summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/ffmpeg
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-08-08 14:30:41 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-08-12 13:49:54 +0200
commitab0a50979b9eb4dfa3320eff7e187e41efedf7a9 (patch)
tree498dfb8a97ff3361a9f7486863a52bb4e26bb898 /chromium/third_party/ffmpeg
parent4ce69f7403811819800e7c5ae1318b2647e778d1 (diff)
Update Chromium to beta version 37.0.2062.68
Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/third_party/ffmpeg')
-rw-r--r--chromium/third_party/ffmpeg/BUILD.gn395
-rw-r--r--chromium/third_party/ffmpeg/Changelog55
-rw-r--r--chromium/third_party/ffmpeg/LICENSE2
-rw-r--r--chromium/third_party/ffmpeg/MAINTAINERS30
-rw-r--r--chromium/third_party/ffmpeg/Makefile28
-rw-r--r--chromium/third_party/ffmpeg/PRESUBMIT.py33
-rw-r--r--chromium/third_party/ffmpeg/README.chromium29
-rw-r--r--chromium/third_party/ffmpeg/RELEASE2
-rw-r--r--chromium/third_party/ffmpeg/arch.mak3
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/binaries/c99conv.exebin1652224 -> 0 bytes
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h (renamed from chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/config.h)468
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/avconfig.h (renamed from chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/libavutil/avconfig.h)3
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h342
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h342
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm336
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h340
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/config.h372
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm338
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h342
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/config.asm334
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/config.h340
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm334
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h340
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/config.asm1645
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/libavutil/avconfig.h8
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/config.asm1645
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/config.h1661
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm366
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h372
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm368
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h374
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h340
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h340
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm334
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h338
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/config.h370
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm336
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h340
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h (renamed from chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/ia32/config.h)462
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/avconfig.h (renamed from chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/ia32/libavutil/avconfig.h)3
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h336
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h336
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm330
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h334
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/config.h366
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm332
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h336
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/config.asm328
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/config.h334
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm328
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h334
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/ia32/config.asm1645
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/config.asm1645
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/config.h1661
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/libavutil/avconfig.h8
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm362
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h368
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm362
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h368
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/config.h336
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/config.h336
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.asm330
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.h334
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/config.h366
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.asm332
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.h336
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/libavutil/avconfig.h1
-rw-r--r--chromium/third_party/ffmpeg/chromium/ffmpegsumo.sigs29
-rw-r--r--chromium/third_party/ffmpeg/chromium/patches/README32
-rw-r--r--chromium/third_party/ffmpeg/chromium/patches/to_upstream/unblock_windows_build.patch12
-rw-r--r--chromium/third_party/ffmpeg/chromium/patches/to_upstream/uninitcond_dct_token_vp3_dequant.patch13
-rw-r--r--chromium/third_party/ffmpeg/chromium/patches/ugly/compile_with_no_iconv.patch15
-rw-r--r--chromium/third_party/ffmpeg/chromium/patches/ugly/disable_pix_fmt_desc_api.patch34
-rw-r--r--chromium/third_party/ffmpeg/chromium/patches/ugly/undeprecate_destruct_packet_api.patch72
-rw-r--r--chromium/third_party/ffmpeg/chromium/patches/ugly/w32pthreads_xp_fixes_and_vp8_workaround.patch (renamed from chromium/third_party/ffmpeg/chromium/patches/to_upstream/w32pthreads_xp_fixes_and_vp8_workaround.patch)0
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py462
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.sh457
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/c99conv.py92
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/copy_config.sh2
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/cygwin-wrapper84
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/generate_gyp.py210
-rwxr-xr-x[-rw-r--r--]chromium/third_party/ffmpeg/chromium/scripts/generate_libs.py0
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/make_src_tree.sh47
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/sync_svn.py105
-rw-r--r--chromium/third_party/ffmpeg/cmdutils.c25
-rw-r--r--chromium/third_party/ffmpeg/cmdutils.h4
-rw-r--r--chromium/third_party/ffmpeg/cmdutils_common_opts.h1
-rw-r--r--chromium/third_party/ffmpeg/common.mak6
-rw-r--r--chromium/third_party/ffmpeg/compat/avisynth/avisynth_c.h3
-rw-r--r--chromium/third_party/ffmpeg/compat/avisynth/avxsynth_c.h3
-rw-r--r--chromium/third_party/ffmpeg/compat/float/float.h35
-rw-r--r--chromium/third_party/ffmpeg/compat/float/limits.h (renamed from chromium/third_party/ffmpeg/libavcodec/bfin/vp3_bfin.h)13
-rw-r--r--chromium/third_party/ffmpeg/compat/va_copy.h3
-rwxr-xr-xchromium/third_party/ffmpeg/configure1197
-rw-r--r--chromium/third_party/ffmpeg/doc/APIchanges238
-rw-r--r--chromium/third_party/ffmpeg/doc/Doxyfile6
-rw-r--r--chromium/third_party/ffmpeg/doc/Makefile14
-rw-r--r--chromium/third_party/ffmpeg/doc/RELEASE_NOTES2
-rw-r--r--chromium/third_party/ffmpeg/doc/bitstream_filters.texi2
-rw-r--r--chromium/third_party/ffmpeg/doc/codecs.texi14
-rw-r--r--chromium/third_party/ffmpeg/doc/decoders.texi33
-rw-r--r--chromium/third_party/ffmpeg/doc/demuxers.texi30
-rw-r--r--chromium/third_party/ffmpeg/doc/developer.texi4
-rw-r--r--chromium/third_party/ffmpeg/doc/devices.texi4
-rwxr-xr-xchromium/third_party/ffmpeg/doc/doxy-wrapper.sh1
-rw-r--r--chromium/third_party/ffmpeg/doc/doxy/doxy_stylesheet.css2019
-rw-r--r--chromium/third_party/ffmpeg/doc/doxy/footer.html9
-rw-r--r--chromium/third_party/ffmpeg/doc/doxy/header.html16
-rw-r--r--chromium/third_party/ffmpeg/doc/encoders.texi209
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/Makefile7
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/avio_reading.c134
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/decoding_encoding.c58
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/demuxing_decoding.c10
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/filter_audio.c364
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/filtering_audio.c4
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/filtering_video.c4
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/metadata.c2
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/muxing.c230
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/remuxing.c165
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/resampling_audio.c6
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/scaling_video.c2
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/transcode_aac.c5
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/transcoding.c597
-rw-r--r--chromium/third_party/ffmpeg/doc/faq.texi20
-rw-r--r--chromium/third_party/ffmpeg/doc/ffmpeg-resampler.texi2
-rw-r--r--chromium/third_party/ffmpeg/doc/ffmpeg-scaler.texi2
-rw-r--r--chromium/third_party/ffmpeg/doc/ffmpeg.texi89
-rw-r--r--chromium/third_party/ffmpeg/doc/ffplay.texi9
-rw-r--r--chromium/third_party/ffmpeg/doc/ffprobe.texi1
-rw-r--r--chromium/third_party/ffmpeg/doc/ffprobe.xsd2
-rw-r--r--chromium/third_party/ffmpeg/doc/ffserver.conf10
-rw-r--r--chromium/third_party/ffmpeg/doc/ffserver.texi32
-rw-r--r--chromium/third_party/ffmpeg/doc/fftools-common-opts.texi11
-rw-r--r--chromium/third_party/ffmpeg/doc/filters.texi1577
-rw-r--r--chromium/third_party/ffmpeg/doc/formats.texi36
-rw-r--r--chromium/third_party/ffmpeg/doc/general.texi85
-rw-r--r--chromium/third_party/ffmpeg/doc/git-howto.texi2
-rw-r--r--chromium/third_party/ffmpeg/doc/indevs.texi138
-rw-r--r--chromium/third_party/ffmpeg/doc/muxers.texi224
-rw-r--r--chromium/third_party/ffmpeg/doc/optimization.txt14
-rw-r--r--chromium/third_party/ffmpeg/doc/outdevs.texi146
-rw-r--r--chromium/third_party/ffmpeg/doc/platform.texi7
-rw-r--r--chromium/third_party/ffmpeg/doc/protocols.texi240
-rw-r--r--chromium/third_party/ffmpeg/doc/scaler.texi10
-rw-r--r--[-rwxr-xr-x]chromium/third_party/ffmpeg/doc/texi2pod.pl21
-rw-r--r--chromium/third_party/ffmpeg/doc/utils.texi2
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg.c716
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg.gyp129
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg.h37
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_dxva2.c620
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_filter.c15
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_generated.gni468
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_generated.gypi1069
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_opt.c90
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_options.gni43
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_vda.c134
-rw-r--r--chromium/third_party/ffmpeg/ffplay.c87
-rw-r--r--chromium/third_party/ffmpeg/ffprobe.c53
-rw-r--r--chromium/third_party/ffmpeg/ffserver.c332
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/4xm.c136
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/8bps.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/Makefile117
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/a64multienc.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aac_adtstoasc_bsf.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacadtsdec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacdec.c78
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacps.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aactab.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aactab.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/Makefile28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/asm-offsets.h30
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/cabac.h104
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/fft_init_aarch64.c47
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/fft_neon.S442
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/h264chroma_init_aarch64.c59
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/h264cmc_neon.S402
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/h264dsp_init_aarch64.c101
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/h264dsp_neon.S498
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/h264idct_neon.S408
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/h264qpel_init_aarch64.c172
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/h264qpel_neon.S934
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/hpeldsp_init_aarch64.c123
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/hpeldsp_neon.S397
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/mdct_neon.S323
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/mpegaudiodsp_init.c39
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/mpegaudiodsp_neon.S226
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/neon.S149
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/neontest.c79
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/opus_imdct_init.c45
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/opus_imdct_neon.S647
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/rv40dsp_init_aarch64.c48
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/vc1dsp_init_aarch64.c47
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/videodsp.S28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/videodsp_init.c32
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/vorbisdsp_init.c34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/vorbisdsp_neon.S82
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3.h84
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3_parser.c27
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3_parser.h5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3dec.c311
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3dec.h42
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3dec_fixed.c176
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3dec_float.c89
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3dsp.c28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3dsp.h5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3enc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3enc.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3enc_fixed.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3enc_float.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3enc_template.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3tab.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3tab.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/adpcm.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/adpcm_data.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/adpcm_data.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/adx.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/adxdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aic.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/alac.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aliaspixdec.c128
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aliaspixenc.c134
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/allcodecs.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/alsdec.c26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ansi.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/apedec.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/Makefile56
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/asm-offsets.h19
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/cabac.h108
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/dca.h23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_init_arm.c26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_neon.S48
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_vfp.S39
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/dsputil_arm.S7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/dsputil_arm.h16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_arm.c38
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_armv5te.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_armv6.c40
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_neon.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/fft_fixed_init_arm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/fft_fixed_neon.S2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/flacdsp_init_arm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/fmtconvert_neon.S2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/h264cmc_neon.S13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/h264dsp_init_arm.c46
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/h264idct_neon.S16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/h264pred_init_arm.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_arm.S26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_arm.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_armv6.S14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_init_arm.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/int_neon.S18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/mdct_neon.S2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_armv5te.S655
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_armv6.S533
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_init_arm.c146
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_arm.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_arm.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_neon.S2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/neontest.c79
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/simple_idct_arm.S1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/startcode_armv6.S (renamed from chromium/third_party/ffmpeg/libavcodec/arm/h264dsp_armv6.S)6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp.h (renamed from chromium/third_party/ffmpeg/libavcodec/sh4/dsputil_sh4.h)12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_init_arm.c36
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_init_neon.c119
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_neon.S1170
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/videodsp_armv5te.S4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vp3dsp_init_arm.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vp3dsp_neon.S2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vp8.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_armv6.S24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_arm.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_armv6.c47
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_neon.c45
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_neon.S117
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac1data.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac3plus.c1818
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac3plus.h240
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac3plus_data.h1914
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac3plusdec.c396
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac3plusdsp.c638
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avcodec.h295
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avfft.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avpacket.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/Makefile20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/dsputil.S (renamed from chromium/third_party/ffmpeg/libavcodec/bfin/pixels_bfin.S)3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_bfin.c173
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_bfin.h95
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_init.c195
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/fdct_bfin.S17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/hpel_pixels_no_rnd.S81
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_bfin.c123
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_bfin.h50
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_init.c146
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/idct_bfin.S13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/mpegvideo_bfin.c152
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/pixels.S (renamed from chromium/third_party/ffmpeg/libavcodec/bfin/hpel_pixels_bfin.S)176
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/pixels.h42
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/vp3dsp.S (renamed from chromium/third_party/ffmpeg/libavcodec/bfin/vp3_idct_bfin.S)13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfin/vp3dsp_init.c (renamed from chromium/third_party/ffmpeg/libavcodec/bfin/vp3_bfin.c)11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bink.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/binkaudio.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/binkdsp.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bit_depth_template.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bitstream.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bmp.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bmp_parser.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/brender_pix.c216
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/brenderpix.c292
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bytestream.h26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cabac.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cabac.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cabac_functions.h7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cavs.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cavsdec.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cavsdsp.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cinepakenc.c1335
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cllc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cngdec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cngenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/codec_desc.c661
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cook.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/copy_block.h47
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cos_tablegen.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cpia.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dca.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dcadata.h387
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dcadec.c118
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dcadsp.c54
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dcadsp.h11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dcaenc.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dct-test.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dct.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dfa.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dirac_arith.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dirac_dwt.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dirac_dwt.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/diracdec.c157
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dnxhd_parser.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dnxhddata.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dnxhddata.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dnxhddec.c169
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dnxhdenc.c494
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dnxhdenc.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dpx.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dsd_tablegen.c38
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dsd_tablegen.h95
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dsddec.c167
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dsputil.c3471
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dsputil.h255
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dsputil_template.c408
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dsputilenc_template.c51
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dv.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dvbsub.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dvbsubdec.c29
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dvdata.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dvdata.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dvdsubdec.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dvdsubenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dvenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxa.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxtory.c575
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxva2.c66
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxva2.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxva2_h264.c47
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxva2_internal.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxva2_vc1.c50
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/eac3dec.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/eacmv.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/eamad.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/eatgv.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/elbg.c34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/error_resilience.c282
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/error_resilience.h22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/evrcdata.h8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/evrcdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/exif.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/exif.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/exr.c888
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/faxcompr.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft-fixed-test.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft-fixed32-test.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft-internal.h10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft-test.c28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft.h19
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft_fixed.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft_fixed_32.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft_float.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft_table.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft_template.c23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffv1.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffv1.h8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffv1dec.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffv1enc.c65
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fic.c459
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flac_parser.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flacdec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flacdsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flacdsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flacdsp_lpc_template.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flacenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flashsv.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flashsv2enc.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flvdec.c44
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/frame_thread_encoder.c27
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fraps.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g2meet.c174
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g723_1.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g729postfilter.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/get_bits.h24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/gifdec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/golomb.h12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h261data.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h261dec.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h261enc.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h263.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h263dec.c40
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264.c3749
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264.h143
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_cabac.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_cavlc.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_direct.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_loopfilter.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_mb.c820
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_mb_template.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_mc_template.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_mvpred.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_parser.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_picture.c211
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_ps.c60
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_refs.c212
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_sei.c60
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_slice.c2565
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264chroma.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264chroma.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264chroma_template.c43
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264data.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264dsp.c44
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264dsp.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264idct_template.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264pred.c42
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264pred.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264pred_template.c75
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264qpel.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264qpel.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264qpel_template.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc.c877
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc.h118
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_cabac.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_filter.c368
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_mvs.c117
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_ps.c104
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_refs.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_sei.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevcdsp.c131
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevcdsp.h122
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevcdsp_template.c1117
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevcpred_template.c391
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hnm4video.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hpel_template.c148
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hpeldsp.c307
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hpeldsp.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hpeldsp_template.c254
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/huffman.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/huffman.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/huffyuv.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/huffyuv.h27
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/huffyuvdec.c447
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/huffyuvenc.c437
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/iff.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/imgconvert.c193
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/imgconvert.h18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/indeo3.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/indeo4data.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/indeo5.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/intelh263dec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/internal.h39
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/interplayvideo.c25
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/intrax8.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ituh263dec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ituh263enc.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ivi_common.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/j2kenc.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c29
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpegls.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeglsdec.c60
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jvdec.c44
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/kbdwin.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/kbdwin.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/kgv1dec.c45
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lagarith.c38
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libfdk-aacdec.c32
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c50
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libopencore-amr.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libopenjpegdec.c181
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libopenjpegenc.c52
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libopusdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libspeexdec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libstagefright.cpp2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libtwolame.c167
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libutvideodec.cpp4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libutvideoenc.cpp10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvorbisenc.c42
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvpx.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvpx.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvpxdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvpxenc.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libwebpenc.c285
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libx264.c106
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libx265.c313
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libxavs.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libxvid.c31
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libzvbi-teletextdec.c158
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ljpegenc.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lossless_videodsp.c128
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lossless_videodsp.h40
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lzw.c29
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lzwenc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mace.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mathops.h13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mathtables.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mdct_fixed.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mdct_fixed_32.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mdct_float.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mdct_template.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mdec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/metasound.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpeg.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegbdec.c19
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegdec.c325
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegdec.h11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegenc.c79
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegenc.h5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlp.h10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlp_parser.c23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlp_parser.h5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlpdec.c152
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlpdsp.c73
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlpdsp.h46
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motion_est.c35
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motion_est_template.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motionpixels.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motionpixels_tablegen.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motionpixels_tablegen.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpc8.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg12.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg12dec.c1020
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg12enc.c56
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg4video.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg4video_parser.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg4videodec.c32
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg4videoenc.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_template.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudiodecheader.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudiodecheader.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudiodsp.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudiodsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudioenc_template.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegutils.c80
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegutils.h127
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo.c1031
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo.h156
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo_enc.c382
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo_motion.c93
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo_xvmc.c66
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/msmpeg4.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/msmpeg4dec.c28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/msrle.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss1.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss12.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss12.h14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss2.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss3.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss4.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/msvideo1.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/msvideo1enc.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mvcdec.c140
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mxpegdec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/nellymoserenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/nuv.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/on2avc.c1015
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/on2avcdata.c9383
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/on2avcdata.h82
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/options.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/options_table.h15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opus.c428
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opus.h411
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opus_celt.c2221
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opus_imdct.c272
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opus_imdct.h57
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opus_parser.c75
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opus_silk.c1597
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opusdec.c673
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/paf.c251
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/parser.c205
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pcm-dvd.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pgssubdec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pixels.h37
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/png.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/png_parser.c49
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pngdec.c189
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pngdsp.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pngenc.c167
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/Makefile12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_altivec.c1166
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_altivec.h11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_ppc.c165
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/fdct_altivec.c396
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/fft_altivec.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/gmc_altivec.c138
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/h264chroma_init.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/h264dsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/h264qpel.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/hpeldsp_altivec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/hpeldsp_altivec.h34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/idct_altivec.c313
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/int_altivec.c113
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/mpegvideo_altivec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/vc1dsp_altivec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/vp3dsp_altivec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/proresdsp.c34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/proresdsp.h5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/proresenc_kostya.c50
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/psymodel.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pthread_frame.c30
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/put_bits.h7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qcelpdata.h28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qcelpdec.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qtrleenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ra144.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ra144.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ra144dec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ra144enc.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ratecontrol.c34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ratecontrol.h8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/raw.c43
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/raw.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rawdec.c129
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rawenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rnd_avg.h10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/roqvideo.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/roqvideodec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/roqvideoenc.c53
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rpza.c76
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rtjpeg.c29
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rtjpeg.h9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv10.c143
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv30.c47
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv30data.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv30dsp.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv34.c23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv34.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv34dsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv40.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv40dsp.c99
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/s302menc.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sanm.c506
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sanm_data.h248
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sbrdsp.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sgi.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sgidec.c78
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sgienc.c36
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sgirledec.c65
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sh4/Makefile2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sh4/README6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sh4/dsputil_sh4.c107
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sh4/idct_sh4.c210
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sh4/sh4.h44
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/shorten.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/simple_idct.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/simple_idct_template.c26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/smacker.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/smvjpegdec.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snow.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snow.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snow_dwt.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snow_dwt.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snowdec.c33
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snowenc.c43
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sonic.c167
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sp5xdec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sparc/Makefile4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sparc/README6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sparc/hpeldsp_vis.c3524
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sparc/simple_idct_vis.c531
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sparc/vis.h264
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/startcode.c57
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/startcode.h35
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/svq1enc.c38
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/svq3.c107
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/svq3.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/synth_filter.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/synth_filter.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/takdec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tiff.c285
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tiff.h20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tiff_common.c32
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tiff_common.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tiffenc.c25
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tpel_template.c80
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tpeldsp.c333
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tpeldsp.h59
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/truemotion1.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/truemotion2.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tscc2.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tta.c42
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ttadsp.c57
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ttadsp.h34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ttaenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/utils.c422
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/utvideodec.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/utvideoenc.c54
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_h264.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_internal.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_vc1.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vble.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1.c94
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1.h17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1_parser.c284
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1dec.c297
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1dsp.c831
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1dsp.h15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vda.c72
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vda.h75
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vda_h264.c308
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vda_h264_dec.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vda_internal.h33
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau.c59
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau_h264.c44
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau_vc1.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/version.h28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/videodsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/videodsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/videodsp_template.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vima.c123
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vmdav.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vmnc.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vorbis.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vorbisdec.c56
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vorbisdsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vorbisdsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vorbisenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp3.c1538
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp3_parser.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp3data.h5846
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp3dsp.c142
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp5.c26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp56.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp56.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp6.c30
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp8.c1916
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp8.h53
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp8_parser.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp8data.h339
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp8dsp.c809
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp8dsp.h17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9.c627
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9_parser.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9dsp.c70
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9dsp.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vqavideo.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wavpack.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/webp.c48
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wma.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmadec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmalosslessdec.c38
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmaprodec.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmv2.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmv2dec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wnv1.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/Makefile46
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/ac3dsp.asm133
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/ac3dsp_init.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/cabac.h14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/cavsdsp.c66
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/constants.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dca.h60
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dcadsp.asm431
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dcadsp_init.c113
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/deinterlace.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc.asm49
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc.c67
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc_init.c (renamed from chromium/third_party/ffmpeg/libavcodec/sparc/dsputil_vis.c)33
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dsputil.asm174
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dsputil_init.c185
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dsputil_mmx.c124
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dsputil_qns_template.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dsputil_x86.h152
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dsputilenc.asm16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dsputilenc_mmx.c1525
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/fdct.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/flacdsp.asm74
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/flacdsp_init.c45
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/fmtconvert.asm11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/fpel.asm11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/fpel.h43
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/fpel_mmx.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h263_loopfilter.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_chromamc.asm5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_chromamc_10bit.asm11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock.asm42
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock_10bit.asm21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_i386.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_idct.asm85
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_idct_10bit.asm24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred.asm96
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred_10bit.asm90
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred_init.c31
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm32
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_weight.asm10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_weight_10bit.asm9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264chroma_init.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264dsp_init.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hevc_mc.asm1256
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hevcdsp.h123
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hevcdsp_init.c377
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.h38
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c47
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_mmx.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_rnd_template.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/idct_sse2_xvid.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/imdct36.asm23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/inline_asm.h100
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp.asm292
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp_init.c62
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/lpc.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mathops.h5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mlpdsp.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/motion_est.c318
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mpeg4qpel.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mpegvideo.c115
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoenc.c133
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/proresdsp.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/qpel.asm11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/rnd_template.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/rv34dsp_init.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/rv40dsp.asm8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/rv40dsp_init.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp.asm30
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp_init.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/simple_idct.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/snowdsp.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/ttadsp.asm119
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/ttadsp_init.c42
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vc1dsp_init.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vc1dsp_mmx.c124
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/videodsp_init.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vorbisdsp_init.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp_init.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp56_arith.h15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp6dsp_init.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp.asm20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp_init.c82
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp_loopfilter.asm10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp9dsp_init.c232
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp9intrapred.asm1405
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp9itxfm.asm1388
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp9lpf.asm817
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp9mc.asm140
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xbmdec.c87
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xsubenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xvmc.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xvmc_internal.h7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xwddec.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/zmbv.c6
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/Makefile10
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/alldevices.c5
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/alsa-audio-dec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/alsa-audio-enc.c27
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/avdevice.c191
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/avdevice.h418
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/avfoundation.m374
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/bktr.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/caca.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/decklink_enc.cpp588
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/decklink_enc.h43
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/decklink_enc_c.c56
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/dshow.c31
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/dshow_capture.h2
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/dshow_enummediatypes.c4
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/dshow_pin.c2
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/dv1394.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/fbdev_common.c62
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/fbdev_common.h4
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/fbdev_dec.c7
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/fbdev_enc.c8
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/gdigrab.c630
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/iec61883.c11
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/jack_audio.c15
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/lavfi.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/libcdio.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/libdc1394.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/openal-dec.c3
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/opengl_enc.c1306
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/opengl_enc_shaders.h188
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/oss_audio.c9
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/pulse_audio_common.c210
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/pulse_audio_common.h10
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/pulse_audio_dec.c37
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/pulse_audio_enc.c742
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/qtkit.m358
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/sdl.c7
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/sndio_dec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/sndio_enc.c8
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/v4l.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/v4l2-common.c6
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/v4l2.c47
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/v4l2enc.c8
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/version.h6
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/vfwcap.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/x11grab.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/xv.c165
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/Makefile29
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/aeval.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_adelay.c1
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_aecho.c1
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_amerge.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_apad.c1
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_aresample.c9
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_ashowinfo.c114
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_atempo.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_bs2b.c222
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_channelmap.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_compand.c232
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_pan.c3
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_resample.c8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_volume.c224
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_volume.h38
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/allfilters.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/audio.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avcodec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c3
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_concat.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avfilter.c30
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avfilter.h24
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avfiltergraph.c5
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/buffer.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/buffersink.c5
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/buffersink.h22
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/buffersrc.c36
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/buffersrc.h22
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/deshake.h9
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/deshake_opencl.c81
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/deshake_opencl.h7
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/deshake_opencl_kernel.h254
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/dualinput.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/f_ebur128.c170
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/f_select.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/fifo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/filtfmts.c12
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/graphdump.c3
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/internal.h8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/lavfutils.c5
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/libmpcodecs/img_format.c11
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/libmpcodecs/img_format.h9
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/libmpcodecs/libvo/video_out.h23
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/libmpcodecs/mp_image.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_eq.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_eq2.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_fspp.c57
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_ilpack.c8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_pp7.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_uspp.c5
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/pthread.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/setpts.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/settb.c (renamed from chromium/third_party/ffmpeg/libavfilter/f_settb.c)8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/src_movie.c35
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/unsharp.h2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/version.h35
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_aspect.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_blackframe.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_boxblur.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_colormatrix.c37
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_copy.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_crop.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_cropdetect.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_curves.c72
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_dejudder.c187
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_delogo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_deshake.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_drawbox.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c226
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_edgedetect.c163
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_elbg.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_fade.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_fieldorder.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_format.c5
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_fps.c15
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_framepack.c363
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_framestep.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_frei0r.c41
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_hflip.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.c5
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.h2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_hue.c14
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_interlace.c66
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_libopencv.c8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_lut.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c135
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_mergeplanes.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_noise.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_overlay.c49
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_pad.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_phase.c51
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_pixdesctest.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_psnr.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_pullup.c42
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_removelogo.c14
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_rotate.c108
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_scale.c34
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_showinfo.c85
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_shuffleplanes.c172
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_subtitles.c78
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_tile.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_tinterlace.c12
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_transpose.c65
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_vflip.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_vidstabdetect.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_vidstabtransform.c62
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_yadif.c143
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vsrc_mandelbrot.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vsrc_testsrc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/Makefile1
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif.asm18
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif_init.c97
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/yadif-10.asm18
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/yadif-16.asm18
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/yadif.h77
-rw-r--r--chromium/third_party/ffmpeg/libavformat/4xm.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/Makefile34
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aacdec.c58
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ac3dec.c17
-rw-r--r--chromium/third_party/ffmpeg/libavformat/adxdec.c7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aiffdec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aiffenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/allformats.c11
-rw-r--r--chromium/third_party/ffmpeg/libavformat/amr.c17
-rw-r--r--chromium/third_party/ffmpeg/libavformat/apc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ape.c12
-rw-r--r--chromium/third_party/ffmpeg/libavformat/apetag.c13
-rw-r--r--chromium/third_party/ffmpeg/libavformat/asf.h3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/asfdec.c69
-rw-r--r--chromium/third_party/ffmpeg/libavformat/asfenc.c90
-rw-r--r--chromium/third_party/ffmpeg/libavformat/assdec.c20
-rw-r--r--chromium/third_party/ffmpeg/libavformat/astenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/audiointerleave.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avformat.h511
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avidec.c218
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avienc.c461
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avio.c45
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avio.h22
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avio_internal.h2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aviobuf.c43
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avisynth.c38
-rw-r--r--chromium/third_party/ffmpeg/libavformat/bink.c34
-rw-r--r--chromium/third_party/ffmpeg/libavformat/cafdec.c8
-rw-r--r--chromium/third_party/ffmpeg/libavformat/cafenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/cinedec.c301
-rw-r--r--chromium/third_party/ffmpeg/libavformat/concatdec.c269
-rw-r--r--chromium/third_party/ffmpeg/libavformat/crcenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dfa.c7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dsfdec.c159
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dvenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dxa.c15
-rw-r--r--chromium/third_party/ffmpeg/libavformat/electronicarts.c12
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ffmdec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/file.c17
-rw-r--r--chromium/third_party/ffmpeg/libavformat/flac_picture.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/flacdec.c54
-rw-r--r--chromium/third_party/ffmpeg/libavformat/flacenc.c44
-rw-r--r--chromium/third_party/ffmpeg/libavformat/flvdec.c34
-rw-r--r--chromium/third_party/ffmpeg/libavformat/flvenc.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/format.c9
-rw-r--r--chromium/third_party/ffmpeg/libavformat/framecrcenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ftp.c10
-rw-r--r--chromium/third_party/ffmpeg/libavformat/gif.c20
-rw-r--r--chromium/third_party/ffmpeg/libavformat/golomb_tab.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/gxf.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/gxfenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/h263dec.c23
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hdsenc.c32
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hevc.c1140
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hevc.h98
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hls.c1453
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hlsenc.c36
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hnm.c13
-rw-r--r--chromium/third_party/ffmpeg/libavformat/http.c391
-rw-r--r--chromium/third_party/ffmpeg/libavformat/httpauth.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/icodec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/icoenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/id3v2.c198
-rw-r--r--chromium/third_party/ffmpeg/libavformat/id3v2.h28
-rw-r--r--chromium/third_party/ffmpeg/libavformat/id3v2enc.c24
-rw-r--r--chromium/third_party/ffmpeg/libavformat/idcin.c9
-rw-r--r--chromium/third_party/ffmpeg/libavformat/idroqenc.c30
-rw-r--r--chromium/third_party/ffmpeg/libavformat/iff.c323
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2.h61
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2_alias_pix.c65
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2_brender_pix.c49
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2dec.c85
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2enc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/internal.h41
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ipmovie.c15
-rw-r--r--chromium/third_party/ffmpeg/libavformat/isom.c31
-rw-r--r--chromium/third_party/ffmpeg/libavformat/isom.h3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/iss.c15
-rw-r--r--chromium/third_party/ffmpeg/libavformat/jvdec.c94
-rw-r--r--chromium/third_party/ffmpeg/libavformat/libmodplug.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/libnut.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/librtmp.c144
-rw-r--r--chromium/third_party/ffmpeg/libavformat/libssh.c237
-rw-r--r--chromium/third_party/ffmpeg/libavformat/loasdec.c27
-rw-r--r--chromium/third_party/ffmpeg/libavformat/lxfdec.c9
-rw-r--r--chromium/third_party/ffmpeg/libavformat/matroska.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/matroskadec.c1130
-rw-r--r--chromium/third_party/ffmpeg/libavformat/matroskaenc.c84
-rw-r--r--chromium/third_party/ffmpeg/libavformat/metadata.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/microdvddec.c44
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mlvdec.c471
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mms.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mmsh.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mmst.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mov.c358
-rw-r--r--chromium/third_party/ffmpeg/libavformat/movenc.c251
-rw-r--r--chromium/third_party/ffmpeg/libavformat/movenc.h3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mp3dec.c213
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mp3enc.c109
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpc8.c14
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpeg.c294
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpeg.h1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpegenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpegts.c1123
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpegts.h10
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpegtsenc.c191
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mtv.c51
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mux.c220
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mvdec.c143
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mvi.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxf.c46
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxf.h29
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxfdec.c275
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxfenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/network.c9
-rw-r--r--chromium/third_party/ffmpeg/libavformat/network.h13
-rw-r--r--chromium/third_party/ffmpeg/libavformat/nistspheredec.c9
-rw-r--r--chromium/third_party/ffmpeg/libavformat/nut.c25
-rw-r--r--chromium/third_party/ffmpeg/libavformat/nut.h4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/nutdec.c140
-rw-r--r--chromium/third_party/ffmpeg/libavformat/nutenc.c162
-rw-r--r--chromium/third_party/ffmpeg/libavformat/nuv.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggdec.c49
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggdec.h3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggenc.c40
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparsecelt.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparseogm.c15
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparseopus.c19
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparseskeleton.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparsetheora.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparsevorbis.c79
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparsevp8.c137
-rw-r--r--chromium/third_party/ffmpeg/libavformat/omadec.c14
-rw-r--r--chromium/third_party/ffmpeg/libavformat/options.c8
-rw-r--r--chromium/third_party/ffmpeg/libavformat/options_table.h12
-rw-r--r--chromium/third_party/ffmpeg/libavformat/paf.c52
-rw-r--r--chromium/third_party/ffmpeg/libavformat/pcm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/pjsdec.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/pmpdec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavformat/psxstr.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/pva.c17
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rawdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rawenc.c41
-rw-r--r--chromium/third_party/ffmpeg/libavformat/replaygain.c125
-rw-r--r--chromium/third_party/ffmpeg/libavformat/replaygain.h38
-rw-r--r--chromium/third_party/ffmpeg/libavformat/riff.c23
-rw-r--r--chromium/third_party/ffmpeg/libavformat/riff.h22
-rw-r--r--chromium/third_party/ffmpeg/libavformat/riffdec.c18
-rw-r--r--chromium/third_party/ffmpeg/libavformat/riffenc.c58
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rl2.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rmdec.c54
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rpl.c9
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rsd.c7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtmppkt.c65
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtmppkt.h2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtmpproto.c36
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpdec.h4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpdec_asf.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpdec_h264.c12
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpdec_xiph.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtsp.c49
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtspcodes.h110
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtspdec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtspenc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/sapenc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/sdp.c18
-rw-r--r--chromium/third_party/ffmpeg/libavformat/sdr2.c121
-rw-r--r--chromium/third_party/ffmpeg/libavformat/segafilm.c49
-rw-r--r--chromium/third_party/ffmpeg/libavformat/segment.c37
-rw-r--r--chromium/third_party/ffmpeg/libavformat/sierravmd.c7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/siff.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/smacker.c8
-rw-r--r--chromium/third_party/ffmpeg/libavformat/smjpegdec.c8
-rw-r--r--chromium/third_party/ffmpeg/libavformat/smush.c50
-rw-r--r--chromium/third_party/ffmpeg/libavformat/spdifenc.c8
-rw-r--r--chromium/third_party/ffmpeg/libavformat/subfile.c147
-rw-r--r--chromium/third_party/ffmpeg/libavformat/swfdec.c20
-rw-r--r--chromium/third_party/ffmpeg/libavformat/swfenc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/takdec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/tcp.c13
-rw-r--r--chromium/third_party/ffmpeg/libavformat/tee.c13
-rw-r--r--chromium/third_party/ffmpeg/libavformat/tls.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/txd.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/udp.c66
-rw-r--r--chromium/third_party/ffmpeg/libavformat/uncodedframecrcenc.c172
-rw-r--r--chromium/third_party/ffmpeg/libavformat/utils.c2156
-rw-r--r--chromium/third_party/ffmpeg/libavformat/vc1test.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/version.h7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/vqf.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wavdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wavenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wc3movie.c7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/webvttdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/westwood_vqa.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wtv.h2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wtv_common.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wtvdec.c23
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wtvenc.c96
-rw-r--r--chromium/third_party/ffmpeg/libavformat/xmv.c8
-rw-r--r--chromium/third_party/ffmpeg/libavformat/xwma.c25
-rw-r--r--chromium/third_party/ffmpeg/libavformat/yuv4mpeg.c1
-rw-r--r--chromium/third_party/ffmpeg/libavresample/Makefile1
-rw-r--r--chromium/third_party/ffmpeg/libavresample/aarch64/Makefile7
-rw-r--r--chromium/third_party/ffmpeg/libavresample/aarch64/asm-offsets.h28
-rw-r--r--chromium/third_party/ffmpeg/libavresample/aarch64/audio_convert_init.c49
-rw-r--r--chromium/third_party/ffmpeg/libavresample/aarch64/audio_convert_neon.S363
-rw-r--r--chromium/third_party/ffmpeg/libavresample/aarch64/neontest.c31
-rw-r--r--chromium/third_party/ffmpeg/libavresample/aarch64/resample_init.c71
-rw-r--r--chromium/third_party/ffmpeg/libavresample/aarch64/resample_neon.S233
-rw-r--r--chromium/third_party/ffmpeg/libavresample/arm/Makefile3
-rw-r--r--chromium/third_party/ffmpeg/libavresample/arm/audio_convert_neon.S4
-rw-r--r--chromium/third_party/ffmpeg/libavresample/arm/neontest.c31
-rw-r--r--chromium/third_party/ffmpeg/libavresample/audio_convert.c2
-rw-r--r--chromium/third_party/ffmpeg/libavresample/audio_convert.h1
-rw-r--r--chromium/third_party/ffmpeg/libavresample/audio_mix.c11
-rw-r--r--chromium/third_party/ffmpeg/libavresample/audio_mix_matrix.c9
-rw-r--r--chromium/third_party/ffmpeg/libavresample/avresample.h8
-rw-r--r--chromium/third_party/ffmpeg/libavresample/internal.h3
-rw-r--r--chromium/third_party/ffmpeg/libavresample/resample.c140
-rw-r--r--chromium/third_party/ffmpeg/libavresample/resample.h29
-rw-r--r--chromium/third_party/ffmpeg/libavresample/resample_template.c72
-rw-r--r--chromium/third_party/ffmpeg/libavresample/utils.c12
-rw-r--r--chromium/third_party/ffmpeg/libavresample/version.h4
-rw-r--r--chromium/third_party/ffmpeg/libavresample/x86/Makefile2
-rw-r--r--chromium/third_party/ffmpeg/libavresample/x86/audio_mix_init.c2
-rw-r--r--chromium/third_party/ffmpeg/libavresample/x86/w64xmmtest.c31
-rw-r--r--chromium/third_party/ffmpeg/libavutil/Makefile8
-rw-r--r--chromium/third_party/ffmpeg/libavutil/aarch64/Makefile4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/aarch64/asm.S70
-rw-r--r--chromium/third_party/ffmpeg/libavutil/aarch64/bswap.h50
-rw-r--r--chromium/third_party/ffmpeg/libavutil/aarch64/cpu.c28
-rw-r--r--chromium/third_party/ffmpeg/libavutil/aarch64/cpu.h (renamed from chromium/third_party/ffmpeg/libavcodec/sparc/dsputil_vis.h)16
-rw-r--r--chromium/third_party/ffmpeg/libavutil/aarch64/float_dsp_init.c69
-rw-r--r--chromium/third_party/ffmpeg/libavutil/aarch64/float_dsp_neon.S202
-rw-r--r--chromium/third_party/ffmpeg/libavutil/aarch64/neontest.h65
-rw-r--r--chromium/third_party/ffmpeg/libavutil/aes.c1
-rw-r--r--chromium/third_party/ffmpeg/libavutil/arm/asm.S17
-rw-r--r--chromium/third_party/ffmpeg/libavutil/arm/float_dsp_init_arm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/arm/intmath.h6
-rw-r--r--chromium/third_party/ffmpeg/libavutil/arm/neontest.h62
-rw-r--r--chromium/third_party/ffmpeg/libavutil/atomic.c8
-rw-r--r--chromium/third_party/ffmpeg/libavutil/atomic.h7
-rw-r--r--chromium/third_party/ffmpeg/libavutil/audio_fifo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/avstring.c12
-rw-r--r--chromium/third_party/ffmpeg/libavutil/avstring.h14
-rw-r--r--chromium/third_party/ffmpeg/libavutil/avutil.h17
-rw-r--r--chromium/third_party/ffmpeg/libavutil/base64.c1
-rw-r--r--chromium/third_party/ffmpeg/libavutil/bfin/asm.h (renamed from chromium/third_party/ffmpeg/libavcodec/bfin/config_bfin.h)45
-rw-r--r--chromium/third_party/ffmpeg/libavutil/bfin/attributes.h (renamed from chromium/third_party/ffmpeg/libavcodec/x86/rnd_mmx.c)27
-rw-r--r--chromium/third_party/ffmpeg/libavutil/bswap.h4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/channel_layout.h4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/cpu.c34
-rw-r--r--chromium/third_party/ffmpeg/libavutil/cpu.h4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/cpu_internal.h1
-rw-r--r--chromium/third_party/ffmpeg/libavutil/crc.c41
-rw-r--r--chromium/third_party/ffmpeg/libavutil/crc.h1
-rw-r--r--chromium/third_party/ffmpeg/libavutil/dict.c52
-rw-r--r--chromium/third_party/ffmpeg/libavutil/dict.h43
-rw-r--r--chromium/third_party/ffmpeg/libavutil/downmix_info.c38
-rw-r--r--chromium/third_party/ffmpeg/libavutil/downmix_info.h114
-rw-r--r--chromium/third_party/ffmpeg/libavutil/dynarray.h70
-rw-r--r--chromium/third_party/ffmpeg/libavutil/eval.c1
-rw-r--r--chromium/third_party/ffmpeg/libavutil/fifo.c12
-rw-r--r--chromium/third_party/ffmpeg/libavutil/fifo.h10
-rw-r--r--chromium/third_party/ffmpeg/libavutil/file_open.c2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/fixed_dsp.c98
-rw-r--r--chromium/third_party/ffmpeg/libavutil/fixed_dsp.h144
-rw-r--r--chromium/third_party/ffmpeg/libavutil/float_dsp.c304
-rw-r--r--chromium/third_party/ffmpeg/libavutil/float_dsp.h5
-rw-r--r--chromium/third_party/ffmpeg/libavutil/frame.c112
-rw-r--r--chromium/third_party/ffmpeg/libavutil/frame.h76
-rw-r--r--chromium/third_party/ffmpeg/libavutil/hash.c35
-rw-r--r--chromium/third_party/ffmpeg/libavutil/hash.h22
-rw-r--r--chromium/third_party/ffmpeg/libavutil/internal.h36
-rw-r--r--chromium/third_party/ffmpeg/libavutil/intfloat_readwrite.c3
-rw-r--r--chromium/third_party/ffmpeg/libavutil/intfloat_readwrite.h4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/log.c187
-rw-r--r--chromium/third_party/ffmpeg/libavutil/log.h31
-rw-r--r--chromium/third_party/ffmpeg/libavutil/macros.h48
-rw-r--r--chromium/third_party/ffmpeg/libavutil/mathematics.c114
-rw-r--r--chromium/third_party/ffmpeg/libavutil/mathematics.h21
-rw-r--r--chromium/third_party/ffmpeg/libavutil/mem.c88
-rw-r--r--chromium/third_party/ffmpeg/libavutil/mem.h19
-rw-r--r--chromium/third_party/ffmpeg/libavutil/opencl.c52
-rw-r--r--chromium/third_party/ffmpeg/libavutil/opencl.h1
-rw-r--r--chromium/third_party/ffmpeg/libavutil/opt.c174
-rw-r--r--chromium/third_party/ffmpeg/libavutil/opt.h100
-rw-r--r--chromium/third_party/ffmpeg/libavutil/parseutils.c6
-rw-r--r--chromium/third_party/ffmpeg/libavutil/pca.c2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/pixdesc.c282
-rw-r--r--chromium/third_party/ffmpeg/libavutil/pixdesc.h50
-rw-r--r--chromium/third_party/ffmpeg/libavutil/pixfmt.h28
-rw-r--r--chromium/third_party/ffmpeg/libavutil/random_seed.c18
-rw-r--r--chromium/third_party/ffmpeg/libavutil/rational.c30
-rw-r--r--chromium/third_party/ffmpeg/libavutil/rational.h11
-rw-r--r--chromium/third_party/ffmpeg/libavutil/replaygain.h51
-rw-r--r--chromium/third_party/ffmpeg/libavutil/samplefmt.c2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/stereo3d.h2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/timer.h20
-rw-r--r--chromium/third_party/ffmpeg/libavutil/timestamp.h4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/utils.c5
-rw-r--r--chromium/third_party/ffmpeg/libavutil/version.h77
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/asm.h42
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/cpu.c22
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/cpu.h6
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/float_dsp.asm93
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/float_dsp_init.c8
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/timer.h1
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/x86inc.asm61
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/x86util.asm52
-rw-r--r--chromium/third_party/ffmpeg/libpostproc/postprocess.c4
-rw-r--r--chromium/third_party/ffmpeg/libpostproc/postprocess_template.c37
-rw-r--r--chromium/third_party/ffmpeg/library.mak13
-rw-r--r--chromium/third_party/ffmpeg/libswresample/arm/Makefile3
-rw-r--r--chromium/third_party/ffmpeg/libswresample/arm/audio_convert_neon.S4
-rw-r--r--chromium/third_party/ffmpeg/libswresample/arm/neontest.c29
-rw-r--r--chromium/third_party/ffmpeg/libswresample/dither.c2
-rw-r--r--chromium/third_party/ffmpeg/libswresample/rematrix.c5
-rw-r--r--chromium/third_party/ffmpeg/libswresample/resample.c35
-rw-r--r--chromium/third_party/ffmpeg/libswresample/resample_template.c60
-rw-r--r--chromium/third_party/ffmpeg/libswresample/swresample.c71
-rw-r--r--chromium/third_party/ffmpeg/libswresample/swresample.h19
-rw-r--r--chromium/third_party/ffmpeg/libswresample/version.h4
-rw-r--r--chromium/third_party/ffmpeg/libswresample/x86/Makefile2
-rw-r--r--chromium/third_party/ffmpeg/libswresample/x86/resample_mmx.h183
-rw-r--r--chromium/third_party/ffmpeg/libswresample/x86/swresample_x86.c10
-rw-r--r--chromium/third_party/ffmpeg/libswresample/x86/w64xmmtest.c29
-rw-r--r--chromium/third_party/ffmpeg/libswscale/Makefile1
-rw-r--r--chromium/third_party/ffmpeg/libswscale/arm/Makefile4
-rw-r--r--chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_16.S80
-rw-r--r--chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_32.S119
-rw-r--r--chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_common.S291
-rw-r--r--chromium/third_party/ffmpeg/libswscale/arm/swscale_unscaled.c79
-rw-r--r--chromium/third_party/ffmpeg/libswscale/bayer_template.c236
-rw-r--r--chromium/third_party/ffmpeg/libswscale/bfin/internal_bfin.S18
-rw-r--r--chromium/third_party/ffmpeg/libswscale/bfin/swscale_bfin.c13
-rw-r--r--chromium/third_party/ffmpeg/libswscale/bfin/yuv2rgb_bfin.c13
-rw-r--r--chromium/third_party/ffmpeg/libswscale/input.c42
-rw-r--r--chromium/third_party/ffmpeg/libswscale/options.c10
-rw-r--r--chromium/third_party/ffmpeg/libswscale/output.c164
-rw-r--r--chromium/third_party/ffmpeg/libswscale/rgb2rgb.c4
-rw-r--r--chromium/third_party/ffmpeg/libswscale/rgb2rgb_template.c2
-rw-r--r--chromium/third_party/ffmpeg/libswscale/sparc/Makefile1
-rw-r--r--chromium/third_party/ffmpeg/libswscale/sparc/yuv2rgb_vis.c212
-rw-r--r--chromium/third_party/ffmpeg/libswscale/swscale.c58
-rw-r--r--chromium/third_party/ffmpeg/libswscale/swscale.h10
-rw-r--r--chromium/third_party/ffmpeg/libswscale/swscale_internal.h61
-rw-r--r--chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c375
-rw-r--r--chromium/third_party/ffmpeg/libswscale/utils.c118
-rw-r--r--chromium/third_party/ffmpeg/libswscale/version.h6
-rw-r--r--chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb.c5
-rw-r--r--chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb_template.c34
-rw-r--r--chromium/third_party/ffmpeg/libswscale/x86/swscale.c11
-rw-r--r--chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c101
-rw-r--r--chromium/third_party/ffmpeg/libswscale/x86/yuv2rgb.c17
-rw-r--r--chromium/third_party/ffmpeg/libswscale/x86/yuv2rgb_template.c16
-rw-r--r--chromium/third_party/ffmpeg/libswscale/yuv2rgb.c2
-rw-r--r--chromium/third_party/ffmpeg/tools/aviocat.c18
-rw-r--r--chromium/third_party/ffmpeg/tools/build_libstagefright4
-rwxr-xr-xchromium/third_party/ffmpeg/tools/dvd2concat127
-rw-r--r--chromium/third_party/ffmpeg/tools/ffhash.c34
-rwxr-xr-xchromium/third_party/ffmpeg/tools/gen-rc121
-rw-r--r--chromium/third_party/ffmpeg/tools/ismindex.c2
-rwxr-xr-xchromium/third_party/ffmpeg/tools/missing_codec_desc1
-rw-r--r--chromium/third_party/ffmpeg/tools/probetest.c5
-rw-r--r--chromium/third_party/ffmpeg/tools/qt-faststart.c47
-rw-r--r--chromium/third_party/ffmpeg/tools/uncoded_frame.c279
-rw-r--r--chromium/third_party/ffmpeg/tools/zmqsend.c20
1447 files changed, 120198 insertions, 58128 deletions
diff --git a/chromium/third_party/ffmpeg/BUILD.gn b/chromium/third_party/ffmpeg/BUILD.gn
new file mode 100644
index 00000000000..d6b3535d067
--- /dev/null
+++ b/chromium/third_party/ffmpeg/BUILD.gn
@@ -0,0 +1,395 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("ffmpeg_options.gni")
+
+# Path to platform configuration files.
+platform_config_root =
+ "chromium/config/$ffmpeg_branding/$os_config/$ffmpeg_arch"
+
+# Stub generator script and signatures of all functions used by Chrome.
+generate_stubs_script = "//tools/generate_stubs/generate_stubs.py"
+
+# Used by ffmpeg_generate_stubs and ffmpeg_generate_def
+sig_files = [ "chromium/ffmpegsumo.sigs" ]
+
+# TODO(ajwong): Should be in ffmpeg_generate_stubs if we could grab the
+# outputs of an action via a function.
+stubs_filename_root = "ffmpeg_stubs"
+
+if (cpu_arch != "arm" && os_config != "linux-noasm") {
+ import("ffmpeg_generated.gni")
+ import("//third_party/yasm/yasm_assemble.gni")
+ yasm_assemble("ffmpeg_yasm") {
+ sources = ffmpeg_yasm_sources
+
+ # Ensure the architecture defines go in the command line before the -P
+ # file below, so don't use defines.
+ yasm_flags = []
+ if (cpu_arch == "x86") {
+ yasm_flags += [ "-DARCH_X86_32" ]
+ } else if (cpu_arch == "x64") {
+ yasm_flags += [ "-DARCH_X86_64" ]
+ }
+
+ defines = [ "PIC" ]
+ include_dirs = [
+ platform_config_root,
+ "libavcodec/x86",
+ "libavutil/x86",
+ ".",
+ ]
+
+ # Disable warnings, prevents log spam for things we won't fix.
+ yasm_flags += [
+ "-w",
+ "-P", rebase_path("$platform_config_root/config.asm", root_build_dir),
+ ]
+
+ if (is_mac) {
+ # Necessary to ensure symbols end up with a _ prefix; added by
+ # yasm_compile.gypi for Windows, but not Mac.
+ defines += [ "PREFIX" ]
+ }
+ }
+}
+
+# FFMpeg is dynamically loaded on all platforms but our code calls it
+# as if it were directly linked. To make this work, the build system needs
+# to generate stubs that indirect into the library calls.
+#
+# On Windows, this script calls the windows stub generator. Otherwise, assume
+# this is a POSIX platform and generate our own wrapper stubs.
+action("ffmpeg_generate_stubs") {
+ extra_header = "chromium/ffmpeg_stub_headers.fragment"
+
+ script = generate_stubs_script
+ sources = sig_files
+ source_prereqs = [ extra_header ]
+
+ if (is_win) {
+ if (build_cpu_arch == "x64") {
+ outfile_type = "windows_lib_x64"
+ } else {
+ outfile_type = "windows_lib"
+ }
+
+ # TODO(ajwong): these need to be in the ffmpeg build.
+ outputs = [
+ "$target_gen_dir/$stubs_filename_root.lib",
+ ]
+
+ args = [
+ # TODO(ajwong): In gyp, this uses different directories for the
+ # windows build. We should think this through.
+ "-i", rebase_path(target_gen_dir, root_build_dir),
+ "-o", rebase_path(target_gen_dir, root_build_dir),
+ "-t", outfile_type,
+ ]
+ } else {
+ # If it's not windows, clearly it must be posix.
+
+ # TODO(ajwong): these need to be included in the ffmpeg build.
+ outputs = [
+ "$target_gen_dir/$stubs_filename_root.cc",
+ "$target_gen_dir/$stubs_filename_root.h",
+ ]
+ args = [
+ # TODO(ajwong): IN gyp, this used to output the .h file into a shared
+ # directory that other targets could reference. The .cc ends up in a
+ # special generated directory that gyp would guaranteed that no one else
+ # could look at. Now we're dumping both into the generated directory.
+ # Verify what the best + simplest behavior is here and use that.
+ "-i", rebase_path(target_gen_dir, root_build_dir),
+ "-o", rebase_path(target_gen_dir, root_build_dir),
+ "-t", "posix_stubs",
+ "-e", rebase_path(extra_header, root_build_dir),
+ "-s", stubs_filename_root,
+ "-p", "third_party/ffmpeg",
+ ]
+ }
+
+ args += rebase_path(sources, root_build_dir)
+}
+
+if (build_ffmpegsumo) {
+ shared_library("ffmpegsumo") {
+ sources = ffmpeg_c_sources + ffmpeg_gas_sources + [
+ "$platform_config_root/config.h",
+ "$platform_config_root/libavutil/avconfig.h",
+ ]
+ include_dirs = [
+ platform_config_root,
+ "."
+ ]
+ defines = [
+ "HAVE_AV_CONFIG_H",
+ "_POSIX_C_SOURCE=200112",
+ "_XOPEN_SOURCE=600",
+ "PIC",
+ # Disable deprecated features which generate spammy warnings.
+ "FF_API_PIX_FMT_DESC=0",
+ "FF_API_OLD_DECODE_AUDIO=0",
+ "FF_API_DESTRUCT_PACKET=0",
+ "FF_API_GET_BUFFER=0",
+ ]
+ cflags = [
+ "-fPIC",
+ "-fomit-frame-pointer",
+ # ffmpeg uses its own deprecated functions.
+ "-Wno-deprecated-declarations",
+ ]
+ if (is_clang) {
+ cflags += [
+ "-Wno-absolute-value",
+ "-Wno-incompatible-pointer-types",
+ "-Wno-logical-op-parentheses",
+ "-Wno-parentheses",
+ "-Wno-pointer-sign",
+ "-Wno-switch",
+ # Don't emit warnings for gcc -f flags clang doesn't implement.
+ "-Qunused-arguments",
+ ]
+ if (ffmpeg_branding == "Chrome" || ffmpeg_branding == "ChromeOS") {
+ cflags += [ "-Wno-attributes" ]
+ }
+ } else {
+ # gcc doesn't have flags for specific warnings, so disable them
+ # all.
+ cflags += [ "-w" ]
+ }
+ if (cpu_arch == "x86") {
+ # Turn off valgrind build option that breaks ffmpeg builds.
+ # TODO(ajwong): The gyp file had special removals for
+ # debug_extra_cflags and release_extra_cflags. Do we care?
+ cflags -= [ "-fno-omit-frame-pointer" ]
+ } else if (cpu_arch == "arm") {
+ # TODO(ihf): See the long comment in build_ffmpeg.sh
+ # We want to be consistent with CrOS and have configured
+ # ffmpeg for thumb. Protect yourself from -marm.
+ cflags -= [ "-marm" ]
+ cflags += [
+ "-mthumb",
+ "-march=armv7-a",
+ "-mtune=cortex-a8",
+ "-mfpu=${arm_fpu}"
+ ]
+ if (arm_float_abi == "hard") {
+ cflags += [ "-DHAVE_VFP_ARGS=1" ]
+ } else {
+ cflags += [ "-DHAVE_VFP_ARGS=0" ]
+ }
+ } else if (cpu_arch == "mipsel") {
+ cflags += [
+ "-mips32",
+ "-EL -Wl,-EL",
+ ]
+ }
+
+ if (is_posix && !is_mac) {
+ defines += [
+ "_ISOC99_SOURCE",
+ "_LARGEFILE_SOURCE",
+ # BUG(ihf): ffmpeg compiles with this define. But according to
+ # ajwong: I wouldn't change _FILE_OFFSET_BITS. That's a scary change
+ # cause it affects the default length of off_t, and fpos_t,
+ # which can cause strange problems if the loading code doesn't
+ # have it set and you start passing FILE*s or file descriptors
+ # between symbol contexts.
+ # "_FILE_OFFSET_BITS=64",
+ ]
+ cflags += [
+ "-std=c99",
+ "-pthread",
+ "-fno-math-errno",
+ "-fno-signed-zeros",
+ "-fno-tree-vectorize",
+ "-fomit-frame-pointer",
+ ]
+ # Ensure the symbols are exported.
+ #
+ # TODO(ajwong): Manually tag the API that we use to be
+ # exported.
+ configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
+ ldflags = [
+ "-Wl,-Bsymbolic",
+ "-L", rebase_path(target_gen_dir, root_build_dir),
+ ]
+ libs = [ "z" ]
+# TODO(ajwong): How to handle openbsd? Especially w/o the is_posix?
+# if (is_openbsd) {
+# # OpenBSD's gcc (4.2.1) does not support this flag
+# cflags -= [ "-fno-signed-zeros" ]
+# }
+ }
+ if (is_mac) {
+ defines += [ "_DARWIN_C_SOURCE" ]
+
+# TODO(ajwong): What does this do in mac? There isn't anything in ffmpeg.gyp that
+# uses mac_real_dsym
+# ['mac_breakpad == 1', {
+# 'variables': {
+# # A real .dSYM is needed for dump_syms to operate on.
+# 'mac_real_dsym': 1,
+# },
+# }],
+ if (cpu_arch != "x64") {
+ # This is needed because even though FFmpeg now builds
+ # with -fPIC, it's not quite a complete PIC build, only
+ # partial :( Thus we need to instruct the linker to allow
+ # relocations for read-only segments for this target to be
+ # able to generated the shared library on Mac.
+ #
+#TODO(ajwong): Check if this can be cpu_arch == "x86"
+ # Note -read_only_relocs cannot be used in x86_64
+ #
+ # This makes Mark sad, but he's okay with it since it is
+ # isolated to this module. When Mark finds this in the
+ # future, and has forgotten this conversation, this
+ # comment should remind him that the world is still nice
+ # and butterflies still exist...as do rainbows, sunshine,
+ # tulips, etc., etc...but not kittens. Those went away
+ # with this flag.
+ ldflags += [
+ "-Wl,-read_only_relocs,suppress",
+ ]
+ }
+# TODO(ajwong): How to handle SDKROOT?
+# 'libraries': [
+# '$(SDKROOT)/usr/lib/libz.dylib',
+# ],
+ # Ensure the symbols are exported.
+ #
+ # TODO(ajwong): Manually tag the API that we use to be exported.
+ if (!is_win) {
+ configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
+ }
+# TODO(ajwong): How to handle @loader_path?
+# 'xcode_settings': {
+# 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
+# }
+ lib_dirs += [ target_gen_dir ]
+ } else if (is_win) {
+# TODO(ajwong):
+# Original conditional
+# ['clang == 1 or (OS == "win" and (MSVS_VERSION == "2013" or MSVS_VERSION == "2013e"))',
+ if (is_clang) {
+ defines += [
+ "inline=__inline",
+ "strtoll=_strtoi64",
+ "_ISOC99_SOURCE",
+ "_LARGEFILE_SOURCE",
+ "HAVE_AV_CONFIG_H",
+ "strtod=avpriv_strtod",
+ "snprintf=avpriv_snprintf",
+ "_snprintf=avpriv_snprintf",
+ "vsnprintf=avpriv_vsnprintf",
+ ]
+ include_dirs += [
+ "chromium/include/win"
+ ]
+ # TODO(dalecurtis): We should fix these. http://crbug.com/154421
+ cflags += [
+ "/wd4996", # 'function': was declared deprecated
+ "/wd4018", # 'expression': signed/unsigned mismatch
+ "/wd4090", # 'operation' : different 'modifier' qualifiers
+ "/wd4305", # 'identifier': truncation from 'type1' to 'type2'
+ "/wd4133", # 'type' : incompatible types - from 'type1' to 'type2'
+ "/wd4146", # unary minus operator applied to unsigned type, result
+ # still unsigned
+ "/wd4554", # 'operator' : check operator precedence for possible
+ # error; use parentheses to clarify precedence
+ "/wd4028", # formal parameter 'number' different from declaration
+ "/wd4334", # 'operator' : result of 32-bit shift implicitly
+ # converted to 64 bits (was 64-bit shift intended?)
+ "/wd4101", # 'identifier' : unreferenced local variable
+ "/wd4102", # 'label' : unreferenced label
+ "/wd4116", # unnamed type definition in parentheses
+ "/wd4307", # 'operator' : integral constant overflow
+ "/wd4273", # 'function' : inconsistent DLL linkage
+ "/wd4005", # 'identifier' : macro redefinition
+ "/wd4056", # overflow in floating point constant arithmetic
+ "/wd4756", # overflow in constant arithmetic
+ ]
+# TODO(ajwong): Verify this is true.
+ # Ignore warnings about a local symbol being inefficiently imported,
+ # upstream is working on a fix.
+ ldflags += [
+ "/ignore:4049", # locally defined symbol 'symbol' imported
+ "/ignore:4217", # locally defined symbol 'symbol' imported in
+ # function 'function'
+ ]
+ if (cpu_arch == "x64") {
+ # TODO(wolenetz): We should fix this. http://crbug.com/171009
+ cflags += [
+ "/wd4267" # Conversion from size_t to 'type'.
+ ]
+ }
+ }
+ deps += [ ":ffmpeg_generate_def" ]
+ }
+
+ if (cpu_arch != "arm" && cpu_arch != "mipsel" && os_config != "linux-noasm") {
+ deps = [ ":ffmpeg_yasm" ]
+ }
+ }
+}
+
+if (is_win) {
+ config("ffmpeg_win_dependent_config") {
+ include_dirs = [
+ "$platform_config_root",
+ "chromium/include/win",
+ ".",
+ ]
+ }
+
+ action("ffmpeg_generate_def") {
+ script = generate_stubs_script
+ sources = sig_files
+ outputs = [ "$target_gen_dir/ffmpegsumo.def" ]
+ args = [
+# TODO(ajwong): This was -i <(INTERMEDIATE_DIR). What next?
+ "-i", target_out_dir,
+ "-o", target_gen_dir,
+ "-t", "windows_def",
+ "-m", "ffmpegsumo.dll",
+ ] + sources
+ }
+
+ group("ffmpeg") {
+ # Adds C99 types for Visual C++.
+ sources = [ "chromium/include/win/inttypes.h" ]
+# TODO(ajwong): Is adding "libs" here necessary necessary on windows?
+ libs = [ "$target_out_dir/ffmpegsumo.lib" ]
+ ldflags += [ "/DELAYLOAD:ffmpegsumo.dll" ]
+ direct_dependent_configs = [ ":ffmpeg_win_dependent_config" ]
+ deps = [ ":ffmpeg_generate_stubs", "ffmpegsumo" ]
+ }
+} else {
+ config("ffmpeg_posix_dependent_config") {
+ include_dirs = [
+ "$platform_config_root",
+ ".",
+ ]
+ }
+ component("ffmpeg") {
+ sources = [
+ "$target_gen_dir/$stubs_filename_root.cc",
+ "$target_gen_dir/$stubs_filename_root.h",
+ ]
+ configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
+ defines = [
+ "__STDC_CONSTANT_MACROS", # FFmpeg uses INT64_C.
+ ]
+
+ include_dirs = [
+ platform_config_root,
+ ".",
+ ]
+
+ direct_dependent_configs = [ ":ffmpeg_posix_dependent_config" ]
+ deps = [ ":ffmpeg_generate_stubs", ":ffmpegsumo" ]
+ }
+}
diff --git a/chromium/third_party/ffmpeg/Changelog b/chromium/third_party/ffmpeg/Changelog
index 45c0ddcac35..f01e7e82949 100644
--- a/chromium/third_party/ffmpeg/Changelog
+++ b/chromium/third_party/ffmpeg/Changelog
@@ -1,7 +1,32 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
-version <next>
+version <next>:
+- AC3 fixed-point decoding
+- shuffleplanes filter
+- subfile protocol
+- Phantom Cine demuxer
+- replaygain data export
+- VP7 video decoder
+- Alias PIX image encoder and decoder
+- Improvments to the BRender PIX image decoder
+- Improvments to the XBM decoder
+- QTKit input device
+- improvments to OpenEXR image decoder
+- support decoding 16-bit RLE SGI images
+- GDI screen grabbing for Windows
+- alternative rendition support for HTTP Live Streaming
+- AVFoundation input device
+- Direct Stream Digital (DSD) decoder
+- Magic Lantern Video (MLV) demuxer
+- On2 AVC (Audio for Video) decoder
+- support for decoding through DXVA2 in ffmpeg
+- libbs2b-based stereo-to-binaural audio filter
+- libx264 reference frames count limiting depending on level
+- native Opus decoder
+
+
+version 2.2:
- HNM version 4 demuxer and video decoder
- Live HDS muxer
@@ -10,10 +35,25 @@ version <next>
- string validation in ffprobe
- support for decoding through VDPAU in ffmpeg (the -hwaccel option)
- complete Voxware MetaSound decoder
-- remove mp3_header_compress bitstream filters
+- remove mp3_header_compress bitstream filter
- Windows resource files for shared libraries
- aeval filter
- stereoscopic 3d metadata handling
+- WebP encoding via libwebp
+- ATRAC3+ decoder
+- VP8 in Ogg demuxing
+- side & metadata support in NUT
+- framepack filter
+- XYZ12 rawvideo support in NUT
+- Exif metadata support in WebP decoder
+- OpenGL device
+- Use metadata_header_padding to control padding in ID3 tags (currently used in
+ MP3, AIFF, and OMA files), FLAC header, and the AVI "junk" block.
+- Mirillis FIC video decoder
+- Support DNx444
+- libx265 encoder
+- dejudder filter
+- Autodetect VDA like all other hardware accelerations
version 2.1:
@@ -75,7 +115,7 @@ version 2.0:
- 10% faster aac encoding on x86 and MIPS
- sine audio filter source
- WebP demuxing and decoding support
-- new ffmpeg options -filter_script and -filter_complex_script, which allow a
+- ffmpeg options -filter_script and -filter_complex_script, which allow a
filtergraph description to be read from a file
- OpenCL support
- audio phaser filter
@@ -83,7 +123,7 @@ version 2.0:
- libquvi demuxer
- uniform options syntax across all filters
- telecine filter
-- new interlace filter
+- interlace filter
- smptehdbars source
- inverse telecine filters (fieldmatch and decimate)
- colorbalance filter
@@ -201,7 +241,7 @@ version 1.1:
- JSON captions for TED talks decoding support
- SOX Resampler support in libswresample
- aselect filter
-- SGI RLE 8-bit decoder
+- SGI RLE 8-bit / Silicon Graphics RLE 8-bit video decoder
- Silicon Graphics Motion Video Compressor 1 & 2 decoder
- Silicon Graphics Movie demuxer
- apad filter
@@ -245,7 +285,9 @@ version 1.0:
- RTMPE protocol support
- RTMPTE protocol support
- showwaves and showspectrum filter
-- LucasArts SMUSH playback support
+- LucasArts SMUSH SANM playback support
+- LucasArts SMUSH VIMA audio decoder (ADPCM)
+- LucasArts SMUSH demuxer
- SAMI, RealText and SubViewer demuxers and decoders
- Heart Of Darkness PAF playback support
- iec61883 device
@@ -369,6 +411,7 @@ version 0.10:
- ffwavesynth decoder
- aviocat tool
- ffeval tool
+- support encoding and decoding 4-channel SGI images
version 0.9:
diff --git a/chromium/third_party/ffmpeg/LICENSE b/chromium/third_party/ffmpeg/LICENSE
index 1840d691794..1f757aa782c 100644
--- a/chromium/third_party/ffmpeg/LICENSE
+++ b/chromium/third_party/ffmpeg/LICENSE
@@ -47,7 +47,6 @@ Specifically, the GPL parts of FFmpeg are
- vf_stereo3d.c
- vf_super2xsai.c
- vf_tinterlace.c
- - vf_yadif.c
- vsrc_mptestsrc.c
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
@@ -80,6 +79,7 @@ The following libraries are under GPL:
- libutvideo
- libvidstab
- libx264
+ - libx265
- libxavs
- libxvid
When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
diff --git a/chromium/third_party/ffmpeg/MAINTAINERS b/chromium/third_party/ffmpeg/MAINTAINERS
index 847d1d60056..490dfb41f3c 100644
--- a/chromium/third_party/ffmpeg/MAINTAINERS
+++ b/chromium/third_party/ffmpeg/MAINTAINERS
@@ -31,7 +31,7 @@ ffprobe:
ffprobe.c Stefano Sabatini
ffserver:
- ffserver.c, ffserver.h Baptiste Coudurier
+ ffserver.c Reynaldo H. Verdejo Pinochet
Commandline utility code:
cmdutils.c, cmdutils.h Michael Niedermayer
@@ -73,6 +73,7 @@ Other:
bprint Nicolas George
bswap.h
des Reimar Doeffinger
+ dynarray.h Nicolas George
eval.c, eval.h Michael Niedermayer
float_dsp Loren Merritt
hash Reimar Doeffinger
@@ -142,6 +143,7 @@ Codecs:
ass* Aurelien Jacobs
asv* Michael Niedermayer
atrac3* Benjamin Larsson
+ atrac3plus* Maxim Poliakovski
bgmc.c, bgmc.h Thilo Borgmann
bink.c Kostya Shishkov
binkaudio.c Peter Ross
@@ -150,6 +152,7 @@ Codecs:
cdxl.c Paul B Mahol
celp_filters.* Vitor Sessak
cinepak.c Roberto Togni
+ cinepakenc.c Rl / Aetey G.T. AB
cljr Alex Beregszaszi
cllc.c Derek Buitenhuis
cook.c, cookdata.h Benjamin Larsson
@@ -163,8 +166,9 @@ Codecs:
dxa.c Kostya Shishkov
eacmv*, eaidct*, eat* Peter Ross
exif.c, exif.h Thilo Borgmann
- ffv1.c Michael Niedermayer
+ ffv1* Michael Niedermayer
ffwavesynth.c Nicolas George
+ fic.c Derek Buitenhuis
flac* Justin Ruggles
flashsv* Benjamin Larsson
flicvideo.c Mike Melanson
@@ -199,6 +203,7 @@ Codecs:
libvorbis.c David Conrad
libvpx* James Zern
libx264.c Mans Rullgard, Jason Garrett-Glaser
+ libx265.c Derek Buitenhuis
libxavs.c Stefan Gehrer
libzvbi-teletextdec.c Marton Balint
loco.c Kostya Shishkov
@@ -238,7 +243,7 @@ Codecs:
smacker.c Kostya Shishkov
smc.c Mike Melanson
smvjpegdec.c Ash Hughes
- snow.c Michael Niedermayer, Loren Merritt
+ snow* Michael Niedermayer, Loren Merritt
sonic.c Alex Beregszaszi
srt* Aurelien Jacobs
sunrast.c Ivo van Poorten
@@ -299,15 +304,20 @@ libavdevice
libavdevice/avdevice.h
- dshow.c Roger Pack
+ avfoundation.m Thilo Borgmann
+ dshow.c Roger Pack (CC rogerdpack@gmail.com)
fbdev_enc.c Lukasz Marek
+ gdigrab.c Roger Pack (CC rogerdpack@gmail.com)
iec61883.c Georg Lippitsch
lavfi Stefano Sabatini
libdc1394.c Roman Shaposhnik
+ opengl_enc.c Lukasz Marek
pulse_audio_enc.c Lukasz Marek
+ qtkit.m Thilo Borgmann
sdl Stefano Sabatini
v4l2.c Luca Abeni
vfwcap.c Ramiro Polla
+ xv.c Lukasz Marek
libavfilter
===========
@@ -332,6 +342,7 @@ Filters:
avf_avectorscope.c Paul B Mahol
vf_blend.c Paul B Mahol
vf_colorbalance.c Paul B Mahol
+ vf_dejudder.c Nicholas Robbins
vf_delogo.c Jean Delvare (CC <khali@linux-fr.org>)
vf_drawbox.c/drawgrid Andrey Utkin
vf_extractplanes.c Paul B Mahol
@@ -388,6 +399,7 @@ Muxers/Demuxers:
flvdec.c, flvenc.c Michael Niedermayer
gxf.c Reimar Doeffinger
gxfenc.c Baptiste Coudurier
+ hls.c Anssi Hannula
idcin.c Mike Melanson
idroqdec.c Mike Melanson
iff.c Jaikrishnan Menon
@@ -414,14 +426,15 @@ Muxers/Demuxers:
mpc.c Kostya Shishkov
mpeg.c Michael Niedermayer
mpegenc.c Michael Niedermayer
- mpegts* Baptiste Coudurier
+ mpegts.c Marton Balint
+ mpegtsenc.c Baptiste Coudurier
msnwc_tcp.c Ramiro Polla
mtv.c Reynaldo H. Verdejo Pinochet
mxf* Baptiste Coudurier
mxfdec.c Tomas Härdin
nistspheredec.c Paul B Mahol
nsvdec.c Francois Revol
- nut.c Michael Niedermayer
+ nut* Michael Niedermayer
nuv.c Reimar Doeffinger
oggdec.c, oggdec.h David Conrad
oggenc.c Baptiste Coudurier
@@ -447,6 +460,7 @@ Muxers/Demuxers:
siff.c Kostya Shishkov
smacker.c Kostya Shishkov
smjpeg* Paul B Mahol
+ spdif* Anssi Hannula
srtdec.c Aurelien Jacobs
swf.c Baptiste Coudurier
takdec.c Paul B Mahol
@@ -496,6 +510,8 @@ Amiga / PowerPC Colin Ward
Linux / PowerPC Luca Barbato
Windows MinGW Alex Beregszaszi, Ramiro Polla
Windows Cygwin Victor Paesa
+Windows MSVC Matthew Oliver
+Windows ICL Matthew Oliver
ADI/Blackfin DSP Marc Hoffman
Sparc Roman Shaposhnik
x86 Michael Niedermayer
@@ -504,8 +520,8 @@ x86 Michael Niedermayer
Releases
========
+2.2 Michael Niedermayer
2.1 Michael Niedermayer
-2.0 Michael Niedermayer
1.2 Michael Niedermayer
If you want to maintain an older release, please contact us
diff --git a/chromium/third_party/ffmpeg/Makefile b/chromium/third_party/ffmpeg/Makefile
index 7317f254fba..86b3508425a 100644
--- a/chromium/third_party/ffmpeg/Makefile
+++ b/chromium/third_party/ffmpeg/Makefile
@@ -4,6 +4,7 @@ include config.mak
vpath %.c $(SRC_PATH)
vpath %.cpp $(SRC_PATH)
vpath %.h $(SRC_PATH)
+vpath %.m $(SRC_PATH)
vpath %.S $(SRC_PATH)
vpath %.asm $(SRC_PATH)
vpath %.rc $(SRC_PATH)
@@ -29,19 +30,23 @@ $(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog)-$(CONFIG_OPENCL) += cmdutils_o
OBJS-ffmpeg += ffmpeg_opt.o ffmpeg_filter.o
OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
+OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
+OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_vda.o
+
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
-TOOLS = qt-faststart trasher
+TOOLS = qt-faststart trasher uncoded_frame
TOOLS-$(CONFIG_ZLIB) += cws2fws
-FFLIBS-$(CONFIG_AVDEVICE) += avdevice
-FFLIBS-$(CONFIG_AVFILTER) += avfilter
-FFLIBS-$(CONFIG_AVFORMAT) += avformat
+# $(FFLIBS-yes) needs to be in linking order
+FFLIBS-$(CONFIG_AVDEVICE) += avdevice
+FFLIBS-$(CONFIG_AVFILTER) += avfilter
+FFLIBS-$(CONFIG_AVFORMAT) += avformat
+FFLIBS-$(CONFIG_AVCODEC) += avcodec
FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
-FFLIBS-$(CONFIG_AVCODEC) += avcodec
-FFLIBS-$(CONFIG_POSTPROC) += postproc
-FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
-FFLIBS-$(CONFIG_SWSCALE) += swscale
+FFLIBS-$(CONFIG_POSTPROC) += postproc
+FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
+FFLIBS-$(CONFIG_SWSCALE) += swscale
FFLIBS := avutil
@@ -61,6 +66,8 @@ $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
$(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS)
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
+tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
+tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
config.h: .config
.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
@@ -70,9 +77,8 @@ config.h: .config
SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
- ARMV5TE-OBJS ARMV6-OBJS VFP-OBJS NEON-OBJS \
- ALTIVEC-OBJS VIS-OBJS \
- MMX-OBJS YASM-OBJS \
+ ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
+ ALTIVEC-OBJS MMX-OBJS YASM-OBJS \
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS \
OBJS SLIBOBJS HOSTOBJS TESTOBJS
diff --git a/chromium/third_party/ffmpeg/PRESUBMIT.py b/chromium/third_party/ffmpeg/PRESUBMIT.py
index 253e9905585..98ad5ea56ac 100644
--- a/chromium/third_party/ffmpeg/PRESUBMIT.py
+++ b/chromium/third_party/ffmpeg/PRESUBMIT.py
@@ -5,8 +5,7 @@
"""Presubmit script for FFmpeg repository.
Does the following:
-- Displays a message indicating that all changes must be pushed to SVN.
-- Prevents changes inside the git-svn and svn repositories.
+- Warns users that changes must be submitted via Gerrit.
- Warns users when a change is made without updating the README file.
"""
@@ -23,38 +22,19 @@ def Color(color, string):
return ''.join([color, string, '\033[m'])
-def _CheckForMainRepository(input_api, output_api):
- """Ensure no commits are allowed to the Subversion repository."""
- try:
- stdout = subprocess.Popen('git config --get remote.origin.url', shell=True,
- cwd=input_api.PresubmitLocalPath(),
- stdout=subprocess.PIPE).communicate()[0]
- if 'chromium/third_party/ffmpeg.git' in stdout:
- return []
- except Exception, e:
- # Not everyone has a working Git configuration, so print the exception text
- # and move on.
- print e
-
- return [output_api.PresubmitError('\n'.join([
- 'Commits to the FFmpeg repository must be made through Git. The easiest',
- 'way to do this is to switch to using NewGit:\n',
- ' http://code.google.com/p/chromium/wiki/UsingNewGit\n',
- 'Alternatively, you can clone the repository directly using:\n',
- ' git clone http://git.chromium.org/chromium/third_party/ffmpeg.git']))]
-
-
def _WarnAboutManualSteps():
"""Warn about the manual steps required for rolling the FFmpeg repository."""
- print Color(BOLD_RED, '[ REMEMBER ]'.center(70, '*'))
+ print Color(BOLD_RED, '[ WARNING ]'.center(70, '*'))
print Color(
BOLD_BLUE, '\n'.join([
+ 'Changes to FFmpeg must uploaded to Gerrit not Rietveld. You are',
+ 'seeing this message because you''re trying to upload to Rietveld.',
+ 'Please see README.chromium for details on using Gerrit.\n',
'Updates to FFmpeg require the following additional manual steps:',
- ' - Push of new sources from Git to Subversion. See sync_svn.py.',
' - External DEPS roll.',
' - If new source files were added, generate_gyp.py must be run.\n',
'For help, please consult the following resources:',
- ' - chromium/README.chromium help text.',
+ ' - README.chromium help text.',
' - Chromium development list: chromium-dev@chromium.org',
' - "Communication" section of http://www.chromium.org/developers']))
print Color(BOLD_RED, 70 * '*')
@@ -76,6 +56,5 @@ def _WarnIfReadmeIsUnchanged(input_api, output_api):
def CheckChangeOnUpload(input_api, output_api):
_WarnAboutManualSteps()
results = []
- results.extend(_CheckForMainRepository(input_api, output_api))
results.extend(_WarnIfReadmeIsUnchanged(input_api, output_api))
return results
diff --git a/chromium/third_party/ffmpeg/README.chromium b/chromium/third_party/ffmpeg/README.chromium
index 9ddeab21b59..08ac6159cca 100644
--- a/chromium/third_party/ffmpeg/README.chromium
+++ b/chromium/third_party/ffmpeg/README.chromium
@@ -3,7 +3,7 @@ URL: http://ffmpeg.org/
License: LGPL 2.1
License File: LICENSE
Upstream Git: git://source.ffmpeg.org/ffmpeg.git
-Last Upstream Merge: 100184ccffbf8a25098a943b71b1cd2e599de2ec, Apr 24 2013
+Last Upstream Merge: bebce653e5601ceafa004db0eb6b2c7d4d16f0c0, May 20 2014
This file documents the layout of the Chromium copy of FFmpeg git, some common
tasks, how to produce the FFmpeg include directory, and how to create the
@@ -54,6 +54,10 @@ for review:
git push ssh://gerrit.chromium.org:29418/chromium/third_party/ffmpeg \
HEAD:refs/for/master
+This will create a gerrit chanage. Make sure to "git commit --amend" and
+add "Change-Id: XXX" as the last line so that future pushes do not create new
+changes. You can get the "XXX" from the gerrit web interface.
+
Note: You'll need a Gerrit account, see:
http://www.chromium.org/chromium-os/developer-guide/gerrit-guide
@@ -62,23 +66,8 @@ If your change adds new files to the repository, you'll need to regenerate the
GYP defines by following the directions in chromium/scripts/generate_gyp.py.
After all that's done and your change has landed in the Git repository, you'll
-need to export it to the Subversion repository. See the next help entry.
-
--- Exporting the Git repository to Subversion.
-
-Sadly, as of this writing (Oct 2012) Chromium does not support building from Git
-repos. The builders rely on an export of the Git repo to SVN for builds. A
-DEPS entry controls which revision the builders are currently using.
-
-The steps for doing this are:
-
- cd <some path outside of ffmpeg Git>
- svn co svn://svn.chromium.org/chrome/trunk/deps/third_party/ffmpeg
- <path to ffmpeg Git>/chromium/scripts/sync_svn.py <Git path> <SVN path>
- cd <svn repo>
- svn commit -m "<Some happy message about updating FFmpeg SVN.>"
+need to roll DEPS before the change will show up in Chrome.
-You'll need to roll DEPS once your SVN changes are committed.
-- Performing an upstream merge.
@@ -106,7 +95,11 @@ The upstream merge process follows the normal Git merge process:
# approval on your Gerrit account. Do not commit any other way.
git push origin master
- <Follow the steps under "Exporting the Git repository to Subversion."
+Once complete you'll need to regenerate the configuration files for every
+platform (see "Short Directions" in the "Building" section below). You'll also
+need to regenerate the gyp files (see chromium/scripts/generate_gyp.py). After
+all that is done, you can update Chromium's root DEPS file to point to the tip
+of tree commit.
-- Upstreaming a patch.
diff --git a/chromium/third_party/ffmpeg/RELEASE b/chromium/third_party/ffmpeg/RELEASE
index 7f9e2dc6075..bd5ee42fcc7 100644
--- a/chromium/third_party/ffmpeg/RELEASE
+++ b/chromium/third_party/ffmpeg/RELEASE
@@ -1 +1 @@
-2.1.git
+2.2.git
diff --git a/chromium/third_party/ffmpeg/arch.mak b/chromium/third_party/ffmpeg/arch.mak
index b71c8e51f3b..0e866d86287 100644
--- a/chromium/third_party/ffmpeg/arch.mak
+++ b/chromium/third_party/ffmpeg/arch.mak
@@ -1,5 +1,6 @@
OBJS-$(HAVE_ARMV5TE) += $(ARMV5TE-OBJS) $(ARMV5TE-OBJS-yes)
OBJS-$(HAVE_ARMV6) += $(ARMV6-OBJS) $(ARMV6-OBJS-yes)
+OBJS-$(HAVE_ARMV8) += $(ARMV8-OBJS) $(ARMV8-OBJS-yes)
OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes)
@@ -10,7 +11,5 @@ OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS) $(MIPSDSPR2-OBJS-yes)
OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
-OBJS-$(HAVE_VIS) += $(VIS-OBJS) $(VIS-OBJS-yes)
-
OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes)
OBJS-$(HAVE_YASM) += $(YASM-OBJS) $(YASM-OBJS-yes)
diff --git a/chromium/third_party/ffmpeg/chromium/binaries/c99conv.exe b/chromium/third_party/ffmpeg/chromium/binaries/c99conv.exe
deleted file mode 100755
index 9de5cfd349d..00000000000
--- a/chromium/third_party/ffmpeg/chromium/binaries/c99conv.exe
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h
index 784fd1dde43..e4f3cc2dee8 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h
@@ -1,17 +1,17 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --disable-asm --disable-inline-asm --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86"
-#define av_restrict __restrict
-#define EXTERN_PREFIX "_"
-#define EXTERN_ASM _
+#define CC_IDENT "gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
#define BUILDSUF ""
-#define SLIBSUF ".dll"
+#define SLIBSUF ".so"
#define HAVE_MMX2 HAVE_MMXEXT
#define ARCH_AARCH64 0
#define ARCH_ALPHA 0
@@ -34,75 +34,92 @@
#define ARCH_TILEGX 0
#define ARCH_TILEPRO 0
#define ARCH_TOMI 0
-#define ARCH_X86 1
-#define ARCH_X86_32 1
+#define ARCH_X86 0
+#define ARCH_X86_32 0
#define ARCH_X86_64 0
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
-#define HAVE_AMD3DNOW 1
-#define HAVE_AMD3DNOWEXT 1
-#define HAVE_AVX 1
-#define HAVE_AVX2 1
-#define HAVE_FMA4 1
-#define HAVE_I686 1
-#define HAVE_MMX 1
-#define HAVE_MMXEXT 1
-#define HAVE_SSE 1
-#define HAVE_SSE2 1
-#define HAVE_SSE3 1
-#define HAVE_SSE4 1
-#define HAVE_SSE42 1
-#define HAVE_SSSE3 1
#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_AMD3DNOW 0
+#define HAVE_AMD3DNOWEXT 0
+#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
+#define HAVE_FMA4 0
+#define HAVE_MMX 0
+#define HAVE_MMXEXT 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
+#define HAVE_SSE3 0
+#define HAVE_SSE4 0
+#define HAVE_SSE42 0
+#define HAVE_SSSE3 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
-#define HAVE_AMD3DNOW_EXTERNAL 1
-#define HAVE_AMD3DNOWEXT_EXTERNAL 1
-#define HAVE_AVX_EXTERNAL 1
-#define HAVE_AVX2_EXTERNAL 1
-#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
-#define HAVE_MMX_EXTERNAL 1
-#define HAVE_MMXEXT_EXTERNAL 1
-#define HAVE_SSE_EXTERNAL 1
-#define HAVE_SSE2_EXTERNAL 1
-#define HAVE_SSE3_EXTERNAL 1
-#define HAVE_SSE4_EXTERNAL 1
-#define HAVE_SSE42_EXTERNAL 1
-#define HAVE_SSSE3_EXTERNAL 1
#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 0
+#define HAVE_AMD3DNOWEXT_EXTERNAL 0
+#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
+#define HAVE_FMA4_EXTERNAL 0
+#define HAVE_MMX_EXTERNAL 0
+#define HAVE_MMXEXT_EXTERNAL 0
+#define HAVE_SSE_EXTERNAL 0
+#define HAVE_SSE2_EXTERNAL 0
+#define HAVE_SSE3_EXTERNAL 0
+#define HAVE_SSE4_EXTERNAL 0
+#define HAVE_SSE42_EXTERNAL 0
+#define HAVE_SSSE3_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 0
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 0
#define HAVE_SYMVER 0
-#define HAVE_YASM 1
+#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
-#define HAVE_FAST_UNALIGNED 1
+#define HAVE_FAST_UNALIGNED 0
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 0
-#define HAVE_W32THREADS 1
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 0
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 1
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -144,7 +211,7 @@
#define HAVE_LDEXPF 1
#define HAVE_LLRINT 1
#define HAVE_LLRINTF 1
-#define HAVE_LOG2 0
+#define HAVE_LOG2 1
#define HAVE_LOG2F 1
#define HAVE_LOG10F 1
#define HAVE_LRINT 1
@@ -157,146 +224,104 @@
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
-#define HAVE_ALIGNED_MALLOC 1
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 0
-#define HAVE_ATTRIBUTE_PACKED 0
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
-#define HAVE_CLOCK_GETTIME 0
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
-#define HAVE_COMMANDLINETOARGVW 1
-#define HAVE_CPUNOP 1
-#define HAVE_CRYPTGENRANDOM 1
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 1
-#define HAVE_DLFCN_H 0
-#define HAVE_DLOPEN 0
-#define HAVE_DOS_PATHS 1
-#define HAVE_DXVA_H 1
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
-#define HAVE_FCNTL 0
-#define HAVE_FORK 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
-#define HAVE_GETOPT 0
-#define HAVE_GETPROCESSAFFINITYMASK 1
-#define HAVE_GETPROCESSMEMORYINFO 1
-#define HAVE_GETPROCESSTIMES 1
-#define HAVE_GETSYSTEMTIMEASFILETIME 1
-#define HAVE_GETRUSAGE 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
-#define HAVE_GETTIMEOFDAY 0
-#define HAVE_GLOB 0
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 1
+#define HAVE_GLXGETPROCADDRESS 0
#define HAVE_INET_ATON 0
-#define HAVE_IO_H 1
-#define HAVE_INLINE_ASM_LABELS 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
-#define HAVE_KBHIT 1
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 1
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
-#define HAVE_LOCALTIME_R 0
-#define HAVE_LOONGSON 0
+#define HAVE_KBHIT 0
+#define HAVE_LOCALTIME_R 1
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MAPVIEWOFFILE 1
-#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 1
-#define HAVE_MKSTEMP 0
-#define HAVE_MM_EMPTY 1
-#define HAVE_MMAP 0
-#define HAVE_MPROTECT 0
-#define HAVE_NANOSLEEP 0
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
-#define HAVE_PEEKNAMEDPIPE 1
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 0
-#define HAVE_POSIX_MEMALIGN 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_PTHREAD_CANCEL 1
+#define HAVE_SCHED_GETAFFINITY 1
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
#define HAVE_PRAGMA_DEPRECATED 1
-#define HAVE_PTHREAD_CANCEL 0
-#define HAVE_RDTSC 1
#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 0
-#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
-#define HAVE_SETCONSOLETEXTATTRIBUTE 1
-#define HAVE_SETMODE 1
-#define HAVE_SETRLIMIT 0
-#define HAVE_SLEEP 1
-#define HAVE_SNDIO_H 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
-#define HAVE_STRERROR_R 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
#define HAVE_STRUCT_POLLFD 0
-#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
#define HAVE_STRUCT_SOCKADDR_IN6 0
#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
-#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
-#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-#define HAVE_SYSCONF 0
-#define HAVE_SYSCTL 0
-#define HAVE_SYS_MMAN_H 0
-#define HAVE_SYS_PARAM_H 0
-#define HAVE_SYS_RESOURCE_H 0
-#define HAVE_SYS_SELECT_H 0
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 0
-#define HAVE_SYS_UN_H 0
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 0
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 1
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 0
-#define HAVE_USLEEP 0
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 1
-#define HAVE_WINDOWS_H 1
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -312,20 +337,24 @@
#define CONFIG_HTMLPAGES 0
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
-#define CONFIG_TXTPAGES 1
+#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -401,38 +450,29 @@
#define CONFIG_FFMPEG 0
#define CONFIG_DCT 1
#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
-#define CONFIG_FAST_UNALIGNED 1
+#define CONFIG_ERROR_RESILIENCE 0
+#define CONFIG_FAST_UNALIGNED 0
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
-#define CONFIG_MEMALIGN_HACK 0
-#define CONFIG_MEMORY_POISONING 0
#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
-#define CONFIG_PIC 0
#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 0
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
+#define CONFIG_CABAC 1
+#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/avconfig.h
index f6685b72c19..123b3b28aef 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/avconfig.h
@@ -2,7 +2,6 @@
#ifndef AVUTIL_AVCONFIG_H
#define AVUTIL_AVCONFIG_H
#define AV_HAVE_BIGENDIAN 0
-#define AV_HAVE_FAST_UNALIGNED 1
+#define AV_HAVE_FAST_UNALIGNED 0
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h
index 86ba94d43db..7261f9cf572 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --enable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=neon' --extra-cflags='-mfloat-abi=hard' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --enable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=neon' --extra-cflags='-mfloat-abi=hard' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.x-google (4.7.2_cos_gg_c8f69e0) 20130114 (prerelease)"
+#define CC_IDENT "gcc 4.8.x-google (4.8.2_cos_gg_38c6bf0_4.8.2-r70) 20140307 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 1
+#define HAVE_ARMV8 0
#define HAVE_NEON 1
#define HAVE_VFP 1
#define HAVE_VFPV3 1
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -57,25 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 1
#define HAVE_VFP_EXTERNAL 1
#define HAVE_VFPV3_EXTERNAL 1
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 1
#define HAVE_VFP_INLINE 1
#define HAVE_VFPV3_INLINE 1
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 1
-#define HAVE_ASM_MOD_Y 1
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 1
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 1
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -401,38 +450,29 @@
#define CONFIG_FFMPEG 0
#define CONFIG_DCT 1
#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 1
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
+#define CONFIG_CABAC 1
+#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h
index b6efd4108c2..b84e23efa8d 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --disable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=hard' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --disable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=hard' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.x-google (4.7.2_cos_gg_c8f69e0) 20130114 (prerelease)"
+#define CC_IDENT "gcc 4.8.x-google (4.8.2_cos_gg_38c6bf0_4.8.2-r70) 20140307 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 1
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 1
#define HAVE_VFPV3 1
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -57,25 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 1
#define HAVE_VFPV3_EXTERNAL 1
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 1
#define HAVE_VFPV3_INLINE 1
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 1
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 1
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 1
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -401,38 +450,29 @@
#define CONFIG_FFMPEG 0
#define CONFIG_DCT 1
#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 1
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
+#define CONFIG_CABAC 1
+#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm
index 0573c475afb..aa329890140 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 0
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 0
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 0
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
-%define HAVE_SYMVER 1
+%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 1
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 1
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 1
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 1
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 0
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 0
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 1
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 0
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 1
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 0
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 0
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 1
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 1
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 0
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -386,38 +435,29 @@
%define CONFIG_FFMPEG 0
%define CONFIG_DCT 1
%define CONFIG_DWT 0
-%define CONFIG_ERROR_RESILIENCE 1
+%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
-%define CONFIG_DSPUTIL 1
+%define CONFIG_CABAC 1
+%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
%define CONFIG_GCRYPT 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 1
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 1
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 1
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -846,7 +901,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
%define CONFIG_ADF_DEMUXER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 1
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 1
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h
index 6c7ab1438bb..f71caffa679 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h
@@ -1,9 +1,9 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --arch=i686 --enable-yasm --extra-cflags=-m32 --extra-ldflags=-m32 --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --arch=i686 --enable-yasm --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
#define CC_IDENT "gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 1
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -401,38 +450,29 @@
#define CONFIG_FFMPEG 0
#define CONFIG_DCT 1
#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
+#define CONFIG_CABAC 1
+#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/config.h
index ad8563354ca..3e1f2ea0b98 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/config.h
@@ -1,14 +1,16 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=mips-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=mipsel-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.3 (Sourcery CodeBench Lite 2013.05-7)"
+#define CC_IDENT "gcc 4.9.0 (GCC)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
+#define BUILDSUF ""
#define SLIBSUF ".so"
#define HAVE_MMX2 HAVE_MMXEXT
#define ARCH_AARCH64 0
@@ -38,14 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -54,24 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 1
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -80,24 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
+#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -106,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 0
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -153,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -196,63 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
-#define HAVE_MSVCRT 0
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -265,30 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
-#define HAVE_XMM_CLOBBERS 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -305,10 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -316,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -323,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -355,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -384,50 +450,44 @@
#define CONFIG_FFMPEG 0
#define CONFIG_DCT 1
#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 0
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
+#define CONFIG_CABAC 1
+#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
#define CONFIG_GOLOMB 1
#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
#define CONFIG_H264CHROMA 1
#define CONFIG_H264DSP 1
#define CONFIG_H264PRED 1
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -440,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -449,7 +510,6 @@
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
-#define CONFIG_MP3_HEADER_COMPRESS_BSF 0
#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
#define CONFIG_MOV2TEXTSUB_BSF 0
#define CONFIG_NOISE_BSF 0
@@ -457,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -507,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -524,6 +586,8 @@
#define CONFIG_H264_CRYSTALHD_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HUFFYUV_DECODER 0
#define CONFIG_IDCIN_DECODER 0
#define CONFIG_IFF_BYTERUN1_DECODER 0
@@ -641,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -668,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -675,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -708,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -779,6 +852,7 @@
#define CONFIG_ADPCM_EA_XAS_DECODER 0
#define CONFIG_ADPCM_G722_DECODER 0
#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
#define CONFIG_ADPCM_IMA_AMV_DECODER 0
#define CONFIG_ADPCM_IMA_APC_DECODER 0
#define CONFIG_ADPCM_IMA_DK3_DECODER 0
@@ -798,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -841,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -876,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -910,6 +987,7 @@
#define CONFIG_H264_DEMUXER 0
#define CONFIG_HEVC_DEMUXER 0
#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
#define CONFIG_ICO_DEMUXER 0
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
@@ -917,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -936,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1003,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1054,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1061,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1133,6 +1217,7 @@
#define CONFIG_FLAC_ENCODER 0
#define CONFIG_G723_1_ENCODER 0
#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
#define CONFIG_NELLYMOSER_ENCODER 0
#define CONFIG_RA_144_ENCODER 0
#define CONFIG_SONIC_ENCODER 0
@@ -1206,14 +1291,17 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
#define CONFIG_ACONVERT_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
@@ -1243,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1254,6 +1343,7 @@
#define CONFIG_LADSPA_FILTER 0
#define CONFIG_LOWPASS_FILTER 0
#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1281,12 +1371,14 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FIELD_FILTER 0
@@ -1294,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1314,6 +1407,7 @@
#define CONFIG_LUTRGB_FILTER 0
#define CONFIG_LUTYUV_FILTER 0
#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
#define CONFIG_MP_FILTER 0
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
@@ -1344,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1389,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1403,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1458,6 +1559,8 @@
#define CONFIG_H261_MUXER 0
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1494,8 +1597,10 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
#define CONFIG_PCM_ALAW_MUXER 0
#define CONFIG_PCM_MULAW_MUXER 0
#define CONFIG_PCM_F64BE_MUXER 0
@@ -1530,6 +1635,7 @@
#define CONFIG_SMOOTHSTREAMING_MUXER 0
#define CONFIG_SOX_MUXER 0
#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SPEEX_MUXER 0
#define CONFIG_SRT_MUXER 0
#define CONFIG_SWF_MUXER 0
#define CONFIG_TEE_MUXER 0
@@ -1537,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1550,6 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1575,11 +1685,13 @@
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
#define CONFIG_H264_PARSER 1
+#define CONFIG_HEVC_PARSER 0
#define CONFIG_MJPEG_PARSER 0
#define CONFIG_MLP_PARSER 0
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1589,6 +1701,7 @@
#define CONFIG_VORBIS_PARSER 1
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
+#define CONFIG_VP9_PARSER 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
@@ -1616,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/libavutil/avconfig.h
index bac323a539b..123b3b28aef 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 0
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm
index db8091a9568..37093d9b9b8 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 1
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 1
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
-%define HAVE_SYMVER 1
+%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 1
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 1
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 1
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 1
-%define HAVE_EBX_AVAILABLE 1
-%define HAVE_FAST_64BIT 1
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 1
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 1
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 1
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 1
-%define HAVE_SDL 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 1
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 1
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 1
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 0
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 1
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
-%define HAVE_XLIB 1
-%define HAVE_XMM_CLOBBERS 1
+%define HAVE_XLIB 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -386,38 +435,29 @@
%define CONFIG_FFMPEG 0
%define CONFIG_DCT 1
%define CONFIG_DWT 0
-%define CONFIG_ERROR_RESILIENCE 1
+%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
-%define CONFIG_DSPUTIL 1
+%define CONFIG_CABAC 1
+%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
%define CONFIG_GCRYPT 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 1
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 1
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 1
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -846,7 +901,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
%define CONFIG_ADF_DEMUXER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 1
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 1
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h
index a7ea9e52319..c0db484c77a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h
@@ -1,9 +1,9 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
#define CC_IDENT "gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 1
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 1
-#define HAVE_EBX_AVAILABLE 1
-#define HAVE_FAST_64BIT 1
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 1
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 1
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 1
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
-#define HAVE_XLIB 1
-#define HAVE_XMM_CLOBBERS 1
+#define HAVE_XLIB 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -401,38 +450,29 @@
#define CONFIG_FFMPEG 0
#define CONFIG_DCT 1
#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
+#define CONFIG_CABAC 1
+#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/config.asm
index 475f83e1260..ae3f94a348a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 0
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 0
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 0
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 1
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 0
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 0
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 0
-%define HAVE_EBX_AVAILABLE 1
-%define HAVE_FAST_64BIT 0
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 0
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 0
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 0
+%define HAVE_MACH_ABSOLUTE_TIME 1
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 1
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 0
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 0
+%define HAVE_EBX_AVAILABLE 1
+%define HAVE_GNU_AS 0
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 0
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 0
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 1
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 1
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -386,38 +435,29 @@
%define CONFIG_FFMPEG 0
%define CONFIG_DCT 1
%define CONFIG_DWT 0
-%define CONFIG_ERROR_RESILIENCE 1
+%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
-%define CONFIG_DSPUTIL 1
+%define CONFIG_CABAC 1
+%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
%define CONFIG_GCRYPT 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 1
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 1
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 1
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -846,7 +901,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
%define CONFIG_ADF_DEMUXER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 1
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 1
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/config.h
index 830e22e06c0..3d3ef04b353 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags='-fno-omit-frame-pointer -O2' --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=i686 --extra-cflags=-m32 --extra-ldflags=-m32 --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\0-fno-omit-frame-pointer -O2\0' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=i686 --extra-cflags=-m32 --extra-ldflags=-m32 --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 3.4 (trunk 193323)"
+#define CC_IDENT "clang version 3.5.0 (trunk 206824)"
#define av_restrict restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 0
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 1
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 0
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 0
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 1
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 0
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 0
+#define HAVE_MACH_ABSOLUTE_TIME 1
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 1
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 0
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 0
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 1
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -401,38 +450,29 @@
#define CONFIG_FFMPEG 0
#define CONFIG_DCT 1
#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
+#define CONFIG_CABAC 1
+#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/ia32/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm
index ea603539672..16cc042ff43 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 1
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 1
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 0
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 1
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 0
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 0
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 1
-%define HAVE_EBX_AVAILABLE 1
-%define HAVE_FAST_64BIT 1
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 1
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 0
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 0
+%define HAVE_MACH_ABSOLUTE_TIME 1
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 1
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 0
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 1
+%define HAVE_GNU_AS 0
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 0
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 0
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 1
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 1
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -386,38 +435,29 @@
%define CONFIG_FFMPEG 0
%define CONFIG_DCT 1
%define CONFIG_DWT 0
-%define CONFIG_ERROR_RESILIENCE 1
+%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
-%define CONFIG_DSPUTIL 1
+%define CONFIG_CABAC 1
+%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
%define CONFIG_GCRYPT 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 1
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 1
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 1
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -846,7 +901,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
%define CONFIG_ADF_DEMUXER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 1
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 1
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h
index bc4f0950134..74ba69381c4 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64 --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\0-O2\0' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64 --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 3.4 (trunk 193323)"
+#define CC_IDENT "clang version 3.5.0 (trunk 206824)"
#define av_restrict restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 1
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 0
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 1
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 0
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 0
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 1
-#define HAVE_EBX_AVAILABLE 1
-#define HAVE_FAST_64BIT 1
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 1
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 0
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 0
+#define HAVE_MACH_ABSOLUTE_TIME 1
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 1
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 0
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 0
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 1
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -401,38 +450,29 @@
#define CONFIG_FFMPEG 0
#define CONFIG_DCT 1
#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
+#define CONFIG_CABAC 1
+#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/config.asm
deleted file mode 100644
index e5c0a5eb894..00000000000
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/config.asm
+++ /dev/null
@@ -1,1645 +0,0 @@
-%define ARCH_AARCH64 0
-%define ARCH_ALPHA 0
-%define ARCH_ARM 0
-%define ARCH_AVR32 0
-%define ARCH_AVR32_AP 0
-%define ARCH_AVR32_UC 0
-%define ARCH_BFIN 0
-%define ARCH_IA64 0
-%define ARCH_M68K 0
-%define ARCH_MIPS 0
-%define ARCH_MIPS64 0
-%define ARCH_PARISC 0
-%define ARCH_PPC 0
-%define ARCH_PPC64 0
-%define ARCH_S390 0
-%define ARCH_SH4 0
-%define ARCH_SPARC 0
-%define ARCH_SPARC64 0
-%define ARCH_TILEGX 0
-%define ARCH_TILEPRO 0
-%define ARCH_TOMI 0
-%define ARCH_X86 1
-%define ARCH_X86_32 1
-%define ARCH_X86_64 0
-%define HAVE_ARMV5TE 0
-%define HAVE_ARMV6 0
-%define HAVE_ARMV6T2 0
-%define HAVE_NEON 0
-%define HAVE_VFP 0
-%define HAVE_VFPV3 0
-%define HAVE_AMD3DNOW 1
-%define HAVE_AMD3DNOWEXT 1
-%define HAVE_AVX 1
-%define HAVE_AVX2 1
-%define HAVE_FMA4 1
-%define HAVE_I686 1
-%define HAVE_MMX 1
-%define HAVE_MMXEXT 1
-%define HAVE_SSE 1
-%define HAVE_SSE2 1
-%define HAVE_SSE3 1
-%define HAVE_SSE4 1
-%define HAVE_SSE42 1
-%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
-%define HAVE_MIPSFPU 0
-%define HAVE_MIPS32R2 0
-%define HAVE_MIPSDSPR1 0
-%define HAVE_MIPSDSPR2 0
-%define HAVE_ARMV5TE_EXTERNAL 0
-%define HAVE_ARMV6_EXTERNAL 0
-%define HAVE_ARMV6T2_EXTERNAL 0
-%define HAVE_NEON_EXTERNAL 0
-%define HAVE_VFP_EXTERNAL 0
-%define HAVE_VFPV3_EXTERNAL 0
-%define HAVE_AMD3DNOW_EXTERNAL 1
-%define HAVE_AMD3DNOWEXT_EXTERNAL 1
-%define HAVE_AVX_EXTERNAL 1
-%define HAVE_AVX2_EXTERNAL 1
-%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
-%define HAVE_MMX_EXTERNAL 1
-%define HAVE_MMXEXT_EXTERNAL 1
-%define HAVE_SSE_EXTERNAL 1
-%define HAVE_SSE2_EXTERNAL 1
-%define HAVE_SSE3_EXTERNAL 1
-%define HAVE_SSE4_EXTERNAL 1
-%define HAVE_SSE42_EXTERNAL 1
-%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
-%define HAVE_MIPSFPU_EXTERNAL 0
-%define HAVE_MIPS32R2_EXTERNAL 0
-%define HAVE_MIPSDSPR1_EXTERNAL 0
-%define HAVE_MIPSDSPR2_EXTERNAL 0
-%define HAVE_ARMV5TE_INLINE 0
-%define HAVE_ARMV6_INLINE 0
-%define HAVE_ARMV6T2_INLINE 0
-%define HAVE_NEON_INLINE 0
-%define HAVE_VFP_INLINE 0
-%define HAVE_VFPV3_INLINE 0
-%define HAVE_AMD3DNOW_INLINE 0
-%define HAVE_AMD3DNOWEXT_INLINE 0
-%define HAVE_AVX_INLINE 0
-%define HAVE_AVX2_INLINE 0
-%define HAVE_FMA4_INLINE 0
-%define HAVE_I686_INLINE 0
-%define HAVE_MMX_INLINE 0
-%define HAVE_MMXEXT_INLINE 0
-%define HAVE_SSE_INLINE 0
-%define HAVE_SSE2_INLINE 0
-%define HAVE_SSE3_INLINE 0
-%define HAVE_SSE4_INLINE 0
-%define HAVE_SSE42_INLINE 0
-%define HAVE_SSSE3_INLINE 0
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
-%define HAVE_MIPSFPU_INLINE 0
-%define HAVE_MIPS32R2_INLINE 0
-%define HAVE_MIPSDSPR1_INLINE 0
-%define HAVE_MIPSDSPR2_INLINE 0
-%define HAVE_INLINE_ASM 0
-%define HAVE_SYMVER 0
-%define HAVE_YASM 1
-%define HAVE_BIGENDIAN 0
-%define HAVE_FAST_UNALIGNED 1
-%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 0
-%define HAVE_W32THREADS 1
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 0
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 1
-%define HAVE_ATANF 1
-%define HAVE_ATAN2F 1
-%define HAVE_CBRT 1
-%define HAVE_CBRTF 1
-%define HAVE_COSF 1
-%define HAVE_EXP2 1
-%define HAVE_EXP2F 1
-%define HAVE_EXPF 1
-%define HAVE_ISINF 1
-%define HAVE_ISNAN 1
-%define HAVE_LDEXPF 1
-%define HAVE_LLRINT 1
-%define HAVE_LLRINTF 1
-%define HAVE_LOG2 0
-%define HAVE_LOG2F 1
-%define HAVE_LOG10F 1
-%define HAVE_LRINT 1
-%define HAVE_LRINTF 1
-%define HAVE_POWF 1
-%define HAVE_RINT 1
-%define HAVE_ROUND 1
-%define HAVE_ROUNDF 1
-%define HAVE_SINF 1
-%define HAVE_TRUNC 1
-%define HAVE_TRUNCF 1
-%define HAVE_ACCESS 1
-%define HAVE_ALIGNED_MALLOC 1
-%define HAVE_ALIGNED_STACK 0
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 0
-%define HAVE_ATTRIBUTE_PACKED 0
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
-%define HAVE_CLOCK_GETTIME 0
-%define HAVE_CLOSESOCKET 0
-%define HAVE_COMMANDLINETOARGVW 1
-%define HAVE_CPUNOP 1
-%define HAVE_CRYPTGENRANDOM 1
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 1
-%define HAVE_DLFCN_H 0
-%define HAVE_DLOPEN 0
-%define HAVE_DOS_PATHS 1
-%define HAVE_DXVA_H 1
-%define HAVE_EBP_AVAILABLE 0
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 0
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 0
-%define HAVE_FCNTL 0
-%define HAVE_FORK 0
-%define HAVE_GETADDRINFO 0
-%define HAVE_GETHRTIME 0
-%define HAVE_GETOPT 0
-%define HAVE_GETPROCESSAFFINITYMASK 1
-%define HAVE_GETPROCESSMEMORYINFO 1
-%define HAVE_GETPROCESSTIMES 1
-%define HAVE_GETSYSTEMTIMEASFILETIME 1
-%define HAVE_GETRUSAGE 0
-%define HAVE_GETSERVBYPORT 0
-%define HAVE_GETTIMEOFDAY 0
-%define HAVE_GLOB 0
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 0
-%define HAVE_IO_H 1
-%define HAVE_INLINE_ASM_LABELS 0
-%define HAVE_ISATTY 1
-%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
-%define HAVE_KBHIT 1
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 1
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
-%define HAVE_LOCALTIME_R 0
-%define HAVE_LOONGSON 0
-%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 1
-%define HAVE_MAPVIEWOFFILE 1
-%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 1
-%define HAVE_MKSTEMP 0
-%define HAVE_MM_EMPTY 1
-%define HAVE_MMAP 0
-%define HAVE_MPROTECT 0
-%define HAVE_NANOSLEEP 0
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
-%define HAVE_PEEKNAMEDPIPE 1
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 0
-%define HAVE_POSIX_MEMALIGN 0
-%define HAVE_PRAGMA_DEPRECATED 1
-%define HAVE_PTHREAD_CANCEL 0
-%define HAVE_RDTSC 1
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 0
-%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
-%define HAVE_SETCONSOLETEXTATTRIBUTE 1
-%define HAVE_SETMODE 1
-%define HAVE_SETRLIMIT 0
-%define HAVE_SLEEP 1
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
-%define HAVE_STRERROR_R 0
-%define HAVE_STRUCT_ADDRINFO 0
-%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
-%define HAVE_STRUCT_IP_MREQ_SOURCE 0
-%define HAVE_STRUCT_IPV6_MREQ 0
-%define HAVE_STRUCT_POLLFD 0
-%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0
-%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
-%define HAVE_STRUCT_SOCKADDR_IN6 0
-%define HAVE_STRUCT_SOCKADDR_SA_LEN 0
-%define HAVE_STRUCT_SOCKADDR_STORAGE 0
-%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
-%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-%define HAVE_SYSCONF 0
-%define HAVE_SYSCTL 0
-%define HAVE_SYS_MMAN_H 0
-%define HAVE_SYS_PARAM_H 0
-%define HAVE_SYS_RESOURCE_H 0
-%define HAVE_SYS_SELECT_H 0
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 0
-%define HAVE_SYS_UN_H 0
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 0
-%define HAVE_TEXI2HTML 0
-%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 0
-%define HAVE_USLEEP 0
-%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 1
-%define HAVE_WINDOWS_H 1
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
-%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
-%define CONFIG_BSFS 0
-%define CONFIG_DECODERS 1
-%define CONFIG_DEMUXERS 1
-%define CONFIG_ENCODERS 0
-%define CONFIG_FILTERS 0
-%define CONFIG_HWACCELS 0
-%define CONFIG_INDEVS 0
-%define CONFIG_MUXERS 0
-%define CONFIG_OUTDEVS 0
-%define CONFIG_PARSERS 1
-%define CONFIG_PROTOCOLS 0
-%define CONFIG_DOC 0
-%define CONFIG_HTMLPAGES 0
-%define CONFIG_MANPAGES 1
-%define CONFIG_PODPAGES 1
-%define CONFIG_TXTPAGES 1
-%define CONFIG_DECODING_ENCODING_EXAMPLE 1
-%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
-%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
-%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
-%define CONFIG_METADATA_EXAMPLE 1
-%define CONFIG_MUXING_EXAMPLE 0
-%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
-%define CONFIG_SCALING_VIDEO_EXAMPLE 0
-%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
-%define CONFIG_AVISYNTH 0
-%define CONFIG_BZLIB 0
-%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
-%define CONFIG_FREI0R 0
-%define CONFIG_GNUTLS 0
-%define CONFIG_ICONV 0
-%define CONFIG_LADSPA 0
-%define CONFIG_LIBAACPLUS 0
-%define CONFIG_LIBASS 0
-%define CONFIG_LIBBLURAY 0
-%define CONFIG_LIBCACA 0
-%define CONFIG_LIBCDIO 0
-%define CONFIG_LIBCELT 0
-%define CONFIG_LIBDC1394 0
-%define CONFIG_LIBFAAC 0
-%define CONFIG_LIBFDK_AAC 0
-%define CONFIG_LIBFLITE 0
-%define CONFIG_LIBFREETYPE 0
-%define CONFIG_LIBGME 0
-%define CONFIG_LIBGSM 0
-%define CONFIG_LIBIEC61883 0
-%define CONFIG_LIBILBC 0
-%define CONFIG_LIBMODPLUG 0
-%define CONFIG_LIBMP3LAME 0
-%define CONFIG_LIBNUT 0
-%define CONFIG_LIBOPENCORE_AMRNB 0
-%define CONFIG_LIBOPENCORE_AMRWB 0
-%define CONFIG_LIBOPENCV 0
-%define CONFIG_LIBOPENJPEG 0
-%define CONFIG_LIBOPUS 0
-%define CONFIG_LIBPULSE 0
-%define CONFIG_LIBQUVI 0
-%define CONFIG_LIBRTMP 0
-%define CONFIG_LIBSCHROEDINGER 0
-%define CONFIG_LIBSHINE 0
-%define CONFIG_LIBSOXR 0
-%define CONFIG_LIBSPEEX 0
-%define CONFIG_LIBSSH 0
-%define CONFIG_LIBSTAGEFRIGHT_H264 0
-%define CONFIG_LIBTHEORA 0
-%define CONFIG_LIBTWOLAME 0
-%define CONFIG_LIBUTVIDEO 0
-%define CONFIG_LIBV4L2 0
-%define CONFIG_LIBVIDSTAB 0
-%define CONFIG_LIBVO_AACENC 0
-%define CONFIG_LIBVO_AMRWBENC 0
-%define CONFIG_LIBVORBIS 0
-%define CONFIG_LIBVPX 0
-%define CONFIG_LIBWAVPACK 0
-%define CONFIG_LIBX264 0
-%define CONFIG_LIBXAVS 0
-%define CONFIG_LIBXVID 0
-%define CONFIG_LIBZMQ 0
-%define CONFIG_LIBZVBI 0
-%define CONFIG_OPENAL 0
-%define CONFIG_OPENCL 0
-%define CONFIG_OPENSSL 0
-%define CONFIG_X11GRAB 0
-%define CONFIG_ZLIB 0
-%define CONFIG_DXVA2 0
-%define CONFIG_VAAPI 0
-%define CONFIG_VDA 0
-%define CONFIG_VDPAU 0
-%define CONFIG_AVCODEC 1
-%define CONFIG_AVDEVICE 0
-%define CONFIG_AVFILTER 0
-%define CONFIG_AVFORMAT 1
-%define CONFIG_AVRESAMPLE 0
-%define CONFIG_AVUTIL 1
-%define CONFIG_POSTPROC 0
-%define CONFIG_SWRESAMPLE 0
-%define CONFIG_SWSCALE 0
-%define CONFIG_FFPLAY 0
-%define CONFIG_FFPROBE 0
-%define CONFIG_FFSERVER 0
-%define CONFIG_FFMPEG 0
-%define CONFIG_DCT 1
-%define CONFIG_DWT 0
-%define CONFIG_ERROR_RESILIENCE 1
-%define CONFIG_FAST_UNALIGNED 1
-%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
-%define CONFIG_LSP 0
-%define CONFIG_LZO 0
-%define CONFIG_MDCT 1
-%define CONFIG_MEMALIGN_HACK 0
-%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
-%define CONFIG_PIC 0
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 0
-%define CONFIG_SWSCALE_ALPHA 1
-%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
-%define CONFIG_XMM_CLOBBER_TEST 0
-%define CONFIG_AANDCTTABLES 0
-%define CONFIG_AC3DSP 0
-%define CONFIG_AUDIO_FRAME_QUEUE 0
-%define CONFIG_DSPUTIL 1
-%define CONFIG_EXIF 0
-%define CONFIG_FRAME_THREAD_ENCODER 0
-%define CONFIG_GCRYPT 0
-%define CONFIG_GOLOMB 1
-%define CONFIG_GPLV3 0
-%define CONFIG_H263DSP 0
-%define CONFIG_H264CHROMA 1
-%define CONFIG_H264DSP 1
-%define CONFIG_H264PRED 1
-%define CONFIG_H264QPEL 1
-%define CONFIG_HPELDSP 1
-%define CONFIG_HUFFMAN 0
-%define CONFIG_LGPLV3 0
-%define CONFIG_LPC 0
-%define CONFIG_MPEGAUDIO 1
-%define CONFIG_MPEGAUDIODSP 1
-%define CONFIG_MPEGVIDEO 0
-%define CONFIG_MPEGVIDEOENC 0
-%define CONFIG_NETTLE 0
-%define CONFIG_RANGECODER 0
-%define CONFIG_RIFFDEC 1
-%define CONFIG_RIFFENC 0
-%define CONFIG_RTPDEC 0
-%define CONFIG_RTPENC_CHAIN 0
-%define CONFIG_SINEWIN 1
-%define CONFIG_VIDEODSP 1
-%define CONFIG_VP3DSP 1
-%define CONFIG_AAC_ADTSTOASC_BSF 0
-%define CONFIG_CHOMP_BSF 0
-%define CONFIG_DUMP_EXTRADATA_BSF 0
-%define CONFIG_H264_MP4TOANNEXB_BSF 0
-%define CONFIG_IMX_DUMP_HEADER_BSF 0
-%define CONFIG_MJPEG2JPEG_BSF 0
-%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
-%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
-%define CONFIG_MOV2TEXTSUB_BSF 0
-%define CONFIG_NOISE_BSF 0
-%define CONFIG_REMOVE_EXTRADATA_BSF 0
-%define CONFIG_TEXT2MOVSUB_BSF 0
-%define CONFIG_AASC_DECODER 0
-%define CONFIG_AIC_DECODER 0
-%define CONFIG_AMV_DECODER 0
-%define CONFIG_ANM_DECODER 0
-%define CONFIG_ANSI_DECODER 0
-%define CONFIG_ASV1_DECODER 0
-%define CONFIG_ASV2_DECODER 0
-%define CONFIG_AURA_DECODER 0
-%define CONFIG_AURA2_DECODER 0
-%define CONFIG_AVRP_DECODER 0
-%define CONFIG_AVRN_DECODER 0
-%define CONFIG_AVS_DECODER 0
-%define CONFIG_AVUI_DECODER 0
-%define CONFIG_AYUV_DECODER 0
-%define CONFIG_BETHSOFTVID_DECODER 0
-%define CONFIG_BFI_DECODER 0
-%define CONFIG_BINK_DECODER 0
-%define CONFIG_BMP_DECODER 0
-%define CONFIG_BMV_VIDEO_DECODER 0
-%define CONFIG_BRENDER_PIX_DECODER 0
-%define CONFIG_C93_DECODER 0
-%define CONFIG_CAVS_DECODER 0
-%define CONFIG_CDGRAPHICS_DECODER 0
-%define CONFIG_CDXL_DECODER 0
-%define CONFIG_CINEPAK_DECODER 0
-%define CONFIG_CLJR_DECODER 0
-%define CONFIG_CLLC_DECODER 0
-%define CONFIG_COMFORTNOISE_DECODER 0
-%define CONFIG_CPIA_DECODER 0
-%define CONFIG_CSCD_DECODER 0
-%define CONFIG_CYUV_DECODER 0
-%define CONFIG_DFA_DECODER 0
-%define CONFIG_DIRAC_DECODER 0
-%define CONFIG_DNXHD_DECODER 0
-%define CONFIG_DPX_DECODER 0
-%define CONFIG_DSICINVIDEO_DECODER 0
-%define CONFIG_DVVIDEO_DECODER 0
-%define CONFIG_DXA_DECODER 0
-%define CONFIG_DXTORY_DECODER 0
-%define CONFIG_EACMV_DECODER 0
-%define CONFIG_EAMAD_DECODER 0
-%define CONFIG_EATGQ_DECODER 0
-%define CONFIG_EATGV_DECODER 0
-%define CONFIG_EATQI_DECODER 0
-%define CONFIG_EIGHTBPS_DECODER 0
-%define CONFIG_EIGHTSVX_EXP_DECODER 0
-%define CONFIG_EIGHTSVX_FIB_DECODER 0
-%define CONFIG_ESCAPE124_DECODER 0
-%define CONFIG_ESCAPE130_DECODER 0
-%define CONFIG_EXR_DECODER 0
-%define CONFIG_FFV1_DECODER 0
-%define CONFIG_FFVHUFF_DECODER 0
-%define CONFIG_FLASHSV_DECODER 0
-%define CONFIG_FLASHSV2_DECODER 0
-%define CONFIG_FLIC_DECODER 0
-%define CONFIG_FLV_DECODER 0
-%define CONFIG_FOURXM_DECODER 0
-%define CONFIG_FRAPS_DECODER 0
-%define CONFIG_FRWU_DECODER 0
-%define CONFIG_G2M_DECODER 0
-%define CONFIG_GIF_DECODER 0
-%define CONFIG_H261_DECODER 0
-%define CONFIG_H263_DECODER 0
-%define CONFIG_H263I_DECODER 0
-%define CONFIG_H263P_DECODER 0
-%define CONFIG_H264_DECODER 1
-%define CONFIG_H264_CRYSTALHD_DECODER 0
-%define CONFIG_H264_VDA_DECODER 0
-%define CONFIG_H264_VDPAU_DECODER 0
-%define CONFIG_HEVC_DECODER 0
-%define CONFIG_HNM4_VIDEO_DECODER 0
-%define CONFIG_HUFFYUV_DECODER 0
-%define CONFIG_IDCIN_DECODER 0
-%define CONFIG_IFF_BYTERUN1_DECODER 0
-%define CONFIG_IFF_ILBM_DECODER 0
-%define CONFIG_INDEO2_DECODER 0
-%define CONFIG_INDEO3_DECODER 0
-%define CONFIG_INDEO4_DECODER 0
-%define CONFIG_INDEO5_DECODER 0
-%define CONFIG_INTERPLAY_VIDEO_DECODER 0
-%define CONFIG_JPEG2000_DECODER 0
-%define CONFIG_JPEGLS_DECODER 0
-%define CONFIG_JV_DECODER 0
-%define CONFIG_KGV1_DECODER 0
-%define CONFIG_KMVC_DECODER 0
-%define CONFIG_LAGARITH_DECODER 0
-%define CONFIG_LOCO_DECODER 0
-%define CONFIG_MDEC_DECODER 0
-%define CONFIG_MIMIC_DECODER 0
-%define CONFIG_MJPEG_DECODER 0
-%define CONFIG_MJPEGB_DECODER 0
-%define CONFIG_MMVIDEO_DECODER 0
-%define CONFIG_MOTIONPIXELS_DECODER 0
-%define CONFIG_MPEG_XVMC_DECODER 0
-%define CONFIG_MPEG1VIDEO_DECODER 0
-%define CONFIG_MPEG2VIDEO_DECODER 0
-%define CONFIG_MPEG4_DECODER 0
-%define CONFIG_MPEG4_CRYSTALHD_DECODER 0
-%define CONFIG_MPEG4_VDPAU_DECODER 0
-%define CONFIG_MPEGVIDEO_DECODER 0
-%define CONFIG_MPEG_VDPAU_DECODER 0
-%define CONFIG_MPEG1_VDPAU_DECODER 0
-%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
-%define CONFIG_MSA1_DECODER 0
-%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
-%define CONFIG_MSMPEG4V1_DECODER 0
-%define CONFIG_MSMPEG4V2_DECODER 0
-%define CONFIG_MSMPEG4V3_DECODER 0
-%define CONFIG_MSRLE_DECODER 0
-%define CONFIG_MSS1_DECODER 0
-%define CONFIG_MSS2_DECODER 0
-%define CONFIG_MSVIDEO1_DECODER 0
-%define CONFIG_MSZH_DECODER 0
-%define CONFIG_MTS2_DECODER 0
-%define CONFIG_MVC1_DECODER 0
-%define CONFIG_MVC2_DECODER 0
-%define CONFIG_MXPEG_DECODER 0
-%define CONFIG_NUV_DECODER 0
-%define CONFIG_PAF_VIDEO_DECODER 0
-%define CONFIG_PAM_DECODER 0
-%define CONFIG_PBM_DECODER 0
-%define CONFIG_PCX_DECODER 0
-%define CONFIG_PGM_DECODER 0
-%define CONFIG_PGMYUV_DECODER 0
-%define CONFIG_PICTOR_DECODER 0
-%define CONFIG_PNG_DECODER 0
-%define CONFIG_PPM_DECODER 0
-%define CONFIG_PRORES_DECODER 0
-%define CONFIG_PRORES_LGPL_DECODER 0
-%define CONFIG_PTX_DECODER 0
-%define CONFIG_QDRAW_DECODER 0
-%define CONFIG_QPEG_DECODER 0
-%define CONFIG_QTRLE_DECODER 0
-%define CONFIG_R10K_DECODER 0
-%define CONFIG_R210_DECODER 0
-%define CONFIG_RAWVIDEO_DECODER 0
-%define CONFIG_RL2_DECODER 0
-%define CONFIG_ROQ_DECODER 0
-%define CONFIG_RPZA_DECODER 0
-%define CONFIG_RV10_DECODER 0
-%define CONFIG_RV20_DECODER 0
-%define CONFIG_RV30_DECODER 0
-%define CONFIG_RV40_DECODER 0
-%define CONFIG_S302M_DECODER 0
-%define CONFIG_SANM_DECODER 0
-%define CONFIG_SGI_DECODER 0
-%define CONFIG_SGIRLE_DECODER 0
-%define CONFIG_SMACKER_DECODER 0
-%define CONFIG_SMC_DECODER 0
-%define CONFIG_SMVJPEG_DECODER 0
-%define CONFIG_SNOW_DECODER 0
-%define CONFIG_SP5X_DECODER 0
-%define CONFIG_SUNRAST_DECODER 0
-%define CONFIG_SVQ1_DECODER 0
-%define CONFIG_SVQ3_DECODER 0
-%define CONFIG_TARGA_DECODER 0
-%define CONFIG_TARGA_Y216_DECODER 0
-%define CONFIG_THEORA_DECODER 1
-%define CONFIG_THP_DECODER 0
-%define CONFIG_TIERTEXSEQVIDEO_DECODER 0
-%define CONFIG_TIFF_DECODER 0
-%define CONFIG_TMV_DECODER 0
-%define CONFIG_TRUEMOTION1_DECODER 0
-%define CONFIG_TRUEMOTION2_DECODER 0
-%define CONFIG_TSCC_DECODER 0
-%define CONFIG_TSCC2_DECODER 0
-%define CONFIG_TXD_DECODER 0
-%define CONFIG_ULTI_DECODER 0
-%define CONFIG_UTVIDEO_DECODER 0
-%define CONFIG_V210_DECODER 0
-%define CONFIG_V210X_DECODER 0
-%define CONFIG_V308_DECODER 0
-%define CONFIG_V408_DECODER 0
-%define CONFIG_V410_DECODER 0
-%define CONFIG_VB_DECODER 0
-%define CONFIG_VBLE_DECODER 0
-%define CONFIG_VC1_DECODER 0
-%define CONFIG_VC1_CRYSTALHD_DECODER 0
-%define CONFIG_VC1_VDPAU_DECODER 0
-%define CONFIG_VC1IMAGE_DECODER 0
-%define CONFIG_VCR1_DECODER 0
-%define CONFIG_VMDVIDEO_DECODER 0
-%define CONFIG_VMNC_DECODER 0
-%define CONFIG_VP3_DECODER 1
-%define CONFIG_VP5_DECODER 0
-%define CONFIG_VP6_DECODER 0
-%define CONFIG_VP6A_DECODER 0
-%define CONFIG_VP6F_DECODER 0
-%define CONFIG_VP8_DECODER 1
-%define CONFIG_VP9_DECODER 0
-%define CONFIG_VQA_DECODER 0
-%define CONFIG_WEBP_DECODER 0
-%define CONFIG_WMV1_DECODER 0
-%define CONFIG_WMV2_DECODER 0
-%define CONFIG_WMV3_DECODER 0
-%define CONFIG_WMV3_CRYSTALHD_DECODER 0
-%define CONFIG_WMV3_VDPAU_DECODER 0
-%define CONFIG_WMV3IMAGE_DECODER 0
-%define CONFIG_WNV1_DECODER 0
-%define CONFIG_XAN_WC3_DECODER 0
-%define CONFIG_XAN_WC4_DECODER 0
-%define CONFIG_XBM_DECODER 0
-%define CONFIG_XFACE_DECODER 0
-%define CONFIG_XL_DECODER 0
-%define CONFIG_XWD_DECODER 0
-%define CONFIG_Y41P_DECODER 0
-%define CONFIG_YOP_DECODER 0
-%define CONFIG_YUV4_DECODER 0
-%define CONFIG_ZERO12V_DECODER 0
-%define CONFIG_ZEROCODEC_DECODER 0
-%define CONFIG_ZLIB_DECODER 0
-%define CONFIG_ZMBV_DECODER 0
-%define CONFIG_AAC_DECODER 1
-%define CONFIG_AAC_LATM_DECODER 0
-%define CONFIG_AC3_DECODER 0
-%define CONFIG_ALAC_DECODER 0
-%define CONFIG_ALS_DECODER 0
-%define CONFIG_AMRNB_DECODER 0
-%define CONFIG_AMRWB_DECODER 0
-%define CONFIG_APE_DECODER 0
-%define CONFIG_ATRAC1_DECODER 0
-%define CONFIG_ATRAC3_DECODER 0
-%define CONFIG_BINKAUDIO_DCT_DECODER 0
-%define CONFIG_BINKAUDIO_RDFT_DECODER 0
-%define CONFIG_BMV_AUDIO_DECODER 0
-%define CONFIG_COOK_DECODER 0
-%define CONFIG_DCA_DECODER 0
-%define CONFIG_DSICINAUDIO_DECODER 0
-%define CONFIG_EAC3_DECODER 0
-%define CONFIG_EVRC_DECODER 0
-%define CONFIG_FFWAVESYNTH_DECODER 0
-%define CONFIG_FLAC_DECODER 0
-%define CONFIG_G723_1_DECODER 0
-%define CONFIG_G729_DECODER 0
-%define CONFIG_GSM_DECODER 0
-%define CONFIG_GSM_MS_DECODER 0
-%define CONFIG_IAC_DECODER 0
-%define CONFIG_IMC_DECODER 0
-%define CONFIG_MACE3_DECODER 0
-%define CONFIG_MACE6_DECODER 0
-%define CONFIG_METASOUND_DECODER 0
-%define CONFIG_MLP_DECODER 0
-%define CONFIG_MP1_DECODER 0
-%define CONFIG_MP1FLOAT_DECODER 0
-%define CONFIG_MP2_DECODER 0
-%define CONFIG_MP2FLOAT_DECODER 0
-%define CONFIG_MP3_DECODER 1
-%define CONFIG_MP3FLOAT_DECODER 0
-%define CONFIG_MP3ADU_DECODER 0
-%define CONFIG_MP3ADUFLOAT_DECODER 0
-%define CONFIG_MP3ON4_DECODER 0
-%define CONFIG_MP3ON4FLOAT_DECODER 0
-%define CONFIG_MPC7_DECODER 0
-%define CONFIG_MPC8_DECODER 0
-%define CONFIG_NELLYMOSER_DECODER 0
-%define CONFIG_PAF_AUDIO_DECODER 0
-%define CONFIG_QCELP_DECODER 0
-%define CONFIG_QDM2_DECODER 0
-%define CONFIG_RA_144_DECODER 0
-%define CONFIG_RA_288_DECODER 0
-%define CONFIG_RALF_DECODER 0
-%define CONFIG_SHORTEN_DECODER 0
-%define CONFIG_SIPR_DECODER 0
-%define CONFIG_SMACKAUD_DECODER 0
-%define CONFIG_SONIC_DECODER 0
-%define CONFIG_TAK_DECODER 0
-%define CONFIG_TRUEHD_DECODER 0
-%define CONFIG_TRUESPEECH_DECODER 0
-%define CONFIG_TTA_DECODER 0
-%define CONFIG_TWINVQ_DECODER 0
-%define CONFIG_VMDAUDIO_DECODER 0
-%define CONFIG_VORBIS_DECODER 1
-%define CONFIG_WAVPACK_DECODER 0
-%define CONFIG_WMALOSSLESS_DECODER 0
-%define CONFIG_WMAPRO_DECODER 0
-%define CONFIG_WMAV1_DECODER 0
-%define CONFIG_WMAV2_DECODER 0
-%define CONFIG_WMAVOICE_DECODER 0
-%define CONFIG_WS_SND1_DECODER 0
-%define CONFIG_PCM_ALAW_DECODER 1
-%define CONFIG_PCM_BLURAY_DECODER 0
-%define CONFIG_PCM_DVD_DECODER 0
-%define CONFIG_PCM_F32BE_DECODER 0
-%define CONFIG_PCM_F32LE_DECODER 1
-%define CONFIG_PCM_F64BE_DECODER 0
-%define CONFIG_PCM_F64LE_DECODER 0
-%define CONFIG_PCM_LXF_DECODER 0
-%define CONFIG_PCM_MULAW_DECODER 1
-%define CONFIG_PCM_S8_DECODER 0
-%define CONFIG_PCM_S8_PLANAR_DECODER 0
-%define CONFIG_PCM_S16BE_DECODER 1
-%define CONFIG_PCM_S16BE_PLANAR_DECODER 0
-%define CONFIG_PCM_S16LE_DECODER 1
-%define CONFIG_PCM_S16LE_PLANAR_DECODER 0
-%define CONFIG_PCM_S24BE_DECODER 1
-%define CONFIG_PCM_S24DAUD_DECODER 0
-%define CONFIG_PCM_S24LE_DECODER 1
-%define CONFIG_PCM_S24LE_PLANAR_DECODER 0
-%define CONFIG_PCM_S32BE_DECODER 0
-%define CONFIG_PCM_S32LE_DECODER 0
-%define CONFIG_PCM_S32LE_PLANAR_DECODER 0
-%define CONFIG_PCM_U8_DECODER 1
-%define CONFIG_PCM_U16BE_DECODER 0
-%define CONFIG_PCM_U16LE_DECODER 0
-%define CONFIG_PCM_U24BE_DECODER 0
-%define CONFIG_PCM_U24LE_DECODER 0
-%define CONFIG_PCM_U32BE_DECODER 0
-%define CONFIG_PCM_U32LE_DECODER 0
-%define CONFIG_PCM_ZORK_DECODER 0
-%define CONFIG_INTERPLAY_DPCM_DECODER 0
-%define CONFIG_ROQ_DPCM_DECODER 0
-%define CONFIG_SOL_DPCM_DECODER 0
-%define CONFIG_XAN_DPCM_DECODER 0
-%define CONFIG_ADPCM_4XM_DECODER 0
-%define CONFIG_ADPCM_ADX_DECODER 0
-%define CONFIG_ADPCM_AFC_DECODER 0
-%define CONFIG_ADPCM_CT_DECODER 0
-%define CONFIG_ADPCM_DTK_DECODER 0
-%define CONFIG_ADPCM_EA_DECODER 0
-%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
-%define CONFIG_ADPCM_EA_R1_DECODER 0
-%define CONFIG_ADPCM_EA_R2_DECODER 0
-%define CONFIG_ADPCM_EA_R3_DECODER 0
-%define CONFIG_ADPCM_EA_XAS_DECODER 0
-%define CONFIG_ADPCM_G722_DECODER 0
-%define CONFIG_ADPCM_G726_DECODER 0
-%define CONFIG_ADPCM_G726LE_DECODER 0
-%define CONFIG_ADPCM_IMA_AMV_DECODER 0
-%define CONFIG_ADPCM_IMA_APC_DECODER 0
-%define CONFIG_ADPCM_IMA_DK3_DECODER 0
-%define CONFIG_ADPCM_IMA_DK4_DECODER 0
-%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
-%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
-%define CONFIG_ADPCM_IMA_ISS_DECODER 0
-%define CONFIG_ADPCM_IMA_OKI_DECODER 0
-%define CONFIG_ADPCM_IMA_QT_DECODER 0
-%define CONFIG_ADPCM_IMA_RAD_DECODER 0
-%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
-%define CONFIG_ADPCM_IMA_WAV_DECODER 0
-%define CONFIG_ADPCM_IMA_WS_DECODER 0
-%define CONFIG_ADPCM_MS_DECODER 0
-%define CONFIG_ADPCM_SBPRO_2_DECODER 0
-%define CONFIG_ADPCM_SBPRO_3_DECODER 0
-%define CONFIG_ADPCM_SBPRO_4_DECODER 0
-%define CONFIG_ADPCM_SWF_DECODER 0
-%define CONFIG_ADPCM_THP_DECODER 0
-%define CONFIG_ADPCM_XA_DECODER 0
-%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
-%define CONFIG_SSA_DECODER 0
-%define CONFIG_ASS_DECODER 0
-%define CONFIG_DVBSUB_DECODER 0
-%define CONFIG_DVDSUB_DECODER 0
-%define CONFIG_JACOSUB_DECODER 0
-%define CONFIG_MICRODVD_DECODER 0
-%define CONFIG_MOVTEXT_DECODER 0
-%define CONFIG_MPL2_DECODER 0
-%define CONFIG_PGSSUB_DECODER 0
-%define CONFIG_PJS_DECODER 0
-%define CONFIG_REALTEXT_DECODER 0
-%define CONFIG_SAMI_DECODER 0
-%define CONFIG_SRT_DECODER 0
-%define CONFIG_SUBRIP_DECODER 0
-%define CONFIG_SUBVIEWER_DECODER 0
-%define CONFIG_SUBVIEWER1_DECODER 0
-%define CONFIG_TEXT_DECODER 0
-%define CONFIG_VPLAYER_DECODER 0
-%define CONFIG_WEBVTT_DECODER 0
-%define CONFIG_XSUB_DECODER 0
-%define CONFIG_LIBCELT_DECODER 0
-%define CONFIG_LIBFDK_AAC_DECODER 0
-%define CONFIG_LIBGSM_DECODER 0
-%define CONFIG_LIBGSM_MS_DECODER 0
-%define CONFIG_LIBILBC_DECODER 0
-%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
-%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
-%define CONFIG_LIBOPENJPEG_DECODER 0
-%define CONFIG_LIBOPUS_DECODER 0
-%define CONFIG_LIBSCHROEDINGER_DECODER 0
-%define CONFIG_LIBSPEEX_DECODER 0
-%define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
-%define CONFIG_LIBUTVIDEO_DECODER 0
-%define CONFIG_LIBVORBIS_DECODER 0
-%define CONFIG_LIBVPX_VP8_DECODER 0
-%define CONFIG_LIBVPX_VP9_DECODER 0
-%define CONFIG_LIBZVBI_TELETEXT_DECODER 0
-%define CONFIG_BINTEXT_DECODER 0
-%define CONFIG_XBIN_DECODER 0
-%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
-%define CONFIG_AC3_DEMUXER 0
-%define CONFIG_ACT_DEMUXER 0
-%define CONFIG_ADF_DEMUXER 0
-%define CONFIG_ADP_DEMUXER 0
-%define CONFIG_ADX_DEMUXER 0
-%define CONFIG_AEA_DEMUXER 0
-%define CONFIG_AFC_DEMUXER 0
-%define CONFIG_AIFF_DEMUXER 0
-%define CONFIG_AMR_DEMUXER 0
-%define CONFIG_ANM_DEMUXER 0
-%define CONFIG_APC_DEMUXER 0
-%define CONFIG_APE_DEMUXER 0
-%define CONFIG_AQTITLE_DEMUXER 0
-%define CONFIG_ASF_DEMUXER 0
-%define CONFIG_ASS_DEMUXER 0
-%define CONFIG_AST_DEMUXER 0
-%define CONFIG_AU_DEMUXER 0
-%define CONFIG_AVI_DEMUXER 0
-%define CONFIG_AVISYNTH_DEMUXER 0
-%define CONFIG_AVR_DEMUXER 0
-%define CONFIG_AVS_DEMUXER 0
-%define CONFIG_BETHSOFTVID_DEMUXER 0
-%define CONFIG_BFI_DEMUXER 0
-%define CONFIG_BINTEXT_DEMUXER 0
-%define CONFIG_BINK_DEMUXER 0
-%define CONFIG_BIT_DEMUXER 0
-%define CONFIG_BMV_DEMUXER 0
-%define CONFIG_BRSTM_DEMUXER 0
-%define CONFIG_BOA_DEMUXER 0
-%define CONFIG_C93_DEMUXER 0
-%define CONFIG_CAF_DEMUXER 0
-%define CONFIG_CAVSVIDEO_DEMUXER 0
-%define CONFIG_CDG_DEMUXER 0
-%define CONFIG_CDXL_DEMUXER 0
-%define CONFIG_CONCAT_DEMUXER 0
-%define CONFIG_DATA_DEMUXER 0
-%define CONFIG_DAUD_DEMUXER 0
-%define CONFIG_DFA_DEMUXER 0
-%define CONFIG_DIRAC_DEMUXER 0
-%define CONFIG_DNXHD_DEMUXER 0
-%define CONFIG_DSICIN_DEMUXER 0
-%define CONFIG_DTS_DEMUXER 0
-%define CONFIG_DTSHD_DEMUXER 0
-%define CONFIG_DV_DEMUXER 0
-%define CONFIG_DXA_DEMUXER 0
-%define CONFIG_EA_DEMUXER 0
-%define CONFIG_EA_CDATA_DEMUXER 0
-%define CONFIG_EAC3_DEMUXER 0
-%define CONFIG_EPAF_DEMUXER 0
-%define CONFIG_FFM_DEMUXER 0
-%define CONFIG_FFMETADATA_DEMUXER 0
-%define CONFIG_FILMSTRIP_DEMUXER 0
-%define CONFIG_FLAC_DEMUXER 0
-%define CONFIG_FLIC_DEMUXER 0
-%define CONFIG_FLV_DEMUXER 0
-%define CONFIG_FOURXM_DEMUXER 0
-%define CONFIG_FRM_DEMUXER 0
-%define CONFIG_G722_DEMUXER 0
-%define CONFIG_G723_1_DEMUXER 0
-%define CONFIG_G729_DEMUXER 0
-%define CONFIG_GIF_DEMUXER 0
-%define CONFIG_GSM_DEMUXER 0
-%define CONFIG_GXF_DEMUXER 0
-%define CONFIG_H261_DEMUXER 0
-%define CONFIG_H263_DEMUXER 0
-%define CONFIG_H264_DEMUXER 0
-%define CONFIG_HEVC_DEMUXER 0
-%define CONFIG_HLS_DEMUXER 0
-%define CONFIG_HNM_DEMUXER 0
-%define CONFIG_ICO_DEMUXER 0
-%define CONFIG_IDCIN_DEMUXER 0
-%define CONFIG_IDF_DEMUXER 0
-%define CONFIG_IFF_DEMUXER 0
-%define CONFIG_ILBC_DEMUXER 0
-%define CONFIG_IMAGE2_DEMUXER 0
-%define CONFIG_IMAGE2PIPE_DEMUXER 0
-%define CONFIG_INGENIENT_DEMUXER 0
-%define CONFIG_IPMOVIE_DEMUXER 0
-%define CONFIG_IRCAM_DEMUXER 0
-%define CONFIG_ISS_DEMUXER 0
-%define CONFIG_IV8_DEMUXER 0
-%define CONFIG_IVF_DEMUXER 0
-%define CONFIG_JACOSUB_DEMUXER 0
-%define CONFIG_JV_DEMUXER 0
-%define CONFIG_LATM_DEMUXER 0
-%define CONFIG_LMLM4_DEMUXER 0
-%define CONFIG_LOAS_DEMUXER 0
-%define CONFIG_LVF_DEMUXER 0
-%define CONFIG_LXF_DEMUXER 0
-%define CONFIG_M4V_DEMUXER 0
-%define CONFIG_MATROSKA_DEMUXER 1
-%define CONFIG_MGSTS_DEMUXER 0
-%define CONFIG_MICRODVD_DEMUXER 0
-%define CONFIG_MJPEG_DEMUXER 0
-%define CONFIG_MLP_DEMUXER 0
-%define CONFIG_MM_DEMUXER 0
-%define CONFIG_MMF_DEMUXER 0
-%define CONFIG_MOV_DEMUXER 1
-%define CONFIG_MP3_DEMUXER 1
-%define CONFIG_MPC_DEMUXER 0
-%define CONFIG_MPC8_DEMUXER 0
-%define CONFIG_MPEGPS_DEMUXER 0
-%define CONFIG_MPEGTS_DEMUXER 0
-%define CONFIG_MPEGTSRAW_DEMUXER 0
-%define CONFIG_MPEGVIDEO_DEMUXER 0
-%define CONFIG_MPL2_DEMUXER 0
-%define CONFIG_MPSUB_DEMUXER 0
-%define CONFIG_MSNWC_TCP_DEMUXER 0
-%define CONFIG_MTV_DEMUXER 0
-%define CONFIG_MV_DEMUXER 0
-%define CONFIG_MVI_DEMUXER 0
-%define CONFIG_MXF_DEMUXER 0
-%define CONFIG_MXG_DEMUXER 0
-%define CONFIG_NC_DEMUXER 0
-%define CONFIG_NISTSPHERE_DEMUXER 0
-%define CONFIG_NSV_DEMUXER 0
-%define CONFIG_NUT_DEMUXER 0
-%define CONFIG_NUV_DEMUXER 0
-%define CONFIG_OGG_DEMUXER 1
-%define CONFIG_OMA_DEMUXER 0
-%define CONFIG_PAF_DEMUXER 0
-%define CONFIG_PCM_ALAW_DEMUXER 0
-%define CONFIG_PCM_MULAW_DEMUXER 0
-%define CONFIG_PCM_F64BE_DEMUXER 0
-%define CONFIG_PCM_F64LE_DEMUXER 0
-%define CONFIG_PCM_F32BE_DEMUXER 0
-%define CONFIG_PCM_F32LE_DEMUXER 0
-%define CONFIG_PCM_S32BE_DEMUXER 0
-%define CONFIG_PCM_S32LE_DEMUXER 0
-%define CONFIG_PCM_S24BE_DEMUXER 0
-%define CONFIG_PCM_S24LE_DEMUXER 0
-%define CONFIG_PCM_S16BE_DEMUXER 0
-%define CONFIG_PCM_S16LE_DEMUXER 0
-%define CONFIG_PCM_S8_DEMUXER 0
-%define CONFIG_PCM_U32BE_DEMUXER 0
-%define CONFIG_PCM_U32LE_DEMUXER 0
-%define CONFIG_PCM_U24BE_DEMUXER 0
-%define CONFIG_PCM_U24LE_DEMUXER 0
-%define CONFIG_PCM_U16BE_DEMUXER 0
-%define CONFIG_PCM_U16LE_DEMUXER 0
-%define CONFIG_PCM_U8_DEMUXER 0
-%define CONFIG_PJS_DEMUXER 0
-%define CONFIG_PMP_DEMUXER 0
-%define CONFIG_PVA_DEMUXER 0
-%define CONFIG_PVF_DEMUXER 0
-%define CONFIG_QCP_DEMUXER 0
-%define CONFIG_R3D_DEMUXER 0
-%define CONFIG_RAWVIDEO_DEMUXER 0
-%define CONFIG_REALTEXT_DEMUXER 0
-%define CONFIG_REDSPARK_DEMUXER 0
-%define CONFIG_RL2_DEMUXER 0
-%define CONFIG_RM_DEMUXER 0
-%define CONFIG_ROQ_DEMUXER 0
-%define CONFIG_RPL_DEMUXER 0
-%define CONFIG_RSD_DEMUXER 0
-%define CONFIG_RSO_DEMUXER 0
-%define CONFIG_RTP_DEMUXER 0
-%define CONFIG_RTSP_DEMUXER 0
-%define CONFIG_SAMI_DEMUXER 0
-%define CONFIG_SAP_DEMUXER 0
-%define CONFIG_SBG_DEMUXER 0
-%define CONFIG_SDP_DEMUXER 0
-%define CONFIG_SEGAFILM_DEMUXER 0
-%define CONFIG_SHORTEN_DEMUXER 0
-%define CONFIG_SIFF_DEMUXER 0
-%define CONFIG_SMACKER_DEMUXER 0
-%define CONFIG_SMJPEG_DEMUXER 0
-%define CONFIG_SMUSH_DEMUXER 0
-%define CONFIG_SOL_DEMUXER 0
-%define CONFIG_SOX_DEMUXER 0
-%define CONFIG_SPDIF_DEMUXER 0
-%define CONFIG_SRT_DEMUXER 0
-%define CONFIG_STR_DEMUXER 0
-%define CONFIG_SUBVIEWER1_DEMUXER 0
-%define CONFIG_SUBVIEWER_DEMUXER 0
-%define CONFIG_SWF_DEMUXER 0
-%define CONFIG_TAK_DEMUXER 0
-%define CONFIG_TEDCAPTIONS_DEMUXER 0
-%define CONFIG_THP_DEMUXER 0
-%define CONFIG_TIERTEXSEQ_DEMUXER 0
-%define CONFIG_TMV_DEMUXER 0
-%define CONFIG_TRUEHD_DEMUXER 0
-%define CONFIG_TTA_DEMUXER 0
-%define CONFIG_TXD_DEMUXER 0
-%define CONFIG_TTY_DEMUXER 0
-%define CONFIG_VC1_DEMUXER 0
-%define CONFIG_VC1T_DEMUXER 0
-%define CONFIG_VIVO_DEMUXER 0
-%define CONFIG_VMD_DEMUXER 0
-%define CONFIG_VOBSUB_DEMUXER 0
-%define CONFIG_VOC_DEMUXER 0
-%define CONFIG_VPLAYER_DEMUXER 0
-%define CONFIG_VQF_DEMUXER 0
-%define CONFIG_W64_DEMUXER 0
-%define CONFIG_WAV_DEMUXER 1
-%define CONFIG_WC3_DEMUXER 0
-%define CONFIG_WEBVTT_DEMUXER 0
-%define CONFIG_WSAUD_DEMUXER 0
-%define CONFIG_WSVQA_DEMUXER 0
-%define CONFIG_WTV_DEMUXER 0
-%define CONFIG_WV_DEMUXER 0
-%define CONFIG_XA_DEMUXER 0
-%define CONFIG_XBIN_DEMUXER 0
-%define CONFIG_XMV_DEMUXER 0
-%define CONFIG_XWMA_DEMUXER 0
-%define CONFIG_YOP_DEMUXER 0
-%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
-%define CONFIG_LIBGME_DEMUXER 0
-%define CONFIG_LIBMODPLUG_DEMUXER 0
-%define CONFIG_LIBNUT_DEMUXER 0
-%define CONFIG_LIBQUVI_DEMUXER 0
-%define CONFIG_A64MULTI_ENCODER 0
-%define CONFIG_A64MULTI5_ENCODER 0
-%define CONFIG_AMV_ENCODER 0
-%define CONFIG_ASV1_ENCODER 0
-%define CONFIG_ASV2_ENCODER 0
-%define CONFIG_AVRP_ENCODER 0
-%define CONFIG_AVUI_ENCODER 0
-%define CONFIG_AYUV_ENCODER 0
-%define CONFIG_BMP_ENCODER 0
-%define CONFIG_CLJR_ENCODER 0
-%define CONFIG_COMFORTNOISE_ENCODER 0
-%define CONFIG_DNXHD_ENCODER 0
-%define CONFIG_DPX_ENCODER 0
-%define CONFIG_DVVIDEO_ENCODER 0
-%define CONFIG_FFV1_ENCODER 0
-%define CONFIG_FFVHUFF_ENCODER 0
-%define CONFIG_FLASHSV_ENCODER 0
-%define CONFIG_FLASHSV2_ENCODER 0
-%define CONFIG_FLV_ENCODER 0
-%define CONFIG_GIF_ENCODER 0
-%define CONFIG_H261_ENCODER 0
-%define CONFIG_H263_ENCODER 0
-%define CONFIG_H263P_ENCODER 0
-%define CONFIG_HUFFYUV_ENCODER 0
-%define CONFIG_JPEG2000_ENCODER 0
-%define CONFIG_JPEGLS_ENCODER 0
-%define CONFIG_LJPEG_ENCODER 0
-%define CONFIG_MJPEG_ENCODER 0
-%define CONFIG_MPEG1VIDEO_ENCODER 0
-%define CONFIG_MPEG2VIDEO_ENCODER 0
-%define CONFIG_MPEG4_ENCODER 0
-%define CONFIG_MSMPEG4V2_ENCODER 0
-%define CONFIG_MSMPEG4V3_ENCODER 0
-%define CONFIG_MSVIDEO1_ENCODER 0
-%define CONFIG_PAM_ENCODER 0
-%define CONFIG_PBM_ENCODER 0
-%define CONFIG_PCX_ENCODER 0
-%define CONFIG_PGM_ENCODER 0
-%define CONFIG_PGMYUV_ENCODER 0
-%define CONFIG_PNG_ENCODER 0
-%define CONFIG_PPM_ENCODER 0
-%define CONFIG_PRORES_ENCODER 0
-%define CONFIG_PRORES_AW_ENCODER 0
-%define CONFIG_PRORES_KS_ENCODER 0
-%define CONFIG_QTRLE_ENCODER 0
-%define CONFIG_R10K_ENCODER 0
-%define CONFIG_R210_ENCODER 0
-%define CONFIG_RAWVIDEO_ENCODER 0
-%define CONFIG_ROQ_ENCODER 0
-%define CONFIG_RV10_ENCODER 0
-%define CONFIG_RV20_ENCODER 0
-%define CONFIG_S302M_ENCODER 0
-%define CONFIG_SGI_ENCODER 0
-%define CONFIG_SNOW_ENCODER 0
-%define CONFIG_SUNRAST_ENCODER 0
-%define CONFIG_SVQ1_ENCODER 0
-%define CONFIG_TARGA_ENCODER 0
-%define CONFIG_TIFF_ENCODER 0
-%define CONFIG_UTVIDEO_ENCODER 0
-%define CONFIG_V210_ENCODER 0
-%define CONFIG_V308_ENCODER 0
-%define CONFIG_V408_ENCODER 0
-%define CONFIG_V410_ENCODER 0
-%define CONFIG_WMV1_ENCODER 0
-%define CONFIG_WMV2_ENCODER 0
-%define CONFIG_XBM_ENCODER 0
-%define CONFIG_XFACE_ENCODER 0
-%define CONFIG_XWD_ENCODER 0
-%define CONFIG_Y41P_ENCODER 0
-%define CONFIG_YUV4_ENCODER 0
-%define CONFIG_ZLIB_ENCODER 0
-%define CONFIG_ZMBV_ENCODER 0
-%define CONFIG_AAC_ENCODER 0
-%define CONFIG_AC3_ENCODER 0
-%define CONFIG_AC3_FIXED_ENCODER 0
-%define CONFIG_ALAC_ENCODER 0
-%define CONFIG_DCA_ENCODER 0
-%define CONFIG_EAC3_ENCODER 0
-%define CONFIG_FLAC_ENCODER 0
-%define CONFIG_G723_1_ENCODER 0
-%define CONFIG_MP2_ENCODER 0
-%define CONFIG_MP2FIXED_ENCODER 0
-%define CONFIG_NELLYMOSER_ENCODER 0
-%define CONFIG_RA_144_ENCODER 0
-%define CONFIG_SONIC_ENCODER 0
-%define CONFIG_SONIC_LS_ENCODER 0
-%define CONFIG_TTA_ENCODER 0
-%define CONFIG_VORBIS_ENCODER 0
-%define CONFIG_WAVPACK_ENCODER 0
-%define CONFIG_WMAV1_ENCODER 0
-%define CONFIG_WMAV2_ENCODER 0
-%define CONFIG_PCM_ALAW_ENCODER 0
-%define CONFIG_PCM_F32BE_ENCODER 0
-%define CONFIG_PCM_F32LE_ENCODER 0
-%define CONFIG_PCM_F64BE_ENCODER 0
-%define CONFIG_PCM_F64LE_ENCODER 0
-%define CONFIG_PCM_MULAW_ENCODER 0
-%define CONFIG_PCM_S8_ENCODER 0
-%define CONFIG_PCM_S8_PLANAR_ENCODER 0
-%define CONFIG_PCM_S16BE_ENCODER 0
-%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S16LE_ENCODER 0
-%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S24BE_ENCODER 0
-%define CONFIG_PCM_S24DAUD_ENCODER 0
-%define CONFIG_PCM_S24LE_ENCODER 0
-%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S32BE_ENCODER 0
-%define CONFIG_PCM_S32LE_ENCODER 0
-%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_U8_ENCODER 0
-%define CONFIG_PCM_U16BE_ENCODER 0
-%define CONFIG_PCM_U16LE_ENCODER 0
-%define CONFIG_PCM_U24BE_ENCODER 0
-%define CONFIG_PCM_U24LE_ENCODER 0
-%define CONFIG_PCM_U32BE_ENCODER 0
-%define CONFIG_PCM_U32LE_ENCODER 0
-%define CONFIG_ROQ_DPCM_ENCODER 0
-%define CONFIG_ADPCM_ADX_ENCODER 0
-%define CONFIG_ADPCM_G722_ENCODER 0
-%define CONFIG_ADPCM_G726_ENCODER 0
-%define CONFIG_ADPCM_IMA_QT_ENCODER 0
-%define CONFIG_ADPCM_IMA_WAV_ENCODER 0
-%define CONFIG_ADPCM_MS_ENCODER 0
-%define CONFIG_ADPCM_SWF_ENCODER 0
-%define CONFIG_ADPCM_YAMAHA_ENCODER 0
-%define CONFIG_SSA_ENCODER 0
-%define CONFIG_ASS_ENCODER 0
-%define CONFIG_DVBSUB_ENCODER 0
-%define CONFIG_DVDSUB_ENCODER 0
-%define CONFIG_MOVTEXT_ENCODER 0
-%define CONFIG_SRT_ENCODER 0
-%define CONFIG_SUBRIP_ENCODER 0
-%define CONFIG_XSUB_ENCODER 0
-%define CONFIG_LIBFAAC_ENCODER 0
-%define CONFIG_LIBFDK_AAC_ENCODER 0
-%define CONFIG_LIBGSM_ENCODER 0
-%define CONFIG_LIBGSM_MS_ENCODER 0
-%define CONFIG_LIBILBC_ENCODER 0
-%define CONFIG_LIBMP3LAME_ENCODER 0
-%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
-%define CONFIG_LIBOPENJPEG_ENCODER 0
-%define CONFIG_LIBOPUS_ENCODER 0
-%define CONFIG_LIBSCHROEDINGER_ENCODER 0
-%define CONFIG_LIBSHINE_ENCODER 0
-%define CONFIG_LIBSPEEX_ENCODER 0
-%define CONFIG_LIBTHEORA_ENCODER 0
-%define CONFIG_LIBTWOLAME_ENCODER 0
-%define CONFIG_LIBUTVIDEO_ENCODER 0
-%define CONFIG_LIBVO_AACENC_ENCODER 0
-%define CONFIG_LIBVO_AMRWBENC_ENCODER 0
-%define CONFIG_LIBVORBIS_ENCODER 0
-%define CONFIG_LIBVPX_VP8_ENCODER 0
-%define CONFIG_LIBVPX_VP9_ENCODER 0
-%define CONFIG_LIBWAVPACK_ENCODER 0
-%define CONFIG_LIBX264_ENCODER 0
-%define CONFIG_LIBX264RGB_ENCODER 0
-%define CONFIG_LIBXAVS_ENCODER 0
-%define CONFIG_LIBXVID_ENCODER 0
-%define CONFIG_LIBAACPLUS_ENCODER 0
-%define CONFIG_ACONVERT_FILTER 0
-%define CONFIG_ADELAY_FILTER 0
-%define CONFIG_AECHO_FILTER 0
-%define CONFIG_AEVAL_FILTER 0
-%define CONFIG_AFADE_FILTER 0
-%define CONFIG_AFORMAT_FILTER 0
-%define CONFIG_AINTERLEAVE_FILTER 0
-%define CONFIG_ALLPASS_FILTER 0
-%define CONFIG_AMERGE_FILTER 0
-%define CONFIG_AMIX_FILTER 0
-%define CONFIG_ANULL_FILTER 0
-%define CONFIG_APAD_FILTER 0
-%define CONFIG_APERMS_FILTER 0
-%define CONFIG_APHASER_FILTER 0
-%define CONFIG_ARESAMPLE_FILTER 0
-%define CONFIG_ASELECT_FILTER 0
-%define CONFIG_ASENDCMD_FILTER 0
-%define CONFIG_ASETNSAMPLES_FILTER 0
-%define CONFIG_ASETPTS_FILTER 0
-%define CONFIG_ASETRATE_FILTER 0
-%define CONFIG_ASETTB_FILTER 0
-%define CONFIG_ASHOWINFO_FILTER 0
-%define CONFIG_ASPLIT_FILTER 0
-%define CONFIG_ASTATS_FILTER 0
-%define CONFIG_ASTREAMSYNC_FILTER 0
-%define CONFIG_ASYNCTS_FILTER 0
-%define CONFIG_ATEMPO_FILTER 0
-%define CONFIG_ATRIM_FILTER 0
-%define CONFIG_AZMQ_FILTER 0
-%define CONFIG_BANDPASS_FILTER 0
-%define CONFIG_BANDREJECT_FILTER 0
-%define CONFIG_BASS_FILTER 0
-%define CONFIG_BIQUAD_FILTER 0
-%define CONFIG_CHANNELMAP_FILTER 0
-%define CONFIG_CHANNELSPLIT_FILTER 0
-%define CONFIG_COMPAND_FILTER 0
-%define CONFIG_EARWAX_FILTER 0
-%define CONFIG_EBUR128_FILTER 0
-%define CONFIG_EQUALIZER_FILTER 0
-%define CONFIG_HIGHPASS_FILTER 0
-%define CONFIG_JOIN_FILTER 0
-%define CONFIG_LADSPA_FILTER 0
-%define CONFIG_LOWPASS_FILTER 0
-%define CONFIG_PAN_FILTER 0
-%define CONFIG_REPLAYGAIN_FILTER 0
-%define CONFIG_RESAMPLE_FILTER 0
-%define CONFIG_SILENCEDETECT_FILTER 0
-%define CONFIG_TREBLE_FILTER 0
-%define CONFIG_VOLUME_FILTER 0
-%define CONFIG_VOLUMEDETECT_FILTER 0
-%define CONFIG_AEVALSRC_FILTER 0
-%define CONFIG_ANULLSRC_FILTER 0
-%define CONFIG_FLITE_FILTER 0
-%define CONFIG_SINE_FILTER 0
-%define CONFIG_ANULLSINK_FILTER 0
-%define CONFIG_ALPHAEXTRACT_FILTER 0
-%define CONFIG_ALPHAMERGE_FILTER 0
-%define CONFIG_ASS_FILTER 0
-%define CONFIG_BBOX_FILTER 0
-%define CONFIG_BLACKDETECT_FILTER 0
-%define CONFIG_BLACKFRAME_FILTER 0
-%define CONFIG_BLEND_FILTER 0
-%define CONFIG_BOXBLUR_FILTER 0
-%define CONFIG_COLORBALANCE_FILTER 0
-%define CONFIG_COLORCHANNELMIXER_FILTER 0
-%define CONFIG_COLORMATRIX_FILTER 0
-%define CONFIG_COPY_FILTER 0
-%define CONFIG_CROP_FILTER 0
-%define CONFIG_CROPDETECT_FILTER 0
-%define CONFIG_CURVES_FILTER 0
-%define CONFIG_DCTDNOIZ_FILTER 0
-%define CONFIG_DECIMATE_FILTER 0
-%define CONFIG_DELOGO_FILTER 0
-%define CONFIG_DESHAKE_FILTER 0
-%define CONFIG_DRAWBOX_FILTER 0
-%define CONFIG_DRAWGRID_FILTER 0
-%define CONFIG_DRAWTEXT_FILTER 0
-%define CONFIG_EDGEDETECT_FILTER 0
-%define CONFIG_ELBG_FILTER 0
-%define CONFIG_EXTRACTPLANES_FILTER 0
-%define CONFIG_FADE_FILTER 0
-%define CONFIG_FIELD_FILTER 0
-%define CONFIG_FIELDMATCH_FILTER 0
-%define CONFIG_FIELDORDER_FILTER 0
-%define CONFIG_FORMAT_FILTER 0
-%define CONFIG_FPS_FILTER 0
-%define CONFIG_FRAMESTEP_FILTER 0
-%define CONFIG_FREI0R_FILTER 0
-%define CONFIG_GEQ_FILTER 0
-%define CONFIG_GRADFUN_FILTER 0
-%define CONFIG_HALDCLUT_FILTER 0
-%define CONFIG_HFLIP_FILTER 0
-%define CONFIG_HISTEQ_FILTER 0
-%define CONFIG_HISTOGRAM_FILTER 0
-%define CONFIG_HQDN3D_FILTER 0
-%define CONFIG_HUE_FILTER 0
-%define CONFIG_IDET_FILTER 0
-%define CONFIG_IL_FILTER 0
-%define CONFIG_INTERLACE_FILTER 0
-%define CONFIG_INTERLEAVE_FILTER 0
-%define CONFIG_KERNDEINT_FILTER 0
-%define CONFIG_LUT3D_FILTER 0
-%define CONFIG_LUT_FILTER 0
-%define CONFIG_LUTRGB_FILTER 0
-%define CONFIG_LUTYUV_FILTER 0
-%define CONFIG_MCDEINT_FILTER 0
-%define CONFIG_MERGEPLANES_FILTER 0
-%define CONFIG_MP_FILTER 0
-%define CONFIG_MPDECIMATE_FILTER 0
-%define CONFIG_NEGATE_FILTER 0
-%define CONFIG_NOFORMAT_FILTER 0
-%define CONFIG_NOISE_FILTER 0
-%define CONFIG_NULL_FILTER 0
-%define CONFIG_OCV_FILTER 0
-%define CONFIG_OVERLAY_FILTER 0
-%define CONFIG_OWDENOISE_FILTER 0
-%define CONFIG_PAD_FILTER 0
-%define CONFIG_PERMS_FILTER 0
-%define CONFIG_PERSPECTIVE_FILTER 0
-%define CONFIG_PHASE_FILTER 0
-%define CONFIG_PIXDESCTEST_FILTER 0
-%define CONFIG_PP_FILTER 0
-%define CONFIG_PSNR_FILTER 0
-%define CONFIG_PULLUP_FILTER 0
-%define CONFIG_REMOVELOGO_FILTER 0
-%define CONFIG_ROTATE_FILTER 0
-%define CONFIG_SAB_FILTER 0
-%define CONFIG_SCALE_FILTER 0
-%define CONFIG_SELECT_FILTER 0
-%define CONFIG_SENDCMD_FILTER 0
-%define CONFIG_SEPARATEFIELDS_FILTER 0
-%define CONFIG_SETDAR_FILTER 0
-%define CONFIG_SETFIELD_FILTER 0
-%define CONFIG_SETPTS_FILTER 0
-%define CONFIG_SETSAR_FILTER 0
-%define CONFIG_SETTB_FILTER 0
-%define CONFIG_SHOWINFO_FILTER 0
-%define CONFIG_SMARTBLUR_FILTER 0
-%define CONFIG_SPLIT_FILTER 0
-%define CONFIG_SPP_FILTER 0
-%define CONFIG_STEREO3D_FILTER 0
-%define CONFIG_SUBTITLES_FILTER 0
-%define CONFIG_SUPER2XSAI_FILTER 0
-%define CONFIG_SWAPUV_FILTER 0
-%define CONFIG_TELECINE_FILTER 0
-%define CONFIG_THUMBNAIL_FILTER 0
-%define CONFIG_TILE_FILTER 0
-%define CONFIG_TINTERLACE_FILTER 0
-%define CONFIG_TRANSPOSE_FILTER 0
-%define CONFIG_TRIM_FILTER 0
-%define CONFIG_UNSHARP_FILTER 0
-%define CONFIG_VFLIP_FILTER 0
-%define CONFIG_VIDSTABDETECT_FILTER 0
-%define CONFIG_VIDSTABTRANSFORM_FILTER 0
-%define CONFIG_VIGNETTE_FILTER 0
-%define CONFIG_W3FDIF_FILTER 0
-%define CONFIG_YADIF_FILTER 0
-%define CONFIG_ZMQ_FILTER 0
-%define CONFIG_CELLAUTO_FILTER 0
-%define CONFIG_COLOR_FILTER 0
-%define CONFIG_FREI0R_SRC_FILTER 0
-%define CONFIG_HALDCLUTSRC_FILTER 0
-%define CONFIG_LIFE_FILTER 0
-%define CONFIG_MANDELBROT_FILTER 0
-%define CONFIG_MPTESTSRC_FILTER 0
-%define CONFIG_NULLSRC_FILTER 0
-%define CONFIG_RGBTESTSRC_FILTER 0
-%define CONFIG_SMPTEBARS_FILTER 0
-%define CONFIG_SMPTEHDBARS_FILTER 0
-%define CONFIG_TESTSRC_FILTER 0
-%define CONFIG_NULLSINK_FILTER 0
-%define CONFIG_AVECTORSCOPE_FILTER 0
-%define CONFIG_CONCAT_FILTER 0
-%define CONFIG_SHOWSPECTRUM_FILTER 0
-%define CONFIG_SHOWWAVES_FILTER 0
-%define CONFIG_AMOVIE_FILTER 0
-%define CONFIG_MOVIE_FILTER 0
-%define CONFIG_H263_VAAPI_HWACCEL 0
-%define CONFIG_H263_VDPAU_HWACCEL 0
-%define CONFIG_H264_DXVA2_HWACCEL 0
-%define CONFIG_H264_VAAPI_HWACCEL 0
-%define CONFIG_H264_VDA_HWACCEL 0
-%define CONFIG_H264_VDPAU_HWACCEL 0
-%define CONFIG_MPEG1_VDPAU_HWACCEL 0
-%define CONFIG_MPEG2_DXVA2_HWACCEL 0
-%define CONFIG_MPEG2_VAAPI_HWACCEL 0
-%define CONFIG_MPEG2_VDPAU_HWACCEL 0
-%define CONFIG_MPEG4_VAAPI_HWACCEL 0
-%define CONFIG_MPEG4_VDPAU_HWACCEL 0
-%define CONFIG_VC1_DXVA2_HWACCEL 0
-%define CONFIG_VC1_VAAPI_HWACCEL 0
-%define CONFIG_VC1_VDPAU_HWACCEL 0
-%define CONFIG_WMV3_DXVA2_HWACCEL 0
-%define CONFIG_WMV3_VAAPI_HWACCEL 0
-%define CONFIG_WMV3_VDPAU_HWACCEL 0
-%define CONFIG_ALSA_INDEV 0
-%define CONFIG_BKTR_INDEV 0
-%define CONFIG_DSHOW_INDEV 0
-%define CONFIG_DV1394_INDEV 0
-%define CONFIG_FBDEV_INDEV 0
-%define CONFIG_IEC61883_INDEV 0
-%define CONFIG_JACK_INDEV 0
-%define CONFIG_LAVFI_INDEV 0
-%define CONFIG_OPENAL_INDEV 0
-%define CONFIG_OSS_INDEV 0
-%define CONFIG_PULSE_INDEV 0
-%define CONFIG_SNDIO_INDEV 0
-%define CONFIG_V4L2_INDEV 0
-%define CONFIG_VFWCAP_INDEV 0
-%define CONFIG_X11GRAB_INDEV 0
-%define CONFIG_LIBCDIO_INDEV 0
-%define CONFIG_LIBDC1394_INDEV 0
-%define CONFIG_A64_MUXER 0
-%define CONFIG_AC3_MUXER 0
-%define CONFIG_ADTS_MUXER 0
-%define CONFIG_ADX_MUXER 0
-%define CONFIG_AIFF_MUXER 0
-%define CONFIG_AMR_MUXER 0
-%define CONFIG_ASF_MUXER 0
-%define CONFIG_ASS_MUXER 0
-%define CONFIG_AST_MUXER 0
-%define CONFIG_ASF_STREAM_MUXER 0
-%define CONFIG_AU_MUXER 0
-%define CONFIG_AVI_MUXER 0
-%define CONFIG_AVM2_MUXER 0
-%define CONFIG_BIT_MUXER 0
-%define CONFIG_CAF_MUXER 0
-%define CONFIG_CAVSVIDEO_MUXER 0
-%define CONFIG_CRC_MUXER 0
-%define CONFIG_DATA_MUXER 0
-%define CONFIG_DAUD_MUXER 0
-%define CONFIG_DIRAC_MUXER 0
-%define CONFIG_DNXHD_MUXER 0
-%define CONFIG_DTS_MUXER 0
-%define CONFIG_DV_MUXER 0
-%define CONFIG_EAC3_MUXER 0
-%define CONFIG_F4V_MUXER 0
-%define CONFIG_FFM_MUXER 0
-%define CONFIG_FFMETADATA_MUXER 0
-%define CONFIG_FILMSTRIP_MUXER 0
-%define CONFIG_FLAC_MUXER 0
-%define CONFIG_FLV_MUXER 0
-%define CONFIG_FRAMECRC_MUXER 0
-%define CONFIG_FRAMEMD5_MUXER 0
-%define CONFIG_G722_MUXER 0
-%define CONFIG_G723_1_MUXER 0
-%define CONFIG_GIF_MUXER 0
-%define CONFIG_GXF_MUXER 0
-%define CONFIG_H261_MUXER 0
-%define CONFIG_H263_MUXER 0
-%define CONFIG_H264_MUXER 0
-%define CONFIG_HDS_MUXER 0
-%define CONFIG_HLS_MUXER 0
-%define CONFIG_ICO_MUXER 0
-%define CONFIG_ILBC_MUXER 0
-%define CONFIG_IMAGE2_MUXER 0
-%define CONFIG_IMAGE2PIPE_MUXER 0
-%define CONFIG_IPOD_MUXER 0
-%define CONFIG_IRCAM_MUXER 0
-%define CONFIG_ISMV_MUXER 0
-%define CONFIG_IVF_MUXER 0
-%define CONFIG_JACOSUB_MUXER 0
-%define CONFIG_LATM_MUXER 0
-%define CONFIG_M4V_MUXER 0
-%define CONFIG_MD5_MUXER 0
-%define CONFIG_MATROSKA_MUXER 0
-%define CONFIG_MATROSKA_AUDIO_MUXER 0
-%define CONFIG_MICRODVD_MUXER 0
-%define CONFIG_MJPEG_MUXER 0
-%define CONFIG_MLP_MUXER 0
-%define CONFIG_MMF_MUXER 0
-%define CONFIG_MOV_MUXER 0
-%define CONFIG_MP2_MUXER 0
-%define CONFIG_MP3_MUXER 0
-%define CONFIG_MP4_MUXER 0
-%define CONFIG_MPEG1SYSTEM_MUXER 0
-%define CONFIG_MPEG1VCD_MUXER 0
-%define CONFIG_MPEG1VIDEO_MUXER 0
-%define CONFIG_MPEG2DVD_MUXER 0
-%define CONFIG_MPEG2SVCD_MUXER 0
-%define CONFIG_MPEG2VIDEO_MUXER 0
-%define CONFIG_MPEG2VOB_MUXER 0
-%define CONFIG_MPEGTS_MUXER 0
-%define CONFIG_MPJPEG_MUXER 0
-%define CONFIG_MXF_MUXER 0
-%define CONFIG_MXF_D10_MUXER 0
-%define CONFIG_NULL_MUXER 0
-%define CONFIG_NUT_MUXER 0
-%define CONFIG_OGG_MUXER 0
-%define CONFIG_OMA_MUXER 0
-%define CONFIG_OPUS_MUXER 0
-%define CONFIG_PCM_ALAW_MUXER 0
-%define CONFIG_PCM_MULAW_MUXER 0
-%define CONFIG_PCM_F64BE_MUXER 0
-%define CONFIG_PCM_F64LE_MUXER 0
-%define CONFIG_PCM_F32BE_MUXER 0
-%define CONFIG_PCM_F32LE_MUXER 0
-%define CONFIG_PCM_S32BE_MUXER 0
-%define CONFIG_PCM_S32LE_MUXER 0
-%define CONFIG_PCM_S24BE_MUXER 0
-%define CONFIG_PCM_S24LE_MUXER 0
-%define CONFIG_PCM_S16BE_MUXER 0
-%define CONFIG_PCM_S16LE_MUXER 0
-%define CONFIG_PCM_S8_MUXER 0
-%define CONFIG_PCM_U32BE_MUXER 0
-%define CONFIG_PCM_U32LE_MUXER 0
-%define CONFIG_PCM_U24BE_MUXER 0
-%define CONFIG_PCM_U24LE_MUXER 0
-%define CONFIG_PCM_U16BE_MUXER 0
-%define CONFIG_PCM_U16LE_MUXER 0
-%define CONFIG_PCM_U8_MUXER 0
-%define CONFIG_PSP_MUXER 0
-%define CONFIG_RAWVIDEO_MUXER 0
-%define CONFIG_RM_MUXER 0
-%define CONFIG_ROQ_MUXER 0
-%define CONFIG_RSO_MUXER 0
-%define CONFIG_RTP_MUXER 0
-%define CONFIG_RTSP_MUXER 0
-%define CONFIG_SAP_MUXER 0
-%define CONFIG_SEGMENT_MUXER 0
-%define CONFIG_STREAM_SEGMENT_MUXER 0
-%define CONFIG_SMJPEG_MUXER 0
-%define CONFIG_SMOOTHSTREAMING_MUXER 0
-%define CONFIG_SOX_MUXER 0
-%define CONFIG_SPDIF_MUXER 0
-%define CONFIG_SPEEX_MUXER 0
-%define CONFIG_SRT_MUXER 0
-%define CONFIG_SWF_MUXER 0
-%define CONFIG_TEE_MUXER 0
-%define CONFIG_TG2_MUXER 0
-%define CONFIG_TGP_MUXER 0
-%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
-%define CONFIG_TRUEHD_MUXER 0
-%define CONFIG_VC1_MUXER 0
-%define CONFIG_VC1T_MUXER 0
-%define CONFIG_VOC_MUXER 0
-%define CONFIG_W64_MUXER 0
-%define CONFIG_WAV_MUXER 0
-%define CONFIG_WEBM_MUXER 0
-%define CONFIG_WEBVTT_MUXER 0
-%define CONFIG_WTV_MUXER 0
-%define CONFIG_WV_MUXER 0
-%define CONFIG_YUV4MPEGPIPE_MUXER 0
-%define CONFIG_LIBNUT_MUXER 0
-%define CONFIG_ALSA_OUTDEV 0
-%define CONFIG_CACA_OUTDEV 0
-%define CONFIG_FBDEV_OUTDEV 0
-%define CONFIG_OSS_OUTDEV 0
-%define CONFIG_PULSE_OUTDEV 0
-%define CONFIG_SDL_OUTDEV 0
-%define CONFIG_SNDIO_OUTDEV 0
-%define CONFIG_V4L2_OUTDEV 0
-%define CONFIG_XV_OUTDEV 0
-%define CONFIG_AAC_PARSER 1
-%define CONFIG_AAC_LATM_PARSER 0
-%define CONFIG_AC3_PARSER 0
-%define CONFIG_ADX_PARSER 0
-%define CONFIG_BMP_PARSER 0
-%define CONFIG_CAVSVIDEO_PARSER 0
-%define CONFIG_COOK_PARSER 0
-%define CONFIG_DCA_PARSER 0
-%define CONFIG_DIRAC_PARSER 0
-%define CONFIG_DNXHD_PARSER 0
-%define CONFIG_DPX_PARSER 0
-%define CONFIG_DVBSUB_PARSER 0
-%define CONFIG_DVDSUB_PARSER 0
-%define CONFIG_DVD_NAV_PARSER 0
-%define CONFIG_FLAC_PARSER 0
-%define CONFIG_GSM_PARSER 0
-%define CONFIG_H261_PARSER 0
-%define CONFIG_H263_PARSER 0
-%define CONFIG_H264_PARSER 1
-%define CONFIG_HEVC_PARSER 0
-%define CONFIG_MJPEG_PARSER 0
-%define CONFIG_MLP_PARSER 0
-%define CONFIG_MPEG4VIDEO_PARSER 0
-%define CONFIG_MPEGAUDIO_PARSER 1
-%define CONFIG_MPEGVIDEO_PARSER 0
-%define CONFIG_PNG_PARSER 0
-%define CONFIG_PNM_PARSER 0
-%define CONFIG_RV30_PARSER 0
-%define CONFIG_RV40_PARSER 0
-%define CONFIG_TAK_PARSER 0
-%define CONFIG_VC1_PARSER 0
-%define CONFIG_VORBIS_PARSER 1
-%define CONFIG_VP3_PARSER 1
-%define CONFIG_VP8_PARSER 1
-%define CONFIG_VP9_PARSER 0
-%define CONFIG_BLURAY_PROTOCOL 0
-%define CONFIG_CACHE_PROTOCOL 0
-%define CONFIG_CONCAT_PROTOCOL 0
-%define CONFIG_CRYPTO_PROTOCOL 0
-%define CONFIG_DATA_PROTOCOL 0
-%define CONFIG_FFRTMPCRYPT_PROTOCOL 0
-%define CONFIG_FFRTMPHTTP_PROTOCOL 0
-%define CONFIG_FILE_PROTOCOL 0
-%define CONFIG_FTP_PROTOCOL 0
-%define CONFIG_GOPHER_PROTOCOL 0
-%define CONFIG_HLS_PROTOCOL 0
-%define CONFIG_HTTP_PROTOCOL 0
-%define CONFIG_HTTPPROXY_PROTOCOL 0
-%define CONFIG_HTTPS_PROTOCOL 0
-%define CONFIG_MMSH_PROTOCOL 0
-%define CONFIG_MMST_PROTOCOL 0
-%define CONFIG_MD5_PROTOCOL 0
-%define CONFIG_PIPE_PROTOCOL 0
-%define CONFIG_RTMP_PROTOCOL 0
-%define CONFIG_RTMPE_PROTOCOL 0
-%define CONFIG_RTMPS_PROTOCOL 0
-%define CONFIG_RTMPT_PROTOCOL 0
-%define CONFIG_RTMPTE_PROTOCOL 0
-%define CONFIG_RTMPTS_PROTOCOL 0
-%define CONFIG_RTP_PROTOCOL 0
-%define CONFIG_SCTP_PROTOCOL 0
-%define CONFIG_SRTP_PROTOCOL 0
-%define CONFIG_TCP_PROTOCOL 0
-%define CONFIG_TLS_PROTOCOL 0
-%define CONFIG_UDP_PROTOCOL 0
-%define CONFIG_UNIX_PROTOCOL 0
-%define CONFIG_LIBRTMP_PROTOCOL 0
-%define CONFIG_LIBRTMPE_PROTOCOL 0
-%define CONFIG_LIBRTMPS_PROTOCOL 0
-%define CONFIG_LIBRTMPT_PROTOCOL 0
-%define CONFIG_LIBRTMPTE_PROTOCOL 0
-%define CONFIG_LIBSSH_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/libavutil/avconfig.h
deleted file mode 100644
index f6685b72c19..00000000000
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/ia32/libavutil/avconfig.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Generated by ffconf */
-#ifndef AVUTIL_AVCONFIG_H
-#define AVUTIL_AVCONFIG_H
-#define AV_HAVE_BIGENDIAN 0
-#define AV_HAVE_FAST_UNALIGNED 1
-#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
-#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/config.asm
deleted file mode 100644
index 734b245574f..00000000000
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/config.asm
+++ /dev/null
@@ -1,1645 +0,0 @@
-%define ARCH_AARCH64 0
-%define ARCH_ALPHA 0
-%define ARCH_ARM 0
-%define ARCH_AVR32 0
-%define ARCH_AVR32_AP 0
-%define ARCH_AVR32_UC 0
-%define ARCH_BFIN 0
-%define ARCH_IA64 0
-%define ARCH_M68K 0
-%define ARCH_MIPS 0
-%define ARCH_MIPS64 0
-%define ARCH_PARISC 0
-%define ARCH_PPC 0
-%define ARCH_PPC64 0
-%define ARCH_S390 0
-%define ARCH_SH4 0
-%define ARCH_SPARC 0
-%define ARCH_SPARC64 0
-%define ARCH_TILEGX 0
-%define ARCH_TILEPRO 0
-%define ARCH_TOMI 0
-%define ARCH_X86 1
-%define ARCH_X86_32 0
-%define ARCH_X86_64 1
-%define HAVE_ARMV5TE 0
-%define HAVE_ARMV6 0
-%define HAVE_ARMV6T2 0
-%define HAVE_NEON 0
-%define HAVE_VFP 0
-%define HAVE_VFPV3 0
-%define HAVE_AMD3DNOW 1
-%define HAVE_AMD3DNOWEXT 1
-%define HAVE_AVX 1
-%define HAVE_AVX2 1
-%define HAVE_FMA4 1
-%define HAVE_I686 1
-%define HAVE_MMX 1
-%define HAVE_MMXEXT 1
-%define HAVE_SSE 1
-%define HAVE_SSE2 1
-%define HAVE_SSE3 1
-%define HAVE_SSE4 1
-%define HAVE_SSE42 1
-%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
-%define HAVE_MIPSFPU 0
-%define HAVE_MIPS32R2 0
-%define HAVE_MIPSDSPR1 0
-%define HAVE_MIPSDSPR2 0
-%define HAVE_ARMV5TE_EXTERNAL 0
-%define HAVE_ARMV6_EXTERNAL 0
-%define HAVE_ARMV6T2_EXTERNAL 0
-%define HAVE_NEON_EXTERNAL 0
-%define HAVE_VFP_EXTERNAL 0
-%define HAVE_VFPV3_EXTERNAL 0
-%define HAVE_AMD3DNOW_EXTERNAL 1
-%define HAVE_AMD3DNOWEXT_EXTERNAL 1
-%define HAVE_AVX_EXTERNAL 1
-%define HAVE_AVX2_EXTERNAL 1
-%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
-%define HAVE_MMX_EXTERNAL 1
-%define HAVE_MMXEXT_EXTERNAL 1
-%define HAVE_SSE_EXTERNAL 1
-%define HAVE_SSE2_EXTERNAL 1
-%define HAVE_SSE3_EXTERNAL 1
-%define HAVE_SSE4_EXTERNAL 1
-%define HAVE_SSE42_EXTERNAL 1
-%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
-%define HAVE_MIPSFPU_EXTERNAL 0
-%define HAVE_MIPS32R2_EXTERNAL 0
-%define HAVE_MIPSDSPR1_EXTERNAL 0
-%define HAVE_MIPSDSPR2_EXTERNAL 0
-%define HAVE_ARMV5TE_INLINE 0
-%define HAVE_ARMV6_INLINE 0
-%define HAVE_ARMV6T2_INLINE 0
-%define HAVE_NEON_INLINE 0
-%define HAVE_VFP_INLINE 0
-%define HAVE_VFPV3_INLINE 0
-%define HAVE_AMD3DNOW_INLINE 0
-%define HAVE_AMD3DNOWEXT_INLINE 0
-%define HAVE_AVX_INLINE 0
-%define HAVE_AVX2_INLINE 0
-%define HAVE_FMA4_INLINE 0
-%define HAVE_I686_INLINE 0
-%define HAVE_MMX_INLINE 0
-%define HAVE_MMXEXT_INLINE 0
-%define HAVE_SSE_INLINE 0
-%define HAVE_SSE2_INLINE 0
-%define HAVE_SSE3_INLINE 0
-%define HAVE_SSE4_INLINE 0
-%define HAVE_SSE42_INLINE 0
-%define HAVE_SSSE3_INLINE 0
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
-%define HAVE_MIPSFPU_INLINE 0
-%define HAVE_MIPS32R2_INLINE 0
-%define HAVE_MIPSDSPR1_INLINE 0
-%define HAVE_MIPSDSPR2_INLINE 0
-%define HAVE_INLINE_ASM 0
-%define HAVE_SYMVER 0
-%define HAVE_YASM 1
-%define HAVE_BIGENDIAN 0
-%define HAVE_FAST_UNALIGNED 1
-%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 0
-%define HAVE_W32THREADS 1
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 0
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 1
-%define HAVE_ATANF 1
-%define HAVE_ATAN2F 1
-%define HAVE_CBRT 1
-%define HAVE_CBRTF 1
-%define HAVE_COSF 1
-%define HAVE_EXP2 1
-%define HAVE_EXP2F 1
-%define HAVE_EXPF 1
-%define HAVE_ISINF 1
-%define HAVE_ISNAN 1
-%define HAVE_LDEXPF 1
-%define HAVE_LLRINT 1
-%define HAVE_LLRINTF 1
-%define HAVE_LOG2 0
-%define HAVE_LOG2F 1
-%define HAVE_LOG10F 1
-%define HAVE_LRINT 1
-%define HAVE_LRINTF 1
-%define HAVE_POWF 1
-%define HAVE_RINT 1
-%define HAVE_ROUND 1
-%define HAVE_ROUNDF 1
-%define HAVE_SINF 1
-%define HAVE_TRUNC 1
-%define HAVE_TRUNCF 1
-%define HAVE_ACCESS 1
-%define HAVE_ALIGNED_MALLOC 1
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 0
-%define HAVE_ATTRIBUTE_PACKED 0
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
-%define HAVE_CLOCK_GETTIME 0
-%define HAVE_CLOSESOCKET 0
-%define HAVE_COMMANDLINETOARGVW 1
-%define HAVE_CPUNOP 1
-%define HAVE_CRYPTGENRANDOM 1
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 1
-%define HAVE_DLFCN_H 0
-%define HAVE_DLOPEN 0
-%define HAVE_DOS_PATHS 1
-%define HAVE_DXVA_H 1
-%define HAVE_EBP_AVAILABLE 0
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 1
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 1
-%define HAVE_FCNTL 0
-%define HAVE_FORK 0
-%define HAVE_GETADDRINFO 0
-%define HAVE_GETHRTIME 0
-%define HAVE_GETOPT 0
-%define HAVE_GETPROCESSAFFINITYMASK 1
-%define HAVE_GETPROCESSMEMORYINFO 1
-%define HAVE_GETPROCESSTIMES 1
-%define HAVE_GETSYSTEMTIMEASFILETIME 1
-%define HAVE_GETRUSAGE 0
-%define HAVE_GETSERVBYPORT 0
-%define HAVE_GETTIMEOFDAY 0
-%define HAVE_GLOB 0
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 0
-%define HAVE_IO_H 1
-%define HAVE_INLINE_ASM_LABELS 0
-%define HAVE_ISATTY 1
-%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
-%define HAVE_KBHIT 1
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 1
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
-%define HAVE_LOCALTIME_R 0
-%define HAVE_LOONGSON 0
-%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 1
-%define HAVE_MAPVIEWOFFILE 1
-%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 1
-%define HAVE_MKSTEMP 0
-%define HAVE_MM_EMPTY 0
-%define HAVE_MMAP 0
-%define HAVE_MPROTECT 0
-%define HAVE_NANOSLEEP 0
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
-%define HAVE_PEEKNAMEDPIPE 1
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 0
-%define HAVE_POSIX_MEMALIGN 0
-%define HAVE_PRAGMA_DEPRECATED 1
-%define HAVE_PTHREAD_CANCEL 0
-%define HAVE_RDTSC 1
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 0
-%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
-%define HAVE_SETCONSOLETEXTATTRIBUTE 1
-%define HAVE_SETMODE 1
-%define HAVE_SETRLIMIT 0
-%define HAVE_SLEEP 1
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
-%define HAVE_STRERROR_R 0
-%define HAVE_STRUCT_ADDRINFO 0
-%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
-%define HAVE_STRUCT_IP_MREQ_SOURCE 0
-%define HAVE_STRUCT_IPV6_MREQ 0
-%define HAVE_STRUCT_POLLFD 0
-%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0
-%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
-%define HAVE_STRUCT_SOCKADDR_IN6 0
-%define HAVE_STRUCT_SOCKADDR_SA_LEN 0
-%define HAVE_STRUCT_SOCKADDR_STORAGE 0
-%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
-%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-%define HAVE_SYSCONF 0
-%define HAVE_SYSCTL 0
-%define HAVE_SYS_MMAN_H 0
-%define HAVE_SYS_PARAM_H 0
-%define HAVE_SYS_RESOURCE_H 0
-%define HAVE_SYS_SELECT_H 0
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 0
-%define HAVE_SYS_UN_H 0
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 0
-%define HAVE_TEXI2HTML 0
-%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 0
-%define HAVE_USLEEP 0
-%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 1
-%define HAVE_WINDOWS_H 1
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
-%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
-%define CONFIG_BSFS 0
-%define CONFIG_DECODERS 1
-%define CONFIG_DEMUXERS 1
-%define CONFIG_ENCODERS 0
-%define CONFIG_FILTERS 0
-%define CONFIG_HWACCELS 0
-%define CONFIG_INDEVS 0
-%define CONFIG_MUXERS 0
-%define CONFIG_OUTDEVS 0
-%define CONFIG_PARSERS 1
-%define CONFIG_PROTOCOLS 0
-%define CONFIG_DOC 0
-%define CONFIG_HTMLPAGES 0
-%define CONFIG_MANPAGES 1
-%define CONFIG_PODPAGES 1
-%define CONFIG_TXTPAGES 1
-%define CONFIG_DECODING_ENCODING_EXAMPLE 1
-%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
-%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
-%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
-%define CONFIG_METADATA_EXAMPLE 1
-%define CONFIG_MUXING_EXAMPLE 0
-%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
-%define CONFIG_SCALING_VIDEO_EXAMPLE 0
-%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
-%define CONFIG_AVISYNTH 0
-%define CONFIG_BZLIB 0
-%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
-%define CONFIG_FREI0R 0
-%define CONFIG_GNUTLS 0
-%define CONFIG_ICONV 0
-%define CONFIG_LADSPA 0
-%define CONFIG_LIBAACPLUS 0
-%define CONFIG_LIBASS 0
-%define CONFIG_LIBBLURAY 0
-%define CONFIG_LIBCACA 0
-%define CONFIG_LIBCDIO 0
-%define CONFIG_LIBCELT 0
-%define CONFIG_LIBDC1394 0
-%define CONFIG_LIBFAAC 0
-%define CONFIG_LIBFDK_AAC 0
-%define CONFIG_LIBFLITE 0
-%define CONFIG_LIBFREETYPE 0
-%define CONFIG_LIBGME 0
-%define CONFIG_LIBGSM 0
-%define CONFIG_LIBIEC61883 0
-%define CONFIG_LIBILBC 0
-%define CONFIG_LIBMODPLUG 0
-%define CONFIG_LIBMP3LAME 0
-%define CONFIG_LIBNUT 0
-%define CONFIG_LIBOPENCORE_AMRNB 0
-%define CONFIG_LIBOPENCORE_AMRWB 0
-%define CONFIG_LIBOPENCV 0
-%define CONFIG_LIBOPENJPEG 0
-%define CONFIG_LIBOPUS 0
-%define CONFIG_LIBPULSE 0
-%define CONFIG_LIBQUVI 0
-%define CONFIG_LIBRTMP 0
-%define CONFIG_LIBSCHROEDINGER 0
-%define CONFIG_LIBSHINE 0
-%define CONFIG_LIBSOXR 0
-%define CONFIG_LIBSPEEX 0
-%define CONFIG_LIBSSH 0
-%define CONFIG_LIBSTAGEFRIGHT_H264 0
-%define CONFIG_LIBTHEORA 0
-%define CONFIG_LIBTWOLAME 0
-%define CONFIG_LIBUTVIDEO 0
-%define CONFIG_LIBV4L2 0
-%define CONFIG_LIBVIDSTAB 0
-%define CONFIG_LIBVO_AACENC 0
-%define CONFIG_LIBVO_AMRWBENC 0
-%define CONFIG_LIBVORBIS 0
-%define CONFIG_LIBVPX 0
-%define CONFIG_LIBWAVPACK 0
-%define CONFIG_LIBX264 0
-%define CONFIG_LIBXAVS 0
-%define CONFIG_LIBXVID 0
-%define CONFIG_LIBZMQ 0
-%define CONFIG_LIBZVBI 0
-%define CONFIG_OPENAL 0
-%define CONFIG_OPENCL 0
-%define CONFIG_OPENSSL 0
-%define CONFIG_X11GRAB 0
-%define CONFIG_ZLIB 0
-%define CONFIG_DXVA2 0
-%define CONFIG_VAAPI 0
-%define CONFIG_VDA 0
-%define CONFIG_VDPAU 0
-%define CONFIG_AVCODEC 1
-%define CONFIG_AVDEVICE 0
-%define CONFIG_AVFILTER 0
-%define CONFIG_AVFORMAT 1
-%define CONFIG_AVRESAMPLE 0
-%define CONFIG_AVUTIL 1
-%define CONFIG_POSTPROC 0
-%define CONFIG_SWRESAMPLE 0
-%define CONFIG_SWSCALE 0
-%define CONFIG_FFPLAY 0
-%define CONFIG_FFPROBE 0
-%define CONFIG_FFSERVER 0
-%define CONFIG_FFMPEG 0
-%define CONFIG_DCT 1
-%define CONFIG_DWT 0
-%define CONFIG_ERROR_RESILIENCE 1
-%define CONFIG_FAST_UNALIGNED 1
-%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
-%define CONFIG_LSP 0
-%define CONFIG_LZO 0
-%define CONFIG_MDCT 1
-%define CONFIG_MEMALIGN_HACK 0
-%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
-%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 0
-%define CONFIG_SWSCALE_ALPHA 1
-%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
-%define CONFIG_XMM_CLOBBER_TEST 0
-%define CONFIG_AANDCTTABLES 0
-%define CONFIG_AC3DSP 0
-%define CONFIG_AUDIO_FRAME_QUEUE 0
-%define CONFIG_DSPUTIL 1
-%define CONFIG_EXIF 0
-%define CONFIG_FRAME_THREAD_ENCODER 0
-%define CONFIG_GCRYPT 0
-%define CONFIG_GOLOMB 1
-%define CONFIG_GPLV3 0
-%define CONFIG_H263DSP 0
-%define CONFIG_H264CHROMA 1
-%define CONFIG_H264DSP 1
-%define CONFIG_H264PRED 1
-%define CONFIG_H264QPEL 1
-%define CONFIG_HPELDSP 1
-%define CONFIG_HUFFMAN 0
-%define CONFIG_LGPLV3 0
-%define CONFIG_LPC 0
-%define CONFIG_MPEGAUDIO 1
-%define CONFIG_MPEGAUDIODSP 1
-%define CONFIG_MPEGVIDEO 0
-%define CONFIG_MPEGVIDEOENC 0
-%define CONFIG_NETTLE 0
-%define CONFIG_RANGECODER 0
-%define CONFIG_RIFFDEC 1
-%define CONFIG_RIFFENC 0
-%define CONFIG_RTPDEC 0
-%define CONFIG_RTPENC_CHAIN 0
-%define CONFIG_SINEWIN 1
-%define CONFIG_VIDEODSP 1
-%define CONFIG_VP3DSP 1
-%define CONFIG_AAC_ADTSTOASC_BSF 0
-%define CONFIG_CHOMP_BSF 0
-%define CONFIG_DUMP_EXTRADATA_BSF 0
-%define CONFIG_H264_MP4TOANNEXB_BSF 0
-%define CONFIG_IMX_DUMP_HEADER_BSF 0
-%define CONFIG_MJPEG2JPEG_BSF 0
-%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
-%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
-%define CONFIG_MOV2TEXTSUB_BSF 0
-%define CONFIG_NOISE_BSF 0
-%define CONFIG_REMOVE_EXTRADATA_BSF 0
-%define CONFIG_TEXT2MOVSUB_BSF 0
-%define CONFIG_AASC_DECODER 0
-%define CONFIG_AIC_DECODER 0
-%define CONFIG_AMV_DECODER 0
-%define CONFIG_ANM_DECODER 0
-%define CONFIG_ANSI_DECODER 0
-%define CONFIG_ASV1_DECODER 0
-%define CONFIG_ASV2_DECODER 0
-%define CONFIG_AURA_DECODER 0
-%define CONFIG_AURA2_DECODER 0
-%define CONFIG_AVRP_DECODER 0
-%define CONFIG_AVRN_DECODER 0
-%define CONFIG_AVS_DECODER 0
-%define CONFIG_AVUI_DECODER 0
-%define CONFIG_AYUV_DECODER 0
-%define CONFIG_BETHSOFTVID_DECODER 0
-%define CONFIG_BFI_DECODER 0
-%define CONFIG_BINK_DECODER 0
-%define CONFIG_BMP_DECODER 0
-%define CONFIG_BMV_VIDEO_DECODER 0
-%define CONFIG_BRENDER_PIX_DECODER 0
-%define CONFIG_C93_DECODER 0
-%define CONFIG_CAVS_DECODER 0
-%define CONFIG_CDGRAPHICS_DECODER 0
-%define CONFIG_CDXL_DECODER 0
-%define CONFIG_CINEPAK_DECODER 0
-%define CONFIG_CLJR_DECODER 0
-%define CONFIG_CLLC_DECODER 0
-%define CONFIG_COMFORTNOISE_DECODER 0
-%define CONFIG_CPIA_DECODER 0
-%define CONFIG_CSCD_DECODER 0
-%define CONFIG_CYUV_DECODER 0
-%define CONFIG_DFA_DECODER 0
-%define CONFIG_DIRAC_DECODER 0
-%define CONFIG_DNXHD_DECODER 0
-%define CONFIG_DPX_DECODER 0
-%define CONFIG_DSICINVIDEO_DECODER 0
-%define CONFIG_DVVIDEO_DECODER 0
-%define CONFIG_DXA_DECODER 0
-%define CONFIG_DXTORY_DECODER 0
-%define CONFIG_EACMV_DECODER 0
-%define CONFIG_EAMAD_DECODER 0
-%define CONFIG_EATGQ_DECODER 0
-%define CONFIG_EATGV_DECODER 0
-%define CONFIG_EATQI_DECODER 0
-%define CONFIG_EIGHTBPS_DECODER 0
-%define CONFIG_EIGHTSVX_EXP_DECODER 0
-%define CONFIG_EIGHTSVX_FIB_DECODER 0
-%define CONFIG_ESCAPE124_DECODER 0
-%define CONFIG_ESCAPE130_DECODER 0
-%define CONFIG_EXR_DECODER 0
-%define CONFIG_FFV1_DECODER 0
-%define CONFIG_FFVHUFF_DECODER 0
-%define CONFIG_FLASHSV_DECODER 0
-%define CONFIG_FLASHSV2_DECODER 0
-%define CONFIG_FLIC_DECODER 0
-%define CONFIG_FLV_DECODER 0
-%define CONFIG_FOURXM_DECODER 0
-%define CONFIG_FRAPS_DECODER 0
-%define CONFIG_FRWU_DECODER 0
-%define CONFIG_G2M_DECODER 0
-%define CONFIG_GIF_DECODER 0
-%define CONFIG_H261_DECODER 0
-%define CONFIG_H263_DECODER 0
-%define CONFIG_H263I_DECODER 0
-%define CONFIG_H263P_DECODER 0
-%define CONFIG_H264_DECODER 1
-%define CONFIG_H264_CRYSTALHD_DECODER 0
-%define CONFIG_H264_VDA_DECODER 0
-%define CONFIG_H264_VDPAU_DECODER 0
-%define CONFIG_HEVC_DECODER 0
-%define CONFIG_HNM4_VIDEO_DECODER 0
-%define CONFIG_HUFFYUV_DECODER 0
-%define CONFIG_IDCIN_DECODER 0
-%define CONFIG_IFF_BYTERUN1_DECODER 0
-%define CONFIG_IFF_ILBM_DECODER 0
-%define CONFIG_INDEO2_DECODER 0
-%define CONFIG_INDEO3_DECODER 0
-%define CONFIG_INDEO4_DECODER 0
-%define CONFIG_INDEO5_DECODER 0
-%define CONFIG_INTERPLAY_VIDEO_DECODER 0
-%define CONFIG_JPEG2000_DECODER 0
-%define CONFIG_JPEGLS_DECODER 0
-%define CONFIG_JV_DECODER 0
-%define CONFIG_KGV1_DECODER 0
-%define CONFIG_KMVC_DECODER 0
-%define CONFIG_LAGARITH_DECODER 0
-%define CONFIG_LOCO_DECODER 0
-%define CONFIG_MDEC_DECODER 0
-%define CONFIG_MIMIC_DECODER 0
-%define CONFIG_MJPEG_DECODER 0
-%define CONFIG_MJPEGB_DECODER 0
-%define CONFIG_MMVIDEO_DECODER 0
-%define CONFIG_MOTIONPIXELS_DECODER 0
-%define CONFIG_MPEG_XVMC_DECODER 0
-%define CONFIG_MPEG1VIDEO_DECODER 0
-%define CONFIG_MPEG2VIDEO_DECODER 0
-%define CONFIG_MPEG4_DECODER 0
-%define CONFIG_MPEG4_CRYSTALHD_DECODER 0
-%define CONFIG_MPEG4_VDPAU_DECODER 0
-%define CONFIG_MPEGVIDEO_DECODER 0
-%define CONFIG_MPEG_VDPAU_DECODER 0
-%define CONFIG_MPEG1_VDPAU_DECODER 0
-%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
-%define CONFIG_MSA1_DECODER 0
-%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
-%define CONFIG_MSMPEG4V1_DECODER 0
-%define CONFIG_MSMPEG4V2_DECODER 0
-%define CONFIG_MSMPEG4V3_DECODER 0
-%define CONFIG_MSRLE_DECODER 0
-%define CONFIG_MSS1_DECODER 0
-%define CONFIG_MSS2_DECODER 0
-%define CONFIG_MSVIDEO1_DECODER 0
-%define CONFIG_MSZH_DECODER 0
-%define CONFIG_MTS2_DECODER 0
-%define CONFIG_MVC1_DECODER 0
-%define CONFIG_MVC2_DECODER 0
-%define CONFIG_MXPEG_DECODER 0
-%define CONFIG_NUV_DECODER 0
-%define CONFIG_PAF_VIDEO_DECODER 0
-%define CONFIG_PAM_DECODER 0
-%define CONFIG_PBM_DECODER 0
-%define CONFIG_PCX_DECODER 0
-%define CONFIG_PGM_DECODER 0
-%define CONFIG_PGMYUV_DECODER 0
-%define CONFIG_PICTOR_DECODER 0
-%define CONFIG_PNG_DECODER 0
-%define CONFIG_PPM_DECODER 0
-%define CONFIG_PRORES_DECODER 0
-%define CONFIG_PRORES_LGPL_DECODER 0
-%define CONFIG_PTX_DECODER 0
-%define CONFIG_QDRAW_DECODER 0
-%define CONFIG_QPEG_DECODER 0
-%define CONFIG_QTRLE_DECODER 0
-%define CONFIG_R10K_DECODER 0
-%define CONFIG_R210_DECODER 0
-%define CONFIG_RAWVIDEO_DECODER 0
-%define CONFIG_RL2_DECODER 0
-%define CONFIG_ROQ_DECODER 0
-%define CONFIG_RPZA_DECODER 0
-%define CONFIG_RV10_DECODER 0
-%define CONFIG_RV20_DECODER 0
-%define CONFIG_RV30_DECODER 0
-%define CONFIG_RV40_DECODER 0
-%define CONFIG_S302M_DECODER 0
-%define CONFIG_SANM_DECODER 0
-%define CONFIG_SGI_DECODER 0
-%define CONFIG_SGIRLE_DECODER 0
-%define CONFIG_SMACKER_DECODER 0
-%define CONFIG_SMC_DECODER 0
-%define CONFIG_SMVJPEG_DECODER 0
-%define CONFIG_SNOW_DECODER 0
-%define CONFIG_SP5X_DECODER 0
-%define CONFIG_SUNRAST_DECODER 0
-%define CONFIG_SVQ1_DECODER 0
-%define CONFIG_SVQ3_DECODER 0
-%define CONFIG_TARGA_DECODER 0
-%define CONFIG_TARGA_Y216_DECODER 0
-%define CONFIG_THEORA_DECODER 1
-%define CONFIG_THP_DECODER 0
-%define CONFIG_TIERTEXSEQVIDEO_DECODER 0
-%define CONFIG_TIFF_DECODER 0
-%define CONFIG_TMV_DECODER 0
-%define CONFIG_TRUEMOTION1_DECODER 0
-%define CONFIG_TRUEMOTION2_DECODER 0
-%define CONFIG_TSCC_DECODER 0
-%define CONFIG_TSCC2_DECODER 0
-%define CONFIG_TXD_DECODER 0
-%define CONFIG_ULTI_DECODER 0
-%define CONFIG_UTVIDEO_DECODER 0
-%define CONFIG_V210_DECODER 0
-%define CONFIG_V210X_DECODER 0
-%define CONFIG_V308_DECODER 0
-%define CONFIG_V408_DECODER 0
-%define CONFIG_V410_DECODER 0
-%define CONFIG_VB_DECODER 0
-%define CONFIG_VBLE_DECODER 0
-%define CONFIG_VC1_DECODER 0
-%define CONFIG_VC1_CRYSTALHD_DECODER 0
-%define CONFIG_VC1_VDPAU_DECODER 0
-%define CONFIG_VC1IMAGE_DECODER 0
-%define CONFIG_VCR1_DECODER 0
-%define CONFIG_VMDVIDEO_DECODER 0
-%define CONFIG_VMNC_DECODER 0
-%define CONFIG_VP3_DECODER 1
-%define CONFIG_VP5_DECODER 0
-%define CONFIG_VP6_DECODER 0
-%define CONFIG_VP6A_DECODER 0
-%define CONFIG_VP6F_DECODER 0
-%define CONFIG_VP8_DECODER 1
-%define CONFIG_VP9_DECODER 0
-%define CONFIG_VQA_DECODER 0
-%define CONFIG_WEBP_DECODER 0
-%define CONFIG_WMV1_DECODER 0
-%define CONFIG_WMV2_DECODER 0
-%define CONFIG_WMV3_DECODER 0
-%define CONFIG_WMV3_CRYSTALHD_DECODER 0
-%define CONFIG_WMV3_VDPAU_DECODER 0
-%define CONFIG_WMV3IMAGE_DECODER 0
-%define CONFIG_WNV1_DECODER 0
-%define CONFIG_XAN_WC3_DECODER 0
-%define CONFIG_XAN_WC4_DECODER 0
-%define CONFIG_XBM_DECODER 0
-%define CONFIG_XFACE_DECODER 0
-%define CONFIG_XL_DECODER 0
-%define CONFIG_XWD_DECODER 0
-%define CONFIG_Y41P_DECODER 0
-%define CONFIG_YOP_DECODER 0
-%define CONFIG_YUV4_DECODER 0
-%define CONFIG_ZERO12V_DECODER 0
-%define CONFIG_ZEROCODEC_DECODER 0
-%define CONFIG_ZLIB_DECODER 0
-%define CONFIG_ZMBV_DECODER 0
-%define CONFIG_AAC_DECODER 1
-%define CONFIG_AAC_LATM_DECODER 0
-%define CONFIG_AC3_DECODER 0
-%define CONFIG_ALAC_DECODER 0
-%define CONFIG_ALS_DECODER 0
-%define CONFIG_AMRNB_DECODER 0
-%define CONFIG_AMRWB_DECODER 0
-%define CONFIG_APE_DECODER 0
-%define CONFIG_ATRAC1_DECODER 0
-%define CONFIG_ATRAC3_DECODER 0
-%define CONFIG_BINKAUDIO_DCT_DECODER 0
-%define CONFIG_BINKAUDIO_RDFT_DECODER 0
-%define CONFIG_BMV_AUDIO_DECODER 0
-%define CONFIG_COOK_DECODER 0
-%define CONFIG_DCA_DECODER 0
-%define CONFIG_DSICINAUDIO_DECODER 0
-%define CONFIG_EAC3_DECODER 0
-%define CONFIG_EVRC_DECODER 0
-%define CONFIG_FFWAVESYNTH_DECODER 0
-%define CONFIG_FLAC_DECODER 0
-%define CONFIG_G723_1_DECODER 0
-%define CONFIG_G729_DECODER 0
-%define CONFIG_GSM_DECODER 0
-%define CONFIG_GSM_MS_DECODER 0
-%define CONFIG_IAC_DECODER 0
-%define CONFIG_IMC_DECODER 0
-%define CONFIG_MACE3_DECODER 0
-%define CONFIG_MACE6_DECODER 0
-%define CONFIG_METASOUND_DECODER 0
-%define CONFIG_MLP_DECODER 0
-%define CONFIG_MP1_DECODER 0
-%define CONFIG_MP1FLOAT_DECODER 0
-%define CONFIG_MP2_DECODER 0
-%define CONFIG_MP2FLOAT_DECODER 0
-%define CONFIG_MP3_DECODER 1
-%define CONFIG_MP3FLOAT_DECODER 0
-%define CONFIG_MP3ADU_DECODER 0
-%define CONFIG_MP3ADUFLOAT_DECODER 0
-%define CONFIG_MP3ON4_DECODER 0
-%define CONFIG_MP3ON4FLOAT_DECODER 0
-%define CONFIG_MPC7_DECODER 0
-%define CONFIG_MPC8_DECODER 0
-%define CONFIG_NELLYMOSER_DECODER 0
-%define CONFIG_PAF_AUDIO_DECODER 0
-%define CONFIG_QCELP_DECODER 0
-%define CONFIG_QDM2_DECODER 0
-%define CONFIG_RA_144_DECODER 0
-%define CONFIG_RA_288_DECODER 0
-%define CONFIG_RALF_DECODER 0
-%define CONFIG_SHORTEN_DECODER 0
-%define CONFIG_SIPR_DECODER 0
-%define CONFIG_SMACKAUD_DECODER 0
-%define CONFIG_SONIC_DECODER 0
-%define CONFIG_TAK_DECODER 0
-%define CONFIG_TRUEHD_DECODER 0
-%define CONFIG_TRUESPEECH_DECODER 0
-%define CONFIG_TTA_DECODER 0
-%define CONFIG_TWINVQ_DECODER 0
-%define CONFIG_VMDAUDIO_DECODER 0
-%define CONFIG_VORBIS_DECODER 1
-%define CONFIG_WAVPACK_DECODER 0
-%define CONFIG_WMALOSSLESS_DECODER 0
-%define CONFIG_WMAPRO_DECODER 0
-%define CONFIG_WMAV1_DECODER 0
-%define CONFIG_WMAV2_DECODER 0
-%define CONFIG_WMAVOICE_DECODER 0
-%define CONFIG_WS_SND1_DECODER 0
-%define CONFIG_PCM_ALAW_DECODER 1
-%define CONFIG_PCM_BLURAY_DECODER 0
-%define CONFIG_PCM_DVD_DECODER 0
-%define CONFIG_PCM_F32BE_DECODER 0
-%define CONFIG_PCM_F32LE_DECODER 1
-%define CONFIG_PCM_F64BE_DECODER 0
-%define CONFIG_PCM_F64LE_DECODER 0
-%define CONFIG_PCM_LXF_DECODER 0
-%define CONFIG_PCM_MULAW_DECODER 1
-%define CONFIG_PCM_S8_DECODER 0
-%define CONFIG_PCM_S8_PLANAR_DECODER 0
-%define CONFIG_PCM_S16BE_DECODER 1
-%define CONFIG_PCM_S16BE_PLANAR_DECODER 0
-%define CONFIG_PCM_S16LE_DECODER 1
-%define CONFIG_PCM_S16LE_PLANAR_DECODER 0
-%define CONFIG_PCM_S24BE_DECODER 1
-%define CONFIG_PCM_S24DAUD_DECODER 0
-%define CONFIG_PCM_S24LE_DECODER 1
-%define CONFIG_PCM_S24LE_PLANAR_DECODER 0
-%define CONFIG_PCM_S32BE_DECODER 0
-%define CONFIG_PCM_S32LE_DECODER 0
-%define CONFIG_PCM_S32LE_PLANAR_DECODER 0
-%define CONFIG_PCM_U8_DECODER 1
-%define CONFIG_PCM_U16BE_DECODER 0
-%define CONFIG_PCM_U16LE_DECODER 0
-%define CONFIG_PCM_U24BE_DECODER 0
-%define CONFIG_PCM_U24LE_DECODER 0
-%define CONFIG_PCM_U32BE_DECODER 0
-%define CONFIG_PCM_U32LE_DECODER 0
-%define CONFIG_PCM_ZORK_DECODER 0
-%define CONFIG_INTERPLAY_DPCM_DECODER 0
-%define CONFIG_ROQ_DPCM_DECODER 0
-%define CONFIG_SOL_DPCM_DECODER 0
-%define CONFIG_XAN_DPCM_DECODER 0
-%define CONFIG_ADPCM_4XM_DECODER 0
-%define CONFIG_ADPCM_ADX_DECODER 0
-%define CONFIG_ADPCM_AFC_DECODER 0
-%define CONFIG_ADPCM_CT_DECODER 0
-%define CONFIG_ADPCM_DTK_DECODER 0
-%define CONFIG_ADPCM_EA_DECODER 0
-%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
-%define CONFIG_ADPCM_EA_R1_DECODER 0
-%define CONFIG_ADPCM_EA_R2_DECODER 0
-%define CONFIG_ADPCM_EA_R3_DECODER 0
-%define CONFIG_ADPCM_EA_XAS_DECODER 0
-%define CONFIG_ADPCM_G722_DECODER 0
-%define CONFIG_ADPCM_G726_DECODER 0
-%define CONFIG_ADPCM_G726LE_DECODER 0
-%define CONFIG_ADPCM_IMA_AMV_DECODER 0
-%define CONFIG_ADPCM_IMA_APC_DECODER 0
-%define CONFIG_ADPCM_IMA_DK3_DECODER 0
-%define CONFIG_ADPCM_IMA_DK4_DECODER 0
-%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
-%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
-%define CONFIG_ADPCM_IMA_ISS_DECODER 0
-%define CONFIG_ADPCM_IMA_OKI_DECODER 0
-%define CONFIG_ADPCM_IMA_QT_DECODER 0
-%define CONFIG_ADPCM_IMA_RAD_DECODER 0
-%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
-%define CONFIG_ADPCM_IMA_WAV_DECODER 0
-%define CONFIG_ADPCM_IMA_WS_DECODER 0
-%define CONFIG_ADPCM_MS_DECODER 0
-%define CONFIG_ADPCM_SBPRO_2_DECODER 0
-%define CONFIG_ADPCM_SBPRO_3_DECODER 0
-%define CONFIG_ADPCM_SBPRO_4_DECODER 0
-%define CONFIG_ADPCM_SWF_DECODER 0
-%define CONFIG_ADPCM_THP_DECODER 0
-%define CONFIG_ADPCM_XA_DECODER 0
-%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
-%define CONFIG_SSA_DECODER 0
-%define CONFIG_ASS_DECODER 0
-%define CONFIG_DVBSUB_DECODER 0
-%define CONFIG_DVDSUB_DECODER 0
-%define CONFIG_JACOSUB_DECODER 0
-%define CONFIG_MICRODVD_DECODER 0
-%define CONFIG_MOVTEXT_DECODER 0
-%define CONFIG_MPL2_DECODER 0
-%define CONFIG_PGSSUB_DECODER 0
-%define CONFIG_PJS_DECODER 0
-%define CONFIG_REALTEXT_DECODER 0
-%define CONFIG_SAMI_DECODER 0
-%define CONFIG_SRT_DECODER 0
-%define CONFIG_SUBRIP_DECODER 0
-%define CONFIG_SUBVIEWER_DECODER 0
-%define CONFIG_SUBVIEWER1_DECODER 0
-%define CONFIG_TEXT_DECODER 0
-%define CONFIG_VPLAYER_DECODER 0
-%define CONFIG_WEBVTT_DECODER 0
-%define CONFIG_XSUB_DECODER 0
-%define CONFIG_LIBCELT_DECODER 0
-%define CONFIG_LIBFDK_AAC_DECODER 0
-%define CONFIG_LIBGSM_DECODER 0
-%define CONFIG_LIBGSM_MS_DECODER 0
-%define CONFIG_LIBILBC_DECODER 0
-%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
-%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
-%define CONFIG_LIBOPENJPEG_DECODER 0
-%define CONFIG_LIBOPUS_DECODER 0
-%define CONFIG_LIBSCHROEDINGER_DECODER 0
-%define CONFIG_LIBSPEEX_DECODER 0
-%define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
-%define CONFIG_LIBUTVIDEO_DECODER 0
-%define CONFIG_LIBVORBIS_DECODER 0
-%define CONFIG_LIBVPX_VP8_DECODER 0
-%define CONFIG_LIBVPX_VP9_DECODER 0
-%define CONFIG_LIBZVBI_TELETEXT_DECODER 0
-%define CONFIG_BINTEXT_DECODER 0
-%define CONFIG_XBIN_DECODER 0
-%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
-%define CONFIG_AC3_DEMUXER 0
-%define CONFIG_ACT_DEMUXER 0
-%define CONFIG_ADF_DEMUXER 0
-%define CONFIG_ADP_DEMUXER 0
-%define CONFIG_ADX_DEMUXER 0
-%define CONFIG_AEA_DEMUXER 0
-%define CONFIG_AFC_DEMUXER 0
-%define CONFIG_AIFF_DEMUXER 0
-%define CONFIG_AMR_DEMUXER 0
-%define CONFIG_ANM_DEMUXER 0
-%define CONFIG_APC_DEMUXER 0
-%define CONFIG_APE_DEMUXER 0
-%define CONFIG_AQTITLE_DEMUXER 0
-%define CONFIG_ASF_DEMUXER 0
-%define CONFIG_ASS_DEMUXER 0
-%define CONFIG_AST_DEMUXER 0
-%define CONFIG_AU_DEMUXER 0
-%define CONFIG_AVI_DEMUXER 0
-%define CONFIG_AVISYNTH_DEMUXER 0
-%define CONFIG_AVR_DEMUXER 0
-%define CONFIG_AVS_DEMUXER 0
-%define CONFIG_BETHSOFTVID_DEMUXER 0
-%define CONFIG_BFI_DEMUXER 0
-%define CONFIG_BINTEXT_DEMUXER 0
-%define CONFIG_BINK_DEMUXER 0
-%define CONFIG_BIT_DEMUXER 0
-%define CONFIG_BMV_DEMUXER 0
-%define CONFIG_BRSTM_DEMUXER 0
-%define CONFIG_BOA_DEMUXER 0
-%define CONFIG_C93_DEMUXER 0
-%define CONFIG_CAF_DEMUXER 0
-%define CONFIG_CAVSVIDEO_DEMUXER 0
-%define CONFIG_CDG_DEMUXER 0
-%define CONFIG_CDXL_DEMUXER 0
-%define CONFIG_CONCAT_DEMUXER 0
-%define CONFIG_DATA_DEMUXER 0
-%define CONFIG_DAUD_DEMUXER 0
-%define CONFIG_DFA_DEMUXER 0
-%define CONFIG_DIRAC_DEMUXER 0
-%define CONFIG_DNXHD_DEMUXER 0
-%define CONFIG_DSICIN_DEMUXER 0
-%define CONFIG_DTS_DEMUXER 0
-%define CONFIG_DTSHD_DEMUXER 0
-%define CONFIG_DV_DEMUXER 0
-%define CONFIG_DXA_DEMUXER 0
-%define CONFIG_EA_DEMUXER 0
-%define CONFIG_EA_CDATA_DEMUXER 0
-%define CONFIG_EAC3_DEMUXER 0
-%define CONFIG_EPAF_DEMUXER 0
-%define CONFIG_FFM_DEMUXER 0
-%define CONFIG_FFMETADATA_DEMUXER 0
-%define CONFIG_FILMSTRIP_DEMUXER 0
-%define CONFIG_FLAC_DEMUXER 0
-%define CONFIG_FLIC_DEMUXER 0
-%define CONFIG_FLV_DEMUXER 0
-%define CONFIG_FOURXM_DEMUXER 0
-%define CONFIG_FRM_DEMUXER 0
-%define CONFIG_G722_DEMUXER 0
-%define CONFIG_G723_1_DEMUXER 0
-%define CONFIG_G729_DEMUXER 0
-%define CONFIG_GIF_DEMUXER 0
-%define CONFIG_GSM_DEMUXER 0
-%define CONFIG_GXF_DEMUXER 0
-%define CONFIG_H261_DEMUXER 0
-%define CONFIG_H263_DEMUXER 0
-%define CONFIG_H264_DEMUXER 0
-%define CONFIG_HEVC_DEMUXER 0
-%define CONFIG_HLS_DEMUXER 0
-%define CONFIG_HNM_DEMUXER 0
-%define CONFIG_ICO_DEMUXER 0
-%define CONFIG_IDCIN_DEMUXER 0
-%define CONFIG_IDF_DEMUXER 0
-%define CONFIG_IFF_DEMUXER 0
-%define CONFIG_ILBC_DEMUXER 0
-%define CONFIG_IMAGE2_DEMUXER 0
-%define CONFIG_IMAGE2PIPE_DEMUXER 0
-%define CONFIG_INGENIENT_DEMUXER 0
-%define CONFIG_IPMOVIE_DEMUXER 0
-%define CONFIG_IRCAM_DEMUXER 0
-%define CONFIG_ISS_DEMUXER 0
-%define CONFIG_IV8_DEMUXER 0
-%define CONFIG_IVF_DEMUXER 0
-%define CONFIG_JACOSUB_DEMUXER 0
-%define CONFIG_JV_DEMUXER 0
-%define CONFIG_LATM_DEMUXER 0
-%define CONFIG_LMLM4_DEMUXER 0
-%define CONFIG_LOAS_DEMUXER 0
-%define CONFIG_LVF_DEMUXER 0
-%define CONFIG_LXF_DEMUXER 0
-%define CONFIG_M4V_DEMUXER 0
-%define CONFIG_MATROSKA_DEMUXER 1
-%define CONFIG_MGSTS_DEMUXER 0
-%define CONFIG_MICRODVD_DEMUXER 0
-%define CONFIG_MJPEG_DEMUXER 0
-%define CONFIG_MLP_DEMUXER 0
-%define CONFIG_MM_DEMUXER 0
-%define CONFIG_MMF_DEMUXER 0
-%define CONFIG_MOV_DEMUXER 1
-%define CONFIG_MP3_DEMUXER 1
-%define CONFIG_MPC_DEMUXER 0
-%define CONFIG_MPC8_DEMUXER 0
-%define CONFIG_MPEGPS_DEMUXER 0
-%define CONFIG_MPEGTS_DEMUXER 0
-%define CONFIG_MPEGTSRAW_DEMUXER 0
-%define CONFIG_MPEGVIDEO_DEMUXER 0
-%define CONFIG_MPL2_DEMUXER 0
-%define CONFIG_MPSUB_DEMUXER 0
-%define CONFIG_MSNWC_TCP_DEMUXER 0
-%define CONFIG_MTV_DEMUXER 0
-%define CONFIG_MV_DEMUXER 0
-%define CONFIG_MVI_DEMUXER 0
-%define CONFIG_MXF_DEMUXER 0
-%define CONFIG_MXG_DEMUXER 0
-%define CONFIG_NC_DEMUXER 0
-%define CONFIG_NISTSPHERE_DEMUXER 0
-%define CONFIG_NSV_DEMUXER 0
-%define CONFIG_NUT_DEMUXER 0
-%define CONFIG_NUV_DEMUXER 0
-%define CONFIG_OGG_DEMUXER 1
-%define CONFIG_OMA_DEMUXER 0
-%define CONFIG_PAF_DEMUXER 0
-%define CONFIG_PCM_ALAW_DEMUXER 0
-%define CONFIG_PCM_MULAW_DEMUXER 0
-%define CONFIG_PCM_F64BE_DEMUXER 0
-%define CONFIG_PCM_F64LE_DEMUXER 0
-%define CONFIG_PCM_F32BE_DEMUXER 0
-%define CONFIG_PCM_F32LE_DEMUXER 0
-%define CONFIG_PCM_S32BE_DEMUXER 0
-%define CONFIG_PCM_S32LE_DEMUXER 0
-%define CONFIG_PCM_S24BE_DEMUXER 0
-%define CONFIG_PCM_S24LE_DEMUXER 0
-%define CONFIG_PCM_S16BE_DEMUXER 0
-%define CONFIG_PCM_S16LE_DEMUXER 0
-%define CONFIG_PCM_S8_DEMUXER 0
-%define CONFIG_PCM_U32BE_DEMUXER 0
-%define CONFIG_PCM_U32LE_DEMUXER 0
-%define CONFIG_PCM_U24BE_DEMUXER 0
-%define CONFIG_PCM_U24LE_DEMUXER 0
-%define CONFIG_PCM_U16BE_DEMUXER 0
-%define CONFIG_PCM_U16LE_DEMUXER 0
-%define CONFIG_PCM_U8_DEMUXER 0
-%define CONFIG_PJS_DEMUXER 0
-%define CONFIG_PMP_DEMUXER 0
-%define CONFIG_PVA_DEMUXER 0
-%define CONFIG_PVF_DEMUXER 0
-%define CONFIG_QCP_DEMUXER 0
-%define CONFIG_R3D_DEMUXER 0
-%define CONFIG_RAWVIDEO_DEMUXER 0
-%define CONFIG_REALTEXT_DEMUXER 0
-%define CONFIG_REDSPARK_DEMUXER 0
-%define CONFIG_RL2_DEMUXER 0
-%define CONFIG_RM_DEMUXER 0
-%define CONFIG_ROQ_DEMUXER 0
-%define CONFIG_RPL_DEMUXER 0
-%define CONFIG_RSD_DEMUXER 0
-%define CONFIG_RSO_DEMUXER 0
-%define CONFIG_RTP_DEMUXER 0
-%define CONFIG_RTSP_DEMUXER 0
-%define CONFIG_SAMI_DEMUXER 0
-%define CONFIG_SAP_DEMUXER 0
-%define CONFIG_SBG_DEMUXER 0
-%define CONFIG_SDP_DEMUXER 0
-%define CONFIG_SEGAFILM_DEMUXER 0
-%define CONFIG_SHORTEN_DEMUXER 0
-%define CONFIG_SIFF_DEMUXER 0
-%define CONFIG_SMACKER_DEMUXER 0
-%define CONFIG_SMJPEG_DEMUXER 0
-%define CONFIG_SMUSH_DEMUXER 0
-%define CONFIG_SOL_DEMUXER 0
-%define CONFIG_SOX_DEMUXER 0
-%define CONFIG_SPDIF_DEMUXER 0
-%define CONFIG_SRT_DEMUXER 0
-%define CONFIG_STR_DEMUXER 0
-%define CONFIG_SUBVIEWER1_DEMUXER 0
-%define CONFIG_SUBVIEWER_DEMUXER 0
-%define CONFIG_SWF_DEMUXER 0
-%define CONFIG_TAK_DEMUXER 0
-%define CONFIG_TEDCAPTIONS_DEMUXER 0
-%define CONFIG_THP_DEMUXER 0
-%define CONFIG_TIERTEXSEQ_DEMUXER 0
-%define CONFIG_TMV_DEMUXER 0
-%define CONFIG_TRUEHD_DEMUXER 0
-%define CONFIG_TTA_DEMUXER 0
-%define CONFIG_TXD_DEMUXER 0
-%define CONFIG_TTY_DEMUXER 0
-%define CONFIG_VC1_DEMUXER 0
-%define CONFIG_VC1T_DEMUXER 0
-%define CONFIG_VIVO_DEMUXER 0
-%define CONFIG_VMD_DEMUXER 0
-%define CONFIG_VOBSUB_DEMUXER 0
-%define CONFIG_VOC_DEMUXER 0
-%define CONFIG_VPLAYER_DEMUXER 0
-%define CONFIG_VQF_DEMUXER 0
-%define CONFIG_W64_DEMUXER 0
-%define CONFIG_WAV_DEMUXER 1
-%define CONFIG_WC3_DEMUXER 0
-%define CONFIG_WEBVTT_DEMUXER 0
-%define CONFIG_WSAUD_DEMUXER 0
-%define CONFIG_WSVQA_DEMUXER 0
-%define CONFIG_WTV_DEMUXER 0
-%define CONFIG_WV_DEMUXER 0
-%define CONFIG_XA_DEMUXER 0
-%define CONFIG_XBIN_DEMUXER 0
-%define CONFIG_XMV_DEMUXER 0
-%define CONFIG_XWMA_DEMUXER 0
-%define CONFIG_YOP_DEMUXER 0
-%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
-%define CONFIG_LIBGME_DEMUXER 0
-%define CONFIG_LIBMODPLUG_DEMUXER 0
-%define CONFIG_LIBNUT_DEMUXER 0
-%define CONFIG_LIBQUVI_DEMUXER 0
-%define CONFIG_A64MULTI_ENCODER 0
-%define CONFIG_A64MULTI5_ENCODER 0
-%define CONFIG_AMV_ENCODER 0
-%define CONFIG_ASV1_ENCODER 0
-%define CONFIG_ASV2_ENCODER 0
-%define CONFIG_AVRP_ENCODER 0
-%define CONFIG_AVUI_ENCODER 0
-%define CONFIG_AYUV_ENCODER 0
-%define CONFIG_BMP_ENCODER 0
-%define CONFIG_CLJR_ENCODER 0
-%define CONFIG_COMFORTNOISE_ENCODER 0
-%define CONFIG_DNXHD_ENCODER 0
-%define CONFIG_DPX_ENCODER 0
-%define CONFIG_DVVIDEO_ENCODER 0
-%define CONFIG_FFV1_ENCODER 0
-%define CONFIG_FFVHUFF_ENCODER 0
-%define CONFIG_FLASHSV_ENCODER 0
-%define CONFIG_FLASHSV2_ENCODER 0
-%define CONFIG_FLV_ENCODER 0
-%define CONFIG_GIF_ENCODER 0
-%define CONFIG_H261_ENCODER 0
-%define CONFIG_H263_ENCODER 0
-%define CONFIG_H263P_ENCODER 0
-%define CONFIG_HUFFYUV_ENCODER 0
-%define CONFIG_JPEG2000_ENCODER 0
-%define CONFIG_JPEGLS_ENCODER 0
-%define CONFIG_LJPEG_ENCODER 0
-%define CONFIG_MJPEG_ENCODER 0
-%define CONFIG_MPEG1VIDEO_ENCODER 0
-%define CONFIG_MPEG2VIDEO_ENCODER 0
-%define CONFIG_MPEG4_ENCODER 0
-%define CONFIG_MSMPEG4V2_ENCODER 0
-%define CONFIG_MSMPEG4V3_ENCODER 0
-%define CONFIG_MSVIDEO1_ENCODER 0
-%define CONFIG_PAM_ENCODER 0
-%define CONFIG_PBM_ENCODER 0
-%define CONFIG_PCX_ENCODER 0
-%define CONFIG_PGM_ENCODER 0
-%define CONFIG_PGMYUV_ENCODER 0
-%define CONFIG_PNG_ENCODER 0
-%define CONFIG_PPM_ENCODER 0
-%define CONFIG_PRORES_ENCODER 0
-%define CONFIG_PRORES_AW_ENCODER 0
-%define CONFIG_PRORES_KS_ENCODER 0
-%define CONFIG_QTRLE_ENCODER 0
-%define CONFIG_R10K_ENCODER 0
-%define CONFIG_R210_ENCODER 0
-%define CONFIG_RAWVIDEO_ENCODER 0
-%define CONFIG_ROQ_ENCODER 0
-%define CONFIG_RV10_ENCODER 0
-%define CONFIG_RV20_ENCODER 0
-%define CONFIG_S302M_ENCODER 0
-%define CONFIG_SGI_ENCODER 0
-%define CONFIG_SNOW_ENCODER 0
-%define CONFIG_SUNRAST_ENCODER 0
-%define CONFIG_SVQ1_ENCODER 0
-%define CONFIG_TARGA_ENCODER 0
-%define CONFIG_TIFF_ENCODER 0
-%define CONFIG_UTVIDEO_ENCODER 0
-%define CONFIG_V210_ENCODER 0
-%define CONFIG_V308_ENCODER 0
-%define CONFIG_V408_ENCODER 0
-%define CONFIG_V410_ENCODER 0
-%define CONFIG_WMV1_ENCODER 0
-%define CONFIG_WMV2_ENCODER 0
-%define CONFIG_XBM_ENCODER 0
-%define CONFIG_XFACE_ENCODER 0
-%define CONFIG_XWD_ENCODER 0
-%define CONFIG_Y41P_ENCODER 0
-%define CONFIG_YUV4_ENCODER 0
-%define CONFIG_ZLIB_ENCODER 0
-%define CONFIG_ZMBV_ENCODER 0
-%define CONFIG_AAC_ENCODER 0
-%define CONFIG_AC3_ENCODER 0
-%define CONFIG_AC3_FIXED_ENCODER 0
-%define CONFIG_ALAC_ENCODER 0
-%define CONFIG_DCA_ENCODER 0
-%define CONFIG_EAC3_ENCODER 0
-%define CONFIG_FLAC_ENCODER 0
-%define CONFIG_G723_1_ENCODER 0
-%define CONFIG_MP2_ENCODER 0
-%define CONFIG_MP2FIXED_ENCODER 0
-%define CONFIG_NELLYMOSER_ENCODER 0
-%define CONFIG_RA_144_ENCODER 0
-%define CONFIG_SONIC_ENCODER 0
-%define CONFIG_SONIC_LS_ENCODER 0
-%define CONFIG_TTA_ENCODER 0
-%define CONFIG_VORBIS_ENCODER 0
-%define CONFIG_WAVPACK_ENCODER 0
-%define CONFIG_WMAV1_ENCODER 0
-%define CONFIG_WMAV2_ENCODER 0
-%define CONFIG_PCM_ALAW_ENCODER 0
-%define CONFIG_PCM_F32BE_ENCODER 0
-%define CONFIG_PCM_F32LE_ENCODER 0
-%define CONFIG_PCM_F64BE_ENCODER 0
-%define CONFIG_PCM_F64LE_ENCODER 0
-%define CONFIG_PCM_MULAW_ENCODER 0
-%define CONFIG_PCM_S8_ENCODER 0
-%define CONFIG_PCM_S8_PLANAR_ENCODER 0
-%define CONFIG_PCM_S16BE_ENCODER 0
-%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S16LE_ENCODER 0
-%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S24BE_ENCODER 0
-%define CONFIG_PCM_S24DAUD_ENCODER 0
-%define CONFIG_PCM_S24LE_ENCODER 0
-%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S32BE_ENCODER 0
-%define CONFIG_PCM_S32LE_ENCODER 0
-%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_U8_ENCODER 0
-%define CONFIG_PCM_U16BE_ENCODER 0
-%define CONFIG_PCM_U16LE_ENCODER 0
-%define CONFIG_PCM_U24BE_ENCODER 0
-%define CONFIG_PCM_U24LE_ENCODER 0
-%define CONFIG_PCM_U32BE_ENCODER 0
-%define CONFIG_PCM_U32LE_ENCODER 0
-%define CONFIG_ROQ_DPCM_ENCODER 0
-%define CONFIG_ADPCM_ADX_ENCODER 0
-%define CONFIG_ADPCM_G722_ENCODER 0
-%define CONFIG_ADPCM_G726_ENCODER 0
-%define CONFIG_ADPCM_IMA_QT_ENCODER 0
-%define CONFIG_ADPCM_IMA_WAV_ENCODER 0
-%define CONFIG_ADPCM_MS_ENCODER 0
-%define CONFIG_ADPCM_SWF_ENCODER 0
-%define CONFIG_ADPCM_YAMAHA_ENCODER 0
-%define CONFIG_SSA_ENCODER 0
-%define CONFIG_ASS_ENCODER 0
-%define CONFIG_DVBSUB_ENCODER 0
-%define CONFIG_DVDSUB_ENCODER 0
-%define CONFIG_MOVTEXT_ENCODER 0
-%define CONFIG_SRT_ENCODER 0
-%define CONFIG_SUBRIP_ENCODER 0
-%define CONFIG_XSUB_ENCODER 0
-%define CONFIG_LIBFAAC_ENCODER 0
-%define CONFIG_LIBFDK_AAC_ENCODER 0
-%define CONFIG_LIBGSM_ENCODER 0
-%define CONFIG_LIBGSM_MS_ENCODER 0
-%define CONFIG_LIBILBC_ENCODER 0
-%define CONFIG_LIBMP3LAME_ENCODER 0
-%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
-%define CONFIG_LIBOPENJPEG_ENCODER 0
-%define CONFIG_LIBOPUS_ENCODER 0
-%define CONFIG_LIBSCHROEDINGER_ENCODER 0
-%define CONFIG_LIBSHINE_ENCODER 0
-%define CONFIG_LIBSPEEX_ENCODER 0
-%define CONFIG_LIBTHEORA_ENCODER 0
-%define CONFIG_LIBTWOLAME_ENCODER 0
-%define CONFIG_LIBUTVIDEO_ENCODER 0
-%define CONFIG_LIBVO_AACENC_ENCODER 0
-%define CONFIG_LIBVO_AMRWBENC_ENCODER 0
-%define CONFIG_LIBVORBIS_ENCODER 0
-%define CONFIG_LIBVPX_VP8_ENCODER 0
-%define CONFIG_LIBVPX_VP9_ENCODER 0
-%define CONFIG_LIBWAVPACK_ENCODER 0
-%define CONFIG_LIBX264_ENCODER 0
-%define CONFIG_LIBX264RGB_ENCODER 0
-%define CONFIG_LIBXAVS_ENCODER 0
-%define CONFIG_LIBXVID_ENCODER 0
-%define CONFIG_LIBAACPLUS_ENCODER 0
-%define CONFIG_ACONVERT_FILTER 0
-%define CONFIG_ADELAY_FILTER 0
-%define CONFIG_AECHO_FILTER 0
-%define CONFIG_AEVAL_FILTER 0
-%define CONFIG_AFADE_FILTER 0
-%define CONFIG_AFORMAT_FILTER 0
-%define CONFIG_AINTERLEAVE_FILTER 0
-%define CONFIG_ALLPASS_FILTER 0
-%define CONFIG_AMERGE_FILTER 0
-%define CONFIG_AMIX_FILTER 0
-%define CONFIG_ANULL_FILTER 0
-%define CONFIG_APAD_FILTER 0
-%define CONFIG_APERMS_FILTER 0
-%define CONFIG_APHASER_FILTER 0
-%define CONFIG_ARESAMPLE_FILTER 0
-%define CONFIG_ASELECT_FILTER 0
-%define CONFIG_ASENDCMD_FILTER 0
-%define CONFIG_ASETNSAMPLES_FILTER 0
-%define CONFIG_ASETPTS_FILTER 0
-%define CONFIG_ASETRATE_FILTER 0
-%define CONFIG_ASETTB_FILTER 0
-%define CONFIG_ASHOWINFO_FILTER 0
-%define CONFIG_ASPLIT_FILTER 0
-%define CONFIG_ASTATS_FILTER 0
-%define CONFIG_ASTREAMSYNC_FILTER 0
-%define CONFIG_ASYNCTS_FILTER 0
-%define CONFIG_ATEMPO_FILTER 0
-%define CONFIG_ATRIM_FILTER 0
-%define CONFIG_AZMQ_FILTER 0
-%define CONFIG_BANDPASS_FILTER 0
-%define CONFIG_BANDREJECT_FILTER 0
-%define CONFIG_BASS_FILTER 0
-%define CONFIG_BIQUAD_FILTER 0
-%define CONFIG_CHANNELMAP_FILTER 0
-%define CONFIG_CHANNELSPLIT_FILTER 0
-%define CONFIG_COMPAND_FILTER 0
-%define CONFIG_EARWAX_FILTER 0
-%define CONFIG_EBUR128_FILTER 0
-%define CONFIG_EQUALIZER_FILTER 0
-%define CONFIG_HIGHPASS_FILTER 0
-%define CONFIG_JOIN_FILTER 0
-%define CONFIG_LADSPA_FILTER 0
-%define CONFIG_LOWPASS_FILTER 0
-%define CONFIG_PAN_FILTER 0
-%define CONFIG_REPLAYGAIN_FILTER 0
-%define CONFIG_RESAMPLE_FILTER 0
-%define CONFIG_SILENCEDETECT_FILTER 0
-%define CONFIG_TREBLE_FILTER 0
-%define CONFIG_VOLUME_FILTER 0
-%define CONFIG_VOLUMEDETECT_FILTER 0
-%define CONFIG_AEVALSRC_FILTER 0
-%define CONFIG_ANULLSRC_FILTER 0
-%define CONFIG_FLITE_FILTER 0
-%define CONFIG_SINE_FILTER 0
-%define CONFIG_ANULLSINK_FILTER 0
-%define CONFIG_ALPHAEXTRACT_FILTER 0
-%define CONFIG_ALPHAMERGE_FILTER 0
-%define CONFIG_ASS_FILTER 0
-%define CONFIG_BBOX_FILTER 0
-%define CONFIG_BLACKDETECT_FILTER 0
-%define CONFIG_BLACKFRAME_FILTER 0
-%define CONFIG_BLEND_FILTER 0
-%define CONFIG_BOXBLUR_FILTER 0
-%define CONFIG_COLORBALANCE_FILTER 0
-%define CONFIG_COLORCHANNELMIXER_FILTER 0
-%define CONFIG_COLORMATRIX_FILTER 0
-%define CONFIG_COPY_FILTER 0
-%define CONFIG_CROP_FILTER 0
-%define CONFIG_CROPDETECT_FILTER 0
-%define CONFIG_CURVES_FILTER 0
-%define CONFIG_DCTDNOIZ_FILTER 0
-%define CONFIG_DECIMATE_FILTER 0
-%define CONFIG_DELOGO_FILTER 0
-%define CONFIG_DESHAKE_FILTER 0
-%define CONFIG_DRAWBOX_FILTER 0
-%define CONFIG_DRAWGRID_FILTER 0
-%define CONFIG_DRAWTEXT_FILTER 0
-%define CONFIG_EDGEDETECT_FILTER 0
-%define CONFIG_ELBG_FILTER 0
-%define CONFIG_EXTRACTPLANES_FILTER 0
-%define CONFIG_FADE_FILTER 0
-%define CONFIG_FIELD_FILTER 0
-%define CONFIG_FIELDMATCH_FILTER 0
-%define CONFIG_FIELDORDER_FILTER 0
-%define CONFIG_FORMAT_FILTER 0
-%define CONFIG_FPS_FILTER 0
-%define CONFIG_FRAMESTEP_FILTER 0
-%define CONFIG_FREI0R_FILTER 0
-%define CONFIG_GEQ_FILTER 0
-%define CONFIG_GRADFUN_FILTER 0
-%define CONFIG_HALDCLUT_FILTER 0
-%define CONFIG_HFLIP_FILTER 0
-%define CONFIG_HISTEQ_FILTER 0
-%define CONFIG_HISTOGRAM_FILTER 0
-%define CONFIG_HQDN3D_FILTER 0
-%define CONFIG_HUE_FILTER 0
-%define CONFIG_IDET_FILTER 0
-%define CONFIG_IL_FILTER 0
-%define CONFIG_INTERLACE_FILTER 0
-%define CONFIG_INTERLEAVE_FILTER 0
-%define CONFIG_KERNDEINT_FILTER 0
-%define CONFIG_LUT3D_FILTER 0
-%define CONFIG_LUT_FILTER 0
-%define CONFIG_LUTRGB_FILTER 0
-%define CONFIG_LUTYUV_FILTER 0
-%define CONFIG_MCDEINT_FILTER 0
-%define CONFIG_MERGEPLANES_FILTER 0
-%define CONFIG_MP_FILTER 0
-%define CONFIG_MPDECIMATE_FILTER 0
-%define CONFIG_NEGATE_FILTER 0
-%define CONFIG_NOFORMAT_FILTER 0
-%define CONFIG_NOISE_FILTER 0
-%define CONFIG_NULL_FILTER 0
-%define CONFIG_OCV_FILTER 0
-%define CONFIG_OVERLAY_FILTER 0
-%define CONFIG_OWDENOISE_FILTER 0
-%define CONFIG_PAD_FILTER 0
-%define CONFIG_PERMS_FILTER 0
-%define CONFIG_PERSPECTIVE_FILTER 0
-%define CONFIG_PHASE_FILTER 0
-%define CONFIG_PIXDESCTEST_FILTER 0
-%define CONFIG_PP_FILTER 0
-%define CONFIG_PSNR_FILTER 0
-%define CONFIG_PULLUP_FILTER 0
-%define CONFIG_REMOVELOGO_FILTER 0
-%define CONFIG_ROTATE_FILTER 0
-%define CONFIG_SAB_FILTER 0
-%define CONFIG_SCALE_FILTER 0
-%define CONFIG_SELECT_FILTER 0
-%define CONFIG_SENDCMD_FILTER 0
-%define CONFIG_SEPARATEFIELDS_FILTER 0
-%define CONFIG_SETDAR_FILTER 0
-%define CONFIG_SETFIELD_FILTER 0
-%define CONFIG_SETPTS_FILTER 0
-%define CONFIG_SETSAR_FILTER 0
-%define CONFIG_SETTB_FILTER 0
-%define CONFIG_SHOWINFO_FILTER 0
-%define CONFIG_SMARTBLUR_FILTER 0
-%define CONFIG_SPLIT_FILTER 0
-%define CONFIG_SPP_FILTER 0
-%define CONFIG_STEREO3D_FILTER 0
-%define CONFIG_SUBTITLES_FILTER 0
-%define CONFIG_SUPER2XSAI_FILTER 0
-%define CONFIG_SWAPUV_FILTER 0
-%define CONFIG_TELECINE_FILTER 0
-%define CONFIG_THUMBNAIL_FILTER 0
-%define CONFIG_TILE_FILTER 0
-%define CONFIG_TINTERLACE_FILTER 0
-%define CONFIG_TRANSPOSE_FILTER 0
-%define CONFIG_TRIM_FILTER 0
-%define CONFIG_UNSHARP_FILTER 0
-%define CONFIG_VFLIP_FILTER 0
-%define CONFIG_VIDSTABDETECT_FILTER 0
-%define CONFIG_VIDSTABTRANSFORM_FILTER 0
-%define CONFIG_VIGNETTE_FILTER 0
-%define CONFIG_W3FDIF_FILTER 0
-%define CONFIG_YADIF_FILTER 0
-%define CONFIG_ZMQ_FILTER 0
-%define CONFIG_CELLAUTO_FILTER 0
-%define CONFIG_COLOR_FILTER 0
-%define CONFIG_FREI0R_SRC_FILTER 0
-%define CONFIG_HALDCLUTSRC_FILTER 0
-%define CONFIG_LIFE_FILTER 0
-%define CONFIG_MANDELBROT_FILTER 0
-%define CONFIG_MPTESTSRC_FILTER 0
-%define CONFIG_NULLSRC_FILTER 0
-%define CONFIG_RGBTESTSRC_FILTER 0
-%define CONFIG_SMPTEBARS_FILTER 0
-%define CONFIG_SMPTEHDBARS_FILTER 0
-%define CONFIG_TESTSRC_FILTER 0
-%define CONFIG_NULLSINK_FILTER 0
-%define CONFIG_AVECTORSCOPE_FILTER 0
-%define CONFIG_CONCAT_FILTER 0
-%define CONFIG_SHOWSPECTRUM_FILTER 0
-%define CONFIG_SHOWWAVES_FILTER 0
-%define CONFIG_AMOVIE_FILTER 0
-%define CONFIG_MOVIE_FILTER 0
-%define CONFIG_H263_VAAPI_HWACCEL 0
-%define CONFIG_H263_VDPAU_HWACCEL 0
-%define CONFIG_H264_DXVA2_HWACCEL 0
-%define CONFIG_H264_VAAPI_HWACCEL 0
-%define CONFIG_H264_VDA_HWACCEL 0
-%define CONFIG_H264_VDPAU_HWACCEL 0
-%define CONFIG_MPEG1_VDPAU_HWACCEL 0
-%define CONFIG_MPEG2_DXVA2_HWACCEL 0
-%define CONFIG_MPEG2_VAAPI_HWACCEL 0
-%define CONFIG_MPEG2_VDPAU_HWACCEL 0
-%define CONFIG_MPEG4_VAAPI_HWACCEL 0
-%define CONFIG_MPEG4_VDPAU_HWACCEL 0
-%define CONFIG_VC1_DXVA2_HWACCEL 0
-%define CONFIG_VC1_VAAPI_HWACCEL 0
-%define CONFIG_VC1_VDPAU_HWACCEL 0
-%define CONFIG_WMV3_DXVA2_HWACCEL 0
-%define CONFIG_WMV3_VAAPI_HWACCEL 0
-%define CONFIG_WMV3_VDPAU_HWACCEL 0
-%define CONFIG_ALSA_INDEV 0
-%define CONFIG_BKTR_INDEV 0
-%define CONFIG_DSHOW_INDEV 0
-%define CONFIG_DV1394_INDEV 0
-%define CONFIG_FBDEV_INDEV 0
-%define CONFIG_IEC61883_INDEV 0
-%define CONFIG_JACK_INDEV 0
-%define CONFIG_LAVFI_INDEV 0
-%define CONFIG_OPENAL_INDEV 0
-%define CONFIG_OSS_INDEV 0
-%define CONFIG_PULSE_INDEV 0
-%define CONFIG_SNDIO_INDEV 0
-%define CONFIG_V4L2_INDEV 0
-%define CONFIG_VFWCAP_INDEV 0
-%define CONFIG_X11GRAB_INDEV 0
-%define CONFIG_LIBCDIO_INDEV 0
-%define CONFIG_LIBDC1394_INDEV 0
-%define CONFIG_A64_MUXER 0
-%define CONFIG_AC3_MUXER 0
-%define CONFIG_ADTS_MUXER 0
-%define CONFIG_ADX_MUXER 0
-%define CONFIG_AIFF_MUXER 0
-%define CONFIG_AMR_MUXER 0
-%define CONFIG_ASF_MUXER 0
-%define CONFIG_ASS_MUXER 0
-%define CONFIG_AST_MUXER 0
-%define CONFIG_ASF_STREAM_MUXER 0
-%define CONFIG_AU_MUXER 0
-%define CONFIG_AVI_MUXER 0
-%define CONFIG_AVM2_MUXER 0
-%define CONFIG_BIT_MUXER 0
-%define CONFIG_CAF_MUXER 0
-%define CONFIG_CAVSVIDEO_MUXER 0
-%define CONFIG_CRC_MUXER 0
-%define CONFIG_DATA_MUXER 0
-%define CONFIG_DAUD_MUXER 0
-%define CONFIG_DIRAC_MUXER 0
-%define CONFIG_DNXHD_MUXER 0
-%define CONFIG_DTS_MUXER 0
-%define CONFIG_DV_MUXER 0
-%define CONFIG_EAC3_MUXER 0
-%define CONFIG_F4V_MUXER 0
-%define CONFIG_FFM_MUXER 0
-%define CONFIG_FFMETADATA_MUXER 0
-%define CONFIG_FILMSTRIP_MUXER 0
-%define CONFIG_FLAC_MUXER 0
-%define CONFIG_FLV_MUXER 0
-%define CONFIG_FRAMECRC_MUXER 0
-%define CONFIG_FRAMEMD5_MUXER 0
-%define CONFIG_G722_MUXER 0
-%define CONFIG_G723_1_MUXER 0
-%define CONFIG_GIF_MUXER 0
-%define CONFIG_GXF_MUXER 0
-%define CONFIG_H261_MUXER 0
-%define CONFIG_H263_MUXER 0
-%define CONFIG_H264_MUXER 0
-%define CONFIG_HDS_MUXER 0
-%define CONFIG_HLS_MUXER 0
-%define CONFIG_ICO_MUXER 0
-%define CONFIG_ILBC_MUXER 0
-%define CONFIG_IMAGE2_MUXER 0
-%define CONFIG_IMAGE2PIPE_MUXER 0
-%define CONFIG_IPOD_MUXER 0
-%define CONFIG_IRCAM_MUXER 0
-%define CONFIG_ISMV_MUXER 0
-%define CONFIG_IVF_MUXER 0
-%define CONFIG_JACOSUB_MUXER 0
-%define CONFIG_LATM_MUXER 0
-%define CONFIG_M4V_MUXER 0
-%define CONFIG_MD5_MUXER 0
-%define CONFIG_MATROSKA_MUXER 0
-%define CONFIG_MATROSKA_AUDIO_MUXER 0
-%define CONFIG_MICRODVD_MUXER 0
-%define CONFIG_MJPEG_MUXER 0
-%define CONFIG_MLP_MUXER 0
-%define CONFIG_MMF_MUXER 0
-%define CONFIG_MOV_MUXER 0
-%define CONFIG_MP2_MUXER 0
-%define CONFIG_MP3_MUXER 0
-%define CONFIG_MP4_MUXER 0
-%define CONFIG_MPEG1SYSTEM_MUXER 0
-%define CONFIG_MPEG1VCD_MUXER 0
-%define CONFIG_MPEG1VIDEO_MUXER 0
-%define CONFIG_MPEG2DVD_MUXER 0
-%define CONFIG_MPEG2SVCD_MUXER 0
-%define CONFIG_MPEG2VIDEO_MUXER 0
-%define CONFIG_MPEG2VOB_MUXER 0
-%define CONFIG_MPEGTS_MUXER 0
-%define CONFIG_MPJPEG_MUXER 0
-%define CONFIG_MXF_MUXER 0
-%define CONFIG_MXF_D10_MUXER 0
-%define CONFIG_NULL_MUXER 0
-%define CONFIG_NUT_MUXER 0
-%define CONFIG_OGG_MUXER 0
-%define CONFIG_OMA_MUXER 0
-%define CONFIG_OPUS_MUXER 0
-%define CONFIG_PCM_ALAW_MUXER 0
-%define CONFIG_PCM_MULAW_MUXER 0
-%define CONFIG_PCM_F64BE_MUXER 0
-%define CONFIG_PCM_F64LE_MUXER 0
-%define CONFIG_PCM_F32BE_MUXER 0
-%define CONFIG_PCM_F32LE_MUXER 0
-%define CONFIG_PCM_S32BE_MUXER 0
-%define CONFIG_PCM_S32LE_MUXER 0
-%define CONFIG_PCM_S24BE_MUXER 0
-%define CONFIG_PCM_S24LE_MUXER 0
-%define CONFIG_PCM_S16BE_MUXER 0
-%define CONFIG_PCM_S16LE_MUXER 0
-%define CONFIG_PCM_S8_MUXER 0
-%define CONFIG_PCM_U32BE_MUXER 0
-%define CONFIG_PCM_U32LE_MUXER 0
-%define CONFIG_PCM_U24BE_MUXER 0
-%define CONFIG_PCM_U24LE_MUXER 0
-%define CONFIG_PCM_U16BE_MUXER 0
-%define CONFIG_PCM_U16LE_MUXER 0
-%define CONFIG_PCM_U8_MUXER 0
-%define CONFIG_PSP_MUXER 0
-%define CONFIG_RAWVIDEO_MUXER 0
-%define CONFIG_RM_MUXER 0
-%define CONFIG_ROQ_MUXER 0
-%define CONFIG_RSO_MUXER 0
-%define CONFIG_RTP_MUXER 0
-%define CONFIG_RTSP_MUXER 0
-%define CONFIG_SAP_MUXER 0
-%define CONFIG_SEGMENT_MUXER 0
-%define CONFIG_STREAM_SEGMENT_MUXER 0
-%define CONFIG_SMJPEG_MUXER 0
-%define CONFIG_SMOOTHSTREAMING_MUXER 0
-%define CONFIG_SOX_MUXER 0
-%define CONFIG_SPDIF_MUXER 0
-%define CONFIG_SPEEX_MUXER 0
-%define CONFIG_SRT_MUXER 0
-%define CONFIG_SWF_MUXER 0
-%define CONFIG_TEE_MUXER 0
-%define CONFIG_TG2_MUXER 0
-%define CONFIG_TGP_MUXER 0
-%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
-%define CONFIG_TRUEHD_MUXER 0
-%define CONFIG_VC1_MUXER 0
-%define CONFIG_VC1T_MUXER 0
-%define CONFIG_VOC_MUXER 0
-%define CONFIG_W64_MUXER 0
-%define CONFIG_WAV_MUXER 0
-%define CONFIG_WEBM_MUXER 0
-%define CONFIG_WEBVTT_MUXER 0
-%define CONFIG_WTV_MUXER 0
-%define CONFIG_WV_MUXER 0
-%define CONFIG_YUV4MPEGPIPE_MUXER 0
-%define CONFIG_LIBNUT_MUXER 0
-%define CONFIG_ALSA_OUTDEV 0
-%define CONFIG_CACA_OUTDEV 0
-%define CONFIG_FBDEV_OUTDEV 0
-%define CONFIG_OSS_OUTDEV 0
-%define CONFIG_PULSE_OUTDEV 0
-%define CONFIG_SDL_OUTDEV 0
-%define CONFIG_SNDIO_OUTDEV 0
-%define CONFIG_V4L2_OUTDEV 0
-%define CONFIG_XV_OUTDEV 0
-%define CONFIG_AAC_PARSER 1
-%define CONFIG_AAC_LATM_PARSER 0
-%define CONFIG_AC3_PARSER 0
-%define CONFIG_ADX_PARSER 0
-%define CONFIG_BMP_PARSER 0
-%define CONFIG_CAVSVIDEO_PARSER 0
-%define CONFIG_COOK_PARSER 0
-%define CONFIG_DCA_PARSER 0
-%define CONFIG_DIRAC_PARSER 0
-%define CONFIG_DNXHD_PARSER 0
-%define CONFIG_DPX_PARSER 0
-%define CONFIG_DVBSUB_PARSER 0
-%define CONFIG_DVDSUB_PARSER 0
-%define CONFIG_DVD_NAV_PARSER 0
-%define CONFIG_FLAC_PARSER 0
-%define CONFIG_GSM_PARSER 0
-%define CONFIG_H261_PARSER 0
-%define CONFIG_H263_PARSER 0
-%define CONFIG_H264_PARSER 1
-%define CONFIG_HEVC_PARSER 0
-%define CONFIG_MJPEG_PARSER 0
-%define CONFIG_MLP_PARSER 0
-%define CONFIG_MPEG4VIDEO_PARSER 0
-%define CONFIG_MPEGAUDIO_PARSER 1
-%define CONFIG_MPEGVIDEO_PARSER 0
-%define CONFIG_PNG_PARSER 0
-%define CONFIG_PNM_PARSER 0
-%define CONFIG_RV30_PARSER 0
-%define CONFIG_RV40_PARSER 0
-%define CONFIG_TAK_PARSER 0
-%define CONFIG_VC1_PARSER 0
-%define CONFIG_VORBIS_PARSER 1
-%define CONFIG_VP3_PARSER 1
-%define CONFIG_VP8_PARSER 1
-%define CONFIG_VP9_PARSER 0
-%define CONFIG_BLURAY_PROTOCOL 0
-%define CONFIG_CACHE_PROTOCOL 0
-%define CONFIG_CONCAT_PROTOCOL 0
-%define CONFIG_CRYPTO_PROTOCOL 0
-%define CONFIG_DATA_PROTOCOL 0
-%define CONFIG_FFRTMPCRYPT_PROTOCOL 0
-%define CONFIG_FFRTMPHTTP_PROTOCOL 0
-%define CONFIG_FILE_PROTOCOL 0
-%define CONFIG_FTP_PROTOCOL 0
-%define CONFIG_GOPHER_PROTOCOL 0
-%define CONFIG_HLS_PROTOCOL 0
-%define CONFIG_HTTP_PROTOCOL 0
-%define CONFIG_HTTPPROXY_PROTOCOL 0
-%define CONFIG_HTTPS_PROTOCOL 0
-%define CONFIG_MMSH_PROTOCOL 0
-%define CONFIG_MMST_PROTOCOL 0
-%define CONFIG_MD5_PROTOCOL 0
-%define CONFIG_PIPE_PROTOCOL 0
-%define CONFIG_RTMP_PROTOCOL 0
-%define CONFIG_RTMPE_PROTOCOL 0
-%define CONFIG_RTMPS_PROTOCOL 0
-%define CONFIG_RTMPT_PROTOCOL 0
-%define CONFIG_RTMPTE_PROTOCOL 0
-%define CONFIG_RTMPTS_PROTOCOL 0
-%define CONFIG_RTP_PROTOCOL 0
-%define CONFIG_SCTP_PROTOCOL 0
-%define CONFIG_SRTP_PROTOCOL 0
-%define CONFIG_TCP_PROTOCOL 0
-%define CONFIG_TLS_PROTOCOL 0
-%define CONFIG_UDP_PROTOCOL 0
-%define CONFIG_UNIX_PROTOCOL 0
-%define CONFIG_LIBRTMP_PROTOCOL 0
-%define CONFIG_LIBRTMPE_PROTOCOL 0
-%define CONFIG_LIBRTMPS_PROTOCOL 0
-%define CONFIG_LIBRTMPT_PROTOCOL 0
-%define CONFIG_LIBRTMPTE_PROTOCOL 0
-%define CONFIG_LIBSSH_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/config.h
deleted file mode 100644
index 0829177b32f..00000000000
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win-vs2013/x64/config.h
+++ /dev/null
@@ -1,1661 +0,0 @@
-/* Automatically generated by configure - do not modify! */
-#ifndef FFMPEG_CONFIG_H
-#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
-#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
-#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
-#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64"
-#define av_restrict __restrict
-#define EXTERN_PREFIX ""
-#define EXTERN_ASM
-#define BUILDSUF ""
-#define SLIBSUF ".dll"
-#define HAVE_MMX2 HAVE_MMXEXT
-#define ARCH_AARCH64 0
-#define ARCH_ALPHA 0
-#define ARCH_ARM 0
-#define ARCH_AVR32 0
-#define ARCH_AVR32_AP 0
-#define ARCH_AVR32_UC 0
-#define ARCH_BFIN 0
-#define ARCH_IA64 0
-#define ARCH_M68K 0
-#define ARCH_MIPS 0
-#define ARCH_MIPS64 0
-#define ARCH_PARISC 0
-#define ARCH_PPC 0
-#define ARCH_PPC64 0
-#define ARCH_S390 0
-#define ARCH_SH4 0
-#define ARCH_SPARC 0
-#define ARCH_SPARC64 0
-#define ARCH_TILEGX 0
-#define ARCH_TILEPRO 0
-#define ARCH_TOMI 0
-#define ARCH_X86 1
-#define ARCH_X86_32 0
-#define ARCH_X86_64 1
-#define HAVE_ARMV5TE 0
-#define HAVE_ARMV6 0
-#define HAVE_ARMV6T2 0
-#define HAVE_NEON 0
-#define HAVE_VFP 0
-#define HAVE_VFPV3 0
-#define HAVE_AMD3DNOW 1
-#define HAVE_AMD3DNOWEXT 1
-#define HAVE_AVX 1
-#define HAVE_AVX2 1
-#define HAVE_FMA4 1
-#define HAVE_I686 1
-#define HAVE_MMX 1
-#define HAVE_MMXEXT 1
-#define HAVE_SSE 1
-#define HAVE_SSE2 1
-#define HAVE_SSE3 1
-#define HAVE_SSE4 1
-#define HAVE_SSE42 1
-#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
-#define HAVE_MIPSFPU 0
-#define HAVE_MIPS32R2 0
-#define HAVE_MIPSDSPR1 0
-#define HAVE_MIPSDSPR2 0
-#define HAVE_ARMV5TE_EXTERNAL 0
-#define HAVE_ARMV6_EXTERNAL 0
-#define HAVE_ARMV6T2_EXTERNAL 0
-#define HAVE_NEON_EXTERNAL 0
-#define HAVE_VFP_EXTERNAL 0
-#define HAVE_VFPV3_EXTERNAL 0
-#define HAVE_AMD3DNOW_EXTERNAL 1
-#define HAVE_AMD3DNOWEXT_EXTERNAL 1
-#define HAVE_AVX_EXTERNAL 1
-#define HAVE_AVX2_EXTERNAL 1
-#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
-#define HAVE_MMX_EXTERNAL 1
-#define HAVE_MMXEXT_EXTERNAL 1
-#define HAVE_SSE_EXTERNAL 1
-#define HAVE_SSE2_EXTERNAL 1
-#define HAVE_SSE3_EXTERNAL 1
-#define HAVE_SSE4_EXTERNAL 1
-#define HAVE_SSE42_EXTERNAL 1
-#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
-#define HAVE_MIPSFPU_EXTERNAL 0
-#define HAVE_MIPS32R2_EXTERNAL 0
-#define HAVE_MIPSDSPR1_EXTERNAL 0
-#define HAVE_MIPSDSPR2_EXTERNAL 0
-#define HAVE_ARMV5TE_INLINE 0
-#define HAVE_ARMV6_INLINE 0
-#define HAVE_ARMV6T2_INLINE 0
-#define HAVE_NEON_INLINE 0
-#define HAVE_VFP_INLINE 0
-#define HAVE_VFPV3_INLINE 0
-#define HAVE_AMD3DNOW_INLINE 0
-#define HAVE_AMD3DNOWEXT_INLINE 0
-#define HAVE_AVX_INLINE 0
-#define HAVE_AVX2_INLINE 0
-#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
-#define HAVE_MMX_INLINE 0
-#define HAVE_MMXEXT_INLINE 0
-#define HAVE_SSE_INLINE 0
-#define HAVE_SSE2_INLINE 0
-#define HAVE_SSE3_INLINE 0
-#define HAVE_SSE4_INLINE 0
-#define HAVE_SSE42_INLINE 0
-#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
-#define HAVE_MIPSFPU_INLINE 0
-#define HAVE_MIPS32R2_INLINE 0
-#define HAVE_MIPSDSPR1_INLINE 0
-#define HAVE_MIPSDSPR2_INLINE 0
-#define HAVE_INLINE_ASM 0
-#define HAVE_SYMVER 0
-#define HAVE_YASM 1
-#define HAVE_BIGENDIAN 0
-#define HAVE_FAST_UNALIGNED 1
-#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 0
-#define HAVE_W32THREADS 1
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 0
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 1
-#define HAVE_ATANF 1
-#define HAVE_ATAN2F 1
-#define HAVE_CBRT 1
-#define HAVE_CBRTF 1
-#define HAVE_COSF 1
-#define HAVE_EXP2 1
-#define HAVE_EXP2F 1
-#define HAVE_EXPF 1
-#define HAVE_ISINF 1
-#define HAVE_ISNAN 1
-#define HAVE_LDEXPF 1
-#define HAVE_LLRINT 1
-#define HAVE_LLRINTF 1
-#define HAVE_LOG2 0
-#define HAVE_LOG2F 1
-#define HAVE_LOG10F 1
-#define HAVE_LRINT 1
-#define HAVE_LRINTF 1
-#define HAVE_POWF 1
-#define HAVE_RINT 1
-#define HAVE_ROUND 1
-#define HAVE_ROUNDF 1
-#define HAVE_SINF 1
-#define HAVE_TRUNC 1
-#define HAVE_TRUNCF 1
-#define HAVE_ACCESS 1
-#define HAVE_ALIGNED_MALLOC 1
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 0
-#define HAVE_ATTRIBUTE_PACKED 0
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
-#define HAVE_CLOCK_GETTIME 0
-#define HAVE_CLOSESOCKET 0
-#define HAVE_COMMANDLINETOARGVW 1
-#define HAVE_CPUNOP 1
-#define HAVE_CRYPTGENRANDOM 1
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 1
-#define HAVE_DLFCN_H 0
-#define HAVE_DLOPEN 0
-#define HAVE_DOS_PATHS 1
-#define HAVE_DXVA_H 1
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 1
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 1
-#define HAVE_FCNTL 0
-#define HAVE_FORK 0
-#define HAVE_GETADDRINFO 0
-#define HAVE_GETHRTIME 0
-#define HAVE_GETOPT 0
-#define HAVE_GETPROCESSAFFINITYMASK 1
-#define HAVE_GETPROCESSMEMORYINFO 1
-#define HAVE_GETPROCESSTIMES 1
-#define HAVE_GETSYSTEMTIMEASFILETIME 1
-#define HAVE_GETRUSAGE 0
-#define HAVE_GETSERVBYPORT 0
-#define HAVE_GETTIMEOFDAY 0
-#define HAVE_GLOB 0
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 0
-#define HAVE_IO_H 1
-#define HAVE_INLINE_ASM_LABELS 0
-#define HAVE_ISATTY 1
-#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
-#define HAVE_KBHIT 1
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 1
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
-#define HAVE_LOCALTIME_R 0
-#define HAVE_LOONGSON 0
-#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MAPVIEWOFFILE 1
-#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 1
-#define HAVE_MKSTEMP 0
-#define HAVE_MM_EMPTY 0
-#define HAVE_MMAP 0
-#define HAVE_MPROTECT 0
-#define HAVE_NANOSLEEP 0
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
-#define HAVE_PEEKNAMEDPIPE 1
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 0
-#define HAVE_POSIX_MEMALIGN 0
-#define HAVE_PRAGMA_DEPRECATED 1
-#define HAVE_PTHREAD_CANCEL 0
-#define HAVE_RDTSC 1
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 0
-#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
-#define HAVE_SETCONSOLETEXTATTRIBUTE 1
-#define HAVE_SETMODE 1
-#define HAVE_SETRLIMIT 0
-#define HAVE_SLEEP 1
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
-#define HAVE_STRERROR_R 0
-#define HAVE_STRUCT_ADDRINFO 0
-#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
-#define HAVE_STRUCT_IP_MREQ_SOURCE 0
-#define HAVE_STRUCT_IPV6_MREQ 0
-#define HAVE_STRUCT_POLLFD 0
-#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0
-#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
-#define HAVE_STRUCT_SOCKADDR_IN6 0
-#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
-#define HAVE_STRUCT_SOCKADDR_STORAGE 0
-#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
-#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-#define HAVE_SYSCONF 0
-#define HAVE_SYSCTL 0
-#define HAVE_SYS_MMAN_H 0
-#define HAVE_SYS_PARAM_H 0
-#define HAVE_SYS_RESOURCE_H 0
-#define HAVE_SYS_SELECT_H 0
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 0
-#define HAVE_SYS_UN_H 0
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 0
-#define HAVE_TEXI2HTML 0
-#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 0
-#define HAVE_USLEEP 0
-#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 1
-#define HAVE_WINDOWS_H 1
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
-#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
-#define CONFIG_BSFS 0
-#define CONFIG_DECODERS 1
-#define CONFIG_DEMUXERS 1
-#define CONFIG_ENCODERS 0
-#define CONFIG_FILTERS 0
-#define CONFIG_HWACCELS 0
-#define CONFIG_INDEVS 0
-#define CONFIG_MUXERS 0
-#define CONFIG_OUTDEVS 0
-#define CONFIG_PARSERS 1
-#define CONFIG_PROTOCOLS 0
-#define CONFIG_DOC 0
-#define CONFIG_HTMLPAGES 0
-#define CONFIG_MANPAGES 1
-#define CONFIG_PODPAGES 1
-#define CONFIG_TXTPAGES 1
-#define CONFIG_DECODING_ENCODING_EXAMPLE 1
-#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
-#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
-#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
-#define CONFIG_METADATA_EXAMPLE 1
-#define CONFIG_MUXING_EXAMPLE 0
-#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
-#define CONFIG_SCALING_VIDEO_EXAMPLE 0
-#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
-#define CONFIG_AVISYNTH 0
-#define CONFIG_BZLIB 0
-#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
-#define CONFIG_FREI0R 0
-#define CONFIG_GNUTLS 0
-#define CONFIG_ICONV 0
-#define CONFIG_LADSPA 0
-#define CONFIG_LIBAACPLUS 0
-#define CONFIG_LIBASS 0
-#define CONFIG_LIBBLURAY 0
-#define CONFIG_LIBCACA 0
-#define CONFIG_LIBCDIO 0
-#define CONFIG_LIBCELT 0
-#define CONFIG_LIBDC1394 0
-#define CONFIG_LIBFAAC 0
-#define CONFIG_LIBFDK_AAC 0
-#define CONFIG_LIBFLITE 0
-#define CONFIG_LIBFREETYPE 0
-#define CONFIG_LIBGME 0
-#define CONFIG_LIBGSM 0
-#define CONFIG_LIBIEC61883 0
-#define CONFIG_LIBILBC 0
-#define CONFIG_LIBMODPLUG 0
-#define CONFIG_LIBMP3LAME 0
-#define CONFIG_LIBNUT 0
-#define CONFIG_LIBOPENCORE_AMRNB 0
-#define CONFIG_LIBOPENCORE_AMRWB 0
-#define CONFIG_LIBOPENCV 0
-#define CONFIG_LIBOPENJPEG 0
-#define CONFIG_LIBOPUS 0
-#define CONFIG_LIBPULSE 0
-#define CONFIG_LIBQUVI 0
-#define CONFIG_LIBRTMP 0
-#define CONFIG_LIBSCHROEDINGER 0
-#define CONFIG_LIBSHINE 0
-#define CONFIG_LIBSOXR 0
-#define CONFIG_LIBSPEEX 0
-#define CONFIG_LIBSSH 0
-#define CONFIG_LIBSTAGEFRIGHT_H264 0
-#define CONFIG_LIBTHEORA 0
-#define CONFIG_LIBTWOLAME 0
-#define CONFIG_LIBUTVIDEO 0
-#define CONFIG_LIBV4L2 0
-#define CONFIG_LIBVIDSTAB 0
-#define CONFIG_LIBVO_AACENC 0
-#define CONFIG_LIBVO_AMRWBENC 0
-#define CONFIG_LIBVORBIS 0
-#define CONFIG_LIBVPX 0
-#define CONFIG_LIBWAVPACK 0
-#define CONFIG_LIBX264 0
-#define CONFIG_LIBXAVS 0
-#define CONFIG_LIBXVID 0
-#define CONFIG_LIBZMQ 0
-#define CONFIG_LIBZVBI 0
-#define CONFIG_OPENAL 0
-#define CONFIG_OPENCL 0
-#define CONFIG_OPENSSL 0
-#define CONFIG_X11GRAB 0
-#define CONFIG_ZLIB 0
-#define CONFIG_DXVA2 0
-#define CONFIG_VAAPI 0
-#define CONFIG_VDA 0
-#define CONFIG_VDPAU 0
-#define CONFIG_AVCODEC 1
-#define CONFIG_AVDEVICE 0
-#define CONFIG_AVFILTER 0
-#define CONFIG_AVFORMAT 1
-#define CONFIG_AVRESAMPLE 0
-#define CONFIG_AVUTIL 1
-#define CONFIG_POSTPROC 0
-#define CONFIG_SWRESAMPLE 0
-#define CONFIG_SWSCALE 0
-#define CONFIG_FFPLAY 0
-#define CONFIG_FFPROBE 0
-#define CONFIG_FFSERVER 0
-#define CONFIG_FFMPEG 0
-#define CONFIG_DCT 1
-#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
-#define CONFIG_FAST_UNALIGNED 1
-#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
-#define CONFIG_LSP 0
-#define CONFIG_LZO 0
-#define CONFIG_MDCT 1
-#define CONFIG_MEMALIGN_HACK 0
-#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
-#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 0
-#define CONFIG_SWSCALE_ALPHA 1
-#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
-#define CONFIG_XMM_CLOBBER_TEST 0
-#define CONFIG_AANDCTTABLES 0
-#define CONFIG_AC3DSP 0
-#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
-#define CONFIG_EXIF 0
-#define CONFIG_FRAME_THREAD_ENCODER 0
-#define CONFIG_GCRYPT 0
-#define CONFIG_GOLOMB 1
-#define CONFIG_GPLV3 0
-#define CONFIG_H263DSP 0
-#define CONFIG_H264CHROMA 1
-#define CONFIG_H264DSP 1
-#define CONFIG_H264PRED 1
-#define CONFIG_H264QPEL 1
-#define CONFIG_HPELDSP 1
-#define CONFIG_HUFFMAN 0
-#define CONFIG_LGPLV3 0
-#define CONFIG_LPC 0
-#define CONFIG_MPEGAUDIO 1
-#define CONFIG_MPEGAUDIODSP 1
-#define CONFIG_MPEGVIDEO 0
-#define CONFIG_MPEGVIDEOENC 0
-#define CONFIG_NETTLE 0
-#define CONFIG_RANGECODER 0
-#define CONFIG_RIFFDEC 1
-#define CONFIG_RIFFENC 0
-#define CONFIG_RTPDEC 0
-#define CONFIG_RTPENC_CHAIN 0
-#define CONFIG_SINEWIN 1
-#define CONFIG_VIDEODSP 1
-#define CONFIG_VP3DSP 1
-#define CONFIG_AAC_ADTSTOASC_BSF 0
-#define CONFIG_CHOMP_BSF 0
-#define CONFIG_DUMP_EXTRADATA_BSF 0
-#define CONFIG_H264_MP4TOANNEXB_BSF 0
-#define CONFIG_IMX_DUMP_HEADER_BSF 0
-#define CONFIG_MJPEG2JPEG_BSF 0
-#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
-#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
-#define CONFIG_MOV2TEXTSUB_BSF 0
-#define CONFIG_NOISE_BSF 0
-#define CONFIG_REMOVE_EXTRADATA_BSF 0
-#define CONFIG_TEXT2MOVSUB_BSF 0
-#define CONFIG_AASC_DECODER 0
-#define CONFIG_AIC_DECODER 0
-#define CONFIG_AMV_DECODER 0
-#define CONFIG_ANM_DECODER 0
-#define CONFIG_ANSI_DECODER 0
-#define CONFIG_ASV1_DECODER 0
-#define CONFIG_ASV2_DECODER 0
-#define CONFIG_AURA_DECODER 0
-#define CONFIG_AURA2_DECODER 0
-#define CONFIG_AVRP_DECODER 0
-#define CONFIG_AVRN_DECODER 0
-#define CONFIG_AVS_DECODER 0
-#define CONFIG_AVUI_DECODER 0
-#define CONFIG_AYUV_DECODER 0
-#define CONFIG_BETHSOFTVID_DECODER 0
-#define CONFIG_BFI_DECODER 0
-#define CONFIG_BINK_DECODER 0
-#define CONFIG_BMP_DECODER 0
-#define CONFIG_BMV_VIDEO_DECODER 0
-#define CONFIG_BRENDER_PIX_DECODER 0
-#define CONFIG_C93_DECODER 0
-#define CONFIG_CAVS_DECODER 0
-#define CONFIG_CDGRAPHICS_DECODER 0
-#define CONFIG_CDXL_DECODER 0
-#define CONFIG_CINEPAK_DECODER 0
-#define CONFIG_CLJR_DECODER 0
-#define CONFIG_CLLC_DECODER 0
-#define CONFIG_COMFORTNOISE_DECODER 0
-#define CONFIG_CPIA_DECODER 0
-#define CONFIG_CSCD_DECODER 0
-#define CONFIG_CYUV_DECODER 0
-#define CONFIG_DFA_DECODER 0
-#define CONFIG_DIRAC_DECODER 0
-#define CONFIG_DNXHD_DECODER 0
-#define CONFIG_DPX_DECODER 0
-#define CONFIG_DSICINVIDEO_DECODER 0
-#define CONFIG_DVVIDEO_DECODER 0
-#define CONFIG_DXA_DECODER 0
-#define CONFIG_DXTORY_DECODER 0
-#define CONFIG_EACMV_DECODER 0
-#define CONFIG_EAMAD_DECODER 0
-#define CONFIG_EATGQ_DECODER 0
-#define CONFIG_EATGV_DECODER 0
-#define CONFIG_EATQI_DECODER 0
-#define CONFIG_EIGHTBPS_DECODER 0
-#define CONFIG_EIGHTSVX_EXP_DECODER 0
-#define CONFIG_EIGHTSVX_FIB_DECODER 0
-#define CONFIG_ESCAPE124_DECODER 0
-#define CONFIG_ESCAPE130_DECODER 0
-#define CONFIG_EXR_DECODER 0
-#define CONFIG_FFV1_DECODER 0
-#define CONFIG_FFVHUFF_DECODER 0
-#define CONFIG_FLASHSV_DECODER 0
-#define CONFIG_FLASHSV2_DECODER 0
-#define CONFIG_FLIC_DECODER 0
-#define CONFIG_FLV_DECODER 0
-#define CONFIG_FOURXM_DECODER 0
-#define CONFIG_FRAPS_DECODER 0
-#define CONFIG_FRWU_DECODER 0
-#define CONFIG_G2M_DECODER 0
-#define CONFIG_GIF_DECODER 0
-#define CONFIG_H261_DECODER 0
-#define CONFIG_H263_DECODER 0
-#define CONFIG_H263I_DECODER 0
-#define CONFIG_H263P_DECODER 0
-#define CONFIG_H264_DECODER 1
-#define CONFIG_H264_CRYSTALHD_DECODER 0
-#define CONFIG_H264_VDA_DECODER 0
-#define CONFIG_H264_VDPAU_DECODER 0
-#define CONFIG_HEVC_DECODER 0
-#define CONFIG_HNM4_VIDEO_DECODER 0
-#define CONFIG_HUFFYUV_DECODER 0
-#define CONFIG_IDCIN_DECODER 0
-#define CONFIG_IFF_BYTERUN1_DECODER 0
-#define CONFIG_IFF_ILBM_DECODER 0
-#define CONFIG_INDEO2_DECODER 0
-#define CONFIG_INDEO3_DECODER 0
-#define CONFIG_INDEO4_DECODER 0
-#define CONFIG_INDEO5_DECODER 0
-#define CONFIG_INTERPLAY_VIDEO_DECODER 0
-#define CONFIG_JPEG2000_DECODER 0
-#define CONFIG_JPEGLS_DECODER 0
-#define CONFIG_JV_DECODER 0
-#define CONFIG_KGV1_DECODER 0
-#define CONFIG_KMVC_DECODER 0
-#define CONFIG_LAGARITH_DECODER 0
-#define CONFIG_LOCO_DECODER 0
-#define CONFIG_MDEC_DECODER 0
-#define CONFIG_MIMIC_DECODER 0
-#define CONFIG_MJPEG_DECODER 0
-#define CONFIG_MJPEGB_DECODER 0
-#define CONFIG_MMVIDEO_DECODER 0
-#define CONFIG_MOTIONPIXELS_DECODER 0
-#define CONFIG_MPEG_XVMC_DECODER 0
-#define CONFIG_MPEG1VIDEO_DECODER 0
-#define CONFIG_MPEG2VIDEO_DECODER 0
-#define CONFIG_MPEG4_DECODER 0
-#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
-#define CONFIG_MPEG4_VDPAU_DECODER 0
-#define CONFIG_MPEGVIDEO_DECODER 0
-#define CONFIG_MPEG_VDPAU_DECODER 0
-#define CONFIG_MPEG1_VDPAU_DECODER 0
-#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
-#define CONFIG_MSA1_DECODER 0
-#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
-#define CONFIG_MSMPEG4V1_DECODER 0
-#define CONFIG_MSMPEG4V2_DECODER 0
-#define CONFIG_MSMPEG4V3_DECODER 0
-#define CONFIG_MSRLE_DECODER 0
-#define CONFIG_MSS1_DECODER 0
-#define CONFIG_MSS2_DECODER 0
-#define CONFIG_MSVIDEO1_DECODER 0
-#define CONFIG_MSZH_DECODER 0
-#define CONFIG_MTS2_DECODER 0
-#define CONFIG_MVC1_DECODER 0
-#define CONFIG_MVC2_DECODER 0
-#define CONFIG_MXPEG_DECODER 0
-#define CONFIG_NUV_DECODER 0
-#define CONFIG_PAF_VIDEO_DECODER 0
-#define CONFIG_PAM_DECODER 0
-#define CONFIG_PBM_DECODER 0
-#define CONFIG_PCX_DECODER 0
-#define CONFIG_PGM_DECODER 0
-#define CONFIG_PGMYUV_DECODER 0
-#define CONFIG_PICTOR_DECODER 0
-#define CONFIG_PNG_DECODER 0
-#define CONFIG_PPM_DECODER 0
-#define CONFIG_PRORES_DECODER 0
-#define CONFIG_PRORES_LGPL_DECODER 0
-#define CONFIG_PTX_DECODER 0
-#define CONFIG_QDRAW_DECODER 0
-#define CONFIG_QPEG_DECODER 0
-#define CONFIG_QTRLE_DECODER 0
-#define CONFIG_R10K_DECODER 0
-#define CONFIG_R210_DECODER 0
-#define CONFIG_RAWVIDEO_DECODER 0
-#define CONFIG_RL2_DECODER 0
-#define CONFIG_ROQ_DECODER 0
-#define CONFIG_RPZA_DECODER 0
-#define CONFIG_RV10_DECODER 0
-#define CONFIG_RV20_DECODER 0
-#define CONFIG_RV30_DECODER 0
-#define CONFIG_RV40_DECODER 0
-#define CONFIG_S302M_DECODER 0
-#define CONFIG_SANM_DECODER 0
-#define CONFIG_SGI_DECODER 0
-#define CONFIG_SGIRLE_DECODER 0
-#define CONFIG_SMACKER_DECODER 0
-#define CONFIG_SMC_DECODER 0
-#define CONFIG_SMVJPEG_DECODER 0
-#define CONFIG_SNOW_DECODER 0
-#define CONFIG_SP5X_DECODER 0
-#define CONFIG_SUNRAST_DECODER 0
-#define CONFIG_SVQ1_DECODER 0
-#define CONFIG_SVQ3_DECODER 0
-#define CONFIG_TARGA_DECODER 0
-#define CONFIG_TARGA_Y216_DECODER 0
-#define CONFIG_THEORA_DECODER 1
-#define CONFIG_THP_DECODER 0
-#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
-#define CONFIG_TIFF_DECODER 0
-#define CONFIG_TMV_DECODER 0
-#define CONFIG_TRUEMOTION1_DECODER 0
-#define CONFIG_TRUEMOTION2_DECODER 0
-#define CONFIG_TSCC_DECODER 0
-#define CONFIG_TSCC2_DECODER 0
-#define CONFIG_TXD_DECODER 0
-#define CONFIG_ULTI_DECODER 0
-#define CONFIG_UTVIDEO_DECODER 0
-#define CONFIG_V210_DECODER 0
-#define CONFIG_V210X_DECODER 0
-#define CONFIG_V308_DECODER 0
-#define CONFIG_V408_DECODER 0
-#define CONFIG_V410_DECODER 0
-#define CONFIG_VB_DECODER 0
-#define CONFIG_VBLE_DECODER 0
-#define CONFIG_VC1_DECODER 0
-#define CONFIG_VC1_CRYSTALHD_DECODER 0
-#define CONFIG_VC1_VDPAU_DECODER 0
-#define CONFIG_VC1IMAGE_DECODER 0
-#define CONFIG_VCR1_DECODER 0
-#define CONFIG_VMDVIDEO_DECODER 0
-#define CONFIG_VMNC_DECODER 0
-#define CONFIG_VP3_DECODER 1
-#define CONFIG_VP5_DECODER 0
-#define CONFIG_VP6_DECODER 0
-#define CONFIG_VP6A_DECODER 0
-#define CONFIG_VP6F_DECODER 0
-#define CONFIG_VP8_DECODER 1
-#define CONFIG_VP9_DECODER 0
-#define CONFIG_VQA_DECODER 0
-#define CONFIG_WEBP_DECODER 0
-#define CONFIG_WMV1_DECODER 0
-#define CONFIG_WMV2_DECODER 0
-#define CONFIG_WMV3_DECODER 0
-#define CONFIG_WMV3_CRYSTALHD_DECODER 0
-#define CONFIG_WMV3_VDPAU_DECODER 0
-#define CONFIG_WMV3IMAGE_DECODER 0
-#define CONFIG_WNV1_DECODER 0
-#define CONFIG_XAN_WC3_DECODER 0
-#define CONFIG_XAN_WC4_DECODER 0
-#define CONFIG_XBM_DECODER 0
-#define CONFIG_XFACE_DECODER 0
-#define CONFIG_XL_DECODER 0
-#define CONFIG_XWD_DECODER 0
-#define CONFIG_Y41P_DECODER 0
-#define CONFIG_YOP_DECODER 0
-#define CONFIG_YUV4_DECODER 0
-#define CONFIG_ZERO12V_DECODER 0
-#define CONFIG_ZEROCODEC_DECODER 0
-#define CONFIG_ZLIB_DECODER 0
-#define CONFIG_ZMBV_DECODER 0
-#define CONFIG_AAC_DECODER 1
-#define CONFIG_AAC_LATM_DECODER 0
-#define CONFIG_AC3_DECODER 0
-#define CONFIG_ALAC_DECODER 0
-#define CONFIG_ALS_DECODER 0
-#define CONFIG_AMRNB_DECODER 0
-#define CONFIG_AMRWB_DECODER 0
-#define CONFIG_APE_DECODER 0
-#define CONFIG_ATRAC1_DECODER 0
-#define CONFIG_ATRAC3_DECODER 0
-#define CONFIG_BINKAUDIO_DCT_DECODER 0
-#define CONFIG_BINKAUDIO_RDFT_DECODER 0
-#define CONFIG_BMV_AUDIO_DECODER 0
-#define CONFIG_COOK_DECODER 0
-#define CONFIG_DCA_DECODER 0
-#define CONFIG_DSICINAUDIO_DECODER 0
-#define CONFIG_EAC3_DECODER 0
-#define CONFIG_EVRC_DECODER 0
-#define CONFIG_FFWAVESYNTH_DECODER 0
-#define CONFIG_FLAC_DECODER 0
-#define CONFIG_G723_1_DECODER 0
-#define CONFIG_G729_DECODER 0
-#define CONFIG_GSM_DECODER 0
-#define CONFIG_GSM_MS_DECODER 0
-#define CONFIG_IAC_DECODER 0
-#define CONFIG_IMC_DECODER 0
-#define CONFIG_MACE3_DECODER 0
-#define CONFIG_MACE6_DECODER 0
-#define CONFIG_METASOUND_DECODER 0
-#define CONFIG_MLP_DECODER 0
-#define CONFIG_MP1_DECODER 0
-#define CONFIG_MP1FLOAT_DECODER 0
-#define CONFIG_MP2_DECODER 0
-#define CONFIG_MP2FLOAT_DECODER 0
-#define CONFIG_MP3_DECODER 1
-#define CONFIG_MP3FLOAT_DECODER 0
-#define CONFIG_MP3ADU_DECODER 0
-#define CONFIG_MP3ADUFLOAT_DECODER 0
-#define CONFIG_MP3ON4_DECODER 0
-#define CONFIG_MP3ON4FLOAT_DECODER 0
-#define CONFIG_MPC7_DECODER 0
-#define CONFIG_MPC8_DECODER 0
-#define CONFIG_NELLYMOSER_DECODER 0
-#define CONFIG_PAF_AUDIO_DECODER 0
-#define CONFIG_QCELP_DECODER 0
-#define CONFIG_QDM2_DECODER 0
-#define CONFIG_RA_144_DECODER 0
-#define CONFIG_RA_288_DECODER 0
-#define CONFIG_RALF_DECODER 0
-#define CONFIG_SHORTEN_DECODER 0
-#define CONFIG_SIPR_DECODER 0
-#define CONFIG_SMACKAUD_DECODER 0
-#define CONFIG_SONIC_DECODER 0
-#define CONFIG_TAK_DECODER 0
-#define CONFIG_TRUEHD_DECODER 0
-#define CONFIG_TRUESPEECH_DECODER 0
-#define CONFIG_TTA_DECODER 0
-#define CONFIG_TWINVQ_DECODER 0
-#define CONFIG_VMDAUDIO_DECODER 0
-#define CONFIG_VORBIS_DECODER 1
-#define CONFIG_WAVPACK_DECODER 0
-#define CONFIG_WMALOSSLESS_DECODER 0
-#define CONFIG_WMAPRO_DECODER 0
-#define CONFIG_WMAV1_DECODER 0
-#define CONFIG_WMAV2_DECODER 0
-#define CONFIG_WMAVOICE_DECODER 0
-#define CONFIG_WS_SND1_DECODER 0
-#define CONFIG_PCM_ALAW_DECODER 1
-#define CONFIG_PCM_BLURAY_DECODER 0
-#define CONFIG_PCM_DVD_DECODER 0
-#define CONFIG_PCM_F32BE_DECODER 0
-#define CONFIG_PCM_F32LE_DECODER 1
-#define CONFIG_PCM_F64BE_DECODER 0
-#define CONFIG_PCM_F64LE_DECODER 0
-#define CONFIG_PCM_LXF_DECODER 0
-#define CONFIG_PCM_MULAW_DECODER 1
-#define CONFIG_PCM_S8_DECODER 0
-#define CONFIG_PCM_S8_PLANAR_DECODER 0
-#define CONFIG_PCM_S16BE_DECODER 1
-#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
-#define CONFIG_PCM_S16LE_DECODER 1
-#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
-#define CONFIG_PCM_S24BE_DECODER 1
-#define CONFIG_PCM_S24DAUD_DECODER 0
-#define CONFIG_PCM_S24LE_DECODER 1
-#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
-#define CONFIG_PCM_S32BE_DECODER 0
-#define CONFIG_PCM_S32LE_DECODER 0
-#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
-#define CONFIG_PCM_U8_DECODER 1
-#define CONFIG_PCM_U16BE_DECODER 0
-#define CONFIG_PCM_U16LE_DECODER 0
-#define CONFIG_PCM_U24BE_DECODER 0
-#define CONFIG_PCM_U24LE_DECODER 0
-#define CONFIG_PCM_U32BE_DECODER 0
-#define CONFIG_PCM_U32LE_DECODER 0
-#define CONFIG_PCM_ZORK_DECODER 0
-#define CONFIG_INTERPLAY_DPCM_DECODER 0
-#define CONFIG_ROQ_DPCM_DECODER 0
-#define CONFIG_SOL_DPCM_DECODER 0
-#define CONFIG_XAN_DPCM_DECODER 0
-#define CONFIG_ADPCM_4XM_DECODER 0
-#define CONFIG_ADPCM_ADX_DECODER 0
-#define CONFIG_ADPCM_AFC_DECODER 0
-#define CONFIG_ADPCM_CT_DECODER 0
-#define CONFIG_ADPCM_DTK_DECODER 0
-#define CONFIG_ADPCM_EA_DECODER 0
-#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
-#define CONFIG_ADPCM_EA_R1_DECODER 0
-#define CONFIG_ADPCM_EA_R2_DECODER 0
-#define CONFIG_ADPCM_EA_R3_DECODER 0
-#define CONFIG_ADPCM_EA_XAS_DECODER 0
-#define CONFIG_ADPCM_G722_DECODER 0
-#define CONFIG_ADPCM_G726_DECODER 0
-#define CONFIG_ADPCM_G726LE_DECODER 0
-#define CONFIG_ADPCM_IMA_AMV_DECODER 0
-#define CONFIG_ADPCM_IMA_APC_DECODER 0
-#define CONFIG_ADPCM_IMA_DK3_DECODER 0
-#define CONFIG_ADPCM_IMA_DK4_DECODER 0
-#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
-#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
-#define CONFIG_ADPCM_IMA_ISS_DECODER 0
-#define CONFIG_ADPCM_IMA_OKI_DECODER 0
-#define CONFIG_ADPCM_IMA_QT_DECODER 0
-#define CONFIG_ADPCM_IMA_RAD_DECODER 0
-#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
-#define CONFIG_ADPCM_IMA_WAV_DECODER 0
-#define CONFIG_ADPCM_IMA_WS_DECODER 0
-#define CONFIG_ADPCM_MS_DECODER 0
-#define CONFIG_ADPCM_SBPRO_2_DECODER 0
-#define CONFIG_ADPCM_SBPRO_3_DECODER 0
-#define CONFIG_ADPCM_SBPRO_4_DECODER 0
-#define CONFIG_ADPCM_SWF_DECODER 0
-#define CONFIG_ADPCM_THP_DECODER 0
-#define CONFIG_ADPCM_XA_DECODER 0
-#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
-#define CONFIG_SSA_DECODER 0
-#define CONFIG_ASS_DECODER 0
-#define CONFIG_DVBSUB_DECODER 0
-#define CONFIG_DVDSUB_DECODER 0
-#define CONFIG_JACOSUB_DECODER 0
-#define CONFIG_MICRODVD_DECODER 0
-#define CONFIG_MOVTEXT_DECODER 0
-#define CONFIG_MPL2_DECODER 0
-#define CONFIG_PGSSUB_DECODER 0
-#define CONFIG_PJS_DECODER 0
-#define CONFIG_REALTEXT_DECODER 0
-#define CONFIG_SAMI_DECODER 0
-#define CONFIG_SRT_DECODER 0
-#define CONFIG_SUBRIP_DECODER 0
-#define CONFIG_SUBVIEWER_DECODER 0
-#define CONFIG_SUBVIEWER1_DECODER 0
-#define CONFIG_TEXT_DECODER 0
-#define CONFIG_VPLAYER_DECODER 0
-#define CONFIG_WEBVTT_DECODER 0
-#define CONFIG_XSUB_DECODER 0
-#define CONFIG_LIBCELT_DECODER 0
-#define CONFIG_LIBFDK_AAC_DECODER 0
-#define CONFIG_LIBGSM_DECODER 0
-#define CONFIG_LIBGSM_MS_DECODER 0
-#define CONFIG_LIBILBC_DECODER 0
-#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
-#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
-#define CONFIG_LIBOPENJPEG_DECODER 0
-#define CONFIG_LIBOPUS_DECODER 0
-#define CONFIG_LIBSCHROEDINGER_DECODER 0
-#define CONFIG_LIBSPEEX_DECODER 0
-#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
-#define CONFIG_LIBUTVIDEO_DECODER 0
-#define CONFIG_LIBVORBIS_DECODER 0
-#define CONFIG_LIBVPX_VP8_DECODER 0
-#define CONFIG_LIBVPX_VP9_DECODER 0
-#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
-#define CONFIG_BINTEXT_DECODER 0
-#define CONFIG_XBIN_DECODER 0
-#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
-#define CONFIG_AC3_DEMUXER 0
-#define CONFIG_ACT_DEMUXER 0
-#define CONFIG_ADF_DEMUXER 0
-#define CONFIG_ADP_DEMUXER 0
-#define CONFIG_ADX_DEMUXER 0
-#define CONFIG_AEA_DEMUXER 0
-#define CONFIG_AFC_DEMUXER 0
-#define CONFIG_AIFF_DEMUXER 0
-#define CONFIG_AMR_DEMUXER 0
-#define CONFIG_ANM_DEMUXER 0
-#define CONFIG_APC_DEMUXER 0
-#define CONFIG_APE_DEMUXER 0
-#define CONFIG_AQTITLE_DEMUXER 0
-#define CONFIG_ASF_DEMUXER 0
-#define CONFIG_ASS_DEMUXER 0
-#define CONFIG_AST_DEMUXER 0
-#define CONFIG_AU_DEMUXER 0
-#define CONFIG_AVI_DEMUXER 0
-#define CONFIG_AVISYNTH_DEMUXER 0
-#define CONFIG_AVR_DEMUXER 0
-#define CONFIG_AVS_DEMUXER 0
-#define CONFIG_BETHSOFTVID_DEMUXER 0
-#define CONFIG_BFI_DEMUXER 0
-#define CONFIG_BINTEXT_DEMUXER 0
-#define CONFIG_BINK_DEMUXER 0
-#define CONFIG_BIT_DEMUXER 0
-#define CONFIG_BMV_DEMUXER 0
-#define CONFIG_BRSTM_DEMUXER 0
-#define CONFIG_BOA_DEMUXER 0
-#define CONFIG_C93_DEMUXER 0
-#define CONFIG_CAF_DEMUXER 0
-#define CONFIG_CAVSVIDEO_DEMUXER 0
-#define CONFIG_CDG_DEMUXER 0
-#define CONFIG_CDXL_DEMUXER 0
-#define CONFIG_CONCAT_DEMUXER 0
-#define CONFIG_DATA_DEMUXER 0
-#define CONFIG_DAUD_DEMUXER 0
-#define CONFIG_DFA_DEMUXER 0
-#define CONFIG_DIRAC_DEMUXER 0
-#define CONFIG_DNXHD_DEMUXER 0
-#define CONFIG_DSICIN_DEMUXER 0
-#define CONFIG_DTS_DEMUXER 0
-#define CONFIG_DTSHD_DEMUXER 0
-#define CONFIG_DV_DEMUXER 0
-#define CONFIG_DXA_DEMUXER 0
-#define CONFIG_EA_DEMUXER 0
-#define CONFIG_EA_CDATA_DEMUXER 0
-#define CONFIG_EAC3_DEMUXER 0
-#define CONFIG_EPAF_DEMUXER 0
-#define CONFIG_FFM_DEMUXER 0
-#define CONFIG_FFMETADATA_DEMUXER 0
-#define CONFIG_FILMSTRIP_DEMUXER 0
-#define CONFIG_FLAC_DEMUXER 0
-#define CONFIG_FLIC_DEMUXER 0
-#define CONFIG_FLV_DEMUXER 0
-#define CONFIG_FOURXM_DEMUXER 0
-#define CONFIG_FRM_DEMUXER 0
-#define CONFIG_G722_DEMUXER 0
-#define CONFIG_G723_1_DEMUXER 0
-#define CONFIG_G729_DEMUXER 0
-#define CONFIG_GIF_DEMUXER 0
-#define CONFIG_GSM_DEMUXER 0
-#define CONFIG_GXF_DEMUXER 0
-#define CONFIG_H261_DEMUXER 0
-#define CONFIG_H263_DEMUXER 0
-#define CONFIG_H264_DEMUXER 0
-#define CONFIG_HEVC_DEMUXER 0
-#define CONFIG_HLS_DEMUXER 0
-#define CONFIG_HNM_DEMUXER 0
-#define CONFIG_ICO_DEMUXER 0
-#define CONFIG_IDCIN_DEMUXER 0
-#define CONFIG_IDF_DEMUXER 0
-#define CONFIG_IFF_DEMUXER 0
-#define CONFIG_ILBC_DEMUXER 0
-#define CONFIG_IMAGE2_DEMUXER 0
-#define CONFIG_IMAGE2PIPE_DEMUXER 0
-#define CONFIG_INGENIENT_DEMUXER 0
-#define CONFIG_IPMOVIE_DEMUXER 0
-#define CONFIG_IRCAM_DEMUXER 0
-#define CONFIG_ISS_DEMUXER 0
-#define CONFIG_IV8_DEMUXER 0
-#define CONFIG_IVF_DEMUXER 0
-#define CONFIG_JACOSUB_DEMUXER 0
-#define CONFIG_JV_DEMUXER 0
-#define CONFIG_LATM_DEMUXER 0
-#define CONFIG_LMLM4_DEMUXER 0
-#define CONFIG_LOAS_DEMUXER 0
-#define CONFIG_LVF_DEMUXER 0
-#define CONFIG_LXF_DEMUXER 0
-#define CONFIG_M4V_DEMUXER 0
-#define CONFIG_MATROSKA_DEMUXER 1
-#define CONFIG_MGSTS_DEMUXER 0
-#define CONFIG_MICRODVD_DEMUXER 0
-#define CONFIG_MJPEG_DEMUXER 0
-#define CONFIG_MLP_DEMUXER 0
-#define CONFIG_MM_DEMUXER 0
-#define CONFIG_MMF_DEMUXER 0
-#define CONFIG_MOV_DEMUXER 1
-#define CONFIG_MP3_DEMUXER 1
-#define CONFIG_MPC_DEMUXER 0
-#define CONFIG_MPC8_DEMUXER 0
-#define CONFIG_MPEGPS_DEMUXER 0
-#define CONFIG_MPEGTS_DEMUXER 0
-#define CONFIG_MPEGTSRAW_DEMUXER 0
-#define CONFIG_MPEGVIDEO_DEMUXER 0
-#define CONFIG_MPL2_DEMUXER 0
-#define CONFIG_MPSUB_DEMUXER 0
-#define CONFIG_MSNWC_TCP_DEMUXER 0
-#define CONFIG_MTV_DEMUXER 0
-#define CONFIG_MV_DEMUXER 0
-#define CONFIG_MVI_DEMUXER 0
-#define CONFIG_MXF_DEMUXER 0
-#define CONFIG_MXG_DEMUXER 0
-#define CONFIG_NC_DEMUXER 0
-#define CONFIG_NISTSPHERE_DEMUXER 0
-#define CONFIG_NSV_DEMUXER 0
-#define CONFIG_NUT_DEMUXER 0
-#define CONFIG_NUV_DEMUXER 0
-#define CONFIG_OGG_DEMUXER 1
-#define CONFIG_OMA_DEMUXER 0
-#define CONFIG_PAF_DEMUXER 0
-#define CONFIG_PCM_ALAW_DEMUXER 0
-#define CONFIG_PCM_MULAW_DEMUXER 0
-#define CONFIG_PCM_F64BE_DEMUXER 0
-#define CONFIG_PCM_F64LE_DEMUXER 0
-#define CONFIG_PCM_F32BE_DEMUXER 0
-#define CONFIG_PCM_F32LE_DEMUXER 0
-#define CONFIG_PCM_S32BE_DEMUXER 0
-#define CONFIG_PCM_S32LE_DEMUXER 0
-#define CONFIG_PCM_S24BE_DEMUXER 0
-#define CONFIG_PCM_S24LE_DEMUXER 0
-#define CONFIG_PCM_S16BE_DEMUXER 0
-#define CONFIG_PCM_S16LE_DEMUXER 0
-#define CONFIG_PCM_S8_DEMUXER 0
-#define CONFIG_PCM_U32BE_DEMUXER 0
-#define CONFIG_PCM_U32LE_DEMUXER 0
-#define CONFIG_PCM_U24BE_DEMUXER 0
-#define CONFIG_PCM_U24LE_DEMUXER 0
-#define CONFIG_PCM_U16BE_DEMUXER 0
-#define CONFIG_PCM_U16LE_DEMUXER 0
-#define CONFIG_PCM_U8_DEMUXER 0
-#define CONFIG_PJS_DEMUXER 0
-#define CONFIG_PMP_DEMUXER 0
-#define CONFIG_PVA_DEMUXER 0
-#define CONFIG_PVF_DEMUXER 0
-#define CONFIG_QCP_DEMUXER 0
-#define CONFIG_R3D_DEMUXER 0
-#define CONFIG_RAWVIDEO_DEMUXER 0
-#define CONFIG_REALTEXT_DEMUXER 0
-#define CONFIG_REDSPARK_DEMUXER 0
-#define CONFIG_RL2_DEMUXER 0
-#define CONFIG_RM_DEMUXER 0
-#define CONFIG_ROQ_DEMUXER 0
-#define CONFIG_RPL_DEMUXER 0
-#define CONFIG_RSD_DEMUXER 0
-#define CONFIG_RSO_DEMUXER 0
-#define CONFIG_RTP_DEMUXER 0
-#define CONFIG_RTSP_DEMUXER 0
-#define CONFIG_SAMI_DEMUXER 0
-#define CONFIG_SAP_DEMUXER 0
-#define CONFIG_SBG_DEMUXER 0
-#define CONFIG_SDP_DEMUXER 0
-#define CONFIG_SEGAFILM_DEMUXER 0
-#define CONFIG_SHORTEN_DEMUXER 0
-#define CONFIG_SIFF_DEMUXER 0
-#define CONFIG_SMACKER_DEMUXER 0
-#define CONFIG_SMJPEG_DEMUXER 0
-#define CONFIG_SMUSH_DEMUXER 0
-#define CONFIG_SOL_DEMUXER 0
-#define CONFIG_SOX_DEMUXER 0
-#define CONFIG_SPDIF_DEMUXER 0
-#define CONFIG_SRT_DEMUXER 0
-#define CONFIG_STR_DEMUXER 0
-#define CONFIG_SUBVIEWER1_DEMUXER 0
-#define CONFIG_SUBVIEWER_DEMUXER 0
-#define CONFIG_SWF_DEMUXER 0
-#define CONFIG_TAK_DEMUXER 0
-#define CONFIG_TEDCAPTIONS_DEMUXER 0
-#define CONFIG_THP_DEMUXER 0
-#define CONFIG_TIERTEXSEQ_DEMUXER 0
-#define CONFIG_TMV_DEMUXER 0
-#define CONFIG_TRUEHD_DEMUXER 0
-#define CONFIG_TTA_DEMUXER 0
-#define CONFIG_TXD_DEMUXER 0
-#define CONFIG_TTY_DEMUXER 0
-#define CONFIG_VC1_DEMUXER 0
-#define CONFIG_VC1T_DEMUXER 0
-#define CONFIG_VIVO_DEMUXER 0
-#define CONFIG_VMD_DEMUXER 0
-#define CONFIG_VOBSUB_DEMUXER 0
-#define CONFIG_VOC_DEMUXER 0
-#define CONFIG_VPLAYER_DEMUXER 0
-#define CONFIG_VQF_DEMUXER 0
-#define CONFIG_W64_DEMUXER 0
-#define CONFIG_WAV_DEMUXER 1
-#define CONFIG_WC3_DEMUXER 0
-#define CONFIG_WEBVTT_DEMUXER 0
-#define CONFIG_WSAUD_DEMUXER 0
-#define CONFIG_WSVQA_DEMUXER 0
-#define CONFIG_WTV_DEMUXER 0
-#define CONFIG_WV_DEMUXER 0
-#define CONFIG_XA_DEMUXER 0
-#define CONFIG_XBIN_DEMUXER 0
-#define CONFIG_XMV_DEMUXER 0
-#define CONFIG_XWMA_DEMUXER 0
-#define CONFIG_YOP_DEMUXER 0
-#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
-#define CONFIG_LIBGME_DEMUXER 0
-#define CONFIG_LIBMODPLUG_DEMUXER 0
-#define CONFIG_LIBNUT_DEMUXER 0
-#define CONFIG_LIBQUVI_DEMUXER 0
-#define CONFIG_A64MULTI_ENCODER 0
-#define CONFIG_A64MULTI5_ENCODER 0
-#define CONFIG_AMV_ENCODER 0
-#define CONFIG_ASV1_ENCODER 0
-#define CONFIG_ASV2_ENCODER 0
-#define CONFIG_AVRP_ENCODER 0
-#define CONFIG_AVUI_ENCODER 0
-#define CONFIG_AYUV_ENCODER 0
-#define CONFIG_BMP_ENCODER 0
-#define CONFIG_CLJR_ENCODER 0
-#define CONFIG_COMFORTNOISE_ENCODER 0
-#define CONFIG_DNXHD_ENCODER 0
-#define CONFIG_DPX_ENCODER 0
-#define CONFIG_DVVIDEO_ENCODER 0
-#define CONFIG_FFV1_ENCODER 0
-#define CONFIG_FFVHUFF_ENCODER 0
-#define CONFIG_FLASHSV_ENCODER 0
-#define CONFIG_FLASHSV2_ENCODER 0
-#define CONFIG_FLV_ENCODER 0
-#define CONFIG_GIF_ENCODER 0
-#define CONFIG_H261_ENCODER 0
-#define CONFIG_H263_ENCODER 0
-#define CONFIG_H263P_ENCODER 0
-#define CONFIG_HUFFYUV_ENCODER 0
-#define CONFIG_JPEG2000_ENCODER 0
-#define CONFIG_JPEGLS_ENCODER 0
-#define CONFIG_LJPEG_ENCODER 0
-#define CONFIG_MJPEG_ENCODER 0
-#define CONFIG_MPEG1VIDEO_ENCODER 0
-#define CONFIG_MPEG2VIDEO_ENCODER 0
-#define CONFIG_MPEG4_ENCODER 0
-#define CONFIG_MSMPEG4V2_ENCODER 0
-#define CONFIG_MSMPEG4V3_ENCODER 0
-#define CONFIG_MSVIDEO1_ENCODER 0
-#define CONFIG_PAM_ENCODER 0
-#define CONFIG_PBM_ENCODER 0
-#define CONFIG_PCX_ENCODER 0
-#define CONFIG_PGM_ENCODER 0
-#define CONFIG_PGMYUV_ENCODER 0
-#define CONFIG_PNG_ENCODER 0
-#define CONFIG_PPM_ENCODER 0
-#define CONFIG_PRORES_ENCODER 0
-#define CONFIG_PRORES_AW_ENCODER 0
-#define CONFIG_PRORES_KS_ENCODER 0
-#define CONFIG_QTRLE_ENCODER 0
-#define CONFIG_R10K_ENCODER 0
-#define CONFIG_R210_ENCODER 0
-#define CONFIG_RAWVIDEO_ENCODER 0
-#define CONFIG_ROQ_ENCODER 0
-#define CONFIG_RV10_ENCODER 0
-#define CONFIG_RV20_ENCODER 0
-#define CONFIG_S302M_ENCODER 0
-#define CONFIG_SGI_ENCODER 0
-#define CONFIG_SNOW_ENCODER 0
-#define CONFIG_SUNRAST_ENCODER 0
-#define CONFIG_SVQ1_ENCODER 0
-#define CONFIG_TARGA_ENCODER 0
-#define CONFIG_TIFF_ENCODER 0
-#define CONFIG_UTVIDEO_ENCODER 0
-#define CONFIG_V210_ENCODER 0
-#define CONFIG_V308_ENCODER 0
-#define CONFIG_V408_ENCODER 0
-#define CONFIG_V410_ENCODER 0
-#define CONFIG_WMV1_ENCODER 0
-#define CONFIG_WMV2_ENCODER 0
-#define CONFIG_XBM_ENCODER 0
-#define CONFIG_XFACE_ENCODER 0
-#define CONFIG_XWD_ENCODER 0
-#define CONFIG_Y41P_ENCODER 0
-#define CONFIG_YUV4_ENCODER 0
-#define CONFIG_ZLIB_ENCODER 0
-#define CONFIG_ZMBV_ENCODER 0
-#define CONFIG_AAC_ENCODER 0
-#define CONFIG_AC3_ENCODER 0
-#define CONFIG_AC3_FIXED_ENCODER 0
-#define CONFIG_ALAC_ENCODER 0
-#define CONFIG_DCA_ENCODER 0
-#define CONFIG_EAC3_ENCODER 0
-#define CONFIG_FLAC_ENCODER 0
-#define CONFIG_G723_1_ENCODER 0
-#define CONFIG_MP2_ENCODER 0
-#define CONFIG_MP2FIXED_ENCODER 0
-#define CONFIG_NELLYMOSER_ENCODER 0
-#define CONFIG_RA_144_ENCODER 0
-#define CONFIG_SONIC_ENCODER 0
-#define CONFIG_SONIC_LS_ENCODER 0
-#define CONFIG_TTA_ENCODER 0
-#define CONFIG_VORBIS_ENCODER 0
-#define CONFIG_WAVPACK_ENCODER 0
-#define CONFIG_WMAV1_ENCODER 0
-#define CONFIG_WMAV2_ENCODER 0
-#define CONFIG_PCM_ALAW_ENCODER 0
-#define CONFIG_PCM_F32BE_ENCODER 0
-#define CONFIG_PCM_F32LE_ENCODER 0
-#define CONFIG_PCM_F64BE_ENCODER 0
-#define CONFIG_PCM_F64LE_ENCODER 0
-#define CONFIG_PCM_MULAW_ENCODER 0
-#define CONFIG_PCM_S8_ENCODER 0
-#define CONFIG_PCM_S8_PLANAR_ENCODER 0
-#define CONFIG_PCM_S16BE_ENCODER 0
-#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
-#define CONFIG_PCM_S16LE_ENCODER 0
-#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
-#define CONFIG_PCM_S24BE_ENCODER 0
-#define CONFIG_PCM_S24DAUD_ENCODER 0
-#define CONFIG_PCM_S24LE_ENCODER 0
-#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
-#define CONFIG_PCM_S32BE_ENCODER 0
-#define CONFIG_PCM_S32LE_ENCODER 0
-#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
-#define CONFIG_PCM_U8_ENCODER 0
-#define CONFIG_PCM_U16BE_ENCODER 0
-#define CONFIG_PCM_U16LE_ENCODER 0
-#define CONFIG_PCM_U24BE_ENCODER 0
-#define CONFIG_PCM_U24LE_ENCODER 0
-#define CONFIG_PCM_U32BE_ENCODER 0
-#define CONFIG_PCM_U32LE_ENCODER 0
-#define CONFIG_ROQ_DPCM_ENCODER 0
-#define CONFIG_ADPCM_ADX_ENCODER 0
-#define CONFIG_ADPCM_G722_ENCODER 0
-#define CONFIG_ADPCM_G726_ENCODER 0
-#define CONFIG_ADPCM_IMA_QT_ENCODER 0
-#define CONFIG_ADPCM_IMA_WAV_ENCODER 0
-#define CONFIG_ADPCM_MS_ENCODER 0
-#define CONFIG_ADPCM_SWF_ENCODER 0
-#define CONFIG_ADPCM_YAMAHA_ENCODER 0
-#define CONFIG_SSA_ENCODER 0
-#define CONFIG_ASS_ENCODER 0
-#define CONFIG_DVBSUB_ENCODER 0
-#define CONFIG_DVDSUB_ENCODER 0
-#define CONFIG_MOVTEXT_ENCODER 0
-#define CONFIG_SRT_ENCODER 0
-#define CONFIG_SUBRIP_ENCODER 0
-#define CONFIG_XSUB_ENCODER 0
-#define CONFIG_LIBFAAC_ENCODER 0
-#define CONFIG_LIBFDK_AAC_ENCODER 0
-#define CONFIG_LIBGSM_ENCODER 0
-#define CONFIG_LIBGSM_MS_ENCODER 0
-#define CONFIG_LIBILBC_ENCODER 0
-#define CONFIG_LIBMP3LAME_ENCODER 0
-#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
-#define CONFIG_LIBOPENJPEG_ENCODER 0
-#define CONFIG_LIBOPUS_ENCODER 0
-#define CONFIG_LIBSCHROEDINGER_ENCODER 0
-#define CONFIG_LIBSHINE_ENCODER 0
-#define CONFIG_LIBSPEEX_ENCODER 0
-#define CONFIG_LIBTHEORA_ENCODER 0
-#define CONFIG_LIBTWOLAME_ENCODER 0
-#define CONFIG_LIBUTVIDEO_ENCODER 0
-#define CONFIG_LIBVO_AACENC_ENCODER 0
-#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
-#define CONFIG_LIBVORBIS_ENCODER 0
-#define CONFIG_LIBVPX_VP8_ENCODER 0
-#define CONFIG_LIBVPX_VP9_ENCODER 0
-#define CONFIG_LIBWAVPACK_ENCODER 0
-#define CONFIG_LIBX264_ENCODER 0
-#define CONFIG_LIBX264RGB_ENCODER 0
-#define CONFIG_LIBXAVS_ENCODER 0
-#define CONFIG_LIBXVID_ENCODER 0
-#define CONFIG_LIBAACPLUS_ENCODER 0
-#define CONFIG_ACONVERT_FILTER 0
-#define CONFIG_ADELAY_FILTER 0
-#define CONFIG_AECHO_FILTER 0
-#define CONFIG_AEVAL_FILTER 0
-#define CONFIG_AFADE_FILTER 0
-#define CONFIG_AFORMAT_FILTER 0
-#define CONFIG_AINTERLEAVE_FILTER 0
-#define CONFIG_ALLPASS_FILTER 0
-#define CONFIG_AMERGE_FILTER 0
-#define CONFIG_AMIX_FILTER 0
-#define CONFIG_ANULL_FILTER 0
-#define CONFIG_APAD_FILTER 0
-#define CONFIG_APERMS_FILTER 0
-#define CONFIG_APHASER_FILTER 0
-#define CONFIG_ARESAMPLE_FILTER 0
-#define CONFIG_ASELECT_FILTER 0
-#define CONFIG_ASENDCMD_FILTER 0
-#define CONFIG_ASETNSAMPLES_FILTER 0
-#define CONFIG_ASETPTS_FILTER 0
-#define CONFIG_ASETRATE_FILTER 0
-#define CONFIG_ASETTB_FILTER 0
-#define CONFIG_ASHOWINFO_FILTER 0
-#define CONFIG_ASPLIT_FILTER 0
-#define CONFIG_ASTATS_FILTER 0
-#define CONFIG_ASTREAMSYNC_FILTER 0
-#define CONFIG_ASYNCTS_FILTER 0
-#define CONFIG_ATEMPO_FILTER 0
-#define CONFIG_ATRIM_FILTER 0
-#define CONFIG_AZMQ_FILTER 0
-#define CONFIG_BANDPASS_FILTER 0
-#define CONFIG_BANDREJECT_FILTER 0
-#define CONFIG_BASS_FILTER 0
-#define CONFIG_BIQUAD_FILTER 0
-#define CONFIG_CHANNELMAP_FILTER 0
-#define CONFIG_CHANNELSPLIT_FILTER 0
-#define CONFIG_COMPAND_FILTER 0
-#define CONFIG_EARWAX_FILTER 0
-#define CONFIG_EBUR128_FILTER 0
-#define CONFIG_EQUALIZER_FILTER 0
-#define CONFIG_HIGHPASS_FILTER 0
-#define CONFIG_JOIN_FILTER 0
-#define CONFIG_LADSPA_FILTER 0
-#define CONFIG_LOWPASS_FILTER 0
-#define CONFIG_PAN_FILTER 0
-#define CONFIG_REPLAYGAIN_FILTER 0
-#define CONFIG_RESAMPLE_FILTER 0
-#define CONFIG_SILENCEDETECT_FILTER 0
-#define CONFIG_TREBLE_FILTER 0
-#define CONFIG_VOLUME_FILTER 0
-#define CONFIG_VOLUMEDETECT_FILTER 0
-#define CONFIG_AEVALSRC_FILTER 0
-#define CONFIG_ANULLSRC_FILTER 0
-#define CONFIG_FLITE_FILTER 0
-#define CONFIG_SINE_FILTER 0
-#define CONFIG_ANULLSINK_FILTER 0
-#define CONFIG_ALPHAEXTRACT_FILTER 0
-#define CONFIG_ALPHAMERGE_FILTER 0
-#define CONFIG_ASS_FILTER 0
-#define CONFIG_BBOX_FILTER 0
-#define CONFIG_BLACKDETECT_FILTER 0
-#define CONFIG_BLACKFRAME_FILTER 0
-#define CONFIG_BLEND_FILTER 0
-#define CONFIG_BOXBLUR_FILTER 0
-#define CONFIG_COLORBALANCE_FILTER 0
-#define CONFIG_COLORCHANNELMIXER_FILTER 0
-#define CONFIG_COLORMATRIX_FILTER 0
-#define CONFIG_COPY_FILTER 0
-#define CONFIG_CROP_FILTER 0
-#define CONFIG_CROPDETECT_FILTER 0
-#define CONFIG_CURVES_FILTER 0
-#define CONFIG_DCTDNOIZ_FILTER 0
-#define CONFIG_DECIMATE_FILTER 0
-#define CONFIG_DELOGO_FILTER 0
-#define CONFIG_DESHAKE_FILTER 0
-#define CONFIG_DRAWBOX_FILTER 0
-#define CONFIG_DRAWGRID_FILTER 0
-#define CONFIG_DRAWTEXT_FILTER 0
-#define CONFIG_EDGEDETECT_FILTER 0
-#define CONFIG_ELBG_FILTER 0
-#define CONFIG_EXTRACTPLANES_FILTER 0
-#define CONFIG_FADE_FILTER 0
-#define CONFIG_FIELD_FILTER 0
-#define CONFIG_FIELDMATCH_FILTER 0
-#define CONFIG_FIELDORDER_FILTER 0
-#define CONFIG_FORMAT_FILTER 0
-#define CONFIG_FPS_FILTER 0
-#define CONFIG_FRAMESTEP_FILTER 0
-#define CONFIG_FREI0R_FILTER 0
-#define CONFIG_GEQ_FILTER 0
-#define CONFIG_GRADFUN_FILTER 0
-#define CONFIG_HALDCLUT_FILTER 0
-#define CONFIG_HFLIP_FILTER 0
-#define CONFIG_HISTEQ_FILTER 0
-#define CONFIG_HISTOGRAM_FILTER 0
-#define CONFIG_HQDN3D_FILTER 0
-#define CONFIG_HUE_FILTER 0
-#define CONFIG_IDET_FILTER 0
-#define CONFIG_IL_FILTER 0
-#define CONFIG_INTERLACE_FILTER 0
-#define CONFIG_INTERLEAVE_FILTER 0
-#define CONFIG_KERNDEINT_FILTER 0
-#define CONFIG_LUT3D_FILTER 0
-#define CONFIG_LUT_FILTER 0
-#define CONFIG_LUTRGB_FILTER 0
-#define CONFIG_LUTYUV_FILTER 0
-#define CONFIG_MCDEINT_FILTER 0
-#define CONFIG_MERGEPLANES_FILTER 0
-#define CONFIG_MP_FILTER 0
-#define CONFIG_MPDECIMATE_FILTER 0
-#define CONFIG_NEGATE_FILTER 0
-#define CONFIG_NOFORMAT_FILTER 0
-#define CONFIG_NOISE_FILTER 0
-#define CONFIG_NULL_FILTER 0
-#define CONFIG_OCV_FILTER 0
-#define CONFIG_OVERLAY_FILTER 0
-#define CONFIG_OWDENOISE_FILTER 0
-#define CONFIG_PAD_FILTER 0
-#define CONFIG_PERMS_FILTER 0
-#define CONFIG_PERSPECTIVE_FILTER 0
-#define CONFIG_PHASE_FILTER 0
-#define CONFIG_PIXDESCTEST_FILTER 0
-#define CONFIG_PP_FILTER 0
-#define CONFIG_PSNR_FILTER 0
-#define CONFIG_PULLUP_FILTER 0
-#define CONFIG_REMOVELOGO_FILTER 0
-#define CONFIG_ROTATE_FILTER 0
-#define CONFIG_SAB_FILTER 0
-#define CONFIG_SCALE_FILTER 0
-#define CONFIG_SELECT_FILTER 0
-#define CONFIG_SENDCMD_FILTER 0
-#define CONFIG_SEPARATEFIELDS_FILTER 0
-#define CONFIG_SETDAR_FILTER 0
-#define CONFIG_SETFIELD_FILTER 0
-#define CONFIG_SETPTS_FILTER 0
-#define CONFIG_SETSAR_FILTER 0
-#define CONFIG_SETTB_FILTER 0
-#define CONFIG_SHOWINFO_FILTER 0
-#define CONFIG_SMARTBLUR_FILTER 0
-#define CONFIG_SPLIT_FILTER 0
-#define CONFIG_SPP_FILTER 0
-#define CONFIG_STEREO3D_FILTER 0
-#define CONFIG_SUBTITLES_FILTER 0
-#define CONFIG_SUPER2XSAI_FILTER 0
-#define CONFIG_SWAPUV_FILTER 0
-#define CONFIG_TELECINE_FILTER 0
-#define CONFIG_THUMBNAIL_FILTER 0
-#define CONFIG_TILE_FILTER 0
-#define CONFIG_TINTERLACE_FILTER 0
-#define CONFIG_TRANSPOSE_FILTER 0
-#define CONFIG_TRIM_FILTER 0
-#define CONFIG_UNSHARP_FILTER 0
-#define CONFIG_VFLIP_FILTER 0
-#define CONFIG_VIDSTABDETECT_FILTER 0
-#define CONFIG_VIDSTABTRANSFORM_FILTER 0
-#define CONFIG_VIGNETTE_FILTER 0
-#define CONFIG_W3FDIF_FILTER 0
-#define CONFIG_YADIF_FILTER 0
-#define CONFIG_ZMQ_FILTER 0
-#define CONFIG_CELLAUTO_FILTER 0
-#define CONFIG_COLOR_FILTER 0
-#define CONFIG_FREI0R_SRC_FILTER 0
-#define CONFIG_HALDCLUTSRC_FILTER 0
-#define CONFIG_LIFE_FILTER 0
-#define CONFIG_MANDELBROT_FILTER 0
-#define CONFIG_MPTESTSRC_FILTER 0
-#define CONFIG_NULLSRC_FILTER 0
-#define CONFIG_RGBTESTSRC_FILTER 0
-#define CONFIG_SMPTEBARS_FILTER 0
-#define CONFIG_SMPTEHDBARS_FILTER 0
-#define CONFIG_TESTSRC_FILTER 0
-#define CONFIG_NULLSINK_FILTER 0
-#define CONFIG_AVECTORSCOPE_FILTER 0
-#define CONFIG_CONCAT_FILTER 0
-#define CONFIG_SHOWSPECTRUM_FILTER 0
-#define CONFIG_SHOWWAVES_FILTER 0
-#define CONFIG_AMOVIE_FILTER 0
-#define CONFIG_MOVIE_FILTER 0
-#define CONFIG_H263_VAAPI_HWACCEL 0
-#define CONFIG_H263_VDPAU_HWACCEL 0
-#define CONFIG_H264_DXVA2_HWACCEL 0
-#define CONFIG_H264_VAAPI_HWACCEL 0
-#define CONFIG_H264_VDA_HWACCEL 0
-#define CONFIG_H264_VDPAU_HWACCEL 0
-#define CONFIG_MPEG1_VDPAU_HWACCEL 0
-#define CONFIG_MPEG2_DXVA2_HWACCEL 0
-#define CONFIG_MPEG2_VAAPI_HWACCEL 0
-#define CONFIG_MPEG2_VDPAU_HWACCEL 0
-#define CONFIG_MPEG4_VAAPI_HWACCEL 0
-#define CONFIG_MPEG4_VDPAU_HWACCEL 0
-#define CONFIG_VC1_DXVA2_HWACCEL 0
-#define CONFIG_VC1_VAAPI_HWACCEL 0
-#define CONFIG_VC1_VDPAU_HWACCEL 0
-#define CONFIG_WMV3_DXVA2_HWACCEL 0
-#define CONFIG_WMV3_VAAPI_HWACCEL 0
-#define CONFIG_WMV3_VDPAU_HWACCEL 0
-#define CONFIG_ALSA_INDEV 0
-#define CONFIG_BKTR_INDEV 0
-#define CONFIG_DSHOW_INDEV 0
-#define CONFIG_DV1394_INDEV 0
-#define CONFIG_FBDEV_INDEV 0
-#define CONFIG_IEC61883_INDEV 0
-#define CONFIG_JACK_INDEV 0
-#define CONFIG_LAVFI_INDEV 0
-#define CONFIG_OPENAL_INDEV 0
-#define CONFIG_OSS_INDEV 0
-#define CONFIG_PULSE_INDEV 0
-#define CONFIG_SNDIO_INDEV 0
-#define CONFIG_V4L2_INDEV 0
-#define CONFIG_VFWCAP_INDEV 0
-#define CONFIG_X11GRAB_INDEV 0
-#define CONFIG_LIBCDIO_INDEV 0
-#define CONFIG_LIBDC1394_INDEV 0
-#define CONFIG_A64_MUXER 0
-#define CONFIG_AC3_MUXER 0
-#define CONFIG_ADTS_MUXER 0
-#define CONFIG_ADX_MUXER 0
-#define CONFIG_AIFF_MUXER 0
-#define CONFIG_AMR_MUXER 0
-#define CONFIG_ASF_MUXER 0
-#define CONFIG_ASS_MUXER 0
-#define CONFIG_AST_MUXER 0
-#define CONFIG_ASF_STREAM_MUXER 0
-#define CONFIG_AU_MUXER 0
-#define CONFIG_AVI_MUXER 0
-#define CONFIG_AVM2_MUXER 0
-#define CONFIG_BIT_MUXER 0
-#define CONFIG_CAF_MUXER 0
-#define CONFIG_CAVSVIDEO_MUXER 0
-#define CONFIG_CRC_MUXER 0
-#define CONFIG_DATA_MUXER 0
-#define CONFIG_DAUD_MUXER 0
-#define CONFIG_DIRAC_MUXER 0
-#define CONFIG_DNXHD_MUXER 0
-#define CONFIG_DTS_MUXER 0
-#define CONFIG_DV_MUXER 0
-#define CONFIG_EAC3_MUXER 0
-#define CONFIG_F4V_MUXER 0
-#define CONFIG_FFM_MUXER 0
-#define CONFIG_FFMETADATA_MUXER 0
-#define CONFIG_FILMSTRIP_MUXER 0
-#define CONFIG_FLAC_MUXER 0
-#define CONFIG_FLV_MUXER 0
-#define CONFIG_FRAMECRC_MUXER 0
-#define CONFIG_FRAMEMD5_MUXER 0
-#define CONFIG_G722_MUXER 0
-#define CONFIG_G723_1_MUXER 0
-#define CONFIG_GIF_MUXER 0
-#define CONFIG_GXF_MUXER 0
-#define CONFIG_H261_MUXER 0
-#define CONFIG_H263_MUXER 0
-#define CONFIG_H264_MUXER 0
-#define CONFIG_HDS_MUXER 0
-#define CONFIG_HLS_MUXER 0
-#define CONFIG_ICO_MUXER 0
-#define CONFIG_ILBC_MUXER 0
-#define CONFIG_IMAGE2_MUXER 0
-#define CONFIG_IMAGE2PIPE_MUXER 0
-#define CONFIG_IPOD_MUXER 0
-#define CONFIG_IRCAM_MUXER 0
-#define CONFIG_ISMV_MUXER 0
-#define CONFIG_IVF_MUXER 0
-#define CONFIG_JACOSUB_MUXER 0
-#define CONFIG_LATM_MUXER 0
-#define CONFIG_M4V_MUXER 0
-#define CONFIG_MD5_MUXER 0
-#define CONFIG_MATROSKA_MUXER 0
-#define CONFIG_MATROSKA_AUDIO_MUXER 0
-#define CONFIG_MICRODVD_MUXER 0
-#define CONFIG_MJPEG_MUXER 0
-#define CONFIG_MLP_MUXER 0
-#define CONFIG_MMF_MUXER 0
-#define CONFIG_MOV_MUXER 0
-#define CONFIG_MP2_MUXER 0
-#define CONFIG_MP3_MUXER 0
-#define CONFIG_MP4_MUXER 0
-#define CONFIG_MPEG1SYSTEM_MUXER 0
-#define CONFIG_MPEG1VCD_MUXER 0
-#define CONFIG_MPEG1VIDEO_MUXER 0
-#define CONFIG_MPEG2DVD_MUXER 0
-#define CONFIG_MPEG2SVCD_MUXER 0
-#define CONFIG_MPEG2VIDEO_MUXER 0
-#define CONFIG_MPEG2VOB_MUXER 0
-#define CONFIG_MPEGTS_MUXER 0
-#define CONFIG_MPJPEG_MUXER 0
-#define CONFIG_MXF_MUXER 0
-#define CONFIG_MXF_D10_MUXER 0
-#define CONFIG_NULL_MUXER 0
-#define CONFIG_NUT_MUXER 0
-#define CONFIG_OGG_MUXER 0
-#define CONFIG_OMA_MUXER 0
-#define CONFIG_OPUS_MUXER 0
-#define CONFIG_PCM_ALAW_MUXER 0
-#define CONFIG_PCM_MULAW_MUXER 0
-#define CONFIG_PCM_F64BE_MUXER 0
-#define CONFIG_PCM_F64LE_MUXER 0
-#define CONFIG_PCM_F32BE_MUXER 0
-#define CONFIG_PCM_F32LE_MUXER 0
-#define CONFIG_PCM_S32BE_MUXER 0
-#define CONFIG_PCM_S32LE_MUXER 0
-#define CONFIG_PCM_S24BE_MUXER 0
-#define CONFIG_PCM_S24LE_MUXER 0
-#define CONFIG_PCM_S16BE_MUXER 0
-#define CONFIG_PCM_S16LE_MUXER 0
-#define CONFIG_PCM_S8_MUXER 0
-#define CONFIG_PCM_U32BE_MUXER 0
-#define CONFIG_PCM_U32LE_MUXER 0
-#define CONFIG_PCM_U24BE_MUXER 0
-#define CONFIG_PCM_U24LE_MUXER 0
-#define CONFIG_PCM_U16BE_MUXER 0
-#define CONFIG_PCM_U16LE_MUXER 0
-#define CONFIG_PCM_U8_MUXER 0
-#define CONFIG_PSP_MUXER 0
-#define CONFIG_RAWVIDEO_MUXER 0
-#define CONFIG_RM_MUXER 0
-#define CONFIG_ROQ_MUXER 0
-#define CONFIG_RSO_MUXER 0
-#define CONFIG_RTP_MUXER 0
-#define CONFIG_RTSP_MUXER 0
-#define CONFIG_SAP_MUXER 0
-#define CONFIG_SEGMENT_MUXER 0
-#define CONFIG_STREAM_SEGMENT_MUXER 0
-#define CONFIG_SMJPEG_MUXER 0
-#define CONFIG_SMOOTHSTREAMING_MUXER 0
-#define CONFIG_SOX_MUXER 0
-#define CONFIG_SPDIF_MUXER 0
-#define CONFIG_SPEEX_MUXER 0
-#define CONFIG_SRT_MUXER 0
-#define CONFIG_SWF_MUXER 0
-#define CONFIG_TEE_MUXER 0
-#define CONFIG_TG2_MUXER 0
-#define CONFIG_TGP_MUXER 0
-#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
-#define CONFIG_TRUEHD_MUXER 0
-#define CONFIG_VC1_MUXER 0
-#define CONFIG_VC1T_MUXER 0
-#define CONFIG_VOC_MUXER 0
-#define CONFIG_W64_MUXER 0
-#define CONFIG_WAV_MUXER 0
-#define CONFIG_WEBM_MUXER 0
-#define CONFIG_WEBVTT_MUXER 0
-#define CONFIG_WTV_MUXER 0
-#define CONFIG_WV_MUXER 0
-#define CONFIG_YUV4MPEGPIPE_MUXER 0
-#define CONFIG_LIBNUT_MUXER 0
-#define CONFIG_ALSA_OUTDEV 0
-#define CONFIG_CACA_OUTDEV 0
-#define CONFIG_FBDEV_OUTDEV 0
-#define CONFIG_OSS_OUTDEV 0
-#define CONFIG_PULSE_OUTDEV 0
-#define CONFIG_SDL_OUTDEV 0
-#define CONFIG_SNDIO_OUTDEV 0
-#define CONFIG_V4L2_OUTDEV 0
-#define CONFIG_XV_OUTDEV 0
-#define CONFIG_AAC_PARSER 1
-#define CONFIG_AAC_LATM_PARSER 0
-#define CONFIG_AC3_PARSER 0
-#define CONFIG_ADX_PARSER 0
-#define CONFIG_BMP_PARSER 0
-#define CONFIG_CAVSVIDEO_PARSER 0
-#define CONFIG_COOK_PARSER 0
-#define CONFIG_DCA_PARSER 0
-#define CONFIG_DIRAC_PARSER 0
-#define CONFIG_DNXHD_PARSER 0
-#define CONFIG_DPX_PARSER 0
-#define CONFIG_DVBSUB_PARSER 0
-#define CONFIG_DVDSUB_PARSER 0
-#define CONFIG_DVD_NAV_PARSER 0
-#define CONFIG_FLAC_PARSER 0
-#define CONFIG_GSM_PARSER 0
-#define CONFIG_H261_PARSER 0
-#define CONFIG_H263_PARSER 0
-#define CONFIG_H264_PARSER 1
-#define CONFIG_HEVC_PARSER 0
-#define CONFIG_MJPEG_PARSER 0
-#define CONFIG_MLP_PARSER 0
-#define CONFIG_MPEG4VIDEO_PARSER 0
-#define CONFIG_MPEGAUDIO_PARSER 1
-#define CONFIG_MPEGVIDEO_PARSER 0
-#define CONFIG_PNG_PARSER 0
-#define CONFIG_PNM_PARSER 0
-#define CONFIG_RV30_PARSER 0
-#define CONFIG_RV40_PARSER 0
-#define CONFIG_TAK_PARSER 0
-#define CONFIG_VC1_PARSER 0
-#define CONFIG_VORBIS_PARSER 1
-#define CONFIG_VP3_PARSER 1
-#define CONFIG_VP8_PARSER 1
-#define CONFIG_VP9_PARSER 0
-#define CONFIG_BLURAY_PROTOCOL 0
-#define CONFIG_CACHE_PROTOCOL 0
-#define CONFIG_CONCAT_PROTOCOL 0
-#define CONFIG_CRYPTO_PROTOCOL 0
-#define CONFIG_DATA_PROTOCOL 0
-#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
-#define CONFIG_FFRTMPHTTP_PROTOCOL 0
-#define CONFIG_FILE_PROTOCOL 0
-#define CONFIG_FTP_PROTOCOL 0
-#define CONFIG_GOPHER_PROTOCOL 0
-#define CONFIG_HLS_PROTOCOL 0
-#define CONFIG_HTTP_PROTOCOL 0
-#define CONFIG_HTTPPROXY_PROTOCOL 0
-#define CONFIG_HTTPS_PROTOCOL 0
-#define CONFIG_MMSH_PROTOCOL 0
-#define CONFIG_MMST_PROTOCOL 0
-#define CONFIG_MD5_PROTOCOL 0
-#define CONFIG_PIPE_PROTOCOL 0
-#define CONFIG_RTMP_PROTOCOL 0
-#define CONFIG_RTMPE_PROTOCOL 0
-#define CONFIG_RTMPS_PROTOCOL 0
-#define CONFIG_RTMPT_PROTOCOL 0
-#define CONFIG_RTMPTE_PROTOCOL 0
-#define CONFIG_RTMPTS_PROTOCOL 0
-#define CONFIG_RTP_PROTOCOL 0
-#define CONFIG_SCTP_PROTOCOL 0
-#define CONFIG_SRTP_PROTOCOL 0
-#define CONFIG_TCP_PROTOCOL 0
-#define CONFIG_TLS_PROTOCOL 0
-#define CONFIG_UDP_PROTOCOL 0
-#define CONFIG_UNIX_PROTOCOL 0
-#define CONFIG_LIBRTMP_PROTOCOL 0
-#define CONFIG_LIBRTMPE_PROTOCOL 0
-#define CONFIG_LIBRTMPS_PROTOCOL 0
-#define CONFIG_LIBRTMPT_PROTOCOL 0
-#define CONFIG_LIBRTMPTE_PROTOCOL 0
-#define CONFIG_LIBSSH_PROTOCOL 0
-#endif /* FFMPEG_CONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm
index 75cee1ed9a4..6b0afb769a8 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 0
%define HAVE_AMD3DNOWEXT_INLINE 0
%define HAVE_AVX_INLINE 0
%define HAVE_AVX2_INLINE 0
+%define HAVE_FMA3_INLINE 0
%define HAVE_FMA4_INLINE 0
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 0
%define HAVE_MMXEXT_INLINE 0
%define HAVE_SSE_INLINE 0
@@ -96,73 +113,44 @@
%define HAVE_SSE4_INLINE 0
%define HAVE_SSE42_INLINE 0
%define HAVE_SSSE3_INLINE 0
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 0
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 0
+%define HAVE_FAST_64BIT 0
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 0
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 0
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 1
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 1
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 1
+%define HAVE_SARESTART 0
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
%define HAVE_INLINE_ASM 0
%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 0
-%define HAVE_W32THREADS 1
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 0
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 1
-%define HAVE_ATANF 1
-%define HAVE_ATAN2F 1
-%define HAVE_CBRT 0
-%define HAVE_CBRTF 0
-%define HAVE_COSF 1
-%define HAVE_EXP2 0
-%define HAVE_EXP2F 0
-%define HAVE_EXPF 1
-%define HAVE_ISINF 0
-%define HAVE_ISNAN 0
-%define HAVE_LDEXPF 1
-%define HAVE_LLRINT 0
-%define HAVE_LLRINTF 0
-%define HAVE_LOG2 0
-%define HAVE_LOG2F 0
-%define HAVE_LOG10F 1
-%define HAVE_LRINT 0
-%define HAVE_LRINTF 0
-%define HAVE_POWF 1
-%define HAVE_RINT 0
-%define HAVE_ROUND 0
-%define HAVE_ROUNDF 0
-%define HAVE_SINF 1
-%define HAVE_TRUNC 0
-%define HAVE_TRUNCF 0
-%define HAVE_ACCESS 1
-%define HAVE_ALIGNED_MALLOC 1
-%define HAVE_ALIGNED_STACK 0
%define HAVE_ALSA_ASOUNDLIB_H 0
%define HAVE_ALTIVEC_H 0
%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 0
-%define HAVE_ATTRIBUTE_PACKED 0
%define HAVE_CDIO_PARANOIA_H 0
%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
%define HAVE_CL_CL_H 0
-%define HAVE_CLOCK_GETTIME 0
-%define HAVE_CLOSESOCKET 0
-%define HAVE_COMMANDLINETOARGVW 1
-%define HAVE_CPUNOP 1
-%define HAVE_CRYPTGENRANDOM 1
-%define HAVE_DCBZL 0
%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
%define HAVE_DEV_IC_BT8XX_H 0
@@ -170,15 +158,66 @@
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 1
%define HAVE_DLFCN_H 0
-%define HAVE_DLOPEN 0
-%define HAVE_DOS_PATHS 1
%define HAVE_DXVA_H 1
-%define HAVE_EBP_AVAILABLE 0
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 0
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 1
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 0
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 0
+%define HAVE_SYS_PARAM_H 0
+%define HAVE_SYS_RESOURCE_H 0
+%define HAVE_SYS_SELECT_H 0
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 0
+%define HAVE_SYS_UN_H 0
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 0
+%define HAVE_UNISTD_H 0
+%define HAVE_WINDOWS_H 1
+%define HAVE_WINSOCK2_H 0
+%define HAVE_ATANF 1
+%define HAVE_ATAN2F 1
+%define HAVE_CBRT 1
+%define HAVE_CBRTF 1
+%define HAVE_COSF 1
+%define HAVE_EXP2 1
+%define HAVE_EXP2F 1
+%define HAVE_EXPF 1
+%define HAVE_ISINF 1
+%define HAVE_ISNAN 1
+%define HAVE_LDEXPF 1
+%define HAVE_LLRINT 1
+%define HAVE_LLRINTF 1
+%define HAVE_LOG2 1
+%define HAVE_LOG2F 1
+%define HAVE_LOG10F 1
+%define HAVE_LRINT 1
+%define HAVE_LRINTF 1
+%define HAVE_POWF 1
+%define HAVE_RINT 1
+%define HAVE_ROUND 1
+%define HAVE_ROUNDF 1
+%define HAVE_SINF 1
+%define HAVE_TRUNC 1
+%define HAVE_TRUNCF 1
+%define HAVE_ACCESS 1
+%define HAVE_ALIGNED_MALLOC 1
+%define HAVE_CLOCK_GETTIME 0
+%define HAVE_CLOSESOCKET 0
+%define HAVE_COMMANDLINETOARGVW 1
+%define HAVE_COTASKMEMFREE 1
+%define HAVE_CRYPTGENRANDOM 1
+%define HAVE_DLOPEN 0
%define HAVE_FCNTL 0
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 0
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 1
%define HAVE_GETPROCESSMEMORYINFO 1
%define HAVE_GETPROCESSTIMES 1
-%define HAVE_GETSYSTEMTIMEASFILETIME 1
%define HAVE_GETRUSAGE 0
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 1
%define HAVE_GETTIMEOFDAY 0
%define HAVE_GLOB 0
-%define HAVE_GNU_AS 0
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
+%define HAVE_GLXGETPROCADDRESS 0
%define HAVE_INET_ATON 0
-%define HAVE_IO_H 1
-%define HAVE_INLINE_ASM_LABELS 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 1
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 1
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 0
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 1
%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 1
%define HAVE_MKSTEMP 0
-%define HAVE_MM_EMPTY 1
%define HAVE_MMAP 0
%define HAVE_MPROTECT 0
%define HAVE_NANOSLEEP 0
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 1
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 0
%define HAVE_POSIX_MEMALIGN 0
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 0
-%define HAVE_RDTSC 1
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 0
%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 1
%define HAVE_SETMODE 1
%define HAVE_SETRLIMIT 0
%define HAVE_SLEEP 1
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 0
+%define HAVE_SYSCONF 0
+%define HAVE_SYSCTL 0
+%define HAVE_USLEEP 0
+%define HAVE_VIRTUALALLOC 1
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 0
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 1
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 0
+%define HAVE_ATTRIBUTE_PACKED 0
+%define HAVE_EBP_AVAILABLE 0
+%define HAVE_EBX_AVAILABLE 0
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 0
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 0
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 0
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 0
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 0
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-%define HAVE_SYSCONF 0
-%define HAVE_SYSCTL 0
-%define HAVE_SYS_MMAN_H 0
-%define HAVE_SYS_PARAM_H 0
-%define HAVE_SYS_RESOURCE_H 0
-%define HAVE_SYS_SELECT_H 0
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 0
-%define HAVE_SYS_UN_H 0
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 0
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 1
+%define HAVE_DXVA2API_COBJ 1
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 1
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 0
-%define HAVE_USLEEP 0
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 1
-%define HAVE_WINDOWS_H 1
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 1
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -386,38 +435,29 @@
%define CONFIG_FFMPEG 0
%define CONFIG_DCT 1
%define CONFIG_DWT 0
-%define CONFIG_ERROR_RESILIENCE 1
+%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 0
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 0
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
-%define CONFIG_DSPUTIL 1
+%define CONFIG_CABAC 1
+%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
%define CONFIG_GCRYPT 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 1
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 1
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 1
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -846,7 +901,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
%define CONFIG_ADF_DEMUXER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 1
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 1
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h
index 5e46f65261d..fda2712c5a9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib' --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86"
+#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86"
#define av_restrict __restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,73 +128,44 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 0
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 1
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 1
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 1
+#define HAVE_SARESTART 0
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
#define HAVE_INLINE_ASM 0
#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 0
-#define HAVE_W32THREADS 1
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 0
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 1
-#define HAVE_ATANF 1
-#define HAVE_ATAN2F 1
-#define HAVE_CBRT 0
-#define HAVE_CBRTF 0
-#define HAVE_COSF 1
-#define HAVE_EXP2 0
-#define HAVE_EXP2F 0
-#define HAVE_EXPF 1
-#define HAVE_ISINF 0
-#define HAVE_ISNAN 0
-#define HAVE_LDEXPF 1
-#define HAVE_LLRINT 0
-#define HAVE_LLRINTF 0
-#define HAVE_LOG2 0
-#define HAVE_LOG2F 0
-#define HAVE_LOG10F 1
-#define HAVE_LRINT 0
-#define HAVE_LRINTF 0
-#define HAVE_POWF 1
-#define HAVE_RINT 0
-#define HAVE_ROUND 0
-#define HAVE_ROUNDF 0
-#define HAVE_SINF 1
-#define HAVE_TRUNC 0
-#define HAVE_TRUNCF 0
-#define HAVE_ACCESS 1
-#define HAVE_ALIGNED_MALLOC 1
-#define HAVE_ALIGNED_STACK 0
#define HAVE_ALSA_ASOUNDLIB_H 0
#define HAVE_ALTIVEC_H 0
#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 0
-#define HAVE_ATTRIBUTE_PACKED 0
#define HAVE_CDIO_PARANOIA_H 0
#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
#define HAVE_CL_CL_H 0
-#define HAVE_CLOCK_GETTIME 0
-#define HAVE_CLOSESOCKET 0
-#define HAVE_COMMANDLINETOARGVW 1
-#define HAVE_CPUNOP 1
-#define HAVE_CRYPTGENRANDOM 1
-#define HAVE_DCBZL 0
#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
#define HAVE_DEV_IC_BT8XX_H 0
@@ -185,15 +173,66 @@
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 1
#define HAVE_DLFCN_H 0
-#define HAVE_DLOPEN 0
-#define HAVE_DOS_PATHS 1
#define HAVE_DXVA_H 1
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 1
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 0
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 0
+#define HAVE_SYS_PARAM_H 0
+#define HAVE_SYS_RESOURCE_H 0
+#define HAVE_SYS_SELECT_H 0
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 0
+#define HAVE_SYS_UN_H 0
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 0
+#define HAVE_UNISTD_H 0
+#define HAVE_WINDOWS_H 1
+#define HAVE_WINSOCK2_H 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COSF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 1
+#define HAVE_LOG2F 1
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 1
+#define HAVE_CLOCK_GETTIME 0
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 1
+#define HAVE_COTASKMEMFREE 1
+#define HAVE_CRYPTGENRANDOM 1
+#define HAVE_DLOPEN 0
#define HAVE_FCNTL 0
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 0
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 1
#define HAVE_GETPROCESSMEMORYINFO 1
#define HAVE_GETPROCESSTIMES 1
-#define HAVE_GETSYSTEMTIMEASFILETIME 1
#define HAVE_GETRUSAGE 0
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 1
#define HAVE_GETTIMEOFDAY 0
#define HAVE_GLOB 0
-#define HAVE_GNU_AS 0
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
+#define HAVE_GLXGETPROCADDRESS 0
#define HAVE_INET_ATON 0
-#define HAVE_IO_H 1
-#define HAVE_INLINE_ASM_LABELS 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 1
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 1
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 0
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 1
#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 1
#define HAVE_MKSTEMP 0
-#define HAVE_MM_EMPTY 1
#define HAVE_MMAP 0
#define HAVE_MPROTECT 0
#define HAVE_NANOSLEEP 0
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 1
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 0
#define HAVE_POSIX_MEMALIGN 0
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 0
-#define HAVE_RDTSC 1
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 0
#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 1
#define HAVE_SETMODE 1
#define HAVE_SETRLIMIT 0
#define HAVE_SLEEP 1
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 0
+#define HAVE_SYSCONF 0
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 0
+#define HAVE_VIRTUALALLOC 1
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 0
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 1
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 0
+#define HAVE_ATTRIBUTE_PACKED 0
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 0
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 0
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 0
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-#define HAVE_SYSCONF 0
-#define HAVE_SYSCTL 0
-#define HAVE_SYS_MMAN_H 0
-#define HAVE_SYS_PARAM_H 0
-#define HAVE_SYS_RESOURCE_H 0
-#define HAVE_SYS_SELECT_H 0
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 0
-#define HAVE_SYS_UN_H 0
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 0
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 1
+#define HAVE_DXVA2API_COBJ 1
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 1
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 0
-#define HAVE_USLEEP 0
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 1
-#define HAVE_WINDOWS_H 1
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -401,38 +450,29 @@
#define CONFIG_FFMPEG 0
#define CONFIG_DCT 1
#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 0
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 0
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
+#define CONFIG_CABAC 1
+#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm
index cbe942b0d89..ca4a46ea207 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 0
%define HAVE_AMD3DNOWEXT_INLINE 0
%define HAVE_AVX_INLINE 0
%define HAVE_AVX2_INLINE 0
+%define HAVE_FMA3_INLINE 0
%define HAVE_FMA4_INLINE 0
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 0
%define HAVE_MMXEXT_INLINE 0
%define HAVE_SSE_INLINE 0
@@ -96,73 +113,44 @@
%define HAVE_SSE4_INLINE 0
%define HAVE_SSE42_INLINE 0
%define HAVE_SSSE3_INLINE 0
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 0
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 1
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 1
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 0
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 1
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 1
+%define HAVE_MM_EMPTY 0
+%define HAVE_RDTSC 1
+%define HAVE_SARESTART 0
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
%define HAVE_INLINE_ASM 0
%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 0
-%define HAVE_W32THREADS 1
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 0
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 1
-%define HAVE_ATANF 1
-%define HAVE_ATAN2F 1
-%define HAVE_CBRT 0
-%define HAVE_CBRTF 0
-%define HAVE_COSF 1
-%define HAVE_EXP2 0
-%define HAVE_EXP2F 0
-%define HAVE_EXPF 1
-%define HAVE_ISINF 0
-%define HAVE_ISNAN 0
-%define HAVE_LDEXPF 1
-%define HAVE_LLRINT 0
-%define HAVE_LLRINTF 0
-%define HAVE_LOG2 0
-%define HAVE_LOG2F 0
-%define HAVE_LOG10F 1
-%define HAVE_LRINT 0
-%define HAVE_LRINTF 0
-%define HAVE_POWF 1
-%define HAVE_RINT 0
-%define HAVE_ROUND 0
-%define HAVE_ROUNDF 0
-%define HAVE_SINF 1
-%define HAVE_TRUNC 0
-%define HAVE_TRUNCF 0
-%define HAVE_ACCESS 1
-%define HAVE_ALIGNED_MALLOC 1
-%define HAVE_ALIGNED_STACK 1
%define HAVE_ALSA_ASOUNDLIB_H 0
%define HAVE_ALTIVEC_H 0
%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 0
-%define HAVE_ATTRIBUTE_PACKED 0
%define HAVE_CDIO_PARANOIA_H 0
%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
%define HAVE_CL_CL_H 0
-%define HAVE_CLOCK_GETTIME 0
-%define HAVE_CLOSESOCKET 0
-%define HAVE_COMMANDLINETOARGVW 1
-%define HAVE_CPUNOP 1
-%define HAVE_CRYPTGENRANDOM 1
-%define HAVE_DCBZL 0
%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
%define HAVE_DEV_IC_BT8XX_H 0
@@ -170,15 +158,66 @@
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 1
%define HAVE_DLFCN_H 0
-%define HAVE_DLOPEN 0
-%define HAVE_DOS_PATHS 1
%define HAVE_DXVA_H 1
-%define HAVE_EBP_AVAILABLE 0
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 1
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 1
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 1
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 0
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 0
+%define HAVE_SYS_PARAM_H 0
+%define HAVE_SYS_RESOURCE_H 0
+%define HAVE_SYS_SELECT_H 0
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 0
+%define HAVE_SYS_UN_H 0
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 0
+%define HAVE_UNISTD_H 0
+%define HAVE_WINDOWS_H 1
+%define HAVE_WINSOCK2_H 0
+%define HAVE_ATANF 1
+%define HAVE_ATAN2F 1
+%define HAVE_CBRT 1
+%define HAVE_CBRTF 1
+%define HAVE_COSF 1
+%define HAVE_EXP2 1
+%define HAVE_EXP2F 1
+%define HAVE_EXPF 1
+%define HAVE_ISINF 1
+%define HAVE_ISNAN 1
+%define HAVE_LDEXPF 1
+%define HAVE_LLRINT 1
+%define HAVE_LLRINTF 1
+%define HAVE_LOG2 1
+%define HAVE_LOG2F 1
+%define HAVE_LOG10F 1
+%define HAVE_LRINT 1
+%define HAVE_LRINTF 1
+%define HAVE_POWF 1
+%define HAVE_RINT 1
+%define HAVE_ROUND 1
+%define HAVE_ROUNDF 1
+%define HAVE_SINF 1
+%define HAVE_TRUNC 1
+%define HAVE_TRUNCF 1
+%define HAVE_ACCESS 1
+%define HAVE_ALIGNED_MALLOC 1
+%define HAVE_CLOCK_GETTIME 0
+%define HAVE_CLOSESOCKET 0
+%define HAVE_COMMANDLINETOARGVW 1
+%define HAVE_COTASKMEMFREE 1
+%define HAVE_CRYPTGENRANDOM 1
+%define HAVE_DLOPEN 0
%define HAVE_FCNTL 0
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 0
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 1
%define HAVE_GETPROCESSMEMORYINFO 1
%define HAVE_GETPROCESSTIMES 1
-%define HAVE_GETSYSTEMTIMEASFILETIME 1
%define HAVE_GETRUSAGE 0
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 1
%define HAVE_GETTIMEOFDAY 0
%define HAVE_GLOB 0
-%define HAVE_GNU_AS 0
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
+%define HAVE_GLXGETPROCADDRESS 0
%define HAVE_INET_ATON 0
-%define HAVE_IO_H 1
-%define HAVE_INLINE_ASM_LABELS 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 1
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 1
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 0
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 1
%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 1
%define HAVE_MKSTEMP 0
-%define HAVE_MM_EMPTY 0
%define HAVE_MMAP 0
%define HAVE_MPROTECT 0
%define HAVE_NANOSLEEP 0
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 1
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 0
%define HAVE_POSIX_MEMALIGN 0
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 0
-%define HAVE_RDTSC 1
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 0
%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 1
-%define HAVE_SETMODE 0
+%define HAVE_SETMODE 1
%define HAVE_SETRLIMIT 0
%define HAVE_SLEEP 1
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 0
+%define HAVE_SYSCONF 0
+%define HAVE_SYSCTL 0
+%define HAVE_USLEEP 0
+%define HAVE_VIRTUALALLOC 1
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 0
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 1
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 0
+%define HAVE_ATTRIBUTE_PACKED 0
+%define HAVE_EBP_AVAILABLE 0
+%define HAVE_EBX_AVAILABLE 0
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 0
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 0
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 0
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 0
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 0
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-%define HAVE_SYSCONF 0
-%define HAVE_SYSCTL 0
-%define HAVE_SYS_MMAN_H 0
-%define HAVE_SYS_PARAM_H 0
-%define HAVE_SYS_RESOURCE_H 0
-%define HAVE_SYS_SELECT_H 0
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 0
-%define HAVE_SYS_UN_H 0
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 0
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 1
+%define HAVE_DXVA2API_COBJ 1
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 1
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 0
-%define HAVE_USLEEP 0
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 1
-%define HAVE_WINDOWS_H 1
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 1
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -386,38 +435,29 @@
%define CONFIG_FFMPEG 0
%define CONFIG_DCT 1
%define CONFIG_DWT 0
-%define CONFIG_ERROR_RESILIENCE 1
+%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 0
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
-%define CONFIG_DSPUTIL 1
+%define CONFIG_CABAC 1
+%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
%define CONFIG_GCRYPT 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 1
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 1
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 1
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -846,7 +901,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
%define CONFIG_ADF_DEMUXER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 1
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 1
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h
index b6cea251388..df940f8d0d6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib' --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64"
+#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64"
#define av_restrict __restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,73 +128,44 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 1
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 0
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 1
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 1
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 1
+#define HAVE_SARESTART 0
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
#define HAVE_INLINE_ASM 0
#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 0
-#define HAVE_W32THREADS 1
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 0
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 1
-#define HAVE_ATANF 1
-#define HAVE_ATAN2F 1
-#define HAVE_CBRT 0
-#define HAVE_CBRTF 0
-#define HAVE_COSF 1
-#define HAVE_EXP2 0
-#define HAVE_EXP2F 0
-#define HAVE_EXPF 1
-#define HAVE_ISINF 0
-#define HAVE_ISNAN 0
-#define HAVE_LDEXPF 1
-#define HAVE_LLRINT 0
-#define HAVE_LLRINTF 0
-#define HAVE_LOG2 0
-#define HAVE_LOG2F 0
-#define HAVE_LOG10F 1
-#define HAVE_LRINT 0
-#define HAVE_LRINTF 0
-#define HAVE_POWF 1
-#define HAVE_RINT 0
-#define HAVE_ROUND 0
-#define HAVE_ROUNDF 0
-#define HAVE_SINF 1
-#define HAVE_TRUNC 0
-#define HAVE_TRUNCF 0
-#define HAVE_ACCESS 1
-#define HAVE_ALIGNED_MALLOC 1
-#define HAVE_ALIGNED_STACK 1
#define HAVE_ALSA_ASOUNDLIB_H 0
#define HAVE_ALTIVEC_H 0
#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 0
-#define HAVE_ATTRIBUTE_PACKED 0
#define HAVE_CDIO_PARANOIA_H 0
#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
#define HAVE_CL_CL_H 0
-#define HAVE_CLOCK_GETTIME 0
-#define HAVE_CLOSESOCKET 0
-#define HAVE_COMMANDLINETOARGVW 1
-#define HAVE_CPUNOP 1
-#define HAVE_CRYPTGENRANDOM 1
-#define HAVE_DCBZL 0
#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
#define HAVE_DEV_IC_BT8XX_H 0
@@ -185,15 +173,66 @@
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 1
#define HAVE_DLFCN_H 0
-#define HAVE_DLOPEN 0
-#define HAVE_DOS_PATHS 1
#define HAVE_DXVA_H 1
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 1
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 1
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 1
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 0
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 0
+#define HAVE_SYS_PARAM_H 0
+#define HAVE_SYS_RESOURCE_H 0
+#define HAVE_SYS_SELECT_H 0
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 0
+#define HAVE_SYS_UN_H 0
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 0
+#define HAVE_UNISTD_H 0
+#define HAVE_WINDOWS_H 1
+#define HAVE_WINSOCK2_H 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COSF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 1
+#define HAVE_LOG2F 1
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 1
+#define HAVE_CLOCK_GETTIME 0
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 1
+#define HAVE_COTASKMEMFREE 1
+#define HAVE_CRYPTGENRANDOM 1
+#define HAVE_DLOPEN 0
#define HAVE_FCNTL 0
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 0
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 1
#define HAVE_GETPROCESSMEMORYINFO 1
#define HAVE_GETPROCESSTIMES 1
-#define HAVE_GETSYSTEMTIMEASFILETIME 1
#define HAVE_GETRUSAGE 0
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 1
#define HAVE_GETTIMEOFDAY 0
#define HAVE_GLOB 0
-#define HAVE_GNU_AS 0
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
+#define HAVE_GLXGETPROCADDRESS 0
#define HAVE_INET_ATON 0
-#define HAVE_IO_H 1
-#define HAVE_INLINE_ASM_LABELS 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 1
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 1
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 0
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 1
#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 1
#define HAVE_MKSTEMP 0
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 0
#define HAVE_MPROTECT 0
#define HAVE_NANOSLEEP 0
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 1
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 0
#define HAVE_POSIX_MEMALIGN 0
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 0
-#define HAVE_RDTSC 1
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 0
#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 1
-#define HAVE_SETMODE 0
+#define HAVE_SETMODE 1
#define HAVE_SETRLIMIT 0
#define HAVE_SLEEP 1
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 0
+#define HAVE_SYSCONF 0
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 0
+#define HAVE_VIRTUALALLOC 1
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 0
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 1
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 0
+#define HAVE_ATTRIBUTE_PACKED 0
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 0
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 0
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 0
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-#define HAVE_SYSCONF 0
-#define HAVE_SYSCTL 0
-#define HAVE_SYS_MMAN_H 0
-#define HAVE_SYS_PARAM_H 0
-#define HAVE_SYS_RESOURCE_H 0
-#define HAVE_SYS_SELECT_H 0
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 0
-#define HAVE_SYS_UN_H 0
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 0
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 1
+#define HAVE_DXVA2API_COBJ 1
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 1
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 0
-#define HAVE_USLEEP 0
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 1
-#define HAVE_WINDOWS_H 1
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -401,38 +450,29 @@
#define CONFIG_FFMPEG 0
#define CONFIG_DCT 1
#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 0
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 1
+#define CONFIG_CABAC 1
+#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h
index 4f54f733386..9879de58991 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --enable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=neon' --extra-cflags='-mfloat-abi=hard' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --enable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=neon' --extra-cflags='-mfloat-abi=hard' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.x-google (4.7.2_cos_gg_c8f69e0) 20130114 (prerelease)"
+#define CC_IDENT "gcc 4.8.x-google (4.8.2_cos_gg_38c6bf0_4.8.2-r70) 20140307 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 1
+#define HAVE_ARMV8 0
#define HAVE_NEON 1
#define HAVE_VFP 1
#define HAVE_VFPV3 1
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -57,25 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 1
#define HAVE_VFP_EXTERNAL 1
#define HAVE_VFPV3_EXTERNAL 1
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 1
#define HAVE_VFP_INLINE 1
#define HAVE_VFPV3_INLINE 1
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 1
-#define HAVE_ASM_MOD_Y 1
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 1
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 1
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,36 +453,27 @@
#define CONFIG_ERROR_RESILIENCE 1
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 1
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 1
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 1
#define CONFIG_DSPUTIL 1
-#define CONFIG_EXIF 0
+#define CONFIG_EXIF 1
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
#define CONFIG_GOLOMB 1
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 1
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 1
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h
index 068618e614e..d697c8c9ae3 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --disable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=hard' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --disable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=hard' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.x-google (4.7.2_cos_gg_c8f69e0) 20130114 (prerelease)"
+#define CC_IDENT "gcc 4.8.x-google (4.8.2_cos_gg_38c6bf0_4.8.2-r70) 20140307 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 1
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 1
#define HAVE_VFPV3 1
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -57,25 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 1
#define HAVE_VFPV3_EXTERNAL 1
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 1
#define HAVE_VFPV3_INLINE 1
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 1
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 1
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 1
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,36 +453,27 @@
#define CONFIG_ERROR_RESILIENCE 1
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 1
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 1
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 1
#define CONFIG_DSPUTIL 1
-#define CONFIG_EXIF 0
+#define CONFIG_EXIF 1
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
#define CONFIG_GOLOMB 1
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 1
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 1
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm
index 9fe2b3ec8f4..62e9b94ac0e 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 0
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 0
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 0
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
-%define HAVE_SYMVER 1
+%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 1
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 1
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 1
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 1
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 0
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 0
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 1
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 0
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 1
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 0
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 0
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 1
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 1
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 0
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -389,36 +438,27 @@
%define CONFIG_ERROR_RESILIENCE 1
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 1
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_CABAC 1
%define CONFIG_DSPUTIL 1
-%define CONFIG_EXIF 0
+%define CONFIG_EXIF 1
%define CONFIG_FRAME_THREAD_ENCODER 0
%define CONFIG_GCRYPT 0
%define CONFIG_GOLOMB 1
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 1
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 1
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 1
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 1
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -846,7 +901,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
%define CONFIG_ADF_DEMUXER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 1
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 1
%define CONFIG_MPEGAUDIO_PARSER 1
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h
index 46b7bc4da06..6da1dec0499 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h
@@ -1,9 +1,9 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --arch=i686 --enable-yasm --extra-cflags=-m32 --extra-ldflags=-m32 --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --arch=i686 --enable-yasm --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
#define CC_IDENT "gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 1
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,36 +453,27 @@
#define CONFIG_ERROR_RESILIENCE 1
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 1
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 1
#define CONFIG_DSPUTIL 1
-#define CONFIG_EXIF 0
+#define CONFIG_EXIF 1
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
#define CONFIG_GOLOMB 1
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 1
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 1
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/config.h
index 48a932af9ad..fe2947c344a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/config.h
@@ -1,14 +1,16 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=mips-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=mipsel-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.3 (Sourcery CodeBench Lite 2013.05-7)"
+#define CC_IDENT "gcc 4.9.0 (GCC)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
+#define BUILDSUF ""
#define SLIBSUF ".so"
#define HAVE_MMX2 HAVE_MMXEXT
#define ARCH_AARCH64 0
@@ -38,14 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -54,24 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 1
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -80,24 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
+#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -106,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 0
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -153,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -196,63 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
-#define HAVE_MSVCRT 0
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -265,30 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
-#define HAVE_XMM_CLOBBERS 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -305,10 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -316,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -323,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -355,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -387,47 +453,41 @@
#define CONFIG_ERROR_RESILIENCE 1
#define CONFIG_FAST_UNALIGNED 0
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 1
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 1
#define CONFIG_DSPUTIL 1
-#define CONFIG_EXIF 0
+#define CONFIG_EXIF 1
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
#define CONFIG_GOLOMB 1
#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 1
#define CONFIG_H264CHROMA 1
#define CONFIG_H264DSP 1
#define CONFIG_H264PRED 1
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -440,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -449,7 +510,6 @@
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
-#define CONFIG_MP3_HEADER_COMPRESS_BSF 0
#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
#define CONFIG_MOV2TEXTSUB_BSF 0
#define CONFIG_NOISE_BSF 0
@@ -457,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -507,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -524,6 +586,8 @@
#define CONFIG_H264_CRYSTALHD_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HUFFYUV_DECODER 0
#define CONFIG_IDCIN_DECODER 0
#define CONFIG_IFF_BYTERUN1_DECODER 0
@@ -641,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -668,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 1
@@ -675,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -708,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -779,6 +852,7 @@
#define CONFIG_ADPCM_EA_XAS_DECODER 0
#define CONFIG_ADPCM_G722_DECODER 0
#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
#define CONFIG_ADPCM_IMA_AMV_DECODER 0
#define CONFIG_ADPCM_IMA_APC_DECODER 0
#define CONFIG_ADPCM_IMA_DK3_DECODER 0
@@ -798,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -841,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -876,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -910,6 +987,7 @@
#define CONFIG_H264_DEMUXER 0
#define CONFIG_HEVC_DEMUXER 0
#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
#define CONFIG_ICO_DEMUXER 0
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
@@ -917,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -936,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1003,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1054,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1061,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1133,6 +1217,7 @@
#define CONFIG_FLAC_ENCODER 0
#define CONFIG_G723_1_ENCODER 0
#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
#define CONFIG_NELLYMOSER_ENCODER 0
#define CONFIG_RA_144_ENCODER 0
#define CONFIG_SONIC_ENCODER 0
@@ -1206,14 +1291,17 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
#define CONFIG_ACONVERT_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
@@ -1243,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1254,6 +1343,7 @@
#define CONFIG_LADSPA_FILTER 0
#define CONFIG_LOWPASS_FILTER 0
#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1281,12 +1371,14 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FIELD_FILTER 0
@@ -1294,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1314,6 +1407,7 @@
#define CONFIG_LUTRGB_FILTER 0
#define CONFIG_LUTYUV_FILTER 0
#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
#define CONFIG_MP_FILTER 0
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
@@ -1344,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1389,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1403,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1458,6 +1559,8 @@
#define CONFIG_H261_MUXER 0
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1494,8 +1597,10 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
#define CONFIG_PCM_ALAW_MUXER 0
#define CONFIG_PCM_MULAW_MUXER 0
#define CONFIG_PCM_F64BE_MUXER 0
@@ -1530,6 +1635,7 @@
#define CONFIG_SMOOTHSTREAMING_MUXER 0
#define CONFIG_SOX_MUXER 0
#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SPEEX_MUXER 0
#define CONFIG_SRT_MUXER 0
#define CONFIG_SWF_MUXER 0
#define CONFIG_TEE_MUXER 0
@@ -1537,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1550,6 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1575,11 +1685,13 @@
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 1
#define CONFIG_H264_PARSER 1
+#define CONFIG_HEVC_PARSER 0
#define CONFIG_MJPEG_PARSER 0
#define CONFIG_MLP_PARSER 0
#define CONFIG_MPEG4VIDEO_PARSER 1
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1589,6 +1701,7 @@
#define CONFIG_VORBIS_PARSER 1
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
+#define CONFIG_VP9_PARSER 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
@@ -1616,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/libavutil/avconfig.h
index bac323a539b..123b3b28aef 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 0
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm
index d33d5723afa..0e80d09fe9a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 1
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 1
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
-%define HAVE_SYMVER 1
+%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 1
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 1
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 1
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 1
-%define HAVE_EBX_AVAILABLE 1
-%define HAVE_FAST_64BIT 1
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 1
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 1
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 1
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 1
-%define HAVE_SDL 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 1
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 1
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 1
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 0
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 1
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
-%define HAVE_XLIB 1
-%define HAVE_XMM_CLOBBERS 1
+%define HAVE_XLIB 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -389,36 +438,27 @@
%define CONFIG_ERROR_RESILIENCE 1
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 1
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_CABAC 1
%define CONFIG_DSPUTIL 1
-%define CONFIG_EXIF 0
+%define CONFIG_EXIF 1
%define CONFIG_FRAME_THREAD_ENCODER 0
%define CONFIG_GCRYPT 0
%define CONFIG_GOLOMB 1
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 1
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 1
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 1
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 1
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -846,7 +901,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
%define CONFIG_ADF_DEMUXER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 1
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 1
%define CONFIG_MPEGAUDIO_PARSER 1
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h
index ff34c793285..65b2a958b69 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h
@@ -1,9 +1,9 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
#define CC_IDENT "gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 1
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 1
-#define HAVE_EBX_AVAILABLE 1
-#define HAVE_FAST_64BIT 1
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 1
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 1
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 1
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
-#define HAVE_XLIB 1
-#define HAVE_XMM_CLOBBERS 1
+#define HAVE_XLIB 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,36 +453,27 @@
#define CONFIG_ERROR_RESILIENCE 1
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 1
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 1
#define CONFIG_DSPUTIL 1
-#define CONFIG_EXIF 0
+#define CONFIG_EXIF 1
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
#define CONFIG_GOLOMB 1
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 1
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 1
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 1
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 1
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -861,7 +916,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
#define CONFIG_ADF_DEMUXER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 1
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 1
#define CONFIG_MPEGAUDIO_PARSER 1
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h
index e4cc36a158b..4c09731bd1a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h
@@ -1,17 +1,17 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --disable-error-resilience"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --disable-asm --disable-inline-asm --enable-pic"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86"
-#define av_restrict __restrict
-#define EXTERN_PREFIX "_"
-#define EXTERN_ASM _
+#define CC_IDENT "gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
#define BUILDSUF ""
-#define SLIBSUF ".dll"
+#define SLIBSUF ".so"
#define HAVE_MMX2 HAVE_MMXEXT
#define ARCH_AARCH64 0
#define ARCH_ALPHA 0
@@ -34,75 +34,92 @@
#define ARCH_TILEGX 0
#define ARCH_TILEPRO 0
#define ARCH_TOMI 0
-#define ARCH_X86 1
-#define ARCH_X86_32 1
+#define ARCH_X86 0
+#define ARCH_X86_32 0
#define ARCH_X86_64 0
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
-#define HAVE_AMD3DNOW 1
-#define HAVE_AMD3DNOWEXT 1
-#define HAVE_AVX 1
-#define HAVE_AVX2 1
-#define HAVE_FMA4 1
-#define HAVE_I686 1
-#define HAVE_MMX 1
-#define HAVE_MMXEXT 1
-#define HAVE_SSE 1
-#define HAVE_SSE2 1
-#define HAVE_SSE3 1
-#define HAVE_SSE4 1
-#define HAVE_SSE42 1
-#define HAVE_SSSE3 1
#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_AMD3DNOW 0
+#define HAVE_AMD3DNOWEXT 0
+#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
+#define HAVE_FMA4 0
+#define HAVE_MMX 0
+#define HAVE_MMXEXT 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
+#define HAVE_SSE3 0
+#define HAVE_SSE4 0
+#define HAVE_SSE42 0
+#define HAVE_SSSE3 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
-#define HAVE_AMD3DNOW_EXTERNAL 1
-#define HAVE_AMD3DNOWEXT_EXTERNAL 1
-#define HAVE_AVX_EXTERNAL 1
-#define HAVE_AVX2_EXTERNAL 1
-#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
-#define HAVE_MMX_EXTERNAL 1
-#define HAVE_MMXEXT_EXTERNAL 1
-#define HAVE_SSE_EXTERNAL 1
-#define HAVE_SSE2_EXTERNAL 1
-#define HAVE_SSE3_EXTERNAL 1
-#define HAVE_SSE4_EXTERNAL 1
-#define HAVE_SSE42_EXTERNAL 1
-#define HAVE_SSSE3_EXTERNAL 1
#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 0
+#define HAVE_AMD3DNOWEXT_EXTERNAL 0
+#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
+#define HAVE_FMA4_EXTERNAL 0
+#define HAVE_MMX_EXTERNAL 0
+#define HAVE_MMXEXT_EXTERNAL 0
+#define HAVE_SSE_EXTERNAL 0
+#define HAVE_SSE2_EXTERNAL 0
+#define HAVE_SSE3_EXTERNAL 0
+#define HAVE_SSE4_EXTERNAL 0
+#define HAVE_SSE42_EXTERNAL 0
+#define HAVE_SSSE3_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 0
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 0
#define HAVE_SYMVER 0
-#define HAVE_YASM 1
+#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
-#define HAVE_FAST_UNALIGNED 1
+#define HAVE_FAST_UNALIGNED 0
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 0
-#define HAVE_W32THREADS 1
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 0
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 1
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -144,7 +211,7 @@
#define HAVE_LDEXPF 1
#define HAVE_LLRINT 1
#define HAVE_LLRINTF 1
-#define HAVE_LOG2 0
+#define HAVE_LOG2 1
#define HAVE_LOG2F 1
#define HAVE_LOG10F 1
#define HAVE_LRINT 1
@@ -157,146 +224,104 @@
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
-#define HAVE_ALIGNED_MALLOC 1
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 0
-#define HAVE_ATTRIBUTE_PACKED 0
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
-#define HAVE_CLOCK_GETTIME 0
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
-#define HAVE_COMMANDLINETOARGVW 1
-#define HAVE_CPUNOP 1
-#define HAVE_CRYPTGENRANDOM 1
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 1
-#define HAVE_DLFCN_H 0
-#define HAVE_DLOPEN 0
-#define HAVE_DOS_PATHS 1
-#define HAVE_DXVA_H 1
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
-#define HAVE_FCNTL 0
-#define HAVE_FORK 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
-#define HAVE_GETOPT 0
-#define HAVE_GETPROCESSAFFINITYMASK 1
-#define HAVE_GETPROCESSMEMORYINFO 1
-#define HAVE_GETPROCESSTIMES 1
-#define HAVE_GETSYSTEMTIMEASFILETIME 1
-#define HAVE_GETRUSAGE 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
-#define HAVE_GETTIMEOFDAY 0
-#define HAVE_GLOB 0
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 1
+#define HAVE_GLXGETPROCADDRESS 0
#define HAVE_INET_ATON 0
-#define HAVE_IO_H 1
-#define HAVE_INLINE_ASM_LABELS 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
-#define HAVE_KBHIT 1
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 1
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
-#define HAVE_LOCALTIME_R 0
-#define HAVE_LOONGSON 0
+#define HAVE_KBHIT 0
+#define HAVE_LOCALTIME_R 1
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MAPVIEWOFFILE 1
-#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 1
-#define HAVE_MKSTEMP 0
-#define HAVE_MM_EMPTY 1
-#define HAVE_MMAP 0
-#define HAVE_MPROTECT 0
-#define HAVE_NANOSLEEP 0
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
-#define HAVE_PEEKNAMEDPIPE 1
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 0
-#define HAVE_POSIX_MEMALIGN 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_PTHREAD_CANCEL 1
+#define HAVE_SCHED_GETAFFINITY 1
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
#define HAVE_PRAGMA_DEPRECATED 1
-#define HAVE_PTHREAD_CANCEL 0
-#define HAVE_RDTSC 1
#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 0
-#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
-#define HAVE_SETCONSOLETEXTATTRIBUTE 1
-#define HAVE_SETMODE 1
-#define HAVE_SETRLIMIT 0
-#define HAVE_SLEEP 1
-#define HAVE_SNDIO_H 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
-#define HAVE_STRERROR_R 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
#define HAVE_STRUCT_POLLFD 0
-#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
#define HAVE_STRUCT_SOCKADDR_IN6 0
#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
-#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
-#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-#define HAVE_SYSCONF 0
-#define HAVE_SYSCTL 0
-#define HAVE_SYS_MMAN_H 0
-#define HAVE_SYS_PARAM_H 0
-#define HAVE_SYS_RESOURCE_H 0
-#define HAVE_SYS_SELECT_H 0
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 0
-#define HAVE_SYS_UN_H 0
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 0
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 1
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 0
-#define HAVE_USLEEP 0
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 1
-#define HAVE_WINDOWS_H 1
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -312,20 +337,24 @@
#define CONFIG_HTMLPAGES 0
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
-#define CONFIG_TXTPAGES 1
+#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -402,36 +451,27 @@
#define CONFIG_DCT 0
#define CONFIG_DWT 0
#define CONFIG_ERROR_RESILIENCE 0
-#define CONFIG_FAST_UNALIGNED 1
+#define CONFIG_FAST_UNALIGNED 0
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
-#define CONFIG_MEMALIGN_HACK 0
-#define CONFIG_MEMORY_POISONING 0
#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
-#define CONFIG_PIC 0
#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 0
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/avconfig.h
index f6685b72c19..123b3b28aef 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/ia32/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/avconfig.h
@@ -2,7 +2,6 @@
#ifndef AVUTIL_AVCONFIG_H
#define AVUTIL_AVCONFIG_H
#define AV_HAVE_BIGENDIAN 0
-#define AV_HAVE_FAST_UNALIGNED 1
+#define AV_HAVE_FAST_UNALIGNED 0
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h
index 12367dd6569..b2f34ee0890 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --enable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=neon' --extra-cflags='-mfloat-abi=hard' --enable-pic --disable-error-resilience"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --enable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=neon' --extra-cflags='-mfloat-abi=hard' --enable-pic"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.x-google (4.7.2_cos_gg_c8f69e0) 20130114 (prerelease)"
+#define CC_IDENT "gcc 4.8.x-google (4.8.2_cos_gg_38c6bf0_4.8.2-r70) 20140307 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 1
+#define HAVE_ARMV8 0
#define HAVE_NEON 1
#define HAVE_VFP 1
#define HAVE_VFPV3 1
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -57,25 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 1
#define HAVE_VFP_EXTERNAL 1
#define HAVE_VFPV3_EXTERNAL 1
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 1
#define HAVE_VFP_INLINE 1
#define HAVE_VFPV3_INLINE 1
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 1
-#define HAVE_ASM_MOD_Y 1
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 1
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 1
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 1
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h
index 91bbf679e67..2d688b3ac9c 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --disable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=hard' --enable-pic --disable-error-resilience"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --disable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=hard' --enable-pic"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.x-google (4.7.2_cos_gg_c8f69e0) 20130114 (prerelease)"
+#define CC_IDENT "gcc 4.8.x-google (4.8.2_cos_gg_38c6bf0_4.8.2-r70) 20140307 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 1
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 1
#define HAVE_VFPV3 1
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -57,25 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 1
#define HAVE_VFPV3_EXTERNAL 1
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 1
#define HAVE_VFPV3_INLINE 1
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 1
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 1
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 1
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 1
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm
index 2dce472faee..ea11c21552a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 0
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 0
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 0
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
-%define HAVE_SYMVER 1
+%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 1
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 1
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 1
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 1
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 0
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 0
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 1
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 0
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 1
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 0
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 0
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 1
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 1
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 0
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -389,34 +438,25 @@
%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_CABAC 0
%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 0
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 0
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 0
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 0
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h
index 7326d0fc9fc..fb44099149b 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h
@@ -1,9 +1,9 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --arch=i686 --enable-yasm --extra-cflags=-m32 --extra-ldflags=-m32 --enable-pic --disable-error-resilience"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --arch=i686 --enable-yasm --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
#define CC_IDENT "gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 1
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/config.h
index 6e71f3f9753..91f48c70cae 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/config.h
@@ -1,14 +1,16 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=mips-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --disable-error-resilience"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=mipsel-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.3 (Sourcery CodeBench Lite 2013.05-7)"
+#define CC_IDENT "gcc 4.9.0 (GCC)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
+#define BUILDSUF ""
#define SLIBSUF ".so"
#define HAVE_MMX2 HAVE_MMXEXT
#define ARCH_AARCH64 0
@@ -38,14 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -54,24 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 1
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -80,24 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
+#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -106,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 0
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -153,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -196,63 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
-#define HAVE_MSVCRT 0
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -265,30 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
-#define HAVE_XMM_CLOBBERS 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -305,10 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -316,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -323,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -355,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -387,47 +453,41 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 0
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
#define CONFIG_GOLOMB 1
#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
#define CONFIG_H264CHROMA 0
#define CONFIG_H264DSP 0
#define CONFIG_H264PRED 1
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -440,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -449,7 +510,6 @@
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
-#define CONFIG_MP3_HEADER_COMPRESS_BSF 0
#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
#define CONFIG_MOV2TEXTSUB_BSF 0
#define CONFIG_NOISE_BSF 0
@@ -457,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -507,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -524,6 +586,8 @@
#define CONFIG_H264_CRYSTALHD_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HUFFYUV_DECODER 0
#define CONFIG_IDCIN_DECODER 0
#define CONFIG_IFF_BYTERUN1_DECODER 0
@@ -641,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -668,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -675,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -708,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -779,6 +852,7 @@
#define CONFIG_ADPCM_EA_XAS_DECODER 0
#define CONFIG_ADPCM_G722_DECODER 0
#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
#define CONFIG_ADPCM_IMA_AMV_DECODER 0
#define CONFIG_ADPCM_IMA_APC_DECODER 0
#define CONFIG_ADPCM_IMA_DK3_DECODER 0
@@ -798,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -876,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -910,6 +987,7 @@
#define CONFIG_H264_DEMUXER 0
#define CONFIG_HEVC_DEMUXER 0
#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
#define CONFIG_ICO_DEMUXER 0
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
@@ -917,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -936,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1003,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1054,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1061,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1133,6 +1217,7 @@
#define CONFIG_FLAC_ENCODER 0
#define CONFIG_G723_1_ENCODER 0
#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
#define CONFIG_NELLYMOSER_ENCODER 0
#define CONFIG_RA_144_ENCODER 0
#define CONFIG_SONIC_ENCODER 0
@@ -1206,14 +1291,17 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
#define CONFIG_ACONVERT_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
@@ -1243,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1254,6 +1343,7 @@
#define CONFIG_LADSPA_FILTER 0
#define CONFIG_LOWPASS_FILTER 0
#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1281,12 +1371,14 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FIELD_FILTER 0
@@ -1294,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1314,6 +1407,7 @@
#define CONFIG_LUTRGB_FILTER 0
#define CONFIG_LUTYUV_FILTER 0
#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
#define CONFIG_MP_FILTER 0
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
@@ -1344,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1389,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1403,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1458,6 +1559,8 @@
#define CONFIG_H261_MUXER 0
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1494,8 +1597,10 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
#define CONFIG_PCM_ALAW_MUXER 0
#define CONFIG_PCM_MULAW_MUXER 0
#define CONFIG_PCM_F64BE_MUXER 0
@@ -1530,6 +1635,7 @@
#define CONFIG_SMOOTHSTREAMING_MUXER 0
#define CONFIG_SOX_MUXER 0
#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SPEEX_MUXER 0
#define CONFIG_SRT_MUXER 0
#define CONFIG_SWF_MUXER 0
#define CONFIG_TEE_MUXER 0
@@ -1537,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1550,6 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1575,11 +1685,13 @@
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
#define CONFIG_H264_PARSER 0
+#define CONFIG_HEVC_PARSER 0
#define CONFIG_MJPEG_PARSER 0
#define CONFIG_MLP_PARSER 0
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1589,6 +1701,7 @@
#define CONFIG_VORBIS_PARSER 1
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
+#define CONFIG_VP9_PARSER 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
@@ -1616,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/libavutil/avconfig.h
index bac323a539b..123b3b28aef 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 0
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm
index cbfd1fc576a..316482bcb48 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 1
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 1
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
-%define HAVE_SYMVER 1
+%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 1
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 1
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 1
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 1
-%define HAVE_EBX_AVAILABLE 1
-%define HAVE_FAST_64BIT 1
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 1
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 1
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 1
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 1
-%define HAVE_SDL 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 1
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 1
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 1
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 0
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 1
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
-%define HAVE_XLIB 1
-%define HAVE_XMM_CLOBBERS 1
+%define HAVE_XLIB 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -389,34 +438,25 @@
%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_CABAC 0
%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 0
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 0
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 0
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 0
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h
index 29099ac0cea..2dda50cc7b5 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h
@@ -1,9 +1,9 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-pic --disable-error-resilience"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-pic"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
#define CC_IDENT "gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 1
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 1
-#define HAVE_EBX_AVAILABLE 1
-#define HAVE_FAST_64BIT 1
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 1
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 1
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 1
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
-#define HAVE_XLIB 1
-#define HAVE_XMM_CLOBBERS 1
+#define HAVE_XLIB 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/config.asm
index ea579af2368..3e651883d70 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 0
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 0
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 0
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 1
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 0
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 0
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 0
-%define HAVE_EBX_AVAILABLE 1
-%define HAVE_FAST_64BIT 0
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 0
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 0
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 0
+%define HAVE_MACH_ABSOLUTE_TIME 1
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 1
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 0
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 0
+%define HAVE_EBX_AVAILABLE 1
+%define HAVE_GNU_AS 0
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 0
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 0
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 1
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 1
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -389,34 +438,25 @@
%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_CABAC 0
%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 0
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 0
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 0
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 0
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/config.h
index 323840c0da6..bd87b4c0c86 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags='-fno-omit-frame-pointer -O2' --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=i686 --extra-cflags=-m32 --extra-ldflags=-m32 --disable-error-resilience"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\0-fno-omit-frame-pointer -O2\0' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=i686 --extra-cflags=-m32 --extra-ldflags=-m32"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 3.4 (trunk 193323)"
+#define CC_IDENT "clang version 3.5.0 (trunk 206824)"
#define av_restrict restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 0
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 1
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 0
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 0
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 1
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 0
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 0
+#define HAVE_MACH_ABSOLUTE_TIME 1
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 1
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 0
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 0
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 1
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/ia32/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm
index 8e1d5750bb9..d30839524e7 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 1
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 1
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 0
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 1
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 0
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 0
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 1
-%define HAVE_EBX_AVAILABLE 1
-%define HAVE_FAST_64BIT 1
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 1
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 0
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 0
+%define HAVE_MACH_ABSOLUTE_TIME 1
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 1
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 0
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 1
+%define HAVE_GNU_AS 0
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 0
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 0
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 1
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 1
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -389,34 +438,25 @@
%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_CABAC 0
%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 0
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 0
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 0
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 0
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h
index 1175d474299..c53ca82e4b0 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64 --disable-error-resilience"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\0-O2\0' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 3.4 (trunk 193323)"
+#define CC_IDENT "clang version 3.5.0 (trunk 206824)"
#define av_restrict restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 1
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 0
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 1
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 0
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 0
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 1
-#define HAVE_EBX_AVAILABLE 1
-#define HAVE_FAST_64BIT 1
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 1
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 0
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 0
+#define HAVE_MACH_ABSOLUTE_TIME 1
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 1
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 0
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 0
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 1
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/ia32/config.asm
deleted file mode 100644
index cb415ffdc46..00000000000
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/ia32/config.asm
+++ /dev/null
@@ -1,1645 +0,0 @@
-%define ARCH_AARCH64 0
-%define ARCH_ALPHA 0
-%define ARCH_ARM 0
-%define ARCH_AVR32 0
-%define ARCH_AVR32_AP 0
-%define ARCH_AVR32_UC 0
-%define ARCH_BFIN 0
-%define ARCH_IA64 0
-%define ARCH_M68K 0
-%define ARCH_MIPS 0
-%define ARCH_MIPS64 0
-%define ARCH_PARISC 0
-%define ARCH_PPC 0
-%define ARCH_PPC64 0
-%define ARCH_S390 0
-%define ARCH_SH4 0
-%define ARCH_SPARC 0
-%define ARCH_SPARC64 0
-%define ARCH_TILEGX 0
-%define ARCH_TILEPRO 0
-%define ARCH_TOMI 0
-%define ARCH_X86 1
-%define ARCH_X86_32 1
-%define ARCH_X86_64 0
-%define HAVE_ARMV5TE 0
-%define HAVE_ARMV6 0
-%define HAVE_ARMV6T2 0
-%define HAVE_NEON 0
-%define HAVE_VFP 0
-%define HAVE_VFPV3 0
-%define HAVE_AMD3DNOW 1
-%define HAVE_AMD3DNOWEXT 1
-%define HAVE_AVX 1
-%define HAVE_AVX2 1
-%define HAVE_FMA4 1
-%define HAVE_I686 1
-%define HAVE_MMX 1
-%define HAVE_MMXEXT 1
-%define HAVE_SSE 1
-%define HAVE_SSE2 1
-%define HAVE_SSE3 1
-%define HAVE_SSE4 1
-%define HAVE_SSE42 1
-%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
-%define HAVE_MIPSFPU 0
-%define HAVE_MIPS32R2 0
-%define HAVE_MIPSDSPR1 0
-%define HAVE_MIPSDSPR2 0
-%define HAVE_ARMV5TE_EXTERNAL 0
-%define HAVE_ARMV6_EXTERNAL 0
-%define HAVE_ARMV6T2_EXTERNAL 0
-%define HAVE_NEON_EXTERNAL 0
-%define HAVE_VFP_EXTERNAL 0
-%define HAVE_VFPV3_EXTERNAL 0
-%define HAVE_AMD3DNOW_EXTERNAL 1
-%define HAVE_AMD3DNOWEXT_EXTERNAL 1
-%define HAVE_AVX_EXTERNAL 1
-%define HAVE_AVX2_EXTERNAL 1
-%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
-%define HAVE_MMX_EXTERNAL 1
-%define HAVE_MMXEXT_EXTERNAL 1
-%define HAVE_SSE_EXTERNAL 1
-%define HAVE_SSE2_EXTERNAL 1
-%define HAVE_SSE3_EXTERNAL 1
-%define HAVE_SSE4_EXTERNAL 1
-%define HAVE_SSE42_EXTERNAL 1
-%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
-%define HAVE_MIPSFPU_EXTERNAL 0
-%define HAVE_MIPS32R2_EXTERNAL 0
-%define HAVE_MIPSDSPR1_EXTERNAL 0
-%define HAVE_MIPSDSPR2_EXTERNAL 0
-%define HAVE_ARMV5TE_INLINE 0
-%define HAVE_ARMV6_INLINE 0
-%define HAVE_ARMV6T2_INLINE 0
-%define HAVE_NEON_INLINE 0
-%define HAVE_VFP_INLINE 0
-%define HAVE_VFPV3_INLINE 0
-%define HAVE_AMD3DNOW_INLINE 0
-%define HAVE_AMD3DNOWEXT_INLINE 0
-%define HAVE_AVX_INLINE 0
-%define HAVE_AVX2_INLINE 0
-%define HAVE_FMA4_INLINE 0
-%define HAVE_I686_INLINE 0
-%define HAVE_MMX_INLINE 0
-%define HAVE_MMXEXT_INLINE 0
-%define HAVE_SSE_INLINE 0
-%define HAVE_SSE2_INLINE 0
-%define HAVE_SSE3_INLINE 0
-%define HAVE_SSE4_INLINE 0
-%define HAVE_SSE42_INLINE 0
-%define HAVE_SSSE3_INLINE 0
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
-%define HAVE_MIPSFPU_INLINE 0
-%define HAVE_MIPS32R2_INLINE 0
-%define HAVE_MIPSDSPR1_INLINE 0
-%define HAVE_MIPSDSPR2_INLINE 0
-%define HAVE_INLINE_ASM 0
-%define HAVE_SYMVER 0
-%define HAVE_YASM 1
-%define HAVE_BIGENDIAN 0
-%define HAVE_FAST_UNALIGNED 1
-%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 0
-%define HAVE_W32THREADS 1
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 0
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 1
-%define HAVE_ATANF 1
-%define HAVE_ATAN2F 1
-%define HAVE_CBRT 1
-%define HAVE_CBRTF 1
-%define HAVE_COSF 1
-%define HAVE_EXP2 1
-%define HAVE_EXP2F 1
-%define HAVE_EXPF 1
-%define HAVE_ISINF 1
-%define HAVE_ISNAN 1
-%define HAVE_LDEXPF 1
-%define HAVE_LLRINT 1
-%define HAVE_LLRINTF 1
-%define HAVE_LOG2 0
-%define HAVE_LOG2F 1
-%define HAVE_LOG10F 1
-%define HAVE_LRINT 1
-%define HAVE_LRINTF 1
-%define HAVE_POWF 1
-%define HAVE_RINT 1
-%define HAVE_ROUND 1
-%define HAVE_ROUNDF 1
-%define HAVE_SINF 1
-%define HAVE_TRUNC 1
-%define HAVE_TRUNCF 1
-%define HAVE_ACCESS 1
-%define HAVE_ALIGNED_MALLOC 1
-%define HAVE_ALIGNED_STACK 0
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 0
-%define HAVE_ATTRIBUTE_PACKED 0
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
-%define HAVE_CLOCK_GETTIME 0
-%define HAVE_CLOSESOCKET 0
-%define HAVE_COMMANDLINETOARGVW 1
-%define HAVE_CPUNOP 1
-%define HAVE_CRYPTGENRANDOM 1
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 1
-%define HAVE_DLFCN_H 0
-%define HAVE_DLOPEN 0
-%define HAVE_DOS_PATHS 1
-%define HAVE_DXVA_H 1
-%define HAVE_EBP_AVAILABLE 0
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 0
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 0
-%define HAVE_FCNTL 0
-%define HAVE_FORK 0
-%define HAVE_GETADDRINFO 0
-%define HAVE_GETHRTIME 0
-%define HAVE_GETOPT 0
-%define HAVE_GETPROCESSAFFINITYMASK 1
-%define HAVE_GETPROCESSMEMORYINFO 1
-%define HAVE_GETPROCESSTIMES 1
-%define HAVE_GETSYSTEMTIMEASFILETIME 1
-%define HAVE_GETRUSAGE 0
-%define HAVE_GETSERVBYPORT 0
-%define HAVE_GETTIMEOFDAY 0
-%define HAVE_GLOB 0
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 0
-%define HAVE_IO_H 1
-%define HAVE_INLINE_ASM_LABELS 0
-%define HAVE_ISATTY 1
-%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
-%define HAVE_KBHIT 1
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 1
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
-%define HAVE_LOCALTIME_R 0
-%define HAVE_LOONGSON 0
-%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 1
-%define HAVE_MAPVIEWOFFILE 1
-%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 1
-%define HAVE_MKSTEMP 0
-%define HAVE_MM_EMPTY 1
-%define HAVE_MMAP 0
-%define HAVE_MPROTECT 0
-%define HAVE_NANOSLEEP 0
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
-%define HAVE_PEEKNAMEDPIPE 1
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 0
-%define HAVE_POSIX_MEMALIGN 0
-%define HAVE_PRAGMA_DEPRECATED 1
-%define HAVE_PTHREAD_CANCEL 0
-%define HAVE_RDTSC 1
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 0
-%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
-%define HAVE_SETCONSOLETEXTATTRIBUTE 1
-%define HAVE_SETMODE 1
-%define HAVE_SETRLIMIT 0
-%define HAVE_SLEEP 1
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
-%define HAVE_STRERROR_R 0
-%define HAVE_STRUCT_ADDRINFO 0
-%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
-%define HAVE_STRUCT_IP_MREQ_SOURCE 0
-%define HAVE_STRUCT_IPV6_MREQ 0
-%define HAVE_STRUCT_POLLFD 0
-%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0
-%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
-%define HAVE_STRUCT_SOCKADDR_IN6 0
-%define HAVE_STRUCT_SOCKADDR_SA_LEN 0
-%define HAVE_STRUCT_SOCKADDR_STORAGE 0
-%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
-%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-%define HAVE_SYSCONF 0
-%define HAVE_SYSCTL 0
-%define HAVE_SYS_MMAN_H 0
-%define HAVE_SYS_PARAM_H 0
-%define HAVE_SYS_RESOURCE_H 0
-%define HAVE_SYS_SELECT_H 0
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 0
-%define HAVE_SYS_UN_H 0
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 0
-%define HAVE_TEXI2HTML 0
-%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 0
-%define HAVE_USLEEP 0
-%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 1
-%define HAVE_WINDOWS_H 1
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
-%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
-%define CONFIG_BSFS 0
-%define CONFIG_DECODERS 1
-%define CONFIG_DEMUXERS 1
-%define CONFIG_ENCODERS 0
-%define CONFIG_FILTERS 0
-%define CONFIG_HWACCELS 0
-%define CONFIG_INDEVS 0
-%define CONFIG_MUXERS 0
-%define CONFIG_OUTDEVS 0
-%define CONFIG_PARSERS 1
-%define CONFIG_PROTOCOLS 0
-%define CONFIG_DOC 0
-%define CONFIG_HTMLPAGES 0
-%define CONFIG_MANPAGES 1
-%define CONFIG_PODPAGES 1
-%define CONFIG_TXTPAGES 1
-%define CONFIG_DECODING_ENCODING_EXAMPLE 1
-%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
-%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
-%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
-%define CONFIG_METADATA_EXAMPLE 1
-%define CONFIG_MUXING_EXAMPLE 0
-%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
-%define CONFIG_SCALING_VIDEO_EXAMPLE 0
-%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
-%define CONFIG_AVISYNTH 0
-%define CONFIG_BZLIB 0
-%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
-%define CONFIG_FREI0R 0
-%define CONFIG_GNUTLS 0
-%define CONFIG_ICONV 0
-%define CONFIG_LADSPA 0
-%define CONFIG_LIBAACPLUS 0
-%define CONFIG_LIBASS 0
-%define CONFIG_LIBBLURAY 0
-%define CONFIG_LIBCACA 0
-%define CONFIG_LIBCDIO 0
-%define CONFIG_LIBCELT 0
-%define CONFIG_LIBDC1394 0
-%define CONFIG_LIBFAAC 0
-%define CONFIG_LIBFDK_AAC 0
-%define CONFIG_LIBFLITE 0
-%define CONFIG_LIBFREETYPE 0
-%define CONFIG_LIBGME 0
-%define CONFIG_LIBGSM 0
-%define CONFIG_LIBIEC61883 0
-%define CONFIG_LIBILBC 0
-%define CONFIG_LIBMODPLUG 0
-%define CONFIG_LIBMP3LAME 0
-%define CONFIG_LIBNUT 0
-%define CONFIG_LIBOPENCORE_AMRNB 0
-%define CONFIG_LIBOPENCORE_AMRWB 0
-%define CONFIG_LIBOPENCV 0
-%define CONFIG_LIBOPENJPEG 0
-%define CONFIG_LIBOPUS 0
-%define CONFIG_LIBPULSE 0
-%define CONFIG_LIBQUVI 0
-%define CONFIG_LIBRTMP 0
-%define CONFIG_LIBSCHROEDINGER 0
-%define CONFIG_LIBSHINE 0
-%define CONFIG_LIBSOXR 0
-%define CONFIG_LIBSPEEX 0
-%define CONFIG_LIBSSH 0
-%define CONFIG_LIBSTAGEFRIGHT_H264 0
-%define CONFIG_LIBTHEORA 0
-%define CONFIG_LIBTWOLAME 0
-%define CONFIG_LIBUTVIDEO 0
-%define CONFIG_LIBV4L2 0
-%define CONFIG_LIBVIDSTAB 0
-%define CONFIG_LIBVO_AACENC 0
-%define CONFIG_LIBVO_AMRWBENC 0
-%define CONFIG_LIBVORBIS 0
-%define CONFIG_LIBVPX 0
-%define CONFIG_LIBWAVPACK 0
-%define CONFIG_LIBX264 0
-%define CONFIG_LIBXAVS 0
-%define CONFIG_LIBXVID 0
-%define CONFIG_LIBZMQ 0
-%define CONFIG_LIBZVBI 0
-%define CONFIG_OPENAL 0
-%define CONFIG_OPENCL 0
-%define CONFIG_OPENSSL 0
-%define CONFIG_X11GRAB 0
-%define CONFIG_ZLIB 0
-%define CONFIG_DXVA2 0
-%define CONFIG_VAAPI 0
-%define CONFIG_VDA 0
-%define CONFIG_VDPAU 0
-%define CONFIG_AVCODEC 1
-%define CONFIG_AVDEVICE 0
-%define CONFIG_AVFILTER 0
-%define CONFIG_AVFORMAT 1
-%define CONFIG_AVRESAMPLE 0
-%define CONFIG_AVUTIL 1
-%define CONFIG_POSTPROC 0
-%define CONFIG_SWRESAMPLE 0
-%define CONFIG_SWSCALE 0
-%define CONFIG_FFPLAY 0
-%define CONFIG_FFPROBE 0
-%define CONFIG_FFSERVER 0
-%define CONFIG_FFMPEG 0
-%define CONFIG_DCT 0
-%define CONFIG_DWT 0
-%define CONFIG_ERROR_RESILIENCE 0
-%define CONFIG_FAST_UNALIGNED 1
-%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
-%define CONFIG_LSP 0
-%define CONFIG_LZO 0
-%define CONFIG_MDCT 1
-%define CONFIG_MEMALIGN_HACK 0
-%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
-%define CONFIG_PIC 0
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 0
-%define CONFIG_SWSCALE_ALPHA 1
-%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
-%define CONFIG_XMM_CLOBBER_TEST 0
-%define CONFIG_AANDCTTABLES 0
-%define CONFIG_AC3DSP 0
-%define CONFIG_AUDIO_FRAME_QUEUE 0
-%define CONFIG_DSPUTIL 0
-%define CONFIG_EXIF 0
-%define CONFIG_FRAME_THREAD_ENCODER 0
-%define CONFIG_GCRYPT 0
-%define CONFIG_GOLOMB 1
-%define CONFIG_GPLV3 0
-%define CONFIG_H263DSP 0
-%define CONFIG_H264CHROMA 0
-%define CONFIG_H264DSP 0
-%define CONFIG_H264PRED 1
-%define CONFIG_H264QPEL 0
-%define CONFIG_HPELDSP 1
-%define CONFIG_HUFFMAN 0
-%define CONFIG_LGPLV3 0
-%define CONFIG_LPC 0
-%define CONFIG_MPEGAUDIO 0
-%define CONFIG_MPEGAUDIODSP 0
-%define CONFIG_MPEGVIDEO 0
-%define CONFIG_MPEGVIDEOENC 0
-%define CONFIG_NETTLE 0
-%define CONFIG_RANGECODER 0
-%define CONFIG_RIFFDEC 1
-%define CONFIG_RIFFENC 0
-%define CONFIG_RTPDEC 0
-%define CONFIG_RTPENC_CHAIN 0
-%define CONFIG_SINEWIN 0
-%define CONFIG_VIDEODSP 1
-%define CONFIG_VP3DSP 1
-%define CONFIG_AAC_ADTSTOASC_BSF 0
-%define CONFIG_CHOMP_BSF 0
-%define CONFIG_DUMP_EXTRADATA_BSF 0
-%define CONFIG_H264_MP4TOANNEXB_BSF 0
-%define CONFIG_IMX_DUMP_HEADER_BSF 0
-%define CONFIG_MJPEG2JPEG_BSF 0
-%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
-%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
-%define CONFIG_MOV2TEXTSUB_BSF 0
-%define CONFIG_NOISE_BSF 0
-%define CONFIG_REMOVE_EXTRADATA_BSF 0
-%define CONFIG_TEXT2MOVSUB_BSF 0
-%define CONFIG_AASC_DECODER 0
-%define CONFIG_AIC_DECODER 0
-%define CONFIG_AMV_DECODER 0
-%define CONFIG_ANM_DECODER 0
-%define CONFIG_ANSI_DECODER 0
-%define CONFIG_ASV1_DECODER 0
-%define CONFIG_ASV2_DECODER 0
-%define CONFIG_AURA_DECODER 0
-%define CONFIG_AURA2_DECODER 0
-%define CONFIG_AVRP_DECODER 0
-%define CONFIG_AVRN_DECODER 0
-%define CONFIG_AVS_DECODER 0
-%define CONFIG_AVUI_DECODER 0
-%define CONFIG_AYUV_DECODER 0
-%define CONFIG_BETHSOFTVID_DECODER 0
-%define CONFIG_BFI_DECODER 0
-%define CONFIG_BINK_DECODER 0
-%define CONFIG_BMP_DECODER 0
-%define CONFIG_BMV_VIDEO_DECODER 0
-%define CONFIG_BRENDER_PIX_DECODER 0
-%define CONFIG_C93_DECODER 0
-%define CONFIG_CAVS_DECODER 0
-%define CONFIG_CDGRAPHICS_DECODER 0
-%define CONFIG_CDXL_DECODER 0
-%define CONFIG_CINEPAK_DECODER 0
-%define CONFIG_CLJR_DECODER 0
-%define CONFIG_CLLC_DECODER 0
-%define CONFIG_COMFORTNOISE_DECODER 0
-%define CONFIG_CPIA_DECODER 0
-%define CONFIG_CSCD_DECODER 0
-%define CONFIG_CYUV_DECODER 0
-%define CONFIG_DFA_DECODER 0
-%define CONFIG_DIRAC_DECODER 0
-%define CONFIG_DNXHD_DECODER 0
-%define CONFIG_DPX_DECODER 0
-%define CONFIG_DSICINVIDEO_DECODER 0
-%define CONFIG_DVVIDEO_DECODER 0
-%define CONFIG_DXA_DECODER 0
-%define CONFIG_DXTORY_DECODER 0
-%define CONFIG_EACMV_DECODER 0
-%define CONFIG_EAMAD_DECODER 0
-%define CONFIG_EATGQ_DECODER 0
-%define CONFIG_EATGV_DECODER 0
-%define CONFIG_EATQI_DECODER 0
-%define CONFIG_EIGHTBPS_DECODER 0
-%define CONFIG_EIGHTSVX_EXP_DECODER 0
-%define CONFIG_EIGHTSVX_FIB_DECODER 0
-%define CONFIG_ESCAPE124_DECODER 0
-%define CONFIG_ESCAPE130_DECODER 0
-%define CONFIG_EXR_DECODER 0
-%define CONFIG_FFV1_DECODER 0
-%define CONFIG_FFVHUFF_DECODER 0
-%define CONFIG_FLASHSV_DECODER 0
-%define CONFIG_FLASHSV2_DECODER 0
-%define CONFIG_FLIC_DECODER 0
-%define CONFIG_FLV_DECODER 0
-%define CONFIG_FOURXM_DECODER 0
-%define CONFIG_FRAPS_DECODER 0
-%define CONFIG_FRWU_DECODER 0
-%define CONFIG_G2M_DECODER 0
-%define CONFIG_GIF_DECODER 0
-%define CONFIG_H261_DECODER 0
-%define CONFIG_H263_DECODER 0
-%define CONFIG_H263I_DECODER 0
-%define CONFIG_H263P_DECODER 0
-%define CONFIG_H264_DECODER 0
-%define CONFIG_H264_CRYSTALHD_DECODER 0
-%define CONFIG_H264_VDA_DECODER 0
-%define CONFIG_H264_VDPAU_DECODER 0
-%define CONFIG_HEVC_DECODER 0
-%define CONFIG_HNM4_VIDEO_DECODER 0
-%define CONFIG_HUFFYUV_DECODER 0
-%define CONFIG_IDCIN_DECODER 0
-%define CONFIG_IFF_BYTERUN1_DECODER 0
-%define CONFIG_IFF_ILBM_DECODER 0
-%define CONFIG_INDEO2_DECODER 0
-%define CONFIG_INDEO3_DECODER 0
-%define CONFIG_INDEO4_DECODER 0
-%define CONFIG_INDEO5_DECODER 0
-%define CONFIG_INTERPLAY_VIDEO_DECODER 0
-%define CONFIG_JPEG2000_DECODER 0
-%define CONFIG_JPEGLS_DECODER 0
-%define CONFIG_JV_DECODER 0
-%define CONFIG_KGV1_DECODER 0
-%define CONFIG_KMVC_DECODER 0
-%define CONFIG_LAGARITH_DECODER 0
-%define CONFIG_LOCO_DECODER 0
-%define CONFIG_MDEC_DECODER 0
-%define CONFIG_MIMIC_DECODER 0
-%define CONFIG_MJPEG_DECODER 0
-%define CONFIG_MJPEGB_DECODER 0
-%define CONFIG_MMVIDEO_DECODER 0
-%define CONFIG_MOTIONPIXELS_DECODER 0
-%define CONFIG_MPEG_XVMC_DECODER 0
-%define CONFIG_MPEG1VIDEO_DECODER 0
-%define CONFIG_MPEG2VIDEO_DECODER 0
-%define CONFIG_MPEG4_DECODER 0
-%define CONFIG_MPEG4_CRYSTALHD_DECODER 0
-%define CONFIG_MPEG4_VDPAU_DECODER 0
-%define CONFIG_MPEGVIDEO_DECODER 0
-%define CONFIG_MPEG_VDPAU_DECODER 0
-%define CONFIG_MPEG1_VDPAU_DECODER 0
-%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
-%define CONFIG_MSA1_DECODER 0
-%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
-%define CONFIG_MSMPEG4V1_DECODER 0
-%define CONFIG_MSMPEG4V2_DECODER 0
-%define CONFIG_MSMPEG4V3_DECODER 0
-%define CONFIG_MSRLE_DECODER 0
-%define CONFIG_MSS1_DECODER 0
-%define CONFIG_MSS2_DECODER 0
-%define CONFIG_MSVIDEO1_DECODER 0
-%define CONFIG_MSZH_DECODER 0
-%define CONFIG_MTS2_DECODER 0
-%define CONFIG_MVC1_DECODER 0
-%define CONFIG_MVC2_DECODER 0
-%define CONFIG_MXPEG_DECODER 0
-%define CONFIG_NUV_DECODER 0
-%define CONFIG_PAF_VIDEO_DECODER 0
-%define CONFIG_PAM_DECODER 0
-%define CONFIG_PBM_DECODER 0
-%define CONFIG_PCX_DECODER 0
-%define CONFIG_PGM_DECODER 0
-%define CONFIG_PGMYUV_DECODER 0
-%define CONFIG_PICTOR_DECODER 0
-%define CONFIG_PNG_DECODER 0
-%define CONFIG_PPM_DECODER 0
-%define CONFIG_PRORES_DECODER 0
-%define CONFIG_PRORES_LGPL_DECODER 0
-%define CONFIG_PTX_DECODER 0
-%define CONFIG_QDRAW_DECODER 0
-%define CONFIG_QPEG_DECODER 0
-%define CONFIG_QTRLE_DECODER 0
-%define CONFIG_R10K_DECODER 0
-%define CONFIG_R210_DECODER 0
-%define CONFIG_RAWVIDEO_DECODER 0
-%define CONFIG_RL2_DECODER 0
-%define CONFIG_ROQ_DECODER 0
-%define CONFIG_RPZA_DECODER 0
-%define CONFIG_RV10_DECODER 0
-%define CONFIG_RV20_DECODER 0
-%define CONFIG_RV30_DECODER 0
-%define CONFIG_RV40_DECODER 0
-%define CONFIG_S302M_DECODER 0
-%define CONFIG_SANM_DECODER 0
-%define CONFIG_SGI_DECODER 0
-%define CONFIG_SGIRLE_DECODER 0
-%define CONFIG_SMACKER_DECODER 0
-%define CONFIG_SMC_DECODER 0
-%define CONFIG_SMVJPEG_DECODER 0
-%define CONFIG_SNOW_DECODER 0
-%define CONFIG_SP5X_DECODER 0
-%define CONFIG_SUNRAST_DECODER 0
-%define CONFIG_SVQ1_DECODER 0
-%define CONFIG_SVQ3_DECODER 0
-%define CONFIG_TARGA_DECODER 0
-%define CONFIG_TARGA_Y216_DECODER 0
-%define CONFIG_THEORA_DECODER 1
-%define CONFIG_THP_DECODER 0
-%define CONFIG_TIERTEXSEQVIDEO_DECODER 0
-%define CONFIG_TIFF_DECODER 0
-%define CONFIG_TMV_DECODER 0
-%define CONFIG_TRUEMOTION1_DECODER 0
-%define CONFIG_TRUEMOTION2_DECODER 0
-%define CONFIG_TSCC_DECODER 0
-%define CONFIG_TSCC2_DECODER 0
-%define CONFIG_TXD_DECODER 0
-%define CONFIG_ULTI_DECODER 0
-%define CONFIG_UTVIDEO_DECODER 0
-%define CONFIG_V210_DECODER 0
-%define CONFIG_V210X_DECODER 0
-%define CONFIG_V308_DECODER 0
-%define CONFIG_V408_DECODER 0
-%define CONFIG_V410_DECODER 0
-%define CONFIG_VB_DECODER 0
-%define CONFIG_VBLE_DECODER 0
-%define CONFIG_VC1_DECODER 0
-%define CONFIG_VC1_CRYSTALHD_DECODER 0
-%define CONFIG_VC1_VDPAU_DECODER 0
-%define CONFIG_VC1IMAGE_DECODER 0
-%define CONFIG_VCR1_DECODER 0
-%define CONFIG_VMDVIDEO_DECODER 0
-%define CONFIG_VMNC_DECODER 0
-%define CONFIG_VP3_DECODER 1
-%define CONFIG_VP5_DECODER 0
-%define CONFIG_VP6_DECODER 0
-%define CONFIG_VP6A_DECODER 0
-%define CONFIG_VP6F_DECODER 0
-%define CONFIG_VP8_DECODER 1
-%define CONFIG_VP9_DECODER 0
-%define CONFIG_VQA_DECODER 0
-%define CONFIG_WEBP_DECODER 0
-%define CONFIG_WMV1_DECODER 0
-%define CONFIG_WMV2_DECODER 0
-%define CONFIG_WMV3_DECODER 0
-%define CONFIG_WMV3_CRYSTALHD_DECODER 0
-%define CONFIG_WMV3_VDPAU_DECODER 0
-%define CONFIG_WMV3IMAGE_DECODER 0
-%define CONFIG_WNV1_DECODER 0
-%define CONFIG_XAN_WC3_DECODER 0
-%define CONFIG_XAN_WC4_DECODER 0
-%define CONFIG_XBM_DECODER 0
-%define CONFIG_XFACE_DECODER 0
-%define CONFIG_XL_DECODER 0
-%define CONFIG_XWD_DECODER 0
-%define CONFIG_Y41P_DECODER 0
-%define CONFIG_YOP_DECODER 0
-%define CONFIG_YUV4_DECODER 0
-%define CONFIG_ZERO12V_DECODER 0
-%define CONFIG_ZEROCODEC_DECODER 0
-%define CONFIG_ZLIB_DECODER 0
-%define CONFIG_ZMBV_DECODER 0
-%define CONFIG_AAC_DECODER 0
-%define CONFIG_AAC_LATM_DECODER 0
-%define CONFIG_AC3_DECODER 0
-%define CONFIG_ALAC_DECODER 0
-%define CONFIG_ALS_DECODER 0
-%define CONFIG_AMRNB_DECODER 0
-%define CONFIG_AMRWB_DECODER 0
-%define CONFIG_APE_DECODER 0
-%define CONFIG_ATRAC1_DECODER 0
-%define CONFIG_ATRAC3_DECODER 0
-%define CONFIG_BINKAUDIO_DCT_DECODER 0
-%define CONFIG_BINKAUDIO_RDFT_DECODER 0
-%define CONFIG_BMV_AUDIO_DECODER 0
-%define CONFIG_COOK_DECODER 0
-%define CONFIG_DCA_DECODER 0
-%define CONFIG_DSICINAUDIO_DECODER 0
-%define CONFIG_EAC3_DECODER 0
-%define CONFIG_EVRC_DECODER 0
-%define CONFIG_FFWAVESYNTH_DECODER 0
-%define CONFIG_FLAC_DECODER 0
-%define CONFIG_G723_1_DECODER 0
-%define CONFIG_G729_DECODER 0
-%define CONFIG_GSM_DECODER 0
-%define CONFIG_GSM_MS_DECODER 0
-%define CONFIG_IAC_DECODER 0
-%define CONFIG_IMC_DECODER 0
-%define CONFIG_MACE3_DECODER 0
-%define CONFIG_MACE6_DECODER 0
-%define CONFIG_METASOUND_DECODER 0
-%define CONFIG_MLP_DECODER 0
-%define CONFIG_MP1_DECODER 0
-%define CONFIG_MP1FLOAT_DECODER 0
-%define CONFIG_MP2_DECODER 0
-%define CONFIG_MP2FLOAT_DECODER 0
-%define CONFIG_MP3_DECODER 0
-%define CONFIG_MP3FLOAT_DECODER 0
-%define CONFIG_MP3ADU_DECODER 0
-%define CONFIG_MP3ADUFLOAT_DECODER 0
-%define CONFIG_MP3ON4_DECODER 0
-%define CONFIG_MP3ON4FLOAT_DECODER 0
-%define CONFIG_MPC7_DECODER 0
-%define CONFIG_MPC8_DECODER 0
-%define CONFIG_NELLYMOSER_DECODER 0
-%define CONFIG_PAF_AUDIO_DECODER 0
-%define CONFIG_QCELP_DECODER 0
-%define CONFIG_QDM2_DECODER 0
-%define CONFIG_RA_144_DECODER 0
-%define CONFIG_RA_288_DECODER 0
-%define CONFIG_RALF_DECODER 0
-%define CONFIG_SHORTEN_DECODER 0
-%define CONFIG_SIPR_DECODER 0
-%define CONFIG_SMACKAUD_DECODER 0
-%define CONFIG_SONIC_DECODER 0
-%define CONFIG_TAK_DECODER 0
-%define CONFIG_TRUEHD_DECODER 0
-%define CONFIG_TRUESPEECH_DECODER 0
-%define CONFIG_TTA_DECODER 0
-%define CONFIG_TWINVQ_DECODER 0
-%define CONFIG_VMDAUDIO_DECODER 0
-%define CONFIG_VORBIS_DECODER 1
-%define CONFIG_WAVPACK_DECODER 0
-%define CONFIG_WMALOSSLESS_DECODER 0
-%define CONFIG_WMAPRO_DECODER 0
-%define CONFIG_WMAV1_DECODER 0
-%define CONFIG_WMAV2_DECODER 0
-%define CONFIG_WMAVOICE_DECODER 0
-%define CONFIG_WS_SND1_DECODER 0
-%define CONFIG_PCM_ALAW_DECODER 1
-%define CONFIG_PCM_BLURAY_DECODER 0
-%define CONFIG_PCM_DVD_DECODER 0
-%define CONFIG_PCM_F32BE_DECODER 0
-%define CONFIG_PCM_F32LE_DECODER 1
-%define CONFIG_PCM_F64BE_DECODER 0
-%define CONFIG_PCM_F64LE_DECODER 0
-%define CONFIG_PCM_LXF_DECODER 0
-%define CONFIG_PCM_MULAW_DECODER 1
-%define CONFIG_PCM_S8_DECODER 0
-%define CONFIG_PCM_S8_PLANAR_DECODER 0
-%define CONFIG_PCM_S16BE_DECODER 1
-%define CONFIG_PCM_S16BE_PLANAR_DECODER 0
-%define CONFIG_PCM_S16LE_DECODER 1
-%define CONFIG_PCM_S16LE_PLANAR_DECODER 0
-%define CONFIG_PCM_S24BE_DECODER 1
-%define CONFIG_PCM_S24DAUD_DECODER 0
-%define CONFIG_PCM_S24LE_DECODER 1
-%define CONFIG_PCM_S24LE_PLANAR_DECODER 0
-%define CONFIG_PCM_S32BE_DECODER 0
-%define CONFIG_PCM_S32LE_DECODER 0
-%define CONFIG_PCM_S32LE_PLANAR_DECODER 0
-%define CONFIG_PCM_U8_DECODER 1
-%define CONFIG_PCM_U16BE_DECODER 0
-%define CONFIG_PCM_U16LE_DECODER 0
-%define CONFIG_PCM_U24BE_DECODER 0
-%define CONFIG_PCM_U24LE_DECODER 0
-%define CONFIG_PCM_U32BE_DECODER 0
-%define CONFIG_PCM_U32LE_DECODER 0
-%define CONFIG_PCM_ZORK_DECODER 0
-%define CONFIG_INTERPLAY_DPCM_DECODER 0
-%define CONFIG_ROQ_DPCM_DECODER 0
-%define CONFIG_SOL_DPCM_DECODER 0
-%define CONFIG_XAN_DPCM_DECODER 0
-%define CONFIG_ADPCM_4XM_DECODER 0
-%define CONFIG_ADPCM_ADX_DECODER 0
-%define CONFIG_ADPCM_AFC_DECODER 0
-%define CONFIG_ADPCM_CT_DECODER 0
-%define CONFIG_ADPCM_DTK_DECODER 0
-%define CONFIG_ADPCM_EA_DECODER 0
-%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
-%define CONFIG_ADPCM_EA_R1_DECODER 0
-%define CONFIG_ADPCM_EA_R2_DECODER 0
-%define CONFIG_ADPCM_EA_R3_DECODER 0
-%define CONFIG_ADPCM_EA_XAS_DECODER 0
-%define CONFIG_ADPCM_G722_DECODER 0
-%define CONFIG_ADPCM_G726_DECODER 0
-%define CONFIG_ADPCM_G726LE_DECODER 0
-%define CONFIG_ADPCM_IMA_AMV_DECODER 0
-%define CONFIG_ADPCM_IMA_APC_DECODER 0
-%define CONFIG_ADPCM_IMA_DK3_DECODER 0
-%define CONFIG_ADPCM_IMA_DK4_DECODER 0
-%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
-%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
-%define CONFIG_ADPCM_IMA_ISS_DECODER 0
-%define CONFIG_ADPCM_IMA_OKI_DECODER 0
-%define CONFIG_ADPCM_IMA_QT_DECODER 0
-%define CONFIG_ADPCM_IMA_RAD_DECODER 0
-%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
-%define CONFIG_ADPCM_IMA_WAV_DECODER 0
-%define CONFIG_ADPCM_IMA_WS_DECODER 0
-%define CONFIG_ADPCM_MS_DECODER 0
-%define CONFIG_ADPCM_SBPRO_2_DECODER 0
-%define CONFIG_ADPCM_SBPRO_3_DECODER 0
-%define CONFIG_ADPCM_SBPRO_4_DECODER 0
-%define CONFIG_ADPCM_SWF_DECODER 0
-%define CONFIG_ADPCM_THP_DECODER 0
-%define CONFIG_ADPCM_XA_DECODER 0
-%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
-%define CONFIG_SSA_DECODER 0
-%define CONFIG_ASS_DECODER 0
-%define CONFIG_DVBSUB_DECODER 0
-%define CONFIG_DVDSUB_DECODER 0
-%define CONFIG_JACOSUB_DECODER 0
-%define CONFIG_MICRODVD_DECODER 0
-%define CONFIG_MOVTEXT_DECODER 0
-%define CONFIG_MPL2_DECODER 0
-%define CONFIG_PGSSUB_DECODER 0
-%define CONFIG_PJS_DECODER 0
-%define CONFIG_REALTEXT_DECODER 0
-%define CONFIG_SAMI_DECODER 0
-%define CONFIG_SRT_DECODER 0
-%define CONFIG_SUBRIP_DECODER 0
-%define CONFIG_SUBVIEWER_DECODER 0
-%define CONFIG_SUBVIEWER1_DECODER 0
-%define CONFIG_TEXT_DECODER 0
-%define CONFIG_VPLAYER_DECODER 0
-%define CONFIG_WEBVTT_DECODER 0
-%define CONFIG_XSUB_DECODER 0
-%define CONFIG_LIBCELT_DECODER 0
-%define CONFIG_LIBFDK_AAC_DECODER 0
-%define CONFIG_LIBGSM_DECODER 0
-%define CONFIG_LIBGSM_MS_DECODER 0
-%define CONFIG_LIBILBC_DECODER 0
-%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
-%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
-%define CONFIG_LIBOPENJPEG_DECODER 0
-%define CONFIG_LIBOPUS_DECODER 0
-%define CONFIG_LIBSCHROEDINGER_DECODER 0
-%define CONFIG_LIBSPEEX_DECODER 0
-%define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
-%define CONFIG_LIBUTVIDEO_DECODER 0
-%define CONFIG_LIBVORBIS_DECODER 0
-%define CONFIG_LIBVPX_VP8_DECODER 0
-%define CONFIG_LIBVPX_VP9_DECODER 0
-%define CONFIG_LIBZVBI_TELETEXT_DECODER 0
-%define CONFIG_BINTEXT_DECODER 0
-%define CONFIG_XBIN_DECODER 0
-%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
-%define CONFIG_AC3_DEMUXER 0
-%define CONFIG_ACT_DEMUXER 0
-%define CONFIG_ADF_DEMUXER 0
-%define CONFIG_ADP_DEMUXER 0
-%define CONFIG_ADX_DEMUXER 0
-%define CONFIG_AEA_DEMUXER 0
-%define CONFIG_AFC_DEMUXER 0
-%define CONFIG_AIFF_DEMUXER 0
-%define CONFIG_AMR_DEMUXER 0
-%define CONFIG_ANM_DEMUXER 0
-%define CONFIG_APC_DEMUXER 0
-%define CONFIG_APE_DEMUXER 0
-%define CONFIG_AQTITLE_DEMUXER 0
-%define CONFIG_ASF_DEMUXER 0
-%define CONFIG_ASS_DEMUXER 0
-%define CONFIG_AST_DEMUXER 0
-%define CONFIG_AU_DEMUXER 0
-%define CONFIG_AVI_DEMUXER 0
-%define CONFIG_AVISYNTH_DEMUXER 0
-%define CONFIG_AVR_DEMUXER 0
-%define CONFIG_AVS_DEMUXER 0
-%define CONFIG_BETHSOFTVID_DEMUXER 0
-%define CONFIG_BFI_DEMUXER 0
-%define CONFIG_BINTEXT_DEMUXER 0
-%define CONFIG_BINK_DEMUXER 0
-%define CONFIG_BIT_DEMUXER 0
-%define CONFIG_BMV_DEMUXER 0
-%define CONFIG_BRSTM_DEMUXER 0
-%define CONFIG_BOA_DEMUXER 0
-%define CONFIG_C93_DEMUXER 0
-%define CONFIG_CAF_DEMUXER 0
-%define CONFIG_CAVSVIDEO_DEMUXER 0
-%define CONFIG_CDG_DEMUXER 0
-%define CONFIG_CDXL_DEMUXER 0
-%define CONFIG_CONCAT_DEMUXER 0
-%define CONFIG_DATA_DEMUXER 0
-%define CONFIG_DAUD_DEMUXER 0
-%define CONFIG_DFA_DEMUXER 0
-%define CONFIG_DIRAC_DEMUXER 0
-%define CONFIG_DNXHD_DEMUXER 0
-%define CONFIG_DSICIN_DEMUXER 0
-%define CONFIG_DTS_DEMUXER 0
-%define CONFIG_DTSHD_DEMUXER 0
-%define CONFIG_DV_DEMUXER 0
-%define CONFIG_DXA_DEMUXER 0
-%define CONFIG_EA_DEMUXER 0
-%define CONFIG_EA_CDATA_DEMUXER 0
-%define CONFIG_EAC3_DEMUXER 0
-%define CONFIG_EPAF_DEMUXER 0
-%define CONFIG_FFM_DEMUXER 0
-%define CONFIG_FFMETADATA_DEMUXER 0
-%define CONFIG_FILMSTRIP_DEMUXER 0
-%define CONFIG_FLAC_DEMUXER 0
-%define CONFIG_FLIC_DEMUXER 0
-%define CONFIG_FLV_DEMUXER 0
-%define CONFIG_FOURXM_DEMUXER 0
-%define CONFIG_FRM_DEMUXER 0
-%define CONFIG_G722_DEMUXER 0
-%define CONFIG_G723_1_DEMUXER 0
-%define CONFIG_G729_DEMUXER 0
-%define CONFIG_GIF_DEMUXER 0
-%define CONFIG_GSM_DEMUXER 0
-%define CONFIG_GXF_DEMUXER 0
-%define CONFIG_H261_DEMUXER 0
-%define CONFIG_H263_DEMUXER 0
-%define CONFIG_H264_DEMUXER 0
-%define CONFIG_HEVC_DEMUXER 0
-%define CONFIG_HLS_DEMUXER 0
-%define CONFIG_HNM_DEMUXER 0
-%define CONFIG_ICO_DEMUXER 0
-%define CONFIG_IDCIN_DEMUXER 0
-%define CONFIG_IDF_DEMUXER 0
-%define CONFIG_IFF_DEMUXER 0
-%define CONFIG_ILBC_DEMUXER 0
-%define CONFIG_IMAGE2_DEMUXER 0
-%define CONFIG_IMAGE2PIPE_DEMUXER 0
-%define CONFIG_INGENIENT_DEMUXER 0
-%define CONFIG_IPMOVIE_DEMUXER 0
-%define CONFIG_IRCAM_DEMUXER 0
-%define CONFIG_ISS_DEMUXER 0
-%define CONFIG_IV8_DEMUXER 0
-%define CONFIG_IVF_DEMUXER 0
-%define CONFIG_JACOSUB_DEMUXER 0
-%define CONFIG_JV_DEMUXER 0
-%define CONFIG_LATM_DEMUXER 0
-%define CONFIG_LMLM4_DEMUXER 0
-%define CONFIG_LOAS_DEMUXER 0
-%define CONFIG_LVF_DEMUXER 0
-%define CONFIG_LXF_DEMUXER 0
-%define CONFIG_M4V_DEMUXER 0
-%define CONFIG_MATROSKA_DEMUXER 1
-%define CONFIG_MGSTS_DEMUXER 0
-%define CONFIG_MICRODVD_DEMUXER 0
-%define CONFIG_MJPEG_DEMUXER 0
-%define CONFIG_MLP_DEMUXER 0
-%define CONFIG_MM_DEMUXER 0
-%define CONFIG_MMF_DEMUXER 0
-%define CONFIG_MOV_DEMUXER 0
-%define CONFIG_MP3_DEMUXER 0
-%define CONFIG_MPC_DEMUXER 0
-%define CONFIG_MPC8_DEMUXER 0
-%define CONFIG_MPEGPS_DEMUXER 0
-%define CONFIG_MPEGTS_DEMUXER 0
-%define CONFIG_MPEGTSRAW_DEMUXER 0
-%define CONFIG_MPEGVIDEO_DEMUXER 0
-%define CONFIG_MPL2_DEMUXER 0
-%define CONFIG_MPSUB_DEMUXER 0
-%define CONFIG_MSNWC_TCP_DEMUXER 0
-%define CONFIG_MTV_DEMUXER 0
-%define CONFIG_MV_DEMUXER 0
-%define CONFIG_MVI_DEMUXER 0
-%define CONFIG_MXF_DEMUXER 0
-%define CONFIG_MXG_DEMUXER 0
-%define CONFIG_NC_DEMUXER 0
-%define CONFIG_NISTSPHERE_DEMUXER 0
-%define CONFIG_NSV_DEMUXER 0
-%define CONFIG_NUT_DEMUXER 0
-%define CONFIG_NUV_DEMUXER 0
-%define CONFIG_OGG_DEMUXER 1
-%define CONFIG_OMA_DEMUXER 0
-%define CONFIG_PAF_DEMUXER 0
-%define CONFIG_PCM_ALAW_DEMUXER 0
-%define CONFIG_PCM_MULAW_DEMUXER 0
-%define CONFIG_PCM_F64BE_DEMUXER 0
-%define CONFIG_PCM_F64LE_DEMUXER 0
-%define CONFIG_PCM_F32BE_DEMUXER 0
-%define CONFIG_PCM_F32LE_DEMUXER 0
-%define CONFIG_PCM_S32BE_DEMUXER 0
-%define CONFIG_PCM_S32LE_DEMUXER 0
-%define CONFIG_PCM_S24BE_DEMUXER 0
-%define CONFIG_PCM_S24LE_DEMUXER 0
-%define CONFIG_PCM_S16BE_DEMUXER 0
-%define CONFIG_PCM_S16LE_DEMUXER 0
-%define CONFIG_PCM_S8_DEMUXER 0
-%define CONFIG_PCM_U32BE_DEMUXER 0
-%define CONFIG_PCM_U32LE_DEMUXER 0
-%define CONFIG_PCM_U24BE_DEMUXER 0
-%define CONFIG_PCM_U24LE_DEMUXER 0
-%define CONFIG_PCM_U16BE_DEMUXER 0
-%define CONFIG_PCM_U16LE_DEMUXER 0
-%define CONFIG_PCM_U8_DEMUXER 0
-%define CONFIG_PJS_DEMUXER 0
-%define CONFIG_PMP_DEMUXER 0
-%define CONFIG_PVA_DEMUXER 0
-%define CONFIG_PVF_DEMUXER 0
-%define CONFIG_QCP_DEMUXER 0
-%define CONFIG_R3D_DEMUXER 0
-%define CONFIG_RAWVIDEO_DEMUXER 0
-%define CONFIG_REALTEXT_DEMUXER 0
-%define CONFIG_REDSPARK_DEMUXER 0
-%define CONFIG_RL2_DEMUXER 0
-%define CONFIG_RM_DEMUXER 0
-%define CONFIG_ROQ_DEMUXER 0
-%define CONFIG_RPL_DEMUXER 0
-%define CONFIG_RSD_DEMUXER 0
-%define CONFIG_RSO_DEMUXER 0
-%define CONFIG_RTP_DEMUXER 0
-%define CONFIG_RTSP_DEMUXER 0
-%define CONFIG_SAMI_DEMUXER 0
-%define CONFIG_SAP_DEMUXER 0
-%define CONFIG_SBG_DEMUXER 0
-%define CONFIG_SDP_DEMUXER 0
-%define CONFIG_SEGAFILM_DEMUXER 0
-%define CONFIG_SHORTEN_DEMUXER 0
-%define CONFIG_SIFF_DEMUXER 0
-%define CONFIG_SMACKER_DEMUXER 0
-%define CONFIG_SMJPEG_DEMUXER 0
-%define CONFIG_SMUSH_DEMUXER 0
-%define CONFIG_SOL_DEMUXER 0
-%define CONFIG_SOX_DEMUXER 0
-%define CONFIG_SPDIF_DEMUXER 0
-%define CONFIG_SRT_DEMUXER 0
-%define CONFIG_STR_DEMUXER 0
-%define CONFIG_SUBVIEWER1_DEMUXER 0
-%define CONFIG_SUBVIEWER_DEMUXER 0
-%define CONFIG_SWF_DEMUXER 0
-%define CONFIG_TAK_DEMUXER 0
-%define CONFIG_TEDCAPTIONS_DEMUXER 0
-%define CONFIG_THP_DEMUXER 0
-%define CONFIG_TIERTEXSEQ_DEMUXER 0
-%define CONFIG_TMV_DEMUXER 0
-%define CONFIG_TRUEHD_DEMUXER 0
-%define CONFIG_TTA_DEMUXER 0
-%define CONFIG_TXD_DEMUXER 0
-%define CONFIG_TTY_DEMUXER 0
-%define CONFIG_VC1_DEMUXER 0
-%define CONFIG_VC1T_DEMUXER 0
-%define CONFIG_VIVO_DEMUXER 0
-%define CONFIG_VMD_DEMUXER 0
-%define CONFIG_VOBSUB_DEMUXER 0
-%define CONFIG_VOC_DEMUXER 0
-%define CONFIG_VPLAYER_DEMUXER 0
-%define CONFIG_VQF_DEMUXER 0
-%define CONFIG_W64_DEMUXER 0
-%define CONFIG_WAV_DEMUXER 1
-%define CONFIG_WC3_DEMUXER 0
-%define CONFIG_WEBVTT_DEMUXER 0
-%define CONFIG_WSAUD_DEMUXER 0
-%define CONFIG_WSVQA_DEMUXER 0
-%define CONFIG_WTV_DEMUXER 0
-%define CONFIG_WV_DEMUXER 0
-%define CONFIG_XA_DEMUXER 0
-%define CONFIG_XBIN_DEMUXER 0
-%define CONFIG_XMV_DEMUXER 0
-%define CONFIG_XWMA_DEMUXER 0
-%define CONFIG_YOP_DEMUXER 0
-%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
-%define CONFIG_LIBGME_DEMUXER 0
-%define CONFIG_LIBMODPLUG_DEMUXER 0
-%define CONFIG_LIBNUT_DEMUXER 0
-%define CONFIG_LIBQUVI_DEMUXER 0
-%define CONFIG_A64MULTI_ENCODER 0
-%define CONFIG_A64MULTI5_ENCODER 0
-%define CONFIG_AMV_ENCODER 0
-%define CONFIG_ASV1_ENCODER 0
-%define CONFIG_ASV2_ENCODER 0
-%define CONFIG_AVRP_ENCODER 0
-%define CONFIG_AVUI_ENCODER 0
-%define CONFIG_AYUV_ENCODER 0
-%define CONFIG_BMP_ENCODER 0
-%define CONFIG_CLJR_ENCODER 0
-%define CONFIG_COMFORTNOISE_ENCODER 0
-%define CONFIG_DNXHD_ENCODER 0
-%define CONFIG_DPX_ENCODER 0
-%define CONFIG_DVVIDEO_ENCODER 0
-%define CONFIG_FFV1_ENCODER 0
-%define CONFIG_FFVHUFF_ENCODER 0
-%define CONFIG_FLASHSV_ENCODER 0
-%define CONFIG_FLASHSV2_ENCODER 0
-%define CONFIG_FLV_ENCODER 0
-%define CONFIG_GIF_ENCODER 0
-%define CONFIG_H261_ENCODER 0
-%define CONFIG_H263_ENCODER 0
-%define CONFIG_H263P_ENCODER 0
-%define CONFIG_HUFFYUV_ENCODER 0
-%define CONFIG_JPEG2000_ENCODER 0
-%define CONFIG_JPEGLS_ENCODER 0
-%define CONFIG_LJPEG_ENCODER 0
-%define CONFIG_MJPEG_ENCODER 0
-%define CONFIG_MPEG1VIDEO_ENCODER 0
-%define CONFIG_MPEG2VIDEO_ENCODER 0
-%define CONFIG_MPEG4_ENCODER 0
-%define CONFIG_MSMPEG4V2_ENCODER 0
-%define CONFIG_MSMPEG4V3_ENCODER 0
-%define CONFIG_MSVIDEO1_ENCODER 0
-%define CONFIG_PAM_ENCODER 0
-%define CONFIG_PBM_ENCODER 0
-%define CONFIG_PCX_ENCODER 0
-%define CONFIG_PGM_ENCODER 0
-%define CONFIG_PGMYUV_ENCODER 0
-%define CONFIG_PNG_ENCODER 0
-%define CONFIG_PPM_ENCODER 0
-%define CONFIG_PRORES_ENCODER 0
-%define CONFIG_PRORES_AW_ENCODER 0
-%define CONFIG_PRORES_KS_ENCODER 0
-%define CONFIG_QTRLE_ENCODER 0
-%define CONFIG_R10K_ENCODER 0
-%define CONFIG_R210_ENCODER 0
-%define CONFIG_RAWVIDEO_ENCODER 0
-%define CONFIG_ROQ_ENCODER 0
-%define CONFIG_RV10_ENCODER 0
-%define CONFIG_RV20_ENCODER 0
-%define CONFIG_S302M_ENCODER 0
-%define CONFIG_SGI_ENCODER 0
-%define CONFIG_SNOW_ENCODER 0
-%define CONFIG_SUNRAST_ENCODER 0
-%define CONFIG_SVQ1_ENCODER 0
-%define CONFIG_TARGA_ENCODER 0
-%define CONFIG_TIFF_ENCODER 0
-%define CONFIG_UTVIDEO_ENCODER 0
-%define CONFIG_V210_ENCODER 0
-%define CONFIG_V308_ENCODER 0
-%define CONFIG_V408_ENCODER 0
-%define CONFIG_V410_ENCODER 0
-%define CONFIG_WMV1_ENCODER 0
-%define CONFIG_WMV2_ENCODER 0
-%define CONFIG_XBM_ENCODER 0
-%define CONFIG_XFACE_ENCODER 0
-%define CONFIG_XWD_ENCODER 0
-%define CONFIG_Y41P_ENCODER 0
-%define CONFIG_YUV4_ENCODER 0
-%define CONFIG_ZLIB_ENCODER 0
-%define CONFIG_ZMBV_ENCODER 0
-%define CONFIG_AAC_ENCODER 0
-%define CONFIG_AC3_ENCODER 0
-%define CONFIG_AC3_FIXED_ENCODER 0
-%define CONFIG_ALAC_ENCODER 0
-%define CONFIG_DCA_ENCODER 0
-%define CONFIG_EAC3_ENCODER 0
-%define CONFIG_FLAC_ENCODER 0
-%define CONFIG_G723_1_ENCODER 0
-%define CONFIG_MP2_ENCODER 0
-%define CONFIG_MP2FIXED_ENCODER 0
-%define CONFIG_NELLYMOSER_ENCODER 0
-%define CONFIG_RA_144_ENCODER 0
-%define CONFIG_SONIC_ENCODER 0
-%define CONFIG_SONIC_LS_ENCODER 0
-%define CONFIG_TTA_ENCODER 0
-%define CONFIG_VORBIS_ENCODER 0
-%define CONFIG_WAVPACK_ENCODER 0
-%define CONFIG_WMAV1_ENCODER 0
-%define CONFIG_WMAV2_ENCODER 0
-%define CONFIG_PCM_ALAW_ENCODER 0
-%define CONFIG_PCM_F32BE_ENCODER 0
-%define CONFIG_PCM_F32LE_ENCODER 0
-%define CONFIG_PCM_F64BE_ENCODER 0
-%define CONFIG_PCM_F64LE_ENCODER 0
-%define CONFIG_PCM_MULAW_ENCODER 0
-%define CONFIG_PCM_S8_ENCODER 0
-%define CONFIG_PCM_S8_PLANAR_ENCODER 0
-%define CONFIG_PCM_S16BE_ENCODER 0
-%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S16LE_ENCODER 0
-%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S24BE_ENCODER 0
-%define CONFIG_PCM_S24DAUD_ENCODER 0
-%define CONFIG_PCM_S24LE_ENCODER 0
-%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S32BE_ENCODER 0
-%define CONFIG_PCM_S32LE_ENCODER 0
-%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_U8_ENCODER 0
-%define CONFIG_PCM_U16BE_ENCODER 0
-%define CONFIG_PCM_U16LE_ENCODER 0
-%define CONFIG_PCM_U24BE_ENCODER 0
-%define CONFIG_PCM_U24LE_ENCODER 0
-%define CONFIG_PCM_U32BE_ENCODER 0
-%define CONFIG_PCM_U32LE_ENCODER 0
-%define CONFIG_ROQ_DPCM_ENCODER 0
-%define CONFIG_ADPCM_ADX_ENCODER 0
-%define CONFIG_ADPCM_G722_ENCODER 0
-%define CONFIG_ADPCM_G726_ENCODER 0
-%define CONFIG_ADPCM_IMA_QT_ENCODER 0
-%define CONFIG_ADPCM_IMA_WAV_ENCODER 0
-%define CONFIG_ADPCM_MS_ENCODER 0
-%define CONFIG_ADPCM_SWF_ENCODER 0
-%define CONFIG_ADPCM_YAMAHA_ENCODER 0
-%define CONFIG_SSA_ENCODER 0
-%define CONFIG_ASS_ENCODER 0
-%define CONFIG_DVBSUB_ENCODER 0
-%define CONFIG_DVDSUB_ENCODER 0
-%define CONFIG_MOVTEXT_ENCODER 0
-%define CONFIG_SRT_ENCODER 0
-%define CONFIG_SUBRIP_ENCODER 0
-%define CONFIG_XSUB_ENCODER 0
-%define CONFIG_LIBFAAC_ENCODER 0
-%define CONFIG_LIBFDK_AAC_ENCODER 0
-%define CONFIG_LIBGSM_ENCODER 0
-%define CONFIG_LIBGSM_MS_ENCODER 0
-%define CONFIG_LIBILBC_ENCODER 0
-%define CONFIG_LIBMP3LAME_ENCODER 0
-%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
-%define CONFIG_LIBOPENJPEG_ENCODER 0
-%define CONFIG_LIBOPUS_ENCODER 0
-%define CONFIG_LIBSCHROEDINGER_ENCODER 0
-%define CONFIG_LIBSHINE_ENCODER 0
-%define CONFIG_LIBSPEEX_ENCODER 0
-%define CONFIG_LIBTHEORA_ENCODER 0
-%define CONFIG_LIBTWOLAME_ENCODER 0
-%define CONFIG_LIBUTVIDEO_ENCODER 0
-%define CONFIG_LIBVO_AACENC_ENCODER 0
-%define CONFIG_LIBVO_AMRWBENC_ENCODER 0
-%define CONFIG_LIBVORBIS_ENCODER 0
-%define CONFIG_LIBVPX_VP8_ENCODER 0
-%define CONFIG_LIBVPX_VP9_ENCODER 0
-%define CONFIG_LIBWAVPACK_ENCODER 0
-%define CONFIG_LIBX264_ENCODER 0
-%define CONFIG_LIBX264RGB_ENCODER 0
-%define CONFIG_LIBXAVS_ENCODER 0
-%define CONFIG_LIBXVID_ENCODER 0
-%define CONFIG_LIBAACPLUS_ENCODER 0
-%define CONFIG_ACONVERT_FILTER 0
-%define CONFIG_ADELAY_FILTER 0
-%define CONFIG_AECHO_FILTER 0
-%define CONFIG_AEVAL_FILTER 0
-%define CONFIG_AFADE_FILTER 0
-%define CONFIG_AFORMAT_FILTER 0
-%define CONFIG_AINTERLEAVE_FILTER 0
-%define CONFIG_ALLPASS_FILTER 0
-%define CONFIG_AMERGE_FILTER 0
-%define CONFIG_AMIX_FILTER 0
-%define CONFIG_ANULL_FILTER 0
-%define CONFIG_APAD_FILTER 0
-%define CONFIG_APERMS_FILTER 0
-%define CONFIG_APHASER_FILTER 0
-%define CONFIG_ARESAMPLE_FILTER 0
-%define CONFIG_ASELECT_FILTER 0
-%define CONFIG_ASENDCMD_FILTER 0
-%define CONFIG_ASETNSAMPLES_FILTER 0
-%define CONFIG_ASETPTS_FILTER 0
-%define CONFIG_ASETRATE_FILTER 0
-%define CONFIG_ASETTB_FILTER 0
-%define CONFIG_ASHOWINFO_FILTER 0
-%define CONFIG_ASPLIT_FILTER 0
-%define CONFIG_ASTATS_FILTER 0
-%define CONFIG_ASTREAMSYNC_FILTER 0
-%define CONFIG_ASYNCTS_FILTER 0
-%define CONFIG_ATEMPO_FILTER 0
-%define CONFIG_ATRIM_FILTER 0
-%define CONFIG_AZMQ_FILTER 0
-%define CONFIG_BANDPASS_FILTER 0
-%define CONFIG_BANDREJECT_FILTER 0
-%define CONFIG_BASS_FILTER 0
-%define CONFIG_BIQUAD_FILTER 0
-%define CONFIG_CHANNELMAP_FILTER 0
-%define CONFIG_CHANNELSPLIT_FILTER 0
-%define CONFIG_COMPAND_FILTER 0
-%define CONFIG_EARWAX_FILTER 0
-%define CONFIG_EBUR128_FILTER 0
-%define CONFIG_EQUALIZER_FILTER 0
-%define CONFIG_HIGHPASS_FILTER 0
-%define CONFIG_JOIN_FILTER 0
-%define CONFIG_LADSPA_FILTER 0
-%define CONFIG_LOWPASS_FILTER 0
-%define CONFIG_PAN_FILTER 0
-%define CONFIG_REPLAYGAIN_FILTER 0
-%define CONFIG_RESAMPLE_FILTER 0
-%define CONFIG_SILENCEDETECT_FILTER 0
-%define CONFIG_TREBLE_FILTER 0
-%define CONFIG_VOLUME_FILTER 0
-%define CONFIG_VOLUMEDETECT_FILTER 0
-%define CONFIG_AEVALSRC_FILTER 0
-%define CONFIG_ANULLSRC_FILTER 0
-%define CONFIG_FLITE_FILTER 0
-%define CONFIG_SINE_FILTER 0
-%define CONFIG_ANULLSINK_FILTER 0
-%define CONFIG_ALPHAEXTRACT_FILTER 0
-%define CONFIG_ALPHAMERGE_FILTER 0
-%define CONFIG_ASS_FILTER 0
-%define CONFIG_BBOX_FILTER 0
-%define CONFIG_BLACKDETECT_FILTER 0
-%define CONFIG_BLACKFRAME_FILTER 0
-%define CONFIG_BLEND_FILTER 0
-%define CONFIG_BOXBLUR_FILTER 0
-%define CONFIG_COLORBALANCE_FILTER 0
-%define CONFIG_COLORCHANNELMIXER_FILTER 0
-%define CONFIG_COLORMATRIX_FILTER 0
-%define CONFIG_COPY_FILTER 0
-%define CONFIG_CROP_FILTER 0
-%define CONFIG_CROPDETECT_FILTER 0
-%define CONFIG_CURVES_FILTER 0
-%define CONFIG_DCTDNOIZ_FILTER 0
-%define CONFIG_DECIMATE_FILTER 0
-%define CONFIG_DELOGO_FILTER 0
-%define CONFIG_DESHAKE_FILTER 0
-%define CONFIG_DRAWBOX_FILTER 0
-%define CONFIG_DRAWGRID_FILTER 0
-%define CONFIG_DRAWTEXT_FILTER 0
-%define CONFIG_EDGEDETECT_FILTER 0
-%define CONFIG_ELBG_FILTER 0
-%define CONFIG_EXTRACTPLANES_FILTER 0
-%define CONFIG_FADE_FILTER 0
-%define CONFIG_FIELD_FILTER 0
-%define CONFIG_FIELDMATCH_FILTER 0
-%define CONFIG_FIELDORDER_FILTER 0
-%define CONFIG_FORMAT_FILTER 0
-%define CONFIG_FPS_FILTER 0
-%define CONFIG_FRAMESTEP_FILTER 0
-%define CONFIG_FREI0R_FILTER 0
-%define CONFIG_GEQ_FILTER 0
-%define CONFIG_GRADFUN_FILTER 0
-%define CONFIG_HALDCLUT_FILTER 0
-%define CONFIG_HFLIP_FILTER 0
-%define CONFIG_HISTEQ_FILTER 0
-%define CONFIG_HISTOGRAM_FILTER 0
-%define CONFIG_HQDN3D_FILTER 0
-%define CONFIG_HUE_FILTER 0
-%define CONFIG_IDET_FILTER 0
-%define CONFIG_IL_FILTER 0
-%define CONFIG_INTERLACE_FILTER 0
-%define CONFIG_INTERLEAVE_FILTER 0
-%define CONFIG_KERNDEINT_FILTER 0
-%define CONFIG_LUT3D_FILTER 0
-%define CONFIG_LUT_FILTER 0
-%define CONFIG_LUTRGB_FILTER 0
-%define CONFIG_LUTYUV_FILTER 0
-%define CONFIG_MCDEINT_FILTER 0
-%define CONFIG_MERGEPLANES_FILTER 0
-%define CONFIG_MP_FILTER 0
-%define CONFIG_MPDECIMATE_FILTER 0
-%define CONFIG_NEGATE_FILTER 0
-%define CONFIG_NOFORMAT_FILTER 0
-%define CONFIG_NOISE_FILTER 0
-%define CONFIG_NULL_FILTER 0
-%define CONFIG_OCV_FILTER 0
-%define CONFIG_OVERLAY_FILTER 0
-%define CONFIG_OWDENOISE_FILTER 0
-%define CONFIG_PAD_FILTER 0
-%define CONFIG_PERMS_FILTER 0
-%define CONFIG_PERSPECTIVE_FILTER 0
-%define CONFIG_PHASE_FILTER 0
-%define CONFIG_PIXDESCTEST_FILTER 0
-%define CONFIG_PP_FILTER 0
-%define CONFIG_PSNR_FILTER 0
-%define CONFIG_PULLUP_FILTER 0
-%define CONFIG_REMOVELOGO_FILTER 0
-%define CONFIG_ROTATE_FILTER 0
-%define CONFIG_SAB_FILTER 0
-%define CONFIG_SCALE_FILTER 0
-%define CONFIG_SELECT_FILTER 0
-%define CONFIG_SENDCMD_FILTER 0
-%define CONFIG_SEPARATEFIELDS_FILTER 0
-%define CONFIG_SETDAR_FILTER 0
-%define CONFIG_SETFIELD_FILTER 0
-%define CONFIG_SETPTS_FILTER 0
-%define CONFIG_SETSAR_FILTER 0
-%define CONFIG_SETTB_FILTER 0
-%define CONFIG_SHOWINFO_FILTER 0
-%define CONFIG_SMARTBLUR_FILTER 0
-%define CONFIG_SPLIT_FILTER 0
-%define CONFIG_SPP_FILTER 0
-%define CONFIG_STEREO3D_FILTER 0
-%define CONFIG_SUBTITLES_FILTER 0
-%define CONFIG_SUPER2XSAI_FILTER 0
-%define CONFIG_SWAPUV_FILTER 0
-%define CONFIG_TELECINE_FILTER 0
-%define CONFIG_THUMBNAIL_FILTER 0
-%define CONFIG_TILE_FILTER 0
-%define CONFIG_TINTERLACE_FILTER 0
-%define CONFIG_TRANSPOSE_FILTER 0
-%define CONFIG_TRIM_FILTER 0
-%define CONFIG_UNSHARP_FILTER 0
-%define CONFIG_VFLIP_FILTER 0
-%define CONFIG_VIDSTABDETECT_FILTER 0
-%define CONFIG_VIDSTABTRANSFORM_FILTER 0
-%define CONFIG_VIGNETTE_FILTER 0
-%define CONFIG_W3FDIF_FILTER 0
-%define CONFIG_YADIF_FILTER 0
-%define CONFIG_ZMQ_FILTER 0
-%define CONFIG_CELLAUTO_FILTER 0
-%define CONFIG_COLOR_FILTER 0
-%define CONFIG_FREI0R_SRC_FILTER 0
-%define CONFIG_HALDCLUTSRC_FILTER 0
-%define CONFIG_LIFE_FILTER 0
-%define CONFIG_MANDELBROT_FILTER 0
-%define CONFIG_MPTESTSRC_FILTER 0
-%define CONFIG_NULLSRC_FILTER 0
-%define CONFIG_RGBTESTSRC_FILTER 0
-%define CONFIG_SMPTEBARS_FILTER 0
-%define CONFIG_SMPTEHDBARS_FILTER 0
-%define CONFIG_TESTSRC_FILTER 0
-%define CONFIG_NULLSINK_FILTER 0
-%define CONFIG_AVECTORSCOPE_FILTER 0
-%define CONFIG_CONCAT_FILTER 0
-%define CONFIG_SHOWSPECTRUM_FILTER 0
-%define CONFIG_SHOWWAVES_FILTER 0
-%define CONFIG_AMOVIE_FILTER 0
-%define CONFIG_MOVIE_FILTER 0
-%define CONFIG_H263_VAAPI_HWACCEL 0
-%define CONFIG_H263_VDPAU_HWACCEL 0
-%define CONFIG_H264_DXVA2_HWACCEL 0
-%define CONFIG_H264_VAAPI_HWACCEL 0
-%define CONFIG_H264_VDA_HWACCEL 0
-%define CONFIG_H264_VDPAU_HWACCEL 0
-%define CONFIG_MPEG1_VDPAU_HWACCEL 0
-%define CONFIG_MPEG2_DXVA2_HWACCEL 0
-%define CONFIG_MPEG2_VAAPI_HWACCEL 0
-%define CONFIG_MPEG2_VDPAU_HWACCEL 0
-%define CONFIG_MPEG4_VAAPI_HWACCEL 0
-%define CONFIG_MPEG4_VDPAU_HWACCEL 0
-%define CONFIG_VC1_DXVA2_HWACCEL 0
-%define CONFIG_VC1_VAAPI_HWACCEL 0
-%define CONFIG_VC1_VDPAU_HWACCEL 0
-%define CONFIG_WMV3_DXVA2_HWACCEL 0
-%define CONFIG_WMV3_VAAPI_HWACCEL 0
-%define CONFIG_WMV3_VDPAU_HWACCEL 0
-%define CONFIG_ALSA_INDEV 0
-%define CONFIG_BKTR_INDEV 0
-%define CONFIG_DSHOW_INDEV 0
-%define CONFIG_DV1394_INDEV 0
-%define CONFIG_FBDEV_INDEV 0
-%define CONFIG_IEC61883_INDEV 0
-%define CONFIG_JACK_INDEV 0
-%define CONFIG_LAVFI_INDEV 0
-%define CONFIG_OPENAL_INDEV 0
-%define CONFIG_OSS_INDEV 0
-%define CONFIG_PULSE_INDEV 0
-%define CONFIG_SNDIO_INDEV 0
-%define CONFIG_V4L2_INDEV 0
-%define CONFIG_VFWCAP_INDEV 0
-%define CONFIG_X11GRAB_INDEV 0
-%define CONFIG_LIBCDIO_INDEV 0
-%define CONFIG_LIBDC1394_INDEV 0
-%define CONFIG_A64_MUXER 0
-%define CONFIG_AC3_MUXER 0
-%define CONFIG_ADTS_MUXER 0
-%define CONFIG_ADX_MUXER 0
-%define CONFIG_AIFF_MUXER 0
-%define CONFIG_AMR_MUXER 0
-%define CONFIG_ASF_MUXER 0
-%define CONFIG_ASS_MUXER 0
-%define CONFIG_AST_MUXER 0
-%define CONFIG_ASF_STREAM_MUXER 0
-%define CONFIG_AU_MUXER 0
-%define CONFIG_AVI_MUXER 0
-%define CONFIG_AVM2_MUXER 0
-%define CONFIG_BIT_MUXER 0
-%define CONFIG_CAF_MUXER 0
-%define CONFIG_CAVSVIDEO_MUXER 0
-%define CONFIG_CRC_MUXER 0
-%define CONFIG_DATA_MUXER 0
-%define CONFIG_DAUD_MUXER 0
-%define CONFIG_DIRAC_MUXER 0
-%define CONFIG_DNXHD_MUXER 0
-%define CONFIG_DTS_MUXER 0
-%define CONFIG_DV_MUXER 0
-%define CONFIG_EAC3_MUXER 0
-%define CONFIG_F4V_MUXER 0
-%define CONFIG_FFM_MUXER 0
-%define CONFIG_FFMETADATA_MUXER 0
-%define CONFIG_FILMSTRIP_MUXER 0
-%define CONFIG_FLAC_MUXER 0
-%define CONFIG_FLV_MUXER 0
-%define CONFIG_FRAMECRC_MUXER 0
-%define CONFIG_FRAMEMD5_MUXER 0
-%define CONFIG_G722_MUXER 0
-%define CONFIG_G723_1_MUXER 0
-%define CONFIG_GIF_MUXER 0
-%define CONFIG_GXF_MUXER 0
-%define CONFIG_H261_MUXER 0
-%define CONFIG_H263_MUXER 0
-%define CONFIG_H264_MUXER 0
-%define CONFIG_HDS_MUXER 0
-%define CONFIG_HLS_MUXER 0
-%define CONFIG_ICO_MUXER 0
-%define CONFIG_ILBC_MUXER 0
-%define CONFIG_IMAGE2_MUXER 0
-%define CONFIG_IMAGE2PIPE_MUXER 0
-%define CONFIG_IPOD_MUXER 0
-%define CONFIG_IRCAM_MUXER 0
-%define CONFIG_ISMV_MUXER 0
-%define CONFIG_IVF_MUXER 0
-%define CONFIG_JACOSUB_MUXER 0
-%define CONFIG_LATM_MUXER 0
-%define CONFIG_M4V_MUXER 0
-%define CONFIG_MD5_MUXER 0
-%define CONFIG_MATROSKA_MUXER 0
-%define CONFIG_MATROSKA_AUDIO_MUXER 0
-%define CONFIG_MICRODVD_MUXER 0
-%define CONFIG_MJPEG_MUXER 0
-%define CONFIG_MLP_MUXER 0
-%define CONFIG_MMF_MUXER 0
-%define CONFIG_MOV_MUXER 0
-%define CONFIG_MP2_MUXER 0
-%define CONFIG_MP3_MUXER 0
-%define CONFIG_MP4_MUXER 0
-%define CONFIG_MPEG1SYSTEM_MUXER 0
-%define CONFIG_MPEG1VCD_MUXER 0
-%define CONFIG_MPEG1VIDEO_MUXER 0
-%define CONFIG_MPEG2DVD_MUXER 0
-%define CONFIG_MPEG2SVCD_MUXER 0
-%define CONFIG_MPEG2VIDEO_MUXER 0
-%define CONFIG_MPEG2VOB_MUXER 0
-%define CONFIG_MPEGTS_MUXER 0
-%define CONFIG_MPJPEG_MUXER 0
-%define CONFIG_MXF_MUXER 0
-%define CONFIG_MXF_D10_MUXER 0
-%define CONFIG_NULL_MUXER 0
-%define CONFIG_NUT_MUXER 0
-%define CONFIG_OGG_MUXER 0
-%define CONFIG_OMA_MUXER 0
-%define CONFIG_OPUS_MUXER 0
-%define CONFIG_PCM_ALAW_MUXER 0
-%define CONFIG_PCM_MULAW_MUXER 0
-%define CONFIG_PCM_F64BE_MUXER 0
-%define CONFIG_PCM_F64LE_MUXER 0
-%define CONFIG_PCM_F32BE_MUXER 0
-%define CONFIG_PCM_F32LE_MUXER 0
-%define CONFIG_PCM_S32BE_MUXER 0
-%define CONFIG_PCM_S32LE_MUXER 0
-%define CONFIG_PCM_S24BE_MUXER 0
-%define CONFIG_PCM_S24LE_MUXER 0
-%define CONFIG_PCM_S16BE_MUXER 0
-%define CONFIG_PCM_S16LE_MUXER 0
-%define CONFIG_PCM_S8_MUXER 0
-%define CONFIG_PCM_U32BE_MUXER 0
-%define CONFIG_PCM_U32LE_MUXER 0
-%define CONFIG_PCM_U24BE_MUXER 0
-%define CONFIG_PCM_U24LE_MUXER 0
-%define CONFIG_PCM_U16BE_MUXER 0
-%define CONFIG_PCM_U16LE_MUXER 0
-%define CONFIG_PCM_U8_MUXER 0
-%define CONFIG_PSP_MUXER 0
-%define CONFIG_RAWVIDEO_MUXER 0
-%define CONFIG_RM_MUXER 0
-%define CONFIG_ROQ_MUXER 0
-%define CONFIG_RSO_MUXER 0
-%define CONFIG_RTP_MUXER 0
-%define CONFIG_RTSP_MUXER 0
-%define CONFIG_SAP_MUXER 0
-%define CONFIG_SEGMENT_MUXER 0
-%define CONFIG_STREAM_SEGMENT_MUXER 0
-%define CONFIG_SMJPEG_MUXER 0
-%define CONFIG_SMOOTHSTREAMING_MUXER 0
-%define CONFIG_SOX_MUXER 0
-%define CONFIG_SPDIF_MUXER 0
-%define CONFIG_SPEEX_MUXER 0
-%define CONFIG_SRT_MUXER 0
-%define CONFIG_SWF_MUXER 0
-%define CONFIG_TEE_MUXER 0
-%define CONFIG_TG2_MUXER 0
-%define CONFIG_TGP_MUXER 0
-%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
-%define CONFIG_TRUEHD_MUXER 0
-%define CONFIG_VC1_MUXER 0
-%define CONFIG_VC1T_MUXER 0
-%define CONFIG_VOC_MUXER 0
-%define CONFIG_W64_MUXER 0
-%define CONFIG_WAV_MUXER 0
-%define CONFIG_WEBM_MUXER 0
-%define CONFIG_WEBVTT_MUXER 0
-%define CONFIG_WTV_MUXER 0
-%define CONFIG_WV_MUXER 0
-%define CONFIG_YUV4MPEGPIPE_MUXER 0
-%define CONFIG_LIBNUT_MUXER 0
-%define CONFIG_ALSA_OUTDEV 0
-%define CONFIG_CACA_OUTDEV 0
-%define CONFIG_FBDEV_OUTDEV 0
-%define CONFIG_OSS_OUTDEV 0
-%define CONFIG_PULSE_OUTDEV 0
-%define CONFIG_SDL_OUTDEV 0
-%define CONFIG_SNDIO_OUTDEV 0
-%define CONFIG_V4L2_OUTDEV 0
-%define CONFIG_XV_OUTDEV 0
-%define CONFIG_AAC_PARSER 0
-%define CONFIG_AAC_LATM_PARSER 0
-%define CONFIG_AC3_PARSER 0
-%define CONFIG_ADX_PARSER 0
-%define CONFIG_BMP_PARSER 0
-%define CONFIG_CAVSVIDEO_PARSER 0
-%define CONFIG_COOK_PARSER 0
-%define CONFIG_DCA_PARSER 0
-%define CONFIG_DIRAC_PARSER 0
-%define CONFIG_DNXHD_PARSER 0
-%define CONFIG_DPX_PARSER 0
-%define CONFIG_DVBSUB_PARSER 0
-%define CONFIG_DVDSUB_PARSER 0
-%define CONFIG_DVD_NAV_PARSER 0
-%define CONFIG_FLAC_PARSER 0
-%define CONFIG_GSM_PARSER 0
-%define CONFIG_H261_PARSER 0
-%define CONFIG_H263_PARSER 0
-%define CONFIG_H264_PARSER 0
-%define CONFIG_HEVC_PARSER 0
-%define CONFIG_MJPEG_PARSER 0
-%define CONFIG_MLP_PARSER 0
-%define CONFIG_MPEG4VIDEO_PARSER 0
-%define CONFIG_MPEGAUDIO_PARSER 0
-%define CONFIG_MPEGVIDEO_PARSER 0
-%define CONFIG_PNG_PARSER 0
-%define CONFIG_PNM_PARSER 0
-%define CONFIG_RV30_PARSER 0
-%define CONFIG_RV40_PARSER 0
-%define CONFIG_TAK_PARSER 0
-%define CONFIG_VC1_PARSER 0
-%define CONFIG_VORBIS_PARSER 1
-%define CONFIG_VP3_PARSER 1
-%define CONFIG_VP8_PARSER 1
-%define CONFIG_VP9_PARSER 0
-%define CONFIG_BLURAY_PROTOCOL 0
-%define CONFIG_CACHE_PROTOCOL 0
-%define CONFIG_CONCAT_PROTOCOL 0
-%define CONFIG_CRYPTO_PROTOCOL 0
-%define CONFIG_DATA_PROTOCOL 0
-%define CONFIG_FFRTMPCRYPT_PROTOCOL 0
-%define CONFIG_FFRTMPHTTP_PROTOCOL 0
-%define CONFIG_FILE_PROTOCOL 0
-%define CONFIG_FTP_PROTOCOL 0
-%define CONFIG_GOPHER_PROTOCOL 0
-%define CONFIG_HLS_PROTOCOL 0
-%define CONFIG_HTTP_PROTOCOL 0
-%define CONFIG_HTTPPROXY_PROTOCOL 0
-%define CONFIG_HTTPS_PROTOCOL 0
-%define CONFIG_MMSH_PROTOCOL 0
-%define CONFIG_MMST_PROTOCOL 0
-%define CONFIG_MD5_PROTOCOL 0
-%define CONFIG_PIPE_PROTOCOL 0
-%define CONFIG_RTMP_PROTOCOL 0
-%define CONFIG_RTMPE_PROTOCOL 0
-%define CONFIG_RTMPS_PROTOCOL 0
-%define CONFIG_RTMPT_PROTOCOL 0
-%define CONFIG_RTMPTE_PROTOCOL 0
-%define CONFIG_RTMPTS_PROTOCOL 0
-%define CONFIG_RTP_PROTOCOL 0
-%define CONFIG_SCTP_PROTOCOL 0
-%define CONFIG_SRTP_PROTOCOL 0
-%define CONFIG_TCP_PROTOCOL 0
-%define CONFIG_TLS_PROTOCOL 0
-%define CONFIG_UDP_PROTOCOL 0
-%define CONFIG_UNIX_PROTOCOL 0
-%define CONFIG_LIBRTMP_PROTOCOL 0
-%define CONFIG_LIBRTMPE_PROTOCOL 0
-%define CONFIG_LIBRTMPS_PROTOCOL 0
-%define CONFIG_LIBRTMPT_PROTOCOL 0
-%define CONFIG_LIBRTMPTE_PROTOCOL 0
-%define CONFIG_LIBSSH_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/config.asm
deleted file mode 100644
index d7bac54c3a4..00000000000
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/config.asm
+++ /dev/null
@@ -1,1645 +0,0 @@
-%define ARCH_AARCH64 0
-%define ARCH_ALPHA 0
-%define ARCH_ARM 0
-%define ARCH_AVR32 0
-%define ARCH_AVR32_AP 0
-%define ARCH_AVR32_UC 0
-%define ARCH_BFIN 0
-%define ARCH_IA64 0
-%define ARCH_M68K 0
-%define ARCH_MIPS 0
-%define ARCH_MIPS64 0
-%define ARCH_PARISC 0
-%define ARCH_PPC 0
-%define ARCH_PPC64 0
-%define ARCH_S390 0
-%define ARCH_SH4 0
-%define ARCH_SPARC 0
-%define ARCH_SPARC64 0
-%define ARCH_TILEGX 0
-%define ARCH_TILEPRO 0
-%define ARCH_TOMI 0
-%define ARCH_X86 1
-%define ARCH_X86_32 0
-%define ARCH_X86_64 1
-%define HAVE_ARMV5TE 0
-%define HAVE_ARMV6 0
-%define HAVE_ARMV6T2 0
-%define HAVE_NEON 0
-%define HAVE_VFP 0
-%define HAVE_VFPV3 0
-%define HAVE_AMD3DNOW 1
-%define HAVE_AMD3DNOWEXT 1
-%define HAVE_AVX 1
-%define HAVE_AVX2 1
-%define HAVE_FMA4 1
-%define HAVE_I686 1
-%define HAVE_MMX 1
-%define HAVE_MMXEXT 1
-%define HAVE_SSE 1
-%define HAVE_SSE2 1
-%define HAVE_SSE3 1
-%define HAVE_SSE4 1
-%define HAVE_SSE42 1
-%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
-%define HAVE_MIPSFPU 0
-%define HAVE_MIPS32R2 0
-%define HAVE_MIPSDSPR1 0
-%define HAVE_MIPSDSPR2 0
-%define HAVE_ARMV5TE_EXTERNAL 0
-%define HAVE_ARMV6_EXTERNAL 0
-%define HAVE_ARMV6T2_EXTERNAL 0
-%define HAVE_NEON_EXTERNAL 0
-%define HAVE_VFP_EXTERNAL 0
-%define HAVE_VFPV3_EXTERNAL 0
-%define HAVE_AMD3DNOW_EXTERNAL 1
-%define HAVE_AMD3DNOWEXT_EXTERNAL 1
-%define HAVE_AVX_EXTERNAL 1
-%define HAVE_AVX2_EXTERNAL 1
-%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
-%define HAVE_MMX_EXTERNAL 1
-%define HAVE_MMXEXT_EXTERNAL 1
-%define HAVE_SSE_EXTERNAL 1
-%define HAVE_SSE2_EXTERNAL 1
-%define HAVE_SSE3_EXTERNAL 1
-%define HAVE_SSE4_EXTERNAL 1
-%define HAVE_SSE42_EXTERNAL 1
-%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
-%define HAVE_MIPSFPU_EXTERNAL 0
-%define HAVE_MIPS32R2_EXTERNAL 0
-%define HAVE_MIPSDSPR1_EXTERNAL 0
-%define HAVE_MIPSDSPR2_EXTERNAL 0
-%define HAVE_ARMV5TE_INLINE 0
-%define HAVE_ARMV6_INLINE 0
-%define HAVE_ARMV6T2_INLINE 0
-%define HAVE_NEON_INLINE 0
-%define HAVE_VFP_INLINE 0
-%define HAVE_VFPV3_INLINE 0
-%define HAVE_AMD3DNOW_INLINE 0
-%define HAVE_AMD3DNOWEXT_INLINE 0
-%define HAVE_AVX_INLINE 0
-%define HAVE_AVX2_INLINE 0
-%define HAVE_FMA4_INLINE 0
-%define HAVE_I686_INLINE 0
-%define HAVE_MMX_INLINE 0
-%define HAVE_MMXEXT_INLINE 0
-%define HAVE_SSE_INLINE 0
-%define HAVE_SSE2_INLINE 0
-%define HAVE_SSE3_INLINE 0
-%define HAVE_SSE4_INLINE 0
-%define HAVE_SSE42_INLINE 0
-%define HAVE_SSSE3_INLINE 0
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
-%define HAVE_MIPSFPU_INLINE 0
-%define HAVE_MIPS32R2_INLINE 0
-%define HAVE_MIPSDSPR1_INLINE 0
-%define HAVE_MIPSDSPR2_INLINE 0
-%define HAVE_INLINE_ASM 0
-%define HAVE_SYMVER 0
-%define HAVE_YASM 1
-%define HAVE_BIGENDIAN 0
-%define HAVE_FAST_UNALIGNED 1
-%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 0
-%define HAVE_W32THREADS 1
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 0
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 1
-%define HAVE_ATANF 1
-%define HAVE_ATAN2F 1
-%define HAVE_CBRT 1
-%define HAVE_CBRTF 1
-%define HAVE_COSF 1
-%define HAVE_EXP2 1
-%define HAVE_EXP2F 1
-%define HAVE_EXPF 1
-%define HAVE_ISINF 1
-%define HAVE_ISNAN 1
-%define HAVE_LDEXPF 1
-%define HAVE_LLRINT 1
-%define HAVE_LLRINTF 1
-%define HAVE_LOG2 0
-%define HAVE_LOG2F 1
-%define HAVE_LOG10F 1
-%define HAVE_LRINT 1
-%define HAVE_LRINTF 1
-%define HAVE_POWF 1
-%define HAVE_RINT 1
-%define HAVE_ROUND 1
-%define HAVE_ROUNDF 1
-%define HAVE_SINF 1
-%define HAVE_TRUNC 1
-%define HAVE_TRUNCF 1
-%define HAVE_ACCESS 1
-%define HAVE_ALIGNED_MALLOC 1
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 0
-%define HAVE_ATTRIBUTE_PACKED 0
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
-%define HAVE_CLOCK_GETTIME 0
-%define HAVE_CLOSESOCKET 0
-%define HAVE_COMMANDLINETOARGVW 1
-%define HAVE_CPUNOP 1
-%define HAVE_CRYPTGENRANDOM 1
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 1
-%define HAVE_DLFCN_H 0
-%define HAVE_DLOPEN 0
-%define HAVE_DOS_PATHS 1
-%define HAVE_DXVA_H 1
-%define HAVE_EBP_AVAILABLE 0
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 1
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 1
-%define HAVE_FCNTL 0
-%define HAVE_FORK 0
-%define HAVE_GETADDRINFO 0
-%define HAVE_GETHRTIME 0
-%define HAVE_GETOPT 0
-%define HAVE_GETPROCESSAFFINITYMASK 1
-%define HAVE_GETPROCESSMEMORYINFO 1
-%define HAVE_GETPROCESSTIMES 1
-%define HAVE_GETSYSTEMTIMEASFILETIME 1
-%define HAVE_GETRUSAGE 0
-%define HAVE_GETSERVBYPORT 0
-%define HAVE_GETTIMEOFDAY 0
-%define HAVE_GLOB 0
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 0
-%define HAVE_IO_H 1
-%define HAVE_INLINE_ASM_LABELS 0
-%define HAVE_ISATTY 1
-%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
-%define HAVE_KBHIT 1
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 1
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
-%define HAVE_LOCALTIME_R 0
-%define HAVE_LOONGSON 0
-%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 1
-%define HAVE_MAPVIEWOFFILE 1
-%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 1
-%define HAVE_MKSTEMP 0
-%define HAVE_MM_EMPTY 0
-%define HAVE_MMAP 0
-%define HAVE_MPROTECT 0
-%define HAVE_NANOSLEEP 0
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
-%define HAVE_PEEKNAMEDPIPE 1
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 0
-%define HAVE_POSIX_MEMALIGN 0
-%define HAVE_PRAGMA_DEPRECATED 1
-%define HAVE_PTHREAD_CANCEL 0
-%define HAVE_RDTSC 1
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 0
-%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
-%define HAVE_SETCONSOLETEXTATTRIBUTE 1
-%define HAVE_SETMODE 1
-%define HAVE_SETRLIMIT 0
-%define HAVE_SLEEP 1
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
-%define HAVE_STRERROR_R 0
-%define HAVE_STRUCT_ADDRINFO 0
-%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
-%define HAVE_STRUCT_IP_MREQ_SOURCE 0
-%define HAVE_STRUCT_IPV6_MREQ 0
-%define HAVE_STRUCT_POLLFD 0
-%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0
-%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
-%define HAVE_STRUCT_SOCKADDR_IN6 0
-%define HAVE_STRUCT_SOCKADDR_SA_LEN 0
-%define HAVE_STRUCT_SOCKADDR_STORAGE 0
-%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
-%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-%define HAVE_SYSCONF 0
-%define HAVE_SYSCTL 0
-%define HAVE_SYS_MMAN_H 0
-%define HAVE_SYS_PARAM_H 0
-%define HAVE_SYS_RESOURCE_H 0
-%define HAVE_SYS_SELECT_H 0
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 0
-%define HAVE_SYS_UN_H 0
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 0
-%define HAVE_TEXI2HTML 0
-%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 0
-%define HAVE_USLEEP 0
-%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 1
-%define HAVE_WINDOWS_H 1
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
-%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
-%define CONFIG_BSFS 0
-%define CONFIG_DECODERS 1
-%define CONFIG_DEMUXERS 1
-%define CONFIG_ENCODERS 0
-%define CONFIG_FILTERS 0
-%define CONFIG_HWACCELS 0
-%define CONFIG_INDEVS 0
-%define CONFIG_MUXERS 0
-%define CONFIG_OUTDEVS 0
-%define CONFIG_PARSERS 1
-%define CONFIG_PROTOCOLS 0
-%define CONFIG_DOC 0
-%define CONFIG_HTMLPAGES 0
-%define CONFIG_MANPAGES 1
-%define CONFIG_PODPAGES 1
-%define CONFIG_TXTPAGES 1
-%define CONFIG_DECODING_ENCODING_EXAMPLE 1
-%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
-%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
-%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
-%define CONFIG_METADATA_EXAMPLE 1
-%define CONFIG_MUXING_EXAMPLE 0
-%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
-%define CONFIG_SCALING_VIDEO_EXAMPLE 0
-%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
-%define CONFIG_AVISYNTH 0
-%define CONFIG_BZLIB 0
-%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
-%define CONFIG_FREI0R 0
-%define CONFIG_GNUTLS 0
-%define CONFIG_ICONV 0
-%define CONFIG_LADSPA 0
-%define CONFIG_LIBAACPLUS 0
-%define CONFIG_LIBASS 0
-%define CONFIG_LIBBLURAY 0
-%define CONFIG_LIBCACA 0
-%define CONFIG_LIBCDIO 0
-%define CONFIG_LIBCELT 0
-%define CONFIG_LIBDC1394 0
-%define CONFIG_LIBFAAC 0
-%define CONFIG_LIBFDK_AAC 0
-%define CONFIG_LIBFLITE 0
-%define CONFIG_LIBFREETYPE 0
-%define CONFIG_LIBGME 0
-%define CONFIG_LIBGSM 0
-%define CONFIG_LIBIEC61883 0
-%define CONFIG_LIBILBC 0
-%define CONFIG_LIBMODPLUG 0
-%define CONFIG_LIBMP3LAME 0
-%define CONFIG_LIBNUT 0
-%define CONFIG_LIBOPENCORE_AMRNB 0
-%define CONFIG_LIBOPENCORE_AMRWB 0
-%define CONFIG_LIBOPENCV 0
-%define CONFIG_LIBOPENJPEG 0
-%define CONFIG_LIBOPUS 0
-%define CONFIG_LIBPULSE 0
-%define CONFIG_LIBQUVI 0
-%define CONFIG_LIBRTMP 0
-%define CONFIG_LIBSCHROEDINGER 0
-%define CONFIG_LIBSHINE 0
-%define CONFIG_LIBSOXR 0
-%define CONFIG_LIBSPEEX 0
-%define CONFIG_LIBSSH 0
-%define CONFIG_LIBSTAGEFRIGHT_H264 0
-%define CONFIG_LIBTHEORA 0
-%define CONFIG_LIBTWOLAME 0
-%define CONFIG_LIBUTVIDEO 0
-%define CONFIG_LIBV4L2 0
-%define CONFIG_LIBVIDSTAB 0
-%define CONFIG_LIBVO_AACENC 0
-%define CONFIG_LIBVO_AMRWBENC 0
-%define CONFIG_LIBVORBIS 0
-%define CONFIG_LIBVPX 0
-%define CONFIG_LIBWAVPACK 0
-%define CONFIG_LIBX264 0
-%define CONFIG_LIBXAVS 0
-%define CONFIG_LIBXVID 0
-%define CONFIG_LIBZMQ 0
-%define CONFIG_LIBZVBI 0
-%define CONFIG_OPENAL 0
-%define CONFIG_OPENCL 0
-%define CONFIG_OPENSSL 0
-%define CONFIG_X11GRAB 0
-%define CONFIG_ZLIB 0
-%define CONFIG_DXVA2 0
-%define CONFIG_VAAPI 0
-%define CONFIG_VDA 0
-%define CONFIG_VDPAU 0
-%define CONFIG_AVCODEC 1
-%define CONFIG_AVDEVICE 0
-%define CONFIG_AVFILTER 0
-%define CONFIG_AVFORMAT 1
-%define CONFIG_AVRESAMPLE 0
-%define CONFIG_AVUTIL 1
-%define CONFIG_POSTPROC 0
-%define CONFIG_SWRESAMPLE 0
-%define CONFIG_SWSCALE 0
-%define CONFIG_FFPLAY 0
-%define CONFIG_FFPROBE 0
-%define CONFIG_FFSERVER 0
-%define CONFIG_FFMPEG 0
-%define CONFIG_DCT 0
-%define CONFIG_DWT 0
-%define CONFIG_ERROR_RESILIENCE 0
-%define CONFIG_FAST_UNALIGNED 1
-%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
-%define CONFIG_LSP 0
-%define CONFIG_LZO 0
-%define CONFIG_MDCT 1
-%define CONFIG_MEMALIGN_HACK 0
-%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
-%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 0
-%define CONFIG_SWSCALE_ALPHA 1
-%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
-%define CONFIG_XMM_CLOBBER_TEST 0
-%define CONFIG_AANDCTTABLES 0
-%define CONFIG_AC3DSP 0
-%define CONFIG_AUDIO_FRAME_QUEUE 0
-%define CONFIG_DSPUTIL 0
-%define CONFIG_EXIF 0
-%define CONFIG_FRAME_THREAD_ENCODER 0
-%define CONFIG_GCRYPT 0
-%define CONFIG_GOLOMB 1
-%define CONFIG_GPLV3 0
-%define CONFIG_H263DSP 0
-%define CONFIG_H264CHROMA 0
-%define CONFIG_H264DSP 0
-%define CONFIG_H264PRED 1
-%define CONFIG_H264QPEL 0
-%define CONFIG_HPELDSP 1
-%define CONFIG_HUFFMAN 0
-%define CONFIG_LGPLV3 0
-%define CONFIG_LPC 0
-%define CONFIG_MPEGAUDIO 0
-%define CONFIG_MPEGAUDIODSP 0
-%define CONFIG_MPEGVIDEO 0
-%define CONFIG_MPEGVIDEOENC 0
-%define CONFIG_NETTLE 0
-%define CONFIG_RANGECODER 0
-%define CONFIG_RIFFDEC 1
-%define CONFIG_RIFFENC 0
-%define CONFIG_RTPDEC 0
-%define CONFIG_RTPENC_CHAIN 0
-%define CONFIG_SINEWIN 0
-%define CONFIG_VIDEODSP 1
-%define CONFIG_VP3DSP 1
-%define CONFIG_AAC_ADTSTOASC_BSF 0
-%define CONFIG_CHOMP_BSF 0
-%define CONFIG_DUMP_EXTRADATA_BSF 0
-%define CONFIG_H264_MP4TOANNEXB_BSF 0
-%define CONFIG_IMX_DUMP_HEADER_BSF 0
-%define CONFIG_MJPEG2JPEG_BSF 0
-%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
-%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
-%define CONFIG_MOV2TEXTSUB_BSF 0
-%define CONFIG_NOISE_BSF 0
-%define CONFIG_REMOVE_EXTRADATA_BSF 0
-%define CONFIG_TEXT2MOVSUB_BSF 0
-%define CONFIG_AASC_DECODER 0
-%define CONFIG_AIC_DECODER 0
-%define CONFIG_AMV_DECODER 0
-%define CONFIG_ANM_DECODER 0
-%define CONFIG_ANSI_DECODER 0
-%define CONFIG_ASV1_DECODER 0
-%define CONFIG_ASV2_DECODER 0
-%define CONFIG_AURA_DECODER 0
-%define CONFIG_AURA2_DECODER 0
-%define CONFIG_AVRP_DECODER 0
-%define CONFIG_AVRN_DECODER 0
-%define CONFIG_AVS_DECODER 0
-%define CONFIG_AVUI_DECODER 0
-%define CONFIG_AYUV_DECODER 0
-%define CONFIG_BETHSOFTVID_DECODER 0
-%define CONFIG_BFI_DECODER 0
-%define CONFIG_BINK_DECODER 0
-%define CONFIG_BMP_DECODER 0
-%define CONFIG_BMV_VIDEO_DECODER 0
-%define CONFIG_BRENDER_PIX_DECODER 0
-%define CONFIG_C93_DECODER 0
-%define CONFIG_CAVS_DECODER 0
-%define CONFIG_CDGRAPHICS_DECODER 0
-%define CONFIG_CDXL_DECODER 0
-%define CONFIG_CINEPAK_DECODER 0
-%define CONFIG_CLJR_DECODER 0
-%define CONFIG_CLLC_DECODER 0
-%define CONFIG_COMFORTNOISE_DECODER 0
-%define CONFIG_CPIA_DECODER 0
-%define CONFIG_CSCD_DECODER 0
-%define CONFIG_CYUV_DECODER 0
-%define CONFIG_DFA_DECODER 0
-%define CONFIG_DIRAC_DECODER 0
-%define CONFIG_DNXHD_DECODER 0
-%define CONFIG_DPX_DECODER 0
-%define CONFIG_DSICINVIDEO_DECODER 0
-%define CONFIG_DVVIDEO_DECODER 0
-%define CONFIG_DXA_DECODER 0
-%define CONFIG_DXTORY_DECODER 0
-%define CONFIG_EACMV_DECODER 0
-%define CONFIG_EAMAD_DECODER 0
-%define CONFIG_EATGQ_DECODER 0
-%define CONFIG_EATGV_DECODER 0
-%define CONFIG_EATQI_DECODER 0
-%define CONFIG_EIGHTBPS_DECODER 0
-%define CONFIG_EIGHTSVX_EXP_DECODER 0
-%define CONFIG_EIGHTSVX_FIB_DECODER 0
-%define CONFIG_ESCAPE124_DECODER 0
-%define CONFIG_ESCAPE130_DECODER 0
-%define CONFIG_EXR_DECODER 0
-%define CONFIG_FFV1_DECODER 0
-%define CONFIG_FFVHUFF_DECODER 0
-%define CONFIG_FLASHSV_DECODER 0
-%define CONFIG_FLASHSV2_DECODER 0
-%define CONFIG_FLIC_DECODER 0
-%define CONFIG_FLV_DECODER 0
-%define CONFIG_FOURXM_DECODER 0
-%define CONFIG_FRAPS_DECODER 0
-%define CONFIG_FRWU_DECODER 0
-%define CONFIG_G2M_DECODER 0
-%define CONFIG_GIF_DECODER 0
-%define CONFIG_H261_DECODER 0
-%define CONFIG_H263_DECODER 0
-%define CONFIG_H263I_DECODER 0
-%define CONFIG_H263P_DECODER 0
-%define CONFIG_H264_DECODER 0
-%define CONFIG_H264_CRYSTALHD_DECODER 0
-%define CONFIG_H264_VDA_DECODER 0
-%define CONFIG_H264_VDPAU_DECODER 0
-%define CONFIG_HEVC_DECODER 0
-%define CONFIG_HNM4_VIDEO_DECODER 0
-%define CONFIG_HUFFYUV_DECODER 0
-%define CONFIG_IDCIN_DECODER 0
-%define CONFIG_IFF_BYTERUN1_DECODER 0
-%define CONFIG_IFF_ILBM_DECODER 0
-%define CONFIG_INDEO2_DECODER 0
-%define CONFIG_INDEO3_DECODER 0
-%define CONFIG_INDEO4_DECODER 0
-%define CONFIG_INDEO5_DECODER 0
-%define CONFIG_INTERPLAY_VIDEO_DECODER 0
-%define CONFIG_JPEG2000_DECODER 0
-%define CONFIG_JPEGLS_DECODER 0
-%define CONFIG_JV_DECODER 0
-%define CONFIG_KGV1_DECODER 0
-%define CONFIG_KMVC_DECODER 0
-%define CONFIG_LAGARITH_DECODER 0
-%define CONFIG_LOCO_DECODER 0
-%define CONFIG_MDEC_DECODER 0
-%define CONFIG_MIMIC_DECODER 0
-%define CONFIG_MJPEG_DECODER 0
-%define CONFIG_MJPEGB_DECODER 0
-%define CONFIG_MMVIDEO_DECODER 0
-%define CONFIG_MOTIONPIXELS_DECODER 0
-%define CONFIG_MPEG_XVMC_DECODER 0
-%define CONFIG_MPEG1VIDEO_DECODER 0
-%define CONFIG_MPEG2VIDEO_DECODER 0
-%define CONFIG_MPEG4_DECODER 0
-%define CONFIG_MPEG4_CRYSTALHD_DECODER 0
-%define CONFIG_MPEG4_VDPAU_DECODER 0
-%define CONFIG_MPEGVIDEO_DECODER 0
-%define CONFIG_MPEG_VDPAU_DECODER 0
-%define CONFIG_MPEG1_VDPAU_DECODER 0
-%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
-%define CONFIG_MSA1_DECODER 0
-%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
-%define CONFIG_MSMPEG4V1_DECODER 0
-%define CONFIG_MSMPEG4V2_DECODER 0
-%define CONFIG_MSMPEG4V3_DECODER 0
-%define CONFIG_MSRLE_DECODER 0
-%define CONFIG_MSS1_DECODER 0
-%define CONFIG_MSS2_DECODER 0
-%define CONFIG_MSVIDEO1_DECODER 0
-%define CONFIG_MSZH_DECODER 0
-%define CONFIG_MTS2_DECODER 0
-%define CONFIG_MVC1_DECODER 0
-%define CONFIG_MVC2_DECODER 0
-%define CONFIG_MXPEG_DECODER 0
-%define CONFIG_NUV_DECODER 0
-%define CONFIG_PAF_VIDEO_DECODER 0
-%define CONFIG_PAM_DECODER 0
-%define CONFIG_PBM_DECODER 0
-%define CONFIG_PCX_DECODER 0
-%define CONFIG_PGM_DECODER 0
-%define CONFIG_PGMYUV_DECODER 0
-%define CONFIG_PICTOR_DECODER 0
-%define CONFIG_PNG_DECODER 0
-%define CONFIG_PPM_DECODER 0
-%define CONFIG_PRORES_DECODER 0
-%define CONFIG_PRORES_LGPL_DECODER 0
-%define CONFIG_PTX_DECODER 0
-%define CONFIG_QDRAW_DECODER 0
-%define CONFIG_QPEG_DECODER 0
-%define CONFIG_QTRLE_DECODER 0
-%define CONFIG_R10K_DECODER 0
-%define CONFIG_R210_DECODER 0
-%define CONFIG_RAWVIDEO_DECODER 0
-%define CONFIG_RL2_DECODER 0
-%define CONFIG_ROQ_DECODER 0
-%define CONFIG_RPZA_DECODER 0
-%define CONFIG_RV10_DECODER 0
-%define CONFIG_RV20_DECODER 0
-%define CONFIG_RV30_DECODER 0
-%define CONFIG_RV40_DECODER 0
-%define CONFIG_S302M_DECODER 0
-%define CONFIG_SANM_DECODER 0
-%define CONFIG_SGI_DECODER 0
-%define CONFIG_SGIRLE_DECODER 0
-%define CONFIG_SMACKER_DECODER 0
-%define CONFIG_SMC_DECODER 0
-%define CONFIG_SMVJPEG_DECODER 0
-%define CONFIG_SNOW_DECODER 0
-%define CONFIG_SP5X_DECODER 0
-%define CONFIG_SUNRAST_DECODER 0
-%define CONFIG_SVQ1_DECODER 0
-%define CONFIG_SVQ3_DECODER 0
-%define CONFIG_TARGA_DECODER 0
-%define CONFIG_TARGA_Y216_DECODER 0
-%define CONFIG_THEORA_DECODER 1
-%define CONFIG_THP_DECODER 0
-%define CONFIG_TIERTEXSEQVIDEO_DECODER 0
-%define CONFIG_TIFF_DECODER 0
-%define CONFIG_TMV_DECODER 0
-%define CONFIG_TRUEMOTION1_DECODER 0
-%define CONFIG_TRUEMOTION2_DECODER 0
-%define CONFIG_TSCC_DECODER 0
-%define CONFIG_TSCC2_DECODER 0
-%define CONFIG_TXD_DECODER 0
-%define CONFIG_ULTI_DECODER 0
-%define CONFIG_UTVIDEO_DECODER 0
-%define CONFIG_V210_DECODER 0
-%define CONFIG_V210X_DECODER 0
-%define CONFIG_V308_DECODER 0
-%define CONFIG_V408_DECODER 0
-%define CONFIG_V410_DECODER 0
-%define CONFIG_VB_DECODER 0
-%define CONFIG_VBLE_DECODER 0
-%define CONFIG_VC1_DECODER 0
-%define CONFIG_VC1_CRYSTALHD_DECODER 0
-%define CONFIG_VC1_VDPAU_DECODER 0
-%define CONFIG_VC1IMAGE_DECODER 0
-%define CONFIG_VCR1_DECODER 0
-%define CONFIG_VMDVIDEO_DECODER 0
-%define CONFIG_VMNC_DECODER 0
-%define CONFIG_VP3_DECODER 1
-%define CONFIG_VP5_DECODER 0
-%define CONFIG_VP6_DECODER 0
-%define CONFIG_VP6A_DECODER 0
-%define CONFIG_VP6F_DECODER 0
-%define CONFIG_VP8_DECODER 1
-%define CONFIG_VP9_DECODER 0
-%define CONFIG_VQA_DECODER 0
-%define CONFIG_WEBP_DECODER 0
-%define CONFIG_WMV1_DECODER 0
-%define CONFIG_WMV2_DECODER 0
-%define CONFIG_WMV3_DECODER 0
-%define CONFIG_WMV3_CRYSTALHD_DECODER 0
-%define CONFIG_WMV3_VDPAU_DECODER 0
-%define CONFIG_WMV3IMAGE_DECODER 0
-%define CONFIG_WNV1_DECODER 0
-%define CONFIG_XAN_WC3_DECODER 0
-%define CONFIG_XAN_WC4_DECODER 0
-%define CONFIG_XBM_DECODER 0
-%define CONFIG_XFACE_DECODER 0
-%define CONFIG_XL_DECODER 0
-%define CONFIG_XWD_DECODER 0
-%define CONFIG_Y41P_DECODER 0
-%define CONFIG_YOP_DECODER 0
-%define CONFIG_YUV4_DECODER 0
-%define CONFIG_ZERO12V_DECODER 0
-%define CONFIG_ZEROCODEC_DECODER 0
-%define CONFIG_ZLIB_DECODER 0
-%define CONFIG_ZMBV_DECODER 0
-%define CONFIG_AAC_DECODER 0
-%define CONFIG_AAC_LATM_DECODER 0
-%define CONFIG_AC3_DECODER 0
-%define CONFIG_ALAC_DECODER 0
-%define CONFIG_ALS_DECODER 0
-%define CONFIG_AMRNB_DECODER 0
-%define CONFIG_AMRWB_DECODER 0
-%define CONFIG_APE_DECODER 0
-%define CONFIG_ATRAC1_DECODER 0
-%define CONFIG_ATRAC3_DECODER 0
-%define CONFIG_BINKAUDIO_DCT_DECODER 0
-%define CONFIG_BINKAUDIO_RDFT_DECODER 0
-%define CONFIG_BMV_AUDIO_DECODER 0
-%define CONFIG_COOK_DECODER 0
-%define CONFIG_DCA_DECODER 0
-%define CONFIG_DSICINAUDIO_DECODER 0
-%define CONFIG_EAC3_DECODER 0
-%define CONFIG_EVRC_DECODER 0
-%define CONFIG_FFWAVESYNTH_DECODER 0
-%define CONFIG_FLAC_DECODER 0
-%define CONFIG_G723_1_DECODER 0
-%define CONFIG_G729_DECODER 0
-%define CONFIG_GSM_DECODER 0
-%define CONFIG_GSM_MS_DECODER 0
-%define CONFIG_IAC_DECODER 0
-%define CONFIG_IMC_DECODER 0
-%define CONFIG_MACE3_DECODER 0
-%define CONFIG_MACE6_DECODER 0
-%define CONFIG_METASOUND_DECODER 0
-%define CONFIG_MLP_DECODER 0
-%define CONFIG_MP1_DECODER 0
-%define CONFIG_MP1FLOAT_DECODER 0
-%define CONFIG_MP2_DECODER 0
-%define CONFIG_MP2FLOAT_DECODER 0
-%define CONFIG_MP3_DECODER 0
-%define CONFIG_MP3FLOAT_DECODER 0
-%define CONFIG_MP3ADU_DECODER 0
-%define CONFIG_MP3ADUFLOAT_DECODER 0
-%define CONFIG_MP3ON4_DECODER 0
-%define CONFIG_MP3ON4FLOAT_DECODER 0
-%define CONFIG_MPC7_DECODER 0
-%define CONFIG_MPC8_DECODER 0
-%define CONFIG_NELLYMOSER_DECODER 0
-%define CONFIG_PAF_AUDIO_DECODER 0
-%define CONFIG_QCELP_DECODER 0
-%define CONFIG_QDM2_DECODER 0
-%define CONFIG_RA_144_DECODER 0
-%define CONFIG_RA_288_DECODER 0
-%define CONFIG_RALF_DECODER 0
-%define CONFIG_SHORTEN_DECODER 0
-%define CONFIG_SIPR_DECODER 0
-%define CONFIG_SMACKAUD_DECODER 0
-%define CONFIG_SONIC_DECODER 0
-%define CONFIG_TAK_DECODER 0
-%define CONFIG_TRUEHD_DECODER 0
-%define CONFIG_TRUESPEECH_DECODER 0
-%define CONFIG_TTA_DECODER 0
-%define CONFIG_TWINVQ_DECODER 0
-%define CONFIG_VMDAUDIO_DECODER 0
-%define CONFIG_VORBIS_DECODER 1
-%define CONFIG_WAVPACK_DECODER 0
-%define CONFIG_WMALOSSLESS_DECODER 0
-%define CONFIG_WMAPRO_DECODER 0
-%define CONFIG_WMAV1_DECODER 0
-%define CONFIG_WMAV2_DECODER 0
-%define CONFIG_WMAVOICE_DECODER 0
-%define CONFIG_WS_SND1_DECODER 0
-%define CONFIG_PCM_ALAW_DECODER 1
-%define CONFIG_PCM_BLURAY_DECODER 0
-%define CONFIG_PCM_DVD_DECODER 0
-%define CONFIG_PCM_F32BE_DECODER 0
-%define CONFIG_PCM_F32LE_DECODER 1
-%define CONFIG_PCM_F64BE_DECODER 0
-%define CONFIG_PCM_F64LE_DECODER 0
-%define CONFIG_PCM_LXF_DECODER 0
-%define CONFIG_PCM_MULAW_DECODER 1
-%define CONFIG_PCM_S8_DECODER 0
-%define CONFIG_PCM_S8_PLANAR_DECODER 0
-%define CONFIG_PCM_S16BE_DECODER 1
-%define CONFIG_PCM_S16BE_PLANAR_DECODER 0
-%define CONFIG_PCM_S16LE_DECODER 1
-%define CONFIG_PCM_S16LE_PLANAR_DECODER 0
-%define CONFIG_PCM_S24BE_DECODER 1
-%define CONFIG_PCM_S24DAUD_DECODER 0
-%define CONFIG_PCM_S24LE_DECODER 1
-%define CONFIG_PCM_S24LE_PLANAR_DECODER 0
-%define CONFIG_PCM_S32BE_DECODER 0
-%define CONFIG_PCM_S32LE_DECODER 0
-%define CONFIG_PCM_S32LE_PLANAR_DECODER 0
-%define CONFIG_PCM_U8_DECODER 1
-%define CONFIG_PCM_U16BE_DECODER 0
-%define CONFIG_PCM_U16LE_DECODER 0
-%define CONFIG_PCM_U24BE_DECODER 0
-%define CONFIG_PCM_U24LE_DECODER 0
-%define CONFIG_PCM_U32BE_DECODER 0
-%define CONFIG_PCM_U32LE_DECODER 0
-%define CONFIG_PCM_ZORK_DECODER 0
-%define CONFIG_INTERPLAY_DPCM_DECODER 0
-%define CONFIG_ROQ_DPCM_DECODER 0
-%define CONFIG_SOL_DPCM_DECODER 0
-%define CONFIG_XAN_DPCM_DECODER 0
-%define CONFIG_ADPCM_4XM_DECODER 0
-%define CONFIG_ADPCM_ADX_DECODER 0
-%define CONFIG_ADPCM_AFC_DECODER 0
-%define CONFIG_ADPCM_CT_DECODER 0
-%define CONFIG_ADPCM_DTK_DECODER 0
-%define CONFIG_ADPCM_EA_DECODER 0
-%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
-%define CONFIG_ADPCM_EA_R1_DECODER 0
-%define CONFIG_ADPCM_EA_R2_DECODER 0
-%define CONFIG_ADPCM_EA_R3_DECODER 0
-%define CONFIG_ADPCM_EA_XAS_DECODER 0
-%define CONFIG_ADPCM_G722_DECODER 0
-%define CONFIG_ADPCM_G726_DECODER 0
-%define CONFIG_ADPCM_G726LE_DECODER 0
-%define CONFIG_ADPCM_IMA_AMV_DECODER 0
-%define CONFIG_ADPCM_IMA_APC_DECODER 0
-%define CONFIG_ADPCM_IMA_DK3_DECODER 0
-%define CONFIG_ADPCM_IMA_DK4_DECODER 0
-%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
-%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
-%define CONFIG_ADPCM_IMA_ISS_DECODER 0
-%define CONFIG_ADPCM_IMA_OKI_DECODER 0
-%define CONFIG_ADPCM_IMA_QT_DECODER 0
-%define CONFIG_ADPCM_IMA_RAD_DECODER 0
-%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
-%define CONFIG_ADPCM_IMA_WAV_DECODER 0
-%define CONFIG_ADPCM_IMA_WS_DECODER 0
-%define CONFIG_ADPCM_MS_DECODER 0
-%define CONFIG_ADPCM_SBPRO_2_DECODER 0
-%define CONFIG_ADPCM_SBPRO_3_DECODER 0
-%define CONFIG_ADPCM_SBPRO_4_DECODER 0
-%define CONFIG_ADPCM_SWF_DECODER 0
-%define CONFIG_ADPCM_THP_DECODER 0
-%define CONFIG_ADPCM_XA_DECODER 0
-%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
-%define CONFIG_SSA_DECODER 0
-%define CONFIG_ASS_DECODER 0
-%define CONFIG_DVBSUB_DECODER 0
-%define CONFIG_DVDSUB_DECODER 0
-%define CONFIG_JACOSUB_DECODER 0
-%define CONFIG_MICRODVD_DECODER 0
-%define CONFIG_MOVTEXT_DECODER 0
-%define CONFIG_MPL2_DECODER 0
-%define CONFIG_PGSSUB_DECODER 0
-%define CONFIG_PJS_DECODER 0
-%define CONFIG_REALTEXT_DECODER 0
-%define CONFIG_SAMI_DECODER 0
-%define CONFIG_SRT_DECODER 0
-%define CONFIG_SUBRIP_DECODER 0
-%define CONFIG_SUBVIEWER_DECODER 0
-%define CONFIG_SUBVIEWER1_DECODER 0
-%define CONFIG_TEXT_DECODER 0
-%define CONFIG_VPLAYER_DECODER 0
-%define CONFIG_WEBVTT_DECODER 0
-%define CONFIG_XSUB_DECODER 0
-%define CONFIG_LIBCELT_DECODER 0
-%define CONFIG_LIBFDK_AAC_DECODER 0
-%define CONFIG_LIBGSM_DECODER 0
-%define CONFIG_LIBGSM_MS_DECODER 0
-%define CONFIG_LIBILBC_DECODER 0
-%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
-%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
-%define CONFIG_LIBOPENJPEG_DECODER 0
-%define CONFIG_LIBOPUS_DECODER 0
-%define CONFIG_LIBSCHROEDINGER_DECODER 0
-%define CONFIG_LIBSPEEX_DECODER 0
-%define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
-%define CONFIG_LIBUTVIDEO_DECODER 0
-%define CONFIG_LIBVORBIS_DECODER 0
-%define CONFIG_LIBVPX_VP8_DECODER 0
-%define CONFIG_LIBVPX_VP9_DECODER 0
-%define CONFIG_LIBZVBI_TELETEXT_DECODER 0
-%define CONFIG_BINTEXT_DECODER 0
-%define CONFIG_XBIN_DECODER 0
-%define CONFIG_IDF_DECODER 0
-%define CONFIG_AAC_DEMUXER 0
-%define CONFIG_AC3_DEMUXER 0
-%define CONFIG_ACT_DEMUXER 0
-%define CONFIG_ADF_DEMUXER 0
-%define CONFIG_ADP_DEMUXER 0
-%define CONFIG_ADX_DEMUXER 0
-%define CONFIG_AEA_DEMUXER 0
-%define CONFIG_AFC_DEMUXER 0
-%define CONFIG_AIFF_DEMUXER 0
-%define CONFIG_AMR_DEMUXER 0
-%define CONFIG_ANM_DEMUXER 0
-%define CONFIG_APC_DEMUXER 0
-%define CONFIG_APE_DEMUXER 0
-%define CONFIG_AQTITLE_DEMUXER 0
-%define CONFIG_ASF_DEMUXER 0
-%define CONFIG_ASS_DEMUXER 0
-%define CONFIG_AST_DEMUXER 0
-%define CONFIG_AU_DEMUXER 0
-%define CONFIG_AVI_DEMUXER 0
-%define CONFIG_AVISYNTH_DEMUXER 0
-%define CONFIG_AVR_DEMUXER 0
-%define CONFIG_AVS_DEMUXER 0
-%define CONFIG_BETHSOFTVID_DEMUXER 0
-%define CONFIG_BFI_DEMUXER 0
-%define CONFIG_BINTEXT_DEMUXER 0
-%define CONFIG_BINK_DEMUXER 0
-%define CONFIG_BIT_DEMUXER 0
-%define CONFIG_BMV_DEMUXER 0
-%define CONFIG_BRSTM_DEMUXER 0
-%define CONFIG_BOA_DEMUXER 0
-%define CONFIG_C93_DEMUXER 0
-%define CONFIG_CAF_DEMUXER 0
-%define CONFIG_CAVSVIDEO_DEMUXER 0
-%define CONFIG_CDG_DEMUXER 0
-%define CONFIG_CDXL_DEMUXER 0
-%define CONFIG_CONCAT_DEMUXER 0
-%define CONFIG_DATA_DEMUXER 0
-%define CONFIG_DAUD_DEMUXER 0
-%define CONFIG_DFA_DEMUXER 0
-%define CONFIG_DIRAC_DEMUXER 0
-%define CONFIG_DNXHD_DEMUXER 0
-%define CONFIG_DSICIN_DEMUXER 0
-%define CONFIG_DTS_DEMUXER 0
-%define CONFIG_DTSHD_DEMUXER 0
-%define CONFIG_DV_DEMUXER 0
-%define CONFIG_DXA_DEMUXER 0
-%define CONFIG_EA_DEMUXER 0
-%define CONFIG_EA_CDATA_DEMUXER 0
-%define CONFIG_EAC3_DEMUXER 0
-%define CONFIG_EPAF_DEMUXER 0
-%define CONFIG_FFM_DEMUXER 0
-%define CONFIG_FFMETADATA_DEMUXER 0
-%define CONFIG_FILMSTRIP_DEMUXER 0
-%define CONFIG_FLAC_DEMUXER 0
-%define CONFIG_FLIC_DEMUXER 0
-%define CONFIG_FLV_DEMUXER 0
-%define CONFIG_FOURXM_DEMUXER 0
-%define CONFIG_FRM_DEMUXER 0
-%define CONFIG_G722_DEMUXER 0
-%define CONFIG_G723_1_DEMUXER 0
-%define CONFIG_G729_DEMUXER 0
-%define CONFIG_GIF_DEMUXER 0
-%define CONFIG_GSM_DEMUXER 0
-%define CONFIG_GXF_DEMUXER 0
-%define CONFIG_H261_DEMUXER 0
-%define CONFIG_H263_DEMUXER 0
-%define CONFIG_H264_DEMUXER 0
-%define CONFIG_HEVC_DEMUXER 0
-%define CONFIG_HLS_DEMUXER 0
-%define CONFIG_HNM_DEMUXER 0
-%define CONFIG_ICO_DEMUXER 0
-%define CONFIG_IDCIN_DEMUXER 0
-%define CONFIG_IDF_DEMUXER 0
-%define CONFIG_IFF_DEMUXER 0
-%define CONFIG_ILBC_DEMUXER 0
-%define CONFIG_IMAGE2_DEMUXER 0
-%define CONFIG_IMAGE2PIPE_DEMUXER 0
-%define CONFIG_INGENIENT_DEMUXER 0
-%define CONFIG_IPMOVIE_DEMUXER 0
-%define CONFIG_IRCAM_DEMUXER 0
-%define CONFIG_ISS_DEMUXER 0
-%define CONFIG_IV8_DEMUXER 0
-%define CONFIG_IVF_DEMUXER 0
-%define CONFIG_JACOSUB_DEMUXER 0
-%define CONFIG_JV_DEMUXER 0
-%define CONFIG_LATM_DEMUXER 0
-%define CONFIG_LMLM4_DEMUXER 0
-%define CONFIG_LOAS_DEMUXER 0
-%define CONFIG_LVF_DEMUXER 0
-%define CONFIG_LXF_DEMUXER 0
-%define CONFIG_M4V_DEMUXER 0
-%define CONFIG_MATROSKA_DEMUXER 1
-%define CONFIG_MGSTS_DEMUXER 0
-%define CONFIG_MICRODVD_DEMUXER 0
-%define CONFIG_MJPEG_DEMUXER 0
-%define CONFIG_MLP_DEMUXER 0
-%define CONFIG_MM_DEMUXER 0
-%define CONFIG_MMF_DEMUXER 0
-%define CONFIG_MOV_DEMUXER 0
-%define CONFIG_MP3_DEMUXER 0
-%define CONFIG_MPC_DEMUXER 0
-%define CONFIG_MPC8_DEMUXER 0
-%define CONFIG_MPEGPS_DEMUXER 0
-%define CONFIG_MPEGTS_DEMUXER 0
-%define CONFIG_MPEGTSRAW_DEMUXER 0
-%define CONFIG_MPEGVIDEO_DEMUXER 0
-%define CONFIG_MPL2_DEMUXER 0
-%define CONFIG_MPSUB_DEMUXER 0
-%define CONFIG_MSNWC_TCP_DEMUXER 0
-%define CONFIG_MTV_DEMUXER 0
-%define CONFIG_MV_DEMUXER 0
-%define CONFIG_MVI_DEMUXER 0
-%define CONFIG_MXF_DEMUXER 0
-%define CONFIG_MXG_DEMUXER 0
-%define CONFIG_NC_DEMUXER 0
-%define CONFIG_NISTSPHERE_DEMUXER 0
-%define CONFIG_NSV_DEMUXER 0
-%define CONFIG_NUT_DEMUXER 0
-%define CONFIG_NUV_DEMUXER 0
-%define CONFIG_OGG_DEMUXER 1
-%define CONFIG_OMA_DEMUXER 0
-%define CONFIG_PAF_DEMUXER 0
-%define CONFIG_PCM_ALAW_DEMUXER 0
-%define CONFIG_PCM_MULAW_DEMUXER 0
-%define CONFIG_PCM_F64BE_DEMUXER 0
-%define CONFIG_PCM_F64LE_DEMUXER 0
-%define CONFIG_PCM_F32BE_DEMUXER 0
-%define CONFIG_PCM_F32LE_DEMUXER 0
-%define CONFIG_PCM_S32BE_DEMUXER 0
-%define CONFIG_PCM_S32LE_DEMUXER 0
-%define CONFIG_PCM_S24BE_DEMUXER 0
-%define CONFIG_PCM_S24LE_DEMUXER 0
-%define CONFIG_PCM_S16BE_DEMUXER 0
-%define CONFIG_PCM_S16LE_DEMUXER 0
-%define CONFIG_PCM_S8_DEMUXER 0
-%define CONFIG_PCM_U32BE_DEMUXER 0
-%define CONFIG_PCM_U32LE_DEMUXER 0
-%define CONFIG_PCM_U24BE_DEMUXER 0
-%define CONFIG_PCM_U24LE_DEMUXER 0
-%define CONFIG_PCM_U16BE_DEMUXER 0
-%define CONFIG_PCM_U16LE_DEMUXER 0
-%define CONFIG_PCM_U8_DEMUXER 0
-%define CONFIG_PJS_DEMUXER 0
-%define CONFIG_PMP_DEMUXER 0
-%define CONFIG_PVA_DEMUXER 0
-%define CONFIG_PVF_DEMUXER 0
-%define CONFIG_QCP_DEMUXER 0
-%define CONFIG_R3D_DEMUXER 0
-%define CONFIG_RAWVIDEO_DEMUXER 0
-%define CONFIG_REALTEXT_DEMUXER 0
-%define CONFIG_REDSPARK_DEMUXER 0
-%define CONFIG_RL2_DEMUXER 0
-%define CONFIG_RM_DEMUXER 0
-%define CONFIG_ROQ_DEMUXER 0
-%define CONFIG_RPL_DEMUXER 0
-%define CONFIG_RSD_DEMUXER 0
-%define CONFIG_RSO_DEMUXER 0
-%define CONFIG_RTP_DEMUXER 0
-%define CONFIG_RTSP_DEMUXER 0
-%define CONFIG_SAMI_DEMUXER 0
-%define CONFIG_SAP_DEMUXER 0
-%define CONFIG_SBG_DEMUXER 0
-%define CONFIG_SDP_DEMUXER 0
-%define CONFIG_SEGAFILM_DEMUXER 0
-%define CONFIG_SHORTEN_DEMUXER 0
-%define CONFIG_SIFF_DEMUXER 0
-%define CONFIG_SMACKER_DEMUXER 0
-%define CONFIG_SMJPEG_DEMUXER 0
-%define CONFIG_SMUSH_DEMUXER 0
-%define CONFIG_SOL_DEMUXER 0
-%define CONFIG_SOX_DEMUXER 0
-%define CONFIG_SPDIF_DEMUXER 0
-%define CONFIG_SRT_DEMUXER 0
-%define CONFIG_STR_DEMUXER 0
-%define CONFIG_SUBVIEWER1_DEMUXER 0
-%define CONFIG_SUBVIEWER_DEMUXER 0
-%define CONFIG_SWF_DEMUXER 0
-%define CONFIG_TAK_DEMUXER 0
-%define CONFIG_TEDCAPTIONS_DEMUXER 0
-%define CONFIG_THP_DEMUXER 0
-%define CONFIG_TIERTEXSEQ_DEMUXER 0
-%define CONFIG_TMV_DEMUXER 0
-%define CONFIG_TRUEHD_DEMUXER 0
-%define CONFIG_TTA_DEMUXER 0
-%define CONFIG_TXD_DEMUXER 0
-%define CONFIG_TTY_DEMUXER 0
-%define CONFIG_VC1_DEMUXER 0
-%define CONFIG_VC1T_DEMUXER 0
-%define CONFIG_VIVO_DEMUXER 0
-%define CONFIG_VMD_DEMUXER 0
-%define CONFIG_VOBSUB_DEMUXER 0
-%define CONFIG_VOC_DEMUXER 0
-%define CONFIG_VPLAYER_DEMUXER 0
-%define CONFIG_VQF_DEMUXER 0
-%define CONFIG_W64_DEMUXER 0
-%define CONFIG_WAV_DEMUXER 1
-%define CONFIG_WC3_DEMUXER 0
-%define CONFIG_WEBVTT_DEMUXER 0
-%define CONFIG_WSAUD_DEMUXER 0
-%define CONFIG_WSVQA_DEMUXER 0
-%define CONFIG_WTV_DEMUXER 0
-%define CONFIG_WV_DEMUXER 0
-%define CONFIG_XA_DEMUXER 0
-%define CONFIG_XBIN_DEMUXER 0
-%define CONFIG_XMV_DEMUXER 0
-%define CONFIG_XWMA_DEMUXER 0
-%define CONFIG_YOP_DEMUXER 0
-%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
-%define CONFIG_LIBGME_DEMUXER 0
-%define CONFIG_LIBMODPLUG_DEMUXER 0
-%define CONFIG_LIBNUT_DEMUXER 0
-%define CONFIG_LIBQUVI_DEMUXER 0
-%define CONFIG_A64MULTI_ENCODER 0
-%define CONFIG_A64MULTI5_ENCODER 0
-%define CONFIG_AMV_ENCODER 0
-%define CONFIG_ASV1_ENCODER 0
-%define CONFIG_ASV2_ENCODER 0
-%define CONFIG_AVRP_ENCODER 0
-%define CONFIG_AVUI_ENCODER 0
-%define CONFIG_AYUV_ENCODER 0
-%define CONFIG_BMP_ENCODER 0
-%define CONFIG_CLJR_ENCODER 0
-%define CONFIG_COMFORTNOISE_ENCODER 0
-%define CONFIG_DNXHD_ENCODER 0
-%define CONFIG_DPX_ENCODER 0
-%define CONFIG_DVVIDEO_ENCODER 0
-%define CONFIG_FFV1_ENCODER 0
-%define CONFIG_FFVHUFF_ENCODER 0
-%define CONFIG_FLASHSV_ENCODER 0
-%define CONFIG_FLASHSV2_ENCODER 0
-%define CONFIG_FLV_ENCODER 0
-%define CONFIG_GIF_ENCODER 0
-%define CONFIG_H261_ENCODER 0
-%define CONFIG_H263_ENCODER 0
-%define CONFIG_H263P_ENCODER 0
-%define CONFIG_HUFFYUV_ENCODER 0
-%define CONFIG_JPEG2000_ENCODER 0
-%define CONFIG_JPEGLS_ENCODER 0
-%define CONFIG_LJPEG_ENCODER 0
-%define CONFIG_MJPEG_ENCODER 0
-%define CONFIG_MPEG1VIDEO_ENCODER 0
-%define CONFIG_MPEG2VIDEO_ENCODER 0
-%define CONFIG_MPEG4_ENCODER 0
-%define CONFIG_MSMPEG4V2_ENCODER 0
-%define CONFIG_MSMPEG4V3_ENCODER 0
-%define CONFIG_MSVIDEO1_ENCODER 0
-%define CONFIG_PAM_ENCODER 0
-%define CONFIG_PBM_ENCODER 0
-%define CONFIG_PCX_ENCODER 0
-%define CONFIG_PGM_ENCODER 0
-%define CONFIG_PGMYUV_ENCODER 0
-%define CONFIG_PNG_ENCODER 0
-%define CONFIG_PPM_ENCODER 0
-%define CONFIG_PRORES_ENCODER 0
-%define CONFIG_PRORES_AW_ENCODER 0
-%define CONFIG_PRORES_KS_ENCODER 0
-%define CONFIG_QTRLE_ENCODER 0
-%define CONFIG_R10K_ENCODER 0
-%define CONFIG_R210_ENCODER 0
-%define CONFIG_RAWVIDEO_ENCODER 0
-%define CONFIG_ROQ_ENCODER 0
-%define CONFIG_RV10_ENCODER 0
-%define CONFIG_RV20_ENCODER 0
-%define CONFIG_S302M_ENCODER 0
-%define CONFIG_SGI_ENCODER 0
-%define CONFIG_SNOW_ENCODER 0
-%define CONFIG_SUNRAST_ENCODER 0
-%define CONFIG_SVQ1_ENCODER 0
-%define CONFIG_TARGA_ENCODER 0
-%define CONFIG_TIFF_ENCODER 0
-%define CONFIG_UTVIDEO_ENCODER 0
-%define CONFIG_V210_ENCODER 0
-%define CONFIG_V308_ENCODER 0
-%define CONFIG_V408_ENCODER 0
-%define CONFIG_V410_ENCODER 0
-%define CONFIG_WMV1_ENCODER 0
-%define CONFIG_WMV2_ENCODER 0
-%define CONFIG_XBM_ENCODER 0
-%define CONFIG_XFACE_ENCODER 0
-%define CONFIG_XWD_ENCODER 0
-%define CONFIG_Y41P_ENCODER 0
-%define CONFIG_YUV4_ENCODER 0
-%define CONFIG_ZLIB_ENCODER 0
-%define CONFIG_ZMBV_ENCODER 0
-%define CONFIG_AAC_ENCODER 0
-%define CONFIG_AC3_ENCODER 0
-%define CONFIG_AC3_FIXED_ENCODER 0
-%define CONFIG_ALAC_ENCODER 0
-%define CONFIG_DCA_ENCODER 0
-%define CONFIG_EAC3_ENCODER 0
-%define CONFIG_FLAC_ENCODER 0
-%define CONFIG_G723_1_ENCODER 0
-%define CONFIG_MP2_ENCODER 0
-%define CONFIG_MP2FIXED_ENCODER 0
-%define CONFIG_NELLYMOSER_ENCODER 0
-%define CONFIG_RA_144_ENCODER 0
-%define CONFIG_SONIC_ENCODER 0
-%define CONFIG_SONIC_LS_ENCODER 0
-%define CONFIG_TTA_ENCODER 0
-%define CONFIG_VORBIS_ENCODER 0
-%define CONFIG_WAVPACK_ENCODER 0
-%define CONFIG_WMAV1_ENCODER 0
-%define CONFIG_WMAV2_ENCODER 0
-%define CONFIG_PCM_ALAW_ENCODER 0
-%define CONFIG_PCM_F32BE_ENCODER 0
-%define CONFIG_PCM_F32LE_ENCODER 0
-%define CONFIG_PCM_F64BE_ENCODER 0
-%define CONFIG_PCM_F64LE_ENCODER 0
-%define CONFIG_PCM_MULAW_ENCODER 0
-%define CONFIG_PCM_S8_ENCODER 0
-%define CONFIG_PCM_S8_PLANAR_ENCODER 0
-%define CONFIG_PCM_S16BE_ENCODER 0
-%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S16LE_ENCODER 0
-%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S24BE_ENCODER 0
-%define CONFIG_PCM_S24DAUD_ENCODER 0
-%define CONFIG_PCM_S24LE_ENCODER 0
-%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_S32BE_ENCODER 0
-%define CONFIG_PCM_S32LE_ENCODER 0
-%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
-%define CONFIG_PCM_U8_ENCODER 0
-%define CONFIG_PCM_U16BE_ENCODER 0
-%define CONFIG_PCM_U16LE_ENCODER 0
-%define CONFIG_PCM_U24BE_ENCODER 0
-%define CONFIG_PCM_U24LE_ENCODER 0
-%define CONFIG_PCM_U32BE_ENCODER 0
-%define CONFIG_PCM_U32LE_ENCODER 0
-%define CONFIG_ROQ_DPCM_ENCODER 0
-%define CONFIG_ADPCM_ADX_ENCODER 0
-%define CONFIG_ADPCM_G722_ENCODER 0
-%define CONFIG_ADPCM_G726_ENCODER 0
-%define CONFIG_ADPCM_IMA_QT_ENCODER 0
-%define CONFIG_ADPCM_IMA_WAV_ENCODER 0
-%define CONFIG_ADPCM_MS_ENCODER 0
-%define CONFIG_ADPCM_SWF_ENCODER 0
-%define CONFIG_ADPCM_YAMAHA_ENCODER 0
-%define CONFIG_SSA_ENCODER 0
-%define CONFIG_ASS_ENCODER 0
-%define CONFIG_DVBSUB_ENCODER 0
-%define CONFIG_DVDSUB_ENCODER 0
-%define CONFIG_MOVTEXT_ENCODER 0
-%define CONFIG_SRT_ENCODER 0
-%define CONFIG_SUBRIP_ENCODER 0
-%define CONFIG_XSUB_ENCODER 0
-%define CONFIG_LIBFAAC_ENCODER 0
-%define CONFIG_LIBFDK_AAC_ENCODER 0
-%define CONFIG_LIBGSM_ENCODER 0
-%define CONFIG_LIBGSM_MS_ENCODER 0
-%define CONFIG_LIBILBC_ENCODER 0
-%define CONFIG_LIBMP3LAME_ENCODER 0
-%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
-%define CONFIG_LIBOPENJPEG_ENCODER 0
-%define CONFIG_LIBOPUS_ENCODER 0
-%define CONFIG_LIBSCHROEDINGER_ENCODER 0
-%define CONFIG_LIBSHINE_ENCODER 0
-%define CONFIG_LIBSPEEX_ENCODER 0
-%define CONFIG_LIBTHEORA_ENCODER 0
-%define CONFIG_LIBTWOLAME_ENCODER 0
-%define CONFIG_LIBUTVIDEO_ENCODER 0
-%define CONFIG_LIBVO_AACENC_ENCODER 0
-%define CONFIG_LIBVO_AMRWBENC_ENCODER 0
-%define CONFIG_LIBVORBIS_ENCODER 0
-%define CONFIG_LIBVPX_VP8_ENCODER 0
-%define CONFIG_LIBVPX_VP9_ENCODER 0
-%define CONFIG_LIBWAVPACK_ENCODER 0
-%define CONFIG_LIBX264_ENCODER 0
-%define CONFIG_LIBX264RGB_ENCODER 0
-%define CONFIG_LIBXAVS_ENCODER 0
-%define CONFIG_LIBXVID_ENCODER 0
-%define CONFIG_LIBAACPLUS_ENCODER 0
-%define CONFIG_ACONVERT_FILTER 0
-%define CONFIG_ADELAY_FILTER 0
-%define CONFIG_AECHO_FILTER 0
-%define CONFIG_AEVAL_FILTER 0
-%define CONFIG_AFADE_FILTER 0
-%define CONFIG_AFORMAT_FILTER 0
-%define CONFIG_AINTERLEAVE_FILTER 0
-%define CONFIG_ALLPASS_FILTER 0
-%define CONFIG_AMERGE_FILTER 0
-%define CONFIG_AMIX_FILTER 0
-%define CONFIG_ANULL_FILTER 0
-%define CONFIG_APAD_FILTER 0
-%define CONFIG_APERMS_FILTER 0
-%define CONFIG_APHASER_FILTER 0
-%define CONFIG_ARESAMPLE_FILTER 0
-%define CONFIG_ASELECT_FILTER 0
-%define CONFIG_ASENDCMD_FILTER 0
-%define CONFIG_ASETNSAMPLES_FILTER 0
-%define CONFIG_ASETPTS_FILTER 0
-%define CONFIG_ASETRATE_FILTER 0
-%define CONFIG_ASETTB_FILTER 0
-%define CONFIG_ASHOWINFO_FILTER 0
-%define CONFIG_ASPLIT_FILTER 0
-%define CONFIG_ASTATS_FILTER 0
-%define CONFIG_ASTREAMSYNC_FILTER 0
-%define CONFIG_ASYNCTS_FILTER 0
-%define CONFIG_ATEMPO_FILTER 0
-%define CONFIG_ATRIM_FILTER 0
-%define CONFIG_AZMQ_FILTER 0
-%define CONFIG_BANDPASS_FILTER 0
-%define CONFIG_BANDREJECT_FILTER 0
-%define CONFIG_BASS_FILTER 0
-%define CONFIG_BIQUAD_FILTER 0
-%define CONFIG_CHANNELMAP_FILTER 0
-%define CONFIG_CHANNELSPLIT_FILTER 0
-%define CONFIG_COMPAND_FILTER 0
-%define CONFIG_EARWAX_FILTER 0
-%define CONFIG_EBUR128_FILTER 0
-%define CONFIG_EQUALIZER_FILTER 0
-%define CONFIG_HIGHPASS_FILTER 0
-%define CONFIG_JOIN_FILTER 0
-%define CONFIG_LADSPA_FILTER 0
-%define CONFIG_LOWPASS_FILTER 0
-%define CONFIG_PAN_FILTER 0
-%define CONFIG_REPLAYGAIN_FILTER 0
-%define CONFIG_RESAMPLE_FILTER 0
-%define CONFIG_SILENCEDETECT_FILTER 0
-%define CONFIG_TREBLE_FILTER 0
-%define CONFIG_VOLUME_FILTER 0
-%define CONFIG_VOLUMEDETECT_FILTER 0
-%define CONFIG_AEVALSRC_FILTER 0
-%define CONFIG_ANULLSRC_FILTER 0
-%define CONFIG_FLITE_FILTER 0
-%define CONFIG_SINE_FILTER 0
-%define CONFIG_ANULLSINK_FILTER 0
-%define CONFIG_ALPHAEXTRACT_FILTER 0
-%define CONFIG_ALPHAMERGE_FILTER 0
-%define CONFIG_ASS_FILTER 0
-%define CONFIG_BBOX_FILTER 0
-%define CONFIG_BLACKDETECT_FILTER 0
-%define CONFIG_BLACKFRAME_FILTER 0
-%define CONFIG_BLEND_FILTER 0
-%define CONFIG_BOXBLUR_FILTER 0
-%define CONFIG_COLORBALANCE_FILTER 0
-%define CONFIG_COLORCHANNELMIXER_FILTER 0
-%define CONFIG_COLORMATRIX_FILTER 0
-%define CONFIG_COPY_FILTER 0
-%define CONFIG_CROP_FILTER 0
-%define CONFIG_CROPDETECT_FILTER 0
-%define CONFIG_CURVES_FILTER 0
-%define CONFIG_DCTDNOIZ_FILTER 0
-%define CONFIG_DECIMATE_FILTER 0
-%define CONFIG_DELOGO_FILTER 0
-%define CONFIG_DESHAKE_FILTER 0
-%define CONFIG_DRAWBOX_FILTER 0
-%define CONFIG_DRAWGRID_FILTER 0
-%define CONFIG_DRAWTEXT_FILTER 0
-%define CONFIG_EDGEDETECT_FILTER 0
-%define CONFIG_ELBG_FILTER 0
-%define CONFIG_EXTRACTPLANES_FILTER 0
-%define CONFIG_FADE_FILTER 0
-%define CONFIG_FIELD_FILTER 0
-%define CONFIG_FIELDMATCH_FILTER 0
-%define CONFIG_FIELDORDER_FILTER 0
-%define CONFIG_FORMAT_FILTER 0
-%define CONFIG_FPS_FILTER 0
-%define CONFIG_FRAMESTEP_FILTER 0
-%define CONFIG_FREI0R_FILTER 0
-%define CONFIG_GEQ_FILTER 0
-%define CONFIG_GRADFUN_FILTER 0
-%define CONFIG_HALDCLUT_FILTER 0
-%define CONFIG_HFLIP_FILTER 0
-%define CONFIG_HISTEQ_FILTER 0
-%define CONFIG_HISTOGRAM_FILTER 0
-%define CONFIG_HQDN3D_FILTER 0
-%define CONFIG_HUE_FILTER 0
-%define CONFIG_IDET_FILTER 0
-%define CONFIG_IL_FILTER 0
-%define CONFIG_INTERLACE_FILTER 0
-%define CONFIG_INTERLEAVE_FILTER 0
-%define CONFIG_KERNDEINT_FILTER 0
-%define CONFIG_LUT3D_FILTER 0
-%define CONFIG_LUT_FILTER 0
-%define CONFIG_LUTRGB_FILTER 0
-%define CONFIG_LUTYUV_FILTER 0
-%define CONFIG_MCDEINT_FILTER 0
-%define CONFIG_MERGEPLANES_FILTER 0
-%define CONFIG_MP_FILTER 0
-%define CONFIG_MPDECIMATE_FILTER 0
-%define CONFIG_NEGATE_FILTER 0
-%define CONFIG_NOFORMAT_FILTER 0
-%define CONFIG_NOISE_FILTER 0
-%define CONFIG_NULL_FILTER 0
-%define CONFIG_OCV_FILTER 0
-%define CONFIG_OVERLAY_FILTER 0
-%define CONFIG_OWDENOISE_FILTER 0
-%define CONFIG_PAD_FILTER 0
-%define CONFIG_PERMS_FILTER 0
-%define CONFIG_PERSPECTIVE_FILTER 0
-%define CONFIG_PHASE_FILTER 0
-%define CONFIG_PIXDESCTEST_FILTER 0
-%define CONFIG_PP_FILTER 0
-%define CONFIG_PSNR_FILTER 0
-%define CONFIG_PULLUP_FILTER 0
-%define CONFIG_REMOVELOGO_FILTER 0
-%define CONFIG_ROTATE_FILTER 0
-%define CONFIG_SAB_FILTER 0
-%define CONFIG_SCALE_FILTER 0
-%define CONFIG_SELECT_FILTER 0
-%define CONFIG_SENDCMD_FILTER 0
-%define CONFIG_SEPARATEFIELDS_FILTER 0
-%define CONFIG_SETDAR_FILTER 0
-%define CONFIG_SETFIELD_FILTER 0
-%define CONFIG_SETPTS_FILTER 0
-%define CONFIG_SETSAR_FILTER 0
-%define CONFIG_SETTB_FILTER 0
-%define CONFIG_SHOWINFO_FILTER 0
-%define CONFIG_SMARTBLUR_FILTER 0
-%define CONFIG_SPLIT_FILTER 0
-%define CONFIG_SPP_FILTER 0
-%define CONFIG_STEREO3D_FILTER 0
-%define CONFIG_SUBTITLES_FILTER 0
-%define CONFIG_SUPER2XSAI_FILTER 0
-%define CONFIG_SWAPUV_FILTER 0
-%define CONFIG_TELECINE_FILTER 0
-%define CONFIG_THUMBNAIL_FILTER 0
-%define CONFIG_TILE_FILTER 0
-%define CONFIG_TINTERLACE_FILTER 0
-%define CONFIG_TRANSPOSE_FILTER 0
-%define CONFIG_TRIM_FILTER 0
-%define CONFIG_UNSHARP_FILTER 0
-%define CONFIG_VFLIP_FILTER 0
-%define CONFIG_VIDSTABDETECT_FILTER 0
-%define CONFIG_VIDSTABTRANSFORM_FILTER 0
-%define CONFIG_VIGNETTE_FILTER 0
-%define CONFIG_W3FDIF_FILTER 0
-%define CONFIG_YADIF_FILTER 0
-%define CONFIG_ZMQ_FILTER 0
-%define CONFIG_CELLAUTO_FILTER 0
-%define CONFIG_COLOR_FILTER 0
-%define CONFIG_FREI0R_SRC_FILTER 0
-%define CONFIG_HALDCLUTSRC_FILTER 0
-%define CONFIG_LIFE_FILTER 0
-%define CONFIG_MANDELBROT_FILTER 0
-%define CONFIG_MPTESTSRC_FILTER 0
-%define CONFIG_NULLSRC_FILTER 0
-%define CONFIG_RGBTESTSRC_FILTER 0
-%define CONFIG_SMPTEBARS_FILTER 0
-%define CONFIG_SMPTEHDBARS_FILTER 0
-%define CONFIG_TESTSRC_FILTER 0
-%define CONFIG_NULLSINK_FILTER 0
-%define CONFIG_AVECTORSCOPE_FILTER 0
-%define CONFIG_CONCAT_FILTER 0
-%define CONFIG_SHOWSPECTRUM_FILTER 0
-%define CONFIG_SHOWWAVES_FILTER 0
-%define CONFIG_AMOVIE_FILTER 0
-%define CONFIG_MOVIE_FILTER 0
-%define CONFIG_H263_VAAPI_HWACCEL 0
-%define CONFIG_H263_VDPAU_HWACCEL 0
-%define CONFIG_H264_DXVA2_HWACCEL 0
-%define CONFIG_H264_VAAPI_HWACCEL 0
-%define CONFIG_H264_VDA_HWACCEL 0
-%define CONFIG_H264_VDPAU_HWACCEL 0
-%define CONFIG_MPEG1_VDPAU_HWACCEL 0
-%define CONFIG_MPEG2_DXVA2_HWACCEL 0
-%define CONFIG_MPEG2_VAAPI_HWACCEL 0
-%define CONFIG_MPEG2_VDPAU_HWACCEL 0
-%define CONFIG_MPEG4_VAAPI_HWACCEL 0
-%define CONFIG_MPEG4_VDPAU_HWACCEL 0
-%define CONFIG_VC1_DXVA2_HWACCEL 0
-%define CONFIG_VC1_VAAPI_HWACCEL 0
-%define CONFIG_VC1_VDPAU_HWACCEL 0
-%define CONFIG_WMV3_DXVA2_HWACCEL 0
-%define CONFIG_WMV3_VAAPI_HWACCEL 0
-%define CONFIG_WMV3_VDPAU_HWACCEL 0
-%define CONFIG_ALSA_INDEV 0
-%define CONFIG_BKTR_INDEV 0
-%define CONFIG_DSHOW_INDEV 0
-%define CONFIG_DV1394_INDEV 0
-%define CONFIG_FBDEV_INDEV 0
-%define CONFIG_IEC61883_INDEV 0
-%define CONFIG_JACK_INDEV 0
-%define CONFIG_LAVFI_INDEV 0
-%define CONFIG_OPENAL_INDEV 0
-%define CONFIG_OSS_INDEV 0
-%define CONFIG_PULSE_INDEV 0
-%define CONFIG_SNDIO_INDEV 0
-%define CONFIG_V4L2_INDEV 0
-%define CONFIG_VFWCAP_INDEV 0
-%define CONFIG_X11GRAB_INDEV 0
-%define CONFIG_LIBCDIO_INDEV 0
-%define CONFIG_LIBDC1394_INDEV 0
-%define CONFIG_A64_MUXER 0
-%define CONFIG_AC3_MUXER 0
-%define CONFIG_ADTS_MUXER 0
-%define CONFIG_ADX_MUXER 0
-%define CONFIG_AIFF_MUXER 0
-%define CONFIG_AMR_MUXER 0
-%define CONFIG_ASF_MUXER 0
-%define CONFIG_ASS_MUXER 0
-%define CONFIG_AST_MUXER 0
-%define CONFIG_ASF_STREAM_MUXER 0
-%define CONFIG_AU_MUXER 0
-%define CONFIG_AVI_MUXER 0
-%define CONFIG_AVM2_MUXER 0
-%define CONFIG_BIT_MUXER 0
-%define CONFIG_CAF_MUXER 0
-%define CONFIG_CAVSVIDEO_MUXER 0
-%define CONFIG_CRC_MUXER 0
-%define CONFIG_DATA_MUXER 0
-%define CONFIG_DAUD_MUXER 0
-%define CONFIG_DIRAC_MUXER 0
-%define CONFIG_DNXHD_MUXER 0
-%define CONFIG_DTS_MUXER 0
-%define CONFIG_DV_MUXER 0
-%define CONFIG_EAC3_MUXER 0
-%define CONFIG_F4V_MUXER 0
-%define CONFIG_FFM_MUXER 0
-%define CONFIG_FFMETADATA_MUXER 0
-%define CONFIG_FILMSTRIP_MUXER 0
-%define CONFIG_FLAC_MUXER 0
-%define CONFIG_FLV_MUXER 0
-%define CONFIG_FRAMECRC_MUXER 0
-%define CONFIG_FRAMEMD5_MUXER 0
-%define CONFIG_G722_MUXER 0
-%define CONFIG_G723_1_MUXER 0
-%define CONFIG_GIF_MUXER 0
-%define CONFIG_GXF_MUXER 0
-%define CONFIG_H261_MUXER 0
-%define CONFIG_H263_MUXER 0
-%define CONFIG_H264_MUXER 0
-%define CONFIG_HDS_MUXER 0
-%define CONFIG_HLS_MUXER 0
-%define CONFIG_ICO_MUXER 0
-%define CONFIG_ILBC_MUXER 0
-%define CONFIG_IMAGE2_MUXER 0
-%define CONFIG_IMAGE2PIPE_MUXER 0
-%define CONFIG_IPOD_MUXER 0
-%define CONFIG_IRCAM_MUXER 0
-%define CONFIG_ISMV_MUXER 0
-%define CONFIG_IVF_MUXER 0
-%define CONFIG_JACOSUB_MUXER 0
-%define CONFIG_LATM_MUXER 0
-%define CONFIG_M4V_MUXER 0
-%define CONFIG_MD5_MUXER 0
-%define CONFIG_MATROSKA_MUXER 0
-%define CONFIG_MATROSKA_AUDIO_MUXER 0
-%define CONFIG_MICRODVD_MUXER 0
-%define CONFIG_MJPEG_MUXER 0
-%define CONFIG_MLP_MUXER 0
-%define CONFIG_MMF_MUXER 0
-%define CONFIG_MOV_MUXER 0
-%define CONFIG_MP2_MUXER 0
-%define CONFIG_MP3_MUXER 0
-%define CONFIG_MP4_MUXER 0
-%define CONFIG_MPEG1SYSTEM_MUXER 0
-%define CONFIG_MPEG1VCD_MUXER 0
-%define CONFIG_MPEG1VIDEO_MUXER 0
-%define CONFIG_MPEG2DVD_MUXER 0
-%define CONFIG_MPEG2SVCD_MUXER 0
-%define CONFIG_MPEG2VIDEO_MUXER 0
-%define CONFIG_MPEG2VOB_MUXER 0
-%define CONFIG_MPEGTS_MUXER 0
-%define CONFIG_MPJPEG_MUXER 0
-%define CONFIG_MXF_MUXER 0
-%define CONFIG_MXF_D10_MUXER 0
-%define CONFIG_NULL_MUXER 0
-%define CONFIG_NUT_MUXER 0
-%define CONFIG_OGG_MUXER 0
-%define CONFIG_OMA_MUXER 0
-%define CONFIG_OPUS_MUXER 0
-%define CONFIG_PCM_ALAW_MUXER 0
-%define CONFIG_PCM_MULAW_MUXER 0
-%define CONFIG_PCM_F64BE_MUXER 0
-%define CONFIG_PCM_F64LE_MUXER 0
-%define CONFIG_PCM_F32BE_MUXER 0
-%define CONFIG_PCM_F32LE_MUXER 0
-%define CONFIG_PCM_S32BE_MUXER 0
-%define CONFIG_PCM_S32LE_MUXER 0
-%define CONFIG_PCM_S24BE_MUXER 0
-%define CONFIG_PCM_S24LE_MUXER 0
-%define CONFIG_PCM_S16BE_MUXER 0
-%define CONFIG_PCM_S16LE_MUXER 0
-%define CONFIG_PCM_S8_MUXER 0
-%define CONFIG_PCM_U32BE_MUXER 0
-%define CONFIG_PCM_U32LE_MUXER 0
-%define CONFIG_PCM_U24BE_MUXER 0
-%define CONFIG_PCM_U24LE_MUXER 0
-%define CONFIG_PCM_U16BE_MUXER 0
-%define CONFIG_PCM_U16LE_MUXER 0
-%define CONFIG_PCM_U8_MUXER 0
-%define CONFIG_PSP_MUXER 0
-%define CONFIG_RAWVIDEO_MUXER 0
-%define CONFIG_RM_MUXER 0
-%define CONFIG_ROQ_MUXER 0
-%define CONFIG_RSO_MUXER 0
-%define CONFIG_RTP_MUXER 0
-%define CONFIG_RTSP_MUXER 0
-%define CONFIG_SAP_MUXER 0
-%define CONFIG_SEGMENT_MUXER 0
-%define CONFIG_STREAM_SEGMENT_MUXER 0
-%define CONFIG_SMJPEG_MUXER 0
-%define CONFIG_SMOOTHSTREAMING_MUXER 0
-%define CONFIG_SOX_MUXER 0
-%define CONFIG_SPDIF_MUXER 0
-%define CONFIG_SPEEX_MUXER 0
-%define CONFIG_SRT_MUXER 0
-%define CONFIG_SWF_MUXER 0
-%define CONFIG_TEE_MUXER 0
-%define CONFIG_TG2_MUXER 0
-%define CONFIG_TGP_MUXER 0
-%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
-%define CONFIG_TRUEHD_MUXER 0
-%define CONFIG_VC1_MUXER 0
-%define CONFIG_VC1T_MUXER 0
-%define CONFIG_VOC_MUXER 0
-%define CONFIG_W64_MUXER 0
-%define CONFIG_WAV_MUXER 0
-%define CONFIG_WEBM_MUXER 0
-%define CONFIG_WEBVTT_MUXER 0
-%define CONFIG_WTV_MUXER 0
-%define CONFIG_WV_MUXER 0
-%define CONFIG_YUV4MPEGPIPE_MUXER 0
-%define CONFIG_LIBNUT_MUXER 0
-%define CONFIG_ALSA_OUTDEV 0
-%define CONFIG_CACA_OUTDEV 0
-%define CONFIG_FBDEV_OUTDEV 0
-%define CONFIG_OSS_OUTDEV 0
-%define CONFIG_PULSE_OUTDEV 0
-%define CONFIG_SDL_OUTDEV 0
-%define CONFIG_SNDIO_OUTDEV 0
-%define CONFIG_V4L2_OUTDEV 0
-%define CONFIG_XV_OUTDEV 0
-%define CONFIG_AAC_PARSER 0
-%define CONFIG_AAC_LATM_PARSER 0
-%define CONFIG_AC3_PARSER 0
-%define CONFIG_ADX_PARSER 0
-%define CONFIG_BMP_PARSER 0
-%define CONFIG_CAVSVIDEO_PARSER 0
-%define CONFIG_COOK_PARSER 0
-%define CONFIG_DCA_PARSER 0
-%define CONFIG_DIRAC_PARSER 0
-%define CONFIG_DNXHD_PARSER 0
-%define CONFIG_DPX_PARSER 0
-%define CONFIG_DVBSUB_PARSER 0
-%define CONFIG_DVDSUB_PARSER 0
-%define CONFIG_DVD_NAV_PARSER 0
-%define CONFIG_FLAC_PARSER 0
-%define CONFIG_GSM_PARSER 0
-%define CONFIG_H261_PARSER 0
-%define CONFIG_H263_PARSER 0
-%define CONFIG_H264_PARSER 0
-%define CONFIG_HEVC_PARSER 0
-%define CONFIG_MJPEG_PARSER 0
-%define CONFIG_MLP_PARSER 0
-%define CONFIG_MPEG4VIDEO_PARSER 0
-%define CONFIG_MPEGAUDIO_PARSER 0
-%define CONFIG_MPEGVIDEO_PARSER 0
-%define CONFIG_PNG_PARSER 0
-%define CONFIG_PNM_PARSER 0
-%define CONFIG_RV30_PARSER 0
-%define CONFIG_RV40_PARSER 0
-%define CONFIG_TAK_PARSER 0
-%define CONFIG_VC1_PARSER 0
-%define CONFIG_VORBIS_PARSER 1
-%define CONFIG_VP3_PARSER 1
-%define CONFIG_VP8_PARSER 1
-%define CONFIG_VP9_PARSER 0
-%define CONFIG_BLURAY_PROTOCOL 0
-%define CONFIG_CACHE_PROTOCOL 0
-%define CONFIG_CONCAT_PROTOCOL 0
-%define CONFIG_CRYPTO_PROTOCOL 0
-%define CONFIG_DATA_PROTOCOL 0
-%define CONFIG_FFRTMPCRYPT_PROTOCOL 0
-%define CONFIG_FFRTMPHTTP_PROTOCOL 0
-%define CONFIG_FILE_PROTOCOL 0
-%define CONFIG_FTP_PROTOCOL 0
-%define CONFIG_GOPHER_PROTOCOL 0
-%define CONFIG_HLS_PROTOCOL 0
-%define CONFIG_HTTP_PROTOCOL 0
-%define CONFIG_HTTPPROXY_PROTOCOL 0
-%define CONFIG_HTTPS_PROTOCOL 0
-%define CONFIG_MMSH_PROTOCOL 0
-%define CONFIG_MMST_PROTOCOL 0
-%define CONFIG_MD5_PROTOCOL 0
-%define CONFIG_PIPE_PROTOCOL 0
-%define CONFIG_RTMP_PROTOCOL 0
-%define CONFIG_RTMPE_PROTOCOL 0
-%define CONFIG_RTMPS_PROTOCOL 0
-%define CONFIG_RTMPT_PROTOCOL 0
-%define CONFIG_RTMPTE_PROTOCOL 0
-%define CONFIG_RTMPTS_PROTOCOL 0
-%define CONFIG_RTP_PROTOCOL 0
-%define CONFIG_SCTP_PROTOCOL 0
-%define CONFIG_SRTP_PROTOCOL 0
-%define CONFIG_TCP_PROTOCOL 0
-%define CONFIG_TLS_PROTOCOL 0
-%define CONFIG_UDP_PROTOCOL 0
-%define CONFIG_UNIX_PROTOCOL 0
-%define CONFIG_LIBRTMP_PROTOCOL 0
-%define CONFIG_LIBRTMPE_PROTOCOL 0
-%define CONFIG_LIBRTMPS_PROTOCOL 0
-%define CONFIG_LIBRTMPT_PROTOCOL 0
-%define CONFIG_LIBRTMPTE_PROTOCOL 0
-%define CONFIG_LIBSSH_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/config.h
deleted file mode 100644
index f526002cb56..00000000000
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/config.h
+++ /dev/null
@@ -1,1661 +0,0 @@
-/* Automatically generated by configure - do not modify! */
-#ifndef FFMPEG_CONFIG_H
-#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --disable-error-resilience"
-#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
-#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
-#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64"
-#define av_restrict __restrict
-#define EXTERN_PREFIX ""
-#define EXTERN_ASM
-#define BUILDSUF ""
-#define SLIBSUF ".dll"
-#define HAVE_MMX2 HAVE_MMXEXT
-#define ARCH_AARCH64 0
-#define ARCH_ALPHA 0
-#define ARCH_ARM 0
-#define ARCH_AVR32 0
-#define ARCH_AVR32_AP 0
-#define ARCH_AVR32_UC 0
-#define ARCH_BFIN 0
-#define ARCH_IA64 0
-#define ARCH_M68K 0
-#define ARCH_MIPS 0
-#define ARCH_MIPS64 0
-#define ARCH_PARISC 0
-#define ARCH_PPC 0
-#define ARCH_PPC64 0
-#define ARCH_S390 0
-#define ARCH_SH4 0
-#define ARCH_SPARC 0
-#define ARCH_SPARC64 0
-#define ARCH_TILEGX 0
-#define ARCH_TILEPRO 0
-#define ARCH_TOMI 0
-#define ARCH_X86 1
-#define ARCH_X86_32 0
-#define ARCH_X86_64 1
-#define HAVE_ARMV5TE 0
-#define HAVE_ARMV6 0
-#define HAVE_ARMV6T2 0
-#define HAVE_NEON 0
-#define HAVE_VFP 0
-#define HAVE_VFPV3 0
-#define HAVE_AMD3DNOW 1
-#define HAVE_AMD3DNOWEXT 1
-#define HAVE_AVX 1
-#define HAVE_AVX2 1
-#define HAVE_FMA4 1
-#define HAVE_I686 1
-#define HAVE_MMX 1
-#define HAVE_MMXEXT 1
-#define HAVE_SSE 1
-#define HAVE_SSE2 1
-#define HAVE_SSE3 1
-#define HAVE_SSE4 1
-#define HAVE_SSE42 1
-#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
-#define HAVE_MIPSFPU 0
-#define HAVE_MIPS32R2 0
-#define HAVE_MIPSDSPR1 0
-#define HAVE_MIPSDSPR2 0
-#define HAVE_ARMV5TE_EXTERNAL 0
-#define HAVE_ARMV6_EXTERNAL 0
-#define HAVE_ARMV6T2_EXTERNAL 0
-#define HAVE_NEON_EXTERNAL 0
-#define HAVE_VFP_EXTERNAL 0
-#define HAVE_VFPV3_EXTERNAL 0
-#define HAVE_AMD3DNOW_EXTERNAL 1
-#define HAVE_AMD3DNOWEXT_EXTERNAL 1
-#define HAVE_AVX_EXTERNAL 1
-#define HAVE_AVX2_EXTERNAL 1
-#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
-#define HAVE_MMX_EXTERNAL 1
-#define HAVE_MMXEXT_EXTERNAL 1
-#define HAVE_SSE_EXTERNAL 1
-#define HAVE_SSE2_EXTERNAL 1
-#define HAVE_SSE3_EXTERNAL 1
-#define HAVE_SSE4_EXTERNAL 1
-#define HAVE_SSE42_EXTERNAL 1
-#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
-#define HAVE_MIPSFPU_EXTERNAL 0
-#define HAVE_MIPS32R2_EXTERNAL 0
-#define HAVE_MIPSDSPR1_EXTERNAL 0
-#define HAVE_MIPSDSPR2_EXTERNAL 0
-#define HAVE_ARMV5TE_INLINE 0
-#define HAVE_ARMV6_INLINE 0
-#define HAVE_ARMV6T2_INLINE 0
-#define HAVE_NEON_INLINE 0
-#define HAVE_VFP_INLINE 0
-#define HAVE_VFPV3_INLINE 0
-#define HAVE_AMD3DNOW_INLINE 0
-#define HAVE_AMD3DNOWEXT_INLINE 0
-#define HAVE_AVX_INLINE 0
-#define HAVE_AVX2_INLINE 0
-#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
-#define HAVE_MMX_INLINE 0
-#define HAVE_MMXEXT_INLINE 0
-#define HAVE_SSE_INLINE 0
-#define HAVE_SSE2_INLINE 0
-#define HAVE_SSE3_INLINE 0
-#define HAVE_SSE4_INLINE 0
-#define HAVE_SSE42_INLINE 0
-#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
-#define HAVE_MIPSFPU_INLINE 0
-#define HAVE_MIPS32R2_INLINE 0
-#define HAVE_MIPSDSPR1_INLINE 0
-#define HAVE_MIPSDSPR2_INLINE 0
-#define HAVE_INLINE_ASM 0
-#define HAVE_SYMVER 0
-#define HAVE_YASM 1
-#define HAVE_BIGENDIAN 0
-#define HAVE_FAST_UNALIGNED 1
-#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 0
-#define HAVE_W32THREADS 1
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 0
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 1
-#define HAVE_ATANF 1
-#define HAVE_ATAN2F 1
-#define HAVE_CBRT 1
-#define HAVE_CBRTF 1
-#define HAVE_COSF 1
-#define HAVE_EXP2 1
-#define HAVE_EXP2F 1
-#define HAVE_EXPF 1
-#define HAVE_ISINF 1
-#define HAVE_ISNAN 1
-#define HAVE_LDEXPF 1
-#define HAVE_LLRINT 1
-#define HAVE_LLRINTF 1
-#define HAVE_LOG2 0
-#define HAVE_LOG2F 1
-#define HAVE_LOG10F 1
-#define HAVE_LRINT 1
-#define HAVE_LRINTF 1
-#define HAVE_POWF 1
-#define HAVE_RINT 1
-#define HAVE_ROUND 1
-#define HAVE_ROUNDF 1
-#define HAVE_SINF 1
-#define HAVE_TRUNC 1
-#define HAVE_TRUNCF 1
-#define HAVE_ACCESS 1
-#define HAVE_ALIGNED_MALLOC 1
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 0
-#define HAVE_ATTRIBUTE_PACKED 0
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
-#define HAVE_CLOCK_GETTIME 0
-#define HAVE_CLOSESOCKET 0
-#define HAVE_COMMANDLINETOARGVW 1
-#define HAVE_CPUNOP 1
-#define HAVE_CRYPTGENRANDOM 1
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 1
-#define HAVE_DLFCN_H 0
-#define HAVE_DLOPEN 0
-#define HAVE_DOS_PATHS 1
-#define HAVE_DXVA_H 1
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 1
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 1
-#define HAVE_FCNTL 0
-#define HAVE_FORK 0
-#define HAVE_GETADDRINFO 0
-#define HAVE_GETHRTIME 0
-#define HAVE_GETOPT 0
-#define HAVE_GETPROCESSAFFINITYMASK 1
-#define HAVE_GETPROCESSMEMORYINFO 1
-#define HAVE_GETPROCESSTIMES 1
-#define HAVE_GETSYSTEMTIMEASFILETIME 1
-#define HAVE_GETRUSAGE 0
-#define HAVE_GETSERVBYPORT 0
-#define HAVE_GETTIMEOFDAY 0
-#define HAVE_GLOB 0
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 0
-#define HAVE_IO_H 1
-#define HAVE_INLINE_ASM_LABELS 0
-#define HAVE_ISATTY 1
-#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
-#define HAVE_KBHIT 1
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 1
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
-#define HAVE_LOCALTIME_R 0
-#define HAVE_LOONGSON 0
-#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MAPVIEWOFFILE 1
-#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 1
-#define HAVE_MKSTEMP 0
-#define HAVE_MM_EMPTY 0
-#define HAVE_MMAP 0
-#define HAVE_MPROTECT 0
-#define HAVE_NANOSLEEP 0
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
-#define HAVE_PEEKNAMEDPIPE 1
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 0
-#define HAVE_POSIX_MEMALIGN 0
-#define HAVE_PRAGMA_DEPRECATED 1
-#define HAVE_PTHREAD_CANCEL 0
-#define HAVE_RDTSC 1
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 0
-#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
-#define HAVE_SETCONSOLETEXTATTRIBUTE 1
-#define HAVE_SETMODE 1
-#define HAVE_SETRLIMIT 0
-#define HAVE_SLEEP 1
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
-#define HAVE_STRERROR_R 0
-#define HAVE_STRUCT_ADDRINFO 0
-#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
-#define HAVE_STRUCT_IP_MREQ_SOURCE 0
-#define HAVE_STRUCT_IPV6_MREQ 0
-#define HAVE_STRUCT_POLLFD 0
-#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0
-#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
-#define HAVE_STRUCT_SOCKADDR_IN6 0
-#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
-#define HAVE_STRUCT_SOCKADDR_STORAGE 0
-#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
-#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-#define HAVE_SYSCONF 0
-#define HAVE_SYSCTL 0
-#define HAVE_SYS_MMAN_H 0
-#define HAVE_SYS_PARAM_H 0
-#define HAVE_SYS_RESOURCE_H 0
-#define HAVE_SYS_SELECT_H 0
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 0
-#define HAVE_SYS_UN_H 0
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 0
-#define HAVE_TEXI2HTML 0
-#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 0
-#define HAVE_USLEEP 0
-#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 1
-#define HAVE_WINDOWS_H 1
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
-#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
-#define CONFIG_BSFS 0
-#define CONFIG_DECODERS 1
-#define CONFIG_DEMUXERS 1
-#define CONFIG_ENCODERS 0
-#define CONFIG_FILTERS 0
-#define CONFIG_HWACCELS 0
-#define CONFIG_INDEVS 0
-#define CONFIG_MUXERS 0
-#define CONFIG_OUTDEVS 0
-#define CONFIG_PARSERS 1
-#define CONFIG_PROTOCOLS 0
-#define CONFIG_DOC 0
-#define CONFIG_HTMLPAGES 0
-#define CONFIG_MANPAGES 1
-#define CONFIG_PODPAGES 1
-#define CONFIG_TXTPAGES 1
-#define CONFIG_DECODING_ENCODING_EXAMPLE 1
-#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
-#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
-#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
-#define CONFIG_METADATA_EXAMPLE 1
-#define CONFIG_MUXING_EXAMPLE 0
-#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
-#define CONFIG_SCALING_VIDEO_EXAMPLE 0
-#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
-#define CONFIG_AVISYNTH 0
-#define CONFIG_BZLIB 0
-#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
-#define CONFIG_FREI0R 0
-#define CONFIG_GNUTLS 0
-#define CONFIG_ICONV 0
-#define CONFIG_LADSPA 0
-#define CONFIG_LIBAACPLUS 0
-#define CONFIG_LIBASS 0
-#define CONFIG_LIBBLURAY 0
-#define CONFIG_LIBCACA 0
-#define CONFIG_LIBCDIO 0
-#define CONFIG_LIBCELT 0
-#define CONFIG_LIBDC1394 0
-#define CONFIG_LIBFAAC 0
-#define CONFIG_LIBFDK_AAC 0
-#define CONFIG_LIBFLITE 0
-#define CONFIG_LIBFREETYPE 0
-#define CONFIG_LIBGME 0
-#define CONFIG_LIBGSM 0
-#define CONFIG_LIBIEC61883 0
-#define CONFIG_LIBILBC 0
-#define CONFIG_LIBMODPLUG 0
-#define CONFIG_LIBMP3LAME 0
-#define CONFIG_LIBNUT 0
-#define CONFIG_LIBOPENCORE_AMRNB 0
-#define CONFIG_LIBOPENCORE_AMRWB 0
-#define CONFIG_LIBOPENCV 0
-#define CONFIG_LIBOPENJPEG 0
-#define CONFIG_LIBOPUS 0
-#define CONFIG_LIBPULSE 0
-#define CONFIG_LIBQUVI 0
-#define CONFIG_LIBRTMP 0
-#define CONFIG_LIBSCHROEDINGER 0
-#define CONFIG_LIBSHINE 0
-#define CONFIG_LIBSOXR 0
-#define CONFIG_LIBSPEEX 0
-#define CONFIG_LIBSSH 0
-#define CONFIG_LIBSTAGEFRIGHT_H264 0
-#define CONFIG_LIBTHEORA 0
-#define CONFIG_LIBTWOLAME 0
-#define CONFIG_LIBUTVIDEO 0
-#define CONFIG_LIBV4L2 0
-#define CONFIG_LIBVIDSTAB 0
-#define CONFIG_LIBVO_AACENC 0
-#define CONFIG_LIBVO_AMRWBENC 0
-#define CONFIG_LIBVORBIS 0
-#define CONFIG_LIBVPX 0
-#define CONFIG_LIBWAVPACK 0
-#define CONFIG_LIBX264 0
-#define CONFIG_LIBXAVS 0
-#define CONFIG_LIBXVID 0
-#define CONFIG_LIBZMQ 0
-#define CONFIG_LIBZVBI 0
-#define CONFIG_OPENAL 0
-#define CONFIG_OPENCL 0
-#define CONFIG_OPENSSL 0
-#define CONFIG_X11GRAB 0
-#define CONFIG_ZLIB 0
-#define CONFIG_DXVA2 0
-#define CONFIG_VAAPI 0
-#define CONFIG_VDA 0
-#define CONFIG_VDPAU 0
-#define CONFIG_AVCODEC 1
-#define CONFIG_AVDEVICE 0
-#define CONFIG_AVFILTER 0
-#define CONFIG_AVFORMAT 1
-#define CONFIG_AVRESAMPLE 0
-#define CONFIG_AVUTIL 1
-#define CONFIG_POSTPROC 0
-#define CONFIG_SWRESAMPLE 0
-#define CONFIG_SWSCALE 0
-#define CONFIG_FFPLAY 0
-#define CONFIG_FFPROBE 0
-#define CONFIG_FFSERVER 0
-#define CONFIG_FFMPEG 0
-#define CONFIG_DCT 0
-#define CONFIG_DWT 0
-#define CONFIG_ERROR_RESILIENCE 0
-#define CONFIG_FAST_UNALIGNED 1
-#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
-#define CONFIG_LSP 0
-#define CONFIG_LZO 0
-#define CONFIG_MDCT 1
-#define CONFIG_MEMALIGN_HACK 0
-#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
-#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 0
-#define CONFIG_SWSCALE_ALPHA 1
-#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
-#define CONFIG_XMM_CLOBBER_TEST 0
-#define CONFIG_AANDCTTABLES 0
-#define CONFIG_AC3DSP 0
-#define CONFIG_AUDIO_FRAME_QUEUE 0
-#define CONFIG_DSPUTIL 0
-#define CONFIG_EXIF 0
-#define CONFIG_FRAME_THREAD_ENCODER 0
-#define CONFIG_GCRYPT 0
-#define CONFIG_GOLOMB 1
-#define CONFIG_GPLV3 0
-#define CONFIG_H263DSP 0
-#define CONFIG_H264CHROMA 0
-#define CONFIG_H264DSP 0
-#define CONFIG_H264PRED 1
-#define CONFIG_H264QPEL 0
-#define CONFIG_HPELDSP 1
-#define CONFIG_HUFFMAN 0
-#define CONFIG_LGPLV3 0
-#define CONFIG_LPC 0
-#define CONFIG_MPEGAUDIO 0
-#define CONFIG_MPEGAUDIODSP 0
-#define CONFIG_MPEGVIDEO 0
-#define CONFIG_MPEGVIDEOENC 0
-#define CONFIG_NETTLE 0
-#define CONFIG_RANGECODER 0
-#define CONFIG_RIFFDEC 1
-#define CONFIG_RIFFENC 0
-#define CONFIG_RTPDEC 0
-#define CONFIG_RTPENC_CHAIN 0
-#define CONFIG_SINEWIN 0
-#define CONFIG_VIDEODSP 1
-#define CONFIG_VP3DSP 1
-#define CONFIG_AAC_ADTSTOASC_BSF 0
-#define CONFIG_CHOMP_BSF 0
-#define CONFIG_DUMP_EXTRADATA_BSF 0
-#define CONFIG_H264_MP4TOANNEXB_BSF 0
-#define CONFIG_IMX_DUMP_HEADER_BSF 0
-#define CONFIG_MJPEG2JPEG_BSF 0
-#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
-#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
-#define CONFIG_MOV2TEXTSUB_BSF 0
-#define CONFIG_NOISE_BSF 0
-#define CONFIG_REMOVE_EXTRADATA_BSF 0
-#define CONFIG_TEXT2MOVSUB_BSF 0
-#define CONFIG_AASC_DECODER 0
-#define CONFIG_AIC_DECODER 0
-#define CONFIG_AMV_DECODER 0
-#define CONFIG_ANM_DECODER 0
-#define CONFIG_ANSI_DECODER 0
-#define CONFIG_ASV1_DECODER 0
-#define CONFIG_ASV2_DECODER 0
-#define CONFIG_AURA_DECODER 0
-#define CONFIG_AURA2_DECODER 0
-#define CONFIG_AVRP_DECODER 0
-#define CONFIG_AVRN_DECODER 0
-#define CONFIG_AVS_DECODER 0
-#define CONFIG_AVUI_DECODER 0
-#define CONFIG_AYUV_DECODER 0
-#define CONFIG_BETHSOFTVID_DECODER 0
-#define CONFIG_BFI_DECODER 0
-#define CONFIG_BINK_DECODER 0
-#define CONFIG_BMP_DECODER 0
-#define CONFIG_BMV_VIDEO_DECODER 0
-#define CONFIG_BRENDER_PIX_DECODER 0
-#define CONFIG_C93_DECODER 0
-#define CONFIG_CAVS_DECODER 0
-#define CONFIG_CDGRAPHICS_DECODER 0
-#define CONFIG_CDXL_DECODER 0
-#define CONFIG_CINEPAK_DECODER 0
-#define CONFIG_CLJR_DECODER 0
-#define CONFIG_CLLC_DECODER 0
-#define CONFIG_COMFORTNOISE_DECODER 0
-#define CONFIG_CPIA_DECODER 0
-#define CONFIG_CSCD_DECODER 0
-#define CONFIG_CYUV_DECODER 0
-#define CONFIG_DFA_DECODER 0
-#define CONFIG_DIRAC_DECODER 0
-#define CONFIG_DNXHD_DECODER 0
-#define CONFIG_DPX_DECODER 0
-#define CONFIG_DSICINVIDEO_DECODER 0
-#define CONFIG_DVVIDEO_DECODER 0
-#define CONFIG_DXA_DECODER 0
-#define CONFIG_DXTORY_DECODER 0
-#define CONFIG_EACMV_DECODER 0
-#define CONFIG_EAMAD_DECODER 0
-#define CONFIG_EATGQ_DECODER 0
-#define CONFIG_EATGV_DECODER 0
-#define CONFIG_EATQI_DECODER 0
-#define CONFIG_EIGHTBPS_DECODER 0
-#define CONFIG_EIGHTSVX_EXP_DECODER 0
-#define CONFIG_EIGHTSVX_FIB_DECODER 0
-#define CONFIG_ESCAPE124_DECODER 0
-#define CONFIG_ESCAPE130_DECODER 0
-#define CONFIG_EXR_DECODER 0
-#define CONFIG_FFV1_DECODER 0
-#define CONFIG_FFVHUFF_DECODER 0
-#define CONFIG_FLASHSV_DECODER 0
-#define CONFIG_FLASHSV2_DECODER 0
-#define CONFIG_FLIC_DECODER 0
-#define CONFIG_FLV_DECODER 0
-#define CONFIG_FOURXM_DECODER 0
-#define CONFIG_FRAPS_DECODER 0
-#define CONFIG_FRWU_DECODER 0
-#define CONFIG_G2M_DECODER 0
-#define CONFIG_GIF_DECODER 0
-#define CONFIG_H261_DECODER 0
-#define CONFIG_H263_DECODER 0
-#define CONFIG_H263I_DECODER 0
-#define CONFIG_H263P_DECODER 0
-#define CONFIG_H264_DECODER 0
-#define CONFIG_H264_CRYSTALHD_DECODER 0
-#define CONFIG_H264_VDA_DECODER 0
-#define CONFIG_H264_VDPAU_DECODER 0
-#define CONFIG_HEVC_DECODER 0
-#define CONFIG_HNM4_VIDEO_DECODER 0
-#define CONFIG_HUFFYUV_DECODER 0
-#define CONFIG_IDCIN_DECODER 0
-#define CONFIG_IFF_BYTERUN1_DECODER 0
-#define CONFIG_IFF_ILBM_DECODER 0
-#define CONFIG_INDEO2_DECODER 0
-#define CONFIG_INDEO3_DECODER 0
-#define CONFIG_INDEO4_DECODER 0
-#define CONFIG_INDEO5_DECODER 0
-#define CONFIG_INTERPLAY_VIDEO_DECODER 0
-#define CONFIG_JPEG2000_DECODER 0
-#define CONFIG_JPEGLS_DECODER 0
-#define CONFIG_JV_DECODER 0
-#define CONFIG_KGV1_DECODER 0
-#define CONFIG_KMVC_DECODER 0
-#define CONFIG_LAGARITH_DECODER 0
-#define CONFIG_LOCO_DECODER 0
-#define CONFIG_MDEC_DECODER 0
-#define CONFIG_MIMIC_DECODER 0
-#define CONFIG_MJPEG_DECODER 0
-#define CONFIG_MJPEGB_DECODER 0
-#define CONFIG_MMVIDEO_DECODER 0
-#define CONFIG_MOTIONPIXELS_DECODER 0
-#define CONFIG_MPEG_XVMC_DECODER 0
-#define CONFIG_MPEG1VIDEO_DECODER 0
-#define CONFIG_MPEG2VIDEO_DECODER 0
-#define CONFIG_MPEG4_DECODER 0
-#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
-#define CONFIG_MPEG4_VDPAU_DECODER 0
-#define CONFIG_MPEGVIDEO_DECODER 0
-#define CONFIG_MPEG_VDPAU_DECODER 0
-#define CONFIG_MPEG1_VDPAU_DECODER 0
-#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
-#define CONFIG_MSA1_DECODER 0
-#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
-#define CONFIG_MSMPEG4V1_DECODER 0
-#define CONFIG_MSMPEG4V2_DECODER 0
-#define CONFIG_MSMPEG4V3_DECODER 0
-#define CONFIG_MSRLE_DECODER 0
-#define CONFIG_MSS1_DECODER 0
-#define CONFIG_MSS2_DECODER 0
-#define CONFIG_MSVIDEO1_DECODER 0
-#define CONFIG_MSZH_DECODER 0
-#define CONFIG_MTS2_DECODER 0
-#define CONFIG_MVC1_DECODER 0
-#define CONFIG_MVC2_DECODER 0
-#define CONFIG_MXPEG_DECODER 0
-#define CONFIG_NUV_DECODER 0
-#define CONFIG_PAF_VIDEO_DECODER 0
-#define CONFIG_PAM_DECODER 0
-#define CONFIG_PBM_DECODER 0
-#define CONFIG_PCX_DECODER 0
-#define CONFIG_PGM_DECODER 0
-#define CONFIG_PGMYUV_DECODER 0
-#define CONFIG_PICTOR_DECODER 0
-#define CONFIG_PNG_DECODER 0
-#define CONFIG_PPM_DECODER 0
-#define CONFIG_PRORES_DECODER 0
-#define CONFIG_PRORES_LGPL_DECODER 0
-#define CONFIG_PTX_DECODER 0
-#define CONFIG_QDRAW_DECODER 0
-#define CONFIG_QPEG_DECODER 0
-#define CONFIG_QTRLE_DECODER 0
-#define CONFIG_R10K_DECODER 0
-#define CONFIG_R210_DECODER 0
-#define CONFIG_RAWVIDEO_DECODER 0
-#define CONFIG_RL2_DECODER 0
-#define CONFIG_ROQ_DECODER 0
-#define CONFIG_RPZA_DECODER 0
-#define CONFIG_RV10_DECODER 0
-#define CONFIG_RV20_DECODER 0
-#define CONFIG_RV30_DECODER 0
-#define CONFIG_RV40_DECODER 0
-#define CONFIG_S302M_DECODER 0
-#define CONFIG_SANM_DECODER 0
-#define CONFIG_SGI_DECODER 0
-#define CONFIG_SGIRLE_DECODER 0
-#define CONFIG_SMACKER_DECODER 0
-#define CONFIG_SMC_DECODER 0
-#define CONFIG_SMVJPEG_DECODER 0
-#define CONFIG_SNOW_DECODER 0
-#define CONFIG_SP5X_DECODER 0
-#define CONFIG_SUNRAST_DECODER 0
-#define CONFIG_SVQ1_DECODER 0
-#define CONFIG_SVQ3_DECODER 0
-#define CONFIG_TARGA_DECODER 0
-#define CONFIG_TARGA_Y216_DECODER 0
-#define CONFIG_THEORA_DECODER 1
-#define CONFIG_THP_DECODER 0
-#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
-#define CONFIG_TIFF_DECODER 0
-#define CONFIG_TMV_DECODER 0
-#define CONFIG_TRUEMOTION1_DECODER 0
-#define CONFIG_TRUEMOTION2_DECODER 0
-#define CONFIG_TSCC_DECODER 0
-#define CONFIG_TSCC2_DECODER 0
-#define CONFIG_TXD_DECODER 0
-#define CONFIG_ULTI_DECODER 0
-#define CONFIG_UTVIDEO_DECODER 0
-#define CONFIG_V210_DECODER 0
-#define CONFIG_V210X_DECODER 0
-#define CONFIG_V308_DECODER 0
-#define CONFIG_V408_DECODER 0
-#define CONFIG_V410_DECODER 0
-#define CONFIG_VB_DECODER 0
-#define CONFIG_VBLE_DECODER 0
-#define CONFIG_VC1_DECODER 0
-#define CONFIG_VC1_CRYSTALHD_DECODER 0
-#define CONFIG_VC1_VDPAU_DECODER 0
-#define CONFIG_VC1IMAGE_DECODER 0
-#define CONFIG_VCR1_DECODER 0
-#define CONFIG_VMDVIDEO_DECODER 0
-#define CONFIG_VMNC_DECODER 0
-#define CONFIG_VP3_DECODER 1
-#define CONFIG_VP5_DECODER 0
-#define CONFIG_VP6_DECODER 0
-#define CONFIG_VP6A_DECODER 0
-#define CONFIG_VP6F_DECODER 0
-#define CONFIG_VP8_DECODER 1
-#define CONFIG_VP9_DECODER 0
-#define CONFIG_VQA_DECODER 0
-#define CONFIG_WEBP_DECODER 0
-#define CONFIG_WMV1_DECODER 0
-#define CONFIG_WMV2_DECODER 0
-#define CONFIG_WMV3_DECODER 0
-#define CONFIG_WMV3_CRYSTALHD_DECODER 0
-#define CONFIG_WMV3_VDPAU_DECODER 0
-#define CONFIG_WMV3IMAGE_DECODER 0
-#define CONFIG_WNV1_DECODER 0
-#define CONFIG_XAN_WC3_DECODER 0
-#define CONFIG_XAN_WC4_DECODER 0
-#define CONFIG_XBM_DECODER 0
-#define CONFIG_XFACE_DECODER 0
-#define CONFIG_XL_DECODER 0
-#define CONFIG_XWD_DECODER 0
-#define CONFIG_Y41P_DECODER 0
-#define CONFIG_YOP_DECODER 0
-#define CONFIG_YUV4_DECODER 0
-#define CONFIG_ZERO12V_DECODER 0
-#define CONFIG_ZEROCODEC_DECODER 0
-#define CONFIG_ZLIB_DECODER 0
-#define CONFIG_ZMBV_DECODER 0
-#define CONFIG_AAC_DECODER 0
-#define CONFIG_AAC_LATM_DECODER 0
-#define CONFIG_AC3_DECODER 0
-#define CONFIG_ALAC_DECODER 0
-#define CONFIG_ALS_DECODER 0
-#define CONFIG_AMRNB_DECODER 0
-#define CONFIG_AMRWB_DECODER 0
-#define CONFIG_APE_DECODER 0
-#define CONFIG_ATRAC1_DECODER 0
-#define CONFIG_ATRAC3_DECODER 0
-#define CONFIG_BINKAUDIO_DCT_DECODER 0
-#define CONFIG_BINKAUDIO_RDFT_DECODER 0
-#define CONFIG_BMV_AUDIO_DECODER 0
-#define CONFIG_COOK_DECODER 0
-#define CONFIG_DCA_DECODER 0
-#define CONFIG_DSICINAUDIO_DECODER 0
-#define CONFIG_EAC3_DECODER 0
-#define CONFIG_EVRC_DECODER 0
-#define CONFIG_FFWAVESYNTH_DECODER 0
-#define CONFIG_FLAC_DECODER 0
-#define CONFIG_G723_1_DECODER 0
-#define CONFIG_G729_DECODER 0
-#define CONFIG_GSM_DECODER 0
-#define CONFIG_GSM_MS_DECODER 0
-#define CONFIG_IAC_DECODER 0
-#define CONFIG_IMC_DECODER 0
-#define CONFIG_MACE3_DECODER 0
-#define CONFIG_MACE6_DECODER 0
-#define CONFIG_METASOUND_DECODER 0
-#define CONFIG_MLP_DECODER 0
-#define CONFIG_MP1_DECODER 0
-#define CONFIG_MP1FLOAT_DECODER 0
-#define CONFIG_MP2_DECODER 0
-#define CONFIG_MP2FLOAT_DECODER 0
-#define CONFIG_MP3_DECODER 0
-#define CONFIG_MP3FLOAT_DECODER 0
-#define CONFIG_MP3ADU_DECODER 0
-#define CONFIG_MP3ADUFLOAT_DECODER 0
-#define CONFIG_MP3ON4_DECODER 0
-#define CONFIG_MP3ON4FLOAT_DECODER 0
-#define CONFIG_MPC7_DECODER 0
-#define CONFIG_MPC8_DECODER 0
-#define CONFIG_NELLYMOSER_DECODER 0
-#define CONFIG_PAF_AUDIO_DECODER 0
-#define CONFIG_QCELP_DECODER 0
-#define CONFIG_QDM2_DECODER 0
-#define CONFIG_RA_144_DECODER 0
-#define CONFIG_RA_288_DECODER 0
-#define CONFIG_RALF_DECODER 0
-#define CONFIG_SHORTEN_DECODER 0
-#define CONFIG_SIPR_DECODER 0
-#define CONFIG_SMACKAUD_DECODER 0
-#define CONFIG_SONIC_DECODER 0
-#define CONFIG_TAK_DECODER 0
-#define CONFIG_TRUEHD_DECODER 0
-#define CONFIG_TRUESPEECH_DECODER 0
-#define CONFIG_TTA_DECODER 0
-#define CONFIG_TWINVQ_DECODER 0
-#define CONFIG_VMDAUDIO_DECODER 0
-#define CONFIG_VORBIS_DECODER 1
-#define CONFIG_WAVPACK_DECODER 0
-#define CONFIG_WMALOSSLESS_DECODER 0
-#define CONFIG_WMAPRO_DECODER 0
-#define CONFIG_WMAV1_DECODER 0
-#define CONFIG_WMAV2_DECODER 0
-#define CONFIG_WMAVOICE_DECODER 0
-#define CONFIG_WS_SND1_DECODER 0
-#define CONFIG_PCM_ALAW_DECODER 1
-#define CONFIG_PCM_BLURAY_DECODER 0
-#define CONFIG_PCM_DVD_DECODER 0
-#define CONFIG_PCM_F32BE_DECODER 0
-#define CONFIG_PCM_F32LE_DECODER 1
-#define CONFIG_PCM_F64BE_DECODER 0
-#define CONFIG_PCM_F64LE_DECODER 0
-#define CONFIG_PCM_LXF_DECODER 0
-#define CONFIG_PCM_MULAW_DECODER 1
-#define CONFIG_PCM_S8_DECODER 0
-#define CONFIG_PCM_S8_PLANAR_DECODER 0
-#define CONFIG_PCM_S16BE_DECODER 1
-#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
-#define CONFIG_PCM_S16LE_DECODER 1
-#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
-#define CONFIG_PCM_S24BE_DECODER 1
-#define CONFIG_PCM_S24DAUD_DECODER 0
-#define CONFIG_PCM_S24LE_DECODER 1
-#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
-#define CONFIG_PCM_S32BE_DECODER 0
-#define CONFIG_PCM_S32LE_DECODER 0
-#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
-#define CONFIG_PCM_U8_DECODER 1
-#define CONFIG_PCM_U16BE_DECODER 0
-#define CONFIG_PCM_U16LE_DECODER 0
-#define CONFIG_PCM_U24BE_DECODER 0
-#define CONFIG_PCM_U24LE_DECODER 0
-#define CONFIG_PCM_U32BE_DECODER 0
-#define CONFIG_PCM_U32LE_DECODER 0
-#define CONFIG_PCM_ZORK_DECODER 0
-#define CONFIG_INTERPLAY_DPCM_DECODER 0
-#define CONFIG_ROQ_DPCM_DECODER 0
-#define CONFIG_SOL_DPCM_DECODER 0
-#define CONFIG_XAN_DPCM_DECODER 0
-#define CONFIG_ADPCM_4XM_DECODER 0
-#define CONFIG_ADPCM_ADX_DECODER 0
-#define CONFIG_ADPCM_AFC_DECODER 0
-#define CONFIG_ADPCM_CT_DECODER 0
-#define CONFIG_ADPCM_DTK_DECODER 0
-#define CONFIG_ADPCM_EA_DECODER 0
-#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
-#define CONFIG_ADPCM_EA_R1_DECODER 0
-#define CONFIG_ADPCM_EA_R2_DECODER 0
-#define CONFIG_ADPCM_EA_R3_DECODER 0
-#define CONFIG_ADPCM_EA_XAS_DECODER 0
-#define CONFIG_ADPCM_G722_DECODER 0
-#define CONFIG_ADPCM_G726_DECODER 0
-#define CONFIG_ADPCM_G726LE_DECODER 0
-#define CONFIG_ADPCM_IMA_AMV_DECODER 0
-#define CONFIG_ADPCM_IMA_APC_DECODER 0
-#define CONFIG_ADPCM_IMA_DK3_DECODER 0
-#define CONFIG_ADPCM_IMA_DK4_DECODER 0
-#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
-#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
-#define CONFIG_ADPCM_IMA_ISS_DECODER 0
-#define CONFIG_ADPCM_IMA_OKI_DECODER 0
-#define CONFIG_ADPCM_IMA_QT_DECODER 0
-#define CONFIG_ADPCM_IMA_RAD_DECODER 0
-#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
-#define CONFIG_ADPCM_IMA_WAV_DECODER 0
-#define CONFIG_ADPCM_IMA_WS_DECODER 0
-#define CONFIG_ADPCM_MS_DECODER 0
-#define CONFIG_ADPCM_SBPRO_2_DECODER 0
-#define CONFIG_ADPCM_SBPRO_3_DECODER 0
-#define CONFIG_ADPCM_SBPRO_4_DECODER 0
-#define CONFIG_ADPCM_SWF_DECODER 0
-#define CONFIG_ADPCM_THP_DECODER 0
-#define CONFIG_ADPCM_XA_DECODER 0
-#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
-#define CONFIG_SSA_DECODER 0
-#define CONFIG_ASS_DECODER 0
-#define CONFIG_DVBSUB_DECODER 0
-#define CONFIG_DVDSUB_DECODER 0
-#define CONFIG_JACOSUB_DECODER 0
-#define CONFIG_MICRODVD_DECODER 0
-#define CONFIG_MOVTEXT_DECODER 0
-#define CONFIG_MPL2_DECODER 0
-#define CONFIG_PGSSUB_DECODER 0
-#define CONFIG_PJS_DECODER 0
-#define CONFIG_REALTEXT_DECODER 0
-#define CONFIG_SAMI_DECODER 0
-#define CONFIG_SRT_DECODER 0
-#define CONFIG_SUBRIP_DECODER 0
-#define CONFIG_SUBVIEWER_DECODER 0
-#define CONFIG_SUBVIEWER1_DECODER 0
-#define CONFIG_TEXT_DECODER 0
-#define CONFIG_VPLAYER_DECODER 0
-#define CONFIG_WEBVTT_DECODER 0
-#define CONFIG_XSUB_DECODER 0
-#define CONFIG_LIBCELT_DECODER 0
-#define CONFIG_LIBFDK_AAC_DECODER 0
-#define CONFIG_LIBGSM_DECODER 0
-#define CONFIG_LIBGSM_MS_DECODER 0
-#define CONFIG_LIBILBC_DECODER 0
-#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
-#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
-#define CONFIG_LIBOPENJPEG_DECODER 0
-#define CONFIG_LIBOPUS_DECODER 0
-#define CONFIG_LIBSCHROEDINGER_DECODER 0
-#define CONFIG_LIBSPEEX_DECODER 0
-#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
-#define CONFIG_LIBUTVIDEO_DECODER 0
-#define CONFIG_LIBVORBIS_DECODER 0
-#define CONFIG_LIBVPX_VP8_DECODER 0
-#define CONFIG_LIBVPX_VP9_DECODER 0
-#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
-#define CONFIG_BINTEXT_DECODER 0
-#define CONFIG_XBIN_DECODER 0
-#define CONFIG_IDF_DECODER 0
-#define CONFIG_AAC_DEMUXER 0
-#define CONFIG_AC3_DEMUXER 0
-#define CONFIG_ACT_DEMUXER 0
-#define CONFIG_ADF_DEMUXER 0
-#define CONFIG_ADP_DEMUXER 0
-#define CONFIG_ADX_DEMUXER 0
-#define CONFIG_AEA_DEMUXER 0
-#define CONFIG_AFC_DEMUXER 0
-#define CONFIG_AIFF_DEMUXER 0
-#define CONFIG_AMR_DEMUXER 0
-#define CONFIG_ANM_DEMUXER 0
-#define CONFIG_APC_DEMUXER 0
-#define CONFIG_APE_DEMUXER 0
-#define CONFIG_AQTITLE_DEMUXER 0
-#define CONFIG_ASF_DEMUXER 0
-#define CONFIG_ASS_DEMUXER 0
-#define CONFIG_AST_DEMUXER 0
-#define CONFIG_AU_DEMUXER 0
-#define CONFIG_AVI_DEMUXER 0
-#define CONFIG_AVISYNTH_DEMUXER 0
-#define CONFIG_AVR_DEMUXER 0
-#define CONFIG_AVS_DEMUXER 0
-#define CONFIG_BETHSOFTVID_DEMUXER 0
-#define CONFIG_BFI_DEMUXER 0
-#define CONFIG_BINTEXT_DEMUXER 0
-#define CONFIG_BINK_DEMUXER 0
-#define CONFIG_BIT_DEMUXER 0
-#define CONFIG_BMV_DEMUXER 0
-#define CONFIG_BRSTM_DEMUXER 0
-#define CONFIG_BOA_DEMUXER 0
-#define CONFIG_C93_DEMUXER 0
-#define CONFIG_CAF_DEMUXER 0
-#define CONFIG_CAVSVIDEO_DEMUXER 0
-#define CONFIG_CDG_DEMUXER 0
-#define CONFIG_CDXL_DEMUXER 0
-#define CONFIG_CONCAT_DEMUXER 0
-#define CONFIG_DATA_DEMUXER 0
-#define CONFIG_DAUD_DEMUXER 0
-#define CONFIG_DFA_DEMUXER 0
-#define CONFIG_DIRAC_DEMUXER 0
-#define CONFIG_DNXHD_DEMUXER 0
-#define CONFIG_DSICIN_DEMUXER 0
-#define CONFIG_DTS_DEMUXER 0
-#define CONFIG_DTSHD_DEMUXER 0
-#define CONFIG_DV_DEMUXER 0
-#define CONFIG_DXA_DEMUXER 0
-#define CONFIG_EA_DEMUXER 0
-#define CONFIG_EA_CDATA_DEMUXER 0
-#define CONFIG_EAC3_DEMUXER 0
-#define CONFIG_EPAF_DEMUXER 0
-#define CONFIG_FFM_DEMUXER 0
-#define CONFIG_FFMETADATA_DEMUXER 0
-#define CONFIG_FILMSTRIP_DEMUXER 0
-#define CONFIG_FLAC_DEMUXER 0
-#define CONFIG_FLIC_DEMUXER 0
-#define CONFIG_FLV_DEMUXER 0
-#define CONFIG_FOURXM_DEMUXER 0
-#define CONFIG_FRM_DEMUXER 0
-#define CONFIG_G722_DEMUXER 0
-#define CONFIG_G723_1_DEMUXER 0
-#define CONFIG_G729_DEMUXER 0
-#define CONFIG_GIF_DEMUXER 0
-#define CONFIG_GSM_DEMUXER 0
-#define CONFIG_GXF_DEMUXER 0
-#define CONFIG_H261_DEMUXER 0
-#define CONFIG_H263_DEMUXER 0
-#define CONFIG_H264_DEMUXER 0
-#define CONFIG_HEVC_DEMUXER 0
-#define CONFIG_HLS_DEMUXER 0
-#define CONFIG_HNM_DEMUXER 0
-#define CONFIG_ICO_DEMUXER 0
-#define CONFIG_IDCIN_DEMUXER 0
-#define CONFIG_IDF_DEMUXER 0
-#define CONFIG_IFF_DEMUXER 0
-#define CONFIG_ILBC_DEMUXER 0
-#define CONFIG_IMAGE2_DEMUXER 0
-#define CONFIG_IMAGE2PIPE_DEMUXER 0
-#define CONFIG_INGENIENT_DEMUXER 0
-#define CONFIG_IPMOVIE_DEMUXER 0
-#define CONFIG_IRCAM_DEMUXER 0
-#define CONFIG_ISS_DEMUXER 0
-#define CONFIG_IV8_DEMUXER 0
-#define CONFIG_IVF_DEMUXER 0
-#define CONFIG_JACOSUB_DEMUXER 0
-#define CONFIG_JV_DEMUXER 0
-#define CONFIG_LATM_DEMUXER 0
-#define CONFIG_LMLM4_DEMUXER 0
-#define CONFIG_LOAS_DEMUXER 0
-#define CONFIG_LVF_DEMUXER 0
-#define CONFIG_LXF_DEMUXER 0
-#define CONFIG_M4V_DEMUXER 0
-#define CONFIG_MATROSKA_DEMUXER 1
-#define CONFIG_MGSTS_DEMUXER 0
-#define CONFIG_MICRODVD_DEMUXER 0
-#define CONFIG_MJPEG_DEMUXER 0
-#define CONFIG_MLP_DEMUXER 0
-#define CONFIG_MM_DEMUXER 0
-#define CONFIG_MMF_DEMUXER 0
-#define CONFIG_MOV_DEMUXER 0
-#define CONFIG_MP3_DEMUXER 0
-#define CONFIG_MPC_DEMUXER 0
-#define CONFIG_MPC8_DEMUXER 0
-#define CONFIG_MPEGPS_DEMUXER 0
-#define CONFIG_MPEGTS_DEMUXER 0
-#define CONFIG_MPEGTSRAW_DEMUXER 0
-#define CONFIG_MPEGVIDEO_DEMUXER 0
-#define CONFIG_MPL2_DEMUXER 0
-#define CONFIG_MPSUB_DEMUXER 0
-#define CONFIG_MSNWC_TCP_DEMUXER 0
-#define CONFIG_MTV_DEMUXER 0
-#define CONFIG_MV_DEMUXER 0
-#define CONFIG_MVI_DEMUXER 0
-#define CONFIG_MXF_DEMUXER 0
-#define CONFIG_MXG_DEMUXER 0
-#define CONFIG_NC_DEMUXER 0
-#define CONFIG_NISTSPHERE_DEMUXER 0
-#define CONFIG_NSV_DEMUXER 0
-#define CONFIG_NUT_DEMUXER 0
-#define CONFIG_NUV_DEMUXER 0
-#define CONFIG_OGG_DEMUXER 1
-#define CONFIG_OMA_DEMUXER 0
-#define CONFIG_PAF_DEMUXER 0
-#define CONFIG_PCM_ALAW_DEMUXER 0
-#define CONFIG_PCM_MULAW_DEMUXER 0
-#define CONFIG_PCM_F64BE_DEMUXER 0
-#define CONFIG_PCM_F64LE_DEMUXER 0
-#define CONFIG_PCM_F32BE_DEMUXER 0
-#define CONFIG_PCM_F32LE_DEMUXER 0
-#define CONFIG_PCM_S32BE_DEMUXER 0
-#define CONFIG_PCM_S32LE_DEMUXER 0
-#define CONFIG_PCM_S24BE_DEMUXER 0
-#define CONFIG_PCM_S24LE_DEMUXER 0
-#define CONFIG_PCM_S16BE_DEMUXER 0
-#define CONFIG_PCM_S16LE_DEMUXER 0
-#define CONFIG_PCM_S8_DEMUXER 0
-#define CONFIG_PCM_U32BE_DEMUXER 0
-#define CONFIG_PCM_U32LE_DEMUXER 0
-#define CONFIG_PCM_U24BE_DEMUXER 0
-#define CONFIG_PCM_U24LE_DEMUXER 0
-#define CONFIG_PCM_U16BE_DEMUXER 0
-#define CONFIG_PCM_U16LE_DEMUXER 0
-#define CONFIG_PCM_U8_DEMUXER 0
-#define CONFIG_PJS_DEMUXER 0
-#define CONFIG_PMP_DEMUXER 0
-#define CONFIG_PVA_DEMUXER 0
-#define CONFIG_PVF_DEMUXER 0
-#define CONFIG_QCP_DEMUXER 0
-#define CONFIG_R3D_DEMUXER 0
-#define CONFIG_RAWVIDEO_DEMUXER 0
-#define CONFIG_REALTEXT_DEMUXER 0
-#define CONFIG_REDSPARK_DEMUXER 0
-#define CONFIG_RL2_DEMUXER 0
-#define CONFIG_RM_DEMUXER 0
-#define CONFIG_ROQ_DEMUXER 0
-#define CONFIG_RPL_DEMUXER 0
-#define CONFIG_RSD_DEMUXER 0
-#define CONFIG_RSO_DEMUXER 0
-#define CONFIG_RTP_DEMUXER 0
-#define CONFIG_RTSP_DEMUXER 0
-#define CONFIG_SAMI_DEMUXER 0
-#define CONFIG_SAP_DEMUXER 0
-#define CONFIG_SBG_DEMUXER 0
-#define CONFIG_SDP_DEMUXER 0
-#define CONFIG_SEGAFILM_DEMUXER 0
-#define CONFIG_SHORTEN_DEMUXER 0
-#define CONFIG_SIFF_DEMUXER 0
-#define CONFIG_SMACKER_DEMUXER 0
-#define CONFIG_SMJPEG_DEMUXER 0
-#define CONFIG_SMUSH_DEMUXER 0
-#define CONFIG_SOL_DEMUXER 0
-#define CONFIG_SOX_DEMUXER 0
-#define CONFIG_SPDIF_DEMUXER 0
-#define CONFIG_SRT_DEMUXER 0
-#define CONFIG_STR_DEMUXER 0
-#define CONFIG_SUBVIEWER1_DEMUXER 0
-#define CONFIG_SUBVIEWER_DEMUXER 0
-#define CONFIG_SWF_DEMUXER 0
-#define CONFIG_TAK_DEMUXER 0
-#define CONFIG_TEDCAPTIONS_DEMUXER 0
-#define CONFIG_THP_DEMUXER 0
-#define CONFIG_TIERTEXSEQ_DEMUXER 0
-#define CONFIG_TMV_DEMUXER 0
-#define CONFIG_TRUEHD_DEMUXER 0
-#define CONFIG_TTA_DEMUXER 0
-#define CONFIG_TXD_DEMUXER 0
-#define CONFIG_TTY_DEMUXER 0
-#define CONFIG_VC1_DEMUXER 0
-#define CONFIG_VC1T_DEMUXER 0
-#define CONFIG_VIVO_DEMUXER 0
-#define CONFIG_VMD_DEMUXER 0
-#define CONFIG_VOBSUB_DEMUXER 0
-#define CONFIG_VOC_DEMUXER 0
-#define CONFIG_VPLAYER_DEMUXER 0
-#define CONFIG_VQF_DEMUXER 0
-#define CONFIG_W64_DEMUXER 0
-#define CONFIG_WAV_DEMUXER 1
-#define CONFIG_WC3_DEMUXER 0
-#define CONFIG_WEBVTT_DEMUXER 0
-#define CONFIG_WSAUD_DEMUXER 0
-#define CONFIG_WSVQA_DEMUXER 0
-#define CONFIG_WTV_DEMUXER 0
-#define CONFIG_WV_DEMUXER 0
-#define CONFIG_XA_DEMUXER 0
-#define CONFIG_XBIN_DEMUXER 0
-#define CONFIG_XMV_DEMUXER 0
-#define CONFIG_XWMA_DEMUXER 0
-#define CONFIG_YOP_DEMUXER 0
-#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
-#define CONFIG_LIBGME_DEMUXER 0
-#define CONFIG_LIBMODPLUG_DEMUXER 0
-#define CONFIG_LIBNUT_DEMUXER 0
-#define CONFIG_LIBQUVI_DEMUXER 0
-#define CONFIG_A64MULTI_ENCODER 0
-#define CONFIG_A64MULTI5_ENCODER 0
-#define CONFIG_AMV_ENCODER 0
-#define CONFIG_ASV1_ENCODER 0
-#define CONFIG_ASV2_ENCODER 0
-#define CONFIG_AVRP_ENCODER 0
-#define CONFIG_AVUI_ENCODER 0
-#define CONFIG_AYUV_ENCODER 0
-#define CONFIG_BMP_ENCODER 0
-#define CONFIG_CLJR_ENCODER 0
-#define CONFIG_COMFORTNOISE_ENCODER 0
-#define CONFIG_DNXHD_ENCODER 0
-#define CONFIG_DPX_ENCODER 0
-#define CONFIG_DVVIDEO_ENCODER 0
-#define CONFIG_FFV1_ENCODER 0
-#define CONFIG_FFVHUFF_ENCODER 0
-#define CONFIG_FLASHSV_ENCODER 0
-#define CONFIG_FLASHSV2_ENCODER 0
-#define CONFIG_FLV_ENCODER 0
-#define CONFIG_GIF_ENCODER 0
-#define CONFIG_H261_ENCODER 0
-#define CONFIG_H263_ENCODER 0
-#define CONFIG_H263P_ENCODER 0
-#define CONFIG_HUFFYUV_ENCODER 0
-#define CONFIG_JPEG2000_ENCODER 0
-#define CONFIG_JPEGLS_ENCODER 0
-#define CONFIG_LJPEG_ENCODER 0
-#define CONFIG_MJPEG_ENCODER 0
-#define CONFIG_MPEG1VIDEO_ENCODER 0
-#define CONFIG_MPEG2VIDEO_ENCODER 0
-#define CONFIG_MPEG4_ENCODER 0
-#define CONFIG_MSMPEG4V2_ENCODER 0
-#define CONFIG_MSMPEG4V3_ENCODER 0
-#define CONFIG_MSVIDEO1_ENCODER 0
-#define CONFIG_PAM_ENCODER 0
-#define CONFIG_PBM_ENCODER 0
-#define CONFIG_PCX_ENCODER 0
-#define CONFIG_PGM_ENCODER 0
-#define CONFIG_PGMYUV_ENCODER 0
-#define CONFIG_PNG_ENCODER 0
-#define CONFIG_PPM_ENCODER 0
-#define CONFIG_PRORES_ENCODER 0
-#define CONFIG_PRORES_AW_ENCODER 0
-#define CONFIG_PRORES_KS_ENCODER 0
-#define CONFIG_QTRLE_ENCODER 0
-#define CONFIG_R10K_ENCODER 0
-#define CONFIG_R210_ENCODER 0
-#define CONFIG_RAWVIDEO_ENCODER 0
-#define CONFIG_ROQ_ENCODER 0
-#define CONFIG_RV10_ENCODER 0
-#define CONFIG_RV20_ENCODER 0
-#define CONFIG_S302M_ENCODER 0
-#define CONFIG_SGI_ENCODER 0
-#define CONFIG_SNOW_ENCODER 0
-#define CONFIG_SUNRAST_ENCODER 0
-#define CONFIG_SVQ1_ENCODER 0
-#define CONFIG_TARGA_ENCODER 0
-#define CONFIG_TIFF_ENCODER 0
-#define CONFIG_UTVIDEO_ENCODER 0
-#define CONFIG_V210_ENCODER 0
-#define CONFIG_V308_ENCODER 0
-#define CONFIG_V408_ENCODER 0
-#define CONFIG_V410_ENCODER 0
-#define CONFIG_WMV1_ENCODER 0
-#define CONFIG_WMV2_ENCODER 0
-#define CONFIG_XBM_ENCODER 0
-#define CONFIG_XFACE_ENCODER 0
-#define CONFIG_XWD_ENCODER 0
-#define CONFIG_Y41P_ENCODER 0
-#define CONFIG_YUV4_ENCODER 0
-#define CONFIG_ZLIB_ENCODER 0
-#define CONFIG_ZMBV_ENCODER 0
-#define CONFIG_AAC_ENCODER 0
-#define CONFIG_AC3_ENCODER 0
-#define CONFIG_AC3_FIXED_ENCODER 0
-#define CONFIG_ALAC_ENCODER 0
-#define CONFIG_DCA_ENCODER 0
-#define CONFIG_EAC3_ENCODER 0
-#define CONFIG_FLAC_ENCODER 0
-#define CONFIG_G723_1_ENCODER 0
-#define CONFIG_MP2_ENCODER 0
-#define CONFIG_MP2FIXED_ENCODER 0
-#define CONFIG_NELLYMOSER_ENCODER 0
-#define CONFIG_RA_144_ENCODER 0
-#define CONFIG_SONIC_ENCODER 0
-#define CONFIG_SONIC_LS_ENCODER 0
-#define CONFIG_TTA_ENCODER 0
-#define CONFIG_VORBIS_ENCODER 0
-#define CONFIG_WAVPACK_ENCODER 0
-#define CONFIG_WMAV1_ENCODER 0
-#define CONFIG_WMAV2_ENCODER 0
-#define CONFIG_PCM_ALAW_ENCODER 0
-#define CONFIG_PCM_F32BE_ENCODER 0
-#define CONFIG_PCM_F32LE_ENCODER 0
-#define CONFIG_PCM_F64BE_ENCODER 0
-#define CONFIG_PCM_F64LE_ENCODER 0
-#define CONFIG_PCM_MULAW_ENCODER 0
-#define CONFIG_PCM_S8_ENCODER 0
-#define CONFIG_PCM_S8_PLANAR_ENCODER 0
-#define CONFIG_PCM_S16BE_ENCODER 0
-#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
-#define CONFIG_PCM_S16LE_ENCODER 0
-#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
-#define CONFIG_PCM_S24BE_ENCODER 0
-#define CONFIG_PCM_S24DAUD_ENCODER 0
-#define CONFIG_PCM_S24LE_ENCODER 0
-#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
-#define CONFIG_PCM_S32BE_ENCODER 0
-#define CONFIG_PCM_S32LE_ENCODER 0
-#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
-#define CONFIG_PCM_U8_ENCODER 0
-#define CONFIG_PCM_U16BE_ENCODER 0
-#define CONFIG_PCM_U16LE_ENCODER 0
-#define CONFIG_PCM_U24BE_ENCODER 0
-#define CONFIG_PCM_U24LE_ENCODER 0
-#define CONFIG_PCM_U32BE_ENCODER 0
-#define CONFIG_PCM_U32LE_ENCODER 0
-#define CONFIG_ROQ_DPCM_ENCODER 0
-#define CONFIG_ADPCM_ADX_ENCODER 0
-#define CONFIG_ADPCM_G722_ENCODER 0
-#define CONFIG_ADPCM_G726_ENCODER 0
-#define CONFIG_ADPCM_IMA_QT_ENCODER 0
-#define CONFIG_ADPCM_IMA_WAV_ENCODER 0
-#define CONFIG_ADPCM_MS_ENCODER 0
-#define CONFIG_ADPCM_SWF_ENCODER 0
-#define CONFIG_ADPCM_YAMAHA_ENCODER 0
-#define CONFIG_SSA_ENCODER 0
-#define CONFIG_ASS_ENCODER 0
-#define CONFIG_DVBSUB_ENCODER 0
-#define CONFIG_DVDSUB_ENCODER 0
-#define CONFIG_MOVTEXT_ENCODER 0
-#define CONFIG_SRT_ENCODER 0
-#define CONFIG_SUBRIP_ENCODER 0
-#define CONFIG_XSUB_ENCODER 0
-#define CONFIG_LIBFAAC_ENCODER 0
-#define CONFIG_LIBFDK_AAC_ENCODER 0
-#define CONFIG_LIBGSM_ENCODER 0
-#define CONFIG_LIBGSM_MS_ENCODER 0
-#define CONFIG_LIBILBC_ENCODER 0
-#define CONFIG_LIBMP3LAME_ENCODER 0
-#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
-#define CONFIG_LIBOPENJPEG_ENCODER 0
-#define CONFIG_LIBOPUS_ENCODER 0
-#define CONFIG_LIBSCHROEDINGER_ENCODER 0
-#define CONFIG_LIBSHINE_ENCODER 0
-#define CONFIG_LIBSPEEX_ENCODER 0
-#define CONFIG_LIBTHEORA_ENCODER 0
-#define CONFIG_LIBTWOLAME_ENCODER 0
-#define CONFIG_LIBUTVIDEO_ENCODER 0
-#define CONFIG_LIBVO_AACENC_ENCODER 0
-#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
-#define CONFIG_LIBVORBIS_ENCODER 0
-#define CONFIG_LIBVPX_VP8_ENCODER 0
-#define CONFIG_LIBVPX_VP9_ENCODER 0
-#define CONFIG_LIBWAVPACK_ENCODER 0
-#define CONFIG_LIBX264_ENCODER 0
-#define CONFIG_LIBX264RGB_ENCODER 0
-#define CONFIG_LIBXAVS_ENCODER 0
-#define CONFIG_LIBXVID_ENCODER 0
-#define CONFIG_LIBAACPLUS_ENCODER 0
-#define CONFIG_ACONVERT_FILTER 0
-#define CONFIG_ADELAY_FILTER 0
-#define CONFIG_AECHO_FILTER 0
-#define CONFIG_AEVAL_FILTER 0
-#define CONFIG_AFADE_FILTER 0
-#define CONFIG_AFORMAT_FILTER 0
-#define CONFIG_AINTERLEAVE_FILTER 0
-#define CONFIG_ALLPASS_FILTER 0
-#define CONFIG_AMERGE_FILTER 0
-#define CONFIG_AMIX_FILTER 0
-#define CONFIG_ANULL_FILTER 0
-#define CONFIG_APAD_FILTER 0
-#define CONFIG_APERMS_FILTER 0
-#define CONFIG_APHASER_FILTER 0
-#define CONFIG_ARESAMPLE_FILTER 0
-#define CONFIG_ASELECT_FILTER 0
-#define CONFIG_ASENDCMD_FILTER 0
-#define CONFIG_ASETNSAMPLES_FILTER 0
-#define CONFIG_ASETPTS_FILTER 0
-#define CONFIG_ASETRATE_FILTER 0
-#define CONFIG_ASETTB_FILTER 0
-#define CONFIG_ASHOWINFO_FILTER 0
-#define CONFIG_ASPLIT_FILTER 0
-#define CONFIG_ASTATS_FILTER 0
-#define CONFIG_ASTREAMSYNC_FILTER 0
-#define CONFIG_ASYNCTS_FILTER 0
-#define CONFIG_ATEMPO_FILTER 0
-#define CONFIG_ATRIM_FILTER 0
-#define CONFIG_AZMQ_FILTER 0
-#define CONFIG_BANDPASS_FILTER 0
-#define CONFIG_BANDREJECT_FILTER 0
-#define CONFIG_BASS_FILTER 0
-#define CONFIG_BIQUAD_FILTER 0
-#define CONFIG_CHANNELMAP_FILTER 0
-#define CONFIG_CHANNELSPLIT_FILTER 0
-#define CONFIG_COMPAND_FILTER 0
-#define CONFIG_EARWAX_FILTER 0
-#define CONFIG_EBUR128_FILTER 0
-#define CONFIG_EQUALIZER_FILTER 0
-#define CONFIG_HIGHPASS_FILTER 0
-#define CONFIG_JOIN_FILTER 0
-#define CONFIG_LADSPA_FILTER 0
-#define CONFIG_LOWPASS_FILTER 0
-#define CONFIG_PAN_FILTER 0
-#define CONFIG_REPLAYGAIN_FILTER 0
-#define CONFIG_RESAMPLE_FILTER 0
-#define CONFIG_SILENCEDETECT_FILTER 0
-#define CONFIG_TREBLE_FILTER 0
-#define CONFIG_VOLUME_FILTER 0
-#define CONFIG_VOLUMEDETECT_FILTER 0
-#define CONFIG_AEVALSRC_FILTER 0
-#define CONFIG_ANULLSRC_FILTER 0
-#define CONFIG_FLITE_FILTER 0
-#define CONFIG_SINE_FILTER 0
-#define CONFIG_ANULLSINK_FILTER 0
-#define CONFIG_ALPHAEXTRACT_FILTER 0
-#define CONFIG_ALPHAMERGE_FILTER 0
-#define CONFIG_ASS_FILTER 0
-#define CONFIG_BBOX_FILTER 0
-#define CONFIG_BLACKDETECT_FILTER 0
-#define CONFIG_BLACKFRAME_FILTER 0
-#define CONFIG_BLEND_FILTER 0
-#define CONFIG_BOXBLUR_FILTER 0
-#define CONFIG_COLORBALANCE_FILTER 0
-#define CONFIG_COLORCHANNELMIXER_FILTER 0
-#define CONFIG_COLORMATRIX_FILTER 0
-#define CONFIG_COPY_FILTER 0
-#define CONFIG_CROP_FILTER 0
-#define CONFIG_CROPDETECT_FILTER 0
-#define CONFIG_CURVES_FILTER 0
-#define CONFIG_DCTDNOIZ_FILTER 0
-#define CONFIG_DECIMATE_FILTER 0
-#define CONFIG_DELOGO_FILTER 0
-#define CONFIG_DESHAKE_FILTER 0
-#define CONFIG_DRAWBOX_FILTER 0
-#define CONFIG_DRAWGRID_FILTER 0
-#define CONFIG_DRAWTEXT_FILTER 0
-#define CONFIG_EDGEDETECT_FILTER 0
-#define CONFIG_ELBG_FILTER 0
-#define CONFIG_EXTRACTPLANES_FILTER 0
-#define CONFIG_FADE_FILTER 0
-#define CONFIG_FIELD_FILTER 0
-#define CONFIG_FIELDMATCH_FILTER 0
-#define CONFIG_FIELDORDER_FILTER 0
-#define CONFIG_FORMAT_FILTER 0
-#define CONFIG_FPS_FILTER 0
-#define CONFIG_FRAMESTEP_FILTER 0
-#define CONFIG_FREI0R_FILTER 0
-#define CONFIG_GEQ_FILTER 0
-#define CONFIG_GRADFUN_FILTER 0
-#define CONFIG_HALDCLUT_FILTER 0
-#define CONFIG_HFLIP_FILTER 0
-#define CONFIG_HISTEQ_FILTER 0
-#define CONFIG_HISTOGRAM_FILTER 0
-#define CONFIG_HQDN3D_FILTER 0
-#define CONFIG_HUE_FILTER 0
-#define CONFIG_IDET_FILTER 0
-#define CONFIG_IL_FILTER 0
-#define CONFIG_INTERLACE_FILTER 0
-#define CONFIG_INTERLEAVE_FILTER 0
-#define CONFIG_KERNDEINT_FILTER 0
-#define CONFIG_LUT3D_FILTER 0
-#define CONFIG_LUT_FILTER 0
-#define CONFIG_LUTRGB_FILTER 0
-#define CONFIG_LUTYUV_FILTER 0
-#define CONFIG_MCDEINT_FILTER 0
-#define CONFIG_MERGEPLANES_FILTER 0
-#define CONFIG_MP_FILTER 0
-#define CONFIG_MPDECIMATE_FILTER 0
-#define CONFIG_NEGATE_FILTER 0
-#define CONFIG_NOFORMAT_FILTER 0
-#define CONFIG_NOISE_FILTER 0
-#define CONFIG_NULL_FILTER 0
-#define CONFIG_OCV_FILTER 0
-#define CONFIG_OVERLAY_FILTER 0
-#define CONFIG_OWDENOISE_FILTER 0
-#define CONFIG_PAD_FILTER 0
-#define CONFIG_PERMS_FILTER 0
-#define CONFIG_PERSPECTIVE_FILTER 0
-#define CONFIG_PHASE_FILTER 0
-#define CONFIG_PIXDESCTEST_FILTER 0
-#define CONFIG_PP_FILTER 0
-#define CONFIG_PSNR_FILTER 0
-#define CONFIG_PULLUP_FILTER 0
-#define CONFIG_REMOVELOGO_FILTER 0
-#define CONFIG_ROTATE_FILTER 0
-#define CONFIG_SAB_FILTER 0
-#define CONFIG_SCALE_FILTER 0
-#define CONFIG_SELECT_FILTER 0
-#define CONFIG_SENDCMD_FILTER 0
-#define CONFIG_SEPARATEFIELDS_FILTER 0
-#define CONFIG_SETDAR_FILTER 0
-#define CONFIG_SETFIELD_FILTER 0
-#define CONFIG_SETPTS_FILTER 0
-#define CONFIG_SETSAR_FILTER 0
-#define CONFIG_SETTB_FILTER 0
-#define CONFIG_SHOWINFO_FILTER 0
-#define CONFIG_SMARTBLUR_FILTER 0
-#define CONFIG_SPLIT_FILTER 0
-#define CONFIG_SPP_FILTER 0
-#define CONFIG_STEREO3D_FILTER 0
-#define CONFIG_SUBTITLES_FILTER 0
-#define CONFIG_SUPER2XSAI_FILTER 0
-#define CONFIG_SWAPUV_FILTER 0
-#define CONFIG_TELECINE_FILTER 0
-#define CONFIG_THUMBNAIL_FILTER 0
-#define CONFIG_TILE_FILTER 0
-#define CONFIG_TINTERLACE_FILTER 0
-#define CONFIG_TRANSPOSE_FILTER 0
-#define CONFIG_TRIM_FILTER 0
-#define CONFIG_UNSHARP_FILTER 0
-#define CONFIG_VFLIP_FILTER 0
-#define CONFIG_VIDSTABDETECT_FILTER 0
-#define CONFIG_VIDSTABTRANSFORM_FILTER 0
-#define CONFIG_VIGNETTE_FILTER 0
-#define CONFIG_W3FDIF_FILTER 0
-#define CONFIG_YADIF_FILTER 0
-#define CONFIG_ZMQ_FILTER 0
-#define CONFIG_CELLAUTO_FILTER 0
-#define CONFIG_COLOR_FILTER 0
-#define CONFIG_FREI0R_SRC_FILTER 0
-#define CONFIG_HALDCLUTSRC_FILTER 0
-#define CONFIG_LIFE_FILTER 0
-#define CONFIG_MANDELBROT_FILTER 0
-#define CONFIG_MPTESTSRC_FILTER 0
-#define CONFIG_NULLSRC_FILTER 0
-#define CONFIG_RGBTESTSRC_FILTER 0
-#define CONFIG_SMPTEBARS_FILTER 0
-#define CONFIG_SMPTEHDBARS_FILTER 0
-#define CONFIG_TESTSRC_FILTER 0
-#define CONFIG_NULLSINK_FILTER 0
-#define CONFIG_AVECTORSCOPE_FILTER 0
-#define CONFIG_CONCAT_FILTER 0
-#define CONFIG_SHOWSPECTRUM_FILTER 0
-#define CONFIG_SHOWWAVES_FILTER 0
-#define CONFIG_AMOVIE_FILTER 0
-#define CONFIG_MOVIE_FILTER 0
-#define CONFIG_H263_VAAPI_HWACCEL 0
-#define CONFIG_H263_VDPAU_HWACCEL 0
-#define CONFIG_H264_DXVA2_HWACCEL 0
-#define CONFIG_H264_VAAPI_HWACCEL 0
-#define CONFIG_H264_VDA_HWACCEL 0
-#define CONFIG_H264_VDPAU_HWACCEL 0
-#define CONFIG_MPEG1_VDPAU_HWACCEL 0
-#define CONFIG_MPEG2_DXVA2_HWACCEL 0
-#define CONFIG_MPEG2_VAAPI_HWACCEL 0
-#define CONFIG_MPEG2_VDPAU_HWACCEL 0
-#define CONFIG_MPEG4_VAAPI_HWACCEL 0
-#define CONFIG_MPEG4_VDPAU_HWACCEL 0
-#define CONFIG_VC1_DXVA2_HWACCEL 0
-#define CONFIG_VC1_VAAPI_HWACCEL 0
-#define CONFIG_VC1_VDPAU_HWACCEL 0
-#define CONFIG_WMV3_DXVA2_HWACCEL 0
-#define CONFIG_WMV3_VAAPI_HWACCEL 0
-#define CONFIG_WMV3_VDPAU_HWACCEL 0
-#define CONFIG_ALSA_INDEV 0
-#define CONFIG_BKTR_INDEV 0
-#define CONFIG_DSHOW_INDEV 0
-#define CONFIG_DV1394_INDEV 0
-#define CONFIG_FBDEV_INDEV 0
-#define CONFIG_IEC61883_INDEV 0
-#define CONFIG_JACK_INDEV 0
-#define CONFIG_LAVFI_INDEV 0
-#define CONFIG_OPENAL_INDEV 0
-#define CONFIG_OSS_INDEV 0
-#define CONFIG_PULSE_INDEV 0
-#define CONFIG_SNDIO_INDEV 0
-#define CONFIG_V4L2_INDEV 0
-#define CONFIG_VFWCAP_INDEV 0
-#define CONFIG_X11GRAB_INDEV 0
-#define CONFIG_LIBCDIO_INDEV 0
-#define CONFIG_LIBDC1394_INDEV 0
-#define CONFIG_A64_MUXER 0
-#define CONFIG_AC3_MUXER 0
-#define CONFIG_ADTS_MUXER 0
-#define CONFIG_ADX_MUXER 0
-#define CONFIG_AIFF_MUXER 0
-#define CONFIG_AMR_MUXER 0
-#define CONFIG_ASF_MUXER 0
-#define CONFIG_ASS_MUXER 0
-#define CONFIG_AST_MUXER 0
-#define CONFIG_ASF_STREAM_MUXER 0
-#define CONFIG_AU_MUXER 0
-#define CONFIG_AVI_MUXER 0
-#define CONFIG_AVM2_MUXER 0
-#define CONFIG_BIT_MUXER 0
-#define CONFIG_CAF_MUXER 0
-#define CONFIG_CAVSVIDEO_MUXER 0
-#define CONFIG_CRC_MUXER 0
-#define CONFIG_DATA_MUXER 0
-#define CONFIG_DAUD_MUXER 0
-#define CONFIG_DIRAC_MUXER 0
-#define CONFIG_DNXHD_MUXER 0
-#define CONFIG_DTS_MUXER 0
-#define CONFIG_DV_MUXER 0
-#define CONFIG_EAC3_MUXER 0
-#define CONFIG_F4V_MUXER 0
-#define CONFIG_FFM_MUXER 0
-#define CONFIG_FFMETADATA_MUXER 0
-#define CONFIG_FILMSTRIP_MUXER 0
-#define CONFIG_FLAC_MUXER 0
-#define CONFIG_FLV_MUXER 0
-#define CONFIG_FRAMECRC_MUXER 0
-#define CONFIG_FRAMEMD5_MUXER 0
-#define CONFIG_G722_MUXER 0
-#define CONFIG_G723_1_MUXER 0
-#define CONFIG_GIF_MUXER 0
-#define CONFIG_GXF_MUXER 0
-#define CONFIG_H261_MUXER 0
-#define CONFIG_H263_MUXER 0
-#define CONFIG_H264_MUXER 0
-#define CONFIG_HDS_MUXER 0
-#define CONFIG_HLS_MUXER 0
-#define CONFIG_ICO_MUXER 0
-#define CONFIG_ILBC_MUXER 0
-#define CONFIG_IMAGE2_MUXER 0
-#define CONFIG_IMAGE2PIPE_MUXER 0
-#define CONFIG_IPOD_MUXER 0
-#define CONFIG_IRCAM_MUXER 0
-#define CONFIG_ISMV_MUXER 0
-#define CONFIG_IVF_MUXER 0
-#define CONFIG_JACOSUB_MUXER 0
-#define CONFIG_LATM_MUXER 0
-#define CONFIG_M4V_MUXER 0
-#define CONFIG_MD5_MUXER 0
-#define CONFIG_MATROSKA_MUXER 0
-#define CONFIG_MATROSKA_AUDIO_MUXER 0
-#define CONFIG_MICRODVD_MUXER 0
-#define CONFIG_MJPEG_MUXER 0
-#define CONFIG_MLP_MUXER 0
-#define CONFIG_MMF_MUXER 0
-#define CONFIG_MOV_MUXER 0
-#define CONFIG_MP2_MUXER 0
-#define CONFIG_MP3_MUXER 0
-#define CONFIG_MP4_MUXER 0
-#define CONFIG_MPEG1SYSTEM_MUXER 0
-#define CONFIG_MPEG1VCD_MUXER 0
-#define CONFIG_MPEG1VIDEO_MUXER 0
-#define CONFIG_MPEG2DVD_MUXER 0
-#define CONFIG_MPEG2SVCD_MUXER 0
-#define CONFIG_MPEG2VIDEO_MUXER 0
-#define CONFIG_MPEG2VOB_MUXER 0
-#define CONFIG_MPEGTS_MUXER 0
-#define CONFIG_MPJPEG_MUXER 0
-#define CONFIG_MXF_MUXER 0
-#define CONFIG_MXF_D10_MUXER 0
-#define CONFIG_NULL_MUXER 0
-#define CONFIG_NUT_MUXER 0
-#define CONFIG_OGG_MUXER 0
-#define CONFIG_OMA_MUXER 0
-#define CONFIG_OPUS_MUXER 0
-#define CONFIG_PCM_ALAW_MUXER 0
-#define CONFIG_PCM_MULAW_MUXER 0
-#define CONFIG_PCM_F64BE_MUXER 0
-#define CONFIG_PCM_F64LE_MUXER 0
-#define CONFIG_PCM_F32BE_MUXER 0
-#define CONFIG_PCM_F32LE_MUXER 0
-#define CONFIG_PCM_S32BE_MUXER 0
-#define CONFIG_PCM_S32LE_MUXER 0
-#define CONFIG_PCM_S24BE_MUXER 0
-#define CONFIG_PCM_S24LE_MUXER 0
-#define CONFIG_PCM_S16BE_MUXER 0
-#define CONFIG_PCM_S16LE_MUXER 0
-#define CONFIG_PCM_S8_MUXER 0
-#define CONFIG_PCM_U32BE_MUXER 0
-#define CONFIG_PCM_U32LE_MUXER 0
-#define CONFIG_PCM_U24BE_MUXER 0
-#define CONFIG_PCM_U24LE_MUXER 0
-#define CONFIG_PCM_U16BE_MUXER 0
-#define CONFIG_PCM_U16LE_MUXER 0
-#define CONFIG_PCM_U8_MUXER 0
-#define CONFIG_PSP_MUXER 0
-#define CONFIG_RAWVIDEO_MUXER 0
-#define CONFIG_RM_MUXER 0
-#define CONFIG_ROQ_MUXER 0
-#define CONFIG_RSO_MUXER 0
-#define CONFIG_RTP_MUXER 0
-#define CONFIG_RTSP_MUXER 0
-#define CONFIG_SAP_MUXER 0
-#define CONFIG_SEGMENT_MUXER 0
-#define CONFIG_STREAM_SEGMENT_MUXER 0
-#define CONFIG_SMJPEG_MUXER 0
-#define CONFIG_SMOOTHSTREAMING_MUXER 0
-#define CONFIG_SOX_MUXER 0
-#define CONFIG_SPDIF_MUXER 0
-#define CONFIG_SPEEX_MUXER 0
-#define CONFIG_SRT_MUXER 0
-#define CONFIG_SWF_MUXER 0
-#define CONFIG_TEE_MUXER 0
-#define CONFIG_TG2_MUXER 0
-#define CONFIG_TGP_MUXER 0
-#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
-#define CONFIG_TRUEHD_MUXER 0
-#define CONFIG_VC1_MUXER 0
-#define CONFIG_VC1T_MUXER 0
-#define CONFIG_VOC_MUXER 0
-#define CONFIG_W64_MUXER 0
-#define CONFIG_WAV_MUXER 0
-#define CONFIG_WEBM_MUXER 0
-#define CONFIG_WEBVTT_MUXER 0
-#define CONFIG_WTV_MUXER 0
-#define CONFIG_WV_MUXER 0
-#define CONFIG_YUV4MPEGPIPE_MUXER 0
-#define CONFIG_LIBNUT_MUXER 0
-#define CONFIG_ALSA_OUTDEV 0
-#define CONFIG_CACA_OUTDEV 0
-#define CONFIG_FBDEV_OUTDEV 0
-#define CONFIG_OSS_OUTDEV 0
-#define CONFIG_PULSE_OUTDEV 0
-#define CONFIG_SDL_OUTDEV 0
-#define CONFIG_SNDIO_OUTDEV 0
-#define CONFIG_V4L2_OUTDEV 0
-#define CONFIG_XV_OUTDEV 0
-#define CONFIG_AAC_PARSER 0
-#define CONFIG_AAC_LATM_PARSER 0
-#define CONFIG_AC3_PARSER 0
-#define CONFIG_ADX_PARSER 0
-#define CONFIG_BMP_PARSER 0
-#define CONFIG_CAVSVIDEO_PARSER 0
-#define CONFIG_COOK_PARSER 0
-#define CONFIG_DCA_PARSER 0
-#define CONFIG_DIRAC_PARSER 0
-#define CONFIG_DNXHD_PARSER 0
-#define CONFIG_DPX_PARSER 0
-#define CONFIG_DVBSUB_PARSER 0
-#define CONFIG_DVDSUB_PARSER 0
-#define CONFIG_DVD_NAV_PARSER 0
-#define CONFIG_FLAC_PARSER 0
-#define CONFIG_GSM_PARSER 0
-#define CONFIG_H261_PARSER 0
-#define CONFIG_H263_PARSER 0
-#define CONFIG_H264_PARSER 0
-#define CONFIG_HEVC_PARSER 0
-#define CONFIG_MJPEG_PARSER 0
-#define CONFIG_MLP_PARSER 0
-#define CONFIG_MPEG4VIDEO_PARSER 0
-#define CONFIG_MPEGAUDIO_PARSER 0
-#define CONFIG_MPEGVIDEO_PARSER 0
-#define CONFIG_PNG_PARSER 0
-#define CONFIG_PNM_PARSER 0
-#define CONFIG_RV30_PARSER 0
-#define CONFIG_RV40_PARSER 0
-#define CONFIG_TAK_PARSER 0
-#define CONFIG_VC1_PARSER 0
-#define CONFIG_VORBIS_PARSER 1
-#define CONFIG_VP3_PARSER 1
-#define CONFIG_VP8_PARSER 1
-#define CONFIG_VP9_PARSER 0
-#define CONFIG_BLURAY_PROTOCOL 0
-#define CONFIG_CACHE_PROTOCOL 0
-#define CONFIG_CONCAT_PROTOCOL 0
-#define CONFIG_CRYPTO_PROTOCOL 0
-#define CONFIG_DATA_PROTOCOL 0
-#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
-#define CONFIG_FFRTMPHTTP_PROTOCOL 0
-#define CONFIG_FILE_PROTOCOL 0
-#define CONFIG_FTP_PROTOCOL 0
-#define CONFIG_GOPHER_PROTOCOL 0
-#define CONFIG_HLS_PROTOCOL 0
-#define CONFIG_HTTP_PROTOCOL 0
-#define CONFIG_HTTPPROXY_PROTOCOL 0
-#define CONFIG_HTTPS_PROTOCOL 0
-#define CONFIG_MMSH_PROTOCOL 0
-#define CONFIG_MMST_PROTOCOL 0
-#define CONFIG_MD5_PROTOCOL 0
-#define CONFIG_PIPE_PROTOCOL 0
-#define CONFIG_RTMP_PROTOCOL 0
-#define CONFIG_RTMPE_PROTOCOL 0
-#define CONFIG_RTMPS_PROTOCOL 0
-#define CONFIG_RTMPT_PROTOCOL 0
-#define CONFIG_RTMPTE_PROTOCOL 0
-#define CONFIG_RTMPTS_PROTOCOL 0
-#define CONFIG_RTP_PROTOCOL 0
-#define CONFIG_SCTP_PROTOCOL 0
-#define CONFIG_SRTP_PROTOCOL 0
-#define CONFIG_TCP_PROTOCOL 0
-#define CONFIG_TLS_PROTOCOL 0
-#define CONFIG_UDP_PROTOCOL 0
-#define CONFIG_UNIX_PROTOCOL 0
-#define CONFIG_LIBRTMP_PROTOCOL 0
-#define CONFIG_LIBRTMPE_PROTOCOL 0
-#define CONFIG_LIBRTMPS_PROTOCOL 0
-#define CONFIG_LIBRTMPT_PROTOCOL 0
-#define CONFIG_LIBRTMPTE_PROTOCOL 0
-#define CONFIG_LIBSSH_PROTOCOL 0
-#endif /* FFMPEG_CONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/libavutil/avconfig.h
deleted file mode 100644
index f6685b72c19..00000000000
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win-vs2013/x64/libavutil/avconfig.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Generated by ffconf */
-#ifndef AVUTIL_AVCONFIG_H
-#define AVUTIL_AVCONFIG_H
-#define AV_HAVE_BIGENDIAN 0
-#define AV_HAVE_FAST_UNALIGNED 1
-#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
-#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm
index 11c47b6aaad..43688d19d1d 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 0
%define HAVE_AMD3DNOWEXT_INLINE 0
%define HAVE_AVX_INLINE 0
%define HAVE_AVX2_INLINE 0
+%define HAVE_FMA3_INLINE 0
%define HAVE_FMA4_INLINE 0
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 0
%define HAVE_MMXEXT_INLINE 0
%define HAVE_SSE_INLINE 0
@@ -96,73 +113,44 @@
%define HAVE_SSE4_INLINE 0
%define HAVE_SSE42_INLINE 0
%define HAVE_SSSE3_INLINE 0
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 0
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 0
+%define HAVE_FAST_64BIT 0
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 0
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 0
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 1
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 1
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 1
+%define HAVE_SARESTART 0
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
%define HAVE_INLINE_ASM 0
%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 0
-%define HAVE_W32THREADS 1
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 0
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 1
-%define HAVE_ATANF 1
-%define HAVE_ATAN2F 1
-%define HAVE_CBRT 0
-%define HAVE_CBRTF 0
-%define HAVE_COSF 1
-%define HAVE_EXP2 0
-%define HAVE_EXP2F 0
-%define HAVE_EXPF 1
-%define HAVE_ISINF 0
-%define HAVE_ISNAN 0
-%define HAVE_LDEXPF 1
-%define HAVE_LLRINT 0
-%define HAVE_LLRINTF 0
-%define HAVE_LOG2 0
-%define HAVE_LOG2F 0
-%define HAVE_LOG10F 1
-%define HAVE_LRINT 0
-%define HAVE_LRINTF 0
-%define HAVE_POWF 1
-%define HAVE_RINT 0
-%define HAVE_ROUND 0
-%define HAVE_ROUNDF 0
-%define HAVE_SINF 1
-%define HAVE_TRUNC 0
-%define HAVE_TRUNCF 0
-%define HAVE_ACCESS 1
-%define HAVE_ALIGNED_MALLOC 1
-%define HAVE_ALIGNED_STACK 0
%define HAVE_ALSA_ASOUNDLIB_H 0
%define HAVE_ALTIVEC_H 0
%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 0
-%define HAVE_ATTRIBUTE_PACKED 0
%define HAVE_CDIO_PARANOIA_H 0
%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
%define HAVE_CL_CL_H 0
-%define HAVE_CLOCK_GETTIME 0
-%define HAVE_CLOSESOCKET 0
-%define HAVE_COMMANDLINETOARGVW 1
-%define HAVE_CPUNOP 1
-%define HAVE_CRYPTGENRANDOM 1
-%define HAVE_DCBZL 0
%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
%define HAVE_DEV_IC_BT8XX_H 0
@@ -170,15 +158,66 @@
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 1
%define HAVE_DLFCN_H 0
-%define HAVE_DLOPEN 0
-%define HAVE_DOS_PATHS 1
%define HAVE_DXVA_H 1
-%define HAVE_EBP_AVAILABLE 0
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 0
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 1
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 0
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 0
+%define HAVE_SYS_PARAM_H 0
+%define HAVE_SYS_RESOURCE_H 0
+%define HAVE_SYS_SELECT_H 0
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 0
+%define HAVE_SYS_UN_H 0
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 0
+%define HAVE_UNISTD_H 0
+%define HAVE_WINDOWS_H 1
+%define HAVE_WINSOCK2_H 0
+%define HAVE_ATANF 1
+%define HAVE_ATAN2F 1
+%define HAVE_CBRT 1
+%define HAVE_CBRTF 1
+%define HAVE_COSF 1
+%define HAVE_EXP2 1
+%define HAVE_EXP2F 1
+%define HAVE_EXPF 1
+%define HAVE_ISINF 1
+%define HAVE_ISNAN 1
+%define HAVE_LDEXPF 1
+%define HAVE_LLRINT 1
+%define HAVE_LLRINTF 1
+%define HAVE_LOG2 1
+%define HAVE_LOG2F 1
+%define HAVE_LOG10F 1
+%define HAVE_LRINT 1
+%define HAVE_LRINTF 1
+%define HAVE_POWF 1
+%define HAVE_RINT 1
+%define HAVE_ROUND 1
+%define HAVE_ROUNDF 1
+%define HAVE_SINF 1
+%define HAVE_TRUNC 1
+%define HAVE_TRUNCF 1
+%define HAVE_ACCESS 1
+%define HAVE_ALIGNED_MALLOC 1
+%define HAVE_CLOCK_GETTIME 0
+%define HAVE_CLOSESOCKET 0
+%define HAVE_COMMANDLINETOARGVW 1
+%define HAVE_COTASKMEMFREE 1
+%define HAVE_CRYPTGENRANDOM 1
+%define HAVE_DLOPEN 0
%define HAVE_FCNTL 0
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 0
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 1
%define HAVE_GETPROCESSMEMORYINFO 1
%define HAVE_GETPROCESSTIMES 1
-%define HAVE_GETSYSTEMTIMEASFILETIME 1
%define HAVE_GETRUSAGE 0
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 1
%define HAVE_GETTIMEOFDAY 0
%define HAVE_GLOB 0
-%define HAVE_GNU_AS 0
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
+%define HAVE_GLXGETPROCADDRESS 0
%define HAVE_INET_ATON 0
-%define HAVE_IO_H 1
-%define HAVE_INLINE_ASM_LABELS 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 1
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 1
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 0
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 1
%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 1
%define HAVE_MKSTEMP 0
-%define HAVE_MM_EMPTY 1
%define HAVE_MMAP 0
%define HAVE_MPROTECT 0
%define HAVE_NANOSLEEP 0
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 1
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 0
%define HAVE_POSIX_MEMALIGN 0
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 0
-%define HAVE_RDTSC 1
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 0
%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 1
-%define HAVE_SETMODE 0
+%define HAVE_SETMODE 1
%define HAVE_SETRLIMIT 0
%define HAVE_SLEEP 1
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 0
+%define HAVE_SYSCONF 0
+%define HAVE_SYSCTL 0
+%define HAVE_USLEEP 0
+%define HAVE_VIRTUALALLOC 1
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 0
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 1
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 0
+%define HAVE_ATTRIBUTE_PACKED 0
+%define HAVE_EBP_AVAILABLE 0
+%define HAVE_EBX_AVAILABLE 0
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 0
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 0
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 0
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 0
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 0
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-%define HAVE_SYSCONF 0
-%define HAVE_SYSCTL 0
-%define HAVE_SYS_MMAN_H 0
-%define HAVE_SYS_PARAM_H 0
-%define HAVE_SYS_RESOURCE_H 0
-%define HAVE_SYS_SELECT_H 0
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 0
-%define HAVE_SYS_UN_H 0
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 0
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 1
+%define HAVE_DXVA2API_COBJ 1
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 1
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 0
-%define HAVE_USLEEP 0
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 1
-%define HAVE_WINDOWS_H 1
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 1
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -389,34 +438,25 @@
%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 0
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 0
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_CABAC 0
%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 0
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 0
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 0
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 0
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h
index ef03295e24b..e387249ac1c 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --disable-error-resilience"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86"
+#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86"
#define av_restrict __restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,73 +128,44 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 0
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 1
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 1
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 1
+#define HAVE_SARESTART 0
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
#define HAVE_INLINE_ASM 0
#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 0
-#define HAVE_W32THREADS 1
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 0
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 1
-#define HAVE_ATANF 1
-#define HAVE_ATAN2F 1
-#define HAVE_CBRT 0
-#define HAVE_CBRTF 0
-#define HAVE_COSF 1
-#define HAVE_EXP2 0
-#define HAVE_EXP2F 0
-#define HAVE_EXPF 1
-#define HAVE_ISINF 0
-#define HAVE_ISNAN 0
-#define HAVE_LDEXPF 1
-#define HAVE_LLRINT 0
-#define HAVE_LLRINTF 0
-#define HAVE_LOG2 0
-#define HAVE_LOG2F 0
-#define HAVE_LOG10F 1
-#define HAVE_LRINT 0
-#define HAVE_LRINTF 0
-#define HAVE_POWF 1
-#define HAVE_RINT 0
-#define HAVE_ROUND 0
-#define HAVE_ROUNDF 0
-#define HAVE_SINF 1
-#define HAVE_TRUNC 0
-#define HAVE_TRUNCF 0
-#define HAVE_ACCESS 1
-#define HAVE_ALIGNED_MALLOC 1
-#define HAVE_ALIGNED_STACK 0
#define HAVE_ALSA_ASOUNDLIB_H 0
#define HAVE_ALTIVEC_H 0
#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 0
-#define HAVE_ATTRIBUTE_PACKED 0
#define HAVE_CDIO_PARANOIA_H 0
#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
#define HAVE_CL_CL_H 0
-#define HAVE_CLOCK_GETTIME 0
-#define HAVE_CLOSESOCKET 0
-#define HAVE_COMMANDLINETOARGVW 1
-#define HAVE_CPUNOP 1
-#define HAVE_CRYPTGENRANDOM 1
-#define HAVE_DCBZL 0
#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
#define HAVE_DEV_IC_BT8XX_H 0
@@ -185,15 +173,66 @@
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 1
#define HAVE_DLFCN_H 0
-#define HAVE_DLOPEN 0
-#define HAVE_DOS_PATHS 1
#define HAVE_DXVA_H 1
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 1
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 0
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 0
+#define HAVE_SYS_PARAM_H 0
+#define HAVE_SYS_RESOURCE_H 0
+#define HAVE_SYS_SELECT_H 0
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 0
+#define HAVE_SYS_UN_H 0
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 0
+#define HAVE_UNISTD_H 0
+#define HAVE_WINDOWS_H 1
+#define HAVE_WINSOCK2_H 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COSF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 1
+#define HAVE_LOG2F 1
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 1
+#define HAVE_CLOCK_GETTIME 0
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 1
+#define HAVE_COTASKMEMFREE 1
+#define HAVE_CRYPTGENRANDOM 1
+#define HAVE_DLOPEN 0
#define HAVE_FCNTL 0
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 0
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 1
#define HAVE_GETPROCESSMEMORYINFO 1
#define HAVE_GETPROCESSTIMES 1
-#define HAVE_GETSYSTEMTIMEASFILETIME 1
#define HAVE_GETRUSAGE 0
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 1
#define HAVE_GETTIMEOFDAY 0
#define HAVE_GLOB 0
-#define HAVE_GNU_AS 0
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
+#define HAVE_GLXGETPROCADDRESS 0
#define HAVE_INET_ATON 0
-#define HAVE_IO_H 1
-#define HAVE_INLINE_ASM_LABELS 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 1
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 1
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 0
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 1
#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 1
#define HAVE_MKSTEMP 0
-#define HAVE_MM_EMPTY 1
#define HAVE_MMAP 0
#define HAVE_MPROTECT 0
#define HAVE_NANOSLEEP 0
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 1
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 0
#define HAVE_POSIX_MEMALIGN 0
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 0
-#define HAVE_RDTSC 1
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 0
#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 1
-#define HAVE_SETMODE 0
+#define HAVE_SETMODE 1
#define HAVE_SETRLIMIT 0
#define HAVE_SLEEP 1
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 0
+#define HAVE_SYSCONF 0
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 0
+#define HAVE_VIRTUALALLOC 1
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 0
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 1
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 0
+#define HAVE_ATTRIBUTE_PACKED 0
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 0
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 0
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 0
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-#define HAVE_SYSCONF 0
-#define HAVE_SYSCTL 0
-#define HAVE_SYS_MMAN_H 0
-#define HAVE_SYS_PARAM_H 0
-#define HAVE_SYS_RESOURCE_H 0
-#define HAVE_SYS_SELECT_H 0
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 0
-#define HAVE_SYS_UN_H 0
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 0
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 1
+#define HAVE_DXVA2API_COBJ 1
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 1
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 0
-#define HAVE_USLEEP 0
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 1
-#define HAVE_WINDOWS_H 1
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 0
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 0
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm
index c19357be455..9e158d701a1 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 0
%define HAVE_AMD3DNOWEXT_INLINE 0
%define HAVE_AVX_INLINE 0
%define HAVE_AVX2_INLINE 0
+%define HAVE_FMA3_INLINE 0
%define HAVE_FMA4_INLINE 0
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 0
%define HAVE_MMXEXT_INLINE 0
%define HAVE_SSE_INLINE 0
@@ -96,73 +113,44 @@
%define HAVE_SSE4_INLINE 0
%define HAVE_SSE42_INLINE 0
%define HAVE_SSSE3_INLINE 0
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 0
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 1
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 1
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 0
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 1
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 1
+%define HAVE_MM_EMPTY 0
+%define HAVE_RDTSC 1
+%define HAVE_SARESTART 0
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
%define HAVE_INLINE_ASM 0
%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 0
-%define HAVE_W32THREADS 1
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 0
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 1
-%define HAVE_ATANF 1
-%define HAVE_ATAN2F 1
-%define HAVE_CBRT 0
-%define HAVE_CBRTF 0
-%define HAVE_COSF 1
-%define HAVE_EXP2 0
-%define HAVE_EXP2F 0
-%define HAVE_EXPF 1
-%define HAVE_ISINF 0
-%define HAVE_ISNAN 0
-%define HAVE_LDEXPF 1
-%define HAVE_LLRINT 0
-%define HAVE_LLRINTF 0
-%define HAVE_LOG2 0
-%define HAVE_LOG2F 0
-%define HAVE_LOG10F 1
-%define HAVE_LRINT 0
-%define HAVE_LRINTF 0
-%define HAVE_POWF 1
-%define HAVE_RINT 0
-%define HAVE_ROUND 0
-%define HAVE_ROUNDF 0
-%define HAVE_SINF 1
-%define HAVE_TRUNC 0
-%define HAVE_TRUNCF 0
-%define HAVE_ACCESS 1
-%define HAVE_ALIGNED_MALLOC 1
-%define HAVE_ALIGNED_STACK 1
%define HAVE_ALSA_ASOUNDLIB_H 0
%define HAVE_ALTIVEC_H 0
%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
%define HAVE_ASM_TYPES_H 0
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 0
-%define HAVE_ATTRIBUTE_PACKED 0
%define HAVE_CDIO_PARANOIA_H 0
%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
%define HAVE_CL_CL_H 0
-%define HAVE_CLOCK_GETTIME 0
-%define HAVE_CLOSESOCKET 0
-%define HAVE_COMMANDLINETOARGVW 1
-%define HAVE_CPUNOP 1
-%define HAVE_CRYPTGENRANDOM 1
-%define HAVE_DCBZL 0
%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
%define HAVE_DEV_IC_BT8XX_H 0
@@ -170,15 +158,66 @@
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 1
%define HAVE_DLFCN_H 0
-%define HAVE_DLOPEN 0
-%define HAVE_DOS_PATHS 1
%define HAVE_DXVA_H 1
-%define HAVE_EBP_AVAILABLE 0
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 1
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 1
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 1
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 0
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 0
+%define HAVE_SYS_PARAM_H 0
+%define HAVE_SYS_RESOURCE_H 0
+%define HAVE_SYS_SELECT_H 0
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 0
+%define HAVE_SYS_UN_H 0
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 0
+%define HAVE_UNISTD_H 0
+%define HAVE_WINDOWS_H 1
+%define HAVE_WINSOCK2_H 0
+%define HAVE_ATANF 1
+%define HAVE_ATAN2F 1
+%define HAVE_CBRT 1
+%define HAVE_CBRTF 1
+%define HAVE_COSF 1
+%define HAVE_EXP2 1
+%define HAVE_EXP2F 1
+%define HAVE_EXPF 1
+%define HAVE_ISINF 1
+%define HAVE_ISNAN 1
+%define HAVE_LDEXPF 1
+%define HAVE_LLRINT 1
+%define HAVE_LLRINTF 1
+%define HAVE_LOG2 1
+%define HAVE_LOG2F 1
+%define HAVE_LOG10F 1
+%define HAVE_LRINT 1
+%define HAVE_LRINTF 1
+%define HAVE_POWF 1
+%define HAVE_RINT 1
+%define HAVE_ROUND 1
+%define HAVE_ROUNDF 1
+%define HAVE_SINF 1
+%define HAVE_TRUNC 1
+%define HAVE_TRUNCF 1
+%define HAVE_ACCESS 1
+%define HAVE_ALIGNED_MALLOC 1
+%define HAVE_CLOCK_GETTIME 0
+%define HAVE_CLOSESOCKET 0
+%define HAVE_COMMANDLINETOARGVW 1
+%define HAVE_COTASKMEMFREE 1
+%define HAVE_CRYPTGENRANDOM 1
+%define HAVE_DLOPEN 0
%define HAVE_FCNTL 0
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 0
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 1
%define HAVE_GETPROCESSMEMORYINFO 1
%define HAVE_GETPROCESSTIMES 1
-%define HAVE_GETSYSTEMTIMEASFILETIME 1
%define HAVE_GETRUSAGE 0
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 1
%define HAVE_GETTIMEOFDAY 0
%define HAVE_GLOB 0
-%define HAVE_GNU_AS 0
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
+%define HAVE_GLXGETPROCADDRESS 0
%define HAVE_INET_ATON 0
-%define HAVE_IO_H 1
-%define HAVE_INLINE_ASM_LABELS 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 1
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 1
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 0
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 1
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 1
%define HAVE_MEMALIGN 0
-%define HAVE_MEMORYBARRIER 1
%define HAVE_MKSTEMP 0
-%define HAVE_MM_EMPTY 0
%define HAVE_MMAP 0
%define HAVE_MPROTECT 0
%define HAVE_NANOSLEEP 0
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 1
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 0
%define HAVE_POSIX_MEMALIGN 0
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 0
-%define HAVE_RDTSC 1
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 0
%define HAVE_SCHED_GETAFFINITY 0
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 1
-%define HAVE_SETMODE 0
+%define HAVE_SETMODE 1
%define HAVE_SETRLIMIT 0
%define HAVE_SLEEP 1
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 0
+%define HAVE_SYSCONF 0
+%define HAVE_SYSCTL 0
+%define HAVE_USLEEP 0
+%define HAVE_VIRTUALALLOC 1
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 0
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 1
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 0
+%define HAVE_ATTRIBUTE_PACKED 0
+%define HAVE_EBP_AVAILABLE 0
+%define HAVE_EBX_AVAILABLE 0
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 0
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 0
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 0
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 0
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 0
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 0
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-%define HAVE_SYSCONF 0
-%define HAVE_SYSCTL 0
-%define HAVE_SYS_MMAN_H 0
-%define HAVE_SYS_PARAM_H 0
-%define HAVE_SYS_RESOURCE_H 0
-%define HAVE_SYS_SELECT_H 0
-%define HAVE_SYS_SOUNDCARD_H 0
-%define HAVE_SYS_TIME_H 0
-%define HAVE_SYS_UN_H 0
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 0
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 1
+%define HAVE_DXVA2API_COBJ 1
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 1
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 0
-%define HAVE_USLEEP 0
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 1
-%define HAVE_WINDOWS_H 1
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 1
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -389,34 +438,25 @@
%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 0
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_CABAC 0
%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 0
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 0
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 0
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 0
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h
index 237a15c764c..9954a84558a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --disable-error-resilience"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64"
+#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64"
#define av_restrict __restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,73 +128,44 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 1
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 0
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 1
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 1
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 1
+#define HAVE_SARESTART 0
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
#define HAVE_INLINE_ASM 0
#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 0
-#define HAVE_W32THREADS 1
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 0
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 1
-#define HAVE_ATANF 1
-#define HAVE_ATAN2F 1
-#define HAVE_CBRT 0
-#define HAVE_CBRTF 0
-#define HAVE_COSF 1
-#define HAVE_EXP2 0
-#define HAVE_EXP2F 0
-#define HAVE_EXPF 1
-#define HAVE_ISINF 0
-#define HAVE_ISNAN 0
-#define HAVE_LDEXPF 1
-#define HAVE_LLRINT 0
-#define HAVE_LLRINTF 0
-#define HAVE_LOG2 0
-#define HAVE_LOG2F 0
-#define HAVE_LOG10F 1
-#define HAVE_LRINT 0
-#define HAVE_LRINTF 0
-#define HAVE_POWF 1
-#define HAVE_RINT 0
-#define HAVE_ROUND 0
-#define HAVE_ROUNDF 0
-#define HAVE_SINF 1
-#define HAVE_TRUNC 0
-#define HAVE_TRUNCF 0
-#define HAVE_ACCESS 1
-#define HAVE_ALIGNED_MALLOC 1
-#define HAVE_ALIGNED_STACK 1
#define HAVE_ALSA_ASOUNDLIB_H 0
#define HAVE_ALTIVEC_H 0
#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
#define HAVE_ASM_TYPES_H 0
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 0
-#define HAVE_ATTRIBUTE_PACKED 0
#define HAVE_CDIO_PARANOIA_H 0
#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
#define HAVE_CL_CL_H 0
-#define HAVE_CLOCK_GETTIME 0
-#define HAVE_CLOSESOCKET 0
-#define HAVE_COMMANDLINETOARGVW 1
-#define HAVE_CPUNOP 1
-#define HAVE_CRYPTGENRANDOM 1
-#define HAVE_DCBZL 0
#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
#define HAVE_DEV_IC_BT8XX_H 0
@@ -185,15 +173,66 @@
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 1
#define HAVE_DLFCN_H 0
-#define HAVE_DLOPEN 0
-#define HAVE_DOS_PATHS 1
#define HAVE_DXVA_H 1
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 1
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 1
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 1
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 0
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 0
+#define HAVE_SYS_PARAM_H 0
+#define HAVE_SYS_RESOURCE_H 0
+#define HAVE_SYS_SELECT_H 0
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 0
+#define HAVE_SYS_UN_H 0
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 0
+#define HAVE_UNISTD_H 0
+#define HAVE_WINDOWS_H 1
+#define HAVE_WINSOCK2_H 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COSF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 1
+#define HAVE_LOG2F 1
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 1
+#define HAVE_CLOCK_GETTIME 0
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 1
+#define HAVE_COTASKMEMFREE 1
+#define HAVE_CRYPTGENRANDOM 1
+#define HAVE_DLOPEN 0
#define HAVE_FCNTL 0
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 0
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 1
#define HAVE_GETPROCESSMEMORYINFO 1
#define HAVE_GETPROCESSTIMES 1
-#define HAVE_GETSYSTEMTIMEASFILETIME 1
#define HAVE_GETRUSAGE 0
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 1
#define HAVE_GETTIMEOFDAY 0
#define HAVE_GLOB 0
-#define HAVE_GNU_AS 0
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
+#define HAVE_GLXGETPROCADDRESS 0
#define HAVE_INET_ATON 0
-#define HAVE_IO_H 1
-#define HAVE_INLINE_ASM_LABELS 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 1
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 1
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 0
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 1
#define HAVE_MEMALIGN 0
-#define HAVE_MEMORYBARRIER 1
#define HAVE_MKSTEMP 0
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 0
#define HAVE_MPROTECT 0
#define HAVE_NANOSLEEP 0
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 1
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 0
#define HAVE_POSIX_MEMALIGN 0
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 0
-#define HAVE_RDTSC 1
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 0
#define HAVE_SCHED_GETAFFINITY 0
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 1
-#define HAVE_SETMODE 0
+#define HAVE_SETMODE 1
#define HAVE_SETRLIMIT 0
#define HAVE_SLEEP 1
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 0
+#define HAVE_SYSCONF 0
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 0
+#define HAVE_VIRTUALALLOC 1
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 0
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 1
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 0
+#define HAVE_ATTRIBUTE_PACKED 0
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 0
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 0
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 0
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 0
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 0
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
-#define HAVE_SYSCONF 0
-#define HAVE_SYSCTL 0
-#define HAVE_SYS_MMAN_H 0
-#define HAVE_SYS_PARAM_H 0
-#define HAVE_SYS_RESOURCE_H 0
-#define HAVE_SYS_SELECT_H 0
-#define HAVE_SYS_SOUNDCARD_H 0
-#define HAVE_SYS_TIME_H 0
-#define HAVE_SYS_UN_H 0
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 0
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 1
+#define HAVE_DXVA2API_COBJ 1
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 1
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 0
-#define HAVE_USLEEP 0
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 1
-#define HAVE_WINDOWS_H 1
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 0
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/config.h
index 6b21e49013e..b02f606e5f1 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --enable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=neon' --extra-cflags='-mfloat-abi=hard' --enable-pic --disable-error-resilience --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --enable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=neon' --extra-cflags='-mfloat-abi=hard' --enable-pic --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.x-google (4.7.2_cos_gg_c8f69e0) 20130114 (prerelease)"
+#define CC_IDENT "gcc 4.8.x-google (4.8.2_cos_gg_38c6bf0_4.8.2-r70) 20140307 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 1
+#define HAVE_ARMV8 0
#define HAVE_NEON 1
#define HAVE_VFP 1
#define HAVE_VFPV3 1
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -57,25 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 1
#define HAVE_VFP_EXTERNAL 1
#define HAVE_VFPV3_EXTERNAL 1
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 1
#define HAVE_VFP_INLINE 1
#define HAVE_VFPV3_INLINE 1
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 1
-#define HAVE_ASM_MOD_Y 1
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 1
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 1
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 1
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/config.h
index 4a66497fb52..5341f63a3df 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/config.h
@@ -1,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --disable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=hard' --enable-pic --disable-error-resilience --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- --target-os=linux --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --disable-neon --extra-cflags='-march=armv7-a' --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=hard' --enable-pic --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.x-google (4.7.2_cos_gg_c8f69e0) 20130114 (prerelease)"
+#define CC_IDENT "gcc 4.8.x-google (4.8.2_cos_gg_38c6bf0_4.8.2-r70) 20140307 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 1
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 1
#define HAVE_VFPV3 1
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -57,25 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 1
#define HAVE_VFPV3_EXTERNAL 1
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 1
#define HAVE_VFPV3_INLINE 1
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 1
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 1
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 1
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-/* #define HAVE_VFP_ARGS 1 -- Disabled to allow softfp/hardfp selection at gyp time */
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 1
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.asm
index eace7a00857..5a58cad9c88 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 0
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 0
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 0
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
-%define HAVE_SYMVER 1
+%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 1
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 1
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 1
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 1
-%define HAVE_EBX_AVAILABLE 0
-%define HAVE_FAST_64BIT 0
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 0
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 1
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 0
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 1
-%define HAVE_SDL 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 0
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 0
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 1
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 1
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 0
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
%define HAVE_XLIB 0
-%define HAVE_XMM_CLOBBERS 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -389,34 +438,25 @@
%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_CABAC 0
%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 0
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 0
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 0
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 0
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.h
index 06db8a81620..0e22de88912 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.h
@@ -1,9 +1,9 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --arch=i686 --enable-yasm --extra-cflags=-m32 --extra-ldflags=-m32 --enable-pic --disable-error-resilience --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --arch=i686 --enable-yasm --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
#define CC_IDENT "gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 1
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
#define HAVE_XLIB 0
-#define HAVE_XMM_CLOBBERS 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/config.h
index 07f168f5045..0831b46fa9b 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/config.h
@@ -1,14 +1,16 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-cross-compile --cross-prefix=mips-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --disable-error-resilience --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-cross-compile --cross-prefix=mipsel-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.7.3 (Sourcery CodeBench Lite 2013.05-7)"
+#define CC_IDENT "gcc 4.9.0 (GCC)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
+#define BUILDSUF ""
#define SLIBSUF ".so"
#define HAVE_MMX2 HAVE_MMXEXT
#define ARCH_AARCH64 0
@@ -38,14 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
#define HAVE_FMA4 0
-#define HAVE_I686 1
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
@@ -54,24 +62,31 @@
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 1
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
@@ -80,24 +95,31 @@
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
+#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
@@ -106,26 +128,76 @@
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 0
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -153,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 0
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 0
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 0
-#define HAVE_EBX_AVAILABLE 0
-#define HAVE_FAST_64BIT 0
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 0
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -196,63 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 0
-#define HAVE_LOCAL_ALIGNED_8 0
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 1
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 0
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
-#define HAVE_MSVCRT 0
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -265,30 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
-#define HAVE_XMM_CLOBBERS 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -305,10 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -316,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -323,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -355,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -387,47 +453,41 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 0
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_GCRYPT 0
#define CONFIG_GOLOMB 1
#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
#define CONFIG_H264CHROMA 0
#define CONFIG_H264DSP 0
#define CONFIG_H264PRED 1
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -440,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -449,7 +510,6 @@
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
-#define CONFIG_MP3_HEADER_COMPRESS_BSF 0
#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
#define CONFIG_MOV2TEXTSUB_BSF 0
#define CONFIG_NOISE_BSF 0
@@ -457,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -507,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -524,6 +586,8 @@
#define CONFIG_H264_CRYSTALHD_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HUFFYUV_DECODER 0
#define CONFIG_IDCIN_DECODER 0
#define CONFIG_IFF_BYTERUN1_DECODER 0
@@ -641,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -668,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -675,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -708,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -779,6 +852,7 @@
#define CONFIG_ADPCM_EA_XAS_DECODER 0
#define CONFIG_ADPCM_G722_DECODER 0
#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
#define CONFIG_ADPCM_IMA_AMV_DECODER 0
#define CONFIG_ADPCM_IMA_APC_DECODER 0
#define CONFIG_ADPCM_IMA_DK3_DECODER 0
@@ -798,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -876,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -910,6 +987,7 @@
#define CONFIG_H264_DEMUXER 0
#define CONFIG_HEVC_DEMUXER 0
#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
#define CONFIG_ICO_DEMUXER 0
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
@@ -917,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -936,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1003,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1054,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1061,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1133,6 +1217,7 @@
#define CONFIG_FLAC_ENCODER 0
#define CONFIG_G723_1_ENCODER 0
#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
#define CONFIG_NELLYMOSER_ENCODER 0
#define CONFIG_RA_144_ENCODER 0
#define CONFIG_SONIC_ENCODER 0
@@ -1206,14 +1291,17 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
#define CONFIG_ACONVERT_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
@@ -1243,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1254,6 +1343,7 @@
#define CONFIG_LADSPA_FILTER 0
#define CONFIG_LOWPASS_FILTER 0
#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1281,12 +1371,14 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FIELD_FILTER 0
@@ -1294,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1314,6 +1407,7 @@
#define CONFIG_LUTRGB_FILTER 0
#define CONFIG_LUTYUV_FILTER 0
#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
#define CONFIG_MP_FILTER 0
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
@@ -1344,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1389,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1403,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1458,6 +1559,8 @@
#define CONFIG_H261_MUXER 0
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1494,8 +1597,10 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
#define CONFIG_PCM_ALAW_MUXER 0
#define CONFIG_PCM_MULAW_MUXER 0
#define CONFIG_PCM_F64BE_MUXER 0
@@ -1530,6 +1635,7 @@
#define CONFIG_SMOOTHSTREAMING_MUXER 0
#define CONFIG_SOX_MUXER 0
#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SPEEX_MUXER 0
#define CONFIG_SRT_MUXER 0
#define CONFIG_SWF_MUXER 0
#define CONFIG_TEE_MUXER 0
@@ -1537,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1550,6 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1575,11 +1685,13 @@
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
#define CONFIG_H264_PARSER 0
+#define CONFIG_HEVC_PARSER 0
#define CONFIG_MJPEG_PARSER 0
#define CONFIG_MLP_PARSER 0
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1589,6 +1701,7 @@
#define CONFIG_VORBIS_PARSER 1
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
+#define CONFIG_VP9_PARSER 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
@@ -1616,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/libavutil/avconfig.h
index bac323a539b..123b3b28aef 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 0
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.asm
index 4f214007aaa..a7745082728 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.asm
@@ -25,15 +25,20 @@
%define HAVE_ARMV5TE 0
%define HAVE_ARMV6 0
%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
%define HAVE_NEON 0
%define HAVE_VFP 0
%define HAVE_VFPV3 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 1
+%define HAVE_LDBRX 1
+%define HAVE_PPC4XX 0
%define HAVE_AMD3DNOW 1
%define HAVE_AMD3DNOWEXT 1
%define HAVE_AVX 1
%define HAVE_AVX2 1
+%define HAVE_FMA3 1
%define HAVE_FMA4 1
-%define HAVE_I686 1
%define HAVE_MMX 1
%define HAVE_MMXEXT 1
%define HAVE_SSE 1
@@ -42,25 +47,31 @@
%define HAVE_SSE4 1
%define HAVE_SSE42 1
%define HAVE_SSSE3 1
-%define HAVE_ALTIVEC 0
-%define HAVE_PPC4XX 0
-%define HAVE_VIS 0
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
%define HAVE_MIPSFPU 0
%define HAVE_MIPS32R2 0
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
+%define HAVE_LOONGSON 1
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
%define HAVE_NEON_EXTERNAL 0
%define HAVE_VFP_EXTERNAL 0
%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
%define HAVE_AMD3DNOW_EXTERNAL 1
%define HAVE_AMD3DNOWEXT_EXTERNAL 1
%define HAVE_AVX_EXTERNAL 1
%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
%define HAVE_FMA4_EXTERNAL 1
-%define HAVE_I686_EXTERNAL 0
%define HAVE_MMX_EXTERNAL 1
%define HAVE_MMXEXT_EXTERNAL 1
%define HAVE_SSE_EXTERNAL 1
@@ -69,25 +80,31 @@
%define HAVE_SSE4_EXTERNAL 1
%define HAVE_SSE42_EXTERNAL 1
%define HAVE_SSSE3_EXTERNAL 1
-%define HAVE_ALTIVEC_EXTERNAL 0
-%define HAVE_PPC4XX_EXTERNAL 0
-%define HAVE_VIS_EXTERNAL 0
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
%define HAVE_MIPSFPU_EXTERNAL 0
%define HAVE_MIPS32R2_EXTERNAL 0
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_LOONGSON_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
%define HAVE_NEON_INLINE 0
%define HAVE_VFP_INLINE 0
%define HAVE_VFPV3_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
%define HAVE_AMD3DNOW_INLINE 1
%define HAVE_AMD3DNOWEXT_INLINE 1
%define HAVE_AVX_INLINE 1
%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
%define HAVE_FMA4_INLINE 1
-%define HAVE_I686_INLINE 0
%define HAVE_MMX_INLINE 1
%define HAVE_MMXEXT_INLINE 1
%define HAVE_SSE_INLINE 1
@@ -96,26 +113,76 @@
%define HAVE_SSE4_INLINE 1
%define HAVE_SSE42_INLINE 1
%define HAVE_SSSE3_INLINE 1
-%define HAVE_ALTIVEC_INLINE 0
-%define HAVE_PPC4XX_INLINE 0
-%define HAVE_VIS_INLINE 0
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
%define HAVE_MIPSFPU_INLINE 0
%define HAVE_MIPS32R2_INLINE 0
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_LOONGSON_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 1
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 1
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
%define HAVE_INLINE_ASM 1
-%define HAVE_SYMVER 1
+%define HAVE_SYMVER 0
%define HAVE_YASM 1
%define HAVE_BIGENDIAN 0
%define HAVE_FAST_UNALIGNED 1
%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-%define HAVE_INCOMPATIBLE_FORK_ABI 0
-%define HAVE_PTHREADS 1
-%define HAVE_W32THREADS 0
-%define HAVE_OS2THREADS 0
-%define HAVE_ATOMICS_GCC 1
-%define HAVE_ATOMICS_SUNCC 0
-%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_CL_CL_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DLFCN_H 1
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 1
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UNISTD_H 1
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
%define HAVE_ATANF 1
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
@@ -143,42 +210,14 @@
%define HAVE_TRUNCF 1
%define HAVE_ACCESS 1
%define HAVE_ALIGNED_MALLOC 0
-%define HAVE_ALIGNED_STACK 1
-%define HAVE_ALSA_ASOUNDLIB_H 0
-%define HAVE_ALTIVEC_H 0
-%define HAVE_ARPA_INET_H 0
-%define HAVE_ASM_MOD_Q 0
-%define HAVE_ASM_MOD_Y 0
-%define HAVE_ASM_TYPES_H 1
-%define HAVE_ATOMIC_CAS_PTR 0
-%define HAVE_ATOMICS_NATIVE 1
-%define HAVE_ATTRIBUTE_MAY_ALIAS 1
-%define HAVE_ATTRIBUTE_PACKED 1
-%define HAVE_CDIO_PARANOIA_H 0
-%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-%define HAVE_CL_CL_H 0
%define HAVE_CLOCK_GETTIME 1
%define HAVE_CLOSESOCKET 0
%define HAVE_COMMANDLINETOARGVW 0
-%define HAVE_CPUNOP 1
+%define HAVE_COTASKMEMFREE 0
%define HAVE_CRYPTGENRANDOM 0
-%define HAVE_DCBZL 0
-%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-%define HAVE_DEV_IC_BT8XX_H 0
-%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-%define HAVE_DIRECT_H 0
-%define HAVE_DLFCN_H 1
%define HAVE_DLOPEN 1
-%define HAVE_DOS_PATHS 0
-%define HAVE_DXVA_H 0
-%define HAVE_EBP_AVAILABLE 1
-%define HAVE_EBX_AVAILABLE 1
-%define HAVE_FAST_64BIT 1
-%define HAVE_FAST_CLZ 1
-%define HAVE_FAST_CMOV 1
%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
%define HAVE_FORK 1
%define HAVE_GETADDRINFO 0
%define HAVE_GETHRTIME 0
@@ -186,64 +225,61 @@
%define HAVE_GETPROCESSAFFINITYMASK 0
%define HAVE_GETPROCESSMEMORYINFO 0
%define HAVE_GETPROCESSTIMES 0
-%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETRUSAGE 1
%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
%define HAVE_GETTIMEOFDAY 1
%define HAVE_GLOB 1
-%define HAVE_GNU_AS 1
-%define HAVE_GNU_WINDRES 0
-%define HAVE_GSM_H 0
-%define HAVE_IBM_ASM 0
-%define HAVE_INET_ATON 1
-%define HAVE_IO_H 0
-%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_INET_ATON 0
%define HAVE_ISATTY 1
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
-%define HAVE_LDBRX 0
-%define HAVE_LIBC_MSVCRT 0
-%define HAVE_LIBDC1394_1 0
-%define HAVE_LIBDC1394_2 0
-%define HAVE_LOCAL_ALIGNED_16 1
-%define HAVE_LOCAL_ALIGNED_8 1
%define HAVE_LOCALTIME_R 1
-%define HAVE_LOONGSON 0
%define HAVE_LZO1X_999_COMPRESS 0
-%define HAVE_MACHINE_IOCTL_BT848_H 0
-%define HAVE_MACHINE_IOCTL_METEOR_H 0
-%define HAVE_MACHINE_RW_BARRIER 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MALLOC_H 1
+%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
%define HAVE_MEMALIGN 1
-%define HAVE_MEMORYBARRIER 0
%define HAVE_MKSTEMP 1
-%define HAVE_MM_EMPTY 1
%define HAVE_MMAP 1
%define HAVE_MPROTECT 1
%define HAVE_NANOSLEEP 1
-%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
%define HAVE_PEEKNAMEDPIPE 0
-%define HAVE_PERL 1
-%define HAVE_POD2MAN 1
-%define HAVE_POLL_H 1
%define HAVE_POSIX_MEMALIGN 1
-%define HAVE_PRAGMA_DEPRECATED 1
%define HAVE_PTHREAD_CANCEL 1
-%define HAVE_RDTSC 0
-%define HAVE_RSYNC_CONTIMEOUT 1
-%define HAVE_SARESTART 1
%define HAVE_SCHED_GETAFFINITY 1
-%define HAVE_SDL 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
-%define HAVE_SNDIO_H 0
-%define HAVE_SOCKLEN_T 0
-%define HAVE_SOUNDCARD_H 0
%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 1
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 1
+%define HAVE_GNU_AS 1
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -256,32 +292,21 @@
%define HAVE_STRUCT_SOCKADDR_STORAGE 0
%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-%define HAVE_SYMVER_ASM_LABEL 0
-%define HAVE_SYMVER_GNU_ASM 1
-%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-%define HAVE_SYSCONF 1
-%define HAVE_SYSCTL 1
-%define HAVE_SYS_MMAN_H 1
-%define HAVE_SYS_PARAM_H 1
-%define HAVE_SYS_RESOURCE_H 1
-%define HAVE_SYS_SELECT_H 1
-%define HAVE_SYS_SOUNDCARD_H 1
-%define HAVE_SYS_TIME_H 1
-%define HAVE_SYS_UN_H 1
-%define HAVE_SYS_VIDEOIO_H 0
-%define HAVE_TERMIOS_H 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 0
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 1
%define HAVE_TEXI2HTML 0
%define HAVE_THREADS 1
-%define HAVE_UNISTD_H 1
-%define HAVE_USLEEP 1
%define HAVE_VDPAU_X11 0
-%define HAVE_VFP_ARGS 0
-%define HAVE_VIRTUALALLOC 0
-%define HAVE_WINDOWS_H 0
-%define HAVE_WINSOCK2_H 0
-%define HAVE_XFORM_ASM 0
-%define HAVE_XLIB 1
-%define HAVE_XMM_CLOBBERS 1
+%define HAVE_XLIB 0
%define CONFIG_BSFS 0
%define CONFIG_DECODERS 1
%define CONFIG_DEMUXERS 1
@@ -298,19 +323,23 @@
%define CONFIG_MANPAGES 1
%define CONFIG_PODPAGES 1
%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
%define CONFIG_METADATA_EXAMPLE 1
%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
%define CONFIG_SCALING_VIDEO_EXAMPLE 0
%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
%define CONFIG_AVISYNTH 0
%define CONFIG_BZLIB 0
%define CONFIG_CRYSTALHD 0
-%define CONFIG_FONTCONFIG 0
+%define CONFIG_DECKLINK 0
%define CONFIG_FREI0R 0
%define CONFIG_GNUTLS 0
%define CONFIG_ICONV 0
@@ -318,6 +347,7 @@
%define CONFIG_LIBAACPLUS 0
%define CONFIG_LIBASS 0
%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
%define CONFIG_LIBCACA 0
%define CONFIG_LIBCDIO 0
%define CONFIG_LIBCELT 0
@@ -325,6 +355,7 @@
%define CONFIG_LIBFAAC 0
%define CONFIG_LIBFDK_AAC 0
%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
%define CONFIG_LIBFREETYPE 0
%define CONFIG_LIBGME 0
%define CONFIG_LIBGSM 0
@@ -357,20 +388,38 @@
%define CONFIG_LIBVORBIS 0
%define CONFIG_LIBVPX 0
%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
%define CONFIG_LIBXAVS 0
%define CONFIG_LIBXVID 0
%define CONFIG_LIBZMQ 0
%define CONFIG_LIBZVBI 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
%define CONFIG_OPENSSL 0
%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 1
+%define CONFIG_SMALL 0
+%define CONFIG_SRAM 0
+%define CONFIG_STATIC 0
+%define CONFIG_SWSCALE_ALPHA 1
%define CONFIG_DXVA2 0
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
%define CONFIG_AVCODEC 1
%define CONFIG_AVDEVICE 0
%define CONFIG_AVFILTER 0
@@ -389,34 +438,25 @@
%define CONFIG_ERROR_RESILIENCE 0
%define CONFIG_FAST_UNALIGNED 1
%define CONFIG_FFT 1
-%define CONFIG_FTRAPV 0
-%define CONFIG_GPL 0
-%define CONFIG_GRAY 0
-%define CONFIG_HARDCODED_TABLES 0
-%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-%define CONFIG_INCOMPATIBLE_FORK_ABI 0
%define CONFIG_LSP 0
%define CONFIG_LZO 0
%define CONFIG_MDCT 1
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
%define CONFIG_MEMALIGN_HACK 0
%define CONFIG_MEMORY_POISONING 0
-%define CONFIG_NETWORK 0
-%define CONFIG_NONFREE 0
+%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 1
-%define CONFIG_RDFT 1
-%define CONFIG_RUNTIME_CPUDETECT 1
-%define CONFIG_SAFE_BITSTREAM_READER 1
-%define CONFIG_SHARED 1
-%define CONFIG_SMALL 0
-%define CONFIG_SRAM 0
-%define CONFIG_STATIC 1
-%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
-%define CONFIG_VERSION3 0
%define CONFIG_XMM_CLOBBER_TEST 0
%define CONFIG_AANDCTTABLES 0
%define CONFIG_AC3DSP 0
%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_CABAC 0
%define CONFIG_DSPUTIL 0
%define CONFIG_EXIF 0
%define CONFIG_FRAME_THREAD_ENCODER 0
@@ -430,7 +470,9 @@
%define CONFIG_H264QPEL 0
%define CONFIG_HPELDSP 1
%define CONFIG_HUFFMAN 0
+%define CONFIG_INTRAX8 0
%define CONFIG_LGPLV3 0
+%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
@@ -443,6 +485,7 @@
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
%define CONFIG_SINEWIN 0
+%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
%define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -459,6 +502,7 @@
%define CONFIG_TEXT2MOVSUB_BSF 0
%define CONFIG_AASC_DECODER 0
%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
%define CONFIG_AMV_DECODER 0
%define CONFIG_ANM_DECODER 0
%define CONFIG_ANSI_DECODER 0
@@ -509,6 +553,7 @@
%define CONFIG_EXR_DECODER 0
%define CONFIG_FFV1_DECODER 0
%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
%define CONFIG_FLASHSV_DECODER 0
%define CONFIG_FLASHSV2_DECODER 0
%define CONFIG_FLIC_DECODER 0
@@ -645,6 +690,7 @@
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
%define CONFIG_VP8_DECODER 1
%define CONFIG_VP9_DECODER 0
%define CONFIG_VQA_DECODER 0
@@ -672,6 +718,7 @@
%define CONFIG_AAC_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
%define CONFIG_ALAC_DECODER 0
%define CONFIG_ALS_DECODER 0
%define CONFIG_AMRNB_DECODER 0
@@ -679,11 +726,16 @@
%define CONFIG_APE_DECODER 0
%define CONFIG_ATRAC1_DECODER 0
%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
%define CONFIG_BINKAUDIO_DCT_DECODER 0
%define CONFIG_BINKAUDIO_RDFT_DECODER 0
%define CONFIG_BMV_AUDIO_DECODER 0
%define CONFIG_COOK_DECODER 0
%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
%define CONFIG_DSICINAUDIO_DECODER 0
%define CONFIG_EAC3_DECODER 0
%define CONFIG_EVRC_DECODER 0
@@ -712,6 +764,8 @@
%define CONFIG_MPC7_DECODER 0
%define CONFIG_MPC8_DECODER 0
%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
%define CONFIG_PAF_AUDIO_DECODER 0
%define CONFIG_QCELP_DECODER 0
%define CONFIG_QDM2_DECODER 0
@@ -803,6 +857,7 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
%define CONFIG_VIMA_DECODER 0
@@ -881,12 +936,14 @@
%define CONFIG_CAVSVIDEO_DEMUXER 0
%define CONFIG_CDG_DEMUXER 0
%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
%define CONFIG_CONCAT_DEMUXER 0
%define CONFIG_DATA_DEMUXER 0
%define CONFIG_DAUD_DEMUXER 0
%define CONFIG_DFA_DEMUXER 0
%define CONFIG_DIRAC_DEMUXER 0
%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
%define CONFIG_DSICIN_DEMUXER 0
%define CONFIG_DTS_DEMUXER 0
%define CONFIG_DTSHD_DEMUXER 0
@@ -923,6 +980,8 @@
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
%define CONFIG_INGENIENT_DEMUXER 0
%define CONFIG_IPMOVIE_DEMUXER 0
%define CONFIG_IRCAM_DEMUXER 0
@@ -942,6 +1001,7 @@
%define CONFIG_MICRODVD_DEMUXER 0
%define CONFIG_MJPEG_DEMUXER 0
%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
%define CONFIG_MM_DEMUXER 0
%define CONFIG_MMF_DEMUXER 0
%define CONFIG_MOV_DEMUXER 0
@@ -1009,6 +1069,7 @@
%define CONFIG_SAP_DEMUXER 0
%define CONFIG_SBG_DEMUXER 0
%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
%define CONFIG_SEGAFILM_DEMUXER 0
%define CONFIG_SHORTEN_DEMUXER 0
%define CONFIG_SIFF_DEMUXER 0
@@ -1060,6 +1121,7 @@
%define CONFIG_LIBQUVI_DEMUXER 0
%define CONFIG_A64MULTI_ENCODER 0
%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
%define CONFIG_AMV_ENCODER 0
%define CONFIG_ASV1_ENCODER 0
%define CONFIG_ASV2_ENCODER 0
@@ -1067,6 +1129,7 @@
%define CONFIG_AVUI_ENCODER 0
%define CONFIG_AYUV_ENCODER 0
%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
%define CONFIG_CLJR_ENCODER 0
%define CONFIG_COMFORTNOISE_ENCODER 0
%define CONFIG_DNXHD_ENCODER 0
@@ -1213,8 +1276,10 @@
%define CONFIG_LIBVPX_VP8_ENCODER 0
%define CONFIG_LIBVPX_VP9_ENCODER 0
%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
%define CONFIG_LIBXAVS_ENCODER 0
%define CONFIG_LIBXVID_ENCODER 0
%define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1251,6 +1316,7 @@
%define CONFIG_BANDREJECT_FILTER 0
%define CONFIG_BASS_FILTER 0
%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
%define CONFIG_CHANNELMAP_FILTER 0
%define CONFIG_CHANNELSPLIT_FILTER 0
%define CONFIG_COMPAND_FILTER 0
@@ -1290,6 +1356,7 @@
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
@@ -1304,6 +1371,7 @@
%define CONFIG_FIELDORDER_FILTER 0
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_GEQ_FILTER 0
@@ -1355,6 +1423,7 @@
%define CONFIG_SETSAR_FILTER 0
%define CONFIG_SETTB_FILTER 0
%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
@@ -1400,8 +1469,11 @@
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_VAAPI_HWACCEL 0
%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1414,16 +1486,19 @@
%define CONFIG_WMV3_VAAPI_HWACCEL 0
%define CONFIG_WMV3_VDPAU_HWACCEL 0
%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
%define CONFIG_BKTR_INDEV 0
%define CONFIG_DSHOW_INDEV 0
%define CONFIG_DV1394_INDEV 0
%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
%define CONFIG_IEC61883_INDEV 0
%define CONFIG_JACK_INDEV 0
%define CONFIG_LAVFI_INDEV 0
%define CONFIG_OPENAL_INDEV 0
%define CONFIG_OSS_INDEV 0
%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
%define CONFIG_SNDIO_INDEV 0
%define CONFIG_V4L2_INDEV 0
%define CONFIG_VFWCAP_INDEV 0
@@ -1470,6 +1545,7 @@
%define CONFIG_H263_MUXER 0
%define CONFIG_H264_MUXER 0
%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
%define CONFIG_HLS_MUXER 0
%define CONFIG_ICO_MUXER 0
%define CONFIG_ILBC_MUXER 0
@@ -1506,6 +1582,7 @@
%define CONFIG_MXF_D10_MUXER 0
%define CONFIG_NULL_MUXER 0
%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
%define CONFIG_OGG_MUXER 0
%define CONFIG_OMA_MUXER 0
%define CONFIG_OPUS_MUXER 0
@@ -1551,6 +1628,7 @@
%define CONFIG_TGP_MUXER 0
%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
%define CONFIG_VC1_MUXER 0
%define CONFIG_VC1T_MUXER 0
%define CONFIG_VOC_MUXER 0
@@ -1564,7 +1642,9 @@
%define CONFIG_LIBNUT_MUXER 0
%define CONFIG_ALSA_OUTDEV 0
%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
%define CONFIG_OSS_OUTDEV 0
%define CONFIG_PULSE_OUTDEV 0
%define CONFIG_SDL_OUTDEV 0
@@ -1596,6 +1676,7 @@
%define CONFIG_MPEG4VIDEO_PARSER 0
%define CONFIG_MPEGAUDIO_PARSER 0
%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
%define CONFIG_PNG_PARSER 0
%define CONFIG_PNM_PARSER 0
%define CONFIG_RV30_PARSER 0
@@ -1633,6 +1714,7 @@
%define CONFIG_RTP_PROTOCOL 0
%define CONFIG_SCTP_PROTOCOL 0
%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
%define CONFIG_TCP_PROTOCOL 0
%define CONFIG_TLS_PROTOCOL 0
%define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.h
index b32edeee8b7..0f7d447bb64 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.h
@@ -1,9 +1,9 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-avdevice --disable-avfilter --disable-bzlib --disable-doc --disable-ffprobe --disable-lzo --disable-network --disable-postproc --disable-swresample --disable-swscale --disable-zlib --enable-fft --enable-rdft --enable-shared --disable-iconv --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --optflags=-O2 --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='vp3,vorbis,vp8' --enable-pic --disable-error-resilience --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-shared --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-symver --disable-xlib --disable-zlib --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder='theora,vorbis,vp8' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vp3,vorbis,vp8' --optflags='\"-O2\"' --enable-pic --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
-#define CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
#define CC_IDENT "gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
@@ -40,15 +40,20 @@
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 1
+#define HAVE_LDBRX 1
+#define HAVE_PPC4XX 0
#define HAVE_AMD3DNOW 1
#define HAVE_AMD3DNOWEXT 1
#define HAVE_AVX 1
#define HAVE_AVX2 1
+#define HAVE_FMA3 1
#define HAVE_FMA4 1
-#define HAVE_I686 1
#define HAVE_MMX 1
#define HAVE_MMXEXT 1
#define HAVE_SSE 1
@@ -57,25 +62,31 @@
#define HAVE_SSE4 1
#define HAVE_SSE42 1
#define HAVE_SSSE3 1
-#define HAVE_ALTIVEC 0
-#define HAVE_PPC4XX 0
-#define HAVE_VIS 0
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
+#define HAVE_LOONGSON 1
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 1
#define HAVE_AMD3DNOWEXT_EXTERNAL 1
#define HAVE_AVX_EXTERNAL 1
#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
#define HAVE_FMA4_EXTERNAL 1
-#define HAVE_I686_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 1
#define HAVE_MMXEXT_EXTERNAL 1
#define HAVE_SSE_EXTERNAL 1
@@ -84,25 +95,31 @@
#define HAVE_SSE4_EXTERNAL 1
#define HAVE_SSE42_EXTERNAL 1
#define HAVE_SSSE3_EXTERNAL 1
-#define HAVE_ALTIVEC_EXTERNAL 0
-#define HAVE_PPC4XX_EXTERNAL 0
-#define HAVE_VIS_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_LOONGSON_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
#define HAVE_AMD3DNOW_INLINE 1
#define HAVE_AMD3DNOWEXT_INLINE 1
#define HAVE_AVX_INLINE 1
#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
#define HAVE_FMA4_INLINE 1
-#define HAVE_I686_INLINE 0
#define HAVE_MMX_INLINE 1
#define HAVE_MMXEXT_INLINE 1
#define HAVE_SSE_INLINE 1
@@ -111,26 +128,76 @@
#define HAVE_SSE4_INLINE 1
#define HAVE_SSE42_INLINE 1
#define HAVE_SSSE3_INLINE 1
-#define HAVE_ALTIVEC_INLINE 0
-#define HAVE_PPC4XX_INLINE 0
-#define HAVE_VIS_INLINE 0
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_LOONGSON_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 1
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
-#define HAVE_SYMVER 1
+#define HAVE_SYMVER 0
#define HAVE_YASM 1
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define HAVE_INCOMPATIBLE_FORK_ABI 0
-#define HAVE_PTHREADS 1
-#define HAVE_W32THREADS 0
-#define HAVE_OS2THREADS 0
-#define HAVE_ATOMICS_GCC 1
-#define HAVE_ATOMICS_SUNCC 0
-#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CL_CL_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DLFCN_H 1
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
@@ -158,42 +225,14 @@
#define HAVE_TRUNCF 1
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
-#define HAVE_ALIGNED_STACK 1
-#define HAVE_ALSA_ASOUNDLIB_H 0
-#define HAVE_ALTIVEC_H 0
-#define HAVE_ARPA_INET_H 0
-#define HAVE_ASM_MOD_Q 0
-#define HAVE_ASM_MOD_Y 0
-#define HAVE_ASM_TYPES_H 1
-#define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMICS_NATIVE 1
-#define HAVE_ATTRIBUTE_MAY_ALIAS 1
-#define HAVE_ATTRIBUTE_PACKED 1
-#define HAVE_CDIO_PARANOIA_H 0
-#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
-#define HAVE_CL_CL_H 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
-#define HAVE_CPUNOP 1
+#define HAVE_COTASKMEMFREE 0
#define HAVE_CRYPTGENRANDOM 0
-#define HAVE_DCBZL 0
-#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
-#define HAVE_DEV_IC_BT8XX_H 0
-#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
-#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
-#define HAVE_DIRECT_H 0
-#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
-#define HAVE_DOS_PATHS 0
-#define HAVE_DXVA_H 0
-#define HAVE_EBP_AVAILABLE 1
-#define HAVE_EBX_AVAILABLE 1
-#define HAVE_FAST_64BIT 1
-#define HAVE_FAST_CLZ 1
-#define HAVE_FAST_CMOV 1
#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
#define HAVE_FORK 1
#define HAVE_GETADDRINFO 0
#define HAVE_GETHRTIME 0
@@ -201,64 +240,61 @@
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
-#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
-#define HAVE_GNU_AS 1
-#define HAVE_GNU_WINDRES 0
-#define HAVE_GSM_H 0
-#define HAVE_IBM_ASM 0
-#define HAVE_INET_ATON 1
-#define HAVE_IO_H 0
-#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_INET_ATON 0
#define HAVE_ISATTY 1
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
-#define HAVE_LDBRX 0
-#define HAVE_LIBC_MSVCRT 0
-#define HAVE_LIBDC1394_1 0
-#define HAVE_LIBDC1394_2 0
-#define HAVE_LOCAL_ALIGNED_16 1
-#define HAVE_LOCAL_ALIGNED_8 1
#define HAVE_LOCALTIME_R 1
-#define HAVE_LOONGSON 0
#define HAVE_LZO1X_999_COMPRESS 0
-#define HAVE_MACHINE_IOCTL_BT848_H 0
-#define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MACHINE_RW_BARRIER 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MALLOC_H 1
+#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
-#define HAVE_MEMORYBARRIER 0
#define HAVE_MKSTEMP 1
-#define HAVE_MM_EMPTY 1
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
-#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
#define HAVE_PEEKNAMEDPIPE 0
-#define HAVE_PERL 1
-#define HAVE_POD2MAN 1
-#define HAVE_POLL_H 1
#define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_PTHREAD_CANCEL 1
-#define HAVE_RDTSC 0
-#define HAVE_RSYNC_CONTIMEOUT 1
-#define HAVE_SARESTART 1
#define HAVE_SCHED_GETAFFINITY 1
-#define HAVE_SDL 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
-#define HAVE_SNDIO_H 0
-#define HAVE_SOCKLEN_T 0
-#define HAVE_SOUNDCARD_H 0
#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 1
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
@@ -271,32 +307,21 @@
#define HAVE_STRUCT_SOCKADDR_STORAGE 0
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
-#define HAVE_SYMVER_ASM_LABEL 0
-#define HAVE_SYMVER_GNU_ASM 1
-#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
-#define HAVE_SYSCONF 1
-#define HAVE_SYSCTL 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SOUNDCARD_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_UN_H 1
-#define HAVE_SYS_VIDEOIO_H 0
-#define HAVE_TERMIOS_H 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 1
#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
-#define HAVE_UNISTD_H 1
-#define HAVE_USLEEP 1
#define HAVE_VDPAU_X11 0
-#define HAVE_VFP_ARGS 0
-#define HAVE_VIRTUALALLOC 0
-#define HAVE_WINDOWS_H 0
-#define HAVE_WINSOCK2_H 0
-#define HAVE_XFORM_ASM 0
-#define HAVE_XLIB 1
-#define HAVE_XMM_CLOBBERS 1
+#define HAVE_XLIB 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_DEMUXERS 1
@@ -313,19 +338,23 @@
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
#define CONFIG_METADATA_EXAMPLE 1
#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
#define CONFIG_SCALING_VIDEO_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_BZLIB 0
#define CONFIG_CRYSTALHD 0
-#define CONFIG_FONTCONFIG 0
+#define CONFIG_DECKLINK 0
#define CONFIG_FREI0R 0
#define CONFIG_GNUTLS 0
#define CONFIG_ICONV 0
@@ -333,6 +362,7 @@
#define CONFIG_LIBAACPLUS 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBCELT 0
@@ -340,6 +370,7 @@
#define CONFIG_LIBFAAC 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
@@ -372,20 +403,38 @@
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXVID 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 0
+#define CONFIG_SRAM 0
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_DXVA2 0
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
@@ -404,34 +453,25 @@
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_FFT 1
-#define CONFIG_FTRAPV 0
-#define CONFIG_GPL 0
-#define CONFIG_GRAY 0
-#define CONFIG_HARDCODED_TABLES 0
-#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
-#define CONFIG_INCOMPATIBLE_FORK_ABI 0
#define CONFIG_LSP 0
#define CONFIG_LZO 0
#define CONFIG_MDCT 1
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
#define CONFIG_MEMALIGN_HACK 0
#define CONFIG_MEMORY_POISONING 0
-#define CONFIG_NETWORK 0
-#define CONFIG_NONFREE 0
+#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 1
-#define CONFIG_RDFT 1
-#define CONFIG_RUNTIME_CPUDETECT 1
-#define CONFIG_SAFE_BITSTREAM_READER 1
-#define CONFIG_SHARED 1
-#define CONFIG_SMALL 0
-#define CONFIG_SRAM 0
-#define CONFIG_STATIC 1
-#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
-#define CONFIG_VERSION3 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_CABAC 0
#define CONFIG_DSPUTIL 0
#define CONFIG_EXIF 0
#define CONFIG_FRAME_THREAD_ENCODER 0
@@ -445,7 +485,9 @@
#define CONFIG_H264QPEL 0
#define CONFIG_HPELDSP 1
#define CONFIG_HUFFMAN 0
+#define CONFIG_INTRAX8 0
#define CONFIG_LGPLV3 0
+#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
@@ -458,6 +500,7 @@
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_SINEWIN 0
+#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
#define CONFIG_AAC_ADTSTOASC_BSF 0
@@ -474,6 +517,7 @@
#define CONFIG_TEXT2MOVSUB_BSF 0
#define CONFIG_AASC_DECODER 0
#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
#define CONFIG_AMV_DECODER 0
#define CONFIG_ANM_DECODER 0
#define CONFIG_ANSI_DECODER 0
@@ -524,6 +568,7 @@
#define CONFIG_EXR_DECODER 0
#define CONFIG_FFV1_DECODER 0
#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
#define CONFIG_FLASHSV_DECODER 0
#define CONFIG_FLASHSV2_DECODER 0
#define CONFIG_FLIC_DECODER 0
@@ -660,6 +705,7 @@
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
#define CONFIG_VP8_DECODER 1
#define CONFIG_VP9_DECODER 0
#define CONFIG_VQA_DECODER 0
@@ -687,6 +733,7 @@
#define CONFIG_AAC_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
#define CONFIG_ALAC_DECODER 0
#define CONFIG_ALS_DECODER 0
#define CONFIG_AMRNB_DECODER 0
@@ -694,11 +741,16 @@
#define CONFIG_APE_DECODER 0
#define CONFIG_ATRAC1_DECODER 0
#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
#define CONFIG_BINKAUDIO_DCT_DECODER 0
#define CONFIG_BINKAUDIO_RDFT_DECODER 0
#define CONFIG_BMV_AUDIO_DECODER 0
#define CONFIG_COOK_DECODER 0
#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
#define CONFIG_DSICINAUDIO_DECODER 0
#define CONFIG_EAC3_DECODER 0
#define CONFIG_EVRC_DECODER 0
@@ -727,6 +779,8 @@
#define CONFIG_MPC7_DECODER 0
#define CONFIG_MPC8_DECODER 0
#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
#define CONFIG_PAF_AUDIO_DECODER 0
#define CONFIG_QCELP_DECODER 0
#define CONFIG_QDM2_DECODER 0
@@ -818,6 +872,7 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
#define CONFIG_VIMA_DECODER 0
@@ -896,12 +951,14 @@
#define CONFIG_CAVSVIDEO_DEMUXER 0
#define CONFIG_CDG_DEMUXER 0
#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
#define CONFIG_CONCAT_DEMUXER 0
#define CONFIG_DATA_DEMUXER 0
#define CONFIG_DAUD_DEMUXER 0
#define CONFIG_DFA_DEMUXER 0
#define CONFIG_DIRAC_DEMUXER 0
#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
#define CONFIG_DSICIN_DEMUXER 0
#define CONFIG_DTS_DEMUXER 0
#define CONFIG_DTSHD_DEMUXER 0
@@ -938,6 +995,8 @@
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
#define CONFIG_INGENIENT_DEMUXER 0
#define CONFIG_IPMOVIE_DEMUXER 0
#define CONFIG_IRCAM_DEMUXER 0
@@ -957,6 +1016,7 @@
#define CONFIG_MICRODVD_DEMUXER 0
#define CONFIG_MJPEG_DEMUXER 0
#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
#define CONFIG_MM_DEMUXER 0
#define CONFIG_MMF_DEMUXER 0
#define CONFIG_MOV_DEMUXER 0
@@ -1024,6 +1084,7 @@
#define CONFIG_SAP_DEMUXER 0
#define CONFIG_SBG_DEMUXER 0
#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
#define CONFIG_SEGAFILM_DEMUXER 0
#define CONFIG_SHORTEN_DEMUXER 0
#define CONFIG_SIFF_DEMUXER 0
@@ -1075,6 +1136,7 @@
#define CONFIG_LIBQUVI_DEMUXER 0
#define CONFIG_A64MULTI_ENCODER 0
#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
#define CONFIG_AMV_ENCODER 0
#define CONFIG_ASV1_ENCODER 0
#define CONFIG_ASV2_ENCODER 0
@@ -1082,6 +1144,7 @@
#define CONFIG_AVUI_ENCODER 0
#define CONFIG_AYUV_ENCODER 0
#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
#define CONFIG_CLJR_ENCODER 0
#define CONFIG_COMFORTNOISE_ENCODER 0
#define CONFIG_DNXHD_ENCODER 0
@@ -1228,8 +1291,10 @@
#define CONFIG_LIBVPX_VP8_ENCODER 0
#define CONFIG_LIBVPX_VP9_ENCODER 0
#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
#define CONFIG_LIBXAVS_ENCODER 0
#define CONFIG_LIBXVID_ENCODER 0
#define CONFIG_LIBAACPLUS_ENCODER 0
@@ -1266,6 +1331,7 @@
#define CONFIG_BANDREJECT_FILTER 0
#define CONFIG_BASS_FILTER 0
#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
#define CONFIG_CHANNELMAP_FILTER 0
#define CONFIG_CHANNELSPLIT_FILTER 0
#define CONFIG_COMPAND_FILTER 0
@@ -1305,6 +1371,7 @@
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
@@ -1319,6 +1386,7 @@
#define CONFIG_FIELDORDER_FILTER 0
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_GEQ_FILTER 0
@@ -1370,6 +1438,7 @@
#define CONFIG_SETSAR_FILTER 0
#define CONFIG_SETTB_FILTER 0
#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
@@ -1415,8 +1484,11 @@
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_VAAPI_HWACCEL 0
#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
@@ -1429,16 +1501,19 @@
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DSHOW_INDEV 0
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
#define CONFIG_IEC61883_INDEV 0
#define CONFIG_JACK_INDEV 0
#define CONFIG_LAVFI_INDEV 0
#define CONFIG_OPENAL_INDEV 0
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
@@ -1485,6 +1560,7 @@
#define CONFIG_H263_MUXER 0
#define CONFIG_H264_MUXER 0
#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
#define CONFIG_HLS_MUXER 0
#define CONFIG_ICO_MUXER 0
#define CONFIG_ILBC_MUXER 0
@@ -1521,6 +1597,7 @@
#define CONFIG_MXF_D10_MUXER 0
#define CONFIG_NULL_MUXER 0
#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
#define CONFIG_OGG_MUXER 0
#define CONFIG_OMA_MUXER 0
#define CONFIG_OPUS_MUXER 0
@@ -1566,6 +1643,7 @@
#define CONFIG_TGP_MUXER 0
#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
#define CONFIG_VC1_MUXER 0
#define CONFIG_VC1T_MUXER 0
#define CONFIG_VOC_MUXER 0
@@ -1579,7 +1657,9 @@
#define CONFIG_LIBNUT_MUXER 0
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_PULSE_OUTDEV 0
#define CONFIG_SDL_OUTDEV 0
@@ -1611,6 +1691,7 @@
#define CONFIG_MPEG4VIDEO_PARSER 0
#define CONFIG_MPEGAUDIO_PARSER 0
#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
#define CONFIG_PNG_PARSER 0
#define CONFIG_PNM_PARSER 0
#define CONFIG_RV30_PARSER 0
@@ -1648,6 +1729,7 @@
#define CONFIG_RTP_PROTOCOL 0
#define CONFIG_SCTP_PROTOCOL 0
#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
#define CONFIG_TCP_PROTOCOL 0
#define CONFIG_TLS_PROTOCOL 0
#define CONFIG_UDP_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/libavutil/avconfig.h
index f6685b72c19..36a8cd14da6 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/libavutil/avconfig.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/libavutil/avconfig.h
@@ -4,5 +4,4 @@
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
-#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/ffmpegsumo.sigs b/chromium/third_party/ffmpeg/chromium/ffmpegsumo.sigs
index 33246ca775b..653b3e9ed34 100644
--- a/chromium/third_party/ffmpeg/chromium/ffmpegsumo.sigs
+++ b/chromium/third_party/ffmpeg/chromium/ffmpegsumo.sigs
@@ -1,10 +1,10 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
-#------------------------------------------------
-# Functions from avcodec used in chromium code.
-#------------------------------------------------
+//------------------------------------------------
+// Functions from avcodec used in chromium code.
+//------------------------------------------------
AVCodecContext *avcodec_alloc_context3(const AVCodec *codec);
AVCodec *avcodec_find_decoder(enum AVCodecID id);
int av_new_packet(AVPacket *pkt, int size);
@@ -12,6 +12,7 @@ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt);
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
int avcodec_close(AVCodecContext *avctx);
+const char *avcodec_get_name(enum AVCodecID id);
void av_free_packet(AVPacket *pkt);
void av_init_packet(AVPacket *pkt);
int av_dup_packet(AVPacket *pkt);
@@ -20,7 +21,6 @@ void av_register_bitstream_filter(AVBitStreamFilter *bsf);
AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe);
void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
-void av_destruct_packet(AVPacket *pkt);
int av_lockmgr_register(AVLockMgrOperation cb);
void avcodec_get_frame_defaults(AVFrame *pic);
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
@@ -30,16 +30,17 @@ void av_frame_unref(AVFrame *frame);
void av_frame_free(AVFrame **frame);
void avcodec_free_frame(AVFrame **frame);
AVFrame* av_frame_alloc();
+int av_packet_copy_props(AVPacket *dst, const AVPacket *src);
-# RDFT functions.
+// RDFT functions.
RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
void av_rdft_calc(RDFTContext *s, FFTSample *data);
void av_rdft_end(RDFTContext *s);
-#------------------------------------------------
-# Functions from avformat used in chromium code.
-#------------------------------------------------
+//------------------------------------------------
+// Functions from avformat used in chromium code.
+//------------------------------------------------
void avformat_close_input(AVFormatContext **s);
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options);
int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp, int flags);
@@ -53,9 +54,9 @@ AVIOContext *avio_alloc_context(unsigned char *buffer, int buffer_size, int writ
int avio_close(AVIOContext *s);
-#------------------------------------------------
-# Functions from avutil used in chromium code.
-#------------------------------------------------
+//------------------------------------------------
+// Functions from avutil used in chromium code.
+//------------------------------------------------
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq);
void *av_malloc(size_t size);
diff --git a/chromium/third_party/ffmpeg/chromium/patches/README b/chromium/third_party/ffmpeg/chromium/patches/README
index ffd45dd30f6..4c1a982ce9a 100644
--- a/chromium/third_party/ffmpeg/chromium/patches/README
+++ b/chromium/third_party/ffmpeg/chromium/patches/README
@@ -1,22 +1,10 @@
-Current Status as of Aug 22, 2013
-
+Current Status as of May 16, 2014
Upstream cherry-picks:
Current patches:
to_upstream/
-unblock_windows_build.patch
- wolenetz: MSVC fails to detect that abort() in av_assert0(0) occurs in
- all code paths in lavc/utils.c avcodec_default_reget_buffer(). This patch
- includes an explicit return AVERROR_BUG after the assert to unblock
- the build when MSVC is configured to treat all warnings as errors.
-
-w32pthreads_xp_fixes_and_vp8_workaround.patch
- dalecurtis: pthreads emulation incorrectly assumed Vista+. Additionally due
- to use of static variables in header file, duplicate initialization is needed.
- reported upstream which is working on a proper fix.
-
ugly/
01_enable_checked_bitstream.patch
@@ -33,17 +21,6 @@ ugly/
matroska_read_header(), resulting state should be same as prior to call; and
no double-free is expected to result from this either.)
-compile_with_no_iconv.patch
- wolenetz: When CONFIG_ICONV is 0, the original code path did not return a
- value, causing compile failure on Windows. It also aborted via an assert.
- This patch enables compiling by returning an appropriate error code and also
- removes the assert and abort.
-
-undeprecate_destruct_packet_api.patch
- wolenetz: Until upstream fully deprecates usage of FF_API_DESTRUCT_PACKET and
- we switch to using refcounted AVBuffer API, this patch is necessary.
- See http://crbug.com/236611
-
preserve_m27_avcodecids.patch
wolenetz: Insert a deprecated placeholder into AVCodecID enum such that
the resulting IDs are either new IDs since M27 or have same enumeration as
@@ -51,6 +28,7 @@ preserve_m27_avcodecids.patch
See https://ffmpeg.org/trac/ffmpeg/ticket/2575
See also http://crbug.com/241212
-disable_pix_fmt_desc_api.patch
- dalecurtis: Disable unused API to avoid deprecatation warnings. Remove once
- libavutil version > 52. \ No newline at end of file
+w32pthreads_xp_fixes_and_vp8_workaround.patch
+ dalecurtis: pthreads emulation incorrectly assumed Vista+. Additionally due
+ to use of static variables in header file, duplicate initialization is needed.
+ reported upstream which is working on a proper fix.
diff --git a/chromium/third_party/ffmpeg/chromium/patches/to_upstream/unblock_windows_build.patch b/chromium/third_party/ffmpeg/chromium/patches/to_upstream/unblock_windows_build.patch
deleted file mode 100644
index 27adbf8c887..00000000000
--- a/chromium/third_party/ffmpeg/chromium/patches/to_upstream/unblock_windows_build.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/libavcodec/utils.c b/libavcodec/utils.c
-index 92d3453..1aac0a4 100644
---- a/libavcodec/utils.c
-+++ b/libavcodec/utils.c
-@@ -884,6 +884,7 @@ void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
- int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic)
- {
- av_assert0(0);
-+ return AVERROR_BUG;
- }
- #endif
-
diff --git a/chromium/third_party/ffmpeg/chromium/patches/to_upstream/uninitcond_dct_token_vp3_dequant.patch b/chromium/third_party/ffmpeg/chromium/patches/to_upstream/uninitcond_dct_token_vp3_dequant.patch
deleted file mode 100644
index 38c73196419..00000000000
--- a/chromium/third_party/ffmpeg/chromium/patches/to_upstream/uninitcond_dct_token_vp3_dequant.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
-index 5bf2fee..ddfb49f 100644
---- a/libavcodec/vp3.c
-+++ b/libavcodec/vp3.c
-@@ -1635,7 +1635,7 @@ static av_cold int allocate_tables(AVCodecContext *avctx)
- s->superblock_coding = av_malloc(s->superblock_count);
- s->all_fragments = av_malloc(s->fragment_count * sizeof(Vp3Fragment));
- s->coded_fragment_list[0] = av_malloc(s->fragment_count * sizeof(int));
-- s->dct_tokens_base = av_malloc(64*s->fragment_count * sizeof(*s->dct_tokens_base));
-+ s->dct_tokens_base = av_mallocz(64*s->fragment_count * sizeof(*s->dct_tokens_base));
- s->motion_val[0] = av_malloc(y_fragment_count * sizeof(*s->motion_val[0]));
- s->motion_val[1] = av_malloc(c_fragment_count * sizeof(*s->motion_val[1]));
-
diff --git a/chromium/third_party/ffmpeg/chromium/patches/ugly/compile_with_no_iconv.patch b/chromium/third_party/ffmpeg/chromium/patches/ugly/compile_with_no_iconv.patch
deleted file mode 100644
index 8d126f25251..00000000000
--- a/chromium/third_party/ffmpeg/chromium/patches/ugly/compile_with_no_iconv.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/libavcodec/utils.c b/libavcodec/utils.c
-index e364b7e..adee2ea 100644
---- a/libavcodec/utils.c
-+++ b/libavcodec/utils.c
-@@ -1941,7 +1941,9 @@ end:
- iconv_close(cd);
- return ret;
- #else
-- av_assert0(!"requesting subtitles recoding without iconv");
-+ // ICONV is not on all platforms. Unblock compile by returning a
-+ // value. Assert with abort() is removed here, too.
-+ return AVERROR(EINVAL);
- #endif
- }
-
diff --git a/chromium/third_party/ffmpeg/chromium/patches/ugly/disable_pix_fmt_desc_api.patch b/chromium/third_party/ffmpeg/chromium/patches/ugly/disable_pix_fmt_desc_api.patch
deleted file mode 100644
index 5303fda0307..00000000000
--- a/chromium/third_party/ffmpeg/chromium/patches/ugly/disable_pix_fmt_desc_api.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From e3d88f59ad497312341559fb308f270e58266609 Mon Sep 17 00:00:00 2001
-From: Dale Curtis <dalecurtis@chromium.org>
-Date: Mon, 26 Aug 2013 17:47:59 -0700
-Subject: [PATCH] Disable unused PIX_FMT_DESC API to avoid deprecation
- warnings.
-
-Chrome doesn't use this API, so disable it until its removed in
-a later FFmpeg version.
----
- libavutil/version.h | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/libavutil/version.h b/libavutil/version.h
-index e522b79..4d02ea3 100644
---- a/libavutil/version.h
-+++ b/libavutil/version.h
-@@ -114,9 +114,11 @@
- #ifndef FF_API_CONTEXT_SIZE
- #define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 53)
- #endif
--#ifndef FF_API_PIX_FMT_DESC
--#define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 53)
--#endif
-+// TODO(dalecurtis): Remove when libavutil > 52. We don't care about this API,
-+// but without this it'll generate spammy deprecation warnings.
-+// #ifndef FF_API_PIX_FMT_DESC
-+// #define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 53)
-+// #endif
- #ifndef FF_API_AV_REVERSE
- #define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 53)
- #endif
---
-1.8.3
-
diff --git a/chromium/third_party/ffmpeg/chromium/patches/ugly/undeprecate_destruct_packet_api.patch b/chromium/third_party/ffmpeg/chromium/patches/ugly/undeprecate_destruct_packet_api.patch
deleted file mode 100644
index ac4aff452d4..00000000000
--- a/chromium/third_party/ffmpeg/chromium/patches/ugly/undeprecate_destruct_packet_api.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
-index e5b0c2b..8295f35 100644
---- a/libavcodec/avcodec.h
-+++ b/libavcodec/avcodec.h
-@@ -1072,9 +1072,11 @@ typedef struct AVPacket {
- */
- int duration;
- #if FF_API_DESTRUCT_PACKET
-- attribute_deprecated
-+ // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
-+ // attribute_deprecated
- void (*destruct)(struct AVPacket *);
-- attribute_deprecated
-+ // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
-+ // attribute_deprecated
- void *priv;
- #endif
- int64_t pos; ///< byte position in stream, -1 if unknown
-@@ -2006,7 +2008,8 @@ typedef struct AVCodecContext {
- *
- * @deprecated use get_buffer2()
- */
-- attribute_deprecated
-+ // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
-+ // attribute_deprecated
- int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
- /**
-@@ -2020,7 +2023,8 @@ typedef struct AVCodecContext {
- *
- * @deprecated custom freeing callbacks should be set from get_buffer2()
- */
-- attribute_deprecated
-+ // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
-+ // attribute_deprecated
- void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
- /**
-@@ -3389,7 +3393,8 @@ void avsubtitle_free(AVSubtitle *sub);
- * Default packet destructor.
- * @deprecated use the AVBuffer API instead
- */
--attribute_deprecated
-+// TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
-+// attribute_deprecated
- void av_destruct_packet(AVPacket *pkt);
- #endif
-
-diff --git a/libavutil/frame.h b/libavutil/frame.h
-index 39a664f..a24c299 100644
---- a/libavutil/frame.h
-+++ b/libavutil/frame.h
-@@ -144,7 +144,8 @@ typedef struct AVFrame {
- enum AVPictureType pict_type;
-
- #if FF_API_AVFRAME_LAVC
-- attribute_deprecated
-+ // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
-+ // attribute_deprecated
- uint8_t *base[AV_NUM_DATA_POINTERS];
- #endif
-
-@@ -254,7 +255,8 @@ typedef struct AVFrame {
- uint64_t error[AV_NUM_DATA_POINTERS];
-
- #if FF_API_AVFRAME_LAVC
-- attribute_deprecated
-+ // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
-+ // attribute_deprecated
- int type;
- #endif
-
diff --git a/chromium/third_party/ffmpeg/chromium/patches/to_upstream/w32pthreads_xp_fixes_and_vp8_workaround.patch b/chromium/third_party/ffmpeg/chromium/patches/ugly/w32pthreads_xp_fixes_and_vp8_workaround.patch
index dd61cd76277..dd61cd76277 100644
--- a/chromium/third_party/ffmpeg/chromium/patches/to_upstream/w32pthreads_xp_fixes_and_vp8_workaround.patch
+++ b/chromium/third_party/ffmpeg/chromium/patches/ugly/w32pthreads_xp_fixes_and_vp8_workaround.patch
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py b/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py
new file mode 100755
index 00000000000..86f1b935e27
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py
@@ -0,0 +1,462 @@
+#!/usr/bin/env python
+#
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from __future__ import print_function
+
+import collections
+import functools
+import multiprocessing
+import optparse
+import os
+import platform
+import re
+import shutil
+import subprocess
+import sys
+
+
+SCRIPTS_DIR = os.path.abspath(os.path.dirname(__file__))
+FFMPEG_DIR = os.path.abspath(os.path.join(SCRIPTS_DIR, '..', '..'))
+
+
+USAGE = """Usage: %prog TARGET_OS TARGET_ARCH [options] -- [configure_args]
+
+Valid combinations are linux [ia32|x64|mipsel|arm|arm-neon]
+ linux-noasm [ia32|x64]
+ mac [ia32|x64]
+ win [ia32|x64]
+
+Platform specific build notes:
+ linux ia32/x64:
+ Script can run on a normal Ubuntu box.
+
+ linux mipsel:
+ Script can run on a normal Ubuntu box with MIPS cross-toolchain in $PATH.
+
+ linux arm/arm-neon:
+ Script must be run inside of ChromeOS chroot with BOARD=arm-generic.
+
+ mac:
+ Script must be run on OSX. Additionally, ensure the Chromium (not Apple)
+ version of clang is in the path; usually found under
+ src/third_party/llvm-build/Release+Asserts/bin
+
+ win:
+ Script must be run on Windows with VS2013 or higher under Cygwin (or MinGW,
+ but as of 1.0.11, it has serious performance issues with make which makes
+ building take hours).
+
+ Additionall, ensure you have the correct toolchain environment for building.
+ The x86 toolchain environment is required for ia32 builds and the x64 one
+ for x64 builds. This can be verified by running "cl.exe" and checking if
+ the version string ends with "for x64" or "for x86."
+
+ Building on Windows also requires some additional Cygwin packages plus a
+ wrapper script for converting Cygwin paths to DOS paths.
+ - Add these packages at install time: diffutils, yasm, make, python.
+ - Copy chromium/scripts/cygwin-wrapper to /usr/local/bin
+
+Resulting binaries will be placed in:
+ build.TARGET_ARCH.TARGET_OS/Chromium/out/
+ build.TARGET_ARCH.TARGET_OS/Chrome/out/
+ build.TARGET_ARCH.TARGET_OS/ChromiumOS/out/
+ build.TARGET_ARCH.TARGET_OS/ChromeOS/out/"""
+
+
+def PrintAndCheckCall(argv, *args, **kwargs):
+ print('Running %r' % argv)
+ subprocess.check_call(argv, *args, **kwargs)
+
+
+def DetermineHostOsAndArch():
+ if platform.system() == 'Linux':
+ host_os = 'linux'
+ elif platform.system() == 'Darwin':
+ host_os = 'mac'
+ elif platform.system() == 'Windows' or platform.system() == 'CYGWIN_NT-6.1':
+ host_os = 'win'
+ else:
+ return None
+
+ if re.match(r'i.86', platform.machine()):
+ host_arch = 'ia32'
+ elif platform.machine() == 'x86_64' or platform.machine() == 'AMD64':
+ host_arch = 'x64'
+ elif platform.machine().startswith('arm'):
+ host_arch = 'arm'
+ else:
+ return None
+
+ return (host_os, host_arch)
+
+
+def GetDsoName(target_os, dso_name, dso_version):
+ if target_os == 'linux':
+ return 'lib%s.so.%s' % (dso_name, dso_version)
+ elif target_os == 'mac':
+ return 'lib%s.%s.dylib' % (dso_name, dso_version)
+ elif target_os == 'win':
+ return '%s-%s.dll' % (dso_name, dso_version)
+ else:
+ raise ValueError('Unexpected target_os %s' % target_os)
+
+
+def RewriteFile(path, search, replace):
+ with open(path) as f:
+ contents = f.read()
+ with open(path, 'w') as f:
+ f.write(re.sub(search, replace, contents))
+
+
+def BuildFFmpeg(target_os, target_arch, host_os, host_arch, parallel_jobs,
+ config_only, config, configure_flags):
+ print('%s configure/build:' % config)
+
+ config_dir = 'build.%s.%s/%s' % (target_arch, target_os, config)
+ shutil.rmtree(config_dir, ignore_errors=True)
+ os.makedirs(os.path.join(config_dir, 'out'))
+
+ PrintAndCheckCall(
+ [os.path.join(FFMPEG_DIR, 'configure')] + configure_flags, cwd=config_dir)
+
+ if (target_os, target_arch) == ('mac', 'ia32'):
+ # Required to get Mac ia32 builds compiling with -fno-omit-frame-pointer,
+ # which is required for accurate stack traces. See http://crbug.com/115170.
+ #
+ # Without this, building without -fomit-frame-pointer on ia32 will result in
+ # the the inclusion of a number of inline assembly blocks that use too many
+ # registers for its input/output operands.
+ for name in ('config.h', 'config.asm'):
+ RewriteFile(os.path.join(config_dir, name),
+ 'HAVE_EBP_AVAILABLE 1',
+ 'HAVE_EBP_AVAILABLE 0')
+
+ if host_os == target_os and not config_only:
+ libraries = [
+ os.path.join('libavcodec', GetDsoName(target_os, 'avcodec', 55)),
+ os.path.join('libavformat', GetDsoName(target_os, 'avformat', 55)),
+ os.path.join('libavutil', GetDsoName(target_os, 'avutil', 52)),
+ ]
+ PrintAndCheckCall(
+ ['make', '-j%d' % parallel_jobs] + libraries, cwd=config_dir)
+ for lib in libraries:
+ shutil.copy(os.path.join(config_dir, lib),
+ os.path.join(config_dir, 'out'))
+ elif config_only:
+ print('Skipping build step as requested.')
+ else:
+ print('Skipping compile as host configuration differs from target.\n'
+ 'Please compare the generated config.h with the previous version.\n'
+ 'You may also patch the script to properly cross-compile.\n'
+ 'Host OS : %s\n'
+ 'Target OS : %s\n'
+ 'Host arch : %s\n'
+ 'Target arch : %s\n' % (host_os, target_os, host_arch, target_arch))
+
+ if target_arch in ('arm', 'arm-neon'):
+ RewriteFile(
+ os.path.join(config_dir, 'config.h'),
+ r'(#define HAVE_VFP_ARGS [01])',
+ r'/* \1 -- Disabled to allow softfp/hardfp selection at gyp time */')
+
+
+def main(argv):
+ parser = optparse.OptionParser(usage=USAGE)
+ parser.add_option('--config-only', action='store_true',
+ help='Skip the build step. Useful when a given platform '
+ 'is not necessary for generate_gyp.py')
+ options, args = parser.parse_args(argv)
+
+ if len(args) < 2:
+ parser.print_help()
+ return 1
+
+ target_os = args[0]
+ target_arch = args[1]
+ configure_args = args[2:]
+
+ if target_os not in ('linux', 'linux-noasm', 'win', 'win-vs2013', 'mac'):
+ parser.print_help()
+ return 1
+
+ host_tuple = DetermineHostOsAndArch()
+ if not host_tuple:
+ print('Unrecognized host OS and architecture.', file=sys.stderr)
+ return 1
+
+ host_os, host_arch = host_tuple
+ parallel_jobs = multiprocessing.cpu_count()
+
+ print('System information:\n'
+ 'Host OS : %s\n'
+ 'Target OS : %s\n'
+ 'Host arch : %s\n'
+ 'Target arch : %s\n'
+ 'Parallel jobs : %d\n' % (
+ host_os, target_os, host_arch, target_arch, parallel_jobs))
+
+ configure_flags = collections.defaultdict(list)
+
+ # Common configuration. Note: --disable-everything does not in fact disable
+ # everything, just non-library components such as decoders and demuxers.
+ configure_flags['Common'].extend([
+ '--disable-everything',
+ '--disable-all',
+ '--disable-doc',
+ '--disable-static',
+ '--enable-avcodec',
+ '--enable-avformat',
+ '--enable-avutil',
+ '--enable-fft',
+ '--enable-rdft',
+ '--enable-shared',
+
+ # Disable features.
+ '--disable-bzlib',
+ '--disable-error-resilience',
+ '--disable-iconv',
+ '--disable-lzo',
+ '--disable-network',
+ '--disable-symver',
+ '--disable-xlib',
+ '--disable-zlib',
+
+ # Disable hardware decoding options which will sometimes turn on
+ # via autodetect.
+ '--disable-dxva2',
+ '--disable-vaapi',
+ '--disable-vda',
+ '--disable-vdpau',
+
+ # Common codecs.
+ '--enable-decoder=theora,vorbis,vp8',
+ '--enable-decoder=pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le',
+ '--enable-decoder=pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw',
+ '--enable-demuxer=ogg,matroska,wav',
+ '--enable-parser=opus,vp3,vorbis,vp8',
+ ])
+
+ # --optflags doesn't append multiple entries, so set all at once.
+ if (target_os, target_arch) == ('mac', 'ia32'):
+ configure_flags['Common'].append('--optflags="-fno-omit-frame-pointer -O2"')
+ else:
+ configure_flags['Common'].append('--optflags="-O2"')
+
+ # Linux only.
+ if target_os in ('linux', 'linux-noasm'):
+ if target_arch == 'x64':
+ pass
+ elif target_arch == 'ia32':
+ configure_flags['Common'].extend([
+ '--arch=i686',
+ '--enable-yasm',
+ '--extra-cflags="-m32"',
+ '--extra-ldflags="-m32"',
+ ])
+ elif target_arch == 'arm':
+ if host_arch != 'arm':
+ configure_flags['Common'].extend([
+ # This if-statement essentially is for chroot tegra2.
+ '--enable-cross-compile',
+
+ # Location is for CrOS chroot. If you want to use this, enter chroot
+ # and copy ffmpeg to a location that is reachable.
+ '--cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-',
+ '--target-os=linux',
+ '--arch=arm',
+ ])
+
+ # TODO(ihf): ARM compile flags are tricky. The final options
+ # overriding everything live in chroot /build/*/etc/make.conf
+ # (some of them coming from src/overlays/overlay-<BOARD>/make.conf).
+ # We try to follow these here closely. In particular we need to
+ # set ffmpeg internal #defines to conform to make.conf.
+ # TODO(ihf): For now it is not clear if thumb or arm settings would be
+ # faster. I ran experiments in other contexts and performance seemed
+ # to be close and compiler version dependent. In practice thumb builds are
+ # much smaller than optimized arm builds, hence we go with the global
+ # CrOS settings.
+ configure_flags['Common'].extend([
+ '--enable-armv6',
+ '--enable-armv6t2',
+ '--enable-vfp',
+ '--enable-thumb',
+ '--disable-neon',
+ '--extra-cflags=-march=armv7-a',
+ '--extra-cflags=-mtune=cortex-a8',
+ '--extra-cflags=-mfpu=vfpv3-d16',
+ # NOTE: softfp/hardfp selected at gyp time.
+ '--extra-cflags=-mfloat-abi=hard',
+ ])
+ elif target_arch == 'arm-neon':
+ if host_arch != 'arm':
+ # This if-statement is for chroot arm-generic.
+ configure_flags['Common'].extend([
+ '--enable-cross-compile',
+ '--cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-',
+ '--target-os=linux',
+ '--arch=arm',
+ ])
+ configure_flags['Common'].extend([
+ '--enable-armv6',
+ '--enable-armv6t2',
+ '--enable-vfp',
+ '--enable-thumb',
+ '--enable-neon',
+ '--extra-cflags=-march=armv7-a',
+ '--extra-cflags=-mtune=cortex-a8',
+ '--extra-cflags=-mfpu=neon',
+ # NOTE: softfp/hardfp selected at gyp time.
+ '--extra-cflags=-mfloat-abi=hard',
+ ])
+ elif target_arch == 'mipsel':
+ configure_flags['Common'].extend([
+ '--enable-cross-compile',
+ '--cross-prefix=mips-linux-gnu-',
+ '--target-os=linux',
+ '--arch=mips',
+ '--extra-cflags=-mips32',
+ '--extra-cflags=-EL',
+ '--extra-ldflags=-mips32',
+ '--extra-ldflags=-EL',
+ '--disable-mipsfpu',
+ '--disable-mipsdspr1',
+ '--disable-mipsdspr2',
+ ])
+ else:
+ print('Error: Unknown target arch %r for target OS %r!' % (
+ target_arch, target_os), file=sys.stderr)
+ return 1
+
+ if target_os == 'linux-noasm':
+ configure_flags['Common'].extend([
+ '--disable-asm',
+ '--disable-inline-asm',
+ ])
+
+ if 'win' not in target_os:
+ configure_flags['Common'].append('--enable-pic')
+
+ # Should be run on Mac.
+ if target_os == 'mac':
+ if host_os != 'mac':
+ print('Script should be run on a Mac host. If this is not possible\n'
+ 'try a merge of config files with new linux ia32 config.h\n'
+ 'by hand.\n', file=sys.stderr)
+ return 1
+
+ configure_flags['Common'].extend([
+ '--enable-yasm',
+ '--cc=clang',
+ '--cxx=clang++',
+ ])
+ if target_arch == 'ia32':
+ configure_flags['Common'].extend([
+ '--arch=i686',
+ '--extra-cflags=-m32',
+ '--extra-ldflags=-m32',
+ ])
+ elif target_arch == 'x64':
+ configure_flags['Common'].extend([
+ '--arch=x86_64',
+ '--extra-cflags=-m64',
+ '--extra-ldflags=-m64',
+ ])
+ else:
+ print('Error: Unknown target arch %r for target OS %r!' % (
+ target_arch, target_os), file=sys.stderr)
+
+ # Should be run on Windows.
+ if target_os == 'win':
+ if host_os != 'win':
+ print('Script should be run on a Windows host.\n', file=sys.stderr)
+ return 1
+
+ configure_flags['Common'].extend([
+ '--toolchain=msvc',
+ '--enable-yasm',
+ '--extra-cflags=-I' + os.path.join(FFMPEG_DIR, 'chromium/include/win'),
+ ])
+
+ if platform.system() == 'CYGWIN_NT-6.1':
+ configure_flags['Common'].extend([
+ '--cc=cygwin-wrapper cl',
+ '--ld=cygwin-wrapper link',
+ '--nm=cygwin-wrapper dumpbin -symbols',
+ '--ar=cygwin-wrapper lib',
+ ])
+
+ # Google Chrome & ChromeOS specific configuration.
+ configure_flags['Chrome'].extend([
+ '--enable-decoder=aac,h264,mp3',
+ '--enable-demuxer=aac,mp3,mov',
+ '--enable-parser=aac,h264,mpegaudio',
+ ])
+
+ # ChromiumOS specific configuration.
+ # Warning: do *NOT* add avi, aac, h264, mp3, mp4, amr*
+ # Flac support.
+ configure_flags['ChromiumOS'].extend([
+ '--enable-demuxer=flac',
+ '--enable-decoder=flac',
+ '--enable-parser=flac',
+ ])
+
+ # Google ChromeOS specific configuration.
+ # We want to make sure to play everything Android generates and plays.
+ # http://developer.android.com/guide/appendix/media-formats.html
+ configure_flags['ChromeOS'].extend([
+ # Enable playing avi files.
+ '--enable-decoder=mpeg4',
+ '--enable-parser=h263,mpeg4video',
+ '--enable-demuxer=avi',
+ # Enable playing Android 3gp files.
+ '--enable-demuxer=amr',
+ '--enable-decoder=amrnb,amrwb',
+ # Flac support.
+ '--enable-demuxer=flac',
+ '--enable-decoder=flac',
+ '--enable-parser=flac',
+ # Wav files for playing phone messages.
+ '--enable-decoder=gsm_ms',
+ '--enable-demuxer=gsm',
+ '--enable-parser=gsm',
+ ])
+
+ do_build_ffmpeg = functools.partial(
+ BuildFFmpeg, target_os, target_arch, host_os, host_arch, parallel_jobs,
+ options.config_only)
+ do_build_ffmpeg('Chromium',
+ configure_flags['Common'] +
+ configure_flags['Chromium'] +
+ configure_args)
+ do_build_ffmpeg('Chrome',
+ configure_flags['Common'] +
+ configure_flags['Chrome'] +
+ configure_args)
+
+ if target_os == 'linux':
+ do_build_ffmpeg('ChromiumOS',
+ configure_flags['Common'] +
+ configure_flags['Chromium'] +
+ configure_flags['ChromiumOS'] +
+ configure_args)
+
+ # ChromeOS enables MPEG4 which requires error resilience :(
+ chrome_os_flags = (configure_flags['Common'] +
+ configure_flags['Chrome'] +
+ configure_flags['ChromeOS'] +
+ configure_args)
+ chrome_os_flags.remove('--disable-error-resilience')
+ do_build_ffmpeg('ChromeOS', chrome_os_flags)
+
+ print('Done. If desired you may copy config.h/config.asm into the '
+ 'source/config tree using copy_config.sh.')
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.sh b/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.sh
deleted file mode 100755
index 92be63e43dc..00000000000
--- a/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.sh
+++ /dev/null
@@ -1,457 +0,0 @@
-#!/bin/bash -e
-
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Builds Chromium, Google Chrome and *OS FFmpeg binaries.
-#
-# For Windows it the script must be run from either a x64 or ia32 Visual Studio
-# environment (i.e., cl.exe, lib.exe and editbin.exe are in $PATH). Using the
-# x64 environment will build the x64 version and vice versa.
-#
-# For MIPS it assumes that cross-toolchain bin directory is in $PATH.
-#
-# Instructions for setting up a MinGW/MSYS shell can be found here:
-# http://src.chromium.org/viewvc/chrome/trunk/deps/third_party/mingw/README.chromium
-
-if [ "$3" = "" ]; then
- echo "Usage:"
- echo " $0 [TARGET_OS] [TARGET_ARCH] [path/to/ffmpeg] [config-only]"
- echo
- echo "Valid combinations are linux [ia32|x64|mipsel|arm|arm-neon]"
- echo " win [ia32|x64]"
- echo " win-vs2013 [ia32|x64]"
- echo " mac [ia32|x64]"
- echo
- echo " linux ia32/x64 - script can be run on a normal Ubuntu box."
- echo " linux mipsel - script can be run on a normal Ubuntu box with MIPS"
- echo " cross-toolchain in \$PATH."
- echo " linux arm/arm-neon should be run inside of CrOS chroot."
- echo " mac and win have to be run on Mac and Windows 7 (under mingw)."
- echo
- echo " mac - ensure the Chromium (not Apple) version of clang is in the path,"
- echo " usually found under src/third_party/llvm-build/Release+Asserts/bin"
- echo
- echo "Specifying 'config-only' will skip the build step. Useful when a"
- echo "given platform is not necessary for generate_gyp.py."
- echo
- echo "The path should be absolute and point at Chromium's copy of FFmpeg."
- echo "This corresponds to:"
- echo " chrome/trunk/deps/third_party/ffmpeg"
- echo
- echo "Resulting binaries will be placed in:"
- echo " build.TARGET_ARCH.TARGET_OS/Chromium/out/"
- echo " build.TARGET_ARCH.TARGET_OS/Chrome/out/"
- echo " build.TARGET_ARCH.TARGET_OS/ChromiumOS/out/"
- echo " build.TARGET_ARCH.TARGET_OS/ChromeOS/out/"
- exit 1
-fi
-
-TARGET_OS=$1
-TARGET_ARCH=$2
-FFMPEG_PATH=$3
-CONFIG_ONLY=$4
-
-# Check TARGET_OS (TARGET_ARCH is checked during configuration).
-if [[ "$TARGET_OS" != "linux" &&
- "$TARGET_OS" != "mac" &&
- "$TARGET_OS" != "win" &&
- "$TARGET_OS" != "win-vs2013" ]]; then
- echo "Valid target OSes are: linux, mac, win, win-vs2013"
- exit 1
-fi
-
-# Check FFMPEG_PATH to contain this script.
-if [ ! -f "$FFMPEG_PATH/chromium/scripts/$(basename $0)" ]; then
- echo "$FFMPEG_PATH doesn't appear to contain FFmpeg"
- exit 1
-fi
-
-# If configure & make works but this script doesn't, make sure to grep for
-# these.
-LIBAVCODEC_VERSION_MAJOR=55
-LIBAVFORMAT_VERSION_MAJOR=55
-LIBAVUTIL_VERSION_MAJOR=52
-
-case $(uname -sm) in
- Linux\ i386)
- HOST_OS=linux
- HOST_ARCH=ia32
- JOBS=$(grep processor /proc/cpuinfo | wc -l)
- ;;
- Linux\ x86_64)
- HOST_OS=linux
- HOST_ARCH=x64
- JOBS=$(grep processor /proc/cpuinfo | wc -l)
- ;;
- Darwin\ i386)
- HOST_OS=mac
- HOST_ARCH=ia32
- JOBS=$(sysctl -n hw.ncpu)
- ;;
- Darwin\ x86_64)
- HOST_OS=mac
- HOST_ARCH=x64
- JOBS=$(sysctl -n hw.ncpu)
- ;;
- MINGW*)
- HOST_OS=win
- HOST_ARCH=ia32
- JOBS=$NUMBER_OF_PROCESSORS
- ;;
- *)
- echo "Unrecognized HOST_OS: $(uname)"
- echo "Patches welcome!"
- exit 1
- ;;
-esac
-
-# Print out system information.
-echo "System information:"
-echo "HOST_OS = $HOST_OS"
-echo "TARGET_OS = $TARGET_OS"
-echo "HOST_ARCH = $HOST_ARCH"
-echo "TARGET_ARCH = $TARGET_ARCH"
-echo "JOBS = $JOBS"
-echo "LD = $(ld --version | head -n1)"
-echo
-
-# As of this writing gold 2.20.1-system.20100303 is unable to link FFmpeg.
-if ld --version | grep -q gold; then
- echo "gold is unable to link FFmpeg"
- echo
- echo "Switch /usr/bin/ld to the regular binutils ld and try again"
- exit 1
-fi
-
-# We want to use a sufficiently recent version of yasm on Windows.
-if [[ "$TARGET_OS" == "win" || "$TARGET_OS" == "win-vs2013" ]]; then
- if !(which yasm 2>&1 > /dev/null); then
- echo "Could not find yasm in \$PATH"
- exit 1
- fi
-
- if (yasm --version | head -1 | grep -q "^yasm 0\."); then
- echo "Must have yasm 1.0 or higher installed"
- exit 1
- fi
-fi
-
-# Returns the Dynamic Shared Object name given the module name and version.
-function dso_name { dso_name_${TARGET_OS} $1 $2; }
-function dso_name_win { echo "${1}-${2}.dll"; }
-function dso_name_linux { echo "lib${1}.so.${2}"; }
-function dso_name_mac { echo "lib${1}.${2}.dylib"; }
-
-# Appends configure flags.
-FLAGS_COMMON=
-FLAGS_CHROMIUM=
-FLAGS_CHROME=
-FLAGS_CHROMIUMOS=
-FLAGS_CHROMEOS=
-
-# Flags that are used in all of Chrome/Chromium + OS.
-function add_flag_common {
- FLAGS_COMMON="$FLAGS_COMMON $*"
-}
-# Flags that are used in Chromium and ChromiumOS.
-function add_flag_chromium {
- FLAGS_CHROMIUM="$FLAGS_CHROMIUM $*"
-}
-# Flags that are used in Chrome and ChromeOS.
-function add_flag_chrome {
- FLAGS_CHROME="$FLAGS_CHROME $*"
-}
-# Flags that are used only in ChromiumOS (but not Chromium).
-function add_flag_chromiumos {
- FLAGS_CHROMIUMOS="$FLAGS_CHROMIUMOS $*"
-}
-# Flags that are used only in ChromeOS (but not Chrome).
-function add_flag_chromeos {
- FLAGS_CHROMEOS="$FLAGS_CHROMEOS $*"
-}
-
-# Builds using $1 as the output directory and all following arguments as
-# configure script arguments.
-function build {
- CONFIG=$1
- CONFIG_DIR="build.$TARGET_ARCH.$TARGET_OS/$CONFIG"
- shift
-
- # Create our working directory.
- echo "Creating build directory..."
- rm -rf $CONFIG_DIR
- mkdir -p $CONFIG_DIR
- pushd $CONFIG_DIR
- mkdir out
-
- # Configure and check for exit status.
- echo "Configuring $CONFIG..."
- CMD="$FFMPEG_PATH/configure $*"
- echo $CMD
- eval $CMD
-
- if [ ! -f config.h ]; then
- echo "Configure failed!"
- exit 1
- fi
-
- if [ $TARGET_OS = "mac" ]; then
- # Required to get Mac ia32 builds compiling with -fno-omit-frame-pointer,
- # which is required for accurate stack traces. See http://crbug.com/115170.
- if [ $TARGET_ARCH = "ia32" ]; then
- echo "Forcing HAVE_EBP_AVAILABLE to 0 in config.h and config.asm"
- $FFMPEG_PATH/chromium/scripts/munge_config_optimizations.sh config.h
- $FFMPEG_PATH/chromium/scripts/munge_config_optimizations.sh config.asm
- fi
- fi
-
- if [[ "$HOST_OS" = "$TARGET_OS" && "$CONFIG_ONLY" = "" ]]; then
- # Build!
- LIBS="libavcodec/$(dso_name avcodec $LIBAVCODEC_VERSION_MAJOR)"
- LIBS="libavformat/$(dso_name avformat $LIBAVFORMAT_VERSION_MAJOR) $LIBS"
- LIBS="libavutil/$(dso_name avutil $LIBAVUTIL_VERSION_MAJOR) $LIBS"
- for lib in $LIBS; do
- echo "Building $lib for $CONFIG..."
- echo "make -j$JOBS $lib"
- make -j$JOBS $lib
- if [ -f $lib ]; then
- cp $lib out
- else
- echo "Build failed!"
- exit 1
- fi
- done
- elif [ ! "$CONFIG_ONLY" = "" ]; then
- echo "Skipping build step as requested."
- else
- echo "Skipping compile as host configuration differs from target."
- echo "Please compare the generated config.h with the previous version."
- echo "You may also patch the script to properly cross-compile."
- echo "host OS = $HOST_OS"
- echo "target OS = $TARGET_OS"
- echo "host ARCH= $HOST_ARCH"
- echo "target ARCH= $TARGET_ARCH"
- fi
-
- if [ "$TARGET_ARCH" = "arm" -o "$TARGET_ARCH" = "arm-neon" ]; then
- sed -i 's/^\(#define HAVE_VFP_ARGS [01]\)$/\/* \1 -- Disabled to allow softfp\/hardfp selection at gyp time *\//' config.h
- fi
-
- popd
-}
-
-# Common configuration. Note: --disable-everything does not in fact disable
-# everything, just non-library components such as decoders and demuxers.
-add_flag_common --disable-everything
-add_flag_common --disable-avdevice
-add_flag_common --disable-avfilter
-add_flag_common --disable-bzlib
-add_flag_common --disable-doc
-add_flag_common --disable-ffprobe
-add_flag_common --disable-lzo
-add_flag_common --disable-network
-add_flag_common --disable-postproc
-add_flag_common --disable-swresample
-add_flag_common --disable-swscale
-add_flag_common --disable-zlib
-add_flag_common --enable-fft
-add_flag_common --enable-rdft
-add_flag_common --enable-shared
-add_flag_common --disable-iconv
-
-# Disable hardware decoding options which will sometimes turn on via autodetect.
-add_flag_common --disable-dxva2
-add_flag_common --disable-vaapi
-add_flag_common --disable-vda
-add_flag_common --disable-vdpau
-
-# --optflags doesn't append multiple entries, so set all at once.
-if [[ "$TARGET_OS" = "mac" && "$TARGET_ARCH" = "ia32" ]]; then
- add_flag_common --optflags="\"-fno-omit-frame-pointer -O2\""
-else
- add_flag_common --optflags=-O2
-fi
-
-# Common codecs.
-add_flag_common --enable-decoder=theora,vorbis,vp8
-add_flag_common --enable-decoder=pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le
-add_flag_common --enable-decoder=pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw
-add_flag_common --enable-demuxer=ogg,matroska,wav
-add_flag_common --enable-parser=vp3,vorbis,vp8
-
-# Linux only.
-if [ "$TARGET_OS" = "linux" ]; then
- if [ "$TARGET_ARCH" = "x64" ]; then
- # Nothing to add for now.
- add_flag_common ""
- elif [ "$TARGET_ARCH" = "ia32" ]; then
- add_flag_common --arch=i686
- add_flag_common --enable-yasm
- add_flag_common --extra-cflags=-m32
- add_flag_common --extra-ldflags=-m32
- elif [ "$TARGET_ARCH" = "arm" ]; then
- # This if-statement essentially is for chroot tegra2.
- add_flag_common --enable-cross-compile
-
- # Location is for CrOS chroot. If you want to use this, enter chroot
- # and copy ffmpeg to a location that is reachable.
- add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-
- add_flag_common --target-os=linux
- add_flag_common --arch=arm
-
- # TODO(ihf): ARM compile flags are tricky. The final options
- # overriding everything live in chroot /build/*/etc/make.conf
- # (some of them coming from src/overlays/overlay-<BOARD>/make.conf).
- # We try to follow these here closely. In particular we need to
- # set ffmpeg internal #defines to conform to make.conf.
- # TODO(ihf): For now it is not clear if thumb or arm settings would be
- # faster. I ran experiments in other contexts and performance seemed
- # to be close and compiler version dependent. In practice thumb builds are
- # much smaller than optimized arm builds, hence we go with the global
- # CrOS settings.
- add_flag_common --enable-armv6
- add_flag_common --enable-armv6t2
- add_flag_common --enable-vfp
- add_flag_common --enable-thumb
- add_flag_common --disable-neon
- add_flag_common --extra-cflags=-march=armv7-a
- add_flag_common --extra-cflags=-mtune=cortex-a8
- add_flag_common --extra-cflags=-mfpu=vfpv3-d16
- # NOTE: softfp/hardfp selected at gyp time.
- add_flag_common --extra-cflags=-mfloat-abi=hard
- elif [ "$TARGET_ARCH" = "arm-neon" ]; then
- # This if-statement is for chroot arm-generic.
- add_flag_common --enable-cross-compile
- add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-
- add_flag_common --target-os=linux
- add_flag_common --arch=arm
- add_flag_common --enable-armv6
- add_flag_common --enable-armv6t2
- add_flag_common --enable-vfp
- add_flag_common --enable-thumb
- add_flag_common --enable-neon
- add_flag_common --extra-cflags=-march=armv7-a
- add_flag_common --extra-cflags=-mtune=cortex-a8
- add_flag_common --extra-cflags=-mfpu=neon
- # NOTE: softfp/hardfp selected at gyp time.
- add_flag_common --extra-cflags=-mfloat-abi=hard
- elif [ "$TARGET_ARCH" = "mipsel" ]; then
- add_flag_common --enable-cross-compile
- add_flag_common --cross-prefix=mips-linux-gnu-
- add_flag_common --target-os=linux
- add_flag_common --arch=mips
- add_flag_common --extra-cflags=-mips32
- add_flag_common --extra-cflags=-EL
- add_flag_common --extra-ldflags=-mips32
- add_flag_common --extra-ldflags=-EL
- add_flag_common --disable-mipsfpu
- add_flag_common --disable-mipsdspr1
- add_flag_common --disable-mipsdspr2
- else
- echo "Error: Unknown TARGET_ARCH=$TARGET_ARCH for TARGET_OS=$TARGET_OS!"
- exit 1
- fi
-fi
-
-# Should be run on Windows.
-if [ "$TARGET_OS" = "win" ]; then
- if [ "$HOST_OS" = "win" ]; then
- add_flag_common --toolchain=msvc
- add_flag_common --enable-yasm
- add_flag_common --extra-cflags=-I$FFMPEG_PATH/chromium/include/win
- else
- echo "Script should be run on Windows host. If this is not possible try a "
- echo "merge of config files with new linux ia32 config.h by hand."
- exit 1
- fi
-elif [ "$TARGET_OS" = "win-vs2013" ]; then
- if [ "$HOST_OS" = "win" ]; then
- add_flag_common --toolchain=msvc2013
- add_flag_common --enable-yasm
- add_flag_common --extra-cflags=-I$FFMPEG_PATH/chromium/include/win
- else
- echo "Script should be run on Windows host. If this is not possible try a "
- echo "merge of config files with new linux ia32 config.h by hand."
- exit 1
- fi
-else
- add_flag_common --enable-pic
-fi
-
-# Should be run on Mac.
-if [ "$TARGET_OS" = "mac" ]; then
- if [ "$HOST_OS" = "mac" ]; then
- add_flag_common --enable-yasm
- add_flag_common --cc=clang
- add_flag_common --cxx=clang++
- if [ "$TARGET_ARCH" = "ia32" ]; then
- add_flag_common --arch=i686
- add_flag_common --extra-cflags=-m32
- add_flag_common --extra-ldflags=-m32
- elif [ "$TARGET_ARCH" = "x64" ]; then
- add_flag_common --arch=x86_64
- add_flag_common --extra-cflags=-m64
- add_flag_common --extra-ldflags=-m64
- else
- echo "Error: Unknown TARGET_ARCH=$TARGET_ARCH for TARGET_OS=$TARGET_OS!"
- exit 1
- fi
- else
- echo "Script should be run on a Mac host. If this is not possible try a "
- echo "merge of config files with new linux ia32 config.h by hand."
- exit 1
- fi
-fi
-
-# Chromium & ChromiumOS specific configuration.
-# Though CONFIG_ERROR_RESILIENCE should already be disabled for Chromium[OS],
-# forcing disable here to help ensure it remains this way.
-add_flag_chromium --disable-error-resilience
-
-# Google Chrome & ChromeOS specific configuration.
-add_flag_chrome --enable-decoder=aac,h264,mp3
-add_flag_chrome --enable-demuxer=mp3,mov
-add_flag_chrome --enable-parser=aac,h264,mpegaudio
-
-# ChromiumOS specific configuration.
-# Warning: do *NOT* add avi, aac, h264, mp3, mp4, amr*
-# Flac support.
-add_flag_chromiumos --enable-demuxer=flac
-add_flag_chromiumos --enable-decoder=flac
-add_flag_chromiumos --enable-parser=flac
-
-# Google ChromeOS specific configuration.
-# We want to make sure to play everything Android generates and plays.
-# http://developer.android.com/guide/appendix/media-formats.html
-# Enable playing avi files.
-add_flag_chromeos --enable-decoder=mpeg4
-add_flag_chromeos --enable-parser=h263,mpeg4video
-add_flag_chromeos --enable-demuxer=avi
-# Enable playing Android 3gp files.
-add_flag_chromeos --enable-demuxer=amr
-add_flag_chromeos --enable-decoder=amrnb,amrwb
-# Flac support.
-add_flag_chromeos --enable-demuxer=flac
-add_flag_chromeos --enable-decoder=flac
-add_flag_chromeos --enable-parser=flac
-# Wav files for playing phone messages.
-add_flag_chromeos --enable-decoder=gsm_ms
-add_flag_chromeos --enable-demuxer=gsm
-add_flag_chromeos --enable-parser=gsm
-
-echo "Chromium configure/build:"
-build Chromium $FLAGS_COMMON $FLAGS_CHROMIUM
-echo "Chrome configure/build:"
-build Chrome $FLAGS_COMMON $FLAGS_CHROME
-
-if [ "$TARGET_OS" = "linux" ]; then
- echo "ChromiumOS configure/build:"
- build ChromiumOS $FLAGS_COMMON $FLAGS_CHROMIUM $FLAGS_CHROMIUMOS
- echo "ChromeOS configure/build:"
- build ChromeOS $FLAGS_COMMON $FLAGS_CHROME $FLAGS_CHROMEOS
-fi
-
-echo "Done. If desired you may copy config.h/config.asm into the" \
- "source/config tree using copy_config.sh."
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/c99conv.py b/chromium/third_party/ffmpeg/chromium/scripts/c99conv.py
deleted file mode 100755
index aa4b77125f6..00000000000
--- a/chromium/third_party/ffmpeg/chromium/scripts/c99conv.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import re
-import sys
-import subprocess
-
-
-# Path to root FFmpeg directory. Used as the CWD for executing all commands.
-FFMPEG_ROOT = os.path.abspath(os.path.join(
- os.path.dirname(__file__), '..', '..'))
-
-# Path to the C99 to C89 converter.
-CONVERTER_EXECUTABLE = os.path.abspath(os.path.join(
- FFMPEG_ROOT, 'chromium', 'binaries', 'c99conv.exe'))
-
-# $CC to use. We use to support GOMA, but by switching to stdout preprocessing
-# its twice as fast to just preprocess locally (compilation may still be GOMA).
-DEFAULT_CC = 'cl.exe'
-
-# Disable spammy warning related to av_restrict, upstream needs to fix.
-DISABLED_WARNINGS = ['-wd4005']
-
-
-def main():
- if len(sys.argv) < 3:
- print 'C99 to C89 Converter Wrapper'
- print ' usage: c99conv.py <input file> <output file> [-I <include> ...]'
- sys.exit(1)
-
- input_file = os.path.abspath(sys.argv[1])
- # Keep the preprocessed output file in the same directory so GOMA will work
- # without complaining about unknown paths.
- preprocessed_output_file = input_file + '_preprocessed.c'
- output_file = os.path.abspath(sys.argv[2])
-
- # Run the preprocessor command. All of these settings are pulled from the
- # CFLAGS section of the "config.mak" created after running build_ffmpeg.sh.
- #
- # cl.exe is extremely inefficient (upwards of 30k writes) when asked to
- # preprocess to file (-P) so instead ask for output to go to stdout (-E) and
- # write it out ourselves afterward. See http://crbug.com/172368.
- p = subprocess.Popen(
- [DEFAULT_CC, '-E', '-nologo', '-DCOMPILING_avcodec=1',
- '-DCOMPILING_avutil=1', '-DCOMPILING_avformat=1', '-D_USE_MATH_DEFINES',
- '-Dinline=__inline', '-Dstrtoll=_strtoi64', '-U__STRICT_ANSI__',
- '-D_ISOC99_SOURCE', '-D_LARGEFILE_SOURCE', '-DHAVE_AV_CONFIG_H',
- '-Dstrtod=avpriv_strtod', '-Dsnprintf=avpriv_snprintf',
- '-D_snprintf=avpriv_snprintf', '-Dvsnprintf=avpriv_vsnprintf',
- '-FIstdlib.h'] +
- sys.argv[3:] +
- DISABLED_WARNINGS +
- ['-I', '.', '-I', FFMPEG_ROOT, '-I', 'chromium/config',
- '-I', 'chromium/include/win', input_file],
- cwd=FFMPEG_ROOT, stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
- # universal_newlines ensures whitespace is correct for #line directives.
- universal_newlines=True)
- stdout, stderr = p.communicate()
-
- # Abort if any error occurred.
- if p.returncode != 0:
- print stdout, stderr
- if os.path.isfile(preprocessed_output_file):
- os.unlink(preprocessed_output_file)
- sys.exit(p.returncode)
-
- with open(preprocessed_output_file, 'w') as f:
- # Write out stdout but skip the filename print out that MSVC forces for
- # every cl.exe execution as well as ridiculous amounts of white space; saves
- # ~64mb of output over the entire conversion! Care must be taken while
- # trimming whitespace to keep #line directives accurate or stack traces will
- # be inaccurate.
- f.write(re.sub('\s+\n(#line|#pragma)', r'\n\1',
- stdout[len(os.path.basename(input_file)):]))
-
- # Run the converter command. Note: the input file must have a '.c' extension
- # or the converter will crash. libclang does some funky detection based on
- # the file extension.
- p = subprocess.Popen(
- [CONVERTER_EXECUTABLE, preprocessed_output_file, output_file],
- cwd=FFMPEG_ROOT)
- p.wait()
- os.unlink(preprocessed_output_file)
- sys.exit(p.returncode)
-
-
-if __name__ == '__main__':
- main()
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/copy_config.sh b/chromium/third_party/ffmpeg/chromium/scripts/copy_config.sh
index c41490fe3a5..7de102ec595 100755
--- a/chromium/third_party/ffmpeg/chromium/scripts/copy_config.sh
+++ b/chromium/third_party/ffmpeg/chromium/scripts/copy_config.sh
@@ -5,7 +5,7 @@
# found in the LICENSE file.
# Use this to copy all config files into the tree.
-for os in linux mac win win-vs2013; do
+for os in linux linux-noasm mac win win-vs2013; do
for target in Chromium ChromiumOS Chrome ChromeOS; do
# Copy config files for various architectures:
# - ia32/x64 have config.asm, config.h
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/cygwin-wrapper b/chromium/third_party/ffmpeg/chromium/scripts/cygwin-wrapper
new file mode 100755
index 00000000000..895859ac3a1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/scripts/cygwin-wrapper
@@ -0,0 +1,84 @@
+#!/bin/sh
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#
+# Stupid wrapper to avoid win32 dospath/cygdrive issues
+# Try not to spawn programs from within this file. If the stuff in here looks royally
+# confusing, see bug: http://bugzilla.mozilla.org/show_bug.cgi?id=206643
+# and look at the older versions of this file that are easier to read, but
+# do basically the same thing
+#
+
+#
+# Taken directly from:
+# http://dxr.mozilla.org/mozilla-central/source/nsprpub/build/cygwin-wrapper
+#
+
+prog=$1
+shift
+if test -z "$prog"; then
+ exit 0
+fi
+
+# If $CYGDRIVE_MOUNT was not set in configure, give $mountpoint the results of mount -p
+mountpoint=$CYGDRIVE_MOUNT
+if test -z "$mountpoint"; then
+ mountpoint=`mount -p`
+ if test -z "$mountpoint"; then
+ print "Cannot determine cygwin mount points. Exiting"
+ exit 1
+ fi
+fi
+
+# Delete everything but "/cygdrive" (or other mountpoint) from mount=`mount -p`
+mountpoint=${mountpoint#*/}
+mountpoint=/${mountpoint%%[!A-Za-z0-9_]*}
+mountpoint=${mountpoint%/}
+
+args=""
+up=""
+if test "${prog}" = "-up"; then
+ up=1
+ prog=${1}
+ shift
+fi
+
+process=1
+
+# Convert the mountpoint in parameters to Win32 filenames
+# For instance: /cygdrive/c/foo -&gt; c:/foo
+for i in "${@}"
+do
+ if test "${i}" = "-wrap"; then
+ process=1
+ else
+ if test "${i}" = "-nowrap"; then
+ process=
+ else
+ if test -n "${process}"; then
+ if test -n "${up}"; then
+ pathname=${i#-I[a-zA-Z]:/}
+ if ! test "${pathname}" = "${i}"; then
+ no_i=${i#-I}
+ driveletter=${no_i%%:*}
+ i=-I${mountpoint}/${driveletter}/${pathname}
+ fi
+ else
+ eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}'
+ if ! test "${leader}" = "${i}"; then
+ eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}'
+ eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}'
+ driveletter=${no_mountpoint%%/*}
+ i=${leader}${driveletter}:/${pathname}
+ fi
+ fi
+ fi
+
+ args="${args} ${i}"
+ fi
+ fi
+done
+
+exec $prog $args \ No newline at end of file
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/generate_gyp.py b/chromium/third_party/ffmpeg/chromium/scripts/generate_gyp.py
index e806c924c22..16cf8ec989c 100755
--- a/chromium/third_party/ffmpeg/chromium/scripts/generate_gyp.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/generate_gyp.py
@@ -67,15 +67,18 @@ import optparse
import os
import string
-GYP_HEADER = """# Copyright (c) %d The Chromium Authors. All rights reserved.
+COPYRIGHT = """# Copyright %d The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# NOTE: this file is autogenerated by ffmpeg/chromium/scripts/generate_gyp.py
+""" % (datetime.datetime.now().year)
+
+GYP_HEADER = """
{
'variables': {
-""" % (datetime.datetime.now().year)
+"""
GYP_FOOTER = """ },
}
@@ -99,16 +102,32 @@ GYP_CONDITIONAL_C_SOURCE_STANZA_BEGIN = """ 'c_sources': [
"""
GYP_CONDITIONAL_ASM_SOURCE_STANZA_BEGIN = """ 'asm_sources': [
"""
-GYP_CONDITIONAL_MSVC_OUTPUT_STANZA_BEGIN = """ 'converter_outputs': [
-"""
GYP_CONDITIONAL_ITEM_STANZA_END = """ ],
"""
-GYP_HEADERS_STANZA_BEGIN = """ 'c_headers': [
+GN_HEADER = """import("//build/config/arm.gni")
+import("ffmpeg_options.gni")
+
+# Declare empty versions of each variable for easier +=ing later.
+ffmpeg_c_sources = []
+ffmpeg_gas_sources = []
+ffmpeg_yasm_sources = []
+
+"""
+GN_CONDITION_BEGIN = """if (%s) {
+"""
+GN_CONDITION_END = """}
+
"""
-GYP_HEADERS_STANZA_END = """ ], # c_headers
+GN_C_SOURCES_BEGIN = """ffmpeg_c_sources += [
"""
-GYP_HEADERS_STANZA_ITEM = """ '%s',
+GN_GAS_SOURCES_BEGIN = """ffmpeg_gas_sources += [
+"""
+GN_YASM_SOURCES_BEGIN = """ffmpeg_yasm_sources += [
+"""
+GN_SOURCE_ITEM = """ "%s",
+"""
+GN_SOURCE_END = """]
"""
# Controls GYP conditional stanza generation.
@@ -133,6 +152,7 @@ def CleanObjectFiles(object_files):
'libavcodec/inverse.o', # Includes libavutil/inverse.c
'libavcodec/file_open.o', # Includes libavutil/file_open.c
'libavcodec/log2_tab.o', # Includes libavutil/log2_tab.c
+ 'libavformat/golomb_tab.o', # Includes libavcodec/golomb.c
'libavformat/log2_tab.o', # Includes libavutil/log2_tab.c
'libavformat/file_open.o', # Includes libavutil/file_open.c
@@ -172,6 +192,14 @@ def IsAssemblyFile(f):
_, ext = os.path.splitext(f)
return ext in ['.S', '.asm']
+def IsGasFile(f):
+ _, ext = os.path.splitext(f)
+ return ext in ['.S']
+
+def IsYasmFile(f):
+ _, ext = os.path.splitext(f)
+ return ext in ['.asm']
+
def IsCFile(f):
_, ext = os.path.splitext(f)
return ext in ['.c']
@@ -387,17 +415,98 @@ class SourceSet(object):
stanza += GYP_CONDITIONAL_STANZA_ITEM % (name)
stanza += GYP_CONDITIONAL_ITEM_STANZA_END
- # Write out all MSVC outputs.
- msvc_outputs = filter(IsCFile, self.sources)
- if msvc_outputs:
- stanza += GYP_CONDITIONAL_MSVC_OUTPUT_STANZA_BEGIN
- for name in msvc_outputs:
- stanza += GYP_CONDITIONAL_STANZA_OUTPUT_ITEM % (name)
- stanza += GYP_CONDITIONAL_ITEM_STANZA_END
-
stanza += GYP_CONDITIONAL_STANZA_END % (conditions)
return ''.join(stanza)
+ def WriteGnStanza(self, fd):
+ """Generates a gyp conditional stanza representing this source set.
+
+ TODO(scherkus): Having all this special case condition optimizing logic in
+ here feels a bit dirty, but hey it works. Perhaps refactor if it starts
+ getting out of hand.
+
+ Args:
+ fd: File object to write the stanza into.
+ """
+
+ # Only build a non-trivial conditional if it's a subset of all supported
+ # architectures. targets. Arch conditions look like:
+ # (cpu_arch == "arm" || (cpu_arch == "arm" && arm_use_neon))
+ arch_conditions = []
+ if self.architectures != set(SUPPORTED_ARCHITECTURES + ['x64']):
+ for arch in self.architectures:
+ if arch == 'arm-neon':
+ arch_conditions.append('(cpu_arch == "arm" && arm_use_neon)')
+ else:
+ arch_conditions.append('cpu_arch == "%s"' % arch)
+
+ # Only build a non-trivial conditional if it's a subset of all supported
+ # targets. Branding conditions look like:
+ # (ffmpeg_branding == "Chrome" || ffmpeg_branding == "ChromeOS")
+ branding_conditions = []
+ if self.targets != set(SUPPORTED_TARGETS):
+ for branding in self.targets:
+ branding_conditions.append('ffmpeg_branding == "%s"' % branding)
+
+ # Platform conditions look like:
+ # (os == "mac" || os == "linux")
+ platform_conditions = []
+ if (self.platforms != set(SUPPORTED_PLATFORMS) and
+ self.platforms != set(['linux'])):
+ for platform in self.platforms:
+ platform_conditions.append('os == "%s"' % platform)
+
+ # Remove 0-lengthed lists.
+ conditions = filter(None, [' || '.join(arch_conditions),
+ ' || '.join(branding_conditions),
+ ' || '.join(platform_conditions)])
+
+ # If there is more that one clause, wrap various conditions in parens
+ # before joining.
+ if len(conditions) > 1:
+ conditions = [ '(%s)' % x for x in conditions ]
+
+ # Output a conditional wrapper around stanzas if necessary.
+ if conditions:
+ fd.write(GN_CONDITION_BEGIN % ' && '.join(conditions))
+ def indent_write(s):
+ fd.write(' %s' % s)
+ else:
+ def indent_write(s):
+ fd.write(s)
+
+ sources = sorted(n.replace('\\', '/') for n in self.sources)
+
+ # Write out all C sources.
+ c_sources = filter(IsCFile, sources)
+ if c_sources:
+ indent_write(GN_C_SOURCES_BEGIN)
+ for name in c_sources:
+ indent_write(GN_SOURCE_ITEM % (name))
+ indent_write(GN_SOURCE_END)
+
+ # Write out all assembly sources.
+ gas_sources = filter(IsGasFile, sources)
+ if gas_sources:
+ indent_write(GN_GAS_SOURCES_BEGIN)
+ for name in gas_sources:
+ indent_write(GN_SOURCE_ITEM % (name))
+ indent_write(GN_SOURCE_END)
+
+ # Write out all assembly sources.
+ yasm_sources = filter(IsYasmFile, sources)
+ if yasm_sources:
+ indent_write(GN_YASM_SOURCES_BEGIN)
+ for name in yasm_sources:
+ indent_write(GN_SOURCE_ITEM % (name))
+ indent_write(GN_SOURCE_END)
+
+ # Close the conditional if necessary.
+ if conditions:
+ fd.write(GN_CONDITION_END)
+ else:
+ fd.write('\n') # Makeup the spacing for the remove conditional.
+
def CreatePairwiseDisjointSets(sets):
""" Given a list of SourceSet objects, returns the pairwise disjoint sets.
@@ -464,6 +573,13 @@ def ParseOptions():
metavar='DIR',
help='Build root containing build.x64.linux, etc...')
+ parser.add_option('-g',
+ '--output_gn',
+ dest='output_gn',
+ action="store_true",
+ default=False,
+ help='Output a GN file instead of a gyp file.')
+
options, args = parser.parse_args()
if not options.source_dir:
@@ -478,6 +594,28 @@ def ParseOptions():
return options, args
+def WriteGyp(fd, build_dir, disjoint_sets):
+ fd.write(COPYRIGHT)
+ fd.write(GYP_HEADER)
+
+ # Generate conditional stanza for each disjoint source set.
+ fd.write(GYP_CONDITIONAL_BEGIN)
+ for s in disjoint_sets:
+ fd.write(s.GenerateGypStanza())
+ fd.write(GYP_CONDITIONAL_END)
+
+ fd.write(GYP_FOOTER)
+
+
+def WriteGn(fd, build_dir, disjoint_sets):
+ fd.write(COPYRIGHT)
+ fd.write(GN_HEADER)
+
+ # Generate conditional stanza for each disjoint source set.
+ for s in reversed(disjoint_sets):
+ s.WriteGnStanza(fd)
+
+
def main():
options, args = ParseOptions()
@@ -486,11 +624,6 @@ def main():
source_files = GetSourceFiles(source_dir)
object_to_sources = GetObjectToSourceMapping(source_files)
- # Open for writing.
- output_name = os.path.join(options.source_dir, 'ffmpeg_generated.gypi')
- fd = open(output_name, 'w')
- fd.write(GYP_HEADER)
-
sets = []
for arch in SUPPORTED_ARCHITECTURES:
@@ -514,31 +647,18 @@ def main():
sets.append(SourceSet(s, set(['x64']), set([target]),
set([platform])))
- # Generate conditional stanza for each disjoint source set.
- fd.write(GYP_CONDITIONAL_BEGIN)
- for s in CreatePairwiseDisjointSets(sets):
- fd.write(s.GenerateGypStanza())
- fd.write(GYP_CONDITIONAL_END)
-
- # Generate sorted list of .h files in source tree and write headers stanza.
- header_files = []
- for root, dirnames, filenames in os.walk('.'):
- # Strip './' and other cruft from path.
- root = os.path.normpath(root)
- # Only process headers in code we use. There should be no dependencies on
- # headers from libraries we don't use.
- if not root.startswith(
- ('libavcodec', 'libavutil', 'libavformat', 'compat')):
- continue
- for fn in fnmatch.filter(filenames, '*.h'):
- header_files.append(os.path.join(root,fn))
- fd.write(GYP_HEADERS_STANZA_BEGIN)
- for header in sorted(header_files):
- fd.write(GYP_HEADERS_STANZA_ITEM % header)
- fd.write(GYP_HEADERS_STANZA_END)
-
- fd.write(GYP_FOOTER)
- fd.close()
+ sets = CreatePairwiseDisjointSets(sets)
+ # Open for writing.
+ if options.output_gn:
+ outfile = 'ffmpeg_generated.gni'
+ else:
+ outfile = 'ffmpeg_generated.gypi'
+ output_name = os.path.join(options.source_dir, outfile)
+ with open(output_name, 'w') as fd:
+ if options.output_gn:
+ WriteGn(fd, options.build_dir, sets)
+ else:
+ WriteGyp(fd, options.build_dir, sets)
if __name__ == '__main__':
main()
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/generate_libs.py b/chromium/third_party/ffmpeg/chromium/scripts/generate_libs.py
index 9a8faeb51b1..9a8faeb51b1 100644..100755
--- a/chromium/third_party/ffmpeg/chromium/scripts/generate_libs.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/generate_libs.py
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/make_src_tree.sh b/chromium/third_party/ffmpeg/chromium/scripts/make_src_tree.sh
deleted file mode 100755
index a35752cd28f..00000000000
--- a/chromium/third_party/ffmpeg/chromium/scripts/make_src_tree.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This script creates a patched FFmpeg tree suitable for using to build
-# the FFmpeg needed by chromium. It takes an |output_dir| where the
-# final source tree will reside, and |patches_dir| containing patches
-# to apply to the pristine source.
-#
-# All files inside the directory tree at |patch_dir| matching the pattern
-# *.patch will be applied to the output directory in lexicographic order.
-
-set -e
-
-if [ $# -ne 2 ]; then
- echo "Usage: $0 <output directory> <directory with patches>"
- exit 1
-fi
-
-output_dir="${1}"
-patches_dir="${2}"
-
-if [ ! -d "$patches_dir" ]; then
- echo "$patches_dir is not a directory."
- exit 1
-fi
-
-if [ ! -d "$output_dir" ]; then
- echo "$output_dir is not a directory."
- exit 1
-fi
-
-# Get a list of all patches in |patches_dir|. Sort them in by the filename
-# regardless of path.
-reverse_paths() {
- perl -lne "print join '/', reverse split '/'"
-}
-patches=`find "$patches_dir" -name '*.patch' -type f |
- reverse_paths | sort | reverse_paths`
-
-# Apply the patches.
-for p in $patches; do
- echo Apply patch `basename $p` to $output_dir
- patch -p1 -d "$output_dir" < "$p"
-done
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/sync_svn.py b/chromium/third_party/ffmpeg/chromium/scripts/sync_svn.py
deleted file mode 100755
index 062d996a9f9..00000000000
--- a/chromium/third_party/ffmpeg/chromium/scripts/sync_svn.py
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""A script for syncing a Git repository to a Subversion repository.
-
-See help text below for usage.
-"""
-
-import filecmp
-import os
-import subprocess
-import sys
-
-
-def SyncPath(git_base, svn_base, diff):
- """Synchronizes the Git repository to the SVN repository using the diff.
-
- Given two paths and a filecmp.dircmp object of the diff, mirrors the contents
- of |git_base| to |svn_base|. WARNING: This includes deleting all files and
- directories in |svn_base| that are not in |git_base|.
-
- The difference between this and 'rsync -a --delete' is this method will run
- the appropriate 'svn add' and 'svn rm' commands necessary to commit.
-
- Args:
- git_base: Source folder, usually a Git repository.
- svn_base: Destination folder to sync to, must be an SVN repository.
- diff: A filecmp.dircmp diff object of git_base and svn_base.
- """
- # Delete files and folders only in the SVN repository.
- for f in diff.right_only:
- f = os.path.abspath(os.path.join(svn_base, f))
- print 'Removing %s' % f
- subprocess.check_call(['svn', 'rm', '--force', '--quiet', f])
- if os.path.isdir(f):
- subprocess.check_call(['rm', '-rf', f])
-
- # Copy files which were only in Git or different in SVN.
- for f in diff.left_only + diff.diff_files:
- dest = os.path.join(svn_base, f)
- src = os.path.abspath(os.path.join(git_base, f))
- print 'Copying %s' % src
- subprocess.check_call(['cp', '-fpr', src, dest])
- subprocess.check_call(['svn', 'add', '--force', '--quiet', dest])
-
- # For each directory in both, run SyncPath again on the diff.
- for dir_base, dir_diff in diff.subdirs.iteritems():
- SyncPath(os.path.join(git_base, dir_base),
- os.path.join(svn_base, dir_base), dir_diff)
-
-
-def Main():
- print '\n'.join([
- '\n Usage: %s <source git path> <dest svn path>\n' % sys.argv[0],
- '%s syncs a Git repository to a Subversion one. Given a source' % (
- os.path.basename(sys.argv[0])),
- 'Git repository and a destination SVN repository, it does:\n',
- ' 1. cd <source git>; git clean -qfdx',
- ' 2. Recursively removes all files and folders from SVN which are',
- ' in SVN but not in Git.',
- ' 3. Recursively copies all files and folders from Git to SVN which',
- ' are in Git but not in SVN.',
- ' 4. Recursively copies all files and folders from Git to SVN which',
- ' are different in Git than SVN.\n',
- '!!WARNING!!: This is a destructive process, both the source Git and ',
- 'destination SVN repositories will be modified. The git clean -qfdx',
- 'command will remove all files and folders not under source control from',
- 'the Git repository. While the sync process will remove all files',
- 'and folders from the SVN repository not in the Git repository.\n'])
-
- if len(sys.argv) != 3:
- sys.exit(1)
-
- git_path = os.path.abspath(sys.argv[1])
- svn_path = os.path.abspath(sys.argv[2])
- if not os.path.isdir(git_path):
- print 'ERROR: The specified Git path is not a directory.'
- sys.exit(1)
- if not os.path.isdir(svn_path):
- print 'ERROR: The specified Subversion path is not a directory.'
- sys.exit(1)
-
- prompt = raw_input('\n'.join([
- 'You are about to sync the Git repository:\n'
- ' %s\n' % git_path,
- 'To the Subversion repository:\n'
- ' %s\n' % svn_path,
- 'This is destructive, are you sure you want to continue? [y/N]: ']))
-
- if not prompt.strip().upper() in ['Y', 'YES']:
- print 'Aborting...'
- sys.exit(1)
-
- # Cleanup the Git repository before syncing.
- subprocess.check_call(['git', 'clean', '-qfdx'], cwd=git_path)
-
- SyncPath(git_path, svn_path, filecmp.dircmp(
- git_path, svn_path, ignore=['.git', '.svn']))
- print 'Sync complete, you may now run "svn commit" from the SVN directory.'
-
-
-if __name__ == '__main__':
- Main()
diff --git a/chromium/third_party/ffmpeg/cmdutils.c b/chromium/third_party/ffmpeg/cmdutils.c
index fc4b42440ee..1147bc338e2 100644
--- a/chromium/third_party/ffmpeg/cmdutils.c
+++ b/chromium/third_party/ffmpeg/cmdutils.c
@@ -66,6 +66,7 @@ AVDictionary *swr_opts;
AVDictionary *format_opts, *codec_opts, *resample_opts;
static FILE *report_file;
+int hide_banner = 0;
void init_opts(void)
{
@@ -491,6 +492,9 @@ void parse_loglevel(int argc, char **argv, const OptionDef *options)
fflush(report_file);
}
}
+ idx = locate_option(argc, argv, options, "hide_banner");
+ if (idx)
+ hide_banner = 1;
}
static const AVOption *opt_find(void *obj, const char *name, const char *unit,
@@ -658,7 +662,7 @@ static void init_parse_context(OptionParseContext *octx,
memset(octx, 0, sizeof(*octx));
octx->nb_groups = nb_groups;
- octx->groups = av_mallocz(sizeof(*octx->groups) * octx->nb_groups);
+ octx->groups = av_mallocz_array(octx->nb_groups, sizeof(*octx->groups));
if (!octx->groups)
exit_program(1);
@@ -830,10 +834,17 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
};
char *tail;
int level;
+ int flags;
int i;
+ flags = av_log_get_flags();
tail = strstr(arg, "repeat");
- av_log_set_flags(tail ? 0 : AV_LOG_SKIP_REPEATED);
+ if (tail)
+ flags &= ~AV_LOG_SKIP_REPEATED;
+ else
+ flags |= AV_LOG_SKIP_REPEATED;
+
+ av_log_set_flags(flags);
if (tail == arg)
arg += 6 + (arg[6]=='+');
if(tail && !*arg)
@@ -1083,7 +1094,7 @@ static void print_buildconf(int flags, int level)
void show_banner(int argc, char **argv, const OptionDef *options)
{
int idx = locate_option(argc, argv, options, "version");
- if (idx)
+ if (hide_banner || idx)
return;
print_program_info (INDENT|SHOW_COPYRIGHT, AV_LOG_INFO);
@@ -1374,6 +1385,9 @@ int show_codecs(void *optctx, const char *opt, const char *arg)
const AVCodecDescriptor *desc = codecs[i];
const AVCodec *codec = NULL;
+ if (strstr(desc->name, "_deprecated"))
+ continue;
+
printf(" ");
printf(avcodec_find_decoder(desc->id) ? "D" : ".");
printf(avcodec_find_encoder(desc->id) ? "E" : ".");
@@ -1938,7 +1952,8 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
}
if (av_opt_find(&cc, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ) ||
- (codec && codec->priv_class &&
+ !codec ||
+ (codec->priv_class &&
av_opt_find(&codec->priv_class, t->key, NULL, flags,
AV_OPT_SEARCH_FAKE_OBJ)))
av_dict_set(&ret, t->key, t->value, 0);
@@ -1961,7 +1976,7 @@ AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
if (!s->nb_streams)
return NULL;
- opts = av_mallocz(s->nb_streams * sizeof(*opts));
+ opts = av_mallocz_array(s->nb_streams, sizeof(*opts));
if (!opts) {
av_log(NULL, AV_LOG_ERROR,
"Could not alloc memory for stream options.\n");
diff --git a/chromium/third_party/ffmpeg/cmdutils.h b/chromium/third_party/ffmpeg/cmdutils.h
index f4f23ef8350..3fbaae93c24 100644
--- a/chromium/third_party/ffmpeg/cmdutils.h
+++ b/chromium/third_party/ffmpeg/cmdutils.h
@@ -24,6 +24,7 @@
#include <stdint.h>
+#include "config.h"
#include "libavcodec/avcodec.h"
#include "libavfilter/avfilter.h"
#include "libavformat/avformat.h"
@@ -48,6 +49,7 @@ extern AVFormatContext *avformat_opts;
extern struct SwsContext *sws_opts;
extern AVDictionary *swr_opts;
extern AVDictionary *format_opts, *codec_opts, *resample_opts;
+extern int hide_banner;
/**
* Register a program-specific cleanup routine.
@@ -57,7 +59,7 @@ void register_exit(void (*cb)(int ret));
/**
* Wraps exit with a program-specific cleanup routine.
*/
-void exit_program(int ret);
+void exit_program(int ret) av_noreturn;
/**
* Initialize the cmdutils option system, in particular
diff --git a/chromium/third_party/ffmpeg/cmdutils_common_opts.h b/chromium/third_party/ffmpeg/cmdutils_common_opts.h
index 685163e7d18..190dba674fa 100644
--- a/chromium/third_party/ffmpeg/cmdutils_common_opts.h
+++ b/chromium/third_party/ffmpeg/cmdutils_common_opts.h
@@ -21,6 +21,7 @@
{ "report" , 0, {(void*)opt_report}, "generate a report" },
{ "max_alloc" , HAS_ARG, {.func_arg = opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
{ "cpuflags" , HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags }, "force specific cpu flags", "flags" },
+ { "hide_banner", OPT_BOOL | OPT_EXPERT, {&hide_banner}, "do not show program banner", "hide_banner" },
#if CONFIG_OPENCL
{ "opencl_bench", OPT_EXIT, {.func_arg = opt_opencl_bench}, "run benchmark on all OpenCL devices and show results" },
{ "opencl_options", HAS_ARG, {.func_arg = opt_opencl}, "set OpenCL environment options" },
diff --git a/chromium/third_party/ffmpeg/common.mak b/chromium/third_party/ffmpeg/common.mak
index 50469a16a7b..18b5463d5b1 100644
--- a/chromium/third_party/ffmpeg/common.mak
+++ b/chromium/third_party/ffmpeg/common.mak
@@ -51,6 +51,9 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
%.o: %.cpp
$(COMPILE_CXX)
+%.o: %.m
+ $(COMPILE_C)
+
%.s: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -S -o $@ $<
@@ -90,13 +93,12 @@ include $(SRC_PATH)/arch.mak
OBJS += $(OBJS-yes)
SLIBOBJS += $(SLIBOBJS-yes)
-FFLIBS := $(FFLIBS-yes) $(FFLIBS)
+FFLIBS := $(FFLIBS-$(if $(NAME),$(NAME),no)) $(FFLIBS-yes) $(FFLIBS)
TESTPROGS += $(TESTPROGS-yes)
LDLIBS = $(FFLIBS:%=%$(BUILDSUF))
FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
-EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
SLIBOBJS := $(sort $(SLIBOBJS:%=$(SUBDIR)%))
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
diff --git a/chromium/third_party/ffmpeg/compat/avisynth/avisynth_c.h b/chromium/third_party/ffmpeg/compat/avisynth/avisynth_c.h
index 84b6e136842..448493b8395 100644
--- a/chromium/third_party/ffmpeg/compat/avisynth/avisynth_c.h
+++ b/chromium/third_party/ffmpeg/compat/avisynth/avisynth_c.h
@@ -13,7 +13,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+// MA 02110-1301 USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// As a special exception, I give you permission to link to the
diff --git a/chromium/third_party/ffmpeg/compat/avisynth/avxsynth_c.h b/chromium/third_party/ffmpeg/compat/avisynth/avxsynth_c.h
index 7a81e2195a9..b20f46081e5 100644
--- a/chromium/third_party/ffmpeg/compat/avisynth/avxsynth_c.h
+++ b/chromium/third_party/ffmpeg/compat/avisynth/avxsynth_c.h
@@ -13,7 +13,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+// MA 02110-1301 USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// As a special exception, I give you permission to link to the
diff --git a/chromium/third_party/ffmpeg/compat/float/float.h b/chromium/third_party/ffmpeg/compat/float/float.h
new file mode 100644
index 00000000000..1f0d3ab4b50
--- /dev/null
+++ b/chromium/third_party/ffmpeg/compat/float/float.h
@@ -0,0 +1,35 @@
+/*
+ * Work around broken floating point limits on some systems.
+ *
+ * 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_next <float.h>
+
+#ifdef FLT_MAX
+#undef FLT_MAX
+#define FLT_MAX 3.40282346638528859812e+38F
+
+#undef FLT_MIN
+#define FLT_MIN 1.17549435082228750797e-38F
+
+#undef DBL_MAX
+#define DBL_MAX ((double)1.79769313486231570815e+308L)
+
+#undef DBL_MIN
+#define DBL_MIN ((double)2.22507385850720138309e-308L)
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/vp3_bfin.h b/chromium/third_party/ffmpeg/compat/float/limits.h
index e832de749ab..7ea374a8bcd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/vp3_bfin.h
+++ b/chromium/third_party/ffmpeg/compat/float/limits.h
@@ -1,4 +1,6 @@
/*
+ * Work around broken floating point limits on some systems.
+ *
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
@@ -16,12 +18,5 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-#ifndef AVCODEC_BFIN_VP3_BFIN_H
-#define AVCODEC_BFIN_VP3_BFIN_H
-
-#include <stdint.h>
-
-void ff_bfin_vp3_idct(int16_t *block);
-
-#endif /* AVCODEC_BFIN_VP3_BFIN_H */
+#include_next <limits.h>
+#include <float.h>
diff --git a/chromium/third_party/ffmpeg/compat/va_copy.h b/chromium/third_party/ffmpeg/compat/va_copy.h
index f8947719490..3cb5ebee338 100644
--- a/chromium/third_party/ffmpeg/compat/va_copy.h
+++ b/chromium/third_party/ffmpeg/compat/va_copy.h
@@ -24,3 +24,6 @@
#if !defined(va_copy) && defined(_MSC_VER)
#define va_copy(dst, src) ((dst) = (src))
#endif
+#if !defined(va_copy) && defined(__GNUC__) && __GNUC__ < 3
+#define va_copy(dst, src) __va_copy(dst, src)
+#endif
diff --git a/chromium/third_party/ffmpeg/configure b/chromium/third_party/ffmpeg/configure
index 742233d18c1..8928f09a038 100755
--- a/chromium/third_party/ffmpeg/configure
+++ b/chromium/third_party/ffmpeg/configure
@@ -106,7 +106,7 @@ Configuration options:
--disable-swscale-alpha disable alpha channel support in swscale
--disable-all disable building components, libraries and programs
--enable-incompatible-libav-abi enable incompatible Libav fork ABI [no]
- --enable-incompatible-fork-abi enable incompatible Libav fork ABI (deprecated) [no]
+ --enable-raise-major increase major version numbers in sonames [no]
Program options:
--disable-programs do not build command line programs
@@ -148,7 +148,7 @@ Component options:
Hardware accelerators:
--disable-dxva2 disable DXVA2 code [autodetect]
--disable-vaapi disable VAAPI code [autodetect]
- --enable-vda enable VDA code
+ --disable-vda disable VDA code [autodetect]
--disable-vdpau disable VDPAU code [autodetect]
Individual component options:
@@ -199,6 +199,7 @@ External library support:
--enable-libaacplus enable AAC+ encoding via libaacplus [no]
--enable-libass enable libass subtitles rendering [no]
--enable-libbluray enable BluRay reading using libbluray [no]
+ --enable-libbs2b enable bs2b DSP library [no]
--enable-libcaca enable textual display using libcaca
--enable-libcelt enable CELT decoding via libcelt [no]
--enable-libcdio enable audio CD grabbing with libcdio
@@ -220,7 +221,7 @@ External library support:
--enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
--enable-libopencv enable video filtering via libopencv [no]
--enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
- --enable-libopus enable Opus decoding via libopus [no]
+ --enable-libopus enable Opus de/encoding via libopus [no]
--enable-libpulse enable Pulseaudio input via libpulse [no]
--enable-libquvi enable quvi input via libquvi [no]
--enable-librtmp enable RTMP[E] support via librtmp [no]
@@ -241,20 +242,29 @@ External library support:
native implementation exists [no]
--enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
--enable-libwavpack enable wavpack encoding via libwavpack [no]
+ --enable-libwebp enable WebP encoding via libwebp [no]
--enable-libx264 enable H.264 encoding via x264 [no]
+ --enable-libx265 enable HEVC encoding via x265 [no]
--enable-libxavs enable AVS encoding via xavs [no]
--enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
--enable-libzmq enable message passing via libzmq [no]
--enable-libzvbi enable teletext support via libzvbi [no]
+ --enable-decklink enable Blackmagick DeckLink output [no]
--enable-openal enable OpenAL 1.1 capture support [no]
--enable-opencl enable OpenCL code
+ --enable-opengl enable OpenGL rendering [no]
--enable-openssl enable openssl [no]
--enable-x11grab enable X11 grabbing [no]
+ --disable-xlib disable xlib [autodetect]
--disable-zlib disable zlib [autodetect]
-Advanced options (experts only):
+Toolchain options:
+ --arch=ARCH select architecture [$arch]
+ --cpu=CPU select the minimum required CPU (affects
+ instruction selection, may crash on older CPUs)
--cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
+ --progs-suffix=SUFFIX program name suffix []
--enable-cross-compile assume a cross-compiler is used
--sysroot=PATH root of cross-build tree
--sysinclude=PATH location of cross-build system headers
@@ -264,6 +274,7 @@ Advanced options (experts only):
--target-samples=DIR path to samples directory on target
--tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
--toolchain=NAME set tool defaults according to NAME
+ --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
--nm=NM use nm tool NM [$nm_default]
--ar=AR use archive tool AR [$ar_default]
--as=AS use assembler AS [$as_default]
@@ -273,6 +284,9 @@ Advanced options (experts only):
--cxx=CXX use C compiler CXX [$cxx_default]
--dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
--ld=LD use linker LD [$ld_default]
+ --pkg-config=PKGCONF use pkg-config PKGCONF [$pkg_config_default]
+ --pkg-config-flags=FLAGS pass additional flags to pkgconf []
+ --ranlib=RANLIB use ranlib RANLIB [$ranlib_default]
--host-cc=HOSTCC use host C compiler HOSTCC
--host-cflags=HCFLAGS use HCFLAGS when compiling for host
--host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
@@ -287,21 +301,19 @@ Advanced options (experts only):
--extra-version=STRING version string suffix []
--optflags=OPTFLAGS override optimization-related compiler flags
--build-suffix=SUFFIX library name suffix []
- --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
- --progs-suffix=SUFFIX program name suffix []
- --arch=ARCH select architecture [$arch]
- --cpu=CPU select the minimum required CPU (affects
- instruction selection, may crash on older CPUs)
--enable-pic build position-independent code
- --enable-sram allow use of on-chip SRAM
--enable-thumb compile for Thumb instruction set
+ --enable-lto use link-time optimization
+
+Advanced options (experts only):
+ --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
--disable-symver disable symbol versioning
--enable-hardcoded-tables use hardcoded tables instead of runtime generation
--disable-safe-bitstream-reader
disable buffer boundary checking in bitreaders
(faster, but may crash)
--enable-memalign-hack emulate memalign, interferes with memory debuggers
- --enable-lto use link-time optimization
+ --enable-sram allow use of on-chip SRAM
Optimization options (experts only):
--disable-asm disable all assembler optimizations
@@ -317,6 +329,8 @@ Optimization options (experts only):
--disable-sse4 disable SSE4 optimizations
--disable-sse42 disable SSE4.2 optimizations
--disable-avx disable AVX optimizations
+ --disable-xop disable XOP optimizations
+ --disable-fma3 disable FMA3 optimizations
--disable-fma4 disable FMA4 optimizations
--disable-avx2 disable AVX2 optimizations
--disable-armv5te disable armv5te optimizations
@@ -324,7 +338,6 @@ Optimization options (experts only):
--disable-armv6t2 disable armv6t2 optimizations
--disable-vfp disable VFP optimizations
--disable-neon disable NEON optimizations
- --disable-vis disable VIS optimizations
--disable-inline-asm disable use of inline assembler
--disable-yasm disable use of yasm assembler
--disable-mips32r2 disable MIPS32R2 optimizations
@@ -348,6 +361,8 @@ Developer options (useful when working on FFmpeg itself):
--enable-ftrapv Trap arithmetic overflows
--samples=PATH location of test samples for FATE, if not set use
\$FATE_SAMPLES at make invocation time.
+ --enable-neon-clobber-test check NEON registers for clobbering (should be
+ used only for debugging purposes)
--enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
should be used only for debugging purposes)
--enable-random randomly enable/disable components
@@ -711,6 +726,15 @@ prepend(){
eval "$var=\"$* \$$var\""
}
+unique(){
+ var=$1
+ uniq_list=""
+ for tok in $(eval echo \$$var); do
+ uniq_list="$(filter_out $tok $uniq_list) $tok"
+ done
+ eval "$var=\"${uniq_list}\""
+}
+
add_cppflags(){
append CPPFLAGS "$@"
}
@@ -762,6 +786,11 @@ check_cmd(){
"$@" >> $logfile 2>&1
}
+check_stat(){
+ log check_stat "$@"
+ stat "$1" >> $logfile 2>&1
+}
+
cc_o(){
eval printf '%s\\n' $CC_O
}
@@ -784,6 +813,13 @@ check_cxx(){
check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
}
+check_oc(){
+ log check_oc "$@"
+ cat > $TMPM
+ log_file $TMPM
+ check_cmd $cc -Werror=missing-prototypes $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPM
+}
+
check_cpp(){
log check_cpp "$@"
cat > $TMPC
@@ -843,6 +879,13 @@ check_ld(){
check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
}
+print_include(){
+ hdr=$1
+ test "${hdr%.h}" = "${hdr}" &&
+ echo "#include $hdr" ||
+ echo "#include <$hdr>"
+}
+
check_code(){
log check_code "$@"
check=$1
@@ -851,7 +894,7 @@ check_code(){
shift 3
{
for hdr in $headers; do
- echo "#include <$hdr>"
+ print_include $hdr
done
echo "int main(void) { $code; return 0; }"
} | check_$check "$@"
@@ -922,6 +965,18 @@ int x;
EOF
}
+check_header_oc(){
+ log check_header_oc "$@"
+ rm -f -- "$TMPO"
+ header=$1
+ shift
+ disable_safe $header
+ {
+ echo "#include <$header>"
+ echo "int main(void) { return 0; }"
+ } | check_oc && check_stat "$TMPO" && enable_safe $headers
+}
+
check_func(){
log check_func "$@"
func=$1
@@ -954,7 +1009,7 @@ check_func_headers(){
shift 2
{
for hdr in $headers; do
- echo "#include <$hdr>"
+ print_include $hdr
done
for func in $funcs; do
echo "long check_$func(void) { return (long) $func; }"
@@ -1021,13 +1076,14 @@ check_lib_cpp(){
check_pkg_config(){
log check_pkg_config "$@"
- pkg="$1"
+ pkgandversion="$1"
+ pkg="${1%% *}"
headers="$2"
funcs="$3"
shift 3
- check_cmd $pkg_config --exists --print-errors $pkg || return
- pkg_cflags=$($pkg_config --cflags $pkg)
- pkg_libs=$($pkg_config --libs $pkg)
+ check_cmd $pkg_config --exists --print-errors $pkgandversion || return
+ pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
+ pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
set_safe ${pkg}_cflags $pkg_cflags &&
set_safe ${pkg}_libs $pkg_libs
@@ -1097,6 +1153,16 @@ check_builtin(){
check_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
}
+check_compile_assert(){
+ log check_compile_assert "$@"
+ name=$1
+ headers=$2
+ condition=$3
+ shift 3
+ disable "$name"
+ check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
+}
+
require(){
name="$1"
header="$2"
@@ -1148,6 +1214,10 @@ require_libfreetype(){
add_extralibs $(get_safe ${pkg}_libs)
}
+hostcc_e(){
+ eval printf '%s\\n' $HOSTCC_E
+}
+
hostcc_o(){
eval printf '%s\\n' $HOSTCC_O
}
@@ -1159,6 +1229,13 @@ check_host_cc(){
check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
}
+check_host_cpp(){
+ log check_host_cpp "$@"
+ cat > $TMPC
+ log_file $TMPC
+ check_cmd $host_cc $HOSTCPPFLAGS $HOSTCFLAGS "$@" $(hostcc_e $TMPO) $TMPC
+}
+
check_host_cppflags(){
log check_host_cppflags "$@"
check_host_cc "$@" <<EOF && append host_cppflags "$@"
@@ -1174,6 +1251,19 @@ int x;
EOF
}
+check_host_cpp_condition(){
+ log check_host_cpp_condition "$@"
+ header=$1
+ condition=$2
+ shift 2
+ check_host_cpp "$@" <<EOF
+#include <$header>
+#if !($condition)
+#error "unsatisfied condition: $condition"
+#endif
+EOF
+}
+
apply(){
file=$1
shift
@@ -1204,22 +1294,26 @@ COMPONENT_LIST="
"
EXAMPLE_LIST="
+ avio_reading_example
decoding_encoding_example
demuxing_decoding_example
+ filter_audio_example
filtering_audio_example
filtering_video_example
metadata_example
muxing_example
+ remuxing_example
resampling_audio_example
scaling_video_example
transcode_aac_example
+ transcoding_example
"
EXTERNAL_LIBRARY_LIST="
avisynth
bzlib
crystalhd
- fontconfig
+ decklink
frei0r
gnutls
iconv
@@ -1227,6 +1321,7 @@ EXTERNAL_LIBRARY_LIST="
libaacplus
libass
libbluray
+ libbs2b
libcaca
libcdio
libcelt
@@ -1234,6 +1329,7 @@ EXTERNAL_LIBRARY_LIST="
libfaac
libfdk_aac
libflite
+ libfontconfig
libfreetype
libgme
libgsm
@@ -1266,15 +1362,19 @@ EXTERNAL_LIBRARY_LIST="
libvorbis
libvpx
libwavpack
+ libwebp
libx264
+ libx265
libxavs
libxvid
libzmq
libzvbi
openal
opencl
+ opengl
openssl
x11grab
+ xlib
zlib
"
@@ -1286,11 +1386,25 @@ DOCUMENT_LIST="
txtpages
"
+FEATURE_LIST="
+ ftrapv
+ gray
+ hardcoded_tables
+ runtime_cpudetect
+ safe_bitstream_reader
+ shared
+ small
+ sram
+ static
+ swscale_alpha
+"
+
HWACCEL_LIST="
dxva2
vaapi
vda
vdpau
+ xvmc
"
LIBRARY_LIST="
@@ -1305,6 +1419,12 @@ LIBRARY_LIST="
swscale
"
+LICENSE_LIST="
+ gpl
+ nonfree
+ version3
+"
+
PROGRAM_LIST="
ffplay
ffprobe
@@ -1312,59 +1432,55 @@ PROGRAM_LIST="
ffmpeg
"
+SUBSYSTEM_LIST="
+ dct
+ dwt
+ error_resilience
+ fast_unaligned
+ fft
+ lsp
+ lzo
+ mdct
+ network
+ rdft
+"
+
CONFIG_LIST="
$COMPONENT_LIST
$DOCUMENT_LIST
$EXAMPLE_LIST
$EXTERNAL_LIBRARY_LIST
+ $FEATURE_LIST
$HWACCEL_LIST
+ $LICENSE_LIST
$LIBRARY_LIST
$PROGRAM_LIST
- dct
- dwt
- error_resilience
- fast_unaligned
- fft
- ftrapv
- gpl
- gray
- hardcoded_tables
+ $SUBSYSTEM_LIST
+ fontconfig
incompatible_libav_abi
- incompatible_fork_abi
- lsp
- lzo
- mdct
memalign_hack
memory_poisoning
- network
- nonfree
+ neon_clobber_test
pic
- rdft
- runtime_cpudetect
- safe_bitstream_reader
- shared
- small
- sram
- static
- swscale_alpha
+ pod2man
+ raise_major
thumb
- version3
xmm_clobber_test
"
-THREADS_LIST='
+THREADS_LIST="
pthreads
- w32threads
os2threads
-'
+ w32threads
+"
-ATOMICS_LIST='
+ATOMICS_LIST="
atomics_gcc
atomics_suncc
atomics_win32
-'
+"
-ARCH_LIST='
+ARCH_LIST="
aarch64
alpha
arm
@@ -1389,24 +1505,32 @@ ARCH_LIST='
x86
x86_32
x86_64
-'
+"
-ARCH_EXT_LIST_ARM='
+ARCH_EXT_LIST_ARM="
armv5te
armv6
armv6t2
+ armv8
neon
vfp
vfpv3
-'
+"
+
+ARCH_EXT_LIST_MIPS="
+ mipsfpu
+ mips32r2
+ mipsdspr1
+ mipsdspr2
+"
-ARCH_EXT_LIST_X86='
+ARCH_EXT_LIST_X86_SIMD="
amd3dnow
amd3dnowext
avx
avx2
+ fma3
fma4
- i686
mmx
mmxext
sse
@@ -1415,32 +1539,102 @@ ARCH_EXT_LIST_X86='
sse4
sse42
ssse3
-'
+ xop
+"
+
+ARCH_EXT_LIST_PPC="
+ altivec
+ dcbzl
+ ldbrx
+ ppc4xx
+"
+
+ARCH_EXT_LIST_X86="
+ $ARCH_EXT_LIST_X86_SIMD
+ cpunop
+ i686
+"
ARCH_EXT_LIST="
$ARCH_EXT_LIST_ARM
+ $ARCH_EXT_LIST_PPC
$ARCH_EXT_LIST_X86
- altivec
- ppc4xx
- vis
- mipsfpu
- mips32r2
- mipsdspr1
- mipsdspr2
+ $ARCH_EXT_LIST_MIPS
+ loongson
+"
+
+ARCH_FEATURES="
+ aligned_stack
+ fast_64bit
+ fast_clz
+ fast_cmov
+ local_aligned_8
+ local_aligned_16
+ local_aligned_32
"
-HAVE_LIST_CMDLINE='
+BUILTIN_LIST="
+ atomic_cas_ptr
+ machine_rw_barrier
+ MemoryBarrier
+ mm_empty
+ rdtsc
+ sarestart
+ sync_val_compare_and_swap
+"
+HAVE_LIST_CMDLINE="
inline_asm
symver
yasm
-'
+"
-HAVE_LIST_PUB='
+HAVE_LIST_PUB="
bigendian
fast_unaligned
incompatible_libav_abi
- incompatible_fork_abi
-'
+"
+
+HEADERS_LIST="
+ alsa_asoundlib_h
+ altivec_h
+ arpa_inet_h
+ asm_types_h
+ cdio_paranoia_h
+ cdio_paranoia_paranoia_h
+ CL_cl_h
+ dev_bktr_ioctl_bt848_h
+ dev_bktr_ioctl_meteor_h
+ dev_ic_bt8xx_h
+ dev_video_bktr_ioctl_bt848_h
+ dev_video_meteor_ioctl_meteor_h
+ direct_h
+ dlfcn_h
+ dxva_h
+ ES2_gl_h
+ gsm_h
+ io_h
+ mach_mach_time_h
+ machine_ioctl_bt848_h
+ machine_ioctl_meteor_h
+ malloc_h
+ openjpeg_1_5_openjpeg_h
+ OpenGL_gl3_h
+ poll_h
+ sndio_h
+ soundcard_h
+ sys_mman_h
+ sys_param_h
+ sys_resource_h
+ sys_select_h
+ sys_soundcard_h
+ sys_time_h
+ sys_un_h
+ sys_videoio_h
+ termios_h
+ unistd_h
+ windows_h
+ winsock2_h
+"
MATH_FUNCS="
atanf
@@ -1470,53 +1664,17 @@ MATH_FUNCS="
truncf
"
-HAVE_LIST="
- $ARCH_EXT_LIST
- $(add_suffix _external $ARCH_EXT_LIST)
- $(add_suffix _inline $ARCH_EXT_LIST)
- $HAVE_LIST_CMDLINE
- $HAVE_LIST_PUB
- $THREADS_LIST
- $ATOMICS_LIST
- $MATH_FUNCS
+SYSTEM_FUNCS="
access
aligned_malloc
- aligned_stack
- alsa_asoundlib_h
- altivec_h
- arpa_inet_h
- asm_mod_q
- asm_mod_y
- asm_types_h
- atomic_cas_ptr
- atomics_native
- attribute_may_alias
- attribute_packed
- cdio_paranoia_h
- cdio_paranoia_paranoia_h
- CL_cl_h
clock_gettime
closesocket
CommandLineToArgvW
- cpunop
+ CoTaskMemFree
CryptGenRandom
- dcbzl
- dev_bktr_ioctl_bt848_h
- dev_bktr_ioctl_meteor_h
- dev_ic_bt8xx_h
- dev_video_bktr_ioctl_bt848_h
- dev_video_meteor_ioctl_meteor_h
- direct_h
- dlfcn_h
dlopen
- dos_paths
- dxva_h
- ebp_available
- ebx_available
- fast_64bit
- fast_clz
- fast_cmov
fcntl
+ flt_lim
fork
getaddrinfo
gethrtime
@@ -1524,64 +1682,64 @@ HAVE_LIST="
GetProcessAffinityMask
GetProcessMemoryInfo
GetProcessTimes
- GetSystemTimeAsFileTime
getrusage
getservbyport
+ GetSystemTimeAsFileTime
gettimeofday
glob
- gnu_as
- gnu_windres
- gsm_h
- ibm_asm
+ glXGetProcAddress
inet_aton
- io_h
- inline_asm_labels
isatty
jack_port_get_latency_range
kbhit
- ldbrx
- libc_msvcrt
- libdc1394_1
- libdc1394_2
- local_aligned_16
- local_aligned_8
localtime_r
- loongson
lzo1x_999_compress
- machine_ioctl_bt848_h
- machine_ioctl_meteor_h
- machine_rw_barrier
- makeinfo
- malloc_h
+ mach_absolute_time
MapViewOfFile
memalign
- MemoryBarrier
mkstemp
- mm_empty
mmap
mprotect
nanosleep
- openjpeg_1_5_openjpeg_h
PeekNamedPipe
- perl
- pod2man
- poll_h
posix_memalign
- pragma_deprecated
pthread_cancel
- rdtsc
- rsync_contimeout
- sarestart
sched_getaffinity
- sdl
SetConsoleTextAttribute
setmode
setrlimit
Sleep
- sndio_h
- socklen_t
- soundcard_h
strerror_r
+ sysconf
+ sysctl
+ usleep
+ VirtualAlloc
+ wglGetProcAddress
+"
+
+TOOLCHAIN_FEATURES="
+ asm_mod_q
+ attribute_may_alias
+ attribute_packed
+ ebp_available
+ ebx_available
+ gnu_as
+ gnu_windres
+ ibm_asm
+ inline_asm_labels
+ inline_asm_nonlocal_labels
+ inline_asm_direct_symbol_refs
+ pragma_deprecated
+ rsync_contimeout
+ symver_asm_label
+ symver_gnu_asm
+ vfp_args
+ xform_asm
+ xmm_clobbers
+"
+
+TYPES_LIST="
+ socklen_t
struct_addrinfo
struct_group_source_req
struct_ip_mreq_source
@@ -1594,32 +1752,38 @@ HAVE_LIST="
struct_sockaddr_storage
struct_stat_st_mtim_tv_nsec
struct_v4l2_frmivalenum_discrete
- symver_asm_label
- symver_gnu_asm
- sync_val_compare_and_swap
- sysconf
- sysctl
- sys_mman_h
- sys_param_h
- sys_resource_h
- sys_select_h
- sys_soundcard_h
- sys_time_h
- sys_un_h
- sys_videoio_h
- termios_h
+"
+
+HAVE_LIST="
+ $ARCH_EXT_LIST
+ $(add_suffix _external $ARCH_EXT_LIST)
+ $(add_suffix _inline $ARCH_EXT_LIST)
+ $ARCH_FEATURES
+ $ATOMICS_LIST
+ $BUILTIN_LIST
+ $HAVE_LIST_CMDLINE
+ $HAVE_LIST_PUB
+ $HEADERS_LIST
+ $MATH_FUNCS
+ $SYSTEM_FUNCS
+ $THREADS_LIST
+ $TOOLCHAIN_FEATURES
+ $TYPES_LIST
+ atomics_native
+ dos_paths
+ dxva2api_cobj
+ dxva2_lib
+ libc_msvcrt
+ libdc1394_1
+ libdc1394_2
+ makeinfo
+ perl
+ pod2man
+ sdl
texi2html
threads
- unistd_h
- usleep
vdpau_x11
- vfp_args
- VirtualAlloc
- windows_h
- winsock2_h
- xform_asm
xlib
- xmm_clobbers
"
# options emitted with CONFIG_ prefix but not available on the command line
@@ -1627,6 +1791,7 @@ CONFIG_EXTRA="
aandcttables
ac3dsp
audio_frame_queue
+ cabac
dsputil
exif
frame_thread_encoder
@@ -1640,7 +1805,9 @@ CONFIG_EXTRA="
h264qpel
hpeldsp
huffman
+ intrax8
lgplv3
+ llviddsp
lpc
mpegaudio
mpegaudiodsp
@@ -1653,6 +1820,7 @@ CONFIG_EXTRA="
rtpdec
rtpenc_chain
sinewin
+ tpeldsp
videodsp
vp3dsp
"
@@ -1673,7 +1841,7 @@ CMDLINE_SELECT="
stripping
"
-PATHS_LIST='
+PATHS_LIST="
bindir
datadir
docdir
@@ -1682,7 +1850,7 @@ PATHS_LIST='
mandir
prefix
shlibdir
-'
+"
CMDLINE_SET="
$PATHS_LIST
@@ -1697,6 +1865,7 @@ CMDLINE_SET="
cxx
dep_cc
extra_version
+ gas
host_cc
host_cflags
host_ld
@@ -1710,8 +1879,10 @@ CMDLINE_SET="
nm
optflags
pkg_config
+ pkg_config_flags
progs_suffix
random_seed
+ ranlib
samples
strip
sysinclude
@@ -1739,8 +1910,9 @@ CMDLINE_APPEND="
armv5te_deps="arm"
armv6_deps="arm"
armv6t2_deps="arm"
-neon_deps="arm"
-vfp_deps="arm"
+armv8_deps="aarch64"
+neon_deps_any="aarch64 arm"
+vfp_deps_any="aarch64 arm"
vfpv3_deps="vfp"
map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
@@ -1753,14 +1925,13 @@ mipsdspr2_deps="mips"
altivec_deps="ppc"
ppc4xx_deps="ppc"
-vis_deps="sparc"
-
cpunop_deps="i686"
x86_64_select="i686"
x86_64_suggest="fast_cmov"
amd3dnow_deps="mmx"
amd3dnowext_deps="amd3dnow"
+i686_deps="x86"
mmx_deps="x86"
mmxext_deps="mmx"
sse_deps="mmxext"
@@ -1770,6 +1941,8 @@ ssse3_deps="sse3"
sse4_deps="ssse3"
sse42_deps="sse4"
avx_deps="sse42"
+xop_deps="avx"
+fma3_deps="avx"
fma4_deps="avx"
avx2_deps="avx"
@@ -1777,42 +1950,49 @@ mmx_external_deps="yasm"
mmx_inline_deps="inline_asm"
mmx_suggest="mmx_external mmx_inline"
-for ext in $(filter_out mmx $ARCH_EXT_LIST_X86); do
+for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
eval dep=\$${ext}_deps
eval ${ext}_external_deps='"${dep}_external"'
eval ${ext}_inline_deps='"${dep}_inline"'
eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
done
-aligned_stack_if_any="ppc x86"
-fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
-fast_clz_if_any="alpha avr32 mips ppc x86"
-fast_unaligned_if_any="ppc x86"
+aligned_stack_if_any="aarch64 ppc x86"
+fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
+fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
+fast_unaligned_if_any="aarch64 ppc x86"
-inline_asm_deps="!tms470"
need_memalign="altivec neon sse"
+# system capabilities
+
symver_if_any="symver_asm_label symver_gnu_asm"
-log2_deps="!libc_msvcrt"
+# threading support
+atomics_gcc_if="sync_val_compare_and_swap"
+atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
+atomics_win32_if="MemoryBarrier"
+atomics_native_if_any="$ATOMICS_LIST"
+w32threads_deps="atomics_native"
+threads_if_any="$THREADS_LIST"
# subsystems
dct_select="rdft"
error_resilience_select="dsputil"
frame_thread_encoder_deps="encoders threads"
-lpc_select="dsputil"
mdct_select="fft"
rdft_select="fft"
mpegaudio_select="mpegaudiodsp"
mpegaudiodsp_select="dct"
mpegvideo_select="dsputil h264chroma hpeldsp videodsp"
-mpegvideoenc_select="mpegvideo"
+mpegvideoenc_select="dsputil mpegvideo"
# decoders / encoders
aac_decoder_select="mdct sinewin"
aac_encoder_select="audio_frame_queue mdct sinewin"
aac_latm_decoder_select="aac_decoder aac_latm_parser"
ac3_decoder_select="mdct ac3dsp ac3_parser dsputil"
+ac3_fixed_decoder_select="mdct ac3dsp ac3_parser dsputil"
ac3_encoder_select="mdct ac3dsp dsputil"
ac3_fixed_encoder_select="mdct ac3dsp dsputil"
aic_decoder_select="dsputil golomb"
@@ -1820,7 +2000,7 @@ alac_encoder_select="lpc"
als_decoder_select="dsputil"
amrnb_decoder_select="lsp"
amrwb_decoder_select="lsp"
-amv_decoder_select="dsputil hpeldsp exif"
+amv_decoder_select="sp5x_decoder exif"
amv_encoder_select="aandcttables"
ape_decoder_select="dsputil"
asv1_decoder_select="dsputil"
@@ -1829,6 +2009,7 @@ asv2_decoder_select="dsputil"
asv2_encoder_select="dsputil"
atrac1_decoder_select="mdct sinewin"
atrac3_decoder_select="mdct"
+atrac3p_decoder_select="mdct sinewin"
avrn_decoder_select="exif"
bink_decoder_select="dsputil hpeldsp"
binkaudio_dct_decoder_select="mdct rdft dct sinewin"
@@ -1850,12 +2031,13 @@ eac3_decoder_select="ac3_decoder"
eac3_encoder_select="ac3_encoder"
eamad_decoder_select="aandcttables dsputil mpegvideo"
eatgq_decoder_select="aandcttables"
-eatqi_decoder_select="aandcttables error_resilience mpegvideo"
+eatqi_decoder_select="aandcttables dsputil error_resilience mpegvideo"
exr_decoder_select="zlib"
-ffv1_decoder_select="dsputil golomb rangecoder"
-ffv1_encoder_select="dsputil rangecoder"
-ffvhuff_decoder_select="dsputil"
-ffvhuff_encoder_select="dsputil huffman"
+ffv1_decoder_select="golomb rangecoder"
+ffv1_encoder_select="rangecoder"
+ffvhuff_decoder_select="huffyuv_decoder"
+ffvhuff_encoder_select="huffyuv_encoder"
+fic_decoder_select="golomb"
flac_decoder_select="golomb"
flac_encoder_select="dsputil golomb lpc"
flashsv_decoder_select="zlib"
@@ -1874,16 +2056,16 @@ h263_decoder_select="error_resilience h263_parser h263dsp mpegvideo"
h263_encoder_select="aandcttables h263dsp mpegvideoenc"
h263i_decoder_select="h263_decoder"
h263p_encoder_select="h263_encoder"
-h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
+h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel videodsp"
h264_decoder_suggest="error_resilience"
-hevc_decoder_select="dsputil golomb videodsp"
-huffyuv_decoder_select="dsputil"
-huffyuv_encoder_select="dsputil huffman"
-iac_decoder_select="dsputil fft mdct sinewin"
+hevc_decoder_select="cabac dsputil golomb videodsp"
+huffyuv_decoder_select="dsputil llviddsp"
+huffyuv_encoder_select="dsputil huffman llviddsp"
+iac_decoder_select="imc_decoder"
imc_decoder_select="dsputil fft mdct sinewin"
indeo3_decoder_select="hpeldsp"
interplay_video_decoder_select="hpeldsp"
-jpegls_decoder_select="dsputil golomb hpeldsp exif"
+jpegls_decoder_select="golomb mjpeg_decoder"
jpegls_encoder_select="golomb"
jv_decoder_select="dsputil"
lagarith_decoder_select="dsputil"
@@ -1893,9 +2075,9 @@ mdec_decoder_select="dsputil error_resilience mpegvideo"
metasound_decoder_select="lsp mdct sinewin"
mimic_decoder_select="dsputil hpeldsp"
mjpeg_decoder_select="dsputil hpeldsp exif"
-mjpegb_decoder_select="dsputil hpeldsp exif"
-mjpeg_encoder_select="aandcttables dsputil mpegvideoenc"
-mlp_decoder_select="dsputil mlp_parser"
+mjpeg_encoder_select="aandcttables mpegvideoenc"
+mjpegb_decoder_select="mjpeg_decoder"
+mlp_decoder_select="mlp_parser"
motionpixels_decoder_select="dsputil"
mp1_decoder_select="mpegaudio"
mp1float_decoder_select="mpegaudio"
@@ -1908,13 +2090,13 @@ mp3float_decoder_select="mpegaudio"
mp3on4_decoder_select="mpegaudio"
mp3on4float_decoder_select="mpegaudio"
mpc7_decoder_select="dsputil mpegaudiodsp"
-mpc8_decoder_select="dsputil mpegaudiodsp"
+mpc8_decoder_select="mpegaudiodsp"
mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
mpeg_xvmc_decoder_select="mpeg2video_decoder"
mpeg1video_decoder_select="error_resilience mpegvideo"
-mpeg1video_encoder_select="aandcttables mpegvideoenc"
+mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp"
mpeg2video_decoder_select="error_resilience mpegvideo"
-mpeg2video_encoder_select="aandcttables mpegvideoenc"
+mpeg2video_encoder_select="aandcttables mpegvideoenc h263dsp"
mpeg4_decoder_select="h263_decoder mpeg4video_parser"
mpeg4_encoder_select="h263_encoder"
msmpeg4v1_decoder_select="h263_decoder"
@@ -1923,10 +2105,12 @@ msmpeg4v2_encoder_select="h263_encoder"
msmpeg4v3_decoder_select="h263_decoder"
msmpeg4v3_encoder_select="h263_encoder"
mss2_decoder_select="error_resilience vc1_decoder"
-mxpeg_decoder_select="dsputil hpeldsp exif"
+mxpeg_decoder_select="mjpeg_decoder"
nellymoser_decoder_select="mdct sinewin"
nellymoser_encoder_select="audio_frame_queue mdct sinewin"
nuv_decoder_select="dsputil lzo"
+on2avc_decoder_select="mdct"
+opus_decoder_deps="swresample"
png_decoder_select="zlib"
png_encoder_select="dsputil zlib"
prores_decoder_select="dsputil"
@@ -1935,6 +2119,7 @@ qcelp_decoder_select="lsp"
qdm2_decoder_select="mdct rdft mpegaudiodsp"
ra_144_encoder_select="audio_frame_queue lpc"
ralf_decoder_select="golomb"
+rawvideo_decoder_select="dsputil"
rtjpeg_decoder_select="dsputil"
rv10_decoder_select="error_resilience h263_decoder h263dsp"
rv10_encoder_select="h263_encoder"
@@ -1946,19 +2131,19 @@ shorten_decoder_select="golomb"
sipr_decoder_select="lsp"
snow_decoder_select="dsputil dwt h264qpel hpeldsp rangecoder"
snow_encoder_select="aandcttables dsputil dwt h264qpel hpeldsp mpegvideoenc rangecoder"
-sonic_decoder_select="golomb"
-sonic_encoder_select="golomb"
-sonic_ls_encoder_select="golomb"
-sp5x_decoder_select="dsputil hpeldsp exif"
+sonic_decoder_select="golomb rangecoder"
+sonic_encoder_select="golomb rangecoder"
+sonic_ls_encoder_select="golomb rangecoder"
+sp5x_decoder_select="mjpeg_decoder"
svq1_decoder_select="hpeldsp"
svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
-svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel hpeldsp mpegvideo videodsp"
-svq3_decoder_suggest="error_resilience zlib"
+svq3_decoder_select="h264_decoder hpeldsp tpeldsp"
+svq3_decoder_suggest="zlib"
tak_decoder_select="dsputil"
theora_decoder_select="vp3_decoder"
+thp_decoder_select="mjpeg_decoder"
tiff_decoder_suggest="zlib"
tiff_encoder_suggest="zlib"
-thp_decoder_select="dsputil hpeldsp exif"
truehd_decoder_select="mlp_parser"
truemotion2_decoder_select="dsputil"
truespeech_decoder_select="dsputil"
@@ -1967,7 +2152,7 @@ twinvq_decoder_select="mdct lsp sinewin"
utvideo_decoder_select="dsputil"
utvideo_encoder_select="dsputil huffman"
vble_decoder_select="dsputil"
-vc1_decoder_select="error_resilience h263_decoder h264chroma h264qpel"
+vc1_decoder_select="error_resilience h263_decoder h264chroma h264qpel intrax8"
vc1image_decoder_select="vc1_decoder"
vorbis_decoder_select="mdct"
vorbis_encoder_select="mdct"
@@ -1976,6 +2161,7 @@ vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp"
vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp"
vp6a_decoder_select="vp6_decoder"
vp6f_decoder_select="vp6_decoder"
+vp7_decoder_select="h264pred videodsp"
vp8_decoder_select="h264pred videodsp"
vp9_decoder_select="videodsp"
webp_decoder_select="vp8_decoder"
@@ -1987,7 +2173,7 @@ wmav2_encoder_select="mdct sinewin"
wmavoice_decoder_select="lsp rdft dct mdct sinewin"
wmv1_decoder_select="h263_decoder"
wmv1_encoder_select="h263_encoder"
-wmv2_decoder_select="h263_decoder videodsp"
+wmv2_decoder_select="h263_decoder intrax8 videodsp"
wmv2_encoder_select="h263_encoder"
wmv3_decoder_select="vc1_decoder"
wmv3image_decoder_select="wmv3_decoder"
@@ -2004,6 +2190,7 @@ vaapi_deps="va_va_h"
vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
+xvmc_deps="X11_extensions_XvMClib_h"
h263_vaapi_hwaccel_deps="vaapi"
h263_vaapi_hwaccel_select="h263_decoder"
@@ -2018,16 +2205,22 @@ h264_vda_decoder_deps="vda"
h264_vda_decoder_select="h264_decoder"
h264_vda_hwaccel_deps="vda"
h264_vda_hwaccel_select="h264_decoder"
+h264_vda_old_hwaccel_deps="vda"
+h264_vda_old_hwaccel_select="h264_decoder"
h264_vdpau_decoder_deps="vdpau"
h264_vdpau_decoder_select="h264_decoder"
h264_vdpau_hwaccel_deps="vdpau"
h264_vdpau_hwaccel_select="h264_decoder"
mpeg_vdpau_decoder_deps="vdpau"
mpeg_vdpau_decoder_select="mpeg2video_decoder"
+mpeg_xvmc_hwaccel_deps="xvmc"
+mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
mpeg1_vdpau_decoder_deps="vdpau"
mpeg1_vdpau_decoder_select="mpeg1video_decoder"
mpeg1_vdpau_hwaccel_deps="vdpau"
mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
+mpeg1_xvmc_hwaccel_deps="xvmc"
+mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
mpeg2_crystalhd_decoder_select="crystalhd"
mpeg2_dxva2_hwaccel_deps="dxva2"
mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
@@ -2035,6 +2228,8 @@ mpeg2_vaapi_hwaccel_deps="vaapi"
mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
mpeg2_vdpau_hwaccel_deps="vdpau"
mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
+mpeg2_xvmc_hwaccel_deps="xvmc"
+mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
mpeg4_crystalhd_decoder_select="crystalhd"
mpeg4_vaapi_hwaccel_deps="vaapi"
mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
@@ -2059,9 +2254,9 @@ wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
# parsers
-h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
+h264_parser_select="h264_decoder"
hevc_parser_select="hevc_decoder"
-mpeg4video_parser_select="error_resilience mpegvideo"
+mpeg4video_parser_select="error_resilience h263dsp mpegvideo"
mpegvideo_parser_select="error_resilience mpegvideo"
vc1_parser_select="mpegvideo"
@@ -2114,8 +2309,10 @@ libvpx_vp8_encoder_deps="libvpx"
libvpx_vp9_decoder_deps="libvpx"
libvpx_vp9_encoder_deps="libvpx"
libwavpack_encoder_deps="libwavpack"
+libwebp_encoder_deps="libwebp"
libx264_encoder_deps="libx264"
libx264rgb_encoder_deps="libx264"
+libx265_encoder_deps="libx265"
libxavs_encoder_deps="libxavs"
libxvid_encoder_deps="libxvid"
libutvideo_decoder_deps="libutvideo"
@@ -2127,7 +2324,7 @@ ac3_demuxer_select="ac3_parser"
asf_demuxer_select="riffdec"
asf_muxer_select="riffenc"
asf_stream_muxer_select="asf_muxer"
-avi_demuxer_select="riffdec"
+avi_demuxer_select="riffdec exif"
avi_muxer_select="riffenc"
avisynth_demuxer_deps="avisynth"
avisynth_demuxer_select="riffdec"
@@ -2141,6 +2338,8 @@ f4v_muxer_select="mov_muxer"
flac_demuxer_select="flac_parser"
hds_muxer_select="flv_muxer"
hls_muxer_select="mpegts_muxer"
+image2_alias_pix_demuxer_select="image2_demuxer"
+image2_brender_pix_demuxer_select="image2_demuxer"
ipod_muxer_select="mov_muxer"
ismv_muxer_select="mov_muxer"
libnut_demuxer_deps="libnut"
@@ -2181,20 +2380,28 @@ wav_demuxer_select="riffdec"
wav_muxer_select="riffenc"
webm_muxer_select="riffenc"
wtv_demuxer_select="riffdec"
+wtv_muxer_select="riffenc"
xmv_demuxer_select="riffdec"
xwma_demuxer_select="riffdec"
# indevs / outdevs
alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
alsa_outdev_deps="alsa_asoundlib_h"
+avfoundation_indev_extralibs="-framework CoreVideo -framework Foundation -framework AVFoundation -framework CoreMedia"
+avfoundation_indev_select="avfoundation"
bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
caca_outdev_deps="libcaca"
+decklink_outdev_deps="decklink pthreads"
+decklink_outdev_extralibs="-lstdc++"
dshow_indev_deps="IBaseFilter"
dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
dv1394_indev_deps="dv1394"
dv1394_indev_select="dv_demuxer"
fbdev_indev_deps="linux_fb_h"
fbdev_outdev_deps="linux_fb_h"
+gdigrab_indev_deps="CreateDIBSection"
+gdigrab_indev_extralibs="-lgdi32"
+gdigrab_indev_select="bmp_decoder"
iec61883_indev_deps="libiec61883"
jack_indev_deps="jack_jack_h sem_timedwait"
lavfi_indev_deps="avfilter"
@@ -2202,10 +2409,13 @@ libcdio_indev_deps="libcdio"
libdc1394_indev_deps="libdc1394"
libv4l2_indev_deps="libv4l2"
openal_indev_deps="openal"
+opengl_outdev_deps="opengl"
oss_indev_deps_any="soundcard_h sys_soundcard_h"
oss_outdev_deps_any="soundcard_h sys_soundcard_h"
pulse_indev_deps="libpulse"
pulse_outdev_deps="libpulse"
+qtkit_indev_extralibs="-framework QTKit -framework Foundation -framework QuartzCore"
+qtkit_indev_select="qtkit"
sdl_outdev_deps="sdl"
sndio_indev_deps="sndio_h"
sndio_outdev_deps="sndio_h"
@@ -2227,8 +2437,8 @@ ffrtmphttp_protocol_deps="!librtmp_protocol"
ffrtmphttp_protocol_select="http_protocol"
ftp_protocol_select="tcp_protocol"
gopher_protocol_select="network"
-httpproxy_protocol_select="tcp_protocol"
http_protocol_select="tcp_protocol"
+httpproxy_protocol_select="tcp_protocol"
https_protocol_select="tls_protocol"
librtmp_protocol_deps="librtmp"
librtmpe_protocol_deps="librtmp"
@@ -2268,10 +2478,11 @@ atempo_filter_select="rdft"
azmq_filter_deps="libzmq"
blackframe_filter_deps="gpl"
boxblur_filter_deps="gpl"
+bs2b_filter_deps="libbs2b"
colormatrix_filter_deps="gpl"
cropdetect_filter_deps="gpl"
dctdnoiz_filter_deps="avcodec"
-dctdnoiz_filter_select="fft"
+dctdnoiz_filter_select="dct"
delogo_filter_deps="gpl"
deshake_filter_deps="avcodec"
deshake_filter_select="dsputil"
@@ -2295,7 +2506,6 @@ mpdecimate_filter_deps="gpl avcodec"
mptestsrc_filter_deps="gpl"
negate_filter_deps="lut_filter"
perspective_filter_deps="gpl"
-resample_filter_deps="avresample"
ocv_filter_deps="libopencv"
owdenoise_filter_deps="gpl"
pan_filter_deps="swresample"
@@ -2303,6 +2513,7 @@ phase_filter_deps="gpl"
pp_filter_deps="gpl postproc"
pullup_filter_deps="gpl"
removelogo_filter_deps="avcodec avformat swscale"
+resample_filter_deps="avresample"
sab_filter_deps="gpl swscale"
scale_filter_deps="swscale"
smartblur_filter_deps="gpl swscale"
@@ -2316,30 +2527,34 @@ super2xsai_filter_deps="gpl"
tinterlace_filter_deps="gpl"
vidstabdetect_filter_deps="libvidstab"
vidstabtransform_filter_deps="libvidstab"
-yadif_filter_deps="gpl"
pixfmts_super2xsai_test_deps="super2xsai_filter"
tinterlace_merge_test_deps="tinterlace_filter"
tinterlace_pad_test_deps="tinterlace_filter"
zmq_filter_deps="libzmq"
# examples
-decoding_encoding_example_deps="avcodec avutil"
+avio_reading="avformat avcodec avutil"
+avcodec_example_deps="avcodec avutil"
demuxing_decoding_example_deps="avcodec avformat avutil"
+filter_audio_example_deps="avfilter avutil"
filtering_audio_example_deps="avfilter avcodec avformat avutil"
filtering_video_example_deps="avfilter avcodec avformat avutil"
metadata_example_deps="avformat avutil"
muxing_example_deps="avcodec avformat avutil swscale"
+remuxing_example_deps="avcodec avformat avutil"
resampling_audio_example_deps="avutil swresample"
scaling_video_example_deps="avutil swscale"
transcode_aac_example_deps="avcodec avformat swresample"
+transcoding_example_deps="avfilter avcodec avformat avutil"
-# libraries
+# libraries, in linking order
avcodec_deps="avutil"
-avdevice_deps="avutil avcodec avformat"
+avdevice_deps="avformat avcodec avutil"
avfilter_deps="avutil"
-avformat_deps="avutil avcodec"
+avformat_deps="avcodec avutil"
avresample_deps="avutil"
postproc_deps="avutil gpl"
+swresample_deps="avutil"
swscale_deps="avutil"
# programs
@@ -2348,11 +2563,11 @@ ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
null_filter
setpts_filter trim_filter"
ffplay_deps="avcodec avformat swscale swresample sdl"
+ffplay_libs='$sdl_libs'
ffplay_select="rdft crop_filter"
ffprobe_deps="avcodec avformat"
ffserver_deps="avformat fork sarestart"
ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
-ffserver_extralibs='$ldl'
# documentation
podpages_deps="perl"
@@ -2386,21 +2601,25 @@ ln_s="ln -s -f"
nm_default="nm -g"
objformat="elf"
pkg_config_default=pkg-config
-ranlib="ranlib"
+ranlib_default="ranlib"
strip_default="strip"
yasmexe_default="yasm"
windres_default="windres"
nogas=":"
-# machine
-arch_default=$(uname -m)
-cpu="generic"
-
# OS
target_os_default=$(tolower $(uname -s))
host_os=$target_os_default
+# machine
+if test "$target_os_default" = aix; then
+ arch_default=$(uname -p)
+else
+ arch_default=$(uname -m)
+fi
+cpu="generic"
+
# configurable options
enable $PROGRAM_LIST
enable $DOCUMENT_LIST
@@ -2418,7 +2637,8 @@ enable static
enable swscale_alpha
# Enable hwaccels by default.
-enable dxva2 vaapi vdpau
+enable dxva2 vaapi vda vdpau xvmc
+enable xlib
# build settings
SHFLAGS='-shared -Wl,-soname,$$(@F)'
@@ -2450,11 +2670,10 @@ LD_O='-o $@'
LD_LIB='-l%'
LD_PATH='-L'
HOSTCC_C='-c'
+HOSTCC_E='-E -o $@'
HOSTCC_O='-o $@'
HOSTLD_O='-o $@'
-host_cflags='-O3 -g'
-host_cppflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600'
host_libs='-lm'
host_cflags_filter=echo
host_ldflags_filter=echo
@@ -2658,7 +2877,7 @@ cc_default="${cross_prefix}${cc_default}"
cxx_default="${cross_prefix}${cxx_default}"
nm_default="${cross_prefix}${nm_default}"
pkg_config_default="${cross_prefix}${pkg_config_default}"
-ranlib="${cross_prefix}${ranlib}"
+ranlib_default="${cross_prefix}${ranlib_default}"
strip_default="${cross_prefix}${strip_default}"
windres_default="${cross_prefix}${windres_default}"
@@ -2677,6 +2896,11 @@ case "$toolchain" in
add_cflags -fsanitize=thread -pie
add_ldflags -fsanitize=thread -pie
;;
+ clang-usan)
+ cc_default="clang"
+ add_cflags -fsanitize=undefined
+ add_ldflags -fsanitize=undefined
+ ;;
gcc-asan)
cc_default="gcc"
add_cflags -fsanitize=address
@@ -2687,6 +2911,11 @@ case "$toolchain" in
add_cflags -fsanitize=thread -pie -fPIC
add_ldflags -fsanitize=thread -pie -fPIC
;;
+ gcc-usan)
+ cc_default="gcc"
+ add_cflags -fsanitize=undefined
+ add_ldflags -fsanitize=undefined
+ ;;
valgrind-massif)
target_exec_default=${valgrind:-"valgrind"}
target_exec_args="--tool=massif --alloc-fn=av_malloc --alloc-fn=av_mallocz --alloc-fn=av_calloc --alloc-fn=av_fast_padded_malloc --alloc-fn=av_fast_malloc --alloc-fn=av_realloc_f --alloc-fn=av_fast_realloc --alloc-fn=av_realloc"
@@ -2731,7 +2960,7 @@ case "$toolchain" in
add_ldflags -fprofile-arcs -ftest-coverage
;;
hardened)
- add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all
+ add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all
add_ldflags -Wl,-z,relro -Wl,-z,now
;;
?*)
@@ -2739,7 +2968,7 @@ case "$toolchain" in
;;
esac
-set_default arch cc cxx pkg_config strip sysinclude target_exec target_os yasmexe
+set_default arch cc cxx pkg_config ranlib strip sysinclude target_exec target_os yasmexe
enabled cross_compile || host_cc_default=$cc
set_default host_cc
@@ -2789,6 +3018,7 @@ tmpfile TMPC .c
tmpfile TMPCPP .cpp
tmpfile TMPE $EXESUF
tmpfile TMPH .h
+tmpfile TMPM .m
tmpfile TMPO .o
tmpfile TMPS .S
tmpfile TMPSH .sh
@@ -2892,6 +3122,15 @@ icl_flags(){
done
}
+icc_flags(){
+ for flag; do
+ case $flag in
+ -flto) echo -ipo ;;
+ *) echo $flag ;;
+ esac
+ done
+}
+
pgi_flags(){
for flag; do
case $flag in
@@ -2920,10 +3159,16 @@ suncc_flags(){
prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
*-sse3) echo -xarch=sse3 ;;
core2) echo -xarch=ssse3 -xchip=core2 ;;
- corei7) echo -xarch=sse4_2 -xchip=nehalem ;;
- corei7-avx) echo -xarch=avx -xchip=sandybridge ;;
+ bonnell) echo -xarch=ssse3 ;;
+ corei7|nehalem) echo -xtarget=nehalem ;;
+ westmere) echo -xtarget=westmere ;;
+ silvermont) echo -xarch=sse4_2 ;;
+ corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
+ core-avx*|ivybridge|haswell|broadwell)
+ echo -xarch=avx ;;
amdfam10|barcelona) echo -xtarget=barcelona ;;
- bdver*) echo -xarch=avx ;;
+ btver1) echo -xarch=amdsse4a ;;
+ btver2|bdver*) echo -xarch=avx ;;
athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
k8|opteron|athlon64|athlon-fx)
echo -xarch=sse2a ;;
@@ -3007,6 +3252,7 @@ probe_cc(){
_cflags_speed='-O3'
_cflags_size='-Os'
_cflags_noopt='-O1'
+ _flags_filter=icc_flags
elif $_cc -v 2>&1 | grep -q xlc; then
_type=xlc
_ident=$($_cc -qversion 2>/dev/null | head -n1)
@@ -3019,10 +3265,10 @@ probe_cc(){
_cflags_speed='-fast'
_cflags_size='-O1'
_flags_filter=ccc_flags
- elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
+ elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
test -d "$sysroot" || die "No valid sysroot specified."
_type=armcc
- _ident=$($_cc --vsn | head -n1)
+ _ident=$($_cc --vsn | head -n1 | sed 's/.*: //')
armcc_conf="$PWD/armcc.conf"
$_cc --arm_linux_configure \
--arm_linux_config_file="$armcc_conf" \
@@ -3048,7 +3294,7 @@ probe_cc(){
elif $_cc -v 2>&1 | grep -q clang; then
_type=clang
_ident=$($_cc --version | head -n1)
- _depflags='-MMD'
+ _depflags='-MMD -MF $(@:.o=.d) -MT $@'
_cflags_speed='-O3'
_cflags_size='-Os'
elif $_cc -V 2>&1 | grep -q Sun; then
@@ -3094,8 +3340,8 @@ probe_cc(){
else
_ld_o='-Fe$@'
fi
- _cc_o='-Fo $@'
- _cc_e='-P -Fi $@'
+ _cc_o='-Fo$@'
+ _cc_e='-P -Fi$@'
_flags_filter=msvc_flags
_ld_lib='lib%.a'
_ld_path='-libpath:'
@@ -3125,9 +3371,9 @@ probe_cc(){
_ld_path='-libpath:'
# -Qdiag-error to make icl error when seeing certain unknown arguments
_flags='-nologo -Qdiag-error:4044,10157'
- # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency
+ # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
# with MSVC which enables it by default.
- _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS'
+ _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
if [ $pfx = hostcc ]; then
append _cflags -Dsnprintf=_snprintf
fi
@@ -3229,6 +3475,9 @@ if test -n "$sysroot"; then
gcc|llvm_gcc|clang)
add_cppflags --sysroot="$sysroot"
add_ldflags --sysroot="$sysroot"
+# On Darwin --sysroot may be ignored, -isysroot always affects headers and linking
+ add_cppflags -isysroot "$sysroot"
+ add_ldflags -isysroot "$sysroot"
;;
tms470)
add_cppflags -I"$sysinclude"
@@ -3422,6 +3671,8 @@ elif enabled mips; then
elif enabled ppc; then
+ disable ldbrx
+
case $(tolower $cpu) in
601|ppc601|powerpc601)
cpuflags="-mcpu=601"
@@ -3462,10 +3713,12 @@ elif enabled ppc; then
e500v2)
cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
disable altivec
+ disable dcbzl
;;
e500)
cpuflags="-mcpu=8540 -mhard-float"
disable altivec
+ disable dcbzl
;;
esac
@@ -3474,7 +3727,6 @@ elif enabled sparc; then
case $cpu in
cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
cpuflags="-mcpu=$cpu"
- disable vis
;;
ultrasparc*|niagara[234])
cpuflags="-mcpu=$cpu"
@@ -3494,7 +3746,8 @@ elif enabled x86; then
disable i686
;;
# targets that do support nopl and conditional mov (cmov)
- i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|corei7*|amdfam10|barcelona|atom|bdver*)
+ i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
+ |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|amdfam10|barcelona|b[dt]ver*)
cpuflags="-march=$cpu"
enable i686
enable fast_cmov
@@ -3537,8 +3790,10 @@ check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
#include <stdlib.h>
EOF
+add_host_cppflags -D_ISOC99_SOURCE
check_host_cflags -std=c99
check_host_cflags -Wall
+check_host_cflags -O3
check_64bit(){
arch32=$1
@@ -3564,6 +3819,10 @@ case "$arch" in
check_64bit ppc ppc64 'sizeof(void *) > 4'
spic=$shared
;;
+ s390)
+ check_64bit s390 s390x 'sizeof(void *) > 4'
+ spic=$shared
+ ;;
sparc)
check_64bit sparc sparc64 'sizeof(void *) > 4'
spic=$shared
@@ -3634,7 +3893,7 @@ case $target_os in
strip="strip -d"
;;
darwin)
- gas="gas-preprocessor.pl $cc"
+ test "${as#*gas-preprocessor.pl}" != "$as" || gas="${gas:=gas-preprocessor.pl} ${as:=$cc}"
enabled ppc && add_asflags -force_cpusubtype_ALL
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
@@ -3809,52 +4068,63 @@ esac
# determine libc flavour
-# uclibc defines __GLIBC__, so it needs to be checked before glibc.
-if check_cpp_condition features.h "defined __UCLIBC__"; then
- libc_type=uclibc
- add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
-elif check_cpp_condition features.h "defined __GLIBC__"; then
- libc_type=glibc
- add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
-# MinGW headers can be installed on Cygwin, so check for newlib first.
-elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
- libc_type=newlib
- add_cppflags -U__STRICT_ANSI__
-# MinGW64 is backwards compatible with MinGW32, so check for it first.
-elif check_cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
- libc_type=mingw64
- if check_cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
- add_compat msvcrt/snprintf.o
- add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
- else
- add_cppflags -D__USE_MINGW_ANSI_STDIO=1
+probe_libc(){
+ pfx=$1
+ pfx_no_=${pfx%_}
+ # uclibc defines __GLIBC__, so it needs to be checked before glibc.
+ if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
+ eval ${pfx}libc_type=uclibc
+ add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
+ elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
+ eval ${pfx}libc_type=glibc
+ add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
+ # MinGW headers can be installed on Cygwin, so check for newlib first.
+ elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
+ eval ${pfx}libc_type=newlib
+ add_${pfx}cppflags -U__STRICT_ANSI__
+ # MinGW64 is backwards compatible with MinGW32, so check for it first.
+ elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
+ eval ${pfx}libc_type=mingw64
+ if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
+ add_compat msvcrt/snprintf.o
+ add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
+ fi
+ add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
+ eval test \$${pfx_no_}cc_type = "gcc" &&
+ add_${pfx}cppflags -D__printf__=__gnu_printf__
+ elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
+ check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
+ eval ${pfx}libc_type=mingw32
+ check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
+ (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
+ die "ERROR: MinGW32 runtime version must be >= 3.15."
+ add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
+ eval test \$${pfx_no_}cc_type = "gcc" &&
+ add_${pfx}cppflags -D__printf__=__gnu_printf__
+ elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
+ eval ${pfx}libc_type=msvcrt
+ # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
+ # 0x601 by default unless something else is set by the user.
+ # This can easily lead to us detecting functions only present
+ # in such new versions and producing binaries requiring windows 7.0.
+ # Therefore explicitly set the default to XP unless the user has
+ # set something else on the command line.
+ check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
+ add_${pfx}cppflags -D_WIN32_WINNT=0x0502
+ elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
+ eval ${pfx}libc_type=klibc
+ elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
+ eval ${pfx}libc_type=bionic
+ elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
+ eval ${pfx}libc_type=solaris
+ add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
fi
- add_cppflags -U__STRICT_ANSI__
-elif check_cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
- libc_type=mingw32
- check_cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
- (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
- die "ERROR: MinGW32 runtime version must be >= 3.15."
- add_cppflags -U__STRICT_ANSI__
-elif check_cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
- libc_type=msvcrt
- # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
- # 0x601 by default unless something else is set by the user.
- # This can easily lead to us detecting functions only present
- # in such new versions and producing binaries requiring windows 7.0.
- # Therefore explicitly set the default to XP unless the user has
- # set something else on the command line.
- check_cpp_condition stdlib.h "defined(_WIN32_WINNT)" || add_cppflags -D_WIN32_WINNT=0x0502
-elif check_cpp_condition stddef.h "defined __KLIBC__"; then
- libc_type=klibc
-elif check_cpp_condition sys/cdefs.h "defined __BIONIC__"; then
- libc_type=bionic
-elif check_cpp_condition sys/brand.h "defined SOLARIS_BRAND_NAME"; then
- libc_type=solaris
- add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
-fi
+}
+probe_libc
test -n "$libc_type" && enable libc_$libc_type
+probe_libc host_
+test -n "$host_libc_type" && enable host_libc_$host_libc_type
case $libc_type in
bionic)
@@ -3882,6 +4152,9 @@ if enabled_all ccc libc_glibc; then
add_ldflags -Wl,-z,now # calls to libots crash without this
fi
+check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
+ add_cppflags '-I\$(SRC_PATH)/compat/float'
+
esc(){
echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
}
@@ -3904,10 +4177,6 @@ EOF
exit 1;
fi
-# backward compatibility layer for incompatible_libav/fork_abi
-enabled incompatible_fork_abi && enable incompatible_libav_abi
-enabled incompatible_libav_abi && enable incompatible_fork_abi
-
die_license_disabled() {
enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
}
@@ -3921,6 +4190,7 @@ die_license_disabled gpl libcdio
die_license_disabled gpl libutvideo
die_license_disabled gpl libvidstab
die_license_disabled gpl libx264
+die_license_disabled gpl libx265
die_license_disabled gpl libxavs
die_license_disabled gpl libxvid
die_license_disabled gpl libzvbi
@@ -3992,7 +4262,17 @@ od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
check_inline_asm inline_asm_labels '"1:\n"'
-if enabled alpha; then
+check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
+
+if enabled aarch64; then
+ enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
+ # internal assembler in clang 3.3 does not support this instruction
+ enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
+ enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
+
+ map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
+
+elif enabled alpha; then
check_cflags -mieee
@@ -4030,7 +4310,6 @@ EOF
$ARCH_EXT_LIST_ARM
check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
- check_inline_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
[ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
@@ -4056,7 +4335,7 @@ elif enabled parisc; then
elif enabled ppc; then
- enable local_aligned_8 local_aligned_16
+ enable local_aligned_8 local_aligned_16 local_aligned_32
check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
check_inline_asm ibm_asm '"add 0, 0, 0"'
@@ -4086,16 +4365,12 @@ EOF
enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
fi
-elif enabled sparc; then
-
- enabled vis && check_inline_asm vis '"pdist %f0, %f0, %f0"'
-
elif enabled x86; then
check_builtin rdtsc intrin.h "__rdtsc()"
check_builtin mm_empty mmintrin.h "_mm_empty()"
- enable local_aligned_8 local_aligned_16
+ enable local_aligned_8 local_aligned_16 local_aligned_32
# check whether EBP is available on x86
# As 'i' is stored on the stack, this program will crash
@@ -4114,6 +4389,9 @@ EOF
# check whether xmm clobbers are supported
check_inline_asm xmm_clobbers '"":::"%xmm0"'
+ check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
+ check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
+
# check whether binutils is new enough to compile SSSE3/MMXEXT
enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
@@ -4138,8 +4416,11 @@ EOF
check_yasm "movbe ecx, [5]" && enable yasm ||
die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx_external avresample
+ check_yasm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
+ check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
+ check_yasm "vfmadd132ps ymm0, ymm1, ymm2" || disable fma3_external
check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
- check_yasm "CPU amdnop" && enable cpunop
+ check_yasm "CPU amdnop" || disable cpunop
fi
case "$cpu" in
@@ -4170,18 +4451,21 @@ elif check_func dlopen -ldl; then
fi
if ! disabled network; then
- check_type "sys/types.h sys/socket.h" socklen_t
+ check_func getaddrinfo $network_extralibs
+ check_func getservbyport $network_extralibs
+ check_func inet_aton $network_extralibs
+
check_type netdb.h "struct addrinfo"
check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
- check_type netinet/in.h "struct sockaddr_in6"
check_type poll.h "struct pollfd"
- check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
- check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
check_type netinet/sctp.h "struct sctp_event_subscribe"
- check_func getaddrinfo $network_extralibs
- check_func getservbyport $network_extralibs
+ check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
+ check_type netinet/in.h "struct sockaddr_in6"
+ check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
+ check_type "sys/types.h sys/socket.h" socklen_t
+
# Prefer arpa/inet.h over winsock2
if check_header arpa/inet.h ; then
check_func closesocket
@@ -4189,72 +4473,74 @@ if ! disabled network; then
check_func_headers winsock2.h closesocket -lws2 &&
network_extralibs="-lws2" ||
{ check_func_headers winsock2.h closesocket -lws2_32 &&
- network_extralibs="-lws2_32"; }
+ network_extralibs="-lws2_32"; } || disable winsock2_h network
check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
+
check_type ws2tcpip.h socklen_t
check_type ws2tcpip.h "struct addrinfo"
check_type ws2tcpip.h "struct group_source_req"
check_type ws2tcpip.h "struct ip_mreq_source"
check_type ws2tcpip.h "struct ipv6_mreq"
check_type winsock2.h "struct pollfd"
+ check_struct winsock2.h "struct sockaddr" sa_len
check_type ws2tcpip.h "struct sockaddr_in6"
check_type ws2tcpip.h "struct sockaddr_storage"
- check_struct winsock2.h "struct sockaddr" sa_len
else
disable network
fi
fi
-# Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
-check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
+check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
+check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
+check_builtin MemoryBarrier windows.h "MemoryBarrier()"
+check_builtin sarestart signal.h "SA_RESTART"
+check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
+
+check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
+check_func ${malloc_prefix}memalign && enable memalign
+check_func ${malloc_prefix}posix_memalign && enable posix_memalign
check_func access
check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; }
check_func fcntl
check_func fork
-check_func_headers stdlib.h getenv
check_func gethrtime
check_func getopt
check_func getrusage
-check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
check_func gettimeofday
-check_func inet_aton $network_extralibs
check_func isatty
check_func localtime_r
-check_func ${malloc_prefix}memalign && enable memalign
+check_func mach_absolute_time
check_func mkstemp
check_func mmap
check_func mprotect
-check_func ${malloc_prefix}posix_memalign && enable posix_memalign
-check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
+# Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
+check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
+check_func sched_getaffinity
check_func setrlimit
check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
check_func strerror_r
-check_func sched_getaffinity
-check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
-check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
-check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
-check_builtin MemoryBarrier windows.h "MemoryBarrier()"
-check_builtin sarestart signal.h "SA_RESTART"
check_func sysconf
check_func sysctl
check_func usleep
+
check_func_headers conio.h kbhit
-check_func_headers windows.h PeekNamedPipe
check_func_headers io.h setmode
check_func_headers lzo/lzo1x.h lzo1x_999_compress
-check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
-check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
-check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
+check_func_headers stdlib.h getenv
+
+check_func_headers windows.h CoTaskMemFree -lole32
check_func_headers windows.h GetProcessAffinityMask
check_func_headers windows.h GetProcessTimes
check_func_headers windows.h GetSystemTimeAsFileTime
check_func_headers windows.h MapViewOfFile
+check_func_headers windows.h PeekNamedPipe
check_func_headers windows.h SetConsoleTextAttribute
check_func_headers windows.h Sleep
check_func_headers windows.h VirtualAlloc
check_func_headers glob.h glob
-check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
+enabled xlib &&
+ check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
check_header cl/cl.h
check_header direct.h
@@ -4263,6 +4549,7 @@ check_header dxva.h
check_header dxva2api.h -D_WIN32_WINNT=0x0600
check_header io.h
check_header libcrystalhd/libcrystalhd_if.h
+check_header mach/mach_time.h
check_header malloc.h
check_header poll.h
check_header sys/mman.h
@@ -4280,20 +4567,22 @@ check_header windows.h
check_header X11/extensions/XvMClib.h
check_header asm/types.h
-disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
-disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
+check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
+check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
+check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
+
+check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
if ! disabled w32threads && ! enabled pthreads; then
- check_func_headers "windows.h process.h" _beginthreadex && enable w32threads
+ check_func_headers "windows.h process.h" _beginthreadex &&
+ enable w32threads || disable w32threads
fi
# check for some common methods of building with pthread support
# do this before the optional library checks as some of them require pthreads
if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
enable pthreads
- if check_func pthread_join && check_func pthread_create; then
- :
- elif check_func pthread_join -pthread && check_func pthread_create -pthread; then
+ if check_func pthread_join -pthread && check_func pthread_create -pthread; then
add_cflags -pthread
add_extralibs -pthread
elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
@@ -4301,26 +4590,21 @@ if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
add_extralibs -pthreads
elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
add_extralibs -lpthreadGC2
- elif ! check_lib pthread.h pthread_join -lpthread && ! check_lib pthread.h pthread_create -lpthread; then
+ elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then
+ :
+ elif ! check_func pthread_join && ! check_func pthread_create; then
disable pthreads
fi
+ check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
fi
-for thread in $THREADS_LIST; do
- if enabled $thread; then
- test -n "$thread_type" &&
- die "ERROR: Only one thread type must be selected." ||
- thread_type="$thread"
- fi
-done
if enabled pthreads; then
check_func pthread_cancel
fi
-enabled sync_val_compare_and_swap && enable atomics_gcc
-enabled_all atomic_cas_ptr machine_rw_barrier && enable atomics_suncc
-enabled MemoryBarrier && enable atomics_win32
+disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
+disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
check_lib math.h sin -lm && LIBM="-lm"
disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
@@ -4334,17 +4618,19 @@ for func in $MATH_FUNCS; do
done
# these are off by default, so fail if requested and not available
+enabled avfoundation_indev && { check_header_oc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
{ check_lib2 "dlfcn.h" dlopen -ldl; } ||
die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
-enabled fontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
+enabled decklink && { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; }
enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
enabled libass && require_pkg_config libass ass/ass.h ass_library_init
-enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
+enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
+enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open
enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
@@ -4353,6 +4639,8 @@ enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersio
enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
+enabled fontconfig && enable libfontconfig
+enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
enabled libfreetype && require_libfreetype
enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++
enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
@@ -4365,8 +4653,8 @@ enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
-enabled libopenjpeg && { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg ||
- check_lib openjpeg.h opj_version -lopenjpeg ||
+enabled libopenjpeg && { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
+ check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
die "ERROR: libopenjpeg not found"; }
enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
@@ -4386,7 +4674,7 @@ enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame
die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
-enabled libvidstab && require_pkg_config vidstab vid.stab/libvidstab.h vsMotionDetectInit
+enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
@@ -4396,11 +4684,15 @@ enabled libvpx && {
enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
die "ERROR: libvpx encoder version must be >=0.9.7"; }
enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
- enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx" -lvpx || disable libvpx_vp9_encoder; } }
+ enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_SVC" -lvpx || disable libvpx_vp9_encoder; } }
enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
+enabled libwebp && require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion
enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
die "ERROR: libx264 must be installed and version must be >= 0.118."; }
+enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
+ { check_cpp_condition x265.h "X265_BUILD >= 13" ||
+ die "ERROR: libx265 version must be >= 13."; }
enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
@@ -4413,15 +4705,20 @@ enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lO
enabled opencl && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
die "ERROR: opencl not found"; } &&
- { ! enabled_any w32threads os2threads ||
- die "opencl currently needs --enable-pthreads or --disable-w32threads"; } &&
{ check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
+enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
+ check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
+ check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
+ check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
+ die "ERROR: opengl not found."
+ }
enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
+enabled qtkit_indev && { check_header_oc QTKit/QTKit.h || disable qtkit_indev; }
if enabled gnutls; then
{ check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
@@ -4508,13 +4805,26 @@ if enabled libcdio; then
die "ERROR: libcdio-paranoia not found"
fi
-check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib
+enabled xlib &&
+ check_lib X11/Xlib.h XOpenDisplay -lX11 || disable xlib
enabled x11grab &&
require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes &&
{ enabled xlib || die "ERROR: Xlib not found"; }
+check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
+
+enabled dxva2api_h &&
+ check_cc <<EOF && enable dxva2api_cobj
+#define _WIN32_WINNT 0x0600
+#define COBJMACROS
+#include <windows.h>
+#include <d3d9.h>
+#include <dxva2api.h>
+int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
+EOF
+
enabled vaapi &&
check_lib va/va.h vaInitialize -lva ||
disable vaapi
@@ -4524,7 +4834,8 @@ enabled vdpau &&
disable vdpau
enabled vdpau && enabled xlib &&
- check_lib2 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
+ check_func_headers "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
+ prepend ffmpeg_libs $($ldflags_filter "-lvdpau") &&
enable vdpau_x11
# Funny iconv installations are not unusual, so check it after all flags have been set
@@ -4544,6 +4855,7 @@ check_cflags -Wundef
check_cflags -Wmissing-prototypes
check_cflags -Wno-pointer-to-int-cast
check_cflags -Wstrict-prototypes
+check_cflags -Wempty-body
enabled extra_warnings && check_cflags -Winline
check_disable_warning(){
@@ -4559,13 +4871,25 @@ check_disable_warning -Wno-pointer-sign
# add some linker flags
check_ldflags -Wl,--warn-common
check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
-enabled rpath && add_ldflags -Wl,-rpath=$libdir
+enabled rpath && add_ldflags -Wl,-rpath,$libdir
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
# add some strip flags
# -wN '..@*' is more selective than -x, but not available everywhere.
check_stripflags -wN \'..@*\' || check_stripflags -x
+enabled neon_clobber_test &&
+ check_ldflags -Wl,--wrap,avcodec_open2 \
+ -Wl,--wrap,avcodec_decode_audio4 \
+ -Wl,--wrap,avcodec_decode_video2 \
+ -Wl,--wrap,avcodec_decode_subtitle2 \
+ -Wl,--wrap,avcodec_encode_audio2 \
+ -Wl,--wrap,avcodec_encode_video2 \
+ -Wl,--wrap,avcodec_encode_subtitle \
+ -Wl,--wrap,swr_convert \
+ -Wl,--wrap,avresample_convert ||
+ disable neon_clobber_test
+
enabled xmm_clobber_test &&
check_ldflags -Wl,--wrap,avcodec_open2 \
-Wl,--wrap,avcodec_decode_audio4 \
@@ -4575,6 +4899,8 @@ enabled xmm_clobber_test &&
-Wl,--wrap,avcodec_encode_video \
-Wl,--wrap,avcodec_encode_video2 \
-Wl,--wrap,avcodec_encode_subtitle \
+ -Wl,--wrap,swr_convert \
+ -Wl,--wrap,avresample_convert \
-Wl,--wrap,sws_scale ||
disable xmm_clobber_test
@@ -4611,6 +4937,7 @@ if enabled lto; then
test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
check_cflags -flto
check_ldflags -flto $cpuflags
+ disable inline_asm_direct_symbol_refs
fi
check_optflags $optflags
@@ -4641,6 +4968,8 @@ if enabled icc; then
check_ldflags -wd10156,11030
# icc 11.0 and 11.1 work with ebp_available, but don't pass the test
enable ebp_available
+ # The test above does not test linking
+ enabled lto && disable symver_asm_label
if enabled x86_32; then
icc_version=$($cc -dumpversion)
test ${icc_version%%.*} -ge 11 &&
@@ -4672,6 +5001,8 @@ elif enabled cparser; then
add_cflags -Wno-missing-variable-declarations
add_cflags -Wno-empty-statement
elif enabled armcc; then
+ add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
+ add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
# 2523: use of inline assembler is deprecated
add_cflags -W${armcc_opt},--diag_suppress=2523
add_cflags -W${armcc_opt},--diag_suppress=1207
@@ -4681,6 +5012,7 @@ elif enabled armcc; then
add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
elif enabled tms470; then
add_cflags -pds=824 -pds=837
+ disable inline_asm
elif enabled pathscale; then
add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
elif enabled_any msvc icl; then
@@ -4693,13 +5025,28 @@ elif enabled_any msvc icl; then
# (correctly) on icl 13.x.
check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
add_cflags -Qansi-alias
- # icl will pass the inline asm tests but inline asm is currently
- # not supported (build will fail)
- disabled inline_asm || warn "inline asm disabled due to issues with it in ICL"
- disable inline_asm
+ # Some inline asm is not compilable in debug
+ if enabled debug; then
+ disable ebp_available
+ disable ebx_available
+ fi
fi
+ # msvcrt10 x64 incorrectly enables log2, only msvcrt12 onwards actually has log2.
+ check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
fi
+case $as_type in
+ clang)
+ add_asflags -Qunused-arguments
+ ;;
+esac
+
+case $ld_type in
+ clang)
+ check_ldflags -Qunused-arguments
+ ;;
+esac
+
case $target_os in
osf1)
enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
@@ -4710,10 +5057,6 @@ case $target_os in
esac
enable frame_thread_encoder
-enabled_any $THREADS_LIST && enable threads
-enabled_any $ATOMICS_LIST && enable atomics_native
-
-enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pthread threading without atomics not supported, try adding --enable-pthreads or --cpu=i486 or higher if you are on x86"
enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
@@ -4722,12 +5065,18 @@ check_deps $CONFIG_LIST \
$HAVE_LIST \
$ALL_COMPONENTS \
+enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pthread threading without atomics not supported, try adding --enable-pthreads or --cpu=i486 or higher if you are on x86"
+
if test $target_os = "haiku"; then
disable memalign
disable posix_memalign
fi
+enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
+ prepend ffmpeg_libs $($ldflags_filter "-lole32") &&
+ enable dxva2_lib
+
! enabled_any memalign posix_memalign aligned_malloc &&
enabled_any $need_memalign && enable memalign_hack
@@ -4758,13 +5107,61 @@ merge_deps() {
merge_deps libavfilter $FILTER_LIST
+for thread in $THREADS_LIST; do
+ if enabled $thread; then
+ test -n "$thread_type" &&
+ die "ERROR: Only one thread type must be selected." ||
+ thread_type="$thread"
+ fi
+done
+
+# conditional library dependencies, in linking order
+enabled aconvert_filter && prepend avfilter_deps "swresample"
+enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
+enabled aresample_filter && prepend avfilter_deps "swresample"
+enabled asyncts_filter && prepend avfilter_deps "avresample"
+enabled atempo_filter && prepend avfilter_deps "avcodec"
+enabled decimate_filter && prepend avfilter_deps "avcodec"
+enabled deshake_filter && prepend avfilter_deps "avcodec"
+enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
+enabled elbg_filter && prepend avfilter_deps "avcodec"
+enabled mcdeint_filter && prepend avfilter_deps "avcodec"
+enabled movie_filter && prepend avfilter_deps "avformat avcodec"
+enabled mp_filter && prepend avfilter_deps "avcodec"
+enabled pan_filter && prepend avfilter_deps "swresample"
+enabled pp_filter && prepend avfilter_deps "postproc"
+enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
+enabled resample_filter && prepend avfilter_deps "avresample"
+enabled sab_filter && prepend avfilter_deps "swscale"
+enabled scale_filter && prepend avfilter_deps "swscale"
+enabled showspectrum_filter && prepend avfilter_deps "avcodec"
+enabled smartblur_filter && prepend avfilter_deps "swscale"
+enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
+
+enabled lavfi_indev && prepend avdevice_deps "avfilter"
+
+enabled opus_decoder && prepend avcodec_deps "swresample"
+
+expand_deps(){
+ lib_deps=${1}_deps
+ eval "deps=\$$lib_deps"
+ append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
+ unique $lib_deps
+}
+
+#we have to remove gpl from the deps here as some code assumes all lib deps are libs
+postproc_deps="$(filter_out 'gpl' $postproc_deps)"
+
+map 'expand_deps $v' $LIBRARY_LIST
+
echo "install prefix $prefix"
echo "source path $source_path"
echo "C compiler $cc"
+echo "C library $libc_type"
if test "$host_cc" != "$cc"; then
echo "host C compiler $host_cc"
+ echo "host C library $host_libc_type"
fi
-echo "C library $libc_type"
echo "ARCH $arch ($cpu)"
if test "$build_suffix" != ""; then
echo "build suffix $build_suffix"
@@ -4786,12 +5183,18 @@ if enabled x86; then
echo "SSE enabled ${sse-no}"
echo "SSSE3 enabled ${ssse3-no}"
echo "AVX enabled ${avx-no}"
+ echo "XOP enabled ${xop-no}"
+ echo "FMA3 enabled ${fma3-no}"
echo "FMA4 enabled ${fma4-no}"
echo "i686 features enabled ${i686-no}"
echo "CMOV is fast ${fast_cmov-no}"
echo "EBX available ${ebx_available-no}"
echo "EBP available ${ebp_available-no}"
fi
+if enabled aarch64; then
+ echo "NEON enabled ${neon-no}"
+ echo "VFP enabled ${vfp-no}"
+fi
if enabled arm; then
echo "ARMv5TE enabled ${armv5te-no}"
echo "ARMv6 enabled ${armv6-no}"
@@ -4811,9 +5214,6 @@ if enabled ppc; then
echo "PPC 4xx optimizations ${ppc4xx-no}"
echo "dcbzl available ${dcbzl-no}"
fi
-if enabled sparc; then
- echo "VIS enabled ${vis-no}"
-fi
echo "debug symbols ${debug-no}"
echo "strip symbols ${stripping-no}"
echo "optimize for size ${small-no}"
@@ -4960,7 +5360,6 @@ HOSTLD_O=$HOSTLD_O
TARGET_EXEC=$target_exec $target_exec_args
TARGET_PATH=$target_path
TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
-LIBS-ffplay=$sdl_libs
CFLAGS-ffplay=$sdl_cflags
ZLIB=$($ldflags_filter -lz)
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
@@ -4987,6 +5386,7 @@ get_version(){
name=$(toupper $lcname)
file=$source_path/$lcname/version.h
eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
+ enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
@@ -4995,13 +5395,22 @@ get_version(){
map 'get_version $v' $LIBRARY_LIST
+map 'eval echo "FFLIBS-${v}=\$${v}_deps" >> config.mak' $LIBRARY_LIST
+
+print_program_libs(){
+ eval "program_libs=\$${1}_libs"
+ eval echo "LIBS-${1}=${program_libs}" >> config.mak
+}
+
+map 'print_program_libs $v' $PROGRAM_LIST
+
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 CONFIG_THIS_YEAR 2013
+#define CONFIG_THIS_YEAR 2014
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
@@ -5064,13 +5473,18 @@ fi
# build pkg-config files
+lib_version(){
+ eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \""
+}
+
pkgconfig_generate(){
name=$1
shortname=${name#lib}${build_suffix}
comment=$2
version=$3
libs=$4
- requires=$5
+ requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
+ requires=${requires%, }
enabled ${name#lib} || return 0
mkdir -p $name
cat <<EOF > $name/$name${build_suffix}.pc
@@ -5109,47 +5523,12 @@ Cflags: -I\${includedir}
EOF
}
-lavfi_libs="libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-enabled libavfilter_deps_avcodec && prepend lavfi_libs "libavcodec${build_suffix} = $LIBAVCODEC_VERSION,"
-enabled libavfilter_deps_avformat && prepend lavfi_libs "libavformat${build_suffix} = $LIBAVFORMAT_VERSION,"
-enabled libavfilter_deps_avresample && prepend lavfi_libs "libavresample${build_suffix} = $LIBAVRESAMPLE_VERSION,"
-enabled libavfilter_deps_swscale && prepend lavfi_libs "libswscale${build_suffix} = $LIBSWSCALE_VERSION,"
-enabled libavfilter_deps_swresample && prepend lavfi_libs "libswresample${build_suffix} = $LIBSWRESAMPLE_VERSION,"
-enabled libavfilter_deps_postproc && prepend lavfi_libs "libpostproc${build_suffix} = $LIBPOSTPROC_VERSION,"
-lavfi_libs=${lavfi_libs%, }
-
-lavd_libs="libavformat${build_suffix} = $LIBAVFORMAT_VERSION"
-enabled lavfi_indev && prepend lavd_libs "libavfilter${build_suffix} = $LIBAVFILTER_VERSION,"
-
pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
-pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec${build_suffix} = $LIBAVCODEC_VERSION"
-pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$lavd_libs"
-pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$lavfi_libs"
-pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-
-fix_ffmpeg_remote(){
- git_remote_from=$1
- git_remote_to=$2
- fixme_remote=$(git --git-dir=$source_path/.git --work-tree=$source_path remote -v | grep $git_remote_from | cut -f 1 | sort | uniq)
- if [ "$fixme_remote" != "" ]; then
- echolog "
-Outdated domain in git config, the official domain for ffmpeg git is since
-November 2011, source.ffmpeg.org, both the old and the new point to the same
-repository and server. To update it enter the following commands:
-"
- for remote in $fixme_remote; do
- echolog "git remote set-url $remote $git_remote_to"
- done
- fi
-}
-
-if test -f "$source_path/.git/config"; then
- remote_from=git.videolan.org
- remote_to=source.ffmpeg.org
- fix_ffmpeg_remote git@$remote_from:ffmpeg git@$remote_to:ffmpeg
- fix_ffmpeg_remote git://$remote_from/ffmpeg git://$remote_to/ffmpeg
-fi
+pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
+pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
+pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
+pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
+pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
+pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
+pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
+pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"
diff --git a/chromium/third_party/ffmpeg/doc/APIchanges b/chromium/third_party/ffmpeg/doc/APIchanges
index c3f4c6bfd74..4137775fc17 100644
--- a/chromium/third_party/ffmpeg/doc/APIchanges
+++ b/chromium/third_party/ffmpeg/doc/APIchanges
@@ -4,7 +4,7 @@ since the last major version increase or the API was added.
The last version increases were:
libavcodec: 2013-03-xx
libavdevice: 2013-03-xx
-libavfilter: 2012-06-22
+libavfilter: 2013-12-xx
libavformat: 2013-03-xx
libavresample: 2012-10-05
libpostproc: 2011-04-18
@@ -14,77 +14,267 @@ libavutil: 2012-10-22
API changes, most recent first:
-2013-12-xx - xxxxxxx - lavu 52.57.100 - opencl.h
+
+2014-05-xx - xxxxxxx - lavf 55.17.0 - avformat.h
+ Add AVMFT_FLAG_BITEXACT flag. Muxers now use it instead of checking
+ CODEC_FLAG_BITEXACT on the first stream.
+
+2014-05-15 - xxxxxxx - lswr 0.19.100 - swresample.h
+ Add swr_close()
+
+2014-xx-xx - xxxxxxx - lavu 53.14.0 - pixfmt.h
+ Add AV_PIX_FMT_VDA for new-style VDA acceleration.
+
+2014-05-xx - xxxxxxx - lavu 52.82.0 - fifo.h
+ Add av_fifo_freep() function.
+
+2014-05-02 - ba52fb11 - lavu 52.81.0 - opt.h
+ Add av_opt_set_dict2() function.
+
+2014-04-xx - e77b985 / a2941c8 - lavc 55.60.103 / 55.50.3 - avcodec.h
+ Deprecate CODEC_FLAG_MV0. It is replaced by the flag "mv0" in the
+ "mpv_flags" private option of the mpegvideo encoders.
+
+2014-04-xx - e40ae8c / 6484149 - lavc 55.60.102 / 55.50.2 - avcodec.h
+ Deprecate CODEC_FLAG_GMC. It is replaced by the "gmc" private option of the
+ libxvid encoder.
+
+2014-04-xx - 1851643 / b2c3171 - lavc 55.60.101 / 55.50.1 - avcodec.h
+ Deprecate CODEC_FLAG_NORMALIZE_AQP. It is replaced by the flag "naq" in the
+ "mpv_flags" private option of the mpegvideo encoders.
+
+2014-04-xx - xxxxxxx - avcodec.h
+ Deprecate CODEC_FLAG_INPUT_PRESERVED. Its functionality is replaced by passing
+ reference-counted frames to encoders.
+
+2014-04-29 - 1bf6396 - lavc 55.60.100 - avcodec.h
+ Add AVCodecDescriptor.mime_types field.
+
+2014-04-29 - xxxxxxx - lavu 52.80.0 - hash.h
+ Add av_hash_final_bin(), av_hash_final_hex() and av_hash_final_b64().
+
+2014-03-07 - 8b2a130 - lavc 55.50.0 / 55.53.100 - dxva2.h
+ Add FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO for old Intel GPUs.
+
+2014-04-22 - dac7e8a - lavu 53.13.0 / 52.78.100 - avutil.h
+ Add av_get_time_base_q().
+
+2014-04-xx - xxxxxxx - lavu 53.12.0 / 52.77.100 - crc.h
+ Add AV_CRC_16_ANSI_LE crc variant.
+
+2014-04-XX - xxxxxxx - lavf xx.xx.1xx - avformat.h
+ Add av_format_inject_global_side_data()
+
+2014-04-12 - 4f698be - lavu 52.76.100 - log.h
+ Add av_log_get_flags()
+
+2014-04-11 - 6db42a2b - lavd 55.12.100 - avdevice.h
+ Add avdevice_capabilities_create() function.
+ Add avdevice_capabilities_free() function.
+
+2014-04-07 - 0a1cc04 / 8b17243 - lavu 52.75.100 / 53.11.0 - pixfmt.h
+ Add AV_PIX_FMT_YVYU422 pixel format.
+
+2014-04-04 - c1d0536 / 8542f9c - lavu 52.74.100 / 53.10.0 - replaygain.h
+ Full scale for peak values is now 100000 (instead of UINT32_MAX) and values
+ may overflow.
+
+2014-04-03 - c16e006 / 7763118 - lavu 52.73.100 / 53.9.0 - log.h
+ Add AV_LOG(c) macro to have 256 color debug messages.
+
+2014-04-03 - eaed4da9 - lavu 52.72.100 - opt.h
+ Add AV_OPT_MULTI_COMPONENT_RANGE define to allow return
+ multi-component option ranges.
+
+2014-03-29 - cd50a44b - lavu 52.70.100 - mem.h
+ Add av_dynarray_add_nofree() function.
+
+2014-02-xx - 3e1f241 / d161ae0 - lavu 52.69.100 / 53.8.0 - frame.h
+ Add av_frame_remove_side_data() for removing a single side data
+ instance from a frame.
+
+2014-02-xx - 83e8978 / 5a7e35d - lavu 52.68.100 / 53.7.0 - frame.h, replaygain.h
+ Add AV_FRAME_DATA_REPLAYGAIN for exporting replaygain tags.
+ Add a new header replaygain.h with the AVReplayGain struct.
+
+2014-02-xx - 83e8978 / 5a7e35d - lavc 55.54.100 / 55.36.0 - avcodec.h
+ Add AV_PKT_DATA_REPLAYGAIN for exporting replaygain tags.
+
+2014-02-xx - 595ba3b / 25b3258 - lavf 55.35.100 / 55.13.0 - avformat.h
+ Add AVStream.side_data and AVStream.nb_side_data for exporting stream-global
+ side data (e.g. replaygain tags, video rotation)
+
+2014-02-xx - bd34e26 / 0e2c3ee - lavc 55.53.100 / 55.35.0 - avcodec.h
+ Give the name AVPacketSideData to the previously anonymous struct used for
+ AVPacket.side_data.
+
+2014-03-18 - 37c07d4 - lsws 2.5.102
+ Make gray16 full-scale.
+
+2014-03-16 - 6b1ca17 / 1481d24 - lavu 52.67.100 / 53.6.0 - pixfmt.h
+ Add RGBA64_LIBAV pixel format and variants for compatibility
+
+2014-03-11 - 3f3229c - lavf 55.34.101 - avformat.h
+ Set AVFormatContext.start_time_realtime when demuxing.
+
+2014-03-03 - 06fed440 - lavd 55.11.100 - avdevice.h
+ Add av_input_audio_device_next().
+ Add av_input_video_device_next().
+ Add av_output_audio_device_next().
+ Add av_output_video_device_next().
+
+2014-02-24 - fff5262 / 1155fd0 - lavu 52.66.100 / 53.5.0 - frame.h
+ Add av_frame_copy() for copying the frame data.
+
+2014-02-24 - a66be60 - lswr 0.18.100 - swresample.h
+ Add swr_is_initialized() for checking whether a resample context is initialized.
+
+2014-02-22 - 5367c0b / 7e86c27 - lavr 1.2.0 - avresample.h
+ Add avresample_is_open() for checking whether a resample context is open.
+
+2014-02-19 - 6a24d77 / c3ecd96 - lavu 52.65.100 / 53.4.0 - opt.h
+ Add AV_OPT_FLAG_EXPORT and AV_OPT_FLAG_READONLY to mark options meant (only)
+ for reading.
+
+2014-02-19 - f4c8d00 / 6bb8720 - lavu 52.64.101 / 53.3.1 - opt.h
+ Deprecate unused AV_OPT_FLAG_METADATA.
+
+2014-02-xx - xxxxxxx - lavd 55.10.100 - avdevice.h
+ Add avdevice_list_devices() and avdevice_free_list_devices()
+
+2014-02-16 - db3c970 - lavf 55.33.100 - avio.h
+ Add avio_find_protocol_name() to find out the name of the protocol that would
+ be selected for a given URL.
+
+2014-02-15 - a2bc6c1 / c98f316 - lavu 52.64.100 / 53.3.0 - frame.h
+ Add AV_FRAME_DATA_DOWNMIX_INFO value to the AVFrameSideDataType enum and
+ downmix_info.h API, which identify downmix-related metadata.
+
+2014-02-11 - 1b05ac2 - lavf 55.32.100 - avformat.h
+ Add av_write_uncoded_frame() and av_interleaved_write_uncoded_frame().
+
+2014-02-04 - 3adb5f8 / d9ae103 - lavf 55.30.100 / 55.11.0 - avformat.h
+ Add AVFormatContext.max_interleave_delta for controlling amount of buffering
+ when interleaving.
+
+2014-02-02 - 5871ee5 - lavf 55.29.100 - avformat.h
+ Add output_ts_offset muxing option to AVFormatContext.
+
+2014-01-27 - 102bd64 - lavd 55.7.100 - avdevice.h
+ lavf 55.28.100 - avformat.h
+ Add avdevice_dev_to_app_control_message() function.
+
+2014-01-27 - 7151411 - lavd 55.6.100 - avdevice.h
+ lavf 55.27.100 - avformat.h
+ Add avdevice_app_to_dev_control_message() function.
+
+2014-01-24 - 86bee79 - lavf 55.26.100 - avformat.h
+ Add AVFormatContext option metadata_header_padding to allow control over the
+ amount of padding added.
+
+2014-01-20 - eef74b2 / 93c553c - lavc 55.48.102 / 55.32.1 - avcodec.h
+ Edges are not required anymore on video buffers allocated by get_buffer2()
+ (i.e. as if the CODEC_FLAG_EMU_EDGE flag was always on). Deprecate
+ CODEC_FLAG_EMU_EDGE and avcodec_get_edge_width().
+
+2014-01-19 - 1a193c4 - lavf 55.25.100 - avformat.h
+ Add avformat_get_mov_video_tags() and avformat_get_mov_audio_tags().
+
+2014-01-19 - xxxxxxx - lavu 52.63.100 - rational.h
+ Add av_make_q() function.
+
+2014-01-05 - 4cf4da9 / 5b4797a - lavu 52.62.100 / 53.2.0 - frame.h
+ Add AV_FRAME_DATA_MATRIXENCODING value to the AVFrameSideDataType enum, which
+ identifies AVMatrixEncoding data.
+
+2014-01-05 - 751385f / 5c437fb - lavu 52.61.100 / 53.1.0 - channel_layout.h
+ Add values for various Dolby flags to the AVMatrixEncoding enum.
+
+2014-01-04 - b317f94 - lavu 52.60.100 - mathematics.h
+ Add av_add_stable() function.
+
+2013-12-22 - 911676c - lavu 52.59.100 - avstring.h
+ Add av_strnlen() function.
+
+2013-12-09 - 64f73ac - lavu 52.57.100 - opencl.h
Add av_opencl_benchmark() function.
-2013-11-xx - xxxxxxx - lavu 52.56.100 - ffversion.h
+2013-11-30 - 82b2e9c - lavu 52.56.100 - ffversion.h
Moves version.h to libavutil/ffversion.h.
Install ffversion.h and make it public.
-2013-11-xx - xxxxxxx- - lavu 52.20.0 - frame.h
+2013-12-11 - 29c83d2 / b9fb59d,409a143 / 9431356,44967ab / d7b3ee9 - lavc 55.45.101 / 55.28.1 - avcodec.h
+ av_frame_alloc(), av_frame_unref() and av_frame_free() now can and should be
+ used instead of avcodec_alloc_frame(), avcodec_get_frame_defaults() and
+ avcodec_free_frame() respectively. The latter three functions are deprecated.
+
+2013-12-09 - 7a60348 / 7e244c6- - lavu 52.58.100 / 52.20.0 - frame.h
Add AV_FRAME_DATA_STEREO3D value to the AVFrameSideDataType enum and
stereo3d.h API, that identify codec-independent stereo3d information.
-2013-11-xx - xxxxxxx- - lavu 52.19.0 - frame.h
+2013-11-26 - 625b290 / 1eaac1d- - lavu 52.55.100 / 52.19.0 - frame.h
Add AV_FRAME_DATA_A53_CC value to the AVFrameSideDataType enum, which
identifies ATSC A53 Part 4 Closed Captions data.
-2013-11-XX - xxxxxxx - lavu 52.54.100 - avstring.h
+2013-11-22 - 6859065 - lavu 52.54.100 - avstring.h
Add av_utf8_decode() function.
-2013-11-xx - xxxxxxx - lavc 55.44.100 - avcodec.h
+2013-11-22 - fb7d70c - lavc 55.44.100 - avcodec.h
+ Add HEVC profiles
+
+2013-11-20 - c28b61c - lavc 55.44.100 - avcodec.h
Add av_packet_{un,}pack_dictionary()
Add AV_PKT_METADATA_UPDATE side data type, used to transmit key/value
strings between a stream and the application.
-2013-11-xx - xxxxxxx - lavu 52.18.0 - mem.h
+2013-11-14 - 7c888ae / cce3e0a - lavu 52.53.100 / 52.18.0 - mem.h
Move av_fast_malloc() and av_fast_realloc() for libavcodec to libavutil.
-2013-10-xx - xxxxxxx - lavc 55.27.0 - avcodec.h
+2013-11-14 - b71e4d8 / 8941971 - lavc 55.43.100 / 55.27.0 - avcodec.h
Deprecate AVCodecContext.error_rate, it is replaced by the 'error_rate'
private option of the mpegvideo encoder family.
-2013-11-xx - xxxxxxx - lavc 55.26.0 - vdpau.h
+2013-11-14 - 31c09b7 / 728c465 - lavc 55.42.100 / 55.26.0 - vdpau.h
Add av_vdpau_get_profile().
Add av_vdpau_alloc_context(). This function must from now on be
used for allocating AVVDPAUContext.
-2013-11-xx - xxxxxxx - lavc 55.41.100 / 55.25.0 - avcodec.h
+2013-11-04 - be41f21 / cd8f772 - lavc 55.41.100 / 55.25.0 - avcodec.h
lavu 52.51.100 - frame.h
Add ITU-R BT.2020 and other not yet included values to color primaries,
transfer characteristics and colorspaces.
-2013-11-04 - xxxxxxx - lavu 52.50.100 - avutil.h
+2013-11-04 - 85cabf1 - lavu 52.50.100 - avutil.h
Add av_fopen_utf8()
-2013-08-xx - xxxxxxx - lavu 52.17.0 - avframe.h
+2013-10-31 - 78265fc / 28096e0 - lavu 52.49.100 / 52.17.0 - frame.h
Add AVFrame.flags and AV_FRAME_FLAG_CORRUPT.
-2013-10-27 - xxxxxxx - lavc 55.39.100 - avcodec.h
+2013-10-27 - dbe6f9f - lavc 55.39.100 - avcodec.h
Add CODEC_CAP_DELAY support to avcodec_decode_subtitle2.
-2013-10-27 - xxxxxxx - lavu 52.48.100 - parseutils.h
+2013-10-27 - d61617a - lavu 52.48.100 - parseutils.h
Add av_get_known_color_name().
-2013-10-17 - xxxxxxx - lavu 52.47.100 - opt.h
+2013-10-17 - 8696e51 - lavu 52.47.100 - opt.h
Add AV_OPT_TYPE_CHANNEL_LAYOUT and channel layout option handlers
av_opt_get_channel_layout() and av_opt_set_channel_layout().
-2013-10-xx - xxxxxxx -libswscale 2.5.101 - options.c
+2013-10-06 - ccf96f8 -libswscale 2.5.101 - options.c
Change default scaler to bicubic
-2013-10-03 - xxxxxxx - lavc 55.34.100 - avcodec.h
+2013-10-03 - e57dba0 - lavc 55.34.100 - avcodec.h
Add av_codec_get_max_lowres()
-2013-10-02 - xxxxxxx - lavf 55.19.100 - avformat.h
+2013-10-02 - 5082fcc - lavf 55.19.100 - avformat.h
Add audio/video/subtitle AVCodec fields to AVFormatContext to force specific
decoders
-2013-08-xx - xxxxxxx - lavfi 3.11.0 - avfilter.h
+2013-09-28 - 7381d31 / 0767bfd - lavfi 3.88.100 / 3.11.0 - avfilter.h
Add AVFilterGraph.execute and AVFilterGraph.opaque for custom slice threading
implementations.
-2013-09-21 - xxxxxxx - lavu 52.16.0 - pixfmt.h
+2013-09-21 - 85f8a3c / e208e6d - lavu 52.46.100 / 52.16.0 - pixfmt.h
Add interleaved 4:2:2 8/10-bit formats AV_PIX_FMT_NV16 and
AV_PIX_FMT_NV20.
@@ -103,10 +293,10 @@ API changes, most recent first:
2013-08-15 - 1e0e193 - lsws 2.5.100 -
Add a sws_dither AVOption, allowing to set the dither algorithm used
-2013-08-xx - xxxxxxx - lavc 55.27.100 - vdpau.h
+2013-08-11 - d404fe35 - lavc 55.27.100 - vdpau.h
Add a render2 alternative to the render callback function.
-2013-08-xx - xxxxxxx - lavc 55.26.100 - vdpau.h
+2013-08-11 - af05edc - lavc 55.26.100 - vdpau.h
Add allocation function for AVVDPAUContext, allowing
to extend it in the future without breaking ABI/API.
@@ -116,7 +306,7 @@ API changes, most recent first:
2013-08-05 - 9547e3e / f824535 - lavc 55.22.100 / 55.13.0 - avcodec.h
Deprecate the bitstream-related members from struct AVVDPAUContext.
- The bistream buffers no longer need to be explicitly freed.
+ The bitstream buffers no longer need to be explicitly freed.
2013-08-05 - 3b805dc / 549294f - lavc 55.21.100 / 55.12.0 - avcodec.h
Deprecate the CODEC_CAP_HWACCEL_VDPAU codec capability. Use CODEC_CAP_HWACCEL
diff --git a/chromium/third_party/ffmpeg/doc/Doxyfile b/chromium/third_party/ffmpeg/doc/Doxyfile
index 6488aadd35e..96327ff6e5e 100644
--- a/chromium/third_party/ffmpeg/doc/Doxyfile
+++ b/chromium/third_party/ffmpeg/doc/Doxyfile
@@ -793,13 +793,13 @@ HTML_FILE_EXTENSION = .html
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
-#HTML_HEADER = doc/doxy/header.html
+HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
-#HTML_FOOTER = doc/doxy/footer.html
+HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
@@ -808,7 +808,7 @@ HTML_FILE_EXTENSION = .html
# the style sheet file to the HTML output directory, so don't put your own
# stylesheet in the HTML output directory as well, or it will be erased!
-#HTML_STYLESHEET = doc/doxy/doxy_stylesheet.css
+HTML_STYLESHEET =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
# Doxygen will adjust the colors in the stylesheet and background images
diff --git a/chromium/third_party/ffmpeg/doc/Makefile b/chromium/third_party/ffmpeg/doc/Makefile
index 26bd9f59cba..10f03cc8cba 100644
--- a/chromium/third_party/ffmpeg/doc/Makefile
+++ b/chromium/third_party/ffmpeg/doc/Makefile
@@ -36,15 +36,19 @@ DOCS-$(CONFIG_MANPAGES) += $(MANPAGES)
DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES)
DOCS = $(DOCS-yes)
-DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding
+DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading
+DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE) += avcodec
DOC_EXAMPLES-$(CONFIG_DEMUXING_DECODING_EXAMPLE) += demuxing_decoding
+DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE) += filter_audio
DOC_EXAMPLES-$(CONFIG_FILTERING_AUDIO_EXAMPLE) += filtering_audio
DOC_EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE) += filtering_video
DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata
DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE) += muxing
+DOC_EXAMPLES-$(CONFIG_REMUXING_EXAMPLE) += remuxing
DOC_EXAMPLES-$(CONFIG_RESAMPLING_AUDIO_EXAMPLE) += resampling_audio
DOC_EXAMPLES-$(CONFIG_SCALING_VIDEO_EXAMPLE) += scaling_video
DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE) += transcode_aac
+DOC_EXAMPLES-$(CONFIG_TRANSCODING_EXAMPLE) += transcoding
ALL_DOC_EXAMPLES_LIST = $(DOC_EXAMPLES-) $(DOC_EXAMPLES-yes)
DOC_EXAMPLES := $(DOC_EXAMPLES-yes:%=doc/examples/%$(PROGSSUF)$(EXESUF))
@@ -102,11 +106,13 @@ doc/%.3: doc/%.pod $(GENTEXI)
$(M)pod2man --section=3 --center=" " --release=" " $< > $@
$(DOCS) doc/doxy/html: | doc/
-$(DOC_EXAMPLES:%=%.o): | doc/examples
+$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
OBJDIRS += doc/examples
-doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
- $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
+DOXY_INPUT = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c))
+
+doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(DOXY_INPUT)
+ $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $< $(DOXY_INPUT)
install-doc: install-html install-man
diff --git a/chromium/third_party/ffmpeg/doc/RELEASE_NOTES b/chromium/third_party/ffmpeg/doc/RELEASE_NOTES
index fae3a2bf3fd..b3338b9fee6 100644
--- a/chromium/third_party/ffmpeg/doc/RELEASE_NOTES
+++ b/chromium/third_party/ffmpeg/doc/RELEASE_NOTES
@@ -1,7 +1,7 @@
Release Notes
=============
-* 2.1 "Fourier" October, 2013
+* 2.2 "Muybridge" March, 2014
General notes
diff --git a/chromium/third_party/ffmpeg/doc/bitstream_filters.texi b/chromium/third_party/ffmpeg/doc/bitstream_filters.texi
index 315fe33002b..9bcb12c734d 100644
--- a/chromium/third_party/ffmpeg/doc/bitstream_filters.texi
+++ b/chromium/third_party/ffmpeg/doc/bitstream_filters.texi
@@ -117,8 +117,6 @@ ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
@section movsub
-@section mp3_header_compress
-
@section mp3_header_decompress
@section noise
diff --git a/chromium/third_party/ffmpeg/doc/codecs.texi b/chromium/third_party/ffmpeg/doc/codecs.texi
index 1606f6c5c94..ec69a581ba3 100644
--- a/chromium/third_party/ffmpeg/doc/codecs.texi
+++ b/chromium/third_party/ffmpeg/doc/codecs.texi
@@ -285,6 +285,11 @@ detect bitstream specification deviations
detect improper bitstream length
@item explode
abort decoding on minor error detection
+@item ignore_err
+ignore decoding errors, and continue decoding.
+This is useful if you want to analyze the content of a video and thus want
+everything to be decoded no matter what. This option will not result in a video
+that is pleasing to watch in case of errors.
@item careful
consider things that violate the spec and have not been seen in the wild as errors
@item compliant
@@ -424,6 +429,8 @@ Possible values:
iterative motion vector (MV) search (slow)
@item deblock
use strong deblock filter for damaged MBs
+@item favor_inter
+favor predicting from the previous frame instead of the current
@end table
@item bits_per_coded_sample @var{integer}
@@ -877,6 +884,9 @@ Set frame skip factor.
@item skip_exp @var{integer} (@emph{encoding,video})
Set frame skip exponent.
+Negative values behave identical to the corresponding positive ones, except
+that the score is normalized.
+Positive values exist primarly for compatibility reasons and are not so useful.
@item skipcmp @var{integer} (@emph{encoding,video})
Set frame skip compare function.
@@ -1089,5 +1099,9 @@ instead of alpha. Default is 0.
@c man end CODEC OPTIONS
+@ifclear config-writeonly
@include decoders.texi
+@end ifclear
+@ifclear config-readonly
@include encoders.texi
+@end ifclear
diff --git a/chromium/third_party/ffmpeg/doc/decoders.texi b/chromium/third_party/ffmpeg/doc/decoders.texi
index 9d9f2984713..9309b82a587 100644
--- a/chromium/third_party/ffmpeg/doc/decoders.texi
+++ b/chromium/third_party/ffmpeg/doc/decoders.texi
@@ -14,7 +14,7 @@ You can disable all the decoders with the configure option
with the options @code{--enable-decoder=@var{DECODER}} /
@code{--disable-decoder=@var{DECODER}}.
-The option @code{-codecs} of the ff* tools will display the list of
+The option @code{-decoders} of the ff* tools will display the list of
enabled decoders.
@c man end DECODERS
@@ -52,6 +52,37 @@ top-field-first is assumed
@chapter Audio Decoders
@c man begin AUDIO DECODERS
+A description of some of the currently available audio decoders
+follows.
+
+@section ac3
+
+AC-3 audio decoder.
+
+This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
+the undocumented RealAudio 3 (a.k.a. dnet).
+
+@subsection AC-3 Decoder Options
+
+@table @option
+
+@item -drc_scale @var{value}
+Dynamic Range Scale Factor. The factor to apply to dynamic range values
+from the AC-3 stream. This factor is applied exponentially.
+There are 3 notable scale factor ranges:
+@table @option
+@item drc_scale == 0
+DRC disabled. Produces full range audio.
+@item 0 < drc_scale <= 1
+DRC enabled. Applies a fraction of the stream DRC value.
+Audio reproduction is between full range and full compression.
+@item drc_scale > 1
+DRC enabled. Applies drc_scale asymmetrically.
+Loud sounds are fully compressed. Soft sounds are enhanced.
+@end table
+
+@end table
+
@section ffwavesynth
Internal wave synthetizer.
diff --git a/chromium/third_party/ffmpeg/doc/demuxers.texi b/chromium/third_party/ffmpeg/doc/demuxers.texi
index bfc0bdc6b1c..d51b9d07487 100644
--- a/chromium/third_party/ffmpeg/doc/demuxers.texi
+++ b/chromium/third_party/ffmpeg/doc/demuxers.texi
@@ -74,7 +74,7 @@ following directive is recognized:
Path to a file to read; special characters and spaces must be escaped with
backslash or single quotes.
-All subsequent directives apply to that file.
+All subsequent file-related directives apply to that file.
@item @code{ffconcat version 1.0}
Identify the script type and version. It also sets the @option{safe} option
@@ -92,6 +92,22 @@ file is not available or accurate.
If the duration is set for all files, then it is possible to seek in the
whole concatenated video.
+@item @code{stream}
+Introduce a stream in the virtual file.
+All subsequent stream-related directives apply to the last introduced
+stream.
+Some streams properties must be set in order to allow identifying the
+matching streams in the subfiles.
+If no streams are defined in the script, the streams from the first file are
+copied.
+
+@item @code{exact_stream_id @var{id}}
+Set the id of the stream.
+If this directive is given, the string with the corresponding id in the
+subfiles will be used.
+This is especially useful for MPEG-PS (VOB) files, where the order of the
+streams is not reliable.
+
@end table
@subsection Options
@@ -112,6 +128,14 @@ If set to 0, any file name is accepted.
The default is -1, it is equivalent to 1 if the format was automatically
probed and 0 otherwise.
+@item auto_convert
+If set to 1, try to perform automatic conversions on packet data to make the
+streams concatenable.
+
+Currently, the only conversion is adding the h264_mp4toannexb bitstream
+filter to H.264 streams in MP4 format. This is necessary in particular if
+there are resolution changes.
+
@end table
@section flv
@@ -249,6 +273,8 @@ is 5.
If set to 1, will set frame timestamp to modification time of image file. Note
that monotonity of timestamps is not provided: images go in the same order as
without this option. Default value is 0.
+If set to 2, will set frame timestamp to the modification time of the image file in
+nanosecond precision.
@item video_size
Set the video size of the images to read. If not specified the video
size is guessed from the first image file in the sequence.
@@ -296,7 +322,7 @@ teletext packet PTS and DTS values untouched.
Raw video demuxer.
-This demuxer allows to read raw video data. Since there is no header
+This demuxer allows one to read raw video data. Since there is no header
specifying the assumed video parameters, the user must specify them
in order to be able to decode the data correctly.
diff --git a/chromium/third_party/ffmpeg/doc/developer.texi b/chromium/third_party/ffmpeg/doc/developer.texi
index 9c72c449073..1e1d3b8c8f2 100644
--- a/chromium/third_party/ffmpeg/doc/developer.texi
+++ b/chromium/third_party/ffmpeg/doc/developer.texi
@@ -92,7 +92,7 @@ for markup commands, i.e. use @code{@@param} and not @code{\param}.
* more text ...
* ...
*/
-typedef struct Foobar@{
+typedef struct Foobar @{
int var1; /**< var1 description */
int var2; ///< var2 description
/** var3 description */
@@ -248,7 +248,7 @@ Contributions should be licensed under the
@uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
including an "or any later version" clause, or, if you prefer
a gift-style license, the
-@uref{http://www.isc.org/software/license/, ISC} or
+@uref{http://opensource.org/licenses/isc-license.txt, ISC} or
@uref{http://mit-license.org/, MIT} license.
@uref{http://www.gnu.org/licenses/gpl-2.0.html, GPL 2} including
an "or any later version" clause is also acceptable, but LGPL is
diff --git a/chromium/third_party/ffmpeg/doc/devices.texi b/chromium/third_party/ffmpeg/doc/devices.texi
index 8f8b22a94b8..5e74a962d77 100644
--- a/chromium/third_party/ffmpeg/doc/devices.texi
+++ b/chromium/third_party/ffmpeg/doc/devices.texi
@@ -17,5 +17,9 @@ for programmatic use.
@c man end DEVICE OPTIONS
+@ifclear config-writeonly
@include indevs.texi
+@end ifclear
+@ifclear config-readonly
@include outdevs.texi
+@end ifclear
diff --git a/chromium/third_party/ffmpeg/doc/doxy-wrapper.sh b/chromium/third_party/ffmpeg/doc/doxy-wrapper.sh
index a6c54dd3981..13be8cb950c 100755
--- a/chromium/third_party/ffmpeg/doc/doxy-wrapper.sh
+++ b/chromium/third_party/ffmpeg/doc/doxy-wrapper.sh
@@ -8,4 +8,5 @@ shift 2
doxygen - <<EOF
@INCLUDE = ${DOXYFILE}
INPUT = $@
+EXAMPLE_PATH = ${SRC_PATH}/doc/examples
EOF
diff --git a/chromium/third_party/ffmpeg/doc/doxy/doxy_stylesheet.css b/chromium/third_party/ffmpeg/doc/doxy/doxy_stylesheet.css
deleted file mode 100644
index 63238a2d5cf..00000000000
--- a/chromium/third_party/ffmpeg/doc/doxy/doxy_stylesheet.css
+++ /dev/null
@@ -1,2019 +0,0 @@
-/*!
- * Bootstrap v2.1.1
- *
- * Copyright 2012 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
- */
-
-html {
- font-size: 100%;
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
-}
-a:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-a:hover,
-a:current {
- outline: 0;
-}
-img {
- /* Responsive images (ensure images don't scale beyond their parents) */
-
- max-width: 100%;
- /* Part 1: Set a maxium relative to the parent */
-
- width: auto\9;
- /* IE7-8 need help adjusting responsive images */
-
- height: auto;
- /* Part 2: Scale the height according to the width, otherwise you get stretching */
-
- vertical-align: middle;
- border: 0;
- -ms-interpolation-mode: bicubic;
-}
-body {
- margin: 0;
- font-family: sans-serif;
- font-size: 14px;
- line-height: 20px;
- color: #333333;
- background-color: #ffffff;
-}
-a {
- color: #0088cc;
- text-decoration: none;
-}
-a:hover {
- color: #005580;
- text-decoration: underline;
-}
-.container {
- width: 940px;
-}
-
-.container {
- margin-right: auto;
- margin-left: auto;
- *zoom: 1;
-}
-
-.container:before,
-.container:after {
- display: table;
- content: "";
- line-height: 0;
-}
-.container:after {
- clear: both;
-}
-.container-fluid {
- padding-right: 20px;
- padding-left: 20px;
- *zoom: 1;
-}
-small {
- font-size: 85%;
-}
-strong {
- font-weight: bold;
-}
-em {
- font-style: italic;
-}
-cite {
- font-style: normal;
-}
-.text-warning {
- color: #c09853;
-}
-.text-error {
- color: #b94a48;
-}
-.text-info {
- color: #3a87ad;
-}
-.text-success {
- color: #468847;
-}
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
- margin: 10px 0;
- font-family: inherit;
- font-weight: bold;
- line-height: 1;
- color: inherit;
- text-rendering: optimizelegibility;
-}
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small {
- font-weight: normal;
- line-height: 1;
- color: #999999;
-}
-h1 {
- font-size: 30px;
- line-height: 40px;
-}
-h2 {
- font-size: 20px;
- line-height: 40px;
-}
-h3 {
- font-size: 18px;
- line-height: 40px;
-}
-h4 {
- font-size: 18px;
- line-height: 20px;
-}
-h5 {
- font-size: 14px;
- line-height: 20px;
-}
-h6 {
- font-size: 12px;
- line-height: 20px;
-}
-ul,
-ol {
- padding: 0;
- margin: 0 0 10px 25px;
-}
-ul ul,
-ul ol,
-ol ol,
-ol ul {
- margin-bottom: 0;
-}
-li {
- line-height: 20px;
-}
-ul.unstyled,
-ol.unstyled {
- margin-left: 0;
- list-style: none;
-}
-dl {
- margin-bottom: 20px;
-}
-dt,
-dd {
- line-height: 20px;
-}
-dt {
- font-weight: bold;
-}
-dd {
- margin-left: 10px;
-}
-blockquote {
- padding: 0 0 0 15px;
- margin: 0 0 20px;
- border-left: 5px solid #eeeeee;
-}
-blockquote p {
- margin-bottom: 0;
- font-size: 16px;
- font-weight: 300;
- line-height: 25px;
-}
-blockquote:before,
-blockquote:after {
- content: "";
-}
-.fragment,
-code,
-pre {
- padding: 0 3px 2px;
- font-family: monospace;
- font-size: 12px;
- color: #333333;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-.fragment,
-code {
- padding: 2px 4px;
- color: #d14;
- background-color: #f7f7f9;
- border: 1px solid #e1e1e8;
-}
-pre {
- display: block;
- padding: 9.5px;
- margin: 0 0 10px;
- font-size: 13px;
- line-height: 20px;
- word-break: break-all;
- word-wrap: break-word;
- white-space: pre;
- white-space: pre-wrap;
- background-color: #f5f5f5;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.15);
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-pre code {
- padding: 0;
- color: inherit;
- background-color: transparent;
- border: 0;
-}
-.label,
-.badge {
- font-size: 11.844px;
- font-weight: bold;
- line-height: 14px;
- color: #ffffff;
- vertical-align: baseline;
- white-space: nowrap;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #999999;
-}
-.label {
- padding: 1px 4px 2px;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-.badge {
- padding: 1px 9px 2px;
- -webkit-border-radius: 9px;
- -moz-border-radius: 9px;
- border-radius: 9px;
-}
-a.label:hover,
-a.badge:hover {
- color: #ffffff;
- text-decoration: none;
- cursor: pointer;
-}
-.label-important,
-.badge-important {
- background-color: #b94a48;
-}
-.label-important[href],
-.badge-important[href] {
- background-color: #953b39;
-}
-.label-warning,
-.badge-warning {
- background-color: #f89406;
-}
-.label-warning[href],
-.badge-warning[href] {
- background-color: #c67605;
-}
-.label-success,
-.badge-success {
- background-color: #468847;
-}
-.label-success[href],
-.badge-success[href] {
- background-color: #356635;
-}
-.label-info,
-.badge-info {
- background-color: #3a87ad;
-}
-.label-info[href],
-.badge-info[href] {
- background-color: #2d6987;
-}
-.label-inverse,
-.badge-inverse {
- background-color: #333333;
-}
-.label-inverse[href],
-.badge-inverse[href] {
- background-color: #1a1a1a;
-}
-table {
- max-width: 100%;
- background-color: transparent;
- border-collapse: collapse;
- border-spacing: 0;
-}
-
-table [class*=span],
-.row-fluid table [class*=span] {
- display: table-cell;
- float: none;
- margin-left: 0;
-}
-fieldset {
- padding: 0;
- margin: 0;
- border: 0;
-}
-legend {
- display: block;
- width: 100%;
- padding: 0;
- margin-bottom: 20px;
- font-size: 21px;
- line-height: 40px;
- color: #333333;
- border: 0;
- border-bottom: 1px solid #e5e5e5;
-}
-legend small {
- font-size: 15px;
- color: #999999;
-}
-label,
-input,
-button,
-select,
-textarea {
- font-size: 14px;
- font-weight: normal;
- line-height: 20px;
-}
-input,
-button,
-select,
-textarea {
- font-family: sans-serif;
-}
-label {
- display: block;
- margin-bottom: 5px;
-}
-
-.tablist {
- margin-left: 0;
- margin-bottom: 20px;
- list-style: none;
-}
-.tablist > li > a {
- display: block;
-}
-.tablist > li > a:hover {
- text-decoration: none;
- background-color: #eeeeee;
-}
-.tablist > .pull-right {
- float: right;
-}
-.tablist-header {
- display: block;
- padding: 3px 15px;
- font-size: 11px;
- font-weight: bold;
- line-height: 20px;
- color: #999999;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
- text-transform: uppercase;
-}
-.tablist li + .tablist-header {
- margin-top: 9px;
-}
-.tablist-list {
- padding-left: 15px;
- padding-right: 15px;
- margin-bottom: 0;
-}
-.tablist-list > li > a,
-.tablist-list .tablist-header {
- margin-left: -15px;
- margin-right: -15px;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-}
-.tablist-list > li > a {
- padding: 3px 15px;
-}
-.tablist-list > .current > a,
-.tablist-list > .current > a:hover {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
- background-color: #0088cc;
-}
-.tablist-list [class^="icon-"] {
- margin-right: 2px;
-}
-.tablist-list .divider {
- *width: 100%;
- height: 1px;
- margin: 9px 1px;
- *margin: -5px 0 5px;
- overflow: hidden;
- background-color: #e5e5e5;
- border-bottom: 1px solid #ffffff;
-}
-.tablist-tabs,
-.tablist {
- *zoom: 1;
-}
-.tablist-tabs:before,
-.tablist:before,
-.tablist-tabs:after,
-.tablist:after {
- display: table;
- content: "";
- line-height: 0;
-}
-.tablist-tabs:after,
-.tablist:after {
- clear: both;
-}
-.tablist-tabs > li,
-.tablist > li {
- float: left;
-}
-.tablist-tabs > li > a,
-.tablist > li > a {
- padding-right: 12px;
- padding-left: 12px;
- margin-right: 2px;
- line-height: 14px;
-}
-.tablist-tabs {
- border-bottom: 1px solid #ddd;
-}
-.tablist-tabs > li {
- margin-bottom: -1px;
-}
-.tablist-tabs > li > a {
- padding-top: 8px;
- padding-bottom: 8px;
- line-height: 20px;
- border: 1px solid transparent;
- -webkit-border-radius: 4px 4px 0 0;
- -moz-border-radius: 4px 4px 0 0;
- border-radius: 4px 4px 0 0;
-}
-.tablist-tabs > li > a:hover {
- border-color: #eeeeee #eeeeee #dddddd;
-}
-.tablist-tabs > .current > a,
-.tablist-tabs > .current > a:hover {
- color: #555555;
- background-color: #ffffff;
- border: 1px solid #ddd;
- border-bottom-color: transparent;
- cursor: default;
-}
-.tablist > li > a {
- padding-top: 8px;
- padding-bottom: 8px;
- margin-top: 2px;
- margin-bottom: 2px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
-}
-.tablist > .current > a,
-.tablist > .current > a:hover {
- color: #ffffff;
- background-color: #0088cc;
-}
-.tablist-stacked > li {
- float: none;
-}
-.tablist-stacked > li > a {
- margin-right: 0;
-}
-.tablist-tabs.tablist-stacked {
- border-bottom: 0;
-}
-.tablist-tabs.tablist-stacked > li > a {
- border: 1px solid #ddd;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-.tablist-tabs.tablist-stacked > li:first-child > a {
- -webkit-border-top-right-radius: 4px;
- -moz-border-radius-topright: 4px;
- border-top-right-radius: 4px;
- -webkit-border-top-left-radius: 4px;
- -moz-border-radius-topleft: 4px;
- border-top-left-radius: 4px;
-}
-.tablist-tabs.tablist-stacked > li:last-child > a {
- -webkit-border-bottom-right-radius: 4px;
- -moz-border-radius-bottomright: 4px;
- border-bottom-right-radius: 4px;
- -webkit-border-bottom-left-radius: 4px;
- -moz-border-radius-bottomleft: 4px;
- border-bottom-left-radius: 4px;
-}
-.tablist-tabs.tablist-stacked > li > a:hover {
- border-color: #ddd;
- z-index: 2;
-}
-.tablist.tablist-stacked > li > a {
- margin-bottom: 3px;
-}
-.tablist.tablist-stacked > li:last-child > a {
- margin-bottom: 1px;
-}
-.tablist-tabs .dropdown-menu {
- -webkit-border-radius: 0 0 6px 6px;
- -moz-border-radius: 0 0 6px 6px;
- border-radius: 0 0 6px 6px;
-}
-.tablist .dropdown-menu {
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
-}
-.tablist .dropdown-toggle .caret {
- border-top-color: #0088cc;
- border-bottom-color: #0088cc;
- margin-top: 6px;
-}
-.tablist .dropdown-toggle:hover .caret {
- border-top-color: #005580;
- border-bottom-color: #005580;
-}
-/* move down carets for tabs */
-.tablist-tabs .dropdown-toggle .caret {
- margin-top: 8px;
-}
-.tablist .current .dropdown-toggle .caret {
- border-top-color: #fff;
- border-bottom-color: #fff;
-}
-.tablist-tabs .current .dropdown-toggle .caret {
- border-top-color: #555555;
- border-bottom-color: #555555;
-}
-.tablist > .dropdown.current > a:hover {
- cursor: pointer;
-}
-.tablist-tabs .open .dropdown-toggle,
-.tablist .open .dropdown-toggle,
-.tablist > li.dropdown.open.current > a:hover {
- color: #ffffff;
- background-color: #999999;
- border-color: #999999;
-}
-.tablist li.dropdown.open .caret,
-.tablist li.dropdown.open.current .caret,
-.tablist li.dropdown.open a:hover .caret {
- border-top-color: #ffffff;
- border-bottom-color: #ffffff;
- opacity: 1;
- filter: alpha(opacity=100);
-}
-.tabs-stacked .open > a:hover {
- border-color: #999999;
-}
-.tab-content > .tab-pane,
-.pill-content > .pill-pane {
- display: none;
-}
-.tab-content > .current,
-.pill-content > .current {
- display: block;
-}
-.tabs-below > .tablist-tabs {
- border-top: 1px solid #ddd;
-}
-.tabs-below > .tablist-tabs > li {
- margin-top: -1px;
- margin-bottom: 0;
-}
-.tabs-below > .tablist-tabs > li > a {
- -webkit-border-radius: 0 0 4px 4px;
- -moz-border-radius: 0 0 4px 4px;
- border-radius: 0 0 4px 4px;
-}
-.tabs-below > .tablist-tabs > li > a:hover {
- border-bottom-color: transparent;
- border-top-color: #ddd;
-}
-.tabs-below > .tablist-tabs > .current > a,
-.tabs-below > .tablist-tabs > .current > a:hover {
- border-color: transparent #ddd #ddd #ddd;
-}
-.tabs-left > .tablist-tabs > li,
-.tabs-right > .tablist-tabs > li {
- float: none;
-}
-.tabs-left > .tablist-tabs > li > a,
-.tabs-right > .tablist-tabs > li > a {
- min-width: 74px;
- margin-right: 0;
- margin-bottom: 3px;
-}
-.tabs-left > .tablist-tabs {
- float: left;
- margin-right: 19px;
- border-right: 1px solid #ddd;
-}
-.tabs-left > .tablist-tabs > li > a {
- margin-right: -1px;
- -webkit-border-radius: 4px 0 0 4px;
- -moz-border-radius: 4px 0 0 4px;
- border-radius: 4px 0 0 4px;
-}
-.tabs-left > .tablist-tabs > li > a:hover {
- border-color: #eeeeee #dddddd #eeeeee #eeeeee;
-}
-.tabs-left > .tablist-tabs .current > a,
-.tabs-left > .tablist-tabs .current > a:hover {
- border-color: #ddd transparent #ddd #ddd;
- *border-right-color: #ffffff;
-}
-.tabs-right > .tablist-tabs {
- float: right;
- margin-left: 19px;
- border-left: 1px solid #ddd;
-}
-.tabs-right > .tablist-tabs > li > a {
- margin-left: -1px;
- -webkit-border-radius: 0 4px 4px 0;
- -moz-border-radius: 0 4px 4px 0;
- border-radius: 0 4px 4px 0;
-}
-.tabs-right > .tablist-tabs > li > a:hover {
- border-color: #eeeeee #eeeeee #eeeeee #dddddd;
-}
-.tabs-right > .tablist-tabs .current > a,
-.tabs-right > .tablist-tabs .current > a:hover {
- border-color: #ddd #ddd #ddd transparent;
- *border-left-color: #ffffff;
-}
-.tablist > .disabled > a {
- color: #999999;
-}
-.tablist > .disabled > a:hover {
- text-decoration: none;
- background-color: transparent;
- cursor: default;
-}
-.tablistbar {
- overflow: visible;
- margin-bottom: 20px;
- color: #ffffff;
- *position: relative;
- *z-index: 2;
-}
-.tablistbar-inner {
- min-height: 40px;
- padding-left: 20px;
- padding-right: 20px;
- background-color: #034c03;
- background-image: -moz-linear-gradient(top, #024002, #045f04);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#024002), to(#045f04));
- background-image: -webkit-linear-gradient(top, #024002, #045f04);
- background-image: -o-linear-gradient(top, #024002, #045f04);
- background-image: linear-gradient(to bottom, #024002, #045f04);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff024002', endColorstr='#ff045f04', GradientType=0);
- border: 1px solid #022402;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
- -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
- *zoom: 1;
-}
-.tablistbar-inner:before,
-.tablistbar-inner:after {
- display: table;
- content: "";
- line-height: 0;
-}
-.tablistbar-inner:after {
- clear: both;
-}
-.tablistbar .container {
- width: auto;
-}
-.tablist-collapse.collapse {
- height: auto;
-}
-.tablistbar .brand {
- float: left;
- display: block;
- padding: 10px 20px 10px;
- margin-left: -20px;
- font-size: 20px;
- font-weight: 200;
- color: #ffffff;
- text-shadow: 0 1px 0 #024002;
-}
-.tablistbar .brand:hover {
- text-decoration: none;
-}
-.tablistbar-text {
- margin-bottom: 0;
- line-height: 40px;
-}
-.tablistbar-link {
- color: #ffffff;
-}
-.tablistbar-link:hover {
- color: #333333;
-}
-.tablistbar .tablist {
- position: relative;
- left: 0;
- display: block;
- float: left;
- margin: 0 10px 0 0;
-}
-.tablistbar .tablist.pull-right {
- float: right;
- margin-right: 0;
-}
-.tablistbar .tablist > li {
- float: left;
-}
-.tablistbar .tablist > li > a {
- float: none;
- padding: 10px 15px 10px;
- color: #ffffff;
- text-decoration: none;
- text-shadow: 0 1px 0 #024002;
-}
-.tablistbar .tablist .dropdown-toggle .caret {
- margin-top: 8px;
-}
-.tablistbar .tablist > li > a:focus,
-.tablistbar .tablist > li > a:hover {
- background-color: transparent;
- color: white;
- text-decoration: none;
-}
-.tablistbar .tablist > .current > a,
-.tablistbar .tablist > .current > a:hover,
-.tablistbar .tablist > .current > a:focus {
- color: #555555;
- text-decoration: none;
- background-color: #034703;
- -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
- -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
- box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
-}
-.tablistbar .btn-navbar {
- display: none;
- float: right;
- padding: 7px 10px;
- margin-left: 5px;
- margin-right: 5px;
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #023402;
- background-image: -moz-linear-gradient(top, #012701, #034703);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#012701), to(#034703));
- background-image: -webkit-linear-gradient(top, #012701, #034703);
- background-image: -o-linear-gradient(top, #012701, #034703);
- background-image: linear-gradient(to bottom, #012701, #034703);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff012701', endColorstr='#ff034703', GradientType=0);
- border-color: #034703 #034703 #000000;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- *background-color: #034703;
- /* Darken IE7 buttons by default so they stand out more given they won't have borders */
-
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
-}
-.tablistbar .tablist > li > .dropdown-menu:before {
- content: '';
- display: inline-block;
- border-left: 7px solid transparent;
- border-right: 7px solid transparent;
- border-bottom: 7px solid #ccc;
- border-bottom-color: rgba(0, 0, 0, 0.2);
- position: absolute;
- top: -7px;
- left: 9px;
-}
-.tablistbar .tablist > li > .dropdown-menu:after {
- content: '';
- display: inline-block;
- border-left: 6px solid transparent;
- border-right: 6px solid transparent;
- border-bottom: 6px solid #ffffff;
- position: absolute;
- top: -6px;
- left: 10px;
-}
-.tablistbar .tablist li.dropdown.open > .dropdown-toggle,
-.tablistbar .tablist li.dropdown.current > .dropdown-toggle,
-.tablistbar .tablist li.dropdown.open.current > .dropdown-toggle {
- background-color: #034703;
- color: #555555;
-}
-.tablistbar .tablist li.dropdown > .dropdown-toggle .caret {
- border-top-color: #ffffff;
- border-bottom-color: #ffffff;
-}
-.tablistbar .tablist li.dropdown.open > .dropdown-toggle .caret,
-.tablistbar .tablist li.dropdown.current > .dropdown-toggle .caret,
-.tablistbar .tablist li.dropdown.open.current > .dropdown-toggle .caret {
- border-top-color: #555555;
- border-bottom-color: #555555;
-}
-.tablistbar .pull-right > li > .dropdown-menu,
-.tablistbar .tablist > li > .dropdown-menu.pull-right {
- left: auto;
- right: 0;
-}
-.tablistbar .pull-right > li > .dropdown-menu:before,
-.tablistbar .tablist > li > .dropdown-menu.pull-right:before {
- left: auto;
- right: 12px;
-}
-.tablistbar .pull-right > li > .dropdown-menu:after,
-.tablistbar .tablist > li > .dropdown-menu.pull-right:after {
- left: auto;
- right: 13px;
-}
-.tablistbar .pull-right > li > .dropdown-menu .dropdown-menu,
-.tablistbar .tablist > li > .dropdown-menu.pull-right .dropdown-menu {
- left: auto;
- right: 100%;
- margin-left: 0;
- margin-right: -1px;
- -webkit-border-radius: 6px 0 6px 6px;
- -moz-border-radius: 6px 0 6px 6px;
- border-radius: 6px 0 6px 6px;
-}
-.breadcrumb {
- padding: 8px 15px;
- margin: 0 0 20px;
- list-style: none;
- background-color: #f5f5f5;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-.breadcrumb li {
- display: inline-block;
- *display: inline;
- /* IE7 inline-block hack */
-
- *zoom: 1;
- text-shadow: 0 1px 0 #ffffff;
-}
-.breadcrumb .divider {
- padding: 0 5px;
- color: #ccc;
-}
-.breadcrumb .current {
- color: #999999;
-}
-.pagination-right {
- text-align: right;
-}
-.fade {
- opacity: 0;
- -webkit-transition: opacity 0.15s linear;
- -moz-transition: opacity 0.15s linear;
- -o-transition: opacity 0.15s linear;
- transition: opacity 0.15s linear;
-}
-.fade.in {
- opacity: 1;
-}
-.collapse {
- position: relative;
- height: 0;
- overflow: hidden;
- -webkit-transition: height 0.35s ease;
- -moz-transition: height 0.35s ease;
- -o-transition: height 0.35s ease;
- transition: height 0.35s ease;
-}
-.collapse.in {
- height: auto;
-}
-.hidden {
- display: none;
- visibility: hidden;
-}
-.visible-phone {
- display: none !important;
-}
-.visible-tablet {
- display: none !important;
-}
-.hidden-desktop {
- display: none !important;
-}
-.visible-desktop {
- display: inherit !important;
-}
-@media (min-width: 768px) and (max-width: 979px) {
- .hidden-desktop {
- display: inherit !important;
- }
- .visible-desktop {
- display: none !important ;
- }
- .visible-tablet {
- display: inherit !important;
- }
- .hidden-tablet {
- display: none !important;
- }
-}
-@media (max-width: 767px) {
- .hidden-desktop {
- display: inherit !important;
- }
- .visible-desktop {
- display: none !important;
- }
- .visible-phone {
- display: inherit !important;
- }
- .hidden-phone {
- display: none !important;
- }
-}
-@media (max-width: 767px) {
- body {
- padding-left: 20px;
- padding-right: 20px;
- }
- .container {
- width: auto;
- }
- .row,
- .thumbnails {
- margin-left: 0;
- }
-}
-@media (max-width: 480px) {
- .tablist-collapse {
- -webkit-transform: translate3d(0, 0, 0);
- }
- .page-header h1 small {
- display: block;
- line-height: 20px;
- }
-}
-@media (min-width: 768px) and (max-width: 979px) {
- .row {
- margin-left: -20px;
- *zoom: 1;
- }
- .row:before,
- .row:after {
- display: table;
- content: "";
- line-height: 0;
- }
- .row:after {
- clear: both;
- }
- [class*="span"] {
- float: left;
- min-height: 1px;
- margin-left: 20px;
- }
- .container {
- width: 724px;
- }
-}
-@media (min-width: 1200px) {
- .row {
- margin-left: -30px;
- *zoom: 1;
- }
- .row:before,
- .row:after {
- display: table;
- content: "";
- line-height: 0;
- }
- .row:after {
- clear: both;
- }
- [class*="span"] {
- float: left;
- min-height: 1px;
- margin-left: 30px;
- }
- .container {
- width: 1070px;
- }
-}
-@media (max-width: 979px) {
- body {
- padding-top: 0;
- }
-}
-@media (min-width: 980px) {
- .tablist-collapse.collapse {
- height: auto !important;
- overflow: visible !important;
- }
-}
-.tablistbar .brand {
- padding: 5px;
- margin-left: 0;
-}
-.tablistbar .brand img {
- width: 30px;
- vertical-align: middle;
-}
-
-h1 small {
- font-size: 18px;
-}
-
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small,
-.page-header small {
- line-height: 0.8;
- font-weight: normal;
- color: #999999;
- display:block;
- vertical-align: middle;
-}
-
-.page-header h1, h1:first-child {
- font-size: 40px;
- padding-bottom: 5px;
-}
-
-.page-header h1 {
- border-bottom: 1px solid #999999;
- padding-bottom: 9px;
-}
-
-.page-header img {
- height: 80px;
- padding-bottom: 5px;
-}
-
-.page-header small {
- line-height: 1.1;
- font-size: 18px;
-}
-
-h2,
-h3,
-h4,
-div.ah,
-.title {
- border-color: #D6E9C6;
- color: #468847;
- border-style: solid;
- border-width: 0 0 1px;
- padding-left: 0.5em;
-}
-
-
-.google {
- color: white;
-}
-
-.breadcrumb {
- font-size: 11px;
- padding-top: 2px;
- padding-bottom: 2px;
-}
-
-h1 a,
-h2 a,
-h3 a,
-h4 a {
- color: inherit;
-}
-
-.tablistbar-inner a {
- font-weight: bold;
-}
-
-.list-2panes:before,
-.list-2panes:after {
- display: table;
- content: "";
- line-height: 0;
-}
-
-.list-2panes:after {
- clear:both;
-}
-
-.list-2panes li {
- width: 470px;
- width: 470px;
- float: left;
- margin-left: 30px;
- min-height: 1px;
-}
-/* The standard CSS for doxygen */
-
-/* @group Heading Levels */
-
-
-dt {
- font-weight: bold;
-}
-
-div.multicol {
- -moz-column-gap: 1em;
- -webkit-column-gap: 1em;
- -moz-column-count: 3;
- -webkit-column-count: 3;
-}
-
-p.startli, p.startdd, p.starttd {
- margin-top: 2px;
-}
-
-p.endli {
- margin-bottom: 0px;
-}
-
-p.enddd {
- margin-bottom: 4px;
-}
-
-p.endtd {
- margin-bottom: 2px;
-}
-
-/* @end */
-
-caption {
- font-weight: bold;
-}
-
-span.legend {
- font-size: 70%;
- text-align: center;
-}
-
-h3.version {
- font-size: 90%;
- text-align: center;
-}
-
-div.qindex, div.tablisttab{
- background-color: #EBF6EB;
- border: 1px solid #A3D7A3;
- text-align: center;
-}
-
-div.qindex, div.tablistpath {
- width: 100%;
- line-height: 140%;
-}
-
-div.tablisttab {
- margin-right: 15px;
-}
-
-/* @group Link Styling */
-
-a {
- color: #3D8C3D;
- font-weight: normal;
- text-decoration: none;
-}
-
-.contents a:visited {
- color: #46A246;
-}
-
-a:hover {
- text-decoration: underline;
-}
-
-a.qindex {
- font-weight: bold;
-}
-
-a.qindexHL {
- font-weight: bold;
- background-color: #9CD49C;
- color: #ffffff;
- border: 1px double #86CA86;
-}
-
-.contents a.qindexHL:visited {
- color: #ffffff;
-}
-
-a.el {
- font-weight: bold;
-}
-
-a.elRef {
-}
-
-a.code {
- color: #4665A2;
-}
-
-a.codeRef {
- color: #4665A2;
-}
-
-/* @end */
-
-dl.el {
- margin-left: -1cm;
-}
-
-.fragment {
- font-family: monospace, fixed;
- font-size: 105%;
-}
-
-pre.fragment {
- border: 1px solid #C4E5C4;
- background-color: #FBFDFB;
- padding: 4px 6px;
- margin: 4px 8px 4px 2px;
- overflow: auto;
- word-wrap: break-word;
- font-size: 9pt;
- line-height: 125%;
-}
-
-div.groupHeader {
- margin-left: 16px;
- margin-top: 12px;
- font-weight: bold;
-}
-
-div.groupText {
- margin-left: 16px;
- font-style: italic;
-}
-
-div.contents {
- margin-top: 10px;
- margin-left: 8px;
- margin-right: 8px;
-}
-
-td.indexkey {
- white-space: nowrap;
- vertical-align: top;
-}
-
-
-tr.memlist {
- background-color: #EEF7EE;
-}
-
-p.formulaDsp {
- text-align: center;
-}
-
-img.formulaDsp {
-
-}
-
-img.formulaInl {
- vertical-align: middle;
-}
-
-div.center {
- text-align: center;
- margin-top: 0px;
- margin-bottom: 0px;
- padding: 0px;
-}
-
-div.center img {
- border: 0px;
-}
-
-#footer {
- margin: -10px 1em 0;
- padding-top: 20px;
- text-align: center;
- font-size: small;
-}
-
-address.footer {
- background-color: #ffffff;
- text-align: center;
-}
-
-img.footer {
- border: 0px;
- vertical-align: middle;
-}
-
-/* @group Code Colorization */
-
-span.keyword {
- color: #008000
-}
-
-span.keywordtype {
- color: #604020
-}
-
-span.keywordflow {
- color: #e08000
-}
-
-span.comment {
- color: #800000
-}
-
-span.preprocessor {
- color: #806020
-}
-
-span.stringliteral {
- color: #002080
-}
-
-span.charliteral {
- color: #008080
-}
-
-span.vhdldigit {
- color: #ff00ff
-}
-
-span.vhdlchar {
- color: #000000
-}
-
-span.vhdlkeyword {
- color: #700070
-}
-
-span.vhdllogic {
- color: #ff0000
-}
-
-/* @end */
-
-/*
-.search {
- color: #003399;
- font-weight: bold;
-}
-
-form.search {
- margin-bottom: 0px;
- margin-top: 0px;
-}
-
-input.search {
- font-size: 75%;
- color: #000080;
- font-weight: normal;
- background-color: #e8eef2;
-}
-*/
-
-td.tiny {
- font-size: 75%;
-}
-
-.dirtab {
- padding: 4px;
- border-collapse: collapse;
- border: 1px solid #A3D7A3;
-}
-
-th.dirtab {
- background: #EBF6EB;
- font-weight: bold;
-}
-
-hr {
- height: 0px;
- border: none;
- border-top: 1px solid #4AAA4A;
-}
-
-hr.footer {
- height: 1px;
-}
-
-/* @group Member Descriptions */
-
-table.memberdecls {
- border-spacing: 0px;
- padding: 0px;
-}
-
-.mdescLeft, .mdescRight,
-.memItemLeft, .memItemRight,
-.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
- background-color: #F9FCF9;
- border: none;
- margin: 4px;
- padding: 1px 0 0 8px;
-}
-
-.mdescLeft, .mdescRight {
- padding: 0px 8px 4px 8px;
- color: #555;
-}
-
-.memItemLeft, .memItemRight, .memTemplParams {
- border-top: 1px solid #C4E5C4;
-}
-
-.memItemLeft, .memTemplItemLeft {
- white-space: nowrap;
-}
-
-.memItemRight {
- width: 100%;
-}
-
-.memTemplParams {
- color: #46A246;
- white-space: nowrap;
-}
-
-/* @end */
-
-/* @group Member Details */
-
-/* Styles for detailed member documentation */
-
-.memtemplate {
- font-size: 80%;
- color: #46A246;
- font-weight: normal;
- margin-left: 9px;
-}
-
-.memnav {
- background-color: #EBF6EB;
- border: 1px solid #A3D7A3;
- text-align: center;
- margin: 2px;
- margin-right: 15px;
- padding: 2px;
-}
-
-.mempage {
- width: 100%;
-}
-
-.memitem {
- padding: 0;
- margin-bottom: 10px;
- margin-right: 5px;
-}
-
-.memname {
- white-space: nowrap;
- font-weight: bold;
- margin-left: 6px;
-}
-
-.memproto, dl.reflist dt {
- border-top: 1px solid #A8D9A8;
- border-left: 1px solid #A8D9A8;
- border-right: 1px solid #A8D9A8;
- padding: 6px 0px 6px 0px;
- color: #255525;
- font-weight: bold;
- text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
- /* opera specific markup */
- box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- border-top-right-radius: 8px;
- border-top-left-radius: 8px;
- /* firefox specific markup */
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
- -moz-border-radius-topright: 8px;
- -moz-border-radius-topleft: 8px;
- /* webkit specific markup */
- -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- -webkit-border-top-right-radius: 8px;
- -webkit-border-top-left-radius: 8px;
- background-image:url('nav_f.png');
- background-repeat:repeat-x;
- background-color: #E2F2E2;
-
-}
-
-.memdoc, dl.reflist dd {
- border-bottom: 1px solid #A8D9A8;
- border-left: 1px solid #A8D9A8;
- border-right: 1px solid #A8D9A8;
- padding: 2px 5px;
- background-color: #FBFDFB;
- border-top-width: 0;
- /* opera specific markup */
- border-bottom-left-radius: 8px;
- border-bottom-right-radius: 8px;
- box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- /* firefox specific markup */
- -moz-border-radius-bottomleft: 8px;
- -moz-border-radius-bottomright: 8px;
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
- background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7FBF7 95%, #EEF7EE);
- /* webkit specific markup */
- -webkit-border-bottom-left-radius: 8px;
- -webkit-border-bottom-right-radius: 8px;
- -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7FBF7), to(#EEF7EE));
-}
-
-dl.reflist dt {
- padding: 5px;
-}
-
-dl.reflist dd {
- margin: 0px 0px 10px 0px;
- padding: 5px;
-}
-
-.paramkey {
- text-align: right;
-}
-
-.paramtype {
- white-space: nowrap;
-}
-
-.paramname {
- color: #602020;
- white-space: nowrap;
-}
-.paramname em {
- font-style: normal;
-}
-
-.params, .retval, .exception, .tparams {
- border-spacing: 6px 2px;
-}
-
-.params .paramname, .retval .paramname {
- font-weight: bold;
- vertical-align: top;
-}
-
-.params .paramtype {
- font-style: italic;
- vertical-align: top;
-}
-
-.params .paramdir {
- font-family: "courier new",courier,monospace;
- vertical-align: top;
-}
-
-
-
-
-/* @end */
-
-/* @group Directory (tree) */
-
-/* for the tree view */
-
-.ftvtree {
- font-family: sans-serif;
- margin: 0px;
-}
-
-/* these are for tree view when used as main index */
-
-.directory {
- font-size: 9pt;
- font-weight: bold;
- margin: 5px;
-}
-
-.directory h3 {
- margin: 0px;
- margin-top: 1em;
- font-size: 11pt;
-}
-
-/*
-The following two styles can be used to replace the root node title
-with an image of your choice. Simply uncomment the next two styles,
-specify the name of your image and be sure to set 'height' to the
-proper pixel height of your image.
-*/
-
-/*
-.directory h3.swap {
- height: 61px;
- background-repeat: no-repeat;
- background-image: url("yourimage.gif");
-}
-.directory h3.swap span {
- display: none;
-}
-*/
-
-.directory > h3 {
- margin-top: 0;
-}
-
-.directory p {
- margin: 0px;
- white-space: nowrap;
-}
-
-.directory div {
- display: none;
- margin: 0px;
-}
-
-.directory img {
- vertical-align: -30%;
-}
-
-/* these are for tree view when not used as main index */
-
-.directory-alt {
- font-size: 100%;
- font-weight: bold;
-}
-
-.directory-alt h3 {
- margin: 0px;
- margin-top: 1em;
- font-size: 11pt;
-}
-
-.directory-alt > h3 {
- margin-top: 0;
-}
-
-.directory-alt p {
- margin: 0px;
- white-space: nowrap;
-}
-
-.directory-alt div {
- display: none;
- margin: 0px;
-}
-
-.directory-alt img {
- vertical-align: -30%;
-}
-
-/* @end */
-
-div.dynheader {
- margin-top: 8px;
-}
-
-address {
- font-style: normal;
- color: #2A612A;
-}
-
-table.doxtable {
- border-collapse:collapse;
-}
-
-table.doxtable td, table.doxtable th {
- border: 1px solid #2D682D;
- padding: 3px 7px 2px;
-}
-
-table.doxtable th {
- background-color: #377F37;
- color: #FFFFFF;
- font-size: 110%;
- padding-bottom: 4px;
- padding-top: 5px;
- text-align:left;
-}
-
-table.fieldtable {
- width: 100%;
- margin-bottom: 10px;
- border: 1px solid #A8D9A8;
- border-spacing: 0px;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
- -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
- box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
-}
-
-.fieldtable td, .fieldtable th {
- padding: 3px 7px 2px;
-}
-
-.fieldtable td.fieldtype, .fieldtable td.fieldname {
- white-space: nowrap;
- border-right: 1px solid #A8D9A8;
- border-bottom: 1px solid #A8D9A8;
- vertical-align: top;
-}
-
-.fieldtable td.fielddoc {
- border-bottom: 1px solid #A8D9A8;
- width: 100%;
-}
-
-.fieldtable tr:last-child td {
- border-bottom: none;
-}
-
-.fieldtable th {
- background-image:url('nav_f.png');
- background-repeat:repeat-x;
- background-color: #E2F2E2;
- font-size: 90%;
- color: #255525;
- padding-bottom: 4px;
- padding-top: 5px;
- text-align:left;
- -moz-border-radius-topleft: 4px;
- -moz-border-radius-topright: 4px;
- -webkit-border-top-left-radius: 4px;
- -webkit-border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- border-bottom: 1px solid #A8D9A8;
-}
-
-
-.tabsearch {
- top: 0px;
- left: 10px;
- height: 36px;
- background-image: url('tab_b.png');
- z-index: 101;
- overflow: hidden;
- font-size: 13px;
-}
-
-.tablistpath ul
-{
- font-size: 11px;
- background-image:url('tab_b.png');
- background-repeat:repeat-x;
- height:30px;
- line-height:30px;
- color:#8ACC8A;
- border:solid 1px #C2E4C2;
- overflow:hidden;
- margin:0px;
- padding:0px;
-}
-
-.tablistpath li
-{
- list-style-type:none;
- float:left;
- padding-left:10px;
- padding-right:15px;
- background-image:url('bc_s.png');
- background-repeat:no-repeat;
- background-position:right;
- color:#367C36;
-}
-
-.tablistpath li.tablistelem a
-{
- height:32px;
- display:block;
- text-decoration: none;
- outline: none;
-}
-
-.tablistpath li.tablistelem a:hover
-{
- color:#68BD68;
-}
-
-.tablistpath li.footer
-{
- list-style-type:none;
- float:right;
- padding-left:10px;
- padding-right:15px;
- background-image:none;
- background-repeat:no-repeat;
- background-position:right;
- color:#367C36;
- font-size: 8pt;
-}
-
-
-div.summary
-{
- margin-top: 12px;
- text-align: center;
-}
-
-div.summary a
-{
- white-space: nowrap;
-}
-
-div.ingroups
-{
- margin-left: 5px;
- font-size: 8pt;
- padding-left: 5px;
- width: 50%;
- text-align: left;
-}
-
-div.ingroups a
-{
- white-space: nowrap;
-}
-
-div.headertitle
-{
- padding: 5px 5px 5px 7px;
-}
-
-dl
-{
- padding: 0 0 0 10px;
-}
-
-dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
-{
- border-left:4px solid;
- padding: 0 0 0 6px;
-}
-
-dl.note
-{
- border-color: #D0C000;
-}
-
-dl.warning, dl.attention
-{
- border-color: #FF0000;
-}
-
-dl.pre, dl.post, dl.invariant
-{
- border-color: #00D000;
-}
-
-dl.deprecated
-{
- border-color: #505050;
-}
-
-dl.todo
-{
- border-color: #00C0E0;
-}
-
-dl.test
-{
- border-color: #3030E0;
-}
-
-dl.bug
-{
- border-color: #C08050;
-}
-
-#projectlogo
-{
- text-align: center;
- vertical-align: bottom;
- border-collapse: separate;
-}
-
-#projectlogo img
-{
- border: 0px none;
-}
-
-#projectname
-{
- font: 300% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 2px 0px;
-}
-
-#projectbrief
-{
- font: 120% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 0px;
-}
-
-#projectnumber
-{
- font: 50% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 0px;
-}
-
-#titlearea
-{
- padding: 0px;
- margin: 0px;
- width: 100%;
- border-bottom: 1px solid #53B453;
-}
-
-.image
-{
- text-align: center;
-}
-
-.dotgraph
-{
- text-align: center;
-}
-
-.mscgraph
-{
- text-align: center;
-}
-
-.caption
-{
- font-weight: bold;
-}
-
-div.zoom
-{
- border: 1px solid #90CE90;
-}
-
-dl.citelist {
- margin-bottom:50px;
-}
-
-dl.citelist dt {
- color:#337533;
- float:left;
- font-weight:bold;
- margin-right:10px;
- padding:5px;
-}
-
-dl.citelist dd {
- margin:2px 0;
- padding:5px 0;
-}
-
-@media print
-{
- #top { display: none; }
- #side-nav { display: none; }
- #nav-path { display: none; }
- body { overflow:visible; }
- h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
- .summary { display: none; }
- .memitem { page-break-inside: avoid; }
- #doc-content
- {
- margin-left:0 !important;
- height:auto !important;
- width:auto !important;
- overflow:inherit;
- display:inline;
- }
- pre.fragment
- {
- overflow: visible;
- text-wrap: unrestricted;
- white-space: -moz-pre-wrap; /* Moz */
- white-space: -pre-wrap; /* Opera 4-6 */
- white-space: -o-pre-wrap; /* Opera 7 */
- white-space: pre-wrap; /* CSS3 */
- word-wrap: break-word; /* IE 5.5+ */
- }
-}
-
-#proj_desc {
- font-size: 1.2em;
-}
diff --git a/chromium/third_party/ffmpeg/doc/doxy/footer.html b/chromium/third_party/ffmpeg/doc/doxy/footer.html
deleted file mode 100644
index 101e6fe70b8..00000000000
--- a/chromium/third_party/ffmpeg/doc/doxy/footer.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
- <footer class="footer pagination-right">
- <span class="label label-info">
- Generated on $datetime for $projectname by&#160;<a href="http://www.doxygen.org/index.html">doxygen</a> $doxygenversion
- </span>
- </footer>
-</div>
-</body>
-</html>
diff --git a/chromium/third_party/ffmpeg/doc/doxy/header.html b/chromium/third_party/ffmpeg/doc/doxy/header.html
deleted file mode 100644
index 312990cdbc9..00000000000
--- a/chromium/third_party/ffmpeg/doc/doxy/header.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
-<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
-<link href="$relpath$doxy_stylesheet.css" rel="stylesheet" type="text/css" />
-<!--Header replace -->
-
-</head>
-
-<div class="container">
-
-<!--Header replace -->
-<div class="menu">
diff --git a/chromium/third_party/ffmpeg/doc/encoders.texi b/chromium/third_party/ffmpeg/doc/encoders.texi
index a93edb4b93e..d48df7d302b 100644
--- a/chromium/third_party/ffmpeg/doc/encoders.texi
+++ b/chromium/third_party/ffmpeg/doc/encoders.texi
@@ -14,7 +14,7 @@ You can disable all the encoders with the configure option
with the options @code{--enable-encoder=@var{ENCODER}} /
@code{--disable-encoder=@var{ENCODER}}.
-The option @code{-codecs} of the ff* tools will display the list of
+The option @code{-encoders} of the ff* tools will display the list of
enabled encoders.
@c man end ENCODERS
@@ -623,6 +623,9 @@ VBR encoding, enabled through the @option{vbr} or @option{flags
+qscale} options, is experimental and only works with some
combinations of parameters.
+Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
+higher.
+
For more information see the fdk-aac project at
@url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
@@ -804,7 +807,7 @@ while producing the worst quality.
@item reservoir
Enable use of bit reservoir when set to 1. Default value is 1. LAME
-has this enabled by default, but can be overriden by use
+has this enabled by default, but can be overridden by use
@option{--nores} option.
@item joint_stereo (@emph{-m j})
@@ -1144,32 +1147,111 @@ transient response is a higher bitrate.
@end table
+@anchor{libwavpack}
@section libwavpack
A wrapper providing WavPack encoding through libwavpack.
Only lossless mode using 32-bit integer samples is supported currently.
-The @option{compression_level} option can be used to control speed vs.
-compression tradeoff, with the values mapped to libwavpack as follows:
+
+Requires the presence of the libwavpack headers and library during
+configuration. You need to explicitly configure the build with
+@code{--enable-libwavpack}.
+
+Note that a libavcodec-native encoder for the WavPack codec exists so users can
+encode audios with this codec without using this encoder. See @ref{wavpackenc}.
+
+@subsection Options
+
+@command{wavpack} command line utility's corresponding options are listed in
+parentheses, if any.
@table @option
+@item frame_size (@emph{--blocksize})
+Default is 32768.
-@item 0
-Fast mode - corresponding to the wavpack @option{-f} option.
+@item compression_level
+Set speed vs. compression tradeoff. Acceptable arguments are listed below:
+
+@table @samp
+@item 0 (@emph{-f})
+Fast mode.
@item 1
Normal (default) settings.
-@item 2
-High quality - corresponding to the wavpack @option{-h} option.
+@item 2 (@emph{-h})
+High quality.
-@item 3
-Very high quality - corresponding to the wavpack @option{-hh} option.
+@item 3 (@emph{-hh})
+Very high quality.
+
+@item 4-8 (@emph{-hh -x}@var{EXTRAPROC})
+Same as @samp{3}, but with extra processing enabled.
+
+@samp{4} is the same as @option{-x2} and @samp{8} is the same as @option{-x6}.
+
+@end table
+@end table
+
+@anchor{wavpackenc}
+@section wavpack
+
+WavPack lossless audio encoder.
+
+This is a libavcodec-native WavPack encoder. There is also an encoder based on
+libwavpack, but there is virtually no reason to use that encoder.
+
+See also @ref{libwavpack}.
+
+@subsection Options
+
+The equivalent options for @command{wavpack} command line utility are listed in
+parentheses.
+
+@subsubsection Shared options
+
+The following shared options are effective for this encoder. Only special notes
+about this particular encoder will be documented here. For the general meaning
+of the options, see @ref{codec-options,,the Codec Options chapter}.
+
+@table @option
+@item frame_size (@emph{--blocksize})
+For this encoder, the range for this option is between 128 and 131072. Default
+is automatically decided based on sample rate and number of channel.
+
+For the complete formula of calculating default, see
+@file{libavcodec/wavpackenc.c}.
+
+@item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
+This option's syntax is consistent with @ref{libwavpack}'s.
+@end table
+
+@subsubsection Private options
-@item 4-8
-Same as 3, but with extra processing enabled - corresponding to the wavpack
-@option{-x} option. I.e. 4 is the same as @option{-x2} and 8 is the same as
-@option{-x6}.
+@table @option
+@item joint_stereo (@emph{-j})
+Set whether to enable joint stereo. Valid values are:
+
+@table @samp
+@item on (@emph{1})
+Force mid/side audio encoding.
+@item off (@emph{0})
+Force left/right audio encoding.
+@item auto
+Let the encoder decide automatically.
+@end table
+
+@item optimize_mono
+Set whether to enable optimization for mono. This option is only effective for
+non-mono streams. Available values:
+
+@table @samp
+@item on
+enabled
+@item off
+disabled
+@end table
@end table
@@ -1189,7 +1271,7 @@ Requires the presence of the libtheora headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libtheora}.
-For more informations about the libtheora project see
+For more information about the libtheora project see
@url{http://www.theora.org/}.
@subsection Options
@@ -1365,7 +1447,69 @@ g_error_resilient
For more information about libvpx see:
@url{http://www.webmproject.org/}
-@section libx264
+
+@section libwebp
+
+libwebp WebP Image encoder wrapper
+
+libwebp is Google's official encoder for WebP images. It can encode in either
+lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
+frame. Lossless images are a separate codec developed by Google.
+
+@subsection Pixel Format
+
+Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
+to limitations of the format and libwebp. Alpha is supported for either mode.
+Because of API limitations, if RGB is passed in when encoding lossy or YUV is
+passed in for encoding lossless, the pixel format will automatically be
+converted using functions from libwebp. This is not ideal and is done only for
+convenience.
+
+@subsection Options
+
+@table @option
+
+@item -lossless @var{boolean}
+Enables/Disables use of lossless mode. Default is 0.
+
+@item -compression_level @var{integer}
+For lossy, this is a quality/speed tradeoff. Higher values give better quality
+for a given size at the cost of increased encoding time. For lossless, this is
+a size/speed tradeoff. Higher values give smaller size at the cost of increased
+encoding time. More specifically, it controls the number of extra algorithms
+and compression tools used, and varies the combination of these tools. This
+maps to the @var{method} option in libwebp. The valid range is 0 to 6.
+Default is 4.
+
+@item -qscale @var{float}
+For lossy encoding, this controls image quality, 0 to 100. For lossless
+encoding, this controls the effort and time spent at compressing more. The
+default value is 75. Note that for usage via libavcodec, this option is called
+@var{global_quality} and must be multiplied by @var{FF_QP2LAMBDA}.
+
+@item -preset @var{type}
+Configuration preset. This does some automatic settings based on the general
+type of the image.
+@table @option
+@item none
+Do not use a preset.
+@item default
+Use the encoder default.
+@item picture
+Digital picture, like portrait, inner shot
+@item photo
+Outdoor photograph, with natural lighting
+@item drawing
+Hand or line drawing, with high-contrast details
+@item icon
+Small-sized colorful images
+@item text
+Text-like
+@end table
+
+@end table
+
+@section libx264, libx264rgb
x264 H.264/MPEG-4 AVC encoder wrapper.
@@ -1381,12 +1525,22 @@ for detail retention (adaptive quantization, psy-RD, psy-trellis).
Many libx264 encoder options are mapped to FFmpeg global codec
options, while unique encoder options are provided through private
options. Additionally the @option{x264opts} and @option{x264-params}
-private options allows to pass a list of key=value tuples as accepted
+private options allows one to pass a list of key=value tuples as accepted
by the libx264 @code{x264_param_parse} function.
The x264 project website is at
@url{http://www.videolan.org/developers/x264.html}.
+The libx264rgb encoder is the same as libx264, except it accepts packed RGB
+pixel formats as input instead of YUV.
+
+@subsection Supported Pixel Formats
+
+x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
+x264's configure time. FFmpeg only supports one bit depth in one particular
+build. In other words, it is not possible to build one FFmpeg with multiple
+versions of x264 with different bit depths.
+
@subsection Options
The following options are supported by the libx264 wrapper. The
@@ -1412,25 +1566,34 @@ kilobits/s.
@item g (@emph{keyint})
-@item qmax (@emph{qpmax})
-
@item qmin (@emph{qpmin})
+Minimum quantizer scale.
+
+@item qmax (@emph{qpmax})
+Maximum quantizer scale.
@item qdiff (@emph{qpstep})
+Maximum difference between quantizer scales.
@item qblur (@emph{qblur})
+Quantizer curve blur
@item qcomp (@emph{qcomp})
+Quantizer curve compression factor
@item refs (@emph{ref})
+Number of reference frames each P-frame can use. The range is from @var{0-16}.
@item sc_threshold (@emph{scenecut})
+Sets the threshold for the scene change detection.
@item trellis (@emph{trellis})
+Performs Trellis quantization to increase efficiency. Enabled by default.
@item nr (@emph{nr})
@item me_range (@emph{merange})
+Maximum range of the motion search in pixels.
@item me_method (@emph{me})
Set motion estimation method. Possible values in the decreasing order
@@ -1452,10 +1615,13 @@ Hadamard exhaustive search (slowest).
@end table
@item subq (@emph{subme})
+Sub-pixel motion estimation method.
@item b_strategy (@emph{b-adapt})
+Adaptive B-frame placement decision algorithm. Use only on first-pass.
@item keyint_min (@emph{min-keyint})
+Minimum GOP size.
@item coder
Set entropy encoder. Possible values:
@@ -1482,6 +1648,7 @@ Ignore chroma in motion estimation. It generates the same effect as
@end table
@item threads (@emph{threads})
+Number of encoding threads.
@item thread_type
Set multithreading technique. Possible values:
@@ -1699,7 +1866,7 @@ Override the x264 configuration using a :-separated list of key=value
parameters.
This option is functionally the same as the @option{x264opts}, but is
-duplicated for compability with the Libav fork.
+duplicated for compatibility with the Libav fork.
For example to specify libx264 encoding options with @command{ffmpeg}:
@example
@@ -1893,7 +2060,7 @@ Set physical density of pixels, in dots per meter, unset by default
Apple ProRes encoder.
FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
-The used encoder can be choosen with the @code{-vcodec} option.
+The used encoder can be chosen with the @code{-vcodec} option.
@subsection Private Options for prores-ks
diff --git a/chromium/third_party/ffmpeg/doc/examples/Makefile b/chromium/third_party/ffmpeg/doc/examples/Makefile
index f085532ffef..03c7021e8bb 100644
--- a/chromium/third_party/ffmpeg/doc/examples/Makefile
+++ b/chromium/third_party/ffmpeg/doc/examples/Makefile
@@ -11,20 +11,23 @@ CFLAGS += -Wall -g
CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
-EXAMPLES= decoding_encoding \
+EXAMPLES= avio_reading \
+ decoding_encoding \
demuxing_decoding \
filtering_video \
filtering_audio \
metadata \
muxing \
+ remuxing \
resampling_audio \
scaling_video \
transcode_aac \
+ transcoding \
OBJS=$(addsuffix .o,$(EXAMPLES))
# the following examples make explicit use of the math library
-decoding_encoding: LDLIBS += -lm
+avcodec: LDLIBS += -lm
muxing: LDLIBS += -lm
resampling_audio: LDLIBS += -lm
diff --git a/chromium/third_party/ffmpeg/doc/examples/avio_reading.c b/chromium/third_party/ffmpeg/doc/examples/avio_reading.c
new file mode 100644
index 00000000000..02474e907af
--- /dev/null
+++ b/chromium/third_party/ffmpeg/doc/examples/avio_reading.c
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2014 Stefano Sabatini
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * @file
+ * libavformat AVIOContext API example.
+ *
+ * Make libavformat demuxer access media content through a custom
+ * AVIOContext read callback.
+ * @example avio_reading.c
+ */
+
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+#include <libavformat/avio.h>
+#include <libavutil/file.h>
+
+struct buffer_data {
+ uint8_t *ptr;
+ size_t size; ///< size left in the buffer
+};
+
+static int read_packet(void *opaque, uint8_t *buf, int buf_size)
+{
+ struct buffer_data *bd = (struct buffer_data *)opaque;
+ buf_size = FFMIN(buf_size, bd->size);
+
+ printf("ptr:%p size:%zu\n", bd->ptr, bd->size);
+
+ /* copy internal buffer data to buf */
+ memcpy(buf, bd->ptr, buf_size);
+ bd->ptr += buf_size;
+ bd->size -= buf_size;
+
+ return buf_size;
+}
+
+int main(int argc, char *argv[])
+{
+ AVFormatContext *fmt_ctx = NULL;
+ AVIOContext *avio_ctx = NULL;
+ uint8_t *buffer = NULL, *avio_ctx_buffer = NULL;
+ size_t buffer_size, avio_ctx_buffer_size = 4096;
+ char *input_filename = NULL;
+ int ret = 0;
+ struct buffer_data bd = { 0 };
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s input_file\n"
+ "API example program to show how to read from a custom buffer "
+ "accessed through AVIOContext.\n", argv[0]);
+ return 1;
+ }
+ input_filename = argv[1];
+
+ /* register codecs and formats and other lavf/lavc components*/
+ av_register_all();
+
+ /* slurp file content into buffer */
+ ret = av_file_map(input_filename, &buffer, &buffer_size, 0, NULL);
+ if (ret < 0)
+ goto end;
+
+ /* fill opaque structure used by the AVIOContext read callback */
+ bd.ptr = buffer;
+ bd.size = buffer_size;
+
+ if (!(fmt_ctx = avformat_alloc_context())) {
+ ret = AVERROR(ENOMEM);
+ goto end;
+ }
+
+ avio_ctx_buffer = av_malloc(avio_ctx_buffer_size);
+ if (!avio_ctx_buffer) {
+ ret = AVERROR(ENOMEM);
+ goto end;
+ }
+ avio_ctx = avio_alloc_context(avio_ctx_buffer, avio_ctx_buffer_size,
+ 0, &bd, &read_packet, NULL, NULL);
+ if (!avio_ctx) {
+ ret = AVERROR(ENOMEM);
+ goto end;
+ }
+ fmt_ctx->pb = avio_ctx;
+
+ ret = avformat_open_input(&fmt_ctx, NULL, NULL, NULL);
+ if (ret < 0) {
+ fprintf(stderr, "Could not open input\n");
+ goto end;
+ }
+
+ ret = avformat_find_stream_info(fmt_ctx, NULL);
+ if (ret < 0) {
+ fprintf(stderr, "Could not find stream information\n");
+ goto end;
+ }
+
+ av_dump_format(fmt_ctx, 0, input_filename, 0);
+
+end:
+ avformat_close_input(&fmt_ctx);
+ /* note: the internal buffer could have changed, and be != avio_ctx_buffer */
+ if (avio_ctx) {
+ av_freep(&avio_ctx->buffer);
+ av_freep(&avio_ctx);
+ }
+ av_file_unmap(buffer, buffer_size);
+
+ if (ret < 0) {
+ fprintf(stderr, "Error occurred: %s\n", av_err2str(ret));
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/doc/examples/decoding_encoding.c b/chromium/third_party/ffmpeg/doc/examples/decoding_encoding.c
index 99aeb1c8ace..0585e518ad5 100644
--- a/chromium/third_party/ffmpeg/doc/examples/decoding_encoding.c
+++ b/chromium/third_party/ffmpeg/doc/examples/decoding_encoding.c
@@ -24,10 +24,10 @@
* @file
* libavcodec API use example.
*
+ * @example decoding_encoding.c
* Note that libavcodec only handles codecs (mpeg, mpeg4, etc...),
* not file formats (avi, vob, mp4, mov, mkv, mxf, flv, mpegts, mpegps, etc...). See library 'libavformat' for the
* format handling
- * @example doc/examples/decoding_encoding.c
*/
#include <math.h>
@@ -170,6 +170,10 @@ static void audio_encode_example(const char *filename)
* we calculate the size of the samples buffer in bytes */
buffer_size = av_samples_get_buffer_size(NULL, c->channels, c->frame_size,
c->sample_fmt, 0);
+ if (buffer_size < 0) {
+ fprintf(stderr, "Could not get sample buffer size\n");
+ exit(1);
+ }
samples = av_malloc(buffer_size);
if (!samples) {
fprintf(stderr, "Could not allocate %d bytes for samples buffer\n",
@@ -187,7 +191,7 @@ static void audio_encode_example(const char *filename)
/* encode a single tone sound */
t = 0;
tincr = 2 * M_PI * 440.0 / c->sample_rate;
- for(i=0;i<200;i++) {
+ for (i = 0; i < 200; i++) {
av_init_packet(&pkt);
pkt.data = NULL; // packet data will be allocated by the encoder
pkt.size = 0;
@@ -227,7 +231,7 @@ static void audio_encode_example(const char *filename)
fclose(f);
av_freep(&samples);
- avcodec_free_frame(&frame);
+ av_frame_free(&frame);
avcodec_close(c);
av_free(c);
}
@@ -291,8 +295,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
fprintf(stderr, "Could not allocate audio frame\n");
exit(1);
}
- } else
- avcodec_get_frame_defaults(decoded_frame);
+ }
len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
if (len < 0) {
@@ -304,6 +307,11 @@ static void audio_decode_example(const char *outfilename, const char *filename)
int data_size = av_samples_get_buffer_size(NULL, c->channels,
decoded_frame->nb_samples,
c->sample_fmt, 1);
+ if (data_size < 0) {
+ /* This should not occur, checking just for paranoia */
+ fprintf(stderr, "Failed to calculate data size\n");
+ exit(1);
+ }
fwrite(decoded_frame->data[0], 1, data_size, outfile);
}
avpkt.size -= len;
@@ -329,7 +337,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
avcodec_close(c);
av_free(c);
- avcodec_free_frame(&decoded_frame);
+ av_frame_free(&decoded_frame);
}
/*
@@ -366,12 +374,18 @@ static void video_encode_example(const char *filename, int codec_id)
c->width = 352;
c->height = 288;
/* frames per second */
- c->time_base= (AVRational){1,25};
- c->gop_size = 10; /* emit one intra frame every ten frames */
- c->max_b_frames=1;
+ c->time_base = (AVRational){1,25};
+ /* emit one intra frame every ten frames
+ * check frame pict_type before passing frame
+ * to encoder, if frame->pict_type is AV_PICTURE_TYPE_I
+ * then gop_size is ignored and the output of encoder
+ * will always be I frame irrespective to gop_size
+ */
+ c->gop_size = 10;
+ c->max_b_frames = 1;
c->pix_fmt = AV_PIX_FMT_YUV420P;
- if(codec_id == AV_CODEC_ID_H264)
+ if (codec_id == AV_CODEC_ID_H264)
av_opt_set(c->priv_data, "preset", "slow", 0);
/* open it */
@@ -405,7 +419,7 @@ static void video_encode_example(const char *filename, int codec_id)
}
/* encode 1 second of video */
- for(i=0;i<25;i++) {
+ for (i = 0; i < 25; i++) {
av_init_packet(&pkt);
pkt.data = NULL; // packet data will be allocated by the encoder
pkt.size = 0;
@@ -413,15 +427,15 @@ static void video_encode_example(const char *filename, int codec_id)
fflush(stdout);
/* prepare a dummy image */
/* Y */
- for(y=0;y<c->height;y++) {
- for(x=0;x<c->width;x++) {
+ for (y = 0; y < c->height; y++) {
+ for (x = 0; x < c->width; x++) {
frame->data[0][y * frame->linesize[0] + x] = x + y + i * 3;
}
}
/* Cb and Cr */
- for(y=0;y<c->height/2;y++) {
- for(x=0;x<c->width/2;x++) {
+ for (y = 0; y < c->height/2; y++) {
+ for (x = 0; x < c->width/2; x++) {
frame->data[1][y * frame->linesize[1] + x] = 128 + y + i * 2;
frame->data[2][y * frame->linesize[2] + x] = 64 + x + i * 5;
}
@@ -467,7 +481,7 @@ static void video_encode_example(const char *filename, int codec_id)
avcodec_close(c);
av_free(c);
av_freep(&frame->data[0]);
- avcodec_free_frame(&frame);
+ av_frame_free(&frame);
printf("\n");
}
@@ -481,10 +495,10 @@ static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize,
FILE *f;
int i;
- f=fopen(filename,"w");
- fprintf(f,"P5\n%d %d\n%d\n",xsize,ysize,255);
- for(i=0;i<ysize;i++)
- fwrite(buf + i * wrap,1,xsize,f);
+ f = fopen(filename,"w");
+ fprintf(f, "P5\n%d %d\n%d\n", xsize, ysize, 255);
+ for (i = 0; i < ysize; i++)
+ fwrite(buf + i * wrap, 1, xsize, f);
fclose(f);
}
@@ -572,7 +586,7 @@ static void video_decode_example(const char *outfilename, const char *filename)
}
frame_count = 0;
- for(;;) {
+ for (;;) {
avpkt.size = fread(inbuf, 1, INBUF_SIZE, f);
if (avpkt.size == 0)
break;
@@ -609,7 +623,7 @@ static void video_decode_example(const char *outfilename, const char *filename)
avcodec_close(c);
av_free(c);
- avcodec_free_frame(&frame);
+ av_frame_free(&frame);
printf("\n");
}
diff --git a/chromium/third_party/ffmpeg/doc/examples/demuxing_decoding.c b/chromium/third_party/ffmpeg/doc/examples/demuxing_decoding.c
index 1b5a9894710..2ce4018c79b 100644
--- a/chromium/third_party/ffmpeg/doc/examples/demuxing_decoding.c
+++ b/chromium/third_party/ffmpeg/doc/examples/demuxing_decoding.c
@@ -26,7 +26,7 @@
*
* Show how to use the libavformat and libavcodec API to demux and
* decode audio and video data.
- * @example doc/examples/demuxing_decoding.c
+ * @example demuxing_decoding.c
*/
#include <libavutil/imgutils.h>
@@ -76,7 +76,7 @@ static int decode_packet(int *got_frame, int cached)
/* decode video frame */
ret = avcodec_decode_video2(video_dec_ctx, frame, got_frame, &pkt);
if (ret < 0) {
- fprintf(stderr, "Error decoding video frame\n");
+ fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(ret));
return ret;
}
@@ -99,7 +99,7 @@ static int decode_packet(int *got_frame, int cached)
/* decode audio frame */
ret = avcodec_decode_audio4(audio_dec_ctx, frame, got_frame, &pkt);
if (ret < 0) {
- fprintf(stderr, "Error decoding audio frame\n");
+ fprintf(stderr, "Error decoding audio frame (%s)\n", av_err2str(ret));
return ret;
}
/* Some audio decoders decode only part of the packet, and have to be
@@ -159,7 +159,7 @@ static int open_codec_context(int *stream_idx,
if (!dec) {
fprintf(stderr, "Failed to find %s codec\n",
av_get_media_type_string(type));
- return ret;
+ return AVERROR(EINVAL);
}
/* Init the decoders, with or without reference counting */
@@ -279,7 +279,7 @@ int main (int argc, char **argv)
audio_dec_ctx = audio_stream->codec;
audio_dst_file = fopen(audio_dst_filename, "wb");
if (!audio_dst_file) {
- fprintf(stderr, "Could not open destination file %s\n", video_dst_filename);
+ fprintf(stderr, "Could not open destination file %s\n", audio_dst_filename);
ret = 1;
goto end;
}
diff --git a/chromium/third_party/ffmpeg/doc/examples/filter_audio.c b/chromium/third_party/ffmpeg/doc/examples/filter_audio.c
new file mode 100644
index 00000000000..8451f9cba22
--- /dev/null
+++ b/chromium/third_party/ffmpeg/doc/examples/filter_audio.c
@@ -0,0 +1,364 @@
+/*
+ * copyright (c) 2013 Andrew Kelley
+ *
+ * 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 API usage example.
+ *
+ * @example filter_audio.c
+ * This example will generate a sine wave audio,
+ * pass it through a simple filter chain, and then compute the MD5 checksum of
+ * the output data.
+ *
+ * The filter chain it uses is:
+ * (input) -> abuffer -> volume -> aformat -> abuffersink -> (output)
+ *
+ * abuffer: This provides the endpoint where you can feed the decoded samples.
+ * volume: In this example we hardcode it to 0.90.
+ * aformat: This converts the samples to the samplefreq, channel layout,
+ * and sample format required by the audio device.
+ * abuffersink: This provides the endpoint where you can read the samples after
+ * they have passed through the filter chain.
+ */
+
+#include <inttypes.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "libavutil/channel_layout.h"
+#include "libavutil/md5.h"
+#include "libavutil/opt.h"
+#include "libavutil/samplefmt.h"
+
+#include "libavfilter/avfilter.h"
+#include "libavfilter/buffersink.h"
+#include "libavfilter/buffersrc.h"
+
+#define INPUT_SAMPLERATE 48000
+#define INPUT_FORMAT AV_SAMPLE_FMT_FLTP
+#define INPUT_CHANNEL_LAYOUT AV_CH_LAYOUT_5POINT0
+
+#define VOLUME_VAL 0.90
+
+static int init_filter_graph(AVFilterGraph **graph, AVFilterContext **src,
+ AVFilterContext **sink)
+{
+ AVFilterGraph *filter_graph;
+ AVFilterContext *abuffer_ctx;
+ AVFilter *abuffer;
+ AVFilterContext *volume_ctx;
+ AVFilter *volume;
+ AVFilterContext *aformat_ctx;
+ AVFilter *aformat;
+ AVFilterContext *abuffersink_ctx;
+ AVFilter *abuffersink;
+
+ AVDictionary *options_dict = NULL;
+ uint8_t options_str[1024];
+ uint8_t ch_layout[64];
+
+ int err;
+
+ /* Create a new filtergraph, which will contain all the filters. */
+ filter_graph = avfilter_graph_alloc();
+ if (!filter_graph) {
+ fprintf(stderr, "Unable to create filter graph.\n");
+ return AVERROR(ENOMEM);
+ }
+
+ /* Create the abuffer filter;
+ * it will be used for feeding the data into the graph. */
+ abuffer = avfilter_get_by_name("abuffer");
+ if (!abuffer) {
+ fprintf(stderr, "Could not find the abuffer filter.\n");
+ return AVERROR_FILTER_NOT_FOUND;
+ }
+
+ abuffer_ctx = avfilter_graph_alloc_filter(filter_graph, abuffer, "src");
+ if (!abuffer_ctx) {
+ fprintf(stderr, "Could not allocate the abuffer instance.\n");
+ return AVERROR(ENOMEM);
+ }
+
+ /* Set the filter options through the AVOptions API. */
+ av_get_channel_layout_string(ch_layout, sizeof(ch_layout), 0, INPUT_CHANNEL_LAYOUT);
+ av_opt_set (abuffer_ctx, "channel_layout", ch_layout, AV_OPT_SEARCH_CHILDREN);
+ av_opt_set (abuffer_ctx, "sample_fmt", av_get_sample_fmt_name(INPUT_FORMAT), AV_OPT_SEARCH_CHILDREN);
+ av_opt_set_q (abuffer_ctx, "time_base", (AVRational){ 1, INPUT_SAMPLERATE }, AV_OPT_SEARCH_CHILDREN);
+ av_opt_set_int(abuffer_ctx, "sample_rate", INPUT_SAMPLERATE, AV_OPT_SEARCH_CHILDREN);
+
+ /* Now initialize the filter; we pass NULL options, since we have already
+ * set all the options above. */
+ err = avfilter_init_str(abuffer_ctx, NULL);
+ if (err < 0) {
+ fprintf(stderr, "Could not initialize the abuffer filter.\n");
+ return err;
+ }
+
+ /* Create volume filter. */
+ volume = avfilter_get_by_name("volume");
+ if (!volume) {
+ fprintf(stderr, "Could not find the volume filter.\n");
+ return AVERROR_FILTER_NOT_FOUND;
+ }
+
+ volume_ctx = avfilter_graph_alloc_filter(filter_graph, volume, "volume");
+ if (!volume_ctx) {
+ fprintf(stderr, "Could not allocate the volume instance.\n");
+ return AVERROR(ENOMEM);
+ }
+
+ /* A different way of passing the options is as key/value pairs in a
+ * dictionary. */
+ av_dict_set(&options_dict, "volume", AV_STRINGIFY(VOLUME_VAL), 0);
+ err = avfilter_init_dict(volume_ctx, &options_dict);
+ av_dict_free(&options_dict);
+ if (err < 0) {
+ fprintf(stderr, "Could not initialize the volume filter.\n");
+ return err;
+ }
+
+ /* Create the aformat filter;
+ * it ensures that the output is of the format we want. */
+ aformat = avfilter_get_by_name("aformat");
+ if (!aformat) {
+ fprintf(stderr, "Could not find the aformat filter.\n");
+ return AVERROR_FILTER_NOT_FOUND;
+ }
+
+ aformat_ctx = avfilter_graph_alloc_filter(filter_graph, aformat, "aformat");
+ if (!aformat_ctx) {
+ fprintf(stderr, "Could not allocate the aformat instance.\n");
+ return AVERROR(ENOMEM);
+ }
+
+ /* A third way of passing the options is in a string of the form
+ * key1=value1:key2=value2.... */
+ snprintf(options_str, sizeof(options_str),
+ "sample_fmts=%s:sample_rates=%d:channel_layouts=0x%"PRIx64,
+ av_get_sample_fmt_name(AV_SAMPLE_FMT_S16), 44100,
+ (uint64_t)AV_CH_LAYOUT_STEREO);
+ err = avfilter_init_str(aformat_ctx, options_str);
+ if (err < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Could not initialize the aformat filter.\n");
+ return err;
+ }
+
+ /* Finally create the abuffersink filter;
+ * it will be used to get the filtered data out of the graph. */
+ abuffersink = avfilter_get_by_name("abuffersink");
+ if (!abuffersink) {
+ fprintf(stderr, "Could not find the abuffersink filter.\n");
+ return AVERROR_FILTER_NOT_FOUND;
+ }
+
+ abuffersink_ctx = avfilter_graph_alloc_filter(filter_graph, abuffersink, "sink");
+ if (!abuffersink_ctx) {
+ fprintf(stderr, "Could not allocate the abuffersink instance.\n");
+ return AVERROR(ENOMEM);
+ }
+
+ /* This filter takes no options. */
+ err = avfilter_init_str(abuffersink_ctx, NULL);
+ if (err < 0) {
+ fprintf(stderr, "Could not initialize the abuffersink instance.\n");
+ return err;
+ }
+
+ /* Connect the filters;
+ * in this simple case the filters just form a linear chain. */
+ err = avfilter_link(abuffer_ctx, 0, volume_ctx, 0);
+ if (err >= 0)
+ err = avfilter_link(volume_ctx, 0, aformat_ctx, 0);
+ if (err >= 0)
+ err = avfilter_link(aformat_ctx, 0, abuffersink_ctx, 0);
+ if (err < 0) {
+ fprintf(stderr, "Error connecting filters\n");
+ return err;
+ }
+
+ /* Configure the graph. */
+ err = avfilter_graph_config(filter_graph, NULL);
+ if (err < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error configuring the filter graph\n");
+ return err;
+ }
+
+ *graph = filter_graph;
+ *src = abuffer_ctx;
+ *sink = abuffersink_ctx;
+
+ return 0;
+}
+
+/* Do something useful with the filtered data: this simple
+ * example just prints the MD5 checksum of each plane to stdout. */
+static int process_output(struct AVMD5 *md5, AVFrame *frame)
+{
+ int planar = av_sample_fmt_is_planar(frame->format);
+ int channels = av_get_channel_layout_nb_channels(frame->channel_layout);
+ int planes = planar ? channels : 1;
+ int bps = av_get_bytes_per_sample(frame->format);
+ int plane_size = bps * frame->nb_samples * (planar ? 1 : channels);
+ int i, j;
+
+ for (i = 0; i < planes; i++) {
+ uint8_t checksum[16];
+
+ av_md5_init(md5);
+ av_md5_sum(checksum, frame->extended_data[i], plane_size);
+
+ fprintf(stdout, "plane %d: 0x", i);
+ for (j = 0; j < sizeof(checksum); j++)
+ fprintf(stdout, "%02X", checksum[j]);
+ fprintf(stdout, "\n");
+ }
+ fprintf(stdout, "\n");
+
+ return 0;
+}
+
+/* Construct a frame of audio data to be filtered;
+ * this simple example just synthesizes a sine wave. */
+static int get_input(AVFrame *frame, int frame_num)
+{
+ int err, i, j;
+
+#define FRAME_SIZE 1024
+
+ /* Set up the frame properties and allocate the buffer for the data. */
+ frame->sample_rate = INPUT_SAMPLERATE;
+ frame->format = INPUT_FORMAT;
+ frame->channel_layout = INPUT_CHANNEL_LAYOUT;
+ frame->nb_samples = FRAME_SIZE;
+ frame->pts = frame_num * FRAME_SIZE;
+
+ err = av_frame_get_buffer(frame, 0);
+ if (err < 0)
+ return err;
+
+ /* Fill the data for each channel. */
+ for (i = 0; i < 5; i++) {
+ float *data = (float*)frame->extended_data[i];
+
+ for (j = 0; j < frame->nb_samples; j++)
+ data[j] = sin(2 * M_PI * (frame_num + j) * (i + 1) / FRAME_SIZE);
+ }
+
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ struct AVMD5 *md5;
+ AVFilterGraph *graph;
+ AVFilterContext *src, *sink;
+ AVFrame *frame;
+ uint8_t errstr[1024];
+ float duration;
+ int err, nb_frames, i;
+
+ if (argc < 2) {
+ fprintf(stderr, "Usage: %s <duration>\n", argv[0]);
+ return 1;
+ }
+
+ duration = atof(argv[1]);
+ nb_frames = duration * INPUT_SAMPLERATE / FRAME_SIZE;
+ if (nb_frames <= 0) {
+ fprintf(stderr, "Invalid duration: %s\n", argv[1]);
+ return 1;
+ }
+
+ avfilter_register_all();
+
+ /* Allocate the frame we will be using to store the data. */
+ frame = av_frame_alloc();
+ if (!frame) {
+ fprintf(stderr, "Error allocating the frame\n");
+ return 1;
+ }
+
+ md5 = av_md5_alloc();
+ if (!md5) {
+ fprintf(stderr, "Error allocating the MD5 context\n");
+ return 1;
+ }
+
+ /* Set up the filtergraph. */
+ err = init_filter_graph(&graph, &src, &sink);
+ if (err < 0) {
+ fprintf(stderr, "Unable to init filter graph:");
+ goto fail;
+ }
+
+ /* the main filtering loop */
+ for (i = 0; i < nb_frames; i++) {
+ /* get an input frame to be filtered */
+ err = get_input(frame, i);
+ if (err < 0) {
+ fprintf(stderr, "Error generating input frame:");
+ goto fail;
+ }
+
+ /* Send the frame to the input of the filtergraph. */
+ err = av_buffersrc_add_frame(src, frame);
+ if (err < 0) {
+ av_frame_unref(frame);
+ fprintf(stderr, "Error submitting the frame to the filtergraph:");
+ goto fail;
+ }
+
+ /* Get all the filtered output that is available. */
+ while ((err = av_buffersink_get_frame(sink, frame)) >= 0) {
+ /* now do something with our filtered frame */
+ err = process_output(md5, frame);
+ if (err < 0) {
+ fprintf(stderr, "Error processing the filtered frame:");
+ goto fail;
+ }
+ av_frame_unref(frame);
+ }
+
+ if (err == AVERROR(EAGAIN)) {
+ /* Need to feed more frames in. */
+ continue;
+ } else if (err == AVERROR_EOF) {
+ /* Nothing more to do, finish. */
+ break;
+ } else if (err < 0) {
+ /* An error occurred. */
+ fprintf(stderr, "Error filtering the data:");
+ goto fail;
+ }
+ }
+
+ avfilter_graph_free(&graph);
+ av_frame_free(&frame);
+ av_freep(&md5);
+
+ return 0;
+
+fail:
+ av_strerror(err, errstr, sizeof(errstr));
+ fprintf(stderr, "%s\n", errstr);
+ return 1;
+}
diff --git a/chromium/third_party/ffmpeg/doc/examples/filtering_audio.c b/chromium/third_party/ffmpeg/doc/examples/filtering_audio.c
index 1d66ca33e34..46595fb3b8f 100644
--- a/chromium/third_party/ffmpeg/doc/examples/filtering_audio.c
+++ b/chromium/third_party/ffmpeg/doc/examples/filtering_audio.c
@@ -25,7 +25,7 @@
/**
* @file
* API example for audio decoding and filtering
- * @example doc/examples/filtering_audio.c
+ * @example filtering_audio.c
*/
#include <unistd.h>
@@ -210,7 +210,6 @@ int main(int argc, char **argv)
exit(1);
}
- avcodec_register_all();
av_register_all();
avfilter_register_all();
@@ -230,7 +229,6 @@ int main(int argc, char **argv)
}
if (packet.stream_index == audio_stream_index) {
- avcodec_get_frame_defaults(frame);
got_frame = 0;
ret = avcodec_decode_audio4(dec_ctx, frame, &got_frame, &packet);
if (ret < 0) {
diff --git a/chromium/third_party/ffmpeg/doc/examples/filtering_video.c b/chromium/third_party/ffmpeg/doc/examples/filtering_video.c
index 790c6418ed5..8d595735b3b 100644
--- a/chromium/third_party/ffmpeg/doc/examples/filtering_video.c
+++ b/chromium/third_party/ffmpeg/doc/examples/filtering_video.c
@@ -24,7 +24,7 @@
/**
* @file
* API example for decoding and filtering
- * @example doc/examples/filtering_video.c
+ * @example filtering_video.c
*/
#define _XOPEN_SOURCE 600 /* for usleep */
@@ -200,7 +200,6 @@ int main(int argc, char **argv)
exit(1);
}
- avcodec_register_all();
av_register_all();
avfilter_register_all();
@@ -215,7 +214,6 @@ int main(int argc, char **argv)
break;
if (packet.stream_index == video_stream_index) {
- avcodec_get_frame_defaults(frame);
got_frame = 0;
ret = avcodec_decode_video2(dec_ctx, frame, &got_frame, &packet);
if (ret < 0) {
diff --git a/chromium/third_party/ffmpeg/doc/examples/metadata.c b/chromium/third_party/ffmpeg/doc/examples/metadata.c
index 9c1bcd79d99..f73c2673692 100644
--- a/chromium/third_party/ffmpeg/doc/examples/metadata.c
+++ b/chromium/third_party/ffmpeg/doc/examples/metadata.c
@@ -23,7 +23,7 @@
/**
* @file
* Shows how the metadata API can be used in application programs.
- * @example doc/examples/metadata.c
+ * @example metadata.c
*/
#include <stdio.h>
diff --git a/chromium/third_party/ffmpeg/doc/examples/muxing.c b/chromium/third_party/ffmpeg/doc/examples/muxing.c
index 4276114306e..ad8e027148d 100644
--- a/chromium/third_party/ffmpeg/doc/examples/muxing.c
+++ b/chromium/third_party/ffmpeg/doc/examples/muxing.c
@@ -24,9 +24,9 @@
* @file
* libavformat API example.
*
- * Output a media file in any supported libavformat format.
- * The default codecs are used.
- * @example doc/examples/muxing.c
+ * Output a media file in any supported libavformat format. The default
+ * codecs are used.
+ * @example muxing.c
*/
#include <stdlib.h>
@@ -36,18 +36,43 @@
#include <libavutil/opt.h>
#include <libavutil/mathematics.h>
+#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libswresample/swresample.h>
-/* 5 seconds stream duration */
-#define STREAM_DURATION 200.0
+static int audio_is_eof, video_is_eof;
+
+#define STREAM_DURATION 10.0
#define STREAM_FRAME_RATE 25 /* 25 images/s */
-#define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
#define STREAM_PIX_FMT AV_PIX_FMT_YUV420P /* default pix_fmt */
static int sws_flags = SWS_BICUBIC;
+static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt)
+{
+ AVRational *time_base = &fmt_ctx->streams[pkt->stream_index]->time_base;
+
+ printf("pts:%s pts_time:%s dts:%s dts_time:%s duration:%s duration_time:%s stream_index:%d\n",
+ av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, time_base),
+ av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, time_base),
+ av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, time_base),
+ pkt->stream_index);
+}
+
+static int write_frame(AVFormatContext *fmt_ctx, const AVRational *time_base, AVStream *st, AVPacket *pkt)
+{
+ /* rescale output packet timestamp values from codec to stream timebase */
+ pkt->pts = av_rescale_q_rnd(pkt->pts, *time_base, st->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+ pkt->dts = av_rescale_q_rnd(pkt->dts, *time_base, st->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+ pkt->duration = av_rescale_q(pkt->duration, *time_base, st->time_base);
+ pkt->stream_index = st->index;
+
+ /* Write the compressed frame to the media file. */
+ log_packet(fmt_ctx, pkt);
+ return av_interleaved_write_frame(fmt_ctx, pkt);
+}
+
/* Add an output stream. */
static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
enum AVCodecID codec_id)
@@ -73,7 +98,8 @@ static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
switch ((*codec)->type) {
case AVMEDIA_TYPE_AUDIO:
- c->sample_fmt = AV_SAMPLE_FMT_FLTP;
+ c->sample_fmt = (*codec)->sample_fmts ?
+ (*codec)->sample_fmts[0] : AV_SAMPLE_FMT_FLTP;
c->bit_rate = 64000;
c->sample_rate = 44100;
c->channels = 2;
@@ -122,6 +148,7 @@ static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
static float t, tincr, tincr2;
+AVFrame *audio_frame;
static uint8_t **src_samples_data;
static int src_samples_linesize;
static int src_nb_samples;
@@ -130,6 +157,7 @@ static int max_dst_nb_samples;
uint8_t **dst_samples_data;
int dst_samples_linesize;
int dst_samples_size;
+int samples_count;
struct SwrContext *swr_ctx = NULL;
@@ -140,6 +168,13 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st)
c = st->codec;
+ /* allocate and init a re-usable frame */
+ audio_frame = av_frame_alloc();
+ if (!audio_frame) {
+ fprintf(stderr, "Could not allocate audio frame\n");
+ exit(1);
+ }
+
/* open it */
ret = avcodec_open2(c, codec, NULL);
if (ret < 0) {
@@ -157,12 +192,17 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st)
10000 : c->frame_size;
ret = av_samples_alloc_array_and_samples(&src_samples_data, &src_samples_linesize, c->channels,
- src_nb_samples, c->sample_fmt, 0);
+ src_nb_samples, AV_SAMPLE_FMT_S16, 0);
if (ret < 0) {
fprintf(stderr, "Could not allocate source samples\n");
exit(1);
}
+ /* compute the number of converted samples: buffering is avoided
+ * ensuring that the output buffer will contain at least all the
+ * converted input samples */
+ max_dst_nb_samples = src_nb_samples;
+
/* create resampler context */
if (c->sample_fmt != AV_SAMPLE_FMT_S16) {
swr_ctx = swr_alloc();
@@ -184,17 +224,15 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st)
fprintf(stderr, "Failed to initialize the resampling context\n");
exit(1);
}
- }
- /* compute the number of converted samples: buffering is avoided
- * ensuring that the output buffer will contain at least all the
- * converted input samples */
- max_dst_nb_samples = src_nb_samples;
- ret = av_samples_alloc_array_and_samples(&dst_samples_data, &dst_samples_linesize, c->channels,
- max_dst_nb_samples, c->sample_fmt, 0);
- if (ret < 0) {
- fprintf(stderr, "Could not allocate destination samples\n");
- exit(1);
+ ret = av_samples_alloc_array_and_samples(&dst_samples_data, &dst_samples_linesize, c->channels,
+ max_dst_nb_samples, c->sample_fmt, 0);
+ if (ret < 0) {
+ fprintf(stderr, "Could not allocate destination samples\n");
+ exit(1);
+ }
+ } else {
+ dst_samples_data = src_samples_data;
}
dst_samples_size = av_samples_get_buffer_size(NULL, c->channels, max_dst_nb_samples,
c->sample_fmt, 0);
@@ -217,77 +255,83 @@ static void get_audio_frame(int16_t *samples, int frame_size, int nb_channels)
}
}
-static void write_audio_frame(AVFormatContext *oc, AVStream *st)
+static void write_audio_frame(AVFormatContext *oc, AVStream *st, int flush)
{
AVCodecContext *c;
AVPacket pkt = { 0 }; // data and size must be 0;
- AVFrame *frame = av_frame_alloc();
int got_packet, ret, dst_nb_samples;
av_init_packet(&pkt);
c = st->codec;
- get_audio_frame((int16_t *)src_samples_data[0], src_nb_samples, c->channels);
-
- /* convert samples from native format to destination codec format, using the resampler */
- if (swr_ctx) {
- /* compute destination number of samples */
- dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, c->sample_rate) + src_nb_samples,
- c->sample_rate, c->sample_rate, AV_ROUND_UP);
- if (dst_nb_samples > max_dst_nb_samples) {
- av_free(dst_samples_data[0]);
- ret = av_samples_alloc(dst_samples_data, &dst_samples_linesize, c->channels,
- dst_nb_samples, c->sample_fmt, 0);
- if (ret < 0)
+ if (!flush) {
+ get_audio_frame((int16_t *)src_samples_data[0], src_nb_samples, c->channels);
+
+ /* convert samples from native format to destination codec format, using the resampler */
+ if (swr_ctx) {
+ /* compute destination number of samples */
+ dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, c->sample_rate) + src_nb_samples,
+ c->sample_rate, c->sample_rate, AV_ROUND_UP);
+ if (dst_nb_samples > max_dst_nb_samples) {
+ av_free(dst_samples_data[0]);
+ ret = av_samples_alloc(dst_samples_data, &dst_samples_linesize, c->channels,
+ dst_nb_samples, c->sample_fmt, 0);
+ if (ret < 0)
+ exit(1);
+ max_dst_nb_samples = dst_nb_samples;
+ dst_samples_size = av_samples_get_buffer_size(NULL, c->channels, dst_nb_samples,
+ c->sample_fmt, 0);
+ }
+
+ /* convert to destination format */
+ ret = swr_convert(swr_ctx,
+ dst_samples_data, dst_nb_samples,
+ (const uint8_t **)src_samples_data, src_nb_samples);
+ if (ret < 0) {
+ fprintf(stderr, "Error while converting\n");
exit(1);
- max_dst_nb_samples = dst_nb_samples;
- dst_samples_size = av_samples_get_buffer_size(NULL, c->channels, dst_nb_samples,
- c->sample_fmt, 0);
+ }
+ } else {
+ dst_nb_samples = src_nb_samples;
}
- /* convert to destination format */
- ret = swr_convert(swr_ctx,
- dst_samples_data, dst_nb_samples,
- (const uint8_t **)src_samples_data, src_nb_samples);
- if (ret < 0) {
- fprintf(stderr, "Error while converting\n");
- exit(1);
- }
- } else {
- dst_samples_data[0] = src_samples_data[0];
- dst_nb_samples = src_nb_samples;
+ audio_frame->nb_samples = dst_nb_samples;
+ audio_frame->pts = av_rescale_q(samples_count, (AVRational){1, c->sample_rate}, c->time_base);
+ avcodec_fill_audio_frame(audio_frame, c->channels, c->sample_fmt,
+ dst_samples_data[0], dst_samples_size, 0);
+ samples_count += dst_nb_samples;
}
- frame->nb_samples = dst_nb_samples;
- avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt,
- dst_samples_data[0], dst_samples_size, 0);
-
- ret = avcodec_encode_audio2(c, &pkt, frame, &got_packet);
+ ret = avcodec_encode_audio2(c, &pkt, flush ? NULL : audio_frame, &got_packet);
if (ret < 0) {
fprintf(stderr, "Error encoding audio frame: %s\n", av_err2str(ret));
exit(1);
}
- if (!got_packet)
+ if (!got_packet) {
+ if (flush)
+ audio_is_eof = 1;
return;
+ }
- pkt.stream_index = st->index;
-
- /* Write the compressed frame to the media file. */
- ret = av_interleaved_write_frame(oc, &pkt);
- if (ret != 0) {
+ ret = write_frame(oc, &c->time_base, st, &pkt);
+ if (ret < 0) {
fprintf(stderr, "Error while writing audio frame: %s\n",
av_err2str(ret));
exit(1);
}
- avcodec_free_frame(&frame);
}
static void close_audio(AVFormatContext *oc, AVStream *st)
{
avcodec_close(st->codec);
+ if (dst_samples_data != src_samples_data) {
+ av_free(dst_samples_data[0]);
+ av_free(dst_samples_data);
+ }
av_free(src_samples_data[0]);
- av_free(dst_samples_data[0]);
+ av_free(src_samples_data);
+ av_frame_free(&audio_frame);
}
/**************************************************************/
@@ -315,6 +359,9 @@ static void open_video(AVFormatContext *oc, AVCodec *codec, AVStream *st)
fprintf(stderr, "Could not allocate video frame\n");
exit(1);
}
+ frame->format = c->pix_fmt;
+ frame->width = c->width;
+ frame->height = c->height;
/* Allocate the encoded raw picture. */
ret = avpicture_alloc(&dst_picture, c->pix_fmt, c->width, c->height);
@@ -361,17 +408,13 @@ static void fill_yuv_image(AVPicture *pict, int frame_index,
}
}
-static void write_video_frame(AVFormatContext *oc, AVStream *st)
+static void write_video_frame(AVFormatContext *oc, AVStream *st, int flush)
{
int ret;
static struct SwsContext *sws_ctx;
AVCodecContext *c = st->codec;
- if (frame_count >= STREAM_NB_FRAMES) {
- /* No more frames to compress. The codec has a latency of a few
- * frames if using B-frames, so we get the last frames by
- * passing the same picture again. */
- } else {
+ if (!flush) {
if (c->pix_fmt != AV_PIX_FMT_YUV420P) {
/* as we only generate a YUV420P picture, we must convert it
* to the codec pixel format if needed */
@@ -394,7 +437,7 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
}
}
- if (oc->oformat->flags & AVFMT_RAWPICTURE) {
+ if (oc->oformat->flags & AVFMT_RAWPICTURE && !flush) {
/* Raw video case - directly store the picture in the packet */
AVPacket pkt;
av_init_packet(&pkt);
@@ -411,23 +454,24 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
av_init_packet(&pkt);
/* encode the image */
- ret = avcodec_encode_video2(c, &pkt, frame, &got_packet);
+ frame->pts = frame_count;
+ ret = avcodec_encode_video2(c, &pkt, flush ? NULL : frame, &got_packet);
if (ret < 0) {
fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret));
exit(1);
}
/* If size is zero, it means the image was buffered. */
- if (!ret && got_packet && pkt.size) {
- pkt.stream_index = st->index;
-
- /* Write the compressed frame to the media file. */
- ret = av_interleaved_write_frame(oc, &pkt);
+ if (got_packet) {
+ ret = write_frame(oc, &c->time_base, st, &pkt);
} else {
+ if (flush)
+ video_is_eof = 1;
ret = 0;
}
}
- if (ret != 0) {
+
+ if (ret < 0) {
fprintf(stderr, "Error while writing video frame: %s\n", av_err2str(ret));
exit(1);
}
@@ -439,7 +483,7 @@ static void close_video(AVFormatContext *oc, AVStream *st)
avcodec_close(st->codec);
av_free(src_picture.data[0]);
av_free(dst_picture.data[0]);
- av_free(frame);
+ av_frame_free(&frame);
}
/**************************************************************/
@@ -453,7 +497,7 @@ int main(int argc, char **argv)
AVStream *audio_st, *video_st;
AVCodec *audio_codec, *video_codec;
double audio_time, video_time;
- int ret;
+ int flush, ret;
/* Initialize libavcodec, and register all codecs and formats. */
av_register_all();
@@ -477,9 +521,9 @@ int main(int argc, char **argv)
printf("Could not deduce output format from file extension: using MPEG.\n");
avformat_alloc_output_context2(&oc, NULL, "mpeg", filename);
}
- if (!oc) {
+ if (!oc)
return 1;
- }
+
fmt = oc->oformat;
/* Add the audio and video streams using the default format codecs
@@ -487,12 +531,10 @@ int main(int argc, char **argv)
video_st = NULL;
audio_st = NULL;
- if (fmt->video_codec != AV_CODEC_ID_NONE) {
+ if (fmt->video_codec != AV_CODEC_ID_NONE)
video_st = add_stream(oc, &video_codec, fmt->video_codec);
- }
- if (fmt->audio_codec != AV_CODEC_ID_NONE) {
+ if (fmt->audio_codec != AV_CODEC_ID_NONE)
audio_st = add_stream(oc, &audio_codec, fmt->audio_codec);
- }
/* Now that all the parameters are set, we can open the audio and
* video codecs and allocate the necessary encode buffers. */
@@ -521,23 +563,23 @@ int main(int argc, char **argv)
return 1;
}
- if (frame)
- frame->pts = 0;
- for (;;) {
+ flush = 0;
+ while ((video_st && !video_is_eof) || (audio_st && !audio_is_eof)) {
/* Compute current audio and video time. */
- audio_time = audio_st ? audio_st->pts.val * av_q2d(audio_st->time_base) : 0.0;
- video_time = video_st ? video_st->pts.val * av_q2d(video_st->time_base) : 0.0;
+ audio_time = (audio_st && !audio_is_eof) ? audio_st->pts.val * av_q2d(audio_st->time_base) : INFINITY;
+ video_time = (video_st && !video_is_eof) ? video_st->pts.val * av_q2d(video_st->time_base) : INFINITY;
- if ((!audio_st || audio_time >= STREAM_DURATION) &&
- (!video_st || video_time >= STREAM_DURATION))
- break;
+ if (!flush &&
+ (!audio_st || audio_time >= STREAM_DURATION) &&
+ (!video_st || video_time >= STREAM_DURATION)) {
+ flush = 1;
+ }
/* write interleaved audio and video frames */
- if (!video_st || (video_st && audio_st && audio_time < video_time)) {
- write_audio_frame(oc, audio_st);
- } else {
- write_video_frame(oc, video_st);
- frame->pts += av_rescale_q(1, video_st->codec->time_base, video_st->time_base);
+ if (audio_st && !audio_is_eof && audio_time <= video_time) {
+ write_audio_frame(oc, audio_st, flush);
+ } else if (video_st && !video_is_eof && video_time < audio_time) {
+ write_video_frame(oc, video_st, flush);
}
}
diff --git a/chromium/third_party/ffmpeg/doc/examples/remuxing.c b/chromium/third_party/ffmpeg/doc/examples/remuxing.c
new file mode 100644
index 00000000000..39d9dee8625
--- /dev/null
+++ b/chromium/third_party/ffmpeg/doc/examples/remuxing.c
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2013 Stefano Sabatini
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * @file
+ * libavformat/libavcodec demuxing and muxing API example.
+ *
+ * Remux streams from one container format to another.
+ * @example remuxing.c
+ */
+
+#include <libavutil/timestamp.h>
+#include <libavformat/avformat.h>
+
+static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt, const char *tag)
+{
+ AVRational *time_base = &fmt_ctx->streams[pkt->stream_index]->time_base;
+
+ printf("%s: pts:%s pts_time:%s dts:%s dts_time:%s duration:%s duration_time:%s stream_index:%d\n",
+ tag,
+ av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, time_base),
+ av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, time_base),
+ av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, time_base),
+ pkt->stream_index);
+}
+
+int main(int argc, char **argv)
+{
+ AVOutputFormat *ofmt = NULL;
+ AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL;
+ AVPacket pkt;
+ const char *in_filename, *out_filename;
+ int ret, i;
+
+ if (argc < 3) {
+ printf("usage: %s input output\n"
+ "API example program to remux a media file with libavformat and libavcodec.\n"
+ "The output format is guessed according to the file extension.\n"
+ "\n", argv[0]);
+ return 1;
+ }
+
+ in_filename = argv[1];
+ out_filename = argv[2];
+
+ av_register_all();
+
+ if ((ret = avformat_open_input(&ifmt_ctx, in_filename, 0, 0)) < 0) {
+ fprintf(stderr, "Could not open input file '%s'", in_filename);
+ goto end;
+ }
+
+ if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) < 0) {
+ fprintf(stderr, "Failed to retrieve input stream information");
+ goto end;
+ }
+
+ av_dump_format(ifmt_ctx, 0, in_filename, 0);
+
+ avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, out_filename);
+ if (!ofmt_ctx) {
+ fprintf(stderr, "Could not create output context\n");
+ ret = AVERROR_UNKNOWN;
+ goto end;
+ }
+
+ ofmt = ofmt_ctx->oformat;
+
+ for (i = 0; i < ifmt_ctx->nb_streams; i++) {
+ AVStream *in_stream = ifmt_ctx->streams[i];
+ AVStream *out_stream = avformat_new_stream(ofmt_ctx, in_stream->codec->codec);
+ if (!out_stream) {
+ fprintf(stderr, "Failed allocating output stream\n");
+ ret = AVERROR_UNKNOWN;
+ goto end;
+ }
+
+ ret = avcodec_copy_context(out_stream->codec, in_stream->codec);
+ if (ret < 0) {
+ fprintf(stderr, "Failed to copy context from input to output stream codec context\n");
+ goto end;
+ }
+ out_stream->codec->codec_tag = 0;
+ if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
+ out_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ }
+ av_dump_format(ofmt_ctx, 0, out_filename, 1);
+
+ if (!(ofmt->flags & AVFMT_NOFILE)) {
+ ret = avio_open(&ofmt_ctx->pb, out_filename, AVIO_FLAG_WRITE);
+ if (ret < 0) {
+ fprintf(stderr, "Could not open output file '%s'", out_filename);
+ goto end;
+ }
+ }
+
+ ret = avformat_write_header(ofmt_ctx, NULL);
+ if (ret < 0) {
+ fprintf(stderr, "Error occurred when opening output file\n");
+ goto end;
+ }
+
+ while (1) {
+ AVStream *in_stream, *out_stream;
+
+ ret = av_read_frame(ifmt_ctx, &pkt);
+ if (ret < 0)
+ break;
+
+ in_stream = ifmt_ctx->streams[pkt.stream_index];
+ out_stream = ofmt_ctx->streams[pkt.stream_index];
+
+ log_packet(ifmt_ctx, &pkt, "in");
+
+ /* copy packet */
+ pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+ pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+ pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
+ pkt.pos = -1;
+ log_packet(ofmt_ctx, &pkt, "out");
+
+ ret = av_interleaved_write_frame(ofmt_ctx, &pkt);
+ if (ret < 0) {
+ fprintf(stderr, "Error muxing packet\n");
+ break;
+ }
+ av_free_packet(&pkt);
+ }
+
+ av_write_trailer(ofmt_ctx);
+end:
+
+ avformat_close_input(&ifmt_ctx);
+
+ /* close output */
+ if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE))
+ avio_close(ofmt_ctx->pb);
+ avformat_free_context(ofmt_ctx);
+
+ if (ret < 0 && ret != AVERROR_EOF) {
+ fprintf(stderr, "Error occurred: %s\n", av_err2str(ret));
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/doc/examples/resampling_audio.c b/chromium/third_party/ffmpeg/doc/examples/resampling_audio.c
index f9bfb92cfd2..f743cbe550d 100644
--- a/chromium/third_party/ffmpeg/doc/examples/resampling_audio.c
+++ b/chromium/third_party/ffmpeg/doc/examples/resampling_audio.c
@@ -21,7 +21,7 @@
*/
/**
- * @example doc/examples/resampling_audio.c
+ * @example resampling_audio.c
* libswresample API use example.
*/
@@ -184,6 +184,10 @@ int main(int argc, char **argv)
}
dst_bufsize = av_samples_get_buffer_size(&dst_linesize, dst_nb_channels,
ret, dst_sample_fmt, 1);
+ if (dst_bufsize < 0) {
+ fprintf(stderr, "Could not get sample buffer size\n");
+ goto end;
+ }
printf("t:%f in:%d out:%d\n", t, src_nb_samples, ret);
fwrite(dst_data[0], 1, dst_bufsize, dst_file);
} while (t < 10);
diff --git a/chromium/third_party/ffmpeg/doc/examples/scaling_video.c b/chromium/third_party/ffmpeg/doc/examples/scaling_video.c
index be2c510ffa6..fcb98b7489a 100644
--- a/chromium/third_party/ffmpeg/doc/examples/scaling_video.c
+++ b/chromium/third_party/ffmpeg/doc/examples/scaling_video.c
@@ -23,7 +23,7 @@
/**
* @file
* libswscale API use example.
- * @example doc/examples/scaling_video.c
+ * @example scaling_video.c
*/
#include <libavutil/imgutils.h>
diff --git a/chromium/third_party/ffmpeg/doc/examples/transcode_aac.c b/chromium/third_party/ffmpeg/doc/examples/transcode_aac.c
index 35deb4c03e1..bf0128f68dd 100644
--- a/chromium/third_party/ffmpeg/doc/examples/transcode_aac.c
+++ b/chromium/third_party/ffmpeg/doc/examples/transcode_aac.c
@@ -17,7 +17,10 @@
*/
/**
- * @file simple audio converter
+ * @file
+ * simple audio converter
+ *
+ * @example transcode_aac.c
* Convert an input audio file to AAC in an MP4 container using FFmpeg.
* @author Andreas Unterweger (dustsigns@gmail.com)
*/
diff --git a/chromium/third_party/ffmpeg/doc/examples/transcoding.c b/chromium/third_party/ffmpeg/doc/examples/transcoding.c
new file mode 100644
index 00000000000..5194de33f4a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/doc/examples/transcoding.c
@@ -0,0 +1,597 @@
+/*
+ * Copyright (c) 2010 Nicolas George
+ * Copyright (c) 2011 Stefano Sabatini
+ * Copyright (c) 2014 Andrey Utkin
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * @file
+ * API example for demuxing, decoding, filtering, encoding and muxing
+ * @example doc/examples/transcoding.c
+ */
+
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+#include <libavfilter/avfiltergraph.h>
+#include <libavfilter/avcodec.h>
+#include <libavfilter/buffersink.h>
+#include <libavfilter/buffersrc.h>
+#include <libavutil/opt.h>
+#include <libavutil/pixdesc.h>
+
+static AVFormatContext *ifmt_ctx;
+static AVFormatContext *ofmt_ctx;
+typedef struct FilteringContext {
+ AVFilterContext *buffersink_ctx;
+ AVFilterContext *buffersrc_ctx;
+ AVFilterGraph *filter_graph;
+} FilteringContext;
+static FilteringContext *filter_ctx;
+
+static int open_input_file(const char *filename)
+{
+ int ret;
+ unsigned int i;
+
+ ifmt_ctx = NULL;
+ if ((ret = avformat_open_input(&ifmt_ctx, filename, NULL, NULL)) < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
+ return ret;
+ }
+
+ if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");
+ return ret;
+ }
+
+ for (i = 0; i < ifmt_ctx->nb_streams; i++) {
+ AVStream *stream;
+ AVCodecContext *codec_ctx;
+ stream = ifmt_ctx->streams[i];
+ codec_ctx = stream->codec;
+ /* Reencode video & audio and remux subtitles etc. */
+ if (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO
+ || codec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
+ /* Open decoder */
+ ret = avcodec_open2(codec_ctx,
+ avcodec_find_decoder(codec_ctx->codec_id), NULL);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Failed to open decoder for stream #%u\n", i);
+ return ret;
+ }
+ }
+ }
+
+ av_dump_format(ifmt_ctx, 0, filename, 0);
+ return 0;
+}
+
+static int open_output_file(const char *filename)
+{
+ AVStream *out_stream;
+ AVStream *in_stream;
+ AVCodecContext *dec_ctx, *enc_ctx;
+ AVCodec *encoder;
+ int ret;
+ unsigned int i;
+
+ ofmt_ctx = NULL;
+ avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, filename);
+ if (!ofmt_ctx) {
+ av_log(NULL, AV_LOG_ERROR, "Could not create output context\n");
+ return AVERROR_UNKNOWN;
+ }
+
+
+ for (i = 0; i < ifmt_ctx->nb_streams; i++) {
+ out_stream = avformat_new_stream(ofmt_ctx, NULL);
+ if (!out_stream) {
+ av_log(NULL, AV_LOG_ERROR, "Failed allocating output stream\n");
+ return AVERROR_UNKNOWN;
+ }
+
+ in_stream = ifmt_ctx->streams[i];
+ dec_ctx = in_stream->codec;
+ enc_ctx = out_stream->codec;
+
+ if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO
+ || dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
+ /* in this example, we choose transcoding to same codec */
+ encoder = avcodec_find_encoder(dec_ctx->codec_id);
+
+ /* In this example, we transcode to same properties (picture size,
+ * sample rate etc.). These properties can be changed for output
+ * streams easily using filters */
+ if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+ enc_ctx->height = dec_ctx->height;
+ enc_ctx->width = dec_ctx->width;
+ enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio;
+ /* take first format from list of supported formats */
+ enc_ctx->pix_fmt = encoder->pix_fmts[0];
+ /* video time_base can be set to whatever is handy and supported by encoder */
+ enc_ctx->time_base = dec_ctx->time_base;
+ } else {
+ enc_ctx->sample_rate = dec_ctx->sample_rate;
+ enc_ctx->channel_layout = dec_ctx->channel_layout;
+ enc_ctx->channels = av_get_channel_layout_nb_channels(enc_ctx->channel_layout);
+ /* take first format from list of supported formats */
+ enc_ctx->sample_fmt = encoder->sample_fmts[0];
+ enc_ctx->time_base = (AVRational){1, enc_ctx->sample_rate};
+ }
+
+ /* Third parameter can be used to pass settings to encoder */
+ ret = avcodec_open2(enc_ctx, encoder, NULL);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot open video encoder for stream #%u\n", i);
+ return ret;
+ }
+ } else if (dec_ctx->codec_type == AVMEDIA_TYPE_UNKNOWN) {
+ av_log(NULL, AV_LOG_FATAL, "Elementary stream #%d is of unknown type, cannot proceed\n", i);
+ return AVERROR_INVALIDDATA;
+ } else {
+ /* if this stream must be remuxed */
+ ret = avcodec_copy_context(ofmt_ctx->streams[i]->codec,
+ ifmt_ctx->streams[i]->codec);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Copying stream context failed\n");
+ return ret;
+ }
+ }
+
+ if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
+ enc_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
+
+ }
+ av_dump_format(ofmt_ctx, 0, filename, 1);
+
+ if (!(ofmt_ctx->oformat->flags & AVFMT_NOFILE)) {
+ ret = avio_open(&ofmt_ctx->pb, filename, AVIO_FLAG_WRITE);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Could not open output file '%s'", filename);
+ return ret;
+ }
+ }
+
+ /* init muxer, write output file header */
+ ret = avformat_write_header(ofmt_ctx, NULL);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error occurred when opening output file\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,
+ AVCodecContext *enc_ctx, const char *filter_spec)
+{
+ char args[512];
+ int ret = 0;
+ AVFilter *buffersrc = NULL;
+ AVFilter *buffersink = NULL;
+ AVFilterContext *buffersrc_ctx = NULL;
+ AVFilterContext *buffersink_ctx = NULL;
+ AVFilterInOut *outputs = avfilter_inout_alloc();
+ AVFilterInOut *inputs = avfilter_inout_alloc();
+ AVFilterGraph *filter_graph = avfilter_graph_alloc();
+
+ if (!outputs || !inputs || !filter_graph) {
+ ret = AVERROR(ENOMEM);
+ goto end;
+ }
+
+ if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+ buffersrc = avfilter_get_by_name("buffer");
+ buffersink = avfilter_get_by_name("buffersink");
+ if (!buffersrc || !buffersink) {
+ av_log(NULL, AV_LOG_ERROR, "filtering source or sink element not found\n");
+ ret = AVERROR_UNKNOWN;
+ goto end;
+ }
+
+ snprintf(args, sizeof(args),
+ "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
+ dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,
+ dec_ctx->time_base.num, dec_ctx->time_base.den,
+ dec_ctx->sample_aspect_ratio.num,
+ dec_ctx->sample_aspect_ratio.den);
+
+ ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in",
+ args, NULL, filter_graph);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n");
+ goto end;
+ }
+
+ ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
+ NULL, NULL, filter_graph);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
+ goto end;
+ }
+
+ ret = av_opt_set_bin(buffersink_ctx, "pix_fmts",
+ (uint8_t*)&enc_ctx->pix_fmt, sizeof(enc_ctx->pix_fmt),
+ AV_OPT_SEARCH_CHILDREN);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n");
+ goto end;
+ }
+ } else if (dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
+ buffersrc = avfilter_get_by_name("abuffer");
+ buffersink = avfilter_get_by_name("abuffersink");
+ if (!buffersrc || !buffersink) {
+ av_log(NULL, AV_LOG_ERROR, "filtering source or sink element not found\n");
+ ret = AVERROR_UNKNOWN;
+ goto end;
+ }
+
+ if (!dec_ctx->channel_layout)
+ dec_ctx->channel_layout =
+ av_get_default_channel_layout(dec_ctx->channels);
+ snprintf(args, sizeof(args),
+ "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%"PRIx64,
+ dec_ctx->time_base.num, dec_ctx->time_base.den, dec_ctx->sample_rate,
+ av_get_sample_fmt_name(dec_ctx->sample_fmt),
+ dec_ctx->channel_layout);
+ ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in",
+ args, NULL, filter_graph);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer source\n");
+ goto end;
+ }
+
+ ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
+ NULL, NULL, filter_graph);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n");
+ goto end;
+ }
+
+ ret = av_opt_set_bin(buffersink_ctx, "sample_fmts",
+ (uint8_t*)&enc_ctx->sample_fmt, sizeof(enc_ctx->sample_fmt),
+ AV_OPT_SEARCH_CHILDREN);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot set output sample format\n");
+ goto end;
+ }
+
+ ret = av_opt_set_bin(buffersink_ctx, "channel_layouts",
+ (uint8_t*)&enc_ctx->channel_layout,
+ sizeof(enc_ctx->channel_layout), AV_OPT_SEARCH_CHILDREN);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot set output channel layout\n");
+ goto end;
+ }
+
+ ret = av_opt_set_bin(buffersink_ctx, "sample_rates",
+ (uint8_t*)&enc_ctx->sample_rate, sizeof(enc_ctx->sample_rate),
+ AV_OPT_SEARCH_CHILDREN);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n");
+ goto end;
+ }
+ } else {
+ ret = AVERROR_UNKNOWN;
+ goto end;
+ }
+
+ /* Endpoints for the filter graph. */
+ outputs->name = av_strdup("in");
+ outputs->filter_ctx = buffersrc_ctx;
+ outputs->pad_idx = 0;
+ outputs->next = NULL;
+
+ inputs->name = av_strdup("out");
+ inputs->filter_ctx = buffersink_ctx;
+ inputs->pad_idx = 0;
+ inputs->next = NULL;
+
+ if (!outputs->name || !inputs->name) {
+ ret = AVERROR(ENOMEM);
+ goto end;
+ }
+
+ if ((ret = avfilter_graph_parse_ptr(filter_graph, filter_spec,
+ &inputs, &outputs, NULL)) < 0)
+ goto end;
+
+ if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0)
+ goto end;
+
+ /* Fill FilteringContext */
+ fctx->buffersrc_ctx = buffersrc_ctx;
+ fctx->buffersink_ctx = buffersink_ctx;
+ fctx->filter_graph = filter_graph;
+
+end:
+ avfilter_inout_free(&inputs);
+ avfilter_inout_free(&outputs);
+
+ return ret;
+}
+
+static int init_filters(void)
+{
+ const char *filter_spec;
+ unsigned int i;
+ int ret;
+ filter_ctx = av_malloc_array(ifmt_ctx->nb_streams, sizeof(*filter_ctx));
+ if (!filter_ctx)
+ return AVERROR(ENOMEM);
+
+ for (i = 0; i < ifmt_ctx->nb_streams; i++) {
+ filter_ctx[i].buffersrc_ctx = NULL;
+ filter_ctx[i].buffersink_ctx = NULL;
+ filter_ctx[i].filter_graph = NULL;
+ if (!(ifmt_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO
+ || ifmt_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO))
+ continue;
+
+
+ if (ifmt_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
+ filter_spec = "null"; /* passthrough (dummy) filter for video */
+ else
+ filter_spec = "anull"; /* passthrough (dummy) filter for audio */
+ ret = init_filter(&filter_ctx[i], ifmt_ctx->streams[i]->codec,
+ ofmt_ctx->streams[i]->codec, filter_spec);
+ if (ret)
+ return ret;
+ }
+ return 0;
+}
+
+static int encode_write_frame(AVFrame *filt_frame, unsigned int stream_index, int *got_frame) {
+ int ret;
+ int got_frame_local;
+ AVPacket enc_pkt;
+ int (*enc_func)(AVCodecContext *, AVPacket *, const AVFrame *, int *) =
+ (ifmt_ctx->streams[stream_index]->codec->codec_type ==
+ AVMEDIA_TYPE_VIDEO) ? avcodec_encode_video2 : avcodec_encode_audio2;
+
+ if (!got_frame)
+ got_frame = &got_frame_local;
+
+ av_log(NULL, AV_LOG_INFO, "Encoding frame\n");
+ /* encode filtered frame */
+ enc_pkt.data = NULL;
+ enc_pkt.size = 0;
+ av_init_packet(&enc_pkt);
+ ret = enc_func(ofmt_ctx->streams[stream_index]->codec, &enc_pkt,
+ filt_frame, got_frame);
+ av_frame_free(&filt_frame);
+ if (ret < 0)
+ return ret;
+ if (!(*got_frame))
+ return 0;
+
+ /* prepare packet for muxing */
+ enc_pkt.stream_index = stream_index;
+ enc_pkt.dts = av_rescale_q_rnd(enc_pkt.dts,
+ ofmt_ctx->streams[stream_index]->codec->time_base,
+ ofmt_ctx->streams[stream_index]->time_base,
+ AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+ enc_pkt.pts = av_rescale_q_rnd(enc_pkt.pts,
+ ofmt_ctx->streams[stream_index]->codec->time_base,
+ ofmt_ctx->streams[stream_index]->time_base,
+ AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+ enc_pkt.duration = av_rescale_q(enc_pkt.duration,
+ ofmt_ctx->streams[stream_index]->codec->time_base,
+ ofmt_ctx->streams[stream_index]->time_base);
+
+ av_log(NULL, AV_LOG_DEBUG, "Muxing frame\n");
+ /* mux encoded frame */
+ ret = av_interleaved_write_frame(ofmt_ctx, &enc_pkt);
+ return ret;
+}
+
+static int filter_encode_write_frame(AVFrame *frame, unsigned int stream_index)
+{
+ int ret;
+ AVFrame *filt_frame;
+
+ av_log(NULL, AV_LOG_INFO, "Pushing decoded frame to filters\n");
+ /* push the decoded frame into the filtergraph */
+ ret = av_buffersrc_add_frame_flags(filter_ctx[stream_index].buffersrc_ctx,
+ frame, 0);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n");
+ return ret;
+ }
+
+ /* pull filtered frames from the filtergraph */
+ while (1) {
+ filt_frame = av_frame_alloc();
+ if (!filt_frame) {
+ ret = AVERROR(ENOMEM);
+ break;
+ }
+ av_log(NULL, AV_LOG_INFO, "Pulling filtered frame from filters\n");
+ ret = av_buffersink_get_frame(filter_ctx[stream_index].buffersink_ctx,
+ filt_frame);
+ if (ret < 0) {
+ /* if no more frames for output - returns AVERROR(EAGAIN)
+ * if flushed and no more frames for output - returns AVERROR_EOF
+ * rewrite retcode to 0 to show it as normal procedure completion
+ */
+ if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
+ ret = 0;
+ av_frame_free(&filt_frame);
+ break;
+ }
+
+ filt_frame->pict_type = AV_PICTURE_TYPE_NONE;
+ ret = encode_write_frame(filt_frame, stream_index, NULL);
+ if (ret < 0)
+ break;
+ }
+
+ return ret;
+}
+
+static int flush_encoder(unsigned int stream_index)
+{
+ int ret;
+ int got_frame;
+
+ if (!(ofmt_ctx->streams[stream_index]->codec->codec->capabilities &
+ CODEC_CAP_DELAY))
+ return 0;
+
+ while (1) {
+ av_log(NULL, AV_LOG_INFO, "Flushing stream #%u encoder\n", stream_index);
+ ret = encode_write_frame(NULL, stream_index, &got_frame);
+ if (ret < 0)
+ break;
+ if (!got_frame)
+ return 0;
+ }
+ return ret;
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+ AVPacket packet = { .data = NULL, .size = 0 };
+ AVFrame *frame = NULL;
+ enum AVMediaType type;
+ unsigned int stream_index;
+ unsigned int i;
+ int got_frame;
+ int (*dec_func)(AVCodecContext *, AVFrame *, int *, const AVPacket *);
+
+ if (argc != 3) {
+ av_log(NULL, AV_LOG_ERROR, "Usage: %s <input file> <output file>\n", argv[0]);
+ return 1;
+ }
+
+ av_register_all();
+ avfilter_register_all();
+
+ if ((ret = open_input_file(argv[1])) < 0)
+ goto end;
+ if ((ret = open_output_file(argv[2])) < 0)
+ goto end;
+ if ((ret = init_filters()) < 0)
+ goto end;
+
+ /* read all packets */
+ while (1) {
+ if ((ret = av_read_frame(ifmt_ctx, &packet)) < 0)
+ break;
+ stream_index = packet.stream_index;
+ type = ifmt_ctx->streams[packet.stream_index]->codec->codec_type;
+ av_log(NULL, AV_LOG_DEBUG, "Demuxer gave frame of stream_index %u\n",
+ stream_index);
+
+ if (filter_ctx[stream_index].filter_graph) {
+ av_log(NULL, AV_LOG_DEBUG, "Going to reencode&filter the frame\n");
+ frame = av_frame_alloc();
+ if (!frame) {
+ ret = AVERROR(ENOMEM);
+ break;
+ }
+ packet.dts = av_rescale_q_rnd(packet.dts,
+ ifmt_ctx->streams[stream_index]->time_base,
+ ifmt_ctx->streams[stream_index]->codec->time_base,
+ AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+ packet.pts = av_rescale_q_rnd(packet.pts,
+ ifmt_ctx->streams[stream_index]->time_base,
+ ifmt_ctx->streams[stream_index]->codec->time_base,
+ AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+ dec_func = (type == AVMEDIA_TYPE_VIDEO) ? avcodec_decode_video2 :
+ avcodec_decode_audio4;
+ ret = dec_func(ifmt_ctx->streams[stream_index]->codec, frame,
+ &got_frame, &packet);
+ if (ret < 0) {
+ av_frame_free(&frame);
+ av_log(NULL, AV_LOG_ERROR, "Decoding failed\n");
+ break;
+ }
+
+ if (got_frame) {
+ frame->pts = av_frame_get_best_effort_timestamp(frame);
+ ret = filter_encode_write_frame(frame, stream_index);
+ av_frame_free(&frame);
+ if (ret < 0)
+ goto end;
+ } else {
+ av_frame_free(&frame);
+ }
+ } else {
+ /* remux this frame without reencoding */
+ packet.dts = av_rescale_q_rnd(packet.dts,
+ ifmt_ctx->streams[stream_index]->time_base,
+ ofmt_ctx->streams[stream_index]->time_base,
+ AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+ packet.pts = av_rescale_q_rnd(packet.pts,
+ ifmt_ctx->streams[stream_index]->time_base,
+ ofmt_ctx->streams[stream_index]->time_base,
+ AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
+
+ ret = av_interleaved_write_frame(ofmt_ctx, &packet);
+ if (ret < 0)
+ goto end;
+ }
+ av_free_packet(&packet);
+ }
+
+ /* flush filters and encoders */
+ for (i = 0; i < ifmt_ctx->nb_streams; i++) {
+ /* flush filter */
+ if (!filter_ctx[i].filter_graph)
+ continue;
+ ret = filter_encode_write_frame(NULL, i);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Flushing filter failed\n");
+ goto end;
+ }
+
+ /* flush encoder */
+ ret = flush_encoder(i);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Flushing encoder failed\n");
+ goto end;
+ }
+ }
+
+ av_write_trailer(ofmt_ctx);
+end:
+ av_free_packet(&packet);
+ av_frame_free(&frame);
+ for (i = 0; i < ifmt_ctx->nb_streams; i++) {
+ avcodec_close(ifmt_ctx->streams[i]->codec);
+ if (ofmt_ctx && ofmt_ctx->nb_streams > i && ofmt_ctx->streams[i] && ofmt_ctx->streams[i]->codec)
+ avcodec_close(ofmt_ctx->streams[i]->codec);
+ if (filter_ctx && filter_ctx[i].filter_graph)
+ avfilter_graph_free(&filter_ctx[i].filter_graph);
+ }
+ av_free(filter_ctx);
+ avformat_close_input(&ifmt_ctx);
+ if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE))
+ avio_close(ofmt_ctx->pb);
+ avformat_free_context(ofmt_ctx);
+
+ if (ret < 0)
+ av_log(NULL, AV_LOG_ERROR, "Error occurred: %s\n", av_err2str(ret));
+
+ return ret ? 1 : 0;
+}
diff --git a/chromium/third_party/ffmpeg/doc/faq.texi b/chromium/third_party/ffmpeg/doc/faq.texi
index c47d9d969e6..74c259f2bb1 100644
--- a/chromium/third_party/ffmpeg/doc/faq.texi
+++ b/chromium/third_party/ffmpeg/doc/faq.texi
@@ -368,26 +368,6 @@ ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
rm temp[12].[av] all.[av]
@end example
-@section -profile option fails when encoding H.264 video with AAC audio
-
-@command{ffmpeg} prints an error like
-
-@example
-Undefined constant or missing '(' in 'baseline'
-Unable to parse option value "baseline"
-Error setting option profile to value baseline.
-@end example
-
-Short answer: write @option{-profile:v} instead of @option{-profile}.
-
-Long answer: this happens because the @option{-profile} option can apply to both
-video and audio. Specifically the AAC encoder also defines some profiles, none
-of which are named @var{baseline}.
-
-The solution is to apply the @option{-profile} option to the video stream only
-by using @url{http://ffmpeg.org/ffmpeg.html#Stream-specifiers-1, Stream specifiers}.
-Appending @code{:v} to it will do exactly that.
-
@section Using @option{-f lavfi}, audio becomes mono for no apparent reason.
Use @option{-dumpgraph -} to find out exactly where the channel layout is
diff --git a/chromium/third_party/ffmpeg/doc/ffmpeg-resampler.texi b/chromium/third_party/ffmpeg/doc/ffmpeg-resampler.texi
index 69767a29ca7..5bef78967b0 100644
--- a/chromium/third_party/ffmpeg/doc/ffmpeg-resampler.texi
+++ b/chromium/third_party/ffmpeg/doc/ffmpeg-resampler.texi
@@ -14,7 +14,7 @@
The FFmpeg resampler provides a high-level interface to the
libswresample library audio resampling utilities. In particular it
-allows to perform audio resampling, audio channel layout rematrixing,
+allows one to perform audio resampling, audio channel layout rematrixing,
and convert audio format and packing layout.
@c man end DESCRIPTION
diff --git a/chromium/third_party/ffmpeg/doc/ffmpeg-scaler.texi b/chromium/third_party/ffmpeg/doc/ffmpeg-scaler.texi
index 1eb8cd6bdd6..c4ddc0972af 100644
--- a/chromium/third_party/ffmpeg/doc/ffmpeg-scaler.texi
+++ b/chromium/third_party/ffmpeg/doc/ffmpeg-scaler.texi
@@ -13,7 +13,7 @@
@c man begin DESCRIPTION
The FFmpeg rescaler provides a high-level interface to the libswscale
-library image conversion utilities. In particular it allows to perform
+library image conversion utilities. In particular it allows one to perform
image rescaling and pixel format conversion.
@c man end DESCRIPTION
diff --git a/chromium/third_party/ffmpeg/doc/ffmpeg.texi b/chromium/third_party/ffmpeg/doc/ffmpeg.texi
index 0a930cebf85..765b2a7ebc6 100644
--- a/chromium/third_party/ffmpeg/doc/ffmpeg.texi
+++ b/chromium/third_party/ffmpeg/doc/ffmpeg.texi
@@ -80,11 +80,23 @@ The transcoding process in @command{ffmpeg} for each output can be described by
the following diagram:
@example
- _______ ______________ _________ ______________ ________
-| | | | | | | | | |
-| input | demuxer | encoded data | decoder | decoded | encoder | encoded data | muxer | output |
-| file | ---------> | packets | ---------> | frames | ---------> | packets | -------> | file |
-|_______| |______________| |_________| |______________| |________|
+ _______ ______________
+| | | |
+| input | demuxer | encoded data | decoder
+| file | ---------> | packets | -----+
+|_______| |______________| |
+ v
+ _________
+ | |
+ | decoded |
+ | frames |
+ |_________|
+ ________ ______________ |
+| | | | |
+| output | <-------- | encoded data | <----+
+| file | muxer | packets | encoder
+|________| |______________|
+
@end example
@@ -112,11 +124,16 @@ the same type. In the above diagram they can be represented by simply inserting
an additional step between decoding and encoding:
@example
- _________ __________ ______________
-| | | | | |
-| decoded | simple filtergraph | filtered | encoder | encoded data |
-| frames | -------------------> | frames | ---------> | packets |
-|_________| |__________| |______________|
+ _________ ______________
+| | | |
+| decoded | | encoded data |
+| frames |\ _ | packets |
+|_________| \ /||______________|
+ \ __________ /
+ simple _\|| | / encoder
+ filtergraph | filtered |/
+ | frames |
+ |__________|
@end example
@@ -125,10 +142,10 @@ Simple filtergraphs are configured with the per-stream @option{-filter} option
A simple filtergraph for video can look for example like this:
@example
- _______ _____________ _______ _____ ________
-| | | | | | | | | |
-| input | ---> | deinterlace | ---> | scale | ---> | fps | ---> | output |
-|_______| |_____________| |_______| |_____| |________|
+ _______ _____________ _______ ________
+| | | | | | | |
+| input | ---> | deinterlace | ---> | scale | ---> | output |
+|_______| |_____________| |_______| |________|
@end example
@@ -285,23 +302,20 @@ input until the timestamps reach @var{position}.
@var{position} may be either in seconds or in @code{hh:mm:ss[.xxx]} form.
@item -itsoffset @var{offset} (@emph{input})
-Set the input time offset in seconds.
-@code{[-]hh:mm:ss[.xxx]} syntax is also supported.
-The offset is added to the timestamps of the input files.
-Specifying a positive offset means that the corresponding
-streams are delayed by @var{offset} seconds.
+Set the input time offset.
+
+@var{offset} must be a time duration specification,
+see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
+
+The offset is added to the timestamps of the input files. Specifying
+a positive offset means that the corresponding streams are delayed by
+the time duration specified in @var{offset}.
-@item -timestamp @var{time} (@emph{output})
+@item -timestamp @var{date} (@emph{output})
Set the recording timestamp in the container.
-The syntax for @var{time} is:
-@example
-now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...])|(HHMMSS[.m...]))[Z|z])
-@end example
-If the value is "now" it takes the current time.
-Time is local time unless 'Z' or 'z' is appended, in which case it is
-interpreted as UTC.
-If the year-month-day part is not specified it takes the current
-year-month-day.
+
+@var{date} must be a time duration specification,
+see @ref{date syntax,,the Date section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
@item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata})
Set a metadata key/value pair.
@@ -508,9 +522,6 @@ prefix is ``ffmpeg2pass''. The complete file name will be
@file{PREFIX-N.log}, where N is a number specific to the output
stream
-@item -vlang @var{code}
-Set the ISO 639 language code (3 letters) of the current video stream.
-
@item -vf @var{filtergraph} (@emph{output})
Create the filtergraph specified by @var{filtergraph} and use it to
filter the stream.
@@ -632,8 +643,14 @@ Do not use any hardware acceleration (the default).
@item auto
Automatically select the hardware acceleration method.
+@item vda
+Use Apple VDA hardware acceleration.
+
@item vdpau
Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
+
+@item dxva2
+Use DXVA2 (DirectX Video Acceleration) hardware acceleration.
@end table
This option has no effect if the selected hwaccel is not available or not
@@ -656,6 +673,10 @@ method chosen.
@item vdpau
For VDPAU, this option specifies the X11 display/screen to use. If this option
is not specified, the value of the @var{DISPLAY} environment variable is used
+
+@item dxva2
+For DXVA2, this option should contain the number of the display adapter to use.
+If this option is not specified, the default adapter is used.
@end table
@end table
@@ -709,8 +730,6 @@ stereo but not 6 channels as 5.1. The default is to always try to guess. Use
@section Subtitle options:
@table @option
-@item -slang @var{code}
-Set the ISO 639 language code (3 letters) of the current subtitle stream.
@item -scodec @var{codec} (@emph{input/output})
Set the subtitle codec. This is an alias for @code{-codec:s}.
@item -sn (@emph{output})
@@ -1039,7 +1058,7 @@ ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
@end example
-@item -tag[:@var{stream_specifier}] @var{codec_tag} (@emph{per-stream})
+@item -tag[:@var{stream_specifier}] @var{codec_tag} (@emph{input/output,per-stream})
Force a tag/fourcc for matching streams.
@item -timecode @var{hh}:@var{mm}:@var{ss}SEP@var{ff}
diff --git a/chromium/third_party/ffmpeg/doc/ffplay.texi b/chromium/third_party/ffmpeg/doc/ffplay.texi
index 54b6f19a48c..c26c68da5df 100644
--- a/chromium/third_party/ffmpeg/doc/ffplay.texi
+++ b/chromium/third_party/ffmpeg/doc/ffplay.texi
@@ -188,6 +188,12 @@ Cycle program.
@item w
Show audio waves.
+@item s
+Step to the next frame.
+
+Pause if the stream is not already paused, step to the next video
+frame, and pause.
+
@item left/right
Seek backward/forward 10 seconds.
@@ -195,6 +201,8 @@ Seek backward/forward 10 seconds.
Seek backward/forward 1 minute.
@item page down/page up
+Seek to the previous/next chapter.
+or if there are no chapters
Seek backward/forward 10 minutes.
@item mouse click
@@ -206,6 +214,7 @@ Seek to percentage in file corresponding to fraction of width.
@include config.texi
@ifset config-all
+@set config-readonly
@ifset config-avutil
@include utils.texi
@end ifset
diff --git a/chromium/third_party/ffmpeg/doc/ffprobe.texi b/chromium/third_party/ffmpeg/doc/ffprobe.texi
index 75d1e72ca81..8de8956b75d 100644
--- a/chromium/third_party/ffmpeg/doc/ffprobe.texi
+++ b/chromium/third_party/ffmpeg/doc/ffprobe.texi
@@ -599,6 +599,7 @@ DV, GXF and AVI timecodes are available in format metadata
@include config.texi
@ifset config-all
+@set config-readonly
@ifset config-avutil
@include utils.texi
@end ifset
diff --git a/chromium/third_party/ffmpeg/doc/ffprobe.xsd b/chromium/third_party/ffmpeg/doc/ffprobe.xsd
index cc3d1b63f78..1bc1fb5bb4f 100644
--- a/chromium/third_party/ffmpeg/doc/ffprobe.xsd
+++ b/chromium/third_party/ffmpeg/doc/ffprobe.xsd
@@ -61,6 +61,8 @@
<xsd:attribute name="pkt_pts_time" type="xsd:float"/>
<xsd:attribute name="pkt_dts" type="xsd:long" />
<xsd:attribute name="pkt_dts_time" type="xsd:float"/>
+ <xsd:attribute name="best_effort_timestamp" type="xsd:long" />
+ <xsd:attribute name="best_effort_timestamp_time" type="xsd:float" />
<xsd:attribute name="pkt_duration" type="xsd:long" />
<xsd:attribute name="pkt_duration_time" type="xsd:float"/>
<xsd:attribute name="pkt_pos" type="xsd:long" />
diff --git a/chromium/third_party/ffmpeg/doc/ffserver.conf b/chromium/third_party/ffmpeg/doc/ffserver.conf
index 0f5922cc3e1..094c093af25 100644
--- a/chromium/third_party/ffmpeg/doc/ffserver.conf
+++ b/chromium/third_party/ffmpeg/doc/ffserver.conf
@@ -235,7 +235,7 @@ StartSendOnKey
#<Stream test.ogg>
#Feed feed1.ffm
-#Title "Stream title"
+#Metadata title "Stream title"
#AudioBitRate 64
#AudioChannels 2
#AudioSampleRate 44100
@@ -280,10 +280,10 @@ StartSendOnKey
#<Stream file.asf>
#File "/usr/local/httpd/htdocs/test.asf"
#NoAudio
-#Author "Me"
-#Copyright "Super MegaCorp"
-#Title "Test stream from disk"
-#Comment "Test comment"
+#Metadata author "Me"
+#Metadata copyright "Super MegaCorp"
+#Metadata title "Test stream from disk"
+#Metadata comment "Test comment"
#</Stream>
diff --git a/chromium/third_party/ffmpeg/doc/ffserver.texi b/chromium/third_party/ffmpeg/doc/ffserver.texi
index 3f7a98dbe56..fb90dd650d7 100644
--- a/chromium/third_party/ffmpeg/doc/ffserver.texi
+++ b/chromium/third_party/ffmpeg/doc/ffserver.texi
@@ -49,7 +49,8 @@ configuration file.
Precisely, @command{ffserver} acts as an HTTP server, accepting POST
requests from @command{ffmpeg} to acquire the stream to publish, and
-serving HTTP clients GET requests with the stream media content.
+serving RTSP clients or HTTP clients GET requests with the stream
+media content.
A feed is an @ref{FFM} stream created by @command{ffmpeg}, and sent to
a port where @command{ffserver} is listening.
@@ -86,15 +87,22 @@ Each stream is identified by a unique name, corresponding to the name
of the resource served by @command{ffserver}, and is configured by
a dedicated @code{Stream} section in the configuration file.
-The stream access URL is given by:
+The stream access HTTP URL is given by:
@example
http://@var{ffserver_ip_address}:@var{http_port}/@var{stream_name}[@var{options}]
@end example
+The stream access RTSP URL is given by:
+@example
+http://@var{ffserver_ip_address}:@var{rtsp_port}/@var{stream_name}[@var{options}]
+@end example
+
@var{stream_name} is the name of the corresponding stream defined in
the configuration file. @var{options} is a list of options specified
after the URL which affects how the stream is served by
-@command{ffserver}.
+@command{ffserver}. @var{http_port} and @var{rtsp_port} are the HTTP
+and RTSP ports configured with the options @var{Port} and
+@var{RTSPPort} respectively.
In case the stream is associated to a feed, the encoding parameters
must be configured in the stream configuration. They are sent to
@@ -103,7 +111,7 @@ must be configured in the stream configuration. They are sent to
the @command{ffmpeg} encoders.
The @command{ffmpeg} @option{override_ffserver} commandline option
-allows to override the encoding parameters set by the server.
+allows one to override the encoding parameters set by the server.
Multiple streams can be connected to the same feed.
@@ -550,7 +558,11 @@ for regular streams.
@item Comment @var{value}
@item Copyright @var{value}
@item Title @var{value}
-Set metadata corresponding to the option.
+Set metadata corresponding to the option. All these options are
+deprecated in favor of @option{Metadata}.
+
+@item Metadata @var{key} @var{value}
+Set metadata value on the output stream.
@item NoAudio
@item NoVideo
@@ -757,7 +769,7 @@ Ogg Vorbis audio
@example
<Stream test.ogg>
Feed feed1.ffm
-Title "Stream title"
+Metadata title "Stream title"
AudioBitRate 64
AudioChannels 2
AudioSampleRate 44100
@@ -804,10 +816,10 @@ NoAudio
<Stream file.asf>
File "/usr/local/httpd/htdocs/test.asf"
NoAudio
-Author "Me"
-Copyright "Super MegaCorp"
-Title "Test stream from disk"
-Comment "Test comment"
+Metadata author "Me"
+Metadata copyright "Super MegaCorp"
+Metadata title "Test stream from disk"
+Metadata comment "Test comment"
</Stream>
@end example
@end itemize
diff --git a/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi b/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi
index ff6478a1de0..6bc6852d922 100644
--- a/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi
+++ b/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi
@@ -44,8 +44,8 @@ streams of this type.
If @var{stream_index} is given, then it matches the stream with number @var{stream_index}
in the program with the id @var{program_id}. Otherwise, it matches all streams in the
program.
-@item #@var{stream_id}
-Matches the stream by a format-specific ID.
+@item #@var{stream_id} or i:@var{stream_id}
+Match the stream by stream id (e.g. PID in MPEG-TS container).
@end table
@section Generic options
@@ -194,6 +194,13 @@ to a plain @code{%}
Errors in parsing the environment variable are not fatal, and will not
appear in the report.
+@item -hide_banner
+Suppress printing banner.
+
+All FFmpeg tools will normally show a copyright notice, build options
+and library versions. This option can be used to suppress printing
+this information.
+
@item -cpuflags flags (@emph{global})
Allows setting and clearing cpu flags. This option is intended
for testing. Do not use it unless you know what you're doing.
diff --git a/chromium/third_party/ffmpeg/doc/filters.texi b/chromium/third_party/ffmpeg/doc/filters.texi
index f3d698f147f..923551f210f 100644
--- a/chromium/third_party/ffmpeg/doc/filters.texi
+++ b/chromium/third_party/ffmpeg/doc/filters.texi
@@ -16,8 +16,8 @@ input --> split ---------------------> overlay --> output
+-----> crop --> vflip -------+
@end example
-This filtergraph splits the input stream in two streams, sends one
-stream through the crop filter and the vflip filter before merging it
+This filtergraph splits the input stream in two streams, then 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:
@@ -25,8 +25,8 @@ following command to achieve this:
ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
@end example
-The result will be that in output the top half of the video is mirrored
-onto the bottom half.
+The result will be that the top half of the video is mirrored
+onto the bottom half of the output video.
Filters in the same linear chain are separated by commas, and distinct
linear chains of filters are separated by semicolons. In our example,
@@ -102,22 +102,22 @@ A filtergraph is a directed graph of connected filters. It can contain
cycles, and there can be multiple links between a pair of
filters. Each link has one input pad on one side connecting it to one
filter from which it takes its input, and one output pad on the other
-side connecting it to the one filter accepting its output.
+side connecting it to one filter accepting its output.
Each filter in a filtergraph is an instance of a filter class
registered in the application, which defines the features and the
number of input and output pads of the filter.
-A filter with no input pads is called a "source", a filter with no
+A filter with no input pads is called a "source", and a filter with no
output pads is called a "sink".
@anchor{Filtergraph syntax}
@section Filtergraph syntax
-A filtergraph can be represented using a textual representation, which is
+A filtergraph has a textual representation, which is
recognized by the @option{-filter}/@option{-vf} and @option{-filter_complex}
options in @command{ffmpeg} and @option{-vf} in @command{ffplay}, and by the
-@code{avfilter_graph_parse()}/@code{avfilter_graph_parse2()} function defined in
+@code{avfilter_graph_parse()}/@code{avfilter_graph_parse2()} functions defined in
@file{libavfilter/avfilter.h}.
A filterchain consists of a sequence of connected filters, each one
@@ -138,7 +138,7 @@ The name of the filter class is optionally followed by a string
"=@var{arguments}".
@var{arguments} is a string which contains the parameters used to
-initialize the filter instance. It may have one of the following forms:
+initialize the filter instance. It may have one of two forms:
@itemize
@item
@@ -172,7 +172,7 @@ terminated when the next special character (belonging to the set
The name and arguments of the filter are optionally preceded and
followed by a list of link labels.
-A link label allows to name a link and associate it to a filter output
+A link label allows one to name a link and associate it to a filter output
or input pad. The preceding labels @var{in_link_1}
... @var{in_link_N}, are associated to the filter input pads,
the following labels @var{out_link_1} ... @var{out_link_M}, are
@@ -184,7 +184,7 @@ created.
If an output pad is not labelled, it is linked by default to the first
unlabelled input pad of the next filter in the filterchain.
-For example in the filterchain:
+For example in the filterchain
@example
nullsrc, split[L1], [L2]overlay, nullsink
@end example
@@ -204,12 +204,12 @@ for those automatically inserted scalers by prepending
@code{sws_flags=@var{flags};}
to the filtergraph description.
-Follows a BNF description for the filtergraph syntax:
+Here is a BNF description of the filtergraph syntax:
@example
@var{NAME} ::= sequence of alphanumeric characters and '_'
@var{LINKLABEL} ::= "[" @var{NAME} "]"
@var{LINKLABELS} ::= @var{LINKLABEL} [@var{LINKLABELS}]
-@var{FILTER_ARGUMENTS} ::= sequence of chars (eventually quoted)
+@var{FILTER_ARGUMENTS} ::= sequence of chars (possibly quoted)
@var{FILTER} ::= [@var{LINKLABELS}] @var{NAME} ["=" @var{FILTER_ARGUMENTS}] [@var{LINKLABELS}]
@var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}]
@var{FILTERGRAPH} ::= [sws_flags=@var{flags};] @var{FILTERCHAIN} [;@var{FILTERGRAPH}]
@@ -217,29 +217,45 @@ Follows a BNF description for the filtergraph syntax:
@section Notes on filtergraph escaping
-Some filter arguments require the use of special characters, typically
-@code{:} to separate key=value pairs in a named options list. In this
-case the user should perform a first level escaping when specifying
-the filter arguments. For example, consider the following literal
-string to be embedded in the @ref{drawtext} filter arguments:
+Filtergraph description composition entails several levels of
+escaping. See @ref{quoting_and_escaping,,the "Quoting and escaping"
+section in the ffmpeg-utils(1) manual,ffmpeg-utils} for more
+information about the employed escaping procedure.
+
+A first level escaping affects the content of each filter option
+value, which may contain the special character @code{:} used to
+separate values, or one of the escaping characters @code{\'}.
+
+A second level escaping affects the whole filter description, which
+may contain the escaping characters @code{\'} or the special
+characters @code{[],;} used by the filtergraph description.
+
+Finally, when you specify a filtergraph on a shell commandline, you
+need to perform a third level escaping for the shell special
+characters contained within it.
+
+For example, consider the following string to be embedded in
+the @ref{drawtext} filter description @option{text} value:
@example
this is a 'string': may contain one, or more, special characters
@end example
-Since @code{:} is special for the filter arguments syntax, it needs to
-be escaped, so you get:
+This string contains the @code{'} special escaping character, and the
+@code{:} special character, so it needs to be escaped in this way:
@example
text=this is a \'string\'\: may contain one, or more, special characters
@end example
A second level of escaping is required when embedding the filter
-arguments in a filtergraph description, in order to escape all the
+description in a filtergraph description, in order to escape all the
filtergraph special characters. Thus the example above becomes:
@example
drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
@end example
+(note that in addition to the @code{\'} escaping special characters,
+also @code{,} needs to be escaped).
-Finally an additional level of escaping may be needed when writing the
+Finally an additional level of escaping is needed when writing the
filtergraph description in a shell command, which depends on the
escaping rules of the adopted shell. For example, assuming that
@code{\} is special and needs to be escaped with another @code{\}, the
@@ -248,26 +264,6 @@ previous string will finally result in:
-vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
@end example
-Sometimes, it might be more convenient to employ quoting in place of
-escaping. For example the string:
-@example
-Caesar: tu quoque, Brute, fili mi
-@end example
-
-Can be quoted in the filter arguments as:
-@example
-text='Caesar: tu quoque, Brute, fili mi'
-@end example
-
-And finally inserted in a filtergraph like:
-@example
-drawtext=text=\'Caesar: tu quoque\, Brute\, fili mi\'
-@end example
-
-See the ``Quoting and escaping'' section in the ffmpeg-utils manual
-for more information about the escaping and quoting rules adopted by
-FFmpeg.
-
@chapter Timeline editing
Some filters support a generic @option{enable} option. For the filters
@@ -371,7 +367,7 @@ smaller than number of channels all remaining channels will not be delayed.
Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
the second channel (and any other channels that may be present) unchanged.
@example
-adelay=1500:0:500
+adelay=1500|0|500
@end example
@end itemize
@@ -442,7 +438,7 @@ Modify an audio signal according to the specified expressions.
This filter accepts one or more expressions (one for each channel),
which are evaluated and used to modify a corresponding audio signal.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item exprs
@@ -593,7 +589,7 @@ afade=t=out:st=875:d=25
Set output format constraints for the input audio. The framework will
negotiate the most appropriate format to minimize conversions.
-The filter accepts the following named parameters:
+It accepts the following parameters:
@table @option
@item sample_fmts
@@ -611,7 +607,7 @@ for the required syntax.
If a parameter is omitted, all values are allowed.
-For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
+Force the output to either unsigned 8-bit or signed 16-bit stereo
@example
aformat=sample_fmts=u8|s16:channel_layouts=stereo
@end example
@@ -708,29 +704,29 @@ ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=firs
will mix 3 input audio streams to a single output with the same duration as the
first input and a dropout transition time of 3 seconds.
-The filter accepts the following named parameters:
+It accepts the following parameters:
@table @option
@item inputs
-Number of inputs. If unspecified, it defaults to 2.
+The number of inputs. If unspecified, it defaults to 2.
@item duration
How to determine the end-of-stream.
@table @option
@item longest
-Duration of longest input. (default)
+The duration of the longest input. (default)
@item shortest
-Duration of shortest input.
+The duration of the shortest input.
@item first
-Duration of first input.
+The duration of the first input.
@end table
@item dropout_transition
-Transition time, in seconds, for volume renormalization when an input
+The transition time, in seconds, for volume renormalization when an input
stream ends. The default value is 2 seconds.
@end table
@@ -861,38 +857,38 @@ The input audio is not modified.
The shown line contains a sequence of key/value pairs of the form
@var{key}:@var{value}.
-A description of each shown parameter follows:
+It accepts the following parameters:
@table @option
@item n
-sequential number of the input frame, starting from 0
+The (sequential) number of the input frame, starting from 0.
@item pts
-Presentation timestamp of the input frame, in time base units; the time base
+The presentation timestamp of the input frame, in time base units; the time base
depends on the filter input pad, and is usually 1/@var{sample_rate}.
@item pts_time
-presentation timestamp of the input frame in seconds
+The presentation timestamp of the input frame in seconds.
@item pos
position of the frame in the input stream, -1 if this information in
unavailable and/or meaningless (for example in case of synthetic audio)
@item fmt
-sample format
+The sample format.
@item chlayout
-channel layout
+The channel layout.
@item rate
-sample rate for the audio frame
+The sample rate for the audio frame.
@item nb_samples
-number of samples (per channel) in the frame
+The number of samples (per channel) in the frame.
@item checksum
-Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
-the data is treated as if all the planes were concatenated.
+The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
+audio, the data is treated as if all the planes were concatenated.
@item plane_checksums
A list of Adler-32 checksums for each data plane.
@@ -904,7 +900,7 @@ Display time domain statistical information about the audio channels.
Statistics are calculated and displayed for each audio channel and,
where applicable, an overall figure is also given.
-The filter accepts the following option:
+It accepts the following option:
@table @option
@item length
Short window length in seconds, used for peak and trough RMS measurement.
@@ -986,7 +982,7 @@ dropping samples/adding silence when needed.
This filter is not built by default, please use @ref{aresample} to do squeezing/stretching.
-The filter accepts the following named parameters:
+It accepts the following parameters:
@table @option
@item compensate
@@ -994,21 +990,21 @@ Enable stretching/squeezing the data to make it match the timestamps. Disabled
by default. When disabled, time gaps are covered with silence.
@item min_delta
-Minimum difference between timestamps and audio data (in seconds) to trigger
-adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
-this filter, try setting this parameter to 0.
+The minimum difference between timestamps and audio data (in seconds) to trigger
+adding/dropping samples. The default value is 0.1. If you get an imperfect
+sync with this filter, try setting this parameter to 0.
@item max_comp
-Maximum compensation in samples per second. Relevant only with compensate=1.
-Default value 500.
+The maximum compensation in samples per second. Only relevant with compensate=1.
+The default value is 500.
@item first_pts
-Assume the first pts should be this value. The time base is 1 / sample rate.
-This allows for padding/trimming at the start of stream. By default, no
-assumption is made about the first frame's expected pts, so no padding or
+Assume that the first PTS should be this value. The time base is 1 / sample
+rate. This allows for padding/trimming at the start of the stream. By default,
+no assumption is made about the first frame's expected PTS, so no padding or
trimming is done. For example, this could be set to 0 to pad the beginning with
silence if an audio stream starts after the video stream or to trim any samples
-with a negative pts due to encoder delay.
+with a negative PTS due to encoder delay.
@end table
@@ -1040,11 +1036,11 @@ atempo=1.25
Trim the input so that the output contains one continuous subpart of the input.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item start
-Specify time of the start of the kept section, i.e. the audio sample
-with the timestamp @var{start} will be the first sample in the output.
+Timestamp (in seconds) of the start of the section to keep. I.e. the audio
+sample with the timestamp @var{start} will be the first sample in the output.
@item end
Specify time of the first audio sample that will be dropped, i.e. the
@@ -1060,13 +1056,13 @@ Same as @var{end}, except this option sets the end timestamp in samples instead
of seconds.
@item duration
-Specify maximum duration of the output.
+The maximum duration of the output in seconds.
@item start_sample
-Number of the first sample that should be passed to output.
+The number of the first sample that should be output.
@item end_sample
-Number of the first sample that should be dropped.
+The number of the first sample that should be dropped.
@end table
@option{start}, @option{end}, @option{duration} are expressed as time
@@ -1078,7 +1074,7 @@ option look at the frame timestamp, while the _sample options simply count the
samples that pass through the filter. So start/end_pts and start/end_sample will
give different results when the timestamps are wrong, inexact or do not start at
zero. Also note that this filter does not modify the timestamps. If you wish
-that the output timestamps start at zero, insert the asetpts filter after the
+to have the output timestamps start at zero, insert the asetpts filter after the
atrim filter.
If multiple start or end options are set, this filter tries to be greedy and
@@ -1092,13 +1088,13 @@ just the end values to keep everything before the specified time.
Examples:
@itemize
@item
-drop everything except the second minute of input
+Drop everything except the second minute of input:
@example
ffmpeg -i INPUT -af atrim=60:120
@end example
@item
-keep only the first 1000 samples
+Keep only the first 1000 samples:
@example
ffmpeg -i INPUT -af atrim=end_sample=1000
@end example
@@ -1210,14 +1206,44 @@ Apply a biquad IIR filter with the given coefficients.
Where @var{b0}, @var{b1}, @var{b2} and @var{a0}, @var{a1}, @var{a2}
are the numerator and denominator coefficients respectively.
+@section bs2b
+Bauer stereo to binaural transformation, which improves headphone listening of
+stereo audio records.
+
+It accepts the following parameters:
+@table @option
+
+@item profile
+Pre-defined crossfeed level.
+@table @option
+
+@item default
+Default level (fcut=700, feed=50).
+
+@item cmoy
+Chu Moy circuit (fcut=700, feed=60).
+
+@item jmeier
+Jan Meier circuit (fcut=650, feed=95).
+
+@end table
+
+@item fcut
+Cut frequency (in Hz).
+
+@item feed
+Feed level (in Hz).
+
+@end table
+
@section channelmap
Remap input channels to new locations.
-This filter accepts the following named parameters:
+It accepts the following parameters:
@table @option
@item channel_layout
-Channel layout of the output stream.
+The channel layout of the output stream.
@item map
Map channels from input to output. The argument is a '|'-separated list of
@@ -1230,9 +1256,9 @@ index, starting with zero and increasing by one for each mapping.
@end table
If no mapping is present, the filter will implicitly map input channels to
-output channels preserving index.
+output channels, preserving indices.
-For example, assuming a 5.1+downmix input MOV file
+For example, assuming a 5.1+downmix input MOV file,
@example
ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
@end example
@@ -1246,22 +1272,22 @@ ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
@section channelsplit
-Split each channel in input audio stream into a separate output stream.
+Split each channel from an input audio stream into a separate output stream.
-This filter accepts the following named parameters:
+It accepts the following parameters:
@table @option
@item channel_layout
-Channel layout of the input stream. Default is "stereo".
+The channel layout of the input stream. The default is "stereo".
@end table
-For example, assuming a stereo input MP3 file
+For example, assuming a stereo input MP3 file,
@example
ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
@end example
will create an output Matroska file with two audio streams, one containing only
the left channel and the other the right channel.
-To split a 5.1 WAV file into per-channel files
+Split a 5.1 WAV file into per-channel files:
@example
ffmpeg -i in.wav -filter_complex
'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
@@ -1271,79 +1297,77 @@ side_right.wav
@end example
@section compand
+Compress or expand the audio's dynamic range.
-Compress or expand audio dynamic range.
-
-A description of the accepted options follows.
+It accepts the following parameters:
@table @option
+
@item attacks
@item decays
-Set list of times in seconds for each channel over which the instantaneous
-level of the input signal is averaged to determine its volume.
-@option{attacks} refers to increase of volume and @option{decays} refers
-to decrease of volume.
-For most situations, the attack time (response to the audio getting louder)
-should be shorter than the decay time because the human ear is more sensitive
-to sudden loud audio than sudden soft audio.
-Typical value for attack is @code{0.3} seconds and for decay @code{0.8}
-seconds.
+A list of times in seconds for each channel over which the instantaneous level
+of the input signal is averaged to determine its volume. @var{attacks} refers to
+increase of volume and @var{decays} refers to decrease of volume. For most
+situations, the attack time (response to the audio getting louder) should be
+shorter than the decay time, because the human ear is more sensitive to sudden
+loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
+a typical value for decay is 0.8 seconds.
@item points
-Set list of points for transfer function, specified in dB relative to maximum
-possible signal amplitude.
-Each key points list need to be defined using the following syntax:
-@code{x0/y0 x1/y1 x2/y2 ...}.
+A list of points for the transfer function, specified in dB relative to the
+maximum possible signal amplitude. Each key points list must be defined using
+the following syntax: @code{x0/y0|x1/y1|x2/y2|....} or
+@code{x0/y0 x1/y1 x2/y2 ....}
-The input values must be in strictly increasing order but the transfer
-function does not have to be monotonically rising.
-The point @code{0/0} is assumed but may be overridden (by @code{0/out-dBn}).
-Typical values for the transfer function are @code{-70/-70 -60/-20}.
+The input values must be in strictly increasing order but the transfer function
+does not have to be monotonically rising. The point @code{0/0} is assumed but
+may be overridden (by @code{0/out-dBn}). Typical values for the transfer
+function are @code{-70/-70|-60/-20}.
@item soft-knee
-Set amount for which the points at where adjacent line segments on the
-transfer function meet will be rounded. Defaults is @code{0.01}.
+Set the curve radius in dB for all joints. It defaults to 0.01.
@item gain
-Set additional gain in dB to be applied at all points on the transfer function
-and allows easy adjustment of the overall gain.
-Default is @code{0}.
+Set the additional gain in dB to be applied at all points on the transfer
+function. This allows for easy adjustment of the overall gain.
+It defaults to 0.
@item volume
-Set initial volume in dB to be assumed for each channel when filtering starts.
-This permits the user to supply a nominal level initially, so that,
-for example, a very large gain is not applied to initial signal levels before
-the companding has begun to operate. A typical value for audio which is
-initially quiet is -90 dB. Default is @code{0}.
+Set an initial volume, in dB, to be assumed for each channel when filtering
+starts. This permits the user to supply a nominal level initially, so that, for
+example, a very large gain is not applied to initial signal levels before the
+companding has begun to operate. A typical value for audio which is initially
+quiet is -90 dB. It defaults to 0.
@item delay
-Set delay in seconds. Default is @code{0}. The input audio
-is analysed immediately, but audio is delayed before being fed to the
-volume adjuster. Specifying a delay approximately equal to the attack/decay
-times allows the filter to effectively operate in predictive rather than
-reactive mode.
+Set a delay, in seconds. The input audio is analyzed immediately, but audio is
+delayed before being fed to the volume adjuster. Specifying a delay
+approximately equal to the attack/decay times allows the filter to effectively
+operate in predictive rather than reactive mode. It defaults to 0.
+
@end table
@subsection Examples
+
@itemize
@item
-Make music with both quiet and loud passages suitable for listening
-in a noisy environment:
+Make music with both quiet and loud passages suitable for listening to in a
+noisy environment:
@example
-compand=.3 .3:1 1:-90/-60 -60/-40 -40/-30 -20/-20:6:0:-90:0.2
+compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
@end example
@item
-Noise-gate for when the noise is at a lower level than the signal:
+A noise gate for when the noise is at a lower level than the signal:
@example
-compand=.1 .1:.2 .2:-900/-900 -50.1/-900 -50/-50:.01:0:-90:.1
+compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
@end example
@item
-Here is another noise-gate, this time for when the noise is at a higher level
+Here is another noise gate, this time for when the noise is at a higher level
than the signal (making it, in some ways, similar to squelch):
@example
-compand=.1 .1:.1 .1:-45.1/-45.1 -45/-900 0/-900:.01:45:-90:.1
+compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
@end example
@end itemize
@@ -1395,6 +1419,21 @@ Set the required gain or attenuation in dB.
Beware of clipping when using a positive gain.
@end table
+@subsection Examples
+@itemize
+@item
+Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
+@example
+equalizer=f=1000:width_type=h:width=200:g=-10
+@end example
+
+@item
+Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
+@example
+equalizer=f=1000:width_type=q:width=1:g=2,equalizer=f=100:width_type=q:width=2:g=-5
+@end example
+@end itemize
+
@section highpass
Apply a high-pass filter with 3dB point frequency.
@@ -1433,14 +1472,14 @@ The default is 0.707q and gives a Butterworth response.
Join multiple input streams into one multi-channel stream.
-The filter accepts the following named parameters:
+It accepts the following parameters:
@table @option
@item inputs
-Number of input streams. Defaults to 2.
+The number of input streams. It defaults to 2.
@item channel_layout
-Desired output channel layout. Defaults to stereo.
+The desired output channel layout. It defaults to stereo.
@item map
Map channels from inputs to output. The argument is a '|'-separated list of
@@ -1451,16 +1490,16 @@ index in the specified input stream. @var{out_channel} is the name of the output
channel.
@end table
-The filter will attempt to guess the mappings when those are not specified
+The filter will attempt to guess the mappings when they are not specified
explicitly. It does so by first trying to find an unused matching input channel
and if that fails it picks the first unused input channel.
-E.g. to join 3 inputs (with properly set channel layouts)
+Join 3 inputs (with properly set channel layouts):
@example
ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
@end example
-To build a 5.1 output from 6 single-channel streams:
+Build a 5.1 output from 6 single-channel streams:
@example
ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE'
@@ -1710,7 +1749,7 @@ At end of filtering it displays @code{track_gain} and @code{track_peak}.
@section resample
-Convert the audio sample format, sample rate and channel layout. This filter is
+Convert the audio sample format, sample rate and channel layout. It is
not meant to be used directly.
@section silencedetect
@@ -1791,12 +1830,11 @@ Determine how steep is the filter's shelf transition.
Adjust the input audio volume.
-The filter accepts the following options:
-
+It accepts the following parameters:
@table @option
@item volume
-Expresses how the audio volume will be increased or decreased.
+Set audio volume expression.
Output values are clipped to the maximum value.
@@ -1805,22 +1843,109 @@ The output audio volume is given by the relation:
@var{output_volume} = @var{volume} * @var{input_volume}
@end example
-Default value for @var{volume} is 1.0.
+The default value for @var{volume} is "1.0".
@item precision
-Set the mathematical precision.
+This parameter represents the mathematical precision.
-This determines which input sample formats will be allowed, which affects the
+It determines which input sample formats will be allowed, which affects the
precision of the volume scaling.
@table @option
@item fixed
-8-bit fixed-point; limits input sample format to U8, S16, and S32.
+8-bit fixed-point; this limits input sample format to U8, S16, and S32.
@item float
-32-bit floating-point; limits input sample format to FLT. (default)
+32-bit floating-point; this limits input sample format to FLT. (default)
@item double
-64-bit floating-point; limits input sample format to DBL.
+64-bit floating-point; this limits input sample format to DBL.
+@end table
+
+@item replaygain
+Choose the behaviour on encountering ReplayGain side data in input frames.
+
+@table @option
+@item drop
+Remove ReplayGain side data, ignoring its contents (the default).
+
+@item ignore
+Ignore ReplayGain side data, but leave it in the frame.
+
+@item track
+Prefer the track gain, if present.
+
+@item album
+Prefer the album gain, if present.
+@end table
+
+@item replaygain_preamp
+Pre-amplification gain in dB to apply to the selected replaygain gain.
+
+Default value for @var{replaygain_preamp} is 0.0.
+
+@item eval
+Set when the volume expression is evaluated.
+
+It accepts the following values:
+@table @samp
+@item once
+only evaluate expression once during the filter initialization, or
+when the @samp{volume} command is sent
+
+@item frame
+evaluate expression for each incoming frame
+@end table
+
+Default value is @samp{once}.
+@end table
+
+The volume expression can contain the following parameters.
+
+@table @option
+@item n
+frame number (starting at zero)
+@item nb_channels
+number of channels
+@item nb_consumed_samples
+number of samples consumed by the filter
+@item nb_samples
+number of samples in the current frame
+@item pos
+original frame position in the file
+@item pts
+frame PTS
+@item sample_rate
+sample rate
+@item startpts
+PTS at start of stream
+@item startt
+time at start of stream
+@item t
+frame time
+@item tb
+timestamp timebase
+@item volume
+last set volume value
@end table
+
+Note that when @option{eval} is set to @samp{once} only the
+@var{sample_rate} and @var{tb} variables are available, all other
+variables will evaluate to NAN.
+
+@subsection Commands
+
+This filter supports the following commands:
+@table @option
+@item volume
+Modify the volume expression.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+@item replaygain_noclip
+Prevent clipping by limiting the gain applied.
+
+Default value for @var{replaygain_noclip} is 1.
+
@end table
@subsection Examples
@@ -1845,6 +1970,12 @@ Increase input audio power by 6 decibels using fixed-point precision:
@example
volume=volume=6dB:precision=fixed
@end example
+
+@item
+Fade volume after time 10 with an annihilation period of 5 seconds:
+@example
+volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
+@end example
@end itemize
@section volumedetect
@@ -1903,12 +2034,11 @@ Buffer audio frames, and make them available to the filter chain.
This source is mainly intended for a programmatic use, in particular
through the interface defined in @file{libavfilter/asrc_abuffer.h}.
-It accepts the following named parameters:
-
+It accepts the following parameters:
@table @option
@item time_base
-Timebase which will be used for timestamps of submitted frames. It must be
+The timebase which will be used for timestamps of submitted frames. It must be
either a floating-point number or in @var{numerator}/@var{denominator} form.
@item sample_rate
@@ -2044,7 +2174,7 @@ aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
@section anullsrc
-Null audio source, return unprocessed audio frames. It is mainly useful
+The null audio source, return unprocessed audio frames. It is mainly useful
as a template and to be employed in analysis / debugging tools, or as
the source for filters which ignore the input data (for example the sox
synth filter).
@@ -2055,7 +2185,7 @@ This source accepts the following options:
@item channel_layout, cl
-Specify the channel layout, and can be either an integer or a string
+Specifies the channel layout, and can be either an integer or a string
representing a channel layout. The default value of @var{channel_layout}
is "stereo".
@@ -2064,7 +2194,7 @@ Check the channel_layout_map definition in
channel layout values.
@item sample_rate, r
-Specify the sample rate, and defaults to 44100.
+Specifies the sample rate, and defaults to 44100.
@item nb_samples, n
Set the number of samples per requested frames.
@@ -2218,11 +2348,10 @@ or the options system.
It accepts a pointer to an AVABufferSinkContext structure, which
defines the incoming buffers' formats, to be passed as the opaque
parameter to @code{avfilter_init_filter} for initialization.
-
@section anullsink
-Null audio sink, do absolutely nothing with the input audio. It is
-mainly useful as a template and to be employed in analysis / debugging
+Null audio sink; do absolutely nothing with the input audio. It is
+mainly useful as a template and for use in analysis / debugging
tools.
@c man end AUDIO SINKS
@@ -2347,16 +2476,16 @@ the position in the file if known or -1 and the timestamp in seconds.
In order to display the output lines, you need to set the loglevel at
least to the AV_LOG_INFO value.
-The filter accepts the following options:
+It accepts the following parameters:
@table @option
@item amount
-Set the percentage of the pixels that have to be below the threshold, defaults
-to @code{98}.
+The percentage of the pixels that have to be below the threshold; it defaults to
+@code{98}.
@item threshold, thresh
-Set the threshold below which a pixel value is considered black, defaults to
+The threshold below which a pixel value is considered black; it defaults to
@code{32}.
@end table
@@ -2499,9 +2628,9 @@ blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
@section boxblur
-Apply boxblur algorithm to the input video.
+Apply a boxblur algorithm to the input video.
-The filter accepts the following options:
+It accepts the following parameters:
@table @option
@@ -2536,16 +2665,16 @@ The expressions can contain the following constants:
@table @option
@item w
@item h
-the input width and height in pixels
+The input width and height in pixels.
@item cw
@item ch
-the input chroma image width and height in pixels
+The input chroma image width and height in pixels.
@item hsub
@item vsub
-horizontal and vertical chroma subsample values. For example for the
-pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
+The horizontal and vertical chroma subsample values. For example, for the
+pixel format "yuv422p", @var{hsub} is 2 and @var{vsub} is 1.
@end table
@item luma_power, lp
@@ -2565,7 +2694,7 @@ A value of 0 will disable the effect.
@itemize
@item
-Apply a boxblur filter with luma, chroma, and alpha radius
+Apply a boxblur filter with the luma, chroma, and alpha radii
set to 2:
@example
boxblur=luma_radius=2:luma_power=1
@@ -2573,13 +2702,13 @@ boxblur=2:1
@end example
@item
-Set luma radius to 2, alpha and chroma radius to 0:
+Set the luma radius to 2, and alpha and chroma radius to 0:
@example
boxblur=2:1:cr=0:ar=0
@end example
@item
-Set luma and chroma radius to a fraction of the video dimension:
+Set the luma and chroma radii to a fraction of the video dimension:
@example
boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
@end example
@@ -2720,33 +2849,33 @@ colormatrix=bt601:smpte240m
@section copy
-Copy the input source unchanged to the output. Mainly useful for
+Copy the input source unchanged to the output. This is mainly useful for
testing purposes.
@section crop
Crop the input video to given dimensions.
-The filter accepts the following options:
+It accepts the following parameters:
@table @option
@item w, out_w
-Width of the output video. It defaults to @code{iw}.
+The width of the output video. It defaults to @code{iw}.
This expression is evaluated only once during the filter
configuration.
@item h, out_h
-Height of the output video. It defaults to @code{ih}.
+The height of the output video. It defaults to @code{ih}.
This expression is evaluated only once during the filter
configuration.
@item x
-Horizontal position, in the input video, of the left edge of the output video.
-It defaults to @code{(in_w-out_w)/2}.
+The horizontal position, in the input video, of the left edge of the output
+video. It defaults to @code{(in_w-out_w)/2}.
This expression is evaluated per-frame.
@item y
-Vertical position, in the input video, of the top edge of the output video.
+The vertical position, in the input video, of the top edge of the output video.
It defaults to @code{(in_h-out_h)/2}.
This expression is evaluated per-frame.
@@ -2762,24 +2891,24 @@ expressions containing the following constants:
@table @option
@item x
@item y
-the computed values for @var{x} and @var{y}. They are evaluated for
+The computed values for @var{x} and @var{y}. They are evaluated for
each new frame.
@item in_w
@item in_h
-the input width and height
+The input width and height.
@item iw
@item ih
-same as @var{in_w} and @var{in_h}
+These are the same as @var{in_w} and @var{in_h}.
@item out_w
@item out_h
-the output (cropped) width and height
+The output (cropped) width and height.
@item ow
@item oh
-same as @var{out_w} and @var{out_h}
+These are the same as @var{out_w} and @var{out_h}.
@item a
same as @var{iw} / @var{ih}
@@ -2796,13 +2925,13 @@ horizontal and vertical chroma subsample values. For example for the
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
@item n
-the number of input frame, starting from 0
+The number of the input frame, starting from 0.
@item pos
the position in the file of the input frame, NAN if unknown
@item t
-timestamp expressed in seconds, NAN if the input timestamp is unknown
+The timestamp expressed in seconds. It's NAN if the input timestamp is unknown.
@end table
@@ -2855,7 +2984,7 @@ crop=in_h
@item
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:
+corner of the input image.
@example
crop=in_w-100:in_h-100:100:100
@end example
@@ -2900,26 +3029,26 @@ crop=in_w/2:in_h/2:y:10+10*sin(n/10)
@section cropdetect
-Auto-detect crop size.
+Auto-detect the crop size.
-Calculate necessary cropping parameters and prints the recommended
-parameters through the logging system. The detected dimensions
+It calculates the necessary cropping parameters and prints the
+recommended parameters via the logging system. The detected dimensions
correspond to the non-black area of the input video.
-The filter accepts the following options:
+It accepts the following parameters:
@table @option
@item limit
Set higher black value threshold, which can be optionally specified
from nothing (0) to everything (255). An intensity value greater
-to the set value is considered non-black. Default value is 24.
+to the set value is considered non-black. It defaults to 24.
@item round
-Set the value for which the width/height should be divisible by. The
-offset is automatically adjusted to center the video. Use 2 to get
-only even dimensions (needed for 4:2:2 video). 16 is best when
-encoding to most video codecs. Default value is 16.
+The value which the width/height should be divisible by. It defaults to
+16. The offset is automatically adjusted to center the video. Use 2 to
+get only even dimensions (needed for 4:2:2 video). 16 is best when
+encoding to most video codecs.
@item reset_count, reset
Set the counter that determines after how many frames cropdetect will
@@ -2927,7 +3056,7 @@ reset the previously detected largest video area and start over to
detect the current optimal crop area. Default value is 0.
This can be useful when channel logos distort the video area. 0
-indicates never reset and return the largest area encountered during
+indicates 'never reset', and returns the largest area encountered during
playback.
@end table
@@ -3138,13 +3267,45 @@ Set whether or not chroma is considered in the metric calculations. Default is
@code{1}.
@end table
+@section dejudder
+
+Remove judder produced by partially interlaced telecined content.
+
+Judder can be introduced, for instance, by @ref{pullup} filter. If the original
+source was partially telecined content then the output of @code{pullup,dejudder}
+will have a variable frame rate. May change the recorded frame rate of the
+container. Aside from that change, this filter will not affect constant frame
+rate video.
+
+The option available in this filter is:
+@table @option
+
+@item cycle
+Specify the length of the window over which the judder repeats.
+
+Accepts any interger greater than 1. Useful values are:
+@table @samp
+
+@item 4
+If the original was telecined from 24 to 30 fps (Film to NTSC).
+
+@item 5
+If the original was telecined from 25 to 30 fps (PAL to NTSC).
+
+@item 20
+If a mixture of the two.
+@end table
+
+The default is @samp{4}.
+@end table
+
@section delogo
Suppress a TV station logo by a simple interpolation of the surrounding
pixels. Just set a rectangle covering the logo and watch it disappear
(and sometimes something even uglier appear - your mileage may vary).
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item x
@@ -3178,7 +3339,7 @@ compute the interpolated pixel values inside the rectangle.
@itemize
@item
Set a rectangle covering the area with top left corner coordinates 0,0
-and size 100x77, setting a band of size 10:
+and size 100x77, and a band of size 10:
@example
delogo=x=0:y=0:w=100:h=77:band=10
@end example
@@ -3269,17 +3430,17 @@ FFmpeg was configured with @code{--enable-opencl}. Default value is 0.
Draw a colored box on the input image.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item x
@item y
-The expressions which specify the top left corner coordinates of the box. Default to 0.
+The expressions which specify the top left corner coordinates of the box. It defaults to 0.
@item width, w
@item height, h
-The expressions which specify the width and height of the box, if 0 they are interpreted as
-the input width and height. Default to 0.
+The expressions which specify the width and height of the box; if 0 they are interpreted as
+the input width and height. It defaults to 0.
@item color, c
Specify the color of the box to write. For the general syntax of this option,
@@ -3365,7 +3526,7 @@ drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
Draw a grid on the input image.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item x
@@ -3444,21 +3605,23 @@ drawgrid=w=iw/3:h=ih/3:t=2:c=white@@0.5
@anchor{drawtext}
@section drawtext
-Draw text string or text from specified file on top of video using the
+Draw a text string or text from a specified file on top of a video, using the
libfreetype library.
-To enable compilation of this filter you need to configure FFmpeg with
+To enable compilation of this filter, you need to configure FFmpeg with
@code{--enable-libfreetype}.
+To enable default font fallback and the @var{font} option you need to
+configure FFmpeg with @code{--enable-libfontconfig}.
@subsection Syntax
-The description of the accepted parameters follows.
+It accepts the following parameters:
@table @option
@item box
-Used to draw a box around text using background color.
-Value should be either 1 (enable) or 0 (disable).
+Used to draw a box around text using the background color.
+The value must be either 1 (enable) or 0 (disable).
The default value of @var{box} is 0.
@item boxcolor
@@ -3467,6 +3630,16 @@ option, check the "Color" section in the ffmpeg-utils manual.
The default value of @var{boxcolor} is "white".
+@item borderw
+Set the width of the border to be drawn around the text using @var{bordercolor}.
+The default value of @var{borderw} is 0.
+
+@item bordercolor
+Set the color to be used for drawing border around text. For the syntax of this
+option, check the "Color" section in the ffmpeg-utils manual.
+
+The default value of @var{bordercolor} is "black".
+
@item expansion
Select how the @var{text} is expanded. Can be either @code{none},
@code{strftime} (deprecated) or
@@ -3482,16 +3655,19 @@ the "Color" section in the ffmpeg-utils manual.
The default value of @var{fontcolor} is "black".
+@item font
+The font family to be used for drawing text. By default Sans.
+
@item fontfile
-The font file to be used for drawing text. Path must be included.
-This parameter is mandatory.
+The font file to be used for drawing text. The path must be included.
+This parameter is mandatory if the fontconfig support is disabled.
@item fontsize
The font size to be used for drawing text.
The default value of @var{fontsize} is 16.
@item ft_load_flags
-Flags to be used for loading the fonts.
+The flags to be used for loading the fonts.
The flags map the corresponding flags supported by libfreetype, and are
a combination of the following values:
@@ -3513,7 +3689,7 @@ a combination of the following values:
@item no_autohint
@end table
-Default value is "render".
+Default value is "default".
For more information consult the documentation for the FT_LOAD_*
libfreetype flags.
@@ -3528,7 +3704,7 @@ The default value of @var{shadowcolor} is "black".
@item shadowy
The x and y offsets for the text shadow position with respect to the
position of the text. They can be either positive or negative
-values. Default value for both is "0".
+values. The default value for both is "0".
@item start_number
The starting frame number for the n/frame_num variable. The default value
@@ -3626,7 +3802,7 @@ the number of input frame, starting from 0
return a random number included between @var{min} and @var{max}
@item sar
-input sample aspect ratio
+The input sample aspect ratio.
@item t
timestamp expressed in seconds, NAN if the input timestamp is unknown
@@ -3645,9 +3821,6 @@ These parameters allow the @var{x} and @var{y} expressions to refer
each other, so you can for example specify @code{y=x/dar}.
@end table
-If libavfilter was built with @code{--enable-fontconfig}, then
-@option{fontfile} can be a fontconfig pattern or omitted.
-
@anchor{drawtext_expansion}
@subsection Text expansion
@@ -3707,7 +3880,14 @@ The frame number, starting from 0.
A 1 character description of the current picture type.
@item pts
-The timestamp of the current frame, in seconds, with microsecond accuracy.
+The timestamp of the current frame.
+It can take up to two arguments.
+
+The first argument is the format of the timestamp; it defaults to @code{flt}
+for seconds as a decimal number with microsecond accuracy; @code{hms} stands
+for a formatted @var{[-]HH:MM:SS.mmm} timestamp with millisecond accuracy.
+
+The second argument is an offset added to the timestamp.
@end table
@@ -3805,18 +3985,42 @@ The high threshold selects the "strong" edge pixels, which are then
connected through 8-connectivity with the "weak" edge pixels selected
by the low threshold.
-@var{low} and @var{high} threshold values must be choosen in the range
+@var{low} and @var{high} threshold values must be chosen in the range
[0,1], and @var{low} should be lesser or equal to @var{high}.
Default value for @var{low} is @code{20/255}, and default value for @var{high}
is @code{50/255}.
+
+@item mode
+Define the drawing mode.
+
+@table @samp
+@item wires
+Draw white/gray wires on black background.
+
+@item colormix
+Mix the colors to create a paint/cartoon effect.
@end table
-Example:
+Default value is @var{wires}.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Standard edge detection with custom values for the hysteresis thresholding:
@example
edgedetect=low=0.1:high=0.4
@end example
+@item
+Painting effect without thresholding:
+@example
+edgedetect=mode=colormix:high=0
+@end example
+@end itemize
+
@section extractplanes
Extract color channel components from input video stream into
@@ -3883,24 +4087,24 @@ will try to use a good random seed on a best effort basis.
@section fade
-Apply fade-in/out effect to input video.
+Apply a fade-in/out effect to the input video.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item type, t
-The effect type -- can be either "in" for fade-in, or "out" for a fade-out
+The effect type can be either "in" for a fade-in, or "out" for a fade-out
effect.
Default is @code{in}.
@item start_frame, s
-Specify the number of the start frame for starting to apply the fade
-effect. Default is 0.
+Specify the number of the frame to start applying the fade
+effect at. Default is 0.
@item nb_frames, n
-The number of frames for which the fade effect has to last. At the end of the
-fade-in effect the output video will have the same intensity as the input video,
-at the end of the fade-out transition the output video will be filled with the
+The number of frames that the fade effect lasts. At the end of the
+fade-in effect, the output video will have the same intensity as the input video.
+At the end of the fade-out transition, the output video will be filled with the
selected @option{color}.
Default is 25.
@@ -3928,7 +4132,7 @@ Specify the color of the fade. Default is "black".
@itemize
@item
-Fade in first 30 frames of video:
+Fade in the first 30 frames of video:
@example
fade=in:0:30
@end example
@@ -3939,20 +4143,20 @@ fade=t=in:s=0:n=30
@end example
@item
-Fade out last 45 frames of a 200-frame video:
+Fade out the last 45 frames of a 200-frame video:
@example
fade=out:155:45
fade=type=out:start_frame=155:nb_frames=45
@end example
@item
-Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
+Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
@example
fade=in:0:25, fade=out:975:25
@end example
@item
-Make first 5 frames yellow, then fade in from frame 5-24:
+Make the first 5 frames yellow, then fade in from frame 5-24:
@example
fade=in:5:20:color=yellow
@end example
@@ -3964,7 +4168,7 @@ fade=in:0:25:alpha=1
@end example
@item
-Make first 5.5 seconds black, then fade in for 0.5 seconds:
+Make the first 5.5 seconds black, then fade in for 0.5 seconds:
@example
fade=t=in:st=5.5:d=0.5
@end example
@@ -4312,26 +4516,26 @@ fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
Transform the field order of the input video.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item order
-Output field order. Valid values are @var{tff} for top field first or @var{bff}
+The output field order. Valid values are @var{tff} for top field first or @var{bff}
for bottom field first.
@end table
-Default value is @samp{tff}.
+The default value is @samp{tff}.
-Transformation is achieved by shifting the picture content up or down
+The transformation is done by shifting the picture content up or down
by one line, and filling the remaining line with appropriate picture content.
This method is consistent with most broadcast field order converters.
If the input video is not flagged as being interlaced, or it is already
-flagged as being of the required output field order then this filter does
+flagged as being of the required output field order, then this filter does
not alter the incoming video.
-This filter is very useful when converting to or from PAL DV material,
+It is very useful when converting to or from PAL DV material,
which is bottom field first.
For example:
@@ -4343,23 +4547,23 @@ ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
Buffer input images and send them when they are requested.
-This filter is mainly useful when auto-inserted by the libavfilter
+It is mainly useful when auto-inserted by the libavfilter
framework.
-The filter does not take parameters.
+It does not take parameters.
@anchor{format}
@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
+Libavfilter will try to pick one that is suitable as input to
the next filter.
-This filter accepts the following parameters:
+It accepts the following parameters:
@table @option
@item pix_fmts
-A '|'-separated list of pixel format names, for example
+A '|'-separated list of pixel format names, such as
"pix_fmts=yuv420p|monow|rgb24".
@end table
@@ -4368,7 +4572,7 @@ A '|'-separated list of pixel format names, for example
@itemize
@item
-Convert the input video to the format @var{yuv420p}
+Convert the input video to the @var{yuv420p} format
@example
format=pix_fmts=yuv420p
@end example
@@ -4385,11 +4589,11 @@ format=pix_fmts=yuv420p|yuv444p|yuv410p
Convert the video to specified constant frame rate by duplicating or dropping
frames as necessary.
-This filter accepts the following named parameters:
+It accepts the following parameters:
@table @option
@item fps
-Desired output frame rate. The default is @code{25}.
+The desired output frame rate. The default is @code{25}.
@item round
Rounding method.
@@ -4440,6 +4644,51 @@ fps=fps=film:round=near
@end example
@end itemize
+@section framepack
+
+Pack two different video streams into a stereoscopic video, setting proper
+metadata on supported codecs. The two views should have the same size and
+framerate and processing will stop when the shorter video ends. Please note
+that you may conveniently adjust view properties with the @ref{scale} and
+@ref{fps} filters.
+
+It accepts the following parameters:
+@table @option
+
+@item format
+The desired packing format. Supported values are:
+
+@table @option
+
+@item sbs
+The views are next to each other (default).
+
+@item tab
+The views are on top of each other.
+
+@item lines
+The views are packed by line.
+
+@item columns
+The views are packed by column.
+
+@item frameseq
+The views are temporally interleaved.
+
+@end table
+
+@end table
+
+Some examples:
+
+@example
+# Convert left and right views into a frame-sequential video
+ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
+
+# Convert views into a side-by-side video with the same output resolution as the input
+ffmpeg -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
+@end example
+
@section framestep
Select one frame every N-th frame.
@@ -4456,18 +4705,18 @@ Allowed values are positive integers higher than 0. Default value is @code{1}.
Apply a frei0r effect to the input video.
-To enable compilation of this filter you need to install the frei0r
+To enable the compilation of this filter, you need to install the frei0r
header and configure FFmpeg with @code{--enable-frei0r}.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item filter_name
-The name to the frei0r effect to load. If the environment variable
-@env{FREI0R_PATH} is defined, the frei0r effect is searched in each one of the
-directories specified by the colon separated list in @env{FREIOR_PATH},
-otherwise in the standard frei0r paths, which are in this order:
+The name of the frei0r effect to load. If the environment variable
+@env{FREI0R_PATH} is defined, the frei0r effect is searched for in each of the
+directories specified by the colon-separated list in @env{FREIOR_PATH}.
+Otherwise, the standard frei0r paths are searched, in this order:
@file{HOME/.frei0r-1/lib/}, @file{/usr/local/lib/frei0r-1/},
@file{/usr/lib/frei0r-1/}.
@@ -4476,27 +4725,27 @@ A '|'-separated list of parameters to pass to the frei0r effect.
@end table
-A frei0r effect parameter can be a boolean (whose values are specified
-with "y" and "n"), a double, a color (specified by the syntax
-@var{R}/@var{G}/@var{B}, (@var{R}, @var{G}, and @var{B} being float
-numbers from 0.0 to 1.0) or by a color description specified in the "Color"
-section in the ffmpeg-utils manual), a position (specified by the syntax @var{X}/@var{Y},
-@var{X} and @var{Y} being float numbers) and a string.
+A frei0r effect parameter can be a boolean (its value is either
+"y" or "n"), a double, a color (specified as
+@var{R}/@var{G}/@var{B}, where @var{R}, @var{G}, and @var{B} are floating point
+numbers between 0.0 and 1.0, inclusive) or by a color description specified in the "Color"
+section in the ffmpeg-utils manual), a position (specified as @var{X}/@var{Y}, where
+@var{X} and @var{Y} are floating point numbers) and/or a string.
-The number and kind of parameters depend on the loaded effect. If an
-effect parameter is not specified the default value is set.
+The number and types of parameters depend on the loaded effect. If an
+effect parameter is not specified, the default value is set.
@subsection Examples
@itemize
@item
-Apply the distort0r effect, set the first two double parameters:
+Apply the distort0r effect, setting the first two double parameters:
@example
frei0r=filter_name=distort0r:filter_params=0.5|0.01
@end example
@item
-Apply the colordistance effect, take a color as first parameter:
+Apply the colordistance effect, taking a color as the first parameter:
@example
frei0r=colordistance:0.2/0.3/0.4
frei0r=colordistance:violet
@@ -4504,14 +4753,14 @@ frei0r=colordistance:0x112233
@end example
@item
-Apply the perspective effect, specify the top left and top right image
+Apply the perspective effect, specifying the top left and top right image
positions:
@example
frei0r=perspective:0.2/0.2|0.8/0.2
@end example
@end itemize
-For more information see:
+For more information, see
@url{http://frei0r.dyne.org}
@section geq
@@ -4643,25 +4892,25 @@ regions by truncation to 8bit color depth.
Interpolate the gradients that should go where the bands are, and
dither them.
-This filter is designed for playback only. Do not use it prior to
+It is designed for playback only. Do not use it prior to
lossy compression, because compression tends to lose the dither and
bring back the bands.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item strength
-The maximum amount by which the filter will change any one pixel. Also the
-threshold for detecting nearly flat regions. Acceptable values range from .51 to
-64, default value is 1.2, out-of-range values will be clipped to the valid
-range.
+The maximum amount by which the filter will change any one pixel. This is also
+the threshold for detecting nearly flat regions. Acceptable values range from
+.51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
+valid range.
@item radius
The neighborhood to fit the gradient to. A larger radius makes for smoother
gradients, but also prevents the filter from modifying the pixels near detailed
-regions. Acceptable values are 8-32, default value is 16, out-of-range values
-will be clipped to the valid range.
+regions. Acceptable values are 8-32; the default value is 16. Out-of-range
+values will be clipped to the valid range.
@end table
@@ -4763,7 +5012,7 @@ ffplay input.mkv -vf "movie=clut.png, [in] haldclut"
Flip the input video horizontally.
-For example to horizontally flip the input video with @command{ffmpeg}:
+For example, to horizontally flip the input video with @command{ffmpeg}:
@example
ffmpeg -i in.avi -vf "hflip" out.avi
@end example
@@ -4805,8 +5054,8 @@ the histogram. Possible values are @code{none}, @code{weak} or
Compute and draw a color distribution histogram for the input video.
-The computed histogram is a representation of distribution of color components
-in an image.
+The computed histogram is a representation of the color component
+distribution in an image.
The filter accepts the following options:
@@ -4817,41 +5066,38 @@ Set histogram mode.
It accepts the following values:
@table @samp
@item levels
-standard histogram that display color components distribution in an image.
-Displays color graph for each color component. Shows distribution
-of the Y, U, V, A or R, G, B components, depending on input format,
-in current frame. Bellow each graph is color component scale meter.
+Standard histogram that displays the color components distribution in an
+image. Displays color graph for each color component. Shows distribution of
+the Y, U, V, A or R, G, B components, depending on input format, in the
+current frame. Below each graph a color component scale meter is shown.
@item color
-chroma values in vectorscope, if brighter more such chroma values are
-distributed in an image.
-Displays chroma values (U/V color placement) in two dimensional graph
-(which is called a vectorscope). It can be used to read of the hue and
-saturation of the current frame. At a same time it is a histogram.
-The whiter a pixel in the vectorscope, the more pixels of the input frame
-correspond to that pixel (that is the more pixels have this chroma value).
-The V component is displayed on the horizontal (X) axis, with the leftmost
-side being V = 0 and the rightmost side being V = 255.
-The U component is displayed on the vertical (Y) axis, with the top
-representing U = 0 and the bottom representing U = 255.
-
-The position of a white pixel in the graph corresponds to the chroma value
-of a pixel of the input clip. So the graph can be used to read of the
-hue (color flavor) and the saturation (the dominance of the hue in the color).
-As the hue of a color changes, it moves around the square. At the center of
-the square, the saturation is zero, which means that the corresponding pixel
-has no color. If you increase the amount of a specific color, while leaving
-the other colors unchanged, the saturation increases, and you move towards
+Displays chroma values (U/V color placement) in a two dimensional
+graph (which is called a vectorscope). The brighter a pixel in the
+vectorscope, the more pixels of the input frame correspond to that pixel
+(i.e., more pixels have this chroma value). The V component is displayed on
+the horizontal (X) axis, with the leftmost side being V = 0 and the rightmost
+side being V = 255. The U component is displayed on the vertical (Y) axis,
+with the top representing U = 0 and the bottom representing U = 255.
+
+The position of a white pixel in the graph corresponds to the chroma value of
+a pixel of the input clip. The graph can therefore be used to read the hue
+(color flavor) and the saturation (the dominance of the hue in the color). As
+the hue of a color changes, it moves around the square. At the center of the
+square the saturation is zero, which means that the corresponding pixel has no
+color. If the amount of a specific color is increased (while leaving the other
+colors unchanged) the saturation increases, and the indicator moves towards
the edge of the square.
@item color2
-chroma values in vectorscope, similar as @code{color} but actual chroma values
+Chroma values in vectorscope, similar as @code{color} but actual chroma values
are displayed.
@item waveform
-per row/column color component graph. In row mode graph in the left side represents
-color component value 0 and right side represents value = 255. In column mode top
-side represents color component value = 0 and bottom side represents value = 255.
+Per row/column color component graph. In row mode, the graph on the left side
+represents color component value 0 and the right side represents value = 255.
+In column mode, the top side represents color component value = 0 and bottom
+side represents value = 255.
@end table
Default value is @code{levels}.
@@ -4864,8 +5110,8 @@ Set height of color scale in @code{levels}. Default value is @code{12}.
Allowed range is [0, 40].
@item step
-Set step for @code{waveform} mode. Smaller values are useful to find out how much
-of same luminance values across input rows/columns are distributed.
+Set step for @code{waveform} mode. Smaller values are useful to find out how
+many values of the same luminance are distributed across input rows/columns.
Default value is @code{10}. Allowed range is [1, 255].
@item waveform_mode
@@ -4884,26 +5130,25 @@ It accepts the following values:
@table @samp
@item parade
Display separate graph for the color components side by side in
-@code{row} waveform mode or one below other in @code{column} waveform mode
-for @code{waveform} histogram mode. For @code{levels} histogram mode
-per color component graphs are placed one bellow other.
-
-This display mode in @code{waveform} histogram mode makes it easy to spot
-color casts in the highlights and shadows of an image, by comparing the
-contours of the top and the bottom of each waveform.
-Since whites, grays, and blacks are characterized by
-exactly equal amounts of red, green, and blue, neutral areas of the
-picture should display three waveforms of roughly equal width/height.
-If not, the correction is easy to make by making adjustments to level the
-three waveforms.
+@code{row} waveform mode or one below the other in @code{column} waveform mode
+for @code{waveform} histogram mode. For @code{levels} histogram mode,
+per color component graphs are placed below each other.
+
+Using this display mode in @code{waveform} histogram mode makes it easy to
+spot color casts in the highlights and shadows of an image, by comparing the
+contours of the top and the bottom graphs of each waveform. Since whites,
+grays, and blacks are characterized by exactly equal amounts of red, green,
+and blue, neutral areas of the picture should display three waveforms of
+roughly equal width/height. If not, the correction is easy to perform by
+making level adjustments the three waveforms.
@item overlay
-Presents information that's identical to that in the @code{parade}, except
+Presents information identical to that in the @code{parade}, except
that the graphs representing color components are superimposed directly
over one another.
-This display mode in @code{waveform} histogram mode can make it easier to spot
-the relative differences or similarities in overlapping areas of the color
+This display mode in @code{waveform} histogram mode makes it easier to spot
+relative differences or similarities in overlapping areas of the color
components that are supposed to be identical, such as neutral whites, grays,
or blacks.
@end table
@@ -4929,35 +5174,35 @@ ffplay -i input -vf histogram
@anchor{hqdn3d}
@section hqdn3d
-High precision/quality 3d denoise filter. This filter aims to reduce
-image noise producing smooth images and making still images really
+This is a high precision/quality 3d denoise filter. It aims to reduce
+image noise, producing smooth images and making still images really
still. It should enhance compressibility.
It accepts the following optional parameters:
@table @option
@item luma_spatial
-a non-negative float number which specifies spatial luma strength,
-defaults to 4.0
+A non-negative floating point number which specifies spatial luma strength.
+It defaults to 4.0.
@item chroma_spatial
-a non-negative float number which specifies spatial chroma strength,
-defaults to 3.0*@var{luma_spatial}/4.0
+A non-negative floating point number which specifies spatial chroma strength.
+It defaults to 3.0*@var{luma_spatial}/4.0.
@item luma_tmp
-a float number which specifies luma temporal strength, defaults to
-6.0*@var{luma_spatial}/4.0
+A floating point number which specifies luma temporal strength. It defaults to
+6.0*@var{luma_spatial}/4.0.
@item chroma_tmp
-a float number which specifies chroma temporal strength, defaults to
-@var{luma_tmp}*@var{chroma_spatial}/@var{luma_spatial}
+A floating point number which specifies chroma temporal strength. It defaults to
+@var{luma_tmp}*@var{chroma_spatial}/@var{luma_spatial}.
@end table
@section hue
Modify the hue and/or the saturation of the input.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item h
@@ -5081,7 +5326,7 @@ Set progressive threshold.
Deinterleave or interleave fields.
-This filter allows to process interlaced images fields without
+This filter allows one to process interlaced images fields without
deinterlacing them. Deinterleaving splits the input frame into 2
fields (so called half pictures). Odd lines are moved to the top
half of the output image, even lines to the bottom half.
@@ -5118,7 +5363,8 @@ Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is @code
Simple interlacing filter from progressive contents. This interleaves upper (or
lower) lines from odd frames with lower (or upper) lines from even frames,
-halving the frame rate and preserving image height.
+halving the frame rate and preserving image height. A vertical lowpass filter
+is always applied in order to avoid twitter effects and reduce moiré patterns.
@example
Original Original New Frame
@@ -5136,12 +5382,8 @@ It accepts the following optional parameters:
@table @option
@item scan
-determines whether the interlaced frame is taken from the even (tff - default)
-or odd (bff) lines of the progressive frame.
-
-@item lowpass
-Enable (default) or disable the vertical lowpass filter to avoid twitter
-interlacing and reduce moire patterns.
+This determines whether the interlaced frame is taken from the even
+(tff - default) or odd (bff) lines of the progressive frame.
@end table
@section kerndeint
@@ -5236,12 +5478,12 @@ Interpolate values using a tetrahedron.
@section lut, lutrgb, lutyuv
Compute a look-up table for binding each pixel component input value
-to an output value, and apply it to input video.
+to an output value, and apply it to the input video.
@var{lutyuv} applies a lookup table to a YUV input video, @var{lutrgb}
to an RGB input video.
-These filters accept the following options:
+These filters accept the following parameters:
@table @option
@item c0
set first pixel component expression
@@ -5283,32 +5525,32 @@ The expressions can contain the following constants and functions:
@table @option
@item w
@item h
-the input width and height
+The input width and height.
@item val
-input value for the pixel component
+The input value for the pixel component.
@item clipval
-the input value clipped in the @var{minval}-@var{maxval} range
+The input value, clipped to the @var{minval}-@var{maxval} range.
@item maxval
-maximum value for the pixel component
+The maximum value for the pixel component.
@item minval
-minimum value for the pixel component
+The minimum value for the pixel component.
@item negval
-the negated value for the pixel component value clipped in the
-@var{minval}-@var{maxval} range , it corresponds to the expression
-"maxval-clipval+minval"
+The negated value for the pixel component value, clipped to the
+@var{minval}-@var{maxval} range; it corresponds to the expression
+"maxval-clipval+minval".
@item clip(val)
-the computed value in @var{val} clipped in the
-@var{minval}-@var{maxval} range
+The computed value in @var{val}, clipped to the
+@var{minval}-@var{maxval} range.
@item gammaval(gamma)
-the computed gamma correction value of the pixel component value
-clipped in the @var{minval}-@var{maxval} range, corresponds to the
+The computed gamma correction value of the pixel component value,
+clipped to the @var{minval}-@var{maxval} range. It corresponds to the
expression
"pow((clipval-minval)/(maxval-minval)\,@var{gamma})*(maxval-minval)+minval"
@@ -5339,7 +5581,7 @@ lutyuv=y=negval
@end example
@item
-Remove chroma components, turns the video into a graytone image:
+Remove chroma components, turning the video into a graytone image:
@example
lutyuv="u=128:v=128"
@end example
@@ -5363,7 +5605,7 @@ format=rgba,lutrgb=a="maxval-minval/2"
@end example
@item
-Correct luminance gamma by a 0.5 factor:
+Correct luminance gamma by a factor of 0.5:
@example
lutyuv=y=gammaval(0.5)
@end example
@@ -5567,7 +5809,7 @@ Default value for @option{hi} is 64*12, default value for @option{lo} is
Negate input video.
-This filter accepts an integer in input, if non-zero it negates the
+It accepts an integer in input; if non-zero it negates the
alpha component (if available). The default value in input is 0.
@section noformat
@@ -5575,12 +5817,12 @@ alpha component (if available). The default value in input is 0.
Force libavfilter not to use any of the specified pixel formats for the
input to the next filter.
-This filter accepts the following parameters:
+It accepts the following parameters:
@table @option
@item pix_fmts
-A '|'-separated list of pixel format names, for example
-"pix_fmts=yuv420p|monow|rgb24".
+A '|'-separated list of pixel format names, such as
+apix_fmts=yuv420p|monow|rgb24".
@end table
@@ -5656,12 +5898,12 @@ Pass the video source unchanged to the output.
@section ocv
-Apply video transform using libopencv.
+Apply a video transform using libopencv.
-To enable this filter install libopencv library and headers and
+To enable this filter, install the libopencv library and headers and
configure FFmpeg with @code{--enable-libopencv}.
-This filter accepts the following parameters:
+It accepts the following parameters:
@table @option
@@ -5669,7 +5911,7 @@ This filter accepts the following parameters:
The name of the libopencv filter to apply.
@item filter_params
-The parameters to pass to the libopencv filter. If not specified the default
+The parameters to pass to the libopencv filter. If not specified, the default
values are assumed.
@end table
@@ -5678,13 +5920,13 @@ Refer to the official libopencv documentation for more precise
information:
@url{http://opencv.willowgarage.com/documentation/c/image_filtering.html}
-Follows the list of supported libopencv filters.
+Several libopencv filters are supported; see the following subsections.
@anchor{dilate}
@subsection dilate
Dilate an image by using a specific structuring element.
-This filter corresponds to the libopencv function @code{cvDilate}.
+It corresponds to the libopencv function @code{cvDilate}.
It accepts the parameters: @var{struct_el}|@var{nb_iterations}.
@@ -5693,8 +5935,8 @@ It accepts the parameters: @var{struct_el}|@var{nb_iterations}.
@var{cols} and @var{rows} represent the number of columns and rows of
the structuring element, @var{anchor_x} and @var{anchor_y} the anchor
-point, and @var{shape} the shape for the structuring element, and
-can be one of the values "rect", "cross", "ellipse", "custom".
+point, and @var{shape} the shape for the structuring element. @var{shape}
+must be "rect", "cross", "ellipse", or "custom".
If the value for @var{shape} is "custom", it must be followed by a
string of the form "=@var{filename}". The file with name
@@ -5708,31 +5950,32 @@ The default value for @var{struct_el} is "3x3+0x0/rect".
@var{nb_iterations} specifies the number of times the transform is
applied to the image, and defaults to 1.
-Follow some example:
+Some examples:
@example
-# use the default values
+# Use the default values
ocv=dilate
-# dilate using a structuring element with a 5x5 cross, iterate two times
+# Dilate using a structuring element with a 5x5 cross, iterating two times
ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
-# read the shape from the file diamond.shape, iterate two times
-# the file diamond.shape may contain a pattern of characters like this:
+# Read the shape from the file diamond.shape, iterating two times.
+# The file diamond.shape may contain a pattern of characters like this
# *
# ***
# *****
# ***
# *
-# the specified cols and rows are ignored (but not the anchor point coordinates)
+# The specified columns and rows are ignored
+# but the anchor point coordinates are not
ocv=dilate:0x0+2x2/custom=diamond.shape|2
@end example
@subsection erode
Erode an image by using a specific structuring element.
-This filter corresponds to the libopencv function @code{cvErode}.
+It corresponds to the libopencv function @code{cvErode}.
-The filter accepts the parameters: @var{struct_el}:@var{nb_iterations},
+It accepts the parameters: @var{struct_el}:@var{nb_iterations},
with the same syntax and semantics as the @ref{dilate} filter.
@subsection smooth
@@ -5742,16 +5985,16 @@ Smooth the input video.
The filter takes the following parameters:
@var{type}|@var{param1}|@var{param2}|@var{param3}|@var{param4}.
-@var{type} is the type of smooth filter to apply, and can be one of
+@var{type} is the type of smooth filter to apply, and must be one of
the following values: "blur", "blur_no_scale", "median", "gaussian",
-"bilateral". The default value is "gaussian".
+or "bilateral". The default value is "gaussian".
-@var{param1}, @var{param2}, @var{param3}, and @var{param4} are
-parameters whose meanings depend on smooth type. @var{param1} and
-@var{param2} accept integer positive values or 0, @var{param3} and
-@var{param4} accept float values.
+The meaning of @var{param1}, @var{param2}, @var{param3}, and @var{param4}
+depend on the smooth type. @var{param1} and
+@var{param2} accept integer positive values or 0. @var{param3} and
+@var{param4} accept floating point values.
-The default value for @var{param1} is 3, the default value for the
+The default value for @var{param1} is 3. The default value for the
other parameters is 0.
These parameters correspond to the parameters assigned to the
@@ -5762,10 +6005,10 @@ libopencv function @code{cvSmooth}.
Overlay one video on top of another.
-It takes two inputs and one output, the first input is the "main"
+It takes two inputs and has one output. The first input is the "main"
video on which the second input is overlayed.
-This filter accepts the following parameters:
+It accepts the following parameters:
A description of the accepted options follows.
@@ -5777,6 +6020,19 @@ on the main video. Default value is "0" for both expressions. In case
the expression is invalid, it is set to a huge value (meaning that the
overlay will not be displayed within the output visible area).
+@item eof_action
+The action to take when EOF is encountered on the secondary input; it accepts
+one of the following values:
+
+@table @option
+@item repeat
+Repeat the last frame (the default).
+@item endall
+End both streams.
+@item pass
+Pass the main input through.
+@end table
+
@item eval
Set when the expressions for @option{x}, and @option{y} are evaluated.
@@ -5804,6 +6060,9 @@ It accepts the following values:
@item yuv420
force YUV420 output
+@item yuv422
+force YUV422 output
+
@item yuv444
force YUV444 output
@@ -5830,15 +6089,15 @@ parameters.
@table @option
@item main_w, W
@item main_h, H
-main input width and height
+The main input width and height.
@item overlay_w, w
@item overlay_h, h
-overlay input width and height
+The overlay input width and height.
@item x
@item y
-the computed values for @var{x} and @var{y}. They are evaluated for
+The computed values for @var{x} and @var{y}. They are evaluated for
each new frame.
@item hsub
@@ -5854,7 +6113,8 @@ the number of input frame, starting from 0
the position in the file of the input frame, NAN if unknown
@item t
-timestamp expressed in seconds, NAN if the input timestamp is unknown
+The timestamp, expressed in seconds. It's NAN if the input timestamp is unknown.
+
@end table
Note that the @var{n}, @var{pos}, @var{t} variables are available only
@@ -5864,8 +6124,8 @@ when @option{eval} is set to @samp{init}.
Be aware that frames are taken from each input video in timestamp
order, hence, if their initial timestamps differ, it is a good idea
to pass the two inputs through a @var{setpts=PTS-STARTPTS} filter to
-have them begin in the same zero timestamp, as it does the example for
-the @var{movie} filter.
+have them begin in the same zero timestamp, as the example for
+the @var{movie} filter does.
You can chain together more overlays but you should test the
efficiency of such approach.
@@ -5913,7 +6173,7 @@ ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay
@end example
@item
-Add a transparent color layer on top of the main video, @code{WxH}
+Add a transparent color layer on top of the main video; @code{WxH}
must specify the size of the main input to the overlay filter:
@example
color=color=red@@.3:size=WxH [over]; [in][over] overlay [out]
@@ -5951,6 +6211,14 @@ nullsrc=size=200x100 [background];
@end example
@item
+Mask 10-20 seconds of a video by applying the delogo filter to a section
+@example
+ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
+-vf '[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main][delogoed]overlay=eof_action=pass[out]'
+masked.avi
+@end example
+
+@item
Chain several overlays in cascade:
@example
nullsrc=s=200x200 [bg];
@@ -5992,9 +6260,9 @@ Must be a double value in the range 0-1000, default is @code{1.0}.
@section pad
Add paddings to the input image, and place the original input at the
-given coordinates @var{x}, @var{y}.
+provided @var{x}, @var{y} coordinates.
-This filter accepts the following parameters:
+It accepts the following parameters:
@table @option
@item width, w
@@ -6010,9 +6278,8 @@ The default value of @var{width} and @var{height} is 0.
@item x
@item y
-Specify an expression for the offsets where to place the input image
-in the padded area with respect to the top/left border of the output
-image.
+Specify the offsets to place the input image at within the padded area,
+with respect to the top/left border of the output image.
The @var{x} expression can reference the value set by the @var{y}
expression, and vice versa.
@@ -6032,25 +6299,25 @@ options are expressions containing the following constants:
@table @option
@item in_w
@item in_h
-the input video width and height
+The input video width and height.
@item iw
@item ih
-same as @var{in_w} and @var{in_h}
+These are the same as @var{in_w} and @var{in_h}.
@item out_w
@item out_h
-the output width and height, that is the size of the padded area as
-specified by the @var{width} and @var{height} expressions
+The output width and height (the size of the padded area), as
+specified by the @var{width} and @var{height} expressions.
@item ow
@item oh
-same as @var{out_w} and @var{out_h}
+These are the same as @var{out_w} and @var{out_h}.
@item x
@item y
-x and y offsets as specified by the @var{x} and @var{y}
-expressions, or NAN if not yet specified
+The x and y offsets as specified by the @var{x} and @var{y}
+expressions, or NAN if not yet specified.
@item a
same as @var{iw} / @var{ih}
@@ -6063,7 +6330,7 @@ input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
@item hsub
@item vsub
-horizontal and vertical chroma subsample values. For example for the
+The horizontal and vertical chroma subsample values. For example for the
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
@end table
@@ -6071,9 +6338,9 @@ pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
@itemize
@item
-Add paddings with color "violet" to the input video. Output video
-size is 640x480, the top-left corner of the input video is placed at
-column 0, row 40:
+Add paddings with the color "violet" to the input video. The output video
+size is 640x480, and the top-left corner of the input video is placed at
+column 0, row 40
@example
pad=640:480:0:40:violet
@end example
@@ -6119,7 +6386,7 @@ pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
@end example
@item
-Double output size and put the input video in the bottom-right
+Double the output size and put the input video in the bottom-right
corner of the output padded area:
@example
pad="2*iw:2*ih:ow-iw:oh-ih"
@@ -6480,6 +6747,7 @@ On this example the input file being processed is compared with the
reference file @file{ref_movie.mpg}. The PSNR of each individual frame
is stored in @file{stats.log}.
+@anchor{pullup}
@section pullup
Pulldown reversal (inverse telecine) filter, capable of handling mixed
@@ -6629,11 +6897,11 @@ pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
@item in_w, iw
@item in_h, ih
-the input video width and heigth
+the input video width and height
@item out_w, ow
@item out_h, oh
-the output width and heigth, that is the size of the padded area as
+the output width and height, that is the size of the padded area as
specified by the @var{width} and @var{height} expressions
@item rotw(a)
@@ -6661,6 +6929,12 @@ rotate=-PI/6
@end example
@item
+Rotate the input by 45 degrees clockwise:
+@example
+rotate=45*PI/180
+@end example
+
+@item
Apply a constant rotation with period T, starting from an angle of PI/3:
@example
rotate=PI/3+2*PI*t/T
@@ -6674,7 +6948,7 @@ rotate=A*sin(2*PI/T*t)
@end example
@item
-Rotate the video, output size is choosen so that the whole rotating
+Rotate the video, output size is chosen so that the whole rotating
input video is always completely contained in the output:
@example
rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
@@ -6769,6 +7043,11 @@ maintains the aspect ratio of the input image, calculated from the
other specified dimension. If both of them are -1, the input size is
used
+If one of the values is -n with n > 1, the scale filter will also use a value
+that maintains the aspect ratio of the input image, calculated from the other
+specified dimension. After that it will, however, make sure that the calculated
+dimension is divisible by n and adjust the value if necessary.
+
See below for the list of accepted constants for use in the dimension
expression.
@@ -6792,7 +7071,7 @@ Default value is @samp{0}.
@item flags
Set libswscale scaling flags. See
@ref{sws_flags,,the ffmpeg-scaler manual,ffmpeg-scaler} for the
-complete list of values. If not explictly specified the filter applies
+complete list of values. If not explicitly specified the filter applies
the default flags.
@item size, s
@@ -6895,28 +7174,28 @@ containing the following constants:
@table @var
@item in_w
@item in_h
-the input width and height
+The input width and height
@item iw
@item ih
-same as @var{in_w} and @var{in_h}
+These are the same as @var{in_w} and @var{in_h}.
@item out_w
@item out_h
-the output (scaled) width and height
+The output (scaled) width and height
@item ow
@item oh
-same as @var{out_w} and @var{out_h}
+These are the same as @var{out_w} and @var{out_h}
@item a
-same as @var{iw} / @var{ih}
+The same as @var{iw} / @var{ih}
@item sar
input sample aspect ratio
@item dar
-input display aspect ratio. Calculated from @code{(iw / ih) * sar}.
+The input display aspect ratio. Calculated from @code{(iw / ih) * sar}.
@item hsub
@item vsub
@@ -6933,7 +7212,7 @@ pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
@itemize
@item
-Scale the input video to a size of 200x100:
+Scale the input video to a size of 200x100
@example
scale=w=200:h=100
@end example
@@ -6990,7 +7269,7 @@ scale=3/2*iw:ow
@end example
@item
-Seek for Greek harmony:
+Seek Greek harmony:
@example
scale=iw:1/PHI*iw
scale=ih*PHI:ih
@@ -7003,15 +7282,15 @@ scale=w=3/2*oh:h=3/5*ih
@end example
@item
-Increase the size, but make the size a multiple of the chroma
+Increase the size, making the size a multiple of the chroma
subsample values:
@example
scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
@end example
@item
-Increase the width to a maximum of 500 pixels, keep the same input
-aspect ratio:
+Increase the width to a maximum of 500 pixels,
+keeping the same aspect ratio as the input:
@example
scale=w='min(500\, iw*3/2):h=-1'
@end example
@@ -7039,7 +7318,7 @@ Ratio, according to the following equation:
@end example
Keep in mind that the @code{setdar} filter does not modify the pixel
-dimensions of the video frame. Also the display aspect ratio set by
+dimensions of the video frame. Also, the display aspect ratio set by
this filter may be changed by later filters in the filterchain,
e.g. in case of scaling or if another "setdar" or a "setsar" filter is
applied.
@@ -7055,7 +7334,7 @@ Keep in mind that the sample aspect ratio set by the @code{setsar}
filter may be changed by later filters in the filterchain, e.g. if
another "setsar" or a "setdar" filter is applied.
-The filters accept the following options:
+It accepts the following parameters:
@table @option
@item r, ratio, dar (@code{setdar} only), sar (@code{setsar} only)
@@ -7080,23 +7359,24 @@ the following constants:
@table @option
@item E, PI, PHI
-the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
+These are approximated values for the mathematical constants e
+(Euler's number), pi (Greek pi), and phi (the golden ratio).
@item w, h
-the input width and height
+The input width and height.
@item a
-same as @var{w} / @var{h}
+These are the same as @var{w} / @var{h}.
@item sar
-input sample aspect ratio
+The input sample aspect ratio.
@item dar
-input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}
+The input display aspect ratio. It is the same as
+(@var{w} / @var{h}) * @var{sar}.
@item hsub, vsub
-horizontal and vertical chroma subsample values. For example for the
+Horizontal and vertical chroma subsample values. For example, for the
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
@end table
@@ -7167,63 +7447,92 @@ The input video is not modified.
The shown line contains a sequence of key/value pairs of the form
@var{key}:@var{value}.
-A description of each shown parameter follows:
+It accepts the following parameters:
@table @option
@item n
-sequential number of the input frame, starting from 0
+The (sequential) number of the input frame, starting from 0.
@item pts
-Presentation TimeStamp of the input frame, expressed as a number of
+The Presentation TimeStamp of the input frame, expressed as a number of
time base units. The time base unit depends on the filter input pad.
@item pts_time
-Presentation TimeStamp of the input frame, expressed as a number of
-seconds
+The Presentation TimeStamp of the input frame, expressed as a number of
+seconds.
@item pos
-position of the frame in the input stream, -1 if this information in
-unavailable and/or meaningless (for example in case of synthetic video)
+The position of the frame in the input stream, or -1 if this information is
+unavailable and/or meaningless (for example in case of synthetic video).
@item fmt
-pixel format name
+The pixel format name.
@item sar
-sample aspect ratio of the input frame, expressed in the form
-@var{num}/@var{den}
+The sample aspect ratio of the input frame, expressed in the form
+@var{num}/@var{den}.
@item s
-size of the input frame. For the syntax of this option, check the "Video size"
+The size of the input frame. For the syntax of this option, check the "Video size"
section in the ffmpeg-utils manual.
@item i
-interlaced mode ("P" for "progressive", "T" for top field first, "B"
-for bottom field first)
+The type of interlaced mode ("P" for "progressive", "T" for top field first, "B"
+for bottom field first).
@item iskey
-1 if the frame is a key frame, 0 otherwise
+This is 1 if the frame is a key frame, 0 otherwise.
@item type
-picture type of the input frame ("I" for an I-frame, "P" for a
-P-frame, "B" for a B-frame, "?" for unknown type).
-Check also the documentation of the @code{AVPictureType} enum and of
+The picture type of the input frame ("I" for an I-frame, "P" for a
+P-frame, "B" for a B-frame, or "?" for an unknown type).
+Also refer to the documentation of the @code{AVPictureType} enum and of
the @code{av_get_picture_type_char} function defined in
@file{libavutil/avutil.h}.
@item checksum
-Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
+The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
@item plane_checksum
-Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
-expressed in the form "[@var{c0} @var{c1} @var{c2} @var{c3}]"
+The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
+expressed in the form "[@var{c0} @var{c1} @var{c2} @var{c3}]".
+@end table
+
+@section shuffleplanes
+
+Reorder and/or duplicate video planes.
+
+It accepts the following parameters:
+
+@table @option
+
+@item map0
+The index of the input plane to be used as the first output plane.
+
+@item map1
+The index of the input plane to be used as the second output plane.
+
+@item map2
+The index of the input plane to be used as the third output plane.
+
+@item map3
+The index of the input plane to be used as the fourth output plane.
+
@end table
+The first plane has the index 0. The default is to keep the input unchanged.
+
+Swap the second and third planes of the input:
+@example
+ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
+@end example
+
@anchor{smartblur}
@section smartblur
Blur the input video without impacting the outlines.
-The filter accepts the following options:
+It accepts the following options:
@table @option
@item luma_radius, lr
@@ -7470,6 +7779,9 @@ changed.
@item charenc
Set subtitles input character encoding. @code{subtitles} filter only. Only
useful if not UTF-8.
+
+@item stream_index, si
+Set subtitles stream index. @code{subtitles} filter only.
@end table
If the first key is not specified, it is assumed that the first value
@@ -7486,6 +7798,16 @@ which is equivalent to:
subtitles=filename=sub.srt
@end example
+To render the default subtitles stream from file @file{video.mkv}, use:
+@example
+subtitles=video.mkv
+@end example
+
+To render the second subtitles stream from that file, use:
+@example
+subtitles=video.mkv:si=1
+@end example
+
@section super2xsai
Scale the input by 2x and smooth using the Super2xSaI (Scale and
@@ -7606,7 +7928,7 @@ Produce 8x8 PNG tiles of all keyframes (@option{-skip_frame nokey}) in a movie:
ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
@end example
The @option{-vsync 0} is necessary to prevent @command{ffmpeg} from
-duplicating each output frame to accomodate the originally detected frame
+duplicating each output frame to accommodate the originally detected frame
rate.
@item
@@ -7696,7 +8018,7 @@ Vertical low-pass filtering can only be enabled for @option{mode}
Transpose rows with columns in the input video and optionally flip it.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@@ -7774,33 +8096,33 @@ transpose=1:portrait
@section trim
Trim the input so that the output contains one continuous subpart of the input.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item start
-Specify time of the start of the kept section, i.e. the frame with the
+Specify the time of the start of the kept section, i.e. the frame with the
timestamp @var{start} will be the first frame in the output.
@item end
-Specify time of the first frame that will be dropped, i.e. the frame
+Specify the time of the first frame that will be dropped, i.e. the frame
immediately preceding the one with the timestamp @var{end} will be the last
frame in the output.
@item start_pts
-Same as @var{start}, except this option sets the start timestamp in timebase
-units instead of seconds.
+This is the same as @var{start}, except this option sets the start timestamp
+in timebase units instead of seconds.
@item end_pts
-Same as @var{end}, except this option sets the end timestamp in timebase units
-instead of seconds.
+This is the same as @var{end}, except this option sets the end timestamp
+in timebase units instead of seconds.
@item duration
-Specify maximum duration of the output.
+The maximum duration of the output in seconds.
@item start_frame
-Number of the first frame that should be passed to output.
+The number of the first frame that should be passed to the output.
@item end_frame
-Number of the first frame that should be dropped.
+The number of the first frame that should be dropped.
@end table
@option{start}, @option{end}, @option{duration} are expressed as time
@@ -7810,7 +8132,7 @@ ffmpeg-utils manual.
Note that the first two sets of the start/end options and the @option{duration}
option look at the frame timestamp, while the _frame variants simply count the
frames that pass through the filter. Also note that this filter does not modify
-the timestamps. If you wish that the output timestamps start at zero, insert a
+the timestamps. If you wish for the output timestamps to start at zero, insert a
setpts filter after the trim filter.
If multiple start or end options are set, this filter tries to be greedy and
@@ -7824,13 +8146,13 @@ just the end values to keep everything before the specified time.
Examples:
@itemize
@item
-drop everything except the second minute of input
+Drop everything except the second minute of input:
@example
ffmpeg -i INPUT -vf trim=60:120
@end example
@item
-keep only the first second
+Keep only the first second:
@example
ffmpeg -i INPUT -vf trim=duration=1
@end example
@@ -7847,14 +8169,14 @@ It accepts the following parameters:
@table @option
@item luma_msize_x, lx
Set the luma matrix horizontal size. It must be an odd integer between
-3 and 63, default value is 5.
+3 and 63. The default value is 5.
@item luma_msize_y, ly
Set the luma matrix vertical size. It must be an odd integer between 3
-and 63, default value is 5.
+and 63. The default value is 5.
@item luma_amount, la
-Set the luma effect strength. It can be a float number, reasonable
+Set the luma effect strength. It must be a floating point number, reasonable
values lay between -1.5 and 1.5.
Negative values will blur the input video, while positive values will
@@ -7864,14 +8186,14 @@ Default value is 1.0.
@item chroma_msize_x, cx
Set the chroma matrix horizontal size. It must be an odd integer
-between 3 and 63, default value is 5.
+between 3 and 63. The default value is 5.
@item chroma_msize_y, cy
Set the chroma matrix vertical size. It must be an odd integer
-between 3 and 63, default value is 5.
+between 3 and 63. The default value is 5.
@item chroma_amount, ca
-Set the chroma effect strength. It can be a float number, reasonable
+Set the chroma effect strength. It must be a floating point number, reasonable
values lay between -1.5 and 1.5.
Negative values will blur the input video, while positive values will
@@ -7898,7 +8220,7 @@ unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
@end example
@item
-Apply strong blur of both luma and chroma parameters:
+Apply a strong blur of both luma and chroma parameters:
@example
unsharp=7:7:-2:7:7:-2
@end example
@@ -7932,7 +8254,7 @@ value of 10 means strong shakiness. Default value is 5.
@item accuracy
Set the accuracy of the detection process. It must be a value in the
range 1-15. A value of 1 means low accuracy, a value of 15 means high
-accuracy. Default value is 9.
+accuracy. Default value is 15.
@item stepsize
Set stepsize of the search process. The region around minimum is
@@ -8004,31 +8326,47 @@ the unsharp filter, see below.
To enable compilation of this filter you need to configure FFmpeg with
@code{--enable-libvidstab}.
-This filter accepts the following options:
+@subsection Options
@table @option
-
@item input
-path to the file used to read the transforms (default: @file{transforms.trf})
+Set path to the file used to read the transforms. Default value is
+@file{transforms.trf}).
@item smoothing
-number of frames (value*2 + 1) used for lowpass filtering the camera movements
-(default: 10). For example a number of 10 means that 21 frames are used
-(10 in the past and 10 in the future) to smoothen the motion in the
-video. A larger values leads to a smoother video, but limits the
-acceleration of the camera (pan/tilt movements).
+Set the number of frames (value*2 + 1) used for lowpass filtering the
+camera movements. Default value is 10.
+
+For example a number of 10 means that 21 frames are used (10 in the
+past and 10 in the future) to smoothen the motion in the video. A
+larger values leads to a smoother video, but limits the acceleration
+of the camera (pan/tilt movements). 0 is a special case where a
+static camera is simulated.
+
+@item optalgo
+Set the camera path optimization algorithm.
+
+Accepted values are:
+@table @samp
+@item gauss
+gaussian kernel low-pass filter on camera motion (default)
+@item avg
+averaging on transformations
+@end table
@item maxshift
-maximal number of pixels to translate frames (default: -1 no limit)
+Set maximal number of pixels to translate frames. Default value is -1,
+meaning no limit.
@item maxangle
-maximal angle in radians (degree*PI/180) to rotate frames (default: -1
-no limit)
+Set maximal angle in radians (degree*PI/180) to rotate frames. Default
+value is -1, meaning no limit.
@item crop
-How to deal with borders that may be visible due to movement
-compensation. Available values are:
+Specify how to deal with borders that may be visible due to movement
+compensation.
+Available values are:
@table @samp
@item keep
keep image information from previous frame (default)
@@ -8037,46 +8375,41 @@ fill the border black
@end table
@item invert
-@table @samp
-@item 0
-keep transforms normal (default)
-@item 1
-invert transforms
-@end table
+Invert transforms if set to 1. Default value is 0.
@item relative
-consider transforms as
-@table @samp
-@item 0
-absolute
-@item 1
-relative to previous frame (default)
-@end table
+Consider transforms as relative to previsou frame if set to 1,
+absolute if set to 0. Default value is 0.
@item zoom
-percentage to zoom (default: 0)
-@table @samp
-@item >0
-zoom in
-@item <0
-zoom out
-@end table
+Set percentage to zoom. A positive value will result in a zoom-in
+effect, a negative value in a zoom-out effect. Default value is 0 (no
+zoom).
@item optzoom
-set optimal zooming to avoid borders
+Set optimal zooming to avoid borders.
+
+Accepted values are:
@table @samp
@item 0
disabled
@item 1
-optimal static zoom value is determined (only very strong movements will lead to visible borders) (default)
+optimal static zoom value is determined (only very strong movements
+will lead to visible borders) (default)
@item 2
-optimal adaptive zoom value is determined (no borders will be visible)
+optimal adaptive zoom value is determined (no borders will be
+visible), see @option{zoomspeed}
@end table
-Note that the value given at zoom is added to the one calculated
-here.
+
+Note that the value given at zoom is added to the one calculated here.
+
+@item zoomspeed
+Set percent to zoom maximally each frame (enabled when
+@option{optzoom} is set to 2). Range is from 0 to 5, default value is
+0.25.
@item interpol
-type of interpolation
+Specify type of interpolation.
Available values are:
@table @samp
@@ -8091,40 +8424,39 @@ cubic in both directions (slow)
@end table
@item tripod
-virtual tripod mode means that the video is stabilized such that the
-camera stays stationary. Use also @code{tripod} option of
-@ref{vidstabdetect}.
-@table @samp
-@item 0
-off (default)
-@item 1
-virtual tripod mode: equivalent to @code{relative=0:smoothing=0}
-@end table
+Enable virtual tripod mode if set to 1, which is equivalent to
+@code{relative=0:smoothing=0}. Default value is 0.
+
+Use also @code{tripod} option of @ref{vidstabdetect}.
+@item debug
+Increase log verbosity if set to 1. Also the detected global motions
+are written to the temporary file @file{global_motions.trf}. Default
+value is 0.
@end table
@subsection Examples
@itemize
@item
-typical call with default default values:
- (note the unsharp filter which is always recommended)
+Use @command{ffmpeg} for a typical stabilization with default values:
@example
ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
@end example
+Note the use of the unsharp filter which is always recommended.
+
@item
-zoom in a bit more and load transform data from a given file
+Zoom in a bit more and load transform data from a given file:
@example
vidstabtransform=zoom=5:input="mytransforms.trf"
@end example
@item
-smoothen the video even more
+Smoothen the video even more:
@example
vidstabtransform=smoothing=30
@end example
-
@end itemize
@section vflip
@@ -8193,7 +8525,7 @@ Set dithering to reduce the circular banding effects. Default is @code{1}
(enabled).
@item aspect
-Set vignette aspect. This setting allows to adjust the shape of the vignette.
+Set vignette aspect. This setting allows one to adjust the shape of the vignette.
Setting this value to the SAR of the input will make a rectangular vignetting
following the dimensions of the video.
@@ -8291,42 +8623,42 @@ Default value is @samp{all}.
Deinterlace the input video ("yadif" means "yet another deinterlacing
filter").
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item mode
-The interlacing mode to adopt, accepts one of the following values:
+The interlacing mode to adopt. It accepts one of the following values:
@table @option
@item 0, send_frame
-output 1 frame for each frame
+Output one frame for each frame.
@item 1, send_field
-output 1 frame for each field
+Output one frame for each field.
@item 2, send_frame_nospatial
-like @code{send_frame} but skip spatial interlacing check
+Like @code{send_frame}, but it skips the spatial interlacing check.
@item 3, send_field_nospatial
-like @code{send_field} but skip spatial interlacing check
+Like @code{send_field}, but it skips the spatial interlacing check.
@end table
-Default value is @code{send_frame}.
+The default value is @code{send_frame}.
@item parity
-The picture field parity assumed for the input interlaced video, accepts one of
-the following values:
+The picture field parity assumed for the input interlaced video. It accepts one
+of the following values:
@table @option
@item 0, tff
-assume top field first
+Assume the top field is first.
@item 1, bff
-assume bottom field first
+Assume the bottom field is first.
@item -1, auto
-enable automatic detection
+Enable automatic detection of field parity.
@end table
-Default value is @code{auto}.
-If interlacing is unknown or decoder does not export this information,
+The default value is @code{auto}.
+If the interlacing is unknown or the decoder does not export this information,
top field first will be assumed.
@item deint
@@ -8335,12 +8667,12 @@ values:
@table @option
@item 0, all
-deinterlace all frames
+Deinterlace all frames.
@item 1, interlaced
-only deinterlace frames marked as interlaced
+Only deinterlace frames marked as interlaced.
@end table
-Default value is @code{all}.
+The default value is @code{all}.
@end table
@c man end VIDEO FILTERS
@@ -8357,7 +8689,7 @@ Buffer video frames, and make them available to the filter chain.
This source is mainly intended for a programmatic use, in particular
through the interface defined in @file{libavfilter/vsrc_buffer.h}.
-This source accepts the following options:
+It accepts the following parameters:
@table @option
@@ -8367,10 +8699,10 @@ syntax of this option, check the "Video size" section in the ffmpeg-utils
manual.
@item width
-Input video width.
+The input video width.
@item height
-Input video height.
+The input video height.
@item pix_fmt
A string representing the pixel format of the buffered video frames.
@@ -8384,7 +8716,7 @@ Specify the timebase assumed by the timestamps of the buffered frames.
Specify the frame rate expected for the video stream.
@item pixel_aspect, sar
-Specify the sample aspect ratio assumed by the video frames.
+The sample (pixel) aspect ratio of the input video.
@item sws_param
Specify the optional parameters to be used for the scale filter which
@@ -8612,7 +8944,7 @@ This source accepts the following options:
@item rate, r
Specify the frame rate of the sourced video, as the number of frames
generated per second. It has to be a string in the format
-@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
+@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a floating point
number or a valid video frame rate abbreviation. The default value is
"25".
@@ -8642,12 +8974,13 @@ Set the number or the name of the test to perform. Supported tests are:
@item ring1
@item ring2
@item all
+
@end table
Default value is "all", which will cycle through the list of all tests.
@end table
-For example the following:
+Some examples:
@example
testsrc=t=dc_luma
@end example
@@ -8661,7 +8994,7 @@ Provide a frei0r source.
To enable compilation of this filter you need to install the frei0r
header and configure FFmpeg with @code{--enable-frei0r}.
-This source accepts the following options:
+This source accepts the following parameters:
@table @option
@@ -8670,13 +9003,13 @@ The size of the video to generate. For the syntax of this option, check the
"Video size" section in the ffmpeg-utils manual.
@item framerate
-Framerate of the generated video, may be a string of the form
+The framerate of the generated video. It may be a string of the form
@var{num}/@var{den} or a frame rate abbreviation.
@item filter_name
The name to the frei0r source to load. For more information regarding frei0r and
-how to set the parameters read the section @ref{frei0r} in the description of
-the video filters.
+how to set the parameters, read the @ref{frei0r} section in the video filters
+documentation.
@item filter_params
A '|'-separated list of parameters to pass to the frei0r source.
@@ -8702,7 +9035,7 @@ horizontally, vertically, or diagonally adjacent.
At each interaction the grid evolves according to the adopted rule,
which specifies the number of neighbor alive cells which will make a
-cell stay alive or born. The @option{rule} option allows to specify
+cell stay alive or born. The @option{rule} option allows one to specify
the rule to adopt.
This source accepts the following options:
@@ -8850,7 +9183,7 @@ The @code{testsrc} source generates a test video pattern, showing a
color pattern, a scrolling gradient and a timestamp. This is mainly
intended for testing purposes.
-The sources accept the following options:
+The sources accept the following parameters:
@table @option
@@ -8875,7 +9208,7 @@ This option is not available with the @code{haldclutsrc} filter.
@item rate, r
Specify the frame rate of the sourced video, as the number of frames
generated per second. It has to be a string in the format
-@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
+@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a floating point
number or a valid video frame rate abbreviation. The default value is
"25".
@@ -8888,7 +9221,7 @@ Set the video duration of the sourced video. The accepted syntax is:
[-]HH[:MM[:SS[.m...]]]
[-]S+[.m...]
@end example
-See also the function @code{av_parse_time()}.
+Also see the the @code{av_parse_time()} function.
If not specified, or the expressed duration is negative, the video is
supposed to be generated forever.
@@ -8946,7 +9279,7 @@ Below is a description of the currently available video sinks.
Buffer video frames, and make them available to the end of the filter
graph.
-This sink is mainly intended for a programmatic use, in particular
+This sink is mainly intended for programmatic use, in particular
through the interface defined in @file{libavfilter/buffersink.h}
or the options system.
@@ -8956,8 +9289,8 @@ parameter to @code{avfilter_init_filter} for initialization.
@section nullsink
-Null video sink, do absolutely nothing with the input video. It is
-mainly useful as a template and to be employed in analysis / debugging
+Null video sink: do absolutely nothing with the input video. It is
+mainly useful as a template and for use in analysis / debugging
tools.
@c man end VIDEO SINKS
@@ -9166,6 +9499,29 @@ verbose logging level
By default, the logging level is set to @var{info}. If the @option{video} or
the @option{metadata} options are set, it switches to @var{verbose}.
+
+@item peak
+Set peak mode(s).
+
+Available modes can be cumulated (the option is a @code{flag} type). Possible
+values are:
+@table @samp
+@item none
+Disable any peak mode (default).
+@item sample
+Enable sample-peak mode.
+
+Simple peak mode looking for the higher sample value. It logs a message
+for sample-peak (identified by @code{SPK}).
+@item true
+Enable true-peak mode.
+
+If enabled, the peak lookup is done on an over-sampled version of the input
+stream for better peak accuracy. It logs a message for true-peak.
+(identified by @code{TPK}) and true-peak per frame (identified by @code{FTPK}).
+This mode requires a build with @code{libswresample}.
+@end table
+
@end table
@subsection Examples
@@ -9300,42 +9656,42 @@ The expression can contain the following constants:
@table @option
@item n
-the sequential number of the filtered frame, starting from 0
+The (sequential) number of the filtered frame, starting from 0.
@item selected_n
-the sequential number of the selected frame, starting from 0
+The (sequential) number of the selected frame, starting from 0.
@item prev_selected_n
-the sequential number of the last selected frame, NAN if undefined
+The sequential number of the last selected frame. It's NAN if undefined.
@item TB
-timebase of the input timestamps
+The timebase of the input timestamps.
@item pts
-the PTS (Presentation TimeStamp) of the filtered video frame,
-expressed in @var{TB} units, NAN if undefined
+The PTS (Presentation TimeStamp) of the filtered video frame,
+expressed in @var{TB} units. It's NAN if undefined.
@item t
-the PTS (Presentation TimeStamp) of the filtered video frame,
-expressed in seconds, NAN if undefined
+The PTS of the filtered video frame,
+expressed in seconds. It's NAN if undefined.
@item prev_pts
-the PTS of the previously filtered video frame, NAN if undefined
+The PTS of the previously filtered video frame. It's NAN if undefined.
@item prev_selected_pts
-the PTS of the last previously filtered video frame, NAN if undefined
+The PTS of the last previously filtered video frame. It's NAN if undefined.
@item prev_selected_t
-the PTS of the last previously selected video frame, NAN if undefined
+The PTS of the last previously selected video frame. It's NAN if undefined.
@item start_pts
-the PTS of the first video frame in the video, NAN if undefined
+The PTS of the first video frame in the video. It's NAN if undefined.
@item start_t
-the time of the first video frame in the video, NAN if undefined
+The time of the first video frame in the video. It's NAN if undefined.
@item pict_type @emph{(video only)}
-the type of the filtered frame, can assume one of the following
+The type of the filtered frame. It can assume one of the following
values:
@table @option
@item I
@@ -9348,14 +9704,14 @@ values:
@end table
@item interlace_type @emph{(video only)}
-the frame interlace type, can assume one of the following values:
+The frame interlace type. It can assume one of the following values:
@table @option
@item PROGRESSIVE
-the frame is progressive (not interlaced)
+The frame is progressive (not interlaced).
@item TOPFIRST
-the frame is top-field-first
+The frame is top-field-first.
@item BOTTOMFIRST
-the frame is bottom-field-first
+The frame is bottom-field-first.
@end table
@item consumed_sample_n @emph{(audio only)}
@@ -9368,7 +9724,7 @@ the number of samples in the current frame
the input sample rate
@item key
-1 if the filtered frame is a key-frame, 0 otherwise
+This is 1 if the filtered frame is a key-frame, 0 otherwise.
@item pos
the position in the file of the filtered frame, -1 if the information
@@ -9610,30 +9966,30 @@ constants:
frame rate, only defined for constant frame-rate video
@item PTS
-the presentation timestamp in input
+The presentation timestamp in input
@item N
-the count of the input frame for video or the number of consumed samples,
+The count of the input frame for video or the number of consumed samples,
not including the current frame for audio, starting from 0.
@item NB_CONSUMED_SAMPLES
-the number of consumed samples, not including the current frame (only
+The number of consumed samples, not including the current frame (only
audio)
@item NB_SAMPLES, S
-the number of samples in the current frame (only audio)
+The number of samples in the current frame (only audio)
@item SAMPLE_RATE, SR
-audio sample rate
+The audio sample rate.
@item STARTPTS
-the PTS of the first frame
+The PTS of the first frame.
@item STARTT
the time in seconds of the first frame
@item INTERLACED
-tell if the current frame is interlaced
+State whether the current frame is interlaced.
@item T
the time in seconds of the current frame
@@ -9643,26 +9999,26 @@ original position in the file of the frame, or undefined if undefined
for the current frame
@item PREV_INPTS
-previous input PTS
+The previous input PTS.
@item PREV_INT
previous input time in seconds
@item PREV_OUTPTS
-previous output PTS
+The previous output PTS.
@item PREV_OUTT
previous output time in seconds
@item RTCTIME
-wallclock (RTC) time in microseconds. This is deprecated, use time(0)
+The wallclock (RTC) time in microseconds.. This is deprecated, use time(0)
instead.
@item RTCSTART
-wallclock (RTC) time at the start of the movie in microseconds
+The wallclock (RTC) time at the start of the movie in microseconds.
@item TB
-timebase of the input timestamps
+The timebase of the input timestamps.
@end table
@@ -9724,7 +10080,7 @@ asetpts=N/SR/TB
Set the timebase to use for the output frames timestamps.
It is mainly useful for testing timebase configuration.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@@ -10058,23 +10414,23 @@ stream by default.
Read audio and/or video stream(s) from a movie container.
-This filter accepts the following options:
+It accepts the following parameters:
@table @option
@item filename
-The name of the resource to read (not necessarily a file but also a device or a
-stream accessed through some protocol).
+The name of the resource to read (not necessarily a file; it can also be a
+device or a stream accessed through some protocol).
@item format_name, f
Specifies the format assumed for the movie to read, and can be either
-the name of a container or an input device. If not specified the
+the name of a container or an input device. If not specified, the
format is guessed from @var{movie_name} or by probing.
@item seek_point, sp
-Specifies the seek point in seconds, the frames will be output
-starting from this seek point, the parameter is evaluated with
-@code{av_strtod} so the numerical value may be suffixed by an IS
-postfix. Default value is "0".
+Specifies the seek point in seconds. The frames will be output
+starting from this seek point. The parameter is evaluated with
+@code{av_strtod}, so the numerical value may be suffixed by an IS
+postfix. The default value is "0".
@item streams, s
Specifies the streams to read. Several streams can be specified,
@@ -10086,7 +10442,7 @@ is "dv", or "da" if the filter is called as "amovie".
@item stream_index, si
Specifies the index of the video stream to read. If the value is -1,
-the best suited video stream will be automatically selected. Default
+the most suitable video stream will be automatically selected. The default
value is "-1". Deprecated. If the filter is called "amovie", it will select
audio instead of video.
@@ -10099,21 +10455,20 @@ Note that when the movie is looped the source timestamps are not
changed, so it will generate non monotonically increasing timestamps.
@end table
-This filter allows to overlay a second video on top of main input of
-a filtergraph as shown in this graph:
+It allows overlaying a second video on top of the main input of
+a filtergraph, as shown in this graph:
@example
input -----------> deltapts0 --> overlay --> output
^
|
movie --> scale--> deltapts1 -------+
@end example
-
@subsection Examples
@itemize
@item
-Skip 3.2 seconds from the start of the avi file in.avi, and overlay it
-on top of the input labelled as "in":
+Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
+on top of the input labelled "in":
@example
movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
[in] setpts=PTS-STARTPTS [main];
@@ -10122,7 +10477,7 @@ movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
@item
Read from a video4linux2 device, and overlay it on top of the input
-labelled as "in":
+labelled "in":
@example
movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
[in] setpts=PTS-STARTPTS [main];
diff --git a/chromium/third_party/ffmpeg/doc/formats.texi b/chromium/third_party/ffmpeg/doc/formats.texi
index b535a5f0159..027510eb6da 100644
--- a/chromium/third_party/ffmpeg/doc/formats.texi
+++ b/chromium/third_party/ffmpeg/doc/formats.texi
@@ -125,18 +125,26 @@ Consider things that a sane encoder should not do as an error.
Use wallclock as timestamps.
@item avoid_negative_ts @var{integer} (@emph{output})
-Shift timestamps to make them non-negative. A value of 1 enables shifting,
-a value of 0 disables it, the default value of -1 enables shifting
-when required by the target format.
+
+Possible values:
+@table @samp
+@item make_non_negative
+Shift timestamps to make them non-negative.
+Also note that this affects only leading negative timestamps, and not
+non-monotonic negative timestamps.
+@item make_zero
+Shift timestamps so that the first timestamp is 0.
+@item auto (default)
+Enables shifting when required by the target format.
+@item disabled
+Disables shifting of timestamp.
+@end table
When shifting is enabled, all output timestamps are shifted by the
same amount. Audio, video, and subtitles desynching and relative
timestamp differences are preserved compared to how they would have
been without shifting.
-Also note that this affects only leading negative timestamps, and not
-non-monotonic negative timestamps.
-
@item skip_initial_bytes @var{integer} (@emph{input})
Set number of bytes to skip before reading header and frames if set to 1.
Default is 0.
@@ -148,6 +156,18 @@ Correct single timestamp overflows if set to 1. Default is 1.
Flush the underlying I/O stream after each packet. Default 1 enables it, and
has the effect of reducing the latency; 0 disables it and may slightly
increase performance in some cases.
+
+@item output_ts_offset @var{offset} (@emph{output})
+Set the output time offset.
+
+@var{offset} must be a time duration specification,
+see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
+
+The offset is added by the muxer to the output timestamps.
+
+Specifying a positive offset means that the corresponding streams are
+delayed bt the time duration specified in @var{offset}. Default value
+is @code{0} (meaning that no offset is applied).
@end table
@c man end FORMAT OPTIONS
@@ -183,6 +203,10 @@ The exact semantics of stream specifiers is defined by the
@code{avformat_match_stream_specifier()} function declared in the
@file{libavformat/avformat.h} header.
+@ifclear config-writeonly
@include demuxers.texi
+@end ifclear
+@ifclear config-readonly
@include muxers.texi
+@end ifclear
@include metadata.texi
diff --git a/chromium/third_party/ffmpeg/doc/general.texi b/chromium/third_party/ffmpeg/doc/general.texi
index a3221d54fb0..8a73cbf5be7 100644
--- a/chromium/third_party/ffmpeg/doc/general.texi
+++ b/chromium/third_party/ffmpeg/doc/general.texi
@@ -122,6 +122,20 @@ x264 is under the GNU Public License Version 2 or later
details), you must upgrade FFmpeg's license to GPL in order to use it.
@end float
+@section x265
+
+FFmpeg can make use of the x265 library for HEVC encoding.
+
+Go to @url{http://x265.org/developers.html} and follow the instructions
+for installing the library. Then pass @code{--enable-libx265} to configure
+to enable it.
+
+@float note
+x265 is under the GNU Public License Version 2 or later
+(see @url{http://www.gnu.org/licenses/old-licenses/gpl-2.0.html} for
+details), you must upgrade FFmpeg's license to GPL in order to use it.
+@end float
+
@section libilbc
iLBC is a narrowband speech codec that has been made freely available
@@ -148,6 +162,27 @@ libzvbi is licensed under the GNU General Public License Version 2 or later
you must upgrade FFmpeg's license to GPL in order to use it.
@end float
+@section AviSynth
+
+FFmpeg can read AviSynth scripts as input. To enable support, pass
+@code{--enable-avisynth} to configure. The correct headers are
+included in compat/avisynth/, which allows the user to enable support
+without needing to search for these headers themselves.
+
+For Windows, supported AviSynth variants are
+@url{http://avisynth.nl, AviSynth 2.5 or 2.6} for 32-bit builds and
+@url{http://avs-plus.net, AviSynth+ 0.1} for 32-bit and 64-bit builds.
+
+For Linux and OS X, the supported AviSynth variant is
+@url{https://github.com/avxsynth/avxsynth, AvxSynth}.
+
+@float NOTE
+AviSynth and AvxSynth are loaded dynamically. Distributors can build FFmpeg
+with @code{--enable-avisynth}, and the binaries will work regardless of the
+end user having AviSynth or AvxSynth installed - they'll only need to be
+installed to use AviSynth scripts (obviously).
+@end float
+
@chapter Supported File Formats, Codecs or Features
@@ -170,7 +205,7 @@ library:
@item American Laser Games MM @tab @tab X
@tab Multimedia format used in games like Mad Dog McCree.
@item 3GPP AMR @tab X @tab X
-@item Amazing Studio Packed Animation File @tab @tab X
+@item Amazing Studio Packed Animation File @tab @tab X
@tab Multimedia format used in game Heart Of Darkness.
@item Apple HTTP Live Streaming @tab @tab X
@item Artworx Data Format @tab @tab X
@@ -210,6 +245,7 @@ library:
@tab Multimedia format used by Delphine Software games.
@item CD+G @tab @tab X
@tab Video format used by CD+G karaoke disks
+@item Phantom Cine @tab @tab X
@item Commodore CDXL @tab @tab X
@tab Amiga CD video format
@item Core Audio Format @tab X @tab X
@@ -223,6 +259,7 @@ library:
@item Deluxe Paint Animation @tab @tab X
@item DFA @tab @tab X
@tab This format is used in Chronomaster game
+@item DSD Stream File (DSF) @tab @tab X
@item DV video @tab X @tab X
@item DXA @tab @tab X
@tab This format is used in the non-Windows version of the Feeble Files
@@ -276,6 +313,7 @@ library:
@item LVF @tab @tab X
@item LXF @tab @tab X
@tab VR native stream format, used by Leitch/Harris' video servers.
+@item Magic Lantern Video (MLV) @tab @tab X
@item Matroska @tab X @tab X
@item Matroska audio @tab X @tab
@item FFmpeg metadata @tab X @tab X
@@ -301,6 +339,8 @@ library:
@tab also known as DVB Transport Stream
@item MPEG-4 @tab X @tab X
@tab MPEG-4 is a variant of QuickTime.
+@item Mirillis FIC video @tab @tab X
+ @tab No cursor rendering.
@item MIME multipart JPEG @tab X @tab
@item MSN TCP webcam @tab @tab X
@tab Used by MSN Messenger webcam streams.
@@ -340,7 +380,7 @@ library:
@item raw H.261 @tab X @tab X
@item raw H.263 @tab X @tab X
@item raw H.264 @tab X @tab X
-@item raw HEVC @tab @tab X
+@item raw HEVC @tab X @tab X
@item raw Ingenient MJPEG @tab @tab X
@item raw MJPEG @tab X @tab X
@item raw MLP @tab @tab X
@@ -451,11 +491,13 @@ following image formats are supported:
@item Name @tab Encoding @tab Decoding @tab Comments
@item .Y.U.V @tab X @tab X
@tab one raw file per component
+@item Alias PIX @tab X @tab X
+ @tab Alias/Wavefront PIX image format
@item animated GIF @tab X @tab X
@item BMP @tab X @tab X
@tab Microsoft BMP image
-@item PIX @tab @tab X
- @tab PIX is an image format used in the Argonaut BRender engine.
+@item BRender PIX @tab @tab X
+ @tab Argonaut BRender 3D engine image format.
@item DPX @tab X @tab X
@tab Digital Picture Exchange
@item EXR @tab @tab X
@@ -491,8 +533,8 @@ following image formats are supported:
@tab YUV, JPEG and some extension is not supported yet.
@item Truevision Targa @tab X @tab X
@tab Targa (.TGA) image format
-@item WebP @tab @tab X
- @tab WebP image format
+@item WebP @tab E @tab X
+ @tab WebP image format, encoding supported through external library libwebp
@item XBM @tab X @tab X
@tab X BitMap image format
@item XFace @tab X @tab X
@@ -610,7 +652,8 @@ following image formats are supported:
@item H.263+ / H.263-1998 / H.263 version 2 @tab X @tab X
@item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 @tab E @tab X
@tab encoding supported through external library libx264
-@item HEVC @tab @tab X
+@item HEVC @tab X @tab X
+ @tab encoding supported through the external library libx265
@item HNM version 4 @tab @tab X
@item HuffYUV @tab X @tab X
@item HuffYUV FFmpeg variant @tab X @tab X
@@ -642,8 +685,8 @@ following image formats are supported:
@item LCL (LossLess Codec Library) MSZH @tab @tab X
@item LCL (LossLess Codec Library) ZLIB @tab E @tab E
@item LOCO @tab @tab X
-@item LucasArts Smush @tab @tab X
- @tab Used in LucasArts games.
+@item LucasArts SANM/Smush @tab @tab X
+ @tab Used in LucasArts games / SMUSH animations.
@item lossless MJPEG @tab X @tab X
@item Microsoft ATC Screen @tab @tab X
@tab Also known as Microsoft Screen 3.
@@ -678,6 +721,8 @@ following image formats are supported:
@tab fourcc: VP50
@item On2 VP6 @tab @tab X
@tab fourcc: VP60,VP61,VP62
+@item On2 VP7 @tab @tab X
+ @tab fourcc: VP70,VP71
@item VP8 @tab E @tab X
@tab fourcc: VP80, encoding supported through external library libvpx
@item VP9 @tab E @tab X
@@ -707,11 +752,11 @@ following image formats are supported:
@tab Texture dictionaries used by the Renderware Engine.
@item RL2 video @tab @tab X
@tab used in some games by Entertainment Software Partners
-@item SGI RLE 8-bit @tab @tab X
@item Sierra VMD video @tab @tab X
@tab Used in Sierra VMD files.
@item Silicon Graphics Motion Video Compressor 1 (MVC1) @tab @tab X
@item Silicon Graphics Motion Video Compressor 2 (MVC2) @tab @tab X
+@item Silicon Graphics RLE 8-bit video @tab @tab X
@item Smacker video @tab @tab X
@tab Video encoding used in Smacker.
@item SMPTE VC-1 @tab @tab X
@@ -777,7 +822,7 @@ following image formats are supported:
@tab encoding supported through external library libaacplus
@item AAC @tab E @tab X
@tab encoding supported through external library libfaac and libvo-aacenc
-@item AC-3 @tab IX @tab X
+@item AC-3 @tab IX @tab IX
@item ADPCM 4X Movie @tab @tab X
@item ADPCM CDROM XA @tab @tab X
@item ADPCM Creative Technology @tab @tab X
@@ -821,6 +866,8 @@ following image formats are supported:
@item ADPCM Sound Blaster Pro 2-bit @tab @tab X
@item ADPCM Sound Blaster Pro 2.6-bit @tab @tab X
@item ADPCM Sound Blaster Pro 4-bit @tab @tab X
+@item ADPCM VIMA
+ @tab Used in LucasArts SMUSH animations.
@item ADPCM Westwood Studios IMA @tab @tab X
@tab Used in Westwood Studios games like Command and Conquer.
@item ADPCM Yamaha @tab X @tab X
@@ -833,6 +880,7 @@ following image formats are supported:
@tab QuickTime fourcc 'alac'
@item ATRAC1 @tab @tab X
@item ATRAC3 @tab @tab X
+@item ATRAC3+ @tab @tab X
@item Bink Audio @tab @tab X
@tab Used in Bink and Smacker files in many games.
@item CELT @tab @tab E
@@ -852,6 +900,10 @@ following image formats are supported:
@item DPCM Sol @tab @tab X
@item DPCM Xan @tab @tab X
@tab Used in Origin's Wing Commander IV AVI files.
+@item DSD (Direct Stream Digitial), least significant bit first @tab @tab X
+@item DSD (Direct Stream Digitial), most significant bit first @tab @tab X
+@item DSD (Direct Stream Digitial), least significant bit first, planar @tab @tab X
+@item DSD (Direct Stream Digitial), most significant bit first, planar @tab @tab X
@item DSP Group TrueSpeech @tab @tab X
@item DV audio @tab @tab X
@item Enhanced AC-3 @tab X @tab X
@@ -874,13 +926,14 @@ following image formats are supported:
@item Monkey's Audio @tab @tab X
@item MP1 (MPEG audio layer 1) @tab @tab IX
@item MP2 (MPEG audio layer 2) @tab IX @tab IX
- @tab libtwolame can be used alternatively for encoding.
+ @tab encoding supported also through external library TwoLAME
@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
+@item On2 AVC (Audio for Video Codec) @tab @tab X
@item Opus @tab E @tab E
@tab supported through external library libopus
@item PCM A-law @tab X @tab X
@@ -996,6 +1049,7 @@ performance on systems without hardware floating point support).
@multitable @columnfractions .4 .1
@item Name @tab Support
@item file @tab X
+@item FTP @tab X
@item Gopher @tab X
@item HLS @tab X
@item HTTP @tab X
@@ -1011,6 +1065,7 @@ performance on systems without hardware floating point support).
@item RTMPTS @tab X
@item RTP @tab X
@item SCTP @tab X
+@item SFTP @tab E
@item TCP @tab X
@item TLS @tab X
@item UDP @tab X
@@ -1030,17 +1085,19 @@ performance on systems without hardware floating point support).
@item caca @tab @tab X
@item DV1394 @tab X @tab
@item Lavfi virtual device @tab X @tab
-@item Linux framebuffer @tab X @tab
+@item Linux framebuffer @tab X @tab X
@item JACK @tab X @tab
@item LIBCDIO @tab X
@item LIBDC1394 @tab X @tab
@item OpenAL @tab X
+@item OpenGL @tab @tab X
@item OSS @tab X @tab X
-@item Pulseaudio @tab X @tab
+@item PulseAudio @tab X @tab X
@item SDL @tab @tab X
@item Video4Linux2 @tab X @tab X
@item VfW capture @tab X @tab
@item X11 grabbing @tab X @tab
+@item Win32 grabbing @tab X @tab
@end multitable
@code{X} means that input/output is supported.
diff --git a/chromium/third_party/ffmpeg/doc/git-howto.texi b/chromium/third_party/ffmpeg/doc/git-howto.texi
index 44e1cc64398..750662a4581 100644
--- a/chromium/third_party/ffmpeg/doc/git-howto.texi
+++ b/chromium/third_party/ffmpeg/doc/git-howto.texi
@@ -299,7 +299,7 @@ the current branch history.
git commit --amend
@end example
-allows to amend the last commit details quickly.
+allows one to amend the last commit details quickly.
@example
git rebase -i origin/master
diff --git a/chromium/third_party/ffmpeg/doc/indevs.texi b/chromium/third_party/ffmpeg/doc/indevs.texi
index 72b14935221..7b94155380f 100644
--- a/chromium/third_party/ffmpeg/doc/indevs.texi
+++ b/chromium/third_party/ffmpeg/doc/indevs.texi
@@ -51,6 +51,36 @@ ffmpeg -f alsa -i hw:0 alsaout.wav
For more information see:
@url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html}
+@section avfoundation
+
+AVFoundation input device.
+
+AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX >= 10.7 as well as on iOS.
+The older QTKit framework has been marked deprecated since OSX version 10.7.
+
+The filename passed as input is parsed to contain either a device name or index.
+The device index can also be given by using -video_device_index.
+A given device index will override any given device name.
+If the desired device consists of numbers only, use -video_device_index to identify it.
+The default device will be chosen if an empty string or the device name "default" is given.
+The available devices can be enumerated by using -list_devices.
+
+@example
+ffmpeg -f avfoundation -i "0" out.mpg
+@end example
+
+@example
+ffmpeg -f avfoundation -video_device_index 0 -i "" out.mpg
+@end example
+
+@example
+ffmpeg -f avfoundation -i "default" out.mpg
+@end example
+
+@example
+ffmpeg -f avfoundation -list_devices true -i ""
+@end example
+
@section bktr
BSD video input device.
@@ -192,6 +222,81 @@ ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
+@section gdigrab
+
+Win32 GDI-based screen capture device.
+
+This device allows you to capture a region of the display on Windows.
+
+There are two options for the input filename:
+@example
+desktop
+@end example
+or
+@example
+title=@var{window_title}
+@end example
+
+The first option will capture the entire desktop, or a fixed region of the
+desktop. The second option will instead capture the contents of a single
+window, regardless of its position on the screen.
+
+For example, to grab the entire desktop using @command{ffmpeg}:
+@example
+ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
+@end example
+
+Grab a 640x480 region at position @code{10,20}:
+@example
+ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
+@end example
+
+Grab the contents of the window named "Calculator"
+@example
+ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
+@end example
+
+@subsection Options
+
+@table @option
+@item draw_mouse
+Specify whether to draw the mouse pointer. Use the value @code{0} to
+not draw the pointer. Default value is @code{1}.
+
+@item framerate
+Set the grabbing frame rate. Default value is @code{ntsc},
+corresponding to a frame rate of @code{30000/1001}.
+
+@item show_region
+Show grabbed region on screen.
+
+If @var{show_region} is specified with @code{1}, then the grabbing
+region will be indicated on screen. With this option, it is easy to
+know what is being grabbed if only a portion of the screen is grabbed.
+
+Note that @var{show_region} is incompatible with grabbing the contents
+of a single window.
+
+For example:
+@example
+ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
+@end example
+
+@item video_size
+Set the video frame size. The default is to capture the full screen if @file{desktop} is selected, or the full window size if @file{title=@var{window_title}} is selected.
+
+@item offset_x
+When capturing a region with @var{video_size}, set the distance from the left edge of the screen or desktop.
+
+Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned to the left of your primary monitor, you will need to use a negative @var{offset_x} value to move the region to that monitor.
+
+@item offset_y
+When capturing a region with @var{video_size}, set the distance from the top edge of the screen or desktop.
+
+Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you will need to use a negative @var{offset_y} value to move the region to that monitor.
+
+@end table
+
@section iec61883
FireWire DV/HDV input device using libiec61883.
@@ -409,7 +514,7 @@ OpenAL is part of Core Audio, the official Mac OS X Audio interface.
See @url{http://developer.apple.com/technologies/mac/audio-and-video.html}
@end table
-This device allows to capture from an audio input device handled
+This device allows one to capture from an audio input device handled
through OpenAL.
You need to specify the name of the device to capture in the provided
@@ -531,6 +636,33 @@ Record a stream from default device:
ffmpeg -f pulse -i default /tmp/pulse.wav
@end example
+@section qtkit
+
+QTKit input device.
+
+The filename passed as input is parsed to contain either a device name or index.
+The device index can also be given by using -video_device_index.
+A given device index will override any given device name.
+If the desired device consists of numbers only, use -video_device_index to identify it.
+The default device will be chosen if an empty string or the device name "default" is given.
+The available devices can be enumerated by using -list_devices.
+
+@example
+ffmpeg -f qtkit -i "0" out.mpg
+@end example
+
+@example
+ffmpeg -f qtkit -video_device_index 0 -i "" out.mpg
+@end example
+
+@example
+ffmpeg -f qtkit -i "default" out.mpg
+@end example
+
+@example
+ffmpeg -f qtkit -list_devices true -i ""
+@end example
+
@section sndio
sndio input device.
@@ -617,7 +749,7 @@ Select the pixel format (only valid for raw video input).
@item input_format
Set the preferred pixel format (for raw video) or a codec name.
-This option allows to select the input format, when several are
+This option allows one to select the input format, when several are
available.
@item framerate
@@ -678,7 +810,7 @@ other filename will be interpreted as device number 0.
X11 video input device.
-This device allows to capture a region of an X11 display.
+This device allows one to capture a region of an X11 display.
The filename passed as input has the syntax:
@example
diff --git a/chromium/third_party/ffmpeg/doc/muxers.texi b/chromium/third_party/ffmpeg/doc/muxers.texi
index dbb52e81c56..bab0081724d 100644
--- a/chromium/third_party/ffmpeg/doc/muxers.texi
+++ b/chromium/third_party/ffmpeg/doc/muxers.texi
@@ -23,6 +23,8 @@ A description of some of the currently available muxers follows.
Audio Interchange File Format muxer.
+@subsection Options
+
It accepts the following options:
@table @option
@@ -49,6 +51,10 @@ The output of the muxer consists of a single line of the form:
CRC=0x@var{CRC}, where @var{CRC} is a hexadecimal number 0-padded to
8 digits containing the CRC for all the decoded input frames.
+See also the @ref{framecrc} muxer.
+
+@subsection Examples
+
For example to compute the CRC of the input, and store it in the file
@file{out.crc}:
@example
@@ -68,8 +74,6 @@ and the input video converted to MPEG-2 video, use the command:
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
@end example
-See also the @ref{framecrc} muxer.
-
@anchor{framecrc}
@section framecrc
@@ -89,6 +93,8 @@ packet of the form:
@var{CRC} is a hexadecimal number 0-padded to 8 digits containing the
CRC of the packet.
+@subsection Examples
+
For example to compute the CRC of the audio and video frames in
@file{INPUT}, converted to raw audio and video packets, and store it
in the file @file{out.crc}:
@@ -132,6 +138,8 @@ packet of the form:
@var{MD5} is a hexadecimal number representing the computed MD5 hash
for the packet.
+@subsection Examples
+
For example to compute the MD5 of the audio and video frames in
@file{INPUT}, converted to raw audio and video packets, and store it
in the file @file{out.md5}:
@@ -184,26 +192,55 @@ can not be smaller than one centi second.
@section hls
Apple HTTP Live Streaming muxer that segments MPEG-TS according to
-the HTTP Live Streaming specification.
+the HTTP Live Streaming (HLS) specification.
It creates a playlist file and numbered segment files. The output
filename specifies the playlist filename; the segment filenames
receive the same basename as the playlist, a sequential number and
a .ts extension.
+For example, to convert an input file with @command{ffmpeg}:
@example
ffmpeg -i in.nut out.m3u8
@end example
+See also the @ref{segment} muxer, which provides a more generic and
+flexible implementation of a segmenter, and can be used to perform HLS
+segmentation.
+
+@subsection Options
+
+This muxer supports the following options:
+
@table @option
-@item -hls_time @var{seconds}
-Set the segment length in seconds.
-@item -hls_list_size @var{size}
-Set the maximum number of playlist entries.
-@item -hls_wrap @var{wrap}
-Set the number after which index wraps.
-@item -start_number @var{number}
-Start the sequence from @var{number}.
+@item hls_time @var{seconds}
+Set the segment length in seconds. Default value is 2.
+
+@item hls_list_size @var{size}
+Set the maximum number of playlist entries. If set to 0 the list file
+will contain all the segments. Default value is 5.
+
+@item hls_wrap @var{wrap}
+Set the number after which the segment filename number (the number
+specified in each segment file) wraps. If set to 0 the number will be
+never wrapped. Default value is 0.
+
+This option is useful to avoid to fill the disk with many segment
+files, and limits the maximum number of segment files written to disk
+to @var{wrap}.
+
+@item start_number @var{number}
+Start the playlist sequence number from @var{number}. Default value is
+0.
+
+@item hls_base_url @var{baseurl}
+Append @var{baseurl} to every entry in the playlist.
+Useful to generate playlists with absolute paths.
+
+Note that the playlist sequence number must be unique for each segment
+and it is not to be confused with the segment filename sequence number
+which can be cyclic, for example if the @option{wrap} option is
+specified.
@end table
@anchor{ico}
@@ -269,6 +306,8 @@ The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
form @file{img%-1.jpg}, @file{img%-2.jpg}, ..., @file{img%-10.jpg},
etc.
+@subsection Examples
+
The following example shows how to use @command{ffmpeg} for creating a
sequence of files @file{img-001.jpeg}, @file{img-002.jpeg}, ...,
taking one image every second from the input video:
@@ -291,16 +330,32 @@ Note also that the pattern must not necessarily contain "%d" or
ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
@end example
-@table @option
-@item start_number @var{number}
-Start the sequence from @var{number}. Default value is 1. Must be a
-non-negative number.
+The @option{strftime} option allows you to expand the filename with
+date and time information. Check the documentation of
+the @code{strftime()} function for the syntax.
-@item -update @var{number}
-If @var{number} is nonzero, the filename will always be interpreted as just a
-filename, not a pattern, and this file will be continuously overwritten with new
-images.
+For example to generate image files from the @code{strftime()}
+"%Y-%m-%d_%H-%M-%S" pattern, the following @command{ffmpeg} command
+can be used:
+@example
+ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S.jpg"
+@end example
+@subsection Options
+
+@table @option
+@item start_number
+Start the sequence from the specified number. Default value is 1. Must
+be a non-negative number.
+
+@item update
+If set to 1, the filename will always be interpreted as just a
+filename, not a pattern, and the corresponding file will be continuously
+overwritten with new images. Default value is 0.
+
+@item strftime
+If set to 1, expand the filename with date and time information from
+@code{strftime()}. Default value is 0.
@end table
The image muxer supports the .Y.U.V image file format. This format is
@@ -315,25 +370,27 @@ Matroska container muxer.
This muxer implements the matroska and webm container specs.
+@subsection Metadata
+
The recognized metadata settings in this muxer are:
@table @option
+@item title
+Set title name provided to a single track.
-@item title=@var{title name}
-Name provided to a single track
-@end table
+@item language
+Specify the language of the track in the Matroska languages form.
-@table @option
+The language can be either the 3 letters bibliographic ISO-639-2 (ISO
+639-2/B) form (like "fre" for French), or a language code mixed with a
+country code for specialities in languages (like "fre-ca" for Canadian
+French).
-@item language=@var{language name}
-Specifies the language of the track in the Matroska languages form
-@end table
+@item stereo_mode
+Set stereo 3D video layout of two views in a single video track.
-@table @option
-
-@item stereo_mode=@var{mode}
-Stereo 3D video layout of two views in a single video track
-@table @option
+The following values are recognized:
+@table @samp
@item mono
video is not stereo
@item left_right
@@ -372,10 +429,11 @@ For example a 3D WebM clip can be created using the following command line:
ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
@end example
+@subsection Options
+
This muxer supports the following options:
@table @option
-
@item reserve_index_space
By default, this muxer writes the index for seeking (called cues in Matroska
terms) at the end of the file, because it cannot know in advance how much space
@@ -390,7 +448,6 @@ for most use cases should be about 50kB per hour of video.
Note that cues are only written if the output is seekable and this option will
have no effect if it is not.
-
@end table
@anchor{md5}
@@ -420,7 +477,7 @@ ffmpeg -i INPUT -f md5 -
See also the @ref{framemd5} muxer.
-@section mov/mp4/ismv
+@section mov, mp4, ismv
MOV/MP4/ISMV (Smooth Streaming) muxer.
@@ -438,6 +495,8 @@ very long files (since writing normal MOV/MP4 files stores info about
every single packet in memory until the file is closed). The downside
is that it is less compatible with other applications.
+@subsection Options
+
Fragmentation is enabled by setting one of the AVOptions that define
how to cut the file into fragments:
@@ -494,6 +553,8 @@ as fragmented output, thus it is not enabled by default.
Add RTP hinting tracks to the output file.
@end table
+@subsection Example
+
Smooth Streaming content can be pushed in real time to a publishing
point on IIS with this muxer. Example:
@example
@@ -504,12 +565,15 @@ ffmpeg -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe
The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
-@code{id3v2_version} option controls which one is used. The legacy ID3v1 tag is
-not written by default, but may be enabled with the @code{write_id3v1} option.
+@code{id3v2_version} option controls which one is used. Setting
+@code{id3v2_version} to 0 will disable the ID3v2 header completely. The legacy
+ID3v1 tag is not written by default, but may be enabled with the
+@code{write_id3v1} option.
-For seekable output the muxer also writes a Xing frame at the beginning, which
-contains the number of frames in the file. It is useful for computing duration
-of VBR files.
+The muxer may also write a Xing frame at the beginning, which contains the
+number of frames in the file. It is useful for computing duration of VBR files.
+The Xing frame is written if the output stream is seekable and if the
+@code{write_xing} option is set to 1 (the default).
The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
are supplied to the muxer in form of a video stream with a single packet. There
@@ -536,12 +600,24 @@ ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
@end example
+Write a "clean" MP3 without any extra features:
+@example
+ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
+@end example
+
@section mpegts
MPEG transport stream muxer.
This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
+The recognized metadata settings in mpegts muxer are @code{service_provider}
+and @code{service_name}. If they are not set the default for
+@code{service_provider} is "FFmpeg" and the default for
+@code{service_name} is "Service01".
+
+@subsection Options
+
The muxer options are:
@table @option
@@ -594,10 +670,7 @@ Reemit PAT/PMT before writing the next packet.
Use LATM packetization for AAC.
@end table
-The recognized metadata settings in mpegts muxer are @code{service_provider}
-and @code{service_name}. If they are not set the default for
-@code{service_provider} is "FFmpeg" and the default for
-@code{service_name} is "Service01".
+@subsection Example
@example
ffmpeg -i file.mpg -c copy \
@@ -648,11 +721,12 @@ situations, giving a small seek granularity at the cost of additional container
overhead.
@end table
+@anchor{segment}
@section segment, stream_segment, ssegment
Basic stream segmenter.
-The segmenter muxer outputs streams to a number of separate files of nearly
+This muxer outputs streams to a number of separate files of nearly
fixed duration. Output filename pattern can be set in a fashion similar to
@ref{image2}.
@@ -678,12 +752,17 @@ the option @var{segment_list}. The list type is specified by the
list are set by default to the basename of the corresponding segment
files.
+See also the @ref{hls} muxer, which provides a more specific
+implementation for HLS segmentation.
+
+@subsection Options
+
The segment muxer supports the following options:
@table @option
@item reference_stream @var{specifier}
Set the reference stream, as specified by the string @var{specifier}.
-If @var{specifier} is set to @code{auto}, the reference is choosen
+If @var{specifier} is set to @code{auto}, the reference is chosen
automatically. Otherwise it must be a stream specifier (see the ``Stream
specifiers'' chapter in the ffmpeg manual) which specifies the
reference stream. The default value is @code{auto}.
@@ -714,8 +793,8 @@ segments. If 0 the list file will contain all the segments. Default
value is 0.
@item segment_list_entry_prefix @var{prefix}
-Set @var{prefix} to prepend to the name of each entry filename. By
-default no prefix is applied.
+Prepend @var{prefix} to each entry. Useful to generate absolute paths.
+By default no prefix is applied.
@item segment_list_type @var{type}
Specify the format for the segment list file.
@@ -788,7 +867,7 @@ In particular may be used in combination with the @file{ffmpeg} option
@var{force_key_frames} may not be set accurately because of rounding
issues, with the consequence that a key frame time may result set just
before the specified time. For constant frame rate videos a value of
-1/2*@var{frame_rate} should address the worst case mismatch between
+1/(2*@var{frame_rate}) should address the worst case mismatch between
the specified time and the time set by @var{force_key_frames}.
@item segment_times @var{times}
@@ -874,6 +953,28 @@ ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
@end example
@end itemize
+@section smoothstreaming
+
+Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
+
+@table @option
+@item window_size
+Specify the number of fragments kept in the manifest. Default 0 (keep all).
+
+@item extra_window_size
+Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
+
+@item lookahead_count
+Specify the number of lookahead fragments. Default 2.
+
+@item min_frag_duration
+Specify the minimum fragment duration (in microseconds). Default 5000000.
+
+@item remove_at_exit
+Specify whether to remove all fragments when finished. Default 0 (do not remove).
+
+@end table
+
@section tee
The tee muxer can be used to write the same data to several files or any
@@ -889,8 +990,8 @@ to feed the same packets to several muxers directly.
The slave outputs are specified in the file name given to the muxer,
separated by '|'. If any of the slave name contains the '|' separator,
leading or trailing spaces or any special character, it must be
-escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils
-manual).
+escaped (see @ref{quoting_and_escaping,,the "Quoting and escaping"
+section in the ffmpeg-utils(1) manual,ffmpeg-utils}).
Muxer options can be specified for each slave by prepending them as a list of
@var{key}=@var{value} pairs separated by ':', between square brackets. If
@@ -905,10 +1006,13 @@ output name suffix.
@item bsfs[/@var{spec}]
Specify a list of bitstream filters to apply to the specified
-output. It is possible to specify to which streams a given bitstream
-filter applies, by appending a stream specifier to the option
-separated by @code{/}. If the stream specifier is not specified, the
-bistream filters will be applied to all streams in the output.
+output.
+
+It is possible to specify to which streams a given bitstream filter
+applies, by appending a stream specifier to the option separated by
+@code{/}. @var{spec} must be a stream specifier (see @ref{Format
+stream specifiers}). If the stream specifier is not specified, the
+bitstream filters will be applied to all streams in the output.
Several bitstream filters can be specified, separated by ",".
@@ -918,7 +1022,8 @@ specified by a stream specifier. If not specified, this defaults to
all the input streams.
@end table
-Some examples follow.
+@subsection Examples
+
@itemize
@item
Encode something and both archive it in a WebM file and stream it
@@ -939,6 +1044,15 @@ audio packets.
ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
-f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac"
@end example
+
+@item
+As below, but select only stream @code{a:1} for the audio output. Note
+that a second level escaping must be performed, as ":" is a special
+character used to separate options.
+@example
+ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
+ -f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac"
+@end example
@end itemize
Note: some codecs may need different options depending on the output format;
diff --git a/chromium/third_party/ffmpeg/doc/optimization.txt b/chromium/third_party/ffmpeg/doc/optimization.txt
index 5a66d6bb3ff..cce472f4ca2 100644
--- a/chromium/third_party/ffmpeg/doc/optimization.txt
+++ b/chromium/third_party/ffmpeg/doc/optimization.txt
@@ -79,9 +79,6 @@ qpel{8,16}_mc??_old_c / *pixels{8,16}_l4
Just used to work around a bug in an old libavcodec encoder version.
Don't optimize them.
-tpel_mc_func {put,avg}_tpel_pixels_tab
- Used only for SVQ3, so only optimize them if you need fast SVQ3 decoding.
-
add_bytes/diff_bytes
For huffyuv only, optimize if you want a faster ffhuffyuv codec.
@@ -268,17 +265,6 @@ CELL/SPU:
http://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/30B3520C93F437AB87257060006FFE5E/$file/Language_Extensions_for_CBEA_2.4.pdf
http://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/9F820A5FFA3ECE8C8725716A0062585F/$file/CBE_Handbook_v1.1_24APR2007_pub.pdf
-SPARC-specific:
----------------
-SPARC Joint Programming Specification (JPS1): Commonality
-http://www.fujitsu.com/downloads/PRMPWR/JPS1-R1.0.4-Common-pub.pdf
-
-UltraSPARC III Processor User's Manual (contains instruction timings)
-http://www.sun.com/processors/manuals/USIIIv2.pdf
-
-VIS Whitepaper (contains optimization guidelines)
-http://www.sun.com/processors/vis/download/vis/vis_whitepaper.pdf
-
GCC asm links:
--------------
official doc but quite ugly
diff --git a/chromium/third_party/ffmpeg/doc/outdevs.texi b/chromium/third_party/ffmpeg/doc/outdevs.texi
index f18982300b0..488a1ad3627 100644
--- a/chromium/third_party/ffmpeg/doc/outdevs.texi
+++ b/chromium/third_party/ffmpeg/doc/outdevs.texi
@@ -22,11 +22,27 @@ A description of the currently available output devices follows.
ALSA (Advanced Linux Sound Architecture) output device.
+@subsection Examples
+
+@itemize
+@item
+Play a file on default ALSA device:
+@example
+ffmpeg -i INPUT -f alsa default
+@end example
+
+@item
+Play a file on soundcard 1, audio device 7:
+@example
+ffmpeg -i INPUT -f alsa hw:1,7
+@end example
+@end itemize
+
@section caca
CACA output device.
-This output device allows to show a video stream in CACA window.
+This output device allows one to show a video stream in CACA window.
Only one CACA window is allowed per application, so you can
have only one instance of this output device in an application.
@@ -104,6 +120,68 @@ ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
@end example
@end itemize
+@section decklink
+
+The decklink output device provides playback capabilities for Blackmagic
+DeckLink devices.
+
+To enable this output device, you need the Blackmagic DeckLink SDK and you
+need to configure with the appropriate @code{--extra-cflags}
+and @code{--extra-ldflags}.
+On Windows, you need to run the IDL files through @command{widl}.
+
+DeckLink is very picky about the formats it supports. Pixel format is always
+uyvy422, framerate and video size must be determined for your device with
+@command{-list_formats 1}. Audio sample rate is always 48 kHz.
+
+@subsection Options
+
+@table @option
+
+@item list_devices
+If set to @option{true}, print a list of devices and exit.
+Defaults to @option{false}.
+
+@item list_formats
+If set to @option{true}, print a list of supported formats and exit.
+Defaults to @option{false}.
+
+@item preroll
+Amount of time to preroll video in seconds.
+Defaults to @option{0.5}.
+
+@end table
+
+@subsection Examples
+
+@itemize
+
+@item
+List output devices:
+@example
+ffmpeg -i test.avi -f decklink -list_devices 1 dummy
+@end example
+
+@item
+List supported formats:
+@example
+ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
+@end example
+
+@item
+Play video clip:
+@example
+ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
+@end example
+
+@item
+Play video clip with non-standard framerate or video size:
+@example
+ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
+@end example
+
+@end itemize
+
@section fbdev
Linux framebuffer output device.
@@ -133,6 +211,45 @@ ffmpeg -re -i INPUT -vcodec rawvideo -pix_fmt bgra -f fbdev /dev/fb0
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
+@section opengl
+OpenGL output device.
+
+To enable this output device you need to configure FFmpeg with @code{--enable-opengl}.
+
+This output device allows one to render to OpenGL context.
+Context may be provided by application or default SDL window is created.
+
+When device renders to external context, application must implement handlers for following messages:
+@code{AV_DEV_TO_APP_CREATE_WINDOW_BUFFER} - create OpenGL context on current thread.
+@code{AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER} - make OpenGL context current.
+@code{AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER} - swap buffers.
+@code{AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER} - destroy OpenGL context.
+Application is also required to inform a device about current resolution by sending @code{AV_APP_TO_DEV_WINDOW_SIZE} message.
+
+@subsection Options
+@table @option
+
+@item background
+Set background color. Black is a default.
+@item no_window
+Disables default SDL window when set to non-zero value.
+Application must provide OpenGL context and both @code{window_size_cb} and @code{window_swap_buffers_cb} callbacks when set.
+@item window_title
+Set the SDL window title, if not specified default to the filename specified for the output device.
+Ignored when @option{no_window} is set.
+@item window_size
+Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
+If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
+Mostly usable when @option{no_window} is not set.
+
+@end table
+
+@subsection Examples
+Play a file on SDL window using OpenGL rendering:
+@example
+ffmpeg -i INPUT -f opengl "window title"
+@end example
+
@section oss
OSS (Open Sound System) output device.
@@ -177,6 +294,20 @@ When both options are provided then the highest value is used
are set to 0 (which is default), the device will use the default
PulseAudio duration value. By default PulseAudio set buffer duration
to around 2 seconds.
+
+@item prebuf
+Specify pre-buffering size in bytes. The server does not start with
+playback before at least @option{prebuf} bytes are available in the
+buffer. By default this option is initialized to the same value as
+@option{buffer_size} or @option{buffer_duration} (whichever is bigger).
+
+@item minreq
+Specify minimum request size in bytes. The server does not request less
+than @option{minreq} bytes from the client, instead waits until the buffer
+is free enough to request more bytes at once. It is recommended to not set
+this option, which will initialize this to a value that is deemed sensible
+by the server.
+
@end table
@subsection Examples
@@ -189,7 +320,7 @@ ffmpeg -i INPUT -f pulse "stream name"
SDL (Simple DirectMedia Layer) output device.
-This output device allows to show a video stream in an SDL
+This output device allows one to show a video stream in an SDL
window. Only one SDL window is allowed per application, so you can
have only one instance of this output device in an application.
@@ -248,7 +379,7 @@ sndio audio output device.
XV (XVideo) output device.
-This output device allows to show a video stream in a X Window System
+This output device allows one to show a video stream in a X Window System
window.
@subsection Options
@@ -275,19 +406,26 @@ For example, @code{dual-headed:0.1} would specify screen 1 of display
Check the X11 specification for more detailed information about the
display name format.
+@item window_id
+When set to non-zero value then device doesn't create new window,
+but uses existing one with provided @var{window_id}. By default
+this options is set to zero and device creates its own window.
+
@item window_size
Set the created window size, can be a string of the form
@var{width}x@var{height} or a video size abbreviation. If not
specified it defaults to the size of the input video.
+Ignored when @var{window_id} is set.
@item window_x
@item window_y
Set the X and Y window offsets for the created window. They are both
set to 0 by default. The values may be ignored by the window manager.
+Ignored when @var{window_id} is set.
@item window_title
Set the window title, if not specified default to the filename
-specified for the output device.
+specified for the output device. Ignored when @var{window_id} is set.
@end table
For more information about XVideo see @url{http://www.x.org/}.
diff --git a/chromium/third_party/ffmpeg/doc/platform.texi b/chromium/third_party/ffmpeg/doc/platform.texi
index 934a3ae3177..c999383acbd 100644
--- a/chromium/third_party/ffmpeg/doc/platform.texi
+++ b/chromium/third_party/ffmpeg/doc/platform.texi
@@ -51,14 +51,15 @@ The toolchain provided with Xcode is sufficient to build the basic
unacelerated code.
Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from
-@url{http://github.com/yuvi/gas-preprocessor} to build the optimized
-assembler functions. Just download the Perl script and put it somewhere
+@url{https://github.com/FFmpeg/gas-preprocessor} or
+@url{https://github.com/yuvi/gas-preprocessor}(currently outdated) to build the optimized
+assembler functions. Put the Perl script somewhere
in your PATH, FFmpeg's configure will pick it up automatically.
Mac OS X on amd64 and x86 requires @command{yasm} to build most of the
optimized assembler functions. @uref{http://www.finkproject.org/, Fink},
@uref{http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml, Gentoo Prefix},
-@uref{http://mxcl.github.com/homebrew/, Homebrew}
+@uref{https://mxcl.github.com/homebrew/, Homebrew}
or @uref{http://www.macports.org, MacPorts} can easily provide it.
diff --git a/chromium/third_party/ffmpeg/doc/protocols.texi b/chromium/third_party/ffmpeg/doc/protocols.texi
index 3f3844d9a83..133512a70df 100644
--- a/chromium/third_party/ffmpeg/doc/protocols.texi
+++ b/chromium/third_party/ffmpeg/doc/protocols.texi
@@ -117,7 +117,19 @@ ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP/////////////
File access protocol.
-Allow to read from or read to a file.
+Allow to read from or write to a file.
+
+A file URL can have the form:
+@example
+file:@var{filename}
+@end example
+
+where @var{filename} is the path of the file to read.
+
+An URL that does not have a protocol prefix will be assumed to be a
+file URL. Depending on the build, an URL that looks like a Windows
+path with the drive letter at the beginning will also be assumed to be
+a file URL (usually not the case in builds for unix-like systems).
For example to read from a file @file{input.mpeg} with @command{ffmpeg}
use the command:
@@ -125,10 +137,6 @@ use the command:
ffmpeg -i file:input.mpeg output.mpeg
@end example
-The ff* tools default to the file protocol, that is a resource
-specified with the name "FILE.mpeg" is interpreted as the URL
-"file:FILE.mpeg".
-
This protocol accepts the following options:
@table @option
@@ -205,7 +213,7 @@ m3u8 files.
HTTP (Hyper Text Transfer Protocol).
-This protocol accepts the following options.
+This protocol accepts the following options:
@table @option
@item seekable
@@ -215,32 +223,33 @@ if set to -1 it will try to autodetect if it is seekable. Default
value is -1.
@item chunked_post
-If set to 1 use chunked transfer-encoding for posts, default is 1.
+If set to 1 use chunked Transfer-Encoding for posts, default is 1.
+
+@item content_type
+Set a specific content type for the POST messages.
@item headers
Set custom HTTP headers, can override built in default headers. The
value must be a string encoding the headers.
-@item content_type
-Force a content type.
-
-@item user-agent
-Override User-Agent header. If not specified the protocol will use a
-string describing the libavformat build.
-
@item multiple_requests
-Use persistent connections if set to 1. By default it is 0.
+Use persistent connections if set to 1, default is 0.
@item post_data
Set custom HTTP post data.
+@item user-agent
+@item user_agent
+Override the User-Agent header. If not specified the protocol will use a
+string describing the libavformat build. ("Lavf/<version>")
+
@item timeout
Set timeout of socket I/O operations used by the underlying low level
operation. By default it is set to -1, which means that the timeout is
not specified.
@item mime_type
-Set MIME type.
+Export the MIME type.
@item icy
If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
@@ -249,17 +258,25 @@ the @option{icy_metadata_headers} and @option{icy_metadata_packet} options.
The default is 0.
@item icy_metadata_headers
-If the server supports ICY metadata, this contains the ICY specific HTTP reply
-headers, separated with newline characters.
+If the server supports ICY metadata, this contains the ICY-specific HTTP reply
+headers, separated by newline characters.
@item icy_metadata_packet
If the server supports ICY metadata, and @option{icy} was set to 1, this
-contains the last non-empty metadata packet sent by the server.
+contains the last non-empty metadata packet sent by the server. It should be
+polled in regular intervals by applications interested in mid-stream metadata
+updates.
@item cookies
Set the cookies to be sent in future requests. The format of each cookie is the
same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
delimited by a newline character.
+
+@item offset
+Set initial byte offset.
+
+@item end_offset
+Try to limit the request to bytes preceding this offset.
@end table
@subsection HTTP Cookies
@@ -544,6 +561,10 @@ is not specified.
Truncate existing files on write, if set to 1. A value of 0 prevents
truncating. Default value is 1.
+@item private_key
+Specify the path of the file containing private key to use during authorization.
+By default libssh searches for keys in the @file{~/.ssh/} directory.
+
@end table
Example: Play a file stored on remote server.
@@ -661,6 +682,8 @@ set to the the local RTP port value plus 1.
@section rtsp
+Real-Time Streaming Protocol.
+
RTSP is not technically a protocol handler in libavformat, it is a demuxer
and muxer. The demuxer supports both normal RTSP (with data transferred
over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
@@ -668,21 +691,29 @@ data transferred over RDT).
The muxer can be used to send a stream using RTSP ANNOUNCE to a server
supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
-@uref{http://github.com/revmischa/rtsp-server, RTSP server}).
+@uref{https://github.com/revmischa/rtsp-server, RTSP server}).
The required syntax for a RTSP url is:
@example
rtsp://@var{hostname}[:@var{port}]/@var{path}
@end example
-The following options (set on the @command{ffmpeg}/@command{ffplay} command
-line, or set in code via @code{AVOption}s or in @code{avformat_open_input}),
-are supported:
+Options can be set on the @command{ffmpeg}/@command{ffplay} command
+line, or set in code via @code{AVOption}s or in
+@code{avformat_open_input}.
-Flags for @code{rtsp_transport}:
+The following options are supported.
@table @option
+@item initial_pause
+Do not start playing the stream immediately if set to 1. Default value
+is 0.
+@item rtsp_transport
+Set RTSP trasport protocols.
+
+It accepts the following values:
+@table @samp
@item udp
Use UDP as lower transport protocol.
@@ -700,15 +731,56 @@ passing proxies.
Multiple lower transport protocols may be specified, in that case they are
tried one at a time (if the setup of one fails, the next one is tried).
-For the muxer, only the @code{tcp} and @code{udp} options are supported.
+For the muxer, only the @samp{tcp} and @samp{udp} options are supported.
-Flags for @code{rtsp_flags}:
+@item rtsp_flags
+Set RTSP flags.
-@table @option
+The following values are accepted:
+@table @samp
@item filter_src
Accept packets only from negotiated peer address and port.
@item listen
Act as a server, listening for an incoming connection.
+@item prefer_tcp
+Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
+@end table
+
+Default value is @samp{none}.
+
+@item allowed_media_types
+Set media types to accept from the server.
+
+The following flags are accepted:
+@table @samp
+@item video
+@item audio
+@item data
+@end table
+
+By default it accepts all media types.
+
+@item min_port
+Set minimum local UDP port. Default value is 5000.
+
+@item max_port
+Set maximum local UDP port. Default value is 65000.
+
+@item timeout
+Set maximum timeout (in seconds) to wait for incoming connections.
+
+A value of -1 mean infinite (default). This option implies the
+@option{rtsp_flags} set to @samp{listen}.
+
+@item reorder_queue_size
+Set number of packets to buffer for handling of reordered packets.
+
+@item stimeout
+Set socket TCP I/O timeout in micro seconds.
+
+@item user-agent
+Override User-Agent header. If not specified, it default to the
+libavformat identifier string.
@end table
When receiving data over UDP, the demuxer tries to reorder received packets
@@ -721,36 +793,36 @@ streams to display can be chosen with @code{-vst} @var{n} and
@code{-ast} @var{n} for video and audio respectively, and can be switched
on the fly by pressing @code{v} and @code{a}.
-Example command lines:
+@subsection Examples
-To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
+The following examples all make use of the @command{ffplay} and
+@command{ffmpeg} tools.
+@itemize
+@item
+Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
@example
ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
@end example
-To watch a stream tunneled over HTTP:
-
+@item
+Watch a stream tunneled over HTTP:
@example
ffplay -rtsp_transport http rtsp://server/video.mp4
@end example
-To send a stream in realtime to a RTSP server, for others to watch:
-
+@item
+Send a stream in realtime to a RTSP server, for others to watch:
@example
ffmpeg -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
@end example
-To receive a stream in realtime:
-
+@item
+Receive a stream in realtime:
@example
ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output}
@end example
-
-@table @option
-@item stimeout
-Socket IO timeout in micro seconds.
-@end table
+@end itemize
@section sap
@@ -888,32 +960,65 @@ this binary block are used as master key, the following 14 bytes are
used as master salt.
@end table
+@section subfile
+
+Virtually extract a segment of a file or another stream.
+The underlying stream must be seekable.
+
+Accepted options:
+@table @option
+@item start
+Start offset of the extracted segment, in bytes.
+@item end
+End offset of the extracted segment, in bytes.
+@end table
+
+Examples:
+
+Extract a chapter from a DVD VOB file (start and end sectors obtained
+externally and multiplied by 2048):
+@example
+subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
+@end example
+
+Play an AVI file directly from a TAR archive:
+subfile,,start,183241728,end,366490624,,:archive.tar
+
@section tcp
-Trasmission Control Protocol.
+Transmission Control Protocol.
The required syntax for a TCP url is:
@example
tcp://@var{hostname}:@var{port}[?@var{options}]
@end example
-@table @option
+@var{options} contains a list of &-separated options of the form
+@var{key}=@var{val}.
-@item listen
-Listen for an incoming connection
+The list of supported options follows.
+
+@table @option
+@item listen=@var{1|0}
+Listen for an incoming connection. Default value is 0.
@item timeout=@var{microseconds}
-In read mode: if no data arrived in more than this time interval, raise error.
-In write mode: if socket cannot be written in more than this time interval, raise error.
-This also sets timeout on TCP connection establishing.
+Set raise error timeout, expressed in microseconds.
+This option is only relevant in read mode: if no data arrived in more
+than this time interval, raise error.
+
+@item listen_timeout=@var{microseconds}
+Set listen timeout, expressed in microseconds.
+@end table
+
+The following example shows how to setup a listening TCP connection
+with @command{ffmpeg}, which is then accessed with @command{ffplay}:
@example
ffmpeg -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen
ffplay tcp://@var{hostname}:@var{port}
@end example
-@end table
-
@section tls
Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
@@ -979,7 +1084,7 @@ ffplay tls://@var{hostname}:@var{port}
User Datagram Protocol.
-The required syntax for a UDP url is:
+The required syntax for an UDP URL is:
@example
udp://@var{hostname}:@var{port}[?@var{options}]
@end example
@@ -987,17 +1092,17 @@ udp://@var{hostname}:@var{port}[?@var{options}]
@var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
In case threading is enabled on the system, a circular buffer is used
-to store the incoming data, which allows to reduce loss of data due to
+to store the incoming data, which allows one to reduce loss of data due to
UDP socket buffer overruns. The @var{fifo_size} and
@var{overrun_nonfatal} options are related to this buffer.
The list of supported options follows.
@table @option
-
@item buffer_size=@var{size}
-Set the UDP socket buffer size in bytes. This is used both for the
-receiving and the sending buffer size.
+Set the UDP maximum socket buffer size in bytes. This is used to set either
+the receive or send buffer size, depending on what the socket is used for.
+Default is 64KB. See also @var{fifo_size}.
@item localport=@var{port}
Override the local UDP port to bind with.
@@ -1044,25 +1149,40 @@ Survive in case of UDP receiving circular buffer overrun. Default
value is 0.
@item timeout=@var{microseconds}
-In read mode: if no data arrived in more than this time interval, raise error.
+Set raise error timeout, expressed in microseconds.
+
+This option is only relevant in read mode: if no data arrived in more
+than this time interval, raise error.
+
+@item broadcast=@var{1|0}
+Explicitly allow or disallow UDP broadcasting.
+
+Note that broadcasting may not work properly on networks having
+a broadcast storm protection.
@end table
-Some usage examples of the UDP protocol with @command{ffmpeg} follow.
+@subsection Examples
-To stream over UDP to a remote endpoint:
+@itemize
+@item
+Use @command{ffmpeg} to stream over UDP to a remote endpoint:
@example
ffmpeg -i @var{input} -f @var{format} udp://@var{hostname}:@var{port}
@end example
-To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
+@item
+Use @command{ffmpeg} to stream in mpegts format over UDP using 188
+sized UDP packets, using a large input buffer:
@example
ffmpeg -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535
@end example
-To receive over UDP from a remote endpoint:
+@item
+Use @command{ffmpeg} to receive over UDP from a remote endpoint:
@example
-ffmpeg -i udp://[@var{multicast-address}]:@var{port}
+ffmpeg -i udp://[@var{multicast-address}]:@var{port} ...
@end example
+@end itemize
@section unix
diff --git a/chromium/third_party/ffmpeg/doc/scaler.texi b/chromium/third_party/ffmpeg/doc/scaler.texi
index 08d90bcc81a..23d6393883f 100644
--- a/chromium/third_party/ffmpeg/doc/scaler.texi
+++ b/chromium/third_party/ffmpeg/doc/scaler.texi
@@ -35,7 +35,7 @@ Select nearest neighbor rescaling algorithm.
@item area
Select averaging area rescaling algorithm.
-@item bicubiclin
+@item bicublin
Select bicubic scaling algorithm for the luma component, bilinear for
chroma components.
@@ -112,6 +112,14 @@ bayer dither
@item ed
error diffusion dither
+
+@item a_dither
+arithmetic dither, based using addition
+
+@item x_dither
+arithmetic dither, based using xor (more random/less apparent patterning that
+a_dither).
+
@end table
@end table
diff --git a/chromium/third_party/ffmpeg/doc/texi2pod.pl b/chromium/third_party/ffmpeg/doc/texi2pod.pl
index 6cf78d889c0..94e011e42bd 100755..100644
--- a/chromium/third_party/ffmpeg/doc/texi2pod.pl
+++ b/chromium/third_party/ffmpeg/doc/texi2pod.pl
@@ -282,6 +282,14 @@ INF: while(<$inf>) {
$_ = "\n=over 4\n";
};
+ /^\@(multitable)\s+{.*/ and do {
+ push @endwstack, $endw;
+ push @icstack, $ic;
+ $endw = $1;
+ $ic = "";
+ $_ = "\n=over 4\n";
+ };
+
/^\@((?:small)?example|display)/ and do {
push @endwstack, $endw;
$endw = $1;
@@ -298,10 +306,10 @@ INF: while(<$inf>) {
/^\@tab\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
my $columns = $1;
- $columns =~ s/\@tab/ : /;
+ $columns =~ s/\@tab//;
- $_ = " : ". $columns;
- $chapter =~ s/\n+\s+$//;
+ $_ = $columns;
+ $chapter =~ s/$//;
};
/^\@itemx?\s*(.+)?$/ and do {
@@ -327,6 +335,9 @@ die "No filename or title\n" unless defined $fn && defined $tl;
$chapters{NAME} = "$fn \- $tl\n";
$chapters{FOOTNOTES} .= "=back\n" if exists $chapters{FOOTNOTES};
+# always use utf8
+print "=encoding utf8\n\n";
+
unshift @chapters_sequence, "NAME";
for $chapter (@chapters_sequence) {
if (exists $chapters{$chapter}) {
@@ -377,8 +388,8 @@ sub postprocess
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
s/;\s+\@pxref\{(?:[^\}]*)\}//g;
- s/\@ref\{(?:[^,\}]*,)(?:[^,\}]*,)([^,\}]*).*\}/$1/g;
- s/\@ref\{([^\}]*)\}/$1/g;
+ s/\@ref\{(?:[^,\}]*,)(?:[^,\}]*,)([^,\}]*).*\}/B<$1>/g;
+ s/\@ref\{([^\}]*)\}/B<$1>/g;
s/\@noindent\s*//g;
s/\@refill//g;
s/\@gol//g;
diff --git a/chromium/third_party/ffmpeg/doc/utils.texi b/chromium/third_party/ffmpeg/doc/utils.texi
index 305566246c1..5abfb0ccc69 100644
--- a/chromium/third_party/ffmpeg/doc/utils.texi
+++ b/chromium/third_party/ffmpeg/doc/utils.texi
@@ -1056,7 +1056,7 @@ which can be obtained with @code{ffmpeg -opencl_bench} or @code{av_opencl_get_de
@item device_idx
Select the index of the device used to run OpenCL code.
-The specifed index must be one of the indexes in the device list which
+The specified index must be one of the indexes in the device list which
can be obtained with @code{ffmpeg -opencl_bench} or @code{av_opencl_get_device_list()}.
@end table
diff --git a/chromium/third_party/ffmpeg/ffmpeg.c b/chromium/third_party/ffmpeg/ffmpeg.c
index 6411ce30395..10311ef4959 100644
--- a/chromium/third_party/ffmpeg/ffmpeg.c
+++ b/chromium/third_party/ffmpeg/ffmpeg.c
@@ -123,10 +123,6 @@ static int64_t getutime(void);
static int64_t getmaxrss(void);
static int run_as_daemon = 0;
-static int64_t video_size = 0;
-static int64_t audio_size = 0;
-static int64_t subtitle_size = 0;
-static int64_t extra_size = 0;
static int nb_frames_dup = 0;
static int nb_frames_drop = 0;
static int64_t decode_error_stat[2];
@@ -296,32 +292,41 @@ static void sub2video_flush(InputStream *ist)
{
int i;
+ if (ist->sub2video.end_pts < INT64_MAX)
+ sub2video_update(ist, NULL);
for (i = 0; i < ist->nb_filters; i++)
av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
}
/* end of sub2video hack */
-void term_exit(void)
+static void term_exit_sigsafe(void)
{
- av_log(NULL, AV_LOG_QUIET, "%s", "");
#if HAVE_TERMIOS_H
if(restore_tty)
tcsetattr (0, TCSANOW, &oldtty);
#endif
}
+void term_exit(void)
+{
+ av_log(NULL, AV_LOG_QUIET, "%s", "");
+ term_exit_sigsafe();
+}
+
static volatile int received_sigterm = 0;
static volatile int received_nb_signals = 0;
+static volatile int transcode_init_done = 0;
+static int main_return_code = 0;
static void
sigterm_handler(int sig)
{
received_sigterm = sig;
received_nb_signals++;
- term_exit();
+ term_exit_sigsafe();
if(received_nb_signals > 3)
- exit_program(123);
+ exit(123);
}
void term_init(void)
@@ -418,7 +423,7 @@ static int read_key(void)
static int decode_interrupt_cb(void *ctx)
{
- return received_nb_signals > 1;
+ return received_nb_signals > transcode_init_done;
}
const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };
@@ -433,18 +438,20 @@ static void ffmpeg_cleanup(int ret)
}
for (i = 0; i < nb_filtergraphs; i++) {
- avfilter_graph_free(&filtergraphs[i]->graph);
- for (j = 0; j < filtergraphs[i]->nb_inputs; j++) {
- av_freep(&filtergraphs[i]->inputs[j]->name);
- av_freep(&filtergraphs[i]->inputs[j]);
- }
- av_freep(&filtergraphs[i]->inputs);
- for (j = 0; j < filtergraphs[i]->nb_outputs; j++) {
- av_freep(&filtergraphs[i]->outputs[j]->name);
- av_freep(&filtergraphs[i]->outputs[j]);
- }
- av_freep(&filtergraphs[i]->outputs);
- av_freep(&filtergraphs[i]->graph_desc);
+ FilterGraph *fg = filtergraphs[i];
+ avfilter_graph_free(&fg->graph);
+ for (j = 0; j < fg->nb_inputs; j++) {
+ av_freep(&fg->inputs[j]->name);
+ av_freep(&fg->inputs[j]);
+ }
+ av_freep(&fg->inputs);
+ for (j = 0; j < fg->nb_outputs; j++) {
+ av_freep(&fg->outputs[j]->name);
+ av_freep(&fg->outputs[j]);
+ }
+ av_freep(&fg->outputs);
+ av_freep(&fg->graph_desc);
+
av_freep(&filtergraphs[i]);
}
av_freep(&filtergraphs);
@@ -453,29 +460,33 @@ static void ffmpeg_cleanup(int ret)
/* close files */
for (i = 0; i < nb_output_files; i++) {
- AVFormatContext *s = output_files[i]->ctx;
+ OutputFile *of = output_files[i];
+ AVFormatContext *s = of->ctx;
if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE) && s->pb)
avio_close(s->pb);
avformat_free_context(s);
- av_dict_free(&output_files[i]->opts);
+ av_dict_free(&of->opts);
+
av_freep(&output_files[i]);
}
for (i = 0; i < nb_output_streams; i++) {
- AVBitStreamFilterContext *bsfc = output_streams[i]->bitstream_filters;
+ OutputStream *ost = output_streams[i];
+ AVBitStreamFilterContext *bsfc = ost->bitstream_filters;
while (bsfc) {
AVBitStreamFilterContext *next = bsfc->next;
av_bitstream_filter_close(bsfc);
bsfc = next;
}
- output_streams[i]->bitstream_filters = NULL;
- avcodec_free_frame(&output_streams[i]->filtered_frame);
+ ost->bitstream_filters = NULL;
+ av_frame_free(&ost->filtered_frame);
- av_parser_close(output_streams[i]->parser);
+ av_parser_close(ost->parser);
+
+ av_freep(&ost->forced_keyframes);
+ av_expr_free(ost->forced_keyframes_pexpr);
+ av_freep(&ost->avfilter);
+ av_freep(&ost->logfile_prefix);
- av_freep(&output_streams[i]->forced_keyframes);
- av_expr_free(output_streams[i]->forced_keyframes_pexpr);
- av_freep(&output_streams[i]->avfilter);
- av_freep(&output_streams[i]->logfile_prefix);
av_freep(&output_streams[i]);
}
#if HAVE_PTHREADS
@@ -486,13 +497,16 @@ static void ffmpeg_cleanup(int ret)
av_freep(&input_files[i]);
}
for (i = 0; i < nb_input_streams; i++) {
- av_frame_free(&input_streams[i]->decoded_frame);
- av_frame_free(&input_streams[i]->filter_frame);
- av_dict_free(&input_streams[i]->opts);
- avsubtitle_free(&input_streams[i]->prev_sub.subtitle);
- av_frame_free(&input_streams[i]->sub2video.frame);
- av_freep(&input_streams[i]->filters);
- av_freep(&input_streams[i]->hwaccel_device);
+ InputStream *ist = input_streams[i];
+
+ av_frame_free(&ist->decoded_frame);
+ av_frame_free(&ist->filter_frame);
+ av_dict_free(&ist->decoder_opts);
+ avsubtitle_free(&ist->prev_sub.subtitle);
+ av_frame_free(&ist->sub2video.frame);
+ av_freep(&ist->filters);
+ av_freep(&ist->hwaccel_device);
+
av_freep(&input_streams[i]);
}
@@ -512,6 +526,8 @@ static void ffmpeg_cleanup(int ret)
if (received_sigterm) {
av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
(int) received_sigterm);
+ } else if (ret && transcode_init_done) {
+ av_log(NULL, AV_LOG_INFO, "Conversion failed!\n");
}
term_exit();
}
@@ -547,6 +563,15 @@ static void update_benchmark(const char *fmt, ...)
}
}
+static void close_all_output_streams(OutputStream *ost, OSTFinished this_stream, OSTFinished others)
+{
+ int i;
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost2 = output_streams[i];
+ ost2->finished |= ost == ost2 ? this_stream : others;
+ }
+}
+
static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
{
AVBitStreamFilterContext *bsfc = ost->bitstream_filters;
@@ -572,6 +597,9 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
ost->frame_number++;
}
+ if (bsfc)
+ av_packet_split_side_data(pkt);
+
while (bsfc) {
AVPacket new_pkt = *pkt;
int a = av_bitstream_filter_filter(bsfc, avctx, NULL,
@@ -632,6 +660,9 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
}
ost->last_mux_dts = pkt->dts;
+ ost->data_size += pkt->size;
+ ost->packets_written++;
+
pkt->stream_index = ost->index;
if (debug_ts) {
@@ -647,15 +678,17 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
ret = av_interleaved_write_frame(s, pkt);
if (ret < 0) {
print_error("av_interleaved_write_frame()", ret);
- exit_program(1);
+ main_return_code = 1;
+ close_all_output_streams(ost, MUXER_FINISHED | ENCODER_FINISHED, ENCODER_FINISHED);
}
+ av_free_packet(pkt);
}
static void close_output_stream(OutputStream *ost)
{
OutputFile *of = output_files[ost->file_index];
- ost->finished = 1;
+ ost->finished |= ENCODER_FINISHED;
if (of->shortest) {
int64_t end = av_rescale_q(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, AV_TIME_BASE_Q);
of->recording_time = FFMIN(of->recording_time, end);
@@ -692,9 +725,18 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost,
if (frame->pts == AV_NOPTS_VALUE || audio_sync_method < 0)
frame->pts = ost->sync_opts;
ost->sync_opts = frame->pts + frame->nb_samples;
+ ost->samples_encoded += frame->nb_samples;
+ ost->frames_encoded++;
av_assert0(pkt.size || !pkt.data);
update_benchmark(NULL);
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "encoder <- type:audio "
+ "frame_pts:%s frame_pts_time:%s time_base:%d/%d\n",
+ av_ts2str(frame->pts), av_ts2timestr(frame->pts, &enc->time_base),
+ enc->time_base.num, enc->time_base.den);
+ }
+
if (avcodec_encode_audio2(enc, &pkt, frame, &got_packet) < 0) {
av_log(NULL, AV_LOG_FATAL, "Audio encoding failed (avcodec_encode_audio2)\n");
exit_program(1);
@@ -716,10 +758,7 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost,
av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &ost->st->time_base));
}
- audio_size += pkt.size;
write_frame(s, &pkt, ost);
-
- av_free_packet(&pkt);
}
}
@@ -771,6 +810,9 @@ static void do_subtitle_out(AVFormatContext *s,
sub->start_display_time = 0;
if (i == 1)
sub->num_rects = 0;
+
+ ost->frames_encoded++;
+
subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out,
subtitle_out_max_size, sub);
if (subtitle_out_size < 0) {
@@ -791,7 +833,6 @@ static void do_subtitle_out(AVFormatContext *s,
else
pkt.pts += 90 * sub->end_display_time;
}
- subtitle_size += pkt.size;
write_frame(s, &pkt, ost);
}
}
@@ -869,7 +910,9 @@ static void do_video_out(AVFormatContext *s,
nb_frames = FFMIN(nb_frames, ost->max_frames - ost->frame_number);
if (nb_frames == 0) {
nb_frames_drop++;
- av_log(NULL, AV_LOG_VERBOSE, "*** drop!\n");
+ av_log(NULL, AV_LOG_VERBOSE,
+ "*** dropping frame %d from stream %d at ts %"PRId64"\n",
+ ost->frame_number, ost->st->index, in_picture->pts);
return;
} else if (nb_frames > 1) {
if (nb_frames > dts_error_threshold * 30) {
@@ -912,7 +955,6 @@ static void do_video_out(AVFormatContext *s,
pkt.pts = av_rescale_q(in_picture->pts, enc->time_base, ost->st->time_base);
pkt.flags |= AV_PKT_FLAG_KEY;
- video_size += pkt.size;
write_frame(s, &pkt, ost);
} else {
int got_packet, forced_keyframe = 0;
@@ -963,12 +1005,22 @@ static void do_video_out(AVFormatContext *s,
ost->forced_keyframes_expr_const_values[FKF_N] += 1;
}
+
if (forced_keyframe) {
in_picture->pict_type = AV_PICTURE_TYPE_I;
av_log(NULL, AV_LOG_DEBUG, "Forced keyframe at time %f\n", pts_time);
}
update_benchmark(NULL);
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "encoder <- type:video "
+ "frame_pts:%s frame_pts_time:%s time_base:%d/%d\n",
+ av_ts2str(in_picture->pts), av_ts2timestr(in_picture->pts, &enc->time_base),
+ enc->time_base.num, enc->time_base.den);
+ }
+
+ ost->frames_encoded++;
+
ret = avcodec_encode_video2(enc, &pkt, in_picture, &got_packet);
update_benchmark("encode_video %d.%d", ost->file_index, ost->index);
if (ret < 0) {
@@ -977,6 +1029,13 @@ static void do_video_out(AVFormatContext *s,
}
if (got_packet) {
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "encoder -> type:video "
+ "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s\n",
+ av_ts2str(pkt.pts), av_ts2timestr(pkt.pts, &enc->time_base),
+ av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &enc->time_base));
+ }
+
if (pkt.pts == AV_NOPTS_VALUE && !(enc->codec->capabilities & CODEC_CAP_DELAY))
pkt.pts = ost->sync_opts;
@@ -993,9 +1052,7 @@ static void do_video_out(AVFormatContext *s,
}
frame_size = pkt.size;
- video_size += pkt.size;
write_frame(s, &pkt, ost);
- av_free_packet(&pkt);
/* if two pass, output log */
if (ost->logfile && enc->stats_out) {
@@ -1050,9 +1107,9 @@ static void do_video_stats(OutputStream *ost, int frame_size)
ti1 = 0.01;
bitrate = (frame_size * 8) / av_q2d(enc->time_base) / 1000.0;
- avg_bitrate = (double)(video_size * 8) / ti1 / 1000.0;
+ avg_bitrate = (double)(ost->data_size * 8) / ti1 / 1000.0;
fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ",
- (double)video_size / 1024, ti1, bitrate, avg_bitrate);
+ (double)ost->data_size / 1024, ti1, bitrate, avg_bitrate);
fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(enc->coded_frame->pict_type));
}
}
@@ -1073,19 +1130,21 @@ static int reap_filters(void)
for (i = 0; i < nb_output_streams; i++) {
OutputStream *ost = output_streams[i];
OutputFile *of = output_files[ost->file_index];
+ AVFilterContext *filter;
+ AVCodecContext *enc = ost->st->codec;
int ret = 0;
if (!ost->filter)
continue;
+ filter = ost->filter->filter;
if (!ost->filtered_frame && !(ost->filtered_frame = av_frame_alloc())) {
return AVERROR(ENOMEM);
- } else
- avcodec_get_frame_defaults(ost->filtered_frame);
+ }
filtered_frame = ost->filtered_frame;
while (1) {
- ret = av_buffersink_get_frame_flags(ost->filter->filter, filtered_frame,
+ ret = av_buffersink_get_frame_flags(filter, filtered_frame,
AV_BUFFERSINK_FLAG_NO_REQUEST);
if (ret < 0) {
if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {
@@ -1094,32 +1153,38 @@ static int reap_filters(void)
}
break;
}
+ if (ost->finished) {
+ av_frame_unref(filtered_frame);
+ continue;
+ }
frame_pts = AV_NOPTS_VALUE;
if (filtered_frame->pts != AV_NOPTS_VALUE) {
int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time;
- filtered_frame->pts = frame_pts = av_rescale_q(filtered_frame->pts,
- ost->filter->filter->inputs[0]->time_base,
- ost->st->codec->time_base) -
- av_rescale_q(start_time,
- AV_TIME_BASE_Q,
- ost->st->codec->time_base);
+ filtered_frame->pts = frame_pts =
+ av_rescale_q(filtered_frame->pts, filter->inputs[0]->time_base, enc->time_base) -
+ av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base);
}
//if (ost->source_index >= 0)
// *filtered_frame= *input_streams[ost->source_index]->decoded_frame; //for me_threshold
-
- switch (ost->filter->filter->inputs[0]->type) {
+ switch (filter->inputs[0]->type) {
case AVMEDIA_TYPE_VIDEO:
filtered_frame->pts = frame_pts;
if (!ost->frame_aspect_ratio.num)
- ost->st->codec->sample_aspect_ratio = filtered_frame->sample_aspect_ratio;
+ enc->sample_aspect_ratio = filtered_frame->sample_aspect_ratio;
+
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "filter -> pts:%s pts_time:%s time_base:%d/%d\n",
+ av_ts2str(filtered_frame->pts), av_ts2timestr(filtered_frame->pts, &enc->time_base),
+ enc->time_base.num, enc->time_base.den);
+ }
do_video_out(of->ctx, ost, filtered_frame);
break;
case AVMEDIA_TYPE_AUDIO:
filtered_frame->pts = frame_pts;
- if (!(ost->st->codec->codec->capabilities & CODEC_CAP_PARAM_CHANGE) &&
- ost->st->codec->channels != av_frame_get_channels(filtered_frame)) {
+ if (!(enc->codec->capabilities & CODEC_CAP_PARAM_CHANGE) &&
+ enc->channels != av_frame_get_channels(filtered_frame)) {
av_log(NULL, AV_LOG_ERROR,
"Audio filter graph output is not normalized and encoder does not support parameter changes\n");
break;
@@ -1138,6 +1203,115 @@ static int reap_filters(void)
return 0;
}
+static void print_final_stats(int64_t total_size)
+{
+ uint64_t video_size = 0, audio_size = 0, extra_size = 0, other_size = 0;
+ uint64_t subtitle_size = 0;
+ uint64_t data_size = 0;
+ float percent = -1.0;
+ int i, j;
+
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+ switch (ost->st->codec->codec_type) {
+ case AVMEDIA_TYPE_VIDEO: video_size += ost->data_size; break;
+ case AVMEDIA_TYPE_AUDIO: audio_size += ost->data_size; break;
+ case AVMEDIA_TYPE_SUBTITLE: subtitle_size += ost->data_size; break;
+ default: other_size += ost->data_size; break;
+ }
+ extra_size += ost->st->codec->extradata_size;
+ data_size += ost->data_size;
+ }
+
+ if (data_size && total_size >= data_size)
+ percent = 100.0 * (total_size - data_size) / data_size;
+
+ av_log(NULL, AV_LOG_INFO, "\n");
+ av_log(NULL, AV_LOG_INFO, "video:%1.0fkB audio:%1.0fkB subtitle:%1.0fkB other streams:%1.0fkB global headers:%1.0fkB muxing overhead: ",
+ video_size / 1024.0,
+ audio_size / 1024.0,
+ subtitle_size / 1024.0,
+ other_size / 1024.0,
+ extra_size / 1024.0);
+ if (percent >= 0.0)
+ av_log(NULL, AV_LOG_INFO, "%f%%", percent);
+ else
+ av_log(NULL, AV_LOG_INFO, "unknown");
+ av_log(NULL, AV_LOG_INFO, "\n");
+
+ /* print verbose per-stream stats */
+ for (i = 0; i < nb_input_files; i++) {
+ InputFile *f = input_files[i];
+ uint64_t total_packets = 0, total_size = 0;
+
+ av_log(NULL, AV_LOG_VERBOSE, "Input file #%d (%s):\n",
+ i, f->ctx->filename);
+
+ for (j = 0; j < f->nb_streams; j++) {
+ InputStream *ist = input_streams[f->ist_index + j];
+ enum AVMediaType type = ist->st->codec->codec_type;
+
+ total_size += ist->data_size;
+ total_packets += ist->nb_packets;
+
+ av_log(NULL, AV_LOG_VERBOSE, " Input stream #%d:%d (%s): ",
+ i, j, media_type_string(type));
+ av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" packets read (%"PRIu64" bytes); ",
+ ist->nb_packets, ist->data_size);
+
+ if (ist->decoding_needed) {
+ av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" frames decoded",
+ ist->frames_decoded);
+ if (type == AVMEDIA_TYPE_AUDIO)
+ av_log(NULL, AV_LOG_VERBOSE, " (%"PRIu64" samples)", ist->samples_decoded);
+ av_log(NULL, AV_LOG_VERBOSE, "; ");
+ }
+
+ av_log(NULL, AV_LOG_VERBOSE, "\n");
+ }
+
+ av_log(NULL, AV_LOG_VERBOSE, " Total: %"PRIu64" packets (%"PRIu64" bytes) demuxed\n",
+ total_packets, total_size);
+ }
+
+ for (i = 0; i < nb_output_files; i++) {
+ OutputFile *of = output_files[i];
+ uint64_t total_packets = 0, total_size = 0;
+
+ av_log(NULL, AV_LOG_VERBOSE, "Output file #%d (%s):\n",
+ i, of->ctx->filename);
+
+ for (j = 0; j < of->ctx->nb_streams; j++) {
+ OutputStream *ost = output_streams[of->ost_index + j];
+ enum AVMediaType type = ost->st->codec->codec_type;
+
+ total_size += ost->data_size;
+ total_packets += ost->packets_written;
+
+ av_log(NULL, AV_LOG_VERBOSE, " Output stream #%d:%d (%s): ",
+ i, j, media_type_string(type));
+ if (ost->encoding_needed) {
+ av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" frames encoded",
+ ost->frames_encoded);
+ if (type == AVMEDIA_TYPE_AUDIO)
+ av_log(NULL, AV_LOG_VERBOSE, " (%"PRIu64" samples)", ost->samples_encoded);
+ av_log(NULL, AV_LOG_VERBOSE, "; ");
+ }
+
+ av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" packets muxed (%"PRIu64" bytes); ",
+ ost->packets_written, ost->data_size);
+
+ av_log(NULL, AV_LOG_VERBOSE, "\n");
+ }
+
+ av_log(NULL, AV_LOG_VERBOSE, " Total: %"PRIu64" packets (%"PRIu64" bytes) muxed\n",
+ total_packets, total_size);
+ }
+ if(video_size + data_size + audio_size + subtitle_size + extra_size == 0){
+ av_log(NULL, AV_LOG_WARNING, "Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)\n");
+ }
+}
+
static void print_report(int is_last_report, int64_t timer_start, int64_t cur_time)
{
char buf[1024];
@@ -1240,7 +1414,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
vid = 1;
}
/* compute min output value */
- if ((is_last_report || !ost->finished) && ost->st->pts.val != AV_NOPTS_VALUE)
+ if (ost->st->pts.val != AV_NOPTS_VALUE)
pts = FFMAX(pts, av_rescale_q(ost->st->pts.val,
ost->st->time_base, AV_TIME_BASE_Q));
}
@@ -1299,20 +1473,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
}
}
- if (is_last_report) {
- int64_t raw= audio_size + video_size + subtitle_size + extra_size;
- av_log(NULL, AV_LOG_INFO, "\n");
- av_log(NULL, AV_LOG_INFO, "video:%1.0fkB audio:%1.0fkB subtitle:%1.0f global headers:%1.0fkB muxing overhead %f%%\n",
- video_size / 1024.0,
- audio_size / 1024.0,
- subtitle_size / 1024.0,
- extra_size / 1024.0,
- 100.0 * (total_size - raw) / raw
- );
- if(video_size + audio_size + subtitle_size + extra_size == 0){
- av_log(NULL, AV_LOG_WARNING, "Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)\n");
- }
- }
+ if (is_last_report)
+ print_final_stats(total_size);
}
static void flush_encoders(void)
@@ -1336,18 +1498,15 @@ static void flush_encoders(void)
for (;;) {
int (*encode)(AVCodecContext*, AVPacket*, const AVFrame*, int*) = NULL;
const char *desc;
- int64_t *size;
switch (ost->st->codec->codec_type) {
case AVMEDIA_TYPE_AUDIO:
encode = avcodec_encode_audio2;
desc = "Audio";
- size = &audio_size;
break;
case AVMEDIA_TYPE_VIDEO:
encode = avcodec_encode_video2;
desc = "Video";
- size = &video_size;
break;
default:
stop_encoding = 1;
@@ -1355,6 +1514,7 @@ static void flush_encoders(void)
if (encode) {
AVPacket pkt;
+ int pkt_size;
int got_packet;
av_init_packet(&pkt);
pkt.data = NULL;
@@ -1367,7 +1527,6 @@ static void flush_encoders(void)
av_log(NULL, AV_LOG_FATAL, "%s encoding failed\n", desc);
exit_program(1);
}
- *size += pkt.size;
if (ost->logfile && enc->stats_out) {
fprintf(ost->logfile, "%s", enc->stats_out);
}
@@ -1375,15 +1534,20 @@ static void flush_encoders(void)
stop_encoding = 1;
break;
}
+ if (ost->finished & MUXER_FINISHED) {
+ av_free_packet(&pkt);
+ continue;
+ }
if (pkt.pts != AV_NOPTS_VALUE)
pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base);
if (pkt.dts != AV_NOPTS_VALUE)
pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base);
if (pkt.duration > 0)
pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base);
+ pkt_size = pkt.size;
write_frame(os, &pkt, ost);
if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && vstats_filename) {
- do_video_stats(ost, pkt.size);
+ do_video_stats(ost, pkt_size);
}
}
@@ -1404,6 +1568,9 @@ static int check_output_constraints(InputStream *ist, OutputStream *ost)
if (ost->source_index != ist_index)
return 0;
+ if (ost->finished)
+ return 0;
+
if (of->start_time != AV_NOPTS_VALUE && ist->pts < of->start_time)
return 0;
@@ -1453,14 +1620,8 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
}
/* force the input stream PTS */
- if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
- audio_size += pkt->size;
- else if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
- video_size += pkt->size;
+ if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
ost->sync_opts++;
- } else if (ost->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
- subtitle_size += pkt->size;
- }
if (pkt->pts != AV_NOPTS_VALUE)
opkt.pts = av_rescale_q(pkt->pts, ist->st->time_base, ost->st->time_base) - ost_tb_start_time;
@@ -1514,7 +1675,6 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
}
write_frame(of->ctx, &opkt, ost);
- ost->st->codec->frame_number++;
}
int guess_input_channel_layout(InputStream *ist)
@@ -1574,6 +1734,9 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
return ret;
}
+ ist->samples_decoded += decoded_frame->nb_samples;
+ ist->frames_decoded++;
+
#if 1
/* increment next_dts to use for the case where the input stream does not
have timestamps or there are multiple frames in the packet */
@@ -1641,16 +1804,15 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
decoded_frame_tb = avctx->time_base;
} else if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) {
decoded_frame->pts = decoded_frame->pkt_pts;
- pkt->pts = AV_NOPTS_VALUE;
decoded_frame_tb = ist->st->time_base;
} else if (pkt->pts != AV_NOPTS_VALUE) {
decoded_frame->pts = pkt->pts;
- pkt->pts = AV_NOPTS_VALUE;
decoded_frame_tb = ist->st->time_base;
}else {
decoded_frame->pts = ist->dts;
decoded_frame_tb = AV_TIME_BASE_Q;
}
+ pkt->pts = AV_NOPTS_VALUE;
if (decoded_frame->pts != AV_NOPTS_VALUE)
decoded_frame->pts = av_rescale_delta(decoded_frame_tb, decoded_frame->pts,
(AVRational){1, ist->st->codec->sample_rate}, decoded_frame->nb_samples, &ist->filter_in_rescale_delta_last,
@@ -1714,6 +1876,8 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
if(ist->top_field_first>=0)
decoded_frame->top_field_first = ist->top_field_first;
+ ist->frames_decoded++;
+
if (ist->hwaccel_retrieve_data && decoded_frame->format == ist->hwaccel_pix_fmt) {
err = ist->hwaccel_retrieve_data(ist->st->codec, decoded_frame);
if (err < 0)
@@ -1727,12 +1891,13 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
if (debug_ts) {
av_log(NULL, AV_LOG_INFO, "decoder -> ist_index:%d type:video "
- "frame_pts:%s frame_pts_time:%s best_effort_ts:%"PRId64" best_effort_ts_time:%s keyframe:%d frame_type:%d \n",
- ist->st->index, av_ts2str(decoded_frame->pts),
- av_ts2timestr(decoded_frame->pts, &ist->st->time_base),
- best_effort_timestamp,
- av_ts2timestr(best_effort_timestamp, &ist->st->time_base),
- decoded_frame->key_frame, decoded_frame->pict_type);
+ "frame_pts:%s frame_pts_time:%s best_effort_ts:%"PRId64" best_effort_ts_time:%s keyframe:%d frame_type:%d time_base:%d/%d\n",
+ ist->st->index, av_ts2str(decoded_frame->pts),
+ av_ts2timestr(decoded_frame->pts, &ist->st->time_base),
+ best_effort_timestamp,
+ av_ts2timestr(best_effort_timestamp, &ist->st->time_base),
+ decoded_frame->key_frame, decoded_frame->pict_type,
+ ist->st->time_base.num, ist->st->time_base.den);
}
pkt->size = 0;
@@ -1834,10 +1999,13 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
if (!subtitle.num_rects)
goto out;
+ ist->frames_decoded++;
+
for (i = 0; i < nb_output_streams; i++) {
OutputStream *ost = output_streams[i];
- if (!check_output_constraints(ist, ost) || !ost->encoding_needed)
+ if (!check_output_constraints(ist, ost) || !ost->encoding_needed
+ || ost->enc->type != AVMEDIA_TYPE_SUBTITLE)
continue;
do_subtitle_out(output_files[ost->file_index]->ctx, ost, ist, &subtitle);
@@ -1894,7 +2062,8 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
ist->pts = ist->next_pts;
ist->dts = ist->next_dts;
- if (avpkt.size && avpkt.size != pkt->size) {
+ if (avpkt.size && avpkt.size != pkt->size &&
+ !(ist->dec->capabilities & CODEC_CAP_SUBFRAMES)) {
av_log(NULL, ist->showed_multi_packet_warning ? AV_LOG_VERBOSE : AV_LOG_WARNING,
"Multiple frames in a packet from stream %d\n", pkt->stream_index);
ist->showed_multi_packet_warning = 1;
@@ -1992,7 +2161,7 @@ static void print_sdp(void)
{
char sdp[16384];
int i;
- AVFormatContext **avc = av_malloc(sizeof(*avc) * nb_output_files);
+ AVFormatContext **avc = av_malloc_array(nb_output_files, sizeof(*avc));
if (!avc)
exit_program(1);
@@ -2082,27 +2251,23 @@ static int init_input_stream(int ist_index, char *error, int error_len)
av_opt_set_int(ist->st->codec, "refcounted_frames", 1, 0);
- if (!av_dict_get(ist->opts, "threads", NULL, 0))
- av_dict_set(&ist->opts, "threads", "auto", 0);
- if ((ret = avcodec_open2(ist->st->codec, codec, &ist->opts)) < 0) {
- char errbuf[128];
+ if (!av_dict_get(ist->decoder_opts, "threads", NULL, 0))
+ av_dict_set(&ist->decoder_opts, "threads", "auto", 0);
+ if ((ret = avcodec_open2(ist->st->codec, codec, &ist->decoder_opts)) < 0) {
if (ret == AVERROR_EXPERIMENTAL)
abort_codec_experimental(codec, 0);
- av_strerror(ret, errbuf, sizeof(errbuf));
-
snprintf(error, error_len,
"Error while opening decoder for input stream "
"#%d:%d : %s",
- ist->file_index, ist->st->index, errbuf);
+ ist->file_index, ist->st->index, av_err2str(ret));
return ret;
}
- assert_avoptions(ist->opts);
+ assert_avoptions(ist->decoder_opts);
}
ist->next_pts = AV_NOPTS_VALUE;
ist->next_dts = AV_NOPTS_VALUE;
- ist->is_start = 1;
return 0;
}
@@ -2131,7 +2296,7 @@ static void parse_forced_key_frames(char *kf, OutputStream *ost,
if (*p == ',')
n++;
size = n;
- pts = av_malloc(sizeof(*pts) * size);
+ pts = av_malloc_array(size, sizeof(*pts));
if (!pts) {
av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n");
exit_program(1);
@@ -2202,7 +2367,6 @@ static int transcode_init(void)
{
int ret = 0, i, j, k;
AVFormatContext *oc;
- AVCodecContext *codec;
OutputStream *ost;
InputStream *ist;
char error[1024];
@@ -2248,7 +2412,8 @@ static int transcode_init(void)
/* for each output stream, we compute the right encoding parameters */
for (i = 0; i < nb_output_streams; i++) {
- AVCodecContext *icodec = NULL;
+ AVCodecContext *enc_ctx;
+ AVCodecContext *dec_ctx = NULL;
ost = output_streams[i];
oc = output_files[ost->file_index]->ctx;
ist = get_input_stream(ost);
@@ -2256,22 +2421,22 @@ static int transcode_init(void)
if (ost->attachment_filename)
continue;
- codec = ost->st->codec;
+ enc_ctx = ost->st->codec;
if (ist) {
- icodec = ist->st->codec;
+ dec_ctx = ist->st->codec;
ost->st->disposition = ist->st->disposition;
- codec->bits_per_raw_sample = icodec->bits_per_raw_sample;
- codec->chroma_sample_location = icodec->chroma_sample_location;
+ enc_ctx->bits_per_raw_sample = dec_ctx->bits_per_raw_sample;
+ enc_ctx->chroma_sample_location = dec_ctx->chroma_sample_location;
} else {
for (j=0; j<oc->nb_streams; j++) {
AVStream *st = oc->streams[j];
- if (st != ost->st && st->codec->codec_type == codec->codec_type)
+ if (st != ost->st && st->codec->codec_type == enc_ctx->codec_type)
break;
}
if (j == oc->nb_streams)
- if (codec->codec_type == AVMEDIA_TYPE_AUDIO || codec->codec_type == AVMEDIA_TYPE_VIDEO)
+ if (enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO || enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO)
ost->st->disposition = AV_DISPOSITION_DEFAULT;
}
@@ -2281,37 +2446,37 @@ static int transcode_init(void)
av_assert0(ist && !ost->filter);
- extra_size = (uint64_t)icodec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE;
+ extra_size = (uint64_t)dec_ctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE;
if (extra_size > INT_MAX) {
return AVERROR(EINVAL);
}
/* if stream_copy is selected, no need to decode or encode */
- codec->codec_id = icodec->codec_id;
- codec->codec_type = icodec->codec_type;
+ enc_ctx->codec_id = dec_ctx->codec_id;
+ enc_ctx->codec_type = dec_ctx->codec_type;
- if (!codec->codec_tag) {
+ if (!enc_ctx->codec_tag) {
unsigned int codec_tag;
if (!oc->oformat->codec_tag ||
- av_codec_get_id (oc->oformat->codec_tag, icodec->codec_tag) == codec->codec_id ||
- !av_codec_get_tag2(oc->oformat->codec_tag, icodec->codec_id, &codec_tag))
- codec->codec_tag = icodec->codec_tag;
+ av_codec_get_id (oc->oformat->codec_tag, dec_ctx->codec_tag) == enc_ctx->codec_id ||
+ !av_codec_get_tag2(oc->oformat->codec_tag, dec_ctx->codec_id, &codec_tag))
+ enc_ctx->codec_tag = dec_ctx->codec_tag;
}
- codec->bit_rate = icodec->bit_rate;
- codec->rc_max_rate = icodec->rc_max_rate;
- codec->rc_buffer_size = icodec->rc_buffer_size;
- codec->field_order = icodec->field_order;
- codec->extradata = av_mallocz(extra_size);
- if (!codec->extradata) {
+ enc_ctx->bit_rate = dec_ctx->bit_rate;
+ enc_ctx->rc_max_rate = dec_ctx->rc_max_rate;
+ enc_ctx->rc_buffer_size = dec_ctx->rc_buffer_size;
+ enc_ctx->field_order = dec_ctx->field_order;
+ enc_ctx->extradata = av_mallocz(extra_size);
+ if (!enc_ctx->extradata) {
return AVERROR(ENOMEM);
}
- memcpy(codec->extradata, icodec->extradata, icodec->extradata_size);
- codec->extradata_size= icodec->extradata_size;
- codec->bits_per_coded_sample = icodec->bits_per_coded_sample;
+ memcpy(enc_ctx->extradata, dec_ctx->extradata, dec_ctx->extradata_size);
+ enc_ctx->extradata_size= dec_ctx->extradata_size;
+ enc_ctx->bits_per_coded_sample = dec_ctx->bits_per_coded_sample;
- codec->time_base = ist->st->time_base;
+ enc_ctx->time_base = ist->st->time_base;
/*
* Avi is a special case here because it supports variable fps but
* having the fps and timebase differe significantly adds quite some
@@ -2320,89 +2485,90 @@ static int transcode_init(void)
if(!strcmp(oc->oformat->name, "avi")) {
if ( copy_tb<0 && av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(ist->st->time_base)
- && 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(icodec->time_base)
- && av_q2d(ist->st->time_base) < 1.0/500 && av_q2d(icodec->time_base) < 1.0/500
+ && 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(dec_ctx->time_base)
+ && av_q2d(ist->st->time_base) < 1.0/500 && av_q2d(dec_ctx->time_base) < 1.0/500
|| copy_tb==2){
- codec->time_base.num = ist->st->r_frame_rate.den;
- codec->time_base.den = 2*ist->st->r_frame_rate.num;
- codec->ticks_per_frame = 2;
- } else if ( copy_tb<0 && av_q2d(icodec->time_base)*icodec->ticks_per_frame > 2*av_q2d(ist->st->time_base)
+ enc_ctx->time_base.num = ist->st->r_frame_rate.den;
+ enc_ctx->time_base.den = 2*ist->st->r_frame_rate.num;
+ enc_ctx->ticks_per_frame = 2;
+ } else if ( copy_tb<0 && av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > 2*av_q2d(ist->st->time_base)
&& av_q2d(ist->st->time_base) < 1.0/500
|| copy_tb==0){
- codec->time_base = icodec->time_base;
- codec->time_base.num *= icodec->ticks_per_frame;
- codec->time_base.den *= 2;
- codec->ticks_per_frame = 2;
+ enc_ctx->time_base = dec_ctx->time_base;
+ enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
+ enc_ctx->time_base.den *= 2;
+ enc_ctx->ticks_per_frame = 2;
}
} else if(!(oc->oformat->flags & AVFMT_VARIABLE_FPS)
&& strcmp(oc->oformat->name, "mov") && strcmp(oc->oformat->name, "mp4") && strcmp(oc->oformat->name, "3gp")
&& strcmp(oc->oformat->name, "3g2") && strcmp(oc->oformat->name, "psp") && strcmp(oc->oformat->name, "ipod")
&& strcmp(oc->oformat->name, "f4v")
) {
- if( copy_tb<0 && icodec->time_base.den
- && av_q2d(icodec->time_base)*icodec->ticks_per_frame > av_q2d(ist->st->time_base)
+ if( copy_tb<0 && dec_ctx->time_base.den
+ && av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > av_q2d(ist->st->time_base)
&& av_q2d(ist->st->time_base) < 1.0/500
|| copy_tb==0){
- codec->time_base = icodec->time_base;
- codec->time_base.num *= icodec->ticks_per_frame;
+ enc_ctx->time_base = dec_ctx->time_base;
+ enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
}
}
- if ( codec->codec_tag == AV_RL32("tmcd")
- && icodec->time_base.num < icodec->time_base.den
- && icodec->time_base.num > 0
- && 121LL*icodec->time_base.num > icodec->time_base.den) {
- codec->time_base = icodec->time_base;
+ if ( enc_ctx->codec_tag == AV_RL32("tmcd")
+ && dec_ctx->time_base.num < dec_ctx->time_base.den
+ && dec_ctx->time_base.num > 0
+ && 121LL*dec_ctx->time_base.num > dec_ctx->time_base.den) {
+ enc_ctx->time_base = dec_ctx->time_base;
}
if (ist && !ost->frame_rate.num)
ost->frame_rate = ist->framerate;
if(ost->frame_rate.num)
- codec->time_base = av_inv_q(ost->frame_rate);
+ enc_ctx->time_base = av_inv_q(ost->frame_rate);
- av_reduce(&codec->time_base.num, &codec->time_base.den,
- codec->time_base.num, codec->time_base.den, INT_MAX);
+ av_reduce(&enc_ctx->time_base.num, &enc_ctx->time_base.den,
+ enc_ctx->time_base.num, enc_ctx->time_base.den, INT_MAX);
- ost->parser = av_parser_init(codec->codec_id);
+ ost->parser = av_parser_init(enc_ctx->codec_id);
- switch (codec->codec_type) {
+ switch (enc_ctx->codec_type) {
case AVMEDIA_TYPE_AUDIO:
if (audio_volume != 256) {
av_log(NULL, AV_LOG_FATAL, "-acodec copy and -vol are incompatible (frames are not decoded)\n");
exit_program(1);
}
- codec->channel_layout = icodec->channel_layout;
- codec->sample_rate = icodec->sample_rate;
- codec->channels = icodec->channels;
- codec->frame_size = icodec->frame_size;
- codec->audio_service_type = icodec->audio_service_type;
- codec->block_align = icodec->block_align;
- if((codec->block_align == 1 || codec->block_align == 1152 || codec->block_align == 576) && codec->codec_id == AV_CODEC_ID_MP3)
- codec->block_align= 0;
- if(codec->codec_id == AV_CODEC_ID_AC3)
- codec->block_align= 0;
+ enc_ctx->channel_layout = dec_ctx->channel_layout;
+ enc_ctx->sample_rate = dec_ctx->sample_rate;
+ enc_ctx->channels = dec_ctx->channels;
+ enc_ctx->frame_size = dec_ctx->frame_size;
+ enc_ctx->audio_service_type = dec_ctx->audio_service_type;
+ enc_ctx->block_align = dec_ctx->block_align;
+ enc_ctx->delay = dec_ctx->delay;
+ if((enc_ctx->block_align == 1 || enc_ctx->block_align == 1152 || enc_ctx->block_align == 576) && enc_ctx->codec_id == AV_CODEC_ID_MP3)
+ enc_ctx->block_align= 0;
+ if(enc_ctx->codec_id == AV_CODEC_ID_AC3)
+ enc_ctx->block_align= 0;
break;
case AVMEDIA_TYPE_VIDEO:
- codec->pix_fmt = icodec->pix_fmt;
- codec->width = icodec->width;
- codec->height = icodec->height;
- codec->has_b_frames = icodec->has_b_frames;
+ enc_ctx->pix_fmt = dec_ctx->pix_fmt;
+ enc_ctx->width = dec_ctx->width;
+ enc_ctx->height = dec_ctx->height;
+ enc_ctx->has_b_frames = dec_ctx->has_b_frames;
if (ost->frame_aspect_ratio.num) { // overridden by the -aspect cli option
sar =
av_mul_q(ost->frame_aspect_ratio,
- (AVRational){ codec->height, codec->width });
+ (AVRational){ enc_ctx->height, enc_ctx->width });
av_log(NULL, AV_LOG_WARNING, "Overriding aspect ratio "
"with stream copy may produce invalid files\n");
}
else if (ist->st->sample_aspect_ratio.num)
sar = ist->st->sample_aspect_ratio;
else
- sar = icodec->sample_aspect_ratio;
- ost->st->sample_aspect_ratio = codec->sample_aspect_ratio = sar;
+ sar = dec_ctx->sample_aspect_ratio;
+ ost->st->sample_aspect_ratio = enc_ctx->sample_aspect_ratio = sar;
ost->st->avg_frame_rate = ist->st->avg_frame_rate;
break;
case AVMEDIA_TYPE_SUBTITLE:
- codec->width = icodec->width;
- codec->height = icodec->height;
+ enc_ctx->width = dec_ctx->width;
+ enc_ctx->height = dec_ctx->height;
break;
case AVMEDIA_TYPE_DATA:
case AVMEDIA_TYPE_ATTACHMENT:
@@ -2412,7 +2578,7 @@ static int transcode_init(void)
}
} else {
if (!ost->enc)
- ost->enc = avcodec_find_encoder(codec->codec_id);
+ ost->enc = avcodec_find_encoder(enc_ctx->codec_id);
if (!ost->enc) {
/* should only happen when a default codec is not present. */
snprintf(error, sizeof(error), "Encoder (codec %s) not found for output stream #%d:%d",
@@ -2426,8 +2592,8 @@ static int transcode_init(void)
ost->encoding_needed = 1;
if (!ost->filter &&
- (codec->codec_type == AVMEDIA_TYPE_VIDEO ||
- codec->codec_type == AVMEDIA_TYPE_AUDIO)) {
+ (enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO ||
+ enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO)) {
FilterGraph *fg;
fg = init_simple_filtergraph(ist, ost);
if (configure_filtergraph(fg)) {
@@ -2436,33 +2602,46 @@ static int transcode_init(void)
}
}
- if (codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {
if (ost->filter && !ost->frame_rate.num)
ost->frame_rate = av_buffersink_get_frame_rate(ost->filter->filter);
if (ist && !ost->frame_rate.num)
ost->frame_rate = ist->framerate;
if (ist && !ost->frame_rate.num)
- ost->frame_rate = ist->st->r_frame_rate.num ? ist->st->r_frame_rate : (AVRational){25, 1};
+ ost->frame_rate = ist->st->r_frame_rate;
+ if (ist && !ost->frame_rate.num) {
+ ost->frame_rate = (AVRational){25, 1};
+ av_log(NULL, AV_LOG_WARNING,
+ "No information "
+ "about the input framerate is available. Falling "
+ "back to a default value of 25fps for output stream #%d:%d. Use the -r option "
+ "if you want a different framerate.\n",
+ ost->file_index, ost->index);
+ }
// ost->frame_rate = ist->st->avg_frame_rate.num ? ist->st->avg_frame_rate : (AVRational){25, 1};
if (ost->enc && ost->enc->supported_framerates && !ost->force_fps) {
int idx = av_find_nearest_q_idx(ost->frame_rate, ost->enc->supported_framerates);
ost->frame_rate = ost->enc->supported_framerates[idx];
}
+ if (enc_ctx->codec_id == AV_CODEC_ID_MPEG4) {
+ av_reduce(&ost->frame_rate.num, &ost->frame_rate.den,
+ ost->frame_rate.num, ost->frame_rate.den, 65535);
+ }
}
- switch (codec->codec_type) {
+ switch (enc_ctx->codec_type) {
case AVMEDIA_TYPE_AUDIO:
- codec->sample_fmt = ost->filter->filter->inputs[0]->format;
- codec->sample_rate = ost->filter->filter->inputs[0]->sample_rate;
- codec->channel_layout = ost->filter->filter->inputs[0]->channel_layout;
- codec->channels = avfilter_link_get_channels(ost->filter->filter->inputs[0]);
- codec->time_base = (AVRational){ 1, codec->sample_rate };
+ enc_ctx->sample_fmt = ost->filter->filter->inputs[0]->format;
+ enc_ctx->sample_rate = ost->filter->filter->inputs[0]->sample_rate;
+ enc_ctx->channel_layout = ost->filter->filter->inputs[0]->channel_layout;
+ enc_ctx->channels = avfilter_link_get_channels(ost->filter->filter->inputs[0]);
+ enc_ctx->time_base = (AVRational){ 1, enc_ctx->sample_rate };
break;
case AVMEDIA_TYPE_VIDEO:
- codec->time_base = av_inv_q(ost->frame_rate);
- if (ost->filter && !(codec->time_base.num && codec->time_base.den))
- codec->time_base = ost->filter->filter->inputs[0]->time_base;
- if ( av_q2d(codec->time_base) < 0.001 && video_sync_method != VSYNC_PASSTHROUGH
+ enc_ctx->time_base = av_inv_q(ost->frame_rate);
+ if (ost->filter && !(enc_ctx->time_base.num && enc_ctx->time_base.den))
+ enc_ctx->time_base = ost->filter->filter->inputs[0]->time_base;
+ if ( av_q2d(enc_ctx->time_base) < 0.001 && video_sync_method != VSYNC_PASSTHROUGH
&& (video_sync_method == VSYNC_CFR || video_sync_method == VSYNC_VSCFR || (video_sync_method == VSYNC_AUTO && !(oc->oformat->flags & AVFMT_VARIABLE_FPS)))){
av_log(oc, AV_LOG_WARNING, "Frame rate very high for a muxer not efficiently supporting it.\n"
"Please consider specifying a lower framerate, a different muxer or -vsync 2\n");
@@ -2470,35 +2649,35 @@ static int transcode_init(void)
for (j = 0; j < ost->forced_kf_count; j++)
ost->forced_kf_pts[j] = av_rescale_q(ost->forced_kf_pts[j],
AV_TIME_BASE_Q,
- codec->time_base);
+ enc_ctx->time_base);
- codec->width = ost->filter->filter->inputs[0]->w;
- codec->height = ost->filter->filter->inputs[0]->h;
- codec->sample_aspect_ratio = ost->st->sample_aspect_ratio =
+ enc_ctx->width = ost->filter->filter->inputs[0]->w;
+ enc_ctx->height = ost->filter->filter->inputs[0]->h;
+ enc_ctx->sample_aspect_ratio = ost->st->sample_aspect_ratio =
ost->frame_aspect_ratio.num ? // overridden by the -aspect cli option
- av_mul_q(ost->frame_aspect_ratio, (AVRational){ codec->height, codec->width }) :
+ av_mul_q(ost->frame_aspect_ratio, (AVRational){ enc_ctx->height, enc_ctx->width }) :
ost->filter->filter->inputs[0]->sample_aspect_ratio;
if (!strncmp(ost->enc->name, "libx264", 7) &&
- codec->pix_fmt == AV_PIX_FMT_NONE &&
+ enc_ctx->pix_fmt == AV_PIX_FMT_NONE &&
ost->filter->filter->inputs[0]->format != AV_PIX_FMT_YUV420P)
av_log(NULL, AV_LOG_WARNING,
"No pixel format specified, %s for H.264 encoding chosen.\n"
"Use -pix_fmt yuv420p for compatibility with outdated media players.\n",
av_get_pix_fmt_name(ost->filter->filter->inputs[0]->format));
if (!strncmp(ost->enc->name, "mpeg2video", 10) &&
- codec->pix_fmt == AV_PIX_FMT_NONE &&
+ enc_ctx->pix_fmt == AV_PIX_FMT_NONE &&
ost->filter->filter->inputs[0]->format != AV_PIX_FMT_YUV420P)
av_log(NULL, AV_LOG_WARNING,
"No pixel format specified, %s for MPEG-2 encoding chosen.\n"
"Use -pix_fmt yuv420p for compatibility with outdated media players.\n",
av_get_pix_fmt_name(ost->filter->filter->inputs[0]->format));
- codec->pix_fmt = ost->filter->filter->inputs[0]->format;
+ enc_ctx->pix_fmt = ost->filter->filter->inputs[0]->format;
- if (!icodec ||
- codec->width != icodec->width ||
- codec->height != icodec->height ||
- codec->pix_fmt != icodec->pix_fmt) {
- codec->bits_per_raw_sample = frame_bits_per_raw_sample;
+ if (!dec_ctx ||
+ enc_ctx->width != dec_ctx->width ||
+ enc_ctx->height != dec_ctx->height ||
+ enc_ctx->pix_fmt != dec_ctx->pix_fmt) {
+ enc_ctx->bits_per_raw_sample = frame_bits_per_raw_sample;
}
if (ost->forced_keyframes) {
@@ -2520,10 +2699,10 @@ static int transcode_init(void)
}
break;
case AVMEDIA_TYPE_SUBTITLE:
- codec->time_base = (AVRational){1, 1000};
- if (!codec->width) {
- codec->width = input_streams[ost->source_index]->st->codec->width;
- codec->height = input_streams[ost->source_index]->st->codec->height;
+ enc_ctx->time_base = (AVRational){1, 1000};
+ if (!enc_ctx->width) {
+ enc_ctx->width = input_streams[ost->source_index]->st->codec->width;
+ enc_ctx->height = input_streams[ost->source_index]->st->codec->height;
}
break;
default:
@@ -2531,7 +2710,7 @@ static int transcode_init(void)
break;
}
/* two pass mode */
- if (codec->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2)) {
+ if (enc_ctx->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2)) {
char logfilename[1024];
FILE *f;
@@ -2540,9 +2719,9 @@ static int transcode_init(void)
DEFAULT_PASS_LOGFILENAME_PREFIX,
i);
if (!strcmp(ost->enc->name, "libx264")) {
- av_dict_set(&ost->opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
+ av_dict_set(&ost->encoder_opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
} else {
- if (codec->flags & CODEC_FLAG_PASS2) {
+ if (enc_ctx->flags & CODEC_FLAG_PASS2) {
char *logbuffer;
size_t logbuffer_size;
if (cmdutils_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
@@ -2550,9 +2729,9 @@ static int transcode_init(void)
logfilename);
exit_program(1);
}
- codec->stats_in = logbuffer;
+ enc_ctx->stats_in = logbuffer;
}
- if (codec->flags & CODEC_FLAG_PASS1) {
+ if (enc_ctx->flags & CODEC_FLAG_PASS1) {
f = av_fopen_utf8(logfilename, "wb");
if (!f) {
av_log(NULL, AV_LOG_FATAL, "Cannot write log file '%s' for pass-1 encoding: %s\n",
@@ -2585,9 +2764,9 @@ static int transcode_init(void)
memcpy(ost->st->codec->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
ost->st->codec->subtitle_header_size = dec->subtitle_header_size;
}
- if (!av_dict_get(ost->opts, "threads", NULL, 0))
- av_dict_set(&ost->opts, "threads", "auto", 0);
- if ((ret = avcodec_open2(ost->st->codec, codec, &ost->opts)) < 0) {
+ if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
+ av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
+ if ((ret = avcodec_open2(ost->st->codec, codec, &ost->encoder_opts)) < 0) {
if (ret == AVERROR_EXPERIMENTAL)
abort_codec_experimental(codec, 1);
snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height",
@@ -2598,13 +2777,12 @@ static int transcode_init(void)
!(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
av_buffersink_set_frame_size(ost->filter->filter,
ost->st->codec->frame_size);
- assert_avoptions(ost->opts);
+ assert_avoptions(ost->encoder_opts);
if (ost->st->codec->bit_rate && ost->st->codec->bit_rate < 1000)
av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
" It takes bits/s as argument, not kbits/s\n");
- extra_size += ost->st->codec->extradata_size;
} else {
- av_opt_set_dict(ost->st->codec, &ost->opts);
+ av_opt_set_dict(ost->st->codec, &ost->encoder_opts);
}
}
@@ -2639,12 +2817,10 @@ static int transcode_init(void)
oc = output_files[i]->ctx;
oc->interrupt_callback = int_cb;
if ((ret = avformat_write_header(oc, &output_files[i]->opts)) < 0) {
- char errbuf[128];
- av_strerror(ret, errbuf, sizeof(errbuf));
snprintf(error, sizeof(error),
"Could not write header for output file #%d "
"(incorrect codec parameters ?): %s",
- i, errbuf);
+ i, av_err2str(ret));
ret = AVERROR(EINVAL);
goto dump_format;
}
@@ -2726,6 +2902,8 @@ static int transcode_init(void)
print_sdp();
}
+ transcode_init_done = 1;
+
return 0;
}
@@ -2898,11 +3076,15 @@ static void *input_thread(void *arg)
av_dup_packet(&pkt);
av_fifo_generic_write(f->fifo, &pkt, sizeof(pkt), NULL);
+ pthread_cond_signal(&f->fifo_cond);
pthread_mutex_unlock(&f->fifo_lock);
}
+ pthread_mutex_lock(&f->fifo_lock);
f->finished = 1;
+ pthread_cond_signal(&f->fifo_cond);
+ pthread_mutex_unlock(&f->fifo_lock);
return NULL;
}
@@ -2937,7 +3119,7 @@ static void free_input_threads(void)
av_fifo_generic_read(f->fifo, &pkt, sizeof(pkt), NULL);
av_free_packet(&pkt);
}
- av_fifo_free(f->fifo);
+ av_fifo_freep(&f->fifo);
}
}
@@ -2954,6 +3136,10 @@ static int init_input_threads(void)
if (!(f->fifo = av_fifo_alloc(8*sizeof(AVPacket))))
return AVERROR(ENOMEM);
+ if (f->ctx->pb ? !f->ctx->pb->seekable :
+ strcmp(f->ctx->iformat->name, "lavfi"))
+ f->non_blocking = 1;
+
pthread_mutex_init(&f->fifo_lock, NULL);
pthread_cond_init (&f->fifo_cond, NULL);
@@ -2969,14 +3155,22 @@ static int get_input_packet_mt(InputFile *f, AVPacket *pkt)
pthread_mutex_lock(&f->fifo_lock);
+ while (1) {
if (av_fifo_size(f->fifo)) {
av_fifo_generic_read(f->fifo, pkt, sizeof(*pkt), NULL);
pthread_cond_signal(&f->fifo_cond);
+ break;
} else {
- if (f->finished)
+ if (f->finished) {
ret = AVERROR_EOF;
- else
+ break;
+ }
+ if (f->non_blocking) {
ret = AVERROR(EAGAIN);
+ break;
+ }
+ pthread_cond_wait(&f->fifo_cond, &f->fifo_lock);
+ }
}
pthread_mutex_unlock(&f->fifo_lock);
@@ -3085,6 +3279,10 @@ static int process_input(int file_index)
}
ist = input_streams[ifile->ist_index + pkt.stream_index];
+
+ ist->data_size += pkt.size;
+ ist->nb_packets++;
+
if (ist->discard)
goto discard_packet;
@@ -3135,6 +3333,24 @@ static int process_input(int file_index)
}
}
+ /* add the stream-global side data to the first packet */
+ if (ist->nb_packets == 1)
+ if (ist->st->nb_side_data)
+ av_packet_split_side_data(&pkt);
+ for (i = 0; i < ist->st->nb_side_data; i++) {
+ AVPacketSideData *src_sd = &ist->st->side_data[i];
+ uint8_t *dst_data;
+
+ if (av_packet_get_side_data(&pkt, src_sd->type, NULL))
+ continue;
+
+ dst_data = av_packet_new_side_data(&pkt, src_sd->type, src_sd->size);
+ if (!dst_data)
+ exit_program(1);
+
+ memcpy(dst_data, src_sd->data, src_sd->size);
+ }
+
if (pkt.dts != AV_NOPTS_VALUE)
pkt.dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base);
if (pkt.pts != AV_NOPTS_VALUE)
@@ -3167,22 +3383,21 @@ static int process_input(int file_index)
int64_t pkt_dts = av_rescale_q(pkt.dts, ist->st->time_base, AV_TIME_BASE_Q);
int64_t delta = pkt_dts - ist->next_dts;
if (is->iformat->flags & AVFMT_TS_DISCONT) {
- if(delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
- (delta > 1LL*dts_delta_threshold*AV_TIME_BASE &&
- ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) ||
- pkt_dts + AV_TIME_BASE/10 < ist->pts){
- ifile->ts_offset -= delta;
- av_log(NULL, AV_LOG_DEBUG,
- "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n",
- delta, ifile->ts_offset);
- pkt.dts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base);
- if (pkt.pts != AV_NOPTS_VALUE)
- pkt.pts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base);
- }
+ if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
+ (delta > 1LL*dts_delta_threshold*AV_TIME_BASE &&
+ ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) ||
+ pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) {
+ ifile->ts_offset -= delta;
+ av_log(NULL, AV_LOG_DEBUG,
+ "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n",
+ delta, ifile->ts_offset);
+ pkt.dts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base);
+ if (pkt.pts != AV_NOPTS_VALUE)
+ pkt.pts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base);
+ }
} else {
if ( delta < -1LL*dts_error_threshold*AV_TIME_BASE ||
- (delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)
- ) {
+ (delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)) {
av_log(NULL, AV_LOG_WARNING, "DTS %"PRId64", next:%"PRId64" st:%d invalid dropping\n", pkt.dts, ist->next_dts, pkt.stream_index);
pkt.dts = AV_NOPTS_VALUE;
}
@@ -3190,8 +3405,7 @@ static int process_input(int file_index)
int64_t pkt_pts = av_rescale_q(pkt.pts, ist->st->time_base, AV_TIME_BASE_Q);
delta = pkt_pts - ist->next_dts;
if ( delta < -1LL*dts_error_threshold*AV_TIME_BASE ||
- (delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)
- ) {
+ (delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)) {
av_log(NULL, AV_LOG_WARNING, "PTS %"PRId64", next:%"PRId64" invalid dropping st:%d\n", pkt.pts, ist->next_dts, pkt.stream_index);
pkt.pts = AV_NOPTS_VALUE;
}
@@ -3215,10 +3429,8 @@ static int process_input(int file_index)
ret = output_packet(ist, &pkt);
if (ret < 0) {
- char buf[128];
- av_strerror(ret, buf, sizeof(buf));
av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d: %s\n",
- ist->file_index, ist->st->index, buf);
+ ist->file_index, ist->st->index, av_err2str(ret));
if (exit_on_error)
exit_program(1);
}
@@ -3437,7 +3649,7 @@ static int transcode(void)
av_freep(&ost->st->codec->subtitle_header);
av_freep(&ost->forced_kf_pts);
av_freep(&ost->apad);
- av_dict_free(&ost->opts);
+ av_dict_free(&ost->encoder_opts);
av_dict_free(&ost->swr_opts);
av_dict_free(&ost->resample_opts);
}
@@ -3552,6 +3764,6 @@ int main(int argc, char **argv)
if ((decode_error_stat[0] + decode_error_stat[1]) * max_error_rate < decode_error_stat[1])
exit_program(69);
- exit_program(received_nb_signals ? 255 : 0);
- return 0;
+ exit_program(received_nb_signals ? 255 : main_return_code);
+ return main_return_code;
}
diff --git a/chromium/third_party/ffmpeg/ffmpeg.gyp b/chromium/third_party/ffmpeg/ffmpeg.gyp
index b7b8bd56f85..52f8f73b2a7 100644
--- a/chromium/third_party/ffmpeg/ffmpeg.gyp
+++ b/chromium/third_party/ffmpeg/ffmpeg.gyp
@@ -30,9 +30,22 @@
'win_debug_Optimization': '2',
# Run time checks are incompatible with any level of optimizations.
'win_debug_RuntimeChecks': '0',
+ 'conditions': [
+ ['OS == "win"', {
+ # Setting the optimizations to 'speed' or to 'max' results in a lot of
+ # unresolved symbols. The only supported mode is 'size' (see
+ # crbug.com/264459).
+ 'optimize' :'size',
+ }],
+ ],
},
},
'variables': {
+ # Make sure asm_sources is always defined even if an arch doesn't have any
+ # asm sources (e.g. mips or x86 with forcefully disabled asm).
+ 'asm_sources': [
+ ],
+
# Allow overriding the selection of which FFmpeg binaries to copy via an
# environment variable. Affects the ffmpeg_binaries target.
'conditions': [
@@ -42,19 +55,16 @@
}, {
'ffmpeg_config%': '<(target_arch)',
}],
- ['target_arch == "mipsel"', {
- 'asm_sources': [
- ],
- }],
- ['OS == "win" and (MSVS_VERSION == "2013" or MSVS_VERSION == "2013e")', {
- 'os_config%': 'win-vs2013',
- }, {
+ ['OS == "mac" or OS == "win" or OS == "openbsd"', {
+ 'os_config%': '<(OS)',
+ }, { # all other Unix OS's use the linux config
'conditions': [
- ['OS == "mac" or OS == "win" or OS == "openbsd"', {
- 'os_config%': '<(OS)',
- }, { # all other Unix OS's use the linux config
+ ['msan==1', {
+ # MemorySanitizer doesn't like assembly code.
+ 'os_config%': 'linux-noasm',
+ }, {
'os_config%': 'linux',
- }],
+ }]
],
}],
['chromeos == 1', {
@@ -64,8 +74,6 @@
}],
],
- 'ffmpeg_variant%': '<(target_arch)',
-
'build_ffmpegsumo%': 1,
# Locations for generated artifacts.
@@ -77,15 +85,11 @@
'extra_header': 'chromium/ffmpeg_stub_headers.fragment',
},
'conditions': [
- ['target_arch != "arm"', {
+ ['target_arch != "arm" and os_config != "linux-noasm"', {
'targets': [
{
'target_name': 'ffmpeg_yasm',
'type': 'static_library',
- # VS2010 does not correctly incrementally link obj files generated
- # from asm files. This flag disables UseLibraryDependencyInputs to
- # avoid this problem.
- 'msvs_2010_disable_uldi_when_referenced': 1,
'includes': [
'ffmpeg_generated.gypi',
'../yasm/yasm_compile.gypi',
@@ -135,59 +139,6 @@
},
] # targets
}], # arch != arm
- ['OS == "win" and clang == 0 and MSVS_VERSION != "2013" and MSVS_VERSION != "2013e"', {
- # Convert the source code from c99 to c89 if we're on Windows and not
- # using clang, which can compile c99 directly. Clang support is
- # experimental and unsupported. VS2013 also supports enough of C99 to
- # be able to avoid this conversion.
- 'variables': {
- 'converter_script': 'chromium/scripts/c99conv.py',
- 'converter_executable': 'chromium/binaries/c99conv.exe',
- # Path to platform configuration files.
- 'platform_config_root': 'chromium/config/<(ffmpeg_branding)/<(os_config)/<(ffmpeg_config)',
- },
- 'includes': [
- 'ffmpeg_generated.gypi',
- ],
- 'targets': [{
- 'target_name': 'convert_ffmpeg_sources',
- 'type': 'none',
- 'sources': [
- '<@(c_sources)',
- ],
- 'rules': [
- {
- 'rule_name': 'convert_c99_to_c89',
- 'extension': 'c',
- 'inputs': [
- '<(converter_script)',
- '<(converter_executable)',
- # Since we don't know the dependency graph for header includes
- # we need to list them all here to ensure a header change causes
- # a recompilation.
- '<(platform_config_root)/config.h',
- '<(platform_config_root)/libavutil/avconfig.h',
- '<@(c_headers)',
- ],
- # Argh! Required so that the msvs generator will properly convert
- # RULE_INPUT_DIRNAME to a relative path.
- 'msvs_external_rule': 1,
- 'outputs': [
- '<(shared_generated_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).c',
- ],
- 'action': [
- 'python',
- '<(converter_script)',
- '<(RULE_INPUT_PATH)',
- '<(shared_generated_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).c',
- '-I', '<(platform_config_root)',
- ],
- 'message': 'Converting <(RULE_INPUT_PATH) from C99 to C89.',
- 'process_outputs_as_sources': 1,
- },
- ],
- }],
- }],
['build_ffmpegsumo != 0', {
'includes': [
'ffmpeg_generated.gypi',
@@ -201,6 +152,7 @@
'target_name': 'ffmpegsumo',
'type': 'loadable_module',
'sources': [
+ '<@(c_sources)',
'<(platform_config_root)/config.h',
'<(platform_config_root)/libavutil/avconfig.h',
],
@@ -213,21 +165,20 @@
'_POSIX_C_SOURCE=200112',
'_XOPEN_SOURCE=600',
'PIC',
+ # Disable deprecated features which generate spammy warnings.
+ 'FF_API_PIX_FMT_DESC=0',
+ 'FF_API_OLD_DECODE_AUDIO=0',
+ 'FF_API_DESTRUCT_PACKET=0',
+ 'FF_API_GET_BUFFER=0',
],
'cflags': [
'-fPIC',
'-fomit-frame-pointer',
+ # ffmpeg uses its own deprecated functions.
+ '-Wno-deprecated-declarations',
],
'conditions': [
- ['OS != "win" or clang == 1 or MSVS_VERSION == "2013" or MSVS_VERSION == "2013e"', {
- # If we're not doing C99 conversion, add the normal source code.
- 'sources': ['<@(c_sources)'],
- }, {
- # Otherwise, compile the converted source code.
- 'dependencies': ['convert_ffmpeg_sources'],
- 'sources': ['<@(converter_outputs)'],
- }],
- ['target_arch != "arm" and target_arch != "mipsel"', {
+ ['target_arch != "arm" and target_arch != "mipsel" and os_config != "linux-noasm"', {
'dependencies': [
'ffmpeg_yasm',
],
@@ -235,6 +186,7 @@
['clang == 1', {
'xcode_settings': {
'WARNING_CFLAGS': [
+ '-Wno-absolute-value',
# ffmpeg uses its own deprecated functions.
'-Wno-deprecated-declarations',
# ffmpeg doesn't care about pointer constness.
@@ -248,7 +200,7 @@
],
},
'cflags': [
- '-Wno-deprecated-declarations',
+ '-Wno-absolute-value',
'-Wno-incompatible-pointer-types',
'-Wno-logical-op-parentheses',
'-Wno-parentheses',
@@ -352,9 +304,6 @@
'-fno-math-errno',
'-fno-signed-zeros',
'-fno-tree-vectorize',
- '-fomit-frame-pointer',
- # Don't warn about libavformat using its own deprecated APIs.
- '-Wno-deprecated-declarations',
],
'cflags!': [
# Ensure the symbols are exported.
@@ -459,11 +408,6 @@
}],
],
'msvs_settings': {
- # This magical incantation is necessary because VC++ will compile
- # object files to same directory... even if they have the same name!
- 'VCCLCompilerTool': {
- 'ObjectFile': '$(IntDir)/%(RelativeDir)/',
- },
# Ignore warnings about a local symbol being inefficiently imported,
# upstream is working on a fix.
'VCLinkerTool': {
@@ -488,8 +432,7 @@
'-m', 'ffmpegsumo.dll',
'<@(_inputs)',
],
- 'message': 'Generating FFmpeg export definitions.',
- 'msvs_cygwin_shell': 1,
+ 'message': 'Generating FFmpeg export definitions',
},
],
}],
@@ -571,7 +514,7 @@
'-t', '<(outfile_type)',
'<@(RULE_INPUT_PATH)',
],
- 'message': 'Generating FFmpeg import libraries.',
+ 'message': 'Generating FFmpeg import libraries',
},
],
}, { # else OS != "win", use POSIX stub generator
@@ -631,7 +574,7 @@
'<@(_inputs)',
],
'process_outputs_as_sources': 1,
- 'message': 'Generating FFmpeg stubs for dynamic loading.',
+ 'message': 'Generating FFmpeg stubs for dynamic loading',
},
],
'conditions': [
diff --git a/chromium/third_party/ffmpeg/ffmpeg.h b/chromium/third_party/ffmpeg/ffmpeg.h
index 433baf84fa0..41d666340d7 100644
--- a/chromium/third_party/ffmpeg/ffmpeg.h
+++ b/chromium/third_party/ffmpeg/ffmpeg.h
@@ -60,6 +60,8 @@ enum HWAccelID {
HWACCEL_NONE = 0,
HWACCEL_AUTO,
HWACCEL_VDPAU,
+ HWACCEL_DXVA2,
+ HWACCEL_VDA,
};
typedef struct HWAccel {
@@ -171,6 +173,8 @@ typedef struct OptionsContext {
int nb_intra_matrices;
SpecifierOpt *inter_matrices;
int nb_inter_matrices;
+ SpecifierOpt *chroma_intra_matrices;
+ int nb_chroma_intra_matrices;
SpecifierOpt *top_field_first;
int nb_top_field_first;
SpecifierOpt *metadata_map;
@@ -253,10 +257,9 @@ typedef struct InputStream {
int64_t filter_in_rescale_delta_last;
double ts_scale;
- int is_start; /* is 1 at the start and after a discontinuity */
int saw_first_ts;
int showed_multi_packet_warning;
- AVDictionary *opts;
+ AVDictionary *decoder_opts;
AVRational framerate; /* framerate forced with -r */
int top_field_first;
int guess_layout_max;
@@ -305,6 +308,15 @@ typedef struct InputStream {
int (*hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame);
enum AVPixelFormat hwaccel_pix_fmt;
enum AVPixelFormat hwaccel_retrieved_pix_fmt;
+
+ /* stats */
+ // combined size of all the packets read
+ uint64_t data_size;
+ /* number of packets successfully read for this stream */
+ uint64_t nb_packets;
+ // number of frames/samples retrieved from the decoder
+ uint64_t frames_decoded;
+ uint64_t samples_decoded;
} InputStream;
typedef struct InputFile {
@@ -325,6 +337,7 @@ typedef struct InputFile {
#if HAVE_PTHREADS
pthread_t thread; /* thread reading from this file */
+ int non_blocking; /* reading packets from the thread should not block */
int finished; /* the thread has exited */
int joined; /* the thread has been joined */
pthread_mutex_t fifo_lock; /* lock for access to fifo */
@@ -344,6 +357,11 @@ enum forced_keyframes_const {
extern const char *const forced_keyframes_const_names[];
+typedef enum {
+ ENCODER_FINISHED = 1,
+ MUXER_FINISHED = 2,
+} OSTFinished ;
+
typedef struct OutputStream {
int file_index; /* file index */
int index; /* stream index in the output file */
@@ -393,11 +411,11 @@ typedef struct OutputStream {
char *filters_script; ///< filtergraph script associated to the -filter_script option
int64_t sws_flags;
- AVDictionary *opts;
+ AVDictionary *encoder_opts;
AVDictionary *swr_opts;
AVDictionary *resample_opts;
char *apad;
- int finished; /* no more packets should be written for this stream */
+ OSTFinished finished; /* no more packets should be written for this stream */
int unavailable; /* true if the steram is unavailable (possibly temporarily) */
int stream_copy;
const char *attachment_filename;
@@ -407,6 +425,15 @@ typedef struct OutputStream {
int keep_pix_fmt;
AVCodecParserContext *parser;
+
+ /* stats */
+ // combined size of all the packets written
+ uint64_t data_size;
+ // number of packets send to the muxer
+ uint64_t packets_written;
+ // number of frames/samples sent to the encoder
+ uint64_t frames_encoded;
+ uint64_t samples_encoded;
} OutputStream;
typedef struct OutputFile {
@@ -487,5 +514,7 @@ FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost);
int ffmpeg_parse_options(int argc, char **argv);
int vdpau_init(AVCodecContext *s);
+int dxva2_init(AVCodecContext *s);
+int vda_init(AVCodecContext *s);
#endif /* FFMPEG_H */
diff --git a/chromium/third_party/ffmpeg/ffmpeg_dxva2.c b/chromium/third_party/ffmpeg/ffmpeg_dxva2.c
new file mode 100644
index 00000000000..3c91d26f38d
--- /dev/null
+++ b/chromium/third_party/ffmpeg/ffmpeg_dxva2.c
@@ -0,0 +1,620 @@
+/*
+ * 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 <windows.h>
+
+#ifdef _WIN32_WINNT
+#undef _WIN32_WINNT
+#endif
+#define _WIN32_WINNT 0x0600
+#define DXVA2API_USE_BITFIELDS
+#define COBJMACROS
+
+#include <stdint.h>
+
+#include <d3d9.h>
+#include <dxva2api.h>
+
+#include "ffmpeg.h"
+
+#include "libavcodec/dxva2.h"
+
+#include "libavutil/avassert.h"
+#include "libavutil/buffer.h"
+#include "libavutil/frame.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/pixfmt.h"
+
+/* define all the GUIDs used directly here,
+ to avoid problems with inconsistent dxva2api.h versions in mingw-w64 and different MSVC version */
+#include <initguid.h>
+DEFINE_GUID(IID_IDirectXVideoDecoderService, 0xfc51a551,0xd5e7,0x11d9,0xaf,0x55,0x00,0x05,0x4e,0x43,0xff,0x02);
+
+DEFINE_GUID(DXVA2_ModeMPEG2_VLD, 0xee27417f, 0x5e28,0x4e65,0xbe,0xea,0x1d,0x26,0xb5,0x08,0xad,0xc9);
+DEFINE_GUID(DXVA2_ModeMPEG2and1_VLD, 0x86695f12, 0x340e,0x4f04,0x9f,0xd3,0x92,0x53,0xdd,0x32,0x74,0x60);
+DEFINE_GUID(DXVA2_ModeH264_E, 0x1b81be68, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(DXVA2_ModeH264_F, 0x1b81be69, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(DXVADDI_Intel_ModeH264_E, 0x604F8E68, 0x4951,0x4C54,0x88,0xFE,0xAB,0xD2,0x5C,0x15,0xB3,0xD6);
+DEFINE_GUID(DXVA2_ModeVC1_D, 0x1b81beA3, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(DXVA2_ModeVC1_D2010, 0x1b81beA4, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(DXVA2_NoEncrypt, 0x1b81beD0, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(GUID_NULL, 0x00000000, 0x0000,0x0000,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
+
+typedef IDirect3D9* WINAPI pDirect3DCreate9(UINT);
+typedef HRESULT WINAPI pCreateDeviceManager9(UINT *, IDirect3DDeviceManager9 **);
+
+typedef struct dxva2_mode {
+ const GUID *guid;
+ enum AVCodecID codec;
+} dxva2_mode;
+
+static const dxva2_mode dxva2_modes[] = {
+ /* MPEG-2 */
+ { &DXVA2_ModeMPEG2_VLD, AV_CODEC_ID_MPEG2VIDEO },
+ { &DXVA2_ModeMPEG2and1_VLD, AV_CODEC_ID_MPEG2VIDEO },
+
+ /* H.264 */
+ { &DXVA2_ModeH264_F, AV_CODEC_ID_H264 },
+ { &DXVA2_ModeH264_E, AV_CODEC_ID_H264 },
+ /* Intel specific H.264 mode */
+ { &DXVADDI_Intel_ModeH264_E, AV_CODEC_ID_H264 },
+
+ /* VC-1 / WMV3 */
+ { &DXVA2_ModeVC1_D2010, AV_CODEC_ID_VC1 },
+ { &DXVA2_ModeVC1_D2010, AV_CODEC_ID_WMV3 },
+ { &DXVA2_ModeVC1_D, AV_CODEC_ID_VC1 },
+ { &DXVA2_ModeVC1_D, AV_CODEC_ID_WMV3 },
+
+ { NULL, 0 },
+};
+
+typedef struct surface_info {
+ int used;
+ uint64_t age;
+} surface_info;
+
+typedef struct DXVA2Context {
+ HMODULE d3dlib;
+ HMODULE dxva2lib;
+
+ HANDLE deviceHandle;
+
+ IDirect3D9 *d3d9;
+ IDirect3DDevice9 *d3d9device;
+ IDirect3DDeviceManager9 *d3d9devmgr;
+ IDirectXVideoDecoderService *decoder_service;
+ IDirectXVideoDecoder *decoder;
+
+ GUID decoder_guid;
+ DXVA2_ConfigPictureDecode decoder_config;
+
+ LPDIRECT3DSURFACE9 *surfaces;
+ surface_info *surface_infos;
+ uint32_t num_surfaces;
+ uint64_t surface_age;
+
+ AVFrame *tmp_frame;
+} DXVA2Context;
+
+typedef struct DXVA2SurfaceWrapper {
+ DXVA2Context *ctx;
+ LPDIRECT3DSURFACE9 surface;
+ IDirectXVideoDecoder *decoder;
+} DXVA2SurfaceWrapper;
+
+static void dxva2_destroy_decoder(AVCodecContext *s)
+{
+ InputStream *ist = s->opaque;
+ DXVA2Context *ctx = ist->hwaccel_ctx;
+ int i;
+
+ if (ctx->surfaces) {
+ for (i = 0; i < ctx->num_surfaces; i++) {
+ if (ctx->surfaces[i])
+ IDirect3DSurface9_Release(ctx->surfaces[i]);
+ }
+ }
+ av_freep(&ctx->surfaces);
+ av_freep(&ctx->surface_infos);
+ ctx->num_surfaces = 0;
+ ctx->surface_age = 0;
+
+ if (ctx->decoder) {
+ IDirectXVideoDecoder_Release(ctx->decoder);
+ ctx->decoder = NULL;
+ }
+}
+
+static void dxva2_uninit(AVCodecContext *s)
+{
+ InputStream *ist = s->opaque;
+ DXVA2Context *ctx = ist->hwaccel_ctx;
+
+ ist->hwaccel_uninit = NULL;
+ ist->hwaccel_get_buffer = NULL;
+ ist->hwaccel_retrieve_data = NULL;
+
+ if (ctx->decoder)
+ dxva2_destroy_decoder(s);
+
+ if (ctx->decoder_service)
+ IDirectXVideoDecoderService_Release(ctx->decoder_service);
+
+ if (ctx->d3d9devmgr && ctx->deviceHandle != INVALID_HANDLE_VALUE)
+ IDirect3DDeviceManager9_CloseDeviceHandle(ctx->d3d9devmgr, ctx->deviceHandle);
+
+ if (ctx->d3d9devmgr)
+ IDirect3DDeviceManager9_Release(ctx->d3d9devmgr);
+
+ if (ctx->d3d9device)
+ IDirect3DDevice9_Release(ctx->d3d9device);
+
+ if (ctx->d3d9)
+ IDirect3D9_Release(ctx->d3d9);
+
+ if (ctx->d3dlib)
+ FreeLibrary(ctx->d3dlib);
+
+ if (ctx->dxva2lib)
+ FreeLibrary(ctx->dxva2lib);
+
+ av_frame_free(&ctx->tmp_frame);
+
+ av_freep(&ist->hwaccel_ctx);
+ av_freep(&s->hwaccel_context);
+}
+
+static void dxva2_release_buffer(void *opaque, uint8_t *data)
+{
+ DXVA2SurfaceWrapper *w = opaque;
+ DXVA2Context *ctx = w->ctx;
+ int i;
+
+ for (i = 0; i < ctx->num_surfaces; i++) {
+ if (ctx->surfaces[i] == w->surface) {
+ ctx->surface_infos[i].used = 0;
+ break;
+ }
+ }
+ IDirect3DSurface9_Release(w->surface);
+ IDirectXVideoDecoder_Release(w->decoder);
+ av_free(w);
+}
+
+static int dxva2_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
+{
+ InputStream *ist = s->opaque;
+ DXVA2Context *ctx = ist->hwaccel_ctx;
+ int i, old_unused = -1;
+ LPDIRECT3DSURFACE9 surface;
+ DXVA2SurfaceWrapper *w = NULL;
+
+ av_assert0(frame->format == AV_PIX_FMT_DXVA2_VLD);
+
+ for (i = 0; i < ctx->num_surfaces; i++) {
+ surface_info *info = &ctx->surface_infos[i];
+ if (!info->used && (old_unused == -1 || info->age < ctx->surface_infos[old_unused].age))
+ old_unused = i;
+ }
+ if (old_unused == -1) {
+ av_log(NULL, AV_LOG_ERROR, "No free DXVA2 surface!\n");
+ return AVERROR(ENOMEM);
+ }
+ i = old_unused;
+
+ surface = ctx->surfaces[i];
+
+ w = av_mallocz(sizeof(*w));
+ if (!w)
+ return AVERROR(ENOMEM);
+
+ frame->buf[0] = av_buffer_create((uint8_t*)surface, 0,
+ dxva2_release_buffer, w,
+ AV_BUFFER_FLAG_READONLY);
+ if (!frame->buf[0]) {
+ av_free(w);
+ return AVERROR(ENOMEM);
+ }
+
+ w->ctx = ctx;
+ w->surface = surface;
+ IDirect3DSurface9_AddRef(w->surface);
+ w->decoder = ctx->decoder;
+ IDirectXVideoDecoder_AddRef(w->decoder);
+
+ ctx->surface_infos[i].used = 1;
+ ctx->surface_infos[i].age = ctx->surface_age++;
+
+ frame->data[3] = (uint8_t *)surface;
+
+ return 0;
+}
+
+static int dxva2_retrieve_data(AVCodecContext *s, AVFrame *frame)
+{
+ LPDIRECT3DSURFACE9 surface = (LPDIRECT3DSURFACE9)frame->data[3];
+ InputStream *ist = s->opaque;
+ DXVA2Context *ctx = ist->hwaccel_ctx;
+ D3DSURFACE_DESC surfaceDesc;
+ D3DLOCKED_RECT LockedRect;
+ HRESULT hr;
+ int ret;
+
+ IDirect3DSurface9_GetDesc(surface, &surfaceDesc);
+
+ ctx->tmp_frame->width = frame->width;
+ ctx->tmp_frame->height = frame->height;
+ ctx->tmp_frame->format = AV_PIX_FMT_NV12;
+
+ ret = av_frame_get_buffer(ctx->tmp_frame, 32);
+ if (ret < 0)
+ return ret;
+
+ hr = IDirect3DSurface9_LockRect(surface, &LockedRect, NULL, D3DLOCK_READONLY);
+ if (FAILED(hr)) {
+ av_log(NULL, AV_LOG_ERROR, "Unable to lock DXVA2 surface\n");
+ return AVERROR_UNKNOWN;
+ }
+
+ av_image_copy_plane(ctx->tmp_frame->data[0], ctx->tmp_frame->linesize[0],
+ (uint8_t*)LockedRect.pBits,
+ LockedRect.Pitch, frame->width, frame->height);
+
+ av_image_copy_plane(ctx->tmp_frame->data[1], ctx->tmp_frame->linesize[1],
+ (uint8_t*)LockedRect.pBits + LockedRect.Pitch * surfaceDesc.Height,
+ LockedRect.Pitch, frame->width, frame->height / 2);
+
+ IDirect3DSurface9_UnlockRect(surface);
+
+ ret = av_frame_copy_props(ctx->tmp_frame, frame);
+ if (ret < 0)
+ goto fail;
+
+ av_frame_unref(frame);
+ av_frame_move_ref(frame, ctx->tmp_frame);
+
+ return 0;
+fail:
+ av_frame_unref(ctx->tmp_frame);
+ return ret;
+}
+
+static int dxva2_alloc(AVCodecContext *s)
+{
+ InputStream *ist = s->opaque;
+ int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
+ DXVA2Context *ctx;
+ pDirect3DCreate9 *createD3D = NULL;
+ pCreateDeviceManager9 *createDeviceManager = NULL;
+ HRESULT hr;
+ D3DPRESENT_PARAMETERS d3dpp = {0};
+ D3DDISPLAYMODE d3ddm;
+ unsigned resetToken = 0;
+ UINT adapter = D3DADAPTER_DEFAULT;
+
+ ctx = av_mallocz(sizeof(*ctx));
+ if (!ctx)
+ return AVERROR(ENOMEM);
+
+ ctx->deviceHandle = INVALID_HANDLE_VALUE;
+
+ ist->hwaccel_ctx = ctx;
+ ist->hwaccel_uninit = dxva2_uninit;
+ ist->hwaccel_get_buffer = dxva2_get_buffer;
+ ist->hwaccel_retrieve_data = dxva2_retrieve_data;
+
+ ctx->d3dlib = LoadLibrary("d3d9.dll");
+ if (!ctx->d3dlib) {
+ av_log(NULL, loglevel, "Failed to load D3D9 library\n");
+ goto fail;
+ }
+ ctx->dxva2lib = LoadLibrary("dxva2.dll");
+ if (!ctx->dxva2lib) {
+ av_log(NULL, loglevel, "Failed to load DXVA2 library\n");
+ goto fail;
+ }
+
+ createD3D = (pDirect3DCreate9 *)GetProcAddress(ctx->d3dlib, "Direct3DCreate9");
+ if (!createD3D) {
+ av_log(NULL, loglevel, "Failed to locate Direct3DCreate9\n");
+ goto fail;
+ }
+ createDeviceManager = (pCreateDeviceManager9 *)GetProcAddress(ctx->dxva2lib, "DXVA2CreateDirect3DDeviceManager9");
+ if (!createDeviceManager) {
+ av_log(NULL, loglevel, "Failed to locate DXVA2CreateDirect3DDeviceManager9\n");
+ goto fail;
+ }
+
+ ctx->d3d9 = createD3D(D3D_SDK_VERSION);
+ if (!ctx->d3d9) {
+ av_log(NULL, loglevel, "Failed to create IDirect3D object\n");
+ goto fail;
+ }
+
+ if (ist->hwaccel_device) {
+ adapter = atoi(ist->hwaccel_device);
+ av_log(NULL, AV_LOG_INFO, "Using HWAccel device %d\n", adapter);
+ }
+
+ IDirect3D9_GetAdapterDisplayMode(ctx->d3d9, adapter, &d3ddm);
+ d3dpp.Windowed = TRUE;
+ d3dpp.BackBufferWidth = 640;
+ d3dpp.BackBufferHeight = 480;
+ d3dpp.BackBufferCount = 0;
+ d3dpp.BackBufferFormat = d3ddm.Format;
+ d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
+ d3dpp.Flags = D3DPRESENTFLAG_VIDEO;
+
+ hr = IDirect3D9_CreateDevice(ctx->d3d9, adapter, D3DDEVTYPE_HAL, GetShellWindow(),
+ D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE,
+ &d3dpp, &ctx->d3d9device);
+ if (FAILED(hr)) {
+ av_log(NULL, loglevel, "Failed to create Direct3D device\n");
+ goto fail;
+ }
+
+ hr = createDeviceManager(&resetToken, &ctx->d3d9devmgr);
+ if (FAILED(hr)) {
+ av_log(NULL, loglevel, "Failed to create Direct3D device manager\n");
+ goto fail;
+ }
+
+ hr = IDirect3DDeviceManager9_ResetDevice(ctx->d3d9devmgr, ctx->d3d9device, resetToken);
+ if (FAILED(hr)) {
+ av_log(NULL, loglevel, "Failed to bind Direct3D device to device manager\n");
+ goto fail;
+ }
+
+ hr = IDirect3DDeviceManager9_OpenDeviceHandle(ctx->d3d9devmgr, &ctx->deviceHandle);
+ if (FAILED(hr)) {
+ av_log(NULL, loglevel, "Failed to open device handle\n");
+ goto fail;
+ }
+
+ hr = IDirect3DDeviceManager9_GetVideoService(ctx->d3d9devmgr, ctx->deviceHandle, &IID_IDirectXVideoDecoderService, (void **)&ctx->decoder_service);
+ if (FAILED(hr)) {
+ av_log(NULL, loglevel, "Failed to create IDirectXVideoDecoderService\n");
+ goto fail;
+ }
+
+ ctx->tmp_frame = av_frame_alloc();
+ if (!ctx->tmp_frame)
+ goto fail;
+
+ s->hwaccel_context = av_mallocz(sizeof(struct dxva_context));
+ if (!s->hwaccel_context)
+ goto fail;
+
+ return 0;
+fail:
+ dxva2_uninit(s);
+ return AVERROR(EINVAL);
+}
+
+static int dxva2_get_decoder_configuration(AVCodecContext *s, const GUID *device_guid,
+ const DXVA2_VideoDesc *desc,
+ DXVA2_ConfigPictureDecode *config)
+{
+ InputStream *ist = s->opaque;
+ int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
+ DXVA2Context *ctx = ist->hwaccel_ctx;
+ unsigned cfg_count = 0, best_score = 0;
+ DXVA2_ConfigPictureDecode *cfg_list = NULL;
+ DXVA2_ConfigPictureDecode best_cfg = {{0}};
+ HRESULT hr;
+ int i;
+
+ hr = IDirectXVideoDecoderService_GetDecoderConfigurations(ctx->decoder_service, device_guid, desc, NULL, &cfg_count, &cfg_list);
+ if (FAILED(hr)) {
+ av_log(NULL, loglevel, "Unable to retrieve decoder configurations\n");
+ return AVERROR(EINVAL);
+ }
+
+ for (i = 0; i < cfg_count; i++) {
+ DXVA2_ConfigPictureDecode *cfg = &cfg_list[i];
+
+ unsigned score;
+ if (cfg->ConfigBitstreamRaw == 1)
+ score = 1;
+ else if (s->codec_id == AV_CODEC_ID_H264 && cfg->ConfigBitstreamRaw == 2)
+ score = 2;
+ else
+ continue;
+ if (IsEqualGUID(&cfg->guidConfigBitstreamEncryption, &DXVA2_NoEncrypt))
+ score += 16;
+ if (score > best_score) {
+ best_score = score;
+ best_cfg = *cfg;
+ }
+ }
+ CoTaskMemFree(cfg_list);
+
+ if (!best_score) {
+ av_log(NULL, loglevel, "No valid decoder configuration available\n");
+ return AVERROR(EINVAL);
+ }
+
+ *config = best_cfg;
+ return 0;
+}
+
+static int dxva2_create_decoder(AVCodecContext *s)
+{
+ InputStream *ist = s->opaque;
+ int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
+ DXVA2Context *ctx = ist->hwaccel_ctx;
+ struct dxva_context *dxva_ctx = s->hwaccel_context;
+ GUID *guid_list = NULL;
+ unsigned guid_count = 0, i, j;
+ GUID device_guid = GUID_NULL;
+ D3DFORMAT target_format = 0;
+ DXVA2_VideoDesc desc = { 0 };
+ DXVA2_ConfigPictureDecode config;
+ HRESULT hr;
+ int surface_alignment;
+ int ret;
+
+ hr = IDirectXVideoDecoderService_GetDecoderDeviceGuids(ctx->decoder_service, &guid_count, &guid_list);
+ if (FAILED(hr)) {
+ av_log(NULL, loglevel, "Failed to retrieve decoder device GUIDs\n");
+ goto fail;
+ }
+
+ for (i = 0; dxva2_modes[i].guid; i++) {
+ D3DFORMAT *target_list = NULL;
+ unsigned target_count = 0;
+ const dxva2_mode *mode = &dxva2_modes[i];
+ if (mode->codec != s->codec_id)
+ continue;
+
+ for (j = 0; j < guid_count; j++) {
+ if (IsEqualGUID(mode->guid, &guid_list[j]))
+ break;
+ }
+ if (j == guid_count)
+ continue;
+
+ hr = IDirectXVideoDecoderService_GetDecoderRenderTargets(ctx->decoder_service, mode->guid, &target_count, &target_list);
+ if (FAILED(hr)) {
+ continue;
+ }
+ for (j = 0; j < target_count; j++) {
+ const D3DFORMAT format = target_list[j];
+ if (format == MKTAG('N','V','1','2')) {
+ target_format = format;
+ break;
+ }
+ }
+ CoTaskMemFree(target_list);
+ if (target_format) {
+ device_guid = *mode->guid;
+ break;
+ }
+ }
+ CoTaskMemFree(guid_list);
+
+ if (IsEqualGUID(&device_guid, &GUID_NULL)) {
+ av_log(NULL, loglevel, "No decoder device for codec found\n");
+ goto fail;
+ }
+
+ desc.SampleWidth = s->coded_width;
+ desc.SampleHeight = s->coded_height;
+ desc.Format = target_format;
+
+ ret = dxva2_get_decoder_configuration(s, &device_guid, &desc, &config);
+ if (ret < 0) {
+ goto fail;
+ }
+
+ /* decoding MPEG-2 requires additional alignment on some Intel GPUs,
+ but it causes issues for H.264 on certain AMD GPUs..... */
+ if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO)
+ surface_alignment = 32;
+ else
+ surface_alignment = 16;
+
+ /* 4 base work surfaces */
+ ctx->num_surfaces = 4;
+
+ /* add surfaces based on number of possible refs */
+ if (s->codec_id == AV_CODEC_ID_H264)
+ ctx->num_surfaces += 16;
+ else
+ ctx->num_surfaces += 2;
+
+ /* add extra surfaces for frame threading */
+ if (s->active_thread_type & FF_THREAD_FRAME)
+ ctx->num_surfaces += s->thread_count;
+
+ ctx->surfaces = av_mallocz(ctx->num_surfaces * sizeof(*ctx->surfaces));
+ ctx->surface_infos = av_mallocz(ctx->num_surfaces * sizeof(*ctx->surface_infos));
+
+ if (!ctx->surfaces || !ctx->surface_infos) {
+ av_log(NULL, loglevel, "Unable to allocate surface arrays\n");
+ goto fail;
+ }
+
+ hr = IDirectXVideoDecoderService_CreateSurface(ctx->decoder_service,
+ FFALIGN(s->coded_width, surface_alignment),
+ FFALIGN(s->coded_height, surface_alignment),
+ ctx->num_surfaces - 1,
+ target_format, D3DPOOL_DEFAULT, 0,
+ DXVA2_VideoDecoderRenderTarget,
+ ctx->surfaces, NULL);
+ if (FAILED(hr)) {
+ av_log(NULL, loglevel, "Failed to create %d video surfaces\n", ctx->num_surfaces);
+ goto fail;
+ }
+
+ hr = IDirectXVideoDecoderService_CreateVideoDecoder(ctx->decoder_service, &device_guid,
+ &desc, &config, ctx->surfaces,
+ ctx->num_surfaces, &ctx->decoder);
+ if (FAILED(hr)) {
+ av_log(NULL, loglevel, "Failed to create DXVA2 video decoder\n");
+ goto fail;
+ }
+
+ ctx->decoder_guid = device_guid;
+ ctx->decoder_config = config;
+
+ dxva_ctx->cfg = &ctx->decoder_config;
+ dxva_ctx->decoder = ctx->decoder;
+ dxva_ctx->surface = ctx->surfaces;
+ dxva_ctx->surface_count = ctx->num_surfaces;
+
+ if (IsEqualGUID(&ctx->decoder_guid, &DXVADDI_Intel_ModeH264_E))
+ dxva_ctx->workaround |= FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO;
+
+ return 0;
+fail:
+ dxva2_destroy_decoder(s);
+ return AVERROR(EINVAL);
+}
+
+int dxva2_init(AVCodecContext *s)
+{
+ InputStream *ist = s->opaque;
+ int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
+ DXVA2Context *ctx;
+ int ret;
+
+ if (!ist->hwaccel_ctx) {
+ ret = dxva2_alloc(s);
+ if (ret < 0)
+ return ret;
+ }
+ ctx = ist->hwaccel_ctx;
+
+ if (s->codec_id == AV_CODEC_ID_H264 &&
+ (s->profile & ~FF_PROFILE_H264_CONSTRAINED) > FF_PROFILE_H264_HIGH) {
+ av_log(NULL, loglevel, "Unsupported H.264 profile for DXVA2 HWAccel: %d\n", s->profile);
+ return AVERROR(EINVAL);
+ }
+
+ if (ctx->decoder)
+ dxva2_destroy_decoder(s);
+
+ ret = dxva2_create_decoder(s);
+ if (ret < 0) {
+ av_log(NULL, loglevel, "Error creating the DXVA2 decoder\n");
+ return ret;
+ }
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/ffmpeg_filter.c b/chromium/third_party/ffmpeg/ffmpeg_filter.c
index 9d945fca49c..6fd170baeaa 100644
--- a/chromium/third_party/ffmpeg/ffmpeg_filter.c
+++ b/chromium/third_party/ffmpeg/ffmpeg_filter.c
@@ -44,12 +44,17 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
+ static const enum AVPixelFormat mjpeg_formats[] =
+ { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
+ static const enum AVPixelFormat ljpeg_formats[] =
+ { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
+
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
- p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
+ p = mjpeg_formats;
} else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
- p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
+ p =ljpeg_formats;
}
}
for (; *p != AV_PIX_FMT_NONE; p++) {
@@ -94,7 +99,7 @@ void choose_sample_fmt(AVStream *st, AVCodec *codec)
static char *choose_pix_fmts(OutputStream *ost)
{
- AVDictionaryEntry *strict_dict = av_dict_get(ost->opts, "strict", NULL, 0);
+ AVDictionaryEntry *strict_dict = av_dict_get(ost->encoder_opts, "strict", NULL, 0);
if (strict_dict)
// used by choose_pixel_fmt() and below
av_opt_set(ost->st->codec, "strict", strict_dict->value, 0);
@@ -869,7 +874,7 @@ int configure_filtergraph(FilterGraph *fg)
args[strlen(args) - 1] = '\0';
fg->graph->resample_lavr_opts = av_strdup(args);
- e = av_dict_get(ost->opts, "threads", NULL, 0);
+ e = av_dict_get(ost->encoder_opts, "threads", NULL, 0);
if (e)
av_opt_set(fg->graph, "threads", e->value, 0);
}
diff --git a/chromium/third_party/ffmpeg/ffmpeg_generated.gni b/chromium/third_party/ffmpeg/ffmpeg_generated.gni
new file mode 100644
index 00000000000..3a5840e475a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/ffmpeg_generated.gni
@@ -0,0 +1,468 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# NOTE: this file is autogenerated by ffmpeg/chromium/scripts/generate_gyp.py
+
+import("//build/config/arm.gni")
+import("ffmpeg_options.gni")
+
+# Declare empty versions of each variable for easier +=ing later.
+ffmpeg_c_sources = []
+ffmpeg_gas_sources = []
+ffmpeg_yasm_sources = []
+
+ffmpeg_c_sources += [
+ "libavcodec/allcodecs.c",
+ "libavcodec/avfft.c",
+ "libavcodec/avpacket.c",
+ "libavcodec/avpicture.c",
+ "libavcodec/bitstream.c",
+ "libavcodec/bitstream_filter.c",
+ "libavcodec/codec_desc.c",
+ "libavcodec/dirac.c",
+ "libavcodec/fft_fixed.c",
+ "libavcodec/fft_fixed_32.c",
+ "libavcodec/fft_float.c",
+ "libavcodec/fft_init_table.c",
+ "libavcodec/flac.c",
+ "libavcodec/flacdata.c",
+ "libavcodec/fmtconvert.c",
+ "libavcodec/golomb.c",
+ "libavcodec/h264pred.c",
+ "libavcodec/hpeldsp.c",
+ "libavcodec/imgconvert.c",
+ "libavcodec/mathtables.c",
+ "libavcodec/mdct_fixed.c",
+ "libavcodec/mdct_fixed_32.c",
+ "libavcodec/mdct_float.c",
+ "libavcodec/mpeg12data.c",
+ "libavcodec/mpeg4audio.c",
+ "libavcodec/mpegaudiodata.c",
+ "libavcodec/options.c",
+ "libavcodec/opus.c",
+ "libavcodec/opus_parser.c",
+ "libavcodec/parser.c",
+ "libavcodec/pcm.c",
+ "libavcodec/pthread.c",
+ "libavcodec/pthread_frame.c",
+ "libavcodec/pthread_slice.c",
+ "libavcodec/raw.c",
+ "libavcodec/rdft.c",
+ "libavcodec/utils.c",
+ "libavcodec/videodsp.c",
+ "libavcodec/vorbis.c",
+ "libavcodec/vorbis_data.c",
+ "libavcodec/vorbis_parser.c",
+ "libavcodec/vorbisdec.c",
+ "libavcodec/vorbisdsp.c",
+ "libavcodec/vp3.c",
+ "libavcodec/vp3_parser.c",
+ "libavcodec/vp3dsp.c",
+ "libavcodec/vp56rac.c",
+ "libavcodec/vp8.c",
+ "libavcodec/vp8_parser.c",
+ "libavcodec/vp8dsp.c",
+ "libavcodec/xiph.c",
+ "libavformat/allformats.c",
+ "libavformat/avio.c",
+ "libavformat/aviobuf.c",
+ "libavformat/cutils.c",
+ "libavformat/flac_picture.c",
+ "libavformat/format.c",
+ "libavformat/id3v1.c",
+ "libavformat/id3v2.c",
+ "libavformat/isom.c",
+ "libavformat/matroska.c",
+ "libavformat/matroskadec.c",
+ "libavformat/metadata.c",
+ "libavformat/mux.c",
+ "libavformat/oggdec.c",
+ "libavformat/oggparsecelt.c",
+ "libavformat/oggparsedirac.c",
+ "libavformat/oggparseflac.c",
+ "libavformat/oggparseogm.c",
+ "libavformat/oggparseopus.c",
+ "libavformat/oggparseskeleton.c",
+ "libavformat/oggparsespeex.c",
+ "libavformat/oggparsetheora.c",
+ "libavformat/oggparsevorbis.c",
+ "libavformat/oggparsevp8.c",
+ "libavformat/options.c",
+ "libavformat/os_support.c",
+ "libavformat/pcm.c",
+ "libavformat/replaygain.c",
+ "libavformat/riff.c",
+ "libavformat/riffdec.c",
+ "libavformat/rmsipr.c",
+ "libavformat/seek.c",
+ "libavformat/url.c",
+ "libavformat/utils.c",
+ "libavformat/vorbiscomment.c",
+ "libavformat/wavdec.c",
+ "libavutil/atomic.c",
+ "libavutil/avstring.c",
+ "libavutil/base64.c",
+ "libavutil/bprint.c",
+ "libavutil/buffer.c",
+ "libavutil/channel_layout.c",
+ "libavutil/cpu.c",
+ "libavutil/crc.c",
+ "libavutil/dict.c",
+ "libavutil/downmix_info.c",
+ "libavutil/error.c",
+ "libavutil/eval.c",
+ "libavutil/fifo.c",
+ "libavutil/file_open.c",
+ "libavutil/fixed_dsp.c",
+ "libavutil/float_dsp.c",
+ "libavutil/frame.c",
+ "libavutil/imgutils.c",
+ "libavutil/intfloat_readwrite.c",
+ "libavutil/intmath.c",
+ "libavutil/lfg.c",
+ "libavutil/lls1.c",
+ "libavutil/lls2.c",
+ "libavutil/log.c",
+ "libavutil/log2_tab.c",
+ "libavutil/mathematics.c",
+ "libavutil/md5.c",
+ "libavutil/mem.c",
+ "libavutil/opt.c",
+ "libavutil/parseutils.c",
+ "libavutil/pixdesc.c",
+ "libavutil/random_seed.c",
+ "libavutil/rational.c",
+ "libavutil/samplefmt.c",
+ "libavutil/sha.c",
+ "libavutil/stereo3d.c",
+ "libavutil/time.c",
+ "libavutil/timecode.c",
+ "libavutil/utils.c",
+]
+
+if (ffmpeg_branding == "ChromiumOS" || ffmpeg_branding == "ChromeOS" || ffmpeg_branding == "Chrome") {
+ ffmpeg_c_sources += [
+ "libavformat/rawdec.c",
+ ]
+}
+
+if (cpu_arch == "arm" || (cpu_arch == "arm" && arm_use_neon)) {
+ ffmpeg_c_sources += [
+ "libavcodec/arm/fft_fixed_init_arm.c",
+ "libavcodec/arm/fft_init_arm.c",
+ "libavcodec/arm/fmtconvert_init_arm.c",
+ "libavcodec/arm/h264pred_init_arm.c",
+ "libavcodec/arm/hpeldsp_init_arm.c",
+ "libavcodec/arm/hpeldsp_init_armv6.c",
+ "libavcodec/arm/videodsp_init_arm.c",
+ "libavcodec/arm/videodsp_init_armv5te.c",
+ "libavcodec/arm/vorbisdsp_init_arm.c",
+ "libavcodec/arm/vp3dsp_init_arm.c",
+ "libavcodec/arm/vp8dsp_init_arm.c",
+ "libavcodec/arm/vp8dsp_init_armv6.c",
+ "libavutil/arm/cpu.c",
+ "libavutil/arm/float_dsp_init_arm.c",
+ "libavutil/arm/float_dsp_init_vfp.c",
+ ]
+ ffmpeg_gas_sources += [
+ "libavcodec/arm/fft_vfp.S",
+ "libavcodec/arm/fmtconvert_vfp.S",
+ "libavcodec/arm/fmtconvert_vfp_armv6.S",
+ "libavcodec/arm/hpeldsp_arm.S",
+ "libavcodec/arm/hpeldsp_armv6.S",
+ "libavcodec/arm/mdct_vfp.S",
+ "libavcodec/arm/videodsp_armv5te.S",
+ "libavcodec/arm/vp8_armv6.S",
+ "libavcodec/arm/vp8dsp_armv6.S",
+ "libavutil/arm/float_dsp_vfp.S",
+ ]
+}
+
+if (ffmpeg_branding == "Chrome" || ffmpeg_branding == "ChromeOS") {
+ ffmpeg_c_sources += [
+ "libavcodec/aac_ac3_parser.c",
+ "libavcodec/aac_parser.c",
+ "libavcodec/aacadtsdec.c",
+ "libavcodec/aacdec.c",
+ "libavcodec/aacps.c",
+ "libavcodec/aacpsdsp.c",
+ "libavcodec/aacsbr.c",
+ "libavcodec/aactab.c",
+ "libavcodec/ac3tab.c",
+ "libavcodec/cabac.c",
+ "libavcodec/dct.c",
+ "libavcodec/dct32_fixed.c",
+ "libavcodec/dct32_float.c",
+ "libavcodec/h264.c",
+ "libavcodec/h264_cabac.c",
+ "libavcodec/h264_cavlc.c",
+ "libavcodec/h264_direct.c",
+ "libavcodec/h264_loopfilter.c",
+ "libavcodec/h264_mb.c",
+ "libavcodec/h264_parser.c",
+ "libavcodec/h264_picture.c",
+ "libavcodec/h264_ps.c",
+ "libavcodec/h264_refs.c",
+ "libavcodec/h264_sei.c",
+ "libavcodec/h264_slice.c",
+ "libavcodec/h264chroma.c",
+ "libavcodec/h264dsp.c",
+ "libavcodec/h264idct.c",
+ "libavcodec/h264qpel.c",
+ "libavcodec/kbdwin.c",
+ "libavcodec/mpegaudio.c",
+ "libavcodec/mpegaudio_parser.c",
+ "libavcodec/mpegaudiodec_fixed.c",
+ "libavcodec/mpegaudiodecheader.c",
+ "libavcodec/mpegaudiodsp.c",
+ "libavcodec/mpegaudiodsp_data.c",
+ "libavcodec/mpegaudiodsp_fixed.c",
+ "libavcodec/mpegaudiodsp_float.c",
+ "libavcodec/sbrdsp.c",
+ "libavcodec/sinewin.c",
+ "libavcodec/startcode.c",
+ "libavformat/aacdec.c",
+ "libavformat/apetag.c",
+ "libavformat/img2.c",
+ "libavformat/mov.c",
+ "libavformat/mov_chan.c",
+ "libavformat/mp3dec.c",
+ ]
+}
+
+if (cpu_arch == "ia32" || cpu_arch == "x64") {
+ ffmpeg_c_sources += [
+ "libavcodec/x86/constants.c",
+ "libavcodec/x86/fft_init.c",
+ "libavcodec/x86/fmtconvert_init.c",
+ "libavcodec/x86/fpel_mmx.c",
+ "libavcodec/x86/h264_intrapred_init.c",
+ "libavcodec/x86/hpeldsp_init.c",
+ "libavcodec/x86/hpeldsp_mmx.c",
+ "libavcodec/x86/videodsp_init.c",
+ "libavcodec/x86/vorbisdsp_init.c",
+ "libavcodec/x86/vp3dsp_init.c",
+ "libavcodec/x86/vp8dsp_init.c",
+ "libavutil/x86/cpu.c",
+ "libavutil/x86/float_dsp_init.c",
+ "libavutil/x86/lls_init.c",
+ ]
+ ffmpeg_yasm_sources += [
+ "libavcodec/x86/deinterlace.asm",
+ "libavcodec/x86/fft.asm",
+ "libavcodec/x86/fmtconvert.asm",
+ "libavcodec/x86/fpel.asm",
+ "libavcodec/x86/h264_intrapred.asm",
+ "libavcodec/x86/h264_intrapred_10bit.asm",
+ "libavcodec/x86/hpeldsp.asm",
+ "libavcodec/x86/videodsp.asm",
+ "libavcodec/x86/vorbisdsp.asm",
+ "libavcodec/x86/vp3dsp.asm",
+ "libavcodec/x86/vp8dsp.asm",
+ "libavcodec/x86/vp8dsp_loopfilter.asm",
+ "libavutil/x86/cpuid.asm",
+ "libavutil/x86/emms.asm",
+ "libavutil/x86/float_dsp.asm",
+ "libavutil/x86/lls.asm",
+ ]
+}
+
+if (ffmpeg_branding == "ChromiumOS" || ffmpeg_branding == "ChromeOS") {
+ ffmpeg_c_sources += [
+ "libavcodec/flac_parser.c",
+ "libavcodec/flacdec.c",
+ "libavcodec/flacdsp.c",
+ "libavformat/flacdec.c",
+ ]
+}
+
+if ((cpu_arch == "arm" && arm_use_neon)) {
+ ffmpeg_c_sources += [
+ "libavcodec/arm/hpeldsp_init_neon.c",
+ "libavcodec/arm/vp8dsp_init_neon.c",
+ "libavutil/arm/float_dsp_init_neon.c",
+ ]
+ ffmpeg_gas_sources += [
+ "libavcodec/arm/fft_fixed_neon.S",
+ "libavcodec/arm/fft_neon.S",
+ "libavcodec/arm/fmtconvert_neon.S",
+ "libavcodec/arm/h264pred_neon.S",
+ "libavcodec/arm/hpeldsp_neon.S",
+ "libavcodec/arm/mdct_fixed_neon.S",
+ "libavcodec/arm/mdct_neon.S",
+ "libavcodec/arm/rdft_neon.S",
+ "libavcodec/arm/vorbisdsp_neon.S",
+ "libavcodec/arm/vp3dsp_neon.S",
+ "libavcodec/arm/vp8dsp_neon.S",
+ "libavutil/arm/float_dsp_neon.S",
+ ]
+}
+
+if ((cpu_arch == "arm" || (cpu_arch == "arm" && arm_use_neon)) && (ffmpeg_branding == "ChromiumOS" || ffmpeg_branding == "ChromeOS")) {
+ ffmpeg_c_sources += [
+ "libavcodec/arm/flacdsp_init_arm.c",
+ ]
+ ffmpeg_gas_sources += [
+ "libavcodec/arm/flacdsp_arm.S",
+ ]
+}
+
+if ((cpu_arch == "arm" || (cpu_arch == "arm" && arm_use_neon)) && (ffmpeg_branding == "Chrome" || ffmpeg_branding == "ChromeOS")) {
+ ffmpeg_c_sources += [
+ "libavcodec/arm/aacpsdsp_init_arm.c",
+ "libavcodec/arm/h264chroma_init_arm.c",
+ "libavcodec/arm/h264dsp_init_arm.c",
+ "libavcodec/arm/h264qpel_init_arm.c",
+ "libavcodec/arm/mpegaudiodsp_init_arm.c",
+ "libavcodec/arm/sbrdsp_init_arm.c",
+ ]
+ ffmpeg_gas_sources += [
+ "libavcodec/arm/mpegaudiodsp_fixed_armv6.S",
+ "libavcodec/arm/startcode_armv6.S",
+ ]
+}
+
+if ((cpu_arch == "ia32" || cpu_arch == "x64") && (ffmpeg_branding == "Chrome" || ffmpeg_branding == "ChromeOS")) {
+ ffmpeg_c_sources += [
+ "libavcodec/x86/dct_init.c",
+ "libavcodec/x86/h264_qpel.c",
+ "libavcodec/x86/h264chroma_init.c",
+ "libavcodec/x86/h264dsp_init.c",
+ "libavcodec/x86/mpegaudiodsp.c",
+ "libavcodec/x86/sbrdsp_init.c",
+ ]
+ ffmpeg_yasm_sources += [
+ "libavcodec/x86/dct32.asm",
+ "libavcodec/x86/h264_chromamc.asm",
+ "libavcodec/x86/h264_chromamc_10bit.asm",
+ "libavcodec/x86/h264_deblock.asm",
+ "libavcodec/x86/h264_deblock_10bit.asm",
+ "libavcodec/x86/h264_idct.asm",
+ "libavcodec/x86/h264_idct_10bit.asm",
+ "libavcodec/x86/h264_qpel_10bit.asm",
+ "libavcodec/x86/h264_qpel_8bit.asm",
+ "libavcodec/x86/h264_weight.asm",
+ "libavcodec/x86/h264_weight_10bit.asm",
+ "libavcodec/x86/imdct36.asm",
+ "libavcodec/x86/qpel.asm",
+ "libavcodec/x86/sbrdsp.asm",
+ ]
+}
+
+if (ffmpeg_branding == "ChromeOS") {
+ ffmpeg_c_sources += [
+ "libavcodec/acelp_filters.c",
+ "libavcodec/acelp_pitch_delay.c",
+ "libavcodec/acelp_vectors.c",
+ "libavcodec/amrnbdec.c",
+ "libavcodec/amrwbdec.c",
+ "libavcodec/celp_filters.c",
+ "libavcodec/celp_math.c",
+ "libavcodec/dsputil.c",
+ "libavcodec/error_resilience.c",
+ "libavcodec/exif.c",
+ "libavcodec/faanidct.c",
+ "libavcodec/flvdec.c",
+ "libavcodec/gsm_parser.c",
+ "libavcodec/gsmdec.c",
+ "libavcodec/gsmdec_data.c",
+ "libavcodec/h263.c",
+ "libavcodec/h263_parser.c",
+ "libavcodec/h263dec.c",
+ "libavcodec/h263dsp.c",
+ "libavcodec/intelh263dec.c",
+ "libavcodec/ituh263dec.c",
+ "libavcodec/jrevdct.c",
+ "libavcodec/lsp.c",
+ "libavcodec/mpeg4video.c",
+ "libavcodec/mpeg4video_parser.c",
+ "libavcodec/mpeg4videodec.c",
+ "libavcodec/mpegutils.c",
+ "libavcodec/mpegvideo.c",
+ "libavcodec/mpegvideo_motion.c",
+ "libavcodec/msgsmdec.c",
+ "libavcodec/simple_idct.c",
+ "libavcodec/tiff_common.c",
+ "libavformat/amr.c",
+ "libavformat/avidec.c",
+ "libavformat/gsmdec.c",
+ ]
+}
+
+if ((cpu_arch == "ia32" || cpu_arch == "x64") && (ffmpeg_branding == "ChromiumOS" || ffmpeg_branding == "ChromeOS")) {
+ ffmpeg_c_sources += [
+ "libavcodec/x86/flacdsp_init.c",
+ ]
+ ffmpeg_yasm_sources += [
+ "libavcodec/x86/flacdsp.asm",
+ ]
+}
+
+if ((cpu_arch == "ia32" || cpu_arch == "x64") && (ffmpeg_branding == "Chrome" || ffmpeg_branding == "Chromium") && (os == "win")) {
+ ffmpeg_c_sources += [
+ "compat/msvcrt/snprintf.c",
+ "compat/strtod.c",
+ ]
+}
+
+if (((cpu_arch == "arm" && arm_use_neon)) && (ffmpeg_branding == "Chrome" || ffmpeg_branding == "ChromeOS")) {
+ ffmpeg_gas_sources += [
+ "libavcodec/arm/aacpsdsp_neon.S",
+ "libavcodec/arm/h264cmc_neon.S",
+ "libavcodec/arm/h264dsp_neon.S",
+ "libavcodec/arm/h264idct_neon.S",
+ "libavcodec/arm/h264qpel_neon.S",
+ "libavcodec/arm/sbrdsp_neon.S",
+ ]
+}
+
+if ((cpu_arch == "arm" || (cpu_arch == "arm" && arm_use_neon)) && (ffmpeg_branding == "ChromeOS")) {
+ ffmpeg_c_sources += [
+ "libavcodec/arm/dsputil_init_arm.c",
+ "libavcodec/arm/dsputil_init_armv5te.c",
+ "libavcodec/arm/dsputil_init_armv6.c",
+ "libavcodec/arm/mpegvideo_arm.c",
+ "libavcodec/arm/mpegvideo_armv5te.c",
+ ]
+ ffmpeg_gas_sources += [
+ "libavcodec/arm/dsputil_arm.S",
+ "libavcodec/arm/dsputil_armv6.S",
+ "libavcodec/arm/jrevdct_arm.S",
+ "libavcodec/arm/mpegvideo_armv5te_s.S",
+ "libavcodec/arm/simple_idct_arm.S",
+ "libavcodec/arm/simple_idct_armv5te.S",
+ "libavcodec/arm/simple_idct_armv6.S",
+ ]
+}
+
+if ((cpu_arch == "ia32" || cpu_arch == "x64") && (ffmpeg_branding == "ChromeOS")) {
+ ffmpeg_c_sources += [
+ "libavcodec/x86/dsputil_init.c",
+ "libavcodec/x86/dsputil_mmx.c",
+ "libavcodec/x86/dsputil_x86.c",
+ "libavcodec/x86/h263dsp_init.c",
+ "libavcodec/x86/idct_mmx_xvid.c",
+ "libavcodec/x86/idct_sse2_xvid.c",
+ "libavcodec/x86/mpegvideo.c",
+ "libavcodec/x86/simple_idct.c",
+ ]
+ ffmpeg_yasm_sources += [
+ "libavcodec/x86/dsputil.asm",
+ "libavcodec/x86/h263_loopfilter.asm",
+ "libavcodec/x86/mpeg4qpel.asm",
+ ]
+}
+
+if (((cpu_arch == "arm" && arm_use_neon)) && (ffmpeg_branding == "ChromeOS")) {
+ ffmpeg_c_sources += [
+ "libavcodec/arm/dsputil_init_neon.c",
+ ]
+ ffmpeg_gas_sources += [
+ "libavcodec/arm/dsputil_neon.S",
+ "libavcodec/arm/int_neon.S",
+ "libavcodec/arm/mpegvideo_neon.S",
+ "libavcodec/arm/simple_idct_neon.S",
+ ]
+}
+
diff --git a/chromium/third_party/ffmpeg/ffmpeg_generated.gypi b/chromium/third_party/ffmpeg/ffmpeg_generated.gypi
index 9951a2a3e80..eeb4612576c 100644
--- a/chromium/third_party/ffmpeg/ffmpeg_generated.gypi
+++ b/chromium/third_party/ffmpeg/ffmpeg_generated.gypi
@@ -1,60 +1,67 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# NOTE: this file is autogenerated by ffmpeg/chromium/scripts/generate_gyp.py
+
{
'variables': {
'conditions': [
['((target_arch == "arm" and arm_neon == 1)) and (ffmpeg_branding == "ChromeOS") and (1)', {
+ 'c_sources': [
+ 'libavcodec/arm/dsputil_init_neon.c',
+ ],
'asm_sources': [
+ 'libavcodec/arm/dsputil_neon.S',
+ 'libavcodec/arm/int_neon.S',
'libavcodec/arm/mpegvideo_neon.S',
+ 'libavcodec/arm/simple_idct_neon.S',
],
}], # ((target_arch == "arm" and arm_neon == 1)) and (ffmpeg_branding == "ChromeOS") and (1)
['(target_arch == "ia32" or target_arch == "x64") and (ffmpeg_branding == "ChromeOS") and (1)', {
'c_sources': [
+ 'libavcodec/x86/dsputil_init.c',
+ 'libavcodec/x86/dsputil_mmx.c',
+ 'libavcodec/x86/dsputil_x86.c',
'libavcodec/x86/h263dsp_init.c',
+ 'libavcodec/x86/idct_mmx_xvid.c',
+ 'libavcodec/x86/idct_sse2_xvid.c',
'libavcodec/x86/mpegvideo.c',
+ 'libavcodec/x86/simple_idct.c',
],
'asm_sources': [
+ 'libavcodec/x86/dsputil.asm',
'libavcodec/x86/h263_loopfilter.asm',
- ],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/x86/h263dsp_init.c',
- '<(shared_generated_dir)/libavcodec/x86/mpegvideo.c',
+ 'libavcodec/x86/mpeg4qpel.asm',
],
}], # (target_arch == "ia32" or target_arch == "x64") and (ffmpeg_branding == "ChromeOS") and (1)
['(target_arch == "arm" or (target_arch == "arm" and arm_neon == 1)) and (ffmpeg_branding == "ChromeOS") and (1)', {
'c_sources': [
+ 'libavcodec/arm/dsputil_init_arm.c',
+ 'libavcodec/arm/dsputil_init_armv5te.c',
+ 'libavcodec/arm/dsputil_init_armv6.c',
'libavcodec/arm/mpegvideo_arm.c',
'libavcodec/arm/mpegvideo_armv5te.c',
],
'asm_sources': [
+ 'libavcodec/arm/dsputil_arm.S',
+ 'libavcodec/arm/dsputil_armv6.S',
+ 'libavcodec/arm/jrevdct_arm.S',
'libavcodec/arm/mpegvideo_armv5te_s.S',
- ],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/arm/mpegvideo_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/mpegvideo_armv5te.c',
+ 'libavcodec/arm/simple_idct_arm.S',
+ 'libavcodec/arm/simple_idct_armv5te.S',
+ 'libavcodec/arm/simple_idct_armv6.S',
],
}], # (target_arch == "arm" or (target_arch == "arm" and arm_neon == 1)) and (ffmpeg_branding == "ChromeOS") and (1)
['((target_arch == "arm" and arm_neon == 1)) and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)', {
- 'c_sources': [
- 'libavcodec/arm/dsputil_init_neon.c',
- ],
'asm_sources': [
'libavcodec/arm/aacpsdsp_neon.S',
- 'libavcodec/arm/dsputil_neon.S',
'libavcodec/arm/h264cmc_neon.S',
'libavcodec/arm/h264dsp_neon.S',
'libavcodec/arm/h264idct_neon.S',
'libavcodec/arm/h264qpel_neon.S',
- 'libavcodec/arm/int_neon.S',
'libavcodec/arm/sbrdsp_neon.S',
- 'libavcodec/arm/simple_idct_neon.S',
- ],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/arm/dsputil_init_neon.c',
],
}], # ((target_arch == "arm" and arm_neon == 1)) and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)
['(target_arch == "ia32" or target_arch == "x64") and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "Chromium") and (OS == "win")', {
@@ -62,59 +69,15 @@
'compat/msvcrt/snprintf.c',
'compat/strtod.c',
],
- 'converter_outputs': [
- '<(shared_generated_dir)/compat/msvcrt/snprintf.c',
- '<(shared_generated_dir)/compat/strtod.c',
- ],
}], # (target_arch == "ia32" or target_arch == "x64") and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "Chromium") and (OS == "win")
- ['(target_arch == "ia32" or target_arch == "x64") and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)', {
+ ['(target_arch == "ia32" or target_arch == "x64") and (ffmpeg_branding == "ChromiumOS" or ffmpeg_branding == "ChromeOS") and (1)', {
'c_sources': [
- 'libavcodec/x86/dct_init.c',
- 'libavcodec/x86/dsputil_init.c',
- 'libavcodec/x86/dsputil_mmx.c',
- 'libavcodec/x86/dsputil_x86.c',
- 'libavcodec/x86/h264_qpel.c',
- 'libavcodec/x86/h264chroma_init.c',
- 'libavcodec/x86/h264dsp_init.c',
- 'libavcodec/x86/idct_mmx_xvid.c',
- 'libavcodec/x86/idct_sse2_xvid.c',
- 'libavcodec/x86/mpegaudiodsp.c',
- 'libavcodec/x86/sbrdsp_init.c',
- 'libavcodec/x86/simple_idct.c',
+ 'libavcodec/x86/flacdsp_init.c',
],
'asm_sources': [
- 'libavcodec/x86/dct32.asm',
- 'libavcodec/x86/dsputil.asm',
- 'libavcodec/x86/h264_chromamc.asm',
- 'libavcodec/x86/h264_chromamc_10bit.asm',
- 'libavcodec/x86/h264_deblock.asm',
- 'libavcodec/x86/h264_deblock_10bit.asm',
- 'libavcodec/x86/h264_idct.asm',
- 'libavcodec/x86/h264_idct_10bit.asm',
- 'libavcodec/x86/h264_qpel_10bit.asm',
- 'libavcodec/x86/h264_qpel_8bit.asm',
- 'libavcodec/x86/h264_weight.asm',
- 'libavcodec/x86/h264_weight_10bit.asm',
- 'libavcodec/x86/imdct36.asm',
- 'libavcodec/x86/mpeg4qpel.asm',
- 'libavcodec/x86/qpel.asm',
- 'libavcodec/x86/sbrdsp.asm',
- ],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/x86/dct_init.c',
- '<(shared_generated_dir)/libavcodec/x86/dsputil_init.c',
- '<(shared_generated_dir)/libavcodec/x86/dsputil_mmx.c',
- '<(shared_generated_dir)/libavcodec/x86/dsputil_x86.c',
- '<(shared_generated_dir)/libavcodec/x86/h264_qpel.c',
- '<(shared_generated_dir)/libavcodec/x86/h264chroma_init.c',
- '<(shared_generated_dir)/libavcodec/x86/h264dsp_init.c',
- '<(shared_generated_dir)/libavcodec/x86/idct_mmx_xvid.c',
- '<(shared_generated_dir)/libavcodec/x86/idct_sse2_xvid.c',
- '<(shared_generated_dir)/libavcodec/x86/mpegaudiodsp.c',
- '<(shared_generated_dir)/libavcodec/x86/sbrdsp_init.c',
- '<(shared_generated_dir)/libavcodec/x86/simple_idct.c',
+ 'libavcodec/x86/flacdsp.asm',
],
- }], # (target_arch == "ia32" or target_arch == "x64") and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)
+ }], # (target_arch == "ia32" or target_arch == "x64") and (ffmpeg_branding == "ChromiumOS" or ffmpeg_branding == "ChromeOS") and (1)
['(1) and (ffmpeg_branding == "ChromeOS") and (1)', {
'c_sources': [
'libavcodec/acelp_filters.c',
@@ -124,6 +87,10 @@
'libavcodec/amrwbdec.c',
'libavcodec/celp_filters.c',
'libavcodec/celp_math.c',
+ 'libavcodec/dsputil.c',
+ 'libavcodec/error_resilience.c',
+ 'libavcodec/exif.c',
+ 'libavcodec/faanidct.c',
'libavcodec/flvdec.c',
'libavcodec/gsm_parser.c',
'libavcodec/gsmdec.c',
@@ -134,53 +101,51 @@
'libavcodec/h263dsp.c',
'libavcodec/intelh263dec.c',
'libavcodec/ituh263dec.c',
+ 'libavcodec/jrevdct.c',
'libavcodec/lsp.c',
'libavcodec/mpeg4video.c',
'libavcodec/mpeg4video_parser.c',
'libavcodec/mpeg4videodec.c',
+ 'libavcodec/mpegutils.c',
'libavcodec/mpegvideo.c',
'libavcodec/mpegvideo_motion.c',
'libavcodec/msgsmdec.c',
+ 'libavcodec/simple_idct.c',
+ 'libavcodec/tiff_common.c',
'libavformat/amr.c',
'libavformat/avidec.c',
'libavformat/gsmdec.c',
],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/acelp_filters.c',
- '<(shared_generated_dir)/libavcodec/acelp_pitch_delay.c',
- '<(shared_generated_dir)/libavcodec/acelp_vectors.c',
- '<(shared_generated_dir)/libavcodec/amrnbdec.c',
- '<(shared_generated_dir)/libavcodec/amrwbdec.c',
- '<(shared_generated_dir)/libavcodec/celp_filters.c',
- '<(shared_generated_dir)/libavcodec/celp_math.c',
- '<(shared_generated_dir)/libavcodec/flvdec.c',
- '<(shared_generated_dir)/libavcodec/gsm_parser.c',
- '<(shared_generated_dir)/libavcodec/gsmdec.c',
- '<(shared_generated_dir)/libavcodec/gsmdec_data.c',
- '<(shared_generated_dir)/libavcodec/h263.c',
- '<(shared_generated_dir)/libavcodec/h263_parser.c',
- '<(shared_generated_dir)/libavcodec/h263dec.c',
- '<(shared_generated_dir)/libavcodec/h263dsp.c',
- '<(shared_generated_dir)/libavcodec/intelh263dec.c',
- '<(shared_generated_dir)/libavcodec/ituh263dec.c',
- '<(shared_generated_dir)/libavcodec/lsp.c',
- '<(shared_generated_dir)/libavcodec/mpeg4video.c',
- '<(shared_generated_dir)/libavcodec/mpeg4video_parser.c',
- '<(shared_generated_dir)/libavcodec/mpeg4videodec.c',
- '<(shared_generated_dir)/libavcodec/mpegvideo.c',
- '<(shared_generated_dir)/libavcodec/mpegvideo_motion.c',
- '<(shared_generated_dir)/libavcodec/msgsmdec.c',
- '<(shared_generated_dir)/libavformat/amr.c',
- '<(shared_generated_dir)/libavformat/avidec.c',
- '<(shared_generated_dir)/libavformat/gsmdec.c',
- ],
}], # (1) and (ffmpeg_branding == "ChromeOS") and (1)
+ ['(target_arch == "ia32" or target_arch == "x64") and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)', {
+ 'c_sources': [
+ 'libavcodec/x86/dct_init.c',
+ 'libavcodec/x86/h264_qpel.c',
+ 'libavcodec/x86/h264chroma_init.c',
+ 'libavcodec/x86/h264dsp_init.c',
+ 'libavcodec/x86/mpegaudiodsp.c',
+ 'libavcodec/x86/sbrdsp_init.c',
+ ],
+ 'asm_sources': [
+ 'libavcodec/x86/dct32.asm',
+ 'libavcodec/x86/h264_chromamc.asm',
+ 'libavcodec/x86/h264_chromamc_10bit.asm',
+ 'libavcodec/x86/h264_deblock.asm',
+ 'libavcodec/x86/h264_deblock_10bit.asm',
+ 'libavcodec/x86/h264_idct.asm',
+ 'libavcodec/x86/h264_idct_10bit.asm',
+ 'libavcodec/x86/h264_qpel_10bit.asm',
+ 'libavcodec/x86/h264_qpel_8bit.asm',
+ 'libavcodec/x86/h264_weight.asm',
+ 'libavcodec/x86/h264_weight_10bit.asm',
+ 'libavcodec/x86/imdct36.asm',
+ 'libavcodec/x86/qpel.asm',
+ 'libavcodec/x86/sbrdsp.asm',
+ ],
+ }], # (target_arch == "ia32" or target_arch == "x64") and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)
['(target_arch == "arm" or (target_arch == "arm" and arm_neon == 1)) and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)', {
'c_sources': [
'libavcodec/arm/aacpsdsp_init_arm.c',
- 'libavcodec/arm/dsputil_init_arm.c',
- 'libavcodec/arm/dsputil_init_armv5te.c',
- 'libavcodec/arm/dsputil_init_armv6.c',
'libavcodec/arm/h264chroma_init_arm.c',
'libavcodec/arm/h264dsp_init_arm.c',
'libavcodec/arm/h264qpel_init_arm.c',
@@ -188,25 +153,8 @@
'libavcodec/arm/sbrdsp_init_arm.c',
],
'asm_sources': [
- 'libavcodec/arm/dsputil_arm.S',
- 'libavcodec/arm/dsputil_armv6.S',
- 'libavcodec/arm/h264dsp_armv6.S',
- 'libavcodec/arm/jrevdct_arm.S',
'libavcodec/arm/mpegaudiodsp_fixed_armv6.S',
- 'libavcodec/arm/simple_idct_arm.S',
- 'libavcodec/arm/simple_idct_armv5te.S',
- 'libavcodec/arm/simple_idct_armv6.S',
- ],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/arm/aacpsdsp_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/dsputil_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/dsputil_init_armv5te.c',
- '<(shared_generated_dir)/libavcodec/arm/dsputil_init_armv6.c',
- '<(shared_generated_dir)/libavcodec/arm/h264chroma_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/h264dsp_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/h264qpel_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/mpegaudiodsp_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/sbrdsp_init_arm.c',
+ 'libavcodec/arm/startcode_armv6.S',
],
}], # (target_arch == "arm" or (target_arch == "arm" and arm_neon == 1)) and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)
['(target_arch == "arm" or (target_arch == "arm" and arm_neon == 1)) and (ffmpeg_branding == "ChromiumOS" or ffmpeg_branding == "ChromeOS") and (1)', {
@@ -216,9 +164,6 @@
'asm_sources': [
'libavcodec/arm/flacdsp_arm.S',
],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/arm/flacdsp_init_arm.c',
- ],
}], # (target_arch == "arm" or (target_arch == "arm" and arm_neon == 1)) and (ffmpeg_branding == "ChromiumOS" or ffmpeg_branding == "ChromeOS") and (1)
['((target_arch == "arm" and arm_neon == 1)) and (1) and (1)', {
'c_sources': [
@@ -240,122 +185,13 @@
'libavcodec/arm/vp8dsp_neon.S',
'libavutil/arm/float_dsp_neon.S',
],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/arm/hpeldsp_init_neon.c',
- '<(shared_generated_dir)/libavcodec/arm/vp8dsp_init_neon.c',
- '<(shared_generated_dir)/libavutil/arm/float_dsp_init_neon.c',
- ],
}], # ((target_arch == "arm" and arm_neon == 1)) and (1) and (1)
- ['(1) and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)', {
- 'c_sources': [
- 'libavcodec/aac_ac3_parser.c',
- 'libavcodec/aac_parser.c',
- 'libavcodec/aacadtsdec.c',
- 'libavcodec/aacdec.c',
- 'libavcodec/aacps.c',
- 'libavcodec/aacpsdsp.c',
- 'libavcodec/aacsbr.c',
- 'libavcodec/aactab.c',
- 'libavcodec/ac3tab.c',
- 'libavcodec/cabac.c',
- 'libavcodec/dct.c',
- 'libavcodec/dct32_fixed.c',
- 'libavcodec/dct32_float.c',
- 'libavcodec/dsputil.c',
- 'libavcodec/error_resilience.c',
- 'libavcodec/faanidct.c',
- 'libavcodec/h264.c',
- 'libavcodec/h264_cabac.c',
- 'libavcodec/h264_cavlc.c',
- 'libavcodec/h264_direct.c',
- 'libavcodec/h264_loopfilter.c',
- 'libavcodec/h264_parser.c',
- 'libavcodec/h264_ps.c',
- 'libavcodec/h264_refs.c',
- 'libavcodec/h264_sei.c',
- 'libavcodec/h264chroma.c',
- 'libavcodec/h264dsp.c',
- 'libavcodec/h264idct.c',
- 'libavcodec/h264qpel.c',
- 'libavcodec/jrevdct.c',
- 'libavcodec/kbdwin.c',
- 'libavcodec/mpegaudio.c',
- 'libavcodec/mpegaudio_parser.c',
- 'libavcodec/mpegaudiodec_fixed.c',
- 'libavcodec/mpegaudiodecheader.c',
- 'libavcodec/mpegaudiodsp.c',
- 'libavcodec/mpegaudiodsp_data.c',
- 'libavcodec/mpegaudiodsp_fixed.c',
- 'libavcodec/mpegaudiodsp_float.c',
- 'libavcodec/sbrdsp.c',
- 'libavcodec/simple_idct.c',
- 'libavcodec/sinewin.c',
- 'libavformat/mov.c',
- 'libavformat/mov_chan.c',
- 'libavformat/mp3dec.c',
- ],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/aac_ac3_parser.c',
- '<(shared_generated_dir)/libavcodec/aac_parser.c',
- '<(shared_generated_dir)/libavcodec/aacadtsdec.c',
- '<(shared_generated_dir)/libavcodec/aacdec.c',
- '<(shared_generated_dir)/libavcodec/aacps.c',
- '<(shared_generated_dir)/libavcodec/aacpsdsp.c',
- '<(shared_generated_dir)/libavcodec/aacsbr.c',
- '<(shared_generated_dir)/libavcodec/aactab.c',
- '<(shared_generated_dir)/libavcodec/ac3tab.c',
- '<(shared_generated_dir)/libavcodec/cabac.c',
- '<(shared_generated_dir)/libavcodec/dct.c',
- '<(shared_generated_dir)/libavcodec/dct32_fixed.c',
- '<(shared_generated_dir)/libavcodec/dct32_float.c',
- '<(shared_generated_dir)/libavcodec/dsputil.c',
- '<(shared_generated_dir)/libavcodec/error_resilience.c',
- '<(shared_generated_dir)/libavcodec/faanidct.c',
- '<(shared_generated_dir)/libavcodec/h264.c',
- '<(shared_generated_dir)/libavcodec/h264_cabac.c',
- '<(shared_generated_dir)/libavcodec/h264_cavlc.c',
- '<(shared_generated_dir)/libavcodec/h264_direct.c',
- '<(shared_generated_dir)/libavcodec/h264_loopfilter.c',
- '<(shared_generated_dir)/libavcodec/h264_parser.c',
- '<(shared_generated_dir)/libavcodec/h264_ps.c',
- '<(shared_generated_dir)/libavcodec/h264_refs.c',
- '<(shared_generated_dir)/libavcodec/h264_sei.c',
- '<(shared_generated_dir)/libavcodec/h264chroma.c',
- '<(shared_generated_dir)/libavcodec/h264dsp.c',
- '<(shared_generated_dir)/libavcodec/h264idct.c',
- '<(shared_generated_dir)/libavcodec/h264qpel.c',
- '<(shared_generated_dir)/libavcodec/jrevdct.c',
- '<(shared_generated_dir)/libavcodec/kbdwin.c',
- '<(shared_generated_dir)/libavcodec/mpegaudio.c',
- '<(shared_generated_dir)/libavcodec/mpegaudio_parser.c',
- '<(shared_generated_dir)/libavcodec/mpegaudiodec_fixed.c',
- '<(shared_generated_dir)/libavcodec/mpegaudiodecheader.c',
- '<(shared_generated_dir)/libavcodec/mpegaudiodsp.c',
- '<(shared_generated_dir)/libavcodec/mpegaudiodsp_data.c',
- '<(shared_generated_dir)/libavcodec/mpegaudiodsp_fixed.c',
- '<(shared_generated_dir)/libavcodec/mpegaudiodsp_float.c',
- '<(shared_generated_dir)/libavcodec/sbrdsp.c',
- '<(shared_generated_dir)/libavcodec/simple_idct.c',
- '<(shared_generated_dir)/libavcodec/sinewin.c',
- '<(shared_generated_dir)/libavformat/mov.c',
- '<(shared_generated_dir)/libavformat/mov_chan.c',
- '<(shared_generated_dir)/libavformat/mp3dec.c',
- ],
- }], # (1) and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)
['(1) and (ffmpeg_branding == "ChromiumOS" or ffmpeg_branding == "ChromeOS") and (1)', {
'c_sources': [
'libavcodec/flac_parser.c',
'libavcodec/flacdec.c',
'libavcodec/flacdsp.c',
'libavformat/flacdec.c',
- 'libavformat/rawdec.c',
- ],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/flac_parser.c',
- '<(shared_generated_dir)/libavcodec/flacdec.c',
- '<(shared_generated_dir)/libavcodec/flacdsp.c',
- '<(shared_generated_dir)/libavformat/flacdec.c',
- '<(shared_generated_dir)/libavformat/rawdec.c',
],
}], # (1) and (ffmpeg_branding == "ChromiumOS" or ffmpeg_branding == "ChromeOS") and (1)
['(target_arch == "ia32" or target_arch == "x64") and (1) and (1)', {
@@ -367,7 +203,6 @@
'libavcodec/x86/h264_intrapred_init.c',
'libavcodec/x86/hpeldsp_init.c',
'libavcodec/x86/hpeldsp_mmx.c',
- 'libavcodec/x86/rnd_mmx.c',
'libavcodec/x86/videodsp_init.c',
'libavcodec/x86/vorbisdsp_init.c',
'libavcodec/x86/vp3dsp_init.c',
@@ -394,24 +229,58 @@
'libavutil/x86/float_dsp.asm',
'libavutil/x86/lls.asm',
],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/x86/constants.c',
- '<(shared_generated_dir)/libavcodec/x86/fft_init.c',
- '<(shared_generated_dir)/libavcodec/x86/fmtconvert_init.c',
- '<(shared_generated_dir)/libavcodec/x86/fpel_mmx.c',
- '<(shared_generated_dir)/libavcodec/x86/h264_intrapred_init.c',
- '<(shared_generated_dir)/libavcodec/x86/hpeldsp_init.c',
- '<(shared_generated_dir)/libavcodec/x86/hpeldsp_mmx.c',
- '<(shared_generated_dir)/libavcodec/x86/rnd_mmx.c',
- '<(shared_generated_dir)/libavcodec/x86/videodsp_init.c',
- '<(shared_generated_dir)/libavcodec/x86/vorbisdsp_init.c',
- '<(shared_generated_dir)/libavcodec/x86/vp3dsp_init.c',
- '<(shared_generated_dir)/libavcodec/x86/vp8dsp_init.c',
- '<(shared_generated_dir)/libavutil/x86/cpu.c',
- '<(shared_generated_dir)/libavutil/x86/float_dsp_init.c',
- '<(shared_generated_dir)/libavutil/x86/lls_init.c',
- ],
}], # (target_arch == "ia32" or target_arch == "x64") and (1) and (1)
+ ['(1) and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)', {
+ 'c_sources': [
+ 'libavcodec/aac_ac3_parser.c',
+ 'libavcodec/aac_parser.c',
+ 'libavcodec/aacadtsdec.c',
+ 'libavcodec/aacdec.c',
+ 'libavcodec/aacps.c',
+ 'libavcodec/aacpsdsp.c',
+ 'libavcodec/aacsbr.c',
+ 'libavcodec/aactab.c',
+ 'libavcodec/ac3tab.c',
+ 'libavcodec/cabac.c',
+ 'libavcodec/dct.c',
+ 'libavcodec/dct32_fixed.c',
+ 'libavcodec/dct32_float.c',
+ 'libavcodec/h264.c',
+ 'libavcodec/h264_cabac.c',
+ 'libavcodec/h264_cavlc.c',
+ 'libavcodec/h264_direct.c',
+ 'libavcodec/h264_loopfilter.c',
+ 'libavcodec/h264_mb.c',
+ 'libavcodec/h264_parser.c',
+ 'libavcodec/h264_picture.c',
+ 'libavcodec/h264_ps.c',
+ 'libavcodec/h264_refs.c',
+ 'libavcodec/h264_sei.c',
+ 'libavcodec/h264_slice.c',
+ 'libavcodec/h264chroma.c',
+ 'libavcodec/h264dsp.c',
+ 'libavcodec/h264idct.c',
+ 'libavcodec/h264qpel.c',
+ 'libavcodec/kbdwin.c',
+ 'libavcodec/mpegaudio.c',
+ 'libavcodec/mpegaudio_parser.c',
+ 'libavcodec/mpegaudiodec_fixed.c',
+ 'libavcodec/mpegaudiodecheader.c',
+ 'libavcodec/mpegaudiodsp.c',
+ 'libavcodec/mpegaudiodsp_data.c',
+ 'libavcodec/mpegaudiodsp_fixed.c',
+ 'libavcodec/mpegaudiodsp_float.c',
+ 'libavcodec/sbrdsp.c',
+ 'libavcodec/sinewin.c',
+ 'libavcodec/startcode.c',
+ 'libavformat/aacdec.c',
+ 'libavformat/apetag.c',
+ 'libavformat/img2.c',
+ 'libavformat/mov.c',
+ 'libavformat/mov_chan.c',
+ 'libavformat/mp3dec.c',
+ ],
+ }], # (1) and (ffmpeg_branding == "Chrome" or ffmpeg_branding == "ChromeOS") and (1)
['(target_arch == "arm" or (target_arch == "arm" and arm_neon == 1)) and (1) and (1)', {
'c_sources': [
'libavcodec/arm/fft_fixed_init_arm.c',
@@ -442,24 +311,12 @@
'libavcodec/arm/vp8dsp_armv6.S',
'libavutil/arm/float_dsp_vfp.S',
],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/arm/fft_fixed_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/fft_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/fmtconvert_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/h264pred_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/hpeldsp_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/hpeldsp_init_armv6.c',
- '<(shared_generated_dir)/libavcodec/arm/videodsp_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/videodsp_init_armv5te.c',
- '<(shared_generated_dir)/libavcodec/arm/vorbisdsp_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/vp3dsp_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/vp8dsp_init_arm.c',
- '<(shared_generated_dir)/libavcodec/arm/vp8dsp_init_armv6.c',
- '<(shared_generated_dir)/libavutil/arm/cpu.c',
- '<(shared_generated_dir)/libavutil/arm/float_dsp_init_arm.c',
- '<(shared_generated_dir)/libavutil/arm/float_dsp_init_vfp.c',
- ],
}], # (target_arch == "arm" or (target_arch == "arm" and arm_neon == 1)) and (1) and (1)
+ ['(1) and (ffmpeg_branding == "ChromiumOS" or ffmpeg_branding == "ChromeOS" or ffmpeg_branding == "Chrome") and (1)', {
+ 'c_sources': [
+ 'libavformat/rawdec.c',
+ ],
+ }], # (1) and (ffmpeg_branding == "ChromiumOS" or ffmpeg_branding == "ChromeOS" or ffmpeg_branding == "Chrome") and (1)
['(1) and (1) and (1)', {
'c_sources': [
'libavcodec/allcodecs.c',
@@ -489,13 +346,14 @@
'libavcodec/mpeg4audio.c',
'libavcodec/mpegaudiodata.c',
'libavcodec/options.c',
+ 'libavcodec/opus.c',
+ 'libavcodec/opus_parser.c',
'libavcodec/parser.c',
'libavcodec/pcm.c',
'libavcodec/pthread.c',
'libavcodec/pthread_frame.c',
'libavcodec/pthread_slice.c',
'libavcodec/raw.c',
- 'libavcodec/rawdec.c',
'libavcodec/rdft.c',
'libavcodec/utils.c',
'libavcodec/videodsp.c',
@@ -535,9 +393,11 @@
'libavformat/oggparsespeex.c',
'libavformat/oggparsetheora.c',
'libavformat/oggparsevorbis.c',
+ 'libavformat/oggparsevp8.c',
'libavformat/options.c',
'libavformat/os_support.c',
'libavformat/pcm.c',
+ 'libavformat/replaygain.c',
'libavformat/riff.c',
'libavformat/riffdec.c',
'libavformat/rmsipr.c',
@@ -555,10 +415,12 @@
'libavutil/cpu.c',
'libavutil/crc.c',
'libavutil/dict.c',
+ 'libavutil/downmix_info.c',
'libavutil/error.c',
'libavutil/eval.c',
'libavutil/fifo.c',
'libavutil/file_open.c',
+ 'libavutil/fixed_dsp.c',
'libavutil/float_dsp.c',
'libavutil/frame.c',
'libavutil/imgutils.c',
@@ -584,686 +446,7 @@
'libavutil/timecode.c',
'libavutil/utils.c',
],
- 'converter_outputs': [
- '<(shared_generated_dir)/libavcodec/allcodecs.c',
- '<(shared_generated_dir)/libavcodec/avfft.c',
- '<(shared_generated_dir)/libavcodec/avpacket.c',
- '<(shared_generated_dir)/libavcodec/avpicture.c',
- '<(shared_generated_dir)/libavcodec/bitstream.c',
- '<(shared_generated_dir)/libavcodec/bitstream_filter.c',
- '<(shared_generated_dir)/libavcodec/codec_desc.c',
- '<(shared_generated_dir)/libavcodec/dirac.c',
- '<(shared_generated_dir)/libavcodec/fft_fixed.c',
- '<(shared_generated_dir)/libavcodec/fft_fixed_32.c',
- '<(shared_generated_dir)/libavcodec/fft_float.c',
- '<(shared_generated_dir)/libavcodec/fft_init_table.c',
- '<(shared_generated_dir)/libavcodec/flac.c',
- '<(shared_generated_dir)/libavcodec/flacdata.c',
- '<(shared_generated_dir)/libavcodec/fmtconvert.c',
- '<(shared_generated_dir)/libavcodec/golomb.c',
- '<(shared_generated_dir)/libavcodec/h264pred.c',
- '<(shared_generated_dir)/libavcodec/hpeldsp.c',
- '<(shared_generated_dir)/libavcodec/imgconvert.c',
- '<(shared_generated_dir)/libavcodec/mathtables.c',
- '<(shared_generated_dir)/libavcodec/mdct_fixed.c',
- '<(shared_generated_dir)/libavcodec/mdct_fixed_32.c',
- '<(shared_generated_dir)/libavcodec/mdct_float.c',
- '<(shared_generated_dir)/libavcodec/mpeg12data.c',
- '<(shared_generated_dir)/libavcodec/mpeg4audio.c',
- '<(shared_generated_dir)/libavcodec/mpegaudiodata.c',
- '<(shared_generated_dir)/libavcodec/options.c',
- '<(shared_generated_dir)/libavcodec/parser.c',
- '<(shared_generated_dir)/libavcodec/pcm.c',
- '<(shared_generated_dir)/libavcodec/pthread.c',
- '<(shared_generated_dir)/libavcodec/pthread_frame.c',
- '<(shared_generated_dir)/libavcodec/pthread_slice.c',
- '<(shared_generated_dir)/libavcodec/raw.c',
- '<(shared_generated_dir)/libavcodec/rawdec.c',
- '<(shared_generated_dir)/libavcodec/rdft.c',
- '<(shared_generated_dir)/libavcodec/utils.c',
- '<(shared_generated_dir)/libavcodec/videodsp.c',
- '<(shared_generated_dir)/libavcodec/vorbis.c',
- '<(shared_generated_dir)/libavcodec/vorbis_data.c',
- '<(shared_generated_dir)/libavcodec/vorbis_parser.c',
- '<(shared_generated_dir)/libavcodec/vorbisdec.c',
- '<(shared_generated_dir)/libavcodec/vorbisdsp.c',
- '<(shared_generated_dir)/libavcodec/vp3.c',
- '<(shared_generated_dir)/libavcodec/vp3_parser.c',
- '<(shared_generated_dir)/libavcodec/vp3dsp.c',
- '<(shared_generated_dir)/libavcodec/vp56rac.c',
- '<(shared_generated_dir)/libavcodec/vp8.c',
- '<(shared_generated_dir)/libavcodec/vp8_parser.c',
- '<(shared_generated_dir)/libavcodec/vp8dsp.c',
- '<(shared_generated_dir)/libavcodec/xiph.c',
- '<(shared_generated_dir)/libavformat/allformats.c',
- '<(shared_generated_dir)/libavformat/avio.c',
- '<(shared_generated_dir)/libavformat/aviobuf.c',
- '<(shared_generated_dir)/libavformat/cutils.c',
- '<(shared_generated_dir)/libavformat/flac_picture.c',
- '<(shared_generated_dir)/libavformat/format.c',
- '<(shared_generated_dir)/libavformat/id3v1.c',
- '<(shared_generated_dir)/libavformat/id3v2.c',
- '<(shared_generated_dir)/libavformat/isom.c',
- '<(shared_generated_dir)/libavformat/matroska.c',
- '<(shared_generated_dir)/libavformat/matroskadec.c',
- '<(shared_generated_dir)/libavformat/metadata.c',
- '<(shared_generated_dir)/libavformat/mux.c',
- '<(shared_generated_dir)/libavformat/oggdec.c',
- '<(shared_generated_dir)/libavformat/oggparsecelt.c',
- '<(shared_generated_dir)/libavformat/oggparsedirac.c',
- '<(shared_generated_dir)/libavformat/oggparseflac.c',
- '<(shared_generated_dir)/libavformat/oggparseogm.c',
- '<(shared_generated_dir)/libavformat/oggparseopus.c',
- '<(shared_generated_dir)/libavformat/oggparseskeleton.c',
- '<(shared_generated_dir)/libavformat/oggparsespeex.c',
- '<(shared_generated_dir)/libavformat/oggparsetheora.c',
- '<(shared_generated_dir)/libavformat/oggparsevorbis.c',
- '<(shared_generated_dir)/libavformat/options.c',
- '<(shared_generated_dir)/libavformat/os_support.c',
- '<(shared_generated_dir)/libavformat/pcm.c',
- '<(shared_generated_dir)/libavformat/riff.c',
- '<(shared_generated_dir)/libavformat/riffdec.c',
- '<(shared_generated_dir)/libavformat/rmsipr.c',
- '<(shared_generated_dir)/libavformat/seek.c',
- '<(shared_generated_dir)/libavformat/url.c',
- '<(shared_generated_dir)/libavformat/utils.c',
- '<(shared_generated_dir)/libavformat/vorbiscomment.c',
- '<(shared_generated_dir)/libavformat/wavdec.c',
- '<(shared_generated_dir)/libavutil/atomic.c',
- '<(shared_generated_dir)/libavutil/avstring.c',
- '<(shared_generated_dir)/libavutil/base64.c',
- '<(shared_generated_dir)/libavutil/bprint.c',
- '<(shared_generated_dir)/libavutil/buffer.c',
- '<(shared_generated_dir)/libavutil/channel_layout.c',
- '<(shared_generated_dir)/libavutil/cpu.c',
- '<(shared_generated_dir)/libavutil/crc.c',
- '<(shared_generated_dir)/libavutil/dict.c',
- '<(shared_generated_dir)/libavutil/error.c',
- '<(shared_generated_dir)/libavutil/eval.c',
- '<(shared_generated_dir)/libavutil/fifo.c',
- '<(shared_generated_dir)/libavutil/file_open.c',
- '<(shared_generated_dir)/libavutil/float_dsp.c',
- '<(shared_generated_dir)/libavutil/frame.c',
- '<(shared_generated_dir)/libavutil/imgutils.c',
- '<(shared_generated_dir)/libavutil/intfloat_readwrite.c',
- '<(shared_generated_dir)/libavutil/intmath.c',
- '<(shared_generated_dir)/libavutil/lfg.c',
- '<(shared_generated_dir)/libavutil/lls1.c',
- '<(shared_generated_dir)/libavutil/lls2.c',
- '<(shared_generated_dir)/libavutil/log.c',
- '<(shared_generated_dir)/libavutil/log2_tab.c',
- '<(shared_generated_dir)/libavutil/mathematics.c',
- '<(shared_generated_dir)/libavutil/md5.c',
- '<(shared_generated_dir)/libavutil/mem.c',
- '<(shared_generated_dir)/libavutil/opt.c',
- '<(shared_generated_dir)/libavutil/parseutils.c',
- '<(shared_generated_dir)/libavutil/pixdesc.c',
- '<(shared_generated_dir)/libavutil/random_seed.c',
- '<(shared_generated_dir)/libavutil/rational.c',
- '<(shared_generated_dir)/libavutil/samplefmt.c',
- '<(shared_generated_dir)/libavutil/sha.c',
- '<(shared_generated_dir)/libavutil/stereo3d.c',
- '<(shared_generated_dir)/libavutil/time.c',
- '<(shared_generated_dir)/libavutil/timecode.c',
- '<(shared_generated_dir)/libavutil/utils.c',
- ],
}], # (1) and (1) and (1)
], # conditions
- 'c_headers': [
- 'compat/aix/math.h',
- 'compat/avisynth/avisynth_c.h',
- 'compat/avisynth/avisynth_c_25.h',
- 'compat/avisynth/avxsynth_c.h',
- 'compat/avisynth/windowsPorts/basicDataTypeConversions.h',
- 'compat/avisynth/windowsPorts/windows2linux.h',
- 'compat/msvcrt/snprintf.h',
- 'compat/os2threads.h',
- 'compat/tms470/math.h',
- 'compat/va_copy.h',
- 'compat/w32pthreads.h',
- 'libavcodec/a64colors.h',
- 'libavcodec/a64tables.h',
- 'libavcodec/aac.h',
- 'libavcodec/aac_ac3_parser.h',
- 'libavcodec/aac_tablegen.h',
- 'libavcodec/aac_tablegen_decl.h',
- 'libavcodec/aacadtsdec.h',
- 'libavcodec/aacdectab.h',
- 'libavcodec/aacenc.h',
- 'libavcodec/aacps.h',
- 'libavcodec/aacps_tablegen.h',
- 'libavcodec/aacpsdsp.h',
- 'libavcodec/aacsbr.h',
- 'libavcodec/aacsbrdata.h',
- 'libavcodec/aactab.h',
- 'libavcodec/aandcttab.h',
- 'libavcodec/ac3.h',
- 'libavcodec/ac3_parser.h',
- 'libavcodec/ac3dec.h',
- 'libavcodec/ac3dec_data.h',
- 'libavcodec/ac3dsp.h',
- 'libavcodec/ac3enc.h',
- 'libavcodec/ac3tab.h',
- 'libavcodec/acelp_filters.h',
- 'libavcodec/acelp_pitch_delay.h',
- 'libavcodec/acelp_vectors.h',
- 'libavcodec/adpcm.h',
- 'libavcodec/adpcm_data.h',
- 'libavcodec/adx.h',
- 'libavcodec/alac_data.h',
- 'libavcodec/alpha/asm.h',
- 'libavcodec/alpha/dsputil_alpha.h',
- 'libavcodec/alpha/hpeldsp_alpha.h',
- 'libavcodec/alpha/regdef.h',
- 'libavcodec/amr.h',
- 'libavcodec/amrnbdata.h',
- 'libavcodec/amrwbdata.h',
- 'libavcodec/arm/aac.h',
- 'libavcodec/arm/asm-offsets.h',
- 'libavcodec/arm/dca.h',
- 'libavcodec/arm/dsputil_arm.h',
- 'libavcodec/arm/hpeldsp_arm.h',
- 'libavcodec/arm/mathops.h',
- 'libavcodec/arm/mpegvideo_arm.h',
- 'libavcodec/arm/videodsp_arm.h',
- 'libavcodec/arm/vp56_arith.h',
- 'libavcodec/arm/vp8.h',
- 'libavcodec/arm/vp8dsp.h',
- 'libavcodec/ass.h',
- 'libavcodec/ass_split.h',
- 'libavcodec/asv.h',
- 'libavcodec/atrac.h',
- 'libavcodec/atrac1data.h',
- 'libavcodec/atrac3data.h',
- 'libavcodec/audio_frame_queue.h',
- 'libavcodec/audioconvert.h',
- 'libavcodec/avcodec.h',
- 'libavcodec/avfft.h',
- 'libavcodec/avr32/mathops.h',
- 'libavcodec/bethsoftvideo.h',
- 'libavcodec/bfin/config_bfin.h',
- 'libavcodec/bfin/dsputil_bfin.h',
- 'libavcodec/bfin/hpeldsp_bfin.h',
- 'libavcodec/bfin/mathops.h',
- 'libavcodec/bfin/vp3_bfin.h',
- 'libavcodec/bgmc.h',
- 'libavcodec/binkdata.h',
- 'libavcodec/binkdsp.h',
- 'libavcodec/bintext.h',
- 'libavcodec/bmp.h',
- 'libavcodec/bytestream.h',
- 'libavcodec/cabac.h',
- 'libavcodec/cabac_functions.h',
- 'libavcodec/cavs.h',
- 'libavcodec/cavsdsp.h',
- 'libavcodec/cbrt_tablegen.h',
- 'libavcodec/celp_filters.h',
- 'libavcodec/celp_math.h',
- 'libavcodec/cga_data.h',
- 'libavcodec/cookdata.h',
- 'libavcodec/copy_block.h',
- 'libavcodec/dca.h',
- 'libavcodec/dcadata.h',
- 'libavcodec/dcadsp.h',
- 'libavcodec/dcaenc.h',
- 'libavcodec/dcahuff.h',
- 'libavcodec/dct.h',
- 'libavcodec/dct32.h',
- 'libavcodec/dctref.h',
- 'libavcodec/dirac.h',
- 'libavcodec/dirac_arith.h',
- 'libavcodec/dirac_dwt.h',
- 'libavcodec/diracdsp.h',
- 'libavcodec/dnxhddata.h',
- 'libavcodec/dnxhdenc.h',
- 'libavcodec/dsputil.h',
- 'libavcodec/dv.h',
- 'libavcodec/dv_profile.h',
- 'libavcodec/dv_tablegen.h',
- 'libavcodec/dvdata.h',
- 'libavcodec/dxva2.h',
- 'libavcodec/dxva2_internal.h',
- 'libavcodec/eac3_data.h',
- 'libavcodec/eac3enc.h',
- 'libavcodec/eaidct.h',
- 'libavcodec/elbg.h',
- 'libavcodec/error_resilience.h',
- 'libavcodec/evrcdata.h',
- 'libavcodec/exif.h',
- 'libavcodec/faandct.h',
- 'libavcodec/faanidct.h',
- 'libavcodec/faxcompr.h',
- 'libavcodec/fft-internal.h',
- 'libavcodec/fft.h',
- 'libavcodec/fft_table.h',
- 'libavcodec/ffv1.h',
- 'libavcodec/flac.h',
- 'libavcodec/flacdata.h',
- 'libavcodec/flacdsp.h',
- 'libavcodec/flv.h',
- 'libavcodec/fmtconvert.h',
- 'libavcodec/frame_thread_encoder.h',
- 'libavcodec/g722.h',
- 'libavcodec/g723_1_data.h',
- 'libavcodec/g729.h',
- 'libavcodec/g729data.h',
- 'libavcodec/g729postfilter.h',
- 'libavcodec/get_bits.h',
- 'libavcodec/gif.h',
- 'libavcodec/golomb.h',
- 'libavcodec/gsm.h',
- 'libavcodec/gsmdec_data.h',
- 'libavcodec/h261.h',
- 'libavcodec/h263.h',
- 'libavcodec/h263_parser.h',
- 'libavcodec/h263data.h',
- 'libavcodec/h263dsp.h',
- 'libavcodec/h264.h',
- 'libavcodec/h264_mvpred.h',
- 'libavcodec/h264chroma.h',
- 'libavcodec/h264data.h',
- 'libavcodec/h264dsp.h',
- 'libavcodec/h264idct.h',
- 'libavcodec/h264pred.h',
- 'libavcodec/h264qpel.h',
- 'libavcodec/hevc.h',
- 'libavcodec/hevcdsp.h',
- 'libavcodec/hevcpred.h',
- 'libavcodec/hpeldsp.h',
- 'libavcodec/huffman.h',
- 'libavcodec/huffyuv.h',
- 'libavcodec/iirfilter.h',
- 'libavcodec/imcdata.h',
- 'libavcodec/imgconvert.h',
- 'libavcodec/indeo2data.h',
- 'libavcodec/indeo3data.h',
- 'libavcodec/indeo4data.h',
- 'libavcodec/indeo5data.h',
- 'libavcodec/internal.h',
- 'libavcodec/intrax8.h',
- 'libavcodec/intrax8dsp.h',
- 'libavcodec/intrax8huf.h',
- 'libavcodec/ivi_common.h',
- 'libavcodec/ivi_dsp.h',
- 'libavcodec/jacosub.h',
- 'libavcodec/jpeg2000.h',
- 'libavcodec/jpeg2000dwt.h',
- 'libavcodec/jpegls.h',
- 'libavcodec/jpeglsdec.h',
- 'libavcodec/kbdwin.h',
- 'libavcodec/lagarithrac.h',
- 'libavcodec/lcl.h',
- 'libavcodec/libopus.h',
- 'libavcodec/libschroedinger.h',
- 'libavcodec/libutvideo.h',
- 'libavcodec/libvpx.h',
- 'libavcodec/libxvid.h',
- 'libavcodec/lpc.h',
- 'libavcodec/lsp.h',
- 'libavcodec/lzw.h',
- 'libavcodec/mathops.h',
- 'libavcodec/metasound_data.h',
- 'libavcodec/mips/aacdec_mips.h',
- 'libavcodec/mips/aacpsy_mips.h',
- 'libavcodec/mips/aacsbr_mips.h',
- 'libavcodec/mips/amrwbdec_mips.h',
- 'libavcodec/mips/compute_antialias_fixed.h',
- 'libavcodec/mips/compute_antialias_float.h',
- 'libavcodec/mips/lsp_mips.h',
- 'libavcodec/mips/mathops.h',
- 'libavcodec/mjpeg.h',
- 'libavcodec/mjpegdec.h',
- 'libavcodec/mjpegenc.h',
- 'libavcodec/mlp.h',
- 'libavcodec/mlp_parser.h',
- 'libavcodec/mlpdsp.h',
- 'libavcodec/motionpixels_tablegen.h',
- 'libavcodec/mpc.h',
- 'libavcodec/mpc7data.h',
- 'libavcodec/mpc8data.h',
- 'libavcodec/mpc8huff.h',
- 'libavcodec/mpcdata.h',
- 'libavcodec/mpeg12.h',
- 'libavcodec/mpeg12data.h',
- 'libavcodec/mpeg4audio.h',
- 'libavcodec/mpeg4data.h',
- 'libavcodec/mpeg4video.h',
- 'libavcodec/mpeg4video_parser.h',
- 'libavcodec/mpegaudio.h',
- 'libavcodec/mpegaudio_tablegen.h',
- 'libavcodec/mpegaudiodata.h',
- 'libavcodec/mpegaudiodecheader.h',
- 'libavcodec/mpegaudiodectab.h',
- 'libavcodec/mpegaudiodsp.h',
- 'libavcodec/mpegaudiotab.h',
- 'libavcodec/mpegvideo.h',
- 'libavcodec/mqc.h',
- 'libavcodec/msgsmdec.h',
- 'libavcodec/msmpeg4.h',
- 'libavcodec/msmpeg4data.h',
- 'libavcodec/msrledec.h',
- 'libavcodec/mss12.h',
- 'libavcodec/mss2dsp.h',
- 'libavcodec/mss34dsp.h',
- 'libavcodec/nellymoser.h',
- 'libavcodec/old_codec_ids.h',
- 'libavcodec/options_table.h',
- 'libavcodec/paf.h',
- 'libavcodec/parser.h',
- 'libavcodec/pcm_tablegen.h',
- 'libavcodec/png.h',
- 'libavcodec/pngdsp.h',
- 'libavcodec/pnm.h',
- 'libavcodec/ppc/dsputil_altivec.h',
- 'libavcodec/ppc/mathops.h',
- 'libavcodec/proresdata.h',
- 'libavcodec/proresdec.h',
- 'libavcodec/proresdsp.h',
- 'libavcodec/psymodel.h',
- 'libavcodec/pthread_internal.h',
- 'libavcodec/put_bits.h',
- 'libavcodec/qcelpdata.h',
- 'libavcodec/qdm2_tablegen.h',
- 'libavcodec/qdm2data.h',
- 'libavcodec/ra144.h',
- 'libavcodec/ra288.h',
- 'libavcodec/ralfdata.h',
- 'libavcodec/rangecoder.h',
- 'libavcodec/ratecontrol.h',
- 'libavcodec/raw.h',
- 'libavcodec/rdft.h',
- 'libavcodec/rectangle.h',
- 'libavcodec/rl.h',
- 'libavcodec/rle.h',
- 'libavcodec/rnd_avg.h',
- 'libavcodec/roqvideo.h',
- 'libavcodec/rtjpeg.h',
- 'libavcodec/rv30data.h',
- 'libavcodec/rv34.h',
- 'libavcodec/rv34data.h',
- 'libavcodec/rv34dsp.h',
- 'libavcodec/rv34vlc.h',
- 'libavcodec/rv40data.h',
- 'libavcodec/rv40vlc2.h',
- 'libavcodec/s3tc.h',
- 'libavcodec/sanm_data.h',
- 'libavcodec/sbr.h',
- 'libavcodec/sbrdsp.h',
- 'libavcodec/sgi.h',
- 'libavcodec/sh4/dsputil_sh4.h',
- 'libavcodec/sh4/sh4.h',
- 'libavcodec/simple_idct.h',
- 'libavcodec/sinewin.h',
- 'libavcodec/sinewin_tablegen.h',
- 'libavcodec/sipr.h',
- 'libavcodec/sipr16kdata.h',
- 'libavcodec/siprdata.h',
- 'libavcodec/snow.h',
- 'libavcodec/snow_dwt.h',
- 'libavcodec/snowdata.h',
- 'libavcodec/sp5x.h',
- 'libavcodec/sparc/dsputil_vis.h',
- 'libavcodec/sparc/vis.h',
- 'libavcodec/sunrast.h',
- 'libavcodec/svq1.h',
- 'libavcodec/svq1_cb.h',
- 'libavcodec/svq1_vlc.h',
- 'libavcodec/svq1enc_cb.h',
- 'libavcodec/svq3.h',
- 'libavcodec/synth_filter.h',
- 'libavcodec/tableprint.h',
- 'libavcodec/tak.h',
- 'libavcodec/targa.h',
- 'libavcodec/thread.h',
- 'libavcodec/tiff.h',
- 'libavcodec/tiff_common.h',
- 'libavcodec/tiff_data.h',
- 'libavcodec/truemotion1data.h',
- 'libavcodec/truespeech_data.h',
- 'libavcodec/tscc2data.h',
- 'libavcodec/ttadata.h',
- 'libavcodec/twinvq.h',
- 'libavcodec/twinvq_data.h',
- 'libavcodec/ulti_cb.h',
- 'libavcodec/unary.h',
- 'libavcodec/utvideo.h',
- 'libavcodec/v210dec.h',
- 'libavcodec/vaapi.h',
- 'libavcodec/vaapi_internal.h',
- 'libavcodec/vc1.h',
- 'libavcodec/vc1acdata.h',
- 'libavcodec/vc1data.h',
- 'libavcodec/vc1dsp.h',
- 'libavcodec/vda.h',
- 'libavcodec/vdpau.h',
- 'libavcodec/vdpau_internal.h',
- 'libavcodec/version.h',
- 'libavcodec/videodsp.h',
- 'libavcodec/vorbis.h',
- 'libavcodec/vorbis_enc_data.h',
- 'libavcodec/vorbis_parser.h',
- 'libavcodec/vorbisdsp.h',
- 'libavcodec/vp3data.h',
- 'libavcodec/vp3dsp.h',
- 'libavcodec/vp56.h',
- 'libavcodec/vp56data.h',
- 'libavcodec/vp56dsp.h',
- 'libavcodec/vp5data.h',
- 'libavcodec/vp6data.h',
- 'libavcodec/vp8.h',
- 'libavcodec/vp8data.h',
- 'libavcodec/vp8dsp.h',
- 'libavcodec/vp9.h',
- 'libavcodec/vp9data.h',
- 'libavcodec/vp9dsp.h',
- 'libavcodec/wavpack.h',
- 'libavcodec/wavpackenc.h',
- 'libavcodec/wma.h',
- 'libavcodec/wma_common.h',
- 'libavcodec/wmadata.h',
- 'libavcodec/wmaprodata.h',
- 'libavcodec/wmavoice_data.h',
- 'libavcodec/wmv2.h',
- 'libavcodec/wmv2dsp.h',
- 'libavcodec/x86/cabac.h',
- 'libavcodec/x86/constants.h',
- 'libavcodec/x86/dirac_dwt.h',
- 'libavcodec/x86/diracdsp_mmx.h',
- 'libavcodec/x86/dsputil_x86.h',
- 'libavcodec/x86/fft.h',
- 'libavcodec/x86/h264_i386.h',
- 'libavcodec/x86/idct_xvid.h',
- 'libavcodec/x86/mathops.h',
- 'libavcodec/x86/vc1dsp.h',
- 'libavcodec/x86/vp56_arith.h',
- 'libavcodec/xface.h',
- 'libavcodec/xiph.h',
- 'libavcodec/xvmc.h',
- 'libavcodec/xvmc_internal.h',
- 'libavcodec/xwd.h',
- 'libavformat/aiff.h',
- 'libavformat/apetag.h',
- 'libavformat/asf.h',
- 'libavformat/asfcrypt.h',
- 'libavformat/ast.h',
- 'libavformat/audiointerleave.h',
- 'libavformat/avc.h',
- 'libavformat/avformat.h',
- 'libavformat/avi.h',
- 'libavformat/avio.h',
- 'libavformat/avio_internal.h',
- 'libavformat/avlanguage.h',
- 'libavformat/caf.h',
- 'libavformat/dv.h',
- 'libavformat/ffm.h',
- 'libavformat/ffmeta.h',
- 'libavformat/flac_picture.h',
- 'libavformat/flacenc.h',
- 'libavformat/flv.h',
- 'libavformat/gxf.h',
- 'libavformat/http.h',
- 'libavformat/httpauth.h',
- 'libavformat/id3v1.h',
- 'libavformat/id3v2.h',
- 'libavformat/internal.h',
- 'libavformat/ircam.h',
- 'libavformat/isom.h',
- 'libavformat/matroska.h',
- 'libavformat/metadata.h',
- 'libavformat/mms.h',
- 'libavformat/mov_chan.h',
- 'libavformat/movenc.h',
- 'libavformat/mpeg.h',
- 'libavformat/mpegts.h',
- 'libavformat/mxf.h',
- 'libavformat/network.h',
- 'libavformat/nut.h',
- 'libavformat/oggdec.h',
- 'libavformat/oma.h',
- 'libavformat/options_table.h',
- 'libavformat/os_support.h',
- 'libavformat/pcm.h',
- 'libavformat/qtpalette.h',
- 'libavformat/rawdec.h',
- 'libavformat/rawenc.h',
- 'libavformat/rdt.h',
- 'libavformat/riff.h',
- 'libavformat/rm.h',
- 'libavformat/rmsipr.h',
- 'libavformat/rso.h',
- 'libavformat/rtmp.h',
- 'libavformat/rtmpcrypt.h',
- 'libavformat/rtmpdh.h',
- 'libavformat/rtmppkt.h',
- 'libavformat/rtp.h',
- 'libavformat/rtpdec.h',
- 'libavformat/rtpdec_formats.h',
- 'libavformat/rtpenc.h',
- 'libavformat/rtpenc_chain.h',
- 'libavformat/rtpproto.h',
- 'libavformat/rtsp.h',
- 'libavformat/rtspcodes.h',
- 'libavformat/sauce.h',
- 'libavformat/seek.h',
- 'libavformat/smjpeg.h',
- 'libavformat/sox.h',
- 'libavformat/spdif.h',
- 'libavformat/srtp.h',
- 'libavformat/subtitles.h',
- 'libavformat/swf.h',
- 'libavformat/url.h',
- 'libavformat/urldecode.h',
- 'libavformat/version.h',
- 'libavformat/voc.h',
- 'libavformat/vorbiscomment.h',
- 'libavformat/w64.h',
- 'libavformat/wtv.h',
- 'libavformat/wv.h',
- 'libavutil/adler32.h',
- 'libavutil/aes.h',
- 'libavutil/arm/bswap.h',
- 'libavutil/arm/cpu.h',
- 'libavutil/arm/float_dsp_arm.h',
- 'libavutil/arm/intmath.h',
- 'libavutil/arm/intreadwrite.h',
- 'libavutil/arm/timer.h',
- 'libavutil/atomic.h',
- 'libavutil/atomic_gcc.h',
- 'libavutil/atomic_suncc.h',
- 'libavutil/atomic_win32.h',
- 'libavutil/attributes.h',
- 'libavutil/audio_fifo.h',
- 'libavutil/audioconvert.h',
- 'libavutil/avassert.h',
- 'libavutil/avr32/bswap.h',
- 'libavutil/avr32/intreadwrite.h',
- 'libavutil/avstring.h',
- 'libavutil/avutil.h',
- 'libavutil/base64.h',
- 'libavutil/bfin/bswap.h',
- 'libavutil/bfin/timer.h',
- 'libavutil/blowfish.h',
- 'libavutil/bprint.h',
- 'libavutil/bswap.h',
- 'libavutil/buffer.h',
- 'libavutil/buffer_internal.h',
- 'libavutil/channel_layout.h',
- 'libavutil/colorspace.h',
- 'libavutil/common.h',
- 'libavutil/cpu.h',
- 'libavutil/cpu_internal.h',
- 'libavutil/crc.h',
- 'libavutil/des.h',
- 'libavutil/dict.h',
- 'libavutil/error.h',
- 'libavutil/eval.h',
- 'libavutil/fifo.h',
- 'libavutil/file.h',
- 'libavutil/float_dsp.h',
- 'libavutil/frame.h',
- 'libavutil/hash.h',
- 'libavutil/hmac.h',
- 'libavutil/imgutils.h',
- 'libavutil/integer.h',
- 'libavutil/internal.h',
- 'libavutil/intfloat.h',
- 'libavutil/intfloat_readwrite.h',
- 'libavutil/intmath.h',
- 'libavutil/intreadwrite.h',
- 'libavutil/lfg.h',
- 'libavutil/libm.h',
- 'libavutil/lls1.h',
- 'libavutil/lls2.h',
- 'libavutil/log.h',
- 'libavutil/lzo.h',
- 'libavutil/mathematics.h',
- 'libavutil/md5.h',
- 'libavutil/mem.h',
- 'libavutil/mips/intreadwrite.h',
- 'libavutil/mips/libm_mips.h',
- 'libavutil/murmur3.h',
- 'libavutil/old_pix_fmts.h',
- 'libavutil/opencl.h',
- 'libavutil/opencl_internal.h',
- 'libavutil/opt.h',
- 'libavutil/parseutils.h',
- 'libavutil/pca.h',
- 'libavutil/pixdesc.h',
- 'libavutil/pixfmt.h',
- 'libavutil/ppc/cpu.h',
- 'libavutil/ppc/float_dsp_altivec.h',
- 'libavutil/ppc/intreadwrite.h',
- 'libavutil/ppc/timer.h',
- 'libavutil/ppc/types_altivec.h',
- 'libavutil/ppc/util_altivec.h',
- 'libavutil/qsort.h',
- 'libavutil/random_seed.h',
- 'libavutil/rational.h',
- 'libavutil/rc4.h',
- 'libavutil/ripemd.h',
- 'libavutil/samplefmt.h',
- 'libavutil/sh4/bswap.h',
- 'libavutil/sha.h',
- 'libavutil/sha512.h',
- 'libavutil/softfloat.h',
- 'libavutil/stereo3d.h',
- 'libavutil/time.h',
- 'libavutil/timecode.h',
- 'libavutil/timer.h',
- 'libavutil/timestamp.h',
- 'libavutil/tomi/intreadwrite.h',
- 'libavutil/tree.h',
- 'libavutil/version.h',
- 'libavutil/x86/asm.h',
- 'libavutil/x86/bswap.h',
- 'libavutil/x86/cpu.h',
- 'libavutil/x86/emms.h',
- 'libavutil/x86/intreadwrite.h',
- 'libavutil/x86/timer.h',
- 'libavutil/x86/w64xmmtest.h',
- 'libavutil/x86_cpu.h',
- 'libavutil/xga_font_data.h',
- 'libavutil/xtea.h',
- ], # c_headers
},
}
diff --git a/chromium/third_party/ffmpeg/ffmpeg_opt.c b/chromium/third_party/ffmpeg/ffmpeg_opt.c
index e6ac3ee8e73..8e3873c8070 100644
--- a/chromium/third_party/ffmpeg/ffmpeg_opt.c
+++ b/chromium/third_party/ffmpeg/ffmpeg_opt.c
@@ -67,6 +67,12 @@ const HWAccel hwaccels[] = {
#if HAVE_VDPAU_X11
{ "vdpau", vdpau_init, HWACCEL_VDPAU, AV_PIX_FMT_VDPAU },
#endif
+#if HAVE_DXVA2_LIB
+ { "dxva2", dxva2_init, HWACCEL_DXVA2, AV_PIX_FMT_DXVA2_VLD },
+#endif
+#if CONFIG_VDA
+ { "vda", vda_init, HWACCEL_VDA, AV_PIX_FMT_VDA },
+#endif
{ 0 },
};
@@ -559,13 +565,14 @@ static AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *
static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
{
int i;
- char *next, *codec_tag = NULL;
for (i = 0; i < ic->nb_streams; i++) {
AVStream *st = ic->streams[i];
AVCodecContext *dec = st->codec;
InputStream *ist = av_mallocz(sizeof(*ist));
char *framerate = NULL, *hwaccel = NULL, *hwaccel_device = NULL;
+ char *codec_tag = NULL;
+ char *next;
if (!ist)
exit_program(1);
@@ -590,7 +597,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
}
ist->dec = choose_decoder(o, ic, st);
- ist->opts = filter_codec_opts(o->g->codec_opts, ist->st->codec->codec_id, ic, st, ist->dec);
+ ist->decoder_opts = filter_codec_opts(o->g->codec_opts, ist->st->codec->codec_id, ic, st, ist->dec);
ist->reinit_filters = -1;
MATCH_PER_STREAM_OPT(reinit_filters, i, ist->reinit_filters, ic, st);
@@ -697,10 +704,9 @@ static void assert_file_overwrite(const char *filename)
exit_program(1);
}
- if (!file_overwrite &&
- (strchr(filename, ':') == NULL || filename[1] == ':' ||
- av_strstart(filename, "file:", NULL))) {
- if (avio_check(filename, 0) == 0) {
+ if (!file_overwrite) {
+ const char *proto_name = avio_find_protocol_name(filename);
+ if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) {
if (stdin_interaction && !no_file_overwrite) {
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
fflush(stderr);
@@ -905,7 +911,7 @@ static int open_input_file(OptionsContext *o, const char *filename)
unused_opts = strip_specifiers(o->g->codec_opts);
for (i = f->ist_index; i < nb_input_streams; i++) {
e = NULL;
- while ((e = av_dict_get(input_streams[i]->opts, "", e,
+ while ((e = av_dict_get(input_streams[i]->decoder_opts, "", e,
AV_DICT_IGNORE_SUFFIX)))
av_dict_set(&unused_opts, e->key, NULL, 0);
}
@@ -915,8 +921,13 @@ static int open_input_file(OptionsContext *o, const char *filename)
const AVClass *class = avcodec_get_class();
const AVOption *option = av_opt_find(&class, e->key, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
- if (!option)
+ const AVClass *fclass = avformat_get_class();
+ const AVOption *foption = av_opt_find(&fclass, e->key, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
+ if (!option || foption)
continue;
+
+
if (!(option->flags & AV_OPT_FLAG_DECODING_PARAM)) {
av_log(NULL, AV_LOG_ERROR, "Codec AVOption %s (%s) specified for "
"input file #%d (%s) is not a decoding option.\n", e->key,
@@ -973,14 +984,14 @@ static uint8_t *get_line(AVIOContext *s)
static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s)
{
- int i, ret = 1;
+ int i, ret = -1;
char filename[1000];
const char *base[3] = { getenv("AVCONV_DATADIR"),
getenv("HOME"),
AVCONV_DATADIR,
};
- for (i = 0; i < FF_ARRAY_ELEMS(base) && ret; i++) {
+ for (i = 0; i < FF_ARRAY_ELEMS(base) && ret < 0; i++) {
if (!base[i])
continue;
if (codec_name) {
@@ -988,7 +999,7 @@ static int get_preset_file_2(const char *preset_name, const char *codec_name, AV
i != 1 ? "" : "/.avconv", codec_name, preset_name);
ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL);
}
- if (ret) {
+ if (ret < 0) {
snprintf(filename, sizeof(filename), "%s%s/%s.avpreset", base[i],
i != 1 ? "" : "/.avconv", preset_name);
ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL);
@@ -1046,7 +1057,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
AVIOContext *s = NULL;
char *buf = NULL, *arg = NULL, *preset = NULL;
- ost->opts = filter_codec_opts(o->g->codec_opts, ost->enc->id, oc, st, ost->enc);
+ ost->encoder_opts = filter_codec_opts(o->g->codec_opts, ost->enc->id, oc, st, ost->enc);
MATCH_PER_STREAM_OPT(presets, str, preset, oc, st);
if (preset && (!(ret = get_preset_file_2(preset, ost->enc->name, &s)))) {
@@ -1061,7 +1072,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
exit_program(1);
}
*arg++ = 0;
- av_dict_set(&ost->opts, buf, arg, AV_DICT_DONT_OVERWRITE);
+ av_dict_set(&ost->encoder_opts, buf, arg, AV_DICT_DONT_OVERWRITE);
av_free(buf);
} while (!s->eof_reached);
avio_close(s);
@@ -1073,7 +1084,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
exit_program(1);
}
} else {
- ost->opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
+ ost->encoder_opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
}
avcodec_get_context_defaults3(st->codec, ost->enc);
@@ -1261,6 +1272,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
char *frame_size = NULL;
char *frame_pix_fmt = NULL;
char *intra_matrix = NULL, *inter_matrix = NULL;
+ char *chroma_intra_matrix = NULL;
int do_pass = 0;
int i;
@@ -1293,6 +1305,16 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
}
parse_matrix_coeffs(video_enc->intra_matrix, intra_matrix);
}
+ MATCH_PER_STREAM_OPT(chroma_intra_matrices, str, chroma_intra_matrix, oc, st);
+ if (chroma_intra_matrix) {
+ uint16_t *p = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64);
+ if (!p) {
+ av_log(NULL, AV_LOG_FATAL, "Could not allocate memory for intra matrix.\n");
+ exit_program(1);
+ }
+ av_codec_set_chroma_intra_matrix(video_enc, p);
+ parse_matrix_coeffs(p, chroma_intra_matrix);
+ }
MATCH_PER_STREAM_OPT(inter_matrices, str, inter_matrix, oc, st);
if (inter_matrix) {
if (!(video_enc->inter_matrix = av_mallocz(sizeof(*video_enc->inter_matrix) * 64))) {
@@ -1338,11 +1360,11 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
if (do_pass) {
if (do_pass & 1) {
video_enc->flags |= CODEC_FLAG_PASS1;
- av_dict_set(&ost->opts, "flags", "+pass1", AV_DICT_APPEND);
+ av_dict_set(&ost->encoder_opts, "flags", "+pass1", AV_DICT_APPEND);
}
if (do_pass & 2) {
video_enc->flags |= CODEC_FLAG_PASS2;
- av_dict_set(&ost->opts, "flags", "+pass2", AV_DICT_APPEND);
+ av_dict_set(&ost->encoder_opts, "flags", "+pass2", AV_DICT_APPEND);
}
}
@@ -1414,15 +1436,27 @@ static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc, in
/* check for channel mapping for this audio stream */
for (n = 0; n < o->nb_audio_channel_maps; n++) {
AudioChannelMap *map = &o->audio_channel_maps[n];
- InputStream *ist = input_streams[ost->source_index];
- if ((map->channel_idx == -1 || (ist->file_index == map->file_idx && ist->st->index == map->stream_idx)) &&
- (map->ofile_idx == -1 || ost->file_index == map->ofile_idx) &&
+ if ((map->ofile_idx == -1 || ost->file_index == map->ofile_idx) &&
(map->ostream_idx == -1 || ost->st->index == map->ostream_idx)) {
- if (ost->audio_channels_mapped < FF_ARRAY_ELEMS(ost->audio_channels_map))
- ost->audio_channels_map[ost->audio_channels_mapped++] = map->channel_idx;
- else
- av_log(NULL, AV_LOG_FATAL, "Max channel mapping for output %d.%d reached\n",
+ InputStream *ist;
+
+ if (map->channel_idx == -1) {
+ ist = NULL;
+ } else if (ost->source_index < 0) {
+ av_log(NULL, AV_LOG_FATAL, "Cannot determine input stream for channel mapping %d.%d\n",
ost->file_index, ost->st->index);
+ continue;
+ } else {
+ ist = input_streams[ost->source_index];
+ }
+
+ if (!ist || (ist->file_index == map->file_idx && ist->st->index == map->stream_idx)) {
+ if (ost->audio_channels_mapped < FF_ARRAY_ELEMS(ost->audio_channels_map))
+ ost->audio_channels_map[ost->audio_channels_mapped++] = map->channel_idx;
+ else
+ av_log(NULL, AV_LOG_FATAL, "Max channel mapping for output %d.%d reached\n",
+ ost->file_index, ost->st->index);
+ }
}
}
}
@@ -1805,7 +1839,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
/* subtitles: pick first */
MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, oc, "s");
- if (!o->subtitle_disable && (oc->oformat->subtitle_codec != AV_CODEC_ID_NONE || subtitle_codec_name)) {
+ if (!o->subtitle_disable && (avcodec_find_encoder(oc->oformat->subtitle_codec) || subtitle_codec_name)) {
for (i = 0; i < nb_input_streams; i++)
if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
new_subtitle_stream(o, oc, i);
@@ -1921,7 +1955,7 @@ loop_end:
unused_opts = strip_specifiers(o->g->codec_opts);
for (i = of->ost_index; i < nb_output_streams; i++) {
e = NULL;
- while ((e = av_dict_get(output_streams[i]->opts, "", e,
+ while ((e = av_dict_get(output_streams[i]->encoder_opts, "", e,
AV_DICT_IGNORE_SUFFIX)))
av_dict_set(&unused_opts, e->key, NULL, 0);
}
@@ -2133,7 +2167,6 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
opt_video_codec(o, "c:v", "mpeg1video");
opt_audio_codec(o, "c:a", "mp2");
parse_option(o, "f", "vcd", options);
- av_dict_set(&o->g->codec_opts, "b:v", arg, AV_DICT_DONT_OVERWRITE);
parse_option(o, "s", norm == PAL ? "352x288" : "352x240", options);
parse_option(o, "r", frame_rates[norm], options);
@@ -2766,7 +2799,7 @@ const OptionDef options[] = {
{ "frames", OPT_INT64 | HAS_ARG | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(max_frames) },
"set the number of frames to record", "number" },
{ "tag", OPT_STRING | HAS_ARG | OPT_SPEC |
- OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(codec_tags) },
+ OPT_EXPERT | OPT_OUTPUT | OPT_INPUT, { .off = OFFSET(codec_tags) },
"force codec tag/fourcc", "fourcc/tag" },
{ "q", HAS_ARG | OPT_EXPERT | OPT_DOUBLE |
OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(qscale) },
@@ -2857,6 +2890,9 @@ const OptionDef options[] = {
{ "inter_matrix", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_STRING | OPT_SPEC |
OPT_OUTPUT, { .off = OFFSET(inter_matrices) },
"specify inter matrix coeffs", "matrix" },
+ { "chroma_intra_matrix", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_STRING | OPT_SPEC |
+ OPT_OUTPUT, { .off = OFFSET(chroma_intra_matrices) },
+ "specify intra matrix coeffs", "matrix" },
{ "top", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_INT| OPT_SPEC |
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(top_field_first) },
"top=1/bottom=0/auto=-1 field first", "" },
diff --git a/chromium/third_party/ffmpeg/ffmpeg_options.gni b/chromium/third_party/ffmpeg/ffmpeg_options.gni
new file mode 100644
index 00000000000..280125c3f30
--- /dev/null
+++ b/chromium/third_party/ffmpeg/ffmpeg_options.gni
@@ -0,0 +1,43 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/arm.gni")
+
+if (is_chrome_branded) {
+ _default_ffmpeg_branding = "Chrome"
+} else {
+ _default_ffmpeg_branding = "Chromium"
+}
+
+if (is_chromeos) {
+ _default_ffmpeg_branding = ffmpeg_branding + "OS"
+}
+
+declare_args() {
+ # Controls whether we build the Chromium or Google Chrome version of FFmpeg.
+ # The Google Chrome version contains additional codecs. Typical values are
+ # Chromium, Chrome, ChromiumOS, and ChromeOS.
+ ffmpeg_branding = _default_ffmpeg_branding
+
+ # When set to false will build Chromium against Chrome's FFmpeg headers, but
+ # not build ffmpegsumo itself. Users are expected to build and provide
+ # their own version of ffmpegsumo.
+ build_ffmpegsumo = true
+}
+
+assert(ffmpeg_branding == "Chromium" ||
+ ffmpeg_branding == "Chrome" ||
+ ffmpeg_branding == "ChromiumOS" ||
+ ffmpeg_branding == "ChromeOS")
+
+if (cpu_arch == "arm" && arm_version == 7 && arm_use_neon) {
+ ffmpeg_arch = "arm-neon"
+} else {
+ ffmpeg_arch = cpu_arch
+}
+
+os_config = os
+if (is_linux && is_msan) {
+ os_config = "linux-noasm"
+}
diff --git a/chromium/third_party/ffmpeg/ffmpeg_vda.c b/chromium/third_party/ffmpeg/ffmpeg_vda.c
new file mode 100644
index 00000000000..b9f0975f55b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/ffmpeg_vda.c
@@ -0,0 +1,134 @@
+/*
+ * 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 "libavcodec/avcodec.h"
+#include "libavcodec/vda.h"
+#include "libavutil/imgutils.h"
+
+#include "ffmpeg.h"
+
+typedef struct VDAContext {
+ AVFrame *tmp_frame;
+} VDAContext;
+
+static int vda_retrieve_data(AVCodecContext *s, AVFrame *frame)
+{
+ InputStream *ist = s->opaque;
+ VDAContext *vda = ist->hwaccel_ctx;
+ CVPixelBufferRef pixbuf = (CVPixelBufferRef)frame->data[3];
+ OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
+ CVReturn err;
+ uint8_t *data[4] = { 0 };
+ int linesize[4] = { 0 };
+ int planes, ret, i;
+
+ av_frame_unref(vda->tmp_frame);
+
+ switch (pixel_format) {
+ case kCVPixelFormatType_420YpCbCr8Planar: vda->tmp_frame->format = AV_PIX_FMT_YUV420P; break;
+ case kCVPixelFormatType_422YpCbCr8: vda->tmp_frame->format = AV_PIX_FMT_UYVY422; break;
+ default:
+ av_log(NULL, AV_LOG_ERROR,
+ "Unsupported pixel format: %u\n", pixel_format);
+ return AVERROR(ENOSYS);
+ }
+
+ vda->tmp_frame->width = frame->width;
+ vda->tmp_frame->height = frame->height;
+ ret = av_frame_get_buffer(vda->tmp_frame, 32);
+ if (ret < 0)
+ return ret;
+
+ err = CVPixelBufferLockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
+ if (err != kCVReturnSuccess) {
+ av_log(NULL, AV_LOG_ERROR, "Error locking the pixel buffer.\n");
+ return AVERROR_UNKNOWN;
+ }
+
+ if (CVPixelBufferIsPlanar(pixbuf)) {
+
+ planes = CVPixelBufferGetPlaneCount(pixbuf);
+ for (i = 0; i < planes; i++) {
+ data[i] = CVPixelBufferGetBaseAddressOfPlane(pixbuf, i);
+ linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(pixbuf, i);
+ }
+ } else {
+ data[0] = CVPixelBufferGetBaseAddress(pixbuf);
+ linesize[0] = CVPixelBufferGetBytesPerRow(pixbuf);
+ }
+
+ av_image_copy(vda->tmp_frame->data, vda->tmp_frame->linesize,
+ data, linesize, vda->tmp_frame->format,
+ frame->width, frame->height);
+
+ ret = av_frame_copy_props(vda->tmp_frame, frame);
+ if (ret < 0)
+ return ret;
+
+ av_frame_unref(frame);
+ av_frame_move_ref(frame, vda->tmp_frame);
+
+ return 0;
+}
+
+static void vda_uninit(AVCodecContext *s)
+{
+ InputStream *ist = s->opaque;
+ VDAContext *vda = ist->hwaccel_ctx;
+
+ ist->hwaccel_uninit = NULL;
+ ist->hwaccel_retrieve_data = NULL;
+
+ av_frame_free(&vda->tmp_frame);
+
+ av_vda_default_free(s);
+ av_freep(&ist->hwaccel_ctx);
+}
+
+int vda_init(AVCodecContext *s)
+{
+ InputStream *ist = s->opaque;
+ int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
+ VDAContext *vda;
+ int ret;
+
+ vda = av_mallocz(sizeof(*vda));
+ if (!vda)
+ return AVERROR(ENOMEM);
+
+ ist->hwaccel_ctx = vda;
+ ist->hwaccel_uninit = vda_uninit;
+ ist->hwaccel_retrieve_data = vda_retrieve_data;
+
+ vda->tmp_frame = av_frame_alloc();
+ if (!vda->tmp_frame) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ ret = av_vda_default_init(s);
+ if (ret < 0) {
+ av_log(NULL, loglevel, "Error creating VDA decoder.\n");
+ goto fail;
+ }
+
+ return 0;
+fail:
+ vda_uninit(s);
+ return ret;
+}
diff --git a/chromium/third_party/ffmpeg/ffplay.c b/chromium/third_party/ffmpeg/ffplay.c
index 4893ebcb2f5..86b9126ab2d 100644
--- a/chromium/third_party/ffmpeg/ffplay.c
+++ b/chromium/third_party/ffmpeg/ffplay.c
@@ -145,6 +145,8 @@ typedef struct AudioParams {
int channels;
int64_t channel_layout;
enum AVSampleFormat fmt;
+ int frame_size;
+ int bytes_per_sec;
} AudioParams;
typedef struct Clock {
@@ -357,8 +359,6 @@ int64_t get_valid_channel_layout(int64_t channel_layout, int channels)
return 0;
}
-static int packet_queue_put(PacketQueue *q, AVPacket *pkt);
-
static int packet_queue_put_private(PacketQueue *q, AVPacket *pkt)
{
MyAVPacketList *pkt1;
@@ -1608,7 +1608,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, double
}
/* if the queue is aborted, we have to pop the pending ALLOC event or wait for the allocation to complete */
if (is->videoq.abort_request && SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_EVENTMASK(FF_ALLOC_EVENT)) != 1) {
- while (!vp->allocated) {
+ while (!vp->allocated && !is->abort_request) {
SDL_CondWait(is->pictq_cond, is->pictq_mutex);
}
}
@@ -1727,7 +1727,8 @@ static int get_video_frame(VideoState *is, AVFrame *frame, AVPacket *pkt, int *s
static int configure_filtergraph(AVFilterGraph *graph, const char *filtergraph,
AVFilterContext *source_ctx, AVFilterContext *sink_ctx)
{
- int ret;
+ int ret, i;
+ int nb_filters = graph->nb_filters;
AVFilterInOut *outputs = NULL, *inputs = NULL;
if (filtergraph) {
@@ -1755,6 +1756,10 @@ static int configure_filtergraph(AVFilterGraph *graph, const char *filtergraph,
goto fail;
}
+ /* Reorder the filters to ensure that inputs of the custom filters are merged first */
+ for (i = 0; i < graph->nb_filters - nb_filters; i++)
+ FFSWAP(AVFilterContext*, graph->filters[i], graph->filters[i + nb_filters]);
+
ret = avfilter_graph_config(graph, NULL);
fail:
avfilter_inout_free(&outputs);
@@ -1920,7 +1925,6 @@ static int video_thread(void *arg)
while (is->paused && !is->videoq.abort_request)
SDL_Delay(10);
- avcodec_get_frame_defaults(frame);
av_free_packet(&pkt);
ret = get_video_frame(is, frame, &pkt, &serial);
@@ -1947,7 +1951,6 @@ static int video_thread(void *arg)
event.type = FF_QUIT_EVENT;
event.user.data1 = is;
SDL_PushEvent(&event);
- av_free_packet(&pkt);
goto the_end;
}
filt_in = is->in_video_filter;
@@ -1962,9 +1965,6 @@ static int video_thread(void *arg)
ret = av_buffersrc_add_frame(filt_in, frame);
if (ret < 0)
goto the_end;
- av_frame_unref(frame);
- avcodec_get_frame_defaults(frame);
- av_free_packet(&pkt);
while (ret >= 0) {
is->frame_last_returned_time = av_gettime() / 1000000.0;
@@ -2167,7 +2167,6 @@ static int audio_decode_frame(VideoState *is)
return AVERROR(ENOMEM);
} else {
av_frame_unref(is->frame);
- avcodec_get_frame_defaults(is->frame);
}
if (is->audioq.serial != is->audio_pkt_temp_serial)
@@ -2242,7 +2241,6 @@ static int audio_decode_frame(VideoState *is)
if ((ret = av_buffersrc_add_frame(is->in_audio_filter, is->frame)) < 0)
return ret;
- av_frame_unref(is->frame);
#endif
}
#if CONFIG_AVFILTER
@@ -2379,8 +2377,6 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
{
VideoState *is = opaque;
int audio_size, len1;
- int bytes_per_sec;
- int frame_size = av_samples_get_buffer_size(NULL, is->audio_tgt.channels, 1, is->audio_tgt.fmt, 1);
audio_callback_time = av_gettime();
@@ -2390,7 +2386,7 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
if (audio_size < 0) {
/* if error, just output silence */
is->audio_buf = is->silence_buf;
- is->audio_buf_size = sizeof(is->silence_buf) / frame_size * frame_size;
+ is->audio_buf_size = sizeof(is->silence_buf) / is->audio_tgt.frame_size * is->audio_tgt.frame_size;
} else {
if (is->show_mode != SHOW_MODE_VIDEO)
update_sample_display(is, (int16_t *)is->audio_buf, audio_size);
@@ -2406,11 +2402,10 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
stream += len1;
is->audio_buf_index += len1;
}
- bytes_per_sec = is->audio_tgt.freq * is->audio_tgt.channels * av_get_bytes_per_sample(is->audio_tgt.fmt);
is->audio_write_buf_size = is->audio_buf_size - is->audio_buf_index;
/* Let's assume the audio driver that is used by SDL has two periods. */
if (!isnan(is->audio_clock)) {
- set_clock_at(&is->audclk, is->audio_clock - (double)(2 * is->audio_hw_buf_size + is->audio_write_buf_size) / bytes_per_sec, is->audio_clock_serial, audio_callback_time / 1000000.0);
+ set_clock_at(&is->audclk, is->audio_clock - (double)(2 * is->audio_hw_buf_size + is->audio_write_buf_size) / is->audio_tgt.bytes_per_sec, is->audio_clock_serial, audio_callback_time / 1000000.0);
sync_clock_to_slave(&is->extclk, &is->audclk);
}
}
@@ -2469,6 +2464,12 @@ static int audio_open(void *opaque, int64_t wanted_channel_layout, int wanted_nb
audio_hw_params->freq = spec.freq;
audio_hw_params->channel_layout = wanted_channel_layout;
audio_hw_params->channels = spec.channels;
+ audio_hw_params->frame_size = av_samples_get_buffer_size(NULL, audio_hw_params->channels, 1, audio_hw_params->fmt, 1);
+ audio_hw_params->bytes_per_sec = av_samples_get_buffer_size(NULL, audio_hw_params->channels, audio_hw_params->freq, audio_hw_params->fmt, 1);
+ if (audio_hw_params->bytes_per_sec <= 0 || audio_hw_params->frame_size <= 0) {
+ av_log(NULL, AV_LOG_ERROR, "av_samples_get_buffer_size failed\n");
+ return -1;
+ }
return spec.size;
}
@@ -2573,7 +2574,7 @@ static int stream_component_open(VideoState *is, int stream_index)
is->audio_diff_avg_count = 0;
/* since we do not have a precise anough audio fifo fullness,
we correct audio sync only if larger than this threshold */
- is->audio_diff_threshold = 2.0 * is->audio_hw_buf_size / av_samples_get_buffer_size(NULL, is->audio_tgt.channels, is->audio_tgt.freq, is->audio_tgt.fmt, 1);
+ is->audio_diff_threshold = 2.0 * is->audio_hw_buf_size / is->audio_tgt.bytes_per_sec;
memset(&is->audio_pkt, 0, sizeof(is->audio_pkt));
memset(&is->audio_pkt_temp, 0, sizeof(is->audio_pkt_temp));
@@ -2751,6 +2752,8 @@ static int read_thread(void *arg)
if (genpts)
ic->flags |= AVFMT_FLAG_GENPTS;
+ av_format_inject_global_side_data(ic);
+
opts = setup_find_stream_info_opts(ic, codec_opts);
orig_nb_streams = ic->nb_streams;
@@ -2947,6 +2950,8 @@ static int read_thread(void *arg)
packet_queue_put_nullpacket(&is->videoq, is->video_stream);
if (is->audio_stream >= 0)
packet_queue_put_nullpacket(&is->audioq, is->audio_stream);
+ if (is->subtitle_stream >= 0)
+ packet_queue_put_nullpacket(&is->subtitleq, is->subtitle_stream);
SDL_Delay(10);
eof=0;
continue;
@@ -3117,6 +3122,11 @@ static void stream_cycle_channel(VideoState *is, int codec_type)
the_end:
if (p && stream_index != -1)
stream_index = p->stream_index[stream_index];
+ av_log(NULL, AV_LOG_INFO, "Switch %s stream from #%d to #%d\n",
+ av_get_media_type_string(codec_type),
+ old_index,
+ stream_index);
+
stream_component_close(is, old_index);
stream_component_open(is, stream_index);
}
@@ -3167,6 +3177,33 @@ static void refresh_loop_wait_event(VideoState *is, SDL_Event *event) {
}
}
+static void seek_chapter(VideoState *is, int incr)
+{
+ int64_t pos = get_master_clock(is) * AV_TIME_BASE;
+ int i;
+
+ if (!is->ic->nb_chapters)
+ return;
+
+ /* find the current chapter */
+ for (i = 0; i < is->ic->nb_chapters; i++) {
+ AVChapter *ch = is->ic->chapters[i];
+ if (av_compare_ts(pos, AV_TIME_BASE_Q, ch->start, ch->time_base) < 0) {
+ i--;
+ break;
+ }
+ }
+
+ i += incr;
+ i = FFMAX(i, 0);
+ if (i >= is->ic->nb_chapters)
+ return;
+
+ av_log(NULL, AV_LOG_VERBOSE, "Seeking to chapter %d.\n", i);
+ stream_seek(is, av_rescale_q(is->ic->chapters[i]->start, is->ic->chapters[i]->time_base,
+ AV_TIME_BASE_Q), 0, 0);
+}
+
/* handle an event sent by the GUI */
static void event_loop(VideoState *cur_stream)
{
@@ -3216,11 +3253,19 @@ static void event_loop(VideoState *cur_stream)
toggle_audio_display(cur_stream);
break;
case SDLK_PAGEUP:
- incr = 600.0;
- goto do_seek;
+ if (cur_stream->ic->nb_chapters <= 1) {
+ incr = 600.0;
+ goto do_seek;
+ }
+ seek_chapter(cur_stream, 1);
+ break;
case SDLK_PAGEDOWN:
- incr = -600.0;
- goto do_seek;
+ if (cur_stream->ic->nb_chapters <= 1) {
+ incr = -600.0;
+ goto do_seek;
+ }
+ seek_chapter(cur_stream, -1);
+ break;
case SDLK_LEFT:
incr = -10.0;
goto do_seek;
diff --git a/chromium/third_party/ffmpeg/ffprobe.c b/chromium/third_party/ffmpeg/ffprobe.c
index 46c232e1daf..c6e0469d183 100644
--- a/chromium/third_party/ffmpeg/ffprobe.c
+++ b/chromium/third_party/ffmpeg/ffprobe.c
@@ -66,6 +66,12 @@ static int do_show_data = 0;
static int do_show_program_version = 0;
static int do_show_library_versions = 0;
+static int do_show_chapter_tags = 0;
+static int do_show_format_tags = 0;
+static int do_show_frame_tags = 0;
+static int do_show_program_tags = 0;
+static int do_show_stream_tags = 0;
+
static int show_value_unit = 0;
static int use_value_prefix = 0;
static int use_byte_value_binary_prefix = 0;
@@ -240,6 +246,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
vald /= pow(10, index * 3);
prefix_string = decimal_unit_prefixes[index];
}
+ vali = vald;
}
if (show_float || (use_value_prefix && vald != (long long int)vald))
@@ -330,7 +337,7 @@ static const AVOption writer_options[] = {
{ "replace", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_REPLACE}, .unit = "sv" },
{ "fail", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_FAIL}, .unit = "sv" },
{ "string_validation_replacement", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
- { "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
+ { "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str="\xEF\xBF\xBD"}},
{ NULL }
};
@@ -1719,6 +1726,8 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
print_time("pkt_pts_time", frame->pkt_pts, &stream->time_base);
print_ts ("pkt_dts", frame->pkt_dts);
print_time("pkt_dts_time", frame->pkt_dts, &stream->time_base);
+ print_ts ("best_effort_timestamp", av_frame_get_best_effort_timestamp(frame));
+ print_time("best_effort_timestamp_time", av_frame_get_best_effort_timestamp(frame), &stream->time_base);
print_duration_ts ("pkt_duration", av_frame_get_pkt_duration(frame));
print_duration_time("pkt_duration_time", av_frame_get_pkt_duration(frame), &stream->time_base);
if (av_frame_get_pkt_pos (frame) != -1) print_fmt ("pkt_pos", "%"PRId64, av_frame_get_pkt_pos(frame));
@@ -1764,7 +1773,8 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
print_str_opt("channel_layout", "unknown");
break;
}
- show_tags(w, av_frame_get_metadata(frame), SECTION_ID_FRAME_TAGS);
+ if (do_show_frame_tags)
+ show_tags(w, av_frame_get_metadata(frame), SECTION_ID_FRAME_TAGS);
writer_print_section_footer(w);
@@ -1780,7 +1790,6 @@ static av_always_inline int process_frame(WriterContext *w,
AVSubtitle sub;
int ret = 0, got_frame = 0;
- avcodec_get_frame_defaults(frame);
if (dec_ctx->codec) {
switch (dec_ctx->codec_type) {
case AVMEDIA_TYPE_VIDEO:
@@ -1844,7 +1853,7 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
const ReadInterval *interval, int64_t *cur_ts)
{
AVPacket pkt, pkt1;
- AVFrame frame;
+ AVFrame *frame = NULL;
int ret = 0, i = 0, frame_count = 0;
int64_t start = -INT64_MAX, end = interval->end;
int has_start = 0, has_end = interval->has_end && !interval->end_is_offset;
@@ -1878,6 +1887,11 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
}
}
+ frame = av_frame_alloc();
+ if (!frame) {
+ ret = AVERROR(ENOMEM);
+ goto end;
+ }
while (!av_read_frame(fmt_ctx, &pkt)) {
if (selected_streams[pkt.stream_index]) {
AVRational tb = fmt_ctx->streams[pkt.stream_index]->time_base;
@@ -1910,7 +1924,7 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
}
if (do_read_frames) {
pkt1 = pkt;
- while (pkt1.size && process_frame(w, fmt_ctx, &frame, &pkt1) > 0);
+ while (pkt1.size && process_frame(w, fmt_ctx, frame, &pkt1) > 0);
}
}
av_free_packet(&pkt);
@@ -1922,10 +1936,11 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
for (i = 0; i < fmt_ctx->nb_streams; i++) {
pkt.stream_index = i;
if (do_read_frames)
- while (process_frame(w, fmt_ctx, &frame, &pkt) > 0);
+ while (process_frame(w, fmt_ctx, frame, &pkt) > 0);
}
end:
+ av_frame_free(&frame);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Could not read packets in interval ");
log_read_interval(interval, NULL, AV_LOG_ERROR);
@@ -1961,6 +1976,7 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
const char *s;
AVRational sar, dar;
AVBPrint pbuf;
+ const AVCodecDescriptor *cd;
int ret = 0;
av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
@@ -1978,6 +1994,12 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
if (dec->long_name) print_str ("codec_long_name", dec->long_name);
else print_str_opt("codec_long_name", "unknown");
}
+ } else if ((cd = avcodec_descriptor_get(stream->codec->codec_id))) {
+ print_str_opt("codec_name", cd->name);
+ if (!do_bitexact) {
+ print_str_opt("codec_long_name",
+ cd->long_name ? cd->long_name : "unknown");
+ }
} else {
print_str_opt("codec_name", "unknown");
if (!do_bitexact) {
@@ -2116,7 +2138,8 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
writer_print_section_footer(w);
}
- ret = show_tags(w, stream->metadata, in_program ? SECTION_ID_PROGRAM_STREAM_TAGS : SECTION_ID_STREAM_TAGS);
+ if (do_show_stream_tags)
+ ret = show_tags(w, stream->metadata, in_program ? SECTION_ID_PROGRAM_STREAM_TAGS : SECTION_ID_STREAM_TAGS);
writer_print_section_footer(w);
av_bprint_finalize(&pbuf, NULL);
@@ -2155,7 +2178,8 @@ static int show_program(WriterContext *w, AVFormatContext *fmt_ctx, AVProgram *p
print_time("start_time", program->start_time, &AV_TIME_BASE_Q);
print_ts("end_pts", program->end_time);
print_time("end_time", program->end_time, &AV_TIME_BASE_Q);
- ret = show_tags(w, program->metadata, SECTION_ID_PROGRAM_TAGS);
+ if (do_show_program_tags)
+ ret = show_tags(w, program->metadata, SECTION_ID_PROGRAM_TAGS);
if (ret < 0)
goto end;
@@ -2206,7 +2230,8 @@ static int show_chapters(WriterContext *w, AVFormatContext *fmt_ctx)
print_time("start_time", chapter->start, &chapter->time_base);
print_int("end", chapter->end);
print_time("end_time", chapter->end, &chapter->time_base);
- ret = show_tags(w, chapter->metadata, SECTION_ID_CHAPTER_TAGS);
+ if (do_show_chapter_tags)
+ ret = show_tags(w, chapter->metadata, SECTION_ID_CHAPTER_TAGS);
writer_print_section_footer(w);
}
writer_print_section_footer(w);
@@ -2236,7 +2261,8 @@ static int show_format(WriterContext *w, AVFormatContext *fmt_ctx)
if (fmt_ctx->bit_rate > 0) print_val ("bit_rate", fmt_ctx->bit_rate, unit_bit_per_second_str);
else print_str_opt("bit_rate", "N/A");
print_int("probe_score", av_format_get_probe_score(fmt_ctx));
- ret = show_tags(w, fmt_ctx->metadata, SECTION_ID_FORMAT_TAGS);
+ if (do_show_format_tags)
+ ret = show_tags(w, fmt_ctx->metadata, SECTION_ID_FORMAT_TAGS);
writer_print_section_footer(w);
fflush(stdout);
@@ -2381,6 +2407,7 @@ static int probe_file(WriterContext *wctx, const char *filename)
writer_print_section_footer(wctx);
CHECK_END;
}
+
if (do_show_programs) {
ret = show_programs(wctx, fmt_ctx);
CHECK_END;
@@ -2894,6 +2921,12 @@ int main(int argc, char **argv)
SET_DO_SHOW(STREAM_DISPOSITION, stream_disposition);
SET_DO_SHOW(PROGRAM_STREAM_DISPOSITION, stream_disposition);
+ SET_DO_SHOW(CHAPTER_TAGS, chapter_tags);
+ SET_DO_SHOW(FORMAT_TAGS, format_tags);
+ SET_DO_SHOW(FRAME_TAGS, frame_tags);
+ SET_DO_SHOW(PROGRAM_TAGS, program_tags);
+ SET_DO_SHOW(STREAM_TAGS, stream_tags);
+
if (do_bitexact && (do_show_program_version || do_show_library_versions)) {
av_log(NULL, AV_LOG_ERROR,
"-bitexact and -show_program_version or -show_library_versions "
diff --git a/chromium/third_party/ffmpeg/ffserver.c b/chromium/third_party/ffmpeg/ffserver.c
index 4d656b04fff..a6ab458de62 100644
--- a/chromium/third_party/ffmpeg/ffserver.c
+++ b/chromium/third_party/ffmpeg/ffserver.c
@@ -38,6 +38,7 @@
#include "libavformat/rtpdec.h"
#include "libavformat/rtpproto.h"
#include "libavformat/rtsp.h"
+#include "libavformat/rtspcodes.h"
#include "libavformat/avio_internal.h"
#include "libavformat/internal.h"
#include "libavformat/url.h"
@@ -216,22 +217,19 @@ typedef struct FFStream {
struct FFStream *feed; /* feed we are using (can be null if
coming from file) */
AVDictionary *in_opts; /* input parameters */
+ AVDictionary *metadata; /* metadata to set on the stream */
AVInputFormat *ifmt; /* if non NULL, force input format */
AVOutputFormat *fmt;
IPAddressACL *acl;
char dynamic_acl[1024];
int nb_streams;
- int prebuffer; /* Number of millseconds early to start */
+ int prebuffer; /* Number of milliseconds early to start */
int64_t max_time; /* Number of milliseconds to run */
int send_on_key;
AVStream *streams[MAX_STREAMS];
int feed_streams[MAX_STREAMS]; /* index of streams in the feed */
char feed_filename[1024]; /* file name of the feed storage, or
input file name for a stream */
- char author[512];
- char title[512];
- char copyright[512];
- char comment[512];
pid_t pid; /* Of ffmpeg process */
time_t pid_start; /* Of ffmpeg process */
char **child_argv;
@@ -290,8 +288,7 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url);
static void rtsp_cmd_options(HTTPContext *c, const char *url);
static void rtsp_cmd_setup(HTTPContext *c, const char *url, RTSPMessageHeader *h);
static void rtsp_cmd_play(HTTPContext *c, const char *url, RTSPMessageHeader *h);
-static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPMessageHeader *h);
-static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPMessageHeader *h);
+static void rtsp_cmd_interrupt(HTTPContext *c, const char *url, RTSPMessageHeader *h, int pause_only);
/* SDP handling */
static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
@@ -509,8 +506,8 @@ static void start_children(FFStream *feed)
char *slash;
int i;
- /* replace "ffserver" with "ffmpeg" in the path of current program,
- * ignore user provided path */
+ /* replace "ffserver" with "ffmpeg" in the path of current
+ * program. Ignore user provided path */
av_strlcpy(pathname, my_program_name, sizeof(pathname));
slash = strrchr(pathname, '/');
if (!slash)
@@ -559,7 +556,8 @@ static int socket_open_listen(struct sockaddr_in *my_addr)
}
tmp = 1;
- setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp));
+ if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp)))
+ av_log(NULL, AV_LOG_WARNING, "setsockopt SO_REUSEADDR failed\n");
my_addr->sin_family = AF_INET;
if (bind (server_fd, (struct sockaddr *) my_addr, sizeof (*my_addr)) < 0) {
@@ -575,7 +573,9 @@ static int socket_open_listen(struct sockaddr_in *my_addr)
closesocket(server_fd);
return -1;
}
- ff_socket_nonblock(server_fd, 1);
+
+ if (ff_socket_nonblock(server_fd, 1) < 0)
+ av_log(NULL, AV_LOG_WARNING, "ff_socket_nonblock failed\n");
return server_fd;
}
@@ -631,17 +631,16 @@ static void start_multicast(void)
}
}
- /* change state to send data */
rtp_c->state = HTTPSTATE_SEND_DATA;
}
}
}
-/* main loop of the http server */
+/* main loop of the HTTP server */
static int http_server(void)
{
int server_fd = 0, rtsp_server_fd = 0;
- int ret, delay, delay1;
+ int ret, delay;
struct pollfd *poll_table, *poll_entry;
HTTPContext *c, *c_next;
@@ -652,18 +651,24 @@ static int http_server(void)
if (my_http_addr.sin_port) {
server_fd = socket_open_listen(&my_http_addr);
- if (server_fd < 0)
+ if (server_fd < 0) {
+ av_free(poll_table);
return -1;
+ }
}
if (my_rtsp_addr.sin_port) {
rtsp_server_fd = socket_open_listen(&my_rtsp_addr);
- if (rtsp_server_fd < 0)
+ if (rtsp_server_fd < 0) {
+ av_free(poll_table);
+ closesocket(server_fd);
return -1;
+ }
}
if (!rtsp_server_fd && !server_fd) {
http_log("HTTP and RTSP disabled.\n");
+ av_free(poll_table);
return -1;
}
@@ -705,18 +710,19 @@ static int http_server(void)
case HTTPSTATE_SEND_DATA:
case HTTPSTATE_SEND_DATA_TRAILER:
if (!c->is_packetized) {
- /* for TCP, we output as much as we can (may need to put a limit) */
+ /* for TCP, we output as much as we can
+ * (may need to put a limit) */
c->poll_entry = poll_entry;
poll_entry->fd = fd;
poll_entry->events = POLLOUT;
poll_entry++;
} else {
/* when ffserver is doing the timing, we work by
- looking at which packet need to be sent every
+ looking at which packet needs to be sent every
10 ms */
- delay1 = 10; /* one tick wait XXX: 10 ms assumed */
- if (delay1 < delay)
- delay = delay1;
+ /* one tick wait XXX: 10 ms assumed */
+ if (delay > 10)
+ delay = 10;
}
break;
case HTTPSTATE_WAIT_REQUEST:
@@ -741,8 +747,10 @@ static int http_server(void)
do {
ret = poll(poll_table, poll_entry - poll_table, delay);
if (ret < 0 && ff_neterrno() != AVERROR(EAGAIN) &&
- ff_neterrno() != AVERROR(EINTR))
+ ff_neterrno() != AVERROR(EINTR)) {
+ av_free(poll_table);
return -1;
+ }
} while (ret < 0);
cur_time = av_gettime() / 1000;
@@ -756,8 +764,8 @@ static int http_server(void)
for(c = first_http_ctx; c != NULL; c = c_next) {
c_next = c->next;
if (handle_connection(c) < 0) {
- /* close and free the connection */
log_connection(c);
+ /* close and free the connection */
close_connection(c);
}
}
@@ -805,7 +813,8 @@ static void http_send_too_busy_reply(int fd)
"</body></html>\r\n",
nb_connections, nb_max_connections);
av_assert0(len < sizeof(buffer));
- send(fd, buffer, len, 0);
+ if (send(fd, buffer, len, 0) < len)
+ av_log(NULL, AV_LOG_WARNING, "Could not send too-busy reply, send() failed\n");
}
@@ -823,7 +832,8 @@ static void new_connection(int server_fd, int is_rtsp)
http_log("error during accept %s\n", strerror(errno));
return;
}
- ff_socket_nonblock(fd, 1);
+ if (ff_socket_nonblock(fd, 1) < 0)
+ av_log(NULL, AV_LOG_WARNING, "ff_socket_nonblock failed\n");
if (nb_connections >= nb_max_connections) {
http_send_too_busy_reply(fd);
@@ -1006,9 +1016,7 @@ static int handle_connection(HTTPContext *c)
if (len < 0) {
if (ff_neterrno() != AVERROR(EAGAIN) &&
ff_neterrno() != AVERROR(EINTR)) {
- /* error : close connection */
- av_freep(&c->pb_buffer);
- return -1;
+ goto close_connection;
}
} else {
c->buffer_ptr += len;
@@ -1020,7 +1028,8 @@ static int handle_connection(HTTPContext *c)
/* if error, exit */
if (c->http_error)
return -1;
- /* all the buffer was sent : synchronize to the incoming stream */
+ /* all the buffer was sent : synchronize to the incoming
+ * stream */
c->state = HTTPSTATE_SEND_DATA_HEADER;
c->buffer_ptr = c->buffer_end = c->buffer;
}
@@ -1031,7 +1040,7 @@ static int handle_connection(HTTPContext *c)
case HTTPSTATE_SEND_DATA_HEADER:
case HTTPSTATE_SEND_DATA_TRAILER:
/* for packetized output, we consider we can always write (the
- input streams sets the speed). It may be better to verify
+ input streams set the speed). It may be better to verify
that we do not rely too much on the kernel queues */
if (!c->is_packetized) {
if (c->poll_entry->revents & (POLLERR | POLLHUP))
@@ -1065,10 +1074,8 @@ static int handle_connection(HTTPContext *c)
break;
case RTSPSTATE_SEND_REPLY:
- if (c->poll_entry->revents & (POLLERR | POLLHUP)) {
- av_freep(&c->pb_buffer);
- return -1;
- }
+ if (c->poll_entry->revents & (POLLERR | POLLHUP))
+ goto close_connection;
/* no need to write if no events */
if (!(c->poll_entry->revents & POLLOUT))
return 0;
@@ -1076,9 +1083,7 @@ static int handle_connection(HTTPContext *c)
if (len < 0) {
if (ff_neterrno() != AVERROR(EAGAIN) &&
ff_neterrno() != AVERROR(EINTR)) {
- /* error : close connection */
- av_freep(&c->pb_buffer);
- return -1;
+ goto close_connection;
}
} else {
c->buffer_ptr += len;
@@ -1123,6 +1128,10 @@ static int handle_connection(HTTPContext *c)
return -1;
}
return 0;
+
+close_connection:
+ av_freep(&c->pb_buffer);
+ return -1;
}
static int extract_rates(char *rates, int ratelen, const char *request)
@@ -1329,7 +1338,7 @@ static void parse_acl_row(FFStream *stream, FFStream* feed, IPAddressACL *ext_ac
get_arg(arg, sizeof(arg), &p);
if (resolve_host(&acl.first, arg) != 0) {
- fprintf(stderr, "%s:%d: ACL refers to invalid host or ip address '%s'\n",
+ fprintf(stderr, "%s:%d: ACL refers to invalid host or IP address '%s'\n",
filename, line_num, arg);
errors++;
} else
@@ -1339,7 +1348,7 @@ static void parse_acl_row(FFStream *stream, FFStream* feed, IPAddressACL *ext_ac
if (arg[0]) {
if (resolve_host(&acl.last, arg) != 0) {
- fprintf(stderr, "%s:%d: ACL refers to invalid host or ip address '%s'\n",
+ fprintf(stderr, "%s:%d: ACL refers to invalid host or IP address '%s'\n",
filename, line_num, arg);
errors++;
}
@@ -1369,7 +1378,8 @@ static void parse_acl_row(FFStream *stream, FFStream* feed, IPAddressACL *ext_ac
naclp = &(*naclp)->next;
*naclp = nacl;
- }
+ } else
+ av_free(nacl);
}
}
@@ -1461,7 +1471,7 @@ static int validate_acl(FFStream *stream, HTTPContext *c)
}
/* compute the real filename of a file by matching it without its
- extensions to all the stream filenames */
+ extensions to all the stream's filenames */
static void compute_real_filename(char *filename, int max_size)
{
char file1[1024];
@@ -1495,7 +1505,7 @@ enum RedirType {
REDIR_SDP,
};
-/* parse http request and prepare header */
+/* parse HTTP request and prepare header */
static int http_parse_request(HTTPContext *c)
{
const char *p;
@@ -1730,7 +1740,7 @@ static int http_parse_request(HTTPContext *c)
*p = '\0';
snprintf(q, c->buffer_size,
"HTTP/1.0 200 RTSP Redirect follows\r\n"
- /* XXX: incorrect mime type ? */
+ /* XXX: incorrect MIME type ? */
"Content-type: application/x-rtsp\r\n"
"\r\n"
"rtsp://%s:%d/%s\r\n", hostname, ntohs(my_rtsp_addr.sin_port), filename);
@@ -1751,7 +1761,10 @@ static int http_parse_request(HTTPContext *c)
q += strlen(q);
len = sizeof(my_addr);
- getsockname(c->fd, (struct sockaddr *)&my_addr, &len);
+
+ /* XXX: Should probably fail? */
+ if (getsockname(c->fd, (struct sockaddr *)&my_addr, &len))
+ http_log("getsockname() failed\n");
/* XXX: should use a dynamic buffer */
sdp_data_size = prepare_sdp_description(stream,
@@ -1791,7 +1804,7 @@ static int http_parse_request(HTTPContext *c)
/* if post, it means a feed is being sent */
if (!stream->is_feed) {
/* However it might be a status report from WMP! Let us log the
- * data as it might come in handy one day. */
+ * data as it might come handy one day. */
const char *logline = 0;
int client_id = 0;
@@ -1866,7 +1879,7 @@ static int http_parse_request(HTTPContext *c)
goto send_error;
}
- /* prepare http header */
+ /* prepare HTTP header */
c->buffer[0] = 0;
av_strlcatf(c->buffer, c->buffer_size, "HTTP/1.0 200 OK\r\n");
mime_type = c->stream->fmt->mime_type;
@@ -1945,7 +1958,7 @@ static void compute_status(HTTPContext *c)
}
avio_printf(pb, "HTTP/1.0 200 OK\r\n");
- avio_printf(pb, "Content-type: %s\r\n", "text/html");
+ avio_printf(pb, "Content-type: text/html\r\n");
avio_printf(pb, "Pragma: no-cache\r\n");
avio_printf(pb, "\r\n");
@@ -2228,8 +2241,8 @@ static int open_input_stream(HTTPContext *c, const char *info)
return ret;
}
- /* choose stream as clock source (we favorize video stream if
- present) for packet sending */
+ /* choose stream as clock source (we favor the video stream if
+ * present) for packet sending */
c->pts_stream_index = 0;
for(i=0;i<c->stream->nb_streams;i++) {
if (c->pts_stream_index == 0 &&
@@ -2278,12 +2291,10 @@ static int http_prepare_data(HTTPContext *c)
av_freep(&c->pb_buffer);
switch(c->state) {
case HTTPSTATE_SEND_DATA_HEADER:
- memset(&c->fmt_ctx, 0, sizeof(c->fmt_ctx));
- av_dict_set(&c->fmt_ctx.metadata, "author" , c->stream->author , 0);
- av_dict_set(&c->fmt_ctx.metadata, "comment" , c->stream->comment , 0);
- av_dict_set(&c->fmt_ctx.metadata, "copyright", c->stream->copyright, 0);
- av_dict_set(&c->fmt_ctx.metadata, "title" , c->stream->title , 0);
-
+ ctx = avformat_alloc_context();
+ c->fmt_ctx = *ctx;
+ av_freep(&ctx);
+ av_dict_copy(&(c->fmt_ctx.metadata), c->stream->metadata, 0);
c->fmt_ctx.streams = av_mallocz(sizeof(AVStream *) * c->stream->nb_streams);
for(i=0;i<c->stream->nb_streams;i++) {
@@ -2298,8 +2309,8 @@ static int http_prepare_data(HTTPContext *c)
*(c->fmt_ctx.streams[i]) = *src;
c->fmt_ctx.streams[i]->priv_data = 0;
- c->fmt_ctx.streams[i]->codec->frame_number = 0; /* XXX: should be done in
- AVStream, not in codec */
+ /* XXX: should be done in AVStream, not in codec */
+ c->fmt_ctx.streams[i]->codec->frame_number = 0;
}
/* set output format parameters */
c->fmt_ctx.oformat = c->stream->fmt;
@@ -2315,9 +2326,9 @@ static int http_prepare_data(HTTPContext *c)
c->fmt_ctx.pb->seekable = 0;
/*
- * HACK to avoid mpeg ps muxer to spit many underflow errors
+ * HACK to avoid MPEG-PS muxer to spit many underflow errors
* Default value from FFmpeg
- * Try to set it use configuration option
+ * Try to set it using configuration option
*/
c->fmt_ctx.max_delay = (int)(0.7*AV_TIME_BASE);
@@ -2368,7 +2379,7 @@ static int http_prepare_data(HTTPContext *c)
goto redo;
} else {
no_loop:
- /* must send trailer now because eof or error */
+ /* must send trailer now because EOF or error */
c->state = HTTPSTATE_SEND_DATA_TRAILER;
}
}
@@ -2410,8 +2421,8 @@ static int http_prepare_data(HTTPContext *c)
send_it:
ist = c->fmt_in->streams[source_index];
/* specific handling for RTP: we use several
- output stream (one for each RTP
- connection). XXX: need more abstract handling */
+ * output streams (one for each RTP connection).
+ * XXX: need more abstract handling */
if (c->is_packetized) {
/* compute send time and duration */
c->cur_pts = av_rescale_q(pkt.dts, ist->time_base, AV_TIME_BASE_Q);
@@ -2455,8 +2466,9 @@ static int http_prepare_data(HTTPContext *c)
if (pkt.pts != AV_NOPTS_VALUE)
pkt.pts = av_rescale_q(pkt.pts, ist->time_base, ost->time_base);
pkt.duration = av_rescale_q(pkt.duration, ist->time_base, ost->time_base);
- if (av_write_frame(ctx, &pkt) < 0) {
- http_log("Error writing frame to output\n");
+ if ((ret = av_write_frame(ctx, &pkt)) < 0) {
+ http_log("Error writing frame to output for stream '%s': %s\n",
+ c->stream->filename, av_err2str(ret));
c->state = HTTPSTATE_SEND_DATA_TRAILER;
}
@@ -2500,7 +2512,7 @@ static int http_prepare_data(HTTPContext *c)
/* should convert the format at the same time */
/* send data starting at c->buffer_ptr to the output connection
- (either UDP or TCP connection) */
+ * (either UDP or TCP) */
static int http_send_data(HTTPContext *c)
{
int len, ret;
@@ -2640,7 +2652,7 @@ static int http_start_receive_data(HTTPContext *c)
fd = open(c->stream->feed_filename, O_RDWR);
if (fd < 0) {
ret = AVERROR(errno);
- http_log("Could not open feed file '%s':%s \n",
+ http_log("Could not open feed file '%s': %s\n",
c->stream->feed_filename, strerror(errno));
return ret;
}
@@ -2745,8 +2757,11 @@ static int http_receive_data(HTTPContext *c)
/* a packet has been received : write it in the store, except
if header */
if (c->data_count > FFM_PACKET_SIZE) {
- /* XXX: use llseek or url_seek */
- lseek(c->feed_fd, feed->feed_write_index, SEEK_SET);
+ /* XXX: use llseek or url_seek
+ * XXX: Should probably fail? */
+ if (lseek(c->feed_fd, feed->feed_write_index, SEEK_SET) == -1)
+ http_log("Seek to %"PRId64" failed\n", feed->feed_write_index);
+
if (write(c->feed_fd, c->buffer, FFM_PACKET_SIZE) < 0) {
http_log("Error writing to feed file: %s\n", strerror(errno));
goto fail;
@@ -2842,44 +2857,9 @@ static void rtsp_reply_header(HTTPContext *c, enum RTSPStatusCode error_number)
struct tm *tm;
char buf2[32];
- switch(error_number) {
- case RTSP_STATUS_OK:
- str = "OK";
- break;
- case RTSP_STATUS_METHOD:
- str = "Method Not Allowed";
- break;
- case RTSP_STATUS_BANDWIDTH:
- str = "Not Enough Bandwidth";
- break;
- case RTSP_STATUS_SESSION:
- str = "Session Not Found";
- break;
- case RTSP_STATUS_STATE:
- str = "Method Not Valid in This State";
- break;
- case RTSP_STATUS_AGGREGATE:
- str = "Aggregate operation not allowed";
- break;
- case RTSP_STATUS_ONLY_AGGREGATE:
- str = "Only aggregate operation allowed";
- break;
- case RTSP_STATUS_TRANSPORT:
- str = "Unsupported transport";
- break;
- case RTSP_STATUS_INTERNAL:
- str = "Internal Server Error";
- break;
- case RTSP_STATUS_SERVICE:
- str = "Service Unavailable";
- break;
- case RTSP_STATUS_VERSION:
- str = "RTSP Version not supported";
- break;
- default:
+ str = RTSP_STATUS_CODE2STRING(error_number);
+ if (!str)
str = "Unknown Error";
- break;
- }
avio_printf(c->pb, "RTSP/1.0 %d %s\r\n", error_number, str);
avio_printf(c->pb, "CSeq: %d\r\n", c->seq);
@@ -2967,9 +2947,9 @@ static int rtsp_parse_request(HTTPContext *c)
else if (!strcmp(cmd, "PLAY"))
rtsp_cmd_play(c, url, header);
else if (!strcmp(cmd, "PAUSE"))
- rtsp_cmd_pause(c, url, header);
+ rtsp_cmd_interrupt(c, url, header, 1);
else if (!strcmp(cmd, "TEARDOWN"))
- rtsp_cmd_teardown(c, url, header);
+ rtsp_cmd_interrupt(c, url, header, 0);
else
rtsp_reply_error(c, RTSP_STATUS_METHOD);
@@ -2992,6 +2972,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
AVFormatContext *avc;
AVStream *avs = NULL;
AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
+ AVDictionaryEntry *entry = av_dict_get(stream->metadata, "title", NULL, 0);
int i;
avc = avformat_alloc_context();
@@ -3000,7 +2981,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
}
avc->oformat = rtp_format;
av_dict_set(&avc->metadata, "title",
- stream->title[0] ? stream->title : "No Title", 0);
+ entry ? entry->value : "No Title", 0);
avc->nb_streams = stream->nb_streams;
if (stream->is_multicast) {
snprintf(avc->filename, 1024, "rtp://%s:%d?multicast=1?ttl=%d",
@@ -3052,7 +3033,7 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url)
socklen_t len;
struct sockaddr_in my_addr;
- /* find which url is asked */
+ /* find which URL is asked */
av_url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
path = path1;
if (*path == '/')
@@ -3070,7 +3051,7 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url)
return;
found:
- /* prepare the media description in sdp format */
+ /* prepare the media description in SDP format */
/* get the host IP */
len = sizeof(my_addr);
@@ -3129,7 +3110,7 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url,
struct sockaddr_in dest_addr;
RTSPActionServerSetup setup;
- /* find which url is asked */
+ /* find which URL is asked */
av_url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
path = path1;
if (*path == '/')
@@ -3171,7 +3152,7 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url,
random0, random1);
}
- /* find rtp session, and create it if none found */
+ /* find RTP session, and create it if none found */
rtp_c = find_rtp_session(h->session_id);
if (!rtp_c) {
/* always prefer UDP */
@@ -3260,7 +3241,7 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url,
}
-/* find an rtp connection by using the session ID. Check consistency
+/* find an RTP connection by using the session ID. Check consistency
with filename */
static HTTPContext *find_rtp_session_with_url(const char *url,
const char *session_id)
@@ -3275,7 +3256,7 @@ static HTTPContext *find_rtp_session_with_url(const char *url,
if (!rtp_c)
return NULL;
- /* find which url is asked */
+ /* find which URL is asked */
av_url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
path = path1;
if (*path == '/')
@@ -3322,7 +3303,7 @@ static void rtsp_cmd_play(HTTPContext *c, const char *url, RTSPMessageHeader *h)
avio_printf(c->pb, "\r\n");
}
-static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPMessageHeader *h)
+static void rtsp_cmd_interrupt(HTTPContext *c, const char *url, RTSPMessageHeader *h, int pause_only)
{
HTTPContext *rtp_c;
@@ -3332,29 +3313,14 @@ static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPMessageHeader *h
return;
}
- if (rtp_c->state != HTTPSTATE_SEND_DATA &&
- rtp_c->state != HTTPSTATE_WAIT_FEED) {
- rtsp_reply_error(c, RTSP_STATUS_STATE);
- return;
- }
-
- rtp_c->state = HTTPSTATE_READY;
- rtp_c->first_pts = AV_NOPTS_VALUE;
- /* now everything is OK, so we can send the connection parameters */
- rtsp_reply_header(c, RTSP_STATUS_OK);
- /* session ID */
- avio_printf(c->pb, "Session: %s\r\n", rtp_c->session_id);
- avio_printf(c->pb, "\r\n");
-}
-
-static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPMessageHeader *h)
-{
- HTTPContext *rtp_c;
-
- rtp_c = find_rtp_session_with_url(url, h->session_id);
- if (!rtp_c) {
- rtsp_reply_error(c, RTSP_STATUS_SESSION);
- return;
+ if (pause_only) {
+ if (rtp_c->state != HTTPSTATE_SEND_DATA &&
+ rtp_c->state != HTTPSTATE_WAIT_FEED) {
+ rtsp_reply_error(c, RTSP_STATUS_STATE);
+ return;
+ }
+ rtp_c->state = HTTPSTATE_READY;
+ rtp_c->first_pts = AV_NOPTS_VALUE;
}
/* now everything is OK, so we can send the connection parameters */
@@ -3363,11 +3329,10 @@ static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPMessageHeader
avio_printf(c->pb, "Session: %s\r\n", rtp_c->session_id);
avio_printf(c->pb, "\r\n");
- /* abort the session */
- close_connection(rtp_c);
+ if (!pause_only)
+ close_connection(rtp_c);
}
-
/********************************************************************/
/* RTP handling */
@@ -3512,7 +3477,8 @@ static int rtp_new_av_stream(HTTPContext *c,
ipaddr, ntohs(dest_addr->sin_port),
c->stream->filename, stream_index, c->protocol);
- /* normally, no packets should be output here, but the packet size may be checked */
+ /* normally, no packets should be output here, but the packet size may
+ * be checked */
if (ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size) < 0) {
/* XXX: close stream */
goto fail;
@@ -3521,6 +3487,7 @@ static int rtp_new_av_stream(HTTPContext *c,
fail:
if (h)
ffurl_close(h);
+ av_free(st);
av_free(ctx);
return -1;
}
@@ -3554,7 +3521,7 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int cop
}
} else {
/* live streams must use the actual feed's codec since it may be
- * updated later to carry extradata needed by the streams.
+ * updated later to carry extradata needed by them.
*/
fst->codec = codec;
}
@@ -3619,7 +3586,7 @@ static void remove_stream(FFStream *stream)
}
}
-/* specific mpeg4 handling : we extract the raw parameters */
+/* specific MPEG4 handling : we extract the raw parameters */
static void extract_mpeg4_header(AVFormatContext *infile)
{
int mpeg4_count, i, size;
@@ -3823,7 +3790,7 @@ static void build_feed_streams(void)
}
}
if (avio_check(feed->feed_filename, AVIO_FLAG_WRITE) <= 0) {
- AVFormatContext s1 = {0}, *s = &s1;
+ AVFormatContext *s = avformat_alloc_context();
if (feed->readonly) {
http_log("Unable to create feed file '%s' as it is marked readonly\n",
@@ -3844,9 +3811,12 @@ static void build_feed_streams(void)
http_log("Container doesn't support the required parameters\n");
exit(1);
}
- /* XXX: need better api */
+ /* XXX: need better API */
av_freep(&s->priv_data);
avio_close(s->pb);
+ s->streams = NULL;
+ s->nb_streams = 0;
+ avformat_free_context(s);
}
/* get feed size and write index */
fd = open(feed->feed_filename, O_RDONLY);
@@ -4031,8 +4001,7 @@ static int ffserver_opt_preset(const char *arg,
return ret;
}
-static AVOutputFormat *ffserver_guess_format(const char *short_name, const char *filename,
- const char *mime_type)
+static AVOutputFormat *ffserver_guess_format(const char *short_name, const char *filename, const char *mime_type)
{
AVOutputFormat *fmt = av_guess_format(short_name, filename, mime_type);
@@ -4050,12 +4019,12 @@ static AVOutputFormat *ffserver_guess_format(const char *short_name, const char
return fmt;
}
-static void report_config_error(const char *filename, int line_num, int *errors, const char *fmt, ...)
+static void report_config_error(const char *filename, int line_num, int log_level, int *errors, const char *fmt, ...)
{
va_list vl;
va_start(vl, fmt);
- fprintf(stderr, "%s:%d: ", filename, line_num);
- vfprintf(stderr, fmt, vl);
+ av_log(NULL, log_level, "%s:%d: ", filename, line_num);
+ av_vlog(NULL, log_level, fmt, vl);
va_end(vl);
(*errors)++;
@@ -4066,9 +4035,9 @@ static int parse_ffconfig(const char *filename)
FILE *f;
char line[1024];
char cmd[64];
- char arg[1024];
+ char arg[1024], arg2[1024];
const char *p;
- int val, errors, line_num;
+ int val, errors, warnings, line_num;
FFStream **last_stream, *stream, *redirect;
FFStream **last_feed, *feed, *s;
AVCodecContext audio_enc, video_enc;
@@ -4082,7 +4051,7 @@ static int parse_ffconfig(const char *filename)
return ret;
}
- errors = 0;
+ errors = warnings = 0;
line_num = 0;
first_stream = NULL;
last_stream = &first_stream;
@@ -4093,8 +4062,9 @@ static int parse_ffconfig(const char *filename)
redirect = NULL;
audio_id = AV_CODEC_ID_NONE;
video_id = AV_CODEC_ID_NONE;
+#define ERROR(...) report_config_error(filename, line_num, AV_LOG_ERROR, &errors, __VA_ARGS__)
+#define WARNING(...) report_config_error(filename, line_num, AV_LOG_WARNING, &warnings, __VA_ARGS__)
-#define ERROR(...) report_config_error(filename, line_num, &errors, __VA_ARGS__)
for(;;) {
if (fgets(line, sizeof(line), f) == NULL)
break;
@@ -4120,7 +4090,7 @@ static int parse_ffconfig(const char *filename)
ERROR("%s:%d: Invalid host/IP address: %s\n", arg);
}
} else if (!av_strcasecmp(cmd, "NoDaemon")) {
- // do nothing here, its the default now
+ WARNING("NoDaemon option has no effect, you should remove it\n");
} else if (!av_strcasecmp(cmd, "RTSPPort")) {
get_arg(arg, sizeof(arg), &p);
val = atoi(arg);
@@ -4242,9 +4212,8 @@ static int parse_ffconfig(const char *filename)
if (!arg[0]) {
feed->truncate = 1;
} else {
- av_log(NULL, AV_LOG_WARNING,
- "Truncate N syntax in configuration file is deprecated, "
- "use Truncate alone with no arguments\n");
+ WARNING("Truncate N syntax in configuration file is deprecated, "
+ "use Truncate alone with no arguments\n");
feed->truncate = strtod(arg, NULL);
}
}
@@ -4339,7 +4308,7 @@ static int parse_ffconfig(const char *filename)
stream->fmt = NULL;
} else {
stream->stream_type = STREAM_TYPE_LIVE;
- /* jpeg cannot be used here, so use single frame jpeg */
+ /* JPEG cannot be used here, so use single frame MJPEG */
if (!strcmp(arg, "jpeg"))
strcpy(arg, "mjpeg");
stream->fmt = ffserver_guess_format(arg, NULL, NULL);
@@ -4366,18 +4335,36 @@ static int parse_ffconfig(const char *filename)
} else {
ERROR("FaviconURL only permitted for status streams\n");
}
- } else if (!av_strcasecmp(cmd, "Author")) {
- if (stream)
- get_arg(stream->author, sizeof(stream->author), &p);
- } else if (!av_strcasecmp(cmd, "Comment")) {
- if (stream)
- get_arg(stream->comment, sizeof(stream->comment), &p);
- } else if (!av_strcasecmp(cmd, "Copyright")) {
- if (stream)
- get_arg(stream->copyright, sizeof(stream->copyright), &p);
- } else if (!av_strcasecmp(cmd, "Title")) {
- if (stream)
- get_arg(stream->title, sizeof(stream->title), &p);
+ } else if (!av_strcasecmp(cmd, "Author") ||
+ !av_strcasecmp(cmd, "Comment") ||
+ !av_strcasecmp(cmd, "Copyright") ||
+ !av_strcasecmp(cmd, "Title")) {
+ get_arg(arg, sizeof(arg), &p);
+
+ if (stream) {
+ char key[32];
+ int i, ret;
+
+ for (i = 0; i < strlen(cmd); i++)
+ key[i] = av_tolower(cmd[i]);
+ key[i] = 0;
+ WARNING("'%s' option in configuration file is deprecated, "
+ "use 'Metadata %s VALUE' instead\n", cmd, key);
+ if ((ret = av_dict_set(&stream->metadata, key, arg, 0)) < 0) {
+ ERROR("Could not set metadata '%s' to value '%s': %s\n",
+ key, arg, av_err2str(ret));
+ }
+ }
+ } else if (!av_strcasecmp(cmd, "Metadata")) {
+ get_arg(arg, sizeof(arg), &p);
+ get_arg(arg2, sizeof(arg2), &p);
+ if (stream) {
+ int ret;
+ if ((ret = av_dict_set(&stream->metadata, arg, arg2, 0)) < 0) {
+ ERROR("Could not set metadata '%s' to value '%s': %s\n",
+ arg, arg2, av_err2str(ret));
+ }
+ }
} else if (!av_strcasecmp(cmd, "Preroll")) {
get_arg(arg, sizeof(arg), &p);
if (stream)
@@ -4500,7 +4487,6 @@ static int parse_ffconfig(const char *filename)
}
} else if (!av_strcasecmp(cmd, "AVOptionVideo") ||
!av_strcasecmp(cmd, "AVOptionAudio")) {
- char arg2[1024];
AVCodecContext *avctx;
int type;
get_arg(arg, sizeof(arg), &p);
diff --git a/chromium/third_party/ffmpeg/libavcodec/4xm.c b/chromium/third_party/ffmpeg/libavcodec/4xm.c
index eb07cc370df..23ba1ecee7a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/4xm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/4xm.c
@@ -24,8 +24,11 @@
* 4XM codec.
*/
+#include <inttypes.h>
+
#include "libavutil/avassert.h"
#include "libavutil/frame.h"
+#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "bytestream.h"
@@ -131,7 +134,8 @@ typedef struct CFrameBuffer {
typedef struct FourXContext {
AVCodecContext *avctx;
DSPContext dsp;
- AVFrame *current_picture, *last_picture;
+ uint16_t *frame_buffer;
+ uint16_t *last_frame_buffer;
GetBitContext pre_gb; ///< ac/dc prefix
GetBitContext gb;
GetByteContext g;
@@ -341,7 +345,7 @@ static int decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
int code = get_vlc2(&f->gb,
block_type_vlc[1 - (f->version > 1)][index].table,
BLOCK_TYPE_VLC_BITS, 1);
- uint16_t *start = (uint16_t *)f->last_picture->data[0];
+ uint16_t *start = f->last_frame_buffer;
uint16_t *end = start + stride * (f->avctx->height - h + 1) - (1 << log2w);
int ret;
int scale = 1;
@@ -414,29 +418,18 @@ static int decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
return 0;
}
-static int decode_p_frame(FourXContext *f, AVFrame *frame,
- const uint8_t *buf, int length)
+static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
{
int x, y;
const int width = f->avctx->width;
const int height = f->avctx->height;
- uint16_t *dst = (uint16_t *)frame->data[0];
- const int stride = frame->linesize[0] >> 1;
+ uint16_t *dst = f->frame_buffer;
uint16_t *src;
unsigned int bitstream_size, bytestream_size, wordstream_size, extra,
bytestream_offset, wordstream_offset;
int ret;
- if (!f->last_picture->data[0]) {
- if ((ret = ff_get_buffer(f->avctx, f->last_picture,
- AV_GET_BUFFER_FLAG_REF)) < 0) {
- return ret;
- }
- for (y=0; y<f->avctx->height; y++)
- memset(f->last_picture->data[0] + y*f->last_picture->linesize[0], 0, 2*f->avctx->width);
- }
-
- src = (uint16_t *)f->last_picture->data[0];
+ src = f->last_frame_buffer;
if (f->version > 1) {
extra = 20;
@@ -476,14 +469,14 @@ static int decode_p_frame(FourXContext *f, AVFrame *frame,
bytestream2_init(&f->g, buf + bytestream_offset,
length - bytestream_offset);
- init_mv(f, frame->linesize[0]);
+ init_mv(f, width * 2);
for (y = 0; y < height; y += 8) {
for (x = 0; x < width; x += 8)
- if ((ret = decode_p_block(f, dst + x, src + x, 3, 3, stride)) < 0)
+ if ((ret = decode_p_block(f, dst + x, src + x, 3, 3, width)) < 0)
return ret;
- src += 8 * stride;
- dst += 8 * stride;
+ src += 8 * width;
+ dst += 8 * width;
}
return 0;
@@ -548,12 +541,12 @@ static int decode_i_block(FourXContext *f, int16_t *block)
return 0;
}
-static inline void idct_put(FourXContext *f, AVFrame *frame, int x, int y)
+static inline void idct_put(FourXContext *f, int x, int y)
{
int16_t (*block)[64] = f->block;
- int stride = frame->linesize[0] >> 1;
+ int stride = f->avctx->width;
int i;
- uint16_t *dst = ((uint16_t*)frame->data[0]) + y * stride + x;
+ uint16_t *dst = f->frame_buffer + y * stride + x;
for (i = 0; i < 4; i++) {
block[i][0] += 0x80 * 8 * 8;
@@ -713,14 +706,13 @@ static int mix(int c0, int c1)
return red / 3 * 1024 + green / 3 * 32 + blue / 3;
}
-static int decode_i2_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, int length)
+static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
{
int x, y, x2, y2;
const int width = f->avctx->width;
const int height = f->avctx->height;
const int mbs = (FFALIGN(width, 16) >> 4) * (FFALIGN(height, 16) >> 4);
- uint16_t *dst = (uint16_t*)frame->data[0];
- const int stride = frame->linesize[0]>>1;
+ uint16_t *dst = f->frame_buffer;
const uint8_t *buf_end = buf + length;
GetByteContext g3;
@@ -751,18 +743,18 @@ static int decode_i2_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf,
for (y2 = 0; y2 < 16; y2++) {
for (x2 = 0; x2 < 16; x2++) {
int index = 2 * (x2 >> 2) + 8 * (y2 >> 2);
- dst[y2 * stride + x2] = color[(bits >> index) & 3];
+ dst[y2 * width + x2] = color[(bits >> index) & 3];
}
}
dst += 16;
}
- dst += 16 * stride - x;
+ dst += 16 * width - x;
}
return 0;
}
-static int decode_i_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, int length)
+static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
{
int x, y, ret;
const int width = f->avctx->width;
@@ -816,7 +808,7 @@ static int decode_i_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, i
if ((ret = decode_i_mb(f)) < 0)
return ret;
- idct_put(f, frame, x, y);
+ idct_put(f, x, y);
}
}
@@ -841,7 +833,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
av_assert0(avctx->width % 16 == 0 && avctx->height % 16 == 0);
if (buf_size < AV_RL32(buf + 4) + 8) {
- av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n",
+ av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %"PRIu32"\n",
buf_size, AV_RL32(buf + 4));
return AVERROR_INVALIDDATA;
}
@@ -919,29 +911,24 @@ static int decode_frame(AVCodecContext *avctx, void *data,
frame_size = buf_size - 12;
}
- FFSWAP(AVFrame*, f->current_picture, f->last_picture);
-
- // alternatively we would have to use our own buffer management
- avctx->flags |= CODEC_FLAG_EMU_EDGE;
-
- if ((ret = ff_reget_buffer(avctx, f->current_picture)) < 0)
+ if ((ret = ff_get_buffer(avctx, picture, 0)) < 0)
return ret;
if (frame_4cc == AV_RL32("ifr2")) {
- f->current_picture->pict_type = AV_PICTURE_TYPE_I;
- if ((ret = decode_i2_frame(f, f->current_picture, buf - 4, frame_size + 4)) < 0) {
+ picture->pict_type = AV_PICTURE_TYPE_I;
+ if ((ret = decode_i2_frame(f, buf - 4, frame_size + 4)) < 0) {
av_log(f->avctx, AV_LOG_ERROR, "decode i2 frame failed\n");
return ret;
}
} else if (frame_4cc == AV_RL32("ifrm")) {
- f->current_picture->pict_type = AV_PICTURE_TYPE_I;
- if ((ret = decode_i_frame(f, f->current_picture, buf, frame_size)) < 0) {
+ picture->pict_type = AV_PICTURE_TYPE_I;
+ if ((ret = decode_i_frame(f, buf, frame_size)) < 0) {
av_log(f->avctx, AV_LOG_ERROR, "decode i frame failed\n");
return ret;
}
} else if (frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")) {
- f->current_picture->pict_type = AV_PICTURE_TYPE_P;
- if ((ret = decode_p_frame(f, f->current_picture, buf, frame_size)) < 0) {
+ picture->pict_type = AV_PICTURE_TYPE_P;
+ if ((ret = decode_p_frame(f, buf, frame_size)) < 0) {
av_log(f->avctx, AV_LOG_ERROR, "decode p frame failed\n");
return ret;
}
@@ -953,10 +940,13 @@ static int decode_frame(AVCodecContext *avctx, void *data,
buf_size);
}
- f->current_picture->key_frame = f->current_picture->pict_type == AV_PICTURE_TYPE_I;
+ picture->key_frame = picture->pict_type == AV_PICTURE_TYPE_I;
+
+ av_image_copy_plane(picture->data[0], picture->linesize[0],
+ (const uint8_t*)f->frame_buffer, avctx->width * 2,
+ avctx->width * 2, avctx->height);
+ FFSWAP(uint16_t *, f->frame_buffer, f->last_frame_buffer);
- if ((ret = av_frame_ref(picture, f->current_picture)) < 0)
- return ret;
*got_frame = 1;
emms_c();
@@ -964,9 +954,28 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return buf_size;
}
+static av_cold int decode_end(AVCodecContext *avctx)
+{
+ FourXContext * const f = avctx->priv_data;
+ int i;
+
+ av_freep(&f->frame_buffer);
+ av_freep(&f->last_frame_buffer);
+ av_freep(&f->bitstream_buffer);
+ f->bitstream_buffer_size = 0;
+ for (i = 0; i < CFRAME_BUFFER_COUNT; i++) {
+ av_freep(&f->cfrm[i].data);
+ f->cfrm[i].allocated_size = 0;
+ }
+ ff_free_vlc(&f->pre_vlc);
+
+ return 0;
+}
+
static av_cold int decode_init(AVCodecContext *avctx)
{
FourXContext * const f = avctx->priv_data;
+ int ret;
if (avctx->extradata_size != 4 || !avctx->extradata) {
av_log(avctx, AV_LOG_ERROR, "extradata wrong or missing\n");
@@ -977,6 +986,17 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
+ ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
+ if (ret < 0)
+ return ret;
+
+ f->frame_buffer = av_mallocz(avctx->width * avctx->height * 2);
+ f->last_frame_buffer = av_mallocz(avctx->width * avctx->height * 2);
+ if (!f->frame_buffer || !f->last_frame_buffer) {
+ decode_end(avctx);
+ return AVERROR(ENOMEM);
+ }
+
f->version = AV_RL32(avctx->extradata) >> 16;
ff_dsputil_init(&f->dsp, avctx);
f->avctx = avctx;
@@ -987,30 +1007,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
else
avctx->pix_fmt = AV_PIX_FMT_BGR555;
- f->current_picture = av_frame_alloc();
- f->last_picture = av_frame_alloc();
- if (!f->current_picture || !f->last_picture)
- return AVERROR(ENOMEM);
-
- return 0;
-}
-
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
- FourXContext * const f = avctx->priv_data;
- int i;
-
- av_freep(&f->bitstream_buffer);
- f->bitstream_buffer_size = 0;
- for (i = 0; i < CFRAME_BUFFER_COUNT; i++) {
- av_freep(&f->cfrm[i].data);
- f->cfrm[i].allocated_size = 0;
- }
- ff_free_vlc(&f->pre_vlc);
- av_frame_free(&f->current_picture);
- av_frame_free(&f->last_picture);
-
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/8bps.c b/chromium/third_party/ffmpeg/libavcodec/8bps.c
index d01ef924c79..e00bdfc8086 100644
--- a/chromium/third_party/ffmpeg/libavcodec/8bps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/8bps.c
@@ -150,7 +150,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->planemap[0] = 0; // 1st plane is palette indexes
break;
case 24:
- avctx->pix_fmt = avctx->get_format(avctx, pixfmt_rgb24);
+ avctx->pix_fmt = ff_get_format(avctx, pixfmt_rgb24);
c->planes = 3;
c->planemap[0] = 2; // 1st plane is red
c->planemap[1] = 1; // 2nd plane is green
diff --git a/chromium/third_party/ffmpeg/libavcodec/Makefile b/chromium/third_party/ffmpeg/libavcodec/Makefile
index 0f6f881cf80..f1690a82ed9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/Makefile
@@ -1,7 +1,6 @@
include $(SUBDIR)../config.mak
NAME = avcodec
-FFLIBS = avutil
HEADERS = avcodec.h \
avfft.h \
@@ -26,7 +25,6 @@ OBJS = allcodecs.o \
options.o \
parser.o \
raw.o \
- rawdec.o \
resample.o \
resample2.o \
utils.o \
@@ -35,6 +33,7 @@ OBJS = allcodecs.o \
OBJS-$(CONFIG_AANDCTTABLES) += aandcttab.o
OBJS-$(CONFIG_AC3DSP) += ac3dsp.o
OBJS-$(CONFIG_AUDIO_FRAME_QUEUE) += audio_frame_queue.o
+OBJS-$(CONFIG_CABAC) += cabac.o
OBJS-$(CONFIG_CRYSTALHD) += crystalhd.o
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
OBJS-$(CONFIG_DXVA2) += dxva2.o
@@ -50,12 +49,14 @@ OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
OBJS-$(CONFIG_GOLOMB) += golomb.o
OBJS-$(CONFIG_H263DSP) += h263dsp.o
OBJS-$(CONFIG_H264CHROMA) += h264chroma.o
-OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o
+OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o startcode.o
OBJS-$(CONFIG_H264PRED) += h264pred.o
OBJS-$(CONFIG_H264QPEL) += h264qpel.o
OBJS-$(CONFIG_HPELDSP) += hpeldsp.o
OBJS-$(CONFIG_HUFFMAN) += huffman.o
+OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o
OBJS-$(CONFIG_LIBXVID) += libxvid_rc.o
+OBJS-$(CONFIG_LLVIDDSP) += lossless_videodsp.o
OBJS-$(CONFIG_LPC) += lpc.o
OBJS-$(CONFIG_LSP) += lsp.o
OBJS-$(CONFIG_MDCT) += mdct_fixed.o mdct_float.o mdct_fixed_32.o
@@ -65,7 +66,8 @@ OBJS-$(CONFIG_MPEGAUDIODSP) += mpegaudiodsp.o \
mpegaudiodsp_data.o \
mpegaudiodsp_fixed.o \
mpegaudiodsp_float.o
-OBJS-$(CONFIG_MPEGVIDEO) += mpegvideo.o mpegvideo_motion.o
+OBJS-$(CONFIG_MPEGVIDEO) += mpegvideo.o mpegvideo_motion.o \
+ mpegutils.o
OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
motion_est.o ratecontrol.o
OBJS-$(CONFIG_RANGECODER) += rangecoder.o
@@ -73,7 +75,9 @@ RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
OBJS-$(CONFIG_SHARED) += log2_tab.o
OBJS-$(CONFIG_SINEWIN) += sinewin.o
+OBJS-$(CONFIG_TPELDSP) += tpeldsp.o
OBJS-$(CONFIG_VAAPI) += vaapi.o
+OBJS-$(CONFIG_VDA) += vda.o
OBJS-$(CONFIG_VDPAU) += vdpau.o
OBJS-$(CONFIG_VIDEODSP) += videodsp.o
OBJS-$(CONFIG_VP3DSP) += vp3dsp.o
@@ -90,13 +94,16 @@ OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
psymodel.o iirfilter.o \
mpeg4audio.o kbdwin.o
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
-OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3dec_data.o ac3.o kbdwin.o
+OBJS-$(CONFIG_AC3_DECODER) += ac3dec_float.o ac3dec_data.o ac3.o kbdwin.o
+OBJS-$(CONFIG_AC3_FIXED_DECODER) += ac3dec_fixed.o ac3dec_data.o ac3.o kbdwin.o
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3enc.o ac3tab.o \
ac3.o kbdwin.o
OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o
OBJS-$(CONFIG_AIC_DECODER) += aic.o
OBJS-$(CONFIG_ALAC_DECODER) += alac.o alac_data.o
OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o alac_data.o
+OBJS-$(CONFIG_ALIAS_PIX_DECODER) += aliaspixdec.o
+OBJS-$(CONFIG_ALIAS_PIX_ENCODER) += aliaspixenc.o
OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mpeg4audio.o
OBJS-$(CONFIG_AMRNB_DECODER) += amrnbdec.o celp_filters.o \
celp_math.o acelp_filters.o \
@@ -106,7 +113,6 @@ OBJS-$(CONFIG_AMRWB_DECODER) += amrwbdec.o celp_filters.o \
celp_math.o acelp_filters.o \
acelp_vectors.o \
acelp_pitch_delay.o
-OBJS-$(CONFIG_AMV_DECODER) += sp5xdec.o mjpegdec.o mjpeg.o
OBJS-$(CONFIG_AMV_ENCODER) += mjpegenc.o mjpeg.o \
mpegvideo_enc.o motion_est.o \
ratecontrol.o mpeg12data.o \
@@ -124,6 +130,8 @@ OBJS-$(CONFIG_ASV2_DECODER) += asvdec.o asv.o mpeg12data.o
OBJS-$(CONFIG_ASV2_ENCODER) += asvenc.o asv.o mpeg12data.o
OBJS-$(CONFIG_ATRAC1_DECODER) += atrac1.o atrac.o
OBJS-$(CONFIG_ATRAC3_DECODER) += atrac3.o atrac.o
+OBJS-$(CONFIG_ATRAC3P_DECODER) += atrac3plusdec.o atrac3plus.o \
+ atrac3plusdsp.o atrac.o
OBJS-$(CONFIG_AURA_DECODER) += cyuv.o
OBJS-$(CONFIG_AURA2_DECODER) += aura.o
OBJS-$(CONFIG_AVRN_DECODER) += avrndec.o mjpegdec.o mjpeg.o
@@ -144,13 +152,14 @@ OBJS-$(CONFIG_BMP_DECODER) += bmp.o msrledec.o
OBJS-$(CONFIG_BMP_ENCODER) += bmpenc.o
OBJS-$(CONFIG_BMV_VIDEO_DECODER) += bmv.o
OBJS-$(CONFIG_BMV_AUDIO_DECODER) += bmv.o
-OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brender_pix.o
+OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brenderpix.o
OBJS-$(CONFIG_C93_DECODER) += c93.o
OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
cavsdata.o mpeg12data.o
OBJS-$(CONFIG_CDGRAPHICS_DECODER) += cdgraphics.o
OBJS-$(CONFIG_CDXL_DECODER) += cdxl.o
OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
+OBJS-$(CONFIG_CINEPAK_ENCODER) += cinepakenc.o elbg.o
OBJS-$(CONFIG_CLJR_DECODER) += cljr.o
OBJS-$(CONFIG_CLJR_ENCODER) += cljr.o
OBJS-$(CONFIG_CLLC_DECODER) += cllc.o
@@ -170,6 +179,10 @@ OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o
OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o
OBJS-$(CONFIG_DPX_DECODER) += dpx.o
OBJS-$(CONFIG_DPX_ENCODER) += dpxenc.o
+OBJS-$(CONFIG_DSD_LSBF_DECODER) += dsddec.o
+OBJS-$(CONFIG_DSD_MSBF_DECODER) += dsddec.o
+OBJS-$(CONFIG_DSD_LSBF_PLANAR_DECODER) += dsddec.o
+OBJS-$(CONFIG_DSD_MSBF_PLANAR_DECODER) += dsddec.o
OBJS-$(CONFIG_DSICINAUDIO_DECODER) += dsicinav.o
OBJS-$(CONFIG_DSICINVIDEO_DECODER) += dsicinav.o
OBJS-$(CONFIG_DVBSUB_DECODER) += dvbsubdec.o
@@ -198,9 +211,8 @@ OBJS-$(CONFIG_EVRC_DECODER) += evrcdec.o acelp_vectors.o lsp.o
OBJS-$(CONFIG_EXR_DECODER) += exr.o
OBJS-$(CONFIG_FFV1_DECODER) += ffv1dec.o ffv1.o
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1enc.o ffv1.o
-OBJS-$(CONFIG_FFVHUFF_DECODER) += huffyuv.o huffyuvdec.o
-OBJS-$(CONFIG_FFVHUFF_ENCODER) += huffyuv.o huffyuvenc.o
OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
+OBJS-$(CONFIG_FIC_DECODER) += fic.o
OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o flacdsp.o
OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o flacdsp.o vorbis_data.o
OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
@@ -227,18 +239,17 @@ OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o ituh263dec.o \
intelh263dec.o
OBJS-$(CONFIG_H263_ENCODER) += mpeg4videoenc.o mpeg4video.o \
h263.o ituh263enc.o flvenc.o
-OBJS-$(CONFIG_H264_DECODER) += h264.o \
- h264_loopfilter.o h264_direct.o \
- cabac.o h264_sei.o h264_ps.o \
- h264_refs.o h264_cavlc.o h264_cabac.o
+OBJS-$(CONFIG_H264_DECODER) += h264.o h264_cabac.o h264_cavlc.o \
+ h264_direct.o h264_loopfilter.o \
+ h264_mb.o h264_picture.o h264_ps.o \
+ h264_refs.o h264_sei.o h264_slice.o
OBJS-$(CONFIG_H264_VDA_DECODER) += vda_h264_dec.o
OBJS-$(CONFIG_HEVC_DECODER) += hevc.o hevc_mvs.o hevc_ps.o hevc_sei.o \
hevc_cabac.o hevc_refs.o hevcpred.o \
- hevcdsp.o hevc_filter.o cabac.o
+ hevcdsp.o hevc_filter.o
OBJS-$(CONFIG_HNM4_VIDEO_DECODER) += hnm4video.o
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o huffyuvdec.o
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o huffyuvenc.o
-OBJS-$(CONFIG_IAC_DECODER) += imc.o
OBJS-$(CONFIG_IDCIN_DECODER) += idcinvideo.o
OBJS-$(CONFIG_IDF_DECODER) += bintext.o cga_data.o
OBJS-$(CONFIG_IFF_BYTERUN1_DECODER) += iff.o
@@ -255,8 +266,7 @@ OBJS-$(CONFIG_JPEG2000_ENCODER) += j2kenc.o mqcenc.o mqc.o jpeg2000.o \
jpeg2000dwt.o
OBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dec.o jpeg2000.o \
jpeg2000dwt.o mqcdec.o mqc.o
-OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o \
- mjpegdec.o mjpeg.o
+OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o
OBJS-$(CONFIG_JPEGLS_ENCODER) += jpeglsenc.o jpegls.o
OBJS-$(CONFIG_JV_DECODER) += jvdec.o
OBJS-$(CONFIG_KGV1_DECODER) += kgv1dec.o
@@ -273,7 +283,7 @@ OBJS-$(CONFIG_MICRODVD_DECODER) += microdvddec.o ass.o
OBJS-$(CONFIG_MIMIC_DECODER) += mimic.o
OBJS-$(CONFIG_MJPEG_DECODER) += mjpegdec.o mjpeg.o
OBJS-$(CONFIG_MJPEG_ENCODER) += mjpegenc.o mjpeg.o
-OBJS-$(CONFIG_MJPEGB_DECODER) += mjpegbdec.o mjpegdec.o mjpeg.o
+OBJS-$(CONFIG_MJPEGB_DECODER) += mjpegbdec.o
OBJS-$(CONFIG_MLP_DECODER) += mlpdec.o mlpdsp.o
OBJS-$(CONFIG_MMVIDEO_DECODER) += mmvideo.o
OBJS-$(CONFIG_MOTIONPIXELS_DECODER) += motionpixels.o
@@ -297,23 +307,16 @@ OBJS-$(CONFIG_MPC7_DECODER) += mpc7.o mpc.o
OBJS-$(CONFIG_MPC8_DECODER) += mpc8.o mpc.o
OBJS-$(CONFIG_MPEGVIDEO_DECODER) += mpeg12.o mpeg12data.o \
mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_MPEG_XVMC_DECODER) += mpegvideo_xvmc.o
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
OBJS-$(CONFIG_MPL2_DECODER) += mpl2dec.o ass.o
OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o \
- h263dec.o h263.o ituh263dec.o \
- mpeg4videodec.o
-OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4.o msmpeg4enc.o msmpeg4data.o \
- h263.o
-OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o \
- h263dec.o h263.o ituh263dec.o \
- mpeg4videodec.o
-OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4.o msmpeg4enc.o msmpeg4data.o \
- h263.o
+OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
+OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
+OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
+OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o
OBJS-$(CONFIG_MSA1_DECODER) += mss3.o mss34dsp.o
OBJS-$(CONFIG_MSS1_DECODER) += mss1.o mss12.o
@@ -324,10 +327,14 @@ OBJS-$(CONFIG_MSZH_DECODER) += lcldec.o
OBJS-$(CONFIG_MTS2_DECODER) += mss4.o mss34dsp.o
OBJS-$(CONFIG_MVC1_DECODER) += mvcdec.o
OBJS-$(CONFIG_MVC2_DECODER) += mvcdec.o
-OBJS-$(CONFIG_MXPEG_DECODER) += mxpegdec.o mjpegdec.o mjpeg.o
+OBJS-$(CONFIG_MXPEG_DECODER) += mxpegdec.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_ON2AVC_DECODER) += on2avc.o on2avcdata.o
+OBJS-$(CONFIG_OPUS_DECODER) += opusdec.o opus.o opus_celt.o \
+ opus_imdct.o opus_silk.o \
+ vorbis_data.o
OBJS-$(CONFIG_PAF_VIDEO_DECODER) += paf.o
OBJS-$(CONFIG_PAF_AUDIO_DECODER) += paf.o
OBJS-$(CONFIG_PAM_DECODER) += pnmdec.o pnm.o
@@ -351,7 +358,7 @@ OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o proresdsp.o proresdata.o
OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o proresdata.o
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o
OBJS-$(CONFIG_PRORES_AW_ENCODER) += proresenc_anatoliy.o
-OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o proresdsp.o
+OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o
OBJS-$(CONFIG_PTX_DECODER) += ptx.o
OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o \
celp_filters.o acelp_vectors.o \
@@ -407,7 +414,7 @@ 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_SP5X_DECODER) += sp5xdec.o
OBJS-$(CONFIG_SRT_DECODER) += srtdec.o ass.o
OBJS-$(CONFIG_SRT_ENCODER) += srtenc.o ass_split.o
OBJS-$(CONFIG_SUBRIP_DECODER) += srtdec.o ass.o
@@ -419,17 +426,13 @@ OBJS-$(CONFIG_SUNRAST_ENCODER) += sunrastenc.o
OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o svq13.o h263.o
OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o \
h263.o ituh263enc.o
-OBJS-$(CONFIG_SVQ3_DECODER) += svq3.o svq13.o h263.o h264.o \
- h264_loopfilter.o h264_direct.o \
- h264_sei.o h264_ps.o h264_refs.o \
- h264_cavlc.o h264_cabac.o cabac.o
+OBJS-$(CONFIG_SVQ3_DECODER) += svq3.o svq13.o mpegutils.o
OBJS-$(CONFIG_TEXT_DECODER) += textdec.o ass.o
OBJS-$(CONFIG_TAK_DECODER) += takdec.o tak.o
OBJS-$(CONFIG_TARGA_DECODER) += targa.o
OBJS-$(CONFIG_TARGA_ENCODER) += targaenc.o rle.o
OBJS-$(CONFIG_TARGA_Y216_DECODER) += targa_y216dec.o
OBJS-$(CONFIG_THEORA_DECODER) += xiph.o
-OBJS-$(CONFIG_THP_DECODER) += mjpegdec.o mjpeg.o
OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o
OBJS-$(CONFIG_TIFF_DECODER) += tiff.o lzw.o faxcompr.o tiff_data.o tiff_common.o
OBJS-$(CONFIG_TIFF_ENCODER) += tiffenc.o rle.o lzwenc.o tiff_data.o
@@ -440,7 +443,7 @@ OBJS-$(CONFIG_TRUEMOTION2_DECODER) += truemotion2.o
OBJS-$(CONFIG_TRUESPEECH_DECODER) += truespeech.o
OBJS-$(CONFIG_TSCC_DECODER) += tscc.o msrledec.o
OBJS-$(CONFIG_TSCC2_DECODER) += tscc2.o
-OBJS-$(CONFIG_TTA_DECODER) += tta.o ttadata.o
+OBJS-$(CONFIG_TTA_DECODER) += tta.o ttadata.o ttadsp.o
OBJS-$(CONFIG_TTA_ENCODER) += ttaenc.o ttadata.o
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o
OBJS-$(CONFIG_TXD_DECODER) += txd.o s3tc.o
@@ -460,7 +463,7 @@ OBJS-$(CONFIG_VB_DECODER) += vb.o
OBJS-$(CONFIG_VBLE_DECODER) += vble.o
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o \
msmpeg4dec.o msmpeg4.o msmpeg4data.o \
- intrax8.o intrax8dsp.o wmv2dsp.o
+ wmv2dsp.o startcode.o
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdav.o
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdav.o
@@ -474,6 +477,7 @@ OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vp56dsp.o \
vp56rac.o
OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp56dsp.o \
vp6dsp.o vp56rac.o
+OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp8dsp.o vp56rac.o
OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp8dsp.o vp56rac.o
OBJS-$(CONFIG_VP9_DECODER) += vp9.o vp9dsp.o vp56rac.o
OBJS-$(CONFIG_VPLAYER_DECODER) += textdec.o ass.o
@@ -481,7 +485,7 @@ OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
OBJS-$(CONFIG_WAVPACK_ENCODER) += wavpackenc.o
OBJS-$(CONFIG_WEBP_DECODER) += vp8.o vp8dsp.o vp56rac.o
-OBJS-$(CONFIG_WEBP_DECODER) += webp.o
+OBJS-$(CONFIG_WEBP_DECODER) += webp.o exif.o tiff_common.o
OBJS-$(CONFIG_WEBVTT_DECODER) += webvttdec.o
OBJS-$(CONFIG_WMALOSSLESS_DECODER) += wmalosslessdec.o wma_common.o
OBJS-$(CONFIG_WMAPRO_DECODER) += wmaprodec.o wma.o wma_common.o
@@ -494,8 +498,7 @@ OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \
acelp_vectors.o acelp_filters.o
OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2dsp.o \
- msmpeg4dec.o msmpeg4.o msmpeg4data.o \
- intrax8.o intrax8dsp.o
+ msmpeg4dec.o msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2dsp.o \
msmpeg4.o msmpeg4enc.o msmpeg4data.o
OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
@@ -622,6 +625,7 @@ OBJS-$(CONFIG_ADPCM_SBPRO_4_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_SWF_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_SWF_ENCODER) += adpcmenc.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_THP_DECODER) += adpcm.o adpcm_data.o
+OBJS-$(CONFIG_ADPCM_VIMA_DECODER) += vima.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o
@@ -635,9 +639,11 @@ OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
OBJS-$(CONFIG_H264_VDA_HWACCEL) += vda_h264.o
OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL) += vdpau_mpeg12.o
+OBJS-$(CONFIG_MPEG1_XVMC_HWACCEL) += mpegvideo_xvmc.o
OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL) += dxva2_mpeg2.o
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o vaapi_mpeg.o
OBJS-$(CONFIG_MPEG2_VDPAU_HWACCEL) += vdpau_mpeg12.o
+OBJS-$(CONFIG_MPEG2_XVMC_HWACCEL) += mpegvideo_xvmc.o
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o vaapi_mpeg.o
OBJS-$(CONFIG_MPEG4_VDPAU_HWACCEL) += vdpau_mpeg4.o
OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o
@@ -672,6 +678,7 @@ OBJS-$(CONFIG_MPEGTS_MUXER) += mpeg4audio.o
OBJS-$(CONFIG_MPEGTS_DEMUXER) += mpeg4audio.o mpegaudiodata.o
OBJS-$(CONFIG_MXF_MUXER) += dnxhddata.o
OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o
+OBJS-$(CONFIG_OGA_MUXER) += xiph.o flac.o flacdata.o
OBJS-$(CONFIG_OGG_DEMUXER) += xiph.o flac.o flacdata.o \
mpeg12data.o vorbis_parser.o \
dirac.o vorbis_data.o
@@ -734,7 +741,9 @@ OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o
OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o libvpx.o
OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o libvpx.o
OBJS-$(CONFIG_LIBWAVPACK_ENCODER) += libwavpackenc.o
+OBJS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc.o
OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o
+OBJS-$(CONFIG_LIBX265_ENCODER) += libx265.o
OBJS-$(CONFIG_LIBXAVS_ENCODER) += libxavs.o
OBJS-$(CONFIG_LIBXVID_ENCODER) += libxvid.o
OBJS-$(CONFIG_LIBZVBI_TELETEXT_DECODER) += libzvbi-teletextdec.o
@@ -761,11 +770,7 @@ OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \
OBJS-$(CONFIG_GSM_PARSER) += gsm_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 \
- cabac.o \
- h264_refs.o h264_sei.o h264_direct.o \
- h264_loopfilter.o h264_cabac.o \
- h264_cavlc.o h264_ps.o
+OBJS-$(CONFIG_H264_PARSER) += h264_parser.o
OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o
OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
OBJS-$(CONFIG_MLP_PARSER) += mlp_parser.o mlp.o
@@ -777,13 +782,15 @@ OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o \
mpegaudiodecheader.o mpegaudiodata.o
OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \
mpeg12.o mpeg12data.o
+OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus.o vorbis_data.o
+OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
OBJS-$(CONFIG_RV30_PARSER) += rv34_parser.o
OBJS-$(CONFIG_RV40_PARSER) += rv34_parser.o
OBJS-$(CONFIG_TAK_PARSER) += tak_parser.o tak.o
-OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \
+OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o vc1dsp.o \
msmpeg4.o msmpeg4data.o mpeg4video.o \
- h263.o
+ h263.o startcode.o
OBJS-$(CONFIG_VORBIS_PARSER) += vorbis_parser.o xiph.o
OBJS-$(CONFIG_VP3_PARSER) += vp3_parser.o
OBJS-$(CONFIG_VP8_PARSER) += vp8_parser.o
@@ -807,9 +814,7 @@ OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
# thread libraries
OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o
-OBJS-$(HAVE_PTHREADS) += pthread.o pthread_slice.o pthread_frame.o
-OBJS-$(HAVE_W32THREADS) += pthread.o pthread_slice.o pthread_frame.o
-OBJS-$(HAVE_OS2THREADS) += pthread.o pthread_slice.o pthread_frame.o
+OBJS-$(HAVE_THREADS) += pthread.o pthread_slice.o pthread_frame.o
OBJS-$(CONFIG_FRAME_THREAD_ENCODER) += frame_thread_encoder.o
@@ -827,9 +832,9 @@ SKIPHEADERS += %_tablegen.h \
SKIPHEADERS-$(CONFIG_DXVA2) += dxva2.h dxva2_internal.h
SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER) += libschroedinger.h
SKIPHEADERS-$(CONFIG_LIBUTVIDEO) += libutvideo.h
-SKIPHEADERS-$(CONFIG_MPEG_XVMC_DECODER) += xvmc.h
+SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_internal.h
-SKIPHEADERS-$(CONFIG_VDA) += vda.h
+SKIPHEADERS-$(CONFIG_VDA) += vda.h vda_internal.h
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h
TESTPROGS = cabac \
@@ -852,6 +857,7 @@ HOSTPROGS = aac_tablegen \
aacps_tablegen \
cbrt_tablegen \
cos_tablegen \
+ dsd_tablegen \
dv_tablegen \
motionpixels_tablegen \
mpegaudio_tablegen \
@@ -876,7 +882,7 @@ else
$(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=0
endif
-GEN_HEADERS = cbrt_tables.h aacps_tables.h aac_tables.h dv_tables.h \
+GEN_HEADERS = cbrt_tables.h aacps_tables.h aac_tables.h dsd_tables.h dv_tables.h \
sinewin_tables.h mpegaudio_tables.h motionpixels_tables.h \
pcm_tables.h qdm2_tables.h
GEN_HEADERS := $(addprefix $(SUBDIR), $(GEN_HEADERS))
@@ -888,6 +894,7 @@ ifdef CONFIG_HARDCODED_TABLES
$(SUBDIR)aacdec.o: $(SUBDIR)cbrt_tables.h
$(SUBDIR)aacps.o: $(SUBDIR)aacps_tables.h
$(SUBDIR)aactab.o: $(SUBDIR)aac_tables.h
+$(SUBDIR)dsddec.o: $(SUBDIR)dsd_tables.h
$(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h
$(SUBDIR)sinewin.o: $(SUBDIR)sinewin_tables.h
$(SUBDIR)mpegaudiodec_fixed.o: $(SUBDIR)mpegaudio_tables.h
diff --git a/chromium/third_party/ffmpeg/libavcodec/a64multienc.c b/chromium/third_party/ffmpeg/libavcodec/a64multienc.c
index 6dd5c2c2ad5..306777418d9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/a64multienc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/a64multienc.c
@@ -195,7 +195,7 @@ static av_cold int a64multi_close_encoder(AVCodecContext *avctx)
return 0;
}
-static av_cold int a64multi_init_encoder(AVCodecContext *avctx)
+static av_cold int a64multi_encode_init(AVCodecContext *avctx)
{
A64Context *c = avctx->priv_data;
int a;
@@ -220,9 +220,9 @@ static av_cold int a64multi_init_encoder(AVCodecContext *avctx)
a64_palette[mc_colors[a]][2] * 0.11;
}
- if (!(c->mc_meta_charset = av_malloc(32000 * c->mc_lifetime * sizeof(int))) ||
+ if (!(c->mc_meta_charset = av_malloc_array(c->mc_lifetime, 32000 * sizeof(int))) ||
!(c->mc_best_cb = av_malloc(CHARSET_CHARS * 32 * sizeof(int))) ||
- !(c->mc_charmap = av_mallocz(1000 * c->mc_lifetime * sizeof(int))) ||
+ !(c->mc_charmap = av_mallocz_array(c->mc_lifetime, 1000 * sizeof(int))) ||
!(c->mc_colram = av_mallocz(CHARSET_CHARS * sizeof(uint8_t))) ||
!(c->mc_charset = av_malloc(0x800 * (INTERLACED+1) * sizeof(uint8_t)))) {
av_log(avctx, AV_LOG_ERROR, "Failed to allocate buffer memory.\n");
@@ -402,7 +402,7 @@ AVCodec ff_a64multi_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_A64_MULTI,
.priv_data_size = sizeof(A64Context),
- .init = a64multi_init_encoder,
+ .init = a64multi_encode_init,
.encode2 = a64multi_encode_frame,
.close = a64multi_close_encoder,
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
@@ -416,7 +416,7 @@ AVCodec ff_a64multi5_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_A64_MULTI5,
.priv_data_size = sizeof(A64Context),
- .init = a64multi_init_encoder,
+ .init = a64multi_encode_init,
.encode2 = a64multi_encode_frame,
.close = a64multi_close_encoder,
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
diff --git a/chromium/third_party/ffmpeg/libavcodec/aac_adtstoasc_bsf.c b/chromium/third_party/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
index c8f9e0ae690..37ba5c17d2c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
@@ -87,6 +87,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
buf_size -= get_bits_count(&gb)/8;
buf += get_bits_count(&gb)/8;
}
+ av_free(avctx->extradata);
avctx->extradata_size = 2 + pce_size;
avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacadtsdec.c b/chromium/third_party/ffmpeg/libavcodec/aacadtsdec.c
index c9718c45998..d0814ac27e1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacadtsdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacadtsdec.c
@@ -31,7 +31,7 @@ int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
int size, rdb, ch, sr;
int aot, crc_abs;
- if(get_bits(gbc, 12) != 0xfff)
+ if (get_bits(gbc, 12) != 0xfff)
return AAC_AC3_PARSE_ERROR_SYNC;
skip_bits1(gbc); /* id */
@@ -39,10 +39,10 @@ int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
crc_abs = get_bits1(gbc); /* protection_absent */
aot = get_bits(gbc, 2); /* profile_objecttype */
sr = get_bits(gbc, 4); /* sample_frequency_index */
- if(!avpriv_mpeg4audio_sample_rates[sr])
+ if (!avpriv_mpeg4audio_sample_rates[sr])
return AAC_AC3_PARSE_ERROR_SAMPLE_RATE;
skip_bits1(gbc); /* private_bit */
- ch = get_bits(gbc, 3); /* channel_configuration */
+ ch = get_bits(gbc, 3); /* channel_configuration */
skip_bits1(gbc); /* original/copy */
skip_bits1(gbc); /* home */
@@ -50,8 +50,8 @@ int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
/* adts_variable_header */
skip_bits1(gbc); /* copyright_identification_bit */
skip_bits1(gbc); /* copyright_identification_start */
- size = get_bits(gbc, 13); /* aac_frame_length */
- if(size < AAC_ADTS_HEADER_SIZE)
+ size = get_bits(gbc, 13); /* aac_frame_length */
+ if (size < AAC_ADTS_HEADER_SIZE)
return AAC_AC3_PARSE_ERROR_FRAME_SIZE;
skip_bits(gbc, 11); /* adts_buffer_fullness */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacdec.c b/chromium/third_party/ffmpeg/libavcodec/aacdec.c
index 1fb91853d01..a8f76e73e11 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacdec.c
@@ -196,6 +196,9 @@ static int frame_configure_elements(AVCodecContext *avctx)
/* get output buffer */
av_frame_unref(ac->frame);
+ if (!avctx->channels)
+ return 1;
+
ac->frame->nb_samples = 2048;
if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0)
return ret;
@@ -534,6 +537,25 @@ static int set_default_channel_config(AVCodecContext *avctx,
*tags = tags_per_config[channel_config];
memcpy(layout_map, aac_channel_layout_map[channel_config - 1],
*tags * sizeof(*layout_map));
+
+ /*
+ * AAC specification has 7.1(wide) as a default layout for 8-channel streams.
+ * However, at least Nero AAC encoder encodes 7.1 streams using the default
+ * channel config 7, mapping the side channels of the original audio stream
+ * to the second AAC_CHANNEL_FRONT pair in the AAC stream. Similarly, e.g. FAAD
+ * decodes the second AAC_CHANNEL_FRONT pair as side channels, therefore decoding
+ * the incorrect streams as if they were correct (and as the encoder intended).
+ *
+ * As actual intended 7.1(wide) streams are very rare, default to assuming a
+ * 7.1 layout was intended.
+ */
+ if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) {
+ av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
+ " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
+ " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
+ layout_map[2][2] = AAC_CHANNEL_SIDE;
+ }
+
return 0;
}
@@ -1114,7 +1136,6 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
ff_mdct_init(&ac->mdct_ltp, 11, 0, -2.0 * 32768.0);
// window initialization
ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
- ff_kbd_window_init(ff_aac_kbd_long_512, 4.0, 512);
ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
ff_init_ff_sine_windows(10);
ff_init_ff_sine_windows( 9);
@@ -1227,13 +1248,14 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD) {
ics->swb_offset = ff_swb_offset_512[ac->oc[1].m4ac.sampling_index];
ics->num_swb = ff_aac_num_swb_512[ac->oc[1].m4ac.sampling_index];
+ ics->tns_max_bands = ff_tns_max_bands_512[ac->oc[1].m4ac.sampling_index];
if (!ics->num_swb || !ics->swb_offset)
return AVERROR_BUG;
} else {
ics->swb_offset = ff_swb_offset_1024[ac->oc[1].m4ac.sampling_index];
ics->num_swb = ff_aac_num_swb_1024[ac->oc[1].m4ac.sampling_index];
+ ics->tns_max_bands = ff_tns_max_bands_1024[ac->oc[1].m4ac.sampling_index];
}
- ics->tns_max_bands = ff_tns_max_bands_1024[ac->oc[1].m4ac.sampling_index];
if (aot != AOT_ER_AAC_ELD) {
ics->predictor_present = get_bits1(gb);
ics->predictor_reset_group = 0;
@@ -1404,12 +1426,12 @@ static int decode_pulses(Pulse *pulse, GetBitContext *gb,
return -1;
pulse->pos[0] = swb_offset[pulse_swb];
pulse->pos[0] += get_bits(gb, 5);
- if (pulse->pos[0] > 1023)
+ if (pulse->pos[0] >= swb_offset[num_swb])
return -1;
pulse->amp[0] = get_bits(gb, 4);
for (i = 1; i < pulse->num_pulse; i++) {
pulse->pos[i] = get_bits(gb, 5) + pulse->pos[i - 1];
- if (pulse->pos[i] > 1023)
+ if (pulse->pos[i] >= swb_offset[num_swb])
return -1;
pulse->amp[i] = get_bits(gb, 4);
}
@@ -2509,14 +2531,20 @@ static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce)
float *in = sce->coeffs;
float *out = sce->ret;
float *saved = sce->saved;
- const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_512 : ff_sine_512;
float *buf = ac->buf_mdct;
// imdct
ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
// window overlapping
- ac->fdsp.vector_fmul_window(out, saved, buf, lwindow_prev, 256);
+ if (ics->use_kb_window[1]) {
+ // AAC LD uses a low overlap sine window instead of a KBD window
+ memcpy(out, saved, 192 * sizeof(float));
+ ac->fdsp.vector_fmul_window(out + 192, saved + 192, buf, ff_sine_128, 64);
+ memcpy( out + 320, buf + 64, 192 * sizeof(float));
+ } else {
+ ac->fdsp.vector_fmul_window(out, saved, buf, ff_sine_512, 256);
+ }
// buffer update
memcpy(saved, buf + 256, 256 * sizeof(float));
@@ -2603,7 +2631,7 @@ static void apply_dependent_coupling(AACContext *ac,
const float gain = cce->coup.gain[index][idx];
for (group = 0; group < ics->group_len[g]; group++) {
for (k = offsets[i]; k < offsets[i + 1]; k++) {
- // XXX dsputil-ize
+ // FIXME: SIMDify
dest[group * 128 + k] += gain * src[group * 128 + k];
}
}
@@ -2844,6 +2872,7 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
spectral_to_sample(ac);
ac->frame->nb_samples = samples;
+ ac->frame->sample_rate = avctx->sample_rate;
*got_frame_ptr = 1;
skip_bits_long(gb, get_bits_left(gb));
@@ -2978,22 +3007,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0;
samples <<= multiplier;
- /* for dual-mono audio (SCE + SCE) */
- is_dmono = ac->dmono_mode && sce_count == 2 &&
- ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT);
-
- if (samples)
- ac->frame->nb_samples = samples;
- else
- av_frame_unref(ac->frame);
- *got_frame_ptr = !!samples;
-
- if (is_dmono) {
- if (ac->dmono_mode == 1)
- ((AVFrame *)data)->data[1] =((AVFrame *)data)->data[0];
- else if (ac->dmono_mode == 2)
- ((AVFrame *)data)->data[0] =((AVFrame *)data)->data[1];
- }
if (ac->oc[1].status && audio_found) {
avctx->sample_rate = ac->oc[1].m4ac.sample_rate << multiplier;
@@ -3007,6 +3020,25 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
if (side && side_size>=4)
AV_WL32(side, 2*AV_RL32(side));
}
+
+ *got_frame_ptr = !!samples;
+ if (samples) {
+ ac->frame->nb_samples = samples;
+ ac->frame->sample_rate = avctx->sample_rate;
+ } else
+ av_frame_unref(ac->frame);
+ *got_frame_ptr = !!samples;
+
+ /* for dual-mono audio (SCE + SCE) */
+ is_dmono = ac->dmono_mode && sce_count == 2 &&
+ ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT);
+ if (is_dmono) {
+ if (ac->dmono_mode == 1)
+ ((AVFrame *)data)->data[1] =((AVFrame *)data)->data[0];
+ else if (ac->dmono_mode == 2)
+ ((AVFrame *)data)->data[0] =((AVFrame *)data)->data[1];
+ }
+
return 0;
fail:
pop_output_configuration(ac);
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacps.c b/chromium/third_party/ffmpeg/libavcodec/aacps.c
index 9b7bdae584b..20012f9b31d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacps.c
@@ -432,6 +432,7 @@ static void hybrid_synthesis(PSDSPContext *dsp, float out[2][38][64],
#define DECAY_SLOPE 0.05f
/// Number of frequency bands that can be addressed by the parameter index, b(k)
static const int NR_PAR_BANDS[] = { 20, 34 };
+static const int NR_IPDOPD_BANDS[] = { 11, 17 };
/// Number of frequency bands that can be addressed by the sub subband index, k
static const int NR_BANDS[] = { 71, 91 };
/// Start frequency band for the all-pass filter decay slope
@@ -828,7 +829,7 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
h21 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][2];
h22 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][3];
- if (!PS_BASELINE && ps->enable_ipdopd && 2*b <= NR_PAR_BANDS[is34]) {
+ if (!PS_BASELINE && ps->enable_ipdopd && b < NR_IPDOPD_BANDS[is34]) {
//The spec say says to only run this smoother when enable_ipdopd
//is set but the reference decoder appears to run it constantly
float h11i, h12i, h21i, h22i;
diff --git a/chromium/third_party/ffmpeg/libavcodec/aactab.c b/chromium/third_party/ffmpeg/libavcodec/aactab.c
index 7ec83745359..eb882e89769 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aactab.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aactab.c
@@ -34,7 +34,6 @@
#include <stdint.h>
DECLARE_ALIGNED(32, float, ff_aac_kbd_long_1024)[1024];
-DECLARE_ALIGNED(32, float, ff_aac_kbd_long_512 )[512];
DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128];
const uint8_t ff_aac_num_swb_1024[] = {
@@ -1237,6 +1236,10 @@ const uint8_t ff_tns_max_bands_1024[] = {
31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39, 39
};
+const uint8_t ff_tns_max_bands_512[] = {
+ 0, 0, 0, 31, 32, 37, 31, 31, 0, 0, 0, 0, 0
+};
+
const uint8_t ff_tns_max_bands_128[] = {
9, 9, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/aactab.h b/chromium/third_party/ffmpeg/libavcodec/aactab.h
index 699d99d696c..5ed850888f5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aactab.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aactab.h
@@ -45,7 +45,6 @@
* @{
*/
DECLARE_ALIGNED(32, extern float, ff_aac_kbd_long_1024)[1024];
-DECLARE_ALIGNED(32, extern float, ff_aac_kbd_long_512 )[512];
DECLARE_ALIGNED(32, extern float, ff_aac_kbd_short_128)[128];
const DECLARE_ALIGNED(32, extern float, ff_aac_eld_window)[1920];
// @}
@@ -76,6 +75,7 @@ extern const uint16_t * const ff_swb_offset_512 [13];
extern const uint16_t * const ff_swb_offset_128 [13];
extern const uint8_t ff_tns_max_bands_1024[13];
+extern const uint8_t ff_tns_max_bands_512 [13];
extern const uint8_t ff_tns_max_bands_128 [13];
#endif /* AVCODEC_AACTAB_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/Makefile b/chromium/third_party/ffmpeg/libavcodec/aarch64/Makefile
new file mode 100644
index 00000000000..964428e35de
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/Makefile
@@ -0,0 +1,28 @@
+OBJS-$(CONFIG_FFT) += aarch64/fft_init_aarch64.o
+OBJS-$(CONFIG_H264CHROMA) += aarch64/h264chroma_init_aarch64.o
+OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_init_aarch64.o
+OBJS-$(CONFIG_H264QPEL) += aarch64/h264qpel_init_aarch64.o
+OBJS-$(CONFIG_HPELDSP) += aarch64/hpeldsp_init_aarch64.o
+OBJS-$(CONFIG_MPEGAUDIODSP) += aarch64/mpegaudiodsp_init.o
+OBJS-$(CONFIG_NEON_CLOBBER_TEST) += aarch64/neontest.o
+OBJS-$(CONFIG_VIDEODSP) += aarch64/videodsp_init.o
+
+OBJS-$(CONFIG_OPUS_DECODER) += aarch64/opus_imdct_init.o
+OBJS-$(CONFIG_RV40_DECODER) += aarch64/rv40dsp_init_aarch64.o
+OBJS-$(CONFIG_VC1_DECODER) += aarch64/vc1dsp_init_aarch64.o
+OBJS-$(CONFIG_VORBIS_DECODER) += aarch64/vorbisdsp_init.o
+
+ARMV8-OBJS-$(CONFIG_VIDEODSP) += aarch64/videodsp.o
+
+NEON-OBJS-$(CONFIG_FFT) += aarch64/fft_neon.o
+NEON-OBJS-$(CONFIG_H264CHROMA) += aarch64/h264cmc_neon.o
+NEON-OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_neon.o \
+ aarch64/h264idct_neon.o
+NEON-OBJS-$(CONFIG_H264QPEL) += aarch64/h264qpel_neon.o \
+ aarch64/hpeldsp_neon.o
+NEON-OBJS-$(CONFIG_HPELDSP) += aarch64/hpeldsp_neon.o
+NEON-OBJS-$(CONFIG_MPEGAUDIODSP) += aarch64/mpegaudiodsp_neon.o
+NEON-OBJS-$(CONFIG_MDCT) += aarch64/mdct_neon.o
+
+NEON-OBJS-$(CONFIG_OPUS_DECODER) += aarch64/opus_imdct_neon.o
+NEON-OBJS-$(CONFIG_VORBIS_DECODER) += aarch64/vorbisdsp_neon.o
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/asm-offsets.h b/chromium/third_party/ffmpeg/libavcodec/aarch64/asm-offsets.h
new file mode 100644
index 00000000000..8defd7c9eca
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/asm-offsets.h
@@ -0,0 +1,30 @@
+/*
+ * 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_AARCH64_ASM_OFFSETS_H
+#define AVCODEC_AARCH64_ASM_OFFSETS_H
+
+/* CeltIMDCTContext */
+#define CELT_EXPTAB 0x20
+#define CELT_FFT_N 0x00
+#define CELT_LEN2 0x04
+#define CELT_LEN4 (CELT_LEN2 + 0x4) // loaded as pair
+#define CELT_TMP 0x10
+#define CELT_TWIDDLE (CELT_TMP + 0x8) // loaded as pair
+
+#endif /* AVCODEC_AARCH64_ASM_OFFSETS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/cabac.h b/chromium/third_party/ffmpeg/libavcodec/aarch64/cabac.h
new file mode 100644
index 00000000000..6b9b77eb30b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/cabac.h
@@ -0,0 +1,104 @@
+/*
+ * 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_AARCH64_CABAC_H
+#define AVCODEC_AARCH64_CABAC_H
+
+#include "config.h"
+#if HAVE_INLINE_ASM
+
+#include "libavutil/attributes.h"
+#include "libavutil/internal.h"
+#include "libavcodec/cabac.h"
+
+#define get_cabac_inline get_cabac_inline_aarch64
+static av_always_inline int get_cabac_inline_aarch64(CABACContext *c,
+ uint8_t *const state)
+{
+ int bit;
+ void *reg_a, *reg_b, *reg_c, *tmp;
+
+ __asm__ volatile(
+ "ldrb %w[bit] , [%[state]] \n\t"
+ "add %[r_b] , %[tables] , %[lps_off] \n\t"
+ "mov %w[tmp] , %w[range] \n\t"
+ "and %w[range] , %w[range] , #0xC0 \n\t"
+ "lsl %w[r_c] , %w[range] , #1 \n\t"
+ "add %[r_b] , %[r_b] , %w[bit], UXTW \n\t"
+ "ldrb %w[range] , [%[r_b], %w[r_c], SXTW] \n\t"
+ "sub %w[r_c] , %w[tmp] , %w[range] \n\t"
+ "lsl %w[tmp] , %w[r_c] , #17 \n\t"
+ "cmp %w[tmp] , %w[low] \n\t"
+ "csel %w[tmp] , %w[tmp] , wzr , cc \n\t"
+ "csel %w[range] , %w[r_c] , %w[range], gt \n\t"
+ "cinv %w[bit] , %w[bit] , cc \n\t"
+ "sub %w[low] , %w[low] , %w[tmp] \n\t"
+ "add %[r_b] , %[tables] , %[norm_off] \n\t"
+ "add %[r_a] , %[tables] , %[mlps_off] \n\t"
+ "ldrb %w[tmp] , [%[r_b], %w[range], SXTW] \n\t"
+ "ldrb %w[r_a] , [%[r_a], %w[bit], SXTW] \n\t"
+ "lsl %w[low] , %w[low] , %w[tmp] \n\t"
+ "lsl %w[range] , %w[range] , %w[tmp] \n\t"
+ "uxth %w[r_c] , %w[low] \n\t"
+ "strb %w[r_a] , [%[state]] \n\t"
+ "cbnz %w[r_c] , 2f \n\t"
+ "ldr %[r_c] , [%[c], %[byte]] \n\t"
+ "ldr %[r_a] , [%[c], %[end]] \n\t"
+ "ldrh %w[tmp] , [%[r_c]] \n\t"
+ "cmp %[r_c] , %[r_a] \n\t"
+ "b.ge 1f \n\t"
+ "add %[r_a] , %[r_c] , #2 \n\t"
+ "str %[r_a] , [%[c], %[byte]] \n\t"
+ "1: \n\t"
+ "sub %w[r_c] , %w[low] , #1 \n\t"
+ "eor %w[r_c] , %w[r_c] , %w[low] \n\t"
+ "rev %w[tmp] , %w[tmp] \n\t"
+ "lsr %w[r_c] , %w[r_c] , #15 \n\t"
+ "lsr %w[tmp] , %w[tmp] , #15 \n\t"
+ "ldrb %w[r_c] , [%[r_b], %w[r_c], SXTW] \n\t"
+ "mov %w[r_b] , #0xFFFF \n\t"
+ "mov %w[r_a] , #7 \n\t"
+ "sub %w[tmp] , %w[tmp] , %w[r_b] \n\t"
+ "sub %w[r_c] , %w[r_a] , %w[r_c] \n\t"
+ "lsl %w[tmp] , %w[tmp] , %w[r_c] \n\t"
+ "add %w[low] , %w[low] , %w[tmp] \n\t"
+ "2: \n\t"
+ : [bit]"=&r"(bit),
+ [low]"+&r"(c->low),
+ [range]"+&r"(c->range),
+ [r_a]"=&r"(reg_a),
+ [r_b]"=&r"(reg_b),
+ [r_c]"=&r"(reg_c),
+ [tmp]"=&r"(tmp)
+ : [c]"r"(c),
+ [state]"r"(state),
+ [tables]"r"(ff_h264_cabac_tables),
+ [byte]"i"(offsetof(CABACContext, bytestream)),
+ [end]"i"(offsetof(CABACContext, bytestream_end)),
+ [norm_off]"I"(H264_NORM_SHIFT_OFFSET),
+ [lps_off]"I"(H264_LPS_RANGE_OFFSET),
+ [mlps_off]"I"(H264_MLPS_STATE_OFFSET + 128)
+ : "memory", "cc"
+ );
+
+ return bit & 1;
+}
+
+#endif /* HAVE_INLINE_ASM */
+
+#endif /* AVCODEC_AARCH64_CABAC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/fft_init_aarch64.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/fft_init_aarch64.c
new file mode 100644
index 00000000000..8514d3b07b4
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/fft_init_aarch64.c
@@ -0,0 +1,47 @@
+/*
+ * 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 "config.h"
+
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/fft.h"
+
+void ff_fft_permute_neon(FFTContext *s, FFTComplex *z);
+void ff_fft_calc_neon(FFTContext *s, FFTComplex *z);
+
+void ff_imdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
+void ff_imdct_half_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
+void ff_mdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
+
+av_cold void ff_fft_init_aarch64(FFTContext *s)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ s->fft_permute = ff_fft_permute_neon;
+ s->fft_calc = ff_fft_calc_neon;
+#if CONFIG_MDCT
+ s->imdct_calc = ff_imdct_calc_neon;
+ s->imdct_half = ff_imdct_half_neon;
+ s->mdct_calc = ff_mdct_calc_neon;
+ s->mdct_permutation = FF_MDCT_PERM_INTERLEAVE;
+#endif
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/fft_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/fft_neon.S
new file mode 100644
index 00000000000..70365d4f646
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/fft_neon.S
@@ -0,0 +1,442 @@
+/*
+ * ARM NEON optimised FFT
+ *
+ * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
+ * Copyright (c) 2009 Naotoshi Nojiri
+ * Copyright (c) 2014 Janne Grunau <janne-libav@jannau.net>
+ *
+ * This algorithm (though not any of the implementation details) is
+ * based on libdjbfft by D. J. Bernstein.
+ *
+ * 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 "libavutil/aarch64/asm.S"
+
+#define M_SQRT1_2 0.70710678118654752440
+
+.macro transpose d0, d1, s0, s1
+ trn1 \d0, \s0, \s1
+ trn2 \d1, \s0, \s1
+.endm
+
+
+function fft4_neon
+ ld1 {v0.2s,v1.2s,v2.2s,v3.2s}, [x0]
+
+ fadd v4.2s, v0.2s, v1.2s // r0+r1,i0+i1
+ fsub v6.2s, v0.2s, v1.2s // r0-r1,i0-i1
+
+ ext v16.8b, v2.8b, v3.8b, #4
+ ext v17.8b, v3.8b, v2.8b, #4
+
+ fadd v5.2s, v2.2s, v3.2s // i2+i3,r2+r3
+ fsub v7.2s, v16.2s, v17.2s // r3-r2,i2-i3
+
+ fadd v0.2s, v4.2s, v5.2s
+ fsub v2.2s, v4.2s, v5.2s
+ fadd v1.2s, v6.2s, v7.2s
+ fsub v3.2s, v6.2s, v7.2s
+
+ st1 {v0.2s,v1.2s,v2.2s,v3.2s}, [x0]
+
+ ret
+endfunc
+
+function fft8_neon
+ mov x1, x0
+ ld1 {v0.2s, v1.2s, v2.2s, v3.2s}, [x0], #32
+ ld1 {v16.2s,v17.2s,v18.2s,v19.2s}, [x0]
+ ext v22.8b, v2.8b, v3.8b, #4
+ ext v23.8b, v3.8b, v2.8b, #4
+ fadd v4.2s, v16.2s, v17.2s // r4+r5,i4+i5
+ fadd v5.2s, v18.2s, v19.2s // r6+r7,i6+i7
+ fsub v17.2s, v16.2s, v17.2s // r4-r5,i4-i5
+ fsub v19.2s, v18.2s, v19.2s // r6-r7,i6-i7
+ rev64 v27.2s, v28.2s // ???
+ fadd v20.2s, v0.2s, v1.2s // r0+r1,i0+i1
+ fadd v21.2s, v2.2s, v3.2s // r2+r3,i2+i3
+ fmul v26.2s, v17.2s, v28.2s // -a2r*w,a2i*w
+ ext v6.8b, v4.8b, v5.8b, #4
+ ext v7.8b, v5.8b, v4.8b, #4
+ fmul v27.2s, v19.2s, v27.2s // a3r*w,-a3i*w
+ fsub v23.2s, v22.2s, v23.2s // i2-i3,r3-r2
+ fsub v22.2s, v0.2s, v1.2s // r0-r1,i0-i1
+ fmul v24.2s, v17.2s, v28.s[1] // a2r*w,a2i*w
+ fmul v25.2s, v19.2s, v28.s[1] // a3r*w,a3i*w
+ fadd v0.2s, v20.2s, v21.2s
+ fsub v2.2s, v20.2s, v21.2s
+ fadd v1.2s, v22.2s, v23.2s
+ rev64 v26.2s, v26.2s
+ rev64 v27.2s, v27.2s
+ fsub v3.2s, v22.2s, v23.2s
+ fsub v6.2s, v6.2s, v7.2s
+ fadd v24.2s, v24.2s, v26.2s // a2r+a2i,a2i-a2r t1,t2
+ fadd v25.2s, v25.2s, v27.2s // a3r-a3i,a3i+a3r t5,t6
+ fadd v7.2s, v4.2s, v5.2s
+ fsub v18.2s, v2.2s, v6.2s
+ ext v26.8b, v24.8b, v25.8b, #4
+ ext v27.8b, v25.8b, v24.8b, #4
+ fadd v2.2s, v2.2s, v6.2s
+ fsub v16.2s, v0.2s, v7.2s
+ fadd v5.2s, v25.2s, v24.2s
+ fsub v4.2s, v26.2s, v27.2s
+ fadd v0.2s, v0.2s, v7.2s
+ fsub v17.2s, v1.2s, v5.2s
+ fsub v19.2s, v3.2s, v4.2s
+ fadd v3.2s, v3.2s, v4.2s
+ fadd v1.2s, v1.2s, v5.2s
+
+ st1 {v16.2s,v17.2s,v18.2s,v19.2s}, [x0]
+ st1 {v0.2s, v1.2s, v2.2s, v3.2s}, [x1]
+
+ ret
+endfunc
+
+function fft16_neon
+ mov x1, x0
+ ld1 {v0.2s, v1.2s, v2.2s, v3.2s}, [x0], #32
+ ld1 {v16.2s,v17.2s,v18.2s,v19.2s}, [x0], #32
+ ext v22.8b, v2.8b, v3.8b, #4
+ ext v23.8b, v3.8b, v2.8b, #4
+ fadd v4.2s, v16.2s, v17.2s // r4+r5,i4+i5
+ fadd v5.2s, v18.2s, v19.2s // r6+r7,i6+i7
+ fsub v17.2s, v16.2s, v17.2s // r4-r5,i4-i5
+ fsub v19.2s, v18.2s, v19.2s // r6-r7,i6-i7
+ rev64 v27.2s, v28.2s // ???
+ fadd v20.2s, v0.2s, v1.2s // r0+r1,i0+i1
+ fadd v21.2s, v2.2s, v3.2s // r2+r3,i2+i3
+ fmul v26.2s, v17.2s, v28.2s // -a2r*w,a2i*w
+ ext v6.8b, v4.8b, v5.8b, #4
+ ext v7.8b, v5.8b, v4.8b, #4
+ fmul v27.2s, v19.2s, v27.2s // a3r*w,-a3i*w
+ fsub v23.2s, v22.2s, v23.2s // i2-i3,r3-r2
+ fsub v22.2s, v0.2s, v1.2s // r0-r1,i0-i1
+ fmul v24.2s, v17.2s, v28.s[1] // a2r*w,a2i*w
+ fmul v25.2s, v19.2s, v28.s[1] // a3r*w,a3i*w
+ fadd v0.2s, v20.2s, v21.2s
+ fsub v2.2s, v20.2s, v21.2s
+ fadd v1.2s, v22.2s, v23.2s
+ rev64 v26.2s, v26.2s
+ rev64 v27.2s, v27.2s
+ fsub v3.2s, v22.2s, v23.2s
+ fsub v6.2s, v6.2s, v7.2s
+ fadd v24.2s, v24.2s, v26.2s // a2r+a2i,a2i-a2r t1,t2
+ fadd v25.2s, v25.2s, v27.2s // a3r-a3i,a3i+a3r t5,t6
+ fadd v7.2s, v4.2s, v5.2s
+ fsub v18.2s, v2.2s, v6.2s
+ ld1 {v20.4s,v21.4s}, [x0], #32
+ ld1 {v22.4s,v23.4s}, [x0], #32
+ ext v26.8b, v24.8b, v25.8b, #4
+ ext v27.8b, v25.8b, v24.8b, #4
+ fadd v2.2s, v2.2s, v6.2s
+ fsub v16.2s, v0.2s, v7.2s
+ fadd v5.2s, v25.2s, v24.2s
+ fsub v4.2s, v26.2s, v27.2s
+ transpose v24.2d, v25.2d, v20.2d, v22.2d
+ transpose v26.2d, v27.2d, v21.2d, v23.2d
+ fadd v0.2s, v0.2s, v7.2s
+ fsub v17.2s, v1.2s, v5.2s
+ fsub v19.2s, v3.2s, v4.2s
+ fadd v3.2s, v3.2s, v4.2s
+ fadd v1.2s, v1.2s, v5.2s
+ ext v20.16b, v21.16b, v21.16b, #4
+ ext v21.16b, v23.16b, v23.16b, #4
+
+ zip1 v0.2d, v0.2d, v1.2d // {z[0], z[1]}
+ zip1 v1.2d, v2.2d, v3.2d // {z[2], z[3]}
+ zip1 v2.2d, v16.2d, v17.2d // {z[o1], z[o1+1]}
+ zip1 v3.2d, v18.2d, v19.2d // {z[o1+2],z[o1+3]}
+
+ // 2 x fft4
+ transpose v22.2d, v23.2d, v20.2d, v21.2d
+
+ fadd v4.4s, v24.4s, v25.4s
+ fadd v5.4s, v26.4s, v27.4s
+ fsub v6.4s, v24.4s, v25.4s
+ fsub v7.4s, v22.4s, v23.4s
+
+ ld1 {v23.4s}, [x14]
+
+ fadd v24.4s, v4.4s, v5.4s // {z[o2+0],z[o2+1]}
+ fsub v26.4s, v4.4s, v5.4s // {z[o2+2],z[o2+3]}
+ fadd v25.4s, v6.4s, v7.4s // {z[o3+0],z[o3+1]}
+ fsub v27.4s, v6.4s, v7.4s // {z[o3+2],z[o3+3]}
+
+ //fft_pass_neon_16
+ rev64 v7.4s, v25.4s
+ fmul v25.4s, v25.4s, v23.s[1]
+ fmul v7.4s, v7.4s, v29.4s
+ fmla v25.4s, v7.4s, v23.s[3] // {t1a,t2a,t5a,t6a}
+
+ zip1 v20.4s, v24.4s, v25.4s
+ zip2 v21.4s, v24.4s, v25.4s
+ fneg v22.4s, v20.4s
+ fadd v4.4s, v21.4s, v20.4s
+ fsub v6.4s, v20.4s, v21.4s // just the second half
+ fadd v5.4s, v21.4s, v22.4s // just the first half
+
+ tbl v4.16b, {v4.16b}, v30.16b // trans4_float
+ tbl v5.16b, {v5.16b,v6.16b}, v31.16b // trans8_float
+
+ fsub v20.4s, v0.4s, v4.4s // {z[o2],z[o2+1]}
+ fadd v16.4s, v0.4s, v4.4s // {z[0], z[1]}
+ fsub v22.4s, v2.4s, v5.4s // {z[o3],z[o3+1]}
+ fadd v18.4s, v2.4s, v5.4s // {z[o1],z[o1+1]}
+
+//second half
+ rev64 v6.4s, v26.4s
+ fmul v26.4s, v26.4s, v23.s[2]
+ rev64 v7.4s, v27.4s
+ fmul v27.4s, v27.4s, v23.s[3]
+ fmul v6.4s, v6.4s, v29.4s
+ fmul v7.4s, v7.4s, v29.4s
+ fmla v26.4s, v6.4s, v23.s[2] // {t1,t2,t5,t6}
+ fmla v27.4s, v7.4s, v23.s[1] // {t1a,t2a,t5a,t6a}
+
+ zip1 v24.4s, v26.4s, v27.4s
+ zip2 v25.4s, v26.4s, v27.4s
+ fneg v26.4s, v24.4s
+ fadd v4.4s, v25.4s, v24.4s
+ fsub v6.4s, v24.4s, v25.4s // just the second half
+ fadd v5.4s, v25.4s, v26.4s // just the first half
+
+ tbl v4.16b, {v4.16b}, v30.16b // trans4_float
+ tbl v5.16b, {v5.16b,v6.16b}, v31.16b // trans8_float
+
+ fadd v17.4s, v1.4s, v4.4s // {z[2], z[3]}
+ fsub v21.4s, v1.4s, v4.4s // {z[o2+2],z[o2+3]}
+ fadd v19.4s, v3.4s, v5.4s // {z[o1+2],z[o1+3]}
+ fsub v23.4s, v3.4s, v5.4s // {z[o3+2],z[o3+3]}
+
+ st1 {v16.4s,v17.4s}, [x1], #32
+ st1 {v18.4s,v19.4s}, [x1], #32
+ st1 {v20.4s,v21.4s}, [x1], #32
+ st1 {v22.4s,v23.4s}, [x1], #32
+
+ ret
+endfunc
+
+
+const trans4_float, align=4
+ .byte 0, 1, 2, 3
+ .byte 8, 9, 10, 11
+ .byte 4, 5, 6, 7
+ .byte 12, 13, 14, 15
+endconst
+
+const trans8_float, align=4
+ .byte 24, 25, 26, 27
+ .byte 0, 1, 2, 3
+ .byte 28, 29, 30, 31
+ .byte 4, 5, 6, 7
+endconst
+
+function fft_pass_neon
+ sub x6, x2, #1 // n - 1, loop counter
+ lsl x5, x2, #3 // 2 * n * sizeof FFTSample
+ lsl x1, x2, #4 // 2 * n * sizeof FFTComplex
+ add x5, x4, x5 // wim
+ add x3, x1, x2, lsl #5 // 4 * n * sizeof FFTComplex
+ add x2, x0, x2, lsl #5 // &z[o2]
+ add x3, x0, x3 // &z[o3]
+ add x1, x0, x1 // &z[o1]
+ ld1 {v20.4s},[x2] // {z[o2],z[o2+1]}
+ ld1 {v22.4s},[x3] // {z[o3],z[o3+1]}
+ ld1 {v4.2s}, [x4], #8 // {wre[0],wre[1]}
+ trn2 v25.2d, v20.2d, v22.2d
+ sub x5, x5, #4 // wim--
+ trn1 v24.2d, v20.2d, v22.2d
+ ld1 {v5.s}[0], [x5], x7 // d5[0] = wim[-1]
+ rev64 v7.4s, v25.4s
+ fmul v25.4s, v25.4s, v4.s[1]
+ ld1 {v16.4s}, [x0] // {z[0],z[1]}
+ fmul v7.4s, v7.4s, v29.4s
+ ld1 {v17.4s}, [x1] // {z[o1],z[o1+1]}
+ prfm pldl1keep, [x2, #16]
+ prfm pldl1keep, [x3, #16]
+ fmla v25.4s, v7.4s, v5.s[0] // {t1a,t2a,t5a,t6a}
+ prfm pldl1keep, [x0, #16]
+ prfm pldl1keep, [x1, #16]
+
+ zip1 v20.4s, v24.4s, v25.4s
+ zip2 v21.4s, v24.4s, v25.4s
+ fneg v22.4s, v20.4s
+ fadd v4.4s, v21.4s, v20.4s
+ fsub v6.4s, v20.4s, v21.4s // just the second half
+ fadd v5.4s, v21.4s, v22.4s // just the first half
+
+ tbl v4.16b, {v4.16b}, v30.16b // trans4_float
+ tbl v5.16b, {v5.16b,v6.16b}, v31.16b // trans8_float
+
+ fadd v20.4s, v16.4s, v4.4s
+ fsub v22.4s, v16.4s, v4.4s
+ fadd v21.4s, v17.4s, v5.4s
+ st1 {v20.4s}, [x0], #16 // {z[0], z[1]}
+ fsub v23.4s, v17.4s, v5.4s
+
+ st1 {v21.4s}, [x1], #16 // {z[o1],z[o1+1]}
+ st1 {v22.4s}, [x2], #16 // {z[o2],z[o2+1]}
+ st1 {v23.4s}, [x3], #16 // {z[o3],z[o3+1]}
+1:
+ ld1 {v20.4s},[x2] // {z[o2],z[o2+1]}
+ ld1 {v22.4s},[x3] // {z[o3],z[o3+1]}
+ ld1 {v4.2s}, [x4], #8 // {wre[0],wre[1]}
+ transpose v26.2d, v27.2d, v20.2d, v22.2d
+ ld1 {v5.2s}, [x5], x7 // {wim[-1],wim[0]}
+ rev64 v6.4s, v26.4s
+ fmul v26.4s, v26.4s, v4.s[0]
+ rev64 v7.4s, v27.4s
+ fmul v27.4s, v27.4s, v4.s[1]
+ fmul v6.4s, v6.4s, v29.4s
+ fmul v7.4s, v7.4s, v29.4s
+ ld1 {v16.4s},[x0] // {z[0],z[1]}
+ fmla v26.4s, v6.4s, v5.s[1] // {t1,t2,t5,t6}
+ fmla v27.4s, v7.4s, v5.s[0] // {t1a,t2a,t5a,t6a}
+ ld1 {v17.4s},[x1] // {z[o1],z[o1+1]}
+
+ subs x6, x6, #1 // n--
+
+ zip1 v20.4s, v26.4s, v27.4s
+ zip2 v21.4s, v26.4s, v27.4s
+ fneg v22.4s, v20.4s
+ fadd v4.4s, v21.4s, v20.4s
+ fsub v6.4s, v20.4s, v21.4s // just the second half
+ fadd v5.4s, v21.4s, v22.4s // just the first half
+
+ tbl v4.16b, {v4.16b}, v30.16b // trans4_float
+ tbl v5.16b, {v5.16b,v6.16b}, v31.16b // trans8_float
+
+ fadd v20.4s, v16.4s, v4.4s
+ fsub v22.4s, v16.4s, v4.4s
+ fadd v21.4s, v17.4s, v5.4s
+ st1 {v20.4s}, [x0], #16 // {z[0], z[1]}
+ fsub v23.4s, v17.4s, v5.4s
+
+ st1 {v21.4s}, [x1], #16 // {z[o1],z[o1+1]}
+ st1 {v22.4s}, [x2], #16 // {z[o2],z[o2+1]}
+ st1 {v23.4s}, [x3], #16 // {z[o3],z[o3+1]}
+ b.ne 1b
+
+ ret
+endfunc
+
+.macro def_fft n, n2, n4
+function fft\n\()_neon align=6
+ sub sp, sp, #16
+ stp x28, x30, [sp]
+ add x28, x0, #\n4*2*8
+ bl fft\n2\()_neon
+ mov x0, x28
+ bl fft\n4\()_neon
+ add x0, x28, #\n4*1*8
+ bl fft\n4\()_neon
+ sub x0, x28, #\n4*2*8
+ ldp x28, x30, [sp], #16
+ movrel x4, X(ff_cos_\n)
+ mov x2, #\n4>>1
+ b fft_pass_neon
+endfunc
+.endm
+
+ def_fft 32, 16, 8
+ def_fft 64, 32, 16
+ def_fft 128, 64, 32
+ def_fft 256, 128, 64
+ def_fft 512, 256, 128
+ def_fft 1024, 512, 256
+ def_fft 2048, 1024, 512
+ def_fft 4096, 2048, 1024
+ def_fft 8192, 4096, 2048
+ def_fft 16384, 8192, 4096
+ def_fft 32768, 16384, 8192
+ def_fft 65536, 32768, 16384
+
+function ff_fft_calc_neon, export=1
+ prfm pldl1keep, [x1]
+ movrel x10, trans4_float
+ ldr w2, [x0]
+ movrel x11, trans8_float
+ sub w2, w2, #2
+ movrel x3, fft_tab_neon
+ ld1 {v30.16b}, [x10]
+ mov x7, #-8
+ movrel x12, pmmp
+ ldr x3, [x3, x2, lsl #3]
+ movrel x13, mppm
+ movrel x14, X(ff_cos_16)
+ ld1 {v31.16b}, [x11]
+ mov x0, x1
+ ld1 {v29.4s}, [x12] // pmmp
+ ld1 {v28.4s}, [x13]
+ br x3
+endfunc
+
+function ff_fft_permute_neon, export=1
+ mov x6, #1
+ ldr w2, [x0] // nbits
+ ldr x3, [x0, #16] // tmp_buf
+ ldr x0, [x0, #8] // revtab
+ lsl x6, x6, x2
+ mov x2, x6
+1:
+ ld1 {v0.2s,v1.2s}, [x1], #16
+ ldr w4, [x0], #4
+ uxth w5, w4
+ lsr w4, w4, #16
+ add x5, x3, x5, lsl #3
+ add x4, x3, x4, lsl #3
+ st1 {v0.2s}, [x5]
+ st1 {v1.2s}, [x4]
+ subs x6, x6, #2
+ b.gt 1b
+
+ sub x1, x1, x2, lsl #3
+1:
+ ld1 {v0.4s,v1.4s}, [x3], #32
+ st1 {v0.4s,v1.4s}, [x1], #32
+ subs x2, x2, #4
+ b.gt 1b
+
+ ret
+endfunc
+
+const fft_tab_neon
+ .quad fft4_neon
+ .quad fft8_neon
+ .quad fft16_neon
+ .quad fft32_neon
+ .quad fft64_neon
+ .quad fft128_neon
+ .quad fft256_neon
+ .quad fft512_neon
+ .quad fft1024_neon
+ .quad fft2048_neon
+ .quad fft4096_neon
+ .quad fft8192_neon
+ .quad fft16384_neon
+ .quad fft32768_neon
+ .quad fft65536_neon
+endconst
+
+const pmmp, align=4
+ .float +1.0, -1.0, -1.0, +1.0
+endconst
+
+const mppm, align=4
+ .float -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2
+endconst
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/h264chroma_init_aarch64.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264chroma_init_aarch64.c
new file mode 100644
index 00000000000..2af62becf7c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264chroma_init_aarch64.c
@@ -0,0 +1,59 @@
+/*
+ * ARM NEON optimised H.264 chroma functions
+ * Copyright (c) 2008 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 "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/h264chroma.h"
+
+#include "config.h"
+
+void ff_put_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride,
+ int h, int x, int y);
+void ff_put_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride,
+ int h, int x, int y);
+void ff_put_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, int stride,
+ int h, int x, int y);
+
+void ff_avg_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride,
+ int h, int x, int y);
+void ff_avg_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride,
+ int h, int x, int y);
+void ff_avg_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, int stride,
+ int h, int x, int y);
+
+av_cold void ff_h264chroma_init_aarch64(H264ChromaContext *c, int bit_depth)
+{
+ const int high_bit_depth = bit_depth > 8;
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags) && !high_bit_depth) {
+ 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;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/h264cmc_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264cmc_neon.S
new file mode 100644
index 00000000000..a6ed877f2d6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264cmc_neon.S
@@ -0,0 +1,402 @@
+/*
+ * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
+ * Copyright (c) 2013 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "libavutil/aarch64/asm.S"
+
+/* chroma_mc8(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y) */
+.macro h264_chroma_mc8 type, codec=h264
+function ff_\type\()_\codec\()_chroma_mc8_neon, export=1
+ sxtw x2, w2
+ .ifc \type,avg
+ mov x8, x0
+ .endif
+ prfm pldl1strm, [x1]
+ prfm pldl1strm, [x1, x2]
+ .ifc \codec,rv40
+ movrel x6, rv40bias
+ lsr w9, w5, #1
+ lsr w10, w4, #1
+ lsl w9, w9, #3
+ lsl w10, w10, #1
+ add w9, w9, w10
+ add x6, x6, w9, UXTW
+ ld1r {v22.8H}, [x6]
+ .endif
+ .ifc \codec,vc1
+ movi v22.8H, #28
+ .endif
+ mul w7, w4, w5
+ lsl w14, w5, #3
+ lsl w13, w4, #3
+ cmp w7, #0
+ sub w6, w14, w7
+ sub w12, w13, w7
+ sub w4, w7, w13
+ sub w4, w4, w14
+ add w4, w4, #64
+ b.eq 2f
+
+ dup v0.8B, w4
+ dup v1.8B, w12
+ ld1 {v4.8B, v5.8B}, [x1], x2
+ dup v2.8B, w6
+ dup v3.8B, w7
+ ext v5.8B, v4.8B, v5.8B, #1
+1: ld1 {v6.8B, v7.8B}, [x1], x2
+ umull v16.8H, v4.8B, v0.8B
+ umlal v16.8H, v5.8B, v1.8B
+ ext v7.8B, v6.8B, v7.8B, #1
+ ld1 {v4.8B, v5.8B}, [x1], x2
+ umlal v16.8H, v6.8B, v2.8B
+ prfm pldl1strm, [x1]
+ ext v5.8B, v4.8B, v5.8B, #1
+ umlal v16.8H, v7.8B, v3.8B
+ umull v17.8H, v6.8B, v0.8B
+ subs w3, w3, #2
+ umlal v17.8H, v7.8B, v1.8B
+ umlal v17.8H, v4.8B, v2.8B
+ umlal v17.8H, v5.8B, v3.8B
+ prfm pldl1strm, [x1, x2]
+ .ifc \codec,h264
+ rshrn v16.8B, v16.8H, #6
+ rshrn v17.8B, v17.8H, #6
+ .else
+ add v16.8H, v16.8H, v22.8H
+ add v17.8H, v17.8H, v22.8H
+ shrn v16.8B, v16.8H, #6
+ shrn v17.8B, v17.8H, #6
+ .endif
+ .ifc \type,avg
+ ld1 {v20.8B}, [x8], x2
+ ld1 {v21.8B}, [x8], x2
+ urhadd v16.8B, v16.8B, v20.8B
+ urhadd v17.8B, v17.8B, v21.8B
+ .endif
+ st1 {v16.8B}, [x0], x2
+ st1 {v17.8B}, [x0], x2
+ b.gt 1b
+ ret
+
+2: tst w6, w6
+ add w12, w12, w6
+ dup v0.8B, w4
+ dup v1.8B, w12
+ b.eq 4f
+
+ ld1 {v4.8B}, [x1], x2
+3: ld1 {v6.8B}, [x1], x2
+ umull v16.8H, v4.8B, v0.8B
+ umlal v16.8H, v6.8B, v1.8B
+ ld1 {v4.8B}, [x1], x2
+ umull v17.8H, v6.8B, v0.8B
+ umlal v17.8H, v4.8B, v1.8B
+ prfm pldl1strm, [x1]
+ .ifc \codec,h264
+ rshrn v16.8B, v16.8H, #6
+ rshrn v17.8B, v17.8H, #6
+ .else
+ add v16.8H, v16.8H, v22.8H
+ add v17.8H, v17.8H, v22.8H
+ shrn v16.8B, v16.8H, #6
+ shrn v17.8B, v17.8H, #6
+ .endif
+ prfm pldl1strm, [x1, x2]
+ .ifc \type,avg
+ ld1 {v20.8B}, [x8], x2
+ ld1 {v21.8B}, [x8], x2
+ urhadd v16.8B, v16.8B, v20.8B
+ urhadd v17.8B, v17.8B, v21.8B
+ .endif
+ subs w3, w3, #2
+ st1 {v16.8B}, [x0], x2
+ st1 {v17.8B}, [x0], x2
+ b.gt 3b
+ ret
+
+4: ld1 {v4.8B, v5.8B}, [x1], x2
+ ld1 {v6.8B, v7.8B}, [x1], x2
+ ext v5.8B, v4.8B, v5.8B, #1
+ ext v7.8B, v6.8B, v7.8B, #1
+ prfm pldl1strm, [x1]
+ subs w3, w3, #2
+ umull v16.8H, v4.8B, v0.8B
+ umlal v16.8H, v5.8B, v1.8B
+ umull v17.8H, v6.8B, v0.8B
+ umlal v17.8H, v7.8B, v1.8B
+ prfm pldl1strm, [x1, x2]
+ .ifc \codec,h264
+ rshrn v16.8B, v16.8H, #6
+ rshrn v17.8B, v17.8H, #6
+ .else
+ add v16.8H, v16.8H, v22.8H
+ add v17.8H, v17.8H, v22.8H
+ shrn v16.8B, v16.8H, #6
+ shrn v17.8B, v17.8H, #6
+ .endif
+ .ifc \type,avg
+ ld1 {v20.8B}, [x8], x2
+ ld1 {v21.8B}, [x8], x2
+ urhadd v16.8B, v16.8B, v20.8B
+ urhadd v17.8B, v17.8B, v21.8B
+ .endif
+ st1 {v16.8B}, [x0], x2
+ st1 {v17.8B}, [x0], x2
+ b.gt 4b
+ ret
+endfunc
+.endm
+
+/* chroma_mc4(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y) */
+.macro h264_chroma_mc4 type, codec=h264
+function ff_\type\()_\codec\()_chroma_mc4_neon, export=1
+ sxtw x2, w2
+ .ifc \type,avg
+ mov x8, x0
+ .endif
+ prfm pldl1strm, [x1]
+ prfm pldl1strm, [x1, x2]
+ .ifc \codec,rv40
+ movrel x6, rv40bias
+ lsr w9, w5, #1
+ lsr w10, w4, #1
+ lsl w9, w9, #3
+ lsl w10, w10, #1
+ add w9, w9, w10
+ add x6, x6, w9, UXTW
+ ld1r {v22.8H}, [x6]
+ .endif
+ .ifc \codec,vc1
+ movi v22.8H, #28
+ .endif
+ mul w7, w4, w5
+ lsl w14, w5, #3
+ lsl w13, w4, #3
+ cmp w7, #0
+ sub w6, w14, w7
+ sub w12, w13, w7
+ sub w4, w7, w13
+ sub w4, w4, w14
+ add w4, w4, #64
+ b.eq 2f
+
+ dup v24.8B, w4
+ dup v25.8B, w12
+ ld1 {v4.8B}, [x1], x2
+ dup v26.8B, w6
+ dup v27.8B, w7
+ ext v5.8B, v4.8B, v5.8B, #1
+ trn1 v0.2S, v24.2S, v25.2S
+ trn1 v2.2S, v26.2S, v27.2S
+ trn1 v4.2S, v4.2S, v5.2S
+1: ld1 {v6.8B}, [x1], x2
+ ext v7.8B, v6.8B, v7.8B, #1
+ trn1 v6.2S, v6.2S, v7.2S
+ umull v18.8H, v4.8B, v0.8B
+ umlal v18.8H, v6.8B, v2.8B
+ ld1 {v4.8B}, [x1], x2
+ ext v5.8B, v4.8B, v5.8B, #1
+ trn1 v4.2S, v4.2S, v5.2S
+ prfm pldl1strm, [x1]
+ umull v19.8H, v6.8B, v0.8B
+ umlal v19.8H, v4.8B, v2.8B
+ trn1 v30.2D, v18.2D, v19.2D
+ trn2 v31.2D, v18.2D, v19.2D
+ add v18.8H, v30.8H, v31.8H
+ .ifc \codec,h264
+ rshrn v16.8B, v18.8H, #6
+ .else
+ add v18.8H, v18.8H, v22.8H
+ shrn v16.8B, v18.8H, #6
+ .endif
+ subs w3, w3, #2
+ prfm pldl1strm, [x1, x2]
+ .ifc \type,avg
+ ld1 {v20.S}[0], [x8], x2
+ ld1 {v20.S}[1], [x8], x2
+ urhadd v16.8B, v16.8B, v20.8B
+ .endif
+ st1 {v16.S}[0], [x0], x2
+ st1 {v16.S}[1], [x0], x2
+ b.gt 1b
+ ret
+
+2: tst w6, w6
+ add w12, w12, w6
+ dup v30.8B, w4
+ dup v31.8B, w12
+ trn1 v0.2S, v30.2S, v31.2S
+ trn2 v1.2S, v30.2S, v31.2S
+ b.eq 4f
+
+ ext v1.8B, v0.8B, v1.8B, #4
+ ld1 {v4.S}[0], [x1], x2
+3: ld1 {v4.S}[1], [x1], x2
+ umull v18.8H, v4.8B, v0.8B
+ ld1 {v4.S}[0], [x1], x2
+ umull v19.8H, v4.8B, v1.8B
+ trn1 v30.2D, v18.2D, v19.2D
+ trn2 v31.2D, v18.2D, v19.2D
+ add v18.8H, v30.8H, v31.8H
+ prfm pldl1strm, [x1]
+ .ifc \codec,h264
+ rshrn v16.8B, v18.8H, #6
+ .else
+ add v18.8H, v18.8H, v22.8H
+ shrn v16.8B, v18.8H, #6
+ .endif
+ .ifc \type,avg
+ ld1 {v20.S}[0], [x8], x2
+ ld1 {v20.S}[1], [x8], x2
+ urhadd v16.8B, v16.8B, v20.8B
+ .endif
+ subs w3, w3, #2
+ prfm pldl1strm, [x1, x2]
+ st1 {v16.S}[0], [x0], x2
+ st1 {v16.S}[1], [x0], x2
+ b.gt 3b
+ ret
+
+4: ld1 {v4.8B}, [x1], x2
+ ld1 {v6.8B}, [x1], x2
+ ext v5.8B, v4.8B, v5.8B, #1
+ ext v7.8B, v6.8B, v7.8B, #1
+ trn1 v4.2S, v4.2S, v5.2S
+ trn1 v6.2S, v6.2S, v7.2S
+ umull v18.8H, v4.8B, v0.8B
+ umull v19.8H, v6.8B, v0.8B
+ subs w3, w3, #2
+ trn1 v30.2D, v18.2D, v19.2D
+ trn2 v31.2D, v18.2D, v19.2D
+ add v18.8H, v30.8H, v31.8H
+ prfm pldl1strm, [x1]
+ .ifc \codec,h264
+ rshrn v16.8B, v18.8H, #6
+ .else
+ add v18.8H, v18.8H, v22.8H
+ shrn v16.8B, v18.8H, #6
+ .endif
+ .ifc \type,avg
+ ld1 {v20.S}[0], [x8], x2
+ ld1 {v20.S}[1], [x8], x2
+ urhadd v16.8B, v16.8B, v20.8B
+ .endif
+ prfm pldl1strm, [x1]
+ st1 {v16.S}[0], [x0], x2
+ st1 {v16.S}[1], [x0], x2
+ b.gt 4b
+ ret
+endfunc
+.endm
+
+.macro h264_chroma_mc2 type
+function ff_\type\()_h264_chroma_mc2_neon, export=1
+ sxtw x2, w2
+ prfm pldl1strm, [x1]
+ prfm pldl1strm, [x1, x2]
+ orr w7, w4, w5
+ cbz w7, 2f
+
+ mul w7, w4, w5
+ lsl w14, w5, #3
+ lsl w13, w4, #3
+ sub w6, w14, w7
+ sub w12, w13, w7
+ sub w4, w7, w13
+ sub w4, w4, w14
+ add w4, w4, #64
+ dup v0.8B, w4
+ dup v2.8B, w12
+ dup v1.8B, w6
+ dup v3.8B, w7
+ trn1 v0.4H, v0.4H, v2.4H
+ trn1 v1.4H, v1.4H, v3.4H
+1:
+ ld1 {v4.S}[0], [x1], x2
+ ld1 {v4.S}[1], [x1], x2
+ rev64 v5.2S, v4.2S
+ ld1 {v5.S}[1], [x1]
+ ext v6.8B, v4.8B, v5.8B, #1
+ ext v7.8B, v5.8B, v4.8B, #1
+ trn1 v4.4H, v4.4H, v6.4H
+ trn1 v5.4H, v5.4H, v7.4H
+ umull v16.8H, v4.8B, v0.8B
+ umlal v16.8H, v5.8B, v1.8B
+ .ifc \type,avg
+ ld1 {v18.H}[0], [x0], x2
+ ld1 {v18.H}[2], [x0]
+ sub x0, x0, x2
+ .endif
+ rev64 v17.4S, v16.4S
+ add v16.8H, v16.8H, v17.8H
+ rshrn v16.8B, v16.8H, #6
+ .ifc \type,avg
+ urhadd v16.8B, v16.8B, v18.8B
+ .endif
+ st1 {v16.H}[0], [x0], x2
+ st1 {v16.H}[2], [x0], x2
+ subs w3, w3, #2
+ b.gt 1b
+ ret
+
+2:
+ ld1 {v16.H}[0], [x1], x2
+ ld1 {v16.H}[1], [x1], x2
+ .ifc \type,avg
+ ld1 {v18.H}[0], [x0], x2
+ ld1 {v18.H}[1], [x0]
+ sub x0, x0, x2
+ urhadd v16.8B, v16.8B, v18.8B
+ .endif
+ st1 {v16.H}[0], [x0], x2
+ st1 {v16.H}[1], [x0], x2
+ subs w3, w3, #2
+ b.gt 2b
+ ret
+endfunc
+.endm
+
+ h264_chroma_mc8 put
+ h264_chroma_mc8 avg
+ h264_chroma_mc4 put
+ h264_chroma_mc4 avg
+ h264_chroma_mc2 put
+ h264_chroma_mc2 avg
+
+#if CONFIG_RV40_DECODER
+const rv40bias
+ .short 0, 16, 32, 16
+ .short 32, 28, 32, 28
+ .short 0, 32, 16, 32
+ .short 32, 28, 32, 28
+endconst
+
+ h264_chroma_mc8 put, rv40
+ h264_chroma_mc8 avg, rv40
+ h264_chroma_mc4 put, rv40
+ h264_chroma_mc4 avg, rv40
+#endif
+
+#if CONFIG_VC1_DECODER
+ h264_chroma_mc8 put, vc1
+ h264_chroma_mc8 avg, vc1
+ h264_chroma_mc4 put, vc1
+ h264_chroma_mc4 avg, vc1
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/h264dsp_init_aarch64.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264dsp_init_aarch64.c
new file mode 100644
index 00000000000..ed5e4bdd9b5
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264dsp_init_aarch64.c
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2010 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 "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/h264dsp.h"
+
+void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
+ int beta, int8_t *tc0);
+void ff_h264_h_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
+ int beta, int8_t *tc0);
+void ff_h264_v_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
+ int beta, int8_t *tc0);
+void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
+ int beta, int8_t *tc0);
+
+void ff_weight_h264_pixels_16_neon(uint8_t *dst, int stride, int height,
+ int log2_den, int weight, int offset);
+void ff_weight_h264_pixels_8_neon(uint8_t *dst, int stride, int height,
+ int log2_den, int weight, int offset);
+void ff_weight_h264_pixels_4_neon(uint8_t *dst, int stride, int height,
+ int log2_den, int weight, int offset);
+
+void ff_biweight_h264_pixels_16_neon(uint8_t *dst, uint8_t *src, int stride,
+ int height, int log2_den, int weightd,
+ int weights, int offset);
+void ff_biweight_h264_pixels_8_neon(uint8_t *dst, uint8_t *src, int stride,
+ int height, int log2_den, int weightd,
+ int weights, int offset);
+void ff_biweight_h264_pixels_4_neon(uint8_t *dst, uint8_t *src, int stride,
+ int height, int log2_den, int weightd,
+ int weights, int offset);
+
+void ff_h264_idct_add_neon(uint8_t *dst, int16_t *block, int stride);
+void ff_h264_idct_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
+void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset,
+ int16_t *block, int stride,
+ const uint8_t nnzc[6*8]);
+void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset,
+ int16_t *block, int stride,
+ const uint8_t nnzc[6*8]);
+void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset,
+ int16_t *block, int stride,
+ const uint8_t nnzc[6*8]);
+
+void ff_h264_idct8_add_neon(uint8_t *dst, int16_t *block, int stride);
+void ff_h264_idct8_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
+void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset,
+ int16_t *block, int stride,
+ const uint8_t nnzc[6*8]);
+
+av_cold void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
+ const int chroma_format_idc)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags) && bit_depth == 8) {
+ 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;
+ c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
+ c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
+
+ c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
+ c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
+ c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
+
+ c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
+ c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
+ c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
+
+ c->h264_idct_add = ff_h264_idct_add_neon;
+ c->h264_idct_dc_add = ff_h264_idct_dc_add_neon;
+ c->h264_idct_add16 = ff_h264_idct_add16_neon;
+ c->h264_idct_add16intra = ff_h264_idct_add16intra_neon;
+ if (chroma_format_idc <= 1)
+ c->h264_idct_add8 = ff_h264_idct_add8_neon;
+ c->h264_idct8_add = ff_h264_idct8_add_neon;
+ c->h264_idct8_dc_add = ff_h264_idct8_dc_add_neon;
+ c->h264_idct8_add4 = ff_h264_idct8_add4_neon;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/h264dsp_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264dsp_neon.S
new file mode 100644
index 00000000000..4ec35f29050
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264dsp_neon.S
@@ -0,0 +1,498 @@
+/*
+ * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
+ * Copyright (c) 2013 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "libavutil/aarch64/asm.S"
+#include "neon.S"
+
+.macro h264_loop_filter_start
+ cmp w2, #0
+ ldr w6, [x4]
+ ccmp w3, #0, #0, ne
+ mov v24.S[0], w6
+ and w6, w6, w6, lsl #16
+ b.eq 1f
+ ands w6, w6, w6, lsl #8
+ b.ge 2f
+1:
+ ret
+2:
+.endm
+
+.macro h264_loop_filter_luma
+ dup v22.16B, w2 // alpha
+ uxtl v24.8H, v24.8B
+ uabd v21.16B, v16.16B, v0.16B // abs(p0 - q0)
+ uxtl v24.4S, v24.4H
+ uabd v28.16B, v18.16B, v16.16B // abs(p1 - p0)
+ sli v24.8H, v24.8H, #8
+ uabd v30.16B, v2.16B, v0.16B // abs(q1 - q0)
+ sli v24.4S, v24.4S, #16
+ cmhi v21.16B, v22.16B, v21.16B // < alpha
+ dup v22.16B, w3 // beta
+ cmlt v23.16B, v24.16B, #0
+ cmhi v28.16B, v22.16B, v28.16B // < beta
+ cmhi v30.16B, v22.16B, v30.16B // < beta
+ bic v21.16B, v21.16B, v23.16B
+ uabd v17.16B, v20.16B, v16.16B // abs(p2 - p0)
+ and v21.16B, v21.16B, v28.16B
+ uabd v19.16B, v4.16B, v0.16B // abs(q2 - q0)
+ cmhi v17.16B, v22.16B, v17.16B // < beta
+ and v21.16B, v21.16B, v30.16B
+ cmhi v19.16B, v22.16B, v19.16B // < beta
+ and v17.16B, v17.16B, v21.16B
+ and v19.16B, v19.16B, v21.16B
+ and v24.16B, v24.16B, v21.16B
+ urhadd v28.16B, v16.16B, v0.16B
+ sub v21.16B, v24.16B, v17.16B
+ uqadd v23.16B, v18.16B, v24.16B
+ uhadd v20.16B, v20.16B, v28.16B
+ sub v21.16B, v21.16B, v19.16B
+ uhadd v28.16B, v4.16B, v28.16B
+ umin v23.16B, v23.16B, v20.16B
+ uqsub v22.16B, v18.16B, v24.16B
+ uqadd v4.16B, v2.16B, v24.16B
+ umax v23.16B, v23.16B, v22.16B
+ uqsub v22.16B, v2.16B, v24.16B
+ umin v28.16B, v4.16B, v28.16B
+ uxtl v4.8H, v0.8B
+ umax v28.16B, v28.16B, v22.16B
+ uxtl2 v20.8H, v0.16B
+ usubw v4.8H, v4.8H, v16.8B
+ usubw2 v20.8H, v20.8H, v16.16B
+ shl v4.8H, v4.8H, #2
+ shl v20.8H, v20.8H, #2
+ uaddw v4.8H, v4.8H, v18.8B
+ uaddw2 v20.8H, v20.8H, v18.16B
+ usubw v4.8H, v4.8H, v2.8B
+ usubw2 v20.8H, v20.8H, v2.16B
+ rshrn v4.8B, v4.8H, #3
+ rshrn2 v4.16B, v20.8H, #3
+ bsl v17.16B, v23.16B, v18.16B
+ bsl v19.16B, v28.16B, v2.16B
+ neg v23.16B, v21.16B
+ uxtl v28.8H, v16.8B
+ smin v4.16B, v4.16B, v21.16B
+ uxtl2 v21.8H, v16.16B
+ smax v4.16B, v4.16B, v23.16B
+ uxtl v22.8H, v0.8B
+ uxtl2 v24.8H, v0.16B
+ saddw v28.8H, v28.8H, v4.8B
+ saddw2 v21.8H, v21.8H, v4.16B
+ ssubw v22.8H, v22.8H, v4.8B
+ ssubw2 v24.8H, v24.8H, v4.16B
+ sqxtun v16.8B, v28.8H
+ sqxtun2 v16.16B, v21.8H
+ sqxtun v0.8B, v22.8H
+ sqxtun2 v0.16B, v24.8H
+.endm
+
+function ff_h264_v_loop_filter_luma_neon, export=1
+ h264_loop_filter_start
+ sxtw x1, w1
+
+ ld1 {v0.16B}, [x0], x1
+ ld1 {v2.16B}, [x0], x1
+ ld1 {v4.16B}, [x0], x1
+ sub x0, x0, x1, lsl #2
+ sub x0, x0, x1, lsl #1
+ ld1 {v20.16B}, [x0], x1
+ ld1 {v18.16B}, [x0], x1
+ ld1 {v16.16B}, [x0], x1
+
+ h264_loop_filter_luma
+
+ sub x0, x0, x1, lsl #1
+ st1 {v17.16B}, [x0], x1
+ st1 {v16.16B}, [x0], x1
+ st1 {v0.16B}, [x0], x1
+ st1 {v19.16B}, [x0]
+
+ ret
+endfunc
+
+function ff_h264_h_loop_filter_luma_neon, export=1
+ h264_loop_filter_start
+
+ sub x0, x0, #4
+ ld1 {v6.8B}, [x0], x1
+ ld1 {v20.8B}, [x0], x1
+ ld1 {v18.8B}, [x0], x1
+ ld1 {v16.8B}, [x0], x1
+ ld1 {v0.8B}, [x0], x1
+ ld1 {v2.8B}, [x0], x1
+ ld1 {v4.8B}, [x0], x1
+ ld1 {v26.8B}, [x0], x1
+ ld1 {v6.D}[1], [x0], x1
+ ld1 {v20.D}[1], [x0], x1
+ ld1 {v18.D}[1], [x0], x1
+ ld1 {v16.D}[1], [x0], x1
+ ld1 {v0.D}[1], [x0], x1
+ ld1 {v2.D}[1], [x0], x1
+ ld1 {v4.D}[1], [x0], x1
+ ld1 {v26.D}[1], [x0], x1
+
+ transpose_8x16B v6, v20, v18, v16, v0, v2, v4, v26, v21, v23
+
+ h264_loop_filter_luma
+
+ transpose_4x16B v17, v16, v0, v19, v21, v23, v25, v27
+
+ sub x0, x0, x1, lsl #4
+ add x0, x0, #2
+ st1 {v17.S}[0], [x0], x1
+ st1 {v16.S}[0], [x0], x1
+ st1 {v0.S}[0], [x0], x1
+ st1 {v19.S}[0], [x0], x1
+ st1 {v17.S}[1], [x0], x1
+ st1 {v16.S}[1], [x0], x1
+ st1 {v0.S}[1], [x0], x1
+ st1 {v19.S}[1], [x0], x1
+ st1 {v17.S}[2], [x0], x1
+ st1 {v16.S}[2], [x0], x1
+ st1 {v0.S}[2], [x0], x1
+ st1 {v19.S}[2], [x0], x1
+ st1 {v17.S}[3], [x0], x1
+ st1 {v16.S}[3], [x0], x1
+ st1 {v0.S}[3], [x0], x1
+ st1 {v19.S}[3], [x0], x1
+
+ ret
+endfunc
+
+.macro h264_loop_filter_chroma
+ dup v22.8B, w2 // alpha
+ uxtl v24.8H, v24.8B
+ uabd v26.8B, v16.8B, v0.8B // abs(p0 - q0)
+ uxtl v4.8H, v0.8B
+ uabd v28.8B, v18.8B, v16.8B // abs(p1 - p0)
+ usubw v4.8H, v4.8H, v16.8B
+ sli v24.8H, v24.8H, #8
+ shl v4.8H, v4.8H, #2
+ uabd v30.8B, v2.8B, v0.8B // abs(q1 - q0)
+ uaddw v4.8H, v4.8H, v18.8B
+ cmhi v26.8B, v22.8B, v26.8B // < alpha
+ usubw v4.8H, v4.8H, v2.8B
+ dup v22.8B, w3 // beta
+ rshrn v4.8B, v4.8H, #3
+ cmhi v28.8B, v22.8B, v28.8B // < beta
+ cmhi v30.8B, v22.8B, v30.8B // < beta
+ smin v4.8B, v4.8B, v24.8B
+ neg v25.8B, v24.8B
+ and v26.8B, v26.8B, v28.8B
+ smax v4.8B, v4.8B, v25.8B
+ and v26.8B, v26.8B, v30.8B
+ uxtl v22.8H, v0.8B
+ and v4.8B, v4.8B, v26.8B
+ uxtl v28.8H, v16.8B
+ saddw v28.8H, v28.8H, v4.8B
+ ssubw v22.8H, v22.8H, v4.8B
+ sqxtun v16.8B, v28.8H
+ sqxtun v0.8B, v22.8H
+.endm
+
+function ff_h264_v_loop_filter_chroma_neon, export=1
+ h264_loop_filter_start
+
+ sub x0, x0, x1, lsl #1
+ ld1 {v18.8B}, [x0], x1
+ ld1 {v16.8B}, [x0], x1
+ ld1 {v0.8B}, [x0], x1
+ ld1 {v2.8B}, [x0]
+
+ h264_loop_filter_chroma
+
+ sub x0, x0, x1, lsl #1
+ st1 {v16.8B}, [x0], x1
+ st1 {v0.8B}, [x0], x1
+
+ ret
+endfunc
+
+function ff_h264_h_loop_filter_chroma_neon, export=1
+ h264_loop_filter_start
+
+ sub x0, x0, #2
+ ld1 {v18.S}[0], [x0], x1
+ ld1 {v16.S}[0], [x0], x1
+ ld1 {v0.S}[0], [x0], x1
+ ld1 {v2.S}[0], [x0], x1
+ ld1 {v18.S}[1], [x0], x1
+ ld1 {v16.S}[1], [x0], x1
+ ld1 {v0.S}[1], [x0], x1
+ ld1 {v2.S}[1], [x0], x1
+
+ transpose_4x8B v18, v16, v0, v2, v28, v29, v30, v31
+
+ h264_loop_filter_chroma
+
+ transpose_4x8B v18, v16, v0, v2, v28, v29, v30, v31
+
+ sub x0, x0, x1, lsl #3
+ st1 {v18.S}[0], [x0], x1
+ st1 {v16.S}[0], [x0], x1
+ st1 {v0.S}[0], [x0], x1
+ st1 {v2.S}[0], [x0], x1
+ st1 {v18.S}[1], [x0], x1
+ st1 {v16.S}[1], [x0], x1
+ st1 {v0.S}[1], [x0], x1
+ st1 {v2.S}[1], [x0], x1
+
+ ret
+endfunc
+
+.macro biweight_16 macs, macd
+ dup v0.16B, w5
+ dup v1.16B, w6
+ mov v4.16B, v16.16B
+ mov v6.16B, v16.16B
+1: subs w3, w3, #2
+ ld1 {v20.16B}, [x0], x2
+ \macd v4.8H, v0.8B, v20.8B
+ \macd\()2 v6.8H, v0.16B, v20.16B
+ ld1 {v22.16B}, [x1], x2
+ \macs v4.8H, v1.8B, v22.8B
+ \macs\()2 v6.8H, v1.16B, v22.16B
+ mov v24.16B, v16.16B
+ ld1 {v28.16B}, [x0], x2
+ mov v26.16B, v16.16B
+ \macd v24.8H, v0.8B, v28.8B
+ \macd\()2 v26.8H, v0.16B, v28.16B
+ ld1 {v30.16B}, [x1], x2
+ \macs v24.8H, v1.8B, v30.8B
+ \macs\()2 v26.8H, v1.16B, v30.16B
+ sshl v4.8H, v4.8H, v18.8H
+ sshl v6.8H, v6.8H, v18.8H
+ sqxtun v4.8B, v4.8H
+ sqxtun2 v4.16B, v6.8H
+ sshl v24.8H, v24.8H, v18.8H
+ sshl v26.8H, v26.8H, v18.8H
+ sqxtun v24.8B, v24.8H
+ sqxtun2 v24.16B, v26.8H
+ mov v6.16B, v16.16B
+ st1 {v4.16B}, [x7], x2
+ mov v4.16B, v16.16B
+ st1 {v24.16B}, [x7], x2
+ b.ne 1b
+ ret
+.endm
+
+.macro biweight_8 macs, macd
+ dup v0.8B, w5
+ dup v1.8B, w6
+ mov v2.16B, v16.16B
+ mov v20.16B, v16.16B
+1: subs w3, w3, #2
+ ld1 {v4.8B}, [x0], x2
+ \macd v2.8H, v0.8B, v4.8B
+ ld1 {v5.8B}, [x1], x2
+ \macs v2.8H, v1.8B, v5.8B
+ ld1 {v6.8B}, [x0], x2
+ \macd v20.8H, v0.8B, v6.8B
+ ld1 {v7.8B}, [x1], x2
+ \macs v20.8H, v1.8B, v7.8B
+ sshl v2.8H, v2.8H, v18.8H
+ sqxtun v2.8B, v2.8H
+ sshl v20.8H, v20.8H, v18.8H
+ sqxtun v4.8B, v20.8H
+ mov v20.16B, v16.16B
+ st1 {v2.8B}, [x7], x2
+ mov v2.16B, v16.16B
+ st1 {v4.8B}, [x7], x2
+ b.ne 1b
+ ret
+.endm
+
+.macro biweight_4 macs, macd
+ dup v0.8B, w5
+ dup v1.8B, w6
+ mov v2.16B, v16.16B
+ mov v20.16B,v16.16B
+1: subs w3, w3, #4
+ ld1 {v4.S}[0], [x0], x2
+ ld1 {v4.S}[1], [x0], x2
+ \macd v2.8H, v0.8B, v4.8B
+ ld1 {v5.S}[0], [x1], x2
+ ld1 {v5.S}[1], [x1], x2
+ \macs v2.8H, v1.8B, v5.8B
+ b.lt 2f
+ ld1 {v6.S}[0], [x0], x2
+ ld1 {v6.S}[1], [x0], x2
+ \macd v20.8H, v0.8B, v6.8B
+ ld1 {v7.S}[0], [x1], x2
+ ld1 {v7.S}[1], [x1], x2
+ \macs v20.8H, v1.8B, v7.8B
+ sshl v2.8H, v2.8H, v18.8H
+ sqxtun v2.8B, v2.8H
+ sshl v20.8H, v20.8H, v18.8H
+ sqxtun v4.8B, v20.8H
+ mov v20.16B, v16.16B
+ st1 {v2.S}[0], [x7], x2
+ st1 {v2.S}[1], [x7], x2
+ mov v2.16B, v16.16B
+ st1 {v4.S}[0], [x7], x2
+ st1 {v4.S}[1], [x7], x2
+ b.ne 1b
+ ret
+2: sshl v2.8H, v2.8H, v18.8H
+ sqxtun v2.8B, v2.8H
+ st1 {v2.S}[0], [x7], x2
+ st1 {v2.S}[1], [x7], x2
+ ret
+.endm
+
+.macro biweight_func w
+function ff_biweight_h264_pixels_\w\()_neon, export=1
+ sxtw x2, w2
+ lsr w8, w5, #31
+ add w7, w7, #1
+ eor w8, w8, w6, lsr #30
+ orr w7, w7, #1
+ dup v18.8H, w4
+ lsl w7, w7, w4
+ not v18.16B, v18.16B
+ dup v16.8H, w7
+ mov x7, x0
+ cbz w8, 10f
+ subs w8, w8, #1
+ b.eq 20f
+ subs w8, w8, #1
+ b.eq 30f
+ b 40f
+10: biweight_\w umlal, umlal
+20: neg w5, w5
+ biweight_\w umlal, umlsl
+30: neg w5, w5
+ neg w6, w6
+ biweight_\w umlsl, umlsl
+40: neg w6, w6
+ biweight_\w umlsl, umlal
+endfunc
+.endm
+
+ biweight_func 16
+ biweight_func 8
+ biweight_func 4
+
+.macro weight_16 add
+ dup v0.16B, w4
+1: subs w2, w2, #2
+ ld1 {v20.16B}, [x0], x1
+ umull v4.8H, v0.8B, v20.8B
+ umull2 v6.8H, v0.16B, v20.16B
+ ld1 {v28.16B}, [x0], x1
+ umull v24.8H, v0.8B, v28.8B
+ umull2 v26.8H, v0.16B, v28.16B
+ \add v4.8H, v16.8H, v4.8H
+ srshl v4.8H, v4.8H, v18.8H
+ \add v6.8H, v16.8H, v6.8H
+ srshl v6.8H, v6.8H, v18.8H
+ sqxtun v4.8B, v4.8H
+ sqxtun2 v4.16B, v6.8H
+ \add v24.8H, v16.8H, v24.8H
+ srshl v24.8H, v24.8H, v18.8H
+ \add v26.8H, v16.8H, v26.8H
+ srshl v26.8H, v26.8H, v18.8H
+ sqxtun v24.8B, v24.8H
+ sqxtun2 v24.16B, v26.8H
+ st1 {v4.16B}, [x5], x1
+ st1 {v24.16B}, [x5], x1
+ b.ne 1b
+ ret
+.endm
+
+.macro weight_8 add
+ dup v0.8B, w4
+1: subs w2, w2, #2
+ ld1 {v4.8B}, [x0], x1
+ umull v2.8H, v0.8B, v4.8B
+ ld1 {v6.8B}, [x0], x1
+ umull v20.8H, v0.8B, v6.8B
+ \add v2.8H, v16.8H, v2.8H
+ srshl v2.8H, v2.8H, v18.8H
+ sqxtun v2.8B, v2.8H
+ \add v20.8H, v16.8H, v20.8H
+ srshl v20.8H, v20.8H, v18.8H
+ sqxtun v4.8B, v20.8H
+ st1 {v2.8B}, [x5], x1
+ st1 {v4.8B}, [x5], x1
+ b.ne 1b
+ ret
+.endm
+
+.macro weight_4 add
+ dup v0.8B, w4
+1: subs w2, w2, #4
+ ld1 {v4.S}[0], [x0], x1
+ ld1 {v4.S}[1], [x0], x1
+ umull v2.8H, v0.8B, v4.8B
+ b.lt 2f
+ ld1 {v6.S}[0], [x0], x1
+ ld1 {v6.S}[1], [x0], x1
+ umull v20.8H, v0.8B, v6.8B
+ \add v2.8H, v16.8H, v2.8H
+ srshl v2.8H, v2.8H, v18.8H
+ sqxtun v2.8B, v2.8H
+ \add v20.8H, v16.8H, v20.8H
+ srshl v20.8H, v20.8h, v18.8H
+ sqxtun v4.8B, v20.8H
+ st1 {v2.S}[0], [x5], x1
+ st1 {v2.S}[1], [x5], x1
+ st1 {v4.S}[0], [x5], x1
+ st1 {v4.S}[1], [x5], x1
+ b.ne 1b
+ ret
+2: \add v2.8H, v16.8H, v2.8H
+ srshl v2.8H, v2.8H, v18.8H
+ sqxtun v2.8B, v2.8H
+ st1 {v2.S}[0], [x5], x1
+ st1 {v2.S}[1], [x5], x1
+ ret
+.endm
+
+.macro weight_func w
+function ff_weight_h264_pixels_\w\()_neon, export=1
+ sxtw x1, w1
+ cmp w3, #1
+ mov w6, #1
+ lsl w5, w5, w3
+ dup v16.8H, w5
+ mov x5, x0
+ b.le 20f
+ sub w6, w6, w3
+ dup v18.8H, w6
+ cmp w4, #0
+ b.lt 10f
+ weight_\w shadd
+10: neg w4, w4
+ weight_\w shsub
+20: neg w6, w3
+ dup v18.8H, w6
+ cmp w4, #0
+ b.lt 10f
+ weight_\w add
+10: neg w4, w4
+ weight_\w sub
+endfunc
+.endm
+
+ weight_func 16
+ weight_func 8
+ weight_func 4
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/h264idct_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264idct_neon.S
new file mode 100644
index 00000000000..04b5a47f043
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264idct_neon.S
@@ -0,0 +1,408 @@
+/*
+ * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
+ * Copyright (c) 2013 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "libavutil/aarch64/asm.S"
+#include "neon.S"
+
+function ff_h264_idct_add_neon, export=1
+ ld1 {v0.4H, v1.4H, v2.4H, v3.4H}, [x1]
+ sxtw x2, w2
+ movi v30.8H, #0
+
+ add v4.4H, v0.4H, v2.4H
+ sshr v16.4H, v1.4H, #1
+ st1 {v30.8H}, [x1], #16
+ sshr v17.4H, v3.4H, #1
+ st1 {v30.8H}, [x1], #16
+ sub v5.4H, v0.4H, v2.4H
+ add v6.4H, v1.4H, v17.4H
+ sub v7.4H, v16.4H, v3.4H
+ add v0.4H, v4.4H, v6.4H
+ add v1.4H, v5.4H, v7.4H
+ sub v2.4H, v4.4H, v6.4H
+ sub v3.4H, v5.4H, v7.4H
+
+ transpose_4x4H v0, v1, v2, v3, v4, v5, v6, v7
+
+ add v4.4H, v0.4H, v3.4H
+ ld1 {v18.S}[0], [x0], x2
+ sshr v16.4H, v2.4H, #1
+ sshr v17.4H, v1.4H, #1
+ ld1 {v19.S}[1], [x0], x2
+ sub v5.4H, v0.4H, v3.4H
+ ld1 {v18.S}[1], [x0], x2
+ add v6.4H, v16.4H, v1.4H
+ ins v4.D[1], v5.D[0]
+ sub v7.4H, v2.4H, v17.4H
+ ld1 {v19.S}[0], [x0], x2
+ ins v6.D[1], v7.D[0]
+ sub x0, x0, x2, lsl #2
+ add v0.8H, v4.8H, v6.8H
+ sub v1.8H, v4.8H, v6.8H
+
+ srshr v0.8H, v0.8H, #6
+ srshr v1.8H, v1.8H, #6
+
+ uaddw v0.8H, v0.8H, v18.8B
+ uaddw v1.8H, v1.8H, v19.8B
+
+ sqxtun v0.8B, v0.8H
+ sqxtun v1.8B, v1.8H
+
+ st1 {v0.S}[0], [x0], x2
+ st1 {v1.S}[1], [x0], x2
+ st1 {v0.S}[1], [x0], x2
+ st1 {v1.S}[0], [x0], x2
+
+ sub x1, x1, #32
+ ret
+endfunc
+
+function ff_h264_idct_dc_add_neon, export=1
+ sxtw x2, w2
+ mov w3, #0
+ ld1r {v2.8H}, [x1]
+ strh w3, [x1]
+ srshr v2.8H, v2.8H, #6
+ ld1 {v0.S}[0], [x0], x2
+ ld1 {v0.S}[1], [x0], x2
+ uaddw v3.8H, v2.8H, v0.8B
+ ld1 {v1.S}[0], [x0], x2
+ ld1 {v1.S}[1], [x0], x2
+ uaddw v4.8H, v2.8H, v1.8B
+ sqxtun v0.8B, v3.8H
+ sqxtun v1.8B, v4.8H
+ sub x0, x0, x2, lsl #2
+ st1 {v0.S}[0], [x0], x2
+ st1 {v0.S}[1], [x0], x2
+ st1 {v1.S}[0], [x0], x2
+ st1 {v1.S}[1], [x0], x2
+ ret
+endfunc
+
+function ff_h264_idct_add16_neon, export=1
+ mov x12, x30
+ mov x6, x0 // dest
+ mov x5, x1 // block_offset
+ mov x1, x2 // block
+ mov w9, w3 // stride
+ movrel x7, scan8
+ mov x10, #16
+ movrel x13, X(ff_h264_idct_dc_add_neon)
+ movrel x14, X(ff_h264_idct_add_neon)
+1: mov w2, w9
+ ldrb w3, [x7], #1
+ ldrsw x0, [x5], #4
+ ldrb w3, [x4, w3, uxtw]
+ subs w3, w3, #1
+ b.lt 2f
+ ldrsh w3, [x1]
+ add x0, x0, x6
+ ccmp w3, #0, #4, eq
+ csel x15, x13, x14, ne
+ blr x15
+2: subs x10, x10, #1
+ add x1, x1, #32
+ b.ne 1b
+ ret x12
+endfunc
+
+function ff_h264_idct_add16intra_neon, export=1
+ mov x12, x30
+ mov x6, x0 // dest
+ mov x5, x1 // block_offset
+ mov x1, x2 // block
+ mov w9, w3 // stride
+ movrel x7, scan8
+ mov x10, #16
+ movrel x13, X(ff_h264_idct_dc_add_neon)
+ movrel x14, X(ff_h264_idct_add_neon)
+1: mov w2, w9
+ ldrb w3, [x7], #1
+ ldrsw x0, [x5], #4
+ ldrb w3, [x4, w3, uxtw]
+ add x0, x0, x6
+ cmp w3, #0
+ ldrsh w3, [x1]
+ csel x15, x13, x14, eq
+ ccmp w3, #0, #0, eq
+ b.eq 2f
+ blr x15
+2: subs x10, x10, #1
+ add x1, x1, #32
+ b.ne 1b
+ ret x12
+endfunc
+
+function ff_h264_idct_add8_neon, export=1
+ sub sp, sp, #0x40
+ stp x19, x20, [sp]
+ mov x12, x30
+ ldp x6, x15, [x0] // dest[0], dest[1]
+ add x5, x1, #16*4 // block_offset
+ add x9, x2, #16*32 // block
+ mov w19, w3 // stride
+ movrel x13, X(ff_h264_idct_dc_add_neon)
+ movrel x14, X(ff_h264_idct_add_neon)
+ movrel x7, scan8+16
+ mov x10, #0
+ mov x11, #16
+1: mov w2, w19
+ ldrb w3, [x7, x10] // scan8[i]
+ ldrsw x0, [x5, x10, lsl #2] // block_offset[i]
+ ldrb w3, [x4, w3, uxtw] // nnzc[ scan8[i] ]
+ add x0, x0, x6 // block_offset[i] + dst[j-1]
+ add x1, x9, x10, lsl #5 // block + i * 16
+ cmp w3, #0
+ ldrsh w3, [x1] // block[i*16]
+ csel x20, x13, x14, eq
+ ccmp w3, #0, #0, eq
+ b.eq 2f
+ blr x20
+2: add x10, x10, #1
+ cmp x10, #4
+ csel x10, x11, x10, eq // mov x10, #16
+ csel x6, x15, x6, eq
+ cmp x10, #20
+ b.lt 1b
+ ldp x19, x20, [sp]
+ add sp, sp, #0x40
+ ret x12
+endfunc
+
+.macro idct8x8_cols pass
+ .if \pass == 0
+ va .req v18
+ vb .req v30
+ sshr v18.8H, v26.8H, #1
+ add v16.8H, v24.8H, v28.8H
+ ld1 {v30.8H, v31.8H}, [x1]
+ st1 {v19.8H}, [x1], #16
+ st1 {v19.8H}, [x1], #16
+ sub v17.8H, v24.8H, v28.8H
+ sshr v19.8H, v30.8H, #1
+ sub v18.8H, v18.8H, v30.8H
+ add v19.8H, v19.8H, v26.8H
+ .else
+ va .req v30
+ vb .req v18
+ sshr v30.8H, v26.8H, #1
+ sshr v19.8H, v18.8H, #1
+ add v16.8H, v24.8H, v28.8H
+ sub v17.8H, v24.8H, v28.8H
+ sub v30.8H, v30.8H, v18.8H
+ add v19.8H, v19.8H, v26.8H
+ .endif
+ add v26.8H, v17.8H, va.8H
+ sub v28.8H, v17.8H, va.8H
+ add v24.8H, v16.8H, v19.8H
+ sub vb.8H, v16.8H, v19.8H
+ sub v16.8H, v29.8H, v27.8H
+ add v17.8H, v31.8H, v25.8H
+ sub va.8H, v31.8H, v25.8H
+ add v19.8H, v29.8H, v27.8H
+ sub v16.8H, v16.8H, v31.8H
+ sub v17.8H, v17.8H, v27.8H
+ add va.8H, va.8H, v29.8H
+ add v19.8H, v19.8H, v25.8H
+ sshr v25.8H, v25.8H, #1
+ sshr v27.8H, v27.8H, #1
+ sshr v29.8H, v29.8H, #1
+ sshr v31.8H, v31.8H, #1
+ sub v16.8H, v16.8H, v31.8H
+ sub v17.8H, v17.8H, v27.8H
+ add va.8H, va.8H, v29.8H
+ add v19.8H, v19.8H, v25.8H
+ sshr v25.8H, v16.8H, #2
+ sshr v27.8H, v17.8H, #2
+ sshr v29.8H, va.8H, #2
+ sshr v31.8H, v19.8H, #2
+ sub v19.8H, v19.8H, v25.8H
+ sub va.8H, v27.8H, va.8H
+ add v17.8H, v17.8H, v29.8H
+ add v16.8H, v16.8H, v31.8H
+ .if \pass == 0
+ sub v31.8H, v24.8H, v19.8H
+ add v24.8H, v24.8H, v19.8H
+ add v25.8H, v26.8H, v18.8H
+ sub v18.8H, v26.8H, v18.8H
+ add v26.8H, v28.8H, v17.8H
+ add v27.8H, v30.8H, v16.8H
+ sub v29.8H, v28.8H, v17.8H
+ sub v28.8H, v30.8H, v16.8H
+ .else
+ sub v31.8H, v24.8H, v19.8H
+ add v24.8H, v24.8H, v19.8H
+ add v25.8H, v26.8H, v30.8H
+ sub v30.8H, v26.8H, v30.8H
+ add v26.8H, v28.8H, v17.8H
+ sub v29.8H, v28.8H, v17.8H
+ add v27.8H, v18.8H, v16.8H
+ sub v28.8H, v18.8H, v16.8H
+ .endif
+ .unreq va
+ .unreq vb
+.endm
+
+function ff_h264_idct8_add_neon, export=1
+ movi v19.8H, #0
+ ld1 {v24.8H, v25.8H}, [x1]
+ st1 {v19.8H}, [x1], #16
+ st1 {v19.8H}, [x1], #16
+ ld1 {v26.8H, v27.8H}, [x1]
+ st1 {v19.8H}, [x1], #16
+ st1 {v19.8H}, [x1], #16
+ ld1 {v28.8H, v29.8H}, [x1]
+ st1 {v19.8H}, [x1], #16
+ st1 {v19.8H}, [x1], #16
+
+ idct8x8_cols 0
+ transpose_8x8H v24, v25, v26, v27, v28, v29, v18, v31, v6, v7
+ idct8x8_cols 1
+
+ mov x3, x0
+ srshr v24.8H, v24.8H, #6
+ ld1 {v0.8B}, [x0], x2
+ srshr v25.8H, v25.8H, #6
+ ld1 {v1.8B}, [x0], x2
+ srshr v26.8H, v26.8H, #6
+ ld1 {v2.8B}, [x0], x2
+ srshr v27.8H, v27.8H, #6
+ ld1 {v3.8B}, [x0], x2
+ srshr v28.8H, v28.8H, #6
+ ld1 {v4.8B}, [x0], x2
+ srshr v29.8H, v29.8H, #6
+ ld1 {v5.8B}, [x0], x2
+ srshr v30.8H, v30.8H, #6
+ ld1 {v6.8B}, [x0], x2
+ srshr v31.8H, v31.8H, #6
+ ld1 {v7.8B}, [x0], x2
+ uaddw v24.8H, v24.8H, v0.8B
+ uaddw v25.8H, v25.8H, v1.8B
+ uaddw v26.8H, v26.8H, v2.8B
+ sqxtun v0.8B, v24.8H
+ uaddw v27.8H, v27.8H, v3.8B
+ sqxtun v1.8B, v25.8H
+ uaddw v28.8H, v28.8H, v4.8B
+ sqxtun v2.8B, v26.8H
+ st1 {v0.8B}, [x3], x2
+ uaddw v29.8H, v29.8H, v5.8B
+ sqxtun v3.8B, v27.8H
+ st1 {v1.8B}, [x3], x2
+ uaddw v30.8H, v30.8H, v6.8B
+ sqxtun v4.8B, v28.8H
+ st1 {v2.8B}, [x3], x2
+ uaddw v31.8H, v31.8H, v7.8B
+ sqxtun v5.8B, v29.8H
+ st1 {v3.8B}, [x3], x2
+ sqxtun v6.8B, v30.8H
+ sqxtun v7.8B, v31.8H
+ st1 {v4.8B}, [x3], x2
+ st1 {v5.8B}, [x3], x2
+ st1 {v6.8B}, [x3], x2
+ st1 {v7.8B}, [x3], x2
+
+ sub x1, x1, #128
+ ret
+endfunc
+
+function ff_h264_idct8_dc_add_neon, export=1
+ mov w3, #0
+ sxtw x2, w2
+ ld1r {v31.8H}, [x1]
+ strh w3, [x1]
+ ld1 {v0.8B}, [x0], x2
+ srshr v31.8H, v31.8H, #6
+ ld1 {v1.8B}, [x0], x2
+ ld1 {v2.8B}, [x0], x2
+ uaddw v24.8H, v31.8H, v0.8B
+ ld1 {v3.8B}, [x0], x2
+ uaddw v25.8H, v31.8H, v1.8B
+ ld1 {v4.8B}, [x0], x2
+ uaddw v26.8H, v31.8H, v2.8B
+ ld1 {v5.8B}, [x0], x2
+ uaddw v27.8H, v31.8H, v3.8B
+ ld1 {v6.8B}, [x0], x2
+ uaddw v28.8H, v31.8H, v4.8B
+ ld1 {v7.8B}, [x0], x2
+ uaddw v29.8H, v31.8H, v5.8B
+ uaddw v30.8H, v31.8H, v6.8B
+ uaddw v31.8H, v31.8H, v7.8B
+ sqxtun v0.8B, v24.8H
+ sqxtun v1.8B, v25.8H
+ sqxtun v2.8B, v26.8H
+ sqxtun v3.8B, v27.8H
+ sub x0, x0, x2, lsl #3
+ st1 {v0.8B}, [x0], x2
+ sqxtun v4.8B, v28.8H
+ st1 {v1.8B}, [x0], x2
+ sqxtun v5.8B, v29.8H
+ st1 {v2.8B}, [x0], x2
+ sqxtun v6.8B, v30.8H
+ st1 {v3.8B}, [x0], x2
+ sqxtun v7.8B, v31.8H
+ st1 {v4.8B}, [x0], x2
+ st1 {v5.8B}, [x0], x2
+ st1 {v6.8B}, [x0], x2
+ st1 {v7.8B}, [x0], x2
+ ret
+endfunc
+
+function ff_h264_idct8_add4_neon, export=1
+ mov x12, x30
+ mov x6, x0
+ mov x5, x1
+ mov x1, x2
+ mov w2, w3
+ movrel x7, scan8
+ mov w10, #16
+ movrel x13, X(ff_h264_idct8_dc_add_neon)
+ movrel x14, X(ff_h264_idct8_add_neon)
+1: ldrb w9, [x7], #4
+ ldrsw x0, [x5], #16
+ ldrb w9, [x4, w9, UXTW]
+ subs w9, w9, #1
+ b.lt 2f
+ ldrsh w11, [x1]
+ add x0, x6, x0
+ ccmp w11, #0, #4, eq
+ csel x15, x13, x14, ne
+ blr x15
+2: subs w10, w10, #4
+ add x1, x1, #128
+ b.ne 1b
+ ret x12
+endfunc
+
+const scan8
+ .byte 4+ 1*8, 5+ 1*8, 4+ 2*8, 5+ 2*8
+ .byte 6+ 1*8, 7+ 1*8, 6+ 2*8, 7+ 2*8
+ .byte 4+ 3*8, 5+ 3*8, 4+ 4*8, 5+ 4*8
+ .byte 6+ 3*8, 7+ 3*8, 6+ 4*8, 7+ 4*8
+ .byte 4+ 6*8, 5+ 6*8, 4+ 7*8, 5+ 7*8
+ .byte 6+ 6*8, 7+ 6*8, 6+ 7*8, 7+ 7*8
+ .byte 4+ 8*8, 5+ 8*8, 4+ 9*8, 5+ 9*8
+ .byte 6+ 8*8, 7+ 8*8, 6+ 9*8, 7+ 9*8
+ .byte 4+11*8, 5+11*8, 4+12*8, 5+12*8
+ .byte 6+11*8, 7+11*8, 6+12*8, 7+12*8
+ .byte 4+13*8, 5+13*8, 4+14*8, 5+14*8
+ .byte 6+13*8, 7+13*8, 6+14*8, 7+14*8
+endconst
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/h264qpel_init_aarch64.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264qpel_init_aarch64.c
new file mode 100644
index 00000000000..0578c01704c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264qpel_init_aarch64.c
@@ -0,0 +1,172 @@
+/*
+ * ARM NEON optimised DSP functions
+ * Copyright (c) 2008 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 "config.h"
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/h264qpel.h"
+
+void ff_put_h264_qpel16_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel16_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+
+void ff_put_h264_qpel8_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_put_h264_qpel8_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+
+void ff_avg_h264_qpel16_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel16_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+
+void ff_avg_h264_qpel8_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+void ff_avg_h264_qpel8_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
+
+av_cold void ff_h264qpel_init_aarch64(H264QpelContext *c, int bit_depth)
+{
+ const int high_bit_depth = bit_depth > 8;
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags) && !high_bit_depth) {
+ 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;
+ c->put_h264_qpel_pixels_tab[0][ 2] = ff_put_h264_qpel16_mc20_neon;
+ c->put_h264_qpel_pixels_tab[0][ 3] = ff_put_h264_qpel16_mc30_neon;
+ c->put_h264_qpel_pixels_tab[0][ 4] = ff_put_h264_qpel16_mc01_neon;
+ c->put_h264_qpel_pixels_tab[0][ 5] = ff_put_h264_qpel16_mc11_neon;
+ c->put_h264_qpel_pixels_tab[0][ 6] = ff_put_h264_qpel16_mc21_neon;
+ c->put_h264_qpel_pixels_tab[0][ 7] = ff_put_h264_qpel16_mc31_neon;
+ c->put_h264_qpel_pixels_tab[0][ 8] = ff_put_h264_qpel16_mc02_neon;
+ c->put_h264_qpel_pixels_tab[0][ 9] = ff_put_h264_qpel16_mc12_neon;
+ c->put_h264_qpel_pixels_tab[0][10] = ff_put_h264_qpel16_mc22_neon;
+ c->put_h264_qpel_pixels_tab[0][11] = ff_put_h264_qpel16_mc32_neon;
+ c->put_h264_qpel_pixels_tab[0][12] = ff_put_h264_qpel16_mc03_neon;
+ c->put_h264_qpel_pixels_tab[0][13] = ff_put_h264_qpel16_mc13_neon;
+ c->put_h264_qpel_pixels_tab[0][14] = ff_put_h264_qpel16_mc23_neon;
+ c->put_h264_qpel_pixels_tab[0][15] = ff_put_h264_qpel16_mc33_neon;
+
+ c->put_h264_qpel_pixels_tab[1][ 0] = ff_put_h264_qpel8_mc00_neon;
+ c->put_h264_qpel_pixels_tab[1][ 1] = ff_put_h264_qpel8_mc10_neon;
+ c->put_h264_qpel_pixels_tab[1][ 2] = ff_put_h264_qpel8_mc20_neon;
+ c->put_h264_qpel_pixels_tab[1][ 3] = ff_put_h264_qpel8_mc30_neon;
+ c->put_h264_qpel_pixels_tab[1][ 4] = ff_put_h264_qpel8_mc01_neon;
+ c->put_h264_qpel_pixels_tab[1][ 5] = ff_put_h264_qpel8_mc11_neon;
+ c->put_h264_qpel_pixels_tab[1][ 6] = ff_put_h264_qpel8_mc21_neon;
+ c->put_h264_qpel_pixels_tab[1][ 7] = ff_put_h264_qpel8_mc31_neon;
+ c->put_h264_qpel_pixels_tab[1][ 8] = ff_put_h264_qpel8_mc02_neon;
+ c->put_h264_qpel_pixels_tab[1][ 9] = ff_put_h264_qpel8_mc12_neon;
+ c->put_h264_qpel_pixels_tab[1][10] = ff_put_h264_qpel8_mc22_neon;
+ c->put_h264_qpel_pixels_tab[1][11] = ff_put_h264_qpel8_mc32_neon;
+ c->put_h264_qpel_pixels_tab[1][12] = ff_put_h264_qpel8_mc03_neon;
+ c->put_h264_qpel_pixels_tab[1][13] = ff_put_h264_qpel8_mc13_neon;
+ c->put_h264_qpel_pixels_tab[1][14] = ff_put_h264_qpel8_mc23_neon;
+ 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;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/h264qpel_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264qpel_neon.S
new file mode 100644
index 00000000000..d27cfac4941
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264qpel_neon.S
@@ -0,0 +1,934 @@
+/*
+ * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
+ * Copyright (c) 2013 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "libavutil/aarch64/asm.S"
+#include "neon.S"
+
+ /* H.264 qpel MC */
+
+.macro lowpass_const r
+ movz \r, #20, lsl #16
+ movk \r, #5
+ mov v6.S[0], \r
+.endm
+
+//trashes v0-v5
+.macro lowpass_8 r0, r1, r2, r3, d0, d1, narrow=1
+ ext v2.8B, \r0\().8B, \r1\().8B, #2
+ ext v3.8B, \r0\().8B, \r1\().8B, #3
+ uaddl v2.8H, v2.8B, v3.8B
+ ext v4.8B, \r0\().8B, \r1\().8B, #1
+ ext v5.8B, \r0\().8B, \r1\().8B, #4
+ uaddl v4.8H, v4.8B, v5.8B
+ ext v1.8B, \r0\().8B, \r1\().8B, #5
+ uaddl \d0\().8H, \r0\().8B, v1.8B
+ ext v0.8B, \r2\().8B, \r3\().8B, #2
+ mla \d0\().8H, v2.8H, v6.H[1]
+ ext v1.8B, \r2\().8B, \r3\().8B, #3
+ uaddl v0.8H, v0.8B, v1.8B
+ ext v1.8B, \r2\().8B, \r3\().8B, #1
+ mls \d0\().8H, v4.8H, v6.H[0]
+ ext v3.8B, \r2\().8B, \r3\().8B, #4
+ uaddl v1.8H, v1.8B, v3.8B
+ ext v2.8B, \r2\().8B, \r3\().8B, #5
+ uaddl \d1\().8H, \r2\().8B, v2.8B
+ mla \d1\().8H, v0.8H, v6.H[1]
+ mls \d1\().8H, v1.8H, v6.H[0]
+ .if \narrow
+ sqrshrun \d0\().8B, \d0\().8H, #5
+ sqrshrun \d1\().8B, \d1\().8H, #5
+ .endif
+.endm
+
+//trashes v0-v5, v7, v30-v31
+.macro lowpass_8H r0, r1
+ ext v0.16B, \r0\().16B, \r0\().16B, #2
+ ext v1.16B, \r0\().16B, \r0\().16B, #3
+ uaddl v0.8H, v0.8B, v1.8B
+ ext v2.16B, \r0\().16B, \r0\().16B, #1
+ ext v3.16B, \r0\().16B, \r0\().16B, #4
+ uaddl v2.8H, v2.8B, v3.8B
+ ext v30.16B, \r0\().16B, \r0\().16B, #5
+ uaddl \r0\().8H, \r0\().8B, v30.8B
+ ext v4.16B, \r1\().16B, \r1\().16B, #2
+ mla \r0\().8H, v0.8H, v6.H[1]
+ ext v5.16B, \r1\().16B, \r1\().16B, #3
+ uaddl v4.8H, v4.8B, v5.8B
+ ext v7.16B, \r1\().16B, \r1\().16B, #1
+ mls \r0\().8H, v2.8H, v6.H[0]
+ ext v0.16B, \r1\().16B, \r1\().16B, #4
+ uaddl v7.8H, v7.8B, v0.8B
+ ext v31.16B, \r1\().16B, \r1\().16B, #5
+ uaddl \r1\().8H, \r1\().8B, v31.8B
+ mla \r1\().8H, v4.8H, v6.H[1]
+ mls \r1\().8H, v7.8H, v6.H[0]
+.endm
+
+// trashes v2-v5, v30
+.macro lowpass_8_1 r0, r1, d0, narrow=1
+ ext v2.8B, \r0\().8B, \r1\().8B, #2
+ ext v3.8B, \r0\().8B, \r1\().8B, #3
+ uaddl v2.8H, v2.8B, v3.8B
+ ext v4.8B, \r0\().8B, \r1\().8B, #1
+ ext v5.8B, \r0\().8B, \r1\().8B, #4
+ uaddl v4.8H, v4.8B, v5.8B
+ ext v30.8B, \r0\().8B, \r1\().8B, #5
+ uaddl \d0\().8H, \r0\().8B, v30.8B
+ mla \d0\().8H, v2.8H, v6.H[1]
+ mls \d0\().8H, v4.8H, v6.H[0]
+ .if \narrow
+ sqrshrun \d0\().8B, \d0\().8H, #5
+ .endif
+.endm
+
+// trashed v0-v7
+.macro lowpass_8.16 r0, r1, r2
+ ext v1.16B, \r0\().16B, \r1\().16B, #4
+ ext v0.16B, \r0\().16B, \r1\().16B, #6
+ saddl v5.4S, v1.4H, v0.4H
+ ext v2.16B, \r0\().16B, \r1\().16B, #2
+ saddl2 v1.4S, v1.8H, v0.8H
+ ext v3.16B, \r0\().16B, \r1\().16B, #8
+ saddl v6.4S, v2.4H, v3.4H
+ ext \r1\().16B, \r0\().16B, \r1\().16B, #10
+ saddl2 v2.4S, v2.8H, v3.8H
+ saddl v0.4S, \r0\().4H, \r1\().4H
+ saddl2 v4.4S, \r0\().8H, \r1\().8H
+
+ shl v3.4S, v5.4S, #4
+ shl v5.4S, v5.4S, #2
+ shl v7.4S, v6.4S, #2
+ add v5.4S, v5.4S, v3.4S
+ add v6.4S, v6.4S, v7.4S
+
+ shl v3.4S, v1.4S, #4
+ shl v1.4S, v1.4S, #2
+ shl v7.4S, v2.4S, #2
+ add v1.4S, v1.4S, v3.4S
+ add v2.4S, v2.4S, v7.4S
+
+ add v5.4S, v5.4S, v0.4S
+ sub v5.4S, v5.4S, v6.4S
+
+ add v1.4S, v1.4S, v4.4S
+ sub v1.4S, v1.4S, v2.4S
+
+ rshrn v5.4H, v5.4S, #10
+ rshrn2 v5.8H, v1.4S, #10
+
+ sqxtun \r2\().8B, v5.8H
+.endm
+
+function put_h264_qpel16_h_lowpass_neon_packed
+ mov x4, x30
+ mov x12, #16
+ mov x3, #8
+ bl put_h264_qpel8_h_lowpass_neon
+ sub x1, x1, x2, lsl #4
+ add x1, x1, #8
+ mov x12, #16
+ mov x30, x4
+ b put_h264_qpel8_h_lowpass_neon
+endfunc
+
+.macro h264_qpel_h_lowpass type
+function \type\()_h264_qpel16_h_lowpass_neon
+ mov x13, x30
+ mov x12, #16
+ bl \type\()_h264_qpel8_h_lowpass_neon
+ sub x0, x0, x3, lsl #4
+ sub x1, x1, x2, lsl #4
+ add x0, x0, #8
+ add x1, x1, #8
+ mov x12, #16
+ mov x30, x13
+endfunc
+
+function \type\()_h264_qpel8_h_lowpass_neon
+1: ld1 {v28.8B, v29.8B}, [x1], x2
+ ld1 {v16.8B, v17.8B}, [x1], x2
+ subs x12, x12, #2
+ lowpass_8 v28, v29, v16, v17, v28, v16
+ .ifc \type,avg
+ ld1 {v2.8B}, [x0], x3
+ urhadd v28.8B, v28.8B, v2.8B
+ ld1 {v3.8B}, [x0]
+ urhadd v16.8B, v16.8B, v3.8B
+ sub x0, x0, x3
+ .endif
+ st1 {v28.8B}, [x0], x3
+ st1 {v16.8B}, [x0], x3
+ b.ne 1b
+ ret
+endfunc
+.endm
+
+ h264_qpel_h_lowpass put
+ h264_qpel_h_lowpass avg
+
+.macro h264_qpel_h_lowpass_l2 type
+function \type\()_h264_qpel16_h_lowpass_l2_neon
+ mov x13, x30
+ mov x12, #16
+ bl \type\()_h264_qpel8_h_lowpass_l2_neon
+ sub x0, x0, x2, lsl #4
+ sub x1, x1, x2, lsl #4
+ sub x3, x3, x2, lsl #4
+ add x0, x0, #8
+ add x1, x1, #8
+ add x3, x3, #8
+ mov x12, #16
+ mov x30, x13
+endfunc
+
+function \type\()_h264_qpel8_h_lowpass_l2_neon
+1: ld1 {v26.8B, v27.8B}, [x1], x2
+ ld1 {v16.8B, v17.8B}, [x1], x2
+ ld1 {v28.8B}, [x3], x2
+ ld1 {v29.8B}, [x3], x2
+ subs x12, x12, #2
+ lowpass_8 v26, v27, v16, v17, v26, v27
+ urhadd v26.8B, v26.8B, v28.8B
+ urhadd v27.8B, v27.8B, v29.8B
+ .ifc \type,avg
+ ld1 {v2.8B}, [x0], x2
+ urhadd v26.8B, v26.8B, v2.8B
+ ld1 {v3.8B}, [x0]
+ urhadd v27.8B, v27.8B, v3.8B
+ sub x0, x0, x2
+ .endif
+ st1 {v26.8B}, [x0], x2
+ st1 {v27.8B}, [x0], x2
+ b.ne 1b
+ ret
+endfunc
+.endm
+
+ h264_qpel_h_lowpass_l2 put
+ h264_qpel_h_lowpass_l2 avg
+
+function put_h264_qpel16_v_lowpass_neon_packed
+ mov x4, x30
+ mov x2, #8
+ bl put_h264_qpel8_v_lowpass_neon
+ sub x1, x1, x3, lsl #2
+ bl put_h264_qpel8_v_lowpass_neon
+ sub x1, x1, x3, lsl #4
+ sub x1, x1, x3, lsl #2
+ add x1, x1, #8
+ bl put_h264_qpel8_v_lowpass_neon
+ sub x1, x1, x3, lsl #2
+ mov x30, x4
+ b put_h264_qpel8_v_lowpass_neon
+endfunc
+
+.macro h264_qpel_v_lowpass type
+function \type\()_h264_qpel16_v_lowpass_neon
+ mov x4, x30
+ bl \type\()_h264_qpel8_v_lowpass_neon
+ sub x1, x1, x3, lsl #2
+ bl \type\()_h264_qpel8_v_lowpass_neon
+ sub x0, x0, x2, lsl #4
+ add x0, x0, #8
+ sub x1, x1, x3, lsl #4
+ sub x1, x1, x3, lsl #2
+ add x1, x1, #8
+ bl \type\()_h264_qpel8_v_lowpass_neon
+ sub x1, x1, x3, lsl #2
+ mov x30, x4
+endfunc
+
+function \type\()_h264_qpel8_v_lowpass_neon
+ ld1 {v16.8B}, [x1], x3
+ ld1 {v18.8B}, [x1], x3
+ ld1 {v20.8B}, [x1], x3
+ ld1 {v22.8B}, [x1], x3
+ ld1 {v24.8B}, [x1], x3
+ ld1 {v26.8B}, [x1], x3
+ ld1 {v28.8B}, [x1], x3
+ ld1 {v30.8B}, [x1], x3
+ ld1 {v17.8B}, [x1], x3
+ ld1 {v19.8B}, [x1], x3
+ ld1 {v21.8B}, [x1], x3
+ ld1 {v23.8B}, [x1], x3
+ ld1 {v25.8B}, [x1]
+
+ transpose_8x8B v16, v18, v20, v22, v24, v26, v28, v30, v0, v1
+ transpose_8x8B v17, v19, v21, v23, v25, v27, v29, v31, v0, v1
+ lowpass_8 v16, v17, v18, v19, v16, v17
+ lowpass_8 v20, v21, v22, v23, v18, v19
+ lowpass_8 v24, v25, v26, v27, v20, v21
+ lowpass_8 v28, v29, v30, v31, v22, v23
+ transpose_8x8B v16, v17, v18, v19, v20, v21, v22, v23, v0, v1
+
+ .ifc \type,avg
+ ld1 {v24.8B}, [x0], x2
+ urhadd v16.8B, v16.8B, v24.8B
+ ld1 {v25.8B}, [x0], x2
+ urhadd v17.8B, v17.8B, v25.8B
+ ld1 {v26.8B}, [x0], x2
+ urhadd v18.8B, v18.8B, v26.8B
+ ld1 {v27.8B}, [x0], x2
+ urhadd v19.8B, v19.8B, v27.8B
+ ld1 {v28.8B}, [x0], x2
+ urhadd v20.8B, v20.8B, v28.8B
+ ld1 {v29.8B}, [x0], x2
+ urhadd v21.8B, v21.8B, v29.8B
+ ld1 {v30.8B}, [x0], x2
+ urhadd v22.8B, v22.8B, v30.8B
+ ld1 {v31.8B}, [x0], x2
+ urhadd v23.8B, v23.8B, v31.8B
+ sub x0, x0, x2, lsl #3
+ .endif
+
+ st1 {v16.8B}, [x0], x2
+ st1 {v17.8B}, [x0], x2
+ st1 {v18.8B}, [x0], x2
+ st1 {v19.8B}, [x0], x2
+ st1 {v20.8B}, [x0], x2
+ st1 {v21.8B}, [x0], x2
+ st1 {v22.8B}, [x0], x2
+ st1 {v23.8B}, [x0], x2
+
+ ret
+endfunc
+.endm
+
+ h264_qpel_v_lowpass put
+ h264_qpel_v_lowpass avg
+
+.macro h264_qpel_v_lowpass_l2 type
+function \type\()_h264_qpel16_v_lowpass_l2_neon
+ mov x4, x30
+ bl \type\()_h264_qpel8_v_lowpass_l2_neon
+ sub x1, x1, x3, lsl #2
+ bl \type\()_h264_qpel8_v_lowpass_l2_neon
+ sub x0, x0, x3, lsl #4
+ sub x12, x12, x2, lsl #4
+ add x0, x0, #8
+ add x12, x12, #8
+ sub x1, x1, x3, lsl #4
+ sub x1, x1, x3, lsl #2
+ add x1, x1, #8
+ bl \type\()_h264_qpel8_v_lowpass_l2_neon
+ sub x1, x1, x3, lsl #2
+ mov x30, x4
+endfunc
+
+function \type\()_h264_qpel8_v_lowpass_l2_neon
+ ld1 {v16.8B}, [x1], x3
+ ld1 {v18.8B}, [x1], x3
+ ld1 {v20.8B}, [x1], x3
+ ld1 {v22.8B}, [x1], x3
+ ld1 {v24.8B}, [x1], x3
+ ld1 {v26.8B}, [x1], x3
+ ld1 {v28.8B}, [x1], x3
+ ld1 {v30.8B}, [x1], x3
+ ld1 {v17.8B}, [x1], x3
+ ld1 {v19.8B}, [x1], x3
+ ld1 {v21.8B}, [x1], x3
+ ld1 {v23.8B}, [x1], x3
+ ld1 {v25.8B}, [x1]
+
+ transpose_8x8B v16, v18, v20, v22, v24, v26, v28, v30, v0, v1
+ transpose_8x8B v17, v19, v21, v23, v25, v27, v29, v31, v0, v1
+ lowpass_8 v16, v17, v18, v19, v16, v17
+ lowpass_8 v20, v21, v22, v23, v18, v19
+ lowpass_8 v24, v25, v26, v27, v20, v21
+ lowpass_8 v28, v29, v30, v31, v22, v23
+ transpose_8x8B v16, v17, v18, v19, v20, v21, v22, v23, v0, v1
+
+ ld1 {v24.8B}, [x12], x2
+ ld1 {v25.8B}, [x12], x2
+ ld1 {v26.8B}, [x12], x2
+ ld1 {v27.8B}, [x12], x2
+ ld1 {v28.8B}, [x12], x2
+ urhadd v16.8B, v24.8B, v16.8B
+ urhadd v17.8B, v25.8B, v17.8B
+ ld1 {v29.8B}, [x12], x2
+ urhadd v18.8B, v26.8B, v18.8B
+ urhadd v19.8B, v27.8B, v19.8B
+ ld1 {v30.8B}, [x12], x2
+ urhadd v20.8B, v28.8B, v20.8B
+ urhadd v21.8B, v29.8B, v21.8B
+ ld1 {v31.8B}, [x12], x2
+ urhadd v22.8B, v30.8B, v22.8B
+ urhadd v23.8B, v31.8B, v23.8B
+
+ .ifc \type,avg
+ ld1 {v24.8B}, [x0], x3
+ urhadd v16.8B, v16.8B, v24.8B
+ ld1 {v25.8B}, [x0], x3
+ urhadd v17.8B, v17.8B, v25.8B
+ ld1 {v26.8B}, [x0], x3
+ urhadd v18.8B, v18.8B, v26.8B
+ ld1 {v27.8B}, [x0], x3
+ urhadd v19.8B, v19.8B, v27.8B
+ ld1 {v28.8B}, [x0], x3
+ urhadd v20.8B, v20.8B, v28.8B
+ ld1 {v29.8B}, [x0], x3
+ urhadd v21.8B, v21.8B, v29.8B
+ ld1 {v30.8B}, [x0], x3
+ urhadd v22.8B, v22.8B, v30.8B
+ ld1 {v31.8B}, [x0], x3
+ urhadd v23.8B, v23.8B, v31.8B
+ sub x0, x0, x3, lsl #3
+ .endif
+
+ st1 {v16.8B}, [x0], x3
+ st1 {v17.8B}, [x0], x3
+ st1 {v18.8B}, [x0], x3
+ st1 {v19.8B}, [x0], x3
+ st1 {v20.8B}, [x0], x3
+ st1 {v21.8B}, [x0], x3
+ st1 {v22.8B}, [x0], x3
+ st1 {v23.8B}, [x0], x3
+
+ ret
+endfunc
+.endm
+
+ h264_qpel_v_lowpass_l2 put
+ h264_qpel_v_lowpass_l2 avg
+
+function put_h264_qpel8_hv_lowpass_neon_top
+ lowpass_const w12
+ ld1 {v16.8H}, [x1], x3
+ ld1 {v17.8H}, [x1], x3
+ ld1 {v18.8H}, [x1], x3
+ ld1 {v19.8H}, [x1], x3
+ ld1 {v20.8H}, [x1], x3
+ ld1 {v21.8H}, [x1], x3
+ ld1 {v22.8H}, [x1], x3
+ ld1 {v23.8H}, [x1], x3
+ ld1 {v24.8H}, [x1], x3
+ ld1 {v25.8H}, [x1], x3
+ ld1 {v26.8H}, [x1], x3
+ ld1 {v27.8H}, [x1], x3
+ ld1 {v28.8H}, [x1]
+ lowpass_8H v16, v17
+ lowpass_8H v18, v19
+ lowpass_8H v20, v21
+ lowpass_8H v22, v23
+ lowpass_8H v24, v25
+ lowpass_8H v26, v27
+ lowpass_8H v28, v29
+
+ transpose_8x8H v16, v17, v18, v19, v20, v21, v22, v23, v0, v1
+ transpose_8x8H v24, v25, v26, v27, v28, v29, v30, v31, v0, v1
+
+ lowpass_8.16 v16, v24, v16
+ lowpass_8.16 v17, v25, v17
+
+ lowpass_8.16 v18, v26, v18
+ lowpass_8.16 v19, v27, v19
+
+ lowpass_8.16 v20, v28, v20
+ lowpass_8.16 v21, v29, v21
+
+ lowpass_8.16 v22, v30, v22
+ lowpass_8.16 v23, v31, v23
+
+ transpose_8x8B v16, v17, v18, v19, v20, v21, v22, v23, v0, v1
+
+ ret
+endfunc
+
+.macro h264_qpel8_hv_lowpass type
+function \type\()_h264_qpel8_hv_lowpass_neon
+ mov x10, x30
+ bl put_h264_qpel8_hv_lowpass_neon_top
+ .ifc \type,avg
+ ld1 {v0.8B}, [x0], x2
+ urhadd v16.8B, v16.8B, v0.8B
+ ld1 {v1.8B}, [x0], x2
+ urhadd v17.8B, v17.8B, v1.8B
+ ld1 {v2.8B}, [x0], x2
+ urhadd v18.8B, v18.8B, v2.8B
+ ld1 {v3.8B}, [x0], x2
+ urhadd v19.8B, v19.8B, v3.8B
+ ld1 {v4.8B}, [x0], x2
+ urhadd v20.8B, v20.8B, v4.8B
+ ld1 {v5.8B}, [x0], x2
+ urhadd v21.8B, v21.8B, v5.8B
+ ld1 {v6.8B}, [x0], x2
+ urhadd v22.8B, v22.8B, v6.8B
+ ld1 {v7.8B}, [x0], x2
+ urhadd v23.8B, v23.8B, v7.8B
+ sub x0, x0, x2, lsl #3
+ .endif
+
+ st1 {v16.8B}, [x0], x2
+ st1 {v17.8B}, [x0], x2
+ st1 {v18.8B}, [x0], x2
+ st1 {v19.8B}, [x0], x2
+ st1 {v20.8B}, [x0], x2
+ st1 {v21.8B}, [x0], x2
+ st1 {v22.8B}, [x0], x2
+ st1 {v23.8B}, [x0], x2
+
+ ret x10
+endfunc
+.endm
+
+ 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 x10, x30
+ bl put_h264_qpel8_hv_lowpass_neon_top
+
+ ld1 {v0.8B, v1.8B}, [x2], #16
+ ld1 {v2.8B, v3.8B}, [x2], #16
+ urhadd v0.8B, v0.8B, v16.8B
+ urhadd v1.8B, v1.8B, v17.8B
+ ld1 {v4.8B, v5.8B}, [x2], #16
+ urhadd v2.8B, v2.8B, v18.8B
+ urhadd v3.8B, v3.8B, v19.8B
+ ld1 {v6.8B, v7.8B}, [x2], #16
+ urhadd v4.8B, v4.8B, v20.8B
+ urhadd v5.8B, v5.8B, v21.8B
+ urhadd v6.8B, v6.8B, v22.8B
+ urhadd v7.8B, v7.8B, v23.8B
+ .ifc \type,avg
+ ld1 {v16.8B}, [x0], x3
+ urhadd v0.8B, v0.8B, v16.8B
+ ld1 {v17.8B}, [x0], x3
+ urhadd v1.8B, v1.8B, v17.8B
+ ld1 {v18.8B}, [x0], x3
+ urhadd v2.8B, v2.8B, v18.8B
+ ld1 {v19.8B}, [x0], x3
+ urhadd v3.8B, v3.8B, v19.8B
+ ld1 {v20.8B}, [x0], x3
+ urhadd v4.8B, v4.8B, v20.8B
+ ld1 {v21.8B}, [x0], x3
+ urhadd v5.8B, v5.8B, v21.8B
+ ld1 {v22.8B}, [x0], x3
+ urhadd v6.8B, v6.8B, v22.8B
+ ld1 {v23.8B}, [x0], x3
+ urhadd v7.8B, v7.8B, v23.8B
+ sub x0, x0, x3, lsl #3
+ .endif
+ st1 {v0.8B}, [x0], x3
+ st1 {v1.8B}, [x0], x3
+ st1 {v2.8B}, [x0], x3
+ st1 {v3.8B}, [x0], x3
+ st1 {v4.8B}, [x0], x3
+ st1 {v5.8B}, [x0], x3
+ st1 {v6.8B}, [x0], x3
+ st1 {v7.8B}, [x0], x3
+
+ ret x10
+endfunc
+.endm
+
+ h264_qpel8_hv_lowpass_l2 put
+ h264_qpel8_hv_lowpass_l2 avg
+
+.macro h264_qpel16_hv type
+function \type\()_h264_qpel16_hv_lowpass_neon
+ mov x13, x30
+ bl \type\()_h264_qpel8_hv_lowpass_neon
+ sub x1, x1, x3, lsl #2
+ bl \type\()_h264_qpel8_hv_lowpass_neon
+ sub x1, x1, x3, lsl #4
+ sub x1, x1, x3, lsl #2
+ add x1, x1, #8
+ sub x0, x0, x2, lsl #4
+ add x0, x0, #8
+ bl \type\()_h264_qpel8_hv_lowpass_neon
+ sub x1, x1, x3, lsl #2
+ mov x30, x13
+ b \type\()_h264_qpel8_hv_lowpass_neon
+endfunc
+
+function \type\()_h264_qpel16_hv_lowpass_l2_neon
+ mov x13, x30
+ sub x2, x4, #256
+ bl \type\()_h264_qpel8_hv_lowpass_l2_neon
+ sub x1, x1, x3, lsl #2
+ bl \type\()_h264_qpel8_hv_lowpass_l2_neon
+ sub x1, x1, x3, lsl #4
+ sub x1, x1, x3, lsl #2
+ add x1, x1, #8
+ sub x0, x0, x3, lsl #4
+ add x0, x0, #8
+ bl \type\()_h264_qpel8_hv_lowpass_l2_neon
+ sub x1, x1, x3, lsl #2
+ mov x30, x13
+ b \type\()_h264_qpel8_hv_lowpass_l2_neon
+endfunc
+.endm
+
+ h264_qpel16_hv put
+ h264_qpel16_hv avg
+
+.macro h264_qpel8 type
+function ff_\type\()_h264_qpel8_mc10_neon, export=1
+ lowpass_const w3
+ mov x3, x1
+ sub x1, x1, #2
+ mov x12, #8
+ b \type\()_h264_qpel8_h_lowpass_l2_neon
+endfunc
+
+function ff_\type\()_h264_qpel8_mc20_neon, export=1
+ lowpass_const w3
+ sub x1, x1, #2
+ mov x3, x2
+ mov x12, #8
+ b \type\()_h264_qpel8_h_lowpass_neon
+endfunc
+
+function ff_\type\()_h264_qpel8_mc30_neon, export=1
+ lowpass_const w3
+ add x3, x1, #1
+ sub x1, x1, #2
+ mov x12, #8
+ b \type\()_h264_qpel8_h_lowpass_l2_neon
+endfunc
+
+function ff_\type\()_h264_qpel8_mc01_neon, export=1
+ mov x14, x30
+ mov x12, x1
+\type\()_h264_qpel8_mc01:
+ lowpass_const w3
+ mov x3, x2
+ sub x1, x1, x2, lsl #1
+ bl \type\()_h264_qpel8_v_lowpass_l2_neon
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel8_mc11_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+\type\()_h264_qpel8_mc11:
+ lowpass_const w3
+ mov x11, sp
+ sub sp, sp, #64
+ mov x0, sp
+ sub x1, x1, #2
+ mov x3, #8
+ mov x12, #8
+ bl put_h264_qpel8_h_lowpass_neon
+ mov x0, x8
+ mov x3, x2
+ mov x12, sp
+ sub x1, x9, x2, lsl #1
+ mov x2, #8
+ bl \type\()_h264_qpel8_v_lowpass_l2_neon
+ mov sp, x11
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel8_mc21_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+\type\()_h264_qpel8_mc21:
+ lowpass_const w3
+ mov x11, sp
+ sub sp, sp, #(8*8+16*12)
+ sub x1, x1, #2
+ mov x3, #8
+ mov x0, sp
+ mov x12, #8
+ bl put_h264_qpel8_h_lowpass_neon
+ mov x4, x0
+ mov x0, x8
+ sub x1, x9, x2, lsl #1
+ sub x1, x1, #2
+ mov x3, x2
+ sub x2, x4, #64
+ bl \type\()_h264_qpel8_hv_lowpass_l2_neon
+ mov sp, x11
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel8_mc31_neon, export=1
+ add x1, x1, #1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+ sub x1, x1, #1
+ b \type\()_h264_qpel8_mc11
+endfunc
+
+function ff_\type\()_h264_qpel8_mc02_neon, export=1
+ mov x14, x30
+ lowpass_const w3
+ sub x1, x1, x2, lsl #1
+ mov x3, x2
+ bl \type\()_h264_qpel8_v_lowpass_neon
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel8_mc12_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+\type\()_h264_qpel8_mc12:
+ lowpass_const w3
+ mov x11, sp
+ sub sp, sp, #(8*8+16*12)
+ sub x1, x1, x2, lsl #1
+ mov x3, x2
+ mov x2, #8
+ mov x0, sp
+ bl put_h264_qpel8_v_lowpass_neon
+ mov x4, x0
+ mov x0, x8
+ sub x1, x9, x3, lsl #1
+ sub x1, x1, #2
+ sub x2, x4, #64
+ bl \type\()_h264_qpel8_hv_lowpass_l2_neon
+ mov sp, x11
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel8_mc22_neon, export=1
+ mov x14, x30
+ mov x11, sp
+ sub x1, x1, x2, lsl #1
+ sub x1, x1, #2
+ mov x3, x2
+ bl \type\()_h264_qpel8_hv_lowpass_neon
+ mov sp, x11
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel8_mc32_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+ add x1, x1, #1
+ b \type\()_h264_qpel8_mc12
+endfunc
+
+function ff_\type\()_h264_qpel8_mc03_neon, export=1
+ mov x14, x30
+ add x12, x1, x2
+ b \type\()_h264_qpel8_mc01
+endfunc
+
+function ff_\type\()_h264_qpel8_mc13_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+ add x1, x1, x2
+ b \type\()_h264_qpel8_mc11
+endfunc
+
+function ff_\type\()_h264_qpel8_mc23_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+ add x1, x1, x2
+ b \type\()_h264_qpel8_mc21
+endfunc
+
+function ff_\type\()_h264_qpel8_mc33_neon, export=1
+ add x1, x1, #1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+ add x1, x1, x2
+ sub x1, x1, #1
+ b \type\()_h264_qpel8_mc11
+endfunc
+.endm
+
+ h264_qpel8 put
+ h264_qpel8 avg
+
+.macro h264_qpel16 type
+function ff_\type\()_h264_qpel16_mc10_neon, export=1
+ lowpass_const w3
+ mov x3, x1
+ sub x1, x1, #2
+ b \type\()_h264_qpel16_h_lowpass_l2_neon
+endfunc
+
+function ff_\type\()_h264_qpel16_mc20_neon, export=1
+ lowpass_const w3
+ sub x1, x1, #2
+ mov x3, x2
+ b \type\()_h264_qpel16_h_lowpass_neon
+endfunc
+
+function ff_\type\()_h264_qpel16_mc30_neon, export=1
+ lowpass_const w3
+ add x3, x1, #1
+ sub x1, x1, #2
+ b \type\()_h264_qpel16_h_lowpass_l2_neon
+endfunc
+
+function ff_\type\()_h264_qpel16_mc01_neon, export=1
+ mov x14, x30
+ mov x12, x1
+\type\()_h264_qpel16_mc01:
+ lowpass_const w3
+ mov x3, x2
+ sub x1, x1, x2, lsl #1
+ bl \type\()_h264_qpel16_v_lowpass_l2_neon
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel16_mc11_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+\type\()_h264_qpel16_mc11:
+ lowpass_const w3
+ mov x11, sp
+ sub sp, sp, #256
+ mov x0, sp
+ sub x1, x1, #2
+ mov x3, #16
+ bl put_h264_qpel16_h_lowpass_neon
+ mov x0, x8
+ mov x3, x2
+ mov x12, sp
+ sub x1, x9, x2, lsl #1
+ mov x2, #16
+ bl \type\()_h264_qpel16_v_lowpass_l2_neon
+ mov sp, x11
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel16_mc21_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+\type\()_h264_qpel16_mc21:
+ lowpass_const w3
+ mov x11, sp
+ sub sp, sp, #(16*16+16*12)
+ sub x1, x1, #2
+ mov x0, sp
+ bl put_h264_qpel16_h_lowpass_neon_packed
+ mov x4, x0
+ mov x0, x8
+ sub x1, x9, x2, lsl #1
+ sub x1, x1, #2
+ mov x3, x2
+ bl \type\()_h264_qpel16_hv_lowpass_l2_neon
+ mov sp, x11
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel16_mc31_neon, export=1
+ add x1, x1, #1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+ sub x1, x1, #1
+ b \type\()_h264_qpel16_mc11
+endfunc
+
+function ff_\type\()_h264_qpel16_mc02_neon, export=1
+ mov x14, x30
+ lowpass_const w3
+ sub x1, x1, x2, lsl #1
+ mov x3, x2
+ bl \type\()_h264_qpel16_v_lowpass_neon
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel16_mc12_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+\type\()_h264_qpel16_mc12:
+ lowpass_const w3
+ mov x11, sp
+ sub sp, sp, #(16*16+16*12)
+ sub x1, x1, x2, lsl #1
+ mov x0, sp
+ mov x3, x2
+ bl put_h264_qpel16_v_lowpass_neon_packed
+ mov x4, x0
+ mov x0, x8
+ sub x1, x9, x3, lsl #1
+ sub x1, x1, #2
+ mov x2, x3
+ bl \type\()_h264_qpel16_hv_lowpass_l2_neon
+ mov sp, x11
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel16_mc22_neon, export=1
+ mov x14, x30
+ lowpass_const w3
+ mov x11, sp
+ sub x1, x1, x2, lsl #1
+ sub x1, x1, #2
+ mov x3, x2
+ bl \type\()_h264_qpel16_hv_lowpass_neon
+ mov sp, x11 // restore stack
+ ret x14
+endfunc
+
+function ff_\type\()_h264_qpel16_mc32_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+ add x1, x1, #1
+ b \type\()_h264_qpel16_mc12
+endfunc
+
+function ff_\type\()_h264_qpel16_mc03_neon, export=1
+ mov x14, x30
+ add x12, x1, x2
+ b \type\()_h264_qpel16_mc01
+endfunc
+
+function ff_\type\()_h264_qpel16_mc13_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+ add x1, x1, x2
+ b \type\()_h264_qpel16_mc11
+endfunc
+
+function ff_\type\()_h264_qpel16_mc23_neon, export=1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+ add x1, x1, x2
+ b \type\()_h264_qpel16_mc21
+endfunc
+
+function ff_\type\()_h264_qpel16_mc33_neon, export=1
+ add x1, x1, #1
+ mov x14, x30
+ mov x8, x0
+ mov x9, x1
+ add x1, x1, x2
+ sub x1, x1, #1
+ b \type\()_h264_qpel16_mc11
+endfunc
+.endm
+
+ h264_qpel16 put
+ h264_qpel16 avg
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/hpeldsp_init_aarch64.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/hpeldsp_init_aarch64.c
new file mode 100644
index 00000000000..144ae2bcc4e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/hpeldsp_init_aarch64.c
@@ -0,0 +1,123 @@
+/*
+ * ARM NEON optimised DSP functions
+ * Copyright (c) 2008 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 <stddef.h>
+#include <stdint.h>
+
+#include "config.h"
+
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/hpeldsp.h"
+
+void ff_put_pixels16_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels16_x2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels16_y2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels16_xy2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels8_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels8_x2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels8_y2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels8_xy2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+
+void ff_put_pixels16_x2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels16_y2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels16_xy2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels8_x2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels8_y2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels8_xy2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+
+void ff_avg_pixels16_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels16_x2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels16_y2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels16_xy2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels8_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels8_x2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels8_y2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels8_xy2_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+
+void ff_avg_pixels16_x2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels16_y2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels16_xy2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+
+av_cold void ff_hpeldsp_init_aarch64(HpelDSPContext *c, int flags)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ c->put_pixels_tab[0][0] = ff_put_pixels16_neon;
+ c->put_pixels_tab[0][1] = ff_put_pixels16_x2_neon;
+ c->put_pixels_tab[0][2] = ff_put_pixels16_y2_neon;
+ c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_neon;
+ c->put_pixels_tab[1][0] = ff_put_pixels8_neon;
+ c->put_pixels_tab[1][1] = ff_put_pixels8_x2_neon;
+ c->put_pixels_tab[1][2] = ff_put_pixels8_y2_neon;
+ c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_neon;
+
+ c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_neon;
+ c->put_no_rnd_pixels_tab[0][1] = ff_put_pixels16_x2_no_rnd_neon;
+ c->put_no_rnd_pixels_tab[0][2] = ff_put_pixels16_y2_no_rnd_neon;
+ c->put_no_rnd_pixels_tab[0][3] = ff_put_pixels16_xy2_no_rnd_neon;
+ c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_neon;
+ c->put_no_rnd_pixels_tab[1][1] = ff_put_pixels8_x2_no_rnd_neon;
+ c->put_no_rnd_pixels_tab[1][2] = ff_put_pixels8_y2_no_rnd_neon;
+ 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[0][1] = ff_avg_pixels16_x2_neon;
+ c->avg_pixels_tab[0][2] = ff_avg_pixels16_y2_neon;
+ c->avg_pixels_tab[0][3] = ff_avg_pixels16_xy2_neon;
+ c->avg_pixels_tab[1][0] = ff_avg_pixels8_neon;
+ c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_neon;
+ c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_neon;
+ c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_neon;
+
+ c->avg_no_rnd_pixels_tab[0] = ff_avg_pixels16_neon;
+ c->avg_no_rnd_pixels_tab[1] = ff_avg_pixels16_x2_no_rnd_neon;
+ c->avg_no_rnd_pixels_tab[2] = ff_avg_pixels16_y2_no_rnd_neon;
+ c->avg_no_rnd_pixels_tab[3] = ff_avg_pixels16_xy2_no_rnd_neon;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/hpeldsp_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/hpeldsp_neon.S
new file mode 100644
index 00000000000..a491c173bbc
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/hpeldsp_neon.S
@@ -0,0 +1,397 @@
+/*
+ * ARM NEON optimised DSP functions
+ * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
+ * Copyright (c) 2013 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "libavutil/aarch64/asm.S"
+
+.macro pixels16 rnd=1, avg=0
+ .if \avg
+ mov x12, x0
+ .endif
+1: ld1 {v0.16B}, [x1], x2
+ ld1 {v1.16B}, [x1], x2
+ ld1 {v2.16B}, [x1], x2
+ ld1 {v3.16B}, [x1], x2
+ .if \avg
+ ld1 {v4.16B}, [x12], x2
+ urhadd v0.16B, v0.16B, v4.16B
+ ld1 {v5.16B}, [x12], x2
+ urhadd v1.16B, v1.16B, v5.16B
+ ld1 {v6.16B}, [x12], x2
+ urhadd v2.16B, v2.16B, v6.16B
+ ld1 {v7.16B}, [x12], x2
+ urhadd v3.16B, v3.16B, v7.16B
+ .endif
+ subs w3, w3, #4
+ st1 {v0.16B}, [x0], x2
+ st1 {v1.16B}, [x0], x2
+ st1 {v2.16B}, [x0], x2
+ st1 {v3.16B}, [x0], x2
+ b.ne 1b
+ ret
+.endm
+
+.macro pixels16_x2 rnd=1, avg=0
+1: ld1 {v0.16B, v1.16B}, [x1], x2
+ ld1 {v2.16B, v3.16B}, [x1], x2
+ subs w3, w3, #2
+ ext v1.16B, v0.16B, v1.16B, #1
+ avg v0.16B, v0.16B, v1.16B
+ ext v3.16B, v2.16B, v3.16B, #1
+ avg v2.16B, v2.16B, v3.16B
+ .if \avg
+ ld1 {v1.16B}, [x0], x2
+ ld1 {v3.16B}, [x0]
+ urhadd v0.16B, v0.16B, v1.16B
+ urhadd v2.16B, v2.16B, v3.16B
+ sub x0, x0, x2
+ .endif
+ st1 {v0.16B}, [x0], x2
+ st1 {v2.16B}, [x0], x2
+ b.ne 1b
+ ret
+.endm
+
+.macro pixels16_y2 rnd=1, avg=0
+ sub w3, w3, #2
+ ld1 {v0.16B}, [x1], x2
+ ld1 {v1.16B}, [x1], x2
+1: subs w3, w3, #2
+ avg v2.16B, v0.16B, v1.16B
+ ld1 {v0.16B}, [x1], x2
+ avg v3.16B, v0.16B, v1.16B
+ ld1 {v1.16B}, [x1], x2
+ .if \avg
+ ld1 {v4.16B}, [x0], x2
+ ld1 {v5.16B}, [x0]
+ urhadd v2.16B, v2.16B, v4.16B
+ urhadd v3.16B, v3.16B, v5.16B
+ sub x0, x0, x2
+ .endif
+ st1 {v2.16B}, [x0], x2
+ st1 {v3.16B}, [x0], x2
+ b.ne 1b
+
+ avg v2.16B, v0.16B, v1.16B
+ ld1 {v0.16B}, [x1], x2
+ avg v3.16B, v0.16B, v1.16B
+ .if \avg
+ ld1 {v4.16B}, [x0], x2
+ ld1 {v5.16B}, [x0]
+ urhadd v2.16B, v2.16B, v4.16B
+ urhadd v3.16B, v3.16B, v5.16B
+ sub x0, x0, x2
+ .endif
+ st1 {v2.16B}, [x0], x2
+ st1 {v3.16B}, [x0], x2
+
+ ret
+.endm
+
+.macro pixels16_xy2 rnd=1, avg=0
+ sub w3, w3, #2
+ ld1 {v0.16B, v1.16B}, [x1], x2
+ ld1 {v4.16B, v5.16B}, [x1], x2
+NRND movi v26.8H, #1
+ ext v1.16B, v0.16B, v1.16B, #1
+ ext v5.16B, v4.16B, v5.16B, #1
+ uaddl v16.8H, v0.8B, v1.8B
+ uaddl2 v20.8H, v0.16B, v1.16B
+ uaddl v18.8H, v4.8B, v5.8B
+ uaddl2 v22.8H, v4.16B, v5.16B
+1: subs w3, w3, #2
+ ld1 {v0.16B, v1.16B}, [x1], x2
+ add v24.8H, v16.8H, v18.8H
+NRND add v24.8H, v24.8H, v26.8H
+ ext v30.16B, v0.16B, v1.16B, #1
+ add v1.8H, v20.8H, v22.8H
+ mshrn v28.8B, v24.8H, #2
+NRND add v1.8H, v1.8H, v26.8H
+ mshrn2 v28.16B, v1.8H, #2
+ .if \avg
+ ld1 {v16.16B}, [x0]
+ urhadd v28.16B, v28.16B, v16.16B
+ .endif
+ uaddl v16.8H, v0.8B, v30.8B
+ ld1 {v2.16B, v3.16B}, [x1], x2
+ uaddl2 v20.8H, v0.16B, v30.16B
+ st1 {v28.16B}, [x0], x2
+ add v24.8H, v16.8H, v18.8H
+NRND add v24.8H, v24.8H, v26.8H
+ ext v3.16B, v2.16B, v3.16B, #1
+ add v0.8H, v20.8H, v22.8H
+ mshrn v30.8B, v24.8H, #2
+NRND add v0.8H, v0.8H, v26.8H
+ mshrn2 v30.16B, v0.8H, #2
+ .if \avg
+ ld1 {v18.16B}, [x0]
+ urhadd v30.16B, v30.16B, v18.16B
+ .endif
+ uaddl v18.8H, v2.8B, v3.8B
+ uaddl2 v22.8H, v2.16B, v3.16B
+ st1 {v30.16B}, [x0], x2
+ b.gt 1b
+
+ ld1 {v0.16B, v1.16B}, [x1], x2
+ add v24.8H, v16.8H, v18.8H
+NRND add v24.8H, v24.8H, v26.8H
+ ext v30.16B, v0.16B, v1.16B, #1
+ add v1.8H, v20.8H, v22.8H
+ mshrn v28.8B, v24.8H, #2
+NRND add v1.8H, v1.8H, v26.8H
+ mshrn2 v28.16B, v1.8H, #2
+ .if \avg
+ ld1 {v16.16B}, [x0]
+ urhadd v28.16B, v28.16B, v16.16B
+ .endif
+ uaddl v16.8H, v0.8B, v30.8B
+ uaddl2 v20.8H, v0.16B, v30.16B
+ st1 {v28.16B}, [x0], x2
+ add v24.8H, v16.8H, v18.8H
+NRND add v24.8H, v24.8H, v26.8H
+ add v0.8H, v20.8H, v22.8H
+ mshrn v30.8B, v24.8H, #2
+NRND add v0.8H, v0.8H, v26.8H
+ mshrn2 v30.16B, v0.8H, #2
+ .if \avg
+ ld1 {v18.16B}, [x0]
+ urhadd v30.16B, v30.16B, v18.16B
+ .endif
+ st1 {v30.16B}, [x0], x2
+
+ ret
+.endm
+
+.macro pixels8 rnd=1, avg=0
+1: ld1 {v0.8B}, [x1], x2
+ ld1 {v1.8B}, [x1], x2
+ ld1 {v2.8B}, [x1], x2
+ ld1 {v3.8B}, [x1], x2
+ .if \avg
+ ld1 {v4.8B}, [x0], x2
+ urhadd v0.8B, v0.8B, v4.8B
+ ld1 {v5.8B}, [x0], x2
+ urhadd v1.8B, v1.8B, v5.8B
+ ld1 {v6.8B}, [x0], x2
+ urhadd v2.8B, v2.8B, v6.8B
+ ld1 {v7.8B}, [x0], x2
+ urhadd v3.8B, v3.8B, v7.8B
+ sub x0, x0, x2, lsl #2
+ .endif
+ subs w3, w3, #4
+ st1 {v0.8B}, [x0], x2
+ st1 {v1.8B}, [x0], x2
+ st1 {v2.8B}, [x0], x2
+ st1 {v3.8B}, [x0], x2
+ b.ne 1b
+ ret
+.endm
+
+.macro pixels8_x2 rnd=1, avg=0
+1: ld1 {v0.8B, v1.8B}, [x1], x2
+ ext v1.8B, v0.8B, v1.8B, #1
+ ld1 {v2.8B, v3.8B}, [x1], x2
+ ext v3.8B, v2.8B, v3.8B, #1
+ subs w3, w3, #2
+ avg v0.8B, v0.8B, v1.8B
+ avg v2.8B, v2.8B, v3.8B
+ .if \avg
+ ld1 {v4.8B}, [x0], x2
+ ld1 {v5.8B}, [x0]
+ urhadd v0.8B, v0.8B, v4.8B
+ urhadd v2.8B, v2.8B, v5.8B
+ sub x0, x0, x2
+ .endif
+ st1 {v0.8B}, [x0], x2
+ st1 {v2.8B}, [x0], x2
+ b.ne 1b
+ ret
+.endm
+
+.macro pixels8_y2 rnd=1, avg=0
+ sub w3, w3, #2
+ ld1 {v0.8B}, [x1], x2
+ ld1 {v1.8B}, [x1], x2
+1: subs w3, w3, #2
+ avg v4.8B, v0.8B, v1.8B
+ ld1 {v0.8B}, [x1], x2
+ avg v5.8B, v0.8B, v1.8B
+ ld1 {v1.8B}, [x1], x2
+ .if \avg
+ ld1 {v2.8B}, [x0], x2
+ ld1 {v3.8B}, [x0]
+ urhadd v4.8B, v4.8B, v2.8B
+ urhadd v5.8B, v5.8B, v3.8B
+ sub x0, x0, x2
+ .endif
+ st1 {v4.8B}, [x0], x2
+ st1 {v5.8B}, [x0], x2
+ b.ne 1b
+
+ avg v4.8B, v0.8B, v1.8B
+ ld1 {v0.8B}, [x1], x2
+ avg v5.8B, v0.8B, v1.8B
+ .if \avg
+ ld1 {v2.8B}, [x0], x2
+ ld1 {v3.8B}, [x0]
+ urhadd v4.8B, v4.8B, v2.8B
+ urhadd v5.8B, v5.8B, v3.8B
+ sub x0, x0, x2
+ .endif
+ st1 {v4.8B}, [x0], x2
+ st1 {v5.8B}, [x0], x2
+
+ ret
+.endm
+
+.macro pixels8_xy2 rnd=1, avg=0
+ sub w3, w3, #2
+ ld1 {v0.16B}, [x1], x2
+ ld1 {v1.16B}, [x1], x2
+NRND movi v19.8H, #1
+ ext v4.16B, v0.16B, v4.16B, #1
+ ext v6.16B, v1.16B, v6.16B, #1
+ uaddl v16.8H, v0.8B, v4.8B
+ uaddl v17.8H, v1.8B, v6.8B
+1: subs w3, w3, #2
+ ld1 {v0.16B}, [x1], x2
+ add v18.8H, v16.8H, v17.8H
+ ext v4.16B, v0.16B, v4.16B, #1
+NRND add v18.8H, v18.8H, v19.8H
+ uaddl v16.8H, v0.8B, v4.8B
+ mshrn v5.8B, v18.8H, #2
+ ld1 {v1.16B}, [x1], x2
+ add v18.8H, v16.8H, v17.8H
+ .if \avg
+ ld1 {v7.8B}, [x0]
+ urhadd v5.8B, v5.8B, v7.8B
+ .endif
+NRND add v18.8H, v18.8H, v19.8H
+ st1 {v5.8B}, [x0], x2
+ mshrn v7.8B, v18.8H, #2
+ .if \avg
+ ld1 {v5.8B}, [x0]
+ urhadd v7.8B, v7.8B, v5.8B
+ .endif
+ ext v6.16B, v1.16B, v6.16B, #1
+ uaddl v17.8H, v1.8B, v6.8B
+ st1 {v7.8B}, [x0], x2
+ b.gt 1b
+
+ ld1 {v0.16B}, [x1], x2
+ add v18.8H, v16.8H, v17.8H
+ ext v4.16B, v0.16B, v4.16B, #1
+NRND add v18.8H, v18.8H, v19.8H
+ uaddl v16.8H, v0.8B, v4.8B
+ mshrn v5.8B, v18.8H, #2
+ add v18.8H, v16.8H, v17.8H
+ .if \avg
+ ld1 {v7.8B}, [x0]
+ urhadd v5.8B, v5.8B, v7.8B
+ .endif
+NRND add v18.8H, v18.8H, v19.8H
+ st1 {v5.8B}, [x0], x2
+ mshrn v7.8B, v18.8H, #2
+ .if \avg
+ ld1 {v5.8B}, [x0]
+ urhadd v7.8B, v7.8B, v5.8B
+ .endif
+ st1 {v7.8B}, [x0], x2
+
+ ret
+.endm
+
+.macro pixfunc pfx, name, suf, rnd=1, avg=0
+ .if \rnd
+ .macro avg rd, rn, rm
+ urhadd \rd, \rn, \rm
+ .endm
+ .macro mshrn rd, rn, rm
+ rshrn \rd, \rn, \rm
+ .endm
+ .macro mshrn2 rd, rn, rm
+ rshrn2 \rd, \rn, \rm
+ .endm
+ .macro NRND insn:vararg
+ .endm
+ .else
+ .macro avg rd, rn, rm
+ uhadd \rd, \rn, \rm
+ .endm
+ .macro mshrn rd, rn, rm
+ shrn \rd, \rn, \rm
+ .endm
+ .macro mshrn2 rd, rn, rm
+ shrn2 \rd, \rn, \rm
+ .endm
+ .macro NRND insn:vararg
+ \insn
+ .endm
+ .endif
+function ff_\pfx\name\suf\()_neon, export=1
+ \name \rnd, \avg
+endfunc
+ .purgem avg
+ .purgem mshrn
+ .purgem mshrn2
+ .purgem NRND
+.endm
+
+.macro pixfunc2 pfx, name, avg=0
+ pixfunc \pfx, \name, rnd=1, avg=\avg
+ pixfunc \pfx, \name, _no_rnd, rnd=0, avg=\avg
+.endm
+
+function ff_put_h264_qpel16_mc00_neon, export=1
+ mov w3, #16
+endfunc
+
+ pixfunc put_, pixels16, avg=0
+ pixfunc2 put_, pixels16_x2, avg=0
+ pixfunc2 put_, pixels16_y2, avg=0
+ pixfunc2 put_, pixels16_xy2, avg=0
+
+function ff_avg_h264_qpel16_mc00_neon, export=1
+ mov w3, #16
+endfunc
+
+ pixfunc avg_, pixels16, avg=1
+ pixfunc2 avg_, pixels16_x2, avg=1
+ pixfunc2 avg_, pixels16_y2, avg=1
+ pixfunc2 avg_, pixels16_xy2, avg=1
+
+function ff_put_h264_qpel8_mc00_neon, export=1
+ mov w3, #8
+endfunc
+
+ pixfunc put_, pixels8, avg=0
+ pixfunc2 put_, pixels8_x2, avg=0
+ pixfunc2 put_, pixels8_y2, avg=0
+ pixfunc2 put_, pixels8_xy2, avg=0
+
+function ff_avg_h264_qpel8_mc00_neon, export=1
+ mov w3, #8
+endfunc
+
+ pixfunc avg_, pixels8, avg=1
+ pixfunc avg_, pixels8_x2, avg=1
+ pixfunc avg_, pixels8_y2, avg=1
+ pixfunc avg_, pixels8_xy2, avg=1
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/mdct_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/mdct_neon.S
new file mode 100644
index 00000000000..1fd199c972e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/mdct_neon.S
@@ -0,0 +1,323 @@
+/*
+ * AArch64 NEON optimised MDCT
+ * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
+ * Copyright (c) 2014 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "libavutil/aarch64/asm.S"
+
+function ff_imdct_half_neon, export=1
+ sub sp, sp, #32
+ stp x19, x20, [sp]
+ str x30, [sp, #16]
+ mov x12, #1
+ ldr w14, [x0, #28] // mdct_bits
+ ldr x4, [x0, #32] // tcos
+ ldr x3, [x0, #8] // revtab
+ lsl x12, x12, x14 // n = 1 << nbits
+ lsr x14, x12, #2 // n4 = n >> 2
+ add x7, x2, x12, lsl #1
+ mov x12, #-16
+ sub x7, x7, #16
+
+ ld2 {v16.2s,v17.2s}, [x7], x12 // d16=x,n1 d17=x,n0
+ ld2 {v0.2s,v1.2s}, [x2], #16 // d0 =m0,x d1 =m1,x
+ rev64 v17.2s, v17.2s
+ ld2 {v2.2s,v3.2s}, [x4], #16 // d2=c0,c1 d3=s0,s2
+ fmul v6.2s, v17.2s, v2.2s
+ fmul v7.2s, v0.2s, v2.2s
+1:
+ subs x14, x14, #2
+ ldr w6, [x3], #4
+ fmul v4.2s, v0.2s, v3.2s
+ fmul v5.2s, v17.2s, v3.2s
+ fsub v4.2s, v6.2s, v4.2s
+ fadd v5.2s, v5.2s, v7.2s
+ ubfm x8, x6, #16, #31
+ ubfm x6, x6, #0, #15
+ add x8, x1, x8, lsl #3
+ add x6, x1, x6, lsl #3
+ b.eq 2f
+ ld2 {v16.2s,v17.2s}, [x7], x12
+ ld2 {v0.2s,v1.2s}, [x2], #16
+ rev64 v17.2s, v17.2s
+ ld2 {v2.2s,v3.2s}, [x4], #16 // d2=c0,c1 d3=s0,s2
+ fmul v6.2s, v17.2s, v2.2s
+ fmul v7.2s, v0.2s, v2.2s
+ st2 {v4.s,v5.s}[0], [x6]
+ st2 {v4.s,v5.s}[1], [x8]
+ b 1b
+2:
+ st2 {v4.s,v5.s}[0], [x6]
+ st2 {v4.s,v5.s}[1], [x8]
+
+ mov x19, x0
+ mov x20, x1
+ bl X(ff_fft_calc_neon)
+
+ mov x12, #1
+ ldr w14, [x19, #28] // mdct_bits
+ ldr x4, [x19, #32] // tcos
+ lsl x12, x12, x14 // n = 1 << nbits
+ lsr x14, x12, #3 // n8 = n >> 3
+
+ add x4, x4, x14, lsl #3
+ add x6, x20, x14, lsl #3
+ sub x1, x4, #16
+ sub x3, x6, #16
+
+ mov x7, #-16
+ mov x8, x6
+ mov x0, x3
+
+ ld2 {v0.2s,v1.2s}, [x3], x7 // d0 =i1,r1 d1 =i0,r0
+ ld2 {v20.2s,v21.2s},[x6], #16 // d20=i2,r2 d21=i3,r3
+ ld2 {v16.2s,v17.2s},[x1], x7 // d16=c1,c0 d18=s1,s0
+3:
+ subs x14, x14, #2
+ fmul v7.2s, v0.2s, v17.2s
+ ld2 {v18.2s,v19.2s},[x4], #16 // d17=c2,c3 d19=s2,s3
+ fmul v4.2s, v1.2s, v17.2s
+ fmul v6.2s, v21.2s, v19.2s
+ fmul v5.2s, v20.2s, v19.2s
+ fmul v22.2s, v1.2s, v16.2s
+ fmul v23.2s, v21.2s, v18.2s
+ fmul v24.2s, v0.2s, v16.2s
+ fmul v25.2s, v20.2s, v18.2s
+ fadd v7.2s, v7.2s, v22.2s
+ fadd v5.2s, v5.2s, v23.2s
+ fsub v4.2s, v4.2s, v24.2s
+ fsub v6.2s, v6.2s, v25.2s
+ b.eq 4f
+ ld2 {v0.2s,v1.2s}, [x3], x7
+ ld2 {v20.2s,v21.2s},[x6], #16
+ ld2 {v16.2s,v17.2s},[x1], x7 // d16=c1,c0 d18=s1,s0
+ rev64 v5.2s, v5.2s
+ rev64 v7.2s, v7.2s
+ st2 {v4.2s,v5.2s}, [x0], x7
+ st2 {v6.2s,v7.2s}, [x8], #16
+ b 3b
+4:
+ rev64 v5.2s, v5.2s
+ rev64 v7.2s, v7.2s
+ st2 {v4.2s,v5.2s}, [x0]
+ st2 {v6.2s,v7.2s}, [x8]
+
+ ldp x19, x20, [sp]
+ ldr x30, [sp, #16]
+ add sp, sp, #32
+
+ ret
+endfunc
+
+function ff_imdct_calc_neon, export=1
+ sub sp, sp, #32
+ stp x19, x20, [sp]
+ str x30, [sp, #16]
+ ldr w3, [x0, #28] // mdct_bits
+ mov x19, #1
+ mov x20, x1
+ lsl x19, x19, x3
+ add x1, x1, x19
+
+ bl X(ff_imdct_half_neon)
+
+ add x0, x20, x19, lsl #2
+ add x1, x20, x19, lsl #1
+ sub x0, x0, #8
+ sub x2, x1, #16
+ mov x3, #-16
+ mov x6, #-8
+1:
+ ld1 {v0.4s}, [x2], x3
+ prfum pldl1keep, [x0, #-16]
+ rev64 v0.4s, v0.4s
+ ld1 {v2.2s,v3.2s}, [x1], #16
+ fneg v4.4s, v0.4s
+ prfum pldl1keep, [x2, #-16]
+ rev64 v2.2s, v2.2s
+ rev64 v3.2s, v3.2s
+ ext v4.16b, v4.16b, v4.16b, #8
+ st1 {v2.2s}, [x0], x6
+ st1 {v3.2s}, [x0], x6
+ st1 {v4.4s}, [x20], #16
+ subs x19, x19, #16
+ b.gt 1b
+
+ ldp x19, x20, [sp], #16
+ ldr x30, [sp], #16
+
+ ret
+endfunc
+
+
+function ff_mdct_calc_neon, export=1
+ sub sp, sp, #32
+ stp x19, x20, [sp]
+ str x30, [sp, #16]
+
+ mov x12, #1
+ ldr w14, [x0, #28] // mdct_bits
+ ldr x4, [x0, #32] // tcos
+ ldr x3, [x0, #8] // revtab
+ lsl x14, x12, x14 // n = 1 << nbits
+ add x7, x2, x14 // in4u
+ sub x9, x7, #16 // in4d
+ add x2, x7, x14, lsl #1 // in3u
+ add x8, x9, x14, lsl #1 // in3d
+ add x5, x4, x14, lsl #1
+ sub x5, x5, #16
+ sub x3, x3, #4
+ mov x12, #-16
+ lsr x13, x14, #1
+
+ ld2 {v16.2s,v17.2s}, [x9], x12 // in0u0,in0u1 in4d1,in4d0
+ ld2 {v18.2s,v19.2s}, [x8], x12 // in2u0,in2u1 in3d1,in3d0
+ ld2 {v0.2s, v1.2s}, [x7], #16 // in4u0,in4u1 in2d1,in2d0
+ rev64 v17.2s, v17.2s // in4d0,in4d1 in3d0,in3d1
+ rev64 v19.2s, v19.2s // in4d0,in4d1 in3d0,in3d1
+ ld2 {v2.2s, v3.2s}, [x2], #16 // in3u0,in3u1 in1d1,in1d0
+ fsub v0.2s, v17.2s, v0.2s // in4d-in4u I
+ ld2 {v20.2s,v21.2s}, [x4], #16 // c0,c1 s0,s1
+ rev64 v1.2s, v1.2s // in2d0,in2d1 in1d0,in1d1
+ rev64 v3.2s, v3.2s // in2d0,in2d1 in1d0,in1d1
+ ld2 {v30.2s,v31.2s}, [x5], x12 // c2,c3 s2,s3
+ fadd v2.2s, v2.2s, v19.2s // in3u+in3d -R
+ fsub v16.2s, v16.2s, v1.2s // in0u-in2d R
+ fadd v18.2s, v18.2s, v3.2s // in2u+in1d -I
+1:
+ fmul v7.2s, v0.2s, v21.2s // I*s
+ ldr w10, [x3, x13]
+ fmul v6.2s, v2.2s, v20.2s // -R*c
+ ldr w6, [x3, #4]!
+ fmul v4.2s, v2.2s, v21.2s // -R*s
+ fmul v5.2s, v0.2s, v20.2s // I*c
+ fmul v24.2s, v16.2s, v30.2s // R*c
+ fmul v25.2s, v18.2s, v31.2s // -I*s
+ fmul v22.2s, v16.2s, v31.2s // R*s
+ fmul v23.2s, v18.2s, v30.2s // I*c
+ subs x14, x14, #16
+ subs x13, x13, #8
+ fsub v6.2s, v6.2s, v7.2s // -R*c-I*s
+ fadd v7.2s, v4.2s, v5.2s // -R*s+I*c
+ fsub v24.2s, v25.2s, v24.2s // I*s-R*c
+ fadd v25.2s, v22.2s, v23.2s // R*s-I*c
+ b.eq 1f
+ mov x12, #-16
+ ld2 {v16.2s,v17.2s}, [x9], x12 // in0u0,in0u1 in4d1,in4d0
+ ld2 {v18.2s,v19.2s}, [x8], x12 // in2u0,in2u1 in3d1,in3d0
+ fneg v7.2s, v7.2s // R*s-I*c
+ ld2 {v0.2s, v1.2s}, [x7], #16 // in4u0,in4u1 in2d1,in2d0
+ rev64 v17.2s, v17.2s // in4d0,in4d1 in3d0,in3d1
+ rev64 v19.2s, v19.2s // in4d0,in4d1 in3d0,in3d1
+ ld2 {v2.2s, v3.2s}, [x2], #16 // in3u0,in3u1 in1d1,in1d0
+ fsub v0.2s, v17.2s, v0.2s // in4d-in4u I
+ ld2 {v20.2s,v21.2s}, [x4], #16 // c0,c1 s0,s1
+ rev64 v1.2s, v1.2s // in2d0,in2d1 in1d0,in1d1
+ rev64 v3.2s, v3.2s // in2d0,in2d1 in1d0,in1d1
+ ld2 {v30.2s,v31.2s}, [x5], x12 // c2,c3 s2,s3
+ fadd v2.2s, v2.2s, v19.2s // in3u+in3d -R
+ fsub v16.2s, v16.2s, v1.2s // in0u-in2d R
+ fadd v18.2s, v18.2s, v3.2s // in2u+in1d -I
+ ubfm x12, x6, #16, #31
+ ubfm x6, x6, #0, #15
+ add x12, x1, x12, lsl #3
+ add x6, x1, x6, lsl #3
+ st2 {v6.s,v7.s}[0], [x6]
+ st2 {v6.s,v7.s}[1], [x12]
+ ubfm x6, x10, #16, #31
+ ubfm x10, x10, #0, #15
+ add x6 , x1, x6, lsl #3
+ add x10, x1, x10, lsl #3
+ st2 {v24.s,v25.s}[0], [x10]
+ st2 {v24.s,v25.s}[1], [x6]
+ b 1b
+1:
+ fneg v7.2s, v7.2s // R*s-I*c
+ ubfm x12, x6, #16, #31
+ ubfm x6, x6, #0, #15
+ add x12, x1, x12, lsl #3
+ add x6, x1, x6, lsl #3
+ st2 {v6.s,v7.s}[0], [x6]
+ st2 {v6.s,v7.s}[1], [x12]
+ ubfm x6, x10, #16, #31
+ ubfm x10, x10, #0, #15
+ add x6 , x1, x6, lsl #3
+ add x10, x1, x10, lsl #3
+ st2 {v24.s,v25.s}[0], [x10]
+ st2 {v24.s,v25.s}[1], [x6]
+
+ mov x19, x0
+ mov x20, x1
+ bl X(ff_fft_calc_neon)
+
+ mov x12, #1
+ ldr w14, [x19, #28] // mdct_bits
+ ldr x4, [x19, #32] // tcos
+ lsl x12, x12, x14 // n = 1 << nbits
+ lsr x14, x12, #3 // n8 = n >> 3
+
+ add x4, x4, x14, lsl #3
+ add x6, x20, x14, lsl #3
+ sub x1, x4, #16
+ sub x3, x6, #16
+
+ mov x7, #-16
+ mov x8, x6
+ mov x0, x3
+
+ ld2 {v0.2s,v1.2s}, [x3], x7 // d0 =r1,i1 d1 =r0,i0
+ ld2 {v20.2s,v21.2s}, [x6], #16 // d20=r2,i2 d21=r3,i3
+ ld2 {v16.2s,v17.2s}, [x1], x7 // c1,c0 s1,s0
+1:
+ subs x14, x14, #2
+ fmul v7.2s, v0.2s, v17.2s // r1*s1,r0*s0
+ ld2 {v18.2s,v19.2s}, [x4], #16 // c2,c3 s2,s3
+ fmul v4.2s, v1.2s, v17.2s // i1*s1,i0*s0
+ fmul v6.2s, v21.2s, v19.2s // i2*s2,i3*s3
+ fmul v5.2s, v20.2s, v19.2s // r2*s2,r3*s3
+ fmul v24.2s, v0.2s, v16.2s // r1*c1,r0*c0
+ fmul v25.2s, v20.2s, v18.2s // r2*c2,r3*c3
+ fmul v22.2s, v21.2s, v18.2s // i2*c2,i3*c3
+ fmul v23.2s, v1.2s, v16.2s // i1*c1,i0*c0
+ fadd v4.2s, v4.2s, v24.2s // i1*s1+r1*c1,i0*s0+r0*c0
+ fadd v6.2s, v6.2s, v25.2s // i2*s2+r2*c2,i3*s3+r3*c3
+ fsub v5.2s, v22.2s, v5.2s // i2*c2-r2*s2,i3*c3-r3*s3
+ fsub v7.2s, v23.2s, v7.2s // i1*c1-r1*s1,i0*c0-r0*s0
+ fneg v4.2s, v4.2s
+ fneg v6.2s, v6.2s
+ b.eq 1f
+ ld2 {v0.2s, v1.2s}, [x3], x7
+ ld2 {v20.2s,v21.2s}, [x6], #16
+ ld2 {v16.2s,v17.2s}, [x1], x7 // c1,c0 s1,s0
+ rev64 v5.2s, v5.2s
+ rev64 v7.2s, v7.2s
+ st2 {v4.2s,v5.2s}, [x0], x7
+ st2 {v6.2s,v7.2s}, [x8], #16
+ b 1b
+1:
+ rev64 v5.2s, v5.2s
+ rev64 v7.2s, v7.2s
+ st2 {v4.2s,v5.2s}, [x0]
+ st2 {v6.2s,v7.2s}, [x8]
+
+ ldp x19, x20, [sp], #16
+ ldr x30, [sp], #16
+ ret
+endfunc
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/mpegaudiodsp_init.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/mpegaudiodsp_init.c
new file mode 100644
index 00000000000..b94514645fb
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/mpegaudiodsp_init.c
@@ -0,0 +1,39 @@
+/*
+ * 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 "libavutil/attributes.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/mpegaudiodsp.h"
+#include "config.h"
+
+void ff_mpadsp_apply_window_fixed_neon(int32_t *synth_buf, int32_t *window,
+ int *dither, int16_t *samples, int incr);
+void ff_mpadsp_apply_window_float_neon(float *synth_buf, float *window,
+ int *dither, float *samples, int incr);
+
+av_cold void ff_mpadsp_init_aarch64(MPADSPContext *s)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ s->apply_window_fixed = ff_mpadsp_apply_window_fixed_neon;
+ s->apply_window_float = ff_mpadsp_apply_window_float_neon;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/mpegaudiodsp_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/mpegaudiodsp_neon.S
new file mode 100644
index 00000000000..e540eb8c011
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/mpegaudiodsp_neon.S
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2014 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "libavutil/aarch64/asm.S"
+
+#define FRAC_BITS 23 // fractional bits for sb_samples and dct
+#define WFRAC_BITS 16 // fractional bits for window
+#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15)
+
+const tbl_rev128.s align=4
+ .byte 12, 13, 14, 15
+ .byte 8, 9, 10, 11
+ .byte 4, 5, 6, 7
+ .byte 0, 1, 2, 3
+endconst
+
+.macro apply_window type, st
+function ff_mpadsp_apply_window_\type\()_neon, export=1
+ mov x7, x0
+ sxtw x4, w4 // incr
+ add x8, x0, #512<<2
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x7], #64
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x7], #64
+ st1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x8], #64
+ st1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x8], #64
+ movrel x15, tbl_rev128.s
+ ld1 {v27.4s}, [x15]
+.ifc \type, fixed
+ lsl x4, x4, #1
+.else
+ lsl x4, x4, #2
+.endif
+ add x10, x0, #45<<2
+ add x0, x0, #16<<2
+ add x1, x1, #16<<2
+ add x5, x3, x4, lsl #5
+ sub x5, x5, x4 // samples2
+ neg x13, x4 // -incr
+ mov x9, #64<<2
+.ifc \type, fixed
+ ld1r {v16.2s}, [x2] // dither_state
+ sxtl v16.2d, v16.2s
+ movi v29.2d, #0
+ movi v30.2d, #(1<<OUT_SHIFT)-1
+ trn1 v31.2d, v29.2d, v30.2d
+ trn2 v30.2d, v30.2d, v29.2d
+ trn1 v16.2d, v16.2d, v29.2d
+.else
+ movi v16.4s, #0
+ movi v28.4s, #0
+.endif
+ mov x14, #4
+1:
+ mov x8, x0
+ sub x7, x1, #3<<2
+ sub x6, x1, x14, lsl #4
+ add x7, x7, x14, lsl #4
+ add x11, x6, #(32)<<2 // w + 32
+ add x12, x7, #(32)<<2 // w2 + 32
+ mov x15, #8
+ movi v17.2d, #0
+ movi v18.2d, #0
+ movi v19.2d, #0
+2:
+ subs x15, x15, #1
+ ld1 {v0.4s}, [x8], x9
+ ld1 {v1.4s}, [x10], x9
+ ld1 {v2.4s}, [x6], x9
+ ld1 {v3.4s}, [x7], x9
+ tbl v6.16b, {v0.16b}, v27.16b
+ tbl v7.16b, {v1.16b}, v27.16b
+ ld1 {v4.4s}, [x11], x9
+ ld1 {v5.4s}, [x12], x9
+ MLA v16, v2, v0
+ MLA2 v17, v2, v0
+ MLS v18, v3, v6
+ MLS2 v19, v3, v6
+ MLS v16, v4, v7
+ MLS2 v17, v4, v7
+ MLS v18, v5, v1
+ MLS2 v19, v5, v1
+ b.gt 2b
+
+ cmp x14, #4
+ sub x10, x10, #64<<5 // 64 * 8 * sizeof(int32_t)
+
+.ifc \type, fixed
+ and v28.16b, v16.16b, v30.16b
+ ext v28.16b, v29.16b, v28.16b, #8
+
+ b.eq 4f
+ round_sample v19, 1, 1
+4:
+ round_sample v16, 1, 0
+ shrn v16.2s, v16.2d, #OUT_SHIFT
+ round_sample v19, 0, 0
+ shrn v19.2s, v19.2d, #OUT_SHIFT
+ round_sample v17, 0, 1
+ round_sample v18, 1, 1
+ round_sample v17, 1, 0
+ shrn2 v16.4s, v17.2d, #OUT_SHIFT
+ round_sample v18, 0, 0
+ shrn2 v19.4s, v18.2d, #OUT_SHIFT
+ sqxtn v16.4h, v16.4s
+ sqxtn v18.4h, v19.4s
+.else
+ ext v18.16b, v18.16b, v18.16b, #8
+.endif
+
+ st1 {v16.\st\()}[0], [x3], x4
+ b.eq 4f
+ st1 {v18.\st\()}[1], [x5], x13
+4:
+ st1 {v16.\st\()}[1], [x3], x4
+ st1 {v18.\st\()}[0], [x5], x13
+ st1 {v16.\st\()}[2], [x3], x4
+ st1 {v18.\st\()}[3], [x5], x13
+ st1 {v16.\st\()}[3], [x3], x4
+ st1 {v18.\st\()}[2], [x5], x13
+
+ mov v16.16b, v28.16b
+
+ subs x14, x14, #1
+ add x0, x0, #4<<2
+ sub x10, x10, #4<<2
+ b.gt 1b
+
+// comuting samples[16]
+ add x6, x1, #32<<2
+ ld1 {v0.2s}, [x6], x9
+ ld1 {v1.2s}, [x0], x9
+.rept 3
+ ld1 {v2.2s}, [x6], x9
+ ld1 {v3.2s}, [x0], x9
+ MLS v16, v0, v1
+ ld1 {v0.2s}, [x6], x9
+ ld1 {v1.2s}, [x0], x9
+ MLS v16, v2, v3
+.endr
+ ld1 {v2.2s}, [x6], x9
+ ld1 {v3.2s}, [x0], x9
+ MLS v16, v0, v1
+ MLS v16, v2, v3
+
+.ifc \type, fixed
+ and v28.16b, v16.16b, v30.16b
+ shrn v20.2s, v16.2d, #OUT_SHIFT
+ xtn v28.2s, v28.2d
+ sqxtn v20.4h, v20.4s
+ st1 {v28.s}[0], [x2] // save dither_state
+ st1 {v20.h}[0], [x3]
+.else
+ st1 {v16.s}[0], [x3]
+.endif
+
+ ret
+endfunc
+.purgem round_sample
+.purgem MLA
+.purgem MLA2
+.purgem MLS
+.purgem MLS2
+.endm
+
+
+.macro round_sample r, idx, next
+ add \r\().2d, \r\().2d, v28.2d
+.if \idx == 0
+ and v28.16b, \r\().16b, v30.16b
+.else // \idx == 1
+ and v28.16b, \r\().16b, v31.16b
+.endif
+.if \idx != \next
+ .if \next == 0
+ ext v28.16b, v28.16b, v29.16b, #8
+ .else
+ ext v28.16b, v29.16b, v28.16b, #8
+ .endif
+.endif
+.endm
+.macro MLA d, s1, s2
+ smlal \d\().2d, \s1\().2s, \s2\().2s
+.endm
+.macro MLA2 d, s1, s2
+ smlal2 \d\().2d, \s1\().4s, \s2\().4s
+.endm
+.macro MLS d, s1, s2
+ smlsl \d\().2d, \s1\().2s, \s2\().2s
+.endm
+.macro MLS2 d, s1, s2
+ smlsl2 \d\().2d, \s1\().4s, \s2\().4s
+.endm
+apply_window fixed, h
+
+
+// nothing to do for round_sample and ML{A,S}2
+.macro round_sample r, idx, next
+.endm
+.macro MLA2 d, s1, s2
+.endm
+.macro MLS2 d, s1, s2
+.endm
+.macro MLA d, s1, s2
+ fmla \d\().4s, \s1\().4s, \s2\().4s
+.endm
+.macro MLS d, s1, s2
+ fmls \d\().4s, \s1\().4s, \s2\().4s
+.endm
+apply_window float, s
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/neon.S
new file mode 100644
index 00000000000..619aec64269
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/neon.S
@@ -0,0 +1,149 @@
+/*
+ * 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
+ */
+
+.macro transpose_8x8B r0, r1, r2, r3, r4, r5, r6, r7, r8, r9
+ trn1 \r8\().8B, \r0\().8B, \r1\().8B
+ trn2 \r9\().8B, \r0\().8B, \r1\().8B
+ trn1 \r1\().8B, \r2\().8B, \r3\().8B
+ trn2 \r3\().8B, \r2\().8B, \r3\().8B
+ trn1 \r0\().8B, \r4\().8B, \r5\().8B
+ trn2 \r5\().8B, \r4\().8B, \r5\().8B
+ trn1 \r2\().8B, \r6\().8B, \r7\().8B
+ trn2 \r7\().8B, \r6\().8B, \r7\().8B
+
+ trn1 \r4\().4H, \r0\().4H, \r2\().4H
+ trn2 \r2\().4H, \r0\().4H, \r2\().4H
+ trn1 \r6\().4H, \r5\().4H, \r7\().4H
+ trn2 \r7\().4H, \r5\().4H, \r7\().4H
+ trn1 \r5\().4H, \r9\().4H, \r3\().4H
+ trn2 \r9\().4H, \r9\().4H, \r3\().4H
+ trn1 \r3\().4H, \r8\().4H, \r1\().4H
+ trn2 \r8\().4H, \r8\().4H, \r1\().4H
+
+ trn1 \r0\().2S, \r3\().2S, \r4\().2S
+ trn2 \r4\().2S, \r3\().2S, \r4\().2S
+
+ trn1 \r1\().2S, \r5\().2S, \r6\().2S
+ trn2 \r5\().2S, \r5\().2S, \r6\().2S
+
+ trn2 \r6\().2S, \r8\().2S, \r2\().2S
+ trn1 \r2\().2S, \r8\().2S, \r2\().2S
+
+ trn1 \r3\().2S, \r9\().2S, \r7\().2S
+ trn2 \r7\().2S, \r9\().2S, \r7\().2S
+.endm
+
+.macro transpose_8x16B r0, r1, r2, r3, r4, r5, r6, r7, t0, t1
+ trn1 \t0\().16B, \r0\().16B, \r1\().16B
+ trn2 \t1\().16B, \r0\().16B, \r1\().16B
+ trn1 \r1\().16B, \r2\().16B, \r3\().16B
+ trn2 \r3\().16B, \r2\().16B, \r3\().16B
+ trn1 \r0\().16B, \r4\().16B, \r5\().16B
+ trn2 \r5\().16B, \r4\().16B, \r5\().16B
+ trn1 \r2\().16B, \r6\().16B, \r7\().16B
+ trn2 \r7\().16B, \r6\().16B, \r7\().16B
+
+ trn1 \r4\().8H, \r0\().8H, \r2\().8H
+ trn2 \r2\().8H, \r0\().8H, \r2\().8H
+ trn1 \r6\().8H, \r5\().8H, \r7\().8H
+ trn2 \r7\().8H, \r5\().8H, \r7\().8H
+ trn1 \r5\().8H, \t1\().8H, \r3\().8H
+ trn2 \t1\().8H, \t1\().8H, \r3\().8H
+ trn1 \r3\().8H, \t0\().8H, \r1\().8H
+ trn2 \t0\().8H, \t0\().8H, \r1\().8H
+
+ trn1 \r0\().4S, \r3\().4S, \r4\().4S
+ trn2 \r4\().4S, \r3\().4S, \r4\().4S
+
+ trn1 \r1\().4S, \r5\().4S, \r6\().4S
+ trn2 \r5\().4S, \r5\().4S, \r6\().4S
+
+ trn2 \r6\().4S, \t0\().4S, \r2\().4S
+ trn1 \r2\().4S, \t0\().4S, \r2\().4S
+
+ trn1 \r3\().4S, \t1\().4S, \r7\().4S
+ trn2 \r7\().4S, \t1\().4S, \r7\().4S
+.endm
+
+.macro transpose_4x16B r0, r1, r2, r3, t4, t5, t6, t7
+ trn1 \t4\().16B, \r0\().16B, \r1\().16B
+ trn2 \t5\().16B, \r0\().16B, \r1\().16B
+ trn1 \t6\().16B, \r2\().16B, \r3\().16B
+ trn2 \t7\().16B, \r2\().16B, \r3\().16B
+
+ trn1 \r0\().8H, \t4\().8H, \t6\().8H
+ trn2 \r2\().8H, \t4\().8H, \t6\().8H
+ trn1 \r1\().8H, \t5\().8H, \t7\().8H
+ trn2 \r3\().8H, \t5\().8H, \t7\().8H
+.endm
+
+.macro transpose_4x8B r0, r1, r2, r3, t4, t5, t6, t7
+ trn1 \t4\().8B, \r0\().8B, \r1\().8B
+ trn2 \t5\().8B, \r0\().8B, \r1\().8B
+ trn1 \t6\().8B, \r2\().8B, \r3\().8B
+ trn2 \t7\().8B, \r2\().8B, \r3\().8B
+
+ trn1 \r0\().4H, \t4\().4H, \t6\().4H
+ trn2 \r2\().4H, \t4\().4H, \t6\().4H
+ trn1 \r1\().4H, \t5\().4H, \t7\().4H
+ trn2 \r3\().4H, \t5\().4H, \t7\().4H
+.endm
+
+.macro transpose_4x4H r0, r1, r2, r3, r4, r5, r6, r7
+ trn1 \r4\().4H, \r0\().4H, \r1\().4H
+ trn2 \r5\().4H, \r0\().4H, \r1\().4H
+ trn1 \r7\().4H, \r3\().4H, \r2\().4H
+ trn2 \r6\().4H, \r3\().4H, \r2\().4H
+ trn1 \r0\().2S, \r4\().2S, \r7\().2S
+ trn2 \r3\().2S, \r4\().2S, \r7\().2S
+ trn1 \r1\().2S, \r5\().2S, \r6\().2S
+ trn2 \r2\().2S, \r5\().2S, \r6\().2S
+.endm
+
+.macro transpose_8x8H r0, r1, r2, r3, r4, r5, r6, r7, r8, r9
+ trn1 \r8\().8H, \r0\().8H, \r1\().8H
+ trn2 \r9\().8H, \r0\().8H, \r1\().8H
+ trn1 \r1\().8H, \r2\().8H, \r3\().8H
+ trn2 \r3\().8H, \r2\().8H, \r3\().8H
+ trn1 \r0\().8H, \r4\().8H, \r5\().8H
+ trn2 \r5\().8H, \r4\().8H, \r5\().8H
+ trn1 \r2\().8H, \r6\().8H, \r7\().8H
+ trn2 \r7\().8H, \r6\().8H, \r7\().8H
+
+ trn1 \r4\().4S, \r0\().4S, \r2\().4S
+ trn2 \r2\().4S, \r0\().4S, \r2\().4S
+ trn1 \r6\().4S, \r5\().4S, \r7\().4S
+ trn2 \r7\().4S, \r5\().4S, \r7\().4S
+ trn1 \r5\().4S, \r9\().4S, \r3\().4S
+ trn2 \r9\().4S, \r9\().4S, \r3\().4S
+ trn1 \r3\().4S, \r8\().4S, \r1\().4S
+ trn2 \r8\().4S, \r8\().4S, \r1\().4S
+
+ trn1 \r0\().2D, \r3\().2D, \r4\().2D
+ trn2 \r4\().2D, \r3\().2D, \r4\().2D
+
+ trn1 \r1\().2D, \r5\().2D, \r6\().2D
+ trn2 \r5\().2D, \r5\().2D, \r6\().2D
+
+ trn2 \r6\().2D, \r8\().2D, \r2\().2D
+ trn1 \r2\().2D, \r8\().2D, \r2\().2D
+
+ trn1 \r3\().2D, \r9\().2D, \r7\().2D
+ trn2 \r7\().2D, \r9\().2D, \r7\().2D
+
+.endm
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/neontest.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/neontest.c
new file mode 100644
index 00000000000..6e41f3736e5
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/neontest.c
@@ -0,0 +1,79 @@
+/*
+ * check NEON registers for clobbers
+ * Copyright (c) 2013 Martin Storsjo
+ *
+ * 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 "libavcodec/avcodec.h"
+#include "libavutil/aarch64/neontest.h"
+
+wrap(avcodec_open2(AVCodecContext *avctx,
+ AVCodec *codec,
+ AVDictionary **options))
+{
+ testneonclobbers(avcodec_open2, avctx, codec, options);
+}
+
+wrap(avcodec_decode_audio4(AVCodecContext *avctx,
+ AVFrame *frame,
+ int *got_frame_ptr,
+ AVPacket *avpkt))
+{
+ testneonclobbers(avcodec_decode_audio4, avctx, frame,
+ got_frame_ptr, avpkt);
+}
+
+wrap(avcodec_decode_video2(AVCodecContext *avctx,
+ AVFrame *picture,
+ int *got_picture_ptr,
+ AVPacket *avpkt))
+{
+ testneonclobbers(avcodec_decode_video2, avctx, picture,
+ got_picture_ptr, avpkt);
+}
+
+wrap(avcodec_decode_subtitle2(AVCodecContext *avctx,
+ AVSubtitle *sub,
+ int *got_sub_ptr,
+ AVPacket *avpkt))
+{
+ testneonclobbers(avcodec_decode_subtitle2, avctx, sub,
+ got_sub_ptr, avpkt);
+}
+
+wrap(avcodec_encode_audio2(AVCodecContext *avctx,
+ AVPacket *avpkt,
+ const AVFrame *frame,
+ int *got_packet_ptr))
+{
+ testneonclobbers(avcodec_encode_audio2, avctx, avpkt, frame,
+ got_packet_ptr);
+}
+
+wrap(avcodec_encode_subtitle(AVCodecContext *avctx,
+ uint8_t *buf, int buf_size,
+ const AVSubtitle *sub))
+{
+ testneonclobbers(avcodec_encode_subtitle, avctx, buf, buf_size, sub);
+}
+
+wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
+ const AVFrame *frame, int *got_packet_ptr))
+{
+ testneonclobbers(avcodec_encode_video2, avctx, avpkt, frame, got_packet_ptr);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/opus_imdct_init.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/opus_imdct_init.c
new file mode 100644
index 00000000000..3fa9a11b2f1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/opus_imdct_init.c
@@ -0,0 +1,45 @@
+/*
+ * 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 <stddef.h>
+
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavutil/internal.h"
+#include "libavcodec/opus_imdct.h"
+
+#include "asm-offsets.h"
+
+AV_CHECK_OFFSET(CeltIMDCTContext, exptab, CELT_EXPTAB);
+AV_CHECK_OFFSET(CeltIMDCTContext, fft_n, CELT_FFT_N);
+AV_CHECK_OFFSET(CeltIMDCTContext, len2, CELT_LEN2);
+AV_CHECK_OFFSET(CeltIMDCTContext, len4, CELT_LEN4);
+AV_CHECK_OFFSET(CeltIMDCTContext, tmp, CELT_TMP);
+AV_CHECK_OFFSET(CeltIMDCTContext, twiddle_exptab, CELT_TWIDDLE);
+
+void ff_celt_imdct_half_neon(CeltIMDCTContext *s, float *dst, const float *src,
+ ptrdiff_t stride, float scale);
+
+void ff_celt_imdct_init_aarch64(CeltIMDCTContext *s)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ s->imdct_half = ff_celt_imdct_half_neon;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/opus_imdct_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/opus_imdct_neon.S
new file mode 100644
index 00000000000..ff1f7054a89
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/opus_imdct_neon.S
@@ -0,0 +1,647 @@
+/*
+ * Copyright (c) 2014 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "libavutil/aarch64/asm.S"
+
+#include "asm-offsets.h"
+
+.macro shuffle a, b, c, d
+const shuffle_\a\b\c\d align=4
+ .byte (\a * 4), (\a * 4 + 1), (\a * 4 + 2), (\a * 4 + 3)
+ .byte (\b * 4), (\b * 4 + 1), (\b * 4 + 2), (\b * 4 + 3)
+ .byte (\c * 4), (\c * 4 + 1), (\c * 4 + 2), (\c * 4 + 3)
+ .byte (\d * 4), (\d * 4 + 1), (\d * 4 + 2), (\d * 4 + 3)
+endconst
+.endm
+
+shuffle 0, 2, 1, 3
+shuffle 1, 0, 3, 2
+shuffle 2, 3, 0, 1
+shuffle 3, 1, 2, 0
+
+
+function fft5_neon
+ lsl x2, x2, #3
+ ld1 {v24.2s}, [x1], x2
+ ld2 {v25.s,v26.s}[0], [x1], x2
+ ld2 {v25.s,v26.s}[1], [x1], x2
+ ld2 {v25.s,v26.s}[2], [x1], x2
+ ld2 {v25.s,v26.s}[3], [x1]
+ dup v6.4s, v24.s[0]
+ dup v7.4s, v24.s[1]
+
+ faddp v0.4s, v25.4s, v26.4s
+ // z[][0], z[][3]
+ fmul v16.4s, v25.4s, v15.s[0] // rr
+ fmul v17.4s, v25.4s, v15.s[1] // ri
+ fmul v18.4s, v26.4s, v15.s[0] // ir
+ fmul v19.4s, v26.4s, v15.s[1] // ii
+ faddp v0.4s, v0.4s, v0.4s
+ // z[][1], z[][2]
+ fmul v20.4s, v25.4s, v15.s[2] // rr
+ fmul v21.4s, v25.4s, v15.s[3] // ri
+ fmul v22.4s, v26.4s, v15.s[2] // ir
+ fmul v23.4s, v26.4s, v15.s[3] // ii
+ fadd v0.2s, v24.2s, v0.2s // out[0]
+
+ // z[0123][0], z[0123][3]
+ fsub v24.4s, v16.4s, v19.4s // (c).re = rr - ii;
+ fadd v27.4s, v16.4s, v19.4s // (d).re = rr + ii;
+ ld1 {v16.16b}, [x11]
+ ld1 {v19.16b}, [x14]
+ fadd v28.4s, v17.4s, v18.4s // (c).im = ri + ir;
+ fsub v31.4s, v18.4s, v17.4s // (d).im = -ri + ir;
+ ld1 {v17.16b}, [x12]
+ // z[0123][1], z[0123][2]
+ fsub v25.4s, v20.4s, v23.4s // (c).re = rr - ii;
+ fadd v26.4s, v20.4s, v23.4s // (d).re = rr + ii;
+ ld1 {v18.16b}, [x13]
+ fadd v29.4s, v21.4s, v22.4s // (c).im = ri + ir;
+ fsub v30.4s, v22.4s, v21.4s // (d).im = -ri + ir;
+
+ //real
+ tbl v20.16b, {v24.16b}, v16.16b
+ tbl v21.16b, {v25.16b}, v17.16b
+ tbl v22.16b, {v26.16b}, v18.16b
+ tbl v23.16b, {v27.16b}, v19.16b
+ //imag
+ tbl v16.16b, {v28.16b}, v16.16b
+ tbl v17.16b, {v29.16b}, v17.16b
+ tbl v18.16b, {v30.16b}, v18.16b
+ tbl v19.16b, {v31.16b}, v19.16b
+
+ fadd v6.4s, v6.4s, v20.4s
+ fadd v22.4s, v22.4s, v23.4s
+ fadd v7.4s, v7.4s, v16.4s
+ fadd v18.4s, v18.4s, v19.4s
+
+ fadd v21.4s, v21.4s, v22.4s
+ fadd v17.4s, v17.4s, v18.4s
+ fadd v6.4s, v6.4s, v21.4s
+ fadd v7.4s, v7.4s, v17.4s
+
+ ret
+endfunc
+
+function fft15_neon
+ mov x8, x1
+ mov x9, x30
+ add x2, x3, x3, lsl #1 // 3 * stride
+
+ add x1, x8, x3, lsl #3 // in + 1 * stride
+ bl fft5_neon
+ mov v1.8b, v0.8b
+ mov v2.16b, v6.16b
+ mov v3.16b, v7.16b
+
+ add x1, x8, x3, lsl #4 // in + 2 * stride
+ add x2, x3, x3, lsl #1 // 3 * stride
+ bl fft5_neon
+ zip1 v1.4s, v1.4s, v0.4s
+ mov v4.16b, v6.16b
+ mov v5.16b, v7.16b
+
+ mov x1, x8 // in + 0 * stride
+ add x2, x3, x3, lsl #1 // 3 * stride
+ bl fft5_neon
+
+ faddp v20.4s, v1.4s, v1.4s
+
+ ext v18.16b, v8.16b, v8.16b, #4
+ ext v19.16b, v9.16b, v9.16b, #4
+ mov v16.16b, v6.16b
+ mov v17.16b, v7.16b
+ fadd v20.2s, v20.2s, v0.2s
+
+ uzp1 v18.4s, v18.4s, v10.4s // exp[2,4,6,8].re
+ uzp1 v19.4s, v19.4s, v11.4s // exp[2,4,6,8].im
+
+ st1 {v20.2s}, [x0], #8 // out[0]
+
+ fmla v16.4s, v2.4s, v8.4s
+ fmls v16.4s, v3.4s, v9.4s
+
+ fmla v17.4s, v2.4s, v9.4s
+ fmla v17.4s, v3.4s, v8.4s
+
+ fmla v16.4s, v4.4s, v18.4s
+ fmls v16.4s, v5.4s, v19.4s
+
+ fmla v17.4s, v4.4s, v19.4s
+ fmla v17.4s, v5.4s, v18.4s
+
+ zip1 v18.4s, v16.4s, v17.4s
+ zip2 v19.4s, v16.4s, v17.4s
+
+ rev64 v31.4s, v14.4s
+ trn1 v28.2d, v1.2d, v1.2d
+ trn2 v29.2d, v1.2d, v1.2d
+ zip1 v30.2d, v14.2d, v31.2d
+ zip2 v31.2d, v14.2d, v31.2d
+
+ st1 {v18.4s,v19.4s}, [x0], #32 // out[1-4]
+
+ fmul v16.4s, v28.4s, v30.4s
+ fmul v17.4s, v29.4s, v30.4s
+ fmls v16.4s, v29.4s, v31.4s
+ fmla v17.4s, v28.4s, v31.4s
+ faddp v16.4s, v16.4s, v16.4s
+ faddp v17.4s, v17.4s, v17.4s
+ zip1 v18.2s, v16.2s, v17.2s
+ zip2 v19.2s, v16.2s, v17.2s
+
+ fadd v18.2s, v18.2s, v0.2s
+ fadd v0.2s, v19.2s, v0.2s
+
+ ext v30.16b, v12.16b, v12.16b, #4
+ ext v31.16b, v13.16b, v13.16b, #4
+ mov v16.16b, v6.16b
+ mov v17.16b, v7.16b
+
+ uzp1 v30.4s, v30.4s, v8.4s
+ uzp1 v31.4s, v31.4s, v9.4s
+
+ st1 {v18.2s}, [x0], #8 // out[5]
+
+ fmla v16.4s, v2.4s, v10.4s
+ fmls v16.4s, v3.4s, v11.4s
+
+ fmla v17.4s, v2.4s, v11.4s
+ fmla v17.4s, v3.4s, v10.4s
+
+ fmla v16.4s, v4.4s, v30.4s
+ fmls v16.4s, v5.4s, v31.4s
+
+ fmla v17.4s, v4.4s, v31.4s
+ fmla v17.4s, v5.4s, v30.4s
+
+ zip1 v18.4s, v16.4s, v17.4s
+ zip2 v19.4s, v16.4s, v17.4s
+
+ ext v30.16b, v10.16b, v10.16b, #4
+ ext v31.16b, v11.16b, v11.16b, #4
+
+ fmla v6.4s, v2.4s, v12.4s
+ fmls v6.4s, v3.4s, v13.4s
+
+ st1 {v18.4s,v19.4s}, [x0], #32 // out[6-9]
+
+ uzp1 v30.4s, v30.4s, v12.4s
+ uzp1 v31.4s, v31.4s, v13.4s
+
+ fmla v7.4s, v2.4s, v13.4s
+ fmla v7.4s, v3.4s, v12.4s
+
+ st1 {v0.2s}, [x0], #8 // out[10]
+
+ fmla v6.4s, v4.4s, v30.4s
+ fmls v6.4s, v5.4s, v31.4s
+
+ fmla v7.4s, v4.4s, v31.4s
+ fmla v7.4s, v5.4s, v30.4s
+
+ zip1 v18.4s, v6.4s, v7.4s
+ zip2 v19.4s, v6.4s, v7.4s
+
+ st1 {v18.4s,v19.4s}, [x0], #32 // out[11-14]
+
+ ret x9
+endfunc
+
+// x0: out, x1: out+len2, x2: exptab, x3: len2
+function fft15_pass
+ ands x6, x3, #3
+ mov x4, x0
+ mov x5, x1
+ b.eq 9f
+ ld1 {v0.2s}, [x0], #8
+ ld1 {v1.2s}, [x1], #8
+ sub x3, x3, x6
+ subs x6, x6, #1
+ fadd v2.2s, v0.2s, v1.2s
+ fsub v3.2s, v0.2s, v1.2s
+ add x2, x2, #8
+ st1 {v2.2s}, [x4], #8
+ st1 {v3.2s}, [x5], #8
+ b.eq 9f
+1:
+ subs x6, x6, #1
+ ldp s4, s5, [x2], #8
+ ldp s2, s3, [x1], #8
+ ldp s0, s1, [x0], #8
+
+ fmul s6, s2, s4
+ fmul s7, s2, s5
+ fmls s6, s3, v5.s[0]
+ fmla s7, s3, v4.s[0]
+
+ fsub s2, s0, s6
+ fsub s3, s1, s7
+ fadd s0, s0, s6
+ fadd s1, s1, s7
+
+ stp s2, s3, [x5], #8
+ stp s0, s1, [x4], #8
+ b.gt 1b
+9:
+ ld1 {v4.4s,v5.4s}, [x2], #32
+ ld2 {v2.4s,v3.4s}, [x1], #32
+ uzp1 v6.4s, v4.4s, v5.4s
+ uzp2 v7.4s, v4.4s, v5.4s
+ ld2 {v0.4s,v1.4s}, [x0], #32
+8:
+ subs x3, x3, #8
+
+ fmul v4.4s, v2.4s, v6.4s
+ fmul v5.4s, v2.4s, v7.4s
+ b.lt 4f
+
+ ld1 {v18.4s,v19.4s}, [x2], #32
+
+ fmls v4.4s, v3.4s, v7.4s
+ fmla v5.4s, v3.4s, v6.4s
+
+ ld2 {v22.4s,v23.4s}, [x1], #32
+
+ fsub v2.4s, v0.4s, v4.4s
+ fadd v0.4s, v0.4s, v4.4s
+ fsub v3.4s, v1.4s, v5.4s
+ fadd v1.4s, v1.4s, v5.4s
+
+ uzp1 v16.4s, v18.4s, v19.4s
+ uzp2 v17.4s, v18.4s, v19.4s
+
+ st2 {v2.4s,v3.4s}, [x5], #32
+ st2 {v0.4s,v1.4s}, [x4], #32
+ ld2 {v20.4s,v21.4s}, [x0], #32
+
+ fmul v18.4s, v22.4s, v16.4s
+ fmul v19.4s, v22.4s, v17.4s
+ b.eq 0f
+
+ ld1 {v4.4s,v5.4s}, [x2], #32
+
+ fmls v18.4s, v23.4s, v17.4s
+ fmla v19.4s, v23.4s, v16.4s
+
+ ld2 {v2.4s,v3.4s}, [x1], #32
+
+ fsub v22.4s, v20.4s, v18.4s
+ fadd v20.4s, v20.4s, v18.4s
+ fsub v23.4s, v21.4s, v19.4s
+ fadd v21.4s, v21.4s, v19.4s
+
+ uzp1 v6.4s, v4.4s, v5.4s
+ uzp2 v7.4s, v4.4s, v5.4s
+
+ st2 {v22.4s,v23.4s}, [x5], #32
+ st2 {v20.4s,v21.4s}, [x4], #32
+ ld2 {v0.4s,v1.4s}, [x0], #32
+
+ b 8b
+4:
+ fmls v4.4s, v3.4s, v7.4s
+ fmla v5.4s, v3.4s, v6.4s
+
+ fsub v2.4s, v0.4s, v4.4s
+ fadd v0.4s, v0.4s, v4.4s
+ fsub v3.4s, v1.4s, v5.4s
+ fadd v1.4s, v1.4s, v5.4s
+
+ st2 {v2.4s,v3.4s}, [x5], #32
+ st2 {v0.4s,v1.4s}, [x4], #32
+
+ ret
+0:
+ fmls v18.4s, v23.4s, v17.4s
+ fmla v19.4s, v23.4s, v16.4s
+
+ fsub v22.4s, v20.4s, v18.4s
+ fadd v20.4s, v20.4s, v18.4s
+ fsub v23.4s, v21.4s, v19.4s
+ fadd v21.4s, v21.4s, v19.4s
+
+ st2 {v22.4s,v23.4s}, [x5], #32
+ st2 {v20.4s,v21.4s}, [x4], #32
+
+ ret
+endfunc
+
+function fft30_neon align=6
+ sub sp, sp, #0x20
+ stp x20, x21, [sp]
+ stp x22, x30, [sp, #0x10]
+ mov x21, x1
+ mov x22, x2
+ mov x20, x4
+ mov x0, x21
+ mov x1, x22
+ lsl x3, x20, #1
+ bl fft15_neon
+
+ add x0, x21, #15*8
+ add x1, x22, x20, lsl #3
+ lsl x3, x20, #1
+ bl fft15_neon
+
+ ldr x2, [x10, #(CELT_EXPTAB + 8)] // s->exptab[1]
+ add x0, x21, #0
+ add x1, x21, #15*8
+ mov x3, #15
+ ldp x20, x21, [sp]
+ ldp x22, x30, [sp, #0x10]
+ add sp, sp, #0x20
+ b fft15_pass
+endfunc
+
+.macro def_fft n, n2
+function fft\n\()_neon align=6
+ sub sp, sp, #0x30
+ stp x20, x21, [sp]
+ stp x22, x30, [sp, #0x10]
+ stp x23, x24, [sp, #0x20]
+ mov x21, x1
+ mov x22, x2
+ mov x23, x3
+ mov x20, x4
+ sub x3, x3, #1
+ lsl x4, x4, #1
+ bl fft\n2\()_neon
+
+ add x1, x21, #(\n2 * 8)
+ add x2, x22, x20, lsl #3
+ sub x3, x23, #1
+ lsl x4, x20, #1
+ bl fft\n2\()_neon
+
+ add x5, x10, #CELT_EXPTAB
+ mov x0, x21
+ ldr x2, [x5, x23, lsl #3] // s->exptab[N]
+ add x1, x21, #(\n2 * 8)
+ mov x3, #\n2
+ ldp x20, x21, [sp]
+ ldp x22, x30, [sp, #0x10]
+ ldp x23, x24, [sp, #0x20]
+ add sp, sp, #0x30
+ b fft15_pass
+endfunc
+.endm
+
+ def_fft 60, 30
+ def_fft 120, 60
+ def_fft 240, 120
+ def_fft 480, 240
+ def_fft 960, 480
+
+function fft_b15_calc_neon
+ sub sp, sp, #0x50
+ ldr x8, [x0, #CELT_EXPTAB] // s->exptab[0]
+ movrel x6, fact5
+ movrel x11, shuffle_0213
+ movrel x12, shuffle_1032
+ movrel x13, shuffle_2301
+ movrel x14, shuffle_3120
+ add x8, x8, #8
+ movrel x5, fft_tab_neon
+ stp x20, x30, [sp]
+ stp d8, d9, [sp, #0x10]
+ stp d10, d11, [sp, #0x20]
+ stp d12, d13, [sp, #0x30]
+ stp d14, d15, [sp, #0x40]
+ ld1 {v15.4s}, [x6]
+ ld1 {v0.4s,v1.4s}, [x8], #32
+ ld1 {v6.2s}, [x8], #8
+ ld1 {v2.4s,v3.4s}, [x8], #32
+ ld1 {v7.2s}, [x8], #8
+ ld1 {v4.4s,v5.4s}, [x8], #32
+ uzp1 v8.4s, v0.4s, v1.4s // exp[ 1 - 4].re
+ uzp2 v9.4s, v0.4s, v1.4s // exp[ 1 - 4].im
+ uzp1 v10.4s, v2.4s, v3.4s // exp[ 6 - 9].re
+ uzp2 v11.4s, v2.4s, v3.4s // exp[ 6 - 9].im
+ uzp1 v12.4s, v4.4s, v5.4s // exp[11 - 14].re
+ uzp2 v13.4s, v4.4s, v5.4s // exp[11 - 14].im
+ zip1 v14.4s, v6.4s, v7.4s // exp[5,10].re/exp[5,10].im
+ add x5, x5, x3, lsl #3
+ ldr x5, [x5]
+ mov x10, x0
+ blr x5
+ ldp x20, x30, [sp]
+ ldp d8, d9, [sp, #0x10]
+ ldp d10, d11, [sp, #0x20]
+ ldp d12, d13, [sp, #0x30]
+ ldp d14, d15, [sp, #0x40]
+ add sp, sp, #0x50
+ ret
+endfunc
+
+const fft_tab_neon
+ .quad fft15_neon
+ .quad fft30_neon
+ .quad fft60_neon
+ .quad fft120_neon
+ .quad fft240_neon
+ .quad fft480_neon
+ .quad fft960_neon
+endconst
+
+function ff_celt_imdct_half_neon, export=1
+ sub sp, sp, #0x20
+ stp x21, x30, [sp]
+ str s0, [sp, #0x10]
+
+ ldp w5, w6, [x0, #CELT_LEN2] // CELT_LEN4
+ mov x10, x0
+ mov x21, x1
+ sub w5, w5, #1
+ lsl x7, x3, #3 // 2 * stride * sizeof(float)
+ sub x8, xzr, x3, lsl #3 // -2 * stride * sizeof(float)
+ mul x5, x5, x3
+ ldp x9, x10, [x0, #CELT_TMP] // CELT_TWIDDLE
+ ldr w3, [x0, #CELT_FFT_N]
+ add x5, x2, x5, lsl #2
+ mov x11, x9
+
+ sub w6, w6, #4
+ ld1 {v0.s}[0], [x5], x8
+ ld1 {v1.s}[0], [x2], x7
+ ld1 {v4.4s,v5.4s}, [x10], #32
+ ld1 {v0.s}[1], [x5], x8
+ ld1 {v1.s}[1], [x2], x7
+ uzp1 v2.4s, v4.4s, v5.4s
+ ld1 {v0.s}[2], [x5], x8
+ ld1 {v1.s}[2], [x2], x7
+ uzp2 v3.4s, v4.4s, v5.4s
+ ld1 {v0.s}[3], [x5], x8
+ ld1 {v1.s}[3], [x2], x7
+1:
+ subs w6, w6, #4
+
+ ld1 {v20.s}[0], [x5], x8
+ ld1 {v21.s}[0], [x2], x7
+ ld1 {v4.4s,v5.4s}, [x10], #32
+
+ fmul v6.4s, v0.4s, v2.4s
+ fmul v7.4s, v0.4s, v3.4s
+
+ ld1 {v20.s}[1], [x5], x8
+ ld1 {v21.s}[1], [x2], x7
+
+ fmls v6.4s, v1.4s, v3.4s
+ fmla v7.4s, v1.4s, v2.4s
+
+ ld1 {v20.s}[2], [x5], x8
+ ld1 {v21.s}[2], [x2], x7
+
+ uzp1 v2.4s, v4.4s, v5.4s
+ uzp2 v3.4s, v4.4s, v5.4s
+ ld1 {v20.s}[3], [x5], x8
+ ld1 {v21.s}[3], [x2], x7
+
+ zip1 v4.4s, v6.4s, v7.4s
+ zip2 v5.4s, v6.4s, v7.4s
+
+ fmul v6.4s, v20.4s, v2.4s
+ fmul v7.4s, v20.4s, v3.4s
+
+ st1 {v4.4s,v5.4s}, [x9], #32
+
+ fmls v6.4s, v21.4s, v3.4s
+ fmla v7.4s, v21.4s, v2.4s
+
+ b.eq 3f
+
+ subs w6, w6, #4
+ ld1 {v4.4s,v5.4s}, [x10], #32
+ ld1 {v0.s}[0], [x5], x8
+ ld1 {v1.s}[0], [x2], x7
+ uzp1 v2.4s, v4.4s, v5.4s
+ ld1 {v0.s}[1], [x5], x8
+ ld1 {v1.s}[1], [x2], x7
+ uzp2 v3.4s, v4.4s, v5.4s
+ ld1 {v0.s}[2], [x5], x8
+ ld1 {v1.s}[2], [x2], x7
+ zip1 v4.4s, v6.4s, v7.4s
+ zip2 v5.4s, v6.4s, v7.4s
+ ld1 {v0.s}[3], [x5], x8
+ ld1 {v1.s}[3], [x2], x7
+
+ st1 {v4.4s,v5.4s}, [x9], #32
+
+ b.gt 1b
+
+ fmul v6.4s, v0.4s, v2.4s
+ fmul v7.4s, v0.4s, v3.4s
+ fmls v6.4s, v1.4s, v3.4s
+ fmla v7.4s, v1.4s, v2.4s
+3:
+ zip1 v4.4s, v6.4s, v7.4s
+ zip2 v5.4s, v6.4s, v7.4s
+ st1 {v4.4s,v5.4s}, [x9], #32
+
+ mov x2, x11
+ mov x4, #1
+
+ bl fft_b15_calc_neon
+
+ ldr w5, [x10, #CELT_LEN4]
+ ldr x6, [x10, #CELT_TWIDDLE]
+ ldr s31, [sp, #0x10]
+
+ add x1, x21, x5, lsl #2
+ add x3, x6, x5, lsl #2
+ sub x0, x1, #16
+ sub x2, x3, #16
+ mov x8, #-16
+ mov x7, #16
+ mov x10, x0
+ mov x11, x1
+
+ sub w5, w5, #4
+
+ ld1 {v0.4s}, [x0], x8
+ ld1 {v1.4s}, [x1], x7
+ ld1 {v2.4s}, [x2], x8
+ ld1 {v3.4s}, [x3], x7
+
+ uzp1 v4.4s, v0.4s, v1.4s // z[-i-2, -i-1, +i, i+1].re
+ uzp2 v6.4s, v0.4s, v1.4s // z[-i-2, -i-1, +i, i+1].im
+
+ uzp1 v5.4s, v2.4s, v3.4s // twidlle_exptab[-i-2, -i-1, +i, i+1].re
+ uzp2 v7.4s, v2.4s, v3.4s // twidlle_exptab[-i-2, -i-1, +i, i+1].im
+
+ fmul v1.4s, v6.4s, v5.4s
+ fmul v0.4s, v6.4s, v7.4s
+2:
+ subs w5, w5, #4
+
+ ld1 {v20.4s}, [x0], x8
+
+ fmla v1.4s, v4.4s, v7.4s
+ fmls v0.4s, v4.4s, v5.4s
+
+ ld1 {v21.4s}, [x1], x7
+
+ ext v1.16b, v1.16b, v1.16b, #8
+ fmul v0.4s, v0.4s, v31.s[0]
+
+ ld1 {v2.4s}, [x2], x8
+
+ rev64 v1.4s, v1.4s
+ fmul v1.4s, v1.4s, v31.s[0]
+
+ ld1 {v3.4s}, [x3], x7
+
+ zip1 v5.4s, v0.4s, v1.4s
+ zip2 v7.4s, v0.4s, v1.4s
+
+ uzp1 v4.4s, v20.4s, v21.4s // z[-i-2, -i-1, +i, i+1].re
+ uzp2 v6.4s, v20.4s, v21.4s // z[-i-2, -i-1, +i, i+1].im
+
+ st1 {v5.4s}, [x10], x8
+ st1 {v7.4s}, [x11], x7
+
+ uzp1 v5.4s, v2.4s, v3.4s // twidlle_exptab[-i-2, -i-1, +i, i+1].re
+ uzp2 v7.4s, v2.4s, v3.4s // twidlle_exptab[-i-2, -i-1, +i, i+1].im
+
+ fmul v1.4s, v6.4s, v5.4s
+ fmul v0.4s, v6.4s, v7.4s
+ b.gt 2b
+
+ fmla v1.4s, v4.4s, v7.4s
+ fmls v0.4s, v4.4s, v5.4s
+ ext v1.16b, v1.16b, v1.16b, #8
+ fmul v0.4s, v0.4s, v31.s[0]
+ rev64 v1.4s, v1.4s
+ fmul v1.4s, v1.4s, v31.s[0]
+ zip1 v5.4s, v0.4s, v1.4s
+ zip2 v7.4s, v0.4s, v1.4s
+ st1 {v5.4s}, [x10], x8
+ st1 {v7.4s}, [x11], x7
+
+ ldp x21, x30, [sp]
+ add sp, sp, #0x20
+ ret
+endfunc
+
+// [0] = exp(2 * i * pi / 5), [1] = exp(2 * i * pi * 2 / 5)
+const fact5 align=4
+ .float 0.30901699437494745, 0.95105651629515353
+ .float -0.80901699437494734, 0.58778525229247325
+endconst
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/rv40dsp_init_aarch64.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/rv40dsp_init_aarch64.c
new file mode 100644
index 00000000000..764bc1ef391
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/rv40dsp_init_aarch64.c
@@ -0,0 +1,48 @@
+/*
+ * 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 "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/rv34dsp.h"
+
+#include "config.h"
+
+void ff_put_rv40_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+void ff_put_rv40_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+
+void ff_avg_rv40_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+void ff_avg_rv40_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+
+av_cold void ff_rv40dsp_init_aarch64(RV34DSPContext *c)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ c->put_chroma_pixels_tab[0] = ff_put_rv40_chroma_mc8_neon;
+ c->put_chroma_pixels_tab[1] = ff_put_rv40_chroma_mc4_neon;
+ c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_neon;
+ c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_neon;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/vc1dsp_init_aarch64.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/vc1dsp_init_aarch64.c
new file mode 100644
index 00000000000..e59e55ec886
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/vc1dsp_init_aarch64.c
@@ -0,0 +1,47 @@
+/*
+ * 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 "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/vc1dsp.h"
+
+#include "config.h"
+
+void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+
+av_cold void ff_vc1dsp_init_aarch64(VC1DSPContext *dsp)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_neon;
+ dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_neon;
+ dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = ff_put_vc1_chroma_mc4_neon;
+ dsp->avg_no_rnd_vc1_chroma_pixels_tab[1] = ff_avg_vc1_chroma_mc4_neon;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/videodsp.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/videodsp.S
new file mode 100644
index 00000000000..24067cc2af5
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/videodsp.S
@@ -0,0 +1,28 @@
+/*
+ * 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 "libavutil/aarch64/asm.S"
+
+function ff_prefetch_aarch64, export=1
+ subs w2, w2, #2
+ prfm pldl1strm, [x0]
+ prfm pldl1strm, [x0, x1]
+ add x0, x0, x1, lsl #1
+ b.gt X(ff_prefetch_aarch64)
+ ret
+endfunc
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/videodsp_init.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/videodsp_init.c
new file mode 100644
index 00000000000..6f667a6d3e6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/videodsp_init.c
@@ -0,0 +1,32 @@
+/*
+ * 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 "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/videodsp.h"
+
+void ff_prefetch_aarch64(uint8_t *mem, ptrdiff_t stride, int h);
+
+av_cold void ff_videodsp_init_aarch64(VideoDSPContext *ctx, int bpc)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_armv8(cpu_flags))
+ ctx->prefetch = ff_prefetch_aarch64;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/vorbisdsp_init.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/vorbisdsp_init.c
new file mode 100644
index 00000000000..c796f95e618
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/vorbisdsp_init.c
@@ -0,0 +1,34 @@
+/*
+ * 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 "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/vorbisdsp.h"
+
+void ff_vorbis_inverse_coupling_neon(float *mag, float *ang,
+ intptr_t blocksize);
+
+av_cold void ff_vorbisdsp_init_aarch64(VorbisDSPContext *c)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ c->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_neon;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/vorbisdsp_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/vorbisdsp_neon.S
new file mode 100644
index 00000000000..e76feebc54f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/vorbisdsp_neon.S
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2008 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 "libavutil/aarch64/asm.S"
+
+function ff_vorbis_inverse_coupling_neon, export=1
+ movi v20.4s, #1<<7, lsl #24
+ subs x2, x2, #4
+ mov x3, x0
+ mov x4, x1
+ b.eq 3f
+
+ ld1 {v7.4s}, [x1], #16
+ ld1 {v6.4s}, [x0], #16
+ cmle v4.4s, v7.4s, #0
+ and v5.16b, v6.16b, v20.16b
+ eor v7.16b, v7.16b, v5.16b
+ and v2.16b, v7.16b, v4.16b
+ bic v3.16b, v7.16b, v4.16b
+ fadd v7.4s, v6.4s, v2.4s
+ fsub v6.4s, v6.4s, v3.4s
+1: ld1 {v1.4s}, [x1], #16
+ ld1 {v0.4s}, [x0], #16
+ cmle v4.4s, v1.4s, #0
+ and v5.16b, v0.16b, v20.16b
+ eor v1.16b, v1.16b, v5.16b
+ st1 {v7.4s}, [x3], #16
+ st1 {v6.4s}, [x4], #16
+ and v2.16b, v1.16b, v4.16b
+ bic v3.16b, v1.16b, v4.16b
+ fadd v1.4s, v0.4s, v2.4s
+ fsub v0.4s, v0.4s, v3.4s
+ subs x2, x2, #8
+ b.le 2f
+ ld1 {v7.4s}, [x1], #16
+ ld1 {v6.4s}, [x0], #16
+ cmle v4.4s, v7.4s, #0
+ and v5.16b, v6.16b, v20.16b
+ eor v7.16b, v7.16b, v5.16b
+ st1 {v1.4s}, [x3], #16
+ st1 {v0.4s}, [x4], #16
+ and v2.16b, v7.16b, v4.16b
+ bic v3.16b, v7.16b, v4.16b
+ fadd v7.4s, v6.4s, v2.4s
+ fsub v6.4s, v6.4s, v3.4s
+ b 1b
+
+2: st1 {v1.4s}, [x3], #16
+ st1 {v0.4s}, [x4], #16
+ b.lt ret
+
+3: ld1 {v1.4s}, [x1]
+ ld1 {v0.4s}, [x0]
+ cmle v4.4s, v1.4s, #0
+ and v5.16b, v0.16b, v20.16b
+ eor v1.16b, v1.16b, v5.16b
+ and v2.16b, v1.16b, v4.16b
+ bic v3.16b, v1.16b, v4.16b
+ fadd v1.4s, v0.4s, v2.4s
+ fsub v0.4s, v0.4s, v3.4s
+ st1 {v1.4s}, [x0], #16
+ st1 {v0.4s}, [x1], #16
+ret:
+ ret
+endfunc
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3.h b/chromium/third_party/ffmpeg/libavcodec/ac3.h
index e609bb51ce3..542f79d711d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3.h
@@ -51,6 +51,52 @@
#define EXP_D25 2
#define EXP_D45 3
+#ifndef USE_FIXED
+#define USE_FIXED 0
+#endif
+
+#if USE_FIXED
+
+#define FFT_FLOAT 0
+
+#define FIXR(a) ((int)((a) * 0 + 0.5))
+#define FIXR12(a) ((int)((a) * 4096 + 0.5))
+#define FIXR15(a) ((int)((a) * 32768 + 0.5))
+#define ROUND15(x) ((x) + 16384) >> 15
+
+#define AC3_RENAME(x) x ## _fixed
+#define AC3_NORM(norm) (1<<24)/(norm)
+#define AC3_MUL(a,b) ((((int64_t) (a)) * (b))>>12)
+#define AC3_RANGE(x) (x)
+#define AC3_DYNAMIC_RANGE(x) (x)
+#define AC3_SPX_BLEND(x) (x)
+#define AC3_DYNAMIC_RANGE1 0
+
+#define INTFLOAT int
+#define SHORTFLOAT int16_t
+
+#else /* USE_FIXED */
+
+#define FIXR(x) ((float)(x))
+#define FIXR12(x) ((float)(x))
+#define FIXR15(x) ((float)(x))
+#define ROUND15(x) (x)
+
+#define AC3_RENAME(x) x
+#define AC3_NORM(norm) (1.0f/(norm))
+#define AC3_MUL(a,b) ((a) * (b))
+#define AC3_RANGE(x) (dynamic_range_tab[(x)])
+#define AC3_DYNAMIC_RANGE(x) (powf(x, s->drc_scale))
+#define AC3_SPX_BLEND(x) (x)* (1.0f/32)
+#define AC3_DYNAMIC_RANGE1 1.0f
+
+#define INTFLOAT float
+#define SHORTFLOAT float
+
+#endif /* USE_FIXED */
+
+#define AC3_LEVEL(x) ROUND15((x) * FIXR15(0.7071067811865476))
+
/* pre-defined gain values */
#define LEVEL_PLUS_3DB 1.4142135623730950
#define LEVEL_PLUS_1POINT5DB 1.1892071150027209
@@ -82,6 +128,38 @@ typedef enum {
AC3_CHMODE_3F2R
} AC3ChannelMode;
+/** Dolby Surround mode */
+typedef enum AC3DolbySurroundMode {
+ AC3_DSURMOD_NOTINDICATED = 0,
+ AC3_DSURMOD_OFF,
+ AC3_DSURMOD_ON,
+ AC3_DSURMOD_RESERVED
+} AC3DolbySurroundMode;
+
+/** Dolby Surround EX mode */
+typedef enum AC3DolbySurroundEXMode {
+ AC3_DSUREXMOD_NOTINDICATED = 0,
+ AC3_DSUREXMOD_OFF,
+ AC3_DSUREXMOD_ON,
+ AC3_DSUREXMOD_PLIIZ
+} AC3DolbySurroundEXMode;
+
+/** Dolby Headphone mode */
+typedef enum AC3DolbyHeadphoneMode {
+ AC3_DHEADPHONMOD_NOTINDICATED = 0,
+ AC3_DHEADPHONMOD_OFF,
+ AC3_DHEADPHONMOD_ON,
+ AC3_DHEADPHONMOD_RESERVED
+} AC3DolbyHeadphoneMode;
+
+/** Preferred Stereo Downmix mode */
+typedef enum AC3PreferredStereoDownmixMode {
+ AC3_DMIXMOD_NOTINDICATED = 0,
+ AC3_DMIXMOD_LTRT,
+ AC3_DMIXMOD_LORO,
+ AC3_DMIXMOD_DPLII // reserved value in A/52, but used by encoders to indicate DPL2
+} AC3PreferredStereoDownmixMode;
+
typedef struct AC3BitAllocParameters {
int sr_code;
int sr_shift;
@@ -110,6 +188,9 @@ typedef struct AC3HeaderInfo {
int surround_mix_level; ///< Surround mix level index
uint16_t channel_map;
int num_blocks; ///< number of audio blocks
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
+ int dolby_surround_mode;
+#endif
/** @} */
/** @name Derived values
@@ -122,6 +203,9 @@ typedef struct AC3HeaderInfo {
uint16_t frame_size;
uint64_t channel_layout;
/** @} */
+#if !AV_HAVE_INCOMPATIBLE_LIBAV_ABI
+ int dolby_surround_mode;
+#endif
} AC3HeaderInfo;
typedef enum {
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3_parser.c b/chromium/third_party/ffmpeg/libavcodec/ac3_parser.c
index 8dc4c0d4801..dd6d77c9ab2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3_parser.c
@@ -47,9 +47,16 @@ static const uint8_t center_levels[4] = { 4, 5, 6, 5 };
static const uint8_t surround_levels[4] = { 4, 6, 7, 6 };
-int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
+int avpriv_ac3_parse_header2(GetBitContext *gbc, AC3HeaderInfo **phdr)
{
int frame_size_code;
+ AC3HeaderInfo *hdr;
+
+ if (!*phdr)
+ *phdr = av_mallocz(sizeof(AC3HeaderInfo));
+ if (!*phdr)
+ return AVERROR(ENOMEM);
+ hdr = *phdr;
memset(hdr, 0, sizeof(*hdr));
@@ -68,6 +75,9 @@ int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
hdr->center_mix_level = 5; // -4.5dB
hdr->surround_mix_level = 6; // -6.0dB
+ /* set default dolby surround mode */
+ hdr->dolby_surround_mode = AC3_DSURMOD_NOTINDICATED;
+
if(hdr->bitstream_id <= 10) {
/* Normal AC-3 */
hdr->crc1 = get_bits(gbc, 16);
@@ -85,7 +95,7 @@ int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
hdr->channel_mode = get_bits(gbc, 3);
if(hdr->channel_mode == AC3_CHMODE_STEREO) {
- skip_bits(gbc, 2); // skip dsurmod
+ hdr->dolby_surround_mode = get_bits(gbc, 2);
} else {
if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO)
hdr-> center_mix_level = center_levels[get_bits(gbc, 2)];
@@ -141,6 +151,15 @@ int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
return 0;
}
+int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
+{
+ AC3HeaderInfo tmp, *ptmp = &tmp;
+ int ret = avpriv_ac3_parse_header2(gbc, &ptmp);
+
+ memcpy(hdr, ptmp, ((intptr_t)&tmp.channel_layout) - ((intptr_t)&tmp) + sizeof(uint64_t));
+ return ret;
+}
+
static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int *need_next_header, int *new_frame_start)
{
@@ -149,11 +168,11 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
uint64_t u64;
uint8_t u8[8];
} tmp = { av_be2ne64(state) };
- AC3HeaderInfo hdr;
+ AC3HeaderInfo hdr, *phdr = &hdr;
GetBitContext gbc;
init_get_bits(&gbc, tmp.u8+8-AC3_HEADER_SIZE, 54);
- err = avpriv_ac3_parse_header(&gbc, &hdr);
+ err = avpriv_ac3_parse_header2(&gbc, &phdr);
if(err < 0)
return 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3_parser.h b/chromium/third_party/ffmpeg/libavcodec/ac3_parser.h
index b5022de2d88..f37387d76c2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3_parser.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3_parser.h
@@ -31,11 +31,14 @@
* Parse the header up to the lfeon element, which is the first 52 or 54 bits
* depending on the audio coding mode.
* @param[in] gbc BitContext containing the first 54 bits of the frame.
- * @param[out] hdr Pointer to struct where header info is written.
+ * @param[out] hdr Pointer to Pointer to struct where header info is written.
+ * will be allocated if NULL
* @return Returns 0 on success, -1 if there is a sync word mismatch,
* -2 if the bsid (version) element is invalid, -3 if the fscod (sample rate)
* element is invalid, or -4 if the frmsizecod (bit rate) element is invalid.
*/
+int avpriv_ac3_parse_header2(GetBitContext *gbc, AC3HeaderInfo **hdr);
+
int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr);
#endif /* AVCODEC_AC3_PARSER_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dec.c b/chromium/third_party/ffmpeg/libavcodec/ac3dec.c
index 1995412cdc4..c8c4eb6b4ac 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3dec.c
@@ -31,6 +31,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
+#include "libavutil/downmix_info.h"
#include "libavutil/opt.h"
#include "internal.h"
#include "aac_ac3_parser.h"
@@ -77,6 +78,15 @@ static const float gain_levels[9] = {
LEVEL_MINUS_9DB
};
+/** Adjustments in dB gain (LFE, +10 to -21 dB) */
+static const float gain_levels_lfe[32] = {
+ 3.162275, 2.818382, 2.511886, 2.238719, 1.995261, 1.778278, 1.584893,
+ 1.412536, 1.258924, 1.122018, 1.000000, 0.891251, 0.794328, 0.707946,
+ 0.630957, 0.562341, 0.501187, 0.446683, 0.398107, 0.354813, 0.316227,
+ 0.281838, 0.251188, 0.223872, 0.199526, 0.177828, 0.158489, 0.141253,
+ 0.125892, 0.112201, 0.100000, 0.089125
+};
+
/**
* Table for default stereo downmixing coefficients
* reference: Section 7.8.2 Downmixing Into Two Channels
@@ -169,14 +179,23 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
ac3_tables_init();
ff_mdct_init(&s->imdct_256, 8, 1, 1.0);
ff_mdct_init(&s->imdct_512, 9, 1, 1.0);
- ff_kbd_window_init(s->window, 5.0, 256);
+ AC3_RENAME(ff_kbd_window_init)(s->window, 5.0, 256);
ff_dsputil_init(&s->dsp, avctx);
+
+#if (USE_FIXED)
+ s->fdsp = avpriv_alloc_fixed_dsp(avctx->flags & CODEC_FLAG_BITEXACT);
+#else
avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
+#endif
+
ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
ff_fmt_convert_init(&s->fmt_conv, avctx);
av_lfg_init(&s->dith_state, 0);
- avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
+ if (USE_FIXED)
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
+ else
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
/* allow downmixing to stereo or mono */
#if FF_API_REQUEST_CHANNELS
@@ -227,12 +246,26 @@ static int ac3_parse_header(AC3DecodeContext *s)
skip_bits(gbc, 2); //skip copyright bit and original bitstream bit
- /* skip the timecodes (or extra bitstream information for Alternate Syntax)
- TODO: read & use the xbsi1 downmix levels */
- if (get_bits1(gbc))
- skip_bits(gbc, 14); //skip timecode1 / xbsi1
- if (get_bits1(gbc))
- skip_bits(gbc, 14); //skip timecode2 / xbsi2
+ /* skip the timecodes or parse the Alternate Bit Stream Syntax */
+ if (s->bitstream_id != 6) {
+ if (get_bits1(gbc))
+ skip_bits(gbc, 14); //skip timecode1
+ if (get_bits1(gbc))
+ skip_bits(gbc, 14); //skip timecode2
+ } else {
+ if (get_bits1(gbc)) {
+ s->preferred_downmix = get_bits(gbc, 2);
+ s->center_mix_level_ltrt = get_bits(gbc, 3);
+ s->surround_mix_level_ltrt = av_clip(get_bits(gbc, 3), 3, 7);
+ s->center_mix_level = get_bits(gbc, 3);
+ s->surround_mix_level = av_clip(get_bits(gbc, 3), 3, 7);
+ }
+ if (get_bits1(gbc)) {
+ s->dolby_surround_ex_mode = get_bits(gbc, 2);
+ s->dolby_headphone_mode = get_bits(gbc, 2);
+ skip_bits(gbc, 10); // skip adconvtyp (1), xbsi2 (8), encinfo (1)
+ }
+ }
/* skip additional bitstream info */
if (get_bits1(gbc)) {
@@ -250,15 +283,16 @@ static int ac3_parse_header(AC3DecodeContext *s)
*/
static int parse_frame_header(AC3DecodeContext *s)
{
- AC3HeaderInfo hdr;
+ AC3HeaderInfo hdr, *phdr=&hdr;
int err;
- err = avpriv_ac3_parse_header(&s->gbc, &hdr);
+ err = avpriv_ac3_parse_header2(&s->gbc, &phdr);
if (err)
return err;
/* get decoding parameters from header info */
s->bit_alloc_params.sr_code = hdr.sr_code;
+ s->bitstream_id = hdr.bitstream_id;
s->bitstream_mode = hdr.bitstream_mode;
s->channel_mode = hdr.channel_mode;
s->lfe_on = hdr.lfe_on;
@@ -269,11 +303,18 @@ static int parse_frame_header(AC3DecodeContext *s)
s->fbw_channels = s->channels - s->lfe_on;
s->lfe_ch = s->fbw_channels + 1;
s->frame_size = hdr.frame_size;
+ s->preferred_downmix = AC3_DMIXMOD_NOTINDICATED;
s->center_mix_level = hdr.center_mix_level;
+ s->center_mix_level_ltrt = 4; // -3.0dB
s->surround_mix_level = hdr.surround_mix_level;
+ s->surround_mix_level_ltrt = 4; // -3.0dB
+ s->lfe_mix_level_exists = 0;
s->num_blocks = hdr.num_blocks;
s->frame_type = hdr.frame_type;
s->substreamid = hdr.substreamid;
+ s->dolby_surround_mode = hdr.dolby_surround_mode;
+ s->dolby_surround_ex_mode = AC3_DSUREXMOD_NOTINDICATED;
+ s->dolby_headphone_mode = AC3_DHEADPHONMOD_NOTINDICATED;
if (s->lfe_on) {
s->start_freq[s->lfe_ch] = 0;
@@ -282,7 +323,7 @@ static int parse_frame_header(AC3DecodeContext *s)
s->channel_in_cpl[s->lfe_ch] = 0;
}
- if (hdr.bitstream_id <= 10) {
+ if (s->bitstream_id <= 10) {
s->eac3 = 0;
s->snr_offset_strategy = 2;
s->block_switch_syntax = 1;
@@ -313,40 +354,45 @@ static void set_downmix_coeffs(AC3DecodeContext *s)
float cmix = gain_levels[s-> center_mix_level];
float smix = gain_levels[s->surround_mix_level];
float norm0, norm1;
+ float downmix_coeffs[AC3_MAX_CHANNELS][2];
for (i = 0; i < s->fbw_channels; i++) {
- s->downmix_coeffs[i][0] = gain_levels[ac3_default_coeffs[s->channel_mode][i][0]];
- s->downmix_coeffs[i][1] = gain_levels[ac3_default_coeffs[s->channel_mode][i][1]];
+ downmix_coeffs[i][0] = gain_levels[ac3_default_coeffs[s->channel_mode][i][0]];
+ downmix_coeffs[i][1] = gain_levels[ac3_default_coeffs[s->channel_mode][i][1]];
}
if (s->channel_mode > 1 && s->channel_mode & 1) {
- s->downmix_coeffs[1][0] = s->downmix_coeffs[1][1] = cmix;
+ downmix_coeffs[1][0] = downmix_coeffs[1][1] = cmix;
}
if (s->channel_mode == AC3_CHMODE_2F1R || s->channel_mode == AC3_CHMODE_3F1R) {
int nf = s->channel_mode - 2;
- s->downmix_coeffs[nf][0] = s->downmix_coeffs[nf][1] = smix * LEVEL_MINUS_3DB;
+ downmix_coeffs[nf][0] = downmix_coeffs[nf][1] = smix * LEVEL_MINUS_3DB;
}
if (s->channel_mode == AC3_CHMODE_2F2R || s->channel_mode == AC3_CHMODE_3F2R) {
int nf = s->channel_mode - 4;
- s->downmix_coeffs[nf][0] = s->downmix_coeffs[nf+1][1] = smix;
+ downmix_coeffs[nf][0] = downmix_coeffs[nf+1][1] = smix;
}
/* renormalize */
norm0 = norm1 = 0.0;
for (i = 0; i < s->fbw_channels; i++) {
- norm0 += s->downmix_coeffs[i][0];
- norm1 += s->downmix_coeffs[i][1];
+ norm0 += downmix_coeffs[i][0];
+ norm1 += downmix_coeffs[i][1];
}
norm0 = 1.0f / norm0;
norm1 = 1.0f / norm1;
for (i = 0; i < s->fbw_channels; i++) {
- s->downmix_coeffs[i][0] *= norm0;
- s->downmix_coeffs[i][1] *= norm1;
+ downmix_coeffs[i][0] *= norm0;
+ downmix_coeffs[i][1] *= norm1;
}
if (s->output_mode == AC3_CHMODE_MONO) {
for (i = 0; i < s->fbw_channels; i++)
- s->downmix_coeffs[i][0] = (s->downmix_coeffs[i][0] +
- s->downmix_coeffs[i][1]) * LEVEL_MINUS_3DB;
+ downmix_coeffs[i][0] = (downmix_coeffs[i][0] +
+ downmix_coeffs[i][1]) * LEVEL_MINUS_3DB;
+ }
+ for (i = 0; i < s->fbw_channels; i++) {
+ s->downmix_coeffs[i][0] = FIXR12(downmix_coeffs[i][0]);
+ s->downmix_coeffs[i][1] = FIXR12(downmix_coeffs[i][1]);
}
}
@@ -614,20 +660,30 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
for (ch = 1; ch <= channels; ch++) {
if (s->block_switch[ch]) {
int i;
- float *x = s->tmp_output + 128;
+ FFTSample *x = s->tmp_output + 128;
for (i = 0; i < 128; i++)
x[i] = s->transform_coeffs[ch][2 * i];
s->imdct_256.imdct_half(&s->imdct_256, s->tmp_output, x);
+#if USE_FIXED
+ s->fdsp->vector_fmul_window_scaled(s->outptr[ch - 1], s->delay[ch - 1],
+ s->tmp_output, s->window, 128, 8);
+#else
s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
s->tmp_output, s->window, 128);
+#endif
for (i = 0; i < 128; i++)
x[i] = s->transform_coeffs[ch][2 * i + 1];
s->imdct_256.imdct_half(&s->imdct_256, s->delay[ch - 1], x);
} else {
s->imdct_512.imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
+#if USE_FIXED
+ s->fdsp->vector_fmul_window_scaled(s->outptr[ch - 1], s->delay[ch - 1],
+ s->tmp_output, s->window, 128, 8);
+#else
s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
s->tmp_output, s->window, 128);
- memcpy(s->delay[ch - 1], s->tmp_output + 128, 128 * sizeof(float));
+#endif
+ memcpy(s->delay[ch - 1], s->tmp_output + 128, 128 * sizeof(FFTSample));
}
}
}
@@ -760,10 +816,15 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
i = !s->channel_mode;
do {
if (get_bits1(gbc)) {
- s->dynamic_range[i] = powf(dynamic_range_tab[get_bits(gbc, 8)],
- s->drc_scale);
+ /* Allow asymmetric application of DRC when drc_scale > 1.
+ Amplification of quiet sounds is enhanced */
+ INTFLOAT range = AC3_RANGE(get_bits(gbc, 8));
+ if (range > 1.0 || s->drc_scale <= 1.0)
+ s->dynamic_range[i] = AC3_DYNAMIC_RANGE(range);
+ else
+ s->dynamic_range[i] = range;
} else if (blk == 0) {
- s->dynamic_range[i] = 1.0f;
+ s->dynamic_range[i] = AC3_DYNAMIC_RANGE1;
}
} while (i--);
@@ -789,6 +850,9 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
if (start_subband > 7)
start_subband += start_subband - 7;
end_subband = get_bits(gbc, 3) + 5;
+#if USE_FIXED
+ s->spx_dst_end_freq = end_freq_inv_tab[end_subband];
+#endif
if (end_subband > 7)
end_subband += end_subband - 7;
dst_start_freq = dst_start_freq * 12 + 25;
@@ -809,7 +873,8 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
s->spx_dst_start_freq = dst_start_freq;
s->spx_src_start_freq = src_start_freq;
- s->spx_dst_end_freq = dst_end_freq;
+ if (!USE_FIXED)
+ s->spx_dst_end_freq = dst_end_freq;
decode_band_structure(gbc, blk, s->eac3, 0,
start_subband, end_subband,
@@ -829,18 +894,40 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
for (ch = 1; ch <= fbw_channels; ch++) {
if (s->channel_uses_spx[ch]) {
if (s->first_spx_coords[ch] || get_bits1(gbc)) {
- float spx_blend;
+ INTFLOAT spx_blend;
int bin, master_spx_coord;
s->first_spx_coords[ch] = 0;
- spx_blend = get_bits(gbc, 5) * (1.0f/32);
+ spx_blend = AC3_SPX_BLEND(get_bits(gbc, 5));
master_spx_coord = get_bits(gbc, 2) * 3;
bin = s->spx_src_start_freq;
for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
int bandsize;
int spx_coord_exp, spx_coord_mant;
- float nratio, sblend, nblend, spx_coord;
+ INTFLOAT nratio, sblend, nblend;
+#if USE_FIXED
+ int64_t accu;
+ /* calculate blending factors */
+ bandsize = s->spx_band_sizes[bnd];
+ accu = (int64_t)((bin << 23) + (bandsize << 22)) * s->spx_dst_end_freq;
+ nratio = (int)(accu >> 32);
+ nratio -= spx_blend << 18;
+
+ if (nratio < 0) {
+ nblend = 0;
+ sblend = 0x800000;
+ } else if (nratio > 0x7fffff) {
+ nblend = 0x800000;
+ sblend = 0;
+ } else {
+ nblend = fixed_sqrt(nratio, 23);
+ accu = (int64_t)nblend * 1859775393;
+ nblend = (int)((accu + (1<<29)) >> 30);
+ sblend = fixed_sqrt(0x800000 - nratio, 23);
+ }
+#else
+ float spx_coord;
/* calculate blending factors */
bandsize = s->spx_band_sizes[bnd];
@@ -849,6 +936,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
nblend = sqrtf(3.0f * nratio); // noise is scaled by sqrt(3)
// to give unity variance
sblend = sqrtf(1.0f - nratio);
+#endif
bin += bandsize;
/* decode spx coordinates */
@@ -857,11 +945,18 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
if (spx_coord_exp == 15) spx_coord_mant <<= 1;
else spx_coord_mant += 4;
spx_coord_mant <<= (25 - spx_coord_exp - master_spx_coord);
- spx_coord = spx_coord_mant * (1.0f / (1 << 23));
/* multiply noise and signal blending factors by spx coordinate */
+#if USE_FIXED
+ accu = (int64_t)nblend * spx_coord_mant;
+ s->spx_noise_blend[ch][bnd] = (int)((accu + (1<<22)) >> 23);
+ accu = (int64_t)sblend * spx_coord_mant;
+ s->spx_signal_blend[ch][bnd] = (int)((accu + (1<<22)) >> 23);
+#else
+ spx_coord = spx_coord_mant * (1.0f / (1 << 23));
s->spx_noise_blend [ch][bnd] = nblend * spx_coord;
s->spx_signal_blend[ch][bnd] = sblend * spx_coord;
+#endif
}
}
} else {
@@ -1218,14 +1313,19 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
/* apply scaling to coefficients (headroom, dynrng) */
for (ch = 1; ch <= s->channels; ch++) {
- float gain = 1.0 / 4194304.0f;
- if (s->channel_mode == AC3_CHMODE_DUALMONO) {
- gain *= s->dynamic_range[2 - ch];
+ INTFLOAT gain;
+ if(s->channel_mode == AC3_CHMODE_DUALMONO) {
+ gain = s->dynamic_range[2-ch];
} else {
- gain *= s->dynamic_range[0];
+ gain = s->dynamic_range[0];
}
+#if USE_FIXED
+ scale_coefs(s->transform_coeffs[ch], s->fixed_coeffs[ch], gain, 256);
+#else
+ gain *= 1.0 / 4194304.0f;
s->fmt_conv.int32_to_float_fmul_scalar(s->transform_coeffs[ch],
s->fixed_coeffs[ch], gain, 256);
+#endif
}
/* apply spectral extension to high frequency bins */
@@ -1250,19 +1350,24 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
do_imdct(s, s->channels);
if (downmix_output) {
+#if USE_FIXED
+ ac3_downmix_c_fixed16(s->outptr, s->downmix_coeffs,
+ s->out_channels, s->fbw_channels, 256);
+#else
s->ac3dsp.downmix(s->outptr, s->downmix_coeffs,
s->out_channels, s->fbw_channels, 256);
+#endif
}
} else {
if (downmix_output) {
- s->ac3dsp.downmix(s->xcfptr + 1, s->downmix_coeffs,
- s->out_channels, s->fbw_channels, 256);
+ s->ac3dsp.AC3_RENAME(downmix)(s->xcfptr + 1, s->downmix_coeffs,
+ s->out_channels, s->fbw_channels, 256);
}
if (downmix_output && !s->downmixed) {
s->downmixed = 1;
- s->ac3dsp.downmix(s->dlyptr, s->downmix_coeffs, s->out_channels,
- s->fbw_channels, 128);
+ s->ac3dsp.AC3_RENAME(downmix)(s->dlyptr, s->downmix_coeffs,
+ s->out_channels, s->fbw_channels, 128);
}
do_imdct(s, s->out_channels);
@@ -1283,7 +1388,9 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
AC3DecodeContext *s = avctx->priv_data;
int blk, ch, err, ret;
const uint8_t *channel_map;
- const float *output[AC3_MAX_CHANNELS];
+ const SHORTFLOAT *output[AC3_MAX_CHANNELS];
+ enum AVMatrixEncoding matrix_encoding;
+ AVDownmixInfo *downmix_info;
/* copy input buffer to decoder context to avoid reading past the end
of the buffer, which can be caused by a damaged input stream. */
@@ -1408,7 +1515,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
}
for (ch = 0; ch < s->channels; ch++) {
if (ch < s->out_channels)
- s->outptr[channel_map[ch]] = (float *)frame->data[ch];
+ s->outptr[channel_map[ch]] = (SHORTFLOAT *)frame->data[ch];
}
for (blk = 0; blk < s->num_blocks; blk++) {
if (!err && decode_audio_block(s, blk)) {
@@ -1417,7 +1524,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
}
if (err)
for (ch = 0; ch < s->out_channels; ch++)
- memcpy(((float*)frame->data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], sizeof(**output) * AC3_BLOCK_SIZE);
+ memcpy(((SHORTFLOAT*)frame->data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], AC3_BLOCK_SIZE*sizeof(SHORTFLOAT));
for (ch = 0; ch < s->out_channels; ch++)
output[ch] = s->outptr[channel_map[ch]];
for (ch = 0; ch < s->out_channels; ch++) {
@@ -1430,7 +1537,63 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
/* keep last block for error concealment in next frame */
for (ch = 0; ch < s->out_channels; ch++)
- memcpy(s->output[ch], output[ch], sizeof(**output) * AC3_BLOCK_SIZE);
+ memcpy(s->output[ch], output[ch], AC3_BLOCK_SIZE*sizeof(SHORTFLOAT));
+
+ /*
+ * AVMatrixEncoding
+ *
+ * Check whether the input layout is compatible, and make sure we're not
+ * downmixing (else the matrix encoding is no longer applicable).
+ */
+ matrix_encoding = AV_MATRIX_ENCODING_NONE;
+ if (s->channel_mode == AC3_CHMODE_STEREO &&
+ s->channel_mode == (s->output_mode & ~AC3_OUTPUT_LFEON)) {
+ if (s->dolby_surround_mode == AC3_DSURMOD_ON)
+ matrix_encoding = AV_MATRIX_ENCODING_DOLBY;
+ else if (s->dolby_headphone_mode == AC3_DHEADPHONMOD_ON)
+ matrix_encoding = AV_MATRIX_ENCODING_DOLBYHEADPHONE;
+ } else if (s->channel_mode >= AC3_CHMODE_2F2R &&
+ s->channel_mode == (s->output_mode & ~AC3_OUTPUT_LFEON)) {
+ switch (s->dolby_surround_ex_mode) {
+ case AC3_DSUREXMOD_ON: // EX or PLIIx
+ matrix_encoding = AV_MATRIX_ENCODING_DOLBYEX;
+ break;
+ case AC3_DSUREXMOD_PLIIZ:
+ matrix_encoding = AV_MATRIX_ENCODING_DPLIIZ;
+ break;
+ default: // not indicated or off
+ break;
+ }
+ }
+ if ((ret = ff_side_data_update_matrix_encoding(frame, matrix_encoding)) < 0)
+ return ret;
+
+ /* AVDownmixInfo */
+ if ((downmix_info = av_downmix_info_update_side_data(frame))) {
+ switch (s->preferred_downmix) {
+ case AC3_DMIXMOD_LTRT:
+ downmix_info->preferred_downmix_type = AV_DOWNMIX_TYPE_LTRT;
+ break;
+ case AC3_DMIXMOD_LORO:
+ downmix_info->preferred_downmix_type = AV_DOWNMIX_TYPE_LORO;
+ break;
+ case AC3_DMIXMOD_DPLII:
+ downmix_info->preferred_downmix_type = AV_DOWNMIX_TYPE_DPLII;
+ break;
+ default:
+ downmix_info->preferred_downmix_type = AV_DOWNMIX_TYPE_UNKNOWN;
+ break;
+ }
+ downmix_info->center_mix_level = gain_levels[s-> center_mix_level];
+ downmix_info->center_mix_level_ltrt = gain_levels[s-> center_mix_level_ltrt];
+ downmix_info->surround_mix_level = gain_levels[s-> surround_mix_level];
+ downmix_info->surround_mix_level_ltrt = gain_levels[s->surround_mix_level_ltrt];
+ if (s->lfe_mix_level_exists)
+ downmix_info->lfe_mix_level = gain_levels_lfe[s->lfe_mix_level];
+ else
+ downmix_info->lfe_mix_level = 0.0; // -inf dB
+ } else
+ return AVERROR(ENOMEM);
*got_frame_ptr = 1;
@@ -1445,66 +1608,12 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx)
AC3DecodeContext *s = avctx->priv_data;
ff_mdct_end(&s->imdct_512);
ff_mdct_end(&s->imdct_256);
+#if (USE_FIXED)
+ av_freep(&s->fdsp);
+#endif
return 0;
}
#define OFFSET(x) offsetof(AC3DecodeContext, x)
#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
-static const AVOption options[] = {
- { "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 1.0}, 0.0, 1.0, PAR },
-
-{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 2, 0, "dmix_mode"},
-{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
-{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
-{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
-{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
-
- { NULL},
-};
-
-static const AVClass ac3_decoder_class = {
- .class_name = "AC3 decoder",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_ac3_decoder = {
- .name = "ac3",
- .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_AC3,
- .priv_data_size = sizeof (AC3DecodeContext),
- .init = ac3_decode_init,
- .close = ac3_decode_end,
- .decode = ac3_decode_frame,
- .capabilities = CODEC_CAP_DR1,
- .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
- AV_SAMPLE_FMT_NONE },
- .priv_class = &ac3_decoder_class,
-};
-
-#if CONFIG_EAC3_DECODER
-static const AVClass eac3_decoder_class = {
- .class_name = "E-AC3 decoder",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_eac3_decoder = {
- .name = "eac3",
- .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_EAC3,
- .priv_data_size = sizeof (AC3DecodeContext),
- .init = ac3_decode_init,
- .close = ac3_decode_end,
- .decode = ac3_decode_frame,
- .capabilities = CODEC_CAP_DR1,
- .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
- AV_SAMPLE_FMT_NONE },
- .priv_class = &eac3_decoder_class,
-};
-#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dec.h b/chromium/third_party/ffmpeg/libavcodec/ac3dec.h
index fa447c4d6f8..5196d90901f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3dec.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3dec.h
@@ -51,6 +51,7 @@
#define AVCODEC_AC3DEC_H
#include "libavutil/float_dsp.h"
+#include "libavutil/fixed_dsp.h"
#include "libavutil/lfg.h"
#include "ac3.h"
#include "ac3dsp.h"
@@ -79,13 +80,22 @@ typedef struct AC3DecodeContext {
int bit_rate; ///< stream bit rate, in bits-per-second
int sample_rate; ///< sample frequency, in Hz
int num_blocks; ///< number of audio blocks
+ int bitstream_id; ///< bitstream id (bsid)
int bitstream_mode; ///< bitstream mode (bsmod)
int channel_mode; ///< channel mode (acmod)
int lfe_on; ///< lfe channel in use
int channel_map; ///< custom channel map
+ int preferred_downmix; ///< Preferred 2-channel downmix mode (dmixmod)
int center_mix_level; ///< Center mix level index
+ int center_mix_level_ltrt; ///< Center mix level index for Lt/Rt (ltrtcmixlev)
int surround_mix_level; ///< Surround mix level index
+ int surround_mix_level_ltrt; ///< Surround mix level index for Lt/Rt (ltrtsurmixlev)
+ int lfe_mix_level_exists; ///< indicates if lfemixlevcod is specified (lfemixlevcode)
+ int lfe_mix_level; ///< LFE mix level index (lfemixlevcod)
int eac3; ///< indicates if current frame is E-AC-3
+ int dolby_surround_mode; ///< dolby surround mode (dsurmod)
+ int dolby_surround_ex_mode; ///< dolby surround ex mode (dsurexmod)
+ int dolby_headphone_mode; ///< dolby headphone mode (dheadphonmod)
///@}
int preferred_stereo_downmix;
@@ -129,8 +139,8 @@ typedef struct AC3DecodeContext {
int num_spx_bands; ///< number of spx bands (nspxbnds)
uint8_t spx_band_sizes[SPX_MAX_BANDS]; ///< number of bins in each spx band
uint8_t first_spx_coords[AC3_MAX_CHANNELS]; ///< first spx coordinates states (firstspxcos)
- float spx_noise_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spx noise blending factor (nblendfact)
- float spx_signal_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS];///< spx signal blending factor (sblendfact)
+ INTFLOAT spx_noise_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spx noise blending factor (nblendfact)
+ INTFLOAT spx_signal_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS];///< spx signal blending factor (sblendfact)
///@}
///@name Adaptive hybrid transform
@@ -142,15 +152,15 @@ typedef struct AC3DecodeContext {
int fbw_channels; ///< number of full-bandwidth channels
int channels; ///< number of total channels
int lfe_ch; ///< index of LFE channel
- float downmix_coeffs[AC3_MAX_CHANNELS][2]; ///< stereo downmix coefficients
+ SHORTFLOAT downmix_coeffs[AC3_MAX_CHANNELS][2]; ///< stereo downmix coefficients
int downmixed; ///< indicates if coeffs are currently downmixed
int output_mode; ///< output channel configuration
int out_channels; ///< number of output channels
///@}
///@name Dynamic range
- float dynamic_range[2]; ///< dynamic range
- float drc_scale; ///< percentage of dynamic range compression to be applied
+ INTFLOAT dynamic_range[2]; ///< dynamic range
+ INTFLOAT drc_scale; ///< percentage of dynamic range compression to be applied
///@}
///@name Bandwidth
@@ -198,22 +208,26 @@ typedef struct AC3DecodeContext {
///@name Optimization
DSPContext dsp; ///< for optimization
+#if USE_FIXED
+ AVFixedDSPContext *fdsp;
+#else
AVFloatDSPContext fdsp;
+#endif
AC3DSPContext ac3dsp;
FmtConvertContext fmt_conv; ///< optimized conversion functions
///@}
- float *outptr[AC3_MAX_CHANNELS];
- float *xcfptr[AC3_MAX_CHANNELS];
- float *dlyptr[AC3_MAX_CHANNELS];
+ SHORTFLOAT *outptr[AC3_MAX_CHANNELS];
+ INTFLOAT *xcfptr[AC3_MAX_CHANNELS];
+ INTFLOAT *dlyptr[AC3_MAX_CHANNELS];
///@name Aligned arrays
- DECLARE_ALIGNED(16, int32_t, fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< fixed-point transform coefficients
- DECLARE_ALIGNED(32, float, transform_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< transform coefficients
- DECLARE_ALIGNED(32, float, delay)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< delay - added to the next block
- DECLARE_ALIGNED(32, float, window)[AC3_BLOCK_SIZE]; ///< window coefficients
- DECLARE_ALIGNED(32, float, tmp_output)[AC3_BLOCK_SIZE]; ///< temporary storage for output before windowing
- DECLARE_ALIGNED(32, float, output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< output after imdct transform and windowing
+ DECLARE_ALIGNED(16, int, fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< fixed-point transform coefficients
+ DECLARE_ALIGNED(32, INTFLOAT, transform_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< transform coefficients
+ DECLARE_ALIGNED(32, INTFLOAT, delay)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< delay - added to the next block
+ DECLARE_ALIGNED(32, INTFLOAT, window)[AC3_BLOCK_SIZE]; ///< window coefficients
+ DECLARE_ALIGNED(32, INTFLOAT, tmp_output)[AC3_BLOCK_SIZE]; ///< temporary storage for output before windowing
+ DECLARE_ALIGNED(32, SHORTFLOAT, output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< output after imdct transform and windowing
DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread
///@}
} AC3DecodeContext;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dec_fixed.c b/chromium/third_party/ffmpeg/libavcodec/ac3dec_fixed.c
new file mode 100644
index 00000000000..c6cbeb9b285
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3dec_fixed.c
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2012
+ * MIPS Technologies, Inc., California.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Author: Stanislav Ocovaj (socovaj@mips.com)
+ *
+ * AC3 fixed-point decoder for MIPS platforms
+ *
+ * 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
+ */
+
+#define FFT_FLOAT 0
+#define USE_FIXED 1
+#define FFT_FIXED_32 1
+#include "ac3dec.h"
+
+
+/**
+ * Table for center mix levels
+ * reference: Section 5.4.2.4 cmixlev
+ */
+static const uint8_t center_levels[4] = { 4, 5, 6, 5 };
+
+/**
+ * Table for surround mix levels
+ * reference: Section 5.4.2.5 surmixlev
+ */
+static const uint8_t surround_levels[4] = { 4, 6, 7, 6 };
+
+int end_freq_inv_tab[8] =
+{
+ 50529027, 44278013, 39403370, 32292987, 27356480, 23729101, 20951060, 18755316
+};
+
+static void scale_coefs (
+ int32_t *dst,
+ const int32_t *src,
+ int dynrng,
+ int len)
+{
+ int i, shift, round;
+ int16_t mul;
+ int temp, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
+
+ mul = (dynrng & 0x1f) + 0x20;
+ shift = 4 - ((dynrng << 24) >> 29);
+ round = 1 << (shift-1);
+ for (i=0; i<len; i+=8) {
+
+ temp = src[i] * mul;
+ temp1 = src[i+1] * mul;
+ temp = temp + round;
+ temp2 = src[i+2] * mul;
+
+ temp1 = temp1 + round;
+ dst[i] = temp >> shift;
+ temp3 = src[i+3] * mul;
+ temp2 = temp2 + round;
+
+ dst[i+1] = temp1 >> shift;
+ temp4 = src[i + 4] * mul;
+ temp3 = temp3 + round;
+ dst[i+2] = temp2 >> shift;
+
+ temp5 = src[i+5] * mul;
+ temp4 = temp4 + round;
+ dst[i+3] = temp3 >> shift;
+ temp6 = src[i+6] * mul;
+
+ dst[i+4] = temp4 >> shift;
+ temp5 = temp5 + round;
+ temp7 = src[i+7] * mul;
+ temp6 = temp6 + round;
+
+ dst[i+5] = temp5 >> shift;
+ temp7 = temp7 + round;
+ dst[i+6] = temp6 >> shift;
+ dst[i+7] = temp7 >> shift;
+
+ }
+}
+
+/**
+ * Downmix samples from original signal to stereo or mono (this is for 16-bit samples
+ * and fixed point decoder - original (for 32-bit samples) is in ac3dsp.c).
+ */
+static void ac3_downmix_c_fixed16(int16_t **samples, int16_t (*matrix)[2],
+ int out_ch, int in_ch, int len)
+{
+ int i, j;
+ int v0, v1;
+ if (out_ch == 2) {
+ for (i = 0; i < len; i++) {
+ v0 = v1 = 0;
+ for (j = 0; j < in_ch; j++) {
+ v0 += samples[j][i] * matrix[j][0];
+ v1 += samples[j][i] * matrix[j][1];
+ }
+ samples[0][i] = (v0+2048)>>12;
+ samples[1][i] = (v1+2048)>>12;
+ }
+ } else if (out_ch == 1) {
+ for (i = 0; i < len; i++) {
+ v0 = 0;
+ for (j = 0; j < in_ch; j++)
+ v0 += samples[j][i] * matrix[j][0];
+ samples[0][i] = (v0+2048)>>12;
+ }
+ }
+}
+
+#include "ac3dec.c"
+
+static const AVOption options[] = {
+ { NULL},
+};
+
+static const AVClass ac3_decoder_class = {
+ .class_name = "Fixed-Point AC-3 Decoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_ac3_fixed_decoder = {
+ .name = "ac3_fixed",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_AC3,
+ .priv_data_size = sizeof (AC3DecodeContext),
+ .init = ac3_decode_init,
+ .close = ac3_decode_end,
+ .decode = ac3_decode_frame,
+ .capabilities = CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
+ .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
+ AV_SAMPLE_FMT_NONE },
+ .priv_class = &ac3_decoder_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dec_float.c b/chromium/third_party/ffmpeg/libavcodec/ac3dec_float.c
new file mode 100644
index 00000000000..7108921701b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3dec_float.c
@@ -0,0 +1,89 @@
+/*
+ * AC-3 Audio Decoder
+ * This code was developed as part of Google Summer of Code 2006.
+ * E-AC-3 support was added as part of Google Summer of Code 2007.
+ *
+ * Copyright (c) 2006 Kartikey Mahendra BHATT (bhattkm at gmail dot com)
+ * Copyright (c) 2007-2008 Bartlomiej Wolowiec <bartek.wolowiec@gmail.com>
+ * Copyright (c) 2007 Justin Ruggles <justin.ruggles@gmail.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
+ */
+
+/**
+ * Upmix delay samples from stereo to original channel layout.
+ */
+#include "ac3dec.h"
+#include "ac3dec.c"
+
+static const AVOption options[] = {
+ { "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 1.0}, 0.0, 6.0, PAR },
+
+{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 2, 0, "dmix_mode"},
+{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
+{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
+{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
+{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
+
+ { NULL},
+};
+
+static const AVClass ac3_decoder_class = {
+ .class_name = "AC3 decoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_ac3_decoder = {
+ .name = "ac3",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_AC3,
+ .priv_data_size = sizeof (AC3DecodeContext),
+ .init = ac3_decode_init,
+ .close = ac3_decode_end,
+ .decode = ac3_decode_frame,
+ .capabilities = CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
+ .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
+ AV_SAMPLE_FMT_NONE },
+ .priv_class = &ac3_decoder_class,
+};
+
+#if CONFIG_EAC3_DECODER
+static const AVClass eac3_decoder_class = {
+ .class_name = "E-AC3 decoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_eac3_decoder = {
+ .name = "eac3",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_EAC3,
+ .priv_data_size = sizeof (AC3DecodeContext),
+ .init = ac3_decode_init,
+ .close = ac3_decode_end,
+ .decode = ac3_decode_frame,
+ .capabilities = CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
+ .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
+ AV_SAMPLE_FMT_NONE },
+ .priv_class = &eac3_decoder_class,
+};
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dsp.c b/chromium/third_party/ffmpeg/libavcodec/ac3dsp.c
index feda6ddc6e8..b746817c9d9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3dsp.c
@@ -1,5 +1,5 @@
/*
- * AC-3 DSP utils
+ * AC-3 DSP functions
* Copyright (c) 2011 Justin Ruggles
*
* This file is part of FFmpeg.
@@ -239,6 +239,31 @@ static void ac3_downmix_c(float **samples, float (*matrix)[2],
}
}
+static void ac3_downmix_c_fixed(int32_t **samples, int16_t (*matrix)[2],
+ int out_ch, int in_ch, int len)
+{
+ int i, j;
+ int64_t v0, v1;
+ if (out_ch == 2) {
+ for (i = 0; i < len; i++) {
+ v0 = v1 = 0;
+ for (j = 0; j < in_ch; j++) {
+ v0 += (int64_t)samples[j][i] * matrix[j][0];
+ v1 += (int64_t)samples[j][i] * matrix[j][1];
+ }
+ samples[0][i] = (v0+2048)>>12;
+ samples[1][i] = (v1+2048)>>12;
+ }
+ } else if (out_ch == 1) {
+ for (i = 0; i < len; i++) {
+ v0 = 0;
+ for (j = 0; j < in_ch; j++)
+ v0 += (int64_t)samples[j][i] * matrix[j][0];
+ samples[0][i] = (v0+2048)>>12;
+ }
+ }
+}
+
static void apply_window_int16_c(int16_t *output, const int16_t *input,
const int16_t *window, unsigned int len)
{
@@ -266,6 +291,7 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
c->sum_square_butterfly_int32 = ac3_sum_square_butterfly_int32_c;
c->sum_square_butterfly_float = ac3_sum_square_butterfly_float_c;
c->downmix = ac3_downmix_c;
+ c->downmix_fixed = ac3_downmix_c_fixed;
c->apply_window_int16 = apply_window_int16_c;
if (ARCH_ARM)
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dsp.h b/chromium/third_party/ffmpeg/libavcodec/ac3dsp.h
index bced5974e1f..ed98c8ce6ae 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3dsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3dsp.h
@@ -1,5 +1,5 @@
/*
- * AC-3 DSP utils
+ * AC-3 DSP functions
* Copyright (c) 2011 Justin Ruggles
*
* This file is part of FFmpeg.
@@ -135,6 +135,9 @@ typedef struct AC3DSPContext {
void (*downmix)(float **samples, float (*matrix)[2], int out_ch,
int in_ch, int len);
+ void (*downmix_fixed)(int32_t **samples, int16_t (*matrix)[2], int out_ch,
+ int in_ch, int len);
+
/**
* Apply symmetric window in 16-bit fixed-point.
* @param output destination array
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3enc.c b/chromium/third_party/ffmpeg/libavcodec/ac3enc.c
index 37c496cd15c..c13c50bbafb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3enc.c
@@ -1381,7 +1381,7 @@ static void ac3_output_frame_header(AC3EncodeContext *s)
*/
static void output_audio_block(AC3EncodeContext *s, int blk)
{
- int ch, i, baie, bnd, got_cpl, ch0;
+ int ch, i, baie, bnd, got_cpl, av_uninit(ch0);
AC3Block *block = &s->blocks[blk];
/* block switching */
@@ -2246,7 +2246,7 @@ static av_cold int validate_options(AC3EncodeContext *s)
*/
static av_cold void set_bandwidth(AC3EncodeContext *s)
{
- int blk, ch, cpl_start;
+ int blk, ch, av_uninit(cpl_start);
if (s->cutoff) {
/* calculate bandwidth based on user-specified cutoff frequency */
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3enc.h b/chromium/third_party/ffmpeg/libavcodec/ac3enc.h
index a04e704d971..94312ba46fb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3enc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3enc.h
@@ -31,12 +31,14 @@
#include <stdint.h>
#include "libavutil/float_dsp.h"
+
#include "ac3.h"
#include "ac3dsp.h"
#include "avcodec.h"
#include "dsputil.h"
-#include "put_bits.h"
#include "fft.h"
+#include "mathops.h"
+#include "put_bits.h"
#ifndef CONFIG_AC3ENC_FLOAT
#define CONFIG_AC3ENC_FLOAT 0
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3enc_fixed.c b/chromium/third_party/ffmpeg/libavcodec/ac3enc_fixed.c
index 5194d42aee7..3994c17d3bc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3enc_fixed.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3enc_fixed.c
@@ -26,7 +26,7 @@
* fixed-point AC-3 encoder.
*/
-#define CONFIG_FFT_FLOAT 0
+#define FFT_FLOAT 0
#undef CONFIG_AC3ENC_FLOAT
#include "internal.h"
#include "ac3enc.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3enc_float.c b/chromium/third_party/ffmpeg/libavcodec/ac3enc_float.c
index 35fb4189cd5..55ea422ddf4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3enc_float.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3enc_float.c
@@ -73,7 +73,7 @@ av_cold int ff_ac3_float_mdct_init(AC3EncodeContext *s)
n = 1 << 9;
n2 = n >> 1;
- window = av_malloc(n * sizeof(*window));
+ window = av_malloc_array(n, sizeof(*window));
if (!window) {
av_log(s->avctx, AV_LOG_ERROR, "Cannot allocate memory.\n");
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3enc_template.c b/chromium/third_party/ffmpeg/libavcodec/ac3enc_template.c
index 4689f7020bb..45275191750 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3enc_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3enc_template.c
@@ -28,7 +28,11 @@
#include <stdint.h>
+#include "libavutil/attributes.h"
#include "libavutil/internal.h"
+#include "internal.h"
+#include "ac3enc.h"
+#include "eac3enc.h"
/* prototypes for static functions in ac3enc_fixed.c and ac3enc_float.c */
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3tab.c b/chromium/third_party/ffmpeg/libavcodec/ac3tab.c
index 1ae7ddf2a63..d62d8bfbf55 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3tab.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3tab.c
@@ -25,6 +25,8 @@
*/
#include "libavutil/channel_layout.h"
+#include "libavutil/mem.h"
+
#include "avcodec.h"
#include "ac3tab.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3tab.h b/chromium/third_party/ffmpeg/libavcodec/ac3tab.h
index c41a93ecc46..74cbd9ed650 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3tab.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3tab.h
@@ -22,7 +22,9 @@
#ifndef AVCODEC_AC3TAB_H
#define AVCODEC_AC3TAB_H
-#include "libavutil/common.h"
+#include <stdint.h>
+
+#include "libavutil/internal.h"
#include "ac3.h"
#if CONFIG_HARDCODED_TABLES
diff --git a/chromium/third_party/ffmpeg/libavcodec/adpcm.c b/chromium/third_party/ffmpeg/libavcodec/adpcm.c
index 8e20de2a637..e31242f02c6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/adpcm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/adpcm.c
@@ -471,9 +471,11 @@ static void adpcm_swf_decode(AVCodecContext *avctx, const uint8_t *buf, int buf_
* @param[out] coded_samples set to the number of samples as coded in the
* packet, or 0 if the codec does not encode the
* number of samples in each frame.
+ * @param[out] approx_nb_samples set to non-zero if the number of samples
+ * returned is an approximation.
*/
static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
- int buf_size, int *coded_samples)
+ int buf_size, int *coded_samples, int *approx_nb_samples)
{
ADPCMDecodeContext *s = avctx->priv_data;
int nb_samples = 0;
@@ -482,6 +484,7 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
int header_size;
*coded_samples = 0;
+ *approx_nb_samples = 0;
if(ch <= 0)
return 0;
@@ -561,6 +564,7 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
*coded_samples -= *coded_samples % 28;
nb_samples = (buf_size - header_size) * 2 / ch;
nb_samples -= nb_samples % 28;
+ *approx_nb_samples = 1;
break;
case AV_CODEC_ID_ADPCM_IMA_DK3:
if (avctx->block_align > 0)
@@ -663,11 +667,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int16_t **samples_p;
int st; /* stereo */
int count1, count2;
- int nb_samples, coded_samples, ret;
+ int nb_samples, coded_samples, approx_nb_samples, ret;
GetByteContext gb;
bytestream2_init(&gb, buf, buf_size);
- nb_samples = get_nb_samples(avctx, &gb, buf_size, &coded_samples);
+ nb_samples = get_nb_samples(avctx, &gb, buf_size, &coded_samples, &approx_nb_samples);
if (nb_samples <= 0) {
av_log(avctx, AV_LOG_ERROR, "invalid number of samples in packet\n");
return AVERROR_INVALIDDATA;
@@ -683,7 +687,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
/* use coded_samples when applicable */
/* it is always <= nb_samples, so the output buffer will be large enough */
if (coded_samples) {
- if (coded_samples != nb_samples)
+ if (!approx_nb_samples && coded_samples != nb_samples)
av_log(avctx, AV_LOG_WARNING, "mismatch in coded sample count\n");
frame->nb_samples = nb_samples = coded_samples;
}
@@ -917,6 +921,9 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
*samples++ = c->status[0].predictor + c->status[1].predictor;
*samples++ = c->status[0].predictor - c->status[1].predictor;
}
+
+ if ((bytestream2_tell(&gb) & 1))
+ bytestream2_skip(&gb, 1);
break;
}
case AV_CODEC_ID_ADPCM_IMA_ISS:
@@ -1310,7 +1317,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
byte & 0x0F, 4, 0);
}
} else if (avctx->codec->id == AV_CODEC_ID_ADPCM_SBPRO_3) {
- for (n = nb_samples / 3; n > 0; n--) {
+ for (n = (nb_samples<<st) / 3; n > 0; n--) {
int byte = bytestream2_get_byteu(&gb);
*samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
byte >> 5 , 3, 0);
diff --git a/chromium/third_party/ffmpeg/libavcodec/adpcm_data.c b/chromium/third_party/ffmpeg/libavcodec/adpcm_data.c
index 1d3e579a893..21092855301 100644
--- a/chromium/third_party/ffmpeg/libavcodec/adpcm_data.c
+++ b/chromium/third_party/ffmpeg/libavcodec/adpcm_data.c
@@ -47,7 +47,7 @@ static const int8_t adpcm_index_table5[32] = {
-1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16,
};
-const int8_t const *ff_adpcm_index_tables[4] = {
+const int8_t * const ff_adpcm_index_tables[4] = {
&adpcm_index_table2[0],
&adpcm_index_table3[0],
&ff_adpcm_index_table[0],
diff --git a/chromium/third_party/ffmpeg/libavcodec/adpcm_data.h b/chromium/third_party/ffmpeg/libavcodec/adpcm_data.h
index a14d5208858..6589bc56c9b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/adpcm_data.h
+++ b/chromium/third_party/ffmpeg/libavcodec/adpcm_data.h
@@ -31,7 +31,7 @@
static const uint8_t ff_adpcm_ima_block_sizes[4] = { 4, 12, 4, 20 };
static const uint8_t ff_adpcm_ima_block_samples[4] = { 16, 32, 8, 32 };
-extern const int8_t const *ff_adpcm_index_tables[4];
+extern const int8_t * const ff_adpcm_index_tables[4];
extern const int8_t ff_adpcm_index_table[16];
extern const int16_t ff_adpcm_step_table[89];
extern const int16_t ff_adpcm_oki_step_table[49];
diff --git a/chromium/third_party/ffmpeg/libavcodec/adx.c b/chromium/third_party/ffmpeg/libavcodec/adx.c
index 94bc386dab1..30e13c0c1c3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/adx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/adx.c
@@ -47,13 +47,8 @@ int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
return AVERROR_INVALIDDATA;
offset = AV_RB16(buf + 2) + 4;
- if (offset < 6) {
- av_log(avctx, AV_LOG_ERROR, "offset is prior data\n");
- return AVERROR_INVALIDDATA;
- }
-
/* if copyright string is within the provided data, validate it */
- if (bufsize >= offset && memcmp(buf + offset - 6, "(c)CRI", 6))
+ if (bufsize >= offset && offset >= 6 && memcmp(buf + offset - 6, "(c)CRI", 6))
return AVERROR_INVALIDDATA;
/* check for encoding=3 block_size=18, sample_size=4 */
diff --git a/chromium/third_party/ffmpeg/libavcodec/adxdec.c b/chromium/third_party/ffmpeg/libavcodec/adxdec.c
index e59cc929847..ec33e735417 100644
--- a/chromium/third_party/ffmpeg/libavcodec/adxdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/adxdec.c
@@ -157,9 +157,11 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
buf_size -= BLOCK_SIZE;
buf += BLOCK_SIZE;
}
- samples_offset += BLOCK_SAMPLES;
+ if (!c->eof)
+ samples_offset += BLOCK_SAMPLES;
}
+ frame->nb_samples = samples_offset;
*got_frame_ptr = 1;
return buf - avpkt->data;
diff --git a/chromium/third_party/ffmpeg/libavcodec/aic.c b/chromium/third_party/ffmpeg/libavcodec/aic.c
index a7e3691aa08..373cf99a26a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aic.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aic.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "bytestream.h"
#include "dsputil.h"
@@ -169,7 +171,7 @@ static int aic_decode_header(AICContext *ctx, const uint8_t *src, int size)
width = AV_RB16(src + 6);
height = AV_RB16(src + 8);
if (frame_size > size) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Frame size should be %d got %d\n",
+ av_log(ctx->avctx, AV_LOG_ERROR, "Frame size should be %"PRIu32" got %d\n",
frame_size, size);
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/alac.c b/chromium/third_party/ffmpeg/libavcodec/alac.c
index 3f37f61883e..103d14eadab 100644
--- a/chromium/third_party/ffmpeg/libavcodec/alac.c
+++ b/chromium/third_party/ffmpeg/libavcodec/alac.c
@@ -45,6 +45,8 @@
* 32bit samplerate
*/
+#include <inttypes.h>
+
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "get_bits.h"
@@ -283,7 +285,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
else
output_samples = alac->max_samples_per_frame;
if (!output_samples || output_samples > alac->max_samples_per_frame) {
- av_log(avctx, AV_LOG_ERROR, "invalid samples per frame: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "invalid samples per frame: %"PRIu32"\n",
output_samples);
return AVERROR_INVALIDDATA;
}
@@ -294,7 +296,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
if ((ret = ff_thread_get_buffer(avctx, &tframe, 0)) < 0)
return ret;
} else if (output_samples != alac->nb_samples) {
- av_log(avctx, AV_LOG_ERROR, "sample count mismatch: %u != %d\n",
+ av_log(avctx, AV_LOG_ERROR, "sample count mismatch: %"PRIu32" != %d\n",
output_samples, alac->nb_samples);
return AVERROR_INVALIDDATA;
}
@@ -490,7 +492,10 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
avpkt->size * 8 - get_bits_count(&alac->gb));
}
- *got_frame_ptr = 1;
+ if (alac->channels == ch)
+ *got_frame_ptr = 1;
+ else
+ av_log(avctx, AV_LOG_WARNING, "Failed to decode all channels\n");
return avpkt->size;
}
@@ -546,7 +551,8 @@ static int alac_set_info(ALACContext *alac)
alac->max_samples_per_frame = bytestream2_get_be32u(&gb);
if (!alac->max_samples_per_frame ||
alac->max_samples_per_frame > INT_MAX / sizeof(int32_t)) {
- av_log(alac->avctx, AV_LOG_ERROR, "max samples per frame invalid: %u\n",
+ av_log(alac->avctx, AV_LOG_ERROR,
+ "max samples per frame invalid: %"PRIu32"\n",
alac->max_samples_per_frame);
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aliaspixdec.c b/chromium/third_party/ffmpeg/libavcodec/aliaspixdec.c
new file mode 100644
index 00000000000..bdc4c72c218
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aliaspixdec.c
@@ -0,0 +1,128 @@
+/*
+ * Alias PIX image decoder
+ * Copyright (C) 2014 Vittorio Giovara <vittorio.giovara@gmail.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 "libavutil/intreadwrite.h"
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "internal.h"
+
+#define ALIAS_HEADER_SIZE 10
+
+static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
+ AVPacket *avpkt)
+{
+ AVFrame *f = data;
+ GetByteContext gb;
+ int width, height, ret, bits_pixel, pixel;
+ uint8_t *out_buf;
+ uint8_t count;
+ int x, y;
+
+ bytestream2_init(&gb, avpkt->data, avpkt->size);
+
+ if (bytestream2_get_bytes_left(&gb) < ALIAS_HEADER_SIZE) {
+ av_log(avctx, AV_LOG_ERROR, "Header too small %d.\n", avpkt->size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ width = bytestream2_get_be16u(&gb);
+ height = bytestream2_get_be16u(&gb);
+ bytestream2_skipu(&gb, 4); // obsolete X, Y offset
+ bits_pixel = bytestream2_get_be16u(&gb);
+
+ if (bits_pixel == 24)
+ avctx->pix_fmt = AV_PIX_FMT_BGR24;
+ else if (bits_pixel == 8)
+ avctx->pix_fmt = AV_PIX_FMT_GRAY8;
+ else {
+ av_log(avctx, AV_LOG_ERROR, "Invalid pixel format.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ ret = ff_set_dimensions(avctx, width, height);
+ if (ret < 0)
+ return ret;
+
+ ret = ff_get_buffer(avctx, f, 0);
+ if (ret < 0)
+ return ret;
+
+ f->pict_type = AV_PICTURE_TYPE_I;
+ f->key_frame = 1;
+
+ x = 0;
+ y = 1;
+ out_buf = f->data[0];
+ while (bytestream2_get_bytes_left(&gb) > 0) {
+ int i;
+
+ /* set buffer at the right position at every new line */
+ if (x == avctx->width) {
+ x = 0;
+ out_buf = f->data[0] + f->linesize[0] * y++;
+ if (y > avctx->height) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Ended frame decoding with %d bytes left.\n",
+ bytestream2_get_bytes_left(&gb));
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ /* read packet and copy data */
+ count = bytestream2_get_byteu(&gb);
+ if (!count || x + count > avctx->width) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid run length %d.\n", count);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (avctx->pix_fmt == AV_PIX_FMT_BGR24) {
+ pixel = bytestream2_get_be24(&gb);
+ for (i = 0; i < count; i++) {
+ AV_WB24(out_buf, pixel);
+ out_buf += 3;
+ }
+ } else { // AV_PIX_FMT_GRAY8
+ pixel = bytestream2_get_byte(&gb);
+ for (i = 0; i < count; i++)
+ *out_buf++ = pixel;
+ }
+
+ x += i;
+ }
+
+ if (x != width || y != height) {
+ av_log(avctx, AV_LOG_ERROR, "Picture stopped at %d,%d.\n", x, y);
+ return AVERROR_INVALIDDATA;
+ }
+
+ *got_frame = 1;
+ return avpkt->size;
+}
+
+AVCodec ff_alias_pix_decoder = {
+ .name = "alias_pix",
+ .long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_ALIAS_PIX,
+ .decode = decode_frame,
+ .capabilities = CODEC_CAP_DR1,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/aliaspixenc.c b/chromium/third_party/ffmpeg/libavcodec/aliaspixenc.c
new file mode 100644
index 00000000000..1fcea084159
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aliaspixenc.c
@@ -0,0 +1,134 @@
+/*
+ * Alias PIX image encoder
+ * Copyright (C) 2014 Vittorio Giovara <vittorio.giovara@gmail.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 "libavutil/intreadwrite.h"
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "internal.h"
+
+#define ALIAS_HEADER_SIZE 10
+
+static av_cold int encode_init(AVCodecContext *avctx)
+{
+ avctx->coded_frame = av_frame_alloc();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+ return 0;
+}
+
+static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
+ const AVFrame *frame, int *got_packet)
+{
+ int width, height, bits_pixel, i, j, length, ret;
+ uint8_t *in_buf, *buf;
+
+ avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+ avctx->coded_frame->key_frame = 1;
+
+ width = avctx->width;
+ height = avctx->height;
+
+ if (width > 65535 || height > 65535 ||
+ width * height >= INT_MAX / 4 - ALIAS_HEADER_SIZE) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid image size %dx%d.\n", width, height);
+ return AVERROR_INVALIDDATA;
+ }
+
+ switch (avctx->pix_fmt) {
+ case AV_PIX_FMT_GRAY8:
+ bits_pixel = 8;
+ break;
+ case AV_PIX_FMT_BGR24:
+ bits_pixel = 24;
+ break;
+ default:
+ return AVERROR(EINVAL);
+ }
+
+ length = ALIAS_HEADER_SIZE + 4 * width * height; // max possible
+ if ((ret = ff_alloc_packet(pkt, length)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", length);
+ return ret;
+ }
+
+ buf = pkt->data;
+
+ /* Encode header. */
+ bytestream_put_be16(&buf, width);
+ bytestream_put_be16(&buf, height);
+ bytestream_put_be32(&buf, 0); /* X, Y offset */
+ bytestream_put_be16(&buf, bits_pixel);
+
+ for (j = 0; j < height; j++) {
+ in_buf = frame->data[0] + frame->linesize[0] * j;
+ for (i = 0; i < width; ) {
+ int count = 0;
+ int pixel;
+
+ if (avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
+ pixel = *in_buf;
+ while (count < 255 && count + i < width && pixel == *in_buf) {
+ count++;
+ in_buf++;
+ }
+ bytestream_put_byte(&buf, count);
+ bytestream_put_byte(&buf, pixel);
+ } else { /* AV_PIX_FMT_BGR24 */
+ pixel = AV_RB24(in_buf);
+ while (count < 255 && count + i < width &&
+ pixel == AV_RB24(in_buf)) {
+ count++;
+ in_buf += 3;
+ }
+ bytestream_put_byte(&buf, count);
+ bytestream_put_be24(&buf, pixel);
+ }
+ i += count;
+ }
+ }
+
+ /* Total length */
+ av_shrink_packet(pkt, buf - pkt->data);
+ pkt->flags |= AV_PKT_FLAG_KEY;
+ *got_packet = 1;
+
+ return 0;
+}
+
+static av_cold int encode_close(AVCodecContext *avctx)
+{
+ av_frame_free(&avctx->coded_frame);
+ return 0;
+}
+
+AVCodec ff_alias_pix_encoder = {
+ .name = "alias_pix",
+ .long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_ALIAS_PIX,
+ .init = encode_init,
+ .encode2 = encode_frame,
+ .close = encode_close,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_BGR24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
+ },
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/allcodecs.c b/chromium/third_party/ffmpeg/libavcodec/allcodecs.c
index 6d084acb649..ac0f424d6a1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/allcodecs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/allcodecs.c
@@ -79,8 +79,11 @@ void avcodec_register_all(void)
REGISTER_HWACCEL(H264_DXVA2, h264_dxva2);
REGISTER_HWACCEL(H264_VAAPI, h264_vaapi);
REGISTER_HWACCEL(H264_VDA, h264_vda);
+ REGISTER_HWACCEL(H264_VDA_OLD, h264_vda_old);
REGISTER_HWACCEL(H264_VDPAU, h264_vdpau);
+ REGISTER_HWACCEL(MPEG1_XVMC, mpeg1_xvmc);
REGISTER_HWACCEL(MPEG1_VDPAU, mpeg1_vdpau);
+ REGISTER_HWACCEL(MPEG2_XVMC, mpeg2_xvmc);
REGISTER_HWACCEL(MPEG2_DXVA2, mpeg2_dxva2);
REGISTER_HWACCEL(MPEG2_VAAPI, mpeg2_vaapi);
REGISTER_HWACCEL(MPEG2_VDPAU, mpeg2_vdpau);
@@ -98,6 +101,7 @@ void avcodec_register_all(void)
REGISTER_ENCODER(A64MULTI5, a64multi5);
REGISTER_DECODER(AASC, aasc);
REGISTER_DECODER(AIC, aic);
+ REGISTER_ENCDEC (ALIAS_PIX, alias_pix);
REGISTER_ENCDEC (AMV, amv);
REGISTER_DECODER(ANM, anm);
REGISTER_DECODER(ANSI, ansi);
@@ -120,7 +124,7 @@ void avcodec_register_all(void)
REGISTER_DECODER(CAVS, cavs);
REGISTER_DECODER(CDGRAPHICS, cdgraphics);
REGISTER_DECODER(CDXL, cdxl);
- REGISTER_DECODER(CINEPAK, cinepak);
+ REGISTER_ENCDEC (CINEPAK, cinepak);
REGISTER_ENCDEC (CLJR, cljr);
REGISTER_DECODER(CLLC, cllc);
REGISTER_ENCDEC (COMFORTNOISE, comfortnoise);
@@ -148,6 +152,7 @@ void avcodec_register_all(void)
REGISTER_DECODER(EXR, exr);
REGISTER_ENCDEC (FFV1, ffv1);
REGISTER_ENCDEC (FFVHUFF, ffvhuff);
+ REGISTER_DECODER(FIC, fic);
REGISTER_ENCDEC (FLASHSV, flashsv);
REGISTER_ENCDEC (FLASHSV2, flashsv2);
REGISTER_DECODER(FLIC, flic);
@@ -289,6 +294,7 @@ void avcodec_register_all(void)
REGISTER_DECODER(VP6, vp6);
REGISTER_DECODER(VP6A, vp6a);
REGISTER_DECODER(VP6F, vp6f);
+ REGISTER_DECODER(VP7, vp7);
REGISTER_DECODER(VP8, vp8);
REGISTER_DECODER(VP9, vp9);
REGISTER_DECODER(VQA, vqa);
@@ -318,7 +324,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (AAC, aac);
REGISTER_DECODER(AAC_LATM, aac_latm);
REGISTER_ENCDEC (AC3, ac3);
- REGISTER_ENCODER(AC3_FIXED, ac3_fixed);
+ REGISTER_ENCDEC (AC3_FIXED, ac3_fixed);
REGISTER_ENCDEC (ALAC, alac);
REGISTER_DECODER(ALS, als);
REGISTER_DECODER(AMRNB, amrnb);
@@ -326,11 +332,16 @@ void avcodec_register_all(void)
REGISTER_DECODER(APE, ape);
REGISTER_DECODER(ATRAC1, atrac1);
REGISTER_DECODER(ATRAC3, atrac3);
+ REGISTER_DECODER(ATRAC3P, atrac3p);
REGISTER_DECODER(BINKAUDIO_DCT, binkaudio_dct);
REGISTER_DECODER(BINKAUDIO_RDFT, binkaudio_rdft);
REGISTER_DECODER(BMV_AUDIO, bmv_audio);
REGISTER_DECODER(COOK, cook);
REGISTER_ENCDEC (DCA, dca);
+ REGISTER_DECODER(DSD_LSBF, dsd_lsbf);
+ REGISTER_DECODER(DSD_MSBF, dsd_msbf);
+ REGISTER_DECODER(DSD_LSBF_PLANAR, dsd_lsbf_planar);
+ REGISTER_DECODER(DSD_MSBF_PLANAR, dsd_msbf_planar);
REGISTER_DECODER(DSICINAUDIO, dsicinaudio);
REGISTER_ENCDEC (EAC3, eac3);
REGISTER_DECODER(EVRC, evrc);
@@ -360,6 +371,8 @@ void avcodec_register_all(void)
REGISTER_DECODER(MPC7, mpc7);
REGISTER_DECODER(MPC8, mpc8);
REGISTER_ENCDEC (NELLYMOSER, nellymoser);
+ REGISTER_DECODER(ON2AVC, on2avc);
+ REGISTER_DECODER(OPUS, opus);
REGISTER_DECODER(PAF_AUDIO, paf_audio);
REGISTER_DECODER(QCELP, qcelp);
REGISTER_DECODER(QDM2, qdm2);
@@ -458,6 +471,7 @@ void avcodec_register_all(void)
REGISTER_DECODER(ADPCM_SBPRO_4, adpcm_sbpro_4);
REGISTER_ENCDEC (ADPCM_SWF, adpcm_swf);
REGISTER_DECODER(ADPCM_THP, adpcm_thp);
+ REGISTER_DECODER(ADPCM_VIMA, adpcm_vima);
REGISTER_DECODER(ADPCM_XA, adpcm_xa);
REGISTER_ENCDEC (ADPCM_YAMAHA, adpcm_yamaha);
REGISTER_DECODER(VIMA, vima);
@@ -509,8 +523,10 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (LIBVPX_VP8, libvpx_vp8);
REGISTER_ENCDEC (LIBVPX_VP9, libvpx_vp9);
REGISTER_ENCODER(LIBWAVPACK, libwavpack);
+ REGISTER_ENCODER(LIBWEBP, libwebp);
REGISTER_ENCODER(LIBX264, libx264);
REGISTER_ENCODER(LIBX264RGB, libx264rgb);
+ REGISTER_ENCODER(LIBX265, libx265);
REGISTER_ENCODER(LIBXAVS, libxavs);
REGISTER_ENCODER(LIBXVID, libxvid);
REGISTER_DECODER(LIBZVBI_TELETEXT, libzvbi_teletext);
@@ -547,6 +563,7 @@ void avcodec_register_all(void)
REGISTER_PARSER(MPEG4VIDEO, mpeg4video);
REGISTER_PARSER(MPEGAUDIO, mpegaudio);
REGISTER_PARSER(MPEGVIDEO, mpegvideo);
+ REGISTER_PARSER(OPUS, opus);
REGISTER_PARSER(PNG, png);
REGISTER_PARSER(PNM, pnm);
REGISTER_PARSER(RV30, rv30);
diff --git a/chromium/third_party/ffmpeg/libavcodec/alsdec.c b/chromium/third_party/ffmpeg/libavcodec/alsdec.c
index 825949f6a73..ace69746cf2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/alsdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/alsdec.c
@@ -25,6 +25,8 @@
* @author Thilo Borgmann <thilo.borgmann _at_ mail.de>
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "get_bits.h"
#include "unary.h"
@@ -688,7 +690,11 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
} else {
*bd->opt_order = sconf->max_order;
}
-
+ if (*bd->opt_order > bd->block_length) {
+ *bd->opt_order = bd->block_length;
+ av_log(avctx, AV_LOG_ERROR, "Predictor order too large.\n");
+ return AVERROR_INVALIDDATA;
+ }
opt_order = *bd->opt_order;
if (opt_order) {
@@ -718,7 +724,9 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
int offset = parcor_rice_table[sconf->coef_table][k][0];
quant_cof[k] = decode_rice(gb, rice_param) + offset;
if (quant_cof[k] < -64 || quant_cof[k] > 63) {
- av_log(avctx, AV_LOG_ERROR, "quant_cof %d is out of range.\n", quant_cof[k]);
+ av_log(avctx, AV_LOG_ERROR,
+ "quant_cof %"PRIu32" is out of range.\n",
+ quant_cof[k]);
return AVERROR_INVALIDDATA;
}
}
@@ -1263,14 +1271,16 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
bd->quant_cof = ctx->quant_cof[c];
bd->raw_samples = ctx->raw_samples[c] + offset;
- dep = 0;
- while (!ch[dep].stop_flag) {
+ for (dep = 0; !ch[dep].stop_flag; dep++) {
unsigned int smp;
unsigned int begin = 1;
unsigned int end = bd->block_length - 1;
int64_t y;
int32_t *master = ctx->raw_samples[ch[dep].master_channel] + offset;
+ if (ch[dep].master_channel == c)
+ continue;
+
if (ch[dep].time_diff_flag) {
int t = ch[dep].time_diff_index;
@@ -1302,8 +1312,6 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
bd->raw_samples[smp] += y >> 7;
}
}
-
- dep++;
}
return 0;
@@ -1391,6 +1399,12 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
for (b = 0; b < ctx->num_blocks; b++) {
bd.block_length = div_blocks[b];
+ if (bd.block_length <= 0) {
+ av_log(ctx->avctx, AV_LOG_WARNING,
+ "Invalid block length %u in channel data!\n",
+ bd.block_length);
+ continue;
+ }
for (c = 0; c < avctx->channels; c++) {
bd.const_block = ctx->const_block + c;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ansi.c b/chromium/third_party/ffmpeg/libavcodec/ansi.c
index 143b0aa12b1..45c307f3170 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ansi.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ansi.c
@@ -420,7 +420,7 @@ static int decode_frame(AVCodecContext *avctx,
switch(buf[0]) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- if (s->nb_args < MAX_NB_ARGS)
+ if (s->nb_args < MAX_NB_ARGS && s->args[s->nb_args] < 6553)
s->args[s->nb_args] = FFMAX(s->args[s->nb_args], 0) * 10 + buf[0] - '0';
break;
case ';':
diff --git a/chromium/third_party/ffmpeg/libavcodec/apedec.c b/chromium/third_party/ffmpeg/libavcodec/apedec.c
index 6ec502b796a..1fd41cdd9d4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/apedec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/apedec.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
@@ -527,7 +529,7 @@ static inline int ape_decode_value_3900(APEContext *ctx, APERice *rice)
return AVERROR_INVALIDDATA;
}
x = range_decode_bits(ctx, tmpk);
- } else if (tmpk <= 32) {
+ } else if (tmpk <= 31) {
x = range_decode_bits(ctx, 16);
x |= (range_decode_bits(ctx, tmpk - 16) << 16);
} else {
@@ -603,10 +605,14 @@ static void decode_array_0000(APEContext *ctx, GetBitContext *gb,
rice->ksum += out[i];
}
rice->k = av_log2(rice->ksum / 10) + 1;
+ if (rice->k >= 24)
+ return;
for (; i < 64; i++) {
out[i] = get_rice_ook(&ctx->gb, rice->k);
rice->ksum += out[i];
rice->k = av_log2(rice->ksum / ((i + 1) * 2)) + 1;
+ if (rice->k >= 24)
+ return;
}
ksummax = 1 << rice->k + 7;
ksummin = rice->k ? (1 << rice->k + 6) : 0;
@@ -1434,7 +1440,7 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
}
if (s->fileversion < 3950) // previous versions overread two bytes
buf_size += 2;
- av_fast_malloc(&s->data, &s->data_size, buf_size);
+ av_fast_padded_malloc(&s->data, &s->data_size, buf_size);
if (!s->data)
return AVERROR(ENOMEM);
s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size >> 2);
@@ -1465,7 +1471,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
}
if (!nblocks || nblocks > INT_MAX) {
- av_log(avctx, AV_LOG_ERROR, "Invalid sample count: %u.\n", nblocks);
+ av_log(avctx, AV_LOG_ERROR, "Invalid sample count: %"PRIu32".\n",
+ nblocks);
return AVERROR_INVALIDDATA;
}
s->samples = nblocks;
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/Makefile b/chromium/third_party/ffmpeg/libavcodec/arm/Makefile
index 201f897a610..1b21906fa6a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/Makefile
@@ -2,19 +2,14 @@ ARCH_HEADERS = mathops.h
OBJS += arm/fmtconvert_init_arm.o
-OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_init_arm.o \
- arm/sbrdsp_init_arm.o
OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \
arm/ac3dsp_arm.o
-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o
OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_arm.o \
arm/dsputil_arm.o \
arm/jrevdct_arm.o \
arm/simple_idct_arm.o
OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o \
arm/fft_fixed_init_arm.o
-OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \
- arm/flacdsp_arm.o
OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o
OBJS-$(CONFIG_H264DSP) += arm/h264dsp_init_arm.o
OBJS-$(CONFIG_H264PRED) += arm/h264pred_init_arm.o
@@ -23,14 +18,25 @@ OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_arm.o \
arm/hpeldsp_arm.o
OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o
OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o
-OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o
+OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o
+OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o
OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_init_arm.o
+
+OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_init_arm.o \
+ arm/sbrdsp_init_arm.o
+OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o
+OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \
+ arm/flacdsp_arm.o
+OBJS-$(CONFIG_FLAC_ENCODER) += arm/flacdsp_init_arm.o
+OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o
+OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_arm.o
+OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o
OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_init_arm.o
+OBJS-$(CONFIG_VP7_DECODER) += arm/vp8dsp_init_arm.o
OBJS-$(CONFIG_VP8_DECODER) += arm/vp8dsp_init_arm.o
OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_init_arm.o
OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \
arm/rv40dsp_init_arm.o
-OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o \
ARMV5TE-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv5te.o \
arm/simple_idct_armv5te.o
@@ -39,34 +45,39 @@ ARMV5TE-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_armv5te.o \
ARMV5TE-OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_armv5te.o \
arm/videodsp_armv5te.o
-ARMV6-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv6.o \
- arm/dsputil_armv6.o \
- arm/simple_idct_armv6.o \
+ARMV5TE-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv5te.o
ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o
-ARMV6-OBJS-$(CONFIG_H264DSP) += arm/h264dsp_armv6.o
+ARMV6-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv6.o \
+ arm/dsputil_armv6.o \
+ arm/simple_idct_armv6.o
+ARMV6-OBJS-$(CONFIG_H264DSP) += arm/startcode_armv6.o
ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \
arm/hpeldsp_armv6.o
ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o
+
+ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o
+ARMV6-OBJS-$(CONFIG_VC1_DECODER) += arm/startcode_armv6.o
+ARMV6-OBJS-$(CONFIG_VC1_PARSER) += arm/startcode_armv6.o
+ARMV6-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8_armv6.o \
+ arm/vp8dsp_init_armv6.o \
+ arm/vp8dsp_armv6.o
ARMV6-OBJS-$(CONFIG_VP8_DECODER) += arm/vp8_armv6.o \
arm/vp8dsp_init_armv6.o \
arm/vp8dsp_armv6.o
VFP-OBJS += arm/fmtconvert_vfp.o
-VFP-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_vfp.o \
- arm/synth_filter_vfp.o
VFP-OBJS-$(CONFIG_FFT) += arm/fft_vfp.o
VFP-OBJS-$(CONFIG_MDCT) += arm/mdct_vfp.o
VFP-OBJS-$(HAVE_ARMV6) += arm/fmtconvert_vfp_armv6.o
+VFP-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_vfp.o \
+ arm/synth_filter_vfp.o
+
NEON-OBJS += arm/fmtconvert_neon.o
NEON-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_neon.o
-NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_neon.o \
- arm/sbrdsp_neon.o
-NEON-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_neon.o \
- arm/synth_filter_neon.o
NEON-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_neon.o \
arm/dsputil_neon.o \
arm/int_neon.o \
@@ -85,11 +96,20 @@ NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \
arm/mdct_fixed_neon.o
NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o
NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o
+NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o
+
+NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_neon.o \
+ arm/sbrdsp_neon.o
+NEON-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_neon.o \
+ arm/synth_filter_neon.o
NEON-OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_neon.o
NEON-OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_neon.o \
arm/rv40dsp_neon.o
+NEON-OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_neon.o \
+ arm/vc1dsp_neon.o
NEON-OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_neon.o
-NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o
NEON-OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_neon.o
+NEON-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8dsp_init_neon.o \
+ arm/vp8dsp_neon.o
NEON-OBJS-$(CONFIG_VP8_DECODER) += arm/vp8dsp_init_neon.o \
arm/vp8dsp_neon.o
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/asm-offsets.h b/chromium/third_party/ffmpeg/libavcodec/arm/asm-offsets.h
index 5cfc5cb10c2..a2174b0a089 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/asm-offsets.h
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/asm-offsets.h
@@ -21,19 +21,12 @@
#ifndef AVCODEC_ARM_ASM_OFFSETS_H
#define AVCODEC_ARM_ASM_OFFSETS_H
-#ifndef __ASSEMBLER__
-#include <stddef.h>
-#define CHK_OFFS(s, m, o) struct check_##o { \
- int x_##o[offsetof(s, m) == o? 1: -1]; \
- }
-#endif
-
/* MpegEncContext */
-#define Y_DC_SCALE 0xa8
-#define C_DC_SCALE 0xac
-#define AC_PRED 0xb0
-#define BLOCK_LAST_INDEX 0xb4
-#define H263_AIC 0xe4
-#define INTER_SCANTAB_RASTER_END 0x12c
+#define Y_DC_SCALE 0x04
+#define C_DC_SCALE 0x08
+#define AC_PRED 0x0c
+#define BLOCK_LAST_INDEX 0x10
+#define H263_AIC 0x40
+#define INTER_SCANTAB_RASTER_END 0x88
#endif /* AVCODEC_ARM_ASM_OFFSETS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/cabac.h b/chromium/third_party/ffmpeg/libavcodec/arm/cabac.h
new file mode 100644
index 00000000000..fdbf86b45e7
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/cabac.h
@@ -0,0 +1,108 @@
+/*
+ * 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_ARM_CABAC_H
+#define AVCODEC_ARM_CABAC_H
+
+#include "config.h"
+#if HAVE_ARMV6T2_INLINE
+
+#include "libavutil/attributes.h"
+#include "libavutil/internal.h"
+#include "libavcodec/cabac.h"
+
+#define get_cabac_inline get_cabac_inline_arm
+static av_always_inline int get_cabac_inline_arm(CABACContext *c,
+ uint8_t *const state)
+{
+ int bit;
+ void *reg_b, *reg_c, *tmp;
+
+ __asm__ volatile(
+ "ldrb %[bit] , [%[state]] \n\t"
+ "add %[r_b] , %[tables] , %[lps_off] \n\t"
+ "mov %[tmp] , %[range] \n\t"
+ "and %[range] , %[range] , #0xC0 \n\t"
+ "add %[r_b] , %[r_b] , %[bit] \n\t"
+ "ldrb %[range] , [%[r_b], %[range], lsl #1] \n\t"
+ "add %[r_b] , %[tables] , %[norm_off] \n\t"
+ "sub %[r_c] , %[tmp] , %[range] \n\t"
+ "lsl %[tmp] , %[r_c] , #17 \n\t"
+ "cmp %[tmp] , %[low] \n\t"
+ "it gt \n\t"
+ "movgt %[range] , %[r_c] \n\t"
+ "itt cc \n\t"
+ "mvncc %[bit] , %[bit] \n\t"
+ "subcc %[low] , %[low] , %[tmp] \n\t"
+ "add %[r_c] , %[tables] , %[mlps_off] \n\t"
+ "ldrb %[tmp] , [%[r_b], %[range]] \n\t"
+ "ldrb %[r_b] , [%[r_c], %[bit]] \n\t"
+ "lsl %[low] , %[low] , %[tmp] \n\t"
+ "lsl %[range] , %[range] , %[tmp] \n\t"
+ "uxth %[r_c] , %[low] \n\t"
+ "strb %[r_b] , [%[state]] \n\t"
+ "tst %[r_c] , %[r_c] \n\t"
+ "bne 2f \n\t"
+ "ldr %[r_c] , [%[c], %[byte]] \n\t"
+#if UNCHECKED_BITSTREAM_READER
+ "ldrh %[tmp] , [%[r_c]] \n\t"
+ "add %[r_c] , %[r_c] , #2 \n\t"
+ "str %[r_c] , [%[c], %[byte]] \n\t"
+#else
+ "ldr %[r_b] , [%[c], %[end]] \n\t"
+ "ldrh %[tmp] , [%[r_c]] \n\t"
+ "cmp %[r_c] , %[r_b] \n\t"
+ "itt lt \n\t"
+ "addlt %[r_c] , %[r_c] , #2 \n\t"
+ "strlt %[r_c] , [%[c], %[byte]] \n\t"
+#endif
+ "sub %[r_c] , %[low] , #1 \n\t"
+ "add %[r_b] , %[tables] , %[norm_off] \n\t"
+ "eor %[r_c] , %[low] , %[r_c] \n\t"
+ "rev %[tmp] , %[tmp] \n\t"
+ "lsr %[r_c] , %[r_c] , #15 \n\t"
+ "lsr %[tmp] , %[tmp] , #15 \n\t"
+ "ldrb %[r_c] , [%[r_b], %[r_c]] \n\t"
+ "movw %[r_b] , #0xFFFF \n\t"
+ "sub %[tmp] , %[tmp] , %[r_b] \n\t"
+ "rsb %[r_c] , %[r_c] , #7 \n\t"
+ "lsl %[tmp] , %[tmp] , %[r_c] \n\t"
+ "add %[low] , %[low] , %[tmp] \n\t"
+ "2: \n\t"
+ : [bit]"=&r"(bit),
+ [low]"+&r"(c->low),
+ [range]"+&r"(c->range),
+ [r_b]"=&r"(reg_b),
+ [r_c]"=&r"(reg_c),
+ [tmp]"=&r"(tmp)
+ : [c]"r"(c),
+ [state]"r"(state),
+ [tables]"r"(ff_h264_cabac_tables),
+ [byte]"M"(offsetof(CABACContext, bytestream)),
+ [end]"M"(offsetof(CABACContext, bytestream_end)),
+ [norm_off]"I"(H264_NORM_SHIFT_OFFSET),
+ [lps_off]"I"(H264_LPS_RANGE_OFFSET),
+ [mlps_off]"I"(H264_MLPS_STATE_OFFSET + 128)
+ : "memory", "cc"
+ );
+
+ return bit & 1;
+}
+#endif /* HAVE_ARMV6T2_INLINE */
+
+#endif /* AVCODEC_ARM_CABAC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/dca.h b/chromium/third_party/ffmpeg/libavcodec/arm/dca.h
index 35971a8c3f6..6e87111a328 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/dca.h
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/dca.h
@@ -24,6 +24,7 @@
#include <stdint.h>
#include "config.h"
+#include "libavcodec/dcadsp.h"
#include "libavcodec/mathops.h"
#if HAVE_ARMV6_INLINE && AV_GCC_VERSION_AT_LEAST(4,4) && !CONFIG_THUMB
@@ -78,26 +79,4 @@ static inline int decode_blockcodes(int code1, int code2, int levels,
#endif
-#if HAVE_NEON_INLINE && HAVE_ASM_MOD_Y
-
-#define int8x8_fmul_int32 int8x8_fmul_int32
-static inline void int8x8_fmul_int32(float *dst, const int8_t *src, int scale)
-{
- __asm__ ("vcvt.f32.s32 %2, %2, #4 \n"
- "vld1.8 {d0}, [%1,:64] \n"
- "vmovl.s8 q0, d0 \n"
- "vmovl.s16 q1, d1 \n"
- "vmovl.s16 q0, d0 \n"
- "vcvt.f32.s32 q0, q0 \n"
- "vcvt.f32.s32 q1, q1 \n"
- "vmul.f32 q0, q0, %y2 \n"
- "vmul.f32 q1, q1, %y2 \n"
- "vst1.32 {q0-q1}, [%m0,:128] \n"
- : "=Um"(*(float (*)[8])dst)
- : "r"(src), "x"(scale)
- : "d0", "d1", "d2", "d3");
-}
-
-#endif
-
#endif /* AVCODEC_ARM_DCA_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_init_arm.c
index 8893f48368f..a54951584fd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_init_arm.c
@@ -24,16 +24,18 @@
#include "libavutil/attributes.h"
#include "libavcodec/dcadsp.h"
-void ff_dca_lfe_fir_vfp(float *out, const float *in, const float *coefs,
- int decifactor, float scale);
+void ff_dca_lfe_fir0_neon(float *out, const float *in, const float *coefs);
+void ff_dca_lfe_fir1_neon(float *out, const float *in, const float *coefs);
+
+void ff_dca_lfe_fir32_vfp(float *out, const float *in, const float *coefs);
+void ff_dca_lfe_fir64_vfp(float *out, const float *in, const float *coefs);
+
void ff_dca_qmf_32_subbands_vfp(float samples_in[32][8], int sb_act,
SynthFilterContext *synth, FFTContext *imdct,
float synth_buf_ptr[512],
int *synth_buf_offset, float synth_buf2[32],
const float window[512], float *samples_out,
float raXin[32], float scale);
-void ff_dca_lfe_fir_neon(float *out, const float *in, const float *coefs,
- int decifactor, float scale);
void ff_synth_filter_float_vfp(FFTContext *imdct,
float *synth_buf_ptr, int *synth_buf_offset,
@@ -47,16 +49,26 @@ void ff_synth_filter_float_neon(FFTContext *imdct,
float out[32], const float in[32],
float scale);
+void ff_decode_hf_neon(float dst[DCA_SUBBANDS][8],
+ const int32_t vq_num[DCA_SUBBANDS],
+ const int8_t hf_vq[1024][32], intptr_t vq_offset,
+ int32_t scale[DCA_SUBBANDS][2],
+ intptr_t start, intptr_t end);
+
av_cold void ff_dcadsp_init_arm(DCADSPContext *s)
{
int cpu_flags = av_get_cpu_flags();
if (have_vfp(cpu_flags) && !have_vfpv3(cpu_flags)) {
- s->lfe_fir = ff_dca_lfe_fir_vfp;
+ s->lfe_fir[0] = ff_dca_lfe_fir32_vfp;
+ s->lfe_fir[1] = ff_dca_lfe_fir64_vfp;
s->qmf_32_subbands = ff_dca_qmf_32_subbands_vfp;
}
- if (have_neon(cpu_flags))
- s->lfe_fir = ff_dca_lfe_fir_neon;
+ if (have_neon(cpu_flags)) {
+ s->lfe_fir[0] = ff_dca_lfe_fir0_neon;
+ s->lfe_fir[1] = ff_dca_lfe_fir1_neon;
+ s->decode_hf = ff_decode_hf_neon;
+ }
}
av_cold void ff_synth_filter_init_arm(SynthFilterContext *s)
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_neon.S
index 6a6c77aca81..cdc41367e94 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_neon.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_neon.S
@@ -20,17 +20,50 @@
#include "libavutil/arm/asm.S"
-function ff_dca_lfe_fir_neon, export=1
+function ff_decode_hf_neon, export=1
+ push {r4-r5,lr}
+ add r2, r2, r3
+ ldr r3, [sp, #12]
+ ldrd r4, r5, [sp, #16]
+ add r3, r3, r4, lsl #3
+ add r1, r1, r4, lsl #2
+ add r0, r0, r4, lsl #5
+
+1: ldr_post lr, r1, #4
+ add r4, r4, #1
+ add lr, r2, lr, lsl #5
+ cmp r4, r5
+ vld1.32 {d7}, [r3]!
+ vld1.8 {d0}, [lr,:64]
+ vcvt.f32.s32 d7, d7, #4
+ vmovl.s8 q1, d0
+ vmovl.s16 q0, d2
+ vmovl.s16 q1, d3
+ vcvt.f32.s32 q0, q0
+ vcvt.f32.s32 q1, q1
+ vmul.f32 q0, q0, d7[0]
+ vmul.f32 q1, q1, d7[0]
+ vst1.32 {q0-q1}, [r0,:128]!
+ bne 1b
+
+ pop {r4-r5,pc}
+endfunc
+
+function ff_dca_lfe_fir0_neon, export=1
push {r4-r6,lr}
+ mov r3, #32 @ decifactor
+ mov r6, #256/32
+ b dca_lfe_fir
+endfunc
+function ff_dca_lfe_fir1_neon, export=1
+ push {r4-r6,lr}
+ mov r3, #64 @ decifactor
+ mov r6, #256/64
+dca_lfe_fir:
add r4, r0, r3, lsl #2 @ out2
add r5, r2, #256*4-16 @ cf1
sub r1, r1, #12
- cmp r3, #32
- ite eq
- moveq r6, #256/32
- movne r6, #256/64
-NOVFP vldr s0, [sp, #16] @ scale
mov lr, #-16
1:
vmov.f32 q2, #0.0 @ v0
@@ -51,8 +84,7 @@ NOVFP vldr s0, [sp, #16] @ scale
subs r3, r3, #1
vadd.f32 d4, d4, d5
vadd.f32 d6, d6, d7
- vpadd.f32 d4, d4, d6
- vmul.f32 d5, d4, d0[0]
+ vpadd.f32 d5, d4, d6
vst1.32 {d5[0]}, [r0,:32]!
vst1.32 {d5[1]}, [r4,:32]!
bne 1b
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_vfp.S b/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_vfp.S
index b23ce4ac8a5..2e09f0ee5d4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_vfp.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/dcadsp_vfp.S
@@ -24,12 +24,9 @@
POUT .req a1
PIN .req a2
PCOEF .req a3
-DECIFACTOR .req a4
OLDFPSCR .req a4
COUNTER .req ip
-SCALE32 .req s28 @ use vector of 4 in place of 9th scalar when decifactor=32 / JMAX=8
-SCALE64 .req s0 @ spare register in scalar bank when decifactor=64 / JMAX=4
IN0 .req s4
IN1 .req s5
IN2 .req s6
@@ -77,9 +74,6 @@ POST3 .req s27
vldr COEF5, [PCOEF, #X + (1*JMAX + 1) * Y]
vldr COEF6, [PCOEF, #X + (2*JMAX + 1) * Y]
.endif
- .ifnc "\tail",""
- vmul.f POST0, POST0, SCALE\decifactor @ vector operation (SCALE may be scalar)
- .endif
.ifnc "\head",""
vldr COEF7, [PCOEF, #X + (3*JMAX + 1) * Y]
.ifc "\tail",""
@@ -129,10 +123,17 @@ POST3 .req s27
.endm
.macro dca_lfe_fir decifactor
+function ff_dca_lfe_fir\decifactor\()_vfp, export=1
+ fmrx OLDFPSCR, FPSCR
+ ldr ip, =0x03030000 @ RunFast mode, short vectors of length 4, stride 1
+ fmxr FPSCR, ip
+ vldr IN0, [PIN, #-0*4]
+ vldr IN1, [PIN, #-1*4]
+ vldr IN2, [PIN, #-2*4]
+ vldr IN3, [PIN, #-3*4]
.if \decifactor == 32
.set JMAX, 8
vpush {s16-s31}
- vmov SCALE32, s0 @ duplicate scalar across vector
vldr IN4, [PIN, #-4*4]
vldr IN5, [PIN, #-5*4]
vldr IN6, [PIN, #-6*4]
@@ -165,37 +166,19 @@ POST3 .req s27
.endif
fmxr FPSCR, OLDFPSCR
bx lr
+endfunc
.endm
-
-/* void ff_dca_lfe_fir_vfp(float *out, const float *in, const float *coefs,
- * int decifactor, float scale)
- */
-function ff_dca_lfe_fir_vfp, export=1
- teq DECIFACTOR, #32
- fmrx OLDFPSCR, FPSCR
- ldr ip, =0x03030000 @ RunFast mode, short vectors of length 4, stride 1
- fmxr FPSCR, ip
-NOVFP vldr s0, [sp]
- vldr IN0, [PIN, #-0*4]
- vldr IN1, [PIN, #-1*4]
- vldr IN2, [PIN, #-2*4]
- vldr IN3, [PIN, #-3*4]
- beq 32f
-64: dca_lfe_fir 64
+ dca_lfe_fir 64
.ltorg
-32: dca_lfe_fir 32
-endfunc
+ dca_lfe_fir 32
.unreq POUT
.unreq PIN
.unreq PCOEF
- .unreq DECIFACTOR
.unreq OLDFPSCR
.unreq COUNTER
- .unreq SCALE32
- .unreq SCALE64
.unreq IN0
.unreq IN1
.unreq IN2
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_arm.S b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_arm.S
index 586a833fc1f..e0a8a2e97f9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_arm.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_arm.S
@@ -22,13 +22,8 @@
#include "config.h"
#include "libavutil/arm/asm.S"
-#if !HAVE_ARMV5TE_EXTERNAL
-#define pld @
-#endif
-
- .align 5
@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, int stride)
-function ff_add_pixels_clamped_arm, export=1
+function ff_add_pixels_clamped_arm, export=1, align=5
push {r4-r10}
mov r10, #8
1:
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_arm.h b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_arm.h
index b7b5bdc0e6a..e1c42ee17f0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_arm.h
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_arm.h
@@ -18,15 +18,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef AVCODEC_ARM_DSPUTIL_H
-#define AVCODEC_ARM_DSPUTIL_H
+#ifndef AVCODEC_ARM_DSPUTIL_ARM_H
+#define AVCODEC_ARM_DSPUTIL_ARM_H
#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
-void ff_dsputil_init_armv5te(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_vfp(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx);
+void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
+void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
+void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
-#endif /* AVCODEC_ARM_DSPUTIL_H */
+#endif /* AVCODEC_ARM_DSPUTIL_ARM_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_arm.c
index 68991fa9c52..c3a48cdecf4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_arm.c
@@ -19,8 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <stdint.h>
+
#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
#include "libavutil/arm/cpu.h"
+#include "libavcodec/avcodec.h"
+#include "libavcodec/dsputil.h"
#include "dsputil_arm.h"
void ff_j_rev_dct_arm(int16_t *data);
@@ -34,43 +39,47 @@ void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
int line_size);
/* XXX: those functions should be suppressed ASAP when all IDCTs are
- converted */
+ * converted */
static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *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, int16_t *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, int16_t *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, int16_t *block)
{
- ff_simple_idct_arm (block);
+ ff_simple_idct_arm(block);
ff_add_pixels_clamped(block, dest, line_size);
}
-av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx)
+av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
{
int cpu_flags = av_get_cpu_flags();
ff_put_pixels_clamped = c->put_pixels_clamped;
ff_add_pixels_clamped = c->add_pixels_clamped;
- if (!avctx->lowres && avctx->bits_per_raw_sample <= 8) {
- if(avctx->idct_algo == FF_IDCT_AUTO ||
- avctx->idct_algo == FF_IDCT_ARM){
+ if (!avctx->lowres && !high_bit_depth) {
+ 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_permutation_type = FF_LIBMPEG2_IDCT_PERM;
- } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM){
+ } 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;
@@ -80,7 +89,10 @@ av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx)
c->add_pixels_clamped = ff_add_pixels_clamped_arm;
- if (have_armv5te(cpu_flags)) ff_dsputil_init_armv5te(c, avctx);
- if (have_armv6(cpu_flags)) ff_dsputil_init_armv6(c, avctx);
- if (have_neon(cpu_flags)) ff_dsputil_init_neon(c, avctx);
+ if (have_armv5te(cpu_flags))
+ ff_dsputil_init_armv5te(c, avctx, high_bit_depth);
+ if (have_armv6(cpu_flags))
+ ff_dsputil_init_armv6(c, avctx, high_bit_depth);
+ if (have_neon(cpu_flags))
+ ff_dsputil_init_neon(c, avctx, high_bit_depth);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_armv5te.c b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_armv5te.c
index 841fbfadcdf..883f6e40ad4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_armv5te.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_armv5te.c
@@ -18,15 +18,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <stdint.h>
+
+#include "libavutil/attributes.h"
+#include "libavcodec/avcodec.h"
+#include "libavcodec/dsputil.h"
#include "dsputil_arm.h"
void ff_simple_idct_armv5te(int16_t *data);
void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);
-av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx)
+av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
{
- if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
+ if (!avctx->lowres && !high_bit_depth &&
(avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) {
c->idct_put = ff_simple_idct_put_armv5te;
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_armv6.c b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_armv6.c
index 8f383025a25..17d55eaac72 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_armv6.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_armv6.c
@@ -20,53 +20,55 @@
#include <stdint.h>
+#include "libavutil/attributes.h"
#include "libavcodec/avcodec.h"
+#include "libavcodec/dsputil.h"
+#include "libavcodec/mpegvideo.h"
#include "dsputil_arm.h"
void ff_simple_idct_armv6(int16_t *data);
void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
-void ff_add_pixels_clamped_armv6(const int16_t *block,
- uint8_t *restrict pixels,
+void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels,
int line_size);
void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride);
void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1,
const uint8_t *s2, int stride);
-int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
+int ff_pix_abs16_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2,
int line_size, int h);
-int ff_pix_abs16_x2_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
+int ff_pix_abs16_x2_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2,
int line_size, int h);
-int ff_pix_abs16_y2_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
+int ff_pix_abs16_y2_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2,
int line_size, int h);
-int ff_pix_abs8_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
- int line_size, int h);
+int ff_pix_abs8_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2,
+ int line_size, int h);
-int ff_sse16_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
+int ff_sse16_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2,
int line_size, int h);
int ff_pix_norm1_armv6(uint8_t *pix, int line_size);
int ff_pix_sum_armv6(uint8_t *pix, int line_size);
-av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx)
+av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
{
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
- if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
- (avctx->idct_algo == FF_IDCT_AUTO ||
- avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) {
- c->idct_put = ff_simple_idct_put_armv6;
- c->idct_add = ff_simple_idct_add_armv6;
- c->idct = ff_simple_idct_armv6;
- c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
+ if (!avctx->lowres && !high_bit_depth) {
+ if (avctx->idct_algo == FF_IDCT_AUTO ||
+ avctx->idct_algo == FF_IDCT_SIMPLEARMV6) {
+ c->idct_put = ff_simple_idct_put_armv6;
+ c->idct_add = ff_simple_idct_add_armv6;
+ c->idct = ff_simple_idct_armv6;
+ c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
+ }
}
+ c->add_pixels_clamped = ff_add_pixels_clamped_armv6;
if (!high_bit_depth)
c->get_pixels = ff_get_pixels_armv6;
- c->add_pixels_clamped = ff_add_pixels_clamped_armv6;
c->diff_pixels = ff_diff_pixels_armv6;
c->pix_abs[0][0] = ff_pix_abs16_armv6;
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_neon.c b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_neon.c
index c1f250acb62..8da442bf826 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_neon.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/dsputil_init_neon.c
@@ -23,6 +23,7 @@
#include "libavutil/attributes.h"
#include "libavcodec/avcodec.h"
+#include "libavcodec/dsputil.h"
#include "dsputil_arm.h"
void ff_simple_idct_neon(int16_t *data);
@@ -42,14 +43,14 @@ void ff_vector_clip_int32_neon(int32_t *dst, const int32_t *src, int32_t min,
int32_t max, unsigned int len);
int32_t ff_scalarproduct_int16_neon(const int16_t *v1, const int16_t *v2, int len);
+
int32_t ff_scalarproduct_and_madd_int16_neon(int16_t *v1, const int16_t *v2,
const int16_t *v3, int len, int mul);
-av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
+av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
{
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
- if (!avctx->lowres && avctx->bits_per_raw_sample <= 8) {
+ if (!avctx->lowres && !high_bit_depth) {
if (avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_SIMPLENEON) {
c->idct_put = ff_simple_idct_put_neon;
@@ -59,18 +60,19 @@ av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
}
}
+ c->add_pixels_clamped = ff_add_pixels_clamped_neon;
+ c->put_pixels_clamped = ff_put_pixels_clamped_neon;
+ c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_neon;
+
if (!high_bit_depth) {
c->clear_block = ff_clear_block_neon;
c->clear_blocks = ff_clear_blocks_neon;
}
- c->add_pixels_clamped = ff_add_pixels_clamped_neon;
- c->put_pixels_clamped = ff_put_pixels_clamped_neon;
- c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_neon;
-
- c->vector_clipf = ff_vector_clipf_neon;
- c->vector_clip_int32 = ff_vector_clip_int32_neon;
+ c->vector_clipf = ff_vector_clipf_neon;
+ c->vector_clip_int32 = ff_vector_clip_int32_neon;
c->scalarproduct_int16 = ff_scalarproduct_int16_neon;
+
c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_neon;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/fft_fixed_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/fft_fixed_init_arm.c
index ef098f4bf1c..b60bb9fa858 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/fft_fixed_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/fft_fixed_init_arm.c
@@ -20,7 +20,7 @@
#include "libavutil/arm/cpu.h"
-#define CONFIG_FFT_FLOAT 0
+#define FFT_FLOAT 0
#include "libavcodec/fft.h"
void ff_fft_fixed_calc_neon(FFTContext *s, FFTComplex *z);
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/fft_fixed_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/fft_fixed_neon.S
index d4a38a2b96f..57a8cfb557c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/fft_fixed_neon.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/fft_fixed_neon.S
@@ -122,7 +122,7 @@ endfunc
function fft_pass_neon
push {r4,lr}
- movrel lr, coefs+24
+ movrel lr, coefs + 24
vld1.16 {d30}, [lr,:64]
lsl r12, r2, #3
vmov d31, d30
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/flacdsp_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/flacdsp_init_arm.c
index 9b9394280f9..9ddb26829d3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/flacdsp_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/flacdsp_init_arm.c
@@ -27,6 +27,6 @@ void ff_flac_lpc_16_arm(int32_t *samples, const int coeffs[32], int order,
av_cold void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt,
int bps)
{
- if (bps <= 16)
+ if (bps <= 16 && CONFIG_FLAC_DECODER)
c->lpc = ff_flac_lpc_16_arm;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/fmtconvert_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/fmtconvert_neon.S
index 55d070e01c1..4662e280b64 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/fmtconvert_neon.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/fmtconvert_neon.S
@@ -70,7 +70,7 @@ function ff_float_to_int16_interleave_neon, export=1
cmp r3, #2
itt lt
ldrlt r1, [r1]
- blt ff_float_to_int16_neon
+ blt X(ff_float_to_int16_neon)
bne 4f
ldr r3, [r1]
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/h264cmc_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/h264cmc_neon.S
index 112d5d6f862..0bcae112042 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/h264cmc_neon.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/h264cmc_neon.S
@@ -39,6 +39,9 @@ function ff_\type\()_\codec\()_chroma_mc8_neon, export=1
add r6, r6, r7, lsl #1
vld1.16 {d22[],d23[]}, [r6,:16]
.endif
+ .ifc \codec,vc1
+ vmov.u16 q11, #28
+ .endif
A muls r7, r4, r5
T mul r7, r4, r5
@@ -183,6 +186,9 @@ function ff_\type\()_\codec\()_chroma_mc4_neon, export=1
add r6, r6, r7, lsl #1
vld1.16 {d22[],d23[]}, [r6,:16]
.endif
+ .ifc \codec,vc1
+ vmov.u16 q11, #28
+ .endif
A muls r7, r4, r5
T mul r7, r4, r5
@@ -396,3 +402,10 @@ endconst
h264_chroma_mc4 put, rv40
h264_chroma_mc4 avg, rv40
#endif
+
+#if CONFIG_VC1_DECODER
+ h264_chroma_mc8 put, vc1
+ h264_chroma_mc8 avg, vc1
+ h264_chroma_mc4 put, vc1
+ h264_chroma_mc4 avg, vc1
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/h264dsp_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/h264dsp_init_arm.c
index 2cafbaf2559..eb6c5147279 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/h264dsp_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/h264dsp_init_arm.c
@@ -24,7 +24,7 @@
#include "libavutil/arm/cpu.h"
#include "libavcodec/h264dsp.h"
-int ff_h264_find_start_code_candidate_armv6(const uint8_t *buf, int size);
+int ff_startcode_find_candidate_armv6(const uint8_t *buf, int size);
void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
int beta, int8_t *tc0);
@@ -75,30 +75,30 @@ static av_cold void h264dsp_init_neon(H264DSPContext *c, const int bit_depth,
{
#if HAVE_NEON
if (bit_depth == 8) {
- 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;
- if(chroma_format_idc == 1){
- c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
- c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_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;
+ if(chroma_format_idc == 1){
+ c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
+ c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
+ }
- c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
- c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
- c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
+ c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
+ c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
+ c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
- c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
- c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
- c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
+ c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
+ c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
+ c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
- c->h264_idct_add = ff_h264_idct_add_neon;
- c->h264_idct_dc_add = ff_h264_idct_dc_add_neon;
- c->h264_idct_add16 = ff_h264_idct_add16_neon;
- c->h264_idct_add16intra = ff_h264_idct_add16intra_neon;
- if (chroma_format_idc == 1)
- c->h264_idct_add8 = ff_h264_idct_add8_neon;
- c->h264_idct8_add = ff_h264_idct8_add_neon;
- c->h264_idct8_dc_add = ff_h264_idct8_dc_add_neon;
- c->h264_idct8_add4 = ff_h264_idct8_add4_neon;
+ c->h264_idct_add = ff_h264_idct_add_neon;
+ c->h264_idct_dc_add = ff_h264_idct_dc_add_neon;
+ c->h264_idct_add16 = ff_h264_idct_add16_neon;
+ c->h264_idct_add16intra = ff_h264_idct_add16intra_neon;
+ if (chroma_format_idc <= 1)
+ c->h264_idct_add8 = ff_h264_idct_add8_neon;
+ c->h264_idct8_add = ff_h264_idct8_add_neon;
+ c->h264_idct8_dc_add = ff_h264_idct8_dc_add_neon;
+ c->h264_idct8_add4 = ff_h264_idct8_add4_neon;
}
#endif // HAVE_NEON
}
@@ -109,7 +109,7 @@ av_cold void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth,
int cpu_flags = av_get_cpu_flags();
if (have_armv6(cpu_flags))
- c->h264_find_start_code_candidate = ff_h264_find_start_code_candidate_armv6;
+ c->h264_find_start_code_candidate = ff_startcode_find_candidate_armv6;
if (have_neon(cpu_flags))
h264dsp_init_neon(c, bit_depth, chroma_format_idc);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/h264idct_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/h264idct_neon.S
index 2edeca2cbc0..4f68bdb9f55 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/h264idct_neon.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/h264idct_neon.S
@@ -113,8 +113,8 @@ function ff_h264_idct_add16_neon, export=1
movne lr, #0
cmp lr, #0
ite ne
- adrne lr, ff_h264_idct_dc_add_neon + CONFIG_THUMB
- adreq lr, ff_h264_idct_add_neon + CONFIG_THUMB
+ adrne lr, X(ff_h264_idct_dc_add_neon) + CONFIG_THUMB
+ adreq lr, X(ff_h264_idct_add_neon) + CONFIG_THUMB
blx lr
2: subs ip, ip, #1
add r1, r1, #32
@@ -138,8 +138,8 @@ function ff_h264_idct_add16intra_neon, export=1
cmp r8, #0
ldrsh r8, [r1]
iteet ne
- adrne lr, ff_h264_idct_add_neon + CONFIG_THUMB
- adreq lr, ff_h264_idct_dc_add_neon + CONFIG_THUMB
+ adrne lr, X(ff_h264_idct_add_neon) + CONFIG_THUMB
+ adreq lr, X(ff_h264_idct_dc_add_neon) + CONFIG_THUMB
cmpeq r8, #0
blxne lr
subs ip, ip, #1
@@ -166,8 +166,8 @@ function ff_h264_idct_add8_neon, export=1
cmp r8, #0
ldrsh r8, [r1]
iteet ne
- adrne lr, ff_h264_idct_add_neon + CONFIG_THUMB
- adreq lr, ff_h264_idct_dc_add_neon + CONFIG_THUMB
+ adrne lr, X(ff_h264_idct_add_neon) + CONFIG_THUMB
+ adreq lr, X(ff_h264_idct_dc_add_neon) + CONFIG_THUMB
cmpeq r8, #0
blxne lr
add r12, r12, #1
@@ -388,8 +388,8 @@ function ff_h264_idct8_add4_neon, export=1
movne lr, #0
cmp lr, #0
ite ne
- adrne lr, ff_h264_idct8_dc_add_neon + CONFIG_THUMB
- adreq lr, ff_h264_idct8_add_neon + CONFIG_THUMB
+ adrne lr, X(ff_h264_idct8_dc_add_neon) + CONFIG_THUMB
+ adreq lr, X(ff_h264_idct8_add_neon) + CONFIG_THUMB
blx lr
2: subs r12, r12, #4
add r1, r1, #128
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/h264pred_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/h264pred_init_arm.c
index 1562f0bcbe8..6ba7592fe71 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/h264pred_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/h264pred_init_arm.c
@@ -57,10 +57,11 @@ static av_cold void h264_pred_init_neon(H264PredContext *h, int codec_id,
if(chroma_format_idc == 1){
h->pred8x8[VERT_PRED8x8 ] = ff_pred8x8_vert_neon;
h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_hor_neon;
- if (codec_id != AV_CODEC_ID_VP8)
+ if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8)
h->pred8x8[PLANE_PRED8x8] = ff_pred8x8_plane_neon;
h->pred8x8[DC_128_PRED8x8 ] = ff_pred8x8_128_dc_neon;
- if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP8) {
+ if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7 &&
+ codec_id != AV_CODEC_ID_VP8) {
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;
@@ -77,7 +78,8 @@ static av_cold void h264_pred_init_neon(H264PredContext *h, int codec_id,
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 != AV_CODEC_ID_SVQ3 && codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP8)
+ if (codec_id != AV_CODEC_ID_SVQ3 && codec_id != AV_CODEC_ID_RV40 &&
+ codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8)
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_neon;
#endif // HAVE_NEON
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_arm.S b/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_arm.S
index 2f3d3114eaf..219f793d992 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_arm.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_arm.S
@@ -1,5 +1,5 @@
@
-@ ARMv4 optimized DSP utils
+@ ARMv4-optimized halfpel functions
@ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp>
@
@ This file is part of FFmpeg.
@@ -89,8 +89,7 @@
.endm
@ ----------------------------------------------------------------
- .align 5
-function ff_put_pixels16_arm, export=1
+function ff_put_pixels16_arm, export=1, align=5
@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
@ block = word aligned, pixles = unaligned
pld [r1]
@@ -141,8 +140,7 @@ function ff_put_pixels16_arm, export=1
endfunc
@ ----------------------------------------------------------------
- .align 5
-function ff_put_pixels8_arm, export=1
+function ff_put_pixels8_arm, export=1, align=5
@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
@ block = word aligned, pixles = unaligned
pld [r1]
@@ -193,8 +191,7 @@ function ff_put_pixels8_arm, export=1
endfunc
@ ----------------------------------------------------------------
- .align 5
-function ff_put_pixels8_x2_arm, export=1
+function ff_put_pixels8_x2_arm, export=1, align=5
@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
@ block = word aligned, pixles = unaligned
pld [r1]
@@ -252,8 +249,7 @@ function ff_put_pixels8_x2_arm, export=1
pop {r4-r10,pc}
endfunc
- .align 5
-function ff_put_no_rnd_pixels8_x2_arm, export=1
+function ff_put_no_rnd_pixels8_x2_arm, export=1, align=5
@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
@ block = word aligned, pixles = unaligned
pld [r1]
@@ -313,8 +309,7 @@ endfunc
@ ----------------------------------------------------------------
- .align 5
-function ff_put_pixels8_y2_arm, export=1
+function ff_put_pixels8_y2_arm, export=1, align=5
@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
@ block = word aligned, pixles = unaligned
pld [r1]
@@ -411,8 +406,7 @@ function ff_put_pixels8_y2_arm, export=1
pop {r4-r11,pc}
endfunc
- .align 5
-function ff_put_no_rnd_pixels8_y2_arm, export=1
+function ff_put_no_rnd_pixels8_y2_arm, export=1, align=5
@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
@ block = word aligned, pixles = unaligned
pld [r1]
@@ -578,8 +572,7 @@ endfunc
pop {r4-r11,pc}
.endm
- .align 5
-function ff_put_pixels8_xy2_arm, export=1
+function ff_put_pixels8_xy2_arm, export=1, align=5
@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
@ block = word aligned, pixles = unaligned
pld [r1]
@@ -594,8 +587,7 @@ function ff_put_pixels8_xy2_arm, export=1
4: RND_XY2_EXPAND 3, lsl
endfunc
- .align 5
-function ff_put_no_rnd_pixels8_xy2_arm, export=1
+function ff_put_no_rnd_pixels8_xy2_arm, export=1, align=5
@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
@ block = word aligned, pixles = unaligned
pld [r1]
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_arm.h b/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_arm.h
index 3f18c624d81..5f3c7741c1e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_arm.h
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_arm.h
@@ -18,12 +18,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef AVCODEC_ARM_HPELDSP_H
-#define AVCODEC_ARM_HPELDSP_H
+#ifndef AVCODEC_ARM_HPELDSP_ARM_H
+#define AVCODEC_ARM_HPELDSP_ARM_H
#include "libavcodec/hpeldsp.h"
void ff_hpeldsp_init_armv6(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_neon(HpelDSPContext *c, int flags);
-#endif /* AVCODEC_ARM_HPELDSP_H */
+#endif /* AVCODEC_ARM_HPELDSP_ARM_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_armv6.S b/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_armv6.S
index cd501504da4..a8bd459c207 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_armv6.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_armv6.S
@@ -23,11 +23,11 @@
.macro call_2x_pixels type, subp
function ff_\type\()_pixels16\subp\()_armv6, export=1
push {r0-r3, lr}
- bl ff_\type\()_pixels8\subp\()_armv6
+ bl X(ff_\type\()_pixels8\subp\()_armv6)
pop {r0-r3, lr}
add r0, r0, #8
add r1, r1, #8
- b ff_\type\()_pixels8\subp\()_armv6
+ b X(ff_\type\()_pixels8\subp\()_armv6)
endfunc
.endm
@@ -144,10 +144,11 @@ function ff_put_pixels8_y2_armv6, export=1
eor r7, r5, r7
uadd8 r10, r10, r6
and r7, r7, r12
- ldr_pre r6, r1, r2
+ ldrc_pre ne, r6, r1, r2
uadd8 r11, r11, r7
strd_post r8, r9, r0, r2
- ldr r7, [r1, #4]
+ it ne
+ ldrne r7, [r1, #4]
strd_post r10, r11, r0, r2
bne 1b
@@ -196,9 +197,10 @@ function ff_put_pixels8_y2_no_rnd_armv6, export=1
uhadd8 r9, r5, r7
ldr r5, [r1, #4]
uhadd8 r12, r4, r6
- ldr_pre r6, r1, r2
+ ldrc_pre ne, r6, r1, r2
uhadd8 r14, r5, r7
- ldr r7, [r1, #4]
+ it ne
+ ldrne r7, [r1, #4]
stm r0, {r8,r9}
add r0, r0, r2
stm r0, {r12,r14}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_init_arm.c
index 2cc2b782b20..1977b1379b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/hpeldsp_init_arm.c
@@ -1,5 +1,5 @@
/*
- * ARM optimized DSP utils
+ * ARM-optimized halfpel functions
* Copyright (c) 2001 Lionel Ulmer
*
* This file is part of FFmpeg.
@@ -21,8 +21,7 @@
#include "libavutil/arm/cpu.h"
#include "libavutil/attributes.h"
-#include "libavcodec/bit_depth_template.c" // for CALL_2X_PIXELS
-#include "libavcodec/rnd_avg.h"
+#include "libavcodec/pixels.h"
#include "hpeldsp_arm.h"
void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/int_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/int_neon.S
index dea1ad51ebd..ba840656fee 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/int_neon.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/int_neon.S
@@ -21,8 +21,6 @@
#include "libavutil/arm/asm.S"
- .fpu neon
-
function ff_scalarproduct_int16_neon, export=1
vmov.i16 q0, #0
vmov.i16 q1, #0
@@ -37,14 +35,14 @@ function ff_scalarproduct_int16_neon, export=1
vmlal.s16 q2, d18, d22
vmlal.s16 q3, d19, d23
subs r2, r2, #16
- bne 1b
+ bgt 1b
vpadd.s32 d16, d0, d1
vpadd.s32 d17, d2, d3
- vpadd.s32 d10, d4, d5
- vpadd.s32 d11, d6, d7
+ vpadd.s32 d18, d4, d5
+ vpadd.s32 d19, d6, d7
vpadd.s32 d0, d16, d17
- vpadd.s32 d1, d10, d11
+ vpadd.s32 d1, d18, d19
vpadd.s32 d2, d0, d1
vpaddl.s32 d3, d2
vmov.32 r0, d3[0]
@@ -77,14 +75,14 @@ function ff_scalarproduct_and_madd_int16_neon, export=1
vst1.16 {q10}, [r12,:128]!
subs r3, r3, #16
vst1.16 {q13}, [r12,:128]!
- bne 1b
+ bgt 1b
vpadd.s32 d16, d0, d1
vpadd.s32 d17, d2, d3
- vpadd.s32 d10, d4, d5
- vpadd.s32 d11, d6, d7
+ vpadd.s32 d18, d4, d5
+ vpadd.s32 d19, d6, d7
vpadd.s32 d0, d16, d17
- vpadd.s32 d1, d10, d11
+ vpadd.s32 d1, d18, d19
vpadd.s32 d2, d0, d1
vpaddl.s32 d3, d2
vmov.32 r0, d3[0]
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/mdct_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/mdct_neon.S
index e481cd1307a..a6952fa5716 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/mdct_neon.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/mdct_neon.S
@@ -129,7 +129,7 @@ function ff_imdct_calc_neon, export=1
lsl r4, r4, r3
add r1, r1, r4
- bl ff_imdct_half_neon
+ bl X(ff_imdct_half_neon)
add r0, r5, r4, lsl #2
add r1, r5, r4, lsl #1
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_armv5te.S b/chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_armv5te.S
new file mode 100644
index 00000000000..8355cdf3a2b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_armv5te.S
@@ -0,0 +1,655 @@
+/*
+ * Copyright (c) 2014 RISC OS Open Ltd
+ * Author: Ben Avison <bavison@riscosopen.org>
+ *
+ * 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 "libavutil/arm/asm.S"
+
+#define MAX_CHANNELS 8
+#define MAX_FIR_ORDER 8
+#define MAX_IIR_ORDER 4
+#define MAX_RATEFACTOR 4
+#define MAX_BLOCKSIZE (40 * MAX_RATEFACTOR)
+
+PST .req a1
+PCO .req a2
+AC0 .req a3
+AC1 .req a4
+CO0 .req v1
+CO1 .req v2
+CO2 .req v3
+CO3 .req v4
+ST0 .req v5
+ST1 .req v6
+ST2 .req sl
+ST3 .req fp
+I .req ip
+PSAMP .req lr
+
+
+// Some macros that do loads/multiplies where the register number is determined
+// from an assembly-time expression. Boy is GNU assembler's syntax ugly...
+
+.macro load group, index, base, offset
+ .altmacro
+ load_ \group, %(\index), \base, \offset
+ .noaltmacro
+.endm
+
+.macro load_ group, index, base, offset
+ ldr \group\index, [\base, #\offset]
+.endm
+
+.macro loadd group, index, base, offset
+ .altmacro
+ loadd_ \group, %(\index), %(\index+1), \base, \offset
+ .noaltmacro
+.endm
+
+.macro loadd_ group, index0, index1, base, offset
+A .if \offset >= 256
+A ldr \group\index0, [\base, #\offset]
+A ldr \group\index1, [\base, #(\offset) + 4]
+A .else
+ ldrd \group\index0, \group\index1, [\base, #\offset]
+A .endif
+.endm
+
+.macro multiply index, accumulate, long
+ .altmacro
+ multiply_ %(\index), \accumulate, \long
+ .noaltmacro
+.endm
+
+.macro multiply_ index, accumulate, long
+ .if \long
+ .if \accumulate
+ smlal AC0, AC1, CO\index, ST\index
+ .else
+ smull AC0, AC1, CO\index, ST\index
+ .endif
+ .else
+ .if \accumulate
+ mla AC0, CO\index, ST\index, AC0
+ .else
+ mul AC0, CO\index, ST\index
+ .endif
+ .endif
+.endm
+
+// A macro to update the load register number and load offsets
+
+.macro inc howmany
+ .set LOAD_REG, (LOAD_REG + \howmany) & 3
+ .set OFFSET_CO, OFFSET_CO + 4 * \howmany
+ .set OFFSET_ST, OFFSET_ST + 4 * \howmany
+ .if FIR_REMAIN > 0
+ .set FIR_REMAIN, FIR_REMAIN - \howmany
+ .if FIR_REMAIN == 0
+ .set OFFSET_CO, 4 * MAX_FIR_ORDER
+ .set OFFSET_ST, 4 * (MAX_BLOCKSIZE + MAX_FIR_ORDER)
+ .endif
+ .elseif IIR_REMAIN > 0
+ .set IIR_REMAIN, IIR_REMAIN - \howmany
+ .endif
+.endm
+
+// Macro to implement the inner loop for one specific combination of parameters
+
+.macro implement_filter mask_minus1, shift_0, shift_8, iir_taps, fir_taps
+ .set TOTAL_TAPS, \iir_taps + \fir_taps
+
+ // Deal with register allocation...
+ .set DEFINED_SHIFT, 0
+ .set DEFINED_MASK, 0
+ .set SHUFFLE_SHIFT, 0
+ .set SHUFFLE_MASK, 0
+ .set SPILL_SHIFT, 0
+ .set SPILL_MASK, 0
+ .if TOTAL_TAPS == 0
+ // Little register pressure in this case - just keep MASK where it was
+ .if !\mask_minus1
+ MASK .req ST1
+ .set DEFINED_MASK, 1
+ .endif
+ .else
+ .if \shift_0
+ .if !\mask_minus1
+ // AC1 is unused with shift 0
+ MASK .req AC1
+ .set DEFINED_MASK, 1
+ .set SHUFFLE_MASK, 1
+ .endif
+ .elseif \shift_8
+ .if !\mask_minus1
+ .if TOTAL_TAPS <= 4
+ // All coefficients are preloaded (so pointer not needed)
+ MASK .req PCO
+ .set DEFINED_MASK, 1
+ .set SHUFFLE_MASK, 1
+ .else
+ .set SPILL_MASK, 1
+ .endif
+ .endif
+ .else // shift not 0 or 8
+ .if TOTAL_TAPS <= 3
+ // All coefficients are preloaded, and at least one CO register is unused
+ .if \fir_taps & 1
+ SHIFT .req CO0
+ .set DEFINED_SHIFT, 1
+ .set SHUFFLE_SHIFT, 1
+ .else
+ SHIFT .req CO3
+ .set DEFINED_SHIFT, 1
+ .set SHUFFLE_SHIFT, 1
+ .endif
+ .if !\mask_minus1
+ MASK .req PCO
+ .set DEFINED_MASK, 1
+ .set SHUFFLE_MASK, 1
+ .endif
+ .elseif TOTAL_TAPS == 4
+ // All coefficients are preloaded
+ SHIFT .req PCO
+ .set DEFINED_SHIFT, 1
+ .set SHUFFLE_SHIFT, 1
+ .if !\mask_minus1
+ .set SPILL_MASK, 1
+ .endif
+ .else
+ .set SPILL_SHIFT, 1
+ .if !\mask_minus1
+ .set SPILL_MASK, 1
+ .endif
+ .endif
+ .endif
+ .endif
+ .if SPILL_SHIFT
+ SHIFT .req ST0
+ .set DEFINED_SHIFT, 1
+ .endif
+ .if SPILL_MASK
+ MASK .req ST1
+ .set DEFINED_MASK, 1
+ .endif
+
+ // Preload coefficients if possible
+ .if TOTAL_TAPS <= 4
+ .set OFFSET_CO, 0
+ .if \fir_taps & 1
+ .set LOAD_REG, 1
+ .else
+ .set LOAD_REG, 0
+ .endif
+ .rept \fir_taps
+ load CO, LOAD_REG, PCO, OFFSET_CO
+ .set LOAD_REG, (LOAD_REG + 1) & 3
+ .set OFFSET_CO, OFFSET_CO + 4
+ .endr
+ .set OFFSET_CO, 4 * MAX_FIR_ORDER
+ .rept \iir_taps
+ load CO, LOAD_REG, PCO, OFFSET_CO
+ .set LOAD_REG, (LOAD_REG + 1) & 3
+ .set OFFSET_CO, OFFSET_CO + 4
+ .endr
+ .endif
+
+ // Move mask/shift to final positions if necessary
+ // Need to do this after preloading, because in some cases we
+ // reuse the coefficient pointer register
+ .if SHUFFLE_SHIFT
+ mov SHIFT, ST0
+ .endif
+ .if SHUFFLE_MASK
+ mov MASK, ST1
+ .endif
+
+ // Begin loop
+01:
+ .if TOTAL_TAPS == 0
+ // Things simplify a lot in this case
+ // In fact this could be pipelined further if it's worth it...
+ ldr ST0, [PSAMP]
+ subs I, I, #1
+ .if !\mask_minus1
+ and ST0, ST0, MASK
+ .endif
+ str ST0, [PST, #-4]!
+ str ST0, [PST, #4 * (MAX_BLOCKSIZE + MAX_FIR_ORDER)]
+ str ST0, [PSAMP], #4 * MAX_CHANNELS
+ bne 01b
+ .else
+ .if \fir_taps & 1
+ .set LOAD_REG, 1
+ .else
+ .set LOAD_REG, 0
+ .endif
+ .set LOAD_BANK, 0
+ .set FIR_REMAIN, \fir_taps
+ .set IIR_REMAIN, \iir_taps
+ .if FIR_REMAIN == 0 // only IIR terms
+ .set OFFSET_CO, 4 * MAX_FIR_ORDER
+ .set OFFSET_ST, 4 * (MAX_BLOCKSIZE + MAX_FIR_ORDER)
+ .else
+ .set OFFSET_CO, 0
+ .set OFFSET_ST, 0
+ .endif
+ .set MUL_REG, LOAD_REG
+ .set COUNTER, 0
+ .rept TOTAL_TAPS + 2
+ // Do load(s)
+ .if FIR_REMAIN != 0 || IIR_REMAIN != 0
+ .if COUNTER == 0
+ .if TOTAL_TAPS > 4
+ load CO, LOAD_REG, PCO, OFFSET_CO
+ .endif
+ load ST, LOAD_REG, PST, OFFSET_ST
+ inc 1
+ .elseif COUNTER == 1 && (\fir_taps & 1) == 0
+ .if TOTAL_TAPS > 4
+ load CO, LOAD_REG, PCO, OFFSET_CO
+ .endif
+ load ST, LOAD_REG, PST, OFFSET_ST
+ inc 1
+ .elseif LOAD_BANK == 0
+ .if TOTAL_TAPS > 4
+ .if FIR_REMAIN == 0 && IIR_REMAIN == 1
+ load CO, LOAD_REG, PCO, OFFSET_CO
+ .else
+ loadd CO, LOAD_REG, PCO, OFFSET_CO
+ .endif
+ .endif
+ .set LOAD_BANK, 1
+ .else
+ .if FIR_REMAIN == 0 && IIR_REMAIN == 1
+ load ST, LOAD_REG, PST, OFFSET_ST
+ inc 1
+ .else
+ loadd ST, LOAD_REG, PST, OFFSET_ST
+ inc 2
+ .endif
+ .set LOAD_BANK, 0
+ .endif
+ .endif
+
+ // Do interleaved multiplies, slightly delayed
+ .if COUNTER >= 2
+ multiply MUL_REG, COUNTER > 2, !\shift_0
+ .set MUL_REG, (MUL_REG + 1) & 3
+ .endif
+ .set COUNTER, COUNTER + 1
+ .endr
+
+ // Post-process the result of the multiplies
+ .if SPILL_SHIFT
+ ldr SHIFT, [sp, #9*4 + 0*4]
+ .endif
+ .if SPILL_MASK
+ ldr MASK, [sp, #9*4 + 1*4]
+ .endif
+ ldr ST2, [PSAMP]
+ subs I, I, #1
+ .if \shift_8
+ mov AC0, AC0, lsr #8
+ orr AC0, AC0, AC1, lsl #24
+ .elseif !\shift_0
+ rsb ST3, SHIFT, #32
+ mov AC0, AC0, lsr SHIFT
+A orr AC0, AC0, AC1, lsl ST3
+T mov AC1, AC1, lsl ST3
+T orr AC0, AC0, AC1
+ .endif
+ .if \mask_minus1
+ add ST3, ST2, AC0
+ .else
+ add ST2, ST2, AC0
+ and ST3, ST2, MASK
+ sub ST2, ST3, AC0
+ .endif
+ str ST3, [PST, #-4]!
+ str ST2, [PST, #4 * (MAX_BLOCKSIZE + MAX_FIR_ORDER)]
+ str ST3, [PSAMP], #4 * MAX_CHANNELS
+ bne 01b
+ .endif
+ b 99f
+
+ .if DEFINED_SHIFT
+ .unreq SHIFT
+ .endif
+ .if DEFINED_MASK
+ .unreq MASK
+ .endif
+.endm
+
+.macro switch_on_fir_taps mask_minus1, shift_0, shift_8, iir_taps
+A ldr pc, [pc, a3, LSL #2] // firorder is in range 0-(8-iir_taps)
+T tbh [pc, a3, lsl #1]
+0:
+A .word 0, 70f, 71f, 72f, 73f, 74f
+T .hword (70f - 0b) / 2, (71f - 0b) / 2, (72f - 0b) / 2, (73f - 0b) / 2, (74f - 0b) / 2
+ .if \iir_taps <= 3
+A .word 75f
+T .hword (75f - 0b) / 2
+ .if \iir_taps <= 2
+A .word 76f
+T .hword (76f - 0b) / 2
+ .if \iir_taps <= 1
+A .word 77f
+T .hword (77f - 0b) / 2
+ .if \iir_taps == 0
+A .word 78f
+T .hword (78f - 0b) / 2
+ .endif
+ .endif
+ .endif
+ .endif
+70: implement_filter \mask_minus1, \shift_0, \shift_8, \iir_taps, 0
+71: implement_filter \mask_minus1, \shift_0, \shift_8, \iir_taps, 1
+72: implement_filter \mask_minus1, \shift_0, \shift_8, \iir_taps, 2
+73: implement_filter \mask_minus1, \shift_0, \shift_8, \iir_taps, 3
+74: implement_filter \mask_minus1, \shift_0, \shift_8, \iir_taps, 4
+ .if \iir_taps <= 3
+75: implement_filter \mask_minus1, \shift_0, \shift_8, \iir_taps, 5
+ .if \iir_taps <= 2
+76: implement_filter \mask_minus1, \shift_0, \shift_8, \iir_taps, 6
+ .if \iir_taps <= 1
+77: implement_filter \mask_minus1, \shift_0, \shift_8, \iir_taps, 7
+ .if \iir_taps == 0
+78: implement_filter \mask_minus1, \shift_0, \shift_8, \iir_taps, 8
+ .endif
+ .endif
+ .endif
+ .endif
+.endm
+
+.macro switch_on_iir_taps mask_minus1, shift_0, shift_8
+A ldr pc, [pc, a4, LSL #2] // irorder is in range 0-4
+T tbh [pc, a4, lsl #1]
+0:
+A .word 0, 60f, 61f, 62f, 63f, 64f
+T .hword (60f - 0b) / 2, (61f - 0b) / 2, (62f - 0b) / 2, (63f - 0b) / 2, (64f - 0b) / 2
+60: switch_on_fir_taps \mask_minus1, \shift_0, \shift_8, 0
+61: switch_on_fir_taps \mask_minus1, \shift_0, \shift_8, 1
+62: switch_on_fir_taps \mask_minus1, \shift_0, \shift_8, 2
+63: switch_on_fir_taps \mask_minus1, \shift_0, \shift_8, 3
+64: switch_on_fir_taps \mask_minus1, \shift_0, \shift_8, 4
+.endm
+
+/* void ff_mlp_filter_channel_arm(int32_t *state, const int32_t *coeff,
+ * int firorder, int iirorder,
+ * unsigned int filter_shift, int32_t mask,
+ * int blocksize, int32_t *sample_buffer);
+ */
+function ff_mlp_filter_channel_arm, export=1
+ push {v1-fp,lr}
+ add v1, sp, #9*4 // point at arguments on stack
+ ldm v1, {ST0,ST1,I,PSAMP}
+ cmp ST1, #-1
+ bne 30f
+ movs ST2, ST0, lsl #29 // shift is in range 0-15; we want to special-case 0 and 8
+ bne 20f
+ bcs 10f
+ switch_on_iir_taps 1, 1, 0
+10: switch_on_iir_taps 1, 0, 1
+20: switch_on_iir_taps 1, 0, 0
+30: movs ST2, ST0, lsl #29 // shift is in range 0-15; we want to special-case 0 and 8
+ bne 50f
+ bcs 40f
+ switch_on_iir_taps 0, 1, 0
+40: switch_on_iir_taps 0, 0, 1
+50: switch_on_iir_taps 0, 0, 0
+99: pop {v1-fp,pc}
+endfunc
+
+ .unreq PST
+ .unreq PCO
+ .unreq AC0
+ .unreq AC1
+ .unreq CO0
+ .unreq CO1
+ .unreq CO2
+ .unreq CO3
+ .unreq ST0
+ .unreq ST1
+ .unreq ST2
+ .unreq ST3
+ .unreq I
+ .unreq PSAMP
+
+/********************************************************************/
+
+PSA .req a1 // samples
+PCO .req a2 // coeffs
+PBL .req a3 // bypassed_lsbs
+INDEX .req a4
+CO0 .req v1
+CO1 .req v2
+CO2 .req v3
+CO3 .req v4
+SA0 .req v5
+SA1 .req v6
+SA2 .req sl
+SA3 .req fp
+AC0 .req ip
+AC1 .req lr
+NOISE .req SA0
+LSB .req SA1
+DCH .req SA2 // dest_ch
+MASK .req SA3
+
+ // INDEX is used as follows:
+ // bits 0..6 index2 (values up to 17, but wider so that we can
+ // add to index field without needing to mask)
+ // bits 7..14 i (values up to 160)
+ // bit 15 underflow detect for i
+ // bits 25..31 (if access_unit_size_pow2 == 128) \ index
+ // bits 26..31 (if access_unit_size_pow2 == 64) /
+
+.macro implement_rematrix shift, index_mask, mask_minus1, maxchan
+ .if \maxchan == 1
+ // We can just leave the coefficients in registers in this case
+ ldrd CO0, CO1, [PCO]
+ .endif
+1:
+ .if \maxchan == 1
+ ldrd SA0, SA1, [PSA]
+ smull AC0, AC1, CO0, SA0
+ .elseif \maxchan == 5
+ ldr CO0, [PCO, #0]
+ ldr SA0, [PSA, #0]
+ ldr CO1, [PCO, #4]
+ ldr SA1, [PSA, #4]
+ ldrd CO2, CO3, [PCO, #8]
+ smull AC0, AC1, CO0, SA0
+ ldrd SA2, SA3, [PSA, #8]
+ smlal AC0, AC1, CO1, SA1
+ ldrd CO0, CO1, [PCO, #16]
+ smlal AC0, AC1, CO2, SA2
+ ldrd SA0, SA1, [PSA, #16]
+ smlal AC0, AC1, CO3, SA3
+ smlal AC0, AC1, CO0, SA0
+ .else // \maxchan == 7
+ ldr CO2, [PCO, #0]
+ ldr SA2, [PSA, #0]
+ ldr CO3, [PCO, #4]
+ ldr SA3, [PSA, #4]
+ ldrd CO0, CO1, [PCO, #8]
+ smull AC0, AC1, CO2, SA2
+ ldrd SA0, SA1, [PSA, #8]
+ smlal AC0, AC1, CO3, SA3
+ ldrd CO2, CO3, [PCO, #16]
+ smlal AC0, AC1, CO0, SA0
+ ldrd SA2, SA3, [PSA, #16]
+ smlal AC0, AC1, CO1, SA1
+ ldrd CO0, CO1, [PCO, #24]
+ smlal AC0, AC1, CO2, SA2
+ ldrd SA0, SA1, [PSA, #24]
+ smlal AC0, AC1, CO3, SA3
+ smlal AC0, AC1, CO0, SA0
+ .endif
+ ldm sp, {NOISE, DCH, MASK}
+ smlal AC0, AC1, CO1, SA1
+ .if \shift != 0
+ .if \index_mask == 63
+ add NOISE, NOISE, INDEX, lsr #32-6
+ ldrb LSB, [PBL], #MAX_CHANNELS
+ ldrsb NOISE, [NOISE]
+ add INDEX, INDEX, INDEX, lsl #32-6
+ .else // \index_mask == 127
+ add NOISE, NOISE, INDEX, lsr #32-7
+ ldrb LSB, [PBL], #MAX_CHANNELS
+ ldrsb NOISE, [NOISE]
+ add INDEX, INDEX, INDEX, lsl #32-7
+ .endif
+ sub INDEX, INDEX, #1<<7
+ adds AC0, AC0, NOISE, lsl #\shift + 7
+ adc AC1, AC1, NOISE, asr #31
+ .else
+ ldrb LSB, [PBL], #MAX_CHANNELS
+ sub INDEX, INDEX, #1<<7
+ .endif
+ add PSA, PSA, #MAX_CHANNELS*4
+ mov AC0, AC0, lsr #14
+ orr AC0, AC0, AC1, lsl #18
+ .if !\mask_minus1
+ and AC0, AC0, MASK
+ .endif
+ add AC0, AC0, LSB
+ tst INDEX, #1<<15
+ str AC0, [PSA, DCH, lsl #2] // DCH is precompensated for the early increment of PSA
+ beq 1b
+ b 98f
+.endm
+
+.macro switch_on_maxchan shift, index_mask, mask_minus1
+ cmp v4, #5
+ blo 51f
+ beq 50f
+ implement_rematrix \shift, \index_mask, \mask_minus1, 7
+50: implement_rematrix \shift, \index_mask, \mask_minus1, 5
+51: implement_rematrix \shift, \index_mask, \mask_minus1, 1
+.endm
+
+.macro switch_on_mask shift, index_mask
+ cmp sl, #-1
+ bne 40f
+ switch_on_maxchan \shift, \index_mask, 1
+40: switch_on_maxchan \shift, \index_mask, 0
+.endm
+
+.macro switch_on_au_size shift
+ .if \shift == 0
+ switch_on_mask \shift, undefined
+ .else
+ teq v6, #64
+ bne 30f
+ orr INDEX, INDEX, v1, lsl #32-6
+ switch_on_mask \shift, 63
+30: orr INDEX, INDEX, v1, lsl #32-7
+ switch_on_mask \shift, 127
+ .endif
+.endm
+
+/* void ff_mlp_rematrix_channel_arm(int32_t *samples,
+ * const int32_t *coeffs,
+ * const uint8_t *bypassed_lsbs,
+ * const int8_t *noise_buffer,
+ * int index,
+ * unsigned int dest_ch,
+ * uint16_t blockpos,
+ * unsigned int maxchan,
+ * int matrix_noise_shift,
+ * int access_unit_size_pow2,
+ * int32_t mask);
+ */
+function ff_mlp_rematrix_channel_arm, export=1
+ push {v1-fp,lr}
+ add v1, sp, #9*4 // point at arguments on stack
+ ldm v1, {v1-sl}
+ teq v4, #1
+ itt ne
+ teqne v4, #5
+ teqne v4, #7
+ bne 99f
+ teq v6, #64
+ it ne
+ teqne v6, #128
+ bne 99f
+ sub v2, v2, #MAX_CHANNELS
+ push {a4,v2,sl} // initialise NOISE,DCH,MASK; make sp dword-aligned
+ movs INDEX, v3, lsl #7
+ beq 98f // just in case, do nothing if blockpos = 0
+ subs INDEX, INDEX, #1<<7 // offset by 1 so we borrow at the right time
+ adc lr, v1, v1 // calculate index2 (C was set by preceding subs)
+ orr INDEX, INDEX, lr
+ // Switch on matrix_noise_shift: values 0 and 1 are
+ // disproportionately common so do those in a form the branch
+ // predictor can accelerate. Values can only go up to 15.
+ cmp v5, #1
+ beq 11f
+ blo 10f
+A ldr pc, [pc, v5, lsl #2]
+T tbh [pc, v5, lsl #1]
+0:
+A .word 0, 0, 0, 12f, 13f, 14f, 15f, 16f, 17f, 18f, 19f, 20f, 21f, 22f, 23f, 24f, 25f
+T .hword 0, 0, (12f - 0b) / 2, (13f - 0b) / 2, (14f - 0b) / 2, (15f - 0b) / 2
+T .hword (16f - 0b) / 2, (17f - 0b) / 2, (18f - 0b) / 2, (19f - 0b) / 2
+T .hword (20f - 0b) / 2, (21f - 0b) / 2, (22f - 0b) / 2, (23f - 0b) / 2, (24f - 0b) / 2, (25f - 0b) / 2
+10: switch_on_au_size 0
+11: switch_on_au_size 1
+12: switch_on_au_size 2
+13: switch_on_au_size 3
+14: switch_on_au_size 4
+15: switch_on_au_size 5
+16: switch_on_au_size 6
+17: switch_on_au_size 7
+18: switch_on_au_size 8
+19: switch_on_au_size 9
+20: switch_on_au_size 10
+21: switch_on_au_size 11
+22: switch_on_au_size 12
+23: switch_on_au_size 13
+24: switch_on_au_size 14
+25: switch_on_au_size 15
+
+98: add sp, sp, #3*4
+ pop {v1-fp,pc}
+99: // Can't handle these parameters, drop back to C
+ pop {v1-fp,lr}
+ b X(ff_mlp_rematrix_channel)
+endfunc
+
+ .unreq PSA
+ .unreq PCO
+ .unreq PBL
+ .unreq INDEX
+ .unreq CO0
+ .unreq CO1
+ .unreq CO2
+ .unreq CO3
+ .unreq SA0
+ .unreq SA1
+ .unreq SA2
+ .unreq SA3
+ .unreq AC0
+ .unreq AC1
+ .unreq NOISE
+ .unreq LSB
+ .unreq DCH
+ .unreq MASK
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_armv6.S b/chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_armv6.S
new file mode 100644
index 00000000000..d98f807559c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_armv6.S
@@ -0,0 +1,533 @@
+/*
+ * Copyright (c) 2014 RISC OS Open Ltd
+ * Author: Ben Avison <bavison@riscosopen.org>
+ *
+ * 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 "libavutil/arm/asm.S"
+
+.macro loadregoffsh2 group, index, base, offgroup, offindex
+ .altmacro
+ loadregoffsh2_ \group, %(\index), \base, \offgroup, %(\offindex)
+ .noaltmacro
+.endm
+
+.macro loadregoffsh2_ group, index, base, offgroup, offindex
+ ldr \group\index, [\base, \offgroup\offindex, lsl #2]
+.endm
+
+.macro eorlslreg check, data, group, index
+ .altmacro
+ eorlslreg_ \check, \data, \group, %(\index)
+ .noaltmacro
+.endm
+
+.macro eorlslreg_ check, data, group, index
+ eor \check, \check, \data, lsl \group\index
+.endm
+
+.macro decr_modulo var, by, modulus
+ .set \var, \var - \by
+ .if \var == 0
+ .set \var, \modulus
+ .endif
+.endm
+
+ .macro load_group1 size, channels, r0, r1, r2, r3, pointer_dead=0
+ .if \size == 2
+ ldrd \r0, \r1, [IN], #(\size + 8 - \channels) * 4
+ .else // size == 4
+ .if IDX1 > 4 || \channels==8
+ ldm IN!, {\r0, \r1, \r2, \r3}
+ .else
+ ldm IN, {\r0, \r1, \r2, \r3}
+ .if !\pointer_dead
+ add IN, IN, #(4 + 8 - \channels) * 4
+ .endif
+ .endif
+ .endif
+ decr_modulo IDX1, \size, \channels
+ .endm
+
+ .macro load_group2 size, channels, r0, r1, r2, r3, pointer_dead=0
+ .if \size == 2
+ .if IDX1 > 2
+ ldm IN!, {\r2, \r3}
+ .else
+//A .ifc \r2, ip
+//A .if \pointer_dead
+//A ldm IN, {\r2, \r3}
+//A .else
+//A ldr \r2, [IN], #4
+//A ldr \r3, [IN], #(\size - 1 + 8 - \channels) * 4
+//A .endif
+//A .else
+ ldrd \r2, \r3, [IN], #(\size + 8 - \channels) * 4
+//A .endif
+ .endif
+ .endif
+ decr_modulo IDX1, \size, \channels
+ .endm
+
+.macro implement_pack inorder, channels, shift
+.if \inorder
+.ifc \shift, mixed
+
+CHECK .req a1
+COUNT .req a2
+IN .req a3
+OUT .req a4
+DAT0 .req v1
+DAT1 .req v2
+DAT2 .req v3
+DAT3 .req v4
+SHIFT0 .req v5
+SHIFT1 .req v6
+SHIFT2 .req sl
+SHIFT3 .req fp
+SHIFT4 .req ip
+SHIFT5 .req lr
+
+ .macro output4words
+ .set SIZE_GROUP1, IDX1
+ .if SIZE_GROUP1 > 4
+ .set SIZE_GROUP1, 4
+ .endif
+ .set SIZE_GROUP2, 4 - SIZE_GROUP1
+ load_group1 SIZE_GROUP1, \channels, DAT0, DAT1, DAT2, DAT3
+ load_group2 SIZE_GROUP2, \channels, DAT0, DAT1, DAT2, DAT3
+ .if \channels == 2
+ lsl DAT0, SHIFT0
+ lsl DAT1, SHIFT1
+ lsl DAT2, SHIFT0
+ lsl DAT3, SHIFT1
+ .elseif \channels == 6
+ .if IDX2 == 6
+ lsl DAT0, SHIFT0
+ lsl DAT1, SHIFT1
+ lsl DAT2, SHIFT2
+ lsl DAT3, SHIFT3
+ .elseif IDX2 == 2
+ lsl DAT0, SHIFT4
+ lsl DAT1, SHIFT5
+ lsl DAT2, SHIFT0
+ lsl DAT3, SHIFT1
+ .else // IDX2 == 4
+ lsl DAT0, SHIFT2
+ lsl DAT1, SHIFT3
+ lsl DAT2, SHIFT4
+ lsl DAT3, SHIFT5
+ .endif
+ .elseif \channels == 8
+ .if IDX2 == 8
+ uxtb SHIFT0, SHIFT4, ror #0
+ uxtb SHIFT1, SHIFT4, ror #8
+ uxtb SHIFT2, SHIFT4, ror #16
+ uxtb SHIFT3, SHIFT4, ror #24
+ .else
+ uxtb SHIFT0, SHIFT5, ror #0
+ uxtb SHIFT1, SHIFT5, ror #8
+ uxtb SHIFT2, SHIFT5, ror #16
+ uxtb SHIFT3, SHIFT5, ror #24
+ .endif
+ lsl DAT0, SHIFT0
+ lsl DAT1, SHIFT1
+ lsl DAT2, SHIFT2
+ lsl DAT3, SHIFT3
+ .endif
+ eor CHECK, CHECK, DAT0, lsr #8 - (\channels - IDX2)
+ eor CHECK, CHECK, DAT1, lsr #7 - (\channels - IDX2)
+ decr_modulo IDX2, 2, \channels
+ eor CHECK, CHECK, DAT2, lsr #8 - (\channels - IDX2)
+ eor CHECK, CHECK, DAT3, lsr #7 - (\channels - IDX2)
+ decr_modulo IDX2, 2, \channels
+ stm OUT!, {DAT0 - DAT3}
+ .endm
+
+ .set WORDS_PER_LOOP, \channels // calculate LCM (channels, 4)
+ .if (WORDS_PER_LOOP % 2) == 0
+ .set WORDS_PER_LOOP, WORDS_PER_LOOP / 2
+ .endif
+ .if (WORDS_PER_LOOP % 2) == 0
+ .set WORDS_PER_LOOP, WORDS_PER_LOOP / 2
+ .endif
+ .set WORDS_PER_LOOP, WORDS_PER_LOOP * 4
+ .set SAMPLES_PER_LOOP, WORDS_PER_LOOP / \channels
+
+function ff_mlp_pack_output_inorder_\channels\()ch_mixedshift_armv6, export=1
+ .if SAMPLES_PER_LOOP > 1
+ tst COUNT, #SAMPLES_PER_LOOP - 1 // always seems to be in practice
+ it ne
+ bne X(ff_mlp_pack_output) // but just in case, branch to C implementation if not
+ .endif
+ teq COUNT, #0
+ it eq
+ bxeq lr
+ push {v1-v6,sl,fp,lr}
+ ldr SHIFT0, [sp, #(9+1)*4] // get output_shift from stack
+ ldr SHIFT1, =0x08080808
+ ldr SHIFT4, [SHIFT0]
+ .if \channels == 2
+ uadd8 SHIFT4, SHIFT4, SHIFT1 // increase all shifts by 8
+ uxtb SHIFT0, SHIFT4, ror #0
+ uxtb SHIFT1, SHIFT4, ror #8
+ .else
+ ldr SHIFT5, [SHIFT0, #4]
+ uadd8 SHIFT4, SHIFT4, SHIFT1 // increase all shifts by 8
+ uadd8 SHIFT5, SHIFT5, SHIFT1
+ .if \channels == 6
+ uxtb SHIFT0, SHIFT4, ror #0
+ uxtb SHIFT1, SHIFT4, ror #8
+ uxtb SHIFT2, SHIFT4, ror #16
+ uxtb SHIFT3, SHIFT4, ror #24
+ uxtb SHIFT4, SHIFT5, ror #0
+ uxtb SHIFT5, SHIFT5, ror #8
+ .endif
+ .endif
+ .set IDX1, \channels
+ .set IDX2, \channels
+0:
+ .rept WORDS_PER_LOOP / 4
+ output4words
+ .endr
+ subs COUNT, COUNT, #SAMPLES_PER_LOOP
+ bne 0b
+ pop {v1-v6,sl,fp,pc}
+ .ltorg
+endfunc
+ .purgem output4words
+
+ .unreq CHECK
+ .unreq COUNT
+ .unreq IN
+ .unreq OUT
+ .unreq DAT0
+ .unreq DAT1
+ .unreq DAT2
+ .unreq DAT3
+ .unreq SHIFT0
+ .unreq SHIFT1
+ .unreq SHIFT2
+ .unreq SHIFT3
+ .unreq SHIFT4
+ .unreq SHIFT5
+
+.else // not mixed
+
+CHECK .req a1
+COUNT .req a2
+IN .req a3
+OUT .req a4
+DAT0 .req v1
+DAT1 .req v2
+DAT2 .req v3
+DAT3 .req v4
+DAT4 .req v5
+DAT5 .req v6
+DAT6 .req sl // use these rather than the otherwise unused
+DAT7 .req fp // ip and lr so that we can load them usinf LDRD
+
+ .macro output4words tail, head, r0, r1, r2, r3, r4, r5, r6, r7, pointer_dead=0
+ .if \head
+ .set SIZE_GROUP1, IDX1
+ .if SIZE_GROUP1 > 4
+ .set SIZE_GROUP1, 4
+ .endif
+ .set SIZE_GROUP2, 4 - SIZE_GROUP1
+ load_group1 SIZE_GROUP1, \channels, \r0, \r1, \r2, \r3, \pointer_dead
+ .endif
+ .if \tail
+ eor CHECK, CHECK, \r4, lsr #8 - (\channels - IDX2)
+ eor CHECK, CHECK, \r5, lsr #7 - (\channels - IDX2)
+ decr_modulo IDX2, 2, \channels
+ .endif
+ .if \head
+ load_group2 SIZE_GROUP2, \channels, \r0, \r1, \r2, \r3, \pointer_dead
+ .endif
+ .if \tail
+ eor CHECK, CHECK, \r6, lsr #8 - (\channels - IDX2)
+ eor CHECK, CHECK, \r7, lsr #7 - (\channels - IDX2)
+ decr_modulo IDX2, 2, \channels
+ stm OUT!, {\r4, \r5, \r6, \r7}
+ .endif
+ .if \head
+ lsl \r0, #8 + \shift
+ lsl \r1, #8 + \shift
+ lsl \r2, #8 + \shift
+ lsl \r3, #8 + \shift
+ .endif
+ .endm
+
+ .set WORDS_PER_LOOP, \channels // calculate LCM (channels, 8)
+ .if (WORDS_PER_LOOP % 2) == 0
+ .set WORDS_PER_LOOP, WORDS_PER_LOOP / 2
+ .endif
+ .if (WORDS_PER_LOOP % 2) == 0
+ .set WORDS_PER_LOOP, WORDS_PER_LOOP / 2
+ .endif
+ .if (WORDS_PER_LOOP % 2) == 0
+ .set WORDS_PER_LOOP, WORDS_PER_LOOP / 2
+ .endif
+ .set WORDS_PER_LOOP, WORDS_PER_LOOP * 8
+ .set SAMPLES_PER_LOOP, WORDS_PER_LOOP / \channels
+
+function ff_mlp_pack_output_inorder_\channels\()ch_\shift\()shift_armv6, export=1
+ .if SAMPLES_PER_LOOP > 1
+ tst COUNT, #SAMPLES_PER_LOOP - 1 // always seems to be in practice
+ it ne
+ bne X(ff_mlp_pack_output) // but just in case, branch to C implementation if not
+ .endif
+ subs COUNT, COUNT, #SAMPLES_PER_LOOP
+ it lo
+ bxlo lr
+ push {v1-v6,sl,fp,lr}
+ .set IDX1, \channels
+ .set IDX2, \channels
+ output4words 0, 1, DAT0, DAT1, DAT2, DAT3, DAT4, DAT5, DAT6, DAT7
+0: beq 1f
+ .rept WORDS_PER_LOOP / 8
+ output4words 1, 1, DAT4, DAT5, DAT6, DAT7, DAT0, DAT1, DAT2, DAT3
+ output4words 1, 1, DAT0, DAT1, DAT2, DAT3, DAT4, DAT5, DAT6, DAT7
+ .endr
+ subs COUNT, COUNT, #SAMPLES_PER_LOOP
+ bne 0b
+1:
+ .rept WORDS_PER_LOOP / 8 - 1
+ output4words 1, 1, DAT4, DAT5, DAT6, DAT7, DAT0, DAT1, DAT2, DAT3
+ output4words 1, 1, DAT0, DAT1, DAT2, DAT3, DAT4, DAT5, DAT6, DAT7
+ .endr
+ output4words 1, 1, DAT4, DAT5, DAT6, DAT7, DAT0, DAT1, DAT2, DAT3, pointer_dead=1
+ output4words 1, 0, DAT0, DAT1, DAT2, DAT3, DAT4, DAT5, DAT6, DAT7
+ pop {v1-v6,sl,fp,pc}
+endfunc
+ .purgem output4words
+
+ .unreq CHECK
+ .unreq COUNT
+ .unreq IN
+ .unreq OUT
+ .unreq DAT0
+ .unreq DAT1
+ .unreq DAT2
+ .unreq DAT3
+ .unreq DAT4
+ .unreq DAT5
+ .unreq DAT6
+ .unreq DAT7
+
+.endif // mixed
+.else // not inorder
+.ifc \shift, mixed
+
+// This case not currently handled
+
+.else // not mixed
+
+#if !CONFIG_THUMB
+
+CHECK .req a1
+COUNT .req a2
+IN .req a3
+OUT .req a4
+DAT0 .req v1
+DAT1 .req v2
+DAT2 .req v3
+DAT3 .req v4
+CHAN0 .req v5
+CHAN1 .req v6
+CHAN2 .req sl
+CHAN3 .req fp
+CHAN4 .req ip
+CHAN5 .req lr
+
+ .macro output4words
+ .if \channels == 8
+ .if IDX1 == 8
+ uxtb CHAN0, CHAN4, ror #0
+ uxtb CHAN1, CHAN4, ror #8
+ uxtb CHAN2, CHAN4, ror #16
+ uxtb CHAN3, CHAN4, ror #24
+ .else
+ uxtb CHAN0, CHAN5, ror #0
+ uxtb CHAN1, CHAN5, ror #8
+ uxtb CHAN2, CHAN5, ror #16
+ uxtb CHAN3, CHAN5, ror #24
+ .endif
+ ldr DAT0, [IN, CHAN0, lsl #2]
+ ldr DAT1, [IN, CHAN1, lsl #2]
+ ldr DAT2, [IN, CHAN2, lsl #2]
+ ldr DAT3, [IN, CHAN3, lsl #2]
+ .if IDX1 == 4
+ add IN, IN, #8*4
+ .endif
+ decr_modulo IDX1, 4, \channels
+ .else
+ .set SIZE_GROUP1, IDX1
+ .if SIZE_GROUP1 > 4
+ .set SIZE_GROUP1, 4
+ .endif
+ .set SIZE_GROUP2, 4 - SIZE_GROUP1
+ .if SIZE_GROUP1 == 2
+ loadregoffsh2 DAT, 0, IN, CHAN, 0 + (\channels - IDX1)
+ loadregoffsh2 DAT, 1, IN, CHAN, 1 + (\channels - IDX1)
+ add IN, IN, #8*4
+ .else // SIZE_GROUP1 == 4
+ loadregoffsh2 DAT, 0, IN, CHAN, 0 + (\channels - IDX1)
+ loadregoffsh2 DAT, 1, IN, CHAN, 1 + (\channels - IDX1)
+ loadregoffsh2 DAT, 2, IN, CHAN, 2 + (\channels - IDX1)
+ loadregoffsh2 DAT, 3, IN, CHAN, 3 + (\channels - IDX1)
+ .if IDX1 == 4
+ add IN, IN, #8*4
+ .endif
+ .endif
+ decr_modulo IDX1, SIZE_GROUP1, \channels
+ .if SIZE_GROUP2 == 2
+ loadregoffsh2 DAT, 2, IN, CHAN, 0 + (\channels - IDX1)
+ loadregoffsh2 DAT, 3, IN, CHAN, 1 + (\channels - IDX1)
+ .if IDX1 == 2
+ add IN, IN, #8*4
+ .endif
+ .endif
+ decr_modulo IDX1, SIZE_GROUP2, \channels
+ .endif
+ .if \channels == 8 // in this case we can corrupt CHAN0-3
+ rsb CHAN0, CHAN0, #8
+ rsb CHAN1, CHAN1, #8
+ rsb CHAN2, CHAN2, #8
+ rsb CHAN3, CHAN3, #8
+ lsl DAT0, #8 + \shift
+ lsl DAT1, #8 + \shift
+ lsl DAT2, #8 + \shift
+ lsl DAT3, #8 + \shift
+ eor CHECK, CHECK, DAT0, lsr CHAN0
+ eor CHECK, CHECK, DAT1, lsr CHAN1
+ eor CHECK, CHECK, DAT2, lsr CHAN2
+ eor CHECK, CHECK, DAT3, lsr CHAN3
+ .else
+ .if \shift != 0
+ lsl DAT0, #\shift
+ lsl DAT1, #\shift
+ lsl DAT2, #\shift
+ lsl DAT3, #\shift
+ .endif
+ bic DAT0, DAT0, #0xff000000
+ bic DAT1, DAT1, #0xff000000
+ bic DAT2, DAT2, #0xff000000
+ bic DAT3, DAT3, #0xff000000
+ eorlslreg CHECK, DAT0, CHAN, 0 + (\channels - IDX2)
+ eorlslreg CHECK, DAT1, CHAN, 1 + (\channels - IDX2)
+ decr_modulo IDX2, 2, \channels
+ eorlslreg CHECK, DAT2, CHAN, 0 + (\channels - IDX2)
+ eorlslreg CHECK, DAT3, CHAN, 1 + (\channels - IDX2)
+ decr_modulo IDX2, 2, \channels
+ lsl DAT0, #8
+ lsl DAT1, #8
+ lsl DAT2, #8
+ lsl DAT3, #8
+ .endif
+ stm OUT!, {DAT0 - DAT3}
+ .endm
+
+ .set WORDS_PER_LOOP, \channels // calculate LCM (channels, 4)
+ .if (WORDS_PER_LOOP % 2) == 0
+ .set WORDS_PER_LOOP, WORDS_PER_LOOP / 2
+ .endif
+ .if (WORDS_PER_LOOP % 2) == 0
+ .set WORDS_PER_LOOP, WORDS_PER_LOOP / 2
+ .endif
+ .set WORDS_PER_LOOP, WORDS_PER_LOOP * 4
+ .set SAMPLES_PER_LOOP, WORDS_PER_LOOP / \channels
+
+function ff_mlp_pack_output_outoforder_\channels\()ch_\shift\()shift_armv6, export=1
+ .if SAMPLES_PER_LOOP > 1
+ tst COUNT, #SAMPLES_PER_LOOP - 1 // always seems to be in practice
+ it ne
+ bne X(ff_mlp_pack_output) // but just in case, branch to C implementation if not
+ .endif
+ teq COUNT, #0
+ it eq
+ bxeq lr
+ push {v1-v6,sl,fp,lr}
+ ldr CHAN0, [sp, #(9+0)*4] // get ch_assign from stack
+ ldr CHAN4, [CHAN0]
+ .if \channels == 2
+ uxtb CHAN0, CHAN4, ror #0
+ uxtb CHAN1, CHAN4, ror #8
+ .else
+ ldr CHAN5, [CHAN0, #4]
+ .if \channels == 6
+ uxtb CHAN0, CHAN4, ror #0
+ uxtb CHAN1, CHAN4, ror #8
+ uxtb CHAN2, CHAN4, ror #16
+ uxtb CHAN3, CHAN4, ror #24
+ uxtb CHAN4, CHAN5, ror #0
+ uxtb CHAN5, CHAN5, ror #8
+ .endif
+ .endif
+ .set IDX1, \channels
+ .set IDX2, \channels
+0:
+ .rept WORDS_PER_LOOP / 4
+ output4words
+ .endr
+ subs COUNT, COUNT, #SAMPLES_PER_LOOP
+ bne 0b
+ pop {v1-v6,sl,fp,pc}
+ .ltorg
+endfunc
+ .purgem output4words
+
+ .unreq CHECK
+ .unreq COUNT
+ .unreq IN
+ .unreq OUT
+ .unreq DAT0
+ .unreq DAT1
+ .unreq DAT2
+ .unreq DAT3
+ .unreq CHAN0
+ .unreq CHAN1
+ .unreq CHAN2
+ .unreq CHAN3
+ .unreq CHAN4
+ .unreq CHAN5
+
+#endif // !CONFIG_THUMB
+
+.endif // mixed
+.endif // inorder
+.endm // implement_pack
+
+.macro pack_channels inorder, channels
+ implement_pack \inorder, \channels, 0
+ implement_pack \inorder, \channels, 1
+ implement_pack \inorder, \channels, 2
+ implement_pack \inorder, \channels, 3
+ implement_pack \inorder, \channels, 4
+ implement_pack \inorder, \channels, 5
+ implement_pack \inorder, \channels, mixed
+.endm
+
+.macro pack_order inorder
+ pack_channels \inorder, 2
+ pack_channels \inorder, 6
+ pack_channels \inorder, 8
+.endm
+
+ pack_order 0
+ pack_order 1
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_init_arm.c
new file mode 100644
index 00000000000..34a5f61e1d0
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/mlpdsp_init_arm.c
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2014 RISC OS Open Ltd
+ * Author: Ben Avison <bavison@riscosopen.org>
+ *
+ * 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 "libavutil/arm/cpu.h"
+#include "libavutil/attributes.h"
+#include "libavcodec/mlpdsp.h"
+
+void ff_mlp_filter_channel_arm(int32_t *state, const int32_t *coeff,
+ int firorder, int iirorder,
+ unsigned int filter_shift, int32_t mask,
+ int blocksize, int32_t *sample_buffer);
+void ff_mlp_rematrix_channel_arm(int32_t *samples,
+ const int32_t *coeffs,
+ const uint8_t *bypassed_lsbs,
+ const int8_t *noise_buffer,
+ int index,
+ unsigned int dest_ch,
+ uint16_t blockpos,
+ unsigned int maxchan,
+ int matrix_noise_shift,
+ int access_unit_size_pow2,
+ int32_t mask);
+
+#define DECLARE_PACK(order,channels,shift) \
+ int32_t ff_mlp_pack_output_##order##order_##channels##ch_##shift##shift_armv6(int32_t, uint16_t, int32_t (*)[], void *, uint8_t*, int8_t *, uint8_t, int);
+#define ENUMERATE_PACK(order,channels,shift) \
+ ff_mlp_pack_output_##order##order_##channels##ch_##shift##shift_armv6,
+#define PACK_CHANNELS(macro,order,channels) \
+ macro(order,channels,0) \
+ macro(order,channels,1) \
+ macro(order,channels,2) \
+ macro(order,channels,3) \
+ macro(order,channels,4) \
+ macro(order,channels,5) \
+ macro(order,channels,mixed)
+#define PACK_ORDER(macro,order) \
+ PACK_CHANNELS(macro,order,2) \
+ PACK_CHANNELS(macro,order,6) \
+ PACK_CHANNELS(macro,order,8)
+#define PACK_ALL(macro) \
+ PACK_ORDER(macro,outof) \
+ PACK_ORDER(macro,in)
+PACK_ALL(DECLARE_PACK)
+
+#define ff_mlp_pack_output_outoforder_2ch_mixedshift_armv6 0
+#define ff_mlp_pack_output_outoforder_6ch_mixedshift_armv6 0
+#define ff_mlp_pack_output_outoforder_8ch_mixedshift_armv6 0
+#if CONFIG_THUMB
+#define ff_mlp_pack_output_outoforder_2ch_0shift_armv6 0
+#define ff_mlp_pack_output_outoforder_2ch_1shift_armv6 0
+#define ff_mlp_pack_output_outoforder_2ch_2shift_armv6 0
+#define ff_mlp_pack_output_outoforder_2ch_3shift_armv6 0
+#define ff_mlp_pack_output_outoforder_2ch_4shift_armv6 0
+#define ff_mlp_pack_output_outoforder_2ch_5shift_armv6 0
+#define ff_mlp_pack_output_outoforder_6ch_0shift_armv6 0
+#define ff_mlp_pack_output_outoforder_6ch_1shift_armv6 0
+#define ff_mlp_pack_output_outoforder_6ch_2shift_armv6 0
+#define ff_mlp_pack_output_outoforder_6ch_3shift_armv6 0
+#define ff_mlp_pack_output_outoforder_6ch_4shift_armv6 0
+#define ff_mlp_pack_output_outoforder_6ch_5shift_armv6 0
+#define ff_mlp_pack_output_outoforder_8ch_0shift_armv6 0
+#define ff_mlp_pack_output_outoforder_8ch_1shift_armv6 0
+#define ff_mlp_pack_output_outoforder_8ch_2shift_armv6 0
+#define ff_mlp_pack_output_outoforder_8ch_3shift_armv6 0
+#define ff_mlp_pack_output_outoforder_8ch_4shift_armv6 0
+#define ff_mlp_pack_output_outoforder_8ch_5shift_armv6 0
+#endif
+
+static int32_t (*mlp_select_pack_output_armv6(uint8_t *ch_assign,
+ int8_t *output_shift,
+ uint8_t max_matrix_channel,
+ int is32))(int32_t, uint16_t, int32_t (*)[], void *, uint8_t*, int8_t *, uint8_t, int)
+{
+ int ch_index;
+ int shift = output_shift[0] < 0 || output_shift[0] > 5 ? 6 : output_shift[0];
+ int inorder = 1;
+ static int32_t (*const routine[2*3*7])(int32_t, uint16_t, int32_t (*)[], void *, uint8_t*, int8_t *, uint8_t, int) = {
+ PACK_ALL(ENUMERATE_PACK)
+ };
+ int i;
+
+ if (!is32) // don't support 16-bit output (it's not used by TrueHD)
+ return ff_mlp_pack_output;
+
+ switch (max_matrix_channel) {
+ case 1:
+ ch_index = 0;
+ break;
+ case 5:
+ ch_index = 1;
+ break;
+ case 7:
+ ch_index = 2;
+ break;
+ default:
+ return ff_mlp_pack_output;
+ }
+
+ for (i = 0; i <= max_matrix_channel; i++) {
+ if (shift != 6 && output_shift[i] != shift)
+ shift = 6; // indicate mixed shifts
+ if (ch_assign[i] != i)
+ inorder = 0;
+ }
+#if CONFIG_THUMB
+ if (!inorder)
+ return ff_mlp_pack_output; // can't currently handle an order array except in ARM mode
+#else
+ if (shift == 6 && !inorder)
+ return ff_mlp_pack_output; // can't currently handle both an order array and a shift array
+#endif
+
+ return routine[(inorder*3+ch_index)*7+shift];
+}
+
+av_cold void ff_mlpdsp_init_arm(MLPDSPContext *c)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_armv5te(cpu_flags)) {
+ c->mlp_filter_channel = ff_mlp_filter_channel_arm;
+ c->mlp_rematrix_channel = ff_mlp_rematrix_channel_arm;
+ }
+ if (have_armv6(cpu_flags))
+ c->mlp_select_pack_output = mlp_select_pack_output_armv6;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_arm.c
index 656679809b0..5f5473d28c8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_arm.c
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/internal.h"
#include "libavutil/arm/cpu.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/mpegvideo.h"
@@ -25,12 +26,13 @@
#include "asm-offsets.h"
#if HAVE_NEON
-CHK_OFFS(MpegEncContext, y_dc_scale, Y_DC_SCALE);
-CHK_OFFS(MpegEncContext, c_dc_scale, C_DC_SCALE);
-CHK_OFFS(MpegEncContext, ac_pred, AC_PRED);
-CHK_OFFS(MpegEncContext, block_last_index, BLOCK_LAST_INDEX);
-CHK_OFFS(MpegEncContext, inter_scantable.raster_end, INTER_SCANTAB_RASTER_END);
-CHK_OFFS(MpegEncContext, h263_aic, H263_AIC);
+AV_CHECK_OFFSET(MpegEncContext, y_dc_scale, Y_DC_SCALE);
+AV_CHECK_OFFSET(MpegEncContext, c_dc_scale, C_DC_SCALE);
+AV_CHECK_OFFSET(MpegEncContext, ac_pred, AC_PRED);
+AV_CHECK_OFFSET(MpegEncContext, block_last_index, BLOCK_LAST_INDEX);
+AV_CHECK_OFFSET(MpegEncContext, inter_scantable.raster_end,
+ INTER_SCANTAB_RASTER_END);
+AV_CHECK_OFFSET(MpegEncContext, h263_aic, H263_AIC);
#endif
void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, int16_t *block,
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_arm.h b/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_arm.h
index 4ff93b76b9c..78e07e15c50 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_arm.h
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_arm.h
@@ -16,11 +16,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef AVCODEC_ARM_MPEGVIDEO_H
-#define AVCODEC_ARM_MPEGVIDEO_H
+#ifndef AVCODEC_ARM_MPEGVIDEO_ARM_H
+#define AVCODEC_ARM_MPEGVIDEO_ARM_H
#include "libavcodec/mpegvideo.h"
void ff_MPV_common_init_armv5te(MpegEncContext *s);
-#endif /* AVCODEC_ARM_MPEGVIDEO_H */
+#endif /* AVCODEC_ARM_MPEGVIDEO_ARM_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_neon.S
index e05df8e7113..1889d7a9121 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_neon.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/mpegvideo_neon.S
@@ -100,7 +100,7 @@ function ff_dct_unquantize_h263_intra_neon, export=1
smulbb r4, r4, r6
2: lsl r0, r3, #1
add r3, r12, #1
- bl ff_dct_unquantize_h263_neon
+ bl X(ff_dct_unquantize_h263_neon)
vmov.16 d0[0], r4
vst1.16 {d0[0]}, [r5]
pop {r4-r6,pc}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/neontest.c b/chromium/third_party/ffmpeg/libavcodec/arm/neontest.c
new file mode 100644
index 00000000000..a3b5b8e2e37
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/neontest.c
@@ -0,0 +1,79 @@
+/*
+ * check NEON registers for clobbers
+ * Copyright (c) 2013 Martin Storsjo
+ *
+ * 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 "libavcodec/avcodec.h"
+#include "libavutil/arm/neontest.h"
+
+wrap(avcodec_open2(AVCodecContext *avctx,
+ AVCodec *codec,
+ AVDictionary **options))
+{
+ testneonclobbers(avcodec_open2, avctx, codec, options);
+}
+
+wrap(avcodec_decode_audio4(AVCodecContext *avctx,
+ AVFrame *frame,
+ int *got_frame_ptr,
+ AVPacket *avpkt))
+{
+ testneonclobbers(avcodec_decode_audio4, avctx, frame,
+ got_frame_ptr, avpkt);
+}
+
+wrap(avcodec_decode_video2(AVCodecContext *avctx,
+ AVFrame *picture,
+ int *got_picture_ptr,
+ AVPacket *avpkt))
+{
+ testneonclobbers(avcodec_decode_video2, avctx, picture,
+ got_picture_ptr, avpkt);
+}
+
+wrap(avcodec_decode_subtitle2(AVCodecContext *avctx,
+ AVSubtitle *sub,
+ int *got_sub_ptr,
+ AVPacket *avpkt))
+{
+ testneonclobbers(avcodec_decode_subtitle2, avctx, sub,
+ got_sub_ptr, avpkt);
+}
+
+wrap(avcodec_encode_audio2(AVCodecContext *avctx,
+ AVPacket *avpkt,
+ const AVFrame *frame,
+ int *got_packet_ptr))
+{
+ testneonclobbers(avcodec_encode_audio2, avctx, avpkt, frame,
+ got_packet_ptr);
+}
+
+wrap(avcodec_encode_subtitle(AVCodecContext *avctx,
+ uint8_t *buf, int buf_size,
+ const AVSubtitle *sub))
+{
+ testneonclobbers(avcodec_encode_subtitle, avctx, buf, buf_size, sub);
+}
+
+wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
+ const AVFrame *frame, int *got_packet_ptr))
+{
+ testneonclobbers(avcodec_encode_video2, avctx, avpkt, frame, got_packet_ptr);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/simple_idct_arm.S b/chromium/third_party/ffmpeg/libavcodec/arm/simple_idct_arm.S
index 50d20c99ee7..c6300737a8a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/simple_idct_arm.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/simple_idct_arm.S
@@ -477,3 +477,4 @@ __end_bef_a_evaluation:
sub r4, r6, r11 @ R4=a0-W2*ROWr16[2] (a3)
add r6, r6, r11 @ R6=a0+W2*ROWr16[2] (a0)
bal __end_a_evaluation
+endfunc
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/h264dsp_armv6.S b/chromium/third_party/ffmpeg/libavcodec/arm/startcode_armv6.S
index 93dc69b77a0..a46f0093751 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/h264dsp_armv6.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/startcode_armv6.S
@@ -69,8 +69,8 @@ TMP3 .req lr
andseq TMP3, TMP3, PATTERN
.endm
-/* int ff_h264_find_start_code_candidate_armv6(const uint8_t *buf, int size) */
-function ff_h264_find_start_code_candidate_armv6, export=1
+/* int ff_startcode_find_candidate_armv6(const uint8_t *buf, int size) */
+function ff_startcode_find_candidate_armv6, export=1
push {v1-v6,lr}
mov PTR, BUF
@ Ensure there are at least (PRELOAD_DISTANCE+2) complete cachelines to go
@@ -236,7 +236,7 @@ function ff_h264_find_start_code_candidate_armv6, export=1
@ drop through to 98f
98: setend le
99: pop {v1-v6,pc}
-.endfunc
+endfunc
.unreq RESULT
.unreq BUF
diff --git a/chromium/third_party/ffmpeg/libavcodec/sh4/dsputil_sh4.h b/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp.h
index 2ba93549fb3..cd01ac5384b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sh4/dsputil_sh4.h
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp.h
@@ -16,13 +16,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef AVCODEC_SH4_DSPUTIL_SH4_H
-#define AVCODEC_SH4_DSPUTIL_SH4_H
+#ifndef AVCODEC_ARM_VC1DSP_H
+#define AVCODEC_ARM_VC1DSP_H
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
-#include "libavcodec/hpeldsp.h"
+#include "libavcodec/vc1dsp.h"
-void ff_idct_sh4(int16_t *block);
+void ff_vc1dsp_init_neon(VC1DSPContext *dsp);
-#endif /* AVCODEC_SH4_DSPUTIL_SH4_H */
+#endif /* AVCODEC_ARM_VC1DSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_init_arm.c
new file mode 100644
index 00000000000..4a848484631
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_init_arm.c
@@ -0,0 +1,36 @@
+/*
+ * 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 "libavutil/attributes.h"
+#include "libavutil/arm/cpu.h"
+#include "libavcodec/vc1dsp.h"
+#include "vc1dsp.h"
+
+int ff_startcode_find_candidate_armv6(const uint8_t *buf, int size);
+
+av_cold void ff_vc1dsp_init_arm(VC1DSPContext *dsp)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_armv6(cpu_flags))
+ dsp->vc1_find_start_code_candidate = ff_startcode_find_candidate_armv6;
+ if (have_neon(cpu_flags))
+ ff_vc1dsp_init_neon(dsp);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_init_neon.c b/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_init_neon.c
new file mode 100644
index 00000000000..3b280770c54
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_init_neon.c
@@ -0,0 +1,119 @@
+/*
+ * 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 "libavutil/attributes.h"
+#include "libavcodec/vc1dsp.h"
+#include "vc1dsp.h"
+
+void ff_vc1_inv_trans_8x8_neon(int16_t *block);
+void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, int linesize, int16_t *block);
+void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, int linesize, int16_t *block);
+void ff_vc1_inv_trans_4x4_neon(uint8_t *dest, int linesize, int16_t *block);
+
+void ff_vc1_inv_trans_8x8_dc_neon(uint8_t *dest, int linesize, int16_t *block);
+void ff_vc1_inv_trans_4x8_dc_neon(uint8_t *dest, int linesize, int16_t *block);
+void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, int linesize, int16_t *block);
+void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, int linesize, int16_t *block);
+
+void ff_put_pixels8x8_neon(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int rnd);
+
+#define DECL_PUT(X, Y) \
+void ff_put_vc1_mspel_mc##X##Y##_neon(uint8_t *dst, const uint8_t *src, \
+ ptrdiff_t stride, int rnd); \
+static void ff_put_vc1_mspel_mc##X##Y##_16_neon(uint8_t *dst, const uint8_t *src, \
+ ptrdiff_t stride, int rnd) \
+{ \
+ ff_put_vc1_mspel_mc##X##Y##_neon(dst+0, src+0, stride, rnd); \
+ ff_put_vc1_mspel_mc##X##Y##_neon(dst+8, src+8, stride, rnd); \
+ dst += 8*stride; src += 8*stride; \
+ ff_put_vc1_mspel_mc##X##Y##_neon(dst+0, src+0, stride, rnd); \
+ ff_put_vc1_mspel_mc##X##Y##_neon(dst+8, src+8, stride, rnd); \
+}
+
+DECL_PUT(1, 0)
+DECL_PUT(2, 0)
+DECL_PUT(3, 0)
+
+DECL_PUT(0, 1)
+DECL_PUT(0, 2)
+DECL_PUT(0, 3)
+
+DECL_PUT(1, 1)
+DECL_PUT(1, 2)
+DECL_PUT(1, 3)
+
+DECL_PUT(2, 1)
+DECL_PUT(2, 2)
+DECL_PUT(2, 3)
+
+DECL_PUT(3, 1)
+DECL_PUT(3, 2)
+DECL_PUT(3, 3)
+
+void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x, int y);
+
+#define FN_ASSIGN(X, Y) \
+ dsp->put_vc1_mspel_pixels_tab[0][X+4*Y] = ff_put_vc1_mspel_mc##X##Y##_16_neon; \
+ dsp->put_vc1_mspel_pixels_tab[1][X+4*Y] = ff_put_vc1_mspel_mc##X##Y##_neon
+
+av_cold void ff_vc1dsp_init_neon(VC1DSPContext *dsp)
+{
+ dsp->vc1_inv_trans_8x8 = ff_vc1_inv_trans_8x8_neon;
+ dsp->vc1_inv_trans_4x8 = ff_vc1_inv_trans_4x8_neon;
+ dsp->vc1_inv_trans_8x4 = ff_vc1_inv_trans_8x4_neon;
+ dsp->vc1_inv_trans_4x4 = ff_vc1_inv_trans_4x4_neon;
+ dsp->vc1_inv_trans_8x8_dc = ff_vc1_inv_trans_8x8_dc_neon;
+ dsp->vc1_inv_trans_4x8_dc = ff_vc1_inv_trans_4x8_dc_neon;
+ dsp->vc1_inv_trans_8x4_dc = ff_vc1_inv_trans_8x4_dc_neon;
+ dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_neon;
+
+ dsp->put_vc1_mspel_pixels_tab[1][ 0] = ff_put_pixels8x8_neon;
+ FN_ASSIGN(1, 0);
+ FN_ASSIGN(2, 0);
+ FN_ASSIGN(3, 0);
+
+ FN_ASSIGN(0, 1);
+ FN_ASSIGN(1, 1);
+ FN_ASSIGN(2, 1);
+ FN_ASSIGN(3, 1);
+
+ FN_ASSIGN(0, 2);
+ FN_ASSIGN(1, 2);
+ FN_ASSIGN(2, 2);
+ FN_ASSIGN(3, 2);
+
+ FN_ASSIGN(0, 3);
+ FN_ASSIGN(1, 3);
+ FN_ASSIGN(2, 3);
+ FN_ASSIGN(3, 3);
+
+ dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_neon;
+ dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_neon;
+ dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = ff_put_vc1_chroma_mc4_neon;
+ dsp->avg_no_rnd_vc1_chroma_pixels_tab[1] = ff_avg_vc1_chroma_mc4_neon;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_neon.S
new file mode 100644
index 00000000000..3fba41fa66a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vc1dsp_neon.S
@@ -0,0 +1,1170 @@
+/*
+ * VC1 NEON optimisations
+ *
+ * Copyright (c) 2010 Rob Clark <rob@ti.com>
+ * Copyright (c) 2011 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 "libavutil/arm/asm.S"
+#include "neon.S"
+
+@ Transpose rows into columns of a matrix of 16-bit elements. For 4x4, pass
+@ double-word registers, for 8x4, pass quad-word registers.
+.macro transpose16 r0, r1, r2, r3
+ @ At this point:
+ @ row[0] r0
+ @ row[1] r1
+ @ row[2] r2
+ @ row[3] r3
+
+ vtrn.16 \r0, \r1 @ first and second row
+ vtrn.16 \r2, \r3 @ third and fourth row
+ vtrn.32 \r0, \r2 @ first and third row
+ vtrn.32 \r1, \r3 @ second and fourth row
+
+ @ At this point, if registers are quad-word:
+ @ column[0] d0
+ @ column[1] d2
+ @ column[2] d4
+ @ column[3] d6
+ @ column[4] d1
+ @ column[5] d3
+ @ column[6] d5
+ @ column[7] d7
+
+ @ At this point, if registers are double-word:
+ @ column[0] d0
+ @ column[1] d1
+ @ column[2] d2
+ @ column[3] d3
+.endm
+
+@ ff_vc1_inv_trans_{4,8}x{4,8}_neon and overflow: The input values in the file
+@ are supposed to be in a specific range as to allow for 16-bit math without
+@ causing overflows, but sometimes the input values are just big enough to
+@ barely cause overflow in vadd instructions like:
+@
+@ vadd.i16 q0, q8, q10
+@ vshr.s16 q0, q0, #\rshift
+@
+@ To prevent these borderline cases from overflowing, we just need one more
+@ bit of precision, which is accomplished by replacing the sequence above with:
+@
+@ vhadd.s16 q0, q8, q10
+@ vshr.s16 q0, q0, #(\rshift -1)
+@
+@ This works because vhadd is a single instruction that adds, then shifts to
+@ the right once, all before writing the result to the destination register.
+@
+@ Even with this workaround, there were still some files that caused overflows
+@ in ff_vc1_inv_trans_8x8_neon. See the comments in ff_vc1_inv_trans_8x8_neon
+@ for the additional workaround.
+
+@ Takes 4 columns of 8 values each and operates on it. Modeled after the first
+@ for loop in vc1_inv_trans_4x8_c.
+@ Input columns: q0 q1 q2 q3
+@ Output columns: q0 q1 q2 q3
+@ Trashes: r12 q8 q9 q10 q11 q12 q13
+.macro vc1_inv_trans_4x8_helper add rshift
+ @ Compute temp1, temp2 and setup scalar #17, #22, #10
+ vadd.i16 q12, q0, q2 @ temp1 = src[0] + src[2]
+ movw r12, #17
+ vsub.i16 q13, q0, q2 @ temp2 = src[0] - src[2]
+ movt r12, #22
+ vmov.32 d0[0], r12
+ movw r12, #10
+ vmov.16 d1[0], r12
+
+ vmov.i16 q8, #\add @ t1 will accumulate here
+ vmov.i16 q9, #\add @ t2 will accumulate here
+
+ vmul.i16 q10, q1, d0[1] @ t3 = 22 * (src[1])
+ vmul.i16 q11, q3, d0[1] @ t4 = 22 * (src[3])
+
+ vmla.i16 q8, q12, d0[0] @ t1 = 17 * (temp1) + 4
+ vmla.i16 q9, q13, d0[0] @ t2 = 17 * (temp2) + 4
+
+ vmla.i16 q10, q3, d1[0] @ t3 += 10 * src[3]
+ vmls.i16 q11, q1, d1[0] @ t4 -= 10 * src[1]
+
+ vhadd.s16 q0, q8, q10 @ dst[0] = (t1 + t3) >> 1
+ vhsub.s16 q3, q8, q10 @ dst[3] = (t1 - t3) >> 1
+ vhsub.s16 q1, q9, q11 @ dst[1] = (t2 - t4) >> 1
+ vhadd.s16 q2, q9, q11 @ dst[2] = (t2 + t4) >> 1
+
+ @ Halving add/sub above already did one shift
+ vshr.s16 q0, q0, #(\rshift - 1) @ dst[0] >>= (rshift - 1)
+ vshr.s16 q3, q3, #(\rshift - 1) @ dst[3] >>= (rshift - 1)
+ vshr.s16 q1, q1, #(\rshift - 1) @ dst[1] >>= (rshift - 1)
+ vshr.s16 q2, q2, #(\rshift - 1) @ dst[2] >>= (rshift - 1)
+.endm
+
+@ Takes 8 columns of 4 values each and operates on it. Modeled after the second
+@ for loop in vc1_inv_trans_4x8_c.
+@ Input columns: d0 d2 d4 d6 d1 d3 d5 d7
+@ Output columns: d16 d17 d18 d19 d21 d20 d23 d22
+@ Trashes all NEON registers (and r12) except for: q4 q5 q6 q7
+.macro vc1_inv_trans_8x4_helper add add1beforeshift rshift
+ @ At this point:
+ @ src[0] d0 overwritten later
+ @ src[8] d2
+ @ src[16] d4 overwritten later
+ @ src[24] d6
+ @ src[32] d1 overwritten later
+ @ src[40] d3
+ @ src[48] d5 overwritten later
+ @ src[56] d7
+
+ movw r12, #12
+ vmov.i16 q14, #\add @ t1|t2 will accumulate here
+ movt r12, #6
+
+ vadd.i16 d20, d0, d1 @ temp1 = src[0] + src[32]
+ vsub.i16 d21, d0, d1 @ temp2 = src[0] - src[32]
+ vmov.i32 d0[0], r12 @ 16-bit: d0[0] = #12, d0[1] = #6
+
+ vshl.i16 q15, q2, #4 @ t3|t4 = 16 * (src[16]|src[48])
+ vswp d4, d5 @ q2 = src[48]|src[16]
+ vmla.i16 q14, q10, d0[0] @ t1|t2 = 12 * (temp1|temp2) + 64
+ movw r12, #15
+ movt r12, #9
+ vmov.i32 d0[1], r12 @ 16-bit: d0[2] = #15, d0[3] = #9
+ vneg.s16 d31, d31 @ t4 = -t4
+ vmla.i16 q15, q2, d0[1] @ t3|t4 += 6 * (src[48]|src[16])
+
+ @ At this point:
+ @ d0[2] #15
+ @ d0[3] #9
+ @ q1 src[8]|src[40]
+ @ q3 src[24]|src[56]
+ @ q14 old t1|t2
+ @ q15 old t3|t4
+
+ vshl.i16 q8, q1, #4 @ t1|t2 = 16 * (src[8]|src[40])
+ vswp d2, d3 @ q1 = src[40]|src[8]
+ vshl.i16 q12, q3, #4 @ temp3a|temp4a = 16 * src[24]|src[56]
+ vswp d6, d7 @ q3 = src[56]|src[24]
+ vshl.i16 q13, q1, #2 @ temp3b|temp4b = 4 * (src[40]|src[8])
+ vshl.i16 q2, q3, #2 @ temp1|temp2 = 4 * (src[56]|src[24])
+ vswp d3, d6 @ q1 = src[40]|src[56], q3 = src[8]|src[24]
+ vsub.i16 q9, q13, q12 @ t3|t4 = - (temp3a|temp4a) + (temp3b|temp4b)
+ vadd.i16 q8, q8, q2 @ t1|t2 += temp1|temp2
+ vmul.i16 q12, q3, d0[3] @ temp3|temp4 = 9 * src[8]|src[24]
+ vmla.i16 q8, q1, d0[3] @ t1|t2 += 9 * (src[40]|src[56])
+ vswp d6, d7 @ q3 = src[24]|src[8]
+ vswp d2, d3 @ q1 = src[56]|src[40]
+
+ vsub.i16 q11, q14, q15 @ t8|t7 = old t1|t2 - old t3|t4
+ vadd.i16 q10, q14, q15 @ t5|t6 = old t1|t2 + old t3|t4
+ .if \add1beforeshift
+ vmov.i16 q15, #1
+ .endif
+
+ vadd.i16 d18, d18, d24 @ t3 += temp3
+ vsub.i16 d19, d19, d25 @ t4 -= temp4
+
+ vswp d22, d23 @ q11 = t7|t8
+
+ vneg.s16 d17, d17 @ t2 = -t2
+ vmla.i16 q9, q1, d0[2] @ t3|t4 += 15 * src[56]|src[40]
+ vmla.i16 q8, q3, d0[2] @ t1|t2 += 15 * src[24]|src[8]
+
+ @ At this point:
+ @ t1 d16
+ @ t2 d17
+ @ t3 d18
+ @ t4 d19
+ @ t5 d20
+ @ t6 d21
+ @ t7 d22
+ @ t8 d23
+ @ #1 q15
+
+ .if \add1beforeshift
+ vadd.i16 q3, q15, q10 @ line[7,6] = t5|t6 + 1
+ vadd.i16 q2, q15, q11 @ line[5,4] = t7|t8 + 1
+ .endif
+
+ @ Sometimes this overflows, so to get one additional bit of precision, use
+ @ a single instruction that both adds and shifts right (halving).
+ vhadd.s16 q1, q9, q11 @ line[2,3] = (t3|t4 + t7|t8) >> 1
+ vhadd.s16 q0, q8, q10 @ line[0,1] = (t1|t2 + t5|t6) >> 1
+ .if \add1beforeshift
+ vhsub.s16 q2, q2, q9 @ line[5,4] = (t7|t8 - t3|t4 + 1) >> 1
+ vhsub.s16 q3, q3, q8 @ line[7,6] = (t5|t6 - t1|t2 + 1) >> 1
+ .else
+ vhsub.s16 q2, q11, q9 @ line[5,4] = (t7|t8 - t3|t4) >> 1
+ vhsub.s16 q3, q10, q8 @ line[7,6] = (t5|t6 - t1|t2) >> 1
+ .endif
+
+ vshr.s16 q9, q1, #(\rshift - 1) @ one shift is already done by vhadd/vhsub above
+ vshr.s16 q8, q0, #(\rshift - 1)
+ vshr.s16 q10, q2, #(\rshift - 1)
+ vshr.s16 q11, q3, #(\rshift - 1)
+
+ @ At this point:
+ @ dst[0] d16
+ @ dst[1] d17
+ @ dst[2] d18
+ @ dst[3] d19
+ @ dst[4] d21
+ @ dst[5] d20
+ @ dst[6] d23
+ @ dst[7] d22
+.endm
+
+@ This is modeled after the first and second for loop in vc1_inv_trans_8x8_c.
+@ Input columns: q8, q9, q10, q11, q12, q13, q14, q15
+@ Output columns: q8, q9, q10, q11, q12, q13, q14, q15
+@ Trashes all NEON registers (and r12) except for: q4 q5 q6 q7
+.macro vc1_inv_trans_8x8_helper add add1beforeshift rshift
+ @ This actually computes half of t1, t2, t3, t4, as explained below
+ @ near `tNhalf`.
+ vmov.i16 q0, #(6 / 2) @ q0 = #6/2
+ vshl.i16 q1, q10, #3 @ t3 = 16/2 * src[16]
+ vshl.i16 q3, q14, #3 @ temp4 = 16/2 * src[48]
+ vmul.i16 q2, q10, q0 @ t4 = 6/2 * src[16]
+ vmla.i16 q1, q14, q0 @ t3 += 6/2 * src[48]
+ @ unused: q0, q10, q14
+ vmov.i16 q0, #(12 / 2) @ q0 = #12/2
+ vadd.i16 q10, q8, q12 @ temp1 = src[0] + src[32]
+ vsub.i16 q14, q8, q12 @ temp2 = src[0] - src[32]
+ @ unused: q8, q12
+ vmov.i16 q8, #(\add / 2) @ t1 will accumulate here
+ vmov.i16 q12, #(\add / 2) @ t2 will accumulate here
+ movw r12, #15
+ vsub.i16 q2, q2, q3 @ t4 = 6/2 * src[16] - 16/2 * src[48]
+ movt r12, #9
+ @ unused: q3
+ vmla.i16 q8, q10, q0 @ t1 = 12/2 * temp1 + add
+ vmla.i16 q12, q14, q0 @ t2 = 12/2 * temp2 + add
+ vmov.i32 d0[0], r12
+ @ unused: q3, q10, q14
+
+ @ At this point:
+ @ q0 d0=#15|#9
+ @ q1 old t3
+ @ q2 old t4
+ @ q3
+ @ q8 old t1
+ @ q9 src[8]
+ @ q10
+ @ q11 src[24]
+ @ q12 old t2
+ @ q13 src[40]
+ @ q14
+ @ q15 src[56]
+
+ @ unused: q3, q10, q14
+ movw r12, #16
+ vshl.i16 q3, q9, #4 @ t1 = 16 * src[8]
+ movt r12, #4
+ vshl.i16 q10, q9, #2 @ t4 = 4 * src[8]
+ vmov.i32 d1[0], r12
+ vmul.i16 q14, q9, d0[0] @ t2 = 15 * src[8]
+ vmul.i16 q9, q9, d0[1] @ t3 = 9 * src[8]
+ @ unused: none
+ vmla.i16 q3, q11, d0[0] @ t1 += 15 * src[24]
+ vmls.i16 q10, q11, d0[1] @ t4 -= 9 * src[24]
+ vmls.i16 q14, q11, d1[1] @ t2 -= 4 * src[24]
+ vmls.i16 q9, q11, d1[0] @ t3 -= 16 * src[24]
+ @ unused: q11
+ vmla.i16 q3, q13, d0[1] @ t1 += 9 * src[40]
+ vmla.i16 q10, q13, d0[0] @ t4 += 15 * src[40]
+ vmls.i16 q14, q13, d1[0] @ t2 -= 16 * src[40]
+ vmla.i16 q9, q13, d1[1] @ t3 += 4 * src[40]
+ @ unused: q11, q13
+
+ @ Compute t5, t6, t7, t8 from old t1, t2, t3, t4. Actually, it computes
+ @ half of t5, t6, t7, t8 since t1, t2, t3, t4 are halved.
+ vadd.i16 q11, q8, q1 @ t5 = t1 + t3
+ vsub.i16 q1, q8, q1 @ t8 = t1 - t3
+ vadd.i16 q13, q12, q2 @ t6 = t2 + t4
+ vsub.i16 q2, q12, q2 @ t7 = t2 - t4
+ @ unused: q8, q12
+
+ .if \add1beforeshift
+ vmov.i16 q12, #1
+ .endif
+
+ @ unused: q8
+ vmla.i16 q3, q15, d1[1] @ t1 += 4 * src[56]
+ vmls.i16 q14, q15, d0[1] @ t2 -= 9 * src[56]
+ vmla.i16 q9, q15, d0[0] @ t3 += 15 * src[56]
+ vmls.i16 q10, q15, d1[0] @ t4 -= 16 * src[56]
+ @ unused: q0, q8, q15
+
+ @ At this point:
+ @ t1 q3
+ @ t2 q14
+ @ t3 q9
+ @ t4 q10
+ @ t5half q11
+ @ t6half q13
+ @ t7half q2
+ @ t8half q1
+ @ #1 q12
+ @
+ @ tNhalf is half of the value of tN (as described in vc1_inv_trans_8x8_c).
+ @ This is done because sometimes files have input that causes tN + tM to
+ @ overflow. To avoid this overflow, we compute tNhalf, then compute
+ @ tNhalf + tM (which doesn't overflow), and then we use vhadd to compute
+ @ (tNhalf + (tNhalf + tM)) >> 1 which does not overflow because it is
+ @ one instruction.
+
+ @ For each pair of tN and tM, do:
+ @ lineA = t5half + t1
+ @ if add1beforeshift: t1 -= 1
+ @ lineA = (t5half + lineA) >> 1
+ @ lineB = t5half - t1
+ @ lineB = (t5half + lineB) >> 1
+ @ lineA >>= rshift - 1
+ @ lineB >>= rshift - 1
+
+ vadd.i16 q8, q11, q3 @ q8 = t5half + t1
+ .if \add1beforeshift
+ vsub.i16 q3, q3, q12 @ q3 = t1 - 1
+ .endif
+
+ vadd.i16 q0, q13, q14 @ q0 = t6half + t2
+ .if \add1beforeshift
+ vsub.i16 q14, q14, q12 @ q14 = t2 - 1
+ .endif
+
+ vadd.i16 q15, q2, q9 @ q15 = t7half + t3
+ .if \add1beforeshift
+ vsub.i16 q9, q9, q12 @ q9 = t3 - 1
+ .endif
+ @ unused: none
+
+ vhadd.s16 q8, q11, q8 @ q8 = (t5half + t5half + t1) >> 1
+ vsub.i16 q3, q11, q3 @ q3 = t5half - t1 + 1
+
+ vhadd.s16 q0, q13, q0 @ q0 = (t6half + t6half + t2) >> 1
+ vsub.i16 q14, q13, q14 @ q14 = t6half - t2 + 1
+
+ vhadd.s16 q15, q2, q15 @ q15 = (t7half + t7half + t3) >> 1
+ vsub.i16 q9, q2, q9 @ q9 = t7half - t3 + 1
+
+ vhadd.s16 q3, q11, q3 @ q3 = (t5half + t5half - t1 + 1) >> 1
+ @ unused: q11
+
+ vadd.i16 q11, q1, q10 @ q11 = t8half + t4
+ .if \add1beforeshift
+ vsub.i16 q10, q10, q12 @ q10 = t4 - 1
+ .endif
+ @ unused: q12
+
+ vhadd.s16 q14, q13, q14 @ q14 = (t6half + t6half - t2 + 1) >> 1
+ @ unused: q12, q13
+ vhadd.s16 q13, q2, q9 @ q9 = (t7half + t7half - t3 + 1) >> 1
+ @ unused: q12, q2, q9
+
+ vsub.i16 q10, q1, q10 @ q10 = t8half - t4 + 1
+ vhadd.s16 q11, q1, q11 @ q11 = (t8half + t8half + t4) >> 1
+
+ vshr.s16 q8, q8, #(\rshift - 1) @ q8 = line[0]
+ vhadd.s16 q12, q1, q10 @ q12 = (t8half + t8half - t4 + 1) >> 1
+ vshr.s16 q9, q0, #(\rshift - 1) @ q9 = line[1]
+ vshr.s16 q10, q15, #(\rshift - 1) @ q10 = line[2]
+ vshr.s16 q11, q11, #(\rshift - 1) @ q11 = line[3]
+ vshr.s16 q12, q12, #(\rshift - 1) @ q12 = line[4]
+ vshr.s16 q13, q13, #(\rshift - 1) @ q13 = line[5]
+ vshr.s16 q14, q14, #(\rshift - 1) @ q14 = line[6]
+ vshr.s16 q15, q3, #(\rshift - 1) @ q15 = line[7]
+.endm
+
+@ (int16_t *block [r0])
+function ff_vc1_inv_trans_8x8_neon, export=1
+ vld1.64 {q8-q9}, [r0,:128]!
+ vld1.64 {q10-q11}, [r0,:128]!
+ vld1.64 {q12-q13}, [r0,:128]!
+ vld1.64 {q14-q15}, [r0,:128]
+ sub r0, r0, #(16 * 2 * 3) @ restore r0
+
+ @ At this point:
+ @ src[0] q8
+ @ src[8] q9
+ @ src[16] q10
+ @ src[24] q11
+ @ src[32] q12
+ @ src[40] q13
+ @ src[48] q14
+ @ src[56] q15
+
+ vc1_inv_trans_8x8_helper add=4 add1beforeshift=0 rshift=3
+
+ @ Transpose result matrix of 8x8
+ swap4 d17, d19, d21, d23, d24, d26, d28, d30
+ transpose16_4x4 q8, q9, q10, q11, q12, q13, q14, q15
+
+ vc1_inv_trans_8x8_helper add=64 add1beforeshift=1 rshift=7
+
+ vst1.64 {q8-q9}, [r0,:128]!
+ vst1.64 {q10-q11}, [r0,:128]!
+ vst1.64 {q12-q13}, [r0,:128]!
+ vst1.64 {q14-q15}, [r0,:128]
+
+ bx lr
+endfunc
+
+@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2])
+function ff_vc1_inv_trans_8x4_neon, export=1
+ vld1.64 {q0-q1}, [r2,:128]! @ load 8 * 4 * 2 = 64 bytes / 16 bytes per quad = 4 quad registers
+ vld1.64 {q2-q3}, [r2,:128]
+
+ transpose16 q0 q1 q2 q3 @ transpose rows to columns
+
+ @ At this point:
+ @ src[0] d0
+ @ src[1] d2
+ @ src[2] d4
+ @ src[3] d6
+ @ src[4] d1
+ @ src[5] d3
+ @ src[6] d5
+ @ src[7] d7
+
+ vc1_inv_trans_8x4_helper add=4 add1beforeshift=0 rshift=3
+
+ @ Move output to more standardized registers
+ vmov d0, d16
+ vmov d2, d17
+ vmov d4, d18
+ vmov d6, d19
+ vmov d1, d21
+ vmov d3, d20
+ vmov d5, d23
+ vmov d7, d22
+
+ @ At this point:
+ @ dst[0] d0
+ @ dst[1] d2
+ @ dst[2] d4
+ @ dst[3] d6
+ @ dst[4] d1
+ @ dst[5] d3
+ @ dst[6] d5
+ @ dst[7] d7
+
+ transpose16 q0 q1 q2 q3 @ turn columns into rows
+
+ @ At this point:
+ @ row[0] q0
+ @ row[1] q1
+ @ row[2] q2
+ @ row[3] q3
+
+ vc1_inv_trans_4x8_helper add=64 rshift=7
+
+ @ At this point:
+ @ line[0].l d0
+ @ line[0].h d1
+ @ line[1].l d2
+ @ line[1].h d3
+ @ line[2].l d4
+ @ line[2].h d5
+ @ line[3].l d6
+ @ line[3].h d7
+
+ @ unused registers: q12, q13, q14, q15
+
+ vld1.64 {d28}, [r0,:64], r1 @ read dest
+ vld1.64 {d29}, [r0,:64], r1
+ vld1.64 {d30}, [r0,:64], r1
+ vld1.64 {d31}, [r0,:64], r1
+ sub r0, r0, r1, lsl #2 @ restore original r0 value
+
+ vaddw.u8 q0, q0, d28 @ line[0] += dest[0]
+ vaddw.u8 q1, q1, d29 @ line[1] += dest[1]
+ vaddw.u8 q2, q2, d30 @ line[2] += dest[2]
+ vaddw.u8 q3, q3, d31 @ line[3] += dest[3]
+
+ vqmovun.s16 d0, q0 @ line[0]
+ vqmovun.s16 d1, q1 @ line[1]
+ vqmovun.s16 d2, q2 @ line[2]
+ vqmovun.s16 d3, q3 @ line[3]
+
+ vst1.64 {d0}, [r0,:64], r1 @ write dest
+ vst1.64 {d1}, [r0,:64], r1
+ vst1.64 {d2}, [r0,:64], r1
+ vst1.64 {d3}, [r0,:64]
+
+ bx lr
+endfunc
+
+@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2])
+function ff_vc1_inv_trans_4x8_neon, export=1
+ mov r12, #(8 * 2) @ 8 elements per line, each element 2 bytes
+ vld4.16 {d0[], d2[], d4[], d6[]}, [r2,:64], r12 @ read each column into a q register
+ vld4.16 {d0[1], d2[1], d4[1], d6[1]}, [r2,:64], r12
+ vld4.16 {d0[2], d2[2], d4[2], d6[2]}, [r2,:64], r12
+ vld4.16 {d0[3], d2[3], d4[3], d6[3]}, [r2,:64], r12
+ vld4.16 {d1[], d3[], d5[], d7[]}, [r2,:64], r12
+ vld4.16 {d1[1], d3[1], d5[1], d7[1]}, [r2,:64], r12
+ vld4.16 {d1[2], d3[2], d5[2], d7[2]}, [r2,:64], r12
+ vld4.16 {d1[3], d3[3], d5[3], d7[3]}, [r2,:64]
+
+ vc1_inv_trans_4x8_helper add=4 rshift=3
+
+ @ At this point:
+ @ dst[0] = q0
+ @ dst[1] = q1
+ @ dst[2] = q2
+ @ dst[3] = q3
+
+ transpose16 q0 q1 q2 q3 @ Transpose rows (registers) into columns
+
+ vc1_inv_trans_8x4_helper add=64 add1beforeshift=1 rshift=7
+
+ vld1.32 {d28[]}, [r0,:32], r1 @ read dest
+ vld1.32 {d28[1]}, [r0,:32], r1
+ vld1.32 {d29[]}, [r0,:32], r1
+ vld1.32 {d29[1]}, [r0,:32], r1
+
+ vld1.32 {d30[]}, [r0,:32], r1
+ vld1.32 {d30[0]}, [r0,:32], r1
+ vld1.32 {d31[]}, [r0,:32], r1
+ vld1.32 {d31[0]}, [r0,:32], r1
+ sub r0, r0, r1, lsl #3 @ restore original r0 value
+
+ vaddw.u8 q8, q8, d28 @ line[0,1] += dest[0,1]
+ vaddw.u8 q9, q9, d29 @ line[2,3] += dest[2,3]
+ vaddw.u8 q10, q10, d30 @ line[5,4] += dest[5,4]
+ vaddw.u8 q11, q11, d31 @ line[7,6] += dest[7,6]
+
+ vqmovun.s16 d16, q8 @ clip(line[0,1])
+ vqmovun.s16 d18, q9 @ clip(line[2,3])
+ vqmovun.s16 d20, q10 @ clip(line[5,4])
+ vqmovun.s16 d22, q11 @ clip(line[7,6])
+
+ vst1.32 {d16[0]}, [r0,:32], r1 @ write dest
+ vst1.32 {d16[1]}, [r0,:32], r1
+ vst1.32 {d18[0]}, [r0,:32], r1
+ vst1.32 {d18[1]}, [r0,:32], r1
+
+ vst1.32 {d20[1]}, [r0,:32], r1
+ vst1.32 {d20[0]}, [r0,:32], r1
+ vst1.32 {d22[1]}, [r0,:32], r1
+ vst1.32 {d22[0]}, [r0,:32]
+
+ bx lr
+endfunc
+
+@ Setup constants in registers which are used by vc1_inv_trans_4x4_helper
+.macro vc1_inv_trans_4x4_helper_setup
+ vmov.i16 q13, #17
+ vmov.i16 q14, #22
+ vmov.i16 d30, #10 @ only need double-word, not quad-word
+.endm
+
+@ This is modeled after the first for loop in vc1_inv_trans_4x4_c.
+.macro vc1_inv_trans_4x4_helper add rshift
+ vmov.i16 q2, #\add @ t1|t2 will accumulate here
+
+ vadd.i16 d16, d0, d1 @ temp1 = src[0] + src[2]
+ vsub.i16 d17, d0, d1 @ temp2 = src[0] - src[2]
+ vmul.i16 q3, q14, q1 @ t3|t4 = 22 * (src[1]|src[3])
+ vmla.i16 q2, q13, q8 @ t1|t2 = 17 * (temp1|temp2) + add
+ vmla.i16 d6, d30, d3 @ t3 += 10 * src[3]
+ vmls.i16 d7, d30, d2 @ t4 -= 10 * src[1]
+
+ vadd.i16 q0, q2, q3 @ dst[0,2] = (t1|t2 + t3|t4)
+ vsub.i16 q1, q2, q3 @ dst[3,1] = (t1|t2 - t3|t4)
+ vshr.s16 q0, q0, #\rshift @ dst[0,2] >>= rshift
+ vshr.s16 q1, q1, #\rshift @ dst[3,1] >>= rshift
+.endm
+
+@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2])
+function ff_vc1_inv_trans_4x4_neon, export=1
+ mov r12, #(8 * 2) @ 8 elements per line, each element 2 bytes
+ vld4.16 {d0[], d1[], d2[], d3[]}, [r2,:64], r12 @ read each column into a register
+ vld4.16 {d0[1], d1[1], d2[1], d3[1]}, [r2,:64], r12
+ vld4.16 {d0[2], d1[2], d2[2], d3[2]}, [r2,:64], r12
+ vld4.16 {d0[3], d1[3], d2[3], d3[3]}, [r2,:64]
+
+ vswp d1, d2 @ so that we can later access column 1 and column 3 as a single q1 register
+
+ vc1_inv_trans_4x4_helper_setup
+
+ @ At this point:
+ @ src[0] = d0
+ @ src[1] = d2
+ @ src[2] = d1
+ @ src[3] = d3
+
+ vc1_inv_trans_4x4_helper add=4 rshift=3 @ compute t1, t2, t3, t4 and combine them into dst[0-3]
+
+ @ At this point:
+ @ dst[0] = d0
+ @ dst[1] = d3
+ @ dst[2] = d1
+ @ dst[3] = d2
+
+ transpose16 d0 d3 d1 d2 @ Transpose rows (registers) into columns
+
+ @ At this point:
+ @ src[0] = d0
+ @ src[8] = d3
+ @ src[16] = d1
+ @ src[24] = d2
+
+ vswp d2, d3 @ so that we can later access column 1 and column 3 in order as a single q1 register
+
+ @ At this point:
+ @ src[0] = d0
+ @ src[8] = d2
+ @ src[16] = d1
+ @ src[24] = d3
+
+ vc1_inv_trans_4x4_helper add=64 rshift=7 @ compute t1, t2, t3, t4 and combine them into dst[0-3]
+
+ @ At this point:
+ @ line[0] = d0
+ @ line[1] = d3
+ @ line[2] = d1
+ @ line[3] = d2
+
+ vld1.32 {d18[]}, [r0,:32], r1 @ read dest
+ vld1.32 {d19[]}, [r0,:32], r1
+ vld1.32 {d18[1]}, [r0,:32], r1
+ vld1.32 {d19[0]}, [r0,:32], r1
+ sub r0, r0, r1, lsl #2 @ restore original r0 value
+
+ vaddw.u8 q0, q0, d18 @ line[0,2] += dest[0,2]
+ vaddw.u8 q1, q1, d19 @ line[3,1] += dest[3,1]
+
+ vqmovun.s16 d0, q0 @ clip(line[0,2])
+ vqmovun.s16 d1, q1 @ clip(line[3,1])
+
+ vst1.32 {d0[0]}, [r0,:32], r1 @ write dest
+ vst1.32 {d1[1]}, [r0,:32], r1
+ vst1.32 {d0[1]}, [r0,:32], r1
+ vst1.32 {d1[0]}, [r0,:32]
+
+ bx lr
+endfunc
+
+@ The absolute value of multiplication constants from vc1_mspel_filter and vc1_mspel_{ver,hor}_filter_16bits.
+@ The sign is embedded in the code below that carries out the multiplication (mspel_filter{,.16}).
+#define MSPEL_MODE_1_MUL_CONSTANTS 4 53 18 3
+#define MSPEL_MODE_2_MUL_CONSTANTS 1 9 9 1
+#define MSPEL_MODE_3_MUL_CONSTANTS 3 18 53 4
+
+@ These constants are from reading the source code of vc1_mspel_mc and determining the value that
+@ is added to `rnd` to result in the variable `r`, and the value of the variable `shift`.
+#define MSPEL_MODES_11_ADDSHIFT_CONSTANTS 15 5
+#define MSPEL_MODES_12_ADDSHIFT_CONSTANTS 3 3
+#define MSPEL_MODES_13_ADDSHIFT_CONSTANTS 15 5
+#define MSPEL_MODES_21_ADDSHIFT_CONSTANTS MSPEL_MODES_12_ADDSHIFT_CONSTANTS
+#define MSPEL_MODES_22_ADDSHIFT_CONSTANTS 0 1
+#define MSPEL_MODES_23_ADDSHIFT_CONSTANTS 3 3
+#define MSPEL_MODES_31_ADDSHIFT_CONSTANTS MSPEL_MODES_13_ADDSHIFT_CONSTANTS
+#define MSPEL_MODES_32_ADDSHIFT_CONSTANTS MSPEL_MODES_23_ADDSHIFT_CONSTANTS
+#define MSPEL_MODES_33_ADDSHIFT_CONSTANTS 15 5
+
+@ The addition and shift constants from vc1_mspel_filter.
+#define MSPEL_MODE_1_ADDSHIFT_CONSTANTS 32 6
+#define MSPEL_MODE_2_ADDSHIFT_CONSTANTS 8 4
+#define MSPEL_MODE_3_ADDSHIFT_CONSTANTS 32 6
+
+@ Setup constants in registers for a subsequent use of mspel_filter{,.16}.
+.macro mspel_constants typesize reg_a reg_b reg_c reg_d filter_a filter_b filter_c filter_d reg_add filter_add_register
+ @ Define double-word register aliases. Typesize should be i8 or i16.
+ ra .dn \reg_a\().\typesize
+ rb .dn \reg_b\().\typesize
+ rc .dn \reg_c\().\typesize
+ rd .dn \reg_d\().\typesize
+
+ @ Only set the register if the value is not 1 and unique
+ .if \filter_a != 1
+ vmov ra, #\filter_a @ ra = filter_a
+ .endif
+ vmov rb, #\filter_b @ rb = filter_b
+ .if \filter_b != \filter_c
+ vmov rc, #\filter_c @ rc = filter_c
+ .endif
+ .if \filter_d != 1
+ vmov rd, #\filter_d @ rd = filter_d
+ .endif
+ @ vdup to double the size of typesize
+ .ifc \typesize,i8
+ vdup.16 \reg_add, \filter_add_register @ reg_add = filter_add_register
+ .else
+ vdup.32 \reg_add, \filter_add_register @ reg_add = filter_add_register
+ .endif
+
+ .unreq ra
+ .unreq rb
+ .unreq rc
+ .unreq rd
+.endm
+
+@ After mspel_constants has been used, do the filtering.
+.macro mspel_filter acc dest src0 src1 src2 src3 filter_a filter_b filter_c filter_d reg_a reg_b reg_c reg_d reg_add filter_shift narrow=1
+ .if \filter_a != 1
+ @ If filter_a != 1, then we need a move and subtract instruction
+ vmov \acc, \reg_add @ acc = reg_add
+ vmlsl.u8 \acc, \reg_a, \src0 @ acc -= filter_a * src[-stride]
+ .else
+ @ If filter_a is 1, then just subtract without an extra move
+ vsubw.u8 \acc, \reg_add, \src0 @ acc = reg_add - src[-stride] @ since filter_a == 1
+ .endif
+ vmlal.u8 \acc, \reg_b, \src1 @ acc += filter_b * src[0]
+ .if \filter_b != \filter_c
+ vmlal.u8 \acc, \reg_c, \src2 @ acc += filter_c * src[stride]
+ .else
+ @ If filter_b is the same as filter_c, use the same reg_b register
+ vmlal.u8 \acc, \reg_b, \src2 @ acc += filter_c * src[stride] @ where filter_c == filter_b
+ .endif
+ .if \filter_d != 1
+ @ If filter_d != 1, then do a multiply accumulate
+ vmlsl.u8 \acc, \reg_d, \src3 @ acc -= filter_d * src[stride * 2]
+ .else
+ @ If filter_d is 1, then just do a subtract
+ vsubw.u8 \acc, \acc, \src3 @ acc -= src[stride * 2] @ since filter_d == 1
+ .endif
+ .if \narrow
+ vqshrun.s16 \dest, \acc, #\filter_shift @ dest = clip_uint8(acc >> filter_shift)
+ .else
+ vshr.s16 \dest, \acc, #\filter_shift @ dest = acc >> filter_shift
+ .endif
+.endm
+
+@ This is similar to mspel_filter, but the input is 16-bit instead of 8-bit and narrow=0 is not supported.
+.macro mspel_filter.16 acc0 acc1 acc0_0 acc0_1 dest src0 src1 src2 src3 src4 src5 src6 src7 filter_a filter_b filter_c filter_d reg_a reg_b reg_c reg_d reg_add filter_shift
+ .if \filter_a != 1
+ vmov \acc0, \reg_add
+ vmov \acc1, \reg_add
+ vmlsl.s16 \acc0, \reg_a, \src0
+ vmlsl.s16 \acc1, \reg_a, \src1
+ .else
+ vsubw.s16 \acc0, \reg_add, \src0
+ vsubw.s16 \acc1, \reg_add, \src1
+ .endif
+ vmlal.s16 \acc0, \reg_b, \src2
+ vmlal.s16 \acc1, \reg_b, \src3
+ .if \filter_b != \filter_c
+ vmlal.s16 \acc0, \reg_c, \src4
+ vmlal.s16 \acc1, \reg_c, \src5
+ .else
+ vmlal.s16 \acc0, \reg_b, \src4
+ vmlal.s16 \acc1, \reg_b, \src5
+ .endif
+ .if \filter_d != 1
+ vmlsl.s16 \acc0, \reg_d, \src6
+ vmlsl.s16 \acc1, \reg_d, \src7
+ .else
+ vsubw.s16 \acc0, \acc0, \src6
+ vsubw.s16 \acc1, \acc1, \src7
+ .endif
+ @ Use acc0_0 and acc0_1 as temp space
+ vqshrun.s32 \acc0_0, \acc0, #\filter_shift @ Shift and narrow with saturation from s32 to u16
+ vqshrun.s32 \acc0_1, \acc1, #\filter_shift
+ vqmovn.u16 \dest, \acc0 @ Narrow with saturation from u16 to u8
+.endm
+
+@ Register usage for put_vc1_mspel_mc functions. Registers marked 'hv' are only used in put_vc1_mspel_mc_hv.
+@
+@ r0 adjusted dst
+@ r1 adjusted src
+@ r2 stride
+@ r3 adjusted rnd
+@ r4 [hv] tmp
+@ r11 [hv] sp saved
+@ r12 loop counter
+@ d0 src[-stride]
+@ d1 src[0]
+@ d2 src[stride]
+@ d3 src[stride * 2]
+@ q0 [hv] src[-stride]
+@ q1 [hv] src[0]
+@ q2 [hv] src[stride]
+@ q3 [hv] src[stride * 2]
+@ d21 often result from mspel_filter
+@ q11 accumulator 0
+@ q12 [hv] accumulator 1
+@ q13 accumulator initial value
+@ d28 filter_a
+@ d29 filter_b
+@ d30 filter_c
+@ d31 filter_d
+
+@ (uint8_t *dst [r0], const uint8_t *src [r1], ptrdiff_t stride [r2], int rnd [r3])
+.macro put_vc1_mspel_mc_hv hmode vmode filter_h_a filter_h_b filter_h_c filter_h_d filter_v_a filter_v_b filter_v_c filter_v_d filter_add filter_shift
+function ff_put_vc1_mspel_mc\hmode\()\vmode\()_neon, export=1
+ push {r4, r11, lr}
+ mov r11, sp @ r11 = stack pointer before realignmnet
+A bic sp, sp, #15 @ sp = round down to multiple of 16 bytes
+T bic r4, r11, #15
+T mov sp, r4
+ sub sp, sp, #(8*2*16) @ make space for 8 rows * 2 byte per element * 16 elements per row (to fit 11 actual elements per row)
+ mov r4, sp @ r4 = int16_t tmp[8 * 16]
+
+ sub r1, r1, #1 @ src -= 1
+ .if \filter_add != 0
+ add r3, r3, #\filter_add @ r3 = filter_add + rnd
+ .endif
+ mov r12, #8 @ loop counter
+ sub r1, r1, r2 @ r1 = &src[-stride] @ slide back
+
+ @ Do vertical filtering from src into tmp
+ mspel_constants i8 d28 d29 d30 d31 \filter_v_a \filter_v_b \filter_v_c \filter_v_d q13 r3
+
+ vld1.64 {d0,d1}, [r1], r2
+ vld1.64 {d2,d3}, [r1], r2
+ vld1.64 {d4,d5}, [r1], r2
+
+1:
+ subs r12, r12, #4
+
+ vld1.64 {d6,d7}, [r1], r2
+ mspel_filter q11 q11 d0 d2 d4 d6 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
+ mspel_filter q12 q12 d1 d3 d5 d7 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
+ vst1.64 {q11,q12}, [r4,:128]! @ store and increment
+
+ vld1.64 {d0,d1}, [r1], r2
+ mspel_filter q11 q11 d2 d4 d6 d0 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
+ mspel_filter q12 q12 d3 d5 d7 d1 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
+ vst1.64 {q11,q12}, [r4,:128]! @ store and increment
+
+ vld1.64 {d2,d3}, [r1], r2
+ mspel_filter q11 q11 d4 d6 d0 d2 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
+ mspel_filter q12 q12 d5 d7 d1 d3 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
+ vst1.64 {q11,q12}, [r4,:128]! @ store and increment
+
+ vld1.64 {d4,d5}, [r1], r2
+ mspel_filter q11 q11 d6 d0 d2 d4 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
+ mspel_filter q12 q12 d7 d1 d3 d5 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
+ vst1.64 {q11,q12}, [r4,:128]! @ store and increment
+
+ bne 1b
+
+ rsb r3, r3, #(64 + \filter_add) @ r3 = (64 + filter_add) - r3
+ mov r12, #8 @ loop counter
+ mov r4, sp @ r4 = tmp
+
+ @ Do horizontal filtering from temp to dst
+ mspel_constants i16 d28 d29 d30 d31 \filter_h_a \filter_h_b \filter_h_c \filter_h_d q13 r3
+
+2:
+ subs r12, r12, #1
+
+ vld1.64 {q0,q1}, [r4,:128]! @ read one line of tmp
+ vext.16 q2, q0, q1, #2
+ vext.16 q3, q0, q1, #3
+ vext.16 q1, q0, q1, #1 @ do last because it writes to q1 which is read by the other vext instructions
+
+ mspel_filter.16 q11 q12 d22 d23 d21 d0 d1 d2 d3 d4 d5 d6 d7 \filter_h_a \filter_h_b \filter_h_c \filter_h_d d28 d29 d30 d31 q13 7
+
+ vst1.64 {d21}, [r0,:64], r2 @ store and increment dst
+
+ bne 2b
+
+ mov sp, r11
+ pop {r4, r11, pc}
+endfunc
+.endm
+
+@ Use C preprocessor and assembler macros to expand to functions for horizontal and vertical filtering.
+#define PUT_VC1_MSPEL_MC_HV(hmode, vmode) \
+ put_vc1_mspel_mc_hv hmode vmode \
+ MSPEL_MODE_ ## hmode ## _MUL_CONSTANTS \
+ MSPEL_MODE_ ## vmode ## _MUL_CONSTANTS \
+ MSPEL_MODES_ ## hmode ## vmode ## _ADDSHIFT_CONSTANTS
+
+PUT_VC1_MSPEL_MC_HV(1, 1)
+PUT_VC1_MSPEL_MC_HV(1, 2)
+PUT_VC1_MSPEL_MC_HV(1, 3)
+PUT_VC1_MSPEL_MC_HV(2, 1)
+PUT_VC1_MSPEL_MC_HV(2, 2)
+PUT_VC1_MSPEL_MC_HV(2, 3)
+PUT_VC1_MSPEL_MC_HV(3, 1)
+PUT_VC1_MSPEL_MC_HV(3, 2)
+PUT_VC1_MSPEL_MC_HV(3, 3)
+
+#undef PUT_VC1_MSPEL_MC_HV
+
+.macro put_vc1_mspel_mc_h_only hmode filter_a filter_b filter_c filter_d filter_add filter_shift
+function ff_put_vc1_mspel_mc\hmode\()0_neon, export=1
+ rsb r3, r3, #\filter_add @ r3 = filter_add - r = filter_add - rnd
+ mov r12, #8 @ loop counter
+ sub r1, r1, #1 @ slide back, using immediate
+
+ mspel_constants i8 d28 d29 d30 d31 \filter_a \filter_b \filter_c \filter_d q13 r3
+
+1:
+ subs r12, r12, #1
+
+ vld1.64 {d0,d1}, [r1], r2 @ read 16 bytes even though we only need 11, also src += stride
+ vext.8 d2, d0, d1, #2
+ vext.8 d3, d0, d1, #3
+ vext.8 d1, d0, d1, #1 @ do last because it writes to d1 which is read by the other vext instructions
+
+ mspel_filter q11 d21 d0 d1 d2 d3 \filter_a \filter_b \filter_c \filter_d d28 d29 d30 d31 q13 \filter_shift
+
+ vst1.64 {d21}, [r0,:64], r2 @ store and increment dst
+
+ bne 1b
+
+ bx lr
+endfunc
+.endm
+
+@ Use C preprocessor and assembler macros to expand to functions for horizontal only filtering.
+#define PUT_VC1_MSPEL_MC_H_ONLY(hmode) \
+ put_vc1_mspel_mc_h_only hmode MSPEL_MODE_ ## hmode ## _MUL_CONSTANTS MSPEL_MODE_ ## hmode ## _ADDSHIFT_CONSTANTS
+
+PUT_VC1_MSPEL_MC_H_ONLY(1)
+PUT_VC1_MSPEL_MC_H_ONLY(2)
+PUT_VC1_MSPEL_MC_H_ONLY(3)
+
+#undef PUT_VC1_MSPEL_MC_H_ONLY
+
+@ (uint8_t *dst [r0], const uint8_t *src [r1], ptrdiff_t stride [r2], int rnd [r3])
+.macro put_vc1_mspel_mc_v_only vmode filter_a filter_b filter_c filter_d filter_add filter_shift
+function ff_put_vc1_mspel_mc0\vmode\()_neon, export=1
+ add r3, r3, #\filter_add - 1 @ r3 = filter_add - r = filter_add - (1 - rnd) = filter_add - 1 + rnd
+ mov r12, #8 @ loop counter
+ sub r1, r1, r2 @ r1 = &src[-stride] @ slide back
+
+ mspel_constants i8 d28 d29 d30 d31 \filter_a \filter_b \filter_c \filter_d q13 r3
+
+ vld1.64 {d0}, [r1], r2 @ d0 = src[-stride]
+ vld1.64 {d1}, [r1], r2 @ d1 = src[0]
+ vld1.64 {d2}, [r1], r2 @ d2 = src[stride]
+
+1:
+ subs r12, r12, #4
+
+ vld1.64 {d3}, [r1], r2 @ d3 = src[stride * 2]
+ mspel_filter q11 d21 d0 d1 d2 d3 \filter_a \filter_b \filter_c \filter_d d28 d29 d30 d31 q13 \filter_shift
+ vst1.64 {d21}, [r0,:64], r2 @ store and increment dst
+
+ vld1.64 {d0}, [r1], r2 @ d0 = next line
+ mspel_filter q11 d21 d1 d2 d3 d0 \filter_a \filter_b \filter_c \filter_d d28 d29 d30 d31 q13 \filter_shift
+ vst1.64 {d21}, [r0,:64], r2 @ store and increment dst
+
+ vld1.64 {d1}, [r1], r2 @ d1 = next line
+ mspel_filter q11 d21 d2 d3 d0 d1 \filter_a \filter_b \filter_c \filter_d d28 d29 d30 d31 q13 \filter_shift
+ vst1.64 {d21}, [r0,:64], r2 @ store and increment dst
+
+ vld1.64 {d2}, [r1], r2 @ d2 = next line
+ mspel_filter q11 d21 d3 d0 d1 d2 \filter_a \filter_b \filter_c \filter_d d28 d29 d30 d31 q13 \filter_shift
+ vst1.64 {d21}, [r0,:64], r2 @ store and increment dst
+
+ bne 1b
+
+ bx lr
+endfunc
+.endm
+
+@ Use C preprocessor and assembler macros to expand to functions for vertical only filtering.
+#define PUT_VC1_MSPEL_MC_V_ONLY(vmode) \
+ put_vc1_mspel_mc_v_only vmode MSPEL_MODE_ ## vmode ## _MUL_CONSTANTS MSPEL_MODE_ ## vmode ## _ADDSHIFT_CONSTANTS
+
+PUT_VC1_MSPEL_MC_V_ONLY(1)
+PUT_VC1_MSPEL_MC_V_ONLY(2)
+PUT_VC1_MSPEL_MC_V_ONLY(3)
+
+#undef PUT_VC1_MSPEL_MC_V_ONLY
+
+function ff_put_pixels8x8_neon, export=1
+ vld1.64 {d0}, [r1], r2
+ vld1.64 {d1}, [r1], r2
+ vld1.64 {d2}, [r1], r2
+ vld1.64 {d3}, [r1], r2
+ vld1.64 {d4}, [r1], r2
+ vld1.64 {d5}, [r1], r2
+ vld1.64 {d6}, [r1], r2
+ vld1.64 {d7}, [r1]
+ vst1.64 {d0}, [r0,:64], r2
+ vst1.64 {d1}, [r0,:64], r2
+ vst1.64 {d2}, [r0,:64], r2
+ vst1.64 {d3}, [r0,:64], r2
+ vst1.64 {d4}, [r0,:64], r2
+ vst1.64 {d5}, [r0,:64], r2
+ vst1.64 {d6}, [r0,:64], r2
+ vst1.64 {d7}, [r0,:64]
+ bx lr
+endfunc
+
+function ff_vc1_inv_trans_8x8_dc_neon, export=1
+ ldrsh r2, [r2] @ int dc = block[0];
+
+ vld1.64 {d0}, [r0,:64], r1
+ vld1.64 {d1}, [r0,:64], r1
+ vld1.64 {d4}, [r0,:64], r1
+ vld1.64 {d5}, [r0,:64], r1
+
+ add r2, r2, r2, lsl #1 @ dc = (3 * dc + 1) >> 1;
+ vld1.64 {d6}, [r0,:64], r1
+ add r2, r2, #1
+ vld1.64 {d7}, [r0,:64], r1
+ vld1.64 {d16}, [r0,:64], r1
+ vld1.64 {d17}, [r0,:64], r1
+ asr r2, r2, #1
+
+ sub r0, r0, r1, lsl #3 @ restore r0 to original value
+
+ add r2, r2, r2, lsl #1 @ dc = (3 * dc + 16) >> 5;
+ add r2, r2, #16
+ asr r2, r2, #5
+
+ vdup.16 q1, r2 @ dc
+
+ vaddw.u8 q9, q1, d0
+ vaddw.u8 q10, q1, d1
+ vaddw.u8 q11, q1, d4
+ vaddw.u8 q12, q1, d5
+ vqmovun.s16 d0, q9
+ vqmovun.s16 d1, q10
+ vqmovun.s16 d4, q11
+ vst1.64 {d0}, [r0,:64], r1
+ vqmovun.s16 d5, q12
+ vst1.64 {d1}, [r0,:64], r1
+ vaddw.u8 q13, q1, d6
+ vst1.64 {d4}, [r0,:64], r1
+ vaddw.u8 q14, q1, d7
+ vst1.64 {d5}, [r0,:64], r1
+ vaddw.u8 q15, q1, d16
+ vaddw.u8 q1, q1, d17 @ this destroys q1
+ vqmovun.s16 d6, q13
+ vqmovun.s16 d7, q14
+ vqmovun.s16 d16, q15
+ vqmovun.s16 d17, q1
+ vst1.64 {d6}, [r0,:64], r1
+ vst1.64 {d7}, [r0,:64], r1
+ vst1.64 {d16}, [r0,:64], r1
+ vst1.64 {d17}, [r0,:64]
+ bx lr
+endfunc
+
+function ff_vc1_inv_trans_8x4_dc_neon, export=1
+ ldrsh r2, [r2] @ int dc = block[0];
+
+ vld1.64 {d0}, [r0,:64], r1
+ vld1.64 {d1}, [r0,:64], r1
+ vld1.64 {d4}, [r0,:64], r1
+ vld1.64 {d5}, [r0,:64], r1
+
+ add r2, r2, r2, lsl #1 @ dc = ( 3 * dc + 1) >> 1;
+
+ sub r0, r0, r1, lsl #2 @ restore r0 to original value
+
+ add r2, r2, #1
+ asr r2, r2, #1
+
+ add r2, r2, r2, lsl #4 @ dc = (17 * dc + 64) >> 7;
+ add r2, r2, #64
+ asr r2, r2, #7
+
+ vdup.16 q1, r2 @ dc
+
+ vaddw.u8 q3, q1, d0
+ vaddw.u8 q8, q1, d1
+ vaddw.u8 q9, q1, d4
+ vaddw.u8 q10, q1, d5
+ vqmovun.s16 d0, q3
+ vqmovun.s16 d1, q8
+ vqmovun.s16 d4, q9
+ vst1.64 {d0}, [r0,:64], r1
+ vqmovun.s16 d5, q10
+ vst1.64 {d1}, [r0,:64], r1
+ vst1.64 {d4}, [r0,:64], r1
+ vst1.64 {d5}, [r0,:64]
+ bx lr
+endfunc
+
+function ff_vc1_inv_trans_4x8_dc_neon, export=1
+ ldrsh r2, [r2] @ int dc = block[0];
+
+ vld1.32 {d0[]}, [r0,:32], r1
+ vld1.32 {d1[]}, [r0,:32], r1
+ vld1.32 {d0[1]}, [r0,:32], r1
+ vld1.32 {d1[1]}, [r0,:32], r1
+
+ add r2, r2, r2, lsl #4 @ dc = (17 * dc + 4) >> 3;
+ vld1.32 {d4[]}, [r0,:32], r1
+ add r2, r2, #4
+ vld1.32 {d5[]}, [r0,:32], r1
+ vld1.32 {d4[1]}, [r0,:32], r1
+ asr r2, r2, #3
+ vld1.32 {d5[1]}, [r0,:32], r1
+
+ add r2, r2, r2, lsl #1 @ dc = (12 * dc + 64) >> 7;
+
+ sub r0, r0, r1, lsl #3 @ restore r0 to original value
+
+ lsl r2, r2, #2
+ add r2, r2, #64
+ asr r2, r2, #7
+
+ vdup.16 q1, r2 @ dc
+
+ vaddw.u8 q3, q1, d0
+ vaddw.u8 q8, q1, d1
+ vaddw.u8 q9, q1, d4
+ vaddw.u8 q10, q1, d5
+ vqmovun.s16 d0, q3
+ vst1.32 {d0[0]}, [r0,:32], r1
+ vqmovun.s16 d1, q8
+ vst1.32 {d1[0]}, [r0,:32], r1
+ vqmovun.s16 d4, q9
+ vst1.32 {d0[1]}, [r0,:32], r1
+ vqmovun.s16 d5, q10
+ vst1.32 {d1[1]}, [r0,:32], r1
+ vst1.32 {d4[0]}, [r0,:32], r1
+ vst1.32 {d5[0]}, [r0,:32], r1
+ vst1.32 {d4[1]}, [r0,:32], r1
+ vst1.32 {d5[1]}, [r0,:32]
+ bx lr
+endfunc
+
+function ff_vc1_inv_trans_4x4_dc_neon, export=1
+ ldrsh r2, [r2] @ int dc = block[0];
+
+ vld1.32 {d0[]}, [r0,:32], r1
+ vld1.32 {d1[]}, [r0,:32], r1
+ vld1.32 {d0[1]}, [r0,:32], r1
+ vld1.32 {d1[1]}, [r0,:32], r1
+
+ add r2, r2, r2, lsl #4 @ dc = (17 * dc + 4) >> 3;
+
+ sub r0, r0, r1, lsl #2 @ restore r0 to original value
+
+ add r2, r2, #4
+ asr r2, r2, #3
+
+ add r2, r2, r2, lsl #4 @ dc = (17 * dc + 64) >> 7;
+ add r2, r2, #64
+ asr r2, r2, #7
+
+ vdup.16 q1, r2 @ dc
+
+ vaddw.u8 q2, q1, d0
+ vaddw.u8 q3, q1, d1
+ vqmovun.s16 d0, q2
+ vst1.32 {d0[0]}, [r0,:32], r1
+ vqmovun.s16 d1, q3
+ vst1.32 {d1[0]}, [r0,:32], r1
+ vst1.32 {d0[1]}, [r0,:32], r1
+ vst1.32 {d1[1]}, [r0,:32]
+ bx lr
+endfunc
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/videodsp_armv5te.S b/chromium/third_party/ffmpeg/libavcodec/arm/videodsp_armv5te.S
index 48a6c3ba83b..55bcce5cb65 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/videodsp_armv5te.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/videodsp_armv5te.S
@@ -1,5 +1,5 @@
@
-@ ARMv5te optimized DSP utils
+@ ARMv5te-optimized core video DSP functions
@ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp>
@
@ This file is part of FFmpeg
@@ -26,6 +26,6 @@ function ff_prefetch_arm, export=1
subs r2, r2, #1
pld [r0]
add r0, r0, r1
- bne ff_prefetch_arm
+ bne X(ff_prefetch_arm)
bx lr
endfunc
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vp3dsp_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/vp3dsp_init_arm.c
index 5af795bc29a..d9246365dfe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/vp3dsp_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vp3dsp_init_arm.c
@@ -21,12 +21,11 @@
#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/arm/cpu.h"
-#include "libavcodec/dsputil.h"
#include "libavcodec/vp3dsp.h"
void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
-void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const int16_t *data);
+void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);
void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vp3dsp_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/vp3dsp_neon.S
index f133905efec..2942d488f54 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/vp3dsp_neon.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vp3dsp_neon.S
@@ -355,7 +355,7 @@ function ff_vp3_idct_dc_add_neon, export=1
mov r3, r0
add r12, r12, #15
vdup.16 q15, r12
- mov r12, 0
+ mov r12, #0
strh r12, [r2]
vshr.s16 q15, q15, #5
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vp8.h b/chromium/third_party/ffmpeg/libavcodec/arm/vp8.h
index ddaa1203fd4..965342d93bd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/vp8.h
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vp8.h
@@ -26,7 +26,7 @@
#include "libavcodec/vp8.h"
#if HAVE_ARMV6_EXTERNAL
-#define decode_block_coeffs_internal ff_decode_block_coeffs_armv6
+#define vp8_decode_block_coeffs_internal ff_decode_block_coeffs_armv6
int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, int16_t block[16],
uint8_t probs[8][3][NUM_DCT_TOKENS-1],
int i, uint8_t *token_prob, int16_t qmul[2]);
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp.h b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp.h
index 6041ef13d12..7281d0bfb13 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp.h
@@ -21,6 +21,8 @@
#include "libavcodec/vp8dsp.h"
+void ff_vp78dsp_init_armv6(VP8DSPContext *dsp);
+void ff_vp78dsp_init_neon(VP8DSPContext *dsp);
void ff_vp8dsp_init_armv6(VP8DSPContext *dsp);
void ff_vp8dsp_init_neon(VP8DSPContext *dsp);
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_armv6.S b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_armv6.S
index a14b188b21a..1adcbbdbb10 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_armv6.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_armv6.S
@@ -359,14 +359,14 @@ endfunc
function ff_vp8_idct_dc_add4uv_armv6, export=1
push {r4, lr}
- bl ff_vp8_idct_dc_add_armv6
+ bl X(ff_vp8_idct_dc_add_armv6)
add r0, r0, #4
- bl ff_vp8_idct_dc_add_armv6
+ bl X(ff_vp8_idct_dc_add_armv6)
add r0, r0, r2, lsl #2
sub r0, r0, #4
- bl ff_vp8_idct_dc_add_armv6
+ bl X(ff_vp8_idct_dc_add_armv6)
add r0, r0, #4
- bl ff_vp8_idct_dc_add_armv6
+ bl X(ff_vp8_idct_dc_add_armv6)
pop {r4, pc}
endfunc
@@ -375,13 +375,13 @@ endfunc
function ff_vp8_idct_dc_add4y_armv6, export=1
push {r4, lr}
- bl ff_vp8_idct_dc_add_armv6
+ bl X(ff_vp8_idct_dc_add_armv6)
add r0, r0, #4
- bl ff_vp8_idct_dc_add_armv6
+ bl X(ff_vp8_idct_dc_add_armv6)
add r0, r0, #4
- bl ff_vp8_idct_dc_add_armv6
+ bl X(ff_vp8_idct_dc_add_armv6)
add r0, r0, #4
- bl ff_vp8_idct_dc_add_armv6
+ bl X(ff_vp8_idct_dc_add_armv6)
pop {r4, pc}
endfunc
@@ -1204,7 +1204,7 @@ function ff_put_vp8_\name\size\()_\hv\()_armv6, export=1
mov r4, #\size
stm r12, {r4, r5}
orr r12, r6, r7
- b vp8_put_\name\()_\hv\()_armv6 + 4
+ b bl_put_\name\()_\hv\()_armv6
endfunc
.endm
@@ -1300,6 +1300,7 @@ vp8_mc_hv bilin, 4, h, v, 2
function vp8_put_epel_h6_armv6
push {r1, r4-r11, lr}
+bl_put_epel_h6_armv6:
sub r2, r2, #2
movrel lr, sixtap_filters_13245600 - 16
add lr, lr, r12, lsl #3
@@ -1358,6 +1359,7 @@ endfunc
function vp8_put_epel_v6_armv6
push {r1, r4-r11, lr}
+bl_put_epel_v6_armv6:
movrel lr, sixtap_filters_13245600 - 16
add lr, lr, r12, lsl #3
str r3, [sp, #48]
@@ -1437,6 +1439,7 @@ endfunc
function vp8_put_epel_h4_armv6
push {r1, r4-r11, lr}
+bl_put_epel_h4_armv6:
subs r2, r2, #1
movrel lr, fourtap_filters_1324 - 4
add lr, lr, r12, lsl #2
@@ -1483,6 +1486,7 @@ endfunc
function vp8_put_epel_v4_armv6
push {r1, r4-r11, lr}
+bl_put_epel_v4_armv6:
movrel lr, fourtap_filters_1324 - 4
add lr, lr, r12, lsl #2
ldm lr, {r5, r6}
@@ -1544,6 +1548,7 @@ endfunc
function vp8_put_bilin_h_armv6
push {r1, r4-r11, lr}
+bl_put_bilin_h_armv6:
rsb r5, r12, r12, lsl #16
ldr r12, [sp, #44]
sub r3, r3, r4
@@ -1589,6 +1594,7 @@ endfunc
function vp8_put_bilin_v_armv6
push {r1, r4-r11, lr}
+bl_put_bilin_v_armv6:
rsb r5, r12, r12, lsl #16
ldr r12, [sp, #44]
add r5, r5, #8
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_arm.c
index d360ae3e6dc..8b801766d7a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_arm.c
@@ -23,6 +23,16 @@
#include "libavcodec/vp8dsp.h"
#include "vp8dsp.h"
+av_cold void ff_vp78dsp_init_arm(VP8DSPContext *dsp)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_armv6(cpu_flags))
+ ff_vp78dsp_init_armv6(dsp);
+ if (have_neon(cpu_flags))
+ ff_vp78dsp_init_neon(dsp);
+}
+
av_cold void ff_vp8dsp_init_arm(VP8DSPContext *dsp)
{
int cpu_flags = av_get_cpu_flags();
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_armv6.c b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_armv6.c
index 563268e862a..a5bcd733e0f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_armv6.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_armv6.c
@@ -40,29 +40,8 @@ VP8_BILIN(16, armv6);
VP8_BILIN(8, armv6);
VP8_BILIN(4, armv6);
-av_cold void ff_vp8dsp_init_armv6(VP8DSPContext *dsp)
+av_cold void ff_vp78dsp_init_armv6(VP8DSPContext *dsp)
{
- dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_armv6;
- dsp->vp8_luma_dc_wht_dc = ff_vp8_luma_dc_wht_dc_armv6;
-
- dsp->vp8_idct_add = ff_vp8_idct_add_armv6;
- dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_armv6;
- dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_armv6;
- dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_armv6;
-
- dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_armv6;
- dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_armv6;
- dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_armv6;
- dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_armv6;
-
- dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_armv6;
- dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_armv6;
- dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_armv6;
- dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_armv6;
-
- dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_armv6;
- dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_armv6;
-
dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_armv6;
dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_armv6;
dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_armv6;
@@ -118,3 +97,27 @@ av_cold void ff_vp8dsp_init_armv6(VP8DSPContext *dsp)
dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_armv6;
dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_armv6;
}
+
+av_cold void ff_vp8dsp_init_armv6(VP8DSPContext *dsp)
+{
+ dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_armv6;
+ dsp->vp8_luma_dc_wht_dc = ff_vp8_luma_dc_wht_dc_armv6;
+
+ dsp->vp8_idct_add = ff_vp8_idct_add_armv6;
+ dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_armv6;
+ dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_armv6;
+ dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_armv6;
+
+ dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_armv6;
+ dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_armv6;
+ dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_armv6;
+ dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_armv6;
+
+ dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_armv6;
+ dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_armv6;
+ dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_armv6;
+ dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_armv6;
+
+ dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_armv6;
+ dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_armv6;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_neon.c b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_neon.c
index ae045a63f24..53f1f233801 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_neon.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_init_neon.c
@@ -39,28 +39,8 @@ VP8_BILIN(16, neon);
VP8_BILIN(8, neon);
VP8_BILIN(4, neon);
-av_cold void ff_vp8dsp_init_neon(VP8DSPContext *dsp)
+av_cold void ff_vp78dsp_init_neon(VP8DSPContext *dsp)
{
- dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_neon;
-
- dsp->vp8_idct_add = ff_vp8_idct_add_neon;
- dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_neon;
- dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_neon;
- dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_neon;
-
- dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_neon;
- dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_neon;
- dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_neon;
- dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_neon;
-
- dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_neon;
- dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_neon;
- dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_neon;
- dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_neon;
-
- dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_neon;
- dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_neon;
-
dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_neon;
dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_neon;
dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_neon;
@@ -114,3 +94,26 @@ av_cold void ff_vp8dsp_init_neon(VP8DSPContext *dsp)
dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_neon;
dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_neon;
}
+
+av_cold void ff_vp8dsp_init_neon(VP8DSPContext *dsp)
+{
+ dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_neon;
+
+ dsp->vp8_idct_add = ff_vp8_idct_add_neon;
+ dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_neon;
+ dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_neon;
+ dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_neon;
+
+ dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_neon;
+ dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_neon;
+ dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_neon;
+ dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_neon;
+
+ dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_neon;
+ dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_neon;
+ dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_neon;
+ dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_neon;
+
+ dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_neon;
+ dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_neon;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_neon.S b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_neon.S
index 436b340330b..5319346951b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_neon.S
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/vp8dsp_neon.S
@@ -1576,12 +1576,11 @@ endconst
/* Bilinear MC */
function ff_put_vp8_bilin16_h_neon, export=1
- push {lr}
- ldr lr, [sp, #8] @ mx
- rsb r12, lr, #8
- vdup.8 d0, lr
+ ldr r12, [sp, #4] @ mx
+ vdup.8 d0, r12
+ rsb r12, r12, #8
vdup.8 d1, r12
- ldr r12, [sp, #4] @ h
+ ldr r12, [sp] @ h
1:
subs r12, r12, #2
vld1.8 {d2-d4}, [r2], r3
@@ -1604,16 +1603,15 @@ function ff_put_vp8_bilin16_h_neon, export=1
vst1.8 {q3}, [r0,:128], r1
bgt 1b
- pop {pc}
+ bx lr
endfunc
function ff_put_vp8_bilin16_v_neon, export=1
- push {lr}
- ldr lr, [sp, #12] @ my
- rsb r12, lr, #8
- vdup.8 d0, lr
+ ldr r12, [sp, #8] @ my
+ vdup.8 d0, r12
+ rsb r12, r12, #8
vdup.8 d1, r12
- ldr r12, [sp, #4] @ h
+ ldr r12, [sp] @ h
vld1.8 {q1}, [r2], r3
1:
subs r12, r12, #2
@@ -1635,20 +1633,19 @@ function ff_put_vp8_bilin16_v_neon, export=1
vst1.8 {q3}, [r0,:128], r1
bgt 1b
- pop {pc}
+ bx lr
endfunc
function ff_put_vp8_bilin16_hv_neon, export=1
- push {lr}
- ldr lr, [sp, #8] @ mx
- rsb r12, lr, #8
- vdup.8 d0, lr
+ ldr r12, [sp, #4] @ mx
+ vdup.8 d0, r12
+ rsb r12, r12, #8
vdup.8 d1, r12
- ldr lr, [sp, #12] @ my
- rsb r12, lr, #8
- vdup.8 d2, lr
+ ldr r12, [sp, #8] @ my
+ vdup.8 d2, r12
+ rsb r12, r12, #8
vdup.8 d3, r12
- ldr r12, [sp, #4] @ h
+ ldr r12, [sp] @ h
vld1.8 {d4-d6}, [r2], r3
vext.8 q3, q2, q3, #1
@@ -1692,16 +1689,15 @@ function ff_put_vp8_bilin16_hv_neon, export=1
vst1.8 {q10}, [r0,:128], r1
bgt 1b
- pop {pc}
+ bx lr
endfunc
function ff_put_vp8_bilin8_h_neon, export=1
- push {lr}
- ldr lr, [sp, #8] @ mx
- rsb r12, lr, #8
- vdup.8 d0, lr
+ ldr r12, [sp, #4] @ mx
+ vdup.8 d0, r12
+ rsb r12, r12, #8
vdup.8 d1, r12
- ldr r12, [sp, #4] @ h
+ ldr r12, [sp] @ h
1:
subs r12, r12, #2
vld1.8 {q1}, [r2], r3
@@ -1718,16 +1714,15 @@ function ff_put_vp8_bilin8_h_neon, export=1
vst1.8 {d16}, [r0,:64], r1
bgt 1b
- pop {pc}
+ bx lr
endfunc
function ff_put_vp8_bilin8_v_neon, export=1
- push {lr}
- ldr lr, [sp, #12] @ my
- rsb r12, lr, #8
- vdup.8 d0, lr
+ ldr r12, [sp, #8] @ my
+ vdup.8 d0, r12
+ rsb r12, r12, #8
vdup.8 d1, r12
- ldr r12, [sp, #4] @ h
+ ldr r12, [sp] @ h
vld1.8 {d2}, [r2], r3
1:
subs r12, r12, #2
@@ -1743,20 +1738,19 @@ function ff_put_vp8_bilin8_v_neon, export=1
vst1.8 {d6}, [r0,:64], r1
bgt 1b
- pop {pc}
+ bx lr
endfunc
function ff_put_vp8_bilin8_hv_neon, export=1
- push {lr}
- ldr lr, [sp, #8] @ mx
- rsb r12, lr, #8
- vdup.8 d0, lr
+ ldr r12, [sp, #4] @ mx
+ vdup.8 d0, r12
+ rsb r12, r12, #8
vdup.8 d1, r12
- ldr lr, [sp, #12] @ my
- rsb r12, lr, #8
- vdup.8 d2, lr
+ ldr r12, [sp, #8] @ my
+ vdup.8 d2, r12
+ rsb r12, r12, #8
vdup.8 d3, r12
- ldr r12, [sp, #4] @ h
+ ldr r12, [sp] @ h
vld1.8 {q2}, [r2], r3
vext.8 d5, d4, d5, #1
@@ -1785,16 +1779,15 @@ function ff_put_vp8_bilin8_hv_neon, export=1
vst1.8 {d23}, [r0,:64], r1
bgt 1b
- pop {pc}
+ bx lr
endfunc
function ff_put_vp8_bilin4_h_neon, export=1
- push {lr}
- ldr lr, [sp, #8] @ mx
- rsb r12, lr, #8
- vdup.8 d0, lr
+ ldr r12, [sp, #4] @ mx
+ vdup.8 d0, r12
+ rsb r12, r12, #8
vdup.8 d1, r12
- ldr r12, [sp, #4] @ h
+ ldr r12, [sp] @ h
1:
subs r12, r12, #2
vld1.8 {d2}, [r2], r3
@@ -1809,16 +1802,15 @@ function ff_put_vp8_bilin4_h_neon, export=1
vst1.32 {d4[1]}, [r0,:32], r1
bgt 1b
- pop {pc}
+ bx lr
endfunc
function ff_put_vp8_bilin4_v_neon, export=1
- push {lr}
- ldr lr, [sp, #12] @ my
- rsb r12, lr, #8
- vdup.8 d0, lr
+ ldr r12, [sp, #8] @ my
+ vdup.8 d0, r12
+ rsb r12, r12, #8
vdup.8 d1, r12
- ldr r12, [sp, #4] @ h
+ ldr r12, [sp] @ h
vld1.32 {d2[]}, [r2], r3
1:
vld1.32 {d3[]}, [r2]
@@ -1833,20 +1825,19 @@ function ff_put_vp8_bilin4_v_neon, export=1
subs r12, r12, #2
bgt 1b
- pop {pc}
+ bx lr
endfunc
function ff_put_vp8_bilin4_hv_neon, export=1
- push {lr}
- ldr lr, [sp, #8] @ mx
- rsb r12, lr, #8
- vdup.8 d0, lr
+ ldr r12, [sp, #4] @ mx
+ vdup.8 d0, r12
+ rsb r12, r12, #8
vdup.8 d1, r12
- ldr lr, [sp, #12] @ my
- rsb r12, lr, #8
- vdup.8 d2, lr
+ ldr r12, [sp, #8] @ my
+ vdup.8 d2, r12
+ rsb r12, r12, #8
vdup.8 d3, r12
- ldr r12, [sp, #4] @ h
+ ldr r12, [sp] @ h
vld1.8 {d4}, [r2], r3
vext.8 d5, d4, d4, #1
@@ -1872,5 +1863,5 @@ function ff_put_vp8_bilin4_hv_neon, export=1
vst1.32 {d20[1]}, [r0,:32], r1
bgt 1b
- pop {pc}
+ bx lr
endfunc
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac1data.h b/chromium/third_party/ffmpeg/libavcodec/atrac1data.h
index 08f835747a7..62c218b7906 100644
--- a/chromium/third_party/ffmpeg/libavcodec/atrac1data.h
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac1data.h
@@ -43,7 +43,7 @@ static const uint8_t bfu_bands_t[4] = {0, 20, 36, 52};
*/
static const uint8_t specs_per_bfu[52] = {
8, 8, 8, 8, 4, 4, 4, 4, 8, 8, 8, 8, 6, 6, 6, 6, 6, 6, 6, 6, // low band
- 6, 6, 6, 6, 7, 7, 7, 7, 9, 9, 9, 9, 10, 10, 10, 10, // midle band
+ 6, 6, 6, 6, 7, 7, 7, 7, 9, 9, 9, 9, 10, 10, 10, 10, // middle band
12, 12, 12, 12, 12, 12, 12, 12, 20, 20, 20, 20, 20, 20, 20, 20 // high band
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac3plus.c b/chromium/third_party/ffmpeg/libavcodec/atrac3plus.c
new file mode 100644
index 00000000000..08c90cde98b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac3plus.c
@@ -0,0 +1,1818 @@
+/*
+ * ATRAC3+ compatible decoder
+ *
+ * Copyright (c) 2010-2013 Maxim Poliakovski
+ *
+ * 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
+ * Bitstream parser for ATRAC3+ decoder.
+ */
+
+#include "libavutil/avassert.h"
+#include "avcodec.h"
+#include "get_bits.h"
+#include "atrac3plus.h"
+#include "atrac3plus_data.h"
+
+static VLC_TYPE tables_data[154276][2];
+static VLC wl_vlc_tabs[4];
+static VLC sf_vlc_tabs[8];
+static VLC ct_vlc_tabs[4];
+static VLC spec_vlc_tabs[112];
+static VLC gain_vlc_tabs[11];
+static VLC tone_vlc_tabs[7];
+
+#define GET_DELTA(gb, delta_bits) \
+ ((delta_bits) ? get_bits((gb), (delta_bits)) : 0)
+
+/**
+ * Generate canonical VLC table from given descriptor.
+ *
+ * @param[in] cb ptr to codebook descriptor
+ * @param[in] xlat ptr to translation table or NULL
+ * @param[in,out] tab_offset starting offset to the generated vlc table
+ * @param[out] out_vlc ptr to vlc table to be generated
+ */
+static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t *xlat,
+ int *tab_offset, VLC *out_vlc)
+{
+ int i, b;
+ uint16_t codes[256];
+ uint8_t bits[256];
+ unsigned code = 0;
+ int index = 0;
+ int min_len = *cb++; // get shortest codeword length
+ int max_len = *cb++; // get longest codeword length
+
+ for (b = min_len; b <= max_len; b++) {
+ for (i = *cb++; i > 0; i--) {
+ av_assert0(index < 256);
+ bits[index] = b;
+ codes[index] = code++;
+ index++;
+ }
+ code <<= 1;
+ }
+
+ out_vlc->table = &tables_data[*tab_offset];
+ out_vlc->table_allocated = 1 << max_len;
+
+ ff_init_vlc_sparse(out_vlc, max_len, index, bits, 1, 1, codes, 2, 2,
+ xlat, 1, 1, INIT_VLC_USE_NEW_STATIC);
+
+ *tab_offset += 1 << max_len;
+}
+
+av_cold void ff_atrac3p_init_vlcs(void)
+{
+ int i, wl_vlc_offs, ct_vlc_offs, sf_vlc_offs, tab_offset;
+
+ static int wl_nb_bits[4] = { 2, 3, 5, 5 };
+ static int wl_nb_codes[4] = { 3, 5, 8, 8 };
+ static const uint8_t *wl_bits[4] = {
+ atrac3p_wl_huff_bits1, atrac3p_wl_huff_bits2,
+ atrac3p_wl_huff_bits3, atrac3p_wl_huff_bits4
+ };
+ static const uint8_t *wl_codes[4] = {
+ atrac3p_wl_huff_code1, atrac3p_wl_huff_code2,
+ atrac3p_wl_huff_code3, atrac3p_wl_huff_code4
+ };
+ static const uint8_t *wl_xlats[4] = {
+ atrac3p_wl_huff_xlat1, atrac3p_wl_huff_xlat2, NULL, NULL
+ };
+
+ static int ct_nb_bits[4] = { 3, 4, 4, 4 };
+ static int ct_nb_codes[4] = { 4, 8, 8, 8 };
+ static const uint8_t *ct_bits[4] = {
+ atrac3p_ct_huff_bits1, atrac3p_ct_huff_bits2,
+ atrac3p_ct_huff_bits2, atrac3p_ct_huff_bits3
+ };
+ static const uint8_t *ct_codes[4] = {
+ atrac3p_ct_huff_code1, atrac3p_ct_huff_code2,
+ atrac3p_ct_huff_code2, atrac3p_ct_huff_code3
+ };
+ static const uint8_t *ct_xlats[4] = {
+ NULL, NULL, atrac3p_ct_huff_xlat1, NULL
+ };
+
+ static int sf_nb_bits[8] = { 9, 9, 9, 9, 6, 6, 7, 7 };
+ static int sf_nb_codes[8] = { 64, 64, 64, 64, 16, 16, 16, 16 };
+ static const uint8_t *sf_bits[8] = {
+ atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits2,
+ atrac3p_sf_huff_bits3, atrac3p_sf_huff_bits4, atrac3p_sf_huff_bits4,
+ atrac3p_sf_huff_bits5, atrac3p_sf_huff_bits6
+ };
+ static const uint16_t *sf_codes[8] = {
+ atrac3p_sf_huff_code1, atrac3p_sf_huff_code1, atrac3p_sf_huff_code2,
+ atrac3p_sf_huff_code3, atrac3p_sf_huff_code4, atrac3p_sf_huff_code4,
+ atrac3p_sf_huff_code5, atrac3p_sf_huff_code6
+ };
+ static const uint8_t *sf_xlats[8] = {
+ atrac3p_sf_huff_xlat1, atrac3p_sf_huff_xlat2, NULL, NULL,
+ atrac3p_sf_huff_xlat4, atrac3p_sf_huff_xlat5, NULL, NULL
+ };
+
+ static const uint8_t *gain_cbs[11] = {
+ atrac3p_huff_gain_npoints1_cb, atrac3p_huff_gain_npoints1_cb,
+ atrac3p_huff_gain_lev1_cb, atrac3p_huff_gain_lev2_cb,
+ atrac3p_huff_gain_lev3_cb, atrac3p_huff_gain_lev4_cb,
+ atrac3p_huff_gain_loc3_cb, atrac3p_huff_gain_loc1_cb,
+ atrac3p_huff_gain_loc4_cb, atrac3p_huff_gain_loc2_cb,
+ atrac3p_huff_gain_loc5_cb
+ };
+ static const uint8_t *gain_xlats[11] = {
+ NULL, atrac3p_huff_gain_npoints2_xlat, atrac3p_huff_gain_lev1_xlat,
+ atrac3p_huff_gain_lev2_xlat, atrac3p_huff_gain_lev3_xlat,
+ atrac3p_huff_gain_lev4_xlat, atrac3p_huff_gain_loc3_xlat,
+ atrac3p_huff_gain_loc1_xlat, atrac3p_huff_gain_loc4_xlat,
+ atrac3p_huff_gain_loc2_xlat, atrac3p_huff_gain_loc5_xlat
+ };
+
+ static const uint8_t *tone_cbs[7] = {
+ atrac3p_huff_tonebands_cb, atrac3p_huff_numwavs1_cb,
+ atrac3p_huff_numwavs2_cb, atrac3p_huff_wav_ampsf1_cb,
+ atrac3p_huff_wav_ampsf2_cb, atrac3p_huff_wav_ampsf3_cb,
+ atrac3p_huff_freq_cb
+ };
+ static const uint8_t *tone_xlats[7] = {
+ NULL, NULL, atrac3p_huff_numwavs2_xlat, atrac3p_huff_wav_ampsf1_xlat,
+ atrac3p_huff_wav_ampsf2_xlat, atrac3p_huff_wav_ampsf3_xlat,
+ atrac3p_huff_freq_xlat
+ };
+
+ for (i = 0, wl_vlc_offs = 0, ct_vlc_offs = 2508; i < 4; i++) {
+ wl_vlc_tabs[i].table = &tables_data[wl_vlc_offs];
+ wl_vlc_tabs[i].table_allocated = 1 << wl_nb_bits[i];
+ ct_vlc_tabs[i].table = &tables_data[ct_vlc_offs];
+ ct_vlc_tabs[i].table_allocated = 1 << ct_nb_bits[i];
+
+ ff_init_vlc_sparse(&wl_vlc_tabs[i], wl_nb_bits[i], wl_nb_codes[i],
+ wl_bits[i], 1, 1,
+ wl_codes[i], 1, 1,
+ wl_xlats[i], 1, 1,
+ INIT_VLC_USE_NEW_STATIC);
+
+ ff_init_vlc_sparse(&ct_vlc_tabs[i], ct_nb_bits[i], ct_nb_codes[i],
+ ct_bits[i], 1, 1,
+ ct_codes[i], 1, 1,
+ ct_xlats[i], 1, 1,
+ INIT_VLC_USE_NEW_STATIC);
+
+ wl_vlc_offs += wl_vlc_tabs[i].table_allocated;
+ ct_vlc_offs += ct_vlc_tabs[i].table_allocated;
+ }
+
+ for (i = 0, sf_vlc_offs = 76; i < 8; i++) {
+ sf_vlc_tabs[i].table = &tables_data[sf_vlc_offs];
+ sf_vlc_tabs[i].table_allocated = 1 << sf_nb_bits[i];
+
+ ff_init_vlc_sparse(&sf_vlc_tabs[i], sf_nb_bits[i], sf_nb_codes[i],
+ sf_bits[i], 1, 1,
+ sf_codes[i], 2, 2,
+ sf_xlats[i], 1, 1,
+ INIT_VLC_USE_NEW_STATIC);
+ sf_vlc_offs += sf_vlc_tabs[i].table_allocated;
+ }
+
+ tab_offset = 2564;
+
+ /* build huffman tables for spectrum decoding */
+ for (i = 0; i < 112; i++) {
+ if (atrac3p_spectra_tabs[i].cb)
+ build_canonical_huff(atrac3p_spectra_tabs[i].cb,
+ atrac3p_spectra_tabs[i].xlat,
+ &tab_offset, &spec_vlc_tabs[i]);
+ else
+ spec_vlc_tabs[i].table = 0;
+ }
+
+ /* build huffman tables for gain data decoding */
+ for (i = 0; i < 11; i++)
+ build_canonical_huff(gain_cbs[i], gain_xlats[i], &tab_offset, &gain_vlc_tabs[i]);
+
+ /* build huffman tables for tone decoding */
+ for (i = 0; i < 7; i++)
+ build_canonical_huff(tone_cbs[i], tone_xlats[i], &tab_offset, &tone_vlc_tabs[i]);
+}
+
+/**
+ * Decode number of coded quantization units.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] chan ptr to the channel parameters
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int num_coded_units(GetBitContext *gb, Atrac3pChanParams *chan,
+ Atrac3pChanUnitCtx *ctx, AVCodecContext *avctx)
+{
+ chan->fill_mode = get_bits(gb, 2);
+ if (!chan->fill_mode) {
+ chan->num_coded_vals = ctx->num_quant_units;
+ } else {
+ chan->num_coded_vals = get_bits(gb, 5);
+ if (chan->num_coded_vals > ctx->num_quant_units) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid number of transmitted units!\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (chan->fill_mode == 3)
+ chan->split_point = get_bits(gb, 2) + (chan->ch_num << 1) + 1;
+ }
+
+ return 0;
+}
+
+/**
+ * Add weighting coefficients to the decoded word-length information.
+ *
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in,out] chan ptr to the channel parameters
+ * @param[in] wtab_idx index of the table of weights
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int add_wordlen_weights(Atrac3pChanUnitCtx *ctx,
+ Atrac3pChanParams *chan, int wtab_idx,
+ AVCodecContext *avctx)
+{
+ int i;
+ const int8_t *weights_tab =
+ &atrac3p_wl_weights[chan->ch_num * 3 + wtab_idx - 1][0];
+
+ for (i = 0; i < ctx->num_quant_units; i++) {
+ chan->qu_wordlen[i] += weights_tab[i];
+ if (chan->qu_wordlen[i] < 0 || chan->qu_wordlen[i] > 7) {
+ av_log(avctx, AV_LOG_ERROR,
+ "WL index out of range: pos=%d, val=%d!\n",
+ i, chan->qu_wordlen[i]);
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * Subtract weighting coefficients from decoded scalefactors.
+ *
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in,out] chan ptr to the channel parameters
+ * @param[in] wtab_idx index of table of weights
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int subtract_sf_weights(Atrac3pChanUnitCtx *ctx,
+ Atrac3pChanParams *chan, int wtab_idx,
+ AVCodecContext *avctx)
+{
+ int i;
+ const int8_t *weights_tab = &atrac3p_sf_weights[wtab_idx - 1][0];
+
+ for (i = 0; i < ctx->used_quant_units; i++) {
+ chan->qu_sf_idx[i] -= weights_tab[i];
+ if (chan->qu_sf_idx[i] < 0 || chan->qu_sf_idx[i] > 63) {
+ av_log(avctx, AV_LOG_ERROR,
+ "SF index out of range: pos=%d, val=%d!\n",
+ i, chan->qu_sf_idx[i]);
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * Unpack vector quantization tables.
+ *
+ * @param[in] start_val start value for the unpacked table
+ * @param[in] shape_vec ptr to table to unpack
+ * @param[out] dst ptr to output array
+ * @param[in] num_values number of values to unpack
+ */
+static inline void unpack_vq_shape(int start_val, const int8_t *shape_vec,
+ int *dst, int num_values)
+{
+ int i;
+
+ if (num_values) {
+ dst[0] = dst[1] = dst[2] = start_val;
+ for (i = 3; i < num_values; i++)
+ dst[i] = start_val - shape_vec[atrac3p_qu_num_to_seg[i] - 1];
+ }
+}
+
+#define UNPACK_SF_VQ_SHAPE(gb, dst, num_vals) \
+ start_val = get_bits((gb), 6); \
+ unpack_vq_shape(start_val, &atrac3p_sf_shapes[get_bits((gb), 6)][0], \
+ (dst), (num_vals))
+
+/**
+ * Decode word length for each quantization unit of a channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_channel_wordlen(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, AVCodecContext *avctx)
+{
+ int i, weight_idx = 0, delta, diff, pos, delta_bits, min_val, flag,
+ ret, start_val;
+ VLC *vlc_tab;
+ Atrac3pChanParams *chan = &ctx->channels[ch_num];
+ Atrac3pChanParams *ref_chan = &ctx->channels[0];
+
+ chan->fill_mode = 0;
+
+ switch (get_bits(gb, 2)) { /* switch according to coding mode */
+ case 0: /* coded using constant number of bits */
+ for (i = 0; i < ctx->num_quant_units; i++)
+ chan->qu_wordlen[i] = get_bits(gb, 3);
+ break;
+ case 1:
+ if (ch_num) {
+ if ((ret = num_coded_units(gb, chan, ctx, avctx)) < 0)
+ return ret;
+
+ if (chan->num_coded_vals) {
+ vlc_tab = &wl_vlc_tabs[get_bits(gb, 2)];
+
+ for (i = 0; i < chan->num_coded_vals; i++) {
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ chan->qu_wordlen[i] = (ref_chan->qu_wordlen[i] + delta) & 7;
+ }
+ }
+ } else {
+ weight_idx = get_bits(gb, 2);
+ if ((ret = num_coded_units(gb, chan, ctx, avctx)) < 0)
+ return ret;
+
+ if (chan->num_coded_vals) {
+ pos = get_bits(gb, 5);
+ if (pos > chan->num_coded_vals) {
+ av_log(avctx, AV_LOG_ERROR,
+ "WL mode 1: invalid position!\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ delta_bits = get_bits(gb, 2);
+ min_val = get_bits(gb, 3);
+
+ for (i = 0; i < pos; i++)
+ chan->qu_wordlen[i] = get_bits(gb, 3);
+
+ for (i = pos; i < chan->num_coded_vals; i++)
+ chan->qu_wordlen[i] = (min_val + GET_DELTA(gb, delta_bits)) & 7;
+ }
+ }
+ break;
+ case 2:
+ if ((ret = num_coded_units(gb, chan, ctx, avctx)) < 0)
+ return ret;
+
+ if (ch_num && chan->num_coded_vals) {
+ vlc_tab = &wl_vlc_tabs[get_bits(gb, 2)];
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ chan->qu_wordlen[0] = (ref_chan->qu_wordlen[0] + delta) & 7;
+
+ for (i = 1; i < chan->num_coded_vals; i++) {
+ diff = ref_chan->qu_wordlen[i] - ref_chan->qu_wordlen[i - 1];
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ chan->qu_wordlen[i] = (chan->qu_wordlen[i - 1] + diff + delta) & 7;
+ }
+ } else if (chan->num_coded_vals) {
+ flag = get_bits(gb, 1);
+ vlc_tab = &wl_vlc_tabs[get_bits(gb, 1)];
+
+ start_val = get_bits(gb, 3);
+ unpack_vq_shape(start_val,
+ &atrac3p_wl_shapes[start_val][get_bits(gb, 4)][0],
+ chan->qu_wordlen, chan->num_coded_vals);
+
+ if (!flag) {
+ for (i = 0; i < chan->num_coded_vals; i++) {
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ chan->qu_wordlen[i] = (chan->qu_wordlen[i] + delta) & 7;
+ }
+ } else {
+ for (i = 0; i < (chan->num_coded_vals & - 2); i += 2)
+ if (!get_bits1(gb)) {
+ chan->qu_wordlen[i] = (chan->qu_wordlen[i] +
+ get_vlc2(gb, vlc_tab->table,
+ vlc_tab->bits, 1)) & 7;
+ chan->qu_wordlen[i + 1] = (chan->qu_wordlen[i + 1] +
+ get_vlc2(gb, vlc_tab->table,
+ vlc_tab->bits, 1)) & 7;
+ }
+
+ if (chan->num_coded_vals & 1)
+ chan->qu_wordlen[i] = (chan->qu_wordlen[i] +
+ get_vlc2(gb, vlc_tab->table,
+ vlc_tab->bits, 1)) & 7;
+ }
+ }
+ break;
+ case 3:
+ weight_idx = get_bits(gb, 2);
+ if ((ret = num_coded_units(gb, chan, ctx, avctx)) < 0)
+ return ret;
+
+ if (chan->num_coded_vals) {
+ vlc_tab = &wl_vlc_tabs[get_bits(gb, 2)];
+
+ /* first coefficient is coded directly */
+ chan->qu_wordlen[0] = get_bits(gb, 3);
+
+ for (i = 1; i < chan->num_coded_vals; i++) {
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ chan->qu_wordlen[i] = (chan->qu_wordlen[i - 1] + delta) & 7;
+ }
+ }
+ break;
+ }
+
+ if (chan->fill_mode == 2) {
+ for (i = chan->num_coded_vals; i < ctx->num_quant_units; i++)
+ chan->qu_wordlen[i] = ch_num ? get_bits1(gb) : 1;
+ } else if (chan->fill_mode == 3) {
+ pos = ch_num ? chan->num_coded_vals + chan->split_point
+ : ctx->num_quant_units - chan->split_point;
+ for (i = chan->num_coded_vals; i < pos; i++)
+ chan->qu_wordlen[i] = 1;
+ }
+
+ if (weight_idx)
+ return add_wordlen_weights(ctx, chan, weight_idx, avctx);
+
+ return 0;
+}
+
+/**
+ * Decode scale factor indexes for each quant unit of a channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_channel_sf_idx(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, AVCodecContext *avctx)
+{
+ int i, weight_idx = 0, delta, diff, num_long_vals,
+ delta_bits, min_val, vlc_sel, start_val;
+ VLC *vlc_tab;
+ Atrac3pChanParams *chan = &ctx->channels[ch_num];
+ Atrac3pChanParams *ref_chan = &ctx->channels[0];
+
+ switch (get_bits(gb, 2)) { /* switch according to coding mode */
+ case 0: /* coded using constant number of bits */
+ for (i = 0; i < ctx->used_quant_units; i++)
+ chan->qu_sf_idx[i] = get_bits(gb, 6);
+ break;
+ case 1:
+ if (ch_num) {
+ vlc_tab = &sf_vlc_tabs[get_bits(gb, 2)];
+
+ for (i = 0; i < ctx->used_quant_units; i++) {
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ chan->qu_sf_idx[i] = (ref_chan->qu_sf_idx[i] + delta) & 0x3F;
+ }
+ } else {
+ weight_idx = get_bits(gb, 2);
+ if (weight_idx == 3) {
+ UNPACK_SF_VQ_SHAPE(gb, chan->qu_sf_idx, ctx->used_quant_units);
+
+ num_long_vals = get_bits(gb, 5);
+ delta_bits = get_bits(gb, 2);
+ min_val = get_bits(gb, 4) - 7;
+
+ for (i = 0; i < num_long_vals; i++)
+ chan->qu_sf_idx[i] = (chan->qu_sf_idx[i] +
+ get_bits(gb, 4) - 7) & 0x3F;
+
+ /* all others are: min_val + delta */
+ for (i = num_long_vals; i < ctx->used_quant_units; i++)
+ chan->qu_sf_idx[i] = (chan->qu_sf_idx[i] + min_val +
+ GET_DELTA(gb, delta_bits)) & 0x3F;
+ } else {
+ num_long_vals = get_bits(gb, 5);
+ delta_bits = get_bits(gb, 3);
+ min_val = get_bits(gb, 6);
+ if (num_long_vals > ctx->used_quant_units || delta_bits == 7) {
+ av_log(avctx, AV_LOG_ERROR,
+ "SF mode 1: invalid parameters!\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ /* read full-precision SF indexes */
+ for (i = 0; i < num_long_vals; i++)
+ chan->qu_sf_idx[i] = get_bits(gb, 6);
+
+ /* all others are: min_val + delta */
+ for (i = num_long_vals; i < ctx->used_quant_units; i++)
+ chan->qu_sf_idx[i] = (min_val +
+ GET_DELTA(gb, delta_bits)) & 0x3F;
+ }
+ }
+ break;
+ case 2:
+ if (ch_num) {
+ vlc_tab = &sf_vlc_tabs[get_bits(gb, 2)];
+
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ chan->qu_sf_idx[0] = (ref_chan->qu_sf_idx[0] + delta) & 0x3F;
+
+ for (i = 1; i < ctx->used_quant_units; i++) {
+ diff = ref_chan->qu_sf_idx[i] - ref_chan->qu_sf_idx[i - 1];
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ chan->qu_sf_idx[i] = (chan->qu_sf_idx[i - 1] + diff + delta) & 0x3F;
+ }
+ } else {
+ vlc_tab = &sf_vlc_tabs[get_bits(gb, 2) + 4];
+
+ UNPACK_SF_VQ_SHAPE(gb, chan->qu_sf_idx, ctx->used_quant_units);
+
+ for (i = 0; i < ctx->used_quant_units; i++) {
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ chan->qu_sf_idx[i] = (chan->qu_sf_idx[i] +
+ sign_extend(delta, 4)) & 0x3F;
+ }
+ }
+ break;
+ case 3:
+ if (ch_num) {
+ /* copy coefficients from reference channel */
+ for (i = 0; i < ctx->used_quant_units; i++)
+ chan->qu_sf_idx[i] = ref_chan->qu_sf_idx[i];
+ } else {
+ weight_idx = get_bits(gb, 2);
+ vlc_sel = get_bits(gb, 2);
+ vlc_tab = &sf_vlc_tabs[vlc_sel];
+
+ if (weight_idx == 3) {
+ vlc_tab = &sf_vlc_tabs[vlc_sel + 4];
+
+ UNPACK_SF_VQ_SHAPE(gb, chan->qu_sf_idx, ctx->used_quant_units);
+
+ diff = (get_bits(gb, 4) + 56) & 0x3F;
+ chan->qu_sf_idx[0] = (chan->qu_sf_idx[0] + diff) & 0x3F;
+
+ for (i = 1; i < ctx->used_quant_units; i++) {
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ diff = (diff + sign_extend(delta, 4)) & 0x3F;
+ chan->qu_sf_idx[i] = (diff + chan->qu_sf_idx[i]) & 0x3F;
+ }
+ } else {
+ /* 1st coefficient is coded directly */
+ chan->qu_sf_idx[0] = get_bits(gb, 6);
+
+ for (i = 1; i < ctx->used_quant_units; i++) {
+ delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+ chan->qu_sf_idx[i] = (chan->qu_sf_idx[i - 1] + delta) & 0x3F;
+ }
+ }
+ }
+ break;
+ }
+
+ if (weight_idx && weight_idx < 3)
+ return subtract_sf_weights(ctx, chan, weight_idx, avctx);
+
+ return 0;
+}
+
+/**
+ * Decode word length information for each channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] num_channels number of channels to process
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_quant_wordlen(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int num_channels, AVCodecContext *avctx)
+{
+ int ch_num, i, ret;
+
+ for (ch_num = 0; ch_num < num_channels; ch_num++) {
+ memset(ctx->channels[ch_num].qu_wordlen, 0,
+ sizeof(ctx->channels[ch_num].qu_wordlen));
+
+ if ((ret = decode_channel_wordlen(gb, ctx, ch_num, avctx)) < 0)
+ return ret;
+ }
+
+ /* scan for last non-zero coeff in both channels and
+ * set number of quant units having coded spectrum */
+ for (i = ctx->num_quant_units - 1; i >= 0; i--)
+ if (ctx->channels[0].qu_wordlen[i] ||
+ (num_channels == 2 && ctx->channels[1].qu_wordlen[i]))
+ break;
+ ctx->used_quant_units = i + 1;
+
+ return 0;
+}
+
+/**
+ * Decode scale factor indexes for each channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] num_channels number of channels to process
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_scale_factors(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int num_channels, AVCodecContext *avctx)
+{
+ int ch_num, ret;
+
+ if (!ctx->used_quant_units)
+ return 0;
+
+ for (ch_num = 0; ch_num < num_channels; ch_num++) {
+ memset(ctx->channels[ch_num].qu_sf_idx, 0,
+ sizeof(ctx->channels[ch_num].qu_sf_idx));
+
+ if ((ret = decode_channel_sf_idx(gb, ctx, ch_num, avctx)) < 0)
+ return ret;
+ }
+
+ return 0;
+}
+
+/**
+ * Decode number of code table values.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int get_num_ct_values(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ AVCodecContext *avctx)
+{
+ int num_coded_vals;
+
+ if (get_bits1(gb)) {
+ num_coded_vals = get_bits(gb, 5);
+ if (num_coded_vals > ctx->used_quant_units) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid number of code table indexes: %d!\n", num_coded_vals);
+ return AVERROR_INVALIDDATA;
+ }
+ return num_coded_vals;
+ } else
+ return ctx->used_quant_units;
+}
+
+#define DEC_CT_IDX_COMMON(OP) \
+ num_vals = get_num_ct_values(gb, ctx, avctx); \
+ if (num_vals < 0) \
+ return num_vals; \
+ \
+ for (i = 0; i < num_vals; i++) { \
+ if (chan->qu_wordlen[i]) { \
+ chan->qu_tab_idx[i] = OP; \
+ } else if (ch_num && ref_chan->qu_wordlen[i]) \
+ /* get clone master flag */ \
+ chan->qu_tab_idx[i] = get_bits1(gb); \
+ }
+
+#define CODING_DIRECT get_bits(gb, num_bits)
+
+#define CODING_VLC get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1)
+
+#define CODING_VLC_DELTA \
+ (!i) ? CODING_VLC \
+ : (pred + get_vlc2(gb, delta_vlc->table, \
+ delta_vlc->bits, 1)) & mask; \
+ pred = chan->qu_tab_idx[i]
+
+#define CODING_VLC_DIFF \
+ (ref_chan->qu_tab_idx[i] + \
+ get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1)) & mask
+
+/**
+ * Decode code table indexes for each quant unit of a channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_channel_code_tab(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, AVCodecContext *avctx)
+{
+ int i, num_vals, num_bits, pred;
+ int mask = ctx->use_full_table ? 7 : 3; /* mask for modular arithmetic */
+ VLC *vlc_tab, *delta_vlc;
+ Atrac3pChanParams *chan = &ctx->channels[ch_num];
+ Atrac3pChanParams *ref_chan = &ctx->channels[0];
+
+ chan->table_type = get_bits1(gb);
+
+ switch (get_bits(gb, 2)) { /* switch according to coding mode */
+ case 0: /* directly coded */
+ num_bits = ctx->use_full_table + 2;
+ DEC_CT_IDX_COMMON(CODING_DIRECT);
+ break;
+ case 1: /* entropy-coded */
+ vlc_tab = ctx->use_full_table ? &ct_vlc_tabs[1]
+ : ct_vlc_tabs;
+ DEC_CT_IDX_COMMON(CODING_VLC);
+ break;
+ case 2: /* entropy-coded delta */
+ if (ctx->use_full_table) {
+ vlc_tab = &ct_vlc_tabs[1];
+ delta_vlc = &ct_vlc_tabs[2];
+ } else {
+ vlc_tab = ct_vlc_tabs;
+ delta_vlc = ct_vlc_tabs;
+ }
+ pred = 0;
+ DEC_CT_IDX_COMMON(CODING_VLC_DELTA);
+ break;
+ case 3: /* entropy-coded difference to master */
+ if (ch_num) {
+ vlc_tab = ctx->use_full_table ? &ct_vlc_tabs[3]
+ : ct_vlc_tabs;
+ DEC_CT_IDX_COMMON(CODING_VLC_DIFF);
+ }
+ break;
+ }
+
+ return 0;
+}
+
+/**
+ * Decode code table indexes for each channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] num_channels number of channels to process
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_code_table_indexes(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int num_channels, AVCodecContext *avctx)
+{
+ int ch_num, ret;
+
+ if (!ctx->used_quant_units)
+ return 0;
+
+ ctx->use_full_table = get_bits1(gb);
+
+ for (ch_num = 0; ch_num < num_channels; ch_num++) {
+ memset(ctx->channels[ch_num].qu_tab_idx, 0,
+ sizeof(ctx->channels[ch_num].qu_tab_idx));
+
+ if ((ret = decode_channel_code_tab(gb, ctx, ch_num, avctx)) < 0)
+ return ret;
+ }
+
+ return 0;
+}
+
+/**
+ * Decode huffman-coded spectral lines for a given quant unit.
+ *
+ * This is a generalized version for all known coding modes.
+ * Its speed can be improved by creating separate functions for each mode.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in] tab code table telling how to decode spectral lines
+ * @param[in] vlc_tab ptr to the huffman table associated with the code table
+ * @param[out] out pointer to buffer where decoded data should be stored
+ * @param[in] num_specs number of spectral lines to decode
+ */
+static void decode_qu_spectra(GetBitContext *gb, const Atrac3pSpecCodeTab *tab,
+ VLC *vlc_tab, int16_t *out, const int num_specs)
+{
+ int i, j, pos, cf;
+ int group_size = tab->group_size;
+ int num_coeffs = tab->num_coeffs;
+ int bits = tab->bits;
+ int is_signed = tab->is_signed;
+ unsigned val, mask = (1 << bits) - 1;
+
+ for (pos = 0; pos < num_specs;) {
+ if (group_size == 1 || get_bits1(gb)) {
+ for (j = 0; j < group_size; j++) {
+ val = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
+
+ for (i = 0; i < num_coeffs; i++) {
+ cf = val & mask;
+ if (is_signed)
+ cf = sign_extend(cf, bits);
+ else if (cf && get_bits1(gb))
+ cf = -cf;
+
+ out[pos++] = cf;
+ val >>= bits;
+ }
+ }
+ } else /* group skipped */
+ pos += group_size * num_coeffs;
+ }
+}
+
+/**
+ * Decode huffman-coded IMDCT spectrum for all channels.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] num_channels number of channels to process
+ * @param[in] avctx ptr to the AVCodecContext
+ */
+static void decode_spectrum(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int num_channels, AVCodecContext *avctx)
+{
+ int i, ch_num, qu, wordlen, codetab, tab_index, num_specs;
+ const Atrac3pSpecCodeTab *tab;
+ Atrac3pChanParams *chan;
+
+ for (ch_num = 0; ch_num < num_channels; ch_num++) {
+ chan = &ctx->channels[ch_num];
+
+ memset(chan->spectrum, 0, sizeof(chan->spectrum));
+
+ /* set power compensation level to disabled */
+ memset(chan->power_levs, ATRAC3P_POWER_COMP_OFF, sizeof(chan->power_levs));
+
+ for (qu = 0; qu < ctx->used_quant_units; qu++) {
+ num_specs = ff_atrac3p_qu_to_spec_pos[qu + 1] -
+ ff_atrac3p_qu_to_spec_pos[qu];
+
+ wordlen = chan->qu_wordlen[qu];
+ codetab = chan->qu_tab_idx[qu];
+ if (wordlen) {
+ if (!ctx->use_full_table)
+ codetab = atrac3p_ct_restricted_to_full[chan->table_type][wordlen - 1][codetab];
+
+ tab_index = (chan->table_type * 8 + codetab) * 7 + wordlen - 1;
+ tab = &atrac3p_spectra_tabs[tab_index];
+
+ /* this allows reusing VLC tables */
+ if (tab->redirect >= 0)
+ tab_index = tab->redirect;
+
+ decode_qu_spectra(gb, tab, &spec_vlc_tabs[tab_index],
+ &chan->spectrum[ff_atrac3p_qu_to_spec_pos[qu]],
+ num_specs);
+ } else if (ch_num && ctx->channels[0].qu_wordlen[qu] && !codetab) {
+ /* copy coefficients from master */
+ memcpy(&chan->spectrum[ff_atrac3p_qu_to_spec_pos[qu]],
+ &ctx->channels[0].spectrum[ff_atrac3p_qu_to_spec_pos[qu]],
+ num_specs *
+ sizeof(chan->spectrum[ff_atrac3p_qu_to_spec_pos[qu]]));
+ chan->qu_wordlen[qu] = ctx->channels[0].qu_wordlen[qu];
+ }
+ }
+
+ /* Power compensation levels only present in the bitstream
+ * if there are more than 2 quant units. The lowest two units
+ * correspond to the frequencies 0...351 Hz, whose shouldn't
+ * be affected by the power compensation. */
+ if (ctx->used_quant_units > 2) {
+ num_specs = atrac3p_subband_to_num_powgrps[ctx->num_coded_subbands - 1];
+ for (i = 0; i < num_specs; i++)
+ chan->power_levs[i] = get_bits(gb, 4);
+ }
+ }
+}
+
+/**
+ * Retrieve specified amount of flag bits from the input bitstream.
+ * The data can be shortened in the case of the following two common conditions:
+ * if all bits are zero then only one signal bit = 0 will be stored,
+ * if all bits are ones then two signal bits = 1,0 will be stored.
+ * Otherwise, all necessary bits will be directly stored
+ * prefixed by two signal bits = 1,1.
+ *
+ * @param[in] gb ptr to the GetBitContext
+ * @param[out] out where to place decoded flags
+ * @param[in] num_flags number of flags to process
+ * @return: 0 = all flag bits are zero, 1 = there is at least one non-zero flag bit
+ */
+static int get_subband_flags(GetBitContext *gb, uint8_t *out, int num_flags)
+{
+ int i, result;
+
+ memset(out, 0, num_flags);
+
+ result = get_bits1(gb);
+ if (result) {
+ if (get_bits1(gb))
+ for (i = 0; i < num_flags; i++)
+ out[i] = get_bits1(gb);
+ else
+ memset(out, 1, num_flags);
+ }
+
+ return result;
+}
+
+/**
+ * Decode mdct window shape flags for all channels.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] num_channels number of channels to process
+ */
+static void decode_window_shape(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int num_channels)
+{
+ int ch_num;
+
+ for (ch_num = 0; ch_num < num_channels; ch_num++)
+ get_subband_flags(gb, ctx->channels[ch_num].wnd_shape,
+ ctx->num_subbands);
+}
+
+/**
+ * Decode number of gain control points.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] coded_subbands number of subbands to process
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_gainc_npoints(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, int coded_subbands)
+{
+ int i, delta, delta_bits, min_val;
+ Atrac3pChanParams *chan = &ctx->channels[ch_num];
+ Atrac3pChanParams *ref_chan = &ctx->channels[0];
+
+ switch (get_bits(gb, 2)) { /* switch according to coding mode */
+ case 0: /* fixed-length coding */
+ for (i = 0; i < coded_subbands; i++)
+ chan->gain_data[i].num_points = get_bits(gb, 3);
+ break;
+ case 1: /* variable-length coding */
+ for (i = 0; i < coded_subbands; i++)
+ chan->gain_data[i].num_points =
+ get_vlc2(gb, gain_vlc_tabs[0].table,
+ gain_vlc_tabs[0].bits, 1);
+ break;
+ case 2:
+ if (ch_num) { /* VLC modulo delta to master channel */
+ for (i = 0; i < coded_subbands; i++) {
+ delta = get_vlc2(gb, gain_vlc_tabs[1].table,
+ gain_vlc_tabs[1].bits, 1);
+ chan->gain_data[i].num_points =
+ (ref_chan->gain_data[i].num_points + delta) & 7;
+ }
+ } else { /* VLC modulo delta to previous */
+ chan->gain_data[0].num_points =
+ get_vlc2(gb, gain_vlc_tabs[0].table,
+ gain_vlc_tabs[0].bits, 1);
+
+ for (i = 1; i < coded_subbands; i++) {
+ delta = get_vlc2(gb, gain_vlc_tabs[1].table,
+ gain_vlc_tabs[1].bits, 1);
+ chan->gain_data[i].num_points =
+ (chan->gain_data[i - 1].num_points + delta) & 7;
+ }
+ }
+ break;
+ case 3:
+ if (ch_num) { /* copy data from master channel */
+ for (i = 0; i < coded_subbands; i++)
+ chan->gain_data[i].num_points =
+ ref_chan->gain_data[i].num_points;
+ } else { /* shorter delta to min */
+ delta_bits = get_bits(gb, 2);
+ min_val = get_bits(gb, 3);
+
+ for (i = 0; i < coded_subbands; i++) {
+ chan->gain_data[i].num_points = min_val + GET_DELTA(gb, delta_bits);
+ if (chan->gain_data[i].num_points > 7)
+ return AVERROR_INVALIDDATA;
+ }
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * Implements coding mode 3 (slave) for gain compensation levels.
+ *
+ * @param[out] dst ptr to the output array
+ * @param[in] ref ptr to the reference channel
+ */
+static inline void gainc_level_mode3s(AtracGainInfo *dst, AtracGainInfo *ref)
+{
+ int i;
+
+ for (i = 0; i < dst->num_points; i++)
+ dst->lev_code[i] = (i >= ref->num_points) ? 7 : ref->lev_code[i];
+}
+
+/**
+ * Implements coding mode 1 (master) for gain compensation levels.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in] ctx ptr to the channel unit context
+ * @param[out] dst ptr to the output array
+ */
+static inline void gainc_level_mode1m(GetBitContext *gb,
+ Atrac3pChanUnitCtx *ctx,
+ AtracGainInfo *dst)
+{
+ int i, delta;
+
+ if (dst->num_points > 0)
+ dst->lev_code[0] = get_vlc2(gb, gain_vlc_tabs[2].table,
+ gain_vlc_tabs[2].bits, 1);
+
+ for (i = 1; i < dst->num_points; i++) {
+ delta = get_vlc2(gb, gain_vlc_tabs[3].table,
+ gain_vlc_tabs[3].bits, 1);
+ dst->lev_code[i] = (dst->lev_code[i - 1] + delta) & 0xF;
+ }
+}
+
+/**
+ * Decode level code for each gain control point.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] coded_subbands number of subbands to process
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_gainc_levels(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, int coded_subbands)
+{
+ int sb, i, delta, delta_bits, min_val, pred;
+ Atrac3pChanParams *chan = &ctx->channels[ch_num];
+ Atrac3pChanParams *ref_chan = &ctx->channels[0];
+
+ switch (get_bits(gb, 2)) { /* switch according to coding mode */
+ case 0: /* fixed-length coding */
+ for (sb = 0; sb < coded_subbands; sb++)
+ for (i = 0; i < chan->gain_data[sb].num_points; i++)
+ chan->gain_data[sb].lev_code[i] = get_bits(gb, 4);
+ break;
+ case 1:
+ if (ch_num) { /* VLC modulo delta to master channel */
+ for (sb = 0; sb < coded_subbands; sb++)
+ for (i = 0; i < chan->gain_data[sb].num_points; i++) {
+ delta = get_vlc2(gb, gain_vlc_tabs[5].table,
+ gain_vlc_tabs[5].bits, 1);
+ pred = (i >= ref_chan->gain_data[sb].num_points)
+ ? 7 : ref_chan->gain_data[sb].lev_code[i];
+ chan->gain_data[sb].lev_code[i] = (pred + delta) & 0xF;
+ }
+ } else { /* VLC modulo delta to previous */
+ for (sb = 0; sb < coded_subbands; sb++)
+ gainc_level_mode1m(gb, ctx, &chan->gain_data[sb]);
+ }
+ break;
+ case 2:
+ if (ch_num) { /* VLC modulo delta to previous or clone master */
+ for (sb = 0; sb < coded_subbands; sb++)
+ if (chan->gain_data[sb].num_points > 0) {
+ if (get_bits1(gb))
+ gainc_level_mode1m(gb, ctx, &chan->gain_data[sb]);
+ else
+ gainc_level_mode3s(&chan->gain_data[sb],
+ &ref_chan->gain_data[sb]);
+ }
+ } else { /* VLC modulo delta to lev_codes of previous subband */
+ if (chan->gain_data[0].num_points > 0)
+ gainc_level_mode1m(gb, ctx, &chan->gain_data[0]);
+
+ for (sb = 1; sb < coded_subbands; sb++)
+ for (i = 0; i < chan->gain_data[sb].num_points; i++) {
+ delta = get_vlc2(gb, gain_vlc_tabs[4].table,
+ gain_vlc_tabs[4].bits, 1);
+ pred = (i >= chan->gain_data[sb - 1].num_points)
+ ? 7 : chan->gain_data[sb - 1].lev_code[i];
+ chan->gain_data[sb].lev_code[i] = (pred + delta) & 0xF;
+ }
+ }
+ break;
+ case 3:
+ if (ch_num) { /* clone master */
+ for (sb = 0; sb < coded_subbands; sb++)
+ gainc_level_mode3s(&chan->gain_data[sb],
+ &ref_chan->gain_data[sb]);
+ } else { /* shorter delta to min */
+ delta_bits = get_bits(gb, 2);
+ min_val = get_bits(gb, 4);
+
+ for (sb = 0; sb < coded_subbands; sb++)
+ for (i = 0; i < chan->gain_data[sb].num_points; i++) {
+ chan->gain_data[sb].lev_code[i] = min_val + GET_DELTA(gb, delta_bits);
+ if (chan->gain_data[sb].lev_code[i] > 15)
+ return AVERROR_INVALIDDATA;
+ }
+ }
+ break;
+ }
+
+ return 0;
+}
+
+/**
+ * Implements coding mode 0 for gain compensation locations.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in] ctx ptr to the channel unit context
+ * @param[out] dst ptr to the output array
+ * @param[in] pos position of the value to be processed
+ */
+static inline void gainc_loc_mode0(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ AtracGainInfo *dst, int pos)
+{
+ int delta_bits;
+
+ if (!pos || dst->loc_code[pos - 1] < 15)
+ dst->loc_code[pos] = get_bits(gb, 5);
+ else if (dst->loc_code[pos - 1] >= 30)
+ dst->loc_code[pos] = 31;
+ else {
+ delta_bits = av_log2(30 - dst->loc_code[pos - 1]) + 1;
+ dst->loc_code[pos] = dst->loc_code[pos - 1] +
+ get_bits(gb, delta_bits) + 1;
+ }
+}
+
+/**
+ * Implements coding mode 1 for gain compensation locations.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in] ctx ptr to the channel unit context
+ * @param[out] dst ptr to the output array
+ */
+static inline void gainc_loc_mode1(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ AtracGainInfo *dst)
+{
+ int i;
+ VLC *tab;
+
+ if (dst->num_points > 0) {
+ /* 1st coefficient is stored directly */
+ dst->loc_code[0] = get_bits(gb, 5);
+
+ for (i = 1; i < dst->num_points; i++) {
+ /* switch VLC according to the curve direction
+ * (ascending/descending) */
+ tab = (dst->lev_code[i] <= dst->lev_code[i - 1])
+ ? &gain_vlc_tabs[7]
+ : &gain_vlc_tabs[9];
+ dst->loc_code[i] = dst->loc_code[i - 1] +
+ get_vlc2(gb, tab->table, tab->bits, 1);
+ }
+ }
+}
+
+/**
+ * Decode location code for each gain control point.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] coded_subbands number of subbands to process
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_gainc_loc_codes(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, int coded_subbands,
+ AVCodecContext *avctx)
+{
+ int sb, i, delta, delta_bits, min_val, pred, more_than_ref;
+ AtracGainInfo *dst, *ref;
+ VLC *tab;
+ Atrac3pChanParams *chan = &ctx->channels[ch_num];
+ Atrac3pChanParams *ref_chan = &ctx->channels[0];
+
+ switch (get_bits(gb, 2)) { /* switch according to coding mode */
+ case 0: /* sequence of numbers in ascending order */
+ for (sb = 0; sb < coded_subbands; sb++)
+ for (i = 0; i < chan->gain_data[sb].num_points; i++)
+ gainc_loc_mode0(gb, ctx, &chan->gain_data[sb], i);
+ break;
+ case 1:
+ if (ch_num) {
+ for (sb = 0; sb < coded_subbands; sb++) {
+ if (chan->gain_data[sb].num_points <= 0)
+ continue;
+ dst = &chan->gain_data[sb];
+ ref = &ref_chan->gain_data[sb];
+
+ /* 1st value is vlc-coded modulo delta to master */
+ delta = get_vlc2(gb, gain_vlc_tabs[10].table,
+ gain_vlc_tabs[10].bits, 1);
+ pred = ref->num_points > 0 ? ref->loc_code[0] : 0;
+ dst->loc_code[0] = (pred + delta) & 0x1F;
+
+ for (i = 1; i < dst->num_points; i++) {
+ more_than_ref = i >= ref->num_points;
+ if (dst->lev_code[i] > dst->lev_code[i - 1]) {
+ /* ascending curve */
+ if (more_than_ref) {
+ delta =
+ get_vlc2(gb, gain_vlc_tabs[9].table,
+ gain_vlc_tabs[9].bits, 1);
+ dst->loc_code[i] = dst->loc_code[i - 1] + delta;
+ } else {
+ if (get_bits1(gb))
+ gainc_loc_mode0(gb, ctx, dst, i); // direct coding
+ else
+ dst->loc_code[i] = ref->loc_code[i]; // clone master
+ }
+ } else { /* descending curve */
+ tab = more_than_ref ? &gain_vlc_tabs[7]
+ : &gain_vlc_tabs[10];
+ delta = get_vlc2(gb, tab->table, tab->bits, 1);
+ if (more_than_ref)
+ dst->loc_code[i] = dst->loc_code[i - 1] + delta;
+ else
+ dst->loc_code[i] = (ref->loc_code[i] + delta) & 0x1F;
+ }
+ }
+ }
+ } else /* VLC delta to previous */
+ for (sb = 0; sb < coded_subbands; sb++)
+ gainc_loc_mode1(gb, ctx, &chan->gain_data[sb]);
+ break;
+ case 2:
+ if (ch_num) {
+ for (sb = 0; sb < coded_subbands; sb++) {
+ if (chan->gain_data[sb].num_points <= 0)
+ continue;
+ dst = &chan->gain_data[sb];
+ ref = &ref_chan->gain_data[sb];
+ if (dst->num_points > ref->num_points || get_bits1(gb))
+ gainc_loc_mode1(gb, ctx, dst);
+ else /* clone master for the whole subband */
+ for (i = 0; i < chan->gain_data[sb].num_points; i++)
+ dst->loc_code[i] = ref->loc_code[i];
+ }
+ } else {
+ /* data for the first subband is coded directly */
+ for (i = 0; i < chan->gain_data[0].num_points; i++)
+ gainc_loc_mode0(gb, ctx, &chan->gain_data[0], i);
+
+ for (sb = 1; sb < coded_subbands; sb++) {
+ if (chan->gain_data[sb].num_points <= 0)
+ continue;
+ dst = &chan->gain_data[sb];
+
+ /* 1st value is vlc-coded modulo delta to the corresponding
+ * value of the previous subband if any or zero */
+ delta = get_vlc2(gb, gain_vlc_tabs[6].table,
+ gain_vlc_tabs[6].bits, 1);
+ pred = dst[-1].num_points > 0
+ ? dst[-1].loc_code[0] : 0;
+ dst->loc_code[0] = (pred + delta) & 0x1F;
+
+ for (i = 1; i < dst->num_points; i++) {
+ more_than_ref = i >= dst[-1].num_points;
+ /* Select VLC table according to curve direction and
+ * presence of prediction. */
+ tab = &gain_vlc_tabs[(dst->lev_code[i] > dst->lev_code[i - 1]) *
+ 2 + more_than_ref + 6];
+ delta = get_vlc2(gb, tab->table, tab->bits, 1);
+ if (more_than_ref)
+ dst->loc_code[i] = dst->loc_code[i - 1] + delta;
+ else
+ dst->loc_code[i] = (dst[-1].loc_code[i] + delta) & 0x1F;
+ }
+ }
+ }
+ break;
+ case 3:
+ if (ch_num) { /* clone master or direct or direct coding */
+ for (sb = 0; sb < coded_subbands; sb++)
+ for (i = 0; i < chan->gain_data[sb].num_points; i++) {
+ if (i >= ref_chan->gain_data[sb].num_points)
+ gainc_loc_mode0(gb, ctx, &chan->gain_data[sb], i);
+ else
+ chan->gain_data[sb].loc_code[i] =
+ ref_chan->gain_data[sb].loc_code[i];
+ }
+ } else { /* shorter delta to min */
+ delta_bits = get_bits(gb, 2) + 1;
+ min_val = get_bits(gb, 5);
+
+ for (sb = 0; sb < coded_subbands; sb++)
+ for (i = 0; i < chan->gain_data[sb].num_points; i++)
+ chan->gain_data[sb].loc_code[i] = min_val + i +
+ get_bits(gb, delta_bits);
+ }
+ break;
+ }
+
+ /* Validate decoded information */
+ for (sb = 0; sb < coded_subbands; sb++) {
+ dst = &chan->gain_data[sb];
+ for (i = 0; i < chan->gain_data[sb].num_points; i++) {
+ if (dst->loc_code[i] < 0 || dst->loc_code[i] > 31 ||
+ (i && dst->loc_code[i] <= dst->loc_code[i - 1])) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid gain location: ch=%d, sb=%d, pos=%d, val=%d\n",
+ ch_num, sb, i, dst->loc_code[i]);
+ return AVERROR_INVALIDDATA;
+ }
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * Decode gain control data for all channels.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] num_channels number of channels to process
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_gainc_data(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int num_channels, AVCodecContext *avctx)
+{
+ int ch_num, coded_subbands, sb, ret;
+
+ for (ch_num = 0; ch_num < num_channels; ch_num++) {
+ memset(ctx->channels[ch_num].gain_data, 0,
+ sizeof(*ctx->channels[ch_num].gain_data) * ATRAC3P_SUBBANDS);
+
+ if (get_bits1(gb)) { /* gain control data present? */
+ coded_subbands = get_bits(gb, 4) + 1;
+ if (get_bits1(gb)) /* is high band gain data replication on? */
+ ctx->channels[ch_num].num_gain_subbands = get_bits(gb, 4) + 1;
+ else
+ ctx->channels[ch_num].num_gain_subbands = coded_subbands;
+
+ if ((ret = decode_gainc_npoints(gb, ctx, ch_num, coded_subbands)) < 0 ||
+ (ret = decode_gainc_levels(gb, ctx, ch_num, coded_subbands)) < 0 ||
+ (ret = decode_gainc_loc_codes(gb, ctx, ch_num, coded_subbands, avctx)) < 0)
+ return ret;
+
+ if (coded_subbands > 0) { /* propagate gain data if requested */
+ for (sb = coded_subbands; sb < ctx->channels[ch_num].num_gain_subbands; sb++)
+ ctx->channels[ch_num].gain_data[sb] =
+ ctx->channels[ch_num].gain_data[sb - 1];
+ }
+ } else {
+ ctx->channels[ch_num].num_gain_subbands = 0;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * Decode envelope for all tones of a channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] band_has_tones ptr to an array of per-band-flags:
+ * 1 - tone data present
+ */
+static void decode_tones_envelope(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, int band_has_tones[])
+{
+ int sb;
+ Atrac3pWavesData *dst = ctx->channels[ch_num].tones_info;
+ Atrac3pWavesData *ref = ctx->channels[0].tones_info;
+
+ if (!ch_num || !get_bits1(gb)) { /* mode 0: fixed-length coding */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
+ if (!band_has_tones[sb])
+ continue;
+ dst[sb].pend_env.has_start_point = get_bits1(gb);
+ dst[sb].pend_env.start_pos = dst[sb].pend_env.has_start_point
+ ? get_bits(gb, 5) : -1;
+ dst[sb].pend_env.has_stop_point = get_bits1(gb);
+ dst[sb].pend_env.stop_pos = dst[sb].pend_env.has_stop_point
+ ? get_bits(gb, 5) : 32;
+ }
+ } else { /* mode 1(slave only): copy master */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
+ if (!band_has_tones[sb])
+ continue;
+ dst[sb].pend_env.has_start_point = ref[sb].pend_env.has_start_point;
+ dst[sb].pend_env.has_stop_point = ref[sb].pend_env.has_stop_point;
+ dst[sb].pend_env.start_pos = ref[sb].pend_env.start_pos;
+ dst[sb].pend_env.stop_pos = ref[sb].pend_env.stop_pos;
+ }
+ }
+}
+
+/**
+ * Decode number of tones for each subband of a channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] band_has_tones ptr to an array of per-band-flags:
+ * 1 - tone data present
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_band_numwavs(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, int band_has_tones[],
+ AVCodecContext *avctx)
+{
+ int mode, sb, delta;
+ Atrac3pWavesData *dst = ctx->channels[ch_num].tones_info;
+ Atrac3pWavesData *ref = ctx->channels[0].tones_info;
+
+ mode = get_bits(gb, ch_num + 1);
+ switch (mode) {
+ case 0: /** fixed-length coding */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++)
+ if (band_has_tones[sb])
+ dst[sb].num_wavs = get_bits(gb, 4);
+ break;
+ case 1: /** variable-length coding */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++)
+ if (band_has_tones[sb])
+ dst[sb].num_wavs =
+ get_vlc2(gb, tone_vlc_tabs[1].table,
+ tone_vlc_tabs[1].bits, 1);
+ break;
+ case 2: /** VLC modulo delta to master (slave only) */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++)
+ if (band_has_tones[sb]) {
+ delta = get_vlc2(gb, tone_vlc_tabs[2].table,
+ tone_vlc_tabs[2].bits, 1);
+ delta = sign_extend(delta, 3);
+ dst[sb].num_wavs = (ref[sb].num_wavs + delta) & 0xF;
+ }
+ break;
+ case 3: /** copy master (slave only) */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++)
+ if (band_has_tones[sb])
+ dst[sb].num_wavs = ref[sb].num_wavs;
+ break;
+ }
+
+ /** initialize start tone index for each subband */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++)
+ if (band_has_tones[sb]) {
+ if (ctx->waves_info->tones_index + dst[sb].num_wavs > 48) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Too many tones: %d (max. 48), frame: %d!\n",
+ ctx->waves_info->tones_index + dst[sb].num_wavs,
+ avctx->frame_number);
+ return AVERROR_INVALIDDATA;
+ }
+ dst[sb].start_index = ctx->waves_info->tones_index;
+ ctx->waves_info->tones_index += dst[sb].num_wavs;
+ }
+
+ return 0;
+}
+
+/**
+ * Decode frequency information for each subband of a channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] band_has_tones ptr to an array of per-band-flags:
+ * 1 - tone data present
+ */
+static void decode_tones_frequency(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, int band_has_tones[])
+{
+ int sb, i, direction, nbits, pred, delta;
+ Atrac3pWaveParam *iwav, *owav;
+ Atrac3pWavesData *dst = ctx->channels[ch_num].tones_info;
+ Atrac3pWavesData *ref = ctx->channels[0].tones_info;
+
+ if (!ch_num || !get_bits1(gb)) { /* mode 0: fixed-length coding */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
+ if (!band_has_tones[sb] || !dst[sb].num_wavs)
+ continue;
+ iwav = &ctx->waves_info->waves[dst[sb].start_index];
+ direction = (dst[sb].num_wavs > 1) ? get_bits1(gb) : 0;
+ if (direction) { /** packed numbers in descending order */
+ if (dst[sb].num_wavs)
+ iwav[dst[sb].num_wavs - 1].freq_index = get_bits(gb, 10);
+ for (i = dst[sb].num_wavs - 2; i >= 0 ; i--) {
+ nbits = av_log2(iwav[i+1].freq_index) + 1;
+ iwav[i].freq_index = get_bits(gb, nbits);
+ }
+ } else { /** packed numbers in ascending order */
+ for (i = 0; i < dst[sb].num_wavs; i++) {
+ if (!i || iwav[i - 1].freq_index < 512)
+ iwav[i].freq_index = get_bits(gb, 10);
+ else {
+ nbits = av_log2(1023 - iwav[i - 1].freq_index) + 1;
+ iwav[i].freq_index = get_bits(gb, nbits) +
+ 1024 - (1 << nbits);
+ }
+ }
+ }
+ }
+ } else { /* mode 1: VLC modulo delta to master (slave only) */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
+ if (!band_has_tones[sb] || !dst[sb].num_wavs)
+ continue;
+ iwav = &ctx->waves_info->waves[ref[sb].start_index];
+ owav = &ctx->waves_info->waves[dst[sb].start_index];
+ for (i = 0; i < dst[sb].num_wavs; i++) {
+ delta = get_vlc2(gb, tone_vlc_tabs[6].table,
+ tone_vlc_tabs[6].bits, 1);
+ delta = sign_extend(delta, 8);
+ pred = (i < ref[sb].num_wavs) ? iwav[i].freq_index :
+ (ref[sb].num_wavs ? iwav[ref[sb].num_wavs - 1].freq_index : 0);
+ owav[i].freq_index = (pred + delta) & 0x3FF;
+ }
+ }
+ }
+}
+
+/**
+ * Decode amplitude information for each subband of a channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] band_has_tones ptr to an array of per-band-flags:
+ * 1 - tone data present
+ */
+static void decode_tones_amplitude(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, int band_has_tones[])
+{
+ int mode, sb, j, i, diff, maxdiff, fi, delta, pred;
+ Atrac3pWaveParam *wsrc, *wref;
+ int refwaves[48];
+ Atrac3pWavesData *dst = ctx->channels[ch_num].tones_info;
+ Atrac3pWavesData *ref = ctx->channels[0].tones_info;
+
+ if (ch_num) {
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
+ if (!band_has_tones[sb] || !dst[sb].num_wavs)
+ continue;
+ wsrc = &ctx->waves_info->waves[dst[sb].start_index];
+ wref = &ctx->waves_info->waves[ref[sb].start_index];
+ for (j = 0; j < dst[sb].num_wavs; j++) {
+ for (i = 0, fi = 0, maxdiff = 1024; i < ref[sb].num_wavs; i++) {
+ diff = FFABS(wsrc[j].freq_index - wref[i].freq_index);
+ if (diff < maxdiff) {
+ maxdiff = diff;
+ fi = i;
+ }
+ }
+
+ if (maxdiff < 8)
+ refwaves[dst[sb].start_index + j] = fi + ref[sb].start_index;
+ else if (j < ref[sb].num_wavs)
+ refwaves[dst[sb].start_index + j] = j + ref[sb].start_index;
+ else
+ refwaves[dst[sb].start_index + j] = -1;
+ }
+ }
+ }
+
+ mode = get_bits(gb, ch_num + 1);
+
+ switch (mode) {
+ case 0: /** fixed-length coding */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
+ if (!band_has_tones[sb] || !dst[sb].num_wavs)
+ continue;
+ if (ctx->waves_info->amplitude_mode)
+ for (i = 0; i < dst[sb].num_wavs; i++)
+ ctx->waves_info->waves[dst[sb].start_index + i].amp_sf = get_bits(gb, 6);
+ else
+ ctx->waves_info->waves[dst[sb].start_index].amp_sf = get_bits(gb, 6);
+ }
+ break;
+ case 1: /** min + VLC delta */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
+ if (!band_has_tones[sb] || !dst[sb].num_wavs)
+ continue;
+ if (ctx->waves_info->amplitude_mode)
+ for (i = 0; i < dst[sb].num_wavs; i++)
+ ctx->waves_info->waves[dst[sb].start_index + i].amp_sf =
+ get_vlc2(gb, tone_vlc_tabs[3].table,
+ tone_vlc_tabs[3].bits, 1) + 20;
+ else
+ ctx->waves_info->waves[dst[sb].start_index].amp_sf =
+ get_vlc2(gb, tone_vlc_tabs[4].table,
+ tone_vlc_tabs[4].bits, 1) + 24;
+ }
+ break;
+ case 2: /** VLC modulo delta to master (slave only) */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
+ if (!band_has_tones[sb] || !dst[sb].num_wavs)
+ continue;
+ for (i = 0; i < dst[sb].num_wavs; i++) {
+ delta = get_vlc2(gb, tone_vlc_tabs[5].table,
+ tone_vlc_tabs[5].bits, 1);
+ delta = sign_extend(delta, 5);
+ pred = refwaves[dst[sb].start_index + i] >= 0 ?
+ ctx->waves_info->waves[refwaves[dst[sb].start_index + i]].amp_sf : 34;
+ ctx->waves_info->waves[dst[sb].start_index + i].amp_sf = (pred + delta) & 0x3F;
+ }
+ }
+ break;
+ case 3: /** clone master (slave only) */
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
+ if (!band_has_tones[sb])
+ continue;
+ for (i = 0; i < dst[sb].num_wavs; i++)
+ ctx->waves_info->waves[dst[sb].start_index + i].amp_sf =
+ refwaves[dst[sb].start_index + i] >= 0
+ ? ctx->waves_info->waves[refwaves[dst[sb].start_index + i]].amp_sf
+ : 32;
+ }
+ break;
+ }
+}
+
+/**
+ * Decode phase information for each subband of a channel.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] ch_num channel to process
+ * @param[in] band_has_tones ptr to an array of per-band-flags:
+ * 1 - tone data present
+ */
+static void decode_tones_phase(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int ch_num, int band_has_tones[])
+{
+ int sb, i;
+ Atrac3pWaveParam *wparam;
+ Atrac3pWavesData *dst = ctx->channels[ch_num].tones_info;
+
+ for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
+ if (!band_has_tones[sb])
+ continue;
+ wparam = &ctx->waves_info->waves[dst[sb].start_index];
+ for (i = 0; i < dst[sb].num_wavs; i++)
+ wparam[i].phase_index = get_bits(gb, 5);
+ }
+}
+
+/**
+ * Decode tones info for all channels.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] num_channels number of channels to process
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+static int decode_tones_info(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int num_channels, AVCodecContext *avctx)
+{
+ int ch_num, i, ret;
+ int band_has_tones[16];
+
+ for (ch_num = 0; ch_num < num_channels; ch_num++)
+ memset(ctx->channels[ch_num].tones_info, 0,
+ sizeof(*ctx->channels[ch_num].tones_info) * ATRAC3P_SUBBANDS);
+
+ ctx->waves_info->tones_present = get_bits1(gb);
+ if (!ctx->waves_info->tones_present)
+ return 0;
+
+ memset(ctx->waves_info->waves, 0, sizeof(ctx->waves_info->waves));
+
+ ctx->waves_info->amplitude_mode = get_bits1(gb);
+ if (!ctx->waves_info->amplitude_mode) {
+ avpriv_report_missing_feature(avctx, "GHA amplitude mode 0");
+ return AVERROR_PATCHWELCOME;
+ }
+
+ ctx->waves_info->num_tone_bands =
+ get_vlc2(gb, tone_vlc_tabs[0].table,
+ tone_vlc_tabs[0].bits, 1) + 1;
+
+ if (num_channels == 2) {
+ get_subband_flags(gb, ctx->waves_info->tone_sharing, ctx->waves_info->num_tone_bands);
+ get_subband_flags(gb, ctx->waves_info->tone_master, ctx->waves_info->num_tone_bands);
+ if (get_subband_flags(gb, ctx->waves_info->phase_shift,
+ ctx->waves_info->num_tone_bands)) {
+ avpriv_report_missing_feature(avctx, "GHA Phase shifting");
+ return AVERROR_PATCHWELCOME;
+ }
+ }
+
+ ctx->waves_info->tones_index = 0;
+
+ for (ch_num = 0; ch_num < num_channels; ch_num++) {
+ for (i = 0; i < ctx->waves_info->num_tone_bands; i++)
+ band_has_tones[i] = !ch_num ? 1 : !ctx->waves_info->tone_sharing[i];
+
+ decode_tones_envelope(gb, ctx, ch_num, band_has_tones);
+ if ((ret = decode_band_numwavs(gb, ctx, ch_num, band_has_tones,
+ avctx)) < 0)
+ return ret;
+
+ decode_tones_frequency(gb, ctx, ch_num, band_has_tones);
+ decode_tones_amplitude(gb, ctx, ch_num, band_has_tones);
+ decode_tones_phase(gb, ctx, ch_num, band_has_tones);
+ }
+
+ if (num_channels == 2) {
+ for (i = 0; i < ctx->waves_info->num_tone_bands; i++) {
+ if (ctx->waves_info->tone_sharing[i])
+ ctx->channels[1].tones_info[i] = ctx->channels[0].tones_info[i];
+
+ if (ctx->waves_info->tone_master[i])
+ FFSWAP(Atrac3pWavesData, ctx->channels[0].tones_info[i],
+ ctx->channels[1].tones_info[i]);
+ }
+ }
+
+ return 0;
+}
+
+int ff_atrac3p_decode_channel_unit(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int num_channels, AVCodecContext *avctx)
+{
+ int ret;
+
+ /* parse sound header */
+ ctx->num_quant_units = get_bits(gb, 5) + 1;
+ if (ctx->num_quant_units > 28 && ctx->num_quant_units < 32) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid number of quantization units: %d!\n",
+ ctx->num_quant_units);
+ return AVERROR_INVALIDDATA;
+ }
+
+ ctx->mute_flag = get_bits1(gb);
+
+ /* decode various sound parameters */
+ if ((ret = decode_quant_wordlen(gb, ctx, num_channels, avctx)) < 0)
+ return ret;
+
+ ctx->num_subbands = atrac3p_qu_to_subband[ctx->num_quant_units - 1] + 1;
+ ctx->num_coded_subbands = ctx->used_quant_units
+ ? atrac3p_qu_to_subband[ctx->used_quant_units - 1] + 1
+ : 0;
+
+ if ((ret = decode_scale_factors(gb, ctx, num_channels, avctx)) < 0)
+ return ret;
+
+ if ((ret = decode_code_table_indexes(gb, ctx, num_channels, avctx)) < 0)
+ return ret;
+
+ decode_spectrum(gb, ctx, num_channels, avctx);
+
+ if (num_channels == 2) {
+ get_subband_flags(gb, ctx->swap_channels, ctx->num_coded_subbands);
+ get_subband_flags(gb, ctx->negate_coeffs, ctx->num_coded_subbands);
+ }
+
+ decode_window_shape(gb, ctx, num_channels);
+
+ if ((ret = decode_gainc_data(gb, ctx, num_channels, avctx)) < 0)
+ return ret;
+
+ if ((ret = decode_tones_info(gb, ctx, num_channels, avctx)) < 0)
+ return ret;
+
+ /* decode global noise info */
+ ctx->noise_present = get_bits1(gb);
+ if (ctx->noise_present) {
+ ctx->noise_level_index = get_bits(gb, 4);
+ ctx->noise_table_index = get_bits(gb, 4);
+ }
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac3plus.h b/chromium/third_party/ffmpeg/libavcodec/atrac3plus.h
new file mode 100644
index 00000000000..1b001fae6d6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac3plus.h
@@ -0,0 +1,240 @@
+/*
+ * ATRAC3+ compatible decoder
+ *
+ * Copyright (c) 2010-2013 Maxim Poliakovski
+ *
+ * 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
+ * Global structures, constants and data for ATRAC3+ decoder.
+ */
+
+#ifndef AVCODEC_ATRAC3PLUS_H
+#define AVCODEC_ATRAC3PLUS_H
+
+#include <stdint.h>
+
+#include "libavutil/float_dsp.h"
+#include "atrac.h"
+#include "avcodec.h"
+#include "fft.h"
+#include "get_bits.h"
+
+/** Global unit sizes */
+#define ATRAC3P_SUBBANDS 16 ///< number of PQF subbands
+#define ATRAC3P_SUBBAND_SAMPLES 128 ///< number of samples per subband
+#define ATRAC3P_FRAME_SAMPLES (ATRAC3P_SUBBAND_SAMPLES * ATRAC3P_SUBBANDS)
+
+#define ATRAC3P_PQF_FIR_LEN 12 ///< length of the prototype FIR of the PQF
+
+/** Global constants */
+#define ATRAC3P_POWER_COMP_OFF 15 ///< disable power compensation
+
+/** ATRAC3+ channel unit types */
+enum Atrac3pChannelUnitTypes {
+ CH_UNIT_MONO = 0, ///< unit containing one coded channel
+ CH_UNIT_STEREO = 1, ///< unit containing two jointly-coded channels
+ CH_UNIT_EXTENSION = 2, ///< unit containing extension information
+ CH_UNIT_TERMINATOR = 3 ///< unit sequence terminator
+};
+
+/** Per-channel IPQF history */
+typedef struct Atrac3pIPQFChannelCtx {
+ DECLARE_ALIGNED(32, float, buf1)[ATRAC3P_PQF_FIR_LEN * 2][8];
+ DECLARE_ALIGNED(32, float, buf2)[ATRAC3P_PQF_FIR_LEN * 2][8];
+ int pos;
+} Atrac3pIPQFChannelCtx;
+
+/** Amplitude envelope of a group of sine waves */
+typedef struct Atrac3pWaveEnvelope {
+ int has_start_point; ///< indicates start point within the GHA window
+ int has_stop_point; ///< indicates stop point within the GHA window
+ int start_pos; ///< start position expressed in n*4 samples
+ int stop_pos; ///< stop position expressed in n*4 samples
+} Atrac3pWaveEnvelope;
+
+/** Parameters of a group of sine waves */
+typedef struct Atrac3pWavesData {
+ Atrac3pWaveEnvelope pend_env; ///< pending envelope from the previous frame
+ Atrac3pWaveEnvelope curr_env; ///< group envelope from the current frame
+ int num_wavs; ///< number of sine waves in the group
+ int start_index; ///< start index into global tones table for that subband
+} Atrac3pWavesData;
+
+/** Parameters of a single sine wave */
+typedef struct Atrac3pWaveParam {
+ int freq_index; ///< wave frequency index
+ int amp_sf; ///< quantized amplitude scale factor
+ int amp_index; ///< quantized amplitude index
+ int phase_index; ///< quantized phase index
+} Atrac3pWaveParam;
+
+/** Sound channel parameters */
+typedef struct Atrac3pChanParams {
+ int ch_num;
+ int num_coded_vals; ///< number of transmitted quant unit values
+ int fill_mode;
+ int split_point;
+ int table_type; ///< table type: 0 - tone?, 1- noise?
+ int qu_wordlen[32]; ///< array of word lengths for each quant unit
+ int qu_sf_idx[32]; ///< array of scale factor indexes for each quant unit
+ int qu_tab_idx[32]; ///< array of code table indexes for each quant unit
+ int16_t spectrum[2048]; ///< decoded IMDCT spectrum
+ uint8_t power_levs[5]; ///< power compensation levels
+
+ /* imdct window shape history (2 frames) for overlapping. */
+ uint8_t wnd_shape_hist[2][ATRAC3P_SUBBANDS]; ///< IMDCT window shape, 0=sine/1=steep
+ uint8_t *wnd_shape; ///< IMDCT window shape for current frame
+ uint8_t *wnd_shape_prev; ///< IMDCT window shape for previous frame
+
+ /* gain control data history (2 frames) for overlapping. */
+ AtracGainInfo gain_data_hist[2][ATRAC3P_SUBBANDS]; ///< gain control data for all subbands
+ AtracGainInfo *gain_data; ///< gain control data for next frame
+ AtracGainInfo *gain_data_prev; ///< gain control data for previous frame
+ int num_gain_subbands; ///< number of subbands with gain control data
+
+ /* tones data history (2 frames) for overlapping. */
+ Atrac3pWavesData tones_info_hist[2][ATRAC3P_SUBBANDS];
+ Atrac3pWavesData *tones_info;
+ Atrac3pWavesData *tones_info_prev;
+} Atrac3pChanParams;
+
+/* Per-unit sine wave parameters */
+typedef struct Atrac3pWaveSynthParams {
+ int tones_present; ///< 1 - tones info present
+ int amplitude_mode; ///< 1 - low range, 0 - high range
+ int num_tone_bands; ///< number of PQF bands with tones
+ uint8_t tone_sharing[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise tone sharing flags
+ uint8_t tone_master[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise tone channel swapping
+ uint8_t phase_shift[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise 180° phase shifting
+ int tones_index; ///< total sum of tones in this unit
+ Atrac3pWaveParam waves[48];
+} Atrac3pWaveSynthParams;
+
+/** Channel unit parameters */
+typedef struct Atrac3pChanUnitCtx {
+ /* channel unit variables */
+ int unit_type; ///< unit type (mono/stereo)
+ int num_quant_units;
+ int num_subbands;
+ int used_quant_units; ///< number of quant units with coded spectrum
+ int num_coded_subbands; ///< number of subbands with coded spectrum
+ int mute_flag; ///< mute flag
+ int use_full_table; ///< 1 - full table list, 0 - restricted one
+ int noise_present; ///< 1 - global noise info present
+ int noise_level_index; ///< global noise level index
+ int noise_table_index; ///< global noise RNG table index
+ uint8_t swap_channels[ATRAC3P_SUBBANDS]; ///< 1 - perform subband-wise channel swapping
+ uint8_t negate_coeffs[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise IMDCT coefficients negation
+ Atrac3pChanParams channels[2];
+
+ /* Variables related to GHA tones */
+ Atrac3pWaveSynthParams wave_synth_hist[2]; ///< waves synth history for two frames
+ Atrac3pWaveSynthParams *waves_info;
+ Atrac3pWaveSynthParams *waves_info_prev;
+
+ Atrac3pIPQFChannelCtx ipqf_ctx[2];
+ DECLARE_ALIGNED(32, float, prev_buf)[2][ATRAC3P_FRAME_SAMPLES]; ///< overlapping buffer
+} Atrac3pChanUnitCtx;
+
+/**
+ * Initialize VLC tables for bitstream parsing.
+ */
+void ff_atrac3p_init_vlcs(void);
+
+/**
+ * Decode bitstream data of a channel unit.
+ *
+ * @param[in] gb the GetBit context
+ * @param[in,out] ctx ptr to the channel unit context
+ * @param[in] num_channels number of channels to process
+ * @param[in] avctx ptr to the AVCodecContext
+ * @return result code: 0 = OK, otherwise - error code
+ */
+int ff_atrac3p_decode_channel_unit(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
+ int num_channels, AVCodecContext *avctx);
+
+/**
+ * Initialize IMDCT transform.
+ *
+ * @param[in] avctx ptr to the AVCodecContext
+ * @param[in] mdct_ctx pointer to MDCT transform context
+ */
+void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx);
+
+/**
+ * Initialize sine waves synthesizer.
+ */
+void ff_atrac3p_init_wave_synth(void);
+
+/**
+ * Synthesize sine waves for a particular subband.
+ *
+ * @param[in] ch_unit pointer to the channel unit context
+ * @param[in] fdsp pointer to float DSP context
+ * @param[in] ch_num which channel to process
+ * @param[in] sb which subband to process
+ * @param[out] out receives processed data
+ */
+void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *fdsp,
+ int ch_num, int sb, float *out);
+
+/**
+ * Perform power compensation aka noise dithering.
+ *
+ * @param[in] ctx ptr to the channel context
+ * @param[in] ch_index which channel to process
+ * @param[in,out] sp ptr to channel spectrum to process
+ * @param[in] rng_index indicates which RNG table to use
+ * @param[in] sb_num which subband to process
+ */
+void ff_atrac3p_power_compensation(Atrac3pChanUnitCtx *ctx, int ch_index,
+ float *sp, int rng_index, int sb_num);
+
+/**
+ * Regular IMDCT and windowing without overlapping,
+ * with spectrum reversal in the odd subbands.
+ *
+ * @param[in] fdsp pointer to float DSP context
+ * @param[in] mdct_ctx pointer to MDCT transform context
+ * @param[in] pIn float input
+ * @param[out] pOut float output
+ * @param[in] wind_id which MDCT window to apply
+ * @param[in] sb subband number
+ */
+void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, FFTContext *mdct_ctx, float *pIn,
+ float *pOut, int wind_id, int sb);
+
+/**
+ * Subband synthesis filter based on the polyphase quadrature (pseudo-QMF)
+ * filter bank.
+ *
+ * @param[in] dct_ctx ptr to the pre-initialized IDCT context
+ * @param[in,out] hist ptr to the filter history
+ * @param[in] in input data to process
+ * @param[out] out receives processed data
+ */
+void ff_atrac3p_ipqf(FFTContext *dct_ctx, Atrac3pIPQFChannelCtx *hist,
+ const float *in, float *out);
+
+extern const uint16_t ff_atrac3p_qu_to_spec_pos[33];
+extern const float ff_atrac3p_sf_tab[64];
+extern const float ff_atrac3p_mant_tab[8];
+
+#endif /* AVCODEC_ATRAC3PLUS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac3plus_data.h b/chromium/third_party/ffmpeg/libavcodec/atrac3plus_data.h
new file mode 100644
index 00000000000..2a107eef1fa
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac3plus_data.h
@@ -0,0 +1,1914 @@
+/*
+ * ATRAC3+ compatible decoder
+ *
+ * Copyright (c) 2010-2013 Maxim Poliakovski
+ *
+ * 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_ATRAC3PLUS_DATA_H
+#define AVCODEC_ATRAC3PLUS_DATA_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+/** VLC tables for wordlen */
+static const uint8_t atrac3p_wl_huff_code1[3] = { 0, 2, 3 };
+
+static const uint8_t atrac3p_wl_huff_bits1[3] = { 1, 2, 2 };
+
+static const uint8_t atrac3p_wl_huff_xlat1[3] = { 0, 1, 7 };
+
+static const uint8_t atrac3p_wl_huff_code2[5] = { 0, 4, 5, 6, 7 };
+
+static const uint8_t atrac3p_wl_huff_bits2[5] = { 1, 3, 3, 3, 3 };
+
+static const uint8_t atrac3p_wl_huff_xlat2[5] = { 0, 1, 2, 6, 7 };
+
+static const uint8_t atrac3p_wl_huff_code3[8] = {
+ 0, 4, 0xC, 0x1E, 0x1F, 0xD, 0xE, 5
+};
+
+static const uint8_t atrac3p_wl_huff_bits3[8] = { 1, 3, 4, 5, 5, 4, 4, 3 };
+
+static const uint8_t atrac3p_wl_huff_code4[8] = {
+ 0, 4, 0xC, 0xD, 0x1E, 0x1F, 0xE, 5
+};
+
+static const uint8_t atrac3p_wl_huff_bits4[8] = { 1, 3, 4, 4, 5, 5, 4, 3 };
+
+/** VLC tables for scale factor indexes */
+static const uint16_t atrac3p_sf_huff_code1[64] = {
+ 0, 2, 3, 4, 5, 0xC, 0xD, 0xE0,
+ 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0x1CE, 0x1CF,
+ 0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x1D4, 0x1D5, 0x1D6, 0x1D7,
+ 0x1D8, 0x1D9, 0x1DA, 0x1DB, 0x1DC, 0x1DD, 0x1DE, 0x1DF,
+ 0x1E0, 0x1E1, 0x1E2, 0x1E3, 0x1E4, 0x1E5, 0x1E6, 0x1E7,
+ 0x1E8, 0x1E9, 0x1EA, 0x1EB, 0x1EC, 0x1ED, 0x1EE, 0x1EF,
+ 0x1F0, 0x1F1, 0x1F2, 0x1F3, 0x1F4, 0x1F5, 0x1F6, 0x1F7,
+ 0x1F8, 0x1F9, 0x1FA, 0x1FB, 0x1FC, 0x1FD, 0x1FE, 0x1FF
+};
+
+static const uint8_t atrac3p_sf_huff_bits1[64] = {
+ 2, 3, 3, 3, 3, 4, 4, 8, 8, 8, 8, 8, 8, 8, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
+};
+
+static const uint8_t atrac3p_sf_huff_xlat1[64] = {
+ 0, 1, 61, 62, 63, 2, 60, 3, 4, 5, 6, 57, 58, 59, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56
+};
+
+static const uint8_t atrac3p_sf_huff_xlat2[64] = {
+ 0, 1, 2, 62, 63, 3, 61, 4, 5, 6, 57, 58, 59, 60, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56
+};
+
+static const uint16_t atrac3p_sf_huff_code2[64] = {
+ 0, 4, 0x18, 0x19, 0x70, 0x1CA, 0x1CB, 0x1CC,
+ 0x1CD, 0x1CE, 0x1CF, 0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x1D4,
+ 0x1D5, 0x1D6, 0x1D7, 0x1D8, 0x1D9, 0x1DA, 0x1DB, 0x1DC,
+ 0x1DD, 0x1DE, 0x1DF, 0x1E0, 0x1E1, 0x1E2, 0x1E3, 0x1E4,
+ 0x1E5, 0x1E6, 0x1E7, 0x1E8, 0x1E9, 0x1EA, 0x1EB, 0x1EC,
+ 0x1ED, 0x1EE, 0x1EF, 0x1F0, 0x1F1, 0x1F2, 0x1F3, 0x1F4,
+ 0x1F5, 0x1F6, 0x1F7, 0x1F8, 0x1F9, 0x1FA, 0x1FB, 0x1FC,
+ 0x1FD, 0x1FE, 0x1FF, 0xE4, 0x71, 0x1A, 0x1B, 5
+};
+
+static const uint8_t atrac3p_sf_huff_bits2[64] = {
+ 1, 3, 5, 5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 7, 5, 5, 3
+};
+
+static const uint16_t atrac3p_sf_huff_code3[64] = {
+ 0, 2, 3, 0x18, 0x19, 0x70, 0x1CC, 0x1CD,
+ 0x1CE, 0x1CF, 0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x1D4, 0x1D5,
+ 0x1D6, 0x1D7, 0x1D8, 0x1D9, 0x1DA, 0x1DB, 0x1DC, 0x1DD,
+ 0x1DE, 0x1DF, 0x1E0, 0x1E1, 0x1E2, 0x1E3, 0x1E4, 0x1E5,
+ 0x1E6, 0x1E7, 0x1E8, 0x1E9, 0x1EA, 0x1EB, 0x1EC, 0x1ED,
+ 0x1EE, 0x1EF, 0x1F0, 0x1F1, 0x1F2, 0x1F3, 0x1F4, 0x1F5,
+ 0x1F6, 0x1F7, 0x1F8, 0x1F9, 0x1FA, 0x1FB, 0x1FC, 0x1FD,
+ 0x1FE, 0x1FF, 0x71, 0x72, 0x1A, 0x1B, 4, 5
+};
+
+static const uint8_t atrac3p_sf_huff_bits3[64] = {
+ 2, 3, 3, 5, 5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 5, 5, 3, 3
+};
+
+static const uint16_t atrac3p_sf_huff_code4[16] = {
+ 0, 2, 3, 4, 5, 0xC, 0xD, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0, 0x3D, 0x3E, 0x3F
+};
+
+static const uint8_t atrac3p_sf_huff_bits4[16] = {
+ 2, 3, 3, 3, 3, 4, 4, 6, 6, 6, 6, 6, 0, 6, 6, 6
+};
+
+static const uint8_t atrac3p_sf_huff_xlat4[16] = {
+ 0, 1, 13, 14, 15, 2, 12, 3, 4, 5, 6, 7, 8, 9, 10, 11
+};
+
+static const uint8_t atrac3p_sf_huff_xlat5[16] = {
+ 0, 1, 2, 14, 15, 3, 13, 4, 5, 6, 7, 9, 8, 10, 11, 12
+};
+
+static const uint16_t atrac3p_sf_huff_code5[16] = {
+ 0, 4, 0xC, 0x1C, 0x78, 0x79, 0x7A, 0x7B,
+ 0, 0x7C, 0x7D, 0x7E, 0x7F, 0x1D, 0xD, 5
+};
+
+static const uint8_t atrac3p_sf_huff_bits5[16] = {
+ 1, 3, 4, 5, 7, 7, 7, 7, 0, 7, 7, 7, 7, 5, 4, 3
+};
+
+static const uint16_t atrac3p_sf_huff_code6[16] = {
+ 0, 2, 3, 0xC, 0x1C, 0x3C, 0x7C, 0x7D, 0, 0x7E, 0x7F, 0x3D, 0x1D, 0xD, 4, 5
+};
+
+static const uint8_t atrac3p_sf_huff_bits6[16] = {
+ 2, 3, 3, 4, 5, 6, 7, 7, 0, 7, 7, 6, 5, 4, 3, 3
+};
+
+/** VLC tables for code table indexes */
+static const uint8_t atrac3p_ct_huff_code1[4] = { 0, 2, 6, 7 };
+
+static const uint8_t atrac3p_ct_huff_bits1[4] = { 1, 2, 3, 3 };
+
+static const uint8_t atrac3p_ct_huff_code2[8] = { 0, 2, 3, 4, 5, 6, 0xE, 0xF };
+
+static const uint8_t atrac3p_ct_huff_bits2[8] = { 2, 3, 3, 3, 3, 3, 4, 4 };
+
+static const uint8_t atrac3p_ct_huff_xlat1[8] = { 0, 1, 2, 3, 6, 7, 4, 5 };
+
+static const uint8_t atrac3p_ct_huff_code3[8] = {
+ 0, 4, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF
+};
+
+static const uint8_t atrac3p_ct_huff_bits3[8] = { 1, 3, 4, 4, 4, 4, 4, 4 };
+
+/* weights for quantized word lengths */
+static const int8_t atrac3p_wl_weights[6][32] = {
+ { 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 },
+ { 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 2, 2, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+/* weights for quantized scale factors
+ * sf_weights[i] = i / (tab_idx + 1)
+ * where tab_idx = [1,2] */
+static const int8_t atrac3p_sf_weights[2][32] = {
+ { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,
+ 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15 },
+ { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5,
+ 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10 }
+};
+
+/** Ungroup table for word length segments.
+ * Numbers in this table tell which coeff belongs to which segment. */
+static const uint8_t atrac3p_qu_num_to_seg[32] = {
+ 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5,
+ 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9
+};
+
+/** Map quant unit number to subband number */
+static const uint8_t atrac3p_qu_to_subband[32] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
+ 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
+};
+
+/** Map subband number to number of power compensation groups */
+static const int atrac3p_subband_to_num_powgrps[16] = {
+ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5
+};
+
+/** 3D base shape tables. The values are grouped together as follows:
+ * [num_start_values = 8][num_shape_tables = 16][num_seg_coeffs = 9]
+ * For each of the 8 start values there are 16 different shapes each
+ * 9 coefficients long. */
+static const int8_t atrac3p_wl_shapes[8][16][9] = {
+ { { 0, 0, 0, 0, 0, 0, 0, -2, -1 },
+ { 0, 0, 0, 0, 0, 0, 0, -5, -1 },
+ { 0, 0, 0, -7, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, -7, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, -5, 0, 0 },
+ { 0, 0, 0, 0, -5, 0, 0, 0, 0 },
+ { -7, -7, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, -7, 0, 0, 0, 0, 0, 0, 0 },
+ { -2, -2, -5, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, -2, -5, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, -2, -5, 0, 0 },
+ { 0, 0, 0, -5, 0, 0, 0, 0, 0 },
+ { 0, -2, -7, -2, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, -2, -5, 0, 0, 0 },
+ { 0, 0, 0, -5, -5, 0, 0, 0, 0 },
+ { 0, 0, 0, -5, -2, 0, 0, 0, 0 } },
+ { { -1, -5, -3, -2, -1, -1, 0, 0, 0 },
+ { -2, -5, -3, -3, -2, -1, -1, 0, 0 },
+ { 0, -1, -1, -1, 0, 0, 0, 0, 0 },
+ { -1, -3, 0, 0, 0, 0, 0, 0, 0 },
+ { -1, -2, 0, 0, 0, 0, 0, 0, 0 },
+ { -1, -3, -1, 0, 0, 0, 0, 1, 1 },
+ { -1, -5, -3, -3, -2, -1, 0, 0, 0 },
+ { -1, -1, -4, -2, -2, -1, -1, 0, 0 },
+ { -1, -1, -3, -2, -3, -1, -1, -1, 0 },
+ { -1, -4, -2, -3, -1, 0, 0, 0, 0 },
+ { 0, -1, -2, -2, -1, -1, 0, 0, 0 },
+ { 0, -2, -1, 0, 0, 0, 0, 0, 0 },
+ { -1, -1, 0, 0, 0, 0, 0, 0, 0 },
+ { -1, -1, -3, -2, -2, -1, -1, -1, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, -1, -3, -2, -2, -1, -1, -1, 0 }, },
+ { { -1, -2, 0, 1, 1, 1, 1, 1, 1 },
+ { 0, -1, 1, 1, 1, 1, 1, 1, 1 },
+ { 0, -2, 1, 1, 1, 1, 1, 1, 1 },
+ { 0, -2, 0, 1, 1, 1, 1, 1, 1 },
+ { -1, -1, 0, 1, 1, 1, 1, 1, 1 },
+ { 0, 0, -1, 0, 1, 1, 1, 1, 1 },
+ { -1, -1, 1, 1, 1, 1, 1, 1, 1 },
+ { 0, 0, -1, 1, 1, 1, 1, 1, 1 },
+ { 0, -1, 0, 1, 1, 1, 1, 1, 1 },
+ { -1, -1, -1, 1, 1, 1, 1, 1, 1 },
+ { 0, 0, 0, 0, 1, 1, 1, 1, 1 },
+ { 0, 0, 0, 1, 1, 1, 1, 1, 1 },
+ { 0, -1, -1, 1, 1, 1, 1, 1, 1 },
+ { 0, 1, 0, 1, 1, 1, 1, 1, 1 },
+ { 0, -3, -2, 1, 1, 1, 1, 2, 2 },
+ { -3, -5, -3, 2, 2, 2, 2, 2, 2 }, },
+ { { -1, -2, 0, 2, 2, 2, 2, 2, 2 },
+ { -1, -2, 0, 1, 2, 2, 2, 2, 2 },
+ { 0, -2, 0, 2, 2, 2, 2, 2, 2 },
+ { -1, 0, 1, 2, 2, 2, 2, 2, 2 },
+ { 0, 0, 1, 2, 2, 2, 2, 2, 2 },
+ { 0, -2, 0, 1, 2, 2, 2, 2, 2 },
+ { 0, -1, 1, 2, 2, 2, 2, 2, 2 },
+ { -1, -1, 0, 2, 2, 2, 2, 2, 2 },
+ { -1, -1, 0, 1, 2, 2, 2, 2, 2 },
+ { -1, -2, -1, 2, 2, 2, 2, 2, 2 },
+ { 0, -1, 0, 2, 2, 2, 2, 2, 2 },
+ { 1, 1, 0, 1, 2, 2, 2, 2, 2 },
+ { 0, 1, 2, 2, 2, 2, 2, 2, 2 },
+ { 1, 0, 0, 1, 2, 2, 2, 2, 2 },
+ { 0, 0, 0, 1, 2, 2, 2, 2, 2 },
+ { -1, -1, -1, 1, 2, 2, 2, 2, 2 }, },
+ { { 0, 1, 2, 3, 3, 3, 3, 3, 3 },
+ { 1, 1, 2, 3, 3, 3, 3, 3, 3 },
+ { -1, 0, 1, 2, 3, 3, 3, 3, 3 },
+ { 0, 0, 2, 3, 3, 3, 3, 3, 3 },
+ { -1, 0, 1, 3, 3, 3, 3, 3, 3 },
+ { 0, 0, 1, 3, 3, 3, 3, 3, 3 },
+ { 1, 2, 3, 3, 3, 3, 3, 3, 3 },
+ { 1, 2, 2, 3, 3, 3, 3, 3, 3 },
+ { 0, 1, 1, 3, 3, 3, 3, 3, 3 },
+ { 0, 0, 1, 2, 3, 3, 3, 3, 3 },
+ { -1, 1, 2, 3, 3, 3, 3, 3, 3 },
+ { -1, 0, 2, 3, 3, 3, 3, 3, 3 },
+ { 2, 2, 3, 3, 3, 3, 3, 3, 3 },
+ { 1, 1, 3, 3, 3, 3, 3, 3, 3 },
+ { 0, 2, 3, 3, 3, 3, 3, 3, 3 },
+ { 0, 1, 1, 2, 3, 3, 3, 3, 3 }, },
+ { { 0, 1, 2, 3, 4, 4, 4, 4, 4 },
+ { 1, 2, 3, 4, 4, 4, 4, 4, 4 },
+ { 0, 0, 2, 3, 4, 4, 4, 4, 4 },
+ { 1, 1, 2, 4, 4, 4, 4, 4, 4 },
+ { 0, 1, 2, 4, 4, 4, 4, 4, 4 },
+ { -1, 0, 1, 3, 4, 4, 4, 4, 4 },
+ { 0, 0, 1, 3, 4, 4, 4, 4, 4 },
+ { 1, 1, 2, 3, 4, 4, 4, 4, 4 },
+ { 0, 1, 1, 3, 4, 4, 4, 4, 4 },
+ { 2, 2, 3, 4, 4, 4, 4, 4, 4 },
+ { 1, 1, 3, 4, 4, 4, 4, 4, 4 },
+ { 1, 2, 2, 4, 4, 4, 4, 4, 4 },
+ { -1, 0, 2, 3, 4, 4, 4, 4, 4 },
+ { 0, 1, 3, 4, 4, 4, 4, 4, 4 },
+ { 1, 2, 2, 3, 4, 4, 4, 4, 4 },
+ { 0, 2, 3, 4, 4, 4, 4, 4, 4 }, },
+ { { 1, 2, 3, 4, 5, 5, 5, 5, 5 },
+ { 0, 1, 2, 3, 4, 5, 5, 5, 5 },
+ { 0, 1, 2, 3, 5, 5, 5, 5, 5 },
+ { 1, 1, 3, 4, 5, 5, 5, 5, 5 },
+ { 1, 1, 2, 4, 5, 5, 5, 5, 5 },
+ { 1, 2, 2, 4, 5, 5, 5, 5, 5 },
+ { 1, 1, 2, 3, 5, 5, 5, 5, 5 },
+ { 2, 2, 3, 4, 5, 5, 5, 5, 5 },
+ { 0, 1, 2, 4, 5, 5, 5, 5, 5 },
+ { 2, 2, 3, 5, 5, 5, 5, 5, 5 },
+ { 1, 2, 3, 5, 5, 5, 5, 5, 5 },
+ { 0, 1, 3, 4, 5, 5, 5, 5, 5 },
+ { 1, 2, 2, 3, 5, 5, 5, 5, 5 },
+ { 2, 3, 4, 5, 5, 5, 5, 5, 5 },
+ { 0, 2, 3, 4, 5, 5, 5, 5, 5 },
+ { 1, 1, 1, 3, 4, 5, 5, 5, 5 }, },
+ { { 1, 2, 3, 4, 5, 5, 5, 6, 6 },
+ { 1, 2, 3, 4, 5, 6, 6, 6, 6 },
+ { 2, 3, 4, 5, 6, 6, 6, 6, 6 },
+ { 1, 2, 3, 4, 6, 6, 6, 6, 6 },
+ { 2, 2, 3, 4, 5, 5, 5, 6, 6 },
+ { 1, 2, 3, 4, 5, 5, 6, 6, 6 },
+ { 2, 2, 3, 4, 6, 6, 6, 6, 6 },
+ { 2, 2, 3, 4, 5, 6, 6, 6, 6 },
+ { 2, 2, 4, 5, 6, 6, 6, 6, 6 },
+ { 2, 2, 3, 5, 6, 6, 6, 6, 6 },
+ { 1, 2, 3, 5, 6, 6, 6, 6, 6 },
+ { 2, 3, 3, 5, 6, 6, 6, 6, 6 },
+ { 1, 2, 4, 5, 6, 6, 6, 6, 6 },
+ { 2, 2, 3, 4, 5, 5, 6, 6, 6 },
+ { 2, 3, 3, 4, 6, 6, 6, 6, 6 },
+ { 1, 3, 4, 5, 6, 6, 6, 6, 6 } }
+};
+
+/** 2D base shape tables for scale factor coding.
+ * The values are grouped together as follows:
+ * [num_shape_tables = 64][num_seg_coeffs = 9] */
+static const int8_t atrac3p_sf_shapes[64][9] = {
+ { -3, -2, -1, 0, 3, 5, 6, 8, 40 },
+ { -3, -2, 0, 1, 7, 9, 11, 13, 20 },
+ { -1, 0, 0, 1, 6, 8, 10, 13, 41 },
+ { 0, 0, 0, 2, 5, 5, 6, 8, 14 },
+ { 0, 0, 0, 2, 6, 7, 8, 11, 47 },
+ { 0, 0, 1, 2, 5, 7, 8, 10, 32 },
+ { 0, 0, 1, 3, 8, 10, 12, 14, 47 },
+ { 0, 0, 2, 4, 9, 10, 12, 14, 40 },
+ { 0, 0, 3, 5, 9, 10, 12, 14, 22 },
+ { 0, 1, 3, 5, 10, 14, 18, 22, 31 },
+ { 0, 2, 5, 6, 10, 10, 10, 12, 46 },
+ { 0, 2, 5, 7, 12, 14, 15, 18, 44 },
+ { 1, 1, 4, 5, 7, 7, 8, 9, 15 },
+ { 1, 2, 2, 2, 4, 5, 7, 9, 26 },
+ { 1, 2, 2, 3, 6, 7, 7, 8, 47 },
+ { 1, 2, 2, 3, 6, 8, 10, 13, 22 },
+ { 1, 3, 4, 7, 13, 17, 21, 24, 41 },
+ { 1, 4, 0, 4, 10, 12, 13, 14, 17 },
+ { 2, 3, 3, 3, 6, 8, 10, 13, 48 },
+ { 2, 3, 3, 4, 9, 12, 14, 17, 47 },
+ { 2, 3, 3, 5, 10, 12, 14, 17, 25 },
+ { 2, 3, 5, 7, 8, 9, 9, 9, 13 },
+ { 2, 3, 5, 9, 16, 21, 25, 28, 33 },
+ { 2, 4, 5, 8, 12, 14, 17, 19, 26 },
+ { 2, 4, 6, 8, 12, 13, 13, 15, 20 },
+ { 2, 4, 7, 12, 20, 26, 30, 32, 35 },
+ { 3, 3, 5, 6, 12, 14, 16, 19, 34 },
+ { 3, 4, 4, 5, 7, 9, 10, 11, 48 },
+ { 3, 4, 5, 6, 8, 9, 10, 11, 16 },
+ { 3, 5, 5, 5, 7, 9, 10, 13, 35 },
+ { 3, 5, 5, 7, 10, 12, 13, 15, 49 },
+ { 3, 5, 7, 7, 8, 7, 9, 12, 21 },
+ { 3, 5, 7, 8, 12, 14, 15, 15, 24 },
+ { 3, 5, 7, 10, 16, 21, 24, 27, 44 },
+ { 3, 5, 8, 14, 21, 26, 28, 29, 42 },
+ { 3, 6, 10, 13, 18, 19, 20, 22, 27 },
+ { 3, 6, 11, 16, 24, 27, 28, 29, 31 },
+ { 4, 5, 4, 3, 4, 6, 8, 11, 18 },
+ { 4, 6, 5, 6, 9, 10, 12, 14, 20 },
+ { 4, 6, 7, 6, 6, 6, 7, 8, 46 },
+ { 4, 6, 7, 9, 13, 16, 18, 20, 48 },
+ { 4, 6, 7, 9, 14, 17, 20, 23, 31 },
+ { 4, 6, 9, 11, 14, 15, 15, 17, 21 },
+ { 4, 8, 13, 20, 27, 32, 35, 36, 38 },
+ { 5, 6, 6, 4, 5, 6, 7, 6, 6 },
+ { 5, 7, 7, 8, 9, 9, 10, 12, 49 },
+ { 5, 8, 9, 9, 10, 11, 12, 13, 42 },
+ { 5, 8, 10, 12, 15, 16, 17, 19, 42 },
+ { 5, 8, 12, 17, 26, 31, 32, 33, 44 },
+ { 5, 9, 13, 16, 20, 22, 23, 23, 35 },
+ { 6, 8, 8, 7, 6, 5, 6, 8, 15 },
+ { 6, 8, 8, 8, 9, 10, 12, 16, 24 },
+ { 6, 8, 8, 9, 10, 10, 11, 11, 13 },
+ { 6, 8, 10, 13, 19, 21, 24, 26, 32 },
+ { 6, 9, 10, 11, 13, 13, 14, 16, 49 },
+ { 7, 9, 9, 10, 13, 14, 16, 19, 27 },
+ { 7, 10, 12, 13, 16, 16, 17, 17, 27 },
+ { 7, 10, 12, 14, 17, 19, 20, 22, 48 },
+ { 8, 9, 10, 9, 10, 11, 11, 11, 19 },
+ { 8, 11, 12, 12, 13, 13, 13, 13, 17 },
+ { 8, 11, 13, 14, 16, 17, 19, 20, 27 },
+ { 8, 12, 17, 22, 26, 28, 29, 30, 33 },
+ { 10, 14, 16, 19, 21, 22, 22, 24, 28 },
+ { 10, 15, 17, 18, 21, 22, 23, 25, 43 }
+};
+
+static const uint8_t atrac3p_ct_restricted_to_full[2][7][4] = {
+ { { 0, 5, 4, 1 },
+ { 0, 1, 2, 3 },
+ { 3, 0, 4, 2 },
+ { 4, 0, 1, 2 },
+ { 1, 0, 4, 3 },
+ { 3, 0, 2, 1 },
+ { 0, 3, 1, 2 } },
+ { { 4, 0, 1, 2 },
+ { 0, 3, 2, 1 },
+ { 0, 1, 2, 3 },
+ { 0, 1, 2, 4 },
+ { 0, 1, 2, 3 },
+ { 1, 4, 2, 0 },
+ { 0, 1, 2, 3 } }
+};
+
+/** Tables for spectrum coding */
+static const uint8_t huff_a01_cb[14] = {
+ 1, 12, 1, 0, 0, 1, 7, 0, 19, 5, 13, 21, 6, 8
+};
+
+static const uint8_t huff_a01_xlat[81] = {
+ 0x00, 0x03, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x50, 0xD0, 0x70,
+ 0xF0, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0x41, 0xC1, 0x31, 0x05, 0x0D,
+ 0xC3, 0x13, 0x07, 0x0F, 0x44, 0xCC, 0x11, 0x43, 0x33, 0x54, 0x74, 0xDC,
+ 0xFC, 0x71, 0x15, 0x4D, 0xCD, 0x1D, 0xD3, 0xC7, 0x37, 0x3F, 0xD4, 0xF4,
+ 0x5C, 0x7C, 0x51, 0xD1, 0xF1, 0x45, 0xC5, 0x35, 0xDD, 0x3D, 0x53, 0x73,
+ 0xF3, 0x47, 0x17, 0x77, 0x4F, 0xCF, 0x1F, 0x55, 0xF5, 0x7D, 0xD7, 0x5F,
+ 0xFF, 0xD5, 0x75, 0x5D, 0xFD, 0x57, 0xF7, 0xDF, 0x7F
+};
+
+static const uint8_t huff_a02_cb[13] = {
+ 2, 12, 1, 0, 4, 11, 0, 1, 29, 6, 20, 7, 2
+};
+
+static const uint8_t huff_a02_xlat[81] = {
+ 0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51,
+ 0x05, 0x45, 0x15, 0x55, 0x90, 0x80, 0x20, 0x60, 0x84, 0x94, 0x24, 0x64,
+ 0x08, 0x48, 0x18, 0x58, 0x81, 0x91, 0x21, 0x85, 0x95, 0x65, 0x09, 0x49,
+ 0x19, 0x59, 0x02, 0x42, 0x12, 0x52, 0x06, 0x46, 0x16, 0x56, 0x88, 0x61,
+ 0x25, 0x29, 0x69, 0x5A, 0xA0, 0xA4, 0x98, 0x28, 0x68, 0xA1, 0xA5, 0x89,
+ 0x99, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x96, 0x26, 0x66, 0x0A, 0x4A, 0x1A,
+ 0xA8, 0x86, 0xA6, 0x8A, 0x9A, 0x2A, 0x6A, 0xA2, 0xAA
+};
+
+static const uint8_t huff_a03_cb[9] = { 3, 9, 1, 8, 0, 13, 18, 7, 2 };
+
+static const uint8_t huff_a03_xlat[49] = {
+ 0x00, 0x08, 0x38, 0x01, 0x09, 0x39, 0x07, 0x0F, 0x3F, 0x10, 0x30, 0x11,
+ 0x31, 0x02, 0x0A, 0x3A, 0x05, 0x06, 0x0E, 0x3E, 0x17, 0x37, 0x18, 0x28,
+ 0x19, 0x29, 0x2A, 0x32, 0x03, 0x0B, 0x33, 0x3B, 0x0D, 0x15, 0x3D, 0x16,
+ 0x1E, 0x36, 0x1F, 0x2F, 0x12, 0x1A, 0x13, 0x2B, 0x1D, 0x35, 0x2E, 0x1B,
+ 0x2D
+};
+
+static const uint8_t huff_a04_cb[4] = { 2, 3, 2, 4 };
+static const uint8_t huff_a04_xlat[6] = { 1, 2, 0, 3, 4, 5 };
+
+static const uint8_t huff_a05_cb[12] = {
+ 3, 12, 1, 3, 5, 8, 12, 23, 72, 68, 31, 2
+};
+
+static const uint8_t huff_a05_xlat[225] = {
+ 0x00, 0x10, 0xF0, 0x01, 0x11, 0xF1, 0x0F, 0x1F, 0xFF, 0x20, 0xE0, 0xE1,
+ 0x02, 0xF2, 0x0E, 0x1E, 0x2F, 0x30, 0xD0, 0x21, 0x12, 0x22, 0xE2, 0x03,
+ 0x0D, 0x2E, 0xEE, 0xFE, 0xEF, 0x40, 0xC0, 0x31, 0xC1, 0xD1, 0x32, 0xD2,
+ 0x13, 0x23, 0xE3, 0xF3, 0x04, 0xF4, 0x0C, 0x1C, 0x1D, 0x2D, 0xED, 0xFD,
+ 0x3E, 0xDE, 0x3F, 0xDF, 0x50, 0x60, 0x70, 0x90, 0xA0, 0xB0, 0x41, 0x51,
+ 0x61, 0x71, 0x91, 0xA1, 0xB1, 0x42, 0x62, 0x92, 0xA2, 0xC2, 0x33, 0xC3,
+ 0xD3, 0x14, 0x24, 0x34, 0xD4, 0xE4, 0x05, 0x15, 0xF5, 0x06, 0x16, 0x26,
+ 0xE6, 0xF6, 0x07, 0x17, 0xE7, 0xF7, 0x09, 0x19, 0x29, 0xF9, 0x0A, 0x1A,
+ 0x2A, 0xEA, 0xFA, 0x0B, 0x1B, 0xFB, 0x2C, 0x3C, 0xDC, 0xEC, 0xFC, 0x3D,
+ 0x4D, 0xCD, 0xDD, 0x4E, 0x6E, 0x7E, 0xAE, 0xCE, 0x4F, 0x5F, 0x6F, 0x7F,
+ 0x9F, 0xAF, 0xBF, 0xCF, 0x52, 0x72, 0xB2, 0x43, 0x53, 0x63, 0x73, 0x93,
+ 0xA3, 0xB3, 0x44, 0x64, 0x74, 0x94, 0xA4, 0xB4, 0xC4, 0x25, 0x35, 0xA5,
+ 0xC5, 0xD5, 0xE5, 0x36, 0x46, 0xB6, 0xC6, 0xD6, 0x27, 0x37, 0x47, 0xB7,
+ 0xC7, 0xD7, 0x39, 0x49, 0x59, 0xC9, 0xD9, 0xE9, 0x3A, 0x4A, 0x5A, 0xCA,
+ 0xDA, 0x2B, 0x3B, 0x4B, 0x6B, 0x7B, 0xDB, 0xEB, 0x4C, 0x5C, 0x6C, 0x7C,
+ 0x9C, 0xAC, 0xCC, 0x5D, 0x6D, 0x7D, 0x9D, 0xAD, 0xBD, 0x5E, 0x9E, 0xBE,
+ 0x54, 0x45, 0x55, 0x65, 0x75, 0x95, 0xB5, 0x56, 0x66, 0x76, 0x96, 0xA6,
+ 0x57, 0x67, 0x97, 0xA7, 0x69, 0x79, 0xA9, 0xB9, 0x6A, 0x7A, 0x9A, 0xAA,
+ 0xBA, 0x5B, 0x9B, 0xAB, 0xBB, 0xCB, 0xBC, 0x77, 0x99
+};
+
+static const uint8_t huff_a06_cb[7] = {
+ 2, 6, 1, 3, 2, 6, 4
+};
+
+static const uint8_t huff_a06_xlat[16] = {
+ 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 10, 11, 12, 15
+};
+
+static const uint8_t huff_a07_cb[11] = {
+ 2, 10, 1, 2, 2, 2, 6, 14, 21, 13, 2
+};
+
+static const uint8_t huff_a07_xlat[63] = {
+ 0, 1, 63, 2, 62, 3, 61, 4, 5, 6, 58, 59, 60, 7, 8, 9,
+ 10, 26, 27, 28, 36, 37, 38, 54, 55, 56, 57, 11, 12, 13, 14, 15,
+ 16, 25, 29, 30, 31, 33, 34, 35, 39, 47, 48, 49, 50, 51, 52, 53,
+ 17, 18, 19, 20, 21, 22, 23, 41, 42, 43, 44, 45, 46, 24, 40
+};
+
+static const uint8_t huff_a11_cb[13] = {
+ 1, 11, 1, 0, 0, 0, 8, 1, 18, 9, 22, 10, 12
+};
+
+static const uint8_t huff_a11_xlat[81] = {
+ 0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0xD0, 0x50, 0x70,
+ 0xF0, 0xC4, 0x34, 0x4C, 0xCC, 0x1C, 0x41, 0xC1, 0x31, 0x05, 0x0D, 0x43,
+ 0xC3, 0x13, 0x07, 0x0F, 0x44, 0x14, 0x74, 0xDC, 0x3C, 0x11, 0x1D, 0x33,
+ 0x37, 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0xFC, 0xD1, 0x71, 0xF1, 0x15, 0x35,
+ 0x4D, 0xCD, 0xDD, 0x3D, 0xD3, 0x73, 0x47, 0xC7, 0x17, 0x77, 0x3F, 0x51,
+ 0x45, 0xC5, 0x55, 0x53, 0xF3, 0x4F, 0xCF, 0x1F, 0xFF, 0xD5, 0x75, 0xF5,
+ 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F
+};
+
+static const uint8_t huff_a12_cb[8] = { 5, 10, 16, 11, 32, 19, 1, 2 };
+
+static const uint8_t huff_a12_xlat[81] = {
+ 0x00, 0x40, 0x10, 0x50, 0x04, 0x44, 0x14, 0x54, 0x01, 0x41, 0x11, 0x51,
+ 0x05, 0x45, 0x15, 0x55, 0x90, 0x94, 0x58, 0x91, 0x95, 0x19, 0x59, 0x06,
+ 0x46, 0x16, 0x56, 0x80, 0x60, 0x84, 0x24, 0x64, 0xA4, 0x08, 0x48, 0x18,
+ 0x68, 0x81, 0x21, 0x61, 0xA1, 0x85, 0x25, 0x65, 0xA5, 0x09, 0x49, 0x99,
+ 0x69, 0xA9, 0x02, 0x42, 0x12, 0x52, 0x96, 0x26, 0x66, 0x1A, 0x5A, 0x20,
+ 0xA0, 0x88, 0x98, 0x28, 0xA8, 0x89, 0x29, 0x82, 0x92, 0x22, 0x62, 0x86,
+ 0xA6, 0x0A, 0x4A, 0x9A, 0x6A, 0xAA, 0xA2, 0x8A, 0x2A
+};
+
+static const uint8_t huff_a13_cb[12] = {
+ 1, 10, 1, 0, 0, 4, 2, 2, 9, 15, 12, 4
+};
+
+static const uint8_t huff_a13_xlat[49] = {
+ 0x00, 0x08, 0x38, 0x01, 0x07, 0x39, 0x0F, 0x09, 0x3F, 0x10, 0x30, 0x31,
+ 0x02, 0x3A, 0x06, 0x0E, 0x3E, 0x17, 0x18, 0x28, 0x11, 0x29, 0x0A, 0x32,
+ 0x03, 0x0B, 0x3B, 0x05, 0x0D, 0x3D, 0x16, 0x1F, 0x37, 0x19, 0x12, 0x1A,
+ 0x2A, 0x13, 0x33, 0x15, 0x35, 0x1E, 0x2E, 0x36, 0x2F, 0x1B, 0x2B, 0x1D,
+ 0x2D
+};
+
+static const uint8_t huff_a14_cb[12] = {
+ 2, 11, 1, 0, 4, 3, 5, 16, 28, 34, 26, 4
+};
+
+static const uint8_t huff_a14_xlat[121] = {
+ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x11, 0x02,
+ 0x0E, 0x30, 0x50, 0xB0, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x05, 0x0B,
+ 0x0D, 0x1E, 0xFE, 0x2F, 0xEF, 0x40, 0xC0, 0x31, 0x51, 0xB1, 0xC1, 0xD1,
+ 0x22, 0x52, 0xE2, 0x13, 0xF3, 0x04, 0x15, 0xF5, 0x1B, 0xEB, 0xFB, 0x0C,
+ 0x1D, 0xFD, 0x2E, 0x5E, 0xEE, 0x3F, 0x5F, 0xBF, 0xDF, 0x41, 0x32, 0x42,
+ 0xB2, 0xD2, 0x23, 0x53, 0xB3, 0xE3, 0x14, 0x24, 0xE4, 0xF4, 0x25, 0x35,
+ 0xD5, 0xE5, 0x2B, 0x3B, 0xDB, 0x1C, 0x2C, 0xBC, 0xEC, 0xFC, 0x2D, 0xBD,
+ 0xED, 0x3E, 0x4E, 0xBE, 0xDE, 0x4F, 0xCF, 0xC2, 0x33, 0x43, 0xC3, 0xD3,
+ 0x34, 0x44, 0x54, 0xB4, 0xD4, 0x45, 0x55, 0xC5, 0x4B, 0xCB, 0x3C, 0x4C,
+ 0x5C, 0xCC, 0xDC, 0x3D, 0x4D, 0x5D, 0xCD, 0xDD, 0xCE, 0xC4, 0xB5, 0x5B,
+ 0xBB
+};
+
+static const uint8_t huff_a15_cb[9] = { 5, 11, 9, 12, 16, 44, 98, 42, 4 };
+
+static const uint8_t huff_a15_xlat[225] = {
+ 0x00, 0x10, 0xF0, 0x01, 0x11, 0xF1, 0x0F, 0x1F, 0xFF, 0x20, 0xE0, 0x21,
+ 0xE1, 0x02, 0x12, 0xF2, 0x0E, 0x1E, 0xFE, 0x2F, 0xEF, 0x30, 0xD0, 0x31,
+ 0xD1, 0x22, 0xE2, 0x03, 0x13, 0xF3, 0x0D, 0x1D, 0xFD, 0x2E, 0xEE, 0x3F,
+ 0xDF, 0x40, 0x60, 0x70, 0x90, 0xA0, 0xC0, 0x41, 0xC1, 0x32, 0x42, 0xC2,
+ 0xD2, 0x23, 0x33, 0xD3, 0xE3, 0x04, 0x14, 0x24, 0xE4, 0xF4, 0x06, 0x16,
+ 0xF6, 0x07, 0x09, 0x0A, 0x1A, 0xFA, 0x0C, 0x1C, 0x2C, 0xEC, 0xFC, 0x2D,
+ 0x3D, 0xDD, 0xED, 0x3E, 0x4E, 0xCE, 0xDE, 0x4F, 0xCF, 0x50, 0xB0, 0x51,
+ 0x61, 0x71, 0x91, 0xA1, 0xB1, 0x52, 0x62, 0x72, 0x92, 0xA2, 0xB2, 0x43,
+ 0x53, 0x63, 0x73, 0x93, 0xA3, 0xC3, 0x34, 0x44, 0x64, 0xA4, 0xC4, 0xD4,
+ 0x05, 0x15, 0x25, 0x35, 0xD5, 0xE5, 0xF5, 0x26, 0x36, 0x46, 0xC6, 0xD6,
+ 0xE6, 0x17, 0x27, 0x37, 0xC7, 0xD7, 0xE7, 0xF7, 0x19, 0x29, 0x39, 0xC9,
+ 0xD9, 0xE9, 0xF9, 0x2A, 0x3A, 0x4A, 0x5A, 0xCA, 0xDA, 0xEA, 0x0B, 0x1B,
+ 0x2B, 0x3B, 0xCB, 0xDB, 0xEB, 0xFB, 0x3C, 0x4C, 0x6C, 0x7C, 0x9C, 0xAC,
+ 0xBC, 0xCC, 0xDC, 0x4D, 0x5D, 0x6D, 0x7D, 0x9D, 0xAD, 0xBD, 0xCD, 0x5E,
+ 0x6E, 0x7E, 0x9E, 0xAE, 0xBE, 0x5F, 0x6F, 0x7F, 0x9F, 0xAF, 0xBF, 0xB3,
+ 0x54, 0x74, 0x94, 0xB4, 0x45, 0x55, 0x65, 0x75, 0x95, 0xA5, 0xB5, 0xC5,
+ 0x56, 0x66, 0x76, 0x96, 0xA6, 0xB6, 0x47, 0x57, 0x67, 0xA7, 0xB7, 0x49,
+ 0x59, 0x69, 0xA9, 0xB9, 0x6A, 0x7A, 0x9A, 0xAA, 0xBA, 0x4B, 0x5B, 0x6B,
+ 0x7B, 0x9B, 0xAB, 0xBB, 0x5C, 0x77, 0x97, 0x79, 0x99
+};
+
+static const uint8_t huff_a16_cb[13] = {
+ 2, 12, 1, 1, 2, 2, 5, 7, 21, 54, 85, 62, 16
+};
+
+static const uint8_t huff_a16_xlat[256] = {
+ 0x00, 0x01, 0x10, 0x11, 0x21, 0x12, 0x20, 0x31, 0x02, 0x22, 0x13, 0x30,
+ 0x41, 0x32, 0x03, 0x23, 0x14, 0x24, 0x40, 0x51, 0x61, 0xD1, 0xE1, 0x42,
+ 0x52, 0xD2, 0x33, 0x43, 0xD3, 0x04, 0x34, 0x05, 0x15, 0x25, 0x16, 0x1D,
+ 0x2D, 0x1E, 0x2E, 0x50, 0x60, 0xD0, 0xE0, 0xF0, 0x71, 0x81, 0xF1, 0x62,
+ 0x72, 0xE2, 0xF2, 0x53, 0x63, 0xE3, 0xF3, 0x44, 0x54, 0xD4, 0xE4, 0xF4,
+ 0x35, 0x45, 0x55, 0xD5, 0xE5, 0xF5, 0x06, 0x26, 0x36, 0xD6, 0x07, 0x17,
+ 0x27, 0x37, 0xD7, 0x18, 0x28, 0x1C, 0x0D, 0x3D, 0x4D, 0x5D, 0x6D, 0x8D,
+ 0x0E, 0x3E, 0x4E, 0x5E, 0x0F, 0x1F, 0x2F, 0x3F, 0x5F, 0x70, 0x80, 0x90,
+ 0xC0, 0x91, 0xA1, 0xB1, 0xC1, 0x82, 0x92, 0xA2, 0xC2, 0x73, 0x83, 0x93,
+ 0xA3, 0xC3, 0x64, 0x74, 0x84, 0x94, 0xA4, 0xC4, 0x65, 0x75, 0x85, 0x46,
+ 0x56, 0x66, 0xC6, 0xE6, 0xF6, 0x47, 0x57, 0xE7, 0xF7, 0x08, 0x38, 0x48,
+ 0x58, 0x68, 0xD8, 0xE8, 0xF8, 0x09, 0x19, 0x29, 0x39, 0x59, 0xD9, 0xE9,
+ 0xF9, 0x1A, 0x2A, 0x3A, 0xDA, 0xEA, 0xFA, 0x1B, 0x2B, 0xDB, 0xEB, 0xFB,
+ 0x0C, 0x2C, 0x3C, 0xDC, 0xEC, 0x7D, 0x9D, 0xAD, 0xBD, 0xCD, 0x6E, 0x7E,
+ 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0x4F, 0x6F, 0x7F, 0x8F, 0xAF, 0xA0, 0xB2,
+ 0xB3, 0xB4, 0x95, 0xA5, 0xB5, 0xC5, 0x76, 0x86, 0x96, 0xA6, 0xB6, 0x67,
+ 0x77, 0x87, 0x97, 0xC7, 0x78, 0x88, 0x98, 0xC8, 0x49, 0x69, 0x79, 0x89,
+ 0x99, 0xC9, 0x0A, 0x4A, 0x5A, 0x6A, 0x7A, 0xCA, 0x0B, 0x3B, 0x4B, 0x5B,
+ 0x6B, 0xCB, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xFC,
+ 0xDD, 0xED, 0xFD, 0xDE, 0xEE, 0xFE, 0x9F, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF,
+ 0xB0, 0xA7, 0xB7, 0xA8, 0xB8, 0xA9, 0xB9, 0x8A, 0x9A, 0xAA, 0xBA, 0x7B,
+ 0x8B, 0x9B, 0xAB, 0xBB
+};
+
+static const uint8_t huff_a17_cb[9] = { 3, 9, 3, 2, 5, 7, 17, 23, 6 };
+
+static const uint8_t huff_a17_xlat[63] = {
+ 0, 1, 63, 2, 62, 3, 4, 59, 60, 61, 5, 6, 7, 8, 56, 57,
+ 58, 9, 10, 11, 12, 13, 14, 26, 27, 36, 37, 38, 50, 51, 52, 53,
+ 54, 55, 15, 16, 17, 18, 19, 20, 21, 25, 28, 29, 30, 31, 33, 34,
+ 35, 39, 43, 44, 45, 46, 47, 48, 49, 22, 23, 24, 40, 41, 42
+};
+
+static const uint8_t huff_a21_cb[14] = {
+ 1, 12, 1, 0, 0, 2, 6, 0, 7, 21, 15, 17, 8, 4
+};
+
+static const uint8_t huff_a21_xlat[81] = {
+ 0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0xD0, 0x70, 0x34,
+ 0x1C, 0x0D, 0x13, 0x07, 0x50, 0xF0, 0x44, 0xC4, 0x14, 0x74, 0x4C, 0xCC,
+ 0xDC, 0x3C, 0x41, 0xC1, 0x11, 0x31, 0x05, 0x1D, 0x43, 0xC3, 0x33, 0x37,
+ 0x0F, 0x54, 0xF4, 0xFC, 0xD1, 0x71, 0x15, 0x4D, 0xCD, 0xDD, 0xD3, 0x73,
+ 0x47, 0xC7, 0x77, 0x3F, 0xD4, 0x5C, 0x7C, 0x51, 0xF1, 0x45, 0xC5, 0x55,
+ 0x35, 0x3D, 0x53, 0xF3, 0x17, 0x4F, 0xCF, 0x1F, 0xFF, 0x75, 0xF5, 0x5D,
+ 0x7D, 0xD7, 0xF7, 0x5F, 0xDF, 0xD5, 0xFD, 0x57, 0x7F
+};
+
+static const uint8_t huff_a22_cb[10] = { 2, 9, 1, 4, 0, 4, 3, 8, 3, 2 };
+
+static const uint8_t huff_a22_xlat[25] = {
+ 0x00, 0x08, 0x38, 0x01, 0x07, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x02, 0x06,
+ 0x30, 0x11, 0x31, 0x0A, 0x3A, 0x0E, 0x17, 0x37, 0x32, 0x16, 0x3E, 0x12,
+ 0x36
+};
+
+static const uint8_t huff_a23_cb[9] = { 3, 9, 5, 0, 4, 6, 10, 16, 8 };
+
+static const uint8_t huff_a23_xlat[49] = {
+ 0x00, 0x08, 0x38, 0x01, 0x07, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x30, 0x02,
+ 0x3A, 0x06, 0x0E, 0x18, 0x28, 0x11, 0x31, 0x0A, 0x03, 0x05, 0x3E, 0x17,
+ 0x37, 0x19, 0x29, 0x12, 0x2A, 0x32, 0x0B, 0x33, 0x3B, 0x0D, 0x15, 0x3D,
+ 0x16, 0x1E, 0x36, 0x1F, 0x2F, 0x1A, 0x13, 0x1B, 0x2B, 0x1D, 0x2D, 0x35,
+ 0x2E
+};
+
+static const uint8_t huff_a24_cb[5] = { 2, 4, 3, 1, 2 };
+
+static const uint8_t huff_a25_cb[5] = { 2, 4, 1, 5, 2 };
+
+static const uint8_t huff_a25_xlat[8] = { 1, 0, 2, 3, 4, 5, 6, 7 };
+
+static const uint8_t huff_a26_cb[10] = { 4, 11, 3, 4, 12, 15, 34, 83, 75, 30 };
+
+static const uint8_t huff_a26_xlat[256] = {
+ 0x00, 0x01, 0x11, 0x10, 0x21, 0x12, 0x22, 0x20, 0x30, 0x31, 0x41, 0x02,
+ 0x32, 0x03, 0x13, 0x23, 0x33, 0x14, 0x24, 0x40, 0x51, 0x61, 0x42, 0x52,
+ 0x43, 0x53, 0x04, 0x34, 0x44, 0x15, 0x25, 0x35, 0x16, 0x26, 0x50, 0x60,
+ 0x71, 0x81, 0xD1, 0x62, 0x72, 0x82, 0xD2, 0x63, 0x73, 0xD3, 0x54, 0x64,
+ 0x05, 0x45, 0x55, 0x65, 0x06, 0x36, 0x46, 0x56, 0x17, 0x27, 0x37, 0x47,
+ 0x18, 0x28, 0x38, 0x19, 0x1D, 0x2D, 0x3D, 0x1E, 0x70, 0x80, 0x90, 0xD0,
+ 0xE0, 0x91, 0xA1, 0xB1, 0xC1, 0xE1, 0xF1, 0x92, 0xA2, 0xC2, 0xE2, 0xF2,
+ 0x83, 0x93, 0xA3, 0xC3, 0xE3, 0xF3, 0x74, 0x84, 0x94, 0xA4, 0xC4, 0xD4,
+ 0xE4, 0xF4, 0x75, 0x85, 0x95, 0xD5, 0xE5, 0x66, 0x76, 0x86, 0xD6, 0xE6,
+ 0x07, 0x57, 0x67, 0x77, 0xD7, 0x08, 0x48, 0x58, 0x68, 0xD8, 0x09, 0x29,
+ 0x39, 0x49, 0x59, 0x69, 0x1A, 0x2A, 0x3A, 0x4A, 0x1B, 0x2B, 0x1C, 0x2C,
+ 0x3C, 0x4C, 0x0D, 0x4D, 0x5D, 0x6D, 0x7D, 0x8D, 0x0E, 0x2E, 0x3E, 0x4E,
+ 0x5E, 0x6E, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0xA0, 0xB0, 0xC0, 0xF0, 0xB2,
+ 0xB3, 0xB4, 0xA5, 0xB5, 0xC5, 0xF5, 0x96, 0xA6, 0xB6, 0xC6, 0xF6, 0x87,
+ 0x97, 0xA7, 0xB7, 0xC7, 0xE7, 0xF7, 0x78, 0x88, 0x98, 0xA8, 0xC8, 0xE8,
+ 0xF8, 0x79, 0x89, 0x99, 0xC9, 0xD9, 0xE9, 0xF9, 0x0A, 0x5A, 0x6A, 0x7A,
+ 0x8A, 0xDA, 0xEA, 0xFA, 0x0B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0x8B, 0xDB,
+ 0x0C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xDC, 0x9D, 0xAD, 0xBD, 0xCD, 0x7E,
+ 0x8E, 0x9E, 0xAE, 0xBE, 0x0F, 0x6F, 0x7F, 0x8F, 0x9F, 0xAF, 0xB8, 0xA9,
+ 0xB9, 0x9A, 0xAA, 0xBA, 0xCA, 0x9B, 0xAB, 0xBB, 0xCB, 0xEB, 0xFB, 0xAC,
+ 0xBC, 0xCC, 0xEC, 0xFC, 0xDD, 0xED, 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xBF,
+ 0xCF, 0xDF, 0xEF, 0xFF
+};
+
+static const uint8_t huff_a27_cb[7] = { 4, 8, 3, 14, 10, 20, 16 };
+
+static const uint8_t huff_a27_xlat[63] = {
+ 0, 2, 3, 1, 5, 6, 7, 9, 54, 55, 56, 58, 59, 60, 61, 62,
+ 63, 4, 8, 10, 11, 12, 14, 49, 52, 53, 57, 13, 15, 16, 17, 18,
+ 19, 22, 23, 25, 26, 30, 39, 43, 44, 45, 46, 47, 48, 50, 51, 20,
+ 21, 24, 27, 28, 29, 31, 33, 34, 35, 36, 37, 38, 40, 41, 42
+};
+
+static const uint8_t huff_a31_cb[8] = { 1, 6, 1, 0, 3, 1, 0, 4 };
+
+static const uint8_t huff_a31_xlat[9] = {
+ 0x00, 0x04, 0x0C, 0x01, 0x03, 0x05, 0x0D, 0x07, 0x0F
+};
+
+static const uint8_t huff_a32_cb[13] = {
+ 1, 11, 1, 0, 0, 2, 2, 6, 12, 18, 19, 15, 6
+};
+
+static const uint8_t huff_a32_xlat[81] = {
+ 0x00, 0x40, 0x01, 0x10, 0x04, 0x80, 0x50, 0x20, 0x14, 0x05, 0x02, 0x90,
+ 0x60, 0x44, 0x54, 0x24, 0x08, 0x18, 0x41, 0x11, 0x15, 0x09, 0x06, 0xA0,
+ 0x84, 0x94, 0x64, 0xA4, 0x48, 0x58, 0x28, 0x51, 0x21, 0x45, 0x55, 0x25,
+ 0x19, 0x12, 0x16, 0x0A, 0x1A, 0x68, 0xA8, 0x81, 0x91, 0x61, 0xA1, 0x85,
+ 0x95, 0x65, 0xA5, 0x49, 0x59, 0x29, 0x69, 0x42, 0x52, 0x46, 0x56, 0x2A,
+ 0x88, 0x98, 0x89, 0x99, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x86, 0x26, 0x66,
+ 0x4A, 0x5A, 0x6A, 0xA2, 0x96, 0xA6, 0x8A, 0x9A, 0xAA
+};
+
+static const uint8_t huff_a33_cb[12] = {
+ 3, 12, 1, 1, 13, 1, 14, 28, 33, 81, 32, 52
+};
+
+static const uint8_t huff_a33_xlat[256] = {
+ 0x00, 0x10, 0x40, 0x50, 0x04, 0x44, 0x14, 0x54, 0x01, 0x41, 0x11, 0x51,
+ 0x05, 0x45, 0x15, 0x55, 0x90, 0x20, 0x94, 0x64, 0x18, 0x21, 0x95, 0x19,
+ 0x69, 0x02, 0x52, 0x06, 0x46, 0x16, 0x80, 0x60, 0x84, 0xD4, 0x24, 0x08,
+ 0x48, 0x58, 0x68, 0x81, 0x91, 0x61, 0x85, 0x25, 0x65, 0xA5, 0x09, 0x49,
+ 0x59, 0x29, 0x42, 0x12, 0x56, 0x96, 0xA6, 0x0A, 0x17, 0x1B, 0xD0, 0xC4,
+ 0x74, 0xF4, 0x88, 0xC8, 0x28, 0xA1, 0x71, 0xC5, 0xD5, 0x75, 0x99, 0xB9,
+ 0x4D, 0x1D, 0x2D, 0x6D, 0x22, 0x62, 0x66, 0x4A, 0x1A, 0x9A, 0x6A, 0x8E,
+ 0x5E, 0x43, 0x23, 0x07, 0x47, 0x57, 0x6B, 0xC0, 0xA0, 0xE0, 0x70, 0xB0,
+ 0xA4, 0xE4, 0x34, 0xB4, 0x98, 0xD8, 0xA8, 0x38, 0x78, 0x0C, 0x4C, 0x1C,
+ 0x5C, 0x9C, 0x6C, 0x7C, 0xC1, 0xD1, 0xE1, 0x31, 0xE5, 0x35, 0xB5, 0xF5,
+ 0x89, 0xA9, 0x79, 0xF9, 0x0D, 0xCD, 0x9D, 0xDD, 0xAD, 0x3D, 0x7D, 0x82,
+ 0xC2, 0x92, 0xD2, 0xE2, 0x72, 0xF2, 0x86, 0xD6, 0xE6, 0x76, 0xB6, 0x8A,
+ 0x5A, 0xDA, 0xEA, 0xFA, 0x4E, 0x1E, 0x9E, 0xEE, 0x03, 0x13, 0x53, 0x97,
+ 0xB7, 0x0B, 0x4B, 0x8B, 0x5B, 0x9B, 0xEB, 0x7B, 0x0F, 0x4F, 0x1F, 0x5F,
+ 0x9F, 0x2F, 0x3F, 0xBF, 0xE8, 0xB8, 0xF8, 0x8C, 0x2C, 0x3C, 0xFC, 0xB1,
+ 0xC9, 0xD9, 0xE9, 0x39, 0x5D, 0xED, 0xBD, 0xA2, 0x32, 0x26, 0x36, 0x2A,
+ 0xAA, 0xBA, 0x0E, 0x2E, 0x6E, 0x83, 0xC3, 0x93, 0x63, 0xB3, 0xA7, 0x37,
+ 0x30, 0xF0, 0xCC, 0xDC, 0xAC, 0xEC, 0xBC, 0xF1, 0x8D, 0xFD, 0xB2, 0xC6,
+ 0xF6, 0xCA, 0x3A, 0x7A, 0xCE, 0xDE, 0xAE, 0x3E, 0x7E, 0xBE, 0xFE, 0xD3,
+ 0xA3, 0xE3, 0x33, 0x73, 0xF3, 0x87, 0xC7, 0xD7, 0x27, 0x67, 0xE7, 0x77,
+ 0xF7, 0xCB, 0xDB, 0x2B, 0xAB, 0x3B, 0xBB, 0xFB, 0x8F, 0xCF, 0xDF, 0x6F,
+ 0xAF, 0xEF, 0x7F, 0xFF
+};
+
+static const uint8_t huff_a34_cb[7] = { 1, 5, 1, 1, 1, 1, 2 };
+
+static const uint8_t huff_a34_xlat[6] = { 1, 0, 2, 3, 4, 5 };
+
+static const uint8_t huff_a35_cb[11] = { 2, 10, 1, 0, 2, 3, 6, 19, 9, 75, 110 };
+
+static const uint8_t huff_a35_xlat[225] = {
+ 0x00, 0xF0, 0x0F, 0x10, 0x01, 0xFF, 0x20, 0xE0, 0x11, 0xF1, 0x0E, 0x1F,
+ 0x30, 0x40, 0xD0, 0x21, 0xE1, 0x02, 0x12, 0x22, 0xE2, 0xF2, 0x03, 0x13,
+ 0x1E, 0x2E, 0x3E, 0xEE, 0xFE, 0x2F, 0xEF, 0xD2, 0x43, 0xF3, 0x04, 0x0D,
+ 0x2D, 0x3D, 0x3F, 0xDF, 0x50, 0x60, 0x70, 0x90, 0xB0, 0x31, 0x41, 0x91,
+ 0xA1, 0xC1, 0xD1, 0x42, 0xA2, 0xC2, 0x23, 0x33, 0xE3, 0x24, 0x34, 0xB4,
+ 0xD4, 0xF4, 0x05, 0x15, 0x45, 0xE5, 0x16, 0x36, 0x56, 0xA6, 0xC6, 0xD6,
+ 0xF6, 0x57, 0xC7, 0xF7, 0x09, 0x29, 0x49, 0x59, 0x69, 0xF9, 0x0A, 0x2A,
+ 0x3A, 0x4A, 0xDA, 0xEA, 0xFA, 0x0B, 0x2B, 0xAB, 0xEB, 0xFB, 0x0C, 0x1C,
+ 0x2C, 0x3C, 0x4C, 0x5C, 0xCC, 0xDC, 0xFC, 0x1D, 0x4D, 0x6D, 0xBD, 0xCD,
+ 0xED, 0xFD, 0x4E, 0x6E, 0xCE, 0xDE, 0x7F, 0xA0, 0xC0, 0x51, 0x61, 0x71,
+ 0xB1, 0x32, 0x52, 0x62, 0x72, 0x92, 0xB2, 0x53, 0x63, 0x73, 0x93, 0xA3,
+ 0xB3, 0xC3, 0xD3, 0x14, 0x44, 0x54, 0x64, 0x74, 0x94, 0xA4, 0xC4, 0xE4,
+ 0x25, 0x35, 0x55, 0x65, 0x75, 0x95, 0xA5, 0xB5, 0xC5, 0xD5, 0xF5, 0x06,
+ 0x26, 0x46, 0x66, 0x76, 0x96, 0xB6, 0xE6, 0x07, 0x17, 0x27, 0x37, 0x47,
+ 0x67, 0x77, 0x97, 0xA7, 0xB7, 0xD7, 0xE7, 0x19, 0x39, 0x79, 0x99, 0xA9,
+ 0xB9, 0xC9, 0xD9, 0xE9, 0x1A, 0x5A, 0x6A, 0x7A, 0x9A, 0xAA, 0xBA, 0xCA,
+ 0x1B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0x9B, 0xBB, 0xCB, 0xDB, 0x6C, 0x7C,
+ 0x9C, 0xAC, 0xBC, 0xEC, 0x5D, 0x7D, 0x9D, 0xAD, 0xDD, 0x5E, 0x7E, 0x9E,
+ 0xAE, 0xBE, 0x4F, 0x5F, 0x6F, 0x9F, 0xAF, 0xBF, 0xCF
+};
+
+static const uint8_t huff_a36_cb[12] = {
+ 3, 12, 1, 3, 5, 5, 13, 27, 69, 96, 35, 2
+};
+
+static const uint8_t huff_a36_xlat[256] = {
+ 0x00, 0x10, 0x01, 0x11, 0x20, 0x21, 0x02, 0x12, 0x22, 0x31, 0x41, 0x32,
+ 0x13, 0x23, 0x30, 0x40, 0x51, 0x42, 0x03, 0x33, 0x43, 0x04, 0x14, 0x24,
+ 0x34, 0x15, 0x25, 0x50, 0x61, 0x71, 0xD1, 0x52, 0x62, 0x72, 0xD2, 0x53,
+ 0x63, 0xD3, 0x44, 0x54, 0x64, 0x05, 0x35, 0x45, 0x55, 0x16, 0x26, 0x36,
+ 0x46, 0x17, 0x27, 0x1D, 0x2D, 0x3D, 0x60, 0x70, 0xD0, 0x81, 0x91, 0xA1,
+ 0xC1, 0xE1, 0xF1, 0x82, 0x92, 0xC2, 0xE2, 0xF2, 0x73, 0x83, 0xE3, 0xF3,
+ 0x74, 0x84, 0xC4, 0xD4, 0xE4, 0xF4, 0x65, 0x75, 0x85, 0xD5, 0xE5, 0x06,
+ 0x56, 0x66, 0xD6, 0xE6, 0x07, 0x37, 0x47, 0x57, 0x67, 0xD7, 0xE7, 0x18,
+ 0x28, 0x38, 0x48, 0x58, 0xD8, 0x19, 0x29, 0x2A, 0x1C, 0x2C, 0x0D, 0x4D,
+ 0x5D, 0x6D, 0x7D, 0x8D, 0x9D, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E,
+ 0x1F, 0x2F, 0x3F, 0x80, 0x90, 0xA0, 0xC0, 0xE0, 0xF0, 0xB1, 0xA2, 0xB2,
+ 0x93, 0xA3, 0xB3, 0xC3, 0x94, 0xA4, 0xB4, 0x95, 0xA5, 0xB5, 0xC5, 0xF5,
+ 0x76, 0x86, 0x96, 0xA6, 0xC6, 0xF6, 0x77, 0x87, 0x97, 0xA7, 0xC7, 0xF7,
+ 0x08, 0x68, 0x78, 0x88, 0x98, 0xC8, 0xE8, 0xF8, 0x09, 0x39, 0x49, 0x59,
+ 0x69, 0x79, 0x89, 0xD9, 0xE9, 0xF9, 0x0A, 0x1A, 0x3A, 0x4A, 0x5A, 0x6A,
+ 0xDA, 0xEA, 0xFA, 0x1B, 0x2B, 0x3B, 0x4B, 0x5B, 0xDB, 0xEB, 0xFB, 0x0C,
+ 0x3C, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xDC, 0xEC, 0xAD, 0xBD, 0xCD,
+ 0xDD, 0xED, 0x0E, 0x8E, 0x9E, 0xAE, 0xBE, 0x0F, 0x4F, 0x5F, 0x6F, 0x7F,
+ 0x8F, 0x9F, 0xAF, 0xB0, 0xB6, 0xB7, 0xA8, 0xB8, 0x99, 0xA9, 0xB9, 0xC9,
+ 0x7A, 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0x0B, 0x6B, 0x7B, 0x8B, 0x9B, 0xCB,
+ 0xAC, 0xBC, 0xCC, 0xFC, 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xBF, 0xCF, 0xDF,
+ 0xEF, 0xFF, 0xAB, 0xBB
+};
+
+static const uint8_t huff_a37_cb[7] = { 4, 8, 7, 6, 8, 22, 20 };
+
+static const uint8_t huff_a37_xlat[63] = {
+ 0, 1, 2, 3, 61, 62, 63, 4, 5, 6, 58, 59, 60, 7, 8, 9,
+ 10, 54, 55, 56, 57, 11, 12, 13, 14, 15, 16, 25, 26, 27, 28, 29,
+ 30, 35, 36, 37, 38, 48, 49, 50, 51, 52, 53, 17, 18, 19, 20, 21,
+ 22, 23, 24, 31, 33, 34, 39, 40, 41, 42, 43, 44, 45, 46, 47
+};
+
+static const uint8_t huff_a41_cb[14] = {
+ 1, 12, 1, 0, 0, 6, 2, 0, 0, 0, 19, 9, 24, 20
+};
+
+static const uint8_t huff_a41_xlat[81] = {
+ 0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0x50, 0xD0, 0x70,
+ 0xF0, 0xC4, 0x34, 0x4C, 0xCC, 0x1C, 0x41, 0xC1, 0x31, 0x05, 0x0D, 0x43,
+ 0xC3, 0x13, 0x07, 0x0F, 0x44, 0x14, 0x74, 0xDC, 0x3C, 0x11, 0x1D, 0x33,
+ 0x37, 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0xFC, 0xD1, 0x71, 0xF1, 0xC5, 0x15,
+ 0x35, 0x4D, 0xCD, 0xDD, 0x3D, 0xD3, 0x73, 0x47, 0xC7, 0x17, 0x77, 0x1F,
+ 0x3F, 0x51, 0x45, 0x55, 0xD5, 0x75, 0xF5, 0x5D, 0x7D, 0xFD, 0x53, 0xF3,
+ 0x57, 0xD7, 0xF7, 0x4F, 0xCF, 0x5F, 0xDF, 0x7F, 0xFF
+};
+
+static const uint8_t huff_a42_cb[10] = { 3, 10, 1, 2, 13, 1, 31, 13, 16, 4 };
+
+static const uint8_t huff_a42_xlat[81] = {
+ 0x00, 0x40, 0x01, 0x10, 0x50, 0x04, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51,
+ 0x05, 0x45, 0x15, 0x55, 0x59, 0x80, 0x90, 0x20, 0x60, 0x84, 0x94, 0x24,
+ 0x64, 0x08, 0x48, 0x18, 0x58, 0x81, 0x91, 0x21, 0x61, 0x85, 0x95, 0x25,
+ 0x65, 0x09, 0x49, 0x19, 0x02, 0x42, 0x12, 0x52, 0x06, 0x46, 0x16, 0x56,
+ 0xA0, 0xA4, 0x68, 0xA1, 0xA5, 0x99, 0x29, 0x69, 0x96, 0x66, 0x4A, 0x1A,
+ 0x5A, 0x88, 0x98, 0x28, 0x89, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x86, 0x26,
+ 0xA6, 0x0A, 0x9A, 0x2A, 0x6A, 0xA8, 0xA2, 0x8A, 0xAA
+};
+
+static const uint8_t huff_a43_cb[5] = { 2, 4, 2, 3, 2 };
+
+static const uint8_t huff_a43_xlat[7] = { 0, 7, 1, 2, 6, 3, 5 };
+
+static const uint8_t huff_a44_cb[9] = { 4, 10, 5, 4, 12, 17, 47, 24, 12 };
+
+static const uint8_t huff_a44_xlat[121] = {
+ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x21,
+ 0xE1, 0x02, 0x12, 0xF2, 0x0E, 0x1E, 0xFE, 0x2F, 0xEF, 0x30, 0x50, 0xD0,
+ 0xD1, 0x22, 0xE2, 0x03, 0x13, 0xF3, 0x0D, 0x1D, 0x2D, 0xFD, 0x2E, 0xEE,
+ 0x3F, 0xDF, 0x40, 0xB0, 0xC0, 0x31, 0x41, 0x51, 0xB1, 0xC1, 0x32, 0xB2,
+ 0xC2, 0xD2, 0x23, 0xB3, 0xD3, 0xE3, 0x04, 0x14, 0xE4, 0xF4, 0x05, 0x15,
+ 0xD5, 0xE5, 0xF5, 0x0B, 0x1B, 0x2B, 0x3B, 0xEB, 0xFB, 0x0C, 0x1C, 0x2C,
+ 0xFC, 0x3D, 0x5D, 0xED, 0x3E, 0x4E, 0x5E, 0xBE, 0xDE, 0x4F, 0x5F, 0xBF,
+ 0xCF, 0x42, 0x52, 0x33, 0x53, 0xC3, 0x24, 0xB4, 0xD4, 0x25, 0x35, 0xC5,
+ 0x4B, 0xCB, 0xDB, 0x3C, 0x4C, 0x5C, 0xDC, 0xEC, 0x4D, 0xBD, 0xCD, 0xDD,
+ 0xCE, 0x43, 0x34, 0x44, 0x54, 0xC4, 0x45, 0x55, 0xB5, 0x5B, 0xBB, 0xBC,
+ 0xCC
+};
+
+static const uint8_t huff_a45_cb[5] = { 2, 4, 2, 2, 4 };
+
+static const uint8_t huff_a45_xlat[8] = { 1, 2, 0, 3, 4, 5, 6, 7 };
+
+static const uint8_t huff_a46_cb[7] = { 5, 9, 1, 16, 31, 36, 172 };
+
+static const uint8_t huff_a46_xlat[256] = {
+ 0x02, 0x00, 0x30, 0x21, 0x31, 0x41, 0x61, 0x12, 0x22, 0x42, 0x62, 0x43,
+ 0x53, 0x24, 0x45, 0x26, 0x27, 0x10, 0x40, 0xB0, 0x01, 0x11, 0x81, 0x32,
+ 0x52, 0x72, 0x92, 0x03, 0x13, 0x33, 0x63, 0x14, 0x34, 0x54, 0x64, 0x74,
+ 0x05, 0x15, 0x25, 0x35, 0x55, 0x65, 0x06, 0x46, 0x56, 0x57, 0x67, 0x88,
+ 0x20, 0x51, 0x91, 0xD1, 0xF2, 0x23, 0x83, 0x93, 0x04, 0x44, 0x84, 0x94,
+ 0x75, 0x85, 0xC5, 0x36, 0x66, 0x96, 0xB6, 0x07, 0x37, 0x97, 0x08, 0x28,
+ 0x38, 0x48, 0x68, 0x09, 0x69, 0x79, 0x0A, 0x2A, 0x1B, 0x9B, 0x2C, 0x4D,
+ 0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xC0, 0xD0, 0xE0, 0xF0, 0x71, 0xA1,
+ 0xB1, 0xC1, 0xE1, 0xF1, 0x82, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0x73, 0xA3,
+ 0xB3, 0xC3, 0xD3, 0xE3, 0xF3, 0xA4, 0xB4, 0xC4, 0xD4, 0xE4, 0xF4, 0x95,
+ 0xA5, 0xB5, 0xD5, 0xE5, 0xF5, 0x16, 0x76, 0x86, 0xA6, 0xC6, 0xD6, 0xE6,
+ 0xF6, 0x17, 0x47, 0x77, 0x87, 0xA7, 0xB7, 0xC7, 0xD7, 0xE7, 0xF7, 0x18,
+ 0x58, 0x78, 0x98, 0xA8, 0xB8, 0xC8, 0xD8, 0xE8, 0xF8, 0x19, 0x29, 0x39,
+ 0x49, 0x59, 0x89, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9, 0x1A, 0x3A,
+ 0x4A, 0x5A, 0x6A, 0x7A, 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA,
+ 0x0B, 0x2B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0x8B, 0xAB, 0xBB, 0xCB, 0xDB,
+ 0xEB, 0xFB, 0x0C, 0x1C, 0x3C, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xAC,
+ 0xBC, 0xCC, 0xDC, 0xEC, 0xFC, 0x0D, 0x1D, 0x2D, 0x3D, 0x5D, 0x6D, 0x7D,
+ 0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0xDD, 0xED, 0xFD, 0x0E, 0x1E, 0x2E, 0x3E,
+ 0x4E, 0x5E, 0x6E, 0x7E, 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0xDE, 0xEE, 0xFE,
+ 0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F, 0x8F, 0x9F, 0xAF, 0xBF,
+ 0xCF, 0xDF, 0xEF, 0xFF
+};
+
+static const uint8_t huff_a47_cb[8] = { 4, 9, 5, 12, 9, 12, 15, 10 };
+
+static const uint8_t huff_a47_xlat[63] = {
+ 0, 1, 2, 62, 63, 3, 4, 5, 6, 8, 54, 56, 57, 58, 59, 60,
+ 61, 7, 9, 10, 11, 12, 13, 14, 53, 55, 15, 16, 17, 18, 19, 20,
+ 21, 36, 37, 39, 42, 52, 22, 25, 28, 35, 38, 40, 41, 43, 45, 46,
+ 47, 48, 49, 50, 51, 23, 24, 26, 27, 29, 30, 31, 33, 34, 44
+};
+
+static const uint8_t huff_a51_cb[12] = {
+ 2, 11, 1, 0, 6, 2, 6, 18, 4, 26, 6, 12
+};
+
+static const uint8_t huff_a51_xlat[81] = {
+ 0x00, 0x40, 0xC0, 0x30, 0x04, 0x01, 0x03, 0x10, 0x0C, 0xD0, 0x70, 0x34,
+ 0x1C, 0x0D, 0x07, 0x50, 0xF0, 0x44, 0xC4, 0x14, 0x4C, 0xCC, 0x3C, 0x41,
+ 0xC1, 0x11, 0x31, 0x05, 0x43, 0xC3, 0x13, 0x33, 0x0F, 0x74, 0xDC, 0x1D,
+ 0x37, 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0xFC, 0xD1, 0x71, 0xF1, 0xC5, 0x15,
+ 0x35, 0x4D, 0xCD, 0xDD, 0x3D, 0x53, 0xD3, 0x73, 0x47, 0xC7, 0x17, 0x77,
+ 0x4F, 0x1F, 0x3F, 0x51, 0x45, 0x55, 0xF3, 0xCF, 0xFF, 0xD5, 0x75, 0xF5,
+ 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F
+};
+
+static const uint8_t huff_a52_cb[12] = { 1, 10, 1, 0, 2, 2, 0, 4, 3, 8, 3, 2 };
+
+static const uint8_t huff_a52_xlat[25] = {
+ 0x00, 0x08, 0x38, 0x01, 0x07, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x02, 0x06,
+ 0x30, 0x11, 0x31, 0x0A, 0x3A, 0x0E, 0x17, 0x37, 0x32, 0x16, 0x3E, 0x12,
+ 0x36
+};
+
+static const uint8_t huff_a53_xlat[7] = { 0, 1, 2, 6, 7, 3, 5 };
+
+static const uint8_t huff_a54_cb[8] = { 4, 9, 4, 7, 12, 19, 21, 58 };
+
+static const uint8_t huff_a54_xlat[121] = {
+ 0x00, 0x01, 0x0F, 0x1F, 0x10, 0xE0, 0xF0, 0x11, 0xF1, 0x2F, 0xFF, 0x20,
+ 0x21, 0xE1, 0x02, 0x12, 0xF2, 0x03, 0xF3, 0x0E, 0x2E, 0xFE, 0x3F, 0x30,
+ 0x40, 0xD0, 0xC1, 0xD1, 0x22, 0xC2, 0x33, 0xE3, 0x0C, 0xCC, 0x0D, 0x1D,
+ 0x2D, 0xFD, 0x1E, 0x3E, 0x5E, 0xEF, 0xC0, 0x52, 0xB2, 0xD2, 0x43, 0xC3,
+ 0xD3, 0x24, 0x45, 0xF5, 0x4B, 0x5B, 0xFB, 0x1C, 0x3D, 0xBD, 0xDD, 0xEE,
+ 0xBF, 0xCF, 0xDF, 0x50, 0xB0, 0x31, 0x41, 0x51, 0xB1, 0x32, 0x42, 0xE2,
+ 0x13, 0x23, 0x53, 0xB3, 0x04, 0x14, 0x34, 0x44, 0x54, 0xB4, 0xC4, 0xD4,
+ 0xE4, 0xF4, 0x05, 0x15, 0x25, 0x35, 0x55, 0xB5, 0xC5, 0xD5, 0xE5, 0x0B,
+ 0x1B, 0x2B, 0x3B, 0xBB, 0xCB, 0xDB, 0xEB, 0x2C, 0x3C, 0x4C, 0x5C, 0xBC,
+ 0xDC, 0xEC, 0xFC, 0x4D, 0x5D, 0xCD, 0xED, 0x4E, 0xBE, 0xCE, 0xDE, 0x4F,
+ 0x5F
+};
+
+static const uint8_t huff_a55_cb[8] = { 1, 6, 1, 1, 1, 0, 3, 2 };
+
+static const uint8_t huff_a55_xlat[8] = { 0, 1, 2, 3, 6, 7, 4, 5 };
+
+static const uint8_t huff_a56_cb[7] = { 3, 7, 1, 8, 6, 8, 8 };
+
+static const uint8_t huff_a56_xlat[31] = {
+ 4, 0, 1, 2, 3, 28, 29, 30, 31, 5, 6, 7, 24, 25, 27, 8,
+ 9, 14, 19, 21, 22, 23, 26, 10, 11, 12, 13, 15, 17, 18, 20
+};
+
+static const uint8_t huff_a57_cb[9] = { 3, 9, 1, 5, 7, 8, 16, 22, 4 };
+
+static const uint8_t huff_a57_xlat[63] = {
+ 0, 1, 2, 61, 62, 63, 3, 4, 5, 6, 58, 59,
+ 60, 7, 8, 9, 10, 54, 55, 56, 57, 11, 12, 13,
+ 14, 15, 26, 27, 28, 36, 37, 38, 49, 50, 51, 52,
+ 53, 16, 17, 18, 19, 20, 21, 23, 24, 25, 29, 30,
+ 31, 33, 34, 35, 39, 43, 44, 45, 46, 47, 48, 22,
+ 40, 41, 42
+};
+
+static const uint8_t huff_a61_cb[12] = {
+ 2, 11, 1, 0, 8, 0, 1, 16, 10, 29, 12, 4
+};
+
+static const uint8_t huff_a61_xlat[81] = {
+ 0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0x70, 0x50, 0xD0,
+ 0xF0, 0x44, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0x31, 0x05, 0x0D, 0x13,
+ 0x07, 0x0F, 0x74, 0xCC, 0xDC, 0xFC, 0x41, 0xC1, 0x11, 0x43, 0xC3, 0x33,
+ 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0x51, 0xD1, 0x71, 0xF1, 0x45, 0xC5, 0x15,
+ 0x35, 0x4D, 0xCD, 0x1D, 0x3D, 0x53, 0xD3, 0x73, 0xF3, 0x47, 0xC7, 0x17,
+ 0x37, 0x4F, 0xCF, 0x1F, 0x3F, 0x55, 0xD5, 0x75, 0xF5, 0x5D, 0xDD, 0xFD,
+ 0x57, 0xD7, 0x77, 0xF7, 0xFF, 0x7D, 0x5F, 0xDF, 0x7F
+};
+
+static const uint8_t huff_a62_cb[8] = { 3, 8, 5, 2, 2, 9, 5, 2 };
+
+static const uint8_t huff_a62_xlat[25] = {
+ 0x00, 0x08, 0x38, 0x01, 0x07, 0x39, 0x0F, 0x09, 0x3F, 0x10, 0x30, 0x31,
+ 0x02, 0x3A, 0x06, 0x0E, 0x17, 0x37, 0x11, 0x0A, 0x32, 0x16, 0x3E, 0x12,
+ 0x36
+};
+
+static const uint8_t huff_a63_cb[11] = {
+ 3, 11, 1, 1, 10, 4, 16, 29, 46, 75, 74
+};
+
+static const uint8_t huff_a63_xlat[256] = {
+ 0x00, 0x40, 0x10, 0x50, 0x04, 0x44, 0x14, 0x01, 0x41, 0x05, 0x45, 0x55,
+ 0x54, 0x11, 0x51, 0x15, 0x80, 0x90, 0x60, 0x24, 0x64, 0xA4, 0x48, 0x61,
+ 0x95, 0x25, 0xA5, 0x02, 0x42, 0x52, 0x16, 0x56, 0x20, 0x84, 0x94, 0x18,
+ 0x58, 0x81, 0x91, 0x85, 0x65, 0x09, 0x49, 0x19, 0x59, 0x99, 0x29, 0x69,
+ 0x79, 0x5D, 0x12, 0x62, 0x06, 0x46, 0x86, 0x66, 0x1A, 0x5A, 0x6A, 0x47,
+ 0x17, 0xC0, 0xA0, 0xE0, 0xC4, 0xD4, 0x74, 0x08, 0x78, 0x0C, 0x4C, 0x1C,
+ 0x5C, 0xD1, 0x21, 0xE1, 0x71, 0xC5, 0xE5, 0x75, 0xB5, 0x89, 0xBD, 0x92,
+ 0x22, 0x96, 0xA6, 0x36, 0x0A, 0x4A, 0x8A, 0x9A, 0x2A, 0x7A, 0xDE, 0x6E,
+ 0x43, 0x13, 0x53, 0x23, 0x07, 0x77, 0x4B, 0x1B, 0x9B, 0x6B, 0x2F, 0xD0,
+ 0x30, 0x70, 0xE4, 0x34, 0xF4, 0xC8, 0x98, 0x28, 0x68, 0xA8, 0xE8, 0x38,
+ 0xB8, 0xF8, 0x9C, 0x2C, 0x6C, 0x7C, 0xA1, 0xB1, 0xD5, 0x35, 0xC9, 0xD9,
+ 0xA9, 0xE9, 0x39, 0xB9, 0xF9, 0xCD, 0x1D, 0x2D, 0xAD, 0x7D, 0xC2, 0xD2,
+ 0xA2, 0xB2, 0xF2, 0xC6, 0x26, 0x76, 0xB6, 0xDA, 0xAA, 0xEA, 0x3A, 0xFA,
+ 0x0E, 0x4E, 0x2E, 0x7E, 0xBE, 0xFE, 0x03, 0x83, 0x63, 0xA3, 0xB3, 0x87,
+ 0x57, 0x97, 0xD7, 0x27, 0x0B, 0x8B, 0x5B, 0x2B, 0xAB, 0xCF, 0x1F, 0x9F,
+ 0x7F, 0xBF, 0xB0, 0xF0, 0xB4, 0x88, 0xD8, 0x8C, 0xCC, 0xDC, 0xAC, 0xEC,
+ 0x3C, 0xBC, 0xFC, 0xC1, 0x31, 0xF1, 0xF5, 0x0D, 0x4D, 0x8D, 0x9D, 0xDD,
+ 0x6D, 0xED, 0x3D, 0xFD, 0x82, 0xE2, 0x32, 0x72, 0xD6, 0xE6, 0xF6, 0xCA,
+ 0xBA, 0x8E, 0xCE, 0x1E, 0x5E, 0x9E, 0xAE, 0xEE, 0x3E, 0xC3, 0x93, 0xD3,
+ 0xE3, 0x33, 0x73, 0xF3, 0xC7, 0x67, 0xA7, 0xE7, 0x37, 0xB7, 0xF7, 0xCB,
+ 0xDB, 0xEB, 0x3B, 0x7B, 0xBB, 0xFB, 0x0F, 0x4F, 0x8F, 0x5F, 0xDF, 0x6F,
+ 0xAF, 0xEF, 0x3F, 0xFF
+};
+
+static const uint8_t huff_a64_cb[8] = { 4, 9, 1, 7, 12, 36, 63, 2 };
+
+static const uint8_t huff_a64_xlat[121] = {
+ 0x00, 0x10, 0x20, 0xE0, 0xF0, 0x02, 0x0E, 0xEF, 0x30, 0x01, 0x11, 0x21,
+ 0x31, 0xF1, 0x12, 0xF2, 0x1E, 0xEE, 0xDF, 0xFF, 0x40, 0xC0, 0xD0, 0xD1,
+ 0xE1, 0x22, 0x32, 0x42, 0xD2, 0xE2, 0x03, 0x13, 0x23, 0xB3, 0xC3, 0xE3,
+ 0xF3, 0xE4, 0x05, 0xF5, 0x2B, 0x0C, 0xFC, 0x1D, 0x2D, 0xBD, 0xDD, 0xFD,
+ 0x2E, 0x4E, 0xDE, 0xFE, 0x0F, 0x1F, 0x2F, 0x3F, 0x50, 0xB0, 0x41, 0x51,
+ 0xB1, 0xC1, 0x52, 0xB2, 0xC2, 0x33, 0x43, 0x53, 0xD3, 0x04, 0x14, 0x24,
+ 0x34, 0x44, 0x54, 0xB4, 0xC4, 0xD4, 0xF4, 0x15, 0x25, 0x35, 0x45, 0x55,
+ 0xB5, 0xC5, 0xD5, 0xE5, 0x0B, 0x1B, 0x3B, 0x4B, 0x5B, 0xBB, 0xCB, 0xDB,
+ 0xEB, 0xFB, 0x1C, 0x2C, 0x3C, 0x4C, 0x5C, 0xBC, 0xCC, 0xDC, 0xEC, 0x0D,
+ 0x3D, 0x4D, 0x5D, 0xCD, 0xED, 0x3E, 0x5E, 0xBE, 0xCE, 0x4F, 0xCF, 0x5F,
+ 0xBF
+};
+
+static const uint8_t huff_a65_cb[8] = { 2, 7, 3, 0, 1, 3, 4, 4 };
+
+static const uint8_t huff_a65_xlat[15] = {
+ 0, 1, 15, 14, 2, 3, 13, 4, 6, 10, 12, 5, 7, 9, 11
+};
+
+static const uint8_t huff_a66_cb[11] = { 2, 10, 1, 2, 2, 6, 8, 6, 3, 1, 2 };
+
+static const uint8_t huff_a66_xlat[31] = {
+ 0, 1, 31, 2, 30, 3, 4, 15, 17, 28, 29, 5, 6, 7, 8, 24,
+ 25, 26, 27, 9, 10, 11, 21, 22, 23, 12, 19, 20, 13, 14, 18
+};
+
+static const uint8_t huff_a67_cb[10] = { 2, 9, 1, 1, 3, 4, 6, 13, 25, 10 };
+
+static const uint8_t huff_a67_xlat[63] = {
+ 0, 1, 2, 62, 63, 3, 4, 60, 61, 5, 6, 7, 57, 58, 59, 8,
+ 9, 10, 11, 12, 13, 26, 38, 52, 53, 54, 55, 56, 14, 15, 16, 17,
+ 18, 19, 25, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 39, 45, 46,
+ 47, 48, 49, 50, 51, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44
+};
+
+static const uint8_t huff_a71_cb[5] = { 1, 3, 1, 1, 2 };
+
+static const uint8_t huff_a72_cb[12] = {
+ 2, 11, 1, 0, 4, 8, 3, 8, 24, 17, 12, 4
+};
+
+static const uint8_t huff_a72_xlat[81] = {
+ 0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x05,
+ 0x15, 0x51, 0x45, 0x55, 0x80, 0x90, 0x20, 0x64, 0x08, 0x19, 0x02, 0x06,
+ 0x60, 0x84, 0x94, 0x24, 0x48, 0x18, 0x58, 0x81, 0x91, 0x21, 0x61, 0x85,
+ 0x95, 0x25, 0x65, 0x09, 0x49, 0x59, 0x42, 0x12, 0x52, 0x46, 0x16, 0x56,
+ 0xA0, 0xA4, 0x98, 0x28, 0x68, 0xA1, 0xA5, 0x99, 0x29, 0x69, 0x96, 0x26,
+ 0x66, 0x0A, 0x4A, 0x1A, 0x5A, 0x88, 0xA8, 0x89, 0xA9, 0x82, 0x92, 0x22,
+ 0x62, 0x86, 0xA6, 0x2A, 0x6A, 0xA2, 0x8A, 0x9A, 0xAA
+};
+
+static const uint8_t huff_a73_cb[11] = { 2, 10, 1, 1, 5, 2, 8, 7, 13, 8, 4 };
+
+static const uint8_t huff_a73_xlat[49] = {
+ 0x00, 0x08, 0x38, 0x01, 0x39, 0x07, 0x0F, 0x09, 0x3F, 0x10, 0x30, 0x31,
+ 0x02, 0x3A, 0x06, 0x0E, 0x17, 0x11, 0x0A, 0x32, 0x0D, 0x16, 0x3E, 0x37,
+ 0x18, 0x28, 0x19, 0x29, 0x12, 0x2A, 0x03, 0x3B, 0x05, 0x15, 0x1E, 0x1F,
+ 0x2F, 0x1A, 0x0B, 0x2B, 0x33, 0x35, 0x3D, 0x2E, 0x36, 0x13, 0x1B, 0x1D,
+ 0x2D
+};
+
+static const uint8_t huff_a74_cb[14] = {
+ 1, 12, 1, 0, 0, 4, 0, 4, 5, 9, 30, 45, 21, 2
+};
+
+static const uint8_t huff_a74_xlat[121] = {
+ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x02,
+ 0xF2, 0x0E, 0x21, 0xE1, 0x12, 0xE2, 0x1E, 0x2E, 0xFE, 0x2F, 0xEF, 0x30,
+ 0x50, 0xB0, 0xC0, 0xD0, 0x31, 0xB1, 0xD1, 0x22, 0xD2, 0x03, 0x13, 0xE3,
+ 0xF3, 0xF4, 0x05, 0xE5, 0xF5, 0x0B, 0x1B, 0x0C, 0x0D, 0x1D, 0x2D, 0xFD,
+ 0x3E, 0xEE, 0x3F, 0x5F, 0xDF, 0x40, 0x41, 0x51, 0xC1, 0x32, 0x42, 0x52,
+ 0xB2, 0xC2, 0x23, 0x33, 0xB3, 0xC3, 0xD3, 0x04, 0x14, 0x24, 0xD4, 0xE4,
+ 0x15, 0x25, 0xC5, 0xD5, 0x2B, 0x3B, 0xEB, 0xFB, 0x1C, 0x2C, 0x3C, 0x5C,
+ 0xEC, 0xFC, 0x3D, 0x5D, 0xDD, 0xED, 0x4E, 0x5E, 0xBE, 0xCE, 0xDE, 0x4F,
+ 0xBF, 0xCF, 0x43, 0x53, 0x34, 0x54, 0xB4, 0xC4, 0x35, 0x45, 0x55, 0xB5,
+ 0x4B, 0x5B, 0xCB, 0xDB, 0x4C, 0xBC, 0xCC, 0xDC, 0x4D, 0xBD, 0xCD, 0x44,
+ 0xBB
+};
+
+static const uint8_t huff_a75_cb[7] = { 2, 6, 1, 3, 3, 4, 4 };
+
+static const uint8_t huff_a75_xlat[15] = {
+ 0, 1, 14, 15, 2, 3, 13, 4, 6, 10, 12, 5, 7, 9, 11
+};
+
+static const uint8_t huff_a76_cb[12] = {
+ 3, 12, 1, 3, 4, 8, 10, 36, 60, 78, 48, 8
+};
+
+static const uint8_t huff_a76_xlat[256] = {
+ 0x00, 0x10, 0x01, 0x11, 0x20, 0x21, 0x02, 0x12, 0x30, 0x31, 0x41, 0x22,
+ 0x03, 0x13, 0x23, 0x14, 0x40, 0x51, 0x61, 0x32, 0x42, 0x33, 0x04, 0x24,
+ 0x15, 0x16, 0x50, 0x60, 0xD0, 0x71, 0x81, 0xD1, 0xE1, 0xF1, 0x52, 0x62,
+ 0x72, 0xD2, 0x43, 0x53, 0x63, 0xD3, 0x34, 0x44, 0x54, 0x05, 0x25, 0x35,
+ 0x45, 0x06, 0x26, 0x36, 0x17, 0x27, 0x18, 0x0D, 0x1D, 0x2D, 0x3D, 0x1E,
+ 0x2E, 0x1F, 0x70, 0x80, 0xE0, 0xF0, 0x91, 0xA1, 0xC1, 0x82, 0x92, 0xC2,
+ 0xE2, 0xF2, 0x73, 0x83, 0x93, 0xE3, 0xF3, 0x64, 0x74, 0x84, 0xD4, 0xE4,
+ 0xF4, 0x55, 0x65, 0xD5, 0xE5, 0xF5, 0x46, 0x56, 0x66, 0xD6, 0x07, 0x37,
+ 0x47, 0x57, 0x08, 0x28, 0x38, 0x48, 0x19, 0x29, 0x39, 0x1A, 0x2A, 0x1B,
+ 0x1C, 0x2C, 0x3C, 0x4D, 0x5D, 0x6D, 0x0E, 0x3E, 0x4E, 0x5E, 0x0F, 0x2F,
+ 0x3F, 0x4F, 0x90, 0xA0, 0xB0, 0xC0, 0xB1, 0xA2, 0xB2, 0xA3, 0xB3, 0xC3,
+ 0x94, 0xA4, 0xB4, 0xC4, 0x75, 0x85, 0x95, 0xA5, 0xC5, 0x76, 0x86, 0x96,
+ 0xE6, 0xF6, 0x67, 0x77, 0x87, 0xD7, 0xE7, 0xF7, 0x58, 0x68, 0x78, 0x88,
+ 0xD8, 0xE8, 0xF8, 0x09, 0x49, 0x59, 0x69, 0xD9, 0xE9, 0xF9, 0x0A, 0x3A,
+ 0x4A, 0x5A, 0xDA, 0xEA, 0x0B, 0x2B, 0x3B, 0x4B, 0xDB, 0x0C, 0x4C, 0x5C,
+ 0x6C, 0xDC, 0x7D, 0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0x6E, 0x7E, 0x8E, 0x9E,
+ 0xAE, 0xBE, 0x5F, 0x6F, 0x7F, 0x8F, 0x9F, 0xAF, 0xB5, 0xA6, 0xB6, 0xC6,
+ 0x97, 0xA7, 0xC7, 0x98, 0xA8, 0xB8, 0xC8, 0x79, 0x89, 0x99, 0xA9, 0xB9,
+ 0xC9, 0x6A, 0x7A, 0x8A, 0x9A, 0xAA, 0xCA, 0xFA, 0x5B, 0x6B, 0x7B, 0x8B,
+ 0xCB, 0xEB, 0xFB, 0x7C, 0x8C, 0x9C, 0xAC, 0xBC, 0xEC, 0xFC, 0xDD, 0xED,
+ 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xBF, 0xCF, 0xDF, 0xB7, 0xBA, 0x9B, 0xAB,
+ 0xBB, 0xCC, 0xEF, 0xFF
+};
+
+static const uint8_t huff_b01_cb[14] = {
+ 1, 12, 1, 0, 0, 2, 6, 0, 11, 13, 12, 24, 4, 8
+};
+
+static const uint8_t huff_b01_xlat[81] = {
+ 0x00, 0x01, 0x03, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x50, 0xD0, 0x70,
+ 0xF0, 0x34, 0x1C, 0x05, 0x0D, 0x13, 0x07, 0x0F, 0x44, 0xC4, 0x14, 0x4C,
+ 0xCC, 0x3C, 0x41, 0xC1, 0x11, 0x31, 0x43, 0xC3, 0x33, 0x54, 0x74, 0xDC,
+ 0xFC, 0x71, 0x15, 0x4D, 0x1D, 0xD3, 0xC7, 0x37, 0x3F, 0xD4, 0xF4, 0x5C,
+ 0x7C, 0x51, 0xD1, 0xF1, 0x45, 0xC5, 0x55, 0x35, 0xCD, 0xDD, 0x3D, 0x53,
+ 0x73, 0xF3, 0x47, 0x17, 0x77, 0x4F, 0xCF, 0x1F, 0xFF, 0xF5, 0x7D, 0xD7,
+ 0x5F, 0xD5, 0x75, 0x5D, 0xFD, 0x57, 0xF7, 0xDF, 0x7F
+};
+
+static const uint8_t huff_b02_cb[14] = {
+ 1, 12, 1, 0, 0, 4, 0, 8, 4, 9, 19, 13, 13, 10
+};
+
+static const uint8_t huff_b02_xlat[81] = {
+ 0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x05,
+ 0x15, 0x80, 0x51, 0x45, 0x55, 0x90, 0x20, 0x60, 0x24, 0x08, 0x18, 0x09,
+ 0x02, 0x06, 0x84, 0x94, 0x64, 0x48, 0x58, 0x81, 0x91, 0x21, 0x61, 0x95,
+ 0x25, 0x65, 0x19, 0x59, 0x42, 0x12, 0x46, 0x16, 0x56, 0xA0, 0xA4, 0x28,
+ 0x68, 0x85, 0xA5, 0x49, 0x29, 0x69, 0x52, 0x0A, 0x1A, 0x5A, 0x88, 0x98,
+ 0xA1, 0x89, 0x99, 0xA9, 0x22, 0x62, 0x96, 0x26, 0x66, 0x4A, 0x6A, 0xA8,
+ 0x82, 0x92, 0xA2, 0x86, 0xA6, 0x8A, 0x9A, 0x2A, 0xAA
+};
+
+static const uint8_t huff_b03_cb[11] = { 1, 9, 1, 0, 0, 4, 0, 5, 12, 13, 14 };
+
+static const uint8_t huff_b03_xlat[49] = {
+ 0x00, 0x08, 0x38, 0x01, 0x07, 0x30, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x18,
+ 0x28, 0x31, 0x02, 0x3A, 0x03, 0x05, 0x06, 0x0E, 0x17, 0x37, 0x11, 0x19,
+ 0x29, 0x0A, 0x32, 0x0B, 0x3B, 0x0D, 0x15, 0x3D, 0x3E, 0x1F, 0x2F, 0x12,
+ 0x1A, 0x2A, 0x13, 0x1B, 0x2B, 0x33, 0x1D, 0x2D, 0x35, 0x16, 0x1E, 0x2E,
+ 0x36
+};
+
+static const uint8_t huff_b04_cb[12] = {
+ 2, 11, 1, 0, 4, 4, 5, 9, 30, 45, 21, 2
+};
+
+static const uint8_t huff_b04_xlat[121] = {
+ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x02,
+ 0xF2, 0x0E, 0x21, 0xE1, 0x12, 0xE2, 0x1E, 0x2E, 0xFE, 0x2F, 0xEF, 0x30,
+ 0x50, 0xB0, 0xC0, 0xD0, 0x31, 0xB1, 0xD1, 0x22, 0xD2, 0x03, 0x13, 0xE3,
+ 0xF3, 0xF4, 0x05, 0xE5, 0xF5, 0x0B, 0x1B, 0x0C, 0x0D, 0x1D, 0x2D, 0xFD,
+ 0x3E, 0xEE, 0x3F, 0x5F, 0xDF, 0x40, 0x41, 0x51, 0xC1, 0x32, 0x42, 0x52,
+ 0xB2, 0xC2, 0x23, 0x33, 0xB3, 0xC3, 0xD3, 0x04, 0x14, 0x24, 0xD4, 0xE4,
+ 0x15, 0x25, 0xC5, 0xD5, 0x2B, 0x3B, 0xEB, 0xFB, 0x1C, 0x2C, 0x3C, 0x5C,
+ 0xEC, 0xFC, 0x3D, 0x5D, 0xDD, 0xED, 0x4E, 0x5E, 0xBE, 0xCE, 0xDE, 0x4F,
+ 0xBF, 0xCF, 0x43, 0x53, 0x34, 0x54, 0xB4, 0xC4, 0x35, 0x45, 0x55, 0xB5,
+ 0x4B, 0x5B, 0xCB, 0xDB, 0x4C, 0xBC, 0xCC, 0xDC, 0x4D, 0xBD, 0xCD, 0x44,
+ 0xBB
+};
+
+static const uint8_t huff_b05_cb[11] = {
+ 3, 11, 1, 4, 4, 4, 12, 30, 73, 75, 22
+};
+
+static const uint8_t huff_b05_xlat[225] = {
+ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x02,
+ 0x0E, 0x30, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x0D, 0x1E, 0xFE, 0x2F,
+ 0xEF, 0x40, 0x60, 0x70, 0x90, 0xA0, 0xC0, 0x31, 0xD1, 0x22, 0x32, 0xD2,
+ 0xE2, 0x13, 0x23, 0xE3, 0xF3, 0x04, 0x06, 0x07, 0x09, 0x0A, 0x0C, 0x1D,
+ 0x2D, 0xFD, 0x2E, 0x3E, 0xEE, 0x3F, 0xDF, 0x50, 0xB0, 0x41, 0x51, 0x61,
+ 0x71, 0x91, 0xA1, 0xB1, 0xC1, 0x42, 0x62, 0x72, 0x92, 0xA2, 0xC2, 0x33,
+ 0x93, 0xA3, 0xD3, 0x14, 0x24, 0xE4, 0xF4, 0x05, 0x15, 0xF5, 0x16, 0x26,
+ 0xD6, 0xE6, 0xF6, 0x17, 0x27, 0xD7, 0xE7, 0xF7, 0x19, 0x29, 0x39, 0xE9,
+ 0xF9, 0x1A, 0x2A, 0xEA, 0xFA, 0x0B, 0x1B, 0xFB, 0x1C, 0x2C, 0xEC, 0xFC,
+ 0x3D, 0x7D, 0x9D, 0xDD, 0xED, 0x4E, 0x6E, 0x7E, 0x9E, 0xAE, 0xCE, 0xDE,
+ 0x4F, 0x5F, 0x6F, 0x7F, 0x9F, 0xAF, 0xBF, 0xCF, 0x52, 0xB2, 0x43, 0x53,
+ 0x63, 0x73, 0xB3, 0xC3, 0x34, 0x44, 0x64, 0x74, 0x94, 0xA4, 0xB4, 0xC4,
+ 0xD4, 0x25, 0x35, 0x65, 0x75, 0x95, 0xA5, 0xD5, 0xE5, 0x36, 0x46, 0x56,
+ 0x66, 0xA6, 0xB6, 0xC6, 0x37, 0x47, 0x57, 0xB7, 0xC7, 0x49, 0x59, 0x69,
+ 0xB9, 0xC9, 0xD9, 0x3A, 0x4A, 0x5A, 0x6A, 0xAA, 0xBA, 0xCA, 0xDA, 0x2B,
+ 0x3B, 0x6B, 0x7B, 0x9B, 0xAB, 0xDB, 0xEB, 0x3C, 0x4C, 0x6C, 0x7C, 0x9C,
+ 0xAC, 0xCC, 0xDC, 0x4D, 0x5D, 0x6D, 0xAD, 0xBD, 0xCD, 0x5E, 0xBE, 0x54,
+ 0x45, 0x55, 0xB5, 0xC5, 0x76, 0x96, 0x67, 0x77, 0x97, 0xA7, 0x79, 0x99,
+ 0xA9, 0x7A, 0x9A, 0x4B, 0x5B, 0xBB, 0xCB, 0x5C, 0xBC
+};
+
+static const uint8_t huff_b07_cb[9] = { 3, 9, 3, 2, 4, 8, 23, 13, 10 };
+
+static const uint8_t huff_b07_xlat[63] = {
+ 0, 1, 63, 2, 62, 3, 4, 60, 61, 5, 6, 7, 8, 56, 57, 58,
+ 59, 9, 10, 11, 12, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36,
+ 37, 38, 39, 51, 52, 53, 54, 55, 13, 14, 15, 16, 17, 18, 19, 45,
+ 46, 47, 48, 49, 50, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44
+};
+
+static const uint8_t huff_b12_cb[10] = { 3, 10, 1, 3, 12, 0, 30, 9, 18, 8 };
+
+static const uint8_t huff_b12_xlat[81] = {
+ 0x00, 0x40, 0x04, 0x01, 0x10, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51,
+ 0x05, 0x45, 0x15, 0x55, 0x80, 0x90, 0x20, 0x60, 0x84, 0x94, 0x24, 0x64,
+ 0x08, 0x48, 0x18, 0x81, 0x91, 0x61, 0x85, 0x95, 0x25, 0x65, 0x09, 0x49,
+ 0x19, 0x59, 0x02, 0x42, 0x12, 0x52, 0x06, 0x46, 0x16, 0x56, 0xA4, 0x58,
+ 0x68, 0x21, 0xA5, 0x29, 0x69, 0x1A, 0x5A, 0xA0, 0x88, 0x98, 0x28, 0xA1,
+ 0x89, 0x99, 0xA9, 0x92, 0x22, 0x62, 0x86, 0x96, 0x26, 0x66, 0x0A, 0x4A,
+ 0x6A, 0xA8, 0x82, 0xA2, 0xA6, 0x8A, 0x9A, 0x2A, 0xAA
+};
+
+static const uint8_t huff_b14_cb[14] = {
+ 1, 12, 1, 0, 0, 4, 0, 3, 5, 16, 28, 34, 26, 4
+};
+
+static const uint8_t huff_b14_xlat[121] = {
+ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x11, 0x02,
+ 0x0E, 0x30, 0x50, 0xB0, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x05, 0x0B,
+ 0x0D, 0x1E, 0xFE, 0x2F, 0xEF, 0x40, 0xC0, 0x31, 0x51, 0xB1, 0xC1, 0xD1,
+ 0x22, 0x52, 0xE2, 0x13, 0xF3, 0x04, 0x15, 0xF5, 0x1B, 0xEB, 0xFB, 0x0C,
+ 0x1D, 0xFD, 0x2E, 0x5E, 0xEE, 0x3F, 0x5F, 0xBF, 0xDF, 0x41, 0x32, 0x42,
+ 0xB2, 0xD2, 0x23, 0x53, 0xB3, 0xE3, 0x14, 0x24, 0xE4, 0xF4, 0x25, 0x35,
+ 0xD5, 0xE5, 0x2B, 0x3B, 0xDB, 0x1C, 0x2C, 0xBC, 0xEC, 0xFC, 0x2D, 0xBD,
+ 0xED, 0x3E, 0x4E, 0xBE, 0xDE, 0x4F, 0xCF, 0xC2, 0x33, 0x43, 0xC3, 0xD3,
+ 0x34, 0x44, 0x54, 0xB4, 0xD4, 0x45, 0x55, 0xC5, 0x4B, 0xCB, 0x3C, 0x4C,
+ 0x5C, 0xCC, 0xDC, 0x3D, 0x4D, 0x5D, 0xCD, 0xDD, 0xCE, 0xC4, 0xB5, 0x5B,
+ 0xBB
+};
+
+static const uint8_t huff_b16_cb[11] = {
+ 4, 12, 4, 4, 9, 13, 37, 76, 72, 39, 2
+};
+
+static const uint8_t huff_b16_xlat[256] = {
+ 0x00, 0x10, 0x01, 0x11, 0x20, 0x21, 0x02, 0x12, 0x30, 0x31, 0x41, 0x22,
+ 0x32, 0x03, 0x13, 0x23, 0x14, 0x40, 0x51, 0x61, 0x42, 0x52, 0x33, 0x43,
+ 0x04, 0x24, 0x34, 0x15, 0x25, 0x16, 0x50, 0x60, 0x70, 0x71, 0x81, 0xD1,
+ 0xE1, 0x62, 0x72, 0x82, 0xD2, 0x53, 0x63, 0x73, 0xD3, 0x44, 0x54, 0x05,
+ 0x35, 0x45, 0x55, 0x06, 0x26, 0x36, 0x07, 0x17, 0x27, 0x37, 0x18, 0x28,
+ 0x19, 0x1D, 0x2D, 0x3D, 0x1E, 0x2E, 0x1F, 0x80, 0x90, 0xD0, 0xE0, 0xF0,
+ 0x91, 0xA1, 0xB1, 0xC1, 0xF1, 0x92, 0xA2, 0xB2, 0xC2, 0xE2, 0xF2, 0x83,
+ 0x93, 0xA3, 0xC3, 0xE3, 0xF3, 0x64, 0x74, 0x84, 0x94, 0xD4, 0xE4, 0xF4,
+ 0x65, 0x75, 0x85, 0xD5, 0xE5, 0x46, 0x56, 0x66, 0x76, 0xD6, 0xE6, 0x47,
+ 0x57, 0x67, 0xD7, 0x08, 0x38, 0x48, 0x58, 0x09, 0x29, 0x39, 0x49, 0x0A,
+ 0x1A, 0x2A, 0x3A, 0x1B, 0x2B, 0x0C, 0x1C, 0x2C, 0x3C, 0x0D, 0x4D, 0x5D,
+ 0x6D, 0x7D, 0x0E, 0x3E, 0x4E, 0x5E, 0x6E, 0x0F, 0x2F, 0x3F, 0x4F, 0xA0,
+ 0xB0, 0xC0, 0xB3, 0xA4, 0xB4, 0xC4, 0x95, 0xA5, 0xB5, 0xC5, 0xF5, 0x86,
+ 0x96, 0xA6, 0xB6, 0xC6, 0xF6, 0x77, 0x87, 0x97, 0xA7, 0xC7, 0xE7, 0xF7,
+ 0x68, 0x78, 0x88, 0x98, 0xD8, 0xE8, 0xF8, 0x59, 0x69, 0x79, 0x89, 0xD9,
+ 0xE9, 0xF9, 0x4A, 0x5A, 0x6A, 0x7A, 0xDA, 0xEA, 0x0B, 0x3B, 0x4B, 0x5B,
+ 0xDB, 0xEB, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0xDC, 0x8D, 0x9D, 0xAD, 0xBD,
+ 0xCD, 0x7E, 0x8E, 0x9E, 0xAE, 0xBE, 0x5F, 0x6F, 0x7F, 0x8F, 0x9F, 0xB7,
+ 0xA8, 0xB8, 0xC8, 0x99, 0xA9, 0xB9, 0xC9, 0x8A, 0x9A, 0xAA, 0xBA, 0xCA,
+ 0xFA, 0x6B, 0x7B, 0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0xFB, 0x9C, 0xAC, 0xBC,
+ 0xCC, 0xEC, 0xFC, 0xDD, 0xED, 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xAF, 0xBF,
+ 0xCF, 0xDF, 0xEF, 0xFF
+};
+
+static const uint8_t huff_b26_cb[12] = {
+ 3, 12, 2, 2, 4, 5, 11, 26, 67, 78, 51, 10
+};
+
+static const uint8_t huff_b26_xlat[256] = {
+ 0x00, 0x01, 0x10, 0x11, 0x20, 0x21, 0x02, 0x12, 0x30, 0x31, 0x22, 0x03,
+ 0x13, 0x40, 0x41, 0x51, 0x32, 0x42, 0x23, 0x33, 0x04, 0x14, 0x24, 0x15,
+ 0x50, 0x61, 0x71, 0xD1, 0xE1, 0x52, 0x62, 0xD2, 0x43, 0x53, 0xD3, 0x34,
+ 0x44, 0x05, 0x25, 0x35, 0x06, 0x16, 0x26, 0x17, 0x18, 0x1D, 0x2D, 0x3D,
+ 0x1E, 0x2E, 0x60, 0x70, 0x80, 0xD0, 0xE0, 0xF0, 0x81, 0x91, 0xA1, 0xC1,
+ 0xF1, 0x72, 0x82, 0x92, 0xC2, 0xE2, 0xF2, 0x63, 0x73, 0xE3, 0xF3, 0x54,
+ 0x64, 0x74, 0xD4, 0xE4, 0xF4, 0x45, 0x55, 0x65, 0xD5, 0xE5, 0xF5, 0x36,
+ 0x46, 0x56, 0xD6, 0xE6, 0x07, 0x27, 0x37, 0x47, 0xD7, 0x08, 0x28, 0x38,
+ 0x19, 0x29, 0x1A, 0x1B, 0x1C, 0x2C, 0x0D, 0x4D, 0x5D, 0x6D, 0x7D, 0x0E,
+ 0x3E, 0x4E, 0x5E, 0x6E, 0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x90, 0xA0, 0xC0,
+ 0xB1, 0xA2, 0xB2, 0x83, 0x93, 0xA3, 0xB3, 0xC3, 0x84, 0x94, 0xA4, 0xC4,
+ 0x75, 0x85, 0x95, 0xC5, 0x66, 0x76, 0x86, 0x96, 0xC6, 0xF6, 0x57, 0x67,
+ 0x77, 0xE7, 0xF7, 0x48, 0x58, 0x68, 0x78, 0xD8, 0xE8, 0xF8, 0x09, 0x39,
+ 0x49, 0x59, 0xD9, 0xE9, 0xF9, 0x0A, 0x2A, 0x3A, 0x4A, 0xDA, 0xEA, 0x0B,
+ 0x2B, 0x3B, 0xDB, 0xEB, 0x0C, 0x3C, 0x4C, 0x5C, 0x6C, 0xDC, 0x8D, 0x9D,
+ 0xAD, 0xBD, 0xCD, 0x7E, 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0x5F, 0x6F, 0x7F,
+ 0x8F, 0x9F, 0xAF, 0xB0, 0xB4, 0xA5, 0xB5, 0xA6, 0xB6, 0x87, 0x97, 0xA7,
+ 0xB7, 0xC7, 0x88, 0x98, 0xA8, 0xC8, 0x69, 0x79, 0x89, 0x99, 0xA9, 0xC9,
+ 0x5A, 0x6A, 0x7A, 0x9A, 0xCA, 0xFA, 0x4B, 0x5B, 0x6B, 0x7B, 0xCB, 0xFB,
+ 0x7C, 0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xEC, 0xFC, 0xDD, 0xED, 0xFD, 0xDE,
+ 0xEE, 0xFE, 0xBF, 0xCF, 0xDF, 0xEF, 0xB8, 0xB9, 0x8A, 0xAA, 0xBA, 0x8B,
+ 0x9B, 0xAB, 0xBB, 0xFF
+};
+
+static const uint8_t huff_b32_cb[12] = {
+ 2, 11, 1, 0, 4, 6, 7, 10, 22, 11, 16, 4
+};
+
+static const uint8_t huff_b32_xlat[81] = {
+ 0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x41, 0x11, 0x05, 0x80,
+ 0x54, 0x51, 0x45, 0x15, 0x55, 0x02, 0x90, 0x20, 0x60, 0x84, 0x24, 0x08,
+ 0x18, 0x09, 0x12, 0x06, 0xA0, 0x94, 0x64, 0x48, 0x58, 0x81, 0x91, 0x21,
+ 0x61, 0x85, 0x95, 0x25, 0x65, 0x49, 0x19, 0x59, 0x42, 0x52, 0x46, 0x16,
+ 0x56, 0x0A, 0xA4, 0x28, 0x68, 0xA1, 0xA5, 0x29, 0x69, 0x26, 0x4A, 0x1A,
+ 0x5A, 0x88, 0x98, 0xA8, 0x89, 0x99, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x86,
+ 0x96, 0x66, 0x9A, 0x2A, 0x6A, 0xA2, 0xA6, 0x8A, 0xAA
+};
+
+static const uint8_t huff_b33_cb[13] = {
+ 2, 12, 1, 0, 0, 4, 11, 8, 28, 92, 97, 13, 2
+};
+
+static const uint8_t huff_b33_xlat[256] = {
+ 0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51,
+ 0x05, 0x45, 0x15, 0x55, 0x20, 0x95, 0x65, 0x49, 0x59, 0x52, 0x46, 0x16,
+ 0x80, 0x90, 0x60, 0x84, 0x94, 0x24, 0x64, 0xA4, 0x08, 0x48, 0x18, 0x58,
+ 0x81, 0x91, 0x21, 0x61, 0x85, 0x25, 0x09, 0x19, 0x69, 0x02, 0x42, 0x12,
+ 0x06, 0x56, 0x5A, 0x57, 0xD0, 0x74, 0x68, 0x5C, 0xC1, 0xD5, 0xA5, 0xE5,
+ 0x75, 0xB5, 0xF5, 0x99, 0xD9, 0xA9, 0xE9, 0x79, 0xB9, 0xF9, 0x1D, 0x5D,
+ 0x9D, 0xDD, 0x6D, 0xAD, 0xED, 0x7D, 0xBD, 0xFD, 0x82, 0x92, 0xD2, 0x62,
+ 0x96, 0xD6, 0x26, 0x66, 0xA6, 0xE6, 0x76, 0xB6, 0xF6, 0x0A, 0x4A, 0x1A,
+ 0x9A, 0xDA, 0x2A, 0x6A, 0xAA, 0xEA, 0x7A, 0xBA, 0xFA, 0x5E, 0x9E, 0xDE,
+ 0x6E, 0xAE, 0xEE, 0x7E, 0xBE, 0xFE, 0x03, 0x13, 0x53, 0x17, 0x97, 0xD7,
+ 0x67, 0xA7, 0xE7, 0x77, 0xB7, 0xF7, 0x5B, 0x9B, 0xDB, 0x6B, 0xAB, 0xEB,
+ 0x7B, 0xBB, 0xFB, 0x5F, 0x9F, 0xDF, 0x6F, 0xAF, 0xEF, 0x7F, 0xBF, 0xFF,
+ 0xC0, 0xA0, 0xE0, 0x30, 0xC4, 0xD4, 0xE4, 0x34, 0xB4, 0xF4, 0x88, 0xC8,
+ 0x98, 0xD8, 0x28, 0xA8, 0xE8, 0x38, 0x78, 0xB8, 0xF8, 0x0C, 0x4C, 0x1C,
+ 0x9C, 0xDC, 0x6C, 0xAC, 0xEC, 0x7C, 0xBC, 0xFC, 0xD1, 0xA1, 0xE1, 0x31,
+ 0x71, 0xB1, 0xF1, 0xC5, 0x35, 0x89, 0xC9, 0x29, 0x39, 0x0D, 0x4D, 0x8D,
+ 0xCD, 0x2D, 0x3D, 0x22, 0xA2, 0xE2, 0x72, 0xB2, 0xF2, 0x86, 0xC6, 0x36,
+ 0x8A, 0xCA, 0x3A, 0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x2E, 0x3E, 0x43, 0x83,
+ 0x93, 0xD3, 0x23, 0x63, 0xA3, 0xE3, 0x73, 0xB3, 0xF3, 0x07, 0x47, 0x87,
+ 0xC7, 0x27, 0x37, 0x4B, 0x8B, 0xCB, 0x1B, 0x2B, 0x3B, 0x4F, 0x8F, 0xCF,
+ 0x1F, 0x70, 0xB0, 0xF0, 0x8C, 0xCC, 0x2C, 0x3C, 0xC2, 0x32, 0xC3, 0x0F,
+ 0x2F, 0x3F, 0x33, 0x0B
+};
+
+static const uint8_t huff_b35_cb[14] = {
+ 1, 12, 1, 0, 0, 0, 4, 6, 6, 14, 42, 63, 59, 30
+};
+
+static const uint8_t huff_b35_xlat[225] = {
+ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x02, 0x0E, 0x1F, 0xFF, 0x20,
+ 0xE0, 0x21, 0xF2, 0xFE, 0xEF, 0x30, 0xD0, 0xE1, 0x12, 0x22, 0xE2, 0x03,
+ 0x0D, 0x1D, 0x1E, 0x2E, 0xEE, 0x2F, 0xDF, 0x40, 0x60, 0x70, 0x90, 0xA0,
+ 0xB0, 0xC0, 0x31, 0x71, 0x91, 0xC1, 0xD1, 0x32, 0xD2, 0x13, 0xE3, 0xF3,
+ 0x04, 0x05, 0x06, 0x07, 0x17, 0xF7, 0x09, 0x19, 0x0A, 0x1A, 0xFA, 0x0C,
+ 0x1C, 0x2D, 0xED, 0xFD, 0x3E, 0x7E, 0xDE, 0x3F, 0x6F, 0x7F, 0x9F, 0xAF,
+ 0xCF, 0x50, 0x41, 0x51, 0x61, 0xA1, 0xB1, 0x62, 0x72, 0x92, 0xA2, 0xC2,
+ 0x23, 0x33, 0x63, 0x73, 0x93, 0xA3, 0xD3, 0x14, 0x24, 0x34, 0xD4, 0xE4,
+ 0xF4, 0x15, 0xF5, 0x16, 0x26, 0xD6, 0xE6, 0xF6, 0x27, 0x37, 0x47, 0xE7,
+ 0x29, 0x39, 0xC9, 0xD9, 0xE9, 0xF9, 0x2A, 0xEA, 0x0B, 0x1B, 0xFB, 0x2C,
+ 0x7C, 0xEC, 0xFC, 0x3D, 0x4D, 0x6D, 0x7D, 0xDD, 0x4E, 0x5E, 0x6E, 0x9E,
+ 0xAE, 0xCE, 0x4F, 0x5F, 0x42, 0x52, 0xB2, 0x43, 0xB3, 0xC3, 0x44, 0x64,
+ 0x74, 0x94, 0xA4, 0x25, 0x35, 0x65, 0x75, 0x95, 0xA5, 0xE5, 0x36, 0x46,
+ 0x66, 0x76, 0x96, 0xA6, 0xB6, 0xC6, 0x57, 0xA7, 0xB7, 0xC7, 0xD7, 0x59,
+ 0xA9, 0xB9, 0x3A, 0x4A, 0x6A, 0xCA, 0xDA, 0x2B, 0x3B, 0x6B, 0x9B, 0xAB,
+ 0xDB, 0xEB, 0x3C, 0x6C, 0x9C, 0xAC, 0xCC, 0xDC, 0x5D, 0x9D, 0xAD, 0xBD,
+ 0xCD, 0xBE, 0xBF, 0x53, 0x54, 0xB4, 0xC4, 0x45, 0x55, 0xB5, 0xC5, 0xD5,
+ 0x56, 0x67, 0x77, 0x97, 0x49, 0x69, 0x79, 0x99, 0x5A, 0x7A, 0x9A, 0xAA,
+ 0xBA, 0x4B, 0x5B, 0x7B, 0xBB, 0xCB, 0x4C, 0x5C, 0xBC
+};
+
+static const uint8_t huff_b37_cb[13] = {
+ 1, 11, 1, 0, 2, 0, 2, 2, 6, 17, 14, 13, 6
+};
+
+static const uint8_t huff_b37_xlat[63] = {
+ 0, 1, 63, 2, 62, 3, 61, 4, 5, 6, 58, 59, 60, 7, 8, 9,
+ 10, 25, 26, 27, 28, 29, 34, 35, 37, 38, 39, 55, 56, 57, 11, 13,
+ 14, 15, 30, 31, 33, 36, 49, 50, 51, 52, 53, 54, 12, 16, 17, 18,
+ 19, 21, 41, 43, 44, 45, 46, 47, 48, 20, 22, 23, 24, 40, 42
+};
+
+static const uint8_t huff_b41_cb[14] = {
+ 1, 12, 1, 0, 0, 1, 7, 0, 20, 4, 10, 24, 2, 12
+};
+
+static const uint8_t huff_b41_xlat[81] = {
+ 0x00, 0x01, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x03, 0x50, 0xD0, 0x70,
+ 0xF0, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0xC1, 0x11, 0x31, 0x05, 0x0D,
+ 0xC3, 0x13, 0x33, 0x07, 0x0F, 0x44, 0xCC, 0x41, 0x43, 0x54, 0x74, 0xDC,
+ 0xFC, 0x71, 0x15, 0x4D, 0x1D, 0x37, 0x3F, 0xD4, 0xF4, 0x5C, 0x7C, 0x51,
+ 0xD1, 0xF1, 0x45, 0xC5, 0x35, 0xCD, 0xDD, 0x3D, 0x53, 0xD3, 0x73, 0xF3,
+ 0x47, 0xC7, 0x17, 0x77, 0x4F, 0xCF, 0x1F, 0x55, 0xFF, 0xD5, 0x75, 0xF5,
+ 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F
+};
+
+static const uint8_t huff_b42_cb[11] = { 1, 9, 1, 0, 1, 3, 2, 3, 7, 4, 4 };
+
+static const uint8_t huff_b42_xlat[25] = {
+ 0x00, 0x07, 0x08, 0x38, 0x01, 0x39, 0x0F, 0x10, 0x09, 0x3F, 0x30, 0x31,
+ 0x02, 0x3A, 0x06, 0x0E, 0x17, 0x11, 0x0A, 0x3E, 0x37, 0x12, 0x32, 0x16,
+ 0x36
+};
+
+static const uint8_t huff_b43_cb[10] = { 2, 9, 1, 1, 3, 4, 9, 15, 12, 4 };
+
+static const uint8_t huff_b43_xlat[49] = {
+ 0x00, 0x07, 0x08, 0x38, 0x01, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x30, 0x31,
+ 0x02, 0x3A, 0x06, 0x0E, 0x17, 0x37, 0x18, 0x28, 0x11, 0x19, 0x29, 0x0A,
+ 0x03, 0x0B, 0x3B, 0x05, 0x0D, 0x3D, 0x3E, 0x1F, 0x2F, 0x12, 0x1A, 0x2A,
+ 0x32, 0x13, 0x33, 0x15, 0x35, 0x16, 0x1E, 0x2E, 0x36, 0x1B, 0x2B, 0x1D,
+ 0x2D
+};
+
+static const uint8_t huff_b47_cb[10] = { 2, 9, 1, 1, 3, 4, 6, 14, 22, 12 };
+
+static const uint8_t huff_b47_xlat[63] = {
+ 0, 1, 2, 62, 63, 3, 4, 60, 61, 5, 6, 7, 57, 58, 59, 8,
+ 9, 10, 11, 12, 26, 27, 37, 38, 52, 53, 54, 55, 56, 13, 14, 15,
+ 16, 17, 18, 25, 28, 29, 30, 31, 33, 34, 35, 36, 39, 46, 47, 48,
+ 49, 50, 51, 19, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 45
+};
+
+static const uint8_t huff_b52_cb[11] = { 1, 9, 1, 0, 1, 3, 2, 3, 7, 4, 4 };
+
+static const uint8_t huff_b52_xlat[25] = {
+ 0x00, 0x01, 0x08, 0x38, 0x07, 0x39, 0x0F, 0x30, 0x09, 0x3F, 0x10, 0x31,
+ 0x02, 0x3A, 0x06, 0x0E, 0x17, 0x11, 0x0A, 0x3E, 0x37, 0x12, 0x32, 0x16,
+ 0x36
+};
+
+static const uint8_t huff_b53_cb[7] = { 1, 5, 1, 1, 1, 0, 4 }; // same as b63!!!
+
+static const uint8_t huff_b53_xlat[7] = { 0, 7, 1, 2, 3, 5, 6 };
+
+static const uint8_t huff_b56_cb[11] = { 1, 9, 1, 0, 2, 0, 2, 4, 11, 9, 2 };
+
+static const uint8_t huff_b56_xlat[31] = {
+ 0, 1, 31, 2, 30, 3, 4, 13, 29, 5, 6, 7, 14, 15, 17, 18,
+ 19, 26, 27, 28, 8, 9, 12, 20, 21, 22, 23, 24, 25, 10, 11
+};
+
+static const uint8_t huff_b62_cb[14] = {
+ 1, 12, 1, 0, 0, 2, 3, 5, 12, 14, 18, 15, 9, 2
+};
+
+static const uint8_t huff_b62_xlat[81] = {
+ 0x00, 0x40, 0x01, 0x10, 0x04, 0x02, 0x80, 0x50, 0x90, 0x05, 0x06, 0x20,
+ 0x60, 0x44, 0x14, 0x54, 0x24, 0x08, 0x18, 0x41, 0x11, 0x15, 0x09, 0xA0,
+ 0x84, 0x94, 0x64, 0xA4, 0x28, 0x51, 0x45, 0x55, 0x19, 0x12, 0x16, 0x0A,
+ 0x1A, 0x48, 0x58, 0x68, 0x81, 0x91, 0x21, 0x61, 0x85, 0x95, 0x25, 0x65,
+ 0x49, 0x59, 0x29, 0x69, 0x42, 0x46, 0x56, 0x88, 0x98, 0xA8, 0xA1, 0xA5,
+ 0x99, 0xA9, 0x52, 0x22, 0x26, 0x66, 0x4A, 0x5A, 0x2A, 0x6A, 0x89, 0x82,
+ 0x92, 0x62, 0x86, 0x96, 0xA6, 0x8A, 0xAA, 0xA2, 0x9A
+};
+
+static const uint8_t huff_b63_cb[7] = { 1, 5, 1, 1, 1, 0, 4 };
+
+static const uint8_t huff_b63_xlat[7] = { 0, 1, 7, 2, 3, 5, 6 };
+
+static const uint8_t huff_b64_cb[7] = { 1, 5, 1, 1, 1, 1, 2 };
+
+static const uint8_t huff_b64_xlat[6] = { 1, 0, 2, 5, 3, 4 };
+
+static const uint8_t huff_b65_cb[14] = {
+ 1, 12, 1, 0, 0, 2, 2, 2, 6, 12, 34, 92, 54, 20
+};
+
+static const uint8_t huff_b65_xlat[225] = {
+ 0x00, 0xF0, 0x01, 0x10, 0x0F, 0x11, 0xF1, 0x20, 0xE0, 0x02, 0x0E, 0x1F,
+ 0xFF, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x07, 0x0A, 0x0D, 0x1E, 0xFE, 0x2F,
+ 0xEF, 0x30, 0x70, 0x90, 0xA0, 0xC0, 0x71, 0x91, 0xC1, 0xD1, 0x32, 0x92,
+ 0xE2, 0x03, 0x13, 0x63, 0x04, 0x06, 0xE6, 0xE7, 0xF7, 0x09, 0x19, 0x39,
+ 0xFA, 0x0C, 0x1C, 0xDD, 0xED, 0xFD, 0x2E, 0x7E, 0x9E, 0x3F, 0x9F, 0x40,
+ 0x50, 0x60, 0xB0, 0x31, 0x41, 0x61, 0xA1, 0xB1, 0x22, 0x42, 0x72, 0xA2,
+ 0xB2, 0xC2, 0xD2, 0x23, 0x33, 0x73, 0xA3, 0xC3, 0xD3, 0xE3, 0xF3, 0x14,
+ 0x24, 0x34, 0x44, 0x74, 0xD4, 0xE4, 0x05, 0x25, 0x45, 0x65, 0x95, 0xA5,
+ 0x16, 0x26, 0x46, 0x76, 0xA6, 0xB6, 0xC6, 0xD6, 0xF6, 0x17, 0x27, 0x37,
+ 0x47, 0x67, 0xA7, 0xD7, 0x29, 0x69, 0xB9, 0xD9, 0xE9, 0xF9, 0x1A, 0x2A,
+ 0x3A, 0x9A, 0xCA, 0xDA, 0xEA, 0x0B, 0x1B, 0x3B, 0x6B, 0xEB, 0xFB, 0x2C,
+ 0x6C, 0xEC, 0xFC, 0x1D, 0x2D, 0x4D, 0x6D, 0x9D, 0xAD, 0x3E, 0x4E, 0x6E,
+ 0xAE, 0xCE, 0xEE, 0x4F, 0x5F, 0x6F, 0xDF, 0x51, 0x52, 0x62, 0x43, 0x93,
+ 0xB3, 0x54, 0x94, 0xA4, 0xF4, 0x15, 0x75, 0xB5, 0xE5, 0xF5, 0x36, 0x56,
+ 0x66, 0x96, 0x57, 0x77, 0x49, 0x59, 0xA9, 0xC9, 0x4A, 0x5A, 0x6A, 0x7A,
+ 0xAA, 0xBA, 0x2B, 0x4B, 0x7B, 0x9B, 0xAB, 0xDB, 0x3C, 0x4C, 0x7C, 0x9C,
+ 0xAC, 0xBC, 0xCC, 0x3D, 0x5D, 0x7D, 0xBD, 0xCD, 0x5E, 0xBE, 0xDE, 0xBF,
+ 0xCF, 0x53, 0x64, 0xB4, 0xC4, 0x35, 0x55, 0xC5, 0xD5, 0x97, 0xB7, 0xC7,
+ 0x79, 0x99, 0x5B, 0xBB, 0xCB, 0x5C, 0xDC, 0x7F, 0xAF
+};
+
+static const uint8_t huff_b66_cb[14] = {
+ 1, 12, 1, 0, 0, 3, 0, 3, 3, 10, 40, 85, 61, 50
+};
+
+static const uint8_t huff_b66_xlat[256] = {
+ 0x00, 0x10, 0x01, 0x11, 0x21, 0x02, 0x12, 0x20, 0x22, 0x13, 0x30, 0x31,
+ 0x41, 0xD1, 0xE1, 0x32, 0x52, 0x03, 0x23, 0x2D, 0x40, 0x50, 0x60, 0x80,
+ 0xD0, 0xE0, 0x51, 0x61, 0xF1, 0x42, 0x62, 0xD2, 0xE2, 0xF2, 0x33, 0x43,
+ 0xC3, 0xD3, 0xE3, 0x04, 0x14, 0xD4, 0xF4, 0x25, 0x35, 0x16, 0x17, 0xF7,
+ 0xD8, 0x1C, 0x3C, 0x0D, 0x1D, 0x3D, 0x5D, 0x0E, 0x1E, 0x2E, 0x7E, 0x2F,
+ 0xC0, 0xF0, 0x71, 0x81, 0x91, 0xC1, 0x72, 0x82, 0x92, 0xB2, 0xC2, 0x53,
+ 0x63, 0x73, 0x93, 0xA3, 0xF3, 0x24, 0x44, 0x64, 0x84, 0xA4, 0xB4, 0x05,
+ 0x15, 0x95, 0xD5, 0x06, 0x26, 0x36, 0x46, 0x96, 0xD6, 0xE6, 0xF6, 0x07,
+ 0x27, 0x37, 0xD7, 0xE7, 0x08, 0x18, 0x28, 0x38, 0xE8, 0xF8, 0x09, 0x19,
+ 0x29, 0xE9, 0xF9, 0x0A, 0x1A, 0xCA, 0xDA, 0xEA, 0x0B, 0x1B, 0xDB, 0xEB,
+ 0xFB, 0x2C, 0x4C, 0x5C, 0x7C, 0x8C, 0x4D, 0x6D, 0x8D, 0x9D, 0xFD, 0x3E,
+ 0x5E, 0x6E, 0x8E, 0x9E, 0xEE, 0x0F, 0x1F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F,
+ 0xCF, 0x70, 0xA1, 0xA2, 0x83, 0xB3, 0x34, 0x74, 0xC4, 0xE4, 0x55, 0x65,
+ 0x85, 0xA5, 0xC5, 0xE5, 0xF5, 0x56, 0x66, 0x76, 0x86, 0xA6, 0xC6, 0x57,
+ 0x67, 0x77, 0x97, 0xA7, 0x48, 0x88, 0x98, 0x49, 0x59, 0x79, 0x99, 0x3A,
+ 0x4A, 0x8A, 0xBA, 0xFA, 0x2B, 0x7B, 0x0C, 0xAC, 0xBC, 0xCC, 0xEC, 0x7D,
+ 0xAD, 0xBD, 0xDD, 0x4E, 0xBE, 0xCE, 0xFE, 0x8F, 0x9F, 0xAF, 0xBF, 0xDF,
+ 0xEF, 0xFF, 0x90, 0xA0, 0xB0, 0xB1, 0x54, 0x94, 0x45, 0x75, 0xB5, 0xB6,
+ 0x47, 0x87, 0xB7, 0xC7, 0x58, 0x68, 0x78, 0xA8, 0xB8, 0xC8, 0x39, 0x69,
+ 0x89, 0xA9, 0xB9, 0xC9, 0xD9, 0x2A, 0x5A, 0x6A, 0x7A, 0x9A, 0xAA, 0x3B,
+ 0x4B, 0x5B, 0x6B, 0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0x6C, 0x9C, 0xDC, 0xFC,
+ 0xCD, 0xED, 0xAE, 0xDE
+};
+
+static const uint8_t huff_b67_cb[10] = { 2, 9, 1, 2, 1, 4, 7, 10, 26, 12 };
+
+static const uint8_t huff_b67_xlat[63] = {
+ 0, 1, 63, 62, 2, 3, 60, 61, 4, 5, 6, 7, 57, 58, 59, 8,
+ 9, 10, 11, 12, 52, 53, 54, 55, 56, 13, 14, 15, 16, 17, 18, 25,
+ 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 46, 47, 48,
+ 49, 50, 51, 19, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 45
+};
+
+static const uint8_t huff_b71_cb[14] = {
+ 1, 12, 1, 0, 0, 1, 7, 0, 19, 5, 13, 23, 0, 12
+};
+
+static const uint8_t huff_b71_xlat[81] = {
+ 0x00, 0x03, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x50, 0xD0, 0x70,
+ 0xF0, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0xC1, 0x11, 0x31, 0x05, 0x0D,
+ 0x13, 0x33, 0x07, 0x0F, 0x44, 0xCC, 0x41, 0x43, 0xC3, 0x54, 0x74, 0xDC,
+ 0xFC, 0xF1, 0xC5, 0x15, 0x1D, 0x53, 0xC7, 0x37, 0x4F, 0x3F, 0xD4, 0xF4,
+ 0x5C, 0x7C, 0x51, 0xD1, 0x71, 0x45, 0x55, 0x35, 0x4D, 0xCD, 0xDD, 0x3D,
+ 0xD3, 0x73, 0xF3, 0x47, 0x17, 0x77, 0xCF, 0x1F, 0xFF, 0xD5, 0x75, 0xF5,
+ 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F
+};
+
+static const uint8_t huff_b73_cb[13] = {
+ 1, 11, 1, 0, 0, 0, 1, 4, 9, 4, 103, 110, 24
+};
+
+static const uint8_t huff_b73_xlat[256] = {
+ 0x00, 0x40, 0x10, 0x04, 0x01, 0x05, 0x50, 0x14, 0x54, 0x41, 0x11, 0x51,
+ 0x45, 0x15, 0x55, 0x44, 0x95, 0x6A, 0x03, 0x80, 0xC0, 0x90, 0xD0, 0x94,
+ 0xD4, 0x24, 0x64, 0x58, 0x91, 0xA1, 0x85, 0xD5, 0x25, 0x65, 0xA5, 0xE5,
+ 0x75, 0xB5, 0xF5, 0x19, 0x59, 0x99, 0xD9, 0x69, 0xA9, 0xE9, 0x79, 0xB9,
+ 0xF9, 0x4D, 0x5D, 0x9D, 0xDD, 0x6D, 0xAD, 0xED, 0x7D, 0xBD, 0xFD, 0x02,
+ 0x42, 0x52, 0x06, 0x46, 0x16, 0x56, 0x96, 0xD6, 0x26, 0x66, 0xA6, 0xE6,
+ 0x76, 0xB6, 0xF6, 0x1A, 0x5A, 0x9A, 0xDA, 0xAA, 0xEA, 0x7A, 0xBA, 0xFA,
+ 0x5E, 0x9E, 0xDE, 0x6E, 0xAE, 0xEE, 0x7E, 0xBE, 0xFE, 0x07, 0x47, 0x57,
+ 0x97, 0xD7, 0x67, 0xA7, 0xE7, 0x77, 0xB7, 0xF7, 0x5B, 0x9B, 0xDB, 0x6B,
+ 0xAB, 0xEB, 0x7B, 0xBB, 0xFB, 0x5F, 0x9F, 0xDF, 0x6F, 0xAF, 0xEF, 0x7F,
+ 0xBF, 0xFF, 0x20, 0x60, 0x70, 0xB0, 0xF0, 0x84, 0xC4, 0xA4, 0xE4, 0x74,
+ 0xB4, 0xF4, 0x08, 0x88, 0x18, 0x98, 0xD8, 0x68, 0xA8, 0xE8, 0x78, 0xB8,
+ 0xF8, 0x1C, 0x5C, 0x9C, 0xDC, 0x6C, 0xAC, 0xEC, 0x3C, 0x7C, 0xBC, 0xFC,
+ 0x81, 0xD1, 0x21, 0x61, 0xE1, 0x71, 0xB1, 0xF1, 0xC5, 0x35, 0x09, 0x49,
+ 0x89, 0xC9, 0x29, 0x39, 0x0D, 0x8D, 0xCD, 0x1D, 0x2D, 0x3D, 0x92, 0xD2,
+ 0x22, 0x62, 0xA2, 0xE2, 0x72, 0xB2, 0xF2, 0x86, 0xC6, 0x36, 0x0A, 0x4A,
+ 0x8A, 0xCA, 0x2A, 0x3A, 0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x2E, 0x3E, 0x13,
+ 0x53, 0x93, 0xD3, 0x63, 0xA3, 0xE3, 0x73, 0xB3, 0xF3, 0x87, 0xC7, 0x17,
+ 0x27, 0x37, 0x0B, 0x4B, 0x8B, 0xCB, 0x1B, 0x2B, 0x3B, 0x0F, 0x4F, 0x8F,
+ 0xCF, 0x1F, 0x2F, 0x3F, 0xA0, 0xE0, 0x30, 0x34, 0x48, 0xC8, 0x28, 0x38,
+ 0x0C, 0x4C, 0x8C, 0xCC, 0x2C, 0xC1, 0x31, 0x82, 0xC2, 0x12, 0x32, 0x43,
+ 0x83, 0xC3, 0x23, 0x33
+};
+
+static const uint8_t huff_b74_cb[8] = { 1, 6, 1, 0, 2, 2, 2, 4 };
+
+static const uint8_t huff_b74_xlat[11] = {
+ 0, 1, 15, 2, 14, 5, 13, 3, 4, 11, 12
+};
+
+static const uint8_t huff_b75_cb[13] = {
+ 2, 12, 1, 4, 0, 0, 0, 8, 11, 24, 53, 64, 60
+};
+
+static const uint8_t huff_b75_xlat[225] = {
+ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x20, 0xE0, 0x11, 0xF1, 0x02, 0x0E, 0x1F,
+ 0xFF, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x0D, 0x1E, 0xFE, 0x2F, 0xEF,
+ 0x30, 0x40, 0x60, 0x70, 0x90, 0xA0, 0xC0, 0x31, 0xD1, 0x22, 0xE2, 0x13,
+ 0xF3, 0x04, 0x06, 0x07, 0x09, 0x0C, 0x1D, 0xFD, 0x2E, 0xEE, 0x3F, 0xDF,
+ 0x50, 0xB0, 0x41, 0x61, 0x71, 0x91, 0xA1, 0xC1, 0x32, 0x62, 0x72, 0x92,
+ 0xA2, 0xD2, 0x23, 0xD3, 0xE3, 0x14, 0xF4, 0x05, 0x16, 0x26, 0xE6, 0xF6,
+ 0x17, 0x27, 0xE7, 0xF7, 0x19, 0x29, 0xF9, 0x0A, 0x1A, 0x2A, 0xFA, 0x0B,
+ 0x1C, 0x2C, 0xFC, 0x2D, 0x3D, 0xED, 0x3E, 0x4E, 0x7E, 0x9E, 0xDE, 0x4F,
+ 0x6F, 0x7F, 0x9F, 0xAF, 0xCF, 0x51, 0xB1, 0x42, 0x52, 0xB2, 0xC2, 0x33,
+ 0x63, 0x73, 0x93, 0xA3, 0xB3, 0xC3, 0x24, 0x34, 0x74, 0xA4, 0xD4, 0xE4,
+ 0x15, 0x25, 0x65, 0x95, 0xE5, 0xF5, 0x36, 0xD6, 0x37, 0x47, 0xC7, 0xD7,
+ 0x39, 0x59, 0xB9, 0xC9, 0xD9, 0xE9, 0x3A, 0x6A, 0xDA, 0xEA, 0x1B, 0x2B,
+ 0x9B, 0xAB, 0xEB, 0xFB, 0x6C, 0x7C, 0x9C, 0xAC, 0xEC, 0x4D, 0x6D, 0x7D,
+ 0x9D, 0xAD, 0xBD, 0xDD, 0x5E, 0x6E, 0xAE, 0xCE, 0x5F, 0x43, 0x53, 0x44,
+ 0x54, 0x64, 0x94, 0xB4, 0xC4, 0x35, 0x45, 0x55, 0x75, 0xA5, 0xB5, 0xC5,
+ 0xD5, 0x46, 0x56, 0x66, 0x76, 0x96, 0xA6, 0xB6, 0xC6, 0x57, 0x67, 0x77,
+ 0x97, 0xA7, 0xB7, 0x49, 0x69, 0x79, 0x99, 0xA9, 0x4A, 0x5A, 0x7A, 0x9A,
+ 0xAA, 0xBA, 0xCA, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0xBB, 0xCB, 0xDB, 0x3C,
+ 0x4C, 0x5C, 0xBC, 0xCC, 0xDC, 0x5D, 0xCD, 0xBE, 0xBF
+};
+
+static const uint8_t huff_b77_cb[12] = {
+ 2, 11, 1, 0, 4, 6, 10, 12, 7, 15, 4, 4
+};
+
+static const uint8_t huff_b77_xlat[63] = {
+ 0, 1, 2, 62, 63, 3, 4, 5, 59, 60, 61, 6, 7, 8, 9, 10,
+ 54, 55, 56, 57, 58, 11, 12, 13, 14, 15, 16, 47, 49, 50, 51, 52,
+ 53, 17, 18, 19, 20, 45, 46, 48, 21, 22, 23, 24, 25, 26, 27, 37,
+ 38, 39, 40, 41, 42, 43, 44, 28, 29, 30, 35, 31, 33, 34, 36
+};
+
+/** Tables for spectrum coding. */
+typedef struct Atrac3pSpecCodeTab {
+ uint8_t group_size; ///< number of coefficients grouped together
+ uint8_t num_coeffs; ///< 1 - map index to a single value, > 1 - map index to a vector of values
+ uint8_t bits; ///< number of bits a single coefficient occupy
+ uint8_t is_signed; ///< 1 - values in that table are signed ones, otherwise - absolute ones
+
+ int redirect; ///< if >= 0: tells which huffman table must be reused
+ const uint8_t *cb; ///< pointer to the codebook descriptor
+ const uint8_t *xlat; ///< pointer to the translation table or NULL if none
+} Atrac3pSpecCodeTab;
+
+static const Atrac3pSpecCodeTab atrac3p_spectra_tabs[112] = {
+ /* table set = A */
+ /* code table = 0 */
+ { 1, 4, 2, 1, -1, huff_a01_cb, huff_a01_xlat }, // wordlen = 1
+ { 1, 4, 2, 0, -1, huff_a02_cb, huff_a02_xlat }, // wordlen = 2
+ { 1, 2, 3, 1, -1, huff_a03_cb, huff_a03_xlat }, // wordlen = 3
+ { 1, 1, 3, 0, -1, huff_a04_cb, huff_a04_xlat }, // wordlen = 4
+ { 1, 2, 4, 1, -1, huff_a05_cb, huff_a05_xlat }, // wordlen = 5
+ { 1, 1, 4, 0, -1, huff_a06_cb, huff_a06_xlat }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_a07_cb, huff_a07_xlat }, // wordlen = 7
+
+ /* code table = 1 */
+ { 4, 4, 2, 1, -1, huff_a11_cb, huff_a11_xlat }, // wordlen = 1
+ { 1, 4, 2, 0, -1, huff_a12_cb, huff_a12_xlat }, // wordlen = 2
+ { 1, 2, 3, 1, -1, huff_a13_cb, huff_a13_xlat }, // wordlen = 3
+ { 1, 2, 4, 1, -1, huff_a14_cb, huff_a14_xlat }, // wordlen = 4
+ { 1, 2, 4, 1, -1, huff_a15_cb, huff_a15_xlat }, // wordlen = 5
+ { 1, 2, 4, 0, -1, huff_a16_cb, huff_a16_xlat }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_a17_cb, huff_a17_xlat }, // wordlen = 7
+
+ /* code table = 2 */
+ { 1, 4, 2, 1, -1, huff_a21_cb, huff_a21_xlat }, // wordlen = 1
+ { 1, 2, 3, 1, -1, huff_a22_cb, huff_a22_xlat }, // wordlen = 2
+ { 1, 2, 3, 1, -1, huff_a23_cb, huff_a23_xlat }, // wordlen = 3
+ { 1, 1, 3, 0, -1, huff_a24_cb, NULL }, // wordlen = 4
+ { 1, 1, 3, 0, -1, huff_a25_cb, huff_a25_xlat }, // wordlen = 5
+ { 1, 2, 4, 0, -1, huff_a26_cb, huff_a26_xlat }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_a27_cb, huff_a27_xlat }, // wordlen = 7
+
+ /* code table = 3 */
+ { 1, 2, 2, 1, -1, huff_a31_cb, huff_a31_xlat }, // wordlen = 1
+ { 1, 4, 2, 0, -1, huff_a32_cb, huff_a32_xlat }, // wordlen = 2
+ { 1, 4, 2, 0, -1, huff_a33_cb, huff_a33_xlat }, // wordlen = 3
+ { 1, 1, 3, 0, -1, huff_a34_cb, huff_a34_xlat }, // wordlen = 4
+ { 1, 2, 4, 1, -1, huff_a35_cb, huff_a35_xlat }, // wordlen = 5
+ { 1, 2, 4, 0, -1, huff_a36_cb, huff_a36_xlat }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_a37_cb, huff_a37_xlat }, // wordlen = 7
+
+ /* code table = 4 */
+ { 1, 4, 2, 1, -1, huff_a41_cb, huff_a41_xlat }, // wordlen = 1
+ { 1, 4, 2, 0, -1, huff_a42_cb, huff_a42_xlat }, // wordlen = 2
+ { 1, 1, 3, 1, -1, huff_a43_cb, huff_a43_xlat }, // wordlen = 3
+ { 1, 2, 4, 1, -1, huff_a44_cb, huff_a44_xlat }, // wordlen = 4
+ { 1, 1, 3, 0, -1, huff_a45_cb, huff_a45_xlat }, // wordlen = 5
+ { 1, 2, 4, 0, -1, huff_a46_cb, huff_a46_xlat }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_a47_cb, huff_a47_xlat }, // wordlen = 7
+
+ /* code table = 5 */
+ { 1, 4, 2, 1, -1, huff_a51_cb, huff_a51_xlat }, // wordlen = 1
+ { 1, 2, 3, 1, -1, huff_a52_cb, huff_a52_xlat }, // wordlen = 2
+ { 1, 1, 3, 1, -1, huff_a43_cb, huff_a53_xlat }, // wordlen = 3
+ { 1, 2, 4, 1, -1, huff_a54_cb, huff_a54_xlat }, // wordlen = 4
+ { 1, 1, 3, 0, -1, huff_a55_cb, huff_a55_xlat }, // wordlen = 5
+ { 1, 1, 5, 1, -1, huff_a56_cb, huff_a56_xlat }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_a57_cb, huff_a57_xlat }, // wordlen = 7
+
+ /* code table = 6 */
+ { 2, 4, 2, 1, -1, huff_a61_cb, huff_a61_xlat }, // wordlen = 1
+ { 1, 2, 3, 1, -1, huff_a62_cb, huff_a62_xlat }, // wordlen = 2
+ { 1, 4, 2, 0, -1, huff_a63_cb, huff_a63_xlat }, // wordlen = 3
+ { 1, 2, 4, 1, -1, huff_a64_cb, huff_a64_xlat }, // wordlen = 4
+ { 1, 1, 4, 1, -1, huff_a65_cb, huff_a65_xlat }, // wordlen = 5
+ { 1, 1, 5, 1, -1, huff_a66_cb, huff_a66_xlat }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_a67_cb, huff_a67_xlat }, // wordlen = 7
+
+ /* code table = 7 */
+ { 1, 2, 1, 0, -1, huff_a71_cb, NULL }, // wordlen = 1
+ { 2, 4, 2, 0, -1, huff_a72_cb, huff_a72_xlat }, // wordlen = 2
+ { 1, 2, 3, 1, -1, huff_a73_cb, huff_a73_xlat }, // wordlen = 3
+ { 1, 2, 4, 1, -1, huff_a74_cb, huff_a74_xlat }, // wordlen = 4
+ { 1, 1, 4, 1, -1, huff_a75_cb, huff_a75_xlat }, // wordlen = 5
+ { 2, 2, 4, 0, -1, huff_a76_cb, huff_a76_xlat }, // wordlen = 6
+ { 4, 1, 6, 1, 6, NULL, NULL }, // wordlen = 7
+
+ /* table set = B */
+ /* code table = 0 */
+ { 4, 4, 2, 1, -1, huff_b01_cb, huff_b01_xlat }, // wordlen = 1
+ { 1, 4, 2, 0, -1, huff_b02_cb, huff_b02_xlat }, // wordlen = 2
+ { 4, 2, 3, 1, -1, huff_b03_cb, huff_b03_xlat }, // wordlen = 3
+ { 1, 2, 4, 1, -1, huff_b04_cb, huff_b04_xlat }, // wordlen = 4
+ { 1, 2, 4, 1, -1, huff_b05_cb, huff_b05_xlat }, // wordlen = 5
+ { 1, 1, 4, 0, 5, NULL, NULL }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_b07_cb, huff_b07_xlat }, // wordlen = 7
+
+ /* code table = 1 */
+ { 1, 4, 2, 1, 14, NULL, NULL }, // wordlen = 1
+ { 1, 4, 2, 0, -1, huff_b12_cb, huff_b12_xlat }, // wordlen = 2
+ { 1, 2, 3, 1, 9, NULL, NULL }, // wordlen = 3
+ { 1, 2, 4, 1, -1, huff_b14_cb, huff_b14_xlat }, // wordlen = 4
+ { 1, 2, 4, 1, 11, NULL, NULL }, // wordlen = 5
+ { 1, 2, 4, 0, -1, huff_b16_cb, huff_b16_xlat }, // wordlen = 6
+ { 1, 1, 6, 1, 6, NULL, NULL }, // wordlen = 7
+
+ /* code table = 2 */
+ { 4, 4, 2, 1, 28, NULL, NULL }, // wordlen = 1
+ { 4, 4, 2, 0, 22, NULL, NULL }, // wordlen = 2
+ { 1, 2, 3, 1, 2, NULL, NULL }, // wordlen = 3
+ { 1, 2, 4, 1, 31, NULL, NULL }, // wordlen = 4
+ { 2, 2, 4, 1, 60, NULL, NULL }, // wordlen = 5
+ { 2, 2, 4, 0, -1, huff_b26_cb, huff_b26_xlat }, // wordlen = 6
+ { 4, 1, 6, 1, 6, NULL, NULL }, // wordlen = 7
+
+ /* code table = 3 */
+ { 1, 4, 2, 1, 35, NULL, NULL }, // wordlen = 1
+ { 1, 4, 2, 0, -1, huff_b32_cb, huff_b32_xlat }, // wordlen = 2
+ { 1, 4, 2, 0, -1, huff_b33_cb, huff_b33_xlat }, // wordlen = 3
+ { 2, 2, 4, 1, 59, NULL, NULL }, // wordlen = 4
+ { 1, 2, 4, 1, -1, huff_b35_cb, huff_b35_xlat }, // wordlen = 5
+ { 1, 2, 4, 0, 75, NULL, NULL }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_b37_cb, huff_b37_xlat }, // wordlen = 7
+
+ /* code table = 4 */
+ { 1, 4, 2, 1, -1, huff_b41_cb, huff_b41_xlat }, // wordlen = 1
+ { 4, 2, 3, 1, -1, huff_b42_cb, huff_b42_xlat }, // wordlen = 2
+ { 1, 2, 3, 1, -1, huff_b43_cb, huff_b43_xlat }, // wordlen = 3
+ { 4, 2, 4, 1, 66, NULL, NULL }, // wordlen = 4
+ { 1, 1, 3, 0, 32, NULL, NULL }, // wordlen = 5
+ { 1, 2, 4, 0, 12, NULL, NULL }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_b47_cb, huff_b47_xlat }, // wordlen = 7
+
+ /* code table = 5 */
+ { 2, 4, 2, 1, 42, NULL, NULL }, // wordlen = 1
+ { 1, 2, 3, 1, -1, huff_b52_cb, huff_b52_xlat }, // wordlen = 2
+ { 4, 1, 3, 1, -1, huff_b53_cb, huff_b53_xlat }, // wordlen = 3
+ { 1, 1, 3, 0, 17, NULL, NULL }, // wordlen = 4
+ { 1, 1, 3, 0, 39, NULL, NULL }, // wordlen = 5
+ { 1, 1, 5, 1, -1, huff_b56_cb, huff_b56_xlat }, // wordlen = 6
+ { 2, 1, 6, 1, 62, NULL, NULL }, // wordlen = 7
+
+ /* code table = 6 */
+ { 1, 4, 2, 1, 28, NULL, NULL }, // wordlen = 1
+ { 1, 4, 2, 0, -1, huff_b62_cb, huff_b62_xlat }, // wordlen = 2
+ { 1, 1, 3, 1, -1, huff_b63_cb, huff_b63_xlat }, // wordlen = 3
+ { 1, 1, 3, 0, -1, huff_b64_cb, huff_b64_xlat }, // wordlen = 4
+ { 4, 2, 4, 1, -1, huff_b65_cb, huff_b65_xlat }, // wordlen = 5
+ { 1, 2, 4, 0, -1, huff_b66_cb, huff_b66_xlat }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_b67_cb, huff_b67_xlat }, // wordlen = 7
+
+ /* code table = 7 */
+ { 1, 4, 2, 1, -1, huff_b71_cb, huff_b71_xlat }, // wordlen = 1
+ { 4, 4, 2, 0, 78, NULL, NULL }, // wordlen = 2
+ { 4, 4, 2, 0, -1, huff_b73_cb, huff_b73_xlat }, // wordlen = 3
+ { 1, 1, 4, 1, -1, huff_b74_cb, huff_b74_xlat }, // wordlen = 4
+ { 1, 2, 4, 1, -1, huff_b75_cb, huff_b75_xlat }, // wordlen = 5
+ { 1, 1, 5, 1, 47, NULL, NULL }, // wordlen = 6
+ { 1, 1, 6, 1, -1, huff_b77_cb, huff_b77_xlat }, // wordlen = 7
+};
+
+/* Huffman tables for gain control data. */
+static const uint8_t atrac3p_huff_gain_npoints1_cb[9] = {
+ 1, 7, 1, 1, 1, 1, 1, 1, 2
+};
+
+static const uint8_t atrac3p_huff_gain_npoints2_xlat[8] = {
+ 0, 1, 7, 2, 6, 3, 4, 5
+};
+
+static const uint8_t atrac3p_huff_gain_lev1_cb[9] = { 1, 7, 1, 0, 2, 2, 1, 2, 8 };
+static const uint8_t atrac3p_huff_gain_lev1_xlat[16] = {
+ 7, 5, 8, 6, 9, 4, 10, 11, 0, 1, 2, 3, 12, 13, 14, 15
+};
+
+static const uint8_t atrac3p_huff_gain_lev2_cb[11] = {
+ 1, 9, 1, 1, 1, 1, 1, 0, 2, 0, 8
+};
+
+static const uint8_t atrac3p_huff_gain_lev2_xlat[15] = {
+ 15, 14, 1, 13, 2, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11
+};
+
+static const uint8_t atrac3p_huff_gain_lev3_cb[11] = {
+ 1, 9, 1, 0, 3, 1, 1, 0, 2, 0, 8
+};
+
+static const uint8_t atrac3p_huff_gain_lev3_xlat[16] = {
+ 0, 1, 14, 15, 2, 13, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11
+};
+
+static const uint8_t atrac3p_huff_gain_lev4_cb[11] = {
+ 1, 9, 1, 1, 1, 1, 1, 0, 1, 2, 8
+};
+
+static const uint8_t atrac3p_huff_gain_lev4_xlat[16] = {
+ 0, 1, 15, 14, 2, 13, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11
+};
+
+static const uint8_t atrac3p_huff_gain_loc1_cb[9] = { 2, 8, 1, 2, 4, 4, 4, 0, 16 };
+static const uint8_t atrac3p_huff_gain_loc1_xlat[31] = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
+};
+
+static const uint8_t atrac3p_huff_gain_loc2_cb[8] = { 3, 8, 5, 3, 2, 3, 2, 16 };
+static const uint8_t atrac3p_huff_gain_loc2_xlat[31] = {
+ 2, 3, 4, 5, 6, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
+};
+
+static const uint8_t atrac3p_huff_gain_loc3_cb[7] = { 2, 6, 1, 0, 2, 11, 18 };
+static const uint8_t atrac3p_huff_gain_loc3_xlat[32] = {
+ 0, 1, 31, 2, 3, 4, 5, 6, 7, 26, 27, 28, 29, 30, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
+};
+
+static const uint8_t atrac3p_huff_gain_loc4_cb[5] = { 4, 6, 3, 23, 6 };
+static const uint8_t atrac3p_huff_gain_loc4_xlat[32] = {
+ 0, 28, 29, 1, 2, 3, 4, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 5, 6, 7, 8, 9, 10
+};
+
+static const uint8_t atrac3p_huff_gain_loc5_cb[9] = { 1, 7, 1, 0, 0, 3, 2, 6, 20 };
+static const uint8_t atrac3p_huff_gain_loc5_xlat[32] = {
+ 0, 1, 2, 31, 3, 4, 5, 6, 7, 8, 29, 30, 9, 10, 11, 12,
+ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
+};
+
+/* Huffman tables for GHA waves data. */
+static const uint8_t atrac3p_huff_tonebands_cb[8] = { 1, 6, 1, 0, 1, 2, 4, 8 };
+static const uint8_t atrac3p_huff_numwavs1_cb[9] = { 1, 7, 1, 1, 1, 1, 1, 1, 2 };
+static const uint8_t atrac3p_huff_numwavs2_cb[8] = { 1, 6, 1, 1, 1, 1, 0, 4 };
+static const uint8_t atrac3p_huff_numwavs2_xlat[8] = { 0, 1, 7, 2, 3, 4, 5, 6 };
+static const uint8_t atrac3p_huff_wav_ampsf1_cb[7] = { 4, 8, 10, 8, 6, 0, 8 };
+static const uint8_t atrac3p_huff_wav_ampsf1_xlat[32] = {
+ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 5, 6, 7, 18, 19, 20,
+ 21, 22, 4, 23, 24, 25, 26, 27, 0, 1, 2, 3, 28, 29, 30, 31
+};
+
+static const uint8_t atrac3p_huff_wav_ampsf2_cb[7] = { 4, 8, 11, 5, 6, 6, 4 };
+static const uint8_t atrac3p_huff_wav_ampsf2_xlat[32] = {
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 14, 15, 16, 17, 29,
+ 9, 10, 11, 12, 13, 30, 4, 5, 6, 7, 8, 31, 0, 1, 2, 3
+};
+
+static const uint8_t atrac3p_huff_wav_ampsf3_cb[9] = { 2, 8, 1, 3, 3, 1, 4, 4, 16 };
+static const uint8_t atrac3p_huff_wav_ampsf3_xlat[32] = {
+ 0, 1, 2, 31, 3, 29, 30, 4, 5, 6, 27, 28, 7, 24, 25, 26,
+ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
+};
+
+static const uint8_t atrac3p_huff_freq_cb[13] = {
+ 1, 11, 1, 0, 0, 2, 2, 0, 9, 9, 29, 104, 100
+};
+
+static const uint8_t atrac3p_huff_freq_xlat[256] = {
+ 0, 1, 255, 2, 254, 3, 4, 5, 6, 7, 8, 251, 252, 253, 9, 10,
+ 11, 12, 246, 247, 248, 249, 250, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 243, 244, 245, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 194, 195, 196, 197, 198,
+ 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
+ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
+ 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 94, 95, 96, 97,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
+ 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
+ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
+ 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161,
+ 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
+ 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193
+};
+
+#endif /* AVCODEC_ATRAC3PLUS_DATA_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac3plusdec.c b/chromium/third_party/ffmpeg/libavcodec/atrac3plusdec.c
new file mode 100644
index 00000000000..652bd7890da
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac3plusdec.c
@@ -0,0 +1,396 @@
+/*
+ * ATRAC3+ compatible decoder
+ *
+ * Copyright (c) 2010-2013 Maxim Poliakovski
+ *
+ * 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
+ * Sony ATRAC3+ compatible decoder.
+ *
+ * Container formats used to store its data:
+ * RIFF WAV (.at3) and Sony OpenMG (.oma, .aa3).
+ *
+ * Technical description of this codec can be found here:
+ * http://wiki.multimedia.cx/index.php?title=ATRAC3plus
+ *
+ * Kudos to Benjamin Larsson and Michael Karcher
+ * for their precious technical help!
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+#include "libavutil/channel_layout.h"
+#include "libavutil/float_dsp.h"
+#include "avcodec.h"
+#include "get_bits.h"
+#include "internal.h"
+#include "atrac.h"
+#include "atrac3plus.h"
+
+typedef struct ATRAC3PContext {
+ GetBitContext gb;
+ AVFloatDSPContext fdsp;
+
+ DECLARE_ALIGNED(32, float, samples)[2][ATRAC3P_FRAME_SAMPLES]; ///< quantized MDCT spectrum
+ DECLARE_ALIGNED(32, float, mdct_buf)[2][ATRAC3P_FRAME_SAMPLES]; ///< output of the IMDCT
+ DECLARE_ALIGNED(32, float, time_buf)[2][ATRAC3P_FRAME_SAMPLES]; ///< output of the gain compensation
+ DECLARE_ALIGNED(32, float, outp_buf)[2][ATRAC3P_FRAME_SAMPLES];
+
+ AtracGCContext gainc_ctx; ///< gain compensation context
+ FFTContext mdct_ctx;
+ FFTContext ipqf_dct_ctx; ///< IDCT context used by IPQF
+
+ Atrac3pChanUnitCtx *ch_units; ///< global channel units
+
+ int num_channel_blocks; ///< number of channel blocks
+ uint8_t channel_blocks[5]; ///< channel configuration descriptor
+ uint64_t my_channel_layout; ///< current channel layout
+} ATRAC3PContext;
+
+static av_cold int atrac3p_decode_close(AVCodecContext *avctx)
+{
+ av_free(((ATRAC3PContext *)(avctx->priv_data))->ch_units);
+
+ return 0;
+}
+
+static av_cold int set_channel_params(ATRAC3PContext *ctx,
+ AVCodecContext *avctx)
+{
+ memset(ctx->channel_blocks, 0, sizeof(ctx->channel_blocks));
+
+ switch (avctx->channels) {
+ case 1:
+ if (avctx->channel_layout != AV_CH_FRONT_LEFT)
+ avctx->channel_layout = AV_CH_LAYOUT_MONO;
+
+ ctx->num_channel_blocks = 1;
+ ctx->channel_blocks[0] = CH_UNIT_MONO;
+ break;
+ case 2:
+ avctx->channel_layout = AV_CH_LAYOUT_STEREO;
+ ctx->num_channel_blocks = 1;
+ ctx->channel_blocks[0] = CH_UNIT_STEREO;
+ break;
+ case 3:
+ avctx->channel_layout = AV_CH_LAYOUT_SURROUND;
+ ctx->num_channel_blocks = 2;
+ ctx->channel_blocks[0] = CH_UNIT_STEREO;
+ ctx->channel_blocks[1] = CH_UNIT_MONO;
+ break;
+ case 4:
+ avctx->channel_layout = AV_CH_LAYOUT_4POINT0;
+ ctx->num_channel_blocks = 3;
+ ctx->channel_blocks[0] = CH_UNIT_STEREO;
+ ctx->channel_blocks[1] = CH_UNIT_MONO;
+ ctx->channel_blocks[2] = CH_UNIT_MONO;
+ break;
+ case 6:
+ avctx->channel_layout = AV_CH_LAYOUT_5POINT1_BACK;
+ ctx->num_channel_blocks = 4;
+ ctx->channel_blocks[0] = CH_UNIT_STEREO;
+ ctx->channel_blocks[1] = CH_UNIT_MONO;
+ ctx->channel_blocks[2] = CH_UNIT_STEREO;
+ ctx->channel_blocks[3] = CH_UNIT_MONO;
+ break;
+ case 7:
+ avctx->channel_layout = AV_CH_LAYOUT_6POINT1_BACK;
+ ctx->num_channel_blocks = 5;
+ ctx->channel_blocks[0] = CH_UNIT_STEREO;
+ ctx->channel_blocks[1] = CH_UNIT_MONO;
+ ctx->channel_blocks[2] = CH_UNIT_STEREO;
+ ctx->channel_blocks[3] = CH_UNIT_MONO;
+ ctx->channel_blocks[4] = CH_UNIT_MONO;
+ break;
+ case 8:
+ avctx->channel_layout = AV_CH_LAYOUT_7POINT1;
+ ctx->num_channel_blocks = 5;
+ ctx->channel_blocks[0] = CH_UNIT_STEREO;
+ ctx->channel_blocks[1] = CH_UNIT_MONO;
+ ctx->channel_blocks[2] = CH_UNIT_STEREO;
+ ctx->channel_blocks[3] = CH_UNIT_STEREO;
+ ctx->channel_blocks[4] = CH_UNIT_MONO;
+ break;
+ default:
+ av_log(avctx, AV_LOG_ERROR,
+ "Unsupported channel count: %d!\n", avctx->channels);
+ return AVERROR_INVALIDDATA;
+ }
+
+ return 0;
+}
+
+static av_cold int atrac3p_decode_init(AVCodecContext *avctx)
+{
+ ATRAC3PContext *ctx = avctx->priv_data;
+ int i, ch, ret;
+
+ if (!avctx->block_align) {
+ av_log(avctx, AV_LOG_ERROR, "block_align is not set\n");
+ return AVERROR(EINVAL);
+ }
+
+ ff_atrac3p_init_vlcs();
+
+ avpriv_float_dsp_init(&ctx->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
+
+ /* initialize IPQF */
+ ff_mdct_init(&ctx->ipqf_dct_ctx, 5, 1, 32.0 / 32768.0);
+
+ ff_atrac3p_init_imdct(avctx, &ctx->mdct_ctx);
+
+ ff_atrac_init_gain_compensation(&ctx->gainc_ctx, 6, 2);
+
+ ff_atrac3p_init_wave_synth();
+
+ if ((ret = set_channel_params(ctx, avctx)) < 0)
+ return ret;
+
+ ctx->my_channel_layout = avctx->channel_layout;
+
+ ctx->ch_units = av_mallocz(sizeof(*ctx->ch_units) *
+ ctx->num_channel_blocks);
+ if (!ctx->ch_units) {
+ atrac3p_decode_close(avctx);
+ return AVERROR(ENOMEM);
+ }
+
+ for (i = 0; i < ctx->num_channel_blocks; i++) {
+ for (ch = 0; ch < 2; ch++) {
+ ctx->ch_units[i].channels[ch].ch_num = ch;
+ ctx->ch_units[i].channels[ch].wnd_shape = &ctx->ch_units[i].channels[ch].wnd_shape_hist[0][0];
+ ctx->ch_units[i].channels[ch].wnd_shape_prev = &ctx->ch_units[i].channels[ch].wnd_shape_hist[1][0];
+ ctx->ch_units[i].channels[ch].gain_data = &ctx->ch_units[i].channels[ch].gain_data_hist[0][0];
+ ctx->ch_units[i].channels[ch].gain_data_prev = &ctx->ch_units[i].channels[ch].gain_data_hist[1][0];
+ ctx->ch_units[i].channels[ch].tones_info = &ctx->ch_units[i].channels[ch].tones_info_hist[0][0];
+ ctx->ch_units[i].channels[ch].tones_info_prev = &ctx->ch_units[i].channels[ch].tones_info_hist[1][0];
+ }
+
+ ctx->ch_units[i].waves_info = &ctx->ch_units[i].wave_synth_hist[0];
+ ctx->ch_units[i].waves_info_prev = &ctx->ch_units[i].wave_synth_hist[1];
+ }
+
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
+
+ return 0;
+}
+
+static void decode_residual_spectrum(Atrac3pChanUnitCtx *ctx,
+ float out[2][ATRAC3P_FRAME_SAMPLES],
+ int num_channels,
+ AVCodecContext *avctx)
+{
+ int i, sb, ch, qu, nspeclines, RNG_index;
+ float *dst, q;
+ int16_t *src;
+ /* calculate RNG table index for each subband */
+ int sb_RNG_index[ATRAC3P_SUBBANDS] = { 0 };
+
+ if (ctx->mute_flag) {
+ for (ch = 0; ch < num_channels; ch++)
+ memset(out[ch], 0, ATRAC3P_FRAME_SAMPLES * sizeof(*out[ch]));
+ return;
+ }
+
+ for (qu = 0, RNG_index = 0; qu < ctx->used_quant_units; qu++)
+ RNG_index += ctx->channels[0].qu_sf_idx[qu] +
+ ctx->channels[1].qu_sf_idx[qu];
+
+ for (sb = 0; sb < ctx->num_coded_subbands; sb++, RNG_index += 128)
+ sb_RNG_index[sb] = RNG_index & 0x3FC;
+
+ /* inverse quant and power compensation */
+ for (ch = 0; ch < num_channels; ch++) {
+ /* clear channel's residual spectrum */
+ memset(out[ch], 0, ATRAC3P_FRAME_SAMPLES * sizeof(*out[ch]));
+
+ for (qu = 0; qu < ctx->used_quant_units; qu++) {
+ src = &ctx->channels[ch].spectrum[ff_atrac3p_qu_to_spec_pos[qu]];
+ dst = &out[ch][ff_atrac3p_qu_to_spec_pos[qu]];
+ nspeclines = ff_atrac3p_qu_to_spec_pos[qu + 1] -
+ ff_atrac3p_qu_to_spec_pos[qu];
+
+ if (ctx->channels[ch].qu_wordlen[qu] > 0) {
+ q = ff_atrac3p_sf_tab[ctx->channels[ch].qu_sf_idx[qu]] *
+ ff_atrac3p_mant_tab[ctx->channels[ch].qu_wordlen[qu]];
+ for (i = 0; i < nspeclines; i++)
+ dst[i] = src[i] * q;
+ }
+ }
+
+ for (sb = 0; sb < ctx->num_coded_subbands; sb++)
+ ff_atrac3p_power_compensation(ctx, ch, &out[ch][0],
+ sb_RNG_index[sb], sb);
+ }
+
+ if (ctx->unit_type == CH_UNIT_STEREO) {
+ for (sb = 0; sb < ctx->num_coded_subbands; sb++) {
+ if (ctx->swap_channels[sb]) {
+ for (i = 0; i < ATRAC3P_SUBBAND_SAMPLES; i++)
+ FFSWAP(float, out[0][sb * ATRAC3P_SUBBAND_SAMPLES + i],
+ out[1][sb * ATRAC3P_SUBBAND_SAMPLES + i]);
+ }
+
+ /* flip coefficients' sign if requested */
+ if (ctx->negate_coeffs[sb])
+ for (i = 0; i < ATRAC3P_SUBBAND_SAMPLES; i++)
+ out[1][sb * ATRAC3P_SUBBAND_SAMPLES + i] = -(out[1][sb * ATRAC3P_SUBBAND_SAMPLES + i]);
+ }
+ }
+}
+
+static void reconstruct_frame(ATRAC3PContext *ctx, Atrac3pChanUnitCtx *ch_unit,
+ int num_channels, AVCodecContext *avctx)
+{
+ int ch, sb;
+
+ for (ch = 0; ch < num_channels; ch++) {
+ for (sb = 0; sb < ch_unit->num_subbands; sb++) {
+ /* inverse transform and windowing */
+ ff_atrac3p_imdct(&ctx->fdsp, &ctx->mdct_ctx,
+ &ctx->samples[ch][sb * ATRAC3P_SUBBAND_SAMPLES],
+ &ctx->mdct_buf[ch][sb * ATRAC3P_SUBBAND_SAMPLES],
+ (ch_unit->channels[ch].wnd_shape_prev[sb] << 1) +
+ ch_unit->channels[ch].wnd_shape[sb], sb);
+
+ /* gain compensation and overlapping */
+ ff_atrac_gain_compensation(&ctx->gainc_ctx,
+ &ctx->mdct_buf[ch][sb * ATRAC3P_SUBBAND_SAMPLES],
+ &ch_unit->prev_buf[ch][sb * ATRAC3P_SUBBAND_SAMPLES],
+ &ch_unit->channels[ch].gain_data_prev[sb],
+ &ch_unit->channels[ch].gain_data[sb],
+ ATRAC3P_SUBBAND_SAMPLES,
+ &ctx->time_buf[ch][sb * ATRAC3P_SUBBAND_SAMPLES]);
+ }
+
+ /* zero unused subbands in both output and overlapping buffers */
+ memset(&ch_unit->prev_buf[ch][ch_unit->num_subbands * ATRAC3P_SUBBAND_SAMPLES],
+ 0,
+ (ATRAC3P_SUBBANDS - ch_unit->num_subbands) *
+ ATRAC3P_SUBBAND_SAMPLES *
+ sizeof(ch_unit->prev_buf[ch][ch_unit->num_subbands * ATRAC3P_SUBBAND_SAMPLES]));
+ memset(&ctx->time_buf[ch][ch_unit->num_subbands * ATRAC3P_SUBBAND_SAMPLES],
+ 0,
+ (ATRAC3P_SUBBANDS - ch_unit->num_subbands) *
+ ATRAC3P_SUBBAND_SAMPLES *
+ sizeof(ctx->time_buf[ch][ch_unit->num_subbands * ATRAC3P_SUBBAND_SAMPLES]));
+
+ /* resynthesize and add tonal signal */
+ if (ch_unit->waves_info->tones_present ||
+ ch_unit->waves_info_prev->tones_present) {
+ for (sb = 0; sb < ch_unit->num_subbands; sb++)
+ if (ch_unit->channels[ch].tones_info[sb].num_wavs ||
+ ch_unit->channels[ch].tones_info_prev[sb].num_wavs) {
+ ff_atrac3p_generate_tones(ch_unit, &ctx->fdsp, ch, sb,
+ &ctx->time_buf[ch][sb * 128]);
+ }
+ }
+
+ /* subband synthesis and acoustic signal output */
+ ff_atrac3p_ipqf(&ctx->ipqf_dct_ctx, &ch_unit->ipqf_ctx[ch],
+ &ctx->time_buf[ch][0], &ctx->outp_buf[ch][0]);
+ }
+
+ /* swap window shape and gain control buffers. */
+ for (ch = 0; ch < num_channels; ch++) {
+ FFSWAP(uint8_t *, ch_unit->channels[ch].wnd_shape,
+ ch_unit->channels[ch].wnd_shape_prev);
+ FFSWAP(AtracGainInfo *, ch_unit->channels[ch].gain_data,
+ ch_unit->channels[ch].gain_data_prev);
+ FFSWAP(Atrac3pWavesData *, ch_unit->channels[ch].tones_info,
+ ch_unit->channels[ch].tones_info_prev);
+ }
+
+ FFSWAP(Atrac3pWaveSynthParams *, ch_unit->waves_info, ch_unit->waves_info_prev);
+}
+
+static int atrac3p_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame_ptr, AVPacket *avpkt)
+{
+ ATRAC3PContext *ctx = avctx->priv_data;
+ AVFrame *frame = data;
+ int i, ret, ch_unit_id, ch_block = 0, out_ch_index = 0, channels_to_process;
+ float **samples_p = (float **)frame->extended_data;
+
+ frame->nb_samples = ATRAC3P_FRAME_SAMPLES;
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ return ret;
+ }
+
+ if ((ret = init_get_bits8(&ctx->gb, avpkt->data, avpkt->size)) < 0)
+ return ret;
+
+ if (get_bits1(&ctx->gb)) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid start bit!\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ while (get_bits_left(&ctx->gb) >= 2 &&
+ (ch_unit_id = get_bits(&ctx->gb, 2)) != CH_UNIT_TERMINATOR) {
+ if (ch_unit_id == CH_UNIT_EXTENSION) {
+ avpriv_report_missing_feature(avctx, "Channel unit extension");
+ return AVERROR_PATCHWELCOME;
+ }
+ if (ch_block >= ctx->num_channel_blocks ||
+ ctx->channel_blocks[ch_block] != ch_unit_id) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Frame data doesn't match channel configuration!\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ ctx->ch_units[ch_block].unit_type = ch_unit_id;
+ channels_to_process = ch_unit_id + 1;
+
+ if ((ret = ff_atrac3p_decode_channel_unit(&ctx->gb,
+ &ctx->ch_units[ch_block],
+ channels_to_process,
+ avctx)) < 0)
+ return ret;
+
+ decode_residual_spectrum(&ctx->ch_units[ch_block], ctx->samples,
+ channels_to_process, avctx);
+ reconstruct_frame(ctx, &ctx->ch_units[ch_block],
+ channels_to_process, avctx);
+
+ for (i = 0; i < channels_to_process; i++)
+ memcpy(samples_p[out_ch_index + i], ctx->outp_buf[i],
+ ATRAC3P_FRAME_SAMPLES * sizeof(**samples_p));
+
+ ch_block++;
+ out_ch_index += channels_to_process;
+ }
+
+ *got_frame_ptr = 1;
+
+ return avctx->block_align;
+}
+
+AVCodec ff_atrac3p_decoder = {
+ .name = "atrac3plus",
+ .long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_ATRAC3P,
+ .priv_data_size = sizeof(ATRAC3PContext),
+ .init = atrac3p_decode_init,
+ .close = atrac3p_decode_close,
+ .decode = atrac3p_decode_frame,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac3plusdsp.c b/chromium/third_party/ffmpeg/libavcodec/atrac3plusdsp.c
new file mode 100644
index 00000000000..3522af1e5ac
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac3plusdsp.c
@@ -0,0 +1,638 @@
+/*
+ * ATRAC3+ compatible decoder
+ *
+ * Copyright (c) 2010-2013 Maxim Poliakovski
+ *
+ * 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
+ * DSP functions for ATRAC3+ decoder.
+ */
+
+#include <math.h>
+
+#include "libavutil/float_dsp.h"
+#include "avcodec.h"
+#include "sinewin.h"
+#include "fft.h"
+#include "atrac3plus.h"
+
+/**
+ * Map quant unit number to its position in the spectrum.
+ * To get the number of spectral lines in each quant unit do the following:
+ * num_specs = qu_to_spec_pos[i+1] - qu_to_spec_pos[i]
+ */
+const uint16_t ff_atrac3p_qu_to_spec_pos[33] = {
+ 0, 16, 32, 48, 64, 80, 96, 112,
+ 128, 160, 192, 224, 256, 288, 320, 352,
+ 384, 448, 512, 576, 640, 704, 768, 896,
+ 1024, 1152, 1280, 1408, 1536, 1664, 1792, 1920,
+ 2048
+};
+
+/* Scalefactors table. */
+/* Approx. Equ: pow(2.0, (i - 16.0 + 0.501783948) / 3.0) */
+const float ff_atrac3p_sf_tab[64] = {
+ 0.027852058, 0.0350914, 0.044212341, 0.055704117, 0.0701828,
+ 0.088424683, 0.11140823, 0.1403656, 0.17684937, 0.22281647, 0.2807312, 0.35369873,
+ 0.44563293, 0.5614624, 0.70739746, 0.89126587, 1.1229248, 1.4147949, 1.7825317,
+ 2.2458496, 2.8295898, 3.5650635, 4.4916992, 5.6591797, 7.130127, 8.9833984,
+ 11.318359, 14.260254, 17.966797, 22.636719, 28.520508, 35.933594, 45.273438,
+ 57.041016, 71.867188, 90.546875, 114.08203, 143.73438, 181.09375, 228.16406,
+ 287.46875, 362.1875, 456.32812, 574.9375, 724.375, 912.65625, 1149.875,
+ 1448.75, 1825.3125, 2299.75, 2897.5, 3650.625, 4599.5, 5795.0,
+ 7301.25, 9199.0, 11590.0, 14602.5, 18398.0, 23180.0, 29205.0,
+ 36796.0, 46360.0, 58410.0
+};
+
+/* Mantissa table. */
+/* pow(10, x * log10(2) + 0.05) / 2 / ([1,2,3,5,7,15,31] + 0.5) */
+const float ff_atrac3p_mant_tab[8] = {
+ 0.0,
+ 0.74801636,
+ 0.44882202,
+ 0.32058716,
+ 0.20400238,
+ 0.1496048,
+ 0.07239151,
+ 0.035619736
+};
+
+#define ATRAC3P_MDCT_SIZE (ATRAC3P_SUBBAND_SAMPLES * 2)
+
+av_cold void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx)
+{
+ ff_init_ff_sine_windows(7);
+ ff_init_ff_sine_windows(6);
+
+ /* Initialize the MDCT transform. */
+ ff_mdct_init(mdct_ctx, 8, 1, -1.0);
+}
+
+#define TWOPI (2 * M_PI)
+
+#define DEQUANT_PHASE(ph) (((ph) & 0x1F) << 6)
+
+static DECLARE_ALIGNED(32, float, sine_table)[2048]; ///< wave table
+static DECLARE_ALIGNED(32, float, hann_window)[256]; ///< Hann windowing function
+static float amp_sf_tab[64]; ///< scalefactors for quantized amplitudes
+
+av_cold void ff_atrac3p_init_wave_synth(void)
+{
+ int i;
+
+ /* generate sine wave table */
+ for (i = 0; i < 2048; i++)
+ sine_table[i] = sin(TWOPI * i / 2048);
+
+ /* generate Hann window */
+ for (i = 0; i < 256; i++)
+ hann_window[i] = (1.0f - cos(TWOPI * i / 256.0f)) * 0.5f;
+
+ /* generate amplitude scalefactors table */
+ for (i = 0; i < 64; i++)
+ amp_sf_tab[i] = pow(2.0f, ((double)i - 3) / 4.0f);
+}
+
+/**
+ * Synthesize sine waves according to given parameters.
+ *
+ * @param[in] synth_param ptr to common synthesis parameters
+ * @param[in] waves_info parameters for each sine wave
+ * @param[in] envelope envelope data for all waves in a group
+ * @param[in] phase_shift flag indicates 180° phase shift
+ * @param[in] reg_offset region offset for trimming envelope data
+ * @param[out] out receives sythesized data
+ */
+static void waves_synth(Atrac3pWaveSynthParams *synth_param,
+ Atrac3pWavesData *waves_info,
+ Atrac3pWaveEnvelope *envelope,
+ int phase_shift, int reg_offset, float *out)
+{
+ int i, wn, inc, pos;
+ double amp;
+ Atrac3pWaveParam *wave_param = &synth_param->waves[waves_info->start_index];
+
+ for (wn = 0; wn < waves_info->num_wavs; wn++, wave_param++) {
+ /* amplitude dequantization */
+ amp = amp_sf_tab[wave_param->amp_sf] *
+ (!synth_param->amplitude_mode
+ ? (wave_param->amp_index + 1) / 15.13f
+ : 1.0f);
+
+ inc = wave_param->freq_index;
+ pos = DEQUANT_PHASE(wave_param->phase_index) - (reg_offset ^ 128) * inc & 2047;
+
+ /* waveform generation */
+ for (i = 0; i < 128; i++) {
+ out[i] += sine_table[pos] * amp;
+ pos = (pos + inc) & 2047;
+ }
+ }
+
+ /* fade in with steep Hann window if requested */
+ if (envelope->has_start_point) {
+ pos = (envelope->start_pos << 2) - reg_offset;
+ if (pos > 0 && pos <= 128) {
+ memset(out, 0, pos * sizeof(*out));
+ if (!envelope->has_stop_point ||
+ envelope->start_pos != envelope->stop_pos) {
+ out[pos + 0] *= hann_window[0];
+ out[pos + 1] *= hann_window[32];
+ out[pos + 2] *= hann_window[64];
+ out[pos + 3] *= hann_window[96];
+ }
+ }
+ }
+
+ /* fade out with steep Hann window if requested */
+ if (envelope->has_stop_point) {
+ pos = (envelope->stop_pos + 1 << 2) - reg_offset;
+ if (pos > 0 && pos <= 128) {
+ out[pos - 4] *= hann_window[96];
+ out[pos - 3] *= hann_window[64];
+ out[pos - 2] *= hann_window[32];
+ out[pos - 1] *= hann_window[0];
+ memset(&out[pos], 0, (128 - pos) * sizeof(out[pos]));
+ }
+ }
+}
+
+void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *fdsp,
+ int ch_num, int sb, float *out)
+{
+ DECLARE_ALIGNED(32, float, wavreg1)[128] = { 0 };
+ DECLARE_ALIGNED(32, float, wavreg2)[128] = { 0 };
+ int i, reg1_env_nonzero, reg2_env_nonzero;
+ Atrac3pWavesData *tones_now = &ch_unit->channels[ch_num].tones_info_prev[sb];
+ Atrac3pWavesData *tones_next = &ch_unit->channels[ch_num].tones_info[sb];
+
+ /* reconstruct full envelopes for both overlapping regions
+ * from truncated bitstream data */
+ if (tones_next->pend_env.has_start_point &&
+ tones_next->pend_env.start_pos < tones_next->pend_env.stop_pos) {
+ tones_next->curr_env.has_start_point = 1;
+ tones_next->curr_env.start_pos = tones_next->pend_env.start_pos + 32;
+ } else if (tones_now->pend_env.has_start_point) {
+ tones_next->curr_env.has_start_point = 1;
+ tones_next->curr_env.start_pos = tones_now->pend_env.start_pos;
+ } else {
+ tones_next->curr_env.has_start_point = 0;
+ tones_next->curr_env.start_pos = 0;
+ }
+
+ if (tones_now->pend_env.has_stop_point &&
+ tones_now->pend_env.stop_pos >= tones_next->curr_env.start_pos) {
+ tones_next->curr_env.has_stop_point = 1;
+ tones_next->curr_env.stop_pos = tones_now->pend_env.stop_pos;
+ } else if (tones_next->pend_env.has_stop_point) {
+ tones_next->curr_env.has_stop_point = 1;
+ tones_next->curr_env.stop_pos = tones_next->pend_env.stop_pos + 32;
+ } else {
+ tones_next->curr_env.has_stop_point = 0;
+ tones_next->curr_env.stop_pos = 64;
+ }
+
+ /* is the visible part of the envelope non-zero? */
+ reg1_env_nonzero = (tones_now->curr_env.stop_pos < 32) ? 0 : 1;
+ reg2_env_nonzero = (tones_next->curr_env.start_pos >= 32) ? 0 : 1;
+
+ /* synthesize waves for both overlapping regions */
+ if (tones_now->num_wavs && reg1_env_nonzero)
+ waves_synth(ch_unit->waves_info_prev, tones_now, &tones_now->curr_env,
+ ch_unit->waves_info_prev->phase_shift[sb] & ch_num,
+ 128, wavreg1);
+
+ if (tones_next->num_wavs && reg2_env_nonzero)
+ waves_synth(ch_unit->waves_info, tones_next, &tones_next->curr_env,
+ ch_unit->waves_info->phase_shift[sb] & ch_num, 0, wavreg2);
+
+ /* Hann windowing for non-faded wave signals */
+ if (tones_now->num_wavs && tones_next->num_wavs &&
+ reg1_env_nonzero && reg2_env_nonzero) {
+ fdsp->vector_fmul(wavreg1, wavreg1, &hann_window[128], 128);
+ fdsp->vector_fmul(wavreg2, wavreg2, hann_window, 128);
+ } else {
+ if (tones_now->num_wavs && !tones_now->curr_env.has_stop_point)
+ fdsp->vector_fmul(wavreg1, wavreg1, &hann_window[128], 128);
+
+ if (tones_next->num_wavs && !tones_next->curr_env.has_start_point)
+ fdsp->vector_fmul(wavreg2, wavreg2, hann_window, 128);
+ }
+
+ /* Overlap and add to residual */
+ for (i = 0; i < 128; i++)
+ out[i] += wavreg1[i] + wavreg2[i];
+}
+
+static const int subband_to_powgrp[ATRAC3P_SUBBANDS] = {
+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4
+};
+
+/* noise table for power compensation */
+static const float noise_tab[1024] = {
+ -0.01358032, -0.05593872, 0.01696777, -0.14871216, -0.26412964, -0.09893799, 0.25723267,
+ 0.02008057, -0.72235107, -0.44351196, -0.22985840, 0.16833496, 0.46902466, 0.05917358,
+ -0.15179443, 0.41299438, -0.01287842, 0.13360596, 0.43557739, -0.09530640, -0.58422852,
+ 0.39266968, -0.08343506, -0.25604248, 0.22848511, 0.26013184, -0.65588379, 0.17288208,
+ -0.08673096, -0.05203247, 0.07299805, -0.28665161, -0.35806274, 0.06552124, -0.09387207,
+ 0.21099854, -0.28347778, -0.72402954, 0.05050659, -0.10635376, -0.18853760, 0.29724121,
+ 0.20703125, -0.29791260, -0.37634277, 0.47970581, -0.09976196, 0.32641602, -0.29248047,
+ -0.28237915, 0.26028442, -0.36157227, 0.22042847, -0.03222656, -0.37268066, -0.03759766,
+ 0.09909058, 0.23284912, 0.19320679, 0.14453125, -0.02139282, -0.19702148, 0.31533813,
+ -0.16741943, 0.35031128, -0.35656738, -0.66128540, -0.00701904, 0.20898438, 0.26837158,
+ -0.33706665, -0.04568481, 0.12600708, 0.10284424, 0.07321167, -0.18280029, 0.38101196,
+ 0.21301270, 0.04541016, 0.01156616, -0.26391602, -0.02346802, -0.22125244, 0.29760742,
+ -0.36233521, -0.31314087, -0.13967896, -0.11276245, -0.19433594, 0.34490967, 0.02343750,
+ 0.21963501, -0.02777100, -0.67678833, -0.08999634, 0.14233398, -0.27697754, 0.51422119,
+ -0.05047607, 0.48327637, 0.37167358, -0.60806274, 0.18728638, -0.15191650, 0.00637817,
+ 0.02832031, -0.15618896, 0.60644531, 0.21826172, 0.06384277, -0.31863403, 0.08816528,
+ 0.15447998, -0.07015991, -0.08154297, -0.40966797, -0.39785767, -0.11709595, 0.22052002,
+ 0.18466187, -0.17257690, 0.03759766, -0.06195068, 0.00433350, 0.12176514, 0.34011841,
+ 0.25610352, -0.05294800, 0.41033936, 0.16854858, -0.76187134, 0.13845825, -0.19418335,
+ -0.21524048, -0.44412231, -0.08160400, -0.28195190, -0.01873779, 0.15524292, -0.37438965,
+ -0.44860840, 0.43096924, -0.24746704, 0.49856567, 0.14859009, 0.38159180, 0.20541382,
+ -0.39175415, -0.65850830, -0.43716431, 0.13037109, -0.05111694, 0.39956665, 0.21447754,
+ -0.04861450, 0.33654785, 0.10589600, -0.88085938, -0.30822754, 0.38577271, 0.30047607,
+ 0.38836670, 0.09118652, -0.36477661, -0.01641846, -0.23031616, 0.26058960, 0.18859863,
+ -0.21868896, -0.17861938, -0.29754639, 0.09777832, 0.10806274, -0.51605225, 0.00076294,
+ 0.13259888, 0.11090088, -0.24084473, 0.24957275, 0.01379395, -0.04141235, -0.04937744,
+ 0.57394409, 0.27410889, 0.27587891, 0.45013428, -0.32592773, 0.11160278, -0.00970459,
+ 0.29092407, 0.03356934, -0.70925903, 0.04882812, 0.43499756, 0.07720947, -0.27554321,
+ -0.01742554, -0.08413696, -0.04028320, -0.52850342, -0.07330322, 0.05181885, 0.21362305,
+ -0.18765259, 0.07058716, -0.03009033, 0.32662964, 0.27023315, -0.28002930, 0.17568970,
+ 0.03338623, 0.30242920, -0.03921509, 0.32174683, -0.23733521, 0.08575439, -0.38269043,
+ 0.09194946, -0.07238770, 0.17941284, -0.51278687, -0.25146484, 0.19790649, -0.19195557,
+ 0.16549683, 0.42456055, 0.39129639, -0.02868652, 0.17980957, 0.24902344, -0.76583862,
+ -0.20959473, 0.61013794, 0.37011719, 0.36859131, -0.04486084, 0.10678101, -0.15994263,
+ -0.05328369, 0.28463745, -0.06420898, -0.36987305, -0.28009033, -0.11764526, 0.04312134,
+ -0.08038330, 0.04885864, -0.03067017, -0.00042725, 0.34289551, -0.00988770, 0.34838867,
+ 0.32516479, -0.16271973, 0.38269043, 0.03240967, 0.12417603, -0.14331055, -0.34902954,
+ -0.18325806, 0.29421997, 0.44284058, 0.75170898, -0.67245483, -0.12176514, 0.27914429,
+ -0.29806519, 0.19863892, 0.30087280, 0.22680664, -0.36633301, -0.32534790, -0.57553101,
+ -0.16641235, 0.43811035, 0.08331299, 0.15942383, 0.26516724, -0.24240112, -0.11761475,
+ -0.16827393, -0.14260864, 0.46343994, 0.11804199, -0.55514526, -0.02520752, -0.14309692,
+ 0.00448608, 0.02749634, -0.30545044, 0.70965576, 0.45108032, 0.66439819, -0.68255615,
+ -0.12496948, 0.09146118, -0.21109009, -0.23791504, 0.79943848, -0.35205078, -0.24963379,
+ 0.18719482, -0.19079590, 0.07458496, 0.07623291, -0.28781128, -0.37121582, -0.19580078,
+ -0.01773071, -0.16717529, 0.13040161, 0.14672852, 0.42379761, 0.03582764, 0.11431885,
+ 0.05145264, 0.44702148, 0.08963013, 0.01367188, -0.54519653, -0.12692261, 0.21176147,
+ 0.04925537, 0.30670166, -0.11029053, 0.19555664, -0.27740479, 0.23043823, 0.15554810,
+ -0.19299316, -0.25729370, 0.17800903, -0.03579712, -0.05065918, -0.06933594, -0.09500122,
+ -0.07821655, 0.23889160, -0.31900024, 0.03073120, -0.00415039, 0.61315918, 0.37176514,
+ -0.13442993, -0.15536499, -0.19216919, -0.37899780, 0.19992065, 0.02630615, -0.12573242,
+ 0.25927734, -0.02447510, 0.29629517, -0.40731812, -0.17333984, 0.24310303, -0.10607910,
+ 0.14828491, 0.08792114, -0.18743896, -0.05572510, -0.04833984, 0.10473633, -0.29028320,
+ -0.67687988, -0.28170776, -0.41687012, 0.05413818, -0.23284912, 0.09555054, -0.08969116,
+ -0.15112305, 0.12738037, 0.35986328, 0.28948975, 0.30691528, 0.23956299, 0.06973267,
+ -0.31198120, -0.18450928, 0.22280884, -0.21600342, 0.23522949, -0.61840820, -0.13012695,
+ 0.26412964, 0.47320557, -0.26440430, 0.38757324, 0.17352295, -0.26104736, -0.25866699,
+ -0.12274170, -0.29733276, 0.07687378, 0.18588257, -0.08880615, 0.31185913, 0.05313110,
+ -0.10885620, -0.14901733, -0.22323608, -0.08538818, 0.19812012, 0.19732666, -0.18927002,
+ 0.29058838, 0.25555420, -0.48599243, 0.18768311, 0.01345825, 0.34887695, 0.21530151,
+ 0.19857788, 0.18661499, -0.01394653, -0.09063721, -0.38781738, 0.27160645, -0.20379639,
+ -0.32119751, -0.23889160, 0.27096558, 0.24951172, 0.07922363, 0.07479858, -0.50946045,
+ 0.10220337, 0.58364868, -0.19503784, -0.18560791, -0.01165771, 0.47195435, 0.22430420,
+ -0.38635254, -0.03732300, -0.09179688, 0.06991577, 0.15106201, 0.20605469, -0.05969238,
+ -0.41821289, 0.12231445, -0.04672241, -0.05117798, -0.11523438, -0.51849365, -0.04077148,
+ 0.44284058, -0.64086914, 0.17019653, 0.02236938, 0.22848511, -0.23214722, -0.32354736,
+ -0.14068604, -0.29690552, -0.19891357, 0.02774048, -0.20965576, -0.52191162, -0.19299316,
+ -0.07290649, 0.49053955, -0.22302246, 0.05642700, 0.13122559, -0.20819092, -0.83590698,
+ -0.08181763, 0.26797485, -0.00091553, -0.09457397, 0.17089844, -0.27020264, 0.30270386,
+ 0.05496216, 0.09564209, -0.08590698, 0.02130127, 0.35931396, 0.21728516, -0.15396118,
+ -0.05053711, 0.02719116, 0.16302490, 0.43212891, 0.10229492, -0.40820312, 0.21646118,
+ 0.08435059, -0.11145020, -0.39962769, -0.05618286, -0.10223389, -0.60839844, 0.33724976,
+ -0.06341553, -0.47369385, -0.32852173, 0.05242920, 0.19635010, -0.19137573, -0.67901611,
+ 0.16180420, 0.05133057, -0.22283936, 0.09646606, 0.24288940, -0.45007324, 0.08804321,
+ 0.14053345, 0.22619629, -0.01000977, 0.36355591, -0.19863892, -0.30364990, -0.24118042,
+ -0.57461548, 0.26498413, 0.04345703, -0.09796143, -0.47714233, -0.23739624, 0.18737793,
+ 0.08926392, -0.02795410, 0.00305176, -0.08700562, -0.38711548, 0.03222656, 0.10940552,
+ -0.41906738, -0.01620483, -0.47061157, 0.37985229, -0.21624756, 0.47976685, -0.20046997,
+ -0.62533569, -0.26907349, -0.02877808, 0.00671387, -0.29071045, -0.24685669, -0.15722656,
+ -0.26055908, 0.29968262, 0.28225708, -0.08990479, -0.16748047, -0.46759033, -0.25067139,
+ -0.25183105, -0.45932007, 0.05828857, 0.29006958, 0.23840332, -0.17974854, 0.26931763,
+ 0.10696411, -0.06848145, -0.17126465, -0.10522461, -0.55386353, -0.42306519, -0.07608032,
+ 0.24380493, 0.38586426, 0.16882324, 0.26751709, 0.17303467, 0.35809326, -0.22094727,
+ -0.30703735, -0.28497314, -0.04321289, 0.15219116, -0.17071533, -0.39334106, 0.03439331,
+ -0.10809326, -0.30590820, 0.26449585, -0.07412720, 0.13638306, -0.01062012, 0.27996826,
+ 0.04397583, -0.05557251, -0.56933594, 0.03363037, -0.00949097, 0.52642822, -0.44329834,
+ 0.28308105, -0.05499268, -0.23312378, -0.29870605, -0.05123901, 0.26831055, -0.35238647,
+ -0.30993652, 0.34646606, -0.19775391, 0.44595337, 0.13769531, 0.45358276, 0.19961548,
+ 0.42681885, 0.15722656, 0.00128174, 0.23757935, 0.40988159, 0.25164795, -0.00732422,
+ -0.12405396, -0.43420410, -0.00402832, 0.34243774, 0.36264038, 0.18807983, -0.09301758,
+ -0.10296631, 0.05532837, -0.31652832, 0.14337158, 0.35040283, 0.32540894, 0.05728149,
+ -0.12030029, -0.25942993, -0.20312500, -0.16491699, -0.46051025, -0.08004761, 0.50772095,
+ 0.16168213, 0.28439331, 0.08105469, -0.19104004, 0.38589478, -0.16400146, -0.25454712,
+ 0.20281982, -0.20730591, -0.06311035, 0.32937622, 0.15032959, -0.05340576, 0.30487061,
+ -0.11648560, 0.38009644, -0.20062256, 0.43466187, 0.01150513, 0.35754395, -0.13146973,
+ 0.67489624, 0.05212402, 0.27914429, -0.39431763, 0.75308228, -0.13366699, 0.24453735,
+ 0.42248535, -0.65905762, -0.00546265, -0.03491211, -0.13659668, -0.08294678, -0.45666504,
+ 0.27188110, 0.12731934, 0.61148071, 0.10449219, -0.28836060, 0.00091553, 0.24618530,
+ 0.13119507, 0.05685425, 0.17355347, 0.42034912, 0.08514404, 0.24536133, 0.18951416,
+ -0.19107056, -0.15036011, 0.02334595, 0.54986572, 0.32321167, -0.16104126, -0.03054810,
+ 0.43594360, 0.17309570, 0.61053467, 0.24731445, 0.33334351, 0.15240479, 0.15588379,
+ 0.36425781, -0.30407715, -0.13302612, 0.00427246, 0.04171753, -0.33178711, 0.34216309,
+ -0.12463379, -0.02764893, 0.05905151, -0.31436157, 0.16531372, 0.34542847, -0.03292847,
+ 0.12527466, -0.12313843, -0.13171387, 0.04757690, -0.45095825, -0.19085693, 0.35342407,
+ -0.23239136, -0.34387207, 0.11264038, -0.15740967, 0.05273438, 0.74942017, 0.21505737,
+ 0.08514404, -0.42391968, -0.19531250, 0.35293579, 0.25305176, 0.15731812, -0.70324707,
+ -0.21591187, 0.35604858, 0.14132690, 0.11724854, 0.15853882, -0.24597168, 0.07019043,
+ 0.02127075, 0.12658691, 0.06390381, -0.12292480, 0.15441895, -0.47640991, 0.06195068,
+ 0.58981323, -0.15151978, -0.03604126, -0.45059204, -0.01672363, -0.46997070, 0.25750732,
+ 0.18084717, 0.06661987, 0.13253784, 0.67828369, 0.11370850, 0.11325073, -0.04611206,
+ -0.07791138, -0.36544800, -0.06747437, -0.31594849, 0.16131592, 0.41983032, 0.11071777,
+ -0.36889648, 0.30963135, -0.37875366, 0.58508301, 0.00393677, 0.12338257, 0.03424072,
+ -0.21728516, -0.12838745, -0.46981812, 0.05868530, -0.25015259, 0.27407837, 0.65240479,
+ -0.34429932, -0.15179443, 0.14056396, 0.33505249, 0.28826904, 0.09921265, 0.34390259,
+ 0.13656616, -0.23608398, 0.00863647, 0.02627563, -0.19119263, 0.19775391, -0.07214355,
+ 0.07809448, 0.03454590, -0.03417969, 0.00033569, -0.23095703, 0.18673706, 0.05798340,
+ 0.03814697, -0.04318237, 0.05487061, 0.08633423, 0.55950928, -0.06347656, 0.10333252,
+ 0.25305176, 0.05853271, 0.12246704, -0.25543213, -0.34262085, -0.36437988, -0.21304321,
+ -0.05093384, 0.02777100, 0.07620239, -0.21215820, -0.09326172, 0.19021606, -0.40579224,
+ -0.01193237, 0.19845581, -0.35336304, -0.07397461, 0.20104980, 0.08615112, -0.44375610,
+ 0.11419678, 0.24453735, -0.16555786, -0.05081177, -0.01406860, 0.27893066, -0.18692017,
+ 0.07473755, 0.03451538, -0.39733887, 0.21548462, -0.22534180, -0.39651489, -0.04989624,
+ -0.57662964, 0.06390381, 0.62020874, -0.13470459, 0.04345703, -0.21862793, -0.02789307,
+ 0.51696777, -0.27587891, 0.39004517, 0.09857178, -0.00738525, 0.31317139, 0.00048828,
+ -0.46572876, 0.29531860, -0.10009766, -0.27856445, 0.03594971, 0.25048828, -0.74584961,
+ -0.25350952, -0.03302002, 0.31188965, 0.01571655, 0.46710205, 0.21591187, 0.07260132,
+ -0.42132568, -0.53900146, -0.13674927, -0.16571045, -0.34454346, 0.12359619, -0.11184692,
+ 0.00967407, 0.34576416, -0.05761719, 0.34848022, 0.17645264, -0.39395142, 0.10339355,
+ 0.18215942, 0.20697021, 0.59109497, -0.11560059, -0.07385254, 0.10397339, 0.35437012,
+ -0.22863770, 0.01794434, 0.17559814, -0.17495728, 0.12142944, 0.10928345, -1.00000000,
+ -0.01379395, 0.21237183, -0.27035522, 0.27319336, -0.37066650, 0.41354370, -0.40054321,
+ 0.00689697, 0.26321411, 0.39266968, 0.65298462, 0.41625977, -0.13909912, 0.78375244,
+ -0.30941772, 0.20169067, -0.39367676, 0.94021606, -0.24066162, 0.05557251, -0.24533081,
+ -0.05444336, -0.76754761, -0.19375610, -0.11041260, -0.17532349, 0.16006470, 0.02188110,
+ 0.17465210, -0.04342651, -0.56777954, -0.40988159, 0.26687622, 0.11700439, -0.00344849,
+ -0.05395508, 0.37426758, -0.40719604, -0.15032959, -0.01660156, 0.04196167, -0.04559326,
+ -0.12969971, 0.12011719, 0.08419800, -0.11199951, 0.35174561, 0.10275269, -0.25686646,
+ 0.48446655, 0.03225708, 0.28408813, -0.18701172, 0.36282349, -0.03280640, 0.32302856,
+ 0.17233276, 0.48269653, 0.31112671, -0.04946899, 0.12774658, 0.52685547, 0.10211182,
+ 0.05953979, 0.05999756, 0.20144653, 0.00744629, 0.27316284, 0.24377441, 0.39672852,
+ 0.01702881, -0.35513306, 0.11364746, -0.13555908, 0.48880005, -0.15417480, -0.09149170,
+ -0.02615356, 0.46246338, -0.72250366, 0.22332764, 0.23849487, -0.25686646, -0.08514404,
+ -0.02062988, -0.34494019, -0.02297974, -0.80386353, -0.08074951, -0.12689209, -0.06896973,
+ 0.24099731, -0.35650635, -0.09558105, 0.29254150, 0.23132324, -0.16726685, 0.00000000,
+ -0.24237061, 0.30899048, 0.29504395, -0.20898438, 0.17059326, -0.07672119, -0.14395142,
+ 0.05572510, 0.20602417, -0.51550293, -0.03167725, -0.48840332, -0.20425415, 0.14144897,
+ 0.07275391, -0.76669312, -0.22488403, 0.20651245, 0.03259277, 0.00085449, 0.03039551,
+ 0.47555542, 0.38351440
+};
+
+/** Noise level table for power compensation.
+ * Equ: pow(2.0f, (double)(6 - i) / 3.0f) where i = 0...15 */
+static const float pwc_levs[16] = {
+ 3.96875, 3.15625, 2.5, 2.0, 1.59375, 1.25, 1.0, 0.78125,
+ 0.625, 0.5, 0.40625, 0.3125, 0.25, 0.1875, 0.15625, 0.0
+};
+
+/** Map subband number to quant unit number. */
+static const int subband_to_qu[17] = {
+ 0, 8, 12, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32
+};
+
+void ff_atrac3p_power_compensation(Atrac3pChanUnitCtx *ctx, int ch_index,
+ float *sp, int rng_index, int sb)
+{
+ AtracGainInfo *g1, *g2;
+ float pwcsp[ATRAC3P_SUBBAND_SAMPLES], *dst, grp_lev, qu_lev;
+ int i, gain_lev, gcv = 0, qu, nsp;
+ int swap_ch = (ctx->unit_type == CH_UNIT_STEREO && ctx->swap_channels[sb]) ? 1 : 0;
+
+ if (ctx->channels[ch_index ^ swap_ch].power_levs[subband_to_powgrp[sb]] == ATRAC3P_POWER_COMP_OFF)
+ return;
+
+ /* generate initial noise spectrum */
+ for (i = 0; i < ATRAC3P_SUBBAND_SAMPLES; i++, rng_index++)
+ pwcsp[i] = noise_tab[rng_index & 0x3FF];
+
+ /* check gain control information */
+ g1 = &ctx->channels[ch_index ^ swap_ch].gain_data[sb];
+ g2 = &ctx->channels[ch_index ^ swap_ch].gain_data_prev[sb];
+
+ gain_lev = (g1->num_points > 0) ? (6 - g1->lev_code[0]) : 0;
+
+ for (i = 0; i < g2->num_points; i++)
+ gcv = FFMAX(gcv, gain_lev - (g2->lev_code[i] - 6));
+
+ for (i = 0; i < g1->num_points; i++)
+ gcv = FFMAX(gcv, 6 - g1->lev_code[i]);
+
+ grp_lev = pwc_levs[ctx->channels[ch_index ^ swap_ch].power_levs[subband_to_powgrp[sb]]] / (1 << gcv);
+
+ /* skip the lowest two quant units (frequencies 0...351 Hz) for subband 0 */
+ for (qu = subband_to_qu[sb] + (!sb ? 2 : 0); qu < subband_to_qu[sb + 1]; qu++) {
+ if (ctx->channels[ch_index].qu_wordlen[qu] <= 0)
+ continue;
+
+ qu_lev = ff_atrac3p_sf_tab[ctx->channels[ch_index].qu_sf_idx[qu]] *
+ ff_atrac3p_mant_tab[ctx->channels[ch_index].qu_wordlen[qu]] /
+ (1 << ctx->channels[ch_index].qu_wordlen[qu]) * grp_lev;
+
+ dst = &sp[ff_atrac3p_qu_to_spec_pos[qu]];
+ nsp = ff_atrac3p_qu_to_spec_pos[qu + 1] - ff_atrac3p_qu_to_spec_pos[qu];
+
+ for (i = 0; i < nsp; i++)
+ dst[i] += pwcsp[i] * qu_lev;
+ }
+}
+
+void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, FFTContext *mdct_ctx, float *pIn,
+ float *pOut, int wind_id, int sb)
+{
+ int i;
+
+ if (sb & 1)
+ for (i = 0; i < ATRAC3P_SUBBAND_SAMPLES / 2; i++)
+ FFSWAP(float, pIn[i], pIn[ATRAC3P_SUBBAND_SAMPLES - 1 - i]);
+
+ mdct_ctx->imdct_calc(mdct_ctx, pOut, pIn);
+
+ /* Perform windowing on the output.
+ * ATRAC3+ uses two different MDCT windows:
+ * - The first one is just the plain sine window of size 256
+ * - The 2nd one is the plain sine window of size 128
+ * wrapped into zero (at the start) and one (at the end) regions.
+ * Both regions are 32 samples long. */
+ if (wind_id & 2) { /* 1st half: steep window */
+ memset(pOut, 0, sizeof(float) * 32);
+ fdsp->vector_fmul(&pOut[32], &pOut[32], ff_sine_64, 64);
+ } else /* 1st half: simple sine window */
+ fdsp->vector_fmul(pOut, pOut, ff_sine_128, ATRAC3P_MDCT_SIZE / 2);
+
+ if (wind_id & 1) { /* 2nd half: steep window */
+ fdsp->vector_fmul_reverse(&pOut[160], &pOut[160], ff_sine_64, 64);
+ memset(&pOut[224], 0, sizeof(float) * 32);
+ } else /* 2nd half: simple sine window */
+ fdsp->vector_fmul_reverse(&pOut[128], &pOut[128], ff_sine_128,
+ ATRAC3P_MDCT_SIZE / 2);
+}
+
+/* lookup table for fast modulo 23 op required for cyclic buffers of the IPQF */
+static const int mod23_lut[26] = {
+ 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0
+};
+
+/* First half of the 384-tap IPQF filtering coefficients. */
+static const float ipqf_coeffs1[ATRAC3P_PQF_FIR_LEN][16] = {
+ { -5.8336207e-7, -8.0604229e-7, -4.2005411e-7, -4.4400572e-8,
+ 3.226247e-8, 3.530856e-8, 1.2660377e-8, 0.000010516783,
+ -0.000011838618, 6.005389e-7, 0.0000014333754, 0.0000023108685,
+ 0.0000032569742, 0.0000046192422, 0.0000063894258, 0.0000070302972 },
+ { -0.0000091622824, -0.000010502935, -0.0000079212787, -0.0000041712024,
+ -0.0000026336629, -0.0000015432918, -5.7168614e-7, 0.0000018111954,
+ 0.000023530851, 0.00002780562, 0.000032302323, 0.000036968919,
+ 0.000041575615, 0.000045337845, 0.000046043948, 0.000048585582 },
+ { -0.000064464548, -0.000068306952, -0.000073081472, -0.00007612785,
+ -0.000074850752, -0.000070208509, -0.000062285151, -0.000058270442,
+ -0.000056296329, -0.000049888811, -0.000035615325, -0.000018532943,
+ 0.0000016657353, 0.00002610587, 0.000053397067, 0.00008079566 },
+ { -0.00054488552, -0.00052537228, -0.00049731287, -0.00045778,
+ -0.00040612387, -0.00034301577, -0.00026866337, -0.00018248901,
+ -0.000084307925, 0.000025081157, 0.00014135583, 0.00026649953,
+ 0.00039945057, 0.00053928449, 0.00068422867, 0.00083093712 },
+ { -0.0014771431, -0.001283227, -0.0010566821, -0.00079780724,
+ -0.00050782406, -0.00018855913, 0.00015771533, 0.00052769453,
+ 0.00091862219, 0.001326357, 0.0017469483, 0.0021754825,
+ 0.0026067684, 0.0030352892, 0.0034549395, 0.0038591374 },
+ { -0.0022995141, -0.001443546, -0.00049266568, 0.00055068987,
+ 0.001682895, 0.0028992873, 0.0041943151, 0.0055614738,
+ 0.0069935122, 0.0084823566, 0.010018963, 0.011593862,
+ 0.013196872, 0.014817309, 0.016444042, 0.018065533 },
+ { -0.034426283, -0.034281436, -0.033992987, -0.033563249,
+ -0.032995768, -0.032295227, -0.031467363, -0.030518902,
+ -0.02945766, -0.028291954, -0.027031265, -0.025685543,
+ -0.024265358, -0.022781773, -0.021246184, -0.019670162 },
+ { -0.0030586775, -0.0037203205, -0.0042847847, -0.0047529764,
+ -0.0051268316, -0.0054091476, -0.0056034233, -0.005714261,
+ -0.0057445862, -0.0057025906, -0.0055920109, -0.0054194843,
+ -0.0051914565, -0.0049146507, -0.0045959447, -0.0042418269 },
+ { -0.0016376863, -0.0017651899, -0.0018608454, -0.0019252141,
+ -0.0019593791, -0.0019653172, -0.0019450618, -0.0018990048,
+ -0.00183808, -0.0017501717, -0.0016481078, -0.0015320742,
+ -0.0014046903, -0.0012685474, -0.001125814, -0.00097943726 },
+ { -0.00055432378, -0.00055472925, -0.00054783461, -0.00053276919,
+ -0.00051135791, -0.00048466062, -0.00045358928, -0.00042499689,
+ -0.00036942671, -0.0003392619, -0.00030001783, -0.00025986304,
+ -0.0002197204, -0.00018116167, -0.00014691355, -0.00011279432 },
+ { -0.000064147389, -0.00006174868, -0.000054267788, -0.000047133824,
+ -0.000042927582, -0.000039477309, -0.000036340745, -0.000029687517,
+ -0.000049787737, -0.000041577889, -0.000033864744, -0.000026534748,
+ -0.000019841305, -0.000014789486, -0.000013131184, -0.0000099198869 },
+ { -0.0000062990207, -0.0000072701259, -0.000011984052, -0.000017348082,
+ -0.000019907106, -0.000021348773, -0.000021961965, -0.000012203576,
+ -0.000010840992, 4.6299544e-7, 5.2588763e-7, 2.7792686e-7,
+ -2.3649704e-7, -0.0000010897784, -9.171448e-7, -5.22682e-7 }
+};
+
+/* Second half of the 384-tap IPQF filtering coefficients. */
+static const float ipqf_coeffs2[ATRAC3P_PQF_FIR_LEN][16] = {
+ { 5.22682e-7, 9.171448e-7, 0.0000010897784, 2.3649704e-7,
+ -2.7792686e-7, -5.2588763e-7, -4.6299544e-7, 0.000010840992,
+ -0.000012203576, -0.000021961965, -0.000021348773, -0.000019907106,
+ -0.000017348082, -0.000011984052, -0.0000072701259, -0.0000062990207 },
+ { 0.0000099198869, 0.000013131184, 0.000014789486, 0.000019841305,
+ 0.000026534748, 0.000033864744, 0.000041577889, 0.000049787737,
+ -0.000029687517, -0.000036340745, -0.000039477309, -0.000042927582,
+ -0.000047133824, -0.000054267788, -0.00006174868, -0.000064147389 },
+ { 0.00011279432, 0.00014691355, 0.00018116167, 0.0002197204,
+ 0.00025986304, 0.00030001783, 0.0003392619, 0.00036942671,
+ -0.00042499689, -0.00045358928, -0.00048466062, -0.00051135791,
+ -0.00053276919, -0.00054783461, -0.00055472925, -0.00055432378 },
+ { 0.00097943726, 0.001125814, 0.0012685474, 0.0014046903,
+ 0.0015320742, 0.0016481078, 0.0017501717, 0.00183808,
+ -0.0018990048, -0.0019450618, -0.0019653172, -0.0019593791,
+ -0.0019252141, -0.0018608454, -0.0017651899, -0.0016376863 },
+ { 0.0042418269, 0.0045959447, 0.0049146507, 0.0051914565,
+ 0.0054194843, 0.0055920109, 0.0057025906, 0.0057445862,
+ -0.005714261, -0.0056034233, -0.0054091476, -0.0051268316,
+ -0.0047529764, -0.0042847847, -0.0037203205, -0.0030586775 },
+ { 0.019670162, 0.021246184, 0.022781773, 0.024265358,
+ 0.025685543, 0.027031265, 0.028291954, 0.02945766,
+ -0.030518902, -0.031467363, -0.032295227, -0.032995768,
+ -0.033563249, -0.033992987, -0.034281436, -0.034426283 },
+ { -0.018065533, -0.016444042, -0.014817309, -0.013196872,
+ -0.011593862, -0.010018963, -0.0084823566, -0.0069935122,
+ 0.0055614738, 0.0041943151, 0.0028992873, 0.001682895,
+ 0.00055068987, -0.00049266568, -0.001443546, -0.0022995141 },
+ { -0.0038591374, -0.0034549395, -0.0030352892, -0.0026067684,
+ -0.0021754825, -0.0017469483, -0.001326357, -0.00091862219,
+ 0.00052769453, 0.00015771533, -0.00018855913, -0.00050782406,
+ -0.00079780724, -0.0010566821, -0.001283227, -0.0014771431 },
+ { -0.00083093712, -0.00068422867, -0.00053928449, -0.00039945057,
+ -0.00026649953, -0.00014135583, -0.000025081157, 0.000084307925,
+ -0.00018248901, -0.00026866337, -0.00034301577, -0.00040612387,
+ -0.00045778, -0.00049731287, -0.00052537228, -0.00054488552 },
+ { -0.00008079566, -0.000053397067, -0.00002610587, -0.0000016657353,
+ 0.000018532943, 0.000035615325, 0.000049888811, 0.000056296329,
+ -0.000058270442, -0.000062285151, -0.000070208509, -0.000074850752,
+ -0.00007612785, -0.000073081472, -0.000068306952, -0.000064464548 },
+ { -0.000048585582, -0.000046043948, -0.000045337845, -0.000041575615,
+ -0.000036968919, -0.000032302323, -0.00002780562, -0.000023530851,
+ 0.0000018111954, -5.7168614e-7, -0.0000015432918, -0.0000026336629,
+ -0.0000041712024, -0.0000079212787, -0.000010502935, -0.0000091622824 },
+ { -0.0000070302972, -0.0000063894258, -0.0000046192422, -0.0000032569742,
+ -0.0000023108685, -0.0000014333754, -6.005389e-7, 0.000011838618,
+ 0.000010516783, 1.2660377e-8, 3.530856e-8, 3.226247e-8,
+ -4.4400572e-8, -4.2005411e-7, -8.0604229e-7, -5.8336207e-7 }
+};
+
+void ff_atrac3p_ipqf(FFTContext *dct_ctx, Atrac3pIPQFChannelCtx *hist,
+ const float *in, float *out)
+{
+ int i, s, sb, t, pos_now, pos_next;
+ DECLARE_ALIGNED(32, float, idct_in)[ATRAC3P_SUBBANDS];
+ DECLARE_ALIGNED(32, float, idct_out)[ATRAC3P_SUBBANDS];
+
+ memset(out, 0, ATRAC3P_FRAME_SAMPLES * sizeof(*out));
+
+ for (s = 0; s < ATRAC3P_SUBBAND_SAMPLES; s++) {
+ /* pick up one sample from each subband */
+ for (sb = 0; sb < ATRAC3P_SUBBANDS; sb++)
+ idct_in[sb] = in[sb * ATRAC3P_SUBBAND_SAMPLES + s];
+
+ /* Calculate the sine and cosine part of the PQF using IDCT-IV */
+ dct_ctx->imdct_half(dct_ctx, idct_out, idct_in);
+
+ /* append the result to the history */
+ for (i = 0; i < 8; i++) {
+ hist->buf1[hist->pos][i] = idct_out[i + 8];
+ hist->buf2[hist->pos][i] = idct_out[7 - i];
+ }
+
+ pos_now = hist->pos;
+ pos_next = mod23_lut[pos_now + 2]; // pos_next = (pos_now + 1) % 23;
+
+ for (t = 0; t < ATRAC3P_PQF_FIR_LEN; t++) {
+ for (i = 0; i < 8; i++) {
+ out[s * 16 + i + 0] += hist->buf1[pos_now][i] * ipqf_coeffs1[t][i] +
+ hist->buf2[pos_next][i] * ipqf_coeffs2[t][i];
+ out[s * 16 + i + 8] += hist->buf1[pos_now][7 - i] * ipqf_coeffs1[t][i + 8] +
+ hist->buf2[pos_next][7 - i] * ipqf_coeffs2[t][i + 8];
+ }
+
+ pos_now = mod23_lut[pos_next + 2]; // pos_now = (pos_now + 2) % 23;
+ pos_next = mod23_lut[pos_now + 2]; // pos_next = (pos_next + 2) % 23;
+ }
+
+ hist->pos = mod23_lut[hist->pos]; // hist->pos = (hist->pos - 1) % 23;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/avcodec.h b/chromium/third_party/ffmpeg/libavcodec/avcodec.h
index 132c4ceaf68..9c182954940 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avcodec.h
+++ b/chromium/third_party/ffmpeg/libavcodec/avcodec.h
@@ -286,6 +286,16 @@ enum AVCodecID {
AV_CODEC_ID_WEBP_DEPRECATED,
AV_CODEC_ID_HNM4_VIDEO,
AV_CODEC_ID_HEVC_DEPRECATED,
+ AV_CODEC_ID_FIC,
+ AV_CODEC_ID_ALIAS_PIX,
+ AV_CODEC_ID_BRENDER_PIX_DEPRECATED,
+ AV_CODEC_ID_PAF_VIDEO_DEPRECATED,
+ AV_CODEC_ID_EXR_DEPRECATED,
+ AV_CODEC_ID_VP7_DEPRECATED,
+ AV_CODEC_ID_SANM_DEPRECATED,
+ AV_CODEC_ID_SGIRLE_DEPRECATED,
+ AV_CODEC_ID_MVC1_DEPRECATED,
+ AV_CODEC_ID_MVC2_DEPRECATED,
AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'),
AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
@@ -314,6 +324,7 @@ enum AVCodecID {
AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'),
AV_CODEC_ID_HEVC = MKBETAG('H','2','6','5'),
#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
+ AV_CODEC_ID_VP7 = MKBETAG('V','P','7','0'),
/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
@@ -382,6 +393,8 @@ enum AVCodecID {
AV_CODEC_ID_ADPCM_IMA_ISS,
AV_CODEC_ID_ADPCM_G722,
AV_CODEC_ID_ADPCM_IMA_APC,
+ AV_CODEC_ID_ADPCM_VIMA_DEPRECATED,
+ AV_CODEC_ID_ADPCM_VIMA = MKBETAG('V','I','M','A'),
AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '),
AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '),
@@ -471,6 +484,8 @@ enum AVCodecID {
AV_CODEC_ID_COMFORT_NOISE,
AV_CODEC_ID_TAK_DEPRECATED,
AV_CODEC_ID_METASOUND,
+ AV_CODEC_ID_PAF_AUDIO_DEPRECATED,
+ AV_CODEC_ID_ON2AVC,
AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
@@ -479,6 +494,10 @@ enum AVCodecID {
AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'),
AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'),
AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'),
+ AV_CODEC_ID_DSD_LSBF = MKBETAG('D','S','D','L'),
+ AV_CODEC_ID_DSD_MSBF = MKBETAG('D','S','D','M'),
+ AV_CODEC_ID_DSD_LSBF_PLANAR = MKBETAG('D','S','D','1'),
+ AV_CODEC_ID_DSD_MSBF_PLANAR = MKBETAG('D','S','D','8'),
/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
@@ -514,6 +533,8 @@ enum AVCodecID {
AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'),
AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'),
+ AV_CODEC_ID_TIMED_ID3 = MKBETAG('T','I','D','3'),
+ AV_CODEC_ID_BIN_DATA = MKBETAG('D','A','T','A'),
AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
@@ -551,6 +572,13 @@ typedef struct AVCodecDescriptor {
* Codec properties, a combination of AV_CODEC_PROP_* flags.
*/
int props;
+
+ /**
+ * MIME type(s) associated with the codec.
+ * May be NULL; if not, a NULL-terminated array of MIME types.
+ * The first item is always non-NULL and is the prefered MIME type.
+ */
+ const char *const *mime_types;
} AVCodecDescriptor;
/**
@@ -718,22 +746,46 @@ typedef struct RcOverride{
#define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / advanced prediction for H.263.
#define CODEC_FLAG_OUTPUT_CORRUPT 0x0008 ///< Output even those frames that might be corrupted
#define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC.
+#if FF_API_GMC
+/**
+ * @deprecated use the "gmc" private option of the libxvid encoder
+ */
#define CODEC_FLAG_GMC 0x0020 ///< Use GMC.
-#define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>.
+#endif
+#if FF_API_MV0
/**
- * The parent program guarantees that the input for B-frames containing
- * streams is not written to for at least s->max_b_frames+1 frames, if
- * this is not set the input will be copied.
+ * @deprecated use the flag "mv0" in the "mpv_flags" private option of the
+ * mpegvideo encoders
+ */
+#define CODEC_FLAG_MV0 0x0040
+#endif
+#if FF_API_INPUT_PRESERVED
+/**
+ * @deprecated passing reference-counted frames to the encoders replaces this
+ * flag
*/
#define CODEC_FLAG_INPUT_PRESERVED 0x0100
+#endif
#define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode.
#define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode.
#define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale.
-#define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges.
+#if FF_API_EMU_EDGE
+/**
+ * @deprecated edges are not used/required anymore. I.e. this flag is now always
+ * set.
+ */
+#define CODEC_FLAG_EMU_EDGE 0x4000
+#endif
#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding.
#define CODEC_FLAG_TRUNCATED 0x00010000 /** Input bitstream might be truncated at a random
location instead of only at frame boundaries. */
-#define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< Normalize adaptive quantization.
+#if FF_API_NORMALIZE_AQP
+/**
+ * @deprecated use the flag "naq" in the "mpv_flags" private option of the
+ * mpegvideo encoders
+ */
+#define CODEC_FLAG_NORMALIZE_AQP 0x00020000
+#endif
#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
#define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay.
#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe.
@@ -768,7 +820,13 @@ typedef struct RcOverride{
#define CODEC_CAP_DR1 0x0002
#define CODEC_CAP_TRUNCATED 0x0008
#if FF_API_XVMC
-/* Codec can export data for HW decoding (XvMC). */
+/* Codec can export data for HW decoding. This flag indicates that
+ * the codec would call get_format() with list that might contain HW accelerated
+ * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them
+ * including raw image format.
+ * The application can use the passed context to determine bitstream version,
+ * chroma format, resolution etc.
+ */
#define CODEC_CAP_HWACCEL 0x0010
#endif /* FF_API_XVMC */
/**
@@ -990,6 +1048,12 @@ enum AVPacketSideDataType {
AV_PKT_DATA_H263_MB_INFO,
/**
+ * This side data should be associated with an audio stream and contains
+ * ReplayGain information in form of the AVReplayGain struct.
+ */
+ AV_PKT_DATA_REPLAYGAIN,
+
+ /**
* Recommmends skipping the specified number of samples
* @code
* u32le number of samples to skip from start of this packet
@@ -1054,6 +1118,12 @@ enum AVPacketSideDataType {
AV_PKT_DATA_METADATA_UPDATE,
};
+typedef struct AVPacketSideData {
+ uint8_t *data;
+ int size;
+ enum AVPacketSideDataType type;
+} AVPacketSideData;
+
/**
* This structure stores compressed data. It is typically exported by demuxers
* and then passed as input to decoders, or received as output from encoders and
@@ -1110,11 +1180,7 @@ typedef struct AVPacket {
* Additional packet data that can be provided by the container.
* Packet can contain several types of side information.
*/
- struct {
- uint8_t *data;
- int size;
- enum AVPacketSideDataType type;
- } *side_data;
+ AVPacketSideData *side_data;
int side_data_elems;
/**
@@ -1123,11 +1189,9 @@ typedef struct AVPacket {
*/
int duration;
#if FF_API_DESTRUCT_PACKET
- // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
- // attribute_deprecated
+ attribute_deprecated
void (*destruct)(struct AVPacket *);
- // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
- // attribute_deprecated
+ attribute_deprecated
void *priv;
#endif
int64_t pos; ///< byte position in stream, -1 if unknown
@@ -1194,7 +1258,13 @@ typedef struct AVCodecContext {
enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
const struct AVCodec *codec;
+#if FF_API_CODEC_NAME
+ /**
+ * @deprecated this field is not used for anything in libavcodec
+ */
+ attribute_deprecated
char codec_name[32];
+#endif
enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */
/**
@@ -1327,12 +1397,17 @@ typedef struct AVCodecContext {
* encoded input.
*
* Audio:
- * For encoding, this is the number of "priming" samples added to the
- * beginning of the stream. The decoded output will be delayed by this
- * many samples relative to the input to the encoder. Note that this
- * field is purely informational and does not directly affect the pts
- * output by the encoder, which should always be based on the actual
- * presentation time, including any delay.
+ * For encoding, this is the number of "priming" samples added by the
+ * encoder to the beginning of the stream. The decoded output will be
+ * delayed by this many samples relative to the input to the encoder (or
+ * more, if the decoder adds its own padding).
+ * The timestamps on the output packets are adjusted by the encoder so
+ * that they always refer to the first sample of the data actually
+ * contained in the packet, including any added padding.
+ * E.g. if the timebase is 1/samplerate and the timestamp of the first
+ * input sample is 0, the timestamp of the first output packet will be
+ * -delay.
+ *
* For decoding, this is the number of samples the decoder needs to
* output before the decoder's output is valid. When seeking, you should
* start decoding this many samples prior to your desired seek point.
@@ -1698,7 +1773,7 @@ typedef struct AVCodecContext {
* XVideo Motion Acceleration
* - encoding: forbidden
* - decoding: set by decoder
- * @deprecated XvMC support is slated for removal.
+ * @deprecated XvMC doesn't need it anymore.
*/
attribute_deprecated int xvmc_acceleration;
#endif /* FF_API_XVMC */
@@ -2064,8 +2139,7 @@ typedef struct AVCodecContext {
*
* @deprecated use get_buffer2()
*/
- // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
- // attribute_deprecated
+ attribute_deprecated
int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
/**
@@ -2079,8 +2153,7 @@ typedef struct AVCodecContext {
*
* @deprecated custom freeing callbacks should be set from get_buffer2()
*/
- // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
- // attribute_deprecated
+ attribute_deprecated
void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
/**
@@ -2150,12 +2223,11 @@ typedef struct AVCodecContext {
* If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused
* (read and/or written to if it is writable) later by libavcodec.
*
- * If CODEC_FLAG_EMU_EDGE is not set in s->flags, the buffer must contain an
- * edge of the size returned by avcodec_get_edge_width() on all sides.
- *
* avcodec_align_dimensions2() should be used to find the required width and
* height, as they normally need to be rounded up to the next multiple of 16.
*
+ * Some decoders do not support linesizes changing between frames.
+ *
* If frame multithreading is used and thread_safe_callbacks is set,
* this callback may be called from a different thread, but not from more
* than one at once. Does not need to be reentrant.
@@ -2222,7 +2294,7 @@ typedef struct AVCodecContext {
/**
* ratecontrol qmin qmax limiting method
- * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax.
+ * 0-> clipping, 1-> use a nice continuous function to limit qscale within qmin/qmax.
* - encoding: Set by user.
* - decoding: unused
*/
@@ -2317,14 +2389,14 @@ typedef struct AVCodecContext {
int context_model;
/**
- * minimum Lagrange multipler
+ * minimum Lagrange multiplier
* - encoding: Set by user.
* - decoding: unused
*/
int lmin;
/**
- * maximum Lagrange multipler
+ * maximum Lagrange multiplier
* - encoding: Set by user.
* - decoding: unused
*/
@@ -2485,6 +2557,7 @@ typedef struct AVCodecContext {
int error_concealment;
#define FF_EC_GUESS_MVS 1
#define FF_EC_DEBLOCK 2
+#define FF_EC_FAVOR_INTER 256
/**
* debug
@@ -2516,6 +2589,7 @@ typedef struct AVCodecContext {
#endif
#define FF_DEBUG_BUFFERS 0x00008000
#define FF_DEBUG_THREADS 0x00010000
+#define FF_DEBUG_NOMC 0x01000000
#if FF_API_DEBUG_MV
/**
@@ -2548,8 +2622,9 @@ typedef struct AVCodecContext {
#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length
#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection
+#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue
#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors
-#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliancies as errors
+#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors
#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder should not do as an error
@@ -2613,13 +2688,17 @@ typedef struct AVCodecContext {
#define FF_IDCT_SIMPLEMMX 3
#define FF_IDCT_ARM 7
#define FF_IDCT_ALTIVEC 8
+#if FF_API_ARCH_SH4
#define FF_IDCT_SH4 9
+#endif
#define FF_IDCT_SIMPLEARM 10
#define FF_IDCT_IPP 13
#define FF_IDCT_XVIDMMX 14
#define FF_IDCT_SIMPLEARMV5TE 16
#define FF_IDCT_SIMPLEARMV6 17
+#if FF_API_ARCH_SPARC
#define FF_IDCT_SIMPLEVIS 18
+#endif
#define FF_IDCT_FAAN 20
#define FF_IDCT_SIMPLENEON 22
#if FF_API_ARCH_ALPHA
@@ -2735,7 +2814,7 @@ typedef struct AVCodecContext {
#endif
/**
- * noise vs. sse weight for the nsse comparsion function
+ * noise vs. sse weight for the nsse comparison function
* - encoding: Set by user.
* - decoding: unused
*/
@@ -2980,6 +3059,14 @@ typedef struct AVCodecContext {
#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
#endif
+
+ /**
+ * custom intra quantization matrix
+ * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix()
+ * - encoding: Set by user, can be NULL.
+ * - decoding: unused.
+ */
+ uint16_t *chroma_intra_matrix;
} AVCodecContext;
AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
@@ -2994,6 +3081,9 @@ void av_codec_set_lowres(AVCodecContext *avctx, int val);
int av_codec_get_seek_preroll(const AVCodecContext *avctx);
void av_codec_set_seek_preroll(AVCodecContext *avctx, int val);
+uint16_t *av_codec_get_chroma_intra_matrix(const AVCodecContext *avctx);
+void av_codec_set_chroma_intra_matrix(AVCodecContext *avctx, uint16_t *val);
+
/**
* AVProfile.
*/
@@ -3105,6 +3195,8 @@ typedef struct AVCodec {
int av_codec_get_max_lowres(const AVCodec *codec);
+struct MpegEncContext;
+
/**
* AVHWAccel.
*/
@@ -3143,9 +3235,21 @@ typedef struct AVHWAccel {
*/
int capabilities;
+ /*****************************************************************
+ * No fields below this line are part of the public API. They
+ * may not be used outside of libavcodec and can be changed and
+ * removed at will.
+ * New public fields should be added right above.
+ *****************************************************************
+ */
struct AVHWAccel *next;
/**
+ * Allocate a custom buffer
+ */
+ int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame);
+
+ /**
* Called at the beginning of each frame or field picture.
*
* Meaningful frame information (codec specific) is guaranteed to
@@ -3166,6 +3270,7 @@ typedef struct AVHWAccel {
*
* Meaningful slice information (codec specific) is guaranteed to
* be parsed at this point. This function is mandatory.
+ * The only exception is XvMC, that works on MB level.
*
* @param avctx the codec context
* @param buf the slice data buffer base
@@ -3186,12 +3291,46 @@ typedef struct AVHWAccel {
int (*end_frame)(AVCodecContext *avctx);
/**
- * Size of HW accelerator private data.
+ * Size of per-frame hardware accelerator private data.
*
* Private data is allocated with av_mallocz() before
* AVCodecContext.get_buffer() and deallocated after
* AVCodecContext.release_buffer().
*/
+ int frame_priv_data_size;
+
+ /**
+ * Called for every Macroblock in a slice.
+ *
+ * XvMC uses it to replace the ff_MPV_decode_mb().
+ * Instead of decoding to raw picture, MB parameters are
+ * stored in an array provided by the video driver.
+ *
+ * @param s the mpeg context
+ */
+ void (*decode_mb)(struct MpegEncContext *s);
+
+ /**
+ * Initialize the hwaccel private data.
+ *
+ * This will be called from ff_get_format(), after hwaccel and
+ * hwaccel_context are set and the hwaccel private data in AVCodecInternal
+ * is allocated.
+ */
+ int (*init)(AVCodecContext *avctx);
+
+ /**
+ * Uninitialize the hwaccel private data.
+ *
+ * This will be called from get_format() or avcodec_close(), after hwaccel
+ * and hwaccel_context are already uninitialized.
+ */
+ int (*uninit)(AVCodecContext *avctx);
+
+ /**
+ * Size of the private data to allocate in
+ * AVCodecInternal.hwaccel_priv_data.
+ */
int priv_data_size;
} AVHWAccel;
@@ -3387,13 +3526,15 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
*/
attribute_deprecated
AVFrame *avcodec_alloc_frame(void);
-#endif
/**
* Set the fields of the given AVFrame to default values.
*
* @param frame The AVFrame of which the fields should be set to default values.
+ *
+ * @deprecated use av_frame_unref()
*/
+attribute_deprecated
void avcodec_get_frame_defaults(AVFrame *frame);
/**
@@ -3405,8 +3546,12 @@ void avcodec_get_frame_defaults(AVFrame *frame);
* @warning this function does NOT free the data buffers themselves
* (it does not know how, since they might have been allocated with
* a custom get_buffer()).
+ *
+ * @deprecated use av_frame_free()
*/
+attribute_deprecated
void avcodec_free_frame(AVFrame **frame);
+#endif
/**
* Initialize the AVCodecContext to use the given AVCodec. Prior to using this
@@ -3478,8 +3623,7 @@ void avsubtitle_free(AVSubtitle *sub);
* Default packet destructor.
* @deprecated use the AVBuffer API instead
*/
-// TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
-// attribute_deprecated
+attribute_deprecated
void av_destruct_packet(AVPacket *pkt);
#endif
@@ -3545,14 +3689,14 @@ int av_dup_packet(AVPacket *pkt);
*
* @return 0 on success, negative AVERROR on fail
*/
-int av_copy_packet(AVPacket *dst, AVPacket *src);
+int av_copy_packet(AVPacket *dst, const AVPacket *src);
/**
* Copy packet side data
*
* @return 0 on success, negative AVERROR on fail
*/
-int av_copy_packet_side_data(AVPacket *dst, AVPacket *src);
+int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src);
/**
* Free a packet.
@@ -3641,7 +3785,7 @@ void av_packet_free_side_data(AVPacket *pkt);
*
* @return 0 on success, a negative AVERROR on error.
*/
-int av_packet_ref(AVPacket *dst, AVPacket *src);
+int av_packet_ref(AVPacket *dst, const AVPacket *src);
/**
* Wipe the packet.
@@ -3715,14 +3859,20 @@ attribute_deprecated int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame
*/
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
+#if FF_API_EMU_EDGE
/**
* Return the amount of padding in pixels which the get_buffer callback must
* provide around the edge of the image for codecs which do not have the
* CODEC_FLAG_EMU_EDGE flag.
*
* @return Required padding in pixels.
+ *
+ * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer
+ * needed
*/
+attribute_deprecated
unsigned avcodec_get_edge_width(void);
+#endif
/**
* Modify width and height values so that they will result in a memory
@@ -3730,8 +3880,6 @@ unsigned avcodec_get_edge_width(void);
* padding.
*
* May only be used if a codec with CODEC_CAP_DR1 has been opened.
- * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
- * according to avcodec_get_edge_width() before.
*/
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
@@ -3741,8 +3889,6 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
* line sizes are a multiple of the respective linesize_align[i].
*
* May only be used if a codec with CODEC_CAP_DR1 has been opened.
- * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
- * according to avcodec_get_edge_width() before.
*/
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
int linesize_align[AV_NUM_DATA_POINTERS]);
@@ -4607,30 +4753,8 @@ void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int
*/
unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
-#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
-#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
-#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */
-#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */
-#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */
-#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
-
-/**
- * Compute what kind of losses will occur when converting from one specific
- * pixel format to another.
- * When converting from one pixel format to another, information loss may occur.
- * For example, when converting from RGB24 to GRAY, the color information will
- * be lost. Similarly, other losses occur when converting from some formats to
- * other formats. These losses can involve loss of chroma, but also loss of
- * resolution, loss of color depth, loss due to the color space conversion, loss
- * of the alpha bits or loss due to color quantization.
- * avcodec_get_fix_fmt_loss() informs you about the various types of losses
- * which will occur when converting from one pixel format to another.
- *
- * @param[in] dst_pix_fmt destination pixel format
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @return Combination of flags informing you what kind of losses will occur
- * (maximum loss for an invalid dst_pix_fmt).
+/**
+ * @deprecated see av_get_pix_fmt_loss()
*/
int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
int has_alpha);
@@ -4657,34 +4781,7 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(const enum AVPixelFormat *p
int has_alpha, int *loss_ptr);
/**
- * Find the best pixel format to convert to given a certain source pixel
- * format and a selection of two destination pixel formats. When converting from
- * one pixel format to another, information loss may occur. For example, when converting
- * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when
- * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of
- * the given pixel formats should be used to suffer the least amount of loss.
- *
- * If one of the destination formats is AV_PIX_FMT_NONE the other pixel format (if valid) will be
- * returned.
- *
- * @code
- * src_pix_fmt = AV_PIX_FMT_YUV420P;
- * dst_pix_fmt1= AV_PIX_FMT_RGB24;
- * dst_pix_fmt2= AV_PIX_FMT_GRAY8;
- * dst_pix_fmt3= AV_PIX_FMT_RGB8;
- * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored.
- * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss);
- * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss);
- * @endcode
- *
- * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from
- * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from
- * @param[in] src_pix_fmt Source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e.
- * NULL or value of zero means we care about all losses. Out: the loss
- * that occurs when converting from src to selected dst pixel format.
- * @return The best pixel format to convert to or -1 if none was found.
+ * @deprecated see av_find_best_pix_fmt_of_2()
*/
enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
@@ -4717,7 +4814,9 @@ void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
/**
* Put a string representing the codec tag codec_tag in buf.
*
+ * @param buf buffer to place codec tag in
* @param buf_size size in bytes of buf
+ * @param codec_tag codec tag to assign
* @return the length of the string that would have been generated if
* enough space had been available, excluding the trailing null
*/
diff --git a/chromium/third_party/ffmpeg/libavcodec/avfft.h b/chromium/third_party/ffmpeg/libavcodec/avfft.h
index 2d20a45f872..0c0f9b8d8da 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avfft.h
+++ b/chromium/third_party/ffmpeg/libavcodec/avfft.h
@@ -99,9 +99,11 @@ enum DCTTransformType {
/**
* Set up DCT.
+ *
* @param nbits size of the input array:
* (1 << nbits) for DCT-II, DCT-III and DST-I
* (1 << nbits) + 1 for DCT-I
+ * @param type the type of transform
*
* @note the first element of the input of DST-I is ignored
*/
diff --git a/chromium/third_party/ffmpeg/libavcodec/avpacket.c b/chromium/third_party/ffmpeg/libavcodec/avpacket.c
index f966bfe8943..93efcec0615 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avpacket.c
+++ b/chromium/third_party/ffmpeg/libavcodec/avpacket.c
@@ -190,7 +190,7 @@ do { \
} while (0)
/* Makes duplicates of data, side_data, but does not copy any other fields */
-static int copy_packet_data(AVPacket *pkt, AVPacket *src, int dup)
+static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
{
pkt->data = NULL;
pkt->side_data = NULL;
@@ -220,7 +220,7 @@ failed_alloc:
return AVERROR(ENOMEM);
}
-int av_copy_packet_side_data(AVPacket *pkt, AVPacket *src)
+int av_copy_packet_side_data(AVPacket *pkt, const AVPacket *src)
{
if (src->side_data_elems) {
int i;
@@ -262,7 +262,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
return 0;
}
-int av_copy_packet(AVPacket *dst, AVPacket *src)
+int av_copy_packet(AVPacket *dst, const AVPacket *src)
{
*dst = *src;
return copy_packet_data(dst, src, 0);
@@ -394,7 +394,7 @@ int av_packet_split_side_data(AVPacket *pkt){
p-= size+5;
}
- pkt->side_data = av_malloc(i * sizeof(*pkt->side_data));
+ pkt->side_data = av_malloc_array(i, sizeof(*pkt->side_data));
if (!pkt->side_data)
return AVERROR(ENOMEM);
@@ -534,7 +534,7 @@ void av_packet_unref(AVPacket *pkt)
pkt->size = 0;
}
-int av_packet_ref(AVPacket *dst, AVPacket *src)
+int av_packet_ref(AVPacket *dst, const AVPacket *src)
{
int ret;
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/Makefile b/chromium/third_party/ffmpeg/libavcodec/bfin/Makefile
index c2933602055..efdcbfc69f0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/Makefile
@@ -1,10 +1,10 @@
-OBJS += bfin/dsputil_bfin.o \
- bfin/fdct_bfin.o \
- bfin/idct_bfin.o \
- bfin/pixels_bfin.o \
-
-OBJS-$(CONFIG_HPELDSP) += bfin/hpeldsp_bfin.o \
- bfin/hpel_pixels_bfin.o
-OBJS-$(CONFIG_MPEGVIDEOENC) += bfin/mpegvideo_bfin.o
-OBJS-$(CONFIG_VP3DSP) += bfin/vp3_bfin.o \
- bfin/vp3_idct_bfin.o
+OBJS-$(CONFIG_DSPUTIL) += bfin/dsputil_init.o \
+ bfin/dsputil.o \
+ bfin/fdct_bfin.o \
+ bfin/idct_bfin.o \
+ bfin/pixels.o
+OBJS-$(CONFIG_HPELDSP) += bfin/hpeldsp_init.o \
+ bfin/hpel_pixels_no_rnd.o \
+ bfin/pixels.o
+OBJS-$(CONFIG_VP3DSP) += bfin/vp3dsp_init.o \
+ bfin/vp3dsp.o
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/pixels_bfin.S b/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil.S
index 2c84deb83f5..25bdac2520d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/pixels_bfin.S
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil.S
@@ -18,7 +18,8 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config_bfin.h"
+
+#include "libavutil/bfin/asm.h"
DEFUN(put_pixels_clamped,mL1,
(int16_t *block, uint8_t *dest, int line_size)):
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_bfin.c b/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_bfin.c
deleted file mode 100644
index a95fd6b62ca..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_bfin.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * BlackFin DSPUTILS
- *
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
- * Copyright (c) 2006 Michael Benjamin <michael.benjamin@analog.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 "libavutil/attributes.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
-#include "dsputil_bfin.h"
-
-int off;
-
-static void bfin_idct_add (uint8_t *dest, int line_size, int16_t *block)
-{
- ff_bfin_idct (block);
- ff_bfin_add_pixels_clamped (block, dest, line_size);
-}
-
-static void bfin_idct_put (uint8_t *dest, int line_size, int16_t *block)
-{
- ff_bfin_idct (block);
- ff_bfin_put_pixels_clamped (block, dest, line_size);
-}
-
-
-static void bfin_clear_blocks (int16_t *blocks)
-{
- // This is just a simple memset.
- //
- __asm__("P0=192; "
- "I0=%0; "
- "R0=0; "
- "LSETUP(clear_blocks_blkfn_lab,clear_blocks_blkfn_lab)LC0=P0;"
- "clear_blocks_blkfn_lab:"
- "[I0++]=R0;"
- ::"a" (blocks):"P0","I0","R0");
-}
-
-static int bfin_pix_abs16 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
- return ff_bfin_z_sad16x16 (blk1,blk2,line_size,line_size,h);
-}
-
-static int bfin_vsad_intra16 (void *c, uint8_t *blk1, uint8_t *dummy, int stride, int h) {
- return ff_bfin_z_sad16x16 (blk1,blk1+stride,stride<<1,stride<<1,h);
-}
-
-static int bfin_vsad (void *c, uint8_t *blk1, uint8_t *blk2, int stride, int h) {
- return ff_bfin_z_sad16x16 (blk1,blk1+stride,stride<<1,stride<<1,h)
- + ff_bfin_z_sad16x16 (blk2,blk2+stride,stride<<1,stride<<1,h);
-}
-
-static uint8_t vtmp_blk[256] attribute_l1_data_b;
-
-static int bfin_pix_abs16_x2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
- ff_bfin_put_pixels16uc (vtmp_blk, blk2, blk2+1, 16, line_size, h);
- return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
-}
-
-static int bfin_pix_abs16_y2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
- ff_bfin_put_pixels16uc (vtmp_blk, blk2, blk2+line_size, 16, line_size, h);
- return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
-}
-
-static int bfin_pix_abs16_xy2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
- ff_bfin_z_put_pixels16_xy2 (vtmp_blk, blk2, 16, line_size, h);
- return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
-}
-
-static int bfin_pix_abs8 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
- return ff_bfin_z_sad8x8 (blk1,blk2,line_size,line_size, h);
-}
-
-static int bfin_pix_abs8_x2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
- ff_bfin_put_pixels8uc (vtmp_blk, blk2, blk2+1, 8, line_size, h);
- return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
-}
-
-static int bfin_pix_abs8_y2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
- ff_bfin_put_pixels8uc (vtmp_blk, blk2, blk2+line_size, 8, line_size, h);
- return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
-}
-
-static int bfin_pix_abs8_xy2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
- ff_bfin_z_put_pixels8_xy2 (vtmp_blk, blk2, 8, line_size, h);
- return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
-}
-
-
-/*
- decoder optimization
- start on 2/11 100 frames of 352x240@25 compiled with no optimization -g debugging
- 9.824s ~ 2.44x off
- 6.360s ~ 1.58x off with -O2
- 5.740s ~ 1.43x off with idcts
-
- 2.64s 2/20 same sman.mp4 decode only
-
-*/
-
-av_cold void ff_dsputil_init_bfin(DSPContext *c, AVCodecContext *avctx)
-{
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
- c->diff_pixels = ff_bfin_diff_pixels;
- c->put_pixels_clamped = ff_bfin_put_pixels_clamped;
- c->add_pixels_clamped = ff_bfin_add_pixels_clamped;
-
- if (!high_bit_depth)
- c->get_pixels = ff_bfin_get_pixels;
- c->clear_blocks = bfin_clear_blocks;
- c->pix_sum = ff_bfin_pix_sum;
- c->pix_norm1 = ff_bfin_pix_norm1;
-
- c->sad[0] = bfin_pix_abs16;
- c->sad[1] = bfin_pix_abs8;
-
-/* c->vsad[0] = bfin_vsad; */
-/* c->vsad[4] = bfin_vsad_intra16; */
-
- /* TODO [0] 16 [1] 8 */
- c->pix_abs[0][0] = bfin_pix_abs16;
- c->pix_abs[0][1] = bfin_pix_abs16_x2;
- c->pix_abs[0][2] = bfin_pix_abs16_y2;
- c->pix_abs[0][3] = bfin_pix_abs16_xy2;
-
- c->pix_abs[1][0] = bfin_pix_abs8;
- c->pix_abs[1][1] = bfin_pix_abs8_x2;
- c->pix_abs[1][2] = bfin_pix_abs8_y2;
- c->pix_abs[1][3] = bfin_pix_abs8_xy2;
-
-
- c->sse[0] = ff_bfin_sse16;
- c->sse[1] = ff_bfin_sse8;
- c->sse[2] = ff_bfin_sse4;
-
- if (avctx->bits_per_raw_sample <= 8) {
- if (avctx->dct_algo == FF_DCT_AUTO)
- c->fdct = ff_bfin_fdct;
-
- if (avctx->idct_algo == FF_IDCT_AUTO) {
- c->idct_permutation_type = FF_NO_IDCT_PERM;
- c->idct = ff_bfin_idct;
- c->idct_add = bfin_idct_add;
- c->idct_put = bfin_idct_put;
- }
- }
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_bfin.h b/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_bfin.h
deleted file mode 100644
index 079ebdda6b6..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_bfin.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * BlackFin DSPUTILS COMMON OPTIMIZATIONS HEADER
- *
- * Copyright (C) 2007 Marc Hoffman <mmh@pleasantst.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
- */
-
-
-#ifndef AVCODEC_BFIN_DSPUTIL_BFIN_H
-#define AVCODEC_BFIN_DSPUTIL_BFIN_H
-
-#include <stdint.h>
-
-#include "config.h"
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-#define attribute_l1_text __attribute__ ((l1_text))
-#define attribute_l1_data_b __attribute__((l1_data_B))
-#else
-#define attribute_l1_text
-#define attribute_l1_data_b
-#endif
-
-void ff_bfin_idct (int16_t *block) attribute_l1_text;
-void ff_bfin_fdct (int16_t *block) attribute_l1_text;
-void ff_bfin_add_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text;
-void ff_bfin_put_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text;
-void ff_bfin_diff_pixels (int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride) attribute_l1_text;
-void ff_bfin_get_pixels (int16_t *restrict block, const uint8_t *pixels, int line_size) attribute_l1_text;
-int ff_bfin_pix_norm1 (uint8_t * pix, int line_size) attribute_l1_text;
-int ff_bfin_z_sad8x8 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
-int ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
-
-int ff_bfin_pix_sum (uint8_t *p, int stride) attribute_l1_text;
-
-int ff_bfin_sse4 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
-int ff_bfin_sse8 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
-int ff_bfin_sse16 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
-
-
-#ifdef BFIN_PROFILE
-
-static double Telem[16];
-static char *TelemNames[16];
-static int TelemCnt;
-
-#define PROF(lab,e) { int xx_e = e; char*xx_lab = lab; uint64_t xx_t0 = read_time();
-#define EPROF() xx_t0 = read_time()-xx_t0; Telem[xx_e] = Telem[xx_e] + xx_t0; TelemNames[xx_e] = xx_lab; }
-
-static void prof_report (void)
-{
- int i;
- double s = 0;
- for (i=0;i<16;i++) {
- double v;
- if (TelemNames[i]) {
- v = Telem[i]/TelemCnt;
- av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n", TelemNames[i],v,v/64);
- s = s + Telem[i];
- }
- }
- av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n%20.4f\t%d\n",
- "total",s/TelemCnt,s/TelemCnt/64,s,TelemCnt);
-}
-
-static void bfprof (void)
-{
- static int init;
- if (!init) atexit (prof_report);
- init=1;
- TelemCnt++;
-}
-
-#else
-#define PROF(a,b)
-#define EPROF()
-#define bfprof()
-#endif
-
-#endif /* AVCODEC_BFIN_DSPUTIL_BFIN_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_init.c b/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_init.c
new file mode 100644
index 00000000000..92bd354ff3f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/dsputil_init.c
@@ -0,0 +1,195 @@
+/*
+ * BlackFin DSPUTILS
+ *
+ * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
+ * Copyright (c) 2006 Michael Benjamin <michael.benjamin@analog.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 "config.h"
+#include "libavutil/attributes.h"
+#include "libavutil/bfin/attributes.h"
+#include "libavcodec/avcodec.h"
+#include "libavcodec/dsputil.h"
+#include "libavcodec/mpegvideo.h"
+
+void ff_bfin_idct(int16_t *block) attribute_l1_text;
+void ff_bfin_fdct(int16_t *block) attribute_l1_text;
+
+void ff_bfin_add_pixels_clamped(const int16_t *block, uint8_t *dest,
+ int line_size) attribute_l1_text;
+void ff_bfin_put_pixels_clamped(const int16_t *block, uint8_t *dest,
+ int line_size) attribute_l1_text;
+
+void ff_bfin_diff_pixels(int16_t *block, const uint8_t *s1, const uint8_t *s2,
+ int stride) attribute_l1_text;
+void ff_bfin_get_pixels(int16_t *restrict block, const uint8_t *pixels,
+ int line_size) attribute_l1_text;
+
+int ff_bfin_pix_norm1(uint8_t *pix, int line_size) attribute_l1_text;
+int ff_bfin_pix_sum(uint8_t *p, int stride) attribute_l1_text;
+
+int ff_bfin_z_sad8x8(uint8_t *blk1, uint8_t *blk2, int dsz,
+ int line_size, int h) attribute_l1_text;
+int ff_bfin_z_sad16x16(uint8_t *blk1, uint8_t *blk2, int dsz,
+ int line_size, int h) attribute_l1_text;
+
+int ff_bfin_sse4(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h) attribute_l1_text;
+int ff_bfin_sse8(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h) attribute_l1_text;
+int ff_bfin_sse16(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h) attribute_l1_text;
+
+static void bfin_idct_add(uint8_t *dest, int line_size, int16_t *block)
+{
+ ff_bfin_idct(block);
+ ff_bfin_add_pixels_clamped(block, dest, line_size);
+}
+
+static void bfin_idct_put(uint8_t *dest, int line_size, int16_t *block)
+{
+ ff_bfin_idct(block);
+ ff_bfin_put_pixels_clamped(block, dest, line_size);
+}
+
+static void bfin_clear_blocks(int16_t *blocks)
+{
+ // This is just a simple memset.
+ __asm__ ("P0=192; "
+ "I0=%0; "
+ "R0=0; "
+ "LSETUP(clear_blocks_blkfn_lab,clear_blocks_blkfn_lab)LC0=P0;"
+ "clear_blocks_blkfn_lab:"
+ "[I0++]=R0;"
+ ::"a" (blocks) : "P0", "I0", "R0");
+}
+
+static int bfin_pix_abs16(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
+ int line_size, int h)
+{
+ return ff_bfin_z_sad16x16(blk1, blk2, line_size, line_size, h);
+}
+
+static uint8_t vtmp_blk[256] attribute_l1_data_b;
+
+static int bfin_pix_abs16_x2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
+ int line_size, int h)
+{
+ ff_bfin_put_pixels16uc(vtmp_blk, blk2, blk2 + 1, 16, line_size, h);
+ return ff_bfin_z_sad16x16(blk1, vtmp_blk, line_size, 16, h);
+}
+
+static int bfin_pix_abs16_y2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
+ int line_size, int h)
+{
+ ff_bfin_put_pixels16uc(vtmp_blk, blk2, blk2 + line_size, 16, line_size, h);
+ return ff_bfin_z_sad16x16(blk1, vtmp_blk, line_size, 16, h);
+}
+
+static int bfin_pix_abs16_xy2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
+ int line_size, int h)
+{
+ ff_bfin_z_put_pixels16_xy2(vtmp_blk, blk2, 16, line_size, h);
+ return ff_bfin_z_sad16x16(blk1, vtmp_blk, line_size, 16, h);
+}
+
+static int bfin_pix_abs8(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
+ int line_size, int h)
+{
+ return ff_bfin_z_sad8x8(blk1, blk2, line_size, line_size, h);
+}
+
+static int bfin_pix_abs8_x2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
+ int line_size, int h)
+{
+ ff_bfin_put_pixels8uc(vtmp_blk, blk2, blk2 + 1, 8, line_size, h);
+ return ff_bfin_z_sad8x8(blk1, vtmp_blk, line_size, 8, h);
+}
+
+static int bfin_pix_abs8_y2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
+ int line_size, int h)
+{
+ ff_bfin_put_pixels8uc(vtmp_blk, blk2, blk2 + line_size, 8, line_size, h);
+ return ff_bfin_z_sad8x8(blk1, vtmp_blk, line_size, 8, h);
+}
+
+static int bfin_pix_abs8_xy2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
+ int line_size, int h)
+{
+ ff_bfin_z_put_pixels8_xy2(vtmp_blk, blk2, 8, line_size, h);
+ return ff_bfin_z_sad8x8(blk1, vtmp_blk, line_size, 8, h);
+}
+
+/*
+ * decoder optimization
+ * start on 2/11 100 frames of 352x240@25 compiled with no optimization -g debugging
+ * 9.824s ~ 2.44x off
+ * 6.360s ~ 1.58x off with -O2
+ * 5.740s ~ 1.43x off with idcts
+ *
+ * 2.64s 2/20 same sman.mp4 decode only
+ */
+
+av_cold void ff_dsputil_init_bfin(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+ c->diff_pixels = ff_bfin_diff_pixels;
+
+ c->put_pixels_clamped = ff_bfin_put_pixels_clamped;
+ c->add_pixels_clamped = ff_bfin_add_pixels_clamped;
+
+ c->clear_blocks = bfin_clear_blocks;
+
+ c->pix_sum = ff_bfin_pix_sum;
+ c->pix_norm1 = ff_bfin_pix_norm1;
+
+ c->sad[0] = bfin_pix_abs16;
+ c->sad[1] = bfin_pix_abs8;
+
+ /* TODO [0] 16 [1] 8 */
+ c->pix_abs[0][0] = bfin_pix_abs16;
+ c->pix_abs[0][1] = bfin_pix_abs16_x2;
+ c->pix_abs[0][2] = bfin_pix_abs16_y2;
+ c->pix_abs[0][3] = bfin_pix_abs16_xy2;
+
+ c->pix_abs[1][0] = bfin_pix_abs8;
+ c->pix_abs[1][1] = bfin_pix_abs8_x2;
+ c->pix_abs[1][2] = bfin_pix_abs8_y2;
+ c->pix_abs[1][3] = bfin_pix_abs8_xy2;
+
+ c->sse[0] = ff_bfin_sse16;
+ c->sse[1] = ff_bfin_sse8;
+ c->sse[2] = ff_bfin_sse4;
+
+ if (!high_bit_depth) {
+ c->get_pixels = ff_bfin_get_pixels;
+
+ if (avctx->dct_algo == FF_DCT_AUTO)
+ c->fdct = ff_bfin_fdct;
+
+ if (avctx->idct_algo == FF_IDCT_AUTO) {
+ c->idct_permutation_type = FF_NO_IDCT_PERM;
+ c->idct = ff_bfin_idct;
+ c->idct_add = bfin_idct_add;
+ c->idct_put = bfin_idct_put;
+ }
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/fdct_bfin.S b/chromium/third_party/ffmpeg/libavcodec/bfin/fdct_bfin.S
index 916957467c6..1b839aafb2b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/fdct_bfin.S
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/fdct_bfin.S
@@ -127,21 +127,16 @@ root:/u/ffmpeg/bhead/libavcodec>
*/
-#include "config.h"
-#include "config_bfin.h"
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.B,"aw",@progbits
-#else
-.data
-#endif
+#include "libavutil/bfin/asm.h"
+
+SECTION_L1_DATA_B
+
.align 4;
dct_coeff:
.short 0x5a82, 0x2d41, 0x187e, 0x3b21, 0x0c7c, 0x3ec5, 0x238e, 0x3537;
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.A,"aw",@progbits
-#endif
+SECTION_L1_DATA_A
+
.align 4
vtmp: .space 128
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/hpel_pixels_no_rnd.S b/chromium/third_party/ffmpeg/libavcodec/bfin/hpel_pixels_no_rnd.S
new file mode 100644
index 00000000000..aeb56edadb1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/hpel_pixels_no_rnd.S
@@ -0,0 +1,81 @@
+/*
+ * Blackfin Pixel Operations
+ * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.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 "libavutil/bfin/asm.h"
+
+DEFUN(put_pixels8uc_no_rnd,mL1,
+ (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
+ int line_size, int h)):
+ i3=r0; // dest
+ i0=r1; // src0
+ i1=r2; // src1
+ r2=[sp+12]; // line_size
+ p0=[sp+16]; // h
+ [--sp] = (r7:6);
+ r2+=-4;
+ m3=r2;
+ r2+=-4;
+ m0=r2;
+ LSETUP(pp8$2,pp8$3) LC0=P0;
+ DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
+
+pp8$2: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
+ R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++M0]|| R2 =[I1++M0];
+ R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++] || [I3++] = R6 ;
+pp8$3: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
+
+ (r7:6) = [sp++];
+ RTS;
+DEFUN_END(put_pixels8uc_no_rnd)
+
+DEFUN(put_pixels16uc_no_rnd,mL1,
+ (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
+ int line_size, int h)):
+ i3=r0; // dest
+ i0=r1; // src0
+ i1=r2; // src1
+ r2=[sp+12]; // line_size
+ p0=[sp+16]; // h
+
+ [--sp] = (r7:6);
+ r2+=-12;
+ m3=r2; // line_size
+ r2+=-4;
+ m0=r2;
+
+ LSETUP(pp16$2,pp16$3) LC0=P0;
+ DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
+
+pp16$2:
+ DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
+ R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++] || R2 =[I1++];
+ R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R1 = [I0++] || R3 =[I1++];
+ [I3++] = R6;
+
+ R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++M0] || R2 =[I1++M0];
+ R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++] || [I3++] = R7 ;
+ [I3++] = R6;
+pp16$3: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
+
+ (r7:6) = [sp++];
+
+ RTS;
+DEFUN_END(put_pixels16uc_no_rnd)
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_bfin.c b/chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_bfin.c
deleted file mode 100644
index 2df551b89a7..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_bfin.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * BlackFin DSPUTILS
- *
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
- * Copyright (c) 2006 Michael Benjamin <michael.benjamin@analog.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 <stddef.h>
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavcodec/hpeldsp.h"
-#include "hpeldsp_bfin.h"
-
-static void bfin_put_pixels8 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels8uc (block, pixels, pixels, line_size, line_size, h);
-}
-
-static void bfin_put_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels8uc (block, pixels, pixels+1, line_size, line_size, h);
-}
-
-static void bfin_put_pixels8_y2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels8uc (block, pixels, pixels+line_size, line_size, line_size, h);
-}
-
-static void bfin_put_pixels8_xy2 (uint8_t *block, const uint8_t *s0, ptrdiff_t line_size, int h)
-{
- ff_bfin_z_put_pixels8_xy2 (block,s0,line_size, line_size, h);
-}
-
-static void bfin_put_pixels16 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels16uc (block, pixels, pixels, line_size, line_size, h);
-}
-
-static void bfin_put_pixels16_x2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels16uc (block, pixels, pixels+1, line_size, line_size, h);
-}
-
-static void bfin_put_pixels16_y2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels16uc (block, pixels, pixels+line_size, line_size, line_size, h);
-}
-
-static void bfin_put_pixels16_xy2 (uint8_t *block, const uint8_t *s0, ptrdiff_t line_size, int h)
-{
- ff_bfin_z_put_pixels16_xy2 (block,s0,line_size, line_size, h);
-}
-
-static void bfin_put_pixels8_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels8uc_nornd (block, pixels, pixels, line_size, h);
-}
-
-static void bfin_put_pixels8_x2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+1, line_size, h);
-}
-
-static void bfin_put_pixels8_y2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+line_size, line_size, h);
-}
-
-
-static void bfin_put_pixels16_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels16uc_nornd (block, pixels, pixels, line_size, h);
-}
-
-static void bfin_put_pixels16_x2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+1, line_size, h);
-}
-
-static void bfin_put_pixels16_y2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
- ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+line_size, line_size, h);
-}
-
-av_cold void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags)
-{
- c->put_pixels_tab[0][0] = bfin_put_pixels16;
- c->put_pixels_tab[0][1] = bfin_put_pixels16_x2;
- c->put_pixels_tab[0][2] = bfin_put_pixels16_y2;
- c->put_pixels_tab[0][3] = bfin_put_pixels16_xy2;
-
- c->put_pixels_tab[1][0] = bfin_put_pixels8;
- c->put_pixels_tab[1][1] = bfin_put_pixels8_x2;
- c->put_pixels_tab[1][2] = bfin_put_pixels8_y2;
- c->put_pixels_tab[1][3] = bfin_put_pixels8_xy2;
-
- c->put_no_rnd_pixels_tab[1][0] = bfin_put_pixels8_nornd;
- c->put_no_rnd_pixels_tab[1][1] = bfin_put_pixels8_x2_nornd;
- c->put_no_rnd_pixels_tab[1][2] = bfin_put_pixels8_y2_nornd;
-/* c->put_no_rnd_pixels_tab[1][3] = ff_bfin_put_pixels8_xy2_nornd; */
-
- c->put_no_rnd_pixels_tab[0][0] = bfin_put_pixels16_nornd;
- c->put_no_rnd_pixels_tab[0][1] = bfin_put_pixels16_x2_nornd;
- c->put_no_rnd_pixels_tab[0][2] = bfin_put_pixels16_y2_nornd;
-/* c->put_no_rnd_pixels_tab[0][3] = ff_bfin_put_pixels16_xy2_nornd; */
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_bfin.h b/chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_bfin.h
deleted file mode 100644
index 36f38722d25..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_bfin.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * BlackFin DSPUTILS COMMON OPTIMIZATIONS HEADER
- *
- * Copyright (C) 2007 Marc Hoffman <mmh@pleasantst.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
- */
-
-
-#ifndef AVCODEC_BFIN_HPELDSP_BFIN_H
-#define AVCODEC_BFIN_HPELDSP_BFIN_H
-
-#include <stdint.h>
-
-#include "config.h"
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-#define attribute_l1_text __attribute__ ((l1_text))
-#define attribute_l1_data_b __attribute__((l1_data_B))
-#else
-#define attribute_l1_text
-#define attribute_l1_data_b
-#endif
-
-void ff_bfin_z_put_pixels16_xy2 (uint8_t *block, const uint8_t *s0, int dest_size, int line_size, int h) attribute_l1_text;
-void ff_bfin_z_put_pixels8_xy2 (uint8_t *block, const uint8_t *s0, int dest_size, int line_size, int h) attribute_l1_text;
-void ff_bfin_put_pixels16_xy2_nornd (uint8_t *block, const uint8_t *s0, int line_size, int h) attribute_l1_text;
-void ff_bfin_put_pixels8_xy2_nornd (uint8_t *block, const uint8_t *s0, int line_size, int h) attribute_l1_text;
-
-
-void ff_bfin_put_pixels8uc (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int dest_size, int line_size, int h) attribute_l1_text;
-void ff_bfin_put_pixels16uc (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int dest_size, int line_size, int h) attribute_l1_text;
-void ff_bfin_put_pixels8uc_nornd (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int line_size, int h) attribute_l1_text;
-void ff_bfin_put_pixels16uc_nornd (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int line_size, int h) attribute_l1_text;
-
-#endif /* AVCODEC_BFIN_HPELDSP_BFIN_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_init.c b/chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_init.c
new file mode 100644
index 00000000000..d671e53425e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/hpeldsp_init.c
@@ -0,0 +1,146 @@
+/*
+ * BlackFin halfpel functions
+ *
+ * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
+ * Copyright (c) 2006 Michael Benjamin <michael.benjamin@analog.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 <stddef.h>
+#include <stdint.h>
+
+#include "libavutil/attributes.h"
+#include "libavutil/bfin/attributes.h"
+#include "libavcodec/hpeldsp.h"
+#include "pixels.h"
+
+void ff_bfin_put_pixels8uc_no_rnd(uint8_t *block, const uint8_t *s0,
+ const uint8_t *s1, int line_size,
+ int h) attribute_l1_text;
+void ff_bfin_put_pixels16uc_no_rnd(uint8_t *block, const uint8_t *s0,
+ const uint8_t *s1, int line_size,
+ int h) attribute_l1_text;
+
+static void bfin_put_pixels8(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels8uc(block, pixels, pixels, line_size, line_size, h);
+}
+
+static void bfin_put_pixels8_x2(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels8uc(block, pixels, pixels + 1, line_size, line_size, h);
+}
+
+static void bfin_put_pixels8_y2(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels8uc(block, pixels, pixels + line_size,
+ line_size, line_size, h);
+}
+
+static void bfin_put_pixels8_xy2(uint8_t *block, const uint8_t *s0,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_z_put_pixels8_xy2(block, s0, line_size, line_size, h);
+}
+
+static void bfin_put_pixels16(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels16uc(block, pixels, pixels, line_size, line_size, h);
+}
+
+static void bfin_put_pixels16_x2(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels16uc(block, pixels, pixels + 1, line_size, line_size, h);
+}
+
+static void bfin_put_pixels16_y2(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels16uc(block, pixels, pixels + line_size,
+ line_size, line_size, h);
+}
+
+static void bfin_put_pixels16_xy2(uint8_t *block, const uint8_t *s0,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_z_put_pixels16_xy2(block, s0, line_size, line_size, h);
+}
+
+static void bfin_put_pixels8_no_rnd(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels8uc_no_rnd(block, pixels, pixels, line_size, h);
+}
+
+static void bfin_put_pixels8_x2_no_rnd(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels8uc_no_rnd(block, pixels, pixels + 1, line_size, h);
+}
+
+static void bfin_put_pixels8_y2_no_rnd(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels8uc_no_rnd(block, pixels, pixels + line_size,
+ line_size, h);
+}
+
+static void bfin_put_pixels16_no_rnd(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels16uc_no_rnd(block, pixels, pixels, line_size, h);
+}
+
+static void bfin_put_pixels16_x2_no_rnd(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels16uc_no_rnd(block, pixels, pixels + 1, line_size, h);
+}
+
+static void bfin_put_pixels16_y2_no_rnd(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ ff_bfin_put_pixels16uc_no_rnd(block, pixels, pixels + line_size,
+ line_size, h);
+}
+
+av_cold void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags)
+{
+ c->put_pixels_tab[0][0] = bfin_put_pixels16;
+ c->put_pixels_tab[0][1] = bfin_put_pixels16_x2;
+ c->put_pixels_tab[0][2] = bfin_put_pixels16_y2;
+ c->put_pixels_tab[0][3] = bfin_put_pixels16_xy2;
+
+ c->put_pixels_tab[1][0] = bfin_put_pixels8;
+ c->put_pixels_tab[1][1] = bfin_put_pixels8_x2;
+ c->put_pixels_tab[1][2] = bfin_put_pixels8_y2;
+ c->put_pixels_tab[1][3] = bfin_put_pixels8_xy2;
+
+ c->put_no_rnd_pixels_tab[1][0] = bfin_put_pixels8_no_rnd;
+ c->put_no_rnd_pixels_tab[1][1] = bfin_put_pixels8_x2_no_rnd;
+ c->put_no_rnd_pixels_tab[1][2] = bfin_put_pixels8_y2_no_rnd;
+
+ c->put_no_rnd_pixels_tab[0][0] = bfin_put_pixels16_no_rnd;
+ c->put_no_rnd_pixels_tab[0][1] = bfin_put_pixels16_x2_no_rnd;
+ c->put_no_rnd_pixels_tab[0][2] = bfin_put_pixels16_y2_no_rnd;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/idct_bfin.S b/chromium/third_party/ffmpeg/libavcodec/bfin/idct_bfin.S
index bd80447bde8..0ae3f5ac374 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/idct_bfin.S
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/idct_bfin.S
@@ -55,14 +55,9 @@ IDCT BFINidct: 88.3 kdct/s
*/
-#include "config.h"
-#include "config_bfin.h"
+#include "libavutil/bfin/asm.h"
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.B,"aw",@progbits
-#else
-.data
-#endif
+SECTION_L1_DATA_B
.align 4;
coefs:
@@ -77,9 +72,7 @@ coefs:
.short 0x18F9; //cos(7pi/16)
.short 0x7D8A; //cos(pi/16)
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.A,"aw",@progbits
-#endif
+SECTION_L1_DATA_A
vtmp: .space 256
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/mpegvideo_bfin.c b/chromium/third_party/ffmpeg/libavcodec/bfin/mpegvideo_bfin.c
deleted file mode 100644
index 458e7dcdbae..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/mpegvideo_bfin.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * BlackFin MPEGVIDEO OPTIMIZATIONS
- *
- * Copyright (C) 2007 Marc Hoffman <mmh@pleasantst.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 "libavutil/attributes.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/mpegvideo.h"
-#include "dsputil_bfin.h"
-
-static int dct_quantize_bfin (MpegEncContext *s,
- int16_t *block, int n,
- int qscale, int *overflow)
-{
- int last_non_zero, q, start_i;
- const short *qmat;
- short *bias;
- const uint8_t *scantable= s->intra_scantable.scantable;
- short dc;
- int max=0;
-
- PROF("fdct",0);
- s->dsp.fdct(block);
- EPROF();
-
- PROF("denoise",1);
- if(s->dct_error_sum)
- s->denoise_dct(s, block);
- EPROF();
-
- PROF("quant-init",2);
- if (s->mb_intra) {
- if (!s->h263_aic) {
- if (n < 4)
- q = s->y_dc_scale;
- else
- q = s->c_dc_scale;
- q = q << 3;
- } else
- /* For AIC we skip quant/dequant of INTRADC */
- q = 1 << 3;
-
- /* note: block[0] is assumed to be positive */
- dc = block[0] = (block[0] + (q >> 1)) / q;
- start_i = 1;
- last_non_zero = 0;
- if(n<4){
- bias = s->q_intra_matrix16[qscale][1];
- qmat = s->q_intra_matrix16[qscale][0];
- }else{
- bias = s->q_chroma_intra_matrix16[qscale][1];
- qmat = s->q_chroma_intra_matrix16[qscale][0];
- }
-
- } else {
- start_i = 0;
- last_non_zero = -1;
- bias = s->q_inter_matrix16[qscale][1];
- qmat = s->q_inter_matrix16[qscale][0];
-
- }
- EPROF();
-
- PROF("quantize",4);
-
- /* for(i=start_i; i<64; i++) { */
- /* sign = (block[i]>>15)|1; */
- /* level = ((abs(block[i])+bias[0])*qmat[i])>>16; */
- /* if (level < 0) level = 0; */
- /* max |= level; */
- /* level = level * sign; */
- /* block[i] = level; */
- /* } */
-
- __asm__ volatile
- ("i2=%1;\n\t"
- "r1=[%1++]; \n\t"
- "r0=r1>>>15 (v); \n\t"
- "lsetup (0f,1f) lc0=%3; \n\t"
- "0: r0=r0|%4; \n\t"
- " r1=abs r1 (v) || r2=[%2++];\n\t"
- " r1=r1+|+%5; \n\t"
- " r1=max(r1,%6) (v); \n\t"
- " r1.h=(a1 =r1.h*r2.h), r1.l=(a0 =r1.l*r2.l) (tfu); \n\t"
- " %0=%0|r1; \n\t"
- " r0.h=(a1 =r1.h*r0.h), r0.l=(a0 =r1.l*r0.l) (is) || r1=[%1++];\n\t"
- "1: r0=r1>>>15 (v) || [i2++]=r0;\n\t"
- "r1=%0>>16; \n\t"
- "%0=%0|r1; \n\t"
- "%0.h=0; \n\t"
- : "=&d" (max)
- : "b" (block), "b" (qmat), "a" (32), "d" (0x00010001), "d" (bias[0]*0x10001), "d" (0)
- : "R0","R1","R2", "I2");
- if (start_i == 1) block[0] = dc;
-
- EPROF();
-
-
- PROF("zzscan",5);
-
- __asm__ volatile
- ("r0=b[%1--] (x); \n\t"
- "lsetup (0f,1f) lc0=%3; \n\t" /* for(i=63; i>=start_i; i--) { */
- "0: p0=r0; \n\t" /* j = scantable[i]; */
- " p0=%2+(p0<<1); \n\t" /* if (block[j]) { */
- " r0=w[p0]; \n\t" /* last_non_zero = i; */
- " cc=r0==0; \n\t" /* break; */
- " if !cc jump 2f; \n\t" /* } */
- "1: r0=b[%1--] (x); \n\t" /* } */
- " %0=%4; \n\t"
- " jump 3f; \n\t"
- "2: %0=lc0; \n\t"
- "3:\n\t"
-
- : "=d" (last_non_zero)
- : "a" (scantable+63), "a" (block), "a" (63), "d" (last_non_zero)
- : "P0","R0");
-
- EPROF();
-
- *overflow= s->max_qcoeff < max; //overflow might have happened
-
- bfprof();
-
- /* we need this permutation so that we correct the IDCT, we only permute the !=0 elements */
- if (s->dsp.idct_permutation_type != FF_NO_IDCT_PERM)
- ff_block_permute(block, s->dsp.idct_permutation, scantable, last_non_zero);
-
- return last_non_zero;
-}
-
-av_cold void ff_MPV_common_init_bfin (MpegEncContext *s)
-{
-/* s->dct_quantize= dct_quantize_bfin; */
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/hpel_pixels_bfin.S b/chromium/third_party/ffmpeg/libavcodec/bfin/pixels.S
index c0cbf1f7f90..50a3bd3aba7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/hpel_pixels_bfin.S
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/pixels.S
@@ -18,7 +18,8 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config_bfin.h"
+
+#include "libavutil/bfin/asm.h"
/*
motion compensation
@@ -96,70 +97,6 @@ pp16$1: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
RTS;
DEFUN_END(put_pixels16uc)
-
-
-
-
-
-DEFUN(put_pixels8uc_nornd,mL1,
- (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
- int line_size, int h)):
- i3=r0; // dest
- i0=r1; // src0
- i1=r2; // src1
- r2=[sp+12]; // line_size
- p0=[sp+16]; // h
- [--sp] = (r7:6);
- r2+=-4;
- m3=r2;
- r2+=-4;
- m0=r2;
- LSETUP(pp8$2,pp8$3) LC0=P0;
- DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
-
-pp8$2: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
- R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++M0]|| R2 =[I1++M0];
- R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++] || [I3++] = R6 ;
-pp8$3: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
-
- (r7:6) = [sp++];
- RTS;
-DEFUN_END(put_pixels8uc_nornd)
-
-DEFUN(put_pixels16uc_nornd,mL1,
- (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
- int line_size, int h)):
- i3=r0; // dest
- i0=r1; // src0
- i1=r2; // src1
- r2=[sp+12]; // line_size
- p0=[sp+16]; // h
-
- [--sp] = (r7:6);
- r2+=-12;
- m3=r2; // line_size
- r2+=-4;
- m0=r2;
-
- LSETUP(pp16$2,pp16$3) LC0=P0;
- DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
-
-pp16$2:
- DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
- R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++] || R2 =[I1++];
- R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R1 = [I0++] || R3 =[I1++];
- [I3++] = R6;
-
- R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++M0] || R2 =[I1++M0];
- R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++] || [I3++] = R7 ;
- [I3++] = R6;
-pp16$3: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
-
- (r7:6) = [sp++];
-
- RTS;
-DEFUN_END(put_pixels16uc_nornd)
-
DEFUN(z_put_pixels16_xy2,mL1,
(uint8_t *block, const uint8_t *s0,
int dest_size, int line_size, int h)):
@@ -219,64 +156,6 @@ LE$16O: DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
rts;
DEFUN_END(z_put_pixels16_xy2)
-DEFUN(put_pixels16_xy2_nornd,mL1,
- (uint8_t *block, const uint8_t *s0,
- int line_size, int h)):
- link 0;
- [--sp] = (r7:4);
- i3=r0; // dest
- i0=r1; // src0--> pixels
- i1=r1; // src1--> pixels + line_size
- m3=r2;
- r2+=-12;
- m2=r2;
- r2+=-4;
- i1+=m3; /* src1 + line_size */
- m0=r2; /* line-size - 20 */
- p0=[fp+20]; // h
-
- B0=I0;
- B1=I1;
- B3=I3;
-
- DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
-
- LSETUP(LS$16ET,LE$16ET) LC0=P0;
-LS$16ET:DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
- R4 = BYTEOP2P (R3:2,R1:0) (TL) || R0 = [I0++] || R2 =[I1++];
- R5 = BYTEOP2P (R3:2,R1:0) (TL,R) || R1 = [I0++] || [I3++] = R4 ;
- DISALGNEXCPT || R3 = [I1++] || [I3++] = R5;
- R4 = BYTEOP2P (R3:2,R1:0) (TL) || R0 = [I0++M0]|| R2 = [I1++M0];
- R5 = BYTEOP2P (R3:2,R1:0) (TL,R) || R0 = [I0++] || [I3++] = R4 ;
-LE$16ET:DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
-
- M1 = 1;
- I3=B3;
- I1=B1;
- I0=B0;
-
- I0 += M1;
- I1 += M1;
-
- DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
- LSETUP(LS$16OT,LE$16OT) LC0=P0;
-LS$16OT:DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
- R4 = BYTEOP2P (R3:2,R1:0) (TH) || R0 = [I0++] || R2 =[I1++];
- R5 = BYTEOP2P (R3:2,R1:0) (TH,R) || R1 = [I0++] || R6 =[I3++];
- R4 = R4 +|+ R6 || R7 = [I3--];
- R5 = R5 +|+ R7 || [I3++] = R4;
- DISALGNEXCPT || R3 =[I1++] || [I3++] = R5;
- R4 = BYTEOP2P (R3:2,R1:0) (TH) || R0 = [I0++M0]|| R2 = [I1++M0];
- R5 = BYTEOP2P (R3:2,R1:0) (TH,R) || R0 = [I0++] || R6 = [I3++];
- R4 = R4 +|+ R6 || R7 = [I3--];
- R5 = R5 +|+ R7 || [I3++] = R4;
-LE$16OT:DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
-
- (r7:4) = [sp++];
- unlink;
- rts;
-DEFUN_END(put_pixels16_xy2_nornd)
-
DEFUN(z_put_pixels8_xy2,mL1,
(uint8_t *block, const uint8_t *s0,
int dest_size, int line_size, int h)):
@@ -326,54 +205,3 @@ LE$8O: DISALGNEXCPT || R2 =[I1++] || [I3++M2] = R5;
unlink;
rts;
DEFUN_END(z_put_pixels8_xy2)
-
-DEFUN(put_pixels8_xy2_nornd,mL1,
- (uint8_t *block, const uint8_t *s0, int line_size, int h)):
- link 0;
- [--sp] = (r7:4);
- i3=r0; // dest
- i0=r1; // src0--> pixels
- i1=r1; // src1--> pixels + line_size
- m3=r2;
- r2+=-4;
- m2=r2;
- r2+=-4;
- i1+=m3; /* src1 + line_size */
- m0=r2; /* line-size - 20 */
- p0=[fp+20]; // h
-
-
- b0 = I0;
- b1 = I1;
- b3 = I3;
-
- LSETUP(LS$8ET,LE$8ET) LC0=P0;
- DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
-
-LS$8ET: DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
- R4 = BYTEOP2P (R3:2,R1:0) (TL) || R0 = [I0++M0] || R2 = [I1++M0];
- R5 = BYTEOP2P (R3:2,R1:0) (TL,R) || R0 = [I0++] || [I3++] = R4 ;
-LE$8ET: DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
-
- M1 = 1;
- I3 = b3;
- I1 = b1;
- I0 = b0;
-
- I0 += M1;
- I1 += M1;
-
- LSETUP(LS$8OT,LE$8OT) LC0=P0;
- DISALGNEXCPT || R0 = [I0++] || R2 = [I1++];
-
-LS$8OT: DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
- R4 = BYTEOP2P (R3:2,R1:0) (TH) || R0 = [I0++M0] || R2 = [I1++M0];
- R5 = BYTEOP2P (R3:2,R1:0) (TH,R) || R0 = [I0++] || R6 = [I3++];
- R4 = R4 +|+ R6 || R7 = [I3--];
- R5 = R5 +|+ R7 || [I3++] = R4;
-LE$8OT: DISALGNEXCPT || R2 =[I1++] || [I3++M2] = R5;
-
- (r7:4) = [sp++];
- unlink;
- rts;
-DEFUN_END(put_pixels8_xy2_nornd)
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/pixels.h b/chromium/third_party/ffmpeg/libavcodec/bfin/pixels.h
new file mode 100644
index 00000000000..78a714e1a55
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/pixels.h
@@ -0,0 +1,42 @@
+/*
+ * BlackFin DSPUTILS COMMON OPTIMIZATIONS HEADER
+ *
+ * Copyright (C) 2007 Marc Hoffman <mmh@pleasantst.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
+ */
+
+#ifndef AVCODEC_BFIN_PIXELS_H
+#define AVCODEC_BFIN_PIXELS_H
+
+#include <stdint.h>
+
+#include "libavutil/bfin/attributes.h"
+
+void ff_bfin_z_put_pixels16_xy2(uint8_t *block, const uint8_t *s0,
+ int dest_size, int line_size, int h) attribute_l1_text;
+void ff_bfin_z_put_pixels8_xy2(uint8_t *block, const uint8_t *s0,
+ int dest_size, int line_size, int h) attribute_l1_text;
+
+void ff_bfin_put_pixels8uc(uint8_t *block, const uint8_t *s0,
+ const uint8_t *s1, int dest_size, int line_size,
+ int h) attribute_l1_text;
+void ff_bfin_put_pixels16uc(uint8_t *block, const uint8_t *s0,
+ const uint8_t *s1, int dest_size, int line_size,
+ int h) attribute_l1_text;
+
+#endif /* AVCODEC_BFIN_PIXELS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/vp3_idct_bfin.S b/chromium/third_party/ffmpeg/libavcodec/bfin/vp3dsp.S
index 4e200459f42..216926c104c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/vp3_idct_bfin.S
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/vp3dsp.S
@@ -28,14 +28,9 @@ Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0.
*/
-#include "config.h"
-#include "config_bfin.h"
+#include "libavutil/bfin/asm.h"
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.B,"aw",@progbits
-#else
-.data
-#endif
+SECTION_L1_DATA_B
.align 4;
coefs:
@@ -50,9 +45,7 @@ coefs:
.short 0x18F9; //cos(7pi/16)
.short 0x7D8A; //cos(pi/16)
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.A
-#endif
+SECTION_L1_DATA_A
vtmp: .space 256
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/vp3_bfin.c b/chromium/third_party/ffmpeg/libavcodec/bfin/vp3dsp_init.c
index 868c4314926..739750b6e48 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/vp3_bfin.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bfin/vp3dsp_init.c
@@ -18,19 +18,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <stdint.h>
#include <string.h>
#include "libavutil/attributes.h"
#include "libavcodec/avcodec.h"
+#include "libavcodec/mathops.h"
#include "libavcodec/vp3dsp.h"
-#include "libavcodec/dsputil.h"
-#include "dsputil_bfin.h"
-#include "vp3_bfin.h"
+
+void ff_bfin_vp3_idct(int16_t *block);
/* Intra iDCT offset 128 */
static void bfin_vp3_idct_put(uint8_t *dest, int line_size, int16_t *block)
{
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + 128;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP + 128;
int i,j;
ff_bfin_vp3_idct (block);
@@ -45,7 +46,7 @@ static void bfin_vp3_idct_put(uint8_t *dest, int line_size, int16_t *block)
/* Inter iDCT */
static void bfin_vp3_idct_add(uint8_t *dest, int line_size, int16_t *block)
{
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
int i, j;
ff_bfin_vp3_idct (block);
diff --git a/chromium/third_party/ffmpeg/libavcodec/bink.c b/chromium/third_party/ffmpeg/libavcodec/bink.c
index 8f8a036d4f7..f23542f17e7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bink.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bink.c
@@ -185,7 +185,7 @@ static av_cold int init_bundles(BinkContext *c)
blocks = bw * bh;
for (i = 0; i < BINKB_NB_SRC; i++) {
- c->bundle[i].data = av_malloc(blocks * 64);
+ c->bundle[i].data = av_mallocz(blocks * 64);
if (!c->bundle[i].data)
return AVERROR(ENOMEM);
c->bundle[i].data_end = c->bundle[i].data + blocks * 64;
diff --git a/chromium/third_party/ffmpeg/libavcodec/binkaudio.c b/chromium/third_party/ffmpeg/libavcodec/binkaudio.c
index 8db4533221c..ffa32d12aa9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/binkaudio.c
+++ b/chromium/third_party/ffmpeg/libavcodec/binkaudio.c
@@ -306,6 +306,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
buf = av_realloc(s->packet_buffer, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!buf)
return AVERROR(ENOMEM);
+ memset(buf + avpkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
s->packet_buffer = buf;
memcpy(s->packet_buffer, avpkt->data, avpkt->size);
if ((ret = init_get_bits8(gb, s->packet_buffer, avpkt->size)) < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/binkdsp.c b/chromium/third_party/ffmpeg/libavcodec/binkdsp.c
index a23f9c73bde..5b3c26229f5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/binkdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/binkdsp.c
@@ -25,7 +25,6 @@
*/
#include "libavutil/attributes.h"
-#include "dsputil.h"
#include "binkdsp.h"
#define A1 2896 /* (1/sqrt(2))<<12 */
diff --git a/chromium/third_party/ffmpeg/libavcodec/bit_depth_template.c b/chromium/third_party/ffmpeg/libavcodec/bit_depth_template.c
index 96f5edec0f7..80184892f5a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bit_depth_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bit_depth_template.c
@@ -16,6 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "mathops.h"
#include "rnd_avg.h"
#include "libavutil/intreadwrite.h"
@@ -23,7 +24,7 @@
#define BIT_DEPTH 8
#endif
-#ifdef AVCODEC_H264_HIGH_DEPTH_H
+#ifdef AVCODEC_BIT_DEPTH_TEMPLATE_C
# undef pixel
# undef pixel2
# undef pixel4
@@ -43,7 +44,7 @@
# undef av_clip_pixel
# undef PIXEL_SPLAT_X4
#else
-# define AVCODEC_H264_HIGH_DEPTH_H
+# define AVCODEC_BIT_DEPTH_TEMPLATE_C
#endif
#if BIT_DEPTH > 8
diff --git a/chromium/third_party/ffmpeg/libavcodec/bitstream.c b/chromium/third_party/ffmpeg/libavcodec/bitstream.c
index 1a346266ec9..5cb86317556 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bitstream.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bitstream.c
@@ -108,7 +108,6 @@ static int alloc_table(VLC *vlc, int size, int use_static)
vlc->table_size += size;
if (vlc->table_size > vlc->table_allocated) {
- int err;
if (use_static)
abort(); // cannot do anything, init_vlc() is used with too little memory
vlc->table_allocated += (1 << vlc->bits);
@@ -233,6 +232,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
/* note: realloc has been done, so reload tables */
table = &vlc->table[table_index];
table[j][0] = index; //code
+ av_assert0(table[j][0] == index);
i = k-1;
}
}
@@ -293,7 +293,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
vlc->table_allocated = 0;
vlc->table_size = 0;
- buf = av_malloc((nb_codes + 1) * sizeof(VLCcode));
+ buf = av_malloc_array((nb_codes + 1), sizeof(VLCcode));
if (!buf)
return AVERROR(ENOMEM);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/bmp.c b/chromium/third_party/ffmpeg/libavcodec/bmp.c
index 404c47dece7..47ff9786325 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bmp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bmp.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "bytestream.h"
#include "bmp.h"
@@ -58,7 +60,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
fsize = bytestream_get_le32(&buf);
if (buf_size < fsize) {
- av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d), trying to decode anyway\n",
+ av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %u), trying to decode anyway\n",
buf_size, fsize);
fsize = buf_size;
}
@@ -69,7 +71,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
hsize = bytestream_get_le32(&buf); /* header size */
ihsize = bytestream_get_le32(&buf); /* more header size */
if (ihsize + 14 > hsize) {
- av_log(avctx, AV_LOG_ERROR, "invalid header size %d\n", hsize);
+ av_log(avctx, AV_LOG_ERROR, "invalid header size %u\n", hsize);
return AVERROR_INVALIDDATA;
}
@@ -78,7 +80,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
fsize = buf_size - 2;
if (fsize <= hsize) {
- av_log(avctx, AV_LOG_ERROR, "declared file size is less than header size (%d < %d)\n",
+ av_log(avctx, AV_LOG_ERROR,
+ "Declared file size is less than header size (%u < %u)\n",
fsize, hsize);
return AVERROR_INVALIDDATA;
}
@@ -166,7 +169,9 @@ static int bmp_decode_frame(AVCodecContext *avctx,
else if (rgb[0] == 0x0F00 && rgb[1] == 0x00F0 && rgb[2] == 0x000F)
avctx->pix_fmt = AV_PIX_FMT_RGB444;
else {
- av_log(avctx, AV_LOG_ERROR, "Unknown bitfields %0X %0X %0X\n", rgb[0], rgb[1], rgb[2]);
+ av_log(avctx, AV_LOG_ERROR,
+ "Unknown bitfields %0"PRIX32" %0"PRIX32" %0"PRIX32"\n",
+ rgb[0], rgb[1], rgb[2]);
return AVERROR(EINVAL);
}
}
@@ -182,12 +187,13 @@ static int bmp_decode_frame(AVCodecContext *avctx,
if (hsize - ihsize - 14 > 0) {
avctx->pix_fmt = AV_PIX_FMT_PAL8;
} else {
- av_log(avctx, AV_LOG_ERROR, "Unknown palette for %d-colour BMP\n", 1<<depth);
+ av_log(avctx, AV_LOG_ERROR, "Unknown palette for %u-colour BMP\n",
+ 1 << depth);
return AVERROR_INVALIDDATA;
}
break;
default:
- av_log(avctx, AV_LOG_ERROR, "depth %d not supported\n", depth);
+ av_log(avctx, AV_LOG_ERROR, "depth %u not supported\n", depth);
return AVERROR_INVALIDDATA;
}
@@ -235,7 +241,9 @@ static int bmp_decode_frame(AVCodecContext *avctx,
buf = buf0 + 46;
t = bytestream_get_le32(&buf);
if (t < 0 || t > (1 << depth)) {
- av_log(avctx, AV_LOG_ERROR, "Incorrect number of colors - %X for bitdepth %d\n", t, depth);
+ av_log(avctx, AV_LOG_ERROR,
+ "Incorrect number of colors - %X for bitdepth %u\n",
+ t, depth);
} else if (t) {
colors = t;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/bmp_parser.c b/chromium/third_party/ffmpeg/libavcodec/bmp_parser.c
index 06ed367b38f..eae8ae0a7f1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bmp_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bmp_parser.c
@@ -25,6 +25,8 @@
*/
#include "libavutil/bswap.h"
+#include "libavutil/common.h"
+
#include "parser.h"
typedef struct BMPParseContext {
@@ -42,8 +44,6 @@ static int bmp_parse(AVCodecParserContext *s, AVCodecContext *avctx,
int next = END_NOT_FOUND;
int i = 0;
- s->pict_type = AV_PICTURE_TYPE_NONE;
-
*poutbuf_size = 0;
if (buf_size == 0)
return 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/brender_pix.c b/chromium/third_party/ffmpeg/libavcodec/brender_pix.c
deleted file mode 100644
index 23a46cc0edc..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/brender_pix.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * BRender PIX (.pix) image decoder
- * Copyright (c) 2012 Aleksi Nurmi
- *
- * 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
- */
-
-/*
- * Tested against samples from I-War / Independence War and Defiance.
- * If the PIX file does not contain a palette, the
- * palette_has_changed property of the AVFrame is set to 0.
- */
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-typedef struct BRPixHeader {
- int format;
- unsigned int width, height;
-} BRPixHeader;
-
-static int brpix_decode_header(BRPixHeader *out, GetByteContext *pgb)
-{
- unsigned int header_len = bytestream2_get_be32(pgb);
-
- out->format = bytestream2_get_byte(pgb);
- bytestream2_skip(pgb, 2);
- out->width = bytestream2_get_be16(pgb);
- out->height = bytestream2_get_be16(pgb);
-
- // the header is at least 11 bytes long; we read the first 7
- if (header_len < 11) {
- return 0;
- }
-
- // skip the rest of the header
- bytestream2_skip(pgb, header_len-7);
-
- return 1;
-}
-
-static int brpix_decode_frame(AVCodecContext *avctx,
- void *data, int *got_frame,
- AVPacket *avpkt)
-{
- AVFrame *frame = data;
-
- int ret;
- GetByteContext gb;
-
- unsigned int bytes_pp;
-
- unsigned int magic[4];
- unsigned int chunk_type;
- unsigned int data_len;
- BRPixHeader hdr;
-
- bytestream2_init(&gb, avpkt->data, avpkt->size);
-
- magic[0] = bytestream2_get_be32(&gb);
- magic[1] = bytestream2_get_be32(&gb);
- magic[2] = bytestream2_get_be32(&gb);
- magic[3] = bytestream2_get_be32(&gb);
-
- if (magic[0] != 0x12 ||
- magic[1] != 0x8 ||
- magic[2] != 0x2 ||
- magic[3] != 0x2) {
- av_log(avctx, AV_LOG_ERROR, "Not a BRender PIX file\n");
- return AVERROR_INVALIDDATA;
- }
-
- chunk_type = bytestream2_get_be32(&gb);
- if (chunk_type != 0x3 && chunk_type != 0x3d) {
- av_log(avctx, AV_LOG_ERROR, "Invalid chunk type %d\n", chunk_type);
- return AVERROR_INVALIDDATA;
- }
-
- ret = brpix_decode_header(&hdr, &gb);
- if (!ret) {
- av_log(avctx, AV_LOG_ERROR, "Invalid header length\n");
- return AVERROR_INVALIDDATA;
- }
- switch (hdr.format) {
- case 3:
- avctx->pix_fmt = AV_PIX_FMT_PAL8;
- bytes_pp = 1;
- break;
- case 4:
- avctx->pix_fmt = AV_PIX_FMT_RGB555BE;
- bytes_pp = 2;
- break;
- case 5:
- avctx->pix_fmt = AV_PIX_FMT_RGB565BE;
- bytes_pp = 2;
- break;
- case 6:
- avctx->pix_fmt = AV_PIX_FMT_RGB24;
- bytes_pp = 3;
- break;
- case 7:
- avctx->pix_fmt = AV_PIX_FMT_0RGB;
- bytes_pp = 4;
- break;
- case 18:
- avctx->pix_fmt = AV_PIX_FMT_GRAY8A;
- bytes_pp = 2;
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Format %d is not supported\n",
- hdr.format);
- return AVERROR_PATCHWELCOME;
- }
-
- if ((ret = ff_set_dimensions(avctx, hdr.width, hdr.height)) < 0)
- return ret;
-
- if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
- return ret;
-
- chunk_type = bytestream2_get_be32(&gb);
-
- if (avctx->pix_fmt == AV_PIX_FMT_PAL8 &&
- (chunk_type == 0x3 || chunk_type == 0x3d)) {
- BRPixHeader palhdr;
- uint32_t *pal_out = (uint32_t *)frame->data[1];
- int i;
-
- ret = brpix_decode_header(&palhdr, &gb);
- if (!ret) {
- av_log(avctx, AV_LOG_ERROR, "Invalid palette header length\n");
- return AVERROR_INVALIDDATA;
- }
- if (palhdr.format != 7) {
- av_log(avctx, AV_LOG_ERROR, "Palette is not in 0RGB format\n");
- return AVERROR_INVALIDDATA;
- }
-
- chunk_type = bytestream2_get_be32(&gb);
- data_len = bytestream2_get_be32(&gb);
- bytestream2_skip(&gb, 8);
- if (chunk_type != 0x21 || data_len != 1032 ||
- bytestream2_get_bytes_left(&gb) < 1032) {
- av_log(avctx, AV_LOG_ERROR, "Invalid palette data\n");
- return AVERROR_INVALIDDATA;
- }
- // convert 0RGB to machine endian format (ARGB32)
- for (i = 0; i < 256; ++i) {
- bytestream2_skipu(&gb, 1);
- *pal_out++ = (0xFFU << 24) | bytestream2_get_be24u(&gb);
- }
- bytestream2_skip(&gb, 8);
-
- frame->palette_has_changed = 1;
-
- chunk_type = bytestream2_get_be32(&gb);
- } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
- uint32_t *pal_out = (uint32_t *)frame->data[1];
- int i;
-
- for (i = 0; i < 256; ++i) {
- *pal_out++ = (0xFFU << 24) | (i * 0x010101);
- }
- frame->palette_has_changed = 1;
- }
-
- data_len = bytestream2_get_be32(&gb);
- bytestream2_skip(&gb, 8);
-
- // read the image data to the buffer
- {
- unsigned int bytes_per_scanline = bytes_pp * hdr.width;
- unsigned int bytes_left = bytestream2_get_bytes_left(&gb);
-
- if (chunk_type != 0x21 || data_len != bytes_left ||
- bytes_left / bytes_per_scanline < hdr.height)
- {
- av_log(avctx, AV_LOG_ERROR, "Invalid image data\n");
- return AVERROR_INVALIDDATA;
- }
-
- av_image_copy_plane(frame->data[0], frame->linesize[0],
- avpkt->data + bytestream2_tell(&gb),
- bytes_per_scanline,
- bytes_per_scanline, hdr.height);
- }
-
- *got_frame = 1;
-
- return avpkt->size;
-}
-
-AVCodec ff_brender_pix_decoder = {
- .name = "brender_pix",
- .long_name = NULL_IF_CONFIG_SMALL("BRender PIX image"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_BRENDER_PIX,
- .decode = brpix_decode_frame,
- .capabilities = CODEC_CAP_DR1,
-};
diff --git a/chromium/third_party/ffmpeg/libavcodec/brenderpix.c b/chromium/third_party/ffmpeg/libavcodec/brenderpix.c
new file mode 100644
index 00000000000..e0d033fcf91
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/brenderpix.c
@@ -0,0 +1,292 @@
+/*
+ * BRender PIX (.pix) image decoder
+ * Copyright (c) 2012 Aleksi Nurmi
+ *
+ * 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
+ */
+
+/* Tested against samples from I-War / Independence War and Defiance. */
+
+#include "libavutil/imgutils.h"
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "internal.h"
+
+#define HEADER1_CHUNK 0x03
+#define HEADER2_CHUNK 0x3D
+#define IMAGE_DATA_CHUNK 0x21
+
+/* In 8-bit colour mode, 256 colours are available at any time. Which 256
+ * colours are available is determined by the contents of the hardware palette
+ * (or CLUT). In this case, the palette supplied with BRender (std.pal) has
+ * been loaded into the CLUT.
+ *
+ * The 256 colours in std.pal are divided into seven ranges, or `colour ramps'.
+ * The first 64 colours represent shades of grey ranging from very dark grey
+ * (black) to very light grey (white). The following colours are 32-element
+ * ramps for six colours as shown below.
+ */
+static const uint32_t std_pal_table[256] = {
+ // gray
+ 0xFF000000, 0xFF030303, 0xFF060606, 0xFF090909, 0xFF0C0C0C, 0xFF0F0F0F,
+ 0xFF121212, 0xFF151515, 0xFF181818, 0xFF1B1B1B, 0xFF1E1E1E, 0xFF212121,
+ 0xFF242424, 0xFF272727, 0xFF2A2A2A, 0xFF2D2D2D, 0xFF313131, 0xFF343434,
+ 0xFF373737, 0xFF3A3A3A, 0xFF3D3D3D, 0xFF404040, 0xFF434343, 0xFF464646,
+ 0xFF494949, 0xFF4C4C4C, 0xFF4F4F4F, 0xFF525252, 0xFF555555, 0xFF585858,
+ 0xFF5B5B5B, 0xFF5E5E5E, 0xFF626262, 0xFF656565, 0xFF686868, 0xFF6B6B6B,
+ 0xFF6E6E6E, 0xFF717171, 0xFF747474, 0xFF777777, 0xFF7A7A7A, 0xFF7D7D7D,
+ 0xFF808080, 0xFF838383, 0xFF868686, 0xFF898989, 0xFF8C8C8C, 0xFF8F8F8F,
+ 0xFF939393, 0xFF999999, 0xFFA0A0A0, 0xFFA7A7A7, 0xFFAEAEAE, 0xFFB4B4B4,
+ 0xFFBBBBBB, 0xFFC2C2C2, 0xFFC9C9C9, 0xFFCFCFCF, 0xFFD6D6D6, 0xFFDDDDDD,
+ 0xFFE4E4E4, 0xFFEAEAEA, 0xFFF1F1F1, 0xFFF8F8F8,
+
+ // blue
+ 0xFF000000, 0xFF020209, 0xFF050513, 0xFF07071D, 0xFF0A0A27, 0xFF0C0C31,
+ 0xFF0F0F3B, 0xFF111145, 0xFF14144F, 0xFF161659, 0xFF181863, 0xFF1B1B6D,
+ 0xFF1E1E77, 0xFF202080, 0xFF22228A, 0xFF252594, 0xFF28289E, 0xFF2A2AA8,
+ 0xFF2D2DB2, 0xFF2F2FBC, 0xFF3131C6, 0xFF3434D0, 0xFF3737DA, 0xFF3939E4,
+ 0xFF3C3CEE, 0xFF5454F0, 0xFF6C6CF2, 0xFF8585F4, 0xFF9D9DF6, 0xFFB5B5F8,
+ 0xFFCECEFA, 0xFFE6E6FC,
+
+ // green
+ 0xFF000000, 0xFF020902, 0xFF051305, 0xFF071D07, 0xFF0A270A, 0xFF0C310C,
+ 0xFF0F3B0F, 0xFF114511, 0xFF144F14, 0xFF165916, 0xFF186318, 0xFF1B6D1B,
+ 0xFF1E771E, 0xFF208020, 0xFF228A22, 0xFF259425, 0xFF289E28, 0xFF2AA82A,
+ 0xFF2DB22D, 0xFF2FBC2F, 0xFF31C631, 0xFF34D034, 0xFF37DA37, 0xFF39E439,
+ 0xFF3CEE3C, 0xFF54F054, 0xFF6CF26C, 0xFF85F485, 0xFF9DF69D, 0xFFB5F8B5,
+ 0xFFCEFACE, 0xFFE6FCE6,
+
+ // cyan
+ 0xFF000000, 0xFF020909, 0xFF051313, 0xFF071D1D, 0xFF0A2727, 0xFF0C3131,
+ 0xFF0F3B3B, 0xFF114545, 0xFF144F4F, 0xFF165959, 0xFF186363, 0xFF1B6D6D,
+ 0xFF1E7777, 0xFF208080, 0xFF228A8A, 0xFF259494, 0xFF289E9E, 0xFF2AA8A8,
+ 0xFF2DB2B2, 0xFF2FBCBC, 0xFF31C6C6, 0xFF34D0D0, 0xFF37DADA, 0xFF39E4E4,
+ 0xFF3CEEEE, 0xFF54F0F0, 0xFF6CF2F2, 0xFF85F4F4, 0xFF9DF6F6, 0xFFB5F8F8,
+ 0xFFCEFAFA, 0xFFE6FCFC,
+
+ // red
+ 0xFF000000, 0xFF090202, 0xFF130505, 0xFF1D0707, 0xFF270A0A, 0xFF310C0C,
+ 0xFF3B0F0F, 0xFF451111, 0xFF4F1414, 0xFF591616, 0xFF631818, 0xFF6D1B1B,
+ 0xFF771E1E, 0xFF802020, 0xFF8A2222, 0xFF942525, 0xFF9E2828, 0xFFA82A2A,
+ 0xFFB22D2D, 0xFFBC2F2F, 0xFFC63131, 0xFFD03434, 0xFFDA3737, 0xFFE43939,
+ 0xFFEE3C3C, 0xFFF05454, 0xFFF26C6C, 0xFFF48585, 0xFFF69D9D, 0xFFF8B5B5,
+ 0xFFFACECE, 0xFFFCE6E6,
+
+ // magenta
+ 0xFF000000, 0xFF090209, 0xFF130513, 0xFF1D071D, 0xFF270A27, 0xFF310C31,
+ 0xFF3B0F3B, 0xFF451145, 0xFF4F144F, 0xFF591659, 0xFF631863, 0xFF6D1B6D,
+ 0xFF771E77, 0xFF802080, 0xFF8A228A, 0xFF942594, 0xFF9E289E, 0xFFA82AA8,
+ 0xFFB22DB2, 0xFFBC2FBC, 0xFFC631C6, 0xFFD034D0, 0xFFDA37DA, 0xFFE439E4,
+ 0xFFEE3CEE, 0xFFF054F0, 0xFFF26CF2, 0xFFF485F4, 0xFFF69DF6, 0xFFF8B5F8,
+ 0xFFFACEFA, 0xFFFCE6FC,
+
+ // yellow
+ 0xFF000000, 0xFF090902, 0xFF131305, 0xFF1D1D07, 0xFF27270A, 0xFF31310C,
+ 0xFF3B3B0F, 0xFF454511, 0xFF4F4F14, 0xFF595916, 0xFF636318, 0xFF6D6D1B,
+ 0xFF77771E, 0xFF808020, 0xFF8A8A22, 0xFF949425, 0xFF9E9E28, 0xFFA8A82A,
+ 0xFFB2B22D, 0xFFBCBC2F, 0xFFC6C631, 0xFFD0D034, 0xFFDADA37, 0xFFE4E439,
+ 0xFFEEEE3C, 0xFFF0F054, 0xFFF2F26C, 0xFFF4F485, 0xFFF6F69D, 0xFFF8F8B5,
+ 0xFFFAFACE, 0xFFFCFCE6,
+};
+
+typedef struct PixHeader {
+ int width;
+ int height;
+ int format;
+} PixHeader;
+
+static int pix_decode_header(PixHeader *out, GetByteContext *pgb)
+{
+ unsigned int header_len = bytestream2_get_be32(pgb);
+
+ out->format = bytestream2_get_byte(pgb);
+ bytestream2_skip(pgb, 2);
+ out->width = bytestream2_get_be16(pgb);
+ out->height = bytestream2_get_be16(pgb);
+
+ // the header is at least 11 bytes long; we read the first 7
+ if (header_len < 11)
+ return AVERROR_INVALIDDATA;
+
+ // skip the rest of the header
+ bytestream2_skip(pgb, header_len - 7);
+
+ return 0;
+}
+
+static int pix_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
+ AVPacket *avpkt)
+{
+ AVFrame *frame = data;
+
+ int ret, i;
+ GetByteContext gb;
+
+ unsigned int bytes_pp;
+ unsigned int magic[4];
+ unsigned int chunk_type;
+ unsigned int data_len;
+ unsigned int bytes_per_scanline;
+ unsigned int bytes_left;
+ PixHeader hdr;
+
+ bytestream2_init(&gb, avpkt->data, avpkt->size);
+
+ magic[0] = bytestream2_get_be32(&gb);
+ magic[1] = bytestream2_get_be32(&gb);
+ magic[2] = bytestream2_get_be32(&gb);
+ magic[3] = bytestream2_get_be32(&gb);
+
+ if (magic[0] != 0x12 ||
+ magic[1] != 0x08 ||
+ magic[2] != 0x02 ||
+ magic[3] != 0x02) {
+ av_log(avctx, AV_LOG_ERROR, "Not a BRender PIX file.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ chunk_type = bytestream2_get_be32(&gb);
+ if (chunk_type != HEADER1_CHUNK && chunk_type != HEADER2_CHUNK) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid chunk type %d.\n", chunk_type);
+ return AVERROR_INVALIDDATA;
+ }
+
+ ret = pix_decode_header(&hdr, &gb);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid header length.\n");
+ return ret;
+ }
+ switch (hdr.format) {
+ case 3:
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
+ bytes_pp = 1;
+ break;
+ case 4:
+ avctx->pix_fmt = AV_PIX_FMT_RGB555BE;
+ bytes_pp = 2;
+ break;
+ case 5:
+ avctx->pix_fmt = AV_PIX_FMT_RGB565BE;
+ bytes_pp = 2;
+ break;
+ case 6:
+ avctx->pix_fmt = AV_PIX_FMT_RGB24;
+ bytes_pp = 3;
+ break;
+ case 7:
+ avctx->pix_fmt = AV_PIX_FMT_0RGB;
+ bytes_pp = 4;
+ break;
+ case 8: // ARGB
+ avctx->pix_fmt = AV_PIX_FMT_ARGB;
+ bytes_pp = 4;
+ break;
+ case 18:
+ avctx->pix_fmt = AV_PIX_FMT_Y400A;
+ bytes_pp = 2;
+ break;
+ default:
+ avpriv_request_sample(avctx, "Format %d", hdr.format);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ if ((ret = ff_set_dimensions(avctx, hdr.width, hdr.height)) < 0)
+ return ret;
+
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+ return ret;
+
+ chunk_type = bytestream2_get_be32(&gb);
+
+ if (avctx->pix_fmt == AV_PIX_FMT_PAL8 &&
+ (chunk_type == HEADER1_CHUNK ||
+ chunk_type == HEADER2_CHUNK)) {
+ /* read palette data from data[1] */
+ PixHeader palhdr;
+ uint32_t *pal_out = (uint32_t *)frame->data[1];
+
+ ret = pix_decode_header(&palhdr, &gb);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid palette header length.\n");
+ return ret;
+ }
+ if (palhdr.format != 7)
+ avpriv_request_sample(avctx, "Palette not in RGB format");
+
+ chunk_type = bytestream2_get_be32(&gb);
+ data_len = bytestream2_get_be32(&gb);
+ bytestream2_skip(&gb, 8);
+ if (chunk_type != IMAGE_DATA_CHUNK || data_len != 1032 ||
+ bytestream2_get_bytes_left(&gb) < 1032) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid palette data.\n");
+ return AVERROR_INVALIDDATA;
+ }
+ // palette data is surrounded by 8 null bytes (both top and bottom)
+ // convert 0RGB to machine endian format (ARGB32)
+ for (i = 0; i < 256; ++i)
+ *pal_out++ = (0xFFU << 24) | bytestream2_get_be32u(&gb);
+ bytestream2_skip(&gb, 8);
+
+ frame->palette_has_changed = 1;
+
+ chunk_type = bytestream2_get_be32(&gb);
+ } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
+ /* no palette supplied, use the default one */
+ uint32_t *pal_out = (uint32_t *)frame->data[1];
+
+ // TODO: add an AVOption to load custom palette files
+ av_log(avctx, AV_LOG_WARNING,
+ "Using default palette, colors might be off.\n");
+ memcpy(pal_out, std_pal_table, sizeof(uint32_t) * 256);
+
+ frame->palette_has_changed = 1;
+ }
+
+ data_len = bytestream2_get_be32(&gb);
+ bytestream2_skip(&gb, 8);
+
+ // read the image data to the buffer
+ bytes_per_scanline = bytes_pp * hdr.width;
+ bytes_left = bytestream2_get_bytes_left(&gb);
+
+ if (chunk_type != IMAGE_DATA_CHUNK || data_len != bytes_left ||
+ bytes_left / bytes_per_scanline < hdr.height) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid image data.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ av_image_copy_plane(frame->data[0], frame->linesize[0],
+ avpkt->data + bytestream2_tell(&gb),
+ bytes_per_scanline,
+ bytes_per_scanline, hdr.height);
+
+ frame->pict_type = AV_PICTURE_TYPE_I;
+ frame->key_frame = 1;
+ *got_frame = 1;
+
+ return avpkt->size;
+}
+
+AVCodec ff_brender_pix_decoder = {
+ .name = "brender_pix",
+ .long_name = NULL_IF_CONFIG_SMALL("BRender PIX image"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_BRENDER_PIX,
+ .decode = pix_decode_frame,
+ .capabilities = CODEC_CAP_DR1,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/bytestream.h b/chromium/third_party/ffmpeg/libavcodec/bytestream.h
index f2458591cb7..c2cb6018061 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bytestream.h
+++ b/chromium/third_party/ffmpeg/libavcodec/bytestream.h
@@ -328,6 +328,32 @@ static av_always_inline unsigned int bytestream2_get_eof(PutByteContext *p)
return p->eof;
}
+static av_always_inline unsigned int bytestream2_copy_bufferu(PutByteContext *p,
+ GetByteContext *g,
+ unsigned int size)
+{
+ memcpy(p->buffer, g->buffer, size);
+ p->buffer += size;
+ g->buffer += size;
+ return size;
+}
+
+static av_always_inline unsigned int bytestream2_copy_buffer(PutByteContext *p,
+ GetByteContext *g,
+ unsigned int size)
+{
+ int size2;
+
+ if (p->eof)
+ return 0;
+ size = FFMIN(g->buffer_end - g->buffer, size);
+ size2 = FFMIN(p->buffer_end - p->buffer, size);
+ if (size2 != size)
+ p->eof = 1;
+
+ return bytestream2_copy_bufferu(p, g, size2);
+}
+
static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b,
uint8_t *dst,
unsigned int size)
diff --git a/chromium/third_party/ffmpeg/libavcodec/cabac.c b/chromium/third_party/ffmpeg/libavcodec/cabac.c
index dff0a91273d..65579d8d3ba 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cabac.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cabac.c
@@ -27,6 +27,7 @@
#include <string.h>
#include "libavutil/common.h"
+#include "libavutil/timer.h"
#include "get_bits.h"
#include "cabac.h"
#include "cabac_functions.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/cabac.h b/chromium/third_party/ffmpeg/libavcodec/cabac.h
index d4bafe08e06..eb6b521d3e7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cabac.h
+++ b/chromium/third_party/ffmpeg/libavcodec/cabac.h
@@ -31,6 +31,7 @@
#include "put_bits.h"
+extern uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63];
#define H264_NORM_SHIFT_OFFSET 0
#define H264_LPS_RANGE_OFFSET 512
#define H264_MLPS_STATE_OFFSET 1024
diff --git a/chromium/third_party/ffmpeg/libavcodec/cabac_functions.h b/chromium/third_party/ffmpeg/libavcodec/cabac_functions.h
index 7e22064d067..d7d6d7dfdbb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cabac_functions.h
+++ b/chromium/third_party/ffmpeg/libavcodec/cabac_functions.h
@@ -32,11 +32,16 @@
#include "cabac.h"
#include "config.h"
+#if ARCH_AARCH64
+# include "aarch64/cabac.h"
+#endif
+#if ARCH_ARM
+# include "arm/cabac.h"
+#endif
#if ARCH_X86
# include "x86/cabac.h"
#endif
-extern uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63];
static uint8_t * const ff_h264_norm_shift = ff_h264_cabac_tables + H264_NORM_SHIFT_OFFSET;
static uint8_t * const ff_h264_lps_range = ff_h264_cabac_tables + H264_LPS_RANGE_OFFSET;
static uint8_t * const ff_h264_mlps_state = ff_h264_cabac_tables + H264_MLPS_STATE_OFFSET;
diff --git a/chromium/third_party/ffmpeg/libavcodec/cavs.c b/chromium/third_party/ffmpeg/libavcodec/cavs.c
index cc544293d14..c5313eb19c1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cavs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cavs.c
@@ -275,7 +275,7 @@ static void intra_pred_plane(uint8_t *d, uint8_t *top, uint8_t *left, int stride
int x, y, ia;
int ih = 0;
int iv = 0;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
for (x = 0; x < 4; x++) {
ih += (x + 1) * (top[5 + x] - top[3 - x]);
diff --git a/chromium/third_party/ffmpeg/libavcodec/cavsdec.c b/chromium/third_party/ffmpeg/libavcodec/cavsdec.c
index 44d0ec0f9cc..93d1c59d5ac 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cavsdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cavsdec.c
@@ -948,8 +948,8 @@ static inline int check_for_slice(AVSContext *h)
static int decode_pic(AVSContext *h)
{
- int skip_count = -1;
int ret;
+ int skip_count = -1;
enum cavs_mb mb_type;
if (!h->top_qp) {
@@ -985,9 +985,9 @@ static int decode_pic(AVSContext *h)
skip_bits(&h->gb, 1); //marker_bit
}
- if ((ret = ff_get_buffer(h->avctx, h->cur.f,
- h->cur.f->pict_type == AV_PICTURE_TYPE_B ?
- 0 : AV_GET_BUFFER_FLAG_REF)) < 0)
+ ret = ff_get_buffer(h->avctx, h->cur.f, h->cur.f->pict_type == AV_PICTURE_TYPE_B ?
+ 0 : AV_GET_BUFFER_FLAG_REF);
+ if (ret < 0)
return ret;
if (!h->edge_emu_buffer) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/cavsdsp.c b/chromium/third_party/ffmpeg/libavcodec/cavsdsp.c
index 61283c23cee..a27915f57d1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cavsdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cavsdsp.c
@@ -23,7 +23,9 @@
*/
#include <stdio.h>
+
#include "dsputil.h"
+#include "mathops.h"
#include "cavsdsp.h"
#include "libavutil/common.h"
@@ -186,7 +188,7 @@ static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc
static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
int i;
int16_t (*src)[8] = (int16_t(*)[8])block;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
src[0][0] += 8;
@@ -261,7 +263,7 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
#define CAVS_SUBPIX(OPNAME, OP, NAME, A, B, C, D, E, F) \
static void OPNAME ## cavs_filt8_h_ ## NAME(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
const int h=8;\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i;\
for(i=0; i<h; i++)\
{\
@@ -280,7 +282,7 @@ static void OPNAME ## cavs_filt8_h_ ## NAME(uint8_t *dst, uint8_t *src, int dstS
\
static void OPNAME ## cavs_filt8_v_ ## NAME(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
const int w=8;\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i;\
for(i=0; i<w; i++)\
{\
@@ -334,7 +336,7 @@ static void OPNAME ## cavs_filt8_hv_ ## NAME(uint8_t *dst, uint8_t *src1, uint8_
int16_t *tmp = temp;\
const int h=8;\
const int w=8;\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i;\
src1 -= 2*srcStride;\
for(i=0; i<h+5; i++)\
diff --git a/chromium/third_party/ffmpeg/libavcodec/cinepakenc.c b/chromium/third_party/ffmpeg/libavcodec/cinepakenc.c
new file mode 100644
index 00000000000..727734519cc
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/cinepakenc.c
@@ -0,0 +1,1335 @@
+/*
+ * Cinepak encoder (c) 2011 Tomas Härdin
+ * http://titan.codemill.se/~tomhar/cinepakenc.patch
+ *
+ * Fixes and improvements, vintage decoders compatibility
+ * (c) 2013, 2014 Rl, Aetey Global Technologies AB
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+ * TODO:
+ * - optimize: color space conversion, ...
+ * - implement options to set the min/max number of strips?
+ * MAYBE:
+ * - "optimally" split the frame into several non-regular areas
+ * using a separate codebook pair for each area and approximating
+ * the area by several rectangular strips (generally not full width ones)
+ * (use quadtree splitting? a simple fixed-granularity grid?)
+ *
+ *
+ * version 2014-01-23 Rl
+ * - added option handling for flexibility
+ *
+ * version 2014-01-21 Rl
+ * - believe it or not, now we get even smaller files, with better quality
+ * (which means I missed an optimization earlier :)
+ *
+ * version 2014-01-20 Rl
+ * - made the encoder compatible with vintage decoders
+ * and added some yet unused code for possible future
+ * incremental codebook updates
+ * - fixed a small memory leak
+ *
+ * version 2013-04-28 Rl
+ * - bugfixed codebook optimization logic
+ *
+ * version 2013-02-14 Rl
+ * "Valentine's Day" version:
+ * - made strip division more robust
+ * - minimized bruteforcing the number of strips,
+ * (costs some R/D but speeds up compession a lot), the heuristic
+ * assumption is that score as a function of the number of strips has
+ * one wide minimum which moves slowly, of course not fully true
+ * - simplified codebook generation,
+ * the old code was meant for other optimizations than we actually do
+ * - optimized the codebook generation / error estimation for MODE_MC
+ *
+ * version 2013-02-12 Rl
+ * - separated codebook training sets, avoided the transfer of wasted bytes,
+ * which yields both better quality and smaller files
+ * - now using the correct colorspace (TODO: move conversion to libswscale)
+ *
+ * version 2013-02-08 Rl
+ * - fixes/optimization in multistrip encoding and codebook size choice,
+ * quality/bitrate is now better than that of the binary proprietary encoder
+ */
+
+#include "libavutil/intreadwrite.h"
+#include "avcodec.h"
+#include "libavutil/lfg.h"
+#include "elbg.h"
+#include "internal.h"
+
+#include "libavutil/avassert.h"
+#include "libavutil/opt.h"
+
+#define CVID_HEADER_SIZE 10
+#define STRIP_HEADER_SIZE 12
+#define CHUNK_HEADER_SIZE 4
+
+#define MB_SIZE 4 //4x4 MBs
+#define MB_AREA (MB_SIZE*MB_SIZE)
+
+#define VECTOR_MAX 6 //six or four entries per vector depending on format
+#define CODEBOOK_MAX 256 //size of a codebook
+
+#define MAX_STRIPS 32 //Note: having fewer choices regarding the number of strips speeds up encoding (obviously)
+#define MIN_STRIPS 1 //Note: having more strips speeds up encoding the frame (this is less obvious)
+// MAX_STRIPS limits the maximum quality you can reach
+// when you want hight quality on high resolutions,
+// MIN_STRIPS limits the minimum efficiently encodable bit rate
+// on low resolutions
+// the numbers are only used for brute force optimization for the first frame,
+// for the following frames they are adaptively readjusted
+// NOTE the decoder in ffmpeg has its own arbitrary limitation on the number
+// of strips, currently 32
+
+typedef enum {
+ MODE_V1_ONLY = 0,
+ MODE_V1_V4,
+ MODE_MC,
+
+ MODE_COUNT,
+} CinepakMode;
+
+typedef enum {
+ ENC_V1,
+ ENC_V4,
+ ENC_SKIP,
+
+ ENC_UNCERTAIN
+} mb_encoding;
+
+typedef struct {
+ int v1_vector; //index into v1 codebook
+ int v1_error; //error when using V1 encoding
+ int v4_vector[4]; //indices into v4 codebooks
+ int v4_error; //error when using V4 encoding
+ int skip_error; //error when block is skipped (aka copied from last frame)
+ mb_encoding best_encoding; //last result from calculate_mode_score()
+} mb_info;
+
+typedef struct {
+ int v1_codebook[CODEBOOK_MAX*VECTOR_MAX];
+ int v4_codebook[CODEBOOK_MAX*VECTOR_MAX];
+ int v1_size;
+ int v4_size;
+ CinepakMode mode;
+} strip_info;
+
+typedef struct {
+ const AVClass *class;
+ AVCodecContext *avctx;
+ unsigned char *pict_bufs[4], *strip_buf, *frame_buf;
+ AVFrame *last_frame;
+ AVFrame *best_frame;
+ AVFrame *scratch_frame;
+ AVFrame *input_frame;
+ enum AVPixelFormat pix_fmt;
+ int w, h;
+ int frame_buf_size;
+ int curframe, keyint;
+ AVLFG randctx;
+ uint64_t lambda;
+ int *codebook_input;
+ int *codebook_closest;
+ mb_info *mb; //MB RD state
+ int min_strips; //the current limit
+ int max_strips; //the current limit
+#ifdef CINEPAKENC_DEBUG
+ mb_info *best_mb; //TODO: remove. only used for printing stats
+ int num_v1_mode, num_v4_mode, num_mc_mode;
+ int num_v1_encs, num_v4_encs, num_skips;
+#endif
+// options
+ int max_extra_cb_iterations;
+ int skip_empty_cb;
+ int min_min_strips;
+ int max_max_strips;
+ int strip_number_delta_range;
+} CinepakEncContext;
+
+#define OFFSET(x) offsetof(CinepakEncContext, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "max_extra_cb_iterations", "Max extra codebook recalculation passes, more is better and slower", OFFSET(max_extra_cb_iterations), AV_OPT_TYPE_INT, { .i64 = 2 }, 0, INT_MAX, VE },
+ { "skip_empty_cb", "Avoid wasting bytes, ignore vintage MacOS decoder", OFFSET(skip_empty_cb), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+ { "max_strips", "Limit strips/frame, vintage compatible is 1..3, otherwise the more the better", OFFSET(max_max_strips), AV_OPT_TYPE_INT, { .i64 = 3 }, MIN_STRIPS, MAX_STRIPS, VE },
+ { "min_strips", "Enforce min strips/frame, more is worse and faster, must be <= max_strips", OFFSET(min_min_strips), AV_OPT_TYPE_INT, { .i64 = MIN_STRIPS }, MIN_STRIPS, MAX_STRIPS, VE },
+ { "strip_number_adaptivity", "How fast the strip number adapts, more is slightly better, much slower", OFFSET(strip_number_delta_range), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_STRIPS-MIN_STRIPS, VE },
+ { NULL },
+};
+
+static const AVClass cinepak_class = {
+ .class_name = "cinepak",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static av_cold int cinepak_encode_init(AVCodecContext *avctx)
+{
+ CinepakEncContext *s = avctx->priv_data;
+ int x, mb_count, strip_buf_size, frame_buf_size;
+
+ if (avctx->width & 3 || avctx->height & 3) {
+ av_log(avctx, AV_LOG_ERROR, "width and height must be multiples of four (got %ix%i)\n",
+ avctx->width, avctx->height);
+ return AVERROR(EINVAL);
+ }
+
+ if (s->min_min_strips > s->max_max_strips) {
+ av_log(avctx, AV_LOG_ERROR, "minimal number of strips can not exceed maximal (got %i and %i)\n",
+ s->min_min_strips, s->max_max_strips);
+ return AVERROR(EINVAL);
+ }
+
+ if (!(s->last_frame = av_frame_alloc()))
+ return AVERROR(ENOMEM);
+ if (!(s->best_frame = av_frame_alloc()))
+ goto enomem;
+ if (!(s->scratch_frame = av_frame_alloc()))
+ goto enomem;
+ if (avctx->pix_fmt == AV_PIX_FMT_RGB24)
+ if (!(s->input_frame = av_frame_alloc()))
+ goto enomem;
+
+ if (!(s->codebook_input = av_malloc(sizeof(int) * (avctx->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4) * (avctx->width * avctx->height) >> 2)))
+ goto enomem;
+
+ if (!(s->codebook_closest = av_malloc(sizeof(int) * (avctx->width * avctx->height) >> 2)))
+ goto enomem;
+
+ for(x = 0; x < (avctx->pix_fmt == AV_PIX_FMT_RGB24 ? 4 : 3); x++)
+ if(!(s->pict_bufs[x] = av_malloc((avctx->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4) * (avctx->width * avctx->height) >> 2)))
+ goto enomem;
+
+ mb_count = avctx->width * avctx->height / MB_AREA;
+
+ //the largest possible chunk is 0x31 with all MBs encoded in V4 mode
+ //and full codebooks being replaced in INTER mode,
+ // which is 34 bits per MB
+ //and 2*256 extra flag bits per strip
+ strip_buf_size = STRIP_HEADER_SIZE + 3 * CHUNK_HEADER_SIZE + 2 * VECTOR_MAX * CODEBOOK_MAX + 4 * (mb_count + (mb_count + 15) / 16) + (2 * CODEBOOK_MAX)/8;
+
+ frame_buf_size = CVID_HEADER_SIZE + s->max_max_strips * strip_buf_size;
+
+ if (!(s->strip_buf = av_malloc(strip_buf_size)))
+ goto enomem;
+
+ if (!(s->frame_buf = av_malloc(frame_buf_size)))
+ goto enomem;
+
+ if (!(s->mb = av_malloc_array(mb_count, sizeof(mb_info))))
+ goto enomem;
+
+#ifdef CINEPAKENC_DEBUG
+ if (!(s->best_mb = av_malloc_array(mb_count, sizeof(mb_info))))
+ goto enomem;
+#endif
+
+ av_lfg_init(&s->randctx, 1);
+ s->avctx = avctx;
+ s->w = avctx->width;
+ s->h = avctx->height;
+ s->frame_buf_size = frame_buf_size;
+ s->curframe = 0;
+ s->keyint = avctx->keyint_min;
+ s->pix_fmt = avctx->pix_fmt;
+
+ //set up AVFrames
+ s->last_frame->data[0] = s->pict_bufs[0];
+ s->last_frame->linesize[0] = s->w;
+ s->best_frame->data[0] = s->pict_bufs[1];
+ s->best_frame->linesize[0] = s->w;
+ s->scratch_frame->data[0] = s->pict_bufs[2];
+ s->scratch_frame->linesize[0] = s->w;
+
+ if (s->pix_fmt == AV_PIX_FMT_RGB24) {
+ s->last_frame->data[1] = s->last_frame->data[0] + s->w * s->h;
+ s->last_frame->data[2] = s->last_frame->data[1] + ((s->w * s->h) >> 2);
+ s->last_frame->linesize[1] = s->last_frame->linesize[2] = s->w >> 1;
+
+ s->best_frame->data[1] = s->best_frame->data[0] + s->w * s->h;
+ s->best_frame->data[2] = s->best_frame->data[1] + ((s->w * s->h) >> 2);
+ s->best_frame->linesize[1] = s->best_frame->linesize[2] = s->w >> 1;
+
+ s->scratch_frame->data[1] = s->scratch_frame->data[0] + s->w * s->h;
+ s->scratch_frame->data[2] = s->scratch_frame->data[1] + ((s->w * s->h) >> 2);
+ s->scratch_frame->linesize[1] = s->scratch_frame->linesize[2] = s->w >> 1;
+
+ s->input_frame->data[0] = s->pict_bufs[3];
+ s->input_frame->linesize[0] = s->w;
+ s->input_frame->data[1] = s->input_frame->data[0] + s->w * s->h;
+ s->input_frame->data[2] = s->input_frame->data[1] + ((s->w * s->h) >> 2);
+ s->input_frame->linesize[1] = s->input_frame->linesize[2] = s->w >> 1;
+ }
+
+ s->min_strips = s->min_min_strips;
+ s->max_strips = s->max_max_strips;
+
+#ifdef CINEPAKENC_DEBUG
+ s->num_v1_mode = s->num_v4_mode = s->num_mc_mode = s->num_v1_encs = s->num_v4_encs = s->num_skips = 0;
+#endif
+
+ return 0;
+
+enomem:
+ av_frame_free(&s->last_frame);
+ av_frame_free(&s->best_frame);
+ av_frame_free(&s->scratch_frame);
+ if (avctx->pix_fmt == AV_PIX_FMT_RGB24)
+ av_frame_free(&s->input_frame);
+ av_freep(&s->codebook_input);
+ av_freep(&s->codebook_closest);
+ av_freep(&s->strip_buf);
+ av_freep(&s->frame_buf);
+ av_freep(&s->mb);
+#ifdef CINEPAKENC_DEBUG
+ av_freep(&s->best_mb);
+#endif
+
+ for(x = 0; x < (avctx->pix_fmt == AV_PIX_FMT_RGB24 ? 4 : 3); x++)
+ av_freep(&s->pict_bufs[x]);
+
+ return AVERROR(ENOMEM);
+}
+
+static int64_t calculate_mode_score(CinepakEncContext *s, int h, strip_info *info, int report, int *training_set_v1_shrunk, int *training_set_v4_shrunk
+#ifdef CINEPAK_REPORT_SERR
+, int64_t *serr
+#endif
+)
+{
+ //score = FF_LAMBDA_SCALE * error + lambda * bits
+ int x;
+ int entry_size = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4;
+ int mb_count = s->w * h / MB_AREA;
+ mb_info *mb;
+ int64_t score1, score2, score3;
+ int64_t ret = s->lambda * ((info->v1_size ? CHUNK_HEADER_SIZE + info->v1_size * entry_size : 0) +
+ (info->v4_size ? CHUNK_HEADER_SIZE + info->v4_size * entry_size : 0) +
+ CHUNK_HEADER_SIZE) << 3;
+
+ //av_log(s->avctx, AV_LOG_INFO, "sizes %3i %3i -> %9lli score mb_count %i", info->v1_size, info->v4_size, (long long int)ret, mb_count);
+
+#ifdef CINEPAK_REPORT_SERR
+ *serr = 0;
+#endif
+
+ switch(info->mode) {
+ case MODE_V1_ONLY:
+ //one byte per MB
+ ret += s->lambda * 8 * mb_count;
+
+// while calculating we assume all blocks are ENC_V1
+ for(x = 0; x < mb_count; x++) {
+ mb = &s->mb[x];
+ ret += FF_LAMBDA_SCALE * mb->v1_error;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->v1_error;
+#endif
+// this function is never called for report in MODE_V1_ONLY
+// if(!report)
+ mb->best_encoding = ENC_V1;
+ }
+
+ break;
+ case MODE_V1_V4:
+ //9 or 33 bits per MB
+ if(report) {
+// no moves between the corresponding training sets are allowed
+ *training_set_v1_shrunk = *training_set_v4_shrunk = 0;
+ for(x = 0; x < mb_count; x++) {
+ int mberr;
+ mb = &s->mb[x];
+ if(mb->best_encoding == ENC_V1)
+ score1 = s->lambda * 9 + FF_LAMBDA_SCALE * (mberr=mb->v1_error);
+ else
+ score1 = s->lambda * 33 + FF_LAMBDA_SCALE * (mberr=mb->v4_error);
+ ret += score1;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mberr;
+#endif
+ }
+ } else { // find best mode per block
+ for(x = 0; x < mb_count; x++) {
+ mb = &s->mb[x];
+ score1 = s->lambda * 9 + FF_LAMBDA_SCALE * mb->v1_error;
+ score2 = s->lambda * 33 + FF_LAMBDA_SCALE * mb->v4_error;
+
+ if(score1 <= score2) {
+ ret += score1;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->v1_error;
+#endif
+ mb->best_encoding = ENC_V1;
+ } else {
+ ret += score2;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->v4_error;
+#endif
+ mb->best_encoding = ENC_V4;
+ }
+ }
+ }
+
+ break;
+ case MODE_MC:
+ //1, 10 or 34 bits per MB
+ if(report) {
+ int v1_shrunk = 0, v4_shrunk = 0;
+ for(x = 0; x < mb_count; x++) {
+ mb = &s->mb[x];
+// it is OK to move blocks to ENC_SKIP here
+// but not to any codebook encoding!
+ score1 = s->lambda * 1 + FF_LAMBDA_SCALE * mb->skip_error;
+ if(mb->best_encoding == ENC_SKIP) {
+ ret += score1;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->skip_error;
+#endif
+ } else if(mb->best_encoding == ENC_V1) {
+ if((score2=s->lambda * 10 + FF_LAMBDA_SCALE * mb->v1_error) >= score1) {
+ mb->best_encoding = ENC_SKIP;
+ ++v1_shrunk;
+ ret += score1;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->skip_error;
+#endif
+ } else {
+ ret += score2;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->v1_error;
+#endif
+ }
+ } else {
+ if((score3=s->lambda * 34 + FF_LAMBDA_SCALE * mb->v4_error) >= score1) {
+ mb->best_encoding = ENC_SKIP;
+ ++v4_shrunk;
+ ret += score1;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->skip_error;
+#endif
+ } else {
+ ret += score3;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->v4_error;
+#endif
+ }
+ }
+ }
+ *training_set_v1_shrunk = v1_shrunk;
+ *training_set_v4_shrunk = v4_shrunk;
+ } else { // find best mode per block
+ for(x = 0; x < mb_count; x++) {
+ mb = &s->mb[x];
+ score1 = s->lambda * 1 + FF_LAMBDA_SCALE * mb->skip_error;
+ score2 = s->lambda * 10 + FF_LAMBDA_SCALE * mb->v1_error;
+ score3 = s->lambda * 34 + FF_LAMBDA_SCALE * mb->v4_error;
+
+ if(score1 <= score2 && score1 <= score3) {
+ ret += score1;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->skip_error;
+#endif
+ mb->best_encoding = ENC_SKIP;
+ } else if(score2 <= score3) {
+ ret += score2;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->v1_error;
+#endif
+ mb->best_encoding = ENC_V1;
+ } else {
+ ret += score3;
+#ifdef CINEPAK_REPORT_SERR
+ *serr += mb->v4_error;
+#endif
+ mb->best_encoding = ENC_V4;
+ }
+ }
+ }
+
+ break;
+ }
+
+ return ret;
+}
+
+static int write_chunk_header(unsigned char *buf, int chunk_type, int chunk_size)
+{
+ buf[0] = chunk_type;
+ AV_WB24(&buf[1], chunk_size + CHUNK_HEADER_SIZE);
+ return CHUNK_HEADER_SIZE;
+}
+
+static int encode_codebook(CinepakEncContext *s, int *codebook, int size, int chunk_type_yuv, int chunk_type_gray, unsigned char *buf)
+{
+ int x, y, ret, entry_size = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4;
+ int incremental_codebook_replacement_mode = 0; // hardcoded here,
+ // the compiler should notice that this is a constant -- rl
+
+ ret = write_chunk_header(buf,
+ s->pix_fmt == AV_PIX_FMT_RGB24 ?
+ chunk_type_yuv+(incremental_codebook_replacement_mode?1:0) :
+ chunk_type_gray+(incremental_codebook_replacement_mode?1:0),
+ entry_size * size
+ + (incremental_codebook_replacement_mode?(size+31)/32*4:0) );
+
+// we do codebook encoding according to the "intra" mode
+// but we keep the "dead" code for reference in case we will want
+// to use incremental codebook updates (which actually would give us
+// "kind of" motion compensation, especially in 1 strip/frame case) -- rl
+// (of course, the code will be not useful as-is)
+ if(incremental_codebook_replacement_mode) {
+ int flags = 0;
+ int flagsind;
+ for(x = 0; x < size; x++) {
+ if(flags == 0) {
+ flagsind = ret;
+ ret += 4;
+ flags = 0x80000000;
+ } else
+ flags = ((flags>>1) | 0x80000000);
+ for(y = 0; y < entry_size; y++)
+ buf[ret++] = codebook[y + x*entry_size] ^ (y >= 4 ? 0x80 : 0);
+ if((flags&0xffffffff) == 0xffffffff) {
+ AV_WB32(&buf[flagsind], flags);
+ flags = 0;
+ }
+ }
+ if(flags)
+ AV_WB32(&buf[flagsind], flags);
+ } else
+ for(x = 0; x < size; x++)
+ for(y = 0; y < entry_size; y++)
+ buf[ret++] = codebook[y + x*entry_size] ^ (y >= 4 ? 0x80 : 0);
+
+ return ret;
+}
+
+//sets out to the sub picture starting at (x,y) in in
+static void get_sub_picture(CinepakEncContext *s, int x, int y, AVPicture *in, AVPicture *out)
+{
+ out->data[0] = in->data[0] + x + y * in->linesize[0];
+ out->linesize[0] = in->linesize[0];
+
+ if(s->pix_fmt == AV_PIX_FMT_RGB24) {
+ out->data[1] = in->data[1] + (x >> 1) + (y >> 1) * in->linesize[1];
+ out->linesize[1] = in->linesize[1];
+
+ out->data[2] = in->data[2] + (x >> 1) + (y >> 1) * in->linesize[2];
+ out->linesize[2] = in->linesize[2];
+ }
+}
+
+//decodes the V1 vector in mb into the 4x4 MB pointed to by sub_pict
+static void decode_v1_vector(CinepakEncContext *s, AVPicture *sub_pict, int v1_vector, strip_info *info)
+{
+ int entry_size = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4;
+
+ sub_pict->data[0][0] =
+ sub_pict->data[0][1] =
+ sub_pict->data[0][ sub_pict->linesize[0]] =
+ sub_pict->data[0][1+ sub_pict->linesize[0]] = info->v1_codebook[v1_vector*entry_size];
+
+ sub_pict->data[0][2] =
+ sub_pict->data[0][3] =
+ sub_pict->data[0][2+ sub_pict->linesize[0]] =
+ sub_pict->data[0][3+ sub_pict->linesize[0]] = info->v1_codebook[v1_vector*entry_size+1];
+
+ sub_pict->data[0][2*sub_pict->linesize[0]] =
+ sub_pict->data[0][1+2*sub_pict->linesize[0]] =
+ sub_pict->data[0][ 3*sub_pict->linesize[0]] =
+ sub_pict->data[0][1+3*sub_pict->linesize[0]] = info->v1_codebook[v1_vector*entry_size+2];
+
+ sub_pict->data[0][2+2*sub_pict->linesize[0]] =
+ sub_pict->data[0][3+2*sub_pict->linesize[0]] =
+ sub_pict->data[0][2+3*sub_pict->linesize[0]] =
+ sub_pict->data[0][3+3*sub_pict->linesize[0]] = info->v1_codebook[v1_vector*entry_size+3];
+
+ if(s->pix_fmt == AV_PIX_FMT_RGB24) {
+ sub_pict->data[1][0] =
+ sub_pict->data[1][1] =
+ sub_pict->data[1][ sub_pict->linesize[1]] =
+ sub_pict->data[1][1+ sub_pict->linesize[1]] = info->v1_codebook[v1_vector*entry_size+4];
+
+ sub_pict->data[2][0] =
+ sub_pict->data[2][1] =
+ sub_pict->data[2][ sub_pict->linesize[2]] =
+ sub_pict->data[2][1+ sub_pict->linesize[2]] = info->v1_codebook[v1_vector*entry_size+5];
+ }
+}
+
+//decodes the V4 vectors in mb into the 4x4 MB pointed to by sub_pict
+static void decode_v4_vector(CinepakEncContext *s, AVPicture *sub_pict, int *v4_vector, strip_info *info)
+{
+ int i, x, y, entry_size = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4;
+
+ for(i = y = 0; y < 4; y += 2) {
+ for(x = 0; x < 4; x += 2, i++) {
+ sub_pict->data[0][x + y*sub_pict->linesize[0]] = info->v4_codebook[v4_vector[i]*entry_size];
+ sub_pict->data[0][x+1 + y*sub_pict->linesize[0]] = info->v4_codebook[v4_vector[i]*entry_size+1];
+ sub_pict->data[0][x + (y+1)*sub_pict->linesize[0]] = info->v4_codebook[v4_vector[i]*entry_size+2];
+ sub_pict->data[0][x+1 + (y+1)*sub_pict->linesize[0]] = info->v4_codebook[v4_vector[i]*entry_size+3];
+
+ if(s->pix_fmt == AV_PIX_FMT_RGB24) {
+ sub_pict->data[1][(x>>1) + (y>>1)*sub_pict->linesize[1]] = info->v4_codebook[v4_vector[i]*entry_size+4];
+ sub_pict->data[2][(x>>1) + (y>>1)*sub_pict->linesize[2]] = info->v4_codebook[v4_vector[i]*entry_size+5];
+ }
+ }
+ }
+}
+
+static void copy_mb(CinepakEncContext *s, AVPicture *a, AVPicture *b)
+{
+ int y, p;
+
+ for(y = 0; y < MB_SIZE; y++) {
+ memcpy(a->data[0]+y*a->linesize[0], b->data[0]+y*b->linesize[0],
+ MB_SIZE);
+ }
+
+ if(s->pix_fmt == AV_PIX_FMT_RGB24) {
+ for(p = 1; p <= 2; p++) {
+ for(y = 0; y < MB_SIZE/2; y++) {
+ memcpy(a->data[p] + y*a->linesize[p],
+ b->data[p] + y*b->linesize[p],
+ MB_SIZE/2);
+ }
+ }
+ }
+}
+
+static int encode_mode(CinepakEncContext *s, int h, AVPicture *scratch_pict, AVPicture *last_pict, strip_info *info, unsigned char *buf)
+{
+ int x, y, z, flags, bits, temp_size, header_ofs, ret = 0, mb_count = s->w * h / MB_AREA;
+ int needs_extra_bit, should_write_temp;
+ unsigned char temp[64]; //32/2 = 16 V4 blocks at 4 B each -> 64 B
+ mb_info *mb;
+ AVPicture sub_scratch = {{0}}, sub_last = {{0}};
+
+ //encode codebooks
+////// MacOS vintage decoder compatibility dictates the presence of
+////// the codebook chunk even when the codebook is empty - pretty dumb...
+////// and also the certain order of the codebook chunks -- rl
+ if(info->v4_size || !s->skip_empty_cb)
+ ret += encode_codebook(s, info->v4_codebook, info->v4_size, 0x20, 0x24, buf + ret);
+
+ if(info->v1_size || !s->skip_empty_cb)
+ ret += encode_codebook(s, info->v1_codebook, info->v1_size, 0x22, 0x26, buf + ret);
+
+ //update scratch picture
+ for(z = y = 0; y < h; y += MB_SIZE) {
+ for(x = 0; x < s->w; x += MB_SIZE, z++) {
+ mb = &s->mb[z];
+
+ get_sub_picture(s, x, y, scratch_pict, &sub_scratch);
+
+ if(info->mode == MODE_MC && mb->best_encoding == ENC_SKIP) {
+ get_sub_picture(s, x, y, last_pict, &sub_last);
+ copy_mb(s, &sub_scratch, &sub_last);
+ } else if(info->mode == MODE_V1_ONLY || mb->best_encoding == ENC_V1)
+ decode_v1_vector(s, &sub_scratch, mb->v1_vector, info);
+ else
+ decode_v4_vector(s, &sub_scratch, mb->v4_vector, info);
+ }
+ }
+
+ switch(info->mode) {
+ case MODE_V1_ONLY:
+ //av_log(s->avctx, AV_LOG_INFO, "mb_count = %i\n", mb_count);
+ ret += write_chunk_header(buf + ret, 0x32, mb_count);
+
+ for(x = 0; x < mb_count; x++)
+ buf[ret++] = s->mb[x].v1_vector;
+
+ break;
+ case MODE_V1_V4:
+ //remember header position
+ header_ofs = ret;
+ ret += CHUNK_HEADER_SIZE;
+
+ for(x = 0; x < mb_count; x += 32) {
+ flags = 0;
+ for(y = x; y < FFMIN(x+32, mb_count); y++)
+ if(s->mb[y].best_encoding == ENC_V4)
+ flags |= 1 << (31 - y + x);
+
+ AV_WB32(&buf[ret], flags);
+ ret += 4;
+
+ for(y = x; y < FFMIN(x+32, mb_count); y++) {
+ mb = &s->mb[y];
+
+ if(mb->best_encoding == ENC_V1)
+ buf[ret++] = mb->v1_vector;
+ else
+ for(z = 0; z < 4; z++)
+ buf[ret++] = mb->v4_vector[z];
+ }
+ }
+
+ write_chunk_header(buf + header_ofs, 0x30, ret - header_ofs - CHUNK_HEADER_SIZE);
+
+ break;
+ case MODE_MC:
+ //remember header position
+ header_ofs = ret;
+ ret += CHUNK_HEADER_SIZE;
+ flags = bits = temp_size = 0;
+
+ for(x = 0; x < mb_count; x++) {
+ mb = &s->mb[x];
+ flags |= (mb->best_encoding != ENC_SKIP) << (31 - bits++);
+ needs_extra_bit = 0;
+ should_write_temp = 0;
+
+ if(mb->best_encoding != ENC_SKIP) {
+ if(bits < 32)
+ flags |= (mb->best_encoding == ENC_V4) << (31 - bits++);
+ else
+ needs_extra_bit = 1;
+ }
+
+ if(bits == 32) {
+ AV_WB32(&buf[ret], flags);
+ ret += 4;
+ flags = bits = 0;
+
+ if(mb->best_encoding == ENC_SKIP || needs_extra_bit) {
+ memcpy(&buf[ret], temp, temp_size);
+ ret += temp_size;
+ temp_size = 0;
+ } else
+ should_write_temp = 1;
+ }
+
+ if(needs_extra_bit) {
+ flags = (mb->best_encoding == ENC_V4) << 31;
+ bits = 1;
+ }
+
+ if(mb->best_encoding == ENC_V1)
+ temp[temp_size++] = mb->v1_vector;
+ else if(mb->best_encoding == ENC_V4)
+ for(z = 0; z < 4; z++)
+ temp[temp_size++] = mb->v4_vector[z];
+
+ if(should_write_temp) {
+ memcpy(&buf[ret], temp, temp_size);
+ ret += temp_size;
+ temp_size = 0;
+ }
+ }
+
+ if(bits > 0) {
+ AV_WB32(&buf[ret], flags);
+ ret += 4;
+ memcpy(&buf[ret], temp, temp_size);
+ ret += temp_size;
+ }
+
+ write_chunk_header(buf + header_ofs, 0x31, ret - header_ofs - CHUNK_HEADER_SIZE);
+
+ break;
+ }
+
+ return ret;
+}
+
+//computes distortion of 4x4 MB in b compared to a
+static int compute_mb_distortion(CinepakEncContext *s, AVPicture *a, AVPicture *b)
+{
+ int x, y, p, d, ret = 0;
+
+ for(y = 0; y < MB_SIZE; y++) {
+ for(x = 0; x < MB_SIZE; x++) {
+ d = a->data[0][x + y*a->linesize[0]] - b->data[0][x + y*b->linesize[0]];
+ ret += d*d;
+ }
+ }
+
+ if(s->pix_fmt == AV_PIX_FMT_RGB24) {
+ for(p = 1; p <= 2; p++) {
+ for(y = 0; y < MB_SIZE/2; y++) {
+ for(x = 0; x < MB_SIZE/2; x++) {
+ d = a->data[p][x + y*a->linesize[p]] - b->data[p][x + y*b->linesize[p]];
+ ret += d*d;
+ }
+ }
+ }
+ }
+
+ return ret;
+}
+
+// return the possibly adjusted size of the codebook
+#define CERTAIN(x) ((x)!=ENC_UNCERTAIN)
+static int quantize(CinepakEncContext *s, int h, AVPicture *pict,
+ int v1mode, strip_info *info,
+ mb_encoding encoding)
+{
+ int x, y, i, j, k, x2, y2, x3, y3, plane, shift, mbn;
+ int entry_size = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4;
+ int *codebook = v1mode ? info->v1_codebook : info->v4_codebook;
+ int size = v1mode ? info->v1_size : info->v4_size;
+ int64_t total_error = 0;
+ uint8_t vq_pict_buf[(MB_AREA*3)/2];
+ AVPicture sub_pict, vq_pict;
+
+ for(mbn = i = y = 0; y < h; y += MB_SIZE) {
+ for(x = 0; x < s->w; x += MB_SIZE, ++mbn) {
+ int *base;
+
+ if(CERTAIN(encoding)) {
+// use for the training only the blocks known to be to be encoded [sic:-]
+ if(s->mb[mbn].best_encoding != encoding) continue;
+ }
+
+ base = s->codebook_input + i*entry_size;
+ if(v1mode) {
+ //subsample
+ for(j = y2 = 0; y2 < entry_size; y2 += 2) {
+ for(x2 = 0; x2 < 4; x2 += 2, j++) {
+ plane = y2 < 4 ? 0 : 1 + (x2 >> 1);
+ shift = y2 < 4 ? 0 : 1;
+ x3 = shift ? 0 : x2;
+ y3 = shift ? 0 : y2;
+ base[j] = (pict->data[plane][((x+x3) >> shift) + ((y+y3) >> shift) * pict->linesize[plane]] +
+ pict->data[plane][((x+x3) >> shift) + 1 + ((y+y3) >> shift) * pict->linesize[plane]] +
+ pict->data[plane][((x+x3) >> shift) + (((y+y3) >> shift) + 1) * pict->linesize[plane]] +
+ pict->data[plane][((x+x3) >> shift) + 1 + (((y+y3) >> shift) + 1) * pict->linesize[plane]]) >> 2;
+ }
+ }
+ } else {
+ //copy
+ for(j = y2 = 0; y2 < MB_SIZE; y2 += 2) {
+ for(x2 = 0; x2 < MB_SIZE; x2 += 2) {
+ for(k = 0; k < entry_size; k++, j++) {
+ plane = k >= 4 ? k - 3 : 0;
+
+ if(k >= 4) {
+ x3 = (x+x2) >> 1;
+ y3 = (y+y2) >> 1;
+ } else {
+ x3 = x + x2 + (k & 1);
+ y3 = y + y2 + (k >> 1);
+ }
+
+ base[j] = pict->data[plane][x3 + y3*pict->linesize[plane]];
+ }
+ }
+ }
+ }
+ i += v1mode ? 1 : 4;
+ }
+ }
+// if(i < mbn*(v1mode ? 1 : 4)) {
+// av_log(s->avctx, AV_LOG_INFO, "reducing training set for %s from %i to %i (encoding %i)\n", v1mode?"v1":"v4", mbn*(v1mode ? 1 : 4), i, encoding);
+// }
+
+ if(i == 0) // empty training set, nothing to do
+ return 0;
+ if(i < size) {
+ //av_log(s->avctx, (CERTAIN(encoding) ? AV_LOG_ERROR : AV_LOG_INFO), "WOULD WASTE: %s cbsize %i bigger than training set size %i (encoding %i)\n", v1mode?"v1":"v4", size, i, encoding);
+ size = i;
+ }
+
+ avpriv_init_elbg(s->codebook_input, entry_size, i, codebook, size, 1, s->codebook_closest, &s->randctx);
+ avpriv_do_elbg(s->codebook_input, entry_size, i, codebook, size, 1, s->codebook_closest, &s->randctx);
+
+ //setup vq_pict, which contains a single MB
+ vq_pict.data[0] = vq_pict_buf;
+ vq_pict.linesize[0] = MB_SIZE;
+ vq_pict.data[1] = &vq_pict_buf[MB_AREA];
+ vq_pict.data[2] = vq_pict.data[1] + (MB_AREA >> 2);
+ vq_pict.linesize[1] = vq_pict.linesize[2] = MB_SIZE >> 1;
+
+ //copy indices
+ for(i = j = y = 0; y < h; y += MB_SIZE) {
+ for(x = 0; x < s->w; x += MB_SIZE, j++) {
+ mb_info *mb = &s->mb[j];
+// skip uninteresting blocks if we know their preferred encoding
+ if(CERTAIN(encoding) && mb->best_encoding != encoding)
+ continue;
+
+ //point sub_pict to current MB
+ get_sub_picture(s, x, y, pict, &sub_pict);
+
+ if(v1mode) {
+ mb->v1_vector = s->codebook_closest[i];
+
+ //fill in vq_pict with V1 data
+ decode_v1_vector(s, &vq_pict, mb->v1_vector, info);
+
+ mb->v1_error = compute_mb_distortion(s, &sub_pict, &vq_pict);
+ total_error += mb->v1_error;
+ } else {
+ for(k = 0; k < 4; k++)
+ mb->v4_vector[k] = s->codebook_closest[i+k];
+
+ //fill in vq_pict with V4 data
+ decode_v4_vector(s, &vq_pict, mb->v4_vector, info);
+
+ mb->v4_error = compute_mb_distortion(s, &sub_pict, &vq_pict);
+ total_error += mb->v4_error;
+ }
+ i += v1mode ? 1 : 4;
+ }
+ }
+// check that we did it right in the beginning of the function
+ av_assert0(i >= size); // training set is no smaller than the codebook
+
+ //av_log(s->avctx, AV_LOG_INFO, "isv1 %i size= %i i= %i error %lli\n", v1mode, size, i, (long long int)total_error);
+
+ return size;
+}
+
+static void calculate_skip_errors(CinepakEncContext *s, int h, AVPicture *last_pict, AVPicture *pict, strip_info *info)
+{
+ int x, y, i;
+ AVPicture sub_last, sub_pict;
+
+ for(i = y = 0; y < h; y += MB_SIZE) {
+ for(x = 0; x < s->w; x += MB_SIZE, i++) {
+ get_sub_picture(s, x, y, last_pict, &sub_last);
+ get_sub_picture(s, x, y, pict, &sub_pict);
+
+ s->mb[i].skip_error = compute_mb_distortion(s, &sub_last, &sub_pict);
+ }
+ }
+}
+
+static void write_strip_header(CinepakEncContext *s, int y, int h, int keyframe, unsigned char *buf, int strip_size)
+{
+// actually we are exclusively using intra strip coding (how much can we win
+// otherwise? how to choose which part of a codebook to update?),
+// keyframes are different only because we disallow ENC_SKIP on them -- rl
+// (besides, the logic here used to be inverted: )
+// buf[0] = keyframe ? 0x11: 0x10;
+ buf[0] = keyframe ? 0x10: 0x11;
+ AV_WB24(&buf[1], strip_size + STRIP_HEADER_SIZE);
+// AV_WB16(&buf[4], y); /* using absolute y values works -- rl */
+ AV_WB16(&buf[4], 0); /* using relative values works as well -- rl */
+ AV_WB16(&buf[6], 0);
+// AV_WB16(&buf[8], y+h); /* using absolute y values works -- rl */
+ AV_WB16(&buf[8], h); /* using relative values works as well -- rl */
+ AV_WB16(&buf[10], s->w);
+ //av_log(s->avctx, AV_LOG_INFO, "write_strip_header() %x keyframe=%d\n", buf[0], keyframe);
+}
+
+static int rd_strip(CinepakEncContext *s, int y, int h, int keyframe, AVPicture *last_pict, AVPicture *pict, AVPicture *scratch_pict, unsigned char *buf, int64_t *best_score
+#ifdef CINEPAK_REPORT_SERR
+, int64_t *best_serr
+#endif
+)
+{
+ int64_t score = 0;
+#ifdef CINEPAK_REPORT_SERR
+ int64_t serr;
+#endif
+ int best_size = 0;
+ strip_info info;
+// for codebook optimization:
+ int v1enough, v1_size, v4enough, v4_size;
+ int new_v1_size, new_v4_size;
+ int v1shrunk, v4shrunk;
+
+ if(!keyframe)
+ calculate_skip_errors(s, h, last_pict, pict, &info);
+
+ //try some powers of 4 for the size of the codebooks
+ //constraint the v4 codebook to be no bigger than v1 one,
+ //(and no less than v1_size/4)
+ //thus making v1 preferable and possibly losing small details? should be ok
+#define SMALLEST_CODEBOOK 1
+ for(v1enough = 0, v1_size = SMALLEST_CODEBOOK; v1_size <= CODEBOOK_MAX && !v1enough; v1_size <<= 2) {
+ for(v4enough = 0, v4_size = 0; v4_size <= v1_size && !v4enough; v4_size = v4_size ? v4_size << 2 : v1_size >= SMALLEST_CODEBOOK << 2 ? v1_size >> 2 : SMALLEST_CODEBOOK) {
+ //try all modes
+ for(CinepakMode mode = 0; mode < MODE_COUNT; mode++) {
+ //don't allow MODE_MC in intra frames
+ if(keyframe && mode == MODE_MC)
+ continue;
+
+ if(mode == MODE_V1_ONLY) {
+ info.v1_size = v1_size;
+// the size may shrink even before optimizations if the input is short:
+ info.v1_size = quantize(s, h, pict, 1, &info, ENC_UNCERTAIN);
+ if(info.v1_size < v1_size)
+// too few eligible blocks, no sense in trying bigger sizes
+ v1enough = 1;
+
+ info.v4_size = 0;
+ } else { // mode != MODE_V1_ONLY
+ // if v4 codebook is empty then only allow V1-only mode
+ if(!v4_size)
+ continue;
+
+ if(mode == MODE_V1_V4) {
+ info.v4_size = v4_size;
+ info.v4_size = quantize(s, h, pict, 0, &info, ENC_UNCERTAIN);
+ if(info.v4_size < v4_size)
+// too few eligible blocks, no sense in trying bigger sizes
+ v4enough = 1;
+ }
+ }
+
+ info.mode = mode;
+// choose the best encoding per block, based on current experience
+ score = calculate_mode_score(s, h, &info, 0,
+ &v1shrunk, &v4shrunk
+#ifdef CINEPAK_REPORT_SERR
+, &serr
+#endif
+);
+
+ if(mode != MODE_V1_ONLY){
+ int extra_iterations_limit = s->max_extra_cb_iterations;
+// recompute the codebooks, omitting the extra blocks
+// we assume we _may_ come here with more blocks to encode than before
+ info.v1_size = v1_size;
+ new_v1_size = quantize(s, h, pict, 1, &info, ENC_V1);
+ if(new_v1_size < info.v1_size){
+ //av_log(s->avctx, AV_LOG_INFO, "mode %i, %3i, %3i: cut v1 codebook to %i entries\n", mode, v1_size, v4_size, new_v1_size);
+ info.v1_size = new_v1_size;
+ }
+// we assume we _may_ come here with more blocks to encode than before
+ info.v4_size = v4_size;
+ new_v4_size = quantize(s, h, pict, 0, &info, ENC_V4);
+ if(new_v4_size < info.v4_size) {
+ //av_log(s->avctx, AV_LOG_INFO, "mode %i, %3i, %3i: cut v4 codebook to %i entries at first iteration\n", mode, v1_size, v4_size, new_v4_size);
+ info.v4_size = new_v4_size;
+ }
+// calculate the resulting score
+// (do not move blocks to codebook encodings now, as some blocks may have
+// got bigger errors despite a smaller training set - but we do not
+// ever grow the training sets back)
+ for(;;) {
+ score = calculate_mode_score(s, h, &info, 1,
+ &v1shrunk, &v4shrunk
+#ifdef CINEPAK_REPORT_SERR
+, &serr
+#endif
+);
+// do we have a reason to reiterate? if so, have we reached the limit?
+ if((!v1shrunk && !v4shrunk) || !extra_iterations_limit--) break;
+// recompute the codebooks, omitting the extra blocks
+ if(v1shrunk) {
+ info.v1_size = v1_size;
+ new_v1_size = quantize(s, h, pict, 1, &info, ENC_V1);
+ if(new_v1_size < info.v1_size){
+ //av_log(s->avctx, AV_LOG_INFO, "mode %i, %3i, %3i: cut v1 codebook to %i entries\n", mode, v1_size, v4_size, new_v1_size);
+ info.v1_size = new_v1_size;
+ }
+ }
+ if(v4shrunk) {
+ info.v4_size = v4_size;
+ new_v4_size = quantize(s, h, pict, 0, &info, ENC_V4);
+ if(new_v4_size < info.v4_size) {
+ //av_log(s->avctx, AV_LOG_INFO, "mode %i, %3i, %3i: cut v4 codebook to %i entries\n", mode, v1_size, v4_size, new_v4_size);
+ info.v4_size = new_v4_size;
+ }
+ }
+ }
+ }
+
+ //av_log(s->avctx, AV_LOG_INFO, "%3i %3i score = %lli\n", v1_size, v4_size, (long long int)score);
+
+ if(best_size == 0 || score < *best_score) {
+
+ *best_score = score;
+#ifdef CINEPAK_REPORT_SERR
+ *best_serr = serr;
+#endif
+ best_size = encode_mode(s, h, scratch_pict, last_pict, &info, s->strip_buf + STRIP_HEADER_SIZE);
+
+ //av_log(s->avctx, AV_LOG_INFO, "mode %i, %3i, %3i: %18lli %i B", mode, info.v1_size, info.v4_size, (long long int)score, best_size);
+ //av_log(s->avctx, AV_LOG_INFO, "\n");
+#ifdef CINEPAK_REPORT_SERR
+ av_log(s->avctx, AV_LOG_INFO, "mode %i, %3i, %3i: %18lli %i B\n", mode, v1_size, v4_size, (long long int)serr, best_size);
+#endif
+
+#ifdef CINEPAKENC_DEBUG
+ //save MB encoding choices
+ memcpy(s->best_mb, s->mb, mb_count*sizeof(mb_info));
+#endif
+
+ //memcpy(strip_temp + STRIP_HEADER_SIZE, strip_temp, best_size);
+ write_strip_header(s, y, h, keyframe, s->strip_buf, best_size);
+
+ }
+ }
+ }
+ }
+
+#ifdef CINEPAKENC_DEBUG
+ //gather stats. this will only work properly of MAX_STRIPS == 1
+ if(best_info.mode == MODE_V1_ONLY) {
+ s->num_v1_mode++;
+ s->num_v1_encs += s->w*h/MB_AREA;
+ } else {
+ if(best_info.mode == MODE_V1_V4)
+ s->num_v4_mode++;
+ else
+ s->num_mc_mode++;
+
+ int x;
+ for(x = 0; x < s->w*h/MB_AREA; x++)
+ if(s->best_mb[x].best_encoding == ENC_V1)
+ s->num_v1_encs++;
+ else if(s->best_mb[x].best_encoding == ENC_V4)
+ s->num_v4_encs++;
+ else
+ s->num_skips++;
+ }
+#endif
+
+ best_size += STRIP_HEADER_SIZE;
+ memcpy(buf, s->strip_buf, best_size);
+
+ return best_size;
+}
+
+static int write_cvid_header(CinepakEncContext *s, unsigned char *buf, int num_strips, int data_size, int isakeyframe)
+{
+ buf[0] = isakeyframe ? 0 : 1;
+ AV_WB24(&buf[1], data_size + CVID_HEADER_SIZE);
+ AV_WB16(&buf[4], s->w);
+ AV_WB16(&buf[6], s->h);
+ AV_WB16(&buf[8], num_strips);
+
+ return CVID_HEADER_SIZE;
+}
+
+static int rd_frame(CinepakEncContext *s, const AVFrame *frame, int isakeyframe, unsigned char *buf, int buf_size)
+{
+ int num_strips, strip, i, y, nexty, size, temp_size;
+ AVPicture last_pict, pict, scratch_pict;
+ int64_t best_score = 0, score, score_temp;
+#ifdef CINEPAK_REPORT_SERR
+ int64_t best_serr = 0, serr, serr_temp;
+#endif
+
+ int best_nstrips = -1, best_size = -1; // mark as uninitialzed
+
+ if(s->pix_fmt == AV_PIX_FMT_RGB24) {
+ int x;
+// build a copy of the given frame in the correct colorspace
+ for(y = 0; y < s->h; y += 2) {
+ for(x = 0; x < s->w; x += 2) {
+ uint8_t *ir[2]; int32_t r, g, b, rr, gg, bb;
+ ir[0] = ((AVPicture*)frame)->data[0] + x*3 + y*((AVPicture*)frame)->linesize[0];
+ ir[1] = ir[0] + ((AVPicture*)frame)->linesize[0];
+ get_sub_picture(s, x, y, (AVPicture*)s->input_frame, &scratch_pict);
+ r = g = b = 0;
+ for(i=0; i<4; ++i) {
+ int i1, i2;
+ i1 = (i&1); i2 = (i>=2);
+ rr = ir[i2][i1*3+0];
+ gg = ir[i2][i1*3+1];
+ bb = ir[i2][i1*3+2];
+ r += rr; g += gg; b += bb;
+// using fixed point arithmetic for portable repeatability, scaling by 2^23
+// "Y"
+// rr = 0.2857*rr + 0.5714*gg + 0.1429*bb;
+ rr = (2396625*rr + 4793251*gg + 1198732*bb) >> 23;
+ if( rr < 0) rr = 0;
+ else if (rr > 255) rr = 255;
+ scratch_pict.data[0][i1 + i2*scratch_pict.linesize[0]] = rr;
+ }
+// let us scale down as late as possible
+// r /= 4; g /= 4; b /= 4;
+// "U"
+// rr = -0.1429*r - 0.2857*g + 0.4286*b;
+ rr = (-299683*r - 599156*g + 898839*b) >> 23;
+ if( rr < -128) rr = -128;
+ else if (rr > 127) rr = 127;
+ scratch_pict.data[1][0] = rr + 128; // quantize needs unsigned
+// "V"
+// rr = 0.3571*r - 0.2857*g - 0.0714*b;
+ rr = (748893*r - 599156*g - 149737*b) >> 23;
+ if( rr < -128) rr = -128;
+ else if (rr > 127) rr = 127;
+ scratch_pict.data[2][0] = rr + 128; // quantize needs unsigned
+ }
+ }
+ }
+
+ //would be nice but quite certainly incompatible with vintage players:
+ // support encoding zero strips (meaning skip the whole frame)
+ for(num_strips = s->min_strips; num_strips <= s->max_strips && num_strips <= s->h / MB_SIZE; num_strips++) {
+ score = 0;
+ size = 0;
+#ifdef CINEPAK_REPORT_SERR
+ serr = 0;
+#endif
+
+ for(y = 0, strip = 1; y < s->h; strip++, y = nexty) {
+ int strip_height;
+
+ nexty = strip * s->h / num_strips; // <= s->h
+ //make nexty the next multiple of 4 if not already there
+ if(nexty & 3)
+ nexty += 4 - (nexty & 3);
+
+ strip_height = nexty - y;
+ if(strip_height <= 0) { // can this ever happen?
+ av_log(s->avctx, AV_LOG_INFO, "skipping zero height strip %i of %i\n", strip, num_strips);
+ continue;
+ }
+
+ if(s->pix_fmt == AV_PIX_FMT_RGB24)
+ get_sub_picture(s, 0, y, (AVPicture*)s->input_frame, &pict);
+ else
+ get_sub_picture(s, 0, y, (AVPicture*)frame, &pict);
+ get_sub_picture(s, 0, y, (AVPicture*)s->last_frame, &last_pict);
+ get_sub_picture(s, 0, y, (AVPicture*)s->scratch_frame, &scratch_pict);
+
+ if((temp_size = rd_strip(s, y, strip_height, isakeyframe, &last_pict, &pict, &scratch_pict, s->frame_buf + size + CVID_HEADER_SIZE, &score_temp
+#ifdef CINEPAK_REPORT_SERR
+, &serr_temp
+#endif
+)) < 0)
+ return temp_size;
+
+ score += score_temp;
+#ifdef CINEPAK_REPORT_SERR
+ serr += serr_temp;
+#endif
+ size += temp_size;
+ //av_log(s->avctx, AV_LOG_INFO, "strip %d, isakeyframe=%d", strip, isakeyframe);
+ //av_log(s->avctx, AV_LOG_INFO, "\n");
+ }
+
+ if(best_score == 0 || score < best_score) {
+ best_score = score;
+#ifdef CINEPAK_REPORT_SERR
+ best_serr = serr;
+#endif
+ best_size = size + write_cvid_header(s, s->frame_buf, num_strips, size, isakeyframe);
+ //av_log(s->avctx, AV_LOG_INFO, "best number of strips so far: %2i, %12lli, %i B\n", num_strips, (long long int)score, best_size);
+#ifdef CINEPAK_REPORT_SERR
+ av_log(s->avctx, AV_LOG_INFO, "best number of strips so far: %2i, %12lli, %i B\n", num_strips, (long long int)serr, best_size);
+#endif
+
+ FFSWAP(AVFrame *, s->best_frame, s->scratch_frame);
+ memcpy(buf, s->frame_buf, best_size);
+ best_nstrips = num_strips;
+ }
+// avoid trying too many strip numbers without a real reason
+// (this makes the processing of the very first frame faster)
+ if(num_strips - best_nstrips > 4)
+ break;
+ }
+
+ av_assert0(best_nstrips >= 0 && best_size >= 0);
+
+// let the number of strips slowly adapt to the changes in the contents,
+// compared to full bruteforcing every time this will occasionally lead
+// to some r/d performance loss but makes encoding up to several times faster
+ if(!s->strip_number_delta_range) {
+ if(best_nstrips == s->max_strips) { // let us try to step up
+ s->max_strips = best_nstrips + 1;
+ if(s->max_strips >= s->max_max_strips)
+ s->max_strips = s->max_max_strips;
+ } else { // try to step down
+ s->max_strips = best_nstrips;
+ }
+ s->min_strips = s->max_strips - 1;
+ if(s->min_strips < s->min_min_strips)
+ s->min_strips = s->min_min_strips;
+ } else {
+ s->max_strips = best_nstrips + s->strip_number_delta_range;
+ if(s->max_strips >= s->max_max_strips)
+ s->max_strips = s->max_max_strips;
+ s->min_strips = best_nstrips - s->strip_number_delta_range;
+ if(s->min_strips < s->min_min_strips)
+ s->min_strips = s->min_min_strips;
+ }
+
+ return best_size;
+}
+
+static int cinepak_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
+ const AVFrame *frame, int *got_packet)
+{
+ CinepakEncContext *s = avctx->priv_data;
+ int ret;
+
+ s->lambda = frame->quality ? frame->quality - 1 : 2 * FF_LAMBDA_SCALE;
+
+ if ((ret = ff_alloc_packet2(avctx, pkt, s->frame_buf_size)) < 0)
+ return ret;
+ ret = rd_frame(s, frame, (s->curframe == 0), pkt->data, s->frame_buf_size);
+ pkt->size = ret;
+ if (s->curframe == 0)
+ pkt->flags |= AV_PKT_FLAG_KEY;
+ *got_packet = 1;
+
+ FFSWAP(AVFrame *, s->last_frame, s->best_frame);
+
+ if (++s->curframe >= s->keyint)
+ s->curframe = 0;
+
+ return 0;
+}
+
+static av_cold int cinepak_encode_end(AVCodecContext *avctx)
+{
+ CinepakEncContext *s = avctx->priv_data;
+ int x;
+
+ av_frame_free(&s->last_frame);
+ av_frame_free(&s->best_frame);
+ av_frame_free(&s->scratch_frame);
+ if (avctx->pix_fmt == AV_PIX_FMT_RGB24)
+ av_frame_free(&s->input_frame);
+ av_freep(&s->codebook_input);
+ av_freep(&s->codebook_closest);
+ av_freep(&s->strip_buf);
+ av_freep(&s->frame_buf);
+ av_freep(&s->mb);
+#ifdef CINEPAKENC_DEBUG
+ av_freep(&s->best_mb);
+#endif
+
+ for(x = 0; x < (avctx->pix_fmt == AV_PIX_FMT_RGB24 ? 4 : 3); x++)
+ av_freep(&s->pict_bufs[x]);
+
+#ifdef CINEPAKENC_DEBUG
+ av_log(avctx, AV_LOG_INFO, "strip coding stats: %i V1 mode, %i V4 mode, %i MC mode (%i V1 encs, %i V4 encs, %i skips)\n",
+ s->num_v1_mode, s->num_v4_mode, s->num_mc_mode, s->num_v1_encs, s->num_v4_encs, s->num_skips);
+#endif
+
+ return 0;
+}
+
+AVCodec ff_cinepak_encoder = {
+ .name = "cinepak",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_CINEPAK,
+ .priv_data_size = sizeof(CinepakEncContext),
+ .init = cinepak_encode_init,
+ .encode2 = cinepak_encode_frame,
+ .close = cinepak_encode_end,
+ .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("Cinepak / CVID"),
+ .priv_class = &cinepak_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cllc.c b/chromium/third_party/ffmpeg/libavcodec/cllc.c
index ee77381fd84..bc8e4b5679d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cllc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cllc.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/intreadwrite.h"
#include "dsputil.h"
#include "get_bits.h"
@@ -367,7 +369,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data,
info_offset = AV_RL32(src + 4);
if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->size) {
av_log(avctx, AV_LOG_ERROR,
- "Invalid INFO header offset: 0x%08X is too large.\n",
+ "Invalid INFO header offset: 0x%08"PRIX32" is too large.\n",
info_offset);
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/cngdec.c b/chromium/third_party/ffmpeg/libavcodec/cngdec.c
index 12241c3b919..855baaaa8da 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cngdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cngdec.c
@@ -59,12 +59,12 @@ static av_cold int cng_decode_init(AVCodecContext *avctx)
p->order = 12;
avctx->frame_size = 640;
- p->refl_coef = av_mallocz(p->order * sizeof(*p->refl_coef));
- p->target_refl_coef = av_mallocz(p->order * sizeof(*p->target_refl_coef));
- p->lpc_coef = av_mallocz(p->order * sizeof(*p->lpc_coef));
- p->filter_out = av_mallocz((avctx->frame_size + p->order) *
+ p->refl_coef = av_mallocz_array(p->order, sizeof(*p->refl_coef));
+ p->target_refl_coef = av_mallocz_array(p->order, sizeof(*p->target_refl_coef));
+ p->lpc_coef = av_mallocz_array(p->order, sizeof(*p->lpc_coef));
+ p->filter_out = av_mallocz_array(avctx->frame_size + p->order,
sizeof(*p->filter_out));
- p->excitation = av_mallocz(avctx->frame_size * sizeof(*p->excitation));
+ p->excitation = av_mallocz_array(avctx->frame_size, sizeof(*p->excitation));
if (!p->refl_coef || !p->target_refl_coef || !p->lpc_coef ||
!p->filter_out || !p->excitation) {
cng_decode_close(avctx);
diff --git a/chromium/third_party/ffmpeg/libavcodec/cngenc.c b/chromium/third_party/ffmpeg/libavcodec/cngenc.c
index 5ab6e365c15..bf5f7bf54b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cngenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cngenc.c
@@ -56,8 +56,8 @@ static av_cold int cng_encode_init(AVCodecContext *avctx)
p->order = 10;
if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0)
return ret;
- p->samples32 = av_malloc(avctx->frame_size * sizeof(*p->samples32));
- p->ref_coef = av_malloc(p->order * sizeof(*p->ref_coef));
+ p->samples32 = av_malloc_array(avctx->frame_size, sizeof(*p->samples32));
+ p->ref_coef = av_malloc_array(p->order, sizeof(*p->ref_coef));
if (!p->samples32 || !p->ref_coef) {
cng_encode_close(avctx);
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavcodec/codec_desc.c b/chromium/third_party/ffmpeg/libavcodec/codec_desc.c
index c62734f69d0..4906a0a21d3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/codec_desc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/codec_desc.c
@@ -26,6 +26,8 @@
#include "avcodec.h"
#include "version.h"
+#define MT(...) (const char *const[]){ __VA_ARGS__, NULL }
+
static const AVCodecDescriptor codec_descriptors[] = {
/* video codecs */
{
@@ -85,6 +87,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "mjpeg",
.long_name = NULL_IF_CONFIG_SMALL("Motion JPEG"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+ .mime_types= MT("image/jpeg"),
},
{
.id = AV_CODEC_ID_MJPEGB,
@@ -94,28 +97,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_LJPEG,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "ljpeg",
- .long_name = NULL_IF_CONFIG_SMALL("Lossless JPEG"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_SP5X,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "sp5x",
- .long_name = NULL_IF_CONFIG_SMALL("Sunplus JPEG (SP5X)"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_JPEGLS,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "jpegls",
- .long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
- AV_CODEC_PROP_LOSSLESS,
- },
- {
.id = AV_CODEC_ID_MPEG4,
.type = AVMEDIA_TYPE_VIDEO,
.name = "mpeg4",
@@ -466,48 +447,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_PNG,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "png",
- .long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
- .props = AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_PPM,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "ppm",
- .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_PBM,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "pbm",
- .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_PGM,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "pgm",
- .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_PGMYUV,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "pgmyuv",
- .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_PAM,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "pam",
- .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
.id = AV_CODEC_ID_FFVHUFF,
.type = AVMEDIA_TYPE_VIDEO,
.name = "ffvhuff",
@@ -590,6 +529,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "bmp",
.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ .mime_types= MT("image/x-ms-bmp"),
},
{
.id = AV_CODEC_ID_CSCD,
@@ -661,6 +601,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
AV_CODEC_PROP_LOSSLESS,
+ .mime_types= MT("image/jp2"),
},
{
.id = AV_CODEC_ID_VMNC,
@@ -691,13 +632,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_TARGA,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "targa",
- .long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
.id = AV_CODEC_ID_DSICINVIDEO,
.type = AVMEDIA_TYPE_VIDEO,
.name = "dsicinvideo",
@@ -712,20 +646,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_TIFF,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "tiff",
- .long_name = NULL_IF_CONFIG_SMALL("TIFF image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_GIF,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "gif",
- .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
- .props = AV_CODEC_PROP_LOSSLESS,
- },
- {
.id = AV_CODEC_ID_DXA,
.type = AVMEDIA_TYPE_VIDEO,
.name = "dxa",
@@ -747,20 +667,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_SGI,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "sgi",
- .long_name = NULL_IF_CONFIG_SMALL("SGI image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_SGIRLE,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "sgirle",
- .long_name = NULL_IF_CONFIG_SMALL("SGI RLE 8-bit"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
.id = AV_CODEC_ID_C93,
.type = AVMEDIA_TYPE_VIDEO,
.name = "c93",
@@ -775,20 +681,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_PTX,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "ptx",
- .long_name = NULL_IF_CONFIG_SMALL("V.Flash PTX image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_TXD,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "txd",
- .long_name = NULL_IF_CONFIG_SMALL("Renderware TXD (TeXture Dictionary) image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
- },
- {
.id = AV_CODEC_ID_VP6A,
.type = AVMEDIA_TYPE_VIDEO,
.name = "vp6a",
@@ -810,20 +702,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_PCX,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "pcx",
- .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_SUNRAST,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "sunrast",
- .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
.id = AV_CODEC_ID_INDEO4,
.type = AVMEDIA_TYPE_VIDEO,
.name = "indeo4",
@@ -925,6 +803,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.id = AV_CODEC_ID_V210X,
.type = AVMEDIA_TYPE_VIDEO,
.name = "v210x",
+ .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
{
@@ -942,13 +821,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
{
- .id = AV_CODEC_ID_DPX,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "dpx",
- .long_name = NULL_IF_CONFIG_SMALL("DPX (Digital Picture Exchange) image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
.id = AV_CODEC_ID_MAD,
.type = AVMEDIA_TYPE_VIDEO,
.name = "mad",
@@ -1047,13 +919,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_ANSI,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "ansi",
- .long_name = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
.id = AV_CODEC_ID_A64_MULTI,
.type = AVMEDIA_TYPE_VIDEO,
.name = "a64_multi",
@@ -1124,20 +989,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_WMV3IMAGE,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "wmv3image",
- .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_VC1IMAGE,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "vc1image",
- .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image v2"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
.id = AV_CODEC_ID_UTVIDEO,
.type = AVMEDIA_TYPE_VIDEO,
.name = "utvideo",
@@ -1173,13 +1024,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
{
- .id = AV_CODEC_ID_XWD,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "xwd",
- .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
.id = AV_CODEC_ID_CDXL,
.type = AVMEDIA_TYPE_VIDEO,
.name = "cdxl",
@@ -1187,13 +1031,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_XBM,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "xbm",
- .long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
.id = AV_CODEC_ID_ZEROCODEC,
.type = AVMEDIA_TYPE_VIDEO,
.name = "zerocodec",
@@ -1264,14 +1101,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_EXR,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "exr",
- .long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
- AV_CODEC_PROP_LOSSLESS,
- },
- {
.id = AV_CODEC_ID_AVRP,
.type = AVMEDIA_TYPE_VIDEO,
.name = "avrp",
@@ -1328,10 +1157,57 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY,
},
{
- .id = AV_CODEC_ID_SANM,
+ .id = AV_CODEC_ID_AVRN,
.type = AVMEDIA_TYPE_VIDEO,
- .name = "sanm",
- .long_name = NULL_IF_CONFIG_SMALL("LucasArts SMUSH video"),
+ .name = "avrn",
+ .long_name = NULL_IF_CONFIG_SMALL("Avid AVI Codec"),
+ },
+ {
+ .id = AV_CODEC_ID_CPIA,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "cpia",
+ .long_name = NULL_IF_CONFIG_SMALL("CPiA video format"),
+ },
+ {
+ .id = AV_CODEC_ID_XFACE,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "xface",
+ .long_name = NULL_IF_CONFIG_SMALL("X-face image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_SMVJPEG,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "smv",
+ .long_name = NULL_IF_CONFIG_SMALL("Sigmatel Motion Video"),
+ },
+
+ {
+ .id = AV_CODEC_ID_G2M,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "g2m",
+ .long_name = NULL_IF_CONFIG_SMALL("Go2Meeting"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_HNM4_VIDEO,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "hnm4video",
+ .long_name = NULL_IF_CONFIG_SMALL("HNM 4 video"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_HEVC,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "hevc",
+ .long_name = NULL_IF_CONFIG_SMALL("H.265 / HEVC (High Efficiency Video Coding)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_FIC,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "fic",
+ .long_name = NULL_IF_CONFIG_SMALL("Mirillis FIC"),
.props = AV_CODEC_PROP_LOSSY,
},
{
@@ -1342,23 +1218,41 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_AVRN,
+ .id = AV_CODEC_ID_VP7,
.type = AVMEDIA_TYPE_VIDEO,
- .name = "avrn",
- .long_name = NULL_IF_CONFIG_SMALL("Avid AVI Codec"),
+ .name = "vp7",
+ .long_name = NULL_IF_CONFIG_SMALL("On2 VP7"),
+ .props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_CPIA,
+ .id = AV_CODEC_ID_SANM,
.type = AVMEDIA_TYPE_VIDEO,
- .name = "cpia",
- .long_name = NULL_IF_CONFIG_SMALL("CPiA video format"),
+ .name = "sanm",
+ .long_name = NULL_IF_CONFIG_SMALL("LucasArts SANM/SMUSH video"),
+ .props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_XFACE,
+ .id = AV_CODEC_ID_SGIRLE,
.type = AVMEDIA_TYPE_VIDEO,
- .name = "xface",
- .long_name = NULL_IF_CONFIG_SMALL("X-face image"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+ .name = "sgirle",
+ .long_name = NULL_IF_CONFIG_SMALL("SGI RLE 8-bit"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+
+ /* image codecs */
+ {
+ .id = AV_CODEC_ID_ALIAS_PIX,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "alias_pix",
+ .long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_ANSI,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "ansi",
+ .long_name = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"),
+ .props = AV_CODEC_PROP_LOSSY,
},
{
.id = AV_CODEC_ID_BRENDER_PIX,
@@ -1368,17 +1262,151 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
{
- .id = AV_CODEC_ID_SMVJPEG,
+ .id = AV_CODEC_ID_DPX,
.type = AVMEDIA_TYPE_VIDEO,
- .name = "smv",
- .long_name = NULL_IF_CONFIG_SMALL("Sigmatel Motion Video"),
+ .name = "dpx",
+ .long_name = NULL_IF_CONFIG_SMALL("DPX (Digital Picture Exchange) image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
-
{
- .id = AV_CODEC_ID_G2M,
+ .id = AV_CODEC_ID_EXR,
.type = AVMEDIA_TYPE_VIDEO,
- .name = "g2m",
- .long_name = NULL_IF_CONFIG_SMALL("Go2Meeting"),
+ .name = "exr",
+ .long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
+ AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_GIF,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "gif",
+ .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
+ .props = AV_CODEC_PROP_LOSSLESS,
+ .mime_types= MT("image/gif"),
+ },
+ {
+ .id = AV_CODEC_ID_JPEGLS,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "jpegls",
+ .long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
+ AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_LJPEG,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "ljpeg",
+ .long_name = NULL_IF_CONFIG_SMALL("Lossless JPEG"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_PAM,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "pam",
+ .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ .mime_types= MT("image/x-portable-pixmap"),
+ },
+ {
+ .id = AV_CODEC_ID_PBM,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "pbm",
+ .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_PCX,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "pcx",
+ .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ .mime_types= MT("image/x-pcx"),
+ },
+ {
+ .id = AV_CODEC_ID_PGM,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "pgm",
+ .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_PGMYUV,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "pgmyuv",
+ .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_PNG,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "png",
+ .long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
+ .props = AV_CODEC_PROP_LOSSLESS,
+ .mime_types= MT("image/png"),
+ },
+ {
+ .id = AV_CODEC_ID_PPM,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "ppm",
+ .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_PTX,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "ptx",
+ .long_name = NULL_IF_CONFIG_SMALL("V.Flash PTX image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_SGI,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "sgi",
+ .long_name = NULL_IF_CONFIG_SMALL("SGI image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_SP5X,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "sp5x",
+ .long_name = NULL_IF_CONFIG_SMALL("Sunplus JPEG (SP5X)"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_SUNRAST,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "sunrast",
+ .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_TARGA,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "targa",
+ .long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ .mime_types= MT("image/x-targa", "image/x-tga"),
+ },
+ {
+ .id = AV_CODEC_ID_TIFF,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "tiff",
+ .long_name = NULL_IF_CONFIG_SMALL("TIFF image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ .mime_types= MT("image/tiff"),
+ },
+ {
+ .id = AV_CODEC_ID_TXD,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "txd",
+ .long_name = NULL_IF_CONFIG_SMALL("Renderware TXD (TeXture Dictionary) image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_VC1IMAGE,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "vc1image",
+ .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image v2"),
.props = AV_CODEC_PROP_LOSSY,
},
{
@@ -1388,20 +1416,29 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("WebP"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
AV_CODEC_PROP_LOSSLESS,
+ .mime_types= MT("image/webp"),
},
{
- .id = AV_CODEC_ID_HNM4_VIDEO,
+ .id = AV_CODEC_ID_WMV3IMAGE,
.type = AVMEDIA_TYPE_VIDEO,
- .name = "hnm4video",
- .long_name = NULL_IF_CONFIG_SMALL("HNM 4 video"),
+ .name = "wmv3image",
+ .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image"),
.props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_HEVC,
+ .id = AV_CODEC_ID_XBM,
.type = AVMEDIA_TYPE_VIDEO,
- .name = "hevc",
- .long_name = NULL_IF_CONFIG_SMALL("H.265 / HEVC (High Efficiency Video Coding)"),
- .props = AV_CODEC_PROP_LOSSY,
+ .name = "xbm",
+ .long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_XWD,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "xwd",
+ .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ .mime_types= MT("image/x-xwindowdump"),
},
/* various PCM "codecs" */
@@ -1869,6 +1906,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM little-endian"),
.props = AV_CODEC_PROP_LOSSY,
},
+ {
+ .id = AV_CODEC_ID_ADPCM_VIMA,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "adpcm_vima",
+ .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
/* AMR */
{
@@ -1965,20 +2009,21 @@ static const AVCodecDescriptor codec_descriptors[] = {
.id = AV_CODEC_ID_DTS,
.type = AVMEDIA_TYPE_AUDIO,
.name = "dts",
- .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
+ .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS,
},
{
.id = AV_CODEC_ID_VORBIS,
.type = AVMEDIA_TYPE_AUDIO,
.name = "vorbis",
- .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
+ .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
.props = AV_CODEC_PROP_LOSSY,
},
{
.id = AV_CODEC_ID_DVAUDIO,
.type = AVMEDIA_TYPE_AUDIO,
.name = "dvaudio",
+ .long_name = NULL_IF_CONFIG_SMALL("DV audio"),
.props = AV_CODEC_PROP_LOSSY,
},
{
@@ -2362,13 +2407,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
- .id = AV_CODEC_ID_VIMA,
- .type = AVMEDIA_TYPE_AUDIO,
- .name = "vima",
- .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
.id = AV_CODEC_ID_FFWAVESYNTH,
.type = AVMEDIA_TYPE_AUDIO,
.name = "wavesynth",
@@ -2387,13 +2425,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"),
},
{
- .id = AV_CODEC_ID_PAF_AUDIO,
- .type = AVMEDIA_TYPE_AUDIO,
- .name = "paf_audio",
- .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Audio"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
.id = AV_CODEC_ID_OPUS,
.type = AVMEDIA_TYPE_AUDIO,
.name = "opus",
@@ -2422,6 +2453,20 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
+ .id = AV_CODEC_ID_PAF_AUDIO,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "paf_audio",
+ .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Audio"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_ON2AVC,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "avc",
+ .long_name = NULL_IF_CONFIG_SMALL("On2 Audio for Video Codec"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
.id = AV_CODEC_ID_EVRC,
.type = AVMEDIA_TYPE_AUDIO,
.name = "evrc",
@@ -2435,6 +2480,34 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("SMV (Selectable Mode Vocoder)"),
.props = AV_CODEC_PROP_LOSSY,
},
+ {
+ .id = AV_CODEC_ID_DSD_LSBF,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "dsd_lsbf",
+ .long_name = NULL_IF_CONFIG_SMALL("DSD (Direct Stream Digital), least significant bit first"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_DSD_MSBF,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "dsd_msbf",
+ .long_name = NULL_IF_CONFIG_SMALL("DSD (Direct Stream Digital), most significant bit first"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_DSD_LSBF_PLANAR,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "dsd_lsbf_planar",
+ .long_name = NULL_IF_CONFIG_SMALL("DSD (Direct Stream Digital), least significant bit first, planar"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_DSD_MSBF_PLANAR,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "dsd_msbf_planar",
+ .long_name = NULL_IF_CONFIG_SMALL("DSD (Direct Stream Digital), most significant bit first, planar"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
/* subtitle codecs */
{
@@ -2589,6 +2662,15 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
.props = AV_CODEC_PROP_TEXT_SUB,
},
+
+ /* other kind of codecs and pseudo-codecs */
+ {
+ .id = AV_CODEC_ID_TTF,
+ .type = AVMEDIA_TYPE_DATA,
+ .name = "ttf",
+ .long_name = NULL_IF_CONFIG_SMALL("TrueType font"),
+ .mime_types= MT("application/x-truetype-font", "application/x-font"),
+ },
{
.id = AV_CODEC_ID_BINTEXT,
.type = AVMEDIA_TYPE_VIDEO,
@@ -2611,6 +2693,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY,
},
{
+ .id = AV_CODEC_ID_OTF,
+ .type = AVMEDIA_TYPE_DATA,
+ .name = "otf",
+ .long_name = NULL_IF_CONFIG_SMALL("OpenType font"),
+ .mime_types= MT("application/vnd.ms-opentype"),
+ },
+ {
.id = AV_CODEC_ID_SMPTE_KLV,
.type = AVMEDIA_TYPE_DATA,
.name = "klv",
@@ -2622,7 +2711,136 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "dvd_nav_packet",
.long_name = NULL_IF_CONFIG_SMALL("DVD Nav packet"),
},
+ {
+ .id = AV_CODEC_ID_TIMED_ID3,
+ .type = AVMEDIA_TYPE_DATA,
+ .name = "timed_id3",
+ .long_name = NULL_IF_CONFIG_SMALL("timed ID3 metadata"),
+ },
+ {
+ .id = AV_CODEC_ID_BIN_DATA,
+ .type = AVMEDIA_TYPE_DATA,
+ .name = "bin_data",
+ .long_name = NULL_IF_CONFIG_SMALL("binary data"),
+ .mime_types= MT("application/octet-stream"),
+ },
+ /* deprecated codec ids */
+ {
+ .id = AV_CODEC_ID_BRENDER_PIX_DEPRECATED,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "brender_pix_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("BRender PIX image (deprecated id)"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_ESCAPE130_DEPRECATED,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "escape130_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("Escape 130 (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_EXR_DEPRECATED,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "exr_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("OpenEXR image (deprecated id)"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
+ AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_G2M_DEPRECATED,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "g2m_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("Go2Meeting (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_HEVC_DEPRECATED,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "hevc_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("H.265 / HEVC (High Efficiency Video Coding) (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_PAF_VIDEO_DEPRECATED,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "paf_video_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Video (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_SANM_DEPRECATED,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "sanm_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("LucasArts SANM/SMUSH video (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_VP7_DEPRECATED,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "vp7_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("On2 VP7 (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_WEBP_DEPRECATED,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "webp_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("WebP (deprecated id)"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
+ AV_CODEC_PROP_LOSSLESS,
+ },
+
+ {
+ .id = AV_CODEC_ID_VIMA,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "vima",
+ .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_ADPCM_VIMA_DEPRECATED,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "adpcm_vima_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_OPUS_DEPRECATED,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "opus_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("Opus (Opus Interactive Audio Codec) (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_PAF_AUDIO_DEPRECATED,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "paf_audio_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Audio (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "pcm_s24le_planar_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("PCM signed 24-bit little-endian planar (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "pcm_s32le_planar_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("PCM signed 32-bit little-endian planar (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSLESS,
+ },
+ {
+ .id = AV_CODEC_ID_TAK_DEPRECATED,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "tak_deprecated",
+ .long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor) (deprecated id)"),
+ .props = AV_CODEC_PROP_LOSSLESS,
+ },
};
const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id)
@@ -2648,9 +2866,8 @@ const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name)
{
const AVCodecDescriptor *desc = NULL;
- while ((desc = avcodec_descriptor_next(desc))) {
+ while ((desc = avcodec_descriptor_next(desc)))
if (!strcmp(desc->name, name))
return desc;
- }
return NULL;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/cook.c b/chromium/third_party/ffmpeg/libavcodec/cook.c
index 402093c425d..d84d755dea9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cook.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cook.c
@@ -219,7 +219,7 @@ static av_cold int init_cook_mlt(COOKContext *q)
int j, ret;
int mlt_size = q->samples_per_channel;
- if ((q->mlt_window = av_malloc(mlt_size * sizeof(*q->mlt_window))) == 0)
+ if ((q->mlt_window = av_malloc_array(mlt_size, sizeof(*q->mlt_window))) == 0)
return AVERROR(ENOMEM);
/* Initialize the MLT window: simple sine window. */
diff --git a/chromium/third_party/ffmpeg/libavcodec/copy_block.h b/chromium/third_party/ffmpeg/libavcodec/copy_block.h
index a73910d80f4..9ed451f2940 100644
--- a/chromium/third_party/ffmpeg/libavcodec/copy_block.h
+++ b/chromium/third_party/ffmpeg/libavcodec/copy_block.h
@@ -37,57 +37,52 @@ static inline void copy_block2(uint8_t *dst, const uint8_t *src, int dstStride,
static inline void copy_block4(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
{
int i;
- for(i=0; i<h; i++)
- {
+ for (i = 0; i < h; i++) {
AV_COPY32U(dst, src);
- dst+=dstStride;
- src+=srcStride;
+ dst += dstStride;
+ src += srcStride;
}
}
static inline void copy_block8(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
{
int i;
- for(i=0; i<h; i++)
- {
+ for (i = 0; i < h; i++) {
AV_COPY64U(dst, src);
- dst+=dstStride;
- src+=srcStride;
+ dst += dstStride;
+ src += srcStride;
}
}
-static inline void copy_block16(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
+static inline void copy_block9(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
{
int i;
- for(i=0; i<h; i++)
- {
- AV_COPY128U(dst, src);
- dst+=dstStride;
- src+=srcStride;
+ for (i = 0; i < h; i++) {
+ AV_COPY64U(dst, src);
+ dst[8] = src[8];
+ dst += dstStride;
+ src += srcStride;
}
}
-static inline void copy_block9(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
+static inline void copy_block16(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
{
int i;
- for(i=0; i<h; i++)
- {
- AV_COPY64U(dst, src);
- dst[8]= src[8];
- dst+=dstStride;
- src+=srcStride;
+ for (i = 0; i < h; i++) {
+ AV_COPY128U(dst, src);
+ dst += dstStride;
+ src += srcStride;
}
}
static inline void copy_block17(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
{
int i;
- for(i=0; i<h; i++)
- {
+ for (i = 0; i < h; i++) {
AV_COPY128U(dst, src);
- dst[16]= src[16];
- dst+=dstStride;
- src+=srcStride;
+ dst[16] = src[16];
+ dst += dstStride;
+ src += srcStride;
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/cos_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/cos_tablegen.c
index 48b7b900103..9af83f4d7d0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cos_tablegen.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cos_tablegen.c
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
double (*func)(double) = do_sin ? sin : cos;
printf("/* This file was automatically generated. */\n");
- printf("#define CONFIG_FFT_FLOAT %d\n", !fixed);
+ printf("#define FFT_FLOAT %d\n", !fixed);
printf("#include \"libavcodec/%s\"\n", do_sin ? "rdft.h" : "fft.h");
for (i = 4; i <= BITS; i++) {
int m = 1 << i;
diff --git a/chromium/third_party/ffmpeg/libavcodec/cpia.c b/chromium/third_party/ffmpeg/libavcodec/cpia.c
index 44226fb46bb..9036cb37fca 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cpia.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cpia.c
@@ -76,15 +76,15 @@ static int cpia_decode_frame(AVCodecContext *avctx,
// currently unsupported properties
if (header[17] == SUBSAMPLE_422) {
- av_log(avctx, AV_LOG_ERROR, "Unsupported subsample!\n");
+ avpriv_report_missing_feature(avctx, "4:2:2 subsampling");
return AVERROR_PATCHWELCOME;
}
if (header[18] == YUVORDER_UYVY) {
- av_log(avctx, AV_LOG_ERROR, "Unsupported YUV byte order!\n");
+ avpriv_report_missing_feature(avctx, "YUV byte order UYVY");
return AVERROR_PATCHWELCOME;
}
if (header[29] == DECIMATION_ENAB) {
- av_log(avctx, AV_LOG_ERROR, "Decimation unsupported!\n");
+ avpriv_report_missing_feature(avctx, "Decimation");
return AVERROR_PATCHWELCOME;
}
@@ -114,7 +114,7 @@ static int cpia_decode_frame(AVCodecContext *avctx,
if (src_size < linelength) {
av_frame_set_decode_error_flags(frame, FF_DECODE_ERROR_INVALID_BITSTREAM);
- av_log(avctx, AV_LOG_WARNING, "Frame ended enexpectedly!\n");
+ av_log(avctx, AV_LOG_WARNING, "Frame ended unexpectedly!\n");
break;
}
if (src[linelength - 1] != EOL) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/dca.c b/chromium/third_party/ffmpeg/libavcodec/dca.c
index 1c1c0803506..fcdfef21475 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dca.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dca.c
@@ -25,8 +25,10 @@
#include <stdint.h>
#include <string.h>
-#include "put_bits.h"
+#include "libavutil/error.h"
+
#include "dca.h"
+#include "put_bits.h"
const uint32_t avpriv_dca_sample_rates[16] =
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/dcadata.h b/chromium/third_party/ffmpeg/libavcodec/dcadata.h
index 5154fbca0ca..0ae125c2f44 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dcadata.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dcadata.h
@@ -7305,205 +7305,208 @@ DECLARE_ALIGNED(16, static const float, fir_32bands_nonperfect)[] =
+1.390191784E-007
};
+/* pre-scale lfe fir coefficients */
+#define SCALE(c) ((c) / (256.0f * 32768.0f))
DECLARE_ALIGNED(16, static const float, lfe_fir_64)[] =
{
- 2.658434386830777e-4, 9.029330685734748e-3,
- 7.939263433218002e-2, 2.425158768892288e-1,
- 3.430179357528686e-1, 2.398228943347931e-1,
- 7.746443897485733e-2, 8.622321300208569e-3,
- 8.179365249816328e-5, 9.450953453779220e-3,
- 8.134882897138596e-2, 2.451938837766648e-1,
- 3.429597318172455e-1, 2.371159791946411e-1,
- 7.556436210870743e-2, 8.229630999267101e-3,
- 9.439323912374676e-5, 9.887560270726680e-3,
- 8.333285897970200e-2, 2.478559017181396e-1,
- 3.428434133529663e-1, 2.343961596488952e-1,
- 7.369252294301987e-2, 7.850865833461285e-3,
- 1.082170274457894e-4, 1.033949479460716e-2,
- 8.534456789493561e-2, 2.505008876323700e-1,
- 3.426689505577088e-1, 2.316644787788391e-1,
- 7.184901088476181e-2, 7.485736627131701e-3,
- 1.233371440321207e-4, 1.080708485096693e-2,
- 8.738376945257187e-2, 2.531278133392334e-1,
- 3.424364924430847e-1, 2.289219647645950e-1,
- 7.003392279148102e-2, 7.133882027119398e-3,
- 1.397485757479444e-4, 1.129068247973919e-2,
- 8.945026248693466e-2, 2.557355761528015e-1,
- 3.421461284160614e-1, 2.261696159839630e-1,
- 6.824731826782227e-2, 6.794991903007030e-3,
- 1.575958012836054e-4, 1.179065089672804e-2,
- 9.154383838176728e-2, 2.583232223987580e-1,
- 3.417979776859284e-1, 2.234084606170654e-1,
- 6.648923456668854e-2, 6.468691397458315e-3,
- 1.769922382663936e-4, 1.230732165277004e-2,
- 9.366425126791000e-2, 2.608896791934967e-1,
- 3.413922190666198e-1, 2.206395119428635e-1,
- 6.475970894098282e-2, 6.154712289571762e-3,
- 1.981738605536520e-4, 1.284105982631445e-2,
- 9.581124037504196e-2, 2.634339034557342e-1,
- 3.409290313720703e-1, 2.178637981414795e-1,
- 6.305878609418869e-2, 5.852684378623962e-3,
- 2.211847313446924e-4, 1.339218579232693e-2,
- 9.798453748226166e-2, 2.659549415111542e-1,
- 3.404086530208588e-1, 2.150822728872299e-1,
- 6.138643622398376e-2, 5.562345497310162e-3,
- 2.460231189616024e-4, 1.396108977496624e-2,
- 1.001838669180870e-1, 2.684516608715058e-1,
- 3.398312926292420e-1, 2.122959494590759e-1,
- 5.974265560507774e-2, 5.283284001052380e-3,
- 2.726115926634520e-4, 1.454808749258518e-2,
- 1.024089083075523e-1, 2.709231376647949e-1,
- 3.391972482204438e-1, 2.095058411359787e-1,
- 5.812742188572884e-2, 5.015311297029257e-3,
- 3.013863170053810e-4, 1.515355054289102e-2,
- 1.046593263745308e-1, 2.733682692050934e-1,
- 3.385068178176880e-1, 2.067128717899322e-1,
- 5.654069408774376e-2, 4.758012015372515e-3,
- 3.328395541757345e-4, 1.577781140804291e-2,
- 1.069347932934761e-1, 2.757860720157624e-1,
- 3.377602994441986e-1, 2.039180546998978e-1,
- 5.498242005705833e-2, 4.511159844696522e-3,
- 3.658991190604866e-4, 1.642123050987720e-2,
- 1.092349365353584e-1, 2.781755328178406e-1,
- 3.369580209255218e-1, 2.011223286390304e-1,
- 5.345252528786659e-2, 4.274417180567980e-3,
- 4.018281470052898e-4, 1.708412915468216e-2,
- 1.115593686699867e-1, 2.805356979370117e-1,
- 3.361004292964936e-1, 1.983266174793244e-1,
- 5.195093154907227e-2, 4.047499038279056e-3,
- 4.401875485200435e-4, 1.776690222322941e-2,
- 1.139076948165894e-1, 2.828655838966370e-1,
- 3.351879119873047e-1, 1.955319195985794e-1,
- 5.047753453254700e-2, 3.830091329291463e-3,
- 4.812776169274002e-4, 1.846982724964619e-2,
- 1.162794977426529e-1, 2.851640880107880e-1,
- 3.342207968235016e-1, 1.927391141653061e-1,
- 4.903224110603333e-2, 3.621967276558280e-3,
- 5.252459668554366e-4, 1.919330470263958e-2,
- 1.186743453145027e-1, 2.874303460121155e-1,
- 3.331996202468872e-1, 1.899491697549820e-1,
- 4.761491715908051e-2, 3.422776935622096e-3,
- 5.721592460758984e-4, 1.993762329220772e-2,
- 1.210917681455612e-1, 2.896633744239807e-1,
- 3.321248590946198e-1, 1.871629506349564e-1,
- 4.622544348239899e-2, 3.232272574678064e-3,
- 6.222130032256246e-4, 2.070316113531590e-2,
- 1.235313042998314e-1, 2.918621897697448e-1,
- 3.309969604015350e-1, 1.843813359737396e-1,
- 4.486365616321564e-2, 3.050152910873294e-3,
- 6.755515350960195e-4, 2.149021252989769e-2,
- 1.259924471378326e-1, 2.940258979797364e-1,
- 3.298164308071136e-1, 1.816052496433258e-1,
- 4.352942481637001e-2, 2.876190468668938e-3,
- 7.324148900806904e-4, 2.229913882911205e-2,
- 1.284746825695038e-1, 2.961534857749939e-1,
- 3.285838961601258e-1, 1.788355410099030e-1,
- 4.222255200147629e-2, 2.710093278437853e-3,
- 7.928516715764999e-4, 2.313023805618286e-2,
- 1.309774816036224e-1, 2.982441186904907e-1,
- 3.272998929023742e-1, 1.760730892419815e-1,
- 4.094288870692253e-2, 2.551567042246461e-3,
- 8.570110658183694e-4, 2.398385666310787e-2,
- 1.335003077983856e-1, 3.002967536449432e-1,
- 3.259649574756622e-1, 1.733186990022659e-1,
- 3.969023004174232e-2, 2.400433411821723e-3,
- 9.251192095689476e-4, 2.486028522253036e-2,
- 1.360425949096680e-1, 3.023106753826142e-1,
- 3.245797157287598e-1, 1.705732345581055e-1,
- 3.846437484025955e-2, 2.256359672173858e-3,
- 9.974770946428180e-4, 2.575986087322235e-2,
- 1.386037617921829e-1, 3.042849004268646e-1,
- 3.231448531150818e-1, 1.678375005722046e-1,
- 3.726511076092720e-2, 2.119151875376701e-3,
- 1.073930296115577e-3, 2.668286114931106e-2,
- 1.411831974983215e-1, 3.062185347080230e-1,
- 3.216609656810760e-1, 1.651122719049454e-1,
- 3.609224036335945e-2, 1.988604199141264e-3,
- 1.155023579485714e-3, 2.762960828840732e-2,
- 1.437802612781525e-1, 3.081108033657074e-1,
- 3.201287388801574e-1, 1.623983532190323e-1,
- 3.494550660252571e-2, 1.864377525635064e-3,
- 1.240676851011813e-3, 2.860039286315441e-2,
- 1.463943719863892e-1, 3.099608123302460e-1,
- 3.185488879680634e-1, 1.596965193748474e-1,
- 3.382468968629837e-2, 1.746327499859035e-3,
- 1.331258914433420e-3, 2.959549613296986e-2,
- 1.490248143672943e-1, 3.117676973342896e-1,
- 3.169221282005310e-1, 1.570075154304504e-1,
- 3.272953629493714e-2, 1.634211512282491e-3,
- 1.426893868483603e-3, 3.061520494520664e-2,
- 1.516709625720978e-1, 3.135308027267456e-1,
- 3.152491748332978e-1, 1.543320864439010e-1,
- 3.165979683399200e-2, 1.527829794213176e-3,
+ SCALE(2.658434386830777e-4), SCALE(9.029330685734748e-3),
+ SCALE(7.939263433218002e-2), SCALE(2.425158768892288e-1),
+ SCALE(3.430179357528686e-1), SCALE(2.398228943347931e-1),
+ SCALE(7.746443897485733e-2), SCALE(8.622321300208569e-3),
+ SCALE(8.179365249816328e-5), SCALE(9.450953453779220e-3),
+ SCALE(8.134882897138596e-2), SCALE(2.451938837766648e-1),
+ SCALE(3.429597318172455e-1), SCALE(2.371159791946411e-1),
+ SCALE(7.556436210870743e-2), SCALE(8.229630999267101e-3),
+ SCALE(9.439323912374676e-5), SCALE(9.887560270726680e-3),
+ SCALE(8.333285897970200e-2), SCALE(2.478559017181396e-1),
+ SCALE(3.428434133529663e-1), SCALE(2.343961596488952e-1),
+ SCALE(7.369252294301987e-2), SCALE(7.850865833461285e-3),
+ SCALE(1.082170274457894e-4), SCALE(1.033949479460716e-2),
+ SCALE(8.534456789493561e-2), SCALE(2.505008876323700e-1),
+ SCALE(3.426689505577088e-1), SCALE(2.316644787788391e-1),
+ SCALE(7.184901088476181e-2), SCALE(7.485736627131701e-3),
+ SCALE(1.233371440321207e-4), SCALE(1.080708485096693e-2),
+ SCALE(8.738376945257187e-2), SCALE(2.531278133392334e-1),
+ SCALE(3.424364924430847e-1), SCALE(2.289219647645950e-1),
+ SCALE(7.003392279148102e-2), SCALE(7.133882027119398e-3),
+ SCALE(1.397485757479444e-4), SCALE(1.129068247973919e-2),
+ SCALE(8.945026248693466e-2), SCALE(2.557355761528015e-1),
+ SCALE(3.421461284160614e-1), SCALE(2.261696159839630e-1),
+ SCALE(6.824731826782227e-2), SCALE(6.794991903007030e-3),
+ SCALE(1.575958012836054e-4), SCALE(1.179065089672804e-2),
+ SCALE(9.154383838176728e-2), SCALE(2.583232223987580e-1),
+ SCALE(3.417979776859284e-1), SCALE(2.234084606170654e-1),
+ SCALE(6.648923456668854e-2), SCALE(6.468691397458315e-3),
+ SCALE(1.769922382663936e-4), SCALE(1.230732165277004e-2),
+ SCALE(9.366425126791000e-2), SCALE(2.608896791934967e-1),
+ SCALE(3.413922190666198e-1), SCALE(2.206395119428635e-1),
+ SCALE(6.475970894098282e-2), SCALE(6.154712289571762e-3),
+ SCALE(1.981738605536520e-4), SCALE(1.284105982631445e-2),
+ SCALE(9.581124037504196e-2), SCALE(2.634339034557342e-1),
+ SCALE(3.409290313720703e-1), SCALE(2.178637981414795e-1),
+ SCALE(6.305878609418869e-2), SCALE(5.852684378623962e-3),
+ SCALE(2.211847313446924e-4), SCALE(1.339218579232693e-2),
+ SCALE(9.798453748226166e-2), SCALE(2.659549415111542e-1),
+ SCALE(3.404086530208588e-1), SCALE(2.150822728872299e-1),
+ SCALE(6.138643622398376e-2), SCALE(5.562345497310162e-3),
+ SCALE(2.460231189616024e-4), SCALE(1.396108977496624e-2),
+ SCALE(1.001838669180870e-1), SCALE(2.684516608715058e-1),
+ SCALE(3.398312926292420e-1), SCALE(2.122959494590759e-1),
+ SCALE(5.974265560507774e-2), SCALE(5.283284001052380e-3),
+ SCALE(2.726115926634520e-4), SCALE(1.454808749258518e-2),
+ SCALE(1.024089083075523e-1), SCALE(2.709231376647949e-1),
+ SCALE(3.391972482204438e-1), SCALE(2.095058411359787e-1),
+ SCALE(5.812742188572884e-2), SCALE(5.015311297029257e-3),
+ SCALE(3.013863170053810e-4), SCALE(1.515355054289102e-2),
+ SCALE(1.046593263745308e-1), SCALE(2.733682692050934e-1),
+ SCALE(3.385068178176880e-1), SCALE(2.067128717899322e-1),
+ SCALE(5.654069408774376e-2), SCALE(4.758012015372515e-3),
+ SCALE(3.328395541757345e-4), SCALE(1.577781140804291e-2),
+ SCALE(1.069347932934761e-1), SCALE(2.757860720157624e-1),
+ SCALE(3.377602994441986e-1), SCALE(2.039180546998978e-1),
+ SCALE(5.498242005705833e-2), SCALE(4.511159844696522e-3),
+ SCALE(3.658991190604866e-4), SCALE(1.642123050987720e-2),
+ SCALE(1.092349365353584e-1), SCALE(2.781755328178406e-1),
+ SCALE(3.369580209255218e-1), SCALE(2.011223286390304e-1),
+ SCALE(5.345252528786659e-2), SCALE(4.274417180567980e-3),
+ SCALE(4.018281470052898e-4), SCALE(1.708412915468216e-2),
+ SCALE(1.115593686699867e-1), SCALE(2.805356979370117e-1),
+ SCALE(3.361004292964936e-1), SCALE(1.983266174793244e-1),
+ SCALE(5.195093154907227e-2), SCALE(4.047499038279056e-3),
+ SCALE(4.401875485200435e-4), SCALE(1.776690222322941e-2),
+ SCALE(1.139076948165894e-1), SCALE(2.828655838966370e-1),
+ SCALE(3.351879119873047e-1), SCALE(1.955319195985794e-1),
+ SCALE(5.047753453254700e-2), SCALE(3.830091329291463e-3),
+ SCALE(4.812776169274002e-4), SCALE(1.846982724964619e-2),
+ SCALE(1.162794977426529e-1), SCALE(2.851640880107880e-1),
+ SCALE(3.342207968235016e-1), SCALE(1.927391141653061e-1),
+ SCALE(4.903224110603333e-2), SCALE(3.621967276558280e-3),
+ SCALE(5.252459668554366e-4), SCALE(1.919330470263958e-2),
+ SCALE(1.186743453145027e-1), SCALE(2.874303460121155e-1),
+ SCALE(3.331996202468872e-1), SCALE(1.899491697549820e-1),
+ SCALE(4.761491715908051e-2), SCALE(3.422776935622096e-3),
+ SCALE(5.721592460758984e-4), SCALE(1.993762329220772e-2),
+ SCALE(1.210917681455612e-1), SCALE(2.896633744239807e-1),
+ SCALE(3.321248590946198e-1), SCALE(1.871629506349564e-1),
+ SCALE(4.622544348239899e-2), SCALE(3.232272574678064e-3),
+ SCALE(6.222130032256246e-4), SCALE(2.070316113531590e-2),
+ SCALE(1.235313042998314e-1), SCALE(2.918621897697448e-1),
+ SCALE(3.309969604015350e-1), SCALE(1.843813359737396e-1),
+ SCALE(4.486365616321564e-2), SCALE(3.050152910873294e-3),
+ SCALE(6.755515350960195e-4), SCALE(2.149021252989769e-2),
+ SCALE(1.259924471378326e-1), SCALE(2.940258979797364e-1),
+ SCALE(3.298164308071136e-1), SCALE(1.816052496433258e-1),
+ SCALE(4.352942481637001e-2), SCALE(2.876190468668938e-3),
+ SCALE(7.324148900806904e-4), SCALE(2.229913882911205e-2),
+ SCALE(1.284746825695038e-1), SCALE(2.961534857749939e-1),
+ SCALE(3.285838961601258e-1), SCALE(1.788355410099030e-1),
+ SCALE(4.222255200147629e-2), SCALE(2.710093278437853e-3),
+ SCALE(7.928516715764999e-4), SCALE(2.313023805618286e-2),
+ SCALE(1.309774816036224e-1), SCALE(2.982441186904907e-1),
+ SCALE(3.272998929023742e-1), SCALE(1.760730892419815e-1),
+ SCALE(4.094288870692253e-2), SCALE(2.551567042246461e-3),
+ SCALE(8.570110658183694e-4), SCALE(2.398385666310787e-2),
+ SCALE(1.335003077983856e-1), SCALE(3.002967536449432e-1),
+ SCALE(3.259649574756622e-1), SCALE(1.733186990022659e-1),
+ SCALE(3.969023004174232e-2), SCALE(2.400433411821723e-3),
+ SCALE(9.251192095689476e-4), SCALE(2.486028522253036e-2),
+ SCALE(1.360425949096680e-1), SCALE(3.023106753826142e-1),
+ SCALE(3.245797157287598e-1), SCALE(1.705732345581055e-1),
+ SCALE(3.846437484025955e-2), SCALE(2.256359672173858e-3),
+ SCALE(9.974770946428180e-4), SCALE(2.575986087322235e-2),
+ SCALE(1.386037617921829e-1), SCALE(3.042849004268646e-1),
+ SCALE(3.231448531150818e-1), SCALE(1.678375005722046e-1),
+ SCALE(3.726511076092720e-2), SCALE(2.119151875376701e-3),
+ SCALE(1.073930296115577e-3), SCALE(2.668286114931106e-2),
+ SCALE(1.411831974983215e-1), SCALE(3.062185347080230e-1),
+ SCALE(3.216609656810760e-1), SCALE(1.651122719049454e-1),
+ SCALE(3.609224036335945e-2), SCALE(1.988604199141264e-3),
+ SCALE(1.155023579485714e-3), SCALE(2.762960828840732e-2),
+ SCALE(1.437802612781525e-1), SCALE(3.081108033657074e-1),
+ SCALE(3.201287388801574e-1), SCALE(1.623983532190323e-1),
+ SCALE(3.494550660252571e-2), SCALE(1.864377525635064e-3),
+ SCALE(1.240676851011813e-3), SCALE(2.860039286315441e-2),
+ SCALE(1.463943719863892e-1), SCALE(3.099608123302460e-1),
+ SCALE(3.185488879680634e-1), SCALE(1.596965193748474e-1),
+ SCALE(3.382468968629837e-2), SCALE(1.746327499859035e-3),
+ SCALE(1.331258914433420e-3), SCALE(2.959549613296986e-2),
+ SCALE(1.490248143672943e-1), SCALE(3.117676973342896e-1),
+ SCALE(3.169221282005310e-1), SCALE(1.570075154304504e-1),
+ SCALE(3.272953629493714e-2), SCALE(1.634211512282491e-3),
+ SCALE(1.426893868483603e-3), SCALE(3.061520494520664e-2),
+ SCALE(1.516709625720978e-1), SCALE(3.135308027267456e-1),
+ SCALE(3.152491748332978e-1), SCALE(1.543320864439010e-1),
+ SCALE(3.165979683399200e-2), SCALE(1.527829794213176e-3),
};
DECLARE_ALIGNED(16, static const float, lfe_fir_128)[] =
{
- 0.00053168571, 0.15878495574, 0.68603444099, 0.15492856503,
- 0.00016358691, 0.16269733012, 0.68591803312, 0.15112841129,
- 0.00018878609, 0.16666537523, 0.68568539619, 0.14738474786,
- 0.00021643363, 0.17068879306, 0.68533653021, 0.14369773865,
- 0.00024667382, 0.17476719618, 0.68487155437, 0.14006754756,
- 0.00027949660, 0.17890018225, 0.68429082632, 0.13649433851,
- 0.00031519096, 0.18308731914, 0.68359452486, 0.13297818601,
- 0.00035398375, 0.18732811511, 0.68278300762, 0.12951917946,
- 0.00039634691, 0.19162209332, 0.68185669184, 0.12611730397,
- 0.00044236859, 0.19596865773, 0.68081587553, 0.12277261168,
- 0.00049204525, 0.20036731660, 0.67966115475, 0.11948505789,
- 0.00054522208, 0.20481738448, 0.67839306593, 0.11625462025,
- 0.00060277141, 0.20931822062, 0.67701220512, 0.11308115721,
- 0.00066567765, 0.21386915445, 0.67551922798, 0.10996460915,
- 0.00073179678, 0.21846942604, 0.67391467094, 0.10690483451,
- 0.00080365466, 0.22311829031, 0.67219948769, 0.10390164703,
- 0.00088037323, 0.22781492770, 0.67037439346, 0.10095486045,
- 0.00096255314, 0.23255851865, 0.66844022274, 0.09806428105,
- 0.00105048984, 0.23734821379, 0.66639786959, 0.09522963315,
- 0.00114431616, 0.24218304455, 0.66424828768, 0.09245070815,
- 0.00124442333, 0.24706205726, 0.66199249029, 0.08972713351,
- 0.00135110028, 0.25198432803, 0.65963155031, 0.08705867827,
- 0.00146482687, 0.25694879889, 0.65716648102, 0.08444493264,
- 0.00158570008, 0.26195442677, 0.65459835529, 0.08188561350,
- 0.00171401864, 0.26700007915, 0.65192854404, 0.07938029617,
- 0.00185023469, 0.27208462358, 0.64915806055, 0.07692859322,
- 0.00199495023, 0.27720692754, 0.64628833532, 0.07453006506,
- 0.00214785640, 0.28236576915, 0.64332056046, 0.07218432426,
- 0.00231004250, 0.28755992651, 0.64025616646, 0.06989086419,
- 0.00248134881, 0.29278811812, 0.63709646463, 0.06764923781,
- 0.00266251224, 0.29804900289, 0.63384294510, 0.06545893103,
- 0.00285378192, 0.30334126949, 0.63049703836, 0.06331945211,
- 0.00305565330, 0.30866351724, 0.62706029415, 0.06123027951,
- 0.00326841651, 0.31401440501, 0.62353414297, 0.05919086933,
- 0.00349264755, 0.31939238310, 0.61992025375, 0.05720067024,
- 0.00372874714, 0.32479602098, 0.61622029543, 0.05525910854,
- 0.00397720048, 0.33022382855, 0.61243581772, 0.05336561054,
- 0.00423829490, 0.33567428589, 0.60856848955, 0.05151961371,
- 0.00451271003, 0.34114575386, 0.60462015867, 0.04972046614,
- 0.00480085658, 0.34663668275, 0.60059231520, 0.04796761274,
- 0.00510312291, 0.35214546323, 0.59648692608, 0.04626038298,
- 0.00542017492, 0.35767036676, 0.59230577946, 0.04459818453,
- 0.00575236930, 0.36320972443, 0.58805054426, 0.04298033938,
- 0.00610029325, 0.36876192689, 0.58372318745, 0.04140623659,
- 0.00646453211, 0.37432509661, 0.57932555676, 0.03987516090,
- 0.00684553990, 0.37989753485, 0.57485944033, 0.03838652745,
- 0.00724391919, 0.38547745347, 0.57032698393, 0.03693958372,
- 0.00766016589, 0.39106300473, 0.56572991610, 0.03553372994,
- 0.00809498038, 0.39665243030, 0.56107026339, 0.03416819125,
- 0.00854881573, 0.40224379301, 0.55634999275, 0.03284239396,
- 0.00902230106, 0.40783521533, 0.55157101154, 0.03155555204,
- 0.00951600447, 0.41342487931, 0.54673534632, 0.03030703776,
- 0.01003060210, 0.41901078820, 0.54184508324, 0.02909611352,
- 0.01056654565, 0.42459106445, 0.53690224886, 0.02792212367,
- 0.01112466771, 0.43016362190, 0.53190881014, 0.02678431384,
- 0.01170534454, 0.43572667241, 0.52686679363, 0.02568206564,
- 0.01230939943, 0.44127810001, 0.52177828550, 0.02461459488,
- 0.01293735672, 0.44681602716, 0.51664537191, 0.02358125709,
- 0.01358995494, 0.45233830810, 0.51147013903, 0.02258131653,
- 0.01426773332, 0.45784294605, 0.50625455379, 0.02161412500,
- 0.01497144438, 0.46332800388, 0.50100076199, 0.02067894675,
- 0.01570170000, 0.46879136562, 0.49571081996, 0.01977507770,
- 0.01645922661, 0.47423094511, 0.49038675427, 0.01890186779,
- 0.01724460535, 0.47964480519, 0.48503074050, 0.01805862412,
+ SCALE(0.00053168571), SCALE(0.15878495574), SCALE(0.68603444099), SCALE(0.15492856503),
+ SCALE(0.00016358691), SCALE(0.16269733012), SCALE(0.68591803312), SCALE(0.15112841129),
+ SCALE(0.00018878609), SCALE(0.16666537523), SCALE(0.68568539619), SCALE(0.14738474786),
+ SCALE(0.00021643363), SCALE(0.17068879306), SCALE(0.68533653021), SCALE(0.14369773865),
+ SCALE(0.00024667382), SCALE(0.17476719618), SCALE(0.68487155437), SCALE(0.14006754756),
+ SCALE(0.00027949660), SCALE(0.17890018225), SCALE(0.68429082632), SCALE(0.13649433851),
+ SCALE(0.00031519096), SCALE(0.18308731914), SCALE(0.68359452486), SCALE(0.13297818601),
+ SCALE(0.00035398375), SCALE(0.18732811511), SCALE(0.68278300762), SCALE(0.12951917946),
+ SCALE(0.00039634691), SCALE(0.19162209332), SCALE(0.68185669184), SCALE(0.12611730397),
+ SCALE(0.00044236859), SCALE(0.19596865773), SCALE(0.68081587553), SCALE(0.12277261168),
+ SCALE(0.00049204525), SCALE(0.20036731660), SCALE(0.67966115475), SCALE(0.11948505789),
+ SCALE(0.00054522208), SCALE(0.20481738448), SCALE(0.67839306593), SCALE(0.11625462025),
+ SCALE(0.00060277141), SCALE(0.20931822062), SCALE(0.67701220512), SCALE(0.11308115721),
+ SCALE(0.00066567765), SCALE(0.21386915445), SCALE(0.67551922798), SCALE(0.10996460915),
+ SCALE(0.00073179678), SCALE(0.21846942604), SCALE(0.67391467094), SCALE(0.10690483451),
+ SCALE(0.00080365466), SCALE(0.22311829031), SCALE(0.67219948769), SCALE(0.10390164703),
+ SCALE(0.00088037323), SCALE(0.22781492770), SCALE(0.67037439346), SCALE(0.10095486045),
+ SCALE(0.00096255314), SCALE(0.23255851865), SCALE(0.66844022274), SCALE(0.09806428105),
+ SCALE(0.00105048984), SCALE(0.23734821379), SCALE(0.66639786959), SCALE(0.09522963315),
+ SCALE(0.00114431616), SCALE(0.24218304455), SCALE(0.66424828768), SCALE(0.09245070815),
+ SCALE(0.00124442333), SCALE(0.24706205726), SCALE(0.66199249029), SCALE(0.08972713351),
+ SCALE(0.00135110028), SCALE(0.25198432803), SCALE(0.65963155031), SCALE(0.08705867827),
+ SCALE(0.00146482687), SCALE(0.25694879889), SCALE(0.65716648102), SCALE(0.08444493264),
+ SCALE(0.00158570008), SCALE(0.26195442677), SCALE(0.65459835529), SCALE(0.08188561350),
+ SCALE(0.00171401864), SCALE(0.26700007915), SCALE(0.65192854404), SCALE(0.07938029617),
+ SCALE(0.00185023469), SCALE(0.27208462358), SCALE(0.64915806055), SCALE(0.07692859322),
+ SCALE(0.00199495023), SCALE(0.27720692754), SCALE(0.64628833532), SCALE(0.07453006506),
+ SCALE(0.00214785640), SCALE(0.28236576915), SCALE(0.64332056046), SCALE(0.07218432426),
+ SCALE(0.00231004250), SCALE(0.28755992651), SCALE(0.64025616646), SCALE(0.06989086419),
+ SCALE(0.00248134881), SCALE(0.29278811812), SCALE(0.63709646463), SCALE(0.06764923781),
+ SCALE(0.00266251224), SCALE(0.29804900289), SCALE(0.63384294510), SCALE(0.06545893103),
+ SCALE(0.00285378192), SCALE(0.30334126949), SCALE(0.63049703836), SCALE(0.06331945211),
+ SCALE(0.00305565330), SCALE(0.30866351724), SCALE(0.62706029415), SCALE(0.06123027951),
+ SCALE(0.00326841651), SCALE(0.31401440501), SCALE(0.62353414297), SCALE(0.05919086933),
+ SCALE(0.00349264755), SCALE(0.31939238310), SCALE(0.61992025375), SCALE(0.05720067024),
+ SCALE(0.00372874714), SCALE(0.32479602098), SCALE(0.61622029543), SCALE(0.05525910854),
+ SCALE(0.00397720048), SCALE(0.33022382855), SCALE(0.61243581772), SCALE(0.05336561054),
+ SCALE(0.00423829490), SCALE(0.33567428589), SCALE(0.60856848955), SCALE(0.05151961371),
+ SCALE(0.00451271003), SCALE(0.34114575386), SCALE(0.60462015867), SCALE(0.04972046614),
+ SCALE(0.00480085658), SCALE(0.34663668275), SCALE(0.60059231520), SCALE(0.04796761274),
+ SCALE(0.00510312291), SCALE(0.35214546323), SCALE(0.59648692608), SCALE(0.04626038298),
+ SCALE(0.00542017492), SCALE(0.35767036676), SCALE(0.59230577946), SCALE(0.04459818453),
+ SCALE(0.00575236930), SCALE(0.36320972443), SCALE(0.58805054426), SCALE(0.04298033938),
+ SCALE(0.00610029325), SCALE(0.36876192689), SCALE(0.58372318745), SCALE(0.04140623659),
+ SCALE(0.00646453211), SCALE(0.37432509661), SCALE(0.57932555676), SCALE(0.03987516090),
+ SCALE(0.00684553990), SCALE(0.37989753485), SCALE(0.57485944033), SCALE(0.03838652745),
+ SCALE(0.00724391919), SCALE(0.38547745347), SCALE(0.57032698393), SCALE(0.03693958372),
+ SCALE(0.00766016589), SCALE(0.39106300473), SCALE(0.56572991610), SCALE(0.03553372994),
+ SCALE(0.00809498038), SCALE(0.39665243030), SCALE(0.56107026339), SCALE(0.03416819125),
+ SCALE(0.00854881573), SCALE(0.40224379301), SCALE(0.55634999275), SCALE(0.03284239396),
+ SCALE(0.00902230106), SCALE(0.40783521533), SCALE(0.55157101154), SCALE(0.03155555204),
+ SCALE(0.00951600447), SCALE(0.41342487931), SCALE(0.54673534632), SCALE(0.03030703776),
+ SCALE(0.01003060210), SCALE(0.41901078820), SCALE(0.54184508324), SCALE(0.02909611352),
+ SCALE(0.01056654565), SCALE(0.42459106445), SCALE(0.53690224886), SCALE(0.02792212367),
+ SCALE(0.01112466771), SCALE(0.43016362190), SCALE(0.53190881014), SCALE(0.02678431384),
+ SCALE(0.01170534454), SCALE(0.43572667241), SCALE(0.52686679363), SCALE(0.02568206564),
+ SCALE(0.01230939943), SCALE(0.44127810001), SCALE(0.52177828550), SCALE(0.02461459488),
+ SCALE(0.01293735672), SCALE(0.44681602716), SCALE(0.51664537191), SCALE(0.02358125709),
+ SCALE(0.01358995494), SCALE(0.45233830810), SCALE(0.51147013903), SCALE(0.02258131653),
+ SCALE(0.01426773332), SCALE(0.45784294605), SCALE(0.50625455379), SCALE(0.02161412500),
+ SCALE(0.01497144438), SCALE(0.46332800388), SCALE(0.50100076199), SCALE(0.02067894675),
+ SCALE(0.01570170000), SCALE(0.46879136562), SCALE(0.49571081996), SCALE(0.01977507770),
+ SCALE(0.01645922661), SCALE(0.47423094511), SCALE(0.49038675427), SCALE(0.01890186779),
+ SCALE(0.01724460535), SCALE(0.47964480519), SCALE(0.48503074050), SCALE(0.01805862412),
};
+#undef SCALE
/*
* D.11 Look-up Table for Downmix Scale Factors
diff --git a/chromium/third_party/ffmpeg/libavcodec/dcadec.c b/chromium/third_party/ffmpeg/libavcodec/dcadec.c
index cc2fa0af12e..6a9dfa34d43 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dcadec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dcadec.c
@@ -53,7 +53,6 @@
//#define TRACE
#define DCA_PRIM_CHANNELS_MAX (7)
-#define DCA_SUBBANDS (64)
#define DCA_ABITS_MAX (32) /* Should be 28 */
#define DCA_SUBSUBFRAMES_MAX (4)
#define DCA_SUBFRAMES_MAX (16)
@@ -400,7 +399,7 @@ typedef struct {
int prediction_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< prediction VQ coefs
int bitalloc[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< bit allocation index
int transition_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< transition mode (transients)
- int scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][2]; ///< scale factors (2 if transient)
+ int32_t scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][2];///< scale factors (2 if transient)
int joint_huff[DCA_PRIM_CHANNELS_MAX]; ///< joint subband scale factors codebook
int joint_scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< joint subband scale factors
float downmix_coef[DCA_PRIM_CHANNELS_MAX + 1][2]; ///< stereo downmix coefficients
@@ -413,7 +412,7 @@ typedef struct {
uint8_t core_downmix_amode; ///< audio channel arrangement of embedded downmix
uint16_t core_downmix_codes[DCA_PRIM_CHANNELS_MAX + 1][4]; ///< embedded downmix coefficients (9-bit codes)
- int high_freq_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< VQ encoded high frequency subbands
+ int32_t high_freq_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< VQ encoded high frequency subbands
float lfe_data[2 * DCA_LFE_MAX * (DCA_BLOCKS_MAX + 4)]; ///< Low frequency effect data
int lfe_scale_factor;
@@ -1105,7 +1104,7 @@ static void qmf_32_subbands(DCAContext *s, int chans,
static void lfe_interpolation_fir(DCAContext *s, int decimation_select,
int num_deci_sample, float *samples_in,
- float *samples_out, float scale)
+ float *samples_out)
{
/* samples_in: An array holding decimated samples.
* Samples in current subframe starts from samples_in[0],
@@ -1115,23 +1114,23 @@ static void lfe_interpolation_fir(DCAContext *s, int decimation_select,
* samples_out: An array holding interpolated samples
*/
- int decifactor;
+ int idx;
const float *prCoeff;
int deciindex;
/* Select decimation filter */
if (decimation_select == 1) {
- decifactor = 64;
+ idx = 1;
prCoeff = lfe_fir_128;
} else {
- decifactor = 32;
+ idx = 0;
prCoeff = lfe_fir_64;
}
/* Interpolation */
for (deciindex = 0; deciindex < num_deci_sample; deciindex++) {
- s->dcadsp.lfe_fir(samples_out, samples_in, prCoeff, decifactor, scale);
+ s->dcadsp.lfe_fir[idx](samples_out, samples_in, prCoeff);
samples_in++;
- samples_out += 2 * decifactor;
+ samples_out += 2 * 32 * (1 + idx);
}
}
@@ -1246,16 +1245,6 @@ static int decode_blockcodes(int code1, int code2, int levels, int32_t *values)
static const uint8_t abits_sizes[7] = { 7, 10, 12, 13, 15, 17, 19 };
static const uint8_t abits_levels[7] = { 3, 5, 7, 9, 13, 17, 25 };
-#ifndef int8x8_fmul_int32
-static inline void int8x8_fmul_int32(float *dst, const int8_t *src, int scale)
-{
- float fscale = scale / 16.0;
- int i;
- for (i = 0; i < 8; i++)
- dst[i] = src[i] * fscale;
-}
-#endif
-
static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
{
int k, l;
@@ -1352,16 +1341,27 @@ static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
*/
if (s->prediction_mode[k][l]) {
int n;
- for (m = 0; m < 8; m++) {
- for (n = 1; n <= 4; n++)
+ if (s->predictor_history)
+ subband_samples[k][l][0] += (adpcm_vb[s->prediction_vq[k][l]][0] *
+ s->subband_samples_hist[k][l][3] +
+ adpcm_vb[s->prediction_vq[k][l]][1] *
+ s->subband_samples_hist[k][l][2] +
+ adpcm_vb[s->prediction_vq[k][l]][2] *
+ s->subband_samples_hist[k][l][1] +
+ adpcm_vb[s->prediction_vq[k][l]][3] *
+ s->subband_samples_hist[k][l][0]) *
+ (1.0f / 8192);
+ for (m = 1; m < 8; m++) {
+ float sum = adpcm_vb[s->prediction_vq[k][l]][0] *
+ subband_samples[k][l][m - 1];
+ for (n = 2; n <= 4; n++)
if (m >= n)
- subband_samples[k][l][m] +=
- (adpcm_vb[s->prediction_vq[k][l]][n - 1] *
- subband_samples[k][l][m - n] / 8192);
+ sum += adpcm_vb[s->prediction_vq[k][l]][n - 1] *
+ subband_samples[k][l][m - n];
else if (s->predictor_history)
- subband_samples[k][l][m] +=
- (adpcm_vb[s->prediction_vq[k][l]][n - 1] *
- s->subband_samples_hist[k][l][m - n + 4] / 8192);
+ sum += adpcm_vb[s->prediction_vq[k][l]][n - 1] *
+ s->subband_samples_hist[k][l][m - n + 4];
+ subband_samples[k][l][m] += sum * (1.0f / 8192);
}
}
}
@@ -1369,20 +1369,16 @@ static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
/*
* Decode VQ encoded high frequencies
*/
- for (l = s->vq_start_subband[k]; l < s->subband_activity[k]; l++) {
- /* 1 vector -> 32 samples but we only need the 8 samples
- * for this subsubframe. */
- int hfvq = s->high_freq_vq[k][l];
-
- if (!s->debug_flag & 0x01) {
+ if (s->subband_activity[k] > s->vq_start_subband[k]) {
+ if (!(s->debug_flag & 0x01)) {
av_log(s->avctx, AV_LOG_DEBUG,
"Stream with high frequencies VQ coding\n");
s->debug_flag |= 0x01;
}
-
- int8x8_fmul_int32(subband_samples[k][l],
- &high_freq_vq[hfvq][subsubframe * 8],
- s->scale_factor[k][l][0]);
+ s->dcadsp.decode_hf(subband_samples[k], s->high_freq_vq[k],
+ high_freq_vq, subsubframe * 8,
+ s->scale_factor[k], s->vq_start_subband[k],
+ s->subband_activity[k]);
}
}
@@ -1401,9 +1397,7 @@ static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
/* Backup predictor history for adpcm */
for (k = base_channel; k < s->prim_channels; k++)
for (l = 0; l < s->vq_start_subband[k]; l++)
- memcpy(s->subband_samples_hist[k][l],
- &subband_samples[k][l][4],
- 4 * sizeof(subband_samples[0][0][0]));
+ AV_COPY128(s->subband_samples_hist[k][l], &subband_samples[k][l][4]);
return 0;
}
@@ -1427,8 +1421,7 @@ static int dca_filter_channels(DCAContext *s, int block_index)
if (s->lfe) {
lfe_interpolation_fir(s, s->lfe, 2 * s->lfe,
s->lfe_data + 2 * s->lfe * (block_index + 4),
- s->samples_chanptr[s->lfe_index],
- 1.0 / (256.0 * 32768.0));
+ s->samples_chanptr[s->lfe_index]);
/* Outputs 20bits pcm samples */
}
@@ -2071,6 +2064,8 @@ static void dca_exss_parse_header(DCAContext *s)
}
}
+ av_assert0(num_assets > 0); // silence a warning
+
for (i = 0; i < num_assets; i++)
asset_size[i] = get_bits_long(&s->gb, 16 + 4 * blownup);
@@ -2082,7 +2077,6 @@ static void dca_exss_parse_header(DCAContext *s)
/* not parsed further, we were only interested in the extensions mask
* from the asset header */
- if (num_assets > 0) {
j = get_bits_count(&s->gb);
if (start_posn + hdrsize * 8 > j)
skip_bits_long(&s->gb, start_posn + hdrsize * 8 - j);
@@ -2107,7 +2101,6 @@ static void dca_exss_parse_header(DCAContext *s)
if (start_posn + asset_size[i] * 8 > j)
skip_bits_long(&s->gb, start_posn + asset_size[i] * 8 - j);
}
- }
}
/**
@@ -2149,7 +2142,6 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
- init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8);
if ((ret = dca_parse_frame_header(s)) < 0) {
//seems like the frame is corrupt, try with the next one
return ret;
@@ -2180,7 +2172,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
if (s->core_downmix && (s->core_downmix_amode == DCA_STEREO ||
s->core_downmix_amode == DCA_STEREO_TOTAL)) {
int sign, code;
- for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
+ for (i = 0; i < num_core_channels + !!s->lfe; i++) {
sign = s->core_downmix_codes[i][0] & 0x100 ? 1 : -1;
code = s->core_downmix_codes[i][0] & 0x0FF;
s->downmix_coef[i][0] = (!code ? 0.0f :
@@ -2190,6 +2182,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
s->downmix_coef[i][1] = (!code ? 0.0f :
sign * dca_dmixtable[code - 1]);
}
+ s->output = s->core_downmix_amode;
} else {
int am = s->amode & DCA_CHANNEL_MASK;
if (am >= FF_ARRAY_ELEMS(dca_default_coeffs)) {
@@ -2197,19 +2190,19 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
"Invalid channel mode %d\n", am);
return AVERROR_INVALIDDATA;
}
- if (s->prim_channels + !!s->lfe >
+ if (num_core_channels + !!s->lfe >
FF_ARRAY_ELEMS(dca_default_coeffs[0])) {
avpriv_request_sample(s->avctx, "Downmixing %d channels",
s->prim_channels + !!s->lfe);
return AVERROR_PATCHWELCOME;
}
- for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
+ for (i = 0; i < num_core_channels + !!s->lfe; i++) {
s->downmix_coef[i][0] = dca_default_coeffs[am][i][0];
s->downmix_coef[i][1] = dca_default_coeffs[am][i][1];
}
}
av_dlog(s->avctx, "Stereo downmix coeffs:\n");
- for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
+ for (i = 0; i < num_core_channels + !!s->lfe; i++) {
av_dlog(s->avctx, "L, input channel %d = %f\n", i,
s->downmix_coef[i][0]);
av_dlog(s->avctx, "R, input channel %d = %f\n", i,
@@ -2335,6 +2328,17 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
{ /* xxx should also do MA extensions */
if (s->amode < 16) {
avctx->channel_layout = dca_core_channel_layout[s->amode];
+
+ if (s->prim_channels + !!s->lfe > 2 &&
+ avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
+ /*
+ * Neither the core's auxiliary data nor our default tables contain
+ * downmix coefficients for the additional channel coded in the XCh
+ * extension, so when we're doing a Stereo downmix, don't decode it.
+ */
+ s->xch_disable = 1;
+ }
+
#if FF_API_REQUEST_CHANNELS
FF_DISABLE_DEPRECATION_WARNINGS
if (s->xch_present && !s->xch_disable &&
@@ -2372,10 +2376,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
return AVERROR_INVALIDDATA;
}
- if (s->prim_channels + !!s->lfe > 2 &&
+ if (num_core_channels + !!s->lfe > 2 &&
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
channels = 2;
- s->output = DCA_STEREO;
+ s->output = s->prim_channels == 2 ? s->amode : DCA_STEREO;
avctx->channel_layout = AV_CH_LAYOUT_STEREO;
}
else if (avctx->request_channel_layout & AV_CH_LAYOUT_NATIVE) {
@@ -2421,7 +2425,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
* masks in some sense -- unfortunately some channels could overlap */
if (av_popcount(channel_mask) != av_popcount(channel_layout)) {
av_log(avctx, AV_LOG_DEBUG,
- "DTS-XXCH: Inconsistant avcodec/dts channel layouts\n");
+ "DTS-XXCH: Inconsistent avcodec/dts channel layouts\n");
return AVERROR_INVALIDDATA;
}
@@ -2439,6 +2443,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
s->xxch_order_tab[j++] = posn;
}
}
+
}
s->lfe_index = av_popcount(channel_layout & (AV_CH_LOW_FREQUENCY-1));
@@ -2559,6 +2564,15 @@ FF_ENABLE_DEPRECATION_WARNINGS
for (i = 0; i < 2 * s->lfe * 4; i++)
s->lfe_data[i] = s->lfe_data[i + lfe_samples];
+ /* AVMatrixEncoding
+ *
+ * DCA_STEREO_TOTAL (Lt/Rt) is equivalent to Dolby Surround */
+ ret = ff_side_data_update_matrix_encoding(frame,
+ (s->output & ~DCA_LFE) == DCA_STEREO_TOTAL ?
+ AV_MATRIX_ENCODING_DOLBY : AV_MATRIX_ENCODING_NONE);
+ if (ret < 0)
+ return ret;
+
*got_frame_ptr = 1;
return buf_size;
diff --git a/chromium/third_party/ffmpeg/libavcodec/dcadsp.c b/chromium/third_party/ffmpeg/libavcodec/dcadsp.c
index abeba2492bf..7d5044298a0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dcadsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dcadsp.c
@@ -24,25 +24,42 @@
#include "libavutil/intreadwrite.h"
#include "dcadsp.h"
-static void dca_lfe_fir_c(float *out, const float *in, const float *coefs,
- int decifactor, float scale)
+static void decode_hf_c(float dst[DCA_SUBBANDS][8],
+ const int32_t vq_num[DCA_SUBBANDS],
+ const int8_t hf_vq[1024][32], intptr_t vq_offset,
+ int32_t scale[DCA_SUBBANDS][2],
+ intptr_t start, intptr_t end)
{
- float *out2 = out + decifactor;
- const float *cf0 = coefs;
- const float *cf1 = coefs + 256;
+ int i, l;
+
+ for (l = start; l < end; l++) {
+ /* 1 vector -> 32 samples but we only need the 8 samples
+ * for this subsubframe. */
+ const int8_t *ptr = &hf_vq[vq_num[l]][vq_offset];
+ float fscale = scale[l][0] * (1 / 16.0);
+ for (i = 0; i < 8; i++)
+ dst[l][i] = ptr[i] * fscale;
+ }
+}
+
+static inline void
+dca_lfe_fir(float *out, const float *in, const float *coefs,
+ int decifactor)
+{
+ float *out2 = out + 2 * decifactor - 1;
+ int num_coeffs = 256 / decifactor;
int j, k;
/* One decimated sample generates 2*decifactor interpolated ones */
for (k = 0; k < decifactor; k++) {
float v0 = 0.0;
float v1 = 0.0;
- for (j = 0; j < 256 / decifactor; j++) {
- float s = in[-j];
- v0 += s * *cf0++;
- v1 += s * *--cf1;
+ for (j = 0; j < num_coeffs; j++, coefs++) {
+ v0 += in[-j] * *coefs;
+ v1 += in[j + 1 - num_coeffs] * *coefs;
}
- *out++ = v0 * scale;
- *out2++ = v1 * scale;
+ *out++ = v0;
+ *out2-- = v1;
}
}
@@ -74,9 +91,22 @@ static void dca_qmf_32_subbands(float samples_in[32][8], int sb_act,
}
}
+static void dca_lfe_fir0_c(float *out, const float *in, const float *coefs)
+{
+ dca_lfe_fir(out, in, coefs, 32);
+}
+
+static void dca_lfe_fir1_c(float *out, const float *in, const float *coefs)
+{
+ dca_lfe_fir(out, in, coefs, 64);
+}
+
av_cold void ff_dcadsp_init(DCADSPContext *s)
{
- s->lfe_fir = dca_lfe_fir_c;
+ s->lfe_fir[0] = dca_lfe_fir0_c;
+ s->lfe_fir[1] = dca_lfe_fir1_c;
s->qmf_32_subbands = dca_qmf_32_subbands;
+ s->decode_hf = decode_hf_c;
if (ARCH_ARM) ff_dcadsp_init_arm(s);
+ if (ARCH_X86) ff_dcadsp_init_x86(s);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dcadsp.h b/chromium/third_party/ffmpeg/libavcodec/dcadsp.h
index d86c1f32a6d..abf577b61fa 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dcadsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dcadsp.h
@@ -22,18 +22,25 @@
#include "avfft.h"
#include "synth_filter.h"
+#define DCA_SUBBANDS 64
+
typedef struct DCADSPContext {
- void (*lfe_fir)(float *out, const float *in, const float *coefs,
- int decifactor, float scale);
+ void (*lfe_fir[2])(float *out, const float *in, const float *coefs);
void (*qmf_32_subbands)(float samples_in[32][8], int sb_act,
SynthFilterContext *synth, FFTContext *imdct,
float synth_buf_ptr[512],
int *synth_buf_offset, float synth_buf2[32],
const float window[512], float *samples_out,
float raXin[32], float scale);
+ void (*decode_hf)(float dst[DCA_SUBBANDS][8],
+ const int32_t vq_num[DCA_SUBBANDS],
+ const int8_t hf_vq[1024][32], intptr_t vq_offset,
+ int32_t scale[DCA_SUBBANDS][2],
+ intptr_t start, intptr_t end);
} DCADSPContext;
void ff_dcadsp_init(DCADSPContext *s);
void ff_dcadsp_init_arm(DCADSPContext *s);
+void ff_dcadsp_init_x86(DCADSPContext *s);
#endif /* AVCODEC_DCADSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/dcaenc.c b/chromium/third_party/ffmpeg/libavcodec/dcaenc.c
index cb73f42a078..8d0655ddcfe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dcaenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dcaenc.c
@@ -29,6 +29,7 @@
#include "dcadata.h"
#include "dcaenc.h"
#include "internal.h"
+#include "mathops.h"
#include "put_bits.h"
#define MAX_CHANNELS 6
diff --git a/chromium/third_party/ffmpeg/libavcodec/dct-test.c b/chromium/third_party/ffmpeg/libavcodec/dct-test.c
index 547ea02a219..63083483617 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dct-test.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dct-test.c
@@ -99,6 +99,18 @@ static const struct algo fdct_tab[] = {
{ 0 }
};
+static void ff_prores_idct_wrap(int16_t *dst){
+ DECLARE_ALIGNED(16, static int16_t, qmat)[64];
+ int i;
+
+ for(i=0; i<64; i++){
+ qmat[i]=4;
+ }
+ ff_prores_idct(dst, qmat);
+ for(i=0; i<64; i++) {
+ dst[i] -= 512;
+ }
+}
#if ARCH_X86_64 && HAVE_MMX && HAVE_YASM
void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
int16_t *block, int16_t *qmat);
@@ -113,6 +125,10 @@ static void ff_prores_idct_put_10_sse2_wrap(int16_t *dst){
tmp[i]= dst[i];
}
ff_prores_idct_put_10_sse2(dst, 16, tmp, qmat);
+
+ for(i=0; i<64; i++) {
+ dst[i] -= 512;
+ }
}
#endif
@@ -121,6 +137,7 @@ static const struct algo idct_tab[] = {
{ "REF-DBL", ff_ref_idct, NO_PERM },
{ "INT", ff_j_rev_dct, MMX_PERM },
{ "SIMPLE-C", ff_simple_idct_8, NO_PERM },
+ { "PR-C", ff_prores_idct_wrap, NO_PERM, 0, 1 },
#if HAVE_MMX_INLINE
{ "SIMPLE-MMX", ff_simple_idct_mmx, MMX_SIMPLE_PERM, AV_CPU_FLAG_MMX },
@@ -150,7 +167,7 @@ static const struct algo idct_tab[] = {
#if HAVE_ARMV6
{ "SIMPLE-ARMV6", ff_simple_idct_armv6, MMX_PERM, AV_CPU_FLAG_ARMV6 },
#endif
-#if HAVE_NEON
+#if HAVE_NEON && ARCH_ARM
{ "SIMPLE-NEON", ff_simple_idct_neon, PARTTRANS_PERM, AV_CPU_FLAG_NEON },
#endif
@@ -280,6 +297,9 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c
}
ref(block1);
+ if (!strcmp(dct->name, "PR-SSE2"))
+ for (i = 0; i < 64; i++)
+ block1[i] = av_clip(block1[i], 4-512, 1019-512);
blockSumErr = 0;
for (i = 0; i < 64; i++) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/dct.c b/chromium/third_party/ffmpeg/libavcodec/dct.c
index b1ee06a8178..26b485106d2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dct.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dct.c
@@ -190,7 +190,7 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
ff_init_ff_cos_tabs(nbits + 2);
s->costab = ff_cos_tabs[nbits + 2];
- s->csc2 = av_malloc(n / 2 * sizeof(FFTSample));
+ s->csc2 = av_malloc_array(n / 2, sizeof(FFTSample));
if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) {
av_free(s->csc2);
diff --git a/chromium/third_party/ffmpeg/libavcodec/dfa.c b/chromium/third_party/ffmpeg/libavcodec/dfa.c
index b1be475ef21..f13291ef28a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dfa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dfa.c
@@ -20,11 +20,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/avassert.h"
+#include <inttypes.h>
+
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
+#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
@@ -369,7 +371,8 @@ static int dfa_decode_frame(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
}
} else {
- av_log(avctx, AV_LOG_WARNING, "Ignoring unknown chunk type %d\n",
+ av_log(avctx, AV_LOG_WARNING,
+ "Ignoring unknown chunk type %"PRIu32"\n",
chunk_type);
}
buf += chunk_size;
diff --git a/chromium/third_party/ffmpeg/libavcodec/dirac_arith.h b/chromium/third_party/ffmpeg/libavcodec/dirac_arith.h
index f9a8bba5fd7..089c71a6983 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dirac_arith.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dirac_arith.h
@@ -28,6 +28,7 @@
#ifndef AVCODEC_DIRAC_ARITH_H
#define AVCODEC_DIRAC_ARITH_H
+#include "libavutil/x86/asm.h"
#include "bytestream.h"
#include "get_bits.h"
@@ -134,7 +135,7 @@ static inline int dirac_get_arith_bit(DiracArith *c, int ctx)
range_times_prob = (c->range * prob_zero) >> 16;
-#if HAVE_FAST_CMOV && HAVE_INLINE_ASM
+#if HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS
low -= range_times_prob << 16;
range -= range_times_prob;
bit = 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/dirac_dwt.c b/chromium/third_party/ffmpeg/libavcodec/dirac_dwt.c
index bbd8ec74a6b..51a924be958 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dirac_dwt.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dirac_dwt.c
@@ -535,6 +535,7 @@ int ff_spatial_idwt_init2(DWTContext *d, IDWTELEM *buffer, int width, int height
d->vertical_compose_l0 = (void*)vertical_compose_fidelityiL0;
d->vertical_compose_h0 = (void*)vertical_compose_fidelityiH0;
d->horizontal_compose = horizontal_compose_fidelityi;
+ d->support = 0; // not really used
break;
case DWT_DIRAC_DAUB9_7:
d->spatial_compose = spatial_compose_daub97i_dy;
diff --git a/chromium/third_party/ffmpeg/libavcodec/dirac_dwt.h b/chromium/third_party/ffmpeg/libavcodec/dirac_dwt.h
index 25c13d1a656..e5e447b0ac6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dirac_dwt.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dirac_dwt.h
@@ -82,7 +82,7 @@ int ff_spatial_idwt_init2(DWTContext *d, IDWTELEM *buffer, int width, int height
void ff_spatial_idwt_slice2(DWTContext *d, int y);
-// shared stuff for simd optimiztions
+// shared stuff for simd optimizations
#define COMPOSE_53iL0(b0, b1, b2)\
(b1 - ((b0 + b2 + 2) >> 2))
diff --git a/chromium/third_party/ffmpeg/libavcodec/diracdec.c b/chromium/third_party/ffmpeg/libavcodec/diracdec.c
index dbc2aab3348..1be4115c59c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/diracdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/diracdec.c
@@ -80,7 +80,7 @@
#define DIVRNDUP(a, b) (((a) + (b) - 1) / (b))
typedef struct {
- AVFrame avframe;
+ AVFrame *avframe;
int interpolated[3]; /* 1 if hpel[] is valid */
uint8_t *hpel[3][4];
uint8_t *hpel_base[3][4];
@@ -291,7 +291,7 @@ static DiracFrame *remove_frame(DiracFrame *framelist[], int picnum)
int i, remove_idx = -1;
for (i = 0; framelist[i]; i++)
- if (framelist[i]->avframe.display_picture_number == picnum) {
+ if (framelist[i]->avframe->display_picture_number == picnum) {
remove_pic = framelist[i];
remove_idx = i;
}
@@ -336,8 +336,8 @@ static int alloc_sequence_buffers(DiracContext *s)
w = FFALIGN(CALC_PADDING(w, MAX_DWT_LEVELS), 8); /* FIXME: Should this be 16 for SSE??? */
h = top_padding + CALC_PADDING(h, MAX_DWT_LEVELS) + max_yblen/2;
- s->plane[i].idwt_buf_base = av_mallocz((w+max_xblen)*h * sizeof(IDWTELEM));
- s->plane[i].idwt_tmp = av_malloc((w+16) * sizeof(IDWTELEM));
+ s->plane[i].idwt_buf_base = av_mallocz_array((w+max_xblen), h * sizeof(IDWTELEM));
+ s->plane[i].idwt_tmp = av_malloc_array((w+16), sizeof(IDWTELEM));
s->plane[i].idwt_buf = s->plane[i].idwt_buf_base + top_padding*w;
if (!s->plane[i].idwt_buf_base || !s->plane[i].idwt_tmp)
return AVERROR(ENOMEM);
@@ -347,12 +347,12 @@ static int alloc_sequence_buffers(DiracContext *s)
h = s->source.height;
/* fixme: allocate using real stride here */
- s->sbsplit = av_malloc(sbwidth * sbheight);
- s->blmotion = av_malloc(sbwidth * sbheight * 16 * sizeof(*s->blmotion));
- s->edge_emu_buffer_base = av_malloc((w+64)*MAX_BLOCKSIZE);
+ s->sbsplit = av_malloc_array(sbwidth, sbheight);
+ s->blmotion = av_malloc_array(sbwidth, sbheight * 16 * sizeof(*s->blmotion));
+ s->edge_emu_buffer_base = av_malloc_array((w+64), MAX_BLOCKSIZE);
- s->mctmp = av_malloc((w+64+MAX_BLOCKSIZE) * (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
- s->mcscratch = av_malloc((w+64)*MAX_BLOCKSIZE);
+ s->mctmp = av_malloc_array((w+64+MAX_BLOCKSIZE), (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
+ s->mcscratch = av_malloc_array((w+64), MAX_BLOCKSIZE);
if (!s->sbsplit || !s->blmotion || !s->mctmp || !s->mcscratch)
return AVERROR(ENOMEM);
@@ -364,8 +364,8 @@ static void free_sequence_buffers(DiracContext *s)
int i, j, k;
for (i = 0; i < MAX_FRAMES; i++) {
- if (s->all_frames[i].avframe.data[0]) {
- av_frame_unref(&s->all_frames[i].avframe);
+ if (s->all_frames[i].avframe->data[0]) {
+ av_frame_unref(s->all_frames[i].avframe);
memset(s->all_frames[i].interpolated, 0, sizeof(s->all_frames[i].interpolated));
}
@@ -393,17 +393,23 @@ static void free_sequence_buffers(DiracContext *s)
static av_cold int dirac_decode_init(AVCodecContext *avctx)
{
DiracContext *s = avctx->priv_data;
+ int i;
+
s->avctx = avctx;
s->frame_number = -1;
- if (avctx->flags&CODEC_FLAG_EMU_EDGE) {
- av_log(avctx, AV_LOG_ERROR, "Edge emulation not supported!\n");
- return AVERROR_PATCHWELCOME;
- }
-
ff_dsputil_init(&s->dsp, avctx);
ff_diracdsp_init(&s->diracdsp);
+ for (i = 0; i < MAX_FRAMES; i++) {
+ s->all_frames[i].avframe = av_frame_alloc();
+ if (!s->all_frames[i].avframe) {
+ while (i > 0)
+ av_frame_free(&s->all_frames[--i].avframe);
+ return AVERROR(ENOMEM);
+ }
+ }
+
return 0;
}
@@ -417,7 +423,13 @@ static void dirac_decode_flush(AVCodecContext *avctx)
static av_cold int dirac_decode_end(AVCodecContext *avctx)
{
+ DiracContext *s = avctx->priv_data;
+ int i;
+
dirac_decode_flush(avctx);
+ for (i = 0; i < MAX_FRAMES; i++)
+ av_frame_free(&s->all_frames[i].avframe);
+
return 0;
}
@@ -742,7 +754,7 @@ static void decode_lowdelay(DiracContext *s)
struct lowdelay_slice *slices;
int slice_num = 0;
- slices = av_mallocz(s->lowdelay.num_x * s->lowdelay.num_y * sizeof(struct lowdelay_slice));
+ slices = av_mallocz_array(s->lowdelay.num_x, s->lowdelay.num_y * sizeof(struct lowdelay_slice));
align_get_bits(&s->gb);
/*[DIRAC_STD] 13.5.2 Slices. slice(sx,sy) */
@@ -1343,8 +1355,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
motion_y >>= s->chroma_y_shift;
}
- mx = motion_x & ~(-1 << s->mv_precision);
- my = motion_y & ~(-1 << s->mv_precision);
+ mx = motion_x & ~(-1U << s->mv_precision);
+ my = motion_y & ~(-1U << s->mv_precision);
motion_x >>= s->mv_precision;
motion_y >>= s->mv_precision;
/* normalize subpel coordinates to epel */
@@ -1519,8 +1531,8 @@ static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, in
just use 8 for everything for the moment */
int i, edge = EDGE_WIDTH/2;
- ref->hpel[plane][0] = ref->avframe.data[plane];
- s->dsp.draw_edges(ref->hpel[plane][0], ref->avframe.linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM); /* EDGE_TOP | EDGE_BOTTOM values just copied to make it build, this needs to be ensured */
+ ref->hpel[plane][0] = ref->avframe->data[plane];
+ s->dsp.draw_edges(ref->hpel[plane][0], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM); /* EDGE_TOP | EDGE_BOTTOM values just copied to make it build, this needs to be ensured */
/* no need for hpel if we only have fpel vectors */
if (!s->mv_precision)
@@ -1528,18 +1540,18 @@ static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, in
for (i = 1; i < 4; i++) {
if (!ref->hpel_base[plane][i])
- ref->hpel_base[plane][i] = av_malloc((height+2*edge) * ref->avframe.linesize[plane] + 32);
+ ref->hpel_base[plane][i] = av_malloc((height+2*edge) * ref->avframe->linesize[plane] + 32);
/* we need to be 16-byte aligned even for chroma */
- ref->hpel[plane][i] = ref->hpel_base[plane][i] + edge*ref->avframe.linesize[plane] + 16;
+ ref->hpel[plane][i] = ref->hpel_base[plane][i] + edge*ref->avframe->linesize[plane] + 16;
}
if (!ref->interpolated[plane]) {
s->diracdsp.dirac_hpel_filter(ref->hpel[plane][1], ref->hpel[plane][2],
ref->hpel[plane][3], ref->hpel[plane][0],
- ref->avframe.linesize[plane], width, height);
- s->dsp.draw_edges(ref->hpel[plane][1], ref->avframe.linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);
- s->dsp.draw_edges(ref->hpel[plane][2], ref->avframe.linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);
- s->dsp.draw_edges(ref->hpel[plane][3], ref->avframe.linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);
+ ref->avframe->linesize[plane], width, height);
+ s->dsp.draw_edges(ref->hpel[plane][1], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);
+ s->dsp.draw_edges(ref->hpel[plane][2], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);
+ s->dsp.draw_edges(ref->hpel[plane][3], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);
}
ref->interpolated[plane] = 1;
}
@@ -1565,7 +1577,7 @@ static int dirac_decode_frame_internal(DiracContext *s)
for (comp = 0; comp < 3; comp++) {
Plane *p = &s->plane[comp];
- uint8_t *frame = s->current_picture->avframe.data[comp];
+ uint8_t *frame = s->current_picture->avframe->data[comp];
/* FIXME: small resolutions */
for (i = 0; i < 4; i++)
@@ -1629,6 +1641,29 @@ static int dirac_decode_frame_internal(DiracContext *s)
return 0;
}
+static int get_buffer_with_edge(AVCodecContext *avctx, AVFrame *f, int flags)
+{
+ int ret, i;
+ int chroma_x_shift, chroma_y_shift;
+ avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_x_shift, &chroma_y_shift);
+
+ f->width = avctx->width + 2 * EDGE_WIDTH;
+ f->height = avctx->height + 2 * EDGE_WIDTH + 2;
+ ret = ff_get_buffer(avctx, f, flags);
+ if (ret < 0)
+ return ret;
+
+ for (i = 0; f->data[i]; i++) {
+ int offset = (EDGE_WIDTH >> (i && i<3 ? chroma_y_shift : 0)) *
+ f->linesize[i] + 32;
+ f->data[i] += offset;
+ }
+ f->width = avctx->width;
+ f->height = avctx->height;
+
+ return 0;
+}
+
/**
* Dirac Specification ->
* 11.1.1 Picture Header. picture_header()
@@ -1640,7 +1675,7 @@ static int dirac_decode_picture_header(DiracContext *s)
GetBitContext *gb = &s->gb;
/* [DIRAC_STD] 11.1.1 Picture Header. picture_header() PICTURE_NUM */
- picnum = s->current_picture->avframe.display_picture_number = get_bits_long(gb, 32);
+ picnum = s->current_picture->avframe->display_picture_number = get_bits_long(gb, 32);
av_log(s->avctx,AV_LOG_DEBUG,"PICTURE_NUM: %d\n",picnum);
@@ -1659,9 +1694,9 @@ static int dirac_decode_picture_header(DiracContext *s)
/* Jordi: this is needed if the referenced picture hasn't yet arrived */
for (j = 0; j < MAX_REFERENCE_FRAMES && refdist; j++)
if (s->ref_frames[j]
- && FFABS(s->ref_frames[j]->avframe.display_picture_number - refnum) < refdist) {
+ && FFABS(s->ref_frames[j]->avframe->display_picture_number - refnum) < refdist) {
s->ref_pics[i] = s->ref_frames[j];
- refdist = FFABS(s->ref_frames[j]->avframe.display_picture_number - refnum);
+ refdist = FFABS(s->ref_frames[j]->avframe->display_picture_number - refnum);
}
if (!s->ref_pics[i] || refdist)
@@ -1670,21 +1705,21 @@ static int dirac_decode_picture_header(DiracContext *s)
/* if there were no references at all, allocate one */
if (!s->ref_pics[i])
for (j = 0; j < MAX_FRAMES; j++)
- if (!s->all_frames[j].avframe.data[0]) {
+ if (!s->all_frames[j].avframe->data[0]) {
s->ref_pics[i] = &s->all_frames[j];
- ff_get_buffer(s->avctx, &s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
+ get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
break;
}
}
/* retire the reference frames that are not used anymore */
- if (s->current_picture->avframe.reference) {
+ if (s->current_picture->avframe->reference) {
retire = picnum + dirac_get_se_golomb(gb);
if (retire != picnum) {
DiracFrame *retire_pic = remove_frame(s->ref_frames, retire);
if (retire_pic)
- retire_pic->avframe.reference &= DELAYED_PIC_REF;
+ retire_pic->avframe->reference &= DELAYED_PIC_REF;
else
av_log(s->avctx, AV_LOG_DEBUG, "Frame to retire not found\n");
}
@@ -1692,7 +1727,7 @@ static int dirac_decode_picture_header(DiracContext *s)
/* if reference array is full, remove the oldest as per the spec */
while (add_frame(s->ref_frames, MAX_REFERENCE_FRAMES, s->current_picture)) {
av_log(s->avctx, AV_LOG_ERROR, "Reference frame overflow\n");
- remove_frame(s->ref_frames, s->ref_frames[0]->avframe.display_picture_number)->avframe.reference &= DELAYED_PIC_REF;
+ remove_frame(s->ref_frames, s->ref_frames[0]->avframe->display_picture_number)->avframe->reference &= DELAYED_PIC_REF;
}
}
@@ -1717,7 +1752,7 @@ static int get_delayed_pic(DiracContext *s, AVFrame *picture, int *got_frame)
/* find frame with lowest picture number */
for (i = 1; s->delay_frames[i]; i++)
- if (s->delay_frames[i]->avframe.display_picture_number < out->avframe.display_picture_number) {
+ if (s->delay_frames[i]->avframe->display_picture_number < out->avframe->display_picture_number) {
out = s->delay_frames[i];
out_idx = i;
}
@@ -1726,9 +1761,9 @@ static int get_delayed_pic(DiracContext *s, AVFrame *picture, int *got_frame)
s->delay_frames[i] = s->delay_frames[i+1];
if (out) {
- out->avframe.reference ^= DELAYED_PIC_REF;
+ out->avframe->reference ^= DELAYED_PIC_REF;
*got_frame = 1;
- if((ret = av_frame_ref(picture, &out->avframe)) < 0)
+ if((ret = av_frame_ref(picture, out->avframe)) < 0)
return ret;
}
@@ -1790,14 +1825,14 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
/* find an unused frame */
for (i = 0; i < MAX_FRAMES; i++)
- if (s->all_frames[i].avframe.data[0] == NULL)
+ if (s->all_frames[i].avframe->data[0] == NULL)
pic = &s->all_frames[i];
if (!pic) {
av_log(avctx, AV_LOG_ERROR, "framelist full\n");
return -1;
}
- avcodec_get_frame_defaults(&pic->avframe);
+ av_frame_unref(pic->avframe);
/* [DIRAC_STD] Defined in 9.6.1 ... */
tmp = parse_code & 0x03; /* [DIRAC_STD] num_refs() */
@@ -1808,16 +1843,16 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
s->num_refs = tmp;
s->is_arith = (parse_code & 0x48) == 0x08; /* [DIRAC_STD] using_ac() */
s->low_delay = (parse_code & 0x88) == 0x88; /* [DIRAC_STD] is_low_delay() */
- pic->avframe.reference = (parse_code & 0x0C) == 0x0C; /* [DIRAC_STD] is_reference() */
- pic->avframe.key_frame = s->num_refs == 0; /* [DIRAC_STD] is_intra() */
- pic->avframe.pict_type = s->num_refs + 1; /* Definition of AVPictureType in avutil.h */
+ pic->avframe->reference = (parse_code & 0x0C) == 0x0C; /* [DIRAC_STD] is_reference() */
+ pic->avframe->key_frame = s->num_refs == 0; /* [DIRAC_STD] is_intra() */
+ pic->avframe->pict_type = s->num_refs + 1; /* Definition of AVPictureType in avutil.h */
- if ((ret = ff_get_buffer(avctx, &pic->avframe, (parse_code & 0x0C) == 0x0C ? AV_GET_BUFFER_FLAG_REF : 0)) < 0)
+ if ((ret = get_buffer_with_edge(avctx, pic->avframe, (parse_code & 0x0C) == 0x0C ? AV_GET_BUFFER_FLAG_REF : 0)) < 0)
return ret;
s->current_picture = pic;
- s->plane[0].stride = pic->avframe.linesize[0];
- s->plane[1].stride = pic->avframe.linesize[1];
- s->plane[2].stride = pic->avframe.linesize[2];
+ s->plane[0].stride = pic->avframe->linesize[0];
+ s->plane[1].stride = pic->avframe->linesize[1];
+ s->plane[2].stride = pic->avframe->linesize[2];
/* [DIRAC_STD] 11.1 Picture parse. picture_parse() */
if (dirac_decode_picture_header(s))
@@ -1833,7 +1868,7 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)
{
DiracContext *s = avctx->priv_data;
- DiracFrame *picture = data;
+ AVFrame *picture = data;
uint8_t *buf = pkt->data;
int buf_size = pkt->size;
int i, data_unit_size, buf_idx = 0;
@@ -1841,8 +1876,8 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
/* release unused frames */
for (i = 0; i < MAX_FRAMES; i++)
- if (s->all_frames[i].avframe.data[0] && !s->all_frames[i].avframe.reference) {
- av_frame_unref(&s->all_frames[i].avframe);
+ if (s->all_frames[i].avframe->data[0] && !s->all_frames[i].avframe->reference) {
+ av_frame_unref(s->all_frames[i].avframe);
memset(s->all_frames[i].interpolated, 0, sizeof(s->all_frames[i].interpolated));
}
@@ -1887,40 +1922,40 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (!s->current_picture)
return buf_size;
- if (s->current_picture->avframe.display_picture_number > s->frame_number) {
+ if (s->current_picture->avframe->display_picture_number > s->frame_number) {
DiracFrame *delayed_frame = remove_frame(s->delay_frames, s->frame_number);
- s->current_picture->avframe.reference |= DELAYED_PIC_REF;
+ s->current_picture->avframe->reference |= DELAYED_PIC_REF;
if (add_frame(s->delay_frames, MAX_DELAY, s->current_picture)) {
- int min_num = s->delay_frames[0]->avframe.display_picture_number;
+ int min_num = s->delay_frames[0]->avframe->display_picture_number;
/* Too many delayed frames, so we display the frame with the lowest pts */
av_log(avctx, AV_LOG_ERROR, "Delay frame overflow\n");
delayed_frame = s->delay_frames[0];
for (i = 1; s->delay_frames[i]; i++)
- if (s->delay_frames[i]->avframe.display_picture_number < min_num)
- min_num = s->delay_frames[i]->avframe.display_picture_number;
+ if (s->delay_frames[i]->avframe->display_picture_number < min_num)
+ min_num = s->delay_frames[i]->avframe->display_picture_number;
delayed_frame = remove_frame(s->delay_frames, min_num);
add_frame(s->delay_frames, MAX_DELAY, s->current_picture);
}
if (delayed_frame) {
- delayed_frame->avframe.reference ^= DELAYED_PIC_REF;
- if((ret=av_frame_ref(data, &delayed_frame->avframe)) < 0)
+ delayed_frame->avframe->reference ^= DELAYED_PIC_REF;
+ if((ret=av_frame_ref(data, delayed_frame->avframe)) < 0)
return ret;
*got_frame = 1;
}
- } else if (s->current_picture->avframe.display_picture_number == s->frame_number) {
+ } else if (s->current_picture->avframe->display_picture_number == s->frame_number) {
/* The right frame at the right time :-) */
- if((ret=av_frame_ref(data, &s->current_picture->avframe)) < 0)
+ if((ret=av_frame_ref(data, s->current_picture->avframe)) < 0)
return ret;
*got_frame = 1;
}
if (*got_frame)
- s->frame_number = picture->avframe.display_picture_number + 1;
+ s->frame_number = picture->display_picture_number + 1;
return buf_idx;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dnxhd_parser.c b/chromium/third_party/ffmpeg/libavcodec/dnxhd_parser.c
index 6e030e4212a..fffb98fa48c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dnxhd_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dnxhd_parser.c
@@ -46,7 +46,7 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
if (!pic_found) {
for (i = 0; i < buf_size; i++) {
- state = (state<<8) | buf[i];
+ state = (state << 8) | buf[i];
if ((state & 0xffffffffff00LL) == DNXHD_HEADER_PREFIX) {
i++;
pic_found = 1;
@@ -61,14 +61,14 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
if (!buf_size) /* EOF considered as end of frame */
return 0;
for (; i < buf_size; i++) {
- state = (state<<8) | buf[i];
+ state = (state << 8) | buf[i];
if ((state & 0xffffffffff00LL) == DNXHD_HEADER_PREFIX) {
if (!interlaced || dctx->cur_field) {
pc->frame_start_found = 0;
pc->state64 = -1;
dctx->interlaced = interlaced;
dctx->cur_field = 0;
- return i-5;
+ return i - 5;
} else {
/* continue, to get the second field */
dctx->interlaced = interlaced = (state&2)>>1;
@@ -98,12 +98,12 @@ static int dnxhd_parse(AVCodecParserContext *s,
} else {
next = dnxhd_find_frame_end(dctx, buf, buf_size);
if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
- *poutbuf = NULL;
+ *poutbuf = NULL;
*poutbuf_size = 0;
return buf_size;
}
}
- *poutbuf = buf;
+ *poutbuf = buf;
*poutbuf_size = buf_size;
return next;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dnxhddata.c b/chromium/third_party/ffmpeg/libavcodec/dnxhddata.c
index 669b8067e99..7ea91915e2d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dnxhddata.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dnxhddata.c
@@ -222,6 +222,17 @@ static const uint8_t dnxhd_1252_chroma_weight[] = {
114, 128, 125, 129, 134, 125, 116, 116,
};
+static const uint8_t dnxhd_1256_chroma_weight[] = {
+ 0, 32, 32, 32, 32, 32, 32, 33,
+ 32, 32, 32, 32, 32, 32, 32, 34,
+ 32, 32, 32, 32, 32, 32, 33, 37,
+ 32, 32, 32, 32, 32, 32, 36, 39,
+ 32, 32, 32, 32, 32, 34, 39, 44,
+ 32, 37, 32, 32, 35, 40, 43, 49,
+ 32, 33, 36, 36, 40, 43, 50, 60,
+ 34, 37, 39, 44, 51, 56, 61, 70,
+};
+
static const uint8_t dnxhd_1237_dc_codes[12] = {
0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
};
@@ -1026,6 +1037,14 @@ const CIDEntry ff_dnxhd_cid_table[] = {
dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
{ 36, 36, 45, 75, 90 },
{ { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
+ { 1256, 1920, 1080, 0, 1835008, 1835008, 6, 10, 4,
+ dnxhd_1235_luma_weight, dnxhd_1256_chroma_weight,
+ dnxhd_1235_1241_dc_codes, dnxhd_1235_1241_dc_bits,
+ dnxhd_1235_1241_ac_codes, dnxhd_1235_1241_ac_bits, dnxhd_1235_1241_ac_level,
+ dnxhd_1235_1241_ac_flags,
+ dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1235_1241_run,
+ { 350, 390, 440, 730, 880 },
+ { { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
};
int ff_dnxhd_get_cid_table(int cid)
@@ -1048,7 +1067,7 @@ int avpriv_dnxhd_get_frame_size(int cid)
int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth)
{
int i, j;
- int mbs = avctx->bit_rate/1000000;
+ int mbs = avctx->bit_rate / 1000000;
if (!mbs)
return 0;
for (i = 0; i < FF_ARRAY_ELEMS(ff_dnxhd_cid_table); i++) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/dnxhddata.h b/chromium/third_party/ffmpeg/libavcodec/dnxhddata.h
index b8bcb21d8ea..8166ee848f4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dnxhddata.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dnxhddata.h
@@ -42,7 +42,7 @@ typedef struct CIDEntry {
const uint8_t *ac_flags;
const uint16_t *run_codes;
const uint8_t *run_bits, *run;
- int bit_rates[5]; ///< Helpher to choose variants, rounded to nearest 5Mb/s
+ int bit_rates[5]; ///< Helper to choose variants, rounded to nearest 5Mb/s
AVRational frame_rates[5];
} CIDEntry;
diff --git a/chromium/third_party/ffmpeg/libavcodec/dnxhddec.c b/chromium/third_party/ffmpeg/libavcodec/dnxhddec.c
index 42775dfd2b7..e33593c1149 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dnxhddec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dnxhddec.c
@@ -23,6 +23,7 @@
*/
#include "libavutil/imgutils.h"
+#include "libavutil/timer.h"
#include "avcodec.h"
#include "get_bits.h"
#include "dnxhddata.h"
@@ -41,10 +42,11 @@ typedef struct DNXHDContext {
VLC ac_vlc, dc_vlc, run_vlc;
int last_dc[3];
DSPContext dsp;
- DECLARE_ALIGNED(16, int16_t, blocks)[8][64];
+ DECLARE_ALIGNED(16, int16_t, blocks)[12][64];
ScanTable scantable;
const CIDEntry *cid_table;
int bit_depth; // 8, 10 or 0 if not initialized at all.
+ int is_444;
void (*decode_dct_block)(struct DNXHDContext *ctx, int16_t *block,
int n, int qscale);
int last_qscale;
@@ -55,8 +57,12 @@ typedef struct DNXHDContext {
#define DNXHD_VLC_BITS 9
#define DNXHD_DC_VLC_BITS 7
-static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block, int n, int qscale);
-static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block, int n, int qscale);
+static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block,
+ int n, int qscale);
+static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block,
+ int n, int qscale);
+static void dnxhd_decode_dct_block_10_444(DNXHDContext *ctx, int16_t *block,
+ int n, int qscale);
static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
{
@@ -74,7 +80,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid)
if ((index = ff_dnxhd_get_cid_table(cid)) < 0) {
av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);
- return -1;
+ return AVERROR(ENOSYS);
}
if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth) {
av_log(ctx->avctx, AV_LOG_ERROR, "bit depth mismatches %d %d\n", ff_dnxhd_cid_table[index].bit_depth, ctx->bit_depth);
@@ -96,30 +102,34 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid)
ctx->cid_table->run_bits, 1, 1,
ctx->cid_table->run_codes, 2, 2, 0);
- ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, ff_zigzag_direct);
+ ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable,
+ ff_zigzag_direct);
ctx->cid = cid;
}
return 0;
}
static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
- const uint8_t *buf, int buf_size, int first_field)
+ const uint8_t *buf, int buf_size,
+ int first_field)
{
- static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
- int i, cid;
+ static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
+ static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
+ int i, cid, ret;
if (buf_size < 0x280)
- return -1;
+ return AVERROR_INVALIDDATA;
- if (memcmp(buf, header_prefix, 5)) {
+ if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5)) {
av_log(ctx->avctx, AV_LOG_ERROR, "error in header\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
if (buf[5] & 2) { /* interlaced */
ctx->cur_field = buf[5] & 1;
frame->interlaced_frame = 1;
frame->top_field_first = first_field ^ ctx->cur_field;
- av_log(ctx->avctx, AV_LOG_DEBUG, "interlaced %d, cur field %d\n", buf[5] & 3, ctx->cur_field);
+ av_log(ctx->avctx, AV_LOG_DEBUG,
+ "interlaced %d, cur field %d\n", buf[5] & 3, ctx->cur_field);
}
ctx->height = AV_RB16(buf + 0x18);
@@ -127,7 +137,17 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
- if (buf[0x21] & 0x40) {
+ ctx->is_444 = 0;
+ if (buf[0x4] == 0x2) {
+ ctx->avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
+ ctx->avctx->bits_per_raw_sample = 10;
+ if (ctx->bit_depth != 10) {
+ ff_dsputil_init(&ctx->dsp, ctx->avctx);
+ ctx->bit_depth = 10;
+ ctx->decode_dct_block = dnxhd_decode_dct_block_10_444;
+ }
+ ctx->is_444 = 1;
+ } else if (buf[0x21] & 0x40) {
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
ctx->avctx->bits_per_raw_sample = 10;
if (ctx->bit_depth != 10) {
@@ -148,34 +168,36 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
cid = AV_RB32(buf + 0x28);
av_dlog(ctx->avctx, "compression id %d\n", cid);
- if (dnxhd_init_vlc(ctx, cid) < 0)
- return -1;
+ if ((ret = dnxhd_init_vlc(ctx, cid)) < 0)
+ return ret;
if (buf_size < ctx->cid_table->coding_unit_size) {
av_log(ctx->avctx, AV_LOG_ERROR, "incorrect frame size\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
- ctx->mb_width = ctx->width>>4;
+ ctx->mb_width = ctx->width >> 4;
ctx->mb_height = buf[0x16d];
- av_dlog(ctx->avctx, "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
+ av_dlog(ctx->avctx,
+ "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
- if ((ctx->height+15)>>4 == ctx->mb_height && frame->interlaced_frame)
+ if ((ctx->height + 15) >> 4 == ctx->mb_height && frame->interlaced_frame)
ctx->height <<= 1;
if (ctx->mb_height > 68 ||
- (ctx->mb_height << frame->interlaced_frame) > (ctx->height+15)>>4) {
- av_log(ctx->avctx, AV_LOG_ERROR, "mb height too big: %d\n", ctx->mb_height);
- return -1;
+ (ctx->mb_height << frame->interlaced_frame) > (ctx->height + 15) >> 4) {
+ av_log(ctx->avctx, AV_LOG_ERROR,
+ "mb height too big: %d\n", ctx->mb_height);
+ return AVERROR_INVALIDDATA;
}
for (i = 0; i < ctx->mb_height; i++) {
- ctx->mb_scan_index[i] = AV_RB32(buf + 0x170 + (i<<2));
+ ctx->mb_scan_index[i] = AV_RB32(buf + 0x170 + (i << 2));
av_dlog(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]);
if (buf_size < ctx->mb_scan_index[i] + 0x280LL) {
av_log(ctx->avctx, AV_LOG_ERROR, "invalid mb scan index\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
}
@@ -198,14 +220,25 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx,
const int eob_index = ctx->cid_table->eob_index;
OPEN_READER(bs, &ctx->gb);
- if (n&2) {
- component = 1 + (n&1);
- scale = ctx->chroma_scale;
- weight_matrix = ctx->cid_table->chroma_weight;
+ if (!ctx->is_444) {
+ if (n & 2) {
+ component = 1 + (n & 1);
+ scale = ctx->chroma_scale;
+ weight_matrix = ctx->cid_table->chroma_weight;
+ } else {
+ component = 0;
+ scale = ctx->luma_scale;
+ weight_matrix = ctx->cid_table->luma_weight;
+ }
} else {
- component = 0;
- scale = ctx->luma_scale;
- weight_matrix = ctx->cid_table->luma_weight;
+ component = (n >> 1) % 3;
+ if (component) {
+ scale = ctx->chroma_scale;
+ weight_matrix = ctx->cid_table->chroma_weight;
+ } else {
+ scale = ctx->luma_scale;
+ weight_matrix = ctx->cid_table->luma_weight;
+ }
}
UPDATE_CACHE(bs, &ctx->gb);
@@ -249,13 +282,13 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx,
break;
}
- j = ctx->scantable.permutated[i];
+ j = ctx->scantable.permutated[i];
level *= scale[i];
if (level_bias < 32 || weight_matrix[i] != level_bias)
level += level_bias;
level >>= level_shift;
- block[j] = (level^sign) - sign;
+ block[j] = (level ^ sign) - sign;
UPDATE_CACHE(bs, &ctx->gb);
GET_VLC(index1, bs, &ctx->gb, ctx->ac_vlc.table,
@@ -277,7 +310,14 @@ static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block,
dnxhd_decode_dct_block(ctx, block, n, qscale, 6, 8, 4);
}
-static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, int x, int y)
+static void dnxhd_decode_dct_block_10_444(DNXHDContext *ctx, int16_t *block,
+ int n, int qscale)
+{
+ dnxhd_decode_dct_block(ctx, block, n, qscale, 6, 32, 6);
+}
+
+static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
+ int x, int y)
{
int shift1 = ctx->bit_depth == 10;
int dct_linesize_luma = frame->linesize[0];
@@ -301,6 +341,12 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, int x, int
ctx->dsp.clear_block(ctx->blocks[i]);
ctx->decode_dct_block(ctx, ctx->blocks[i], i, qscale);
}
+ if (ctx->is_444) {
+ for (; i < 12; i++) {
+ ctx->dsp.clear_block(ctx->blocks[i]);
+ ctx->decode_dct_block(ctx, ctx->blocks[i], i, qscale);
+ }
+ }
if (frame->interlaced_frame) {
dct_linesize_luma <<= 1;
@@ -308,8 +354,8 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, int x, int
}
dest_y = frame->data[0] + ((y * dct_linesize_luma) << 4) + (x << (4 + shift1));
- dest_u = frame->data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1));
- dest_v = frame->data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1));
+ dest_u = frame->data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
+ dest_v = frame->data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
if (ctx->cur_field) {
dest_y += frame->linesize[0];
@@ -319,17 +365,36 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, int x, int
dct_y_offset = dct_linesize_luma << 3;
dct_x_offset = 8 << shift1;
- ctx->dsp.idct_put(dest_y, dct_linesize_luma, ctx->blocks[0]);
- ctx->dsp.idct_put(dest_y + dct_x_offset, dct_linesize_luma, ctx->blocks[1]);
- ctx->dsp.idct_put(dest_y + dct_y_offset, dct_linesize_luma, ctx->blocks[4]);
- ctx->dsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[5]);
-
- if (!(ctx->avctx->flags & CODEC_FLAG_GRAY)) {
- dct_y_offset = dct_linesize_chroma << 3;
- ctx->dsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
- ctx->dsp.idct_put(dest_v, dct_linesize_chroma, ctx->blocks[3]);
- ctx->dsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[6]);
- ctx->dsp.idct_put(dest_v + dct_y_offset, dct_linesize_chroma, ctx->blocks[7]);
+ if (!ctx->is_444) {
+ ctx->dsp.idct_put(dest_y, dct_linesize_luma, ctx->blocks[0]);
+ ctx->dsp.idct_put(dest_y + dct_x_offset, dct_linesize_luma, ctx->blocks[1]);
+ ctx->dsp.idct_put(dest_y + dct_y_offset, dct_linesize_luma, ctx->blocks[4]);
+ ctx->dsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[5]);
+
+ if (!(ctx->avctx->flags & CODEC_FLAG_GRAY)) {
+ dct_y_offset = dct_linesize_chroma << 3;
+ ctx->dsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
+ ctx->dsp.idct_put(dest_v, dct_linesize_chroma, ctx->blocks[3]);
+ ctx->dsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[6]);
+ ctx->dsp.idct_put(dest_v + dct_y_offset, dct_linesize_chroma, ctx->blocks[7]);
+ }
+ } else {
+ ctx->dsp.idct_put(dest_y, dct_linesize_luma, ctx->blocks[0]);
+ ctx->dsp.idct_put(dest_y + dct_x_offset, dct_linesize_luma, ctx->blocks[1]);
+ ctx->dsp.idct_put(dest_y + dct_y_offset, dct_linesize_luma, ctx->blocks[6]);
+ ctx->dsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[7]);
+
+ if (!(ctx->avctx->flags & CODEC_FLAG_GRAY)) {
+ dct_y_offset = dct_linesize_chroma << 3;
+ ctx->dsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
+ ctx->dsp.idct_put(dest_u + dct_x_offset, dct_linesize_chroma, ctx->blocks[3]);
+ ctx->dsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[8]);
+ ctx->dsp.idct_put(dest_u + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->blocks[9]);
+ ctx->dsp.idct_put(dest_v, dct_linesize_chroma, ctx->blocks[4]);
+ ctx->dsp.idct_put(dest_v + dct_x_offset, dct_linesize_chroma, ctx->blocks[5]);
+ ctx->dsp.idct_put(dest_v + dct_y_offset, dct_linesize_chroma, ctx->blocks[10]);
+ ctx->dsp.idct_put(dest_v + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->blocks[11]);
+ }
}
return 0;
@@ -353,8 +418,8 @@ static int dnxhd_decode_macroblocks(DNXHDContext *ctx, AVFrame *frame,
return 0;
}
-static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
- AVPacket *avpkt)
+static int dnxhd_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
@@ -366,9 +431,9 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
av_dlog(avctx, "frame size %d\n", buf_size);
- decode_coding_unit:
- if (dnxhd_decode_header(ctx, picture, buf, buf_size, first_field) < 0)
- return -1;
+decode_coding_unit:
+ if ((ret = dnxhd_decode_header(ctx, picture, buf, buf_size, first_field)) < 0)
+ return ret;
if ((avctx->width || avctx->height) &&
(ctx->width != avctx->width || ctx->height != avctx->height)) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.c b/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.c
index c2fbd5c9993..b5edb726436 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.c
@@ -23,23 +23,28 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define RC_VARIANCE 1 // use variance or ssd for fast rc
-
#include "libavutil/attributes.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
+#include "libavutil/timer.h"
+
#include "avcodec.h"
#include "dsputil.h"
#include "internal.h"
#include "mpegvideo.h"
#include "dnxhdenc.h"
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-#define DNX10BIT_QMAT_SHIFT 18 // The largest value that will not lead to overflow for 10bit samples.
-static const AVOption options[]={
- {"nitris_compat", "encode with Avid Nitris compatibility", offsetof(DNXHDEncContext, nitris_compat), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, VE},
-{NULL}
+// The largest value that will not lead to overflow for 10bit samples.
+#define DNX10BIT_QMAT_SHIFT 18
+#define RC_VARIANCE 1 // use variance or ssd for fast rc
+#define LAMBDA_FRAC_BITS 10
+
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "nitris_compat", "encode with Avid Nitris compatibility",
+ offsetof(DNXHDEncContext, nitris_compat), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+ { NULL }
};
static const AVClass dnxhd_class = {
@@ -49,18 +54,22 @@ static const AVClass dnxhd_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-#define LAMBDA_FRAC_BITS 10
-
-static void dnxhd_8bit_get_pixels_8x4_sym(int16_t *av_restrict block, const uint8_t *pixels, int line_size)
+static void dnxhd_8bit_get_pixels_8x4_sym(int16_t *av_restrict block,
+ const uint8_t *pixels,
+ ptrdiff_t line_size)
{
int i;
for (i = 0; i < 4; i++) {
- block[0] = pixels[0]; block[1] = pixels[1];
- block[2] = pixels[2]; block[3] = pixels[3];
- block[4] = pixels[4]; block[5] = pixels[5];
- block[6] = pixels[6]; block[7] = pixels[7];
- pixels += line_size;
- block += 8;
+ block[0] = pixels[0];
+ block[1] = pixels[1];
+ block[2] = pixels[2];
+ block[3] = pixels[3];
+ block[4] = pixels[4];
+ block[5] = pixels[5];
+ block[6] = pixels[6];
+ block[7] = pixels[7];
+ pixels += line_size;
+ block += 8;
}
memcpy(block, block - 8, sizeof(*block) * 8);
memcpy(block + 8, block - 16, sizeof(*block) * 8);
@@ -68,7 +77,10 @@ static void dnxhd_8bit_get_pixels_8x4_sym(int16_t *av_restrict block, const uint
memcpy(block + 24, block - 32, sizeof(*block) * 8);
}
-static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(int16_t *av_restrict block, const uint8_t *pixels, int line_size)
+static av_always_inline
+void dnxhd_10bit_get_pixels_8x4_sym(int16_t *av_restrict block,
+ const uint8_t *pixels,
+ ptrdiff_t line_size)
{
int i;
const uint16_t* pixels16 = (const uint16_t*)pixels;
@@ -117,24 +129,28 @@ static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, int16_t *block,
static av_cold int dnxhd_init_vlc(DNXHDEncContext *ctx)
{
int i, j, level, run;
- int max_level = 1<<(ctx->cid_table->bit_depth+2);
-
- FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->vlc_codes, max_level*4*sizeof(*ctx->vlc_codes), fail);
- FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->vlc_bits, max_level*4*sizeof(*ctx->vlc_bits) , fail);
- FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->run_codes, 63*2, fail);
- FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->run_bits, 63, fail);
-
- ctx->vlc_codes += max_level*2;
- ctx->vlc_bits += max_level*2;
+ int max_level = 1 << (ctx->cid_table->bit_depth + 2);
+
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->vlc_codes,
+ max_level * 4 * sizeof(*ctx->vlc_codes), fail);
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->vlc_bits,
+ max_level * 4 * sizeof(*ctx->vlc_bits), fail);
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->run_codes,
+ 63 * 2, fail);
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->run_bits,
+ 63, fail);
+
+ ctx->vlc_codes += max_level * 2;
+ ctx->vlc_bits += max_level * 2;
for (level = -max_level; level < max_level; level++) {
for (run = 0; run < 2; run++) {
- int index = (level<<1)|run;
+ int index = (level << 1) | run;
int sign, offset = 0, alevel = level;
MASK_ABS(sign, alevel);
if (alevel > 64) {
- offset = (alevel-1)>>6;
- alevel -= offset<<6;
+ offset = (alevel - 1) >> 6;
+ alevel -= offset << 6;
}
for (j = 0; j < 257; j++) {
if (ctx->cid_table->ac_level[j] >> 1 == alevel &&
@@ -142,19 +158,21 @@ static av_cold int dnxhd_init_vlc(DNXHDEncContext *ctx)
(!run || (ctx->cid_table->ac_flags[j] & 2) && run)) {
av_assert1(!ctx->vlc_codes[index]);
if (alevel) {
- ctx->vlc_codes[index] = (ctx->cid_table->ac_codes[j]<<1)|(sign&1);
- ctx->vlc_bits [index] = ctx->cid_table->ac_bits[j]+1;
+ ctx->vlc_codes[index] =
+ (ctx->cid_table->ac_codes[j] << 1) | (sign & 1);
+ ctx->vlc_bits[index] = ctx->cid_table->ac_bits[j] + 1;
} else {
ctx->vlc_codes[index] = ctx->cid_table->ac_codes[j];
- ctx->vlc_bits [index] = ctx->cid_table->ac_bits [j];
+ ctx->vlc_bits[index] = ctx->cid_table->ac_bits[j];
}
break;
}
}
av_assert0(!alevel || j < 257);
if (offset) {
- ctx->vlc_codes[index] = (ctx->vlc_codes[index]<<ctx->cid_table->index_bits)|offset;
- ctx->vlc_bits [index]+= ctx->cid_table->index_bits;
+ ctx->vlc_codes[index] =
+ (ctx->vlc_codes[index] << ctx->cid_table->index_bits) | offset;
+ ctx->vlc_bits[index] += ctx->cid_table->index_bits;
}
}
}
@@ -162,45 +180,56 @@ static av_cold int dnxhd_init_vlc(DNXHDEncContext *ctx)
int run = ctx->cid_table->run[i];
av_assert0(run < 63);
ctx->run_codes[run] = ctx->cid_table->run_codes[i];
- ctx->run_bits [run] = ctx->cid_table->run_bits[i];
+ ctx->run_bits[run] = ctx->cid_table->run_bits[i];
}
return 0;
- fail:
- return -1;
+fail:
+ return AVERROR(ENOMEM);
}
static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias)
{
// init first elem to 1 to avoid div by 0 in convert_matrix
- uint16_t weight_matrix[64] = {1,}; // convert_matrix needs uint16_t*
+ uint16_t weight_matrix[64] = { 1, }; // convert_matrix needs uint16_t*
int qscale, i;
const uint8_t *luma_weight_table = ctx->cid_table->luma_weight;
const uint8_t *chroma_weight_table = ctx->cid_table->chroma_weight;
- FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_l, (ctx->m.avctx->qmax+1) * 64 * sizeof(int), fail);
- FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_c, (ctx->m.avctx->qmax+1) * 64 * sizeof(int), fail);
- FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_l16, (ctx->m.avctx->qmax+1) * 64 * 2 * sizeof(uint16_t), fail);
- FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_c16, (ctx->m.avctx->qmax+1) * 64 * 2 * sizeof(uint16_t), fail);
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_l,
+ (ctx->m.avctx->qmax + 1) * 64 * sizeof(int), fail);
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_c,
+ (ctx->m.avctx->qmax + 1) * 64 * sizeof(int), fail);
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_l16,
+ (ctx->m.avctx->qmax + 1) * 64 * 2 * sizeof(uint16_t),
+ fail);
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_c16,
+ (ctx->m.avctx->qmax + 1) * 64 * 2 * sizeof(uint16_t),
+ fail);
if (ctx->cid_table->bit_depth == 8) {
for (i = 1; i < 64; i++) {
int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]];
weight_matrix[j] = ctx->cid_table->luma_weight[i];
}
- ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_l, ctx->qmatrix_l16, weight_matrix,
- ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1);
+ ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_l, ctx->qmatrix_l16,
+ weight_matrix, ctx->m.intra_quant_bias, 1,
+ ctx->m.avctx->qmax, 1);
for (i = 1; i < 64; i++) {
int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]];
weight_matrix[j] = ctx->cid_table->chroma_weight[i];
}
- ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_c, ctx->qmatrix_c16, weight_matrix,
- ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1);
+ ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_c, ctx->qmatrix_c16,
+ weight_matrix, ctx->m.intra_quant_bias, 1,
+ ctx->m.avctx->qmax, 1);
for (qscale = 1; qscale <= ctx->m.avctx->qmax; qscale++) {
for (i = 0; i < 64; i++) {
- ctx->qmatrix_l [qscale] [i] <<= 2; ctx->qmatrix_c [qscale] [i] <<= 2;
- ctx->qmatrix_l16[qscale][0][i] <<= 2; ctx->qmatrix_l16[qscale][1][i] <<= 2;
- ctx->qmatrix_c16[qscale][0][i] <<= 2; ctx->qmatrix_c16[qscale][1][i] <<= 2;
+ ctx->qmatrix_l[qscale][i] <<= 2;
+ ctx->qmatrix_c[qscale][i] <<= 2;
+ ctx->qmatrix_l16[qscale][0][i] <<= 2;
+ ctx->qmatrix_l16[qscale][1][i] <<= 2;
+ ctx->qmatrix_c16[qscale][0][i] <<= 2;
+ ctx->qmatrix_c16[qscale][1][i] <<= 2;
}
}
} else {
@@ -209,16 +238,21 @@ static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias)
for (i = 1; i < 64; i++) {
int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]];
- // The quantization formula from the VC-3 standard is:
- // quantized = sign(block[i]) * floor(abs(block[i]/s) * p / (qscale * weight_table[i]))
- // Where p is 32 for 8-bit samples and 8 for 10-bit ones.
- // The s factor compensates scaling of DCT coefficients done by the DCT routines,
- // and therefore is not present in standard. It's 8 for 8-bit samples and 4 for 10-bit ones.
- // We want values of ctx->qtmatrix_l and ctx->qtmatrix_r to be:
- // ((1 << DNX10BIT_QMAT_SHIFT) * (p / s)) / (qscale * weight_table[i])
- // For 10-bit samples, p / s == 2
- ctx->qmatrix_l[qscale][j] = (1 << (DNX10BIT_QMAT_SHIFT + 1)) / (qscale * luma_weight_table[i]);
- ctx->qmatrix_c[qscale][j] = (1 << (DNX10BIT_QMAT_SHIFT + 1)) / (qscale * chroma_weight_table[i]);
+ /* The quantization formula from the VC-3 standard is:
+ * quantized = sign(block[i]) * floor(abs(block[i]/s) * p /
+ * (qscale * weight_table[i]))
+ * Where p is 32 for 8-bit samples and 8 for 10-bit ones.
+ * The s factor compensates scaling of DCT coefficients done by
+ * the DCT routines, and therefore is not present in standard.
+ * It's 8 for 8-bit samples and 4 for 10-bit ones.
+ * We want values of ctx->qtmatrix_l and ctx->qtmatrix_r to be:
+ * ((1 << DNX10BIT_QMAT_SHIFT) * (p / s)) /
+ * (qscale * weight_table[i])
+ * For 10-bit samples, p / s == 2 */
+ ctx->qmatrix_l[qscale][j] = (1 << (DNX10BIT_QMAT_SHIFT + 1)) /
+ (qscale * luma_weight_table[i]);
+ ctx->qmatrix_c[qscale][j] = (1 << (DNX10BIT_QMAT_SHIFT + 1)) /
+ (qscale * chroma_weight_table[i]);
}
}
}
@@ -229,28 +263,30 @@ static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias)
ctx->m.q_intra_matrix = ctx->qmatrix_l;
return 0;
- fail:
- return -1;
+fail:
+ return AVERROR(ENOMEM);
}
static av_cold int dnxhd_init_rc(DNXHDEncContext *ctx)
{
- FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160*ctx->m.avctx->qmax*sizeof(RCEntry), fail);
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160 * (ctx->m.avctx->qmax + 1) * sizeof(RCEntry), fail);
if (ctx->m.avctx->mb_decision != FF_MB_DECISION_RD)
- FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_cmp, ctx->m.mb_num*sizeof(RCCMPEntry), fail);
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_cmp,
+ ctx->m.mb_num * sizeof(RCCMPEntry), fail);
- ctx->frame_bits = (ctx->cid_table->coding_unit_size - 640 - 4 - ctx->min_padding) * 8;
+ ctx->frame_bits = (ctx->cid_table->coding_unit_size -
+ 640 - 4 - ctx->min_padding) * 8;
ctx->qscale = 1;
- ctx->lambda = 2<<LAMBDA_FRAC_BITS; // qscale 2
+ ctx->lambda = 2 << LAMBDA_FRAC_BITS; // qscale 2
return 0;
- fail:
- return -1;
+fail:
+ return AVERROR(ENOMEM);
}
static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
{
DNXHDEncContext *ctx = avctx->priv_data;
- int i, index, bit_depth;
+ int i, index, bit_depth, ret;
switch (avctx->pix_fmt) {
case AV_PIX_FMT_YUV422P:
@@ -260,15 +296,17 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
bit_depth = 10;
break;
default:
- av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHD\n");
- return -1;
+ av_log(avctx, AV_LOG_ERROR,
+ "pixel format is incompatible with DNxHD\n");
+ return AVERROR(EINVAL);
}
ctx->cid = ff_dnxhd_find_cid(avctx, bit_depth);
if (!ctx->cid) {
- av_log(avctx, AV_LOG_ERROR, "video parameters incompatible with DNxHD. Valid DNxHD profiles:\n");
+ av_log(avctx, AV_LOG_ERROR,
+ "video parameters incompatible with DNxHD. Valid DNxHD profiles:\n");
ff_dnxhd_print_profiles(avctx, AV_LOG_ERROR);
- return -1;
+ return AVERROR(EINVAL);
}
av_log(avctx, AV_LOG_DEBUG, "cid %d\n", ctx->cid);
@@ -276,7 +314,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
av_assert0(index >= 0);
ctx->cid_table = &ff_dnxhd_cid_table[index];
- ctx->m.avctx = avctx;
+ ctx->m.avctx = avctx;
ctx->m.mb_intra = 1;
ctx->m.h263_aic = 1;
@@ -289,12 +327,12 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
ctx->m.dct_quantize = ff_dct_quantize_c;
if (ctx->cid_table->bit_depth == 10) {
- ctx->m.dct_quantize = dnxhd_10bit_dct_quantize;
- ctx->get_pixels_8x4_sym = dnxhd_10bit_get_pixels_8x4_sym;
- ctx->block_width_l2 = 4;
+ ctx->m.dct_quantize = dnxhd_10bit_dct_quantize;
+ ctx->get_pixels_8x4_sym = dnxhd_10bit_get_pixels_8x4_sym;
+ ctx->block_width_l2 = 4;
} else {
- ctx->get_pixels_8x4_sym = dnxhd_8bit_get_pixels_8x4_sym;
- ctx->block_width_l2 = 3;
+ ctx->get_pixels_8x4_sym = dnxhd_8bit_get_pixels_8x4_sym;
+ ctx->block_width_l2 = 3;
}
if (ARCH_X86)
@@ -304,7 +342,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
ctx->m.mb_width = (avctx->width + 15) / 16;
if (avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
- ctx->interlaced = 1;
+ ctx->interlaced = 1;
ctx->m.mb_height /= 2;
}
@@ -312,22 +350,28 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
if (avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
ctx->m.intra_quant_bias = avctx->intra_quant_bias;
- if (dnxhd_init_qmat(ctx, ctx->m.intra_quant_bias, 0) < 0) // XXX tune lbias/cbias
- return -1;
+ // XXX tune lbias/cbias
+ if ((ret = dnxhd_init_qmat(ctx, ctx->m.intra_quant_bias, 0)) < 0)
+ return ret;
- // Avid Nitris hardware decoder requires a minimum amount of padding in the coding unit payload
+ /* Avid Nitris hardware decoder requires a minimum amount of padding
+ * in the coding unit payload */
if (ctx->nitris_compat)
ctx->min_padding = 1600;
- if (dnxhd_init_vlc(ctx) < 0)
- return -1;
- if (dnxhd_init_rc(ctx) < 0)
- return -1;
+ if ((ret = dnxhd_init_vlc(ctx)) < 0)
+ return ret;
+ if ((ret = dnxhd_init_rc(ctx)) < 0)
+ return ret;
- 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);
+ 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);
avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
@@ -338,37 +382,42 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
if (avctx->thread_count > MAX_THREADS) {
av_log(avctx, AV_LOG_ERROR, "too many threads\n");
- return -1;
+ return AVERROR(EINVAL);
+ }
+
+ if (avctx->qmax <= 1) {
+ av_log(avctx, AV_LOG_ERROR, "qmax must be at least 2\n");
+ return AVERROR(EINVAL);
}
ctx->thread[0] = ctx;
for (i = 1; i < avctx->thread_count; i++) {
- ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext));
+ ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext));
memcpy(ctx->thread[i], ctx, sizeof(DNXHDEncContext));
}
return 0;
- fail: //for FF_ALLOCZ_OR_GOTO
- return -1;
+fail: // for FF_ALLOCZ_OR_GOTO
+ return AVERROR(ENOMEM);
}
static int dnxhd_write_header(AVCodecContext *avctx, uint8_t *buf)
{
DNXHDEncContext *ctx = avctx->priv_data;
- static const uint8_t header_prefix[5] = { 0x00,0x00,0x02,0x80,0x01 };
+ static const uint8_t header_prefix[5] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
memset(buf, 0, 640);
memcpy(buf, header_prefix, 5);
- buf[5] = ctx->interlaced ? ctx->cur_field+2 : 0x01;
+ buf[5] = ctx->interlaced ? ctx->cur_field + 2 : 0x01;
buf[6] = 0x80; // crc flag off
buf[7] = 0xa0; // reserved
- AV_WB16(buf + 0x18, avctx->height>>ctx->interlaced); // ALPF
+ AV_WB16(buf + 0x18, avctx->height >> ctx->interlaced); // ALPF
AV_WB16(buf + 0x1a, avctx->width); // SPL
- AV_WB16(buf + 0x1d, avctx->height>>ctx->interlaced); // NAL
+ AV_WB16(buf + 0x1d, avctx->height >> ctx->interlaced); // NAL
buf[0x21] = ctx->cid_table->bit_depth == 10 ? 0x58 : 0x38;
- buf[0x22] = 0x88 + (ctx->interlaced<<2);
+ buf[0x22] = 0x88 + (ctx->interlaced << 2);
AV_WB32(buf + 0x28, ctx->cid); // CID
buf[0x2c] = ctx->interlaced ? 0 : 0x80;
@@ -387,16 +436,19 @@ static av_always_inline void dnxhd_encode_dc(DNXHDEncContext *ctx, int diff)
{
int nbits;
if (diff < 0) {
- nbits = av_log2_16bit(-2*diff);
+ nbits = av_log2_16bit(-2 * diff);
diff--;
} else {
- nbits = av_log2_16bit(2*diff);
+ nbits = av_log2_16bit(2 * diff);
}
put_bits(&ctx->m.pb, ctx->cid_table->dc_bits[nbits] + nbits,
- (ctx->cid_table->dc_codes[nbits]<<nbits) + (diff & ((1 << nbits) - 1)));
+ (ctx->cid_table->dc_codes[nbits] << nbits) +
+ (diff & ((1 << nbits) - 1)));
}
-static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t *block, int last_index, int n)
+static av_always_inline
+void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t *block,
+ int last_index, int n)
{
int last_non_zero = 0;
int slevel, i, j;
@@ -409,30 +461,34 @@ static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t *b
slevel = block[j];
if (slevel) {
int run_level = i - last_non_zero - 1;
- int rlevel = (slevel<<1)|!!run_level;
+ int rlevel = (slevel << 1) | !!run_level;
put_bits(&ctx->m.pb, ctx->vlc_bits[rlevel], ctx->vlc_codes[rlevel]);
if (run_level)
- put_bits(&ctx->m.pb, ctx->run_bits[run_level], ctx->run_codes[run_level]);
+ put_bits(&ctx->m.pb, ctx->run_bits[run_level],
+ ctx->run_codes[run_level]);
last_non_zero = i;
}
}
put_bits(&ctx->m.pb, ctx->vlc_bits[0], ctx->vlc_codes[0]); // EOB
}
-static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, int16_t *block, int n, int qscale, int last_index)
+static av_always_inline
+void dnxhd_unquantize_c(DNXHDEncContext *ctx, int16_t *block, int n,
+ int qscale, int last_index)
{
const uint8_t *weight_matrix;
int level;
int i;
- weight_matrix = (n&2) ? ctx->cid_table->chroma_weight : ctx->cid_table->luma_weight;
+ weight_matrix = (n & 2) ? ctx->cid_table->chroma_weight
+ : ctx->cid_table->luma_weight;
for (i = 1; i <= last_index; i++) {
int j = ctx->m.intra_scantable.permutated[i];
level = block[j];
if (level) {
if (level < 0) {
- level = (1-2*level) * qscale * weight_matrix[i];
+ level = (1 - 2 * level) * qscale * weight_matrix[i];
if (ctx->cid_table->bit_depth == 10) {
if (weight_matrix[i] != 8)
level += 8;
@@ -444,7 +500,7 @@ static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, int16_t *b
}
level = -level;
} else {
- level = (2*level+1) * qscale * weight_matrix[i];
+ level = (2 * level + 1) * qscale * weight_matrix[i];
if (ctx->cid_table->bit_depth == 10) {
if (weight_matrix[i] != 8)
level += 8;
@@ -469,7 +525,8 @@ static av_always_inline int dnxhd_ssd_block(int16_t *qblock, int16_t *block)
return score;
}
-static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t *block, int last_index)
+static av_always_inline
+int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t *block, int last_index)
{
int last_non_zero = 0;
int bits = 0;
@@ -479,20 +536,25 @@ static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t *bl
level = block[j];
if (level) {
int run_level = i - last_non_zero - 1;
- bits += ctx->vlc_bits[(level<<1)|!!run_level]+ctx->run_bits[run_level];
+ bits += ctx->vlc_bits[(level << 1) |
+ !!run_level] + ctx->run_bits[run_level];
last_non_zero = i;
}
}
return bits;
}
-static av_always_inline void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, int mb_y)
+static av_always_inline
+void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, int mb_y)
{
const int bs = ctx->block_width_l2;
const int bw = 1 << bs;
- const uint8_t *ptr_y = ctx->thread[0]->src[0] + ((mb_y << 4) * ctx->m.linesize) + (mb_x << bs+1);
- const uint8_t *ptr_u = ctx->thread[0]->src[1] + ((mb_y << 4) * ctx->m.uvlinesize) + (mb_x << bs);
- const uint8_t *ptr_v = ctx->thread[0]->src[2] + ((mb_y << 4) * ctx->m.uvlinesize) + (mb_x << bs);
+ const uint8_t *ptr_y = ctx->thread[0]->src[0] +
+ ((mb_y << 4) * ctx->m.linesize) + (mb_x << bs + 1);
+ const uint8_t *ptr_u = ctx->thread[0]->src[1] +
+ ((mb_y << 4) * ctx->m.uvlinesize) + (mb_x << bs);
+ const uint8_t *ptr_v = ctx->thread[0]->src[2] +
+ ((mb_y << 4) * ctx->m.uvlinesize) + (mb_x << bs);
DSPContext *dsp = &ctx->m.dsp;
dsp->get_pixels(ctx->blocks[0], ptr_y, ctx->m.linesize);
@@ -500,12 +562,20 @@ static av_always_inline void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, in
dsp->get_pixels(ctx->blocks[2], ptr_u, ctx->m.uvlinesize);
dsp->get_pixels(ctx->blocks[3], ptr_v, ctx->m.uvlinesize);
- if (mb_y+1 == ctx->m.mb_height && ctx->m.avctx->height == 1080) {
+ if (mb_y + 1 == ctx->m.mb_height && ctx->m.avctx->height == 1080) {
if (ctx->interlaced) {
- ctx->get_pixels_8x4_sym(ctx->blocks[4], ptr_y + ctx->dct_y_offset, ctx->m.linesize);
- ctx->get_pixels_8x4_sym(ctx->blocks[5], ptr_y + ctx->dct_y_offset + bw, ctx->m.linesize);
- ctx->get_pixels_8x4_sym(ctx->blocks[6], ptr_u + ctx->dct_uv_offset, ctx->m.uvlinesize);
- ctx->get_pixels_8x4_sym(ctx->blocks[7], ptr_v + ctx->dct_uv_offset, ctx->m.uvlinesize);
+ ctx->get_pixels_8x4_sym(ctx->blocks[4],
+ ptr_y + ctx->dct_y_offset,
+ ctx->m.linesize);
+ ctx->get_pixels_8x4_sym(ctx->blocks[5],
+ ptr_y + ctx->dct_y_offset + bw,
+ ctx->m.linesize);
+ ctx->get_pixels_8x4_sym(ctx->blocks[6],
+ ptr_u + ctx->dct_uv_offset,
+ ctx->m.uvlinesize);
+ ctx->get_pixels_8x4_sym(ctx->blocks[7],
+ ptr_v + ctx->dct_uv_offset,
+ ctx->m.uvlinesize);
} else {
dsp->clear_block(ctx->blocks[4]);
dsp->clear_block(ctx->blocks[5]);
@@ -513,20 +583,26 @@ static av_always_inline void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, in
dsp->clear_block(ctx->blocks[7]);
}
} else {
- dsp->get_pixels(ctx->blocks[4], ptr_y + ctx->dct_y_offset, ctx->m.linesize);
- dsp->get_pixels(ctx->blocks[5], ptr_y + ctx->dct_y_offset + bw, ctx->m.linesize);
- dsp->get_pixels(ctx->blocks[6], ptr_u + ctx->dct_uv_offset, ctx->m.uvlinesize);
- dsp->get_pixels(ctx->blocks[7], ptr_v + ctx->dct_uv_offset, ctx->m.uvlinesize);
+ dsp->get_pixels(ctx->blocks[4],
+ ptr_y + ctx->dct_y_offset, ctx->m.linesize);
+ dsp->get_pixels(ctx->blocks[5],
+ ptr_y + ctx->dct_y_offset + bw, ctx->m.linesize);
+ dsp->get_pixels(ctx->blocks[6],
+ ptr_u + ctx->dct_uv_offset, ctx->m.uvlinesize);
+ dsp->get_pixels(ctx->blocks[7],
+ ptr_v + ctx->dct_uv_offset, ctx->m.uvlinesize);
}
}
-static av_always_inline int dnxhd_switch_matrix(DNXHDEncContext *ctx, int i)
+static av_always_inline
+int dnxhd_switch_matrix(DNXHDEncContext *ctx, int i)
{
const static uint8_t component[8]={0,0,1,2,0,0,1,2};
return component[i];
}
-static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
+static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg,
+ int jobnr, int threadnr)
{
DNXHDEncContext *ctx = avctx->priv_data;
int mb_y = jobnr, mb_x;
@@ -552,13 +628,16 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i
int overflow, nbits, diff, last_index;
int n = dnxhd_switch_matrix(ctx, i);
- memcpy(block, src_block, 64*sizeof(*block));
- last_index = ctx->m.dct_quantize(&ctx->m, block, 4&(2*i), qscale, &overflow);
- ac_bits += dnxhd_calc_ac_bits(ctx, block, last_index);
+ memcpy(block, src_block, 64 * sizeof(*block));
+ last_index = ctx->m.dct_quantize(&ctx->m, block, 4 & (2*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);
+ if (diff < 0)
+ nbits = av_log2_16bit(-2 * diff);
+ else
+ nbits = av_log2_16bit(2 * diff);
av_assert1(nbits < ctx->cid_table->bit_depth + 4);
dc_bits += ctx->cid_table->dc_bits[nbits] + nbits;
@@ -571,18 +650,21 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i
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, int jobnr, int threadnr)
+static int dnxhd_encode_thread(AVCodecContext *avctx, void *arg,
+ int jobnr, int threadnr)
{
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]);
+ 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] =
@@ -592,21 +674,22 @@ static int dnxhd_encode_thread(AVCodecContext *avctx, void *arg, int jobnr, int
int qscale = ctx->mb_qscale[mb];
int i;
- put_bits(&ctx->m.pb, 12, qscale<<1);
+ put_bits(&ctx->m.pb, 12, qscale << 1);
dnxhd_get_blocks(ctx, mb_x, mb_y);
for (i = 0; i < 8; i++) {
int16_t *block = ctx->blocks[i];
int overflow, n = dnxhd_switch_matrix(ctx, i);
- int last_index = ctx->m.dct_quantize(&ctx->m, block, 4&(2*i), qscale, &overflow);
- //START_TIMER;
+ int last_index = ctx->m.dct_quantize(&ctx->m, block, 4 & (2*i),
+ qscale, &overflow);
+ // START_TIMER;
dnxhd_encode_block(ctx, block, last_index, n);
- //STOP_TIMER("encode_block");
+ // 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;
}
@@ -623,14 +706,15 @@ static void dnxhd_setup_threads_slices(DNXHDEncContext *ctx)
unsigned mb = mb_y * ctx->m.mb_width + mb_x;
ctx->slice_size[mb_y] += ctx->mb_bits[mb];
}
- ctx->slice_size[mb_y] = (ctx->slice_size[mb_y]+31)&~31;
+ 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];
offset += thread_size;
}
}
-static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
+static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg,
+ int jobnr, int threadnr)
{
DNXHDEncContext *ctx = avctx->priv_data;
int mb_y = jobnr, mb_x, x, y;
@@ -639,9 +723,9 @@ static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg, int jobnr, int
ctx = ctx->thread[threadnr];
if (ctx->cid_table->bit_depth == 8) {
- uint8_t *pix = ctx->thread[0]->src[0] + ((mb_y<<4) * ctx->m.linesize);
+ uint8_t *pix = ctx->thread[0]->src[0] + ((mb_y << 4) * ctx->m.linesize);
for (mb_x = 0; mb_x < ctx->m.mb_width; ++mb_x, pix += 16) {
- unsigned mb = mb_y * ctx->m.mb_width + mb_x;
+ unsigned mb = mb_y * ctx->m.mb_width + mb_x;
int sum;
int varc;
@@ -660,15 +744,16 @@ static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg, int jobnr, int
}
}
}
- varc = (varc - (((unsigned)sum * sum) >> 8) + 128) >> 8;
+ varc = (varc - (((unsigned) sum * sum) >> 8) + 128) >> 8;
ctx->mb_cmp[mb].value = varc;
- ctx->mb_cmp[mb].mb = mb;
+ ctx->mb_cmp[mb].mb = mb;
}
} else { // 10-bit
int const linesize = ctx->m.linesize >> 1;
for (mb_x = 0; mb_x < ctx->m.mb_width; ++mb_x) {
- uint16_t *pix = (uint16_t*)ctx->thread[0]->src[0] + ((mb_y << 4) * linesize) + (mb_x << 4);
+ uint16_t *pix = (uint16_t *)ctx->thread[0]->src[0] +
+ ((mb_y << 4) * linesize) + (mb_x << 4);
unsigned mb = mb_y * ctx->m.mb_width + mb_x;
int sum = 0;
int sqsum = 0;
@@ -678,8 +763,8 @@ static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg, int jobnr, int
for (i = 0; i < 16; ++i) {
for (j = 0; j < 16; ++j) {
// Turn 16-bit pixels into 10-bit ones.
- int const sample = (unsigned)pix[j] >> 6;
- sum += sample;
+ int const sample = (unsigned) pix[j] >> 6;
+ sum += sample;
sqsum += sample * sample;
// 2^10 * 2^10 * 16 * 16 = 2^28, which is less than INT_MAX
}
@@ -688,7 +773,7 @@ static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg, int jobnr, int
mean = sum >> 8; // 16*16 == 2^8
sqmean = sqsum >> 8;
ctx->mb_cmp[mb].value = sqmean - mean * mean;
- ctx->mb_cmp[mb].mb = mb;
+ ctx->mb_cmp[mb].mb = mb;
}
}
return 0;
@@ -702,14 +787,15 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
for (q = 1; q < avctx->qmax; q++) {
ctx->qscale = q;
- avctx->execute2(avctx, dnxhd_calc_bits_thread, NULL, NULL, ctx->m.mb_height);
+ avctx->execute2(avctx, dnxhd_calc_bits_thread,
+ NULL, NULL, ctx->m.mb_height);
}
- up_step = down_step = 2<<LAMBDA_FRAC_BITS;
- lambda = ctx->lambda;
+ up_step = down_step = 2 << LAMBDA_FRAC_BITS;
+ lambda = ctx->lambda;
for (;;) {
int bits = 0;
- int end = 0;
+ int end = 0;
if (lambda == last_higher) {
lambda++;
end = 1; // need to set final qscales/bits
@@ -718,28 +804,29 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
for (x = 0; x < ctx->m.mb_width; x++) {
unsigned min = UINT_MAX;
int qscale = 1;
- int mb = y*ctx->m.mb_width+x;
+ int mb = y * ctx->m.mb_width + x;
for (q = 1; q < avctx->qmax; q++) {
- unsigned score = ctx->mb_rc[q][mb].bits*lambda+
- ((unsigned)ctx->mb_rc[q][mb].ssd<<LAMBDA_FRAC_BITS);
+ unsigned score = ctx->mb_rc[q][mb].bits * lambda +
+ ((unsigned) ctx->mb_rc[q][mb].ssd << LAMBDA_FRAC_BITS);
if (score < min) {
- min = score;
+ min = score;
qscale = q;
}
}
bits += ctx->mb_rc[qscale][mb].bits;
ctx->mb_qscale[mb] = qscale;
- ctx->mb_bits[mb] = ctx->mb_rc[qscale][mb].bits;
+ ctx->mb_bits[mb] = ctx->mb_rc[qscale][mb].bits;
}
- bits = (bits+31)&~31; // padding
+ bits = (bits + 31) & ~31; // padding
if (bits > ctx->frame_bits)
break;
}
- //av_dlog(ctx->m.avctx, "lambda %d, up %u, down %u, bits %d, frame %d\n",
- // lambda, last_higher, last_lower, bits, ctx->frame_bits);
+ // av_dlog(ctx->m.avctx,
+ // "lambda %d, up %u, down %u, bits %d, frame %d\n",
+ // lambda, last_higher, last_lower, bits, ctx->frame_bits);
if (end) {
if (bits > ctx->frame_bits)
- return -1;
+ return AVERROR(EINVAL);
break;
}
if (bits < ctx->frame_bits) {
@@ -758,7 +845,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
if (last_lower != INT_MAX)
lambda = (lambda+last_lower)>>1;
else if ((int64_t)lambda + up_step > INT_MAX)
- return -1;
+ return AVERROR(EINVAL);
else
lambda += up_step;
up_step = FFMIN((int64_t)up_step*5, INT_MAX);
@@ -785,7 +872,8 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
bits = 0;
ctx->qscale = qscale;
// XXX avoid recalculating bits
- ctx->m.avctx->execute2(ctx->m.avctx, dnxhd_calc_bits_thread, NULL, NULL, ctx->m.mb_height);
+ 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;
@@ -793,8 +881,10 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
if (bits > ctx->frame_bits)
break;
}
- //av_dlog(ctx->m.avctx, "%d, qscale %d, bits %d, frame %d, higher %d, lower %d\n",
- // ctx->m.avctx->frame_number, qscale, bits, ctx->frame_bits, last_higher, last_lower);
+ // av_dlog(ctx->m.avctx,
+ // "%d, qscale %d, bits %d, frame %d, higher %d, lower %d\n",
+ // ctx->m.avctx->frame_number, qscale, bits, ctx->frame_bits,
+ // last_higher, last_lower);
if (bits < ctx->frame_bits) {
if (qscale == 1)
return 1;
@@ -804,7 +894,7 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
}
last_lower = FFMIN(qscale, last_lower);
if (last_higher != 0)
- qscale = (qscale+last_higher)>>1;
+ qscale = (qscale + last_higher) >> 1;
else
qscale -= down_step++;
if (qscale < 1)
@@ -815,12 +905,12 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
break;
last_higher = FFMAX(qscale, last_higher);
if (last_lower != INT_MAX)
- qscale = (qscale+last_lower)>>1;
+ qscale = (qscale + last_lower) >> 1;
else
qscale += up_step++;
down_step = 1;
if (qscale >= ctx->m.avctx->qmax)
- return -1;
+ return AVERROR(EINVAL);
}
}
//av_dlog(ctx->m.avctx, "out qscale %d\n", qscale);
@@ -835,11 +925,12 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
static inline int get_bucket(int value, int shift)
{
value >>= shift;
- value &= NBUCKETS - 1;
+ value &= NBUCKETS - 1;
return NBUCKETS - 1 - value;
}
-static void radix_count(const RCCMPEntry *data, int size, int buckets[RADIX_PASSES][NBUCKETS])
+static void radix_count(const RCCMPEntry *data, int size,
+ int buckets[RADIX_PASSES][NBUCKETS])
{
int i, j;
memset(buckets, 0, sizeof(buckets[0][0]) * RADIX_PASSES * NBUCKETS);
@@ -859,12 +950,13 @@ static void radix_count(const RCCMPEntry *data, int size, int buckets[RADIX_PASS
}
}
-static void radix_sort_pass(RCCMPEntry *dst, const RCCMPEntry *data, int size, int buckets[NBUCKETS], int pass)
+static void radix_sort_pass(RCCMPEntry *dst, const RCCMPEntry *data,
+ int size, int buckets[NBUCKETS], int pass)
{
int shift = pass * BUCKET_BITS;
int i;
for (i = 0; i < size; i++) {
- int v = get_bucket(data[i].value, shift);
+ int v = get_bucket(data[i].value, shift);
int pos = buckets[v]++;
dst[pos] = data[i];
}
@@ -873,7 +965,7 @@ static void radix_sort_pass(RCCMPEntry *dst, const RCCMPEntry *data, int size, i
static void radix_sort(RCCMPEntry *data, int size)
{
int buckets[RADIX_PASSES][NBUCKETS];
- RCCMPEntry *tmp = av_malloc(sizeof(*tmp) * size);
+ RCCMPEntry *tmp = av_malloc_array(size, sizeof(*tmp));
radix_count(data, size, buckets);
radix_sort_pass(tmp, data, size, buckets[0], 0);
radix_sort_pass(data, tmp, size, buckets[1], 1);
@@ -889,33 +981,38 @@ static int dnxhd_encode_fast(AVCodecContext *avctx, DNXHDEncContext *ctx)
int max_bits = 0;
int ret, x, y;
if ((ret = dnxhd_find_qscale(ctx)) < 0)
- return -1;
+ return ret;
for (y = 0; y < ctx->m.mb_height; y++) {
for (x = 0; x < ctx->m.mb_width; x++) {
- int mb = y*ctx->m.mb_width+x;
+ int mb = y * ctx->m.mb_width + x;
int delta_bits;
ctx->mb_qscale[mb] = ctx->qscale;
ctx->mb_bits[mb] = ctx->mb_rc[ctx->qscale][mb].bits;
max_bits += ctx->mb_rc[ctx->qscale][mb].bits;
if (!RC_VARIANCE) {
- delta_bits = ctx->mb_rc[ctx->qscale][mb].bits-ctx->mb_rc[ctx->qscale+1][mb].bits;
+ delta_bits = ctx->mb_rc[ctx->qscale][mb].bits -
+ ctx->mb_rc[ctx->qscale + 1][mb].bits;
ctx->mb_cmp[mb].mb = mb;
- ctx->mb_cmp[mb].value = delta_bits ?
- ((ctx->mb_rc[ctx->qscale][mb].ssd-ctx->mb_rc[ctx->qscale+1][mb].ssd)*100)/delta_bits
- : INT_MIN; //avoid increasing qscale
+ ctx->mb_cmp[mb].value =
+ delta_bits ? ((ctx->mb_rc[ctx->qscale][mb].ssd -
+ ctx->mb_rc[ctx->qscale + 1][mb].ssd) * 100) /
+ delta_bits
+ : INT_MIN; // avoid increasing qscale
}
}
- max_bits += 31; //worst padding
+ max_bits += 31; // worst padding
}
if (!ret) {
if (RC_VARIANCE)
- avctx->execute2(avctx, dnxhd_mb_var_thread, NULL, NULL, ctx->m.mb_height);
+ 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;
- max_bits -= ctx->mb_rc[ctx->qscale][mb].bits - ctx->mb_rc[ctx->qscale+1][mb].bits;
- ctx->mb_qscale[mb] = ctx->qscale+1;
- ctx->mb_bits[mb] = ctx->mb_rc[ctx->qscale+1][mb].bits;
+ max_bits -= ctx->mb_rc[ctx->qscale][mb].bits -
+ ctx->mb_rc[ctx->qscale + 1][mb].bits;
+ ctx->mb_qscale[mb] = ctx->qscale + 1;
+ ctx->mb_bits[mb] = ctx->mb_rc[ctx->qscale + 1][mb].bits;
}
}
return 0;
@@ -950,7 +1047,7 @@ static int dnxhd_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
dnxhd_load_picture(ctx, frame);
- encode_coding_unit:
+encode_coding_unit:
for (i = 0; i < 3; i++) {
ctx->src[i] = frame->data[i];
if (ctx->interlaced && ctx->cur_field)
@@ -966,7 +1063,7 @@ static int dnxhd_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR,
"picture could not fit ratecontrol constraints, increase qmax\n");
- return -1;
+ return ret;
}
dnxhd_setup_threads_slices(ctx);
@@ -981,14 +1078,15 @@ static int dnxhd_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
avctx->execute2(avctx, dnxhd_encode_thread, buf, NULL, ctx->m.mb_height);
av_assert1(640 + offset + 4 <= ctx->cid_table->coding_unit_size);
- memset(buf + 640 + offset, 0, ctx->cid_table->coding_unit_size - 4 - offset - 640);
+ memset(buf + 640 + offset, 0,
+ ctx->cid_table->coding_unit_size - 4 - offset - 640);
AV_WB32(buf + ctx->cid_table->coding_unit_size - 4, 0x600DC0DE); // EOF
if (ctx->interlaced && first_field) {
first_field = 0;
ctx->cur_field ^= 1;
- buf += ctx->cid_table->coding_unit_size;
+ buf += ctx->cid_table->coding_unit_size;
goto encode_coding_unit;
}
@@ -1002,11 +1100,11 @@ static int dnxhd_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
static av_cold int dnxhd_encode_end(AVCodecContext *avctx)
{
DNXHDEncContext *ctx = avctx->priv_data;
- int max_level = 1<<(ctx->cid_table->bit_depth+2);
+ int max_level = 1 << (ctx->cid_table->bit_depth + 2);
int i;
- av_free(ctx->vlc_codes-max_level*2);
- av_free(ctx->vlc_bits -max_level*2);
+ av_free(ctx->vlc_codes - max_level * 2);
+ av_free(ctx->vlc_bits - max_level * 2);
av_freep(&ctx->run_codes);
av_freep(&ctx->run_bits);
@@ -1045,9 +1143,11 @@ AVCodec ff_dnxhd_encoder = {
.encode2 = dnxhd_encode_picture,
.close = dnxhd_encode_end,
.capabilities = CODEC_CAP_SLICE_THREADS,
- .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P,
- AV_PIX_FMT_YUV422P10,
- AV_PIX_FMT_NONE },
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUV422P10,
+ AV_PIX_FMT_NONE
+ },
.priv_class = &dnxhd_class,
.defaults = dnxhd_defaults,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.h b/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.h
index 110b0ad9e2f..4e96fa52764 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.h
@@ -89,7 +89,8 @@ typedef struct DNXHDEncContext {
RCCMPEntry *mb_cmp;
RCEntry (*mb_rc)[8160];
- void (*get_pixels_8x4_sym)(int16_t * /*align 16*/, const uint8_t *, int);
+ void (*get_pixels_8x4_sym)(int16_t * /* align 16 */,
+ const uint8_t *, ptrdiff_t);
} DNXHDEncContext;
void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx);
diff --git a/chromium/third_party/ffmpeg/libavcodec/dpx.c b/chromium/third_party/ffmpeg/libavcodec/dpx.c
index 5c3c3e81cb3..a21362eb113 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dpx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dpx.c
@@ -20,6 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/imgutils.h"
#include "bytestream.h"
#include "avcodec.h"
@@ -146,6 +147,16 @@ static int decode_frame(AVCodecContext *avctx,
else
avctx->sample_aspect_ratio = (AVRational){ 0, 1 };
+ if (offset >= 1724 + 4) {
+ buf = avpkt->data + 1724;
+ i = read32(&buf, endian);
+ if(i) {
+ AVRational q = av_d2q(av_int2float(i), 4096);
+ if (q.num > 0 && q.den > 0)
+ avctx->time_base = av_inv_q(q);
+ }
+ }
+
switch (descriptor) {
case 6: // Y
elements = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/dsd_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/dsd_tablegen.c
new file mode 100644
index 00000000000..dbeb9fe2057
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/dsd_tablegen.c
@@ -0,0 +1,38 @@
+/*
+ * Generate a header file for hardcoded DSD tables
+ *
+ * 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 "dsd_tablegen.h"
+#include "tableprint.h"
+#include <inttypes.h>
+
+int main(void)
+{
+ dsd_ctables_tableinit();
+
+ write_fileheader();
+
+ printf("static const double ctables[CTABLES][256] = {\n");
+ write_float_2d_array(ctables, CTABLES, 256);
+ printf("};\n");
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dsd_tablegen.h b/chromium/third_party/ffmpeg/libavcodec/dsd_tablegen.h
new file mode 100644
index 00000000000..6afb4167daa
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/dsd_tablegen.h
@@ -0,0 +1,95 @@
+/*
+ * Header file for hardcoded DSD tables
+ * based on BSD licensed dsd2pcm by Sebastian Gesemann
+ * Copyright (c) 2009, 2011 Sebastian Gesemann. All rights reserved.
+ *
+ * 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_DSD_TABLEGEN_H
+#define AVCODEC_DSD_TABLEGEN_H
+
+#include <stdint.h>
+#include "libavutil/attributes.h"
+
+#define HTAPS 48 /** number of FIR constants */
+#define CTABLES ((HTAPS + 7) / 8) /** number of "8 MACs" lookup tables */
+
+#if CONFIG_HARDCODED_TABLES
+#define dsd_ctables_tableinit()
+#include "libavcodec/dsd_tables.h"
+#else
+#include "libavutil/common.h"
+
+/*
+ * Properties of this 96-tap lowpass filter when applied on a signal
+ * with sampling rate of 44100*64 Hz:
+ *
+ * () has a delay of 17 microseconds.
+ *
+ * () flat response up to 48 kHz
+ *
+ * () if you downsample afterwards by a factor of 8, the
+ * spectrum below 70 kHz is practically alias-free.
+ *
+ * () stopband rejection is about 160 dB
+ *
+ * The coefficient tables ("ctables") take only 6 Kibi Bytes and
+ * should fit into a modern processor's fast cache.
+ */
+
+/**
+ * The 2nd half (48 coeffs) of a 96-tap symmetric lowpass filter
+ */
+static const double htaps[HTAPS] = {
+ 0.09950731974056658, 0.09562845727714668, 0.08819647126516944,
+ 0.07782552527068175, 0.06534876523171299, 0.05172629311427257,
+ 0.0379429484910187, 0.02490921351762261, 0.0133774746265897,
+ 0.003883043418804416, -0.003284703416210726, -0.008080250212687497,
+ -0.01067241812471033, -0.01139427235000863, -0.0106813877974587,
+ -0.009007905078766049, -0.006828859761015335, -0.004535184322001496,
+ -0.002425035959059578, -0.0006922187080790708, 0.0005700762133516592,
+ 0.001353838005269448, 0.001713709169690937, 0.001742046839472948,
+ 0.001545601648013235, 0.001226696225277855, 0.0008704322683580222,
+ 0.0005381636200535649, 0.000266446345425276, 7.002968738383528e-05,
+ -5.279407053811266e-05, -0.0001140625650874684, -0.0001304796361231895,
+ -0.0001189970287491285, -9.396247155265073e-05, -6.577634378272832e-05,
+ -4.07492895872535e-05, -2.17407957554587e-05, -9.163058931391722e-06,
+ -2.017460145032201e-06, 1.249721855219005e-06, 2.166655190537392e-06,
+ 1.930520892991082e-06, 1.319400334374195e-06, 7.410039764949091e-07,
+ 3.423230509967409e-07, 1.244182214744588e-07, 3.130441005359396e-08
+};
+
+static float ctables[CTABLES][256];
+
+static av_cold void dsd_ctables_tableinit(void)
+{
+ int t, e, m, k;
+ double acc;
+ for (t = 0; t < CTABLES; ++t) {
+ k = FFMIN(HTAPS - t * 8, 8);
+ for (e = 0; e < 256; ++e) {
+ acc = 0.0;
+ for (m = 0; m < k; ++m)
+ acc += (((e >> (7 - m)) & 1) * 2 - 1) * htaps[t * 8 + m];
+ ctables[CTABLES - 1 - t][e] = (float)acc;
+ }
+ }
+}
+#endif /* CONFIG_HARDCODED_TABLES */
+
+#endif /* AVCODEC_DSD_TABLEGEN_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/dsddec.c b/chromium/third_party/ffmpeg/libavcodec/dsddec.c
new file mode 100644
index 00000000000..f1dfd4b2313
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/dsddec.c
@@ -0,0 +1,167 @@
+/*
+ * Direct Stream Digital (DSD) decoder
+ * based on BSD licensed dsd2pcm by Sebastian Gesemann
+ * Copyright (c) 2009, 2011 Sebastian Gesemann. All rights reserved.
+ * Copyright (c) 2014 Peter Ross
+ *
+ * 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
+ * Direct Stream Digital (DSD) decoder
+ */
+
+#include "libavcodec/internal.h"
+#include "libavcodec/mathops.h"
+#include "avcodec.h"
+#include "dsd_tablegen.h"
+
+#define FIFOSIZE 16 /** must be a power of two */
+#define FIFOMASK (FIFOSIZE - 1) /** bit mask for FIFO offsets */
+
+#if FIFOSIZE * 8 < HTAPS * 2
+#error "FIFOSIZE too small"
+#endif
+
+/**
+ * Per-channel buffer
+ */
+typedef struct {
+ unsigned char buf[FIFOSIZE];
+ unsigned pos;
+} DSDContext;
+
+static void dsd2pcm_translate(DSDContext* s, size_t samples, int lsbf,
+ const unsigned char *src, ptrdiff_t src_stride,
+ float *dst, ptrdiff_t dst_stride)
+{
+ unsigned pos, i;
+ unsigned char* p;
+ double sum;
+
+ pos = s->pos;
+
+ while (samples-- > 0) {
+ s->buf[pos] = lsbf ? ff_reverse[*src] : *src;
+ src += src_stride;
+
+ p = s->buf + ((pos - CTABLES) & FIFOMASK);
+ *p = ff_reverse[*p];
+
+ sum = 0.0;
+ for (i = 0; i < CTABLES; i++) {
+ unsigned char a = s->buf[(pos - i) & FIFOMASK];
+ unsigned char b = s->buf[(pos - (CTABLES*2 - 1) + i) & FIFOMASK];
+ sum += ctables[i][a] + ctables[i][b];
+ }
+
+ *dst = (float)sum;
+ dst += dst_stride;
+
+ pos = (pos + 1) & FIFOMASK;
+ }
+
+ s->pos = pos;
+}
+
+static av_cold void init_static_data(void)
+{
+ static int done = 0;
+ if (done)
+ return;
+ dsd_ctables_tableinit();
+ done = 1;
+}
+
+static av_cold int decode_init(AVCodecContext *avctx)
+{
+ DSDContext * s;
+ int i;
+
+ init_static_data();
+
+ s = av_malloc_array(sizeof(DSDContext), avctx->channels);
+ if (!s)
+ return AVERROR(ENOMEM);
+
+ for (i = 0; i < avctx->channels; i++) {
+ s[i].pos = 0;
+ memset(s[i].buf, 0x69, sizeof(s[i].buf));
+
+ /* 0x69 = 01101001
+ * This pattern "on repeat" makes a low energy 352.8 kHz tone
+ * and a high energy 1.0584 MHz tone which should be filtered
+ * out completely by any playback system --> silence
+ */
+ }
+
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
+ avctx->priv_data = s;
+ return 0;
+}
+
+static int decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame_ptr, AVPacket *avpkt)
+{
+ DSDContext * s = avctx->priv_data;
+ AVFrame *frame = data;
+ int ret, i;
+ int lsbf = avctx->codec_id == AV_CODEC_ID_DSD_LSBF || avctx->codec_id == AV_CODEC_ID_DSD_LSBF_PLANAR;
+ int src_next;
+ int src_stride;
+
+ frame->nb_samples = avpkt->size / avctx->channels;
+
+ if (avctx->codec_id == AV_CODEC_ID_DSD_LSBF_PLANAR || avctx->codec_id == AV_CODEC_ID_DSD_MSBF_PLANAR) {
+ src_next = frame->nb_samples;
+ src_stride = 1;
+ } else {
+ src_next = 1;
+ src_stride = avctx->channels;
+ }
+
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+ return ret;
+
+ for (i = 0; i < avctx->channels; i++) {
+ float * dst = ((float **)frame->extended_data)[i];
+ dsd2pcm_translate(&s[i], frame->nb_samples, lsbf,
+ avpkt->data + i * src_next, src_stride,
+ dst, 1);
+ }
+
+ *got_frame_ptr = 1;
+ return frame->nb_samples * avctx->channels;
+}
+
+#define DSD_DECODER(id_, name_, long_name_) \
+AVCodec ff_##name_##_decoder = { \
+ .name = #name_, \
+ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
+ .type = AVMEDIA_TYPE_AUDIO, \
+ .id = AV_CODEC_ID_##id_, \
+ .init = decode_init, \
+ .decode = decode_frame, \
+ .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, \
+ AV_SAMPLE_FMT_NONE }, \
+};
+
+DSD_DECODER(DSD_LSBF, dsd_lsbf, "DSD (Direct Stream Digital), least significant bit first")
+DSD_DECODER(DSD_MSBF, dsd_msbf, "DSD (Direct Stream Digital), most significant bit first")
+DSD_DECODER(DSD_MSBF_PLANAR, dsd_msbf_planar, "DSD (Direct Stream Digital), most significant bit first, planar")
+DSD_DECODER(DSD_LSBF_PLANAR, dsd_lsbf_planar, "DSD (Direct Stream Digital), least significant bit first, planar")
diff --git a/chromium/third_party/ffmpeg/libavcodec/dsputil.c b/chromium/third_party/ffmpeg/libavcodec/dsputil.c
index 0e9e34798ef..21e3feaca9a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dsputil.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dsputil.c
@@ -43,34 +43,24 @@
#include "config.h"
#include "diracdsp.h"
-uint32_t ff_squareTbl[512] = {0, };
+uint32_t ff_square_tab[512] = { 0, };
#define BIT_DEPTH 16
-#include "dsputil_template.c"
+#include "dsputilenc_template.c"
#undef BIT_DEPTH
#define BIT_DEPTH 8
+#include "hpel_template.c"
+#include "tpel_template.c"
#include "dsputil_template.c"
+#include "dsputilenc_template.c"
// 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size
-#define pb_7f (~0UL/255 * 0x7f)
-#define pb_80 (~0UL/255 * 0x80)
-
-/* Specific zigzag scan for 248 idct. NOTE that unlike the
- specification, we interleave the fields */
-const uint8_t ff_zigzag248_direct[64] = {
- 0, 8, 1, 9, 16, 24, 2, 10,
- 17, 25, 32, 40, 48, 56, 33, 41,
- 18, 26, 3, 11, 4, 12, 19, 27,
- 34, 42, 49, 57, 50, 58, 35, 43,
- 20, 28, 5, 13, 6, 14, 21, 29,
- 36, 44, 51, 59, 52, 60, 37, 45,
- 22, 30, 7, 15, 23, 31, 38, 46,
- 53, 61, 54, 62, 39, 47, 55, 63,
-};
+#define pb_7f (~0UL / 255 * 0x7f)
+#define pb_80 (~0UL / 255 * 0x80)
const uint8_t ff_alternate_horizontal_scan[64] = {
- 0, 1, 2, 3, 8, 9, 16, 17,
+ 0, 1, 2, 3, 8, 9, 16, 17,
10, 11, 4, 5, 6, 7, 15, 14,
13, 12, 19, 18, 24, 25, 32, 33,
26, 27, 20, 21, 22, 23, 28, 29,
@@ -81,7 +71,7 @@ const uint8_t ff_alternate_horizontal_scan[64] = {
};
const uint8_t ff_alternate_vertical_scan[64] = {
- 0, 8, 16, 24, 1, 9, 2, 10,
+ 0, 8, 16, 24, 1, 9, 2, 10,
17, 25, 32, 40, 48, 56, 57, 49,
41, 33, 26, 18, 3, 11, 4, 12,
19, 27, 34, 42, 50, 58, 35, 43,
@@ -92,39 +82,37 @@ const uint8_t ff_alternate_vertical_scan[64] = {
};
/* Input permutation for the simple_idct_mmx */
-static const uint8_t simple_mmx_permutation[64]={
- 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
- 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
- 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
- 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
- 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
- 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
- 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
- 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
+static const uint8_t simple_mmx_permutation[64] = {
+ 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
+ 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
+ 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
+ 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
+ 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
+ 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
+ 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
+ 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
};
-static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7};
+static const uint8_t idct_sse2_row_perm[8] = { 0, 4, 1, 5, 2, 6, 3, 7 };
av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st,
const uint8_t *src_scantable)
{
- int i;
- int end;
+ int i, end;
- st->scantable= src_scantable;
+ st->scantable = src_scantable;
- for(i=0; i<64; i++){
- int j;
- j = src_scantable[i];
+ for (i = 0; i < 64; i++) {
+ int j = src_scantable[i];
st->permutated[i] = permutation[j];
}
- end=-1;
- for(i=0; i<64; i++){
- int j;
- j = st->permutated[i];
- if(j>end) end=j;
- st->raster_end[i]= end;
+ end = -1;
+ for (i = 0; i < 64; i++) {
+ int j = st->permutated[i];
+ if (j > end)
+ end = j;
+ st->raster_end[i] = end;
}
}
@@ -133,51 +121,51 @@ av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation,
{
int i;
- switch(idct_permutation_type){
+ switch (idct_permutation_type) {
case FF_NO_IDCT_PERM:
- for(i=0; i<64; i++)
- idct_permutation[i]= i;
+ for (i = 0; i < 64; i++)
+ idct_permutation[i] = i;
break;
case FF_LIBMPEG2_IDCT_PERM:
- for(i=0; i<64; i++)
- idct_permutation[i]= (i & 0x38) | ((i & 6) >> 1) | ((i & 1) << 2);
+ for (i = 0; i < 64; i++)
+ idct_permutation[i] = (i & 0x38) | ((i & 6) >> 1) | ((i & 1) << 2);
break;
case FF_SIMPLE_IDCT_PERM:
- for(i=0; i<64; i++)
- idct_permutation[i]= simple_mmx_permutation[i];
+ for (i = 0; i < 64; i++)
+ idct_permutation[i] = simple_mmx_permutation[i];
break;
case FF_TRANSPOSE_IDCT_PERM:
- for(i=0; i<64; i++)
- idct_permutation[i]= ((i&7)<<3) | (i>>3);
+ for (i = 0; i < 64; i++)
+ idct_permutation[i] = ((i & 7) << 3) | (i >> 3);
break;
case FF_PARTTRANS_IDCT_PERM:
- for(i=0; i<64; i++)
- idct_permutation[i]= (i&0x24) | ((i&3)<<3) | ((i>>3)&3);
+ for (i = 0; i < 64; i++)
+ idct_permutation[i] = (i & 0x24) | ((i & 3) << 3) | ((i >> 3) & 3);
break;
case FF_SSE2_IDCT_PERM:
- for(i=0; i<64; i++)
- idct_permutation[i]= (i&0x38) | idct_sse2_row_perm[i&7];
+ for (i = 0; i < 64; i++)
+ idct_permutation[i] = (i & 0x38) | idct_sse2_row_perm[i & 7];
break;
default:
- av_log(NULL, AV_LOG_ERROR, "Internal error, IDCT permutation not set\n");
+ av_log(NULL, AV_LOG_ERROR,
+ "Internal error, IDCT permutation not set\n");
}
}
-static int pix_sum_c(uint8_t * pix, int line_size)
+static int pix_sum_c(uint8_t *pix, int line_size)
{
- int s, i, j;
+ int s = 0, i, j;
- s = 0;
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j += 8) {
- s += pix[0];
- s += pix[1];
- s += pix[2];
- s += pix[3];
- s += pix[4];
- s += pix[5];
- s += pix[6];
- s += pix[7];
+ s += pix[0];
+ s += pix[1];
+ s += pix[2];
+ s += pix[3];
+ s += pix[4];
+ s += pix[5];
+ s += pix[6];
+ s += pix[7];
pix += 8;
}
pix += line_size - 16;
@@ -185,12 +173,11 @@ static int pix_sum_c(uint8_t * pix, int line_size)
return s;
}
-static int pix_norm1_c(uint8_t * pix, int line_size)
+static int pix_norm1_c(uint8_t *pix, int line_size)
{
- int s, i, j;
- uint32_t *sq = ff_squareTbl + 256;
+ int s = 0, i, j;
+ uint32_t *sq = ff_square_tab + 256;
- s = 0;
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j += 8) {
#if 0
@@ -204,26 +191,26 @@ static int pix_norm1_c(uint8_t * pix, int line_size)
s += sq[pix[7]];
#else
#if HAVE_FAST_64BIT
- register uint64_t x=*(uint64_t*)pix;
- s += sq[x&0xff];
- s += sq[(x>>8)&0xff];
- s += sq[(x>>16)&0xff];
- s += sq[(x>>24)&0xff];
- s += sq[(x>>32)&0xff];
- s += sq[(x>>40)&0xff];
- s += sq[(x>>48)&0xff];
- s += sq[(x>>56)&0xff];
+ register uint64_t x = *(uint64_t *) pix;
+ s += sq[x & 0xff];
+ s += sq[(x >> 8) & 0xff];
+ s += sq[(x >> 16) & 0xff];
+ s += sq[(x >> 24) & 0xff];
+ s += sq[(x >> 32) & 0xff];
+ s += sq[(x >> 40) & 0xff];
+ s += sq[(x >> 48) & 0xff];
+ s += sq[(x >> 56) & 0xff];
#else
- register uint32_t x=*(uint32_t*)pix;
- s += sq[x&0xff];
- s += sq[(x>>8)&0xff];
- s += sq[(x>>16)&0xff];
- s += sq[(x>>24)&0xff];
- x=*(uint32_t*)(pix+4);
- s += sq[x&0xff];
- s += sq[(x>>8)&0xff];
- s += sq[(x>>16)&0xff];
- s += sq[(x>>24)&0xff];
+ register uint32_t x = *(uint32_t *) pix;
+ s += sq[x & 0xff];
+ s += sq[(x >> 8) & 0xff];
+ s += sq[(x >> 16) & 0xff];
+ s += sq[(x >> 24) & 0xff];
+ x = *(uint32_t *) (pix + 4);
+ s += sq[x & 0xff];
+ s += sq[(x >> 8) & 0xff];
+ s += sq[(x >> 16) & 0xff];
+ s += sq[(x >> 24) & 0xff];
#endif
#endif
pix += 8;
@@ -233,22 +220,22 @@ static int pix_norm1_c(uint8_t * pix, int line_size)
return s;
}
-static void bswap_buf(uint32_t *dst, const uint32_t *src, int w){
+static void bswap_buf(uint32_t *dst, const uint32_t *src, int w)
+{
int i;
- for(i=0; i+8<=w; i+=8){
- dst[i+0]= av_bswap32(src[i+0]);
- dst[i+1]= av_bswap32(src[i+1]);
- dst[i+2]= av_bswap32(src[i+2]);
- dst[i+3]= av_bswap32(src[i+3]);
- dst[i+4]= av_bswap32(src[i+4]);
- dst[i+5]= av_bswap32(src[i+5]);
- dst[i+6]= av_bswap32(src[i+6]);
- dst[i+7]= av_bswap32(src[i+7]);
- }
- for(;i<w; i++){
- dst[i+0]= av_bswap32(src[i+0]);
+ for (i = 0; i + 8 <= w; i += 8) {
+ dst[i + 0] = av_bswap32(src[i + 0]);
+ dst[i + 1] = av_bswap32(src[i + 1]);
+ dst[i + 2] = av_bswap32(src[i + 2]);
+ dst[i + 3] = av_bswap32(src[i + 3]);
+ dst[i + 4] = av_bswap32(src[i + 4]);
+ dst[i + 5] = av_bswap32(src[i + 5]);
+ dst[i + 6] = av_bswap32(src[i + 6]);
+ dst[i + 7] = av_bswap32(src[i + 7]);
}
+ for (; i < w; i++)
+ dst[i + 0] = av_bswap32(src[i + 0]);
}
static void bswap16_buf(uint16_t *dst, const uint16_t *src, int len)
@@ -257,61 +244,61 @@ static void bswap16_buf(uint16_t *dst, const uint16_t *src, int len)
*dst++ = av_bswap16(*src++);
}
-static int sse4_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h)
+static int sse4_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int s, i;
- uint32_t *sq = ff_squareTbl + 256;
+ int s = 0, i;
+ uint32_t *sq = ff_square_tab + 256;
- s = 0;
for (i = 0; i < h; i++) {
- s += sq[pix1[0] - pix2[0]];
- s += sq[pix1[1] - pix2[1]];
- s += sq[pix1[2] - pix2[2]];
- s += sq[pix1[3] - pix2[3]];
+ s += sq[pix1[0] - pix2[0]];
+ s += sq[pix1[1] - pix2[1]];
+ s += sq[pix1[2] - pix2[2]];
+ s += sq[pix1[3] - pix2[3]];
pix1 += line_size;
pix2 += line_size;
}
return s;
}
-static int sse8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h)
+static int sse8_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int s, i;
- uint32_t *sq = ff_squareTbl + 256;
+ int s = 0, i;
+ uint32_t *sq = ff_square_tab + 256;
- s = 0;
for (i = 0; i < h; i++) {
- s += sq[pix1[0] - pix2[0]];
- s += sq[pix1[1] - pix2[1]];
- s += sq[pix1[2] - pix2[2]];
- s += sq[pix1[3] - pix2[3]];
- s += sq[pix1[4] - pix2[4]];
- s += sq[pix1[5] - pix2[5]];
- s += sq[pix1[6] - pix2[6]];
- s += sq[pix1[7] - pix2[7]];
+ s += sq[pix1[0] - pix2[0]];
+ s += sq[pix1[1] - pix2[1]];
+ s += sq[pix1[2] - pix2[2]];
+ s += sq[pix1[3] - pix2[3]];
+ s += sq[pix1[4] - pix2[4]];
+ s += sq[pix1[5] - pix2[5]];
+ s += sq[pix1[6] - pix2[6]];
+ s += sq[pix1[7] - pix2[7]];
pix1 += line_size;
pix2 += line_size;
}
return s;
}
-static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int sse16_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int s, i;
- uint32_t *sq = ff_squareTbl + 256;
+ int s = 0, i;
+ uint32_t *sq = ff_square_tab + 256;
- s = 0;
for (i = 0; i < h; i++) {
- s += sq[pix1[ 0] - pix2[ 0]];
- s += sq[pix1[ 1] - pix2[ 1]];
- s += sq[pix1[ 2] - pix2[ 2]];
- s += sq[pix1[ 3] - pix2[ 3]];
- s += sq[pix1[ 4] - pix2[ 4]];
- s += sq[pix1[ 5] - pix2[ 5]];
- s += sq[pix1[ 6] - pix2[ 6]];
- s += sq[pix1[ 7] - pix2[ 7]];
- s += sq[pix1[ 8] - pix2[ 8]];
- s += sq[pix1[ 9] - pix2[ 9]];
+ s += sq[pix1[0] - pix2[0]];
+ s += sq[pix1[1] - pix2[1]];
+ s += sq[pix1[2] - pix2[2]];
+ s += sq[pix1[3] - pix2[3]];
+ s += sq[pix1[4] - pix2[4]];
+ s += sq[pix1[5] - pix2[5]];
+ s += sq[pix1[6] - pix2[6]];
+ s += sq[pix1[7] - pix2[7]];
+ s += sq[pix1[8] - pix2[8]];
+ s += sq[pix1[9] - pix2[9]];
s += sq[pix1[10] - pix2[10]];
s += sq[pix1[11] - pix2[11]];
s += sq[pix1[12] - pix2[12]];
@@ -326,11 +313,12 @@ static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
}
static void diff_pixels_c(int16_t *av_restrict block, const uint8_t *s1,
- const uint8_t *s2, int stride){
+ const uint8_t *s2, int stride)
+{
int i;
/* read the pixels */
- for(i=0;i<8;i++) {
+ for (i = 0; i < 8; i++) {
block[0] = s1[0] - s2[0];
block[1] = s1[1] - s2[1];
block[2] = s1[2] - s2[2];
@@ -339,9 +327,9 @@ static void diff_pixels_c(int16_t *av_restrict block, const uint8_t *s1,
block[5] = s1[5] - s2[5];
block[6] = s1[6] - s2[6];
block[7] = s1[7] - s2[7];
- s1 += stride;
- s2 += stride;
- block += 8;
+ s1 += stride;
+ s2 += stride;
+ block += 8;
}
}
@@ -351,7 +339,7 @@ static void put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixe
int i;
/* read the pixels */
- for(i=0;i<8;i++) {
+ for (i = 0; i < 8; i++) {
pixels[0] = av_clip_uint8(block[0]);
pixels[1] = av_clip_uint8(block[1]);
pixels[2] = av_clip_uint8(block[2]);
@@ -362,7 +350,7 @@ static void put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixe
pixels[7] = av_clip_uint8(block[7]);
pixels += line_size;
- block += 8;
+ block += 8;
}
}
@@ -411,7 +399,7 @@ static void put_signed_pixels_clamped_c(const int16_t *block,
else if (*block > 127)
*pixels = 255;
else
- *pixels = (uint8_t)(*block + 128);
+ *pixels = (uint8_t) (*block + 128);
block++;
pixels++;
}
@@ -419,13 +407,12 @@ static void put_signed_pixels_clamped_c(const int16_t *block,
}
}
-static void add_pixels8_c(uint8_t *av_restrict pixels,
- int16_t *block,
+static void add_pixels8_c(uint8_t *av_restrict pixels, int16_t *block,
int line_size)
{
int i;
- for(i=0;i<8;i++) {
+ for (i = 0; i < 8; i++) {
pixels[0] += block[0];
pixels[1] += block[1];
pixels[2] += block[2];
@@ -434,8 +421,8 @@ static void add_pixels8_c(uint8_t *av_restrict pixels,
pixels[5] += block[5];
pixels[6] += block[6];
pixels[7] += block[7];
- pixels += line_size;
- block += 8;
+ pixels += line_size;
+ block += 8;
}
}
@@ -445,7 +432,7 @@ static void add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixe
int i;
/* read the pixels */
- for(i=0;i<8;i++) {
+ for (i = 0; i < 8; i++) {
pixels[0] = av_clip_uint8(pixels[0] + block[0]);
pixels[1] = av_clip_uint8(pixels[1] + block[1]);
pixels[2] = av_clip_uint8(pixels[2] + block[2]);
@@ -454,8 +441,8 @@ static void add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixe
pixels[5] = av_clip_uint8(pixels[5] + block[5]);
pixels[6] = av_clip_uint8(pixels[6] + block[6]);
pixels[7] = av_clip_uint8(pixels[7] + block[7]);
- pixels += line_size;
- block += 8;
+ pixels += line_size;
+ block += 8;
}
}
@@ -491,9 +478,10 @@ static void add_pixels_clamped2_c(const int16_t *block, uint8_t *av_restrict pix
static int sum_abs_dctelem_c(int16_t *block)
{
- int sum=0, i;
- for(i=0; i<64; i++)
- sum+= FFABS(block[i]);
+ int sum = 0, i;
+
+ for (i = 0; i < 64; i++)
+ sum += FFABS(block[i]);
return sum;
}
@@ -517,813 +505,752 @@ static void fill_block8_c(uint8_t *block, uint8_t value, int line_size, int h)
}
}
-#define avg2(a,b) ((a+b+1)>>1)
-#define avg4(a,b,c,d) ((a+b+c+d+2)>>2)
+#define avg2(a, b) ((a + b + 1) >> 1)
+#define avg4(a, b, c, d) ((a + b + c + d + 2) >> 2)
-static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h, int x16, int y16, int rounder)
+static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h,
+ int x16, int y16, int rounder)
{
- const int A=(16-x16)*(16-y16);
- const int B=( x16)*(16-y16);
- const int C=(16-x16)*( y16);
- const int D=( x16)*( y16);
+ const int A = (16 - x16) * (16 - y16);
+ const int B = (x16) * (16 - y16);
+ const int C = (16 - x16) * (y16);
+ const int D = (x16) * (y16);
int i;
- for(i=0; i<h; i++)
- {
- dst[0]= (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + rounder)>>8;
- dst[1]= (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + rounder)>>8;
- dst[2]= (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + rounder)>>8;
- dst[3]= (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + rounder)>>8;
- dst[4]= (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + rounder)>>8;
- dst[5]= (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + rounder)>>8;
- dst[6]= (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + rounder)>>8;
- dst[7]= (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + rounder)>>8;
- dst+= stride;
- src+= stride;
+ for (i = 0; i < h; i++) {
+ dst[0] = (A * src[0] + B * src[1] + C * src[stride + 0] + D * src[stride + 1] + rounder) >> 8;
+ dst[1] = (A * src[1] + B * src[2] + C * src[stride + 1] + D * src[stride + 2] + rounder) >> 8;
+ dst[2] = (A * src[2] + B * src[3] + C * src[stride + 2] + D * src[stride + 3] + rounder) >> 8;
+ dst[3] = (A * src[3] + B * src[4] + C * src[stride + 3] + D * src[stride + 4] + rounder) >> 8;
+ dst[4] = (A * src[4] + B * src[5] + C * src[stride + 4] + D * src[stride + 5] + rounder) >> 8;
+ dst[5] = (A * src[5] + B * src[6] + C * src[stride + 5] + D * src[stride + 6] + rounder) >> 8;
+ dst[6] = (A * src[6] + B * src[7] + C * src[stride + 6] + D * src[stride + 7] + rounder) >> 8;
+ dst[7] = (A * src[7] + B * src[8] + C * src[stride + 7] + D * src[stride + 8] + rounder) >> 8;
+ dst += stride;
+ src += stride;
}
}
void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height)
+ int dxx, int dxy, int dyx, int dyy, int shift, int r,
+ int width, int height)
{
int y, vx, vy;
- const int s= 1<<shift;
+ const int s = 1 << shift;
width--;
height--;
- for(y=0; y<h; y++){
+ for (y = 0; y < h; y++) {
int x;
- vx= ox;
- vy= oy;
- for(x=0; x<8; x++){ //XXX FIXME optimize
- int src_x, src_y, frac_x, frac_y, index;
-
- src_x= vx>>16;
- src_y= vy>>16;
- frac_x= src_x&(s-1);
- frac_y= src_y&(s-1);
- src_x>>=shift;
- src_y>>=shift;
-
- if((unsigned)src_x < width){
- if((unsigned)src_y < height){
- index= src_x + src_y*stride;
- dst[y*stride + x]= ( ( src[index ]*(s-frac_x)
- + src[index +1]* frac_x )*(s-frac_y)
- + ( src[index+stride ]*(s-frac_x)
- + src[index+stride+1]* frac_x )* frac_y
- + r)>>(shift*2);
- }else{
- index= src_x + av_clip(src_y, 0, height)*stride;
- dst[y*stride + x]= ( ( src[index ]*(s-frac_x)
- + src[index +1]* frac_x )*s
- + r)>>(shift*2);
+ vx = ox;
+ vy = oy;
+ for (x = 0; x < 8; x++) { // FIXME: optimize
+ int index;
+ int src_x = vx >> 16;
+ int src_y = vy >> 16;
+ int frac_x = src_x & (s - 1);
+ int frac_y = src_y & (s - 1);
+
+ src_x >>= shift;
+ src_y >>= shift;
+
+ if ((unsigned) src_x < width) {
+ if ((unsigned) src_y < height) {
+ index = src_x + src_y * stride;
+ dst[y * stride + x] =
+ ((src[index] * (s - frac_x) +
+ src[index + 1] * frac_x) * (s - frac_y) +
+ (src[index + stride] * (s - frac_x) +
+ src[index + stride + 1] * frac_x) * frac_y +
+ r) >> (shift * 2);
+ } else {
+ index = src_x + av_clip(src_y, 0, height) * stride;
+ dst[y * stride + x] =
+ ((src[index] * (s - frac_x) +
+ src[index + 1] * frac_x) * s +
+ r) >> (shift * 2);
}
- }else{
- if((unsigned)src_y < height){
- index= av_clip(src_x, 0, width) + src_y*stride;
- dst[y*stride + x]= ( ( src[index ]*(s-frac_y)
- + src[index+stride ]* frac_y )*s
- + r)>>(shift*2);
- }else{
- index= av_clip(src_x, 0, width) + av_clip(src_y, 0, height)*stride;
- dst[y*stride + x]= src[index ];
+ } else {
+ if ((unsigned) src_y < height) {
+ index = av_clip(src_x, 0, width) + src_y * stride;
+ dst[y * stride + x] =
+ ((src[index] * (s - frac_y) +
+ src[index + stride] * frac_y) * s +
+ r) >> (shift * 2);
+ } else {
+ index = av_clip(src_x, 0, width) +
+ av_clip(src_y, 0, height) * stride;
+ dst[y * stride + x] = src[index];
}
}
- vx+= dxx;
- vy+= dyx;
+ vx += dxx;
+ vy += dyx;
}
ox += dxy;
oy += dyy;
}
}
-static inline void put_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- switch(width){
- case 2: put_pixels2_8_c (dst, src, stride, height); break;
- case 4: put_pixels4_8_c (dst, src, stride, height); break;
- case 8: put_pixels8_8_c (dst, src, stride, height); break;
- case 16:put_pixels16_8_c(dst, src, stride, height); break;
- }
-}
-
-static inline void put_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (683*(2*src[j] + src[j+1] + 1)) >> 11;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (683*(src[j] + 2*src[j+1] + 1)) >> 11;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (683*(2*src[j] + src[j+stride] + 1)) >> 11;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (2731*(4*src[j] + 3*src[j+1] + 3*src[j+stride] + 2*src[j+stride+1] + 6)) >> 15;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (683*(src[j] + 2*src[j+stride] + 1)) >> 11;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (2731*(2*src[j] + 3*src[j+1] + 3*src[j+stride] + 4*src[j+stride+1] + 6)) >> 15;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- switch(width){
- case 2: avg_pixels2_8_c (dst, src, stride, height); break;
- case 4: avg_pixels4_8_c (dst, src, stride, height); break;
- case 8: avg_pixels8_8_c (dst, src, stride, height); break;
- case 16:avg_pixels16_8_c(dst, src, stride, height); break;
- }
-}
-
-static inline void avg_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((683*(2*src[j] + src[j+1] + 1)) >> 11) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((683*(src[j] + 2*src[j+1] + 1)) >> 11) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((683*(2*src[j] + src[j+stride] + 1)) >> 11) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((2731*(4*src[j] + 3*src[j+1] + 3*src[j+stride] + 2*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((683*(src[j] + 2*src[j+stride] + 1)) >> 11) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((2731*(2*src[j] + 3*src[j+1] + 3*src[j+stride] + 4*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-#define QPEL_MC(r, OPNAME, RND, OP) \
-static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- for(i=0; i<h; i++)\
- {\
- OP(dst[0], (src[0]+src[1])*20 - (src[0]+src[2])*6 + (src[1]+src[3])*3 - (src[2]+src[4]));\
- OP(dst[1], (src[1]+src[2])*20 - (src[0]+src[3])*6 + (src[0]+src[4])*3 - (src[1]+src[5]));\
- OP(dst[2], (src[2]+src[3])*20 - (src[1]+src[4])*6 + (src[0]+src[5])*3 - (src[0]+src[6]));\
- OP(dst[3], (src[3]+src[4])*20 - (src[2]+src[5])*6 + (src[1]+src[6])*3 - (src[0]+src[7]));\
- OP(dst[4], (src[4]+src[5])*20 - (src[3]+src[6])*6 + (src[2]+src[7])*3 - (src[1]+src[8]));\
- OP(dst[5], (src[5]+src[6])*20 - (src[4]+src[7])*6 + (src[3]+src[8])*3 - (src[2]+src[8]));\
- OP(dst[6], (src[6]+src[7])*20 - (src[5]+src[8])*6 + (src[4]+src[8])*3 - (src[3]+src[7]));\
- OP(dst[7], (src[7]+src[8])*20 - (src[6]+src[8])*6 + (src[5]+src[7])*3 - (src[4]+src[6]));\
- dst+=dstStride;\
- src+=srcStride;\
- }\
-}\
-\
-static void OPNAME ## mpeg4_qpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- const int w=8;\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- for(i=0; i<w; i++)\
- {\
- const int src0= src[0*srcStride];\
- const int src1= src[1*srcStride];\
- const int src2= src[2*srcStride];\
- const int src3= src[3*srcStride];\
- const int src4= src[4*srcStride];\
- const int src5= src[5*srcStride];\
- const int src6= src[6*srcStride];\
- const int src7= src[7*srcStride];\
- const int src8= src[8*srcStride];\
- OP(dst[0*dstStride], (src0+src1)*20 - (src0+src2)*6 + (src1+src3)*3 - (src2+src4));\
- OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*6 + (src0+src4)*3 - (src1+src5));\
- OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*6 + (src0+src5)*3 - (src0+src6));\
- OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*6 + (src1+src6)*3 - (src0+src7));\
- OP(dst[4*dstStride], (src4+src5)*20 - (src3+src6)*6 + (src2+src7)*3 - (src1+src8));\
- OP(dst[5*dstStride], (src5+src6)*20 - (src4+src7)*6 + (src3+src8)*3 - (src2+src8));\
- OP(dst[6*dstStride], (src6+src7)*20 - (src5+src8)*6 + (src4+src8)*3 - (src3+src7));\
- OP(dst[7*dstStride], (src7+src8)*20 - (src6+src8)*6 + (src5+src7)*3 - (src4+src6));\
- dst++;\
- src++;\
- }\
-}\
-\
-static void OPNAME ## mpeg4_qpel16_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- \
- for(i=0; i<h; i++)\
- {\
- OP(dst[ 0], (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]));\
- OP(dst[ 1], (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]));\
- OP(dst[ 2], (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]));\
- OP(dst[ 3], (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]));\
- OP(dst[ 4], (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]));\
- OP(dst[ 5], (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 9]));\
- OP(dst[ 6], (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 9])*3 - (src[ 3]+src[10]));\
- OP(dst[ 7], (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 9])*6 + (src[ 5]+src[10])*3 - (src[ 4]+src[11]));\
- OP(dst[ 8], (src[ 8]+src[ 9])*20 - (src[ 7]+src[10])*6 + (src[ 6]+src[11])*3 - (src[ 5]+src[12]));\
- OP(dst[ 9], (src[ 9]+src[10])*20 - (src[ 8]+src[11])*6 + (src[ 7]+src[12])*3 - (src[ 6]+src[13]));\
- OP(dst[10], (src[10]+src[11])*20 - (src[ 9]+src[12])*6 + (src[ 8]+src[13])*3 - (src[ 7]+src[14]));\
- OP(dst[11], (src[11]+src[12])*20 - (src[10]+src[13])*6 + (src[ 9]+src[14])*3 - (src[ 8]+src[15]));\
- OP(dst[12], (src[12]+src[13])*20 - (src[11]+src[14])*6 + (src[10]+src[15])*3 - (src[ 9]+src[16]));\
- OP(dst[13], (src[13]+src[14])*20 - (src[12]+src[15])*6 + (src[11]+src[16])*3 - (src[10]+src[16]));\
- OP(dst[14], (src[14]+src[15])*20 - (src[13]+src[16])*6 + (src[12]+src[16])*3 - (src[11]+src[15]));\
- OP(dst[15], (src[15]+src[16])*20 - (src[14]+src[16])*6 + (src[13]+src[15])*3 - (src[12]+src[14]));\
- dst+=dstStride;\
- src+=srcStride;\
- }\
-}\
-\
-static void OPNAME ## mpeg4_qpel16_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- const int w=16;\
- for(i=0; i<w; i++)\
- {\
- const int src0= src[0*srcStride];\
- const int src1= src[1*srcStride];\
- const int src2= src[2*srcStride];\
- const int src3= src[3*srcStride];\
- const int src4= src[4*srcStride];\
- const int src5= src[5*srcStride];\
- const int src6= src[6*srcStride];\
- const int src7= src[7*srcStride];\
- const int src8= src[8*srcStride];\
- const int src9= src[9*srcStride];\
- const int src10= src[10*srcStride];\
- const int src11= src[11*srcStride];\
- const int src12= src[12*srcStride];\
- const int src13= src[13*srcStride];\
- const int src14= src[14*srcStride];\
- const int src15= src[15*srcStride];\
- const int src16= src[16*srcStride];\
- OP(dst[ 0*dstStride], (src0 +src1 )*20 - (src0 +src2 )*6 + (src1 +src3 )*3 - (src2 +src4 ));\
- OP(dst[ 1*dstStride], (src1 +src2 )*20 - (src0 +src3 )*6 + (src0 +src4 )*3 - (src1 +src5 ));\
- OP(dst[ 2*dstStride], (src2 +src3 )*20 - (src1 +src4 )*6 + (src0 +src5 )*3 - (src0 +src6 ));\
- OP(dst[ 3*dstStride], (src3 +src4 )*20 - (src2 +src5 )*6 + (src1 +src6 )*3 - (src0 +src7 ));\
- OP(dst[ 4*dstStride], (src4 +src5 )*20 - (src3 +src6 )*6 + (src2 +src7 )*3 - (src1 +src8 ));\
- OP(dst[ 5*dstStride], (src5 +src6 )*20 - (src4 +src7 )*6 + (src3 +src8 )*3 - (src2 +src9 ));\
- OP(dst[ 6*dstStride], (src6 +src7 )*20 - (src5 +src8 )*6 + (src4 +src9 )*3 - (src3 +src10));\
- OP(dst[ 7*dstStride], (src7 +src8 )*20 - (src6 +src9 )*6 + (src5 +src10)*3 - (src4 +src11));\
- OP(dst[ 8*dstStride], (src8 +src9 )*20 - (src7 +src10)*6 + (src6 +src11)*3 - (src5 +src12));\
- OP(dst[ 9*dstStride], (src9 +src10)*20 - (src8 +src11)*6 + (src7 +src12)*3 - (src6 +src13));\
- OP(dst[10*dstStride], (src10+src11)*20 - (src9 +src12)*6 + (src8 +src13)*3 - (src7 +src14));\
- OP(dst[11*dstStride], (src11+src12)*20 - (src10+src13)*6 + (src9 +src14)*3 - (src8 +src15));\
- OP(dst[12*dstStride], (src12+src13)*20 - (src11+src14)*6 + (src10+src15)*3 - (src9 +src16));\
- OP(dst[13*dstStride], (src13+src14)*20 - (src12+src15)*6 + (src11+src16)*3 - (src10+src16));\
- OP(dst[14*dstStride], (src14+src15)*20 - (src13+src16)*6 + (src12+src16)*3 - (src11+src15));\
- OP(dst[15*dstStride], (src15+src16)*20 - (src14+src16)*6 + (src13+src15)*3 - (src12+src14));\
- dst++;\
- src++;\
- }\
-}\
-\
-static void OPNAME ## qpel8_mc10_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t half[64];\
- put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
- OPNAME ## pixels8_l2_8(dst, src, half, stride, stride, 8, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc20_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- OPNAME ## mpeg4_qpel8_h_lowpass(dst, src, stride, stride, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc30_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t half[64];\
- put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
- OPNAME ## pixels8_l2_8(dst, src+1, half, stride, stride, 8, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc01_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t half[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
- OPNAME ## pixels8_l2_8(dst, full, half, stride, 16, 8, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc02_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- copy_block9(full, src, 16, stride, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16);\
-}\
-\
-static void OPNAME ## qpel8_mc03_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t half[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
- OPNAME ## pixels8_l2_8(dst, full+16, half, stride, 16, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l4_8(dst, full, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc11_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l4_8(dst, full+1, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc31_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2_8(halfH, halfH, full+1, 8, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l4_8(dst, full+16, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc13_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_8(dst, halfH+8, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full , 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l4_8(dst, full+17, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2_8(halfH, halfH, full+1, 8, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_8(dst, halfH+8, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc21_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc23_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_8(dst, halfH+8, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc12_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc32_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2_8(halfH, halfH, full+1, 8, 8, 16, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
-}\
-static void OPNAME ## qpel8_mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t halfH[72];\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
-}\
-\
-static void OPNAME ## qpel16_mc10_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t half[256];\
- put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
- OPNAME ## pixels16_l2_8(dst, src, half, stride, stride, 16, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc20_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- OPNAME ## mpeg4_qpel16_h_lowpass(dst, src, stride, stride, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc30_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t half[256];\
- put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
- OPNAME ## pixels16_l2_8(dst, src+1, half, stride, stride, 16, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc01_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t half[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
- OPNAME ## pixels16_l2_8(dst, full, half, stride, 24, 16, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc02_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- copy_block17(full, src, 24, stride, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24);\
-}\
-\
-static void OPNAME ## qpel16_mc03_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t half[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
- OPNAME ## pixels16_l2_8(dst, full+24, half, stride, 24, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l4_8(dst, full, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc11_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l4_8(dst, full+1, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc31_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2_8(halfH, halfH, full+1, 16, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l4_8(dst, full+24, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc13_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_8(dst, halfH+16, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full , 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l4_8(dst, full+25, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2_8(halfH, halfH, full+1, 16, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_8(dst, halfH+16, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc21_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc23_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_8(dst, halfH+16, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_8(dst, halfV, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc12_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_8(dst, halfV, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc32_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2_8(halfH, halfH, full+1, 16, 16, 24, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
-}\
-static void OPNAME ## qpel16_mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
- uint8_t halfH[272];\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
-}
-
-#define op_avg(a, b) a = (((a)+cm[((b) + 16)>>5]+1)>>1)
-#define op_avg_no_rnd(a, b) a = (((a)+cm[((b) + 15)>>5])>>1)
-#define op_put(a, b) a = cm[((b) + 16)>>5]
-#define op_put_no_rnd(a, b) a = cm[((b) + 15)>>5]
-
-QPEL_MC(0, put_ , _ , op_put)
+#define QPEL_MC(r, OPNAME, RND, OP) \
+static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, \
+ int dstStride, int srcStride, \
+ int h) \
+{ \
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
+ int i; \
+ \
+ for (i = 0; i < h; i++) { \
+ OP(dst[0], (src[0] + src[1]) * 20 - (src[0] + src[2]) * 6 + (src[1] + src[3]) * 3 - (src[2] + src[4])); \
+ OP(dst[1], (src[1] + src[2]) * 20 - (src[0] + src[3]) * 6 + (src[0] + src[4]) * 3 - (src[1] + src[5])); \
+ OP(dst[2], (src[2] + src[3]) * 20 - (src[1] + src[4]) * 6 + (src[0] + src[5]) * 3 - (src[0] + src[6])); \
+ OP(dst[3], (src[3] + src[4]) * 20 - (src[2] + src[5]) * 6 + (src[1] + src[6]) * 3 - (src[0] + src[7])); \
+ OP(dst[4], (src[4] + src[5]) * 20 - (src[3] + src[6]) * 6 + (src[2] + src[7]) * 3 - (src[1] + src[8])); \
+ OP(dst[5], (src[5] + src[6]) * 20 - (src[4] + src[7]) * 6 + (src[3] + src[8]) * 3 - (src[2] + src[8])); \
+ OP(dst[6], (src[6] + src[7]) * 20 - (src[5] + src[8]) * 6 + (src[4] + src[8]) * 3 - (src[3] + src[7])); \
+ OP(dst[7], (src[7] + src[8]) * 20 - (src[6] + src[8]) * 6 + (src[5] + src[7]) * 3 - (src[4] + src[6])); \
+ dst += dstStride; \
+ src += srcStride; \
+ } \
+} \
+ \
+static void OPNAME ## mpeg4_qpel8_v_lowpass(uint8_t *dst, uint8_t *src, \
+ int dstStride, int srcStride) \
+{ \
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
+ const int w = 8; \
+ int i; \
+ \
+ for (i = 0; i < w; i++) { \
+ const int src0 = src[0 * srcStride]; \
+ const int src1 = src[1 * srcStride]; \
+ const int src2 = src[2 * srcStride]; \
+ const int src3 = src[3 * srcStride]; \
+ const int src4 = src[4 * srcStride]; \
+ const int src5 = src[5 * srcStride]; \
+ const int src6 = src[6 * srcStride]; \
+ const int src7 = src[7 * srcStride]; \
+ const int src8 = src[8 * srcStride]; \
+ OP(dst[0 * dstStride], (src0 + src1) * 20 - (src0 + src2) * 6 + (src1 + src3) * 3 - (src2 + src4)); \
+ OP(dst[1 * dstStride], (src1 + src2) * 20 - (src0 + src3) * 6 + (src0 + src4) * 3 - (src1 + src5)); \
+ OP(dst[2 * dstStride], (src2 + src3) * 20 - (src1 + src4) * 6 + (src0 + src5) * 3 - (src0 + src6)); \
+ OP(dst[3 * dstStride], (src3 + src4) * 20 - (src2 + src5) * 6 + (src1 + src6) * 3 - (src0 + src7)); \
+ OP(dst[4 * dstStride], (src4 + src5) * 20 - (src3 + src6) * 6 + (src2 + src7) * 3 - (src1 + src8)); \
+ OP(dst[5 * dstStride], (src5 + src6) * 20 - (src4 + src7) * 6 + (src3 + src8) * 3 - (src2 + src8)); \
+ OP(dst[6 * dstStride], (src6 + src7) * 20 - (src5 + src8) * 6 + (src4 + src8) * 3 - (src3 + src7)); \
+ OP(dst[7 * dstStride], (src7 + src8) * 20 - (src6 + src8) * 6 + (src5 + src7) * 3 - (src4 + src6)); \
+ dst++; \
+ src++; \
+ } \
+} \
+ \
+static void OPNAME ## mpeg4_qpel16_h_lowpass(uint8_t *dst, uint8_t *src, \
+ int dstStride, int srcStride, \
+ int h) \
+{ \
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
+ int i; \
+ \
+ for (i = 0; i < h; i++) { \
+ OP(dst[0], (src[0] + src[1]) * 20 - (src[0] + src[2]) * 6 + (src[1] + src[3]) * 3 - (src[2] + src[4])); \
+ OP(dst[1], (src[1] + src[2]) * 20 - (src[0] + src[3]) * 6 + (src[0] + src[4]) * 3 - (src[1] + src[5])); \
+ OP(dst[2], (src[2] + src[3]) * 20 - (src[1] + src[4]) * 6 + (src[0] + src[5]) * 3 - (src[0] + src[6])); \
+ OP(dst[3], (src[3] + src[4]) * 20 - (src[2] + src[5]) * 6 + (src[1] + src[6]) * 3 - (src[0] + src[7])); \
+ OP(dst[4], (src[4] + src[5]) * 20 - (src[3] + src[6]) * 6 + (src[2] + src[7]) * 3 - (src[1] + src[8])); \
+ OP(dst[5], (src[5] + src[6]) * 20 - (src[4] + src[7]) * 6 + (src[3] + src[8]) * 3 - (src[2] + src[9])); \
+ OP(dst[6], (src[6] + src[7]) * 20 - (src[5] + src[8]) * 6 + (src[4] + src[9]) * 3 - (src[3] + src[10])); \
+ OP(dst[7], (src[7] + src[8]) * 20 - (src[6] + src[9]) * 6 + (src[5] + src[10]) * 3 - (src[4] + src[11])); \
+ OP(dst[8], (src[8] + src[9]) * 20 - (src[7] + src[10]) * 6 + (src[6] + src[11]) * 3 - (src[5] + src[12])); \
+ OP(dst[9], (src[9] + src[10]) * 20 - (src[8] + src[11]) * 6 + (src[7] + src[12]) * 3 - (src[6] + src[13])); \
+ OP(dst[10], (src[10] + src[11]) * 20 - (src[9] + src[12]) * 6 + (src[8] + src[13]) * 3 - (src[7] + src[14])); \
+ OP(dst[11], (src[11] + src[12]) * 20 - (src[10] + src[13]) * 6 + (src[9] + src[14]) * 3 - (src[8] + src[15])); \
+ OP(dst[12], (src[12] + src[13]) * 20 - (src[11] + src[14]) * 6 + (src[10] + src[15]) * 3 - (src[9] + src[16])); \
+ OP(dst[13], (src[13] + src[14]) * 20 - (src[12] + src[15]) * 6 + (src[11] + src[16]) * 3 - (src[10] + src[16])); \
+ OP(dst[14], (src[14] + src[15]) * 20 - (src[13] + src[16]) * 6 + (src[12] + src[16]) * 3 - (src[11] + src[15])); \
+ OP(dst[15], (src[15] + src[16]) * 20 - (src[14] + src[16]) * 6 + (src[13] + src[15]) * 3 - (src[12] + src[14])); \
+ dst += dstStride; \
+ src += srcStride; \
+ } \
+} \
+ \
+static void OPNAME ## mpeg4_qpel16_v_lowpass(uint8_t *dst, uint8_t *src, \
+ int dstStride, int srcStride) \
+{ \
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
+ const int w = 16; \
+ int i; \
+ \
+ for (i = 0; i < w; i++) { \
+ const int src0 = src[0 * srcStride]; \
+ const int src1 = src[1 * srcStride]; \
+ const int src2 = src[2 * srcStride]; \
+ const int src3 = src[3 * srcStride]; \
+ const int src4 = src[4 * srcStride]; \
+ const int src5 = src[5 * srcStride]; \
+ const int src6 = src[6 * srcStride]; \
+ const int src7 = src[7 * srcStride]; \
+ const int src8 = src[8 * srcStride]; \
+ const int src9 = src[9 * srcStride]; \
+ const int src10 = src[10 * srcStride]; \
+ const int src11 = src[11 * srcStride]; \
+ const int src12 = src[12 * srcStride]; \
+ const int src13 = src[13 * srcStride]; \
+ const int src14 = src[14 * srcStride]; \
+ const int src15 = src[15 * srcStride]; \
+ const int src16 = src[16 * srcStride]; \
+ OP(dst[0 * dstStride], (src0 + src1) * 20 - (src0 + src2) * 6 + (src1 + src3) * 3 - (src2 + src4)); \
+ OP(dst[1 * dstStride], (src1 + src2) * 20 - (src0 + src3) * 6 + (src0 + src4) * 3 - (src1 + src5)); \
+ OP(dst[2 * dstStride], (src2 + src3) * 20 - (src1 + src4) * 6 + (src0 + src5) * 3 - (src0 + src6)); \
+ OP(dst[3 * dstStride], (src3 + src4) * 20 - (src2 + src5) * 6 + (src1 + src6) * 3 - (src0 + src7)); \
+ OP(dst[4 * dstStride], (src4 + src5) * 20 - (src3 + src6) * 6 + (src2 + src7) * 3 - (src1 + src8)); \
+ OP(dst[5 * dstStride], (src5 + src6) * 20 - (src4 + src7) * 6 + (src3 + src8) * 3 - (src2 + src9)); \
+ OP(dst[6 * dstStride], (src6 + src7) * 20 - (src5 + src8) * 6 + (src4 + src9) * 3 - (src3 + src10)); \
+ OP(dst[7 * dstStride], (src7 + src8) * 20 - (src6 + src9) * 6 + (src5 + src10) * 3 - (src4 + src11)); \
+ OP(dst[8 * dstStride], (src8 + src9) * 20 - (src7 + src10) * 6 + (src6 + src11) * 3 - (src5 + src12)); \
+ OP(dst[9 * dstStride], (src9 + src10) * 20 - (src8 + src11) * 6 + (src7 + src12) * 3 - (src6 + src13)); \
+ OP(dst[10 * dstStride], (src10 + src11) * 20 - (src9 + src12) * 6 + (src8 + src13) * 3 - (src7 + src14)); \
+ OP(dst[11 * dstStride], (src11 + src12) * 20 - (src10 + src13) * 6 + (src9 + src14) * 3 - (src8 + src15)); \
+ OP(dst[12 * dstStride], (src12 + src13) * 20 - (src11 + src14) * 6 + (src10 + src15) * 3 - (src9 + src16)); \
+ OP(dst[13 * dstStride], (src13 + src14) * 20 - (src12 + src15) * 6 + (src11 + src16) * 3 - (src10 + src16)); \
+ OP(dst[14 * dstStride], (src14 + src15) * 20 - (src13 + src16) * 6 + (src12 + src16) * 3 - (src11 + src15)); \
+ OP(dst[15 * dstStride], (src15 + src16) * 20 - (src14 + src16) * 6 + (src13 + src15) * 3 - (src12 + src14)); \
+ dst++; \
+ src++; \
+ } \
+} \
+ \
+static void OPNAME ## qpel8_mc10_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t half[64]; \
+ \
+ put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8); \
+ OPNAME ## pixels8_l2_8(dst, src, half, stride, stride, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc20_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ OPNAME ## mpeg4_qpel8_h_lowpass(dst, src, stride, stride, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc30_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t half[64]; \
+ \
+ put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8); \
+ OPNAME ## pixels8_l2_8(dst, src + 1, half, stride, stride, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc01_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t half[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16); \
+ OPNAME ## pixels8_l2_8(dst, full, half, stride, 16, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc02_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16); \
+} \
+ \
+static void OPNAME ## qpel8_mc03_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t half[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16); \
+ OPNAME ## pixels8_l2_8(dst, full + 16, half, stride, 16, 8, 8); \
+} \
+ \
+void ff_ ## OPNAME ## qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ uint8_t halfV[64]; \
+ uint8_t halfHV[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l4_8(dst, full, halfH, halfV, halfHV, \
+ stride, 16, 8, 8, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc11_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ uint8_t halfHV[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8); \
+} \
+ \
+void ff_ ## OPNAME ## qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ uint8_t halfV[64]; \
+ uint8_t halfHV[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full + 1, 8, 16); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l4_8(dst, full + 1, halfH, halfV, halfHV, \
+ stride, 16, 8, 8, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc31_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ uint8_t halfHV[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## pixels8_l2_8(halfH, halfH, full + 1, 8, 8, 16, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8); \
+} \
+ \
+void ff_ ## OPNAME ## qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ uint8_t halfV[64]; \
+ uint8_t halfHV[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l4_8(dst, full + 16, halfH + 8, halfV, halfHV, \
+ stride, 16, 8, 8, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc13_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ uint8_t halfHV[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l2_8(dst, halfH + 8, halfHV, stride, 8, 8, 8); \
+} \
+ \
+void ff_ ## OPNAME ## qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ uint8_t halfV[64]; \
+ uint8_t halfHV[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full + 1, 8, 16); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l4_8(dst, full + 17, halfH + 8, halfV, halfHV, \
+ stride, 16, 8, 8, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc33_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ uint8_t halfHV[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## pixels8_l2_8(halfH, halfH, full + 1, 8, 8, 16, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l2_8(dst, halfH + 8, halfHV, stride, 8, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc21_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t halfH[72]; \
+ uint8_t halfHV[64]; \
+ \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc23_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t halfH[72]; \
+ uint8_t halfHV[64]; \
+ \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l2_8(dst, halfH + 8, halfHV, stride, 8, 8, 8); \
+} \
+ \
+void ff_ ## OPNAME ## qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ uint8_t halfV[64]; \
+ uint8_t halfHV[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc12_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9); \
+ OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8); \
+} \
+ \
+void ff_ ## OPNAME ## qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ uint8_t halfV[64]; \
+ uint8_t halfHV[64]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full + 1, 8, 16); \
+ put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
+ OPNAME ## pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc32_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[16 * 9]; \
+ uint8_t halfH[72]; \
+ \
+ copy_block9(full, src, 16, stride, 9); \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
+ put ## RND ## pixels8_l2_8(halfH, halfH, full + 1, 8, 8, 16, 9); \
+ OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8); \
+} \
+ \
+static void OPNAME ## qpel8_mc22_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t halfH[72]; \
+ \
+ put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9); \
+ OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8); \
+} \
+ \
+static void OPNAME ## qpel16_mc10_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t half[256]; \
+ \
+ put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16); \
+ OPNAME ## pixels16_l2_8(dst, src, half, stride, stride, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc20_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ OPNAME ## mpeg4_qpel16_h_lowpass(dst, src, stride, stride, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc30_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t half[256]; \
+ \
+ put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16); \
+ OPNAME ## pixels16_l2_8(dst, src + 1, half, stride, stride, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc01_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t half[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24); \
+ OPNAME ## pixels16_l2_8(dst, full, half, stride, 24, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc02_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24); \
+} \
+ \
+static void OPNAME ## qpel16_mc03_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t half[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24); \
+ OPNAME ## pixels16_l2_8(dst, full + 24, half, stride, 24, 16, 16); \
+} \
+ \
+void ff_ ## OPNAME ## qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ uint8_t halfV[256]; \
+ uint8_t halfHV[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l4_8(dst, full, halfH, halfV, halfHV, \
+ stride, 24, 16, 16, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc11_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ uint8_t halfHV[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16); \
+} \
+ \
+void ff_ ## OPNAME ## qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ uint8_t halfV[256]; \
+ uint8_t halfHV[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full + 1, 16, 24); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l4_8(dst, full + 1, halfH, halfV, halfHV, \
+ stride, 24, 16, 16, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc31_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ uint8_t halfHV[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## pixels16_l2_8(halfH, halfH, full + 1, 16, 16, 24, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16); \
+} \
+ \
+void ff_ ## OPNAME ## qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ uint8_t halfV[256]; \
+ uint8_t halfHV[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l4_8(dst, full + 24, halfH + 16, halfV, halfHV, \
+ stride, 24, 16, 16, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc13_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ uint8_t halfHV[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l2_8(dst, halfH + 16, halfHV, stride, 16, 16, 16); \
+} \
+ \
+void ff_ ## OPNAME ## qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ uint8_t halfV[256]; \
+ uint8_t halfHV[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full + 1, 16, 24); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l4_8(dst, full + 25, halfH + 16, halfV, halfHV, \
+ stride, 24, 16, 16, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc33_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ uint8_t halfHV[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## pixels16_l2_8(halfH, halfH, full + 1, 16, 16, 24, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l2_8(dst, halfH + 16, halfHV, stride, 16, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc21_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t halfH[272]; \
+ uint8_t halfHV[256]; \
+ \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc23_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t halfH[272]; \
+ uint8_t halfHV[256]; \
+ \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l2_8(dst, halfH + 16, halfHV, stride, 16, 16, 16); \
+} \
+ \
+void ff_ ## OPNAME ## qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ uint8_t halfV[256]; \
+ uint8_t halfHV[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l2_8(dst, halfV, halfHV, stride, 16, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc12_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17); \
+ OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16); \
+} \
+ \
+void ff_ ## OPNAME ## qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ uint8_t halfV[256]; \
+ uint8_t halfHV[256]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full + 1, 16, 24); \
+ put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
+ OPNAME ## pixels16_l2_8(dst, halfV, halfHV, stride, 16, 16, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc32_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t full[24 * 17]; \
+ uint8_t halfH[272]; \
+ \
+ copy_block17(full, src, 24, stride, 17); \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
+ put ## RND ## pixels16_l2_8(halfH, halfH, full + 1, 16, 16, 24, 17); \
+ OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16); \
+} \
+ \
+static void OPNAME ## qpel16_mc22_c(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
+{ \
+ uint8_t halfH[272]; \
+ \
+ put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17); \
+ OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16); \
+}
+
+#define op_avg(a, b) a = (((a) + cm[((b) + 16) >> 5] + 1) >> 1)
+#define op_avg_no_rnd(a, b) a = (((a) + cm[((b) + 15) >> 5]) >> 1)
+#define op_put(a, b) a = cm[((b) + 16) >> 5]
+#define op_put_no_rnd(a, b) a = cm[((b) + 15) >> 5]
+
+QPEL_MC(0, put_, _, op_put)
QPEL_MC(1, put_no_rnd_, _no_rnd_, op_put_no_rnd)
-QPEL_MC(0, avg_ , _ , op_avg)
-//QPEL_MC(1, avg_no_rnd , _ , op_avg)
+QPEL_MC(0, avg_, _, op_avg)
+
#undef op_avg
-#undef op_avg_no_rnd
#undef op_put
#undef op_put_no_rnd
@@ -1331,63 +1258,49 @@ void ff_put_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
{
put_pixels8_8_c(dst, src, stride, 8);
}
+
void ff_avg_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
{
avg_pixels8_8_c(dst, src, stride, 8);
}
+
void ff_put_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
{
put_pixels16_8_c(dst, src, stride, 16);
}
+
void ff_avg_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
{
avg_pixels16_8_c(dst, src, stride, 16);
}
-#define put_qpel8_mc00_c ff_put_pixels8x8_c
-#define avg_qpel8_mc00_c ff_avg_pixels8x8_c
-#define put_qpel16_mc00_c ff_put_pixels16x16_c
-#define avg_qpel16_mc00_c ff_avg_pixels16x16_c
+#define put_qpel8_mc00_c ff_put_pixels8x8_c
+#define avg_qpel8_mc00_c ff_avg_pixels8x8_c
+#define put_qpel16_mc00_c ff_put_pixels16x16_c
+#define avg_qpel16_mc00_c ff_avg_pixels16x16_c
#define put_no_rnd_qpel8_mc00_c ff_put_pixels8x8_c
#define put_no_rnd_qpel16_mc00_c ff_put_pixels16x16_c
-static void wmv2_mspel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+static void wmv2_mspel8_h_lowpass(uint8_t *dst, uint8_t *src,
+ int dstStride, int srcStride, int h)
+{
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
int i;
- for(i=0; i<h; i++){
- dst[0]= cm[(9*(src[0] + src[1]) - (src[-1] + src[2]) + 8)>>4];
- dst[1]= cm[(9*(src[1] + src[2]) - (src[ 0] + src[3]) + 8)>>4];
- dst[2]= cm[(9*(src[2] + src[3]) - (src[ 1] + src[4]) + 8)>>4];
- dst[3]= cm[(9*(src[3] + src[4]) - (src[ 2] + src[5]) + 8)>>4];
- dst[4]= cm[(9*(src[4] + src[5]) - (src[ 3] + src[6]) + 8)>>4];
- dst[5]= cm[(9*(src[5] + src[6]) - (src[ 4] + src[7]) + 8)>>4];
- dst[6]= cm[(9*(src[6] + src[7]) - (src[ 5] + src[8]) + 8)>>4];
- dst[7]= cm[(9*(src[7] + src[8]) - (src[ 6] + src[9]) + 8)>>4];
- dst+=dstStride;
- src+=srcStride;
+ for (i = 0; i < h; i++) {
+ dst[0] = cm[(9 * (src[0] + src[1]) - (src[-1] + src[2]) + 8) >> 4];
+ dst[1] = cm[(9 * (src[1] + src[2]) - (src[0] + src[3]) + 8) >> 4];
+ dst[2] = cm[(9 * (src[2] + src[3]) - (src[1] + src[4]) + 8) >> 4];
+ dst[3] = cm[(9 * (src[3] + src[4]) - (src[2] + src[5]) + 8) >> 4];
+ dst[4] = cm[(9 * (src[4] + src[5]) - (src[3] + src[6]) + 8) >> 4];
+ dst[5] = cm[(9 * (src[5] + src[6]) - (src[4] + src[7]) + 8) >> 4];
+ dst[6] = cm[(9 * (src[6] + src[7]) - (src[5] + src[8]) + 8) >> 4];
+ dst[7] = cm[(9 * (src[7] + src[8]) - (src[6] + src[9]) + 8) >> 4];
+ dst += dstStride;
+ src += srcStride;
}
}
-#if CONFIG_RV40_DECODER
-void ff_put_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
- put_pixels16_xy2_8_c(dst, src, stride, 16);
-}
-void ff_avg_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
- avg_pixels16_xy2_8_c(dst, src, stride, 16);
-}
-void ff_put_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
- put_pixels8_xy2_8_c(dst, src, stride, 8);
-}
-void ff_avg_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
- avg_pixels8_xy2_8_c(dst, src, stride, 8);
-}
-#endif /* CONFIG_RV40_DECODER */
-
#if CONFIG_DIRAC_DECODER
#define DIRAC_MC(OPNAME)\
void ff_ ## OPNAME ## _dirac_pixels8_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
@@ -1433,30 +1346,32 @@ DIRAC_MC(put)
DIRAC_MC(avg)
#endif
-static void wmv2_mspel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int w){
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+static void wmv2_mspel8_v_lowpass(uint8_t *dst, uint8_t *src,
+ int dstStride, int srcStride, int w)
+{
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
int i;
- for(i=0; i<w; i++){
- const int src_1= src[ -srcStride];
- const int src0 = src[0 ];
- const int src1 = src[ srcStride];
- const int src2 = src[2*srcStride];
- const int src3 = src[3*srcStride];
- const int src4 = src[4*srcStride];
- const int src5 = src[5*srcStride];
- const int src6 = src[6*srcStride];
- const int src7 = src[7*srcStride];
- const int src8 = src[8*srcStride];
- const int src9 = src[9*srcStride];
- dst[0*dstStride]= cm[(9*(src0 + src1) - (src_1 + src2) + 8)>>4];
- dst[1*dstStride]= cm[(9*(src1 + src2) - (src0 + src3) + 8)>>4];
- dst[2*dstStride]= cm[(9*(src2 + src3) - (src1 + src4) + 8)>>4];
- dst[3*dstStride]= cm[(9*(src3 + src4) - (src2 + src5) + 8)>>4];
- dst[4*dstStride]= cm[(9*(src4 + src5) - (src3 + src6) + 8)>>4];
- dst[5*dstStride]= cm[(9*(src5 + src6) - (src4 + src7) + 8)>>4];
- dst[6*dstStride]= cm[(9*(src6 + src7) - (src5 + src8) + 8)>>4];
- dst[7*dstStride]= cm[(9*(src7 + src8) - (src6 + src9) + 8)>>4];
+ for (i = 0; i < w; i++) {
+ const int src_1 = src[-srcStride];
+ const int src0 = src[0];
+ const int src1 = src[srcStride];
+ const int src2 = src[2 * srcStride];
+ const int src3 = src[3 * srcStride];
+ const int src4 = src[4 * srcStride];
+ const int src5 = src[5 * srcStride];
+ const int src6 = src[6 * srcStride];
+ const int src7 = src[7 * srcStride];
+ const int src8 = src[8 * srcStride];
+ const int src9 = src[9 * srcStride];
+ dst[0 * dstStride] = cm[(9 * (src0 + src1) - (src_1 + src2) + 8) >> 4];
+ dst[1 * dstStride] = cm[(9 * (src1 + src2) - (src0 + src3) + 8) >> 4];
+ dst[2 * dstStride] = cm[(9 * (src2 + src3) - (src1 + src4) + 8) >> 4];
+ dst[3 * dstStride] = cm[(9 * (src3 + src4) - (src2 + src5) + 8) >> 4];
+ dst[4 * dstStride] = cm[(9 * (src4 + src5) - (src3 + src6) + 8) >> 4];
+ dst[5 * dstStride] = cm[(9 * (src5 + src6) - (src4 + src7) + 8) >> 4];
+ dst[6 * dstStride] = cm[(9 * (src6 + src7) - (src5 + src8) + 8) >> 4];
+ dst[7 * dstStride] = cm[(9 * (src7 + src8) - (src6 + src9) + 8) >> 4];
src++;
dst++;
}
@@ -1465,6 +1380,7 @@ static void wmv2_mspel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int
static void put_mspel8_mc10_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
{
uint8_t half[64];
+
wmv2_mspel8_h_lowpass(half, src, 8, stride, 8);
put_pixels8_l2_8(dst, src, half, stride, stride, 8, 8);
}
@@ -1477,8 +1393,9 @@ static void put_mspel8_mc20_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
static void put_mspel8_mc30_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
{
uint8_t half[64];
+
wmv2_mspel8_h_lowpass(half, src, 8, stride, 8);
- put_pixels8_l2_8(dst, src+1, half, stride, stride, 8, 8);
+ put_pixels8_l2_8(dst, src + 1, half, stride, stride, 8, 8);
}
static void put_mspel8_mc02_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
@@ -1491,107 +1408,112 @@ static void put_mspel8_mc12_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
uint8_t halfH[88];
uint8_t halfV[64];
uint8_t halfHV[64];
- wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11);
+
+ wmv2_mspel8_h_lowpass(halfH, src - stride, 8, stride, 11);
wmv2_mspel8_v_lowpass(halfV, src, 8, stride, 8);
- wmv2_mspel8_v_lowpass(halfHV, halfH+8, 8, 8, 8);
+ wmv2_mspel8_v_lowpass(halfHV, halfH + 8, 8, 8, 8);
put_pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8);
}
+
static void put_mspel8_mc32_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
{
uint8_t halfH[88];
uint8_t halfV[64];
uint8_t halfHV[64];
- wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11);
- wmv2_mspel8_v_lowpass(halfV, src+1, 8, stride, 8);
- wmv2_mspel8_v_lowpass(halfHV, halfH+8, 8, 8, 8);
+
+ wmv2_mspel8_h_lowpass(halfH, src - stride, 8, stride, 11);
+ wmv2_mspel8_v_lowpass(halfV, src + 1, 8, stride, 8);
+ wmv2_mspel8_v_lowpass(halfHV, halfH + 8, 8, 8, 8);
put_pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8);
}
+
static void put_mspel8_mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
{
uint8_t halfH[88];
- wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11);
- wmv2_mspel8_v_lowpass(dst, halfH+8, stride, 8, 8);
-}
-
-static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
-
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - pix2[0]);
- s += abs(pix1[1] - pix2[1]);
- s += abs(pix1[2] - pix2[2]);
- s += abs(pix1[3] - pix2[3]);
- s += abs(pix1[4] - pix2[4]);
- s += abs(pix1[5] - pix2[5]);
- s += abs(pix1[6] - pix2[6]);
- s += abs(pix1[7] - pix2[7]);
- s += abs(pix1[8] - pix2[8]);
- s += abs(pix1[9] - pix2[9]);
- s += abs(pix1[10] - pix2[10]);
- s += abs(pix1[11] - pix2[11]);
- s += abs(pix1[12] - pix2[12]);
- s += abs(pix1[13] - pix2[13]);
- s += abs(pix1[14] - pix2[14]);
- s += abs(pix1[15] - pix2[15]);
+
+ wmv2_mspel8_h_lowpass(halfH, src - stride, 8, stride, 11);
+ wmv2_mspel8_v_lowpass(dst, halfH + 8, stride, 8, 8);
+}
+
+static inline int pix_abs16_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
+{
+ int s = 0, i;
+
+ for (i = 0; i < h; i++) {
+ s += abs(pix1[0] - pix2[0]);
+ s += abs(pix1[1] - pix2[1]);
+ s += abs(pix1[2] - pix2[2]);
+ s += abs(pix1[3] - pix2[3]);
+ s += abs(pix1[4] - pix2[4]);
+ s += abs(pix1[5] - pix2[5]);
+ s += abs(pix1[6] - pix2[6]);
+ s += abs(pix1[7] - pix2[7]);
+ s += abs(pix1[8] - pix2[8]);
+ s += abs(pix1[9] - pix2[9]);
+ s += abs(pix1[10] - pix2[10]);
+ s += abs(pix1[11] - pix2[11]);
+ s += abs(pix1[12] - pix2[12]);
+ s += abs(pix1[13] - pix2[13]);
+ s += abs(pix1[14] - pix2[14]);
+ s += abs(pix1[15] - pix2[15]);
pix1 += line_size;
pix2 += line_size;
}
return s;
}
-static int pix_abs16_x2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
-
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
- s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
- s += abs(pix1[2] - avg2(pix2[2], pix2[3]));
- s += abs(pix1[3] - avg2(pix2[3], pix2[4]));
- s += abs(pix1[4] - avg2(pix2[4], pix2[5]));
- s += abs(pix1[5] - avg2(pix2[5], pix2[6]));
- s += abs(pix1[6] - avg2(pix2[6], pix2[7]));
- s += abs(pix1[7] - avg2(pix2[7], pix2[8]));
- s += abs(pix1[8] - avg2(pix2[8], pix2[9]));
- s += abs(pix1[9] - avg2(pix2[9], pix2[10]));
- s += abs(pix1[10] - avg2(pix2[10], pix2[11]));
- s += abs(pix1[11] - avg2(pix2[11], pix2[12]));
- s += abs(pix1[12] - avg2(pix2[12], pix2[13]));
- s += abs(pix1[13] - avg2(pix2[13], pix2[14]));
- s += abs(pix1[14] - avg2(pix2[14], pix2[15]));
- s += abs(pix1[15] - avg2(pix2[15], pix2[16]));
+static int pix_abs16_x2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
+{
+ int s = 0, i;
+
+ for (i = 0; i < h; i++) {
+ s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
+ s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
+ s += abs(pix1[2] - avg2(pix2[2], pix2[3]));
+ s += abs(pix1[3] - avg2(pix2[3], pix2[4]));
+ s += abs(pix1[4] - avg2(pix2[4], pix2[5]));
+ s += abs(pix1[5] - avg2(pix2[5], pix2[6]));
+ s += abs(pix1[6] - avg2(pix2[6], pix2[7]));
+ s += abs(pix1[7] - avg2(pix2[7], pix2[8]));
+ s += abs(pix1[8] - avg2(pix2[8], pix2[9]));
+ s += abs(pix1[9] - avg2(pix2[9], pix2[10]));
+ s += abs(pix1[10] - avg2(pix2[10], pix2[11]));
+ s += abs(pix1[11] - avg2(pix2[11], pix2[12]));
+ s += abs(pix1[12] - avg2(pix2[12], pix2[13]));
+ s += abs(pix1[13] - avg2(pix2[13], pix2[14]));
+ s += abs(pix1[14] - avg2(pix2[14], pix2[15]));
+ s += abs(pix1[15] - avg2(pix2[15], pix2[16]));
pix1 += line_size;
pix2 += line_size;
}
return s;
}
-static int pix_abs16_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int pix_abs16_y2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int s, i;
+ int s = 0, i;
uint8_t *pix3 = pix2 + line_size;
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
- s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
- s += abs(pix1[2] - avg2(pix2[2], pix3[2]));
- s += abs(pix1[3] - avg2(pix2[3], pix3[3]));
- s += abs(pix1[4] - avg2(pix2[4], pix3[4]));
- s += abs(pix1[5] - avg2(pix2[5], pix3[5]));
- s += abs(pix1[6] - avg2(pix2[6], pix3[6]));
- s += abs(pix1[7] - avg2(pix2[7], pix3[7]));
- s += abs(pix1[8] - avg2(pix2[8], pix3[8]));
- s += abs(pix1[9] - avg2(pix2[9], pix3[9]));
- s += abs(pix1[10] - avg2(pix2[10], pix3[10]));
- s += abs(pix1[11] - avg2(pix2[11], pix3[11]));
- s += abs(pix1[12] - avg2(pix2[12], pix3[12]));
- s += abs(pix1[13] - avg2(pix2[13], pix3[13]));
- s += abs(pix1[14] - avg2(pix2[14], pix3[14]));
- s += abs(pix1[15] - avg2(pix2[15], pix3[15]));
+ for (i = 0; i < h; i++) {
+ s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
+ s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
+ s += abs(pix1[2] - avg2(pix2[2], pix3[2]));
+ s += abs(pix1[3] - avg2(pix2[3], pix3[3]));
+ s += abs(pix1[4] - avg2(pix2[4], pix3[4]));
+ s += abs(pix1[5] - avg2(pix2[5], pix3[5]));
+ s += abs(pix1[6] - avg2(pix2[6], pix3[6]));
+ s += abs(pix1[7] - avg2(pix2[7], pix3[7]));
+ s += abs(pix1[8] - avg2(pix2[8], pix3[8]));
+ s += abs(pix1[9] - avg2(pix2[9], pix3[9]));
+ s += abs(pix1[10] - avg2(pix2[10], pix3[10]));
+ s += abs(pix1[11] - avg2(pix2[11], pix3[11]));
+ s += abs(pix1[12] - avg2(pix2[12], pix3[12]));
+ s += abs(pix1[13] - avg2(pix2[13], pix3[13]));
+ s += abs(pix1[14] - avg2(pix2[14], pix3[14]));
+ s += abs(pix1[15] - avg2(pix2[15], pix3[15]));
pix1 += line_size;
pix2 += line_size;
pix3 += line_size;
@@ -1599,29 +1521,29 @@ static int pix_abs16_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size,
return s;
}
-static int pix_abs16_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int pix_abs16_xy2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int s, i;
+ int s = 0, i;
uint8_t *pix3 = pix2 + line_size;
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
- s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
- s += abs(pix1[2] - avg4(pix2[2], pix2[3], pix3[2], pix3[3]));
- s += abs(pix1[3] - avg4(pix2[3], pix2[4], pix3[3], pix3[4]));
- s += abs(pix1[4] - avg4(pix2[4], pix2[5], pix3[4], pix3[5]));
- s += abs(pix1[5] - avg4(pix2[5], pix2[6], pix3[5], pix3[6]));
- s += abs(pix1[6] - avg4(pix2[6], pix2[7], pix3[6], pix3[7]));
- s += abs(pix1[7] - avg4(pix2[7], pix2[8], pix3[7], pix3[8]));
- s += abs(pix1[8] - avg4(pix2[8], pix2[9], pix3[8], pix3[9]));
- s += abs(pix1[9] - avg4(pix2[9], pix2[10], pix3[9], pix3[10]));
- s += abs(pix1[10] - avg4(pix2[10], pix2[11], pix3[10], pix3[11]));
- s += abs(pix1[11] - avg4(pix2[11], pix2[12], pix3[11], pix3[12]));
- s += abs(pix1[12] - avg4(pix2[12], pix2[13], pix3[12], pix3[13]));
- s += abs(pix1[13] - avg4(pix2[13], pix2[14], pix3[13], pix3[14]));
- s += abs(pix1[14] - avg4(pix2[14], pix2[15], pix3[14], pix3[15]));
- s += abs(pix1[15] - avg4(pix2[15], pix2[16], pix3[15], pix3[16]));
+ for (i = 0; i < h; i++) {
+ s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
+ s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
+ s += abs(pix1[2] - avg4(pix2[2], pix2[3], pix3[2], pix3[3]));
+ s += abs(pix1[3] - avg4(pix2[3], pix2[4], pix3[3], pix3[4]));
+ s += abs(pix1[4] - avg4(pix2[4], pix2[5], pix3[4], pix3[5]));
+ s += abs(pix1[5] - avg4(pix2[5], pix2[6], pix3[5], pix3[6]));
+ s += abs(pix1[6] - avg4(pix2[6], pix2[7], pix3[6], pix3[7]));
+ s += abs(pix1[7] - avg4(pix2[7], pix2[8], pix3[7], pix3[8]));
+ s += abs(pix1[8] - avg4(pix2[8], pix2[9], pix3[8], pix3[9]));
+ s += abs(pix1[9] - avg4(pix2[9], pix2[10], pix3[9], pix3[10]));
+ s += abs(pix1[10] - avg4(pix2[10], pix2[11], pix3[10], pix3[11]));
+ s += abs(pix1[11] - avg4(pix2[11], pix2[12], pix3[11], pix3[12]));
+ s += abs(pix1[12] - avg4(pix2[12], pix2[13], pix3[12], pix3[13]));
+ s += abs(pix1[13] - avg4(pix2[13], pix2[14], pix3[13], pix3[14]));
+ s += abs(pix1[14] - avg4(pix2[14], pix2[15], pix3[14], pix3[15]));
+ s += abs(pix1[15] - avg4(pix2[15], pix2[16], pix3[15], pix3[16]));
pix1 += line_size;
pix2 += line_size;
pix3 += line_size;
@@ -1629,61 +1551,61 @@ static int pix_abs16_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size,
return s;
}
-static inline int pix_abs8_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static inline int pix_abs8_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int s, i;
+ int s = 0, i;
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - pix2[0]);
- s += abs(pix1[1] - pix2[1]);
- s += abs(pix1[2] - pix2[2]);
- s += abs(pix1[3] - pix2[3]);
- s += abs(pix1[4] - pix2[4]);
- s += abs(pix1[5] - pix2[5]);
- s += abs(pix1[6] - pix2[6]);
- s += abs(pix1[7] - pix2[7]);
+ for (i = 0; i < h; i++) {
+ s += abs(pix1[0] - pix2[0]);
+ s += abs(pix1[1] - pix2[1]);
+ s += abs(pix1[2] - pix2[2]);
+ s += abs(pix1[3] - pix2[3]);
+ s += abs(pix1[4] - pix2[4]);
+ s += abs(pix1[5] - pix2[5]);
+ s += abs(pix1[6] - pix2[6]);
+ s += abs(pix1[7] - pix2[7]);
pix1 += line_size;
pix2 += line_size;
}
return s;
}
-static int pix_abs8_x2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int pix_abs8_x2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int s, i;
+ int s = 0, i;
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
- s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
- s += abs(pix1[2] - avg2(pix2[2], pix2[3]));
- s += abs(pix1[3] - avg2(pix2[3], pix2[4]));
- s += abs(pix1[4] - avg2(pix2[4], pix2[5]));
- s += abs(pix1[5] - avg2(pix2[5], pix2[6]));
- s += abs(pix1[6] - avg2(pix2[6], pix2[7]));
- s += abs(pix1[7] - avg2(pix2[7], pix2[8]));
+ for (i = 0; i < h; i++) {
+ s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
+ s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
+ s += abs(pix1[2] - avg2(pix2[2], pix2[3]));
+ s += abs(pix1[3] - avg2(pix2[3], pix2[4]));
+ s += abs(pix1[4] - avg2(pix2[4], pix2[5]));
+ s += abs(pix1[5] - avg2(pix2[5], pix2[6]));
+ s += abs(pix1[6] - avg2(pix2[6], pix2[7]));
+ s += abs(pix1[7] - avg2(pix2[7], pix2[8]));
pix1 += line_size;
pix2 += line_size;
}
return s;
}
-static int pix_abs8_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int pix_abs8_y2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int s, i;
+ int s = 0, i;
uint8_t *pix3 = pix2 + line_size;
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
- s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
- s += abs(pix1[2] - avg2(pix2[2], pix3[2]));
- s += abs(pix1[3] - avg2(pix2[3], pix3[3]));
- s += abs(pix1[4] - avg2(pix2[4], pix3[4]));
- s += abs(pix1[5] - avg2(pix2[5], pix3[5]));
- s += abs(pix1[6] - avg2(pix2[6], pix3[6]));
- s += abs(pix1[7] - avg2(pix2[7], pix3[7]));
+ for (i = 0; i < h; i++) {
+ s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
+ s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
+ s += abs(pix1[2] - avg2(pix2[2], pix3[2]));
+ s += abs(pix1[3] - avg2(pix2[3], pix3[3]));
+ s += abs(pix1[4] - avg2(pix2[4], pix3[4]));
+ s += abs(pix1[5] - avg2(pix2[5], pix3[5]));
+ s += abs(pix1[6] - avg2(pix2[6], pix3[6]));
+ s += abs(pix1[7] - avg2(pix2[7], pix3[7]));
pix1 += line_size;
pix2 += line_size;
pix3 += line_size;
@@ -1691,21 +1613,21 @@ static int pix_abs8_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, i
return s;
}
-static int pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int pix_abs8_xy2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int s, i;
+ int s = 0, i;
uint8_t *pix3 = pix2 + line_size;
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
- s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
- s += abs(pix1[2] - avg4(pix2[2], pix2[3], pix3[2], pix3[3]));
- s += abs(pix1[3] - avg4(pix2[3], pix2[4], pix3[3], pix3[4]));
- s += abs(pix1[4] - avg4(pix2[4], pix2[5], pix3[4], pix3[5]));
- s += abs(pix1[5] - avg4(pix2[5], pix2[6], pix3[5], pix3[6]));
- s += abs(pix1[6] - avg4(pix2[6], pix2[7], pix3[6], pix3[7]));
- s += abs(pix1[7] - avg4(pix2[7], pix2[8], pix3[7], pix3[8]));
+ for (i = 0; i < h; i++) {
+ s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
+ s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
+ s += abs(pix1[2] - avg4(pix2[2], pix2[3], pix3[2], pix3[3]));
+ s += abs(pix1[3] - avg4(pix2[3], pix2[4], pix3[3], pix3[4]));
+ s += abs(pix1[4] - avg4(pix2[4], pix2[5], pix3[4], pix3[5]));
+ s += abs(pix1[5] - avg4(pix2[5], pix2[6], pix3[5], pix3[6]));
+ s += abs(pix1[6] - avg4(pix2[6], pix2[7], pix3[6], pix3[7]));
+ s += abs(pix1[7] - avg4(pix2[7], pix2[8], pix3[7], pix3[8]));
pix1 += line_size;
pix2 += line_size;
pix3 += line_size;
@@ -1713,130 +1635,135 @@ static int pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size,
return s;
}
-static int nsse16_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h){
- MpegEncContext *c = v;
- int score1=0;
- int score2=0;
- int x,y;
-
- for(y=0; y<h; y++){
- for(x=0; x<16; x++){
- score1+= (s1[x ] - s2[x ])*(s1[x ] - s2[x ]);
- }
- if(y+1<h){
- for(x=0; x<15; x++){
- score2+= FFABS( s1[x ] - s1[x +stride]
- - s1[x+1] + s1[x+1+stride])
- -FFABS( s2[x ] - s2[x +stride]
- - s2[x+1] + s2[x+1+stride]);
- }
+static int nsse16_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, int stride, int h)
+{
+ int score1 = 0, score2 = 0, x, y;
+
+ for (y = 0; y < h; y++) {
+ for (x = 0; x < 16; x++)
+ score1 += (s1[x] - s2[x]) * (s1[x] - s2[x]);
+ if (y + 1 < h) {
+ for (x = 0; x < 15; x++)
+ score2 += FFABS(s1[x] - s1[x + stride] -
+ s1[x + 1] + s1[x + stride + 1]) -
+ FFABS(s2[x] - s2[x + stride] -
+ s2[x + 1] + s2[x + stride + 1]);
}
- s1+= stride;
- s2+= stride;
+ s1 += stride;
+ s2 += stride;
}
- if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
- else return score1 + FFABS(score2)*8;
+ if (c)
+ return score1 + FFABS(score2) * c->avctx->nsse_weight;
+ else
+ return score1 + FFABS(score2) * 8;
}
-static int nsse8_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h){
- MpegEncContext *c = v;
- int score1=0;
- int score2=0;
- int x,y;
-
- for(y=0; y<h; y++){
- for(x=0; x<8; x++){
- score1+= (s1[x ] - s2[x ])*(s1[x ] - s2[x ]);
- }
- if(y+1<h){
- for(x=0; x<7; x++){
- score2+= FFABS( s1[x ] - s1[x +stride]
- - s1[x+1] + s1[x+1+stride])
- -FFABS( s2[x ] - s2[x +stride]
- - s2[x+1] + s2[x+1+stride]);
- }
+static int nsse8_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, int stride, int h)
+{
+ int score1 = 0, score2 = 0, x, y;
+
+ for (y = 0; y < h; y++) {
+ for (x = 0; x < 8; x++)
+ score1 += (s1[x] - s2[x]) * (s1[x] - s2[x]);
+ if (y + 1 < h) {
+ for (x = 0; x < 7; x++)
+ score2 += FFABS(s1[x] - s1[x + stride] -
+ s1[x + 1] + s1[x + stride + 1]) -
+ FFABS(s2[x] - s2[x + stride] -
+ s2[x + 1] + s2[x + stride + 1]);
}
- s1+= stride;
- s2+= stride;
+ s1 += stride;
+ s2 += stride;
}
- if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
- else return score1 + FFABS(score2)*8;
+ if (c)
+ return score1 + FFABS(score2) * c->avctx->nsse_weight;
+ else
+ return score1 + FFABS(score2) * 8;
}
-static int try_8x8basis_c(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale){
+static int try_8x8basis_c(int16_t rem[64], int16_t weight[64],
+ int16_t basis[64], int scale)
+{
int i;
- unsigned int sum=0;
+ unsigned int sum = 0;
- for(i=0; i<8*8; i++){
- int b= rem[i] + ((basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT));
- int w= weight[i];
- b>>= RECON_SHIFT;
- av_assert2(-512<b && b<512);
+ for (i = 0; i < 8 * 8; i++) {
+ int b = rem[i] + ((basis[i] * scale +
+ (1 << (BASIS_SHIFT - RECON_SHIFT - 1))) >>
+ (BASIS_SHIFT - RECON_SHIFT));
+ int w = weight[i];
+ b >>= RECON_SHIFT;
+ av_assert2(-512 < b && b < 512);
- sum += (w*b)*(w*b)>>4;
+ sum += (w * b) * (w * b) >> 4;
}
- return sum>>2;
+ return sum >> 2;
}
-static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale){
+static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale)
+{
int i;
- for(i=0; i<8*8; i++){
- rem[i] += (basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT);
- }
+ for (i = 0; i < 8 * 8; i++)
+ rem[i] += (basis[i] * scale +
+ (1 << (BASIS_SHIFT - RECON_SHIFT - 1))) >>
+ (BASIS_SHIFT - RECON_SHIFT);
}
-static int zero_cmp(void *s, uint8_t *a, uint8_t *b, int stride, int h){
+static int zero_cmp(MpegEncContext *s, uint8_t *a, uint8_t *b,
+ int stride, int h)
+{
return 0;
}
-void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type){
+void ff_set_cmp(DSPContext *c, me_cmp_func *cmp, int type)
+{
int i;
- memset(cmp, 0, sizeof(void*)*6);
+ memset(cmp, 0, sizeof(void *) * 6);
- for(i=0; i<6; i++){
- switch(type&0xFF){
+ for (i = 0; i < 6; i++) {
+ switch (type & 0xFF) {
case FF_CMP_SAD:
- cmp[i]= c->sad[i];
+ cmp[i] = c->sad[i];
break;
case FF_CMP_SATD:
- cmp[i]= c->hadamard8_diff[i];
+ cmp[i] = c->hadamard8_diff[i];
break;
case FF_CMP_SSE:
- cmp[i]= c->sse[i];
+ cmp[i] = c->sse[i];
break;
case FF_CMP_DCT:
- cmp[i]= c->dct_sad[i];
+ cmp[i] = c->dct_sad[i];
break;
case FF_CMP_DCT264:
- cmp[i]= c->dct264_sad[i];
+ cmp[i] = c->dct264_sad[i];
break;
case FF_CMP_DCTMAX:
- cmp[i]= c->dct_max[i];
+ cmp[i] = c->dct_max[i];
break;
case FF_CMP_PSNR:
- cmp[i]= c->quant_psnr[i];
+ cmp[i] = c->quant_psnr[i];
break;
case FF_CMP_BIT:
- cmp[i]= c->bit[i];
+ cmp[i] = c->bit[i];
break;
case FF_CMP_RD:
- cmp[i]= c->rd[i];
+ cmp[i] = c->rd[i];
break;
case FF_CMP_VSAD:
- cmp[i]= c->vsad[i];
+ cmp[i] = c->vsad[i];
break;
case FF_CMP_VSSE:
- cmp[i]= c->vsse[i];
+ cmp[i] = c->vsse[i];
break;
case FF_CMP_ZERO:
- cmp[i]= zero_cmp;
+ cmp[i] = zero_cmp;
break;
case FF_CMP_NSSE:
- cmp[i]= c->nsse[i];
+ cmp[i] = c->nsse[i];
break;
#if CONFIG_DWT
case FF_CMP_W53:
@@ -1847,96 +1774,110 @@ void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type){
break;
#endif
default:
- av_log(NULL, AV_LOG_ERROR,"internal error in cmp function selection\n");
+ av_log(NULL, AV_LOG_ERROR,
+ "internal error in cmp function selection\n");
}
}
}
-static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
+static void add_bytes_c(uint8_t *dst, uint8_t *src, int w)
+{
long i;
- for (i = 0; i <= w - (int)sizeof(long); i += sizeof(long)) {
- long a = *(long*)(src+i);
- long b = *(long*)(dst+i);
- *(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80);
+
+ for (i = 0; i <= w - (int) sizeof(long); i += sizeof(long)) {
+ long a = *(long *) (src + i);
+ long b = *(long *) (dst + i);
+ *(long *) (dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);
}
- for(; i<w; i++)
- dst[i+0] += src[i+0];
+ for (; i < w; i++)
+ dst[i + 0] += src[i + 0];
}
-static void diff_bytes_c(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w){
+static void diff_bytes_c(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w)
+{
long i;
+
#if !HAVE_FAST_UNALIGNED
- if((long)src2 & (sizeof(long)-1)){
- for(i=0; i+7<w; i+=8){
- dst[i+0] = src1[i+0]-src2[i+0];
- dst[i+1] = src1[i+1]-src2[i+1];
- dst[i+2] = src1[i+2]-src2[i+2];
- dst[i+3] = src1[i+3]-src2[i+3];
- dst[i+4] = src1[i+4]-src2[i+4];
- dst[i+5] = src1[i+5]-src2[i+5];
- dst[i+6] = src1[i+6]-src2[i+6];
- dst[i+7] = src1[i+7]-src2[i+7];
+ if ((long) src2 & (sizeof(long) - 1)) {
+ for (i = 0; i + 7 < w; i += 8) {
+ dst[i + 0] = src1[i + 0] - src2[i + 0];
+ dst[i + 1] = src1[i + 1] - src2[i + 1];
+ dst[i + 2] = src1[i + 2] - src2[i + 2];
+ dst[i + 3] = src1[i + 3] - src2[i + 3];
+ dst[i + 4] = src1[i + 4] - src2[i + 4];
+ dst[i + 5] = src1[i + 5] - src2[i + 5];
+ dst[i + 6] = src1[i + 6] - src2[i + 6];
+ dst[i + 7] = src1[i + 7] - src2[i + 7];
}
- }else
+ } else
#endif
- for (i = 0; i <= w - (int)sizeof(long); i += sizeof(long)) {
- long a = *(long*)(src1+i);
- long b = *(long*)(src2+i);
- *(long*)(dst+i) = ((a|pb_80) - (b&pb_7f)) ^ ((a^b^pb_80)&pb_80);
+ for (i = 0; i <= w - (int) sizeof(long); i += sizeof(long)) {
+ long a = *(long *) (src1 + i);
+ long b = *(long *) (src2 + i);
+ *(long *) (dst + i) = ((a | pb_80) - (b & pb_7f)) ^
+ ((a ^ b ^ pb_80) & pb_80);
}
- for(; i<w; i++)
- dst[i+0] = src1[i+0]-src2[i+0];
+ for (; i < w; i++)
+ dst[i + 0] = src1[i + 0] - src2[i + 0];
}
-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){
+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;
- l= *left;
- lt= *left_top;
+ l = *left;
+ lt = *left_top;
- for(i=0; i<w; i++){
- l= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF) + diff[i];
- lt= src1[i];
- dst[i]= l;
+ for (i = 0; i < w; i++) {
+ l = mid_pred(l, src1[i], (l + src1[i] - lt) & 0xFF) + diff[i];
+ lt = src1[i];
+ dst[i] = l;
}
- *left= l;
- *left_top= lt;
+ *left = l;
+ *left_top = lt;
}
-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){
+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;
- l= *left;
- lt= *left_top;
+ l = *left;
+ lt = *left_top;
- for(i=0; i<w; i++){
- const int pred= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF);
- lt= src1[i];
- l= src2[i];
- dst[i]= l - pred;
+ for (i = 0; i < w; i++) {
+ const int pred = mid_pred(l, src1[i], (l + src1[i] - lt) & 0xFF);
+ lt = src1[i];
+ l = src2[i];
+ dst[i] = l - pred;
}
- *left= l;
- *left_top= lt;
+ *left = l;
+ *left_top = lt;
}
-static int add_hfyu_left_prediction_c(uint8_t *dst, const 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++){
- acc+= src[i];
- dst[i]= acc;
+ for (i = 0; i < w - 1; i++) {
+ acc += src[i];
+ dst[i] = acc;
i++;
- acc+= src[i];
- dst[i]= acc;
+ acc += src[i];
+ dst[i] = acc;
}
- for(; i<w; i++){
- acc+= src[i];
- dst[i]= acc;
+ for (; i < w; i++) {
+ acc += src[i];
+ dst[i] = acc;
}
return acc;
@@ -1953,149 +1894,159 @@ static int add_hfyu_left_prediction_c(uint8_t *dst, const uint8_t *src, int w, i
#define R 2
#define A 3
#endif
-static void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue, int *alpha){
- int i;
- int r,g,b,a;
- r= *red;
- g= *green;
- b= *blue;
- a= *alpha;
+static void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, const uint8_t *src,
+ int w, int *red, int *green,
+ int *blue, int *alpha)
+{
+ int i, r = *red, g = *green, b = *blue, a = *alpha;
- for(i=0; i<w; i++){
- b+= src[4*i+B];
- g+= src[4*i+G];
- r+= src[4*i+R];
- a+= src[4*i+A];
+ for (i = 0; i < w; i++) {
+ b += src[4 * i + B];
+ g += src[4 * i + G];
+ r += src[4 * i + R];
+ a += src[4 * i + A];
- dst[4*i+B]= b;
- dst[4*i+G]= g;
- dst[4*i+R]= r;
- dst[4*i+A]= a;
+ dst[4 * i + B] = b;
+ dst[4 * i + G] = g;
+ dst[4 * i + R] = r;
+ dst[4 * i + A] = a;
}
- *red= r;
- *green= g;
- *blue= b;
- *alpha= a;
+ *red = r;
+ *green = g;
+ *blue = b;
+ *alpha = a;
}
#undef B
#undef G
#undef R
#undef A
-#define BUTTERFLY2(o1,o2,i1,i2) \
-o1= (i1)+(i2);\
-o2= (i1)-(i2);
-
-#define BUTTERFLY1(x,y) \
-{\
- int a,b;\
- a= x;\
- b= y;\
- x= a+b;\
- y= a-b;\
-}
+#define BUTTERFLY2(o1, o2, i1, i2) \
+ o1 = (i1) + (i2); \
+ o2 = (i1) - (i2);
-#define BUTTERFLYA(x,y) (FFABS((x)+(y)) + FFABS((x)-(y)))
-
-static int hadamard8_diff8x8_c(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
- int i;
- int temp[64];
- int sum=0;
+#define BUTTERFLY1(x, y) \
+ { \
+ int a, b; \
+ a = x; \
+ b = y; \
+ x = a + b; \
+ y = a - b; \
+ }
- av_assert2(h==8);
+#define BUTTERFLYA(x, y) (FFABS((x) + (y)) + FFABS((x) - (y)))
- for(i=0; i<8; i++){
- //FIXME try pointer walks
- BUTTERFLY2(temp[8*i+0], temp[8*i+1], src[stride*i+0]-dst[stride*i+0],src[stride*i+1]-dst[stride*i+1]);
- BUTTERFLY2(temp[8*i+2], temp[8*i+3], src[stride*i+2]-dst[stride*i+2],src[stride*i+3]-dst[stride*i+3]);
- BUTTERFLY2(temp[8*i+4], temp[8*i+5], src[stride*i+4]-dst[stride*i+4],src[stride*i+5]-dst[stride*i+5]);
- BUTTERFLY2(temp[8*i+6], temp[8*i+7], src[stride*i+6]-dst[stride*i+6],src[stride*i+7]-dst[stride*i+7]);
+static int hadamard8_diff8x8_c(MpegEncContext *s, uint8_t *dst,
+ uint8_t *src, int stride, int h)
+{
+ int i, temp[64], sum = 0;
- BUTTERFLY1(temp[8*i+0], temp[8*i+2]);
- BUTTERFLY1(temp[8*i+1], temp[8*i+3]);
- BUTTERFLY1(temp[8*i+4], temp[8*i+6]);
- BUTTERFLY1(temp[8*i+5], temp[8*i+7]);
+ av_assert2(h == 8);
- BUTTERFLY1(temp[8*i+0], temp[8*i+4]);
- BUTTERFLY1(temp[8*i+1], temp[8*i+5]);
- BUTTERFLY1(temp[8*i+2], temp[8*i+6]);
- BUTTERFLY1(temp[8*i+3], temp[8*i+7]);
+ for (i = 0; i < 8; i++) {
+ // FIXME: try pointer walks
+ BUTTERFLY2(temp[8 * i + 0], temp[8 * i + 1],
+ src[stride * i + 0] - dst[stride * i + 0],
+ src[stride * i + 1] - dst[stride * i + 1]);
+ BUTTERFLY2(temp[8 * i + 2], temp[8 * i + 3],
+ src[stride * i + 2] - dst[stride * i + 2],
+ src[stride * i + 3] - dst[stride * i + 3]);
+ BUTTERFLY2(temp[8 * i + 4], temp[8 * i + 5],
+ src[stride * i + 4] - dst[stride * i + 4],
+ src[stride * i + 5] - dst[stride * i + 5]);
+ BUTTERFLY2(temp[8 * i + 6], temp[8 * i + 7],
+ src[stride * i + 6] - dst[stride * i + 6],
+ src[stride * i + 7] - dst[stride * i + 7]);
+
+ BUTTERFLY1(temp[8 * i + 0], temp[8 * i + 2]);
+ BUTTERFLY1(temp[8 * i + 1], temp[8 * i + 3]);
+ BUTTERFLY1(temp[8 * i + 4], temp[8 * i + 6]);
+ BUTTERFLY1(temp[8 * i + 5], temp[8 * i + 7]);
+
+ BUTTERFLY1(temp[8 * i + 0], temp[8 * i + 4]);
+ BUTTERFLY1(temp[8 * i + 1], temp[8 * i + 5]);
+ BUTTERFLY1(temp[8 * i + 2], temp[8 * i + 6]);
+ BUTTERFLY1(temp[8 * i + 3], temp[8 * i + 7]);
}
- for(i=0; i<8; i++){
- BUTTERFLY1(temp[8*0+i], temp[8*1+i]);
- BUTTERFLY1(temp[8*2+i], temp[8*3+i]);
- BUTTERFLY1(temp[8*4+i], temp[8*5+i]);
- BUTTERFLY1(temp[8*6+i], temp[8*7+i]);
+ for (i = 0; i < 8; i++) {
+ BUTTERFLY1(temp[8 * 0 + i], temp[8 * 1 + i]);
+ BUTTERFLY1(temp[8 * 2 + i], temp[8 * 3 + i]);
+ BUTTERFLY1(temp[8 * 4 + i], temp[8 * 5 + i]);
+ BUTTERFLY1(temp[8 * 6 + i], temp[8 * 7 + i]);
- BUTTERFLY1(temp[8*0+i], temp[8*2+i]);
- BUTTERFLY1(temp[8*1+i], temp[8*3+i]);
- BUTTERFLY1(temp[8*4+i], temp[8*6+i]);
- BUTTERFLY1(temp[8*5+i], temp[8*7+i]);
+ BUTTERFLY1(temp[8 * 0 + i], temp[8 * 2 + i]);
+ BUTTERFLY1(temp[8 * 1 + i], temp[8 * 3 + i]);
+ BUTTERFLY1(temp[8 * 4 + i], temp[8 * 6 + i]);
+ BUTTERFLY1(temp[8 * 5 + i], temp[8 * 7 + i]);
- sum +=
- BUTTERFLYA(temp[8*0+i], temp[8*4+i])
- +BUTTERFLYA(temp[8*1+i], temp[8*5+i])
- +BUTTERFLYA(temp[8*2+i], temp[8*6+i])
- +BUTTERFLYA(temp[8*3+i], temp[8*7+i]);
+ sum += BUTTERFLYA(temp[8 * 0 + i], temp[8 * 4 + i]) +
+ BUTTERFLYA(temp[8 * 1 + i], temp[8 * 5 + i]) +
+ BUTTERFLYA(temp[8 * 2 + i], temp[8 * 6 + i]) +
+ BUTTERFLYA(temp[8 * 3 + i], temp[8 * 7 + i]);
}
return sum;
}
-static int hadamard8_intra8x8_c(/*MpegEncContext*/ void *s, uint8_t *src, uint8_t *dummy, int stride, int h){
- int i;
- int temp[64];
- int sum=0;
-
- av_assert2(h==8);
-
- for(i=0; i<8; i++){
- //FIXME try pointer walks
- BUTTERFLY2(temp[8*i+0], temp[8*i+1], src[stride*i+0],src[stride*i+1]);
- BUTTERFLY2(temp[8*i+2], temp[8*i+3], src[stride*i+2],src[stride*i+3]);
- BUTTERFLY2(temp[8*i+4], temp[8*i+5], src[stride*i+4],src[stride*i+5]);
- BUTTERFLY2(temp[8*i+6], temp[8*i+7], src[stride*i+6],src[stride*i+7]);
+static int hadamard8_intra8x8_c(MpegEncContext *s, uint8_t *src,
+ uint8_t *dummy, int stride, int h)
+{
+ int i, temp[64], sum = 0;
- BUTTERFLY1(temp[8*i+0], temp[8*i+2]);
- BUTTERFLY1(temp[8*i+1], temp[8*i+3]);
- BUTTERFLY1(temp[8*i+4], temp[8*i+6]);
- BUTTERFLY1(temp[8*i+5], temp[8*i+7]);
+ av_assert2(h == 8);
- BUTTERFLY1(temp[8*i+0], temp[8*i+4]);
- BUTTERFLY1(temp[8*i+1], temp[8*i+5]);
- BUTTERFLY1(temp[8*i+2], temp[8*i+6]);
- BUTTERFLY1(temp[8*i+3], temp[8*i+7]);
+ for (i = 0; i < 8; i++) {
+ // FIXME: try pointer walks
+ BUTTERFLY2(temp[8 * i + 0], temp[8 * i + 1],
+ src[stride * i + 0], src[stride * i + 1]);
+ BUTTERFLY2(temp[8 * i + 2], temp[8 * i + 3],
+ src[stride * i + 2], src[stride * i + 3]);
+ BUTTERFLY2(temp[8 * i + 4], temp[8 * i + 5],
+ src[stride * i + 4], src[stride * i + 5]);
+ BUTTERFLY2(temp[8 * i + 6], temp[8 * i + 7],
+ src[stride * i + 6], src[stride * i + 7]);
+
+ BUTTERFLY1(temp[8 * i + 0], temp[8 * i + 2]);
+ BUTTERFLY1(temp[8 * i + 1], temp[8 * i + 3]);
+ BUTTERFLY1(temp[8 * i + 4], temp[8 * i + 6]);
+ BUTTERFLY1(temp[8 * i + 5], temp[8 * i + 7]);
+
+ BUTTERFLY1(temp[8 * i + 0], temp[8 * i + 4]);
+ BUTTERFLY1(temp[8 * i + 1], temp[8 * i + 5]);
+ BUTTERFLY1(temp[8 * i + 2], temp[8 * i + 6]);
+ BUTTERFLY1(temp[8 * i + 3], temp[8 * i + 7]);
}
- for(i=0; i<8; i++){
- BUTTERFLY1(temp[8*0+i], temp[8*1+i]);
- BUTTERFLY1(temp[8*2+i], temp[8*3+i]);
- BUTTERFLY1(temp[8*4+i], temp[8*5+i]);
- BUTTERFLY1(temp[8*6+i], temp[8*7+i]);
+ for (i = 0; i < 8; i++) {
+ BUTTERFLY1(temp[8 * 0 + i], temp[8 * 1 + i]);
+ BUTTERFLY1(temp[8 * 2 + i], temp[8 * 3 + i]);
+ BUTTERFLY1(temp[8 * 4 + i], temp[8 * 5 + i]);
+ BUTTERFLY1(temp[8 * 6 + i], temp[8 * 7 + i]);
- BUTTERFLY1(temp[8*0+i], temp[8*2+i]);
- BUTTERFLY1(temp[8*1+i], temp[8*3+i]);
- BUTTERFLY1(temp[8*4+i], temp[8*6+i]);
- BUTTERFLY1(temp[8*5+i], temp[8*7+i]);
+ BUTTERFLY1(temp[8 * 0 + i], temp[8 * 2 + i]);
+ BUTTERFLY1(temp[8 * 1 + i], temp[8 * 3 + i]);
+ BUTTERFLY1(temp[8 * 4 + i], temp[8 * 6 + i]);
+ BUTTERFLY1(temp[8 * 5 + i], temp[8 * 7 + i]);
sum +=
- BUTTERFLYA(temp[8*0+i], temp[8*4+i])
- +BUTTERFLYA(temp[8*1+i], temp[8*5+i])
- +BUTTERFLYA(temp[8*2+i], temp[8*6+i])
- +BUTTERFLYA(temp[8*3+i], temp[8*7+i]);
+ BUTTERFLYA(temp[8 * 0 + i], temp[8 * 4 + i])
+ + BUTTERFLYA(temp[8 * 1 + i], temp[8 * 5 + i])
+ + BUTTERFLYA(temp[8 * 2 + i], temp[8 * 6 + i])
+ + BUTTERFLYA(temp[8 * 3 + i], temp[8 * 7 + i]);
}
- sum -= FFABS(temp[8*0] + temp[8*4]); // -mean
+ sum -= FFABS(temp[8 * 0] + temp[8 * 4]); // -mean
return sum;
}
-static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
+static int dct_sad8x8_c(MpegEncContext *s, uint8_t *src1,
+ uint8_t *src2, int stride, int h)
+{
LOCAL_ALIGNED_16(int16_t, temp, [64]);
- av_assert2(h==8);
+ av_assert2(h == 8);
s->dsp.diff_pixels(temp, src1, src2, stride);
s->dsp.fdct(temp);
@@ -2103,161 +2054,166 @@ static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2
}
#if CONFIG_GPL
-#define DCT8_1D {\
- const int s07 = SRC(0) + SRC(7);\
- const int s16 = SRC(1) + SRC(6);\
- const int s25 = SRC(2) + SRC(5);\
- const int s34 = SRC(3) + SRC(4);\
- const int a0 = s07 + s34;\
- const int a1 = s16 + s25;\
- const int a2 = s07 - s34;\
- const int a3 = s16 - s25;\
- const int d07 = SRC(0) - SRC(7);\
- const int d16 = SRC(1) - SRC(6);\
- const int d25 = SRC(2) - SRC(5);\
- const int d34 = SRC(3) - SRC(4);\
- const int a4 = d16 + d25 + (d07 + (d07>>1));\
- const int a5 = d07 - d34 - (d25 + (d25>>1));\
- const int a6 = d07 + d34 - (d16 + (d16>>1));\
- const int a7 = d16 - d25 + (d34 + (d34>>1));\
- DST(0, a0 + a1 ) ;\
- DST(1, a4 + (a7>>2)) ;\
- DST(2, a2 + (a3>>1)) ;\
- DST(3, a5 + (a6>>2)) ;\
- DST(4, a0 - a1 ) ;\
- DST(5, a6 - (a5>>2)) ;\
- DST(6, (a2>>1) - a3 ) ;\
- DST(7, (a4>>2) - a7 ) ;\
-}
-
-static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
+#define DCT8_1D \
+ { \
+ const int s07 = SRC(0) + SRC(7); \
+ const int s16 = SRC(1) + SRC(6); \
+ const int s25 = SRC(2) + SRC(5); \
+ const int s34 = SRC(3) + SRC(4); \
+ const int a0 = s07 + s34; \
+ const int a1 = s16 + s25; \
+ const int a2 = s07 - s34; \
+ const int a3 = s16 - s25; \
+ const int d07 = SRC(0) - SRC(7); \
+ const int d16 = SRC(1) - SRC(6); \
+ const int d25 = SRC(2) - SRC(5); \
+ const int d34 = SRC(3) - SRC(4); \
+ const int a4 = d16 + d25 + (d07 + (d07 >> 1)); \
+ const int a5 = d07 - d34 - (d25 + (d25 >> 1)); \
+ const int a6 = d07 + d34 - (d16 + (d16 >> 1)); \
+ const int a7 = d16 - d25 + (d34 + (d34 >> 1)); \
+ DST(0, a0 + a1); \
+ DST(1, a4 + (a7 >> 2)); \
+ DST(2, a2 + (a3 >> 1)); \
+ DST(3, a5 + (a6 >> 2)); \
+ DST(4, a0 - a1); \
+ DST(5, a6 - (a5 >> 2)); \
+ DST(6, (a2 >> 1) - a3); \
+ DST(7, (a4 >> 2) - a7); \
+ }
+
+static int dct264_sad8x8_c(MpegEncContext *s, uint8_t *src1,
+ uint8_t *src2, int stride, int h)
+{
int16_t dct[8][8];
- int i;
- int sum=0;
+ int i, sum = 0;
s->dsp.diff_pixels(dct[0], src1, src2, stride);
#define SRC(x) dct[i][x]
-#define DST(x,v) dct[i][x]= v
- for( i = 0; i < 8; i++ )
+#define DST(x, v) dct[i][x] = v
+ for (i = 0; i < 8; i++)
DCT8_1D
#undef SRC
#undef DST
#define SRC(x) dct[x][i]
-#define DST(x,v) sum += FFABS(v)
- for( i = 0; i < 8; i++ )
- DCT8_1D
+#define DST(x, v) sum += FFABS(v)
+ for (i = 0; i < 8; i++)
+ DCT8_1D
#undef SRC
#undef DST
- return sum;
+ return sum;
}
#endif
-static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
+static int dct_max8x8_c(MpegEncContext *s, uint8_t *src1,
+ uint8_t *src2, int stride, int h)
+{
LOCAL_ALIGNED_16(int16_t, temp, [64]);
- int sum=0, i;
+ int sum = 0, i;
- av_assert2(h==8);
+ av_assert2(h == 8);
s->dsp.diff_pixels(temp, src1, src2, stride);
s->dsp.fdct(temp);
- for(i=0; i<64; i++)
- sum= FFMAX(sum, FFABS(temp[i]));
+ for (i = 0; i < 64; i++)
+ sum = FFMAX(sum, FFABS(temp[i]));
return sum;
}
-static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
- LOCAL_ALIGNED_16(int16_t, temp, [64*2]);
- int16_t * const bak = temp+64;
- int sum=0, i;
+static int quant_psnr8x8_c(MpegEncContext *s, uint8_t *src1,
+ uint8_t *src2, int stride, int h)
+{
+ LOCAL_ALIGNED_16(int16_t, temp, [64 * 2]);
+ int16_t *const bak = temp + 64;
+ int sum = 0, i;
- av_assert2(h==8);
- s->mb_intra=0;
+ av_assert2(h == 8);
+ s->mb_intra = 0;
s->dsp.diff_pixels(temp, src1, src2, stride);
- memcpy(bak, temp, 64*sizeof(int16_t));
+ memcpy(bak, temp, 64 * sizeof(int16_t));
- s->block_last_index[0/*FIXME*/]= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
+ s->block_last_index[0 /* FIXME */] =
+ s->fast_dct_quantize(s, temp, 0 /* FIXME */, s->qscale, &i);
s->dct_unquantize_inter(s, temp, 0, s->qscale);
- ff_simple_idct_8(temp); //FIXME
+ ff_simple_idct_8(temp); // FIXME
- for(i=0; i<64; i++)
- sum+= (temp[i]-bak[i])*(temp[i]-bak[i]);
+ for (i = 0; i < 64; i++)
+ sum += (temp[i] - bak[i]) * (temp[i] - bak[i]);
return sum;
}
-static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
- const uint8_t *scantable= s->intra_scantable.permutated;
+static int rd8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2,
+ int stride, int h)
+{
+ const uint8_t *scantable = s->intra_scantable.permutated;
LOCAL_ALIGNED_16(int16_t, temp, [64]);
LOCAL_ALIGNED_16(uint8_t, lsrc1, [64]);
LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]);
int i, last, run, bits, level, distortion, start_i;
- const int esc_length= s->ac_esc_length;
- uint8_t * length;
- uint8_t * last_length;
+ const int esc_length = s->ac_esc_length;
+ uint8_t *length, *last_length;
- av_assert2(h==8);
+ av_assert2(h == 8);
copy_block8(lsrc1, src1, 8, stride, 8);
copy_block8(lsrc2, src2, 8, stride, 8);
s->dsp.diff_pixels(temp, lsrc1, lsrc2, 8);
- s->block_last_index[0/*FIXME*/]= last= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
+ s->block_last_index[0 /* FIXME */] =
+ last =
+ s->fast_dct_quantize(s, temp, 0 /* FIXME */, s->qscale, &i);
- bits=0;
+ bits = 0;
if (s->mb_intra) {
- start_i = 1;
- length = s->intra_ac_vlc_length;
- last_length= s->intra_ac_vlc_last_length;
- bits+= s->luma_dc_vlc_length[temp[0] + 256]; //FIXME chroma
+ start_i = 1;
+ length = s->intra_ac_vlc_length;
+ last_length = s->intra_ac_vlc_last_length;
+ bits += s->luma_dc_vlc_length[temp[0] + 256]; // FIXME: chroma
} else {
- start_i = 0;
- length = s->inter_ac_vlc_length;
- last_length= s->inter_ac_vlc_last_length;
- }
-
- if(last>=start_i){
- run=0;
- for(i=start_i; i<last; i++){
- int j= scantable[i];
- level= temp[j];
-
- if(level){
- level+=64;
- if((level&(~127)) == 0){
- bits+= length[UNI_AC_ENC_INDEX(run, level)];
- }else
- bits+= esc_length;
- run=0;
- }else
+ start_i = 0;
+ length = s->inter_ac_vlc_length;
+ last_length = s->inter_ac_vlc_last_length;
+ }
+
+ if (last >= start_i) {
+ run = 0;
+ for (i = start_i; i < last; i++) {
+ int j = scantable[i];
+ level = temp[j];
+
+ if (level) {
+ level += 64;
+ if ((level & (~127)) == 0)
+ bits += length[UNI_AC_ENC_INDEX(run, level)];
+ else
+ bits += esc_length;
+ run = 0;
+ } else
run++;
}
- i= scantable[last];
+ i = scantable[last];
- level= temp[i] + 64;
+ level = temp[i] + 64;
av_assert2(level - 64);
- if((level&(~127)) == 0){
- bits+= last_length[UNI_AC_ENC_INDEX(run, level)];
- }else
- bits+= esc_length;
-
+ if ((level & (~127)) == 0) {
+ bits += last_length[UNI_AC_ENC_INDEX(run, level)];
+ } else
+ bits += esc_length;
}
- if(last>=0){
- if(s->mb_intra)
+ if (last >= 0) {
+ if (s->mb_intra)
s->dct_unquantize_intra(s, temp, 0, s->qscale);
else
s->dct_unquantize_inter(s, temp, 0, s->qscale);
@@ -2265,158 +2221,172 @@ static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int
s->dsp.idct_add(lsrc2, 8, temp);
- distortion= s->dsp.sse[1](NULL, lsrc2, lsrc1, 8, 8);
+ distortion = s->dsp.sse[1](NULL, lsrc2, lsrc1, 8, 8);
- return distortion + ((bits*s->qscale*s->qscale*109 + 64)>>7);
+ return distortion + ((bits * s->qscale * s->qscale * 109 + 64) >> 7);
}
-static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
- const uint8_t *scantable= s->intra_scantable.permutated;
+static int bit8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2,
+ int stride, int h)
+{
+ const uint8_t *scantable = s->intra_scantable.permutated;
LOCAL_ALIGNED_16(int16_t, temp, [64]);
int i, last, run, bits, level, start_i;
- const int esc_length= s->ac_esc_length;
- uint8_t * length;
- uint8_t * last_length;
+ const int esc_length = s->ac_esc_length;
+ uint8_t *length, *last_length;
- av_assert2(h==8);
+ av_assert2(h == 8);
s->dsp.diff_pixels(temp, src1, src2, stride);
- s->block_last_index[0/*FIXME*/]= last= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
+ s->block_last_index[0 /* FIXME */] =
+ last =
+ s->fast_dct_quantize(s, temp, 0 /* FIXME */, s->qscale, &i);
- bits=0;
+ bits = 0;
if (s->mb_intra) {
- start_i = 1;
- length = s->intra_ac_vlc_length;
- last_length= s->intra_ac_vlc_last_length;
- bits+= s->luma_dc_vlc_length[temp[0] + 256]; //FIXME chroma
+ start_i = 1;
+ length = s->intra_ac_vlc_length;
+ last_length = s->intra_ac_vlc_last_length;
+ bits += s->luma_dc_vlc_length[temp[0] + 256]; // FIXME: chroma
} else {
- start_i = 0;
- length = s->inter_ac_vlc_length;
- last_length= s->inter_ac_vlc_last_length;
- }
-
- if(last>=start_i){
- run=0;
- for(i=start_i; i<last; i++){
- int j= scantable[i];
- level= temp[j];
-
- if(level){
- level+=64;
- if((level&(~127)) == 0){
- bits+= length[UNI_AC_ENC_INDEX(run, level)];
- }else
- bits+= esc_length;
- run=0;
- }else
+ start_i = 0;
+ length = s->inter_ac_vlc_length;
+ last_length = s->inter_ac_vlc_last_length;
+ }
+
+ if (last >= start_i) {
+ run = 0;
+ for (i = start_i; i < last; i++) {
+ int j = scantable[i];
+ level = temp[j];
+
+ if (level) {
+ level += 64;
+ if ((level & (~127)) == 0)
+ bits += length[UNI_AC_ENC_INDEX(run, level)];
+ else
+ bits += esc_length;
+ run = 0;
+ } else
run++;
}
- i= scantable[last];
+ i = scantable[last];
- level= temp[i] + 64;
+ level = temp[i] + 64;
av_assert2(level - 64);
- if((level&(~127)) == 0){
- bits+= last_length[UNI_AC_ENC_INDEX(run, level)];
- }else
- bits+= esc_length;
+ if ((level & (~127)) == 0)
+ bits += last_length[UNI_AC_ENC_INDEX(run, level)];
+ else
+ bits += esc_length;
}
return bits;
}
-#define VSAD_INTRA(size) \
-static int vsad_intra##size##_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){ \
- int score=0; \
- int x,y; \
- \
- for(y=1; y<h; y++){ \
- for(x=0; x<size; x+=4){ \
- score+= FFABS(s[x ] - s[x +stride]) + FFABS(s[x+1] - s[x+1+stride]) \
- +FFABS(s[x+2] - s[x+2+stride]) + FFABS(s[x+3] - s[x+3+stride]); \
- } \
- s+= stride; \
- } \
- \
- return score; \
+#define VSAD_INTRA(size) \
+static int vsad_intra ## size ## _c(MpegEncContext *c, \
+ uint8_t *s, uint8_t *dummy, \
+ int stride, int h) \
+{ \
+ int score = 0, x, y; \
+ \
+ for (y = 1; y < h; y++) { \
+ for (x = 0; x < size; x += 4) { \
+ score += FFABS(s[x] - s[x + stride]) + \
+ FFABS(s[x + 1] - s[x + stride + 1]) + \
+ FFABS(s[x + 2] - s[x + 2 + stride]) + \
+ FFABS(s[x + 3] - s[x + 3 + stride]); \
+ } \
+ s += stride; \
+ } \
+ \
+ return score; \
}
VSAD_INTRA(8)
VSAD_INTRA(16)
-static int vsad16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
- int score=0;
- int x,y;
+static int vsad16_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2,
+ int stride, int h)
+{
+ int score = 0, x, y;
- for(y=1; y<h; y++){
- for(x=0; x<16; x++){
- score+= FFABS(s1[x ] - s2[x ] - s1[x +stride] + s2[x +stride]);
- }
- s1+= stride;
- s2+= stride;
+ for (y = 1; y < h; y++) {
+ for (x = 0; x < 16; x++)
+ score += FFABS(s1[x] - s2[x] - s1[x + stride] + s2[x + stride]);
+ s1 += stride;
+ s2 += stride;
}
return score;
}
-#define SQ(a) ((a)*(a))
-#define VSSE_INTRA(size) \
-static int vsse_intra##size##_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){ \
- int score=0; \
- int x,y; \
- \
- for(y=1; y<h; y++){ \
- for(x=0; x<size; x+=4){ \
- score+= SQ(s[x ] - s[x +stride]) + SQ(s[x+1] - s[x+1+stride]) \
- +SQ(s[x+2] - s[x+2+stride]) + SQ(s[x+3] - s[x+3+stride]); \
- } \
- s+= stride; \
- } \
- \
- return score; \
+#define SQ(a) ((a) * (a))
+#define VSSE_INTRA(size) \
+static int vsse_intra ## size ## _c(MpegEncContext *c, \
+ uint8_t *s, uint8_t *dummy, \
+ int stride, int h) \
+{ \
+ int score = 0, x, y; \
+ \
+ for (y = 1; y < h; y++) { \
+ for (x = 0; x < size; x += 4) { \
+ score += SQ(s[x] - s[x + stride]) + \
+ SQ(s[x + 1] - s[x + stride + 1]) + \
+ SQ(s[x + 2] - s[x + stride + 2]) + \
+ SQ(s[x + 3] - s[x + stride + 3]); \
+ } \
+ s += stride; \
+ } \
+ \
+ return score; \
}
VSSE_INTRA(8)
VSSE_INTRA(16)
-static int vsse16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
- int score=0;
- int x,y;
+static int vsse16_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2,
+ int stride, int h)
+{
+ int score = 0, x, y;
- for(y=1; y<h; y++){
- for(x=0; x<16; x++){
- score+= SQ(s1[x ] - s2[x ] - s1[x +stride] + s2[x +stride]);
- }
- s1+= stride;
- s2+= stride;
+ for (y = 1; y < h; y++) {
+ for (x = 0; x < 16; x++)
+ score += SQ(s1[x] - s2[x] - s1[x + stride] + s2[x + stride]);
+ s1 += stride;
+ s2 += stride;
}
return score;
}
static int ssd_int8_vs_int16_c(const int8_t *pix1, const int16_t *pix2,
- int size){
- int score=0;
- int i;
- for(i=0; i<size; i++)
- score += (pix1[i]-pix2[i])*(pix1[i]-pix2[i]);
+ int size)
+{
+ int score = 0, i;
+
+ for (i = 0; i < size; i++)
+ score += (pix1[i] - pix2[i]) * (pix1[i] - pix2[i]);
return score;
}
-#define WRAPPER8_16_SQ(name8, name16)\
-static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
- int score=0;\
- score +=name8(s, dst , src , stride, 8);\
- score +=name8(s, dst+8 , src+8 , stride, 8);\
- if(h==16){\
- dst += 8*stride;\
- src += 8*stride;\
- score +=name8(s, dst , src , stride, 8);\
- score +=name8(s, dst+8 , src+8 , stride, 8);\
- }\
- return score;\
+#define WRAPPER8_16_SQ(name8, name16) \
+static int name16(MpegEncContext *s, uint8_t *dst, uint8_t *src, \
+ int stride, int h) \
+{ \
+ int score = 0; \
+ \
+ score += name8(s, dst, src, stride, 8); \
+ score += name8(s, dst + 8, src + 8, stride, 8); \
+ if (h == 16) { \
+ dst += 8 * stride; \
+ src += 8 * stride; \
+ score += name8(s, dst, src, stride, 8); \
+ score += name8(s, dst + 8, src + 8, stride, 8); \
+ } \
+ return score; \
}
WRAPPER8_16_SQ(hadamard8_diff8x8_c, hadamard8_diff16_c)
@@ -2431,22 +2401,27 @@ WRAPPER8_16_SQ(rd8x8_c, rd16_c)
WRAPPER8_16_SQ(bit8x8_c, bit16_c)
static inline uint32_t clipf_c_one(uint32_t a, uint32_t mini,
- uint32_t maxi, uint32_t maxisign)
+ uint32_t maxi, uint32_t maxisign)
{
-
- if(a > mini) return mini;
- else if((a^(1U<<31)) > maxisign) return maxi;
- else return a;
+ if (a > mini)
+ return mini;
+ else if ((a ^ (1U << 31)) > maxisign)
+ return maxi;
+ else
+ return a;
}
-static void vector_clipf_c_opposite_sign(float *dst, const float *src, float *min, float *max, int len){
+static void vector_clipf_c_opposite_sign(float *dst, const float *src,
+ float *min, float *max, int len)
+{
int i;
- uint32_t mini = *(uint32_t*)min;
- uint32_t maxi = *(uint32_t*)max;
- uint32_t maxisign = maxi ^ (1U<<31);
- uint32_t *dsti = (uint32_t*)dst;
- const uint32_t *srci = (const uint32_t*)src;
- for(i=0; i<len; i+=8) {
+ uint32_t mini = *(uint32_t *) min;
+ uint32_t maxi = *(uint32_t *) max;
+ uint32_t maxisign = maxi ^ (1U << 31);
+ uint32_t *dsti = (uint32_t *) dst;
+ const uint32_t *srci = (const uint32_t *) src;
+
+ for (i = 0; i < len; i += 8) {
dsti[i + 0] = clipf_c_one(srci[i + 0], mini, maxi, maxisign);
dsti[i + 1] = clipf_c_one(srci[i + 1], mini, maxi, maxisign);
dsti[i + 2] = clipf_c_one(srci[i + 2], mini, maxi, maxisign);
@@ -2457,13 +2432,17 @@ static void vector_clipf_c_opposite_sign(float *dst, const float *src, float *mi
dsti[i + 7] = clipf_c_one(srci[i + 7], mini, maxi, maxisign);
}
}
-static void vector_clipf_c(float *dst, const float *src, float min, float max, int len){
+
+static void vector_clipf_c(float *dst, const float *src,
+ float min, float max, int len)
+{
int i;
- if(min < 0 && max > 0) {
+
+ if (min < 0 && max > 0) {
vector_clipf_c_opposite_sign(dst, src, &min, &max, len);
} else {
- for(i=0; i < len; i+=8) {
- dst[i ] = av_clipf(src[i ], min, max);
+ for (i = 0; i < len; i += 8) {
+ dst[i] = av_clipf(src[i], min, max);
dst[i + 1] = av_clipf(src[i + 1], min, max);
dst[i + 2] = av_clipf(src[i + 2], min, max);
dst[i + 3] = av_clipf(src[i + 3], min, max);
@@ -2475,19 +2454,23 @@ static void vector_clipf_c(float *dst, const float *src, float min, float max, i
}
}
-static int32_t scalarproduct_int16_c(const int16_t * v1, const int16_t * v2, int order)
+static int32_t scalarproduct_int16_c(const int16_t *v1, const int16_t *v2,
+ int order)
{
int res = 0;
while (order--)
- res += *v1++ * *v2++;
+ res += *v1++ **v2++;
return res;
}
-static int32_t scalarproduct_and_madd_int16_c(int16_t *v1, const int16_t *v2, const int16_t *v3, int order, int mul)
+static int32_t scalarproduct_and_madd_int16_c(int16_t *v1, const int16_t *v2,
+ const int16_t *v3,
+ int order, int mul)
{
int res = 0;
+
while (order--) {
res += *v1 * *v2++;
*v1++ += mul * *v3++;
@@ -2507,18 +2490,19 @@ static void vector_clip_int32_c(int32_t *dst, const int32_t *src, int32_t min,
*dst++ = av_clip(*src++, min, max);
*dst++ = av_clip(*src++, min, max);
*dst++ = av_clip(*src++, min, max);
- len -= 8;
+ len -= 8;
} while (len > 0);
}
static void jref_idct_put(uint8_t *dest, int line_size, int16_t *block)
{
- ff_j_rev_dct (block);
+ ff_j_rev_dct(block);
put_pixels_clamped_c(block, dest, line_size);
}
+
static void jref_idct_add(uint8_t *dest, int line_size, int16_t *block)
{
- ff_j_rev_dct (block);
+ ff_j_rev_dct(block);
add_pixels_clamped_c(block, dest, line_size);
}
@@ -2553,22 +2537,60 @@ static void ff_jref_idct1_add(uint8_t *dest, int line_size, int16_t *block)
dest[0] = av_clip_uint8(dest[0] + ((block[0] + 4)>>3));
}
+/* draw the edges of width 'w' of an image of size width, height */
+// FIXME: Check that this is OK for MPEG-4 interlaced.
+static void draw_edges_8_c(uint8_t *buf, int wrap, int width, int height,
+ int w, int h, int sides)
+{
+ uint8_t *ptr = buf, *last_line;
+ int i;
+
+ /* left and right */
+ for (i = 0; i < height; i++) {
+ memset(ptr - w, ptr[0], w);
+ memset(ptr + width, ptr[width - 1], w);
+ ptr += wrap;
+ }
+
+ /* top and bottom + corners */
+ buf -= w;
+ last_line = buf + (height - 1) * wrap;
+ if (sides & EDGE_TOP)
+ for (i = 0; i < h; i++)
+ // top
+ memcpy(buf - (i + 1) * wrap, buf, width + w + w);
+ if (sides & EDGE_BOTTOM)
+ for (i = 0; i < h; i++)
+ // bottom
+ memcpy(last_line + (i + 1) * wrap, last_line, width + w + w);
+}
+
+static void clear_block_8_c(int16_t *block)
+{
+ memset(block, 0, sizeof(int16_t) * 64);
+}
+
+static void clear_blocks_8_c(int16_t *blocks)
+{
+ memset(blocks, 0, sizeof(int16_t) * 6 * 64);
+}
+
/* init static data */
av_cold void ff_dsputil_static_init(void)
{
int i;
- for(i=0;i<512;i++) {
- ff_squareTbl[i] = (i - 256) * (i - 256);
- }
+ for (i = 0; i < 512; i++)
+ ff_square_tab[i] = (i - 256) * (i - 256);
}
-int ff_check_alignment(void){
- static int did_fail=0;
+int ff_check_alignment(void)
+{
+ static int did_fail = 0;
LOCAL_ALIGNED_16(int, aligned, [4]);
- if((intptr_t)aligned & 15){
- if(!did_fail){
+ if ((intptr_t)aligned & 15) {
+ if (!did_fail) {
#if HAVE_MMX || HAVE_ALTIVEC
av_log(NULL, AV_LOG_ERROR,
"Compiler did not align stack variables. Libavcodec has been miscompiled\n"
@@ -2583,8 +2605,10 @@ int ff_check_alignment(void){
return 0;
}
-av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
+av_cold void ff_dsputil_init(DSPContext *c, AVCodecContext *avctx)
{
+ const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
+
ff_check_alignment();
#if CONFIG_ENCODERS
@@ -2592,37 +2616,35 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->fdct = ff_jpeg_fdct_islow_10;
c->fdct248 = ff_fdct248_islow_10;
} else {
- if(avctx->dct_algo==FF_DCT_FASTINT) {
+ if (avctx->dct_algo == FF_DCT_FASTINT) {
c->fdct = ff_fdct_ifast;
c->fdct248 = ff_fdct_ifast248;
- }
- else if(avctx->dct_algo==FF_DCT_FAAN) {
+ } else if (avctx->dct_algo == FF_DCT_FAAN) {
c->fdct = ff_faandct;
c->fdct248 = ff_faandct248;
- }
- else {
- c->fdct = ff_jpeg_fdct_islow_8; //slow/accurate/default
+ } else {
+ c->fdct = ff_jpeg_fdct_islow_8; // slow/accurate/default
c->fdct248 = ff_fdct248_islow_8;
}
}
-#endif //CONFIG_ENCODERS
-
- if(avctx->lowres==1){
- c->idct_put= ff_jref_idct4_put;
- c->idct_add= ff_jref_idct4_add;
- c->idct = ff_j_rev_dct4;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
- }else if(avctx->lowres==2){
- c->idct_put= ff_jref_idct2_put;
- c->idct_add= ff_jref_idct2_add;
- c->idct = ff_j_rev_dct2;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
- }else if(avctx->lowres==3){
- c->idct_put= ff_jref_idct1_put;
- c->idct_add= ff_jref_idct1_add;
- c->idct = ff_j_rev_dct1;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
- }else{
+#endif /* CONFIG_ENCODERS */
+
+ if (avctx->lowres==1) {
+ c->idct_put = ff_jref_idct4_put;
+ c->idct_add = ff_jref_idct4_add;
+ c->idct = ff_j_rev_dct4;
+ c->idct_permutation_type = FF_NO_IDCT_PERM;
+ } else if (avctx->lowres==2) {
+ c->idct_put = ff_jref_idct2_put;
+ c->idct_add = ff_jref_idct2_add;
+ c->idct = ff_j_rev_dct2;
+ c->idct_permutation_type = FF_NO_IDCT_PERM;
+ } else if (avctx->lowres==3) {
+ c->idct_put = ff_jref_idct1_put;
+ c->idct_add = ff_jref_idct1_add;
+ c->idct = ff_j_rev_dct1;
+ c->idct_permutation_type = FF_NO_IDCT_PERM;
+ } else {
if (avctx->bits_per_raw_sample == 10) {
c->idct_put = ff_simple_idct_put_10;
c->idct_add = ff_simple_idct_add_10;
@@ -2634,33 +2656,37 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->idct = ff_simple_idct_12;
c->idct_permutation_type = FF_NO_IDCT_PERM;
} else {
- if(avctx->idct_algo==FF_IDCT_INT){
- c->idct_put= jref_idct_put;
- c->idct_add= jref_idct_add;
- c->idct = ff_j_rev_dct;
- c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
- }else if(avctx->idct_algo==FF_IDCT_FAAN){
- c->idct_put= ff_faanidct_put;
- c->idct_add= ff_faanidct_add;
- c->idct = ff_faanidct;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
- }else{ //accurate/default
- c->idct_put = ff_simple_idct_put_8;
- c->idct_add = ff_simple_idct_add_8;
- c->idct = ff_simple_idct_8;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
+ if (avctx->idct_algo == FF_IDCT_INT) {
+ c->idct_put = jref_idct_put;
+ c->idct_add = jref_idct_add;
+ c->idct = ff_j_rev_dct;
+ c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
+ } else if (avctx->idct_algo == FF_IDCT_FAAN) {
+ c->idct_put = ff_faanidct_put;
+ c->idct_add = ff_faanidct_add;
+ c->idct = ff_faanidct;
+ c->idct_permutation_type = FF_NO_IDCT_PERM;
+ } else { // accurate/default
+ c->idct_put = ff_simple_idct_put_8;
+ c->idct_add = ff_simple_idct_add_8;
+ c->idct = ff_simple_idct_8;
+ c->idct_permutation_type = FF_NO_IDCT_PERM;
}
}
}
c->diff_pixels = diff_pixels_c;
- c->put_pixels_clamped = put_pixels_clamped_c;
+
+ c->put_pixels_clamped = put_pixels_clamped_c;
c->put_signed_pixels_clamped = put_signed_pixels_clamped_c;
- c->add_pixels_clamped = add_pixels_clamped_c;
+ c->add_pixels_clamped = add_pixels_clamped_c;
+
c->sum_abs_dctelem = sum_abs_dctelem_c;
+
c->gmc1 = gmc1_c;
- c->gmc = ff_gmc_c;
- c->pix_sum = pix_sum_c;
+ c->gmc = ff_gmc_c;
+
+ c->pix_sum = pix_sum_c;
c->pix_norm1 = pix_norm1_c;
c->fill_block_tab[0] = fill_block16_c;
@@ -2676,37 +2702,17 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->pix_abs[1][2] = pix_abs8_y2_c;
c->pix_abs[1][3] = pix_abs8_xy2_c;
- c->put_tpel_pixels_tab[ 0] = put_tpel_pixels_mc00_c;
- c->put_tpel_pixels_tab[ 1] = put_tpel_pixels_mc10_c;
- c->put_tpel_pixels_tab[ 2] = put_tpel_pixels_mc20_c;
- c->put_tpel_pixels_tab[ 4] = put_tpel_pixels_mc01_c;
- c->put_tpel_pixels_tab[ 5] = put_tpel_pixels_mc11_c;
- c->put_tpel_pixels_tab[ 6] = put_tpel_pixels_mc21_c;
- c->put_tpel_pixels_tab[ 8] = put_tpel_pixels_mc02_c;
- c->put_tpel_pixels_tab[ 9] = put_tpel_pixels_mc12_c;
- c->put_tpel_pixels_tab[10] = put_tpel_pixels_mc22_c;
-
- c->avg_tpel_pixels_tab[ 0] = avg_tpel_pixels_mc00_c;
- c->avg_tpel_pixels_tab[ 1] = avg_tpel_pixels_mc10_c;
- c->avg_tpel_pixels_tab[ 2] = avg_tpel_pixels_mc20_c;
- c->avg_tpel_pixels_tab[ 4] = avg_tpel_pixels_mc01_c;
- c->avg_tpel_pixels_tab[ 5] = avg_tpel_pixels_mc11_c;
- c->avg_tpel_pixels_tab[ 6] = avg_tpel_pixels_mc21_c;
- c->avg_tpel_pixels_tab[ 8] = avg_tpel_pixels_mc02_c;
- c->avg_tpel_pixels_tab[ 9] = avg_tpel_pixels_mc12_c;
- c->avg_tpel_pixels_tab[10] = avg_tpel_pixels_mc22_c;
-
-#define dspfunc(PFX, IDX, NUM) \
- c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_c; \
- c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_c; \
- c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_c; \
- c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_c; \
- c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_c; \
- c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_c; \
- c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_c; \
- c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_c; \
- c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_c; \
- c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_c; \
+#define dspfunc(PFX, IDX, NUM) \
+ c->PFX ## _pixels_tab[IDX][0] = PFX ## NUM ## _mc00_c; \
+ c->PFX ## _pixels_tab[IDX][1] = PFX ## NUM ## _mc10_c; \
+ c->PFX ## _pixels_tab[IDX][2] = PFX ## NUM ## _mc20_c; \
+ c->PFX ## _pixels_tab[IDX][3] = PFX ## NUM ## _mc30_c; \
+ c->PFX ## _pixels_tab[IDX][4] = PFX ## NUM ## _mc01_c; \
+ c->PFX ## _pixels_tab[IDX][5] = PFX ## NUM ## _mc11_c; \
+ c->PFX ## _pixels_tab[IDX][6] = PFX ## NUM ## _mc21_c; \
+ c->PFX ## _pixels_tab[IDX][7] = PFX ## NUM ## _mc31_c; \
+ c->PFX ## _pixels_tab[IDX][8] = PFX ## NUM ## _mc02_c; \
+ c->PFX ## _pixels_tab[IDX][9] = PFX ## NUM ## _mc12_c; \
c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_c; \
c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_c; \
c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_c; \
@@ -2715,108 +2721,101 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_c
dspfunc(put_qpel, 0, 16);
- dspfunc(put_no_rnd_qpel, 0, 16);
-
- dspfunc(avg_qpel, 0, 16);
- /* dspfunc(avg_no_rnd_qpel, 0, 16); */
-
dspfunc(put_qpel, 1, 8);
+
+ dspfunc(put_no_rnd_qpel, 0, 16);
dspfunc(put_no_rnd_qpel, 1, 8);
+ dspfunc(avg_qpel, 0, 16);
dspfunc(avg_qpel, 1, 8);
- /* dspfunc(avg_no_rnd_qpel, 1, 8); */
#undef dspfunc
- c->put_mspel_pixels_tab[0]= ff_put_pixels8x8_c;
- c->put_mspel_pixels_tab[1]= put_mspel8_mc10_c;
- c->put_mspel_pixels_tab[2]= put_mspel8_mc20_c;
- c->put_mspel_pixels_tab[3]= put_mspel8_mc30_c;
- c->put_mspel_pixels_tab[4]= put_mspel8_mc02_c;
- c->put_mspel_pixels_tab[5]= put_mspel8_mc12_c;
- c->put_mspel_pixels_tab[6]= put_mspel8_mc22_c;
- c->put_mspel_pixels_tab[7]= put_mspel8_mc32_c;
+ c->put_mspel_pixels_tab[0] = ff_put_pixels8x8_c;
+ c->put_mspel_pixels_tab[1] = put_mspel8_mc10_c;
+ c->put_mspel_pixels_tab[2] = put_mspel8_mc20_c;
+ c->put_mspel_pixels_tab[3] = put_mspel8_mc30_c;
+ c->put_mspel_pixels_tab[4] = put_mspel8_mc02_c;
+ c->put_mspel_pixels_tab[5] = put_mspel8_mc12_c;
+ c->put_mspel_pixels_tab[6] = put_mspel8_mc22_c;
+ c->put_mspel_pixels_tab[7] = put_mspel8_mc32_c;
-#define SET_CMP_FUNC(name) \
- c->name[0]= name ## 16_c;\
- c->name[1]= name ## 8x8_c;
+#define SET_CMP_FUNC(name) \
+ c->name[0] = name ## 16_c; \
+ c->name[1] = name ## 8x8_c;
SET_CMP_FUNC(hadamard8_diff)
- c->hadamard8_diff[4]= hadamard8_intra16_c;
- c->hadamard8_diff[5]= hadamard8_intra8x8_c;
+ c->hadamard8_diff[4] = hadamard8_intra16_c;
+ c->hadamard8_diff[5] = hadamard8_intra8x8_c;
SET_CMP_FUNC(dct_sad)
SET_CMP_FUNC(dct_max)
#if CONFIG_GPL
SET_CMP_FUNC(dct264_sad)
#endif
- c->sad[0]= pix_abs16_c;
- c->sad[1]= pix_abs8_c;
- c->sse[0]= sse16_c;
- c->sse[1]= sse8_c;
- c->sse[2]= sse4_c;
+ c->sad[0] = pix_abs16_c;
+ c->sad[1] = pix_abs8_c;
+ c->sse[0] = sse16_c;
+ c->sse[1] = sse8_c;
+ c->sse[2] = sse4_c;
SET_CMP_FUNC(quant_psnr)
SET_CMP_FUNC(rd)
SET_CMP_FUNC(bit)
- c->vsad[0]= vsad16_c;
- c->vsad[4]= vsad_intra16_c;
- c->vsad[5]= vsad_intra8_c;
- c->vsse[0]= vsse16_c;
- c->vsse[4]= vsse_intra16_c;
- c->vsse[5]= vsse_intra8_c;
- c->nsse[0]= nsse16_c;
- c->nsse[1]= nsse8_c;
+ c->vsad[0] = vsad16_c;
+ c->vsad[4] = vsad_intra16_c;
+ c->vsad[5] = vsad_intra8_c;
+ c->vsse[0] = vsse16_c;
+ c->vsse[4] = vsse_intra16_c;
+ c->vsse[5] = vsse_intra8_c;
+ c->nsse[0] = nsse16_c;
+ c->nsse[1] = nsse8_c;
#if CONFIG_SNOW_DECODER || CONFIG_SNOW_ENCODER
ff_dsputil_init_dwt(c);
#endif
c->ssd_int8_vs_int16 = ssd_int8_vs_int16_c;
- c->add_bytes= add_bytes_c;
- c->diff_bytes= diff_bytes_c;
- c->add_hfyu_median_prediction= add_hfyu_median_prediction_c;
- c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c;
- c->add_hfyu_left_prediction = add_hfyu_left_prediction_c;
+ c->add_bytes = add_bytes_c;
+ c->add_hfyu_median_prediction = add_hfyu_median_prediction_c;
+ c->add_hfyu_left_prediction = add_hfyu_left_prediction_c;
c->add_hfyu_left_prediction_bgr32 = add_hfyu_left_prediction_bgr32_c;
- c->bswap_buf= bswap_buf;
+
+ c->diff_bytes = diff_bytes_c;
+ c->sub_hfyu_median_prediction = sub_hfyu_median_prediction_c;
+
+ c->bswap_buf = bswap_buf;
c->bswap16_buf = bswap16_buf;
- c->try_8x8basis= try_8x8basis_c;
- c->add_8x8basis= add_8x8basis_c;
+ c->try_8x8basis = try_8x8basis_c;
+ c->add_8x8basis = add_8x8basis_c;
- c->vector_clipf = vector_clipf_c;
- c->scalarproduct_int16 = scalarproduct_int16_c;
c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_c;
- c->vector_clip_int32 = vector_clip_int32_c;
- c->shrink[0]= av_image_copy_plane;
- c->shrink[1]= ff_shrink22;
- c->shrink[2]= ff_shrink44;
- c->shrink[3]= ff_shrink88;
+ c->scalarproduct_int16 = scalarproduct_int16_c;
+ c->vector_clip_int32 = vector_clip_int32_c;
+ c->vector_clipf = vector_clipf_c;
+
+ c->shrink[0] = av_image_copy_plane;
+ c->shrink[1] = ff_shrink22;
+ c->shrink[2] = ff_shrink44;
+ c->shrink[3] = ff_shrink88;
c->add_pixels8 = add_pixels8_c;
-#undef FUNC
-#undef FUNCC
-#define FUNC(f, depth) f ## _ ## depth
-#define FUNCC(f, depth) f ## _ ## depth ## _c
-
- c->draw_edges = FUNCC(draw_edges, 8);
- c->clear_block = FUNCC(clear_block, 8);
- c->clear_blocks = FUNCC(clear_blocks, 8);
+ c->draw_edges = draw_edges_8_c;
-#define BIT_DEPTH_FUNCS(depth) \
- c->get_pixels = FUNCC(get_pixels, depth);
+ c->clear_block = clear_block_8_c;
+ c->clear_blocks = clear_blocks_8_c;
switch (avctx->bits_per_raw_sample) {
case 9:
case 10:
case 12:
case 14:
- BIT_DEPTH_FUNCS(16);
+ c->get_pixels = get_pixels_16_c;
break;
default:
- if(avctx->bits_per_raw_sample<=8 || avctx->codec_type != AVMEDIA_TYPE_VIDEO) {
- BIT_DEPTH_FUNCS(8);
+ if (avctx->bits_per_raw_sample<=8 || avctx->codec_type != AVMEDIA_TYPE_VIDEO) {
+ c->get_pixels = get_pixels_8_c;
}
break;
}
@@ -2825,17 +2824,13 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
if (ARCH_ALPHA)
ff_dsputil_init_alpha(c, avctx);
if (ARCH_ARM)
- ff_dsputil_init_arm(c, avctx);
+ ff_dsputil_init_arm(c, avctx, high_bit_depth);
if (ARCH_BFIN)
- ff_dsputil_init_bfin(c, avctx);
+ ff_dsputil_init_bfin(c, avctx, high_bit_depth);
if (ARCH_PPC)
- ff_dsputil_init_ppc(c, avctx);
- if (ARCH_SH4)
- ff_dsputil_init_sh4(c, avctx);
- if (HAVE_VIS)
- ff_dsputil_init_vis(c, avctx);
+ ff_dsputil_init_ppc(c, avctx, high_bit_depth);
if (ARCH_X86)
- ff_dsputil_init_x86(c, avctx);
+ ff_dsputil_init_x86(c, avctx, high_bit_depth);
ff_init_scantable_permutation(c->idct_permutation,
c->idct_permutation_type);
diff --git a/chromium/third_party/ffmpeg/libavcodec/dsputil.h b/chromium/third_party/ffmpeg/libavcodec/dsputil.h
index 0897c560b43..f8eb8fd0086 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dsputil.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dsputil.h
@@ -23,69 +23,60 @@
/**
* @file
* DSP utils.
- * note, many functions in here may use MMX which trashes the FPU state, it is
- * absolutely necessary to call emms_c() between dsp & float/double code
+ * Note, many functions in here may use MMX which trashes the FPU state, it is
+ * absolutely necessary to call emms_c() between DSP & float/double code.
*/
#ifndef AVCODEC_DSPUTIL_H
#define AVCODEC_DSPUTIL_H
-#include "libavutil/intreadwrite.h"
#include "avcodec.h"
-#include "rnd_avg.h"
/* encoding scans */
extern const uint8_t ff_alternate_horizontal_scan[64];
extern const uint8_t ff_alternate_vertical_scan[64];
-extern const uint8_t ff_zigzag_direct[64];
-extern const uint8_t ff_zigzag248_direct[64];
-/* pixel operations */
-#define MAX_NEG_CROP 1024
-
-/* temporary */
-extern uint32_t ff_squareTbl[512];
-extern const uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP];
+extern uint32_t ff_square_tab[512];
void ff_put_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
void ff_avg_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
void ff_put_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
void ff_avg_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-/* RV40 functions */
-void ff_put_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-
void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
+ int dxx, int dxy, int dyx, int dyy, int shift, int r,
+ int width, int height);
/* minimum alignment rules ;)
-If you notice errors in the align stuff, need more alignment for some ASM code
-for some CPU or need to use a function with less aligned data then send a mail
-to the ffmpeg-devel mailing list, ...
-
-!warning These alignments might not match reality, (missing attribute((align))
-stuff somewhere possible).
-I (Michael) did not check them, these are just the alignments which I think
-could be reached easily ...
-
-!future video codecs might need functions with less strict alignment
-*/
+ * If you notice errors in the align stuff, need more alignment for some ASM code
+ * for some CPU or need to use a function with less aligned data then send a mail
+ * to the ffmpeg-devel mailing list, ...
+ *
+ * !warning These alignments might not match reality, (missing attribute((align))
+ * stuff somewhere possible).
+ * I (Michael) did not check them, these are just the alignments which I think
+ * could be reached easily ...
+ *
+ * !future video codecs might need functions with less strict alignment
+ */
-/* add and put pixel (decoding) */
-// blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
-//h for op_pixels_func is limited to {width/2, width} but never larger than 16 and never smaller than 4
-typedef void (*tpel_mc_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int w, int h);
-typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);
+/* add and put pixel (decoding)
+ * Block sizes for op_pixels_func are 8x4,8x8 16x8 16x16.
+ * h for op_pixels_func is limited to { width / 2, width },
+ * but never larger than 16 and never smaller than 4. */
+typedef void (*qpel_mc_func)(uint8_t *dst /* align width (8 or 16) */,
+ uint8_t *src /* align 1 */, ptrdiff_t stride);
-typedef void (*op_fill_func)(uint8_t *block/*align width (8 or 16)*/, uint8_t value, int line_size, int h);
+typedef void (*op_fill_func)(uint8_t *block /* align width (8 or 16) */,
+ uint8_t value, int line_size, int h);
-#define DEF_OLD_QPEL(name)\
-void ff_put_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);\
-void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);\
-void ff_avg_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);
+#define DEF_OLD_QPEL(name) \
+ void ff_put_ ## name(uint8_t *dst /* align width (8 or 16) */, \
+ uint8_t *src /* align 1 */, ptrdiff_t stride); \
+ void ff_put_no_rnd_ ## name(uint8_t *dst /* align width (8 or 16) */, \
+ uint8_t *src /* align 1 */, ptrdiff_t stride); \
+ void ff_avg_ ## name(uint8_t *dst /* align width (8 or 16) */, \
+ uint8_t *src /* align 1 */, ptrdiff_t stride);
DEF_OLD_QPEL(qpel16_mc11_old_c)
DEF_OLD_QPEL(qpel16_mc31_old_c)
@@ -100,21 +91,27 @@ DEF_OLD_QPEL(qpel8_mc32_old_c)
DEF_OLD_QPEL(qpel8_mc13_old_c)
DEF_OLD_QPEL(qpel8_mc33_old_c)
-/* motion estimation */
-// h is limited to {width/2, width, 2*width} but never larger than 16 and never smaller than 2
-// although currently h<4 is not used as functions with width <8 are neither used nor implemented
-typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size, int h)/* __attribute__ ((const))*/;
+struct MpegEncContext;
+/* Motion estimation:
+ * h is limited to { width / 2, width, 2 * width },
+ * but never larger than 16 and never smaller than 2.
+ * Although currently h < 4 is not used as functions with
+ * width < 8 are neither used nor implemented. */
+typedef int (*me_cmp_func)(struct MpegEncContext *c,
+ uint8_t *blk1 /* align width (8 or 16) */,
+ uint8_t *blk2 /* align 1 */, int line_size, int h);
/**
* Scantable.
*/
-typedef struct ScanTable{
+typedef struct ScanTable {
const uint8_t *scantable;
uint8_t permutated[64];
uint8_t raster_end[64];
} ScanTable;
-void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable);
+void ff_init_scantable(uint8_t *permutation, ScanTable *st,
+ const uint8_t *src_scantable);
void ff_init_scantable_permutation(uint8_t *idct_permutation,
int idct_permutation_type);
@@ -123,27 +120,40 @@ void ff_init_scantable_permutation(uint8_t *idct_permutation,
*/
typedef struct DSPContext {
/* pixel ops : interface with DCT */
- void (*get_pixels)(int16_t *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
- void (*diff_pixels)(int16_t *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
- void (*put_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
- void (*put_signed_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
- void (*add_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
+ void (*get_pixels)(int16_t *block /* align 16 */,
+ const uint8_t *pixels /* align 8 */,
+ int line_size);
+ void (*diff_pixels)(int16_t *block /* align 16 */,
+ const uint8_t *s1 /* align 8 */,
+ const uint8_t *s2 /* align 8 */,
+ int stride);
+ void (*put_pixels_clamped)(const int16_t *block /* align 16 */,
+ uint8_t *pixels /* align 8 */,
+ int line_size);
+ void (*put_signed_pixels_clamped)(const int16_t *block /* align 16 */,
+ uint8_t *pixels /* align 8 */,
+ int line_size);
+ void (*add_pixels_clamped)(const int16_t *block /* align 16 */,
+ uint8_t *pixels /* align 8 */,
+ int line_size);
void (*add_pixels8)(uint8_t *pixels, int16_t *block, int line_size);
- int (*sum_abs_dctelem)(int16_t *block/*align 16*/);
+ int (*sum_abs_dctelem)(int16_t *block /* align 16 */);
/**
* translational global motion compensation.
*/
- void (*gmc1)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
+ void (*gmc1)(uint8_t *dst /* align 8 */, uint8_t *src /* align 1 */,
+ int srcStride, int h, int x16, int y16, int rounder);
/**
* global motion compensation.
*/
- void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
- void (*clear_block)(int16_t *block/*align 16*/);
- void (*clear_blocks)(int16_t *blocks/*align 16*/);
- int (*pix_sum)(uint8_t * pix, int line_size);
- int (*pix_norm1)(uint8_t * pix, int line_size);
-// 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4
+ void (*gmc)(uint8_t *dst /* align 8 */, uint8_t *src /* align 1 */,
+ int stride, int h, int ox, int oy,
+ int dxx, int dxy, int dyx, int dyy,
+ int shift, int r, int width, int height);
+ void (*clear_block)(int16_t *block /* align 16 */);
+ void (*clear_blocks)(int16_t *blocks /* align 16 */);
+ int (*pix_sum)(uint8_t *pix, int line_size);
+ int (*pix_norm1)(uint8_t *pix, int line_size);
me_cmp_func sad[6]; /* identical to pix_absAxA except additional void * */
me_cmp_func sse[6];
@@ -164,25 +174,12 @@ typedef struct DSPContext {
me_cmp_func me_cmp[6];
me_cmp_func me_sub_cmp[6];
me_cmp_func mb_cmp[6];
- me_cmp_func ildct_cmp[6]; //only width 16 used
- me_cmp_func frame_skip_cmp[6]; //only width 8 used
+ me_cmp_func ildct_cmp[6]; // only width 16 used
+ me_cmp_func frame_skip_cmp[6]; // only width 8 used
int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2,
int size);
- /**
- * Thirdpel motion compensation with rounding (a+b+1)>>1.
- * this is an array[12] of motion compensation functions for the 9 thirdpe
- * positions<br>
- * *pixels_tab[ xthirdpel + 4*ythirdpel ]
- * @param block destination where the result is stored
- * @param pixels source
- * @param line_size number of bytes in a horizontal line of block
- * @param h height
- */
- tpel_mc_func put_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
- tpel_mc_func avg_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
-
qpel_mc_func put_qpel_pixels_tab[2][16];
qpel_mc_func avg_qpel_pixels_tab[2][16];
qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16];
@@ -190,55 +187,73 @@ typedef struct DSPContext {
me_cmp_func pix_abs[2][4];
- /* huffyuv specific */
- void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w);
- void (*diff_bytes)(uint8_t *dst/*align 16*/, const uint8_t *src1/*align 16*/, const uint8_t *src2/*align 1*/,int w);
+ /* HuffYUV specific */
+ void (*add_bytes)(uint8_t *dst /* align 16 */,
+ uint8_t *src /* align 16 */,
+ int w);
+ void (*diff_bytes)(uint8_t *dst /* align 16 */,
+ const uint8_t *src1 /* align 16 */,
+ const uint8_t *src2 /* align 1 */,
+ int w);
/**
- * subtract huffyuv's variant of median prediction
- * note, this might read from src1[-1], src2[-1]
+ * Subtract HuffYUV's variant of median prediction.
+ * Note, this might read from src1[-1], src2[-1].
*/
- 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, int *alpha);
+ 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, int *alpha);
/* this might write to dst[w] */
void (*bswap_buf)(uint32_t *dst, const uint32_t *src, int w);
void (*bswap16_buf)(uint16_t *dst, const uint16_t *src, int len);
/* assume len is a multiple of 8, and arrays are 16-byte aligned */
- void (*vector_clipf)(float *dst /* align 16 */, const float *src /* align 16 */, float min, float max, int len /* align 16 */);
+ void (*vector_clipf)(float *dst /* align 16 */,
+ const float *src /* align 16 */,
+ float min, float max, int len /* align 16 */);
/* (I)DCT */
- void (*fdct)(int16_t *block/* align 16*/);
- void (*fdct248)(int16_t *block/* align 16*/);
+ void (*fdct)(int16_t *block /* align 16 */);
+ void (*fdct248)(int16_t *block /* align 16 */);
- /* IDCT really*/
- void (*idct)(int16_t *block/* align 16*/);
+ /* IDCT really */
+ void (*idct)(int16_t *block /* align 16 */);
/**
* block -> idct -> clip to unsigned 8 bit -> dest.
* (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
* @param line_size size in bytes of a horizontal line of dest
*/
- void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/);
+ void (*idct_put)(uint8_t *dest /* align 8 */,
+ int line_size, int16_t *block /* align 16 */);
/**
* block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
* @param line_size size in bytes of a horizontal line of dest
*/
- void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/);
+ void (*idct_add)(uint8_t *dest /* align 8 */,
+ int line_size, int16_t *block /* align 16 */);
/**
- * idct input permutation.
- * several optimized IDCTs need a permutated input (relative to the normal order of the reference
- * IDCT)
- * this permutation must be performed before the idct_put/add, note, normally this can be merged
- * with the zigzag/alternate scan<br>
- * an example to avoid confusion:
- * - (->decode coeffs -> zigzag reorder -> dequant -> reference idct ->...)
- * - (x -> reference dct -> reference idct -> x)
- * - (x -> reference dct -> simple_mmx_perm = idct_permutation -> simple_idct_mmx -> x)
- * - (->decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant -> simple_idct_mmx ->...)
+ * IDCT input permutation.
+ * Several optimized IDCTs need a permutated input (relative to the
+ * normal order of the reference IDCT).
+ * This permutation must be performed before the idct_put/add.
+ * Note, normally this can be merged with the zigzag/alternate scan<br>
+ * An example to avoid confusion:
+ * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
+ * - (x -> reference DCT -> reference IDCT -> x)
+ * - (x -> reference DCT -> simple_mmx_perm = idct_permutation
+ * -> simple_idct_mmx -> x)
+ * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
+ * -> simple_idct_mmx -> ...)
*/
uint8_t idct_permutation[64];
int idct_permutation_type;
@@ -249,33 +264,41 @@ typedef struct DSPContext {
#define FF_PARTTRANS_IDCT_PERM 5
#define FF_SSE2_IDCT_PERM 6
- int (*try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale);
+ int (*try_8x8basis)(int16_t rem[64], int16_t weight[64],
+ int16_t basis[64], int scale);
void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale);
#define BASIS_SHIFT 16
#define RECON_SHIFT 6
- void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w, int h, int sides);
+ void (*draw_edges)(uint8_t *buf, int wrap, int width, int height,
+ int w, int h, int sides);
#define EDGE_WIDTH 16
#define EDGE_TOP 1
#define EDGE_BOTTOM 2
- void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
+ void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src,
+ int src_wrap, int width, int height);
/**
* Calculate scalar product of two vectors.
* @param len length of vectors, should be multiple of 16
*/
- int32_t (*scalarproduct_int16)(const int16_t *v1, const int16_t *v2/*align 16*/, int len);
+ int32_t (*scalarproduct_int16)(const int16_t *v1,
+ const int16_t *v2 /* align 16 */, int len);
/* 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*/, const int16_t *v2, const int16_t *v3, int len, int mul);
+ int32_t (*scalarproduct_and_madd_int16)(int16_t *v1 /* align 16 */,
+ const int16_t *v2,
+ const int16_t *v3,
+ int len, int mul);
/**
- * Clip each element in an array of int32_t to a given minimum and maximum value.
+ * Clip each element in an array of int32_t to a given minimum and
+ * maximum value.
* @param dst destination array
* constraints: 16-byte aligned
* @param src source array
@@ -294,21 +317,23 @@ typedef struct DSPContext {
} DSPContext;
void ff_dsputil_static_init(void);
-void ff_dsputil_init(DSPContext* p, AVCodecContext *avctx);
+void ff_dsputil_init(DSPContext *p, AVCodecContext *avctx);
void avpriv_dsputil_init(DSPContext* p, AVCodecContext *avctx);
attribute_deprecated void dsputil_init(DSPContext* c, AVCodecContext *avctx);
int ff_check_alignment(void);
-void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type);
+void ff_set_cmp(DSPContext *c, me_cmp_func *cmp, int type);
void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_x86(DSPContext* c, AVCodecContext *avctx);
+void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
+void ff_dsputil_init_bfin(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
+void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
+void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
void ff_dsputil_init_dwt(DSPContext *c);
diff --git a/chromium/third_party/ffmpeg/libavcodec/dsputil_template.c b/chromium/third_party/ffmpeg/libavcodec/dsputil_template.c
index 96be7a6a654..95d966e721a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dsputil_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dsputil_template.c
@@ -27,231 +27,197 @@
* DSP utils
*/
-#include "bit_depth_template.c"
+#define PIXOP2(OPNAME, OP) \
+static inline void OPNAME ## _no_rnd_pixels8_l2_8(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int h) \
+{ \
+ int i; \
+ \
+ for (i = 0; i < h; i++) { \
+ uint32_t a, b; \
+ a = AV_RN32(&src1[i * src_stride1]); \
+ b = AV_RN32(&src2[i * src_stride2]); \
+ OP(*((uint32_t *) &dst[i * dst_stride]), \
+ no_rnd_avg32(a, b)); \
+ a = AV_RN32(&src1[i * src_stride1 + 4]); \
+ b = AV_RN32(&src2[i * src_stride2 + 4]); \
+ OP(*((uint32_t *) &dst[i * dst_stride + 4]), \
+ no_rnd_avg32(a, b)); \
+ } \
+} \
+ \
+static inline void OPNAME ## _no_rnd_pixels16_l2_8(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int h) \
+{ \
+ OPNAME ## _no_rnd_pixels8_l2_8(dst, src1, src2, dst_stride, \
+ src_stride1, src_stride2, h); \
+ OPNAME ## _no_rnd_pixels8_l2_8(dst + 8, \
+ src1 + 8, \
+ src2 + 8, \
+ dst_stride, src_stride1, \
+ src_stride2, h); \
+} \
+ \
+static inline void OPNAME ## _pixels8_l4_8(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ const uint8_t *src3, \
+ const uint8_t *src4, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int src_stride3, \
+ int src_stride4, \
+ int h) \
+{ \
+ /* FIXME HIGH BIT DEPTH */ \
+ int i; \
+ \
+ for (i = 0; i < h; i++) { \
+ uint32_t a, b, c, d, l0, l1, h0, h1; \
+ a = AV_RN32(&src1[i * src_stride1]); \
+ b = AV_RN32(&src2[i * src_stride2]); \
+ c = AV_RN32(&src3[i * src_stride3]); \
+ d = AV_RN32(&src4[i * src_stride4]); \
+ l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x02020202UL; \
+ h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ l1 = (c & 0x03030303UL) + \
+ (d & 0x03030303UL); \
+ h1 = ((c & 0xFCFCFCFCUL) >> 2) + \
+ ((d & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) &dst[i * dst_stride]), \
+ h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ a = AV_RN32(&src1[i * src_stride1 + 4]); \
+ b = AV_RN32(&src2[i * src_stride2 + 4]); \
+ c = AV_RN32(&src3[i * src_stride3 + 4]); \
+ d = AV_RN32(&src4[i * src_stride4 + 4]); \
+ l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x02020202UL; \
+ h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ l1 = (c & 0x03030303UL) + \
+ (d & 0x03030303UL); \
+ h1 = ((c & 0xFCFCFCFCUL) >> 2) + \
+ ((d & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) &dst[i * dst_stride + 4]), \
+ h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ } \
+} \
+ \
+static inline void OPNAME ## _no_rnd_pixels8_l4_8(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ const uint8_t *src3, \
+ const uint8_t *src4, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int src_stride3, \
+ int src_stride4, \
+ int h) \
+{ \
+ /* FIXME HIGH BIT DEPTH */ \
+ int i; \
+ \
+ for (i = 0; i < h; i++) { \
+ uint32_t a, b, c, d, l0, l1, h0, h1; \
+ a = AV_RN32(&src1[i * src_stride1]); \
+ b = AV_RN32(&src2[i * src_stride2]); \
+ c = AV_RN32(&src3[i * src_stride3]); \
+ d = AV_RN32(&src4[i * src_stride4]); \
+ l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x01010101UL; \
+ h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ l1 = (c & 0x03030303UL) + \
+ (d & 0x03030303UL); \
+ h1 = ((c & 0xFCFCFCFCUL) >> 2) + \
+ ((d & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) &dst[i * dst_stride]), \
+ h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ a = AV_RN32(&src1[i * src_stride1 + 4]); \
+ b = AV_RN32(&src2[i * src_stride2 + 4]); \
+ c = AV_RN32(&src3[i * src_stride3 + 4]); \
+ d = AV_RN32(&src4[i * src_stride4 + 4]); \
+ l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x01010101UL; \
+ h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ l1 = (c & 0x03030303UL) + \
+ (d & 0x03030303UL); \
+ h1 = ((c & 0xFCFCFCFCUL) >> 2) + \
+ ((d & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) &dst[i * dst_stride + 4]), \
+ h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ } \
+} \
+ \
+static inline void OPNAME ## _pixels16_l4_8(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ const uint8_t *src3, \
+ const uint8_t *src4, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int src_stride3, \
+ int src_stride4, \
+ int h) \
+{ \
+ OPNAME ## _pixels8_l4_8(dst, src1, src2, src3, src4, dst_stride, \
+ src_stride1, src_stride2, src_stride3, \
+ src_stride4, h); \
+ OPNAME ## _pixels8_l4_8(dst + 8, \
+ src1 + 8, src2 + 8, \
+ src3 + 8, src4 + 8, \
+ dst_stride, src_stride1, src_stride2, \
+ src_stride3, src_stride4, h); \
+} \
+ \
+static inline void OPNAME ## _no_rnd_pixels16_l4_8(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ const uint8_t *src3, \
+ const uint8_t *src4, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int src_stride3, \
+ int src_stride4, \
+ int h) \
+{ \
+ OPNAME ## _no_rnd_pixels8_l4_8(dst, src1, src2, src3, src4, \
+ dst_stride, src_stride1, \
+ src_stride2, src_stride3, \
+ src_stride4, h); \
+ OPNAME ## _no_rnd_pixels8_l4_8(dst + 8, \
+ src1 + 8, src2 + 8, \
+ src3 + 8, src4 + 8, \
+ dst_stride, src_stride1, \
+ src_stride2, src_stride3, \
+ src_stride4, h); \
+} \
-#if BIT_DEPTH == 8
-/* draw the edges of width 'w' of an image of size width, height */
-//FIXME check that this is ok for mpeg4 interlaced
-static void FUNCC(draw_edges)(uint8_t *p_buf, int p_wrap, int width, int height, int w, int h, int sides)
-{
- pixel *buf = (pixel*)p_buf;
- int wrap = p_wrap / sizeof(pixel);
- pixel *ptr, *last_line;
- int i;
-
- /* left and right */
- ptr = buf;
- for(i=0;i<height;i++) {
- memset(ptr - w, ptr[0], w);
- memset(ptr + width, ptr[width-1], w);
- ptr += wrap;
- }
-
- /* top and bottom + corners */
- buf -= w;
- last_line = buf + (height - 1) * wrap;
- if (sides & EDGE_TOP)
- for(i = 0; i < h; i++)
- memcpy(buf - (i + 1) * wrap, buf, (width + w + w) * sizeof(pixel)); // top
- if (sides & EDGE_BOTTOM)
- for (i = 0; i < h; i++)
- memcpy(last_line + (i + 1) * wrap, last_line, (width + w + w) * sizeof(pixel)); // bottom
-}
-#endif
-
-static void FUNCC(get_pixels)(int16_t *av_restrict block,
- const uint8_t *_pixels,
- int line_size)
-{
- const pixel *pixels = (const pixel *) _pixels;
- int i;
-
- /* read the pixels */
- for(i=0;i<8;i++) {
- block[0] = pixels[0];
- block[1] = pixels[1];
- block[2] = pixels[2];
- block[3] = pixels[3];
- block[4] = pixels[4];
- block[5] = pixels[5];
- block[6] = pixels[6];
- block[7] = pixels[7];
- pixels += line_size / sizeof(pixel);
- block += 8;
- }
-}
-
-#if BIT_DEPTH == 8
-static void FUNCC(clear_block)(int16_t *block)
-{
- memset(block, 0, sizeof(int16_t)*64);
-}
-
-static void FUNCC(clear_blocks)(int16_t *blocks)
-{
- memset(blocks, 0, sizeof(int16_t)*6*64);
-}
-#endif
-
-#if BIT_DEPTH == 8
-#include "hpel_template.c"
-#endif
-
-#define PIXOP2(OPNAME, OP) \
-static inline void FUNC(OPNAME ## _no_rnd_pixels8_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- int i;\
- for(i=0; i<h; i++){\
- pixel4 a,b;\
- a= AV_RN4P(&src1[i*src_stride1 ]);\
- b= AV_RN4P(&src2[i*src_stride2 ]);\
- OP(*((pixel4*)&dst[i*dst_stride ]), no_rnd_avg_pixel4(a, b));\
- a= AV_RN4P(&src1[i*src_stride1+4*sizeof(pixel)]);\
- b= AV_RN4P(&src2[i*src_stride2+4*sizeof(pixel)]);\
- OP(*((pixel4*)&dst[i*dst_stride+4*sizeof(pixel)]), no_rnd_avg_pixel4(a, b));\
- }\
-}\
-\
-static inline void FUNC(OPNAME ## _no_rnd_pixels16_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- FUNC(OPNAME ## _no_rnd_pixels8_l2)(dst , src1 , src2 , dst_stride, src_stride1, src_stride2, h);\
- FUNC(OPNAME ## _no_rnd_pixels8_l2)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, h);\
-}\
-\
-static inline void FUNC(OPNAME ## _pixels8_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
- int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
- /* FIXME HIGH BIT DEPTH */\
- int i;\
- for(i=0; i<h; i++){\
- uint32_t a, b, c, d, l0, l1, h0, h1;\
- a= AV_RN32(&src1[i*src_stride1]);\
- b= AV_RN32(&src2[i*src_stride2]);\
- c= AV_RN32(&src3[i*src_stride3]);\
- d= AV_RN32(&src4[i*src_stride4]);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- l1= (c&0x03030303UL)\
- + (d&0x03030303UL);\
- h1= ((c&0xFCFCFCFCUL)>>2)\
- + ((d&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- a= AV_RN32(&src1[i*src_stride1+4]);\
- b= AV_RN32(&src2[i*src_stride2+4]);\
- c= AV_RN32(&src3[i*src_stride3+4]);\
- d= AV_RN32(&src4[i*src_stride4+4]);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- l1= (c&0x03030303UL)\
- + (d&0x03030303UL);\
- h1= ((c&0xFCFCFCFCUL)>>2)\
- + ((d&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- }\
-}\
-\
-static inline void FUNC(OPNAME ## _no_rnd_pixels8_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
- int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
- /* FIXME HIGH BIT DEPTH*/\
- int i;\
- for(i=0; i<h; i++){\
- uint32_t a, b, c, d, l0, l1, h0, h1;\
- a= AV_RN32(&src1[i*src_stride1]);\
- b= AV_RN32(&src2[i*src_stride2]);\
- c= AV_RN32(&src3[i*src_stride3]);\
- d= AV_RN32(&src4[i*src_stride4]);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x01010101UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- l1= (c&0x03030303UL)\
- + (d&0x03030303UL);\
- h1= ((c&0xFCFCFCFCUL)>>2)\
- + ((d&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- a= AV_RN32(&src1[i*src_stride1+4]);\
- b= AV_RN32(&src2[i*src_stride2+4]);\
- c= AV_RN32(&src3[i*src_stride3+4]);\
- d= AV_RN32(&src4[i*src_stride4+4]);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x01010101UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- l1= (c&0x03030303UL)\
- + (d&0x03030303UL);\
- h1= ((c&0xFCFCFCFCUL)>>2)\
- + ((d&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- }\
-}\
-static inline void FUNC(OPNAME ## _pixels16_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
- int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
- FUNC(OPNAME ## _pixels8_l4)(dst , src1 , src2 , src3 , src4 , dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
- FUNC(OPNAME ## _pixels8_l4)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), src3+8*sizeof(pixel), src4+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
-}\
-static inline void FUNC(OPNAME ## _no_rnd_pixels16_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
- int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
- FUNC(OPNAME ## _no_rnd_pixels8_l4)(dst , src1 , src2 , src3 , src4 , dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
- FUNC(OPNAME ## _no_rnd_pixels8_l4)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), src3+8*sizeof(pixel), src4+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\
-{\
- /* FIXME HIGH BIT DEPTH */\
- int j;\
- for(j=0; j<2; j++){\
- int i;\
- const uint32_t a= AV_RN32(pixels );\
- const uint32_t b= AV_RN32(pixels+1);\
- uint32_t l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- uint32_t l1,h1;\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- uint32_t a= AV_RN32(pixels );\
- uint32_t b= AV_RN32(pixels+1);\
- l1= (a&0x03030303UL)\
- + (b&0x03030303UL);\
- h1= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- a= AV_RN32(pixels );\
- b= AV_RN32(pixels+1);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- }\
- pixels+=4-line_size*(h+1);\
- block +=4-line_size*h;\
- }\
-}\
-\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_xy2), FUNCC(OPNAME ## _pixels8_xy2), 8*sizeof(pixel))\
-
-#define op_avg(a, b) a = rnd_avg_pixel4(a, b)
+#define op_avg(a, b) a = rnd_avg32(a, b)
#define op_put(a, b) a = b
-#if BIT_DEPTH == 8
#define put_no_rnd_pixels8_8_c put_pixels8_8_c
PIXOP2(avg, op_avg)
PIXOP2(put, op_put)
-#endif
#undef op_avg
#undef op_put
diff --git a/chromium/third_party/ffmpeg/libavcodec/dsputilenc_template.c b/chromium/third_party/ffmpeg/libavcodec/dsputilenc_template.c
new file mode 100644
index 00000000000..711c404a972
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/dsputilenc_template.c
@@ -0,0 +1,51 @@
+/*
+ * DSP utils
+ * Copyright (c) 2000, 2001 Fabrice Bellard
+ * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * gmc & q-pel & 32/64 bit based MC by 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
+ */
+
+/**
+ * @file
+ * DSP utils
+ */
+
+#include "bit_depth_template.c"
+
+static void FUNCC(get_pixels)(int16_t *av_restrict block, const uint8_t *_pixels,
+ int line_size)
+{
+ const pixel *pixels = (const pixel *) _pixels;
+ int i;
+
+ /* read the pixels */
+ for (i = 0; i < 8; i++) {
+ block[0] = pixels[0];
+ block[1] = pixels[1];
+ block[2] = pixels[2];
+ block[3] = pixels[3];
+ block[4] = pixels[4];
+ block[5] = pixels[5];
+ block[6] = pixels[6];
+ block[7] = pixels[7];
+ pixels += line_size / sizeof(pixel);
+ block += 8;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dv.c b/chromium/third_party/ffmpeg/libavcodec/dv.c
index ea05e9dd887..a9f64b4a8d3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dv.c
@@ -314,11 +314,11 @@ av_cold int ff_dvvideo_init(AVCodecContext *avctx)
s->idct_put[1] = ff_simple_idct248_put; // FIXME: need to add it to DSP
if (avctx->lowres){
for (i = 0; i < 64; i++){
- int j = ff_zigzag248_direct[i];
+ int j = ff_dv_zigzag248_direct[i];
s->dv_zigzag[1][i] = dsp.idct_permutation[(j & 7) + (j & 8) * 4 + (j & 48) / 2];
}
}else
- memcpy(s->dv_zigzag[1], ff_zigzag248_direct, 64);
+ memcpy(s->dv_zigzag[1], ff_dv_zigzag248_direct, 64);
s->avctx = avctx;
avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
diff --git a/chromium/third_party/ffmpeg/libavcodec/dvbsub.c b/chromium/third_party/ffmpeg/libavcodec/dvbsub.c
index f30b7674f77..f6b46e64a93 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dvbsub.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dvbsub.c
@@ -261,8 +261,6 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
if (h->num_rects && h->rects == NULL)
return -1;
- *q++ = 0x00; /* subtitle_stream_id */
-
/* page composition segment */
*q++ = 0x0f; /* sync_byte */
@@ -437,8 +435,6 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
bytestream_put_be16(&pseg_len, q - pseg_len - 2);
- *q++ = 0xff; /* end of PES data */
-
s->object_version = (s->object_version + 1) & 0xf;
return q - outbuf;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dvbsubdec.c b/chromium/third_party/ffmpeg/libavcodec/dvbsubdec.c
index b8b414343d5..9d74b1a0c06 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dvbsubdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dvbsubdec.c
@@ -18,8 +18,8 @@
* 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 "dsputil.h"
#include "get_bits.h"
#include "bytestream.h"
#include "libavutil/colorspace.h"
@@ -31,7 +31,7 @@
#define DVBSUB_DISPLAYDEFINITION_SEGMENT 0x14
#define DVBSUB_DISPLAY_SEGMENT 0x80
-#define cm (ff_cropTbl + MAX_NEG_CROP)
+#define cm (ff_crop_tab + MAX_NEG_CROP)
#ifdef DEBUG
#if 0
@@ -236,7 +236,6 @@ typedef struct DVBSubContext {
DVBSubCLUT *clut_list;
DVBSubObject *object_list;
- int display_list_size;
DVBSubRegionDisplay *display_list;
DVBSubDisplayDefinition *display_definition;
} DVBSubContext;
@@ -368,11 +367,15 @@ static av_cold int dvbsub_init_decoder(AVCodecContext *avctx)
int i, r, g, b, a = 0;
DVBSubContext *ctx = avctx->priv_data;
- if (!avctx->extradata || avctx->extradata_size != 4) {
- av_log(avctx, AV_LOG_WARNING, "Invalid extradata, subtitle streams may be combined!\n");
+ if (!avctx->extradata || (avctx->extradata_size < 4) || ((avctx->extradata_size % 5 != 0) && (avctx->extradata_size != 4))) {
+ av_log(avctx, AV_LOG_WARNING, "Invalid DVB subtitles stream extradata!\n");
ctx->composition_id = -1;
ctx->ancillary_id = -1;
} else {
+ if (avctx->extradata_size > 5) {
+ av_log(avctx, AV_LOG_WARNING, "Decoding first DVB subtitles sub-stream\n");
+ }
+
ctx->composition_id = AV_RB16(avctx->extradata);
ctx->ancillary_id = AV_RB16(avctx->extradata + 2);
}
@@ -1179,7 +1182,6 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
tmp_display_list = ctx->display_list;
ctx->display_list = NULL;
- ctx->display_list_size = 0;
while (buf + 5 < buf_end) {
region_id = *buf++;
@@ -1207,7 +1209,6 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
display->next = ctx->display_list;
ctx->display_list = display;
- ctx->display_list_size++;
av_dlog(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
}
@@ -1357,8 +1358,8 @@ static void dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
if (info_byte & 1<<3) { // display_window_flag
display_def->x = bytestream_get_be16(&buf);
- display_def->y = bytestream_get_be16(&buf);
display_def->width = bytestream_get_be16(&buf) - display_def->x + 1;
+ display_def->y = bytestream_get_be16(&buf);
display_def->height = bytestream_get_be16(&buf) - display_def->y + 1;
}
}
@@ -1384,10 +1385,16 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
offset_y = display_def->y;
}
- sub->num_rects = ctx->display_list_size;
+ sub->num_rects = 0;
+ for (display = ctx->display_list; display; display = display->next)
+ {
+ region = get_region(ctx, display->region_id);
+ if (region && region->dirty)
+ sub->num_rects++;
+ }
if (sub->num_rects > 0){
- sub->rects = av_mallocz(sizeof(*sub->rects) * sub->num_rects);
+ sub->rects = av_mallocz_array(sizeof(*sub->rects), sub->num_rects);
for(i=0; i<sub->num_rects; i++)
sub->rects[i] = av_mallocz(sizeof(*sub->rects[i]));
@@ -1437,8 +1444,6 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
i++;
}
-
- sub->num_rects = i;
}
#ifdef DEBUG
save_display_set(ctx);
diff --git a/chromium/third_party/ffmpeg/libavcodec/dvdata.c b/chromium/third_party/ffmpeg/libavcodec/dvdata.c
index a3be7fd7adf..ace01ffda27 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dvdata.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dvdata.c
@@ -28,6 +28,19 @@
#include "dvdata.h"
+/* Specific zigzag scan for 248 idct. NOTE that unlike the
+ * specification, we interleave the fields */
+const uint8_t ff_dv_zigzag248_direct[64] = {
+ 0, 8, 1, 9, 16, 24, 2, 10,
+ 17, 25, 32, 40, 48, 56, 33, 41,
+ 18, 26, 3, 11, 4, 12, 19, 27,
+ 34, 42, 49, 57, 50, 58, 35, 43,
+ 20, 28, 5, 13, 6, 14, 21, 29,
+ 36, 44, 51, 59, 52, 60, 37, 45,
+ 22, 30, 7, 15, 23, 31, 38, 46,
+ 53, 61, 54, 62, 39, 47, 55, 63,
+};
+
/* unquant tables (not used directly) */
const uint8_t ff_dv_quant_shifts[22][4] = {
{ 3,3,4,4 },
diff --git a/chromium/third_party/ffmpeg/libavcodec/dvdata.h b/chromium/third_party/ffmpeg/libavcodec/dvdata.h
index 8c120df7221..0932d3ad152 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dvdata.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dvdata.h
@@ -21,6 +21,8 @@
#include <stdint.h>
+extern const uint8_t ff_dv_zigzag248_direct[64];
+
extern const uint8_t ff_dv_quant_shifts[22][4];
extern const uint8_t ff_dv_quant_offset[4];
diff --git a/chromium/third_party/ffmpeg/libavcodec/dvdsubdec.c b/chromium/third_party/ffmpeg/libavcodec/dvdsubdec.c
index 31ce0accc69..53287bd1226 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dvdsubdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dvdsubdec.c
@@ -18,9 +18,9 @@
* 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 "get_bits.h"
-#include "dsputil.h"
#include "internal.h"
#include "libavutil/attributes.h"
@@ -46,7 +46,7 @@ typedef struct DVDSubContext
static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *rgba, int num_values)
{
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
uint8_t r, g, b;
int i, y, cb, cr;
int r_add, g_add, b_add;
@@ -599,8 +599,10 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx)
int w, h;
if (sscanf(data + 5, "%dx%d", &w, &h) == 2) {
int ret = ff_set_dimensions(avctx, w, h);
- if (ret < 0)
+ if (ret < 0) {
+ av_free(dataorig);
return ret;
+ }
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dvdsubenc.c b/chromium/third_party/ffmpeg/libavcodec/dvdsubenc.c
index 8130b74a7ae..11858c7f976 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dvdsubenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dvdsubenc.c
@@ -383,7 +383,7 @@ static int encode_dvd_subtitles(AVCodecContext *avctx,
qq = outbuf;
bytestream_put_be16(&qq, q - outbuf);
- av_log(NULL, AV_LOG_DEBUG, "subtitle_packet size=%td\n", q - outbuf);
+ av_log(NULL, AV_LOG_DEBUG, "subtitle_packet size=%"PTRDIFF_SPECIFIER"\n", q - outbuf);
ret = q - outbuf;
fail:
diff --git a/chromium/third_party/ffmpeg/libavcodec/dvenc.c b/chromium/third_party/ffmpeg/libavcodec/dvenc.c
index 6e887dc840e..052b631863a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dvenc.c
@@ -33,7 +33,7 @@
#include "dv.h"
#include "dv_tablegen.h"
-static av_cold int dvvideo_init_encoder(AVCodecContext *avctx)
+static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
{
if (!avpriv_dv_codec_profile(avctx)) {
av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video. "
@@ -249,7 +249,7 @@ static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, i
}
bi->mb[0] = blk[0];
- zigzag_scan = bi->dct_mode ? ff_zigzag248_direct : ff_zigzag_direct;
+ zigzag_scan = bi->dct_mode ? ff_dv_zigzag248_direct : ff_zigzag_direct;
weight = bi->dct_mode ? dv_weight_248 : dv_weight_88;
for (area = 0; area < 4; area++) {
@@ -702,7 +702,7 @@ AVCodec ff_dvvideo_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_DVVIDEO,
.priv_data_size = sizeof(DVVideoContext),
- .init = dvvideo_init_encoder,
+ .init = dvvideo_encode_init,
.encode2 = dvvideo_encode_frame,
.close = dvvideo_encode_close,
.capabilities = CODEC_CAP_SLICE_THREADS,
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxa.c b/chromium/third_party/ffmpeg/libavcodec/dxa.c
index 1d96f10ef47..0f64b5e6194 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxa.c
@@ -42,6 +42,7 @@ typedef struct DxaDecContext {
AVFrame *prev;
int dsize;
+#define DECOMP_BUF_PADDING 16
uint8_t *decomp_buf;
uint32_t pal[256];
} DxaDecContext;
@@ -50,13 +51,17 @@ static const int shift1[6] = { 0, 8, 8, 8, 4, 4 };
static const int shift2[6] = { 0, 0, 8, 4, 0, 4 };
static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst,
- int stride, uint8_t *src, uint8_t *ref)
+ int stride, uint8_t *src, int srcsize, uint8_t *ref)
{
uint8_t *code, *data, *mv, *msk, *tmp, *tmp2;
+ uint8_t *src_end = src + srcsize;
int i, j, k;
int type, x, y, d, d2;
uint32_t mask;
+ if (12ULL + ((avctx->width * avctx->height) >> 4) + AV_RB32(src + 0) + AV_RB32(src + 4) > srcsize)
+ return AVERROR_INVALIDDATA;
+
code = src + 12;
data = code + ((avctx->width * avctx->height) >> 4);
mv = data + AV_RB32(src + 0);
@@ -64,6 +69,8 @@ static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst,
for(j = 0; j < avctx->height; j += 4){
for(i = 0; i < avctx->width; i += 4){
+ if (data > src_end || mv > src_end || msk > src_end)
+ return AVERROR_INVALIDDATA;
tmp = dst + i;
tmp2 = ref + i;
type = *code++;
@@ -245,6 +252,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
av_log(avctx, AV_LOG_ERROR, "Uncompress failed!\n");
return AVERROR_UNKNOWN;
}
+ memset(c->decomp_buf + dsize, 0, DECOMP_BUF_PADDING);
}
if (avctx->debug & FF_DEBUG_PICT_INFO)
@@ -300,7 +308,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
av_log(avctx, AV_LOG_ERROR, "Missing reference frame\n");
return AVERROR_INVALIDDATA;
}
- decode_13(avctx, c, frame->data[0], frame->linesize[0], srcptr, c->prev->data[0]);
+ decode_13(avctx, c, frame->data[0], frame->linesize[0], srcptr, dsize, c->prev->data[0]);
break;
default:
av_log(avctx, AV_LOG_ERROR, "Unknown/unsupported compression type %d\n", compr);
@@ -328,7 +336,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_PAL8;
c->dsize = avctx->width * avctx->height * 2;
- c->decomp_buf = av_malloc(c->dsize);
+ c->decomp_buf = av_malloc(c->dsize + DECOMP_BUF_PADDING);
if (!c->decomp_buf) {
av_frame_free(&c->prev);
av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxtory.c b/chromium/third_party/ffmpeg/libavcodec/dxtory.c
index 21282b804b5..1a59ae7a048 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxtory.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxtory.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "bytestream.h"
@@ -29,14 +31,84 @@
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
-static int dxtory_decode_v1(AVCodecContext *avctx, AVFrame *pic,
- const uint8_t *src, int src_size)
+static int dxtory_decode_v1_rgb(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size,
+ int id, int bpp)
+{
+ int h;
+ uint8_t *dst;
+ int ret;
+
+ if (src_size < avctx->width * avctx->height * (int64_t)bpp) {
+ av_log(avctx, AV_LOG_ERROR, "packet too small\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ avctx->pix_fmt = id;
+ if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
+ return ret;
+
+ dst = pic->data[0];
+ for (h = 0; h < avctx->height; h++) {
+ memcpy(dst, src, avctx->width * bpp);
+ src += avctx->width * bpp;
+ dst += pic->linesize[0];
+ }
+
+ return 0;
+}
+
+static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size)
+{
+ int h, w;
+ uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
+ int ret;
+
+ if (src_size < avctx->width * avctx->height * 9L / 8) {
+ av_log(avctx, AV_LOG_ERROR, "packet too small\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ avctx->pix_fmt = AV_PIX_FMT_YUV410P;
+ if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
+ return ret;
+
+ Y1 = pic->data[0];
+ Y2 = pic->data[0] + pic->linesize[0];
+ Y3 = pic->data[0] + pic->linesize[0] * 2;
+ Y4 = pic->data[0] + pic->linesize[0] * 3;
+ U = pic->data[1];
+ V = pic->data[2];
+ for (h = 0; h < avctx->height; h += 4) {
+ for (w = 0; w < avctx->width; w += 4) {
+ AV_COPY32(Y1 + w, src);
+ AV_COPY32(Y2 + w, src + 4);
+ AV_COPY32(Y3 + w, src + 8);
+ AV_COPY32(Y4 + w, src + 12);
+ U[w >> 2] = src[16] + 0x80;
+ V[w >> 2] = src[17] + 0x80;
+ src += 18;
+ }
+ Y1 += pic->linesize[0] << 2;
+ Y2 += pic->linesize[0] << 2;
+ Y3 += pic->linesize[0] << 2;
+ Y4 += pic->linesize[0] << 2;
+ U += pic->linesize[1];
+ V += pic->linesize[2];
+ }
+
+ return 0;
+}
+
+static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size)
{
int h, w;
uint8_t *Y1, *Y2, *U, *V;
int ret;
- if (src_size < avctx->width * avctx->height * 3 / 2) {
+ if (src_size < avctx->width * avctx->height * 3L / 2) {
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
return AVERROR_INVALIDDATA;
}
@@ -66,7 +138,42 @@ static int dxtory_decode_v1(AVCodecContext *avctx, AVFrame *pic,
return 0;
}
+static int dxtory_decode_v1_444(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size)
+{
+ int h, w;
+ uint8_t *Y, *U, *V;
+ int ret;
+
+ if (src_size < avctx->width * avctx->height * 3L) {
+ av_log(avctx, AV_LOG_ERROR, "packet too small\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P;
+ if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
+ return ret;
+
+ Y = pic->data[0];
+ U = pic->data[1];
+ V = pic->data[2];
+ for (h = 0; h < avctx->height; h++) {
+ for (w = 0; w < avctx->width; w++) {
+ Y[w] = *src++;
+ U[w] = *src++ ^ 0x80;
+ V[w] = *src++ ^ 0x80;
+ }
+ Y += pic->linesize[0];
+ U += pic->linesize[1];
+ V += pic->linesize[2];
+ }
+
+ return 0;
+}
+
static const uint8_t def_lru[8] = { 0x00, 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xFF };
+static const uint8_t def_lru_555[8] = { 0x00, 0x08, 0x10, 0x18, 0x1F };
+static const uint8_t def_lru_565[8] = { 0x00, 0x08, 0x10, 0x20, 0x30, 0x3F };
static inline uint8_t decode_sym(GetBitContext *gb, uint8_t lru[8])
{
@@ -85,9 +192,298 @@ static inline uint8_t decode_sym(GetBitContext *gb, uint8_t lru[8])
return val;
}
-static int dx2_decode_slice(GetBitContext *gb, int width, int height,
- uint8_t *Y, uint8_t *U, uint8_t *V,
- int ystride, int ustride, int vstride)
+static inline uint8_t decode_sym_565(GetBitContext *gb, uint8_t lru[8],
+ int bits)
+{
+ uint8_t c, val;
+
+ c = get_unary(gb, 0, bits);
+ if (!c) {
+ val = get_bits(gb, bits);
+ memmove(lru + 1, lru, sizeof(*lru) * (6 - 1));
+ } else {
+ val = lru[c - 1];
+ memmove(lru + 1, lru, sizeof(*lru) * (c - 1));
+ }
+ lru[0] = val;
+
+ return val;
+}
+
+static int dx2_decode_slice_565(GetBitContext *gb, int width, int height,
+ uint8_t *dst, int stride, int is_565)
+{
+ int x, y;
+ int r, g, b;
+ uint8_t lru[3][8];
+
+ memcpy(lru[0], def_lru_555, 8 * sizeof(*def_lru));
+ memcpy(lru[1], is_565 ? def_lru_565 : def_lru_555, 8 * sizeof(*def_lru));
+ memcpy(lru[2], def_lru_555, 8 * sizeof(*def_lru));
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ b = decode_sym_565(gb, lru[0], 5);
+ g = decode_sym_565(gb, lru[1], is_565 ? 6 : 5);
+ r = decode_sym_565(gb, lru[2], 5);
+ dst[x * 3 + 0] = (r << 3) | (r >> 2);
+ dst[x * 3 + 1] = is_565 ? (g << 2) | (g >> 4) : (g << 3) | (g >> 2);
+ dst[x * 3 + 2] = (b << 3) | (b >> 2);
+ }
+
+ dst += stride;
+ }
+
+ return 0;
+}
+
+static int dxtory_decode_v2_565(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size, int is_565)
+{
+ GetByteContext gb;
+ GetBitContext gb2;
+ int nslices, slice, slice_height;
+ uint32_t off, slice_size;
+ uint8_t *dst;
+ int ret;
+
+ bytestream2_init(&gb, src, src_size);
+ nslices = bytestream2_get_le16(&gb);
+ off = FFALIGN(nslices * 4 + 2, 16);
+ if (src_size < off) {
+ av_log(avctx, AV_LOG_ERROR, "no slice data\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (!nslices || avctx->height % nslices) {
+ avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
+ avctx->width, avctx->height);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ slice_height = avctx->height / nslices;
+ avctx->pix_fmt = AV_PIX_FMT_RGB24;
+ if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
+ return ret;
+
+ dst = pic->data[0];
+ for (slice = 0; slice < nslices; slice++) {
+ slice_size = bytestream2_get_le32(&gb);
+ if (slice_size > src_size - off) {
+ av_log(avctx, AV_LOG_ERROR,
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
+ slice_size, src_size - off);
+ return AVERROR_INVALIDDATA;
+ }
+ if (slice_size <= 16) {
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (AV_RL32(src + off) != slice_size - 16) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
+ AV_RL32(src + off), slice_size - 16);
+ }
+ init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
+ dx2_decode_slice_565(&gb2, avctx->width, slice_height, dst,
+ pic->linesize[0], is_565);
+
+ dst += pic->linesize[0] * slice_height;
+ off += slice_size;
+ }
+
+ return 0;
+}
+
+static int dx2_decode_slice_rgb(GetBitContext *gb, int width, int height,
+ uint8_t *dst, int stride)
+{
+ int x, y, i;
+ uint8_t lru[3][8];
+
+ for (i = 0; i < 3; i++)
+ memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ dst[x * 3 + 0] = decode_sym(gb, lru[0]);
+ dst[x * 3 + 1] = decode_sym(gb, lru[1]);
+ dst[x * 3 + 2] = decode_sym(gb, lru[2]);
+ }
+
+ dst += stride;
+ }
+
+ return 0;
+}
+
+static int dxtory_decode_v2_rgb(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size)
+{
+ GetByteContext gb;
+ GetBitContext gb2;
+ int nslices, slice, slice_height;
+ uint32_t off, slice_size;
+ uint8_t *dst;
+ int ret;
+
+ bytestream2_init(&gb, src, src_size);
+ nslices = bytestream2_get_le16(&gb);
+ off = FFALIGN(nslices * 4 + 2, 16);
+ if (src_size < off) {
+ av_log(avctx, AV_LOG_ERROR, "no slice data\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (!nslices || avctx->height % nslices) {
+ avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
+ avctx->width, avctx->height);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ slice_height = avctx->height / nslices;
+ avctx->pix_fmt = AV_PIX_FMT_BGR24;
+ if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
+ return ret;
+
+ dst = pic->data[0];
+ for (slice = 0; slice < nslices; slice++) {
+ slice_size = bytestream2_get_le32(&gb);
+ if (slice_size > src_size - off) {
+ av_log(avctx, AV_LOG_ERROR,
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
+ slice_size, src_size - off);
+ return AVERROR_INVALIDDATA;
+ }
+ if (slice_size <= 16) {
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n",
+ slice_size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (AV_RL32(src + off) != slice_size - 16) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
+ AV_RL32(src + off), slice_size - 16);
+ }
+ init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
+ dx2_decode_slice_rgb(&gb2, avctx->width, slice_height, dst,
+ pic->linesize[0]);
+
+ dst += pic->linesize[0] * slice_height;
+ off += slice_size;
+ }
+
+ return 0;
+}
+
+static int dx2_decode_slice_410(GetBitContext *gb, int width, int height,
+ uint8_t *Y, uint8_t *U, uint8_t *V,
+ int ystride, int ustride, int vstride)
+{
+ int x, y, i, j;
+ uint8_t lru[3][8];
+
+ for (i = 0; i < 3; i++)
+ memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
+
+ for (y = 0; y < height; y += 4) {
+ for (x = 0; x < width; x += 4) {
+ for (j = 0; j < 4; j++)
+ for (i = 0; i < 4; i++)
+ Y[x + i + j * ystride] = decode_sym(gb, lru[0]);
+ U[x >> 2] = decode_sym(gb, lru[1]) ^ 0x80;
+ V[x >> 2] = decode_sym(gb, lru[2]) ^ 0x80;
+ }
+
+ Y += ystride << 2;
+ U += ustride;
+ V += vstride;
+ }
+
+ return 0;
+}
+
+static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size)
+{
+ GetByteContext gb;
+ GetBitContext gb2;
+ int nslices, slice, slice_height, ref_slice_height;
+ int cur_y, next_y;
+ uint32_t off, slice_size;
+ uint8_t *Y, *U, *V;
+ int ret;
+
+ bytestream2_init(&gb, src, src_size);
+ nslices = bytestream2_get_le16(&gb);
+ off = FFALIGN(nslices * 4 + 2, 16);
+ if (src_size < off) {
+ av_log(avctx, AV_LOG_ERROR, "no slice data\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (!nslices || avctx->height % nslices) {
+ avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
+ avctx->width, avctx->height);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ ref_slice_height = avctx->height / nslices;
+ if ((avctx->width & 3) || (avctx->height & 3)) {
+ avpriv_request_sample(avctx, "Frame dimensions %dx%d",
+ avctx->width, avctx->height);
+ }
+
+ avctx->pix_fmt = AV_PIX_FMT_YUV410P;
+ if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
+ return ret;
+
+ Y = pic->data[0];
+ U = pic->data[1];
+ V = pic->data[2];
+
+ cur_y = 0;
+ next_y = ref_slice_height;
+ for (slice = 0; slice < nslices; slice++) {
+ slice_size = bytestream2_get_le32(&gb);
+ slice_height = (next_y & ~3) - (cur_y & ~3);
+ if (slice_size > src_size - off) {
+ av_log(avctx, AV_LOG_ERROR,
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
+ slice_size, src_size - off);
+ return AVERROR_INVALIDDATA;
+ }
+ if (slice_size <= 16) {
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (AV_RL32(src + off) != slice_size - 16) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
+ AV_RL32(src + off), slice_size - 16);
+ }
+ init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
+ dx2_decode_slice_410(&gb2, avctx->width, slice_height, Y, U, V,
+ pic->linesize[0], pic->linesize[1],
+ pic->linesize[2]);
+
+ Y += pic->linesize[0] * slice_height;
+ U += pic->linesize[1] * (slice_height >> 2);
+ V += pic->linesize[2] * (slice_height >> 2);
+ off += slice_size;
+ cur_y = next_y;
+ next_y += ref_slice_height;
+ }
+
+ return 0;
+}
+
+static int dx2_decode_slice_420(GetBitContext *gb, int width, int height,
+ uint8_t *Y, uint8_t *U, uint8_t *V,
+ int ystride, int ustride, int vstride)
{
int x, y, i;
uint8_t lru[3][8];
@@ -113,12 +509,13 @@ static int dx2_decode_slice(GetBitContext *gb, int width, int height,
return 0;
}
-static int dxtory_decode_v2(AVCodecContext *avctx, AVFrame *pic,
- const uint8_t *src, int src_size)
+static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size)
{
GetByteContext gb;
GetBitContext gb2;
- int nslices, slice, slice_height;
+ int nslices, slice, slice_height, ref_slice_height;
+ int cur_y, next_y;
uint32_t off, slice_size;
uint8_t *Y, *U, *V;
int ret;
@@ -134,13 +531,13 @@ static int dxtory_decode_v2(AVCodecContext *avctx, AVFrame *pic,
if (!nslices || avctx->height % nslices) {
avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
avctx->width, avctx->height);
- return AVERROR(ENOSYS);
+ return AVERROR_PATCHWELCOME;
}
- slice_height = avctx->height / nslices;
- if ((avctx->width & 1) || (slice_height & 1)) {
- avpriv_request_sample(avctx, "slice dimensions %dx%d",
- avctx->width, slice_height);
+ ref_slice_height = avctx->height / nslices;
+ if ((avctx->width & 1) || (avctx->height & 1)) {
+ avpriv_request_sample(avctx, "Frame dimensions %dx%d",
+ avctx->width, avctx->height);
}
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
@@ -151,32 +548,129 @@ static int dxtory_decode_v2(AVCodecContext *avctx, AVFrame *pic,
U = pic->data[1];
V = pic->data[2];
+ cur_y = 0;
+ next_y = ref_slice_height;
for (slice = 0; slice < nslices; slice++) {
- slice_size = bytestream2_get_le32(&gb);
+ slice_size = bytestream2_get_le32(&gb);
+ slice_height = (next_y & ~1) - (cur_y & ~1);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
- dx2_decode_slice(&gb2, avctx->width, slice_height, Y, U, V,
- pic->linesize[0], pic->linesize[1], pic->linesize[2]);
+ dx2_decode_slice_420(&gb2, avctx->width, slice_height, Y, U, V,
+ pic->linesize[0], pic->linesize[1],
+ pic->linesize[2]);
Y += pic->linesize[0] * slice_height;
U += pic->linesize[1] * (slice_height >> 1);
V += pic->linesize[2] * (slice_height >> 1);
off += slice_size;
+ cur_y = next_y;
+ next_y += ref_slice_height;
+ }
+
+ return 0;
+}
+
+static int dx2_decode_slice_444(GetBitContext *gb, int width, int height,
+ uint8_t *Y, uint8_t *U, uint8_t *V,
+ int ystride, int ustride, int vstride)
+{
+ int x, y, i;
+ uint8_t lru[3][8];
+
+ for (i = 0; i < 3; i++)
+ memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ Y[x] = decode_sym(gb, lru[0]);
+ U[x] = decode_sym(gb, lru[1]) ^ 0x80;
+ V[x] = decode_sym(gb, lru[2]) ^ 0x80;
+ }
+
+ Y += ystride;
+ U += ustride;
+ V += vstride;
+ }
+
+ return 0;
+}
+
+static int dxtory_decode_v2_444(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size)
+{
+ GetByteContext gb;
+ GetBitContext gb2;
+ int nslices, slice, slice_height;
+ uint32_t off, slice_size;
+ uint8_t *Y, *U, *V;
+ int ret;
+
+ bytestream2_init(&gb, src, src_size);
+ nslices = bytestream2_get_le16(&gb);
+ off = FFALIGN(nslices * 4 + 2, 16);
+ if (src_size < off) {
+ av_log(avctx, AV_LOG_ERROR, "no slice data\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (!nslices || avctx->height % nslices) {
+ avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
+ avctx->width, avctx->height);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ slice_height = avctx->height / nslices;
+
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P;
+ if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
+ return ret;
+
+ Y = pic->data[0];
+ U = pic->data[1];
+ V = pic->data[2];
+
+ for (slice = 0; slice < nslices; slice++) {
+ slice_size = bytestream2_get_le32(&gb);
+ if (slice_size > src_size - off) {
+ av_log(avctx, AV_LOG_ERROR,
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
+ slice_size, src_size - off);
+ return AVERROR_INVALIDDATA;
+ }
+ if (slice_size <= 16) {
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (AV_RL32(src + off) != slice_size - 16) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
+ AV_RL32(src + off), slice_size - 16);
+ }
+ init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
+ dx2_decode_slice_444(&gb2, avctx->width, slice_height, Y, U, V,
+ pic->linesize[0], pic->linesize[1],
+ pic->linesize[2]);
+
+ Y += pic->linesize[0] * slice_height;
+ U += pic->linesize[1] * slice_height;
+ V += pic->linesize[2] * slice_height;
+ off += slice_size;
}
return 0;
@@ -195,14 +689,49 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
switch (AV_RB32(src)) {
+ case 0x01000001:
+ ret = dxtory_decode_v1_rgb(avctx, pic, src + 16, avpkt->size - 16,
+ AV_PIX_FMT_BGR24, 3);
+ break;
+ case 0x01000009:
+ ret = dxtory_decode_v2_rgb(avctx, pic, src + 16, avpkt->size - 16);
+ break;
case 0x02000001:
- ret = dxtory_decode_v1(avctx, pic, src + 16, avpkt->size - 16);
+ ret = dxtory_decode_v1_420(avctx, pic, src + 16, avpkt->size - 16);
break;
case 0x02000009:
- ret = dxtory_decode_v2(avctx, pic, src + 16, avpkt->size - 16);
+ ret = dxtory_decode_v2_420(avctx, pic, src + 16, avpkt->size - 16);
+ break;
+ case 0x03000001:
+ ret = dxtory_decode_v1_410(avctx, pic, src + 16, avpkt->size - 16);
+ break;
+ case 0x03000009:
+ ret = dxtory_decode_v2_410(avctx, pic, src + 16, avpkt->size - 16);
+ break;
+ case 0x04000001:
+ ret = dxtory_decode_v1_444(avctx, pic, src + 16, avpkt->size - 16);
+ break;
+ case 0x04000009:
+ ret = dxtory_decode_v2_444(avctx, pic, src + 16, avpkt->size - 16);
+ break;
+ case 0x17000001:
+ ret = dxtory_decode_v1_rgb(avctx, pic, src + 16, avpkt->size - 16,
+ AV_PIX_FMT_RGB565LE, 2);
+ break;
+ case 0x17000009:
+ ret = dxtory_decode_v2_565(avctx, pic, src + 16, avpkt->size - 16, 1);
+ break;
+ case 0x18000001:
+ case 0x19000001:
+ ret = dxtory_decode_v1_rgb(avctx, pic, src + 16, avpkt->size - 16,
+ AV_PIX_FMT_RGB555LE, 2);
+ break;
+ case 0x18000009:
+ case 0x19000009:
+ ret = dxtory_decode_v2_565(avctx, pic, src + 16, avpkt->size - 16, 0);
break;
default:
- avpriv_request_sample(avctx, "Frame header %X", AV_RB32(src));
+ avpriv_request_sample(avctx, "Frame header %"PRIX32, AV_RB32(src));
return AVERROR_PATCHWELCOME;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxva2.c b/chromium/third_party/ffmpeg/libavcodec/dxva2.c
index 0997c736778..c1c7681402a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxva2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxva2.c
@@ -20,17 +20,25 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <assert.h>
+#include <string.h>
+
+#include "libavutil/log.h"
+#include "libavutil/time.h"
+
+#include "avcodec.h"
+#include "mpegvideo.h"
#include "dxva2_internal.h"
-void *ff_dxva2_get_surface(const Picture *picture)
+void *ff_dxva2_get_surface(const AVFrame *frame)
{
- return picture->f.data[3];
+ return frame->data[3];
}
unsigned ff_dxva2_get_surface_index(const struct dxva_context *ctx,
- const Picture *picture)
+ const AVFrame *frame)
{
- void *surface = ff_dxva2_get_surface(picture);
+ void *surface = ff_dxva2_get_surface(frame);
unsigned i;
for (i = 0; i < ctx->surface_count; i++)
@@ -50,10 +58,13 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
void *dxva_data;
unsigned dxva_size;
int result;
+ HRESULT hr;
- if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->decoder, type,
- &dxva_data, &dxva_size))) {
- av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %d\n", type);
+ hr = IDirectXVideoDecoder_GetBuffer(ctx->decoder, type,
+ &dxva_data, &dxva_size);
+ if (FAILED(hr)) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %u: 0x%lx\n",
+ type, hr);
return -1;
}
if (size <= dxva_size) {
@@ -66,17 +77,21 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
result = 0;
} else {
- av_log(avctx, AV_LOG_ERROR, "Buffer for type %d was too small\n", type);
+ av_log(avctx, AV_LOG_ERROR, "Buffer for type %u was too small\n", type);
result = -1;
}
- if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder, type))) {
- av_log(avctx, AV_LOG_ERROR, "Failed to release buffer type %d\n", type);
+
+ hr = IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder, type);
+ if (FAILED(hr)) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Failed to release buffer type %u: 0x%lx\n",
+ type, hr);
result = -1;
}
return result;
}
-int ff_dxva2_common_end_frame(AVCodecContext *avctx, Picture *pic,
+int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
const void *pp, unsigned pp_size,
const void *qm, unsigned qm_size,
int (*commit_bs_si)(AVCodecContext *,
@@ -87,12 +102,19 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, Picture *pic,
unsigned buffer_count = 0;
DXVA2_DecodeBufferDesc buffer[4];
DXVA2_DecodeExecuteParams exec = { 0 };
- int result;
-
- if (FAILED(IDirectXVideoDecoder_BeginFrame(ctx->decoder,
- ff_dxva2_get_surface(pic),
- NULL))) {
- av_log(avctx, AV_LOG_ERROR, "Failed to begin frame\n");
+ int result, runs = 0;
+ HRESULT hr;
+
+ do {
+ hr = IDirectXVideoDecoder_BeginFrame(ctx->decoder,
+ ff_dxva2_get_surface(frame),
+ NULL);
+ if (hr == E_PENDING)
+ av_usleep(2000);
+ } while (hr == E_PENDING && ++runs < 50);
+
+ if (FAILED(hr)) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to begin frame: 0x%lx\n", hr);
return -1;
}
@@ -135,14 +157,16 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, Picture *pic,
exec.NumCompBuffers = buffer_count;
exec.pCompressedBuffers = buffer;
exec.pExtensionData = NULL;
- if (FAILED(IDirectXVideoDecoder_Execute(ctx->decoder, &exec))) {
- av_log(avctx, AV_LOG_ERROR, "Failed to execute\n");
+ hr = IDirectXVideoDecoder_Execute(ctx->decoder, &exec);
+ if (FAILED(hr)) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to execute: 0x%lx\n", hr);
result = -1;
}
end:
- if (FAILED(IDirectXVideoDecoder_EndFrame(ctx->decoder, NULL))) {
- av_log(avctx, AV_LOG_ERROR, "Failed to end frame\n");
+ hr = IDirectXVideoDecoder_EndFrame(ctx->decoder, NULL);
+ if (FAILED(hr)) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to end frame: 0x%lx\n", hr);
result = -1;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxva2.h b/chromium/third_party/ffmpeg/libavcodec/dxva2.h
index ac39e06917b..2639d89d909 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxva2.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dxva2.h
@@ -49,6 +49,7 @@
*/
#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
+#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface
/**
* This structure is used to provides the necessary configurations and data
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxva2_h264.c b/chromium/third_party/ffmpeg/libavcodec/dxva2_h264.c
index 10905026be6..1174188959c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxva2_h264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxva2_h264.c
@@ -23,6 +23,7 @@
#include "dxva2_internal.h"
#include "h264.h"
#include "h264data.h"
+#include "mpegutils.h"
struct dxva2_picture_context {
DXVA_PicParams_H264 pp;
@@ -44,19 +45,19 @@ static void fill_picture_entry(DXVA_PicEntry_H264 *pic,
static void fill_picture_parameters(struct dxva_context *ctx, const H264Context *h,
DXVA_PicParams_H264 *pp)
{
- const Picture *current_picture = h->cur_pic_ptr;
+ const H264Picture *current_picture = h->cur_pic_ptr;
int i, j;
memset(pp, 0, sizeof(*pp));
/* Configure current picture */
fill_picture_entry(&pp->CurrPic,
- ff_dxva2_get_surface_index(ctx, current_picture),
+ ff_dxva2_get_surface_index(ctx, &current_picture->f),
h->picture_structure == PICT_BOTTOM_FIELD);
/* Configure the set of references */
pp->UsedForReferenceFlags = 0;
pp->NonExistingFrameFlags = 0;
for (i = 0, j = 0; i < FF_ARRAY_ELEMS(pp->RefFrameList); i++) {
- const Picture *r;
+ const H264Picture *r;
if (j < h->short_ref_count) {
r = h->short_ref[j++];
} else {
@@ -66,7 +67,7 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context
}
if (r) {
fill_picture_entry(&pp->RefFrameList[i],
- ff_dxva2_get_surface_index(ctx, r),
+ ff_dxva2_get_surface_index(ctx, &r->f),
r->long_ref != 0);
if ((r->reference & PICT_TOP_FIELD) && r->field_poc[0] != INT_MAX)
@@ -115,6 +116,8 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context
pp->bit_depth_chroma_minus8 = h->sps.bit_depth_chroma - 8;
if (ctx->workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG)
pp->Reserved16Bits = 0;
+ else if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
+ pp->Reserved16Bits = 0x34c;
else
pp->Reserved16Bits = 3; /* FIXME is there a way to detect the right mode ? */
pp->StatusReportFeedbackNumber = 1 + ctx->report_id++;
@@ -194,8 +197,18 @@ static void fill_slice_short(DXVA_Slice_H264_Short *slice,
slice->wBadSliceChopping = 0;
}
+static int get_refpic_index(const DXVA_PicParams_H264 *pp, int surface_index)
+{
+ int i;
+ for (i = 0; i < FF_ARRAY_ELEMS(pp->RefFrameList); i++) {
+ if ((pp->RefFrameList[i].bPicEntry & 0x7f) == surface_index)
+ return i;
+ }
+ return 0x7f;
+}
+
static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
- unsigned position, unsigned size)
+ const DXVA_PicParams_H264 *pp, unsigned position, unsigned size)
{
const H264Context *h = avctx->priv_data;
struct dxva_context *ctx = avctx->hwaccel_context;
@@ -218,18 +231,22 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
slice->num_ref_idx_l0_active_minus1 = h->ref_count[0] - 1;
if (h->list_count > 1)
slice->num_ref_idx_l1_active_minus1 = h->ref_count[1] - 1;
- slice->slice_alpha_c0_offset_div2 = h->slice_alpha_c0_offset / 2 - 26;
- slice->slice_beta_offset_div2 = h->slice_beta_offset / 2 - 26;
+ slice->slice_alpha_c0_offset_div2 = h->slice_alpha_c0_offset / 2;
+ slice->slice_beta_offset_div2 = h->slice_beta_offset / 2;
slice->Reserved8Bits = 0;
for (list = 0; list < 2; list++) {
unsigned i;
for (i = 0; i < FF_ARRAY_ELEMS(slice->RefPicList[list]); i++) {
if (list < h->list_count && i < h->ref_count[list]) {
- const Picture *r = &h->ref_list[list][i];
+ const H264Picture *r = &h->ref_list[list][i];
unsigned plane;
- fill_picture_entry(&slice->RefPicList[list][i],
- ff_dxva2_get_surface_index(ctx, r),
+ unsigned index;
+ if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
+ index = ff_dxva2_get_surface_index(ctx, &r->f);
+ else
+ index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, &r->f));
+ fill_picture_entry(&slice->RefPicList[list][i], index,
r->reference == PICT_BOTTOM_FIELD);
for (plane = 0; plane < 3; plane++) {
int w, o;
@@ -277,7 +294,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
const H264Context *h = avctx->priv_data;
const unsigned mb_count = h->mb_width * h->mb_height;
struct dxva_context *ctx = avctx->hwaccel_context;
- const Picture *current_picture = h->cur_pic_ptr;
+ const H264Picture *current_picture = h->cur_pic_ptr;
struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
DXVA_Slice_H264_Short *slice = NULL;
uint8_t *dxva_data, *current, *end;
@@ -397,7 +414,7 @@ static int dxva2_h264_decode_slice(AVCodecContext *avctx,
{
const H264Context *h = avctx->priv_data;
struct dxva_context *ctx = avctx->hwaccel_context;
- const Picture *current_picture = h->cur_pic_ptr;
+ const H264Picture *current_picture = h->cur_pic_ptr;
struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
unsigned position;
@@ -414,7 +431,7 @@ static int dxva2_h264_decode_slice(AVCodecContext *avctx,
position, size);
else
fill_slice_long(avctx, &ctx_pic->slice_long[ctx_pic->slice_count],
- position, size);
+ &ctx_pic->pp, position, size);
ctx_pic->slice_count++;
if (h->slice_type != AV_PICTURE_TYPE_I && h->slice_type != AV_PICTURE_TYPE_SI)
@@ -431,7 +448,7 @@ static int dxva2_h264_end_frame(AVCodecContext *avctx)
if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
return -1;
- ret = ff_dxva2_common_end_frame(avctx, h->cur_pic_ptr,
+ ret = ff_dxva2_common_end_frame(avctx, &h->cur_pic_ptr->f,
&ctx_pic->pp, sizeof(ctx_pic->pp),
&ctx_pic->qm, sizeof(ctx_pic->qm),
commit_bitstream_and_slice_buffer);
@@ -448,5 +465,5 @@ AVHWAccel ff_h264_dxva2_hwaccel = {
.start_frame = dxva2_h264_start_frame,
.decode_slice = dxva2_h264_decode_slice,
.end_frame = dxva2_h264_end_frame,
- .priv_data_size = sizeof(struct dxva2_picture_context),
+ .frame_priv_data_size = sizeof(struct dxva2_picture_context),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxva2_internal.h b/chromium/third_party/ffmpeg/libavcodec/dxva2_internal.h
index 8a454c12997..427c1ffdf80 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxva2_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dxva2_internal.h
@@ -35,10 +35,10 @@
#include "avcodec.h"
#include "mpegvideo.h"
-void *ff_dxva2_get_surface(const Picture *picture);
+void *ff_dxva2_get_surface(const AVFrame *frame);
unsigned ff_dxva2_get_surface_index(const struct dxva_context *,
- const Picture *picture);
+ const AVFrame *frame);
int ff_dxva2_commit_buffer(AVCodecContext *, struct dxva_context *,
DXVA2_DecodeBufferDesc *,
@@ -46,7 +46,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *, struct dxva_context *,
unsigned mb_count);
-int ff_dxva2_common_end_frame(AVCodecContext *, Picture *,
+int ff_dxva2_common_end_frame(AVCodecContext *, AVFrame *,
const void *pp, unsigned pp_size,
const void *qm, unsigned qm_size,
int (*commit_bs_si)(AVCodecContext *,
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c b/chromium/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c
index 1827dd526f4..5fa4424d5f8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c
@@ -20,9 +20,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/log.h"
#include "dxva2_internal.h"
+#include "mpegutils.h"
-#define MAX_SLICES (SLICE_MAX_START_CODE - SLICE_MIN_START_CODE + 1)
+#define MAX_SLICES 1024
struct dxva2_picture_context {
DXVA_PictureParameters pp;
DXVA_QmatrixData qm;
@@ -42,14 +44,14 @@ static void fill_picture_parameters(AVCodecContext *avctx,
int is_field = s->picture_structure != PICT_FRAME;
memset(pp, 0, sizeof(*pp));
- pp->wDecodedPictureIndex = ff_dxva2_get_surface_index(ctx, current_picture);
+ pp->wDecodedPictureIndex = ff_dxva2_get_surface_index(ctx, current_picture->f);
pp->wDeblockedPictureIndex = 0;
if (s->pict_type != AV_PICTURE_TYPE_I)
- pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture);
+ pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, s->last_picture.f);
else
pp->wForwardRefPictureIndex = 0xffff;
if (s->pict_type == AV_PICTURE_TYPE_B)
- pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture);
+ pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, s->next_picture.f);
else
pp->wBackwardRefPictureIndex = 0xffff;
pp->wPicWidthInMBminus1 = s->mb_width - 1;
@@ -232,9 +234,11 @@ static int dxva2_mpeg2_decode_slice(AVCodecContext *avctx,
s->current_picture_ptr->hwaccel_picture_private;
unsigned position;
- if (ctx_pic->slice_count >= MAX_SLICES)
+ if (ctx_pic->slice_count >= MAX_SLICES) {
+ avpriv_request_sample(avctx, "%d slices in dxva2",
+ ctx_pic->slice_count);
return -1;
-
+ }
if (!ctx_pic->bitstream)
ctx_pic->bitstream = buffer;
ctx_pic->bitstream_size += size;
@@ -254,7 +258,7 @@ static int dxva2_mpeg2_end_frame(AVCodecContext *avctx)
if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
return -1;
- ret = ff_dxva2_common_end_frame(avctx, s->current_picture_ptr,
+ ret = ff_dxva2_common_end_frame(avctx, s->current_picture_ptr->f,
&ctx_pic->pp, sizeof(ctx_pic->pp),
&ctx_pic->qm, sizeof(ctx_pic->qm),
commit_bitstream_and_slice_buffer);
@@ -271,5 +275,5 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = {
.start_frame = dxva2_mpeg2_start_frame,
.decode_slice = dxva2_mpeg2_decode_slice,
.end_frame = dxva2_mpeg2_end_frame,
- .priv_data_size = sizeof(struct dxva2_picture_context),
+ .frame_priv_data_size = sizeof(struct dxva2_picture_context),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxva2_vc1.c b/chromium/third_party/ffmpeg/libavcodec/dxva2_vc1.c
index 2e9a00eb077..b2b5cedc178 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxva2_vc1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxva2_vc1.c
@@ -21,6 +21,7 @@
*/
#include "dxva2_internal.h"
+#include "mpegutils.h"
#include "vc1.h"
#include "vc1data.h"
@@ -38,16 +39,25 @@ static void fill_picture_parameters(AVCodecContext *avctx,
{
const MpegEncContext *s = &v->s;
const Picture *current_picture = s->current_picture_ptr;
+ int intcomp = 0;
+
+ // determine if intensity compensation is needed
+ if (s->pict_type == AV_PICTURE_TYPE_P) {
+ if ((v->fcm == ILACE_FRAME && v->intcomp) || (v->fcm != ILACE_FRAME && v->mv_mode == MV_PMODE_INTENSITY_COMP)) {
+ if (v->lumscale != 32 || v->lumshift != 0 || (s->picture_structure != PICT_FRAME && (v->lumscale2 != 32 || v->lumshift2 != 0)))
+ intcomp = 1;
+ }
+ }
memset(pp, 0, sizeof(*pp));
pp->wDecodedPictureIndex =
- pp->wDeblockedPictureIndex = ff_dxva2_get_surface_index(ctx, current_picture);
+ pp->wDeblockedPictureIndex = ff_dxva2_get_surface_index(ctx, current_picture->f);
if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type)
- pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture);
+ pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, s->last_picture.f);
else
pp->wForwardRefPictureIndex = 0xffff;
if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type)
- pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture);
+ pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, s->next_picture.f);
else
pp->wBackwardRefPictureIndex = 0xffff;
if (v->profile == PROFILE_ADVANCED) {
@@ -74,7 +84,7 @@ static void fill_picture_parameters(AVCodecContext *avctx,
pp->bBidirectionalAveragingMode = (1 << 7) |
((ctx->cfg->ConfigIntraResidUnsigned != 0) << 6) |
((ctx->cfg->ConfigResidDiffAccelerator != 0) << 5) |
- ((v->lumscale != 32 || v->lumshift != 0) << 4) |
+ (intcomp << 4) |
((v->profile == PROFILE_ADVANCED) << 3);
pp->bMVprecisionAndChromaRelation = ((v->mv_mode == MV_PMODE_1MV_HPEL_BILIN) << 3) |
(1 << 2) |
@@ -122,15 +132,25 @@ static void fill_picture_parameters(AVCodecContext *avctx,
(v->range_mapuv_flag << 3) |
(v->range_mapuv );
pp->bPicBinPB = 0;
- pp->bMV_RPS = 0;
- pp->bReservedBits = 0;
+ pp->bMV_RPS = (v->fcm == ILACE_FIELD && pp->bPicBackwardPrediction) ? v->refdist + 9 : 0;
+ pp->bReservedBits = v->pq;
if (s->picture_structure == PICT_FRAME) {
- pp->wBitstreamFcodes = v->lumscale;
- pp->wBitstreamPCEelements = v->lumshift;
+ if (intcomp) {
+ pp->wBitstreamFcodes = v->lumscale;
+ pp->wBitstreamPCEelements = v->lumshift;
+ } else {
+ pp->wBitstreamFcodes = 32;
+ pp->wBitstreamPCEelements = 0;
+ }
} else {
/* Syntax: (top_field_param << 8) | bottom_field_param */
- pp->wBitstreamFcodes = (v->lumscale << 8) | v->lumscale;
- pp->wBitstreamPCEelements = (v->lumshift << 8) | v->lumshift;
+ if (intcomp) {
+ pp->wBitstreamFcodes = (v->lumscale << 8) | v->lumscale2;
+ pp->wBitstreamPCEelements = (v->lumshift << 8) | v->lumshift2;
+ } else {
+ pp->wBitstreamFcodes = (32 << 8) | 32;
+ pp->wBitstreamPCEelements = 0;
+ }
}
pp->bBitstreamConcealmentNeed = 0;
pp->bBitstreamConcealmentMethod = 0;
@@ -148,8 +168,8 @@ static void fill_slice(AVCodecContext *avctx, DXVA_SliceInfo *slice,
slice->dwSliceBitsInBuffer = 8 * size;
slice->dwSliceDataLocation = position;
slice->bStartCodeBitOffset = 0;
- slice->bReservedBits = 0;
- slice->wMBbitOffset = get_bits_count(&s->gb);
+ slice->bReservedBits = (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type) ? v->bfraction_lut_index + 9 : 0;
+ slice->wMBbitOffset = v->p_frame_skipped ? 0xffff : get_bits_count(&s->gb) + (avctx->codec_id == AV_CODEC_ID_VC1 ? 32 : 0);
slice->wNumberMBsInSlice = s->mb_width * s->mb_height; /* XXX We assume 1 slice */
slice->wQuantizerScaleCode = v->pq;
slice->wBadSliceChopping = 0;
@@ -263,7 +283,7 @@ static int dxva2_vc1_end_frame(AVCodecContext *avctx)
if (ctx_pic->bitstream_size <= 0)
return -1;
- ret = ff_dxva2_common_end_frame(avctx, v->s.current_picture_ptr,
+ ret = ff_dxva2_common_end_frame(avctx, v->s.current_picture_ptr->f,
&ctx_pic->pp, sizeof(ctx_pic->pp),
NULL, 0,
commit_bitstream_and_slice_buffer);
@@ -281,7 +301,7 @@ AVHWAccel ff_wmv3_dxva2_hwaccel = {
.start_frame = dxva2_vc1_start_frame,
.decode_slice = dxva2_vc1_decode_slice,
.end_frame = dxva2_vc1_end_frame,
- .priv_data_size = sizeof(struct dxva2_picture_context),
+ .frame_priv_data_size = sizeof(struct dxva2_picture_context),
};
#endif
@@ -293,5 +313,5 @@ AVHWAccel ff_vc1_dxva2_hwaccel = {
.start_frame = dxva2_vc1_start_frame,
.decode_slice = dxva2_vc1_decode_slice,
.end_frame = dxva2_vc1_end_frame,
- .priv_data_size = sizeof(struct dxva2_picture_context),
+ .frame_priv_data_size = sizeof(struct dxva2_picture_context),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/eac3dec.c b/chromium/third_party/ffmpeg/libavcodec/eac3dec.c
index b55ee2a34c2..8e931fddeb6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/eac3dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/eac3dec.c
@@ -345,23 +345,22 @@ int ff_eac3_parse_header(AC3DecodeContext *s)
if (get_bits1(gbc)) {
/* center and surround mix levels */
if (s->channel_mode > AC3_CHMODE_STEREO) {
- skip_bits(gbc, 2); // skip preferred stereo downmix mode
+ s->preferred_downmix = get_bits(gbc, 2);
if (s->channel_mode & 1) {
/* if three front channels exist */
- skip_bits(gbc, 3); //skip Lt/Rt center mix level
- s->center_mix_level = get_bits(gbc, 3);
+ s->center_mix_level_ltrt = get_bits(gbc, 3);
+ s->center_mix_level = get_bits(gbc, 3);
}
if (s->channel_mode & 4) {
/* if a surround channel exists */
- skip_bits(gbc, 3); //skip Lt/Rt surround mix level
- s->surround_mix_level = get_bits(gbc, 3);
+ s->surround_mix_level_ltrt = av_clip(get_bits(gbc, 3), 3, 7);
+ s->surround_mix_level = av_clip(get_bits(gbc, 3), 3, 7);
}
}
/* lfe mix level */
- if (s->lfe_on && get_bits1(gbc)) {
- // TODO: use LFE mix level
- skip_bits(gbc, 5); // skip LFE mix level code
+ if (s->lfe_on && (s->lfe_mix_level_exists = get_bits1(gbc))) {
+ s->lfe_mix_level = get_bits(gbc, 5);
}
/* info for mixing with other streams and substreams */
@@ -413,10 +412,11 @@ int ff_eac3_parse_header(AC3DecodeContext *s)
s->bitstream_mode = get_bits(gbc, 3);
skip_bits(gbc, 2); // skip copyright bit and original bitstream bit
if (s->channel_mode == AC3_CHMODE_STEREO) {
- skip_bits(gbc, 4); // skip Dolby surround and headphone mode
+ s->dolby_surround_mode = get_bits(gbc, 2);
+ s->dolby_headphone_mode = get_bits(gbc, 2);
}
if (s->channel_mode >= AC3_CHMODE_2F2R) {
- skip_bits(gbc, 2); // skip Dolby surround EX mode
+ s->dolby_surround_ex_mode = get_bits(gbc, 2);
}
for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
if (get_bits1(gbc)) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/eacmv.c b/chromium/third_party/ffmpeg/libavcodec/eacmv.c
index b3ffb3f07b9..4a1af8cf435 100644
--- a/chromium/third_party/ffmpeg/libavcodec/eacmv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/eacmv.c
@@ -132,7 +132,7 @@ static void cmv_decode_inter(CmvContext *s, AVFrame *frame, const uint8_t *buf,
static int cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end)
{
- int pal_start, pal_count, i, ret;
+ int pal_start, pal_count, i, ret, fps;
if(buf_end - buf < 16) {
av_log(s->avctx, AV_LOG_WARNING, "truncated header\n");
@@ -141,16 +141,20 @@ static int cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *
s->width = AV_RL16(&buf[4]);
s->height = AV_RL16(&buf[6]);
- if (s->avctx->width!=s->width || s->avctx->height!=s->height) {
+
+ if (s->width != s->avctx->width ||
+ s->height != s->avctx->height) {
av_frame_unref(s->last_frame);
av_frame_unref(s->last2_frame);
- ret = ff_set_dimensions(s->avctx, s->width, s->height);
- if (ret < 0)
- return ret;
}
- s->avctx->time_base.num = 1;
- s->avctx->time_base.den = AV_RL16(&buf[10]);
+ ret = ff_set_dimensions(s->avctx, s->width, s->height);
+ if (ret < 0)
+ return ret;
+
+ fps = AV_RL16(&buf[10]);
+ if (fps > 0)
+ s->avctx->time_base = (AVRational){ 1, fps };
pal_start = AV_RL16(&buf[12]);
pal_count = AV_RL16(&buf[14]);
diff --git a/chromium/third_party/ffmpeg/libavcodec/eamad.c b/chromium/third_party/ffmpeg/libavcodec/eamad.c
index 2d34d35a545..c0433057853 100644
--- a/chromium/third_party/ffmpeg/libavcodec/eamad.c
+++ b/chromium/third_party/ffmpeg/libavcodec/eamad.c
@@ -195,7 +195,7 @@ static int decode_motion(GetBitContext *gb)
static int decode_mb(MadContext *s, AVFrame *frame, int inter)
{
int mv_map = 0;
- int mv_x, mv_y;
+ int av_uninit(mv_x), av_uninit(mv_y);
int j;
if (inter) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/eatgv.c b/chromium/third_party/ffmpeg/libavcodec/eatgv.c
index 952ebb3c34c..f204a1344cd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/eatgv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/eatgv.c
@@ -311,7 +311,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
frame->pict_type = AV_PICTURE_TYPE_I;
if (!s->frame_buffer &&
- !(s->frame_buffer = av_malloc(s->width * s->height)))
+ !(s->frame_buffer = av_mallocz(s->width * s->height)))
return AVERROR(ENOMEM);
if (unpack(buf, buf_end, s->frame_buffer, s->avctx->width, s->avctx->height) < 0) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/elbg.c b/chromium/third_party/ffmpeg/libavcodec/elbg.c
index 5c7018b4752..9bbb6d88ac9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/elbg.c
+++ b/chromium/third_party/ffmpeg/libavcodec/elbg.c
@@ -51,7 +51,7 @@ typedef struct{
int *codebook;
cell **cells;
int *utility;
- int *utility_inc;
+ int64_t *utility_inc;
int *nearest_cb;
int *points;
AVLFG *rand_state;
@@ -108,9 +108,18 @@ static int get_high_utility_cell(elbg_data *elbg)
{
int i=0;
/* Using linear search, do binary if it ever turns to be speed critical */
- int r = av_lfg_get(elbg->rand_state)%elbg->utility_inc[elbg->numCB-1] + 1;
- while (elbg->utility_inc[i] < r)
+ uint64_t r;
+
+ if (elbg->utility_inc[elbg->numCB-1] < INT_MAX) {
+ r = av_lfg_get(elbg->rand_state) % (unsigned int)elbg->utility_inc[elbg->numCB-1] + 1;
+ } else {
+ r = av_lfg_get(elbg->rand_state);
+ r = (av_lfg_get(elbg->rand_state) + (r<<32)) % elbg->utility_inc[elbg->numCB-1] + 1;
+ }
+
+ while (elbg->utility_inc[i] < r) {
i++;
+ }
av_assert2(elbg->cells[i]);
@@ -227,7 +236,8 @@ static void shift_codebook(elbg_data *elbg, int *indexes,
static void evaluate_utility_inc(elbg_data *elbg)
{
- int i, inc=0;
+ int i;
+ int64_t inc=0;
for (i=0; i < elbg->numCB; i++) {
if (elbg->numCB*elbg->utility[i] > elbg->error)
@@ -333,7 +343,7 @@ void avpriv_init_elbg(int *points, int dim, int numpoints, int *codebook,
if (numpoints > 24*numCB) {
/* ELBG is very costly for a big number of points. So if we have a lot
of them, get a good initial codebook to save on iterations */
- int *temp_points = av_malloc(dim*(numpoints/8)*sizeof(int));
+ int *temp_points = av_malloc_array(dim, (numpoints/8)*sizeof(int));
for (i=0; i<numpoints/8; i++) {
k = (i*BIG_PRIME) % numpoints;
memcpy(temp_points + i*dim, points + k*dim, dim*sizeof(int));
@@ -359,9 +369,9 @@ void avpriv_do_elbg(int *points, int dim, int numpoints, int *codebook,
elbg_data elbg_d;
elbg_data *elbg = &elbg_d;
int i, j, k, last_error, steps=0;
- int *dist_cb = av_malloc(numpoints*sizeof(int));
- int *size_part = av_malloc(numCB*sizeof(int));
- cell *list_buffer = av_malloc(numpoints*sizeof(cell));
+ int *dist_cb = av_malloc_array(numpoints, sizeof(int));
+ int *size_part = av_malloc_array(numCB, sizeof(int));
+ cell *list_buffer = av_malloc_array(numpoints, sizeof(cell));
cell *free_cells;
int best_dist, best_idx = 0;
@@ -369,12 +379,12 @@ void avpriv_do_elbg(int *points, int dim, int numpoints, int *codebook,
elbg->dim = dim;
elbg->numCB = numCB;
elbg->codebook = codebook;
- elbg->cells = av_malloc(numCB*sizeof(cell *));
- elbg->utility = av_malloc(numCB*sizeof(int));
+ elbg->cells = av_malloc_array(numCB, sizeof(cell *));
+ elbg->utility = av_malloc_array(numCB, sizeof(int));
elbg->nearest_cb = closest_cb;
elbg->points = points;
- elbg->utility_inc = av_malloc(numCB*sizeof(int));
- elbg->scratchbuf = av_malloc(5*dim*sizeof(int));
+ elbg->utility_inc = av_malloc_array(numCB, sizeof(*elbg->utility_inc));
+ elbg->scratchbuf = av_malloc_array(5*dim, sizeof(int));
elbg->rand_state = rand_state;
diff --git a/chromium/third_party/ffmpeg/libavcodec/error_resilience.c b/chromium/third_party/ffmpeg/libavcodec/error_resilience.c
index 8e3fb616be1..7bb7860f91f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/error_resilience.c
+++ b/chromium/third_party/ffmpeg/libavcodec/error_resilience.c
@@ -30,6 +30,7 @@
#include "libavutil/internal.h"
#include "avcodec.h"
#include "error_resilience.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "rectangle.h"
#include "thread.h"
@@ -57,7 +58,7 @@ static void set_mv_strides(ERContext *s, int *mv_step, int *stride)
static void put_dc(ERContext *s, uint8_t *dest_y, uint8_t *dest_cb,
uint8_t *dest_cr, int mb_x, int mb_y)
{
- int *linesize = s->cur_pic->f.linesize;
+ int *linesize = s->cur_pic.f->linesize;
int dc, dcu, dcv, y, i;
for (i = 0; i < 4; i++) {
dc = s->dc_val[0][mb_x * 2 + (i & 1) + (mb_y * 2 + (i >> 1)) * s->b8_stride];
@@ -135,8 +136,8 @@ static void guess_dc(ERContext *s, int16_t *dc, int w,
int h, int stride, int is_luma)
{
int b_x, b_y;
- int16_t (*col )[4] = av_malloc(stride*h*sizeof( int16_t)*4);
- uint32_t (*dist)[4] = av_malloc(stride*h*sizeof(uint32_t)*4);
+ int16_t (*col )[4] = av_malloc_array(stride, h*sizeof( int16_t)*4);
+ uint32_t (*dist)[4] = av_malloc_array(stride, h*sizeof(uint32_t)*4);
if(!col || !dist) {
av_log(s->avctx, AV_LOG_ERROR, "guess_dc() is out of memory\n");
@@ -149,7 +150,7 @@ static void guess_dc(ERContext *s, int16_t *dc, int w,
for(b_x=0; b_x<w; b_x++){
int mb_index_j= (b_x>>is_luma) + (b_y>>is_luma)*s->mb_stride;
int error_j= s->error_status_table[mb_index_j];
- int intra_j = IS_INTRA(s->cur_pic->mb_type[mb_index_j]);
+ int intra_j = IS_INTRA(s->cur_pic.mb_type[mb_index_j]);
if(intra_j==0 || !(error_j&ER_DC_ERROR)){
color= dc[b_x + b_y*stride];
distance= b_x;
@@ -162,7 +163,7 @@ static void guess_dc(ERContext *s, int16_t *dc, int w,
for(b_x=w-1; b_x>=0; b_x--){
int mb_index_j= (b_x>>is_luma) + (b_y>>is_luma)*s->mb_stride;
int error_j= s->error_status_table[mb_index_j];
- int intra_j = IS_INTRA(s->cur_pic->mb_type[mb_index_j]);
+ int intra_j = IS_INTRA(s->cur_pic.mb_type[mb_index_j]);
if(intra_j==0 || !(error_j&ER_DC_ERROR)){
color= dc[b_x + b_y*stride];
distance= b_x;
@@ -177,7 +178,7 @@ static void guess_dc(ERContext *s, int16_t *dc, int w,
for(b_y=0; b_y<h; b_y++){
int mb_index_j= (b_x>>is_luma) + (b_y>>is_luma)*s->mb_stride;
int error_j= s->error_status_table[mb_index_j];
- int intra_j = IS_INTRA(s->cur_pic->mb_type[mb_index_j]);
+ int intra_j = IS_INTRA(s->cur_pic.mb_type[mb_index_j]);
if(intra_j==0 || !(error_j&ER_DC_ERROR)){
color= dc[b_x + b_y*stride];
distance= b_y;
@@ -190,7 +191,7 @@ static void guess_dc(ERContext *s, int16_t *dc, int w,
for(b_y=h-1; b_y>=0; b_y--){
int mb_index_j= (b_x>>is_luma) + (b_y>>is_luma)*s->mb_stride;
int error_j= s->error_status_table[mb_index_j];
- int intra_j = IS_INTRA(s->cur_pic->mb_type[mb_index_j]);
+ int intra_j = IS_INTRA(s->cur_pic.mb_type[mb_index_j]);
if(intra_j==0 || !(error_j&ER_DC_ERROR)){
color= dc[b_x + b_y*stride];
distance= b_y;
@@ -207,7 +208,7 @@ static void guess_dc(ERContext *s, int16_t *dc, int w,
mb_index = (b_x >> is_luma) + (b_y >> is_luma) * s->mb_stride;
error = s->error_status_table[mb_index];
- if (IS_INTER(s->cur_pic->mb_type[mb_index]))
+ if (IS_INTER(s->cur_pic.mb_type[mb_index]))
continue; // inter
if (!(error & ER_DC_ERROR))
continue; // dc-ok
@@ -238,7 +239,7 @@ static void h_block_filter(ERContext *s, uint8_t *dst, int w,
int h, int stride, int is_luma)
{
int b_x, b_y, mvx_stride, mvy_stride;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
set_mv_strides(s, &mvx_stride, &mvy_stride);
mvx_stride >>= is_luma;
mvy_stride *= mvx_stride;
@@ -248,13 +249,13 @@ static void h_block_filter(ERContext *s, uint8_t *dst, int w,
int y;
int left_status = s->error_status_table[( b_x >> is_luma) + (b_y >> is_luma) * s->mb_stride];
int right_status = s->error_status_table[((b_x + 1) >> is_luma) + (b_y >> is_luma) * s->mb_stride];
- int left_intra = IS_INTRA(s->cur_pic->mb_type[( b_x >> is_luma) + (b_y >> is_luma) * s->mb_stride]);
- int right_intra = IS_INTRA(s->cur_pic->mb_type[((b_x + 1) >> is_luma) + (b_y >> is_luma) * s->mb_stride]);
+ int left_intra = IS_INTRA(s->cur_pic.mb_type[( b_x >> is_luma) + (b_y >> is_luma) * s->mb_stride]);
+ int right_intra = IS_INTRA(s->cur_pic.mb_type[((b_x + 1) >> is_luma) + (b_y >> is_luma) * s->mb_stride]);
int left_damage = left_status & ER_MB_ERROR;
int right_damage = right_status & ER_MB_ERROR;
int offset = b_x * 8 + b_y * stride * 8;
- int16_t *left_mv = s->cur_pic->motion_val[0][mvy_stride * b_y + mvx_stride * b_x];
- int16_t *right_mv = s->cur_pic->motion_val[0][mvy_stride * b_y + mvx_stride * (b_x + 1)];
+ int16_t *left_mv = s->cur_pic.motion_val[0][mvy_stride * b_y + mvx_stride * b_x];
+ int16_t *right_mv = s->cur_pic.motion_val[0][mvy_stride * b_y + mvx_stride * (b_x + 1)];
if (!(left_damage || right_damage))
continue; // both undamaged
if ((!left_intra) && (!right_intra) &&
@@ -306,7 +307,7 @@ static void v_block_filter(ERContext *s, uint8_t *dst, int w, int h,
int stride, int is_luma)
{
int b_x, b_y, mvx_stride, mvy_stride;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
set_mv_strides(s, &mvx_stride, &mvy_stride);
mvx_stride >>= is_luma;
mvy_stride *= mvx_stride;
@@ -316,14 +317,14 @@ static void v_block_filter(ERContext *s, uint8_t *dst, int w, int h,
int x;
int top_status = s->error_status_table[(b_x >> is_luma) + (b_y >> is_luma) * s->mb_stride];
int bottom_status = s->error_status_table[(b_x >> is_luma) + ((b_y + 1) >> is_luma) * s->mb_stride];
- int top_intra = IS_INTRA(s->cur_pic->mb_type[(b_x >> is_luma) + ( b_y >> is_luma) * s->mb_stride]);
- int bottom_intra = IS_INTRA(s->cur_pic->mb_type[(b_x >> is_luma) + ((b_y + 1) >> is_luma) * s->mb_stride]);
+ int top_intra = IS_INTRA(s->cur_pic.mb_type[(b_x >> is_luma) + ( b_y >> is_luma) * s->mb_stride]);
+ int bottom_intra = IS_INTRA(s->cur_pic.mb_type[(b_x >> is_luma) + ((b_y + 1) >> is_luma) * s->mb_stride]);
int top_damage = top_status & ER_MB_ERROR;
int bottom_damage = bottom_status & ER_MB_ERROR;
int offset = b_x * 8 + b_y * stride * 8;
- int16_t *top_mv = s->cur_pic->motion_val[0][mvy_stride * b_y + mvx_stride * b_x];
- int16_t *bottom_mv = s->cur_pic->motion_val[0][mvy_stride * (b_y + 1) + mvx_stride * b_x];
+ int16_t *top_mv = s->cur_pic.motion_val[0][mvy_stride * b_y + mvx_stride * b_x];
+ int16_t *bottom_mv = s->cur_pic.motion_val[0][mvy_stride * (b_y + 1) + mvx_stride * b_x];
if (!(top_damage || bottom_damage))
continue; // both undamaged
@@ -388,7 +389,7 @@ static void guess_mv(ERContext *s)
int f = 0;
int error = s->error_status_table[mb_xy];
- if (IS_INTRA(s->cur_pic->mb_type[mb_xy]))
+ if (IS_INTRA(s->cur_pic.mb_type[mb_xy]))
f = MV_FROZEN; // intra // FIXME check
if (!(error & ER_MV_ERROR))
f = MV_FROZEN; // inter with undamaged MV
@@ -396,13 +397,13 @@ static void guess_mv(ERContext *s)
fixed[mb_xy] = f;
if (f == MV_FROZEN)
num_avail++;
- else if(s->last_pic->f.data[0] && s->last_pic->motion_val[0]){
+ else if(s->last_pic.f->data[0] && s->last_pic.motion_val[0]){
const int mb_y= mb_xy / s->mb_stride;
const int mb_x= mb_xy % s->mb_stride;
const int mot_index= (mb_x + mb_y*mot_stride) * mot_step;
- s->cur_pic->motion_val[0][mot_index][0]= s->last_pic->motion_val[0][mot_index][0];
- s->cur_pic->motion_val[0][mot_index][1]= s->last_pic->motion_val[0][mot_index][1];
- s->cur_pic->ref_index[0][4*mb_xy] = s->last_pic->ref_index[0][4*mb_xy];
+ s->cur_pic.motion_val[0][mot_index][0]= s->last_pic.motion_val[0][mot_index][0];
+ s->cur_pic.motion_val[0][mot_index][1]= s->last_pic.motion_val[0][mot_index][1];
+ s->cur_pic.ref_index[0][4*mb_xy] = s->last_pic.ref_index[0][4*mb_xy];
}
}
@@ -411,9 +412,9 @@ static void guess_mv(ERContext *s)
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
const int mb_xy = mb_x + mb_y * s->mb_stride;
- int mv_dir = (s->last_pic && s->last_pic->f.data[0]) ? MV_DIR_FORWARD : MV_DIR_BACKWARD;
+ int mv_dir = (s->last_pic.f && s->last_pic.f->data[0]) ? MV_DIR_FORWARD : MV_DIR_BACKWARD;
- if (IS_INTRA(s->cur_pic->mb_type[mb_xy]))
+ if (IS_INTRA(s->cur_pic.mb_type[mb_xy]))
continue;
if (!(s->error_status_table[mb_xy] & ER_MV_ERROR))
continue;
@@ -454,8 +455,8 @@ static void guess_mv(ERContext *s)
if (fixed[mb_xy] == MV_FROZEN)
continue;
- av_assert1(!IS_INTRA(s->cur_pic->mb_type[mb_xy]));
- av_assert1(s->last_pic && s->last_pic->f.data[0]);
+ av_assert1(!IS_INTRA(s->cur_pic.mb_type[mb_xy]));
+ av_assert1(s->last_pic.f && s->last_pic.f->data[0]);
j = 0;
if (mb_x > 0 && fixed[mb_xy - 1] == MV_FROZEN)
@@ -485,38 +486,38 @@ static void guess_mv(ERContext *s)
if (mb_x > 0 && fixed[mb_xy - 1]) {
mv_predictor[pred_count][0] =
- s->cur_pic->motion_val[0][mot_index - mot_step][0];
+ s->cur_pic.motion_val[0][mot_index - mot_step][0];
mv_predictor[pred_count][1] =
- s->cur_pic->motion_val[0][mot_index - mot_step][1];
+ s->cur_pic.motion_val[0][mot_index - mot_step][1];
ref[pred_count] =
- s->cur_pic->ref_index[0][4 * (mb_xy - 1)];
+ s->cur_pic.ref_index[0][4 * (mb_xy - 1)];
pred_count++;
}
if (mb_x + 1 < mb_width && fixed[mb_xy + 1]) {
mv_predictor[pred_count][0] =
- s->cur_pic->motion_val[0][mot_index + mot_step][0];
+ s->cur_pic.motion_val[0][mot_index + mot_step][0];
mv_predictor[pred_count][1] =
- s->cur_pic->motion_val[0][mot_index + mot_step][1];
+ s->cur_pic.motion_val[0][mot_index + mot_step][1];
ref[pred_count] =
- s->cur_pic->ref_index[0][4 * (mb_xy + 1)];
+ s->cur_pic.ref_index[0][4 * (mb_xy + 1)];
pred_count++;
}
if (mb_y > 0 && fixed[mb_xy - mb_stride]) {
mv_predictor[pred_count][0] =
- s->cur_pic->motion_val[0][mot_index - mot_stride * mot_step][0];
+ s->cur_pic.motion_val[0][mot_index - mot_stride * mot_step][0];
mv_predictor[pred_count][1] =
- s->cur_pic->motion_val[0][mot_index - mot_stride * mot_step][1];
+ s->cur_pic.motion_val[0][mot_index - mot_stride * mot_step][1];
ref[pred_count] =
- s->cur_pic->ref_index[0][4 * (mb_xy - s->mb_stride)];
+ s->cur_pic.ref_index[0][4 * (mb_xy - s->mb_stride)];
pred_count++;
}
if (mb_y + 1<mb_height && fixed[mb_xy + mb_stride]) {
mv_predictor[pred_count][0] =
- s->cur_pic->motion_val[0][mot_index + mot_stride * mot_step][0];
+ s->cur_pic.motion_val[0][mot_index + mot_stride * mot_step][0];
mv_predictor[pred_count][1] =
- s->cur_pic->motion_val[0][mot_index + mot_stride * mot_step][1];
+ s->cur_pic.motion_val[0][mot_index + mot_stride * mot_step][1];
ref[pred_count] =
- s->cur_pic->ref_index[0][4 * (mb_xy + s->mb_stride)];
+ s->cur_pic.ref_index[0][4 * (mb_xy + s->mb_stride)];
pred_count++;
}
if (pred_count == 0)
@@ -574,19 +575,19 @@ skip_mean_and_median:
if (s->avctx->codec_id == AV_CODEC_ID_H264) {
// FIXME
} else {
- ff_thread_await_progress(&s->last_pic->tf,
+ ff_thread_await_progress(s->last_pic.tf,
mb_y, 0);
}
- if (!s->last_pic->motion_val[0] ||
- !s->last_pic->ref_index[0])
+ if (!s->last_pic.motion_val[0] ||
+ !s->last_pic.ref_index[0])
goto skip_last_mv;
- prev_x = s->last_pic->motion_val[0][mot_index][0];
- prev_y = s->last_pic->motion_val[0][mot_index][1];
- prev_ref = s->last_pic->ref_index[0][4 * mb_xy];
+ prev_x = s->last_pic.motion_val[0][mot_index][0];
+ prev_y = s->last_pic.motion_val[0][mot_index][1];
+ prev_ref = s->last_pic.ref_index[0][4 * mb_xy];
} else {
- prev_x = s->cur_pic->motion_val[0][mot_index][0];
- prev_y = s->cur_pic->motion_val[0][mot_index][1];
- prev_ref = s->cur_pic->ref_index[0][4 * mb_xy];
+ prev_x = s->cur_pic.motion_val[0][mot_index][0];
+ prev_y = s->cur_pic.motion_val[0][mot_index][1];
+ prev_ref = s->cur_pic.ref_index[0][4 * mb_xy];
}
/* last MV */
@@ -598,14 +599,14 @@ skip_mean_and_median:
skip_last_mv:
for (j = 0; j < pred_count; j++) {
- int *linesize = s->cur_pic->f.linesize;
+ int *linesize = s->cur_pic.f->linesize;
int score = 0;
- uint8_t *src = s->cur_pic->f.data[0] +
+ uint8_t *src = s->cur_pic.f->data[0] +
mb_x * 16 + mb_y * 16 * linesize[0];
- s->cur_pic->motion_val[0][mot_index][0] =
+ s->cur_pic.motion_val[0][mot_index][0] =
s->mv[0][0][0] = mv_predictor[j][0];
- s->cur_pic->motion_val[0][mot_index][1] =
+ s->cur_pic.motion_val[0][mot_index][1] =
s->mv[0][0][1] = mv_predictor[j][1];
// predictor intra or otherwise not available
@@ -650,8 +651,8 @@ skip_last_mv:
for (i = 0; i < mot_step; i++)
for (j = 0; j < mot_step; j++) {
- s->cur_pic->motion_val[0][mot_index + i + j * mot_stride][0] = s->mv[0][0][0];
- s->cur_pic->motion_val[0][mot_index + i + j * mot_stride][1] = s->mv[0][0][1];
+ s->cur_pic.motion_val[0][mot_index + i + j * mot_stride][0] = s->mv[0][0][0];
+ s->cur_pic.motion_val[0][mot_index + i + j * mot_stride][1] = s->mv[0][0][1];
}
s->decode_mb(s->opaque, ref[best_pred], MV_DIR_FORWARD,
@@ -682,9 +683,12 @@ static int is_intra_more_likely(ERContext *s)
{
int is_intra_likely, i, j, undamaged_count, skip_amount, mb_x, mb_y;
- if (!s->last_pic || !s->last_pic->f.data[0])
+ if (!s->last_pic.f || !s->last_pic.f->data[0])
return 1; // no previous frame available -> use spatial prediction
+ if (s->avctx->error_concealment & FF_EC_FAVOR_INTER)
+ return 0;
+
undamaged_count = 0;
for (i = 0; i < s->mb_num; i++) {
const int mb_xy = s->mb_index2xy[i];
@@ -699,15 +703,11 @@ static int is_intra_more_likely(ERContext *s)
if (undamaged_count < 5)
return 0; // almost all MBs damaged -> use temporal prediction
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
// prevent dsp.sad() check, that requires access to the image
- if (CONFIG_MPEG_XVMC_DECODER &&
- s->avctx->xvmc_acceleration &&
- s->cur_pic->f.pict_type == AV_PICTURE_TYPE_I)
+ if (CONFIG_XVMC &&
+ s->avctx->hwaccel && s->avctx->hwaccel->decode_mb &&
+ s->cur_pic.f->pict_type == AV_PICTURE_TYPE_I)
return 1;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
skip_amount = FFMAX(undamaged_count / 50, 1); // check only up to 50 MBs
is_intra_likely = 0;
@@ -727,17 +727,17 @@ FF_ENABLE_DEPRECATION_WARNINGS
if ((j % skip_amount) != 0)
continue;
- if (s->cur_pic->f.pict_type == AV_PICTURE_TYPE_I) {
- int *linesize = s->cur_pic->f.linesize;
- uint8_t *mb_ptr = s->cur_pic->f.data[0] +
+ if (s->cur_pic.f->pict_type == AV_PICTURE_TYPE_I) {
+ int *linesize = s->cur_pic.f->linesize;
+ uint8_t *mb_ptr = s->cur_pic.f->data[0] +
mb_x * 16 + mb_y * 16 * linesize[0];
- uint8_t *last_mb_ptr = s->last_pic->f.data[0] +
+ uint8_t *last_mb_ptr = s->last_pic.f->data[0] +
mb_x * 16 + mb_y * 16 * linesize[0];
if (s->avctx->codec_id == AV_CODEC_ID_H264) {
// FIXME
} else {
- ff_thread_await_progress(&s->last_pic->tf, mb_y, 0);
+ ff_thread_await_progress(s->last_pic.tf, mb_y, 0);
}
is_intra_likely += s->dsp->sad[0](NULL, last_mb_ptr, mb_ptr,
linesize[0], 16);
@@ -746,7 +746,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
last_mb_ptr + linesize[0] * 16,
linesize[0], 16);
} else {
- if (IS_INTRA(s->cur_pic->mb_type[mb_xy]))
+ if (IS_INTRA(s->cur_pic.mb_type[mb_xy]))
is_intra_likely++;
else
is_intra_likely--;
@@ -770,10 +770,10 @@ void ff_er_frame_start(ERContext *s)
static int er_supported(ERContext *s)
{
- if(s->avctx->hwaccel ||
+ if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice ||
s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
- !s->cur_pic ||
- s->cur_pic->field_picture
+ !s->cur_pic.f ||
+ s->cur_pic.field_picture
)
return 0;
return 1;
@@ -795,7 +795,7 @@ void ff_er_add_slice(ERContext *s, int startx, int starty,
const int end_xy = s->mb_index2xy[end_i];
int mask = -1;
- if (s->avctx->hwaccel)
+ if (s->avctx->hwaccel && s->avctx->hwaccel->decode_slice)
return;
if (start_i > end_i || start_xy > end_xy) {
@@ -858,7 +858,7 @@ void ff_er_add_slice(ERContext *s, int startx, int starty,
void ff_er_frame_end(ERContext *s)
{
- int *linesize = s->cur_pic->f.linesize;
+ int *linesize = s->cur_pic.f->linesize;
int i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error;
int distance;
int threshold_part[4] = { 100, 100, 100 };
@@ -890,40 +890,40 @@ void ff_er_frame_end(ERContext *s)
return;
}
- if (s->last_pic) {
- if (s->last_pic->f.width != s->cur_pic->f.width ||
- s->last_pic->f.height != s->cur_pic->f.height ||
- s->last_pic->f.format != s->cur_pic->f.format) {
+ if (s->last_pic.f) {
+ if (s->last_pic.f->width != s->cur_pic.f->width ||
+ s->last_pic.f->height != s->cur_pic.f->height ||
+ s->last_pic.f->format != s->cur_pic.f->format) {
av_log(s->avctx, AV_LOG_WARNING, "Cannot use previous picture in error concealment\n");
- s->last_pic = NULL;
+ memset(&s->last_pic, 0, sizeof(s->last_pic));
}
}
- if (s->next_pic) {
- if (s->next_pic->f.width != s->cur_pic->f.width ||
- s->next_pic->f.height != s->cur_pic->f.height ||
- s->next_pic->f.format != s->cur_pic->f.format) {
+ if (s->next_pic.f) {
+ if (s->next_pic.f->width != s->cur_pic.f->width ||
+ s->next_pic.f->height != s->cur_pic.f->height ||
+ s->next_pic.f->format != s->cur_pic.f->format) {
av_log(s->avctx, AV_LOG_WARNING, "Cannot use next picture in error concealment\n");
- s->next_pic = NULL;
+ memset(&s->next_pic, 0, sizeof(s->next_pic));
}
}
- if (s->cur_pic->motion_val[0] == NULL) {
+ if (!s->cur_pic.motion_val[0] || !s->cur_pic.ref_index[0]) {
av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
for (i = 0; i < 2; i++) {
- s->cur_pic->ref_index_buf[i] = av_buffer_allocz(s->mb_stride * s->mb_height * 4 * sizeof(uint8_t));
- s->cur_pic->motion_val_buf[i] = av_buffer_allocz((size + 4) * 2 * sizeof(uint16_t));
- if (!s->cur_pic->ref_index_buf[i] || !s->cur_pic->motion_val_buf[i])
+ s->ref_index_buf[i] = av_buffer_allocz(s->mb_stride * s->mb_height * 4 * sizeof(uint8_t));
+ s->motion_val_buf[i] = av_buffer_allocz((size + 4) * 2 * sizeof(uint16_t));
+ if (!s->ref_index_buf[i] || !s->motion_val_buf[i])
break;
- s->cur_pic->ref_index[i] = s->cur_pic->ref_index_buf[i]->data;
- s->cur_pic->motion_val[i] = (int16_t (*)[2])s->cur_pic->motion_val_buf[i]->data + 4;
+ s->cur_pic.ref_index[i] = s->ref_index_buf[i]->data;
+ s->cur_pic.motion_val[i] = (int16_t (*)[2])s->motion_val_buf[i]->data + 4;
}
if (i < 2) {
for (i = 0; i < 2; i++) {
- av_buffer_unref(&s->cur_pic->ref_index_buf[i]);
- av_buffer_unref(&s->cur_pic->motion_val_buf[i]);
- s->cur_pic->ref_index[i] = NULL;
- s->cur_pic->motion_val[i] = NULL;
+ av_buffer_unref(&s->ref_index_buf[i]);
+ av_buffer_unref(&s->motion_val_buf[i]);
+ s->cur_pic.ref_index[i] = NULL;
+ s->cur_pic.motion_val[i] = NULL;
}
return;
}
@@ -1077,7 +1077,7 @@ void ff_er_frame_end(ERContext *s)
mv_error++;
}
av_log(s->avctx, AV_LOG_INFO, "concealing %d DC, %d AC, %d MV errors in %c frame\n",
- dc_error, ac_error, mv_error, av_get_picture_type_char(s->cur_pic->f.pict_type));
+ dc_error, ac_error, mv_error, av_get_picture_type_char(s->cur_pic.f->pict_type));
is_intra_likely = is_intra_more_likely(s);
@@ -1089,26 +1089,26 @@ void ff_er_frame_end(ERContext *s)
continue;
if (is_intra_likely)
- s->cur_pic->mb_type[mb_xy] = MB_TYPE_INTRA4x4;
+ s->cur_pic.mb_type[mb_xy] = MB_TYPE_INTRA4x4;
else
- s->cur_pic->mb_type[mb_xy] = MB_TYPE_16x16 | MB_TYPE_L0;
+ s->cur_pic.mb_type[mb_xy] = MB_TYPE_16x16 | MB_TYPE_L0;
}
// change inter to intra blocks if no reference frames are available
- if (!(s->last_pic && s->last_pic->f.data[0]) &&
- !(s->next_pic && s->next_pic->f.data[0]))
+ if (!(s->last_pic.f && s->last_pic.f->data[0]) &&
+ !(s->next_pic.f && s->next_pic.f->data[0]))
for (i = 0; i < s->mb_num; i++) {
const int mb_xy = s->mb_index2xy[i];
- if (!IS_INTRA(s->cur_pic->mb_type[mb_xy]))
- s->cur_pic->mb_type[mb_xy] = MB_TYPE_INTRA4x4;
+ if (!IS_INTRA(s->cur_pic.mb_type[mb_xy]))
+ s->cur_pic.mb_type[mb_xy] = MB_TYPE_INTRA4x4;
}
/* handle inter blocks with damaged AC */
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
const int mb_xy = mb_x + mb_y * s->mb_stride;
- const int mb_type = s->cur_pic->mb_type[mb_xy];
- const int dir = !(s->last_pic && s->last_pic->f.data[0]);
+ const int mb_type = s->cur_pic.mb_type[mb_xy];
+ const int dir = !(s->last_pic.f && s->last_pic.f->data[0]);
const int mv_dir = dir ? MV_DIR_BACKWARD : MV_DIR_FORWARD;
int mv_type;
@@ -1126,13 +1126,13 @@ void ff_er_frame_end(ERContext *s)
int j;
mv_type = MV_TYPE_8X8;
for (j = 0; j < 4; j++) {
- s->mv[0][j][0] = s->cur_pic->motion_val[dir][mb_index + (j & 1) + (j >> 1) * s->b8_stride][0];
- s->mv[0][j][1] = s->cur_pic->motion_val[dir][mb_index + (j & 1) + (j >> 1) * s->b8_stride][1];
+ s->mv[0][j][0] = s->cur_pic.motion_val[dir][mb_index + (j & 1) + (j >> 1) * s->b8_stride][0];
+ s->mv[0][j][1] = s->cur_pic.motion_val[dir][mb_index + (j & 1) + (j >> 1) * s->b8_stride][1];
}
} else {
mv_type = MV_TYPE_16X16;
- s->mv[0][0][0] = s->cur_pic->motion_val[dir][mb_x * 2 + mb_y * 2 * s->b8_stride][0];
- s->mv[0][0][1] = s->cur_pic->motion_val[dir][mb_x * 2 + mb_y * 2 * s->b8_stride][1];
+ s->mv[0][0][0] = s->cur_pic.motion_val[dir][mb_x * 2 + mb_y * 2 * s->b8_stride][0];
+ s->mv[0][0][1] = s->cur_pic.motion_val[dir][mb_x * 2 + mb_y * 2 * s->b8_stride][1];
}
s->decode_mb(s->opaque, 0 /* FIXME h264 partitioned slices need this set */,
@@ -1141,12 +1141,12 @@ void ff_er_frame_end(ERContext *s)
}
/* guess MVs */
- if (s->cur_pic->f.pict_type == AV_PICTURE_TYPE_B) {
+ if (s->cur_pic.f->pict_type == AV_PICTURE_TYPE_B) {
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
int xy = mb_x * 2 + mb_y * 2 * s->b8_stride;
const int mb_xy = mb_x + mb_y * s->mb_stride;
- const int mb_type = s->cur_pic->mb_type[mb_xy];
+ const int mb_type = s->cur_pic.mb_type[mb_xy];
int mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
error = s->error_status_table[mb_xy];
@@ -1158,9 +1158,9 @@ void ff_er_frame_end(ERContext *s)
if (!(error & ER_AC_ERROR))
continue; // undamaged inter
- if (!(s->last_pic && s->last_pic->f.data[0]))
+ if (!(s->last_pic.f && s->last_pic.f->data[0]))
mv_dir &= ~MV_DIR_FORWARD;
- if (!(s->next_pic && s->next_pic->f.data[0]))
+ if (!(s->next_pic.f && s->next_pic.f->data[0]))
mv_dir &= ~MV_DIR_BACKWARD;
if (s->pp_time) {
@@ -1168,12 +1168,12 @@ void ff_er_frame_end(ERContext *s)
int time_pb = s->pb_time;
av_assert0(s->avctx->codec_id != AV_CODEC_ID_H264);
- ff_thread_await_progress(&s->next_pic->tf, mb_y, 0);
+ ff_thread_await_progress(s->next_pic.tf, mb_y, 0);
- s->mv[0][0][0] = s->next_pic->motion_val[0][xy][0] * time_pb / time_pp;
- s->mv[0][0][1] = s->next_pic->motion_val[0][xy][1] * time_pb / time_pp;
- s->mv[1][0][0] = s->next_pic->motion_val[0][xy][0] * (time_pb - time_pp) / time_pp;
- s->mv[1][0][1] = s->next_pic->motion_val[0][xy][1] * (time_pb - time_pp) / time_pp;
+ s->mv[0][0][0] = s->next_pic.motion_val[0][xy][0] * time_pb / time_pp;
+ s->mv[0][0][1] = s->next_pic.motion_val[0][xy][1] * time_pb / time_pp;
+ s->mv[1][0][0] = s->next_pic.motion_val[0][xy][0] * (time_pb - time_pp) / time_pp;
+ s->mv[1][0][1] = s->next_pic.motion_val[0][xy][1] * (time_pb - time_pp) / time_pp;
} else {
s->mv[0][0][0] = 0;
s->mv[0][0][1] = 0;
@@ -1188,13 +1188,9 @@ void ff_er_frame_end(ERContext *s)
} else
guess_mv(s);
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
- /* the filters below are not XvMC compatible, skip them */
- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
+ /* the filters below manipulate raw image, skip them */
+ if (CONFIG_XVMC && s->avctx->hwaccel && s->avctx->hwaccel->decode_mb)
goto ec_clean;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
/* fill DC for inter blocks */
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
@@ -1202,7 +1198,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
int16_t *dc_ptr;
uint8_t *dest_y, *dest_cb, *dest_cr;
const int mb_xy = mb_x + mb_y * s->mb_stride;
- const int mb_type = s->cur_pic->mb_type[mb_xy];
+ const int mb_type = s->cur_pic.mb_type[mb_xy];
error = s->error_status_table[mb_xy];
@@ -1211,9 +1207,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
// if (error & ER_MV_ERROR)
// continue; // inter data damaged FIXME is this good?
- dest_y = s->cur_pic->f.data[0] + mb_x * 16 + mb_y * 16 * linesize[0];
- dest_cb = s->cur_pic->f.data[1] + mb_x * 8 + mb_y * 8 * linesize[1];
- dest_cr = s->cur_pic->f.data[2] + mb_x * 8 + mb_y * 8 * linesize[2];
+ dest_y = s->cur_pic.f->data[0] + mb_x * 16 + mb_y * 16 * linesize[0];
+ dest_cb = s->cur_pic.f->data[1] + mb_x * 8 + mb_y * 8 * linesize[1];
+ dest_cr = s->cur_pic.f->data[2] + mb_x * 8 + mb_y * 8 * linesize[2];
dc_ptr = &s->dc_val[0][mb_x * 2 + mb_y * 2 * s->b8_stride];
for (n = 0; n < 4; n++) {
@@ -1255,7 +1251,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
uint8_t *dest_y, *dest_cb, *dest_cr;
const int mb_xy = mb_x + mb_y * s->mb_stride;
- const int mb_type = s->cur_pic->mb_type[mb_xy];
+ const int mb_type = s->cur_pic.mb_type[mb_xy];
error = s->error_status_table[mb_xy];
@@ -1264,9 +1260,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!(error & ER_AC_ERROR))
continue; // undamaged
- dest_y = s->cur_pic->f.data[0] + mb_x * 16 + mb_y * 16 * linesize[0];
- dest_cb = s->cur_pic->f.data[1] + mb_x * 8 + mb_y * 8 * linesize[1];
- dest_cr = s->cur_pic->f.data[2] + mb_x * 8 + mb_y * 8 * linesize[2];
+ dest_y = s->cur_pic.f->data[0] + mb_x * 16 + mb_y * 16 * linesize[0];
+ dest_cb = s->cur_pic.f->data[1] + mb_x * 8 + mb_y * 8 * linesize[1];
+ dest_cr = s->cur_pic.f->data[2] + mb_x * 8 + mb_y * 8 * linesize[2];
put_dc(s, dest_y, dest_cb, dest_cr, mb_x, mb_y);
}
@@ -1275,19 +1271,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (s->avctx->error_concealment & FF_EC_DEBLOCK) {
/* filter horizontal block boundaries */
- h_block_filter(s, s->cur_pic->f.data[0], s->mb_width * 2,
+ h_block_filter(s, s->cur_pic.f->data[0], s->mb_width * 2,
s->mb_height * 2, linesize[0], 1);
- h_block_filter(s, s->cur_pic->f.data[1], s->mb_width,
+ h_block_filter(s, s->cur_pic.f->data[1], s->mb_width,
s->mb_height, linesize[1], 0);
- h_block_filter(s, s->cur_pic->f.data[2], s->mb_width,
+ h_block_filter(s, s->cur_pic.f->data[2], s->mb_width,
s->mb_height, linesize[2], 0);
/* filter vertical block boundaries */
- v_block_filter(s, s->cur_pic->f.data[0], s->mb_width * 2,
+ v_block_filter(s, s->cur_pic.f->data[0], s->mb_width * 2,
s->mb_height * 2, linesize[0], 1);
- v_block_filter(s, s->cur_pic->f.data[1], s->mb_width,
+ v_block_filter(s, s->cur_pic.f->data[1], s->mb_width,
s->mb_height, linesize[1], 0);
- v_block_filter(s, s->cur_pic->f.data[2], s->mb_width,
+ v_block_filter(s, s->cur_pic.f->data[2], s->mb_width,
s->mb_height, linesize[2], 0);
}
@@ -1297,13 +1293,21 @@ ec_clean:
const int mb_xy = s->mb_index2xy[i];
int error = s->error_status_table[mb_xy];
- if (s->cur_pic->f.pict_type != AV_PICTURE_TYPE_B &&
+ if (s->cur_pic.f->pict_type != AV_PICTURE_TYPE_B &&
(error & (ER_DC_ERROR | ER_MV_ERROR | ER_AC_ERROR))) {
s->mbskip_table[mb_xy] = 0;
}
s->mbintra_table[mb_xy] = 1;
}
- s->cur_pic = NULL;
- s->next_pic = NULL;
- s->last_pic = NULL;
+
+ for (i = 0; i < 2; i++) {
+ av_buffer_unref(&s->ref_index_buf[i]);
+ av_buffer_unref(&s->motion_val_buf[i]);
+ s->cur_pic.ref_index[i] = NULL;
+ s->cur_pic.motion_val[i] = NULL;
+ }
+
+ memset(&s->cur_pic, 0, sizeof(ERPicture));
+ memset(&s->last_pic, 0, sizeof(ERPicture));
+ memset(&s->next_pic, 0, sizeof(ERPicture));
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/error_resilience.h b/chromium/third_party/ffmpeg/libavcodec/error_resilience.h
index 970fdc20665..9d227e87a15 100644
--- a/chromium/third_party/ffmpeg/libavcodec/error_resilience.h
+++ b/chromium/third_party/ffmpeg/libavcodec/error_resilience.h
@@ -24,6 +24,7 @@
#include "avcodec.h"
#include "dsputil.h"
+#include "thread.h"
///< current MB is the first after a resync marker
#define VP_START 1
@@ -37,6 +38,18 @@
#define ER_MB_ERROR (ER_AC_ERROR|ER_DC_ERROR|ER_MV_ERROR)
#define ER_MB_END (ER_AC_END|ER_DC_END|ER_MV_END)
+typedef struct ERPicture {
+ AVFrame *f;
+ ThreadFrame *tf;
+
+ // it's the caller's responsibility to allocate these buffers
+ int16_t (*motion_val[2])[2];
+ int8_t *ref_index[2];
+
+ uint32_t *mb_type;
+ int field_picture;
+} ERPicture;
+
typedef struct ERContext {
AVCodecContext *avctx;
DSPContext *dsp;
@@ -55,9 +68,12 @@ typedef struct ERContext {
uint8_t *mbintra_table;
int mv[2][4][2];
- struct Picture *cur_pic;
- struct Picture *last_pic;
- struct Picture *next_pic;
+ ERPicture cur_pic;
+ ERPicture last_pic;
+ ERPicture next_pic;
+
+ AVBufferRef *ref_index_buf[2];
+ AVBufferRef *motion_val_buf[2];
uint16_t pp_time;
uint16_t pb_time;
diff --git a/chromium/third_party/ffmpeg/libavcodec/evrcdata.h b/chromium/third_party/ffmpeg/libavcodec/evrcdata.h
index cde1f571d8a..ebcb0ac99f4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/evrcdata.h
+++ b/chromium/third_party/ffmpeg/libavcodec/evrcdata.h
@@ -1437,21 +1437,21 @@ static const float evrc_lspq_quant_codebook2[16][5] = {
{0.22787990, 0.31779197, 0.33831909, 0.40044111, 0.41185561},
{0.27896860, 0.32261974, 0.35658112, 0.40206763, 0.42370448}};
-static const float const *evrc_lspq_full_codebooks[] = {
+static const float * const evrc_lspq_full_codebooks[] = {
evrc_lspq_full_codebook1[0], evrc_lspq_full_codebook2[0],
evrc_lspq_full_codebook3[0], evrc_lspq_full_codebook4[0],
};
-static const float const *evrc_lspq_half_codebooks[] = {
+static const float * const evrc_lspq_half_codebooks[] = {
evrc_lspq_half_codebook1[0], evrc_lspq_half_codebook2[0],
evrc_lspq_half_codebook3[0],
};
-static const float const *evrc_lspq_quant_codebooks[] = {
+static const float * const evrc_lspq_quant_codebooks[] = {
evrc_lspq_quant_codebook1[0], evrc_lspq_quant_codebook2[0],
};
-static const float const **evrc_lspq_codebooks[] = {
+static const float * const *evrc_lspq_codebooks[] = {
0,
evrc_lspq_quant_codebooks,
0,
diff --git a/chromium/third_party/ffmpeg/libavcodec/evrcdec.c b/chromium/third_party/ffmpeg/libavcodec/evrcdec.c
index 51ae9e21ffb..20d0fe7cd42 100644
--- a/chromium/third_party/ffmpeg/libavcodec/evrcdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/evrcdec.c
@@ -276,7 +276,7 @@ static av_cold int evrc_decode_init(AVCodecContext *avctx)
*/
static int decode_lspf(EVRCContext *e)
{
- const float **codebooks = evrc_lspq_codebooks[e->bitrate];
+ const float * const *codebooks = evrc_lspq_codebooks[e->bitrate];
int i, j, k = 0;
for (i = 0; i < evrc_lspq_nb_codebooks[e->bitrate]; i++) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/exif.c b/chromium/third_party/ffmpeg/libavcodec/exif.c
index 96464261c10..a980da2a7be 100644
--- a/chromium/third_party/ffmpeg/libavcodec/exif.c
+++ b/chromium/third_party/ffmpeg/libavcodec/exif.c
@@ -48,9 +48,11 @@ static int exif_add_metadata(AVCodecContext *avctx, int count, int type,
{
switch(type) {
case TIFF_DOUBLE : return ff_tadd_doubles_metadata(count, name, sep, gb, le, metadata);
- case TIFF_SHORT : return ff_tadd_shorts_metadata(count, name, sep, gb, le, metadata);
+ case TIFF_SSHORT : return ff_tadd_shorts_metadata(count, name, sep, gb, le, 1, metadata);
+ case TIFF_SHORT : return ff_tadd_shorts_metadata(count, name, sep, gb, le, 0, metadata);
+ case TIFF_SBYTE : return ff_tadd_bytes_metadata(count, name, sep, gb, le, 1, metadata);
case TIFF_BYTE :
- case TIFF_UNDEFINED: return ff_tadd_bytes_metadata(count, name, sep, gb, le, metadata);
+ case TIFF_UNDEFINED: return ff_tadd_bytes_metadata(count, name, sep, gb, le, 0, metadata);
case TIFF_STRING : return ff_tadd_string_metadata(count, name, gb, le, metadata);
case TIFF_SRATIONAL:
case TIFF_RATIONAL : return ff_tadd_rational_metadata(count, name, sep, gb, le, metadata);
@@ -76,11 +78,16 @@ static int exif_decode_tag(AVCodecContext *avctx, GetByteContext *gbytes, int le
ff_tread_tag(gbytes, le, &id, &type, &count, &cur_pos);
+ if (!bytestream2_tell(gbytes)) {
+ bytestream2_seek(gbytes, cur_pos, SEEK_SET);
+ return 0;
+ }
+
// read count values and add it metadata
// store metadata or proceed with next IFD
ret = ff_tis_ifd(id);
if (ret) {
- ret = ff_exif_decode_ifd(avctx, gbytes, le, depth + 1, metadata);
+ ret = avpriv_exif_decode_ifd(avctx, gbytes, le, depth + 1, metadata);
} else {
const char *name = exif_get_tag_name(id);
char *use_name = (char*) name;
@@ -107,8 +114,8 @@ static int exif_decode_tag(AVCodecContext *avctx, GetByteContext *gbytes, int le
}
-int ff_exif_decode_ifd(AVCodecContext *avctx, GetByteContext *gbytes, int le,
- int depth, AVDictionary **metadata)
+int avpriv_exif_decode_ifd(AVCodecContext *avctx, GetByteContext *gbytes, int le,
+ int depth, AVDictionary **metadata)
{
int i, ret;
int entries;
diff --git a/chromium/third_party/ffmpeg/libavcodec/exif.h b/chromium/third_party/ffmpeg/libavcodec/exif.h
index 71fe8292e13..2f509ba1e9c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/exif.h
+++ b/chromium/third_party/ffmpeg/libavcodec/exif.h
@@ -164,7 +164,7 @@ static const struct exif_tag tag_list[] = { // JEITA CP-3451 EXIF specification:
/** Recursively decodes all IFD's and
* adds included TAGS into the metadata dictionary. */
-int ff_exif_decode_ifd(AVCodecContext *avctx, GetByteContext *gbytes, int le,
- int depth, AVDictionary **metadata);
+int avpriv_exif_decode_ifd(AVCodecContext *avctx, GetByteContext *gbytes, int le,
+ int depth, AVDictionary **metadata);
#endif /* AVCODEC_EXIF_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/exr.c b/chromium/third_party/ffmpeg/libavcodec/exr.c
index f231b703750..6ade66cb39d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/exr.c
+++ b/chromium/third_party/ffmpeg/libavcodec/exr.c
@@ -27,39 +27,46 @@
* For more information on the OpenEXR format, visit:
* http://openexr.com/
*
- * exr_flt2uint() and exr_halflt2uint() is credited to Reimar Döffinger
+ * exr_flt2uint() and exr_halflt2uint() is credited to Reimar Döffinger.
+ * exr_half2float() is credited to Aaftab Munshi; Dan Ginsburg, Dave Shreiner.
+ *
*/
#include <zlib.h>
+#include <float.h>
+
+#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
+#include "libavutil/intfloat.h"
-#include "get_bits.h"
#include "avcodec.h"
#include "bytestream.h"
+#include "get_bits.h"
#include "internal.h"
#include "mathops.h"
#include "thread.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/avassert.h"
enum ExrCompr {
- EXR_RAW = 0,
- EXR_RLE = 1,
- EXR_ZIP1 = 2,
- EXR_ZIP16 = 3,
- EXR_PIZ = 4,
- EXR_PXR24 = 5,
- EXR_B44 = 6,
- EXR_B44A = 7,
+ EXR_RAW,
+ EXR_RLE,
+ EXR_ZIP1,
+ EXR_ZIP16,
+ EXR_PIZ,
+ EXR_PXR24,
+ EXR_B44,
+ EXR_B44A,
+ EXR_UNKN,
};
enum ExrPixelType {
EXR_UINT,
EXR_HALF,
- EXR_FLOAT
+ EXR_FLOAT,
+ EXR_UNKNOWN,
};
typedef struct EXRChannel {
- int xsub, ysub;
+ int xsub, ysub;
enum ExrPixelType pixel_type;
} EXRChannel;
@@ -75,35 +82,108 @@ typedef struct EXRThreadData {
} EXRThreadData;
typedef struct EXRContext {
+ AVClass *class;
AVFrame *picture;
- int compr;
+ AVCodecContext *avctx;
+
+ enum ExrCompr compression;
enum ExrPixelType pixel_type;
int channel_offsets[4]; // 0 = red, 1 = green, 2 = blue and 3 = alpha
const AVPixFmtDescriptor *desc;
+ int w, h;
uint32_t xmax, xmin;
uint32_t ymax, ymin;
uint32_t xdelta, ydelta;
-
int ysize;
uint64_t scan_line_size;
int scan_lines_per_block;
- const uint8_t *buf, *table;
+ GetByteContext gb;
+ const uint8_t *buf;
int buf_size;
EXRChannel *channels;
int nb_channels;
EXRThreadData *thread_data;
- int thread_data_size;
+
+ const char *layer;
+
+ float gamma;
+
+ uint16_t gamma_table[65536];
+
} EXRContext;
+/* -15 stored using a single precision bias of 127 */
+#define HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP 0x38000000
+/* max exponent value in single precision that will be converted
+ * to Inf or Nan when stored as a half-float */
+#define HALF_FLOAT_MAX_BIASED_EXP_AS_SINGLE_FP_EXP 0x47800000
+
+/* 255 is the max exponent biased value */
+#define FLOAT_MAX_BIASED_EXP (0xFF << 23)
+
+#define HALF_FLOAT_MAX_BIASED_EXP (0x1F << 10)
+
+/*
+ * Convert a half float as a uint16_t into a full float.
+ *
+ * @param hf half float as uint16_t
+ *
+ * @return float value
+ */
+static union av_intfloat32 exr_half2float(uint16_t hf)
+{
+ unsigned int sign = (unsigned int)(hf >> 15);
+ unsigned int mantissa = (unsigned int)(hf & ((1 << 10) - 1));
+ unsigned int exp = (unsigned int)(hf & HALF_FLOAT_MAX_BIASED_EXP);
+ union av_intfloat32 f;
+
+ if (exp == HALF_FLOAT_MAX_BIASED_EXP) {
+ // we have a half-float NaN or Inf
+ // half-float NaNs will be converted to a single precision NaN
+ // half-float Infs will be converted to a single precision Inf
+ exp = FLOAT_MAX_BIASED_EXP;
+ if (mantissa)
+ mantissa = (1 << 23) - 1; // set all bits to indicate a NaN
+ } else if (exp == 0x0) {
+ // convert half-float zero/denorm to single precision value
+ if (mantissa) {
+ mantissa <<= 1;
+ exp = HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP;
+ // check for leading 1 in denorm mantissa
+ while ((mantissa & (1 << 10))) {
+ // for every leading 0, decrement single precision exponent by 1
+ // and shift half-float mantissa value to the left
+ mantissa <<= 1;
+ exp -= (1 << 23);
+ }
+ // clamp the mantissa to 10-bits
+ mantissa &= ((1 << 10) - 1);
+ // shift left to generate single-precision mantissa of 23-bits
+ mantissa <<= 13;
+ }
+ } else {
+ // shift left to generate single-precision mantissa of 23-bits
+ mantissa <<= 13;
+ // generate single precision biased exponent value
+ exp = (exp << 13) + HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP;
+ }
+
+ f.i = (sign << 31) | exp | mantissa;
+
+ return f;
+}
+
+
/**
- * Converts from 32-bit float as uint32_t to uint16_t
+ * Convert from 32-bit float as uint32_t to uint16_t.
*
* @param v 32-bit float
+ *
* @return normalized 16-bit unsigned int
*/
static inline uint16_t exr_flt2uint(uint32_t v)
@@ -111,7 +191,7 @@ static inline uint16_t exr_flt2uint(uint32_t v)
unsigned int exp = v >> 23;
// "HACK": negative values result in exp< 0, so clipping them to 0
// is also handled by this condition, avoids explicit check for sign bit.
- if (exp<= 127 + 7 - 24) // we would shift out all bits anyway
+ if (exp <= 127 + 7 - 24) // we would shift out all bits anyway
return 0;
if (exp >= 127)
return 0xffff;
@@ -120,83 +200,32 @@ static inline uint16_t exr_flt2uint(uint32_t v)
}
/**
- * Converts from 16-bit float as uint16_t to uint16_t
+ * Convert from 16-bit float as uint16_t to uint16_t.
*
* @param v 16-bit float
+ *
* @return normalized 16-bit unsigned int
*/
static inline uint16_t exr_halflt2uint(uint16_t v)
{
unsigned exp = 14 - (v >> 10);
if (exp >= 14) {
- if (exp == 14) return (v >> 9) & 1;
- else return (v & 0x8000) ? 0 : 0xffff;
+ if (exp == 14)
+ return (v >> 9) & 1;
+ else
+ return (v & 0x8000) ? 0 : 0xffff;
}
v <<= 6;
return (v + (1 << 16)) >> (exp + 1);
}
-/**
- * Gets the size of the header variable
- *
- * @param **buf the current pointer location in the header where
- * the variable data starts
- * @param *buf_end pointer location of the end of the buffer
- * @return size of variable data
- */
-static unsigned int get_header_variable_length(const uint8_t **buf,
- const uint8_t *buf_end)
-{
- unsigned int variable_buffer_data_size = bytestream_get_le32(buf);
- if (variable_buffer_data_size >= buf_end - *buf)
- return 0;
- return variable_buffer_data_size;
-}
-
-/**
- * Checks if the variable name corresponds with it's data type
- *
- * @param *avctx the AVCodecContext
- * @param **buf the current pointer location in the header where
- * the variable name starts
- * @param *buf_end pointer location of the end of the buffer
- * @param *value_name name of the varible to check
- * @param *value_type type of the varible to check
- * @param minimum_length minimum length of the variable data
- * @param variable_buffer_data_size variable length read from the header
- * after it's checked
- * @return negative if variable is invalid
- */
-static int check_header_variable(AVCodecContext *avctx,
- const uint8_t **buf,
- const uint8_t *buf_end,
- const char *value_name,
- const char *value_type,
- unsigned int minimum_length,
- unsigned int *variable_buffer_data_size)
-{
- if (buf_end - *buf >= minimum_length && !strcmp(*buf, value_name)) {
- *buf += strlen(value_name)+1;
- if (!strcmp(*buf, value_type)) {
- *buf += strlen(value_type)+1;
- *variable_buffer_data_size = get_header_variable_length(buf, buf_end);
- if (!*variable_buffer_data_size)
- av_log(avctx, AV_LOG_ERROR, "Incomplete header\n");
- return 1;
- }
- *buf -= strlen(value_name)+1;
- av_log(avctx, AV_LOG_WARNING, "Unknown data type for header variable %s\n", value_name);
- }
- return -1;
-}
-
static void predictor(uint8_t *src, int size)
{
- uint8_t *t = src + 1;
+ uint8_t *t = src + 1;
uint8_t *stop = src + size;
while (t < stop) {
- int d = (int)t[-1] + (int)t[0] - 128;
+ int d = (int) t[-1] + (int) t[0] - 128;
t[0] = d;
++t;
}
@@ -206,8 +235,8 @@ static void reorder_pixels(uint8_t *src, uint8_t *dst, int size)
{
const int8_t *t1 = src;
const int8_t *t2 = src + (size + 1) / 2;
- int8_t *s = dst;
- int8_t *stop = s + size;
+ int8_t *s = dst;
+ int8_t *stop = s + size;
while (1) {
if (s < stop)
@@ -229,7 +258,7 @@ static int zip_uncompress(const uint8_t *src, int compressed_size,
if (uncompress(td->tmp, &dest_len, src, compressed_size) != Z_OK ||
dest_len != uncompressed_size)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
predictor(td->tmp, uncompressed_size);
reorder_pixels(td->tmp, td->uncompressed_data, uncompressed_size);
@@ -240,11 +269,11 @@ static int zip_uncompress(const uint8_t *src, int compressed_size,
static int rle_uncompress(const uint8_t *src, int compressed_size,
int uncompressed_size, EXRThreadData *td)
{
- int8_t *d = (int8_t *)td->tmp;
- const int8_t *s = (const int8_t *)src;
- int ssize = compressed_size;
- int dsize = uncompressed_size;
- int8_t *dend = d + dsize;
+ uint8_t *d = td->tmp;
+ const int8_t *s = src;
+ int ssize = compressed_size;
+ int dsize = uncompressed_size;
+ uint8_t *dend = d + dsize;
int count;
while (ssize > 0) {
@@ -253,9 +282,9 @@ static int rle_uncompress(const uint8_t *src, int compressed_size,
if (count < 0) {
count = -count;
- if ((dsize -= count ) < 0 ||
+ if ((dsize -= count) < 0 ||
(ssize -= count + 1) < 0)
- return -1;
+ return AVERROR_INVALIDDATA;
while (count--)
*d++ = *s++;
@@ -263,8 +292,8 @@ static int rle_uncompress(const uint8_t *src, int compressed_size,
count++;
if ((dsize -= count) < 0 ||
- (ssize -= 2 ) < 0)
- return -1;
+ (ssize -= 2) < 0)
+ return AVERROR_INVALIDDATA;
while (count--)
*d++ = *s;
@@ -283,16 +312,15 @@ static int rle_uncompress(const uint8_t *src, int compressed_size,
}
#define USHORT_RANGE (1 << 16)
-#define BITMAP_SIZE (1 << 13)
+#define BITMAP_SIZE (1 << 13)
static uint16_t reverse_lut(const uint8_t *bitmap, uint16_t *lut)
{
int i, k = 0;
- for (i = 0; i < USHORT_RANGE; i++) {
+ for (i = 0; i < USHORT_RANGE; i++)
if ((i == 0) || (bitmap[i >> 3] & (1 << (i & 7))))
lut[k++] = i;
- }
i = k - 1;
@@ -313,7 +341,7 @@ static void apply_lut(const uint16_t *lut, uint16_t *dst, int dsize)
#define HUF_DECBITS 14 // decoding bit size (>= 8)
#define HUF_ENCSIZE ((1 << HUF_ENCBITS) + 1) // encoding table size
-#define HUF_DECSIZE (1 << HUF_DECBITS) // decoding table size
+#define HUF_DECSIZE (1 << HUF_DECBITS) // decoding table size
#define HUF_DECMASK (HUF_DECSIZE - 1)
typedef struct HufDec {
@@ -334,7 +362,7 @@ static void huf_canonical_code_table(uint64_t *hcode)
for (i = 58; i > 0; --i) {
uint64_t nc = ((c + n[i]) >> 1);
n[i] = c;
- c = nc;
+ c = nc;
}
for (i = 0; i < HUF_ENCSIZE; ++i) {
@@ -370,7 +398,7 @@ static int huf_unpack_enc_table(GetByteContext *gb,
hcode[im++] = 0;
im--;
- } else if (l >= (uint64_t) SHORT_ZEROCODE_RUN) {
+ } else if (l >= SHORT_ZEROCODE_RUN) {
int zerun = l - SHORT_ZEROCODE_RUN + 2;
if (im + zerun > iM + 1)
@@ -406,7 +434,7 @@ static int huf_build_dec_table(const uint64_t *hcode, int im,
pl->lit++;
- pl->p = av_realloc_f(pl->p, pl->lit, sizeof(int));
+ pl->p = av_realloc(pl->p, pl->lit * sizeof(int));
if (!pl->p)
return AVERROR(ENOMEM);
@@ -426,40 +454,42 @@ static int huf_build_dec_table(const uint64_t *hcode, int im,
return 0;
}
-#define get_char(c, lc, gb) { \
- c = (c << 8) | bytestream2_get_byte(gb); \
- lc += 8; \
+#define get_char(c, lc, gb) \
+{ \
+ c = (c << 8) | bytestream2_get_byte(gb); \
+ lc += 8; \
}
-#define get_code(po, rlc, c, lc, gb, out, oe) { \
- if (po == rlc) { \
- if (lc < 8) \
- get_char(c, lc, gb); \
- lc -= 8; \
- \
- cs = c >> lc; \
- \
- if (out + cs > oe) \
- return AVERROR_INVALIDDATA; \
- \
- s = out[-1]; \
- \
- while (cs-- > 0) \
- *out++ = s; \
- } else if (out < oe) { \
- *out++ = po; \
- } else { \
- return AVERROR_INVALIDDATA; \
- } \
+#define get_code(po, rlc, c, lc, gb, out, oe) \
+{ \
+ if (po == rlc) { \
+ if (lc < 8) \
+ get_char(c, lc, gb); \
+ lc -= 8; \
+ \
+ cs = c >> lc; \
+ \
+ if (out + cs > oe) \
+ return AVERROR_INVALIDDATA; \
+ \
+ s = out[-1]; \
+ \
+ while (cs-- > 0) \
+ *out++ = s; \
+ } else if (out < oe) { \
+ *out++ = po; \
+ } else { \
+ return AVERROR_INVALIDDATA; \
+ } \
}
static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
GetByteContext *gb, int nbits,
int rlc, int no, uint16_t *out)
{
- uint64_t c = 0;
- uint16_t *outb = out;
- uint16_t *oe = out + no;
+ uint64_t c = 0;
+ uint16_t *outb = out;
+ uint16_t *oe = out + no;
const uint8_t *ie = gb->buffer + (nbits + 7) / 8; // input byte size
uint8_t cs, s;
int i, lc = 0;
@@ -468,7 +498,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
get_char(c, lc, gb);
while (lc >= HUF_DECBITS) {
- const HufDec pl = hdecod[(c >> (lc-HUF_DECBITS)) & HUF_DECMASK];
+ const HufDec pl = hdecod[(c >> (lc - HUF_DECBITS)) & HUF_DECMASK];
if (pl.len) {
lc -= pl.len;
@@ -501,7 +531,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
}
}
- i = (8 - nbits) & 7;
+ i = (8 - nbits) & 7;
c >>= i;
lc -= i;
@@ -531,8 +561,8 @@ static int huf_uncompress(GetByteContext *gb,
int ret, i;
src_size = bytestream2_get_le32(gb);
- im = bytestream2_get_le32(gb);
- iM = bytestream2_get_le32(gb);
+ im = bytestream2_get_le32(gb);
+ iM = bytestream2_get_le32(gb);
bytestream2_skip(gb, 4);
nBits = bytestream2_get_le32(gb);
if (im < 0 || im >= HUF_ENCSIZE ||
@@ -542,8 +572,8 @@ static int huf_uncompress(GetByteContext *gb,
bytestream2_skip(gb, 4);
- freq = av_calloc(HUF_ENCSIZE, sizeof(*freq));
- hdec = av_calloc(HUF_DECSIZE, sizeof(*hdec));
+ freq = av_mallocz_array(HUF_ENCSIZE, sizeof(*freq));
+ hdec = av_mallocz_array(HUF_DECSIZE, sizeof(*hdec));
if (!freq || !hdec) {
ret = AVERROR(ENOMEM);
goto fail;
@@ -562,10 +592,9 @@ static int huf_uncompress(GetByteContext *gb,
ret = huf_decode(freq, hdec, gb, nBits, iM, dst_size, dst);
fail:
- for (i = 0; i < HUF_DECSIZE; i++) {
+ for (i = 0; i < HUF_DECSIZE; i++)
if (hdec)
av_freep(&hdec[i].p);
- }
av_free(freq);
av_free(hdec);
@@ -577,8 +606,8 @@ static inline void wdec14(uint16_t l, uint16_t h, uint16_t *a, uint16_t *b)
{
int16_t ls = l;
int16_t hs = h;
- int hi = hs;
- int ai = ls + (hi & 1) + (hi >> 1);
+ int hi = hs;
+ int ai = ls + (hi & 1) + (hi >> 1);
int16_t as = ai;
int16_t bs = ai - hi;
@@ -587,13 +616,13 @@ static inline void wdec14(uint16_t l, uint16_t h, uint16_t *a, uint16_t *b)
}
#define NBITS 16
-#define A_OFFSET (1 << (NBITS - 1))
+#define A_OFFSET (1 << (NBITS - 1))
#define MOD_MASK ((1 << NBITS) - 1)
static inline void wdec16(uint16_t l, uint16_t h, uint16_t *a, uint16_t *b)
{
- int m = l;
- int d = h;
+ int m = l;
+ int d = h;
int bb = (m - (d >> 1)) & MOD_MASK;
int aa = (d + bb - A_OFFSET) & MOD_MASK;
*b = bb;
@@ -604,8 +633,8 @@ static void wav_decode(uint16_t *in, int nx, int ox,
int ny, int oy, uint16_t mx)
{
int w14 = (mx < (1 << 14));
- int n = (nx > ny) ? ny: nx;
- int p = 1;
+ int n = (nx > ny) ? ny : nx;
+ int p = 1;
int p2;
while (p <= n)
@@ -629,19 +658,19 @@ static void wav_decode(uint16_t *in, int nx, int ox,
uint16_t *ex = py + ox * (nx - p2);
for (; px <= ex; px += ox2) {
- uint16_t *p01 = px + ox1;
- uint16_t *p10 = px + oy1;
+ uint16_t *p01 = px + ox1;
+ uint16_t *p10 = px + oy1;
uint16_t *p11 = p10 + ox1;
if (w14) {
- wdec14(*px, *p10, &i00, &i10);
+ wdec14(*px, *p10, &i00, &i10);
wdec14(*p01, *p11, &i01, &i11);
- wdec14(i00, i01, px, p01);
+ wdec14(i00, i01, px, p01);
wdec14(i10, i11, p10, p11);
} else {
- wdec16(*px, *p10, &i00, &i10);
+ wdec16(*px, *p10, &i00, &i10);
wdec16(*p01, *p11, &i01, &i11);
- wdec16(i00, i01, px, p01);
+ wdec16(i00, i01, px, p01);
wdec16(i10, i11, p10, p11);
}
}
@@ -674,25 +703,30 @@ static void wav_decode(uint16_t *in, int nx, int ox,
}
}
- p2 = p;
+ p2 = p;
p >>= 1;
}
}
-static int piz_uncompress(EXRContext *s, const uint8_t *src, int ssize, int dsize, EXRThreadData *td)
+static int piz_uncompress(EXRContext *s, const uint8_t *src, int ssize,
+ int dsize, EXRThreadData *td)
{
GetByteContext gb;
uint16_t maxval, min_non_zero, max_non_zero;
- uint16_t *ptr, *tmp = (uint16_t *)td->tmp;
- int8_t *out;
+ uint16_t *ptr;
+ uint16_t *tmp = (uint16_t *)td->tmp;
+ uint8_t *out;
int ret, i, j;
if (!td->bitmap)
td->bitmap = av_malloc(BITMAP_SIZE);
if (!td->lut)
td->lut = av_malloc(1 << 17);
- if (!td->bitmap || !td->lut)
+ if (!td->bitmap || !td->lut) {
+ av_freep(&td->bitmap);
+ av_freep(&td->lut);
return AVERROR(ENOMEM);
+ }
bytestream2_init(&gb, src, ssize);
min_non_zero = bytestream2_get_le16(&gb);
@@ -709,7 +743,7 @@ static int piz_uncompress(EXRContext *s, const uint8_t *src, int ssize, int dsiz
maxval = reverse_lut(td->bitmap, td->lut);
- ret = huf_uncompress(&gb, tmp, dsize / sizeof(int16_t));
+ ret = huf_uncompress(&gb, tmp, dsize / sizeof(uint16_t));
if (ret)
return ret;
@@ -719,20 +753,20 @@ static int piz_uncompress(EXRContext *s, const uint8_t *src, int ssize, int dsiz
int size = channel->pixel_type;
for (j = 0; j < size; j++)
- wav_decode(ptr + j, s->xdelta, size, s->ysize, s->xdelta * size, maxval);
+ wav_decode(ptr + j, s->xdelta, size, s->ysize,
+ s->xdelta * size, maxval);
ptr += s->xdelta * s->ysize * size;
}
- apply_lut(td->lut, tmp, dsize / sizeof(int16_t));
+ apply_lut(td->lut, tmp, dsize / sizeof(uint16_t));
out = td->uncompressed_data;
- for (i = 0; i < s->ysize; i++) {
+ for (i = 0; i < s->ysize; i++)
for (j = 0; j < s->nb_channels; j++) {
uint16_t *in = tmp + j * s->xdelta * s->ysize + i * s->xdelta;
memcpy(out, in, s->xdelta * 2);
out += s->xdelta * 2;
}
- }
return 0;
}
@@ -748,10 +782,10 @@ static int pxr24_uncompress(EXRContext *s, const uint8_t *src,
if (uncompress(td->tmp, &dest_len, src, compressed_size) != Z_OK ||
dest_len != uncompressed_size)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
out = td->uncompressed_data;
- for (i = 0; i < s->ysize; i++) {
+ for (i = 0; i < s->ysize; i++)
for (c = 0; c < s->nb_channels; c++) {
EXRChannel *channel = &s->channels[c];
const uint8_t *ptr[4];
@@ -762,12 +796,12 @@ static int pxr24_uncompress(EXRContext *s, const uint8_t *src,
ptr[0] = in;
ptr[1] = ptr[0] + s->xdelta;
ptr[2] = ptr[1] + s->xdelta;
- in = ptr[2] + s->xdelta;
+ in = ptr[2] + s->xdelta;
for (j = 0; j < s->xdelta; ++j) {
uint32_t diff = (*(ptr[0]++) << 24) |
(*(ptr[1]++) << 16) |
- (*(ptr[2]++) << 8);
+ (*(ptr[2]++) << 8);
pixel += diff;
bytestream_put_le32(&out, pixel);
}
@@ -775,7 +809,7 @@ static int pxr24_uncompress(EXRContext *s, const uint8_t *src,
case EXR_HALF:
ptr[0] = in;
ptr[1] = ptr[0] + s->xdelta;
- in = ptr[1] + s->xdelta;
+ in = ptr[1] + s->xdelta;
for (j = 0; j < s->xdelta; j++) {
uint32_t diff = (*(ptr[0]++) << 8) | *(ptr[1]++);
@@ -784,10 +818,9 @@ static int pxr24_uncompress(EXRContext *s, const uint8_t *src,
}
break;
default:
- av_assert1(0);
+ return AVERROR_INVALIDDATA;
}
}
- }
return 0;
}
@@ -804,19 +837,20 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
uint32_t xdelta = s->xdelta;
uint16_t *ptr_x;
uint8_t *ptr;
- int32_t data_size, line;
+ uint32_t data_size, line;
const uint8_t *src;
int axmax = (avctx->width - (s->xmax + 1)) * 2 * s->desc->nb_components;
int bxmin = s->xmin * 2 * s->desc->nb_components;
int i, x, buf_size = s->buf_size;
- int av_unused ret;
+ int ret;
+ float one_gamma = 1.0f / s->gamma;
- line_offset = AV_RL64(s->table + jobnr * 8);
+ line_offset = AV_RL64(s->gb.buffer + jobnr * 8);
// Check if the buffer has the required bytes needed from the offset
if (line_offset > buf_size - 8)
return AVERROR_INVALIDDATA;
- src = buf + line_offset + 8;
+ src = buf + line_offset + 8;
line = AV_RL32(src - 8);
if (line < s->ymin || line > s->ymax)
return AVERROR_INVALIDDATA;
@@ -825,22 +859,24 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
if (data_size <= 0 || data_size > buf_size)
return AVERROR_INVALIDDATA;
- s->ysize = FFMIN(s->scan_lines_per_block, s->ymax - line + 1);
+ s->ysize = FFMIN(s->scan_lines_per_block, s->ymax - line + 1);
uncompressed_size = s->scan_line_size * s->ysize;
- if ((s->compr == EXR_RAW && (data_size != uncompressed_size ||
+ if ((s->compression == EXR_RAW && (data_size != uncompressed_size ||
line_offset > buf_size - uncompressed_size)) ||
- (s->compr != EXR_RAW && (data_size > uncompressed_size ||
+ (s->compression != EXR_RAW && (data_size > uncompressed_size ||
line_offset > buf_size - data_size))) {
return AVERROR_INVALIDDATA;
}
if (data_size < uncompressed_size) {
- av_fast_padded_malloc(&td->uncompressed_data, &td->uncompressed_size, uncompressed_size);
+ av_fast_padded_malloc(&td->uncompressed_data,
+ &td->uncompressed_size, uncompressed_size);
av_fast_padded_malloc(&td->tmp, &td->tmp_size, uncompressed_size);
if (!td->uncompressed_data || !td->tmp)
return AVERROR(ENOMEM);
- switch (s->compr) {
+ ret = AVERROR_INVALIDDATA;
+ switch (s->compression) {
case EXR_ZIP1:
case EXR_ZIP16:
ret = zip_uncompress(src, data_size, uncompressed_size, td);
@@ -854,7 +890,10 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
case EXR_RLE:
ret = rle_uncompress(src, data_size, uncompressed_size, td);
}
-
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "decode_block() failed.\n");
+ return ret;
+ }
src = td->uncompressed_data;
}
@@ -865,7 +904,9 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
channel_buffer[3] = src + xdelta * s->channel_offsets[3];
ptr = p->data[0] + line * p->linesize[0];
- for (i = 0; i < s->scan_lines_per_block && line + i <= s->ymax; i++, ptr += p->linesize[0]) {
+ for (i = 0;
+ i < s->scan_lines_per_block && line + i <= s->ymax;
+ i++, ptr += p->linesize[0]) {
const uint8_t *r, *g, *b, *a;
r = channel_buffer[0];
@@ -874,7 +915,7 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
if (channel_buffer[3])
a = channel_buffer[3];
- ptr_x = (uint16_t *)ptr;
+ ptr_x = (uint16_t *) ptr;
// Zero out the start if xmin is not 0
memset(ptr_x, 0, bxmin);
@@ -882,18 +923,30 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
if (s->pixel_type == EXR_FLOAT) {
// 32-bit
for (x = 0; x < xdelta; x++) {
- *ptr_x++ = exr_flt2uint(bytestream_get_le32(&r));
- *ptr_x++ = exr_flt2uint(bytestream_get_le32(&g));
- *ptr_x++ = exr_flt2uint(bytestream_get_le32(&b));
+ union av_intfloat32 t;
+ t.i = bytestream_get_le32(&r);
+ if ( t.f > 0.0f ) /* avoid negative values */
+ t.f = powf(t.f, one_gamma);
+ *ptr_x++ = exr_flt2uint(t.i);
+
+ t.i = bytestream_get_le32(&g);
+ if ( t.f > 0.0f )
+ t.f = powf(t.f, one_gamma);
+ *ptr_x++ = exr_flt2uint(t.i);
+
+ t.i = bytestream_get_le32(&b);
+ if ( t.f > 0.0f )
+ t.f = powf(t.f, one_gamma);
+ *ptr_x++ = exr_flt2uint(t.i);
if (channel_buffer[3])
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&a));
}
} else {
// 16-bit
for (x = 0; x < xdelta; x++) {
- *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&r));
- *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&g));
- *ptr_x++ = exr_halflt2uint(bytestream_get_le16(&b));
+ *ptr_x++ = s->gamma_table[bytestream_get_le16(&r)];
+ *ptr_x++ = s->gamma_table[bytestream_get_le16(&g)];
+ *ptr_x++ = s->gamma_table[bytestream_get_le16(&b)];
if (channel_buffer[3])
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&a));
}
@@ -912,244 +965,296 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
return 0;
}
-static int decode_frame(AVCodecContext *avctx,
- void *data,
- int *got_frame,
- AVPacket *avpkt)
+/**
+ * Check if the variable name corresponds to its data type.
+ *
+ * @param s the EXRContext
+ * @param value_name name of the variable to check
+ * @param value_type type of the variable to check
+ * @param minimum_length minimum length of the variable data
+ *
+ * @return bytes to read containing variable data
+ * -1 if variable is not found
+ * 0 if buffer ended prematurely
+ */
+static int check_header_variable(EXRContext *s,
+ const char *value_name,
+ const char *value_type,
+ unsigned int minimum_length)
{
- const uint8_t *buf = avpkt->data;
- unsigned int buf_size = avpkt->size;
- const uint8_t *buf_end = buf + buf_size;
-
- EXRContext *const s = avctx->priv_data;
- ThreadFrame frame = { .f = data };
- AVFrame *picture = data;
- uint8_t *ptr;
-
- int i, y, magic_number, version, flags, ret;
- int w = 0;
- int h = 0;
+ int var_size = -1;
+
+ if (bytestream2_get_bytes_left(&s->gb) >= minimum_length &&
+ !strcmp(s->gb.buffer, value_name)) {
+ // found value_name, jump to value_type (null terminated strings)
+ s->gb.buffer += strlen(value_name) + 1;
+ if (!strcmp(s->gb.buffer, value_type)) {
+ s->gb.buffer += strlen(value_type) + 1;
+ var_size = bytestream2_get_le32(&s->gb);
+ // don't go read past boundaries
+ if (var_size > bytestream2_get_bytes_left(&s->gb))
+ var_size = 0;
+ } else {
+ // value_type not found, reset the buffer
+ s->gb.buffer -= strlen(value_name) + 1;
+ av_log(s->avctx, AV_LOG_WARNING,
+ "Unknown data type %s for header variable %s.\n",
+ value_type, value_name);
+ }
+ }
- int out_line_size;
- int scan_line_blocks;
+ return var_size;
+}
- unsigned int current_channel_offset = 0;
+static int decode_header(EXRContext *s)
+{
+ int current_channel_offset = 0;
+ int magic_number, version, flags, i;
- s->xmin = ~0;
- s->xmax = ~0;
- s->ymin = ~0;
- s->ymax = ~0;
- s->xdelta = ~0;
- s->ydelta = ~0;
- s->channel_offsets[0] = -1;
- s->channel_offsets[1] = -1;
- s->channel_offsets[2] = -1;
- s->channel_offsets[3] = -1;
- s->pixel_type = -1;
- s->nb_channels = 0;
- s->compr = -1;
- s->buf = buf;
- s->buf_size = buf_size;
-
- if (buf_size < 10) {
- av_log(avctx, AV_LOG_ERROR, "Too short header to parse\n");
+ if (bytestream2_get_bytes_left(&s->gb) < 10) {
+ av_log(s->avctx, AV_LOG_ERROR, "Header too short to parse.\n");
return AVERROR_INVALIDDATA;
}
- magic_number = bytestream_get_le32(&buf);
- if (magic_number != 20000630) { // As per documentation of OpenEXR it's supposed to be int 20000630 little-endian
- av_log(avctx, AV_LOG_ERROR, "Wrong magic number %d\n", magic_number);
+ magic_number = bytestream2_get_le32(&s->gb);
+ if (magic_number != 20000630) {
+ /* As per documentation of OpenEXR, it is supposed to be
+ * int 20000630 little-endian */
+ av_log(s->avctx, AV_LOG_ERROR, "Wrong magic number %d.\n", magic_number);
return AVERROR_INVALIDDATA;
}
- version = bytestream_get_byte(&buf);
+ version = bytestream2_get_byte(&s->gb);
if (version != 2) {
- avpriv_report_missing_feature(avctx, "Version %d", version);
+ avpriv_report_missing_feature(s->avctx, "Version %d", version);
return AVERROR_PATCHWELCOME;
}
- flags = bytestream_get_le24(&buf);
- if (flags & 0x2) {
- avpriv_report_missing_feature(avctx, "Tile support");
+ flags = bytestream2_get_le24(&s->gb);
+ if (flags & 0x02) {
+ avpriv_report_missing_feature(s->avctx, "Tile support");
return AVERROR_PATCHWELCOME;
}
// Parse the header
- while (buf < buf_end && buf[0]) {
- unsigned int variable_buffer_data_size;
- // Process the channel list
- if (check_header_variable(avctx, &buf, buf_end, "channels", "chlist", 38, &variable_buffer_data_size) >= 0) {
- const uint8_t *channel_list_end;
- if (!variable_buffer_data_size)
+ while (bytestream2_get_bytes_left(&s->gb) > 0 && *s->gb.buffer) {
+ int var_size;
+ if ((var_size = check_header_variable(s, "channels",
+ "chlist", 38)) >= 0) {
+ GetByteContext ch_gb;
+ if (!var_size)
return AVERROR_INVALIDDATA;
- channel_list_end = buf + variable_buffer_data_size;
- while (channel_list_end - buf >= 19) {
+ bytestream2_init(&ch_gb, s->gb.buffer, var_size);
+
+ while (bytestream2_get_bytes_left(&ch_gb) >= 19) {
EXRChannel *channel;
enum ExrPixelType current_pixel_type;
int channel_index = -1;
int xsub, ysub;
- if (!strcmp(buf, "R"))
+ if (strcmp(s->layer, "") != 0) {
+ if (strncmp(ch_gb.buffer, s->layer, strlen(s->layer)) == 0) {
+ ch_gb.buffer += strlen(s->layer);
+ if (*ch_gb.buffer == '.')
+ ch_gb.buffer++; /* skip dot if not given */
+ av_log(s->avctx, AV_LOG_INFO,
+ "Layer %s.%s matched.\n", s->layer, ch_gb.buffer);
+ }
+ }
+
+ if (!strcmp(ch_gb.buffer, "R") ||
+ !strcmp(ch_gb.buffer, "X") ||
+ !strcmp(ch_gb.buffer, "U"))
channel_index = 0;
- else if (!strcmp(buf, "G"))
+ else if (!strcmp(ch_gb.buffer, "G") ||
+ !strcmp(ch_gb.buffer, "Y") ||
+ !strcmp(ch_gb.buffer, "V"))
channel_index = 1;
- else if (!strcmp(buf, "B"))
+ else if (!strcmp(ch_gb.buffer, "B") ||
+ !strcmp(ch_gb.buffer, "Z") ||
+ !strcmp(ch_gb.buffer, "W"))
channel_index = 2;
- else if (!strcmp(buf, "A"))
+ else if (!strcmp(ch_gb.buffer, "A"))
channel_index = 3;
else
- av_log(avctx, AV_LOG_WARNING, "Unsupported channel %.256s\n", buf);
+ av_log(s->avctx, AV_LOG_WARNING,
+ "Unsupported channel %.256s.\n", ch_gb.buffer);
- while (bytestream_get_byte(&buf) && buf < channel_list_end)
- continue; /* skip */
+ /* skip until you get a 0 */
+ while (bytestream2_get_bytes_left(&ch_gb) > 0 &&
+ bytestream2_get_byte(&ch_gb))
+ continue;
- if (channel_list_end - * &buf < 4) {
- av_log(avctx, AV_LOG_ERROR, "Incomplete header\n");
+ if (bytestream2_get_bytes_left(&ch_gb) < 4) {
+ av_log(s->avctx, AV_LOG_ERROR, "Incomplete header.\n");
return AVERROR_INVALIDDATA;
}
- current_pixel_type = bytestream_get_le32(&buf);
- if (current_pixel_type > 2) {
- av_log(avctx, AV_LOG_ERROR, "Unknown pixel type\n");
- return AVERROR_INVALIDDATA;
+ current_pixel_type = bytestream2_get_le32(&ch_gb);
+ if (current_pixel_type >= EXR_UNKNOWN) {
+ avpriv_report_missing_feature(s->avctx,
+ "Pixel type %d.\n",
+ current_pixel_type);
+ return AVERROR_PATCHWELCOME;
}
- buf += 4;
- xsub = bytestream_get_le32(&buf);
- ysub = bytestream_get_le32(&buf);
+ bytestream2_skip(&ch_gb, 4);
+ xsub = bytestream2_get_le32(&ch_gb);
+ ysub = bytestream2_get_le32(&ch_gb);
if (xsub != 1 || ysub != 1) {
- avpriv_report_missing_feature(avctx, "Subsampling %dx%d", xsub, ysub);
+ avpriv_report_missing_feature(s->avctx,
+ "Subsampling %dx%d",
+ xsub, ysub);
return AVERROR_PATCHWELCOME;
}
if (channel_index >= 0) {
- if (s->pixel_type != -1 && s->pixel_type != current_pixel_type) {
- av_log(avctx, AV_LOG_ERROR, "RGB channels not of the same depth\n");
+ if (s->pixel_type != EXR_UNKNOWN &&
+ s->pixel_type != current_pixel_type) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "RGB channels not of the same depth.\n");
return AVERROR_INVALIDDATA;
}
- s->pixel_type = current_pixel_type;
+ s->pixel_type = current_pixel_type;
s->channel_offsets[channel_index] = current_channel_offset;
}
- s->channels = av_realloc_f(s->channels, ++s->nb_channels, sizeof(EXRChannel));
+ s->channels = av_realloc(s->channels,
+ ++s->nb_channels * sizeof(EXRChannel));
if (!s->channels)
return AVERROR(ENOMEM);
- channel = &s->channels[s->nb_channels - 1];
+ channel = &s->channels[s->nb_channels - 1];
channel->pixel_type = current_pixel_type;
- channel->xsub = xsub;
- channel->ysub = ysub;
+ channel->xsub = xsub;
+ channel->ysub = ysub;
current_channel_offset += 1 << current_pixel_type;
}
/* Check if all channels are set with an offset or if the channels
* are causing an overflow */
-
if (FFMIN3(s->channel_offsets[0],
s->channel_offsets[1],
s->channel_offsets[2]) < 0) {
if (s->channel_offsets[0] < 0)
- av_log(avctx, AV_LOG_ERROR, "Missing red channel\n");
+ av_log(s->avctx, AV_LOG_ERROR, "Missing red channel.\n");
if (s->channel_offsets[1] < 0)
- av_log(avctx, AV_LOG_ERROR, "Missing green channel\n");
+ av_log(s->avctx, AV_LOG_ERROR, "Missing green channel.\n");
if (s->channel_offsets[2] < 0)
- av_log(avctx, AV_LOG_ERROR, "Missing blue channel\n");
+ av_log(s->avctx, AV_LOG_ERROR, "Missing blue channel.\n");
return AVERROR_INVALIDDATA;
}
- buf = channel_list_end;
+ // skip one last byte and update main gb
+ s->gb.buffer = ch_gb.buffer + 1;
continue;
- } else if (check_header_variable(avctx, &buf, buf_end, "dataWindow", "box2i", 31, &variable_buffer_data_size) >= 0) {
- if (!variable_buffer_data_size)
+ } else if ((var_size = check_header_variable(s, "dataWindow", "box2i",
+ 31)) >= 0) {
+ if (!var_size)
return AVERROR_INVALIDDATA;
- s->xmin = AV_RL32(buf);
- s->ymin = AV_RL32(buf + 4);
- s->xmax = AV_RL32(buf + 8);
- s->ymax = AV_RL32(buf + 12);
+ s->xmin = bytestream2_get_le32(&s->gb);
+ s->ymin = bytestream2_get_le32(&s->gb);
+ s->xmax = bytestream2_get_le32(&s->gb);
+ s->ymax = bytestream2_get_le32(&s->gb);
s->xdelta = (s->xmax - s->xmin) + 1;
s->ydelta = (s->ymax - s->ymin) + 1;
- buf += variable_buffer_data_size;
continue;
- } else if (check_header_variable(avctx, &buf, buf_end, "displayWindow", "box2i", 34, &variable_buffer_data_size) >= 0) {
- if (!variable_buffer_data_size)
+ } else if ((var_size = check_header_variable(s, "displayWindow",
+ "box2i", 34)) >= 0) {
+ if (!var_size)
return AVERROR_INVALIDDATA;
- w = AV_RL32(buf + 8) + 1;
- h = AV_RL32(buf + 12) + 1;
+ bytestream2_skip(&s->gb, 8);
+ s->w = bytestream2_get_le32(&s->gb) + 1;
+ s->h = bytestream2_get_le32(&s->gb) + 1;
- buf += variable_buffer_data_size;
continue;
- } else if (check_header_variable(avctx, &buf, buf_end, "lineOrder", "lineOrder", 25, &variable_buffer_data_size) >= 0) {
- if (!variable_buffer_data_size)
+ } else if ((var_size = check_header_variable(s, "lineOrder",
+ "lineOrder", 25)) >= 0) {
+ int line_order;
+ if (!var_size)
return AVERROR_INVALIDDATA;
- av_log(avctx, AV_LOG_DEBUG, "line order : %d\n", *buf);
- if (*buf > 2) {
- av_log(avctx, AV_LOG_ERROR, "Unknown line order\n");
+ line_order = bytestream2_get_byte(&s->gb);
+ av_log(s->avctx, AV_LOG_DEBUG, "line order: %d.\n", line_order);
+ if (line_order > 2) {
+ av_log(s->avctx, AV_LOG_ERROR, "Unknown line order.\n");
return AVERROR_INVALIDDATA;
}
- buf += variable_buffer_data_size;
continue;
- } else if (check_header_variable(avctx, &buf, buf_end, "pixelAspectRatio", "float", 31, &variable_buffer_data_size) >= 0) {
- if (!variable_buffer_data_size)
+ } else if ((var_size = check_header_variable(s, "pixelAspectRatio",
+ "float", 31)) >= 0) {
+ if (!var_size)
return AVERROR_INVALIDDATA;
- avctx->sample_aspect_ratio = av_d2q(av_int2float(AV_RL32(buf)), 255);
+ s->avctx->sample_aspect_ratio =
+ av_d2q(av_int2float(bytestream2_get_le32(&s->gb)), 255);
- buf += variable_buffer_data_size;
continue;
- } else if (check_header_variable(avctx, &buf, buf_end, "compression", "compression", 29, &variable_buffer_data_size) >= 0) {
- if (!variable_buffer_data_size)
+ } else if ((var_size = check_header_variable(s, "compression",
+ "compression", 29)) >= 0) {
+ if (!var_size)
return AVERROR_INVALIDDATA;
- if (s->compr == -1)
- s->compr = *buf;
+ if (s->compression == EXR_UNKN)
+ s->compression = bytestream2_get_byte(&s->gb);
else
- av_log(avctx, AV_LOG_WARNING, "Found more than one compression attribute\n");
+ av_log(s->avctx, AV_LOG_WARNING,
+ "Found more than one compression attribute.\n");
- buf += variable_buffer_data_size;
continue;
}
- // Check if there is enough bytes for a header
- if (buf_end - buf <= 9) {
- av_log(avctx, AV_LOG_ERROR, "Incomplete header\n");
+ // Check if there are enough bytes for a header
+ if (bytestream2_get_bytes_left(&s->gb) <= 9) {
+ av_log(s->avctx, AV_LOG_ERROR, "Incomplete header\n");
return AVERROR_INVALIDDATA;
}
// Process unknown variables
- for (i = 0; i < 2; i++) {
- // Skip variable name/type
- while (++buf < buf_end)
- if (buf[0] == 0x0)
- break;
- }
- buf++;
+ for (i = 0; i < 2; i++) // value_name and value_type
+ while (bytestream2_get_byte(&s->gb) != 0);
+
// Skip variable length
- if (buf_end - buf >= 5) {
- variable_buffer_data_size = get_header_variable_length(&buf, buf_end);
- if (!variable_buffer_data_size) {
- av_log(avctx, AV_LOG_ERROR, "Incomplete header\n");
- return AVERROR_INVALIDDATA;
- }
- buf += variable_buffer_data_size;
- }
+ bytestream2_skip(&s->gb, bytestream2_get_le32(&s->gb));
}
- if (s->compr == -1) {
- av_log(avctx, AV_LOG_ERROR, "Missing compression attribute\n");
+ if (s->compression == EXR_UNKN) {
+ av_log(s->avctx, AV_LOG_ERROR, "Missing compression attribute.\n");
return AVERROR_INVALIDDATA;
}
+ s->scan_line_size = s->xdelta * current_channel_offset;
- if (buf >= buf_end) {
- av_log(avctx, AV_LOG_ERROR, "Incomplete frame\n");
+ if (bytestream2_get_bytes_left(&s->gb) <= 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "Incomplete frame.\n");
return AVERROR_INVALIDDATA;
}
- buf++;
+
+ // aaand we are done
+ bytestream2_skip(&s->gb, 1);
+ return 0;
+}
+
+static int decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
+{
+ EXRContext *s = avctx->priv_data;
+ ThreadFrame frame = { .f = data };
+ AVFrame *picture = data;
+ uint8_t *ptr;
+
+ int y, ret;
+ int out_line_size;
+ int scan_line_blocks;
+
+ bytestream2_init(&s->gb, avpkt->data, avpkt->size);
+
+ if ((ret = decode_header(s)) < 0)
+ return ret;
switch (s->pixel_type) {
case EXR_FLOAT:
@@ -1163,11 +1268,11 @@ static int decode_frame(AVCodecContext *avctx,
avpriv_request_sample(avctx, "32-bit unsigned int");
return AVERROR_PATCHWELCOME;
default:
- av_log(avctx, AV_LOG_ERROR, "Missing channel list\n");
+ av_log(avctx, AV_LOG_ERROR, "Missing channel list.\n");
return AVERROR_INVALIDDATA;
}
- switch (s->compr) {
+ switch (s->compression) {
case EXR_RAW:
case EXR_RLE:
case EXR_ZIP1:
@@ -1181,49 +1286,41 @@ static int decode_frame(AVCodecContext *avctx,
s->scan_lines_per_block = 32;
break;
default:
- avpriv_report_missing_feature(avctx, "Compression %d", s->compr);
+ avpriv_report_missing_feature(avctx, "Compression %d", s->compression);
return AVERROR_PATCHWELCOME;
}
- // Verify the xmin, xmax, ymin, ymax and xdelta before setting the actual image size
- if (s->xmin > s->xmax ||
- s->ymin > s->ymax ||
+ /* Verify the xmin, xmax, ymin, ymax and xdelta before setting
+ * the actual image size. */
+ if (s->xmin > s->xmax ||
+ s->ymin > s->ymax ||
s->xdelta != s->xmax - s->xmin + 1 ||
- s->xmax >= w || s->ymax >= h) {
- av_log(avctx, AV_LOG_ERROR, "Wrong sizing or missing size information\n");
+ s->xmax >= s->w ||
+ s->ymax >= s->h) {
+ av_log(avctx, AV_LOG_ERROR, "Wrong or missing size information.\n");
return AVERROR_INVALIDDATA;
}
- if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
+ if ((ret = ff_set_dimensions(avctx, s->w, s->h)) < 0)
return ret;
- s->desc = av_pix_fmt_desc_get(avctx->pix_fmt);
- out_line_size = avctx->width * 2 * s->desc->nb_components;
- s->scan_line_size = s->xdelta * current_channel_offset;
- scan_line_blocks = (s->ydelta + s->scan_lines_per_block - 1) / s->scan_lines_per_block;
-
- if (s->compr != EXR_RAW) {
- size_t thread_data_size, prev_size;
- EXRThreadData *m;
-
- prev_size = s->thread_data_size;
- if (av_size_mult(avctx->thread_count, sizeof(EXRThreadData), &thread_data_size))
- return AVERROR(EINVAL);
-
- m = av_fast_realloc(s->thread_data, &s->thread_data_size, thread_data_size);
- if (!m)
- return AVERROR(ENOMEM);
- s->thread_data = m;
- memset(s->thread_data + prev_size, 0, s->thread_data_size - prev_size);
- }
+ s->desc = av_pix_fmt_desc_get(avctx->pix_fmt);
+ if (!s->desc)
+ return AVERROR_INVALIDDATA;
+ out_line_size = avctx->width * 2 * s->desc->nb_components;
+ scan_line_blocks = (s->ydelta + s->scan_lines_per_block - 1) /
+ s->scan_lines_per_block;
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- if (buf_end - buf < scan_line_blocks * 8)
+ if (bytestream2_get_bytes_left(&s->gb) < scan_line_blocks * 8)
return AVERROR_INVALIDDATA;
- s->table = buf;
- ptr = picture->data[0];
+
+ // save pointer we are going to use in decode_block
+ s->buf = avpkt->data;
+ s->buf_size = avpkt->size;
+ ptr = picture->data[0];
// Zero out the start if ymin is not 0
for (y = 0; y < s->ymin; y++) {
@@ -1243,15 +1340,74 @@ static int decode_frame(AVCodecContext *avctx,
picture->pict_type = AV_PICTURE_TYPE_I;
*got_frame = 1;
- return buf_size;
+ return avpkt->size;
+}
+
+static av_cold int decode_init(AVCodecContext *avctx)
+{
+ uint32_t i;
+ union av_intfloat32 t;
+ EXRContext *s = avctx->priv_data;
+ float one_gamma = 1.0f / s->gamma;
+
+ s->avctx = avctx;
+ s->xmin = ~0;
+ s->xmax = ~0;
+ s->ymin = ~0;
+ s->ymax = ~0;
+ s->xdelta = ~0;
+ s->ydelta = ~0;
+ s->channel_offsets[0] = -1;
+ s->channel_offsets[1] = -1;
+ s->channel_offsets[2] = -1;
+ s->channel_offsets[3] = -1;
+ s->pixel_type = EXR_UNKNOWN;
+ s->compression = EXR_UNKN;
+ s->nb_channels = 0;
+ s->w = 0;
+ s->h = 0;
+
+ if ( one_gamma > 0.9999f && one_gamma < 1.0001f ) {
+ for ( i = 0; i < 65536; ++i ) {
+ s->gamma_table[i] = exr_halflt2uint(i);
+ }
+ } else {
+ for ( i = 0; i < 65536; ++i ) {
+ t = exr_half2float(i);
+ /* If negative value we reuse half value */
+ if ( t.f <= 0.0f ) {
+ s->gamma_table[i] = exr_halflt2uint(i);
+ } else {
+ t.f = powf(t.f, one_gamma);
+ s->gamma_table[i] = exr_flt2uint(t.i);
+ }
+ }
+ }
+
+ // allocate thread data, used for non EXR_RAW compreesion types
+ s->thread_data = av_mallocz_array(avctx->thread_count, sizeof(EXRThreadData));
+ if (!s->thread_data)
+ return AVERROR_INVALIDDATA;
+
+ return 0;
+}
+
+static int decode_init_thread_copy(AVCodecContext *avctx)
+{ EXRContext *s = avctx->priv_data;
+
+ // allocate thread data, used for non EXR_RAW compreesion types
+ s->thread_data = av_mallocz_array(avctx->thread_count, sizeof(EXRThreadData));
+ if (!s->thread_data)
+ return AVERROR_INVALIDDATA;
+
+ return 0;
}
static av_cold int decode_end(AVCodecContext *avctx)
{
EXRContext *s = avctx->priv_data;
int i;
-
- for (i = 0; i < s->thread_data_size / sizeof(EXRThreadData); i++) {
+ for (i = 0; i < avctx->thread_count; i++) {
EXRThreadData *td = &s->thread_data[i];
av_freep(&td->uncompressed_data);
av_freep(&td->tmp);
@@ -1260,19 +1416,39 @@ static av_cold int decode_end(AVCodecContext *avctx)
}
av_freep(&s->thread_data);
- s->thread_data_size = 0;
av_freep(&s->channels);
return 0;
}
+#define OFFSET(x) offsetof(EXRContext, x)
+#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
+static const AVOption options[] = {
+ { "layer", "Set the decoding layer", OFFSET(layer),
+ AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, VD },
+ { "gamma", "Set the float gamma value when decoding (experimental/unsupported)", OFFSET(gamma),
+ AV_OPT_TYPE_FLOAT, { .dbl = 1.0f }, 0.001, FLT_MAX, VD },
+ { NULL },
+};
+
+static const AVClass exr_class = {
+ .class_name = "EXR",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_exr_decoder = {
- .name = "exr",
- .long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_EXR,
- .priv_data_size = sizeof(EXRContext),
- .close = decode_end,
- .decode = decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
+ .name = "exr",
+ .long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_EXR,
+ .priv_data_size = sizeof(EXRContext),
+ .init = decode_init,
+ .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
+ .close = decode_end,
+ .decode = decode_frame,
+ .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS |
+ CODEC_CAP_SLICE_THREADS,
+ .priv_class = &exr_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/faxcompr.c b/chromium/third_party/ffmpeg/libavcodec/faxcompr.c
index 900851b3f1b..155f78da66b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/faxcompr.c
+++ b/chromium/third_party/ffmpeg/libavcodec/faxcompr.c
@@ -287,8 +287,8 @@ int ff_ccitt_unpack(AVCodecContext *avctx, const uint8_t *src, int srcsize,
int runsize = avctx->width + 2;
int has_eol;
- runs = av_malloc(runsize * sizeof(runs[0]));
- ref = av_malloc(runsize * sizeof(ref[0]));
+ runs = av_malloc_array(runsize, sizeof(runs[0]));
+ ref = av_malloc_array(runsize, sizeof(ref[0]));
if (!runs || !ref) {
ret = AVERROR(ENOMEM);
goto fail;
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft-fixed-test.c b/chromium/third_party/ffmpeg/libavcodec/fft-fixed-test.c
index a1a61604a93..330211ebf64 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft-fixed-test.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fft-fixed-test.c
@@ -16,5 +16,5 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define CONFIG_FFT_FLOAT 0
+#define FFT_FLOAT 0
#include "fft-test.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft-fixed32-test.c b/chromium/third_party/ffmpeg/libavcodec/fft-fixed32-test.c
index 89cd47c1dae..4bd11cea61e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft-fixed32-test.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fft-fixed32-test.c
@@ -16,6 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define CONFIG_FFT_FLOAT 0
-#define CONFIG_FFT_FIXED_32 1
+#define FFT_FLOAT 0
+#define FFT_FIXED_32 1
#include "fft-test.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft-internal.h b/chromium/third_party/ffmpeg/libavcodec/fft-internal.h
index 065eeccef19..0a8f7d05cf8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft-internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/fft-internal.h
@@ -19,7 +19,7 @@
#ifndef AVCODEC_FFT_INTERNAL_H
#define AVCODEC_FFT_INTERNAL_H
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
#define FIX15(v) (v)
#define sqrthalf (float)M_SQRT1_2
@@ -38,7 +38,7 @@
#define SCALE_FLOAT(a, bits) lrint((a) * (double)(1 << (bits)))
-#if CONFIG_FFT_FIXED_32
+#if FFT_FIXED_32
#define CMUL(dre, dim, are, aim, bre, bim) do { \
int64_t accu; \
@@ -52,7 +52,7 @@
#define FIX15(a) av_clip(SCALE_FLOAT(a, 31), -2147483647, 2147483647)
-#else /* CONFIG_FFT_FIXED_32 */
+#else /* FFT_FIXED_32 */
#include "fft.h"
#include "mathops.h"
@@ -79,9 +79,9 @@ void ff_mdct_calcw_c(FFTContext *s, FFTDouble *output, const FFTSample *input);
#define CMULL(dre, dim, are, aim, bre, bim) \
CMULS(dre, dim, are, aim, bre, bim, 0)
-#endif /* CONFIG_FFT_FIXED_32 */
+#endif /* FFT_FIXED_32 */
-#endif /* CONFIG_FFT_FLOAT */
+#endif /* FFT_FLOAT */
#define ff_imdct_calc_c FFT_NAME(ff_imdct_calc_c)
#define ff_imdct_half_c FFT_NAME(ff_imdct_half_c)
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft-test.c b/chromium/third_party/ffmpeg/libavcodec/fft-test.c
index d650a10844b..a29896fde78 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft-test.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fft-test.c
@@ -29,7 +29,7 @@
#include "libavutil/log.h"
#include "libavutil/time.h"
#include "fft.h"
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
#include "dct.h"
#include "rdft.h"
#endif
@@ -51,11 +51,11 @@
pim += (MUL16(are, bim) + MUL16(bre, aim));\
}
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
# define RANGE 1.0
# define REF_SCALE(x, bits) (x)
# define FMT "%10.6f"
-#elif CONFIG_FFT_FIXED_32
+#elif FFT_FIXED_32
# define RANGE 8388608
# define REF_SCALE(x, bits) (x)
# define FMT "%6d"
@@ -75,7 +75,7 @@ static void fft_ref_init(int nbits, int inverse)
double c1, s1, alpha;
n = 1 << nbits;
- exptab = av_malloc((n / 2) * sizeof(*exptab));
+ exptab = av_malloc_array((n / 2), sizeof(*exptab));
for (i = 0; i < (n/2); i++) {
alpha = 2 * M_PI * (float)i / (float)n;
@@ -152,7 +152,7 @@ static void mdct_ref(FFTSample *output, FFTSample *input, int nbits)
}
}
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
static void idct_ref(FFTSample *output, FFTSample *input, int nbits)
{
int n = 1<<nbits;
@@ -252,7 +252,7 @@ int main(int argc, char **argv)
int do_inverse = 0;
FFTContext s1, *s = &s1;
FFTContext m1, *m = &m1;
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
RDFTContext r1, *r = &r1;
DCTContext d1, *d = &d1;
int fft_size_2;
@@ -304,10 +304,10 @@ int main(int argc, char **argv)
}
fft_size = 1 << fft_nbits;
- tab = av_malloc(fft_size * sizeof(FFTComplex));
- tab1 = av_malloc(fft_size * sizeof(FFTComplex));
- tab_ref = av_malloc(fft_size * sizeof(FFTComplex));
- tab2 = av_malloc(fft_size * sizeof(FFTSample));
+ tab = av_malloc_array(fft_size, sizeof(FFTComplex));
+ tab1 = av_malloc_array(fft_size, sizeof(FFTComplex));
+ tab_ref = av_malloc_array(fft_size, sizeof(FFTComplex));
+ tab2 = av_malloc_array(fft_size, sizeof(FFTSample));
switch (transform) {
case TRANSFORM_MDCT:
@@ -326,7 +326,7 @@ int main(int argc, char **argv)
ff_fft_init(s, fft_nbits, do_inverse);
fft_ref_init(fft_nbits, do_inverse);
break;
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
case TRANSFORM_RDFT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IDFT_C2R");
@@ -383,7 +383,7 @@ int main(int argc, char **argv)
fft_ref(tab_ref, tab1, fft_nbits);
err = check_diff((FFTSample *)tab_ref, (FFTSample *)tab, fft_size * 2, 1.0);
break;
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
case TRANSFORM_RDFT:
fft_size_2 = fft_size >> 1;
if (do_inverse) {
@@ -452,7 +452,7 @@ int main(int argc, char **argv)
memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
s->fft_calc(s, tab);
break;
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
case TRANSFORM_RDFT:
memcpy(tab2, tab1, fft_size * sizeof(FFTSample));
r->rdft_calc(r, tab2);
@@ -482,7 +482,7 @@ int main(int argc, char **argv)
case TRANSFORM_FFT:
ff_fft_end(s);
break;
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
case TRANSFORM_RDFT:
ff_rdft_end(r);
break;
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft.h b/chromium/third_party/ffmpeg/libavcodec/fft.h
index 217090cf2ac..2d7e2549850 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft.h
+++ b/chromium/third_party/ffmpeg/libavcodec/fft.h
@@ -22,19 +22,19 @@
#ifndef AVCODEC_FFT_H
#define AVCODEC_FFT_H
-#ifndef CONFIG_FFT_FLOAT
-#define CONFIG_FFT_FLOAT 1
+#ifndef FFT_FLOAT
+#define FFT_FLOAT 1
#endif
-#ifndef CONFIG_FFT_FIXED_32
-#define CONFIG_FFT_FIXED_32 0
+#ifndef FFT_FIXED_32
+#define FFT_FIXED_32 0
#endif
#include <stdint.h>
#include "config.h"
#include "libavutil/mem.h"
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
#include "avfft.h"
@@ -44,20 +44,20 @@ typedef float FFTDouble;
#else
-#if CONFIG_FFT_FIXED_32
+#if FFT_FIXED_32
#define Q31(x) (int)((x)*2147483648.0 + 0.5)
#define FFT_NAME(x) x ## _fixed_32
typedef int32_t FFTSample;
-#else /* CONFIG_FFT_FIXED_32 */
+#else /* FFT_FIXED_32 */
#define FFT_NAME(x) x ## _fixed
typedef int16_t FFTSample;
-#endif /* CONFIG_FFT_FIXED_32 */
+#endif /* FFT_FIXED_32 */
typedef struct FFTComplex {
FFTSample re, im;
@@ -66,7 +66,7 @@ typedef struct FFTComplex {
typedef int FFTDouble;
typedef struct FFTContext FFTContext;
-#endif /* CONFIG_FFT_FLOAT */
+#endif /* FFT_FLOAT */
typedef struct FFTDComplex {
FFTDouble re, im;
@@ -148,6 +148,7 @@ void ff_init_ff_cos_tabs(int index);
*/
int ff_fft_init(FFTContext *s, int nbits, int inverse);
+void ff_fft_init_aarch64(FFTContext *s);
void ff_fft_init_x86(FFTContext *s);
void ff_fft_init_arm(FFTContext *s);
void ff_fft_init_mips(FFTContext *s);
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft_fixed.c b/chromium/third_party/ffmpeg/libavcodec/fft_fixed.c
index 9e74b8c160a..3d3bd2fca61 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft_fixed.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fft_fixed.c
@@ -16,6 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define CONFIG_FFT_FLOAT 0
-#define CONFIG_FFT_FIXED_32 0
+#define FFT_FLOAT 0
+#define FFT_FIXED_32 0
#include "fft_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft_fixed_32.c b/chromium/third_party/ffmpeg/libavcodec/fft_fixed_32.c
index 18e6da90976..fbdbf847e23 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft_fixed_32.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fft_fixed_32.c
@@ -47,6 +47,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define CONFIG_FFT_FLOAT 0
-#define CONFIG_FFT_FIXED_32 1
+#define FFT_FLOAT 0
+#define FFT_FIXED_32 1
#include "fft_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft_float.c b/chromium/third_party/ffmpeg/libavcodec/fft_float.c
index 93d36071a22..73cc98d0d4b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft_float.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fft_float.c
@@ -16,6 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define CONFIG_FFT_FLOAT 1
-#define CONFIG_FFT_FIXED_32 0
+#define FFT_FLOAT 1
+#define FFT_FIXED_32 0
#include "fft_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft_table.h b/chromium/third_party/ffmpeg/libavcodec/fft_table.h
index 687e5b94fd5..7f3142d7a9f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft_table.h
+++ b/chromium/third_party/ffmpeg/libavcodec/fft_table.h
@@ -56,7 +56,7 @@
#include "libavcodec/fft.h"
-#define MAX_LOG2_NFFT 16 //!< Specifies maxiumum allowed fft size
+#define MAX_LOG2_NFFT 16 //!< Specifies maximum allowed fft size
#define MAX_FFT_SIZE (1 << MAX_LOG2_NFFT)
extern int32_t w_tab_sr[];
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft_template.c b/chromium/third_party/ffmpeg/libavcodec/fft_template.c
index e0cf1f29822..b8d6417fd13 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fft_template.c
@@ -32,9 +32,9 @@
#include "fft.h"
#include "fft-internal.h"
-#if CONFIG_FFT_FIXED_32
+#if FFT_FIXED_32
#include "fft_table.h"
-#else /* CONFIG_FFT_FIXED_32 */
+#else /* FFT_FIXED_32 */
/* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */
#if !CONFIG_HARDCODED_TABLES
@@ -69,7 +69,7 @@ COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = {
FFT_NAME(ff_cos_65536),
};
-#endif /* CONFIG_FFT_FIXED_32 */
+#endif /* FFT_FIXED_32 */
static void fft_permute_c(FFTContext *s, FFTComplex *z);
static void fft_calc_c(FFTContext *s, FFTComplex *z);
@@ -87,7 +87,7 @@ static int split_radix_permutation(int i, int n, int inverse)
av_cold void ff_init_ff_cos_tabs(int index)
{
-#if (!CONFIG_HARDCODED_TABLES) && (!CONFIG_FFT_FIXED_32)
+#if (!CONFIG_HARDCODED_TABLES) && (!FFT_FIXED_32)
int i;
int m = 1<<index;
double freq = 2*M_PI/m;
@@ -163,13 +163,14 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
s->mdct_calc = ff_mdct_calc_c;
#endif
-#if CONFIG_FFT_FIXED_32
+#if FFT_FIXED_32
{
int n=0;
ff_fft_lut_init(fft_offsets_lut, 0, 1 << 16, &n);
}
-#else /* CONFIG_FFT_FIXED_32 */
-#if CONFIG_FFT_FLOAT
+#else /* FFT_FIXED_32 */
+#if FFT_FLOAT
+ if (ARCH_AARCH64) ff_fft_init_aarch64(s);
if (ARCH_ARM) ff_fft_init_arm(s);
if (ARCH_PPC) ff_fft_init_ppc(s);
if (ARCH_X86) ff_fft_init_x86(s);
@@ -182,7 +183,7 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
for(j=4; j<=nbits; j++) {
ff_init_ff_cos_tabs(j);
}
-#endif /* CONFIG_FFT_FIXED_32 */
+#endif /* FFT_FIXED_32 */
if (s->fft_permutation == FF_FFT_PERM_AVX) {
@@ -219,7 +220,7 @@ av_cold void ff_fft_end(FFTContext *s)
av_freep(&s->tmp_buf);
}
-#if CONFIG_FFT_FIXED_32
+#if FFT_FIXED_32
static void fft_calc_c(FFTContext *s, FFTComplex *z) {
@@ -380,7 +381,7 @@ static void fft_calc_c(FFTContext *s, FFTComplex *z) {
}
}
-#else /* CONFIG_FFT_FIXED_32 */
+#else /* FFT_FIXED_32 */
#define BUTTERFLIES(a0,a1,a2,a3) {\
BF(t3, t5, t5, t1);\
@@ -527,4 +528,4 @@ static void fft_calc_c(FFTContext *s, FFTComplex *z)
{
fft_dispatch[s->nbits-2](z);
}
-#endif /* CONFIG_FFT_FIXED_32 */
+#endif /* FFT_FIXED_32 */
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffv1.c b/chromium/third_party/ffmpeg/libavcodec/ffv1.c
index f8556b01f17..ab58a6074f7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffv1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ffv1.c
@@ -54,8 +54,6 @@ av_cold int ffv1_common_init(AVCodecContext *avctx)
if (!s->picture.f || !s->last_picture.f)
return AVERROR(ENOMEM);
- ff_dsputil_init(&s->dsp, avctx);
-
s->width = avctx->width;
s->height = avctx->height;
@@ -77,13 +75,13 @@ av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
if (fs->ac) {
if (!p->state)
- p->state = av_malloc(CONTEXT_SIZE * p->context_count *
+ p->state = av_malloc_array(p->context_count, CONTEXT_SIZE *
sizeof(uint8_t));
if (!p->state)
return AVERROR(ENOMEM);
} else {
if (!p->vlc_state)
- p->vlc_state = av_malloc(p->context_count * sizeof(VlcState));
+ p->vlc_state = av_malloc_array(p->context_count, sizeof(VlcState));
if (!p->vlc_state)
return AVERROR(ENOMEM);
}
@@ -139,7 +137,7 @@ av_cold int ffv1_init_slice_contexts(FFV1Context *f)
fs->slice_x = sxs;
fs->slice_y = sys;
- fs->sample_buffer = av_malloc(3 * MAX_PLANES * (fs->width + 6) *
+ fs->sample_buffer = av_malloc_array((fs->width + 6), 3 * MAX_PLANES *
sizeof(*fs->sample_buffer));
if (!fs->sample_buffer)
return AVERROR(ENOMEM);
@@ -152,7 +150,7 @@ int ffv1_allocate_initial_states(FFV1Context *f)
int i;
for (i = 0; i < f->quant_table_count; i++) {
- f->initial_states[i] = av_malloc(f->context_count[i] *
+ f->initial_states[i] = av_malloc_array(f->context_count[i],
sizeof(*f->initial_states[i]));
if (!f->initial_states[i])
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffv1.h b/chromium/third_party/ffmpeg/libavcodec/ffv1.h
index 2c3e6e4c983..5081397f54b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffv1.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ffv1.h
@@ -35,7 +35,6 @@
#include "libavutil/pixdesc.h"
#include "libavutil/timer.h"
#include "avcodec.h"
-#include "dsputil.h"
#include "get_bits.h"
#include "internal.h"
#include "mathops.h"
@@ -54,8 +53,6 @@
#define MAX_QUANT_TABLES 8
#define MAX_CONTEXT_INPUTS 5
-extern const uint8_t ff_log2_run[41];
-
typedef struct VlcState {
int16_t drift;
uint16_t error_sum;
@@ -118,8 +115,6 @@ typedef struct FFV1Context {
int gob_count;
int quant_table_count;
- DSPContext dsp;
-
struct FFV1Context *slice_context[MAX_SLICES];
int slice_count;
int num_v_slices;
@@ -130,7 +125,8 @@ typedef struct FFV1Context {
int slice_y;
int slice_reset_contexts;
int slice_coding_mode;
- int slice_rct_y_coef;
+ int slice_rct_by_coef;
+ int slice_rct_ry_coef;
} FFV1Context;
int ffv1_common_init(AVCodecContext *avctx);
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c b/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c
index 6c01ebf15f9..a0a50abed4d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c
@@ -260,7 +260,7 @@ static void decode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, int
if (s->slice_coding_mode != 1) {
b -= offset;
r -= offset;
- g -= ((b + r) * s->slice_rct_y_coef) >> 2;
+ g -= (b * s->slice_rct_by_coef + r * s->slice_rct_ry_coef) >> 2;
b += g;
r += g;
}
@@ -334,8 +334,9 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
fs->slice_reset_contexts = get_rac(c, state);
fs->slice_coding_mode = get_symbol(c, state, 0);
if (fs->slice_coding_mode != 1) {
- fs->slice_rct_y_coef = get_symbol(c, state, 0);
- if (fs->slice_rct_y_coef > 2U) {
+ fs->slice_rct_by_coef = get_symbol(c, state, 0);
+ fs->slice_rct_ry_coef = get_symbol(c, state, 0);
+ if ((uint64_t)fs->slice_rct_by_coef + (uint64_t)fs->slice_rct_ry_coef > 4) {
av_log(f->avctx, AV_LOG_ERROR, "slice_rct_y_coef out of range\n");
return AVERROR_INVALIDDATA;
}
@@ -379,16 +380,17 @@ static int decode_slice(AVCodecContext *c, void *arg)
pdst->vlc_state = NULL;
if (fssrc->ac) {
- pdst->state = av_malloc(CONTEXT_SIZE * psrc->context_count);
+ pdst->state = av_malloc_array(CONTEXT_SIZE, psrc->context_count);
memcpy(pdst->state, psrc->state, CONTEXT_SIZE * psrc->context_count);
} else {
- pdst->vlc_state = av_malloc(sizeof(*pdst->vlc_state) * psrc->context_count);
+ pdst->vlc_state = av_malloc_array(sizeof(*pdst->vlc_state), psrc->context_count);
memcpy(pdst->vlc_state, psrc->vlc_state, sizeof(*pdst->vlc_state) * psrc->context_count);
}
}
}
- fs->slice_rct_y_coef = 1;
+ fs->slice_rct_by_coef = 1;
+ fs->slice_rct_ry_coef = 1;
if (f->version > 2) {
if (ffv1_init_slice_state(f, fs) < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffv1enc.c b/chromium/third_party/ffmpeg/libavcodec/ffv1enc.c
index 25a69bf8e07..c7479e649ff 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffv1enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ffv1enc.c
@@ -405,7 +405,7 @@ static int encode_plane(FFV1Context *s, uint8_t *src, int w, int h,
return 0;
}
-static int encode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, int stride[3])
+static int encode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, const int stride[3])
{
int x, y, p, i;
const int ring_size = s->avctx->context_model ? 3 : 2;
@@ -441,7 +441,7 @@ static int encode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, int s
if (s->slice_coding_mode != 1) {
b -= g;
r -= g;
- g += ((b + r) * s->slice_rct_y_coef) >> 2;
+ g += (b * s->slice_rct_by_coef + r * s->slice_rct_ry_coef) >> 2;
b += offset;
r += offset;
}
@@ -560,7 +560,7 @@ static int write_extradata(FFV1Context *f)
if (f->version == 3) {
f->micro_version = 4;
} else if (f->version == 4)
- f->micro_version = 1;
+ f->micro_version = 2;
put_symbol(c, state, f->micro_version, 0);
}
@@ -674,6 +674,10 @@ static av_cold int encode_init(AVCodecContext *avctx)
if ((avctx->flags & (CODEC_FLAG_PASS1|CODEC_FLAG_PASS2)) || avctx->slices>1)
s->version = FFMAX(s->version, 2);
+ // Unspecified level & slices, we choose version 1.2+ to ensure multithreaded decodability
+ if (avctx->slices == 0 && avctx->level < 0 && avctx->width * avctx->height > 720*576)
+ s->version = FFMAX(s->version, 2);
+
if (avctx->level <= 0 && s->version == 2) {
s->version = 3;
}
@@ -999,14 +1003,36 @@ static void encode_slice_header(FFV1Context *f, FFV1Context *fs)
if (fs->slice_coding_mode == 1)
ffv1_clear_slice_state(f, fs);
put_symbol(c, state, fs->slice_coding_mode, 0);
- if (fs->slice_coding_mode != 1)
- put_symbol(c, state, fs->slice_rct_y_coef, 0);
+ if (fs->slice_coding_mode != 1) {
+ put_symbol(c, state, fs->slice_rct_by_coef, 0);
+ put_symbol(c, state, fs->slice_rct_ry_coef, 0);
+ }
}
}
static void choose_rct_params(FFV1Context *fs, uint8_t *src[3], const int stride[3], int w, int h)
{
- int stat[3] = {0};
+#define NB_Y_COEFF 15
+ static const int rct_y_coeff[15][2] = {
+ {0, 0}, // 4G
+ {1, 1}, // R + 2G + B
+ {2, 2}, // 2R + 2B
+ {0, 2}, // 2G + 2B
+ {2, 0}, // 2R + 2G
+ {4, 0}, // 4R
+ {0, 4}, // 4B
+
+ {0, 3}, // 1G + 3B
+ {3, 0}, // 3R + 1G
+ {3, 1}, // 3R + B
+ {1, 3}, // R + 3B
+ {1, 2}, // R + G + 2B
+ {2, 1}, // 2R + G + B
+ {0, 1}, // 3G + B
+ {1, 0}, // R + 3G
+ };
+
+ int stat[NB_Y_COEFF] = {0};
int x, y, i, p, best;
int16_t *sample[3];
int lbd = fs->bits_per_raw_sample <= 8;
@@ -1018,6 +1044,7 @@ static void choose_rct_params(FFV1Context *fs, uint8_t *src[3], const int stride
for (x = 0; x < w; x++) {
int b, g, r;
+ int ab, ag, ar;
if (lbd) {
unsigned v = *((uint32_t*)(src[0] + x*4 + stride[0]*y));
b = v & 0xFF;
@@ -1029,10 +1056,10 @@ static void choose_rct_params(FFV1Context *fs, uint8_t *src[3], const int stride
r = *((uint16_t*)(src[2] + x*2 + stride[2]*y));
}
+ ar = r - lastr;
+ ag = g - lastg;
+ ab = b - lastb;
if (x && y) {
- int ar = r - lastr;
- int ag = g - lastg;
- int ab = b - lastb;
int bg = ag - sample[0][x];
int bb = ab - sample[1][x];
int br = ar - sample[2][x];
@@ -1040,14 +1067,14 @@ static void choose_rct_params(FFV1Context *fs, uint8_t *src[3], const int stride
br -= bg;
bb -= bg;
- stat[0] += FFABS(bg);
- stat[1] += FFABS(bg + ((br+bb)>>2));
- stat[2] += FFABS(bg + ((br+bb)>>1));
+ for (i = 0; i<NB_Y_COEFF; i++) {
+ stat[i] += FFABS(bg + ((br*rct_y_coeff[i][0] + bb*rct_y_coeff[i][1])>>2));
+ }
- sample[0][x] = ag;
- sample[1][x] = ab;
- sample[2][x] = ar;
}
+ sample[0][x] = ag;
+ sample[1][x] = ab;
+ sample[2][x] = ar;
lastr = r;
lastg = g;
@@ -1056,12 +1083,13 @@ static void choose_rct_params(FFV1Context *fs, uint8_t *src[3], const int stride
}
best = 0;
- for (i=1; i<=2; i++) {
+ for (i=1; i<NB_Y_COEFF; i++) {
if (stat[i] < stat[best])
best = i;
}
- fs->slice_rct_y_coef = best;
+ fs->slice_rct_by_coef = rct_y_coeff[best][1];
+ fs->slice_rct_ry_coef = rct_y_coeff[best][0];
}
static int encode_slice(AVCodecContext *c, void *arg)
@@ -1084,7 +1112,8 @@ static int encode_slice(AVCodecContext *c, void *arg)
if (f->version > 3) {
choose_rct_params(fs, planes, p->linesize, width, height);
} else {
- fs->slice_rct_y_coef = 1;
+ fs->slice_rct_by_coef = 1;
+ fs->slice_rct_ry_coef = 1;
}
retry:
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c b/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c
index a62746d61c5..4a5031a8cae 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c
@@ -93,7 +93,6 @@ struct wavesynth_context {
int64_t cur_ts;
int64_t next_ts;
int32_t *sin;
- AVFrame frame;
struct ws_interval *inter;
uint32_t dither_state;
uint32_t pink_state;
@@ -341,8 +340,6 @@ static av_cold int wavesynth_init(AVCodecContext *avc)
ws->pink_need += ws->inter[i].type == WS_NOISE;
ws->pink_state = MKTAG('P','I','N','K');
ws->pink_pos = PINK_UNIT;
- avcodec_get_frame_defaults(&ws->frame);
- avc->coded_frame = &ws->frame;
wavesynth_seek(ws, 0);
avc->sample_fmt = AV_SAMPLE_FMT_S16;
return 0;
@@ -428,6 +425,7 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
AVPacket *packet)
{
struct wavesynth_context *ws = avc->priv_data;
+ AVFrame *frame = rframe;
int64_t ts;
int duration;
int s, c, r;
@@ -443,11 +441,11 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
duration = AV_RL32(packet->data + 8);
if (duration <= 0)
return AVERROR(EINVAL);
- ws->frame.nb_samples = duration;
- r = ff_get_buffer(avc, &ws->frame, 0);
+ frame->nb_samples = duration;
+ r = ff_get_buffer(avc, frame, 0);
if (r < 0)
return r;
- pcm = (int16_t *)ws->frame.data[0];
+ pcm = (int16_t *)frame->data[0];
for (s = 0; s < duration; s++, ts++) {
memset(channels, 0, avc->channels * sizeof(*channels));
if (ts >= ws->next_ts)
@@ -458,7 +456,6 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
}
ws->cur_ts += duration;
*rgot_frame = 1;
- *(AVFrame *)rframe = ws->frame;
return packet->size;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/fic.c b/chromium/third_party/ffmpeg/libavcodec/fic.c
new file mode 100644
index 00000000000..d08d240efef
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/fic.c
@@ -0,0 +1,459 @@
+/*
+ * Mirillis FIC decoder
+ *
+ * Copyright (c) 2014 Konstantin Shishkov
+ * Copyright (c) 2014 Derek Buitenhuis
+ *
+ * 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 "libavutil/common.h"
+#include "avcodec.h"
+#include "internal.h"
+#include "get_bits.h"
+#include "golomb.h"
+
+typedef struct FICThreadContext {
+ DECLARE_ALIGNED(16, int16_t, block)[64];
+ uint8_t *src;
+ int slice_h;
+ int src_size;
+ int y_off;
+} FICThreadContext;
+
+typedef struct FICContext {
+ AVCodecContext *avctx;
+ AVFrame *frame;
+ AVFrame *final_frame;
+
+ FICThreadContext *slice_data;
+ int slice_data_size;
+
+ const uint8_t *qmat;
+
+ enum AVPictureType cur_frame_type;
+
+ int aligned_width, aligned_height;
+ int num_slices, slice_h;
+
+ uint8_t cursor_buf[4096];
+} FICContext;
+
+static const uint8_t fic_qmat_hq[64] = {
+ 1, 2, 2, 2, 3, 3, 3, 4,
+ 2, 2, 2, 3, 3, 3, 4, 4,
+ 2, 2, 3, 3, 3, 4, 4, 4,
+ 2, 2, 3, 3, 3, 4, 4, 5,
+ 2, 3, 3, 3, 4, 4, 5, 6,
+ 3, 3, 3, 4, 4, 5, 6, 7,
+ 3, 3, 3, 4, 4, 5, 7, 7,
+ 3, 3, 4, 4, 5, 7, 7, 7,
+};
+
+static const uint8_t fic_qmat_lq[64] = {
+ 1, 5, 6, 7, 8, 9, 9, 11,
+ 5, 5, 7, 8, 9, 9, 11, 12,
+ 6, 7, 8, 9, 9, 11, 11, 12,
+ 7, 7, 8, 9, 9, 11, 12, 13,
+ 7, 8, 9, 9, 10, 11, 13, 16,
+ 8, 9, 9, 10, 11, 13, 16, 19,
+ 8, 9, 9, 11, 12, 15, 18, 23,
+ 9, 9, 11, 12, 15, 18, 23, 27
+};
+
+static const uint8_t fic_header[7] = { 0, 0, 1, 'F', 'I', 'C', 'V' };
+
+#define FIC_HEADER_SIZE 27
+
+static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd)
+{
+ const int t0 = 27246 * blk[3 * step] + 18405 * blk[5 * step];
+ const int t1 = 27246 * blk[5 * step] - 18405 * blk[3 * step];
+ const int t2 = 6393 * blk[7 * step] + 32139 * blk[1 * step];
+ const int t3 = 6393 * blk[1 * step] - 32139 * blk[7 * step];
+ const int t4 = 5793 * (t2 + t0 + 0x800 >> 12);
+ const int t5 = 5793 * (t3 + t1 + 0x800 >> 12);
+ const int t6 = t2 - t0;
+ const int t7 = t3 - t1;
+ const int t8 = 17734 * blk[2 * step] - 42813 * blk[6 * step];
+ const int t9 = 17734 * blk[6 * step] + 42814 * blk[2 * step];
+ const int tA = (blk[0 * step] - blk[4 * step] << 15) + rnd;
+ const int tB = (blk[0 * step] + blk[4 * step] << 15) + rnd;
+ blk[0 * step] = ( t4 + t9 + tB) >> shift;
+ blk[1 * step] = ( t6 + t7 + t8 + tA) >> shift;
+ blk[2 * step] = ( t6 - t7 - t8 + tA) >> shift;
+ blk[3 * step] = ( t5 - t9 + tB) >> shift;
+ blk[4 * step] = ( -t5 - t9 + tB) >> shift;
+ blk[5 * step] = (-(t6 - t7) - t8 + tA) >> shift;
+ blk[6 * step] = (-(t6 + t7) + t8 + tA) >> shift;
+ blk[7 * step] = ( -t4 + t9 + tB) >> shift;
+}
+
+static void fic_idct_put(uint8_t *dst, int stride, int16_t *block)
+{
+ int i, j;
+ int16_t *ptr;
+
+ ptr = block;
+ fic_idct(ptr++, 8, 13, (1 << 12) + (1 << 17));
+ for (i = 1; i < 8; i++) {
+ fic_idct(ptr, 8, 13, 1 << 12);
+ ptr++;
+ }
+
+ ptr = block;
+ for (i = 0; i < 8; i++) {
+ fic_idct(ptr, 1, 20, 0);
+ ptr += 8;
+ }
+
+ ptr = block;
+ for (j = 0; j < 8; j++) {
+ for (i = 0; i < 8; i++)
+ dst[i] = av_clip_uint8(ptr[i]);
+ dst += stride;
+ ptr += 8;
+ }
+}
+static int fic_decode_block(FICContext *ctx, GetBitContext *gb,
+ uint8_t *dst, int stride, int16_t *block)
+{
+ int i, num_coeff;
+
+ /* Is it a skip block? */
+ if (get_bits1(gb)) {
+ /* This is a P-frame. */
+ ctx->frame->key_frame = 0;
+ ctx->frame->pict_type = AV_PICTURE_TYPE_P;
+
+ return 0;
+ }
+
+ memset(block, 0, sizeof(*block) * 64);
+
+ num_coeff = get_bits(gb, 7);
+ if (num_coeff > 64)
+ return AVERROR_INVALIDDATA;
+
+ for (i = 0; i < num_coeff; i++)
+ block[ff_zigzag_direct[i]] = get_se_golomb(gb) *
+ ctx->qmat[ff_zigzag_direct[i]];
+
+ fic_idct_put(dst, stride, block);
+
+ return 0;
+}
+
+static int fic_decode_slice(AVCodecContext *avctx, void *tdata)
+{
+ FICContext *ctx = avctx->priv_data;
+ FICThreadContext *tctx = tdata;
+ GetBitContext gb;
+ uint8_t *src = tctx->src;
+ int slice_h = tctx->slice_h;
+ int src_size = tctx->src_size;
+ int y_off = tctx->y_off;
+ int x, y, p;
+
+ init_get_bits(&gb, src, src_size * 8);
+
+ for (p = 0; p < 3; p++) {
+ int stride = ctx->frame->linesize[p];
+ uint8_t* dst = ctx->frame->data[p] + (y_off >> !!p) * stride;
+
+ for (y = 0; y < (slice_h >> !!p); y += 8) {
+ for (x = 0; x < (ctx->aligned_width >> !!p); x += 8) {
+ int ret;
+
+ if ((ret = fic_decode_block(ctx, &gb, dst + x, stride, tctx->block)) != 0)
+ return ret;
+ }
+
+ dst += 8 * stride;
+ }
+ }
+
+ return 0;
+}
+
+static av_always_inline void fic_alpha_blend(uint8_t *dst, uint8_t *src,
+ int size, uint8_t *alpha)
+{
+ int i;
+
+ for (i = 0; i < size; i++)
+ dst[i] += ((src[i] - dst[i]) * alpha[i]) >> 8;
+}
+
+static void fic_draw_cursor(AVCodecContext *avctx, int cur_x, int cur_y)
+{
+ FICContext *ctx = avctx->priv_data;
+ uint8_t *ptr = ctx->cursor_buf;
+ uint8_t *dstptr[3];
+ uint8_t planes[4][1024];
+ uint8_t chroma[3][256];
+ int i, j, p;
+
+ /* Convert to YUVA444. */
+ for (i = 0; i < 1024; i++) {
+ planes[0][i] = (( 25 * ptr[0] + 129 * ptr[1] + 66 * ptr[2]) / 255) + 16;
+ planes[1][i] = ((-38 * ptr[0] + 112 * ptr[1] + -74 * ptr[2]) / 255) + 128;
+ planes[2][i] = ((-18 * ptr[0] + 112 * ptr[1] + -94 * ptr[2]) / 255) + 128;
+ planes[3][i] = ptr[3];
+
+ ptr += 4;
+ }
+
+ /* Subsample chroma. */
+ for (i = 0; i < 32; i += 2)
+ for (j = 0; j < 32; j += 2)
+ for (p = 0; p < 3; p++)
+ chroma[p][16 * (i / 2) + j / 2] = (planes[p + 1][32 * i + j ] +
+ planes[p + 1][32 * i + j + 1] +
+ planes[p + 1][32 * (i + 1) + j ] +
+ planes[p + 1][32 * (i + 1) + j + 1]) / 4;
+
+ /* Seek to x/y pos of cursor. */
+ for (i = 0; i < 3; i++)
+ dstptr[i] = ctx->final_frame->data[i] +
+ (ctx->final_frame->linesize[i] * (cur_y >> !!i)) +
+ (cur_x >> !!i) + !!i;
+
+ /* Copy. */
+ for (i = 0; i < FFMIN(32, avctx->height - cur_y) - 1; i += 2) {
+ int lsize = FFMIN(32, avctx->width - cur_x);
+ int csize = lsize / 2;
+
+ fic_alpha_blend(dstptr[0],
+ planes[0] + i * 32, lsize, planes[3] + i * 32);
+ fic_alpha_blend(dstptr[0] + ctx->final_frame->linesize[0],
+ planes[0] + (i + 1) * 32, lsize, planes[3] + (i + 1) * 32);
+ fic_alpha_blend(dstptr[1],
+ chroma[0] + (i / 2) * 16, csize, chroma[2] + (i / 2) * 16);
+ fic_alpha_blend(dstptr[2],
+ chroma[1] + (i / 2) * 16, csize, chroma[2] + (i / 2) * 16);
+
+ dstptr[0] += ctx->final_frame->linesize[0] * 2;
+ dstptr[1] += ctx->final_frame->linesize[1];
+ dstptr[2] += ctx->final_frame->linesize[2];
+ }
+}
+
+static int fic_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
+{
+ FICContext *ctx = avctx->priv_data;
+ uint8_t *src = avpkt->data;
+ int ret;
+ int slice, nslices;
+ int msize;
+ int tsize;
+ int cur_x, cur_y;
+ int skip_cursor = 0;
+ uint8_t *sdata;
+
+ if ((ret = ff_reget_buffer(avctx, ctx->frame)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ return ret;
+ }
+
+ /* Header + at least one slice (4) */
+ if (avpkt->size < FIC_HEADER_SIZE + 4) {
+ av_log(avctx, AV_LOG_ERROR, "Frame data is too small.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ /* Check for header. */
+ if (memcmp(src, fic_header, 7))
+ av_log(avctx, AV_LOG_WARNING, "Invalid FIC Header.\n");
+
+ /* Is it a skip frame? */
+ if (src[17])
+ goto skip;
+
+ nslices = src[13];
+ if (!nslices) {
+ av_log(avctx, AV_LOG_ERROR, "Zero slices found.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ /* High or Low Quality Matrix? */
+ ctx->qmat = src[23] ? fic_qmat_hq : fic_qmat_lq;
+
+ /* Skip cursor data. */
+ tsize = AV_RB24(src + 24);
+ if (tsize > avpkt->size - FIC_HEADER_SIZE) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Packet is too small to contain cursor (%d vs %d bytes).\n",
+ tsize, avpkt->size - FIC_HEADER_SIZE);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (tsize < 32) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Cursor data too small. Skipping cursor.\n");
+ skip_cursor = 1;
+ }
+
+ /* Cursor position. */
+ cur_x = AV_RL16(src + 33);
+ cur_y = AV_RL16(src + 35);
+ if (cur_x > avctx->width || cur_y > avctx->height) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Invalid cursor position: (%d,%d). Skipping cusor.\n",
+ cur_x, cur_y);
+ skip_cursor = 1;
+ }
+
+ if (AV_RL16(src + 37) != 32 || AV_RL16(src + 39) != 32) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Invalid cursor size. Skipping cursor.\n");
+ skip_cursor = 1;
+ }
+
+ /* Slice height for all but the last slice. */
+ ctx->slice_h = 16 * (ctx->aligned_height >> 4) / nslices;
+ if (ctx->slice_h % 16)
+ ctx->slice_h = FFALIGN(ctx->slice_h - 16, 16);
+
+ /* First slice offset and remaining data. */
+ sdata = src + tsize + FIC_HEADER_SIZE + 4 * nslices;
+ msize = avpkt->size - nslices * 4 - tsize - FIC_HEADER_SIZE;
+
+ if (msize <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "Not enough frame data to decode.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ /*
+ * Set the frametype to I initially. It will be set to P if the frame
+ * has any dependencies (skip blocks). There will be a race condition
+ * inside the slice decode function to set these, but we do not care.
+ * since they will only ever be set to 0/P.
+ */
+ ctx->frame->key_frame = 1;
+ ctx->frame->pict_type = AV_PICTURE_TYPE_I;
+
+ /* Allocate slice data. */
+ av_fast_malloc(&ctx->slice_data, &ctx->slice_data_size,
+ nslices * sizeof(ctx->slice_data[0]));
+ if (!ctx->slice_data_size) {
+ av_log(avctx, AV_LOG_ERROR, "Could not allocate slice data.\n");
+ return AVERROR(ENOMEM);
+ }
+ memset(ctx->slice_data, 0, nslices * sizeof(ctx->slice_data[0]));
+
+ for (slice = 0; slice < nslices; slice++) {
+ unsigned slice_off = AV_RB32(src + tsize + FIC_HEADER_SIZE + slice * 4);
+ unsigned slice_size;
+ int y_off = ctx->slice_h * slice;
+ int slice_h = ctx->slice_h;
+
+ /*
+ * Either read the slice size, or consume all data left.
+ * Also, special case the last slight height.
+ */
+ if (slice == nslices - 1) {
+ slice_size = msize;
+ slice_h = FFALIGN(avctx->height - ctx->slice_h * (nslices - 1), 16);
+ } else {
+ slice_size = AV_RB32(src + tsize + FIC_HEADER_SIZE + slice * 4 + 4);
+ }
+
+ if (slice_size < slice_off || slice_size > msize)
+ continue;
+
+ slice_size -= slice_off;
+
+ ctx->slice_data[slice].src = sdata + slice_off;
+ ctx->slice_data[slice].src_size = slice_size;
+ ctx->slice_data[slice].slice_h = slice_h;
+ ctx->slice_data[slice].y_off = y_off;
+ }
+
+ if ((ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
+ NULL, nslices, sizeof(ctx->slice_data[0]))) < 0)
+ return ret;
+
+ av_frame_free(&ctx->final_frame);
+ ctx->final_frame = av_frame_clone(ctx->frame);
+ if (!ctx->final_frame) {
+ av_log(avctx, AV_LOG_ERROR, "Could not clone frame buffer.\n");
+ return AVERROR(ENOMEM);
+ }
+
+ /* Make sure we use a user-supplied buffer. */
+ if ((ret = ff_reget_buffer(avctx, ctx->final_frame)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Could not make frame writable.\n");
+ return ret;
+ }
+
+ /* Draw cursor. */
+ if (!skip_cursor) {
+ memcpy(ctx->cursor_buf, src + 59, 32 * 32 * 4);
+ fic_draw_cursor(avctx, cur_x, cur_y);
+ }
+
+skip:
+ *got_frame = 1;
+ if ((ret = av_frame_ref(data, ctx->final_frame)) < 0)
+ return ret;
+
+ return avpkt->size;
+}
+
+static av_cold int fic_decode_close(AVCodecContext *avctx)
+{
+ FICContext *ctx = avctx->priv_data;
+
+ av_freep(&ctx->slice_data);
+ av_frame_free(&ctx->final_frame);
+ av_frame_free(&ctx->frame);
+
+ return 0;
+}
+
+static av_cold int fic_decode_init(AVCodecContext *avctx)
+{
+ FICContext *ctx = avctx->priv_data;
+
+ /* Initialize various context values */
+ ctx->avctx = avctx;
+ ctx->aligned_width = FFALIGN(avctx->width, 16);
+ ctx->aligned_height = FFALIGN(avctx->height, 16);
+
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P;
+ avctx->bits_per_raw_sample = 8;
+
+ ctx->frame = av_frame_alloc();
+ if (!ctx->frame)
+ return AVERROR(ENOMEM);
+
+ return 0;
+}
+
+AVCodec ff_fic_decoder = {
+ .name = "fic",
+ .long_name = NULL_IF_CONFIG_SMALL("Mirillis FIC"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_FIC,
+ .priv_data_size = sizeof(FICContext),
+ .init = fic_decode_init,
+ .decode = fic_decode_frame,
+ .close = fic_decode_close,
+ .capabilities = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/flac_parser.c b/chromium/third_party/ffmpeg/libavcodec/flac_parser.c
index ba1f060fd9e..3178ee5e553 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flac_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flac_parser.c
@@ -489,6 +489,14 @@ static int get_best_header(FLACParseContext* fpc, const uint8_t **poutbuf,
&fpc->wrap_buf,
&fpc->wrap_buf_allocated_size);
+
+ if (fpc->pc->flags & PARSER_FLAG_USE_CODEC_TS){
+ if (header->fi.is_var_size)
+ fpc->pc->pts = header->fi.frame_or_sample_num;
+ else if (header->best_child)
+ fpc->pc->pts = header->fi.frame_or_sample_num * header->fi.blocksize;
+ }
+
fpc->best_header_valid = 0;
fpc->last_fi_valid = 1;
fpc->last_fi = header->fi;
@@ -516,6 +524,11 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
s->duration = fi.blocksize;
if (!avctx->sample_rate)
avctx->sample_rate = fi.samplerate;
+ if (fpc->pc->flags & PARSER_FLAG_USE_CODEC_TS){
+ fpc->pc->pts = fi.frame_or_sample_num;
+ if (!fi.is_var_size)
+ fpc->pc->pts *= fi.blocksize;
+ }
}
*poutbuf = buf;
*poutbuf_size = buf_size;
@@ -599,7 +612,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
if ( av_fifo_space(fpc->fifo_buf) < read_end - read_start
&& av_fifo_realloc2(fpc->fifo_buf, (read_end - read_start) + 2*av_fifo_size(fpc->fifo_buf)) < 0) {
av_log(avctx, AV_LOG_ERROR,
- "couldn't reallocate buffer of size %td\n",
+ "couldn't reallocate buffer of size %"PTRDIFF_SPECIFIER"\n",
(read_end - read_start) + av_fifo_size(fpc->fifo_buf));
goto handle_error;
}
@@ -711,7 +724,7 @@ static void flac_parse_close(AVCodecParserContext *c)
av_free(curr);
curr = temp;
}
- av_fifo_free(fpc->fifo_buf);
+ av_fifo_freep(&fpc->fifo_buf);
av_free(fpc->wrap_buf);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/flacdec.c b/chromium/third_party/ffmpeg/libavcodec/flacdec.c
index 596b24d76d1..ec3cbffbf42 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flacdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flacdec.c
@@ -221,6 +221,12 @@ static int decode_residuals(FLACContext *s, int32_t *decoded, int pred_order)
rice_order = get_bits(&s->gb, 4);
samples= s->blocksize >> rice_order;
+ if (samples << rice_order != s->blocksize) {
+ av_log(s->avctx, AV_LOG_ERROR, "invalid rice order: %i blocksize %i\n",
+ rice_order, s->blocksize);
+ return AVERROR_INVALIDDATA;
+ }
+
if (pred_order > samples) {
av_log(s->avctx, AV_LOG_ERROR, "invalid predictor order: %i > %i\n",
pred_order, samples);
@@ -506,12 +512,12 @@ static int flac_decode_frame(AVCodecContext *avctx, void *data,
}
if (buf_size > 5 && !memcmp(buf, "\177FLAC", 5)) {
- av_log(s->avctx, AV_LOG_DEBUG, "skiping flac header packet 1\n");
+ av_log(s->avctx, AV_LOG_DEBUG, "skipping flac header packet 1\n");
return buf_size;
}
if (buf_size > 0 && (*buf & 0x7F) == FLAC_METADATA_TYPE_VORBIS_COMMENT) {
- av_log(s->avctx, AV_LOG_DEBUG, "skiping vorbis comment\n");
+ av_log(s->avctx, AV_LOG_DEBUG, "skipping vorbis comment\n");
return buf_size;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/flacdsp.c b/chromium/third_party/ffmpeg/libavcodec/flacdsp.c
index 02eba3ea8af..b15bc7476b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flacdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flacdsp.c
@@ -128,4 +128,6 @@ av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt,
if (ARCH_ARM)
ff_flacdsp_init_arm(c, fmt, bps);
+ if (ARCH_X86)
+ ff_flacdsp_init_x86(c, fmt, bps);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/flacdsp.h b/chromium/third_party/ffmpeg/libavcodec/flacdsp.h
index 5e66dc2f109..272cf2a6749 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flacdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/flacdsp.h
@@ -33,5 +33,6 @@ typedef struct FLACDSPContext {
void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int bps);
void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt, int bps);
+void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int bps);
#endif /* AVCODEC_FLACDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/flacdsp_lpc_template.c b/chromium/third_party/ffmpeg/libavcodec/flacdsp_lpc_template.c
index 0c453aee8e2..acdac042b6e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flacdsp_lpc_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flacdsp_lpc_template.c
@@ -139,3 +139,21 @@ static void FUNC(flac_lpc_encode_c)(int32_t *res, const int32_t *smp, int len,
}
#endif
}
+
+/* Comment for clarity/de-obfuscation.
+ *
+ * for (int i = order; i < len; i++) {
+ * int32_t p = 0;
+ * for (int j = 0; j < order; j++) {
+ * int c = coefs[j];
+ * int s = smp[(i-1)-j];
+ * p += c*s;
+ * }
+ * res[i] = smp[i] - (p >> shift);
+ * }
+ *
+ * The CONFIG_SMALL code above simplifies to this, in the case of SAMPLE_SIZE
+ * not being equal to 32 (at the present time that means for 16-bit audio). The
+ * code above does 2 samples per iteration. Commit bfdd5bc ( made all the way
+ * back in 2007) says that way is faster.
+ */
diff --git a/chromium/third_party/ffmpeg/libavcodec/flacenc.c b/chromium/third_party/ffmpeg/libavcodec/flacenc.c
index 1fc8c4ce6bd..b6ae4af9a73 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flacenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flacenc.c
@@ -649,7 +649,7 @@ static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax,
tmp_rc.coding_mode = rc->coding_mode;
- udata = av_malloc(n * sizeof(uint32_t));
+ udata = av_malloc_array(n, sizeof(uint32_t));
for (i = 0; i < n; i++)
udata[i] = (2*data[i]) ^ (data[i]>>31);
diff --git a/chromium/third_party/ffmpeg/libavcodec/flashsv.c b/chromium/third_party/ffmpeg/libavcodec/flashsv.c
index 981d7744075..8791a2d750c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flashsv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flashsv.c
@@ -69,7 +69,7 @@ typedef struct FlashSVContext {
int diff_start, diff_height;
} FlashSVContext;
-static int decode_hybrid(const uint8_t *sptr, uint8_t *dptr, int dx, int dy,
+static int decode_hybrid(const uint8_t *sptr, const uint8_t *sptr_end, uint8_t *dptr, int dx, int dy,
int h, int w, int stride, const uint32_t *pal)
{
int x, y;
@@ -78,6 +78,8 @@ static int decode_hybrid(const uint8_t *sptr, uint8_t *dptr, int dx, int dy,
for (y = dx + h; y > dx; y--) {
uint8_t *dst = dptr + (y * stride) + dy * 3;
for (x = 0; x < w; x++) {
+ if (sptr >= sptr_end)
+ return AVERROR_INVALIDDATA;
if (*sptr & 0x80) {
/* 15-bit color */
unsigned c = AV_RB16(sptr) & ~0x8000;
@@ -232,10 +234,15 @@ static int flashsv_decode_block(AVCodecContext *avctx, AVPacket *avpkt,
}
} else {
/* hybrid 15-bit/palette mode */
- decode_hybrid(s->tmpblock, s->frame->data[0],
+ ret = decode_hybrid(s->tmpblock, s->zstream.next_out,
+ s->frame->data[0],
s->image_height - (y_pos + 1 + s->diff_height),
x_pos, s->diff_height, width,
s->frame->linesize[0], s->pal);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "decode_hybrid failed\n");
+ return ret;
+ }
}
skip_bits_long(gb, 8 * block_size); /* skip the consumed bits */
return 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/flashsv2enc.c b/chromium/third_party/ffmpeg/libavcodec/flashsv2enc.c
index 2115a465946..436daa4be23 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flashsv2enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flashsv2enc.c
@@ -87,7 +87,6 @@ typedef struct FlashSV2Context {
AVCodecContext *avctx;
uint8_t *current_frame;
uint8_t *key_frame;
- AVFrame frame;
uint8_t *encbuffer;
uint8_t *keybuffer;
uint8_t *databuffer;
@@ -849,15 +848,12 @@ static int reconfigure_at_keyframe(FlashSV2Context * s, const uint8_t * image,
}
static int flashsv2_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
- const AVFrame *pict, int *got_packet)
+ const AVFrame *p, int *got_packet)
{
FlashSV2Context *const s = avctx->priv_data;
- AVFrame *const p = &s->frame;
int res;
int keyframe = 0;
- *p = *pict;
-
if ((res = ff_alloc_packet2(avctx, pkt, s->frame_size + FF_MIN_BUFFER_SIZE)) < 0)
return res;
@@ -891,18 +887,11 @@ static int flashsv2_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (keyframe) {
new_key_frame(s);
- p->pict_type = AV_PICTURE_TYPE_I;
- p->key_frame = 1;
s->last_key_frame = avctx->frame_number;
pkt->flags |= AV_PKT_FLAG_KEY;
av_log(avctx, AV_LOG_DEBUG, "Inserting key frame at frame %d\n", avctx->frame_number);
- } else {
- p->pict_type = AV_PICTURE_TYPE_P;
- p->key_frame = 0;
}
- avctx->coded_frame = p;
-
pkt->size = res;
*got_packet = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/flvdec.c b/chromium/third_party/ffmpeg/libavcodec/flvdec.c
index f425f004243..3b048f666df 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flvdec.c
@@ -22,11 +22,12 @@
#include "flv.h"
#include "libavutil/imgutils.h"
-void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last){
+void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last)
+{
int is11 = get_bits1(gb);
*last = get_bits1(gb);
- *run = get_bits(gb, 6);
- if(is11){
+ *run = get_bits(gb, 6);
+ if (is11) {
*level = get_sbits(gb, 11);
} else {
*level = get_sbits(gb, 7);
@@ -47,45 +48,45 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
av_log(s->avctx, AV_LOG_ERROR, "Bad picture format\n");
return AVERROR_INVALIDDATA;
}
- s->h263_flv = format+1;
+ s->h263_flv = format + 1;
s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */
- format = get_bits(&s->gb, 3);
+ format = get_bits(&s->gb, 3);
switch (format) {
case 0:
- width = get_bits(&s->gb, 8);
+ width = get_bits(&s->gb, 8);
height = get_bits(&s->gb, 8);
break;
case 1:
- width = get_bits(&s->gb, 16);
+ width = get_bits(&s->gb, 16);
height = get_bits(&s->gb, 16);
break;
case 2:
- width = 352;
+ width = 352;
height = 288;
break;
case 3:
- width = 176;
+ width = 176;
height = 144;
break;
case 4:
- width = 128;
+ width = 128;
height = 96;
break;
case 5:
- width = 320;
+ width = 320;
height = 240;
break;
case 6:
- width = 160;
+ width = 160;
height = 120;
break;
default:
width = height = 0;
break;
}
- if(av_image_check_size(width, height, 0, s->avctx))
+ if (av_image_check_size(width, height, 0, s->avctx))
return AVERROR(EINVAL);
- s->width = width;
+ s->width = width;
s->height = height;
s->pict_type = AV_PICTURE_TYPE_I + get_bits(&s->gb, 2);
@@ -94,29 +95,29 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
s->pict_type = AV_PICTURE_TYPE_P;
skip_bits1(&s->gb); /* deblocking flag */
- s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
+ s->chroma_qscale = s->qscale = get_bits(&s->gb, 5);
s->h263_plus = 0;
- s->unrestricted_mv = 1;
+ s->unrestricted_mv = 1;
s->h263_long_vectors = 0;
/* PEI */
if (skip_1stop_8data_bits(&s->gb) < 0)
return AVERROR_INVALIDDATA;
+
s->f_code = 1;
if (s->ehc_mode)
s->avctx->sample_aspect_ratio= (AVRational){1,2};
- if(s->avctx->debug & FF_DEBUG_PICT_INFO){
+ if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
av_log(s->avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n",
s->droppable ? 'D' : av_get_picture_type_char(s->pict_type),
s->h263_flv - 1, s->qscale, s->picture_number);
}
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
+ s->y_dc_scale_table = s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
return 0;
}
@@ -132,5 +133,8 @@ AVCodec ff_flv_decoder = {
.decode = ff_h263_decode_frame,
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
.max_lowres = 3,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/frame_thread_encoder.c b/chromium/third_party/ffmpeg/libavcodec/frame_thread_encoder.c
index b9acefc1101..9ab7c3475e9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/frame_thread_encoder.c
+++ b/chromium/third_party/ffmpeg/libavcodec/frame_thread_encoder.c
@@ -125,6 +125,31 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
|| !(avctx->codec->capabilities & CODEC_CAP_INTRA_ONLY))
return 0;
+ if( !avctx->thread_count
+ && avctx->codec_id == AV_CODEC_ID_MJPEG
+ && !(avctx->flags & CODEC_FLAG_QSCALE)) {
+ av_log(avctx, AV_LOG_DEBUG,
+ "Forcing thread count to 1 for MJPEG encoding, use -thread_type slice "
+ "or a constant quantizer if you want to use multiple cpu cores\n");
+ avctx->thread_count = 1;
+ }
+ if( avctx->thread_count > 1
+ && avctx->codec_id == AV_CODEC_ID_MJPEG
+ && !(avctx->flags & CODEC_FLAG_QSCALE))
+ av_log(avctx, AV_LOG_WARNING,
+ "MJPEG CBR encoding works badly with frame multi-threading, consider "
+ "using -threads 1, -thread_type slice or a constant quantizer.\n");
+
+ if (avctx->codec_id == AV_CODEC_ID_HUFFYUV ||
+ avctx->codec_id == AV_CODEC_ID_FFVHUFF) {
+ // huffyuv does not support these with multiple frame threads currently
+ if (avctx->context_model > 0 || (avctx->flags & CODEC_FLAG_PASS1)) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Forcing thread count to 1 for huffyuv encoding with first pass or context 1\n");
+ avctx->thread_count = 1;
+ }
+ }
+
if(!avctx->thread_count) {
avctx->thread_count = av_cpu_count();
avctx->thread_count = FFMIN(avctx->thread_count, MAX_THREADS);
@@ -209,7 +234,7 @@ void ff_frame_thread_encoder_free(AVCodecContext *avctx){
pthread_mutex_destroy(&c->buffer_mutex);
pthread_cond_destroy(&c->task_fifo_cond);
pthread_cond_destroy(&c->finished_task_cond);
- av_fifo_free(c->task_fifo); c->task_fifo = NULL;
+ av_fifo_freep(&c->task_fifo);
av_freep(&avctx->internal->frame_thread_encoder);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/fraps.c b/chromium/third_party/ffmpeg/libavcodec/fraps.c
index 225da112994..4f89af1e580 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fraps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fraps.c
@@ -207,7 +207,8 @@ static int decode_frame(AVCodecContext *avctx,
f->key_frame = 1;
avctx->pix_fmt = version & 1 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_YUVJ420P;
- avctx->color_range = version & 1 ? AVCOL_RANGE_UNSPECIFIED : AVCOL_RANGE_JPEG;
+ avctx->color_range = version & 1 ? AVCOL_RANGE_UNSPECIFIED
+ : AVCOL_RANGE_JPEG;
avctx->colorspace = version & 1 ? AVCOL_SPC_UNSPECIFIED : AVCOL_SPC_BT709;
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/g2meet.c b/chromium/third_party/ffmpeg/libavcodec/g2meet.c
index 8f8e88047a4..700eb338c41 100644
--- a/chromium/third_party/ffmpeg/libavcodec/g2meet.c
+++ b/chromium/third_party/ffmpeg/libavcodec/g2meet.c
@@ -24,6 +24,7 @@
* Go2Webinar decoder
*/
+#include <inttypes.h>
#include <zlib.h>
#include "libavutil/intreadwrite.h"
@@ -35,7 +36,7 @@
#include "mjpeg.h"
enum ChunkType {
- FRAME_INFO = 0xC8,
+ DISPLAY_INFO = 0xC8,
TILE_DATA,
CURSOR_POS,
CURSOR_SHAPE,
@@ -198,8 +199,8 @@ static int jpg_decode_block(JPGContext *c, GetBitContext *gb,
return AVERROR_INVALIDDATA;
if (dc)
dc = get_xbits(gb, dc);
- dc = dc * qmat[0] + c->prev_dc[plane];
- block[0] = dc;
+ dc = dc * qmat[0] + c->prev_dc[plane];
+ block[0] = dc;
c->prev_dc[plane] = dc;
pos = 0;
@@ -214,8 +215,8 @@ static int jpg_decode_block(JPGContext *c, GetBitContext *gb,
if (val) {
int nbits = val;
- val = get_xbits(gb, nbits);
- val *= qmat[ff_zigzag_direct[pos]];
+ val = get_xbits(gb, nbits);
+ val *= qmat[ff_zigzag_direct[pos]];
block[c->scantable.permutated[pos]] = val;
}
}
@@ -253,19 +254,25 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
mb_h = (height + 15) >> 4;
if (!num_mbs)
- num_mbs = mb_w * mb_h;
+ num_mbs = mb_w * mb_h * 4;
for (i = 0; i < 3; i++)
c->prev_dc[i] = 1024;
bx = by = 0;
+ c->dsp.clear_blocks(c->block[0]);
for (mb_y = 0; mb_y < mb_h; mb_y++) {
for (mb_x = 0; mb_x < mb_w; mb_x++) {
- if (mask && !mask[mb_x]) {
+ if (mask && !mask[mb_x * 2] && !mask[mb_x * 2 + 1] &&
+ !mask[mb_x * 2 + mask_stride] &&
+ !mask[mb_x * 2 + 1 + mask_stride]) {
bx += 16;
continue;
}
for (j = 0; j < 2; j++) {
for (i = 0; i < 2; i++) {
+ if (mask && !mask[mb_x * 2 + i + j * mask_stride])
+ continue;
+ num_mbs--;
if ((ret = jpg_decode_block(c, &gb, 0,
c->block[i + j * 2])) != 0)
return ret;
@@ -290,14 +297,14 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
}
}
- if (!--num_mbs)
+ if (!num_mbs)
return 0;
bx += 16;
}
bx = 0;
by += 16;
if (mask)
- mask += mask_stride;
+ mask += mask_stride * 2;
}
return 0;
@@ -353,7 +360,7 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
width = FFMIN(c->width - tile_x * c->tile_width, c->tile_width);
height = FFMIN(c->height - tile_y * c->tile_height, c->tile_height);
- hdr = *src++;
+ hdr = *src++;
sub_type = hdr >> 5;
if (sub_type == 0) {
int j;
@@ -375,19 +382,21 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
npal = *src++ + 1;
if (src_end - src < npal * 3)
return AVERROR_INVALIDDATA;
- memcpy(pal, src, npal * 3); src += npal * 3;
+ memcpy(pal, src, npal * 3);
+ src += npal * 3;
if (sub_type != 2) {
for (i = 0; i < npal; i++) {
if (!memcmp(pal + i * 3, transp, 3)) {
- tidx = i;
- break;
+ tidx = i;
+ break;
}
}
}
if (src_end - src < 2)
return 0;
- zsize = (src[0] << 8) | src[1]; src += 2;
+ zsize = (src[0] << 8) | src[1];
+ src += 2;
if (src_end - src < zsize + (sub_type != 2))
return AVERROR_INVALIDDATA;
@@ -405,7 +414,7 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
nblocks = *src++ + 1;
cblocks = 0;
- bstride = FFALIGN(width, 16) >> 4;
+ bstride = FFALIGN(width, 16) >> 3;
// blocks are coded LSB and we need normal bitreader for JPEG data
bits = 0;
for (i = 0; i < (FFALIGN(height, 16) >> 4); i++) {
@@ -422,14 +431,17 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
cblocks += coded;
if (cblocks > nblocks)
return AVERROR_INVALIDDATA;
- c->kempf_flags[j + i * bstride] = coded;
+ c->kempf_flags[j * 2 + i * 2 * bstride] =
+ c->kempf_flags[j * 2 + 1 + i * 2 * bstride] =
+ c->kempf_flags[j * 2 + (i * 2 + 1) * bstride] =
+ c->kempf_flags[j * 2 + 1 + (i * 2 + 1) * bstride] = coded;
}
}
memset(c->jpeg_tile, 0, c->tile_stride * height);
jpg_decode_data(&c->jc, width, height, src, src_end - src,
c->jpeg_tile, c->tile_stride,
- c->kempf_flags, bstride, nblocks, 0);
+ c->kempf_flags, bstride, nblocks * 4, 0);
kempf_restore_buf(c->kempf_buf, dlen, dst, c->framebuf_stride,
c->jpeg_tile, c->tile_stride,
@@ -482,30 +494,30 @@ static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
uint32_t cursor_hot_x, cursor_hot_y;
int cursor_fmt, err;
- cur_size = bytestream2_get_be32(gb);
- cursor_w = bytestream2_get_byte(gb);
- cursor_h = bytestream2_get_byte(gb);
- cursor_hot_x = bytestream2_get_byte(gb);
- cursor_hot_y = bytestream2_get_byte(gb);
- cursor_fmt = bytestream2_get_byte(gb);
+ cur_size = bytestream2_get_be32(gb);
+ cursor_w = bytestream2_get_byte(gb);
+ cursor_h = bytestream2_get_byte(gb);
+ cursor_hot_x = bytestream2_get_byte(gb);
+ cursor_hot_y = bytestream2_get_byte(gb);
+ cursor_fmt = bytestream2_get_byte(gb);
cursor_stride = FFALIGN(cursor_w, cursor_fmt==1 ? 32 : 1) * 4;
if (cursor_w < 1 || cursor_w > 256 ||
cursor_h < 1 || cursor_h > 256) {
- av_log(avctx, AV_LOG_ERROR, "Invalid cursor dimensions %dx%d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid cursor dimensions %"PRIu32"x%"PRIu32"\n",
cursor_w, cursor_h);
return AVERROR_INVALIDDATA;
}
if (cursor_hot_x > cursor_w || cursor_hot_y > cursor_h) {
- av_log(avctx, AV_LOG_WARNING, "Invalid hotspot position %d,%d\n",
+ av_log(avctx, AV_LOG_WARNING, "Invalid hotspot position %"PRIu32",%"PRIu32"\n",
cursor_hot_x, cursor_hot_y);
cursor_hot_x = FFMIN(cursor_hot_x, cursor_w - 1);
cursor_hot_y = FFMIN(cursor_hot_y, cursor_h - 1);
}
if (cur_size - 9 > bytestream2_get_bytes_left(gb) ||
c->cursor_w * c->cursor_h / 4 > cur_size) {
- av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size %d/%d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size %"PRIu32"/%u\n",
cur_size, bytestream2_get_bytes_left(gb));
return AVERROR_INVALIDDATA;
}
@@ -535,7 +547,7 @@ static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
bits = bytestream2_get_be32(gb);
for (k = 0; k < 32; k++) {
dst[0] = !!(bits & 0x80000000);
- dst += 4;
+ dst += 4;
bits <<= 1;
}
}
@@ -549,18 +561,24 @@ static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
int mask_bit = !!(bits & 0x80000000);
switch (dst[0] * 2 + mask_bit) {
case 0:
- dst[0] = 0xFF; dst[1] = 0x00;
- dst[2] = 0x00; dst[3] = 0x00;
+ dst[0] = 0xFF;
+ dst[1] = 0x00;
+ dst[2] = 0x00;
+ dst[3] = 0x00;
break;
case 1:
- dst[0] = 0xFF; dst[1] = 0xFF;
- dst[2] = 0xFF; dst[3] = 0xFF;
+ dst[0] = 0xFF;
+ dst[1] = 0xFF;
+ dst[2] = 0xFF;
+ dst[3] = 0xFF;
break;
default:
- dst[0] = 0x00; dst[1] = 0x00;
- dst[2] = 0x00; dst[3] = 0x00;
+ dst[0] = 0x00;
+ dst[1] = 0x00;
+ dst[2] = 0x00;
+ dst[3] = 0x00;
}
- dst += 4;
+ dst += 4;
bits <<= 1;
}
}
@@ -645,8 +663,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
GetByteContext bc, tbc;
int magic;
int got_header = 0;
- uint32_t chunk_size;
- int chunk_type;
+ uint32_t chunk_size, r_mask, g_mask, b_mask;
+ int chunk_type, chunk_start;
int i;
int ret;
@@ -672,18 +690,20 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
while (bytestream2_get_bytes_left(&bc) > 5) {
- chunk_size = bytestream2_get_le32(&bc) - 1;
- chunk_type = bytestream2_get_byte(&bc);
+ chunk_size = bytestream2_get_le32(&bc) - 1;
+ chunk_type = bytestream2_get_byte(&bc);
+ chunk_start = bytestream2_tell(&bc);
if (chunk_size > bytestream2_get_bytes_left(&bc)) {
- av_log(avctx, AV_LOG_ERROR, "Invalid chunk size %d type %02X\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid chunk size %"PRIu32" type %02X\n",
chunk_size, chunk_type);
break;
}
switch (chunk_type) {
- case FRAME_INFO:
+ case DISPLAY_INFO:
+ got_header =
c->got_header = 0;
if (chunk_size < 21) {
- av_log(avctx, AV_LOG_ERROR, "Invalid frame info size %d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid display info size %"PRIu32"\n",
chunk_size);
break;
}
@@ -697,14 +717,18 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
ret = AVERROR_INVALIDDATA;
goto header_fail;
}
- if (c->width != avctx->width || c->height != avctx->height)
- ff_set_dimensions(avctx, c->width, c->height);
+ if (c->width != avctx->width || c->height != avctx->height) {
+ ret = ff_set_dimensions(avctx, c->width, c->height);
+ if (ret < 0)
+ goto header_fail;
+ }
c->compression = bytestream2_get_be32(&bc);
if (c->compression != 2 && c->compression != 3) {
av_log(avctx, AV_LOG_ERROR,
"Unknown compression method %d\n",
c->compression);
- return AVERROR_PATCHWELCOME;
+ ret = AVERROR_PATCHWELCOME;
+ goto header_fail;
}
c->tile_width = bytestream2_get_be32(&bc);
c->tile_height = bytestream2_get_be32(&bc);
@@ -718,9 +742,30 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
c->tiles_x = (c->width + c->tile_width - 1) / c->tile_width;
c->tiles_y = (c->height + c->tile_height - 1) / c->tile_height;
- c->bpp = bytestream2_get_byte(&bc);
- chunk_size -= 21;
- bytestream2_skip(&bc, chunk_size);
+ c->bpp = bytestream2_get_byte(&bc);
+ if (c->bpp == 32) {
+ if (bytestream2_get_bytes_left(&bc) < 16 ||
+ (chunk_size - 21) < 16) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Display info: missing bitmasks!\n");
+ ret = AVERROR_INVALIDDATA;
+ goto header_fail;
+ }
+ r_mask = bytestream2_get_be32(&bc);
+ g_mask = bytestream2_get_be32(&bc);
+ b_mask = bytestream2_get_be32(&bc);
+ if (r_mask != 0xFF0000 || g_mask != 0xFF00 || b_mask != 0xFF) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid or unsupported bitmasks: R=%"PRIX32", G=%"PRIX32", B=%"PRIX32"\n",
+ r_mask, g_mask, b_mask);
+ ret = AVERROR_PATCHWELCOME;
+ goto header_fail;
+ }
+ } else {
+ avpriv_request_sample(avctx, "bpp=%d", c->bpp);
+ ret = AVERROR_PATCHWELCOME;
+ goto header_fail;
+ }
if (g2m_init_buffers(c)) {
ret = AVERROR(ENOMEM);
goto header_fail;
@@ -730,12 +775,11 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
case TILE_DATA:
if (!c->tiles_x || !c->tiles_y) {
av_log(avctx, AV_LOG_WARNING,
- "No frame header - skipping tile\n");
- bytestream2_skip(&bc, bytestream2_get_bytes_left(&bc));
+ "No display info - skipping tile\n");
break;
}
if (chunk_size < 2) {
- av_log(avctx, AV_LOG_ERROR, "Invalid tile data size %d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid tile data size %"PRIu32"\n",
chunk_size);
break;
}
@@ -747,7 +791,6 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
c->tile_x, c->tile_y, c->tiles_x, c->tiles_y);
break;
}
- chunk_size -= 2;
ret = 0;
switch (c->compression) {
case COMPR_EPIC_J_B:
@@ -757,44 +800,42 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
case COMPR_KEMPF_J_B:
ret = kempf_decode_tile(c, c->tile_x, c->tile_y,
buf + bytestream2_tell(&bc),
- chunk_size);
+ chunk_size - 2);
break;
}
if (ret && c->framebuf)
av_log(avctx, AV_LOG_ERROR, "Error decoding tile %d,%d\n",
c->tile_x, c->tile_y);
- bytestream2_skip(&bc, chunk_size);
break;
case CURSOR_POS:
if (chunk_size < 5) {
- av_log(avctx, AV_LOG_ERROR, "Invalid cursor pos size %d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid cursor pos size %"PRIu32"\n",
chunk_size);
break;
}
c->cursor_x = bytestream2_get_be16(&bc);
c->cursor_y = bytestream2_get_be16(&bc);
- bytestream2_skip(&bc, chunk_size - 4);
break;
case CURSOR_SHAPE:
if (chunk_size < 8) {
- av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size %d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size %"PRIu32"\n",
chunk_size);
break;
}
bytestream2_init(&tbc, buf + bytestream2_tell(&bc),
chunk_size - 4);
g2m_load_cursor(avctx, c, &tbc);
- bytestream2_skip(&bc, chunk_size);
break;
case CHUNK_CC:
case CHUNK_CD:
- bytestream2_skip(&bc, chunk_size);
break;
default:
- av_log(avctx, AV_LOG_WARNING, "Skipping chunk type %02X\n",
+ av_log(avctx, AV_LOG_WARNING, "Skipping chunk type %02d\n",
chunk_type);
- bytestream2_skip(&bc, chunk_size);
}
+
+ /* navigate to next chunk */
+ bytestream2_skip(&bc, chunk_start + chunk_size - bytestream2_tell(&bc));
}
if (got_header)
c->got_header = 1;
@@ -808,7 +849,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
for (i = 0; i < avctx->height; i++)
memcpy(pic->data[0] + i * pic->linesize[0],
- c->framebuf + i * c->framebuf_stride,
+ c->framebuf + i * c->framebuf_stride,
c->width * 3);
g2m_paint_cursor(c, pic->data[0], pic->linesize[0]);
@@ -816,15 +857,18 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
return buf_size;
+
header_fail:
- c->width = c->height = 0;
- c->tiles_x = c->tiles_y = 0;
+ c->width =
+ c->height = 0;
+ c->tiles_x =
+ c->tiles_y = 0;
return ret;
}
static av_cold int g2m_decode_init(AVCodecContext *avctx)
{
- G2MContext * const c = avctx->priv_data;
+ G2MContext *const c = avctx->priv_data;
int ret;
if ((ret = jpg_init(avctx, &c->jc)) != 0) {
@@ -840,7 +884,7 @@ static av_cold int g2m_decode_init(AVCodecContext *avctx)
static av_cold int g2m_decode_end(AVCodecContext *avctx)
{
- G2MContext * const c = avctx->priv_data;
+ G2MContext *const c = avctx->priv_data;
jpg_free_context(&c->jc);
diff --git a/chromium/third_party/ffmpeg/libavcodec/g723_1.c b/chromium/third_party/ffmpeg/libavcodec/g723_1.c
index 09da7665b80..e4bde2afd12 100644
--- a/chromium/third_party/ffmpeg/libavcodec/g723_1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/g723_1.c
@@ -2285,7 +2285,8 @@ static int pack_bitstream(G723_1_Context *p, unsigned char *frame, int size)
if (p->cur_rate == RATE_6300) {
info_bits = 0;
put_bits(&pb, 2, info_bits);
- }
+ }else
+ av_assert0(0);
put_bits(&pb, 8, p->lsp_index[2]);
put_bits(&pb, 8, p->lsp_index[1]);
diff --git a/chromium/third_party/ffmpeg/libavcodec/g729postfilter.c b/chromium/third_party/ffmpeg/libavcodec/g729postfilter.c
index fc903740edd..bcf509cfcc6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/g729postfilter.c
+++ b/chromium/third_party/ffmpeg/libavcodec/g729postfilter.c
@@ -389,7 +389,7 @@ static int16_t long_term_filter(DSPContext *dsp, int pitch_delay_int,
lt_filt_factor_a = (gain_den << 15) / (gain_den + gain_num);
}
#else
- L64_temp0 = ((int64_t)gain_num) << (sh_gain_num - 1);
+ L64_temp0 = (((int64_t)gain_num) << sh_gain_num) >> 1;
L64_temp1 = ((int64_t)gain_den) << sh_gain_den;
lt_filt_factor_a = FFMAX((L64_temp1 << 15) / (L64_temp1 + L64_temp0), MIN_LT_FILT_FACTOR_A);
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/get_bits.h b/chromium/third_party/ffmpeg/libavcodec/get_bits.h
index 7824e5ab0fd..ddcef50bd03 100644
--- a/chromium/third_party/ffmpeg/libavcodec/get_bits.h
+++ b/chromium/third_party/ffmpeg/libavcodec/get_bits.h
@@ -219,7 +219,7 @@ static inline void skip_bits_long(GetBitContext *s, int n)
}
/**
- * read mpeg1 dc style vlc (sign bit + mantisse with no MSB).
+ * read mpeg1 dc style vlc (sign bit + mantissa with no MSB).
* if MSB not set it is negative
* @param n length in bits
*/
@@ -513,7 +513,7 @@ void ff_free_vlc(VLC *vlc);
SKIP_BITS(name, gb, n); \
} while (0)
-#define GET_RL_VLC(level, run, name, gb, table, bits, \
+#define GET_RL_VLC_INTERNAL(level, run, name, gb, table, bits, \
max_depth, need_update) \
do { \
int n, nb_bits; \
@@ -642,6 +642,25 @@ static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2],
return r;
}
+#define GET_RL_VLC(level, run, name, gb, table, bits, \
+ max_depth, need_update) \
+ do { \
+ int show = SHOW_UBITS(name, gb, 24); \
+ int len; \
+ int pos = name ## _index; \
+ \
+ GET_RL_VLC_INTERNAL(level, run, name, gb, table, bits,max_depth, need_update); \
+ \
+ len = name ## _index - pos + 1; \
+ show = show >> (24 - len); \
+ \
+ print_bin(show, len); \
+ \
+ av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d/%-3d rlv @%5d in %s %s:%d\n",\
+ show, len, run-1, level, pos, __FILE__, __PRETTY_FUNCTION__, __LINE__);\
+ } while (0) \
+
+
static inline int get_xbits_trace(GetBitContext *s, int n, const char *file,
const char *func, int line)
{
@@ -666,6 +685,7 @@ static inline int get_xbits_trace(GetBitContext *s, int n, const char *file,
#else //TRACE
#define tprintf(p, ...) { }
+#define GET_RL_VLC GET_RL_VLC_INTERNAL
#endif
#endif /* AVCODEC_GET_BITS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/gifdec.c b/chromium/third_party/ffmpeg/libavcodec/gifdec.c
index c7b9ac87263..78c8900628d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/gifdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/gifdec.c
@@ -237,8 +237,12 @@ static int gif_read_image(GifState *s, AVFrame *frame)
pass = 0;
y1 = 0;
for (y = 0; y < height; y++) {
- if (ff_lzw_decode(s->lzw, s->idx_line, width) == 0)
+ int count = ff_lzw_decode(s->lzw, s->idx_line, width);
+ if (count != width) {
+ if (count)
+ av_log(s->avctx, AV_LOG_ERROR, "LZW decode failed\n");
goto decode_tail;
+ }
pr = ptr + width;
diff --git a/chromium/third_party/ffmpeg/libavcodec/golomb.h b/chromium/third_party/ffmpeg/libavcodec/golomb.h
index 43875dc85c4..1c4e2106ee1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/golomb.h
+++ b/chromium/third_party/ffmpeg/libavcodec/golomb.h
@@ -214,6 +214,18 @@ static inline int get_se_golomb(GetBitContext *gb)
}
}
+static inline int get_se_golomb_long(GetBitContext *gb)
+{
+ unsigned int buf = get_ue_golomb_long(gb);
+
+ if (buf & 1)
+ buf = (buf + 1) >> 1;
+ else
+ buf = -(buf >> 1);
+
+ return buf;
+}
+
static inline int svq3_get_se_golomb(GetBitContext *gb)
{
unsigned int buf;
diff --git a/chromium/third_party/ffmpeg/libavcodec/h261data.c b/chromium/third_party/ffmpeg/libavcodec/h261data.c
index 0d1f305418d..a9891edd0a6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h261data.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h261data.c
@@ -26,6 +26,7 @@
#include <stdint.h>
+#include "mpegutils.h"
#include "rl.h"
#include "h261.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/h261dec.c b/chromium/third_party/ffmpeg/libavcodec/h261dec.c
index 49f1b4a199b..95587f2be0a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h261dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h261dec.c
@@ -27,6 +27,7 @@
#include "libavutil/avassert.h"
#include "avcodec.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "h263.h"
#include "h261.h"
@@ -431,6 +432,13 @@ static int h261_decode_mb(H261Context *h)
s->mv[0][0][0] = h->current_mv_x * 2; // gets divided by 2 in motion compensation
s->mv[0][0][1] = h->current_mv_y * 2;
+ if (s->current_picture.motion_val[0]) {
+ int b_stride = 2*s->mb_width + 1;
+ int b_xy = 2 * s->mb_x + (2 * s->mb_y) * b_stride;
+ s->current_picture.motion_val[0][b_xy][0] = s->mv[0][0][0];
+ s->current_picture.motion_val[0][b_xy][1] = s->mv[0][0][1];
+ }
+
intra:
/* decode each block */
if (s->mb_intra || HAS_CBP(h->mtype)) {
@@ -609,8 +617,8 @@ retry:
}
// for skipping the frame
- s->current_picture.f.pict_type = s->pict_type;
- s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+ s->current_picture.f->pict_type = s->pict_type;
+ s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||
@@ -633,10 +641,10 @@ retry:
}
ff_MPV_frame_end(s);
- av_assert0(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type);
- av_assert0(s->current_picture.f.pict_type == s->pict_type);
+ av_assert0(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type);
+ av_assert0(s->current_picture.f->pict_type == s->pict_type);
- if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
return ret;
ff_print_debug_info(s, s->current_picture_ptr, pict);
diff --git a/chromium/third_party/ffmpeg/libavcodec/h261enc.c b/chromium/third_party/ffmpeg/libavcodec/h261enc.c
index e185f5ec0aa..47696e583f9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h261enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h261enc.c
@@ -28,6 +28,7 @@
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "avcodec.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "h263.h"
#include "h261.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/h263.c b/chromium/third_party/ffmpeg/libavcodec/h263.c
index dafc4ecbb51..77d5f75d56d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h263.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h263.c
@@ -34,6 +34,7 @@
#include "h263.h"
#include "h263data.h"
#include "mathops.h"
+#include "mpegutils.h"
#include "unary.h"
#include "flv.h"
#include "mpeg4video.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/h263dec.c b/chromium/third_party/ffmpeg/libavcodec/h263dec.c
index 1fbc08a5068..7db4c0cc941 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h263dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h263dec.c
@@ -58,7 +58,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
if (avctx->codec->id == AV_CODEC_ID_MSS2)
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
else
- avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);
+ avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
s->unrestricted_mv = 1;
/* select sub codec */
@@ -110,7 +110,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
return AVERROR(ENOSYS);
}
s->codec_id = avctx->codec->id;
- avctx->hwaccel = ff_find_hwaccel(avctx);
if (avctx->stream_codec_tag == AV_RL32("l263") && avctx->extradata_size == 56 && avctx->extradata[0] == 1)
s->ehc_mode = 1;
@@ -233,6 +232,8 @@ static int decode_slice(MpegEncContext *s)
s->mv_type = MV_TYPE_16X16;
av_dlog(s, "%d %d %06X\n",
ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
+
+ tprintf(NULL, "Decoding MB at %dx%d\n", s->mb_x, s->mb_y);
ret = s->decode_mb(s, s->block);
if (s->pict_type != AV_PICTURE_TYPE_B)
@@ -269,6 +270,8 @@ static int decode_slice(MpegEncContext *s)
ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
s->mb_x, s->mb_y, ER_MB_ERROR & part_mask);
+ if (s->err_recognition & AV_EF_IGNORE_ERR)
+ continue;
return AVERROR_INVALIDDATA;
}
@@ -317,6 +320,17 @@ static int decode_slice(MpegEncContext *s)
}
}
+ if (s->codec_id == AV_CODEC_ID_H263 &&
+ (s->workaround_bugs & FF_BUG_AUTODETECT) &&
+ get_bits_left(&s->gb) >= 8 &&
+ get_bits_left(&s->gb) < 300 &&
+ s->pict_type == AV_PICTURE_TYPE_I &&
+ show_bits(&s->gb, 8) == 0 &&
+ !s->data_partitioning) {
+
+ s->padding_bug_score += 32;
+ }
+
if (s->workaround_bugs & FF_BUG_AUTODETECT) {
if (s->padding_bug_score > -2 && !s->data_partitioning)
s->workaround_bugs |= FF_BUG_NO_PADDING;
@@ -381,7 +395,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (buf_size == 0) {
/* special case for last picture */
if (s->low_delay == 0 && s->next_picture_ptr) {
- if ((ret = av_frame_ref(pict, &s->next_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0)
return ret;
s->next_picture_ptr = NULL;
@@ -442,7 +456,7 @@ retry:
/* We need to set current_picture_ptr before reading the header,
* otherwise we cannot store anyting in there */
- if (s->current_picture_ptr == NULL || s->current_picture_ptr->f.data[0]) {
+ if (s->current_picture_ptr == NULL || s->current_picture_ptr->f->data[0]) {
int i = ff_find_unused_picture(s, 0);
if (i < 0)
return i;
@@ -518,8 +532,8 @@ retry:
s->gob_index = ff_h263_get_gob_height(s);
// for skipping the frame
- s->current_picture.f.pict_type = s->pict_type;
- s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+ s->current_picture.f->pict_type = s->pict_type;
+ s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
/* skip B-frames if we don't have reference frames */
if (s->last_picture_ptr == NULL &&
@@ -554,7 +568,7 @@ retry:
ff_thread_finish_setup(avctx);
if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) {
- ff_vdpau_mpeg4_decode_picture(s, s->gb.buffer, s->gb.buffer_end - s->gb.buffer);
+ ff_vdpau_mpeg4_decode_picture(avctx->priv_data, s->gb.buffer, s->gb.buffer_end - s->gb.buffer);
goto frame_end;
}
@@ -627,15 +641,15 @@ frame_end:
if (!s->divx_packed && avctx->hwaccel)
ff_thread_finish_setup(avctx);
- av_assert1(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type);
- av_assert1(s->current_picture.f.pict_type == s->pict_type);
+ av_assert1(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type);
+ av_assert1(s->current_picture.f->pict_type == s->pict_type);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
return ret;
ff_print_debug_info(s, s->current_picture_ptr, pict);
ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_QSCALE_TYPE_MPEG1);
} else if (s->last_picture_ptr != NULL) {
- if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
return ret;
ff_print_debug_info(s, s->last_picture_ptr, pict);
ff_mpv_export_qp_table(s, pict, s->last_picture_ptr, FF_QSCALE_TYPE_MPEG1);
@@ -667,10 +681,10 @@ frame_end:
}
const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = {
-#if CONFIG_VAAPI
+#if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL
AV_PIX_FMT_VAAPI_VLD,
#endif
-#if CONFIG_VDPAU
+#if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU,
#endif
AV_PIX_FMT_YUV420P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264.c b/chromium/third_party/ffmpeg/libavcodec/h264.c
index a6218535af0..82bbb1b18ec 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264.c
@@ -28,19 +28,21 @@
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
+#include "libavutil/stereo3d.h"
+#include "libavutil/timer.h"
#include "internal.h"
#include "cabac.h"
#include "cabac_functions.h"
#include "dsputil.h"
#include "error_resilience.h"
#include "avcodec.h"
-#include "mpegvideo.h"
#include "h264.h"
#include "h264data.h"
#include "h264chroma.h"
#include "h264_mvpred.h"
#include "golomb.h"
#include "mathops.h"
+#include "mpegutils.h"
#include "rectangle.h"
#include "svq3.h"
#include "thread.h"
@@ -48,147 +50,8 @@
#include <assert.h>
-static void flush_change(H264Context *h);
-
const uint16_t ff_h264_mb_sizes[4] = { 256, 384, 512, 768 };
-static const uint8_t rem6[QP_MAX_NUM + 1] = {
- 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2,
- 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
- 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2,
- 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
- 0, 1, 2, 3,
-};
-
-static const uint8_t div6[QP_MAX_NUM + 1] = {
- 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3,
- 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6,
- 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10,
- 10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,13,13,13, 13, 13, 13,
- 14,14,14,14,
-};
-
-static const uint8_t field_scan[16+1] = {
- 0 + 0 * 4, 0 + 1 * 4, 1 + 0 * 4, 0 + 2 * 4,
- 0 + 3 * 4, 1 + 1 * 4, 1 + 2 * 4, 1 + 3 * 4,
- 2 + 0 * 4, 2 + 1 * 4, 2 + 2 * 4, 2 + 3 * 4,
- 3 + 0 * 4, 3 + 1 * 4, 3 + 2 * 4, 3 + 3 * 4,
-};
-
-static const uint8_t field_scan8x8[64+1] = {
- 0 + 0 * 8, 0 + 1 * 8, 0 + 2 * 8, 1 + 0 * 8,
- 1 + 1 * 8, 0 + 3 * 8, 0 + 4 * 8, 1 + 2 * 8,
- 2 + 0 * 8, 1 + 3 * 8, 0 + 5 * 8, 0 + 6 * 8,
- 0 + 7 * 8, 1 + 4 * 8, 2 + 1 * 8, 3 + 0 * 8,
- 2 + 2 * 8, 1 + 5 * 8, 1 + 6 * 8, 1 + 7 * 8,
- 2 + 3 * 8, 3 + 1 * 8, 4 + 0 * 8, 3 + 2 * 8,
- 2 + 4 * 8, 2 + 5 * 8, 2 + 6 * 8, 2 + 7 * 8,
- 3 + 3 * 8, 4 + 1 * 8, 5 + 0 * 8, 4 + 2 * 8,
- 3 + 4 * 8, 3 + 5 * 8, 3 + 6 * 8, 3 + 7 * 8,
- 4 + 3 * 8, 5 + 1 * 8, 6 + 0 * 8, 5 + 2 * 8,
- 4 + 4 * 8, 4 + 5 * 8, 4 + 6 * 8, 4 + 7 * 8,
- 5 + 3 * 8, 6 + 1 * 8, 6 + 2 * 8, 5 + 4 * 8,
- 5 + 5 * 8, 5 + 6 * 8, 5 + 7 * 8, 6 + 3 * 8,
- 7 + 0 * 8, 7 + 1 * 8, 6 + 4 * 8, 6 + 5 * 8,
- 6 + 6 * 8, 6 + 7 * 8, 7 + 2 * 8, 7 + 3 * 8,
- 7 + 4 * 8, 7 + 5 * 8, 7 + 6 * 8, 7 + 7 * 8,
-};
-
-static const uint8_t field_scan8x8_cavlc[64+1] = {
- 0 + 0 * 8, 1 + 1 * 8, 2 + 0 * 8, 0 + 7 * 8,
- 2 + 2 * 8, 2 + 3 * 8, 2 + 4 * 8, 3 + 3 * 8,
- 3 + 4 * 8, 4 + 3 * 8, 4 + 4 * 8, 5 + 3 * 8,
- 5 + 5 * 8, 7 + 0 * 8, 6 + 6 * 8, 7 + 4 * 8,
- 0 + 1 * 8, 0 + 3 * 8, 1 + 3 * 8, 1 + 4 * 8,
- 1 + 5 * 8, 3 + 1 * 8, 2 + 5 * 8, 4 + 1 * 8,
- 3 + 5 * 8, 5 + 1 * 8, 4 + 5 * 8, 6 + 1 * 8,
- 5 + 6 * 8, 7 + 1 * 8, 6 + 7 * 8, 7 + 5 * 8,
- 0 + 2 * 8, 0 + 4 * 8, 0 + 5 * 8, 2 + 1 * 8,
- 1 + 6 * 8, 4 + 0 * 8, 2 + 6 * 8, 5 + 0 * 8,
- 3 + 6 * 8, 6 + 0 * 8, 4 + 6 * 8, 6 + 2 * 8,
- 5 + 7 * 8, 6 + 4 * 8, 7 + 2 * 8, 7 + 6 * 8,
- 1 + 0 * 8, 1 + 2 * 8, 0 + 6 * 8, 3 + 0 * 8,
- 1 + 7 * 8, 3 + 2 * 8, 2 + 7 * 8, 4 + 2 * 8,
- 3 + 7 * 8, 5 + 2 * 8, 4 + 7 * 8, 5 + 4 * 8,
- 6 + 3 * 8, 6 + 5 * 8, 7 + 3 * 8, 7 + 7 * 8,
-};
-
-// zigzag_scan8x8_cavlc[i] = zigzag_scan8x8[(i/4) + 16*(i%4)]
-static const uint8_t zigzag_scan8x8_cavlc[64+1] = {
- 0 + 0 * 8, 1 + 1 * 8, 1 + 2 * 8, 2 + 2 * 8,
- 4 + 1 * 8, 0 + 5 * 8, 3 + 3 * 8, 7 + 0 * 8,
- 3 + 4 * 8, 1 + 7 * 8, 5 + 3 * 8, 6 + 3 * 8,
- 2 + 7 * 8, 6 + 4 * 8, 5 + 6 * 8, 7 + 5 * 8,
- 1 + 0 * 8, 2 + 0 * 8, 0 + 3 * 8, 3 + 1 * 8,
- 3 + 2 * 8, 0 + 6 * 8, 4 + 2 * 8, 6 + 1 * 8,
- 2 + 5 * 8, 2 + 6 * 8, 6 + 2 * 8, 5 + 4 * 8,
- 3 + 7 * 8, 7 + 3 * 8, 4 + 7 * 8, 7 + 6 * 8,
- 0 + 1 * 8, 3 + 0 * 8, 0 + 4 * 8, 4 + 0 * 8,
- 2 + 3 * 8, 1 + 5 * 8, 5 + 1 * 8, 5 + 2 * 8,
- 1 + 6 * 8, 3 + 5 * 8, 7 + 1 * 8, 4 + 5 * 8,
- 4 + 6 * 8, 7 + 4 * 8, 5 + 7 * 8, 6 + 7 * 8,
- 0 + 2 * 8, 2 + 1 * 8, 1 + 3 * 8, 5 + 0 * 8,
- 1 + 4 * 8, 2 + 4 * 8, 6 + 0 * 8, 4 + 3 * 8,
- 0 + 7 * 8, 4 + 4 * 8, 7 + 2 * 8, 3 + 6 * 8,
- 5 + 5 * 8, 6 + 5 * 8, 6 + 6 * 8, 7 + 7 * 8,
-};
-
-static const uint8_t dequant4_coeff_init[6][3] = {
- { 10, 13, 16 },
- { 11, 14, 18 },
- { 13, 16, 20 },
- { 14, 18, 23 },
- { 16, 20, 25 },
- { 18, 23, 29 },
-};
-
-static const uint8_t dequant8_coeff_init_scan[16] = {
- 0, 3, 4, 3, 3, 1, 5, 1, 4, 5, 2, 5, 3, 1, 5, 1
-};
-
-static const uint8_t dequant8_coeff_init[6][6] = {
- { 20, 18, 32, 19, 25, 24 },
- { 22, 19, 35, 21, 28, 26 },
- { 26, 23, 42, 24, 33, 31 },
- { 28, 25, 45, 26, 35, 33 },
- { 32, 28, 51, 30, 40, 38 },
- { 36, 32, 58, 34, 46, 43 },
-};
-
-static const enum AVPixelFormat h264_hwaccel_pixfmt_list_420[] = {
-#if CONFIG_H264_DXVA2_HWACCEL
- AV_PIX_FMT_DXVA2_VLD,
-#endif
-#if CONFIG_H264_VAAPI_HWACCEL
- AV_PIX_FMT_VAAPI_VLD,
-#endif
-#if CONFIG_H264_VDA_HWACCEL
- AV_PIX_FMT_VDA_VLD,
-#endif
-#if CONFIG_H264_VDPAU_HWACCEL
- AV_PIX_FMT_VDPAU,
-#endif
- AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_NONE
-};
-
-static const enum AVPixelFormat h264_hwaccel_pixfmt_list_jpeg_420[] = {
-#if CONFIG_H264_DXVA2_HWACCEL
- AV_PIX_FMT_DXVA2_VLD,
-#endif
-#if CONFIG_H264_VAAPI_HWACCEL
- AV_PIX_FMT_VAAPI_VLD,
-#endif
-#if CONFIG_H264_VDA_HWACCEL
- AV_PIX_FMT_VDA_VLD,
-#endif
-#if CONFIG_H264_VDPAU_HWACCEL
- AV_PIX_FMT_VDPAU,
-#endif
- AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_NONE
-};
-
int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx)
{
H264Context *h = avctx->priv_data;
@@ -233,8 +96,8 @@ static void h264_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
void ff_h264_draw_horiz_band(H264Context *h, int y, int height)
{
AVCodecContext *avctx = h->avctx;
- Picture *cur = &h->cur_pic;
- Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL;
+ AVFrame *cur = &h->cur_pic.f;
+ AVFrame *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0].f : NULL;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
int vshift = desc->log2_chroma_h;
const int field_pic = h->picture_structure != PICT_FRAME;
@@ -253,11 +116,11 @@ void ff_h264_draw_horiz_band(H264Context *h, int y, int height)
int offset[AV_NUM_DATA_POINTERS];
int i;
- if (cur->f.pict_type == AV_PICTURE_TYPE_B || h->low_delay ||
+ if (cur->pict_type == AV_PICTURE_TYPE_B || h->low_delay ||
(avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
- src = &cur->f;
+ src = cur;
else if (last)
- src = &last->f;
+ src = last;
else
return;
@@ -274,241 +137,6 @@ void ff_h264_draw_horiz_band(H264Context *h, int y, int height)
}
}
-static void unref_picture(H264Context *h, Picture *pic)
-{
- int off = offsetof(Picture, tf) + sizeof(pic->tf);
- int i;
-
- if (!pic->f.buf[0])
- return;
-
- ff_thread_release_buffer(h->avctx, &pic->tf);
- av_buffer_unref(&pic->hwaccel_priv_buf);
-
- av_buffer_unref(&pic->qscale_table_buf);
- av_buffer_unref(&pic->mb_type_buf);
- for (i = 0; i < 2; i++) {
- av_buffer_unref(&pic->motion_val_buf[i]);
- av_buffer_unref(&pic->ref_index_buf[i]);
- }
-
- memset((uint8_t*)pic + off, 0, sizeof(*pic) - off);
-}
-
-static void release_unused_pictures(H264Context *h, int remove_current)
-{
- int i;
-
- /* release non reference frames */
- for (i = 0; i < MAX_PICTURE_COUNT; i++) {
- if (h->DPB[i].f.buf[0] && !h->DPB[i].reference &&
- (remove_current || &h->DPB[i] != h->cur_pic_ptr)) {
- unref_picture(h, &h->DPB[i]);
- }
- }
-}
-
-static int ref_picture(H264Context *h, Picture *dst, Picture *src)
-{
- int ret, i;
-
- av_assert0(!dst->f.buf[0]);
- av_assert0(src->f.buf[0]);
-
- src->tf.f = &src->f;
- dst->tf.f = &dst->f;
- ret = ff_thread_ref_frame(&dst->tf, &src->tf);
- if (ret < 0)
- goto fail;
-
- dst->qscale_table_buf = av_buffer_ref(src->qscale_table_buf);
- dst->mb_type_buf = av_buffer_ref(src->mb_type_buf);
- if (!dst->qscale_table_buf || !dst->mb_type_buf)
- goto fail;
- dst->qscale_table = src->qscale_table;
- dst->mb_type = src->mb_type;
-
- for (i = 0; i < 2; i++) {
- dst->motion_val_buf[i] = av_buffer_ref(src->motion_val_buf[i]);
- dst->ref_index_buf[i] = av_buffer_ref(src->ref_index_buf[i]);
- if (!dst->motion_val_buf[i] || !dst->ref_index_buf[i])
- goto fail;
- dst->motion_val[i] = src->motion_val[i];
- dst->ref_index[i] = src->ref_index[i];
- }
-
- if (src->hwaccel_picture_private) {
- dst->hwaccel_priv_buf = av_buffer_ref(src->hwaccel_priv_buf);
- if (!dst->hwaccel_priv_buf)
- goto fail;
- dst->hwaccel_picture_private = dst->hwaccel_priv_buf->data;
- }
-
- for (i = 0; i < 2; i++)
- dst->field_poc[i] = src->field_poc[i];
-
- memcpy(dst->ref_poc, src->ref_poc, sizeof(src->ref_poc));
- memcpy(dst->ref_count, src->ref_count, sizeof(src->ref_count));
-
- dst->poc = src->poc;
- dst->frame_num = src->frame_num;
- dst->mmco_reset = src->mmco_reset;
- dst->pic_id = src->pic_id;
- dst->long_ref = src->long_ref;
- dst->mbaff = src->mbaff;
- dst->field_picture = src->field_picture;
- dst->needs_realloc = src->needs_realloc;
- dst->reference = src->reference;
- dst->crop = src->crop;
- dst->crop_left = src->crop_left;
- dst->crop_top = src->crop_top;
- dst->recovered = src->recovered;
-
- return 0;
-fail:
- unref_picture(h, dst);
- return ret;
-}
-
-static int alloc_scratch_buffers(H264Context *h, int linesize)
-{
- int alloc_size = FFALIGN(FFABS(linesize) + 32, 32);
-
- if (h->bipred_scratchpad)
- return 0;
-
- h->bipred_scratchpad = av_malloc(16 * 6 * alloc_size);
- // edge emu needs blocksize + filter length - 1
- // (= 21x21 for h264)
- h->edge_emu_buffer = av_mallocz(alloc_size * 2 * 21);
- h->me.scratchpad = av_mallocz(alloc_size * 2 * 16 * 2);
-
- if (!h->bipred_scratchpad || !h->edge_emu_buffer || !h->me.scratchpad) {
- av_freep(&h->bipred_scratchpad);
- av_freep(&h->edge_emu_buffer);
- av_freep(&h->me.scratchpad);
- return AVERROR(ENOMEM);
- }
-
- h->me.temp = h->me.scratchpad;
-
- return 0;
-}
-
-static int init_table_pools(H264Context *h)
-{
- const int big_mb_num = h->mb_stride * (h->mb_height + 1) + 1;
- const int mb_array_size = h->mb_stride * h->mb_height;
- const int b4_stride = h->mb_width * 4 + 1;
- const int b4_array_size = b4_stride * h->mb_height * 4;
-
- h->qscale_table_pool = av_buffer_pool_init(big_mb_num + h->mb_stride,
- av_buffer_allocz);
- h->mb_type_pool = av_buffer_pool_init((big_mb_num + h->mb_stride) *
- sizeof(uint32_t), av_buffer_allocz);
- h->motion_val_pool = av_buffer_pool_init(2 * (b4_array_size + 4) *
- sizeof(int16_t), av_buffer_allocz);
- h->ref_index_pool = av_buffer_pool_init(4 * mb_array_size, av_buffer_allocz);
-
- if (!h->qscale_table_pool || !h->mb_type_pool || !h->motion_val_pool ||
- !h->ref_index_pool) {
- av_buffer_pool_uninit(&h->qscale_table_pool);
- av_buffer_pool_uninit(&h->mb_type_pool);
- av_buffer_pool_uninit(&h->motion_val_pool);
- av_buffer_pool_uninit(&h->ref_index_pool);
- return AVERROR(ENOMEM);
- }
-
- return 0;
-}
-
-static int alloc_picture(H264Context *h, Picture *pic)
-{
- int i, ret = 0;
-
- av_assert0(!pic->f.data[0]);
-
- pic->tf.f = &pic->f;
- ret = ff_thread_get_buffer(h->avctx, &pic->tf, pic->reference ?
- AV_GET_BUFFER_FLAG_REF : 0);
- if (ret < 0)
- goto fail;
-
- h->linesize = pic->f.linesize[0];
- h->uvlinesize = pic->f.linesize[1];
- pic->crop = h->sps.crop;
- pic->crop_top = h->sps.crop_top;
- pic->crop_left= h->sps.crop_left;
-
- if (h->avctx->hwaccel) {
- const AVHWAccel *hwaccel = h->avctx->hwaccel;
- av_assert0(!pic->hwaccel_picture_private);
- if (hwaccel->priv_data_size) {
- pic->hwaccel_priv_buf = av_buffer_allocz(hwaccel->priv_data_size);
- if (!pic->hwaccel_priv_buf)
- return AVERROR(ENOMEM);
- pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data;
- }
- }
-
- if (!h->qscale_table_pool) {
- ret = init_table_pools(h);
- if (ret < 0)
- goto fail;
- }
-
- pic->qscale_table_buf = av_buffer_pool_get(h->qscale_table_pool);
- pic->mb_type_buf = av_buffer_pool_get(h->mb_type_pool);
- if (!pic->qscale_table_buf || !pic->mb_type_buf)
- goto fail;
-
- pic->mb_type = (uint32_t*)pic->mb_type_buf->data + 2 * h->mb_stride + 1;
- pic->qscale_table = pic->qscale_table_buf->data + 2 * h->mb_stride + 1;
-
- for (i = 0; i < 2; i++) {
- pic->motion_val_buf[i] = av_buffer_pool_get(h->motion_val_pool);
- pic->ref_index_buf[i] = av_buffer_pool_get(h->ref_index_pool);
- if (!pic->motion_val_buf[i] || !pic->ref_index_buf[i])
- goto fail;
-
- pic->motion_val[i] = (int16_t (*)[2])pic->motion_val_buf[i]->data + 4;
- pic->ref_index[i] = pic->ref_index_buf[i]->data;
- }
-
- return 0;
-fail:
- unref_picture(h, pic);
- return (ret < 0) ? ret : AVERROR(ENOMEM);
-}
-
-static inline int pic_is_unused(H264Context *h, Picture *pic)
-{
- if (!pic->f.buf[0])
- return 1;
- if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF))
- return 1;
- return 0;
-}
-
-static int find_unused_picture(H264Context *h)
-{
- int i;
-
- for (i = 0; i < MAX_PICTURE_COUNT; i++) {
- if (pic_is_unused(h, &h->DPB[i]))
- break;
- }
- if (i == MAX_PICTURE_COUNT)
- return AVERROR_INVALIDDATA;
-
- if (h->DPB[i].needs_realloc) {
- h->DPB[i].needs_realloc = 0;
- unref_picture(h, &h->DPB[i]);
- }
-
- return i;
-}
-
/**
* Check if the top & left blocks are available if needed and
* change the dc mode so it only uses the available blocks.
@@ -563,7 +191,7 @@ int ff_h264_check_intra4x4_pred_mode(H264Context *h)
int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma)
{
static const int8_t top[4] = { LEFT_DC_PRED8x8, 1, -1, -1 };
- static const int8_t left[5] = { TOP_DC_PRED8x8, -1, 2, -1, DC_128_PRED8x8 };
+ static const int8_t left[5] = { TOP_DC_PRED8x8, -1, 2, -1, DC_128_PRED8x8 };
if (mode > 3U) {
av_log(h->avctx, AV_LOG_ERROR,
@@ -734,464 +362,7 @@ static int decode_rbsp_trailing(H264Context *h, const uint8_t *src)
return 0;
}
-static inline int get_lowest_part_list_y(H264Context *h, Picture *pic, int n,
- int height, int y_offset, int list)
-{
- int raw_my = h->mv_cache[list][scan8[n]][1];
- int filter_height_down = (raw_my & 3) ? 3 : 0;
- int full_my = (raw_my >> 2) + y_offset;
- int bottom = full_my + filter_height_down + height;
-
- av_assert2(height >= 0);
-
- return FFMAX(0, bottom);
-}
-
-static inline void get_lowest_part_y(H264Context *h, int refs[2][48], int n,
- int height, int y_offset, int list0,
- int list1, int *nrefs)
-{
- int my;
-
- y_offset += 16 * (h->mb_y >> MB_FIELD(h));
-
- if (list0) {
- int ref_n = h->ref_cache[0][scan8[n]];
- Picture *ref = &h->ref_list[0][ref_n];
-
- // Error resilience puts the current picture in the ref list.
- // Don't try to wait on these as it will cause a deadlock.
- // Fields can wait on each other, though.
- if (ref->tf.progress->data != h->cur_pic.tf.progress->data ||
- (ref->reference & 3) != h->picture_structure) {
- my = get_lowest_part_list_y(h, ref, n, height, y_offset, 0);
- if (refs[0][ref_n] < 0)
- nrefs[0] += 1;
- refs[0][ref_n] = FFMAX(refs[0][ref_n], my);
- }
- }
-
- if (list1) {
- int ref_n = h->ref_cache[1][scan8[n]];
- Picture *ref = &h->ref_list[1][ref_n];
-
- if (ref->tf.progress->data != h->cur_pic.tf.progress->data ||
- (ref->reference & 3) != h->picture_structure) {
- my = get_lowest_part_list_y(h, ref, n, height, y_offset, 1);
- if (refs[1][ref_n] < 0)
- nrefs[1] += 1;
- refs[1][ref_n] = FFMAX(refs[1][ref_n], my);
- }
- }
-}
-
-/**
- * Wait until all reference frames are available for MC operations.
- *
- * @param h the H264 context
- */
-static void await_references(H264Context *h)
-{
- const int mb_xy = h->mb_xy;
- const int mb_type = h->cur_pic.mb_type[mb_xy];
- int refs[2][48];
- int nrefs[2] = { 0 };
- int ref, list;
-
- memset(refs, -1, sizeof(refs));
-
- if (IS_16X16(mb_type)) {
- get_lowest_part_y(h, refs, 0, 16, 0,
- IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
- } else if (IS_16X8(mb_type)) {
- get_lowest_part_y(h, refs, 0, 8, 0,
- IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
- get_lowest_part_y(h, refs, 8, 8, 8,
- IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
- } else if (IS_8X16(mb_type)) {
- get_lowest_part_y(h, refs, 0, 16, 0,
- IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
- get_lowest_part_y(h, refs, 4, 16, 0,
- IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
- } else {
- int i;
-
- av_assert2(IS_8X8(mb_type));
-
- for (i = 0; i < 4; i++) {
- const int sub_mb_type = h->sub_mb_type[i];
- const int n = 4 * i;
- int y_offset = (i & 2) << 2;
-
- if (IS_SUB_8X8(sub_mb_type)) {
- get_lowest_part_y(h, refs, n, 8, y_offset,
- IS_DIR(sub_mb_type, 0, 0),
- IS_DIR(sub_mb_type, 0, 1),
- nrefs);
- } else if (IS_SUB_8X4(sub_mb_type)) {
- get_lowest_part_y(h, refs, n, 4, y_offset,
- IS_DIR(sub_mb_type, 0, 0),
- IS_DIR(sub_mb_type, 0, 1),
- nrefs);
- get_lowest_part_y(h, refs, n + 2, 4, y_offset + 4,
- IS_DIR(sub_mb_type, 0, 0),
- IS_DIR(sub_mb_type, 0, 1),
- nrefs);
- } else if (IS_SUB_4X8(sub_mb_type)) {
- get_lowest_part_y(h, refs, n, 8, y_offset,
- IS_DIR(sub_mb_type, 0, 0),
- IS_DIR(sub_mb_type, 0, 1),
- nrefs);
- get_lowest_part_y(h, refs, n + 1, 8, y_offset,
- IS_DIR(sub_mb_type, 0, 0),
- IS_DIR(sub_mb_type, 0, 1),
- nrefs);
- } else {
- int j;
- av_assert2(IS_SUB_4X4(sub_mb_type));
- for (j = 0; j < 4; j++) {
- int sub_y_offset = y_offset + 2 * (j & 2);
- get_lowest_part_y(h, refs, n + j, 4, sub_y_offset,
- IS_DIR(sub_mb_type, 0, 0),
- IS_DIR(sub_mb_type, 0, 1),
- nrefs);
- }
- }
- }
- }
-
- for (list = h->list_count - 1; list >= 0; list--)
- for (ref = 0; ref < 48 && nrefs[list]; ref++) {
- int row = refs[list][ref];
- if (row >= 0) {
- Picture *ref_pic = &h->ref_list[list][ref];
- int ref_field = ref_pic->reference - 1;
- int ref_field_picture = ref_pic->field_picture;
- int pic_height = 16 * h->mb_height >> ref_field_picture;
-
- row <<= MB_MBAFF(h);
- nrefs[list]--;
-
- if (!FIELD_PICTURE(h) && ref_field_picture) { // frame referencing two fields
- ff_thread_await_progress(&ref_pic->tf,
- FFMIN((row >> 1) - !(row & 1),
- pic_height - 1),
- 1);
- ff_thread_await_progress(&ref_pic->tf,
- FFMIN((row >> 1), pic_height - 1),
- 0);
- } else if (FIELD_PICTURE(h) && !ref_field_picture) { // field referencing one field of a frame
- ff_thread_await_progress(&ref_pic->tf,
- FFMIN(row * 2 + ref_field,
- pic_height - 1),
- 0);
- } else if (FIELD_PICTURE(h)) {
- ff_thread_await_progress(&ref_pic->tf,
- FFMIN(row, pic_height - 1),
- ref_field);
- } else {
- ff_thread_await_progress(&ref_pic->tf,
- FFMIN(row, pic_height - 1),
- 0);
- }
- }
- }
-}
-
-static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
- int n, int square, int height,
- int delta, int list,
- uint8_t *dest_y, uint8_t *dest_cb,
- uint8_t *dest_cr,
- int src_x_offset, int src_y_offset,
- qpel_mc_func *qpix_op,
- h264_chroma_mc_func chroma_op,
- int pixel_shift, int chroma_idc)
-{
- const int mx = h->mv_cache[list][scan8[n]][0] + src_x_offset * 8;
- int my = h->mv_cache[list][scan8[n]][1] + src_y_offset * 8;
- const int luma_xy = (mx & 3) + ((my & 3) << 2);
- ptrdiff_t offset = ((mx >> 2) << pixel_shift) + (my >> 2) * h->mb_linesize;
- uint8_t *src_y = pic->f.data[0] + offset;
- uint8_t *src_cb, *src_cr;
- int extra_width = 0;
- int extra_height = 0;
- int emu = 0;
- const int full_mx = mx >> 2;
- const int full_my = my >> 2;
- const int pic_width = 16 * h->mb_width;
- const int pic_height = 16 * h->mb_height >> MB_FIELD(h);
- int ysh;
-
- if (mx & 7)
- extra_width -= 3;
- if (my & 7)
- extra_height -= 3;
-
- if (full_mx < 0 - extra_width ||
- full_my < 0 - extra_height ||
- full_mx + 16 /*FIXME*/ > pic_width + extra_width ||
- full_my + 16 /*FIXME*/ > pic_height + extra_height) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
- src_y - (2 << pixel_shift) - 2 * h->mb_linesize,
- h->mb_linesize, h->mb_linesize,
- 16 + 5, 16 + 5 /*FIXME*/, full_mx - 2,
- full_my - 2, pic_width, pic_height);
- src_y = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
- emu = 1;
- }
-
- qpix_op[luma_xy](dest_y, src_y, h->mb_linesize); // FIXME try variable height perhaps?
- if (!square)
- qpix_op[luma_xy](dest_y + delta, src_y + delta, h->mb_linesize);
-
- if (CONFIG_GRAY && h->flags & CODEC_FLAG_GRAY)
- return;
-
- if (chroma_idc == 3 /* yuv444 */) {
- src_cb = pic->f.data[1] + offset;
- if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
- src_cb - (2 << pixel_shift) - 2 * h->mb_linesize,
- h->mb_linesize, h->mb_linesize,
- 16 + 5, 16 + 5 /*FIXME*/,
- full_mx - 2, full_my - 2,
- pic_width, pic_height);
- src_cb = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
- }
- qpix_op[luma_xy](dest_cb, src_cb, h->mb_linesize); // FIXME try variable height perhaps?
- if (!square)
- qpix_op[luma_xy](dest_cb + delta, src_cb + delta, h->mb_linesize);
-
- src_cr = pic->f.data[2] + offset;
- if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
- src_cr - (2 << pixel_shift) - 2 * h->mb_linesize,
- h->mb_linesize, h->mb_linesize,
- 16 + 5, 16 + 5 /*FIXME*/,
- full_mx - 2, full_my - 2,
- pic_width, pic_height);
- src_cr = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
- }
- qpix_op[luma_xy](dest_cr, src_cr, h->mb_linesize); // FIXME try variable height perhaps?
- if (!square)
- qpix_op[luma_xy](dest_cr + delta, src_cr + delta, h->mb_linesize);
- return;
- }
-
- ysh = 3 - (chroma_idc == 2 /* yuv422 */);
- if (chroma_idc == 1 /* yuv420 */ && MB_FIELD(h)) {
- // chroma offset when predicting from a field of opposite parity
- my += 2 * ((h->mb_y & 1) - (pic->reference - 1));
- emu |= (my >> 3) < 0 || (my >> 3) + 8 >= (pic_height >> 1);
- }
-
- src_cb = pic->f.data[1] + ((mx >> 3) << pixel_shift) +
- (my >> ysh) * h->mb_uvlinesize;
- src_cr = pic->f.data[2] + ((mx >> 3) << pixel_shift) +
- (my >> ysh) * h->mb_uvlinesize;
-
- if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cb,
- h->mb_uvlinesize, h->mb_uvlinesize,
- 9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
- pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
- src_cb = h->edge_emu_buffer;
- }
- chroma_op(dest_cb, src_cb, h->mb_uvlinesize,
- height >> (chroma_idc == 1 /* yuv420 */),
- mx & 7, (my << (chroma_idc == 2 /* yuv422 */)) & 7);
-
- if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cr,
- h->mb_uvlinesize, h->mb_uvlinesize,
- 9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
- pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
- src_cr = h->edge_emu_buffer;
- }
- chroma_op(dest_cr, src_cr, h->mb_uvlinesize, height >> (chroma_idc == 1 /* yuv420 */),
- mx & 7, (my << (chroma_idc == 2 /* yuv422 */)) & 7);
-}
-
-static av_always_inline void mc_part_std(H264Context *h, int n, int square,
- int height, int delta,
- uint8_t *dest_y, uint8_t *dest_cb,
- uint8_t *dest_cr,
- int x_offset, int y_offset,
- qpel_mc_func *qpix_put,
- h264_chroma_mc_func chroma_put,
- qpel_mc_func *qpix_avg,
- h264_chroma_mc_func chroma_avg,
- int list0, int list1,
- int pixel_shift, int chroma_idc)
-{
- qpel_mc_func *qpix_op = qpix_put;
- h264_chroma_mc_func chroma_op = chroma_put;
-
- dest_y += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
- if (chroma_idc == 3 /* yuv444 */) {
- dest_cb += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
- dest_cr += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
- } else if (chroma_idc == 2 /* yuv422 */) {
- dest_cb += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
- dest_cr += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
- } else { /* yuv420 */
- dest_cb += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
- dest_cr += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
- }
- x_offset += 8 * h->mb_x;
- y_offset += 8 * (h->mb_y >> MB_FIELD(h));
-
- if (list0) {
- Picture *ref = &h->ref_list[0][h->ref_cache[0][scan8[n]]];
- mc_dir_part(h, ref, n, square, height, delta, 0,
- dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_op, chroma_op, pixel_shift, chroma_idc);
-
- qpix_op = qpix_avg;
- chroma_op = chroma_avg;
- }
-
- if (list1) {
- Picture *ref = &h->ref_list[1][h->ref_cache[1][scan8[n]]];
- mc_dir_part(h, ref, n, square, height, delta, 1,
- dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_op, chroma_op, pixel_shift, chroma_idc);
- }
-}
-
-static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
- int height, int delta,
- uint8_t *dest_y, uint8_t *dest_cb,
- uint8_t *dest_cr,
- int x_offset, int y_offset,
- qpel_mc_func *qpix_put,
- h264_chroma_mc_func chroma_put,
- h264_weight_func luma_weight_op,
- h264_weight_func chroma_weight_op,
- h264_biweight_func luma_weight_avg,
- h264_biweight_func chroma_weight_avg,
- int list0, int list1,
- int pixel_shift, int chroma_idc)
-{
- int chroma_height;
-
- dest_y += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
- if (chroma_idc == 3 /* yuv444 */) {
- chroma_height = height;
- chroma_weight_avg = luma_weight_avg;
- chroma_weight_op = luma_weight_op;
- dest_cb += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
- dest_cr += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
- } else if (chroma_idc == 2 /* yuv422 */) {
- chroma_height = height;
- dest_cb += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
- dest_cr += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
- } else { /* yuv420 */
- chroma_height = height >> 1;
- dest_cb += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
- dest_cr += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
- }
- x_offset += 8 * h->mb_x;
- y_offset += 8 * (h->mb_y >> MB_FIELD(h));
-
- if (list0 && list1) {
- /* don't optimize for luma-only case, since B-frames usually
- * use implicit weights => chroma too. */
- uint8_t *tmp_cb = h->bipred_scratchpad;
- uint8_t *tmp_cr = h->bipred_scratchpad + (16 << pixel_shift);
- uint8_t *tmp_y = h->bipred_scratchpad + 16 * h->mb_uvlinesize;
- int refn0 = h->ref_cache[0][scan8[n]];
- int refn1 = h->ref_cache[1][scan8[n]];
-
- mc_dir_part(h, &h->ref_list[0][refn0], n, square, height, delta, 0,
- dest_y, dest_cb, dest_cr,
- x_offset, y_offset, qpix_put, chroma_put,
- pixel_shift, chroma_idc);
- mc_dir_part(h, &h->ref_list[1][refn1], n, square, height, delta, 1,
- tmp_y, tmp_cb, tmp_cr,
- x_offset, y_offset, qpix_put, chroma_put,
- pixel_shift, chroma_idc);
-
- if (h->use_weight == 2) {
- int weight0 = h->implicit_weight[refn0][refn1][h->mb_y & 1];
- int weight1 = 64 - weight0;
- luma_weight_avg(dest_y, tmp_y, h->mb_linesize,
- height, 5, weight0, weight1, 0);
- chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize,
- chroma_height, 5, weight0, weight1, 0);
- chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize,
- chroma_height, 5, weight0, weight1, 0);
- } else {
- luma_weight_avg(dest_y, tmp_y, h->mb_linesize, height,
- h->luma_log2_weight_denom,
- h->luma_weight[refn0][0][0],
- h->luma_weight[refn1][1][0],
- h->luma_weight[refn0][0][1] +
- h->luma_weight[refn1][1][1]);
- chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, chroma_height,
- h->chroma_log2_weight_denom,
- h->chroma_weight[refn0][0][0][0],
- h->chroma_weight[refn1][1][0][0],
- h->chroma_weight[refn0][0][0][1] +
- h->chroma_weight[refn1][1][0][1]);
- chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, chroma_height,
- h->chroma_log2_weight_denom,
- h->chroma_weight[refn0][0][1][0],
- h->chroma_weight[refn1][1][1][0],
- h->chroma_weight[refn0][0][1][1] +
- h->chroma_weight[refn1][1][1][1]);
- }
- } else {
- int list = list1 ? 1 : 0;
- int refn = h->ref_cache[list][scan8[n]];
- Picture *ref = &h->ref_list[list][refn];
- mc_dir_part(h, ref, n, square, height, delta, list,
- dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_put, chroma_put, pixel_shift, chroma_idc);
-
- luma_weight_op(dest_y, h->mb_linesize, height,
- h->luma_log2_weight_denom,
- h->luma_weight[refn][list][0],
- h->luma_weight[refn][list][1]);
- if (h->use_weight_chroma) {
- chroma_weight_op(dest_cb, h->mb_uvlinesize, chroma_height,
- h->chroma_log2_weight_denom,
- h->chroma_weight[refn][list][0][0],
- h->chroma_weight[refn][list][0][1]);
- chroma_weight_op(dest_cr, h->mb_uvlinesize, chroma_height,
- h->chroma_log2_weight_denom,
- h->chroma_weight[refn][list][1][0],
- h->chroma_weight[refn][list][1][1]);
- }
- }
-}
-
-static av_always_inline void prefetch_motion(H264Context *h, int list,
- int pixel_shift, int chroma_idc)
-{
- /* fetch pixels for estimated mv 4 macroblocks ahead
- * optimized for 64byte cache lines */
- const int refn = h->ref_cache[list][scan8[0]];
- if (refn >= 0) {
- const int mx = (h->mv_cache[list][scan8[0]][0] >> 2) + 16 * h->mb_x + 8;
- const int my = (h->mv_cache[list][scan8[0]][1] >> 2) + 16 * h->mb_y;
- uint8_t **src = h->ref_list[list][refn].f.data;
- int off = (mx << pixel_shift) +
- (my + (h->mb_x & 3) * 4) * h->mb_linesize +
- (64 << pixel_shift);
- h->vdsp.prefetch(src[0] + off, h->linesize, 4);
- if (chroma_idc == 3 /* yuv444 */) {
- h->vdsp.prefetch(src[1] + off, h->linesize, 4);
- h->vdsp.prefetch(src[2] + off, h->linesize, 4);
- } else {
- off= (((mx>>1)+64)<<pixel_shift) + ((my>>1) + (h->mb_x&7))*h->uvlinesize;
- h->vdsp.prefetch(src[1] + off, src[2] - src[1], 2);
- }
- }
-}
-
-static void free_tables(H264Context *h, int free_rbsp)
+void ff_h264_free_tables(H264Context *h, int free_rbsp)
{
int i;
H264Context *hx;
@@ -1210,26 +381,23 @@ static void free_tables(H264Context *h, int free_rbsp)
av_freep(&h->mb2b_xy);
av_freep(&h->mb2br_xy);
- for (i = 0; i < 3; i++)
- av_freep(&h->visualization_buffer[i]);
-
av_buffer_pool_uninit(&h->qscale_table_pool);
av_buffer_pool_uninit(&h->mb_type_pool);
av_buffer_pool_uninit(&h->motion_val_pool);
av_buffer_pool_uninit(&h->ref_index_pool);
if (free_rbsp && h->DPB) {
- for (i = 0; i < MAX_PICTURE_COUNT; i++)
- unref_picture(h, &h->DPB[i]);
+ for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
+ ff_h264_unref_picture(h, &h->DPB[i]);
av_freep(&h->DPB);
} else if (h->DPB) {
- for (i = 0; i < MAX_PICTURE_COUNT; i++)
+ for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
h->DPB[i].needs_realloc = 1;
}
h->cur_pic_ptr = NULL;
- for (i = 0; i < MAX_THREADS; i++) {
+ for (i = 0; i < H264_MAX_THREADS; i++) {
hx = h->thread_context[i];
if (!hx)
continue;
@@ -1238,7 +406,6 @@ static void free_tables(H264Context *h, int free_rbsp)
av_freep(&hx->bipred_scratchpad);
av_freep(&hx->edge_emu_buffer);
av_freep(&hx->dc_val_base);
- av_freep(&hx->me.scratchpad);
av_freep(&hx->er.mb_index2xy);
av_freep(&hx->er.error_status_table);
av_freep(&hx->er.er_temp_buffer);
@@ -1256,76 +423,6 @@ static void free_tables(H264Context *h, int free_rbsp)
}
}
-static void init_dequant8_coeff_table(H264Context *h)
-{
- int i, j, q, x;
- const int max_qp = 51 + 6 * (h->sps.bit_depth_luma - 8);
-
- for (i = 0; i < 6; i++) {
- h->dequant8_coeff[i] = h->dequant8_buffer[i];
- for (j = 0; j < i; j++)
- if (!memcmp(h->pps.scaling_matrix8[j], h->pps.scaling_matrix8[i],
- 64 * sizeof(uint8_t))) {
- h->dequant8_coeff[i] = h->dequant8_buffer[j];
- break;
- }
- if (j < i)
- continue;
-
- for (q = 0; q < max_qp + 1; q++) {
- int shift = div6[q];
- int idx = rem6[q];
- for (x = 0; x < 64; x++)
- h->dequant8_coeff[i][q][(x >> 3) | ((x & 7) << 3)] =
- ((uint32_t)dequant8_coeff_init[idx][dequant8_coeff_init_scan[((x >> 1) & 12) | (x & 3)]] *
- h->pps.scaling_matrix8[i][x]) << shift;
- }
- }
-}
-
-static void init_dequant4_coeff_table(H264Context *h)
-{
- int i, j, q, x;
- const int max_qp = 51 + 6 * (h->sps.bit_depth_luma - 8);
- for (i = 0; i < 6; i++) {
- h->dequant4_coeff[i] = h->dequant4_buffer[i];
- for (j = 0; j < i; j++)
- if (!memcmp(h->pps.scaling_matrix4[j], h->pps.scaling_matrix4[i],
- 16 * sizeof(uint8_t))) {
- h->dequant4_coeff[i] = h->dequant4_buffer[j];
- break;
- }
- if (j < i)
- continue;
-
- for (q = 0; q < max_qp + 1; q++) {
- int shift = div6[q] + 2;
- int idx = rem6[q];
- for (x = 0; x < 16; x++)
- h->dequant4_coeff[i][q][(x >> 2) | ((x << 2) & 0xF)] =
- ((uint32_t)dequant4_coeff_init[idx][(x & 1) + ((x >> 2) & 1)] *
- h->pps.scaling_matrix4[i][x]) << shift;
- }
- }
-}
-
-static void init_dequant_tables(H264Context *h)
-{
- int i, x;
- init_dequant4_coeff_table(h);
- if (h->pps.transform_8x8_mode)
- init_dequant8_coeff_table(h);
- if (h->sps.transform_bypass) {
- for (i = 0; i < 6; i++)
- for (x = 0; x < 16; x++)
- h->dequant4_coeff[i][0][x] = 1 << 6;
- if (h->pps.transform_8x8_mode)
- for (i = 0; i < 6; i++)
- for (x = 0; x < 64; x++)
- h->dequant8_coeff[i][0][x] = 1 << 6;
- }
-}
-
int ff_h264_alloc_tables(H264Context *h)
{
const int big_mb_num = h->mb_stride * (h->mb_height + 1);
@@ -1369,55 +466,29 @@ int ff_h264_alloc_tables(H264Context *h)
}
if (!h->dequant4_coeff[0])
- init_dequant_tables(h);
+ h264_init_dequant_tables(h);
if (!h->DPB) {
- h->DPB = av_mallocz_array(MAX_PICTURE_COUNT, sizeof(*h->DPB));
+ h->DPB = av_mallocz_array(H264_MAX_PICTURE_COUNT, sizeof(*h->DPB));
if (!h->DPB)
return AVERROR(ENOMEM);
- for (i = 0; i < MAX_PICTURE_COUNT; i++)
- avcodec_get_frame_defaults(&h->DPB[i].f);
- avcodec_get_frame_defaults(&h->cur_pic.f);
+ for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
+ av_frame_unref(&h->DPB[i].f);
+ av_frame_unref(&h->cur_pic.f);
}
return 0;
fail:
- free_tables(h, 1);
+ ff_h264_free_tables(h, 1);
return AVERROR(ENOMEM);
}
/**
- * Mimic alloc_tables(), but for every context thread.
- */
-static void clone_tables(H264Context *dst, H264Context *src, int i)
-{
- dst->intra4x4_pred_mode = src->intra4x4_pred_mode + i * 8 * 2 * src->mb_stride;
- dst->non_zero_count = src->non_zero_count;
- dst->slice_table = src->slice_table;
- dst->cbp_table = src->cbp_table;
- dst->mb2b_xy = src->mb2b_xy;
- dst->mb2br_xy = src->mb2br_xy;
- dst->chroma_pred_mode_table = src->chroma_pred_mode_table;
- dst->mvd_table[0] = src->mvd_table[0] + i * 8 * 2 * src->mb_stride;
- dst->mvd_table[1] = src->mvd_table[1] + i * 8 * 2 * src->mb_stride;
- dst->direct_table = src->direct_table;
- dst->list_counts = src->list_counts;
- dst->DPB = src->DPB;
- dst->cur_pic_ptr = src->cur_pic_ptr;
- dst->cur_pic = src->cur_pic;
- dst->bipred_scratchpad = NULL;
- dst->edge_emu_buffer = NULL;
- dst->me.scratchpad = NULL;
- ff_h264_pred_init(&dst->hpc, src->avctx->codec_id, src->sps.bit_depth_luma,
- src->sps.chroma_format_idc);
-}
-
-/**
* Init context
* Allocate buffers which are not shared amongst multiple threads.
*/
-static int context_init(H264Context *h)
+int ff_h264_context_init(H264Context *h)
{
ERContext *er = &h->er;
int mb_array_size = h->mb_height * h->mb_stride;
@@ -1483,7 +554,7 @@ static int context_init(H264Context *h)
return 0;
fail:
- return AVERROR(ENOMEM); // free_tables will clean up for us
+ return AVERROR(ENOMEM); // ff_h264_free_tables will clean up for us
}
static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
@@ -1504,7 +575,8 @@ int ff_h264_decode_extradata(H264Context *h, const uint8_t *buf, int size)
h->is_avc = 1;
if (size < 7) {
- av_log(avctx, AV_LOG_ERROR, "avcC too short\n");
+ av_log(avctx, AV_LOG_ERROR,
+ "avcC %d too short\n", size);
return AVERROR_INVALIDDATA;
}
/* sps and pps in the avcC always have length coded with 2 bytes,
@@ -1635,49 +707,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
avctx->internal->allocate_progress = 1;
- flush_change(h);
-
- return 0;
-}
-
-#define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b) + (size))))
-#undef REBASE_PICTURE
-#define REBASE_PICTURE(pic, new_ctx, old_ctx) \
- ((pic && pic >= old_ctx->DPB && \
- pic < old_ctx->DPB + MAX_PICTURE_COUNT) ? \
- &new_ctx->DPB[pic - old_ctx->DPB] : NULL)
-
-static void copy_picture_range(Picture **to, Picture **from, int count,
- H264Context *new_base,
- H264Context *old_base)
-{
- int i;
-
- for (i = 0; i < count; i++) {
- assert((IN_RANGE(from[i], old_base, sizeof(*old_base)) ||
- IN_RANGE(from[i], old_base->DPB,
- sizeof(Picture) * MAX_PICTURE_COUNT) ||
- !from[i]));
- to[i] = REBASE_PICTURE(from[i], new_base, old_base);
- }
-}
-
-static int copy_parameter_set(void **to, void **from, int count, int size)
-{
- int i;
-
- for (i = 0; i < count; i++) {
- if (to[i] && !from[i]) {
- av_freep(&to[i]);
- } else if (from[i] && !to[i]) {
- to[i] = av_malloc(size);
- if (!to[i])
- return AVERROR(ENOMEM);
- }
-
- if (from[i])
- memcpy(to[i], from[i], size);
- }
+ ff_h264_flush_change(h);
return 0;
}
@@ -1700,318 +730,6 @@ static int decode_init_thread_copy(AVCodecContext *avctx)
return 0;
}
-#define copy_fields(to, from, start_field, end_field) \
- memcpy(&to->start_field, &from->start_field, \
- (char *)&to->end_field - (char *)&to->start_field)
-
-static int h264_slice_header_init(H264Context *, int);
-
-static int h264_set_parameter_from_sps(H264Context *h);
-
-static int decode_update_thread_context(AVCodecContext *dst,
- const AVCodecContext *src)
-{
- H264Context *h = dst->priv_data, *h1 = src->priv_data;
- int inited = h->context_initialized, err = 0;
- int context_reinitialized = 0;
- int i, ret;
-
- if (dst == src)
- return 0;
-
- if (inited &&
- (h->width != h1->width ||
- h->height != h1->height ||
- h->mb_width != h1->mb_width ||
- h->mb_height != h1->mb_height ||
- h->sps.bit_depth_luma != h1->sps.bit_depth_luma ||
- h->sps.chroma_format_idc != h1->sps.chroma_format_idc ||
- h->sps.colorspace != h1->sps.colorspace)) {
-
- /* set bits_per_raw_sample to the previous value. the check for changed
- * bit depth in h264_set_parameter_from_sps() uses it and sets it to
- * the current value */
- h->avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
-
- av_freep(&h->bipred_scratchpad);
-
- h->width = h1->width;
- h->height = h1->height;
- h->mb_height = h1->mb_height;
- h->mb_width = h1->mb_width;
- h->mb_num = h1->mb_num;
- h->mb_stride = h1->mb_stride;
- h->b_stride = h1->b_stride;
- // SPS/PPS
- if ((ret = copy_parameter_set((void **)h->sps_buffers,
- (void **)h1->sps_buffers,
- MAX_SPS_COUNT, sizeof(SPS))) < 0)
- return ret;
- h->sps = h1->sps;
- if ((ret = copy_parameter_set((void **)h->pps_buffers,
- (void **)h1->pps_buffers,
- MAX_PPS_COUNT, sizeof(PPS))) < 0)
- return ret;
- h->pps = h1->pps;
-
- if ((err = h264_slice_header_init(h, 1)) < 0) {
- av_log(h->avctx, AV_LOG_ERROR, "h264_slice_header_init() failed");
- return err;
- }
- context_reinitialized = 1;
-
-#if 0
- h264_set_parameter_from_sps(h);
- //Note we set context_reinitialized which will cause h264_set_parameter_from_sps to be reexecuted
- h->cur_chroma_format_idc = h1->cur_chroma_format_idc;
-#endif
- }
- /* update linesize on resize for h264. The h264 decoder doesn't
- * necessarily call ff_MPV_frame_start in the new thread */
- h->linesize = h1->linesize;
- h->uvlinesize = h1->uvlinesize;
-
- /* copy block_offset since frame_start may not be called */
- memcpy(h->block_offset, h1->block_offset, sizeof(h->block_offset));
-
- if (!inited) {
- for (i = 0; i < MAX_SPS_COUNT; i++)
- av_freep(h->sps_buffers + i);
-
- for (i = 0; i < MAX_PPS_COUNT; i++)
- av_freep(h->pps_buffers + i);
-
- av_freep(&h->rbsp_buffer[0]);
- av_freep(&h->rbsp_buffer[1]);
- memcpy(h, h1, offsetof(H264Context, intra_pcm_ptr));
- memcpy(&h->cabac, &h1->cabac,
- sizeof(H264Context) - offsetof(H264Context, cabac));
- av_assert0((void*)&h->cabac == &h->mb_padding + 1);
-
- memset(h->sps_buffers, 0, sizeof(h->sps_buffers));
- memset(h->pps_buffers, 0, sizeof(h->pps_buffers));
-
- memset(&h->er, 0, sizeof(h->er));
- memset(&h->me, 0, sizeof(h->me));
- memset(&h->mb, 0, sizeof(h->mb));
- memset(&h->mb_luma_dc, 0, sizeof(h->mb_luma_dc));
- memset(&h->mb_padding, 0, sizeof(h->mb_padding));
-
- h->avctx = dst;
- h->DPB = NULL;
- h->qscale_table_pool = NULL;
- h->mb_type_pool = NULL;
- h->ref_index_pool = NULL;
- h->motion_val_pool = NULL;
- for (i = 0; i < 2; i++) {
- h->rbsp_buffer[i] = NULL;
- h->rbsp_buffer_size[i] = 0;
- }
-
- if (h1->context_initialized) {
- h->context_initialized = 0;
-
- memset(&h->cur_pic, 0, sizeof(h->cur_pic));
- avcodec_get_frame_defaults(&h->cur_pic.f);
- h->cur_pic.tf.f = &h->cur_pic.f;
-
- ret = ff_h264_alloc_tables(h);
- if (ret < 0) {
- av_log(dst, AV_LOG_ERROR, "Could not allocate memory for h264\n");
- return ret;
- }
- ret = context_init(h);
- if (ret < 0) {
- av_log(dst, AV_LOG_ERROR, "context_init() failed.\n");
- return ret;
- }
- }
-
- h->bipred_scratchpad = NULL;
- h->edge_emu_buffer = NULL;
-
- h->thread_context[0] = h;
- h->context_initialized = h1->context_initialized;
- }
-
- h->avctx->coded_height = h1->avctx->coded_height;
- h->avctx->coded_width = h1->avctx->coded_width;
- h->avctx->width = h1->avctx->width;
- h->avctx->height = h1->avctx->height;
- h->coded_picture_number = h1->coded_picture_number;
- h->first_field = h1->first_field;
- h->picture_structure = h1->picture_structure;
- h->qscale = h1->qscale;
- h->droppable = h1->droppable;
- h->data_partitioning = h1->data_partitioning;
- h->low_delay = h1->low_delay;
-
- for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) {
- unref_picture(h, &h->DPB[i]);
- if (h1->DPB[i].f.buf[0] &&
- (ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
- return ret;
- }
-
- h->cur_pic_ptr = REBASE_PICTURE(h1->cur_pic_ptr, h, h1);
- unref_picture(h, &h->cur_pic);
- if (h1->cur_pic.f.buf[0] && (ret = ref_picture(h, &h->cur_pic, &h1->cur_pic)) < 0)
- return ret;
-
- h->workaround_bugs = h1->workaround_bugs;
- h->low_delay = h1->low_delay;
- h->droppable = h1->droppable;
-
- // extradata/NAL handling
- h->is_avc = h1->is_avc;
-
- // SPS/PPS
- if ((ret = copy_parameter_set((void **)h->sps_buffers,
- (void **)h1->sps_buffers,
- MAX_SPS_COUNT, sizeof(SPS))) < 0)
- return ret;
- h->sps = h1->sps;
- if ((ret = copy_parameter_set((void **)h->pps_buffers,
- (void **)h1->pps_buffers,
- MAX_PPS_COUNT, sizeof(PPS))) < 0)
- return ret;
- h->pps = h1->pps;
-
- // Dequantization matrices
- // FIXME these are big - can they be only copied when PPS changes?
- copy_fields(h, h1, dequant4_buffer, dequant4_coeff);
-
- for (i = 0; i < 6; i++)
- h->dequant4_coeff[i] = h->dequant4_buffer[0] +
- (h1->dequant4_coeff[i] - h1->dequant4_buffer[0]);
-
- for (i = 0; i < 6; i++)
- h->dequant8_coeff[i] = h->dequant8_buffer[0] +
- (h1->dequant8_coeff[i] - h1->dequant8_buffer[0]);
-
- h->dequant_coeff_pps = h1->dequant_coeff_pps;
-
- // POC timing
- copy_fields(h, h1, poc_lsb, redundant_pic_count);
-
- // reference lists
- copy_fields(h, h1, short_ref, cabac_init_idc);
-
- copy_picture_range(h->short_ref, h1->short_ref, 32, h, h1);
- copy_picture_range(h->long_ref, h1->long_ref, 32, h, h1);
- copy_picture_range(h->delayed_pic, h1->delayed_pic,
- MAX_DELAYED_PIC_COUNT + 2, h, h1);
-
- h->frame_recovered = h1->frame_recovered;
-
- if (context_reinitialized)
- h264_set_parameter_from_sps(h);
-
- if (!h->cur_pic_ptr)
- return 0;
-
- if (!h->droppable) {
- err = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
- h->prev_poc_msb = h->poc_msb;
- h->prev_poc_lsb = h->poc_lsb;
- }
- h->prev_frame_num_offset = h->frame_num_offset;
- h->prev_frame_num = h->frame_num;
- h->outputed_poc = h->next_outputed_poc;
-
- h->recovery_frame = h1->recovery_frame;
-
- return err;
-}
-
-static int h264_frame_start(H264Context *h)
-{
- Picture *pic;
- int i, ret;
- const int pixel_shift = h->pixel_shift;
- int c[4] = {
- 1<<(h->sps.bit_depth_luma-1),
- 1<<(h->sps.bit_depth_chroma-1),
- 1<<(h->sps.bit_depth_chroma-1),
- -1
- };
-
- if (!ff_thread_can_start_frame(h->avctx)) {
- av_log(h->avctx, AV_LOG_ERROR, "Attempt to start a frame outside SETUP state\n");
- return -1;
- }
-
- release_unused_pictures(h, 1);
- h->cur_pic_ptr = NULL;
-
- i = find_unused_picture(h);
- if (i < 0) {
- av_log(h->avctx, AV_LOG_ERROR, "no frame buffer available\n");
- return i;
- }
- pic = &h->DPB[i];
-
- pic->reference = h->droppable ? 0 : h->picture_structure;
- pic->f.coded_picture_number = h->coded_picture_number++;
- pic->field_picture = h->picture_structure != PICT_FRAME;
-
- /*
- * Zero key_frame here; IDR markings per slice in frame or fields are ORed
- * in later.
- * See decode_nal_units().
- */
- pic->f.key_frame = 0;
- pic->mmco_reset = 0;
- pic->recovered = 0;
-
- if ((ret = alloc_picture(h, pic)) < 0)
- return ret;
- if(!h->frame_recovered && !h->avctx->hwaccel &&
- !(h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU))
- avpriv_color_frame(&pic->f, c);
-
- h->cur_pic_ptr = pic;
- unref_picture(h, &h->cur_pic);
- if ((ret = ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0)
- return ret;
-
- if (CONFIG_ERROR_RESILIENCE) {
- ff_er_frame_start(&h->er);
- h->er.last_pic =
- h->er.next_pic = NULL;
- }
-
- assert(h->linesize && h->uvlinesize);
-
- for (i = 0; i < 16; i++) {
- h->block_offset[i] = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 4 * h->linesize * ((scan8[i] - scan8[0]) >> 3);
- h->block_offset[48 + i] = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 8 * h->linesize * ((scan8[i] - scan8[0]) >> 3);
- }
- for (i = 0; i < 16; i++) {
- h->block_offset[16 + i] =
- h->block_offset[32 + i] = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 4 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3);
- h->block_offset[48 + 16 + i] =
- h->block_offset[48 + 32 + i] = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 8 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3);
- }
-
- // s->decode = (h->flags & CODEC_FLAG_PSNR) || !s->encoding ||
- // h->cur_pic.reference /* || h->contains_intra */ || 1;
-
- /* We mark the current picture as non-reference after allocating it, so
- * that if we break out due to an error it can be released automatically
- * in the next ff_MPV_frame_start().
- */
- h->cur_pic_ptr->reference = 0;
-
- h->cur_pic_ptr->field_poc[0] = h->cur_pic_ptr->field_poc[1] = INT_MAX;
-
- h->next_output_pic = NULL;
-
- assert(h->cur_pic_ptr->long_ref == 0);
-
- return 0;
-}
-
/**
* Run setup operations that must be run after slice header decoding.
* This includes finding the next displayed frame.
@@ -2022,8 +740,8 @@ static int h264_frame_start(H264Context *h)
*/
static void decode_postinit(H264Context *h, int setup_finished)
{
- Picture *out = h->cur_pic_ptr;
- Picture *cur = h->cur_pic_ptr;
+ H264Picture *out = h->cur_pic_ptr;
+ H264Picture *cur = h->cur_pic_ptr;
int i, pics, out_of_order, out_idx;
h->cur_pic_ptr->f.pict_type = h->pict_type;
@@ -2106,8 +824,49 @@ static void decode_postinit(H264Context *h, int setup_finished)
}
}
+ if (h->sei_frame_packing_present &&
+ h->frame_packing_arrangement_type >= 0 &&
+ h->frame_packing_arrangement_type <= 6 &&
+ h->content_interpretation_type > 0 &&
+ h->content_interpretation_type < 3) {
+ AVStereo3D *stereo = av_stereo3d_create_side_data(&cur->f);
+ if (!stereo)
+ return;
+
+ switch (h->frame_packing_arrangement_type) {
+ case 0:
+ stereo->type = AV_STEREO3D_CHECKERBOARD;
+ break;
+ case 1:
+ stereo->type = AV_STEREO3D_LINES;
+ break;
+ case 2:
+ stereo->type = AV_STEREO3D_COLUMNS;
+ break;
+ case 3:
+ if (h->quincunx_subsampling)
+ stereo->type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX;
+ else
+ stereo->type = AV_STEREO3D_SIDEBYSIDE;
+ break;
+ case 4:
+ stereo->type = AV_STEREO3D_TOPBOTTOM;
+ break;
+ case 5:
+ stereo->type = AV_STEREO3D_FRAMESEQUENCE;
+ break;
+ case 6:
+ stereo->type = AV_STEREO3D_2D;
+ break;
+ }
+
+ if (h->content_interpretation_type == 2)
+ stereo->flags = AV_STEREO3D_FLAG_INVERT;
+ }
+
cur->mmco_reset = h->mmco_reset;
h->mmco_reset = 0;
+
// FIXME do something with unavailable reference frames
/* Sort B-frames into display order */
@@ -2204,424 +963,6 @@ static void decode_postinit(H264Context *h, int setup_finished)
ff_thread_finish_setup(h->avctx);
}
-static av_always_inline void backup_mb_border(H264Context *h, uint8_t *src_y,
- uint8_t *src_cb, uint8_t *src_cr,
- int linesize, int uvlinesize,
- int simple)
-{
- uint8_t *top_border;
- int top_idx = 1;
- const int pixel_shift = h->pixel_shift;
- int chroma444 = CHROMA444(h);
- int chroma422 = CHROMA422(h);
-
- src_y -= linesize;
- src_cb -= uvlinesize;
- src_cr -= uvlinesize;
-
- if (!simple && FRAME_MBAFF(h)) {
- if (h->mb_y & 1) {
- if (!MB_MBAFF(h)) {
- top_border = h->top_borders[0][h->mb_x];
- AV_COPY128(top_border, src_y + 15 * linesize);
- if (pixel_shift)
- AV_COPY128(top_border + 16, src_y + 15 * linesize + 16);
- if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
- if (chroma444) {
- if (pixel_shift) {
- AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
- AV_COPY128(top_border + 48, src_cb + 15 * uvlinesize + 16);
- AV_COPY128(top_border + 64, src_cr + 15 * uvlinesize);
- AV_COPY128(top_border + 80, src_cr + 15 * uvlinesize + 16);
- } else {
- AV_COPY128(top_border + 16, src_cb + 15 * uvlinesize);
- AV_COPY128(top_border + 32, src_cr + 15 * uvlinesize);
- }
- } else if (chroma422) {
- if (pixel_shift) {
- AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
- AV_COPY128(top_border + 48, src_cr + 15 * uvlinesize);
- } else {
- AV_COPY64(top_border + 16, src_cb + 15 * uvlinesize);
- AV_COPY64(top_border + 24, src_cr + 15 * uvlinesize);
- }
- } else {
- if (pixel_shift) {
- AV_COPY128(top_border + 32, src_cb + 7 * uvlinesize);
- AV_COPY128(top_border + 48, src_cr + 7 * uvlinesize);
- } else {
- AV_COPY64(top_border + 16, src_cb + 7 * uvlinesize);
- AV_COPY64(top_border + 24, src_cr + 7 * uvlinesize);
- }
- }
- }
- }
- } else if (MB_MBAFF(h)) {
- top_idx = 0;
- } else
- return;
- }
-
- top_border = h->top_borders[top_idx][h->mb_x];
- /* There are two lines saved, the line above the top macroblock
- * of a pair, and the line above the bottom macroblock. */
- AV_COPY128(top_border, src_y + 16 * linesize);
- if (pixel_shift)
- AV_COPY128(top_border + 16, src_y + 16 * linesize + 16);
-
- if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
- if (chroma444) {
- if (pixel_shift) {
- AV_COPY128(top_border + 32, src_cb + 16 * linesize);
- AV_COPY128(top_border + 48, src_cb + 16 * linesize + 16);
- AV_COPY128(top_border + 64, src_cr + 16 * linesize);
- AV_COPY128(top_border + 80, src_cr + 16 * linesize + 16);
- } else {
- AV_COPY128(top_border + 16, src_cb + 16 * linesize);
- AV_COPY128(top_border + 32, src_cr + 16 * linesize);
- }
- } else if (chroma422) {
- if (pixel_shift) {
- AV_COPY128(top_border + 32, src_cb + 16 * uvlinesize);
- AV_COPY128(top_border + 48, src_cr + 16 * uvlinesize);
- } else {
- AV_COPY64(top_border + 16, src_cb + 16 * uvlinesize);
- AV_COPY64(top_border + 24, src_cr + 16 * uvlinesize);
- }
- } else {
- if (pixel_shift) {
- AV_COPY128(top_border + 32, src_cb + 8 * uvlinesize);
- AV_COPY128(top_border + 48, src_cr + 8 * uvlinesize);
- } else {
- AV_COPY64(top_border + 16, src_cb + 8 * uvlinesize);
- AV_COPY64(top_border + 24, src_cr + 8 * uvlinesize);
- }
- }
- }
-}
-
-static av_always_inline void xchg_mb_border(H264Context *h, uint8_t *src_y,
- uint8_t *src_cb, uint8_t *src_cr,
- int linesize, int uvlinesize,
- int xchg, int chroma444,
- int simple, int pixel_shift)
-{
- int deblock_topleft;
- int deblock_top;
- int top_idx = 1;
- uint8_t *top_border_m1;
- uint8_t *top_border;
-
- if (!simple && FRAME_MBAFF(h)) {
- if (h->mb_y & 1) {
- if (!MB_MBAFF(h))
- return;
- } else {
- top_idx = MB_MBAFF(h) ? 0 : 1;
- }
- }
-
- if (h->deblocking_filter == 2) {
- deblock_topleft = h->slice_table[h->mb_xy - 1 - h->mb_stride] == h->slice_num;
- deblock_top = h->top_type;
- } else {
- deblock_topleft = (h->mb_x > 0);
- deblock_top = (h->mb_y > !!MB_FIELD(h));
- }
-
- src_y -= linesize + 1 + pixel_shift;
- src_cb -= uvlinesize + 1 + pixel_shift;
- src_cr -= uvlinesize + 1 + pixel_shift;
-
- top_border_m1 = h->top_borders[top_idx][h->mb_x - 1];
- top_border = h->top_borders[top_idx][h->mb_x];
-
-#define XCHG(a, b, xchg) \
- if (pixel_shift) { \
- if (xchg) { \
- AV_SWAP64(b + 0, a + 0); \
- AV_SWAP64(b + 8, a + 8); \
- } else { \
- AV_COPY128(b, a); \
- } \
- } else if (xchg) \
- AV_SWAP64(b, a); \
- else \
- AV_COPY64(b, a);
-
- if (deblock_top) {
- if (deblock_topleft) {
- XCHG(top_border_m1 + (8 << pixel_shift),
- src_y - (7 << pixel_shift), 1);
- }
- XCHG(top_border + (0 << pixel_shift), src_y + (1 << pixel_shift), xchg);
- XCHG(top_border + (8 << pixel_shift), src_y + (9 << pixel_shift), 1);
- if (h->mb_x + 1 < h->mb_width) {
- XCHG(h->top_borders[top_idx][h->mb_x + 1],
- src_y + (17 << pixel_shift), 1);
- }
- if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
- if (chroma444) {
- if (deblock_topleft) {
- XCHG(top_border_m1 + (24 << pixel_shift), src_cb - (7 << pixel_shift), 1);
- XCHG(top_border_m1 + (40 << pixel_shift), src_cr - (7 << pixel_shift), 1);
- }
- XCHG(top_border + (16 << pixel_shift), src_cb + (1 << pixel_shift), xchg);
- XCHG(top_border + (24 << pixel_shift), src_cb + (9 << pixel_shift), 1);
- XCHG(top_border + (32 << pixel_shift), src_cr + (1 << pixel_shift), xchg);
- XCHG(top_border + (40 << pixel_shift), src_cr + (9 << pixel_shift), 1);
- if (h->mb_x + 1 < h->mb_width) {
- XCHG(h->top_borders[top_idx][h->mb_x + 1] + (16 << pixel_shift), src_cb + (17 << pixel_shift), 1);
- XCHG(h->top_borders[top_idx][h->mb_x + 1] + (32 << pixel_shift), src_cr + (17 << pixel_shift), 1);
- }
- } else {
- if (deblock_topleft) {
- XCHG(top_border_m1 + (16 << pixel_shift), src_cb - (7 << pixel_shift), 1);
- XCHG(top_border_m1 + (24 << pixel_shift), src_cr - (7 << pixel_shift), 1);
- }
- XCHG(top_border + (16 << pixel_shift), src_cb + 1 + pixel_shift, 1);
- XCHG(top_border + (24 << pixel_shift), src_cr + 1 + pixel_shift, 1);
- }
- }
- }
-}
-
-static av_always_inline int dctcoef_get(int16_t *mb, int high_bit_depth,
- int index)
-{
- if (high_bit_depth) {
- return AV_RN32A(((int32_t *)mb) + index);
- } else
- return AV_RN16A(mb + index);
-}
-
-static av_always_inline void dctcoef_set(int16_t *mb, int high_bit_depth,
- int index, int value)
-{
- if (high_bit_depth) {
- AV_WN32A(((int32_t *)mb) + index, value);
- } else
- AV_WN16A(mb + index, value);
-}
-
-static av_always_inline void hl_decode_mb_predict_luma(H264Context *h,
- int mb_type, int is_h264,
- int simple,
- int transform_bypass,
- int pixel_shift,
- int *block_offset,
- int linesize,
- uint8_t *dest_y, int p)
-{
- void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
- void (*idct_dc_add)(uint8_t *dst, int16_t *block, int stride);
- int i;
- int qscale = p == 0 ? h->qscale : h->chroma_qp[p - 1];
- block_offset += 16 * p;
- if (IS_INTRA4x4(mb_type)) {
- if (IS_8x8DCT(mb_type)) {
- if (transform_bypass) {
- idct_dc_add =
- idct_add = h->h264dsp.h264_add_pixels8_clear;
- } else {
- idct_dc_add = h->h264dsp.h264_idct8_dc_add;
- idct_add = h->h264dsp.h264_idct8_add;
- }
- for (i = 0; i < 16; i += 4) {
- uint8_t *const ptr = dest_y + block_offset[i];
- const int dir = h->intra4x4_pred_mode_cache[scan8[i]];
- if (transform_bypass && h->sps.profile_idc == 244 && dir <= 1) {
- h->hpc.pred8x8l_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
- } else {
- const int nnz = h->non_zero_count_cache[scan8[i + p * 16]];
- h->hpc.pred8x8l[dir](ptr, (h->topleft_samples_available << i) & 0x8000,
- (h->topright_samples_available << i) & 0x4000, linesize);
- if (nnz) {
- if (nnz == 1 && dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
- idct_dc_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
- else
- idct_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
- }
- }
- }
- } else {
- if (transform_bypass) {
- idct_dc_add =
- idct_add = h->h264dsp.h264_add_pixels4_clear;
- } else {
- idct_dc_add = h->h264dsp.h264_idct_dc_add;
- idct_add = h->h264dsp.h264_idct_add;
- }
- for (i = 0; i < 16; i++) {
- uint8_t *const ptr = dest_y + block_offset[i];
- const int dir = h->intra4x4_pred_mode_cache[scan8[i]];
-
- if (transform_bypass && h->sps.profile_idc == 244 && dir <= 1) {
- h->hpc.pred4x4_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
- } else {
- uint8_t *topright;
- int nnz, tr;
- uint64_t tr_high;
- if (dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED) {
- const int topright_avail = (h->topright_samples_available << i) & 0x8000;
- av_assert2(h->mb_y || linesize <= block_offset[i]);
- if (!topright_avail) {
- if (pixel_shift) {
- tr_high = ((uint16_t *)ptr)[3 - linesize / 2] * 0x0001000100010001ULL;
- topright = (uint8_t *)&tr_high;
- } else {
- tr = ptr[3 - linesize] * 0x01010101u;
- topright = (uint8_t *)&tr;
- }
- } else
- topright = ptr + (4 << pixel_shift) - linesize;
- } else
- topright = NULL;
-
- h->hpc.pred4x4[dir](ptr, topright, linesize);
- nnz = h->non_zero_count_cache[scan8[i + p * 16]];
- if (nnz) {
- if (is_h264) {
- if (nnz == 1 && dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
- idct_dc_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
- else
- idct_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
- } else if (CONFIG_SVQ3_DECODER)
- ff_svq3_add_idct_c(ptr, h->mb + i * 16 + p * 256, linesize, qscale, 0);
- }
- }
- }
- }
- } else {
- h->hpc.pred16x16[h->intra16x16_pred_mode](dest_y, linesize);
- if (is_h264) {
- if (h->non_zero_count_cache[scan8[LUMA_DC_BLOCK_INDEX + p]]) {
- if (!transform_bypass)
- h->h264dsp.h264_luma_dc_dequant_idct(h->mb + (p * 256 << pixel_shift),
- h->mb_luma_dc[p],
- h->dequant4_coeff[p][qscale][0]);
- else {
- static const uint8_t dc_mapping[16] = {
- 0 * 16, 1 * 16, 4 * 16, 5 * 16,
- 2 * 16, 3 * 16, 6 * 16, 7 * 16,
- 8 * 16, 9 * 16, 12 * 16, 13 * 16,
- 10 * 16, 11 * 16, 14 * 16, 15 * 16
- };
- for (i = 0; i < 16; i++)
- dctcoef_set(h->mb + (p * 256 << pixel_shift),
- pixel_shift, dc_mapping[i],
- dctcoef_get(h->mb_luma_dc[p],
- pixel_shift, i));
- }
- }
- } else if (CONFIG_SVQ3_DECODER)
- ff_svq3_luma_dc_dequant_idct_c(h->mb + p * 256,
- h->mb_luma_dc[p], qscale);
- }
-}
-
-static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, int mb_type,
- int is_h264, int simple,
- int transform_bypass,
- int pixel_shift,
- int *block_offset,
- int linesize,
- uint8_t *dest_y, int p)
-{
- void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
- int i;
- block_offset += 16 * p;
- if (!IS_INTRA4x4(mb_type)) {
- if (is_h264) {
- if (IS_INTRA16x16(mb_type)) {
- if (transform_bypass) {
- if (h->sps.profile_idc == 244 &&
- (h->intra16x16_pred_mode == VERT_PRED8x8 ||
- h->intra16x16_pred_mode == HOR_PRED8x8)) {
- h->hpc.pred16x16_add[h->intra16x16_pred_mode](dest_y, block_offset,
- h->mb + (p * 256 << pixel_shift),
- linesize);
- } else {
- for (i = 0; i < 16; i++)
- if (h->non_zero_count_cache[scan8[i + p * 16]] ||
- dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
- h->h264dsp.h264_add_pixels4_clear(dest_y + block_offset[i],
- h->mb + (i * 16 + p * 256 << pixel_shift),
- linesize);
- }
- } else {
- h->h264dsp.h264_idct_add16intra(dest_y, block_offset,
- h->mb + (p * 256 << pixel_shift),
- linesize,
- h->non_zero_count_cache + p * 5 * 8);
- }
- } else if (h->cbp & 15) {
- if (transform_bypass) {
- const int di = IS_8x8DCT(mb_type) ? 4 : 1;
- idct_add = IS_8x8DCT(mb_type) ? h->h264dsp.h264_add_pixels8_clear
- : h->h264dsp.h264_add_pixels4_clear;
- for (i = 0; i < 16; i += di)
- if (h->non_zero_count_cache[scan8[i + p * 16]])
- idct_add(dest_y + block_offset[i],
- h->mb + (i * 16 + p * 256 << pixel_shift),
- linesize);
- } else {
- if (IS_8x8DCT(mb_type))
- h->h264dsp.h264_idct8_add4(dest_y, block_offset,
- h->mb + (p * 256 << pixel_shift),
- linesize,
- h->non_zero_count_cache + p * 5 * 8);
- else
- h->h264dsp.h264_idct_add16(dest_y, block_offset,
- h->mb + (p * 256 << pixel_shift),
- linesize,
- h->non_zero_count_cache + p * 5 * 8);
- }
- }
- } else if (CONFIG_SVQ3_DECODER) {
- for (i = 0; i < 16; i++)
- if (h->non_zero_count_cache[scan8[i + p * 16]] || h->mb[i * 16 + p * 256]) {
- // FIXME benchmark weird rule, & below
- uint8_t *const ptr = dest_y + block_offset[i];
- ff_svq3_add_idct_c(ptr, h->mb + i * 16 + p * 256, linesize,
- h->qscale, IS_INTRA(mb_type) ? 1 : 0);
- }
- }
- }
-}
-
-#define BITS 8
-#define SIMPLE 1
-#include "h264_mb_template.c"
-
-#undef BITS
-#define BITS 16
-#include "h264_mb_template.c"
-
-#undef SIMPLE
-#define SIMPLE 0
-#include "h264_mb_template.c"
-
-void ff_h264_hl_decode_mb(H264Context *h)
-{
- const int mb_xy = h->mb_xy;
- const int mb_type = h->cur_pic.mb_type[mb_xy];
- int is_complex = CONFIG_SMALL || h->is_complex ||
- IS_INTRA_PCM(mb_type) || h->qscale == 0;
-
- if (CHROMA444(h)) {
- if (is_complex || h->pixel_shift)
- hl_decode_mb_444_complex(h);
- else
- hl_decode_mb_444_simple_8(h);
- } else if (is_complex) {
- hl_decode_mb_complex(h);
- } else if (h->pixel_shift) {
- hl_decode_mb_simple_16(h);
- } else
- hl_decode_mb_simple_8(h);
-}
-
int ff_pred_weight_table(H264Context *h)
{
int list, i;
@@ -2685,72 +1026,6 @@ int ff_pred_weight_table(H264Context *h)
}
/**
- * Initialize implicit_weight table.
- * @param field 0/1 initialize the weight for interlaced MBAFF
- * -1 initializes the rest
- */
-static void implicit_weight_table(H264Context *h, int field)
-{
- int ref0, ref1, i, cur_poc, ref_start, ref_count0, ref_count1;
-
- for (i = 0; i < 2; i++) {
- h->luma_weight_flag[i] = 0;
- h->chroma_weight_flag[i] = 0;
- }
-
- if (field < 0) {
- if (h->picture_structure == PICT_FRAME) {
- cur_poc = h->cur_pic_ptr->poc;
- } else {
- cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure - 1];
- }
- if (h->ref_count[0] == 1 && h->ref_count[1] == 1 && !FRAME_MBAFF(h) &&
- h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2 * cur_poc) {
- h->use_weight = 0;
- h->use_weight_chroma = 0;
- return;
- }
- ref_start = 0;
- ref_count0 = h->ref_count[0];
- ref_count1 = h->ref_count[1];
- } else {
- cur_poc = h->cur_pic_ptr->field_poc[field];
- ref_start = 16;
- ref_count0 = 16 + 2 * h->ref_count[0];
- ref_count1 = 16 + 2 * h->ref_count[1];
- }
-
- h->use_weight = 2;
- h->use_weight_chroma = 2;
- h->luma_log2_weight_denom = 5;
- h->chroma_log2_weight_denom = 5;
-
- for (ref0 = ref_start; ref0 < ref_count0; ref0++) {
- int poc0 = h->ref_list[0][ref0].poc;
- for (ref1 = ref_start; ref1 < ref_count1; ref1++) {
- int w = 32;
- if (!h->ref_list[0][ref0].long_ref && !h->ref_list[1][ref1].long_ref) {
- int poc1 = h->ref_list[1][ref1].poc;
- int td = av_clip(poc1 - poc0, -128, 127);
- if (td) {
- int tb = av_clip(cur_poc - poc0, -128, 127);
- int tx = (16384 + (FFABS(td) >> 1)) / td;
- int dist_scale_factor = (tb * tx + 32) >> 8;
- if (dist_scale_factor >= -64 && dist_scale_factor <= 128)
- w = 64 - dist_scale_factor;
- }
- }
- if (field < 0) {
- h->implicit_weight[ref0][ref1][0] =
- h->implicit_weight[ref0][ref1][1] = w;
- } else {
- h->implicit_weight[ref0][ref1][field] = w;
- }
- }
- }
-}
-
-/**
* instantaneous decoder refresh.
*/
static void idr(H264Context *h)
@@ -2766,7 +1041,7 @@ static void idr(H264Context *h)
}
/* forget old pics after a seek */
-static void flush_change(H264Context *h)
+void ff_h264_flush_change(H264Context *h)
{
int i, j;
@@ -2807,13 +1082,13 @@ static void flush_dpb(AVCodecContext *avctx)
h->delayed_pic[i] = NULL;
}
- flush_change(h);
+ ff_h264_flush_change(h);
if (h->DPB)
- for (i = 0; i < MAX_PICTURE_COUNT; i++)
- unref_picture(h, &h->DPB[i]);
+ for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
+ ff_h264_unref_picture(h, &h->DPB[i]);
h->cur_pic_ptr = NULL;
- unref_picture(h, &h->cur_pic);
+ ff_h264_unref_picture(h, &h->cur_pic);
h->mb_x = h->mb_y = 0;
@@ -2824,7 +1099,7 @@ static void flush_dpb(AVCodecContext *avctx)
h->parse_context.index = 0;
h->parse_context.last_index = 0;
- free_tables(h, 1);
+ ff_h264_free_tables(h, 1);
h->context_initialized = 0;
}
@@ -2907,128 +1182,6 @@ int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc)
}
/**
- * initialize scan tables
- */
-static void init_scan_tables(H264Context *h)
-{
- int i;
- for (i = 0; i < 16; i++) {
-#define T(x) (x >> 2) | ((x << 2) & 0xF)
- h->zigzag_scan[i] = T(zigzag_scan[i]);
- h->field_scan[i] = T(field_scan[i]);
-#undef T
- }
- for (i = 0; i < 64; i++) {
-#define T(x) (x >> 3) | ((x & 7) << 3)
- h->zigzag_scan8x8[i] = T(ff_zigzag_direct[i]);
- h->zigzag_scan8x8_cavlc[i] = T(zigzag_scan8x8_cavlc[i]);
- h->field_scan8x8[i] = T(field_scan8x8[i]);
- h->field_scan8x8_cavlc[i] = T(field_scan8x8_cavlc[i]);
-#undef T
- }
- if (h->sps.transform_bypass) { // FIXME same ugly
- memcpy(h->zigzag_scan_q0 , zigzag_scan , sizeof(h->zigzag_scan_q0 ));
- memcpy(h->zigzag_scan8x8_q0 , ff_zigzag_direct , sizeof(h->zigzag_scan8x8_q0 ));
- memcpy(h->zigzag_scan8x8_cavlc_q0 , zigzag_scan8x8_cavlc , sizeof(h->zigzag_scan8x8_cavlc_q0));
- memcpy(h->field_scan_q0 , field_scan , sizeof(h->field_scan_q0 ));
- memcpy(h->field_scan8x8_q0 , field_scan8x8 , sizeof(h->field_scan8x8_q0 ));
- memcpy(h->field_scan8x8_cavlc_q0 , field_scan8x8_cavlc , sizeof(h->field_scan8x8_cavlc_q0 ));
- } else {
- memcpy(h->zigzag_scan_q0 , h->zigzag_scan , sizeof(h->zigzag_scan_q0 ));
- memcpy(h->zigzag_scan8x8_q0 , h->zigzag_scan8x8 , sizeof(h->zigzag_scan8x8_q0 ));
- memcpy(h->zigzag_scan8x8_cavlc_q0 , h->zigzag_scan8x8_cavlc , sizeof(h->zigzag_scan8x8_cavlc_q0));
- memcpy(h->field_scan_q0 , h->field_scan , sizeof(h->field_scan_q0 ));
- memcpy(h->field_scan8x8_q0 , h->field_scan8x8 , sizeof(h->field_scan8x8_q0 ));
- memcpy(h->field_scan8x8_cavlc_q0 , h->field_scan8x8_cavlc , sizeof(h->field_scan8x8_cavlc_q0 ));
- }
-}
-
-static int field_end(H264Context *h, int in_setup)
-{
- AVCodecContext *const avctx = h->avctx;
- int err = 0;
- h->mb_y = 0;
-
- if (CONFIG_H264_VDPAU_DECODER &&
- h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
- ff_vdpau_h264_set_reference_frames(h);
-
- if (in_setup || !(avctx->active_thread_type & FF_THREAD_FRAME)) {
- if (!h->droppable) {
- err = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
- h->prev_poc_msb = h->poc_msb;
- h->prev_poc_lsb = h->poc_lsb;
- }
- h->prev_frame_num_offset = h->frame_num_offset;
- h->prev_frame_num = h->frame_num;
- h->outputed_poc = h->next_outputed_poc;
- }
-
- if (avctx->hwaccel) {
- if (avctx->hwaccel->end_frame(avctx) < 0)
- av_log(avctx, AV_LOG_ERROR,
- "hardware accelerator failed to decode picture\n");
- }
-
- if (CONFIG_H264_VDPAU_DECODER &&
- h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
- ff_vdpau_h264_picture_complete(h);
-
- /*
- * FIXME: Error handling code does not seem to support interlaced
- * when slices span multiple rows
- * The ff_er_add_slice calls don't work right for bottom
- * fields; they cause massive erroneous error concealing
- * Error marking covers both fields (top and bottom).
- * This causes a mismatched s->error_count
- * and a bad error table. Further, the error count goes to
- * INT_MAX when called for bottom field, because mb_y is
- * past end by one (callers fault) and resync_mb_y != 0
- * causes problems for the first MB line, too.
- */
- if (CONFIG_ERROR_RESILIENCE && !FIELD_PICTURE(h) && h->current_slice && !h->sps.new) {
- h->er.cur_pic = h->cur_pic_ptr;
- ff_er_frame_end(&h->er);
- }
- if (!in_setup && !h->droppable)
- ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
- h->picture_structure == PICT_BOTTOM_FIELD);
- emms_c();
-
- h->current_slice = 0;
-
- return err;
-}
-
-/**
- * Replicate H264 "master" context to thread contexts.
- */
-static int clone_slice(H264Context *dst, H264Context *src)
-{
- memcpy(dst->block_offset, src->block_offset, sizeof(dst->block_offset));
- dst->cur_pic_ptr = src->cur_pic_ptr;
- dst->cur_pic = src->cur_pic;
- dst->linesize = src->linesize;
- dst->uvlinesize = src->uvlinesize;
- dst->first_field = src->first_field;
-
- dst->prev_poc_msb = src->prev_poc_msb;
- dst->prev_poc_lsb = src->prev_poc_lsb;
- dst->prev_frame_num_offset = src->prev_frame_num_offset;
- dst->prev_frame_num = src->prev_frame_num;
- dst->short_ref_count = src->short_ref_count;
-
- memcpy(dst->short_ref, src->short_ref, sizeof(dst->short_ref));
- memcpy(dst->long_ref, src->long_ref, sizeof(dst->long_ref));
- memcpy(dst->default_ref_list, src->default_ref_list, sizeof(dst->default_ref_list));
-
- memcpy(dst->dequant4_coeff, src->dequant4_coeff, sizeof(src->dequant4_coeff));
- memcpy(dst->dequant8_coeff, src->dequant8_coeff, sizeof(src->dequant8_coeff));
-
- return 0;
-}
-
-/**
* Compute profile from profile_idc and constraint_set?_flags.
*
* @param sps SPS
@@ -3055,7 +1208,7 @@ int ff_h264_get_profile(SPS *sps)
return profile;
}
-static int h264_set_parameter_from_sps(H264Context *h)
+int ff_h264_set_parameter_from_sps(H264Context *h)
{
if (h->flags & CODEC_FLAG_LOW_DELAY ||
(h->sps.bitstream_restriction_flag &&
@@ -3070,12 +1223,6 @@ static int h264_set_parameter_from_sps(H264Context *h)
if (h->avctx->has_b_frames < 2)
h->avctx->has_b_frames = !h->low_delay;
- if (h->sps.bit_depth_luma != h->sps.bit_depth_chroma) {
- avpriv_request_sample(h->avctx,
- "Different chroma and luma bit depth");
- return AVERROR_PATCHWELCOME;
- }
-
if (h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
h->cur_chroma_format_idc != h->sps.chroma_format_idc) {
if (h->avctx->codec &&
@@ -3102,7 +1249,7 @@ static int h264_set_parameter_from_sps(H264Context *h)
ff_dsputil_init(&h->dsp, h->avctx);
ff_videodsp_init(&h->vdsp, h->sps.bit_depth_luma);
} else {
- av_log(h->avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n",
+ av_log(h->avctx, AV_LOG_ERROR, "Unsupported bit depth %d\n",
h->sps.bit_depth_luma);
return AVERROR_INVALIDDATA;
}
@@ -3110,238 +1257,14 @@ static int h264_set_parameter_from_sps(H264Context *h)
return 0;
}
-static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
-{
- switch (h->sps.bit_depth_luma) {
- case 9:
- if (CHROMA444(h)) {
- if (h->avctx->colorspace == AVCOL_SPC_RGB) {
- return AV_PIX_FMT_GBRP9;
- } else
- return AV_PIX_FMT_YUV444P9;
- } else if (CHROMA422(h))
- return AV_PIX_FMT_YUV422P9;
- else
- return AV_PIX_FMT_YUV420P9;
- break;
- case 10:
- if (CHROMA444(h)) {
- if (h->avctx->colorspace == AVCOL_SPC_RGB) {
- return AV_PIX_FMT_GBRP10;
- } else
- return AV_PIX_FMT_YUV444P10;
- } else if (CHROMA422(h))
- return AV_PIX_FMT_YUV422P10;
- else
- return AV_PIX_FMT_YUV420P10;
- break;
- case 12:
- if (CHROMA444(h)) {
- if (h->avctx->colorspace == AVCOL_SPC_RGB) {
- return AV_PIX_FMT_GBRP12;
- } else
- return AV_PIX_FMT_YUV444P12;
- } else if (CHROMA422(h))
- return AV_PIX_FMT_YUV422P12;
- else
- return AV_PIX_FMT_YUV420P12;
- break;
- case 14:
- if (CHROMA444(h)) {
- if (h->avctx->colorspace == AVCOL_SPC_RGB) {
- return AV_PIX_FMT_GBRP14;
- } else
- return AV_PIX_FMT_YUV444P14;
- } else if (CHROMA422(h))
- return AV_PIX_FMT_YUV422P14;
- else
- return AV_PIX_FMT_YUV420P14;
- break;
- case 8:
- if (CHROMA444(h)) {
- if (h->avctx->colorspace == AVCOL_SPC_RGB) {
- av_log(h->avctx, AV_LOG_DEBUG, "Detected GBR colorspace.\n");
- return AV_PIX_FMT_GBR24P;
- } else if (h->avctx->colorspace == AVCOL_SPC_YCGCO) {
- av_log(h->avctx, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n");
- }
- return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ444P
- : AV_PIX_FMT_YUV444P;
- } else if (CHROMA422(h)) {
- return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P
- : AV_PIX_FMT_YUV422P;
- } else {
- int i;
- const enum AVPixelFormat * fmt = h->avctx->codec->pix_fmts ?
- h->avctx->codec->pix_fmts :
- h->avctx->color_range == AVCOL_RANGE_JPEG ?
- h264_hwaccel_pixfmt_list_jpeg_420 :
- h264_hwaccel_pixfmt_list_420;
-
- for (i=0; fmt[i] != AV_PIX_FMT_NONE; i++)
- if (fmt[i] == h->avctx->pix_fmt && !force_callback)
- return fmt[i];
- return ff_thread_get_format(h->avctx, fmt);
- }
- break;
- default:
- av_log(h->avctx, AV_LOG_ERROR,
- "Unsupported bit depth: %d\n", h->sps.bit_depth_luma);
- return AVERROR_INVALIDDATA;
- }
-}
-
-/* export coded and cropped frame dimensions to AVCodecContext */
-static int init_dimensions(H264Context *h)
-{
- int width = h->width - (h->sps.crop_right + h->sps.crop_left);
- int height = h->height - (h->sps.crop_top + h->sps.crop_bottom);
- av_assert0(h->sps.crop_right + h->sps.crop_left < (unsigned)h->width);
- av_assert0(h->sps.crop_top + h->sps.crop_bottom < (unsigned)h->height);
-
- /* handle container cropping */
- if (!h->sps.crop &&
- FFALIGN(h->avctx->width, 16) == h->width &&
- FFALIGN(h->avctx->height, 16) == h->height) {
- width = h->avctx->width;
- height = h->avctx->height;
- }
-
- if (width <= 0 || height <= 0) {
- av_log(h->avctx, AV_LOG_ERROR, "Invalid cropped dimensions: %dx%d.\n",
- width, height);
- if (h->avctx->err_recognition & AV_EF_EXPLODE)
- return AVERROR_INVALIDDATA;
-
- av_log(h->avctx, AV_LOG_WARNING, "Ignoring cropping information.\n");
- h->sps.crop_bottom = h->sps.crop_top = h->sps.crop_right = h->sps.crop_left = 0;
- h->sps.crop = 0;
-
- width = h->width;
- height = h->height;
- }
-
- h->avctx->coded_width = h->width;
- h->avctx->coded_height = h->height;
- h->avctx->width = width;
- h->avctx->height = height;
-
- return 0;
-}
-
-static int h264_slice_header_init(H264Context *h, int reinit)
-{
- int nb_slices = (HAVE_THREADS &&
- h->avctx->active_thread_type & FF_THREAD_SLICE) ?
- h->avctx->thread_count : 1;
- int i, ret;
-
- h->avctx->sample_aspect_ratio = h->sps.sar;
- av_assert0(h->avctx->sample_aspect_ratio.den);
- av_pix_fmt_get_chroma_sub_sample(h->avctx->pix_fmt,
- &h->chroma_x_shift, &h->chroma_y_shift);
-
- if (h->sps.timing_info_present_flag) {
- int64_t den = h->sps.time_scale;
- if (h->x264_build < 44U)
- den *= 2;
- av_reduce(&h->avctx->time_base.num, &h->avctx->time_base.den,
- h->sps.num_units_in_tick, den, 1 << 30);
- }
-
- h->avctx->hwaccel = ff_find_hwaccel(h->avctx);
-
- if (reinit)
- free_tables(h, 0);
- h->first_field = 0;
- h->prev_interlaced_frame = 1;
-
- init_scan_tables(h);
- ret = ff_h264_alloc_tables(h);
- if (ret < 0) {
- av_log(h->avctx, AV_LOG_ERROR,
- "Could not allocate memory for h264\n");
- return ret;
- }
-
- if (nb_slices > MAX_THREADS || (nb_slices > h->mb_height && h->mb_height)) {
- int max_slices;
- if (h->mb_height)
- max_slices = FFMIN(MAX_THREADS, h->mb_height);
- else
- max_slices = MAX_THREADS;
- av_log(h->avctx, AV_LOG_WARNING, "too many threads/slices (%d),"
- " reducing to %d\n", nb_slices, max_slices);
- nb_slices = max_slices;
- }
- h->slice_context_count = nb_slices;
-
- if (!HAVE_THREADS || !(h->avctx->active_thread_type & FF_THREAD_SLICE)) {
- ret = context_init(h);
- if (ret < 0) {
- av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n");
- return ret;
- }
- } else {
- for (i = 1; i < h->slice_context_count; i++) {
- H264Context *c;
- c = h->thread_context[i] = av_mallocz(sizeof(H264Context));
- if (!c)
- return AVERROR(ENOMEM);
- c->avctx = h->avctx;
- if (CONFIG_ERROR_RESILIENCE) {
- c->dsp = h->dsp;
- }
- c->vdsp = h->vdsp;
- c->h264dsp = h->h264dsp;
- c->h264qpel = h->h264qpel;
- c->h264chroma = h->h264chroma;
- c->sps = h->sps;
- c->pps = h->pps;
- c->pixel_shift = h->pixel_shift;
- c->cur_chroma_format_idc = h->cur_chroma_format_idc;
- c->width = h->width;
- c->height = h->height;
- c->linesize = h->linesize;
- c->uvlinesize = h->uvlinesize;
- c->chroma_x_shift = h->chroma_x_shift;
- c->chroma_y_shift = h->chroma_y_shift;
- c->qscale = h->qscale;
- c->droppable = h->droppable;
- c->data_partitioning = h->data_partitioning;
- c->low_delay = h->low_delay;
- c->mb_width = h->mb_width;
- c->mb_height = h->mb_height;
- c->mb_stride = h->mb_stride;
- c->mb_num = h->mb_num;
- c->flags = h->flags;
- c->workaround_bugs = h->workaround_bugs;
- c->pict_type = h->pict_type;
-
- init_scan_tables(c);
- clone_tables(c, h, i);
- c->context_initialized = 1;
- }
-
- for (i = 0; i < h->slice_context_count; i++)
- if ((ret = context_init(h->thread_context[i])) < 0) {
- av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n");
- return ret;
- }
- }
-
- h->context_initialized = 1;
-
- return 0;
-}
-
int ff_set_ref_count(H264Context *h)
{
+ int ref_count[2], list_count;
int num_ref_idx_active_override_flag;
// set defaults, might be overridden a few lines later
- h->ref_count[0] = h->pps.ref_count[0];
- h->ref_count[1] = h->pps.ref_count[1];
+ ref_count[0] = h->pps.ref_count[0];
+ ref_count[1] = h->pps.ref_count[1];
if (h->slice_type_nos != AV_PICTURE_TYPE_I) {
unsigned max[2];
@@ -3352,1327 +1275,174 @@ int ff_set_ref_count(H264Context *h)
num_ref_idx_active_override_flag = get_bits1(&h->gb);
if (num_ref_idx_active_override_flag) {
- h->ref_count[0] = get_ue_golomb(&h->gb) + 1;
+ ref_count[0] = get_ue_golomb(&h->gb) + 1;
if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
- h->ref_count[1] = get_ue_golomb(&h->gb) + 1;
+ ref_count[1] = get_ue_golomb(&h->gb) + 1;
} else
// full range is spec-ok in this case, even for frames
- h->ref_count[1] = 1;
+ ref_count[1] = 1;
}
- if (h->ref_count[0]-1 > max[0] || h->ref_count[1]-1 > max[1]){
- av_log(h->avctx, AV_LOG_ERROR, "reference overflow %u > %u or %u > %u\n", h->ref_count[0]-1, max[0], h->ref_count[1]-1, max[1]);
+ if (ref_count[0]-1 > max[0] || ref_count[1]-1 > max[1]){
+ av_log(h->avctx, AV_LOG_ERROR, "reference overflow %u > %u or %u > %u\n", ref_count[0]-1, max[0], ref_count[1]-1, max[1]);
h->ref_count[0] = h->ref_count[1] = 0;
+ h->list_count = 0;
return AVERROR_INVALIDDATA;
}
if (h->slice_type_nos == AV_PICTURE_TYPE_B)
- h->list_count = 2;
+ list_count = 2;
else
- h->list_count = 1;
+ list_count = 1;
} else {
- h->list_count = 0;
- h->ref_count[0] = h->ref_count[1] = 0;
- }
-
- return 0;
-}
-
-/**
- * Decode a slice header.
- * This will also call ff_MPV_common_init() and frame_start() as needed.
- *
- * @param h h264context
- * @param h0 h264 master context (differs from 'h' when doing sliced based
- * parallel decoding)
- *
- * @return 0 if okay, <0 if an error occurred, 1 if decoding must not be multithreaded
- */
-static int decode_slice_header(H264Context *h, H264Context *h0)
-{
- unsigned int first_mb_in_slice;
- unsigned int pps_id;
- int ret;
- unsigned int slice_type, tmp, i, j;
- int last_pic_structure, last_pic_droppable;
- int must_reinit;
- int needs_reinit = 0;
- int field_pic_flag, bottom_field_flag;
-
- h->me.qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
- h->me.qpel_avg = h->h264qpel.avg_h264_qpel_pixels_tab;
-
- first_mb_in_slice = get_ue_golomb_long(&h->gb);
-
- if (first_mb_in_slice == 0) { // FIXME better field boundary detection
- if (h0->current_slice && FIELD_PICTURE(h)) {
- field_end(h, 1);
- }
-
- h0->current_slice = 0;
- if (!h0->first_field) {
- if (h->cur_pic_ptr && !h->droppable) {
- ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
- h->picture_structure == PICT_BOTTOM_FIELD);
- }
- h->cur_pic_ptr = NULL;
- }
+ list_count = 0;
+ ref_count[0] = ref_count[1] = 0;
}
- slice_type = get_ue_golomb_31(&h->gb);
- if (slice_type > 9) {
- av_log(h->avctx, AV_LOG_ERROR,
- "slice type too large (%d) at %d %d\n",
- slice_type, h->mb_x, h->mb_y);
- return AVERROR_INVALIDDATA;
- }
- if (slice_type > 4) {
- slice_type -= 5;
- h->slice_type_fixed = 1;
- } else
- h->slice_type_fixed = 0;
-
- slice_type = golomb_to_pict_type[slice_type];
- h->slice_type = slice_type;
- h->slice_type_nos = slice_type & 3;
-
- // to make a few old functions happy, it's wrong though
- h->pict_type = h->slice_type;
-
- pps_id = get_ue_golomb(&h->gb);
- if (pps_id >= MAX_PPS_COUNT) {
- av_log(h->avctx, AV_LOG_ERROR, "pps_id %d out of range\n", pps_id);
- return AVERROR_INVALIDDATA;
- }
- if (!h0->pps_buffers[pps_id]) {
- av_log(h->avctx, AV_LOG_ERROR,
- "non-existing PPS %u referenced\n",
- pps_id);
- return AVERROR_INVALIDDATA;
- }
- h->pps = *h0->pps_buffers[pps_id];
-
- if (!h0->sps_buffers[h->pps.sps_id]) {
- av_log(h->avctx, AV_LOG_ERROR,
- "non-existing SPS %u referenced\n",
- h->pps.sps_id);
- return AVERROR_INVALIDDATA;
- }
-
- if (h->pps.sps_id != h->current_sps_id ||
- h0->sps_buffers[h->pps.sps_id]->new) {
- h0->sps_buffers[h->pps.sps_id]->new = 0;
-
- h->current_sps_id = h->pps.sps_id;
- h->sps = *h0->sps_buffers[h->pps.sps_id];
-
- if (h->mb_width != h->sps.mb_width ||
- h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) ||
- h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
- h->cur_chroma_format_idc != h->sps.chroma_format_idc
- )
- needs_reinit = 1;
-
- if (h->bit_depth_luma != h->sps.bit_depth_luma ||
- h->chroma_format_idc != h->sps.chroma_format_idc) {
- h->bit_depth_luma = h->sps.bit_depth_luma;
- h->chroma_format_idc = h->sps.chroma_format_idc;
- needs_reinit = 1;
- }
- if ((ret = h264_set_parameter_from_sps(h)) < 0)
- return ret;
- }
-
- h->avctx->profile = ff_h264_get_profile(&h->sps);
- h->avctx->level = h->sps.level_idc;
- h->avctx->refs = h->sps.ref_frame_count;
-
- must_reinit = (h->context_initialized &&
- ( 16*h->sps.mb_width != h->avctx->coded_width
- || 16*h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) != h->avctx->coded_height
- || h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma
- || h->cur_chroma_format_idc != h->sps.chroma_format_idc
- || av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio)
- || h->mb_width != h->sps.mb_width
- || h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
- ));
- if (h0->avctx->pix_fmt != get_pixel_format(h0, 0))
- must_reinit = 1;
-
- h->mb_width = h->sps.mb_width;
- h->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
- h->mb_num = h->mb_width * h->mb_height;
- h->mb_stride = h->mb_width + 1;
-
- h->b_stride = h->mb_width * 4;
-
- h->chroma_y_shift = h->sps.chroma_format_idc <= 1; // 400 uses yuv420p
-
- h->width = 16 * h->mb_width;
- h->height = 16 * h->mb_height;
-
- ret = init_dimensions(h);
- if (ret < 0)
- return ret;
-
- if (h->sps.video_signal_type_present_flag) {
- h->avctx->color_range = h->sps.full_range>0 ? AVCOL_RANGE_JPEG
- : AVCOL_RANGE_MPEG;
- if (h->sps.colour_description_present_flag) {
- if (h->avctx->colorspace != h->sps.colorspace)
- needs_reinit = 1;
- h->avctx->color_primaries = h->sps.color_primaries;
- h->avctx->color_trc = h->sps.color_trc;
- h->avctx->colorspace = h->sps.colorspace;
- }
- }
-
- if (h->context_initialized &&
- (h->width != h->avctx->coded_width ||
- h->height != h->avctx->coded_height ||
- must_reinit ||
- needs_reinit)) {
- if (h != h0) {
- av_log(h->avctx, AV_LOG_ERROR, "changing width/height on "
- "slice %d\n", h0->current_slice + 1);
- return AVERROR_INVALIDDATA;
- }
-
- flush_change(h);
-
- if ((ret = get_pixel_format(h, 1)) < 0)
- return ret;
- h->avctx->pix_fmt = ret;
-
- av_log(h->avctx, AV_LOG_INFO, "Reinit context to %dx%d, "
- "pix_fmt: %s\n", h->width, h->height, av_get_pix_fmt_name(h->avctx->pix_fmt));
-
- if ((ret = h264_slice_header_init(h, 1)) < 0) {
- av_log(h->avctx, AV_LOG_ERROR,
- "h264_slice_header_init() failed\n");
- return ret;
- }
- }
- if (!h->context_initialized) {
- if (h != h0) {
- av_log(h->avctx, AV_LOG_ERROR,
- "Cannot (re-)initialize context during parallel decoding.\n");
- return AVERROR_PATCHWELCOME;
- }
-
- if ((ret = get_pixel_format(h, 1)) < 0)
- return ret;
- h->avctx->pix_fmt = ret;
-
- if ((ret = h264_slice_header_init(h, 0)) < 0) {
- av_log(h->avctx, AV_LOG_ERROR,
- "h264_slice_header_init() failed\n");
- return ret;
- }
- }
-
- if (h == h0 && h->dequant_coeff_pps != pps_id) {
- h->dequant_coeff_pps = pps_id;
- init_dequant_tables(h);
- }
-
- h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
-
- h->mb_mbaff = 0;
- h->mb_aff_frame = 0;
- last_pic_structure = h0->picture_structure;
- last_pic_droppable = h0->droppable;
- h->droppable = h->nal_ref_idc == 0;
- if (h->sps.frame_mbs_only_flag) {
- h->picture_structure = PICT_FRAME;
- } else {
- if (!h->sps.direct_8x8_inference_flag && slice_type == AV_PICTURE_TYPE_B) {
- av_log(h->avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n");
- return -1;
- }
- field_pic_flag = get_bits1(&h->gb);
- if (field_pic_flag) {
- bottom_field_flag = get_bits1(&h->gb);
- h->picture_structure = PICT_TOP_FIELD + bottom_field_flag;
- } else {
- h->picture_structure = PICT_FRAME;
- h->mb_aff_frame = h->sps.mb_aff;
- }
- }
- h->mb_field_decoding_flag = h->picture_structure != PICT_FRAME;
-
- if (h0->current_slice != 0) {
- if (last_pic_structure != h->picture_structure ||
- last_pic_droppable != h->droppable) {
- av_log(h->avctx, AV_LOG_ERROR,
- "Changing field mode (%d -> %d) between slices is not allowed\n",
- last_pic_structure, h->picture_structure);
- h->picture_structure = last_pic_structure;
- h->droppable = last_pic_droppable;
- return AVERROR_INVALIDDATA;
- } else if (!h0->cur_pic_ptr) {
- av_log(h->avctx, AV_LOG_ERROR,
- "unset cur_pic_ptr on %d. slice\n",
- h0->current_slice + 1);
- return AVERROR_INVALIDDATA;
- }
- } else {
- /* Shorten frame num gaps so we don't have to allocate reference
- * frames just to throw them away */
- if (h->frame_num != h->prev_frame_num) {
- int unwrap_prev_frame_num = h->prev_frame_num;
- int max_frame_num = 1 << h->sps.log2_max_frame_num;
-
- if (unwrap_prev_frame_num > h->frame_num)
- unwrap_prev_frame_num -= max_frame_num;
-
- if ((h->frame_num - unwrap_prev_frame_num) > h->sps.ref_frame_count) {
- unwrap_prev_frame_num = (h->frame_num - h->sps.ref_frame_count) - 1;
- if (unwrap_prev_frame_num < 0)
- unwrap_prev_frame_num += max_frame_num;
-
- h->prev_frame_num = unwrap_prev_frame_num;
- }
- }
-
- /* See if we have a decoded first field looking for a pair...
- * Here, we're using that to see if we should mark previously
- * decode frames as "finished".
- * We have to do that before the "dummy" in-between frame allocation,
- * since that can modify h->cur_pic_ptr. */
- if (h0->first_field) {
- assert(h0->cur_pic_ptr);
- assert(h0->cur_pic_ptr->f.buf[0]);
- assert(h0->cur_pic_ptr->reference != DELAYED_PIC_REF);
-
- /* Mark old field/frame as completed */
- if (h0->cur_pic_ptr->tf.owner == h0->avctx) {
- ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
- last_pic_structure == PICT_BOTTOM_FIELD);
- }
-
- /* figure out if we have a complementary field pair */
- if (!FIELD_PICTURE(h) || h->picture_structure == last_pic_structure) {
- /* Previous field is unmatched. Don't display it, but let it
- * remain for reference if marked as such. */
- if (last_pic_structure != PICT_FRAME) {
- ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
- last_pic_structure == PICT_TOP_FIELD);
- }
- } else {
- if (h0->cur_pic_ptr->frame_num != h->frame_num) {
- /* This and previous field were reference, but had
- * different frame_nums. Consider this field first in
- * pair. Throw away previous field except for reference
- * purposes. */
- if (last_pic_structure != PICT_FRAME) {
- ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
- last_pic_structure == PICT_TOP_FIELD);
- }
- } else {
- /* Second field in complementary pair */
- if (!((last_pic_structure == PICT_TOP_FIELD &&
- h->picture_structure == PICT_BOTTOM_FIELD) ||
- (last_pic_structure == PICT_BOTTOM_FIELD &&
- h->picture_structure == PICT_TOP_FIELD))) {
- av_log(h->avctx, AV_LOG_ERROR,
- "Invalid field mode combination %d/%d\n",
- last_pic_structure, h->picture_structure);
- h->picture_structure = last_pic_structure;
- h->droppable = last_pic_droppable;
- return AVERROR_INVALIDDATA;
- } else if (last_pic_droppable != h->droppable) {
- avpriv_request_sample(h->avctx,
- "Found reference and non-reference fields in the same frame, which");
- h->picture_structure = last_pic_structure;
- h->droppable = last_pic_droppable;
- return AVERROR_PATCHWELCOME;
- }
- }
- }
- }
-
- while (h->frame_num != h->prev_frame_num && !h0->first_field &&
- h->frame_num != (h->prev_frame_num + 1) % (1 << h->sps.log2_max_frame_num)) {
- Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL;
- av_log(h->avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n",
- h->frame_num, h->prev_frame_num);
- if (!h->sps.gaps_in_frame_num_allowed_flag)
- for(i=0; i<FF_ARRAY_ELEMS(h->last_pocs); i++)
- h->last_pocs[i] = INT_MIN;
- ret = h264_frame_start(h);
- if (ret < 0)
- return ret;
- h->prev_frame_num++;
- h->prev_frame_num %= 1 << h->sps.log2_max_frame_num;
- h->cur_pic_ptr->frame_num = h->prev_frame_num;
- ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 0);
- ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 1);
- ret = ff_generate_sliding_window_mmcos(h, 1);
- if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
- return ret;
- ret = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
- if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
- return ret;
- /* Error concealment: If a ref is missing, copy the previous ref
- * in its place.
- * FIXME: Avoiding a memcpy would be nice, but ref handling makes
- * many assumptions about there being no actual duplicates.
- * FIXME: This does not copy padding for out-of-frame motion
- * vectors. Given we are concealing a lost frame, this probably
- * is not noticeable by comparison, but it should be fixed. */
- if (h->short_ref_count) {
- if (prev) {
- av_image_copy(h->short_ref[0]->f.data,
- h->short_ref[0]->f.linesize,
- (const uint8_t **)prev->f.data,
- prev->f.linesize,
- h->avctx->pix_fmt,
- h->mb_width * 16,
- h->mb_height * 16);
- h->short_ref[0]->poc = prev->poc + 2;
- }
- h->short_ref[0]->frame_num = h->prev_frame_num;
- }
- }
-
- /* See if we have a decoded first field looking for a pair...
- * We're using that to see whether to continue decoding in that
- * frame, or to allocate a new one. */
- if (h0->first_field) {
- assert(h0->cur_pic_ptr);
- assert(h0->cur_pic_ptr->f.buf[0]);
- assert(h0->cur_pic_ptr->reference != DELAYED_PIC_REF);
-
- /* figure out if we have a complementary field pair */
- if (!FIELD_PICTURE(h) || h->picture_structure == last_pic_structure) {
- /* Previous field is unmatched. Don't display it, but let it
- * remain for reference if marked as such. */
- h0->cur_pic_ptr = NULL;
- h0->first_field = FIELD_PICTURE(h);
- } else {
- if (h0->cur_pic_ptr->frame_num != h->frame_num) {
- ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
- h0->picture_structure==PICT_BOTTOM_FIELD);
- /* This and the previous field had different frame_nums.
- * Consider this field first in pair. Throw away previous
- * one except for reference purposes. */
- h0->first_field = 1;
- h0->cur_pic_ptr = NULL;
- } else {
- /* Second field in complementary pair */
- h0->first_field = 0;
- }
- }
- } else {
- /* Frame or first field in a potentially complementary pair */
- h0->first_field = FIELD_PICTURE(h);
- }
-
- if (!FIELD_PICTURE(h) || h0->first_field) {
- if (h264_frame_start(h) < 0) {
- h0->first_field = 0;
- return AVERROR_INVALIDDATA;
- }
- } else {
- release_unused_pictures(h, 0);
- }
- /* Some macroblocks can be accessed before they're available in case
- * of lost slices, MBAFF or threading. */
- if (FIELD_PICTURE(h)) {
- for(i = (h->picture_structure == PICT_BOTTOM_FIELD); i<h->mb_height; i++)
- memset(h->slice_table + i*h->mb_stride, -1, (h->mb_stride - (i+1==h->mb_height)) * sizeof(*h->slice_table));
- } else {
- memset(h->slice_table, -1,
- (h->mb_height * h->mb_stride - 1) * sizeof(*h->slice_table));
- }
- h0->last_slice_type = -1;
- }
- if (h != h0 && (ret = clone_slice(h, h0)) < 0)
- return ret;
-
- /* can't be in alloc_tables because linesize isn't known there.
- * FIXME: redo bipred weight to not require extra buffer? */
- for (i = 0; i < h->slice_context_count; i++)
- if (h->thread_context[i]) {
- ret = alloc_scratch_buffers(h->thread_context[i], h->linesize);
- if (ret < 0)
- return ret;
- }
-
- h->cur_pic_ptr->frame_num = h->frame_num; // FIXME frame_num cleanup
-
- av_assert1(h->mb_num == h->mb_width * h->mb_height);
- if (first_mb_in_slice << FIELD_OR_MBAFF_PICTURE(h) >= h->mb_num ||
- first_mb_in_slice >= h->mb_num) {
- av_log(h->avctx, AV_LOG_ERROR, "first_mb_in_slice overflow\n");
- return AVERROR_INVALIDDATA;
- }
- h->resync_mb_x = h->mb_x = first_mb_in_slice % h->mb_width;
- h->resync_mb_y = h->mb_y = (first_mb_in_slice / h->mb_width) <<
- FIELD_OR_MBAFF_PICTURE(h);
- if (h->picture_structure == PICT_BOTTOM_FIELD)
- h->resync_mb_y = h->mb_y = h->mb_y + 1;
- av_assert1(h->mb_y < h->mb_height);
-
- if (h->picture_structure == PICT_FRAME) {
- h->curr_pic_num = h->frame_num;
- h->max_pic_num = 1 << h->sps.log2_max_frame_num;
- } else {
- h->curr_pic_num = 2 * h->frame_num + 1;
- h->max_pic_num = 1 << (h->sps.log2_max_frame_num + 1);
- }
-
- if (h->nal_unit_type == NAL_IDR_SLICE)
- get_ue_golomb(&h->gb); /* idr_pic_id */
-
- if (h->sps.poc_type == 0) {
- h->poc_lsb = get_bits(&h->gb, h->sps.log2_max_poc_lsb);
-
- if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME)
- h->delta_poc_bottom = get_se_golomb(&h->gb);
- }
-
- if (h->sps.poc_type == 1 && !h->sps.delta_pic_order_always_zero_flag) {
- h->delta_poc[0] = get_se_golomb(&h->gb);
-
- if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME)
- h->delta_poc[1] = get_se_golomb(&h->gb);
- }
-
- ff_init_poc(h, h->cur_pic_ptr->field_poc, &h->cur_pic_ptr->poc);
-
- if (h->pps.redundant_pic_cnt_present)
- h->redundant_pic_count = get_ue_golomb(&h->gb);
-
- ret = ff_set_ref_count(h);
- if (ret < 0)
- return ret;
-
- if (slice_type != AV_PICTURE_TYPE_I &&
- (h0->current_slice == 0 ||
- slice_type != h0->last_slice_type ||
- memcmp(h0->last_ref_count, h0->ref_count, sizeof(h0->ref_count)))) {
-
- ff_h264_fill_default_ref_list(h);
- }
-
- if (h->slice_type_nos != AV_PICTURE_TYPE_I) {
- ret = ff_h264_decode_ref_pic_list_reordering(h);
- if (ret < 0) {
- h->ref_count[1] = h->ref_count[0] = 0;
- return ret;
- }
- }
-
- if ((h->pps.weighted_pred && h->slice_type_nos == AV_PICTURE_TYPE_P) ||
- (h->pps.weighted_bipred_idc == 1 &&
- h->slice_type_nos == AV_PICTURE_TYPE_B))
- ff_pred_weight_table(h);
- else if (h->pps.weighted_bipred_idc == 2 &&
- h->slice_type_nos == AV_PICTURE_TYPE_B) {
- implicit_weight_table(h, -1);
- } else {
- h->use_weight = 0;
- for (i = 0; i < 2; i++) {
- h->luma_weight_flag[i] = 0;
- h->chroma_weight_flag[i] = 0;
- }
- }
-
- // If frame-mt is enabled, only update mmco tables for the first slice
- // in a field. Subsequent slices can temporarily clobber h->mmco_index
- // or h->mmco, which will cause ref list mix-ups and decoding errors
- // further down the line. This may break decoding if the first slice is
- // corrupt, thus we only do this if frame-mt is enabled.
- if (h->nal_ref_idc) {
- ret = ff_h264_decode_ref_pic_marking(h0, &h->gb,
- !(h->avctx->active_thread_type & FF_THREAD_FRAME) ||
- h0->current_slice == 0);
- if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
- return AVERROR_INVALIDDATA;
- }
-
- if (FRAME_MBAFF(h)) {
- ff_h264_fill_mbaff_ref_list(h);
-
- if (h->pps.weighted_bipred_idc == 2 && h->slice_type_nos == AV_PICTURE_TYPE_B) {
- implicit_weight_table(h, 0);
- implicit_weight_table(h, 1);
- }
- }
-
- if (h->slice_type_nos == AV_PICTURE_TYPE_B && !h->direct_spatial_mv_pred)
- ff_h264_direct_dist_scale_factor(h);
- ff_h264_direct_ref_list_init(h);
-
- if (h->slice_type_nos != AV_PICTURE_TYPE_I && h->pps.cabac) {
- tmp = get_ue_golomb_31(&h->gb);
- if (tmp > 2) {
- av_log(h->avctx, AV_LOG_ERROR, "cabac_init_idc overflow\n");
- return AVERROR_INVALIDDATA;
- }
- h->cabac_init_idc = tmp;
- }
-
- h->last_qscale_diff = 0;
- tmp = h->pps.init_qp + get_se_golomb(&h->gb);
- if (tmp > 51 + 6 * (h->sps.bit_depth_luma - 8)) {
- av_log(h->avctx, AV_LOG_ERROR, "QP %u out of range\n", tmp);
- return AVERROR_INVALIDDATA;
- }
- h->qscale = tmp;
- h->chroma_qp[0] = get_chroma_qp(h, 0, h->qscale);
- h->chroma_qp[1] = get_chroma_qp(h, 1, h->qscale);
- // FIXME qscale / qp ... stuff
- if (h->slice_type == AV_PICTURE_TYPE_SP)
- get_bits1(&h->gb); /* sp_for_switch_flag */
- if (h->slice_type == AV_PICTURE_TYPE_SP ||
- h->slice_type == AV_PICTURE_TYPE_SI)
- get_se_golomb(&h->gb); /* slice_qs_delta */
-
- h->deblocking_filter = 1;
- h->slice_alpha_c0_offset = 52;
- h->slice_beta_offset = 52;
- if (h->pps.deblocking_filter_parameters_present) {
- tmp = get_ue_golomb_31(&h->gb);
- if (tmp > 2) {
- av_log(h->avctx, AV_LOG_ERROR,
- "deblocking_filter_idc %u out of range\n", tmp);
- return AVERROR_INVALIDDATA;
- }
- h->deblocking_filter = tmp;
- if (h->deblocking_filter < 2)
- h->deblocking_filter ^= 1; // 1<->0
-
- if (h->deblocking_filter) {
- h->slice_alpha_c0_offset += get_se_golomb(&h->gb) << 1;
- h->slice_beta_offset += get_se_golomb(&h->gb) << 1;
- if (h->slice_alpha_c0_offset > 104U ||
- h->slice_beta_offset > 104U) {
- av_log(h->avctx, AV_LOG_ERROR,
- "deblocking filter parameters %d %d out of range\n",
- h->slice_alpha_c0_offset, h->slice_beta_offset);
- return AVERROR_INVALIDDATA;
- }
- }
- }
-
- if (h->avctx->skip_loop_filter >= AVDISCARD_ALL ||
- (h->avctx->skip_loop_filter >= AVDISCARD_NONKEY &&
- h->slice_type_nos != AV_PICTURE_TYPE_I) ||
- (h->avctx->skip_loop_filter >= AVDISCARD_BIDIR &&
- h->slice_type_nos == AV_PICTURE_TYPE_B) ||
- (h->avctx->skip_loop_filter >= AVDISCARD_NONREF &&
- h->nal_ref_idc == 0))
- h->deblocking_filter = 0;
-
- if (h->deblocking_filter == 1 && h0->max_contexts > 1) {
- if (h->avctx->flags2 & CODEC_FLAG2_FAST) {
- /* Cheat slightly for speed:
- * Do not bother to deblock across slices. */
- h->deblocking_filter = 2;
- } else {
- h0->max_contexts = 1;
- if (!h0->single_decode_warning) {
- av_log(h->avctx, AV_LOG_INFO,
- "Cannot parallelize deblocking type 1, decoding such frames in sequential order\n");
- h0->single_decode_warning = 1;
- }
- if (h != h0) {
- av_log(h->avctx, AV_LOG_ERROR,
- "Deblocking switched inside frame.\n");
- return 1;
- }
- }
- }
- h->qp_thresh = 15 + 52 -
- FFMIN(h->slice_alpha_c0_offset, h->slice_beta_offset) -
- FFMAX3(0,
- h->pps.chroma_qp_index_offset[0],
- h->pps.chroma_qp_index_offset[1]) +
- 6 * (h->sps.bit_depth_luma - 8);
-
- h0->last_slice_type = slice_type;
- memcpy(h0->last_ref_count, h0->ref_count, sizeof(h0->last_ref_count));
- h->slice_num = ++h0->current_slice;
-
- if (h->slice_num)
- h0->slice_row[(h->slice_num-1)&(MAX_SLICES-1)]= h->resync_mb_y;
- if ( h0->slice_row[h->slice_num&(MAX_SLICES-1)] + 3 >= h->resync_mb_y
- && h0->slice_row[h->slice_num&(MAX_SLICES-1)] <= h->resync_mb_y
- && h->slice_num >= MAX_SLICES) {
- //in case of ASO this check needs to be updated depending on how we decide to assign slice numbers in this case
- av_log(h->avctx, AV_LOG_WARNING, "Possibly too many slices (%d >= %d), increase MAX_SLICES and recompile if there are artifacts\n", h->slice_num, MAX_SLICES);
- }
-
- for (j = 0; j < 2; j++) {
- int id_list[16];
- int *ref2frm = h->ref2frm[h->slice_num & (MAX_SLICES - 1)][j];
- for (i = 0; i < 16; i++) {
- id_list[i] = 60;
- if (j < h->list_count && i < h->ref_count[j] &&
- h->ref_list[j][i].f.buf[0]) {
- int k;
- AVBuffer *buf = h->ref_list[j][i].f.buf[0]->buffer;
- for (k = 0; k < h->short_ref_count; k++)
- if (h->short_ref[k]->f.buf[0]->buffer == buf) {
- id_list[i] = k;
- break;
- }
- for (k = 0; k < h->long_ref_count; k++)
- if (h->long_ref[k] && h->long_ref[k]->f.buf[0]->buffer == buf) {
- id_list[i] = h->short_ref_count + k;
- break;
- }
- }
- }
-
- ref2frm[0] =
- ref2frm[1] = -1;
- for (i = 0; i < 16; i++)
- ref2frm[i + 2] = 4 * id_list[i] + (h->ref_list[j][i].reference & 3);
- ref2frm[18 + 0] =
- ref2frm[18 + 1] = -1;
- for (i = 16; i < 48; i++)
- ref2frm[i + 4] = 4 * id_list[(i - 16) >> 1] +
- (h->ref_list[j][i].reference & 3);
- }
-
- if (h->ref_count[0]) h->er.last_pic = &h->ref_list[0][0];
- if (h->ref_count[1]) h->er.next_pic = &h->ref_list[1][0];
- h->er.ref_count = h->ref_count[0];
-
- if (h->avctx->debug & FF_DEBUG_PICT_INFO) {
- av_log(h->avctx, AV_LOG_DEBUG,
- "slice:%d %s mb:%d %c%s%s pps:%u frame:%d poc:%d/%d ref:%d/%d qp:%d loop:%d:%d:%d weight:%d%s %s\n",
- h->slice_num,
- (h->picture_structure == PICT_FRAME ? "F" : h->picture_structure == PICT_TOP_FIELD ? "T" : "B"),
- first_mb_in_slice,
- av_get_picture_type_char(h->slice_type),
- h->slice_type_fixed ? " fix" : "",
- h->nal_unit_type == NAL_IDR_SLICE ? " IDR" : "",
- pps_id, h->frame_num,
- h->cur_pic_ptr->field_poc[0],
- h->cur_pic_ptr->field_poc[1],
- h->ref_count[0], h->ref_count[1],
- h->qscale,
- h->deblocking_filter,
- h->slice_alpha_c0_offset / 2 - 26, h->slice_beta_offset / 2 - 26,
- h->use_weight,
- h->use_weight == 1 && h->use_weight_chroma ? "c" : "",
- h->slice_type == AV_PICTURE_TYPE_B ? (h->direct_spatial_mv_pred ? "SPAT" : "TEMP") : "");
+ if (list_count != h->list_count ||
+ ref_count[0] != h->ref_count[0] ||
+ ref_count[1] != h->ref_count[1]) {
+ h->ref_count[0] = ref_count[0];
+ h->ref_count[1] = ref_count[1];
+ h->list_count = list_count;
+ return 1;
}
return 0;
}
-int ff_h264_get_slice_type(const H264Context *h)
-{
- switch (h->slice_type) {
- case AV_PICTURE_TYPE_P:
- return 0;
- case AV_PICTURE_TYPE_B:
- return 1;
- case AV_PICTURE_TYPE_I:
- return 2;
- case AV_PICTURE_TYPE_SP:
- return 3;
- case AV_PICTURE_TYPE_SI:
- return 4;
- default:
- return AVERROR_INVALIDDATA;
- }
-}
+static const uint8_t start_code[] = { 0x00, 0x00, 0x01 };
-static av_always_inline void fill_filter_caches_inter(H264Context *h,
- int mb_type, int top_xy,
- int left_xy[LEFT_MBS],
- int top_type,
- int left_type[LEFT_MBS],
- int mb_xy, int list)
+static int find_start_code(const uint8_t *buf, int buf_size,
+ int buf_index, int next_avc)
{
- int b_stride = h->b_stride;
- int16_t(*mv_dst)[2] = &h->mv_cache[list][scan8[0]];
- int8_t *ref_cache = &h->ref_cache[list][scan8[0]];
- if (IS_INTER(mb_type) || IS_DIRECT(mb_type)) {
- if (USES_LIST(top_type, list)) {
- const int b_xy = h->mb2b_xy[top_xy] + 3 * b_stride;
- const int b8_xy = 4 * top_xy + 2;
- int (*ref2frm)[64] = (void*)(h->ref2frm[h->slice_table[top_xy] & (MAX_SLICES - 1)][0] + (MB_MBAFF(h) ? 20 : 2));
- AV_COPY128(mv_dst - 1 * 8, h->cur_pic.motion_val[list][b_xy + 0]);
- ref_cache[0 - 1 * 8] =
- ref_cache[1 - 1 * 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 0]];
- ref_cache[2 - 1 * 8] =
- ref_cache[3 - 1 * 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 1]];
- } else {
- AV_ZERO128(mv_dst - 1 * 8);
- AV_WN32A(&ref_cache[0 - 1 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
- }
+ // start code prefix search
+ 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;
- if (!IS_INTERLACED(mb_type ^ left_type[LTOP])) {
- if (USES_LIST(left_type[LTOP], list)) {
- const int b_xy = h->mb2b_xy[left_xy[LTOP]] + 3;
- const int b8_xy = 4 * left_xy[LTOP] + 1;
- int (*ref2frm)[64] =(void*)( h->ref2frm[h->slice_table[left_xy[LTOP]] & (MAX_SLICES - 1)][0] + (MB_MBAFF(h) ? 20 : 2));
- AV_COPY32(mv_dst - 1 + 0, h->cur_pic.motion_val[list][b_xy + b_stride * 0]);
- AV_COPY32(mv_dst - 1 + 8, h->cur_pic.motion_val[list][b_xy + b_stride * 1]);
- AV_COPY32(mv_dst - 1 + 16, h->cur_pic.motion_val[list][b_xy + b_stride * 2]);
- AV_COPY32(mv_dst - 1 + 24, h->cur_pic.motion_val[list][b_xy + b_stride * 3]);
- ref_cache[-1 + 0] =
- ref_cache[-1 + 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 0]];
- ref_cache[-1 + 16] =
- ref_cache[-1 + 24] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 1]];
- } else {
- AV_ZERO32(mv_dst - 1 + 0);
- AV_ZERO32(mv_dst - 1 + 8);
- AV_ZERO32(mv_dst - 1 + 16);
- AV_ZERO32(mv_dst - 1 + 24);
- ref_cache[-1 + 0] =
- ref_cache[-1 + 8] =
- ref_cache[-1 + 16] =
- ref_cache[-1 + 24] = LIST_NOT_USED;
- }
- }
- }
+ buf_index += 3;
- if (!USES_LIST(mb_type, list)) {
- fill_rectangle(mv_dst, 4, 4, 8, pack16to32(0, 0), 4);
- AV_WN32A(&ref_cache[0 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
- AV_WN32A(&ref_cache[1 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
- AV_WN32A(&ref_cache[2 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
- AV_WN32A(&ref_cache[3 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
- return;
- }
+ if (buf_index >= buf_size)
+ return buf_size;
- {
- int8_t *ref = &h->cur_pic.ref_index[list][4 * mb_xy];
- int (*ref2frm)[64] = (void*)(h->ref2frm[h->slice_num & (MAX_SLICES - 1)][0] + (MB_MBAFF(h) ? 20 : 2));
- uint32_t ref01 = (pack16to32(ref2frm[list][ref[0]], ref2frm[list][ref[1]]) & 0x00FF00FF) * 0x0101;
- uint32_t ref23 = (pack16to32(ref2frm[list][ref[2]], ref2frm[list][ref[3]]) & 0x00FF00FF) * 0x0101;
- AV_WN32A(&ref_cache[0 * 8], ref01);
- AV_WN32A(&ref_cache[1 * 8], ref01);
- AV_WN32A(&ref_cache[2 * 8], ref23);
- AV_WN32A(&ref_cache[3 * 8], ref23);
- }
-
- {
- int16_t(*mv_src)[2] = &h->cur_pic.motion_val[list][4 * h->mb_x + 4 * h->mb_y * b_stride];
- AV_COPY128(mv_dst + 8 * 0, mv_src + 0 * b_stride);
- AV_COPY128(mv_dst + 8 * 1, mv_src + 1 * b_stride);
- AV_COPY128(mv_dst + 8 * 2, mv_src + 2 * b_stride);
- AV_COPY128(mv_dst + 8 * 3, mv_src + 3 * b_stride);
- }
+ return buf_index;
}
-/**
- *
- * @return non zero if the loop filter can be skipped
- */
-static int fill_filter_caches(H264Context *h, int mb_type)
+static int get_avc_nalsize(H264Context *h, const uint8_t *buf,
+ int buf_size, int *buf_index)
{
- const int mb_xy = h->mb_xy;
- int top_xy, left_xy[LEFT_MBS];
- int top_type, left_type[LEFT_MBS];
- uint8_t *nnz;
- uint8_t *nnz_cache;
-
- top_xy = mb_xy - (h->mb_stride << MB_FIELD(h));
-
- /* Wow, what a mess, why didn't they simplify the interlacing & intra
- * stuff, I can't imagine that these complex rules are worth it. */
-
- left_xy[LBOT] = left_xy[LTOP] = mb_xy - 1;
- if (FRAME_MBAFF(h)) {
- const int left_mb_field_flag = IS_INTERLACED(h->cur_pic.mb_type[mb_xy - 1]);
- const int curr_mb_field_flag = IS_INTERLACED(mb_type);
- if (h->mb_y & 1) {
- if (left_mb_field_flag != curr_mb_field_flag)
- left_xy[LTOP] -= h->mb_stride;
- } else {
- if (curr_mb_field_flag)
- top_xy += h->mb_stride &
- (((h->cur_pic.mb_type[top_xy] >> 7) & 1) - 1);
- if (left_mb_field_flag != curr_mb_field_flag)
- left_xy[LBOT] += h->mb_stride;
- }
- }
-
- h->top_mb_xy = top_xy;
- h->left_mb_xy[LTOP] = left_xy[LTOP];
- h->left_mb_xy[LBOT] = left_xy[LBOT];
- {
- /* For sufficiently low qp, filtering wouldn't do anything.
- * This is a conservative estimate: could also check beta_offset
- * and more accurate chroma_qp. */
- int qp_thresh = h->qp_thresh; // FIXME strictly we should store qp_thresh for each mb of a slice
- int qp = h->cur_pic.qscale_table[mb_xy];
- if (qp <= qp_thresh &&
- (left_xy[LTOP] < 0 ||
- ((qp + h->cur_pic.qscale_table[left_xy[LTOP]] + 1) >> 1) <= qp_thresh) &&
- (top_xy < 0 ||
- ((qp + h->cur_pic.qscale_table[top_xy] + 1) >> 1) <= qp_thresh)) {
- if (!FRAME_MBAFF(h))
- return 1;
- if ((left_xy[LTOP] < 0 ||
- ((qp + h->cur_pic.qscale_table[left_xy[LBOT]] + 1) >> 1) <= qp_thresh) &&
- (top_xy < h->mb_stride ||
- ((qp + h->cur_pic.qscale_table[top_xy - h->mb_stride] + 1) >> 1) <= qp_thresh))
- return 1;
- }
- }
-
- top_type = h->cur_pic.mb_type[top_xy];
- left_type[LTOP] = h->cur_pic.mb_type[left_xy[LTOP]];
- left_type[LBOT] = h->cur_pic.mb_type[left_xy[LBOT]];
- if (h->deblocking_filter == 2) {
- if (h->slice_table[top_xy] != h->slice_num)
- top_type = 0;
- if (h->slice_table[left_xy[LBOT]] != h->slice_num)
- left_type[LTOP] = left_type[LBOT] = 0;
- } else {
- if (h->slice_table[top_xy] == 0xFFFF)
- top_type = 0;
- if (h->slice_table[left_xy[LBOT]] == 0xFFFF)
- left_type[LTOP] = left_type[LBOT] = 0;
- }
- h->top_type = top_type;
- h->left_type[LTOP] = left_type[LTOP];
- h->left_type[LBOT] = left_type[LBOT];
-
- if (IS_INTRA(mb_type))
- return 0;
-
- fill_filter_caches_inter(h, mb_type, top_xy, left_xy,
- top_type, left_type, mb_xy, 0);
- if (h->list_count == 2)
- fill_filter_caches_inter(h, mb_type, top_xy, left_xy,
- top_type, left_type, mb_xy, 1);
-
- nnz = h->non_zero_count[mb_xy];
- nnz_cache = h->non_zero_count_cache;
- AV_COPY32(&nnz_cache[4 + 8 * 1], &nnz[0]);
- AV_COPY32(&nnz_cache[4 + 8 * 2], &nnz[4]);
- AV_COPY32(&nnz_cache[4 + 8 * 3], &nnz[8]);
- AV_COPY32(&nnz_cache[4 + 8 * 4], &nnz[12]);
- h->cbp = h->cbp_table[mb_xy];
-
- if (top_type) {
- nnz = h->non_zero_count[top_xy];
- AV_COPY32(&nnz_cache[4 + 8 * 0], &nnz[3 * 4]);
- }
+ int i, nalsize = 0;
- if (left_type[LTOP]) {
- nnz = h->non_zero_count[left_xy[LTOP]];
- nnz_cache[3 + 8 * 1] = nnz[3 + 0 * 4];
- nnz_cache[3 + 8 * 2] = nnz[3 + 1 * 4];
- nnz_cache[3 + 8 * 3] = nnz[3 + 2 * 4];
- nnz_cache[3 + 8 * 4] = nnz[3 + 3 * 4];
- }
-
- /* CAVLC 8x8dct requires NNZ values for residual decoding that differ
- * from what the loop filter needs */
- if (!CABAC(h) && h->pps.transform_8x8_mode) {
- if (IS_8x8DCT(top_type)) {
- nnz_cache[4 + 8 * 0] =
- nnz_cache[5 + 8 * 0] = (h->cbp_table[top_xy] & 0x4000) >> 12;
- nnz_cache[6 + 8 * 0] =
- nnz_cache[7 + 8 * 0] = (h->cbp_table[top_xy] & 0x8000) >> 12;
- }
- if (IS_8x8DCT(left_type[LTOP])) {
- nnz_cache[3 + 8 * 1] =
- nnz_cache[3 + 8 * 2] = (h->cbp_table[left_xy[LTOP]] & 0x2000) >> 12; // FIXME check MBAFF
- }
- if (IS_8x8DCT(left_type[LBOT])) {
- nnz_cache[3 + 8 * 3] =
- nnz_cache[3 + 8 * 4] = (h->cbp_table[left_xy[LBOT]] & 0x8000) >> 12; // FIXME check MBAFF
- }
-
- if (IS_8x8DCT(mb_type)) {
- nnz_cache[scan8[0]] =
- nnz_cache[scan8[1]] =
- nnz_cache[scan8[2]] =
- nnz_cache[scan8[3]] = (h->cbp & 0x1000) >> 12;
-
- nnz_cache[scan8[0 + 4]] =
- nnz_cache[scan8[1 + 4]] =
- nnz_cache[scan8[2 + 4]] =
- nnz_cache[scan8[3 + 4]] = (h->cbp & 0x2000) >> 12;
-
- nnz_cache[scan8[0 + 8]] =
- nnz_cache[scan8[1 + 8]] =
- nnz_cache[scan8[2 + 8]] =
- nnz_cache[scan8[3 + 8]] = (h->cbp & 0x4000) >> 12;
-
- nnz_cache[scan8[0 + 12]] =
- nnz_cache[scan8[1 + 12]] =
- nnz_cache[scan8[2 + 12]] =
- nnz_cache[scan8[3 + 12]] = (h->cbp & 0x8000) >> 12;
- }
- }
-
- return 0;
-}
-
-static void loop_filter(H264Context *h, int start_x, int end_x)
-{
- uint8_t *dest_y, *dest_cb, *dest_cr;
- int linesize, uvlinesize, mb_x, mb_y;
- const int end_mb_y = h->mb_y + FRAME_MBAFF(h);
- const int old_slice_type = h->slice_type;
- const int pixel_shift = h->pixel_shift;
- const int block_h = 16 >> h->chroma_y_shift;
-
- if (h->deblocking_filter) {
- for (mb_x = start_x; mb_x < end_x; mb_x++)
- for (mb_y = end_mb_y - FRAME_MBAFF(h); mb_y <= end_mb_y; mb_y++) {
- int mb_xy, mb_type;
- mb_xy = h->mb_xy = mb_x + mb_y * h->mb_stride;
- h->slice_num = h->slice_table[mb_xy];
- mb_type = h->cur_pic.mb_type[mb_xy];
- h->list_count = h->list_counts[mb_xy];
-
- if (FRAME_MBAFF(h))
- h->mb_mbaff =
- h->mb_field_decoding_flag = !!IS_INTERLACED(mb_type);
-
- h->mb_x = mb_x;
- h->mb_y = mb_y;
- dest_y = h->cur_pic.f.data[0] +
- ((mb_x << pixel_shift) + mb_y * h->linesize) * 16;
- dest_cb = h->cur_pic.f.data[1] +
- (mb_x << pixel_shift) * (8 << CHROMA444(h)) +
- mb_y * h->uvlinesize * block_h;
- dest_cr = h->cur_pic.f.data[2] +
- (mb_x << pixel_shift) * (8 << CHROMA444(h)) +
- mb_y * h->uvlinesize * block_h;
- // FIXME simplify above
-
- if (MB_FIELD(h)) {
- linesize = h->mb_linesize = h->linesize * 2;
- uvlinesize = h->mb_uvlinesize = h->uvlinesize * 2;
- if (mb_y & 1) { // FIXME move out of this function?
- dest_y -= h->linesize * 15;
- dest_cb -= h->uvlinesize * (block_h - 1);
- dest_cr -= h->uvlinesize * (block_h - 1);
- }
- } else {
- linesize = h->mb_linesize = h->linesize;
- uvlinesize = h->mb_uvlinesize = h->uvlinesize;
- }
- backup_mb_border(h, dest_y, dest_cb, dest_cr, linesize,
- uvlinesize, 0);
- if (fill_filter_caches(h, mb_type))
- continue;
- h->chroma_qp[0] = get_chroma_qp(h, 0, h->cur_pic.qscale_table[mb_xy]);
- h->chroma_qp[1] = get_chroma_qp(h, 1, h->cur_pic.qscale_table[mb_xy]);
+ if (*buf_index >= buf_size - h->nal_length_size)
+ return -1;
- if (FRAME_MBAFF(h)) {
- ff_h264_filter_mb(h, mb_x, mb_y, dest_y, dest_cb, dest_cr,
- linesize, uvlinesize);
- } else {
- ff_h264_filter_mb_fast(h, mb_x, mb_y, dest_y, dest_cb,
- dest_cr, linesize, uvlinesize);
- }
- }
+ for (i = 0; i < h->nal_length_size; i++)
+ nalsize = (nalsize << 8) | buf[(*buf_index)++];
+ if (nalsize <= 0 || nalsize > buf_size - *buf_index) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "AVC: nal size %d\n", nalsize);
+ return -1;
}
- h->slice_type = old_slice_type;
- h->mb_x = end_x;
- h->mb_y = end_mb_y - FRAME_MBAFF(h);
- h->chroma_qp[0] = get_chroma_qp(h, 0, h->qscale);
- h->chroma_qp[1] = get_chroma_qp(h, 1, h->qscale);
+ return nalsize;
}
-static void predict_field_decoding_flag(H264Context *h)
-{
- const int mb_xy = h->mb_x + h->mb_y * h->mb_stride;
- int mb_type = (h->slice_table[mb_xy - 1] == h->slice_num) ?
- h->cur_pic.mb_type[mb_xy - 1] :
- (h->slice_table[mb_xy - h->mb_stride] == h->slice_num) ?
- h->cur_pic.mb_type[mb_xy - h->mb_stride] : 0;
- h->mb_mbaff = h->mb_field_decoding_flag = IS_INTERLACED(mb_type) ? 1 : 0;
-}
-
-/**
- * Draw edges and report progress for the last MB row.
- */
-static void decode_finish_row(H264Context *h)
+static int get_bit_length(H264Context *h, const uint8_t *buf,
+ const uint8_t *ptr, int dst_length,
+ int i, int next_avc)
{
- int top = 16 * (h->mb_y >> FIELD_PICTURE(h));
- int pic_height = 16 * h->mb_height >> FIELD_PICTURE(h);
- int height = 16 << FRAME_MBAFF(h);
- int deblock_border = (16 + 4) << FRAME_MBAFF(h);
-
- if (h->deblocking_filter) {
- if ((top + height) >= pic_height)
- height += deblock_border;
- top -= deblock_border;
- }
-
- if (top >= pic_height || (top + height) < 0)
- return;
-
- height = FFMIN(height, pic_height - top);
- if (top < 0) {
- height = top + height;
- top = 0;
- }
-
- ff_h264_draw_horiz_band(h, top, height);
+ if ((h->workaround_bugs & FF_BUG_AUTODETECT) && i + 3 < next_avc &&
+ buf[i] == 0x00 && buf[i + 1] == 0x00 &&
+ buf[i + 2] == 0x01 && buf[i + 3] == 0xE0)
+ h->workaround_bugs |= FF_BUG_TRUNCATED;
- if (h->droppable || h->er.error_occurred)
- return;
+ if (!(h->workaround_bugs & FF_BUG_TRUNCATED))
+ while (dst_length > 0 && ptr[dst_length - 1] == 0)
+ dst_length--;
- ff_thread_report_progress(&h->cur_pic_ptr->tf, top + height - 1,
- h->picture_structure == PICT_BOTTOM_FIELD);
-}
-
-static void er_add_slice(H264Context *h, int startx, int starty,
- int endx, int endy, int status)
-{
- if (CONFIG_ERROR_RESILIENCE) {
- ERContext *er = &h->er;
+ if (!dst_length)
+ return 0;
- ff_er_add_slice(er, startx, starty, endx, endy, status);
- }
+ return 8 * dst_length - decode_rbsp_trailing(h, ptr + dst_length - 1);
}
-static int decode_slice(struct AVCodecContext *avctx, void *arg)
+static int get_last_needed_nal(H264Context *h, const uint8_t *buf, int buf_size)
{
- H264Context *h = *(void **)arg;
- int lf_x_start = h->mb_x;
-
- h->mb_skip_run = -1;
-
- av_assert0(h->block_offset[15] == (4 * ((scan8[15] - scan8[0]) & 7) << h->pixel_shift) + 4 * h->linesize * ((scan8[15] - scan8[0]) >> 3));
-
- h->is_complex = FRAME_MBAFF(h) || h->picture_structure != PICT_FRAME ||
- avctx->codec_id != AV_CODEC_ID_H264 ||
- (CONFIG_GRAY && (h->flags & CODEC_FLAG_GRAY));
-
- if (!(h->avctx->active_thread_type & FF_THREAD_SLICE) && h->picture_structure == PICT_FRAME && h->er.error_status_table) {
- const int start_i = av_clip(h->resync_mb_x + h->resync_mb_y * h->mb_width, 0, h->mb_num - 1);
- if (start_i) {
- int prev_status = h->er.error_status_table[h->er.mb_index2xy[start_i - 1]];
- prev_status &= ~ VP_START;
- if (prev_status != (ER_MV_END | ER_DC_END | ER_AC_END))
- h->er.error_occurred = 1;
- }
- }
-
- if (h->pps.cabac) {
- /* realign */
- align_get_bits(&h->gb);
-
- /* init cabac */
- ff_init_cabac_decoder(&h->cabac,
- h->gb.buffer + get_bits_count(&h->gb) / 8,
- (get_bits_left(&h->gb) + 7) / 8);
-
- ff_h264_init_cabac_states(h);
-
- for (;;) {
- // START_TIMER
- int ret = ff_h264_decode_mb_cabac(h);
- int eos;
- // STOP_TIMER("decode_mb_cabac")
-
- if (ret >= 0)
- ff_h264_hl_decode_mb(h);
-
- // FIXME optimal? or let mb_decode decode 16x32 ?
- if (ret >= 0 && FRAME_MBAFF(h)) {
- h->mb_y++;
-
- ret = ff_h264_decode_mb_cabac(h);
-
- if (ret >= 0)
- ff_h264_hl_decode_mb(h);
- h->mb_y--;
- }
- eos = get_cabac_terminate(&h->cabac);
-
- if ((h->workaround_bugs & FF_BUG_TRUNCATED) &&
- h->cabac.bytestream > h->cabac.bytestream_end + 2) {
- er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x - 1,
- h->mb_y, ER_MB_END);
- if (h->mb_x >= lf_x_start)
- loop_filter(h, lf_x_start, h->mb_x + 1);
- return 0;
- }
- if (h->cabac.bytestream > h->cabac.bytestream_end + 2 )
- av_log(h->avctx, AV_LOG_DEBUG, "bytestream overread %td\n", h->cabac.bytestream_end - h->cabac.bytestream);
- if (ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 4) {
- av_log(h->avctx, AV_LOG_ERROR,
- "error while decoding MB %d %d, bytestream (%td)\n",
- h->mb_x, h->mb_y,
- h->cabac.bytestream_end - h->cabac.bytestream);
- er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
- h->mb_y, ER_MB_ERROR);
- return AVERROR_INVALIDDATA;
- }
+ int next_avc = h->is_avc ? 0 : buf_size;
+ int nal_index = 0;
+ int buf_index = 0;
+ int nals_needed = 0;
+ int first_slice = 0;
- if (++h->mb_x >= h->mb_width) {
- loop_filter(h, lf_x_start, h->mb_x);
- h->mb_x = lf_x_start = 0;
- decode_finish_row(h);
- ++h->mb_y;
- if (FIELD_OR_MBAFF_PICTURE(h)) {
- ++h->mb_y;
- if (FRAME_MBAFF(h) && h->mb_y < h->mb_height)
- predict_field_decoding_flag(h);
- }
- }
+ while(1) {
+ int nalsize = 0;
+ int dst_length, bit_length, consumed;
+ const uint8_t *ptr;
- if (eos || h->mb_y >= h->mb_height) {
- tprintf(h->avctx, "slice end %d %d\n",
- get_bits_count(&h->gb), h->gb.size_in_bits);
- er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x - 1,
- h->mb_y, ER_MB_END);
- if (h->mb_x > lf_x_start)
- loop_filter(h, lf_x_start, h->mb_x);
- return 0;
- }
+ if (buf_index >= next_avc) {
+ nalsize = get_avc_nalsize(h, buf, buf_size, &buf_index);
+ if (nalsize < 0)
+ break;
+ next_avc = buf_index + nalsize;
+ } else {
+ buf_index = find_start_code(buf, buf_size, buf_index, next_avc);
+ if (buf_index >= buf_size)
+ break;
+ if (buf_index >= next_avc)
+ continue;
}
- } else {
- for (;;) {
- int ret = ff_h264_decode_mb_cavlc(h);
-
- if (ret >= 0)
- ff_h264_hl_decode_mb(h);
-
- // FIXME optimal? or let mb_decode decode 16x32 ?
- if (ret >= 0 && FRAME_MBAFF(h)) {
- h->mb_y++;
- ret = ff_h264_decode_mb_cavlc(h);
-
- if (ret >= 0)
- ff_h264_hl_decode_mb(h);
- h->mb_y--;
- }
-
- if (ret < 0) {
- av_log(h->avctx, AV_LOG_ERROR,
- "error while decoding MB %d %d\n", h->mb_x, h->mb_y);
- er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
- h->mb_y, ER_MB_ERROR);
- return ret;
- }
-
- if (++h->mb_x >= h->mb_width) {
- loop_filter(h, lf_x_start, h->mb_x);
- h->mb_x = lf_x_start = 0;
- decode_finish_row(h);
- ++h->mb_y;
- if (FIELD_OR_MBAFF_PICTURE(h)) {
- ++h->mb_y;
- if (FRAME_MBAFF(h) && h->mb_y < h->mb_height)
- predict_field_decoding_flag(h);
- }
- if (h->mb_y >= h->mb_height) {
- tprintf(h->avctx, "slice end %d %d\n",
- get_bits_count(&h->gb), h->gb.size_in_bits);
-
- if ( get_bits_left(&h->gb) == 0
- || get_bits_left(&h->gb) > 0 && !(h->avctx->err_recognition & AV_EF_AGGRESSIVE)) {
- er_add_slice(h, h->resync_mb_x, h->resync_mb_y,
- h->mb_x - 1, h->mb_y,
- ER_MB_END);
-
- return 0;
- } else {
- er_add_slice(h, h->resync_mb_x, h->resync_mb_y,
- h->mb_x, h->mb_y,
- ER_MB_END);
-
- return AVERROR_INVALIDDATA;
- }
- }
- }
-
- if (get_bits_left(&h->gb) <= 0 && h->mb_skip_run <= 0) {
- tprintf(h->avctx, "slice end %d %d\n",
- get_bits_count(&h->gb), h->gb.size_in_bits);
- if (get_bits_left(&h->gb) == 0) {
- er_add_slice(h, h->resync_mb_x, h->resync_mb_y,
- h->mb_x - 1, h->mb_y,
- ER_MB_END);
- if (h->mb_x > lf_x_start)
- loop_filter(h, lf_x_start, h->mb_x);
+ ptr = ff_h264_decode_nal(h, buf + buf_index, &dst_length, &consumed,
+ next_avc - buf_index);
- return 0;
- } else {
- er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
- h->mb_y, ER_MB_ERROR);
+ if (ptr == NULL || dst_length < 0)
+ return AVERROR_INVALIDDATA;
- return AVERROR_INVALIDDATA;
- }
- }
- }
- }
-}
+ buf_index += consumed;
-/**
- * Call decode_slice() for each context.
- *
- * @param h h264 master context
- * @param context_count number of contexts to execute
- */
-static int execute_decode_slices(H264Context *h, int context_count)
-{
- AVCodecContext *const avctx = h->avctx;
- H264Context *hx;
- int i;
+ bit_length = get_bit_length(h, buf, ptr, dst_length,
+ buf_index, next_avc);
+ nal_index++;
- if (h->avctx->hwaccel ||
- h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
- return 0;
- if (context_count == 1) {
- return decode_slice(avctx, &h);
- } else {
- av_assert0(context_count > 0);
- for (i = 1; i < context_count; i++) {
- hx = h->thread_context[i];
- if (CONFIG_ERROR_RESILIENCE) {
- hx->er.error_count = 0;
- }
- hx->x264_build = h->x264_build;
- }
-
- avctx->execute(avctx, decode_slice, h->thread_context,
- NULL, context_count, sizeof(void *));
-
- /* pull back stuff from slices to master context */
- hx = h->thread_context[context_count - 1];
- h->mb_x = hx->mb_x;
- h->mb_y = hx->mb_y;
- h->droppable = hx->droppable;
- h->picture_structure = hx->picture_structure;
- if (CONFIG_ERROR_RESILIENCE) {
- for (i = 1; i < context_count; i++)
- h->er.error_count += h->thread_context[i]->er.error_count;
+ /* packets can sometimes contain multiple PPS/SPS,
+ * e.g. two PAFF field pictures in one packet, or a demuxer
+ * which splits NALs strangely if so, when frame threading we
+ * can't start the next thread until we've read all of them */
+ switch (h->nal_unit_type) {
+ case NAL_SPS:
+ case NAL_PPS:
+ nals_needed = nal_index;
+ break;
+ case NAL_DPA:
+ case NAL_IDR_SLICE:
+ case NAL_SLICE:
+ init_get_bits(&h->gb, ptr, bit_length);
+ if (!get_ue_golomb(&h->gb) ||
+ !first_slice ||
+ first_slice != h->nal_unit_type)
+ nals_needed = nal_index;
+ if (!first_slice)
+ first_slice = h->nal_unit_type;
}
}
- return 0;
+ return nals_needed;
}
-static const uint8_t start_code[] = { 0x00, 0x00, 0x01 };
-
static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
int parse_extradata)
{
AVCodecContext *const avctx = h->avctx;
H264Context *hx; ///< thread context
int buf_index;
- int context_count;
+ unsigned context_count;
int next_avc;
- int pass = !(avctx->active_thread_type & FF_THREAD_FRAME);
int nals_needed = 0; ///< number of NALs that need decoding before the next frame thread starts
int nal_index;
int idr_cleared=0;
- int first_slice = 0;
int ret = 0;
h->nal_unit_type= 0;
@@ -4694,7 +1464,10 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
h->is_avc = 1;
}
- for (; pass <= 1; pass++) {
+ if (avctx->active_thread_type & FF_THREAD_FRAME)
+ nals_needed = get_last_needed_nal(h, buf, buf_size);
+
+ {
buf_index = 0;
context_count = 0;
next_avc = h->is_avc ? 0 : buf_size;
@@ -4704,36 +1477,18 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
int dst_length;
int bit_length;
const uint8_t *ptr;
- int i, nalsize = 0;
+ int nalsize = 0;
int err;
if (buf_index >= next_avc) {
- if (buf_index >= buf_size - h->nal_length_size)
+ nalsize = get_avc_nalsize(h, buf, buf_size, &buf_index);
+ if (nalsize < 0)
break;
- nalsize = 0;
- for (i = 0; i < h->nal_length_size; i++)
- nalsize = (nalsize << 8) | buf[buf_index++];
- if (nalsize <= 0 || nalsize > buf_size - buf_index) {
- av_log(h->avctx, AV_LOG_ERROR,
- "AVC: nal size %d\n", nalsize);
- break;
- }
next_avc = buf_index + nalsize;
} else {
- // start code prefix search
- 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;
-
- if (buf_index + 3 >= buf_size) {
- buf_index = buf_size;
+ buf_index = find_start_code(buf, buf_size, buf_index, next_avc);
+ if (buf_index >= buf_size)
break;
- }
-
- buf_index += 3;
if (buf_index >= next_avc)
continue;
}
@@ -4746,23 +1501,14 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
ret = -1;
goto end;
}
- i = buf_index + consumed;
- if ((h->workaround_bugs & FF_BUG_AUTODETECT) && i + 3 < next_avc &&
- buf[i] == 0x00 && buf[i + 1] == 0x00 &&
- buf[i + 2] == 0x01 && buf[i + 3] == 0xE0)
- h->workaround_bugs |= FF_BUG_TRUNCATED;
-
- if (!(h->workaround_bugs & FF_BUG_TRUNCATED))
- while (dst_length > 0 && ptr[dst_length - 1] == 0)
- dst_length--;
- bit_length = !dst_length ? 0
- : (8 * dst_length -
- decode_rbsp_trailing(h, ptr + dst_length - 1));
+
+ bit_length = get_bit_length(h, buf, ptr, dst_length,
+ buf_index + consumed, next_avc);
if (h->avctx->debug & FF_DEBUG_STARTCODE)
av_log(h->avctx, AV_LOG_DEBUG,
- "NAL %d/%d at %d/%d length %d pass %d\n",
- hx->nal_unit_type, hx->nal_ref_idc, buf_index, buf_size, dst_length, pass);
+ "NAL %d/%d at %d/%d length %d\n",
+ hx->nal_unit_type, hx->nal_ref_idc, buf_index, buf_size, dst_length);
if (h->is_avc && (nalsize != consumed) && nalsize)
av_log(h->avctx, AV_LOG_DEBUG,
@@ -4772,42 +1518,15 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
buf_index += consumed;
nal_index++;
- if (pass == 0) {
- /* packets can sometimes contain multiple PPS/SPS,
- * e.g. two PAFF field pictures in one packet, or a demuxer
- * which splits NALs strangely if so, when frame threading we
- * can't start the next thread until we've read all of them */
- switch (hx->nal_unit_type) {
- case NAL_SPS:
- case NAL_PPS:
- nals_needed = nal_index;
- break;
- case NAL_DPA:
- case NAL_IDR_SLICE:
- case NAL_SLICE:
- init_get_bits(&hx->gb, ptr, bit_length);
- if (!get_ue_golomb(&hx->gb) || !first_slice)
- nals_needed = nal_index;
- if (!first_slice)
- first_slice = hx->nal_unit_type;
- }
- continue;
- }
-
- if (!first_slice)
- switch (hx->nal_unit_type) {
- case NAL_DPA:
- case NAL_IDR_SLICE:
- case NAL_SLICE:
- first_slice = hx->nal_unit_type;
- }
-
if (avctx->skip_frame >= AVDISCARD_NONREF &&
h->nal_ref_idc == 0 &&
h->nal_unit_type != NAL_SEI)
continue;
again:
+ if ( !(avctx->active_thread_type & FF_THREAD_FRAME)
+ || nals_needed >= nal_index)
+ h->au_pps_id = -1;
/* Ignore per frame NAL unit type during extradata
* parsing. Decoding slices is not possible in codec init
* with frame-mt */
@@ -4831,7 +1550,7 @@ again:
switch (hx->nal_unit_type) {
case NAL_IDR_SLICE:
- if (first_slice != NAL_IDR_SLICE) {
+ if (h->nal_unit_type != NAL_IDR_SLICE) {
av_log(h->avctx, AV_LOG_ERROR,
"Invalid mix of idr and non-idr slices\n");
ret = -1;
@@ -4846,7 +1565,7 @@ again:
hx->inter_gb_ptr = &hx->gb;
hx->data_partitioning = 0;
- if ((err = decode_slice_header(hx, h)))
+ if ((err = ff_h264_decode_slice_header(hx, h)))
break;
if (h->sei_recovery_frame_cnt >= 0) {
@@ -4922,12 +1641,24 @@ again:
}
break;
case NAL_DPA:
+ if (h->avctx->flags & CODEC_FLAG2_CHUNKS) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "Decoding in chunks is not supported for "
+ "partitioned slices.\n");
+ return AVERROR(ENOSYS);
+ }
+
init_get_bits(&hx->gb, ptr, bit_length);
hx->intra_gb_ptr =
hx->inter_gb_ptr = NULL;
- if ((err = decode_slice_header(hx, h)) < 0)
+ if ((err = ff_h264_decode_slice_header(hx, h)) < 0) {
+ /* make sure data_partitioning is cleared if it was set
+ * before, so we don't try decoding a slice without a valid
+ * slice header later */
+ h->data_partitioning = 0;
break;
+ }
hx->data_partitioning = 1;
break;
@@ -4992,13 +1723,14 @@ again:
}
if (context_count == h->max_contexts) {
- execute_decode_slices(h, context_count);
+ ff_h264_execute_decode_slices(h, context_count);
context_count = 0;
}
- if (err < 0)
+ if (err < 0) {
av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
- else if (err == 1) {
+ h->ref_count[0] = h->ref_count[1] = h->list_count = 0;
+ } else if (err == 1) {
/* Slice could not be decoded in parallel mode, copy down
* NAL unit stuff to context 0 and restart. Note that
* rbsp_buffer is not transferred, but since we no longer
@@ -5011,7 +1743,7 @@ again:
}
}
if (context_count)
- execute_decode_slices(h, context_count);
+ ff_h264_execute_decode_slices(h, context_count);
end:
/* clean up */
@@ -5036,9 +1768,10 @@ static int get_consumed_bytes(int pos, int buf_size)
return pos;
}
-static int output_frame(H264Context *h, AVFrame *dst, Picture *srcp)
+static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
{
AVFrame *src = &srcp->f;
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(src->format);
int i;
int ret = av_frame_ref(dst, src);
if (ret < 0)
@@ -5046,12 +1779,14 @@ static int output_frame(H264Context *h, AVFrame *dst, Picture *srcp)
av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0);
+ if (srcp->sei_recovery_frame_cnt == 0)
+ dst->key_frame = 1;
if (!srcp->crop)
return 0;
- for (i = 0; i < 3; i++) {
- int hshift = (i > 0) ? h->chroma_x_shift : 0;
- int vshift = (i > 0) ? h->chroma_y_shift : 0;
+ for (i = 0; i < desc->nb_components; i++) {
+ int hshift = (i > 0) ? desc->log2_chroma_w : 0;
+ int vshift = (i > 0) ? desc->log2_chroma_h : 0;
int off = ((srcp->crop_left >> hshift) << h->pixel_shift) +
(srcp->crop_top >> vshift) * dst->linesize[i];
dst->data[i] += off;
@@ -5059,19 +1794,22 @@ static int output_frame(H264Context *h, AVFrame *dst, Picture *srcp)
return 0;
}
-static int decode_frame(AVCodecContext *avctx, void *data,
- int *got_frame, AVPacket *avpkt)
+static int h264_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
H264Context *h = avctx->priv_data;
AVFrame *pict = data;
int buf_index = 0;
- Picture *out;
+ H264Picture *out;
int i, out_idx;
int ret;
h->flags = avctx->flags;
+ /* reset data partitioning here, to ensure GetBitContexts from previous
+ * packets do not get used. */
+ h->data_partitioning = 0;
/* end of stream, output what is still in the buffers */
if (buf_size == 0) {
@@ -5151,7 +1889,7 @@ not_extra:
if (avctx->flags2 & CODEC_FLAG2_CHUNKS)
decode_postinit(h, 1);
- field_end(h, 0);
+ ff_h264_field_end(h, 0);
/* Wait for second field. */
*got_frame = 0;
@@ -5165,7 +1903,10 @@ not_extra:
return ret;
*got_frame = 1;
if (CONFIG_MPEGVIDEO) {
- ff_print_debug_info2(h->avctx, h->next_output_pic, pict, h->er.mbskip_table,
+ ff_print_debug_info2(h->avctx, pict, h->er.mbskip_table,
+ h->next_output_pic->mb_type,
+ h->next_output_pic->qscale_table,
+ h->next_output_pic->motion_val,
&h->low_delay,
h->mb_width, h->mb_height, h->mb_stride, 1);
}
@@ -5181,7 +1922,7 @@ av_cold void ff_h264_free_context(H264Context *h)
{
int i;
- free_tables(h, 1); // FIXME cleanup init stuff perhaps
+ ff_h264_free_tables(h, 1); // FIXME cleanup init stuff perhaps
for (i = 0; i < MAX_SPS_COUNT; i++)
av_freep(h->sps_buffers + i);
@@ -5197,7 +1938,7 @@ static av_cold int h264_decode_end(AVCodecContext *avctx)
ff_h264_remove_all_refs(h);
ff_h264_free_context(h);
- unref_picture(h, &h->cur_pic);
+ ff_h264_unref_picture(h, &h->cur_pic);
return 0;
}
@@ -5247,13 +1988,13 @@ AVCodec ff_h264_decoder = {
.priv_data_size = sizeof(H264Context),
.init = ff_h264_decode_init,
.close = h264_decode_end,
- .decode = decode_frame,
+ .decode = h264_decode_frame,
.capabilities = /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 |
CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS |
CODEC_CAP_FRAME_THREADS,
.flush = flush_dpb,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
- .update_thread_context = ONLY_IF_THREADS_ENABLED(decode_update_thread_context),
+ .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context),
.profiles = NULL_IF_CONFIG_SMALL(profiles),
.priv_class = &h264_class,
};
@@ -5267,7 +2008,7 @@ AVCodec ff_h264_vdpau_decoder = {
.priv_data_size = sizeof(H264Context),
.init = ff_h264_decode_init,
.close = h264_decode_end,
- .decode = decode_frame,
+ .decode = h264_decode_frame,
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
.flush = flush_dpb,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VDPAU_H264,
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264.h b/chromium/third_party/ffmpeg/libavcodec/h264.h
index b7e1214a762..76f111ba789 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264.h
@@ -30,14 +30,20 @@
#include "libavutil/intreadwrite.h"
#include "cabac.h"
+#include "dsputil.h"
#include "error_resilience.h"
#include "get_bits.h"
-#include "mpegvideo.h"
#include "h264chroma.h"
#include "h264dsp.h"
#include "h264pred.h"
#include "h264qpel.h"
+#include "mpegutils.h"
+#include "parser.h"
#include "rectangle.h"
+#include "videodsp.h"
+
+#define H264_MAX_PICTURE_COUNT 36
+#define H264_MAX_THREADS 32
#define MAX_SPS_COUNT 32
#define MAX_PPS_COUNT 256
@@ -102,19 +108,19 @@
/* NAL unit types */
enum {
- NAL_SLICE = 1,
- NAL_DPA,
- NAL_DPB,
- NAL_DPC,
- NAL_IDR_SLICE,
- NAL_SEI,
- NAL_SPS,
- NAL_PPS,
- NAL_AUD,
- NAL_END_SEQUENCE,
- NAL_END_STREAM,
- NAL_FILLER_DATA,
- NAL_SPS_EXT,
+ NAL_SLICE = 1,
+ NAL_DPA = 2,
+ NAL_DPB = 3,
+ NAL_DPC = 4,
+ NAL_IDR_SLICE = 5,
+ NAL_SEI = 6,
+ NAL_SPS = 7,
+ NAL_PPS = 8,
+ NAL_AUD = 9,
+ NAL_END_SEQUENCE = 10,
+ NAL_END_STREAM = 11,
+ NAL_FILLER_DATA = 12,
+ NAL_SPS_EXT = 13,
NAL_AUXILIARY_SLICE = 19,
NAL_FF_IGNORE = 0xff0f001,
};
@@ -123,7 +129,7 @@ enum {
* SEI message types
*/
typedef enum {
- SEI_BUFFERING_PERIOD = 0, ///< buffering period (H.264, D.1.1)
+ SEI_TYPE_BUFFERING_PERIOD = 0, ///< buffering period (H.264, D.1.1)
SEI_TYPE_PIC_TIMING = 1, ///< picture timing
SEI_TYPE_USER_DATA_ITU_T_T35 = 4, ///< user data registered by ITU-T Recommendation T.35
SEI_TYPE_USER_DATA_UNREGISTERED = 5, ///< unregistered user data
@@ -163,6 +169,7 @@ typedef enum {
* Sequence parameter set
*/
typedef struct SPS {
+ unsigned int sps_id;
int profile_idc;
int level_idc;
int chroma_format_idc;
@@ -280,6 +287,50 @@ typedef struct MMCO {
int long_arg; ///< index, pic_num, or num long refs depending on opcode
} MMCO;
+typedef struct H264Picture {
+ struct AVFrame f;
+ uint8_t avframe_padding[1024]; // hack to allow linking to a avutil with larger AVFrame
+ ThreadFrame tf;
+
+ AVBufferRef *qscale_table_buf;
+ int8_t *qscale_table;
+
+ AVBufferRef *motion_val_buf[2];
+ int16_t (*motion_val[2])[2];
+
+ AVBufferRef *mb_type_buf;
+ uint32_t *mb_type;
+
+ AVBufferRef *hwaccel_priv_buf;
+ void *hwaccel_picture_private; ///< hardware accelerator private data
+
+ AVBufferRef *ref_index_buf[2];
+ int8_t *ref_index[2];
+
+ int field_poc[2]; ///< top/bottom POC
+ int poc; ///< frame POC
+ int frame_num; ///< frame_num (raw frame_num from slice header)
+ int mmco_reset; /**< MMCO_RESET set this 1. Reordering code must
+ not mix pictures before and after MMCO_RESET. */
+ int pic_id; /**< pic_num (short -> no wrap version of pic_num,
+ pic_num & max_pic_num; long -> long_pic_num) */
+ int long_ref; ///< 1->long term reference 0->short term reference
+ int ref_poc[2][2][32]; ///< POCs of the frames/fields used as reference (FIXME need per slice)
+ int ref_count[2][2]; ///< number of entries in ref_poc (FIXME need per slice)
+ int mbaff; ///< 1 -> MBAFF frame 0-> not MBAFF
+ int field_picture; ///< whether or not picture was encoded in separate fields
+
+ int needs_realloc; ///< picture needs to be reallocated (eg due to a frame size change)
+ int reference;
+ int recovered; ///< picture at IDR or recovery point + recovery count
+ int invalid_gap;
+ int sei_recovery_frame_cnt;
+
+ int crop;
+ int crop_left;
+ int crop_top;
+} H264Picture;
+
/**
* H264Context
*/
@@ -289,15 +340,14 @@ typedef struct H264Context {
H264DSPContext h264dsp;
H264ChromaContext h264chroma;
H264QpelContext h264qpel;
- MotionEstContext me;
ParseContext parse_context;
GetBitContext gb;
DSPContext dsp;
ERContext er;
- Picture *DPB;
- Picture *cur_pic_ptr;
- Picture cur_pic;
+ H264Picture *DPB;
+ H264Picture *cur_pic_ptr;
+ H264Picture cur_pic;
int pixel_shift; ///< 0 for 8-bit H264, 1 for high-bit-depth H264
int chroma_qp[2]; // QPc
@@ -384,11 +434,9 @@ typedef struct H264Context {
unsigned current_sps_id; ///< id of the current SPS
SPS sps; ///< current sps
+ PPS pps; ///< current pps
- /**
- * current pps
- */
- PPS pps; // FIXME move to Picture perhaps? (->no) do we need that?
+ int au_pps_id; ///< pps_id of current access unit
uint32_t dequant4_buffer[6][QP_MAX_NUM + 1][16]; // FIXME should these be moved down?
uint32_t dequant8_buffer[6][QP_MAX_NUM + 1][64];
@@ -434,7 +482,7 @@ typedef struct H264Context {
unsigned int ref_count[2]; ///< counts frames or fields, depending on current mb mode
unsigned int list_count;
uint8_t *list_counts; ///< Array of list_count per MB specifying the slice type
- Picture ref_list[2][48]; /**< 0..15: frame refs, 16..47: mbaff field refs.
+ H264Picture ref_list[2][48]; /**< 0..15: frame refs, 16..47: mbaff field refs.
* Reordered version of default_ref_list
* according to picture reordering in slice header */
int ref2frm[MAX_SLICES][2][64]; ///< reference to frame number lists, used in the loop filter, the first 2 are for -2,-1
@@ -549,12 +597,12 @@ typedef struct H264Context {
int redundant_pic_count;
- Picture default_ref_list[2][32]; ///< base reference list for all slices of a coded picture
- Picture *short_ref[32];
- Picture *long_ref[32];
- Picture *delayed_pic[MAX_DELAYED_PIC_COUNT + 2]; // FIXME size?
+ H264Picture default_ref_list[2][32]; ///< base reference list for all slices of a coded picture
+ H264Picture *short_ref[32];
+ H264Picture *long_ref[32];
+ H264Picture *delayed_pic[MAX_DELAYED_PIC_COUNT + 2]; // FIXME size?
int last_pocs[MAX_DELAYED_PIC_COUNT];
- Picture *next_output_pic;
+ H264Picture *next_output_pic;
int outputed_poc;
int next_outputed_poc;
@@ -574,7 +622,7 @@ typedef struct H264Context {
* @name Members for slice based multithreading
* @{
*/
- struct H264Context *thread_context[MAX_THREADS];
+ struct H264Context *thread_context[H264_MAX_THREADS];
/**
* current slice number, used to initialize slice_num of each thread/context
@@ -617,6 +665,14 @@ typedef struct H264Context {
int prev_interlaced_frame;
/**
+ * frame_packing_arrangment SEI message
+ */
+ int sei_frame_packing_present;
+ int frame_packing_arrangement_type;
+ int content_interpretation_type;
+ int quincunx_subsampling;
+
+ /**
* Bit set of clock types for fields/frames in picture timing SEI message.
* For each found ct_type, appropriate bit is set (e.g., bit 1 for
* interlaced).
@@ -688,12 +744,14 @@ typedef struct H264Context {
uint8_t *edge_emu_buffer;
int16_t *dc_val_base;
- uint8_t *visualization_buffer[3]; ///< temporary buffer vor MV visualization
-
AVBufferPool *qscale_table_pool;
AVBufferPool *mb_type_pool;
AVBufferPool *motion_val_pool;
AVBufferPool *ref_index_pool;
+
+ /* Motion Estimation */
+ qpel_mc_func (*qpel_put)[16];
+ qpel_mc_func (*qpel_avg)[16];
} H264Context;
extern const uint8_t ff_h264_chroma_qp[7][QP_MAX_NUM + 1]; ///< One chroma qp table for each possible bit depth (8-14).
@@ -797,6 +855,8 @@ int ff_h264_decode_mb_cabac(H264Context *h);
void ff_h264_init_cabac_states(H264Context *h);
+void h264_init_dequant_tables(H264Context *h);
+
void ff_h264_direct_dist_scale_factor(H264Context *const h);
void ff_h264_direct_ref_list_init(H264Context *const h);
void ff_h264_pred_direct_motion(H264Context *const h, int *mb_type);
@@ -1021,9 +1081,28 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h)
0x0001000100010001ULL));
}
+int ff_h264_field_end(H264Context *h, int in_setup);
+
+int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src);
+void ff_h264_unref_picture(H264Context *h, H264Picture *pic);
+
+int ff_h264_context_init(H264Context *h);
+int ff_h264_set_parameter_from_sps(H264Context *h);
+
void ff_h264_draw_horiz_band(H264Context *h, int y, int height);
int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc);
int ff_pred_weight_table(H264Context *h);
int ff_set_ref_count(H264Context *h);
+int ff_h264_decode_slice_header(H264Context *h, H264Context *h0);
+int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count);
+int ff_h264_update_thread_context(AVCodecContext *dst,
+ const AVCodecContext *src);
+
+void ff_h264_flush_change(H264Context *h);
+
+void ff_h264_free_tables(H264Context *h, int free_rbsp);
+
+void ff_h264_set_erpic(ERPicture *dst, H264Picture *src);
+
#endif /* AVCODEC_H264_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_cabac.c b/chromium/third_party/ffmpeg/libavcodec/h264_cabac.c
index d092ba69617..938b94770bd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_cabac.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_cabac.c
@@ -28,6 +28,8 @@
#define CABAC(h) 1
#include "libavutil/attributes.h"
+#include "libavutil/avassert.h"
+#include "libavutil/timer.h"
#include "config.h"
#include "cabac.h"
#include "cabac_functions.h"
@@ -37,7 +39,7 @@
#include "h264data.h"
#include "h264_mvpred.h"
#include "golomb.h"
-#include "libavutil/avassert.h"
+#include "mpegutils.h"
#if ARCH_X86
#include "x86/h264_i386.h"
@@ -1618,6 +1620,9 @@ decode_cabac_residual_internal(H264Context *h, int16_t *block,
cc.range = h->cabac.range;
cc.low = h->cabac.low;
cc.bytestream= h->cabac.bytestream;
+#if !UNCHECKED_BITSTREAM_READER || ARCH_AARCH64
+ cc.bytestream_end = h->cabac.bytestream_end;
+#endif
#else
#define CC &h->cabac
#endif
@@ -2188,7 +2193,7 @@ decode_intra_mb:
}
}else
ref=0;
- fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, ref, 1);
+ fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, ref, 1);
}
}
for(list=0; list<h->list_count; list++){
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_cavlc.c b/chromium/third_party/ffmpeg/libavcodec/h264_cavlc.c
index 87ae17c69d4..bc502484732 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_cavlc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_cavlc.c
@@ -29,11 +29,11 @@
#include "internal.h"
#include "avcodec.h"
-#include "mpegvideo.h"
#include "h264.h"
#include "h264data.h" // FIXME FIXME FIXME
#include "h264_mvpred.h"
#include "golomb.h"
+#include "mpegutils.h"
#include "libavutil/avassert.h"
@@ -615,17 +615,17 @@ static int decode_residual(H264Context *h, GetBitContext *gb, int16_t *block, in
} \
}
- if(zeros_left<0){
- av_log(h->avctx, AV_LOG_ERROR, "negative number of zero coeffs at %d %d\n", h->mb_x, h->mb_y);
- return -1;
- }
-
if (h->pixel_shift) {
STORE_BLOCK(int32_t)
} else {
STORE_BLOCK(int16_t)
}
+ if(zeros_left<0){
+ av_log(h->avctx, AV_LOG_ERROR, "negative number of zero coeffs at %d %d\n", h->mb_x, h->mb_y);
+ return -1;
+ }
+
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_direct.c b/chromium/third_party/ffmpeg/libavcodec/h264_direct.c
index 477359c8fff..3cc5f857151 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_direct.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_direct.c
@@ -27,8 +27,8 @@
#include "internal.h"
#include "avcodec.h"
-#include "mpegvideo.h"
#include "h264.h"
+#include "mpegutils.h"
#include "rectangle.h"
#include "thread.h"
@@ -67,7 +67,7 @@ void ff_h264_direct_dist_scale_factor(H264Context * const h){
}
static void fill_colmap(H264Context *h, int map[2][16+32], int list, int field, int colfield, int mbafi){
- Picture * const ref1 = &h->ref_list[1][0];
+ H264Picture * const ref1 = &h->ref_list[1][0];
int j, old_ref, rfield;
int start= mbafi ? 16 : 0;
int end = mbafi ? 16+2*h->ref_count[0] : h->ref_count[0];
@@ -100,8 +100,8 @@ static void fill_colmap(H264Context *h, int map[2][16+32], int list, int field,
}
void ff_h264_direct_ref_list_init(H264Context * const h){
- Picture * const ref1 = &h->ref_list[1][0];
- Picture * const cur = h->cur_pic_ptr;
+ H264Picture * const ref1 = &h->ref_list[1][0];
+ H264Picture * const cur = h->cur_pic_ptr;
int list, j, field;
int sidx= (h->picture_structure&1)^1;
int ref1sidx = (ref1->reference&1)^1;
@@ -140,7 +140,7 @@ void ff_h264_direct_ref_list_init(H264Context * const h){
}
}
-static void await_reference_mb_row(H264Context * const h, Picture *ref, int mb_y)
+static void await_reference_mb_row(H264Context * const h, H264Picture *ref, int mb_y)
{
int ref_field = ref->reference - 1;
int ref_field_picture = ref->field_picture;
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_loopfilter.c b/chromium/third_party/ffmpeg/libavcodec/h264_loopfilter.c
index 475070ae1b3..8c052c3e210 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_loopfilter.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_loopfilter.c
@@ -29,9 +29,9 @@
#include "libavutil/intreadwrite.h"
#include "internal.h"
#include "avcodec.h"
-#include "mpegvideo.h"
#include "h264.h"
#include "mathops.h"
+#include "mpegutils.h"
#include "rectangle.h"
/* Deblocking filter (p153) */
@@ -250,8 +250,8 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h,
int top_type= h->top_type;
int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
- int a = h->slice_alpha_c0_offset - qp_bd_offset;
- int b = h->slice_beta_offset - qp_bd_offset;
+ int a = 52 + h->slice_alpha_c0_offset - qp_bd_offset;
+ int b = 52 + h->slice_beta_offset - qp_bd_offset;
int mb_type = h->cur_pic.mb_type[mb_xy];
int qp = h->cur_pic.qscale_table[mb_xy];
@@ -709,8 +709,8 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint
av_unused int dir;
int chroma = CHROMA(h) && !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY));
int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
- int a = h->slice_alpha_c0_offset - qp_bd_offset;
- int b = h->slice_beta_offset - qp_bd_offset;
+ int a = 52 + h->slice_alpha_c0_offset - qp_bd_offset;
+ int b = 52 + h->slice_beta_offset - qp_bd_offset;
if (FRAME_MBAFF(h)
// and current and left pair do not have the same interlaced type
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_mb.c b/chromium/third_party/ffmpeg/libavcodec/h264_mb.c
new file mode 100644
index 00000000000..ff902beef46
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_mb.c
@@ -0,0 +1,820 @@
+/*
+ * H.26L/H.264/AVC/JVT/14496-10/... decoder
+ * Copyright (c) 2003 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
+ */
+
+/**
+ * @file
+ * H.264 / AVC / MPEG4 part10 macroblock decoding
+ */
+
+#include <stdint.h>
+
+#include "config.h"
+
+#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
+#include "avcodec.h"
+#include "h264.h"
+#include "svq3.h"
+#include "thread.h"
+
+static inline int get_lowest_part_list_y(H264Context *h, H264Picture *pic, int n,
+ int height, int y_offset, int list)
+{
+ int raw_my = h->mv_cache[list][scan8[n]][1];
+ int filter_height_down = (raw_my & 3) ? 3 : 0;
+ int full_my = (raw_my >> 2) + y_offset;
+ int bottom = full_my + filter_height_down + height;
+
+ av_assert2(height >= 0);
+
+ return FFMAX(0, bottom);
+}
+
+static inline void get_lowest_part_y(H264Context *h, int refs[2][48], int n,
+ int height, int y_offset, int list0,
+ int list1, int *nrefs)
+{
+ int my;
+
+ y_offset += 16 * (h->mb_y >> MB_FIELD(h));
+
+ if (list0) {
+ int ref_n = h->ref_cache[0][scan8[n]];
+ H264Picture *ref = &h->ref_list[0][ref_n];
+
+ // Error resilience puts the current picture in the ref list.
+ // Don't try to wait on these as it will cause a deadlock.
+ // Fields can wait on each other, though.
+ if (ref->tf.progress->data != h->cur_pic.tf.progress->data ||
+ (ref->reference & 3) != h->picture_structure) {
+ my = get_lowest_part_list_y(h, ref, n, height, y_offset, 0);
+ if (refs[0][ref_n] < 0)
+ nrefs[0] += 1;
+ refs[0][ref_n] = FFMAX(refs[0][ref_n], my);
+ }
+ }
+
+ if (list1) {
+ int ref_n = h->ref_cache[1][scan8[n]];
+ H264Picture *ref = &h->ref_list[1][ref_n];
+
+ if (ref->tf.progress->data != h->cur_pic.tf.progress->data ||
+ (ref->reference & 3) != h->picture_structure) {
+ my = get_lowest_part_list_y(h, ref, n, height, y_offset, 1);
+ if (refs[1][ref_n] < 0)
+ nrefs[1] += 1;
+ refs[1][ref_n] = FFMAX(refs[1][ref_n], my);
+ }
+ }
+}
+
+/**
+ * Wait until all reference frames are available for MC operations.
+ *
+ * @param h the H264 context
+ */
+static void await_references(H264Context *h)
+{
+ const int mb_xy = h->mb_xy;
+ const int mb_type = h->cur_pic.mb_type[mb_xy];
+ int refs[2][48];
+ int nrefs[2] = { 0 };
+ int ref, list;
+
+ memset(refs, -1, sizeof(refs));
+
+ if (IS_16X16(mb_type)) {
+ get_lowest_part_y(h, refs, 0, 16, 0,
+ IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
+ } else if (IS_16X8(mb_type)) {
+ get_lowest_part_y(h, refs, 0, 8, 0,
+ IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
+ get_lowest_part_y(h, refs, 8, 8, 8,
+ IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
+ } else if (IS_8X16(mb_type)) {
+ get_lowest_part_y(h, refs, 0, 16, 0,
+ IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
+ get_lowest_part_y(h, refs, 4, 16, 0,
+ IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
+ } else {
+ int i;
+
+ av_assert2(IS_8X8(mb_type));
+
+ for (i = 0; i < 4; i++) {
+ const int sub_mb_type = h->sub_mb_type[i];
+ const int n = 4 * i;
+ int y_offset = (i & 2) << 2;
+
+ if (IS_SUB_8X8(sub_mb_type)) {
+ get_lowest_part_y(h, refs, n, 8, y_offset,
+ IS_DIR(sub_mb_type, 0, 0),
+ IS_DIR(sub_mb_type, 0, 1),
+ nrefs);
+ } else if (IS_SUB_8X4(sub_mb_type)) {
+ get_lowest_part_y(h, refs, n, 4, y_offset,
+ IS_DIR(sub_mb_type, 0, 0),
+ IS_DIR(sub_mb_type, 0, 1),
+ nrefs);
+ get_lowest_part_y(h, refs, n + 2, 4, y_offset + 4,
+ IS_DIR(sub_mb_type, 0, 0),
+ IS_DIR(sub_mb_type, 0, 1),
+ nrefs);
+ } else if (IS_SUB_4X8(sub_mb_type)) {
+ get_lowest_part_y(h, refs, n, 8, y_offset,
+ IS_DIR(sub_mb_type, 0, 0),
+ IS_DIR(sub_mb_type, 0, 1),
+ nrefs);
+ get_lowest_part_y(h, refs, n + 1, 8, y_offset,
+ IS_DIR(sub_mb_type, 0, 0),
+ IS_DIR(sub_mb_type, 0, 1),
+ nrefs);
+ } else {
+ int j;
+ av_assert2(IS_SUB_4X4(sub_mb_type));
+ for (j = 0; j < 4; j++) {
+ int sub_y_offset = y_offset + 2 * (j & 2);
+ get_lowest_part_y(h, refs, n + j, 4, sub_y_offset,
+ IS_DIR(sub_mb_type, 0, 0),
+ IS_DIR(sub_mb_type, 0, 1),
+ nrefs);
+ }
+ }
+ }
+ }
+
+ for (list = h->list_count - 1; list >= 0; list--)
+ for (ref = 0; ref < 48 && nrefs[list]; ref++) {
+ int row = refs[list][ref];
+ if (row >= 0) {
+ H264Picture *ref_pic = &h->ref_list[list][ref];
+ int ref_field = ref_pic->reference - 1;
+ int ref_field_picture = ref_pic->field_picture;
+ int pic_height = 16 * h->mb_height >> ref_field_picture;
+
+ row <<= MB_MBAFF(h);
+ nrefs[list]--;
+
+ if (!FIELD_PICTURE(h) && ref_field_picture) { // frame referencing two fields
+ ff_thread_await_progress(&ref_pic->tf,
+ FFMIN((row >> 1) - !(row & 1),
+ pic_height - 1),
+ 1);
+ ff_thread_await_progress(&ref_pic->tf,
+ FFMIN((row >> 1), pic_height - 1),
+ 0);
+ } else if (FIELD_PICTURE(h) && !ref_field_picture) { // field referencing one field of a frame
+ ff_thread_await_progress(&ref_pic->tf,
+ FFMIN(row * 2 + ref_field,
+ pic_height - 1),
+ 0);
+ } else if (FIELD_PICTURE(h)) {
+ ff_thread_await_progress(&ref_pic->tf,
+ FFMIN(row, pic_height - 1),
+ ref_field);
+ } else {
+ ff_thread_await_progress(&ref_pic->tf,
+ FFMIN(row, pic_height - 1),
+ 0);
+ }
+ }
+ }
+}
+
+static av_always_inline void mc_dir_part(H264Context *h, H264Picture *pic,
+ int n, int square, int height,
+ int delta, int list,
+ uint8_t *dest_y, uint8_t *dest_cb,
+ uint8_t *dest_cr,
+ int src_x_offset, int src_y_offset,
+ qpel_mc_func *qpix_op,
+ h264_chroma_mc_func chroma_op,
+ int pixel_shift, int chroma_idc)
+{
+ const int mx = h->mv_cache[list][scan8[n]][0] + src_x_offset * 8;
+ int my = h->mv_cache[list][scan8[n]][1] + src_y_offset * 8;
+ const int luma_xy = (mx & 3) + ((my & 3) << 2);
+ ptrdiff_t offset = ((mx >> 2) << pixel_shift) + (my >> 2) * h->mb_linesize;
+ uint8_t *src_y = pic->f.data[0] + offset;
+ uint8_t *src_cb, *src_cr;
+ int extra_width = 0;
+ int extra_height = 0;
+ int emu = 0;
+ const int full_mx = mx >> 2;
+ const int full_my = my >> 2;
+ const int pic_width = 16 * h->mb_width;
+ const int pic_height = 16 * h->mb_height >> MB_FIELD(h);
+ int ysh;
+
+ if (mx & 7)
+ extra_width -= 3;
+ if (my & 7)
+ extra_height -= 3;
+
+ if (full_mx < 0 - extra_width ||
+ full_my < 0 - extra_height ||
+ full_mx + 16 /*FIXME*/ > pic_width + extra_width ||
+ full_my + 16 /*FIXME*/ > pic_height + extra_height) {
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
+ src_y - (2 << pixel_shift) - 2 * h->mb_linesize,
+ h->mb_linesize, h->mb_linesize,
+ 16 + 5, 16 + 5 /*FIXME*/, full_mx - 2,
+ full_my - 2, pic_width, pic_height);
+ src_y = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
+ emu = 1;
+ }
+
+ qpix_op[luma_xy](dest_y, src_y, h->mb_linesize); // FIXME try variable height perhaps?
+ if (!square)
+ qpix_op[luma_xy](dest_y + delta, src_y + delta, h->mb_linesize);
+
+ if (CONFIG_GRAY && h->flags & CODEC_FLAG_GRAY)
+ return;
+
+ if (chroma_idc == 3 /* yuv444 */) {
+ src_cb = pic->f.data[1] + offset;
+ if (emu) {
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
+ src_cb - (2 << pixel_shift) - 2 * h->mb_linesize,
+ h->mb_linesize, h->mb_linesize,
+ 16 + 5, 16 + 5 /*FIXME*/,
+ full_mx - 2, full_my - 2,
+ pic_width, pic_height);
+ src_cb = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
+ }
+ qpix_op[luma_xy](dest_cb, src_cb, h->mb_linesize); // FIXME try variable height perhaps?
+ if (!square)
+ qpix_op[luma_xy](dest_cb + delta, src_cb + delta, h->mb_linesize);
+
+ src_cr = pic->f.data[2] + offset;
+ if (emu) {
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
+ src_cr - (2 << pixel_shift) - 2 * h->mb_linesize,
+ h->mb_linesize, h->mb_linesize,
+ 16 + 5, 16 + 5 /*FIXME*/,
+ full_mx - 2, full_my - 2,
+ pic_width, pic_height);
+ src_cr = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
+ }
+ qpix_op[luma_xy](dest_cr, src_cr, h->mb_linesize); // FIXME try variable height perhaps?
+ if (!square)
+ qpix_op[luma_xy](dest_cr + delta, src_cr + delta, h->mb_linesize);
+ return;
+ }
+
+ ysh = 3 - (chroma_idc == 2 /* yuv422 */);
+ if (chroma_idc == 1 /* yuv420 */ && MB_FIELD(h)) {
+ // chroma offset when predicting from a field of opposite parity
+ my += 2 * ((h->mb_y & 1) - (pic->reference - 1));
+ emu |= (my >> 3) < 0 || (my >> 3) + 8 >= (pic_height >> 1);
+ }
+
+ src_cb = pic->f.data[1] + ((mx >> 3) << pixel_shift) +
+ (my >> ysh) * h->mb_uvlinesize;
+ src_cr = pic->f.data[2] + ((mx >> 3) << pixel_shift) +
+ (my >> ysh) * h->mb_uvlinesize;
+
+ if (emu) {
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cb,
+ h->mb_uvlinesize, h->mb_uvlinesize,
+ 9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
+ pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
+ src_cb = h->edge_emu_buffer;
+ }
+ chroma_op(dest_cb, src_cb, h->mb_uvlinesize,
+ height >> (chroma_idc == 1 /* yuv420 */),
+ mx & 7, (my << (chroma_idc == 2 /* yuv422 */)) & 7);
+
+ if (emu) {
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cr,
+ h->mb_uvlinesize, h->mb_uvlinesize,
+ 9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
+ pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
+ src_cr = h->edge_emu_buffer;
+ }
+ chroma_op(dest_cr, src_cr, h->mb_uvlinesize, height >> (chroma_idc == 1 /* yuv420 */),
+ mx & 7, (my << (chroma_idc == 2 /* yuv422 */)) & 7);
+}
+
+static av_always_inline void mc_part_std(H264Context *h, int n, int square,
+ int height, int delta,
+ uint8_t *dest_y, uint8_t *dest_cb,
+ uint8_t *dest_cr,
+ int x_offset, int y_offset,
+ qpel_mc_func *qpix_put,
+ h264_chroma_mc_func chroma_put,
+ qpel_mc_func *qpix_avg,
+ h264_chroma_mc_func chroma_avg,
+ int list0, int list1,
+ int pixel_shift, int chroma_idc)
+{
+ qpel_mc_func *qpix_op = qpix_put;
+ h264_chroma_mc_func chroma_op = chroma_put;
+
+ dest_y += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
+ if (chroma_idc == 3 /* yuv444 */) {
+ dest_cb += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
+ dest_cr += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
+ } else if (chroma_idc == 2 /* yuv422 */) {
+ dest_cb += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
+ dest_cr += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
+ } else { /* yuv420 */
+ dest_cb += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
+ dest_cr += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
+ }
+ x_offset += 8 * h->mb_x;
+ y_offset += 8 * (h->mb_y >> MB_FIELD(h));
+
+ if (list0) {
+ H264Picture *ref = &h->ref_list[0][h->ref_cache[0][scan8[n]]];
+ mc_dir_part(h, ref, n, square, height, delta, 0,
+ dest_y, dest_cb, dest_cr, x_offset, y_offset,
+ qpix_op, chroma_op, pixel_shift, chroma_idc);
+
+ qpix_op = qpix_avg;
+ chroma_op = chroma_avg;
+ }
+
+ if (list1) {
+ H264Picture *ref = &h->ref_list[1][h->ref_cache[1][scan8[n]]];
+ mc_dir_part(h, ref, n, square, height, delta, 1,
+ dest_y, dest_cb, dest_cr, x_offset, y_offset,
+ qpix_op, chroma_op, pixel_shift, chroma_idc);
+ }
+}
+
+static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
+ int height, int delta,
+ uint8_t *dest_y, uint8_t *dest_cb,
+ uint8_t *dest_cr,
+ int x_offset, int y_offset,
+ qpel_mc_func *qpix_put,
+ h264_chroma_mc_func chroma_put,
+ h264_weight_func luma_weight_op,
+ h264_weight_func chroma_weight_op,
+ h264_biweight_func luma_weight_avg,
+ h264_biweight_func chroma_weight_avg,
+ int list0, int list1,
+ int pixel_shift, int chroma_idc)
+{
+ int chroma_height;
+
+ dest_y += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
+ if (chroma_idc == 3 /* yuv444 */) {
+ chroma_height = height;
+ chroma_weight_avg = luma_weight_avg;
+ chroma_weight_op = luma_weight_op;
+ dest_cb += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
+ dest_cr += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
+ } else if (chroma_idc == 2 /* yuv422 */) {
+ chroma_height = height;
+ dest_cb += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
+ dest_cr += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
+ } else { /* yuv420 */
+ chroma_height = height >> 1;
+ dest_cb += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
+ dest_cr += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
+ }
+ x_offset += 8 * h->mb_x;
+ y_offset += 8 * (h->mb_y >> MB_FIELD(h));
+
+ if (list0 && list1) {
+ /* don't optimize for luma-only case, since B-frames usually
+ * use implicit weights => chroma too. */
+ uint8_t *tmp_cb = h->bipred_scratchpad;
+ uint8_t *tmp_cr = h->bipred_scratchpad + (16 << pixel_shift);
+ uint8_t *tmp_y = h->bipred_scratchpad + 16 * h->mb_uvlinesize;
+ int refn0 = h->ref_cache[0][scan8[n]];
+ int refn1 = h->ref_cache[1][scan8[n]];
+
+ mc_dir_part(h, &h->ref_list[0][refn0], n, square, height, delta, 0,
+ dest_y, dest_cb, dest_cr,
+ x_offset, y_offset, qpix_put, chroma_put,
+ pixel_shift, chroma_idc);
+ mc_dir_part(h, &h->ref_list[1][refn1], n, square, height, delta, 1,
+ tmp_y, tmp_cb, tmp_cr,
+ x_offset, y_offset, qpix_put, chroma_put,
+ pixel_shift, chroma_idc);
+
+ if (h->use_weight == 2) {
+ int weight0 = h->implicit_weight[refn0][refn1][h->mb_y & 1];
+ int weight1 = 64 - weight0;
+ luma_weight_avg(dest_y, tmp_y, h->mb_linesize,
+ height, 5, weight0, weight1, 0);
+ chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize,
+ chroma_height, 5, weight0, weight1, 0);
+ chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize,
+ chroma_height, 5, weight0, weight1, 0);
+ } else {
+ luma_weight_avg(dest_y, tmp_y, h->mb_linesize, height,
+ h->luma_log2_weight_denom,
+ h->luma_weight[refn0][0][0],
+ h->luma_weight[refn1][1][0],
+ h->luma_weight[refn0][0][1] +
+ h->luma_weight[refn1][1][1]);
+ chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, chroma_height,
+ h->chroma_log2_weight_denom,
+ h->chroma_weight[refn0][0][0][0],
+ h->chroma_weight[refn1][1][0][0],
+ h->chroma_weight[refn0][0][0][1] +
+ h->chroma_weight[refn1][1][0][1]);
+ chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, chroma_height,
+ h->chroma_log2_weight_denom,
+ h->chroma_weight[refn0][0][1][0],
+ h->chroma_weight[refn1][1][1][0],
+ h->chroma_weight[refn0][0][1][1] +
+ h->chroma_weight[refn1][1][1][1]);
+ }
+ } else {
+ int list = list1 ? 1 : 0;
+ int refn = h->ref_cache[list][scan8[n]];
+ H264Picture *ref = &h->ref_list[list][refn];
+ mc_dir_part(h, ref, n, square, height, delta, list,
+ dest_y, dest_cb, dest_cr, x_offset, y_offset,
+ qpix_put, chroma_put, pixel_shift, chroma_idc);
+
+ luma_weight_op(dest_y, h->mb_linesize, height,
+ h->luma_log2_weight_denom,
+ h->luma_weight[refn][list][0],
+ h->luma_weight[refn][list][1]);
+ if (h->use_weight_chroma) {
+ chroma_weight_op(dest_cb, h->mb_uvlinesize, chroma_height,
+ h->chroma_log2_weight_denom,
+ h->chroma_weight[refn][list][0][0],
+ h->chroma_weight[refn][list][0][1]);
+ chroma_weight_op(dest_cr, h->mb_uvlinesize, chroma_height,
+ h->chroma_log2_weight_denom,
+ h->chroma_weight[refn][list][1][0],
+ h->chroma_weight[refn][list][1][1]);
+ }
+ }
+}
+
+static av_always_inline void prefetch_motion(H264Context *h, int list,
+ int pixel_shift, int chroma_idc)
+{
+ /* fetch pixels for estimated mv 4 macroblocks ahead
+ * optimized for 64byte cache lines */
+ const int refn = h->ref_cache[list][scan8[0]];
+ if (refn >= 0) {
+ const int mx = (h->mv_cache[list][scan8[0]][0] >> 2) + 16 * h->mb_x + 8;
+ const int my = (h->mv_cache[list][scan8[0]][1] >> 2) + 16 * h->mb_y;
+ uint8_t **src = h->ref_list[list][refn].f.data;
+ int off = (mx << pixel_shift) +
+ (my + (h->mb_x & 3) * 4) * h->mb_linesize +
+ (64 << pixel_shift);
+ h->vdsp.prefetch(src[0] + off, h->linesize, 4);
+ if (chroma_idc == 3 /* yuv444 */) {
+ h->vdsp.prefetch(src[1] + off, h->linesize, 4);
+ h->vdsp.prefetch(src[2] + off, h->linesize, 4);
+ } else {
+ off= (((mx>>1)+64)<<pixel_shift) + ((my>>1) + (h->mb_x&7))*h->uvlinesize;
+ h->vdsp.prefetch(src[1] + off, src[2] - src[1], 2);
+ }
+ }
+}
+
+static av_always_inline void xchg_mb_border(H264Context *h, uint8_t *src_y,
+ uint8_t *src_cb, uint8_t *src_cr,
+ int linesize, int uvlinesize,
+ int xchg, int chroma444,
+ int simple, int pixel_shift)
+{
+ int deblock_topleft;
+ int deblock_top;
+ int top_idx = 1;
+ uint8_t *top_border_m1;
+ uint8_t *top_border;
+
+ if (!simple && FRAME_MBAFF(h)) {
+ if (h->mb_y & 1) {
+ if (!MB_MBAFF(h))
+ return;
+ } else {
+ top_idx = MB_MBAFF(h) ? 0 : 1;
+ }
+ }
+
+ if (h->deblocking_filter == 2) {
+ deblock_topleft = h->slice_table[h->mb_xy - 1 - h->mb_stride] == h->slice_num;
+ deblock_top = h->top_type;
+ } else {
+ deblock_topleft = (h->mb_x > 0);
+ deblock_top = (h->mb_y > !!MB_FIELD(h));
+ }
+
+ src_y -= linesize + 1 + pixel_shift;
+ src_cb -= uvlinesize + 1 + pixel_shift;
+ src_cr -= uvlinesize + 1 + pixel_shift;
+
+ top_border_m1 = h->top_borders[top_idx][h->mb_x - 1];
+ top_border = h->top_borders[top_idx][h->mb_x];
+
+#define XCHG(a, b, xchg) \
+ if (pixel_shift) { \
+ if (xchg) { \
+ AV_SWAP64(b + 0, a + 0); \
+ AV_SWAP64(b + 8, a + 8); \
+ } else { \
+ AV_COPY128(b, a); \
+ } \
+ } else if (xchg) \
+ AV_SWAP64(b, a); \
+ else \
+ AV_COPY64(b, a);
+
+ if (deblock_top) {
+ if (deblock_topleft) {
+ XCHG(top_border_m1 + (8 << pixel_shift),
+ src_y - (7 << pixel_shift), 1);
+ }
+ XCHG(top_border + (0 << pixel_shift), src_y + (1 << pixel_shift), xchg);
+ XCHG(top_border + (8 << pixel_shift), src_y + (9 << pixel_shift), 1);
+ if (h->mb_x + 1 < h->mb_width) {
+ XCHG(h->top_borders[top_idx][h->mb_x + 1],
+ src_y + (17 << pixel_shift), 1);
+ }
+ if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (chroma444) {
+ if (deblock_topleft) {
+ XCHG(top_border_m1 + (24 << pixel_shift), src_cb - (7 << pixel_shift), 1);
+ XCHG(top_border_m1 + (40 << pixel_shift), src_cr - (7 << pixel_shift), 1);
+ }
+ XCHG(top_border + (16 << pixel_shift), src_cb + (1 << pixel_shift), xchg);
+ XCHG(top_border + (24 << pixel_shift), src_cb + (9 << pixel_shift), 1);
+ XCHG(top_border + (32 << pixel_shift), src_cr + (1 << pixel_shift), xchg);
+ XCHG(top_border + (40 << pixel_shift), src_cr + (9 << pixel_shift), 1);
+ if (h->mb_x + 1 < h->mb_width) {
+ XCHG(h->top_borders[top_idx][h->mb_x + 1] + (16 << pixel_shift), src_cb + (17 << pixel_shift), 1);
+ XCHG(h->top_borders[top_idx][h->mb_x + 1] + (32 << pixel_shift), src_cr + (17 << pixel_shift), 1);
+ }
+ } else {
+ if (deblock_topleft) {
+ XCHG(top_border_m1 + (16 << pixel_shift), src_cb - (7 << pixel_shift), 1);
+ XCHG(top_border_m1 + (24 << pixel_shift), src_cr - (7 << pixel_shift), 1);
+ }
+ XCHG(top_border + (16 << pixel_shift), src_cb + 1 + pixel_shift, 1);
+ XCHG(top_border + (24 << pixel_shift), src_cr + 1 + pixel_shift, 1);
+ }
+ }
+ }
+}
+
+static av_always_inline int dctcoef_get(int16_t *mb, int high_bit_depth,
+ int index)
+{
+ if (high_bit_depth) {
+ return AV_RN32A(((int32_t *)mb) + index);
+ } else
+ return AV_RN16A(mb + index);
+}
+
+static av_always_inline void dctcoef_set(int16_t *mb, int high_bit_depth,
+ int index, int value)
+{
+ if (high_bit_depth) {
+ AV_WN32A(((int32_t *)mb) + index, value);
+ } else
+ AV_WN16A(mb + index, value);
+}
+
+static av_always_inline void hl_decode_mb_predict_luma(H264Context *h,
+ int mb_type, int is_h264,
+ int simple,
+ int transform_bypass,
+ int pixel_shift,
+ int *block_offset,
+ int linesize,
+ uint8_t *dest_y, int p)
+{
+ void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
+ void (*idct_dc_add)(uint8_t *dst, int16_t *block, int stride);
+ int i;
+ int qscale = p == 0 ? h->qscale : h->chroma_qp[p - 1];
+ block_offset += 16 * p;
+ if (IS_INTRA4x4(mb_type)) {
+ if (IS_8x8DCT(mb_type)) {
+ if (transform_bypass) {
+ idct_dc_add =
+ idct_add = h->h264dsp.h264_add_pixels8_clear;
+ } else {
+ idct_dc_add = h->h264dsp.h264_idct8_dc_add;
+ idct_add = h->h264dsp.h264_idct8_add;
+ }
+ for (i = 0; i < 16; i += 4) {
+ uint8_t *const ptr = dest_y + block_offset[i];
+ const int dir = h->intra4x4_pred_mode_cache[scan8[i]];
+ if (transform_bypass && h->sps.profile_idc == 244 && dir <= 1) {
+ if (h->x264_build != -1) {
+ h->hpc.pred8x8l_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
+ } else
+ h->hpc.pred8x8l_filter_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift),
+ (h-> topleft_samples_available << i) & 0x8000,
+ (h->topright_samples_available << i) & 0x4000, linesize);
+ } else {
+ const int nnz = h->non_zero_count_cache[scan8[i + p * 16]];
+ h->hpc.pred8x8l[dir](ptr, (h->topleft_samples_available << i) & 0x8000,
+ (h->topright_samples_available << i) & 0x4000, linesize);
+ if (nnz) {
+ if (nnz == 1 && dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
+ idct_dc_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
+ else
+ idct_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
+ }
+ }
+ }
+ } else {
+ if (transform_bypass) {
+ idct_dc_add =
+ idct_add = h->h264dsp.h264_add_pixels4_clear;
+ } else {
+ idct_dc_add = h->h264dsp.h264_idct_dc_add;
+ idct_add = h->h264dsp.h264_idct_add;
+ }
+ for (i = 0; i < 16; i++) {
+ uint8_t *const ptr = dest_y + block_offset[i];
+ const int dir = h->intra4x4_pred_mode_cache[scan8[i]];
+
+ if (transform_bypass && h->sps.profile_idc == 244 && dir <= 1) {
+ h->hpc.pred4x4_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
+ } else {
+ uint8_t *topright;
+ int nnz, tr;
+ uint64_t tr_high;
+ if (dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED) {
+ const int topright_avail = (h->topright_samples_available << i) & 0x8000;
+ av_assert2(h->mb_y || linesize <= block_offset[i]);
+ if (!topright_avail) {
+ if (pixel_shift) {
+ tr_high = ((uint16_t *)ptr)[3 - linesize / 2] * 0x0001000100010001ULL;
+ topright = (uint8_t *)&tr_high;
+ } else {
+ tr = ptr[3 - linesize] * 0x01010101u;
+ topright = (uint8_t *)&tr;
+ }
+ } else
+ topright = ptr + (4 << pixel_shift) - linesize;
+ } else
+ topright = NULL;
+
+ h->hpc.pred4x4[dir](ptr, topright, linesize);
+ nnz = h->non_zero_count_cache[scan8[i + p * 16]];
+ if (nnz) {
+ if (is_h264) {
+ if (nnz == 1 && dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
+ idct_dc_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
+ else
+ idct_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
+ } else if (CONFIG_SVQ3_DECODER)
+ ff_svq3_add_idct_c(ptr, h->mb + i * 16 + p * 256, linesize, qscale, 0);
+ }
+ }
+ }
+ }
+ } else {
+ h->hpc.pred16x16[h->intra16x16_pred_mode](dest_y, linesize);
+ if (is_h264) {
+ if (h->non_zero_count_cache[scan8[LUMA_DC_BLOCK_INDEX + p]]) {
+ if (!transform_bypass)
+ h->h264dsp.h264_luma_dc_dequant_idct(h->mb + (p * 256 << pixel_shift),
+ h->mb_luma_dc[p],
+ h->dequant4_coeff[p][qscale][0]);
+ else {
+ static const uint8_t dc_mapping[16] = {
+ 0 * 16, 1 * 16, 4 * 16, 5 * 16,
+ 2 * 16, 3 * 16, 6 * 16, 7 * 16,
+ 8 * 16, 9 * 16, 12 * 16, 13 * 16,
+ 10 * 16, 11 * 16, 14 * 16, 15 * 16
+ };
+ for (i = 0; i < 16; i++)
+ dctcoef_set(h->mb + (p * 256 << pixel_shift),
+ pixel_shift, dc_mapping[i],
+ dctcoef_get(h->mb_luma_dc[p],
+ pixel_shift, i));
+ }
+ }
+ } else if (CONFIG_SVQ3_DECODER)
+ ff_svq3_luma_dc_dequant_idct_c(h->mb + p * 256,
+ h->mb_luma_dc[p], qscale);
+ }
+}
+
+static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, int mb_type,
+ int is_h264, int simple,
+ int transform_bypass,
+ int pixel_shift,
+ int *block_offset,
+ int linesize,
+ uint8_t *dest_y, int p)
+{
+ void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
+ int i;
+ block_offset += 16 * p;
+ if (!IS_INTRA4x4(mb_type)) {
+ if (is_h264) {
+ if (IS_INTRA16x16(mb_type)) {
+ if (transform_bypass) {
+ if (h->sps.profile_idc == 244 &&
+ (h->intra16x16_pred_mode == VERT_PRED8x8 ||
+ h->intra16x16_pred_mode == HOR_PRED8x8)) {
+ h->hpc.pred16x16_add[h->intra16x16_pred_mode](dest_y, block_offset,
+ h->mb + (p * 256 << pixel_shift),
+ linesize);
+ } else {
+ for (i = 0; i < 16; i++)
+ if (h->non_zero_count_cache[scan8[i + p * 16]] ||
+ dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
+ h->h264dsp.h264_add_pixels4_clear(dest_y + block_offset[i],
+ h->mb + (i * 16 + p * 256 << pixel_shift),
+ linesize);
+ }
+ } else {
+ h->h264dsp.h264_idct_add16intra(dest_y, block_offset,
+ h->mb + (p * 256 << pixel_shift),
+ linesize,
+ h->non_zero_count_cache + p * 5 * 8);
+ }
+ } else if (h->cbp & 15) {
+ if (transform_bypass) {
+ const int di = IS_8x8DCT(mb_type) ? 4 : 1;
+ idct_add = IS_8x8DCT(mb_type) ? h->h264dsp.h264_add_pixels8_clear
+ : h->h264dsp.h264_add_pixels4_clear;
+ for (i = 0; i < 16; i += di)
+ if (h->non_zero_count_cache[scan8[i + p * 16]])
+ idct_add(dest_y + block_offset[i],
+ h->mb + (i * 16 + p * 256 << pixel_shift),
+ linesize);
+ } else {
+ if (IS_8x8DCT(mb_type))
+ h->h264dsp.h264_idct8_add4(dest_y, block_offset,
+ h->mb + (p * 256 << pixel_shift),
+ linesize,
+ h->non_zero_count_cache + p * 5 * 8);
+ else
+ h->h264dsp.h264_idct_add16(dest_y, block_offset,
+ h->mb + (p * 256 << pixel_shift),
+ linesize,
+ h->non_zero_count_cache + p * 5 * 8);
+ }
+ }
+ } else if (CONFIG_SVQ3_DECODER) {
+ for (i = 0; i < 16; i++)
+ if (h->non_zero_count_cache[scan8[i + p * 16]] || h->mb[i * 16 + p * 256]) {
+ // FIXME benchmark weird rule, & below
+ uint8_t *const ptr = dest_y + block_offset[i];
+ ff_svq3_add_idct_c(ptr, h->mb + i * 16 + p * 256, linesize,
+ h->qscale, IS_INTRA(mb_type) ? 1 : 0);
+ }
+ }
+ }
+}
+
+#define BITS 8
+#define SIMPLE 1
+#include "h264_mb_template.c"
+
+#undef BITS
+#define BITS 16
+#include "h264_mb_template.c"
+
+#undef SIMPLE
+#define SIMPLE 0
+#include "h264_mb_template.c"
+
+void ff_h264_hl_decode_mb(H264Context *h)
+{
+ const int mb_xy = h->mb_xy;
+ const int mb_type = h->cur_pic.mb_type[mb_xy];
+ int is_complex = CONFIG_SMALL || h->is_complex ||
+ IS_INTRA_PCM(mb_type) || h->qscale == 0;
+
+ if (CHROMA444(h)) {
+ if (is_complex || h->pixel_shift)
+ hl_decode_mb_444_complex(h);
+ else
+ hl_decode_mb_444_simple_8(h);
+ } else if (is_complex) {
+ hl_decode_mb_complex(h);
+ } else if (h->pixel_shift) {
+ hl_decode_mb_simple_16(h);
+ } else
+ hl_decode_mb_simple_8(h);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_mb_template.c b/chromium/third_party/ffmpeg/libavcodec/h264_mb_template.c
index da3a9263de6..7c9d72b35a7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_mb_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_mb_template.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "svq3.h"
+
#undef FUNC
#undef PIXEL_SHIFT
@@ -172,14 +174,14 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h)
} else if (is_h264) {
if (chroma422) {
FUNC(hl_motion_422)(h, dest_y, dest_cb, dest_cr,
- h->me.qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
- h->me.qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
+ h->qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
+ h->qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
h->h264dsp.weight_h264_pixels_tab,
h->h264dsp.biweight_h264_pixels_tab);
} else {
FUNC(hl_motion_420)(h, dest_y, dest_cb, dest_cr,
- h->me.qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
- h->me.qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
+ h->qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
+ h->qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
h->h264dsp.weight_h264_pixels_tab,
h->h264dsp.biweight_h264_pixels_tab);
}
@@ -351,8 +353,8 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h)
linesize, 0, 1, SIMPLE, PIXEL_SHIFT);
} else {
FUNC(hl_motion_444)(h, dest[0], dest[1], dest[2],
- h->me.qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
- h->me.qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
+ h->qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
+ h->qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
h->h264dsp.weight_h264_pixels_tab,
h->h264dsp.biweight_h264_pixels_tab);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_mc_template.c b/chromium/third_party/ffmpeg/libavcodec/h264_mc_template.c
index 7aec43ba90c..0e4e47713dd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_mc_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_mc_template.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "h264.h"
+
#undef MCFUNC
#if CHROMA_IDC == 1
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c b/chromium/third_party/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c
index 8c0fbb3df2f..0f142bb2adb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c
@@ -175,7 +175,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
goto fail;
/* prepend only to the first type 5 NAL unit of an IDR picture */
- if (ctx->first_idr && unit_type == 5) {
+ if (ctx->first_idr && (unit_type == 5 || unit_type == 7 || unit_type == 8)) {
if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
avctx->extradata, avctx->extradata_size,
buf, nal_size)) < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_mvpred.h b/chromium/third_party/ffmpeg/libavcodec/h264_mvpred.h
index afe327c57ff..5f1e9a1ee50 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_mvpred.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_mvpred.h
@@ -31,6 +31,7 @@
#include "internal.h"
#include "avcodec.h"
#include "h264.h"
+#include "mpegutils.h"
#include "libavutil/avassert.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_parser.c b/chromium/third_party/ffmpeg/libavcodec/h264_parser.c
index e718a3bc9ae..52ab67b0f4a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_parser.c
@@ -30,6 +30,7 @@
#include "h264data.h"
#include "golomb.h"
#include "internal.h"
+#include "mpegutils.h"
static int h264_find_frame_end(H264Context *h, const uint8_t *buf,
@@ -74,13 +75,15 @@ static int h264_find_frame_end(H264Context *h, const uint8_t *buf,
else
state >>= 1; // 2->1, 1->0, 0->0
} else if (state <= 5) {
- int v = buf[i] & 0x1F;
- if (v == 6 || v == 7 || v == 8 || v == 9) {
+ int nalu_type = buf[i] & 0x1F;
+ if (nalu_type == NAL_SEI || nalu_type == NAL_SPS ||
+ nalu_type == NAL_PPS || nalu_type == NAL_AUD) {
if (pc->frame_start_found) {
i++;
goto found;
}
- } else if (v == 1 || v == 2 || v == 5) {
+ } else if (nalu_type == NAL_SLICE || nalu_type == NAL_DPA ||
+ nalu_type == NAL_IDR_SLICE) {
state += 8;
continue;
}
@@ -149,7 +152,8 @@ static int scan_mmco_reset(AVCodecParserContext *s)
break;
if (index >= h->ref_count[list]) {
- av_log(h->avctx, AV_LOG_ERROR, "reference count overflow\n");
+ av_log(h->avctx, AV_LOG_ERROR,
+ "reference count %d overflow\n", index);
return AVERROR_INVALIDDATA;
}
}
@@ -290,18 +294,18 @@ static inline int parse_nal_units(AVCodecParserContext *s,
pps_id = get_ue_golomb(&h->gb);
if (pps_id >= MAX_PPS_COUNT) {
av_log(h->avctx, AV_LOG_ERROR,
- "pps_id out of range\n");
+ "pps_id %u out of range\n", pps_id);
return -1;
}
if (!h->pps_buffers[pps_id]) {
av_log(h->avctx, AV_LOG_ERROR,
- "non-existing PPS referenced\n");
+ "non-existing PPS %u referenced\n", pps_id);
return -1;
}
h->pps = *h->pps_buffers[pps_id];
if (!h->sps_buffers[h->pps.sps_id]) {
av_log(h->avctx, AV_LOG_ERROR,
- "non-existing SPS referenced\n");
+ "non-existing SPS %u referenced\n", h->pps.sps_id);
return -1;
}
h->sps = *h->sps_buffers[h->pps.sps_id];
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_picture.c b/chromium/third_party/ffmpeg/libavcodec/h264_picture.c
new file mode 100644
index 00000000000..61ff862a7aa
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_picture.c
@@ -0,0 +1,211 @@
+/*
+ * H.26L/H.264/AVC/JVT/14496-10/... decoder
+ * Copyright (c) 2003 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
+ */
+
+/**
+ * @file
+ * H.264 / AVC / MPEG4 part10 codec.
+ * @author Michael Niedermayer <michaelni@gmx.at>
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/timer.h"
+#include "internal.h"
+#include "cabac.h"
+#include "cabac_functions.h"
+#include "dsputil.h"
+#include "error_resilience.h"
+#include "avcodec.h"
+#include "h264.h"
+#include "h264data.h"
+#include "h264chroma.h"
+#include "h264_mvpred.h"
+#include "golomb.h"
+#include "mathops.h"
+#include "mpegutils.h"
+#include "rectangle.h"
+#include "thread.h"
+#include "vdpau_internal.h"
+
+void ff_h264_unref_picture(H264Context *h, H264Picture *pic)
+{
+ int off = offsetof(H264Picture, tf) + sizeof(pic->tf);
+ int i;
+
+ if (!pic->f.buf[0])
+ return;
+
+ ff_thread_release_buffer(h->avctx, &pic->tf);
+ av_buffer_unref(&pic->hwaccel_priv_buf);
+
+ av_buffer_unref(&pic->qscale_table_buf);
+ av_buffer_unref(&pic->mb_type_buf);
+ for (i = 0; i < 2; i++) {
+ av_buffer_unref(&pic->motion_val_buf[i]);
+ av_buffer_unref(&pic->ref_index_buf[i]);
+ }
+
+ memset((uint8_t*)pic + off, 0, sizeof(*pic) - off);
+}
+
+int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src)
+{
+ int ret, i;
+
+ av_assert0(!dst->f.buf[0]);
+ av_assert0(src->f.buf[0]);
+
+ src->tf.f = &src->f;
+ dst->tf.f = &dst->f;
+ ret = ff_thread_ref_frame(&dst->tf, &src->tf);
+ if (ret < 0)
+ goto fail;
+
+ dst->qscale_table_buf = av_buffer_ref(src->qscale_table_buf);
+ dst->mb_type_buf = av_buffer_ref(src->mb_type_buf);
+ if (!dst->qscale_table_buf || !dst->mb_type_buf)
+ goto fail;
+ dst->qscale_table = src->qscale_table;
+ dst->mb_type = src->mb_type;
+
+ for (i = 0; i < 2; i++) {
+ dst->motion_val_buf[i] = av_buffer_ref(src->motion_val_buf[i]);
+ dst->ref_index_buf[i] = av_buffer_ref(src->ref_index_buf[i]);
+ if (!dst->motion_val_buf[i] || !dst->ref_index_buf[i])
+ goto fail;
+ dst->motion_val[i] = src->motion_val[i];
+ dst->ref_index[i] = src->ref_index[i];
+ }
+
+ if (src->hwaccel_picture_private) {
+ dst->hwaccel_priv_buf = av_buffer_ref(src->hwaccel_priv_buf);
+ if (!dst->hwaccel_priv_buf)
+ goto fail;
+ dst->hwaccel_picture_private = dst->hwaccel_priv_buf->data;
+ }
+
+ for (i = 0; i < 2; i++)
+ dst->field_poc[i] = src->field_poc[i];
+
+ memcpy(dst->ref_poc, src->ref_poc, sizeof(src->ref_poc));
+ memcpy(dst->ref_count, src->ref_count, sizeof(src->ref_count));
+
+ dst->poc = src->poc;
+ dst->frame_num = src->frame_num;
+ dst->mmco_reset = src->mmco_reset;
+ dst->pic_id = src->pic_id;
+ dst->long_ref = src->long_ref;
+ dst->mbaff = src->mbaff;
+ dst->field_picture = src->field_picture;
+ dst->needs_realloc = src->needs_realloc;
+ dst->reference = src->reference;
+ dst->crop = src->crop;
+ dst->crop_left = src->crop_left;
+ dst->crop_top = src->crop_top;
+ dst->recovered = src->recovered;
+ dst->invalid_gap = src->invalid_gap;
+ dst->sei_recovery_frame_cnt = src->sei_recovery_frame_cnt;
+
+ return 0;
+fail:
+ ff_h264_unref_picture(h, dst);
+ return ret;
+}
+
+#if CONFIG_ERROR_RESILIENCE
+void ff_h264_set_erpic(ERPicture *dst, H264Picture *src)
+{
+ int i;
+
+ memset(dst, 0, sizeof(*dst));
+
+ if (!src)
+ return;
+
+ dst->f = &src->f;
+ dst->tf = &src->tf;
+
+ for (i = 0; i < 2; i++) {
+ dst->motion_val[i] = src->motion_val[i];
+ dst->ref_index[i] = src->ref_index[i];
+ }
+
+ dst->mb_type = src->mb_type;
+ dst->field_picture = src->field_picture;
+}
+#endif /* CONFIG_ERROR_RESILIENCE */
+
+int ff_h264_field_end(H264Context *h, int in_setup)
+{
+ AVCodecContext *const avctx = h->avctx;
+ int err = 0;
+ h->mb_y = 0;
+
+ if (CONFIG_H264_VDPAU_DECODER &&
+ h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
+ ff_vdpau_h264_set_reference_frames(h);
+
+ if (in_setup || !(avctx->active_thread_type & FF_THREAD_FRAME)) {
+ if (!h->droppable) {
+ err = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
+ h->prev_poc_msb = h->poc_msb;
+ h->prev_poc_lsb = h->poc_lsb;
+ }
+ h->prev_frame_num_offset = h->frame_num_offset;
+ h->prev_frame_num = h->frame_num;
+ h->outputed_poc = h->next_outputed_poc;
+ }
+
+ if (avctx->hwaccel) {
+ if (avctx->hwaccel->end_frame(avctx) < 0)
+ av_log(avctx, AV_LOG_ERROR,
+ "hardware accelerator failed to decode picture\n");
+ }
+
+ if (CONFIG_H264_VDPAU_DECODER &&
+ h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
+ ff_vdpau_h264_picture_complete(h);
+
+ /*
+ * FIXME: Error handling code does not seem to support interlaced
+ * when slices span multiple rows
+ * The ff_er_add_slice calls don't work right for bottom
+ * fields; they cause massive erroneous error concealing
+ * Error marking covers both fields (top and bottom).
+ * This causes a mismatched s->error_count
+ * and a bad error table. Further, the error count goes to
+ * INT_MAX when called for bottom field, because mb_y is
+ * past end by one (callers fault) and resync_mb_y != 0
+ * causes problems for the first MB line, too.
+ */
+ if (CONFIG_ERROR_RESILIENCE && !FIELD_PICTURE(h) && h->current_slice && !h->sps.new) {
+ ff_h264_set_erpic(&h->er.cur_pic, h->cur_pic_ptr);
+ ff_er_frame_end(&h->er);
+ }
+ if (!in_setup && !h->droppable)
+ ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
+ h->picture_structure == PICT_BOTTOM_FIELD);
+ emms_c();
+
+ h->current_slice = 0;
+
+ return err;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_ps.c b/chromium/third_party/ffmpeg/libavcodec/h264_ps.c
index a06e3dd65b5..97073328920 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_ps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_ps.c
@@ -25,6 +25,8 @@
* @author Michael Niedermayer <michaelni@gmx.at>
*/
+#include <inttypes.h>
+
#include "libavutil/imgutils.h"
#include "internal.h"
#include "avcodec.h"
@@ -213,7 +215,7 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps)
sps->time_scale = get_bits_long(&h->gb, 32);
if (!sps->num_units_in_tick || !sps->time_scale) {
av_log(h->avctx, AV_LOG_ERROR,
- "time_scale/num_units_in_tick invalid or unsupported (%d/%d)\n",
+ "time_scale/num_units_in_tick invalid or unsupported (%"PRIu32"/%"PRIu32")\n",
sps->time_scale, sps->num_units_in_tick);
return AVERROR_INVALIDDATA;
}
@@ -252,7 +254,9 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps)
if (sps->num_reorder_frames > 16U
/* max_dec_frame_buffering || max_dec_frame_buffering > 16 */) {
av_log(h->avctx, AV_LOG_ERROR,
- "illegal num_reorder_frames %d\n", sps->num_reorder_frames);
+ "Clipping illegal num_reorder_frames %d\n",
+ sps->num_reorder_frames);
+ sps->num_reorder_frames = 16;
return AVERROR_INVALIDDATA;
}
}
@@ -333,18 +337,19 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
constraint_set_flags |= get_bits1(&h->gb) << 3; // constraint_set3_flag
constraint_set_flags |= get_bits1(&h->gb) << 4; // constraint_set4_flag
constraint_set_flags |= get_bits1(&h->gb) << 5; // constraint_set5_flag
- get_bits(&h->gb, 2); // reserved
+ skip_bits(&h->gb, 2); // reserved_zero_2bits
level_idc = get_bits(&h->gb, 8);
sps_id = get_ue_golomb_31(&h->gb);
if (sps_id >= MAX_SPS_COUNT) {
- av_log(h->avctx, AV_LOG_ERROR, "sps_id (%d) out of range\n", sps_id);
+ av_log(h->avctx, AV_LOG_ERROR, "sps_id %u out of range\n", sps_id);
return AVERROR_INVALIDDATA;
}
sps = av_mallocz(sizeof(SPS));
if (!sps)
return AVERROR(ENOMEM);
+ sps->sps_id = sps_id;
sps->time_offset_length = 24;
sps->profile_idc = profile_idc;
sps->constraint_set_flags = constraint_set_flags;
@@ -356,16 +361,21 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
sps->scaling_matrix_present = 0;
sps->colorspace = 2; //AVCOL_SPC_UNSPECIFIED
- if (sps->profile_idc == 100 || sps->profile_idc == 110 ||
- sps->profile_idc == 122 || sps->profile_idc == 244 ||
- sps->profile_idc == 44 || sps->profile_idc == 83 ||
- sps->profile_idc == 86 || sps->profile_idc == 118 ||
- sps->profile_idc == 128 || sps->profile_idc == 144) {
+ if (sps->profile_idc == 100 || // High profile
+ sps->profile_idc == 110 || // High10 profile
+ sps->profile_idc == 122 || // High422 profile
+ sps->profile_idc == 244 || // High444 Predictive profile
+ sps->profile_idc == 44 || // Cavlc444 profile
+ sps->profile_idc == 83 || // Scalable Constrained High profile (SVC)
+ sps->profile_idc == 86 || // Scalable High Intra profile (SVC)
+ sps->profile_idc == 118 || // Stereo High profile (MVC)
+ sps->profile_idc == 128 || // Multiview High profile (MVC)
+ sps->profile_idc == 138 || // Multiview Depth High profile (MVCD)
+ sps->profile_idc == 144) { // old High444 profile
sps->chroma_format_idc = get_ue_golomb_31(&h->gb);
if (sps->chroma_format_idc > 3U) {
- av_log(h->avctx, AV_LOG_ERROR,
- "chroma_format_idc %d is illegal\n",
- sps->chroma_format_idc);
+ avpriv_request_sample(h->avctx, "chroma_format_idc %u",
+ sps->chroma_format_idc);
goto fail;
} else if (sps->chroma_format_idc == 3) {
sps->residual_color_transform_flag = get_bits1(&h->gb);
@@ -376,7 +386,12 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
}
sps->bit_depth_luma = get_ue_golomb(&h->gb) + 8;
sps->bit_depth_chroma = get_ue_golomb(&h->gb) + 8;
- if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U || sps->bit_depth_luma != sps->bit_depth_chroma) {
+ if (sps->bit_depth_chroma != sps->bit_depth_luma) {
+ avpriv_request_sample(h->avctx,
+ "Different chroma and luma bit depth");
+ goto fail;
+ }
+ if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U) {
av_log(h->avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
sps->bit_depth_luma, sps->bit_depth_chroma);
goto fail;
@@ -418,7 +433,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
if ((unsigned)sps->poc_cycle_length >=
FF_ARRAY_ELEMS(sps->offset_for_ref_frame)) {
av_log(h->avctx, AV_LOG_ERROR,
- "poc_cycle_length overflow %u\n", sps->poc_cycle_length);
+ "poc_cycle_length overflow %d\n", sps->poc_cycle_length);
goto fail;
}
@@ -432,9 +447,10 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
sps->ref_frame_count = get_ue_golomb_31(&h->gb);
if (h->avctx->codec_tag == MKTAG('S', 'M', 'V', '2'))
sps->ref_frame_count = FFMAX(2, sps->ref_frame_count);
- if (sps->ref_frame_count > MAX_PICTURE_COUNT - 2 ||
+ if (sps->ref_frame_count > H264_MAX_PICTURE_COUNT - 2 ||
sps->ref_frame_count > 16U) {
- av_log(h->avctx, AV_LOG_ERROR, "too many reference frames\n");
+ av_log(h->avctx, AV_LOG_ERROR,
+ "too many reference frames %d\n", sps->ref_frame_count);
goto fail;
}
sps->gaps_in_frame_num_allowed_flag = get_bits1(&h->gb);
@@ -472,7 +488,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
if (h->avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
av_log(h->avctx, AV_LOG_DEBUG, "discarding sps cropping, original "
- "values are l:%u r:%u t:%u b:%u\n",
+ "values are l:%d r:%d t:%d b:%d\n",
crop_left, crop_right, crop_top, crop_bottom);
sps->crop_left =
@@ -532,7 +548,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
if (h->avctx->debug & FF_DEBUG_PICT_INFO) {
static const char csp[4][5] = { "Gray", "420", "422", "444" };
av_log(h->avctx, AV_LOG_DEBUG,
- "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%d/%d/%d/%d %s %s %d/%d b%d reo:%d\n",
+ "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%u/%u/%u/%u %s %s %"PRId32"/%"PRId32" b%d reo:%d\n",
sps_id, sps->profile_idc, sps->level_idc,
sps->poc_type,
sps->ref_frame_count,
@@ -546,7 +562,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
sps->timing_info_present_flag ? sps->num_units_in_tick : 0,
sps->timing_info_present_flag ? sps->time_scale : 0,
sps->bit_depth_luma,
- h->sps.bitstream_restriction_flag ? sps->num_reorder_frames : -1
+ sps->bitstream_restriction_flag ? sps->num_reorder_frames : -1
);
}
sps->new = 1;
@@ -594,7 +610,7 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
int bits_left;
if (pps_id >= MAX_PPS_COUNT) {
- av_log(h->avctx, AV_LOG_ERROR, "pps_id (%d) out of range\n", pps_id);
+ av_log(h->avctx, AV_LOG_ERROR, "pps_id %u out of range\n", pps_id);
return AVERROR_INVALIDDATA;
}
@@ -604,7 +620,7 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
pps->sps_id = get_ue_golomb_31(&h->gb);
if ((unsigned)pps->sps_id >= MAX_SPS_COUNT ||
h->sps_buffers[pps->sps_id] == NULL) {
- av_log(h->avctx, AV_LOG_ERROR, "sps_id out of range\n");
+ av_log(h->avctx, AV_LOG_ERROR, "sps_id %u out of range\n", pps->sps_id);
goto fail;
}
sps = h->sps_buffers[pps->sps_id];
@@ -701,7 +717,7 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
if (h->avctx->debug & FF_DEBUG_PICT_INFO) {
av_log(h->avctx, AV_LOG_DEBUG,
- "pps:%u sps:%u %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d/%d %s %s %s %s\n",
+ "pps:%u sps:%u %s slice_groups:%d ref:%u/%u %s qp:%d/%d/%d/%d %s %s %s %s\n",
pps_id, pps->sps_id,
pps->cabac ? "CABAC" : "CAVLC",
pps->slice_group_count,
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_refs.c b/chromium/third_party/ffmpeg/libavcodec/h264_refs.c
index 7eb1f9e2d49..9bb065d24d9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_refs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_refs.c
@@ -25,11 +25,14 @@
* @author Michael Niedermayer <michaelni@gmx.at>
*/
+#include <inttypes.h>
+
#include "libavutil/avassert.h"
#include "internal.h"
#include "avcodec.h"
#include "h264.h"
#include "golomb.h"
+#include "mpegutils.h"
#include <assert.h>
@@ -41,7 +44,7 @@ do {\
} while (0)
-static void pic_as_field(Picture *pic, const int parity){
+static void pic_as_field(H264Picture *pic, const int parity){
int i;
for (i = 0; i < 4; ++i) {
if (parity == PICT_BOTTOM_FIELD)
@@ -52,7 +55,7 @@ static void pic_as_field(Picture *pic, const int parity){
pic->poc= pic->field_poc[parity == PICT_BOTTOM_FIELD];
}
-static int split_field_copy(Picture *dest, Picture *src, int parity, int id_add)
+static int split_field_copy(H264Picture *dest, H264Picture *src, int parity, int id_add)
{
int match = !!(src->reference & parity);
@@ -68,8 +71,8 @@ static int split_field_copy(Picture *dest, Picture *src, int parity, int id_add)
return match;
}
-static int build_def_list(Picture *def, int def_len,
- Picture **in, int len, int is_long, int sel)
+static int build_def_list(H264Picture *def, int def_len,
+ H264Picture **in, int len, int is_long, int sel)
{
int i[2] = { 0 };
int index = 0;
@@ -94,7 +97,7 @@ static int build_def_list(Picture *def, int def_len,
return index;
}
-static int add_sorted(Picture **sorted, Picture **src, int len, int limit, int dir)
+static int add_sorted(H264Picture **sorted, H264Picture **src, int len, int limit, int dir)
{
int i, best_poc;
int out_i = 0;
@@ -121,7 +124,7 @@ int ff_h264_fill_default_ref_list(H264Context *h)
int i, len;
if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
- Picture *sorted[32];
+ H264Picture *sorted[32];
int cur_poc, list;
int lens[2];
@@ -143,7 +146,7 @@ int ff_h264_fill_default_ref_list(H264Context *h)
av_assert0(len <= 32);
if (len < h->ref_count[list])
- memset(&h->default_ref_list[list][len], 0, sizeof(Picture) * (h->ref_count[list] - len));
+ memset(&h->default_ref_list[list][len], 0, sizeof(H264Picture) * (h->ref_count[list] - len));
lens[list] = len;
}
@@ -152,7 +155,7 @@ int ff_h264_fill_default_ref_list(H264Context *h)
h->default_ref_list[0][i].f.buf[0]->buffer ==
h->default_ref_list[1][i].f.buf[0]->buffer; i++);
if (i == lens[0]) {
- Picture tmp;
+ H264Picture tmp;
COPY_PICTURE(&tmp, &h->default_ref_list[1][0]);
COPY_PICTURE(&h->default_ref_list[1][0], &h->default_ref_list[1][1]);
COPY_PICTURE(&h->default_ref_list[1][1], &tmp);
@@ -167,7 +170,7 @@ int ff_h264_fill_default_ref_list(H264Context *h)
av_assert0(len <= 32);
if (len < h->ref_count[0])
- memset(&h->default_ref_list[0][len], 0, sizeof(Picture) * (h->ref_count[0] - len));
+ memset(&h->default_ref_list[0][len], 0, sizeof(H264Picture) * (h->ref_count[0] - len));
}
#ifdef TRACE
for (i = 0; i < h->ref_count[0]; i++) {
@@ -225,16 +228,16 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h)
for (i = 0; i < h->ref_count[list]; i++)
COPY_PICTURE(&h->ref_list[list][i], &h->default_ref_list[list][i]);
- if (get_bits1(&h->gb)) {
+ if (get_bits1(&h->gb)) { // ref_pic_list_modification_flag_l[01]
int pred = h->curr_pic_num;
for (index = 0; ; index++) {
- unsigned int reordering_of_pic_nums_idc = get_ue_golomb_31(&h->gb);
+ unsigned int modification_of_pic_nums_idc = get_ue_golomb_31(&h->gb);
unsigned int pic_id;
int i;
- Picture *ref = NULL;
+ H264Picture *ref = NULL;
- if (reordering_of_pic_nums_idc == 3)
+ if (modification_of_pic_nums_idc == 3)
break;
if (index >= h->ref_count[list]) {
@@ -242,75 +245,84 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h)
return -1;
}
- if (reordering_of_pic_nums_idc < 3) {
- if (reordering_of_pic_nums_idc < 2) {
- const unsigned int abs_diff_pic_num = get_ue_golomb(&h->gb) + 1;
- int frame_num;
+ switch (modification_of_pic_nums_idc) {
+ case 0:
+ case 1: {
+ const unsigned int abs_diff_pic_num = get_ue_golomb(&h->gb) + 1;
+ int frame_num;
- if (abs_diff_pic_num > h->max_pic_num) {
- av_log(h->avctx, AV_LOG_ERROR, "abs_diff_pic_num overflow\n");
- return -1;
- }
+ if (abs_diff_pic_num > h->max_pic_num) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "abs_diff_pic_num overflow\n");
+ return AVERROR_INVALIDDATA;
+ }
- if (reordering_of_pic_nums_idc == 0)
- pred -= abs_diff_pic_num;
- else
- pred += abs_diff_pic_num;
- pred &= h->max_pic_num - 1;
-
- frame_num = pic_num_extract(h, pred, &pic_structure);
-
- for (i = h->short_ref_count - 1; i >= 0; i--) {
- ref = h->short_ref[i];
- assert(ref->reference);
- assert(!ref->long_ref);
- if (ref->frame_num == frame_num &&
- (ref->reference & pic_structure))
- break;
- }
- if (i >= 0)
- ref->pic_id = pred;
- } else {
- int long_idx;
- pic_id = get_ue_golomb(&h->gb); //long_term_pic_idx
+ if (modification_of_pic_nums_idc == 0)
+ pred -= abs_diff_pic_num;
+ else
+ pred += abs_diff_pic_num;
+ pred &= h->max_pic_num - 1;
+
+ frame_num = pic_num_extract(h, pred, &pic_structure);
+
+ for (i = h->short_ref_count - 1; i >= 0; i--) {
+ ref = h->short_ref[i];
+ assert(ref->reference);
+ assert(!ref->long_ref);
+ if (ref->frame_num == frame_num &&
+ (ref->reference & pic_structure))
+ break;
+ }
+ if (i >= 0)
+ ref->pic_id = pred;
+ break;
+ }
+ case 2: {
+ int long_idx;
+ pic_id = get_ue_golomb(&h->gb); // long_term_pic_idx
- long_idx = pic_num_extract(h, pic_id, &pic_structure);
+ long_idx = pic_num_extract(h, pic_id, &pic_structure);
- if (long_idx > 31) {
- av_log(h->avctx, AV_LOG_ERROR, "long_term_pic_idx overflow\n");
- return -1;
- }
- ref = h->long_ref[long_idx];
- assert(!(ref && !ref->reference));
- if (ref && (ref->reference & pic_structure)) {
- ref->pic_id = pic_id;
- assert(ref->long_ref);
- i = 0;
- } else {
- i = -1;
- }
+ if (long_idx > 31) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "long_term_pic_idx overflow\n");
+ return AVERROR_INVALIDDATA;
}
-
- if (i < 0) {
- av_log(h->avctx, AV_LOG_ERROR, "reference picture missing during reorder\n");
- memset(&h->ref_list[list][index], 0, sizeof(Picture)); //FIXME
+ ref = h->long_ref[long_idx];
+ assert(!(ref && !ref->reference));
+ if (ref && (ref->reference & pic_structure)) {
+ ref->pic_id = pic_id;
+ assert(ref->long_ref);
+ i = 0;
} else {
- for (i = index; i + 1 < h->ref_count[list]; i++) {
- if (ref->long_ref == h->ref_list[list][i].long_ref &&
- ref->pic_id == h->ref_list[list][i].pic_id)
- break;
- }
- for (; i > index; i--) {
- COPY_PICTURE(&h->ref_list[list][i], &h->ref_list[list][i - 1]);
- }
- COPY_PICTURE(&h->ref_list[list][index], ref);
- if (FIELD_PICTURE(h)) {
- pic_as_field(&h->ref_list[list][index], pic_structure);
- }
+ i = -1;
}
+ break;
+ }
+ default:
+ av_log(h->avctx, AV_LOG_ERROR,
+ "illegal modification_of_pic_nums_idc %u\n",
+ modification_of_pic_nums_idc);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (i < 0) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "reference picture missing during reorder\n");
+ memset(&h->ref_list[list][index], 0, sizeof(H264Picture)); // FIXME
} else {
- av_log(h->avctx, AV_LOG_ERROR, "illegal reordering_of_pic_nums_idc\n");
- return -1;
+ for (i = index; i + 1 < h->ref_count[list]; i++) {
+ if (ref->long_ref == h->ref_list[list][i].long_ref &&
+ ref->pic_id == h->ref_list[list][i].pic_id)
+ break;
+ }
+ for (; i > index; i--) {
+ COPY_PICTURE(&h->ref_list[list][i], &h->ref_list[list][i - 1]);
+ }
+ COPY_PICTURE(&h->ref_list[list][index], ref);
+ if (FIELD_PICTURE(h)) {
+ pic_as_field(&h->ref_list[list][index], pic_structure);
+ }
}
}
}
@@ -341,8 +353,8 @@ void ff_h264_fill_mbaff_ref_list(H264Context *h)
int list, i, j;
for (list = 0; list < h->list_count; list++) {
for (i = 0; i < h->ref_count[list]; i++) {
- Picture *frame = &h->ref_list[list][i];
- Picture *field = &h->ref_list[list][16 + 2 * i];
+ H264Picture *frame = &h->ref_list[list][i];
+ H264Picture *field = &h->ref_list[list][16 + 2 * i];
COPY_PICTURE(field, frame);
for (j = 0; j < 3; j++)
field[0].f.linesize[j] <<= 1;
@@ -375,7 +387,7 @@ void ff_h264_fill_mbaff_ref_list(H264Context *h)
* for display purposes) zero if one of the fields remains in
* reference
*/
-static inline int unreference_pic(H264Context *h, Picture *pic, int refmask)
+static inline int unreference_pic(H264Context *h, H264Picture *pic, int refmask)
{
int i;
if (pic->reference &= refmask) {
@@ -391,19 +403,19 @@ static inline int unreference_pic(H264Context *h, Picture *pic, int refmask)
}
/**
- * Find a Picture in the short term reference list by frame number.
+ * Find a H264Picture in the short term reference list by frame number.
* @param frame_num frame number to search for
* @param idx the index into h->short_ref where returned picture is found
* undefined if no picture found.
* @return pointer to the found picture, or NULL if no pic with the provided
* frame number is found
*/
-static Picture *find_short(H264Context *h, int frame_num, int *idx)
+static H264Picture *find_short(H264Context *h, int frame_num, int *idx)
{
int i;
for (i = 0; i < h->short_ref_count; i++) {
- Picture *pic = h->short_ref[i];
+ H264Picture *pic = h->short_ref[i];
if (h->avctx->debug & FF_DEBUG_MMCO)
av_log(h->avctx, AV_LOG_DEBUG, "%d %d %p\n", i, pic->frame_num, pic);
if (pic->frame_num == frame_num) {
@@ -426,16 +438,16 @@ static void remove_short_at_index(H264Context *h, int i)
h->short_ref[i] = NULL;
if (--h->short_ref_count)
memmove(&h->short_ref[i], &h->short_ref[i + 1],
- (h->short_ref_count - i) * sizeof(Picture*));
+ (h->short_ref_count - i) * sizeof(H264Picture*));
}
/**
*
* @return the removed picture or NULL if an error occurs
*/
-static Picture *remove_short(H264Context *h, int frame_num, int ref_mask)
+static H264Picture *remove_short(H264Context *h, int frame_num, int ref_mask)
{
- Picture *pic;
+ H264Picture *pic;
int i;
if (h->avctx->debug & FF_DEBUG_MMCO)
@@ -455,9 +467,9 @@ static Picture *remove_short(H264Context *h, int frame_num, int ref_mask)
* that list.
* @return the removed picture or NULL if an error occurs
*/
-static Picture *remove_long(H264Context *h, int i, int ref_mask)
+static H264Picture *remove_long(H264Context *h, int i, int ref_mask)
{
- Picture *pic;
+ H264Picture *pic;
pic = h->long_ref[i];
if (pic) {
@@ -500,8 +512,8 @@ static void print_short_term(H264Context *h)
if (h->avctx->debug & FF_DEBUG_MMCO) {
av_log(h->avctx, AV_LOG_DEBUG, "short term list:\n");
for (i = 0; i < h->short_ref_count; i++) {
- Picture *pic = h->short_ref[i];
- av_log(h->avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n",
+ H264Picture *pic = h->short_ref[i];
+ av_log(h->avctx, AV_LOG_DEBUG, "%"PRIu32" fn:%d poc:%d %p\n",
i, pic->frame_num, pic->poc, pic->f.data[0]);
}
}
@@ -516,9 +528,9 @@ static void print_long_term(H264Context *h)
if (h->avctx->debug & FF_DEBUG_MMCO) {
av_log(h->avctx, AV_LOG_DEBUG, "long term list:\n");
for (i = 0; i < 16; i++) {
- Picture *pic = h->long_ref[i];
+ H264Picture *pic = h->long_ref[i];
if (pic) {
- av_log(h->avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n",
+ av_log(h->avctx, AV_LOG_DEBUG, "%"PRIu32" fn:%d poc:%d %p\n",
i, pic->frame_num, pic->poc, pic->f.data[0]);
}
}
@@ -543,7 +555,7 @@ static int check_opcodes(MMCO *mmco1, MMCO *mmco2, int n_mmcos)
int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice)
{
MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;
- int mmco_index = 0, i;
+ int mmco_index = 0, i = 0;
if (h->short_ref_count &&
h->long_ref_count + h->short_ref_count >= h->sps.ref_frame_count &&
@@ -577,7 +589,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
int i, av_uninit(j);
int pps_count;
int current_ref_assigned = 0, err = 0;
- Picture *av_uninit(pic);
+ H264Picture *av_uninit(pic);
if ((h->avctx->debug & FF_DEBUG_MMCO) && mmco_count == 0)
av_log(h->avctx, AV_LOG_DEBUG, "no mmco here\n");
@@ -637,6 +649,10 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
* Report the problem and keep the pair where it is,
* and mark this field valid.
*/
+ if (h->short_ref[0] == h->cur_pic_ptr) {
+ av_log(h->avctx, AV_LOG_ERROR, "mmco: cannot assign current picture to short and long at the same time\n");
+ remove_short_at_index(h, 0);
+ }
if (h->long_ref[mmco[i].long_arg] != h->cur_pic_ptr) {
if (h->cur_pic_ptr->long_ref) {
@@ -649,9 +665,6 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
}
av_assert0(!h->cur_pic_ptr->long_ref);
remove_long(h, mmco[i].long_arg, 0);
- if (remove_short(h, h->cur_pic_ptr->frame_num, 0)) {
- av_log(h->avctx, AV_LOG_ERROR, "mmco: cannot assign current picture to short and long at the same time\n");
- }
h->long_ref[mmco[i].long_arg] = h->cur_pic_ptr;
h->long_ref[mmco[i].long_arg]->long_ref = 1;
@@ -710,7 +723,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
if (h->short_ref_count)
memmove(&h->short_ref[1], &h->short_ref[0],
- h->short_ref_count * sizeof(Picture*));
+ h->short_ref_count * sizeof(H264Picture*));
h->short_ref[0] = h->cur_pic_ptr;
h->short_ref_count++;
@@ -743,6 +756,15 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
}
}
+ for (i = 0; i<h->short_ref_count; i++) {
+ pic = h->short_ref[i];
+ if (pic->invalid_gap) {
+ int d = (h->cur_pic_ptr->frame_num - pic->frame_num) & ((1 << h->sps.log2_max_frame_num)-1);
+ if (d > h->sps.ref_frame_count)
+ remove_short(h, pic->frame_num, 0);
+ }
+ }
+
print_short_term(h);
print_long_term(h);
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_sei.c b/chromium/third_party/ffmpeg/libavcodec/h264_sei.c
index 7d5558acb37..4e2f981181f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_sei.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_sei.c
@@ -25,12 +25,10 @@
* @author Michael Niedermayer <michaelni@gmx.at>
*/
-#include "internal.h"
#include "avcodec.h"
-#include "h264.h"
#include "golomb.h"
-
-#include <assert.h>
+#include "h264.h"
+#include "internal.h"
static const uint8_t sei_num_clock_ts_table[9] = {
1, 1, 1, 2, 2, 3, 3, 2, 3
@@ -42,6 +40,7 @@ void ff_h264_reset_sei(H264Context *h)
h->sei_dpb_output_delay = 0;
h->sei_cpb_removal_delay = -1;
h->sei_buffering_period_present = 0;
+ h->sei_frame_packing_present = 0;
}
static int decode_picture_timing(H264Context *h)
@@ -223,31 +222,31 @@ static int decode_buffering_period(H264Context *h)
return 0;
}
-static int decode_frame_packing(H264Context *h, int size) {
- int bits = get_bits_left(&h->gb);
-
+static int decode_frame_packing_arrangement(H264Context *h)
+{
h->sei_fpa.frame_packing_arrangement_id = get_ue_golomb(&h->gb);
- h->sei_fpa.frame_packing_arrangement_cancel_flag = get_bits(&h->gb, 1);
- if (!h->sei_fpa.frame_packing_arrangement_cancel_flag) {
- h->sei_fpa.frame_packing_arrangement_type = get_bits(&h->gb, 7);
- h->sei_fpa.quincunx_sampling_flag = get_bits(&h->gb, 1);
- h->sei_fpa.content_interpretation_type = get_bits(&h->gb, 6);
- skip_bits(&h->gb, 1); /* spatial_flipping_flag */
- skip_bits(&h->gb, 1); /* frame0_flipped_flag */
- skip_bits(&h->gb, 1); /* field_views_flag */
- skip_bits(&h->gb, 1); /* current_frame_is_frame0_flag */
- skip_bits(&h->gb, 1); /* frame0_self_contained_flag */
- skip_bits(&h->gb, 1); /* frame1_self_contained_flag */
- if (!h->sei_fpa.quincunx_sampling_flag && h->sei_fpa.frame_packing_arrangement_type != 5) {
- skip_bits(&h->gb, 4); /* frame0_grid_position_x */
- skip_bits(&h->gb, 4); /* frame0_grid_position_y */
- skip_bits(&h->gb, 4); /* frame1_grid_position_x */
- skip_bits(&h->gb, 4); /* frame1_grid_position_y */
- }
- skip_bits(&h->gb, 8); /* frame_packing_arrangement_reserved_byte */
+ h->sei_fpa.frame_packing_arrangement_cancel_flag = get_bits1(&h->gb);
+ h->sei_frame_packing_present = !h->sei_fpa.frame_packing_arrangement_cancel_flag;
+
+ if (h->sei_frame_packing_present) {
+ h->sei_fpa.frame_packing_arrangement_type =
+ h->frame_packing_arrangement_type = get_bits(&h->gb, 7);
+ h->sei_fpa.quincunx_sampling_flag =
+ h->quincunx_subsampling = get_bits1(&h->gb);
+ h->sei_fpa.content_interpretation_type =
+ h->content_interpretation_type = get_bits(&h->gb, 6);
+
+ // the following skips: spatial_flipping_flag, frame0_flipped_flag,
+ // field_views_flag, current_frame_is_frame0_flag,
+ // frame0_self_contained_flag, frame1_self_contained_flag
+ skip_bits(&h->gb, 6);
+
+ if (!h->quincunx_subsampling && h->frame_packing_arrangement_type != 5)
+ skip_bits(&h->gb, 16); // frame[01]_grid_position_[xy]
+ skip_bits(&h->gb, 8); // frame_packing_arrangement_reserved_byte
h->sei_fpa.frame_packing_arrangement_repetition_period = get_ue_golomb(&h->gb) /* frame_packing_arrangement_repetition_period */;
}
- skip_bits(&h->gb, 1); /* frame_packing_arrangement_extension_flag */
+ skip_bits1(&h->gb); // frame_packing_arrangement_extension_flag
if (h->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(h->avctx, AV_LOG_DEBUG, "SEI FPA %d %d %d %d %d %d\n",
@@ -257,7 +256,7 @@ static int decode_frame_packing(H264Context *h, int size) {
h->sei_fpa.quincunx_sampling_flag,
h->sei_fpa.content_interpretation_type,
h->sei_fpa.frame_packing_arrangement_repetition_period);
- skip_bits_long(&h->gb, 8 * size - (bits - get_bits_left(&h->gb)));
+
return 0;
}
@@ -311,14 +310,15 @@ int ff_h264_decode_sei(H264Context *h)
if (ret < 0)
return ret;
break;
- case SEI_BUFFERING_PERIOD:
+ case SEI_TYPE_BUFFERING_PERIOD:
ret = decode_buffering_period(h);
if (ret < 0)
return ret;
break;
case SEI_TYPE_FRAME_PACKING:
- if (decode_frame_packing(h, size) < 0)
- return -1;
+ ret = decode_frame_packing_arrangement(h);
+ if (ret < 0)
+ return ret;
break;
default:
av_log(h->avctx, AV_LOG_DEBUG, "unknown SEI type %d\n", type);
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_slice.c b/chromium/third_party/ffmpeg/libavcodec/h264_slice.c
new file mode 100644
index 00000000000..a9500432d95
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_slice.c
@@ -0,0 +1,2565 @@
+/*
+ * H.26L/H.264/AVC/JVT/14496-10/... decoder
+ * Copyright (c) 2003 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
+ */
+
+/**
+ * @file
+ * H.264 / AVC / MPEG4 part10 codec.
+ * @author Michael Niedermayer <michaelni@gmx.at>
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/timer.h"
+#include "internal.h"
+#include "cabac.h"
+#include "cabac_functions.h"
+#include "dsputil.h"
+#include "error_resilience.h"
+#include "avcodec.h"
+#include "h264.h"
+#include "h264data.h"
+#include "h264chroma.h"
+#include "h264_mvpred.h"
+#include "golomb.h"
+#include "mathops.h"
+#include "mpegutils.h"
+#include "rectangle.h"
+#include "thread.h"
+
+
+static const uint8_t rem6[QP_MAX_NUM + 1] = {
+ 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2,
+ 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
+ 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2,
+ 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
+ 0, 1, 2, 3,
+};
+
+static const uint8_t div6[QP_MAX_NUM + 1] = {
+ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3,
+ 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6,
+ 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10,
+ 10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,13,13,13, 13, 13, 13,
+ 14,14,14,14,
+};
+
+static const uint8_t field_scan[16+1] = {
+ 0 + 0 * 4, 0 + 1 * 4, 1 + 0 * 4, 0 + 2 * 4,
+ 0 + 3 * 4, 1 + 1 * 4, 1 + 2 * 4, 1 + 3 * 4,
+ 2 + 0 * 4, 2 + 1 * 4, 2 + 2 * 4, 2 + 3 * 4,
+ 3 + 0 * 4, 3 + 1 * 4, 3 + 2 * 4, 3 + 3 * 4,
+};
+
+static const uint8_t field_scan8x8[64+1] = {
+ 0 + 0 * 8, 0 + 1 * 8, 0 + 2 * 8, 1 + 0 * 8,
+ 1 + 1 * 8, 0 + 3 * 8, 0 + 4 * 8, 1 + 2 * 8,
+ 2 + 0 * 8, 1 + 3 * 8, 0 + 5 * 8, 0 + 6 * 8,
+ 0 + 7 * 8, 1 + 4 * 8, 2 + 1 * 8, 3 + 0 * 8,
+ 2 + 2 * 8, 1 + 5 * 8, 1 + 6 * 8, 1 + 7 * 8,
+ 2 + 3 * 8, 3 + 1 * 8, 4 + 0 * 8, 3 + 2 * 8,
+ 2 + 4 * 8, 2 + 5 * 8, 2 + 6 * 8, 2 + 7 * 8,
+ 3 + 3 * 8, 4 + 1 * 8, 5 + 0 * 8, 4 + 2 * 8,
+ 3 + 4 * 8, 3 + 5 * 8, 3 + 6 * 8, 3 + 7 * 8,
+ 4 + 3 * 8, 5 + 1 * 8, 6 + 0 * 8, 5 + 2 * 8,
+ 4 + 4 * 8, 4 + 5 * 8, 4 + 6 * 8, 4 + 7 * 8,
+ 5 + 3 * 8, 6 + 1 * 8, 6 + 2 * 8, 5 + 4 * 8,
+ 5 + 5 * 8, 5 + 6 * 8, 5 + 7 * 8, 6 + 3 * 8,
+ 7 + 0 * 8, 7 + 1 * 8, 6 + 4 * 8, 6 + 5 * 8,
+ 6 + 6 * 8, 6 + 7 * 8, 7 + 2 * 8, 7 + 3 * 8,
+ 7 + 4 * 8, 7 + 5 * 8, 7 + 6 * 8, 7 + 7 * 8,
+};
+
+static const uint8_t field_scan8x8_cavlc[64+1] = {
+ 0 + 0 * 8, 1 + 1 * 8, 2 + 0 * 8, 0 + 7 * 8,
+ 2 + 2 * 8, 2 + 3 * 8, 2 + 4 * 8, 3 + 3 * 8,
+ 3 + 4 * 8, 4 + 3 * 8, 4 + 4 * 8, 5 + 3 * 8,
+ 5 + 5 * 8, 7 + 0 * 8, 6 + 6 * 8, 7 + 4 * 8,
+ 0 + 1 * 8, 0 + 3 * 8, 1 + 3 * 8, 1 + 4 * 8,
+ 1 + 5 * 8, 3 + 1 * 8, 2 + 5 * 8, 4 + 1 * 8,
+ 3 + 5 * 8, 5 + 1 * 8, 4 + 5 * 8, 6 + 1 * 8,
+ 5 + 6 * 8, 7 + 1 * 8, 6 + 7 * 8, 7 + 5 * 8,
+ 0 + 2 * 8, 0 + 4 * 8, 0 + 5 * 8, 2 + 1 * 8,
+ 1 + 6 * 8, 4 + 0 * 8, 2 + 6 * 8, 5 + 0 * 8,
+ 3 + 6 * 8, 6 + 0 * 8, 4 + 6 * 8, 6 + 2 * 8,
+ 5 + 7 * 8, 6 + 4 * 8, 7 + 2 * 8, 7 + 6 * 8,
+ 1 + 0 * 8, 1 + 2 * 8, 0 + 6 * 8, 3 + 0 * 8,
+ 1 + 7 * 8, 3 + 2 * 8, 2 + 7 * 8, 4 + 2 * 8,
+ 3 + 7 * 8, 5 + 2 * 8, 4 + 7 * 8, 5 + 4 * 8,
+ 6 + 3 * 8, 6 + 5 * 8, 7 + 3 * 8, 7 + 7 * 8,
+};
+
+// zigzag_scan8x8_cavlc[i] = zigzag_scan8x8[(i/4) + 16*(i%4)]
+static const uint8_t zigzag_scan8x8_cavlc[64+1] = {
+ 0 + 0 * 8, 1 + 1 * 8, 1 + 2 * 8, 2 + 2 * 8,
+ 4 + 1 * 8, 0 + 5 * 8, 3 + 3 * 8, 7 + 0 * 8,
+ 3 + 4 * 8, 1 + 7 * 8, 5 + 3 * 8, 6 + 3 * 8,
+ 2 + 7 * 8, 6 + 4 * 8, 5 + 6 * 8, 7 + 5 * 8,
+ 1 + 0 * 8, 2 + 0 * 8, 0 + 3 * 8, 3 + 1 * 8,
+ 3 + 2 * 8, 0 + 6 * 8, 4 + 2 * 8, 6 + 1 * 8,
+ 2 + 5 * 8, 2 + 6 * 8, 6 + 2 * 8, 5 + 4 * 8,
+ 3 + 7 * 8, 7 + 3 * 8, 4 + 7 * 8, 7 + 6 * 8,
+ 0 + 1 * 8, 3 + 0 * 8, 0 + 4 * 8, 4 + 0 * 8,
+ 2 + 3 * 8, 1 + 5 * 8, 5 + 1 * 8, 5 + 2 * 8,
+ 1 + 6 * 8, 3 + 5 * 8, 7 + 1 * 8, 4 + 5 * 8,
+ 4 + 6 * 8, 7 + 4 * 8, 5 + 7 * 8, 6 + 7 * 8,
+ 0 + 2 * 8, 2 + 1 * 8, 1 + 3 * 8, 5 + 0 * 8,
+ 1 + 4 * 8, 2 + 4 * 8, 6 + 0 * 8, 4 + 3 * 8,
+ 0 + 7 * 8, 4 + 4 * 8, 7 + 2 * 8, 3 + 6 * 8,
+ 5 + 5 * 8, 6 + 5 * 8, 6 + 6 * 8, 7 + 7 * 8,
+};
+
+static const uint8_t dequant4_coeff_init[6][3] = {
+ { 10, 13, 16 },
+ { 11, 14, 18 },
+ { 13, 16, 20 },
+ { 14, 18, 23 },
+ { 16, 20, 25 },
+ { 18, 23, 29 },
+};
+
+static const uint8_t dequant8_coeff_init_scan[16] = {
+ 0, 3, 4, 3, 3, 1, 5, 1, 4, 5, 2, 5, 3, 1, 5, 1
+};
+
+static const uint8_t dequant8_coeff_init[6][6] = {
+ { 20, 18, 32, 19, 25, 24 },
+ { 22, 19, 35, 21, 28, 26 },
+ { 26, 23, 42, 24, 33, 31 },
+ { 28, 25, 45, 26, 35, 33 },
+ { 32, 28, 51, 30, 40, 38 },
+ { 36, 32, 58, 34, 46, 43 },
+};
+
+static const enum AVPixelFormat h264_hwaccel_pixfmt_list_420[] = {
+#if CONFIG_H264_DXVA2_HWACCEL
+ AV_PIX_FMT_DXVA2_VLD,
+#endif
+#if CONFIG_H264_VAAPI_HWACCEL
+ AV_PIX_FMT_VAAPI_VLD,
+#endif
+#if CONFIG_H264_VDA_HWACCEL
+ AV_PIX_FMT_VDA_VLD,
+ AV_PIX_FMT_VDA,
+#endif
+#if CONFIG_H264_VDPAU_HWACCEL
+ AV_PIX_FMT_VDPAU,
+#endif
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat h264_hwaccel_pixfmt_list_jpeg_420[] = {
+#if CONFIG_H264_DXVA2_HWACCEL
+ AV_PIX_FMT_DXVA2_VLD,
+#endif
+#if CONFIG_H264_VAAPI_HWACCEL
+ AV_PIX_FMT_VAAPI_VLD,
+#endif
+#if CONFIG_H264_VDA_HWACCEL
+ AV_PIX_FMT_VDA_VLD,
+ AV_PIX_FMT_VDA,
+#endif
+#if CONFIG_H264_VDPAU_HWACCEL
+ AV_PIX_FMT_VDPAU,
+#endif
+ AV_PIX_FMT_YUVJ420P,
+ AV_PIX_FMT_NONE
+};
+
+
+static void release_unused_pictures(H264Context *h, int remove_current)
+{
+ int i;
+
+ /* release non reference frames */
+ for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) {
+ if (h->DPB[i].f.buf[0] && !h->DPB[i].reference &&
+ (remove_current || &h->DPB[i] != h->cur_pic_ptr)) {
+ ff_h264_unref_picture(h, &h->DPB[i]);
+ }
+ }
+}
+
+static int alloc_scratch_buffers(H264Context *h, int linesize)
+{
+ int alloc_size = FFALIGN(FFABS(linesize) + 32, 32);
+
+ if (h->bipred_scratchpad)
+ return 0;
+
+ h->bipred_scratchpad = av_malloc(16 * 6 * alloc_size);
+ // edge emu needs blocksize + filter length - 1
+ // (= 21x21 for h264)
+ h->edge_emu_buffer = av_mallocz(alloc_size * 2 * 21);
+
+ if (!h->bipred_scratchpad || !h->edge_emu_buffer) {
+ av_freep(&h->bipred_scratchpad);
+ av_freep(&h->edge_emu_buffer);
+ return AVERROR(ENOMEM);
+ }
+
+ return 0;
+}
+
+static int init_table_pools(H264Context *h)
+{
+ const int big_mb_num = h->mb_stride * (h->mb_height + 1) + 1;
+ const int mb_array_size = h->mb_stride * h->mb_height;
+ const int b4_stride = h->mb_width * 4 + 1;
+ const int b4_array_size = b4_stride * h->mb_height * 4;
+
+ h->qscale_table_pool = av_buffer_pool_init(big_mb_num + h->mb_stride,
+ av_buffer_allocz);
+ h->mb_type_pool = av_buffer_pool_init((big_mb_num + h->mb_stride) *
+ sizeof(uint32_t), av_buffer_allocz);
+ h->motion_val_pool = av_buffer_pool_init(2 * (b4_array_size + 4) *
+ sizeof(int16_t), av_buffer_allocz);
+ h->ref_index_pool = av_buffer_pool_init(4 * mb_array_size, av_buffer_allocz);
+
+ if (!h->qscale_table_pool || !h->mb_type_pool || !h->motion_val_pool ||
+ !h->ref_index_pool) {
+ av_buffer_pool_uninit(&h->qscale_table_pool);
+ av_buffer_pool_uninit(&h->mb_type_pool);
+ av_buffer_pool_uninit(&h->motion_val_pool);
+ av_buffer_pool_uninit(&h->ref_index_pool);
+ return AVERROR(ENOMEM);
+ }
+
+ return 0;
+}
+
+static int alloc_picture(H264Context *h, H264Picture *pic)
+{
+ int i, ret = 0;
+
+ av_assert0(!pic->f.data[0]);
+
+ pic->tf.f = &pic->f;
+ ret = ff_thread_get_buffer(h->avctx, &pic->tf, pic->reference ?
+ AV_GET_BUFFER_FLAG_REF : 0);
+ if (ret < 0)
+ goto fail;
+
+ h->linesize = pic->f.linesize[0];
+ h->uvlinesize = pic->f.linesize[1];
+ pic->crop = h->sps.crop;
+ pic->crop_top = h->sps.crop_top;
+ pic->crop_left= h->sps.crop_left;
+
+ if (h->avctx->hwaccel) {
+ const AVHWAccel *hwaccel = h->avctx->hwaccel;
+ av_assert0(!pic->hwaccel_picture_private);
+ if (hwaccel->frame_priv_data_size) {
+ pic->hwaccel_priv_buf = av_buffer_allocz(hwaccel->frame_priv_data_size);
+ if (!pic->hwaccel_priv_buf)
+ return AVERROR(ENOMEM);
+ pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data;
+ }
+ }
+ if (!h->avctx->hwaccel && CONFIG_GRAY && h->flags & CODEC_FLAG_GRAY && pic->f.data[2]) {
+ int h_chroma_shift, v_chroma_shift;
+ av_pix_fmt_get_chroma_sub_sample(pic->f.format,
+ &h_chroma_shift, &v_chroma_shift);
+
+ for(i=0; i<FF_CEIL_RSHIFT(h->avctx->height, v_chroma_shift); i++) {
+ memset(pic->f.data[1] + pic->f.linesize[1]*i,
+ 0x80, FF_CEIL_RSHIFT(h->avctx->width, h_chroma_shift));
+ memset(pic->f.data[2] + pic->f.linesize[2]*i,
+ 0x80, FF_CEIL_RSHIFT(h->avctx->width, h_chroma_shift));
+ }
+ }
+
+ if (!h->qscale_table_pool) {
+ ret = init_table_pools(h);
+ if (ret < 0)
+ goto fail;
+ }
+
+ pic->qscale_table_buf = av_buffer_pool_get(h->qscale_table_pool);
+ pic->mb_type_buf = av_buffer_pool_get(h->mb_type_pool);
+ if (!pic->qscale_table_buf || !pic->mb_type_buf)
+ goto fail;
+
+ pic->mb_type = (uint32_t*)pic->mb_type_buf->data + 2 * h->mb_stride + 1;
+ pic->qscale_table = pic->qscale_table_buf->data + 2 * h->mb_stride + 1;
+
+ for (i = 0; i < 2; i++) {
+ pic->motion_val_buf[i] = av_buffer_pool_get(h->motion_val_pool);
+ pic->ref_index_buf[i] = av_buffer_pool_get(h->ref_index_pool);
+ if (!pic->motion_val_buf[i] || !pic->ref_index_buf[i])
+ goto fail;
+
+ pic->motion_val[i] = (int16_t (*)[2])pic->motion_val_buf[i]->data + 4;
+ pic->ref_index[i] = pic->ref_index_buf[i]->data;
+ }
+
+ return 0;
+fail:
+ ff_h264_unref_picture(h, pic);
+ return (ret < 0) ? ret : AVERROR(ENOMEM);
+}
+
+static inline int pic_is_unused(H264Context *h, H264Picture *pic)
+{
+ if (!pic->f.buf[0])
+ return 1;
+ if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF))
+ return 1;
+ return 0;
+}
+
+static int find_unused_picture(H264Context *h)
+{
+ int i;
+
+ for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) {
+ if (pic_is_unused(h, &h->DPB[i]))
+ break;
+ }
+ if (i == H264_MAX_PICTURE_COUNT)
+ return AVERROR_INVALIDDATA;
+
+ if (h->DPB[i].needs_realloc) {
+ h->DPB[i].needs_realloc = 0;
+ ff_h264_unref_picture(h, &h->DPB[i]);
+ }
+
+ return i;
+}
+
+
+static void init_dequant8_coeff_table(H264Context *h)
+{
+ int i, j, q, x;
+ const int max_qp = 51 + 6 * (h->sps.bit_depth_luma - 8);
+
+ for (i = 0; i < 6; i++) {
+ h->dequant8_coeff[i] = h->dequant8_buffer[i];
+ for (j = 0; j < i; j++)
+ if (!memcmp(h->pps.scaling_matrix8[j], h->pps.scaling_matrix8[i],
+ 64 * sizeof(uint8_t))) {
+ h->dequant8_coeff[i] = h->dequant8_buffer[j];
+ break;
+ }
+ if (j < i)
+ continue;
+
+ for (q = 0; q < max_qp + 1; q++) {
+ int shift = div6[q];
+ int idx = rem6[q];
+ for (x = 0; x < 64; x++)
+ h->dequant8_coeff[i][q][(x >> 3) | ((x & 7) << 3)] =
+ ((uint32_t)dequant8_coeff_init[idx][dequant8_coeff_init_scan[((x >> 1) & 12) | (x & 3)]] *
+ h->pps.scaling_matrix8[i][x]) << shift;
+ }
+ }
+}
+
+static void init_dequant4_coeff_table(H264Context *h)
+{
+ int i, j, q, x;
+ const int max_qp = 51 + 6 * (h->sps.bit_depth_luma - 8);
+ for (i = 0; i < 6; i++) {
+ h->dequant4_coeff[i] = h->dequant4_buffer[i];
+ for (j = 0; j < i; j++)
+ if (!memcmp(h->pps.scaling_matrix4[j], h->pps.scaling_matrix4[i],
+ 16 * sizeof(uint8_t))) {
+ h->dequant4_coeff[i] = h->dequant4_buffer[j];
+ break;
+ }
+ if (j < i)
+ continue;
+
+ for (q = 0; q < max_qp + 1; q++) {
+ int shift = div6[q] + 2;
+ int idx = rem6[q];
+ for (x = 0; x < 16; x++)
+ h->dequant4_coeff[i][q][(x >> 2) | ((x << 2) & 0xF)] =
+ ((uint32_t)dequant4_coeff_init[idx][(x & 1) + ((x >> 2) & 1)] *
+ h->pps.scaling_matrix4[i][x]) << shift;
+ }
+ }
+}
+
+void h264_init_dequant_tables(H264Context *h)
+{
+ int i, x;
+ init_dequant4_coeff_table(h);
+ memset(h->dequant8_coeff, 0, sizeof(h->dequant8_coeff));
+
+ if (h->pps.transform_8x8_mode)
+ init_dequant8_coeff_table(h);
+ if (h->sps.transform_bypass) {
+ for (i = 0; i < 6; i++)
+ for (x = 0; x < 16; x++)
+ h->dequant4_coeff[i][0][x] = 1 << 6;
+ if (h->pps.transform_8x8_mode)
+ for (i = 0; i < 6; i++)
+ for (x = 0; x < 64; x++)
+ h->dequant8_coeff[i][0][x] = 1 << 6;
+ }
+}
+
+/**
+ * Mimic alloc_tables(), but for every context thread.
+ */
+static void clone_tables(H264Context *dst, H264Context *src, int i)
+{
+ dst->intra4x4_pred_mode = src->intra4x4_pred_mode + i * 8 * 2 * src->mb_stride;
+ dst->non_zero_count = src->non_zero_count;
+ dst->slice_table = src->slice_table;
+ dst->cbp_table = src->cbp_table;
+ dst->mb2b_xy = src->mb2b_xy;
+ dst->mb2br_xy = src->mb2br_xy;
+ dst->chroma_pred_mode_table = src->chroma_pred_mode_table;
+ dst->mvd_table[0] = src->mvd_table[0] + i * 8 * 2 * src->mb_stride;
+ dst->mvd_table[1] = src->mvd_table[1] + i * 8 * 2 * src->mb_stride;
+ dst->direct_table = src->direct_table;
+ dst->list_counts = src->list_counts;
+ dst->DPB = src->DPB;
+ dst->cur_pic_ptr = src->cur_pic_ptr;
+ dst->cur_pic = src->cur_pic;
+ dst->bipred_scratchpad = NULL;
+ dst->edge_emu_buffer = NULL;
+ ff_h264_pred_init(&dst->hpc, src->avctx->codec_id, src->sps.bit_depth_luma,
+ src->sps.chroma_format_idc);
+}
+
+#define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b) + (size))))
+#undef REBASE_PICTURE
+#define REBASE_PICTURE(pic, new_ctx, old_ctx) \
+ ((pic && pic >= old_ctx->DPB && \
+ pic < old_ctx->DPB + H264_MAX_PICTURE_COUNT) ? \
+ &new_ctx->DPB[pic - old_ctx->DPB] : NULL)
+
+static void copy_picture_range(H264Picture **to, H264Picture **from, int count,
+ H264Context *new_base,
+ H264Context *old_base)
+{
+ int i;
+
+ for (i = 0; i < count; i++) {
+ assert((IN_RANGE(from[i], old_base, sizeof(*old_base)) ||
+ IN_RANGE(from[i], old_base->DPB,
+ sizeof(H264Picture) * H264_MAX_PICTURE_COUNT) ||
+ !from[i]));
+ to[i] = REBASE_PICTURE(from[i], new_base, old_base);
+ }
+}
+
+static int copy_parameter_set(void **to, void **from, int count, int size)
+{
+ int i;
+
+ for (i = 0; i < count; i++) {
+ if (to[i] && !from[i]) {
+ av_freep(&to[i]);
+ } else if (from[i] && !to[i]) {
+ to[i] = av_malloc(size);
+ if (!to[i])
+ return AVERROR(ENOMEM);
+ }
+
+ if (from[i])
+ memcpy(to[i], from[i], size);
+ }
+
+ return 0;
+}
+
+#define copy_fields(to, from, start_field, end_field) \
+ memcpy(&to->start_field, &from->start_field, \
+ (char *)&to->end_field - (char *)&to->start_field)
+
+static int h264_slice_header_init(H264Context *h, int reinit);
+
+int ff_h264_update_thread_context(AVCodecContext *dst,
+ const AVCodecContext *src)
+{
+ H264Context *h = dst->priv_data, *h1 = src->priv_data;
+ int inited = h->context_initialized, err = 0;
+ int context_reinitialized = 0;
+ int i, ret;
+
+ if (dst == src)
+ return 0;
+
+ if (inited &&
+ (h->width != h1->width ||
+ h->height != h1->height ||
+ h->mb_width != h1->mb_width ||
+ h->mb_height != h1->mb_height ||
+ h->sps.bit_depth_luma != h1->sps.bit_depth_luma ||
+ h->sps.chroma_format_idc != h1->sps.chroma_format_idc ||
+ h->sps.colorspace != h1->sps.colorspace)) {
+
+ /* set bits_per_raw_sample to the previous value. the check for changed
+ * bit depth in h264_set_parameter_from_sps() uses it and sets it to
+ * the current value */
+ h->avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
+
+ av_freep(&h->bipred_scratchpad);
+
+ h->width = h1->width;
+ h->height = h1->height;
+ h->mb_height = h1->mb_height;
+ h->mb_width = h1->mb_width;
+ h->mb_num = h1->mb_num;
+ h->mb_stride = h1->mb_stride;
+ h->b_stride = h1->b_stride;
+ // SPS/PPS
+ if ((ret = copy_parameter_set((void **)h->sps_buffers,
+ (void **)h1->sps_buffers,
+ MAX_SPS_COUNT, sizeof(SPS))) < 0)
+ return ret;
+ h->sps = h1->sps;
+ if ((ret = copy_parameter_set((void **)h->pps_buffers,
+ (void **)h1->pps_buffers,
+ MAX_PPS_COUNT, sizeof(PPS))) < 0)
+ return ret;
+ h->pps = h1->pps;
+
+ if ((err = h264_slice_header_init(h, 1)) < 0) {
+ av_log(h->avctx, AV_LOG_ERROR, "h264_slice_header_init() failed");
+ return err;
+ }
+ context_reinitialized = 1;
+
+#if 0
+ h264_set_parameter_from_sps(h);
+ //Note we set context_reinitialized which will cause h264_set_parameter_from_sps to be reexecuted
+ h->cur_chroma_format_idc = h1->cur_chroma_format_idc;
+#endif
+ }
+ /* update linesize on resize for h264. The h264 decoder doesn't
+ * necessarily call ff_MPV_frame_start in the new thread */
+ h->linesize = h1->linesize;
+ h->uvlinesize = h1->uvlinesize;
+
+ /* copy block_offset since frame_start may not be called */
+ memcpy(h->block_offset, h1->block_offset, sizeof(h->block_offset));
+
+ if (!inited) {
+ for (i = 0; i < MAX_SPS_COUNT; i++)
+ av_freep(h->sps_buffers + i);
+
+ for (i = 0; i < MAX_PPS_COUNT; i++)
+ av_freep(h->pps_buffers + i);
+
+ av_freep(&h->rbsp_buffer[0]);
+ av_freep(&h->rbsp_buffer[1]);
+ memcpy(h, h1, offsetof(H264Context, intra_pcm_ptr));
+ memcpy(&h->cabac, &h1->cabac,
+ sizeof(H264Context) - offsetof(H264Context, cabac));
+ av_assert0((void*)&h->cabac == &h->mb_padding + 1);
+
+ memset(h->sps_buffers, 0, sizeof(h->sps_buffers));
+ memset(h->pps_buffers, 0, sizeof(h->pps_buffers));
+
+ memset(&h->er, 0, sizeof(h->er));
+ memset(&h->mb, 0, sizeof(h->mb));
+ memset(&h->mb_luma_dc, 0, sizeof(h->mb_luma_dc));
+ memset(&h->mb_padding, 0, sizeof(h->mb_padding));
+ memset(&h->cur_pic, 0, sizeof(h->cur_pic));
+
+ h->avctx = dst;
+ h->DPB = NULL;
+ h->qscale_table_pool = NULL;
+ h->mb_type_pool = NULL;
+ h->ref_index_pool = NULL;
+ h->motion_val_pool = NULL;
+ for (i = 0; i < 2; i++) {
+ h->rbsp_buffer[i] = NULL;
+ h->rbsp_buffer_size[i] = 0;
+ }
+
+ if (h1->context_initialized) {
+ h->context_initialized = 0;
+
+ memset(&h->cur_pic, 0, sizeof(h->cur_pic));
+ av_frame_unref(&h->cur_pic.f);
+ h->cur_pic.tf.f = &h->cur_pic.f;
+
+ ret = ff_h264_alloc_tables(h);
+ if (ret < 0) {
+ av_log(dst, AV_LOG_ERROR, "Could not allocate memory\n");
+ return ret;
+ }
+ ret = ff_h264_context_init(h);
+ if (ret < 0) {
+ av_log(dst, AV_LOG_ERROR, "context_init() failed.\n");
+ return ret;
+ }
+ }
+
+ h->bipred_scratchpad = NULL;
+ h->edge_emu_buffer = NULL;
+
+ h->thread_context[0] = h;
+ h->context_initialized = h1->context_initialized;
+ }
+
+ h->avctx->coded_height = h1->avctx->coded_height;
+ h->avctx->coded_width = h1->avctx->coded_width;
+ h->avctx->width = h1->avctx->width;
+ h->avctx->height = h1->avctx->height;
+ h->coded_picture_number = h1->coded_picture_number;
+ h->first_field = h1->first_field;
+ h->picture_structure = h1->picture_structure;
+ h->qscale = h1->qscale;
+ h->droppable = h1->droppable;
+ h->low_delay = h1->low_delay;
+
+ for (i = 0; h->DPB && i < H264_MAX_PICTURE_COUNT; i++) {
+ ff_h264_unref_picture(h, &h->DPB[i]);
+ if (h1->DPB && h1->DPB[i].f.buf[0] &&
+ (ret = ff_h264_ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
+ return ret;
+ }
+
+ h->cur_pic_ptr = REBASE_PICTURE(h1->cur_pic_ptr, h, h1);
+ ff_h264_unref_picture(h, &h->cur_pic);
+ if (h1->cur_pic.f.buf[0] && (ret = ff_h264_ref_picture(h, &h->cur_pic, &h1->cur_pic)) < 0)
+ return ret;
+
+ h->workaround_bugs = h1->workaround_bugs;
+ h->low_delay = h1->low_delay;
+ h->droppable = h1->droppable;
+
+ // extradata/NAL handling
+ h->is_avc = h1->is_avc;
+
+ // SPS/PPS
+ if ((ret = copy_parameter_set((void **)h->sps_buffers,
+ (void **)h1->sps_buffers,
+ MAX_SPS_COUNT, sizeof(SPS))) < 0)
+ return ret;
+ h->sps = h1->sps;
+ if ((ret = copy_parameter_set((void **)h->pps_buffers,
+ (void **)h1->pps_buffers,
+ MAX_PPS_COUNT, sizeof(PPS))) < 0)
+ return ret;
+ h->pps = h1->pps;
+
+ // Dequantization matrices
+ // FIXME these are big - can they be only copied when PPS changes?
+ copy_fields(h, h1, dequant4_buffer, dequant4_coeff);
+
+ for (i = 0; i < 6; i++)
+ h->dequant4_coeff[i] = h->dequant4_buffer[0] +
+ (h1->dequant4_coeff[i] - h1->dequant4_buffer[0]);
+
+ for (i = 0; i < 6; i++)
+ h->dequant8_coeff[i] = h->dequant8_buffer[0] +
+ (h1->dequant8_coeff[i] - h1->dequant8_buffer[0]);
+
+ h->dequant_coeff_pps = h1->dequant_coeff_pps;
+
+ // POC timing
+ copy_fields(h, h1, poc_lsb, redundant_pic_count);
+
+ // reference lists
+ copy_fields(h, h1, short_ref, cabac_init_idc);
+
+ copy_picture_range(h->short_ref, h1->short_ref, 32, h, h1);
+ copy_picture_range(h->long_ref, h1->long_ref, 32, h, h1);
+ copy_picture_range(h->delayed_pic, h1->delayed_pic,
+ MAX_DELAYED_PIC_COUNT + 2, h, h1);
+
+ h->frame_recovered = h1->frame_recovered;
+
+ if (context_reinitialized)
+ ff_h264_set_parameter_from_sps(h);
+
+ if (!h->cur_pic_ptr)
+ return 0;
+
+ if (!h->droppable) {
+ err = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
+ h->prev_poc_msb = h->poc_msb;
+ h->prev_poc_lsb = h->poc_lsb;
+ }
+ h->prev_frame_num_offset = h->frame_num_offset;
+ h->prev_frame_num = h->frame_num;
+ h->outputed_poc = h->next_outputed_poc;
+
+ h->recovery_frame = h1->recovery_frame;
+
+ return err;
+}
+
+static int h264_frame_start(H264Context *h)
+{
+ H264Picture *pic;
+ int i, ret;
+ const int pixel_shift = h->pixel_shift;
+ int c[4] = {
+ 1<<(h->sps.bit_depth_luma-1),
+ 1<<(h->sps.bit_depth_chroma-1),
+ 1<<(h->sps.bit_depth_chroma-1),
+ -1
+ };
+
+ if (!ff_thread_can_start_frame(h->avctx)) {
+ av_log(h->avctx, AV_LOG_ERROR, "Attempt to start a frame outside SETUP state\n");
+ return -1;
+ }
+
+ release_unused_pictures(h, 1);
+ h->cur_pic_ptr = NULL;
+
+ i = find_unused_picture(h);
+ if (i < 0) {
+ av_log(h->avctx, AV_LOG_ERROR, "no frame buffer available\n");
+ return i;
+ }
+ pic = &h->DPB[i];
+
+ pic->reference = h->droppable ? 0 : h->picture_structure;
+ pic->f.coded_picture_number = h->coded_picture_number++;
+ pic->field_picture = h->picture_structure != PICT_FRAME;
+
+ /*
+ * Zero key_frame here; IDR markings per slice in frame or fields are ORed
+ * in later.
+ * See decode_nal_units().
+ */
+ pic->f.key_frame = 0;
+ pic->mmco_reset = 0;
+ pic->recovered = 0;
+ pic->invalid_gap = 0;
+ pic->sei_recovery_frame_cnt = h->sei_recovery_frame_cnt;
+
+ if ((ret = alloc_picture(h, pic)) < 0)
+ return ret;
+ if(!h->frame_recovered && !h->avctx->hwaccel &&
+ !(h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU))
+ avpriv_color_frame(&pic->f, c);
+
+ h->cur_pic_ptr = pic;
+ ff_h264_unref_picture(h, &h->cur_pic);
+ if (CONFIG_ERROR_RESILIENCE) {
+ ff_h264_set_erpic(&h->er.cur_pic, NULL);
+ }
+
+ if ((ret = ff_h264_ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0)
+ return ret;
+
+ if (CONFIG_ERROR_RESILIENCE) {
+ ff_er_frame_start(&h->er);
+ ff_h264_set_erpic(&h->er.last_pic, NULL);
+ ff_h264_set_erpic(&h->er.next_pic, NULL);
+ }
+
+ assert(h->linesize && h->uvlinesize);
+
+ for (i = 0; i < 16; i++) {
+ h->block_offset[i] = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 4 * h->linesize * ((scan8[i] - scan8[0]) >> 3);
+ h->block_offset[48 + i] = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 8 * h->linesize * ((scan8[i] - scan8[0]) >> 3);
+ }
+ for (i = 0; i < 16; i++) {
+ h->block_offset[16 + i] =
+ h->block_offset[32 + i] = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 4 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3);
+ h->block_offset[48 + 16 + i] =
+ h->block_offset[48 + 32 + i] = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 8 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3);
+ }
+
+ /* We mark the current picture as non-reference after allocating it, so
+ * that if we break out due to an error it can be released automatically
+ * in the next ff_MPV_frame_start().
+ */
+ h->cur_pic_ptr->reference = 0;
+
+ h->cur_pic_ptr->field_poc[0] = h->cur_pic_ptr->field_poc[1] = INT_MAX;
+
+ h->next_output_pic = NULL;
+
+ assert(h->cur_pic_ptr->long_ref == 0);
+
+ return 0;
+}
+
+static av_always_inline void backup_mb_border(H264Context *h, uint8_t *src_y,
+ uint8_t *src_cb, uint8_t *src_cr,
+ int linesize, int uvlinesize,
+ int simple)
+{
+ uint8_t *top_border;
+ int top_idx = 1;
+ const int pixel_shift = h->pixel_shift;
+ int chroma444 = CHROMA444(h);
+ int chroma422 = CHROMA422(h);
+
+ src_y -= linesize;
+ src_cb -= uvlinesize;
+ src_cr -= uvlinesize;
+
+ if (!simple && FRAME_MBAFF(h)) {
+ if (h->mb_y & 1) {
+ if (!MB_MBAFF(h)) {
+ top_border = h->top_borders[0][h->mb_x];
+ AV_COPY128(top_border, src_y + 15 * linesize);
+ if (pixel_shift)
+ AV_COPY128(top_border + 16, src_y + 15 * linesize + 16);
+ if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (chroma444) {
+ if (pixel_shift) {
+ AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
+ AV_COPY128(top_border + 48, src_cb + 15 * uvlinesize + 16);
+ AV_COPY128(top_border + 64, src_cr + 15 * uvlinesize);
+ AV_COPY128(top_border + 80, src_cr + 15 * uvlinesize + 16);
+ } else {
+ AV_COPY128(top_border + 16, src_cb + 15 * uvlinesize);
+ AV_COPY128(top_border + 32, src_cr + 15 * uvlinesize);
+ }
+ } else if (chroma422) {
+ if (pixel_shift) {
+ AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
+ AV_COPY128(top_border + 48, src_cr + 15 * uvlinesize);
+ } else {
+ AV_COPY64(top_border + 16, src_cb + 15 * uvlinesize);
+ AV_COPY64(top_border + 24, src_cr + 15 * uvlinesize);
+ }
+ } else {
+ if (pixel_shift) {
+ AV_COPY128(top_border + 32, src_cb + 7 * uvlinesize);
+ AV_COPY128(top_border + 48, src_cr + 7 * uvlinesize);
+ } else {
+ AV_COPY64(top_border + 16, src_cb + 7 * uvlinesize);
+ AV_COPY64(top_border + 24, src_cr + 7 * uvlinesize);
+ }
+ }
+ }
+ }
+ } else if (MB_MBAFF(h)) {
+ top_idx = 0;
+ } else
+ return;
+ }
+
+ top_border = h->top_borders[top_idx][h->mb_x];
+ /* There are two lines saved, the line above the top macroblock
+ * of a pair, and the line above the bottom macroblock. */
+ AV_COPY128(top_border, src_y + 16 * linesize);
+ if (pixel_shift)
+ AV_COPY128(top_border + 16, src_y + 16 * linesize + 16);
+
+ if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (chroma444) {
+ if (pixel_shift) {
+ AV_COPY128(top_border + 32, src_cb + 16 * linesize);
+ AV_COPY128(top_border + 48, src_cb + 16 * linesize + 16);
+ AV_COPY128(top_border + 64, src_cr + 16 * linesize);
+ AV_COPY128(top_border + 80, src_cr + 16 * linesize + 16);
+ } else {
+ AV_COPY128(top_border + 16, src_cb + 16 * linesize);
+ AV_COPY128(top_border + 32, src_cr + 16 * linesize);
+ }
+ } else if (chroma422) {
+ if (pixel_shift) {
+ AV_COPY128(top_border + 32, src_cb + 16 * uvlinesize);
+ AV_COPY128(top_border + 48, src_cr + 16 * uvlinesize);
+ } else {
+ AV_COPY64(top_border + 16, src_cb + 16 * uvlinesize);
+ AV_COPY64(top_border + 24, src_cr + 16 * uvlinesize);
+ }
+ } else {
+ if (pixel_shift) {
+ AV_COPY128(top_border + 32, src_cb + 8 * uvlinesize);
+ AV_COPY128(top_border + 48, src_cr + 8 * uvlinesize);
+ } else {
+ AV_COPY64(top_border + 16, src_cb + 8 * uvlinesize);
+ AV_COPY64(top_border + 24, src_cr + 8 * uvlinesize);
+ }
+ }
+ }
+}
+
+/**
+ * Initialize implicit_weight table.
+ * @param field 0/1 initialize the weight for interlaced MBAFF
+ * -1 initializes the rest
+ */
+static void implicit_weight_table(H264Context *h, int field)
+{
+ int ref0, ref1, i, cur_poc, ref_start, ref_count0, ref_count1;
+
+ for (i = 0; i < 2; i++) {
+ h->luma_weight_flag[i] = 0;
+ h->chroma_weight_flag[i] = 0;
+ }
+
+ if (field < 0) {
+ if (h->picture_structure == PICT_FRAME) {
+ cur_poc = h->cur_pic_ptr->poc;
+ } else {
+ cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure - 1];
+ }
+ if (h->ref_count[0] == 1 && h->ref_count[1] == 1 && !FRAME_MBAFF(h) &&
+ h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2 * cur_poc) {
+ h->use_weight = 0;
+ h->use_weight_chroma = 0;
+ return;
+ }
+ ref_start = 0;
+ ref_count0 = h->ref_count[0];
+ ref_count1 = h->ref_count[1];
+ } else {
+ cur_poc = h->cur_pic_ptr->field_poc[field];
+ ref_start = 16;
+ ref_count0 = 16 + 2 * h->ref_count[0];
+ ref_count1 = 16 + 2 * h->ref_count[1];
+ }
+
+ h->use_weight = 2;
+ h->use_weight_chroma = 2;
+ h->luma_log2_weight_denom = 5;
+ h->chroma_log2_weight_denom = 5;
+
+ for (ref0 = ref_start; ref0 < ref_count0; ref0++) {
+ int poc0 = h->ref_list[0][ref0].poc;
+ for (ref1 = ref_start; ref1 < ref_count1; ref1++) {
+ int w = 32;
+ if (!h->ref_list[0][ref0].long_ref && !h->ref_list[1][ref1].long_ref) {
+ int poc1 = h->ref_list[1][ref1].poc;
+ int td = av_clip(poc1 - poc0, -128, 127);
+ if (td) {
+ int tb = av_clip(cur_poc - poc0, -128, 127);
+ int tx = (16384 + (FFABS(td) >> 1)) / td;
+ int dist_scale_factor = (tb * tx + 32) >> 8;
+ if (dist_scale_factor >= -64 && dist_scale_factor <= 128)
+ w = 64 - dist_scale_factor;
+ }
+ }
+ if (field < 0) {
+ h->implicit_weight[ref0][ref1][0] =
+ h->implicit_weight[ref0][ref1][1] = w;
+ } else {
+ h->implicit_weight[ref0][ref1][field] = w;
+ }
+ }
+ }
+}
+
+/**
+ * initialize scan tables
+ */
+static void init_scan_tables(H264Context *h)
+{
+ int i;
+ for (i = 0; i < 16; i++) {
+#define TRANSPOSE(x) (x >> 2) | ((x << 2) & 0xF)
+ h->zigzag_scan[i] = TRANSPOSE(zigzag_scan[i]);
+ h->field_scan[i] = TRANSPOSE(field_scan[i]);
+#undef TRANSPOSE
+ }
+ for (i = 0; i < 64; i++) {
+#define TRANSPOSE(x) (x >> 3) | ((x & 7) << 3)
+ h->zigzag_scan8x8[i] = TRANSPOSE(ff_zigzag_direct[i]);
+ h->zigzag_scan8x8_cavlc[i] = TRANSPOSE(zigzag_scan8x8_cavlc[i]);
+ h->field_scan8x8[i] = TRANSPOSE(field_scan8x8[i]);
+ h->field_scan8x8_cavlc[i] = TRANSPOSE(field_scan8x8_cavlc[i]);
+#undef TRANSPOSE
+ }
+ if (h->sps.transform_bypass) { // FIXME same ugly
+ memcpy(h->zigzag_scan_q0 , zigzag_scan , sizeof(h->zigzag_scan_q0 ));
+ memcpy(h->zigzag_scan8x8_q0 , ff_zigzag_direct , sizeof(h->zigzag_scan8x8_q0 ));
+ memcpy(h->zigzag_scan8x8_cavlc_q0 , zigzag_scan8x8_cavlc , sizeof(h->zigzag_scan8x8_cavlc_q0));
+ memcpy(h->field_scan_q0 , field_scan , sizeof(h->field_scan_q0 ));
+ memcpy(h->field_scan8x8_q0 , field_scan8x8 , sizeof(h->field_scan8x8_q0 ));
+ memcpy(h->field_scan8x8_cavlc_q0 , field_scan8x8_cavlc , sizeof(h->field_scan8x8_cavlc_q0 ));
+ } else {
+ memcpy(h->zigzag_scan_q0 , h->zigzag_scan , sizeof(h->zigzag_scan_q0 ));
+ memcpy(h->zigzag_scan8x8_q0 , h->zigzag_scan8x8 , sizeof(h->zigzag_scan8x8_q0 ));
+ memcpy(h->zigzag_scan8x8_cavlc_q0 , h->zigzag_scan8x8_cavlc , sizeof(h->zigzag_scan8x8_cavlc_q0));
+ memcpy(h->field_scan_q0 , h->field_scan , sizeof(h->field_scan_q0 ));
+ memcpy(h->field_scan8x8_q0 , h->field_scan8x8 , sizeof(h->field_scan8x8_q0 ));
+ memcpy(h->field_scan8x8_cavlc_q0 , h->field_scan8x8_cavlc , sizeof(h->field_scan8x8_cavlc_q0 ));
+ }
+}
+
+/**
+ * Replicate H264 "master" context to thread contexts.
+ */
+static int clone_slice(H264Context *dst, H264Context *src)
+{
+ memcpy(dst->block_offset, src->block_offset, sizeof(dst->block_offset));
+ dst->cur_pic_ptr = src->cur_pic_ptr;
+ dst->cur_pic = src->cur_pic;
+ dst->linesize = src->linesize;
+ dst->uvlinesize = src->uvlinesize;
+ dst->first_field = src->first_field;
+
+ dst->prev_poc_msb = src->prev_poc_msb;
+ dst->prev_poc_lsb = src->prev_poc_lsb;
+ dst->prev_frame_num_offset = src->prev_frame_num_offset;
+ dst->prev_frame_num = src->prev_frame_num;
+ dst->short_ref_count = src->short_ref_count;
+
+ memcpy(dst->short_ref, src->short_ref, sizeof(dst->short_ref));
+ memcpy(dst->long_ref, src->long_ref, sizeof(dst->long_ref));
+ memcpy(dst->default_ref_list, src->default_ref_list, sizeof(dst->default_ref_list));
+
+ memcpy(dst->dequant4_coeff, src->dequant4_coeff, sizeof(src->dequant4_coeff));
+ memcpy(dst->dequant8_coeff, src->dequant8_coeff, sizeof(src->dequant8_coeff));
+
+ return 0;
+}
+
+static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
+{
+ switch (h->sps.bit_depth_luma) {
+ case 9:
+ if (CHROMA444(h)) {
+ if (h->avctx->colorspace == AVCOL_SPC_RGB) {
+ return AV_PIX_FMT_GBRP9;
+ } else
+ return AV_PIX_FMT_YUV444P9;
+ } else if (CHROMA422(h))
+ return AV_PIX_FMT_YUV422P9;
+ else
+ return AV_PIX_FMT_YUV420P9;
+ break;
+ case 10:
+ if (CHROMA444(h)) {
+ if (h->avctx->colorspace == AVCOL_SPC_RGB) {
+ return AV_PIX_FMT_GBRP10;
+ } else
+ return AV_PIX_FMT_YUV444P10;
+ } else if (CHROMA422(h))
+ return AV_PIX_FMT_YUV422P10;
+ else
+ return AV_PIX_FMT_YUV420P10;
+ break;
+ case 12:
+ if (CHROMA444(h)) {
+ if (h->avctx->colorspace == AVCOL_SPC_RGB) {
+ return AV_PIX_FMT_GBRP12;
+ } else
+ return AV_PIX_FMT_YUV444P12;
+ } else if (CHROMA422(h))
+ return AV_PIX_FMT_YUV422P12;
+ else
+ return AV_PIX_FMT_YUV420P12;
+ break;
+ case 14:
+ if (CHROMA444(h)) {
+ if (h->avctx->colorspace == AVCOL_SPC_RGB) {
+ return AV_PIX_FMT_GBRP14;
+ } else
+ return AV_PIX_FMT_YUV444P14;
+ } else if (CHROMA422(h))
+ return AV_PIX_FMT_YUV422P14;
+ else
+ return AV_PIX_FMT_YUV420P14;
+ break;
+ case 8:
+ if (CHROMA444(h)) {
+ if (h->avctx->colorspace == AVCOL_SPC_RGB) {
+ av_log(h->avctx, AV_LOG_DEBUG, "Detected GBR colorspace.\n");
+ return AV_PIX_FMT_GBR24P;
+ } else if (h->avctx->colorspace == AVCOL_SPC_YCGCO) {
+ av_log(h->avctx, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n");
+ }
+ return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ444P
+ : AV_PIX_FMT_YUV444P;
+ } else if (CHROMA422(h)) {
+ return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P
+ : AV_PIX_FMT_YUV422P;
+ } else {
+ int i;
+ const enum AVPixelFormat * fmt = h->avctx->codec->pix_fmts ?
+ h->avctx->codec->pix_fmts :
+ h->avctx->color_range == AVCOL_RANGE_JPEG ?
+ h264_hwaccel_pixfmt_list_jpeg_420 :
+ h264_hwaccel_pixfmt_list_420;
+
+ for (i=0; fmt[i] != AV_PIX_FMT_NONE; i++)
+ if (fmt[i] == h->avctx->pix_fmt && !force_callback)
+ return fmt[i];
+ return ff_thread_get_format(h->avctx, fmt);
+ }
+ break;
+ default:
+ av_log(h->avctx, AV_LOG_ERROR,
+ "Unsupported bit depth %d\n", h->sps.bit_depth_luma);
+ return AVERROR_INVALIDDATA;
+ }
+}
+
+/* export coded and cropped frame dimensions to AVCodecContext */
+static int init_dimensions(H264Context *h)
+{
+ int width = h->width - (h->sps.crop_right + h->sps.crop_left);
+ int height = h->height - (h->sps.crop_top + h->sps.crop_bottom);
+ av_assert0(h->sps.crop_right + h->sps.crop_left < (unsigned)h->width);
+ av_assert0(h->sps.crop_top + h->sps.crop_bottom < (unsigned)h->height);
+
+ /* handle container cropping */
+ if (!h->sps.crop &&
+ FFALIGN(h->avctx->width, 16) == h->width &&
+ FFALIGN(h->avctx->height, 16) == h->height) {
+ width = h->avctx->width;
+ height = h->avctx->height;
+ }
+
+ if (width <= 0 || height <= 0) {
+ av_log(h->avctx, AV_LOG_ERROR, "Invalid cropped dimensions: %dx%d.\n",
+ width, height);
+ if (h->avctx->err_recognition & AV_EF_EXPLODE)
+ return AVERROR_INVALIDDATA;
+
+ av_log(h->avctx, AV_LOG_WARNING, "Ignoring cropping information.\n");
+ h->sps.crop_bottom = h->sps.crop_top = h->sps.crop_right = h->sps.crop_left = 0;
+ h->sps.crop = 0;
+
+ width = h->width;
+ height = h->height;
+ }
+
+ h->avctx->coded_width = h->width;
+ h->avctx->coded_height = h->height;
+ h->avctx->width = width;
+ h->avctx->height = height;
+
+ return 0;
+}
+
+static int h264_slice_header_init(H264Context *h, int reinit)
+{
+ int nb_slices = (HAVE_THREADS &&
+ h->avctx->active_thread_type & FF_THREAD_SLICE) ?
+ h->avctx->thread_count : 1;
+ int i, ret;
+
+ h->avctx->sample_aspect_ratio = h->sps.sar;
+ av_assert0(h->avctx->sample_aspect_ratio.den);
+ av_pix_fmt_get_chroma_sub_sample(h->avctx->pix_fmt,
+ &h->chroma_x_shift, &h->chroma_y_shift);
+
+ if (h->sps.timing_info_present_flag) {
+ int64_t den = h->sps.time_scale;
+ if (h->x264_build < 44U)
+ den *= 2;
+ av_reduce(&h->avctx->time_base.num, &h->avctx->time_base.den,
+ h->sps.num_units_in_tick, den, 1 << 30);
+ }
+
+ if (reinit)
+ ff_h264_free_tables(h, 0);
+ h->first_field = 0;
+ h->prev_interlaced_frame = 1;
+
+ init_scan_tables(h);
+ ret = ff_h264_alloc_tables(h);
+ if (ret < 0) {
+ av_log(h->avctx, AV_LOG_ERROR, "Could not allocate memory\n");
+ return ret;
+ }
+
+ if (nb_slices > H264_MAX_THREADS || (nb_slices > h->mb_height && h->mb_height)) {
+ int max_slices;
+ if (h->mb_height)
+ max_slices = FFMIN(H264_MAX_THREADS, h->mb_height);
+ else
+ max_slices = H264_MAX_THREADS;
+ av_log(h->avctx, AV_LOG_WARNING, "too many threads/slices %d,"
+ " reducing to %d\n", nb_slices, max_slices);
+ nb_slices = max_slices;
+ }
+ h->slice_context_count = nb_slices;
+
+ if (!HAVE_THREADS || !(h->avctx->active_thread_type & FF_THREAD_SLICE)) {
+ ret = ff_h264_context_init(h);
+ if (ret < 0) {
+ av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n");
+ return ret;
+ }
+ } else {
+ for (i = 1; i < h->slice_context_count; i++) {
+ H264Context *c;
+ c = h->thread_context[i] = av_mallocz(sizeof(H264Context));
+ if (!c)
+ return AVERROR(ENOMEM);
+ c->avctx = h->avctx;
+ if (CONFIG_ERROR_RESILIENCE) {
+ c->dsp = h->dsp;
+ }
+ c->vdsp = h->vdsp;
+ c->h264dsp = h->h264dsp;
+ c->h264qpel = h->h264qpel;
+ c->h264chroma = h->h264chroma;
+ c->sps = h->sps;
+ c->pps = h->pps;
+ c->pixel_shift = h->pixel_shift;
+ c->cur_chroma_format_idc = h->cur_chroma_format_idc;
+ c->width = h->width;
+ c->height = h->height;
+ c->linesize = h->linesize;
+ c->uvlinesize = h->uvlinesize;
+ c->chroma_x_shift = h->chroma_x_shift;
+ c->chroma_y_shift = h->chroma_y_shift;
+ c->qscale = h->qscale;
+ c->droppable = h->droppable;
+ c->data_partitioning = h->data_partitioning;
+ c->low_delay = h->low_delay;
+ c->mb_width = h->mb_width;
+ c->mb_height = h->mb_height;
+ c->mb_stride = h->mb_stride;
+ c->mb_num = h->mb_num;
+ c->flags = h->flags;
+ c->workaround_bugs = h->workaround_bugs;
+ c->pict_type = h->pict_type;
+
+ init_scan_tables(c);
+ clone_tables(c, h, i);
+ c->context_initialized = 1;
+ }
+
+ for (i = 0; i < h->slice_context_count; i++)
+ if ((ret = ff_h264_context_init(h->thread_context[i])) < 0) {
+ av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n");
+ return ret;
+ }
+ }
+
+ h->context_initialized = 1;
+
+ return 0;
+}
+
+static enum AVPixelFormat non_j_pixfmt(enum AVPixelFormat a)
+{
+ switch (a) {
+ case AV_PIX_FMT_YUVJ420P: return AV_PIX_FMT_YUV420P;
+ case AV_PIX_FMT_YUVJ422P: return AV_PIX_FMT_YUV422P;
+ case AV_PIX_FMT_YUVJ444P: return AV_PIX_FMT_YUV444P;
+ default:
+ return a;
+ }
+}
+
+/**
+ * Decode a slice header.
+ * This will (re)intialize the decoder and call h264_frame_start() as needed.
+ *
+ * @param h h264context
+ * @param h0 h264 master context (differs from 'h' when doing sliced based
+ * parallel decoding)
+ *
+ * @return 0 if okay, <0 if an error occurred, 1 if decoding must not be multithreaded
+ */
+int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
+{
+ unsigned int first_mb_in_slice;
+ unsigned int pps_id;
+ int ret;
+ unsigned int slice_type, tmp, i, j;
+ int last_pic_structure, last_pic_droppable;
+ int must_reinit;
+ int needs_reinit = 0;
+ int field_pic_flag, bottom_field_flag;
+
+ h->qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
+ h->qpel_avg = h->h264qpel.avg_h264_qpel_pixels_tab;
+
+ first_mb_in_slice = get_ue_golomb_long(&h->gb);
+
+ if (first_mb_in_slice == 0) { // FIXME better field boundary detection
+ if (h0->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
+ ff_h264_field_end(h, 1);
+ }
+
+ h0->current_slice = 0;
+ if (!h0->first_field) {
+ if (h->cur_pic_ptr && !h->droppable) {
+ ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
+ h->picture_structure == PICT_BOTTOM_FIELD);
+ }
+ h->cur_pic_ptr = NULL;
+ }
+ }
+
+ slice_type = get_ue_golomb_31(&h->gb);
+ if (slice_type > 9) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "slice type %d too large at %d %d\n",
+ slice_type, h->mb_x, h->mb_y);
+ return AVERROR_INVALIDDATA;
+ }
+ if (slice_type > 4) {
+ slice_type -= 5;
+ h->slice_type_fixed = 1;
+ } else
+ h->slice_type_fixed = 0;
+
+ slice_type = golomb_to_pict_type[slice_type];
+ h->slice_type = slice_type;
+ h->slice_type_nos = slice_type & 3;
+
+ if (h->nal_unit_type == NAL_IDR_SLICE &&
+ h->slice_type_nos != AV_PICTURE_TYPE_I) {
+ av_log(h->avctx, AV_LOG_ERROR, "A non-intra slice in an IDR NAL unit.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ // to make a few old functions happy, it's wrong though
+ h->pict_type = h->slice_type;
+
+ pps_id = get_ue_golomb(&h->gb);
+ if (pps_id >= MAX_PPS_COUNT) {
+ av_log(h->avctx, AV_LOG_ERROR, "pps_id %u out of range\n", pps_id);
+ return AVERROR_INVALIDDATA;
+ }
+ if (!h0->pps_buffers[pps_id]) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "non-existing PPS %u referenced\n",
+ pps_id);
+ return AVERROR_INVALIDDATA;
+ }
+ if (h0->au_pps_id >= 0 && pps_id != h0->au_pps_id) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "PPS change from %d to %d forbidden\n",
+ h0->au_pps_id, pps_id);
+ return AVERROR_INVALIDDATA;
+ }
+ h->pps = *h0->pps_buffers[pps_id];
+
+ if (!h0->sps_buffers[h->pps.sps_id]) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "non-existing SPS %u referenced\n",
+ h->pps.sps_id);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (h->pps.sps_id != h->sps.sps_id ||
+ h->pps.sps_id != h->current_sps_id ||
+ h0->sps_buffers[h->pps.sps_id]->new) {
+
+ h->sps = *h0->sps_buffers[h->pps.sps_id];
+
+ if (h->mb_width != h->sps.mb_width ||
+ h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) ||
+ h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
+ h->cur_chroma_format_idc != h->sps.chroma_format_idc
+ )
+ needs_reinit = 1;
+
+ if (h->bit_depth_luma != h->sps.bit_depth_luma ||
+ h->chroma_format_idc != h->sps.chroma_format_idc) {
+ h->bit_depth_luma = h->sps.bit_depth_luma;
+ h->chroma_format_idc = h->sps.chroma_format_idc;
+ needs_reinit = 1;
+ }
+ if ((ret = ff_h264_set_parameter_from_sps(h)) < 0)
+ return ret;
+ }
+
+ h->avctx->profile = ff_h264_get_profile(&h->sps);
+ h->avctx->level = h->sps.level_idc;
+ h->avctx->refs = h->sps.ref_frame_count;
+
+ must_reinit = (h->context_initialized &&
+ ( 16*h->sps.mb_width != h->avctx->coded_width
+ || 16*h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) != h->avctx->coded_height
+ || h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma
+ || h->cur_chroma_format_idc != h->sps.chroma_format_idc
+ || av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio)
+ || h->mb_width != h->sps.mb_width
+ || h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
+ ));
+ if (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0)))
+ must_reinit = 1;
+
+ h->mb_width = h->sps.mb_width;
+ h->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
+ h->mb_num = h->mb_width * h->mb_height;
+ h->mb_stride = h->mb_width + 1;
+
+ h->b_stride = h->mb_width * 4;
+
+ h->chroma_y_shift = h->sps.chroma_format_idc <= 1; // 400 uses yuv420p
+
+ h->width = 16 * h->mb_width;
+ h->height = 16 * h->mb_height;
+
+ ret = init_dimensions(h);
+ if (ret < 0)
+ return ret;
+
+ if (h->sps.video_signal_type_present_flag) {
+ h->avctx->color_range = h->sps.full_range>0 ? AVCOL_RANGE_JPEG
+ : AVCOL_RANGE_MPEG;
+ if (h->sps.colour_description_present_flag) {
+ if (h->avctx->colorspace != h->sps.colorspace)
+ needs_reinit = 1;
+ h->avctx->color_primaries = h->sps.color_primaries;
+ h->avctx->color_trc = h->sps.color_trc;
+ h->avctx->colorspace = h->sps.colorspace;
+ }
+ }
+
+ if (h->context_initialized &&
+ (must_reinit || needs_reinit)) {
+ if (h != h0) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "changing width %d -> %d / height %d -> %d on "
+ "slice %d\n",
+ h->width, h->avctx->coded_width,
+ h->height, h->avctx->coded_height,
+ h0->current_slice + 1);
+ return AVERROR_INVALIDDATA;
+ }
+
+ ff_h264_flush_change(h);
+
+ if ((ret = get_pixel_format(h, 1)) < 0)
+ return ret;
+ h->avctx->pix_fmt = ret;
+
+ av_log(h->avctx, AV_LOG_INFO, "Reinit context to %dx%d, "
+ "pix_fmt: %s\n", h->width, h->height, av_get_pix_fmt_name(h->avctx->pix_fmt));
+
+ if ((ret = h264_slice_header_init(h, 1)) < 0) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "h264_slice_header_init() failed\n");
+ return ret;
+ }
+ }
+ if (!h->context_initialized) {
+ if (h != h0) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "Cannot (re-)initialize context during parallel decoding.\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
+ if ((ret = get_pixel_format(h, 1)) < 0)
+ return ret;
+ h->avctx->pix_fmt = ret;
+
+ if ((ret = h264_slice_header_init(h, 0)) < 0) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "h264_slice_header_init() failed\n");
+ return ret;
+ }
+ }
+
+ if (h == h0 && h->dequant_coeff_pps != pps_id) {
+ h->dequant_coeff_pps = pps_id;
+ h264_init_dequant_tables(h);
+ }
+
+ h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
+
+ h->mb_mbaff = 0;
+ h->mb_aff_frame = 0;
+ last_pic_structure = h0->picture_structure;
+ last_pic_droppable = h0->droppable;
+ h->droppable = h->nal_ref_idc == 0;
+ if (h->sps.frame_mbs_only_flag) {
+ h->picture_structure = PICT_FRAME;
+ } else {
+ if (!h->sps.direct_8x8_inference_flag && slice_type == AV_PICTURE_TYPE_B) {
+ av_log(h->avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n");
+ return -1;
+ }
+ field_pic_flag = get_bits1(&h->gb);
+ if (field_pic_flag) {
+ bottom_field_flag = get_bits1(&h->gb);
+ h->picture_structure = PICT_TOP_FIELD + bottom_field_flag;
+ } else {
+ h->picture_structure = PICT_FRAME;
+ h->mb_aff_frame = h->sps.mb_aff;
+ }
+ }
+ h->mb_field_decoding_flag = h->picture_structure != PICT_FRAME;
+
+ if (h0->current_slice != 0) {
+ if (last_pic_structure != h->picture_structure ||
+ last_pic_droppable != h->droppable) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "Changing field mode (%d -> %d) between slices is not allowed\n",
+ last_pic_structure, h->picture_structure);
+ h->picture_structure = last_pic_structure;
+ h->droppable = last_pic_droppable;
+ return AVERROR_INVALIDDATA;
+ } else if (!h0->cur_pic_ptr) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "unset cur_pic_ptr on slice %d\n",
+ h0->current_slice + 1);
+ return AVERROR_INVALIDDATA;
+ }
+ } else {
+ /* Shorten frame num gaps so we don't have to allocate reference
+ * frames just to throw them away */
+ if (h->frame_num != h->prev_frame_num) {
+ int unwrap_prev_frame_num = h->prev_frame_num;
+ int max_frame_num = 1 << h->sps.log2_max_frame_num;
+
+ if (unwrap_prev_frame_num > h->frame_num)
+ unwrap_prev_frame_num -= max_frame_num;
+
+ if ((h->frame_num - unwrap_prev_frame_num) > h->sps.ref_frame_count) {
+ unwrap_prev_frame_num = (h->frame_num - h->sps.ref_frame_count) - 1;
+ if (unwrap_prev_frame_num < 0)
+ unwrap_prev_frame_num += max_frame_num;
+
+ h->prev_frame_num = unwrap_prev_frame_num;
+ }
+ }
+
+ /* See if we have a decoded first field looking for a pair...
+ * Here, we're using that to see if we should mark previously
+ * decode frames as "finished".
+ * We have to do that before the "dummy" in-between frame allocation,
+ * since that can modify h->cur_pic_ptr. */
+ if (h0->first_field) {
+ assert(h0->cur_pic_ptr);
+ assert(h0->cur_pic_ptr->f.buf[0]);
+ assert(h0->cur_pic_ptr->reference != DELAYED_PIC_REF);
+
+ /* Mark old field/frame as completed */
+ if (h0->cur_pic_ptr->tf.owner == h0->avctx) {
+ ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
+ last_pic_structure == PICT_BOTTOM_FIELD);
+ }
+
+ /* figure out if we have a complementary field pair */
+ if (!FIELD_PICTURE(h) || h->picture_structure == last_pic_structure) {
+ /* Previous field is unmatched. Don't display it, but let it
+ * remain for reference if marked as such. */
+ if (last_pic_structure != PICT_FRAME) {
+ ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
+ last_pic_structure == PICT_TOP_FIELD);
+ }
+ } else {
+ if (h0->cur_pic_ptr->frame_num != h->frame_num) {
+ /* This and previous field were reference, but had
+ * different frame_nums. Consider this field first in
+ * pair. Throw away previous field except for reference
+ * purposes. */
+ if (last_pic_structure != PICT_FRAME) {
+ ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
+ last_pic_structure == PICT_TOP_FIELD);
+ }
+ } else {
+ /* Second field in complementary pair */
+ if (!((last_pic_structure == PICT_TOP_FIELD &&
+ h->picture_structure == PICT_BOTTOM_FIELD) ||
+ (last_pic_structure == PICT_BOTTOM_FIELD &&
+ h->picture_structure == PICT_TOP_FIELD))) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "Invalid field mode combination %d/%d\n",
+ last_pic_structure, h->picture_structure);
+ h->picture_structure = last_pic_structure;
+ h->droppable = last_pic_droppable;
+ return AVERROR_INVALIDDATA;
+ } else if (last_pic_droppable != h->droppable) {
+ avpriv_request_sample(h->avctx,
+ "Found reference and non-reference fields in the same frame, which");
+ h->picture_structure = last_pic_structure;
+ h->droppable = last_pic_droppable;
+ return AVERROR_PATCHWELCOME;
+ }
+ }
+ }
+ }
+
+ while (h->frame_num != h->prev_frame_num && !h0->first_field &&
+ h->frame_num != (h->prev_frame_num + 1) % (1 << h->sps.log2_max_frame_num)) {
+ H264Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL;
+ av_log(h->avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n",
+ h->frame_num, h->prev_frame_num);
+ if (!h->sps.gaps_in_frame_num_allowed_flag)
+ for(i=0; i<FF_ARRAY_ELEMS(h->last_pocs); i++)
+ h->last_pocs[i] = INT_MIN;
+ ret = h264_frame_start(h);
+ if (ret < 0) {
+ h0->first_field = 0;
+ return ret;
+ }
+
+ h->prev_frame_num++;
+ h->prev_frame_num %= 1 << h->sps.log2_max_frame_num;
+ h->cur_pic_ptr->frame_num = h->prev_frame_num;
+ h->cur_pic_ptr->invalid_gap = !h->sps.gaps_in_frame_num_allowed_flag;
+ ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 0);
+ ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 1);
+ ret = ff_generate_sliding_window_mmcos(h, 1);
+ if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
+ return ret;
+ ret = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
+ if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
+ return ret;
+ /* Error concealment: If a ref is missing, copy the previous ref
+ * in its place.
+ * FIXME: Avoiding a memcpy would be nice, but ref handling makes
+ * many assumptions about there being no actual duplicates.
+ * FIXME: This does not copy padding for out-of-frame motion
+ * vectors. Given we are concealing a lost frame, this probably
+ * is not noticeable by comparison, but it should be fixed. */
+ if (h->short_ref_count) {
+ if (prev) {
+ av_image_copy(h->short_ref[0]->f.data,
+ h->short_ref[0]->f.linesize,
+ (const uint8_t **)prev->f.data,
+ prev->f.linesize,
+ h->avctx->pix_fmt,
+ h->mb_width * 16,
+ h->mb_height * 16);
+ h->short_ref[0]->poc = prev->poc + 2;
+ }
+ h->short_ref[0]->frame_num = h->prev_frame_num;
+ }
+ }
+
+ /* See if we have a decoded first field looking for a pair...
+ * We're using that to see whether to continue decoding in that
+ * frame, or to allocate a new one. */
+ if (h0->first_field) {
+ assert(h0->cur_pic_ptr);
+ assert(h0->cur_pic_ptr->f.buf[0]);
+ assert(h0->cur_pic_ptr->reference != DELAYED_PIC_REF);
+
+ /* figure out if we have a complementary field pair */
+ if (!FIELD_PICTURE(h) || h->picture_structure == last_pic_structure) {
+ /* Previous field is unmatched. Don't display it, but let it
+ * remain for reference if marked as such. */
+ h0->cur_pic_ptr = NULL;
+ h0->first_field = FIELD_PICTURE(h);
+ } else {
+ if (h0->cur_pic_ptr->frame_num != h->frame_num) {
+ ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
+ h0->picture_structure==PICT_BOTTOM_FIELD);
+ /* This and the previous field had different frame_nums.
+ * Consider this field first in pair. Throw away previous
+ * one except for reference purposes. */
+ h0->first_field = 1;
+ h0->cur_pic_ptr = NULL;
+ } else {
+ /* Second field in complementary pair */
+ h0->first_field = 0;
+ }
+ }
+ } else {
+ /* Frame or first field in a potentially complementary pair */
+ h0->first_field = FIELD_PICTURE(h);
+ }
+
+ if (!FIELD_PICTURE(h) || h0->first_field) {
+ if (h264_frame_start(h) < 0) {
+ h0->first_field = 0;
+ return AVERROR_INVALIDDATA;
+ }
+ } else {
+ release_unused_pictures(h, 0);
+ }
+ /* Some macroblocks can be accessed before they're available in case
+ * of lost slices, MBAFF or threading. */
+ if (FIELD_PICTURE(h)) {
+ for(i = (h->picture_structure == PICT_BOTTOM_FIELD); i<h->mb_height; i++)
+ memset(h->slice_table + i*h->mb_stride, -1, (h->mb_stride - (i+1==h->mb_height)) * sizeof(*h->slice_table));
+ } else {
+ memset(h->slice_table, -1,
+ (h->mb_height * h->mb_stride - 1) * sizeof(*h->slice_table));
+ }
+ h0->last_slice_type = -1;
+ }
+ if (h != h0 && (ret = clone_slice(h, h0)) < 0)
+ return ret;
+
+ /* can't be in alloc_tables because linesize isn't known there.
+ * FIXME: redo bipred weight to not require extra buffer? */
+ for (i = 0; i < h->slice_context_count; i++)
+ if (h->thread_context[i]) {
+ ret = alloc_scratch_buffers(h->thread_context[i], h->linesize);
+ if (ret < 0)
+ return ret;
+ }
+
+ h->cur_pic_ptr->frame_num = h->frame_num; // FIXME frame_num cleanup
+
+ av_assert1(h->mb_num == h->mb_width * h->mb_height);
+ if (first_mb_in_slice << FIELD_OR_MBAFF_PICTURE(h) >= h->mb_num ||
+ first_mb_in_slice >= h->mb_num) {
+ av_log(h->avctx, AV_LOG_ERROR, "first_mb_in_slice overflow\n");
+ return AVERROR_INVALIDDATA;
+ }
+ h->resync_mb_x = h->mb_x = first_mb_in_slice % h->mb_width;
+ h->resync_mb_y = h->mb_y = (first_mb_in_slice / h->mb_width) <<
+ FIELD_OR_MBAFF_PICTURE(h);
+ if (h->picture_structure == PICT_BOTTOM_FIELD)
+ h->resync_mb_y = h->mb_y = h->mb_y + 1;
+ av_assert1(h->mb_y < h->mb_height);
+
+ if (h->picture_structure == PICT_FRAME) {
+ h->curr_pic_num = h->frame_num;
+ h->max_pic_num = 1 << h->sps.log2_max_frame_num;
+ } else {
+ h->curr_pic_num = 2 * h->frame_num + 1;
+ h->max_pic_num = 1 << (h->sps.log2_max_frame_num + 1);
+ }
+
+ if (h->nal_unit_type == NAL_IDR_SLICE)
+ get_ue_golomb(&h->gb); /* idr_pic_id */
+
+ if (h->sps.poc_type == 0) {
+ h->poc_lsb = get_bits(&h->gb, h->sps.log2_max_poc_lsb);
+
+ if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME)
+ h->delta_poc_bottom = get_se_golomb(&h->gb);
+ }
+
+ if (h->sps.poc_type == 1 && !h->sps.delta_pic_order_always_zero_flag) {
+ h->delta_poc[0] = get_se_golomb(&h->gb);
+
+ if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME)
+ h->delta_poc[1] = get_se_golomb(&h->gb);
+ }
+
+ ff_init_poc(h, h->cur_pic_ptr->field_poc, &h->cur_pic_ptr->poc);
+
+ if (h->pps.redundant_pic_cnt_present)
+ h->redundant_pic_count = get_ue_golomb(&h->gb);
+
+ ret = ff_set_ref_count(h);
+ if (ret < 0)
+ return ret;
+
+ if (slice_type != AV_PICTURE_TYPE_I &&
+ (h0->current_slice == 0 ||
+ slice_type != h0->last_slice_type ||
+ memcmp(h0->last_ref_count, h0->ref_count, sizeof(h0->ref_count)))) {
+
+ ff_h264_fill_default_ref_list(h);
+ }
+
+ if (h->slice_type_nos != AV_PICTURE_TYPE_I) {
+ ret = ff_h264_decode_ref_pic_list_reordering(h);
+ if (ret < 0) {
+ h->ref_count[1] = h->ref_count[0] = 0;
+ return ret;
+ }
+ }
+
+ if ((h->pps.weighted_pred && h->slice_type_nos == AV_PICTURE_TYPE_P) ||
+ (h->pps.weighted_bipred_idc == 1 &&
+ h->slice_type_nos == AV_PICTURE_TYPE_B))
+ ff_pred_weight_table(h);
+ else if (h->pps.weighted_bipred_idc == 2 &&
+ h->slice_type_nos == AV_PICTURE_TYPE_B) {
+ implicit_weight_table(h, -1);
+ } else {
+ h->use_weight = 0;
+ for (i = 0; i < 2; i++) {
+ h->luma_weight_flag[i] = 0;
+ h->chroma_weight_flag[i] = 0;
+ }
+ }
+
+ // If frame-mt is enabled, only update mmco tables for the first slice
+ // in a field. Subsequent slices can temporarily clobber h->mmco_index
+ // or h->mmco, which will cause ref list mix-ups and decoding errors
+ // further down the line. This may break decoding if the first slice is
+ // corrupt, thus we only do this if frame-mt is enabled.
+ if (h->nal_ref_idc) {
+ ret = ff_h264_decode_ref_pic_marking(h0, &h->gb,
+ !(h->avctx->active_thread_type & FF_THREAD_FRAME) ||
+ h0->current_slice == 0);
+ if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (FRAME_MBAFF(h)) {
+ ff_h264_fill_mbaff_ref_list(h);
+
+ if (h->pps.weighted_bipred_idc == 2 && h->slice_type_nos == AV_PICTURE_TYPE_B) {
+ implicit_weight_table(h, 0);
+ implicit_weight_table(h, 1);
+ }
+ }
+
+ if (h->slice_type_nos == AV_PICTURE_TYPE_B && !h->direct_spatial_mv_pred)
+ ff_h264_direct_dist_scale_factor(h);
+ ff_h264_direct_ref_list_init(h);
+
+ if (h->slice_type_nos != AV_PICTURE_TYPE_I && h->pps.cabac) {
+ tmp = get_ue_golomb_31(&h->gb);
+ if (tmp > 2) {
+ av_log(h->avctx, AV_LOG_ERROR, "cabac_init_idc %u overflow\n", tmp);
+ return AVERROR_INVALIDDATA;
+ }
+ h->cabac_init_idc = tmp;
+ }
+
+ h->last_qscale_diff = 0;
+ tmp = h->pps.init_qp + get_se_golomb(&h->gb);
+ if (tmp > 51 + 6 * (h->sps.bit_depth_luma - 8)) {
+ av_log(h->avctx, AV_LOG_ERROR, "QP %u out of range\n", tmp);
+ return AVERROR_INVALIDDATA;
+ }
+ h->qscale = tmp;
+ h->chroma_qp[0] = get_chroma_qp(h, 0, h->qscale);
+ h->chroma_qp[1] = get_chroma_qp(h, 1, h->qscale);
+ // FIXME qscale / qp ... stuff
+ if (h->slice_type == AV_PICTURE_TYPE_SP)
+ get_bits1(&h->gb); /* sp_for_switch_flag */
+ if (h->slice_type == AV_PICTURE_TYPE_SP ||
+ h->slice_type == AV_PICTURE_TYPE_SI)
+ get_se_golomb(&h->gb); /* slice_qs_delta */
+
+ h->deblocking_filter = 1;
+ h->slice_alpha_c0_offset = 0;
+ h->slice_beta_offset = 0;
+ if (h->pps.deblocking_filter_parameters_present) {
+ tmp = get_ue_golomb_31(&h->gb);
+ if (tmp > 2) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "deblocking_filter_idc %u out of range\n", tmp);
+ return AVERROR_INVALIDDATA;
+ }
+ h->deblocking_filter = tmp;
+ if (h->deblocking_filter < 2)
+ h->deblocking_filter ^= 1; // 1<->0
+
+ if (h->deblocking_filter) {
+ h->slice_alpha_c0_offset = get_se_golomb(&h->gb) * 2;
+ h->slice_beta_offset = get_se_golomb(&h->gb) * 2;
+ if (h->slice_alpha_c0_offset > 12 ||
+ h->slice_alpha_c0_offset < -12 ||
+ h->slice_beta_offset > 12 ||
+ h->slice_beta_offset < -12) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "deblocking filter parameters %d %d out of range\n",
+ h->slice_alpha_c0_offset, h->slice_beta_offset);
+ return AVERROR_INVALIDDATA;
+ }
+ }
+ }
+
+ if (h->avctx->skip_loop_filter >= AVDISCARD_ALL ||
+ (h->avctx->skip_loop_filter >= AVDISCARD_NONKEY &&
+ h->slice_type_nos != AV_PICTURE_TYPE_I) ||
+ (h->avctx->skip_loop_filter >= AVDISCARD_BIDIR &&
+ h->slice_type_nos == AV_PICTURE_TYPE_B) ||
+ (h->avctx->skip_loop_filter >= AVDISCARD_NONREF &&
+ h->nal_ref_idc == 0))
+ h->deblocking_filter = 0;
+
+ if (h->deblocking_filter == 1 && h0->max_contexts > 1) {
+ if (h->avctx->flags2 & CODEC_FLAG2_FAST) {
+ /* Cheat slightly for speed:
+ * Do not bother to deblock across slices. */
+ h->deblocking_filter = 2;
+ } else {
+ h0->max_contexts = 1;
+ if (!h0->single_decode_warning) {
+ av_log(h->avctx, AV_LOG_INFO,
+ "Cannot parallelize deblocking type 1, decoding such frames in sequential order\n");
+ h0->single_decode_warning = 1;
+ }
+ if (h != h0) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "Deblocking switched inside frame.\n");
+ return 1;
+ }
+ }
+ }
+ h->qp_thresh = 15 -
+ FFMIN(h->slice_alpha_c0_offset, h->slice_beta_offset) -
+ FFMAX3(0,
+ h->pps.chroma_qp_index_offset[0],
+ h->pps.chroma_qp_index_offset[1]) +
+ 6 * (h->sps.bit_depth_luma - 8);
+
+ h0->last_slice_type = slice_type;
+ memcpy(h0->last_ref_count, h0->ref_count, sizeof(h0->last_ref_count));
+ h->slice_num = ++h0->current_slice;
+
+ if (h->slice_num)
+ h0->slice_row[(h->slice_num-1)&(MAX_SLICES-1)]= h->resync_mb_y;
+ if ( h0->slice_row[h->slice_num&(MAX_SLICES-1)] + 3 >= h->resync_mb_y
+ && h0->slice_row[h->slice_num&(MAX_SLICES-1)] <= h->resync_mb_y
+ && h->slice_num >= MAX_SLICES) {
+ //in case of ASO this check needs to be updated depending on how we decide to assign slice numbers in this case
+ av_log(h->avctx, AV_LOG_WARNING, "Possibly too many slices (%d >= %d), increase MAX_SLICES and recompile if there are artifacts\n", h->slice_num, MAX_SLICES);
+ }
+
+ for (j = 0; j < 2; j++) {
+ int id_list[16];
+ int *ref2frm = h->ref2frm[h->slice_num & (MAX_SLICES - 1)][j];
+ for (i = 0; i < 16; i++) {
+ id_list[i] = 60;
+ if (j < h->list_count && i < h->ref_count[j] &&
+ h->ref_list[j][i].f.buf[0]) {
+ int k;
+ AVBuffer *buf = h->ref_list[j][i].f.buf[0]->buffer;
+ for (k = 0; k < h->short_ref_count; k++)
+ if (h->short_ref[k]->f.buf[0]->buffer == buf) {
+ id_list[i] = k;
+ break;
+ }
+ for (k = 0; k < h->long_ref_count; k++)
+ if (h->long_ref[k] && h->long_ref[k]->f.buf[0]->buffer == buf) {
+ id_list[i] = h->short_ref_count + k;
+ break;
+ }
+ }
+ }
+
+ ref2frm[0] =
+ ref2frm[1] = -1;
+ for (i = 0; i < 16; i++)
+ ref2frm[i + 2] = 4 * id_list[i] + (h->ref_list[j][i].reference & 3);
+ ref2frm[18 + 0] =
+ ref2frm[18 + 1] = -1;
+ for (i = 16; i < 48; i++)
+ ref2frm[i + 4] = 4 * id_list[(i - 16) >> 1] +
+ (h->ref_list[j][i].reference & 3);
+ }
+
+#if CONFIG_ERROR_RESILIENCE
+ if (h->ref_count[0]) ff_h264_set_erpic(&h->er.last_pic, &h->ref_list[0][0]);
+ if (h->ref_count[1]) ff_h264_set_erpic(&h->er.next_pic, &h->ref_list[1][0]);
+#endif
+
+ h->er.ref_count = h->ref_count[0];
+ h0->au_pps_id = pps_id;
+ h->sps.new =
+ h0->sps_buffers[h->pps.sps_id]->new = 0;
+ h->current_sps_id = h->pps.sps_id;
+
+ if (h->avctx->debug & FF_DEBUG_PICT_INFO) {
+ av_log(h->avctx, AV_LOG_DEBUG,
+ "slice:%d %s mb:%d %c%s%s pps:%u frame:%d poc:%d/%d ref:%d/%d qp:%d loop:%d:%d:%d weight:%d%s %s\n",
+ h->slice_num,
+ (h->picture_structure == PICT_FRAME ? "F" : h->picture_structure == PICT_TOP_FIELD ? "T" : "B"),
+ first_mb_in_slice,
+ av_get_picture_type_char(h->slice_type),
+ h->slice_type_fixed ? " fix" : "",
+ h->nal_unit_type == NAL_IDR_SLICE ? " IDR" : "",
+ pps_id, h->frame_num,
+ h->cur_pic_ptr->field_poc[0],
+ h->cur_pic_ptr->field_poc[1],
+ h->ref_count[0], h->ref_count[1],
+ h->qscale,
+ h->deblocking_filter,
+ h->slice_alpha_c0_offset, h->slice_beta_offset,
+ h->use_weight,
+ h->use_weight == 1 && h->use_weight_chroma ? "c" : "",
+ h->slice_type == AV_PICTURE_TYPE_B ? (h->direct_spatial_mv_pred ? "SPAT" : "TEMP") : "");
+ }
+
+ return 0;
+}
+
+int ff_h264_get_slice_type(const H264Context *h)
+{
+ switch (h->slice_type) {
+ case AV_PICTURE_TYPE_P:
+ return 0;
+ case AV_PICTURE_TYPE_B:
+ return 1;
+ case AV_PICTURE_TYPE_I:
+ return 2;
+ case AV_PICTURE_TYPE_SP:
+ return 3;
+ case AV_PICTURE_TYPE_SI:
+ return 4;
+ default:
+ return AVERROR_INVALIDDATA;
+ }
+}
+
+static av_always_inline void fill_filter_caches_inter(H264Context *h,
+ int mb_type, int top_xy,
+ int left_xy[LEFT_MBS],
+ int top_type,
+ int left_type[LEFT_MBS],
+ int mb_xy, int list)
+{
+ int b_stride = h->b_stride;
+ int16_t(*mv_dst)[2] = &h->mv_cache[list][scan8[0]];
+ int8_t *ref_cache = &h->ref_cache[list][scan8[0]];
+ if (IS_INTER(mb_type) || IS_DIRECT(mb_type)) {
+ if (USES_LIST(top_type, list)) {
+ const int b_xy = h->mb2b_xy[top_xy] + 3 * b_stride;
+ const int b8_xy = 4 * top_xy + 2;
+ int (*ref2frm)[64] = (void*)(h->ref2frm[h->slice_table[top_xy] & (MAX_SLICES - 1)][0] + (MB_MBAFF(h) ? 20 : 2));
+ AV_COPY128(mv_dst - 1 * 8, h->cur_pic.motion_val[list][b_xy + 0]);
+ ref_cache[0 - 1 * 8] =
+ ref_cache[1 - 1 * 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 0]];
+ ref_cache[2 - 1 * 8] =
+ ref_cache[3 - 1 * 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 1]];
+ } else {
+ AV_ZERO128(mv_dst - 1 * 8);
+ AV_WN32A(&ref_cache[0 - 1 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
+ }
+
+ if (!IS_INTERLACED(mb_type ^ left_type[LTOP])) {
+ if (USES_LIST(left_type[LTOP], list)) {
+ const int b_xy = h->mb2b_xy[left_xy[LTOP]] + 3;
+ const int b8_xy = 4 * left_xy[LTOP] + 1;
+ int (*ref2frm)[64] =(void*)( h->ref2frm[h->slice_table[left_xy[LTOP]] & (MAX_SLICES - 1)][0] + (MB_MBAFF(h) ? 20 : 2));
+ AV_COPY32(mv_dst - 1 + 0, h->cur_pic.motion_val[list][b_xy + b_stride * 0]);
+ AV_COPY32(mv_dst - 1 + 8, h->cur_pic.motion_val[list][b_xy + b_stride * 1]);
+ AV_COPY32(mv_dst - 1 + 16, h->cur_pic.motion_val[list][b_xy + b_stride * 2]);
+ AV_COPY32(mv_dst - 1 + 24, h->cur_pic.motion_val[list][b_xy + b_stride * 3]);
+ ref_cache[-1 + 0] =
+ ref_cache[-1 + 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 0]];
+ ref_cache[-1 + 16] =
+ ref_cache[-1 + 24] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 1]];
+ } else {
+ AV_ZERO32(mv_dst - 1 + 0);
+ AV_ZERO32(mv_dst - 1 + 8);
+ AV_ZERO32(mv_dst - 1 + 16);
+ AV_ZERO32(mv_dst - 1 + 24);
+ ref_cache[-1 + 0] =
+ ref_cache[-1 + 8] =
+ ref_cache[-1 + 16] =
+ ref_cache[-1 + 24] = LIST_NOT_USED;
+ }
+ }
+ }
+
+ if (!USES_LIST(mb_type, list)) {
+ fill_rectangle(mv_dst, 4, 4, 8, pack16to32(0, 0), 4);
+ AV_WN32A(&ref_cache[0 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
+ AV_WN32A(&ref_cache[1 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
+ AV_WN32A(&ref_cache[2 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
+ AV_WN32A(&ref_cache[3 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
+ return;
+ }
+
+ {
+ int8_t *ref = &h->cur_pic.ref_index[list][4 * mb_xy];
+ int (*ref2frm)[64] = (void*)(h->ref2frm[h->slice_num & (MAX_SLICES - 1)][0] + (MB_MBAFF(h) ? 20 : 2));
+ uint32_t ref01 = (pack16to32(ref2frm[list][ref[0]], ref2frm[list][ref[1]]) & 0x00FF00FF) * 0x0101;
+ uint32_t ref23 = (pack16to32(ref2frm[list][ref[2]], ref2frm[list][ref[3]]) & 0x00FF00FF) * 0x0101;
+ AV_WN32A(&ref_cache[0 * 8], ref01);
+ AV_WN32A(&ref_cache[1 * 8], ref01);
+ AV_WN32A(&ref_cache[2 * 8], ref23);
+ AV_WN32A(&ref_cache[3 * 8], ref23);
+ }
+
+ {
+ int16_t(*mv_src)[2] = &h->cur_pic.motion_val[list][4 * h->mb_x + 4 * h->mb_y * b_stride];
+ AV_COPY128(mv_dst + 8 * 0, mv_src + 0 * b_stride);
+ AV_COPY128(mv_dst + 8 * 1, mv_src + 1 * b_stride);
+ AV_COPY128(mv_dst + 8 * 2, mv_src + 2 * b_stride);
+ AV_COPY128(mv_dst + 8 * 3, mv_src + 3 * b_stride);
+ }
+}
+
+/**
+ *
+ * @return non zero if the loop filter can be skipped
+ */
+static int fill_filter_caches(H264Context *h, int mb_type)
+{
+ const int mb_xy = h->mb_xy;
+ int top_xy, left_xy[LEFT_MBS];
+ int top_type, left_type[LEFT_MBS];
+ uint8_t *nnz;
+ uint8_t *nnz_cache;
+
+ top_xy = mb_xy - (h->mb_stride << MB_FIELD(h));
+
+ /* Wow, what a mess, why didn't they simplify the interlacing & intra
+ * stuff, I can't imagine that these complex rules are worth it. */
+
+ left_xy[LBOT] = left_xy[LTOP] = mb_xy - 1;
+ if (FRAME_MBAFF(h)) {
+ const int left_mb_field_flag = IS_INTERLACED(h->cur_pic.mb_type[mb_xy - 1]);
+ const int curr_mb_field_flag = IS_INTERLACED(mb_type);
+ if (h->mb_y & 1) {
+ if (left_mb_field_flag != curr_mb_field_flag)
+ left_xy[LTOP] -= h->mb_stride;
+ } else {
+ if (curr_mb_field_flag)
+ top_xy += h->mb_stride &
+ (((h->cur_pic.mb_type[top_xy] >> 7) & 1) - 1);
+ if (left_mb_field_flag != curr_mb_field_flag)
+ left_xy[LBOT] += h->mb_stride;
+ }
+ }
+
+ h->top_mb_xy = top_xy;
+ h->left_mb_xy[LTOP] = left_xy[LTOP];
+ h->left_mb_xy[LBOT] = left_xy[LBOT];
+ {
+ /* For sufficiently low qp, filtering wouldn't do anything.
+ * This is a conservative estimate: could also check beta_offset
+ * and more accurate chroma_qp. */
+ int qp_thresh = h->qp_thresh; // FIXME strictly we should store qp_thresh for each mb of a slice
+ int qp = h->cur_pic.qscale_table[mb_xy];
+ if (qp <= qp_thresh &&
+ (left_xy[LTOP] < 0 ||
+ ((qp + h->cur_pic.qscale_table[left_xy[LTOP]] + 1) >> 1) <= qp_thresh) &&
+ (top_xy < 0 ||
+ ((qp + h->cur_pic.qscale_table[top_xy] + 1) >> 1) <= qp_thresh)) {
+ if (!FRAME_MBAFF(h))
+ return 1;
+ if ((left_xy[LTOP] < 0 ||
+ ((qp + h->cur_pic.qscale_table[left_xy[LBOT]] + 1) >> 1) <= qp_thresh) &&
+ (top_xy < h->mb_stride ||
+ ((qp + h->cur_pic.qscale_table[top_xy - h->mb_stride] + 1) >> 1) <= qp_thresh))
+ return 1;
+ }
+ }
+
+ top_type = h->cur_pic.mb_type[top_xy];
+ left_type[LTOP] = h->cur_pic.mb_type[left_xy[LTOP]];
+ left_type[LBOT] = h->cur_pic.mb_type[left_xy[LBOT]];
+ if (h->deblocking_filter == 2) {
+ if (h->slice_table[top_xy] != h->slice_num)
+ top_type = 0;
+ if (h->slice_table[left_xy[LBOT]] != h->slice_num)
+ left_type[LTOP] = left_type[LBOT] = 0;
+ } else {
+ if (h->slice_table[top_xy] == 0xFFFF)
+ top_type = 0;
+ if (h->slice_table[left_xy[LBOT]] == 0xFFFF)
+ left_type[LTOP] = left_type[LBOT] = 0;
+ }
+ h->top_type = top_type;
+ h->left_type[LTOP] = left_type[LTOP];
+ h->left_type[LBOT] = left_type[LBOT];
+
+ if (IS_INTRA(mb_type))
+ return 0;
+
+ fill_filter_caches_inter(h, mb_type, top_xy, left_xy,
+ top_type, left_type, mb_xy, 0);
+ if (h->list_count == 2)
+ fill_filter_caches_inter(h, mb_type, top_xy, left_xy,
+ top_type, left_type, mb_xy, 1);
+
+ nnz = h->non_zero_count[mb_xy];
+ nnz_cache = h->non_zero_count_cache;
+ AV_COPY32(&nnz_cache[4 + 8 * 1], &nnz[0]);
+ AV_COPY32(&nnz_cache[4 + 8 * 2], &nnz[4]);
+ AV_COPY32(&nnz_cache[4 + 8 * 3], &nnz[8]);
+ AV_COPY32(&nnz_cache[4 + 8 * 4], &nnz[12]);
+ h->cbp = h->cbp_table[mb_xy];
+
+ if (top_type) {
+ nnz = h->non_zero_count[top_xy];
+ AV_COPY32(&nnz_cache[4 + 8 * 0], &nnz[3 * 4]);
+ }
+
+ if (left_type[LTOP]) {
+ nnz = h->non_zero_count[left_xy[LTOP]];
+ nnz_cache[3 + 8 * 1] = nnz[3 + 0 * 4];
+ nnz_cache[3 + 8 * 2] = nnz[3 + 1 * 4];
+ nnz_cache[3 + 8 * 3] = nnz[3 + 2 * 4];
+ nnz_cache[3 + 8 * 4] = nnz[3 + 3 * 4];
+ }
+
+ /* CAVLC 8x8dct requires NNZ values for residual decoding that differ
+ * from what the loop filter needs */
+ if (!CABAC(h) && h->pps.transform_8x8_mode) {
+ if (IS_8x8DCT(top_type)) {
+ nnz_cache[4 + 8 * 0] =
+ nnz_cache[5 + 8 * 0] = (h->cbp_table[top_xy] & 0x4000) >> 12;
+ nnz_cache[6 + 8 * 0] =
+ nnz_cache[7 + 8 * 0] = (h->cbp_table[top_xy] & 0x8000) >> 12;
+ }
+ if (IS_8x8DCT(left_type[LTOP])) {
+ nnz_cache[3 + 8 * 1] =
+ nnz_cache[3 + 8 * 2] = (h->cbp_table[left_xy[LTOP]] & 0x2000) >> 12; // FIXME check MBAFF
+ }
+ if (IS_8x8DCT(left_type[LBOT])) {
+ nnz_cache[3 + 8 * 3] =
+ nnz_cache[3 + 8 * 4] = (h->cbp_table[left_xy[LBOT]] & 0x8000) >> 12; // FIXME check MBAFF
+ }
+
+ if (IS_8x8DCT(mb_type)) {
+ nnz_cache[scan8[0]] =
+ nnz_cache[scan8[1]] =
+ nnz_cache[scan8[2]] =
+ nnz_cache[scan8[3]] = (h->cbp & 0x1000) >> 12;
+
+ nnz_cache[scan8[0 + 4]] =
+ nnz_cache[scan8[1 + 4]] =
+ nnz_cache[scan8[2 + 4]] =
+ nnz_cache[scan8[3 + 4]] = (h->cbp & 0x2000) >> 12;
+
+ nnz_cache[scan8[0 + 8]] =
+ nnz_cache[scan8[1 + 8]] =
+ nnz_cache[scan8[2 + 8]] =
+ nnz_cache[scan8[3 + 8]] = (h->cbp & 0x4000) >> 12;
+
+ nnz_cache[scan8[0 + 12]] =
+ nnz_cache[scan8[1 + 12]] =
+ nnz_cache[scan8[2 + 12]] =
+ nnz_cache[scan8[3 + 12]] = (h->cbp & 0x8000) >> 12;
+ }
+ }
+
+ return 0;
+}
+
+static void loop_filter(H264Context *h, int start_x, int end_x)
+{
+ uint8_t *dest_y, *dest_cb, *dest_cr;
+ int linesize, uvlinesize, mb_x, mb_y;
+ const int end_mb_y = h->mb_y + FRAME_MBAFF(h);
+ const int old_slice_type = h->slice_type;
+ const int pixel_shift = h->pixel_shift;
+ const int block_h = 16 >> h->chroma_y_shift;
+
+ if (h->deblocking_filter) {
+ for (mb_x = start_x; mb_x < end_x; mb_x++)
+ for (mb_y = end_mb_y - FRAME_MBAFF(h); mb_y <= end_mb_y; mb_y++) {
+ int mb_xy, mb_type;
+ mb_xy = h->mb_xy = mb_x + mb_y * h->mb_stride;
+ h->slice_num = h->slice_table[mb_xy];
+ mb_type = h->cur_pic.mb_type[mb_xy];
+ h->list_count = h->list_counts[mb_xy];
+
+ if (FRAME_MBAFF(h))
+ h->mb_mbaff =
+ h->mb_field_decoding_flag = !!IS_INTERLACED(mb_type);
+
+ h->mb_x = mb_x;
+ h->mb_y = mb_y;
+ dest_y = h->cur_pic.f.data[0] +
+ ((mb_x << pixel_shift) + mb_y * h->linesize) * 16;
+ dest_cb = h->cur_pic.f.data[1] +
+ (mb_x << pixel_shift) * (8 << CHROMA444(h)) +
+ mb_y * h->uvlinesize * block_h;
+ dest_cr = h->cur_pic.f.data[2] +
+ (mb_x << pixel_shift) * (8 << CHROMA444(h)) +
+ mb_y * h->uvlinesize * block_h;
+ // FIXME simplify above
+
+ if (MB_FIELD(h)) {
+ linesize = h->mb_linesize = h->linesize * 2;
+ uvlinesize = h->mb_uvlinesize = h->uvlinesize * 2;
+ if (mb_y & 1) { // FIXME move out of this function?
+ dest_y -= h->linesize * 15;
+ dest_cb -= h->uvlinesize * (block_h - 1);
+ dest_cr -= h->uvlinesize * (block_h - 1);
+ }
+ } else {
+ linesize = h->mb_linesize = h->linesize;
+ uvlinesize = h->mb_uvlinesize = h->uvlinesize;
+ }
+ backup_mb_border(h, dest_y, dest_cb, dest_cr, linesize,
+ uvlinesize, 0);
+ if (fill_filter_caches(h, mb_type))
+ continue;
+ h->chroma_qp[0] = get_chroma_qp(h, 0, h->cur_pic.qscale_table[mb_xy]);
+ h->chroma_qp[1] = get_chroma_qp(h, 1, h->cur_pic.qscale_table[mb_xy]);
+
+ if (FRAME_MBAFF(h)) {
+ ff_h264_filter_mb(h, mb_x, mb_y, dest_y, dest_cb, dest_cr,
+ linesize, uvlinesize);
+ } else {
+ ff_h264_filter_mb_fast(h, mb_x, mb_y, dest_y, dest_cb,
+ dest_cr, linesize, uvlinesize);
+ }
+ }
+ }
+ h->slice_type = old_slice_type;
+ h->mb_x = end_x;
+ h->mb_y = end_mb_y - FRAME_MBAFF(h);
+ h->chroma_qp[0] = get_chroma_qp(h, 0, h->qscale);
+ h->chroma_qp[1] = get_chroma_qp(h, 1, h->qscale);
+}
+
+static void predict_field_decoding_flag(H264Context *h)
+{
+ const int mb_xy = h->mb_x + h->mb_y * h->mb_stride;
+ int mb_type = (h->slice_table[mb_xy - 1] == h->slice_num) ?
+ h->cur_pic.mb_type[mb_xy - 1] :
+ (h->slice_table[mb_xy - h->mb_stride] == h->slice_num) ?
+ h->cur_pic.mb_type[mb_xy - h->mb_stride] : 0;
+ h->mb_mbaff = h->mb_field_decoding_flag = IS_INTERLACED(mb_type) ? 1 : 0;
+}
+
+/**
+ * Draw edges and report progress for the last MB row.
+ */
+static void decode_finish_row(H264Context *h)
+{
+ int top = 16 * (h->mb_y >> FIELD_PICTURE(h));
+ int pic_height = 16 * h->mb_height >> FIELD_PICTURE(h);
+ int height = 16 << FRAME_MBAFF(h);
+ int deblock_border = (16 + 4) << FRAME_MBAFF(h);
+
+ if (h->deblocking_filter) {
+ if ((top + height) >= pic_height)
+ height += deblock_border;
+ top -= deblock_border;
+ }
+
+ if (top >= pic_height || (top + height) < 0)
+ return;
+
+ height = FFMIN(height, pic_height - top);
+ if (top < 0) {
+ height = top + height;
+ top = 0;
+ }
+
+ ff_h264_draw_horiz_band(h, top, height);
+
+ if (h->droppable || h->er.error_occurred)
+ return;
+
+ ff_thread_report_progress(&h->cur_pic_ptr->tf, top + height - 1,
+ h->picture_structure == PICT_BOTTOM_FIELD);
+}
+
+static void er_add_slice(H264Context *h, int startx, int starty,
+ int endx, int endy, int status)
+{
+ if (CONFIG_ERROR_RESILIENCE) {
+ ERContext *er = &h->er;
+
+ ff_er_add_slice(er, startx, starty, endx, endy, status);
+ }
+}
+
+static int decode_slice(struct AVCodecContext *avctx, void *arg)
+{
+ H264Context *h = *(void **)arg;
+ int lf_x_start = h->mb_x;
+
+ h->mb_skip_run = -1;
+
+ av_assert0(h->block_offset[15] == (4 * ((scan8[15] - scan8[0]) & 7) << h->pixel_shift) + 4 * h->linesize * ((scan8[15] - scan8[0]) >> 3));
+
+ h->is_complex = FRAME_MBAFF(h) || h->picture_structure != PICT_FRAME ||
+ avctx->codec_id != AV_CODEC_ID_H264 ||
+ (CONFIG_GRAY && (h->flags & CODEC_FLAG_GRAY));
+
+ if (!(h->avctx->active_thread_type & FF_THREAD_SLICE) && h->picture_structure == PICT_FRAME && h->er.error_status_table) {
+ const int start_i = av_clip(h->resync_mb_x + h->resync_mb_y * h->mb_width, 0, h->mb_num - 1);
+ if (start_i) {
+ int prev_status = h->er.error_status_table[h->er.mb_index2xy[start_i - 1]];
+ prev_status &= ~ VP_START;
+ if (prev_status != (ER_MV_END | ER_DC_END | ER_AC_END))
+ h->er.error_occurred = 1;
+ }
+ }
+
+ if (h->pps.cabac) {
+ /* realign */
+ align_get_bits(&h->gb);
+
+ /* init cabac */
+ ff_init_cabac_decoder(&h->cabac,
+ h->gb.buffer + get_bits_count(&h->gb) / 8,
+ (get_bits_left(&h->gb) + 7) / 8);
+
+ ff_h264_init_cabac_states(h);
+
+ for (;;) {
+ // START_TIMER
+ int ret = ff_h264_decode_mb_cabac(h);
+ int eos;
+ // STOP_TIMER("decode_mb_cabac")
+
+ if (ret >= 0)
+ ff_h264_hl_decode_mb(h);
+
+ // FIXME optimal? or let mb_decode decode 16x32 ?
+ if (ret >= 0 && FRAME_MBAFF(h)) {
+ h->mb_y++;
+
+ ret = ff_h264_decode_mb_cabac(h);
+
+ if (ret >= 0)
+ ff_h264_hl_decode_mb(h);
+ h->mb_y--;
+ }
+ eos = get_cabac_terminate(&h->cabac);
+
+ if ((h->workaround_bugs & FF_BUG_TRUNCATED) &&
+ h->cabac.bytestream > h->cabac.bytestream_end + 2) {
+ er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x - 1,
+ h->mb_y, ER_MB_END);
+ if (h->mb_x >= lf_x_start)
+ loop_filter(h, lf_x_start, h->mb_x + 1);
+ return 0;
+ }
+ if (h->cabac.bytestream > h->cabac.bytestream_end + 2 )
+ av_log(h->avctx, AV_LOG_DEBUG, "bytestream overread %"PTRDIFF_SPECIFIER"\n", h->cabac.bytestream_end - h->cabac.bytestream);
+ if (ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 4) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "error while decoding MB %d %d, bytestream %"PTRDIFF_SPECIFIER"\n",
+ h->mb_x, h->mb_y,
+ h->cabac.bytestream_end - h->cabac.bytestream);
+ er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
+ h->mb_y, ER_MB_ERROR);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (++h->mb_x >= h->mb_width) {
+ loop_filter(h, lf_x_start, h->mb_x);
+ h->mb_x = lf_x_start = 0;
+ decode_finish_row(h);
+ ++h->mb_y;
+ if (FIELD_OR_MBAFF_PICTURE(h)) {
+ ++h->mb_y;
+ if (FRAME_MBAFF(h) && h->mb_y < h->mb_height)
+ predict_field_decoding_flag(h);
+ }
+ }
+
+ if (eos || h->mb_y >= h->mb_height) {
+ tprintf(h->avctx, "slice end %d %d\n",
+ get_bits_count(&h->gb), h->gb.size_in_bits);
+ er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x - 1,
+ h->mb_y, ER_MB_END);
+ if (h->mb_x > lf_x_start)
+ loop_filter(h, lf_x_start, h->mb_x);
+ return 0;
+ }
+ }
+ } else {
+ for (;;) {
+ int ret = ff_h264_decode_mb_cavlc(h);
+
+ if (ret >= 0)
+ ff_h264_hl_decode_mb(h);
+
+ // FIXME optimal? or let mb_decode decode 16x32 ?
+ if (ret >= 0 && FRAME_MBAFF(h)) {
+ h->mb_y++;
+ ret = ff_h264_decode_mb_cavlc(h);
+
+ if (ret >= 0)
+ ff_h264_hl_decode_mb(h);
+ h->mb_y--;
+ }
+
+ if (ret < 0) {
+ av_log(h->avctx, AV_LOG_ERROR,
+ "error while decoding MB %d %d\n", h->mb_x, h->mb_y);
+ er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
+ h->mb_y, ER_MB_ERROR);
+ return ret;
+ }
+
+ if (++h->mb_x >= h->mb_width) {
+ loop_filter(h, lf_x_start, h->mb_x);
+ h->mb_x = lf_x_start = 0;
+ decode_finish_row(h);
+ ++h->mb_y;
+ if (FIELD_OR_MBAFF_PICTURE(h)) {
+ ++h->mb_y;
+ if (FRAME_MBAFF(h) && h->mb_y < h->mb_height)
+ predict_field_decoding_flag(h);
+ }
+ if (h->mb_y >= h->mb_height) {
+ tprintf(h->avctx, "slice end %d %d\n",
+ get_bits_count(&h->gb), h->gb.size_in_bits);
+
+ if ( get_bits_left(&h->gb) == 0
+ || get_bits_left(&h->gb) > 0 && !(h->avctx->err_recognition & AV_EF_AGGRESSIVE)) {
+ er_add_slice(h, h->resync_mb_x, h->resync_mb_y,
+ h->mb_x - 1, h->mb_y,
+ ER_MB_END);
+
+ return 0;
+ } else {
+ er_add_slice(h, h->resync_mb_x, h->resync_mb_y,
+ h->mb_x, h->mb_y,
+ ER_MB_END);
+
+ return AVERROR_INVALIDDATA;
+ }
+ }
+ }
+
+ if (get_bits_left(&h->gb) <= 0 && h->mb_skip_run <= 0) {
+ tprintf(h->avctx, "slice end %d %d\n",
+ get_bits_count(&h->gb), h->gb.size_in_bits);
+
+ if (get_bits_left(&h->gb) == 0) {
+ er_add_slice(h, h->resync_mb_x, h->resync_mb_y,
+ h->mb_x - 1, h->mb_y,
+ ER_MB_END);
+ if (h->mb_x > lf_x_start)
+ loop_filter(h, lf_x_start, h->mb_x);
+
+ return 0;
+ } else {
+ er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
+ h->mb_y, ER_MB_ERROR);
+
+ return AVERROR_INVALIDDATA;
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Call decode_slice() for each context.
+ *
+ * @param h h264 master context
+ * @param context_count number of contexts to execute
+ */
+int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count)
+{
+ AVCodecContext *const avctx = h->avctx;
+ H264Context *hx;
+ int i;
+
+ av_assert0(h->mb_y < h->mb_height);
+
+ if (h->avctx->hwaccel ||
+ h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
+ return 0;
+ if (context_count == 1) {
+ return decode_slice(avctx, &h);
+ } else {
+ av_assert0(context_count > 0);
+ for (i = 1; i < context_count; i++) {
+ hx = h->thread_context[i];
+ if (CONFIG_ERROR_RESILIENCE) {
+ hx->er.error_count = 0;
+ }
+ hx->x264_build = h->x264_build;
+ }
+
+ avctx->execute(avctx, decode_slice, h->thread_context,
+ NULL, context_count, sizeof(void *));
+
+ /* pull back stuff from slices to master context */
+ hx = h->thread_context[context_count - 1];
+ h->mb_x = hx->mb_x;
+ h->mb_y = hx->mb_y;
+ h->droppable = hx->droppable;
+ h->picture_structure = hx->picture_structure;
+ if (CONFIG_ERROR_RESILIENCE) {
+ for (i = 1; i < context_count; i++)
+ h->er.error_count += h->thread_context[i]->er.error_count;
+ }
+ }
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264chroma.c b/chromium/third_party/ffmpeg/libavcodec/h264chroma.c
index 5f8ed9193b0..5b3e13bdacf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264chroma.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264chroma.c
@@ -46,6 +46,8 @@ av_cold void ff_h264chroma_init(H264ChromaContext *c, int bit_depth)
SET_CHROMA(8);
}
+ if (ARCH_AARCH64)
+ ff_h264chroma_init_aarch64(c, bit_depth);
if (ARCH_ARM)
ff_h264chroma_init_arm(c, bit_depth);
if (ARCH_PPC)
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264chroma.h b/chromium/third_party/ffmpeg/libavcodec/h264chroma.h
index 45bbc7d35e6..d4b8a0eb0ef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264chroma.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264chroma.h
@@ -30,6 +30,7 @@ typedef struct H264ChromaContext {
void ff_h264chroma_init(H264ChromaContext *c, int bit_depth);
+void ff_h264chroma_init_aarch64(H264ChromaContext *c, int bit_depth);
void ff_h264chroma_init_arm(H264ChromaContext *c, int bit_depth);
void ff_h264chroma_init_ppc(H264ChromaContext *c, int bit_depth);
void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth);
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264chroma_template.c b/chromium/third_party/ffmpeg/libavcodec/h264chroma_template.c
index b64172aadfd..072b5e03f75 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264chroma_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264chroma_template.c
@@ -42,7 +42,7 @@ static void FUNCC(OPNAME ## h264_chroma_mc1)(uint8_t *_dst/*align 8*/, uint8_t *
dst+= stride;\
src+= stride;\
}\
- }else{\
+ } else if (B + C) {\
const int E= B+C;\
const int step= C ? stride : 1;\
for(i=0; i<h; i++){\
@@ -50,6 +50,12 @@ static void FUNCC(OPNAME ## h264_chroma_mc1)(uint8_t *_dst/*align 8*/, uint8_t *
dst+= stride;\
src+= stride;\
}\
+ } else {\
+ for(i=0; i<h; i++){\
+ OP(dst[0], (A*src[0]));\
+ dst+= stride;\
+ src+= stride;\
+ }\
}\
}\
static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\
@@ -71,7 +77,7 @@ static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t *
dst+= stride;\
src+= stride;\
}\
- }else{\
+ } else if (B + C) {\
const int E= B+C;\
const int step= C ? stride : 1;\
for(i=0; i<h; i++){\
@@ -80,6 +86,13 @@ static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t *
dst+= stride;\
src+= stride;\
}\
+ } else {\
+ for ( i = 0; i < h; i++){\
+ OP(dst[0], A * src[0]);\
+ OP(dst[1], A * src[1]);\
+ dst += stride;\
+ src += stride;\
+ }\
}\
}\
\
@@ -104,7 +117,7 @@ static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst/*align 8*/, uint8_t *
dst+= stride;\
src+= stride;\
}\
- }else{\
+ } else if (B + C) {\
const int E= B+C;\
const int step= C ? stride : 1;\
for(i=0; i<h; i++){\
@@ -115,6 +128,15 @@ static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst/*align 8*/, uint8_t *
dst+= stride;\
src+= stride;\
}\
+ } else {\
+ for ( i = 0; i < h; i++){\
+ OP(dst[0], A * src[0]);\
+ OP(dst[1], A * src[1]);\
+ OP(dst[2], A * src[2]);\
+ OP(dst[3], A * src[3]);\
+ dst += stride;\
+ src += stride;\
+ }\
}\
}\
\
@@ -143,7 +165,7 @@ static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst/*align 8*/, uint8_t *
dst+= stride;\
src+= stride;\
}\
- }else{\
+ } else if (B + C) {\
const int E= B+C;\
const int step= C ? stride : 1;\
for(i=0; i<h; i++){\
@@ -158,6 +180,19 @@ static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst/*align 8*/, uint8_t *
dst+= stride;\
src+= stride;\
}\
+ } else {\
+ for ( i = 0; i < h; i++){\
+ OP(dst[0], A * src[0]);\
+ OP(dst[1], A * src[1]);\
+ OP(dst[2], A * src[2]);\
+ OP(dst[3], A * src[3]);\
+ OP(dst[4], A * src[4]);\
+ OP(dst[5], A * src[5]);\
+ OP(dst[6], A * src[6]);\
+ OP(dst[7], A * src[7]);\
+ dst += stride;\
+ src += stride;\
+ }\
}\
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264data.h b/chromium/third_party/ffmpeg/libavcodec/h264data.h
index eb229f3f4d8..38f32583f60 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264data.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264data.h
@@ -32,7 +32,6 @@
#include <stdint.h>
#include "libavutil/rational.h"
-#include "mpegvideo.h"
#include "h264.h"
static const uint8_t golomb_to_pict_type[5] = {
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264dsp.c b/chromium/third_party/ffmpeg/libavcodec/h264dsp.c
index 1606e116b68..a4da7764ed4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264dsp.c
@@ -33,6 +33,7 @@
#include "avcodec.h"
#include "h264dsp.h"
#include "h264idct.h"
+#include "startcode.h"
#include "libavutil/common.h"
#define BIT_DEPTH 8
@@ -63,34 +64,6 @@
#include "h264addpx_template.c"
#undef BIT_DEPTH
-static int h264_find_start_code_candidate_c(const uint8_t *buf, int size)
-{
- int i = 0;
-#if HAVE_FAST_UNALIGNED
- /* we check i < size instead of i + 3 / 7 because it is
- * simpler and there must be FF_INPUT_BUFFER_PADDING_SIZE
- * bytes at the end.
- */
-# if HAVE_FAST_64BIT
- while (i < size &&
- !((~*(const uint64_t *)(buf + i) &
- (*(const uint64_t *)(buf + i) - 0x0101010101010101ULL)) &
- 0x8080808080808080ULL))
- i += 8;
-# else
- while (i < size &&
- !((~*(const uint32_t *)(buf + i) &
- (*(const uint32_t *)(buf + i) - 0x01010101U)) &
- 0x80808080U))
- i += 4;
-# endif
-#endif
- for (; i < size; i++)
- if (!buf[i])
- break;
- return i;
-}
-
av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,
const int chroma_format_idc)
{
@@ -114,13 +87,13 @@ av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,
c->h264_idct8_dc_add= FUNC(ff_h264_idct8_dc_add, depth);\
c->h264_idct_add16 = FUNC(ff_h264_idct_add16, depth);\
c->h264_idct8_add4 = FUNC(ff_h264_idct8_add4, depth);\
- if (chroma_format_idc == 1)\
+ if (chroma_format_idc <= 1)\
c->h264_idct_add8 = FUNC(ff_h264_idct_add8, depth);\
else\
c->h264_idct_add8 = FUNC(ff_h264_idct_add8_422, depth);\
c->h264_idct_add16intra= FUNC(ff_h264_idct_add16intra, depth);\
c->h264_luma_dc_dequant_idct= FUNC(ff_h264_luma_dc_dequant_idct, depth);\
- if (chroma_format_idc == 1)\
+ if (chroma_format_idc <= 1)\
c->h264_chroma_dc_dequant_idct= FUNC(ff_h264_chroma_dc_dequant_idct, depth);\
else\
c->h264_chroma_dc_dequant_idct= FUNC(ff_h264_chroma422_dc_dequant_idct, depth);\
@@ -141,20 +114,20 @@ av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,
c->h264_h_loop_filter_luma_intra= FUNC(h264_h_loop_filter_luma_intra, depth);\
c->h264_h_loop_filter_luma_mbaff_intra= FUNC(h264_h_loop_filter_luma_mbaff_intra, depth);\
c->h264_v_loop_filter_chroma= FUNC(h264_v_loop_filter_chroma, depth);\
- if (chroma_format_idc == 1)\
+ if (chroma_format_idc <= 1)\
c->h264_h_loop_filter_chroma= FUNC(h264_h_loop_filter_chroma, depth);\
else\
c->h264_h_loop_filter_chroma= FUNC(h264_h_loop_filter_chroma422, depth);\
- if (chroma_format_idc == 1)\
+ if (chroma_format_idc <= 1)\
c->h264_h_loop_filter_chroma_mbaff= FUNC(h264_h_loop_filter_chroma_mbaff, depth);\
else\
c->h264_h_loop_filter_chroma_mbaff= FUNC(h264_h_loop_filter_chroma422_mbaff, depth);\
c->h264_v_loop_filter_chroma_intra= FUNC(h264_v_loop_filter_chroma_intra, depth);\
- if (chroma_format_idc == 1)\
+ if (chroma_format_idc <= 1)\
c->h264_h_loop_filter_chroma_intra= FUNC(h264_h_loop_filter_chroma_intra, depth);\
else\
c->h264_h_loop_filter_chroma_intra= FUNC(h264_h_loop_filter_chroma422_intra, depth);\
- if (chroma_format_idc == 1)\
+ if (chroma_format_idc <= 1)\
c->h264_h_loop_filter_chroma_mbaff_intra= FUNC(h264_h_loop_filter_chroma_mbaff_intra, depth);\
else\
c->h264_h_loop_filter_chroma_mbaff_intra= FUNC(h264_h_loop_filter_chroma422_mbaff_intra, depth);\
@@ -178,8 +151,9 @@ av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,
H264_DSP(8);
break;
}
- c->h264_find_start_code_candidate = h264_find_start_code_candidate_c;
+ c->h264_find_start_code_candidate = ff_startcode_find_candidate_c;
+ if (ARCH_AARCH64) ff_h264dsp_init_aarch64(c, bit_depth, chroma_format_idc);
if (ARCH_ARM) ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc);
if (ARCH_PPC) ff_h264dsp_init_ppc(c, bit_depth, chroma_format_idc);
if (ARCH_X86) ff_h264dsp_init_x86(c, bit_depth, chroma_format_idc);
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264dsp.h b/chromium/third_party/ffmpeg/libavcodec/h264dsp.h
index 1be48041751..2a0139cdb3b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264dsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264dsp.h
@@ -118,6 +118,8 @@ typedef struct H264DSPContext {
void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,
const int chroma_format_idc);
+void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
+ const int chroma_format_idc);
void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth,
const int chroma_format_idc);
void ff_h264dsp_init_ppc(H264DSPContext *c, const int bit_depth,
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264idct_template.c b/chromium/third_party/ffmpeg/libavcodec/h264idct_template.c
index 42c32d15eda..abf888ed960 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264idct_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264idct_template.c
@@ -28,6 +28,7 @@
#include "bit_depth_template.c"
#include "libavutil/common.h"
#include "h264.h"
+#include "h264idct.h"
void FUNCC(ff_h264_idct_add)(uint8_t *_dst, int16_t *_block, int stride)
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264pred.c b/chromium/third_party/ffmpeg/libavcodec/h264pred.c
index 3a96654e3c3..044fc90c4eb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264pred.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264pred.c
@@ -27,9 +27,9 @@
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
-#include "dsputil.h"
+#include "libavutil/intreadwrite.h"
+#include "avcodec.h"
#include "h264pred.h"
-#include "avcodec.h" // for AV_CODEC_ID_*
#define BIT_DEPTH 8
#include "h264pred_template.c"
@@ -279,7 +279,7 @@ static void pred4x4_horizontal_up_rv40_nodown_c(uint8_t *src,
static void pred4x4_tm_vp8_c(uint8_t *src, const uint8_t *topright,
ptrdiff_t stride)
{
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP - src[-1-stride];
uint8_t *top = src-stride;
int y;
@@ -305,7 +305,7 @@ static void pred16x16_plane_rv40_c(uint8_t *src, ptrdiff_t stride)
static void pred16x16_tm_vp8_c(uint8_t *src, ptrdiff_t stride)
{
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP - src[-1-stride];
uint8_t *top = src-stride;
int y;
@@ -387,7 +387,7 @@ static void pred8x8_dc_rv40_c(uint8_t *src, ptrdiff_t stride)
static void pred8x8_tm_vp8_c(uint8_t *src, ptrdiff_t stride)
{
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP - src[-1-stride];
uint8_t *top = src-stride;
int y;
@@ -420,7 +420,7 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
#define H264_PRED(depth) \
if(codec_id != AV_CODEC_ID_RV40){\
- if(codec_id == AV_CODEC_ID_VP8) {\
+ if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {\
h->pred4x4[VERT_PRED ]= FUNCD(pred4x4_vertical_vp8);\
h->pred4x4[HOR_PRED ]= FUNCD(pred4x4_horizontal_vp8);\
} else {\
@@ -435,15 +435,14 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred4x4[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred4x4_down_right , depth);\
h->pred4x4[VERT_RIGHT_PRED ]= FUNCC(pred4x4_vertical_right , depth);\
h->pred4x4[HOR_DOWN_PRED ]= FUNCC(pred4x4_horizontal_down , depth);\
- if (codec_id == AV_CODEC_ID_VP8) {\
+ if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {\
h->pred4x4[VERT_LEFT_PRED ]= FUNCD(pred4x4_vertical_left_vp8);\
} else\
h->pred4x4[VERT_LEFT_PRED ]= FUNCC(pred4x4_vertical_left , depth);\
h->pred4x4[HOR_UP_PRED ]= FUNCC(pred4x4_horizontal_up , depth);\
- if(codec_id != AV_CODEC_ID_VP8) {\
+ if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8) {\
h->pred4x4[LEFT_DC_PRED ]= FUNCC(pred4x4_left_dc , depth);\
h->pred4x4[TOP_DC_PRED ]= FUNCC(pred4x4_top_dc , depth);\
- h->pred4x4[DC_128_PRED ]= FUNCC(pred4x4_128_dc , depth);\
} else {\
h->pred4x4[TM_VP8_PRED ]= FUNCD(pred4x4_tm_vp8);\
h->pred4x4[DC_127_PRED ]= FUNCC(pred4x4_127_dc , depth);\
@@ -451,6 +450,8 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred4x4[VERT_VP8_PRED ]= FUNCC(pred4x4_vertical , depth);\
h->pred4x4[HOR_VP8_PRED ]= FUNCC(pred4x4_horizontal , depth);\
}\
+ if (codec_id != AV_CODEC_ID_VP8)\
+ h->pred4x4[DC_128_PRED ]= FUNCC(pred4x4_128_dc , depth);\
}else{\
h->pred4x4[VERT_PRED ]= FUNCC(pred4x4_vertical , depth);\
h->pred4x4[HOR_PRED ]= FUNCC(pred4x4_horizontal , depth);\
@@ -482,23 +483,24 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred8x8l[TOP_DC_PRED ]= FUNCC(pred8x8l_top_dc , depth);\
h->pred8x8l[DC_128_PRED ]= FUNCC(pred8x8l_128_dc , depth);\
\
- if (chroma_format_idc == 1) {\
+ if (chroma_format_idc <= 1) {\
h->pred8x8[VERT_PRED8x8 ]= FUNCC(pred8x8_vertical , depth);\
h->pred8x8[HOR_PRED8x8 ]= FUNCC(pred8x8_horizontal , depth);\
} else {\
h->pred8x8[VERT_PRED8x8 ]= FUNCC(pred8x16_vertical , depth);\
h->pred8x8[HOR_PRED8x8 ]= FUNCC(pred8x16_horizontal , depth);\
}\
- if (codec_id != AV_CODEC_ID_VP8) {\
- if (chroma_format_idc == 1) {\
+ if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8) {\
+ if (chroma_format_idc <= 1) {\
h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x8_plane , depth);\
} else {\
h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x16_plane , depth);\
}\
} else\
h->pred8x8[PLANE_PRED8x8]= FUNCD(pred8x8_tm_vp8);\
- if(codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP8){\
- if (chroma_format_idc == 1) {\
+ if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7 && \
+ codec_id != AV_CODEC_ID_VP8) {\
+ if (chroma_format_idc <= 1) {\
h->pred8x8[DC_PRED8x8 ]= FUNCC(pred8x8_dc , depth);\
h->pred8x8[LEFT_DC_PRED8x8]= FUNCC(pred8x8_left_dc , depth);\
h->pred8x8[TOP_DC_PRED8x8 ]= FUNCC(pred8x8_top_dc , depth);\
@@ -519,12 +521,12 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred8x8[DC_PRED8x8 ]= FUNCD(pred8x8_dc_rv40);\
h->pred8x8[LEFT_DC_PRED8x8]= FUNCD(pred8x8_left_dc_rv40);\
h->pred8x8[TOP_DC_PRED8x8 ]= FUNCD(pred8x8_top_dc_rv40);\
- if (codec_id == AV_CODEC_ID_VP8) {\
+ if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {\
h->pred8x8[DC_127_PRED8x8]= FUNCC(pred8x8_127_dc , depth);\
h->pred8x8[DC_129_PRED8x8]= FUNCC(pred8x8_129_dc , depth);\
}\
}\
- if (chroma_format_idc == 1) {\
+ if (chroma_format_idc <= 1) {\
h->pred8x8[DC_128_PRED8x8 ]= FUNCC(pred8x8_128_dc , depth);\
} else {\
h->pred8x8[DC_128_PRED8x8 ]= FUNCC(pred8x16_128_dc , depth);\
@@ -540,6 +542,7 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
case AV_CODEC_ID_RV40:\
h->pred16x16[PLANE_PRED8x8 ]= FUNCD(pred16x16_plane_rv40);\
break;\
+ case AV_CODEC_ID_VP7:\
case AV_CODEC_ID_VP8:\
h->pred16x16[PLANE_PRED8x8 ]= FUNCD(pred16x16_tm_vp8);\
h->pred16x16[DC_127_PRED8x8]= FUNCC(pred16x16_127_dc , depth);\
@@ -558,7 +561,9 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred4x4_add [ HOR_PRED ]= FUNCC(pred4x4_horizontal_add , depth);\
h->pred8x8l_add [VERT_PRED ]= FUNCC(pred8x8l_vertical_add , depth);\
h->pred8x8l_add [ HOR_PRED ]= FUNCC(pred8x8l_horizontal_add , depth);\
- if (chroma_format_idc == 1) {\
+ h->pred8x8l_filter_add [VERT_PRED ]= FUNCC(pred8x8l_vertical_filter_add , depth);\
+ h->pred8x8l_filter_add [ HOR_PRED ]= FUNCC(pred8x8l_horizontal_filter_add , depth);\
+ if (chroma_format_idc <= 1) {\
h->pred8x8_add [VERT_PRED8x8]= FUNCC(pred8x8_vertical_add , depth);\
h->pred8x8_add [ HOR_PRED8x8]= FUNCC(pred8x8_horizontal_add , depth);\
} else {\
@@ -568,9 +573,6 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred16x16_add[VERT_PRED8x8]= FUNCC(pred16x16_vertical_add , depth);\
h->pred16x16_add[ HOR_PRED8x8]= FUNCC(pred16x16_horizontal_add , depth);\
- if(!chroma_format_idc)
- chroma_format_idc = 1;
-
switch (bit_depth) {
case 9:
H264_PRED(9)
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264pred.h b/chromium/third_party/ffmpeg/libavcodec/h264pred.h
index ed67d2ef43e..67082920487 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264pred.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264pred.h
@@ -60,7 +60,7 @@
#define VERT_VP8_PRED 10 ///< for VP8, #VERT_PRED is the average of
///< (left col+cur col x2+right col) / 4;
///< this is the "unaveraged" one
-#define HOR_VP8_PRED 11 ///< unaveraged version of #HOR_PRED, see
+#define HOR_VP8_PRED 14 ///< unaveraged version of #HOR_PRED, see
///< #VERT_VP8_PRED for details
#define DC_127_PRED 12
#define DC_129_PRED 13
@@ -101,6 +101,8 @@ typedef struct H264PredContext {
int16_t *block /*align 16*/, ptrdiff_t stride);
void(*pred8x8l_add[2])(uint8_t *pix /*align 8*/,
int16_t *block /*align 16*/, ptrdiff_t stride);
+ void(*pred8x8l_filter_add[2])(uint8_t *pix /*align 8*/,
+ int16_t *block /*align 16*/, int topleft, int topright, ptrdiff_t stride);
void(*pred8x8_add[3])(uint8_t *pix /*align 8*/,
const int *block_offset,
int16_t *block /*align 16*/, ptrdiff_t stride);
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264pred_template.c b/chromium/third_party/ffmpeg/libavcodec/h264pred_template.c
index 8d8d62e0b6f..f684433abef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264pred_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264pred_template.c
@@ -25,6 +25,8 @@
* @author Michael Niedermayer <michaelni@gmx.at>
*/
+#include "libavutil/intreadwrite.h"
+
#include "mathops.h"
#include "bit_depth_template.c"
@@ -1122,6 +1124,79 @@ static void FUNCC(pred8x8l_horizontal_up)(uint8_t *_src, int has_topleft,
SRC(5,6)=SRC(5,7)=SRC(6,4)=SRC(6,5)=SRC(6,6)=
SRC(6,7)=SRC(7,4)=SRC(7,5)=SRC(7,6)=SRC(7,7)= l7;
}
+
+static void FUNCC(pred8x8l_vertical_filter_add)(uint8_t *_src, int16_t *_block, int has_topleft,
+ int has_topright, ptrdiff_t _stride)
+{
+ int i;
+ pixel *src = (pixel*)_src;
+ const dctcoef *block = (const dctcoef*)_block;
+ pixel pix[8];
+ int stride = _stride>>(sizeof(pixel)-1);
+ PREDICT_8x8_LOAD_TOP;
+
+ pix[0] = t0;
+ pix[1] = t1;
+ pix[2] = t2;
+ pix[3] = t3;
+ pix[4] = t4;
+ pix[5] = t5;
+ pix[6] = t6;
+ pix[7] = t7;
+
+ for(i=0; i<8; i++){
+ pixel v = pix[i];
+ src[0*stride]= v += block[0];
+ src[1*stride]= v += block[8];
+ src[2*stride]= v += block[16];
+ src[3*stride]= v += block[24];
+ src[4*stride]= v += block[32];
+ src[5*stride]= v += block[40];
+ src[6*stride]= v += block[48];
+ src[7*stride]= v + block[56];
+ src++;
+ block++;
+ }
+
+ memset(_block, 0, sizeof(dctcoef) * 64);
+}
+
+static void FUNCC(pred8x8l_horizontal_filter_add)(uint8_t *_src, int16_t *_block, int has_topleft,
+ int has_topright, ptrdiff_t _stride)
+{
+ int i;
+ pixel *src = (pixel*)_src;
+ const dctcoef *block = (const dctcoef*)_block;
+ pixel pix[8];
+ int stride = _stride>>(sizeof(pixel)-1);
+ PREDICT_8x8_LOAD_LEFT;
+
+ pix[0] = l0;
+ pix[1] = l1;
+ pix[2] = l2;
+ pix[3] = l3;
+ pix[4] = l4;
+ pix[5] = l5;
+ pix[6] = l6;
+ pix[7] = l7;
+
+ for(i=0; i<8; i++){
+ pixel v = pix[i];
+ src[0]= v += block[0];
+ src[1]= v += block[1];
+ src[2]= v += block[2];
+ src[3]= v += block[3];
+ src[4]= v += block[4];
+ src[5]= v += block[5];
+ src[6]= v += block[6];
+ src[7]= v + block[7];
+ src+= stride;
+ block+= 8;
+ }
+
+ memset(_block, 0, sizeof(dctcoef) * 64);
+}
+
#undef PREDICT_8x8_LOAD_LEFT
#undef PREDICT_8x8_LOAD_TOP
#undef PREDICT_8x8_LOAD_TOPLEFT
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264qpel.c b/chromium/third_party/ffmpeg/libavcodec/h264qpel.c
index 7c86d2a2a94..5f1bfa31764 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264qpel.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264qpel.c
@@ -96,6 +96,8 @@ av_cold void ff_h264qpel_init(H264QpelContext *c, int bit_depth)
break;
}
+ if (ARCH_AARCH64)
+ ff_h264qpel_init_aarch64(c, bit_depth);
if (ARCH_ARM)
ff_h264qpel_init_arm(c, bit_depth);
if (ARCH_PPC)
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264qpel.h b/chromium/third_party/ffmpeg/libavcodec/h264qpel.h
index 6abfac042c5..041ee7d14bf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264qpel.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264qpel.h
@@ -31,6 +31,7 @@ typedef struct H264QpelContext {
void ff_h264qpel_init(H264QpelContext *c, int bit_depth);
+void ff_h264qpel_init_aarch64(H264QpelContext *c, int bit_depth);
void ff_h264qpel_init_arm(H264QpelContext *c, int bit_depth);
void ff_h264qpel_init_ppc(H264QpelContext *c, int bit_depth);
void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth);
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264qpel_template.c b/chromium/third_party/ffmpeg/libavcodec/h264qpel_template.c
index 48eb8c874b8..cb421b53093 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264qpel_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264qpel_template.c
@@ -20,8 +20,11 @@
*/
#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
+
#include "bit_depth_template.c"
#include "hpel_template.c"
+#include "tpel_template.c"
static inline void FUNC(copy_block2)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc.c b/chromium/third_party/ffmpeg/libavcodec/hevc.c
index 4294760bb72..6fadef3d231 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc.c
@@ -30,6 +30,7 @@
#include "libavutil/md5.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
+#include "libavutil/stereo3d.h"
#include "bytestream.h"
#include "cabac_functions.h"
@@ -37,9 +38,7 @@
#include "golomb.h"
#include "hevc.h"
-const uint8_t ff_hevc_qpel_extra_before[4] = { 0, 3, 3, 2 };
-const uint8_t ff_hevc_qpel_extra_after[4] = { 0, 3, 4, 4 };
-const uint8_t ff_hevc_qpel_extra[4] = { 0, 6, 7, 6 };
+const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12] = 4, [16] = 5, [24] = 6, [32] = 7, [48] = 8, [64] = 9 };
/**
* NOTE: Each function hls_foo correspond to the function foo in the
@@ -106,7 +105,7 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps)
goto fail;
s->cbf_luma = av_malloc(sps->min_tb_width * sps->min_tb_height);
- s->tab_ipm = av_malloc(min_pu_size);
+ s->tab_ipm = av_mallocz(min_pu_size);
s->is_pcm = av_malloc(min_pu_size);
if (!s->tab_ipm || !s->cbf_luma || !s->is_pcm)
goto fail;
@@ -125,7 +124,7 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps)
goto fail;
s->tab_mvf_pool = av_buffer_pool_init(min_pu_size * sizeof(MvField),
- av_buffer_alloc);
+ av_buffer_allocz);
s->rpl_tab_pool = av_buffer_pool_init(ctb_count * sizeof(RefPicListTab),
av_buffer_allocz);
if (!s->tab_mvf_pool || !s->rpl_tab_pool)
@@ -150,7 +149,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
s->sh.luma_log2_weight_denom = get_ue_golomb_long(gb);
if (s->sps->chroma_format_idc != 0) {
int delta = get_se_golomb(gb);
- s->sh.chroma_log2_weight_denom = av_clip_c(s->sh.luma_log2_weight_denom + delta, 0, 7);
+ s->sh.chroma_log2_weight_denom = av_clip(s->sh.luma_log2_weight_denom + delta, 0, 7);
}
for (i = 0; i < s->sh.nb_refs[L0]; i++) {
@@ -178,7 +177,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
int delta_chroma_weight_l0 = get_se_golomb(gb);
int delta_chroma_offset_l0 = get_se_golomb(gb);
s->sh.chroma_weight_l0[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l0;
- s->sh.chroma_offset_l0[i][j] = av_clip_c((delta_chroma_offset_l0 - ((128 * s->sh.chroma_weight_l0[i][j])
+ s->sh.chroma_offset_l0[i][j] = av_clip((delta_chroma_offset_l0 - ((128 * s->sh.chroma_weight_l0[i][j])
>> s->sh.chroma_log2_weight_denom) + 128), -128, 127);
}
} else {
@@ -214,7 +213,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
int delta_chroma_weight_l1 = get_se_golomb(gb);
int delta_chroma_offset_l1 = get_se_golomb(gb);
s->sh.chroma_weight_l1[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l1;
- s->sh.chroma_offset_l1[i][j] = av_clip_c((delta_chroma_offset_l1 - ((128 * s->sh.chroma_weight_l1[i][j])
+ s->sh.chroma_offset_l1[i][j] = av_clip((delta_chroma_offset_l1 - ((128 * s->sh.chroma_weight_l1[i][j])
>> s->sh.chroma_log2_weight_denom) + 128), -128, 127);
}
} else {
@@ -232,7 +231,7 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
const HEVCSPS *sps = s->sps;
int max_poc_lsb = 1 << sps->log2_max_poc_lsb;
int prev_delta_msb = 0;
- int nb_sps = 0, nb_sh;
+ unsigned int nb_sps = 0, nb_sh;
int i;
rps->nb_refs = 0;
@@ -282,6 +281,7 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
static int set_sps(HEVCContext *s, const HEVCSPS *sps)
{
int ret;
+ unsigned int num = 0, den = 0;
pic_arrays_free(s);
ret = pic_arrays_init(s, sps);
@@ -326,6 +326,19 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
s->sps = sps;
s->vps = (HEVCVPS*) s->vps_list[s->sps->vps_id]->data;
+
+ if (s->vps->vps_timing_info_present_flag) {
+ num = s->vps->vps_num_units_in_tick;
+ den = s->vps->vps_time_scale;
+ } else if (sps->vui.vui_timing_info_present_flag) {
+ num = sps->vui.vui_num_units_in_tick;
+ den = sps->vui.vui_time_scale;
+ }
+
+ if (num != 0 && den != 0)
+ av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den,
+ num, den, 1 << 30);
+
return 0;
fail:
@@ -334,6 +347,17 @@ fail:
return ret;
}
+static int is_sps_exist(HEVCContext *s, const HEVCSPS* last_sps)
+{
+ int i;
+
+ for( i = 0; i < MAX_SPS_COUNT; i++)
+ if(s->sps_list[i])
+ if (last_sps == (HEVCSPS*)s->sps_list[i]->data)
+ return 1;
+ return 0;
+}
+
static int hls_slice_header(HEVCContext *s)
{
GetBitContext *gb = &s->HEVClc->gb;
@@ -348,8 +372,11 @@ static int hls_slice_header(HEVCContext *s)
if (IS_IDR(s))
ff_hevc_clear_refs(s);
}
+ sh->no_output_of_prior_pics_flag = 0;
if (s->nal_unit_type >= 16 && s->nal_unit_type <= 23)
sh->no_output_of_prior_pics_flag = get_bits1(gb);
+ if (s->nal_unit_type == NAL_CRA_NUT && s->last_eos == 1)
+ sh->no_output_of_prior_pics_flag = 1;
sh->pps_id = get_ue_golomb_long(gb);
if (sh->pps_id >= MAX_PPS_COUNT || !s->pps_list[sh->pps_id]) {
@@ -364,7 +391,16 @@ static int hls_slice_header(HEVCContext *s)
s->pps = (HEVCPPS*)s->pps_list[sh->pps_id]->data;
if (s->sps != (HEVCSPS*)s->sps_list[s->pps->sps_id]->data) {
+ const HEVCSPS* last_sps = s->sps;
s->sps = (HEVCSPS*)s->sps_list[s->pps->sps_id]->data;
+ if (last_sps) {
+ if (is_sps_exist(s, last_sps)) {
+ if (s->sps->width != last_sps->width || s->sps->height != last_sps->height ||
+ s->sps->temporal_layer[s->sps->max_sub_layers - 1].max_dec_pic_buffering != last_sps->temporal_layer[last_sps->max_sub_layers - 1].max_dec_pic_buffering)
+ sh->no_output_of_prior_pics_flag = 0;
+ } else
+ sh->no_output_of_prior_pics_flag = 0;
+ }
ff_hevc_clear_refs(s);
ret = set_sps(s, s->sps);
if (ret < 0)
@@ -374,8 +410,8 @@ static int hls_slice_header(HEVCContext *s)
s->max_ra = INT_MAX;
}
- s->avctx->profile = s->sps->ptl.general_PTL.profile_idc;
- s->avctx->level = s->sps->ptl.general_PTL.level_idc;
+ s->avctx->profile = s->sps->ptl.general_ptl.profile_idc;
+ s->avctx->level = s->sps->ptl.general_ptl.level_idc;
sh->dependent_slice_segment_flag = 0;
if (!sh->first_slice_in_pic_flag) {
@@ -423,6 +459,7 @@ static int hls_slice_header(HEVCContext *s)
return AVERROR_INVALIDDATA;
}
+ sh->pic_output_flag = 1;
if (s->pps->output_flag_present_flag)
sh->pic_output_flag = get_bits1(gb);
@@ -582,6 +619,7 @@ static int hls_slice_header(HEVCContext *s)
}
sh->slice_qp_delta = get_se_golomb(gb);
+
if (s->pps->pic_slice_level_chroma_qp_offsets_present_flag) {
sh->slice_cb_qp_offset = get_se_golomb(gb);
sh->slice_cr_qp_offset = get_se_golomb(gb);
@@ -639,6 +677,11 @@ static int hls_slice_header(HEVCContext *s)
sh->entry_point_offset = av_malloc(sh->num_entry_point_offsets * sizeof(int));
sh->offset = av_malloc(sh->num_entry_point_offsets * sizeof(int));
sh->size = av_malloc(sh->num_entry_point_offsets * sizeof(int));
+ if (!sh->entry_point_offset || !sh->offset || !sh->size) {
+ sh->num_entry_point_offsets = 0;
+ av_log(s->avctx, AV_LOG_ERROR, "Failed to allocate memory\n");
+ return AVERROR(ENOMEM);
+ }
for (i = 0; i < sh->num_entry_point_offsets; i++) {
int val = 0;
for (j = 0; j < segments; j++) {
@@ -661,20 +704,34 @@ static int hls_slice_header(HEVCContext *s)
}
if (s->pps->slice_header_extension_present_flag) {
- int length = get_ue_golomb_long(gb);
+ unsigned int length = get_ue_golomb_long(gb);
for (i = 0; i < length; i++)
skip_bits(gb, 8); // slice_header_extension_data_byte
}
// Inferred parameters
- sh->slice_qp = 26 + s->pps->pic_init_qp_minus26 + sh->slice_qp_delta;
+ sh->slice_qp = 26U + s->pps->pic_init_qp_minus26 + sh->slice_qp_delta;
+ if (sh->slice_qp > 51 ||
+ sh->slice_qp < -s->sps->qp_bd_offset) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "The slice_qp %d is outside the valid range "
+ "[%d, 51].\n",
+ sh->slice_qp,
+ -s->sps->qp_bd_offset);
+ return AVERROR_INVALIDDATA;
+ }
+
sh->slice_ctb_addr_rs = sh->slice_segment_addr;
+ if (!s->sh.slice_ctb_addr_rs && s->sh.dependent_slice_segment_flag) {
+ av_log(s->avctx, AV_LOG_ERROR, "Impossible slice segment.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
s->HEVClc->first_qp_group = !s->sh.dependent_slice_segment_flag;
if (!s->pps->cu_qp_delta_enabled_flag)
- s->HEVClc->qp_y = ((s->sh.slice_qp + 52 + 2 * s->sps->qp_bd_offset) %
- (52 + s->sps->qp_bd_offset)) - s->sps->qp_bd_offset;
+ s->HEVClc->qp_y = s->sh.slice_qp;
s->slice_initialized = 1;
@@ -766,10 +823,10 @@ static void hls_sao_param(HEVCContext *s, int rx, int ry)
#undef SET_SAO
#undef CTB
-static void hls_transform_unit(HEVCContext *s, int x0, int y0,
- int xBase, int yBase, int cb_xBase, int cb_yBase,
- int log2_cb_size, int log2_trafo_size,
- int trafo_depth, int blk_idx)
+static int hls_transform_unit(HEVCContext *s, int x0, int y0,
+ int xBase, int yBase, int cb_xBase, int cb_yBase,
+ int log2_cb_size, int log2_trafo_size,
+ int trafo_depth, int blk_idx)
{
HEVCLocalContext *lc = s->HEVClc;
@@ -804,6 +861,18 @@ static void hls_transform_unit(HEVCContext *s, int x0, int y0,
if (ff_hevc_cu_qp_delta_sign_flag(s) == 1)
lc->tu.cu_qp_delta = -lc->tu.cu_qp_delta;
lc->tu.is_cu_qp_delta_coded = 1;
+
+ if (lc->tu.cu_qp_delta < -(26 + s->sps->qp_bd_offset / 2) ||
+ lc->tu.cu_qp_delta > (25 + s->sps->qp_bd_offset / 2)) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "The cu_qp_delta %d is outside the valid range "
+ "[%d, %d].\n",
+ lc->tu.cu_qp_delta,
+ -(26 + s->sps->qp_bd_offset / 2),
+ (25 + s->sps->qp_bd_offset / 2));
+ return AVERROR_INVALIDDATA;
+ }
+
ff_hevc_set_qPy(s, x0, y0, cb_xBase, cb_yBase, log2_cb_size);
}
@@ -839,6 +908,7 @@ static void hls_transform_unit(HEVCContext *s, int x0, int y0,
ff_hevc_hls_residual_coding(s, xBase, yBase, log2_trafo_size, scan_idx_c, 2);
}
}
+ return 0;
}
static void set_deblocking_bypass(HEVCContext *s, int x0, int y0, int log2_cb_size)
@@ -856,13 +926,14 @@ static void set_deblocking_bypass(HEVCContext *s, int x0, int y0, int log2_cb_si
s->is_pcm[i + j * min_pu_width] = 2;
}
-static void hls_transform_tree(HEVCContext *s, int x0, int y0,
- int xBase, int yBase, int cb_xBase, int cb_yBase,
- int log2_cb_size, int log2_trafo_size,
- int trafo_depth, int blk_idx)
+static int hls_transform_tree(HEVCContext *s, int x0, int y0,
+ int xBase, int yBase, int cb_xBase, int cb_yBase,
+ int log2_cb_size, int log2_trafo_size,
+ int trafo_depth, int blk_idx)
{
HEVCLocalContext *lc = s->HEVClc;
uint8_t split_transform_flag;
+ int ret;
if (trafo_depth > 0 && log2_trafo_size == 2) {
SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) =
@@ -917,14 +988,26 @@ static void hls_transform_tree(HEVCContext *s, int x0, int y0,
int x1 = x0 + ((1 << log2_trafo_size) >> 1);
int y1 = y0 + ((1 << log2_trafo_size) >> 1);
- hls_transform_tree(s, x0, y0, x0, y0, cb_xBase, cb_yBase, log2_cb_size,
- log2_trafo_size - 1, trafo_depth + 1, 0);
- hls_transform_tree(s, x1, y0, x0, y0, cb_xBase, cb_yBase, log2_cb_size,
- log2_trafo_size - 1, trafo_depth + 1, 1);
- hls_transform_tree(s, x0, y1, x0, y0, cb_xBase, cb_yBase, log2_cb_size,
- log2_trafo_size - 1, trafo_depth + 1, 2);
- hls_transform_tree(s, x1, y1, x0, y0, cb_xBase, cb_yBase, log2_cb_size,
- log2_trafo_size - 1, trafo_depth + 1, 3);
+ ret = hls_transform_tree(s, x0, y0, x0, y0, cb_xBase, cb_yBase,
+ log2_cb_size, log2_trafo_size - 1,
+ trafo_depth + 1, 0);
+ if (ret < 0)
+ return ret;
+ ret = hls_transform_tree(s, x1, y0, x0, y0, cb_xBase, cb_yBase,
+ log2_cb_size, log2_trafo_size - 1,
+ trafo_depth + 1, 1);
+ if (ret < 0)
+ return ret;
+ ret = hls_transform_tree(s, x0, y1, x0, y0, cb_xBase, cb_yBase,
+ log2_cb_size, log2_trafo_size - 1,
+ trafo_depth + 1, 2);
+ if (ret < 0)
+ return ret;
+ ret = hls_transform_tree(s, x1, y1, x0, y0, cb_xBase, cb_yBase,
+ log2_cb_size, log2_trafo_size - 1,
+ trafo_depth + 1, 3);
+ if (ret < 0)
+ return ret;
} else {
int min_tu_size = 1 << s->sps->log2_min_tb_size;
int log2_min_tu_size = s->sps->log2_min_tb_size;
@@ -936,9 +1019,11 @@ static void hls_transform_tree(HEVCContext *s, int x0, int y0,
lc->tt.cbf_luma = ff_hevc_cbf_luma_decode(s, trafo_depth);
}
- hls_transform_unit(s, x0, y0, xBase, yBase, cb_xBase, cb_yBase,
- log2_cb_size, log2_trafo_size, trafo_depth, blk_idx);
-
+ ret = hls_transform_unit(s, x0, y0, xBase, yBase, cb_xBase, cb_yBase,
+ log2_cb_size, log2_trafo_size, trafo_depth,
+ blk_idx);
+ if (ret < 0)
+ return ret;
// TODO: store cbf_luma somewhere else
if (lc->tt.cbf_luma) {
int i, j;
@@ -950,20 +1035,18 @@ static void hls_transform_tree(HEVCContext *s, int x0, int y0,
}
}
if (!s->sh.disable_deblocking_filter_flag) {
- ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_trafo_size,
- lc->slice_or_tiles_up_boundary,
- lc->slice_or_tiles_left_boundary);
+ ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_trafo_size);
if (s->pps->transquant_bypass_enable_flag &&
lc->cu.cu_transquant_bypass_flag)
set_deblocking_bypass(s, x0, y0, log2_trafo_size);
}
}
+ return 0;
}
static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
{
//TODO: non-4:2:0 support
- HEVCLocalContext *lc = s->HEVClc;
GetBitContext gb;
int cb_size = 1 << log2_cb_size;
int stride0 = s->frame->linesize[0];
@@ -977,9 +1060,8 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
const uint8_t *pcm = skip_bytes(&s->HEVClc->cc, (length + 7) >> 3);
int ret;
- ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size,
- lc->slice_or_tiles_up_boundary,
- lc->slice_or_tiles_left_boundary);
+ if (!s->sh.disable_deblocking_filter_flag)
+ ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size);
ret = init_get_bits(&gb, pcm, length);
if (ret < 0)
@@ -992,7 +1074,7 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
}
/**
- * 8.5.3.2.2.1 Luma sample interpolation process
+ * 8.5.3.2.2.1 Luma sample unidirectional interpolation process
*
* @param s HEVC decoding context
* @param dst target buffer for block data at block position
@@ -1003,45 +1085,148 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
* @param y_off vertical position of block from origin (0, 0)
* @param block_w width of block
* @param block_h height of block
+ * @param luma_weight weighting factor applied to the luma prediction
+ * @param luma_offset additive offset applied to the luma prediction value
*/
-static void luma_mc(HEVCContext *s, int16_t *dst, ptrdiff_t dststride,
- AVFrame *ref, const Mv *mv, int x_off, int y_off,
- int block_w, int block_h)
+
+static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
+ AVFrame *ref, const Mv *mv, int x_off, int y_off,
+ int block_w, int block_h, int luma_weight, int luma_offset)
{
HEVCLocalContext *lc = s->HEVClc;
uint8_t *src = ref->data[0];
ptrdiff_t srcstride = ref->linesize[0];
int pic_width = s->sps->width;
int pic_height = s->sps->height;
-
- int mx = mv->x & 3;
- int my = mv->y & 3;
- int extra_left = ff_hevc_qpel_extra_before[mx];
- int extra_top = ff_hevc_qpel_extra_before[my];
+ int mx = mv->x & 3;
+ int my = mv->y & 3;
+ int weight_flag = (s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
+ (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag);
+ int idx = ff_hevc_pel_weight[block_w];
x_off += mv->x >> 2;
y_off += mv->y >> 2;
src += y_off * srcstride + (x_off << s->sps->pixel_shift);
- if (x_off < extra_left || y_off < extra_top ||
- x_off >= pic_width - block_w - ff_hevc_qpel_extra_after[mx] ||
- y_off >= pic_height - block_h - ff_hevc_qpel_extra_after[my]) {
- int offset = extra_top * srcstride + (extra_left << s->sps->pixel_shift);
+ if (x_off < QPEL_EXTRA_BEFORE || y_off < QPEL_EXTRA_AFTER ||
+ x_off >= pic_width - block_w - QPEL_EXTRA_AFTER ||
+ y_off >= pic_height - block_h - QPEL_EXTRA_AFTER) {
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
+ int offset = QPEL_EXTRA_BEFORE * srcstride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
+ int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src - offset,
- srcstride, srcstride,
- block_w + ff_hevc_qpel_extra[mx],
- block_h + ff_hevc_qpel_extra[my],
- x_off - extra_left, y_off - extra_top,
+ edge_emu_stride, srcstride,
+ block_w + QPEL_EXTRA,
+ block_h + QPEL_EXTRA,
+ x_off - QPEL_EXTRA_BEFORE, y_off - QPEL_EXTRA_BEFORE,
+ pic_width, pic_height);
+ src = lc->edge_emu_buffer + buf_offset;
+ srcstride = edge_emu_stride;
+ }
+
+ if (!weight_flag)
+ s->hevcdsp.put_hevc_qpel_uni[idx][!!my][!!mx](dst, dststride, src, srcstride,
+ block_h, mx, my, block_w);
+ else
+ s->hevcdsp.put_hevc_qpel_uni_w[idx][!!my][!!mx](dst, dststride, src, srcstride,
+ block_h, s->sh.luma_log2_weight_denom,
+ luma_weight, luma_offset, mx, my, block_w);
+}
+
+/**
+ * 8.5.3.2.2.1 Luma sample bidirectional interpolation process
+ *
+ * @param s HEVC decoding context
+ * @param dst target buffer for block data at block position
+ * @param dststride stride of the dst buffer
+ * @param ref0 reference picture0 buffer at origin (0, 0)
+ * @param mv0 motion vector0 (relative to block position) to get pixel data from
+ * @param x_off horizontal position of block from origin (0, 0)
+ * @param y_off vertical position of block from origin (0, 0)
+ * @param block_w width of block
+ * @param block_h height of block
+ * @param ref1 reference picture1 buffer at origin (0, 0)
+ * @param mv1 motion vector1 (relative to block position) to get pixel data from
+ * @param current_mv current motion vector structure
+ */
+ static void luma_mc_bi(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
+ AVFrame *ref0, const Mv *mv0, int x_off, int y_off,
+ int block_w, int block_h, AVFrame *ref1, const Mv *mv1, struct MvField *current_mv)
+{
+ HEVCLocalContext *lc = s->HEVClc;
+ DECLARE_ALIGNED(16, int16_t, tmp[MAX_PB_SIZE * MAX_PB_SIZE]);
+ ptrdiff_t src0stride = ref0->linesize[0];
+ ptrdiff_t src1stride = ref1->linesize[0];
+ int pic_width = s->sps->width;
+ int pic_height = s->sps->height;
+ int mx0 = mv0->x & 3;
+ int my0 = mv0->y & 3;
+ int mx1 = mv1->x & 3;
+ int my1 = mv1->y & 3;
+ int weight_flag = (s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
+ (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag);
+ int x_off0 = x_off + (mv0->x >> 2);
+ int y_off0 = y_off + (mv0->y >> 2);
+ int x_off1 = x_off + (mv1->x >> 2);
+ int y_off1 = y_off + (mv1->y >> 2);
+ int idx = ff_hevc_pel_weight[block_w];
+
+ uint8_t *src0 = ref0->data[0] + y_off0 * src0stride + (int)((unsigned)x_off0 << s->sps->pixel_shift);
+ uint8_t *src1 = ref1->data[0] + y_off1 * src1stride + (int)((unsigned)x_off1 << s->sps->pixel_shift);
+
+ if (x_off0 < QPEL_EXTRA_BEFORE || y_off0 < QPEL_EXTRA_AFTER ||
+ x_off0 >= pic_width - block_w - QPEL_EXTRA_AFTER ||
+ y_off0 >= pic_height - block_h - QPEL_EXTRA_AFTER) {
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
+ int offset = QPEL_EXTRA_BEFORE * src0stride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
+ int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
+
+ s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src0 - offset,
+ edge_emu_stride, src0stride,
+ block_w + QPEL_EXTRA,
+ block_h + QPEL_EXTRA,
+ x_off0 - QPEL_EXTRA_BEFORE, y_off0 - QPEL_EXTRA_BEFORE,
+ pic_width, pic_height);
+ src0 = lc->edge_emu_buffer + buf_offset;
+ src0stride = edge_emu_stride;
+ }
+
+ if (x_off1 < QPEL_EXTRA_BEFORE || y_off1 < QPEL_EXTRA_AFTER ||
+ x_off1 >= pic_width - block_w - QPEL_EXTRA_AFTER ||
+ y_off1 >= pic_height - block_h - QPEL_EXTRA_AFTER) {
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
+ int offset = QPEL_EXTRA_BEFORE * src1stride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
+ int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
+
+ s->vdsp.emulated_edge_mc(lc->edge_emu_buffer2, src1 - offset,
+ edge_emu_stride, src1stride,
+ block_w + QPEL_EXTRA,
+ block_h + QPEL_EXTRA,
+ x_off1 - QPEL_EXTRA_BEFORE, y_off1 - QPEL_EXTRA_BEFORE,
pic_width, pic_height);
- src = lc->edge_emu_buffer + offset;
+ src1 = lc->edge_emu_buffer2 + buf_offset;
+ src1stride = edge_emu_stride;
}
- s->hevcdsp.put_hevc_qpel[my][mx](dst, dststride, src, srcstride, block_w,
- block_h, lc->mc_buffer);
+
+ s->hevcdsp.put_hevc_qpel[idx][!!my0][!!mx0](tmp, MAX_PB_SIZE, src0, src0stride,
+ block_h, mx0, my0, block_w);
+ if (!weight_flag)
+ s->hevcdsp.put_hevc_qpel_bi[idx][!!my1][!!mx1](dst, dststride, src1, src1stride, tmp, MAX_PB_SIZE,
+ block_h, mx1, my1, block_w);
+ else
+ s->hevcdsp.put_hevc_qpel_bi_w[idx][!!my1][!!mx1](dst, dststride, src1, src1stride, tmp, MAX_PB_SIZE,
+ block_h, s->sh.luma_log2_weight_denom,
+ s->sh.luma_weight_l0[current_mv->ref_idx[0]],
+ s->sh.luma_weight_l1[current_mv->ref_idx[1]],
+ s->sh.luma_offset_l0[current_mv->ref_idx[0]],
+ s->sh.luma_offset_l1[current_mv->ref_idx[1]],
+ mx1, my1, block_w);
+
}
/**
- * 8.5.3.2.2.2 Chroma sample interpolation process
+ * 8.5.3.2.2.2 Chroma sample uniprediction interpolation process
*
* @param s HEVC decoding context
* @param dst1 target buffer for block data at block position (U plane)
@@ -1053,62 +1238,165 @@ static void luma_mc(HEVCContext *s, int16_t *dst, ptrdiff_t dststride,
* @param y_off vertical position of block from origin (0, 0)
* @param block_w width of block
* @param block_h height of block
+ * @param chroma_weight weighting factor applied to the chroma prediction
+ * @param chroma_offset additive offset applied to the chroma prediction value
*/
-static void chroma_mc(HEVCContext *s, int16_t *dst1, int16_t *dst2,
- ptrdiff_t dststride, AVFrame *ref, const Mv *mv,
- int x_off, int y_off, int block_w, int block_h)
+
+static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0,
+ ptrdiff_t dststride, uint8_t *src0, ptrdiff_t srcstride, int reflist,
+ int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int chroma_weight, int chroma_offset)
{
HEVCLocalContext *lc = s->HEVClc;
- uint8_t *src1 = ref->data[1];
- uint8_t *src2 = ref->data[2];
- ptrdiff_t src1stride = ref->linesize[1];
- ptrdiff_t src2stride = ref->linesize[2];
- int pic_width = s->sps->width >> 1;
- int pic_height = s->sps->height >> 1;
-
- int mx = mv->x & 7;
- int my = mv->y & 7;
-
- x_off += mv->x >> 3;
- y_off += mv->y >> 3;
- src1 += y_off * src1stride + (x_off << s->sps->pixel_shift);
- src2 += y_off * src2stride + (x_off << s->sps->pixel_shift);
+ int pic_width = s->sps->width >> s->sps->hshift[1];
+ int pic_height = s->sps->height >> s->sps->vshift[1];
+ const Mv *mv = &current_mv->mv[reflist];
+ int weight_flag = (s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
+ (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag);
+ int idx = ff_hevc_pel_weight[block_w];
+ int hshift = s->sps->hshift[1];
+ int vshift = s->sps->vshift[1];
+ intptr_t mx = mv->x & ((1 << (2 + hshift)) - 1);
+ intptr_t my = mv->y & ((1 << (2 + vshift)) - 1);
+ intptr_t _mx = mx << (1 - hshift);
+ intptr_t _my = my << (1 - vshift);
+
+ x_off += mv->x >> (2 + hshift);
+ y_off += mv->y >> (2 + vshift);
+ src0 += y_off * srcstride + (x_off << s->sps->pixel_shift);
if (x_off < EPEL_EXTRA_BEFORE || y_off < EPEL_EXTRA_AFTER ||
x_off >= pic_width - block_w - EPEL_EXTRA_AFTER ||
y_off >= pic_height - block_h - EPEL_EXTRA_AFTER) {
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
+ int offset0 = EPEL_EXTRA_BEFORE * (srcstride + (1 << s->sps->pixel_shift));
+ int buf_offset0 = EPEL_EXTRA_BEFORE *
+ (edge_emu_stride + (1 << s->sps->pixel_shift));
+ s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src0 - offset0,
+ edge_emu_stride, srcstride,
+ block_w + EPEL_EXTRA, block_h + EPEL_EXTRA,
+ x_off - EPEL_EXTRA_BEFORE,
+ y_off - EPEL_EXTRA_BEFORE,
+ pic_width, pic_height);
+
+ src0 = lc->edge_emu_buffer + buf_offset0;
+ srcstride = edge_emu_stride;
+ }
+ if (!weight_flag)
+ s->hevcdsp.put_hevc_epel_uni[idx][!!my][!!mx](dst0, dststride, src0, srcstride,
+ block_h, _mx, _my, block_w);
+ else
+ s->hevcdsp.put_hevc_epel_uni_w[idx][!!my][!!mx](dst0, dststride, src0, srcstride,
+ block_h, s->sh.chroma_log2_weight_denom,
+ chroma_weight, chroma_offset, _mx, _my, block_w);
+}
+
+/**
+ * 8.5.3.2.2.2 Chroma sample bidirectional interpolation process
+ *
+ * @param s HEVC decoding context
+ * @param dst target buffer for block data at block position
+ * @param dststride stride of the dst buffer
+ * @param ref0 reference picture0 buffer at origin (0, 0)
+ * @param mv0 motion vector0 (relative to block position) to get pixel data from
+ * @param x_off horizontal position of block from origin (0, 0)
+ * @param y_off vertical position of block from origin (0, 0)
+ * @param block_w width of block
+ * @param block_h height of block
+ * @param ref1 reference picture1 buffer at origin (0, 0)
+ * @param mv1 motion vector1 (relative to block position) to get pixel data from
+ * @param current_mv current motion vector structure
+ * @param cidx chroma component(cb, cr)
+ */
+static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVFrame *ref0, AVFrame *ref1,
+ int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int cidx)
+{
+ DECLARE_ALIGNED(16, int16_t, tmp [MAX_PB_SIZE * MAX_PB_SIZE]);
+ int tmpstride = MAX_PB_SIZE;
+ HEVCLocalContext *lc = s->HEVClc;
+ uint8_t *src1 = ref0->data[cidx+1];
+ uint8_t *src2 = ref1->data[cidx+1];
+ ptrdiff_t src1stride = ref0->linesize[cidx+1];
+ ptrdiff_t src2stride = ref1->linesize[cidx+1];
+ int weight_flag = (s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
+ (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag);
+ int pic_width = s->sps->width >> s->sps->hshift[1];
+ int pic_height = s->sps->height >> s->sps->vshift[1];
+ Mv *mv0 = &current_mv->mv[0];
+ Mv *mv1 = &current_mv->mv[1];
+ int hshift = s->sps->hshift[1];
+ int vshift = s->sps->vshift[1];
+
+ intptr_t mx0 = mv0->x & ((1 << (2 + hshift)) - 1);
+ intptr_t my0 = mv0->y & ((1 << (2 + vshift)) - 1);
+ intptr_t mx1 = mv1->x & ((1 << (2 + hshift)) - 1);
+ intptr_t my1 = mv1->y & ((1 << (2 + vshift)) - 1);
+ intptr_t _mx0 = mx0 << (1 - hshift);
+ intptr_t _my0 = my0 << (1 - vshift);
+ intptr_t _mx1 = mx1 << (1 - hshift);
+ intptr_t _my1 = my1 << (1 - vshift);
+
+ int x_off0 = x_off + (mv0->x >> (2 + hshift));
+ int y_off0 = y_off + (mv0->y >> (2 + vshift));
+ int x_off1 = x_off + (mv1->x >> (2 + hshift));
+ int y_off1 = y_off + (mv1->y >> (2 + vshift));
+ int idx = ff_hevc_pel_weight[block_w];
+ src1 += y_off0 * src1stride + (int)((unsigned)x_off0 << s->sps->pixel_shift);
+ src2 += y_off1 * src2stride + (int)((unsigned)x_off1 << s->sps->pixel_shift);
+
+ if (x_off0 < EPEL_EXTRA_BEFORE || y_off0 < EPEL_EXTRA_AFTER ||
+ x_off0 >= pic_width - block_w - EPEL_EXTRA_AFTER ||
+ y_off0 >= pic_height - block_h - EPEL_EXTRA_AFTER) {
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
int offset1 = EPEL_EXTRA_BEFORE * (src1stride + (1 << s->sps->pixel_shift));
- int offset2 = EPEL_EXTRA_BEFORE * (src2stride + (1 << s->sps->pixel_shift));
+ int buf_offset1 = EPEL_EXTRA_BEFORE *
+ (edge_emu_stride + (1 << s->sps->pixel_shift));
s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src1 - offset1,
- src1stride, src1stride,
+ edge_emu_stride, src1stride,
block_w + EPEL_EXTRA, block_h + EPEL_EXTRA,
- x_off - EPEL_EXTRA_BEFORE,
- y_off - EPEL_EXTRA_BEFORE,
+ x_off0 - EPEL_EXTRA_BEFORE,
+ y_off0 - EPEL_EXTRA_BEFORE,
pic_width, pic_height);
- src1 = lc->edge_emu_buffer + offset1;
- s->hevcdsp.put_hevc_epel[!!my][!!mx](dst1, dststride, src1, src1stride,
- block_w, block_h, mx, my, lc->mc_buffer);
+ src1 = lc->edge_emu_buffer + buf_offset1;
+ src1stride = edge_emu_stride;
+ }
+
+ if (x_off1 < EPEL_EXTRA_BEFORE || y_off1 < EPEL_EXTRA_AFTER ||
+ x_off1 >= pic_width - block_w - EPEL_EXTRA_AFTER ||
+ y_off1 >= pic_height - block_h - EPEL_EXTRA_AFTER) {
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
+ int offset1 = EPEL_EXTRA_BEFORE * (src2stride + (1 << s->sps->pixel_shift));
+ int buf_offset1 = EPEL_EXTRA_BEFORE *
+ (edge_emu_stride + (1 << s->sps->pixel_shift));
- s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src2 - offset2,
- src2stride, src2stride,
+ s->vdsp.emulated_edge_mc(lc->edge_emu_buffer2, src2 - offset1,
+ edge_emu_stride, src2stride,
block_w + EPEL_EXTRA, block_h + EPEL_EXTRA,
- x_off - EPEL_EXTRA_BEFORE,
- y_off - EPEL_EXTRA_BEFORE,
+ x_off1 - EPEL_EXTRA_BEFORE,
+ y_off1 - EPEL_EXTRA_BEFORE,
pic_width, pic_height);
- src2 = lc->edge_emu_buffer + offset2;
- s->hevcdsp.put_hevc_epel[!!my][!!mx](dst2, dststride, src2, src2stride,
- block_w, block_h, mx, my,
- lc->mc_buffer);
- } else {
- s->hevcdsp.put_hevc_epel[!!my][!!mx](dst1, dststride, src1, src1stride,
- block_w, block_h, mx, my,
- lc->mc_buffer);
- s->hevcdsp.put_hevc_epel[!!my][!!mx](dst2, dststride, src2, src2stride,
- block_w, block_h, mx, my,
- lc->mc_buffer);
+
+ src2 = lc->edge_emu_buffer2 + buf_offset1;
+ src2stride = edge_emu_stride;
}
+
+ s->hevcdsp.put_hevc_epel[idx][!!my0][!!mx0](tmp, tmpstride, src1, src1stride,
+ block_h, _mx0, _my0, block_w);
+ if (!weight_flag)
+ s->hevcdsp.put_hevc_epel_bi[idx][!!my1][!!mx1](dst0, s->frame->linesize[cidx+1],
+ src2, src2stride, tmp, tmpstride,
+ block_h, _mx1, _my1, block_w);
+ else
+ s->hevcdsp.put_hevc_epel_bi_w[idx][!!my1][!!mx1](dst0, s->frame->linesize[cidx+1],
+ src2, src2stride, tmp, tmpstride,
+ block_h,
+ s->sh.chroma_log2_weight_denom,
+ s->sh.chroma_weight_l0[current_mv->ref_idx[0]][cidx],
+ s->sh.chroma_weight_l1[current_mv->ref_idx[1]][cidx],
+ s->sh.chroma_offset_l0[current_mv->ref_idx[0]][cidx],
+ s->sh.chroma_offset_l1[current_mv->ref_idx[1]][cidx],
+ _mx1, _my1, block_w);
}
static void hevc_await_progress(HEVCContext *s, HEVCFrame *ref,
@@ -1136,9 +1424,6 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
MvField *tab_mvf = s->ref->tab_mvf;
RefPicList *refPicList = s->ref->refPicList;
HEVCFrame *ref0, *ref1;
-
- int tmpstride = MAX_PB_SIZE;
-
uint8_t *dst0 = POS(0, x0, y0);
uint8_t *dst1 = POS(1, x0, y0);
uint8_t *dst2 = POS(2, x0, y0);
@@ -1187,6 +1472,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
} else {
enum InterPredIdc inter_pred_idc = PRED_L0;
ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH);
+ current_mv.pred_flag = 0;
if (s->sh.slice_type == B_SLICE)
inter_pred_idc = ff_hevc_inter_pred_idc_decode(s, nPbW, nPbH);
@@ -1195,7 +1481,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
ref_idx[0] = ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L0]);
current_mv.ref_idx[0] = ref_idx[0];
}
- current_mv.pred_flag[0] = 1;
+ current_mv.pred_flag = PF_L0;
ff_hevc_hls_mvd_coding(s, x0, y0, 0);
mvp_flag[0] = ff_hevc_mvp_lx_flag_decode(s);
ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
@@ -1218,7 +1504,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
ff_hevc_hls_mvd_coding(s, x0, y0, 1);
}
- current_mv.pred_flag[1] = 1;
+ current_mv.pred_flag += PF_L1;
mvp_flag[1] = ff_hevc_mvp_lx_flag_decode(s);
ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
partIdx, merge_idx, &current_mv,
@@ -1236,148 +1522,69 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
}
}
- if (current_mv.pred_flag[0]) {
+ if (current_mv.pred_flag & PF_L0) {
ref0 = refPicList[0].ref[current_mv.ref_idx[0]];
if (!ref0)
return;
hevc_await_progress(s, ref0, &current_mv.mv[0], y0, nPbH);
}
- if (current_mv.pred_flag[1]) {
+ if (current_mv.pred_flag & PF_L1) {
ref1 = refPicList[1].ref[current_mv.ref_idx[1]];
if (!ref1)
return;
hevc_await_progress(s, ref1, &current_mv.mv[1], y0, nPbH);
}
- if (current_mv.pred_flag[0] && !current_mv.pred_flag[1]) {
- DECLARE_ALIGNED(16, int16_t, tmp[MAX_PB_SIZE * MAX_PB_SIZE]);
- DECLARE_ALIGNED(16, int16_t, tmp2[MAX_PB_SIZE * MAX_PB_SIZE]);
-
- luma_mc(s, tmp, tmpstride, ref0->frame,
- &current_mv.mv[0], x0, y0, nPbW, nPbH);
-
- if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
- (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
- s->hevcdsp.weighted_pred(s->sh.luma_log2_weight_denom,
- s->sh.luma_weight_l0[current_mv.ref_idx[0]],
- s->sh.luma_offset_l0[current_mv.ref_idx[0]],
- dst0, s->frame->linesize[0], tmp,
- tmpstride, nPbW, nPbH);
- } else {
- s->hevcdsp.put_unweighted_pred(dst0, s->frame->linesize[0], tmp, tmpstride, nPbW, nPbH);
- }
- chroma_mc(s, tmp, tmp2, tmpstride, ref0->frame,
- &current_mv.mv[0], x0 / 2, y0 / 2, nPbW / 2, nPbH / 2);
-
- if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
- (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
- s->hevcdsp.weighted_pred(s->sh.chroma_log2_weight_denom,
- s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0],
- s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0],
- dst1, s->frame->linesize[1], tmp, tmpstride,
- nPbW / 2, nPbH / 2);
- s->hevcdsp.weighted_pred(s->sh.chroma_log2_weight_denom,
- s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1],
- s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1],
- dst2, s->frame->linesize[2], tmp2, tmpstride,
- nPbW / 2, nPbH / 2);
- } else {
- s->hevcdsp.put_unweighted_pred(dst1, s->frame->linesize[1], tmp, tmpstride, nPbW/2, nPbH/2);
- s->hevcdsp.put_unweighted_pred(dst2, s->frame->linesize[2], tmp2, tmpstride, nPbW/2, nPbH/2);
- }
- } else if (!current_mv.pred_flag[0] && current_mv.pred_flag[1]) {
- DECLARE_ALIGNED(16, int16_t, tmp [MAX_PB_SIZE * MAX_PB_SIZE]);
- DECLARE_ALIGNED(16, int16_t, tmp2[MAX_PB_SIZE * MAX_PB_SIZE]);
-
- if (!ref1)
- return;
-
- luma_mc(s, tmp, tmpstride, ref1->frame,
- &current_mv.mv[1], x0, y0, nPbW, nPbH);
-
- if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
- (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
- s->hevcdsp.weighted_pred(s->sh.luma_log2_weight_denom,
- s->sh.luma_weight_l1[current_mv.ref_idx[1]],
- s->sh.luma_offset_l1[current_mv.ref_idx[1]],
- dst0, s->frame->linesize[0], tmp, tmpstride,
- nPbW, nPbH);
- } else {
- s->hevcdsp.put_unweighted_pred(dst0, s->frame->linesize[0], tmp, tmpstride, nPbW, nPbH);
- }
-
- chroma_mc(s, tmp, tmp2, tmpstride, ref1->frame,
- &current_mv.mv[1], x0/2, y0/2, nPbW/2, nPbH/2);
-
- if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
- (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
- s->hevcdsp.weighted_pred(s->sh.chroma_log2_weight_denom,
- s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0],
- s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0],
- dst1, s->frame->linesize[1], tmp, tmpstride, nPbW/2, nPbH/2);
- s->hevcdsp.weighted_pred(s->sh.chroma_log2_weight_denom,
- s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1],
- s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1],
- dst2, s->frame->linesize[2], tmp2, tmpstride, nPbW/2, nPbH/2);
- } else {
- s->hevcdsp.put_unweighted_pred(dst1, s->frame->linesize[1], tmp, tmpstride, nPbW/2, nPbH/2);
- s->hevcdsp.put_unweighted_pred(dst2, s->frame->linesize[2], tmp2, tmpstride, nPbW/2, nPbH/2);
- }
- } else if (current_mv.pred_flag[0] && current_mv.pred_flag[1]) {
- DECLARE_ALIGNED(16, int16_t, tmp [MAX_PB_SIZE * MAX_PB_SIZE]);
- DECLARE_ALIGNED(16, int16_t, tmp2[MAX_PB_SIZE * MAX_PB_SIZE]);
- DECLARE_ALIGNED(16, int16_t, tmp3[MAX_PB_SIZE * MAX_PB_SIZE]);
- DECLARE_ALIGNED(16, int16_t, tmp4[MAX_PB_SIZE * MAX_PB_SIZE]);
- HEVCFrame *ref0 = refPicList[0].ref[current_mv.ref_idx[0]];
- HEVCFrame *ref1 = refPicList[1].ref[current_mv.ref_idx[1]];
-
- if (!ref0 || !ref1)
- return;
-
- luma_mc(s, tmp, tmpstride, ref0->frame,
- &current_mv.mv[0], x0, y0, nPbW, nPbH);
- luma_mc(s, tmp2, tmpstride, ref1->frame,
- &current_mv.mv[1], x0, y0, nPbW, nPbH);
-
- if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
- (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
- s->hevcdsp.weighted_pred_avg(s->sh.luma_log2_weight_denom,
- s->sh.luma_weight_l0[current_mv.ref_idx[0]],
- s->sh.luma_weight_l1[current_mv.ref_idx[1]],
- s->sh.luma_offset_l0[current_mv.ref_idx[0]],
- s->sh.luma_offset_l1[current_mv.ref_idx[1]],
- dst0, s->frame->linesize[0],
- tmp, tmp2, tmpstride, nPbW, nPbH);
- } else {
- s->hevcdsp.put_weighted_pred_avg(dst0, s->frame->linesize[0],
- tmp, tmp2, tmpstride, nPbW, nPbH);
- }
-
- chroma_mc(s, tmp, tmp2, tmpstride, ref0->frame,
- &current_mv.mv[0], x0 / 2, y0 / 2, nPbW / 2, nPbH / 2);
- chroma_mc(s, tmp3, tmp4, tmpstride, ref1->frame,
- &current_mv.mv[1], x0 / 2, y0 / 2, nPbW / 2, nPbH / 2);
-
- if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
- (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
- s->hevcdsp.weighted_pred_avg(s->sh.chroma_log2_weight_denom,
- s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0],
- s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0],
- s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0],
- s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0],
- dst1, s->frame->linesize[1], tmp, tmp3,
- tmpstride, nPbW / 2, nPbH / 2);
- s->hevcdsp.weighted_pred_avg(s->sh.chroma_log2_weight_denom,
- s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1],
- s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1],
- s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1],
- s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1],
- dst2, s->frame->linesize[2], tmp2, tmp4,
- tmpstride, nPbW / 2, nPbH / 2);
- } else {
- s->hevcdsp.put_weighted_pred_avg(dst1, s->frame->linesize[1], tmp, tmp3, tmpstride, nPbW/2, nPbH/2);
- s->hevcdsp.put_weighted_pred_avg(dst2, s->frame->linesize[2], tmp2, tmp4, tmpstride, nPbW/2, nPbH/2);
- }
+ if (current_mv.pred_flag == PF_L0) {
+ int x0_c = x0 >> s->sps->hshift[1];
+ int y0_c = y0 >> s->sps->vshift[1];
+ int nPbW_c = nPbW >> s->sps->hshift[1];
+ int nPbH_c = nPbH >> s->sps->vshift[1];
+
+ luma_mc_uni(s, dst0, s->frame->linesize[0], ref0->frame,
+ &current_mv.mv[0], x0, y0, nPbW, nPbH,
+ s->sh.luma_weight_l0[current_mv.ref_idx[0]],
+ s->sh.luma_offset_l0[current_mv.ref_idx[0]]);
+
+ chroma_mc_uni(s, dst1, s->frame->linesize[1], ref0->frame->data[1], ref0->frame->linesize[1],
+ 0, x0_c, y0_c, nPbW_c, nPbH_c, &current_mv,
+ s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0]);
+ chroma_mc_uni(s, dst2, s->frame->linesize[2], ref0->frame->data[2], ref0->frame->linesize[2],
+ 0, x0_c, y0_c, nPbW_c, nPbH_c, &current_mv,
+ s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1]);
+ } else if (current_mv.pred_flag == PF_L1) {
+ int x0_c = x0 >> s->sps->hshift[1];
+ int y0_c = y0 >> s->sps->vshift[1];
+ int nPbW_c = nPbW >> s->sps->hshift[1];
+ int nPbH_c = nPbH >> s->sps->vshift[1];
+
+ luma_mc_uni(s, dst0, s->frame->linesize[0], ref1->frame,
+ &current_mv.mv[1], x0, y0, nPbW, nPbH,
+ s->sh.luma_weight_l1[current_mv.ref_idx[1]],
+ s->sh.luma_offset_l1[current_mv.ref_idx[1]]);
+
+ chroma_mc_uni(s, dst1, s->frame->linesize[1], ref1->frame->data[1], ref1->frame->linesize[1],
+ 1, x0_c, y0_c, nPbW_c, nPbH_c, &current_mv,
+ s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0]);
+
+ chroma_mc_uni(s, dst2, s->frame->linesize[2], ref1->frame->data[2], ref1->frame->linesize[2],
+ 1, x0_c, y0_c, nPbW_c, nPbH_c, &current_mv,
+ s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1]);
+ } else if (current_mv.pred_flag == PF_BI) {
+ int x0_c = x0 >> s->sps->hshift[1];
+ int y0_c = y0 >> s->sps->vshift[1];
+ int nPbW_c = nPbW >> s->sps->hshift[1];
+ int nPbH_c = nPbH >> s->sps->vshift[1];
+
+ luma_mc_bi(s, dst0, s->frame->linesize[0], ref0->frame,
+ &current_mv.mv[0], x0, y0, nPbW, nPbH,
+ ref1->frame, &current_mv.mv[1], &current_mv);
+
+ chroma_mc_bi(s, dst1, s->frame->linesize[1], ref0->frame, ref1->frame,
+ x0_c, y0_c, nPbW_c, nPbH_c, &current_mv, 0);
+
+ chroma_mc_bi(s, dst2, s->frame->linesize[2], ref0->frame, ref1->frame,
+ x0_c, y0_c, nPbW_c, nPbH_c, &current_mv, 1);
}
}
@@ -1457,15 +1664,7 @@ static int luma_intra_pred_mode(HEVCContext *s, int x0, int y0, int pu_size,
intra_pred_mode, size_in_pus);
for (j = 0; j < size_in_pus; j++) {
- tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].is_intra = 1;
- tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].pred_flag[0] = 0;
- tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].pred_flag[1] = 0;
- tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].ref_idx[0] = 0;
- tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].ref_idx[1] = 0;
- tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].mv[0].x = 0;
- tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].mv[0].y = 0;
- tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].mv[1].x = 0;
- tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].mv[1].y = 0;
+ tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].pred_flag = PF_INTRA;
}
}
@@ -1540,11 +1739,12 @@ static void intra_prediction_unit_default_value(HEVCContext *s,
if (size_in_pus == 0)
size_in_pus = 1;
- for (j = 0; j < size_in_pus; j++) {
+ for (j = 0; j < size_in_pus; j++)
memset(&s->tab_ipm[(y_pu + j) * min_pu_width + x_pu], INTRA_DC, size_in_pus);
- for (k = 0; k < size_in_pus; k++)
- tab_mvf[(y_pu + j) * min_pu_width + x_pu + k].is_intra = lc->cu.pred_mode == MODE_INTRA;
- }
+ if (lc->cu.pred_mode == MODE_INTRA)
+ for (j = 0; j < size_in_pus; j++)
+ for (k = 0; k < size_in_pus; k++)
+ tab_mvf[(y_pu + j) * min_pu_width + x_pu + k].pred_flag = PF_INTRA;
}
static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
@@ -1556,7 +1756,8 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
int min_cb_width = s->sps->min_cb_width;
int x_cb = x0 >> log2_min_cb_size;
int y_cb = y0 >> log2_min_cb_size;
- int x, y;
+ int x, y, ret;
+ int qp_block_mask = (1<<(s->sps->log2_ctb_size - s->pps->diff_cu_qp_delta_depth)) - 1;
lc->cu.x = x0;
lc->cu.y = y0;
@@ -1579,7 +1780,6 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
if (s->sh.slice_type != I_SLICE) {
uint8_t skip_flag = ff_hevc_skip_flag_decode(s, x0, y0, x_cb, y_cb);
- lc->cu.pred_mode = MODE_SKIP;
x = y_cb * min_cb_width + x_cb;
for (y = 0; y < length; y++) {
memset(&s->skip_flag[x], skip_flag, length);
@@ -1593,9 +1793,7 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
intra_prediction_unit_default_value(s, x0, y0, log2_cb_size);
if (!s->sh.disable_deblocking_filter_flag)
- ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size,
- lc->slice_or_tiles_up_boundary,
- lc->slice_or_tiles_left_boundary);
+ ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size);
} else {
if (s->sh.slice_type != I_SLICE)
lc->cu.pred_mode = ff_hevc_pred_mode_decode(s);
@@ -1613,7 +1811,6 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
lc->cu.pcm_flag = ff_hevc_pcm_flag_decode(s);
}
if (lc->cu.pcm_flag) {
- int ret;
intra_prediction_unit_default_value(s, x0, y0, log2_cb_size);
ret = hls_pcm_sample(s, x0, y0, log2_cb_size);
if (s->sps->pcm.loop_filter_disable_flag)
@@ -1672,13 +1869,14 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
lc->cu.max_trafo_depth = lc->cu.pred_mode == MODE_INTRA ?
s->sps->max_transform_hierarchy_depth_intra + lc->cu.intra_split_flag :
s->sps->max_transform_hierarchy_depth_inter;
- hls_transform_tree(s, x0, y0, x0, y0, x0, y0, log2_cb_size,
- log2_cb_size, 0, 0);
+ ret = hls_transform_tree(s, x0, y0, x0, y0, x0, y0,
+ log2_cb_size,
+ log2_cb_size, 0, 0);
+ if (ret < 0)
+ return ret;
} else {
if (!s->sh.disable_deblocking_filter_flag)
- ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size,
- lc->slice_or_tiles_up_boundary,
- lc->slice_or_tiles_left_boundary);
+ ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size);
}
}
}
@@ -1692,6 +1890,11 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
x += min_cb_width;
}
+ if(((x0 + (1<<log2_cb_size)) & qp_block_mask) == 0 &&
+ ((y0 + (1<<log2_cb_size)) & qp_block_mask) == 0) {
+ lc->qPy_pred = lc->qp_y;
+ }
+
set_ct_depth(s, x0, y0, log2_cb_size, lc->ct.depth);
return 0;
@@ -1703,6 +1906,7 @@ static int hls_coding_quadtree(HEVCContext *s, int x0, int y0,
HEVCLocalContext *lc = s->HEVClc;
const int cb_size = 1 << log2_cb_size;
int ret;
+ int qp_block_mask = (1<<(s->sps->log2_ctb_size - s->pps->diff_cu_qp_delta_depth)) - 1;
lc->ct.depth = cb_depth;
if (x0 + cb_size <= s->sps->width &&
@@ -1731,14 +1935,27 @@ static int hls_coding_quadtree(HEVCContext *s, int x0, int y0,
if (more_data < 0)
return more_data;
- if (more_data && x1 < s->sps->width)
+ if (more_data && x1 < s->sps->width) {
more_data = hls_coding_quadtree(s, x1, y0, log2_cb_size - 1, cb_depth + 1);
- if (more_data && y1 < s->sps->height)
+ if (more_data < 0)
+ return more_data;
+ }
+ if (more_data && y1 < s->sps->height) {
more_data = hls_coding_quadtree(s, x0, y1, log2_cb_size - 1, cb_depth + 1);
+ if (more_data < 0)
+ return more_data;
+ }
if (more_data && x1 < s->sps->width &&
y1 < s->sps->height) {
- return hls_coding_quadtree(s, x1, y1, log2_cb_size - 1, cb_depth + 1);
+ more_data = hls_coding_quadtree(s, x1, y1, log2_cb_size - 1, cb_depth + 1);
+ if (more_data < 0)
+ return more_data;
}
+
+ if(((x0 + (1<<log2_cb_size)) & qp_block_mask) == 0 &&
+ ((y0 + (1<<log2_cb_size)) & qp_block_mask) == 0)
+ lc->qPy_pred = lc->qp_y;
+
if (more_data)
return ((x1 + cb_size_split) < s->sps->width ||
(y1 + cb_size_split) < s->sps->height);
@@ -1784,7 +2001,6 @@ static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb,
} else if (s->pps->tiles_enabled_flag) {
if (ctb_addr_ts && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[ctb_addr_ts - 1]) {
int idxX = s->pps->col_idxX[x_ctb >> s->sps->log2_ctb_size];
- lc->start_of_tiles_x = x_ctb;
lc->end_of_tiles_x = x_ctb + (s->pps->column_width[idxX] << s->sps->log2_ctb_size);
lc->first_qp_group = 1;
}
@@ -1826,6 +2042,19 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread)
int y_ctb = 0;
int ctb_addr_ts = s->pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs];
+ if (!ctb_addr_ts && s->sh.dependent_slice_segment_flag) {
+ av_log(s->avctx, AV_LOG_ERROR, "Impossible initial tile.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (s->sh.dependent_slice_segment_flag) {
+ int prev_rs = s->pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1];
+ if (s->tab_slice_address[prev_rs] != s->sh.slice_addr) {
+ av_log(s->avctx, AV_LOG_ERROR, "Previous slice segment missing\n");
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
while (more_data && ctb_addr_ts < s->sps->ctb_size) {
int ctb_addr_rs = s->pps->ctb_addr_ts_to_rs[ctb_addr_ts];
@@ -1842,8 +2071,11 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread)
s->filter_slice_edges[ctb_addr_rs] = s->sh.slice_loop_filter_across_slices_enabled_flag;
more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->sps->log2_ctb_size, 0);
- if (more_data < 0)
+ if (more_data < 0) {
+ s->tab_slice_address[ctb_addr_rs] = -1;
return more_data;
+ }
+
ctb_addr_ts++;
ff_hevc_save_states(s, ctb_addr_ts);
@@ -1909,8 +2141,10 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
hls_sao_param(s, x_ctb >> s->sps->log2_ctb_size, y_ctb >> s->sps->log2_ctb_size);
more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->sps->log2_ctb_size, 0);
- if (more_data < 0)
+ if (more_data < 0) {
+ s->tab_slice_address[ctb_addr_rs] = -1;
return more_data;
+ }
ctb_addr_ts++;
@@ -1959,7 +2193,6 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
s->sList[i] = av_malloc(sizeof(HEVCContext));
memcpy(s->sList[i], s, sizeof(HEVCContext));
s->HEVClcList[i] = av_malloc(sizeof(HEVCLocalContext));
- s->HEVClcList[i]->edge_emu_buffer = av_malloc((MAX_PB_SIZE + 7) * s->frame->linesize[0]);
s->sList[i]->HEVClc = s->HEVClcList[i];
}
}
@@ -2072,18 +2305,57 @@ static void restore_tqb_pixels(HEVCContext *s)
}
}
+static int set_side_data(HEVCContext *s)
+{
+ AVFrame *out = s->ref->frame;
+
+ if (s->sei_frame_packing_present &&
+ s->frame_packing_arrangement_type >= 3 &&
+ s->frame_packing_arrangement_type <= 5 &&
+ s->content_interpretation_type > 0 &&
+ s->content_interpretation_type < 3) {
+ AVStereo3D *stereo = av_stereo3d_create_side_data(out);
+ if (!stereo)
+ return AVERROR(ENOMEM);
+
+ switch (s->frame_packing_arrangement_type) {
+ case 3:
+ if (s->quincunx_subsampling)
+ stereo->type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX;
+ else
+ stereo->type = AV_STEREO3D_SIDEBYSIDE;
+ break;
+ case 4:
+ stereo->type = AV_STEREO3D_TOPBOTTOM;
+ break;
+ case 5:
+ stereo->type = AV_STEREO3D_FRAMESEQUENCE;
+ break;
+ }
+
+ if (s->content_interpretation_type == 2)
+ stereo->flags = AV_STEREO3D_FLAG_INVERT;
+ }
+
+ return 0;
+}
+
static int hevc_frame_start(HEVCContext *s)
{
HEVCLocalContext *lc = s->HEVClc;
+ int pic_size_in_ctb = ((s->sps->width >> s->sps->log2_min_cb_size) + 1) *
+ ((s->sps->height >> s->sps->log2_min_cb_size) + 1);
int ret;
+ AVFrame *cur_frame;
memset(s->horizontal_bs, 0, 2 * s->bs_width * (s->bs_height + 1));
memset(s->vertical_bs, 0, 2 * s->bs_width * (s->bs_height + 1));
memset(s->cbf_luma, 0, s->sps->min_tb_width * s->sps->min_tb_height);
memset(s->is_pcm, 0, s->sps->min_pu_width * s->sps->min_pu_height);
+ memset(s->tab_slice_address, -1, pic_size_in_ctb * sizeof(*s->tab_slice_address));
- lc->start_of_tiles_x = 0;
s->is_decoded = 0;
+ s->first_nal_type = s->nal_unit_type;
if (s->pps->tiles_enabled_flag)
lc->end_of_tiles_x = s->pps->column_width[0] << s->sps->log2_ctb_size;
@@ -2093,19 +2365,19 @@ static int hevc_frame_start(HEVCContext *s)
if (ret < 0)
goto fail;
- av_fast_malloc(&lc->edge_emu_buffer, &lc->edge_emu_buffer_size,
- (MAX_PB_SIZE + 7) * s->ref->frame->linesize[0]);
- if (!lc->edge_emu_buffer) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
ret = ff_hevc_frame_rps(s);
if (ret < 0) {
av_log(s->avctx, AV_LOG_ERROR, "Error constructing the frame RPS.\n");
goto fail;
}
+ ret = set_side_data(s);
+ if (ret < 0)
+ goto fail;
+
+ cur_frame = s->sps->sao_enabled ? s->sao_frame : s->frame;
+ cur_frame->pict_type = 3 - s->sh.slice_type;
+
av_frame_unref(s->output_frame);
ret = ff_hevc_output_frame(s, s->output_frame, 0);
if (ret < 0)
@@ -2136,9 +2408,7 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length)
if (ret < 0) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid NAL unit %d, skipping.\n",
s->nal_unit_type);
- if (s->avctx->err_recognition & AV_EF_EXPLODE)
- return ret;
- return 0;
+ goto fail;
} else if (!ret)
return 0;
@@ -2146,23 +2416,23 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length)
case NAL_VPS:
ret = ff_hevc_decode_nal_vps(s);
if (ret < 0)
- return ret;
+ goto fail;
break;
case NAL_SPS:
ret = ff_hevc_decode_nal_sps(s);
if (ret < 0)
- return ret;
+ goto fail;
break;
case NAL_PPS:
ret = ff_hevc_decode_nal_pps(s);
if (ret < 0)
- return ret;
+ goto fail;
break;
case NAL_SEI_PREFIX:
case NAL_SEI_SUFFIX:
ret = ff_hevc_decode_nal_sei(s);
if (ret < 0)
- return ret;
+ goto fail;
break;
case NAL_TRAIL_R:
case NAL_TRAIL_N:
@@ -2208,6 +2478,13 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length)
return ret;
} else if (!s->ref) {
av_log(s->avctx, AV_LOG_ERROR, "First slice in a frame missing.\n");
+ goto fail;
+ }
+
+ if (s->nal_unit_type != s->first_nal_type) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Non-matching NAL types of the VCL NALUs: %d %d\n",
+ s->first_nal_type, s->nal_unit_type);
return AVERROR_INVALIDDATA;
}
@@ -2217,8 +2494,7 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length)
if (ret < 0) {
av_log(s->avctx, AV_LOG_WARNING,
"Error constructing the reference lists for the current slice.\n");
- if (s->avctx->err_recognition & AV_EF_EXPLODE)
- return ret;
+ goto fail;
}
}
@@ -2234,8 +2510,10 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length)
restore_tqb_pixels(s);
}
- if (ctb_addr_ts < 0)
- return ctb_addr_ts;
+ if (ctb_addr_ts < 0) {
+ ret = ctb_addr_ts;
+ goto fail;
+ }
break;
case NAL_EOS_NUT:
case NAL_EOB_NUT:
@@ -2251,10 +2529,14 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length)
}
return 0;
+fail:
+ if (s->avctx->err_recognition & AV_EF_EXPLODE)
+ return ret;
+ return 0;
}
/* FIXME: This is adapted from ff_h264_decode_nal, avoiding duplication
- between these functions would be nice. */
+ * between these functions would be nice. */
int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length,
HEVCNAL *nal)
{
@@ -2367,6 +2649,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
int i, consumed, ret = 0;
s->ref = NULL;
+ s->last_eos = s->eos;
s->eos = 0;
/* split the input packet into NAL units, so we know the upper bound on the
@@ -2463,8 +2746,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
if (ret < 0) {
av_log(s->avctx, AV_LOG_WARNING,
"Error parsing NAL unit #%d.\n", i);
- if (s->avctx->err_recognition & AV_EF_EXPLODE)
- goto fail;
+ goto fail;
}
}
@@ -2634,8 +2916,6 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
pic_arrays_free(s);
- if (lc)
- av_freep(&lc->edge_emu_buffer);
av_freep(&s->md5_ctx);
for(i=0; i < s->nals_allocated; i++) {
@@ -2669,11 +2949,12 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
for (i = 1; i < s->threads_number; i++) {
lc = s->HEVClcList[i];
if (lc) {
- av_freep(&lc->edge_emu_buffer);
av_freep(&s->HEVClcList[i]);
av_freep(&s->sList[i]);
}
}
+ if (s->HEVClc == s->HEVClcList[0])
+ s->HEVClc = NULL;
av_freep(&s->HEVClcList[0]);
for (i = 0; i < s->nals_allocated; i++)
@@ -2725,6 +3006,7 @@ static av_cold int hevc_init_context(AVCodecContext *avctx)
ff_dsputil_init(&s->dsp, avctx);
s->context_initialized = 1;
+ s->eos = 0;
return 0;
@@ -2789,6 +3071,7 @@ static int hevc_update_thread_context(AVCodecContext *dst,
s->seq_output = s0->seq_output;
s->pocTid0 = s0->pocTid0;
s->max_ra = s0->max_ra;
+ s->eos = s0->eos;
s->is_nalff = s0->is_nalff;
s->nal_length_size = s0->nal_length_size;
@@ -2817,7 +3100,7 @@ static int hevc_decode_extradata(HEVCContext *s)
avctx->extradata[2] > 1)) {
/* It seems the extradata is encoded as hvcC format.
* Temporarily, we support configurationVersion==0 until 14496-15 3rd
- * finalized. When finalized, configurationVersion will be 1 and we
+ * is finalized. When finalized, configurationVersion will be 1 and we
* can recognize hvcC by checking if avctx->extradata[0]==1 or not. */
int i, j, num_arrays, nal_len_size;
@@ -2930,9 +3213,9 @@ static void hevc_decode_flush(AVCodecContext *avctx)
#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
static const AVProfile profiles[] = {
- { FF_PROFILE_HEVC_MAIN, "Main" },
- { FF_PROFILE_HEVC_MAIN_10, "Main10" },
- { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "MainStillPicture" },
+ { FF_PROFILE_HEVC_MAIN, "Main" },
+ { FF_PROFILE_HEVC_MAIN_10, "Main 10" },
+ { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" },
{ FF_PROFILE_UNKNOWN },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc.h b/chromium/third_party/ffmpeg/libavcodec/hevc.h
index 74673a9f1ab..3c88b69a470 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc.h
@@ -71,6 +71,11 @@
#define EPEL_EXTRA_BEFORE 1
#define EPEL_EXTRA_AFTER 2
#define EPEL_EXTRA 3
+#define QPEL_EXTRA_BEFORE 3
+#define QPEL_EXTRA_AFTER 4
+#define QPEL_EXTRA 7
+
+#define EDGE_EMU_BUFFER_STRIDE 80
/**
* Value of the luma sample at position (x, y) in the 2D array tab.
@@ -199,6 +204,13 @@ enum InterPredIdc {
PRED_BI,
};
+enum PredFlag {
+ PF_INTRA = 0,
+ PF_L0,
+ PF_L1,
+ PF_BI,
+};
+
enum IntraPredMode {
INTRA_PLANAR = 0,
INTRA_DC,
@@ -257,7 +269,7 @@ enum ScanType {
};
typedef struct ShortTermRPS {
- int num_negative_pics;
+ unsigned int num_negative_pics;
int num_delta_pocs;
int32_t delta_poc[32];
uint8_t used[32];
@@ -330,30 +342,24 @@ typedef struct VUI {
int log2_max_mv_length_vertical;
} VUI;
-typedef struct ProfileTierLevel {
- int profile_space;
+typedef struct PTLCommon {
+ uint8_t profile_space;
uint8_t tier_flag;
- int profile_idc;
- int profile_compatibility_flag[32];
- int level_idc;
- int progressive_source_flag;
- int interlaced_source_flag;
- int non_packed_constraint_flag;
- int frame_only_constraint_flag;
-} ProfileTierLevel;
+ uint8_t profile_idc;
+ uint8_t profile_compatibility_flag[32];
+ uint8_t level_idc;
+ uint8_t progressive_source_flag;
+ uint8_t interlaced_source_flag;
+ uint8_t non_packed_constraint_flag;
+ uint8_t frame_only_constraint_flag;
+} PTLCommon;
typedef struct PTL {
- ProfileTierLevel general_PTL;
- ProfileTierLevel sub_layer_PTL[MAX_SUB_LAYERS];
+ PTLCommon general_ptl;
+ PTLCommon sub_layer_ptl[MAX_SUB_LAYERS];
uint8_t sub_layer_profile_present_flag[MAX_SUB_LAYERS];
uint8_t sub_layer_level_present_flag[MAX_SUB_LAYERS];
-
- int sub_layer_profile_space[MAX_SUB_LAYERS];
- uint8_t sub_layer_tier_flag[MAX_SUB_LAYERS];
- int sub_layer_profile_idc[MAX_SUB_LAYERS];
- uint8_t sub_layer_profile_compatibility_flags[MAX_SUB_LAYERS][32];
- int sub_layer_level_idc[MAX_SUB_LAYERS];
} PTL;
typedef struct HEVCVPS {
@@ -374,8 +380,6 @@ typedef struct HEVCVPS {
uint8_t vps_poc_proportional_to_timing_flag;
int vps_num_ticks_poc_diff_one; ///< vps_num_ticks_poc_diff_one_minus1 + 1
int vps_num_hrd_parameters;
-
- int vps_extension_flag;
} HEVCVPS;
typedef struct ScalingList {
@@ -386,7 +390,7 @@ typedef struct ScalingList {
} ScalingList;
typedef struct HEVCSPS {
- int vps_id;
+ unsigned vps_id;
int chroma_format_idc;
uint8_t separate_colour_plane_flag;
@@ -467,7 +471,7 @@ typedef struct HEVCSPS {
} HEVCSPS;
typedef struct HEVCPPS {
- int sps_id; ///< seq_parameter_set_id
+ unsigned int sps_id; ///< seq_parameter_set_id
uint8_t sign_data_hiding_flag;
@@ -508,7 +512,7 @@ typedef struct HEVCPPS {
int beta_offset; ///< beta_offset_div2 * 2
int tc_offset; ///< tc_offset_div2 * 2
- int scaling_list_data_present_flag;
+ uint8_t scaling_list_data_present_flag;
ScalingList scaling_list;
uint8_t lists_modification_present_flag;
@@ -516,14 +520,11 @@ typedef struct HEVCPPS {
int num_extra_slice_header_bits;
uint8_t slice_header_extension_present_flag;
- uint8_t pps_extension_flag;
- uint8_t pps_extension_data_flag;
-
// Inferred parameters
- int *column_width; ///< ColumnWidth
- int *row_height; ///< RowHeight
- int *col_bd; ///< ColBd
- int *row_bd; ///< RowBd
+ unsigned int *column_width; ///< ColumnWidth
+ unsigned int *row_height; ///< RowHeight
+ unsigned int *col_bd; ///< ColBd
+ unsigned int *row_bd; ///< RowBd
int *col_idxX;
int *ctb_addr_rs_to_ts; ///< CtbAddrRSToTS
@@ -535,7 +536,7 @@ typedef struct HEVCPPS {
} HEVCPPS;
typedef struct SliceHeader {
- int pps_id;
+ unsigned int pps_id;
///< address (in raster order) of the first block in the current slice segment
unsigned int slice_segment_addr;
@@ -580,8 +581,7 @@ typedef struct SliceHeader {
int beta_offset; ///< beta_offset_div2 * 2
int tc_offset; ///< tc_offset_div2 * 2
- int max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
-
+ unsigned int max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
int *entry_point_offset;
int * offset;
@@ -636,8 +636,7 @@ typedef struct Mv {
typedef struct MvField {
Mv mv[2];
int8_t ref_idx[2];
- int8_t pred_flag[2];
- uint8_t is_intra;
+ int8_t pred_flag;
} MvField;
typedef struct NeighbourAvailable {
@@ -675,19 +674,6 @@ typedef struct TransformUnit {
uint8_t is_cu_qp_delta_coded;
} TransformUnit;
-typedef struct SAOParams {
- int offset_abs[3][4]; ///< sao_offset_abs
- int offset_sign[3][4]; ///< sao_offset_sign
-
- int band_position[3]; ///< sao_band_position
-
- int eo_class[3]; ///< sao_eo_class
-
- int offset_val[3][5]; ///<SaoOffsetVal
-
- uint8_t type_idx[3]; ///< sao_type_idx
-} SAOParams;
-
typedef struct DBParams {
int beta_offset;
int tc_offset;
@@ -746,17 +732,20 @@ typedef struct HEVCLocalContext {
int8_t qp_y;
int8_t curr_qp_y;
+ int qPy_pred;
+
TransformUnit tu;
uint8_t ctb_left_flag;
uint8_t ctb_up_flag;
uint8_t ctb_up_right_flag;
uint8_t ctb_up_left_flag;
- int start_of_tiles_x;
int end_of_tiles_x;
int end_of_tiles_y;
- uint8_t *edge_emu_buffer;
- int edge_emu_buffer_size;
+ /* +7 is for subpixel interpolation, *2 for high bit depths */
+ DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2];
+ DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer2)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2];
+
CodingTree ct;
CodingUnit cu;
PredictionUnit pu;
@@ -768,7 +757,7 @@ typedef struct HEVCLocalContext {
typedef struct HEVCContext {
const AVClass *c; // needed by private avoptions
- AVCodecContext *avctx;
+ AVCodecContext *avctx;
struct HEVCContext *sList[MAX_NB_THREADS];
@@ -791,9 +780,9 @@ typedef struct HEVCContext {
AVFrame *tmp_frame;
AVFrame *output_frame;
- HEVCVPS *vps;
+ const HEVCVPS *vps;
const HEVCSPS *sps;
- HEVCPPS *pps;
+ const HEVCPPS *pps;
AVBufferRef *vps_list[MAX_VPS_COUNT];
AVBufferRef *sps_list[MAX_SPS_COUNT];
AVBufferRef *pps_list[MAX_PPS_COUNT];
@@ -815,6 +804,7 @@ typedef struct HEVCContext {
int pocTid0;
int slice_idx; ///< number of the slice being currently decoded
int eos; ///< current packet contains an EOS/EOB NAL
+ int last_eos; ///< last packet contains an EOS/EOB NAL
int max_ra;
int bs_width;
int bs_height;
@@ -865,19 +855,21 @@ typedef struct HEVCContext {
int **skipped_bytes_pos_nal;
int *skipped_bytes_pos_size_nal;
- uint8_t *data;
+ const uint8_t *data;
HEVCNAL *nals;
int nb_nals;
int nals_allocated;
+ // type of the first VCL NAL of the current frame
+ enum NALUnitType first_nal_type;
// for checking the frame checksums
struct AVMD5 *md5_ctx;
uint8_t md5[3][16];
uint8_t is_md5;
- int context_initialized;
- int is_nalff; ///< this flag is != 0 if bitstream is encapsulated
+ uint8_t context_initialized;
+ uint8_t is_nalff; ///< this flag is != 0 if bitstream is encapsulated
///< as a format defined in 14496-15
int apply_defdispwin;
@@ -886,6 +878,12 @@ typedef struct HEVCContext {
int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4)
int nuh_layer_id;
+ /** frame packing arrangement variables */
+ int sei_frame_packing_present;
+ int frame_packing_arrangement_type;
+ int content_interpretation_type;
+ int quincunx_subsampling;
+
int picture_struct;
} HEVCContext;
@@ -986,9 +984,7 @@ void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0,
void ff_hevc_set_qPy(HEVCContext *s, int xC, int yC, int xBase, int yBase,
int log2_cb_size);
void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
- int log2_trafo_size,
- int slice_or_tiles_up_boundary,
- int slice_or_tiles_left_boundary);
+ int log2_trafo_size);
int ff_hevc_cu_qp_delta_sign_flag(HEVCContext *s);
int ff_hevc_cu_qp_delta_abs(HEVCContext *s);
void ff_hevc_hls_filter(HEVCContext *s, int x, int y);
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_cabac.c b/chromium/third_party/ffmpeg/libavcodec/hevc_cabac.c
index da7a21373d9..288f88576cb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_cabac.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_cabac.c
@@ -27,7 +27,7 @@
#include "cabac_functions.h"
#include "hevc.h"
-#define CABAC_MAX_BIN 100
+#define CABAC_MAX_BIN 31
/**
* number of bin by SyntaxElement.
@@ -537,7 +537,7 @@ static void cabac_init_state(HEVCContext *s)
int init_value = init_values[init_type][i];
int m = (init_value >> 4) * 5 - 45;
int n = ((init_value & 15) << 3) - 16;
- int pre = 2 * (((m * av_clip_c(s->sh.slice_qp, 0, 51)) >> 4) + n) - 127;
+ int pre = 2 * (((m * av_clip(s->sh.slice_qp, 0, 51)) >> 4) + n) - 127;
pre ^= pre >> 31;
if (pre > 124)
@@ -1114,7 +1114,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
else
offset = s->pps->cr_qp_offset + s->sh.slice_cr_qp_offset;
- qp_i = av_clip_c(qp_y + offset, - s->sps->qp_bd_offset, 57);
+ qp_i = av_clip(qp_y + offset, - s->sps->qp_bd_offset, 57);
if (qp_i < 30)
qp = qp_i;
else if (qp_i > 43)
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_filter.c b/chromium/third_party/ffmpeg/libavcodec/hevc_filter.c
index ae72fbbe498..ec7a21187d4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_filter.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_filter.c
@@ -60,7 +60,7 @@ static int chroma_tc(HEVCContext *s, int qp_y, int c_idx, int tc_offset)
else
offset = s->pps->cr_qp_offset;
- qp_i = av_clip_c(qp_y + offset, 0, 57);
+ qp_i = av_clip(qp_y + offset, 0, 57);
if (qp_i < 30)
qp = qp_i;
else if (qp_i > 43)
@@ -68,7 +68,7 @@ static int chroma_tc(HEVCContext *s, int qp_y, int c_idx, int tc_offset)
else
qp = qp_c[qp_i - 30];
- idxt = av_clip_c(qp + DEFAULT_INTRA_TC_OFFSET + tc_offset, 0, 53);
+ idxt = av_clip(qp + DEFAULT_INTRA_TC_OFFSET + tc_offset, 0, 53);
return tctable[idxt];
}
@@ -82,7 +82,6 @@ static int get_qPy_pred(HEVCContext *s, int xC, int yC,
int xQgBase = xBase - (xBase & MinCuQpDeltaSizeMask);
int yQgBase = yBase - (yBase & MinCuQpDeltaSizeMask);
int min_cb_width = s->sps->min_cb_width;
- int min_cb_height = s->sps->min_cb_height;
int x_cb = xQgBase >> s->sps->log2_min_cb_size;
int y_cb = yQgBase >> s->sps->log2_min_cb_size;
int availableA = (xBase & ctb_size_mask) &&
@@ -92,50 +91,11 @@ static int get_qPy_pred(HEVCContext *s, int xC, int yC,
int qPy_pred, qPy_a, qPy_b;
// qPy_pred
- if (lc->first_qp_group) {
+ if (lc->first_qp_group || (!xQgBase && !yQgBase)) {
lc->first_qp_group = !lc->tu.is_cu_qp_delta_coded;
qPy_pred = s->sh.slice_qp;
} else {
- qPy_pred = lc->qp_y;
- if (log2_cb_size < s->sps->log2_ctb_size -
- s->pps->diff_cu_qp_delta_depth) {
- static const int offsetX[8][8] = {
- { -1, 1, 3, 1, 7, 1, 3, 1 },
- { 0, 0, 0, 0, 0, 0, 0, 0 },
- { 1, 3, 1, 3, 1, 3, 1, 3 },
- { 2, 2, 2, 2, 2, 2, 2, 2 },
- { 3, 5, 7, 5, 3, 5, 7, 5 },
- { 4, 4, 4, 4, 4, 4, 4, 4 },
- { 5, 7, 5, 7, 5, 7, 5, 7 },
- { 6, 6, 6, 6, 6, 6, 6, 6 }
- };
- static const int offsetY[8][8] = {
- { 7, 0, 1, 2, 3, 4, 5, 6 },
- { 0, 1, 2, 3, 4, 5, 6, 7 },
- { 1, 0, 3, 2, 5, 4, 7, 6 },
- { 0, 1, 2, 3, 4, 5, 6, 7 },
- { 3, 0, 1, 2, 7, 4, 5, 6 },
- { 0, 1, 2, 3, 4, 5, 6, 7 },
- { 1, 0, 3, 2, 5, 4, 7, 6 },
- { 0, 1, 2, 3, 4, 5, 6, 7 }
- };
- int xC0b = (xC - (xC & ctb_size_mask)) >> s->sps->log2_min_cb_size;
- int yC0b = (yC - (yC & ctb_size_mask)) >> s->sps->log2_min_cb_size;
- int idxX = (xQgBase & ctb_size_mask) >> s->sps->log2_min_cb_size;
- int idxY = (yQgBase & ctb_size_mask) >> s->sps->log2_min_cb_size;
- int idx_mask = ctb_size_mask >> s->sps->log2_min_cb_size;
- int x, y;
-
- x = FFMIN(xC0b + offsetX[idxX][idxY], min_cb_width - 1);
- y = FFMIN(yC0b + (offsetY[idxX][idxY] & idx_mask), min_cb_height - 1);
-
- if (xC0b == (lc->start_of_tiles_x >> s->sps->log2_min_cb_size) &&
- offsetX[idxX][idxY] == -1) {
- x = (lc->end_of_tiles_x >> s->sps->log2_min_cb_size) - 1;
- y = yC0b - 1;
- }
- qPy_pred = s->qp_y_tab[y * min_cb_width + x];
- }
+ qPy_pred = lc->qPy_pred;
}
// qPy_a
@@ -150,6 +110,9 @@ static int get_qPy_pred(HEVCContext *s, int xC, int yC,
else
qPy_b = s->qp_y_tab[x_cb + (y_cb - 1) * min_cb_width];
+ av_assert2(qPy_a >= -s->sps->qp_bd_offset && qPy_a < 52);
+ av_assert2(qPy_b >= -s->sps->qp_bd_offset && qPy_b < 52);
+
return (qPy_a + qPy_b + 1) >> 1;
}
@@ -160,8 +123,8 @@ void ff_hevc_set_qPy(HEVCContext *s, int xC, int yC,
if (s->HEVClc->tu.cu_qp_delta != 0) {
int off = s->sps->qp_bd_offset;
- s->HEVClc->qp_y = ((qp_y + s->HEVClc->tu.cu_qp_delta + 52 + 2 * off) %
- (52 + off)) - off;
+ s->HEVClc->qp_y = FFUMOD(qp_y + s->HEVClc->tu.cu_qp_delta + 52 + 2 * off,
+ 52 + off) - off;
} else
s->HEVClc->qp_y = qp_y;
}
@@ -320,11 +283,15 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
static int get_pcm(HEVCContext *s, int x, int y)
{
int log2_min_pu_size = s->sps->log2_min_pu_size;
- int x_pu = x >> log2_min_pu_size;
- int y_pu = y >> log2_min_pu_size;
+ int x_pu, y_pu;
- if (x < 0 || x_pu >= s->sps->min_pu_width ||
- y < 0 || y_pu >= s->sps->min_pu_height)
+ if (x < 0 || y < 0)
+ return 2;
+
+ x_pu = x >> log2_min_pu_size;
+ y_pu = y >> log2_min_pu_size;
+
+ if (x_pu >= s->sps->min_pu_width || y_pu >= s->sps->min_pu_height)
return 2;
return s->is_pcm[y_pu * s->sps->min_pu_width + x_pu];
}
@@ -380,8 +347,8 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
const int qp0 = (get_qPy(s, x - 1, y) + get_qPy(s, x, y) + 1) >> 1;
const int qp1 = (get_qPy(s, x - 1, y + 4) + get_qPy(s, x, y + 4) + 1) >> 1;
- beta[0] = betatable[av_clip(qp0 + (beta_offset >> 1 << 1), 0, MAX_QP)];
- beta[1] = betatable[av_clip(qp1 + (beta_offset >> 1 << 1), 0, MAX_QP)];
+ beta[0] = betatable[av_clip(qp0 + beta_offset, 0, MAX_QP)];
+ beta[1] = betatable[av_clip(qp1 + beta_offset, 0, MAX_QP)];
tc[0] = bs0 ? TC_CALC(qp0, bs0) : 0;
tc[1] = bs1 ? TC_CALC(qp1, bs1) : 0;
src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->sps->pixel_shift)];
@@ -445,8 +412,8 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
tc_offset = x >= x0 ? cur_tc_offset : left_tc_offset;
beta_offset = x >= x0 ? cur_beta_offset : left_beta_offset;
- beta[0] = betatable[av_clip(qp0 + (beta_offset >> 1 << 1), 0, MAX_QP)];
- beta[1] = betatable[av_clip(qp1 + (beta_offset >> 1 << 1), 0, MAX_QP)];
+ beta[0] = betatable[av_clip(qp0 + beta_offset, 0, MAX_QP)];
+ beta[1] = betatable[av_clip(qp1 + beta_offset, 0, MAX_QP)];
tc[0] = bs0 ? TC_CALC(qp0, bs0) : 0;
tc[1] = bs1 ? TC_CALC(qp1, bs1) : 0;
src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->sps->pixel_shift)];
@@ -510,138 +477,96 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
}
}
-static int boundary_strength(HEVCContext *s, MvField *curr,
- uint8_t curr_cbf_luma, MvField *neigh,
- uint8_t neigh_cbf_luma,
- RefPicList *neigh_refPicList,
- int tu_border)
+static int boundary_strength(HEVCContext *s, MvField *curr, MvField *neigh,
+ RefPicList *neigh_refPicList)
{
- int mvs = curr->pred_flag[0] + curr->pred_flag[1];
-
- if (tu_border) {
- if (curr->is_intra || neigh->is_intra)
- return 2;
- if (curr_cbf_luma || neigh_cbf_luma)
- return 1;
- }
-
- if (mvs == neigh->pred_flag[0] + neigh->pred_flag[1]) {
- if (mvs == 2) {
- // same L0 and L1
- if (s->ref->refPicList[0].list[curr->ref_idx[0]] == neigh_refPicList[0].list[neigh->ref_idx[0]] &&
- s->ref->refPicList[0].list[curr->ref_idx[0]] == s->ref->refPicList[1].list[curr->ref_idx[1]] &&
- neigh_refPicList[0].list[neigh->ref_idx[0]] == neigh_refPicList[1].list[neigh->ref_idx[1]]) {
- if ((abs(neigh->mv[0].x - curr->mv[0].x) >= 4 || abs(neigh->mv[0].y - curr->mv[0].y) >= 4 ||
- abs(neigh->mv[1].x - curr->mv[1].x) >= 4 || abs(neigh->mv[1].y - curr->mv[1].y) >= 4) &&
- (abs(neigh->mv[1].x - curr->mv[0].x) >= 4 || abs(neigh->mv[1].y - curr->mv[0].y) >= 4 ||
- abs(neigh->mv[0].x - curr->mv[1].x) >= 4 || abs(neigh->mv[0].y - curr->mv[1].y) >= 4))
- return 1;
- else
- return 0;
- } else if (neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[0].list[curr->ref_idx[0]] &&
- neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[1].list[curr->ref_idx[1]]) {
- if (abs(neigh->mv[0].x - curr->mv[0].x) >= 4 || abs(neigh->mv[0].y - curr->mv[0].y) >= 4 ||
- abs(neigh->mv[1].x - curr->mv[1].x) >= 4 || abs(neigh->mv[1].y - curr->mv[1].y) >= 4)
- return 1;
- else
- return 0;
- } else if (neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[0].list[curr->ref_idx[0]] &&
- neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[1].list[curr->ref_idx[1]]) {
- if (abs(neigh->mv[1].x - curr->mv[0].x) >= 4 || abs(neigh->mv[1].y - curr->mv[0].y) >= 4 ||
- abs(neigh->mv[0].x - curr->mv[1].x) >= 4 || abs(neigh->mv[0].y - curr->mv[1].y) >= 4)
- return 1;
- else
- return 0;
- } else {
+ if (curr->pred_flag == PF_BI && neigh->pred_flag == PF_BI) {
+ // same L0 and L1
+ if (s->ref->refPicList[0].list[curr->ref_idx[0]] == neigh_refPicList[0].list[neigh->ref_idx[0]] &&
+ s->ref->refPicList[0].list[curr->ref_idx[0]] == s->ref->refPicList[1].list[curr->ref_idx[1]] &&
+ neigh_refPicList[0].list[neigh->ref_idx[0]] == neigh_refPicList[1].list[neigh->ref_idx[1]]) {
+ if ((FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 ||
+ FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4) &&
+ (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 4 ||
+ FFABS(neigh->mv[0].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 4))
return 1;
- }
- } else { // 1 MV
- Mv A, B;
- int ref_A, ref_B;
-
- if (curr->pred_flag[0]) {
- A = curr->mv[0];
- ref_A = s->ref->refPicList[0].list[curr->ref_idx[0]];
- } else {
- A = curr->mv[1];
- ref_A = s->ref->refPicList[1].list[curr->ref_idx[1]];
- }
+ else
+ return 0;
+ } else if (neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[0].list[curr->ref_idx[0]] &&
+ neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[1].list[curr->ref_idx[1]]) {
+ if (FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 ||
+ FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4)
+ return 1;
+ else
+ return 0;
+ } else if (neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[0].list[curr->ref_idx[0]] &&
+ neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[1].list[curr->ref_idx[1]]) {
+ if (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 4 ||
+ FFABS(neigh->mv[0].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 4)
+ return 1;
+ else
+ return 0;
+ } else {
+ return 1;
+ }
+ } else if ((curr->pred_flag != PF_BI) && (neigh->pred_flag != PF_BI)){ // 1 MV
+ Mv A, B;
+ int ref_A, ref_B;
+
+ if (curr->pred_flag & 1) {
+ A = curr->mv[0];
+ ref_A = s->ref->refPicList[0].list[curr->ref_idx[0]];
+ } else {
+ A = curr->mv[1];
+ ref_A = s->ref->refPicList[1].list[curr->ref_idx[1]];
+ }
- if (neigh->pred_flag[0]) {
- B = neigh->mv[0];
- ref_B = neigh_refPicList[0].list[neigh->ref_idx[0]];
- } else {
- B = neigh->mv[1];
- ref_B = neigh_refPicList[1].list[neigh->ref_idx[1]];
- }
+ if (neigh->pred_flag & 1) {
+ B = neigh->mv[0];
+ ref_B = neigh_refPicList[0].list[neigh->ref_idx[0]];
+ } else {
+ B = neigh->mv[1];
+ ref_B = neigh_refPicList[1].list[neigh->ref_idx[1]];
+ }
- if (ref_A == ref_B) {
- if (abs(A.x - B.x) >= 4 || abs(A.y - B.y) >= 4)
- return 1;
- else
- return 0;
- } else
+ if (ref_A == ref_B) {
+ if (FFABS(A.x - B.x) >= 4 || FFABS(A.y - B.y) >= 4)
return 1;
- }
+ else
+ return 0;
+ } else
+ return 1;
}
return 1;
}
void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
- int log2_trafo_size,
- int slice_or_tiles_up_boundary,
- int slice_or_tiles_left_boundary)
+ int log2_trafo_size)
{
+ HEVCLocalContext *lc = s->HEVClc;
MvField *tab_mvf = s->ref->tab_mvf;
int log2_min_pu_size = s->sps->log2_min_pu_size;
int log2_min_tu_size = s->sps->log2_min_tb_size;
int min_pu_width = s->sps->min_pu_width;
int min_tu_width = s->sps->min_tb_width;
int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width +
- (x0 >> log2_min_pu_size)].is_intra;
+ (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA;
int i, j, bs;
if (y0 > 0 && (y0 & 7) == 0) {
- int yp_pu = (y0 - 1) >> log2_min_pu_size;
- int yq_pu = y0 >> log2_min_pu_size;
- int yp_tu = (y0 - 1) >> log2_min_tu_size;
- int yq_tu = y0 >> log2_min_tu_size;
-
- for (i = 0; i < (1 << log2_trafo_size); i += 4) {
- int x_pu = (x0 + i) >> log2_min_pu_size;
- int x_tu = (x0 + i) >> log2_min_tu_size;
- MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu];
- MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu];
- uint8_t top_cbf_luma = s->cbf_luma[yp_tu * min_tu_width + x_tu];
- uint8_t curr_cbf_luma = s->cbf_luma[yq_tu * min_tu_width + x_tu];
+ int bd_ctby = y0 & ((1 << s->sps->log2_ctb_size) - 1);
+ int bd_slice = s->sh.slice_loop_filter_across_slices_enabled_flag ||
+ !(lc->slice_or_tiles_up_boundary & 1);
+ int bd_tiles = s->pps->loop_filter_across_tiles_enabled_flag ||
+ !(lc->slice_or_tiles_up_boundary & 2);
+ if (((bd_slice && bd_tiles) || bd_ctby)) {
+ int yp_pu = (y0 - 1) >> log2_min_pu_size;
+ int yq_pu = y0 >> log2_min_pu_size;
+ int yp_tu = (y0 - 1) >> log2_min_tu_size;
+ int yq_tu = y0 >> log2_min_tu_size;
RefPicList *top_refPicList = ff_hevc_get_ref_list(s, s->ref,
- x0 + i, y0 - 1);
-
- bs = boundary_strength(s, curr, curr_cbf_luma,
- top, top_cbf_luma, top_refPicList, 1);
- if (!s->sh.slice_loop_filter_across_slices_enabled_flag &&
- (slice_or_tiles_up_boundary & 1) &&
- (y0 % (1 << s->sps->log2_ctb_size)) == 0)
- bs = 0;
- else if (!s->pps->loop_filter_across_tiles_enabled_flag &&
- (slice_or_tiles_up_boundary & 2) &&
- (y0 % (1 << s->sps->log2_ctb_size)) == 0)
- bs = 0;
- if (y0 == 0 || s->sh.disable_deblocking_filter_flag == 1)
- bs = 0;
- if (bs)
- s->horizontal_bs[((x0 + i) + y0 * s->bs_width) >> 2] = bs;
- }
- }
-
- // bs for TU internal horizontal PU boundaries
- if (log2_trafo_size > s->sps->log2_min_pu_size && !is_intra)
- for (j = 8; j < (1 << log2_trafo_size); j += 8) {
- int yp_pu = (y0 + j - 1) >> log2_min_pu_size;
- int yq_pu = (y0 + j) >> log2_min_pu_size;
- int yp_tu = (y0 + j - 1) >> log2_min_tu_size;
- int yq_tu = (y0 + j) >> log2_min_tu_size;
+ x0, y0 - 1);
for (i = 0; i < (1 << log2_trafo_size); i += 4) {
int x_pu = (x0 + i) >> log2_min_pu_size;
@@ -650,81 +575,86 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu];
uint8_t top_cbf_luma = s->cbf_luma[yp_tu * min_tu_width + x_tu];
uint8_t curr_cbf_luma = s->cbf_luma[yq_tu * min_tu_width + x_tu];
- RefPicList *top_refPicList = ff_hevc_get_ref_list(s, s->ref,
- x0 + i,
- y0 + j - 1);
-
- bs = boundary_strength(s, curr, curr_cbf_luma,
- top, top_cbf_luma, top_refPicList, 0);
- if (s->sh.disable_deblocking_filter_flag == 1)
- bs = 0;
- if (bs)
- s->horizontal_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs;
+
+ if (curr->pred_flag == PF_INTRA || top->pred_flag == PF_INTRA)
+ bs = 2;
+ else if (curr_cbf_luma || top_cbf_luma)
+ bs = 1;
+ else
+ bs = boundary_strength(s, curr, top, top_refPicList);
+ s->horizontal_bs[((x0 + i) + y0 * s->bs_width) >> 2] = bs;
}
}
+ }
// bs for vertical TU boundaries
if (x0 > 0 && (x0 & 7) == 0) {
- int xp_pu = (x0 - 1) >> log2_min_pu_size;
- int xq_pu = x0 >> log2_min_pu_size;
- int xp_tu = (x0 - 1) >> log2_min_tu_size;
- int xq_tu = x0 >> log2_min_tu_size;
-
- for (i = 0; i < (1 << log2_trafo_size); i += 4) {
- int y_pu = (y0 + i) >> log2_min_pu_size;
- int y_tu = (y0 + i) >> log2_min_tu_size;
- MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu];
- MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu];
-
- uint8_t left_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xp_tu];
- uint8_t curr_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xq_tu];
+ int bd_ctbx = x0 & ((1 << s->sps->log2_ctb_size) - 1);
+ int bd_slice = s->sh.slice_loop_filter_across_slices_enabled_flag ||
+ !(lc->slice_or_tiles_left_boundary & 1);
+ int bd_tiles = s->pps->loop_filter_across_tiles_enabled_flag ||
+ !(lc->slice_or_tiles_left_boundary & 2);
+ if (((bd_slice && bd_tiles) || bd_ctbx)) {
+ int xp_pu = (x0 - 1) >> log2_min_pu_size;
+ int xq_pu = x0 >> log2_min_pu_size;
+ int xp_tu = (x0 - 1) >> log2_min_tu_size;
+ int xq_tu = x0 >> log2_min_tu_size;
RefPicList *left_refPicList = ff_hevc_get_ref_list(s, s->ref,
- x0 - 1, y0 + i);
-
- bs = boundary_strength(s, curr, curr_cbf_luma,
- left, left_cbf_luma, left_refPicList, 1);
- if (!s->sh.slice_loop_filter_across_slices_enabled_flag &&
- (slice_or_tiles_left_boundary & 1) &&
- (x0 % (1 << s->sps->log2_ctb_size)) == 0)
- bs = 0;
- else if (!s->pps->loop_filter_across_tiles_enabled_flag &&
- (slice_or_tiles_left_boundary & 2) &&
- (x0 % (1 << s->sps->log2_ctb_size)) == 0)
- bs = 0;
- if (x0 == 0 || s->sh.disable_deblocking_filter_flag == 1)
- bs = 0;
- if (bs)
+ x0 - 1, y0);
+
+ for (i = 0; i < (1 << log2_trafo_size); i += 4) {
+ int y_pu = (y0 + i) >> log2_min_pu_size;
+ int y_tu = (y0 + i) >> log2_min_tu_size;
+ MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu];
+ MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu];
+ uint8_t left_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xp_tu];
+ uint8_t curr_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xq_tu];
+
+ if (curr->pred_flag == PF_INTRA || left->pred_flag == PF_INTRA)
+ bs = 2;
+ else if (curr_cbf_luma || left_cbf_luma)
+ bs = 1;
+ else
+ bs = boundary_strength(s, curr, left, left_refPicList);
s->vertical_bs[(x0 >> 3) + ((y0 + i) >> 2) * s->bs_width] = bs;
+ }
}
}
- // bs for TU internal vertical PU boundaries
- if (log2_trafo_size > log2_min_pu_size && !is_intra)
+ if (log2_trafo_size > log2_min_pu_size && !is_intra) {
+ RefPicList *refPicList = ff_hevc_get_ref_list(s, s->ref,
+ x0,
+ y0);
+ // bs for TU internal horizontal PU boundaries
+ for (j = 8; j < (1 << log2_trafo_size); j += 8) {
+ int yp_pu = (y0 + j - 1) >> log2_min_pu_size;
+ int yq_pu = (y0 + j) >> log2_min_pu_size;
+
+ for (i = 0; i < (1 << log2_trafo_size); i += 4) {
+ int x_pu = (x0 + i) >> log2_min_pu_size;
+ MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu];
+ MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu];
+
+ bs = boundary_strength(s, curr, top, refPicList);
+ s->horizontal_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs;
+ }
+ }
+
+ // bs for TU internal vertical PU boundaries
for (j = 0; j < (1 << log2_trafo_size); j += 4) {
int y_pu = (y0 + j) >> log2_min_pu_size;
- int y_tu = (y0 + j) >> log2_min_tu_size;
for (i = 8; i < (1 << log2_trafo_size); i += 8) {
int xp_pu = (x0 + i - 1) >> log2_min_pu_size;
int xq_pu = (x0 + i) >> log2_min_pu_size;
- int xp_tu = (x0 + i - 1) >> log2_min_tu_size;
- int xq_tu = (x0 + i) >> log2_min_tu_size;
MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu];
MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu];
- uint8_t left_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xp_tu];
- uint8_t curr_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xq_tu];
- RefPicList *left_refPicList = ff_hevc_get_ref_list(s, s->ref,
- x0 + i - 1,
- y0 + j);
-
- bs = boundary_strength(s, curr, curr_cbf_luma,
- left, left_cbf_luma, left_refPicList, 0);
- if (s->sh.disable_deblocking_filter_flag == 1)
- bs = 0;
- if (bs)
- s->vertical_bs[((x0 + i) >> 3) + ((y0 + j) >> 2) * s->bs_width] = bs;
+
+ bs = boundary_strength(s, curr, left, refPicList);
+ s->vertical_bs[((x0 + i) >> 3) + ((y0 + j) >> 2) * s->bs_width] = bs;
}
}
+ }
}
#undef LUMA
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_mvs.c b/chromium/third_party/ffmpeg/libavcodec/hevc_mvs.c
index b4e067b8766..b7ca79c35e0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_mvs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_mvs.c
@@ -123,16 +123,18 @@ static int isDiffMER(HEVCContext *s, int xN, int yN, int xP, int yP)
// check if the mv's and refidx are the same between A and B
static int compareMVrefidx(struct MvField A, struct MvField B)
{
- if (A.pred_flag[0] && A.pred_flag[1] && B.pred_flag[0] && B.pred_flag[1])
- return MATCH(ref_idx[0]) && MATCH(mv[0].x) && MATCH(mv[0].y) &&
- MATCH(ref_idx[1]) && MATCH(mv[1].x) && MATCH(mv[1].y);
-
- if (A.pred_flag[0] && !A.pred_flag[1] && B.pred_flag[0] && !B.pred_flag[1])
- return MATCH(ref_idx[0]) && MATCH(mv[0].x) && MATCH(mv[0].y);
-
- if (!A.pred_flag[0] && A.pred_flag[1] && !B.pred_flag[0] && B.pred_flag[1])
- return MATCH(ref_idx[1]) && MATCH(mv[1].x) && MATCH(mv[1].y);
-
+ int a_pf = A.pred_flag;
+ int b_pf = B.pred_flag;
+ if (a_pf == b_pf) {
+ if (a_pf == PF_BI) {
+ return MATCH(ref_idx[0]) && MATCH(mv[0].x) && MATCH(mv[0].y) &&
+ MATCH(ref_idx[1]) && MATCH(mv[1].x) && MATCH(mv[1].y);
+ } else if (a_pf == PF_L0) {
+ return MATCH(ref_idx[0]) && MATCH(mv[0].x) && MATCH(mv[0].y);
+ } else if (a_pf == PF_L1) {
+ return MATCH(ref_idx[1]) && MATCH(mv[1].x) && MATCH(mv[1].y);
+ }
+ }
return 0;
}
@@ -140,14 +142,14 @@ static av_always_inline void mv_scale(Mv *dst, Mv *src, int td, int tb)
{
int tx, scale_factor;
- td = av_clip_int8_c(td);
- tb = av_clip_int8_c(tb);
+ td = av_clip_int8(td);
+ tb = av_clip_int8(tb);
tx = (0x4000 + abs(td / 2)) / td;
- scale_factor = av_clip_c((tb * tx + 32) >> 6, -4096, 4095);
- dst->x = av_clip_int16_c((scale_factor * src->x + 127 +
- (scale_factor * src->x < 0)) >> 8);
- dst->y = av_clip_int16_c((scale_factor * src->y + 127 +
- (scale_factor * src->y < 0)) >> 8);
+ scale_factor = av_clip((tb * tx + 32) >> 6, -4096, 4095);
+ dst->x = av_clip_int16((scale_factor * src->x + 127 +
+ (scale_factor * src->x < 0)) >> 8);
+ dst->y = av_clip_int16((scale_factor * src->y + 127 +
+ (scale_factor * src->y < 0)) >> 8);
}
static int check_mvset(Mv *mvLXCol, Mv *mvCol,
@@ -168,10 +170,7 @@ static int check_mvset(Mv *mvLXCol, Mv *mvCol,
col_poc_diff = colPic - refPicList_col[listCol].list[refidxCol];
cur_poc_diff = poc - refPicList[X].list[refIdxLx];
- if (!col_poc_diff)
- col_poc_diff = 1; // error resilience
-
- if (cur_lt || col_poc_diff == cur_poc_diff) {
+ if (cur_lt || col_poc_diff == cur_poc_diff || !col_poc_diff) {
mvLXCol->x = mvCol->x;
mvLXCol->y = mvCol->y;
} else {
@@ -193,17 +192,14 @@ static int derive_temporal_colocated_mvs(HEVCContext *s, MvField temp_col,
{
RefPicList *refPicList = s->ref->refPicList;
- if (temp_col.is_intra) {
- mvLXCol->x = 0;
- mvLXCol->y = 0;
+ if (temp_col.pred_flag == PF_INTRA)
return 0;
- }
- if (temp_col.pred_flag[0] == 0)
+ if (!(temp_col.pred_flag & PF_L0))
return CHECK_MVSET(1);
- else if (temp_col.pred_flag[0] == 1 && temp_col.pred_flag[1] == 0)
+ else if (temp_col.pred_flag == PF_L0)
return CHECK_MVSET(0);
- else if (temp_col.pred_flag[0] == 1 && temp_col.pred_flag[1] == 1) {
+ else if (temp_col.pred_flag == PF_BI) {
int check_diffpicount = 0;
int i = 0;
for (i = 0; i < refPicList[0].nb_refs; i++) {
@@ -295,7 +291,7 @@ static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0,
}
#define AVAILABLE(cand, v) \
- (cand && !TAB_MVF_PU(v).is_intra)
+ (cand && !(TAB_MVF_PU(v).pred_flag == PF_INTRA))
#define PRED_BLOCK_AVAILABLE(v) \
check_prediction_block_available(s, log2_cb_size, \
@@ -458,9 +454,7 @@ static void derive_spatial_merge_candidates(HEVCContext *s, int x0, int y0,
0, &mv_l1_col, 1) : 0;
if (available_l0 || available_l1) {
- mergecandlist[nb_merge_cand].is_intra = 0;
- mergecandlist[nb_merge_cand].pred_flag[0] = available_l0;
- mergecandlist[nb_merge_cand].pred_flag[1] = available_l1;
+ mergecandlist[nb_merge_cand].pred_flag = available_l0 + (available_l1 << 1);
if (available_l0) {
mergecandlist[nb_merge_cand].mv[0] = mv_l0_col;
mergecandlist[nb_merge_cand].ref_idx[0] = 0;
@@ -487,20 +481,18 @@ static void derive_spatial_merge_candidates(HEVCContext *s, int x0, int y0,
MvField l0_cand = mergecandlist[l0_cand_idx];
MvField l1_cand = mergecandlist[l1_cand_idx];
- if (l0_cand.pred_flag[0] && l1_cand.pred_flag[1] &&
+ if ((l0_cand.pred_flag & PF_L0) && (l1_cand.pred_flag & PF_L1) &&
(refPicList[0].list[l0_cand.ref_idx[0]] !=
refPicList[1].list[l1_cand.ref_idx[1]] ||
l0_cand.mv[0].x != l1_cand.mv[1].x ||
l0_cand.mv[0].y != l1_cand.mv[1].y)) {
mergecandlist[nb_merge_cand].ref_idx[0] = l0_cand.ref_idx[0];
mergecandlist[nb_merge_cand].ref_idx[1] = l1_cand.ref_idx[1];
- mergecandlist[nb_merge_cand].pred_flag[0] = 1;
- mergecandlist[nb_merge_cand].pred_flag[1] = 1;
+ mergecandlist[nb_merge_cand].pred_flag = PF_BI;
mergecandlist[nb_merge_cand].mv[0].x = l0_cand.mv[0].x;
mergecandlist[nb_merge_cand].mv[0].y = l0_cand.mv[0].y;
mergecandlist[nb_merge_cand].mv[1].x = l1_cand.mv[1].x;
mergecandlist[nb_merge_cand].mv[1].y = l1_cand.mv[1].y;
- mergecandlist[nb_merge_cand].is_intra = 0;
nb_merge_cand++;
}
}
@@ -508,13 +500,11 @@ static void derive_spatial_merge_candidates(HEVCContext *s, int x0, int y0,
// append Zero motion vector candidates
while (nb_merge_cand < s->sh.max_num_merge_cand) {
- mergecandlist[nb_merge_cand].pred_flag[0] = 1;
- mergecandlist[nb_merge_cand].pred_flag[1] = s->sh.slice_type == B_SLICE;
+ mergecandlist[nb_merge_cand].pred_flag = PF_L0 + ((s->sh.slice_type == B_SLICE) << 1);
mergecandlist[nb_merge_cand].mv[0].x = 0;
mergecandlist[nb_merge_cand].mv[0].y = 0;
mergecandlist[nb_merge_cand].mv[1].x = 0;
mergecandlist[nb_merge_cand].mv[1].y = 0;
- mergecandlist[nb_merge_cand].is_intra = 0;
mergecandlist[nb_merge_cand].ref_idx[0] = zero_idx < nb_refs ? zero_idx : 0;
mergecandlist[nb_merge_cand].ref_idx[1] = zero_idx < nb_refs ? zero_idx : 0;
@@ -550,11 +540,9 @@ void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, int nPbW,
derive_spatial_merge_candidates(s, x0, y0, nPbW, nPbH, log2_cb_size,
singleMCLFlag, part_idx, mergecand_list);
- if (mergecand_list[merge_idx].pred_flag[0] == 1 &&
- mergecand_list[merge_idx].pred_flag[1] == 1 &&
+ if (mergecand_list[merge_idx].pred_flag == PF_BI &&
(nPbW2 + nPbH2) == 12) {
- mergecand_list[merge_idx].ref_idx[1] = -1;
- mergecand_list[merge_idx].pred_flag[1] = 0;
+ mergecand_list[merge_idx].pred_flag = PF_L0;
}
*mv = mergecand_list[merge_idx];
@@ -569,8 +557,12 @@ static av_always_inline void dist_scale(HEVCContext *s, Mv *mv,
int ref_pic_elist = refPicList[elist].list[TAB_MVF(x, y).ref_idx[elist]];
int ref_pic_curr = refPicList[ref_idx_curr].list[ref_idx];
- if (ref_pic_elist != ref_pic_curr)
- mv_scale(mv, mv, s->poc - ref_pic_elist, s->poc - ref_pic_curr);
+ if (ref_pic_elist != ref_pic_curr) {
+ int poc_diff = s->poc - ref_pic_elist;
+ if (!poc_diff)
+ poc_diff = 1;
+ mv_scale(mv, mv, poc_diff, s->poc - ref_pic_curr);
+ }
}
static int mv_mp_mode_mx(HEVCContext *s, int x, int y, int pred_flag_index,
@@ -581,7 +573,7 @@ static int mv_mp_mode_mx(HEVCContext *s, int x, int y, int pred_flag_index,
RefPicList *refPicList = s->ref->refPicList;
- if (TAB_MVF(x, y).pred_flag[pred_flag_index] == 1 &&
+ if (((TAB_MVF(x, y).pred_flag) & (1 << pred_flag_index)) &&
refPicList[pred_flag_index].list[TAB_MVF(x, y).ref_idx[pred_flag_index]] == refPicList[ref_idx_curr].list[ref_idx]) {
*mv = TAB_MVF(x, y).mv[pred_flag_index];
return 1;
@@ -596,18 +588,20 @@ static int mv_mp_mode_mx_lt(HEVCContext *s, int x, int y, int pred_flag_index,
int min_pu_width = s->sps->min_pu_width;
RefPicList *refPicList = s->ref->refPicList;
- int currIsLongTerm = refPicList[ref_idx_curr].isLongTerm[ref_idx];
- int colIsLongTerm =
- refPicList[pred_flag_index].isLongTerm[(TAB_MVF(x, y).ref_idx[pred_flag_index])];
+ if ((TAB_MVF(x, y).pred_flag) & (1 << pred_flag_index)) {
+ int currIsLongTerm = refPicList[ref_idx_curr].isLongTerm[ref_idx];
- if (TAB_MVF(x, y).pred_flag[pred_flag_index] &&
- colIsLongTerm == currIsLongTerm) {
- *mv = TAB_MVF(x, y).mv[pred_flag_index];
- if (!currIsLongTerm)
- dist_scale(s, mv, min_pu_width, x, y,
- pred_flag_index, ref_idx_curr, ref_idx);
- return 1;
+ int colIsLongTerm =
+ refPicList[pred_flag_index].isLongTerm[(TAB_MVF(x, y).ref_idx[pred_flag_index])];
+
+ if (colIsLongTerm == currIsLongTerm) {
+ *mv = TAB_MVF(x, y).mv[pred_flag_index];
+ if (!currIsLongTerm)
+ dist_scale(s, mv, min_pu_width, x, y,
+ pred_flag_index, ref_idx_curr, ref_idx);
+ return 1;
+ }
}
return 0;
}
@@ -653,8 +647,8 @@ void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW,
int xB2_pu = 0, yB2_pu = 0;
int is_available_b2 = 0;
Mv mvpcand_list[2] = { { 0 } };
- Mv mxA = { 0 };
- Mv mxB = { 0 };
+ Mv mxA;
+ Mv mxB;
int ref_idx_curr = 0;
int ref_idx = 0;
int pred_flag_index_l0;
@@ -808,10 +802,5 @@ void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW,
mvpcand_list[numMVPCandLX++] = mv_col;
}
- // insert zero motion vectors when the number of available candidates are less than 2
- while (numMVPCandLX < 2)
- mvpcand_list[numMVPCandLX++] = (Mv){ 0, 0 };
-
- mv->mv[LX].x = mvpcand_list[mvp_lx_flag].x;
- mv->mv[LX].y = mvpcand_list[mvp_lx_flag].y;
+ mv->mv[LX] = mvpcand_list[mvp_lx_flag];
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c b/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c
index 16eeab40cd4..647f83eec6d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c
@@ -92,7 +92,7 @@ int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
uint8_t delta_rps_sign;
if (is_slice_header) {
- int delta_idx = get_ue_golomb_long(gb) + 1;
+ unsigned int delta_idx = get_ue_golomb_long(gb) + 1;
if (delta_idx > sps->nb_st_rps) {
av_log(s->avctx, AV_LOG_ERROR,
"Invalid value of delta_idx in slice header RPS: %d > %d.\n",
@@ -192,7 +192,7 @@ int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
}
-static int decode_profile_tier_level(HEVCContext *s, ProfileTierLevel *ptl)
+static void decode_profile_tier_level(HEVCContext *s, PTLCommon *ptl)
{
int i;
HEVCLocalContext *lc = s->HEVClc;
@@ -201,12 +201,14 @@ static int decode_profile_tier_level(HEVCContext *s, ProfileTierLevel *ptl)
ptl->profile_space = get_bits(gb, 2);
ptl->tier_flag = get_bits1(gb);
ptl->profile_idc = get_bits(gb, 5);
- if (ptl->profile_idc == 1)
+ if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN)
av_log(s->avctx, AV_LOG_DEBUG, "Main profile bitstream\n");
- else if (ptl->profile_idc == 2)
- av_log(s->avctx, AV_LOG_DEBUG, "Main10 profile bitstream\n");
+ else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_10)
+ av_log(s->avctx, AV_LOG_DEBUG, "Main 10 profile bitstream\n");
+ else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_STILL_PICTURE)
+ av_log(s->avctx, AV_LOG_DEBUG, "Main Still Picture profile bitstream\n");
else
- av_log(s->avctx, AV_LOG_WARNING, "No profile indication! (%d)\n", ptl->profile_idc);
+ av_log(s->avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc);
for (i = 0; i < 32; i++)
ptl->profile_compatibility_flag[i] = get_bits1(gb);
@@ -214,22 +216,19 @@ static int decode_profile_tier_level(HEVCContext *s, ProfileTierLevel *ptl)
ptl->interlaced_source_flag = get_bits1(gb);
ptl->non_packed_constraint_flag = get_bits1(gb);
ptl->frame_only_constraint_flag = get_bits1(gb);
- if (get_bits(gb, 16) != 0) // XXX_reserved_zero_44bits[0..15]
- return -1;
- if (get_bits(gb, 16) != 0) // XXX_reserved_zero_44bits[16..31]
- return -1;
- if (get_bits(gb, 12) != 0) // XXX_reserved_zero_44bits[32..43]
- return -1;
- ptl->level_idc = get_bits(gb, 8);
- return 0;
+
+ skip_bits(gb, 16); // XXX_reserved_zero_44bits[0..15]
+ skip_bits(gb, 16); // XXX_reserved_zero_44bits[16..31]
+ skip_bits(gb, 12); // XXX_reserved_zero_44bits[32..43]
}
-static int parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers)
+static void parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers)
{
int i;
HEVCLocalContext *lc = s->HEVClc;
GetBitContext *gb = &lc->gb;
- decode_profile_tier_level(s, &ptl->general_PTL);
+ decode_profile_tier_level(s, &ptl->general_ptl);
+ ptl->general_ptl.level_idc = get_bits(gb, 8);
for (i = 0; i < max_num_sub_layers - 1; i++) {
ptl->sub_layer_profile_present_flag[i] = get_bits1(gb);
@@ -239,15 +238,14 @@ static int parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers)
for (i = max_num_sub_layers - 1; i < 8; i++)
skip_bits(gb, 2); // reserved_zero_2bits[i]
for (i = 0; i < max_num_sub_layers - 1; i++) {
- if (ptl->sub_layer_profile_present_flag[i]) {
- decode_profile_tier_level(s, &ptl->sub_layer_PTL[i]);
- ptl->sub_layer_PTL[i].level_idc = get_bits(gb, 8);
- }
+ if (ptl->sub_layer_profile_present_flag[i])
+ decode_profile_tier_level(s, &ptl->sub_layer_ptl[i]);
+ if (ptl->sub_layer_level_present_flag[i])
+ ptl->sub_layer_ptl[i].level_idc = get_bits(gb, 8);
}
- return 0;
}
-static void decode_sublayer_hrd(HEVCContext *s, int nb_cpb,
+static void decode_sublayer_hrd(HEVCContext *s, unsigned int nb_cpb,
int subpic_params_present)
{
GetBitContext *gb = &s->HEVClc->gb;
@@ -301,7 +299,7 @@ static void decode_hrd(HEVCContext *s, int common_inf_present,
for (i = 0; i < max_sublayers; i++) {
int low_delay = 0;
- int nb_cpb = 1;
+ unsigned int nb_cpb = 1;
int fixed_rate = get_bits1(gb);
if (!fixed_rate)
@@ -336,9 +334,6 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
av_log(s->avctx, AV_LOG_DEBUG, "Decoding VPS\n");
- if (!vps)
- return AVERROR(ENOMEM);
-
vps_id = get_bits(gb, 4);
if (vps_id >= MAX_VPS_COUNT) {
av_log(s->avctx, AV_LOG_ERROR, "VPS id out of range: %d\n", vps_id);
@@ -365,10 +360,8 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
goto err;
}
- if (parse_ptl(s, &vps->ptl, vps->vps_max_sub_layers) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Error decoding profile tier level.\n");
- goto err;
- }
+ parse_ptl(s, &vps->ptl, vps->vps_max_sub_layers);
+
vps->vps_sub_layer_ordering_info_present_flag = get_bits1(gb);
i = vps->vps_sub_layer_ordering_info_present_flag ? 0 : vps->vps_max_sub_layers - 1;
@@ -412,12 +405,10 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
decode_hrd(s, common_inf_present, vps->vps_max_sub_layers);
}
}
-
- vps->vps_extension_flag = get_bits1(gb);
+ get_bits1(gb); /* vps_extension_flag */
av_buffer_unref(&s->vps_list[vps_id]);
s->vps_list[vps_id] = vps_buf;
-
return 0;
err:
@@ -510,10 +501,8 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
vui->vui_timing_info_present_flag = get_bits1(gb);
if (vui->vui_timing_info_present_flag) {
- vui->vui_num_units_in_tick = get_bits(gb, 32);
- vui->vui_time_scale = get_bits(gb, 32);
- s->avctx->time_base.num = vui->vui_num_units_in_tick;
- s->avctx->time_base.den = vui->vui_time_scale;
+ vui->vui_num_units_in_tick = get_bits_long(gb, 32);
+ vui->vui_time_scale = get_bits_long(gb, 32);
vui->vui_poc_proportional_to_timing_flag = get_bits1(gb);
if (vui->vui_poc_proportional_to_timing_flag)
vui->vui_num_ticks_poc_diff_one_minus1 = get_ue_golomb_long(gb);
@@ -566,18 +555,18 @@ static int scaling_list_data(HEVCContext *s, ScalingList *sl)
GetBitContext *gb = &s->HEVClc->gb;
uint8_t scaling_list_pred_mode_flag[4][6];
int32_t scaling_list_dc_coef[2][6];
- int size_id, matrix_id, i, pos, delta;
+ int size_id, matrix_id, i, pos;
for (size_id = 0; size_id < 4; size_id++)
for (matrix_id = 0; matrix_id < (size_id == 3 ? 2 : 6); matrix_id++) {
scaling_list_pred_mode_flag[size_id][matrix_id] = get_bits1(gb);
if (!scaling_list_pred_mode_flag[size_id][matrix_id]) {
- delta = get_ue_golomb_long(gb);
+ unsigned int delta = get_ue_golomb_long(gb);
/* Only need to handle non-zero delta. Zero means default,
* which should already be in the arrays. */
if (delta) {
// Copy from previous array.
- if (matrix_id - delta < 0) {
+ if (matrix_id < delta) {
av_log(s->avctx, AV_LOG_ERROR,
"Invalid delta in scaling list data: %d.\n", delta);
return AVERROR_INVALIDDATA;
@@ -622,8 +611,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
{
const AVPixFmtDescriptor *desc;
GetBitContext *gb = &s->HEVClc->gb;
- int ret = 0;
- int sps_id = 0;
+ int ret = 0;
+ unsigned int sps_id = 0;
int log2_diff_max_min_transform_block_size;
int bit_depth_chroma, start, vui_present, sublayer_ordering_info;
int i;
@@ -646,6 +635,13 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
goto err;
}
+ if (!s->vps_list[sps->vps_id]) {
+ av_log(s->avctx, AV_LOG_ERROR, "VPS %d does not exist\n",
+ sps->vps_id);
+ ret = AVERROR_INVALIDDATA;
+ goto err;
+ }
+
sps->max_sub_layers = get_bits(gb, 3) + 1;
if (sps->max_sub_layers > MAX_SUB_LAYERS) {
av_log(s->avctx, AV_LOG_ERROR, "sps_max_sub_layers out of range: %d\n",
@@ -656,11 +652,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
skip_bits1(gb); // temporal_id_nesting_flag
- if (parse_ptl(s, &sps->ptl, sps->max_sub_layers) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "error decoding profile tier level\n");
- ret = AVERROR_INVALIDDATA;
- goto err;
- }
+ parse_ptl(s, &sps->ptl, sps->max_sub_layers);
+
sps_id = get_ue_golomb_long(gb);
if (sps_id >= MAX_SPS_COUNT) {
av_log(s->avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", sps_id);
@@ -771,8 +764,11 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
if (sps->temporal_layer[i].num_reorder_pics > sps->temporal_layer[i].max_dec_pic_buffering - 1) {
av_log(s->avctx, AV_LOG_ERROR, "sps_max_num_reorder_pics out of range: %d\n",
sps->temporal_layer[i].num_reorder_pics);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ if (sps->temporal_layer[i].num_reorder_pics > MAX_DPB_SIZE - 1) {
+ ret = AVERROR_INVALIDDATA;
+ goto err;
+ }
+ sps->temporal_layer[i].max_dec_pic_buffering = sps->temporal_layer[i].num_reorder_pics + 1;
}
}
@@ -997,8 +993,8 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
int pic_area_in_ctbs, pic_area_in_min_cbs, pic_area_in_min_tbs;
int log2_diff_ctb_min_tb_size;
int i, j, x, y, ctb_addr_rs, tile_id;
- int ret = 0;
- int pps_id = 0;
+ int ret = 0;
+ unsigned int pps_id = 0;
AVBufferRef *pps_buf;
HEVCPPS *pps = av_mallocz(sizeof(*pps));
@@ -1038,7 +1034,7 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
goto err;
}
if (!s->sps_list[pps->sps_id]) {
- av_log(s->avctx, AV_LOG_ERROR, "SPS does not exist \n");
+ av_log(s->avctx, AV_LOG_ERROR, "SPS %u does not exist.\n", pps->sps_id);
ret = AVERROR_INVALIDDATA;
goto err;
}
@@ -1115,7 +1111,7 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
pps->uniform_spacing_flag = get_bits1(gb);
if (!pps->uniform_spacing_flag) {
- int sum = 0;
+ uint64_t sum = 0;
for (i = 0; i < pps->num_tile_columns - 1; i++) {
pps->column_width[i] = get_ue_golomb_long(gb) + 1;
sum += pps->column_width[i];
@@ -1183,7 +1179,7 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
}
pps->slice_header_extension_present_flag = get_bits1(gb);
- pps->pps_extension_flag = get_bits1(gb);
+ skip_bits1(gb); // pps_extension_flag
// Inferred parameters
pps->col_bd = av_malloc_array(pps->num_tile_columns + 1, sizeof(*pps->col_bd));
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_refs.c b/chromium/third_party/ffmpeg/libavcodec/hevc_refs.c
index 118688f55f2..24d55d15bec 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_refs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_refs.c
@@ -1,5 +1,5 @@
/*
- * HEVC video Decoder
+ * HEVC video decoder
*
* Copyright (C) 2012 - 2013 Guillaume Martres
* Copyright (C) 2012 - 2013 Gildas Cocherel
@@ -146,6 +146,8 @@ int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc)
ref->poc = poc;
ref->flags = HEVC_FRAME_FLAG_OUTPUT | HEVC_FRAME_FLAG_SHORT_REF;
+ if (s->sh.pic_output_flag == 0)
+ ref->flags &= ~(HEVC_FRAME_FLAG_OUTPUT);
ref->sequence = s->seq_decode;
ref->window = s->sps->output_window;
@@ -159,6 +161,16 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
int min_poc = INT_MAX;
int i, min_idx, ret;
+ if (s->sh.no_output_of_prior_pics_flag == 1) {
+ for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
+ HEVCFrame *frame = &s->DPB[i];
+ if ((frame->flags & HEVC_FRAME_FLAG_OUTPUT) && frame->poc != s->poc &&
+ frame->sequence == s->seq_output) {
+ frame->flags &= ~(HEVC_FRAME_FLAG_OUTPUT);
+ }
+ }
+ }
+
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
HEVCFrame *frame = &s->DPB[i];
if ((frame->flags & HEVC_FRAME_FLAG_OUTPUT) &&
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_sei.c b/chromium/third_party/ffmpeg/libavcodec/hevc_sei.c
index af8cb7d60eb..216db37e537 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_sei.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_sei.c
@@ -22,8 +22,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "hevc.h"
#include "golomb.h"
+#include "hevc.h"
static void decode_nal_sei_decoded_picture_hash(HEVCContext *s)
{
@@ -52,21 +52,21 @@ static void decode_nal_sei_decoded_picture_hash(HEVCContext *s)
static void decode_nal_sei_frame_packing_arrangement(HEVCContext *s)
{
GetBitContext *gb = &s->HEVClc->gb;
- int cancel, type, quincunx;
get_ue_golomb(gb); // frame_packing_arrangement_id
- cancel = get_bits1(gb); // frame_packing_cancel_flag
- if (cancel == 0) {
- type = get_bits(gb, 7); // frame_packing_arrangement_type
- quincunx = get_bits1(gb); // quincunx_sampling_flag
- skip_bits(gb, 6); // content_interpretation_type
+ s->sei_frame_packing_present = !get_bits1(gb);
+
+ if (s->sei_frame_packing_present) {
+ s->frame_packing_arrangement_type = get_bits(gb, 7);
+ s->quincunx_subsampling = get_bits1(gb);
+ s->content_interpretation_type = get_bits(gb, 6);
// the following skips spatial_flipping_flag frame0_flipped_flag
// field_views_flag current_frame_is_frame0_flag
// frame0_self_contained_flag frame1_self_contained_flag
skip_bits(gb, 6);
- if (quincunx == 0 && type != 5)
+ if (!s->quincunx_subsampling && s->frame_packing_arrangement_type != 5)
skip_bits(gb, 16); // frame[01]_grid_position_[xy]
skip_bits(gb, 8); // frame_packing_arrangement_reserved_byte
skip_bits1(gb); // frame_packing_arrangement_persistance_flag
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevcdsp.c b/chromium/third_party/ffmpeg/libavcodec/hevcdsp.c
index b3abc9d8a58..e6f56386e77 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevcdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevcdsp.c
@@ -2,6 +2,8 @@
* HEVC video decoder
*
* Copyright (C) 2012 - 2013 Guillaume Martres
+ * Copyright (C) 2013 - 2014 Pierre-Edouard Lepere
+ *
*
* This file is part of FFmpeg.
*
@@ -20,7 +22,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "hevc.h"
#include "hevcdsp.h"
static const int8_t transform[32][32] = {
@@ -90,14 +91,20 @@ static const int8_t transform[32][32] = {
90, -90, 88, -85, 82, -78, 73, -67, 61, -54, 46, -38, 31, -22, 13, -4 },
};
-DECLARE_ALIGNED(16, const int8_t, ff_hevc_epel_filters[7][16]) = {
- { -2, 58, 10, -2, -2, 58, 10, -2, -2, 58, 10, -2, -2, 58, 10, -2 },
- { -4, 54, 16, -2, -4, 54, 16, -2, -4, 54, 16, -2, -4, 54, 16, -2 },
- { -6, 46, 28, -4, -6, 46, 28, -4, -6, 46, 28, -4, -6, 46, 28, -4 },
- { -4, 36, 36, -4, -4, 36, 36, -4, -4, 36, 36, -4, -4, 36, 36, -4 },
- { -4, 28, 46, -6, -4, 28, 46, -6, -4, 28, 46, -6, -4, 28, 46, -6 },
- { -2, 16, 54, -4, -2, 16, 54, -4, -2, 16, 54, -4, -2, 16, 54, -4 },
- { -2, 10, 58, -2, -2, 10, 58, -2, -2, 10, 58, -2, -2, 10, 58, -2 },
+DECLARE_ALIGNED(16, const int8_t, ff_hevc_epel_filters[7][4]) = {
+ { -2, 58, 10, -2},
+ { -4, 54, 16, -2},
+ { -6, 46, 28, -4},
+ { -4, 36, 36, -4},
+ { -4, 28, 46, -6},
+ { -2, 16, 54, -4},
+ { -2, 10, 58, -2},
+};
+
+DECLARE_ALIGNED(16, const int8_t, ff_hevc_qpel_filters[3][16]) = {
+ { -1, 4,-10, 58, 17, -5, 1, 0, -1, 4,-10, 58, 17, -5, 1, 0},
+ { -1, 4,-11, 40, 40,-11, 4, -1, -1, 4,-11, 40, 40,-11, 4, -1},
+ { 0, 1, -5, 17, 58,-10, 4, -1, 0, 1, -5, 17, 58,-10, 4, -1}
};
#define BIT_DEPTH 8
@@ -117,6 +124,71 @@ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
#undef FUNC
#define FUNC(a, depth) a ## _ ## depth
+#undef PEL_FUNC
+#define PEL_FUNC(dst1, idx1, idx2, a, depth) \
+ for(i = 0 ; i < 10 ; i++) \
+{ \
+ hevcdsp->dst1[i][idx1][idx2] = a ## _ ## depth; \
+}
+
+#undef EPEL_FUNCS
+#define EPEL_FUNCS(depth) \
+ PEL_FUNC(put_hevc_epel, 0, 0, put_hevc_pel_pixels, depth); \
+ PEL_FUNC(put_hevc_epel, 0, 1, put_hevc_epel_h, depth); \
+ PEL_FUNC(put_hevc_epel, 1, 0, put_hevc_epel_v, depth); \
+ PEL_FUNC(put_hevc_epel, 1, 1, put_hevc_epel_hv, depth)
+
+#undef EPEL_UNI_FUNCS
+#define EPEL_UNI_FUNCS(depth) \
+ PEL_FUNC(put_hevc_epel_uni, 0, 0, put_hevc_pel_uni_pixels, depth); \
+ PEL_FUNC(put_hevc_epel_uni, 0, 1, put_hevc_epel_uni_h, depth); \
+ PEL_FUNC(put_hevc_epel_uni, 1, 0, put_hevc_epel_uni_v, depth); \
+ PEL_FUNC(put_hevc_epel_uni, 1, 1, put_hevc_epel_uni_hv, depth); \
+ PEL_FUNC(put_hevc_epel_uni_w, 0, 0, put_hevc_pel_uni_w_pixels, depth); \
+ PEL_FUNC(put_hevc_epel_uni_w, 0, 1, put_hevc_epel_uni_w_h, depth); \
+ PEL_FUNC(put_hevc_epel_uni_w, 1, 0, put_hevc_epel_uni_w_v, depth); \
+ PEL_FUNC(put_hevc_epel_uni_w, 1, 1, put_hevc_epel_uni_w_hv, depth)
+
+#undef EPEL_BI_FUNCS
+#define EPEL_BI_FUNCS(depth) \
+ PEL_FUNC(put_hevc_epel_bi, 0, 0, put_hevc_pel_bi_pixels, depth); \
+ PEL_FUNC(put_hevc_epel_bi, 0, 1, put_hevc_epel_bi_h, depth); \
+ PEL_FUNC(put_hevc_epel_bi, 1, 0, put_hevc_epel_bi_v, depth); \
+ PEL_FUNC(put_hevc_epel_bi, 1, 1, put_hevc_epel_bi_hv, depth); \
+ PEL_FUNC(put_hevc_epel_bi_w, 0, 0, put_hevc_pel_bi_w_pixels, depth); \
+ PEL_FUNC(put_hevc_epel_bi_w, 0, 1, put_hevc_epel_bi_w_h, depth); \
+ PEL_FUNC(put_hevc_epel_bi_w, 1, 0, put_hevc_epel_bi_w_v, depth); \
+ PEL_FUNC(put_hevc_epel_bi_w, 1, 1, put_hevc_epel_bi_w_hv, depth)
+
+#undef QPEL_FUNCS
+#define QPEL_FUNCS(depth) \
+ PEL_FUNC(put_hevc_qpel, 0, 0, put_hevc_pel_pixels, depth); \
+ PEL_FUNC(put_hevc_qpel, 0, 1, put_hevc_qpel_h, depth); \
+ PEL_FUNC(put_hevc_qpel, 1, 0, put_hevc_qpel_v, depth); \
+ PEL_FUNC(put_hevc_qpel, 1, 1, put_hevc_qpel_hv, depth)
+
+#undef QPEL_UNI_FUNCS
+#define QPEL_UNI_FUNCS(depth) \
+ PEL_FUNC(put_hevc_qpel_uni, 0, 0, put_hevc_pel_uni_pixels, depth); \
+ PEL_FUNC(put_hevc_qpel_uni, 0, 1, put_hevc_qpel_uni_h, depth); \
+ PEL_FUNC(put_hevc_qpel_uni, 1, 0, put_hevc_qpel_uni_v, depth); \
+ PEL_FUNC(put_hevc_qpel_uni, 1, 1, put_hevc_qpel_uni_hv, depth); \
+ PEL_FUNC(put_hevc_qpel_uni_w, 0, 0, put_hevc_pel_uni_w_pixels, depth); \
+ PEL_FUNC(put_hevc_qpel_uni_w, 0, 1, put_hevc_qpel_uni_w_h, depth); \
+ PEL_FUNC(put_hevc_qpel_uni_w, 1, 0, put_hevc_qpel_uni_w_v, depth); \
+ PEL_FUNC(put_hevc_qpel_uni_w, 1, 1, put_hevc_qpel_uni_w_hv, depth)
+
+#undef QPEL_BI_FUNCS
+#define QPEL_BI_FUNCS(depth) \
+ PEL_FUNC(put_hevc_qpel_bi, 0, 0, put_hevc_pel_bi_pixels, depth); \
+ PEL_FUNC(put_hevc_qpel_bi, 0, 1, put_hevc_qpel_bi_h, depth); \
+ PEL_FUNC(put_hevc_qpel_bi, 1, 0, put_hevc_qpel_bi_v, depth); \
+ PEL_FUNC(put_hevc_qpel_bi, 1, 1, put_hevc_qpel_bi_hv, depth); \
+ PEL_FUNC(put_hevc_qpel_bi_w, 0, 0, put_hevc_pel_bi_w_pixels, depth); \
+ PEL_FUNC(put_hevc_qpel_bi_w, 0, 1, put_hevc_qpel_bi_w_h, depth); \
+ PEL_FUNC(put_hevc_qpel_bi_w, 1, 0, put_hevc_qpel_bi_w_v, depth); \
+ PEL_FUNC(put_hevc_qpel_bi_w, 1, 1, put_hevc_qpel_bi_w_hv, depth)
+
#define HEVC_DSP(depth) \
hevcdsp->put_pcm = FUNC(put_pcm, depth); \
hevcdsp->transquant_bypass[0] = FUNC(transquant_bypass4x4, depth); \
@@ -139,35 +211,14 @@ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
hevcdsp->sao_edge_filter[1] = FUNC(sao_edge_filter_1, depth); \
hevcdsp->sao_edge_filter[2] = FUNC(sao_edge_filter_2, depth); \
hevcdsp->sao_edge_filter[3] = FUNC(sao_edge_filter_3, depth); \
- \
- hevcdsp->put_hevc_qpel[0][0] = FUNC(put_hevc_qpel_pixels, depth); \
- hevcdsp->put_hevc_qpel[0][1] = FUNC(put_hevc_qpel_h1, depth); \
- hevcdsp->put_hevc_qpel[0][2] = FUNC(put_hevc_qpel_h2, depth); \
- hevcdsp->put_hevc_qpel[0][3] = FUNC(put_hevc_qpel_h3, depth); \
- hevcdsp->put_hevc_qpel[1][0] = FUNC(put_hevc_qpel_v1, depth); \
- hevcdsp->put_hevc_qpel[1][1] = FUNC(put_hevc_qpel_h1v1, depth); \
- hevcdsp->put_hevc_qpel[1][2] = FUNC(put_hevc_qpel_h2v1, depth); \
- hevcdsp->put_hevc_qpel[1][3] = FUNC(put_hevc_qpel_h3v1, depth); \
- hevcdsp->put_hevc_qpel[2][0] = FUNC(put_hevc_qpel_v2, depth); \
- hevcdsp->put_hevc_qpel[2][1] = FUNC(put_hevc_qpel_h1v2, depth); \
- hevcdsp->put_hevc_qpel[2][2] = FUNC(put_hevc_qpel_h2v2, depth); \
- hevcdsp->put_hevc_qpel[2][3] = FUNC(put_hevc_qpel_h3v2, depth); \
- hevcdsp->put_hevc_qpel[3][0] = FUNC(put_hevc_qpel_v3, depth); \
- hevcdsp->put_hevc_qpel[3][1] = FUNC(put_hevc_qpel_h1v3, depth); \
- hevcdsp->put_hevc_qpel[3][2] = FUNC(put_hevc_qpel_h2v3, depth); \
- hevcdsp->put_hevc_qpel[3][3] = FUNC(put_hevc_qpel_h3v3, depth); \
- \
- hevcdsp->put_hevc_epel[0][0] = FUNC(put_hevc_epel_pixels, depth); \
- hevcdsp->put_hevc_epel[0][1] = FUNC(put_hevc_epel_h, depth); \
- hevcdsp->put_hevc_epel[1][0] = FUNC(put_hevc_epel_v, depth); \
- hevcdsp->put_hevc_epel[1][1] = FUNC(put_hevc_epel_hv, depth); \
- \
- hevcdsp->put_unweighted_pred = FUNC(put_unweighted_pred, depth); \
- hevcdsp->put_weighted_pred_avg = FUNC(put_weighted_pred_avg, depth); \
- \
- hevcdsp->weighted_pred = FUNC(weighted_pred, depth); \
- hevcdsp->weighted_pred_avg = FUNC(weighted_pred_avg, depth); \
- \
+ \
+ QPEL_FUNCS(depth); \
+ QPEL_UNI_FUNCS(depth); \
+ QPEL_BI_FUNCS(depth); \
+ EPEL_FUNCS(depth); \
+ EPEL_UNI_FUNCS(depth); \
+ EPEL_BI_FUNCS(depth); \
+ \
hevcdsp->hevc_h_loop_filter_luma = FUNC(hevc_h_loop_filter_luma, depth); \
hevcdsp->hevc_v_loop_filter_luma = FUNC(hevc_v_loop_filter_luma, depth); \
hevcdsp->hevc_h_loop_filter_chroma = FUNC(hevc_h_loop_filter_chroma, depth); \
@@ -175,7 +226,8 @@ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
hevcdsp->hevc_h_loop_filter_luma_c = FUNC(hevc_h_loop_filter_luma, depth); \
hevcdsp->hevc_v_loop_filter_luma_c = FUNC(hevc_v_loop_filter_luma, depth); \
hevcdsp->hevc_h_loop_filter_chroma_c = FUNC(hevc_h_loop_filter_chroma, depth); \
- hevcdsp->hevc_v_loop_filter_chroma_c = FUNC(hevc_v_loop_filter_chroma, depth);
+ hevcdsp->hevc_v_loop_filter_chroma_c = FUNC(hevc_v_loop_filter_chroma, depth)
+int i = 0;
switch (bit_depth) {
case 9:
@@ -188,4 +240,5 @@ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
HEVC_DSP(8);
break;
}
+ if (ARCH_X86) ff_hevcdsp_init_x86(hevcdsp, bit_depth);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevcdsp.h b/chromium/third_party/ffmpeg/libavcodec/hevcdsp.h
index c6511b01ac9..6fd5469ba14 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevcdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/hevcdsp.h
@@ -1,7 +1,9 @@
/*
- * HEVC video Decoder
+ * HEVC video decoder
*
* Copyright (C) 2012 - 2013 Guillaume Martres
+ * Copyright (C) 2013 - 2014 Pierre-Edouard Lepere
+ *
*
* This file is part of FFmpeg.
*
@@ -25,53 +27,97 @@
#include "get_bits.h"
-struct SAOParams;
-
-typedef struct HEVCDSPContext {
- void (*put_pcm)(uint8_t *_dst, ptrdiff_t _stride, int size,
- GetBitContext *gb, int pcm_bit_depth);
-
- void (*transquant_bypass[4])(uint8_t *_dst, int16_t *coeffs, ptrdiff_t _stride);
-
- void (*transform_skip)(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
+typedef struct SAOParams {
+ int offset_abs[3][4]; ///< sao_offset_abs
+ int offset_sign[3][4]; ///< sao_offset_sign
- void (*transform_4x4_luma_add)(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
+ int band_position[3]; ///< sao_band_position
- void (*transform_add[4])(uint8_t *dst, int16_t *coeffs, ptrdiff_t _stride);
+ int eo_class[3]; ///< sao_eo_class
- void (*sao_band_filter[4])( uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride, struct SAOParams *sao, int *borders, int width, int height, int c_idx);
+ int offset_val[3][5]; ///<SaoOffsetVal
- void (*sao_edge_filter[4])(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride, struct SAOParams *sao, int *borders, int _width, int _height, int c_idx, uint8_t vert_edge, uint8_t horiz_edge, uint8_t diag_edge);
+ uint8_t type_idx[3]; ///< sao_type_idx
+} SAOParams;
+typedef struct HEVCDSPContext {
+ void (*put_pcm)(uint8_t *dst, ptrdiff_t stride, int size,
+ GetBitContext *gb, int pcm_bit_depth);
- void (*put_hevc_qpel[4][4])(int16_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
- int width, int height, int16_t* mcbuffer);
-
- void (*put_hevc_epel[2][2])(int16_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
- int width, int height, int mx, int my, int16_t* mcbuffer);
-
- void (*put_unweighted_pred)(uint8_t *dst, ptrdiff_t dststride, int16_t *src, ptrdiff_t srcstride,
- int width, int height);
+ void (*transquant_bypass[4])(uint8_t *dst, int16_t *coeffs,
+ ptrdiff_t stride);
- void (*put_weighted_pred_avg)(uint8_t *dst, ptrdiff_t dststride, int16_t *src1, int16_t *src2,
- ptrdiff_t srcstride, int width, int height);
- void (*weighted_pred)(uint8_t denom, int16_t wlxFlag, int16_t olxFlag, uint8_t *dst, ptrdiff_t dststride, int16_t *src,
- ptrdiff_t srcstride, int width, int height);
- void (*weighted_pred_avg)(uint8_t denom, int16_t wl0Flag, int16_t wl1Flag, int16_t ol0Flag, int16_t ol1Flag,
- uint8_t *dst, ptrdiff_t dststride, int16_t *src1, int16_t *src2,
- ptrdiff_t srcstride, int width, int height);
- void (*hevc_h_loop_filter_luma)(uint8_t *_pix, ptrdiff_t _stride, int *_beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
- void (*hevc_v_loop_filter_luma)(uint8_t *_pix, ptrdiff_t _stride, int *_beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
- void (*hevc_h_loop_filter_chroma)(uint8_t *_pix, ptrdiff_t _stride, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
- void (*hevc_v_loop_filter_chroma)(uint8_t *_pix, ptrdiff_t _stride, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
- void (*hevc_h_loop_filter_luma_c)(uint8_t *_pix, ptrdiff_t _stride, int *_beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
- void (*hevc_v_loop_filter_luma_c)(uint8_t *_pix, ptrdiff_t _stride, int *_beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
- void (*hevc_h_loop_filter_chroma_c)(uint8_t *_pix, ptrdiff_t _stride, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
- void (*hevc_v_loop_filter_chroma_c)(uint8_t *_pix, ptrdiff_t _stride, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
+ void (*transform_skip)(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
+ void (*transform_4x4_luma_add)(uint8_t *dst, int16_t *coeffs,
+ ptrdiff_t stride);
+ void (*transform_add[4])(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
+
+ void (*sao_band_filter[4])(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
+ struct SAOParams *sao, int *borders,
+ int width, int height, int c_idx);
+ void (*sao_edge_filter[4])(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
+ struct SAOParams *sao, int *borders, int width,
+ int height, int c_idx, uint8_t vert_edge,
+ uint8_t horiz_edge, uint8_t diag_edge);
+
+ void (*put_hevc_qpel[10][2][2])(int16_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
+ int height, intptr_t mx, intptr_t my, int width);
+ void (*put_hevc_qpel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
+ int height, intptr_t mx, intptr_t my, int width);
+ void (*put_hevc_qpel_uni_w[10][2][2])(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
+
+ void (*put_hevc_qpel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, intptr_t mx, intptr_t my, int width);
+ void (*put_hevc_qpel_bi_w[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, int denom, int wx0, int wx1,
+ int ox0, int ox1, intptr_t mx, intptr_t my, int width);
+ void (*put_hevc_epel[10][2][2])(int16_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
+ int height, intptr_t mx, intptr_t my, int width);
+
+ void (*put_hevc_epel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width);
+ void (*put_hevc_epel_uni_w[10][2][2])(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
+ void (*put_hevc_epel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, intptr_t mx, intptr_t my, int width);
+ void (*put_hevc_epel_bi_w[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, int denom, int wx0, int ox0, int wx1,
+ int ox1, intptr_t mx, intptr_t my, int width);
+
+ void (*hevc_h_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
+ int *beta, int *tc,
+ uint8_t *no_p, uint8_t *no_q);
+ void (*hevc_v_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
+ int *beta, int *tc,
+ uint8_t *no_p, uint8_t *no_q);
+ void (*hevc_h_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
+ int *tc, uint8_t *no_p, uint8_t *no_q);
+ void (*hevc_v_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
+ int *tc, uint8_t *no_p, uint8_t *no_q);
+ void (*hevc_h_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride,
+ int *beta, int *tc,
+ uint8_t *no_p, uint8_t *no_q);
+ void (*hevc_v_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride,
+ int *beta, int *tc,
+ uint8_t *no_p, uint8_t *no_q);
+ void (*hevc_h_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride,
+ int *tc, uint8_t *no_p,
+ uint8_t *no_q);
+ void (*hevc_v_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride,
+ int *tc, uint8_t *no_p,
+ uint8_t *no_q);
} HEVCDSPContext;
void ff_hevc_dsp_init(HEVCDSPContext *hpc, int bit_depth);
-extern const int8_t ff_hevc_epel_filters[7][16];
+extern const int8_t ff_hevc_epel_filters[7][4];
+extern const int8_t ff_hevc_qpel_filters[3][16];
+
+void ff_hevcdsp_init_x86(HEVCDSPContext *c, const int bit_depth);
#endif /* AVCODEC_HEVCDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevcdsp_template.c b/chromium/third_party/ffmpeg/libavcodec/hevcdsp_template.c
index c9386e0dfb5..be90c7002b1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevcdsp_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevcdsp_template.c
@@ -52,7 +52,7 @@ static void FUNC(transquant_bypass4x4)(uint8_t *_dst, int16_t *coeffs,
for (y = 0; y < 4; y++) {
for (x = 0; x < 4; x++) {
- dst[x] += *coeffs;
+ dst[x] = av_clip_pixel(dst[x] + *coeffs);
coeffs++;
}
dst += stride;
@@ -69,7 +69,7 @@ static void FUNC(transquant_bypass8x8)(uint8_t *_dst, int16_t *coeffs,
for (y = 0; y < 8; y++) {
for (x = 0; x < 8; x++) {
- dst[x] += *coeffs;
+ dst[x] = av_clip_pixel(dst[x] + *coeffs);
coeffs++;
}
dst += stride;
@@ -86,7 +86,7 @@ static void FUNC(transquant_bypass16x16)(uint8_t *_dst, int16_t *coeffs,
for (y = 0; y < 16; y++) {
for (x = 0; x < 16; x++) {
- dst[x] += *coeffs;
+ dst[x] = av_clip_pixel(dst[x] + *coeffs);
coeffs++;
}
dst += stride;
@@ -103,7 +103,7 @@ static void FUNC(transquant_bypass32x32)(uint8_t *_dst, int16_t *coeffs,
for (y = 0; y < 32; y++) {
for (x = 0; x < 32; x++) {
- dst[x] += *coeffs;
+ dst[x] = av_clip_pixel(dst[x] + *coeffs);
coeffs++;
}
dst += stride;
@@ -194,8 +194,6 @@ static void FUNC(transform_4x4_luma_add)(uint8_t *_dst, int16_t *coeffs,
assign(dst[2 * dstep], e1 - o1); \
assign(dst[3 * dstep], e0 - o0); \
} while (0)
-#define TR_4_1(dst, src) TR_4(dst, src, 4, 4, SCALE)
-#define TR_4_2(dst, src) TR_4(dst, src, 1, 1, ADD_AND_SCALE)
static void FUNC(transform_4x4_add)(uint8_t *_dst, int16_t *coeffs,
ptrdiff_t stride)
@@ -209,14 +207,14 @@ static void FUNC(transform_4x4_add)(uint8_t *_dst, int16_t *coeffs,
stride /= sizeof(pixel);
for (i = 0; i < 4; i++) {
- TR_4_1(src, src);
+ TR_4(src, src, 4, 4, SCALE);
src++;
}
shift = 20 - BIT_DEPTH;
add = 1 << (shift - 1);
for (i = 0; i < 4; i++) {
- TR_4_2(dst, coeffs);
+ TR_4(dst, coeffs, 1, 1, ADD_AND_SCALE);
coeffs += 4;
dst += stride;
}
@@ -270,13 +268,7 @@ static void FUNC(transform_4x4_add)(uint8_t *_dst, int16_t *coeffs,
} \
} while (0)
-#define TR_8_1(dst, src) TR_8(dst, src, 8, 8, SCALE)
-#define TR_16_1(dst, src) TR_16(dst, src, 16, 16, SCALE)
-#define TR_32_1(dst, src) TR_32(dst, src, 32, 32, SCALE)
-#define TR_8_2(dst, src) TR_8(dst, src, 1, 1, ADD_AND_SCALE)
-#define TR_16_2(dst, src) TR_16(dst, src, 1, 1, ADD_AND_SCALE)
-#define TR_32_2(dst, src) TR_32(dst, src, 1, 1, ADD_AND_SCALE)
static void FUNC(transform_8x8_add)(uint8_t *_dst, int16_t *coeffs,
ptrdiff_t stride)
@@ -290,14 +282,14 @@ static void FUNC(transform_8x8_add)(uint8_t *_dst, int16_t *coeffs,
stride /= sizeof(pixel);
for (i = 0; i < 8; i++) {
- TR_8_1(src, src);
+ TR_8(src, src, 8, 8, SCALE);
src++;
}
shift = 20 - BIT_DEPTH;
add = 1 << (shift - 1);
for (i = 0; i < 8; i++) {
- TR_8_2(dst, coeffs);
+ TR_8(dst, coeffs, 1, 1, ADD_AND_SCALE);
coeffs += 8;
dst += stride;
}
@@ -315,14 +307,14 @@ static void FUNC(transform_16x16_add)(uint8_t *_dst, int16_t *coeffs,
stride /= sizeof(pixel);
for (i = 0; i < 16; i++) {
- TR_16_1(src, src);
+ TR_16(src, src, 16, 16, SCALE);
src++;
}
shift = 20 - BIT_DEPTH;
add = 1 << (shift - 1);
for (i = 0; i < 16; i++) {
- TR_16_2(dst, coeffs);
+ TR_16(dst, coeffs, 1, 1, ADD_AND_SCALE);
coeffs += 16;
dst += stride;
}
@@ -331,15 +323,6 @@ static void FUNC(transform_16x16_add)(uint8_t *_dst, int16_t *coeffs,
static void FUNC(transform_32x32_add)(uint8_t *_dst, int16_t *coeffs,
ptrdiff_t stride)
{
-#define IT32x32_even(i,w) ( src[ 0*w] * transform[ 0][i] ) + ( src[16*w] * transform[16][i] )
-#define IT32x32_odd(i,w) ( src[ 8*w] * transform[ 8][i] ) + ( src[24*w] * transform[24][i] )
-#define IT16x16(i,w) ( src[ 4*w] * transform[ 4][i] ) + ( src[12*w] * transform[12][i] ) + ( src[20*w] * transform[20][i] ) + ( src[28*w] * transform[28][i] )
-#define IT8x8(i,w) ( src[ 2*w] * transform[ 2][i] ) + ( src[ 6*w] * transform[ 6][i] ) + ( src[10*w] * transform[10][i] ) + ( src[14*w] * transform[14][i] ) + \
- ( src[18*w] * transform[18][i] ) + ( src[22*w] * transform[22][i] ) + ( src[26*w] * transform[26][i] ) + ( src[30*w] * transform[30][i] )
-#define IT4x4(i,w) ( src[ 1*w] * transform[ 1][i] ) + ( src[ 3*w] * transform[ 3][i] ) + ( src[ 5*w] * transform[ 5][i] ) + ( src[ 7*w] * transform[ 7][i] ) + \
- ( src[ 9*w] * transform[ 9][i] ) + ( src[11*w] * transform[11][i] ) + ( src[13*w] * transform[13][i] ) + ( src[15*w] * transform[15][i] ) + \
- ( src[17*w] * transform[17][i] ) + ( src[19*w] * transform[19][i] ) + ( src[21*w] * transform[21][i] ) + ( src[23*w] * transform[23][i] ) + \
- ( src[25*w] * transform[25][i] ) + ( src[27*w] * transform[27][i] ) + ( src[29*w] * transform[29][i] ) + ( src[31*w] * transform[31][i] )
int i;
pixel *dst = (pixel *)_dst;
int shift = 7;
@@ -349,22 +332,17 @@ static void FUNC(transform_32x32_add)(uint8_t *_dst, int16_t *coeffs,
stride /= sizeof(pixel);
for (i = 0; i < 32; i++) {
- TR_32_1(src, src);
+ TR_32(src, src, 32, 32, SCALE);
src++;
}
src = coeffs;
shift = 20 - BIT_DEPTH;
add = 1 << (shift - 1);
for (i = 0; i < 32; i++) {
- TR_32_2(dst, coeffs);
+ TR_32(dst, coeffs, 1, 1, ADD_AND_SCALE);
coeffs += 32;
dst += stride;
}
-#undef IT32x32_even
-#undef IT32x32_odd
-#undef IT16x16
-#undef IT8x8
-#undef IT4x4
}
static void FUNC(sao_band_filter)(uint8_t *_dst, uint8_t *_src,
@@ -417,7 +395,7 @@ static void FUNC(sao_band_filter)(uint8_t *_dst, uint8_t *_src,
offset_table[(k + sao_left_class) & 31] = sao_offset_val[k + 1];
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++)
- dst[x] = av_clip_pixel(src[x] + offset_table[av_clip_pixel(src[x] >> shift)]);
+ dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]);
dst += stride;
src += stride;
}
@@ -670,6 +648,7 @@ static void FUNC(sao_edge_filter_2)(uint8_t *_dst, uint8_t *_src,
int chroma = !!c_idx;
int *sao_offset_val = sao->offset_val[c_idx];
int sao_eo_class = sao->eo_class[c_idx];
+ int init_x = 0, init_y = 0, width = _width, height = _height;
static const int8_t pos[4][2][2] = {
{ { -1, 0 }, { 1, 0 } }, // horizontal
@@ -679,9 +658,8 @@ static void FUNC(sao_edge_filter_2)(uint8_t *_dst, uint8_t *_src,
};
static const uint8_t edge_idx[] = { 1, 2, 0, 3, 4 };
- int init_x = 0, init_y = 0, width = _width, height = _height;
-
#define CMP(a, b) ((a) > (b) ? 1 : ((a) == (b) ? 0 : -1))
+
stride /= sizeof(pixel);
init_x = -(8 >> chroma) - 2;
@@ -822,21 +800,17 @@ static void FUNC(sao_edge_filter_3)(uint8_t *_dst, uint8_t *_src,
#undef SCALE
#undef ADD_AND_SCALE
#undef TR_4
-#undef TR_4_1
-#undef TR_4_2
#undef TR_8
-#undef TR_8_1
-#undef TR_8_2
#undef TR_16
-#undef TR_16_1
-#undef TR_16_2
#undef TR_32
-#undef TR_32_1
-#undef TR_32_2
-static void FUNC(put_hevc_qpel_pixels)(int16_t *dst, ptrdiff_t dststride,
- uint8_t *_src, ptrdiff_t _srcstride,
- int width, int height, int16_t* mcbuffer)
+
+////////////////////////////////////////////////////////////////////////////////
+//
+////////////////////////////////////////////////////////////////////////////////
+static void FUNC(put_hevc_pel_pixels)(int16_t *dst, ptrdiff_t dststride,
+ uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width)
{
int x, y;
pixel *src = (pixel *)_src;
@@ -850,157 +824,573 @@ static void FUNC(put_hevc_qpel_pixels)(int16_t *dst, ptrdiff_t dststride,
}
}
-#define QPEL_FILTER_1(src, stride) \
- (1 * -src[x - 3 * stride] + \
- 4 * src[x - 2 * stride] - \
- 10 * src[x - stride] + \
- 58 * src[x] + \
- 17 * src[x + stride] - \
- 5 * src[x + 2 * stride] + \
- 1 * src[x + 3 * stride])
-
-#define QPEL_FILTER_2(src, stride) \
- (1 * -src[x - 3 * stride] + \
- 4 * src[x - 2 * stride] - \
- 11 * src[x - stride] + \
- 40 * src[x] + \
- 40 * src[x + stride] - \
- 11 * src[x + 2 * stride] + \
- 4 * src[x + 3 * stride] - \
- 1 * src[x + 4 * stride])
-
-#define QPEL_FILTER_3(src, stride) \
- (1 * src[x - 2 * stride] - \
- 5 * src[x - stride] + \
- 17 * src[x] + \
- 58 * src[x + stride] - \
- 10 * src[x + 2 * stride] + \
- 4 * src[x + 3 * stride] - \
- 1 * src[x + 4 * stride])
-
-
-#define PUT_HEVC_QPEL_H(H) \
-static void FUNC(put_hevc_qpel_h ## H)(int16_t *dst, ptrdiff_t dststride, \
- uint8_t *_src, ptrdiff_t _srcstride, \
- int width, int height, \
- int16_t* mcbuffer) \
-{ \
- int x, y; \
- pixel *src = (pixel*)_src; \
- ptrdiff_t srcstride = _srcstride / sizeof(pixel); \
- \
- for (y = 0; y < height; y++) { \
- for (x = 0; x < width; x++) \
- dst[x] = QPEL_FILTER_ ## H(src, 1) >> (BIT_DEPTH - 8); \
- src += srcstride; \
- dst += dststride; \
- } \
+static void FUNC(put_hevc_pel_uni_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+
+ for (y = 0; y < height; y++) {
+ memcpy(dst, src, width * sizeof(pixel));
+ src += srcstride;
+ dst += dststride;
+ }
}
-#define PUT_HEVC_QPEL_V(V) \
-static void FUNC(put_hevc_qpel_v ## V)(int16_t *dst, ptrdiff_t dststride, \
- uint8_t *_src, ptrdiff_t _srcstride, \
- int width, int height, \
- int16_t* mcbuffer) \
-{ \
- int x, y; \
- pixel *src = (pixel*)_src; \
- ptrdiff_t srcstride = _srcstride / sizeof(pixel); \
- \
- for (y = 0; y < height; y++) { \
- for (x = 0; x < width; x++) \
- dst[x] = QPEL_FILTER_ ## V(src, srcstride) >> (BIT_DEPTH - 8); \
- src += srcstride; \
- dst += dststride; \
- } \
+static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+
+ int shift = 14 + 1 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((src[x] << (14 - BIT_DEPTH)) + src2[x] + offset) >> shift);
+ src += srcstride;
+ dst += dststride;
+ src2 += src2stride;
+ }
}
-#define PUT_HEVC_QPEL_HV(H, V) \
-static void FUNC(put_hevc_qpel_h ## H ## v ## V)(int16_t *dst, \
- ptrdiff_t dststride, \
- uint8_t *_src, \
- ptrdiff_t _srcstride, \
- int width, int height, \
- int16_t* mcbuffer) \
-{ \
- int x, y; \
- pixel *src = (pixel*)_src; \
- ptrdiff_t srcstride = _srcstride / sizeof(pixel); \
- \
- int16_t tmp_array[(MAX_PB_SIZE + 7) * MAX_PB_SIZE]; \
- int16_t *tmp = tmp_array; \
- \
- src -= ff_hevc_qpel_extra_before[V] * srcstride; \
- \
- for (y = 0; y < height + ff_hevc_qpel_extra[V]; y++) { \
- for (x = 0; x < width; x++) \
- tmp[x] = QPEL_FILTER_ ## H(src, 1) >> (BIT_DEPTH - 8); \
- src += srcstride; \
- tmp += MAX_PB_SIZE; \
- } \
- \
- tmp = tmp_array + ff_hevc_qpel_extra_before[V] * MAX_PB_SIZE; \
- \
- for (y = 0; y < height; y++) { \
- for (x = 0; x < width; x++) \
- dst[x] = QPEL_FILTER_ ## V(tmp, MAX_PB_SIZE) >> 6; \
- tmp += MAX_PB_SIZE; \
- dst += dststride; \
- } \
+static void FUNC(put_hevc_pel_uni_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ int shift = denom + 14 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ ox = ox * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel((((src[x] << (14 - BIT_DEPTH)) * wx + offset) >> shift) + ox);
+ src += srcstride;
+ dst += dststride;
+ }
}
-PUT_HEVC_QPEL_H(1)
-PUT_HEVC_QPEL_H(2)
-PUT_HEVC_QPEL_H(3)
-PUT_HEVC_QPEL_V(1)
-PUT_HEVC_QPEL_V(2)
-PUT_HEVC_QPEL_V(3)
-PUT_HEVC_QPEL_HV(1, 1)
-PUT_HEVC_QPEL_HV(1, 2)
-PUT_HEVC_QPEL_HV(1, 3)
-PUT_HEVC_QPEL_HV(2, 1)
-PUT_HEVC_QPEL_HV(2, 2)
-PUT_HEVC_QPEL_HV(2, 3)
-PUT_HEVC_QPEL_HV(3, 1)
-PUT_HEVC_QPEL_HV(3, 2)
-PUT_HEVC_QPEL_HV(3, 3)
-
-static void FUNC(put_hevc_epel_pixels)(int16_t *dst, ptrdiff_t dststride,
- uint8_t *_src, ptrdiff_t _srcstride,
- int width, int height, int mx, int my,
- int16_t* mcbuffer)
+static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, int denom, int wx0, int wx1,
+ int ox0, int ox1, intptr_t mx, intptr_t my, int width)
{
int x, y;
pixel *src = (pixel *)_src;
ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+
+ int shift = 14 + 1 - BIT_DEPTH;
+ int log2Wd = denom + shift - 1;
+ ox0 = ox0 * (1 << (BIT_DEPTH - 8));
+ ox1 = ox1 * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ dst[x] = av_clip_pixel(( (src[x] << (14 - BIT_DEPTH)) * wx1 + src2[x] * wx0 + ((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
+ }
+ src += srcstride;
+ dst += dststride;
+ src2 += src2stride;
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+////////////////////////////////////////////////////////////////////////////////
+#define QPEL_FILTER(src, stride) \
+ (filter[0] * src[x - 3 * stride] + \
+ filter[1] * src[x - 2 * stride] + \
+ filter[2] * src[x - stride] + \
+ filter[3] * src[x ] + \
+ filter[4] * src[x + stride] + \
+ filter[5] * src[x + 2 * stride] + \
+ filter[6] * src[x + 3 * stride] + \
+ filter[7] * src[x + 4 * stride])
+
+static void FUNC(put_hevc_qpel_h)(int16_t *dst, ptrdiff_t dststride,
+ uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_qpel_filters[mx - 1];
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++)
- dst[x] = src[x] << (14 - BIT_DEPTH);
+ dst[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ dst += dststride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_v)(int16_t *dst, ptrdiff_t dststride,
+ uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_qpel_filters[my - 1];
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ dst += dststride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_hv)(int16_t *dst,
+ ptrdiff_t dststride,
+ uint8_t *_src,
+ ptrdiff_t _srcstride,
+ int height, intptr_t mx,
+ intptr_t my, int width)
+{
+ int x, y;
+ const int8_t *filter;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE];
+ int16_t *tmp = tmp_array;
+
+ src -= QPEL_EXTRA_BEFORE * srcstride;
+ filter = ff_hevc_qpel_filters[mx - 1];
+ for (y = 0; y < height + QPEL_EXTRA; y++) {
+ for (x = 0; x < width; x++)
+ tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ tmp += MAX_PB_SIZE;
+ }
+
+ tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE;
+ filter = ff_hevc_qpel_filters[my - 1];
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6;
+ tmp += MAX_PB_SIZE;
+ dst += dststride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride,
+ uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_qpel_filters[mx - 1];
+ int shift = 14 - BIT_DEPTH;
+
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) + offset) >> shift);
+ src += srcstride;
+ dst += dststride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+
+ const int8_t *filter = ff_hevc_qpel_filters[mx - 1];
+
+ int shift = 14 + 1 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) + src2[x] + offset) >> shift);
+ src += srcstride;
+ dst += dststride;
+ src2 += src2stride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride,
+ uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_qpel_filters[my - 1];
+ int shift = 14 - BIT_DEPTH;
+
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) + offset) >> shift);
+ src += srcstride;
+ dst += dststride;
+ }
+}
+
+
+static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+
+ const int8_t *filter = ff_hevc_qpel_filters[my - 1];
+
+ int shift = 14 + 1 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) + src2[x] + offset) >> shift);
+ src += srcstride;
+ dst += dststride;
+ src2 += src2stride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride,
+ uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ const int8_t *filter;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE];
+ int16_t *tmp = tmp_array;
+ int shift = 14 - BIT_DEPTH;
+
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ src -= QPEL_EXTRA_BEFORE * srcstride;
+ filter = ff_hevc_qpel_filters[mx - 1];
+ for (y = 0; y < height + QPEL_EXTRA; y++) {
+ for (x = 0; x < width; x++)
+ tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ tmp += MAX_PB_SIZE;
+ }
+
+ tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE;
+ filter = ff_hevc_qpel_filters[my - 1];
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) + offset) >> shift);
+ tmp += MAX_PB_SIZE;
+ dst += dststride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ const int8_t *filter;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE];
+ int16_t *tmp = tmp_array;
+ int shift = 14 + 1 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ src -= QPEL_EXTRA_BEFORE * srcstride;
+ filter = ff_hevc_qpel_filters[mx - 1];
+ for (y = 0; y < height + QPEL_EXTRA; y++) {
+ for (x = 0; x < width; x++)
+ tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ tmp += MAX_PB_SIZE;
+ }
+
+ tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE;
+ filter = ff_hevc_qpel_filters[my - 1];
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) + src2[x] + offset) >> shift);
+ tmp += MAX_PB_SIZE;
+ dst += dststride;
+ src2 += src2stride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride,
+ uint8_t *_src, ptrdiff_t _srcstride,
+ int height, int denom, int wx, int ox,
+ intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_qpel_filters[mx - 1];
+ int shift = denom + 14 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ ox = ox * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel((((QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox);
src += srcstride;
dst += dststride;
}
}
-#define EPEL_FILTER(src, stride) \
- (filter_0 * src[x - stride] + \
- filter_1 * src[x] + \
- filter_2 * src[x + stride] + \
- filter_3 * src[x + 2 * stride])
+static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, int denom, int wx0, int wx1,
+ int ox0, int ox1, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+
+ const int8_t *filter = ff_hevc_qpel_filters[mx - 1];
+
+ int shift = 14 + 1 - BIT_DEPTH;
+ int log2Wd = denom + shift - 1;
+
+ ox0 = ox0 * (1 << (BIT_DEPTH - 8));
+ ox1 = ox1 * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx1 + src2[x] * wx0 +
+ ((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
+ src += srcstride;
+ dst += dststride;
+ src2 += src2stride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride,
+ uint8_t *_src, ptrdiff_t _srcstride,
+ int height, int denom, int wx, int ox,
+ intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_qpel_filters[my - 1];
+ int shift = denom + 14 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ ox = ox * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel((((QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox);
+ src += srcstride;
+ dst += dststride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, int denom, int wx0, int wx1,
+ int ox0, int ox1, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+
+ const int8_t *filter = ff_hevc_qpel_filters[my - 1];
+
+ int shift = 14 + 1 - BIT_DEPTH;
+ int log2Wd = denom + shift - 1;
+
+ ox0 = ox0 * (1 << (BIT_DEPTH - 8));
+ ox1 = ox1 * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx1 + src2[x] * wx0 +
+ ((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
+ src += srcstride;
+ dst += dststride;
+ src2 += src2stride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride,
+ uint8_t *_src, ptrdiff_t _srcstride,
+ int height, int denom, int wx, int ox,
+ intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ const int8_t *filter;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE];
+ int16_t *tmp = tmp_array;
+ int shift = denom + 14 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ src -= QPEL_EXTRA_BEFORE * srcstride;
+ filter = ff_hevc_qpel_filters[mx - 1];
+ for (y = 0; y < height + QPEL_EXTRA; y++) {
+ for (x = 0; x < width; x++)
+ tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ tmp += MAX_PB_SIZE;
+ }
+
+ tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE;
+ filter = ff_hevc_qpel_filters[my - 1];
+
+ ox = ox * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel((((QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) * wx + offset) >> shift) + ox);
+ tmp += MAX_PB_SIZE;
+ dst += dststride;
+ }
+}
+
+static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, int denom, int wx0, int wx1,
+ int ox0, int ox1, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ const int8_t *filter;
+ pixel *src = (pixel*)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE];
+ int16_t *tmp = tmp_array;
+ int shift = 14 + 1 - BIT_DEPTH;
+ int log2Wd = denom + shift - 1;
+
+ src -= QPEL_EXTRA_BEFORE * srcstride;
+ filter = ff_hevc_qpel_filters[mx - 1];
+ for (y = 0; y < height + QPEL_EXTRA; y++) {
+ for (x = 0; x < width; x++)
+ tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ tmp += MAX_PB_SIZE;
+ }
+
+ tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE;
+ filter = ff_hevc_qpel_filters[my - 1];
+
+ ox0 = ox0 * (1 << (BIT_DEPTH - 8));
+ ox1 = ox1 * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) * wx1 + src2[x] * wx0 +
+ ((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
+ tmp += MAX_PB_SIZE;
+ dst += dststride;
+ src2 += src2stride;
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+////////////////////////////////////////////////////////////////////////////////
+#define EPEL_FILTER(src, stride) \
+ (filter[0] * src[x - stride] + \
+ filter[1] * src[x] + \
+ filter[2] * src[x + stride] + \
+ filter[3] * src[x + 2 * stride])
static void FUNC(put_hevc_epel_h)(int16_t *dst, ptrdiff_t dststride,
uint8_t *_src, ptrdiff_t _srcstride,
- int width, int height, int mx, int my,
- int16_t* mcbuffer)
+ int height, intptr_t mx, intptr_t my, int width)
{
int x, y;
pixel *src = (pixel *)_src;
ptrdiff_t srcstride = _srcstride / sizeof(pixel);
const int8_t *filter = ff_hevc_epel_filters[mx - 1];
- int8_t filter_0 = filter[0];
- int8_t filter_1 = filter[1];
- int8_t filter_2 = filter[2];
- int8_t filter_3 = filter[3];
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++)
dst[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
@@ -1011,17 +1401,12 @@ static void FUNC(put_hevc_epel_h)(int16_t *dst, ptrdiff_t dststride,
static void FUNC(put_hevc_epel_v)(int16_t *dst, ptrdiff_t dststride,
uint8_t *_src, ptrdiff_t _srcstride,
- int width, int height, int mx, int my,
- int16_t* mcbuffer)
+ int height, intptr_t mx, intptr_t my, int width)
{
int x, y;
pixel *src = (pixel *)_src;
ptrdiff_t srcstride = _srcstride / sizeof(pixel);
const int8_t *filter = ff_hevc_epel_filters[my - 1];
- int8_t filter_0 = filter[0];
- int8_t filter_1 = filter[1];
- int8_t filter_2 = filter[2];
- int8_t filter_3 = filter[3];
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++)
@@ -1033,19 +1418,13 @@ static void FUNC(put_hevc_epel_v)(int16_t *dst, ptrdiff_t dststride,
static void FUNC(put_hevc_epel_hv)(int16_t *dst, ptrdiff_t dststride,
uint8_t *_src, ptrdiff_t _srcstride,
- int width, int height, int mx, int my,
- int16_t* mcbuffer)
+ int height, intptr_t mx, intptr_t my, int width)
{
int x, y;
pixel *src = (pixel *)_src;
ptrdiff_t srcstride = _srcstride / sizeof(pixel);
- const int8_t *filter_h = ff_hevc_epel_filters[mx - 1];
- const int8_t *filter_v = ff_hevc_epel_filters[my - 1];
- int8_t filter_0 = filter_h[0];
- int8_t filter_1 = filter_h[1];
- int8_t filter_2 = filter_h[2];
- int8_t filter_3 = filter_h[3];
- int16_t tmp_array[(MAX_PB_SIZE + 3) * MAX_PB_SIZE];
+ const int8_t *filter = ff_hevc_epel_filters[mx - 1];
+ int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE];
int16_t *tmp = tmp_array;
src -= EPEL_EXTRA_BEFORE * srcstride;
@@ -1058,10 +1437,8 @@ static void FUNC(put_hevc_epel_hv)(int16_t *dst, ptrdiff_t dststride,
}
tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE;
- filter_0 = filter_v[0];
- filter_1 = filter_v[1];
- filter_2 = filter_v[2];
- filter_3 = filter_v[3];
+ filter = ff_hevc_epel_filters[my - 1];
+
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++)
dst[x] = EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6;
@@ -1070,37 +1447,91 @@ static void FUNC(put_hevc_epel_hv)(int16_t *dst, ptrdiff_t dststride,
}
}
-static void FUNC(put_unweighted_pred)(uint8_t *_dst, ptrdiff_t _dststride,
- int16_t *src, ptrdiff_t srcstride,
- int width, int height)
+static void FUNC(put_hevc_epel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width)
{
int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
pixel *dst = (pixel *)_dst;
ptrdiff_t dststride = _dststride / sizeof(pixel);
-
+ const int8_t *filter = ff_hevc_epel_filters[mx - 1];
int shift = 14 - BIT_DEPTH;
#if BIT_DEPTH < 14
int offset = 1 << (shift - 1);
#else
int offset = 0;
#endif
+
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++)
- dst[x] = av_clip_pixel((src[x] + offset) >> shift);
- dst += dststride;
+ dst[x] = av_clip_pixel(((EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) + offset) >> shift);
src += srcstride;
+ dst += dststride;
+ }
+}
+
+static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[mx - 1];
+ int shift = 14 + 1 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ dst[x] = av_clip_pixel(((EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) + src2[x] + offset) >> shift);
+ }
+ dst += dststride;
+ src += srcstride;
+ src2 += src2stride;
}
}
-static void FUNC(put_weighted_pred_avg)(uint8_t *_dst, ptrdiff_t _dststride,
- int16_t *src1, int16_t *src2,
- ptrdiff_t srcstride,
- int width, int height)
+static void FUNC(put_hevc_epel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width)
{
int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
pixel *dst = (pixel *)_dst;
ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[my - 1];
+ int shift = 14 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) + offset) >> shift);
+ src += srcstride;
+ dst += dststride;
+ }
+}
+
+static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[my - 1];
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
int shift = 14 + 1 - BIT_DEPTH;
#if BIT_DEPTH < 14
int offset = 1 << (shift - 1);
@@ -1110,71 +1541,273 @@ static void FUNC(put_weighted_pred_avg)(uint8_t *_dst, ptrdiff_t _dststride,
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++)
- dst[x] = av_clip_pixel((src1[x] + src2[x] + offset) >> shift);
+ dst[x] = av_clip_pixel(((EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) + src2[x] + offset) >> shift);
dst += dststride;
- src1 += srcstride;
- src2 += srcstride;
+ src += srcstride;
+ src2 += src2stride;
}
}
-static void FUNC(weighted_pred)(uint8_t denom, int16_t wlxFlag, int16_t olxFlag,
- uint8_t *_dst, ptrdiff_t _dststride,
- int16_t *src, ptrdiff_t srcstride,
- int width, int height)
+static void FUNC(put_hevc_epel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, intptr_t mx, intptr_t my, int width)
{
- int shift, log2Wd, wx, ox, x, y, offset;
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
pixel *dst = (pixel *)_dst;
ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[mx - 1];
+ int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE];
+ int16_t *tmp = tmp_array;
+ int shift = 14 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ src -= EPEL_EXTRA_BEFORE * srcstride;
+
+ for (y = 0; y < height + EPEL_EXTRA; y++) {
+ for (x = 0; x < width; x++)
+ tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ tmp += MAX_PB_SIZE;
+ }
- shift = 14 - BIT_DEPTH;
- log2Wd = denom + shift;
- offset = 1 << (log2Wd - 1);
- wx = wlxFlag;
- ox = olxFlag * (1 << (BIT_DEPTH - 8));
+ tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE;
+ filter = ff_hevc_epel_filters[my - 1];
for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) + offset) >> shift);
+ tmp += MAX_PB_SIZE;
+ dst += dststride;
+ }
+}
+
+static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[mx - 1];
+ int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE];
+ int16_t *tmp = tmp_array;
+ int shift = 14 + 1 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ src -= EPEL_EXTRA_BEFORE * srcstride;
+
+ for (y = 0; y < height + EPEL_EXTRA; y++) {
+ for (x = 0; x < width; x++)
+ tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ tmp += MAX_PB_SIZE;
+ }
+
+ tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE;
+ filter = ff_hevc_epel_filters[my - 1];
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) + src2[x] + offset) >> shift);
+ tmp += MAX_PB_SIZE;
+ dst += dststride;
+ src2 += src2stride;
+ }
+}
+
+static void FUNC(put_hevc_epel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[mx - 1];
+ int shift = denom + 14 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ ox = ox * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
- if (log2Wd >= 1) {
- dst[x] = av_clip_pixel(((src[x] * wx + offset) >> log2Wd) + ox);
- } else {
- dst[x] = av_clip_pixel(src[x] * wx + ox);
- }
+ dst[x] = av_clip_pixel((((EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox);
}
dst += dststride;
src += srcstride;
}
}
-static void FUNC(weighted_pred_avg)(uint8_t denom,
- int16_t wl0Flag, int16_t wl1Flag,
- int16_t ol0Flag, int16_t ol1Flag,
- uint8_t *_dst, ptrdiff_t _dststride,
- int16_t *src1, int16_t *src2,
- ptrdiff_t srcstride,
- int width, int height)
+static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, int denom, int wx0, int wx1,
+ int ox0, int ox1, intptr_t mx, intptr_t my, int width)
{
- int shift, log2Wd, w0, w1, o0, o1, x, y;
- pixel *dst = (pixel *)_dst;
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[mx - 1];
+ int shift = 14 + 1 - BIT_DEPTH;
+ int log2Wd = denom + shift - 1;
+
+ ox0 = ox0 * (1 << (BIT_DEPTH - 8));
+ ox1 = ox1 * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx1 + src2[x] * wx0 +
+ ((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
+ src += srcstride;
+ dst += dststride;
+ src2 += src2stride;
+ }
+}
- shift = 14 - BIT_DEPTH;
- log2Wd = denom + shift;
- w0 = wl0Flag;
- w1 = wl1Flag;
- o0 = ol0Flag * (1 << (BIT_DEPTH - 8));
- o1 = ol1Flag * (1 << (BIT_DEPTH - 8));
+static void FUNC(put_hevc_epel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[my - 1];
+ int shift = denom + 14 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+ ox = ox * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ dst[x] = av_clip_pixel((((EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox);
+ }
+ dst += dststride;
+ src += srcstride;
+ }
+}
+
+static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, int denom, int wx0, int wx1,
+ int ox0, int ox1, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[my - 1];
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ int shift = 14 + 1 - BIT_DEPTH;
+ int log2Wd = denom + shift - 1;
+
+ ox0 = ox0 * (1 << (BIT_DEPTH - 8));
+ ox1 = ox1 * (1 << (BIT_DEPTH - 8));
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++)
- dst[x] = av_clip_pixel((src1[x] * w0 + src2[x] * w1 +
- ((o0 + o1 + 1) << log2Wd)) >> (log2Wd + 1));
+ dst[x] = av_clip_pixel(((EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx1 + src2[x] * wx0 +
+ ((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
+ src += srcstride;
dst += dststride;
- src1 += srcstride;
- src2 += srcstride;
+ src2 += src2stride;
+ }
+}
+
+static void FUNC(put_hevc_epel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[mx - 1];
+ int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE];
+ int16_t *tmp = tmp_array;
+ int shift = denom + 14 - BIT_DEPTH;
+#if BIT_DEPTH < 14
+ int offset = 1 << (shift - 1);
+#else
+ int offset = 0;
+#endif
+
+ src -= EPEL_EXTRA_BEFORE * srcstride;
+
+ for (y = 0; y < height + EPEL_EXTRA; y++) {
+ for (x = 0; x < width; x++)
+ tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ tmp += MAX_PB_SIZE;
+ }
+
+ tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE;
+ filter = ff_hevc_epel_filters[my - 1];
+
+ ox = ox * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel((((EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) * wx + offset) >> shift) + ox);
+ tmp += MAX_PB_SIZE;
+ dst += dststride;
}
}
-// line zero
+static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
+ int16_t *src2, ptrdiff_t src2stride,
+ int height, int denom, int wx0, int wx1,
+ int ox0, int ox1, intptr_t mx, intptr_t my, int width)
+{
+ int x, y;
+ pixel *src = (pixel *)_src;
+ ptrdiff_t srcstride = _srcstride / sizeof(pixel);
+ pixel *dst = (pixel *)_dst;
+ ptrdiff_t dststride = _dststride / sizeof(pixel);
+ const int8_t *filter = ff_hevc_epel_filters[mx - 1];
+ int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE];
+ int16_t *tmp = tmp_array;
+ int shift = 14 + 1 - BIT_DEPTH;
+ int log2Wd = denom + shift - 1;
+
+ src -= EPEL_EXTRA_BEFORE * srcstride;
+
+ for (y = 0; y < height + EPEL_EXTRA; y++) {
+ for (x = 0; x < width; x++)
+ tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
+ src += srcstride;
+ tmp += MAX_PB_SIZE;
+ }
+
+ tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE;
+ filter = ff_hevc_epel_filters[my - 1];
+
+ ox0 = ox0 * (1 << (BIT_DEPTH - 8));
+ ox1 = ox1 * (1 << (BIT_DEPTH - 8));
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ dst[x] = av_clip_pixel(((EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) * wx1 + src2[x] * wx0 +
+ ((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
+ tmp += MAX_PB_SIZE;
+ dst += dststride;
+ src2 += src2stride;
+ }
+}// line zero
#define P3 pix[-4 * xstride]
#define P2 pix[-3 * xstride]
#define P1 pix[-2 * xstride]
@@ -1216,7 +1849,7 @@ static void FUNC(hevc_loop_filter_luma)(uint8_t *_pix,
const int no_p = _no_p[j];
const int no_q = _no_q[j];
- if (d0 + d3 >= beta /*|| tc <= 0*/) {
+ if (d0 + d3 >= beta) {
pix += 4 * ystride;
continue;
} else {
@@ -1313,7 +1946,7 @@ static void FUNC(hevc_loop_filter_chroma)(uint8_t *_pix, ptrdiff_t _xstride,
const int p0 = P0;
const int q0 = Q0;
const int q1 = Q1;
- delta0 = av_clip((((q0 - p0) << 2) + p1 - q1 + 4) >> 3, -tc, tc);
+ delta0 = av_clip((((q0 - p0) * 4) + p1 - q1 + 4) >> 3, -tc, tc);
if (!no_p)
P0 = av_clip_pixel(p0 + delta0);
if (!no_q)
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevcpred_template.c b/chromium/third_party/ffmpeg/libavcodec/hevcpred_template.c
index 5ba95919b1d..5ed7647f921 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevcpred_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevcpred_template.c
@@ -36,43 +36,44 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
#define MVF_PU(x, y) \
MVF(PU(x0 + ((x) << hshift)), PU(y0 + ((y) << vshift)))
#define IS_INTRA(x, y) \
- MVF_PU(x, y).is_intra
+ (MVF_PU(x, y).pred_flag == PF_INTRA)
#define MIN_TB_ADDR_ZS(x, y) \
s->pps->min_tb_addr_zs[(y) * s->sps->min_tb_width + (x)]
-#define EXTEND_LEFT(ptr, start, length) \
- for (i = (start); i > (start) - (length); i--) \
- ptr[i - 1] = ptr[i]
-#define EXTEND_RIGHT(ptr, start, length) \
- for (i = (start); i < (start) + (length); i++) \
- ptr[i] = ptr[i - 1]
-#define EXTEND_UP(ptr, start, length) EXTEND_LEFT(ptr, start, length)
-#define EXTEND_DOWN(ptr, start, length) EXTEND_RIGHT(ptr, start, length)
+#define EXTEND(ptr, start, length) \
+ for (i = start; i < (start) + (length); i += 4) \
+ AV_WN4P(&(ptr[i]), a)
+#define EXTEND_RIGHT_CIP(ptr, start, length) \
+ for (i = start; i < (start) + (length); i += 4) \
+ if (!IS_INTRA(i, -1)) \
+ AV_WN4P(&ptr[i], a); \
+ else \
+ a = PIXEL_SPLAT_X4(ptr[i+3])
#define EXTEND_LEFT_CIP(ptr, start, length) \
- for (i = (start); i > (start) - (length); i--) \
+ for (i = start; i > (start) - (length); i--) \
if (!IS_INTRA(i - 1, -1)) \
ptr[i - 1] = ptr[i]
-#define EXTEND_RIGHT_CIP(ptr, start, length) \
- for (i = (start); i < (start) + (length); i++) \
- if (!IS_INTRA(i, -1)) \
- ptr[i] = ptr[i - 1]
-#define EXTEND_UP_CIP(ptr, start, length) \
- for (i = (start); i > (start) - (length); i--) \
- if (!IS_INTRA(-1, i - 1)) \
- ptr[i - 1] = ptr[i]
-#define EXTEND_UP_CIP_0(ptr, start, length) \
- for (i = (start); i > (start) - (length); i--) \
- ptr[i - 1] = ptr[i]
-#define EXTEND_DOWN_CIP(ptr, start, length) \
- for (i = (start); i < (start) + (length); i++) \
- if (!IS_INTRA(-1, i)) \
- ptr[i] = ptr[i - 1]
+#define EXTEND_UP_CIP(ptr, start, length) \
+ for (i = (start); i > (start) - (length); i -= 4) \
+ if (!IS_INTRA(-1, i - 3)) \
+ AV_WN4P(&ptr[i - 3], a); \
+ else \
+ a = PIXEL_SPLAT_X4(ptr[i - 3])
+#define EXTEND_DOWN_CIP(ptr, start, length) \
+ for (i = start; i < (start) + (length); i += 4) \
+ if (!IS_INTRA(-1, i)) \
+ AV_WN4P(&ptr[i], a); \
+ else \
+ a = PIXEL_SPLAT_X4(ptr[i + 3])
+
HEVCLocalContext *lc = s->HEVClc;
int i;
int hshift = s->sps->hshift[c_idx];
int vshift = s->sps->vshift[c_idx];
int size = (1 << log2_size);
- int size_in_luma = size << hshift;
- int size_in_tbs = size_in_luma >> s->sps->log2_min_tb_size;
+ int size_in_luma_h = size << hshift;
+ int size_in_tbs_h = size_in_luma_h >> s->sps->log2_min_tb_size;
+ int size_in_luma_v = size << vshift;
+ int size_in_tbs_v = size_in_luma_v >> s->sps->log2_min_tb_size;
int x = x0 >> hshift;
int y = y0 >> vshift;
int x_tb = x0 >> s->sps->log2_min_tb_size;
@@ -86,106 +87,100 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
enum IntraPredMode mode = c_idx ? lc->pu.intra_pred_mode_c :
lc->tu.cur_intra_pred_mode;
+ pixel4 a;
+ pixel left_array[2 * MAX_TB_SIZE + 1];
+ pixel filtered_left_array[2 * MAX_TB_SIZE + 1];
+ pixel top_array[2 * MAX_TB_SIZE + 1];
+ pixel filtered_top_array[2 * MAX_TB_SIZE + 1];
- pixel left_array[2 * MAX_TB_SIZE + 1];
- pixel filtered_left_array[2 * MAX_TB_SIZE + 1];
- pixel top_array[2 * MAX_TB_SIZE + 1];
- pixel filtered_top_array[2 * MAX_TB_SIZE + 1];
-
- pixel *left = left_array + 1;
- pixel *top = top_array + 1;
- pixel *filtered_left = filtered_left_array + 1;
- pixel *filtered_top = filtered_top_array + 1;
+ pixel *left = left_array + 1;
+ pixel *top = top_array + 1;
+ pixel *filtered_left = filtered_left_array + 1;
+ pixel *filtered_top = filtered_top_array + 1;
- int cand_bottom_left = lc->na.cand_bottom_left && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb - 1, y_tb + size_in_tbs);
+ int cand_bottom_left = lc->na.cand_bottom_left && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb - 1, y_tb + size_in_tbs_v);
int cand_left = lc->na.cand_left;
int cand_up_left = lc->na.cand_up_left;
int cand_up = lc->na.cand_up;
- int cand_up_right = lc->na.cand_up_right && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb + size_in_tbs, y_tb - 1);
+ int cand_up_right = lc->na.cand_up_right && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb + size_in_tbs_h, y_tb - 1);
- int bottom_left_size = (FFMIN(y0 + 2 * size_in_luma, s->sps->height) -
- (y0 + size_in_luma)) >> vshift;
- int top_right_size = (FFMIN(x0 + 2 * size_in_luma, s->sps->width) -
- (x0 + size_in_luma)) >> hshift;
+ int bottom_left_size = (FFMIN(y0 + 2 * size_in_luma_v, s->sps->height) -
+ (y0 + size_in_luma_v)) >> vshift;
+ int top_right_size = (FFMIN(x0 + 2 * size_in_luma_h, s->sps->width) -
+ (x0 + size_in_luma_h)) >> hshift;
if (s->pps->constrained_intra_pred_flag == 1) {
- int size_in_luma_pu = PU(size_in_luma);
+ int size_in_luma_pu_v = PU(size_in_luma_v);
+ int size_in_luma_pu_h = PU(size_in_luma_h);
int on_pu_edge_x = !(x0 & ((1 << s->sps->log2_min_pu_size) - 1));
int on_pu_edge_y = !(y0 & ((1 << s->sps->log2_min_pu_size) - 1));
- if (!size_in_luma_pu)
- size_in_luma_pu++;
+ if (!size_in_luma_pu_h)
+ size_in_luma_pu_h++;
if (cand_bottom_left == 1 && on_pu_edge_x) {
int x_left_pu = PU(x0 - 1);
- int y_bottom_pu = PU(y0 + size_in_luma);
- int max = FFMIN(size_in_luma_pu, s->sps->min_pu_height - y_bottom_pu);
+ int y_bottom_pu = PU(y0 + size_in_luma_v);
+ int max = FFMIN(size_in_luma_pu_v, s->sps->min_pu_height - y_bottom_pu);
cand_bottom_left = 0;
- for (i = 0; i < max; i++)
- cand_bottom_left |= MVF(x_left_pu, y_bottom_pu + i).is_intra;
+ for (i = 0; i < max; i += 2)
+ cand_bottom_left |= (MVF(x_left_pu, y_bottom_pu + i).pred_flag == PF_INTRA);
}
if (cand_left == 1 && on_pu_edge_x) {
int x_left_pu = PU(x0 - 1);
int y_left_pu = PU(y0);
- int max = FFMIN(size_in_luma_pu, s->sps->min_pu_height - y_left_pu);
+ int max = FFMIN(size_in_luma_pu_v, s->sps->min_pu_height - y_left_pu);
cand_left = 0;
- for (i = 0; i < max; i++)
- cand_left |= MVF(x_left_pu, y_left_pu + i).is_intra;
+ for (i = 0; i < max; i += 2)
+ cand_left |= (MVF(x_left_pu, y_left_pu + i).pred_flag == PF_INTRA);
}
if (cand_up_left == 1) {
int x_left_pu = PU(x0 - 1);
int y_top_pu = PU(y0 - 1);
- cand_up_left = MVF(x_left_pu, y_top_pu).is_intra;
+ cand_up_left = MVF(x_left_pu, y_top_pu).pred_flag == PF_INTRA;
}
if (cand_up == 1 && on_pu_edge_y) {
int x_top_pu = PU(x0);
int y_top_pu = PU(y0 - 1);
- int max = FFMIN(size_in_luma_pu, s->sps->min_pu_width - x_top_pu);
+ int max = FFMIN(size_in_luma_pu_h, s->sps->min_pu_width - x_top_pu);
cand_up = 0;
- for (i = 0; i < max; i++)
- cand_up |= MVF(x_top_pu + i, y_top_pu).is_intra;
+ for (i = 0; i < max; i += 2)
+ cand_up |= (MVF(x_top_pu + i, y_top_pu).pred_flag == PF_INTRA);
}
if (cand_up_right == 1 && on_pu_edge_y) {
int y_top_pu = PU(y0 - 1);
- int x_right_pu = PU(x0 + size_in_luma);
- int max = FFMIN(size_in_luma_pu, s->sps->min_pu_width - x_right_pu);
+ int x_right_pu = PU(x0 + size_in_luma_h);
+ int max = FFMIN(size_in_luma_pu_h, s->sps->min_pu_width - x_right_pu);
cand_up_right = 0;
- for (i = 0; i < max; i++)
- cand_up_right |= MVF(x_right_pu + i, y_top_pu).is_intra;
- }
- for (i = 0; i < 2 * MAX_TB_SIZE; i++) {
- left[i] = 128;
- top[i] = 128;
+ for (i = 0; i < max; i += 2)
+ cand_up_right |= (MVF(x_right_pu + i, y_top_pu).pred_flag == PF_INTRA);
}
+ memset(left, 128, 2 * MAX_TB_SIZE*sizeof(pixel));
+ memset(top , 128, 2 * MAX_TB_SIZE*sizeof(pixel));
+ top[-1] = 128;
}
- if (cand_bottom_left) {
- for (i = size + bottom_left_size; i < (size << 1); i++)
- if (IS_INTRA(-1, size + bottom_left_size - 1) ||
- !s->pps->constrained_intra_pred_flag)
- left[i] = POS(-1, size + bottom_left_size - 1);
- for (i = size + bottom_left_size - 1; i >= size; i--)
- if (IS_INTRA(-1, i) || !s->pps->constrained_intra_pred_flag)
- left[i] = POS(-1, i);
+ if (cand_up_left) {
+ left[-1] = POS(-1, -1);
+ top[-1] = left[-1];
}
- if (cand_left)
- for (i = size - 1; i >= 0; i--)
- if (IS_INTRA(-1, i) || !s->pps->constrained_intra_pred_flag)
- left[i] = POS(-1, i);
- if (cand_up_left)
- if (IS_INTRA(-1, -1) || !s->pps->constrained_intra_pred_flag) {
- left[-1] = POS(-1, -1);
- top[-1] = left[-1];
- }
if (cand_up)
- for (i = size - 1; i >= 0; i--)
- if (IS_INTRA(i, -1) || !s->pps->constrained_intra_pred_flag)
- top[i] = POS(i, -1);
+ for (i = 0; i <size; i+=4)
+ AV_WN4P(&top[i], AV_RN4P(&POS(i, -1)));
+
if (cand_up_right) {
- for (i = size + top_right_size; i < (size << 1); i++)
- if (IS_INTRA(size + top_right_size - 1, -1) ||
- !s->pps->constrained_intra_pred_flag)
- top[i] = POS(size + top_right_size - 1, -1);
- for (i = size + top_right_size - 1; i >= size; i--)
- if (IS_INTRA(i, -1) || !s->pps->constrained_intra_pred_flag)
- top[i] = POS(i, -1);
+ a = PIXEL_SPLAT_X4(POS(size + top_right_size - 1, -1));
+ for (i = size + top_right_size; i < (size << 1); i += 4)
+ AV_WN4P(&top[i], a);
+ for (i = size ; i < size+top_right_size; i+=4)
+ AV_WN4P(&top[i], AV_RN4P(&POS(i, -1)));
+ }
+ if (cand_left)
+ for (i = 0; i < size; i++)
+ left[i] = POS(-1, i);
+ if (cand_bottom_left) {
+ for (i = size ; i < size+bottom_left_size; i++)
+ left[i] = POS(-1, i);
+ a = PIXEL_SPLAT_X4(POS(-1, size + bottom_left_size - 1));
+ for (i = size + bottom_left_size; i < (size << 1); i+=4)
+ AV_WN4P(&left[i], a);
}
if (s->pps->constrained_intra_pred_flag == 1) {
@@ -228,24 +223,34 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
left[-1] = top[-1];
j = 0;
}
+ left[-1] = top[-1];
if (cand_bottom_left || cand_left) {
- EXTEND_DOWN_CIP(left, j, size_max_y - j);
+ a = PIXEL_SPLAT_X4(left[-1]);
+ EXTEND_DOWN_CIP(left, 0, size_max_y);
}
if (!cand_left) {
- EXTEND_DOWN(left, 0, size);
+ a = PIXEL_SPLAT_X4(left[-1]);
+ EXTEND(left, 0, size);
}
if (!cand_bottom_left) {
- EXTEND_DOWN(left, size, size);
+ a = PIXEL_SPLAT_X4(left[size - 1]);
+ EXTEND(left, size, size);
}
if (x0 != 0 && y0 != 0) {
+ a = PIXEL_SPLAT_X4(left[size_max_y - 1]);
EXTEND_UP_CIP(left, size_max_y - 1, size_max_y);
+ if (!IS_INTRA(-1, - 1))
+ left[-1] = left[0];
} else if (x0 == 0) {
- EXTEND_UP_CIP_0(left, size_max_y - 1, size_max_y);
+ a = PIXEL_SPLAT_X4(left[size_max_y - 1]);
+ EXTEND(left, 0, size_max_y);
} else {
- EXTEND_UP_CIP(left, size_max_y - 1, size_max_y - 1);
+ a = PIXEL_SPLAT_X4(left[size_max_y - 1]);
+ EXTEND_UP_CIP(left, size_max_y - 1, size_max_y);
}
top[-1] = left[-1];
if (y0 != 0) {
+ a = PIXEL_SPLAT_X4(left[-1]);
EXTEND_RIGHT_CIP(top, 0, size_max_x);
}
}
@@ -253,80 +258,89 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
// Infer the unavailable samples
if (!cand_bottom_left) {
if (cand_left) {
- EXTEND_DOWN(left, size, size);
+ a = PIXEL_SPLAT_X4(left[size-1]);
+ EXTEND(left, size, size);
} else if (cand_up_left) {
- EXTEND_DOWN(left, 0, 2 * size);
+ a = PIXEL_SPLAT_X4(left[-1]);
+ EXTEND(left, 0, 2 * size);
cand_left = 1;
} else if (cand_up) {
left[-1] = top[0];
- EXTEND_DOWN(left, 0, 2 * size);
+ a = PIXEL_SPLAT_X4(left[-1]);
+ EXTEND(left, 0, 2 * size);
cand_up_left = 1;
cand_left = 1;
} else if (cand_up_right) {
- EXTEND_LEFT(top, size, size);
- left[-1] = top[0];
- EXTEND_DOWN(left, 0, 2 * size);
+ left[-1] = top[size];
+ a = PIXEL_SPLAT_X4(left[-1]);
+ EXTEND(top, 0, size);
+ EXTEND(left, 0, 2 * size);
cand_up = 1;
cand_up_left = 1;
cand_left = 1;
} else { // No samples available
- top[0] = left[-1] = (1 << (BIT_DEPTH - 1));
- EXTEND_RIGHT(top, 1, 2 * size - 1);
- EXTEND_DOWN(left, 0, 2 * size);
+ left[-1] = (1 << (BIT_DEPTH - 1));
+ a = PIXEL_SPLAT_X4(left[-1]);
+ EXTEND(top, 0, 2 * size);
+ EXTEND(left, 0, 2 * size);
}
}
if (!cand_left) {
- EXTEND_UP(left, size, size);
+ a = PIXEL_SPLAT_X4(left[size]);
+ EXTEND(left, 0, size);
}
if (!cand_up_left) {
left[-1] = left[0];
}
if (!cand_up) {
- top[0] = left[-1];
- EXTEND_RIGHT(top, 1, size - 1);
+ a = PIXEL_SPLAT_X4(left[-1]);
+ EXTEND(top, 0, size);
}
if (!cand_up_right) {
- EXTEND_RIGHT(top, size, size);
+ a = PIXEL_SPLAT_X4(top[size-1]);
+ EXTEND(top, size, size);
}
top[-1] = left[-1];
// Filtering process
- if (c_idx == 0 && mode != INTRA_DC && size != 4) {
- int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
- int min_dist_vert_hor = FFMIN(FFABS((int)(mode - 26U)),
- FFABS((int)(mode - 10U)));
- if (min_dist_vert_hor > intra_hor_ver_dist_thresh[log2_size - 3]) {
- int threshold = 1 << (BIT_DEPTH - 5);
- if (s->sps->sps_strong_intra_smoothing_enable_flag &&
- log2_size == 5 &&
- FFABS(top[-1] + top[63] - 2 * top[31]) < threshold &&
- FFABS(left[-1] + left[63] - 2 * left[31]) < threshold) {
- // We can't just overwrite values in top because it could be
- // a pointer into src
- filtered_top[-1] = top[-1];
- filtered_top[63] = top[63];
- for (i = 0; i < 63; i++)
- filtered_top[i] = ((64 - (i + 1)) * top[-1] +
- (i + 1) * top[63] + 32) >> 6;
- for (i = 0; i < 63; i++)
- left[i] = ((64 - (i + 1)) * left[-1] +
- (i + 1) * left[63] + 32) >> 6;
- top = filtered_top;
- } else {
- filtered_left[2 * size - 1] = left[2 * size - 1];
- filtered_top[2 * size - 1] = top[2 * size - 1];
- for (i = 2 * size - 2; i >= 0; i--)
- filtered_left[i] = (left[i + 1] + 2 * left[i] +
- left[i - 1] + 2) >> 2;
- filtered_top[-1] =
- filtered_left[-1] = (left[0] + 2 * left[-1] + top[0] + 2) >> 2;
- for (i = 2 * size - 2; i >= 0; i--)
- filtered_top[i] = (top[i + 1] + 2 * top[i] +
- top[i - 1] + 2) >> 2;
- left = filtered_left;
- top = filtered_top;
+ if (c_idx == 0) {
+ if (mode != INTRA_DC && size != 4){
+ int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
+ int min_dist_vert_hor = FFMIN(FFABS((int)(mode - 26U)),
+ FFABS((int)(mode - 10U)));
+ if (min_dist_vert_hor > intra_hor_ver_dist_thresh[log2_size - 3]) {
+ int threshold = 1 << (BIT_DEPTH - 5);
+ if (s->sps->sps_strong_intra_smoothing_enable_flag && c_idx == 0 &&
+ log2_size == 5 &&
+ FFABS(top[-1] + top[63] - 2 * top[31]) < threshold &&
+ FFABS(left[-1] + left[63] - 2 * left[31]) < threshold) {
+ // We can't just overwrite values in top because it could be
+ // a pointer into src
+ filtered_top[-1] = top[-1];
+ filtered_top[63] = top[63];
+ for (i = 0; i < 63; i++)
+ filtered_top[i] = ((64 - (i + 1)) * top[-1] +
+ (i + 1) * top[63] + 32) >> 6;
+ for (i = 0; i < 63; i++)
+ left[i] = ((64 - (i + 1)) * left[-1] +
+ (i + 1) * left[63] + 32) >> 6;
+ top = filtered_top;
+ } else {
+ filtered_left[2 * size - 1] = left[2 * size - 1];
+ filtered_top[2 * size - 1] = top[2 * size - 1];
+ for (i = 2 * size - 2; i >= 0; i--)
+ filtered_left[i] = (left[i + 1] + 2 * left[i] +
+ left[i - 1] + 2) >> 2;
+ filtered_top[-1] =
+ filtered_left[-1] = (left[0] + 2 * left[-1] + top[0] + 2) >> 2;
+ for (i = 2 * size - 2; i >= 0; i--)
+ filtered_top[i] = (top[i + 1] + 2 * top[i] +
+ top[i - 1] + 2) >> 2;
+ left = filtered_left;
+ top = filtered_top;
+ }
}
}
}
@@ -348,57 +362,43 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
}
}
-static void FUNC(pred_planar_0)(uint8_t *_src, const uint8_t *_top,
- const uint8_t *_left,
- ptrdiff_t stride)
+static av_always_inline void FUNC(pred_planar)(uint8_t *_src, const uint8_t *_top,
+ const uint8_t *_left, ptrdiff_t stride,
+ int trafo_size)
{
int x, y;
pixel *src = (pixel *)_src;
const pixel *top = (const pixel *)_top;
const pixel *left = (const pixel *)_left;
- for (y = 0; y < 4; y++)
- for (x = 0; x < 4; x++)
- POS(x, y) = ((3 - x) * left[y] + (x + 1) * top[4] +
- (3 - y) * top[x] + (y + 1) * left[4] + 4) >> 3;
+ int size = 1 << trafo_size;
+ for (y = 0; y < size; y++)
+ for (x = 0; x < size; x++)
+ POS(x, y) = ((size - 1 - x) * left[y] + (x + 1) * top[size] +
+ (size - 1 - y) * top[x] + (y + 1) * left[size] + size) >> (trafo_size + 1);
+}
+
+static void FUNC(pred_planar_0)(uint8_t *_src, const uint8_t *_top,
+ const uint8_t *_left, ptrdiff_t stride)
+{
+ FUNC(pred_planar)(_src, _top, _left, stride, 2);
}
static void FUNC(pred_planar_1)(uint8_t *_src, const uint8_t *_top,
const uint8_t *_left, ptrdiff_t stride)
{
- int x, y;
- pixel *src = (pixel *)_src;
- const pixel *top = (const pixel *)_top;
- const pixel *left = (const pixel *)_left;
- for (y = 0; y < 8; y++)
- for (x = 0; x < 8; x++)
- POS(x, y) = ((7 - x) * left[y] + (x + 1) * top[8] +
- (7 - y) * top[x] + (y + 1) * left[8] + 8) >> 4;
+ FUNC(pred_planar)(_src, _top, _left, stride, 3);
}
static void FUNC(pred_planar_2)(uint8_t *_src, const uint8_t *_top,
const uint8_t *_left, ptrdiff_t stride)
{
- int x, y;
- pixel *src = (pixel *)_src;
- const pixel *top = (const pixel *)_top;
- const pixel *left = (const pixel *)_left;
- for (y = 0; y < 16; y++)
- for (x = 0; x < 16; x++)
- POS(x, y) = ((15 - x) * left[y] + (x + 1) * top[16] +
- (15 - y) * top[x] + (y + 1) * left[16] + 16) >> 5;
+ FUNC(pred_planar)(_src, _top, _left, stride, 4);
}
static void FUNC(pred_planar_3)(uint8_t *_src, const uint8_t *_top,
const uint8_t *_left, ptrdiff_t stride)
{
- int x, y;
- pixel *src = (pixel *)_src;
- const pixel *top = (const pixel *)_top;
- const pixel *left = (const pixel *)_left;
- for (y = 0; y < 32; y++)
- for (x = 0; x < 32; x++)
- POS(x, y) = ((31 - x) * left[y] + (x + 1) * top[32] +
- (31 - y) * top[x] + (y + 1) * left[32] + 32) >> 6;
+ FUNC(pred_planar)(_src, _top, _left, stride, 5);
}
static void FUNC(pred_dc)(uint8_t *_src, const uint8_t *_top,
@@ -420,8 +420,8 @@ static void FUNC(pred_dc)(uint8_t *_src, const uint8_t *_top,
a = PIXEL_SPLAT_X4(dc);
for (i = 0; i < size; i++)
- for (j = 0; j < size / 4; j++)
- AV_WN4PA(&POS(j * 4, i), a);
+ for (j = 0; j < size; j+=4)
+ AV_WN4P(&POS(j, i), a);
if (c_idx == 0 && size < 32) {
POS(0, 0) = (left[0] + 2 * dc + top[0] + 2) >> 2;
@@ -453,7 +453,7 @@ static av_always_inline void FUNC(pred_angular)(uint8_t *_src,
};
int angle = intra_pred_angle[mode - 2];
- pixel ref_array[3 * MAX_TB_SIZE + 1];
+ pixel ref_array[3 * MAX_TB_SIZE + 4];
pixel *ref_tmp = ref_array + size;
const pixel *ref;
int last = (size * angle) >> 5;
@@ -461,8 +461,8 @@ static av_always_inline void FUNC(pred_angular)(uint8_t *_src,
if (mode >= 18) {
ref = top - 1;
if (angle < 0 && last < -1) {
- for (x = 0; x <= size; x++)
- ref_tmp[x] = top[x - 1];
+ for (x = 0; x <= size; x += 4)
+ AV_WN4P(&ref_tmp[x], AV_RN4P(&top[x - 1]));
for (x = last; x <= -1; x++)
ref_tmp[x] = left[-1 + ((x * inv_angle[mode - 11] + 128) >> 8)];
ref = ref_tmp;
@@ -472,13 +472,19 @@ static av_always_inline void FUNC(pred_angular)(uint8_t *_src,
int idx = ((y + 1) * angle) >> 5;
int fact = ((y + 1) * angle) & 31;
if (fact) {
- for (x = 0; x < size; x++) {
- POS(x, y) = ((32 - fact) * ref[x + idx + 1] +
- fact * ref[x + idx + 2] + 16) >> 5;
+ for (x = 0; x < size; x += 4) {
+ POS(x , y) = ((32 - fact) * ref[x + idx + 1] +
+ fact * ref[x + idx + 2] + 16) >> 5;
+ POS(x + 1, y) = ((32 - fact) * ref[x + 1 + idx + 1] +
+ fact * ref[x + 1 + idx + 2] + 16) >> 5;
+ POS(x + 2, y) = ((32 - fact) * ref[x + 2 + idx + 1] +
+ fact * ref[x + 2 + idx + 2] + 16) >> 5;
+ POS(x + 3, y) = ((32 - fact) * ref[x + 3 + idx + 1] +
+ fact * ref[x + 3 + idx + 2] + 16) >> 5;
}
} else {
- for (x = 0; x < size; x++)
- POS(x, y) = ref[x + idx + 1];
+ for (x = 0; x < size; x += 4)
+ AV_WN4P(&POS(x, y), AV_RN4P(&ref[x + idx + 1]));
}
}
if (mode == 26 && c_idx == 0 && size < 32) {
@@ -488,8 +494,8 @@ static av_always_inline void FUNC(pred_angular)(uint8_t *_src,
} else {
ref = left - 1;
if (angle < 0 && last < -1) {
- for (x = 0; x <= size; x++)
- ref_tmp[x] = left[x - 1];
+ for (x = 0; x <= size; x += 4)
+ AV_WN4P(&ref_tmp[x], AV_RN4P(&left[x - 1]));
for (x = last; x <= -1; x++)
ref_tmp[x] = top[-1 + ((x * inv_angle[mode - 11] + 128) >> 8)];
ref = ref_tmp;
@@ -509,8 +515,12 @@ static av_always_inline void FUNC(pred_angular)(uint8_t *_src,
}
}
if (mode == 10 && c_idx == 0 && size < 32) {
- for (x = 0; x < size; x++)
- POS(x, 0) = av_clip_pixel(left[0] + ((top[x] - top[-1]) >> 1));
+ for (x = 0; x < size; x += 4) {
+ POS(x, 0) = av_clip_pixel(left[0] + ((top[x ] - top[-1]) >> 1));
+ POS(x + 1, 0) = av_clip_pixel(left[0] + ((top[x + 1] - top[-1]) >> 1));
+ POS(x + 2, 0) = av_clip_pixel(left[0] + ((top[x + 2] - top[-1]) >> 1));
+ POS(x + 3, 0) = av_clip_pixel(left[0] + ((top[x + 3] - top[-1]) >> 1));
+ }
}
}
}
@@ -551,9 +561,6 @@ static void FUNC(pred_angular_3)(uint8_t *src, const uint8_t *top,
#undef MVF_PU
#undef MVF
#undef PU
-#undef EXTEND_LEFT
-#undef EXTEND_RIGHT
-#undef EXTEND_UP
-#undef EXTEND_DOWN
+#undef EXTEND
#undef MIN_TB_ADDR_ZS
#undef POS
diff --git a/chromium/third_party/ffmpeg/libavcodec/hnm4video.c b/chromium/third_party/ffmpeg/libavcodec/hnm4video.c
index 177972ba64d..d8c51d0b751 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hnm4video.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hnm4video.c
@@ -36,8 +36,8 @@
typedef struct Hnm4VideoContext {
uint8_t version;
- uint16_t width;
- uint16_t height;
+ int width;
+ int height;
uint8_t *current;
uint8_t *previous;
uint8_t *buffer1;
@@ -311,8 +311,13 @@ static void decode_interframe_v4a(AVCodecContext *avctx, uint8_t *src,
offset = writeoffset;
offset += bytestream2_get_le16(&gb);
- if (delta)
+ if (delta) {
+ if (offset < 0x10000) {
+ av_log(avctx, AV_LOG_ERROR, "Attempting to read out of bounds\n");
+ break;
+ }
offset -= 0x10000;
+ }
if (offset + hnm->width + count >= hnm->width * hnm->height) {
av_log(avctx, AV_LOG_ERROR, "Attempting to read out of bounds\n");
diff --git a/chromium/third_party/ffmpeg/libavcodec/hpel_template.c b/chromium/third_party/ffmpeg/libavcodec/hpel_template.c
index 3b4699927f0..fccfe7610fe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hpel_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hpel_template.c
@@ -19,81 +19,87 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define DEF_HPEL(OPNAME, OP) \
-static inline void FUNCC(OPNAME ## _pixels2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- int i;\
- for(i=0; i<h; i++){\
- OP(*((pixel2*)(block )), AV_RN2P(pixels ));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-static inline void FUNCC(OPNAME ## _pixels4)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- int i;\
- for(i=0; i<h; i++){\
- OP(*((pixel4*)(block )), AV_RN4P(pixels ));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-static inline void FUNCC(OPNAME ## _pixels8)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- int i;\
- for(i=0; i<h; i++){\
- OP(*((pixel4*)(block )), AV_RN4P(pixels ));\
- OP(*((pixel4*)(block+4*sizeof(pixel))), AV_RN4P(pixels+4*sizeof(pixel)));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static inline void FUNC(OPNAME ## _pixels8_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- int i;\
- for(i=0; i<h; i++){\
- pixel4 a,b;\
- a= AV_RN4P(&src1[i*src_stride1 ]);\
- b= AV_RN4P(&src2[i*src_stride2 ]);\
- OP(*((pixel4*)&dst[i*dst_stride ]), rnd_avg_pixel4(a, b));\
- a= AV_RN4P(&src1[i*src_stride1+4*sizeof(pixel)]);\
- b= AV_RN4P(&src2[i*src_stride2+4*sizeof(pixel)]);\
- OP(*((pixel4*)&dst[i*dst_stride+4*sizeof(pixel)]), rnd_avg_pixel4(a, b));\
- }\
-}\
-\
-static inline void FUNC(OPNAME ## _pixels4_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- int i;\
- for(i=0; i<h; i++){\
- pixel4 a,b;\
- a= AV_RN4P(&src1[i*src_stride1 ]);\
- b= AV_RN4P(&src2[i*src_stride2 ]);\
- OP(*((pixel4*)&dst[i*dst_stride ]), rnd_avg_pixel4(a, b));\
- }\
-}\
-\
-static inline void FUNC(OPNAME ## _pixels2_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- int i;\
- for(i=0; i<h; i++){\
- pixel4 a,b;\
- a= AV_RN2P(&src1[i*src_stride1 ]);\
- b= AV_RN2P(&src2[i*src_stride2 ]);\
- OP(*((pixel2*)&dst[i*dst_stride ]), rnd_avg_pixel4(a, b));\
- }\
-}\
-\
-static inline void FUNC(OPNAME ## _pixels16_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- FUNC(OPNAME ## _pixels8_l2)(dst , src1 , src2 , dst_stride, src_stride1, src_stride2, h);\
- FUNC(OPNAME ## _pixels8_l2)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, h);\
-}\
-\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16) , FUNCC(OPNAME ## _pixels8) , 8*sizeof(pixel))
+#include "libavutil/intreadwrite.h"
+#include "pixels.h"
+
+#include "bit_depth_template.c"
+
+#define DEF_HPEL(OPNAME, OP) \
+static inline void FUNC(OPNAME ## _pixels8_l2)(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int h) \
+{ \
+ int i; \
+ for (i = 0; i < h; i++) { \
+ pixel4 a, b; \
+ a = AV_RN4P(&src1[i * src_stride1]); \
+ b = AV_RN4P(&src2[i * src_stride2]); \
+ OP(*((pixel4 *) &dst[i * dst_stride]), rnd_avg_pixel4(a, b)); \
+ a = AV_RN4P(&src1[i * src_stride1 + 4 * sizeof(pixel)]); \
+ b = AV_RN4P(&src2[i * src_stride2 + 4 * sizeof(pixel)]); \
+ OP(*((pixel4 *) &dst[i * dst_stride + 4 * sizeof(pixel)]), \
+ rnd_avg_pixel4(a, b)); \
+ } \
+} \
+ \
+static inline void FUNC(OPNAME ## _pixels4_l2)(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int h) \
+{ \
+ int i; \
+ for (i = 0; i < h; i++) { \
+ pixel4 a, b; \
+ a = AV_RN4P(&src1[i * src_stride1]); \
+ b = AV_RN4P(&src2[i * src_stride2]); \
+ OP(*((pixel4 *) &dst[i * dst_stride]), rnd_avg_pixel4(a, b)); \
+ } \
+} \
+ \
+static inline void FUNC(OPNAME ## _pixels2_l2)(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int h) \
+{ \
+ int i; \
+ for (i = 0; i < h; i++) { \
+ pixel4 a, b; \
+ a = AV_RN2P(&src1[i * src_stride1]); \
+ b = AV_RN2P(&src2[i * src_stride2]); \
+ OP(*((pixel2 *) &dst[i * dst_stride]), rnd_avg_pixel4(a, b)); \
+ } \
+} \
+ \
+static inline void FUNC(OPNAME ## _pixels16_l2)(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int h) \
+{ \
+ FUNC(OPNAME ## _pixels8_l2)(dst, src1, src2, dst_stride, \
+ src_stride1, src_stride2, h); \
+ FUNC(OPNAME ## _pixels8_l2)(dst + 8 * sizeof(pixel), \
+ src1 + 8 * sizeof(pixel), \
+ src2 + 8 * sizeof(pixel), \
+ dst_stride, src_stride1, \
+ src_stride2, h); \
+} \
#define op_avg(a, b) a = rnd_avg_pixel4(a, b)
#define op_put(a, b) a = b
-
DEF_HPEL(avg, op_avg)
DEF_HPEL(put, op_put)
#undef op_avg
diff --git a/chromium/third_party/ffmpeg/libavcodec/hpeldsp.c b/chromium/third_party/ffmpeg/libavcodec/hpeldsp.c
index 473102dddea..63449930412 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hpeldsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hpeldsp.c
@@ -32,7 +32,308 @@
#include "hpeldsp.h"
#define BIT_DEPTH 8
-#include "hpeldsp_template.c"
+#include "hpel_template.c"
+#include "tpel_template.c"
+
+#define PIXOP2(OPNAME, OP) \
+static inline void OPNAME ## _no_rnd_pixels8_l2_8(uint8_t *dst, \
+ const uint8_t *src1, \
+ const uint8_t *src2, \
+ int dst_stride, \
+ int src_stride1, \
+ int src_stride2, \
+ int h) \
+{ \
+ int i; \
+ \
+ for (i = 0; i < h; i++) { \
+ uint32_t a, b; \
+ a = AV_RN32(&src1[i * src_stride1]); \
+ b = AV_RN32(&src2[i * src_stride2]); \
+ OP(*((uint32_t *) &dst[i * dst_stride]), \
+ no_rnd_avg32(a, b)); \
+ a = AV_RN32(&src1[i * src_stride1 + 4]); \
+ b = AV_RN32(&src2[i * src_stride2 + 4]); \
+ OP(*((uint32_t *) &dst[i * dst_stride + 4]), \
+ no_rnd_avg32(a, b)); \
+ } \
+} \
+ \
+static inline void OPNAME ## _no_rnd_pixels8_x2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ OPNAME ## _no_rnd_pixels8_l2_8(block, pixels, pixels + 1, \
+ line_size, line_size, line_size, h); \
+} \
+ \
+static inline void OPNAME ## _pixels8_x2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ OPNAME ## _pixels8_l2_8(block, pixels, pixels + 1, \
+ line_size, line_size, line_size, h); \
+} \
+ \
+static inline void OPNAME ## _no_rnd_pixels8_y2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ OPNAME ## _no_rnd_pixels8_l2_8(block, pixels, pixels + line_size, \
+ line_size, line_size, line_size, h); \
+} \
+ \
+static inline void OPNAME ## _pixels8_y2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ OPNAME ## _pixels8_l2_8(block, pixels, pixels + line_size, \
+ line_size, line_size, line_size, h); \
+} \
+ \
+static inline void OPNAME ## _pixels4_x2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ OPNAME ## _pixels4_l2_8(block, pixels, pixels + 1, \
+ line_size, line_size, line_size, h); \
+} \
+ \
+static inline void OPNAME ## _pixels4_y2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ OPNAME ## _pixels4_l2_8(block, pixels, pixels + line_size, \
+ line_size, line_size, line_size, h); \
+} \
+ \
+static inline void OPNAME ## _pixels2_x2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ OPNAME ## _pixels2_l2_8(block, pixels, pixels + 1, \
+ line_size, line_size, line_size, h); \
+} \
+ \
+static inline void OPNAME ## _pixels2_y2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ OPNAME ## _pixels2_l2_8(block, pixels, pixels + line_size, \
+ line_size, line_size, line_size, h); \
+} \
+ \
+static inline void OPNAME ## _pixels2_xy2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ int i, a1, b1; \
+ int a0 = pixels[0]; \
+ int b0 = pixels[1] + 2; \
+ \
+ a0 += b0; \
+ b0 += pixels[2]; \
+ pixels += line_size; \
+ for (i = 0; i < h; i += 2) { \
+ a1 = pixels[0]; \
+ b1 = pixels[1]; \
+ a1 += b1; \
+ b1 += pixels[2]; \
+ \
+ block[0] = (a1 + a0) >> 2; /* FIXME non put */ \
+ block[1] = (b1 + b0) >> 2; \
+ \
+ pixels += line_size; \
+ block += line_size; \
+ \
+ a0 = pixels[0]; \
+ b0 = pixels[1] + 2; \
+ a0 += b0; \
+ b0 += pixels[2]; \
+ \
+ block[0] = (a1 + a0) >> 2; \
+ block[1] = (b1 + b0) >> 2; \
+ pixels += line_size; \
+ block += line_size; \
+ } \
+} \
+ \
+static inline void OPNAME ## _pixels4_xy2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ /* FIXME HIGH BIT DEPTH */ \
+ int i; \
+ const uint32_t a = AV_RN32(pixels); \
+ const uint32_t b = AV_RN32(pixels + 1); \
+ uint32_t l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x02020202UL; \
+ uint32_t h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ uint32_t l1, h1; \
+ \
+ pixels += line_size; \
+ for (i = 0; i < h; i += 2) { \
+ uint32_t a = AV_RN32(pixels); \
+ uint32_t b = AV_RN32(pixels + 1); \
+ l1 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL); \
+ h1 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) block), h0 + h1 + \
+ (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ pixels += line_size; \
+ block += line_size; \
+ a = AV_RN32(pixels); \
+ b = AV_RN32(pixels + 1); \
+ l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x02020202UL; \
+ h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) block), h0 + h1 + \
+ (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ pixels += line_size; \
+ block += line_size; \
+ } \
+} \
+ \
+static inline void OPNAME ## _pixels8_xy2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ /* FIXME HIGH BIT DEPTH */ \
+ int j; \
+ \
+ for (j = 0; j < 2; j++) { \
+ int i; \
+ const uint32_t a = AV_RN32(pixels); \
+ const uint32_t b = AV_RN32(pixels + 1); \
+ uint32_t l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x02020202UL; \
+ uint32_t h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ uint32_t l1, h1; \
+ \
+ pixels += line_size; \
+ for (i = 0; i < h; i += 2) { \
+ uint32_t a = AV_RN32(pixels); \
+ uint32_t b = AV_RN32(pixels + 1); \
+ l1 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL); \
+ h1 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) block), h0 + h1 + \
+ (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ pixels += line_size; \
+ block += line_size; \
+ a = AV_RN32(pixels); \
+ b = AV_RN32(pixels + 1); \
+ l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x02020202UL; \
+ h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) block), h0 + h1 + \
+ (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ pixels += line_size; \
+ block += line_size; \
+ } \
+ pixels += 4 - line_size * (h + 1); \
+ block += 4 - line_size * h; \
+ } \
+} \
+ \
+static inline void OPNAME ## _no_rnd_pixels8_xy2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ /* FIXME HIGH BIT DEPTH */ \
+ int j; \
+ \
+ for (j = 0; j < 2; j++) { \
+ int i; \
+ const uint32_t a = AV_RN32(pixels); \
+ const uint32_t b = AV_RN32(pixels + 1); \
+ uint32_t l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x01010101UL; \
+ uint32_t h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ uint32_t l1, h1; \
+ \
+ pixels += line_size; \
+ for (i = 0; i < h; i += 2) { \
+ uint32_t a = AV_RN32(pixels); \
+ uint32_t b = AV_RN32(pixels + 1); \
+ l1 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL); \
+ h1 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) block), h0 + h1 + \
+ (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ pixels += line_size; \
+ block += line_size; \
+ a = AV_RN32(pixels); \
+ b = AV_RN32(pixels + 1); \
+ l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x01010101UL; \
+ h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) block), h0 + h1 + \
+ (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ pixels += line_size; \
+ block += line_size; \
+ } \
+ pixels += 4 - line_size * (h + 1); \
+ block += 4 - line_size * h; \
+ } \
+} \
+ \
+CALL_2X_PIXELS(OPNAME ## _pixels16_x2_8_c, \
+ OPNAME ## _pixels8_x2_8_c, \
+ 8) \
+CALL_2X_PIXELS(OPNAME ## _pixels16_y2_8_c, \
+ OPNAME ## _pixels8_y2_8_c, \
+ 8) \
+CALL_2X_PIXELS(OPNAME ## _pixels16_xy2_8_c, \
+ OPNAME ## _pixels8_xy2_8_c, \
+ 8) \
+CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_8_c, \
+ OPNAME ## _pixels8_8_c, \
+ 8) \
+CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_x2_8_c, \
+ OPNAME ## _no_rnd_pixels8_x2_8_c, \
+ 8) \
+CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_y2_8_c, \
+ OPNAME ## _no_rnd_pixels8_y2_8_c, \
+ 8) \
+CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_xy2_8_c, \
+ OPNAME ## _no_rnd_pixels8_xy2_8_c, \
+ 8) \
+
+#define op_avg(a, b) a = rnd_avg32(a, b)
+#define op_put(a, b) a = b
+#define put_no_rnd_pixels8_8_c put_pixels8_8_c
+PIXOP2(avg, op_avg)
+PIXOP2(put, op_put)
+#undef op_avg
+#undef op_put
av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
{
@@ -54,6 +355,8 @@ av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
hpel_funcs(avg, [3], 2);
hpel_funcs(avg_no_rnd,, 16);
+ if (ARCH_AARCH64)
+ ff_hpeldsp_init_aarch64(c, flags);
if (ARCH_ALPHA)
ff_hpeldsp_init_alpha(c, flags);
if (ARCH_ARM)
@@ -62,8 +365,6 @@ av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
ff_hpeldsp_init_bfin(c, flags);
if (ARCH_PPC)
ff_hpeldsp_init_ppc(c, flags);
- if (HAVE_VIS)
- ff_hpeldsp_init_vis(c, flags);
if (ARCH_X86)
ff_hpeldsp_init_x86(c, flags);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/hpeldsp.h b/chromium/third_party/ffmpeg/libavcodec/hpeldsp.h
index ec9006c31da..f8e7b028512 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hpeldsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/hpeldsp.h
@@ -94,11 +94,11 @@ typedef struct HpelDSPContext {
void ff_hpeldsp_init(HpelDSPContext *c, int flags);
+void ff_hpeldsp_init_aarch64(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_alpha(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags);
-void ff_hpeldsp_init_vis(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags);
#endif /* AVCODEC_HPELDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/hpeldsp_template.c b/chromium/third_party/ffmpeg/libavcodec/hpeldsp_template.c
deleted file mode 100644
index 9c9fd2b9e71..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/hpeldsp_template.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Half-pel DSP functions.
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * gmc & q-pel & 32/64 bit based MC by 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
- */
-
-/**
- * @file
- * Half-pel DSP functions.
- */
-
-#include "bit_depth_template.c"
-
-#include "hpel_template.c"
-
-#define PIXOP2(OPNAME, OP) \
-static inline void FUNC(OPNAME ## _no_rnd_pixels8_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- int i;\
- for(i=0; i<h; i++){\
- pixel4 a,b;\
- a= AV_RN4P(&src1[i*src_stride1 ]);\
- b= AV_RN4P(&src2[i*src_stride2 ]);\
- OP(*((pixel4*)&dst[i*dst_stride ]), no_rnd_avg_pixel4(a, b));\
- a= AV_RN4P(&src1[i*src_stride1+4*sizeof(pixel)]);\
- b= AV_RN4P(&src2[i*src_stride2+4*sizeof(pixel)]);\
- OP(*((pixel4*)&dst[i*dst_stride+4*sizeof(pixel)]), no_rnd_avg_pixel4(a, b));\
- }\
-}\
-\
-static inline void FUNCC(OPNAME ## _no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- FUNC(OPNAME ## _no_rnd_pixels8_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- FUNC(OPNAME ## _pixels8_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- FUNC(OPNAME ## _no_rnd_pixels8_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- FUNC(OPNAME ## _pixels8_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels4_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- FUNC(OPNAME ## _pixels4_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels4_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- FUNC(OPNAME ## _pixels4_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels2_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- FUNC(OPNAME ## _pixels2_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels2_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- FUNC(OPNAME ## _pixels2_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *_block, const uint8_t *_pixels, ptrdiff_t line_size, int h)\
-{\
- int i, a0, b0, a1, b1;\
- pixel *block = (pixel*)_block;\
- const pixel *pixels = (const pixel*)_pixels;\
- line_size >>= sizeof(pixel)-1;\
- a0= pixels[0];\
- b0= pixels[1] + 2;\
- a0 += b0;\
- b0 += pixels[2];\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- a1= pixels[0];\
- b1= pixels[1];\
- a1 += b1;\
- b1 += pixels[2];\
-\
- block[0]= (a1+a0)>>2; /* FIXME non put */\
- block[1]= (b1+b0)>>2;\
-\
- pixels+=line_size;\
- block +=line_size;\
-\
- a0= pixels[0];\
- b0= pixels[1] + 2;\
- a0 += b0;\
- b0 += pixels[2];\
-\
- block[0]= (a1+a0)>>2;\
- block[1]= (b1+b0)>>2;\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels4_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\
-{\
- /* FIXME HIGH BIT DEPTH */\
- int i;\
- const uint32_t a= AV_RN32(pixels );\
- const uint32_t b= AV_RN32(pixels+1);\
- uint32_t l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- uint32_t l1,h1;\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- uint32_t a= AV_RN32(pixels );\
- uint32_t b= AV_RN32(pixels+1);\
- l1= (a&0x03030303UL)\
- + (b&0x03030303UL);\
- h1= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- a= AV_RN32(pixels );\
- b= AV_RN32(pixels+1);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\
-{\
- /* FIXME HIGH BIT DEPTH */\
- int j;\
- for(j=0; j<2; j++){\
- int i;\
- const uint32_t a= AV_RN32(pixels );\
- const uint32_t b= AV_RN32(pixels+1);\
- uint32_t l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- uint32_t l1,h1;\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- uint32_t a= AV_RN32(pixels );\
- uint32_t b= AV_RN32(pixels+1);\
- l1= (a&0x03030303UL)\
- + (b&0x03030303UL);\
- h1= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- a= AV_RN32(pixels );\
- b= AV_RN32(pixels+1);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- }\
- pixels+=4-line_size*(h+1);\
- block +=4-line_size*h;\
- }\
-}\
-\
-static inline void FUNCC(OPNAME ## _no_rnd_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\
-{\
- /* FIXME HIGH BIT DEPTH */\
- int j;\
- for(j=0; j<2; j++){\
- int i;\
- const uint32_t a= AV_RN32(pixels );\
- const uint32_t b= AV_RN32(pixels+1);\
- uint32_t l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x01010101UL;\
- uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- uint32_t l1,h1;\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- uint32_t a= AV_RN32(pixels );\
- uint32_t b= AV_RN32(pixels+1);\
- l1= (a&0x03030303UL)\
- + (b&0x03030303UL);\
- h1= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- a= AV_RN32(pixels );\
- b= AV_RN32(pixels+1);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x01010101UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- }\
- pixels+=4-line_size*(h+1);\
- block +=4-line_size*h;\
- }\
-}\
-\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_x2) , FUNCC(OPNAME ## _pixels8_x2) , 8*sizeof(pixel))\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_y2) , FUNCC(OPNAME ## _pixels8_y2) , 8*sizeof(pixel))\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_xy2), FUNCC(OPNAME ## _pixels8_xy2), 8*sizeof(pixel))\
-av_unused CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16) , FUNCC(OPNAME ## _pixels8) , 8*sizeof(pixel))\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_x2) , FUNCC(OPNAME ## _no_rnd_pixels8_x2) , 8*sizeof(pixel))\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_y2) , FUNCC(OPNAME ## _no_rnd_pixels8_y2) , 8*sizeof(pixel))\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_xy2), FUNCC(OPNAME ## _no_rnd_pixels8_xy2), 8*sizeof(pixel))\
-
-#define op_avg(a, b) a = rnd_avg_pixel4(a, b)
-#define op_put(a, b) a = b
-#if BIT_DEPTH == 8
-#define put_no_rnd_pixels8_8_c put_pixels8_8_c
-PIXOP2(avg, op_avg)
-PIXOP2(put, op_put)
-#endif
-#undef op_avg
-#undef op_put
diff --git a/chromium/third_party/ffmpeg/libavcodec/huffman.c b/chromium/third_party/ffmpeg/libavcodec/huffman.c
index 8dd356dde41..0fc2055dbeb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/huffman.c
+++ b/chromium/third_party/ffmpeg/libavcodec/huffman.c
@@ -52,18 +52,23 @@ static void heap_sift(HeapElem *h, int root, int size)
}
}
-void ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats)
+int ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats, int size)
{
- HeapElem h[256];
- int up[2*256];
- int len[2*256];
+ HeapElem *h = av_malloc_array(sizeof(*h), size);
+ int *up = av_malloc_array(sizeof(*up) * 2, size);
+ uint8_t *len = av_malloc_array(sizeof(*len) * 2, size);
int offset, i, next;
- int size = 256;
+ int ret = 0;
+
+ if (!h || !up || !len) {
+ ret = AVERROR(ENOMEM);
+ goto end;
+ }
for (offset = 1; ; offset <<= 1) {
for (i=0; i < size; i++) {
h[i].name = i;
- h[i].val = (stats[i] << 8) + offset;
+ h[i].val = (stats[i] << 14) + offset;
}
for (i = size / 2 - 1; i >= 0; i--)
heap_sift(h, i, size);
@@ -89,6 +94,11 @@ void ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats)
}
if (i==size) break;
}
+end:
+ av_free(h);
+ av_free(up);
+ av_free(len);
+ return ret;
}
static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat,
diff --git a/chromium/third_party/ffmpeg/libavcodec/huffman.h b/chromium/third_party/ffmpeg/libavcodec/huffman.h
index cec95379acc..b1ace62201d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/huffman.h
+++ b/chromium/third_party/ffmpeg/libavcodec/huffman.h
@@ -43,6 +43,6 @@ typedef int (*HuffCmp)(const void *va, const void *vb);
int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes, int nb_bits,
Node *nodes, HuffCmp cmp, int flags);
-void ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats);
+int ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats, int n);
#endif /* AVCODEC_HUFFMAN_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/huffyuv.c b/chromium/third_party/ffmpeg/libavcodec/huffyuv.c
index b4ef76f1983..386653518f9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/huffyuv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/huffyuv.c
@@ -1,7 +1,7 @@
/*
* huffyuv codec for libavcodec
*
- * Copyright (c) 2002-2003 Michael Niedermayer <michaelni@gmx.at>
+ * Copyright (c) 2002-2014 Michael Niedermayer <michaelni@gmx.at>
*
* see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
* the algorithm used
@@ -35,13 +35,13 @@
#include "avcodec.h"
#include "huffyuv.h"
-int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table)
+int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int n)
{
int len, index;
uint32_t bits = 0;
for (len = 32; len > 0; len--) {
- for (index = 0; index < 256; index++) {
+ for (index = 0; index < n; index++) {
if (len_table[index] == len)
dst[index] = bits++;
}
@@ -58,16 +58,11 @@ av_cold int ff_huffyuv_alloc_temp(HYuvContext *s)
{
int i;
- if (s->bitstream_bpp<24) {
- for (i=0; i<3; i++) {
- s->temp[i]= av_malloc(s->width + 16);
- if (!s->temp[i])
- return AVERROR(ENOMEM);
- }
- } else {
- s->temp[0]= av_mallocz(4*s->width + 16);
- if (!s->temp[0])
+ for (i=0; i<3; i++) {
+ s->temp[i]= av_malloc(4*s->width + 16);
+ if (!s->temp[i])
return AVERROR(ENOMEM);
+ s->temp16[i] = (uint16_t*)s->temp[i];
}
return 0;
}
@@ -80,6 +75,7 @@ av_cold void ff_huffyuv_common_init(AVCodecContext *avctx)
s->flags = avctx->flags;
ff_dsputil_init(&s->dsp, avctx);
+ ff_llviddsp_init(&s->llviddsp, avctx);
s->width = avctx->width;
s->height = avctx->height;
@@ -93,5 +89,6 @@ av_cold void ff_huffyuv_common_end(HYuvContext *s)
for(i = 0; i < 3; i++) {
av_freep(&s->temp[i]);
+ s->temp16[i] = NULL;
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/huffyuv.h b/chromium/third_party/ffmpeg/libavcodec/huffyuv.h
index e2cacc1ae47..da4e3b5a132 100644
--- a/chromium/third_party/ffmpeg/libavcodec/huffyuv.h
+++ b/chromium/third_party/ffmpeg/libavcodec/huffyuv.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2003 Michael Niedermayer <michaelni@gmx.at>
+ * Copyright (c) 2002-2014 Michael Niedermayer <michaelni@gmx.at>
*
* see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
* the algorithm used
@@ -35,9 +35,14 @@
#include "dsputil.h"
#include "get_bits.h"
#include "put_bits.h"
+#include "lossless_videodsp.h"
#define VLC_BITS 11
+#define MAX_BITS 16
+#define MAX_N (1<<MAX_BITS)
+#define MAX_VLC_N 16384
+
#if HAVE_BIGENDIAN
#define B 3
#define G 2
@@ -67,25 +72,35 @@ typedef struct HYuvContext {
int version;
int yuy2; //use yuy2 instead of 422P
int bgr32; //use bgr32 instead of bgr24
+ int bps;
+ int n; // 1<<bps
+ int vlc_n; // number of vlc codes (FFMIN(1<<bps, MAX_VLC_N))
+ int alpha;
+ int chroma;
+ int yuv;
+ int chroma_h_shift;
+ int chroma_v_shift;
int width, height;
int flags;
int context;
int picture_number;
int last_slice_end;
uint8_t *temp[3];
- uint64_t stats[3][256];
- uint8_t len[3][256];
- uint32_t bits[3][256];
+ uint16_t *temp16[3]; ///< identical to temp but 16bit type
+ uint64_t stats[4][MAX_VLC_N];
+ uint8_t len[4][MAX_VLC_N];
+ uint32_t bits[4][MAX_VLC_N];
uint32_t pix_bgr_map[1<<VLC_BITS];
- VLC vlc[6]; //Y,U,V,YY,YU,YV
+ VLC vlc[8]; //Y,U,V,A,YY,YU,YV,AA
uint8_t *bitstream_buffer;
unsigned int bitstream_buffer_size;
DSPContext dsp;
+ LLVidDSPContext llviddsp;
} HYuvContext;
void ff_huffyuv_common_init(AVCodecContext *s);
void ff_huffyuv_common_end(HYuvContext *s);
int ff_huffyuv_alloc_temp(HYuvContext *s);
-int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table);
+int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int n);
#endif /* AVCODEC_HUFFYUV_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/huffyuvdec.c b/chromium/third_party/ffmpeg/libavcodec/huffyuvdec.c
index 3cfda9b7677..6ab12c475e4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/huffyuvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/huffyuvdec.c
@@ -1,7 +1,7 @@
/*
* huffyuv decoder
*
- * Copyright (c) 2002-2003 Michael Niedermayer <michaelni@gmx.at>
+ * Copyright (c) 2002-2014 Michael Niedermayer <michaelni@gmx.at>
*
* see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
* the algorithm used
@@ -21,6 +21,8 @@
* 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
+ *
+ * yuva, gray, 4:4:4, 4:1:1, 4:1:0 and >8 bit per sample support sponsored by NOA
*/
/**
@@ -32,6 +34,7 @@
#include "get_bits.h"
#include "huffyuv.h"
#include "thread.h"
+#include "libavutil/pixdesc.h"
#define classic_shift_luma_table_size 42
static const unsigned char classic_shift_luma[classic_shift_luma_table_size + FF_INPUT_BUFFER_PADDING_SIZE] = {
@@ -87,16 +90,16 @@ static const unsigned char classic_add_chroma[256] = {
6, 12, 8, 10, 7, 9, 6, 4, 6, 2, 2, 3, 3, 3, 3, 2,
};
-static int read_len_table(uint8_t *dst, GetBitContext *gb)
+static int read_len_table(uint8_t *dst, GetBitContext *gb, int n)
{
int i, val, repeat;
- for (i = 0; i < 256;) {
+ for (i = 0; i < n;) {
repeat = get_bits(gb, 3);
val = get_bits(gb, 5);
if (repeat == 0)
repeat = get_bits(gb, 8);
- if (i + repeat > 256 || get_bits_left(gb) < 0) {
+ if (i + repeat > n || get_bits_left(gb) < 0) {
av_log(NULL, AV_LOG_ERROR, "Error reading huffman table\n");
return -1;
}
@@ -113,28 +116,33 @@ static int generate_joint_tables(HYuvContext *s)
uint8_t len[1 << VLC_BITS];
int ret;
- if (s->bitstream_bpp < 24) {
+ if (s->bitstream_bpp < 24 || s->version > 2) {
int p, i, y, u;
- for (p = 0; p < 3; p++) {
- for (i = y = 0; y < 256; y++) {
- int len0 = s->len[0][y];
+ for (p = 0; p < 4; p++) {
+ int p0 = s->version > 2 ? p : 0;
+ for (i = y = 0; y < s->vlc_n; y++) {
+ int len0 = s->len[p0][y];
int limit = VLC_BITS - len0;
if(limit <= 0 || !len0)
continue;
- for (u = 0; u < 256; u++) {
+ if((sign_extend(y, 8) & (s->vlc_n-1)) != y)
+ continue;
+ for (u = 0; u < s->vlc_n; u++) {
int len1 = s->len[p][u];
if (len1 > limit || !len1)
continue;
+ if((sign_extend(u, 8) & (s->vlc_n-1)) != u)
+ continue;
av_assert0(i < (1 << VLC_BITS));
len[i] = len0 + len1;
- bits[i] = (s->bits[0][y] << len1) + s->bits[p][u];
- symbols[i] = (y << 8) + u;
+ bits[i] = (s->bits[p0][y] << len1) + s->bits[p][u];
+ symbols[i] = (y << 8) + (u & 0xFF);
if(symbols[i] != 0xffff) // reserved to mean "invalid"
i++;
}
}
- ff_free_vlc(&s->vlc[3 + p]);
- if ((ret = ff_init_vlc_sparse(&s->vlc[3 + p], VLC_BITS, i, len, 1, 1,
+ ff_free_vlc(&s->vlc[4 + p]);
+ if ((ret = ff_init_vlc_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 1,
bits, 2, 2, symbols, 2, 2, 0)) < 0)
return ret;
}
@@ -177,8 +185,8 @@ static int generate_joint_tables(HYuvContext *s)
}
}
}
- ff_free_vlc(&s->vlc[3]);
- if ((ret = init_vlc(&s->vlc[3], VLC_BITS, i, len, 1, 1, bits, 2, 2, 0)) < 0)
+ ff_free_vlc(&s->vlc[4]);
+ if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1, bits, 2, 2, 0)) < 0)
return ret;
}
return 0;
@@ -189,17 +197,21 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)
GetBitContext gb;
int i;
int ret;
+ int count = 3;
init_get_bits(&gb, src, length * 8);
- for (i = 0; i < 3; i++) {
- if (read_len_table(s->len[i], &gb) < 0)
+ if (s->version > 2)
+ count = 1 + s->alpha + 2*s->chroma;
+
+ for (i = 0; i < count; i++) {
+ if (read_len_table(s->len[i], &gb, s->vlc_n) < 0)
return -1;
- if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i]) < 0) {
+ if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i], s->vlc_n) < 0) {
return -1;
}
ff_free_vlc(&s->vlc[i]);
- if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
+ if ((ret = init_vlc(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1,
s->bits[i], 4, 4, 0)) < 0)
return ret;
}
@@ -218,12 +230,12 @@ static int read_old_huffman_tables(HYuvContext *s)
init_get_bits(&gb, classic_shift_luma,
classic_shift_luma_table_size * 8);
- if (read_len_table(s->len[0], &gb) < 0)
+ if (read_len_table(s->len[0], &gb, 256) < 0)
return -1;
init_get_bits(&gb, classic_shift_chroma,
classic_shift_chroma_table_size * 8);
- if (read_len_table(s->len[1], &gb) < 0)
+ if (read_len_table(s->len[1], &gb, 256) < 0)
return -1;
for(i=0; i<256; i++) s->bits[0][i] = classic_add_luma [i];
@@ -236,7 +248,7 @@ static int read_old_huffman_tables(HYuvContext *s)
memcpy(s->bits[2], s->bits[1], 256 * sizeof(uint32_t));
memcpy(s->len[2] , s->len [1], 256 * sizeof(uint8_t));
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < 4; i++) {
ff_free_vlc(&s->vlc[i]);
if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
s->bits[i], 4, 4, 0)) < 0)
@@ -253,10 +265,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
{
HYuvContext *s = avctx->priv_data;
- ff_huffyuv_common_init(avctx);
- memset(s->vlc, 0, 3 * sizeof(VLC));
+ memset(s->vlc, 0, 4 * sizeof(VLC));
- s->interlaced = s->height > 288;
+ s->interlaced = avctx->height > 288;
s->bgr32 = 1;
@@ -264,12 +275,18 @@ static av_cold int decode_init(AVCodecContext *avctx)
if ((avctx->bits_per_coded_sample & 7) &&
avctx->bits_per_coded_sample != 12)
s->version = 1; // do such files exist at all?
- else
+ else if (avctx->extradata_size > 3 && avctx->extradata[3] == 0)
s->version = 2;
+ else
+ s->version = 3;
} else
s->version = 0;
- if (s->version == 2) {
+ s->bps = 8;
+ s->n = 1<<s->bps;
+ s->vlc_n = FFMIN(s->n, MAX_VLC_N);
+ s->chroma = 1;
+ if (s->version >= 2) {
int method, interlace;
if (avctx->extradata_size < 4)
@@ -278,9 +295,20 @@ static av_cold int decode_init(AVCodecContext *avctx)
method = ((uint8_t*)avctx->extradata)[0];
s->decorrelate = method & 64 ? 1 : 0;
s->predictor = method & 63;
- s->bitstream_bpp = ((uint8_t*)avctx->extradata)[1];
- if (s->bitstream_bpp == 0)
- s->bitstream_bpp = avctx->bits_per_coded_sample & ~7;
+ if (s->version == 2) {
+ s->bitstream_bpp = ((uint8_t*)avctx->extradata)[1];
+ if (s->bitstream_bpp == 0)
+ s->bitstream_bpp = avctx->bits_per_coded_sample & ~7;
+ } else {
+ s->bps = (avctx->extradata[1] >> 4) + 1;
+ s->n = 1<<s->bps;
+ s->vlc_n = FFMIN(s->n, MAX_VLC_N);
+ s->chroma_h_shift = avctx->extradata[1] & 3;
+ s->chroma_v_shift = (avctx->extradata[1] >> 2) & 3;
+ s->yuv = !!(((uint8_t*)avctx->extradata)[2] & 1);
+ s->chroma= !!(((uint8_t*)avctx->extradata)[2] & 3);
+ s->alpha = !!(((uint8_t*)avctx->extradata)[2] & 4);
+ }
interlace = (((uint8_t*)avctx->extradata)[2] & 0x30) >> 4;
s->interlaced = (interlace == 1) ? 1 : (interlace == 2) ? 0 : s->interlaced;
s->context = ((uint8_t*)avctx->extradata)[2] & 0x40 ? 1 : 0;
@@ -318,29 +346,176 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- switch (s->bitstream_bpp) {
- case 12:
- avctx->pix_fmt = AV_PIX_FMT_YUV420P;
- break;
- case 16:
- if (s->yuy2) {
- avctx->pix_fmt = AV_PIX_FMT_YUYV422;
- } else {
- avctx->pix_fmt = AV_PIX_FMT_YUV422P;
- }
- break;
- case 24:
- case 32:
- if (s->bgr32) {
+ if (s->version <= 2) {
+ switch (s->bitstream_bpp) {
+ case 12:
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P;
+ s->yuv = 1;
+ break;
+ case 16:
+ if (s->yuy2) {
+ avctx->pix_fmt = AV_PIX_FMT_YUYV422;
+ } else {
+ avctx->pix_fmt = AV_PIX_FMT_YUV422P;
+ }
+ s->yuv = 1;
+ break;
+ case 24:
+ if (s->bgr32) {
+ avctx->pix_fmt = AV_PIX_FMT_0RGB32;
+ } else {
+ avctx->pix_fmt = AV_PIX_FMT_BGR24;
+ }
+ break;
+ case 32:
+ av_assert0(s->bgr32);
avctx->pix_fmt = AV_PIX_FMT_RGB32;
- } else {
- avctx->pix_fmt = AV_PIX_FMT_BGR24;
+ s->alpha = 1;
+ break;
+ default:
+ return AVERROR_INVALIDDATA;
+ }
+ av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt,
+ &s->chroma_h_shift,
+ &s->chroma_v_shift);
+ } else {
+ switch ( (s->chroma<<10) | (s->yuv<<9) | (s->alpha<<8) | ((s->bps-1)<<4) | s->chroma_h_shift | (s->chroma_v_shift<<2)) {
+ case 0x070:
+ avctx->pix_fmt = AV_PIX_FMT_GRAY8;
+ break;
+ case 0x0F0:
+ avctx->pix_fmt = AV_PIX_FMT_GRAY16;
+ break;
+ case 0x170:
+ avctx->pix_fmt = AV_PIX_FMT_GRAY8A;
+ break;
+ case 0x470:
+ avctx->pix_fmt = AV_PIX_FMT_GBRP;
+ break;
+ case 0x480:
+ avctx->pix_fmt = AV_PIX_FMT_GBRP9;
+ break;
+ case 0x490:
+ avctx->pix_fmt = AV_PIX_FMT_GBRP10;
+ break;
+ case 0x4B0:
+ avctx->pix_fmt = AV_PIX_FMT_GBRP12;
+ break;
+ case 0x4D0:
+ avctx->pix_fmt = AV_PIX_FMT_GBRP14;
+ break;
+ case 0x4F0:
+ avctx->pix_fmt = AV_PIX_FMT_GBRP16;
+ break;
+ case 0x570:
+ avctx->pix_fmt = AV_PIX_FMT_GBRAP;
+ break;
+ case 0x670:
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P;
+ break;
+ case 0x680:
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P9;
+ break;
+ case 0x690:
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
+ break;
+ case 0x6B0:
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P12;
+ break;
+ case 0x6D0:
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P14;
+ break;
+ case 0x6F0:
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P16;
+ break;
+ case 0x671:
+ avctx->pix_fmt = AV_PIX_FMT_YUV422P;
+ break;
+ case 0x681:
+ avctx->pix_fmt = AV_PIX_FMT_YUV422P9;
+ break;
+ case 0x691:
+ avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
+ break;
+ case 0x6B1:
+ avctx->pix_fmt = AV_PIX_FMT_YUV422P12;
+ break;
+ case 0x6D1:
+ avctx->pix_fmt = AV_PIX_FMT_YUV422P14;
+ break;
+ case 0x6F1:
+ avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
+ break;
+ case 0x672:
+ avctx->pix_fmt = AV_PIX_FMT_YUV411P;
+ break;
+ case 0x674:
+ avctx->pix_fmt = AV_PIX_FMT_YUV440P;
+ break;
+ case 0x675:
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P;
+ break;
+ case 0x685:
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P9;
+ break;
+ case 0x695:
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
+ break;
+ case 0x6B5:
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P12;
+ break;
+ case 0x6D5:
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P14;
+ break;
+ case 0x6F5:
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
+ break;
+ case 0x67A:
+ avctx->pix_fmt = AV_PIX_FMT_YUV410P;
+ break;
+ case 0x770:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
+ break;
+ case 0x780:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA444P9;
+ break;
+ case 0x790:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA444P10;
+ break;
+ case 0x7F0:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA444P16;
+ break;
+ case 0x771:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA422P;
+ break;
+ case 0x781:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA422P9;
+ break;
+ case 0x791:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA422P10;
+ break;
+ case 0x7F1:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA422P16;
+ break;
+ case 0x775:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA420P;
+ break;
+ case 0x785:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA420P9;
+ break;
+ case 0x795:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA420P10;
+ break;
+ case 0x7F5:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA420P16;
+ break;
+ default:
+ return AVERROR_INVALIDDATA;
}
- break;
- default:
- return AVERROR_INVALIDDATA;
}
+ ff_huffyuv_common_init(avctx);
+
if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P || avctx->pix_fmt == AV_PIX_FMT_YUV420P) && avctx->width & 1) {
av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n");
return AVERROR_INVALIDDATA;
@@ -367,10 +542,10 @@ static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
return AVERROR(ENOMEM);
}
- for (i = 0; i < 6; i++)
+ for (i = 0; i < 8; i++)
s->vlc[i].table = NULL;
- if (s->version == 2) {
+ if (s->version >= 2) {
if (read_huffman_tables(s, ((uint8_t*)avctx->extradata) + 4,
avctx->extradata_size) < 0)
return AVERROR_INVALIDDATA;
@@ -385,7 +560,7 @@ static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
/* TODO instead of restarting the read when the code isn't in the first level
* of the joint table, jump into the 2nd level of the individual table. */
#define READ_2PIX(dst0, dst1, plane1){\
- uint16_t code = get_vlc2(&s->gb, s->vlc[3+plane1].table, VLC_BITS, 1);\
+ uint16_t code = get_vlc2(&s->gb, s->vlc[4+plane1].table, VLC_BITS, 1);\
if(code != 0xffff){\
dst0 = code>>8;\
dst1 = code;\
@@ -406,6 +581,9 @@ static void decode_422_bitstream(HYuvContext *s, int count)
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);
}
+ for (; i < count; i++)
+ s->temp[0][2 * i ] = s->temp[1][i] =
+ s->temp[0][2 * i + 1] = s->temp[2][i] = 128;
} else {
for (i = 0; i < count; i++) {
READ_2PIX(s->temp[0][2 * i ], s->temp[1][i], 1);
@@ -414,6 +592,72 @@ static void decode_422_bitstream(HYuvContext *s, int count)
}
}
+#define READ_2PIX_PLANE(dst0, dst1, plane){\
+ uint16_t code = get_vlc2(&s->gb, s->vlc[4+plane].table, VLC_BITS, 1);\
+ if(code != 0xffff){\
+ dst0 = code>>8;\
+ dst1 = code;\
+ }else{\
+ dst0 = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3);\
+ dst1 = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3);\
+ }\
+}
+#define READ_2PIX_PLANE14(dst0, dst1, plane){\
+ int16_t code = get_vlc2(&s->gb, s->vlc[4+plane].table, VLC_BITS, 1);\
+ if(code != (int16_t)0xffff){\
+ dst0 = code>>8;\
+ dst1 = sign_extend(code, 8);\
+ }else{\
+ dst0 = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3);\
+ dst1 = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3);\
+ }\
+}
+
+#define READ_2PIX_PLANE16(dst0, dst1, plane){\
+ dst0 = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3)<<2;\
+ dst0 += get_bits(&s->gb, 2);\
+ dst1 = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3)<<2;\
+ dst1 += get_bits(&s->gb, 2);\
+}
+static void decode_plane_bitstream(HYuvContext *s, int count, int plane)
+{
+ int i;
+
+ count/=2;
+
+ if (s->bps <= 8) {
+ if (count >= (get_bits_left(&s->gb)) / (31 * 2)) {
+ for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
+ READ_2PIX_PLANE(s->temp[0][2 * i], s->temp[0][2 * i + 1], plane);
+ }
+ } else {
+ for(i=0; i<count; i++){
+ READ_2PIX_PLANE(s->temp[0][2 * i], s->temp[0][2 * i + 1], plane);
+ }
+ }
+ } else if (s->bps <= 14) {
+ if (count >= (get_bits_left(&s->gb)) / (31 * 2)) {
+ for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
+ READ_2PIX_PLANE14(s->temp16[0][2 * i], s->temp16[0][2 * i + 1], plane);
+ }
+ } else {
+ for(i=0; i<count; i++){
+ READ_2PIX_PLANE14(s->temp16[0][2 * i], s->temp16[0][2 * i + 1], plane);
+ }
+ }
+ } else {
+ if (count >= (get_bits_left(&s->gb)) / (31 * 2)) {
+ for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
+ READ_2PIX_PLANE16(s->temp16[0][2 * i], s->temp16[0][2 * i + 1], plane);
+ }
+ } else {
+ for(i=0; i<count; i++){
+ READ_2PIX_PLANE16(s->temp16[0][2 * i], s->temp16[0][2 * i + 1], plane);
+ }
+ }
+ }
+}
+
static void decode_gray_bitstream(HYuvContext *s, int count)
{
int i;
@@ -436,7 +680,7 @@ static av_always_inline void decode_bgr_1(HYuvContext *s, int count,
{
int i;
for (i = 0; i < count; i++) {
- int code = get_vlc2(&s->gb, s->vlc[3].table, VLC_BITS, 1);
+ int code = get_vlc2(&s->gb, s->vlc[4].table, VLC_BITS, 1);
if (code != -1) {
*(uint32_t*)&s->temp[0][4 * i] = s->pix_bgr_map[code];
} else if(decorrelate) {
@@ -499,6 +743,32 @@ static void draw_slice(HYuvContext *s, AVFrame *frame, int y)
s->last_slice_end = y + h;
}
+static int left_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *src, int w, int acc)
+{
+ if (s->bps <= 8) {
+ return s->dsp.add_hfyu_left_prediction(dst, src, w, acc);
+ } else {
+ return s->llviddsp.add_hfyu_left_prediction_int16(( uint16_t *)dst, (const uint16_t *)src, s->n-1, w, acc);
+ }
+}
+
+static void add_bytes(HYuvContext *s, uint8_t *dst, uint8_t *src, int w)
+{
+ if (s->bps <= 8) {
+ s->dsp.add_bytes(dst, src, w);
+ } else {
+ s->llviddsp.add_int16((uint16_t*)dst, (const uint16_t*)src, s->n - 1, w);
+ }
+}
+
+static void add_median_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *src, const uint8_t *diff, int w, int *left, int *left_top)
+{
+ if (s->bps <= 8) {
+ s->dsp.add_hfyu_median_prediction(dst, src, diff, w, left, left_top);
+ } else {
+ s->llviddsp.add_hfyu_median_prediction_int16((uint16_t *)dst, (const uint16_t *)src, (const uint16_t *)diff, s->n-1, w, left, left_top);
+ }
+}
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
@@ -543,7 +813,72 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s->last_slice_end = 0;
- if (s->bitstream_bpp < 24) {
+ if (s->version > 2) {
+ int plane;
+ for(plane = 0; plane < 1 + 2*s->chroma + s->alpha; plane++) {
+ int left, lefttop, y;
+ int w = width;
+ int h = height;
+ int fake_stride = fake_ystride;
+
+ if (s->chroma && (plane == 1 || plane == 2)) {
+ w >>= s->chroma_h_shift;
+ h >>= s->chroma_v_shift;
+ fake_stride = plane == 1 ? fake_ustride : fake_vstride;
+ }
+
+ switch (s->predictor) {
+ case LEFT:
+ case PLANE:
+ decode_plane_bitstream(s, w, plane);
+ left = left_prediction(s, p->data[plane], s->temp[0], w, 0);
+
+ for (y = 1; y < h; y++) {
+ uint8_t *dst = p->data[plane] + p->linesize[plane]*y;
+
+ decode_plane_bitstream(s, w, plane);
+ left = left_prediction(s, dst, s->temp[0], w, left);
+ if (s->predictor == PLANE) {
+ if (y > s->interlaced) {
+ add_bytes(s, dst, dst - fake_stride, w);
+ }
+ }
+ }
+
+ break;
+ case MEDIAN:
+ decode_plane_bitstream(s, w, plane);
+ left= left_prediction(s, p->data[plane], s->temp[0], w, 0);
+
+ y = 1;
+
+ /* second line is left predicted for interlaced case */
+ if (s->interlaced) {
+ decode_plane_bitstream(s, w, plane);
+ left = left_prediction(s, p->data[plane] + p->linesize[plane], s->temp[0], w, left);
+ y++;
+ }
+
+ lefttop = p->data[plane][0];
+ decode_plane_bitstream(s, w, plane);
+ add_median_prediction(s, p->data[plane] + fake_stride, p->data[plane], s->temp[0], w, &left, &lefttop);
+ y++;
+
+ for (; y<h; y++) {
+ uint8_t *dst;
+
+ decode_plane_bitstream(s, w, plane);
+
+ dst = p->data[plane] + p->linesize[plane] * y;
+
+ add_median_prediction(s, dst, dst - fake_stride, s->temp[0], w, &left, &lefttop);
+ }
+
+ break;
+ }
+ }
+ draw_slice(s, p, height);
+ } else if (s->bitstream_bpp < 24) {
int y, cy;
int lefty, leftu, leftv;
int lefttopy, lefttopu, lefttopv;
@@ -756,14 +1091,13 @@ static av_cold int decode_end(AVCodecContext *avctx)
ff_huffyuv_common_end(s);
av_freep(&s->bitstream_buffer);
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < 8; i++) {
ff_free_vlc(&s->vlc[i]);
}
return 0;
}
-#if CONFIG_HUFFYUV_DECODER
AVCodec ff_huffyuv_decoder = {
.name = "huffyuv",
.long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"),
@@ -777,7 +1111,6 @@ AVCodec ff_huffyuv_decoder = {
CODEC_CAP_FRAME_THREADS,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
};
-#endif
#if CONFIG_FFVHUFF_DECODER
AVCodec ff_ffvhuff_decoder = {
diff --git a/chromium/third_party/ffmpeg/libavcodec/huffyuvenc.c b/chromium/third_party/ffmpeg/libavcodec/huffyuvenc.c
index 3a55d543a9a..4a001b922c7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/huffyuvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/huffyuvenc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2003 Michael Niedermayer <michaelni@gmx.at>
+ * Copyright (c) 2002-2014 Michael Niedermayer <michaelni@gmx.at>
*
* see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
* the algorithm used
@@ -19,6 +19,8 @@
* 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
+ *
+ * yuva, gray, 4:4:4, 4:1:1, 4:1:0 and >8 bit per sample support sponsored by NOA
*/
/**
@@ -31,26 +33,58 @@
#include "huffman.h"
#include "internal.h"
#include "put_bits.h"
+#include "libavutil/pixdesc.h"
+
+static inline void diff_bytes(HYuvContext *s, uint8_t *dst,
+ const uint8_t *src0, const uint8_t *src1, int w)
+{
+ if (s->bps <= 8) {
+ s->dsp.diff_bytes(dst, src0, src1, w);
+ } else {
+ s->llviddsp.diff_int16((uint16_t *)dst, (const uint16_t *)src0, (const uint16_t *)src1, s->n - 1, w);
+ }
+}
static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst,
const uint8_t *src, int w, int left)
{
int i;
- if (w < 32) {
- for (i = 0; i < w; i++) {
- const int temp = src[i];
- dst[i] = temp - left;
- left = temp;
+ if (s->bps <= 8) {
+ if (w < 32) {
+ for (i = 0; i < w; i++) {
+ const int temp = src[i];
+ dst[i] = temp - left;
+ left = temp;
+ }
+ return left;
+ } else {
+ for (i = 0; i < 16; i++) {
+ const int temp = src[i];
+ dst[i] = temp - left;
+ left = temp;
+ }
+ s->dsp.diff_bytes(dst + 16, src + 16, src + 15, w - 16);
+ return src[w-1];
}
- return left;
} else {
- for (i = 0; i < 16; i++) {
- const int temp = src[i];
- dst[i] = temp - left;
- left = temp;
+ const uint16_t *src16 = (const uint16_t *)src;
+ uint16_t *dst16 = ( uint16_t *)dst;
+ if (w < 32) {
+ for (i = 0; i < w; i++) {
+ const int temp = src16[i];
+ dst16[i] = temp - left;
+ left = temp;
+ }
+ return left;
+ } else {
+ for (i = 0; i < 16; i++) {
+ const int temp = src16[i];
+ dst16[i] = temp - left;
+ left = temp;
+ }
+ s->llviddsp.diff_int16(dst16 + 16, src16 + 16, src16 + 15, s->n - 1, w - 16);
+ return src16[w-1];
}
- s->dsp.diff_bytes(dst + 16, src + 16, src + 15, w - 16);
- return src[w-1];
}
}
@@ -117,19 +151,29 @@ static inline void sub_left_prediction_rgb24(HYuvContext *s, uint8_t *dst,
*blue = src[(w - 1) * 3 + 2];
}
+static void sub_median_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top)
+{
+ if (s->bps <= 8) {
+ s->dsp.sub_hfyu_median_prediction(dst, src1, src2, w , left, left_top);
+ } else {
+ s->llviddsp.sub_hfyu_median_prediction_int16((uint16_t *)dst, (const uint16_t *)src1, (const uint16_t *)src2, s->n - 1, w , left, left_top);
+ }
+}
+
static int store_table(HYuvContext *s, const uint8_t *len, uint8_t *buf)
{
int i;
int index = 0;
+ int n = s->vlc_n;
- for (i = 0; i < 256;) {
+ for (i = 0; i < n;) {
int val = len[i];
int repeat = 0;
- for (; i < 256 && len[i] == val && repeat < 255; i++)
+ for (; i < n && len[i] == val && repeat < 255; i++)
repeat++;
- av_assert0(val < 32 && val >0 && repeat<256 && repeat>0);
+ av_assert0(val < 32 && val >0 && repeat < 256 && repeat>0);
if (repeat > 7) {
buf[index++] = val;
buf[index++] = repeat;
@@ -141,18 +185,45 @@ static int store_table(HYuvContext *s, const uint8_t *len, uint8_t *buf)
return index;
}
+static int store_huffman_tables(HYuvContext *s, uint8_t *buf)
+{
+ int i, ret;
+ int size = 0;
+ int count = 3;
+
+ if (s->version > 2)
+ count = 1 + s->alpha + 2*s->chroma;
+
+ for (i = 0; i < count; i++) {
+ if ((ret = ff_huff_gen_len_table(s->len[i], s->stats[i], s->vlc_n)) < 0)
+ return ret;
+
+ if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i], s->vlc_n) < 0) {
+ return -1;
+ }
+
+ size += store_table(s, s->len[i], buf + size);
+ }
+ return size;
+}
+
static av_cold int encode_init(AVCodecContext *avctx)
{
HYuvContext *s = avctx->priv_data;
int i, j;
+ int ret;
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
ff_huffyuv_common_init(avctx);
- avctx->extradata = av_mallocz(1024*30); // 256*3+4 == 772
- avctx->stats_out = av_mallocz(1024*30); // 21*256*3(%llu ) + 3(\n) + 1(0) = 16132
- if (!avctx->extradata || !avctx->stats_out) {
- av_freep(&avctx->stats_out);
+ avctx->extradata = av_mallocz(3*MAX_N + 4);
+ if (!avctx->extradata)
return AVERROR(ENOMEM);
+ if (s->flags&CODEC_FLAG_PASS1) {
+#define STATS_OUT_SIZE 21*MAX_N*3 + 4
+ avctx->stats_out = av_mallocz(STATS_OUT_SIZE); // 21*256*3(%llu ) + 3(\n) + 1(0) = 16132
+ if (!avctx->stats_out)
+ return AVERROR(ENOMEM);
}
s->version = 2;
@@ -163,6 +234,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+ s->bps = desc->comp[0].depth_minus1 + 1;
+ s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2;
+ s->chroma = desc->nb_components > 2;
+ s->alpha = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
+ av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt,
+ &s->chroma_h_shift,
+ &s->chroma_v_shift);
+
switch (avctx->pix_fmt) {
case AV_PIX_FMT_YUV420P:
case AV_PIX_FMT_YUV422P:
@@ -172,6 +251,49 @@ static av_cold int encode_init(AVCodecContext *avctx)
}
s->bitstream_bpp = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? 12 : 16;
break;
+ case AV_PIX_FMT_YUV444P:
+ case AV_PIX_FMT_YUV410P:
+ case AV_PIX_FMT_YUV411P:
+ case AV_PIX_FMT_YUV440P:
+ case AV_PIX_FMT_GBRP:
+ case AV_PIX_FMT_GBRP9:
+ case AV_PIX_FMT_GBRP10:
+ case AV_PIX_FMT_GBRP12:
+ case AV_PIX_FMT_GBRP14:
+ case AV_PIX_FMT_GBRP16:
+ case AV_PIX_FMT_GRAY8:
+ case AV_PIX_FMT_GRAY16:
+ case AV_PIX_FMT_YUVA444P:
+ case AV_PIX_FMT_YUVA420P:
+ case AV_PIX_FMT_YUVA422P:
+ case AV_PIX_FMT_GBRAP:
+ case AV_PIX_FMT_GRAY8A:
+ case AV_PIX_FMT_YUV420P9:
+ case AV_PIX_FMT_YUV420P10:
+ case AV_PIX_FMT_YUV420P12:
+ case AV_PIX_FMT_YUV420P14:
+ case AV_PIX_FMT_YUV420P16:
+ case AV_PIX_FMT_YUV422P9:
+ case AV_PIX_FMT_YUV422P10:
+ case AV_PIX_FMT_YUV422P12:
+ case AV_PIX_FMT_YUV422P14:
+ case AV_PIX_FMT_YUV422P16:
+ case AV_PIX_FMT_YUV444P9:
+ case AV_PIX_FMT_YUV444P10:
+ case AV_PIX_FMT_YUV444P12:
+ case AV_PIX_FMT_YUV444P14:
+ case AV_PIX_FMT_YUV444P16:
+ case AV_PIX_FMT_YUVA420P9:
+ case AV_PIX_FMT_YUVA420P10:
+ case AV_PIX_FMT_YUVA420P16:
+ case AV_PIX_FMT_YUVA422P9:
+ case AV_PIX_FMT_YUVA422P10:
+ case AV_PIX_FMT_YUVA422P16:
+ case AV_PIX_FMT_YUVA444P9:
+ case AV_PIX_FMT_YUVA444P10:
+ case AV_PIX_FMT_YUVA444P16:
+ s->version = 3;
+ break;
case AV_PIX_FMT_RGB32:
s->bitstream_bpp = 32;
break;
@@ -182,8 +304,11 @@ static av_cold int encode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "format not supported\n");
return AVERROR(EINVAL);
}
+ s->n = 1<<s->bps;
+ s->vlc_n = FFMIN(s->n, MAX_VLC_N);
+
avctx->bits_per_coded_sample = s->bitstream_bpp;
- s->decorrelate = s->bitstream_bpp >= 24;
+ s->decorrelate = s->bitstream_bpp >= 24 && !s->yuv && !(desc->flags & AV_PIX_FMT_FLAG_PLANAR);
s->predictor = avctx->prediction_method;
s->interlaced = avctx->flags&CODEC_FLAG_INTERLACED_ME ? 1 : 0;
if (avctx->context_model == 1) {
@@ -209,37 +334,58 @@ static av_cold int encode_init(AVCodecContext *avctx)
"by huffyuv; use vcodec=ffvhuff\n");
return AVERROR(EINVAL);
}
+ if (s->version > 2) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Error: ver>2 is not supported "
+ "by huffyuv; use vcodec=ffvhuff\n");
+ return AVERROR(EINVAL);
+ }
if (s->interlaced != ( s->height > 288 ))
av_log(avctx, AV_LOG_INFO,
"using huffyuv 2.2.0 or newer interlacing flag\n");
}
- if (s->bitstream_bpp >= 24 && s->predictor == MEDIAN) {
+ if (s->version > 3 && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
+ av_log(avctx, AV_LOG_ERROR, "Ver > 3 is under development, files encoded with it may not be decodable with future versions!!!\n"
+ "Use vstrict=-2 / -strict -2 to use it anyway.\n");
+ return AVERROR(EINVAL);
+ }
+
+ if (s->bitstream_bpp >= 24 && s->predictor == MEDIAN && s->version <= 2) {
av_log(avctx, AV_LOG_ERROR,
"Error: RGB is incompatible with median predictor\n");
return AVERROR(EINVAL);
}
((uint8_t*)avctx->extradata)[0] = s->predictor | (s->decorrelate << 6);
- ((uint8_t*)avctx->extradata)[1] = s->bitstream_bpp;
((uint8_t*)avctx->extradata)[2] = s->interlaced ? 0x10 : 0x20;
if (s->context)
((uint8_t*)avctx->extradata)[2] |= 0x40;
- ((uint8_t*)avctx->extradata)[3] = 0;
+ if (s->version < 3) {
+ ((uint8_t*)avctx->extradata)[1] = s->bitstream_bpp;
+ ((uint8_t*)avctx->extradata)[3] = 0;
+ } else {
+ ((uint8_t*)avctx->extradata)[1] = ((s->bps-1)<<4) | s->chroma_h_shift | (s->chroma_v_shift<<2);
+ if (s->chroma)
+ ((uint8_t*)avctx->extradata)[2] |= s->yuv ? 1 : 2;
+ if (s->alpha)
+ ((uint8_t*)avctx->extradata)[2] |= 4;
+ ((uint8_t*)avctx->extradata)[3] = 1;
+ }
s->avctx->extradata_size = 4;
if (avctx->stats_in) {
char *p = avctx->stats_in;
- for (i = 0; i < 3; i++)
- for (j = 0; j < 256; j++)
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < s->vlc_n; j++)
s->stats[i][j] = 1;
for (;;) {
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < 4; i++) {
char *next;
- for (j = 0; j < 256; j++) {
+ for (j = 0; j < s->vlc_n; j++) {
s->stats[i][j] += strtol(p, &next, 0);
if (next == p) return -1;
p = next;
@@ -248,36 +394,30 @@ static av_cold int encode_init(AVCodecContext *avctx)
if (p[0] == 0 || p[1] == 0 || p[2] == 0) break;
}
} else {
- for (i = 0; i < 3; i++)
- for (j = 0; j < 256; j++) {
- int d = FFMIN(j, 256 - j);
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < s->vlc_n; j++) {
+ int d = FFMIN(j, s->vlc_n - j);
s->stats[i][j] = 100000000 / (d + 1);
}
}
- for (i = 0; i < 3; i++) {
- ff_huff_gen_len_table(s->len[i], s->stats[i]);
-
- if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i]) < 0) {
- return -1;
- }
-
- s->avctx->extradata_size +=
- store_table(s, s->len[i], &((uint8_t*)s->avctx->extradata)[s->avctx->extradata_size]);
- }
+ ret = store_huffman_tables(s, s->avctx->extradata + s->avctx->extradata_size);
+ if (ret < 0)
+ return ret;
+ s->avctx->extradata_size += ret;
if (s->context) {
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < 4; i++) {
int pels = s->width * s->height / (i ? 40 : 10);
- for (j = 0; j < 256; j++) {
- int d = FFMIN(j, 256 - j);
+ for (j = 0; j < s->vlc_n; j++) {
+ int d = FFMIN(j, s->vlc_n - j);
s->stats[i][j] = pels/(d + 1);
}
}
} else {
- for (i = 0; i < 3; i++)
- for (j = 0; j < 256; j++)
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < s->vlc_n; j++)
s->stats[i][j]= 0;
}
@@ -345,6 +485,115 @@ static int encode_422_bitstream(HYuvContext *s, int offset, int count)
return 0;
}
+static int encode_plane_bitstream(HYuvContext *s, int count, int plane)
+{
+ int i;
+
+ if (s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb) >> 3) < count * s->bps / 2) {
+ av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
+ return -1;
+ }
+
+#define LOAD2\
+ int y0 = s->temp[0][2 * i];\
+ int y1 = s->temp[0][2 * i + 1];
+#define LOAD2_14\
+ int y0 = s->temp16[0][2 * i] & mask;\
+ int y1 = s->temp16[0][2 * i + 1] & mask;
+#define LOAD2_16\
+ int y0 = s->temp16[0][2 * i];\
+ int y1 = s->temp16[0][2 * i + 1];
+#define STAT2\
+ s->stats[plane][y0]++;\
+ s->stats[plane][y1]++;
+#define STAT2_16\
+ s->stats[plane][y0>>2]++;\
+ s->stats[plane][y1>>2]++;
+#define WRITE2\
+ put_bits(&s->pb, s->len[plane][y0], s->bits[plane][y0]);\
+ put_bits(&s->pb, s->len[plane][y1], s->bits[plane][y1]);
+#define WRITE2_16\
+ put_bits(&s->pb, s->len[plane][y0>>2], s->bits[plane][y0>>2]);\
+ put_bits(&s->pb, 2, y0&3);\
+ put_bits(&s->pb, s->len[plane][y1>>2], s->bits[plane][y1>>2]);\
+ put_bits(&s->pb, 2, y1&3);
+
+ count /= 2;
+
+ if (s->bps <= 8) {
+ if (s->flags & CODEC_FLAG_PASS1) {
+ for (i = 0; i < count; i++) {
+ LOAD2;
+ STAT2;
+ }
+ }
+ if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)
+ return 0;
+
+ if (s->context) {
+ for (i = 0; i < count; i++) {
+ LOAD2;
+ STAT2;
+ WRITE2;
+ }
+ } else {
+ for (i = 0; i < count; i++) {
+ LOAD2;
+ WRITE2;
+ }
+ }
+ } else if (s->bps <= 14) {
+ int mask = s->n - 1;
+ if (s->flags & CODEC_FLAG_PASS1) {
+ for (i = 0; i < count; i++) {
+ LOAD2_14;
+ STAT2;
+ }
+ }
+ if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)
+ return 0;
+
+ if (s->context) {
+ for (i = 0; i < count; i++) {
+ LOAD2_14;
+ STAT2;
+ WRITE2;
+ }
+ } else {
+ for (i = 0; i < count; i++) {
+ LOAD2_14;
+ WRITE2;
+ }
+ }
+ } else {
+ if (s->flags & CODEC_FLAG_PASS1) {
+ for (i = 0; i < count; i++) {
+ LOAD2_16;
+ STAT2_16;
+ }
+ }
+ if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)
+ return 0;
+
+ if (s->context) {
+ for (i = 0; i < count; i++) {
+ LOAD2_16;
+ STAT2_16;
+ WRITE2_16;
+ }
+ } else {
+ for (i = 0; i < count; i++) {
+ LOAD2_16;
+ WRITE2_16;
+ }
+ }
+ }
+#undef LOAD2
+#undef STAT2
+#undef WRITE2
+ return 0;
+}
+
static int encode_gray_bitstream(HYuvContext *s, int count)
{
int i;
@@ -458,15 +707,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return ret;
if (s->context) {
- for (i = 0; i < 3; i++) {
- ff_huff_gen_len_table(s->len[i], s->stats[i]);
- if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i]) < 0)
- return -1;
- size += store_table(s, s->len[i], &pkt->data[size]);
- }
+ size = store_huffman_tables(s, pkt->data);
+ if (size < 0)
+ return size;
- for (i = 0; i < 3; i++)
- for (j = 0; j < 256; j++)
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < s->vlc_n; j++)
s->stats[i][j] >>= 1;
}
@@ -634,6 +880,59 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
encode_bgra_bitstream(s, width, 3);
}
+ } else if (s->version > 2) {
+ int plane;
+ for (plane = 0; plane < 1 + 2*s->chroma + s->alpha; plane++) {
+ int left, y;
+ int w = width;
+ int h = height;
+ int fake_stride = fake_ystride;
+
+ if (s->chroma && (plane == 1 || plane == 2)) {
+ w >>= s->chroma_h_shift;
+ h >>= s->chroma_v_shift;
+ fake_stride = plane == 1 ? fake_ustride : fake_vstride;
+ }
+
+ left = sub_left_prediction(s, s->temp[0], p->data[plane], w , 0);
+
+ encode_plane_bitstream(s, w, plane);
+
+ if (s->predictor==MEDIAN) {
+ int lefttop;
+ y = 1;
+ if (s->interlaced) {
+ left = sub_left_prediction(s, s->temp[0], p->data[plane] + p->linesize[plane], w , left);
+
+ encode_plane_bitstream(s, w, plane);
+ y++;
+ }
+
+ lefttop = p->data[plane][0];
+
+ for (; y < h; y++) {
+ uint8_t *dst = p->data[plane] + p->linesize[plane] * y;
+
+ sub_median_prediction(s, s->temp[0], dst - fake_stride, dst, w , &left, &lefttop);
+
+ encode_plane_bitstream(s, w, plane);
+ }
+ } else {
+ for (y = 1; y < h; y++) {
+ uint8_t *dst = p->data[plane] + p->linesize[plane] * y;
+
+ if (s->predictor == PLANE && s->interlaced < y) {
+ diff_bytes(s, s->temp[1], dst, dst - fake_stride, w);
+
+ left = sub_left_prediction(s, s->temp[0], s->temp[1], w , left);
+ } else {
+ left = sub_left_prediction(s, s->temp[0], dst, w , left);
+ }
+
+ encode_plane_bitstream(s, w, plane);
+ }
+ }
+ }
} else {
av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
}
@@ -647,17 +946,19 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if ((s->flags&CODEC_FLAG_PASS1) && (s->picture_number & 31) == 0) {
int j;
char *p = avctx->stats_out;
- char *end = p + 1024*30;
- for (i = 0; i < 3; i++) {
- for (j = 0; j < 256; j++) {
+ char *end = p + STATS_OUT_SIZE;
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < s->vlc_n; j++) {
snprintf(p, end-p, "%"PRIu64" ", s->stats[i][j]);
p += strlen(p);
s->stats[i][j]= 0;
}
snprintf(p, end-p, "\n");
p++;
+ if (end <= p)
+ return AVERROR(ENOMEM);
}
- } else
+ } else if (avctx->stats_out)
avctx->stats_out[0] = '\0';
if (!(s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)) {
flush_put_bits(&s->pb);
@@ -687,7 +988,6 @@ static av_cold int encode_end(AVCodecContext *avctx)
return 0;
}
-#if CONFIG_HUFFYUV_ENCODER
AVCodec ff_huffyuv_encoder = {
.name = "huffyuv",
.long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"),
@@ -697,12 +997,12 @@ AVCodec ff_huffyuv_encoder = {
.init = encode_init,
.encode2 = encode_frame,
.close = encode_end,
+ .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24,
AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
},
};
-#endif
#if CONFIG_FFVHUFF_ENCODER
AVCodec ff_ffvhuff_encoder = {
@@ -714,8 +1014,23 @@ AVCodec ff_ffvhuff_encoder = {
.init = encode_init,
.encode2 = encode_frame,
.close = encode_end,
+ .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum AVPixelFormat[]){
- AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV411P,
+ AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
+ AV_PIX_FMT_GBRP,
+ AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14,
+ AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
+ AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
+ AV_PIX_FMT_GBRAP,
+ AV_PIX_FMT_GRAY8A,
+ AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV420P16,
+ AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV422P16,
+ AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14, AV_PIX_FMT_YUV444P16,
+ AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA420P16,
+ AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA422P16,
+ AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA444P16,
+ AV_PIX_FMT_RGB24,
AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
},
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/iff.c b/chromium/third_party/ffmpeg/libavcodec/iff.c
index e71f5b00b96..f08a0f70cef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/iff.c
+++ b/chromium/third_party/ffmpeg/libavcodec/iff.c
@@ -488,17 +488,21 @@ static int decode_byterun(uint8_t *dst, int dst_size,
unsigned length;
const int8_t value = *buf++;
if (value >= 0) {
- length = value + 1;
- memcpy(dst + x, buf, FFMIN3(length, dst_size - x, buf_end - buf));
+ length = FFMIN3(value + 1, dst_size - x, buf_end - buf);
+ memcpy(dst + x, buf, length);
buf += length;
} else if (value > -128) {
- length = -value + 1;
- memset(dst + x, *buf++, FFMIN(length, dst_size - x));
+ length = FFMIN(-value + 1, dst_size - x);
+ memset(dst + x, *buf++, length);
} else { // noop
continue;
}
x += length;
}
+ if (x < dst_size) {
+ av_log(NULL, AV_LOG_WARNING, "decode_byterun ended before plane size\n");
+ memset(dst+x, 0, dst_size - x);
+ }
return buf - buf_start;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/imgconvert.c b/chromium/third_party/ffmpeg/libavcodec/imgconvert.c
index ee58cfb49ae..27c984a6707 100644
--- a/chromium/third_party/ffmpeg/libavcodec/imgconvert.c
+++ b/chromium/third_party/ffmpeg/libavcodec/imgconvert.c
@@ -31,9 +31,9 @@
*/
#include "avcodec.h"
-#include "dsputil.h"
#include "imgconvert.h"
#include "internal.h"
+#include "mathops.h"
#include "libavutil/avassert.h"
#include "libavutil/colorspace.h"
#include "libavutil/common.h"
@@ -41,16 +41,6 @@
#include "libavutil/imgutils.h"
#if HAVE_MMX_EXTERNAL
-#include "x86/dsputil_x86.h"
-#endif
-
-#define FF_COLOR_NA -1
-#define FF_COLOR_RGB 0 /**< RGB color space */
-#define FF_COLOR_GRAY 1 /**< gray color space */
-#define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
-#define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
-
-#if HAVE_MMX_EXTERNAL
#define deinterlace_line_inplace ff_deinterlace_line_inplace_mmx
#define deinterlace_line ff_deinterlace_line_mmx
#else
@@ -58,10 +48,6 @@
#define deinterlace_line deinterlace_line_c
#endif
-#define pixdesc_has_alpha(pixdesc) \
- ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
-
-
void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
@@ -70,184 +56,17 @@ void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int
*v_shift = desc->log2_chroma_h;
}
-static int get_color_type(const AVPixFmtDescriptor *desc) {
- if (desc->flags & AV_PIX_FMT_FLAG_PAL)
- return FF_COLOR_RGB;
-
- if(desc->nb_components == 1 || desc->nb_components == 2)
- return FF_COLOR_GRAY;
-
- if(desc->name && !strncmp(desc->name, "yuvj", 4))
- return FF_COLOR_YUV_JPEG;
-
- if(desc->flags & AV_PIX_FMT_FLAG_RGB)
- return FF_COLOR_RGB;
-
- if(desc->nb_components == 0)
- return FF_COLOR_NA;
-
- return FF_COLOR_YUV;
-}
-
-static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
-{
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
- int i;
-
- if (!desc || !desc->nb_components) {
- *min = *max = 0;
- return AVERROR(EINVAL);
- }
-
- *min = INT_MAX, *max = -INT_MAX;
- for (i = 0; i < desc->nb_components; i++) {
- *min = FFMIN(desc->comp[i].depth_minus1+1, *min);
- *max = FFMAX(desc->comp[i].depth_minus1+1, *max);
- }
- return 0;
-}
-
-static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
- enum AVPixelFormat src_pix_fmt,
- unsigned *lossp, unsigned consider)
-{
- const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
- const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
- int src_color, dst_color;
- int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
- int ret, loss, i, nb_components;
- int score = INT_MAX - 1;
-
- if (dst_pix_fmt >= AV_PIX_FMT_NB || dst_pix_fmt <= AV_PIX_FMT_NONE)
- return ~0;
-
- /* compute loss */
- *lossp = loss = 0;
-
- if (dst_pix_fmt == src_pix_fmt)
- return INT_MAX;
-
- if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
- return ret;
- if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
- return ret;
-
- src_color = get_color_type(src_desc);
- dst_color = get_color_type(dst_desc);
- nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
-
- for (i = 0; i < nb_components; i++)
- if (src_desc->comp[i].depth_minus1 > dst_desc->comp[i].depth_minus1 && (consider & FF_LOSS_DEPTH)) {
- loss |= FF_LOSS_DEPTH;
- score -= 65536 >> dst_desc->comp[i].depth_minus1;
- }
-
- if (consider & FF_LOSS_RESOLUTION) {
- if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
- loss |= FF_LOSS_RESOLUTION;
- score -= 256 << dst_desc->log2_chroma_w;
- }
- if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
- loss |= FF_LOSS_RESOLUTION;
- score -= 256 << dst_desc->log2_chroma_h;
- }
- // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
- if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
- dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
- score += 512;
- }
- }
-
- if(consider & FF_LOSS_COLORSPACE)
- switch(dst_color) {
- case FF_COLOR_RGB:
- if (src_color != FF_COLOR_RGB &&
- src_color != FF_COLOR_GRAY)
- loss |= FF_LOSS_COLORSPACE;
- break;
- case FF_COLOR_GRAY:
- if (src_color != FF_COLOR_GRAY)
- loss |= FF_LOSS_COLORSPACE;
- break;
- case FF_COLOR_YUV:
- if (src_color != FF_COLOR_YUV)
- loss |= FF_LOSS_COLORSPACE;
- break;
- case FF_COLOR_YUV_JPEG:
- if (src_color != FF_COLOR_YUV_JPEG &&
- src_color != FF_COLOR_YUV &&
- src_color != FF_COLOR_GRAY)
- loss |= FF_LOSS_COLORSPACE;
- break;
- default:
- /* fail safe test */
- if (src_color != dst_color)
- loss |= FF_LOSS_COLORSPACE;
- break;
- }
- if(loss & FF_LOSS_COLORSPACE)
- score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth_minus1, src_desc->comp[0].depth_minus1);
-
- if (dst_color == FF_COLOR_GRAY &&
- src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
- loss |= FF_LOSS_CHROMA;
- score -= 2 * 65536;
- }
- if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
- loss |= FF_LOSS_ALPHA;
- score -= 65536;
- }
- if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
- (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
- loss |= FF_LOSS_COLORQUANT;
- score -= 65536;
- }
-
- *lossp = loss;
- return score;
-}
-
int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
enum AVPixelFormat src_pix_fmt,
int has_alpha)
{
- int loss;
- int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
- if (ret < 0)
- return ret;
- return loss;
+ return av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
}
enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
{
- enum AVPixelFormat dst_pix_fmt;
- int loss1, loss2, loss_mask;
- const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
- const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
- int score1, score2;
-
- loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
- if(!has_alpha)
- loss_mask &= ~FF_LOSS_ALPHA;
-
- dst_pix_fmt = AV_PIX_FMT_NONE;
- score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
- score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
-
- if (score1 == score2) {
- if(av_get_padded_bits_per_pixel(desc2) != av_get_padded_bits_per_pixel(desc1)) {
- dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
- } else {
- dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
- }
- } else {
- dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
- }
-
- if (loss_ptr)
- *loss_ptr = avcodec_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
- return dst_pix_fmt;
+ return av_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, has_alpha, loss_ptr);
}
#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
@@ -486,7 +305,7 @@ static void deinterlace_line_c(uint8_t *dst,
const uint8_t *lum,
int size)
{
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
int sum;
for(;size > 0;size--) {
@@ -509,7 +328,7 @@ static void deinterlace_line_inplace_c(uint8_t *lum_m4, uint8_t *lum_m3,
uint8_t *lum_m2, uint8_t *lum_m1,
uint8_t *lum, int size)
{
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
int sum;
for(;size > 0;size--) {
@@ -656,7 +475,7 @@ int main(void){
av_log(NULL, AV_LOG_INFO, "%3d unused pixel format values\n", skip);
skip = 0;
}
- av_log(NULL, AV_LOG_INFO, "pix fmt %s yuv_plan:%d avg_bpp:%d colortype:%d\n", desc->name, is_yuv_planar(desc), av_get_padded_bits_per_pixel(desc), get_color_type(desc));
+ av_log(NULL, AV_LOG_INFO, "pix fmt %s yuv_plan:%d avg_bpp:%d\n", desc->name, is_yuv_planar(desc), av_get_padded_bits_per_pixel(desc));
if ((!(desc->flags & AV_PIX_FMT_FLAG_ALPHA)) != (desc->nb_components != 2 && desc->nb_components != 4)) {
av_log(NULL, AV_LOG_ERROR, "Alpha flag mismatch\n");
err = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/imgconvert.h b/chromium/third_party/ffmpeg/libavcodec/imgconvert.h
index df8cee794fc..0ce626d7a24 100644
--- a/chromium/third_party/ffmpeg/libavcodec/imgconvert.h
+++ b/chromium/third_party/ffmpeg/libavcodec/imgconvert.h
@@ -21,6 +21,24 @@
#include <stdint.h>
+#include "version.h"
+
+#if FF_API_DEINTERLACE
+
+void ff_deinterlace_line_mmx(uint8_t *dst,
+ const uint8_t *lum_m4, const uint8_t *lum_m3,
+ const uint8_t *lum_m2, const uint8_t *lum_m1,
+ const uint8_t *lum,
+ int size);
+
+void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4,
+ const uint8_t *lum_m3,
+ const uint8_t *lum_m2,
+ const uint8_t *lum_m1,
+ const uint8_t *lum, int size);
+
+#endif /* FF_API_DEINTERLACE */
+
/* 1/2^n downscaling functions */
void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
diff --git a/chromium/third_party/ffmpeg/libavcodec/indeo3.c b/chromium/third_party/ffmpeg/libavcodec/indeo3.c
index ddb4ad0deea..aa9c30aca95 100644
--- a/chromium/third_party/ffmpeg/libavcodec/indeo3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/indeo3.c
@@ -956,7 +956,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
free_frame_buffers(ctx);
if ((res = allocate_frame_buffers(ctx, avctx, width, height)) < 0)
return res;
- ff_set_dimensions(avctx, width, height);
+ if ((res = ff_set_dimensions(avctx, width, height)) < 0)
+ return res;
}
y_offset = bytestream2_get_le32(&gb);
diff --git a/chromium/third_party/ffmpeg/libavcodec/indeo4data.h b/chromium/third_party/ffmpeg/libavcodec/indeo4data.h
index 0ea4f405ad7..d96ee985023 100644
--- a/chromium/third_party/ffmpeg/libavcodec/indeo4data.h
+++ b/chromium/third_party/ffmpeg/libavcodec/indeo4data.h
@@ -28,8 +28,9 @@
#define AVCODEC_INDEO4DATA_H
#include <stdint.h>
-#include "dsputil.h"
+
#include "ivi_common.h"
+#include "mathops.h"
/**
* standard picture dimensions
diff --git a/chromium/third_party/ffmpeg/libavcodec/indeo5.c b/chromium/third_party/ffmpeg/libavcodec/indeo5.c
index e48cb43407c..0477c977397 100644
--- a/chromium/third_party/ffmpeg/libavcodec/indeo5.c
+++ b/chromium/third_party/ffmpeg/libavcodec/indeo5.c
@@ -30,7 +30,6 @@
#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "get_bits.h"
-#include "dsputil.h"
#include "ivi_dsp.h"
#include "ivi_common.h"
#include "indeo5data.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/intelh263dec.c b/chromium/third_party/ffmpeg/libavcodec/intelh263dec.c
index 5da420243d8..7ea62465fa5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/intelh263dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/intelh263dec.c
@@ -133,5 +133,8 @@ AVCodec ff_h263i_decoder = {
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/internal.h b/chromium/third_party/ffmpeg/libavcodec/internal.h
index 35bfcd47551..603ffcf8f60 100644
--- a/chromium/third_party/ffmpeg/libavcodec/internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/internal.h
@@ -27,6 +27,7 @@
#include <stdint.h>
#include "libavutil/buffer.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixfmt.h"
#include "avcodec.h"
@@ -34,6 +35,12 @@
#define FF_SANE_NB_CHANNELS 63U
+#if HAVE_NEON || ARCH_PPC || HAVE_MMX
+# define STRIDE_ALIGN 16
+#else
+# define STRIDE_ALIGN 8
+#endif
+
typedef struct FramePool {
/**
* Pools for each data plane. For audio all the planes have the same size,
@@ -115,6 +122,11 @@ typedef struct AVCodecInternal {
* Number of audio samples to skip at the start of the next decoded frame
*/
int skip_samples;
+
+ /**
+ * hwaccel-specific private data
+ */
+ void *hwaccel_priv_data;
} AVCodecInternal;
struct AVCodecDefault {
@@ -122,14 +134,7 @@ struct AVCodecDefault {
const uint8_t *value;
};
-/**
- * Return the hardware accelerated codec for codec codec_id and
- * pixel format pix_fmt.
- *
- * @param avctx The codec context containing the codec_id and pixel format.
- * @return the hardware accelerated codec, or NULL if none was found.
- */
-AVHWAccel *ff_find_hwaccel(AVCodecContext *avctx);
+extern const uint8_t ff_log2_run[41];
/**
* Return the index into tab at which {a,b} match elements {[0],[1]} of tab.
@@ -238,4 +243,22 @@ const uint8_t *avpriv_find_start_code(const uint8_t *p,
*/
int ff_set_dimensions(AVCodecContext *s, int width, int height);
+/**
+ * Add or update AV_FRAME_DATA_MATRIXENCODING side data.
+ */
+int ff_side_data_update_matrix_encoding(AVFrame *frame,
+ enum AVMatrixEncoding matrix_encoding);
+
+/**
+ * Select the (possibly hardware accelerated) pixel format.
+ * This is a wrapper around AVCodecContext.get_format() and should be used
+ * instead of calling get_format() directly.
+ */
+int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt);
+
+/**
+ * Set various frame properties from the codec context / packet data.
+ */
+int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame);
+
#endif /* AVCODEC_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c b/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c
index 7ac14569544..542fefe146c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c
@@ -197,6 +197,11 @@ static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s, AVFrame *frame)
unsigned char P[2];
unsigned int flags;
+ if (bytestream2_get_bytes_left(&s->stream_ptr) < 4) {
+ av_log(s->avctx, AV_LOG_ERROR, "too little data for opcode 0x7\n");
+ return AVERROR_INVALIDDATA;
+ }
+
/* 2-color encoding */
P[0] = bytestream2_get_byte(&s->stream_ptr);
P[1] = bytestream2_get_byte(&s->stream_ptr);
@@ -236,6 +241,11 @@ static int ipvideo_decode_block_opcode_0x8(IpvideoContext *s, AVFrame *frame)
unsigned char P[4];
unsigned int flags = 0;
+ if (bytestream2_get_bytes_left(&s->stream_ptr) < 12) {
+ av_log(s->avctx, AV_LOG_ERROR, "too little data for opcode 0x8\n");
+ return AVERROR_INVALIDDATA;
+ }
+
/* 2-color encoding for each 4x4 quadrant, or 2-color encoding on
* either top and bottom or left and right halves */
P[0] = bytestream2_get_byte(&s->stream_ptr);
@@ -308,6 +318,11 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s, AVFrame *frame)
int x, y;
unsigned char P[4];
+ if (bytestream2_get_bytes_left(&s->stream_ptr) < 8) {
+ av_log(s->avctx, AV_LOG_ERROR, "too little data for opcode 0x9\n");
+ return AVERROR_INVALIDDATA;
+ }
+
/* 4-color encoding */
bytestream2_get_buffer(&s->stream_ptr, P, 4);
@@ -374,6 +389,11 @@ static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s, AVFrame *frame)
unsigned char P[8];
int flags = 0;
+ if (bytestream2_get_bytes_left(&s->stream_ptr) < 16) {
+ av_log(s->avctx, AV_LOG_ERROR, "too little data for opcode 0xA\n");
+ return AVERROR_INVALIDDATA;
+ }
+
bytestream2_get_buffer(&s->stream_ptr, P, 4);
/* 4-color encoding for each 4x4 quadrant, or 4-color encoding on
@@ -467,6 +487,11 @@ static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s, AVFrame *frame)
int y;
unsigned char P[2];
+ if (bytestream2_get_bytes_left(&s->stream_ptr) < 4) {
+ av_log(s->avctx, AV_LOG_ERROR, "too little data for opcode 0xD\n");
+ return AVERROR_INVALIDDATA;
+ }
+
/* 4-color block encoding: each 4x4 block is a different color */
for (y = 0; y < 8; y++) {
if (!(y & 3)) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/intrax8.c b/chromium/third_party/ffmpeg/libavcodec/intrax8.c
index ffdfb079b78..4008ef6d957 100644
--- a/chromium/third_party/ffmpeg/libavcodec/intrax8.c
+++ b/chromium/third_party/ffmpeg/libavcodec/intrax8.c
@@ -303,7 +303,7 @@ static int x8_setup_spatial_predictor(IntraX8Context * const w, const int chroma
int quant;
w->dsp.setup_spatial_compensation(s->dest[chroma], s->edge_emu_buffer,
- s->current_picture.f.linesize[chroma>0],
+ s->current_picture.f->linesize[chroma>0],
&range, &sum, w->edges);
if(chroma){
w->orient=w->chroma_orient;
@@ -612,7 +612,7 @@ static int x8_decode_intra_mb(IntraX8Context* const w, const int chroma){
dc_level+= (w->predicted_dc*divide_quant + (1<<12) )>>13;
dsp_x8_put_solidcolor( av_clip_uint8((dc_level*dc_quant+4)>>3),
- s->dest[chroma], s->current_picture.f.linesize[!!chroma]);
+ s->dest[chroma], s->current_picture.f->linesize[!!chroma]);
goto block_placed;
}
@@ -636,15 +636,15 @@ static int x8_decode_intra_mb(IntraX8Context* const w, const int chroma){
}
if(w->flat_dc){
- dsp_x8_put_solidcolor(w->predicted_dc, s->dest[chroma], s->current_picture.f.linesize[!!chroma]);
+ dsp_x8_put_solidcolor(w->predicted_dc, s->dest[chroma], s->current_picture.f->linesize[!!chroma]);
}else{
w->dsp.spatial_compensation[w->orient]( s->edge_emu_buffer,
s->dest[chroma],
- s->current_picture.f.linesize[!!chroma] );
+ s->current_picture.f->linesize[!!chroma] );
}
if(!zeros_only)
w->wdsp.idct_add (s->dest[chroma],
- s->current_picture.f.linesize[!!chroma],
+ s->current_picture.f->linesize[!!chroma],
s->block[0] );
block_placed:
@@ -655,7 +655,7 @@ block_placed:
if(s->loop_filter){
uint8_t* ptr = s->dest[chroma];
- int linesize = s->current_picture.f.linesize[!!chroma];
+ int linesize = s->current_picture.f->linesize[!!chroma];
if(!( (w->edges&2) || ( zeros_only && (w->orient|4)==4 ) )){
w->dsp.h_loop_filter(ptr, linesize, w->quant);
@@ -670,12 +670,12 @@ block_placed:
static void x8_init_block_index(MpegEncContext *s){ //FIXME maybe merge with ff_*
//not s->linesize as this would be wrong for field pics
//not that IntraX8 has interlacing support ;)
- const int linesize = s->current_picture.f.linesize[0];
- const int uvlinesize = s->current_picture.f.linesize[1];
+ const int linesize = s->current_picture.f->linesize[0];
+ const int uvlinesize = s->current_picture.f->linesize[1];
- s->dest[0] = s->current_picture.f.data[0];
- s->dest[1] = s->current_picture.f.data[1];
- s->dest[2] = s->current_picture.f.data[2];
+ s->dest[0] = s->current_picture.f->data[0];
+ s->dest[1] = s->current_picture.f->data[1];
+ s->dest[2] = s->current_picture.f->data[2];
s->dest[0] += s->mb_y * linesize << 3;
s->dest[1] += ( s->mb_y&(~1) ) * uvlinesize << 2;//chroma blocks are on add rows
diff --git a/chromium/third_party/ffmpeg/libavcodec/ituh263dec.c b/chromium/third_party/ffmpeg/libavcodec/ituh263dec.c
index 8a17c6f3cae..33526554c21 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ituh263dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ituh263dec.c
@@ -36,6 +36,7 @@
#include "mpegvideo.h"
#include "h263.h"
#include "mathops.h"
+#include "mpegutils.h"
#include "unary.h"
#include "flv.h"
#include "mpeg4video.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/ituh263enc.c b/chromium/third_party/ffmpeg/libavcodec/ituh263enc.c
index 2db95811190..5db3a7512ab 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ituh263enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ituh263enc.c
@@ -34,6 +34,7 @@
#include "mpegvideo.h"
#include "h263.h"
#include "mathops.h"
+#include "mpegutils.h"
#include "unary.h"
#include "flv.h"
#include "mpeg4video.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/ivi_common.c b/chromium/third_party/ffmpeg/libavcodec/ivi_common.c
index 9b5f5f876e8..7b1db42b067 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ivi_common.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ivi_common.c
@@ -26,8 +26,11 @@
* Indeo5 decoders.
*/
+#include <inttypes.h>
+
#define BITSTREAM_READER_LE
#include "libavutil/attributes.h"
+#include "libavutil/timer.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
@@ -297,7 +300,7 @@ av_cold int ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg)
planes[1].num_bands = planes[2].num_bands = cfg->chroma_bands;
for (p = 0; p < 3; p++) {
- planes[p].bands = av_mallocz(planes[p].num_bands * sizeof(IVIBandDesc));
+ planes[p].bands = av_mallocz_array(planes[p].num_bands, sizeof(IVIBandDesc));
if (!planes[p].bands)
return AVERROR(ENOMEM);
@@ -363,7 +366,7 @@ static int ivi_init_tiles(IVIBandDesc *band, IVITile *ref_tile,
band->mb_size);
av_freep(&tile->mbs);
- tile->mbs = av_malloc(tile->num_MBs * sizeof(IVIMbInfo));
+ tile->mbs = av_mallocz_array(tile->num_MBs, sizeof(IVIMbInfo));
if (!tile->mbs)
return AVERROR(ENOMEM);
@@ -407,7 +410,7 @@ av_cold int ff_ivi_init_tiles(IVIPlaneDesc *planes,
band->num_tiles = x_tiles * y_tiles;
av_freep(&band->tiles);
- band->tiles = av_mallocz(band->num_tiles * sizeof(IVITile));
+ band->tiles = av_mallocz_array(band->num_tiles, sizeof(IVITile));
if (!band->tiles)
return AVERROR(ENOMEM);
@@ -512,7 +515,7 @@ static int ivi_decode_coded_blocks(GetBitContext *gb, IVIBandDesc *band,
val = IVI_TOSIGNED((hi << 6) | lo);
} else {
if (sym >= 256U) {
- av_log(avctx, AV_LOG_ERROR, "Invalid sym encountered: %d.\n", sym);
+ av_log(avctx, AV_LOG_ERROR, "Invalid sym encountered: %"PRIu32".\n", sym);
return AVERROR_INVALIDDATA;
}
run = rvmap->runtab[sym];
@@ -961,7 +964,7 @@ static int decode_band(IVI45DecContext *ctx,
if (chksum != band->checksum) {
av_log(avctx, AV_LOG_ERROR,
"Band checksum mismatch! Plane %d, band %d, "
- "received: %x, calculated: %x\n",
+ "received: %"PRIx32", calculated: %"PRIx16"\n",
band->plane, band->band_num, band->checksum, chksum);
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/j2kenc.c b/chromium/third_party/ffmpeg/libavcodec/j2kenc.c
index d9f5eaf5f42..ddb0b686cb9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/j2kenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/j2kenc.c
@@ -60,7 +60,7 @@ typedef struct {
typedef struct {
AVCodecContext *avctx;
- AVFrame picture;
+ const AVFrame *picture;
int width, height; ///< image width and height
uint8_t cbps[4]; ///< bits per sample in particular components
@@ -343,14 +343,14 @@ static int init_tiles(Jpeg2000EncoderContext *s)
s->numXtiles = ff_jpeg2000_ceildiv(s->width, s->tile_width);
s->numYtiles = ff_jpeg2000_ceildiv(s->height, s->tile_height);
- s->tile = av_malloc(s->numXtiles * s->numYtiles * sizeof(Jpeg2000Tile));
+ s->tile = av_malloc_array(s->numXtiles, s->numYtiles * sizeof(Jpeg2000Tile));
if (!s->tile)
return AVERROR(ENOMEM);
for (tileno = 0, tiley = 0; tiley < s->numYtiles; tiley++)
for (tilex = 0; tilex < s->numXtiles; tilex++, tileno++){
Jpeg2000Tile *tile = s->tile + tileno;
- tile->comp = av_mallocz(s->ncomponents * sizeof(Jpeg2000Component));
+ tile->comp = av_mallocz_array(s->ncomponents, sizeof(Jpeg2000Component));
if (!tile->comp)
return AVERROR(ENOMEM);
for (compno = 0; compno < s->ncomponents; compno++){
@@ -390,18 +390,18 @@ static void copy_frame(Jpeg2000EncoderContext *s)
for (compno = 0; compno < s->ncomponents; compno++){
Jpeg2000Component *comp = tile->comp + compno;
int *dst = comp->i_data;
- line = s->picture.data[compno]
- + comp->coord[1][0] * s->picture.linesize[compno]
+ line = s->picture->data[compno]
+ + comp->coord[1][0] * s->picture->linesize[compno]
+ comp->coord[0][0];
for (y = comp->coord[1][0]; y < comp->coord[1][1]; y++){
uint8_t *ptr = line;
for (x = comp->coord[0][0]; x < comp->coord[0][1]; x++)
*dst++ = *ptr++ - (1 << 7);
- line += s->picture.linesize[compno];
+ line += s->picture->linesize[compno];
}
}
} else{
- line = s->picture.data[0] + tile->comp[0].coord[1][0] * s->picture.linesize[0]
+ line = s->picture->data[0] + tile->comp[0].coord[1][0] * s->picture->linesize[0]
+ tile->comp[0].coord[0][0] * s->ncomponents;
i = 0;
@@ -412,7 +412,7 @@ static void copy_frame(Jpeg2000EncoderContext *s)
tile->comp[compno].i_data[i] = *ptr++ - (1 << 7);
}
}
- line += s->picture.linesize[0];
+ line += s->picture->linesize[0];
}
}
}
@@ -927,10 +927,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s->buf = s->buf_start = pkt->data;
s->buf_end = pkt->data + pkt->size;
- s->picture = *pict;
- avctx->coded_frame= &s->picture;
+ s->picture = pict;
- s->lambda = s->picture.quality * LAMBDA_SCALE;
+ s->lambda = s->picture->quality * LAMBDA_SCALE;
copy_frame(s);
reinit(s);
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c
index d3e49a19e6e..fbfb7d1e5f0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c
@@ -25,6 +25,8 @@
* JPEG 2000 image decoder
*/
+#include <inttypes.h>
+
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
@@ -344,7 +346,7 @@ static int get_siz(Jpeg2000DecoderContext *s)
break;
}
}
- if (s->avctx->pix_fmt == AV_PIX_FMT_NONE) {
+ if (i == possible_fmts_nb) {
av_log(s->avctx, AV_LOG_ERROR,
"Unknown pix_fmt, profile: %d, colour_space: %d, "
"components: %d, precision: %d, "
@@ -354,6 +356,7 @@ static int get_siz(Jpeg2000DecoderContext *s)
ncomponents > 2 ? s->cdy[1] : 0,
ncomponents > 2 ? s->cdx[2] : 0,
ncomponents > 2 ? s->cdy[2] : 0);
+ return AVERROR_PATCHWELCOME;
}
s->avctx->bits_per_raw_sample = s->precision;
return 0;
@@ -445,7 +448,7 @@ static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
if (tmp.mct && s->ncomponents < 3) {
av_log(s->avctx, AV_LOG_ERROR,
- "MCT %d with too few components (%d)\n",
+ "MCT %"PRIu8" with too few components (%d)\n",
tmp.mct, s->ncomponents);
return AVERROR_INVALIDDATA;
}
@@ -540,6 +543,8 @@ static int get_qcd(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q,
Jpeg2000QuantStyle tmp;
int compno, ret;
+ memset(&tmp, 0, sizeof(tmp));
+
if ((ret = get_qcx(s, n, &tmp)) < 0)
return ret;
for (compno = 0; compno < s->ncomponents; compno++)
@@ -595,12 +600,12 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
bytestream2_get_byteu(&s->g); // TNsot
if (Psot > bytestream2_get_bytes_left(&s->g) + n + 2) {
- av_log(s->avctx, AV_LOG_ERROR, "Psot %d too big\n", Psot);
+ av_log(s->avctx, AV_LOG_ERROR, "Psot %"PRIu32" too big\n", Psot);
return AVERROR_INVALIDDATA;
}
if (TPsot >= FF_ARRAY_ELEMS(s->tile[Isot].tile_part)) {
- avpriv_request_sample(s->avctx, "Support for %d components", TPsot);
+ avpriv_request_sample(s->avctx, "Support for %"PRIu8" components", TPsot);
return AVERROR_PATCHWELCOME;
}
@@ -777,7 +782,7 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
return ret;
if (ret > sizeof(cblk->data)) {
avpriv_request_sample(s->avctx,
- "Block with lengthinc greater than %zu",
+ "Block with lengthinc greater than %"SIZE_SPECIFIER"",
sizeof(cblk->data));
return AVERROR_PATCHWELCOME;
}
@@ -805,7 +810,7 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
|| sizeof(cblk->data) < cblk->length + cblk->lengthinc + 2
) {
av_log(s->avctx, AV_LOG_ERROR,
- "Block length %d or lengthinc %d is too large\n",
+ "Block length %"PRIu16" or lengthinc %d is too large\n",
cblk->length, cblk->lengthinc);
return AVERROR_INVALIDDATA;
}
@@ -1210,8 +1215,11 @@ static void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
AVFrame *picture)
{
+ const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
int compno, reslevelno, bandno;
int x, y;
+ int planar = !!(pixdesc->flags & AV_PIX_FMT_FLAG_PLANAR);
+ int pixelsize = planar ? 1 : pixdesc->nb_components;
uint8_t *line;
Jpeg2000T1Context t1;
@@ -1285,8 +1293,6 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
int32_t *i_datap = comp->i_data;
int cbps = s->cbps[compno];
int w = tile->comp[compno].coord[0][1] - s->image_offset_x;
- int planar = !!picture->data[2];
- int pixelsize = planar ? 1 : s->ncomponents;
int plane = 0;
if (planar)
@@ -1332,8 +1338,6 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
uint16_t *linel;
int cbps = s->cbps[compno];
int w = tile->comp[compno].coord[0][1] - s->image_offset_x;
- int planar = !!picture->data[2];
- int pixelsize = planar ? 1 : s->ncomponents;
int plane = 0;
if (planar)
@@ -1481,14 +1485,15 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
break;
default:
av_log(s->avctx, AV_LOG_ERROR,
- "unsupported marker 0x%.4X at pos 0x%X\n",
+ "unsupported marker 0x%.4"PRIX16" at pos 0x%X\n",
marker, bytestream2_tell(&s->g) - 4);
bytestream2_skip(&s->g, len - 2);
break;
}
if (bytestream2_tell(&s->g) - oldpos != len || ret) {
av_log(s->avctx, AV_LOG_ERROR,
- "error during processing marker segment %.4x\n", marker);
+ "error during processing marker segment %.4"PRIx16"\n",
+ marker);
return ret ? ret : -1;
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.c b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.c
index 266edece04f..ceceda36dc4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.c
@@ -518,17 +518,17 @@ int ff_jpeg2000_dwt_init(DWTContext *s, uint16_t border[2][2],
}
switch (type) {
case FF_DWT97:
- s->f_linebuf = av_malloc((maxlen + 12) * sizeof(*s->f_linebuf));
+ s->f_linebuf = av_malloc_array((maxlen + 12), sizeof(*s->f_linebuf));
if (!s->f_linebuf)
return AVERROR(ENOMEM);
break;
case FF_DWT97_INT:
- s->i_linebuf = av_malloc((maxlen + 12) * sizeof(*s->i_linebuf));
+ s->i_linebuf = av_malloc_array((maxlen + 12), sizeof(*s->i_linebuf));
if (!s->i_linebuf)
return AVERROR(ENOMEM);
break;
case FF_DWT53:
- s->i_linebuf = av_malloc((maxlen + 6) * sizeof(*s->i_linebuf));
+ s->i_linebuf = av_malloc_array((maxlen + 6), sizeof(*s->i_linebuf));
if (!s->i_linebuf)
return AVERROR(ENOMEM);
break;
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpegls.h b/chromium/third_party/ffmpeg/libavcodec/jpegls.h
index 10ae054a7b3..c8997c78618 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpegls.h
+++ b/chromium/third_party/ffmpeg/libavcodec/jpegls.h
@@ -30,6 +30,7 @@
#include "libavutil/common.h"
#include "avcodec.h"
+#include "internal.h"
typedef struct JpeglsContext {
AVCodecContext *avctx;
@@ -43,8 +44,6 @@ typedef struct JLSState {
int run_index[4];
} JLSState;
-extern const uint8_t ff_log2_run[32];
-
/**
* Calculate initial JPEG-LS parameters
*/
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeglsdec.c b/chromium/third_party/ffmpeg/libavcodec/jpeglsdec.c
index 190b9b6d264..fb3762dad05 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeglsdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeglsdec.c
@@ -50,27 +50,79 @@
int ff_jpegls_decode_lse(MJpegDecodeContext *s)
{
int id;
+ int tid, wt, maxtab, i, j;
- skip_bits(&s->gb, 16); /* length: FIXME: verify field validity */
+ int len = get_bits(&s->gb, 16);
id = get_bits(&s->gb, 8);
switch (id) {
case 1:
+ if (len < 13)
+ return AVERROR_INVALIDDATA;
+
s->maxval = get_bits(&s->gb, 16);
s->t1 = get_bits(&s->gb, 16);
s->t2 = get_bits(&s->gb, 16);
s->t3 = get_bits(&s->gb, 16);
s->reset = get_bits(&s->gb, 16);
+ if(s->avctx->debug & FF_DEBUG_PICT_INFO) {
+ av_log(s->avctx, AV_LOG_DEBUG, "Coding parameters maxval:%d T1:%d T2:%d T3:%d reset:%d\n",
+ s->maxval, s->t1, s->t2, s->t3, s->reset);
+ }
+
// ff_jpegls_reset_coding_parameters(s, 0);
//FIXME quant table?
break;
case 2:
+ s->palette_index = 0;
case 3:
- av_log(s->avctx, AV_LOG_ERROR, "palette not supported\n");
- return AVERROR(ENOSYS);
+ tid= get_bits(&s->gb, 8);
+ wt = get_bits(&s->gb, 8);
+
+ if (len < 5)
+ return AVERROR_INVALIDDATA;
+
+ if (wt < 1 || wt > MAX_COMPONENTS) {
+ avpriv_request_sample(s->avctx, "wt %d", wt);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ if (!s->maxval)
+ maxtab = 255;
+ else if ((5 + wt*(s->maxval+1)) < 65535)
+ maxtab = s->maxval;
+ else
+ maxtab = 65530/wt - 1;
+
+ if(s->avctx->debug & FF_DEBUG_PICT_INFO) {
+ av_log(s->avctx, AV_LOG_DEBUG, "LSE palette %d tid:%d wt:%d maxtab:%d\n", id, tid, wt, maxtab);
+ }
+ if (maxtab >= 256) {
+ avpriv_request_sample(s->avctx, ">8bit palette");
+ return AVERROR_PATCHWELCOME;
+ }
+ maxtab = FFMIN(maxtab, (len - 5) / wt + s->palette_index);
+
+ if (s->palette_index > maxtab)
+ return AVERROR_INVALIDDATA;
+
+ if ((s->avctx->pix_fmt == AV_PIX_FMT_GRAY8 || s->avctx->pix_fmt == AV_PIX_FMT_PAL8) &&
+ (s->picture_ptr->format == AV_PIX_FMT_GRAY8 || s->picture_ptr->format == AV_PIX_FMT_PAL8)) {
+ uint32_t *pal = (uint32_t *)s->picture_ptr->data[1];
+ s->picture_ptr->format =
+ s->avctx->pix_fmt = AV_PIX_FMT_PAL8;
+ for (i=s->palette_index; i<=maxtab; i++) {
+ pal[i] = 0;
+ for (j=0; j<wt; j++) {
+ pal[i] |= get_bits(&s->gb, 8) << (8*(wt-j-1));
+ }
+ }
+ s->palette_index = i;
+ }
+ break;
case 4:
- av_log(s->avctx, AV_LOG_ERROR, "oversize image not supported\n");
+ avpriv_request_sample(s->avctx, "oversize image");
return AVERROR(ENOSYS);
default:
av_log(s->avctx, AV_LOG_ERROR, "invalid id %d\n", id);
diff --git a/chromium/third_party/ffmpeg/libavcodec/jvdec.c b/chromium/third_party/ffmpeg/libavcodec/jvdec.c
index cad053289a0..03da880b7fc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jvdec.c
@@ -25,11 +25,12 @@
* @author Peter Ross <pross@xvid.org>
*/
+#include "libavutil/intreadwrite.h"
+
#include "avcodec.h"
#include "dsputil.h"
#include "get_bits.h"
#include "internal.h"
-#include "libavutil/intreadwrite.h"
typedef struct JvContext {
DSPContext dsp;
@@ -62,19 +63,19 @@ static inline void decode2x2(GetBitContext *gb, uint8_t *dst, int linesize)
case 1:
v[0] = get_bits(gb, 8);
for (j = 0; j < 2; j++)
- memset(dst + j*linesize, v[0], 2);
+ memset(dst + j * linesize, v[0], 2);
break;
case 2:
v[0] = get_bits(gb, 8);
v[1] = get_bits(gb, 8);
for (j = 0; j < 2; j++)
for (i = 0; i < 2; i++)
- dst[j*linesize + i] = v[get_bits1(gb)];
+ dst[j * linesize + i] = v[get_bits1(gb)];
break;
case 3:
for (j = 0; j < 2; j++)
for (i = 0; i < 2; i++)
- dst[j*linesize + i] = get_bits(gb, 8);
+ dst[j * linesize + i] = get_bits(gb, 8);
}
}
@@ -89,29 +90,30 @@ static inline void decode4x4(GetBitContext *gb, uint8_t *dst, int linesize)
case 1:
v[0] = get_bits(gb, 8);
for (j = 0; j < 4; j++)
- memset(dst + j*linesize, v[0], 4);
+ memset(dst + j * linesize, v[0], 4);
break;
case 2:
v[0] = get_bits(gb, 8);
v[1] = get_bits(gb, 8);
for (j = 2; j >= 0; j -= 2) {
for (i = 0; i < 4; i++)
- dst[j*linesize + i] = v[get_bits1(gb)];
+ dst[j * linesize + i] = v[get_bits1(gb)];
for (i = 0; i < 4; i++)
- dst[(j+1)*linesize + i] = v[get_bits1(gb)];
+ dst[(j + 1) * linesize + i] = v[get_bits1(gb)];
}
break;
case 3:
for (j = 0; j < 4; j += 2)
for (i = 0; i < 4; i += 2)
- decode2x2(gb, dst + j*linesize + i, linesize);
+ decode2x2(gb, dst + j * linesize + i, linesize);
}
}
/**
* Decode 8x8 block
*/
-static inline void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize, DSPContext *dsp)
+static inline void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize,
+ DSPContext *dsp)
{
int i, j, v[2];
@@ -124,22 +126,21 @@ static inline void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize, DSPC
v[0] = get_bits(gb, 8);
v[1] = get_bits(gb, 8);
for (j = 7; j >= 0; j--)
- for (i = 0; i < 8; i++)
- dst[j*linesize + i] = v[get_bits1(gb)];
+ for (i = 0; i < 8; i++)
+ dst[j * linesize + i] = v[get_bits1(gb)];
break;
case 3:
for (j = 0; j < 8; j += 4)
for (i = 0; i < 8; i += 4)
- decode4x4(gb, dst + j*linesize + i, linesize);
+ decode4x4(gb, dst + j * linesize + i, linesize);
}
}
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *got_frame,
+static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
- JvContext *s = avctx->priv_data;
- const uint8_t *buf = avpkt->data;
+ JvContext *s = avctx->priv_data;
+ const uint8_t *buf = avpkt->data;
const uint8_t *buf_end = buf + avpkt->size;
int video_size, video_type, i, j, ret;
@@ -164,16 +165,19 @@ static int decode_frame(AVCodecContext *avctx,
for (j = 0; j < avctx->height; j += 8)
for (i = 0; i < avctx->width; i += 8)
- decode8x8(&gb, s->frame->data[0] + j * s->frame->linesize[0] + i,
+ decode8x8(&gb,
+ s->frame->data[0] + j * s->frame->linesize[0] + i,
s->frame->linesize[0], &s->dsp);
buf += video_size;
} else if (video_type == 2) {
int v = *buf++;
for (j = 0; j < avctx->height; j++)
- memset(s->frame->data[0] + j * s->frame->linesize[0], v, avctx->width);
+ memset(s->frame->data[0] + j * s->frame->linesize[0],
+ v, avctx->width);
} else {
- av_log(avctx, AV_LOG_WARNING, "unsupported frame type %i\n", video_type);
+ av_log(avctx, AV_LOG_WARNING,
+ "unsupported frame type %i\n", video_type);
return AVERROR_INVALIDDATA;
}
}
@@ -191,7 +195,7 @@ static int decode_frame(AVCodecContext *avctx,
s->frame->key_frame = 1;
s->frame->pict_type = AV_PICTURE_TYPE_I;
s->frame->palette_has_changed = s->palette_has_changed;
- s->palette_has_changed = 0;
+ s->palette_has_changed = 0;
memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
if ((ret = av_frame_ref(data, s->frame)) < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/kbdwin.c b/chromium/third_party/ffmpeg/libavcodec/kbdwin.c
index 5a62e9da2bd..bf32aeb3176 100644
--- a/chromium/third_party/ffmpeg/libavcodec/kbdwin.c
+++ b/chromium/third_party/ffmpeg/libavcodec/kbdwin.c
@@ -45,3 +45,13 @@ av_cold void ff_kbd_window_init(float *window, float alpha, int n)
for (i = 0; i < n; i++)
window[i] = sqrt(local_window[i] / sum);
}
+
+av_cold void ff_kbd_window_init_fixed(int32_t *window, float alpha, int n)
+{
+ int i;
+ float local_window[FF_KBD_WINDOW_MAX];
+
+ ff_kbd_window_init(local_window, alpha, n);
+ for (i = 0; i < n; i++)
+ window[i] = (int)floor(2147483647.0 * local_window[i] + 0.5);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/kbdwin.h b/chromium/third_party/ffmpeg/libavcodec/kbdwin.h
index 4b939756c10..4185c4206f8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/kbdwin.h
+++ b/chromium/third_party/ffmpeg/libavcodec/kbdwin.h
@@ -19,6 +19,8 @@
#ifndef AVCODEC_KBDWIN_H
#define AVCODEC_KBDWIN_H
+#include <stdint.h>
+
/**
* Maximum window size for ff_kbd_window_init.
*/
@@ -31,5 +33,6 @@
* @param n size of half window, max FF_KBD_WINDOW_MAX
*/
void ff_kbd_window_init(float *window, float alpha, int n);
+void ff_kbd_window_init_fixed(int32_t *window, float alpha, int n);
#endif /* AVCODEC_KBDWIN_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/kgv1dec.c b/chromium/third_party/ffmpeg/libavcodec/kgv1dec.c
index 5528c6f3612..b81ba75325b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/kgv1dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/kgv1dec.c
@@ -31,14 +31,16 @@
#include "internal.h"
typedef struct {
- AVFrame *prev;
+ uint16_t *frame_buffer;
+ uint16_t *last_frame_buffer;
} KgvContext;
static void decode_flush(AVCodecContext *avctx)
{
KgvContext * const c = avctx->priv_data;
- av_frame_free(&c->prev);
+ av_freep(&c->frame_buffer);
+ av_freep(&c->last_frame_buffer);
}
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
@@ -61,21 +63,27 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
buf += 2;
if (w != avctx->width || h != avctx->height) {
- av_frame_unref(c->prev);
+ av_freep(&c->frame_buffer);
+ av_freep(&c->last_frame_buffer);
if ((res = ff_set_dimensions(avctx, w, h)) < 0)
return res;
}
+ if (!c->frame_buffer) {
+ c->frame_buffer = av_mallocz(avctx->width * avctx->height * 2);
+ c->last_frame_buffer = av_mallocz(avctx->width * avctx->height * 2);
+ if (!c->frame_buffer || !c->last_frame_buffer) {
+ decode_flush(avctx);
+ return AVERROR(ENOMEM);
+ }
+ }
+
maxcnt = w * h;
- if ((res = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
+ if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
return res;
- out = frame->data[0];
- if (c->prev->data[0]) {
- prev = c->prev->data[0];
- } else {
- prev = NULL;
- }
+ out = (uint8_t*)c->frame_buffer;
+ prev = (uint8_t*)c->last_frame_buffer;
for (i = 0; i < 8; i++)
offsets[i] = -1;
@@ -142,9 +150,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (outcnt - maxcnt)
av_log(avctx, AV_LOG_DEBUG, "frame finished with %d diff\n", outcnt - maxcnt);
- av_frame_unref(c->prev);
- if ((res = av_frame_ref(c->prev, frame)) < 0)
- return res;
+ av_image_copy_plane(frame->data[0], frame->linesize[0],
+ (const uint8_t*)c->frame_buffer, avctx->width * 2,
+ avctx->width * 2, avctx->height);
+ FFSWAP(uint16_t *, c->frame_buffer, c->last_frame_buffer);
*got_frame = 1;
@@ -153,22 +162,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
static av_cold int decode_init(AVCodecContext *avctx)
{
- KgvContext * const c = avctx->priv_data;
-
- c->prev = av_frame_alloc();
- if (!c->prev)
- return AVERROR(ENOMEM);
-
avctx->pix_fmt = AV_PIX_FMT_RGB555;
- avctx->flags |= CODEC_FLAG_EMU_EDGE;
return 0;
}
static av_cold int decode_end(AVCodecContext *avctx)
{
- KgvContext * const c = avctx->priv_data;
- av_frame_free(&c->prev);
+ decode_flush(avctx);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/lagarith.c b/chromium/third_party/ffmpeg/libavcodec/lagarith.c
index 0a4d23e7a21..6571baf2e70 100644
--- a/chromium/third_party/ffmpeg/libavcodec/lagarith.c
+++ b/chromium/third_party/ffmpeg/libavcodec/lagarith.c
@@ -25,6 +25,8 @@
* @author Nathan Caldwell
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "get_bits.h"
#include "mathops.h"
@@ -52,6 +54,7 @@ typedef struct LagarithContext {
int zeros; /**< number of consecutive zero bytes encountered */
int zeros_rem; /**< number of zero bytes remaining to output */
uint8_t *rgb_planes;
+ int rgb_planes_allocated;
int rgb_stride;
} LagarithContext;
@@ -302,16 +305,16 @@ static void lag_pred_line_yuy2(LagarithContext *l, uint8_t *buf,
L += buf[i];
buf[i] = L;
}
- for (; i<width; i++) {
- L = mid_pred(L&0xFF, buf[i-stride], (L + buf[i-stride] - TL)&0xFF) + buf[i];
- TL = buf[i-stride];
- buf[i]= L;
+ for (; i < width; i++) {
+ L = mid_pred(L & 0xFF, buf[i - stride], (L + buf[i - stride] - TL) & 0xFF) + buf[i];
+ TL = buf[i - stride];
+ buf[i] = L;
}
} else {
TL = buf[width - (2 * stride) - 1];
L = buf[width - stride - 1];
l->dsp.add_hfyu_median_prediction(buf, buf - stride, buf, width,
- &L, &TL);
+ &L, &TL);
}
}
@@ -369,6 +372,10 @@ static int lag_decode_zero_run_line(LagarithContext *l, uint8_t *dst,
uint8_t mask2 = -(esc_count < 3);
uint8_t *end = dst + (width - 2);
+ avpriv_request_sample(l->avctx, "zero_run_line");
+
+ memset(dst, 0, width);
+
output_zeros:
if (l->zeros_rem) {
count = FFMIN(l->zeros_rem, width - i);
@@ -423,6 +430,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
GetBitContext gb;
lag_rac rac;
const uint8_t *src_end = src + src_size;
+ int ret;
rac.avctx = l->avctx;
l->zeros = 0;
@@ -440,7 +448,8 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
offset += 4;
}
- init_get_bits(&gb, src + offset, src_size * 8);
+ if ((ret = init_get_bits8(&gb, src + offset, src_size - offset)) < 0)
+ return ret;
if (lag_read_prob_header(&rac, &gb) < 0)
return -1;
@@ -453,10 +462,12 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
if (read > length)
av_log(l->avctx, AV_LOG_WARNING,
- "Output more bytes than length (%d of %d)\n", read,
+ "Output more bytes than length (%d of %"PRIu32")\n", read,
length);
} else if (esc_count < 8) {
esc_count -= 4;
+ src ++;
+ src_size --;
if (esc_count > 0) {
/* Zero run coding only, no range coding. */
for (i = 0; i < height; i++) {
@@ -603,13 +614,12 @@ static int lag_decode_frame(AVCodecContext *avctx,
offs[1] = offset_gu;
offs[2] = offset_ry;
+ l->rgb_stride = FFALIGN(avctx->width, 16);
+ av_fast_malloc(&l->rgb_planes, &l->rgb_planes_allocated,
+ l->rgb_stride * avctx->height * planes + 1);
if (!l->rgb_planes) {
- l->rgb_stride = FFALIGN(avctx->width, 16);
- l->rgb_planes = av_malloc(l->rgb_stride * avctx->height * 4 + 16);
- if (!l->rgb_planes) {
- av_log(avctx, AV_LOG_ERROR, "cannot allocate temporary buffer\n");
- return AVERROR(ENOMEM);
- }
+ av_log(avctx, AV_LOG_ERROR, "cannot allocate temporary buffer\n");
+ return AVERROR(ENOMEM);
}
for (i = 0; i < planes; i++)
srcs[i] = l->rgb_planes + (i + 1) * l->rgb_stride * avctx->height - l->rgb_stride;
@@ -703,7 +713,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
break;
default:
av_log(avctx, AV_LOG_ERROR,
- "Unsupported Lagarith frame type: %#x\n", frametype);
+ "Unsupported Lagarith frame type: %#"PRIx8"\n", frametype);
return AVERROR_PATCHWELCOME;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/libfdk-aacdec.c b/chromium/third_party/ffmpeg/libavcodec/libfdk-aacdec.c
index c833a98a82a..de1089dd8d6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libfdk-aacdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libfdk-aacdec.c
@@ -4,19 +4,29 @@
*
* 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.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * 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.
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
*
- * 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
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <fdk-aac/aacdecoder_lib.h>
diff --git a/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c b/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c
index 755b76f958c..7a85dfff54a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c
@@ -4,19 +4,29 @@
*
* 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.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * 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.
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
*
- * 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
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <fdk-aac/aacenc_lib.h>
@@ -151,6 +161,20 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
case 4: mode = MODE_1_2_1; sce = 2; cpe = 1; break;
case 5: mode = MODE_1_2_2; sce = 1; cpe = 2; break;
case 6: mode = MODE_1_2_2_1; sce = 2; cpe = 2; break;
+/* The version macro is introduced the same time as the 7.1 support, so this
+ should suffice. */
+#ifdef AACENCODER_LIB_VL0
+ case 8:
+ sce = 2;
+ cpe = 3;
+ if (avctx->channel_layout == AV_CH_LAYOUT_7POINT1) {
+ mode = MODE_7_1_REAR_SURROUND;
+ } else {
+ // MODE_1_2_2_2_1 and MODE_7_1_FRONT_CENTER use the same channel layout
+ mode = MODE_7_1_FRONT_CENTER;
+ }
+ break;
+#endif
default:
av_log(avctx, AV_LOG_ERROR,
"Unsupported number of channels %d\n", avctx->channels);
@@ -384,6 +408,10 @@ static const uint64_t aac_channel_layout[] = {
AV_CH_LAYOUT_4POINT0,
AV_CH_LAYOUT_5POINT0_BACK,
AV_CH_LAYOUT_5POINT1_BACK,
+#ifdef AACENCODER_LIB_VL0
+ AV_CH_LAYOUT_7POINT1_WIDE_BACK,
+ AV_CH_LAYOUT_7POINT1,
+#endif
0,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libopencore-amr.c b/chromium/third_party/ffmpeg/libavcodec/libopencore-amr.c
index 75c467ff59f..4c7b6afc7ce 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libopencore-amr.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libopencore-amr.c
@@ -205,7 +205,6 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
s->enc_state = Encoder_Interface_init(s->enc_dtx);
if (!s->enc_state) {
av_log(avctx, AV_LOG_ERROR, "Encoder_Interface_init error\n");
- av_freep(&avctx->coded_frame);
return -1;
}
@@ -242,7 +241,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if (frame) {
if (frame->nb_samples < avctx->frame_size) {
- flush_buf = av_mallocz(avctx->frame_size * sizeof(*flush_buf));
+ flush_buf = av_mallocz_array(avctx->frame_size, sizeof(*flush_buf));
if (!flush_buf)
return AVERROR(ENOMEM);
memcpy(flush_buf, samples, frame->nb_samples * sizeof(*flush_buf));
@@ -257,7 +256,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
} else {
if (s->enc_last_frame < 0)
return 0;
- flush_buf = av_mallocz(avctx->frame_size * sizeof(*flush_buf));
+ flush_buf = av_mallocz_array(avctx->frame_size, sizeof(*flush_buf));
if (!flush_buf)
return AVERROR(ENOMEM);
samples = flush_buf;
diff --git a/chromium/third_party/ffmpeg/libavcodec/libopenjpegdec.c b/chromium/third_party/ffmpeg/libavcodec/libopenjpegdec.c
index 0543e3a8978..178e4488c41 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libopenjpegdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libopenjpegdec.c
@@ -27,10 +27,11 @@
#define OPJ_STATIC
#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
-#include "libavutil/pixfmt.h"
+#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
+#include "libavutil/pixfmt.h"
+
#include "avcodec.h"
#include "internal.h"
#include "thread.h"
@@ -46,29 +47,38 @@
// pix_fmts with lower bpp have to be listed before
// similar pix_fmts with higher bpp.
-#define RGB_PIXEL_FORMATS AV_PIX_FMT_RGB24,AV_PIX_FMT_RGBA,AV_PIX_FMT_RGB48,AV_PIX_FMT_RGBA64
-#define GRAY_PIXEL_FORMATS AV_PIX_FMT_GRAY8,AV_PIX_FMT_GRAY8A,AV_PIX_FMT_GRAY16
-#define YUV_PIXEL_FORMATS AV_PIX_FMT_YUV410P,AV_PIX_FMT_YUV411P,AV_PIX_FMT_YUVA420P, \
- AV_PIX_FMT_YUV420P,AV_PIX_FMT_YUV422P,AV_PIX_FMT_YUVA422P, \
- AV_PIX_FMT_YUV440P,AV_PIX_FMT_YUV444P,AV_PIX_FMT_YUVA444P, \
- AV_PIX_FMT_YUV420P9,AV_PIX_FMT_YUV422P9,AV_PIX_FMT_YUV444P9, \
- AV_PIX_FMT_YUVA420P9,AV_PIX_FMT_YUVA422P9,AV_PIX_FMT_YUVA444P9, \
- AV_PIX_FMT_YUV420P10,AV_PIX_FMT_YUV422P10,AV_PIX_FMT_YUV444P10, \
- AV_PIX_FMT_YUVA420P10,AV_PIX_FMT_YUVA422P10,AV_PIX_FMT_YUVA444P10, \
- AV_PIX_FMT_YUV420P12,AV_PIX_FMT_YUV422P12,AV_PIX_FMT_YUV444P12, \
- AV_PIX_FMT_YUV420P14,AV_PIX_FMT_YUV422P14,AV_PIX_FMT_YUV444P14, \
- AV_PIX_FMT_YUV420P16,AV_PIX_FMT_YUV422P16,AV_PIX_FMT_YUV444P16, \
- AV_PIX_FMT_YUVA420P16,AV_PIX_FMT_YUVA422P16,AV_PIX_FMT_YUVA444P16
+#define RGB_PIXEL_FORMATS AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, \
+ AV_PIX_FMT_RGB48, AV_PIX_FMT_RGBA64
+
+#define GRAY_PIXEL_FORMATS AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, \
+ AV_PIX_FMT_GRAY16
+
+#define YUV_PIXEL_FORMATS AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUVA420P, \
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA422P, \
+ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, \
+ AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9, \
+ AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9, \
+ AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, \
+ AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA444P10, \
+ AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, \
+ AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV444P14, \
+ AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16, \
+ AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16
#define XYZ_PIXEL_FORMATS AV_PIX_FMT_XYZ12
-static const enum AVPixelFormat libopenjpeg_rgb_pix_fmts[] = {RGB_PIXEL_FORMATS};
-static const enum AVPixelFormat libopenjpeg_gray_pix_fmts[] = {GRAY_PIXEL_FORMATS};
-static const enum AVPixelFormat libopenjpeg_yuv_pix_fmts[] = {YUV_PIXEL_FORMATS};
-static const enum AVPixelFormat libopenjpeg_all_pix_fmts[] = {RGB_PIXEL_FORMATS,
- GRAY_PIXEL_FORMATS,
- YUV_PIXEL_FORMATS,
- XYZ_PIXEL_FORMATS};
+static const enum AVPixelFormat libopenjpeg_rgb_pix_fmts[] = {
+ RGB_PIXEL_FORMATS
+};
+static const enum AVPixelFormat libopenjpeg_gray_pix_fmts[] = {
+ GRAY_PIXEL_FORMATS
+};
+static const enum AVPixelFormat libopenjpeg_yuv_pix_fmts[] = {
+ YUV_PIXEL_FORMATS
+};
+static const enum AVPixelFormat libopenjpeg_all_pix_fmts[] = {
+ RGB_PIXEL_FORMATS, GRAY_PIXEL_FORMATS, YUV_PIXEL_FORMATS, XYZ_PIXEL_FORMATS
+};
typedef struct {
AVClass *class;
@@ -86,18 +96,26 @@ static inline int libopenjpeg_matches_pix_fmt(const opj_image_t *image, enum AVP
}
switch (desc->nb_components) {
- case 4: match = match && desc->comp[3].depth_minus1 + 1 >= image->comps[3].prec &&
- 1 == image->comps[3].dx &&
- 1 == image->comps[3].dy;
- case 3: match = match && desc->comp[2].depth_minus1 + 1 >= image->comps[2].prec &&
- 1 << desc->log2_chroma_w == image->comps[2].dx &&
- 1 << desc->log2_chroma_h == image->comps[2].dy;
- case 2: match = match && desc->comp[1].depth_minus1 + 1 >= image->comps[1].prec &&
- 1 << desc->log2_chroma_w == image->comps[1].dx &&
- 1 << desc->log2_chroma_h == image->comps[1].dy;
- case 1: match = match && desc->comp[0].depth_minus1 + 1 >= image->comps[0].prec &&
- 1 == image->comps[0].dx &&
- 1 == image->comps[0].dy;
+ case 4:
+ match = match &&
+ desc->comp[3].depth_minus1 + 1 >= image->comps[3].prec &&
+ 1 == image->comps[3].dx &&
+ 1 == image->comps[3].dy;
+ case 3:
+ match = match &&
+ desc->comp[2].depth_minus1 + 1 >= image->comps[2].prec &&
+ 1 << desc->log2_chroma_w == image->comps[2].dx &&
+ 1 << desc->log2_chroma_h == image->comps[2].dy;
+ case 2:
+ match = match &&
+ desc->comp[1].depth_minus1 + 1 >= image->comps[1].prec &&
+ 1 << desc->log2_chroma_w == image->comps[1].dx &&
+ 1 << desc->log2_chroma_h == image->comps[1].dy;
+ case 1:
+ match = match &&
+ desc->comp[0].depth_minus1 + 1 >= image->comps[0].prec &&
+ 1 == image->comps[0].dx &&
+ 1 == image->comps[0].dy;
default:
break;
}
@@ -112,28 +130,27 @@ static inline enum AVPixelFormat libopenjpeg_guess_pix_fmt(const opj_image_t *im
switch (image->color_space) {
case CLRSPC_SRGB:
- possible_fmts = libopenjpeg_rgb_pix_fmts;
+ possible_fmts = libopenjpeg_rgb_pix_fmts;
possible_fmts_nb = FF_ARRAY_ELEMS(libopenjpeg_rgb_pix_fmts);
break;
case CLRSPC_GRAY:
- possible_fmts = libopenjpeg_gray_pix_fmts;
+ possible_fmts = libopenjpeg_gray_pix_fmts;
possible_fmts_nb = FF_ARRAY_ELEMS(libopenjpeg_gray_pix_fmts);
break;
case CLRSPC_SYCC:
- possible_fmts = libopenjpeg_yuv_pix_fmts;
+ possible_fmts = libopenjpeg_yuv_pix_fmts;
possible_fmts_nb = FF_ARRAY_ELEMS(libopenjpeg_yuv_pix_fmts);
break;
default:
- possible_fmts = libopenjpeg_all_pix_fmts;
+ possible_fmts = libopenjpeg_all_pix_fmts;
possible_fmts_nb = FF_ARRAY_ELEMS(libopenjpeg_all_pix_fmts);
break;
}
- for (index = 0; index < possible_fmts_nb; ++index) {
+ for (index = 0; index < possible_fmts_nb; ++index)
if (libopenjpeg_matches_pix_fmt(image, possible_fmts[index])) {
return possible_fmts[index];
}
- }
return AV_PIX_FMT_NONE;
}
@@ -147,10 +164,9 @@ static inline int libopenjpeg_ispacked(enum AVPixelFormat pix_fmt)
return 0;
component_plane = desc->comp[0].plane;
- for (i = 1; i < desc->nb_components; i++) {
+ for (i = 1; i < desc->nb_components; i++)
if (component_plane != desc->comp[i].plane)
return 0;
- }
return 1;
}
@@ -158,13 +174,11 @@ static inline void libopenjpeg_copy_to_packed8(AVFrame *picture, opj_image_t *im
uint8_t *img_ptr;
int index, x, y, c;
for (y = 0; y < picture->height; y++) {
- index = y*picture->width;
- img_ptr = picture->data[0] + y*picture->linesize[0];
- for (x = 0; x < picture->width; x++, index++) {
- for (c = 0; c < image->numcomps; c++) {
- *img_ptr++ = image->comps[c].data[index];
- }
- }
+ index = y * picture->width;
+ img_ptr = picture->data[0] + y * picture->linesize[0];
+ for (x = 0; x < picture->width; x++, index++)
+ for (c = 0; c < image->numcomps; c++)
+ *img_ptr++ = 0x80 * image->comps[c].sgnd + image->comps[c].data[index];
}
}
@@ -173,16 +187,15 @@ static inline void libopenjpeg_copy_to_packed16(AVFrame *picture, opj_image_t *i
int index, x, y, c;
int adjust[4];
for (x = 0; x < image->numcomps; x++)
- adjust[x] = FFMAX(FFMIN(16 - image->comps[x].prec, 8), 0);
+ adjust[x] = FFMAX(FFMIN(av_pix_fmt_desc_get(picture->format)->comp[x].depth_minus1 + 1 - image->comps[x].prec, 8), 0);
for (y = 0; y < picture->height; y++) {
- index = y*picture->width;
- img_ptr = (uint16_t*) (picture->data[0] + y*picture->linesize[0]);
- for (x = 0; x < picture->width; x++, index++) {
- for (c = 0; c < image->numcomps; c++) {
- *img_ptr++ = image->comps[c].data[index] << adjust[c];
- }
- }
+ index = y * picture->width;
+ img_ptr = (uint16_t *) (picture->data[0] + y * picture->linesize[0]);
+ for (x = 0; x < picture->width; x++, index++)
+ for (c = 0; c < image->numcomps; c++)
+ *img_ptr++ = (1 << image->comps[c].prec - 1) * image->comps[c].sgnd +
+ (unsigned)image->comps[c].data[index] << adjust[c];
}
}
@@ -196,7 +209,7 @@ static inline void libopenjpeg_copyto8(AVFrame *picture, opj_image_t *image) {
for (y = 0; y < image->comps[index].h; y++) {
img_ptr = picture->data[index] + y * picture->linesize[index];
for (x = 0; x < image->comps[index].w; x++) {
- *img_ptr = (uint8_t) *comp_data;
+ *img_ptr = 0x80 * image->comps[index].sgnd + *comp_data;
img_ptr++;
comp_data++;
}
@@ -210,14 +223,15 @@ static inline void libopenjpeg_copyto16(AVFrame *picture, opj_image_t *image) {
int index, x, y;
int adjust[4];
for (x = 0; x < image->numcomps; x++)
- adjust[x] = FFMAX(FFMIN(16 - image->comps[x].prec, 8), 0);
+ adjust[x] = FFMAX(FFMIN(av_pix_fmt_desc_get(picture->format)->comp[x].depth_minus1 + 1 - image->comps[x].prec, 8), 0);
for (index = 0; index < image->numcomps; index++) {
comp_data = image->comps[index].data;
for (y = 0; y < image->comps[index].h; y++) {
- img_ptr = (uint16_t*) (picture->data[index] + y * picture->linesize[index]);
+ img_ptr = (uint16_t *)(picture->data[index] + y * picture->linesize[index]);
for (x = 0; x < image->comps[index].w; x++) {
- *img_ptr = *comp_data << adjust[index];
+ *img_ptr = (1 << image->comps[index].prec - 1) * image->comps[index].sgnd +
+ (unsigned)*comp_data << adjust[index];
img_ptr++;
comp_data++;
}
@@ -237,24 +251,24 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
- uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
+ uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
LibOpenJPEGContext *ctx = avctx->priv_data;
- ThreadFrame frame = { .f = data };
- AVFrame *picture = data;
+ ThreadFrame frame = { .f = data };
+ AVFrame *picture = data;
const AVPixFmtDescriptor *desc;
opj_dinfo_t *dec;
opj_cio_t *stream;
opj_image_t *image;
int width, height, ret;
int pixel_size = 0;
- int ispacked = 0;
+ int ispacked = 0;
int i;
*got_frame = 0;
// Check if input is a raw jpeg2k codestream or in jp2 wrapping
- if ((AV_RB32(buf) == 12) &&
+ 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);
@@ -270,12 +284,12 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Error initializing decoder.\n");
return AVERROR_UNKNOWN;
}
- opj_set_event_mgr((opj_common_ptr)dec, NULL, NULL);
+ opj_set_event_mgr((opj_common_ptr) dec, NULL, NULL);
ctx->dec_params.cp_limit_decoding = LIMIT_TO_MAIN_HEADER;
ctx->dec_params.cp_layer = ctx->lowqual;
// Tie decoder with decoding parameters
opj_setup_decoder(dec, &ctx->dec_params);
- stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size);
+ stream = opj_cio_open((opj_common_ptr) dec, buf, buf_size);
if (!stream) {
av_log(avctx, AV_LOG_ERROR,
@@ -323,7 +337,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
ctx->dec_params.cp_reduce = avctx->lowres;
// Tie decoder with decoding parameters.
opj_setup_decoder(dec, &ctx->dec_params);
- stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size);
+ stream = opj_cio_open((opj_common_ptr) dec, buf, buf_size);
if (!stream) {
av_log(avctx, AV_LOG_ERROR,
"Codestream could not be opened for reading.\n");
@@ -342,9 +356,9 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
goto done;
}
- desc = av_pix_fmt_desc_get(avctx->pix_fmt);
+ desc = av_pix_fmt_desc_get(avctx->pix_fmt);
pixel_size = desc->comp[0].step_minus1 + 1;
- ispacked = libopenjpeg_ispacked(avctx->pix_fmt);
+ ispacked = libopenjpeg_ispacked(avctx->pix_fmt);
switch (pixel_size) {
case 1:
@@ -392,7 +406,8 @@ done:
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
- { "lowqual", "Limit the number of layers used for decoding", OFFSET(lowqual), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VD },
+ { "lowqual", "Limit the number of layers used for decoding",
+ OFFSET(lowqual), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VD },
{ NULL },
};
@@ -404,14 +419,14 @@ static const AVClass openjpeg_class = {
};
AVCodec ff_libopenjpeg_decoder = {
- .name = "libopenjpeg",
- .long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_JPEG2000,
- .priv_data_size = sizeof(LibOpenJPEGContext),
- .init = libopenjpeg_decode_init,
- .decode = libopenjpeg_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
- .max_lowres = 31,
- .priv_class = &openjpeg_class,
+ .name = "libopenjpeg",
+ .long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_JPEG2000,
+ .priv_data_size = sizeof(LibOpenJPEGContext),
+ .init = libopenjpeg_decode_init,
+ .decode = libopenjpeg_decode_frame,
+ .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .max_lowres = 31,
+ .priv_class = &openjpeg_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libopenjpegenc.c b/chromium/third_party/ffmpeg/libavcodec/libopenjpegenc.c
index 14579b68f31..ac77c7d1963 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libopenjpegenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libopenjpegenc.c
@@ -235,7 +235,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
}
opj_setup_encoder(ctx->compress, &ctx->enc_params, ctx->image);
- ctx->stream = opj_cio_open((opj_common_ptr)ctx->compress, NULL, 0);
+ ctx->stream = opj_cio_open((opj_common_ptr) ctx->compress, NULL, 0);
if (!ctx->stream) {
av_log(avctx, AV_LOG_ERROR, "Error creating the cio stream\n");
err = AVERROR(ENOMEM);
@@ -252,7 +252,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
ctx->event_mgr.info_handler = info_callback;
ctx->event_mgr.error_handler = error_callback;
ctx->event_mgr.warning_handler = warning_callback;
- opj_set_event_mgr((opj_common_ptr)ctx->compress, &ctx->event_mgr, avctx);
+ opj_set_event_mgr((opj_common_ptr) ctx->compress, &ctx->event_mgr, avctx);
return 0;
@@ -310,12 +310,11 @@ static int libopenjpeg_copy_packed8(AVCodecContext *avctx, const AVFrame *frame,
static int libopenjpeg_copy_packed12(AVCodecContext *avctx, const AVFrame *frame, opj_image_t *image)
{
int compno;
- int x;
- int y;
+ int x, y;
int *image_line;
int frame_index;
- const int numcomps = image->numcomps;
- uint16_t *frame_ptr = (uint16_t*)frame->data[0];
+ const int numcomps = image->numcomps;
+ uint16_t *frame_ptr = (uint16_t *)frame->data[0];
for (compno = 0; compno < numcomps; ++compno) {
if (image->comps[compno].w > frame->linesize[0] / numcomps) {
@@ -406,7 +405,7 @@ static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx, const AVFrame *fram
}
for (compno = 0; compno < numcomps; ++compno) {
- width = avctx->width / image->comps[compno].dx;
+ width = avctx->width / image->comps[compno].dx;
height = avctx->height / image->comps[compno].dy;
for (y = 0; y < height; ++y) {
image_line = image->comps[compno].data + y * image->comps[compno].w;
@@ -448,9 +447,9 @@ static int libopenjpeg_copy_unpacked16(AVCodecContext *avctx, const AVFrame *fra
}
for (compno = 0; compno < numcomps; ++compno) {
- width = avctx->width / image->comps[compno].dx;
- height = avctx->height / image->comps[compno].dy;
- frame_ptr = (uint16_t*)frame->data[compno];
+ width = avctx->width / image->comps[compno].dx;
+ height = avctx->height / image->comps[compno].dy;
+ frame_ptr = (uint16_t *)frame->data[compno];
for (y = 0; y < height; ++y) {
image_line = image->comps[compno].data + y * image->comps[compno].w;
frame_index = y * (frame->linesize[compno] / 2);
@@ -475,12 +474,12 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet)
{
LibOpenJPEGContext *ctx = avctx->priv_data;
- opj_cinfo_t *compress = ctx->compress;
- opj_image_t *image = ctx->image;
- opj_cio_t *stream = ctx->stream;
+ opj_cinfo_t *compress = ctx->compress;
+ opj_image_t *image = ctx->image;
+ opj_cio_t *stream = ctx->stream;
int cpyresult = 0;
int ret, len;
- AVFrame gbrframe;
+ AVFrame *gbrframe;
switch (avctx->pix_fmt) {
case AV_PIX_FMT_RGB24:
@@ -501,18 +500,21 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
case AV_PIX_FMT_GBRP12:
case AV_PIX_FMT_GBRP14:
case AV_PIX_FMT_GBRP16:
- gbrframe = *frame;
- gbrframe.data[0] = frame->data[2]; // swap to be rgb
- gbrframe.data[1] = frame->data[0];
- gbrframe.data[2] = frame->data[1];
- gbrframe.linesize[0] = frame->linesize[2];
- gbrframe.linesize[1] = frame->linesize[0];
- gbrframe.linesize[2] = frame->linesize[1];
+ gbrframe = av_frame_clone(frame);
+ if (!gbrframe)
+ return AVERROR(ENOMEM);
+ gbrframe->data[0] = frame->data[2]; // swap to be rgb
+ gbrframe->data[1] = frame->data[0];
+ gbrframe->data[2] = frame->data[1];
+ gbrframe->linesize[0] = frame->linesize[2];
+ gbrframe->linesize[1] = frame->linesize[0];
+ gbrframe->linesize[2] = frame->linesize[1];
if (avctx->pix_fmt == AV_PIX_FMT_GBR24P) {
- cpyresult = libopenjpeg_copy_unpacked8(avctx, &gbrframe, image);
+ cpyresult = libopenjpeg_copy_unpacked8(avctx, gbrframe, image);
} else {
- cpyresult = libopenjpeg_copy_unpacked16(avctx, &gbrframe, image);
+ cpyresult = libopenjpeg_copy_unpacked16(avctx, gbrframe, image);
}
+ av_frame_free(&gbrframe);
break;
case AV_PIX_FMT_GRAY8:
case AV_PIX_FMT_YUV410P:
@@ -645,8 +647,8 @@ AVCodec ff_libopenjpeg_encoder = {
.close = libopenjpeg_encode_close,
.capabilities = 0,
.pix_fmts = (const enum AVPixelFormat[]) {
- AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48, AV_PIX_FMT_RGBA64,
- AV_PIX_FMT_GBR24P,
+ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48,
+ AV_PIX_FMT_RGBA64, AV_PIX_FMT_GBR24P,
AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16,
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, AV_PIX_FMT_GRAY16,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libopusdec.c b/chromium/third_party/ffmpeg/libavcodec/libopusdec.c
index 2409de23a0f..8436302a9bd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libopusdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libopusdec.c
@@ -108,8 +108,8 @@ static av_cold int libopus_decode_init(AVCodecContext *avc)
}
#endif
- avc->internal->skip_samples = opus->pre_skip;
- avc->delay = 3840; /* Decoder delay (in samples) at 48kHz */
+ /* Decoder delay (in samples) at 48kHz */
+ avc->delay = avc->internal->skip_samples = opus->pre_skip;
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/libspeexdec.c b/chromium/third_party/ffmpeg/libavcodec/libspeexdec.c
index afe11761985..53e06d9b9e0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libspeexdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libspeexdec.c
@@ -43,7 +43,7 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx)
SpeexHeader *header = NULL;
int spx_mode;
- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+ avctx->sample_fmt = AV_SAMPLE_FMT_NONE;
if (avctx->extradata && avctx->extradata_size >= 80) {
header = speex_packet_to_header(avctx->extradata,
avctx->extradata_size);
@@ -125,6 +125,7 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
AVFrame *frame = data;
int16_t *output;
int ret, consumed = 0;
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
/* get output buffer */
frame->nb_samples = s->frame_size;
@@ -159,6 +160,8 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
*got_frame_ptr = 1;
+ if (!avctx->bit_rate)
+ speex_decoder_ctl(s->dec_state, SPEEX_GET_BITRATE, &avctx->bit_rate);
return consumed;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/libstagefright.cpp b/chromium/third_party/ffmpeg/libavcodec/libstagefright.cpp
index bb49d8a6258..346cc9ce607 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libstagefright.cpp
+++ b/chromium/third_party/ffmpeg/libavcodec/libstagefright.cpp
@@ -179,7 +179,7 @@ void* decode_thread(void *arg)
sp<MetaData> outFormat = (*s->decoder)->getFormat();
outFormat->findInt32(kKeyWidth , &w);
outFormat->findInt32(kKeyHeight, &h);
- frame->vframe = (AVFrame*)av_mallocz(sizeof(AVFrame));
+ frame->vframe = av_frame_alloc();
if (!frame->vframe) {
frame->status = AVERROR(ENOMEM);
decode_done = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/libtwolame.c b/chromium/third_party/ffmpeg/libavcodec/libtwolame.c
index dc4efe58bab..542abbc32a6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libtwolame.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libtwolame.c
@@ -26,22 +26,25 @@
#include <twolame.h>
+#include "libavutil/common.h"
#include "libavutil/opt.h"
+
#include "avcodec.h"
#include "internal.h"
#include "mpegaudio.h"
typedef struct TWOLAMEContext {
- AVClass *class;
- int mode;
- int psymodel;
- int energy;
- int error_protection;
- int copyright;
- int original;
+ AVClass *class;
+ int mode;
+ int psymodel;
+ int energy;
+ int error_protection;
+ int copyright;
+ int original;
+ int verbosity;
twolame_options *glopts;
- int64_t next_pts;
+ int64_t next_pts;
} TWOLAMEContext;
static av_cold int twolame_encode_close(AVCodecContext *avctx)
@@ -57,12 +60,13 @@ static av_cold int twolame_encode_init(AVCodecContext *avctx)
int ret;
avctx->frame_size = TWOLAME_SAMPLES_PER_FRAME;
+ avctx->delay = 512 - 32 + 1;
s->glopts = twolame_init();
if (!s->glopts)
return AVERROR(ENOMEM);
- twolame_set_verbosity(s->glopts, 0);
+ twolame_set_verbosity(s->glopts, s->verbosity);
twolame_set_mode(s->glopts, s->mode);
twolame_set_psymodel(s->glopts, s->psymodel);
twolame_set_energy_levels(s->glopts, s->energy);
@@ -75,19 +79,21 @@ static av_cold int twolame_encode_init(AVCodecContext *avctx)
twolame_set_out_samplerate(s->glopts, avctx->sample_rate);
if (avctx->flags & CODEC_FLAG_QSCALE || !avctx->bit_rate) {
twolame_set_VBR(s->glopts, TRUE);
- twolame_set_VBR_level(s->glopts, avctx->global_quality);
- av_log(avctx, AV_LOG_WARNING, "VBR mode is experimental!\n");
+ twolame_set_VBR_level(s->glopts,
+ avctx->global_quality / (float) FF_QP2LAMBDA);
+ av_log(avctx, AV_LOG_WARNING,
+ "VBR in MP2 is a hack, use another codec that supports it.\n");
} else {
twolame_set_bitrate(s->glopts, avctx->bit_rate / 1000);
}
- if ((ret = twolame_init_params(s->glopts)))
- goto error;
+ ret = twolame_init_params(s->glopts);
+ if (ret) {
+ twolame_encode_close(avctx);
+ return AVERROR_UNKNOWN;
+ }
return 0;
-error:
- twolame_encode_close(avctx);
- return ret;
}
static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
@@ -103,96 +109,117 @@ static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
switch (avctx->sample_fmt) {
case AV_SAMPLE_FMT_FLT:
ret = twolame_encode_buffer_float32_interleaved(s->glopts,
- frame->data[0],
- frame->nb_samples,
- avpkt->data, avpkt->size);
+ (const float *)frame->data[0],
+ frame->nb_samples,
+ avpkt->data,
+ avpkt->size);
break;
case AV_SAMPLE_FMT_FLTP:
ret = twolame_encode_buffer_float32(s->glopts,
- frame->data[0], frame->data[1],
- frame->nb_samples,
- avpkt->data, avpkt->size);
+ (const float *)frame->data[0],
+ (const float *)frame->data[1],
+ frame->nb_samples,
+ avpkt->data, avpkt->size);
break;
case AV_SAMPLE_FMT_S16:
ret = twolame_encode_buffer_interleaved(s->glopts,
- frame->data[0],
- frame->nb_samples,
- avpkt->data, avpkt->size);
+ (const short int *)frame->data[0],
+ frame->nb_samples,
+ avpkt->data, avpkt->size);
break;
case AV_SAMPLE_FMT_S16P:
ret = twolame_encode_buffer(s->glopts,
- frame->data[0], frame->data[1],
+ (const short int *)frame->data[0],
+ (const short int *)frame->data[1],
frame->nb_samples,
avpkt->data, avpkt->size);
break;
default:
+ av_log(avctx, AV_LOG_ERROR,
+ "Unsupported sample format %d.\n", avctx->sample_fmt);
return AVERROR_BUG;
}
} else {
ret = twolame_encode_flush(s->glopts, avpkt->data, avpkt->size);
}
- if (ret > 0) {
- avpkt->duration = ff_samples_to_time_base(avctx, avctx->frame_size);
- if (frame) {
- if (frame->pts != AV_NOPTS_VALUE)
- avpkt->pts = frame->pts;
- } else {
- avpkt->pts = s->next_pts;
- }
- if (avpkt->pts != AV_NOPTS_VALUE)
- s->next_pts = avpkt->pts + avpkt->duration;
-
- avpkt->size = ret;
- *got_packet_ptr = 1;
+ if (!ret) // no bytes written
return 0;
+ if (ret < 0) // twolame error
+ return AVERROR_UNKNOWN;
+
+ avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
+ if (frame) {
+ if (frame->pts != AV_NOPTS_VALUE)
+ avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
+ } else {
+ avpkt->pts = s->next_pts;
}
+ // this is for setting pts for flushed packet(s).
+ if (avpkt->pts != AV_NOPTS_VALUE)
+ s->next_pts = avpkt->pts + avpkt->duration;
- return ret;
+ av_shrink_packet(avpkt, ret);
+ *got_packet_ptr = 1;
+ return 0;
}
#define OFFSET(x) offsetof(TWOLAMEContext, x)
#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- { "mode", "Mpeg Mode", OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = TWOLAME_AUTO_MODE }, TWOLAME_AUTO_MODE, TWOLAME_MONO, AE, "mode"},
- { "auto", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_AUTO_MODE }, 0, 0, AE, "mode" },
- { "stereo", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_STEREO }, 0, 0, AE, "mode" },
- { "joint_stereo", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_JOINT_STEREO }, 0, 0, AE, "mode" },
- { "dual_channel", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_DUAL_CHANNEL }, 0, 0, AE, "mode" },
- { "mono", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_MONO }, 0, 0, AE, "mode" },
- { "psymodel", "Psychoacoustic Model", OFFSET(psymodel), AV_OPT_TYPE_INT, { .i64 = 3 }, -1, 4, AE},
- { "energy_levels","enable energy levels", OFFSET(energy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
+ { "mode", "Mpeg Mode", OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = TWOLAME_AUTO_MODE }, TWOLAME_AUTO_MODE, TWOLAME_MONO, AE, "mode"},
+ { "auto", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_AUTO_MODE }, 0, 0, AE, "mode" },
+ { "stereo", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_STEREO }, 0, 0, AE, "mode" },
+ { "joint_stereo", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_JOINT_STEREO }, 0, 0, AE, "mode" },
+ { "dual_channel", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_DUAL_CHANNEL }, 0, 0, AE, "mode" },
+ { "mono", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_MONO }, 0, 0, AE, "mode" },
+ { "psymodel", "Psychoacoustic Model", OFFSET(psymodel), AV_OPT_TYPE_INT, { .i64 = 3 }, -1, 4, AE},
+ { "energy_levels","enable energy levels", OFFSET(energy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
{ "error_protection","enable CRC error protection", OFFSET(error_protection), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
- { "copyright", "set MPEG Audio Copyright flag", OFFSET(copyright), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
- { "original", "set MPEG Audio Original flag", OFFSET(original), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
+ { "copyright", "set MPEG Audio Copyright flag", OFFSET(copyright), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
+ { "original", "set MPEG Audio Original flag", OFFSET(original), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
+ { "verbosity", "set library optput level (0-10)", OFFSET(verbosity), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 10, AE},
{ NULL },
};
-static const AVClass libtwolame_class = {
+static const AVClass twolame_class = {
.class_name = "libtwolame encoder",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
+static const AVCodecDefault twolame_defaults[] = {
+ { "b", "384000" },
+ { NULL },
+};
+
+static const int twolame_samplerates[] = {
+ 16000, 22050, 24000, 32000, 44100, 48000, 0
+};
+
AVCodec ff_libtwolame_encoder = {
- .name = "libtwolame",
- .long_name = NULL_IF_CONFIG_SMALL("libtwolame MP2 (MPEG audio layer 2)"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_MP2,
- .priv_data_size = sizeof(TWOLAMEContext),
- .init = twolame_encode_init,
- .encode2 = twolame_encode_frame,
- .close = twolame_encode_close,
- .capabilities = CODEC_CAP_DELAY,
- .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT,
- AV_SAMPLE_FMT_FLTP,
- AV_SAMPLE_FMT_S16,
- AV_SAMPLE_FMT_S16P,
- AV_SAMPLE_FMT_NONE },
- .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
- AV_CH_LAYOUT_STEREO,
- 0 },
- .supported_samplerates = (const int[]){ 16000, 22050, 24000, 32000, 44100, 48000, 0 },
- .priv_class = &libtwolame_class,
+ .name = "libtwolame",
+ .long_name = NULL_IF_CONFIG_SMALL("libtwolame MP2 (MPEG audio layer 2)"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_MP2,
+ .priv_data_size = sizeof(TWOLAMEContext),
+ .init = twolame_encode_init,
+ .encode2 = twolame_encode_frame,
+ .close = twolame_encode_close,
+ .capabilities = CODEC_CAP_DELAY,
+ .defaults = twolame_defaults,
+ .priv_class = &twolame_class,
+ .sample_fmts = (const enum AVSampleFormat[]) {
+ AV_SAMPLE_FMT_FLT,
+ AV_SAMPLE_FMT_FLTP,
+ AV_SAMPLE_FMT_S16,
+ AV_SAMPLE_FMT_S16P,
+ AV_SAMPLE_FMT_NONE
+ },
+ .channel_layouts = (const uint64_t[]) {
+ AV_CH_LAYOUT_MONO,
+ AV_CH_LAYOUT_STEREO,
+ 0 },
+ .supported_samplerates = twolame_samplerates,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libutvideodec.cpp b/chromium/third_party/ffmpeg/libavcodec/libutvideodec.cpp
index 0d8fa1a7f6e..60dbd15fa88 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libutvideodec.cpp
+++ b/chromium/third_party/ffmpeg/libavcodec/libutvideodec.cpp
@@ -164,7 +164,7 @@ static int utvideo_decode_frame(AVCodecContext *avctx, void *data,
}
*got_frame = 1;
- *(AVFrame *)data = *pic;
+ av_frame_move_ref((AVFrame*)data, pic);
return avpkt->size;
}
@@ -174,7 +174,7 @@ static av_cold int utvideo_decode_close(AVCodecContext *avctx)
UtVideoContext *utv = (UtVideoContext *)avctx->priv_data;
/* Free output */
- av_freep(&avctx->coded_frame);
+ av_frame_free(&avctx->coded_frame);
av_freep(&utv->buffer);
/* Finish decoding and clean up the instance */
diff --git a/chromium/third_party/ffmpeg/libavcodec/libutvideoenc.cpp b/chromium/third_party/ffmpeg/libavcodec/libutvideoenc.cpp
index ad70669a6b8..f0d56194b4a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libutvideoenc.cpp
+++ b/chromium/third_party/ffmpeg/libavcodec/libutvideoenc.cpp
@@ -44,12 +44,18 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
case AV_PIX_FMT_YUV420P:
in_format = UTVF_YV12;
avctx->bits_per_coded_sample = 12;
- avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
+ if (avctx->colorspace == AVCOL_SPC_BT709)
+ avctx->codec_tag = MKTAG('U', 'L', 'H', '0');
+ else
+ avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
break;
case AV_PIX_FMT_YUYV422:
in_format = UTVF_YUYV;
avctx->bits_per_coded_sample = 16;
- avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
+ if (avctx->colorspace == AVCOL_SPC_BT709)
+ avctx->codec_tag = MKTAG('U', 'L', 'H', '2');
+ else
+ avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
break;
case AV_PIX_FMT_BGR24:
in_format = UTVF_NFCC_BGR_BU;
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvorbisenc.c b/chromium/third_party/ffmpeg/libavcodec/libvorbisenc.c
index a2faac702b2..c655c21bd60 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvorbisenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvorbisenc.c
@@ -35,13 +35,12 @@
* an output packet will always start at the same point as one of the input
* packets.
*/
-#define OGGVORBIS_FRAME_SIZE 64
+#define LIBVORBIS_FRAME_SIZE 64
#define BUFFER_SIZE (1024 * 64)
-typedef struct OggVorbisEncContext {
+typedef struct LibvorbisEncContext {
AVClass *av_class; /**< class for AVOptions */
- AVFrame frame;
vorbis_info vi; /**< vorbis_info used during init */
vorbis_dsp_state vd; /**< DSP state used for analysis */
vorbis_block vb; /**< vorbis_block used for analysis */
@@ -52,10 +51,10 @@ typedef struct OggVorbisEncContext {
double iblock; /**< impulse block bias option */
VorbisParseContext vp; /**< parse context to get durations */
AudioFrameQueue afq; /**< frame queue for timestamps */
-} OggVorbisEncContext;
+} LibvorbisEncContext;
static const AVOption options[] = {
- { "iblock", "Sets the impulse block bias", offsetof(OggVorbisEncContext, iblock), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, -15, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
+ { "iblock", "Sets the impulse block bias", offsetof(LibvorbisEncContext, iblock), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, -15, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
};
@@ -81,10 +80,9 @@ static int vorbis_error_to_averror(int ov_err)
}
}
-static av_cold int oggvorbis_init_encoder(vorbis_info *vi,
- AVCodecContext *avctx)
+static av_cold int libvorbis_setup(vorbis_info *vi, AVCodecContext *avctx)
{
- OggVorbisEncContext *s = avctx->priv_data;
+ LibvorbisEncContext *s = avctx->priv_data;
double cfreq;
int ret;
@@ -173,9 +171,9 @@ static int xiph_len(int l)
return 1 + l / 255 + l;
}
-static av_cold int oggvorbis_encode_close(AVCodecContext *avctx)
+static av_cold int libvorbis_encode_close(AVCodecContext *avctx)
{
- OggVorbisEncContext *s = avctx->priv_data;
+ LibvorbisEncContext *s = avctx->priv_data;
/* notify vorbisenc this is EOF */
if (s->dsp_initialized)
@@ -185,23 +183,23 @@ static av_cold int oggvorbis_encode_close(AVCodecContext *avctx)
vorbis_dsp_clear(&s->vd);
vorbis_info_clear(&s->vi);
- av_fifo_free(s->pkt_fifo);
+ av_fifo_freep(&s->pkt_fifo);
ff_af_queue_close(&s->afq);
av_freep(&avctx->extradata);
return 0;
}
-static av_cold int oggvorbis_encode_init(AVCodecContext *avctx)
+static av_cold int libvorbis_encode_init(AVCodecContext *avctx)
{
- OggVorbisEncContext *s = avctx->priv_data;
+ LibvorbisEncContext *s = avctx->priv_data;
ogg_packet header, header_comm, header_code;
uint8_t *p;
unsigned int offset;
int ret;
vorbis_info_init(&s->vi);
- if ((ret = oggvorbis_init_encoder(&s->vi, avctx))) {
+ if ((ret = libvorbis_setup(&s->vi, avctx))) {
av_log(avctx, AV_LOG_ERROR, "encoder setup failed\n");
goto error;
}
@@ -255,7 +253,7 @@ static av_cold int oggvorbis_encode_init(AVCodecContext *avctx)
vorbis_comment_clear(&s->vc);
- avctx->frame_size = OGGVORBIS_FRAME_SIZE;
+ avctx->frame_size = LIBVORBIS_FRAME_SIZE;
ff_af_queue_init(avctx, &s->afq);
s->pkt_fifo = av_fifo_alloc(BUFFER_SIZE);
@@ -266,14 +264,14 @@ static av_cold int oggvorbis_encode_init(AVCodecContext *avctx)
return 0;
error:
- oggvorbis_encode_close(avctx);
+ libvorbis_encode_close(avctx);
return ret;
}
-static int oggvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const AVFrame *frame, int *got_packet_ptr)
{
- OggVorbisEncContext *s = avctx->priv_data;
+ LibvorbisEncContext *s = avctx->priv_data;
ogg_packet op;
int ret, duration;
@@ -366,10 +364,10 @@ AVCodec ff_libvorbis_encoder = {
.long_name = NULL_IF_CONFIG_SMALL("libvorbis"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_VORBIS,
- .priv_data_size = sizeof(OggVorbisEncContext),
- .init = oggvorbis_encode_init,
- .encode2 = oggvorbis_encode_frame,
- .close = oggvorbis_encode_close,
+ .priv_data_size = sizeof(LibvorbisEncContext),
+ .init = libvorbis_encode_init,
+ .encode2 = libvorbis_encode_frame,
+ .close = libvorbis_encode_close,
.capabilities = CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvpx.c b/chromium/third_party/ffmpeg/libavcodec/libvpx.c
index 9ff2e91bc47..5d298936022 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvpx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvpx.c
@@ -22,14 +22,9 @@
#include "libvpx.h"
-int ff_vp9_check_experimental(AVCodecContext *avctx)
+av_cold void ff_vp9_init_static(AVCodec *codec)
{
- if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL &&
- (vpx_codec_version_major() < 1 ||
- (vpx_codec_version_major() == 1 && vpx_codec_version_minor() < 3))) {
- av_log(avctx, AV_LOG_ERROR,
- "Non-experimental support of VP9 requires libvpx >= 1.3.0\n");
- return AVERROR_EXPERIMENTAL;
- }
- return 0;
+ if ( vpx_codec_version_major() < 1
+ || (vpx_codec_version_major() == 1 && vpx_codec_version_minor() < 3))
+ codec->capabilities |= CODEC_CAP_EXPERIMENTAL;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvpx.h b/chromium/third_party/ffmpeg/libavcodec/libvpx.h
index 2c901f92ef7..36a275c5d22 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvpx.h
+++ b/chromium/third_party/ffmpeg/libavcodec/libvpx.h
@@ -23,6 +23,6 @@
#include "avcodec.h"
-int ff_vp9_check_experimental(AVCodecContext *avctx);
+void ff_vp9_init_static(AVCodec *codec);
#endif /* AVCODEC_LIBVPX_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvpxdec.c b/chromium/third_party/ffmpeg/libavcodec/libvpxdec.c
index 8d608c38603..94e1e4d1efe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvpxdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvpxdec.c
@@ -133,9 +133,6 @@ AVCodec ff_libvpx_vp8_decoder = {
#if CONFIG_LIBVPX_VP9_DECODER
static av_cold int vp9_init(AVCodecContext *avctx)
{
- int ret;
- if ((ret = ff_vp9_check_experimental(avctx)))
- return ret;
return vpx_init(avctx, &vpx_codec_vp9_dx_algo);
}
@@ -149,5 +146,6 @@ AVCodec ff_libvpx_vp9_decoder = {
.close = vp8_free,
.decode = vp8_decode,
.capabilities = CODEC_CAP_AUTO_THREADS | CODEC_CAP_DR1,
+ .init_static_data = ff_vp9_init_static,
};
#endif /* CONFIG_LIBVPX_VP9_DECODER */
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c b/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c
index c7ca050b178..bc0cf96b064 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c
@@ -158,7 +158,7 @@ static av_cold void dump_enc_cfg(AVCodecContext *avctx,
width, "g_lag_in_frames:", cfg->g_lag_in_frames);
av_log(avctx, level, "rate control settings\n"
" %*s%u\n %*s%u\n %*s%u\n %*s%u\n"
- " %*s%d\n %*s%p(%zu)\n %*s%u\n",
+ " %*s%d\n %*s%p(%"SIZE_SPECIFIER")\n %*s%u\n",
width, "rc_dropframe_thresh:", cfg->rc_dropframe_thresh,
width, "rc_resize_allowed:", cfg->rc_resize_allowed,
width, "rc_resize_up_thresh:", cfg->rc_resize_up_thresh,
@@ -373,7 +373,7 @@ static av_cold int vpx_init(AVCodecContext *avctx,
ctx->twopass_stats.buf = av_malloc(ctx->twopass_stats.sz);
if (!ctx->twopass_stats.buf) {
av_log(avctx, AV_LOG_ERROR,
- "Stat buffer alloc (%zu bytes) failed\n",
+ "Stat buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n",
ctx->twopass_stats.sz);
return AVERROR(ENOMEM);
}
@@ -616,7 +616,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,
if (!cx_frame->buf) {
av_log(avctx, AV_LOG_ERROR,
- "Data buffer alloc (%zu bytes) failed\n",
+ "Data buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n",
cx_frame->sz);
av_free(cx_frame);
return AVERROR(ENOMEM);
@@ -626,7 +626,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,
cx_frame->buf_alpha = av_malloc(cx_frame->sz_alpha);
if (!cx_frame->buf_alpha) {
av_log(avctx, AV_LOG_ERROR,
- "Data buffer alloc (%zu bytes) failed\n",
+ "Data buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n",
cx_frame->sz_alpha);
av_free(cx_frame);
return AVERROR(ENOMEM);
@@ -852,9 +852,6 @@ AVCodec ff_libvpx_vp8_encoder = {
#if CONFIG_LIBVPX_VP9_ENCODER
static av_cold int vp9_init(AVCodecContext *avctx)
{
- int ret;
- if ((ret = ff_vp9_check_experimental(avctx)))
- return ret;
return vpx_init(avctx, &vpx_codec_vp9_cx_algo);
}
@@ -878,5 +875,6 @@ AVCodec ff_libvpx_vp9_encoder = {
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &class_vp9,
.defaults = defaults,
+ .init_static_data = ff_vp9_init_static,
};
#endif /* CONFIG_LIBVPX_VP9_ENCODER */
diff --git a/chromium/third_party/ffmpeg/libavcodec/libwebpenc.c b/chromium/third_party/ffmpeg/libavcodec/libwebpenc.c
new file mode 100644
index 00000000000..5283da50706
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/libwebpenc.c
@@ -0,0 +1,285 @@
+/*
+ * WebP encoding support via libwebp
+ * Copyright (c) 2013 Justin Ruggles <justin.ruggles@gmail.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
+ * WebP encoder using libwebp
+ */
+
+#include <webp/encode.h>
+
+#include "libavutil/common.h"
+#include "libavutil/frame.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
+#include "avcodec.h"
+#include "internal.h"
+
+typedef struct LibWebPContext {
+ AVClass *class; // class for AVOptions
+ float quality; // lossy quality 0 - 100
+ int lossless; // use lossless encoding
+ int preset; // configuration preset
+ int chroma_warning; // chroma linesize mismatch warning has been printed
+ int conversion_warning; // pixel format conversion warning has been printed
+ WebPConfig config; // libwebp configuration
+} LibWebPContext;
+
+static int libwebp_error_to_averror(int err)
+{
+ switch (err) {
+ case VP8_ENC_ERROR_OUT_OF_MEMORY:
+ case VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY:
+ return AVERROR(ENOMEM);
+ case VP8_ENC_ERROR_NULL_PARAMETER:
+ case VP8_ENC_ERROR_INVALID_CONFIGURATION:
+ case VP8_ENC_ERROR_BAD_DIMENSION:
+ return AVERROR(EINVAL);
+ }
+ return AVERROR_UNKNOWN;
+}
+
+static av_cold int libwebp_encode_init(AVCodecContext *avctx)
+{
+ LibWebPContext *s = avctx->priv_data;
+ int ret;
+
+ if (avctx->global_quality < 0)
+ avctx->global_quality = 75 * FF_QP2LAMBDA;
+ s->quality = av_clipf(avctx->global_quality / (float)FF_QP2LAMBDA,
+ 0.0f, 100.0f);
+
+ if (avctx->compression_level < 0 || avctx->compression_level > 6) {
+ av_log(avctx, AV_LOG_WARNING, "invalid compression level: %d\n",
+ avctx->compression_level);
+ avctx->compression_level = av_clip(avctx->compression_level, 0, 6);
+ }
+
+ if (s->preset >= WEBP_PRESET_DEFAULT) {
+ ret = WebPConfigPreset(&s->config, s->preset, s->quality);
+ if (!ret)
+ return AVERROR_UNKNOWN;
+ s->lossless = s->config.lossless;
+ s->quality = s->config.quality;
+ avctx->compression_level = s->config.method;
+ } else {
+ ret = WebPConfigInit(&s->config);
+ if (!ret)
+ return AVERROR_UNKNOWN;
+
+ s->config.lossless = s->lossless;
+ s->config.quality = s->quality;
+ s->config.method = avctx->compression_level;
+
+ ret = WebPValidateConfig(&s->config);
+ if (!ret)
+ return AVERROR(EINVAL);
+ }
+
+ av_log(avctx, AV_LOG_DEBUG, "%s - quality=%.1f method=%d\n",
+ s->lossless ? "Lossless" : "Lossy", s->quality,
+ avctx->compression_level);
+
+ return 0;
+}
+
+static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
+ const AVFrame *frame, int *got_packet)
+{
+ LibWebPContext *s = avctx->priv_data;
+ AVFrame *alt_frame = NULL;
+ WebPPicture *pic = NULL;
+ WebPMemoryWriter mw = { 0 };
+ int ret;
+
+ if (avctx->width > WEBP_MAX_DIMENSION || avctx->height > WEBP_MAX_DIMENSION) {
+ av_log(avctx, AV_LOG_ERROR, "Picture size is too large. Max is %dx%d.\n",
+ WEBP_MAX_DIMENSION, WEBP_MAX_DIMENSION);
+ return AVERROR(EINVAL);
+ }
+
+ pic = av_malloc(sizeof(*pic));
+ if (!pic)
+ return AVERROR(ENOMEM);
+
+ ret = WebPPictureInit(pic);
+ if (!ret) {
+ ret = AVERROR_UNKNOWN;
+ goto end;
+ }
+ pic->width = avctx->width;
+ pic->height = avctx->height;
+
+ if (avctx->pix_fmt == AV_PIX_FMT_RGB32) {
+ if (!s->lossless) {
+ /* libwebp will automatically convert RGB input to YUV when
+ encoding lossy. */
+ if (!s->conversion_warning) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Using libwebp for RGB-to-YUV conversion. You may want "
+ "to consider passing in YUV instead for lossy "
+ "encoding.\n");
+ s->conversion_warning = 1;
+ }
+ }
+ pic->use_argb = 1;
+ pic->argb = (uint32_t *)frame->data[0];
+ pic->argb_stride = frame->linesize[0] / 4;
+ } else {
+ if (frame->linesize[1] != frame->linesize[2]) {
+ if (!s->chroma_warning) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Copying frame due to differing chroma linesizes.\n");
+ s->chroma_warning = 1;
+ }
+ alt_frame = av_frame_alloc();
+ if (!alt_frame) {
+ ret = AVERROR(ENOMEM);
+ goto end;
+ }
+ alt_frame->width = frame->width;
+ alt_frame->height = frame->height;
+ alt_frame->format = frame->format;
+ ret = av_frame_get_buffer(alt_frame, 32);
+ if (ret < 0)
+ goto end;
+ av_frame_copy(alt_frame, frame);
+ frame = alt_frame;
+ }
+ pic->use_argb = 0;
+ pic->y = frame->data[0];
+ pic->u = frame->data[1];
+ pic->v = frame->data[2];
+ pic->y_stride = frame->linesize[0];
+ pic->uv_stride = frame->linesize[1];
+ if (avctx->pix_fmt == AV_PIX_FMT_YUVA420P) {
+ pic->colorspace = WEBP_YUV420A;
+ pic->a = frame->data[3];
+ pic->a_stride = frame->linesize[3];
+ } else {
+ pic->colorspace = WEBP_YUV420;
+ }
+
+ if (s->lossless) {
+ /* We do not have a way to automatically prioritize RGB over YUV
+ in automatic pixel format conversion based on whether we're
+ encoding lossless or lossy, so we do conversion with libwebp as
+ a convenience. */
+ if (!s->conversion_warning) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Using libwebp for YUV-to-RGB conversion. You may want "
+ "to consider passing in RGB instead for lossless "
+ "encoding.\n");
+ s->conversion_warning = 1;
+ }
+
+#if (WEBP_ENCODER_ABI_VERSION <= 0x201)
+ /* libwebp should do the conversion automatically, but there is a
+ bug that causes it to return an error instead, so a work-around
+ is required.
+ See https://code.google.com/p/webp/issues/detail?id=178 */
+ pic->memory_ = (void*)1; /* something non-null */
+ ret = WebPPictureYUVAToARGB(pic);
+ if (!ret) {
+ av_log(avctx, AV_LOG_ERROR,
+ "WebPPictureYUVAToARGB() failed with error: %d\n",
+ pic->error_code);
+ ret = libwebp_error_to_averror(pic->error_code);
+ goto end;
+ }
+ pic->memory_ = NULL; /* restore pointer */
+#endif
+ }
+ }
+
+ WebPMemoryWriterInit(&mw);
+ pic->custom_ptr = &mw;
+ pic->writer = WebPMemoryWrite;
+
+ ret = WebPEncode(&s->config, pic);
+ if (!ret) {
+ av_log(avctx, AV_LOG_ERROR, "WebPEncode() failed with error: %d\n",
+ pic->error_code);
+ ret = libwebp_error_to_averror(pic->error_code);
+ goto end;
+ }
+
+ ret = ff_alloc_packet(pkt, mw.size);
+ if (ret < 0)
+ goto end;
+ memcpy(pkt->data, mw.mem, mw.size);
+
+ pkt->flags |= AV_PKT_FLAG_KEY;
+ *got_packet = 1;
+
+end:
+ free(mw.mem); /* must use free() according to libwebp documentation */
+ WebPPictureFree(pic);
+ av_freep(&pic);
+ av_frame_free(&alt_frame);
+
+ return ret;
+}
+
+#define OFFSET(x) offsetof(LibWebPContext, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "lossless", "Use lossless mode", OFFSET(lossless), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+ { "preset", "Configuration preset", OFFSET(preset), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, WEBP_PRESET_TEXT, VE, "preset" },
+ { "none", "do not use a preset", 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, 0, 0, VE, "preset" },
+ { "default", "default preset", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_DEFAULT }, 0, 0, VE, "preset" },
+ { "picture", "digital picture, like portrait, inner shot", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_PICTURE }, 0, 0, VE, "preset" },
+ { "photo", "outdoor photograph, with natural lighting", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_PHOTO }, 0, 0, VE, "preset" },
+ { "drawing", "hand or line drawing, with high-contrast details", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_DRAWING }, 0, 0, VE, "preset" },
+ { "icon", "small-sized colorful images", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_ICON }, 0, 0, VE, "preset" },
+ { "text", "text-like", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_TEXT }, 0, 0, VE, "preset" },
+ { NULL },
+};
+
+static const AVClass class = {
+ .class_name = "libwebp",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static const AVCodecDefault libwebp_defaults[] = {
+ { "compression_level", "4" },
+ { "global_quality", "-1" },
+ { NULL },
+};
+
+AVCodec ff_libwebp_encoder = {
+ .name = "libwebp",
+ .long_name = NULL_IF_CONFIG_SMALL("libwebp WebP image"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_WEBP,
+ .priv_data_size = sizeof(LibWebPContext),
+ .init = libwebp_encode_init,
+ .encode2 = libwebp_encode_frame,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_RGB32,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P,
+ AV_PIX_FMT_NONE
+ },
+ .priv_class = &class,
+ .defaults = libwebp_defaults,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libx264.c b/chromium/third_party/ffmpeg/libavcodec/libx264.c
index 89df55fac6c..474c247f453 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libx264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libx264.c
@@ -19,10 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/eval.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
+#include "libavutil/stereo3d.h"
#include "avcodec.h"
#include "internal.h"
@@ -161,6 +163,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x264_nal_t *nal;
int nnal, i, ret;
x264_picture_t pic_out = {0};
+ AVFrameSideData *side_data;
x264_picture_init( &x4->pic );
x4->pic.img.i_csp = x4->params.i_csp;
@@ -190,8 +193,42 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x4->params.vui.i_sar_width = ctx->sample_aspect_ratio.num;
x264_encoder_reconfig(x4->enc, &x4->params);
}
- }
+ side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_STEREO3D);
+ if (side_data) {
+ AVStereo3D *stereo = (AVStereo3D *)side_data->data;
+ int fpa_type;
+
+ switch (stereo->type) {
+ case AV_STEREO3D_CHECKERBOARD:
+ fpa_type = 0;
+ break;
+ case AV_STEREO3D_LINES:
+ fpa_type = 1;
+ break;
+ case AV_STEREO3D_COLUMNS:
+ fpa_type = 2;
+ break;
+ case AV_STEREO3D_SIDEBYSIDE:
+ fpa_type = 3;
+ break;
+ case AV_STEREO3D_TOPBOTTOM:
+ fpa_type = 4;
+ break;
+ case AV_STEREO3D_FRAMESEQUENCE:
+ fpa_type = 5;
+ break;
+ default:
+ fpa_type = -1;
+ break;
+ }
+
+ if (fpa_type != x4->params.i_frame_packing) {
+ x4->params.i_frame_packing = fpa_type;
+ x264_encoder_reconfig(x4->enc, &x4->params);
+ }
+ }
+ }
do {
if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
return -1;
@@ -294,6 +331,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
X264Context *x4 = avctx->priv_data;
int sw,sh;
+ if (avctx->global_quality > 0)
+ av_log(avctx, AV_LOG_WARNING, "-qscale is ignored, -crf is recommended.\n");
+
x264_param_default(&x4->params);
x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER;
@@ -355,19 +395,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
OPT_STR("level", x4->level);
- if(x4->x264opts){
- const char *p= x4->x264opts;
- while(p){
- char param[256]={0}, val[256]={0};
- if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
- OPT_STR(param, "1");
- }else
- OPT_STR(param, val);
- p= strchr(p, ':');
- p+=!!p;
- }
- }
-
if (avctx->i_quant_factor > 0)
x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor);
@@ -400,6 +427,28 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.rc.f_qcompress = avctx->qcompress; /* 0.0 => cbr, 1.0 => constant qp */
if (avctx->refs >= 0)
x4->params.i_frame_reference = avctx->refs;
+ else if (x4->level) {
+ int i;
+ int mbn = FF_CEIL_RSHIFT(avctx->width, 4) * FF_CEIL_RSHIFT(avctx->height, 4);
+ int level_id = -1;
+ char *tail;
+ int scale = X264_BUILD < 129 ? 384 : 1;
+
+ if (!strcmp(x4->level, "1b")) {
+ level_id = 9;
+ } else if (strlen(x4->level) <= 3){
+ level_id = av_strtod(x4->level, &tail) * 10 + 0.5;
+ if (*tail)
+ level_id = -1;
+ }
+ if (level_id <= 0)
+ av_log(avctx, AV_LOG_WARNING, "Failed to parse level\n");
+
+ for (i = 0; i<x264_levels[i].level_idc; i++)
+ if (x264_levels[i].level_idc == level_id)
+ x4->params.i_frame_reference = av_clip(x264_levels[i].dpb / mbn / scale, 1, x4->params.i_frame_reference);
+ }
+
if (avctx->trellis >= 0)
x4->params.analyse.i_trellis = avctx->trellis;
if (avctx->me_range >= 0)
@@ -521,8 +570,10 @@ static av_cold int X264_init(AVCodecContext *avctx)
av_reduce(&sw, &sh, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 4096);
x4->params.vui.i_sar_width = sw;
x4->params.vui.i_sar_height = sh;
- x4->params.i_fps_num = x4->params.i_timebase_den = avctx->time_base.den;
- x4->params.i_fps_den = x4->params.i_timebase_num = avctx->time_base.num;
+ x4->params.i_timebase_den = avctx->time_base.den;
+ x4->params.i_timebase_num = avctx->time_base.num;
+ x4->params.i_fps_num = avctx->time_base.den;
+ x4->params.i_fps_den = avctx->time_base.num * avctx->ticks_per_frame;
x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR;
@@ -538,11 +589,32 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.vui.b_fullrange = avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ444P;
+ avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
+ avctx->color_range == AVCOL_RANGE_JPEG;
+
+ if (avctx->colorspace != AVCOL_SPC_UNSPECIFIED)
+ x4->params.vui.i_colmatrix = avctx->colorspace;
+ if (avctx->color_primaries != AVCOL_PRI_UNSPECIFIED)
+ x4->params.vui.i_colorprim = avctx->color_primaries;
+ if (avctx->color_trc != AVCOL_TRC_UNSPECIFIED)
+ x4->params.vui.i_transfer = avctx->color_trc;
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
x4->params.b_repeat_headers = 0;
+ if(x4->x264opts){
+ const char *p= x4->x264opts;
+ while(p){
+ char param[256]={0}, val[256]={0};
+ if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
+ OPT_STR(param, "1");
+ }else
+ OPT_STR(param, val);
+ p= strchr(p, ':');
+ p+=!!p;
+ }
+ }
+
if (x4->x264_params) {
AVDictionary *dict = NULL;
AVDictionaryEntry *en = NULL;
diff --git a/chromium/third_party/ffmpeg/libavcodec/libx265.c b/chromium/third_party/ffmpeg/libavcodec/libx265.c
new file mode 100644
index 00000000000..4de504a9fe1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/libx265.c
@@ -0,0 +1,313 @@
+/*
+ * libx265 encoder
+ *
+ * Copyright (c) 2013-2014 Derek Buitenhuis
+ *
+ * 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 <x265.h>
+
+#include "libavutil/internal.h"
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+#include "avcodec.h"
+#include "internal.h"
+
+#if defined(_MSC_VER)
+#define X265_API_IMPORTS 1
+#endif
+
+typedef struct libx265Context {
+ const AVClass *class;
+
+ x265_encoder *encoder;
+ x265_param *params;
+
+ char *preset;
+ char *tune;
+ char *x265_opts;
+} libx265Context;
+
+static int is_keyframe(NalUnitType naltype)
+{
+ switch (naltype) {
+ case NAL_UNIT_CODED_SLICE_BLA_W_LP:
+ case NAL_UNIT_CODED_SLICE_BLA_W_RADL:
+ case NAL_UNIT_CODED_SLICE_BLA_N_LP:
+ case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
+ case NAL_UNIT_CODED_SLICE_IDR_N_LP:
+ case NAL_UNIT_CODED_SLICE_CRA:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+static av_cold int libx265_encode_close(AVCodecContext *avctx)
+{
+ libx265Context *ctx = avctx->priv_data;
+
+ av_frame_free(&avctx->coded_frame);
+
+ x265_param_free(ctx->params);
+
+ if (ctx->encoder)
+ x265_encoder_close(ctx->encoder);
+
+ return 0;
+}
+
+static av_cold int libx265_encode_init(AVCodecContext *avctx)
+{
+ libx265Context *ctx = avctx->priv_data;
+ x265_nal *nal;
+ char sar[12];
+ int sar_num, sar_den;
+ int nnal;
+
+ if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL &&
+ !av_pix_fmt_desc_get(avctx->pix_fmt)->log2_chroma_w &&
+ !av_pix_fmt_desc_get(avctx->pix_fmt)->log2_chroma_h) {
+ av_log(avctx, AV_LOG_ERROR,
+ "4:4:4 support is not fully defined for HEVC yet. "
+ "Set -strict experimental to encode anyway.\n");
+ return AVERROR(ENOSYS);
+ }
+
+ avctx->coded_frame = av_frame_alloc();
+ if (!avctx->coded_frame) {
+ av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
+ return AVERROR(ENOMEM);
+ }
+
+ ctx->params = x265_param_alloc();
+ if (!ctx->params) {
+ av_log(avctx, AV_LOG_ERROR, "Could not allocate x265 param structure.\n");
+ return AVERROR(ENOMEM);
+ }
+
+ if (x265_param_default_preset(ctx->params, ctx->preset, ctx->tune) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid preset or tune.\n");
+ return AVERROR(EINVAL);
+ }
+
+ ctx->params->frameNumThreads = avctx->thread_count;
+ ctx->params->fpsNum = avctx->time_base.den;
+ ctx->params->fpsDenom = avctx->time_base.num * avctx->ticks_per_frame;
+ ctx->params->sourceWidth = avctx->width;
+ ctx->params->sourceHeight = avctx->height;
+
+ if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) {
+ av_reduce(&sar_num, &sar_den,
+ avctx->sample_aspect_ratio.num,
+ avctx->sample_aspect_ratio.den, 65535);
+ snprintf(sar, sizeof(sar), "%d:%d", sar_num, sar_den);
+ if (x265_param_parse(ctx->params, "sar", sar) == X265_PARAM_BAD_VALUE) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid SAR: %d:%d.\n", sar_num, sar_den);
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ if (x265_max_bit_depth == 8)
+ ctx->params->internalBitDepth = 8;
+ else if (x265_max_bit_depth == 12)
+ ctx->params->internalBitDepth = 10;
+
+ switch (avctx->pix_fmt) {
+ case AV_PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUV420P10:
+ ctx->params->internalCsp = X265_CSP_I420;
+ break;
+ case AV_PIX_FMT_YUV444P:
+ case AV_PIX_FMT_YUV444P10:
+ ctx->params->internalCsp = X265_CSP_I444;
+ break;
+ }
+
+ if (avctx->bit_rate > 0) {
+ ctx->params->rc.bitrate = avctx->bit_rate / 1000;
+ ctx->params->rc.rateControlMode = X265_RC_ABR;
+ }
+
+ if (!(avctx->flags & CODEC_FLAG_GLOBAL_HEADER))
+ ctx->params->bRepeatHeaders = 1;
+
+ if (ctx->x265_opts) {
+ AVDictionary *dict = NULL;
+ AVDictionaryEntry *en = NULL;
+
+ if (!av_dict_parse_string(&dict, ctx->x265_opts, "=", ":", 0)) {
+ while ((en = av_dict_get(dict, "", en, AV_DICT_IGNORE_SUFFIX))) {
+ int parse_ret = x265_param_parse(ctx->params, en->key, en->value);
+
+ switch (parse_ret) {
+ case X265_PARAM_BAD_NAME:
+ av_log(avctx, AV_LOG_WARNING,
+ "Unknown option: %s.\n", en->key);
+ break;
+ case X265_PARAM_BAD_VALUE:
+ av_log(avctx, AV_LOG_WARNING,
+ "Invalid value for %s: %s.\n", en->key, en->value);
+ break;
+ default:
+ break;
+ }
+ }
+ av_dict_free(&dict);
+ }
+ }
+
+ ctx->encoder = x265_encoder_open(ctx->params);
+ if (!ctx->encoder) {
+ av_log(avctx, AV_LOG_ERROR, "Cannot open libx265 encoder.\n");
+ libx265_encode_close(avctx);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ avctx->extradata_size = x265_encoder_headers(ctx->encoder, &nal, &nnal);
+ if (avctx->extradata_size <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "Cannot encode headers.\n");
+ libx265_encode_close(avctx);
+ return AVERROR_INVALIDDATA;
+ }
+
+ avctx->extradata = av_malloc(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!avctx->extradata) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Cannot allocate HEVC header of size %d.\n", avctx->extradata_size);
+ libx265_encode_close(avctx);
+ return AVERROR(ENOMEM);
+ }
+
+ memcpy(avctx->extradata, nal[0].payload, avctx->extradata_size);
+ }
+
+ return 0;
+}
+
+static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
+ const AVFrame *pic, int *got_packet)
+{
+ libx265Context *ctx = avctx->priv_data;
+ x265_picture x265pic;
+ x265_picture x265pic_out = { { 0 } };
+ x265_nal *nal;
+ uint8_t *dst;
+ int payload = 0;
+ int nnal;
+ int ret;
+ int i;
+
+ x265_picture_init(ctx->params, &x265pic);
+
+ if (pic) {
+ for (i = 0; i < 3; i++) {
+ x265pic.planes[i] = pic->data[i];
+ x265pic.stride[i] = pic->linesize[i];
+ }
+
+ x265pic.pts = pic->pts;
+ x265pic.bitDepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth_minus1 + 1;
+ }
+
+ ret = x265_encoder_encode(ctx->encoder, &nal, &nnal,
+ pic ? &x265pic : NULL, &x265pic_out);
+ if (ret < 0)
+ return AVERROR_EXTERNAL;
+
+ if (!nnal)
+ return 0;
+
+ for (i = 0; i < nnal; i++)
+ payload += nal[i].sizeBytes;
+
+ ret = ff_alloc_packet(pkt, payload);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
+ return ret;
+ }
+ dst = pkt->data;
+
+ for (i = 0; i < nnal; i++) {
+ memcpy(dst, nal[i].payload, nal[i].sizeBytes);
+ dst += nal[i].sizeBytes;
+
+ if (is_keyframe(nal[i].type))
+ pkt->flags |= AV_PKT_FLAG_KEY;
+ }
+
+ pkt->pts = x265pic_out.pts;
+ pkt->dts = x265pic_out.dts;
+
+ *got_packet = 1;
+ return 0;
+}
+
+static const enum AVPixelFormat x265_csp_eight[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat x265_csp_twelve[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUV420P10,
+ AV_PIX_FMT_YUV444P10,
+ AV_PIX_FMT_NONE
+};
+
+static av_cold void libx265_encode_init_csp(AVCodec *codec)
+{
+ if (x265_max_bit_depth == 8)
+ codec->pix_fmts = x265_csp_eight;
+ else if (x265_max_bit_depth == 12)
+ codec->pix_fmts = x265_csp_twelve;
+}
+
+#define OFFSET(x) offsetof(libx265Context, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "preset", "set the x265 preset", OFFSET(preset), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
+ { "tune", "set the x265 tune parameter", OFFSET(tune), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
+ { "x265-params", "set the x265 configuration using a :-separated list of key=value parameters", OFFSET(x265_opts), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
+ { NULL }
+};
+
+static const AVClass class = {
+ .class_name = "libx265",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_libx265_encoder = {
+ .name = "libx265",
+ .long_name = NULL_IF_CONFIG_SMALL("libx265 H.265 / HEVC"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_HEVC,
+ .init = libx265_encode_init,
+ .init_static_data = libx265_encode_init_csp,
+ .encode2 = libx265_encode_frame,
+ .close = libx265_encode_close,
+ .priv_data_size = sizeof(libx265Context),
+ .priv_class = &class,
+ .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libxavs.c b/chromium/third_party/ffmpeg/libavcodec/libxavs.c
index ffe3411c960..92dceceac17 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libxavs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libxavs.c
@@ -353,7 +353,7 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
if (!x4->enc)
return -1;
- if (!(x4->pts_buffer = av_mallocz((avctx->max_b_frames+1) * sizeof(*x4->pts_buffer))))
+ if (!(x4->pts_buffer = av_mallocz_array((avctx->max_b_frames+1), sizeof(*x4->pts_buffer))))
return AVERROR(ENOMEM);
avctx->coded_frame = av_frame_alloc();
diff --git a/chromium/third_party/ffmpeg/libavcodec/libxvid.c b/chromium/third_party/ffmpeg/libavcodec/libxvid.c
index 40b3bffacf1..88d748e8b89 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libxvid.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libxvid.c
@@ -48,6 +48,7 @@
* This stores all the private context for the codec.
*/
struct xvid_context {
+ AVClass *class;
void *encoder_handle; /**< Handle for Xvid encoder */
int xsize; /**< Frame x size */
int ysize; /**< Frame y size */
@@ -66,6 +67,7 @@ struct xvid_context {
int variance_aq; /**< Variance adaptive quantization */
int ssim; /**< SSIM information display mode */
int ssim_acc; /**< SSIM accuracy. 0: accurate. 4: fast. */
+ int gmc;
};
/**
@@ -421,8 +423,13 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
}
/* Bring in VOL flags from ffmpeg command-line */
+#if FF_API_GMC
+ if (avctx->flags & CODEC_FLAG_GMC)
+ x->gmc = 1;
+#endif
+
x->vol_flags = 0;
- if( xvid_flags & CODEC_FLAG_GMC ) {
+ if (x->gmc) {
x->vol_flags |= XVID_VOL_GMC;
x->me_flags |= XVID_ME_GME_REFINE;
}
@@ -530,25 +537,26 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
xvid_enc_create.num_plugins++;
}
- if ( avctx->lumi_masking != 0.0)
+ if (avctx->lumi_masking != 0.0)
x->lumi_aq = 1;
/* Luminance Masking */
- if( x->lumi_aq ) {
+ if (x->lumi_aq) {
masking_l.method = 0;
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_lumimasking;
/* The old behavior is that when avctx->lumi_masking is specified,
* plugins[...].param = NULL. Trying to keep the old behavior here. */
- plugins[xvid_enc_create.num_plugins].param = avctx->lumi_masking ? NULL : &masking_l ;
- xvid_enc_create.num_plugins++;
+ plugins[xvid_enc_create.num_plugins].param = avctx->lumi_masking ? NULL
+ : &masking_l;
+ xvid_enc_create.num_plugins++;
}
/* Variance AQ */
- if( x->variance_aq ) {
+ if (x->variance_aq) {
masking_v.method = 1;
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_lumimasking;
- plugins[xvid_enc_create.num_plugins].param = &masking_v ;
+ plugins[xvid_enc_create.num_plugins].param = &masking_v;
xvid_enc_create.num_plugins++;
}
@@ -558,9 +566,9 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
"will be the worse one of the two effects made by the AQ.\n");
/* SSIM */
- if( x->ssim ) {
+ if (x->ssim) {
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_ssim;
- ssim.b_printstat = ( x->ssim == 2 );
+ ssim.b_printstat = x->ssim == 2;
ssim.acc = x->ssim_acc;
ssim.cpu_flags = xvid_gbl_init.cpu_flags;
ssim.b_visualize = 0;
@@ -687,7 +695,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* Initialize input image fields */
if( avctx->pix_fmt != AV_PIX_FMT_YUV420P ) {
av_log(avctx, AV_LOG_ERROR, "Xvid: Color spaces other than 420p not supported\n");
- return -1;
+ return AVERROR(EINVAL);
}
xvid_enc_frame.input.csp = XVID_CSP_PLANAR; /* YUV420P */
@@ -774,7 +782,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (!xerr)
return 0;
av_log(avctx, AV_LOG_ERROR, "Xvid: Encoding Error Occurred: %i\n", xerr);
- return -1;
+ return AVERROR_EXTERNAL;
}
}
@@ -813,6 +821,7 @@ static const AVOption options[] = {
{ "avg", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "ssim" },
{ "frame", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "ssim" },
{ "ssim_acc", "SSIM accuracy", OFFSET(ssim_acc), AV_OPT_TYPE_INT, { .i64 = 2 }, 0, 4, VE },
+ { "gmc", "use GMC", OFFSET(gmc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libzvbi-teletextdec.c b/chromium/third_party/ffmpeg/libavcodec/libzvbi-teletextdec.c
index bf2dc063ab5..e65e3fb55f3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libzvbi-teletextdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libzvbi-teletextdec.c
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avcodec.h"
@@ -23,6 +23,7 @@
#include "libavutil/opt.h"
#include "libavutil/bprint.h"
#include "libavutil/intreadwrite.h"
+#include "libavutil/log.h"
#include <libzvbi.h>
@@ -34,6 +35,9 @@
#define VBI_B(rgba) (((rgba) >> 16) & 0xFF)
#define VBI_A(rgba) (((rgba) >> 24) & 0xFF)
#define MAX_BUFFERED_PAGES 25
+#define BITMAP_CHAR_WIDTH 12
+#define BITMAP_CHAR_HEIGHT 10
+#define MAX_SLICES 64
typedef struct TeletextPage
{
@@ -43,7 +47,6 @@ typedef struct TeletextPage
int64_t pts;
} TeletextPage;
-/* main data structure */
typedef struct TeletextContext
{
AVClass *class;
@@ -63,18 +66,13 @@ typedef struct TeletextContext
int handler_ret;
vbi_decoder * vbi;
- vbi_dvb_demux * dx;
#ifdef DEBUG
vbi_export * ex;
#endif
- /* Don't even _think_ about making sliced stack-local! */
- vbi_sliced sliced[64];
+ vbi_sliced sliced[MAX_SLICES];
} TeletextContext;
-/************************************************************************/
-
-static int
-chop_spaces_utf8(const unsigned char* t, int len)
+static int chop_spaces_utf8(const unsigned char* t, int len)
{
t += len;
while (len > 0) {
@@ -85,8 +83,7 @@ chop_spaces_utf8(const unsigned char* t, int len)
return len;
}
-static void
-subtitle_rect_free(AVSubtitleRect **sub_rect)
+static void subtitle_rect_free(AVSubtitleRect **sub_rect)
{
av_freep(&(*sub_rect)->pict.data[0]);
av_freep(&(*sub_rect)->pict.data[1]);
@@ -94,8 +91,7 @@ subtitle_rect_free(AVSubtitleRect **sub_rect)
av_freep(sub_rect);
}
-static int
-create_ass_text(TeletextContext *ctx, const char *text, char **ass)
+static int create_ass_text(TeletextContext *ctx, const char *text, char **ass)
{
int ret;
AVBPrint buf, buf2;
@@ -127,9 +123,8 @@ create_ass_text(TeletextContext *ctx, const char *text, char **ass)
return 0;
}
-// draw a page as text
-static int
-gen_sub_text(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page, int chop_top)
+/* Draw a page as text */
+static int gen_sub_text(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page, int chop_top)
{
const char *in;
AVBPrint buf;
@@ -195,21 +190,21 @@ gen_sub_text(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page, int
return 0;
}
-static void
-fix_transparency(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page, int chop_top, uint8_t transparent_color, int resx, int resy)
+static void fix_transparency(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page,
+ int chop_top, uint8_t transparent_color, int resx, int resy)
{
int iy;
// Hack for transparency, inspired by VLC code...
for (iy = 0; iy < resy; iy++) {
uint8_t *pixel = sub_rect->pict.data[0] + iy * sub_rect->pict.linesize[0];
- vbi_char *vc = page->text + (iy / 10 + chop_top) * page->columns;
+ vbi_char *vc = page->text + (iy / BITMAP_CHAR_HEIGHT + chop_top) * page->columns;
vbi_char *vcnext = vc + page->columns;
for (; vc < vcnext; vc++) {
- uint8_t *pixelnext = pixel + 12;
+ uint8_t *pixelnext = pixel + BITMAP_CHAR_WIDTH;
switch (vc->opacity) {
case VBI_TRANSPARENT_SPACE:
- memset(pixel, transparent_color, 12);
+ memset(pixel, transparent_color, BITMAP_CHAR_WIDTH);
break;
case VBI_OPAQUE:
case VBI_SEMI_TRANSPARENT:
@@ -226,12 +221,11 @@ fix_transparency(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page,
}
}
-// draw a page as bitmap
-static int
-gen_sub_bitmap(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page, int chop_top)
+/* Draw a page as bitmap */
+static int gen_sub_bitmap(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page, int chop_top)
{
- int resx = page->columns * 12;
- int resy = (page->rows - chop_top) * 10;
+ int resx = page->columns * BITMAP_CHAR_WIDTH;
+ int resy = (page->rows - chop_top) * BITMAP_CHAR_HEIGHT;
uint8_t ci, cmax = 0;
int ret;
vbi_char *vc = page->text + (chop_top * page->columns);
@@ -262,7 +256,7 @@ gen_sub_bitmap(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page, i
fix_transparency(ctx, sub_rect, page, chop_top, cmax, resx, resy);
sub_rect->x = ctx->x_offset;
- sub_rect->y = ctx->y_offset;
+ sub_rect->y = ctx->y_offset + chop_top * BITMAP_CHAR_HEIGHT;
sub_rect->w = resx;
sub_rect->h = resy;
sub_rect->nb_colors = (int)cmax + 1;
@@ -279,18 +273,14 @@ gen_sub_bitmap(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page, i
b = VBI_B(page->color_map[ci]);
a = VBI_A(page->color_map[ci]);
((uint32_t *)sub_rect->pict.data[1])[ci] = RGBA(r, g, b, a);
-#ifdef DEBUG
- av_log(ctx, AV_LOG_DEBUG, "palette %0x\n",
- ((uint32_t *)sub_rect->pict.data[1])[ci]);
-#endif
+ av_dlog(ctx, "palette %0x\n", ((uint32_t *)sub_rect->pict.data[1])[ci]);
}
((uint32_t *)sub_rect->pict.data[1])[cmax] = RGBA(0, 0, 0, 0);
sub_rect->type = SUBTITLE_BITMAP;
return 0;
}
-static void
-handler(vbi_event *ev, void *user_data)
+static void handler(vbi_event *ev, void *user_data)
{
TeletextContext *ctx = user_data;
TeletextPage *new_pages;
@@ -311,7 +301,6 @@ handler(vbi_event *ev, void *user_data)
if (ctx->handler_ret < 0)
return;
- /* Fetch the page. */
res = vbi_fetch_vt_page(ctx->vbi, &page,
ev->ev.ttx_page.pgno,
ev->ev.ttx_page.subno,
@@ -369,18 +358,46 @@ handler(vbi_event *ev, void *user_data)
vbi_unref_page(&page);
}
-static int
-teletext_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- AVPacket *pkt)
+static inline int data_identifier_is_teletext(int data_identifier) {
+ /* See EN 301 775 section 4.4.2. */
+ return (data_identifier >= 0x10 && data_identifier <= 0x1F ||
+ data_identifier >= 0x99 && data_identifier <= 0x9B);
+}
+
+static int slice_to_vbi_lines(TeletextContext *ctx, uint8_t* buf, int size)
+{
+ int lines = 0;
+ while (size >= 2 && lines < MAX_SLICES) {
+ int data_unit_id = buf[0];
+ int data_unit_length = buf[1];
+ if (data_unit_length + 2 > size)
+ return AVERROR_INVALIDDATA;
+ if (data_unit_id == 0x02 || data_unit_id == 0x03) {
+ if (data_unit_length != 0x2c)
+ return AVERROR_INVALIDDATA;
+ else {
+ int line_offset = buf[2] & 0x1f;
+ int field_parity = buf[2] & 0x20;
+ int i;
+ ctx->sliced[lines].id = VBI_SLICED_TELETEXT_B;
+ ctx->sliced[lines].line = (line_offset > 0 ? (line_offset + (field_parity ? 0 : 313)) : 0);
+ for (i = 0; i < 42; i++)
+ ctx->sliced[lines].data[i] = vbi_rev8(buf[4 + i]);
+ lines++;
+ }
+ }
+ size -= data_unit_length + 2;
+ buf += data_unit_length + 2;
+ }
+ if (size)
+ av_log(ctx, AV_LOG_WARNING, "%d bytes remained after slicing data\n", size);
+ return lines;
+}
+
+static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *pkt)
{
TeletextContext *ctx = avctx->priv_data;
AVSubtitle *sub = data;
- const uint8_t *buf = pkt->data;
- int left = pkt->size;
- uint8_t pesheader[45] = {0x00, 0x00, 0x01, 0xbd, 0x00, 0x00, 0x85, 0x80, 0x24, 0x21, 0x00, 0x01, 0x00, 0x01};
- int pesheader_size = sizeof(pesheader);
- const uint8_t *pesheader_buf = pesheader;
int ret = 0;
if (!ctx->vbi) {
@@ -392,43 +409,34 @@ teletext_decode_frame(AVCodecContext *avctx,
return AVERROR(ENOMEM);
}
}
- if (!ctx->dx && (!(ctx->dx = vbi_dvb_pes_demux_new (/* callback */ NULL, NULL))))
- return AVERROR(ENOMEM);
if (avctx->pkt_timebase.den && pkt->pts != AV_NOPTS_VALUE)
ctx->pts = av_rescale_q(pkt->pts, avctx->pkt_timebase, AV_TIME_BASE_Q);
- if (left) {
+ if (pkt->size) {
+ int lines;
+ const int full_pes_size = pkt->size + 45; /* PES header is 45 bytes */
+
// We allow unreasonably big packets, even if the standard only allows a max size of 1472
- if ((pesheader_size + left) < 184 || (pesheader_size + left) > 65504 || (pesheader_size + left) % 184 != 0)
+ if (full_pes_size < 184 || full_pes_size > 65504 || full_pes_size % 184 != 0)
return AVERROR_INVALIDDATA;
- memset(pesheader + 14, 0xff, pesheader_size - 14);
- AV_WB16(pesheader + 4, left + pesheader_size - 6);
-
- /* PTS is deliberately left as 0 in the PES header, otherwise libzvbi uses
- * it to detect dropped frames. Unforunatey the guessed packet PTS values
- * (see mpegts demuxer) are not accurate enough to pass that test. */
- vbi_dvb_demux_cor(ctx->dx, ctx->sliced, 64, NULL, &pesheader_buf, &pesheader_size);
-
ctx->handler_ret = pkt->size;
- while (left > 0) {
- int64_t pts = 0;
- unsigned int lines = vbi_dvb_demux_cor(ctx->dx, ctx->sliced, 64, &pts, &buf, &left);
-#ifdef DEBUG
- av_log(avctx, AV_LOG_DEBUG,
- "ctx=%p buf_size=%d left=%u lines=%u pts=%f pkt_pts=%f\n",
- ctx, pkt->size, left, lines, (double)pts/90000.0, (double)pkt->pts/90000.0);
-#endif
+ if (data_identifier_is_teletext(*pkt->data)) {
+ if ((lines = slice_to_vbi_lines(ctx, pkt->data + 1, pkt->size - 1)) < 0)
+ return lines;
+ av_dlog(avctx, "ctx=%p buf_size=%d lines=%u pkt_pts=%7.3f\n",
+ ctx, pkt->size, lines, (double)pkt->pts/90000.0);
if (lines > 0) {
-#ifdef DEBUGx
+#ifdef DEBUG
int i;
- for(i=0; i<lines; ++i)
- av_log(avctx, AV_LOG_DEBUG,
- "lines=%d id=%x\n", i, ctx->sliced[i].id);
+ av_log(avctx, AV_LOG_DEBUG, "line numbers:");
+ for(i = 0; i < lines; i++)
+ av_log(avctx, AV_LOG_DEBUG, " %d", ctx->sliced[i].line);
+ av_log(avctx, AV_LOG_DEBUG, "\n");
#endif
- vbi_decode(ctx->vbi, ctx->sliced, lines, (double)pts/90000.0);
+ vbi_decode(ctx->vbi, ctx->sliced, lines, 0.0);
ctx->lines_processed += lines;
}
}
@@ -449,7 +457,7 @@ teletext_decode_frame(AVCodecContext *avctx,
sub->pts = ctx->pages->pts;
if (ctx->pages->sub_rect->type != SUBTITLE_NONE) {
- sub->rects = av_malloc(sizeof(*sub->rects) * 1);
+ sub->rects = av_malloc(sizeof(*sub->rects));
if (sub->rects) {
sub->num_rects = 1;
sub->rects[0] = ctx->pages->sub_rect;
@@ -486,7 +494,11 @@ static int teletext_init_decoder(AVCodecContext *avctx)
return AVERROR_EXTERNAL;
}
- ctx->dx = NULL;
+ if (ctx->format_id == 0) {
+ avctx->width = 41 * BITMAP_CHAR_WIDTH;
+ avctx->height = 25 * BITMAP_CHAR_HEIGHT;
+ }
+
ctx->vbi = NULL;
ctx->pts = AV_NOPTS_VALUE;
@@ -504,16 +516,12 @@ static int teletext_close_decoder(AVCodecContext *avctx)
{
TeletextContext *ctx = avctx->priv_data;
-#ifdef DEBUG
- av_log(avctx, AV_LOG_DEBUG, "lines_total=%u\n", ctx->lines_processed);
-#endif
+ av_dlog(avctx, "lines_total=%u\n", ctx->lines_processed);
while (ctx->nb_pages)
subtitle_rect_free(&ctx->pages[--ctx->nb_pages].sub_rect);
av_freep(&ctx->pages);
- vbi_dvb_demux_delete(ctx->dx);
vbi_decoder_delete(ctx->vbi);
- ctx->dx = NULL;
ctx->vbi = NULL;
ctx->pts = AV_NOPTS_VALUE;
return 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ljpegenc.c b/chromium/third_party/ffmpeg/libavcodec/ljpegenc.c
index 35b82fdea2c..6fd86ff2276 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ljpegenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ljpegenc.c
@@ -233,7 +233,7 @@ static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
init_put_bits(&pb, pkt->data, pkt->size);
ff_mjpeg_encode_picture_header(avctx, &pb, &s->scantable,
- s->matrix);
+ s->matrix, s->matrix);
header_bits = put_bits_count(&pb);
@@ -275,7 +275,8 @@ static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
if ((avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV444P) &&
+ avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
+ avctx->color_range == AVCOL_RANGE_MPEG) &&
avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) {
av_log(avctx, AV_LOG_ERROR,
"Limited range YUV is non-standard, set strict_std_compliance to "
diff --git a/chromium/third_party/ffmpeg/libavcodec/lossless_videodsp.c b/chromium/third_party/ffmpeg/libavcodec/lossless_videodsp.c
new file mode 100644
index 00000000000..ca55e6e7c61
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/lossless_videodsp.c
@@ -0,0 +1,128 @@
+/*
+ * Lossless video DSP utils
+ *
+ * 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 "lossless_videodsp.h"
+#include "libavcodec/mathops.h"
+
+static void add_int16_c(uint16_t *dst, const uint16_t *src, unsigned mask, int w){
+ long i;
+ unsigned long pw_lsb = (mask >> 1) * 0x0001000100010001ULL;
+ unsigned long pw_msb = pw_lsb + 0x0001000100010001ULL;
+ for (i = 0; i <= w - (int)sizeof(long)/2; i += sizeof(long)/2) {
+ long a = *(long*)(src+i);
+ long b = *(long*)(dst+i);
+ *(long*)(dst+i) = ((a&pw_lsb) + (b&pw_lsb)) ^ ((a^b)&pw_msb);
+ }
+ for(; i<w; i++)
+ dst[i] = (dst[i] + src[i]) & mask;
+}
+
+static void diff_int16_c(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w){
+ long i;
+#if !HAVE_FAST_UNALIGNED
+ if((long)src2 & (sizeof(long)-1)){
+ for(i=0; i+3<w; i+=4){
+ dst[i+0] = (src1[i+0]-src2[i+0]) & mask;
+ dst[i+1] = (src1[i+1]-src2[i+1]) & mask;
+ dst[i+2] = (src1[i+2]-src2[i+2]) & mask;
+ dst[i+3] = (src1[i+3]-src2[i+3]) & mask;
+ }
+ }else
+#endif
+ {
+ unsigned long pw_lsb = (mask >> 1) * 0x0001000100010001ULL;
+ unsigned long pw_msb = pw_lsb + 0x0001000100010001ULL;
+
+ for (i = 0; i <= w - (int)sizeof(long)/2; i += sizeof(long)/2) {
+ long a = *(long*)(src1+i);
+ long b = *(long*)(src2+i);
+ *(long*)(dst+i) = ((a|pw_msb) - (b&pw_lsb)) ^ ((a^b^pw_msb)&pw_msb);
+ }
+ }
+ for (; i<w; i++)
+ dst[i] = (src1[i] - src2[i]) & mask;
+}
+
+static void add_hfyu_median_prediction_int16_c(uint16_t *dst, const uint16_t *src, const uint16_t *diff, unsigned mask, int w, int *left, int *left_top){
+ int i;
+ uint16_t l, lt;
+
+ l = *left;
+ lt = *left_top;
+
+ for(i=0; i<w; i++){
+ l = (mid_pred(l, src[i], (l + src[i] - lt) & mask) + diff[i]) & mask;
+ lt = src[i];
+ dst[i] = l;
+ }
+
+ *left = l;
+ *left_top = lt;
+}
+
+static void sub_hfyu_median_prediction_int16_c(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w, int *left, int *left_top){
+ int i;
+ uint16_t l, lt;
+
+ l = *left;
+ lt = *left_top;
+
+ for(i=0; i<w; i++){
+ const int pred = mid_pred(l, src1[i], (l + src1[i] - lt) & mask);
+ lt = src1[i];
+ l = src2[i];
+ dst[i] = (l - pred) & mask;
+ }
+
+ *left = l;
+ *left_top = lt;
+}
+
+static int add_hfyu_left_prediction_int16_c(uint16_t *dst, const uint16_t *src, unsigned mask, int w, unsigned acc){
+ int i;
+
+ for(i=0; i<w-1; i++){
+ acc+= src[i];
+ dst[i]= acc & mask;
+ i++;
+ acc+= src[i];
+ dst[i]= acc & mask;
+ }
+
+ for(; i<w; i++){
+ acc+= src[i];
+ dst[i]= acc & mask;
+ }
+
+ return acc;
+}
+
+
+void ff_llviddsp_init(LLVidDSPContext *c, AVCodecContext *avctx)
+{
+ c->add_int16 = add_int16_c;
+ c->diff_int16= diff_int16_c;
+ c->add_hfyu_left_prediction_int16 = add_hfyu_left_prediction_int16_c;
+ c->add_hfyu_median_prediction_int16 = add_hfyu_median_prediction_int16_c;
+ c->sub_hfyu_median_prediction_int16 = sub_hfyu_median_prediction_int16_c;
+
+ if (ARCH_X86)
+ ff_llviddsp_init_x86(c, avctx);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/lossless_videodsp.h b/chromium/third_party/ffmpeg/libavcodec/lossless_videodsp.h
new file mode 100644
index 00000000000..6e82f64eeac
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/lossless_videodsp.h
@@ -0,0 +1,40 @@
+/*
+ * Lossless video DSP utils
+ *
+ * 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_LOSSLESS_VIDEODSP_H
+#define AVCODEC_LOSSLESS_VIDEODSP_H
+
+#include "avcodec.h"
+#include "libavutil/cpu.h"
+
+typedef struct LLVidDSPContext {
+ void (*add_int16)(uint16_t *dst/*align 16*/, const uint16_t *src/*align 16*/, unsigned mask, int w);
+ void (*diff_int16)(uint16_t *dst/*align 16*/, const uint16_t *src1/*align 16*/, const uint16_t *src2/*align 1*/, unsigned mask, int w);
+
+ void (*sub_hfyu_median_prediction_int16)(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w, int *left, int *left_top);
+ void (*add_hfyu_median_prediction_int16)(uint16_t *dst, const uint16_t *top, const uint16_t *diff, unsigned mask, int w, int *left, int *left_top);
+ int (*add_hfyu_left_prediction_int16)(uint16_t *dst, const uint16_t *src, unsigned mask, int w, unsigned left);
+} LLVidDSPContext;
+
+void ff_llviddsp_init(LLVidDSPContext *llviddsp, AVCodecContext *avctx);
+void ff_llviddsp_init_x86(LLVidDSPContext *llviddsp, AVCodecContext *avctx);
+
+#endif //AVCODEC_LOSSLESS_VIDEODSP_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/lzw.c b/chromium/third_party/ffmpeg/libavcodec/lzw.c
index 43e3e055c26..6832c122a28 100644
--- a/chromium/third_party/ffmpeg/libavcodec/lzw.c
+++ b/chromium/third_party/ffmpeg/libavcodec/lzw.c
@@ -28,6 +28,7 @@
*/
#include "avcodec.h"
+#include "bytestream.h"
#include "lzw.h"
#include "libavutil/mem.h"
@@ -43,7 +44,7 @@ static const uint16_t mask[17] =
};
struct LZWState {
- const uint8_t *pbuf, *ebuf;
+ GetByteContext gb;
int bbits;
unsigned int bbuf;
@@ -73,9 +74,9 @@ static int lzw_get_code(struct LZWState * s)
if(s->mode == FF_LZW_GIF) {
while (s->bbits < s->cursize) {
if (!s->bs) {
- s->bs = *s->pbuf++;
+ s->bs = bytestream2_get_byte(&s->gb);
}
- s->bbuf |= (*s->pbuf++) << s->bbits;
+ s->bbuf |= bytestream2_get_byte(&s->gb) << s->bbits;
s->bbits += 8;
s->bs--;
}
@@ -83,7 +84,7 @@ static int lzw_get_code(struct LZWState * s)
s->bbuf >>= s->cursize;
} else { // TIFF
while (s->bbits < s->cursize) {
- s->bbuf = (s->bbuf << 8) | (*s->pbuf++);
+ s->bbuf = (s->bbuf << 8) | bytestream2_get_byte(&s->gb);
s->bbits += 8;
}
c = s->bbuf >> (s->bbits - s->cursize);
@@ -97,17 +98,12 @@ void ff_lzw_decode_tail(LZWState *p)
struct LZWState *s = (struct LZWState *)p;
if(s->mode == FF_LZW_GIF) {
- while (s->bs > 0) {
- if (s->bs >= s->ebuf - s->pbuf) {
- s->pbuf = s->ebuf;
- break;
- } else {
- s->pbuf += s->bs;
- s->bs = *s->pbuf++;
- }
+ while (s->bs > 0 && bytestream2_get_bytes_left(&s->gb)) {
+ bytestream2_skip(&s->gb, s->bs);
+ s->bs = bytestream2_get_byte(&s->gb);
}
}else
- s->pbuf= s->ebuf;
+ bytestream2_skip(&s->gb, bytestream2_get_bytes_left(&s->gb));
}
av_cold void ff_lzw_decode_open(LZWState **p)
@@ -135,8 +131,7 @@ int ff_lzw_decode_init(LZWState *p, int csize, const uint8_t *buf, int buf_size,
if(csize < 1 || csize >= LZW_MAXBITS)
return -1;
/* read buffer */
- s->pbuf = buf;
- s->ebuf = s->pbuf + buf_size;
+ bytestream2_init(&s->gb, buf, buf_size);
s->bbuf = 0;
s->bbits = 0;
s->bs = 0;
@@ -186,10 +181,6 @@ int ff_lzw_decode(LZWState *p, uint8_t *buf, int len){
if ((--l) == 0)
goto the_end;
}
- if (s->ebuf < s->pbuf) {
- av_log(NULL, AV_LOG_ERROR, "lzw overread\n");
- goto the_end;
- }
c = lzw_get_code(s);
if (c == s->end_code) {
break;
diff --git a/chromium/third_party/ffmpeg/libavcodec/lzwenc.c b/chromium/third_party/ffmpeg/libavcodec/lzwenc.c
index d5a07bc7ba5..03080ee5872 100644
--- a/chromium/third_party/ffmpeg/libavcodec/lzwenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/lzwenc.c
@@ -26,8 +26,9 @@
*/
#include "avcodec.h"
-#include "put_bits.h"
#include "lzw.h"
+#include "mathops.h"
+#include "put_bits.h"
#define LZW_MAXBITS 12
#define LZW_SIZTABLE (1<<LZW_MAXBITS)
diff --git a/chromium/third_party/ffmpeg/libavcodec/mace.c b/chromium/third_party/ffmpeg/libavcodec/mace.c
index fbd932e2034..6eaa2966880 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mace.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mace.c
@@ -244,6 +244,13 @@ static int mace_decode_frame(AVCodecContext *avctx, void *data,
int i, j, k, l, ret;
int is_mace3 = (avctx->codec_id == AV_CODEC_ID_MACE3);
+ if (buf_size % (avctx->channels << is_mace3)) {
+ av_log(avctx, AV_LOG_ERROR, "buffer size %d is odd\n", buf_size);
+ buf_size -= buf_size % (avctx->channels << is_mace3);
+ if (!buf_size)
+ return AVERROR_INVALIDDATA;
+ }
+
/* get output buffer */
frame->nb_samples = 3 * (buf_size << (1 - is_mace3)) / avctx->channels;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/mathops.h b/chromium/third_party/ffmpeg/libavcodec/mathops.h
index bad25afd45b..b0e48d89198 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mathops.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mathops.h
@@ -27,9 +27,13 @@
#include "libavutil/common.h"
#include "config.h"
+#define MAX_NEG_CROP 1024
+
extern const uint32_t ff_inverse[257];
extern const uint8_t ff_reverse[256];
extern const uint8_t ff_sqrt_tab[256];
+extern const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP];
+extern const uint8_t ff_zigzag_direct[64];
#if ARCH_ARM
# include "arm/mathops.h"
@@ -195,15 +199,6 @@ if ((y) < (x)) {\
# define FASTDIV(a,b) ((uint32_t)((((uint64_t)a) * ff_inverse[b]) >> 32))
#endif /* FASTDIV */
-#ifndef MOD_UNLIKELY
-# define MOD_UNLIKELY(modulus, dividend, divisor, prev_dividend) \
- do { \
- if ((prev_dividend) == 0 || (dividend) - (prev_dividend) != (divisor)) \
- (modulus) = (dividend) % (divisor); \
- (prev_dividend) = (dividend); \
- } while (0)
-#endif
-
static inline av_const unsigned int ff_sqrt(unsigned int a)
{
unsigned int b;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mathtables.c b/chromium/third_party/ffmpeg/libavcodec/mathtables.c
index ec5ba794273..a07ac50c08b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mathtables.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mathtables.c
@@ -20,6 +20,8 @@
#include <stdint.h>
+#include "mathops.h"
+
/* a*inverse[b]>>32 == a/b for all 0<=a<=16909558 && 2<=b<=256
* for a>16909558, is an overestimate by less than 1 part in 1<<24 */
const uint32_t ff_inverse[257]={
@@ -91,7 +93,7 @@ const uint8_t ff_reverse[256] = {
#define times4(x) x, x, x, x
#define times256(x) times4(times4(times4(times4(times4(x)))))
-const uint8_t ff_cropTbl[256 + 2 * 1024] = {
+const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP] = {
times256(0x00),
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
diff --git a/chromium/third_party/ffmpeg/libavcodec/mdct_fixed.c b/chromium/third_party/ffmpeg/libavcodec/mdct_fixed.c
index 2ee29b609a3..a32cb00ca03 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mdct_fixed.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mdct_fixed.c
@@ -16,8 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define CONFIG_FFT_FLOAT 0
-#define CONFIG_FFT_FIXED_32 0
+#define FFT_FLOAT 0
+#define FFT_FIXED_32 0
#include "mdct_template.c"
/* same as ff_mdct_calcw_c with double-width unscaled output */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mdct_fixed_32.c b/chromium/third_party/ffmpeg/libavcodec/mdct_fixed_32.c
index f1d6a2dc6bc..5a34dfe7607 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mdct_fixed_32.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mdct_fixed_32.c
@@ -47,6 +47,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define CONFIG_FFT_FLOAT 0
-#define CONFIG_FFT_FIXED_32 1
+#define FFT_FLOAT 0
+#define FFT_FIXED_32 1
#include "mdct_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/mdct_float.c b/chromium/third_party/ffmpeg/libavcodec/mdct_float.c
index 75b5f0d3a0a..cff2d211c4b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mdct_float.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mdct_float.c
@@ -16,6 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define CONFIG_FFT_FLOAT 1
-#define CONFIG_FFT_FIXED_32 0
+#define FFT_FLOAT 1
+#define FFT_FIXED_32 0
#include "mdct_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/mdct_template.c b/chromium/third_party/ffmpeg/libavcodec/mdct_template.c
index 922d577e3e3..7fa8bcce569 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mdct_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mdct_template.c
@@ -31,14 +31,14 @@
* MDCT/IMDCT transforms.
*/
-#if CONFIG_FFT_FLOAT
+#if FFT_FLOAT
# define RSCALE(x) (x)
#else
-#if CONFIG_FFT_FIXED_32
+#if FFT_FIXED_32
# define RSCALE(x) (((x) + 32) >> 6)
-#else /* CONFIG_FFT_FIXED_32 */
+#else /* FFT_FIXED_32 */
# define RSCALE(x) ((x) >> 1)
-#endif /* CONFIG_FFT_FIXED_32 */
+#endif /* FFT_FIXED_32 */
#endif
/**
@@ -60,7 +60,7 @@ av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale)
if (ff_fft_init(s, s->mdct_bits - 2, inverse) < 0)
goto fail;
- s->tcos = av_malloc(n/2 * sizeof(FFTSample));
+ s->tcos = av_malloc_array(n/2, sizeof(FFTSample));
if (!s->tcos)
goto fail;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mdec.c b/chromium/third_party/ffmpeg/libavcodec/mdec.c
index 1567e14a1f6..d9bb64e31f5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mdec.c
@@ -215,6 +215,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
if (avctx->idct_algo == FF_IDCT_AUTO)
avctx->idct_algo = FF_IDCT_SIMPLE;
avctx->pix_fmt = AV_PIX_FMT_YUVJ420P;
+ avctx->color_range = AVCOL_RANGE_JPEG;
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/metasound.c b/chromium/third_party/ffmpeg/libavcodec/metasound.c
index 677e959d483..2dab135bdaa 100644
--- a/chromium/third_party/ffmpeg/libavcodec/metasound.c
+++ b/chromium/third_party/ffmpeg/libavcodec/metasound.c
@@ -21,6 +21,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
#include <math.h>
#include <stdint.h>
@@ -283,7 +284,7 @@ static av_cold int metasound_decode_init(AVCodecContext *avctx)
for (;;) {
if (!props->tag) {
- av_log(avctx, AV_LOG_ERROR, "Could not find tag %08X\n", tag);
+ av_log(avctx, AV_LOG_ERROR, "Could not find tag %08"PRIX32"\n", tag);
return AVERROR_INVALIDDATA;
}
if (props->tag == tag) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpeg.h b/chromium/third_party/ffmpeg/libavcodec/mjpeg.h
index 96e18545a7f..73db1dd1eb5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpeg.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpeg.h
@@ -33,10 +33,11 @@
#ifndef AVCODEC_MJPEG_H
#define AVCODEC_MJPEG_H
+#include "libavutil/internal.h"
+
#include "avcodec.h"
#include "put_bits.h"
-
/* JPEG marker codes */
typedef enum {
/* start of frame */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c b/chromium/third_party/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c
index f3672881bc5..6adeaf0ac83 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c
@@ -25,6 +25,10 @@
*/
#include <string.h>
+
+#include "libavutil/error.h"
+#include "libavutil/mem.h"
+
#include "avcodec.h"
#include "mjpeg.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegbdec.c b/chromium/third_party/ffmpeg/libavcodec/mjpegbdec.c
index f061f0bc260..f6ee7057fdb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegbdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegbdec.c
@@ -24,6 +24,8 @@
* Apple MJPEG-B decoder.
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "mjpeg.h"
#include "mjpegdec.h"
@@ -74,13 +76,14 @@ read_header:
}
field_size = get_bits_long(&hgb, 32); /* field size */
- av_log(avctx, AV_LOG_DEBUG, "field size: 0x%x\n", field_size);
+ av_log(avctx, AV_LOG_DEBUG, "field size: 0x%"PRIx32"\n", field_size);
skip_bits(&hgb, 32); /* padded field size */
second_field_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "second_field_offs is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "second field offs: 0x%x\n", second_field_offs);
+ av_log(avctx, AV_LOG_DEBUG, "second field offs: 0x%"PRIx32"\n",
+ second_field_offs);
dqt_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dqt is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "dqt offs: 0x%x\n", dqt_offs);
+ av_log(avctx, AV_LOG_DEBUG, "dqt offs: 0x%"PRIx32"\n", dqt_offs);
if (dqt_offs)
{
init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - (buf_ptr+dqt_offs))*8);
@@ -91,7 +94,7 @@ read_header:
}
dht_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dht is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "dht offs: 0x%x\n", dht_offs);
+ av_log(avctx, AV_LOG_DEBUG, "dht offs: 0x%"PRIx32"\n", dht_offs);
if (dht_offs)
{
init_get_bits(&s->gb, buf_ptr+dht_offs, (buf_end - (buf_ptr+dht_offs))*8);
@@ -100,7 +103,7 @@ read_header:
}
sof_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sof is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "sof offs: 0x%x\n", sof_offs);
+ av_log(avctx, AV_LOG_DEBUG, "sof offs: 0x%"PRIx32"\n", sof_offs);
if (sof_offs)
{
init_get_bits(&s->gb, buf_ptr+sof_offs, (buf_end - (buf_ptr+sof_offs))*8);
@@ -110,16 +113,16 @@ read_header:
}
sos_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sos is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "sos offs: 0x%x\n", sos_offs);
+ av_log(avctx, AV_LOG_DEBUG, "sos offs: 0x%"PRIx32"\n", sos_offs);
sod_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sof is %d and size is %d\n");
- av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%x\n", sod_offs);
+ av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%"PRIx32"\n", sod_offs);
if (sos_offs)
{
init_get_bits(&s->gb, buf_ptr + sos_offs,
8 * FFMIN(field_size, buf_end - buf_ptr - sos_offs));
s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16));
s->start_code = SOS;
- if (ff_mjpeg_decode_sos(s, NULL, NULL) < 0 &&
+ if (ff_mjpeg_decode_sos(s, NULL, 0, NULL) < 0 &&
(avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c b/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c
index 187f32595ad..7150d4a2451 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c
@@ -83,6 +83,17 @@ static void build_basic_mjpeg_vlc(MJpegDecodeContext *s)
avpriv_mjpeg_val_ac_chrominance, 251, 0, 0);
}
+static void parse_avid(MJpegDecodeContext *s, uint8_t *buf, int len)
+{
+ s->buggy_avid = 1;
+ if (len > 14 && buf[12] == 1) /* 1 - NTSC */
+ s->interlace_polarity = 1;
+ if (len > 14 && buf[12] == 2) /* 2 - PAL */
+ s->interlace_polarity = 0;
+ if (s->avctx->debug & FF_DEBUG_PICT_INFO)
+ av_log(s->avctx, AV_LOG_INFO, "AVID: len:%d %d\n", len, len > 14 ? buf[12] : -1);
+}
+
av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
{
MJpegDecodeContext *s = avctx->priv_data;
@@ -120,7 +131,17 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
if (avctx->field_order == AV_FIELD_BB) { /* quicktime icefloe 019 */
s->interlace_polarity = 1; /* bottom field first */
av_log(avctx, AV_LOG_DEBUG, "bottom field first\n");
+ } else if (avctx->field_order == AV_FIELD_UNKNOWN) {
+ if (avctx->codec_tag == AV_RL32("MJPG"))
+ s->interlace_polarity = 1;
}
+
+ if ( avctx->extradata_size > 8
+ && AV_RL32(avctx->extradata) == 0x2C
+ && AV_RL32(avctx->extradata+4) == 0x18) {
+ parse_avid(s, avctx->extradata, avctx->extradata_size);
+ }
+
if (avctx->codec->id == AV_CODEC_ID_AMV)
s->flipped = 1;
@@ -336,7 +357,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
s->first_picture = 0;
}
- if (s->interlaced && (s->bottom_field == !s->interlace_polarity)) {
+ if (s->got_picture && s->interlaced && (s->bottom_field == !s->interlace_polarity)) {
if (s->progressive) {
avpriv_request_sample(s->avctx, "progressively coded interlaced picture");
return AVERROR_INVALIDDATA;
@@ -378,7 +399,30 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
if (s->rgb)
s->avctx->pix_fmt = s->bits <= 9 ? AV_PIX_FMT_ABGR : AV_PIX_FMT_RGBA64;
else {
- s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_YUVA444P : AV_PIX_FMT_YUVA444P16;
+ if (s->adobe_transform == 0 && s->bits <= 8) {
+ s->avctx->pix_fmt = AV_PIX_FMT_GBRAP;
+ } else {
+ s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_YUVA444P : AV_PIX_FMT_YUVA444P16;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ }
+ }
+ av_assert0(s->nb_components == 4);
+ break;
+ case 0x22111122:
+ if (s->adobe_transform == 0 && s->bits <= 8) {
+ s->avctx->pix_fmt = AV_PIX_FMT_GBRAP;
+ s->upscale_v = 6;
+ s->upscale_h = 6;
+ s->chroma_height = s->height;
+ } else if (s->adobe_transform == 2 && s->bits <= 8) {
+ s->avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
+ s->upscale_v = 6;
+ s->upscale_h = 6;
+ s->chroma_height = s->height;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ } else {
+ if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUVA420P;
+ else s->avctx->pix_fmt = AV_PIX_FMT_YUVA420P16;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
}
av_assert0(s->nb_components == 4);
@@ -389,8 +433,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
else
goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- s->upscale_v = 2;
- s->upscale_h = (pix_fmt_id == 0x22122100);
+ s->upscale_v = 4;
+ s->upscale_h = 2*(pix_fmt_id == 0x22122100);
s->chroma_height = s->height;
break;
case 0x21211100:
@@ -399,8 +443,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
else
goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- s->upscale_v = (pix_fmt_id == 0x22211200);
- s->upscale_h = 2;
+ s->upscale_v = 2*(pix_fmt_id == 0x22211200);
+ s->upscale_h = 4;
s->chroma_height = s->height;
break;
case 0x22221100:
@@ -408,8 +452,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
else
goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- s->upscale_v = 2;
- s->upscale_h = 2;
+ s->upscale_v = 4;
+ s->upscale_h = 4;
s->chroma_height = s->height / 2;
break;
case 0x11000000:
@@ -433,7 +477,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
else
goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- s->upscale_h = (pix_fmt_id == 0x22211100) * 2 + (pix_fmt_id == 0x22112100);
+ s->upscale_h = 4 * (pix_fmt_id == 0x22211100) + 2 * (pix_fmt_id == 0x22112100);
s->chroma_height = s->height / 2;
break;
case 0x21111100:
@@ -447,7 +491,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
else
goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- s->upscale_v = (pix_fmt_id == 0x22121100) + 1;
+ s->upscale_v = 2 << (pix_fmt_id == 0x22121100);
break;
case 0x22111100:
if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
@@ -473,12 +517,20 @@ unk_pixfmt:
s->upscale_h = s->upscale_v = 0;
if (s->nb_components > 1)
s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
+ else if (s->palette_index && s->bits <= 8)
+ s->avctx->pix_fmt = AV_PIX_FMT_PAL8;
else if (s->bits <= 8)
s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
else
s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
}
+ s->pix_desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
+ if (!s->pix_desc) {
+ av_log(s->avctx, AV_LOG_ERROR, "Could not get a pixel format descriptor.\n");
+ return AVERROR_BUG;
+ }
+
av_frame_unref(s->picture_ptr);
if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
return -1;
@@ -486,7 +538,7 @@ unk_pixfmt:
s->picture_ptr->key_frame = 1;
s->got_picture = 1;
- for (i = 0; i < 3; i++)
+ for (i = 0; i < 4; i++)
s->linesize[i] = s->picture_ptr->linesize[i] << s->interlaced;
av_dlog(s->avctx, "%d %d %d %d %d %d\n",
@@ -510,8 +562,8 @@ unk_pixfmt:
int size = bw * bh * s->h_count[i] * s->v_count[i];
av_freep(&s->blocks[i]);
av_freep(&s->last_nnz[i]);
- s->blocks[i] = av_malloc(size * sizeof(**s->blocks));
- s->last_nnz[i] = av_mallocz(size * sizeof(**s->last_nnz));
+ s->blocks[i] = av_mallocz_array(size, sizeof(**s->blocks));
+ s->last_nnz[i] = av_mallocz_array(size, sizeof(**s->last_nnz));
if (!s->blocks[i] || !s->last_nnz[i])
return AVERROR(ENOMEM);
s->block_stride[i] = bw * s->h_count[i];
@@ -1094,37 +1146,32 @@ static void shift_output(MJpegDecodeContext *s, uint8_t *ptr, int linesize)
static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
int Al, const uint8_t *mb_bitmask,
+ int mb_bitmask_size,
const AVFrame *reference)
{
int i, mb_x, mb_y;
uint8_t *data[MAX_COMPONENTS];
const uint8_t *reference_data[MAX_COMPONENTS];
int linesize[MAX_COMPONENTS];
- GetBitContext mb_bitmask_gb;
+ GetBitContext mb_bitmask_gb = {0}; // initialize to silence gcc warning
int bytes_per_pixel = 1 + (s->bits > 8);
- if (mb_bitmask)
+ if (mb_bitmask) {
+ if (mb_bitmask_size != (s->mb_width * s->mb_height + 7)>>3) {
+ av_log(s->avctx, AV_LOG_ERROR, "mb_bitmask_size mismatches\n");
+ return AVERROR_INVALIDDATA;
+ }
init_get_bits(&mb_bitmask_gb, mb_bitmask, s->mb_width * s->mb_height);
-
- if (s->flipped && s->avctx->lowres) {
- av_log(s->avctx, AV_LOG_ERROR, "Can not flip image with lowres\n");
- s->flipped = 0;
}
+
s->restart_count = 0;
+
for (i = 0; i < nb_components; i++) {
int c = s->comp_index[i];
data[c] = s->picture_ptr->data[c];
reference_data[c] = reference ? reference->data[c] : NULL;
linesize[c] = s->linesize[c];
s->coefs_finished[c] |= 1;
- if (s->flipped && !(s->avctx->flags & CODEC_FLAG_EMU_EDGE)) {
- // picture should be flipped upside-down for this codec
- int offset = (linesize[c] * (s->v_scount[i] *
- (8 * s->mb_height - ((s->height / s->v_max) & 7)) - 1));
- data[c] += offset;
- reference_data[c] += offset;
- linesize[c] *= -1;
- }
}
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
@@ -1225,7 +1272,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
}
if (!Al) {
- s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss);
+ s->coefs_finished[c] |= (2ULL << se) - (1ULL << ss);
last_scan = !~s->coefs_finished[c];
}
@@ -1270,7 +1317,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
}
int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask,
- const AVFrame *reference)
+ int mb_bitmask_size, const AVFrame *reference)
{
int len, nb_components, i, h, v, predictor, point_transform;
int index, id, ret;
@@ -1402,7 +1449,7 @@ next_field:
} else {
if ((ret = mjpeg_decode_scan(s, nb_components,
prev_shift, point_transform,
- mb_bitmask, reference)) < 0)
+ mb_bitmask, mb_bitmask_size, reference)) < 0)
return ret;
}
}
@@ -1454,8 +1501,11 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
id = get_bits_long(&s->gb, 32);
len -= 6;
- if (s->avctx->debug & FF_DEBUG_STARTCODE)
- av_log(s->avctx, AV_LOG_DEBUG, "APPx %8X len=%d\n", id, len);
+ if (s->avctx->debug & FF_DEBUG_STARTCODE) {
+ char id_str[32];
+ av_get_codec_tag_string(id_str, sizeof(id_str), av_bswap32(id));
+ av_log(s->avctx, AV_LOG_DEBUG, "APPx (%s / %8X) len=%d\n", id_str, id, len);
+ }
/* Buggy AVID, it puts EOI only at every 10th frame. */
/* Also, this fourcc is used by non-avid files too, it holds some
@@ -1511,12 +1561,12 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
}
if (id == AV_RB32("Adob") && (get_bits(&s->gb, 8) == 'e')) {
- if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_INFO, "mjpeg: Adobe header found\n");
skip_bits(&s->gb, 16); /* version */
skip_bits(&s->gb, 16); /* flags0 */
skip_bits(&s->gb, 16); /* flags1 */
- skip_bits(&s->gb, 8); /* transform */
+ s->adobe_transform = get_bits(&s->gb, 8);
+ if (s->avctx->debug & FF_DEBUG_PICT_INFO)
+ av_log(s->avctx, AV_LOG_INFO, "mjpeg: Adobe header found, transform=%d\n", s->adobe_transform);
len -= 7;
goto out;
}
@@ -1559,6 +1609,45 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
goto out;
}
+ /* JPS extension by VRex */
+ if (s->start_code == APP3 && id == AV_RB32("_JPS") && len >= 10) {
+ int flags, layout, type;
+ if (s->avctx->debug & FF_DEBUG_PICT_INFO)
+ av_log(s->avctx, AV_LOG_INFO, "_JPSJPS_\n");
+
+ skip_bits(&s->gb, 32); len -= 4; /* JPS_ */
+ skip_bits(&s->gb, 16); len -= 2; /* block length */
+ skip_bits(&s->gb, 8); /* reserved */
+ flags = get_bits(&s->gb, 8);
+ layout = get_bits(&s->gb, 8);
+ type = get_bits(&s->gb, 8);
+ len -= 4;
+
+ s->stereo3d = av_stereo3d_alloc();
+ if (!s->stereo3d) {
+ goto out;
+ }
+ if (type == 0) {
+ s->stereo3d->type = AV_STEREO3D_2D;
+ } else if (type == 1) {
+ switch (layout) {
+ case 0x01:
+ s->stereo3d->type = AV_STEREO3D_LINES;
+ break;
+ case 0x02:
+ s->stereo3d->type = AV_STEREO3D_SIDEBYSIDE;
+ break;
+ case 0x03:
+ s->stereo3d->type = AV_STEREO3D_TOPBOTTOM;
+ break;
+ }
+ if (!(flags & 0x04)) {
+ s->stereo3d->flags = AV_STEREO3D_FLAG_INVERT;
+ }
+ }
+ goto out;
+ }
+
/* EXIF metadata */
if (s->start_code == APP1 && id == AV_RB32("Exif") && len >= 2) {
GetByteContext gbytes;
@@ -1576,17 +1665,15 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
ret = ff_tdecode_header(&gbytes, &le, &ifd_offset);
if (ret) {
av_log(s->avctx, AV_LOG_ERROR, "mjpeg: invalid TIFF header in EXIF data\n");
- return ret;
- }
-
- bytestream2_seek(&gbytes, ifd_offset, SEEK_SET);
+ } else {
+ bytestream2_seek(&gbytes, ifd_offset, SEEK_SET);
- // read 0th IFD and store the metadata
- // (return values > 0 indicate the presence of subimage metadata)
- ret = ff_exif_decode_ifd(s->avctx, &gbytes, le, 0, &s->exif_metadata);
- if (ret < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "mjpeg: error decoding EXIF data\n");
- return ret;
+ // read 0th IFD and store the metadata
+ // (return values > 0 indicate the presence of subimage metadata)
+ ret = avpriv_exif_decode_ifd(s->avctx, &gbytes, le, 0, &s->exif_metadata);
+ if (ret < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "mjpeg: error decoding EXIF data\n");
+ }
}
bytes_read = bytestream2_tell(&gbytes);
@@ -1647,9 +1734,7 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
/* buggy avid, it puts EOI only at every 10th frame */
if (!strncmp(cbuf, "AVID", 4)) {
- s->buggy_avid = 1;
- if (len > 14 && cbuf[12] == 1) /* 1 - NTSC, 2 - PAL */
- s->interlace_polarity = 1;
+ parse_avid(s, cbuf, len);
} else if (!strcmp(cbuf, "CS=ITU601"))
s->cs_itu601 = 1;
else if ((!strncmp(cbuf, "Intel(R) JPEG Library, version 1", 32)) ||
@@ -1728,7 +1813,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
memset(s->buffer + *unescaped_buf_size, 0,
FF_INPUT_BUFFER_PADDING_SIZE);
- av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %td bytes\n",
+ av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %"PTRDIFF_SPECIFIER" bytes\n",
(buf_end - *buf_ptr) - (dst - s->buffer));
} else if (start_code == SOS && s->ls) {
const uint8_t *src = *buf_ptr;
@@ -1737,8 +1822,6 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
int t = 0, b = 0;
PutBitContext pb;
- s->cur_scan++;
-
/* find marker */
while (src + t < buf_end) {
uint8_t x = src[t++];
@@ -1781,6 +1864,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
+ AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MJpegDecodeContext *s = avctx->priv_data;
@@ -1793,6 +1877,8 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
int ret = 0;
av_dict_free(&s->exif_metadata);
+ av_freep(&s->stereo3d);
+ s->adobe_transform = -1;
buf_ptr = buf;
buf_end = buf + buf_size;
@@ -1803,14 +1889,14 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
&unescaped_buf_size);
/* EOF */
if (start_code < 0) {
- goto the_end;
+ break;
} else if (unescaped_buf_size > INT_MAX / 8) {
av_log(avctx, AV_LOG_ERROR,
"MJPEG packet 0x%x too big (%d/%d), corrupt data?\n",
start_code, unescaped_buf_size, buf_size);
return AVERROR_INVALIDDATA;
}
- av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%td\n",
+ av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%"PTRDIFF_SPECIFIER"\n",
start_code, buf_end - buf_ptr);
ret = init_get_bits8(&s->gb, unescaped_buf_ptr, unescaped_buf_size);
@@ -1906,7 +1992,7 @@ eoi_parser:
if (s->bottom_field == !s->interlace_polarity)
break;
}
- if ((ret = av_frame_ref(data, s->picture_ptr)) < 0)
+ if ((ret = av_frame_ref(frame, s->picture_ptr)) < 0)
return ret;
*got_frame = 1;
s->got_picture = 0;
@@ -1928,7 +2014,8 @@ eoi_parser:
goto the_end;
case SOS:
- if ((ret = ff_mjpeg_decode_sos(s, NULL, NULL)) < 0 &&
+ s->cur_scan++;
+ if ((ret = ff_mjpeg_decode_sos(s, NULL, 0, NULL)) < 0 &&
(avctx->err_recognition & AV_EF_EXPLODE))
goto fail;
break;
@@ -1956,7 +2043,7 @@ eoi_parser:
"marker parser used %d bytes (%d bits)\n",
(get_bits_count(&s->gb) + 7) / 8, get_bits_count(&s->gb));
}
- if (s->got_picture) {
+ if (s->got_picture && s->cur_scan) {
av_log(avctx, AV_LOG_WARNING, "EOI missing, emulating\n");
goto eoi_parser;
}
@@ -1967,65 +2054,134 @@ fail:
return ret;
the_end:
if (s->upscale_h) {
- uint8_t *line = s->picture_ptr->data[s->upscale_h];
+ int p;
av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
avctx->pix_fmt == AV_PIX_FMT_YUVJ440P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV440P);
- for (i = 0; i < s->chroma_height; i++) {
- for (index = s->width - 1; index; index--)
- line[index] = (line[index / 2] + line[(index + 1) / 2]) >> 1;
- line += s->linesize[s->upscale_h];
+ avctx->pix_fmt == AV_PIX_FMT_YUV440P ||
+ avctx->pix_fmt == AV_PIX_FMT_YUVA444P ||
+ avctx->pix_fmt == AV_PIX_FMT_GBRAP
+ );
+ for (p = 1; p<4; p++) {
+ uint8_t *line = s->picture_ptr->data[p];
+ if (!(s->upscale_h & (1<<p)))
+ continue;
+ for (i = 0; i < s->chroma_height; i++) {
+ for (index = s->width - 1; index; index--)
+ line[index] = (line[index / 2] + line[(index + 1) / 2]) >> 1;
+ line += s->linesize[p];
+ }
}
}
if (s->upscale_v) {
- uint8_t *dst = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(s->height - 1) * s->linesize[s->upscale_v]];
- int w;
- avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
- w = s->width >> hshift;
+ int p;
av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV422P);
- for (i = s->height - 1; i; i--) {
- uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[i / 2 * s->linesize[s->upscale_v]];
- uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(i + 1) / 2 * s->linesize[s->upscale_v]];
- if (src1 == src2) {
- memcpy(dst, src1, w);
- } else {
- for (index = 0; index < w; index++)
- dst[index] = (src1[index] + src2[index]) >> 1;
+ avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
+ avctx->pix_fmt == AV_PIX_FMT_YUVA444P ||
+ avctx->pix_fmt == AV_PIX_FMT_GBRAP
+ );
+ avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
+ for (p = 1; p < 4; p++) {
+ uint8_t *dst = &((uint8_t *)s->picture_ptr->data[p])[(s->height - 1) * s->linesize[p]];
+ int w;
+ if (!(s->upscale_v & (1<<p)))
+ continue;
+ w = s->width >> hshift;
+ for (i = s->height - 1; i; i--) {
+ uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i / 2 * s->linesize[p]];
+ uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) / 2 * s->linesize[p]];
+ if (src1 == src2) {
+ memcpy(dst, src1, w);
+ } else {
+ for (index = 0; index < w; index++)
+ dst[index] = (src1[index] + src2[index]) >> 1;
+ }
+ dst -= s->linesize[p];
}
- dst -= s->linesize[s->upscale_v];
}
}
- if (s->flipped && (s->avctx->flags & CODEC_FLAG_EMU_EDGE)) {
+ if (s->flipped) {
int j;
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
for (index=0; index<4; index++) {
uint8_t *dst = s->picture_ptr->data[index];
- int w = s->width;
- int h = s->height;
+ int w = s->picture_ptr->width;
+ int h = s->picture_ptr->height;
if(index && index<3){
w = FF_CEIL_RSHIFT(w, hshift);
h = FF_CEIL_RSHIFT(h, vshift);
}
if(dst){
- uint8_t *dst2 = dst + s->linesize[index]*(h-1);
+ uint8_t *dst2 = dst + s->picture_ptr->linesize[index]*(h-1);
for (i=0; i<h/2; i++) {
for (j=0; j<w; j++)
FFSWAP(int, dst[j], dst2[j]);
- dst += s->linesize[index];
- dst2 -= s->linesize[index];
+ dst += s->picture_ptr->linesize[index];
+ dst2 -= s->picture_ptr->linesize[index];
}
}
}
}
+ if (s->adobe_transform == 0 && s->avctx->pix_fmt == AV_PIX_FMT_GBRAP) {
+ int w = s->picture_ptr->width;
+ int h = s->picture_ptr->height;
+ for (i=0; i<h; i++) {
+ int j;
+ uint8_t *dst[4];
+ for (index=0; index<4; index++) {
+ dst[index] = s->picture_ptr->data[index]
+ + s->picture_ptr->linesize[index]*i;
+ }
+ for (j=0; j<w; j++) {
+ int k = dst[3][j];
+ int r = dst[0][j] * k;
+ int g = dst[1][j] * k;
+ int b = dst[2][j] * k;
+ dst[0][j] = g*257 >> 16;
+ dst[1][j] = b*257 >> 16;
+ dst[2][j] = r*257 >> 16;
+ dst[3][j] = 255;
+ }
+ }
+ }
+ if (s->adobe_transform == 2 && s->avctx->pix_fmt == AV_PIX_FMT_YUVA444P) {
+ int w = s->picture_ptr->width;
+ int h = s->picture_ptr->height;
+ for (i=0; i<h; i++) {
+ int j;
+ uint8_t *dst[4];
+ for (index=0; index<4; index++) {
+ dst[index] = s->picture_ptr->data[index]
+ + s->picture_ptr->linesize[index]*i;
+ }
+ for (j=0; j<w; j++) {
+ int k = dst[3][j];
+ int r = (255 - dst[0][j]) * k;
+ int g = (128 - dst[1][j]) * k;
+ int b = (128 - dst[2][j]) * k;
+ dst[0][j] = r*257 >> 16;
+ dst[1][j] = (g*257 >> 16) + 128;
+ dst[2][j] = (b*257 >> 16) + 128;
+ dst[3][j] = 255;
+ }
+ }
+ }
+
+ if (s->stereo3d) {
+ AVStereo3D *stereo = av_stereo3d_create_side_data(data);
+ if (stereo) {
+ stereo->type = s->stereo3d->type;
+ stereo->flags = s->stereo3d->flags;
+ }
+ av_freep(&s->stereo3d);
+ }
av_dict_copy(avpriv_frame_get_metadatap(data), s->exif_metadata, 0);
av_dict_free(&s->exif_metadata);
- av_log(avctx, AV_LOG_DEBUG, "decode frame unused %td bytes\n",
+ av_log(avctx, AV_LOG_DEBUG, "decode frame unused %"PTRDIFF_SPECIFIER" bytes\n",
buf_end - buf_ptr);
// return buf_end - buf_ptr;
return buf_ptr - buf;
@@ -2046,7 +2202,8 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
} else if (s->picture_ptr)
av_frame_unref(s->picture_ptr);
- av_free(s->buffer);
+ av_freep(&s->buffer);
+ av_freep(&s->stereo3d);
av_freep(&s->ljpeg_buffer);
s->ljpeg_buffer_size = 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegdec.h b/chromium/third_party/ffmpeg/libavcodec/mjpegdec.h
index 1335c66b8dd..a94778846e9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegdec.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegdec.h
@@ -30,6 +30,8 @@
#define AVCODEC_MJPEGDEC_H
#include "libavutil/log.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/stereo3d.h"
#include "avcodec.h"
#include "get_bits.h"
@@ -67,6 +69,7 @@ typedef struct MJpegDecodeContext {
int bits; /* bits per component */
int colr;
int xfrm;
+ int adobe_transform;
int maxval;
int near; ///< near lossless bound (si 0 for lossless)
@@ -99,6 +102,7 @@ typedef struct MJpegDecodeContext {
int16_t (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode)
uint8_t *last_nnz[MAX_COMPONENTS];
uint64_t coefs_finished[MAX_COMPONENTS]; ///< bitmask of which coefs have been completely decoded (progressive mode)
+ int palette_index;
ScanTable scantable;
DSPContext dsp;
HpelDSPContext hdsp;
@@ -120,6 +124,10 @@ typedef struct MJpegDecodeContext {
int extern_huff;
AVDictionary *exif_metadata;
+
+ AVStereo3D *stereo3d; ///!< stereoscopic information (cached, since it is read before frame allocation)
+
+ const AVPixFmtDescriptor *pix_desc;
} MJpegDecodeContext;
int ff_mjpeg_decode_init(AVCodecContext *avctx);
@@ -131,7 +139,8 @@ int ff_mjpeg_decode_dqt(MJpegDecodeContext *s);
int ff_mjpeg_decode_dht(MJpegDecodeContext *s);
int ff_mjpeg_decode_sof(MJpegDecodeContext *s);
int ff_mjpeg_decode_sos(MJpegDecodeContext *s,
- const uint8_t *mb_bitmask, const AVFrame *reference);
+ const uint8_t *mb_bitmask,int mb_bitmask_size,
+ const AVFrame *reference);
int ff_mjpeg_find_marker(MJpegDecodeContext *s,
const uint8_t **buf_ptr, const uint8_t *buf_end,
const uint8_t **unescaped_buf_ptr, int *unescaped_buf_size);
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegenc.c b/chromium/third_party/ffmpeg/libavcodec/mjpegenc.c
index ffc29fd41f3..842528e5f18 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegenc.c
@@ -37,23 +37,18 @@
#include "mjpeg.h"
#include "mjpegenc.h"
-/* use two quantizer tables (one for luminance and one for chrominance) */
-/* not yet working */
-#undef TWOMATRIXES
-
-
av_cold int ff_mjpeg_encode_init(MpegEncContext *s)
{
MJpegContext *m;
if (s->width > 65500 || s->height > 65500) {
av_log(s, AV_LOG_ERROR, "JPEG does not support resolutions above 65500x65500\n");
- return -1;
+ return AVERROR(EINVAL);
}
m = av_malloc(sizeof(MJpegContext));
if (!m)
- return -1;
+ return AVERROR(ENOMEM);
s->min_qcoeff=-1023;
s->max_qcoeff= 1023;
@@ -108,34 +103,35 @@ static int put_huffman_table(PutBitContext *p, int table_class, int table_id,
static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p,
ScanTable *intra_scantable,
- uint16_t intra_matrix[64],
+ uint16_t luma_intra_matrix[64],
+ uint16_t chroma_intra_matrix[64],
int hsample[3])
{
int i, j, size;
uint8_t *ptr;
if (avctx->codec_id != AV_CODEC_ID_LJPEG) {
+ int matrix_count = 1 + !!memcmp(luma_intra_matrix,
+ chroma_intra_matrix,
+ sizeof(luma_intra_matrix[0]) * 64);
/* quant matrixes */
put_marker(p, DQT);
-#ifdef TWOMATRIXES
- put_bits(p, 16, 2 + 2 * (1 + 64));
-#else
- put_bits(p, 16, 2 + 1 * (1 + 64));
-#endif
+ put_bits(p, 16, 2 + matrix_count * (1 + 64));
put_bits(p, 4, 0); /* 8 bit precision */
put_bits(p, 4, 0); /* table 0 */
for(i=0;i<64;i++) {
j = intra_scantable->permutated[i];
- put_bits(p, 8, intra_matrix[j]);
- }
-#ifdef TWOMATRIXES
- put_bits(p, 4, 0); /* 8 bit precision */
- put_bits(p, 4, 1); /* table 1 */
- for(i=0;i<64;i++) {
- j = s->intra_scantable.permutated[i];
- put_bits(p, 8, s->chroma_intra_matrix[j]);
+ put_bits(p, 8, luma_intra_matrix[j]);
}
-#endif
+
+ if (matrix_count > 1) {
+ put_bits(p, 4, 0); /* 8 bit precision */
+ put_bits(p, 4, 1); /* table 1 */
+ for(i=0;i<64;i++) {
+ j = intra_scantable->permutated[i];
+ put_bits(p, 8, chroma_intra_matrix[j]);
+ }
+ }
}
if(avctx->active_thread_type & FF_THREAD_SLICE){
@@ -232,11 +228,15 @@ void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[3], int vsample[3
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
ScanTable *intra_scantable,
- uint16_t intra_matrix[64])
+ uint16_t luma_intra_matrix[64],
+ uint16_t chroma_intra_matrix[64])
{
const int lossless = avctx->codec_id != AV_CODEC_ID_MJPEG && avctx->codec_id != AV_CODEC_ID_AMV;
int hsample[3], vsample[3];
int i;
+ int chroma_matrix = !!memcmp(luma_intra_matrix,
+ chroma_intra_matrix,
+ sizeof(luma_intra_matrix[0])*64);
ff_mjpeg_init_hvsample(avctx, hsample, vsample);
@@ -247,7 +247,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
jpeg_put_comments(avctx, pb);
- jpeg_table_header(avctx, pb, intra_scantable, intra_matrix, hsample);
+ jpeg_table_header(avctx, pb, intra_scantable, luma_intra_matrix, chroma_intra_matrix, hsample);
switch (avctx->codec_id) {
case AV_CODEC_ID_MJPEG: put_marker(pb, SOF0 ); break;
@@ -276,21 +276,13 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
put_bits(pb, 8, 2); /* component number */
put_bits(pb, 4, hsample[1]); /* H factor */
put_bits(pb, 4, vsample[1]); /* V factor */
-#ifdef TWOMATRIXES
- put_bits(pb, 8, lossless ? 0 : 1); /* select matrix */
-#else
- put_bits(pb, 8, 0); /* select matrix */
-#endif
+ put_bits(pb, 8, lossless ? 0 : chroma_matrix); /* select matrix */
/* Cr component */
put_bits(pb, 8, 3); /* component number */
put_bits(pb, 4, hsample[2]); /* H factor */
put_bits(pb, 4, vsample[2]); /* V factor */
-#ifdef TWOMATRIXES
- put_bits(pb, 8, lossless ? 0 : 1); /* select matrix */
-#else
- put_bits(pb, 8, 0); /* select matrix */
-#endif
+ put_bits(pb, 8, lossless ? 0 : chroma_matrix); /* select matrix */
/* scan header */
put_marker(pb, SOS);
@@ -495,7 +487,7 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n)
put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]);
}
-void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64])
+void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64])
{
int i;
if (s->chroma_format == CHROMA_444) {
@@ -537,23 +529,28 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
{
MpegEncContext *s = avctx->priv_data;
- AVFrame pic = *pic_arg;
- int i;
+ AVFrame *pic;
+ int i, ret;
int chroma_h_shift, chroma_v_shift;
av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift, &chroma_v_shift);
//CODEC_FLAG_EMU_EDGE have to be cleared
if(s->avctx->flags & CODEC_FLAG_EMU_EDGE)
- return -1;
+ return AVERROR(EINVAL);
+ pic = av_frame_clone(pic_arg);
+ if (!pic)
+ return AVERROR(ENOMEM);
//picture should be flipped upside-down
for(i=0; i < 3; i++) {
int vsample = i ? 2 >> chroma_v_shift : 2;
- pic.data[i] += (pic.linesize[i] * (vsample * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 ));
- pic.linesize[i] *= -1;
+ pic->data[i] += (pic->linesize[i] * (vsample * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 ));
+ pic->linesize[i] *= -1;
}
- return ff_MPV_encode_picture(avctx, pkt, &pic, got_packet);
+ ret = ff_MPV_encode_picture(avctx, pkt, pic, got_packet);
+ av_frame_free(&pic);
+ return ret;
}
#if CONFIG_MJPEG_ENCODER
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegenc.h b/chromium/third_party/ffmpeg/libavcodec/mjpegenc.h
index 4b19e214d88..94bb652fba3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegenc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegenc.h
@@ -53,13 +53,14 @@ int ff_mjpeg_encode_init(MpegEncContext *s);
void ff_mjpeg_encode_close(MpegEncContext *s);
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
ScanTable *intra_scantable,
- uint16_t intra_matrix[64]);
+ uint16_t luma_intra_matrix[64],
+ uint16_t chroma_intra_matrix[64]);
void ff_mjpeg_encode_picture_trailer(PutBitContext *pb, int header_bits);
void ff_mjpeg_escape_FF(PutBitContext *pb, int start);
void ff_mjpeg_encode_stuffing(MpegEncContext *s);
void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[3], int vsample[3]);
void ff_mjpeg_encode_dc(PutBitContext *pb, int val,
uint8_t *huff_size, uint16_t *huff_code);
-void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]);
+void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64]);
#endif /* AVCODEC_MJPEGENC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlp.h b/chromium/third_party/ffmpeg/libavcodec/mlp.h
index d8d12929037..bb9ca26aa8f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mlp.h
@@ -124,4 +124,14 @@ static inline uint8_t xor_32_to_8(uint32_t value)
return value;
}
+typedef enum THDChannelModifier {
+ THD_CH_MODIFIER_NOTINDICATED = 0x0,
+ THD_CH_MODIFIER_STEREO = 0x0, // Stereo (not Dolby Surround)
+ THD_CH_MODIFIER_LTRT = 0x1, // Dolby Surround
+ THD_CH_MODIFIER_LBINRBIN = 0x2, // Dolby Headphone
+ THD_CH_MODIFIER_MONO = 0x3, // Mono or Dual Mono
+ THD_CH_MODIFIER_NOTSURROUNDEX = 0x1, // Not Dolby Digital EX
+ THD_CH_MODIFIER_SURROUNDEX = 0x2, // Dolby Digital EX
+} THDChannelModifier;
+
#endif /* AVCODEC_MLP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c b/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
index fcd11680761..dae19e756b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
@@ -170,14 +170,17 @@ int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
mh->group1_samplerate = mlp_samplerate(ratebits);
mh->group2_samplerate = 0;
- skip_bits(gb, 8);
+ skip_bits(gb, 4);
+
+ mh->channel_modifier_thd_stream0 = get_bits(gb, 2);
+ mh->channel_modifier_thd_stream1 = get_bits(gb, 2);
mh->channel_arrangement=
channel_arrangement = get_bits(gb, 5);
mh->channels_thd_stream1 = truehd_channels(channel_arrangement);
mh->channel_layout_thd_stream1 = ff_truehd_layout(channel_arrangement);
- skip_bits(gb, 2);
+ mh->channel_modifier_thd_stream2 = get_bits(gb, 2);
channel_arrangement = get_bits(gb, 13);
mh->channels_thd_stream2 = truehd_channels(channel_arrangement);
@@ -340,7 +343,9 @@ FF_DISABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
} else
#endif
- if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO &&
+ if (avctx->request_channel_layout &&
+ (avctx->request_channel_layout & AV_CH_LAYOUT_STEREO) ==
+ avctx->request_channel_layout &&
mh.num_substreams > 1) {
avctx->channels = 2;
avctx->channel_layout = AV_CH_LAYOUT_STEREO;
@@ -363,12 +368,16 @@ FF_DISABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
} else
#endif
- if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO &&
- mh.num_substreams > 1) {
+ if (avctx->request_channel_layout &&
+ (avctx->request_channel_layout & AV_CH_LAYOUT_STEREO) ==
+ avctx->request_channel_layout &&
+ mh.num_substreams > 1) {
avctx->channels = 2;
avctx->channel_layout = AV_CH_LAYOUT_STEREO;
- } else if (avctx->request_channel_layout == mh.channel_layout_thd_stream1 ||
- !mh.channels_thd_stream2) {
+ } else if (!mh.channels_thd_stream2 ||
+ (avctx->request_channel_layout &&
+ (avctx->request_channel_layout & mh.channel_layout_thd_stream1) ==
+ avctx->request_channel_layout)) {
avctx->channels = mh.channels_thd_stream1;
avctx->channel_layout = mh.channel_layout_thd_stream1;
} else {
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.h b/chromium/third_party/ffmpeg/libavcodec/mlp_parser.h
index 9967abbad20..5d1d2e7845c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mlp_parser.h
@@ -40,6 +40,11 @@ typedef struct MLPHeaderInfo
int group2_samplerate; ///< Sample rate of second substream (MLP only)
int channel_arrangement;
+
+ int channel_modifier_thd_stream0; ///< Channel modifier for substream 0 of TrueHD sreams ("2-channel presentation")
+ int channel_modifier_thd_stream1; ///< Channel modifier for substream 1 of TrueHD sreams ("6-channel presentation")
+ int channel_modifier_thd_stream2; ///< Channel modifier for substream 2 of TrueHD sreams ("8-channel presentation")
+
int channels_mlp; ///< Channel count for MLP streams
int channels_thd_stream1; ///< Channel count for substream 1 of TrueHD streams ("6-channel presentation")
int channels_thd_stream2; ///< Channel count for substream 2 of TrueHD streams ("8-channel presentation")
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlpdec.c b/chromium/third_party/ffmpeg/libavcodec/mlpdec.c
index aab82939aba..d25e78bcf62 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlpdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mlpdec.c
@@ -37,9 +37,16 @@
#include "mlp_parser.h"
#include "mlpdsp.h"
#include "mlp.h"
+#include "config.h"
/** number of bits used for VLC lookup - longest Huffman code is 9 */
+#if ARCH_ARM
+#define VLC_BITS 5
+#define VLC_STATIC_SIZE 64
+#else
#define VLC_BITS 9
+#define VLC_STATIC_SIZE 512
+#endif
typedef struct SubStream {
/// Set if a valid restart header has been read. Otherwise the substream cannot be decoded.
@@ -60,6 +67,8 @@ typedef struct SubStream {
uint8_t ch_assign[MAX_CHANNELS];
/// The channel layout for this substream
uint64_t ch_layout;
+ /// The matrix encoding mode for this substream
+ enum AVMatrixEncoding matrix_encoding;
/// Channel coding parameters for channels in the substream
ChannelParams channel_params[MAX_CHANNELS];
@@ -191,13 +200,13 @@ static av_cold void init_static(void)
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);
+ &ff_mlp_huffman_tables[0][0][0], 2, 1, VLC_STATIC_SIZE);
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);
+ &ff_mlp_huffman_tables[1][0][0], 2, 1, VLC_STATIC_SIZE);
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_huffman_tables[2][0][0], 2, 1, VLC_STATIC_SIZE);
}
ff_mlp_init_crc();
@@ -354,6 +363,10 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
m->avctx->sample_fmt = AV_SAMPLE_FMT_S32;
else
m->avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+ m->dsp.mlp_pack_output = m->dsp.mlp_select_pack_output(m->substream[m->max_decoded_substream].ch_assign,
+ m->substream[m->max_decoded_substream].output_shift,
+ m->substream[m->max_decoded_substream].max_matrix_channel,
+ m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
m->params_valid = 1;
for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
@@ -363,10 +376,22 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
* substream is Stereo. Subsequent substreams' layouts are indicated in the
* major sync. */
if (m->avctx->codec_id == AV_CODEC_ID_MLP) {
+ if (mh.stream_type != 0xbb) {
+ avpriv_request_sample(m->avctx,
+ "unexpected stream_type %X in MLP",
+ mh.stream_type);
+ return AVERROR_PATCHWELCOME;
+ }
if ((substr = (mh.num_substreams > 1)))
m->substream[0].ch_layout = AV_CH_LAYOUT_STEREO;
m->substream[substr].ch_layout = mh.channel_layout_mlp;
} else {
+ if (mh.stream_type != 0xba) {
+ avpriv_request_sample(m->avctx,
+ "unexpected stream_type %X in !MLP",
+ mh.stream_type);
+ return AVERROR_PATCHWELCOME;
+ }
if ((substr = (mh.num_substreams > 1)))
m->substream[0].ch_layout = AV_CH_LAYOUT_STEREO;
if (mh.num_substreams > 2)
@@ -386,6 +411,46 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
m->needs_reordering = mh.channel_arrangement >= 18 && mh.channel_arrangement <= 20;
+ /* Parse the TrueHD decoder channel modifiers and set each substream's
+ * AVMatrixEncoding accordingly.
+ *
+ * The meaning of the modifiers depends on the channel layout:
+ *
+ * - THD_CH_MODIFIER_LTRT, THD_CH_MODIFIER_LBINRBIN only apply to 2-channel
+ *
+ * - THD_CH_MODIFIER_MONO applies to 1-channel or 2-channel (dual mono)
+ *
+ * - THD_CH_MODIFIER_SURROUNDEX, THD_CH_MODIFIER_NOTSURROUNDEX only apply to
+ * layouts with an Ls/Rs channel pair
+ */
+ for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
+ m->substream[substr].matrix_encoding = AV_MATRIX_ENCODING_NONE;
+ if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD) {
+ if (mh.num_substreams > 2 &&
+ mh.channel_layout_thd_stream2 & AV_CH_SIDE_LEFT &&
+ mh.channel_layout_thd_stream2 & AV_CH_SIDE_RIGHT &&
+ mh.channel_modifier_thd_stream2 == THD_CH_MODIFIER_SURROUNDEX)
+ m->substream[2].matrix_encoding = AV_MATRIX_ENCODING_DOLBYEX;
+
+ if (mh.num_substreams > 1 &&
+ mh.channel_layout_thd_stream1 & AV_CH_SIDE_LEFT &&
+ mh.channel_layout_thd_stream1 & AV_CH_SIDE_RIGHT &&
+ mh.channel_modifier_thd_stream1 == THD_CH_MODIFIER_SURROUNDEX)
+ m->substream[1].matrix_encoding = AV_MATRIX_ENCODING_DOLBYEX;
+
+ if (mh.num_substreams > 0)
+ switch (mh.channel_modifier_thd_stream0) {
+ case THD_CH_MODIFIER_LTRT:
+ m->substream[0].matrix_encoding = AV_MATRIX_ENCODING_DOLBY;
+ break;
+ case THD_CH_MODIFIER_LBINRBIN:
+ m->substream[0].matrix_encoding = AV_MATRIX_ENCODING_DOLBYHEADPHONE;
+ break;
+ default:
+ break;
+ }
+ }
+
return 0;
}
@@ -474,8 +539,8 @@ FF_DISABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
} else
#endif
- if (m->avctx->request_channel_layout == s->ch_layout &&
- m->max_decoded_substream > substr) {
+ if (m->avctx->request_channel_layout && (s->ch_layout & m->avctx->request_channel_layout) ==
+ m->avctx->request_channel_layout && m->max_decoded_substream > substr) {
av_log(m->avctx, AV_LOG_DEBUG,
"Extracting %d-channel downmix (0x%"PRIx64") from substream %d. "
"Further substreams will be skipped.\n",
@@ -551,6 +616,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (substr == m->max_decoded_substream) {
m->avctx->channels = s->max_matrix_channel + 1;
m->avctx->channel_layout = s->ch_layout;
+ m->dsp.mlp_pack_output = m->dsp.mlp_select_pack_output(s->ch_assign,
+ s->output_shift,
+ s->max_matrix_channel,
+ m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
if (m->avctx->codec_id == AV_CODEC_ID_MLP && m->needs_reordering) {
if (m->avctx->channel_layout == (AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY) ||
@@ -796,9 +865,15 @@ static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp,
return ret;
if (s->param_presence_flags & PARAM_OUTSHIFT)
- if (get_bits1(gbp))
+ if (get_bits1(gbp)) {
for (ch = 0; ch <= s->max_matrix_channel; ch++)
s->output_shift[ch] = get_sbits(gbp, 4);
+ if (substr == m->max_decoded_substream)
+ m->dsp.mlp_pack_output = m->dsp.mlp_select_pack_output(s->ch_assign,
+ s->output_shift,
+ s->max_matrix_channel,
+ m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
+ }
if (s->param_presence_flags & PARAM_QUANTSTEP)
if (get_bits1(gbp))
@@ -963,7 +1038,7 @@ static void fill_noise_buffer(MLPDecodeContext *m, unsigned int substr)
static void rematrix_channels(MLPDecodeContext *m, unsigned int substr)
{
SubStream *s = &m->substream[substr];
- unsigned int mat, src_ch, i;
+ unsigned int mat;
unsigned int maxchan;
maxchan = s->max_matrix_channel;
@@ -975,31 +1050,18 @@ static void rematrix_channels(MLPDecodeContext *m, unsigned int substr)
}
for (mat = 0; mat < s->num_primitive_matrices; mat++) {
- int matrix_noise_shift = s->matrix_noise_shift[mat];
unsigned int dest_ch = s->matrix_out_ch[mat];
- int32_t mask = MSB_MASK(s->quant_step_size[dest_ch]);
- int32_t *coeffs = s->matrix_coeff[mat];
- int index = s->num_primitive_matrices - mat;
- int index2 = 2 * index + 1;
-
- /* TODO: DSPContext? */
-
- for (i = 0; i < s->blockpos; i++) {
- int32_t bypassed_lsb = m->bypassed_lsbs[i][mat];
- int32_t *samples = m->sample_buffer[i];
- int64_t accum = 0;
-
- for (src_ch = 0; src_ch <= maxchan; src_ch++)
- accum += (int64_t) samples[src_ch] * coeffs[src_ch];
-
- if (matrix_noise_shift) {
- index &= m->access_unit_size_pow2 - 1;
- accum += m->noise_buffer[index] << (matrix_noise_shift + 7);
- index += index2;
- }
-
- samples[dest_ch] = ((accum >> 14) & mask) + bypassed_lsb;
- }
+ m->dsp.mlp_rematrix_channel(&m->sample_buffer[0][0],
+ s->matrix_coeff[mat],
+ &m->bypassed_lsbs[0][mat],
+ m->noise_buffer,
+ s->num_primitive_matrices - mat,
+ dest_ch,
+ s->blockpos,
+ maxchan,
+ s->matrix_noise_shift[mat],
+ m->access_unit_size_pow2,
+ MSB_MASK(s->quant_step_size[dest_ch]));
}
}
@@ -1010,9 +1072,6 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
{
AVCodecContext *avctx = m->avctx;
SubStream *s = &m->substream[substr];
- unsigned int i, out_ch = 0;
- int32_t *data_32;
- int16_t *data_16;
int ret;
int is32 = (m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
@@ -1030,19 +1089,18 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
frame->nb_samples = s->blockpos;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
- data_32 = (int32_t *)frame->data[0];
- data_16 = (int16_t *)frame->data[0];
-
- for (i = 0; i < s->blockpos; i++) {
- for (out_ch = 0; out_ch <= s->max_matrix_channel; out_ch++) {
- int mat_ch = s->ch_assign[out_ch];
- int32_t sample = m->sample_buffer[i][mat_ch]
- << s->output_shift[mat_ch];
- s->lossless_check_data ^= (sample & 0xffffff) << mat_ch;
- if (is32) *data_32++ = sample << 8;
- else *data_16++ = sample >> 8;
- }
- }
+ s->lossless_check_data = m->dsp.mlp_pack_output(s->lossless_check_data,
+ s->blockpos,
+ m->sample_buffer,
+ frame->data[0],
+ s->ch_assign,
+ s->output_shift,
+ s->max_matrix_channel,
+ is32);
+
+ /* Update matrix encoding side data */
+ if ((ret = ff_side_data_update_matrix_encoding(frame, s->matrix_encoding)) < 0)
+ return ret;
*got_frame_ptr = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlpdsp.c b/chromium/third_party/ffmpeg/libavcodec/mlpdsp.c
index b413e86db5d..3ae8c377081 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlpdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mlpdsp.c
@@ -57,9 +57,82 @@ static void mlp_filter_channel(int32_t *state, const int32_t *coeff,
}
}
+void ff_mlp_rematrix_channel(int32_t *samples,
+ const int32_t *coeffs,
+ const uint8_t *bypassed_lsbs,
+ const int8_t *noise_buffer,
+ int index,
+ unsigned int dest_ch,
+ uint16_t blockpos,
+ unsigned int maxchan,
+ int matrix_noise_shift,
+ int access_unit_size_pow2,
+ int32_t mask)
+{
+ unsigned int src_ch, i;
+ int index2 = 2 * index + 1;
+ for (i = 0; i < blockpos; i++) {
+ int64_t accum = 0;
+
+ for (src_ch = 0; src_ch <= maxchan; src_ch++)
+ accum += (int64_t) samples[src_ch] * coeffs[src_ch];
+
+ if (matrix_noise_shift) {
+ index &= access_unit_size_pow2 - 1;
+ accum += noise_buffer[index] << (matrix_noise_shift + 7);
+ index += index2;
+ }
+
+ samples[dest_ch] = ((accum >> 14) & mask) + *bypassed_lsbs;
+ bypassed_lsbs += MAX_CHANNELS;
+ samples += MAX_CHANNELS;
+ }
+}
+
+static int32_t (*mlp_select_pack_output(uint8_t *ch_assign,
+ int8_t *output_shift,
+ uint8_t max_matrix_channel,
+ int is32))(int32_t, uint16_t, int32_t (*)[], void *, uint8_t*, int8_t *, uint8_t, int)
+{
+ return ff_mlp_pack_output;
+}
+
+int32_t ff_mlp_pack_output(int32_t lossless_check_data,
+ uint16_t blockpos,
+ int32_t (*sample_buffer)[MAX_CHANNELS],
+ void *data,
+ uint8_t *ch_assign,
+ int8_t *output_shift,
+ uint8_t max_matrix_channel,
+ int is32)
+{
+ unsigned int i, out_ch = 0;
+ int32_t *data_32 = data;
+ int16_t *data_16 = data;
+
+ for (i = 0; i < blockpos; i++) {
+ for (out_ch = 0; out_ch <= max_matrix_channel; out_ch++) {
+ int mat_ch = ch_assign[out_ch];
+ int32_t sample = sample_buffer[i][mat_ch]
+ << output_shift[mat_ch];
+ lossless_check_data ^= (sample & 0xffffff) << mat_ch;
+ if (is32)
+ *data_32++ = sample << 8;
+ else
+ *data_16++ = sample >> 8;
+ }
+ }
+ return lossless_check_data;
+}
+
av_cold void ff_mlpdsp_init(MLPDSPContext *c)
{
c->mlp_filter_channel = mlp_filter_channel;
+ c->mlp_rematrix_channel = ff_mlp_rematrix_channel;
+ c->mlp_select_pack_output = mlp_select_pack_output;
+ c->mlp_pack_output = ff_mlp_pack_output;
+ if (ARCH_ARM)
+ ff_mlpdsp_init_arm(c);
if (ARCH_X86)
ff_mlpdsp_init_x86(c);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlpdsp.h b/chromium/third_party/ffmpeg/libavcodec/mlpdsp.h
index 84a8aa3a3e1..a0edeb77629 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlpdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mlpdsp.h
@@ -23,15 +23,61 @@
#define AVCODEC_MLPDSP_H
#include <stdint.h>
+#include "mlp.h"
+
+void ff_mlp_rematrix_channel(int32_t *samples,
+ const int32_t *coeffs,
+ const uint8_t *bypassed_lsbs,
+ const int8_t *noise_buffer,
+ int index,
+ unsigned int dest_ch,
+ uint16_t blockpos,
+ unsigned int maxchan,
+ int matrix_noise_shift,
+ int access_unit_size_pow2,
+ int32_t mask);
+
+int32_t ff_mlp_pack_output(int32_t lossless_check_data,
+ uint16_t blockpos,
+ int32_t (*sample_buffer)[MAX_CHANNELS],
+ void *data,
+ uint8_t *ch_assign,
+ int8_t *output_shift,
+ uint8_t max_matrix_channel,
+ int is32);
typedef struct MLPDSPContext {
void (*mlp_filter_channel)(int32_t *state, const int32_t *coeff,
int firorder, int iirorder,
unsigned int filter_shift, int32_t mask,
int blocksize, int32_t *sample_buffer);
+ void (*mlp_rematrix_channel)(int32_t *samples,
+ const int32_t *coeffs,
+ const uint8_t *bypassed_lsbs,
+ const int8_t *noise_buffer,
+ int index,
+ unsigned int dest_ch,
+ uint16_t blockpos,
+ unsigned int maxchan,
+ int matrix_noise_shift,
+ int access_unit_size_pow2,
+ int32_t mask);
+ int32_t (*(*mlp_select_pack_output)(uint8_t *ch_assign,
+ int8_t *output_shift,
+ uint8_t max_matrix_channel,
+ int is32))(int32_t, uint16_t, int32_t (*)[], void *, uint8_t*, int8_t *, uint8_t, int);
+ int32_t (*mlp_pack_output)(int32_t lossless_check_data,
+ uint16_t blockpos,
+ int32_t (*sample_buffer)[MAX_CHANNELS],
+ void *data,
+ uint8_t *ch_assign,
+ int8_t *output_shift,
+ uint8_t max_matrix_channel,
+ int is32);
} MLPDSPContext;
void ff_mlpdsp_init(MLPDSPContext *c);
+void ff_mlpdsp_init_arm(MLPDSPContext *c);
void ff_mlpdsp_init_x86(MLPDSPContext *c);
#endif /* AVCODEC_MLPDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/motion_est.c b/chromium/third_party/ffmpeg/libavcodec/motion_est.c
index f4d217bf30f..939dedf17d3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motion_est.c
+++ b/chromium/third_party/ffmpeg/libavcodec/motion_est.c
@@ -33,6 +33,7 @@
#include "avcodec.h"
#include "mathops.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#undef NDEBUG
@@ -285,7 +286,9 @@ static int cmp_qpel(MpegEncContext *s, const int x, const int y, const int subx,
#include "motion_est_template.c"
-static int zero_cmp(void *s, uint8_t *a, uint8_t *b, int stride, int h){
+static int zero_cmp(MpegEncContext *s, uint8_t *a, uint8_t *b,
+ int stride, int h)
+{
return 0;
}
@@ -390,10 +393,9 @@ static int sad_hpel_motion_search(MpegEncContext * s,
int mx, my, dminh;
uint8_t *pix, *ptr;
int stride= c->stride;
- const int flags= c->sub_flags;
LOAD_COMMON
- av_assert2(flags == 0);
+ av_assert2(c->sub_flags == 0);
if(c->skip){
*mx_ptr = 0;
@@ -668,7 +670,7 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift)
return INT_MAX;
if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
- dmin_sum += s->dsp.mb_cmp[0](s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*16*stride, c->scratchpad, stride, 16);
+ dmin_sum += s->dsp.mb_cmp[0](s, s->new_picture.f->data[0] + s->mb_x*16 + s->mb_y*16*stride, c->scratchpad, stride, 16);
}
if(c->avctx->mb_cmp&FF_CMP_CHROMA){
@@ -683,15 +685,15 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift)
offset= (s->mb_x*8 + (mx>>1)) + (s->mb_y*8 + (my>>1))*s->uvlinesize;
if(s->no_rounding){
- s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad , s->last_picture.f.data[1] + offset, s->uvlinesize, 8);
- s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad + 8, s->last_picture.f.data[2] + offset, s->uvlinesize, 8);
+ s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad , s->last_picture.f->data[1] + offset, s->uvlinesize, 8);
+ s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad + 8, s->last_picture.f->data[2] + offset, s->uvlinesize, 8);
}else{
- s->hdsp.put_pixels_tab [1][dxy](c->scratchpad , s->last_picture.f.data[1] + offset, s->uvlinesize, 8);
- s->hdsp.put_pixels_tab [1][dxy](c->scratchpad + 8, s->last_picture.f.data[2] + offset, s->uvlinesize, 8);
+ s->hdsp.put_pixels_tab [1][dxy](c->scratchpad , s->last_picture.f->data[1] + offset, s->uvlinesize, 8);
+ s->hdsp.put_pixels_tab [1][dxy](c->scratchpad + 8, s->last_picture.f->data[2] + offset, s->uvlinesize, 8);
}
- dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.f.data[1] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad , s->uvlinesize, 8);
- dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.f.data[2] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad+8, s->uvlinesize, 8);
+ dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.f->data[1] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad , s->uvlinesize, 8);
+ dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.f->data[2] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad+8, s->uvlinesize, 8);
}
c->pred_x= mx;
@@ -879,7 +881,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
int mb_type=0;
Picture * const pic= &s->current_picture;
- init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0);
+ init_ref(c, s->new_picture.f->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0);
av_assert0(s->quarter_sample==0 || s->quarter_sample==1);
av_assert0(s->linesize == c->stride);
@@ -989,7 +991,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
// if (varc*2 + 200*256 + 50*(s->lambda2>>FF_LAMBDA_SHIFT) > vard){
mb_type|= CANDIDATE_MB_TYPE_INTER;
c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
- if(s->flags&CODEC_FLAG_MV0)
+ if (s->mpv_flags & FF_MPV_FLAG_MV0)
if(mx || my)
mb_type |= CANDIDATE_MB_TYPE_SKIPPED; //FIXME check difference
}else{
@@ -1078,7 +1080,7 @@ int ff_pre_estimate_p_frame_motion(MpegEncContext * s,
int P[10][2];
const int shift= 1+s->quarter_sample;
const int xy= mb_x + mb_y*s->mb_stride;
- init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0);
+ init_ref(c, s->new_picture.f->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0);
av_assert0(s->quarter_sample==0 || s->quarter_sample==1);
@@ -1517,8 +1519,8 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
int fmin, bmin, dmin, fbmin, bimin, fimin;
int type=0;
const int xy = mb_y*s->mb_stride + mb_x;
- init_ref(c, s->new_picture.f.data, s->last_picture.f.data,
- s->next_picture.f.data, 16 * mb_x, 16 * mb_y, 2);
+ init_ref(c, s->new_picture.f->data, s->last_picture.f->data,
+ s->next_picture.f->data, 16 * mb_x, 16 * mb_y, 2);
get_limits(s, 16*mb_x, 16*mb_y);
@@ -1608,7 +1610,8 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
}
//FIXME something smarter
if(dmin>256*256*16) type&= ~CANDIDATE_MB_TYPE_DIRECT; //do not try direct mode if it is invalid for this MB
- if(s->codec_id == AV_CODEC_ID_MPEG4 && type&CANDIDATE_MB_TYPE_DIRECT && s->flags&CODEC_FLAG_MV0 && *(uint32_t*)s->b_direct_mv_table[xy])
+ if (s->codec_id == AV_CODEC_ID_MPEG4 && type&CANDIDATE_MB_TYPE_DIRECT &&
+ s->mpv_flags & FF_MPV_FLAG_MV0 && *(uint32_t*)s->b_direct_mv_table[xy])
type |= CANDIDATE_MB_TYPE_DIRECT0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/motion_est_template.c b/chromium/third_party/ffmpeg/libavcodec/motion_est_template.c
index 3123edcf925..53a39c0cbee 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motion_est_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/motion_est_template.c
@@ -24,6 +24,8 @@
* Motion estimation template.
*/
+#include "mpegvideo.h"
+
//Let us hope gcc will remove the unused vars ...(gcc 3.2.2 seems to do it ...)
#define LOAD_COMMON\
uint32_t av_unused * const score_map= c->score_map;\
@@ -892,7 +894,8 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int
score_map[0]= dmin;
//FIXME precalc first term below?
- if((s->pict_type == AV_PICTURE_TYPE_B && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
+ if ((s->pict_type == AV_PICTURE_TYPE_B && !(c->flags & FLAG_DIRECT)) ||
+ s->mpv_flags & FF_MPV_FLAG_MV0)
dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
/* first line */
diff --git a/chromium/third_party/ffmpeg/libavcodec/motionpixels.c b/chromium/third_party/ffmpeg/libavcodec/motionpixels.c
index 089909a4d8a..13d4759ae6b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motionpixels.c
+++ b/chromium/third_party/ffmpeg/libavcodec/motionpixels.c
@@ -77,10 +77,10 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
motionpixels_tableinit();
mp->avctx = avctx;
ff_dsputil_init(&mp->dsp, avctx);
- mp->changes_map = av_mallocz(avctx->width * h4);
+ mp->changes_map = av_mallocz_array(avctx->width, h4);
mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1;
- mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));
- mp->hpt = av_mallocz(h4 * w4 / 16 * sizeof(YuvPixel));
+ mp->vpt = av_mallocz_array(avctx->height, sizeof(YuvPixel));
+ mp->hpt = av_mallocz_array(h4 / 4, w4 / 4 * sizeof(YuvPixel));
if (!mp->changes_map || !mp->vpt || !mp->hpt) {
av_freep(&mp->changes_map);
av_freep(&mp->vpt);
diff --git a/chromium/third_party/ffmpeg/libavcodec/motionpixels_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/motionpixels_tablegen.c
index 31e5cdf710e..14b7b9bb8ca 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motionpixels_tablegen.c
+++ b/chromium/third_party/ffmpeg/libavcodec/motionpixels_tablegen.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
#define CONFIG_HARDCODED_TABLES 0
#define MAX_NEG_CROP 0
-#define ff_cropTbl ((uint8_t *)NULL)
+#define ff_crop_tab ((uint8_t *)NULL)
#include "motionpixels_tablegen.h"
#include "tableprint.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/motionpixels_tablegen.h b/chromium/third_party/ffmpeg/libavcodec/motionpixels_tablegen.h
index b9802e589df..8fb840f0fad 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motionpixels_tablegen.h
+++ b/chromium/third_party/ffmpeg/libavcodec/motionpixels_tablegen.h
@@ -30,7 +30,7 @@ typedef struct YuvPixel {
} YuvPixel;
static int mp_yuv_to_rgb(int y, int v, int u, int clip_rgb) {
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
int r, g, b;
r = (1000 * y + 701 * v) / 1000;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpc8.c b/chromium/third_party/ffmpeg/libavcodec/mpc8.c
index 2f58805e188..29c65f9ef54 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpc8.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpc8.c
@@ -29,7 +29,6 @@
#include "libavutil/lfg.h"
#include "avcodec.h"
#include "get_bits.h"
-#include "dsputil.h"
#include "internal.h"
#include "mpegaudiodsp.h"
@@ -119,7 +118,6 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
}
memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
av_lfg_init(&c->rnd, 0xDEADBEEF);
- ff_dsputil_init(&c->dsp, avctx);
ff_mpadsp_init(&c->mpadsp);
ff_mpc_init();
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg12.c b/chromium/third_party/ffmpeg/libavcodec/mpeg12.c
index c391ffda0e5..f4786c0ce40 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg12.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg12.c
@@ -31,7 +31,6 @@
#include "internal.h"
#include "avcodec.h"
-#include "dsputil.h"
#include "mpegvideo.h"
#include "error_resilience.h"
#include "mpeg12.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg12dec.c b/chromium/third_party/ffmpeg/libavcodec/mpeg12dec.c
index 11048670af0..f77fc6e1a84 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg12dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg12dec.c
@@ -25,33 +25,41 @@
* MPEG-1/2 decoder
*/
+#define UNCHECKED_BITSTREAM_READER 1
+#include <inttypes.h>
+
#include "libavutil/attributes.h"
#include "libavutil/internal.h"
-#include "internal.h"
+#include "libavutil/stereo3d.h"
+
#include "avcodec.h"
+#include "bytestream.h"
#include "dsputil.h"
-#include "mpegvideo.h"
#include "error_resilience.h"
+#include "internal.h"
#include "mpeg12.h"
#include "mpeg12data.h"
-#include "bytestream.h"
-#include "vdpau_internal.h"
-#include "xvmc_internal.h"
+#include "mpegutils.h"
+#include "mpegvideo.h"
#include "thread.h"
#include "version.h"
+#include "vdpau_internal.h"
+#include "xvmc_internal.h"
typedef struct Mpeg1Context {
MpegEncContext mpeg_enc_ctx;
int mpeg_enc_ctx_allocated; /* true if decoding context allocated */
- int repeat_field; /* true if we must repeat the field */
- AVPanScan pan_scan; /**< some temporary storage for the panscan */
+ int repeat_field; /* true if we must repeat the field */
+ AVPanScan pan_scan; /* some temporary storage for the panscan */
+ AVStereo3D stereo3d;
+ int has_stereo3d;
uint8_t *a53_caption;
int a53_caption_size;
int slice_count;
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?
+ AVRational frame_rate_ext; /* MPEG-2 specific framerate modificator */
+ int sync; /* Did we reach a sync point like a GOP/SEQ/KEYFrame? */
int tmpgexs;
int first_slice;
int extradata_decoded;
@@ -84,10 +92,10 @@ static const uint32_t btype2mb_type[11] = {
};
static const uint8_t non_linear_qscale[32] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8,10,12,14,16,18,20,22,
- 24,28,32,36,40,44,48,52,
- 56,64,72,80,88,96,104,112,
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 10, 12, 14, 16, 18, 20, 22,
+ 24, 28, 32, 36, 40, 44, 48, 52,
+ 56, 64, 72, 80, 88, 96, 104, 112,
};
/* as H.263, but only 17 codes */
@@ -96,12 +104,10 @@ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred)
int code, sign, val, shift;
code = get_vlc2(&s->gb, ff_mv_vlc.table, MV_VLC_BITS, 2);
- if (code == 0) {
+ if (code == 0)
return pred;
- }
- if (code < 0) {
+ if (code < 0)
return 0xffff;
- }
sign = get_bits1(&s->gb);
shift = fcode - 1;
@@ -119,12 +125,22 @@ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred)
return sign_extend(val, 5 + shift);
}
-static inline int mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
+#define check_scantable_index(ctx, x) \
+ do { \
+ if ((x) > 63) { \
+ av_log(ctx->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", \
+ ctx->mb_x, ctx->mb_y); \
+ return AVERROR_INVALIDDATA; \
+ } \
+ } while (0)
+
+static inline int mpeg1_decode_block_intra(MpegEncContext *s,
+ int16_t *block, int n)
{
int level, dc, diff, i, j, run;
int component;
- RLTable *rl = &ff_rl_mpeg1;
- uint8_t * const scantable = s->intra_scantable.permutated;
+ RLTable *rl = &ff_rl_mpeg1;
+ uint8_t *const scantable = s->intra_scantable.permutated;
const uint16_t *quant_matrix = s->intra_matrix;
const int qscale = s->qscale;
@@ -141,31 +157,40 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, in
i = 0;
{
OPEN_READER(re, &s->gb);
+ UPDATE_CACHE(re, &s->gb);
+ if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
+ goto end;
+
/* now quantify & encode AC coefficients */
for (;;) {
- UPDATE_CACHE(re, &s->gb);
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
+ GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
+ TEX_VLC_BITS, 2, 0);
- if (level == 127) {
- break;
- } else if (level != 0) {
+ if (level != 0) {
i += run;
+ check_scantable_index(s, i);
j = scantable[i];
level = (level * qscale * quant_matrix[j]) >> 4;
level = (level - 1) | 1;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- LAST_SKIP_BITS(re, &s->gb, 1);
+ level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
+ SHOW_SBITS(re, &s->gb, 1);
+ SKIP_BITS(re, &s->gb, 1);
} else {
/* escape */
- run = SHOW_UBITS(re, &s->gb, 6) + 1; LAST_SKIP_BITS(re, &s->gb, 6);
+ run = SHOW_UBITS(re, &s->gb, 6) + 1;
+ LAST_SKIP_BITS(re, &s->gb, 6);
UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 8); SKIP_BITS(re, &s->gb, 8);
+ level = SHOW_SBITS(re, &s->gb, 8);
+ SKIP_BITS(re, &s->gb, 8);
if (level == -128) {
- level = SHOW_UBITS(re, &s->gb, 8) - 256; LAST_SKIP_BITS(re, &s->gb, 8);
+ level = SHOW_UBITS(re, &s->gb, 8) - 256;
+ SKIP_BITS(re, &s->gb, 8);
} else if (level == 0) {
- level = SHOW_UBITS(re, &s->gb, 8) ; LAST_SKIP_BITS(re, &s->gb, 8);
+ level = SHOW_UBITS(re, &s->gb, 8);
+ SKIP_BITS(re, &s->gb, 8);
}
i += run;
+ check_scantable_index(s, i);
j = scantable[i];
if (level < 0) {
level = -level;
@@ -177,17 +202,19 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, in
level = (level - 1) | 1;
}
}
- if (i > 63) {
- av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
block[j] = level;
+ if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
+ break;
+
+ UPDATE_CACHE(re, &s->gb);
}
+end:
+ LAST_SKIP_BITS(re, &s->gb, 2);
CLOSE_READER(re, &s->gb);
}
s->block_last_index[n] = i;
- return 0;
+ return 0;
}
int ff_mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
@@ -195,11 +222,12 @@ int ff_mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
return mpeg1_decode_block_intra(s, block, n);
}
-static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *block, int n)
+static inline int mpeg1_decode_block_inter(MpegEncContext *s,
+ int16_t *block, int n)
{
int level, i, j, run;
- RLTable *rl = &ff_rl_mpeg1;
- uint8_t * const scantable = s->intra_scantable.permutated;
+ RLTable *rl = &ff_rl_mpeg1;
+ uint8_t *const scantable = s->intra_scantable.permutated;
const uint16_t *quant_matrix = s->inter_matrix;
const int qscale = s->qscale;
@@ -208,7 +236,7 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *block, in
i = -1;
// special case for first coefficient, no need to add second VLC table
UPDATE_CACHE(re, &s->gb);
- if (((int32_t)GET_CACHE(re, &s->gb)) < 0) {
+ if (((int32_t) GET_CACHE(re, &s->gb)) < 0) {
level = (3 * qscale * quant_matrix[0]) >> 5;
level = (level - 1) | 1;
if (GET_CACHE(re, &s->gb) & 0x40000000)
@@ -216,31 +244,39 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *block, in
block[0] = level;
i++;
SKIP_BITS(re, &s->gb, 2);
- if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
+ if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
goto end;
}
/* now quantify & encode AC coefficients */
for (;;) {
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
+ GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
+ TEX_VLC_BITS, 2, 0);
if (level != 0) {
i += run;
+ check_scantable_index(s, i);
j = scantable[i];
level = ((level * 2 + 1) * qscale * quant_matrix[j]) >> 5;
level = (level - 1) | 1;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
+ level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
+ SHOW_SBITS(re, &s->gb, 1);
SKIP_BITS(re, &s->gb, 1);
} else {
/* escape */
- run = SHOW_UBITS(re, &s->gb, 6) + 1; LAST_SKIP_BITS(re, &s->gb, 6);
+ run = SHOW_UBITS(re, &s->gb, 6) + 1;
+ LAST_SKIP_BITS(re, &s->gb, 6);
UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 8); SKIP_BITS(re, &s->gb, 8);
+ level = SHOW_SBITS(re, &s->gb, 8);
+ SKIP_BITS(re, &s->gb, 8);
if (level == -128) {
- level = SHOW_UBITS(re, &s->gb, 8) - 256; SKIP_BITS(re, &s->gb, 8);
+ level = SHOW_UBITS(re, &s->gb, 8) - 256;
+ SKIP_BITS(re, &s->gb, 8);
} else if (level == 0) {
- level = SHOW_UBITS(re, &s->gb, 8) ; SKIP_BITS(re, &s->gb, 8);
+ level = SHOW_UBITS(re, &s->gb, 8);
+ SKIP_BITS(re, &s->gb, 8);
}
i += run;
+ check_scantable_index(s, i);
j = scantable[i];
if (level < 0) {
level = -level;
@@ -252,13 +288,9 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *block, in
level = (level - 1) | 1;
}
}
- if (i > 63) {
- av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
block[j] = level;
- if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
+ if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
break;
UPDATE_CACHE(re, &s->gb);
}
@@ -275,19 +307,20 @@ end:
* Changing this would eat up any speed benefits it has.
* Do not use "fast" flag if you need the code to be robust.
*/
-static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, int16_t *block, int n)
+static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s,
+ int16_t *block, int n)
{
int level, i, j, run;
- RLTable *rl = &ff_rl_mpeg1;
- uint8_t * const scantable = s->intra_scantable.permutated;
- const int qscale = s->qscale;
+ RLTable *rl = &ff_rl_mpeg1;
+ uint8_t *const scantable = s->intra_scantable.permutated;
+ const int qscale = s->qscale;
{
OPEN_READER(re, &s->gb);
i = -1;
- // special case for first coefficient, no need to add second VLC table
+ // Special case for first coefficient, no need to add second VLC table.
UPDATE_CACHE(re, &s->gb);
- if (((int32_t)GET_CACHE(re, &s->gb)) < 0) {
+ if (((int32_t) GET_CACHE(re, &s->gb)) < 0) {
level = (3 * qscale) >> 1;
level = (level - 1) | 1;
if (GET_CACHE(re, &s->gb) & 0x40000000)
@@ -295,32 +328,40 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, int16_t *bloc
block[0] = level;
i++;
SKIP_BITS(re, &s->gb, 2);
- if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
+ if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
goto end;
}
/* now quantify & encode AC coefficients */
for (;;) {
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
+ GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
+ TEX_VLC_BITS, 2, 0);
if (level != 0) {
i += run;
+ check_scantable_index(s, i);
j = scantable[i];
level = ((level * 2 + 1) * qscale) >> 1;
level = (level - 1) | 1;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
+ level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
+ SHOW_SBITS(re, &s->gb, 1);
SKIP_BITS(re, &s->gb, 1);
} else {
/* escape */
- run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
+ run = SHOW_UBITS(re, &s->gb, 6) + 1;
+ LAST_SKIP_BITS(re, &s->gb, 6);
UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 8); SKIP_BITS(re, &s->gb, 8);
+ level = SHOW_SBITS(re, &s->gb, 8);
+ SKIP_BITS(re, &s->gb, 8);
if (level == -128) {
- level = SHOW_UBITS(re, &s->gb, 8) - 256; SKIP_BITS(re, &s->gb, 8);
+ level = SHOW_UBITS(re, &s->gb, 8) - 256;
+ SKIP_BITS(re, &s->gb, 8);
} else if (level == 0) {
- level = SHOW_UBITS(re, &s->gb, 8) ; SKIP_BITS(re, &s->gb, 8);
+ level = SHOW_UBITS(re, &s->gb, 8);
+ SKIP_BITS(re, &s->gb, 8);
}
i += run;
+ check_scantable_index(s, i);
j = scantable[i];
if (level < 0) {
level = -level;
@@ -334,7 +375,7 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, int16_t *bloc
}
block[j] = level;
- if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
+ if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
break;
UPDATE_CACHE(re, &s->gb);
}
@@ -346,12 +387,12 @@ end:
return 0;
}
-
-static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, int16_t *block, int n)
+static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
+ int16_t *block, int n)
{
int level, i, j, run;
RLTable *rl = &ff_rl_mpeg1;
- uint8_t * const scantable = s->intra_scantable.permutated;
+ uint8_t *const scantable = s->intra_scantable.permutated;
const uint16_t *quant_matrix;
const int qscale = s->qscale;
int mismatch;
@@ -366,37 +407,43 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, int16_t *block
else
quant_matrix = s->chroma_inter_matrix;
- // special case for first coefficient, no need to add second VLC table
+ // Special case for first coefficient, no need to add second VLC table.
UPDATE_CACHE(re, &s->gb);
- if (((int32_t)GET_CACHE(re, &s->gb)) < 0) {
- level= (3 * qscale * quant_matrix[0]) >> 5;
+ if (((int32_t) GET_CACHE(re, &s->gb)) < 0) {
+ level = (3 * qscale * quant_matrix[0]) >> 5;
if (GET_CACHE(re, &s->gb) & 0x40000000)
level = -level;
block[0] = level;
mismatch ^= level;
i++;
SKIP_BITS(re, &s->gb, 2);
- if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
+ if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
goto end;
}
/* now quantify & encode AC coefficients */
for (;;) {
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
+ GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
+ TEX_VLC_BITS, 2, 0);
if (level != 0) {
i += run;
+ check_scantable_index(s, i);
j = scantable[i];
level = ((level * 2 + 1) * qscale * quant_matrix[j]) >> 5;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
+ level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
+ SHOW_SBITS(re, &s->gb, 1);
SKIP_BITS(re, &s->gb, 1);
} else {
/* escape */
- run = SHOW_UBITS(re, &s->gb, 6) + 1; LAST_SKIP_BITS(re, &s->gb, 6);
+ run = SHOW_UBITS(re, &s->gb, 6) + 1;
+ LAST_SKIP_BITS(re, &s->gb, 6);
UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 12); SKIP_BITS(re, &s->gb, 12);
+ level = SHOW_SBITS(re, &s->gb, 12);
+ SKIP_BITS(re, &s->gb, 12);
i += run;
+ check_scantable_index(s, i);
j = scantable[i];
if (level < 0) {
level = ((-level * 2 + 1) * qscale * quant_matrix[j]) >> 5;
@@ -405,14 +452,10 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, int16_t *block
level = ((level * 2 + 1) * qscale * quant_matrix[j]) >> 5;
}
}
- if (i > 63) {
- av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
mismatch ^= level;
block[j] = level;
- if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
+ if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
break;
UPDATE_CACHE(re, &s->gb);
}
@@ -435,22 +478,22 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
int16_t *block, int n)
{
int level, i, j, run;
- RLTable *rl = &ff_rl_mpeg1;
- uint8_t * const scantable = s->intra_scantable.permutated;
- const int qscale = s->qscale;
+ RLTable *rl = &ff_rl_mpeg1;
+ uint8_t *const scantable = s->intra_scantable.permutated;
+ const int qscale = s->qscale;
OPEN_READER(re, &s->gb);
i = -1;
// special case for first coefficient, no need to add second VLC table
UPDATE_CACHE(re, &s->gb);
- if (((int32_t)GET_CACHE(re, &s->gb)) < 0) {
+ if (((int32_t) GET_CACHE(re, &s->gb)) < 0) {
level = (3 * qscale) >> 1;
if (GET_CACHE(re, &s->gb) & 0x40000000)
level = -level;
block[0] = level;
i++;
SKIP_BITS(re, &s->gb, 2);
- if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
+ if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
goto end;
}
@@ -460,18 +503,21 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
if (level != 0) {
i += run;
- j = scantable[i];
+ j = scantable[i];
level = ((level * 2 + 1) * qscale) >> 1;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
+ level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
+ SHOW_SBITS(re, &s->gb, 1);
SKIP_BITS(re, &s->gb, 1);
} else {
/* escape */
- run = SHOW_UBITS(re, &s->gb, 6) + 1; LAST_SKIP_BITS(re, &s->gb, 6);
+ run = SHOW_UBITS(re, &s->gb, 6) + 1;
+ LAST_SKIP_BITS(re, &s->gb, 6);
UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 12); SKIP_BITS(re, &s->gb, 12);
+ level = SHOW_SBITS(re, &s->gb, 12);
+ SKIP_BITS(re, &s->gb, 12);
i += run;
- j = scantable[i];
+ j = scantable[i];
if (level < 0) {
level = ((-level * 2 + 1) * qscale) >> 1;
level = -level;
@@ -481,8 +527,9 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
}
block[j] = level;
- if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
+ if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF || i > 63)
break;
+
UPDATE_CACHE(re, &s->gb);
}
end:
@@ -492,13 +539,13 @@ end:
return 0;
}
-
-static inline int mpeg2_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
+static inline int mpeg2_decode_block_intra(MpegEncContext *s,
+ int16_t *block, int n)
{
int level, dc, diff, i, j, run;
int component;
RLTable *rl;
- uint8_t * const scantable = s->intra_scantable.permutated;
+ uint8_t *const scantable = s->intra_scantable.permutated;
const uint16_t *quant_matrix;
const int qscale = s->qscale;
int mismatch;
@@ -506,10 +553,10 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, int16_t *block, in
/* DC coefficient */
if (n < 4) {
quant_matrix = s->intra_matrix;
- component = 0;
+ component = 0;
} else {
quant_matrix = s->chroma_intra_matrix;
- component = (n & 1) + 1;
+ component = (n & 1) + 1;
}
diff = decode_dc(&s->gb, component);
if (diff >= 0xffff)
@@ -531,23 +578,29 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, int16_t *block, in
/* now quantify & encode AC coefficients */
for (;;) {
UPDATE_CACHE(re, &s->gb);
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
+ GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
+ TEX_VLC_BITS, 2, 0);
if (level == 127) {
break;
} else if (level != 0) {
i += run;
- j = scantable[i];
+ check_scantable_index(s, i);
+ j = scantable[i];
level = (level * qscale * quant_matrix[j]) >> 4;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
+ level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
+ SHOW_SBITS(re, &s->gb, 1);
LAST_SKIP_BITS(re, &s->gb, 1);
} else {
/* escape */
- run = SHOW_UBITS(re, &s->gb, 6) + 1; LAST_SKIP_BITS(re, &s->gb, 6);
+ run = SHOW_UBITS(re, &s->gb, 6) + 1;
+ LAST_SKIP_BITS(re, &s->gb, 6);
UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 12); SKIP_BITS(re, &s->gb, 12);
+ level = SHOW_SBITS(re, &s->gb, 12);
+ SKIP_BITS(re, &s->gb, 12);
i += run;
- j = scantable[i];
+ check_scantable_index(s, i);
+ j = scantable[i];
if (level < 0) {
level = (-level * qscale * quant_matrix[j]) >> 4;
level = -level;
@@ -555,10 +608,6 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, int16_t *block, in
level = (level * qscale * quant_matrix[j]) >> 4;
}
}
- if (i > 63) {
- av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
mismatch ^= level;
block[j] = level;
@@ -576,22 +625,23 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, int16_t *block, in
* Changing this would eat up any speed benefits it has.
* Do not use "fast" flag if you need the code to be robust.
*/
-static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
+static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s,
+ int16_t *block, int n)
{
- int level, dc, diff, j, run;
+ int level, dc, diff, i, j, run;
int component;
RLTable *rl;
- uint8_t * scantable = s->intra_scantable.permutated;
+ uint8_t *const scantable = s->intra_scantable.permutated;
const uint16_t *quant_matrix;
const int qscale = s->qscale;
/* DC coefficient */
if (n < 4) {
quant_matrix = s->intra_matrix;
- component = 0;
+ component = 0;
} else {
quant_matrix = s->chroma_intra_matrix;
- component = (n & 1) + 1;
+ component = (n & 1) + 1;
}
diff = decode_dc(&s->gb, component);
if (diff >= 0xffff)
@@ -600,6 +650,7 @@ static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, int16_t *bloc
dc += diff;
s->last_dc[component] = dc;
block[0] = dc << (3 - s->intra_dc_precision);
+ i = 0;
if (s->intra_vlc_format)
rl = &ff_rl_mpeg2;
else
@@ -610,23 +661,27 @@ static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, int16_t *bloc
/* now quantify & encode AC coefficients */
for (;;) {
UPDATE_CACHE(re, &s->gb);
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
+ GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
+ TEX_VLC_BITS, 2, 0);
- if (level == 127) {
+ if (level >= 64 || i > 63) {
break;
} else if (level != 0) {
- scantable += run;
- j = *scantable;
+ i += run;
+ j = scantable[i];
level = (level * qscale * quant_matrix[j]) >> 4;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
+ level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
+ SHOW_SBITS(re, &s->gb, 1);
LAST_SKIP_BITS(re, &s->gb, 1);
} else {
/* escape */
- run = SHOW_UBITS(re, &s->gb, 6) + 1; LAST_SKIP_BITS(re, &s->gb, 6);
+ run = SHOW_UBITS(re, &s->gb, 6) + 1;
+ LAST_SKIP_BITS(re, &s->gb, 6);
UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 12); SKIP_BITS(re, &s->gb, 12);
- scantable += run;
- j = *scantable;
+ level = SHOW_SBITS(re, &s->gb, 12);
+ SKIP_BITS(re, &s->gb, 12);
+ i += run;
+ j = scantable[i];
if (level < 0) {
level = (-level * qscale * quant_matrix[j]) >> 4;
level = -level;
@@ -640,7 +695,7 @@ static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, int16_t *bloc
CLOSE_READER(re, &s->gb);
}
- s->block_last_index[n] = scantable - s->intra_scantable.permutated;
+ s->block_last_index[n] = i;
return 0;
}
@@ -658,21 +713,12 @@ static inline int get_dmv(MpegEncContext *s)
static inline int get_qscale(MpegEncContext *s)
{
int qscale = get_bits(&s->gb, 5);
- if (s->q_scale_type) {
+ if (s->q_scale_type)
return non_linear_qscale[qscale];
- } else {
+ else
return qscale << 1;
- }
}
-static void exchange_uv(MpegEncContext *s)
-{
- int16_t (*tmp)[64];
-
- tmp = s->pblocks[4];
- s->pblocks[4] = s->pblocks[5];
- s->pblocks[5] = tmp;
-}
/* motion type (for MPEG-2) */
#define MT_FIELD 1
@@ -692,19 +738,21 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
if (s->mb_skip_run-- != 0) {
if (s->pict_type == AV_PICTURE_TYPE_P) {
s->mb_skipped = 1;
- s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] = MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16;
+ s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] =
+ MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16;
} else {
int mb_type;
if (s->mb_x)
mb_type = s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride - 1];
else
- mb_type = s->current_picture.mb_type[s->mb_width + (s->mb_y - 1) * s->mb_stride - 1]; // FIXME not sure if this is allowed in MPEG at all
+ // FIXME not sure if this is allowed in MPEG at all
+ mb_type = s->current_picture.mb_type[s->mb_width + (s->mb_y - 1) * s->mb_stride - 1];
if (IS_INTRA(mb_type)) {
av_log(s->avctx, AV_LOG_ERROR, "skip with previntra\n");
return -1;
}
- s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride] =
+ s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] =
mb_type | MB_TYPE_SKIP;
if ((s->mv[0][0][0] | s->mv[0][0][1] | s->mv[1][0][0] | s->mv[1][0][1]) == 0)
@@ -719,7 +767,9 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
case AV_PICTURE_TYPE_I:
if (get_bits1(&s->gb) == 0) {
if (get_bits1(&s->gb) == 0) {
- av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in I Frame at %d %d\n", s->mb_x, s->mb_y);
+ av_log(s->avctx, AV_LOG_ERROR,
+ "invalid mb type in I Frame at %d %d\n",
+ s->mb_x, s->mb_y);
return -1;
}
mb_type = MB_TYPE_QUANT | MB_TYPE_INTRA;
@@ -730,7 +780,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
case AV_PICTURE_TYPE_P:
mb_type = get_vlc2(&s->gb, ff_mb_ptype_vlc.table, MB_PTYPE_VLC_BITS, 1);
if (mb_type < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in P Frame at %d %d\n", s->mb_x, s->mb_y);
+ av_log(s->avctx, AV_LOG_ERROR,
+ "invalid mb type in P Frame at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
mb_type = ptype2mb_type[mb_type];
@@ -738,7 +789,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
case AV_PICTURE_TYPE_B:
mb_type = get_vlc2(&s->gb, ff_mb_btype_vlc.table, MB_BTYPE_VLC_BITS, 1);
if (mb_type < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in B Frame at %d %d\n", s->mb_x, s->mb_y);
+ av_log(s->avctx, AV_LOG_ERROR,
+ "invalid mb type in B Frame at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
mb_type = btype2mb_type[mb_type];
@@ -749,15 +801,14 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
if (IS_INTRA(mb_type)) {
s->dsp.clear_blocks(s->block[0]);
- if (!s->chroma_y_shift) {
+ if (!s->chroma_y_shift)
s->dsp.clear_blocks(s->block[6]);
- }
/* compute DCT type */
- if (s->picture_structure == PICT_FRAME && // FIXME add an interlaced_dct coded var?
- !s->frame_pred_frame_dct) {
+ // FIXME: add an interlaced_dct coded var?
+ if (s->picture_structure == PICT_FRAME &&
+ !s->frame_pred_frame_dct)
s->interlaced_dct = get_bits1(&s->gb);
- }
if (IS_QUANT(mb_type))
s->qscale = get_qscale(s);
@@ -765,45 +816,40 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
if (s->concealment_motion_vectors) {
/* just parse them */
if (s->picture_structure != PICT_FRAME)
- skip_bits1(&s->gb); /* field select */
+ skip_bits1(&s->gb); /* field select */
- s->mv[0][0][0]= s->last_mv[0][0][0]= s->last_mv[0][1][0] =
- mpeg_decode_motion(s, s->mpeg_f_code[0][0], s->last_mv[0][0][0]);
- s->mv[0][0][1]= s->last_mv[0][0][1]= s->last_mv[0][1][1] =
- mpeg_decode_motion(s, s->mpeg_f_code[0][1], s->last_mv[0][0][1]);
+ s->mv[0][0][0] =
+ s->last_mv[0][0][0] =
+ s->last_mv[0][1][0] = mpeg_decode_motion(s, s->mpeg_f_code[0][0],
+ s->last_mv[0][0][0]);
+ s->mv[0][0][1] =
+ s->last_mv[0][0][1] =
+ s->last_mv[0][1][1] = mpeg_decode_motion(s, s->mpeg_f_code[0][1],
+ s->last_mv[0][0][1]);
skip_bits1(&s->gb); /* marker */
- } else
- memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */
+ } else {
+ /* reset mv prediction */
+ memset(s->last_mv, 0, sizeof(s->last_mv));
+ }
s->mb_intra = 1;
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
// if 1, we memcpy blocks in xvmcvideo
- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) {
+ if ((CONFIG_MPEG1_XVMC_HWACCEL || CONFIG_MPEG2_XVMC_HWACCEL) && s->pack_pblocks)
ff_xvmc_pack_pblocks(s, -1); // inter are always full blocks
- if (s->swap_uv) {
- exchange_uv(s);
- }
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
if (s->flags2 & CODEC_FLAG2_FAST) {
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < 6; i++)
mpeg2_fast_decode_block_intra(s, *s->pblocks[i], i);
- }
} else {
- for (i = 0; i < mb_block_count; i++) {
+ for (i = 0; i < mb_block_count; i++)
if (mpeg2_decode_block_intra(s, *s->pblocks[i], i) < 0)
return -1;
- }
}
} else {
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < 6; i++)
if (mpeg1_decode_block_intra(s, *s->pblocks[i], i) < 0)
return -1;
- }
}
} else {
if (mb_type & MB_TYPE_ZERO_MV) {
@@ -816,8 +862,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
s->interlaced_dct = get_bits1(&s->gb);
s->mv_type = MV_TYPE_16X16;
} else {
- s->mv_type = MV_TYPE_FIELD;
- mb_type |= MB_TYPE_INTERLACED;
+ s->mv_type = MV_TYPE_FIELD;
+ mb_type |= MB_TYPE_INTERLACED;
s->field_select[0][0] = s->picture_structure - 1;
}
@@ -828,15 +874,15 @@ FF_ENABLE_DEPRECATION_WARNINGS
s->last_mv[0][0][1] = 0;
s->last_mv[0][1][0] = 0;
s->last_mv[0][1][1] = 0;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
+ s->mv[0][0][0] = 0;
+ s->mv[0][0][1] = 0;
} else {
av_assert2(mb_type & MB_TYPE_L0L1);
// FIXME decide if MBs in field pictures are MB_TYPE_INTERLACED
/* get additional motion vector type */
- if (s->picture_structure == PICT_FRAME && s->frame_pred_frame_dct)
+ if (s->picture_structure == PICT_FRAME && s->frame_pred_frame_dct) {
motion_type = MT_FRAME;
- else {
+ } else {
motion_type = get_bits(&s->gb, 2);
if (s->picture_structure == PICT_FRAME && HAS_CBP(mb_type))
s->interlaced_dct = get_bits1(&s->gb);
@@ -851,15 +897,21 @@ FF_ENABLE_DEPRECATION_WARNINGS
switch (motion_type) {
case MT_FRAME: /* or MT_16X8 */
if (s->picture_structure == PICT_FRAME) {
- mb_type |= MB_TYPE_16x16;
+ mb_type |= MB_TYPE_16x16;
s->mv_type = MV_TYPE_16X16;
for (i = 0; i < 2; i++) {
if (USES_LIST(mb_type, i)) {
/* MT_FRAME */
- s->mv[i][0][0]= s->last_mv[i][0][0]= s->last_mv[i][1][0] =
- mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]);
- s->mv[i][0][1]= s->last_mv[i][0][1]= s->last_mv[i][1][1] =
- mpeg_decode_motion(s, s->mpeg_f_code[i][1], s->last_mv[i][0][1]);
+ s->mv[i][0][0] =
+ s->last_mv[i][0][0] =
+ s->last_mv[i][1][0] =
+ mpeg_decode_motion(s, s->mpeg_f_code[i][0],
+ s->last_mv[i][0][0]);
+ s->mv[i][0][1] =
+ s->last_mv[i][0][1] =
+ s->last_mv[i][1][1] =
+ mpeg_decode_motion(s, s->mpeg_f_code[i][1],
+ s->last_mv[i][0][1]);
/* full_pel: only for MPEG-1 */
if (s->full_pel[i]) {
s->mv[i][0][0] <<= 1;
@@ -868,7 +920,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
}
} else {
- mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
+ mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
s->mv_type = MV_TYPE_16X8;
for (i = 0; i < 2; i++) {
if (USES_LIST(mb_type, i)) {
@@ -925,7 +977,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
break;
case MT_DMV:
- if(s->progressive_sequence){
+ if (s->progressive_sequence){
av_log(s->avctx, AV_LOG_ERROR, "MT_DMV in progressive_sequence\n");
return -1;
}
@@ -979,7 +1031,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
break;
default:
- av_log(s->avctx, AV_LOG_ERROR, "00 motion_type at %d %d\n", s->mb_x, s->mb_y);
+ av_log(s->avctx, AV_LOG_ERROR,
+ "00 motion_type at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
}
@@ -990,39 +1043,31 @@ FF_ENABLE_DEPRECATION_WARNINGS
cbp = get_vlc2(&s->gb, ff_mb_pat_vlc.table, MB_PAT_VLC_BITS, 1);
if (mb_block_count > 6) {
- cbp <<= mb_block_count - 6;
- cbp |= get_bits(&s->gb, mb_block_count - 6);
- s->dsp.clear_blocks(s->block[6]);
+ cbp <<= mb_block_count - 6;
+ cbp |= get_bits(&s->gb, mb_block_count - 6);
+ s->dsp.clear_blocks(s->block[6]);
}
if (cbp <= 0) {
- av_log(s->avctx, AV_LOG_ERROR, "invalid cbp %d at %d %d\n", cbp, s->mb_x, s->mb_y);
+ av_log(s->avctx, AV_LOG_ERROR,
+ "invalid cbp %d at %d %d\n", cbp, s->mb_x, s->mb_y);
return -1;
}
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
- //if 1, we memcpy blocks in xvmcvideo
- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) {
+ // if 1, we memcpy blocks in xvmcvideo
+ if ((CONFIG_MPEG1_XVMC_HWACCEL || CONFIG_MPEG2_XVMC_HWACCEL) && s->pack_pblocks)
ff_xvmc_pack_pblocks(s, cbp);
- if (s->swap_uv) {
- exchange_uv(s);
- }
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
if (s->flags2 & CODEC_FLAG2_FAST) {
for (i = 0; i < 6; i++) {
- if (cbp & 32) {
+ if (cbp & 32)
mpeg2_fast_decode_block_non_intra(s, *s->pblocks[i], i);
- } else {
+ else
s->block_last_index[i] = -1;
- }
cbp += cbp;
}
} else {
- cbp <<= 12-mb_block_count;
+ cbp <<= 12 - mb_block_count;
for (i = 0; i < mb_block_count; i++) {
if (cbp & (1 << 11)) {
@@ -1037,11 +1082,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
} else {
if (s->flags2 & CODEC_FLAG2_FAST) {
for (i = 0; i < 6; i++) {
- if (cbp & 32) {
+ if (cbp & 32)
mpeg1_fast_decode_block_inter(s, *s->pblocks[i], i);
- } else {
+ else
s->block_last_index[i] = -1;
- }
cbp += cbp;
}
} else {
@@ -1069,14 +1113,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
static av_cold int mpeg_decode_init(AVCodecContext *avctx)
{
- Mpeg1Context *s = avctx->priv_data;
+ Mpeg1Context *s = avctx->priv_data;
MpegEncContext *s2 = &s->mpeg_enc_ctx;
int i;
/* we need some permutation to store matrices,
* until MPV_common_init() sets the real permutation. */
for (i = 0; i < 64; i++)
- s2->dsp.idct_permutation[i]=i;
+ s2->dsp.idct_permutation[i] = i;
ff_MPV_decode_defaults(s2);
@@ -1090,7 +1134,7 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx)
s->mpeg_enc_ctx.picture_number = 0;
s->repeat_field = 0;
s->mpeg_enc_ctx.codec_id = avctx->codec->id;
- avctx->color_range = AVCOL_RANGE_MPEG;
+ avctx->color_range = AVCOL_RANGE_MPEG;
if (avctx->codec->id == AV_CODEC_ID_MPEG1VIDEO)
avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
else
@@ -1098,17 +1142,21 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx)
return 0;
}
-static int mpeg_decode_update_thread_context(AVCodecContext *avctx, const AVCodecContext *avctx_from)
+static int mpeg_decode_update_thread_context(AVCodecContext *avctx,
+ const AVCodecContext *avctx_from)
{
Mpeg1Context *ctx = avctx->priv_data, *ctx_from = avctx_from->priv_data;
MpegEncContext *s = &ctx->mpeg_enc_ctx, *s1 = &ctx_from->mpeg_enc_ctx;
int err;
- if (avctx == avctx_from || !ctx_from->mpeg_enc_ctx_allocated || !s1->context_initialized)
+ if (avctx == avctx_from ||
+ !ctx_from->mpeg_enc_ctx_allocated ||
+ !s1->context_initialized)
return 0;
err = ff_mpeg_update_thread_context(avctx, avctx_from);
- if (err) return err;
+ if (err)
+ return err;
if (!ctx->mpeg_enc_ctx_allocated)
memcpy(s + 1, s1 + 1, sizeof(Mpeg1Context) - sizeof(MpegEncContext));
@@ -1127,18 +1175,14 @@ static void quant_matrix_rebuild(uint16_t *matrix, const uint8_t *old_perm,
memcpy(temp_matrix, matrix, 64 * sizeof(uint16_t));
- for (i = 0; i < 64; i++) {
+ for (i = 0; i < 64; i++)
matrix[new_perm[i]] = temp_matrix[old_perm[i]];
- }
}
static const enum AVPixelFormat mpeg1_hwaccel_pixfmt_list_420[] = {
-#if FF_API_XVMC
-#if CONFIG_MPEG_XVMC_DECODER
- AV_PIX_FMT_XVMC_MPEG2_IDCT,
- AV_PIX_FMT_XVMC_MPEG2_MC,
+#if CONFIG_MPEG1_XVMC_HWACCEL
+ AV_PIX_FMT_XVMC,
#endif
-#endif /* FF_API_XVMC */
#if CONFIG_MPEG1_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU_MPEG1,
AV_PIX_FMT_VDPAU,
@@ -1148,12 +1192,9 @@ static const enum AVPixelFormat mpeg1_hwaccel_pixfmt_list_420[] = {
};
static const enum AVPixelFormat mpeg2_hwaccel_pixfmt_list_420[] = {
-#if FF_API_XVMC
-#if CONFIG_MPEG_XVMC_DECODER
- AV_PIX_FMT_XVMC_MPEG2_IDCT,
- AV_PIX_FMT_XVMC_MPEG2_MC,
+#if CONFIG_MPEG2_XVMC_HWACCEL
+ AV_PIX_FMT_XVMC,
#endif
-#endif /* FF_API_XVMC */
#if CONFIG_MPEG2_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU_MPEG2,
AV_PIX_FMT_VDPAU,
@@ -1174,15 +1215,15 @@ static inline int uses_vdpau(AVCodecContext *avctx) {
static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
{
- Mpeg1Context *s1 = avctx->priv_data;
+ Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
- if(s->chroma_format < 2) {
+ if (s->chroma_format < 2)
return ff_thread_get_format(avctx,
avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO ?
mpeg1_hwaccel_pixfmt_list_420 :
mpeg2_hwaccel_pixfmt_list_420);
- } else if(s->chroma_format == 2)
+ else if (s->chroma_format == 2)
return AV_PIX_FMT_YUV422P;
else
return AV_PIX_FMT_YUV444P;
@@ -1190,46 +1231,39 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)
{
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->pix_fmt != AV_PIX_FMT_XVMC_MPEG2_IDCT && avctx->pix_fmt != AV_PIX_FMT_XVMC_MPEG2_MC) {
- avctx->xvmc_acceleration = 0;
- } else if (!avctx->xvmc_acceleration) {
- avctx->xvmc_acceleration = 2;
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
- avctx->hwaccel = ff_find_hwaccel(avctx);
// until then pix_fmt may be changed right after codec init
-#if FF_API_XVMC
- if (avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT ||
-#else
- if (
-#endif
- avctx->hwaccel || uses_vdpau(avctx))
+ if (avctx->hwaccel || uses_vdpau(avctx))
if (avctx->idct_algo == FF_IDCT_AUTO)
avctx->idct_algo = FF_IDCT_SIMPLE;
+
+ if (avctx->hwaccel && avctx->pix_fmt == AV_PIX_FMT_XVMC) {
+ Mpeg1Context *s1 = avctx->priv_data;
+ MpegEncContext *s = &s1->mpeg_enc_ctx;
+
+ s->pack_pblocks = 1;
+#if FF_API_XVMC
+ avctx->xvmc_acceleration = 2;
+#endif /* FF_API_XVMC */
+ }
}
/* Call this function when we know all parameters.
* It may be called in different places for MPEG-1 and MPEG-2. */
static int mpeg_decode_postinit(AVCodecContext *avctx)
{
- Mpeg1Context *s1 = avctx->priv_data;
+ Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
uint8_t old_permutation[64];
int ret;
- if ((s1->mpeg_enc_ctx_allocated == 0) ||
- avctx->coded_width != s->width ||
- avctx->coded_height != s->height ||
+ if ((s1->mpeg_enc_ctx_allocated == 0) ||
+ avctx->coded_width != s->width ||
+ avctx->coded_height != s->height ||
s1->save_width != s->width ||
s1->save_height != s->height ||
s1->save_aspect_info != s->aspect_ratio_info ||
(s1->save_progressive_seq != s->progressive_sequence && (s->height&31)) ||
- 0)
- {
-
+ 0) {
if (s1->mpeg_enc_ctx_allocated) {
ParseContext pc = s->parse_context;
s->parse_context.buffer = 0;
@@ -1261,45 +1295,49 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
avctx->has_b_frames = !s->low_delay;
if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
- //MPEG-1 fps
+ // MPEG-1 fps
avctx->time_base.den = ff_mpeg12_frame_rate_tab[s->frame_rate_index].num;
avctx->time_base.num = ff_mpeg12_frame_rate_tab[s->frame_rate_index].den;
- //MPEG-1 aspect
- avctx->sample_aspect_ratio = av_d2q(1.0/ff_mpeg1_aspect[s->aspect_ratio_info], 255);
- avctx->ticks_per_frame=1;
- } else {//MPEG-2
- //MPEG-2 fps
+ // MPEG-1 aspect
+ avctx->sample_aspect_ratio = av_d2q(1.0 / ff_mpeg1_aspect[s->aspect_ratio_info], 255);
+ avctx->ticks_per_frame = 1;
+ } else { // MPEG-2
+ // MPEG-2 fps
av_reduce(&s->avctx->time_base.den,
&s->avctx->time_base.num,
- ff_mpeg12_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num*2,
+ ff_mpeg12_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num * 2,
ff_mpeg12_frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den,
1 << 30);
avctx->ticks_per_frame = 2;
- //MPEG-2 aspect
+ // MPEG-2 aspect
if (s->aspect_ratio_info > 1) {
AVRational dar =
av_mul_q(av_div_q(ff_mpeg2_aspect[s->aspect_ratio_info],
- (AVRational) {s1->pan_scan.width, s1->pan_scan.height}),
- (AVRational) {s->width, s->height});
-
- // we ignore the spec here and guess a bit as reality does not match the spec, see for example
- // res_change_ffmpeg_aspect.ts and sequence-display-aspect.mpg
- // issue1613, 621, 562
+ (AVRational) { s1->pan_scan.width,
+ s1->pan_scan.height }),
+ (AVRational) { s->width, s->height });
+
+ /* We ignore the spec here and guess a bit as reality does not
+ * match the spec, see for example res_change_ffmpeg_aspect.ts
+ * and sequence-display-aspect.mpg.
+ * issue1613, 621, 562 */
if ((s1->pan_scan.width == 0) || (s1->pan_scan.height == 0) ||
- (av_cmp_q(dar, (AVRational) {4, 3}) && av_cmp_q(dar, (AVRational) {16, 9}))) {
+ (av_cmp_q(dar, (AVRational) { 4, 3 }) &&
+ av_cmp_q(dar, (AVRational) { 16, 9 }))) {
s->avctx->sample_aspect_ratio =
av_div_q(ff_mpeg2_aspect[s->aspect_ratio_info],
- (AVRational) {s->width, s->height});
+ (AVRational) { s->width, s->height });
} else {
s->avctx->sample_aspect_ratio =
av_div_q(ff_mpeg2_aspect[s->aspect_ratio_info],
- (AVRational) {s1->pan_scan.width, s1->pan_scan.height});
-//issue1613 4/3 16/9 -> 16/9
-//res_change_ffmpeg_aspect.ts 4/3 225/44 ->4/3
-//widescreen-issue562.mpg 4/3 16/9 -> 16/9
+ (AVRational) { s1->pan_scan.width, s1->pan_scan.height });
+// issue1613 4/3 16/9 -> 16/9
+// res_change_ffmpeg_aspect.ts 4/3 225/44 ->4/3
+// widescreen-issue562.mpg 4/3 16/9 -> 16/9
// s->avctx->sample_aspect_ratio = av_mul_q(s->avctx->sample_aspect_ratio, (AVRational) {s->width, s->height});
av_dlog(avctx, "A %d/%d\n",
- ff_mpeg2_aspect[s->aspect_ratio_info].num, ff_mpeg2_aspect[s->aspect_ratio_info].den);
+ ff_mpeg2_aspect[s->aspect_ratio_info].num,
+ ff_mpeg2_aspect[s->aspect_ratio_info].den);
av_dlog(avctx, "B %d/%d\n", s->avctx->sample_aspect_ratio.num,
s->avctx->sample_aspect_ratio.den);
}
@@ -1329,14 +1367,14 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
return 0;
}
-static int mpeg1_decode_picture(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
+static int mpeg1_decode_picture(AVCodecContext *avctx, const uint8_t *buf,
+ int buf_size)
{
- Mpeg1Context *s1 = avctx->priv_data;
+ Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
int ref, f_code, vbv_delay;
- init_get_bits(&s->gb, buf, buf_size*8);
+ init_get_bits(&s->gb, buf, buf_size * 8);
ref = get_bits(&s->gb, 10); /* temporal ref */
s->pict_type = get_bits(&s->gb, 3);
@@ -1345,7 +1383,8 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
vbv_delay = get_bits(&s->gb, 16);
s->vbv_delay = vbv_delay;
- if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type == AV_PICTURE_TYPE_B) {
+ if (s->pict_type == AV_PICTURE_TYPE_P ||
+ s->pict_type == AV_PICTURE_TYPE_B) {
s->full_pel[0] = get_bits1(&s->gb);
f_code = get_bits(&s->gb, 3);
if (f_code == 0 && (avctx->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT)))
@@ -1363,11 +1402,12 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
s->mpeg_f_code[1][0] = f_code;
s->mpeg_f_code[1][1] = f_code;
}
- s->current_picture.f.pict_type = s->pict_type;
- s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+ s->current_picture.f->pict_type = s->pict_type;
+ s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
if (avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(avctx, AV_LOG_DEBUG, "vbv_delay %d, ref %d type:%d\n", vbv_delay, ref, s->pict_type);
+ av_log(avctx, AV_LOG_DEBUG,
+ "vbv_delay %d, ref %d type:%d\n", vbv_delay, ref, s->pict_type);
s->y_dc_scale = 8;
s->c_dc_scale = 8;
@@ -1376,14 +1416,14 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
{
- MpegEncContext *s= &s1->mpeg_enc_ctx;
+ MpegEncContext *s = &s1->mpeg_enc_ctx;
int horiz_size_ext, vert_size_ext;
int bit_rate_ext;
skip_bits(&s->gb, 1); /* profile and level esc*/
s->avctx->profile = get_bits(&s->gb, 3);
s->avctx->level = get_bits(&s->gb, 4);
- s->progressive_sequence = get_bits1(&s->gb); /* progressive_sequence */
+ s->progressive_sequence = get_bits1(&s->gb); /* progressive_sequence */
s->chroma_format = get_bits(&s->gb, 2); /* chroma_format 1=420, 2=422, 3=444 */
horiz_size_ext = get_bits(&s->gb, 2);
vert_size_ext = get_bits(&s->gb, 2);
@@ -1402,12 +1442,13 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
s1->frame_rate_ext.den = get_bits(&s->gb, 5) + 1;
av_dlog(s->avctx, "sequence extension\n");
- s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
+ s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%d\n",
- s->avctx->profile, s->avctx->level, s->progressive_sequence, s->chroma_format, s->avctx->rc_buffer_size, s->bit_rate);
-
+ av_log(s->avctx, AV_LOG_DEBUG,
+ "profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%d\n",
+ s->avctx->profile, s->avctx->level, s->progressive_sequence, s->chroma_format,
+ s->avctx->rc_buffer_size, s->bit_rate);
}
static void mpeg_decode_sequence_display_extension(Mpeg1Context *s1)
@@ -1423,7 +1464,7 @@ static void mpeg_decode_sequence_display_extension(Mpeg1Context *s1)
s->avctx->colorspace = get_bits(&s->gb, 8);
}
w = get_bits(&s->gb, 14);
- skip_bits(&s->gb, 1); //marker
+ skip_bits(&s->gb, 1); // marker
h = get_bits(&s->gb, 14);
// remaining 3 bits are zero padding
@@ -1461,13 +1502,15 @@ static void mpeg_decode_picture_display_extension(Mpeg1Context *s1)
}
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "pde (%d,%d) (%d,%d) (%d,%d)\n",
+ av_log(s->avctx, AV_LOG_DEBUG,
+ "pde (%"PRId16",%"PRId16") (%"PRId16",%"PRId16") (%"PRId16",%"PRId16")\n",
s1->pan_scan.position[0][0], s1->pan_scan.position[0][1],
s1->pan_scan.position[1][0], s1->pan_scan.position[1][1],
s1->pan_scan.position[2][0], s1->pan_scan.position[2][1]);
}
-static int load_matrix(MpegEncContext *s, uint16_t matrix0[64], uint16_t matrix1[64], int intra)
+static int load_matrix(MpegEncContext *s, uint16_t matrix0[64],
+ uint16_t matrix1[64], int intra)
{
int i;
@@ -1493,23 +1536,28 @@ static void mpeg_decode_quant_matrix_extension(MpegEncContext *s)
{
av_dlog(s->avctx, "matrix extension\n");
- if (get_bits1(&s->gb)) load_matrix(s, s->chroma_intra_matrix, s->intra_matrix, 1);
- if (get_bits1(&s->gb)) load_matrix(s, s->chroma_inter_matrix, s->inter_matrix, 0);
- if (get_bits1(&s->gb)) load_matrix(s, s->chroma_intra_matrix, NULL , 1);
- if (get_bits1(&s->gb)) load_matrix(s, s->chroma_inter_matrix, NULL , 0);
+ if (get_bits1(&s->gb))
+ load_matrix(s, s->chroma_intra_matrix, s->intra_matrix, 1);
+ if (get_bits1(&s->gb))
+ load_matrix(s, s->chroma_inter_matrix, s->inter_matrix, 0);
+ if (get_bits1(&s->gb))
+ load_matrix(s, s->chroma_intra_matrix, NULL, 1);
+ if (get_bits1(&s->gb))
+ load_matrix(s, s->chroma_inter_matrix, NULL, 0);
}
static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
{
MpegEncContext *s = &s1->mpeg_enc_ctx;
- s->full_pel[0] = s->full_pel[1] = 0;
+ s->full_pel[0] = s->full_pel[1] = 0;
s->mpeg_f_code[0][0] = get_bits(&s->gb, 4);
s->mpeg_f_code[0][1] = get_bits(&s->gb, 4);
s->mpeg_f_code[1][0] = get_bits(&s->gb, 4);
s->mpeg_f_code[1][1] = get_bits(&s->gb, 4);
if (!s->pict_type && s1->mpeg_enc_ctx_allocated) {
- av_log(s->avctx, AV_LOG_ERROR, "Missing picture start code, guessing missing values\n");
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Missing picture start code, guessing missing values\n");
if (s->mpeg_f_code[1][0] == 15 && s->mpeg_f_code[1][1] == 15) {
if (s->mpeg_f_code[0][0] == 15 && s->mpeg_f_code[0][1] == 15)
s->pict_type = AV_PICTURE_TYPE_I;
@@ -1517,8 +1565,8 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
s->pict_type = AV_PICTURE_TYPE_P;
} else
s->pict_type = AV_PICTURE_TYPE_B;
- s->current_picture.f.pict_type = s->pict_type;
- s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+ s->current_picture.f->pict_type = s->pict_type;
+ s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
}
s->mpeg_f_code[0][0] += !s->mpeg_f_code[0][0];
s->mpeg_f_code[0][1] += !s->mpeg_f_code[0][1];
@@ -1537,7 +1585,6 @@ 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->alternate_scan) {
ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan);
@@ -1561,7 +1608,7 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
{
AVCodecContext *avctx = s->avctx;
- Mpeg1Context *s1 = (Mpeg1Context*)s;
+ Mpeg1Context *s1 = (Mpeg1Context *) s;
/* start frame decoding */
if (s->first_field || s->picture_structure == PICT_FRAME) {
@@ -1573,19 +1620,19 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
ff_mpeg_er_frame_start(s);
/* first check if we must repeat the frame */
- s->current_picture_ptr->f.repeat_pict = 0;
+ s->current_picture_ptr->f->repeat_pict = 0;
if (s->repeat_first_field) {
if (s->progressive_sequence) {
if (s->top_field_first)
- s->current_picture_ptr->f.repeat_pict = 4;
+ s->current_picture_ptr->f->repeat_pict = 4;
else
- s->current_picture_ptr->f.repeat_pict = 2;
+ s->current_picture_ptr->f->repeat_pict = 2;
} else if (s->progressive_frame) {
- s->current_picture_ptr->f.repeat_pict = 1;
+ s->current_picture_ptr->f->repeat_pict = 1;
}
}
- pan_scan = av_frame_new_side_data(&s->current_picture_ptr->f,
+ pan_scan = av_frame_new_side_data(s->current_picture_ptr->f,
AV_FRAME_DATA_PANSCAN,
sizeof(s1->pan_scan));
if (!pan_scan)
@@ -1594,12 +1641,21 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
if (s1->a53_caption) {
AVFrameSideData *sd = av_frame_new_side_data(
- &s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC,
+ s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC,
s1->a53_caption_size);
if (sd)
memcpy(sd->data, s1->a53_caption, s1->a53_caption_size);
av_freep(&s1->a53_caption);
}
+
+ if (s1->has_stereo3d) {
+ AVStereo3D *stereo = av_stereo3d_create_side_data(s->current_picture_ptr->f);
+ if (!stereo)
+ return AVERROR(ENOMEM);
+
+ *stereo = s1->stereo3d;
+ s1->has_stereo3d = 0;
+ }
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME))
ff_thread_finish_setup(avctx);
} else { // second field
@@ -1613,14 +1669,15 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
if (s->avctx->hwaccel &&
(s->avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) {
if (s->avctx->hwaccel->end_frame(s->avctx) < 0)
- av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode first field\n");
+ av_log(avctx, AV_LOG_ERROR,
+ "hardware accelerator failed to decode first field\n");
}
for (i = 0; i < 4; i++) {
- s->current_picture.f.data[i] = s->current_picture_ptr->f.data[i];
- if (s->picture_structure == PICT_BOTTOM_FIELD) {
- s->current_picture.f.data[i] += s->current_picture_ptr->f.linesize[i];
- }
+ s->current_picture.f->data[i] = s->current_picture_ptr->f->data[i];
+ if (s->picture_structure == PICT_BOTTOM_FIELD)
+ s->current_picture.f->data[i] +=
+ s->current_picture_ptr->f->linesize[i];
}
}
@@ -1629,16 +1686,6 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
return -1;
}
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-// MPV_frame_start will call this function too,
-// but we need to call it on every field
- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
- if (ff_xvmc_field_start(s, avctx) < 0)
- return -1;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
return 0;
}
@@ -1664,7 +1711,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
av_assert0(mb_y < s->mb_height);
init_get_bits(&s->gb, *buf, buf_size * 8);
- if(s->codec_id != AV_CODEC_ID_MPEG1VIDEO && s->mb_height > 2800/16)
+ if (s->codec_id != AV_CODEC_ID_MPEG1VIDEO && s->mb_height > 2800/16)
skip_bits(&s->gb, 3);
ff_mpeg1_clean_buffers(s);
@@ -1694,9 +1741,8 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
return -1;
}
if (code >= 33) {
- if (code == 33) {
+ if (code == 33)
s->mb_x += 33;
- }
/* otherwise, stuffing, nothing to do */
} else {
s->mb_x += code;
@@ -1705,12 +1751,12 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
}
}
- if (s->mb_x >= (unsigned)s->mb_width) {
+ if (s->mb_x >= (unsigned) s->mb_width) {
av_log(s->avctx, AV_LOG_ERROR, "initial skip overflow\n");
return -1;
}
- if (avctx->hwaccel) {
+ if (avctx->hwaccel && avctx->hwaccel->decode_slice) {
const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
int start_code = -1;
buf_end = avpriv_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
@@ -1730,28 +1776,35 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
if (s->mb_y == 0 && s->mb_x == 0 && (s->first_field || s->picture_structure == PICT_FRAME)) {
if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
- av_log(s->avctx, AV_LOG_DEBUG, "qp:%d fc:%2d%2d%2d%2d %s %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n",
- s->qscale, s->mpeg_f_code[0][0], s->mpeg_f_code[0][1], s->mpeg_f_code[1][0], s->mpeg_f_code[1][1],
- s->pict_type == AV_PICTURE_TYPE_I ? "I" : (s->pict_type == AV_PICTURE_TYPE_P ? "P" : (s->pict_type == AV_PICTURE_TYPE_B ? "B" : "S")),
- s->progressive_sequence ? "ps" :"", s->progressive_frame ? "pf" : "", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"",
- s->intra_dc_precision, s->picture_structure, s->frame_pred_frame_dct, s->concealment_motion_vectors,
- s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :"");
+ av_log(s->avctx, AV_LOG_DEBUG,
+ "qp:%d fc:%2d%2d%2d%2d %s %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n",
+ s->qscale,
+ s->mpeg_f_code[0][0], s->mpeg_f_code[0][1],
+ s->mpeg_f_code[1][0], s->mpeg_f_code[1][1],
+ s->pict_type == AV_PICTURE_TYPE_I ? "I" :
+ (s->pict_type == AV_PICTURE_TYPE_P ? "P" :
+ (s->pict_type == AV_PICTURE_TYPE_B ? "B" : "S")),
+ s->progressive_sequence ? "ps" : "",
+ s->progressive_frame ? "pf" : "",
+ s->alternate_scan ? "alt" : "",
+ s->top_field_first ? "top" : "",
+ s->intra_dc_precision, s->picture_structure,
+ s->frame_pred_frame_dct, s->concealment_motion_vectors,
+ s->q_scale_type, s->intra_vlc_format,
+ s->repeat_first_field, s->chroma_420_type ? "420" : "");
}
}
for (;;) {
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
// If 1, we memcpy blocks in xvmcvideo.
- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1)
+ if ((CONFIG_MPEG1_XVMC_HWACCEL || CONFIG_MPEG2_XVMC_HWACCEL) && s->pack_pblocks)
ff_xvmc_init_block(s); // set s->block
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
if (mpeg_decode_mb(s, s->block) < 0)
return -1;
- if (s->current_picture.motion_val[0] && !s->encoding) { // note motion_val is normally NULL unless we want to extract the MVs
+ // Note motion_val is normally NULL unless we want to extract the MVs.
+ if (s->current_picture.motion_val[0] && !s->encoding) {
const int wrap = s->b8_stride;
int xy = s->mb_x * 2 + s->mb_y * 2 * wrap;
int b8_xy = 4 * (s->mb_x + s->mb_y * s->mb_stride);
@@ -1759,26 +1812,29 @@ FF_ENABLE_DEPRECATION_WARNINGS
for (i = 0; i < 2; i++) {
for (dir = 0; dir < 2; dir++) {
- if (s->mb_intra || (dir == 1 && s->pict_type != AV_PICTURE_TYPE_B)) {
+ if (s->mb_intra ||
+ (dir == 1 && s->pict_type != AV_PICTURE_TYPE_B)) {
motion_x = motion_y = 0;
- } else if (s->mv_type == MV_TYPE_16X16 || (s->mv_type == MV_TYPE_FIELD && field_pic)) {
+ } else if (s->mv_type == MV_TYPE_16X16 ||
+ (s->mv_type == MV_TYPE_FIELD && field_pic)) {
motion_x = s->mv[dir][0][0];
motion_y = s->mv[dir][0][1];
- } else /*if ((s->mv_type == MV_TYPE_FIELD) || (s->mv_type == MV_TYPE_16X8))*/ {
+ } else { /* if ((s->mv_type == MV_TYPE_FIELD) || (s->mv_type == MV_TYPE_16X8)) */
motion_x = s->mv[dir][i][0];
motion_y = s->mv[dir][i][1];
}
- s->current_picture.motion_val[dir][xy ][0] = motion_x;
- s->current_picture.motion_val[dir][xy ][1] = motion_y;
+ s->current_picture.motion_val[dir][xy][0] = motion_x;
+ s->current_picture.motion_val[dir][xy][1] = motion_y;
s->current_picture.motion_val[dir][xy + 1][0] = motion_x;
s->current_picture.motion_val[dir][xy + 1][1] = motion_y;
- s->current_picture.ref_index [dir][b8_xy ] =
+ s->current_picture.ref_index [dir][b8_xy] =
s->current_picture.ref_index [dir][b8_xy + 1] = s->field_select[dir][i];
- av_assert2(s->field_select[dir][i] == 0 || s->field_select[dir][i] == 1);
+ av_assert2(s->field_select[dir][i] == 0 ||
+ s->field_select[dir][i] == 1);
}
- xy += wrap;
- b8_xy +=2;
+ xy += wrap;
+ b8_xy += 2;
}
}
@@ -1791,17 +1847,21 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (++s->mb_x >= s->mb_width) {
const int mb_size = 16 >> s->avctx->lowres;
- ff_mpeg_draw_horiz_band(s, mb_size*(s->mb_y >> field_pic), mb_size);
+ ff_mpeg_draw_horiz_band(s, mb_size * (s->mb_y >> field_pic), mb_size);
ff_MPV_report_decode_progress(s);
- s->mb_x = 0;
+ s->mb_x = 0;
s->mb_y += 1 << field_pic;
if (s->mb_y >= s->mb_height) {
int left = get_bits_left(&s->gb);
- int is_d10 = s->chroma_format == 2 && s->pict_type == AV_PICTURE_TYPE_I && 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*/;
+ int is_d10 = s->chroma_format == 2 &&
+ s->pict_type == AV_PICTURE_TYPE_I &&
+ 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 */;
if (left >= 32 && !is_d10) {
GetBitContext gb = s->gb;
@@ -1812,9 +1872,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
}
- if (left < 0 || (left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10)
- || ((avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE)) && left > 8)) {
- av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n", left, show_bits(&s->gb, FFMIN(left, 23)));
+ if (left < 0 ||
+ (left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10) ||
+ ((avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE)) && left > 8)) {
+ av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n",
+ left, show_bits(&s->gb, FFMIN(left, 23)));
return -1;
} else
goto eos;
@@ -1853,7 +1915,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (s->mb_skip_run) {
int i;
if (s->pict_type == AV_PICTURE_TYPE_I) {
- av_log(s->avctx, AV_LOG_ERROR, "skipped MB in I frame at %d %d\n", s->mb_x, s->mb_y);
+ av_log(s->avctx, AV_LOG_ERROR,
+ "skipped MB in I frame at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
@@ -1883,14 +1946,16 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
}
eos: // end of slice
- *buf += (get_bits_count(&s->gb)-1)/8;
+ if (get_bits_left(&s->gb) < 0)
+ return AVERROR_INVALIDDATA;
+ *buf += (get_bits_count(&s->gb) - 1) / 8;
av_dlog(s, "y %d %d %d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y);
return 0;
}
static int slice_decode_thread(AVCodecContext *c, void *arg)
{
- MpegEncContext *s = *(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;
@@ -1910,18 +1975,22 @@ static int slice_decode_thread(AVCodecContext *c, void *arg)
if (c->err_recognition & AV_EF_EXPLODE)
return ret;
if (s->resync_mb_x >= 0 && s->resync_mb_y >= 0)
- ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_AC_ERROR | ER_DC_ERROR | ER_MV_ERROR);
+ ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
+ s->mb_x, s->mb_y,
+ ER_AC_ERROR | ER_DC_ERROR | ER_MV_ERROR);
} else {
- ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_AC_END | ER_DC_END | ER_MV_END);
+ ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
+ s->mb_x - 1, s->mb_y,
+ ER_AC_END | ER_DC_END | ER_MV_END);
}
if (s->mb_y == s->end_mb_y)
return 0;
start_code = -1;
- buf = avpriv_find_start_code(buf, s->gb.buffer_end, &start_code);
- mb_y= start_code - SLICE_MIN_START_CODE;
- if(s->codec_id != AV_CODEC_ID_MPEG1VIDEO && s->mb_height > 2800/16)
+ buf = avpriv_find_start_code(buf, s->gb.buffer_end, &start_code);
+ mb_y = start_code - SLICE_MIN_START_CODE;
+ if (s->codec_id != AV_CODEC_ID_MPEG1VIDEO && s->mb_height > 2800/16)
mb_y += (*buf&0xE0)<<2;
mb_y <<= field_pic;
if (s->picture_structure == PICT_BOTTOM_FIELD)
@@ -1937,7 +2006,7 @@ static int slice_decode_thread(AVCodecContext *c, void *arg)
*/
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
{
- Mpeg1Context *s1 = avctx->priv_data;
+ Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
if (!s1->mpeg_enc_ctx_allocated || !s->current_picture_ptr)
@@ -1945,18 +2014,12 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
if (s->avctx->hwaccel) {
if (s->avctx->hwaccel->end_frame(s->avctx) < 0)
- av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n");
+ av_log(avctx, AV_LOG_ERROR,
+ "hardware accelerator failed to decode picture\n");
}
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
- ff_xvmc_field_end(s);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
/* end of slice reached */
- if (/*s->mb_y << field_pic == s->mb_height &&*/ !s->first_field && !s1->first_slice) {
+ if (/* s->mb_y << field_pic == s->mb_height && */ !s->first_field && !s1->first_slice) {
/* end of image */
ff_er_frame_end(&s->er);
@@ -1964,7 +2027,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
ff_MPV_frame_end(s);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- int ret = av_frame_ref(pict, &s->current_picture_ptr->f);
+ int ret = av_frame_ref(pict, s->current_picture_ptr->f);
if (ret < 0)
return ret;
ff_print_debug_info(s, s->current_picture_ptr, pict);
@@ -1975,7 +2038,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
/* latency of 1 frame for I- and P-frames */
/* XXX: use another variable than picture_number */
if (s->last_picture_ptr != NULL) {
- int ret = av_frame_ref(pict, &s->last_picture_ptr->f);
+ int ret = av_frame_ref(pict, s->last_picture_ptr->f);
if (ret < 0)
return ret;
ff_print_debug_info(s, s->last_picture_ptr, pict);
@@ -1992,18 +2055,18 @@ FF_ENABLE_DEPRECATION_WARNINGS
static int mpeg1_decode_sequence(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
- Mpeg1Context *s1 = avctx->priv_data;
+ Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
int width, height;
int i, v, j;
- init_get_bits(&s->gb, buf, buf_size*8);
+ init_get_bits(&s->gb, buf, buf_size * 8);
width = get_bits(&s->gb, 12);
height = get_bits(&s->gb, 12);
if (width == 0 || height == 0) {
- av_log(avctx, AV_LOG_WARNING, "Invalid horizontal or vertical size "
- "value.\n");
+ av_log(avctx, AV_LOG_WARNING,
+ "Invalid horizontal or vertical size value.\n");
if (avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_COMPLIANT))
return AVERROR_INVALIDDATA;
}
@@ -2052,14 +2115,15 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
return -1;
}
- /* we set MPEG-2 parameters so that it emulates MPEG-1 */
+ /* We set MPEG-2 parameters so that it emulates MPEG-1. */
s->progressive_sequence = 1;
s->progressive_frame = 1;
s->picture_structure = PICT_FRAME;
s->first_field = 0;
s->frame_pred_frame_dct = 1;
s->chroma_format = 1;
- s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO;
+ s->codec_id =
+ s->avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO;
s->out_format = FMT_MPEG1;
s->swap_uv = 0; // AFAIK VCR2 does not have SEQ_HEADER
if (s->flags & CODEC_FLAG_LOW_DELAY)
@@ -2074,7 +2138,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
static int vcr2_init_sequence(AVCodecContext *avctx)
{
- Mpeg1Context *s1 = avctx->priv_data;
+ Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
int i, v;
@@ -2084,10 +2148,10 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
ff_MPV_common_end(s);
s1->mpeg_enc_ctx_allocated = 0;
}
- s->width = avctx->coded_width;
- s->height = avctx->coded_height;
+ s->width = avctx->coded_width;
+ s->height = avctx->coded_height;
avctx->has_b_frames = 0; // true?
- s->low_delay = 1;
+ s->low_delay = 1;
avctx->pix_fmt = mpeg_get_pixelformat(avctx);
setup_hwaccel_for_pixfmt(avctx);
@@ -2125,7 +2189,6 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
return 0;
}
-
static int mpeg_decode_a53_cc(AVCodecContext *avctx,
const uint8_t *p, int buf_size)
{
@@ -2139,14 +2202,13 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
if (cc_count > 0 && buf_size >= 7 + cc_count * 3) {
av_freep(&s1->a53_caption);
s1->a53_caption_size = cc_count * 3;
- s1->a53_caption = av_malloc(s1->a53_caption_size);
- if (s1->a53_caption) {
+ s1->a53_caption = av_malloc(s1->a53_caption_size);
+ if (s1->a53_caption)
memcpy(s1->a53_caption, p + 7, s1->a53_caption_size);
- }
}
return 1;
} else if (buf_size >= 11 &&
- p[0] == 'C' && p[1] == 'C' && p[2] == 0x01 && p[3] == 0xf8) {
+ p[0] == 'C' && p[1] == 'C' && p[2] == 0x01 && p[3] == 0xf8) {
/* extract DVD CC data */
int cc_count = 0;
int i;
@@ -2158,7 +2220,7 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
if (cc_count > 0) {
av_freep(&s1->a53_caption);
s1->a53_caption_size = cc_count * 6;
- s1->a53_caption = av_malloc(s1->a53_caption_size);
+ s1->a53_caption = av_malloc(s1->a53_caption_size);
if (s1->a53_caption) {
uint8_t field1 = !!(p[4] & 0x80);
uint8_t *cap = s1->a53_caption;
@@ -2186,10 +2248,10 @@ static void mpeg_decode_user_data(AVCodecContext *avctx,
Mpeg1Context *s = avctx->priv_data;
const uint8_t *buf_end = p + buf_size;
- if(buf_size > 29){
+ if (buf_size > 29){
int i;
for(i=0; i<20; i++)
- if(!memcmp(p+i, "\0TMPGEXS\0", 9)){
+ if (!memcmp(p+i, "\0TMPGEXS\0", 9)){
s->tmpgexs= 1;
}
@@ -2213,6 +2275,35 @@ static void mpeg_decode_user_data(AVCodecContext *avctx,
return;
avctx->dtg_active_format = p[0] & 0x0f;
}
+ } else if (buf_end - p >= 6 &&
+ p[0] == 'J' && p[1] == 'P' && p[2] == '3' && p[3] == 'D' &&
+ p[4] == 0x03) { // S3D_video_format_length
+ // the 0x7F mask ignores the reserved_bit value
+ const uint8_t S3D_video_format_type = p[5] & 0x7F;
+
+ if (S3D_video_format_type == 0x03 ||
+ S3D_video_format_type == 0x04 ||
+ S3D_video_format_type == 0x08 ||
+ S3D_video_format_type == 0x23) {
+ Mpeg1Context *s1 = avctx->priv_data;
+
+ s1->has_stereo3d = 1;
+
+ switch (S3D_video_format_type) {
+ case 0x03:
+ s1->stereo3d.type = AV_STEREO3D_SIDEBYSIDE;
+ break;
+ case 0x04:
+ s1->stereo3d.type = AV_STEREO3D_TOPBOTTOM;
+ break;
+ case 0x08:
+ s1->stereo3d.type = AV_STEREO3D_2D;
+ break;
+ case 0x23:
+ s1->stereo3d.type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX;
+ break;
+ }
+ }
} else if (mpeg_decode_a53_cc(avctx, p, buf_size)) {
return;
}
@@ -2226,14 +2317,14 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
int broken_link;
int64_t tc;
- init_get_bits(&s->gb, buf, buf_size*8);
+ init_get_bits(&s->gb, buf, buf_size * 8);
tc = avctx->timecode_frame_start = get_bits(&s->gb, 25);
s->closed_gop = get_bits1(&s->gb);
- /*broken_link indicate that after editing the
- reference frames of the first B-Frames after GOP I-Frame
- are missing (open gop)*/
+ /* broken_link indicate that after editing the
+ * reference frames of the first B-Frames after GOP I-Frame
+ * are missing (open gop) */
broken_link = get_bits1(&s->gb);
if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
@@ -2245,9 +2336,8 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
}
}
-static int decode_chunks(AVCodecContext *avctx,
- AVFrame *picture, int *got_output,
- const uint8_t *buf, int buf_size)
+static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
+ int *got_output, const uint8_t *buf, int buf_size)
{
Mpeg1Context *s = avctx->priv_data;
MpegEncContext *s2 = &s->mpeg_enc_ctx;
@@ -2263,12 +2353,15 @@ static int decode_chunks(AVCodecContext *avctx,
buf_ptr = avpriv_find_start_code(buf_ptr, buf_end, &start_code);
if (start_code > 0x1ff) {
if (!skip_frame) {
- if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
+ if (HAVE_THREADS &&
+ (avctx->active_thread_type & FF_THREAD_SLICE) &&
!avctx->hwaccel) {
int i;
av_assert0(avctx->thread_count > 1);
- avctx->execute(avctx, slice_decode_thread, &s2->thread_context[0], NULL, s->slice_count, sizeof(void*));
+ avctx->execute(avctx, slice_decode_thread,
+ &s2->thread_context[0], NULL,
+ s->slice_count, sizeof(void *));
for (i = 0; i < s->slice_count; i++)
s2->er.error_count += s2->thread_context[i]->er.error_count;
}
@@ -2281,7 +2374,8 @@ static int decode_chunks(AVCodecContext *avctx,
if (ret < 0)
return ret;
else if (ret) {
- if (s2->last_picture_ptr || s2->low_delay) //FIXME merge with the stuff in mpeg_decode_slice
+ // FIXME: merge with the stuff in mpeg_decode_slice
+ if (s2->last_picture_ptr || s2->low_delay)
*got_output = 1;
}
}
@@ -2295,19 +2389,20 @@ static int decode_chunks(AVCodecContext *avctx,
input_size = buf_end - buf_ptr;
- if (avctx->debug & FF_DEBUG_STARTCODE) {
- av_log(avctx, AV_LOG_DEBUG, "%3X at %td left %d\n", start_code, buf_ptr-buf, input_size);
- }
+ if (avctx->debug & FF_DEBUG_STARTCODE)
+ av_log(avctx, AV_LOG_DEBUG, "%3"PRIX32" at %"PTRDIFF_SPECIFIER" left %d\n",
+ start_code, buf_ptr - buf, input_size);
/* 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);
- if(buf != avctx->extradata)
- s->sync=1;
+ if (buf != avctx->extradata)
+ s->sync = 1;
} else {
- av_log(avctx, AV_LOG_ERROR, "ignoring SEQ_START_CODE after %X\n", last_code);
+ av_log(avctx, AV_LOG_ERROR,
+ "ignoring SEQ_START_CODE after %X\n", last_code);
if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
@@ -2328,7 +2423,7 @@ static int decode_chunks(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
}
- if(s->tmpgexs){
+ if (s->tmpgexs){
s2->intra_dc_precision= 3;
s2->intra_matrix[0]= 1;
}
@@ -2338,7 +2433,7 @@ static int decode_chunks(AVCodecContext *avctx,
avctx->execute(avctx, slice_decode_thread,
s2->thread_context, NULL,
- s->slice_count, sizeof(void*));
+ s->slice_count, sizeof(void *));
for (i = 0; i < s->slice_count; i++)
s2->er.error_count += s2->thread_context[i]->er.error_count;
s->slice_count = 0;
@@ -2346,30 +2441,33 @@ static int decode_chunks(AVCodecContext *avctx,
if (last_code == 0 || last_code == SLICE_MIN_START_CODE) {
ret = mpeg_decode_postinit(avctx);
if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "mpeg_decode_postinit() failure\n");
+ av_log(avctx, AV_LOG_ERROR,
+ "mpeg_decode_postinit() failure\n");
return ret;
}
- /* we have a complete image: we try to decompress it */
+ /* We have a complete image: we try to decompress it. */
if (mpeg1_decode_picture(avctx, buf_ptr, input_size) < 0)
s2->pict_type = 0;
s->first_slice = 1;
- last_code = PICTURE_START_CODE;
+ last_code = PICTURE_START_CODE;
} else {
- av_log(avctx, AV_LOG_ERROR, "ignoring pic after %X\n", last_code);
+ av_log(avctx, AV_LOG_ERROR,
+ "ignoring pic after %X\n", last_code);
if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
case EXT_START_CODE:
- init_get_bits(&s2->gb, buf_ptr, input_size*8);
+ 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);
+ mpeg_decode_sequence_extension(s);
} else {
- av_log(avctx, AV_LOG_ERROR, "ignoring seq ext after %X\n", last_code);
+ av_log(avctx, AV_LOG_ERROR,
+ "ignoring seq ext after %X\n", last_code);
if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
@@ -2387,7 +2485,8 @@ static int decode_chunks(AVCodecContext *avctx,
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);
+ av_log(avctx, AV_LOG_ERROR,
+ "ignoring pic cod ext after %X\n", last_code);
if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
@@ -2399,11 +2498,12 @@ static int decode_chunks(AVCodecContext *avctx,
break;
case GOP_START_CODE:
if (last_code == 0) {
- s2->first_field=0;
+ s2->first_field = 0;
mpeg_decode_gop(avctx, buf_ptr, input_size);
- s->sync=1;
+ s->sync = 1;
} else {
- av_log(avctx, AV_LOG_ERROR, "ignoring GOP_START_CODE after %X\n", last_code);
+ av_log(avctx, AV_LOG_ERROR,
+ "ignoring GOP_START_CODE after %X\n", last_code);
if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
@@ -2411,20 +2511,22 @@ static int decode_chunks(AVCodecContext *avctx,
default:
if (start_code >= SLICE_MIN_START_CODE &&
start_code <= SLICE_MAX_START_CODE && last_code == PICTURE_START_CODE) {
-
if (s2->progressive_sequence && !s2->progressive_frame) {
s2->progressive_frame = 1;
- av_log(s2->avctx, AV_LOG_ERROR, "interlaced frame in progressive sequence, ignoring\n");
+ av_log(s2->avctx, AV_LOG_ERROR,
+ "interlaced frame in progressive sequence, ignoring\n");
}
- if (s2->picture_structure == 0 || (s2->progressive_frame && s2->picture_structure != PICT_FRAME)) {
- av_log(s2->avctx, AV_LOG_ERROR, "picture_structure %d invalid, ignoring\n", s2->picture_structure);
+ if (s2->picture_structure == 0 ||
+ (s2->progressive_frame && s2->picture_structure != PICT_FRAME)) {
+ av_log(s2->avctx, AV_LOG_ERROR,
+ "picture_structure %d invalid, ignoring\n",
+ s2->picture_structure);
s2->picture_structure = PICT_FRAME;
}
- if (s2->progressive_sequence && !s2->frame_pred_frame_dct) {
+ if (s2->progressive_sequence && !s2->frame_pred_frame_dct)
av_log(s2->avctx, AV_LOG_WARNING, "invalid frame_pred_frame_dct\n");
- }
if (s2->picture_structure == PICT_FRAME) {
s2->first_field = 0;
@@ -2440,7 +2542,7 @@ static int decode_chunks(AVCodecContext *avctx,
const int field_pic = s2->picture_structure != PICT_FRAME;
int mb_y = start_code - SLICE_MIN_START_CODE;
last_code = SLICE_MIN_START_CODE;
- if(s2->codec_id != AV_CODEC_ID_MPEG1VIDEO && s2->mb_height > 2800/16)
+ if (s2->codec_id != AV_CODEC_ID_MPEG1VIDEO && s2->mb_height > 2800/16)
mb_y += (*buf_ptr&0xE0)<<2;
mb_y <<= field_pic;
@@ -2453,12 +2555,14 @@ static int decode_chunks(AVCodecContext *avctx,
}
if (mb_y >= s2->mb_height) {
- av_log(s2->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", 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 */
+ /* Skip B-frames if we do not have reference frames and
+ * GOP is not closed. */
if (s2->pict_type == AV_PICTURE_TYPE_B) {
if (!s2->closed_gop) {
skip_frame = 1;
@@ -2467,17 +2571,20 @@ static int decode_chunks(AVCodecContext *avctx,
}
}
if (s2->pict_type == AV_PICTURE_TYPE_I || (s2->flags2 & CODEC_FLAG2_SHOW_ALL))
- s->sync=1;
+ 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. */
+ /* Skip P-frames if we do not have a reference frame or
+ * we have an invalid header. */
if (s2->pict_type == AV_PICTURE_TYPE_P && !s->sync) {
skip_frame = 1;
break;
}
}
- if ((avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type == AV_PICTURE_TYPE_B) ||
- (avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type != AV_PICTURE_TYPE_I) ||
- avctx->skip_frame >= AVDISCARD_ALL) {
+ if ((avctx->skip_frame >= AVDISCARD_NONREF &&
+ s2->pict_type == AV_PICTURE_TYPE_B) ||
+ (avctx->skip_frame >= AVDISCARD_NONKEY &&
+ s2->pict_type != AV_PICTURE_TYPE_I) ||
+ avctx->skip_frame >= AVDISCARD_ALL) {
skip_frame = 1;
break;
}
@@ -2486,7 +2593,8 @@ static int decode_chunks(AVCodecContext *avctx,
break;
if (s2->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
- if (mb_y < avctx->skip_top || mb_y >= s2->mb_height - avctx->skip_bottom)
+ if (mb_y < avctx->skip_top ||
+ mb_y >= s2->mb_height - avctx->skip_bottom)
break;
}
@@ -2498,13 +2606,14 @@ static int decode_chunks(AVCodecContext *avctx,
}
if (s->first_slice) {
- skip_frame = 0;
+ skip_frame = 0;
s->first_slice = 0;
if (mpeg_field_start(s2, buf, buf_size) < 0)
return -1;
}
if (!s2->current_picture_ptr) {
- av_log(avctx, AV_LOG_ERROR, "current_picture not initialized\n");
+ av_log(avctx, AV_LOG_ERROR,
+ "current_picture not initialized\n");
return AVERROR_INVALIDDATA;
}
@@ -2513,7 +2622,8 @@ static int decode_chunks(AVCodecContext *avctx,
break;
}
- if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
+ if (HAVE_THREADS &&
+ (avctx->active_thread_type & FF_THREAD_SLICE) &&
!avctx->hwaccel) {
int threshold = (s2->mb_height * s->slice_count +
s2->slice_context_count / 2) /
@@ -2525,13 +2635,12 @@ static int decode_chunks(AVCodecContext *avctx,
thread_context->start_mb_y = mb_y;
thread_context->end_mb_y = s2->mb_height;
if (s->slice_count) {
- s2->thread_context[s->slice_count-1]->end_mb_y = mb_y;
- ret = ff_update_duplicate_context(thread_context,
- s2);
+ s2->thread_context[s->slice_count - 1]->end_mb_y = mb_y;
+ ret = ff_update_duplicate_context(thread_context, s2);
if (ret < 0)
return ret;
}
- init_get_bits(&thread_context->gb, buf_ptr, input_size*8);
+ init_get_bits(&thread_context->gb, buf_ptr, input_size * 8);
s->slice_count++;
}
buf_ptr += 2; // FIXME add minimum number of bytes per slice
@@ -2543,9 +2652,13 @@ static int decode_chunks(AVCodecContext *avctx,
if (avctx->err_recognition & AV_EF_EXPLODE)
return ret;
if (s2->resync_mb_x >= 0 && s2->resync_mb_y >= 0)
- ff_er_add_slice(&s2->er, s2->resync_mb_x, s2->resync_mb_y, s2->mb_x, s2->mb_y, ER_AC_ERROR | ER_DC_ERROR | ER_MV_ERROR);
+ ff_er_add_slice(&s2->er, s2->resync_mb_x,
+ s2->resync_mb_y, s2->mb_x, s2->mb_y,
+ ER_AC_ERROR | ER_DC_ERROR | ER_MV_ERROR);
} else {
- ff_er_add_slice(&s2->er, s2->resync_mb_x, s2->resync_mb_y, s2->mb_x-1, s2->mb_y, ER_AC_END | ER_DC_END | ER_MV_END);
+ ff_er_add_slice(&s2->er, s2->resync_mb_x,
+ s2->resync_mb_y, s2->mb_x - 1, s2->mb_y,
+ ER_AC_END | ER_DC_END | ER_MV_END);
}
}
}
@@ -2554,9 +2667,8 @@ static int decode_chunks(AVCodecContext *avctx,
}
}
-static int mpeg_decode_frame(AVCodecContext *avctx,
- void *data, int *got_output,
- AVPacket *avpkt)
+static int mpeg_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_output, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int ret;
@@ -2564,12 +2676,11 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
Mpeg1Context *s = avctx->priv_data;
AVFrame *picture = data;
MpegEncContext *s2 = &s->mpeg_enc_ctx;
- av_dlog(avctx, "fill_buffer\n");
if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) {
/* special case for last picture */
if (s2->low_delay == 0 && s2->next_picture_ptr) {
- int ret = av_frame_ref(picture, &s2->next_picture_ptr->f);
+ int ret = av_frame_ref(picture, s2->next_picture_ptr->f);
if (ret < 0)
return ret;
@@ -2581,9 +2692,11 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
}
if (s2->flags & CODEC_FLAG_TRUNCATED) {
- int next = ff_mpeg1_find_frame_end(&s2->parse_context, buf, buf_size, NULL);
+ int next = ff_mpeg1_find_frame_end(&s2->parse_context, buf,
+ buf_size, NULL);
- if (ff_combine_frame(&s2->parse_context, next, (const uint8_t **)&buf, &buf_size) < 0)
+ if (ff_combine_frame(&s2->parse_context, next,
+ (const uint8_t **) &buf, &buf_size) < 0)
return buf_size;
}
@@ -2596,8 +2709,9 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
s->slice_count = 0;
if (avctx->extradata && !s->extradata_decoded) {
- ret = decode_chunks(avctx, picture, got_output, avctx->extradata, avctx->extradata_size);
- if(*got_output) {
+ ret = decode_chunks(avctx, picture, got_output,
+ avctx->extradata, avctx->extradata_size);
+ if (*got_output) {
av_log(avctx, AV_LOG_ERROR, "picture in extradata\n");
*got_output = 0;
}
@@ -2615,12 +2729,11 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
return ret;
}
-
static void flush(AVCodecContext *avctx)
{
Mpeg1Context *s = avctx->priv_data;
- s->sync=0;
+ s->sync = 0;
ff_mpeg_flush(avctx);
}
@@ -2644,10 +2757,9 @@ static const AVProfile mpeg2_video_profiles[] = {
{ FF_PROFILE_MPEG2_SIMPLE, "Simple" },
{ FF_PROFILE_RESERVED, "Reserved" },
{ FF_PROFILE_RESERVED, "Reserved" },
- { FF_PROFILE_UNKNOWN },
+ { FF_PROFILE_UNKNOWN },
};
-
AVCodec ff_mpeg1video_decoder = {
.name = "mpeg1video",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
@@ -2726,7 +2838,7 @@ AVCodec ff_mpeg_xvmc_decoder = {
.close = mpeg_decode_end,
.decode = mpeg_decode_frame,
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
- CODEC_CAP_TRUNCATED| CODEC_CAP_HWACCEL | CODEC_CAP_DELAY,
+ CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL | CODEC_CAP_DELAY,
.flush = flush,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg12enc.c b/chromium/third_party/ffmpeg/libavcodec/mpeg12enc.c
index a550379534d..0b20304517c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg12enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg12enc.c
@@ -32,11 +32,14 @@
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/timecode.h"
+#include "libavutil/stereo3d.h"
+
#include "avcodec.h"
#include "bytestream.h"
#include "mathops.h"
#include "mpeg12.h"
#include "mpeg12data.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
@@ -243,7 +246,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
if (aspect_ratio == 0.0)
aspect_ratio = 1.0; // pixel aspect 1.1 (VGA)
- if (s->current_picture.f.key_frame) {
+ if (s->current_picture.f->key_frame) {
AVRational framerate = ff_mpeg12_frame_rate_tab[s->frame_rate_index];
/* mpeg1 header repeated every gop */
@@ -333,10 +336,10 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
/* time code: we must convert from the real frame rate to a
* fake MPEG frame rate in case of low frame rate */
fps = (framerate.num + framerate.den / 2) / framerate.den;
- time_code = s->current_picture_ptr->f.coded_picture_number +
+ time_code = s->current_picture_ptr->f->coded_picture_number +
s->avctx->timecode_frame_start;
- s->gop_picture_number = s->current_picture_ptr->f.coded_picture_number;
+ s->gop_picture_number = s->current_picture_ptr->f->coded_picture_number;
av_assert0(s->drop_frame_timecode == !!(s->tc.flags & AV_TIMECODE_FLAG_DROPFRAME));
if (s->drop_frame_timecode)
@@ -347,7 +350,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
put_bits(&s->pb, 1, 1);
put_bits(&s->pb, 6, (uint32_t)((time_code / fps) % 60));
put_bits(&s->pb, 6, (uint32_t)((time_code % fps)));
- put_bits(&s->pb, 1, !!(s->flags & CODEC_FLAG_CLOSED_GOP));
+ put_bits(&s->pb, 1, !!(s->flags & CODEC_FLAG_CLOSED_GOP) || s->intra_only || !s->gop_picture_number);
put_bits(&s->pb, 1, 0); // broken link
}
}
@@ -388,6 +391,7 @@ void ff_mpeg1_encode_slice_header(MpegEncContext *s)
void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
{
+ AVFrameSideData *side_data;
mpeg1_encode_sequence_header(s);
/* mpeg1 picture header */
@@ -447,7 +451,7 @@ void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
if (s->progressive_sequence)
put_bits(&s->pb, 1, 0); /* no repeat */
else
- put_bits(&s->pb, 1, s->current_picture_ptr->f.top_field_first);
+ put_bits(&s->pb, 1, s->current_picture_ptr->f->top_field_first);
/* XXX: optimize the generation of this flag with entropy measures */
s->frame_pred_frame_dct = s->progressive_sequence;
@@ -471,6 +475,44 @@ void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
for (i = 0; i < sizeof(svcd_scan_offset_placeholder); i++)
put_bits(&s->pb, 8, svcd_scan_offset_placeholder[i]);
}
+ side_data = av_frame_get_side_data(s->current_picture_ptr->f,
+ AV_FRAME_DATA_STEREO3D);
+ if (side_data) {
+ AVStereo3D *stereo = (AVStereo3D *)side_data->data;
+ uint8_t fpa_type;
+
+ switch (stereo->type) {
+ case AV_STEREO3D_SIDEBYSIDE:
+ fpa_type = 0x03;
+ break;
+ case AV_STEREO3D_TOPBOTTOM:
+ fpa_type = 0x04;
+ break;
+ case AV_STEREO3D_2D:
+ fpa_type = 0x08;
+ break;
+ case AV_STEREO3D_SIDEBYSIDE_QUINCUNX:
+ fpa_type = 0x23;
+ break;
+ default:
+ fpa_type = 0;
+ break;
+ }
+
+ if (fpa_type != 0) {
+ put_header(s, USER_START_CODE);
+ put_bits(&s->pb, 8, 'J'); // S3D_video_format_signaling_identifier
+ put_bits(&s->pb, 8, 'P');
+ put_bits(&s->pb, 8, '3');
+ put_bits(&s->pb, 8, 'D');
+ put_bits(&s->pb, 8, 0x03); // S3D_video_format_length
+
+ put_bits(&s->pb, 1, 1); // reserved_bit
+ put_bits(&s->pb, 7, fpa_type); // S3D_video_format_type
+ put_bits(&s->pb, 8, 0x04); // reserved_data[0]
+ put_bits(&s->pb, 8, 0xFF); // reserved_data[1]
+ }
+ }
s->mb_y = 0;
ff_mpeg1_encode_slice_header(s);
@@ -641,7 +683,7 @@ next_coef:
}
static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
- int16_t block[6][64],
+ int16_t block[8][64],
int motion_x, int motion_y,
int mb_block_count)
{
@@ -918,7 +960,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
}
}
-void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[6][64],
+void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64],
int motion_x, int motion_y)
{
if (s->chroma_format == CHROMA_420)
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg4video.c b/chromium/third_party/ffmpeg/libavcodec/mpeg4video.c
index 3f92ba5a99f..38ed5af66f2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg4video.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg4video.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "mpeg4video.h"
#include "mpeg4data.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg4video_parser.c b/chromium/third_party/ffmpeg/libavcodec/mpeg4video_parser.c
index 1da96c0a75d..0990c5a2298 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg4video_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg4video_parser.c
@@ -71,9 +71,8 @@ int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
}
/* XXX: make it use less memory */
-static int av_mpeg4_decode_header(AVCodecParserContext *s1,
- AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
+static int mpeg4_decode_header(AVCodecParserContext *s1, AVCodecContext *avctx,
+ const uint8_t *buf, int buf_size)
{
struct Mp4vParseContext *pc = s1->priv_data;
Mpeg4DecContext *dec_ctx = &pc->dec_ctx;
@@ -141,7 +140,7 @@ static int mpeg4video_parse(AVCodecParserContext *s,
return buf_size;
}
}
- av_mpeg4_decode_header(s, avctx, buf, buf_size);
+ mpeg4_decode_header(s, avctx, buf, buf_size);
*poutbuf = buf;
*poutbuf_size = buf_size;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg4videodec.c b/chromium/third_party/ffmpeg/libavcodec/mpeg4videodec.c
index 9b7799d6fd8..56795514002 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg4videodec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg4videodec.c
@@ -23,6 +23,7 @@
#include "libavutil/opt.h"
#include "error_resilience.h"
#include "internal.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "mpeg4video.h"
#include "h263.h"
@@ -611,7 +612,7 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx)
cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);
if (cbpc < 0) {
av_log(s->avctx, AV_LOG_ERROR,
- "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
+ "mcbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
} while (cbpc == 8);
@@ -683,7 +684,7 @@ try_again:
cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
if (cbpc < 0) {
av_log(s->avctx, AV_LOG_ERROR,
- "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
+ "mcbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
if (cbpc == 20)
@@ -1081,7 +1082,8 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
if (SHOW_UBITS(re, &s->gb, 1) == 0) {
av_log(s->avctx, AV_LOG_ERROR,
"1. marker bit missing in 3. esc\n");
- return -1;
+ if (!(s->err_recognition & AV_EF_IGNORE_ERR))
+ return -1;
}
SKIP_CACHE(re, &s->gb, 1);
@@ -1091,7 +1093,8 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
if (SHOW_UBITS(re, &s->gb, 1) == 0) {
av_log(s->avctx, AV_LOG_ERROR,
"2. marker bit missing in 3. esc\n");
- return -1;
+ if (!(s->err_recognition & AV_EF_IGNORE_ERR))
+ return -1;
}
SKIP_COUNTER(re, &s->gb, 1 + 12 + 1);
@@ -1162,6 +1165,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
LAST_SKIP_BITS(re, &s->gb, 1);
}
+ tprintf(s->avctx, "dct[%d][%d] = %- 4d end?:%d\n", scan_table[i&63]&7, scan_table[i&63] >> 3, level, i>62);
if (i > 62) {
i -= 192;
if (i & (~63)) {
@@ -1328,7 +1332,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64])
cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
if (cbpc < 0) {
av_log(s->avctx, AV_LOG_ERROR,
- "cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
+ "mcbpc damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
} while (cbpc == 20);
@@ -1737,7 +1741,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
}
} else {
/* is setting low delay flag only once the smartest thing to do?
- * low delay detection won't be overriden. */
+ * low delay detection won't be overridden. */
if (s->picture_number == 0)
s->low_delay = 0;
}
@@ -1914,6 +1918,11 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
else
s->quarter_sample = 0;
+ if (get_bits_left(gb) < 4) {
+ av_log(s->avctx, AV_LOG_ERROR, "VOL Header truncated\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (!get_bits1(gb)) {
int pos = get_bits_count(gb);
int estimation_method = get_bits(gb, 2);
@@ -2295,8 +2304,10 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
ROUNDED_DIV(s->last_non_b_time - s->pp_time, ctx->t_frame)) * 2;
s->pb_field_time = (ROUNDED_DIV(s->time, ctx->t_frame) -
ROUNDED_DIV(s->last_non_b_time - s->pp_time, ctx->t_frame)) * 2;
- if (!s->progressive_sequence) {
- if (s->pp_field_time <= s->pb_field_time || s->pb_field_time <= 1)
+ if (s->pp_field_time <= s->pb_field_time || s->pb_field_time <= 1) {
+ s->pb_field_time = 2;
+ s->pp_field_time = 4;
+ if (!s->progressive_sequence)
return FRAME_SKIPPED;
}
}
@@ -2651,10 +2662,9 @@ int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
}
if (startcode_found) {
- av_fast_malloc(&s->bitstream_buffer,
+ av_fast_padded_malloc(&s->bitstream_buffer,
&s->allocated_bitstream_buffer_size,
- buf_size - current_pos +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ buf_size - current_pos);
if (!s->bitstream_buffer)
return AVERROR(ENOMEM);
memcpy(s->bitstream_buffer, buf + current_pos,
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg4videoenc.c b/chromium/third_party/ffmpeg/libavcodec/mpeg4videoenc.c
index 14c6e8faeda..9865e1df731 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg4videoenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg4videoenc.c
@@ -23,6 +23,7 @@
#include "libavutil/attributes.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "h263.h"
#include "mpeg4video.h"
@@ -277,19 +278,19 @@ static inline void mpeg4_encode_dc(PutBitContext *s, int level, int n)
if (n < 4) {
/* luminance */
- put_bits(&s->pb, ff_mpeg4_DCtab_lum[size][1], ff_mpeg4_DCtab_lum[size][0]);
+ put_bits(s, ff_mpeg4_DCtab_lum[size][1], ff_mpeg4_DCtab_lum[size][0]);
} else {
/* chrominance */
- put_bits(&s->pb, ff_mpeg4_DCtab_chrom[size][1], ff_mpeg4_DCtab_chrom[size][0]);
+ put_bits(s, ff_mpeg4_DCtab_chrom[size][1], ff_mpeg4_DCtab_chrom[size][0]);
}
/* encode remaining bits */
if (size > 0) {
if (level < 0)
level = (-level) ^ ((1 << size) - 1);
- put_bits(&s->pb, size, level);
+ put_bits(s, size, level);
if (size > 8)
- put_bits(&s->pb, 1, 1);
+ put_bits(s, 1, 1);
}
#endif
}
@@ -670,7 +671,7 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64],
y = s->mb_y * 16;
offset = x + y * s->linesize;
- p_pic = s->new_picture.f.data[0] + offset;
+ p_pic = s->new_picture.f->data[0] + offset;
s->mb_skipped = 1;
for (i = 0; i < s->max_b_frames; i++) {
@@ -678,10 +679,10 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64],
int diff;
Picture *pic = s->reordered_input_picture[i + 1];
- if (!pic || pic->f.pict_type != AV_PICTURE_TYPE_B)
+ if (!pic || pic->f->pict_type != AV_PICTURE_TYPE_B)
break;
- b_pic = pic->f.data[0] + offset;
+ b_pic = pic->f->data[0] + offset;
if (!pic->shared)
b_pic += INPLACE_OFFSET;
@@ -915,9 +916,9 @@ static void mpeg4_encode_gop_header(MpegEncContext *s)
put_bits(&s->pb, 16, 0);
put_bits(&s->pb, 16, GOP_STARTCODE);
- time = s->current_picture_ptr->f.pts;
+ time = s->current_picture_ptr->f->pts;
if (s->reordered_input_picture[1])
- time = FFMIN(time, s->reordered_input_picture[1]->f.pts);
+ time = FFMIN(time, s->reordered_input_picture[1]->f->pts);
time = time * s->avctx->time_base.num;
s->last_time_base = FFUDIV(time, s->avctx->time_base.den);
@@ -1125,7 +1126,7 @@ void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number)
}
put_bits(&s->pb, 3, 0); /* intra dc VLC threshold */
if (!s->progressive_sequence) {
- put_bits(&s->pb, 1, s->current_picture_ptr->f.top_field_first);
+ put_bits(&s->pb, 1, s->current_picture_ptr->f->top_field_first);
put_bits(&s->pb, 1, s->alternate_scan);
}
// FIXME sprite stuff
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c
index 408193671fe..3d9e94688a7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c
@@ -64,10 +64,11 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
}else{
while(i<buf_size){
int ret, sr, channels, bit_rate, frame_size;
+ enum AVCodecID codec_id;
state= (state<<8) + buf[i++];
- ret = avpriv_mpa_decode_header(avctx, state, &sr, &channels, &frame_size, &bit_rate);
+ ret = avpriv_mpa_decode_header2(state, &sr, &channels, &frame_size, &bit_rate, &codec_id);
if (ret < 4) {
if (i > 4)
s->header_count = -2;
@@ -78,10 +79,11 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
s->header_count++;
s->frame_size = ret-4;
- if (s->header_count > 0) {
+ if (s->header_count > 0 + (avctx->codec_id != AV_CODEC_ID_NONE && avctx->codec_id != codec_id)) {
avctx->sample_rate= sr;
avctx->channels = channels;
s1->duration = frame_size;
+ avctx->codec_id = codec_id;
if (s->no_bitrate || !avctx->bit_rate) {
s->no_bitrate = 1;
avctx->bit_rate += (bit_rate - avctx->bit_rate) / s->header_count;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_template.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_template.c
index 1f29679d912..05237070ea7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_template.c
@@ -216,7 +216,7 @@ static inline int l1_unscale(int n, int mant, int scale_factor)
shift = scale_factor_modshift[scale_factor];
mod = shift & 3;
shift >>= 2;
- val = MUL64(mant + (-1 << n) + 1, scale_factor_mult[n-1][mod]);
+ val = MUL64((int)(mant + (-1U << n) + 1), scale_factor_mult[n-1][mod]);
shift += n;
/* NOTE: at this point, 1 <= shift >= 21 + 15 */
return (int)((val + (1LL << (shift - 1))) >> shift);
@@ -1705,7 +1705,9 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr,
static void mp_flush(MPADecodeContext *ctx)
{
memset(ctx->synth_buf, 0, sizeof(ctx->synth_buf));
+ memset(ctx->mdct_buf, 0, sizeof(ctx->mdct_buf));
ctx->last_buf_size = 0;
+ ctx->dither_state = 0;
}
static void flush(AVCodecContext *avctx)
@@ -1748,6 +1750,7 @@ static int decode_frame_adu(AVCodecContext *avctx, void *data,
/* update codec info */
avctx->sample_rate = s->sample_rate;
avctx->channels = s->nb_channels;
+ avctx->channel_layout = s->nb_channels == 1 ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
if (!avctx->bit_rate)
avctx->bit_rate = s->bit_rate;
@@ -1933,8 +1936,10 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
}
header = (AV_RB32(buf) & 0x000fffff) | s->syncword; // patch header
- if (ff_mpa_check_header(header) < 0) // Bad header, discard block
- break;
+ if (ff_mpa_check_header(header) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Bad header, discard block\n");
+ return AVERROR_INVALIDDATA;
+ }
avpriv_mpegaudio_decode_header((MPADecodeHeader *)m, header);
@@ -1950,8 +1955,13 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
if (m->nb_channels > 1)
outptr[1] = out_samples[s->coff[fr] + 1];
- if ((ret = mp_decode_frame(m, outptr, buf, fsize)) < 0)
- return ret;
+ if ((ret = mp_decode_frame(m, outptr, buf, fsize)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "failed to decode channel %d\n", ch);
+ memset(outptr[0], 0, MPA_FRAME_SIZE*sizeof(OUT_INT));
+ if (m->nb_channels > 1)
+ memset(outptr[1], 0, MPA_FRAME_SIZE*sizeof(OUT_INT));
+ ret = m->nb_channels * MPA_FRAME_SIZE*sizeof(OUT_INT);
+ }
out_size += ret;
buf += fsize;
@@ -1959,6 +1969,10 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
avctx->bit_rate += m->bit_rate;
}
+ if (ch != avctx->channels) {
+ av_log(avctx, AV_LOG_ERROR, "failed to decode all channels\n");
+ return AVERROR_INVALIDDATA;
+ }
/* update codec info */
avctx->sample_rate = s->mp3decctx[0]->sample_rate;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodecheader.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodecheader.c
index 1772c2a3c4a..d337c458a0b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodecheader.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodecheader.c
@@ -108,7 +108,7 @@ int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header)
return 0;
}
-int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate)
+int avpriv_mpa_decode_header2(uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate, enum AVCodecID *codec_id)
{
MPADecodeHeader s1, *s = &s1;
@@ -121,16 +121,16 @@ int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_r
switch(s->layer) {
case 1:
- avctx->codec_id = AV_CODEC_ID_MP1;
+ *codec_id = AV_CODEC_ID_MP1;
*frame_size = 384;
break;
case 2:
- avctx->codec_id = AV_CODEC_ID_MP2;
+ *codec_id = AV_CODEC_ID_MP2;
*frame_size = 1152;
break;
default:
case 3:
- avctx->codec_id = AV_CODEC_ID_MP3;
+ *codec_id = AV_CODEC_ID_MP3;
if (s->lsf)
*frame_size = 576;
else
@@ -143,3 +143,8 @@ int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_r
*bit_rate = s->bit_rate;
return s->frame_size;
}
+
+int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate)
+{
+ return avpriv_mpa_decode_header2(head, sample_rate, channels, frame_size, bit_rate, &avctx->codec_id);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodecheader.h b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodecheader.h
index c434d004418..444b85f2657 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodecheader.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodecheader.h
@@ -56,6 +56,8 @@ int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header);
header, otherwise the coded frame size in bytes */
int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate);
+int avpriv_mpa_decode_header2(uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate, enum AVCodecID *codec_id);
+
/* fast header check for resync */
static inline int ff_mpa_check_header(uint32_t header){
/* header */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodsp.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodsp.c
index ddb74284581..5fe3444896f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodsp.c
@@ -41,6 +41,7 @@ av_cold void ff_mpadsp_init(MPADSPContext *s)
s->imdct36_blocks_float = ff_imdct36_blocks_float;
s->imdct36_blocks_fixed = ff_imdct36_blocks_fixed;
+ if (ARCH_AARCH64) ff_mpadsp_init_aarch64(s);
if (ARCH_ARM) ff_mpadsp_init_arm(s);
if (ARCH_PPC) ff_mpadsp_init_ppc(s);
if (ARCH_X86) ff_mpadsp_init_x86(s);
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodsp.h b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodsp.h
index 38c75c7fe52..a722a2f36b5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodsp.h
@@ -55,6 +55,7 @@ void ff_mpa_synth_filter_float(MPADSPContext *s,
float *samples, int incr,
float *sb_samples);
+void ff_mpadsp_init_aarch64(MPADSPContext *s);
void ff_mpadsp_init_arm(MPADSPContext *s);
void ff_mpadsp_init_ppc(MPADSPContext *s);
void ff_mpadsp_init_x86(MPADSPContext *s);
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudioenc_template.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudioenc_template.c
index b2dfe78254b..e9571d83c76 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudioenc_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudioenc_template.c
@@ -108,10 +108,15 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
s->freq_index = i;
/* encoding bitrate & frequency */
- for(i=0;i<15;i++) {
+ for(i=1;i<15;i++) {
if (avpriv_mpa_bitrate_tab[s->lsf][1][i] == bitrate)
break;
}
+ if (i == 15 && !avctx->bit_rate) {
+ i = 14;
+ bitrate = avpriv_mpa_bitrate_tab[s->lsf][1][i];
+ avctx->bit_rate = bitrate * 1000;
+ }
if (i == 15){
av_log(avctx, AV_LOG_ERROR, "bitrate %d is not allowed in mp2\n", bitrate);
return AVERROR(EINVAL);
@@ -700,9 +705,10 @@ static void encode_frame(MpegAudioContext *s,
else
q1 = sample >> shift;
q1 = (q1 * mult) >> P;
- q[m] = ((q1 + (1 << P)) * steps) >> (P + 1);
- if (q[m] < 0)
- q[m] = 0;
+ q1 += 1 << P;
+ if (q1 < 0)
+ q1 = 0;
+ q[m] = (q1 * (unsigned)steps) >> (P + 1);
}
#endif
if (q[m] >= steps)
@@ -773,7 +779,7 @@ static int MPA_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
static const AVCodecDefault mp2_defaults[] = {
- { "b", "128k" },
+ { "b", "0" },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegutils.c b/chromium/third_party/ffmpeg/libavcodec/mpegutils.c
new file mode 100644
index 00000000000..62cc36aa6e0
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegutils.c
@@ -0,0 +1,80 @@
+/*
+ * Mpeg video formats-related defines and utility functions
+ *
+ * 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 "libavutil/common.h"
+#include "libavutil/frame.h"
+#include "libavutil/pixdesc.h"
+
+#include "avcodec.h"
+#include "mpegutils.h"
+
+void ff_draw_horiz_band(AVCodecContext *avctx,
+ AVFrame *cur, AVFrame *last,
+ int y, int h, int picture_structure,
+ int first_field, int low_delay)
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
+ int vshift = desc->log2_chroma_h;
+ const int field_pic = picture_structure != PICT_FRAME;
+ if (field_pic) {
+ h <<= 1;
+ y <<= 1;
+ }
+
+ h = FFMIN(h, avctx->height - y);
+
+ if (field_pic && first_field &&
+ !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD))
+ return;
+
+ if (avctx->draw_horiz_band) {
+ AVFrame *src;
+ int offset[AV_NUM_DATA_POINTERS];
+ int i;
+
+ if (cur->pict_type == AV_PICTURE_TYPE_B || low_delay ||
+ (avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
+ src = cur;
+ else if (last)
+ src = last;
+ else
+ return;
+
+ if (cur->pict_type == AV_PICTURE_TYPE_B &&
+ picture_structure == PICT_FRAME &&
+ avctx->codec_id != AV_CODEC_ID_SVQ3) {
+ for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
+ offset[i] = 0;
+ } else {
+ offset[0]= y * src->linesize[0];
+ offset[1]=
+ offset[2]= (y >> vshift) * src->linesize[1];
+ for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
+ offset[i] = 0;
+ }
+
+ emms_c();
+
+ avctx->draw_horiz_band(avctx, src, offset,
+ y, picture_structure, h);
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegutils.h b/chromium/third_party/ffmpeg/libavcodec/mpegutils.h
new file mode 100644
index 00000000000..6d59c224240
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegutils.h
@@ -0,0 +1,127 @@
+/*
+ * Mpeg video formats-related defines and utility functions
+ *
+ * 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_MPEGUTILS_H
+#define AVCODEC_MPEGUTILS_H
+
+#include <stdint.h>
+
+#include "libavutil/frame.h"
+
+#include "avcodec.h"
+#include "version.h"
+
+
+/* picture type */
+#define PICT_TOP_FIELD 1
+#define PICT_BOTTOM_FIELD 2
+#define PICT_FRAME 3
+
+/**
+ * Value of Picture.reference when Picture is not a reference picture, but
+ * is held for delayed output.
+ */
+#define DELAYED_PIC_REF 4
+
+
+/* MB types */
+#if !FF_API_MB_TYPE
+#define MB_TYPE_INTRA4x4 (1 << 0)
+#define MB_TYPE_INTRA16x16 (1 << 1) // FIXME H.264-specific
+#define MB_TYPE_INTRA_PCM (1 << 2) // FIXME H.264-specific
+#define MB_TYPE_16x16 (1 << 3)
+#define MB_TYPE_16x8 (1 << 4)
+#define MB_TYPE_8x16 (1 << 5)
+#define MB_TYPE_8x8 (1 << 6)
+#define MB_TYPE_INTERLACED (1 << 7)
+#define MB_TYPE_DIRECT2 (1 << 8) // FIXME
+#define MB_TYPE_ACPRED (1 << 9)
+#define MB_TYPE_GMC (1 << 10)
+#define MB_TYPE_SKIP (1 << 11)
+#define MB_TYPE_P0L0 (1 << 12)
+#define MB_TYPE_P1L0 (1 << 13)
+#define MB_TYPE_P0L1 (1 << 14)
+#define MB_TYPE_P1L1 (1 << 15)
+#define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
+#define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
+#define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
+#define MB_TYPE_QUANT (1 << 16)
+#define MB_TYPE_CBP (1 << 17)
+#endif
+
+#define MB_TYPE_INTRA MB_TYPE_INTRA4x4 // default mb_type if there is just one type
+
+#define IS_INTRA4x4(a) ((a) & MB_TYPE_INTRA4x4)
+#define IS_INTRA16x16(a) ((a) & MB_TYPE_INTRA16x16)
+#define IS_PCM(a) ((a) & MB_TYPE_INTRA_PCM)
+#define IS_INTRA(a) ((a) & 7)
+#define IS_INTER(a) ((a) & (MB_TYPE_16x16 | MB_TYPE_16x8 | \
+ MB_TYPE_8x16 | MB_TYPE_8x8))
+#define IS_SKIP(a) ((a) & MB_TYPE_SKIP)
+#define IS_INTRA_PCM(a) ((a) & MB_TYPE_INTRA_PCM)
+#define IS_INTERLACED(a) ((a) & MB_TYPE_INTERLACED)
+#define IS_DIRECT(a) ((a) & MB_TYPE_DIRECT2)
+#define IS_GMC(a) ((a) & MB_TYPE_GMC)
+#define IS_16X16(a) ((a) & MB_TYPE_16x16)
+#define IS_16X8(a) ((a) & MB_TYPE_16x8)
+#define IS_8X16(a) ((a) & MB_TYPE_8x16)
+#define IS_8X8(a) ((a) & MB_TYPE_8x8)
+#define IS_SUB_8X8(a) ((a) & MB_TYPE_16x16) // note reused
+#define IS_SUB_8X4(a) ((a) & MB_TYPE_16x8) // note reused
+#define IS_SUB_4X8(a) ((a) & MB_TYPE_8x16) // note reused
+#define IS_SUB_4X4(a) ((a) & MB_TYPE_8x8) // note reused
+#define IS_ACPRED(a) ((a) & MB_TYPE_ACPRED)
+#define IS_QUANT(a) ((a) & MB_TYPE_QUANT)
+#define IS_DIR(a, part, list) ((a) & (MB_TYPE_P0L0 << ((part) + 2 * (list))))
+
+// does this mb use listX, note does not work if subMBs
+#define USES_LIST(a, list) ((a) & ((MB_TYPE_P0L0 | MB_TYPE_P1L0) << (2 * (list))))
+
+#define HAS_CBP(a) ((a) & MB_TYPE_CBP)
+
+/* MB types for encoding */
+#define CANDIDATE_MB_TYPE_INTRA (1 << 0)
+#define CANDIDATE_MB_TYPE_INTER (1 << 1)
+#define CANDIDATE_MB_TYPE_INTER4V (1 << 2)
+#define CANDIDATE_MB_TYPE_SKIPPED (1 << 3)
+
+#define CANDIDATE_MB_TYPE_DIRECT (1 << 4)
+#define CANDIDATE_MB_TYPE_FORWARD (1 << 5)
+#define CANDIDATE_MB_TYPE_BACKWARD (1 << 6)
+#define CANDIDATE_MB_TYPE_BIDIR (1 << 7)
+
+#define CANDIDATE_MB_TYPE_INTER_I (1 << 8)
+#define CANDIDATE_MB_TYPE_FORWARD_I (1 << 9)
+#define CANDIDATE_MB_TYPE_BACKWARD_I (1 << 10)
+#define CANDIDATE_MB_TYPE_BIDIR_I (1 << 11)
+
+#define CANDIDATE_MB_TYPE_DIRECT0 (1 << 12)
+
+
+/**
+ * Draw a horizontal band if supported.
+ *
+ * @param h is the normal height, this will be reduced automatically if needed
+ */
+void ff_draw_horiz_band(AVCodecContext *avctx, AVFrame *cur, AVFrame *last,
+ int y, int h, int picture_structure, int first_field,
+ int low_delay);
+
+#endif /* AVCODEC_PICTTYPE_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo.c b/chromium/third_party/ffmpeg/libavcodec/mpegvideo.c
index 7380af05c96..e1d1efc50eb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo.c
@@ -31,33 +31,19 @@
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
+#include "libavutil/timer.h"
#include "avcodec.h"
#include "dsputil.h"
#include "h264chroma.h"
#include "internal.h"
#include "mathops.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "mjpegenc.h"
#include "msmpeg4.h"
-#include "xvmc_internal.h"
#include "thread.h"
#include <limits.h>
-static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
- int16_t *block, int n, int qscale);
-static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
- int16_t *block, int n, int qscale);
-static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
- int16_t *block, int n, int qscale);
-static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
- int16_t *block, int n, int qscale);
-static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
- int16_t *block, int n, int qscale);
-static void dct_unquantize_h263_intra_c(MpegEncContext *s,
- int16_t *block, int n, int qscale);
-static void dct_unquantize_h263_inter_c(MpegEncContext *s,
- int16_t *block, int n, int qscale);
-
static const uint8_t ff_default_chroma_qscale_table[32] = {
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
@@ -119,10 +105,212 @@ const uint8_t *const ff_mpeg2_dc_scale_table[4] = {
mpeg2_dc_scale_table3,
};
-const enum AVPixelFormat ff_pixfmt_list_420[] = {
- AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_NONE
-};
+static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
+ int16_t *block, int n, int qscale)
+{
+ int i, level, nCoeffs;
+ const uint16_t *quant_matrix;
+
+ nCoeffs= s->block_last_index[n];
+
+ block[0] *= n < 4 ? s->y_dc_scale : s->c_dc_scale;
+ /* XXX: only mpeg1 */
+ quant_matrix = s->intra_matrix;
+ for(i=1;i<=nCoeffs;i++) {
+ int j= s->intra_scantable.permutated[i];
+ level = block[j];
+ if (level) {
+ if (level < 0) {
+ level = -level;
+ level = (int)(level * qscale * quant_matrix[j]) >> 3;
+ level = (level - 1) | 1;
+ level = -level;
+ } else {
+ level = (int)(level * qscale * quant_matrix[j]) >> 3;
+ level = (level - 1) | 1;
+ }
+ block[j] = level;
+ }
+ }
+}
+
+static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
+ int16_t *block, int n, int qscale)
+{
+ int i, level, nCoeffs;
+ const uint16_t *quant_matrix;
+
+ nCoeffs= s->block_last_index[n];
+
+ quant_matrix = s->inter_matrix;
+ for(i=0; i<=nCoeffs; i++) {
+ int j= s->intra_scantable.permutated[i];
+ level = block[j];
+ if (level) {
+ if (level < 0) {
+ level = -level;
+ level = (((level << 1) + 1) * qscale *
+ ((int) (quant_matrix[j]))) >> 4;
+ level = (level - 1) | 1;
+ level = -level;
+ } else {
+ level = (((level << 1) + 1) * qscale *
+ ((int) (quant_matrix[j]))) >> 4;
+ level = (level - 1) | 1;
+ }
+ block[j] = level;
+ }
+ }
+}
+
+static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
+ int16_t *block, int n, int qscale)
+{
+ int i, level, nCoeffs;
+ const uint16_t *quant_matrix;
+
+ if(s->alternate_scan) nCoeffs= 63;
+ else nCoeffs= s->block_last_index[n];
+
+ block[0] *= n < 4 ? s->y_dc_scale : s->c_dc_scale;
+ quant_matrix = s->intra_matrix;
+ for(i=1;i<=nCoeffs;i++) {
+ int j= s->intra_scantable.permutated[i];
+ level = block[j];
+ if (level) {
+ if (level < 0) {
+ level = -level;
+ level = (int)(level * qscale * quant_matrix[j]) >> 3;
+ level = -level;
+ } else {
+ level = (int)(level * qscale * quant_matrix[j]) >> 3;
+ }
+ block[j] = level;
+ }
+ }
+}
+
+static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
+ int16_t *block, int n, int qscale)
+{
+ int i, level, nCoeffs;
+ const uint16_t *quant_matrix;
+ int sum=-1;
+
+ if(s->alternate_scan) nCoeffs= 63;
+ else nCoeffs= s->block_last_index[n];
+
+ block[0] *= n < 4 ? s->y_dc_scale : s->c_dc_scale;
+ sum += block[0];
+ quant_matrix = s->intra_matrix;
+ for(i=1;i<=nCoeffs;i++) {
+ int j= s->intra_scantable.permutated[i];
+ level = block[j];
+ if (level) {
+ if (level < 0) {
+ level = -level;
+ level = (int)(level * qscale * quant_matrix[j]) >> 3;
+ level = -level;
+ } else {
+ level = (int)(level * qscale * quant_matrix[j]) >> 3;
+ }
+ block[j] = level;
+ sum+=level;
+ }
+ }
+ block[63]^=sum&1;
+}
+
+static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
+ int16_t *block, int n, int qscale)
+{
+ int i, level, nCoeffs;
+ const uint16_t *quant_matrix;
+ int sum=-1;
+
+ if(s->alternate_scan) nCoeffs= 63;
+ else nCoeffs= s->block_last_index[n];
+
+ quant_matrix = s->inter_matrix;
+ for(i=0; i<=nCoeffs; i++) {
+ int j= s->intra_scantable.permutated[i];
+ level = block[j];
+ if (level) {
+ if (level < 0) {
+ level = -level;
+ level = (((level << 1) + 1) * qscale *
+ ((int) (quant_matrix[j]))) >> 4;
+ level = -level;
+ } else {
+ level = (((level << 1) + 1) * qscale *
+ ((int) (quant_matrix[j]))) >> 4;
+ }
+ block[j] = level;
+ sum+=level;
+ }
+ }
+ block[63]^=sum&1;
+}
+
+static void dct_unquantize_h263_intra_c(MpegEncContext *s,
+ int16_t *block, int n, int qscale)
+{
+ int i, level, qmul, qadd;
+ int nCoeffs;
+
+ av_assert2(s->block_last_index[n]>=0 || s->h263_aic);
+
+ qmul = qscale << 1;
+
+ if (!s->h263_aic) {
+ block[0] *= n < 4 ? s->y_dc_scale : s->c_dc_scale;
+ qadd = (qscale - 1) | 1;
+ }else{
+ qadd = 0;
+ }
+ if(s->ac_pred)
+ nCoeffs=63;
+ else
+ nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
+
+ for(i=1; i<=nCoeffs; i++) {
+ level = block[i];
+ if (level) {
+ if (level < 0) {
+ level = level * qmul - qadd;
+ } else {
+ level = level * qmul + qadd;
+ }
+ block[i] = level;
+ }
+ }
+}
+
+static void dct_unquantize_h263_inter_c(MpegEncContext *s,
+ int16_t *block, int n, int qscale)
+{
+ int i, level, qmul, qadd;
+ int nCoeffs;
+
+ av_assert2(s->block_last_index[n]>=0);
+
+ qadd = (qscale - 1) | 1;
+ qmul = qscale << 1;
+
+ nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
+
+ for(i=0; i<=nCoeffs; i++) {
+ level = block[i];
+ if (level) {
+ if (level < 0) {
+ level = level * qmul - qadd;
+ } else {
+ level = level * qmul + qadd;
+ }
+ block[i] = level;
+ }
+ }
+}
static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
int (*mv)[2][4][2],
@@ -143,15 +331,27 @@ static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
s->dsp.clear_blocks(s->block[0]);
- s->dest[0] = s->current_picture.f.data[0] + (s->mb_y * 16 * s->linesize) + s->mb_x * 16;
- s->dest[1] = s->current_picture.f.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.f.data[2] + (s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16 >> s->chroma_x_shift);
+ s->dest[0] = s->current_picture.f->data[0] + (s->mb_y * 16 * s->linesize) + s->mb_x * 16;
+ s->dest[1] = s->current_picture.f->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.f->data[2] + (s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16 >> s->chroma_x_shift);
if (ref)
av_log(s->avctx, AV_LOG_DEBUG, "Interlaced error concealment is not fully implemented\n");
ff_MPV_decode_mb(s, s->block);
}
+static void gray16(uint8_t *dst, const uint8_t *src, ptrdiff_t linesize, int h)
+{
+ while(h--)
+ memset(dst + h*linesize, 128, 16);
+}
+
+static void gray8(uint8_t *dst, const uint8_t *src, ptrdiff_t linesize, int h)
+{
+ while(h--)
+ memset(dst + h*linesize, 128, 8);
+}
+
/* init common dct for both encoder and decoder */
av_cold int ff_dct_common_init(MpegEncContext *s)
{
@@ -160,6 +360,19 @@ av_cold int ff_dct_common_init(MpegEncContext *s)
ff_hpeldsp_init(&s->hdsp, s->avctx->flags);
ff_videodsp_init(&s->vdsp, s->avctx->bits_per_raw_sample);
+ if (s->avctx->debug & FF_DEBUG_NOMC) {
+ int i;
+ for (i=0; i<4; i++) {
+ s->hdsp.avg_pixels_tab[0][i] = gray16;
+ s->hdsp.put_pixels_tab[0][i] = gray16;
+ s->hdsp.put_no_rnd_pixels_tab[0][i] = gray16;
+
+ s->hdsp.avg_pixels_tab[1][i] = gray8;
+ s->hdsp.put_pixels_tab[1][i] = gray8;
+ s->hdsp.put_no_rnd_pixels_tab[1][i] = gray8;
+ }
+ }
+
s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_c;
s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_c;
s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_c;
@@ -173,8 +386,6 @@ av_cold int ff_dct_common_init(MpegEncContext *s)
ff_MPV_common_init_axp(s);
if (ARCH_ARM)
ff_MPV_common_init_arm(s);
- if (ARCH_BFIN)
- ff_MPV_common_init_bfin(s);
if (ARCH_PPC)
ff_MPV_common_init_ppc(s);
if (ARCH_X86)
@@ -226,31 +437,49 @@ fail:
*/
static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
{
+ int edges_needed = av_codec_is_encoder(s->avctx->codec);
int r, ret;
- pic->tf.f = &pic->f;
+ pic->tf.f = pic->f;
if (s->codec_id != AV_CODEC_ID_WMV3IMAGE &&
s->codec_id != AV_CODEC_ID_VC1IMAGE &&
- s->codec_id != AV_CODEC_ID_MSS2)
+ s->codec_id != AV_CODEC_ID_MSS2) {
+ if (edges_needed) {
+ pic->f->width = s->avctx->width + 2 * EDGE_WIDTH;
+ pic->f->height = s->avctx->height + 2 * EDGE_WIDTH;
+ }
+
r = ff_thread_get_buffer(s->avctx, &pic->tf,
pic->reference ? AV_GET_BUFFER_FLAG_REF : 0);
- else {
- pic->f.width = s->avctx->width;
- pic->f.height = s->avctx->height;
- pic->f.format = s->avctx->pix_fmt;
- r = avcodec_default_get_buffer2(s->avctx, &pic->f, 0);
+ } else {
+ pic->f->width = s->avctx->width;
+ pic->f->height = s->avctx->height;
+ pic->f->format = s->avctx->pix_fmt;
+ r = avcodec_default_get_buffer2(s->avctx, pic->f, 0);
}
- if (r < 0 || !pic->f.buf[0]) {
+ if (r < 0 || !pic->f->buf[0]) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (%d %p)\n",
- r, pic->f.data[0]);
+ r, pic->f->data[0]);
return -1;
}
+ if (edges_needed) {
+ int i;
+ for (i = 0; pic->f->data[i]; i++) {
+ int offset = (EDGE_WIDTH >> (i ? s->chroma_y_shift : 0)) *
+ pic->f->linesize[i] +
+ (EDGE_WIDTH >> (i ? s->chroma_x_shift : 0));
+ pic->f->data[i] += offset;
+ }
+ pic->f->width = s->avctx->width;
+ pic->f->height = s->avctx->height;
+ }
+
if (s->avctx->hwaccel) {
assert(!pic->hwaccel_picture_private);
- if (s->avctx->hwaccel->priv_data_size) {
- pic->hwaccel_priv_buf = av_buffer_allocz(s->avctx->hwaccel->priv_data_size);
+ if (s->avctx->hwaccel->frame_priv_data_size) {
+ pic->hwaccel_priv_buf = av_buffer_allocz(s->avctx->hwaccel->frame_priv_data_size);
if (!pic->hwaccel_priv_buf) {
av_log(s->avctx, AV_LOG_ERROR, "alloc_frame_buffer() failed (hwaccel private data allocation)\n");
return -1;
@@ -259,15 +488,15 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
}
}
- if (s->linesize && (s->linesize != pic->f.linesize[0] ||
- s->uvlinesize != pic->f.linesize[1])) {
+ if (s->linesize && (s->linesize != pic->f->linesize[0] ||
+ s->uvlinesize != pic->f->linesize[1])) {
av_log(s->avctx, AV_LOG_ERROR,
"get_buffer() failed (stride changed)\n");
ff_mpeg_unref_picture(s, pic);
return -1;
}
- if (pic->f.linesize[1] != pic->f.linesize[2]) {
+ if (pic->f->linesize[1] != pic->f->linesize[2]) {
av_log(s->avctx, AV_LOG_ERROR,
"get_buffer() failed (uv stride mismatch)\n");
ff_mpeg_unref_picture(s, pic);
@@ -275,7 +504,7 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
}
if (!s->edge_emu_buffer &&
- (ret = frame_size_alloc(s, pic->f.linesize[0])) < 0) {
+ (ret = frame_size_alloc(s, pic->f->linesize[0])) < 0) {
av_log(s->avctx, AV_LOG_ERROR,
"get_buffer() failed to allocate context scratch buffers.\n");
ff_mpeg_unref_picture(s, pic);
@@ -385,16 +614,16 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared)
ff_free_picture_tables(pic);
if (shared) {
- av_assert0(pic->f.data[0]);
+ av_assert0(pic->f->data[0]);
pic->shared = 1;
} else {
- av_assert0(!pic->f.buf[0]);
+ av_assert0(!pic->f->buf[0]);
if (alloc_frame_buffer(s, pic) < 0)
return -1;
- s->linesize = pic->f.linesize[0];
- s->uvlinesize = pic->f.linesize[1];
+ s->linesize = pic->f->linesize[0];
+ s->uvlinesize = pic->f->linesize[1];
}
if (!pic->qscale_table_buf)
@@ -436,15 +665,15 @@ void ff_mpeg_unref_picture(MpegEncContext *s, Picture *pic)
{
int off = offsetof(Picture, mb_mean) + sizeof(pic->mb_mean);
- pic->tf.f = &pic->f;
+ pic->tf.f = pic->f;
/* WM Image / Screen codecs allocate internal buffers with different
* dimensions / colorspaces; ignore user-defined callbacks for these. */
if (s->codec_id != AV_CODEC_ID_WMV3IMAGE &&
s->codec_id != AV_CODEC_ID_VC1IMAGE &&
s->codec_id != AV_CODEC_ID_MSS2)
ff_thread_release_buffer(s->avctx, &pic->tf);
- else
- av_frame_unref(&pic->f);
+ else if (pic->f)
+ av_frame_unref(pic->f);
av_buffer_unref(&pic->hwaccel_priv_buf);
@@ -503,11 +732,11 @@ int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src)
{
int ret;
- av_assert0(!dst->f.buf[0]);
- av_assert0(src->f.buf[0]);
+ av_assert0(!dst->f->buf[0]);
+ av_assert0(src->f->buf[0]);
- src->tf.f = &src->f;
- dst->tf.f = &dst->f;
+ src->tf.f = src->f;
+ dst->tf.f = dst->f;
ret = ff_thread_ref_frame(&dst->tf, &src->tf);
if (ret < 0)
goto fail;
@@ -553,6 +782,9 @@ static int init_duplicate_context(MpegEncContext *s)
int yc_size = y_size + 2 * c_size;
int i;
+ if (s->mb_height & 1)
+ yc_size += 2*s->b8_stride + 2*s->mb_stride;
+
s->edge_emu_buffer =
s->me.scratchpad =
s->me.temp =
@@ -716,7 +948,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
if(s->picture)
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
ff_mpeg_unref_picture(s, &s->picture[i]);
- if (s1->picture[i].f.buf[0] &&
+ if (s1->picture[i].f->buf[0] &&
(ret = ff_mpeg_ref_picture(s, &s->picture[i], &s1->picture[i])) < 0)
return ret;
}
@@ -724,7 +956,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
#define UPDATE_PICTURE(pic)\
do {\
ff_mpeg_unref_picture(s, &s->pic);\
- if (s1->pic.f.buf[0])\
+ if (s1->pic.f && s1->pic.f->buf[0])\
ret = ff_mpeg_ref_picture(s, &s->pic, &s1->pic);\
else\
ret = update_picture_tables(&s->pic, &s1->pic);\
@@ -791,7 +1023,7 @@ do {\
if (!s1->first_field) {
s->last_pict_type = s1->pict_type;
if (s1->current_picture_ptr)
- s->last_lambda_for[s1->pict_type] = s1->current_picture_ptr->f.quality;
+ s->last_lambda_for[s1->pict_type] = s1->current_picture_ptr->f->quality;
}
return 0;
@@ -878,11 +1110,10 @@ static int init_context_frame(MpegEncContext *s)
s->mb_width = (s->width + 15) / 16;
s->mb_stride = s->mb_width + 1;
s->b8_stride = s->mb_width * 2 + 1;
- s->b4_stride = s->mb_width * 4 + 1;
mb_array_size = s->mb_height * s->mb_stride;
mv_table_size = (s->mb_height + 2) * s->mb_stride + 1;
- /* set default edge pos, will be overriden
+ /* set default edge pos, will be overridden
* in decode_header if needed */
s->h_edge_pos = s->mb_width * 16;
s->v_edge_pos = s->mb_height * 16;
@@ -900,6 +1131,9 @@ static int init_context_frame(MpegEncContext *s)
c_size = s->mb_stride * (s->mb_height + 1);
yc_size = y_size + 2 * c_size;
+ if (s->mb_height & 1)
+ yc_size += 2*s->b8_stride + 2*s->mb_stride;
+
FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int), fail); // error ressilience code looks cleaner with this
for (y = 0; y < s->mb_height; y++)
for (x = 0; x < s->mb_width; x++)
@@ -957,7 +1191,7 @@ static int init_context_frame(MpegEncContext *s)
}
if (s->out_format == FMT_H263) {
/* cbp values */
- FF_ALLOCZ_OR_GOTO(s->avctx, s->coded_block_base, y_size, fail);
+ FF_ALLOCZ_OR_GOTO(s->avctx, s->coded_block_base, y_size + (s->mb_height&1)*2*s->b8_stride, fail);
s->coded_block = s->coded_block_base + s->b8_stride + 1;
/* cbp, ac_pred, pred_dir */
@@ -1047,14 +1281,26 @@ av_cold int ff_MPV_common_init(MpegEncContext *s)
FF_ALLOCZ_OR_GOTO(s->avctx, s->picture,
MAX_PICTURE_COUNT * sizeof(Picture), fail);
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
- avcodec_get_frame_defaults(&s->picture[i].f);
+ s->picture[i].f = av_frame_alloc();
+ if (!s->picture[i].f)
+ goto fail;
}
memset(&s->next_picture, 0, sizeof(s->next_picture));
memset(&s->last_picture, 0, sizeof(s->last_picture));
memset(&s->current_picture, 0, sizeof(s->current_picture));
- avcodec_get_frame_defaults(&s->next_picture.f);
- avcodec_get_frame_defaults(&s->last_picture.f);
- avcodec_get_frame_defaults(&s->current_picture.f);
+ memset(&s->new_picture, 0, sizeof(s->new_picture));
+ s->next_picture.f = av_frame_alloc();
+ if (!s->next_picture.f)
+ goto fail;
+ s->last_picture.f = av_frame_alloc();
+ if (!s->last_picture.f)
+ goto fail;
+ s->current_picture.f = av_frame_alloc();
+ if (!s->current_picture.f)
+ goto fail;
+ s->new_picture.f = av_frame_alloc();
+ if (!s->new_picture.f)
+ goto fail;
if (init_context_frame(s))
goto fail;
@@ -1248,15 +1494,22 @@ void ff_MPV_common_end(MpegEncContext *s)
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
ff_free_picture_tables(&s->picture[i]);
ff_mpeg_unref_picture(s, &s->picture[i]);
+ av_frame_free(&s->picture[i].f);
}
}
av_freep(&s->picture);
ff_free_picture_tables(&s->last_picture);
ff_mpeg_unref_picture(s, &s->last_picture);
+ av_frame_free(&s->last_picture.f);
ff_free_picture_tables(&s->current_picture);
ff_mpeg_unref_picture(s, &s->current_picture);
+ av_frame_free(&s->current_picture.f);
ff_free_picture_tables(&s->next_picture);
ff_mpeg_unref_picture(s, &s->next_picture);
+ av_frame_free(&s->next_picture.f);
+ ff_free_picture_tables(&s->new_picture);
+ ff_mpeg_unref_picture(s, &s->new_picture);
+ av_frame_free(&s->new_picture.f);
free_context_frame(s);
@@ -1374,7 +1627,7 @@ static inline int pic_is_unused(MpegEncContext *s, Picture *pic)
{
if (pic == s->last_picture_ptr)
return 0;
- if (pic->f.buf[0] == NULL)
+ if (pic->f->buf[0] == NULL)
return 1;
if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF))
return 1;
@@ -1387,7 +1640,7 @@ static int find_unused_picture(MpegEncContext *s, int shared)
if (shared) {
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
- if (s->picture[i].f.buf[0] == NULL && &s->picture[i] != s->last_picture_ptr)
+ if (s->picture[i].f->buf[0] == NULL && &s->picture[i] != s->last_picture_ptr)
return i;
}
} else {
@@ -1423,36 +1676,30 @@ int ff_find_unused_picture(MpegEncContext *s, int shared)
s->picture[ret].needs_realloc = 0;
ff_free_picture_tables(&s->picture[ret]);
ff_mpeg_unref_picture(s, &s->picture[ret]);
- avcodec_get_frame_defaults(&s->picture[ret].f);
}
}
return ret;
}
-static void update_noise_reduction(MpegEncContext *s)
+static void gray_frame(AVFrame *frame)
{
- int intra, i;
+ int i, h_chroma_shift, v_chroma_shift;
- for (intra = 0; intra < 2; intra++) {
- if (s->dct_count[intra] > (1 << 16)) {
- for (i = 0; i < 64; i++) {
- s->dct_error_sum[intra][i] >>= 1;
- }
- s->dct_count[intra] >>= 1;
- }
+ av_pix_fmt_get_chroma_sub_sample(frame->format, &h_chroma_shift, &v_chroma_shift);
- for (i = 0; i < 64; i++) {
- s->dct_offset[intra][i] = (s->avctx->noise_reduction *
- s->dct_count[intra] +
- s->dct_error_sum[intra][i] / 2) /
- (s->dct_error_sum[intra][i] + 1);
- }
+ for(i=0; i<frame->height; i++)
+ memset(frame->data[0] + frame->linesize[0]*i, 0x80, frame->width);
+ for(i=0; i<FF_CEIL_RSHIFT(frame->height, v_chroma_shift); i++) {
+ memset(frame->data[1] + frame->linesize[1]*i,
+ 0x80, FF_CEIL_RSHIFT(frame->width, h_chroma_shift));
+ memset(frame->data[2] + frame->linesize[2]*i,
+ 0x80, FF_CEIL_RSHIFT(frame->width, h_chroma_shift));
}
}
/**
- * generic function for encode/decode called after coding/decoding
- * the header and before a frame is coded/decoded.
+ * generic function called after decoding
+ * the header and before a frame is decoded.
*/
int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
{
@@ -1468,73 +1715,69 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
/* mark & release old frames */
if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr &&
s->last_picture_ptr != s->next_picture_ptr &&
- s->last_picture_ptr->f.buf[0]) {
+ s->last_picture_ptr->f->buf[0]) {
ff_mpeg_unref_picture(s, s->last_picture_ptr);
}
/* release forgotten pictures */
/* if (mpeg124/h263) */
- if (!s->encoding) {
- for (i = 0; i < MAX_PICTURE_COUNT; i++) {
- if (&s->picture[i] != s->last_picture_ptr &&
- &s->picture[i] != s->next_picture_ptr &&
- s->picture[i].reference && !s->picture[i].needs_realloc) {
- if (!(avctx->active_thread_type & FF_THREAD_FRAME))
- av_log(avctx, AV_LOG_ERROR,
- "releasing zombie picture\n");
- ff_mpeg_unref_picture(s, &s->picture[i]);
- }
+ for (i = 0; i < MAX_PICTURE_COUNT; i++) {
+ if (&s->picture[i] != s->last_picture_ptr &&
+ &s->picture[i] != s->next_picture_ptr &&
+ s->picture[i].reference && !s->picture[i].needs_realloc) {
+ if (!(avctx->active_thread_type & FF_THREAD_FRAME))
+ av_log(avctx, AV_LOG_ERROR,
+ "releasing zombie picture\n");
+ ff_mpeg_unref_picture(s, &s->picture[i]);
}
}
ff_mpeg_unref_picture(s, &s->current_picture);
- if (!s->encoding) {
- release_unused_pictures(s);
+ release_unused_pictures(s);
- if (s->current_picture_ptr &&
- s->current_picture_ptr->f.buf[0] == NULL) {
- // we already have a unused image
- // (maybe it was set before reading the header)
- pic = s->current_picture_ptr;
- } else {
- i = ff_find_unused_picture(s, 0);
- if (i < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "no frame buffer available\n");
- return i;
- }
- pic = &s->picture[i];
+ if (s->current_picture_ptr &&
+ s->current_picture_ptr->f->buf[0] == NULL) {
+ // we already have a unused image
+ // (maybe it was set before reading the header)
+ pic = s->current_picture_ptr;
+ } else {
+ i = ff_find_unused_picture(s, 0);
+ if (i < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "no frame buffer available\n");
+ return i;
}
+ pic = &s->picture[i];
+ }
- pic->reference = 0;
- if (!s->droppable) {
- if (s->pict_type != AV_PICTURE_TYPE_B)
- pic->reference = 3;
- }
+ pic->reference = 0;
+ if (!s->droppable) {
+ if (s->pict_type != AV_PICTURE_TYPE_B)
+ pic->reference = 3;
+ }
- pic->f.coded_picture_number = s->coded_picture_number++;
+ pic->f->coded_picture_number = s->coded_picture_number++;
- if (ff_alloc_picture(s, pic, 0) < 0)
- return -1;
+ if (ff_alloc_picture(s, pic, 0) < 0)
+ return -1;
- s->current_picture_ptr = pic;
- // FIXME use only the vars from current_pic
- s->current_picture_ptr->f.top_field_first = s->top_field_first;
- if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO ||
- s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
- if (s->picture_structure != PICT_FRAME)
- s->current_picture_ptr->f.top_field_first =
- (s->picture_structure == PICT_TOP_FIELD) == s->first_field;
- }
- s->current_picture_ptr->f.interlaced_frame = !s->progressive_frame &&
- !s->progressive_sequence;
- s->current_picture_ptr->field_picture = s->picture_structure != PICT_FRAME;
+ s->current_picture_ptr = pic;
+ // FIXME use only the vars from current_pic
+ s->current_picture_ptr->f->top_field_first = s->top_field_first;
+ if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO ||
+ s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
+ if (s->picture_structure != PICT_FRAME)
+ s->current_picture_ptr->f->top_field_first =
+ (s->picture_structure == PICT_TOP_FIELD) == s->first_field;
}
+ s->current_picture_ptr->f->interlaced_frame = !s->progressive_frame &&
+ !s->progressive_sequence;
+ s->current_picture_ptr->field_picture = s->picture_structure != PICT_FRAME;
- s->current_picture_ptr->f.pict_type = s->pict_type;
+ s->current_picture_ptr->f->pict_type = s->pict_type;
// if (s->flags && CODEC_FLAG_QSCALE)
// s->current_picture_ptr->quality = s->new_picture_ptr->quality;
- s->current_picture_ptr->f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+ s->current_picture_ptr->f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
if ((ret = ff_mpeg_ref_picture(s, &s->current_picture,
s->current_picture_ptr)) < 0)
@@ -1547,19 +1790,19 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
}
av_dlog(s->avctx, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n",
s->last_picture_ptr, s->next_picture_ptr,s->current_picture_ptr,
- s->last_picture_ptr ? s->last_picture_ptr->f.data[0] : NULL,
- s->next_picture_ptr ? s->next_picture_ptr->f.data[0] : NULL,
- s->current_picture_ptr ? s->current_picture_ptr->f.data[0] : NULL,
+ s->last_picture_ptr ? s->last_picture_ptr->f->data[0] : NULL,
+ s->next_picture_ptr ? s->next_picture_ptr->f->data[0] : NULL,
+ s->current_picture_ptr ? s->current_picture_ptr->f->data[0] : NULL,
s->pict_type, s->droppable);
if ((s->last_picture_ptr == NULL ||
- s->last_picture_ptr->f.buf[0] == NULL) &&
+ s->last_picture_ptr->f->buf[0] == NULL) &&
(s->pict_type != AV_PICTURE_TYPE_I ||
s->picture_structure != PICT_FRAME)) {
int h_chroma_shift, v_chroma_shift;
av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
&h_chroma_shift, &v_chroma_shift);
- if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr && s->next_picture_ptr->f.buf[0])
+ if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr && s->next_picture_ptr->f->buf[0])
av_log(avctx, AV_LOG_DEBUG,
"allocating dummy last picture for B frame\n");
else if (s->pict_type != AV_PICTURE_TYPE_I)
@@ -1576,31 +1819,38 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
return i;
}
s->last_picture_ptr = &s->picture[i];
- s->last_picture_ptr->f.key_frame = 0;
+
+ s->last_picture_ptr->reference = 3;
+ s->last_picture_ptr->f->key_frame = 0;
+ s->last_picture_ptr->f->pict_type = AV_PICTURE_TYPE_P;
+
if (ff_alloc_picture(s, s->last_picture_ptr, 0) < 0) {
s->last_picture_ptr = NULL;
return -1;
}
- memset(s->last_picture_ptr->f.data[0], 0x80,
- avctx->height * s->last_picture_ptr->f.linesize[0]);
- memset(s->last_picture_ptr->f.data[1], 0x80,
- (avctx->height >> v_chroma_shift) *
- s->last_picture_ptr->f.linesize[1]);
- memset(s->last_picture_ptr->f.data[2], 0x80,
- (avctx->height >> v_chroma_shift) *
- s->last_picture_ptr->f.linesize[2]);
-
- if(s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263){
+ if (!avctx->hwaccel && !(avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)) {
for(i=0; i<avctx->height; i++)
- memset(s->last_picture_ptr->f.data[0] + s->last_picture_ptr->f.linesize[0]*i, 16, avctx->width);
+ memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0]*i,
+ 0x80, avctx->width);
+ for(i=0; i<FF_CEIL_RSHIFT(avctx->height, v_chroma_shift); i++) {
+ memset(s->last_picture_ptr->f->data[1] + s->last_picture_ptr->f->linesize[1]*i,
+ 0x80, FF_CEIL_RSHIFT(avctx->width, h_chroma_shift));
+ memset(s->last_picture_ptr->f->data[2] + s->last_picture_ptr->f->linesize[2]*i,
+ 0x80, FF_CEIL_RSHIFT(avctx->width, h_chroma_shift));
+ }
+
+ if(s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263){
+ for(i=0; i<avctx->height; i++)
+ memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0]*i, 16, avctx->width);
+ }
}
ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 0);
ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 1);
}
if ((s->next_picture_ptr == NULL ||
- s->next_picture_ptr->f.buf[0] == NULL) &&
+ s->next_picture_ptr->f->buf[0] == NULL) &&
s->pict_type == AV_PICTURE_TYPE_B) {
/* Allocate a dummy frame */
i = ff_find_unused_picture(s, 0);
@@ -1609,7 +1859,11 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
return i;
}
s->next_picture_ptr = &s->picture[i];
- s->next_picture_ptr->f.key_frame = 0;
+
+ s->next_picture_ptr->reference = 3;
+ s->next_picture_ptr->f->key_frame = 0;
+ s->next_picture_ptr->f->pict_type = AV_PICTURE_TYPE_P;
+
if (ff_alloc_picture(s, s->next_picture_ptr, 0) < 0) {
s->next_picture_ptr = NULL;
return -1;
@@ -1619,37 +1873,37 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
}
#if 0 // BUFREF-FIXME
- memset(s->last_picture.f.data, 0, sizeof(s->last_picture.f.data));
- memset(s->next_picture.f.data, 0, sizeof(s->next_picture.f.data));
+ memset(s->last_picture.f->data, 0, sizeof(s->last_picture.f->data));
+ memset(s->next_picture.f->data, 0, sizeof(s->next_picture.f->data));
#endif
if (s->last_picture_ptr) {
ff_mpeg_unref_picture(s, &s->last_picture);
- if (s->last_picture_ptr->f.buf[0] &&
+ if (s->last_picture_ptr->f->buf[0] &&
(ret = ff_mpeg_ref_picture(s, &s->last_picture,
s->last_picture_ptr)) < 0)
return ret;
}
if (s->next_picture_ptr) {
ff_mpeg_unref_picture(s, &s->next_picture);
- if (s->next_picture_ptr->f.buf[0] &&
+ if (s->next_picture_ptr->f->buf[0] &&
(ret = ff_mpeg_ref_picture(s, &s->next_picture,
s->next_picture_ptr)) < 0)
return ret;
}
av_assert0(s->pict_type == AV_PICTURE_TYPE_I || (s->last_picture_ptr &&
- s->last_picture_ptr->f.buf[0]));
+ s->last_picture_ptr->f->buf[0]));
if (s->picture_structure!= PICT_FRAME) {
int i;
for (i = 0; i < 4; i++) {
if (s->picture_structure == PICT_BOTTOM_FIELD) {
- s->current_picture.f.data[i] +=
- s->current_picture.f.linesize[i];
+ s->current_picture.f->data[i] +=
+ s->current_picture.f->linesize[i];
}
- s->current_picture.f.linesize[i] *= 2;
- s->last_picture.f.linesize[i] *= 2;
- s->next_picture.f.linesize[i] *= 2;
+ s->current_picture.f->linesize[i] *= 2;
+ s->last_picture.f->linesize[i] *= 2;
+ s->next_picture.f->linesize[i] *= 2;
}
}
@@ -1669,59 +1923,16 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
s->dct_unquantize_inter = s->dct_unquantize_mpeg1_inter;
}
- if (s->dct_error_sum) {
- av_assert2(s->avctx->noise_reduction && s->encoding);
- update_noise_reduction(s);
+ if (s->avctx->debug & FF_DEBUG_NOMC) {
+ gray_frame(s->current_picture_ptr->f);
}
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
- return ff_xvmc_field_start(s, avctx);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
return 0;
}
/* called after a frame has been decoded. */
void ff_MPV_frame_end(MpegEncContext *s)
{
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
- /* redraw edges for the frame if decoding didn't complete */
- // just to make sure that all data is rendered.
- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) {
- ff_xvmc_field_end(s);
- } else
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
- if ((s->er.error_count || !(s->avctx->codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND)) &&
- !s->avctx->hwaccel &&
- !(s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) &&
- s->unrestricted_mv &&
- s->current_picture.reference &&
- !s->intra_only &&
- !(s->flags & CODEC_FLAG_EMU_EDGE) &&
- !s->avctx->lowres
- ) {
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
- int hshift = desc->log2_chroma_w;
- int vshift = desc->log2_chroma_h;
- s->dsp.draw_edges(s->current_picture.f.data[0], s->current_picture.f.linesize[0],
- s->h_edge_pos, s->v_edge_pos,
- EDGE_WIDTH, EDGE_WIDTH,
- EDGE_TOP | EDGE_BOTTOM);
- s->dsp.draw_edges(s->current_picture.f.data[1], s->current_picture.f.linesize[1],
- s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
- EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
- EDGE_TOP | EDGE_BOTTOM);
- s->dsp.draw_edges(s->current_picture.f.data[2], s->current_picture.f.linesize[2],
- s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
- EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
- EDGE_TOP | EDGE_BOTTOM);
- }
-
emms_c();
if (s->current_picture.reference)
@@ -1819,11 +2030,12 @@ static void draw_arrow(uint8_t *buf, int sx, int sy, int ex,
/**
* Print debugging info for the given picture.
*/
-void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint8_t *mbskip_table,
+void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_table,
+ uint32_t *mbtype_table, int8_t *qscale_table, int16_t (*motion_val[2])[2],
int *low_delay,
int mb_width, int mb_height, int mb_stride, int quarter_sample)
{
- if (avctx->hwaccel || !p || !p->mb_type
+ if (avctx->hwaccel || !mbtype_table
|| (avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU))
return;
@@ -1843,10 +2055,10 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
}
if (avctx->debug & FF_DEBUG_QP) {
av_log(avctx, AV_LOG_DEBUG, "%2d",
- p->qscale_table[x + y * mb_stride]);
+ qscale_table[x + y * mb_stride]);
}
if (avctx->debug & FF_DEBUG_MB_TYPE) {
- int mb_type = p->mb_type[x + y * mb_stride];
+ int mb_type = mbtype_table[x + y * mb_stride];
// Type & MV direction
if (IS_PCM(mb_type))
av_log(avctx, AV_LOG_DEBUG, "P");
@@ -1925,7 +2137,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
int mb_x;
for (mb_x = 0; mb_x < mb_width; mb_x++) {
const int mb_index = mb_x + mb_y * mb_stride;
- if ((avctx->debug_mv) && p->motion_val[0]) {
+ if ((avctx->debug_mv) && motion_val[0]) {
int type;
for (type = 0; type < 3; type++) {
int direction = 0;
@@ -1949,46 +2161,46 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
direction = 1;
break;
}
- if (!USES_LIST(p->mb_type[mb_index], direction))
+ if (!USES_LIST(mbtype_table[mb_index], direction))
continue;
- if (IS_8X8(p->mb_type[mb_index])) {
+ if (IS_8X8(mbtype_table[mb_index])) {
int i;
for (i = 0; i < 4; i++) {
int sx = mb_x * 16 + 4 + 8 * (i & 1);
int sy = mb_y * 16 + 4 + 8 * (i >> 1);
int xy = (mb_x * 2 + (i & 1) +
(mb_y * 2 + (i >> 1)) * mv_stride) << (mv_sample_log2 - 1);
- int mx = (p->motion_val[direction][xy][0] >> shift) + sx;
- int my = (p->motion_val[direction][xy][1] >> shift) + sy;
+ int mx = (motion_val[direction][xy][0] >> shift) + sx;
+ int my = (motion_val[direction][xy][1] >> shift) + sy;
draw_arrow(ptr, sx, sy, mx, my, width,
height, pict->linesize[0], 100);
}
- } else if (IS_16X8(p->mb_type[mb_index])) {
+ } else if (IS_16X8(mbtype_table[mb_index])) {
int i;
for (i = 0; i < 2; i++) {
int sx = mb_x * 16 + 8;
int sy = mb_y * 16 + 4 + 8 * i;
int xy = (mb_x * 2 + (mb_y * 2 + i) * mv_stride) << (mv_sample_log2 - 1);
- int mx = (p->motion_val[direction][xy][0] >> shift);
- int my = (p->motion_val[direction][xy][1] >> shift);
+ int mx = (motion_val[direction][xy][0] >> shift);
+ int my = (motion_val[direction][xy][1] >> shift);
- if (IS_INTERLACED(p->mb_type[mb_index]))
+ if (IS_INTERLACED(mbtype_table[mb_index]))
my *= 2;
draw_arrow(ptr, sx, sy, mx + sx, my + sy, width,
height, pict->linesize[0], 100);
}
- } else if (IS_8X16(p->mb_type[mb_index])) {
+ } else if (IS_8X16(mbtype_table[mb_index])) {
int i;
for (i = 0; i < 2; i++) {
int sx = mb_x * 16 + 4 + 8 * i;
int sy = mb_y * 16 + 8;
int xy = (mb_x * 2 + i + mb_y * 2 * mv_stride) << (mv_sample_log2 - 1);
- int mx = p->motion_val[direction][xy][0] >> shift;
- int my = p->motion_val[direction][xy][1] >> shift;
+ int mx = motion_val[direction][xy][0] >> shift;
+ int my = motion_val[direction][xy][1] >> shift;
- if (IS_INTERLACED(p->mb_type[mb_index]))
+ if (IS_INTERLACED(mbtype_table[mb_index]))
my *= 2;
draw_arrow(ptr, sx, sy, mx + sx, my + sy, width,
@@ -1998,14 +2210,14 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
int sx= mb_x * 16 + 8;
int sy= mb_y * 16 + 8;
int xy= (mb_x + mb_y * mv_stride) << mv_sample_log2;
- int mx= (p->motion_val[direction][xy][0]>>shift) + sx;
- int my= (p->motion_val[direction][xy][1]>>shift) + sy;
+ int mx= (motion_val[direction][xy][0]>>shift) + sx;
+ int my= (motion_val[direction][xy][1]>>shift) + sy;
draw_arrow(ptr, sx, sy, mx, my, width, height, pict->linesize[0], 100);
}
}
}
if ((avctx->debug & FF_DEBUG_VIS_QP)) {
- uint64_t c = (p->qscale_table[mb_index] * 128 / 31) *
+ uint64_t c = (qscale_table[mb_index] * 128 / 31) *
0x0101010101010101ULL;
int y;
for (y = 0; y < block_height; y++) {
@@ -2018,8 +2230,8 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
}
}
if ((avctx->debug & FF_DEBUG_VIS_MB_TYPE) &&
- p->motion_val[0]) {
- int mb_type = p->mb_type[mb_index];
+ motion_val[0]) {
+ int mb_type = mbtype_table[mb_index];
uint64_t u,v;
int y;
#define COLOR(theta, r) \
@@ -2083,7 +2295,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
int xy = (mb_x * 2 + (i & 1) +
(mb_y * 2 + (i >> 1)) * mv_stride) << (mv_sample_log2 - 1);
// FIXME bidir
- int32_t *mv = (int32_t *) &p->motion_val[0][xy];
+ int32_t *mv = (int32_t *) &motion_val[0][xy];
if (mv[0] != mv[dm] ||
mv[dm * mv_stride] != mv[dm * (mv_stride + 1)])
for (y = 0; y < 8; y++)
@@ -2107,7 +2319,8 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
void ff_print_debug_info(MpegEncContext *s, Picture *p, AVFrame *pict)
{
- ff_print_debug_info2(s->avctx, p, pict, s->mbskip_table, &s->low_delay,
+ ff_print_debug_info2(s->avctx, pict, s->mbskip_table, p->mb_type,
+ p->qscale_table, p->motion_val, &s->low_delay,
s->mb_width, s->mb_height, s->mb_stride, s->quarter_sample);
}
@@ -2191,8 +2404,8 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
const int s_mask = (2 << lowres) - 1;
const int h_edge_pos = s->h_edge_pos >> lowres;
const int v_edge_pos = s->v_edge_pos >> lowres;
- linesize = s->current_picture.f.linesize[0] << field_based;
- uvlinesize = s->current_picture.f.linesize[1] << field_based;
+ linesize = s->current_picture.f->linesize[0] << field_based;
+ uvlinesize = s->current_picture.f->linesize[1] << field_based;
// FIXME obviously not perfect but qpel will not work in lowres anyway
if (s->quarter_sample) {
@@ -2277,7 +2490,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
}
}
- // FIXME use this for field pix too instead of the obnoxious hack which changes picture.f.data
+ // FIXME use this for field pix too instead of the obnoxious hack which changes picture.f->data
if (bottom_field) {
dest_y += s->linesize;
dest_cb += s->uvlinesize;
@@ -2435,7 +2648,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
} else {
if (s->picture_structure != s->field_select[dir][0] + 1 &&
s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) {
- ref_picture = s->current_picture_ptr->f.data;
+ ref_picture = s->current_picture_ptr->f->data;
}
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
@@ -2453,7 +2666,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
s->pict_type == AV_PICTURE_TYPE_B || s->first_field) {
ref2picture = ref_picture;
} else {
- ref2picture = s->current_picture_ptr->f.data;
+ ref2picture = s->current_picture_ptr->f->data;
}
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
@@ -2495,7 +2708,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
// opposite parity is always in the same
// frame if this is second field
if (!s->first_field) {
- ref_picture = s->current_picture_ptr->f.data;
+ ref_picture = s->current_picture_ptr->f->data;
}
}
}
@@ -2619,14 +2832,11 @@ void MPV_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
{
const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
- if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){
- ff_xvmc_decode_mb(s);//xvmc uses pblocks
+ if (CONFIG_XVMC &&
+ s->avctx->hwaccel && s->avctx->hwaccel->decode_mb) {
+ s->avctx->hwaccel->decode_mb(s);//xvmc uses pblocks
return;
}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
if(s->avctx->debug&FF_DEBUG_DCT_COEFF) {
/* print DCT coefficients */
@@ -2656,13 +2866,15 @@ FF_ENABLE_DEPRECATION_WARNINGS
else if (!is_mpeg12 && (s->h263_pred || s->h263_aic))
s->mbintra_table[mb_xy]=1;
- if ((s->flags&CODEC_FLAG_PSNR) || !(s->encoding && (s->intra_only || s->pict_type==AV_PICTURE_TYPE_B) && s->avctx->mb_decision != FF_MB_DECISION_RD)) { //FIXME precalc
+ if ( (s->flags&CODEC_FLAG_PSNR)
+ || s->avctx->frame_skip_threshold || s->avctx->frame_skip_factor
+ || !(s->encoding && (s->intra_only || s->pict_type==AV_PICTURE_TYPE_B) && s->avctx->mb_decision != FF_MB_DECISION_RD)) { //FIXME precalc
uint8_t *dest_y, *dest_cb, *dest_cr;
int dct_linesize, dct_offset;
op_pixels_func (*op_pix)[4];
qpel_mc_func (*op_qpix)[16];
- const int linesize = s->current_picture.f.linesize[0]; //not s->linesize as this would be wrong for field pics
- const int uvlinesize = s->current_picture.f.linesize[1];
+ const int linesize = s->current_picture.f->linesize[0]; //not s->linesize as this would be wrong for field pics
+ const int uvlinesize = s->current_picture.f->linesize[1];
const int readable= s->pict_type != AV_PICTURE_TYPE_B || s->encoding || s->avctx->draw_horiz_band || lowres_flag;
const int block_size= lowres_flag ? 8>>s->avctx->lowres : 8;
@@ -2717,11 +2929,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
h264_chroma_mc_func *op_pix = s->h264chroma.put_h264_chroma_pixels_tab;
if (s->mv_dir & MV_DIR_FORWARD) {
- MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f.data, op_pix);
+ MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix);
op_pix = s->h264chroma.avg_h264_chroma_pixels_tab;
}
if (s->mv_dir & MV_DIR_BACKWARD) {
- MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f.data, op_pix);
+ MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix);
}
}else{
op_qpix = s->me.qpel_put;
@@ -2731,12 +2943,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
op_pix = s->hdsp.put_no_rnd_pixels_tab;
}
if (s->mv_dir & MV_DIR_FORWARD) {
- ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f.data, op_pix, op_qpix);
+ ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix, op_qpix);
op_pix = s->hdsp.avg_pixels_tab;
op_qpix= s->me.qpel_avg;
}
if (s->mv_dir & MV_DIR_BACKWARD) {
- ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f.data, op_pix, op_qpix);
+ ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix, op_qpix);
}
}
}
@@ -2871,96 +3083,16 @@ void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]){
else MPV_decode_mb_internal(s, block, 0, 0);
}
-/**
- * @param h is the normal height, this will be reduced automatically if needed for the last row
- */
-void ff_draw_horiz_band(AVCodecContext *avctx, DSPContext *dsp, Picture *cur,
- Picture *last, int y, int h, int picture_structure,
- int first_field, int draw_edges, int low_delay,
- int v_edge_pos, int h_edge_pos)
-{
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
- int hshift = desc->log2_chroma_w;
- int vshift = desc->log2_chroma_h;
- const int field_pic = picture_structure != PICT_FRAME;
- if(field_pic){
- h <<= 1;
- y <<= 1;
- }
-
- if (!avctx->hwaccel &&
- !(avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) &&
- draw_edges &&
- cur->reference &&
- !(avctx->flags & CODEC_FLAG_EMU_EDGE)) {
- int *linesize = cur->f.linesize;
- int sides = 0, edge_h;
- if (y==0) sides |= EDGE_TOP;
- if (y + h >= v_edge_pos)
- sides |= EDGE_BOTTOM;
-
- edge_h= FFMIN(h, v_edge_pos - y);
-
- dsp->draw_edges(cur->f.data[0] + y * linesize[0],
- linesize[0], h_edge_pos, edge_h,
- EDGE_WIDTH, EDGE_WIDTH, sides);
- dsp->draw_edges(cur->f.data[1] + (y >> vshift) * linesize[1],
- linesize[1], h_edge_pos >> hshift, edge_h >> vshift,
- EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, sides);
- dsp->draw_edges(cur->f.data[2] + (y >> vshift) * linesize[2],
- linesize[2], h_edge_pos >> hshift, edge_h >> vshift,
- EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, sides);
- }
-
- h = FFMIN(h, avctx->height - y);
-
- if(field_pic && first_field && !(avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
-
- if (avctx->draw_horiz_band) {
- AVFrame *src;
- int offset[AV_NUM_DATA_POINTERS];
- int i;
-
- if(cur->f.pict_type == AV_PICTURE_TYPE_B || low_delay ||
- (avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
- src = &cur->f;
- else if (last)
- src = &last->f;
- else
- return;
-
- if (cur->f.pict_type == AV_PICTURE_TYPE_B &&
- picture_structure == PICT_FRAME &&
- avctx->codec_id != AV_CODEC_ID_SVQ3) {
- for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
- offset[i] = 0;
- }else{
- offset[0]= y * src->linesize[0];
- offset[1]=
- offset[2]= (y >> vshift) * src->linesize[1];
- for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
- offset[i] = 0;
- }
-
- emms_c();
-
- avctx->draw_horiz_band(avctx, src, offset,
- y, picture_structure, h);
- }
-}
-
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
{
- int draw_edges = s->unrestricted_mv && !s->intra_only;
- ff_draw_horiz_band(s->avctx, &s->dsp, s->current_picture_ptr,
- s->last_picture_ptr, y, h, s->picture_structure,
- s->first_field, draw_edges, s->low_delay,
- s->v_edge_pos, s->h_edge_pos);
+ ff_draw_horiz_band(s->avctx, s->current_picture_ptr->f,
+ s->last_picture_ptr ? s->last_picture_ptr->f : NULL, y, h, s->picture_structure,
+ s->first_field, s->low_delay);
}
void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
- const int linesize = s->current_picture.f.linesize[0]; //not s->linesize as this would be wrong for field pics
- const int uvlinesize = s->current_picture.f.linesize[1];
+ const int linesize = s->current_picture.f->linesize[0]; //not s->linesize as this would be wrong for field pics
+ const int uvlinesize = s->current_picture.f->linesize[1];
const int mb_size= 4 - s->avctx->lowres;
s->block_index[0]= s->b8_stride*(s->mb_y*2 ) - 2 + s->mb_x*2;
@@ -2971,9 +3103,9 @@ void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
s->block_index[5]= s->mb_stride*(s->mb_y + s->mb_height + 2) + s->b8_stride*s->mb_height*2 + s->mb_x - 1;
//block_index is not used by mpeg2, so it is not affected by chroma_format
- s->dest[0] = s->current_picture.f.data[0] + ((s->mb_x - 1) << mb_size);
- s->dest[1] = s->current_picture.f.data[1] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
- s->dest[2] = s->current_picture.f.data[2] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
+ s->dest[0] = s->current_picture.f->data[0] + ((s->mb_x - 1) << mb_size);
+ s->dest[1] = s->current_picture.f->data[1] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
+ s->dest[2] = s->current_picture.f->data[2] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
if(!(s->pict_type==AV_PICTURE_TYPE_B && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME))
{
@@ -3047,213 +3179,6 @@ void ff_mpeg_flush(AVCodecContext *avctx){
s->pp_time=0;
}
-static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
- int16_t *block, int n, int qscale)
-{
- int i, level, nCoeffs;
- const uint16_t *quant_matrix;
-
- nCoeffs= s->block_last_index[n];
-
- block[0] *= n < 4 ? s->y_dc_scale : s->c_dc_scale;
- /* XXX: only mpeg1 */
- quant_matrix = s->intra_matrix;
- for(i=1;i<=nCoeffs;i++) {
- int j= s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- if (level < 0) {
- level = -level;
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- level = (level - 1) | 1;
- level = -level;
- } else {
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- level = (level - 1) | 1;
- }
- block[j] = level;
- }
- }
-}
-
-static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
- int16_t *block, int n, int qscale)
-{
- int i, level, nCoeffs;
- const uint16_t *quant_matrix;
-
- nCoeffs= s->block_last_index[n];
-
- quant_matrix = s->inter_matrix;
- for(i=0; i<=nCoeffs; i++) {
- int j= s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- if (level < 0) {
- level = -level;
- level = (((level << 1) + 1) * qscale *
- ((int) (quant_matrix[j]))) >> 4;
- level = (level - 1) | 1;
- level = -level;
- } else {
- level = (((level << 1) + 1) * qscale *
- ((int) (quant_matrix[j]))) >> 4;
- level = (level - 1) | 1;
- }
- block[j] = level;
- }
- }
-}
-
-static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
- int16_t *block, int n, int qscale)
-{
- int i, level, nCoeffs;
- const uint16_t *quant_matrix;
-
- if(s->alternate_scan) nCoeffs= 63;
- else nCoeffs= s->block_last_index[n];
-
- block[0] *= n < 4 ? s->y_dc_scale : s->c_dc_scale;
- quant_matrix = s->intra_matrix;
- for(i=1;i<=nCoeffs;i++) {
- int j= s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- if (level < 0) {
- level = -level;
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- level = -level;
- } else {
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- }
- block[j] = level;
- }
- }
-}
-
-static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
- int16_t *block, int n, int qscale)
-{
- int i, level, nCoeffs;
- const uint16_t *quant_matrix;
- int sum=-1;
-
- if(s->alternate_scan) nCoeffs= 63;
- else nCoeffs= s->block_last_index[n];
-
- block[0] *= n < 4 ? s->y_dc_scale : s->c_dc_scale;
- sum += block[0];
- quant_matrix = s->intra_matrix;
- for(i=1;i<=nCoeffs;i++) {
- int j= s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- if (level < 0) {
- level = -level;
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- level = -level;
- } else {
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- }
- block[j] = level;
- sum+=level;
- }
- }
- block[63]^=sum&1;
-}
-
-static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
- int16_t *block, int n, int qscale)
-{
- int i, level, nCoeffs;
- const uint16_t *quant_matrix;
- int sum=-1;
-
- if(s->alternate_scan) nCoeffs= 63;
- else nCoeffs= s->block_last_index[n];
-
- quant_matrix = s->inter_matrix;
- for(i=0; i<=nCoeffs; i++) {
- int j= s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- if (level < 0) {
- level = -level;
- level = (((level << 1) + 1) * qscale *
- ((int) (quant_matrix[j]))) >> 4;
- level = -level;
- } else {
- level = (((level << 1) + 1) * qscale *
- ((int) (quant_matrix[j]))) >> 4;
- }
- block[j] = level;
- sum+=level;
- }
- }
- block[63]^=sum&1;
-}
-
-static void dct_unquantize_h263_intra_c(MpegEncContext *s,
- int16_t *block, int n, int qscale)
-{
- int i, level, qmul, qadd;
- int nCoeffs;
-
- av_assert2(s->block_last_index[n]>=0 || s->h263_aic);
-
- qmul = qscale << 1;
-
- if (!s->h263_aic) {
- block[0] *= n < 4 ? s->y_dc_scale : s->c_dc_scale;
- qadd = (qscale - 1) | 1;
- }else{
- qadd = 0;
- }
- if(s->ac_pred)
- nCoeffs=63;
- else
- nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
- for(i=1; i<=nCoeffs; i++) {
- level = block[i];
- if (level) {
- if (level < 0) {
- level = level * qmul - qadd;
- } else {
- level = level * qmul + qadd;
- }
- block[i] = level;
- }
- }
-}
-
-static void dct_unquantize_h263_inter_c(MpegEncContext *s,
- int16_t *block, int n, int qscale)
-{
- int i, level, qmul, qadd;
- int nCoeffs;
-
- av_assert2(s->block_last_index[n]>=0);
-
- qadd = (qscale - 1) | 1;
- qmul = qscale << 1;
-
- nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
- for(i=0; i<=nCoeffs; i++) {
- level = block[i];
- if (level) {
- if (level < 0) {
- level = level * qmul - qadd;
- } else {
- level = level * qmul + qadd;
- }
- block[i] = level;
- }
- }
-}
-
/**
* set qscale and update qscale dependent variables.
*/
@@ -3278,13 +3203,33 @@ void ff_MPV_report_decode_progress(MpegEncContext *s)
}
#if CONFIG_ERROR_RESILIENCE
+void ff_mpeg_set_erpic(ERPicture *dst, Picture *src)
+{
+ int i;
+
+ memset(dst, 0, sizeof(*dst));
+ if (!src)
+ return;
+
+ dst->f = src->f;
+ dst->tf = &src->tf;
+
+ for (i = 0; i < 2; i++) {
+ dst->motion_val[i] = src->motion_val[i];
+ dst->ref_index[i] = src->ref_index[i];
+ }
+
+ dst->mb_type = src->mb_type;
+ dst->field_picture = src->field_picture;
+}
+
void ff_mpeg_er_frame_start(MpegEncContext *s)
{
ERContext *er = &s->er;
- er->cur_pic = s->current_picture_ptr;
- er->last_pic = s->last_picture_ptr;
- er->next_pic = s->next_picture_ptr;
+ ff_mpeg_set_erpic(&er->cur_pic, s->current_picture_ptr);
+ ff_mpeg_set_erpic(&er->next_pic, s->next_picture_ptr);
+ ff_mpeg_set_erpic(&er->last_pic, s->last_picture_ptr);
er->pp_time = s->pp_time;
er->pb_time = s->pb_time;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo.h b/chromium/third_party/ffmpeg/libavcodec/mpegvideo.h
index 65c4f9e0d5f..7a49d2ea1d0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo.h
@@ -86,19 +86,13 @@ enum OutputFormat {
#define EXT_START_CODE 0x000001b5
#define USER_START_CODE 0x000001b2
-/**
- * Value of Picture.reference when Picture is not a reference picture, but
- * is held for delayed output.
- */
-#define DELAYED_PIC_REF 4
-
struct MpegEncContext;
/**
* Picture.
*/
typedef struct Picture{
- struct AVFrame f;
+ struct AVFrame *f;
ThreadFrame tf;
AVBufferRef *qscale_table_buf;
@@ -108,31 +102,7 @@ typedef struct Picture{
int16_t (*motion_val[2])[2];
AVBufferRef *mb_type_buf;
- uint32_t *mb_type;
-
-#if !FF_API_MB_TYPE
-#define MB_TYPE_INTRA4x4 0x0001
-#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
-#define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
-#define MB_TYPE_16x16 0x0008
-#define MB_TYPE_16x8 0x0010
-#define MB_TYPE_8x16 0x0020
-#define MB_TYPE_8x8 0x0040
-#define MB_TYPE_INTERLACED 0x0080
-#define MB_TYPE_DIRECT2 0x0100 //FIXME
-#define MB_TYPE_ACPRED 0x0200
-#define MB_TYPE_GMC 0x0400
-#define MB_TYPE_SKIP 0x0800
-#define MB_TYPE_P0L0 0x1000
-#define MB_TYPE_P1L0 0x2000
-#define MB_TYPE_P0L1 0x4000
-#define MB_TYPE_P1L1 0x8000
-#define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
-#define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
-#define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
-#define MB_TYPE_QUANT 0x00010000
-#define MB_TYPE_CBP 0x00020000
-#endif
+ uint32_t *mb_type; ///< types and macros are defined in mpegutils.h
AVBufferRef *mbskip_table_buf;
uint8_t *mbskip_table;
@@ -158,56 +128,16 @@ typedef struct Picture{
*/
void *hwaccel_picture_private;
-#define MB_TYPE_INTRA MB_TYPE_INTRA4x4 //default mb_type if there is just one type
-#define IS_INTRA4x4(a) ((a)&MB_TYPE_INTRA4x4)
-#define IS_INTRA16x16(a) ((a)&MB_TYPE_INTRA16x16)
-#define IS_PCM(a) ((a)&MB_TYPE_INTRA_PCM)
-#define IS_INTRA(a) ((a)&7)
-#define IS_INTER(a) ((a)&(MB_TYPE_16x16|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8))
-#define IS_SKIP(a) ((a)&MB_TYPE_SKIP)
-#define IS_INTRA_PCM(a) ((a)&MB_TYPE_INTRA_PCM)
-#define IS_INTERLACED(a) ((a)&MB_TYPE_INTERLACED)
-#define IS_DIRECT(a) ((a)&MB_TYPE_DIRECT2)
-#define IS_GMC(a) ((a)&MB_TYPE_GMC)
-#define IS_16X16(a) ((a)&MB_TYPE_16x16)
-#define IS_16X8(a) ((a)&MB_TYPE_16x8)
-#define IS_8X16(a) ((a)&MB_TYPE_8x16)
-#define IS_8X8(a) ((a)&MB_TYPE_8x8)
-#define IS_SUB_8X8(a) ((a)&MB_TYPE_16x16) //note reused
-#define IS_SUB_8X4(a) ((a)&MB_TYPE_16x8) //note reused
-#define IS_SUB_4X8(a) ((a)&MB_TYPE_8x16) //note reused
-#define IS_SUB_4X4(a) ((a)&MB_TYPE_8x8) //note reused
-#define IS_ACPRED(a) ((a)&MB_TYPE_ACPRED)
-#define IS_QUANT(a) ((a)&MB_TYPE_QUANT)
-#define IS_DIR(a, part, list) ((a) & (MB_TYPE_P0L0<<((part)+2*(list))))
-#define USES_LIST(a, list) ((a) & ((MB_TYPE_P0L0|MB_TYPE_P1L0)<<(2*(list)))) ///< does this mb use listX, note does not work if subMBs
-#define HAS_CBP(a) ((a)&MB_TYPE_CBP)
-
- int field_poc[2]; ///< h264 top/bottom POC
- int poc; ///< h264 frame POC
- int frame_num; ///< h264 frame_num (raw frame_num from slice header)
- int mmco_reset; ///< h264 MMCO_RESET set this 1. Reordering code must not mix pictures before and after MMCO_RESET.
- int pic_id; /**< h264 pic_num (short -> no wrap version of pic_num,
- pic_num & max_pic_num; long -> long_pic_num) */
- int long_ref; ///< 1->long term reference 0->short term reference
- int ref_poc[2][2][32]; ///< h264 POCs of the frames/fields used as reference (FIXME need per slice)
- int ref_count[2][2]; ///< number of entries in ref_poc (FIXME need per slice)
- int mbaff; ///< h264 1 -> MBAFF frame 0-> not MBAFF
int field_picture; ///< whether or not the picture was encoded in separate fields
- int mb_var_sum; ///< sum of MB variance for current frame
- int mc_mb_var_sum; ///< motion compensated MB variance for current frame
+ int64_t mb_var_sum; ///< sum of MB variance for current frame
+ int64_t mc_mb_var_sum; ///< motion compensated MB variance for current frame
int b_frame_score;
int needs_realloc; ///< Picture needs to be reallocated (eg due to a frame size change)
int reference;
int shared;
- int recovered; ///< Picture at IDR or recovery point + recovery count
-
- int crop;
- int crop_left;
- int crop_top;
} Picture;
/**
@@ -250,8 +180,8 @@ typedef struct MotionEstContext{
int stride;
int uvstride;
/* temp variables for picture complexity calculation */
- int mc_mb_var_sum_temp;
- int mb_var_sum_temp;
+ int64_t mc_mb_var_sum_temp;
+ int64_t mb_var_sum_temp;
int scene_change_score;
/* cmp, chroma_cmp;*/
op_pixels_func (*hpel_put)[4];
@@ -271,6 +201,21 @@ typedef struct MotionEstContext{
*/
typedef struct MpegEncContext {
AVClass *class;
+
+ int y_dc_scale, c_dc_scale;
+ int ac_pred;
+ int block_last_index[12]; ///< last non zero coefficient in block
+ int h263_aic; ///< Advanded INTRA Coding (AIC)
+
+ /* scantables */
+ ScanTable inter_scantable; ///< if inter == intra then intra should be used to reduce tha cache usage
+ ScanTable intra_scantable;
+ ScanTable intra_h_scantable;
+ ScanTable intra_v_scantable;
+
+ /* WARNING: changes above this line require updates to hardcoded
+ * offsets used in asm. */
+
struct AVCodecContext *avctx;
/* the following parameters must be initialized before encoding */
int width, height;///< picture size. must be a multiple of 16
@@ -308,7 +253,6 @@ typedef struct MpegEncContext {
int mb_width, mb_height; ///< number of MBs horizontally & vertically
int mb_stride; ///< mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11
int b8_stride; ///< 2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
- int b4_stride; ///< 4*mb_width+1 used for some 4x4 block arrays to allow simple addressing
int h_edge_pos, v_edge_pos;///< horizontal / vertical position of the right/bottom edge (pixel replication)
int mb_num; ///< number of MBs of a picture
ptrdiff_t linesize; ///< line size, in bytes, may be different from width
@@ -317,20 +261,6 @@ typedef struct MpegEncContext {
Picture **input_picture; ///< next pictures on display order for encoding
Picture **reordered_input_picture; ///< pointer to the next pictures in codedorder for encoding
- int y_dc_scale, c_dc_scale;
- int ac_pred;
- int block_last_index[12]; ///< last non zero coefficient in block
- int h263_aic; ///< Advanded INTRA Coding (AIC)
-
- /* scantables */
- ScanTable inter_scantable; ///< if inter == intra then intra should be used to reduce tha cache usage
- ScanTable intra_scantable;
- ScanTable intra_h_scantable;
- ScanTable intra_v_scantable;
-
- /* WARNING: changes above this line require updates to hardcoded
- * offsets used in asm. */
-
int64_t user_specified_pts; ///< last non-zero pts from AVFrame which was passed into avcodec_encode_video2()
/**
* pts difference between the first and second input frame, used for
@@ -475,24 +405,7 @@ typedef struct MpegEncContext {
int mb_x, mb_y;
int mb_skip_run;
int mb_intra;
- uint16_t *mb_type; ///< Table for candidate MB types for encoding
-#define CANDIDATE_MB_TYPE_INTRA 0x01
-#define CANDIDATE_MB_TYPE_INTER 0x02
-#define CANDIDATE_MB_TYPE_INTER4V 0x04
-#define CANDIDATE_MB_TYPE_SKIPPED 0x08
-//#define MB_TYPE_GMC 0x10
-
-#define CANDIDATE_MB_TYPE_DIRECT 0x10
-#define CANDIDATE_MB_TYPE_FORWARD 0x20
-#define CANDIDATE_MB_TYPE_BACKWARD 0x40
-#define CANDIDATE_MB_TYPE_BIDIR 0x80
-
-#define CANDIDATE_MB_TYPE_INTER_I 0x100
-#define CANDIDATE_MB_TYPE_FORWARD_I 0x200
-#define CANDIDATE_MB_TYPE_BACKWARD_I 0x400
-#define CANDIDATE_MB_TYPE_BIDIR_I 0x800
-
-#define CANDIDATE_MB_TYPE_DIRECT0 0x1000
+ uint16_t *mb_type; ///< Table for candidate MB types for encoding (defines in mpegutils.h)
int block_index[6]; ///< index to current MB in block based arrays with edges
int block_wrap[6];
@@ -656,11 +569,9 @@ typedef struct MpegEncContext {
/* MPEG-2-specific - I wished not to have to support this mess. */
int progressive_sequence;
int mpeg_f_code[2][2];
+
+ // picture structure defines are loaded from mpegutils.h
int picture_structure;
-/* picture type */
-#define PICT_TOP_FIELD 1
-#define PICT_BOTTOM_FIELD 2
-#define PICT_FRAME 3
int intra_dc_precision;
int frame_pred_frame_dct;
@@ -693,6 +604,7 @@ typedef struct MpegEncContext {
uint8_t *ptr_lastgob;
int swap_uv; //vcr2 codec is an MPEG-2 variant with U and V swapped
+ int pack_pblocks; //xvmc needs to keep blocks without gaps.
int16_t (*pblocks[12])[64];
int16_t (*block)[64]; ///< points to one of the following blocks
@@ -755,6 +667,8 @@ typedef struct MpegEncContext {
#define FF_MPV_FLAG_STRICT_GOP 0x0002
#define FF_MPV_FLAG_QP_RD 0x0004
#define FF_MPV_FLAG_CBP_RD 0x0008
+#define FF_MPV_FLAG_NAQ 0x0010
+#define FF_MPV_FLAG_MV0 0x0020
#define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x)
#define FF_MPV_OPT_FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
@@ -764,6 +678,8 @@ typedef struct MpegEncContext {
{ "strict_gop", "Strictly enforce gop size", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_STRICT_GOP }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
{ "qp_rd", "Use rate distortion optimization for qp selection", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_QP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
{ "cbp_rd", "use rate distortion optimization for CBP", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_CBP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
+{ "naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_NAQ }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
+{ "mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_MV0 }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
{ "luma_elim_threshold", "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)",\
FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
{ "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\
@@ -799,23 +715,19 @@ void ff_MPV_frame_end(MpegEncContext *s);
int ff_MPV_encode_init(AVCodecContext *avctx);
int ff_MPV_encode_end(AVCodecContext *avctx);
int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
- AVFrame *frame, int *got_packet);
+ const AVFrame *frame, int *got_packet);
void ff_dct_encode_init_x86(MpegEncContext *s);
void ff_MPV_common_init_x86(MpegEncContext *s);
void ff_MPV_common_init_axp(MpegEncContext *s);
void ff_MPV_common_init_arm(MpegEncContext *s);
-void ff_MPV_common_init_bfin(MpegEncContext *s);
void ff_MPV_common_init_ppc(MpegEncContext *s);
void ff_clean_intra_table_entries(MpegEncContext *s);
-void ff_draw_horiz_band(AVCodecContext *avctx, DSPContext *dsp, Picture *cur,
- Picture *last, int y, int h, int picture_structure,
- int first_field, int draw_edges, int low_delay,
- int v_edge_pos, int h_edge_pos);
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h);
void ff_mpeg_flush(AVCodecContext *avctx);
void ff_print_debug_info(MpegEncContext *s, Picture *p, AVFrame *pict);
-void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint8_t *mbskip_table,
+void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_table,
+ uint32_t *mbtype_table, int8_t *qscale_table, int16_t (*motion_val[2])[2],
int *low_delay,
int mb_width, int mb_height, int mb_stride, int quarter_sample);
@@ -830,7 +742,9 @@ void ff_MPV_report_decode_progress(MpegEncContext *s);
int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src);
void ff_set_qscale(MpegEncContext * s, int qscale);
+/* Error resilience */
void ff_mpeg_er_frame_start(MpegEncContext *s);
+void ff_mpeg_set_erpic(ERPicture *dst, Picture *src);
int ff_dct_common_init(MpegEncContext *s);
int ff_dct_encode_init(MpegEncContext *s);
@@ -853,8 +767,6 @@ void ff_MPV_motion(MpegEncContext *s,
*/
int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared);
-extern const enum AVPixelFormat ff_pixfmt_list_420[];
-
/**
* permute block according to permuatation.
* @param last last non zero element in scantable order
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_enc.c b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_enc.c
index fb9f4519d63..99ab8856875 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_enc.c
@@ -34,6 +34,7 @@
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
+#include "libavutil/timer.h"
#include "avcodec.h"
#include "dct.h"
#include "dsputil.h"
@@ -42,6 +43,7 @@
#include "h261.h"
#include "h263.h"
#include "mathops.h"
+#include "mpegutils.h"
#include "mjpegenc.h"
#include "msmpeg4.h"
#include "faandct.h"
@@ -226,7 +228,8 @@ av_cold int ff_dct_encode_init(MpegEncContext *s) {
if (ARCH_X86)
ff_dct_encode_init_x86(s);
- ff_h263dsp_init(&s->h263dsp);
+ if (CONFIG_H263_ENCODER)
+ ff_h263dsp_init(&s->h263dsp);
if (!s->dct_quantize)
s->dct_quantize = ff_dct_quantize_c;
if (!s->denoise_dct)
@@ -406,9 +409,9 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
if (!s->fixed_qscale &&
avctx->bit_rate * av_q2d(avctx->time_base) >
avctx->bit_rate_tolerance) {
- av_log(avctx, AV_LOG_ERROR,
- "bitrate tolerance too small for bitrate\n");
- return -1;
+ av_log(avctx, AV_LOG_WARNING,
+ "bitrate tolerance %d too small for bitrate %d, overriding\n", avctx->bit_rate_tolerance, avctx->bit_rate);
+ avctx->bit_rate_tolerance = 5 * avctx->bit_rate * av_q2d(avctx->time_base);
}
if (s->avctx->rc_max_rate &&
@@ -800,7 +803,7 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
if (ff_MPV_common_init(s) < 0)
return -1;
- s->avctx->coded_frame = &s->current_picture.f;
+ s->avctx->coded_frame = s->current_picture.f;
if (s->msmpeg4_version) {
FF_ALLOCZ_OR_GOTO(s->avctx, s->ac_stats,
@@ -887,6 +890,20 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
FF_ENABLE_DEPRECATION_WARNINGS;
#endif
+#if FF_API_NORMALIZE_AQP
+ FF_DISABLE_DEPRECATION_WARNINGS
+ if (avctx->flags & CODEC_FLAG_NORMALIZE_AQP)
+ s->mpv_flags |= FF_MPV_FLAG_NAQ;
+ FF_ENABLE_DEPRECATION_WARNINGS;
+#endif
+
+#if FF_API_MV0
+ FF_DISABLE_DEPRECATION_WARNINGS
+ if (avctx->flags & CODEC_FLAG_MV0)
+ s->mpv_flags |= FF_MPV_FLAG_MV0;
+ FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
if (avctx->b_frame_strategy == 2) {
for (i = 0; i < s->max_b_frames + 2; i++) {
s->tmp_frames[i] = av_frame_alloc();
@@ -1035,8 +1052,14 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
direct = 0;
if (pic_arg->linesize[2] != s->uvlinesize)
direct = 0;
+ if ((s->width & 15) || (s->height & 15))
+ direct = 0;
+ if (((intptr_t)(pic_arg->data[0])) & (STRIDE_ALIGN-1))
+ direct = 0;
+ if (s->linesize & (STRIDE_ALIGN-1))
+ direct = 0;
- av_dlog(s->avctx, "%d %d %td %td\n", pic_arg->linesize[0],
+ av_dlog(s->avctx, "%d %d %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"\n", pic_arg->linesize[0],
pic_arg->linesize[1], s->linesize, s->uvlinesize);
if (direct) {
@@ -1047,7 +1070,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
pic = &s->picture[i];
pic->reference = 3;
- if ((ret = av_frame_ref(&pic->f, pic_arg)) < 0)
+ if ((ret = av_frame_ref(pic->f, pic_arg)) < 0)
return ret;
if (ff_alloc_picture(s, pic, 1) < 0) {
return -1;
@@ -1064,9 +1087,9 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
return -1;
}
- if (pic->f.data[0] + INPLACE_OFFSET == pic_arg->data[0] &&
- pic->f.data[1] + INPLACE_OFFSET == pic_arg->data[1] &&
- pic->f.data[2] + INPLACE_OFFSET == pic_arg->data[2]) {
+ if (pic->f->data[0] + INPLACE_OFFSET == pic_arg->data[0] &&
+ pic->f->data[1] + INPLACE_OFFSET == pic_arg->data[1] &&
+ pic->f->data[2] + INPLACE_OFFSET == pic_arg->data[2]) {
// empty
} else {
int h_chroma_shift, v_chroma_shift;
@@ -1082,7 +1105,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
int w = s->width >> h_shift;
int h = s->height >> v_shift;
uint8_t *src = pic_arg->data[i];
- uint8_t *dst = pic->f.data[i];
+ uint8_t *dst = pic->f->data[i];
if (s->codec_id == AV_CODEC_ID_AMV && !(s->avctx->flags & CODEC_FLAG_EMU_EDGE)) {
h = ((s->height + 15)/16*16) >> v_shift;
@@ -1112,12 +1135,12 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
}
}
}
- ret = av_frame_copy_props(&pic->f, pic_arg);
+ ret = av_frame_copy_props(pic->f, pic_arg);
if (ret < 0)
return ret;
- pic->f.display_picture_number = display_picture_number;
- pic->f.pts = pts; // we set this here to avoid modifiying pic_arg
+ pic->f->display_picture_number = display_picture_number;
+ pic->f->pts = pts; // we set this here to avoid modifiying pic_arg
}
/* shift buffer entries */
@@ -1136,28 +1159,32 @@ static int skip_check(MpegEncContext *s, Picture *p, Picture *ref)
int64_t score64 = 0;
for (plane = 0; plane < 3; plane++) {
- const int stride = p->f.linesize[plane];
+ const int stride = p->f->linesize[plane];
const int bw = plane ? 1 : 2;
for (y = 0; y < s->mb_height * bw; y++) {
for (x = 0; x < s->mb_width * bw; x++) {
int off = p->shared ? 0 : 16;
- uint8_t *dptr = p->f.data[plane] + 8 * (x + y * stride) + off;
- uint8_t *rptr = ref->f.data[plane] + 8 * (x + y * stride);
+ uint8_t *dptr = p->f->data[plane] + 8 * (x + y * stride) + off;
+ uint8_t *rptr = ref->f->data[plane] + 8 * (x + y * stride);
int v = s->dsp.frame_skip_cmp[1](s, dptr, rptr, stride, 8);
- switch (s->avctx->frame_skip_exp) {
+ switch (FFABS(s->avctx->frame_skip_exp)) {
case 0: score = FFMAX(score, v); break;
case 1: score += FFABS(v); break;
- case 2: score += v * v; break;
- case 3: score64 += FFABS(v * v * (int64_t)v); break;
- case 4: score64 += v * v * (int64_t)(v * v); break;
+ case 2: score64 += v * (int64_t)v; break;
+ case 3: score64 += FFABS(v * (int64_t)v * v); break;
+ case 4: score64 += (v * (int64_t)v) * (v * (int64_t)v); break;
}
}
}
}
+ emms_c();
if (score)
score64 = score;
+ if (s->avctx->frame_skip_exp < 0)
+ score64 = pow(score64 / (double)(s->mb_width * s->mb_height),
+ -1.0/s->avctx->frame_skip_exp);
if (score64 < s->avctx->frame_skip_threshold)
return 1;
@@ -1204,8 +1231,7 @@ static int estimate_best_b_count(MpegEncContext *s)
c->width = s->width >> scale;
c->height = s->height >> scale;
- c->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR |
- CODEC_FLAG_INPUT_PRESERVED /*| CODEC_FLAG_EMU_EDGE*/;
+ c->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR;
c->flags |= s->avctx->flags & CODEC_FLAG_QPEL;
c->mb_decision = s->avctx->mb_decision;
c->me_cmp = s->avctx->me_cmp;
@@ -1226,19 +1252,19 @@ static int estimate_best_b_count(MpegEncContext *s)
pre_input = *pre_input_ptr;
if (!pre_input.shared && i) {
- pre_input.f.data[0] += INPLACE_OFFSET;
- pre_input.f.data[1] += INPLACE_OFFSET;
- pre_input.f.data[2] += INPLACE_OFFSET;
+ pre_input.f->data[0] += INPLACE_OFFSET;
+ pre_input.f->data[1] += INPLACE_OFFSET;
+ pre_input.f->data[2] += INPLACE_OFFSET;
}
s->dsp.shrink[scale](s->tmp_frames[i]->data[0], s->tmp_frames[i]->linesize[0],
- pre_input.f.data[0], pre_input.f.linesize[0],
+ pre_input.f->data[0], pre_input.f->linesize[0],
c->width, c->height);
s->dsp.shrink[scale](s->tmp_frames[i]->data[1], s->tmp_frames[i]->linesize[1],
- pre_input.f.data[1], pre_input.f.linesize[1],
+ pre_input.f->data[1], pre_input.f->linesize[1],
c->width >> 1, c->height >> 1);
s->dsp.shrink[scale](s->tmp_frames[i]->data[2], s->tmp_frames[i]->linesize[2],
- pre_input.f.data[2], pre_input.f.linesize[2],
+ pre_input.f->data[2], pre_input.f->linesize[2],
c->width >> 1, c->height >> 1);
}
}
@@ -1300,31 +1326,31 @@ static int select_input_picture(MpegEncContext *s)
/* set next picture type & ordering */
if (s->reordered_input_picture[0] == NULL && s->input_picture[0]) {
+ if (s->avctx->frame_skip_threshold || s->avctx->frame_skip_factor) {
+ if (s->picture_in_gop_number < s->gop_size &&
+ s->next_picture_ptr &&
+ skip_check(s, s->input_picture[0], s->next_picture_ptr)) {
+ // FIXME check that te gop check above is +-1 correct
+ av_frame_unref(s->input_picture[0]->f);
+
+ ff_vbv_update(s, 0);
+
+ goto no_output_pic;
+ }
+ }
+
if (/*s->picture_in_gop_number >= s->gop_size ||*/
s->next_picture_ptr == NULL || s->intra_only) {
s->reordered_input_picture[0] = s->input_picture[0];
- s->reordered_input_picture[0]->f.pict_type = AV_PICTURE_TYPE_I;
- s->reordered_input_picture[0]->f.coded_picture_number =
+ s->reordered_input_picture[0]->f->pict_type = AV_PICTURE_TYPE_I;
+ s->reordered_input_picture[0]->f->coded_picture_number =
s->coded_picture_number++;
} else {
int b_frames;
- if (s->avctx->frame_skip_threshold || s->avctx->frame_skip_factor) {
- if (s->picture_in_gop_number < s->gop_size &&
- skip_check(s, s->input_picture[0], s->next_picture_ptr)) {
- // FIXME check that te gop check above is +-1 correct
- av_frame_unref(&s->input_picture[0]->f);
-
- emms_c();
- ff_vbv_update(s, 0);
-
- goto no_output_pic;
- }
- }
-
if (s->flags & CODEC_FLAG_PASS2) {
for (i = 0; i < s->max_b_frames + 1; i++) {
- int pict_num = s->input_picture[0]->f.display_picture_number + i;
+ int pict_num = s->input_picture[0]->f->display_picture_number + i;
if (pict_num >= s->rc_context.num_entries)
break;
@@ -1333,7 +1359,7 @@ static int select_input_picture(MpegEncContext *s)
break;
}
- s->input_picture[i]->f.pict_type =
+ s->input_picture[i]->f->pict_type =
s->rc_context.entry[pict_num].new_pict_type;
}
}
@@ -1348,8 +1374,8 @@ static int select_input_picture(MpegEncContext *s)
s->input_picture[i]->b_frame_score == 0) {
s->input_picture[i]->b_frame_score =
get_intra_count(s,
- s->input_picture[i ]->f.data[0],
- s->input_picture[i - 1]->f.data[0],
+ s->input_picture[i ]->f->data[0],
+ s->input_picture[i - 1]->f->data[0],
s->linesize) + 1;
}
}
@@ -1376,11 +1402,11 @@ static int select_input_picture(MpegEncContext *s)
emms_c();
for (i = b_frames - 1; i >= 0; i--) {
- int type = s->input_picture[i]->f.pict_type;
+ int type = s->input_picture[i]->f->pict_type;
if (type && type != AV_PICTURE_TYPE_B)
b_frames = i;
}
- if (s->input_picture[b_frames]->f.pict_type == AV_PICTURE_TYPE_B &&
+ if (s->input_picture[b_frames]->f->pict_type == AV_PICTURE_TYPE_B &&
b_frames == s->max_b_frames) {
av_log(s->avctx, AV_LOG_ERROR,
"warning, too many b frames in a row\n");
@@ -1393,24 +1419,24 @@ static int select_input_picture(MpegEncContext *s)
} else {
if (s->flags & CODEC_FLAG_CLOSED_GOP)
b_frames = 0;
- s->input_picture[b_frames]->f.pict_type = AV_PICTURE_TYPE_I;
+ s->input_picture[b_frames]->f->pict_type = AV_PICTURE_TYPE_I;
}
}
if ((s->flags & CODEC_FLAG_CLOSED_GOP) && b_frames &&
- s->input_picture[b_frames]->f.pict_type == AV_PICTURE_TYPE_I)
+ s->input_picture[b_frames]->f->pict_type == AV_PICTURE_TYPE_I)
b_frames--;
s->reordered_input_picture[0] = s->input_picture[b_frames];
- if (s->reordered_input_picture[0]->f.pict_type != AV_PICTURE_TYPE_I)
- s->reordered_input_picture[0]->f.pict_type = AV_PICTURE_TYPE_P;
- s->reordered_input_picture[0]->f.coded_picture_number =
+ if (s->reordered_input_picture[0]->f->pict_type != AV_PICTURE_TYPE_I)
+ s->reordered_input_picture[0]->f->pict_type = AV_PICTURE_TYPE_P;
+ s->reordered_input_picture[0]->f->coded_picture_number =
s->coded_picture_number++;
for (i = 0; i < b_frames; i++) {
s->reordered_input_picture[i + 1] = s->input_picture[i];
- s->reordered_input_picture[i + 1]->f.pict_type =
+ s->reordered_input_picture[i + 1]->f->pict_type =
AV_PICTURE_TYPE_B;
- s->reordered_input_picture[i + 1]->f.coded_picture_number =
+ s->reordered_input_picture[i + 1]->f->coded_picture_number =
s->coded_picture_number++;
}
}
@@ -1418,7 +1444,7 @@ static int select_input_picture(MpegEncContext *s)
no_output_pic:
if (s->reordered_input_picture[0]) {
s->reordered_input_picture[0]->reference =
- s->reordered_input_picture[0]->f.pict_type !=
+ s->reordered_input_picture[0]->f->pict_type !=
AV_PICTURE_TYPE_B ? 3 : 0;
ff_mpeg_unref_picture(s, &s->new_picture);
@@ -1440,12 +1466,12 @@ no_output_pic:
return -1;
}
- ret = av_frame_copy_props(&pic->f, &s->reordered_input_picture[0]->f);
+ ret = av_frame_copy_props(pic->f, s->reordered_input_picture[0]->f);
if (ret < 0)
return ret;
/* mark us unused / free shared pic */
- av_frame_unref(&s->reordered_input_picture[0]->f);
+ av_frame_unref(s->reordered_input_picture[0]->f);
s->reordered_input_picture[0]->shared = 0;
s->current_picture_ptr = pic;
@@ -1453,7 +1479,7 @@ no_output_pic:
// input is not a shared pix -> reuse buffer for current_pix
s->current_picture_ptr = s->reordered_input_picture[0];
for (i = 0; i < 4; i++) {
- s->new_picture.f.data[i] += INPLACE_OFFSET;
+ s->new_picture.f->data[i] += INPLACE_OFFSET;
}
}
ff_mpeg_unref_picture(s, &s->current_picture);
@@ -1461,7 +1487,7 @@ no_output_pic:
s->current_picture_ptr)) < 0)
return ret;
- s->picture_number = s->new_picture.f.display_picture_number;
+ s->picture_number = s->new_picture.f->display_picture_number;
} else {
ff_mpeg_unref_picture(s, &s->new_picture);
}
@@ -1476,15 +1502,15 @@ static void frame_end(MpegEncContext *s)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
int hshift = desc->log2_chroma_w;
int vshift = desc->log2_chroma_h;
- s->dsp.draw_edges(s->current_picture.f.data[0], s->current_picture.f.linesize[0],
+ s->dsp.draw_edges(s->current_picture.f->data[0], s->current_picture.f->linesize[0],
s->h_edge_pos, s->v_edge_pos,
EDGE_WIDTH, EDGE_WIDTH,
EDGE_TOP | EDGE_BOTTOM);
- s->dsp.draw_edges(s->current_picture.f.data[1], s->current_picture.f.linesize[1],
+ s->dsp.draw_edges(s->current_picture.f->data[1], s->current_picture.f->linesize[1],
s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
EDGE_TOP | EDGE_BOTTOM);
- s->dsp.draw_edges(s->current_picture.f.data[2], s->current_picture.f.linesize[2],
+ s->dsp.draw_edges(s->current_picture.f->data[2], s->current_picture.f->linesize[2],
s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
EDGE_TOP | EDGE_BOTTOM);
@@ -1493,16 +1519,109 @@ static void frame_end(MpegEncContext *s)
emms_c();
s->last_pict_type = s->pict_type;
- s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f.quality;
+ s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f->quality;
if (s->pict_type!= AV_PICTURE_TYPE_B)
s->last_non_b_pict_type = s->pict_type;
- s->avctx->coded_frame = &s->current_picture_ptr->f;
+ s->avctx->coded_frame = s->current_picture_ptr->f;
+
+}
+
+static void update_noise_reduction(MpegEncContext *s)
+{
+ int intra, i;
+
+ for (intra = 0; intra < 2; intra++) {
+ if (s->dct_count[intra] > (1 << 16)) {
+ for (i = 0; i < 64; i++) {
+ s->dct_error_sum[intra][i] >>= 1;
+ }
+ s->dct_count[intra] >>= 1;
+ }
+
+ for (i = 0; i < 64; i++) {
+ s->dct_offset[intra][i] = (s->avctx->noise_reduction *
+ s->dct_count[intra] +
+ s->dct_error_sum[intra][i] / 2) /
+ (s->dct_error_sum[intra][i] + 1);
+ }
+ }
+}
+
+static int frame_start(MpegEncContext *s)
+{
+ int ret;
+
+ /* mark & release old frames */
+ if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr &&
+ s->last_picture_ptr != s->next_picture_ptr &&
+ s->last_picture_ptr->f->buf[0]) {
+ ff_mpeg_unref_picture(s, s->last_picture_ptr);
+ }
+
+ s->current_picture_ptr->f->pict_type = s->pict_type;
+ s->current_picture_ptr->f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+
+ ff_mpeg_unref_picture(s, &s->current_picture);
+ if ((ret = ff_mpeg_ref_picture(s, &s->current_picture,
+ s->current_picture_ptr)) < 0)
+ return ret;
+
+ if (s->pict_type != AV_PICTURE_TYPE_B) {
+ s->last_picture_ptr = s->next_picture_ptr;
+ if (!s->droppable)
+ s->next_picture_ptr = s->current_picture_ptr;
+ }
+
+ if (s->last_picture_ptr) {
+ ff_mpeg_unref_picture(s, &s->last_picture);
+ if (s->last_picture_ptr->f->buf[0] &&
+ (ret = ff_mpeg_ref_picture(s, &s->last_picture,
+ s->last_picture_ptr)) < 0)
+ return ret;
+ }
+ if (s->next_picture_ptr) {
+ ff_mpeg_unref_picture(s, &s->next_picture);
+ if (s->next_picture_ptr->f->buf[0] &&
+ (ret = ff_mpeg_ref_picture(s, &s->next_picture,
+ s->next_picture_ptr)) < 0)
+ return ret;
+ }
+
+ if (s->picture_structure!= PICT_FRAME) {
+ int i;
+ for (i = 0; i < 4; i++) {
+ if (s->picture_structure == PICT_BOTTOM_FIELD) {
+ s->current_picture.f->data[i] +=
+ s->current_picture.f->linesize[i];
+ }
+ s->current_picture.f->linesize[i] *= 2;
+ s->last_picture.f->linesize[i] *= 2;
+ s->next_picture.f->linesize[i] *= 2;
+ }
+ }
+
+ if (s->mpeg_quant || s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
+ s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra;
+ s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter;
+ } else if (s->out_format == FMT_H263 || s->out_format == FMT_H261) {
+ s->dct_unquantize_intra = s->dct_unquantize_h263_intra;
+ s->dct_unquantize_inter = s->dct_unquantize_h263_inter;
+ } else {
+ s->dct_unquantize_intra = s->dct_unquantize_mpeg1_intra;
+ s->dct_unquantize_inter = s->dct_unquantize_mpeg1_inter;
+ }
+
+ if (s->dct_error_sum) {
+ av_assert2(s->avctx->noise_reduction && s->encoding);
+ update_noise_reduction(s);
+ }
+ return 0;
}
int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
- AVFrame *pic_arg, int *got_packet)
+ const AVFrame *pic_arg, int *got_packet)
{
MpegEncContext *s = avctx->priv_data;
int i, stuffing_count, ret;
@@ -1518,7 +1637,7 @@ int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
}
/* output? */
- if (s->new_picture.f.data[0]) {
+ if (s->new_picture.f->data[0]) {
if ((ret = ff_alloc_packet2(avctx, pkt, s->mb_width*s->mb_height*(MAX_MB_BYTES+100)+10000)) < 0)
return ret;
if (s->mb_info) {
@@ -1538,10 +1657,11 @@ int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
init_put_bits(&s->thread_context[i]->pb, start, end - start);
}
- s->pict_type = s->new_picture.f.pict_type;
+ s->pict_type = s->new_picture.f->pict_type;
//emms_c();
- if (ff_MPV_frame_start(s, avctx) < 0)
- return -1;
+ ret = frame_start(s);
+ if (ret < 0)
+ return ret;
vbv_retry:
if (encode_picture(s, s->picture_number) < 0)
return -1;
@@ -1577,7 +1697,7 @@ vbv_retry:
s->lambda_table[i] * (s->qscale + 1) /
s->qscale);
}
- s->mb_skipped = 0; // done in MPV_frame_start()
+ s->mb_skipped = 0; // done in frame_start()
// done in encode_picture() so we must undo it
if (s->pict_type == AV_PICTURE_TYPE_P) {
if (s->flipflop_rounding ||
@@ -1596,15 +1716,15 @@ vbv_retry:
goto vbv_retry;
}
- assert(s->avctx->rc_max_rate);
+ av_assert0(s->avctx->rc_max_rate);
}
if (s->flags & CODEC_FLAG_PASS1)
ff_write_pass1_stats(s);
for (i = 0; i < 4; i++) {
- s->current_picture_ptr->f.error[i] = s->current_picture.f.error[i];
- avctx->error[i] += s->current_picture_ptr->f.error[i];
+ s->current_picture_ptr->f->error[i] = s->current_picture.f->error[i];
+ avctx->error[i] += s->current_picture_ptr->f->error[i];
}
if (s->flags & CODEC_FLAG_PASS1)
@@ -1682,16 +1802,16 @@ vbv_retry:
s->total_bits += s->frame_bits;
avctx->frame_bits = s->frame_bits;
- pkt->pts = s->current_picture.f.pts;
+ pkt->pts = s->current_picture.f->pts;
if (!s->low_delay && s->pict_type != AV_PICTURE_TYPE_B) {
- if (!s->current_picture.f.coded_picture_number)
+ if (!s->current_picture.f->coded_picture_number)
pkt->dts = pkt->pts - s->dts_delta;
else
pkt->dts = s->reordered_pts;
s->reordered_pts = pkt->pts;
} else
pkt->dts = pkt->pts;
- if (s->current_picture.f.key_frame)
+ if (s->current_picture.f->key_frame)
pkt->flags |= AV_PKT_FLAG_KEY;
if (s->mb_info)
av_packet_shrink_side_data(pkt, AV_PKT_DATA_H263_MB_INFO, s->mb_info_size);
@@ -1705,7 +1825,7 @@ vbv_retry:
ff_mpeg_unref_picture(s, &s->picture[i]);
}
- assert((s->frame_bits & 7) == 0);
+ av_assert1((s->frame_bits & 7) == 0);
pkt->size = s->frame_bits / 8;
*got_packet = !!pkt->size;
@@ -1878,11 +1998,11 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
wrap_y = s->linesize;
wrap_c = s->uvlinesize;
- ptr_y = s->new_picture.f.data[0] +
+ ptr_y = s->new_picture.f->data[0] +
(mb_y * 16 * wrap_y) + mb_x * 16;
- ptr_cb = s->new_picture.f.data[1] +
+ ptr_cb = s->new_picture.f->data[1] +
(mb_y * mb_block_height * wrap_c) + mb_x * mb_block_width;
- ptr_cr = s->new_picture.f.data[2] +
+ ptr_cr = s->new_picture.f->data[2] +
(mb_y * mb_block_height * wrap_c) + mb_x * mb_block_width;
if((mb_x * 16 + 16 > s->width || mb_y * 16 + 16 > s->height) && s->codec_id != AV_CODEC_ID_AMV){
@@ -1978,14 +2098,14 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
if (s->mv_dir & MV_DIR_FORWARD) {
ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 0,
- s->last_picture.f.data,
+ s->last_picture.f->data,
op_pix, op_qpix);
op_pix = s->hdsp.avg_pixels_tab;
op_qpix = s->dsp.avg_qpel_pixels_tab;
}
if (s->mv_dir & MV_DIR_BACKWARD) {
ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 1,
- s->next_picture.f.data,
+ s->next_picture.f->data,
op_pix, op_qpix);
}
@@ -2310,7 +2430,7 @@ static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegE
s->dest[0] = s->rd_scratchpad;
s->dest[1] = s->rd_scratchpad + 16*s->linesize;
s->dest[2] = s->rd_scratchpad + 16*s->linesize + 8;
- assert(s->linesize >= 32); //FIXME
+ av_assert0(s->linesize >= 32); //FIXME
}
encode_mb(s, motion_x, motion_y);
@@ -2341,7 +2461,7 @@ static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegE
}
static int sse(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int w, int h, int stride){
- uint32_t *sq = ff_squareTbl + 256;
+ uint32_t *sq = ff_square_tab + 256;
int acc=0;
int x,y;
@@ -2370,18 +2490,18 @@ static int sse_mb(MpegEncContext *s){
if(w==16 && h==16)
if(s->avctx->mb_cmp == FF_CMP_NSSE){
- return s->dsp.nsse[0](s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
- +s->dsp.nsse[1](s, s->new_picture.f.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)
- +s->dsp.nsse[1](s, s->new_picture.f.data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);
+ return s->dsp.nsse[0](s, s->new_picture.f->data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
+ +s->dsp.nsse[1](s, s->new_picture.f->data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)
+ +s->dsp.nsse[1](s, s->new_picture.f->data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);
}else{
- return s->dsp.sse[0](NULL, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
- +s->dsp.sse[1](NULL, s->new_picture.f.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)
- +s->dsp.sse[1](NULL, s->new_picture.f.data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);
+ return s->dsp.sse[0](NULL, s->new_picture.f->data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
+ +s->dsp.sse[1](NULL, s->new_picture.f->data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)
+ +s->dsp.sse[1](NULL, s->new_picture.f->data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);
}
else
- return sse(s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], w, h, s->linesize)
- +sse(s, s->new_picture.f.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[1], w>>1, h>>1, s->uvlinesize)
- +sse(s, s->new_picture.f.data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[2], w>>1, h>>1, s->uvlinesize);
+ return sse(s, s->new_picture.f->data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], w, h, s->linesize)
+ +sse(s, s->new_picture.f->data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[1], w>>1, h>>1, s->uvlinesize)
+ +sse(s, s->new_picture.f->data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[2], w>>1, h>>1, s->uvlinesize);
}
static int pre_estimate_motion_thread(AVCodecContext *c, void *arg){
@@ -2440,7 +2560,7 @@ static int mb_var_thread(AVCodecContext *c, void *arg){
for(mb_x=0; mb_x < s->mb_width; mb_x++) {
int xx = mb_x * 16;
int yy = mb_y * 16;
- uint8_t *pix = s->new_picture.f.data[0] + (yy * s->linesize) + xx;
+ uint8_t *pix = s->new_picture.f->data[0] + (yy * s->linesize) + xx;
int varc;
int sum = s->dsp.pix_sum(pix, s->linesize);
@@ -2549,7 +2669,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
/* note: quant matrix value (8) is implied here */
s->last_dc[i] = 128 << s->intra_dc_precision;
- s->current_picture.f.error[i] = 0;
+ s->current_picture.f->error[i] = 0;
}
if(s->codec_id==AV_CODEC_ID_AMV){
s->last_dc[0] = 128*8/13;
@@ -3116,14 +3236,14 @@ static int encode_thread(AVCodecContext *c, void *arg){
if(s->mb_x*16 + 16 > s->width ) w= s->width - s->mb_x*16;
if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16;
- s->current_picture.f.error[0] += sse(
- s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16,
+ s->current_picture.f->error[0] += sse(
+ s, s->new_picture.f->data[0] + s->mb_x*16 + s->mb_y*s->linesize*16,
s->dest[0], w, h, s->linesize);
- s->current_picture.f.error[1] += sse(
- s, s->new_picture.f.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h,
+ s->current_picture.f->error[1] += sse(
+ s, s->new_picture.f->data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h,
s->dest[1], w>>1, h>>s->chroma_y_shift, s->uvlinesize);
- s->current_picture.f.error[2] += sse(
- s, s->new_picture.f.data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h,
+ s->current_picture.f->error[2] += sse(
+ s, s->new_picture.f->data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h,
s->dest[2], w>>1, h>>s->chroma_y_shift, s->uvlinesize);
}
if(s->loop_filter){
@@ -3175,9 +3295,9 @@ static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src)
MERGE(misc_bits);
MERGE(er.error_count);
MERGE(padding_bug_score);
- MERGE(current_picture.f.error[0]);
- MERGE(current_picture.f.error[1]);
- MERGE(current_picture.f.error[2]);
+ MERGE(current_picture.f->error[0]);
+ MERGE(current_picture.f->error[1]);
+ MERGE(current_picture.f->error[2]);
if(dst->avctx->noise_reduction){
for(i=0; i<64; i++){
@@ -3194,13 +3314,13 @@ static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src)
static int estimate_qp(MpegEncContext *s, int dry_run){
if (s->next_lambda){
- s->current_picture_ptr->f.quality =
- s->current_picture.f.quality = s->next_lambda;
+ s->current_picture_ptr->f->quality =
+ s->current_picture.f->quality = s->next_lambda;
if(!dry_run) s->next_lambda= 0;
} else if (!s->fixed_qscale) {
- s->current_picture_ptr->f.quality =
- s->current_picture.f.quality = ff_rate_estimate_qscale(s, dry_run);
- if (s->current_picture.f.quality < 0)
+ s->current_picture_ptr->f->quality =
+ s->current_picture.f->quality = ff_rate_estimate_qscale(s, dry_run);
+ if (s->current_picture.f->quality < 0)
return -1;
}
@@ -3223,15 +3343,15 @@ static int estimate_qp(MpegEncContext *s, int dry_run){
s->lambda= s->lambda_table[0];
//FIXME broken
}else
- s->lambda = s->current_picture.f.quality;
+ s->lambda = s->current_picture.f->quality;
update_qscale(s);
return 0;
}
/* must be called before writing the header */
static void set_frame_distances(MpegEncContext * s){
- assert(s->current_picture_ptr->f.pts != AV_NOPTS_VALUE);
- s->time = s->current_picture_ptr->f.pts * s->avctx->time_base.num;
+ av_assert1(s->current_picture_ptr->f->pts != AV_NOPTS_VALUE);
+ s->time = s->current_picture_ptr->f->pts * s->avctx->time_base.num;
if(s->pict_type==AV_PICTURE_TYPE_B){
s->pb_time= s->pp_time - (s->last_non_b_time - s->time);
@@ -3286,7 +3406,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
update_qscale(s);
}
- if(s->codec_id != AV_CODEC_ID_AMV){
+ if(s->codec_id != AV_CODEC_ID_AMV && s->codec_id != AV_CODEC_ID_MJPEG){
if(s->q_chroma_intra_matrix != s->q_intra_matrix ) av_freep(&s->q_chroma_intra_matrix);
if(s->q_chroma_intra_matrix16 != s->q_intra_matrix16) av_freep(&s->q_chroma_intra_matrix16);
s->q_chroma_intra_matrix = s->q_intra_matrix;
@@ -3337,7 +3457,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
if(s->msmpeg4_version >= 3)
s->no_rounding=1;
- av_dlog(s, "Scene change detected, encoding as I Frame %d %d\n",
+ av_dlog(s, "Scene change detected, encoding as I Frame %"PRId64" %"PRId64"\n",
s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
}
@@ -3402,17 +3522,31 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s->qscale= 3; //reduce clipping problems
if (s->out_format == FMT_MJPEG) {
+ const uint16_t * luma_matrix = ff_mpeg1_default_intra_matrix;
+ const uint16_t *chroma_matrix = ff_mpeg1_default_intra_matrix;
+
+ if (s->avctx->intra_matrix) {
+ chroma_matrix =
+ luma_matrix = s->avctx->intra_matrix;
+ }
+ if (s->avctx->chroma_intra_matrix)
+ chroma_matrix = s->avctx->chroma_intra_matrix;
+
/* for mjpeg, we do include qscale in the matrix */
for(i=1;i<64;i++){
int j= s->dsp.idct_permutation[i];
- s->intra_matrix[j] = av_clip_uint8((ff_mpeg1_default_intra_matrix[i] * s->qscale) >> 3);
+ s->chroma_intra_matrix[j] = av_clip_uint8((chroma_matrix[i] * s->qscale) >> 3);
+ s-> intra_matrix[j] = av_clip_uint8(( luma_matrix[i] * s->qscale) >> 3);
}
s->y_dc_scale_table=
s->c_dc_scale_table= ff_mpeg2_dc_scale_table[s->intra_dc_precision];
+ s->chroma_intra_matrix[0] =
s->intra_matrix[0] = ff_mpeg2_dc_scale_table[s->intra_dc_precision][8];
ff_convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
s->intra_matrix, s->intra_quant_bias, 8, 8, 1);
+ ff_convert_matrix(&s->dsp, s->q_chroma_intra_matrix, s->q_chroma_intra_matrix16,
+ s->chroma_intra_matrix, s->intra_quant_bias, 8, 8, 1);
s->qscale= 8;
}
if(s->codec_id == AV_CODEC_ID_AMV){
@@ -3436,12 +3570,12 @@ static int encode_picture(MpegEncContext *s, int picture_number)
}
//FIXME var duplication
- s->current_picture_ptr->f.key_frame =
- s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I; //FIXME pic_ptr
- s->current_picture_ptr->f.pict_type =
- s->current_picture.f.pict_type = s->pict_type;
+ s->current_picture_ptr->f->key_frame =
+ s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I; //FIXME pic_ptr
+ s->current_picture_ptr->f->pict_type =
+ s->current_picture.f->pict_type = s->pict_type;
- if (s->current_picture.f.key_frame)
+ if (s->current_picture.f->key_frame)
s->picture_in_gop_number=0;
s->mb_x = s->mb_y = 0;
@@ -3450,7 +3584,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
case FMT_MJPEG:
if (CONFIG_MJPEG_ENCODER)
ff_mjpeg_encode_picture_header(s->avctx, &s->pb, &s->intra_scantable,
- s->intra_matrix);
+ s->intra_matrix, s->chroma_intra_matrix);
break;
case FMT_H261:
if (CONFIG_H261_ENCODER)
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_motion.c b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_motion.c
index 9ec37890584..8a804e216e2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_motion.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_motion.c
@@ -28,6 +28,7 @@
#include "avcodec.h"
#include "dsputil.h"
#include "h261.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "mjpegenc.h"
#include "msmpeg4.h"
@@ -60,15 +61,15 @@ static void gmc1_motion(MpegEncContext *s,
ptr = ref_picture[0] + src_y * linesize + src_x;
- if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) ||
- (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
- linesize, linesize,
- 17, 17,
- src_x, src_y,
- s->h_edge_pos, s->v_edge_pos);
- ptr = s->edge_emu_buffer;
- }
+ if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) ||
+ (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) {
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ linesize, linesize,
+ 17, 17,
+ src_x, src_y,
+ s->h_edge_pos, s->v_edge_pos);
+ ptr = s->edge_emu_buffer;
+ }
if ((motion_x | motion_y) & 7) {
s->dsp.gmc1(dest_y, ptr, linesize, 16,
@@ -104,16 +105,16 @@ static void gmc1_motion(MpegEncContext *s,
offset = (src_y * uvlinesize) + src_x;
ptr = ref_picture[1] + offset;
- if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) ||
- (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
- uvlinesize, uvlinesize,
- 9, 9,
- src_x, src_y,
- s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- ptr = s->edge_emu_buffer;
- emu = 1;
- }
+ if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) ||
+ (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) {
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ uvlinesize, uvlinesize,
+ 9, 9,
+ src_x, src_y,
+ s->h_edge_pos >> 1, s->v_edge_pos >> 1);
+ ptr = s->edge_emu_buffer;
+ emu = 1;
+ }
s->dsp.gmc1(dest_cb, ptr, uvlinesize, 8,
motion_x & 15, motion_y & 15, 128 - s->no_rounding);
@@ -209,7 +210,6 @@ static inline int hpel_motion(MpegEncContext *s,
dxy |= (motion_y & 1) << 1;
src += src_y * s->linesize + src_x;
- if (s->flags & CODEC_FLAG_EMU_EDGE) {
if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 1) - 8, 0) ||
(unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 1) - 8, 0)) {
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src,
@@ -220,7 +220,6 @@ static inline int hpel_motion(MpegEncContext *s,
src = s->edge_emu_buffer;
emu = 1;
}
- }
pix_op[dxy](dest, src, s->linesize, 8);
return emu;
}
@@ -254,8 +253,8 @@ void mpeg_motion_internal(MpegEncContext *s,
#endif
v_edge_pos = s->v_edge_pos >> field_based;
- linesize = s->current_picture.f.linesize[0] << field_based;
- uvlinesize = s->current_picture.f.linesize[1] << field_based;
+ linesize = s->current_picture.f->linesize[0] << field_based;
+ uvlinesize = s->current_picture.f->linesize[1] << field_based;
dxy = ((motion_y & 1) << 1) | (motion_x & 1);
src_x = s->mb_x * 16 + (motion_x >> 1);
@@ -405,7 +404,7 @@ static void mpeg_motion_field(MpegEncContext *s, uint8_t *dest_y,
motion_x, motion_y, h, 0, mb_y);
}
-// FIXME move to dsputil, avg variant, 16x16 version
+// FIXME: SIMDify, avg variant, 16x16 version
static inline void put_obmc(uint8_t *dst, uint8_t *src[5], int stride)
{
int x;
@@ -619,16 +618,14 @@ static void chroma_4mv_motion(MpegEncContext *s,
offset = src_y * s->uvlinesize + src_x;
ptr = ref_picture[1] + offset;
- if (s->flags & CODEC_FLAG_EMU_EDGE) {
- if ((unsigned)src_x > FFMAX((s->h_edge_pos >> 1) - (dxy & 1) - 8, 0) ||
- (unsigned)src_y > FFMAX((s->v_edge_pos >> 1) - (dxy >> 1) - 8, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
- s->uvlinesize, s->uvlinesize,
- 9, 9, src_x, src_y,
- s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- ptr = s->edge_emu_buffer;
- emu = 1;
- }
+ if ((unsigned)src_x > FFMAX((s->h_edge_pos >> 1) - (dxy & 1) - 8, 0) ||
+ (unsigned)src_y > FFMAX((s->v_edge_pos >> 1) - (dxy >> 1) - 8, 0)) {
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ s->uvlinesize, s->uvlinesize,
+ 9, 9, src_x, src_y,
+ s->h_edge_pos >> 1, s->v_edge_pos >> 1);
+ ptr = s->edge_emu_buffer;
+ emu = 1;
}
pix_op[dxy](dest_cb, ptr, s->uvlinesize, 8);
@@ -779,17 +776,15 @@ static inline void apply_8x8(MpegEncContext *s,
dxy &= ~12;
ptr = ref_picture[0] + (src_y * s->linesize) + (src_x);
- if (s->flags & CODEC_FLAG_EMU_EDGE) {
- if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 3) - 8, 0) ||
- (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 3) - 8, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
- s->linesize, s->linesize,
- 9, 9,
- src_x, src_y,
- s->h_edge_pos,
- s->v_edge_pos);
- ptr = s->edge_emu_buffer;
- }
+ if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 3) - 8, 0) ||
+ (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 3) - 8, 0)) {
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ s->linesize, s->linesize,
+ 9, 9,
+ src_x, src_y,
+ s->h_edge_pos,
+ s->v_edge_pos);
+ ptr = s->edge_emu_buffer;
}
dest = dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize;
qpix_op[1][dxy](dest, ptr, s->linesize);
@@ -904,7 +899,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
} else {
if ( s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field
|| !ref_picture[0]) {
- ref_picture = s->current_picture_ptr->f.data;
+ ref_picture = s->current_picture_ptr->f->data;
}
mpeg_motion(s, dest_y, dest_cb, dest_cr,
@@ -921,7 +916,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
|| s->pict_type == AV_PICTURE_TYPE_B || s->first_field) && ref_picture[0]) {
ref2picture = ref_picture;
} else {
- ref2picture = s->current_picture_ptr->f.data;
+ ref2picture = s->current_picture_ptr->f->data;
}
mpeg_motion(s, dest_y, dest_cb, dest_cr,
@@ -948,7 +943,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
}
} else {
if (!ref_picture[0]) {
- ref_picture = s->current_picture_ptr->f.data;
+ ref_picture = s->current_picture_ptr->f->data;
}
for (i = 0; i < 2; i++) {
mpeg_motion(s, dest_y, dest_cb, dest_cr,
@@ -963,7 +958,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
/* opposite parity is always in the same frame if this is
* second field */
if (!s->first_field) {
- ref_picture = s->current_picture_ptr->f.data;
+ ref_picture = s->current_picture_ptr->f->data;
}
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_xvmc.c b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_xvmc.c
index 664c0089a17..6e8d7753075 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_xvmc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_xvmc.c
@@ -23,6 +23,7 @@
#include <X11/extensions/XvMC.h>
#include "avcodec.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#undef NDEBUG
@@ -32,8 +33,6 @@
#include "xvmc_internal.h"
#include "version.h"
-#if FF_API_XVMC
-
/**
* Initialize the block field of the MpegEncContext pointer passed as
* parameter after making sure that the data is not corrupted.
@@ -43,12 +42,21 @@
*/
void ff_xvmc_init_block(MpegEncContext *s)
{
- struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
+ struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f->data[2];
assert(render && render->xvmc_id == AV_XVMC_ID);
s->block = (int16_t (*)[64])(render->data_blocks + render->next_free_data_block_num * 64);
}
+static void exchange_uv(MpegEncContext *s)
+{
+ int16_t (*tmp)[64];
+
+ tmp = s->pblocks[4];
+ s->pblocks[4] = s->pblocks[5];
+ s->pblocks[5] = tmp;
+}
+
/**
* Fill individual block pointers, so there are no gaps in the data_block array
* in case not all blocks in the macroblock are coded.
@@ -66,6 +74,9 @@ void ff_xvmc_pack_pblocks(MpegEncContext *s, int cbp)
s->pblocks[i] = NULL;
cbp += cbp;
}
+ if (s->swap_uv) {
+ exchange_uv(s);
+ }
}
/**
@@ -73,9 +84,10 @@ void ff_xvmc_pack_pblocks(MpegEncContext *s, int cbp)
* 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.
*/
-int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx)
+static int ff_xvmc_field_start(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)
{
- struct xvmc_pix_fmt *last, *next, *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
+ struct MpegEncContext *s = avctx->priv_data;
+ struct xvmc_pix_fmt *last, *next, *render = (struct xvmc_pix_fmt*)s->current_picture.f->data[2];
const int mb_block_count = 4 + (1 << s->chroma_format);
assert(avctx);
@@ -115,7 +127,7 @@ int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx)
case AV_PICTURE_TYPE_I:
return 0; // no prediction from other frames
case AV_PICTURE_TYPE_B:
- next = (struct xvmc_pix_fmt*)s->next_picture.f.data[2];
+ next = (struct xvmc_pix_fmt*)s->next_picture.f->data[2];
if (!next)
return -1;
if (next->xvmc_id != AV_XVMC_ID)
@@ -123,7 +135,7 @@ int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx)
render->p_future_surface = next->p_surface;
// no return here, going to set forward prediction
case AV_PICTURE_TYPE_P:
- last = (struct xvmc_pix_fmt*)s->last_picture.f.data[2];
+ last = (struct xvmc_pix_fmt*)s->last_picture.f->data[2];
if (!last)
last = render; // predict second field from the first
if (last->xvmc_id != AV_XVMC_ID)
@@ -141,20 +153,22 @@ return -1;
* 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.
*/
-void ff_xvmc_field_end(MpegEncContext *s)
+static int ff_xvmc_field_end(AVCodecContext *avctx)
{
- struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
+ struct MpegEncContext *s = avctx->priv_data;
+ struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f->data[2];
assert(render);
if (render->filled_mv_blocks_num > 0)
ff_mpeg_draw_horiz_band(s, 0, 0);
+ return 0;
}
/**
* Synthesize the data needed by XvMC to render one macroblock of data.
* Fill all relevant fields, if necessary do IDCT.
*/
-void ff_xvmc_decode_mb(MpegEncContext *s)
+static void ff_xvmc_decode_mb(struct MpegEncContext *s)
{
XvMCMacroBlock *mv_block;
struct xvmc_pix_fmt *render;
@@ -184,7 +198,7 @@ void ff_xvmc_decode_mb(MpegEncContext *s)
s->current_picture.qscale_table[mb_xy] = s->qscale;
// start of XVMC-specific code
- render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
+ render = (struct xvmc_pix_fmt*)s->current_picture.f->data[2];
assert(render);
assert(render->xvmc_id == AV_XVMC_ID);
assert(render->mv_blocks);
@@ -313,7 +327,7 @@ void ff_xvmc_decode_mb(MpegEncContext *s)
* slowdown. */
}
// copy blocks only if the codec doesn't support pblocks reordering
- if (s->avctx->xvmc_acceleration == 1) {
+ if (!s->pack_pblocks) {
memcpy(&render->data_blocks[render->next_free_data_block_num*64],
s->pblocks[i], sizeof(*s->pblocks[i]));
}
@@ -333,4 +347,30 @@ void ff_xvmc_decode_mb(MpegEncContext *s)
ff_mpeg_draw_horiz_band(s, 0, 0);
}
-#endif /* FF_API_XVMC */
+#if CONFIG_MPEG1_XVMC_HWACCEL
+AVHWAccel ff_mpeg1_xvmc_hwaccel = {
+ .name = "mpeg1_xvmc",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_MPEG1VIDEO,
+ .pix_fmt = AV_PIX_FMT_XVMC,
+ .start_frame = ff_xvmc_field_start,
+ .end_frame = ff_xvmc_field_end,
+ .decode_slice = NULL,
+ .decode_mb = ff_xvmc_decode_mb,
+ .priv_data_size = 0,
+};
+#endif
+
+#if CONFIG_MPEG2_XVMC_HWACCEL
+AVHWAccel ff_mpeg2_xvmc_hwaccel = {
+ .name = "mpeg2_xvmc",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_MPEG2VIDEO,
+ .pix_fmt = AV_PIX_FMT_XVMC,
+ .start_frame = ff_xvmc_field_start,
+ .end_frame = ff_xvmc_field_end,
+ .decode_slice = NULL,
+ .decode_mb = ff_xvmc_decode_mb,
+ .priv_data_size = 0,
+};
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/msmpeg4.c b/chromium/third_party/ffmpeg/libavcodec/msmpeg4.c
index b071d74c920..70410767014 100644
--- a/chromium/third_party/ffmpeg/libavcodec/msmpeg4.c
+++ b/chromium/third_party/ffmpeg/libavcodec/msmpeg4.c
@@ -276,10 +276,10 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n,
int bs = 8 >> s->avctx->lowres;
if(n<4){
wrap= s->linesize;
- dest= s->current_picture.f.data[0] + (((n >> 1) + 2*s->mb_y) * bs* wrap ) + ((n & 1) + 2*s->mb_x) * bs;
+ dest= s->current_picture.f->data[0] + (((n >> 1) + 2*s->mb_y) * bs* wrap ) + ((n & 1) + 2*s->mb_x) * bs;
}else{
wrap= s->uvlinesize;
- dest= s->current_picture.f.data[n - 3] + (s->mb_y * bs * wrap) + s->mb_x * bs;
+ dest= s->current_picture.f->data[n - 3] + (s->mb_y * bs * wrap) + s->mb_x * bs;
}
if(s->mb_x==0) a= (1024 + (scale>>1))/scale;
else a= get_dc(dest-bs, wrap, scale*8>>(2*s->avctx->lowres), bs);
diff --git a/chromium/third_party/ffmpeg/libavcodec/msmpeg4dec.c b/chromium/third_party/ffmpeg/libavcodec/msmpeg4dec.c
index 7c260fe50e1..2f96c34adb7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/msmpeg4dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/msmpeg4dec.c
@@ -23,7 +23,7 @@
*/
#include "avcodec.h"
-#include "dsputil.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "msmpeg4.h"
#include "libavutil/imgutils.h"
@@ -586,8 +586,11 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
} else {
level = get_vlc2(&s->gb, v2_dc_chroma_vlc.table, DC_VLC_BITS, 3);
}
- if (level < 0)
+ if (level < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");
+ *dir_ptr = 0;
return -1;
+ }
level-=256;
}else{ //FIXME optimize use unified tables & index
if (n < 4) {
@@ -597,6 +600,7 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
}
if (level < 0){
av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");
+ *dir_ptr = 0;
return -1;
}
@@ -918,7 +922,10 @@ AVCodec ff_msmpeg4v1_decoder = {
.decode = ff_h263_decode_frame,
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
.max_lowres = 3,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
AVCodec ff_msmpeg4v2_decoder = {
@@ -932,7 +939,10 @@ AVCodec ff_msmpeg4v2_decoder = {
.decode = ff_h263_decode_frame,
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
.max_lowres = 3,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
AVCodec ff_msmpeg4v3_decoder = {
@@ -946,7 +956,10 @@ AVCodec ff_msmpeg4v3_decoder = {
.decode = ff_h263_decode_frame,
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
.max_lowres = 3,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
AVCodec ff_wmv1_decoder = {
@@ -960,5 +973,8 @@ AVCodec ff_wmv1_decoder = {
.decode = ff_h263_decode_frame,
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
.max_lowres = 3,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/msrle.c b/chromium/third_party/ffmpeg/libavcodec/msrle.c
index 2836fec2fd0..9f0cac61e3a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/msrle.c
+++ b/chromium/third_party/ffmpeg/libavcodec/msrle.c
@@ -35,6 +35,7 @@
#include "avcodec.h"
#include "internal.h"
#include "msrledec.h"
+#include "libavutil/imgutils.h"
typedef struct MsrleContext {
AVCodecContext *avctx;
@@ -110,11 +111,14 @@ static int msrle_decode_frame(AVCodecContext *avctx,
/* FIXME how to correctly detect RLE ??? */
if (avctx->height * istride == avpkt->size) { /* assume uncompressed */
- int linesize = (avctx->width * avctx->bits_per_coded_sample + 7) / 8;
+ int linesize = av_image_get_linesize(avctx->pix_fmt, avctx->width, 0);
uint8_t *ptr = s->frame->data[0];
uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
int i, j;
+ if (linesize < 0)
+ return linesize;
+
for (i = 0; i < avctx->height; i++) {
if (avctx->bits_per_coded_sample == 4) {
for (j = 0; j < avctx->width - 1; j += 2) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss1.c b/chromium/third_party/ffmpeg/libavcodec/mss1.c
index fc88eb0fd9c..6bb524bc482 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mss1.c
@@ -60,7 +60,7 @@ static void arith_normalise(ArithCoder *c)
}
}
-ARITH_GET_BIT()
+ARITH_GET_BIT(arith)
static int arith_get_bits(ArithCoder *c, int bits)
{
@@ -105,7 +105,7 @@ static int arith_get_prob(ArithCoder *c, int16_t *probs)
return sym;
}
-ARITH_GET_MODEL_SYM()
+ARITH_GET_MODEL_SYM(arith)
static void arith_init(ArithCoder *c, GetBitContext *gb)
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss12.c b/chromium/third_party/ffmpeg/libavcodec/mss12.c
index b522e4a4080..7d54d2917a8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss12.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mss12.c
@@ -23,6 +23,8 @@
* Common functions for Microsoft Screen 1 and 2
*/
+#include <inttypes.h>
+
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
@@ -573,7 +575,7 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
if (AV_RB32(avctx->extradata) < avctx->extradata_size) {
av_log(avctx, AV_LOG_ERROR,
- "Insufficient extradata size: expected %d got %d\n",
+ "Insufficient extradata size: expected %"PRIu32" got %d\n",
AV_RB32(avctx->extradata),
avctx->extradata_size);
return AVERROR_INVALIDDATA;
@@ -592,7 +594,7 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
return AVERROR_INVALIDDATA;
}
- av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d\n",
+ av_log(avctx, AV_LOG_DEBUG, "Encoder version %"PRIu32".%"PRIu32"\n",
AV_RB32(avctx->extradata + 4), AV_RB32(avctx->extradata + 8));
if (version != AV_RB32(avctx->extradata + 4) > 1) {
av_log(avctx, AV_LOG_ERROR,
@@ -609,13 +611,13 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
}
av_log(avctx, AV_LOG_DEBUG, "%d free colour(s)\n", c->free_colours);
- av_log(avctx, AV_LOG_DEBUG, "Display dimensions %dx%d\n",
+ av_log(avctx, AV_LOG_DEBUG, "Display dimensions %"PRIu32"x%"PRIu32"\n",
AV_RB32(avctx->extradata + 12), AV_RB32(avctx->extradata + 16));
av_log(avctx, AV_LOG_DEBUG, "Coded dimensions %dx%d\n",
avctx->coded_width, avctx->coded_height);
av_log(avctx, AV_LOG_DEBUG, "%g frames per second\n",
av_int2float(AV_RB32(avctx->extradata + 28)));
- av_log(avctx, AV_LOG_DEBUG, "Bitrate %d bps\n",
+ av_log(avctx, AV_LOG_DEBUG, "Bitrate %"PRIu32" bps\n",
AV_RB32(avctx->extradata + 32));
av_log(avctx, AV_LOG_DEBUG, "Max. lead time %g ms\n",
av_int2float(AV_RB32(avctx->extradata + 36)));
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss12.h b/chromium/third_party/ffmpeg/libavcodec/mss12.h
index a3f9a7ca70d..f9531673894 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss12.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mss12.h
@@ -99,8 +99,8 @@ int ff_mss12_decode_init(MSS12Context *c, int version,
SliceContext *sc1, SliceContext *sc2);
int ff_mss12_decode_end(MSS12Context *ctx);
-#define ARITH_GET_BIT(VERSION) \
-static int arith ## VERSION ## _get_bit(ArithCoder *c) \
+#define ARITH_GET_BIT(prefix) \
+static int prefix ## _get_bit(ArithCoder *c) \
{ \
int range = c->high - c->low + 1; \
int bit = 2 * c->value - c->low >= c->high; \
@@ -110,22 +110,22 @@ static int arith ## VERSION ## _get_bit(ArithCoder *c) \
else \
c->high = c->low + (range >> 1) - 1; \
\
- arith ## VERSION ## _normalise(c); \
+ prefix ## _normalise(c); \
\
return bit; \
}
-#define ARITH_GET_MODEL_SYM(VERSION) \
-static int arith ## VERSION ## _get_model_sym(ArithCoder *c, Model *m) \
+#define ARITH_GET_MODEL_SYM(prefix) \
+static int prefix ## _get_model_sym(ArithCoder *c, Model *m) \
{ \
int idx, val; \
\
- idx = arith ## VERSION ## _get_prob(c, m->cum_prob); \
+ idx = prefix ## _get_prob(c, m->cum_prob); \
\
val = m->idx2sym[idx]; \
ff_mss12_model_update(m, idx); \
\
- arith ## VERSION ## _normalise(c); \
+ prefix ## _normalise(c); \
\
return val; \
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss2.c b/chromium/third_party/ffmpeg/libavcodec/mss2.c
index 99db046f033..64d6300aaa1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mss2.c
@@ -54,7 +54,7 @@ static void arith2_normalise(ArithCoder *c)
}
}
-ARITH_GET_BIT(2)
+ARITH_GET_BIT(arith2)
/* L. Stuiver and A. Moffat: "Piecewise Integer Mapping for Arithmetic Coding."
* In Proc. 8th Data Compression Conference (DCC '98), pp. 3-12, Mar. 1998 */
@@ -127,7 +127,7 @@ static int arith2_get_prob(ArithCoder *c, int16_t *probs)
return i;
}
-ARITH_GET_MODEL_SYM(2)
+ARITH_GET_MODEL_SYM(arith2)
static int arith2_get_consumed_bytes(ArithCoder *c)
{
@@ -417,12 +417,12 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size,
ff_MPV_frame_end(s);
- f = &s->current_picture.f;
+ f = s->current_picture.f;
if (v->respic == 3) {
ctx->dsp.upsample_plane(f->data[0], f->linesize[0], w, h);
- ctx->dsp.upsample_plane(f->data[1], f->linesize[1], w >> 1, h >> 1);
- ctx->dsp.upsample_plane(f->data[2], f->linesize[2], w >> 1, h >> 1);
+ ctx->dsp.upsample_plane(f->data[1], f->linesize[1], w+1 >> 1, h+1 >> 1);
+ ctx->dsp.upsample_plane(f->data[2], f->linesize[2], w+1 >> 1, h+1 >> 1);
} else if (v->respic)
avpriv_request_sample(v->s.avctx,
"Asymmetric WMV9 rectangle subsampling");
@@ -739,8 +739,6 @@ static av_cold int wmv9_init(AVCodecContext *avctx)
int ret;
v->s.avctx = avctx;
- avctx->flags |= CODEC_FLAG_EMU_EDGE;
- v->s.flags |= CODEC_FLAG_EMU_EDGE;
if ((ret = ff_vc1_init_common(v)) < 0)
return ret;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss3.c b/chromium/third_party/ffmpeg/libavcodec/mss3.c
index c6bb838045d..075685b902d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mss3.c
@@ -26,8 +26,8 @@
#include "avcodec.h"
#include "bytestream.h"
-#include "dsputil.h"
#include "internal.h"
+#include "mathops.h"
#include "mss34dsp.h"
#define HEADER_SIZE 27
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss4.c b/chromium/third_party/ffmpeg/libavcodec/mss4.c
index 662cf24df50..efa0372e549 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss4.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mss4.c
@@ -27,7 +27,6 @@
#include "avcodec.h"
#include "bytestream.h"
-#include "dsputil.h"
#include "get_bits.h"
#include "internal.h"
#include "mss34dsp.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/msvideo1.c b/chromium/third_party/ffmpeg/libavcodec/msvideo1.c
index 970c67ce122..e60abeee27d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/msvideo1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/msvideo1.c
@@ -67,6 +67,8 @@ static av_cold int msvideo1_decode_init(AVCodecContext *avctx)
if (s->avctx->bits_per_coded_sample == 8) {
s->mode_8bit = 1;
avctx->pix_fmt = AV_PIX_FMT_PAL8;
+ if (avctx->extradata_size >= AVPALETTE_SIZE)
+ memcpy(s->pal, avctx->extradata, AVPALETTE_SIZE);
} else {
s->mode_8bit = 0;
avctx->pix_fmt = AV_PIX_FMT_RGB555;
diff --git a/chromium/third_party/ffmpeg/libavcodec/msvideo1enc.c b/chromium/third_party/ffmpeg/libavcodec/msvideo1enc.c
index 7844d57b70f..b27eadf06b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/msvideo1enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/msvideo1enc.c
@@ -35,7 +35,6 @@
*/
typedef struct Msvideo1EncContext {
AVCodecContext *avctx;
- AVFrame pic;
AVLFG rnd;
uint8_t *prev;
@@ -58,7 +57,7 @@ enum MSV1Mode{
};
#define SKIP_PREFIX 0x8400
-#define SKIPS_MAX 0x0FFF
+#define SKIPS_MAX 0x03FF
#define MKRGB555(in, off) ((in[off] << 10) | (in[off + 1] << 5) | (in[off + 2]))
static const int remap[16] = { 0, 1, 4, 5, 2, 3, 6, 7, 8, 9, 12, 13, 10, 11, 14, 15 };
@@ -67,7 +66,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
Msvideo1EncContext * const c = avctx->priv_data;
- AVFrame * const p = &c->pic;
+ const AVFrame *p = pict;
uint16_t *src;
uint8_t *prevptr;
uint8_t *dst, *buf;
@@ -75,12 +74,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int no_skips = 1;
int i, j, k, x, y, ret;
int skips = 0;
+ int quality = 24;
if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width*avctx->height*9 + FF_MIN_BUFFER_SIZE)) < 0)
return ret;
dst= buf= pkt->data;
- *p = *pict;
if(!c->prev)
c->prev = av_malloc(avctx->width * 3 * (avctx->height + 3));
prevptr = c->prev + avctx->width * 3 * (FFALIGN(avctx->height, 4) - 1);
@@ -88,7 +87,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if(c->keyint >= avctx->keyint_min)
keyframe = 1;
- p->quality = 24;
for(y = 0; y < avctx->height; y += 4){
for(x = 0; x < avctx->width; x += 4){
@@ -114,7 +112,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bestscore += t*t;
}
}
- bestscore /= p->quality;
+ bestscore /= quality;
}
// try to find optimal value to fill whole 4x4 block
score = 0;
@@ -130,7 +128,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
}
}
- score /= p->quality;
+ score /= quality;
score += 2;
if(score < bestscore){
bestscore = score;
@@ -155,7 +153,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
}
}
- score /= p->quality;
+ score /= quality;
score += 6;
if(score < bestscore){
bestscore = score;
@@ -182,7 +180,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
}
}
- score /= p->quality;
+ score /= quality;
score += 18;
if(score < bestscore){
bestscore = score;
@@ -248,8 +246,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
c->keyint = 0;
else
c->keyint++;
- p->pict_type= keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
- p->key_frame= keyframe;
if (keyframe) pkt->flags |= AV_PKT_FLAG_KEY;
pkt->size = dst - buf;
*got_packet = 1;
@@ -274,8 +270,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
return -1;
}
- avcodec_get_frame_defaults(&c->pic);
- avctx->coded_frame = (AVFrame*)&c->pic;
avctx->bits_per_coded_sample = 16;
c->keyint = avctx->keyint_min;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mvcdec.c b/chromium/third_party/ffmpeg/libavcodec/mvcdec.c
index 2cc7735cfbe..69f0ee259cf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mvcdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mvcdec.c
@@ -25,6 +25,7 @@
*/
#include "libavutil/intreadwrite.h"
+
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
@@ -37,8 +38,8 @@ typedef struct MvcContext {
static av_cold int mvc_decode_init(AVCodecContext *avctx)
{
MvcContext *s = avctx->priv_data;
- int width = avctx->width;
- int height = avctx->height;
+ int width = avctx->width;
+ int height = avctx->height;
int ret;
if (avctx->codec_id == AV_CODEC_ID_MVC1) {
@@ -50,62 +51,60 @@ static av_cold int mvc_decode_init(AVCodecContext *avctx)
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
return ret;
- avctx->pix_fmt = (avctx->codec_id == AV_CODEC_ID_MVC1) ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_BGRA;
- s->frame = av_frame_alloc();
+ avctx->pix_fmt = (avctx->codec_id == AV_CODEC_ID_MVC1) ? AV_PIX_FMT_RGB555
+ : AV_PIX_FMT_RGB32;
+ s->frame = av_frame_alloc();
if (!s->frame)
return AVERROR(ENOMEM);
- s->vflip = avctx->extradata_size >= 9 && !memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9);
+ s->vflip = avctx->extradata_size >= 9 &&
+ !memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9);
return 0;
}
-static int decode_mvc1(AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst_start, int width, int height, int linesize)
+static int decode_mvc1(AVCodecContext *avctx, GetByteContext *gb,
+ uint8_t *dst_start, int width, int height, int linesize)
{
uint8_t *dst;
uint16_t v[8];
int mask, x, y, i;
- x = y= 0;
- while (bytestream2_get_bytes_left(gb) >= 6) {
- mask = bytestream2_get_be16u(gb);
- v[0] = bytestream2_get_be16u(gb);
- v[1] = bytestream2_get_be16u(gb);
- if ((v[0] & 0x8000)) {
- if (bytestream2_get_bytes_left(gb) < 12) {
- av_log(avctx, AV_LOG_WARNING, "buffer overflow\n");
- return AVERROR_INVALIDDATA;
+ for (y = 0; y < height; y += 4) {
+ for (x = 0; x < width; x += 4) {
+ if (bytestream2_get_bytes_left(gb) < 6)
+ return 0;
+
+ mask = bytestream2_get_be16u(gb);
+ v[0] = bytestream2_get_be16u(gb);
+ v[1] = bytestream2_get_be16u(gb);
+ if ((v[0] & 0x8000)) {
+ if (bytestream2_get_bytes_left(gb) < 12) {
+ av_log(avctx, AV_LOG_WARNING, "buffer overflow\n");
+ return AVERROR_INVALIDDATA;
+ }
+ for (i = 2; i < 8; i++)
+ v[i] = bytestream2_get_be16u(gb);
+ } else {
+ v[2] = v[4] = v[6] = v[0];
+ v[3] = v[5] = v[7] = v[1];
}
- for (i = 2; i < 8; i++)
- v[i] = bytestream2_get_be16u(gb);
- } else {
- v[2] = v[4] = v[6] = v[0];
- v[3] = v[5] = v[7] = v[1];
- }
-
-#define PIX16(target, true, false) \
- i = (mask & target) ? true : false; \
- AV_WN16A(dst, (v[i] & 0x7C00) | (v[i] & 0x3E0) | (v[i] & 0x1F)); \
- dst += 2;
-#define ROW16(row, a1, a0, b1, b0) \
- dst = dst_start + (y + row) * linesize + x * 2; \
- PIX16(1 << (row * 4), a1, a0) \
- PIX16(1 << (row * 4 + 1), a1, a0) \
- PIX16(1 << (row * 4 + 2), b1, b0) \
- PIX16(1 << (row * 4 + 3), b1, b0)
-
- ROW16(0, 0, 1, 2, 3);
- ROW16(1, 0, 1, 2, 3);
- ROW16(2, 4, 5, 6, 7);
- ROW16(3, 4, 5, 6, 7);
-
- x += 4;
- if (x >= width) {
- y += 4;
- if (y >= height) {
- break;
- }
- x = 0;
+#define PIX16(target, true, false) \
+ i = (mask & target) ? true : false; \
+ AV_WN16A(dst, v[i] & 0x7FFF); \
+ dst += 2;
+
+#define ROW16(row, a1, a0, b1, b0) \
+ dst = dst_start + (y + row) * linesize + x * 2; \
+ PIX16(1 << (row * 4), a1, a0) \
+ PIX16(1 << (row * 4 + 1), a1, a0) \
+ PIX16(1 << (row * 4 + 2), b1, b0) \
+ PIX16(1 << (row * 4 + 3), b1, b0)
+
+ ROW16(0, 0, 1, 2, 3);
+ ROW16(1, 0, 1, 2, 3);
+ ROW16(2, 4, 5, 6, 7);
+ ROW16(3, 4, 5, 6, 7);
}
}
return 0;
@@ -119,24 +118,26 @@ static void set_4x4_block(uint8_t *dst, int linesize, uint32_t pixel)
AV_WN32A(dst + j * linesize + i * 4, pixel);
}
-#define PIX32(target, true, false) \
- AV_WN32A(dst, (mask & target) ? v[true] : v[false]); \
+#define PIX32(target, true, false) \
+ AV_WN32A(dst, (mask & target) ? v[true] : v[false]); \
dst += 4;
-#define ROW32(row, a1, a0, b1, b0) \
- dst = dst_start + (y + row) * linesize + x * 4; \
- PIX32(1 << (row * 4), a1, a0) \
- PIX32(1 << (row * 4 + 1), a1, a0) \
- PIX32(1 << (row * 4 + 2), b1, b0) \
+#define ROW32(row, a1, a0, b1, b0) \
+ dst = dst_start + (y + row) * linesize + x * 4; \
+ PIX32(1 << (row * 4), a1, a0) \
+ PIX32(1 << (row * 4 + 1), a1, a0) \
+ PIX32(1 << (row * 4 + 2), b1, b0) \
PIX32(1 << (row * 4 + 3), b1, b0)
-#define MVC2_BLOCK \
- ROW32(0, 1, 0, 3, 2); \
- ROW32(1, 1, 0, 3, 2); \
- ROW32(2, 5, 4, 7, 6); \
+#define MVC2_BLOCK \
+ ROW32(0, 1, 0, 3, 2); \
+ ROW32(1, 1, 0, 3, 2); \
+ ROW32(2, 5, 4, 7, 6); \
ROW32(3, 5, 4, 7, 6);
-static int decode_mvc2(AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst_start, int width, int height, int linesize, int vflip)
+static int decode_mvc2(AVCodecContext *avctx, GetByteContext *gb,
+ uint8_t *dst_start, int width, int height,
+ int linesize, int vflip)
{
uint8_t *dst;
uint32_t color[128], v[8];
@@ -165,7 +166,7 @@ static int decode_mvc2(AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst_s
if (vflip) {
dst_start += (height - 1) * linesize;
- linesize = -linesize;
+ linesize = -linesize;
}
x = y = 0;
while (bytestream2_get_bytes_left(gb) >= 1) {
@@ -173,17 +174,19 @@ static int decode_mvc2(AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst_s
if ((p0 & 0x80)) {
if ((p0 & 0x40)) {
p0 &= 0x3F;
- p0 = (p0 << 2) | (p0 >> 4);
- set_4x4_block(dst_start + y * linesize + x * 4, linesize, 0xFF000000 | (p0 << 16) | (p0 << 8) | p0);
+ p0 = (p0 << 2) | (p0 >> 4);
+ set_4x4_block(dst_start + y * linesize + x * 4, linesize,
+ 0xFF000000 | (p0 << 16) | (p0 << 8) | p0);
} else {
int g, r;
p0 &= 0x3F;
- p0 = (p0 << 2) | (p0 >> 4);
+ p0 = (p0 << 2) | (p0 >> 4);
if (bytestream2_get_bytes_left(gb) < 2)
return AVERROR_INVALIDDATA;
g = bytestream2_get_byteu(gb);
r = bytestream2_get_byteu(gb);
- set_4x4_block(dst_start + y * linesize + x * 4, linesize, 0xFF000000 | (r << 16) | (g << 8) | p0);
+ set_4x4_block(dst_start + y * linesize + x * 4, linesize,
+ 0xFF000000 | (r << 16) | (g << 8) | p0);
}
} else {
if (bytestream2_get_bytes_left(gb) < 1)
@@ -191,7 +194,8 @@ static int decode_mvc2(AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst_s
p1 = bytestream2_get_byteu(gb);
if ((p1 & 0x80)) {
if ((p0 & 0x7F) == (p1 & 0x7F)) {
- set_4x4_block(dst_start + y * linesize + x * 4, linesize, color[p0 & 0x7F]);
+ set_4x4_block(dst_start + y * linesize + x * 4, linesize,
+ color[p0 & 0x7F]);
} else {
if (bytestream2_get_bytes_left(gb) < 2)
return AVERROR_INVALIDDATA;
@@ -223,8 +227,7 @@ static int decode_mvc2(AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst_s
return 0;
}
-static int mvc_decode_frame(AVCodecContext *avctx,
- void *data, int *got_frame,
+static int mvc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
MvcContext *s = avctx->priv_data;
@@ -236,9 +239,12 @@ static int mvc_decode_frame(AVCodecContext *avctx,
bytestream2_init(&gb, avpkt->data, avpkt->size);
if (avctx->codec_id == AV_CODEC_ID_MVC1)
- ret = decode_mvc1(avctx, &gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]);
+ ret = decode_mvc1(avctx, &gb, s->frame->data[0],
+ avctx->width, avctx->height, s->frame->linesize[0]);
else
- ret = decode_mvc2(avctx, &gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0], s->vflip);
+ ret = decode_mvc2(avctx, &gb, s->frame->data[0],
+ avctx->width, avctx->height, s->frame->linesize[0],
+ s->vflip);
if (ret < 0)
return ret;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mxpegdec.c b/chromium/third_party/ffmpeg/libavcodec/mxpegdec.c
index 8eee3b8e9e1..fbd4767db81 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mxpegdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mxpegdec.c
@@ -54,6 +54,7 @@ static av_cold int mxpeg_decode_end(AVCodecContext *avctx)
for (i = 0; i < 2; ++i)
av_frame_free(&s->picture[i]);
+ s->bitmask_size = 0;
av_freep(&s->mxm_bitmask);
av_freep(&s->completion_bitmask);
@@ -295,11 +296,11 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
- ret = ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, reference_ptr);
+ ret = ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, s->bitmask_size, reference_ptr);
if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return ret;
} else {
- ret = ff_mjpeg_decode_sos(jpg, NULL, NULL);
+ ret = ff_mjpeg_decode_sos(jpg, NULL, 0, NULL);
if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return ret;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/nellymoserenc.c b/chromium/third_party/ffmpeg/libavcodec/nellymoserenc.c
index f9d1389a783..98e33f0e2e7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/nellymoserenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/nellymoserenc.c
@@ -35,13 +35,15 @@
* http://wiki.multimedia.cx/index.php?title=Nellymoser
*/
+#include "libavutil/common.h"
#include "libavutil/float_dsp.h"
#include "libavutil/mathematics.h"
-#include "nellymoser.h"
-#include "avcodec.h"
+
#include "audio_frame_queue.h"
+#include "avcodec.h"
#include "fft.h"
#include "internal.h"
+#include "nellymoser.h"
#include "sinewin.h"
#define BITSTREAM_WRITER_LE
diff --git a/chromium/third_party/ffmpeg/libavcodec/nuv.c b/chromium/third_party/ffmpeg/libavcodec/nuv.c
index d4d9318bf7a..31ab1a95e8f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/nuv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/nuv.c
@@ -25,6 +25,7 @@
#include "libavutil/bswap.h"
#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
#include "libavutil/lzo.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
@@ -40,7 +41,6 @@ typedef struct {
unsigned char *decomp_buf;
uint32_t lq[64], cq[64];
RTJpegContext rtj;
- DSPContext dsp;
} NuvContext;
static const uint8_t fallback_lquant[] = {
@@ -138,13 +138,11 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height,
"Can't allocate decompression buffer.\n");
return AVERROR(ENOMEM);
}
- ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height,
- c->lq, c->cq);
+ ff_rtjpeg_decode_init(&c->rtj, c->width, c->height, c->lq, c->cq);
av_frame_unref(c->pic);
return 1;
} else if (quality != c->quality)
- ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height,
- c->lq, c->cq);
+ ff_rtjpeg_decode_init(&c->rtj, c->width, c->height, c->lq, c->cq);
return 0;
}
@@ -183,8 +181,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
ret = get_quant(avctx, c, buf, buf_size);
if (ret < 0)
return ret;
- ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq,
- c->cq);
+ ff_rtjpeg_decode_init(&c->rtj, c->width, c->height, c->lq, c->cq);
return orig_size;
}
@@ -218,6 +215,7 @@ retry:
}
buf = c->decomp_buf;
buf_size = c->decomp_size - FFMAX(FF_INPUT_BUFFER_PADDING_SIZE, AV_LZO_OUTPUT_PADDING) - outlen;
+ memset(c->decomp_buf + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
}
if (c->codec_frameheader) {
int w, h, q;
@@ -321,7 +319,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
if (avctx->extradata_size)
get_quant(avctx, c, avctx->extradata, avctx->extradata_size);
- ff_dsputil_init(&c->dsp, avctx);
+ ff_rtjpeg_init(&c->rtj, avctx);
if ((ret = codec_reinit(avctx, avctx->width, avctx->height, -1)) < 0)
return ret;
diff --git a/chromium/third_party/ffmpeg/libavcodec/on2avc.c b/chromium/third_party/ffmpeg/libavcodec/on2avc.c
new file mode 100644
index 00000000000..ed212f118a8
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/on2avc.c
@@ -0,0 +1,1015 @@
+/*
+ * On2 Audio for Video Codec decoder
+ *
+ * Copyright (c) 2013 Konstantin Shishkov
+ *
+ * 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 "libavutil/channel_layout.h"
+#include "libavutil/float_dsp.h"
+#include "avcodec.h"
+#include "bytestream.h"
+#include "dsputil.h"
+#include "fft.h"
+#include "get_bits.h"
+#include "golomb.h"
+#include "internal.h"
+#include "unary.h"
+
+#include "on2avcdata.h"
+
+#define ON2AVC_SUBFRAME_SIZE 1024
+
+enum WindowTypes {
+ WINDOW_TYPE_LONG = 0,
+ WINDOW_TYPE_LONG_STOP,
+ WINDOW_TYPE_LONG_START,
+ WINDOW_TYPE_8SHORT = 3,
+ WINDOW_TYPE_EXT4,
+ WINDOW_TYPE_EXT5,
+ WINDOW_TYPE_EXT6,
+ WINDOW_TYPE_EXT7,
+};
+
+typedef struct On2AVCContext {
+ AVCodecContext *avctx;
+ AVFloatDSPContext fdsp;
+ FFTContext mdct, mdct_half, mdct_small;
+ FFTContext fft128, fft256, fft512, fft1024;
+ void (*wtf)(struct On2AVCContext *ctx, float *out, float *in, int size);
+
+ int is_av500;
+
+ const On2AVCMode *modes;
+ int window_type, prev_window_type;
+ int num_windows, num_bands;
+ int bits_per_section;
+ const int *band_start;
+
+ int grouping[8];
+ int ms_present;
+ int ms_info[ON2AVC_MAX_BANDS];
+
+ int is_long;
+
+ uint8_t band_type[ON2AVC_MAX_BANDS];
+ uint8_t band_run_end[ON2AVC_MAX_BANDS];
+ int num_sections;
+
+ float band_scales[ON2AVC_MAX_BANDS];
+
+ VLC scale_diff;
+ VLC cb_vlc[16];
+
+ float scale_tab[128];
+
+ DECLARE_ALIGNED(32, float, coeffs)[2][ON2AVC_SUBFRAME_SIZE];
+ DECLARE_ALIGNED(32, float, delay) [2][ON2AVC_SUBFRAME_SIZE];
+
+ DECLARE_ALIGNED(32, float, temp) [ON2AVC_SUBFRAME_SIZE * 2];
+ DECLARE_ALIGNED(32, float, mdct_buf) [ON2AVC_SUBFRAME_SIZE];
+ DECLARE_ALIGNED(32, float, long_win) [ON2AVC_SUBFRAME_SIZE];
+ DECLARE_ALIGNED(32, float, short_win)[ON2AVC_SUBFRAME_SIZE / 8];
+} On2AVCContext;
+
+static void on2avc_read_ms_info(On2AVCContext *c, GetBitContext *gb)
+{
+ int w, b, band_off = 0;
+
+ c->ms_present = get_bits1(gb);
+ if (!c->ms_present)
+ return;
+ for (w = 0; w < c->num_windows; w++) {
+ if (!c->grouping[w]) {
+ memcpy(c->ms_info + band_off,
+ c->ms_info + band_off - c->num_bands,
+ c->num_bands * sizeof(*c->ms_info));
+ band_off += c->num_bands;
+ continue;
+ }
+ for (b = 0; b < c->num_bands; b++)
+ c->ms_info[band_off++] = get_bits1(gb);
+ }
+}
+
+// do not see Table 17 in ISO/IEC 13818-7
+static int on2avc_decode_band_types(On2AVCContext *c, GetBitContext *gb)
+{
+ int bits_per_sect = c->is_long ? 5 : 3;
+ int esc_val = (1 << bits_per_sect) - 1;
+ int num_bands = c->num_bands * c->num_windows;
+ int band = 0, i, band_type, run_len, run;
+
+ while (band < num_bands) {
+ band_type = get_bits(gb, 4);
+ run_len = 1;
+ do {
+ run = get_bits(gb, bits_per_sect);
+ run_len += run;
+ } while (run == esc_val);
+ if (band + run_len > num_bands) {
+ av_log(c->avctx, AV_LOG_ERROR, "Invalid band type run\n");
+ return AVERROR_INVALIDDATA;
+ }
+ for (i = band; i < band + run_len; i++) {
+ c->band_type[i] = band_type;
+ c->band_run_end[i] = band + run_len;
+ }
+ band += run_len;
+ }
+
+ return 0;
+}
+
+// completely not like Table 18 in ISO/IEC 13818-7
+// (no intensity stereo, different coding for the first coefficient)
+static int on2avc_decode_band_scales(On2AVCContext *c, GetBitContext *gb)
+{
+ int w, w2, b, scale, first = 1;
+ int band_off = 0;
+
+ for (w = 0; w < c->num_windows; w++) {
+ if (!c->grouping[w]) {
+ memcpy(c->band_scales + band_off,
+ c->band_scales + band_off - c->num_bands,
+ c->num_bands * sizeof(*c->band_scales));
+ band_off += c->num_bands;
+ continue;
+ }
+ for (b = 0; b < c->num_bands; b++) {
+ if (!c->band_type[band_off]) {
+ int all_zero = 1;
+ for (w2 = w + 1; w2 < c->num_windows; w2++) {
+ if (c->grouping[w2])
+ break;
+ if (c->band_type[w2 * c->num_bands + b]) {
+ all_zero = 0;
+ break;
+ }
+ }
+ if (all_zero) {
+ c->band_scales[band_off++] = 0;
+ continue;
+ }
+ }
+ if (first) {
+ scale = get_bits(gb, 7);
+ first = 0;
+ } else {
+ scale += get_vlc2(gb, c->scale_diff.table, 9, 3) - 60;
+ }
+ if (scale < 0 || scale > 128) {
+ av_log(c->avctx, AV_LOG_ERROR, "Invalid scale value %d\n",
+ scale);
+ return AVERROR_INVALIDDATA;
+ }
+ c->band_scales[band_off++] = c->scale_tab[scale];
+ }
+ }
+
+ return 0;
+}
+
+static inline float on2avc_scale(int v, float scale)
+{
+ return v * sqrtf(fabsf(v)) * scale;
+}
+
+// spectral data is coded completely differently - there are no unsigned codebooks
+static int on2avc_decode_quads(On2AVCContext *c, GetBitContext *gb, float *dst,
+ int dst_size, int type, float band_scale)
+{
+ int i, j, val, val1;
+
+ for (i = 0; i < dst_size; i += 4) {
+ val = get_vlc2(gb, c->cb_vlc[type].table, 9, 3);
+
+ for (j = 0; j < 4; j++) {
+ val1 = sign_extend((val >> (12 - j * 4)) & 0xF, 4);
+ *dst++ = on2avc_scale(val1, band_scale);
+ }
+ }
+
+ return 0;
+}
+
+static inline int get_egolomb(GetBitContext *gb)
+{
+ int v = 4;
+
+ while (get_bits1(gb)) v++;
+
+ return (1 << v) + get_bits(gb, v);
+}
+
+static int on2avc_decode_pairs(On2AVCContext *c, GetBitContext *gb, float *dst,
+ int dst_size, int type, float band_scale)
+{
+ int i, val, val1, val2, sign;
+
+ for (i = 0; i < dst_size; i += 2) {
+ val = get_vlc2(gb, c->cb_vlc[type].table, 9, 3);
+
+ val1 = sign_extend(val >> 8, 8);
+ val2 = sign_extend(val & 0xFF, 8);
+ if (type == ON2AVC_ESC_CB) {
+ if (val1 <= -16 || val1 >= 16) {
+ sign = 1 - (val1 < 0) * 2;
+ val1 = sign * get_egolomb(gb);
+ }
+ if (val2 <= -16 || val2 >= 16) {
+ sign = 1 - (val2 < 0) * 2;
+ val2 = sign * get_egolomb(gb);
+ }
+ }
+
+ *dst++ = on2avc_scale(val1, band_scale);
+ *dst++ = on2avc_scale(val2, band_scale);
+ }
+
+ return 0;
+}
+
+static int on2avc_read_channel_data(On2AVCContext *c, GetBitContext *gb, int ch)
+{
+ int ret;
+ int w, b, band_idx;
+ float *coeff_ptr;
+
+ if ((ret = on2avc_decode_band_types(c, gb)) < 0)
+ return ret;
+ if ((ret = on2avc_decode_band_scales(c, gb)) < 0)
+ return ret;
+
+ coeff_ptr = c->coeffs[ch];
+ band_idx = 0;
+ memset(coeff_ptr, 0, ON2AVC_SUBFRAME_SIZE * sizeof(*coeff_ptr));
+ for (w = 0; w < c->num_windows; w++) {
+ for (b = 0; b < c->num_bands; b++) {
+ int band_size = c->band_start[b + 1] - c->band_start[b];
+ int band_type = c->band_type[band_idx + b];
+
+ if (!band_type) {
+ coeff_ptr += band_size;
+ continue;
+ }
+ if (band_type < 9)
+ on2avc_decode_quads(c, gb, coeff_ptr, band_size, band_type,
+ c->band_scales[band_idx + b]);
+ else
+ on2avc_decode_pairs(c, gb, coeff_ptr, band_size, band_type,
+ c->band_scales[band_idx + b]);
+ coeff_ptr += band_size;
+ }
+ band_idx += c->num_bands;
+ }
+
+ return 0;
+}
+
+static int on2avc_apply_ms(On2AVCContext *c)
+{
+ int w, b, i;
+ int band_off = 0;
+ float *ch0 = c->coeffs[0];
+ float *ch1 = c->coeffs[1];
+
+ for (w = 0; w < c->num_windows; w++) {
+ for (b = 0; b < c->num_bands; b++) {
+ if (c->ms_info[band_off + b]) {
+ for (i = c->band_start[b]; i < c->band_start[b + 1]; i++) {
+ float l = *ch0, r = *ch1;
+ *ch0++ = l + r;
+ *ch1++ = l - r;
+ }
+ } else {
+ ch0 += c->band_start[b + 1] - c->band_start[b];
+ ch1 += c->band_start[b + 1] - c->band_start[b];
+ }
+ }
+ band_off += c->num_bands;
+ }
+ return 0;
+}
+
+static void zero_head_and_tail(float *src, int len, int order0, int order1)
+{
+ memset(src, 0, sizeof(*src) * order0);
+ memset(src + len - order1, 0, sizeof(*src) * order1);
+}
+
+static void pretwiddle(float *src, float *dst, int dst_len, int tab_step,
+ int step, int order0, int order1, const double * const *tabs)
+{
+ float *src2, *out;
+ const double *tab;
+ int i, j;
+
+ out = dst;
+ tab = tabs[0];
+ for (i = 0; i < tab_step; i++) {
+ double sum = 0;
+ for (j = 0; j < order0; j++)
+ sum += src[j] * tab[j * tab_step + i];
+ out[i] += sum;
+ }
+
+ out = dst + dst_len - tab_step;
+ tab = tabs[order0];
+ src2 = src + (dst_len - tab_step) / step + 1 + order0;
+ for (i = 0; i < tab_step; i++) {
+ double sum = 0;
+ for (j = 0; j < order1; j++)
+ sum += src2[j] * tab[j * tab_step + i];
+ out[i] += sum;
+ }
+}
+
+static void twiddle(float *src1, float *src2, int src2_len,
+ const double *tab, int tab_len, int step,
+ int order0, int order1, const double * const *tabs)
+{
+ int steps;
+ int mask;
+ int i, j;
+
+ steps = (src2_len - tab_len) / step + 1;
+ pretwiddle(src1, src2, src2_len, tab_len, step, order0, order1, tabs);
+ mask = tab_len - 1;
+
+ for (i = 0; i < steps; i++) {
+ float in0 = src1[order0 + i];
+ int pos = (src2_len - 1) & mask;
+
+ if (pos < tab_len) {
+ const double *t = tab;
+ for (j = pos; j >= 0; j--)
+ src2[j] += in0 * *t++;
+ for (j = 0; j < tab_len - pos - 1; j++)
+ src2[src2_len - j - 1] += in0 * tab[pos + 1 + j];
+ } else {
+ for (j = 0; j < tab_len; j++)
+ src2[pos - j] += in0 * tab[j];
+ }
+ mask = pos + step;
+ }
+}
+
+#define CMUL1_R(s, t, is, it) \
+ s[is + 0] * t[it + 0] - s[is + 1] * t[it + 1]
+#define CMUL1_I(s, t, is, it) \
+ s[is + 0] * t[it + 1] + s[is + 1] * t[it + 0]
+#define CMUL2_R(s, t, is, it) \
+ s[is + 0] * t[it + 0] + s[is + 1] * t[it + 1]
+#define CMUL2_I(s, t, is, it) \
+ s[is + 0] * t[it + 1] - s[is + 1] * t[it + 0]
+
+#define CMUL0(dst, id, s0, s1, s2, s3, t0, t1, t2, t3, is, it) \
+ dst[id] = s0[is] * t0[it] + s1[is] * t1[it] \
+ + s2[is] * t2[it] + s3[is] * t3[it]; \
+ dst[id + 1] = s0[is] * t0[it + 1] + s1[is] * t1[it + 1] \
+ + s2[is] * t2[it + 1] + s3[is] * t3[it + 1];
+
+#define CMUL1(dst, s0, s1, s2, s3, t0, t1, t2, t3, is, it) \
+ *dst++ = CMUL1_R(s0, t0, is, it) \
+ + CMUL1_R(s1, t1, is, it) \
+ + CMUL1_R(s2, t2, is, it) \
+ + CMUL1_R(s3, t3, is, it); \
+ *dst++ = CMUL1_I(s0, t0, is, it) \
+ + CMUL1_I(s1, t1, is, it) \
+ + CMUL1_I(s2, t2, is, it) \
+ + CMUL1_I(s3, t3, is, it);
+
+#define CMUL2(dst, s0, s1, s2, s3, t0, t1, t2, t3, is, it) \
+ *dst++ = CMUL2_R(s0, t0, is, it) \
+ + CMUL2_R(s1, t1, is, it) \
+ + CMUL2_R(s2, t2, is, it) \
+ + CMUL2_R(s3, t3, is, it); \
+ *dst++ = CMUL2_I(s0, t0, is, it) \
+ + CMUL2_I(s1, t1, is, it) \
+ + CMUL2_I(s2, t2, is, it) \
+ + CMUL2_I(s3, t3, is, it);
+
+static void combine_fft(float *s0, float *s1, float *s2, float *s3, float *dst,
+ const float *t0, const float *t1,
+ const float *t2, const float *t3, int len, int step)
+{
+ const float *h0, *h1, *h2, *h3;
+ float *d1, *d2;
+ int tmp, half;
+ int len2 = len >> 1, len4 = len >> 2;
+ int hoff;
+ int i, j, k;
+
+ tmp = step;
+ for (half = len2; tmp > 1; half <<= 1, tmp >>= 1);
+
+ h0 = t0 + half;
+ h1 = t1 + half;
+ h2 = t2 + half;
+ h3 = t3 + half;
+
+ CMUL0(dst, 0, s0, s1, s2, s3, t0, t1, t2, t3, 0, 0);
+
+ hoff = 2 * step * (len4 >> 1);
+
+ j = 2;
+ k = 2 * step;
+ d1 = dst + 2;
+ d2 = dst + 2 + (len >> 1);
+ for (i = 0; i < (len4 - 1) >> 1; i++) {
+ CMUL1(d1, s0, s1, s2, s3, t0, t1, t2, t3, j, k);
+ CMUL1(d2, s0, s1, s2, s3, h0, h1, h2, h3, j, k);
+ j += 2;
+ k += 2 * step;
+ }
+ CMUL0(dst, len4, s0, s1, s2, s3, t0, t1, t2, t3, 1, hoff);
+ CMUL0(dst, len4 + len2, s0, s1, s2, s3, h0, h1, h2, h3, 1, hoff);
+
+ j = len4;
+ k = hoff + 2 * step * len4;
+ d1 = dst + len4 + 2;
+ d2 = dst + len4 + 2 + len2;
+ for (i = 0; i < (len4 - 2) >> 1; i++) {
+ CMUL2(d1, s0, s1, s2, s3, t0, t1, t2, t3, j, k);
+ CMUL2(d2, s0, s1, s2, s3, h0, h1, h2, h3, j, k);
+ j -= 2;
+ k += 2 * step;
+ }
+ CMUL0(dst, len2 + 4, s0, s1, s2, s3, t0, t1, t2, t3, 0, k);
+}
+
+static void wtf_end_512(On2AVCContext *c, float *out, float *src,
+ float *tmp0, float *tmp1)
+{
+ memcpy(src, tmp0, 384 * sizeof(*tmp0));
+ memcpy(tmp0 + 384, src + 384, 128 * sizeof(*tmp0));
+
+ zero_head_and_tail(src, 128, 16, 4);
+ zero_head_and_tail(src + 128, 128, 16, 4);
+ zero_head_and_tail(src + 256, 128, 13, 7);
+ zero_head_and_tail(src + 384, 128, 15, 5);
+
+ c->fft128.fft_permute(&c->fft128, (FFTComplex*)src);
+ c->fft128.fft_permute(&c->fft128, (FFTComplex*)(src + 128));
+ c->fft128.fft_permute(&c->fft128, (FFTComplex*)(src + 256));
+ c->fft128.fft_permute(&c->fft128, (FFTComplex*)(src + 384));
+ c->fft128.fft_calc(&c->fft128, (FFTComplex*)src);
+ c->fft128.fft_calc(&c->fft128, (FFTComplex*)(src + 128));
+ c->fft128.fft_calc(&c->fft128, (FFTComplex*)(src + 256));
+ c->fft128.fft_calc(&c->fft128, (FFTComplex*)(src + 384));
+ combine_fft(src, src + 128, src + 256, src + 384, tmp1,
+ ff_on2avc_ctab_1, ff_on2avc_ctab_2,
+ ff_on2avc_ctab_3, ff_on2avc_ctab_4, 512, 2);
+ c->fft512.fft_permute(&c->fft512, (FFTComplex*)tmp1);
+ c->fft512.fft_calc(&c->fft512, (FFTComplex*)tmp1);
+
+ pretwiddle(&tmp0[ 0], tmp1, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ pretwiddle(&tmp0[128], tmp1, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ pretwiddle(&tmp0[256], tmp1, 512, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ pretwiddle(&tmp0[384], tmp1, 512, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+
+ memcpy(src, tmp1, 512 * sizeof(float));
+}
+
+static void wtf_end_1024(On2AVCContext *c, float *out, float *src,
+ float *tmp0, float *tmp1)
+{
+ memcpy(src, tmp0, 768 * sizeof(*tmp0));
+ memcpy(tmp0 + 768, src + 768, 256 * sizeof(*tmp0));
+
+ zero_head_and_tail(src, 256, 16, 4);
+ zero_head_and_tail(src + 256, 256, 16, 4);
+ zero_head_and_tail(src + 512, 256, 13, 7);
+ zero_head_and_tail(src + 768, 256, 15, 5);
+
+ c->fft256.fft_permute(&c->fft256, (FFTComplex*)src);
+ c->fft256.fft_permute(&c->fft256, (FFTComplex*)(src + 256));
+ c->fft256.fft_permute(&c->fft256, (FFTComplex*)(src + 512));
+ c->fft256.fft_permute(&c->fft256, (FFTComplex*)(src + 768));
+ c->fft256.fft_calc(&c->fft256, (FFTComplex*)src);
+ c->fft256.fft_calc(&c->fft256, (FFTComplex*)(src + 256));
+ c->fft256.fft_calc(&c->fft256, (FFTComplex*)(src + 512));
+ c->fft256.fft_calc(&c->fft256, (FFTComplex*)(src + 768));
+ combine_fft(src, src + 256, src + 512, src + 768, tmp1,
+ ff_on2avc_ctab_1, ff_on2avc_ctab_2,
+ ff_on2avc_ctab_3, ff_on2avc_ctab_4, 1024, 1);
+ c->fft1024.fft_permute(&c->fft1024, (FFTComplex*)tmp1);
+ c->fft1024.fft_calc(&c->fft1024, (FFTComplex*)tmp1);
+
+ pretwiddle(&tmp0[ 0], tmp1, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ pretwiddle(&tmp0[256], tmp1, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ pretwiddle(&tmp0[512], tmp1, 1024, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ pretwiddle(&tmp0[768], tmp1, 1024, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+
+ memcpy(src, tmp1, 1024 * sizeof(float));
+}
+
+static void wtf_40(On2AVCContext *c, float *out, float *src, int size)
+{
+ float *tmp0 = c->temp, *tmp1 = c->temp + 1024;
+
+ memset(tmp0, 0, sizeof(*tmp0) * 1024);
+ memset(tmp1, 0, sizeof(*tmp1) * 1024);
+
+ if (size == 512) {
+ twiddle(src, &tmp0[ 0], 16, ff_on2avc_tab_10_1, 10, 2, 1, 3, ff_on2avc_tabs_4_10_1);
+ twiddle(src + 8, &tmp0[ 0], 16, ff_on2avc_tab_10_2, 10, 2, 3, 1, ff_on2avc_tabs_4_10_2);
+ twiddle(src + 16, &tmp0[ 16], 16, ff_on2avc_tab_10_2, 10, 2, 3, 1, ff_on2avc_tabs_4_10_2);
+ twiddle(src + 24, &tmp0[ 16], 16, ff_on2avc_tab_10_1, 10, 2, 1, 3, ff_on2avc_tabs_4_10_1);
+ twiddle(src + 32, &tmp0[ 32], 16, ff_on2avc_tab_10_1, 10, 2, 1, 3, ff_on2avc_tabs_4_10_1);
+ twiddle(src + 40, &tmp0[ 32], 16, ff_on2avc_tab_10_2, 10, 2, 3, 1, ff_on2avc_tabs_4_10_2);
+ twiddle(src + 48, &tmp0[ 48], 16, ff_on2avc_tab_10_2, 10, 2, 3, 1, ff_on2avc_tabs_4_10_2);
+ twiddle(src + 56, &tmp0[ 48], 16, ff_on2avc_tab_10_1, 10, 2, 1, 3, ff_on2avc_tabs_4_10_1);
+ twiddle(&tmp0[ 0], &tmp1[ 0], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(&tmp0[16], &tmp1[ 0], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(&tmp0[32], &tmp1[ 32], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(&tmp0[48], &tmp1[ 32], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 64, &tmp1[ 64], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 80, &tmp1[ 64], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 96, &tmp1[ 96], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 112, &tmp1[ 96], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 128, &tmp1[128], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 144, &tmp1[128], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 160, &tmp1[160], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 176, &tmp1[160], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+
+ memset(tmp0, 0, 64 * sizeof(*tmp0));
+
+ twiddle(&tmp1[ 0], &tmp0[ 0], 128, ff_on2avc_tab_84_1, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ twiddle(&tmp1[ 32], &tmp0[ 0], 128, ff_on2avc_tab_84_2, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ twiddle(&tmp1[ 64], &tmp0[ 0], 128, ff_on2avc_tab_84_3, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ twiddle(&tmp1[ 96], &tmp0[ 0], 128, ff_on2avc_tab_84_4, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+ twiddle(&tmp1[128], &tmp0[128], 128, ff_on2avc_tab_84_4, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+ twiddle(&tmp1[160], &tmp0[128], 128, ff_on2avc_tab_84_3, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ twiddle(src + 192, &tmp0[128], 128, ff_on2avc_tab_84_2, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ twiddle(src + 224, &tmp0[128], 128, ff_on2avc_tab_84_1, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ twiddle(src + 256, &tmp0[256], 128, ff_on2avc_tab_84_1, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ twiddle(src + 288, &tmp0[256], 128, ff_on2avc_tab_84_2, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ twiddle(src + 320, &tmp0[256], 128, ff_on2avc_tab_84_3, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ twiddle(src + 352, &tmp0[256], 128, ff_on2avc_tab_84_4, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+
+ wtf_end_512(c, out, src, tmp0, tmp1);
+ } else {
+ twiddle(src, &tmp0[ 0], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 16, &tmp0[ 0], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 32, &tmp0[ 32], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 48, &tmp0[ 32], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 64, &tmp0[ 64], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 80, &tmp0[ 64], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 96, &tmp0[ 96], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 112, &tmp0[ 96], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(&tmp0[ 0], &tmp1[ 0], 64, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+ twiddle(&tmp0[32], &tmp1[ 0], 64, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+ twiddle(&tmp0[64], &tmp1[ 64], 64, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+ twiddle(&tmp0[96], &tmp1[ 64], 64, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+ twiddle(src + 128, &tmp1[128], 64, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+ twiddle(src + 160, &tmp1[128], 64, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+ twiddle(src + 192, &tmp1[192], 64, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+ twiddle(src + 224, &tmp1[192], 64, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+ twiddle(src + 256, &tmp1[256], 64, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+ twiddle(src + 288, &tmp1[256], 64, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+ twiddle(src + 320, &tmp1[320], 64, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+ twiddle(src + 352, &tmp1[320], 64, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+
+ memset(tmp0, 0, 128 * sizeof(*tmp0));
+
+ twiddle(&tmp1[ 0], &tmp0[ 0], 256, ff_on2avc_tab_84_1, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ twiddle(&tmp1[ 64], &tmp0[ 0], 256, ff_on2avc_tab_84_2, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ twiddle(&tmp1[128], &tmp0[ 0], 256, ff_on2avc_tab_84_3, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ twiddle(&tmp1[192], &tmp0[ 0], 256, ff_on2avc_tab_84_4, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+ twiddle(&tmp1[256], &tmp0[256], 256, ff_on2avc_tab_84_4, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+ twiddle(&tmp1[320], &tmp0[256], 256, ff_on2avc_tab_84_3, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ twiddle(src + 384, &tmp0[256], 256, ff_on2avc_tab_84_2, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ twiddle(src + 448, &tmp0[256], 256, ff_on2avc_tab_84_1, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ twiddle(src + 512, &tmp0[512], 256, ff_on2avc_tab_84_1, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ twiddle(src + 576, &tmp0[512], 256, ff_on2avc_tab_84_2, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ twiddle(src + 640, &tmp0[512], 256, ff_on2avc_tab_84_3, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ twiddle(src + 704, &tmp0[512], 256, ff_on2avc_tab_84_4, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+
+ wtf_end_1024(c, out, src, tmp0, tmp1);
+ }
+}
+
+static void wtf_44(On2AVCContext *c, float *out, float *src, int size)
+{
+ float *tmp0 = c->temp, *tmp1 = c->temp + 1024;
+
+ memset(tmp0, 0, sizeof(*tmp0) * 1024);
+ memset(tmp1, 0, sizeof(*tmp1) * 1024);
+
+ if (size == 512) {
+ twiddle(src, &tmp0[ 0], 16, ff_on2avc_tab_10_1, 10, 2, 1, 3, ff_on2avc_tabs_4_10_1);
+ twiddle(src + 8, &tmp0[ 0], 16, ff_on2avc_tab_10_2, 10, 2, 3, 1, ff_on2avc_tabs_4_10_2);
+ twiddle(src + 16, &tmp0[16], 16, ff_on2avc_tab_10_2, 10, 2, 3, 1, ff_on2avc_tabs_4_10_2);
+ twiddle(src + 24, &tmp0[16], 16, ff_on2avc_tab_10_1, 10, 2, 1, 3, ff_on2avc_tabs_4_10_1);
+ twiddle(src + 32, &tmp0[32], 16, ff_on2avc_tab_10_1, 10, 2, 1, 3, ff_on2avc_tabs_4_10_1);
+ twiddle(src + 40, &tmp0[32], 16, ff_on2avc_tab_10_2, 10, 2, 3, 1, ff_on2avc_tabs_4_10_2);
+ twiddle(src + 48, &tmp0[48], 16, ff_on2avc_tab_10_2, 10, 2, 3, 1, ff_on2avc_tabs_4_10_2);
+ twiddle(src + 56, &tmp0[48], 16, ff_on2avc_tab_10_1, 10, 2, 1, 3, ff_on2avc_tabs_4_10_1);
+ twiddle(&tmp0[ 0], &tmp1[ 0], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(&tmp0[16], &tmp1[ 0], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(&tmp0[32], &tmp1[32], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(&tmp0[48], &tmp1[32], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 64, &tmp1[64], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 80, &tmp1[64], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 96, &tmp1[96], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 112, &tmp1[96], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+
+ memset(tmp0, 0, 64 * sizeof(*tmp0));
+
+ twiddle(&tmp1[ 0], &tmp0[ 0], 128, ff_on2avc_tab_84_1, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ twiddle(&tmp1[32], &tmp0[ 0], 128, ff_on2avc_tab_84_2, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ twiddle(&tmp1[64], &tmp0[ 0], 128, ff_on2avc_tab_84_3, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ twiddle(&tmp1[96], &tmp0[ 0], 128, ff_on2avc_tab_84_4, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+ twiddle(src + 128, &tmp0[128], 128, ff_on2avc_tab_84_4, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+ twiddle(src + 160, &tmp0[128], 128, ff_on2avc_tab_84_3, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ twiddle(src + 192, &tmp0[128], 128, ff_on2avc_tab_84_2, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ twiddle(src + 224, &tmp0[128], 128, ff_on2avc_tab_84_1, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ twiddle(src + 256, &tmp0[256], 128, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+ twiddle(src + 320, &tmp0[256], 128, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+
+ wtf_end_512(c, out, src, tmp0, tmp1);
+ } else {
+ twiddle(src, &tmp0[ 0], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 16, &tmp0[ 0], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 32, &tmp0[ 32], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 48, &tmp0[ 32], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 64, &tmp0[ 64], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(src + 80, &tmp0[ 64], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 96, &tmp0[ 96], 32, ff_on2avc_tab_20_2, 20, 2, 4, 5, ff_on2avc_tabs_9_20_2);
+ twiddle(src + 112, &tmp0[ 96], 32, ff_on2avc_tab_20_1, 20, 2, 5, 4, ff_on2avc_tabs_9_20_1);
+ twiddle(&tmp0[ 0], &tmp1[ 0], 64, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+ twiddle(&tmp0[32], &tmp1[ 0], 64, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+ twiddle(&tmp0[64], &tmp1[ 64], 64, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+ twiddle(&tmp0[96], &tmp1[ 64], 64, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+ twiddle(src + 128, &tmp1[128], 64, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+ twiddle(src + 160, &tmp1[128], 64, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+ twiddle(src + 192, &tmp1[192], 64, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+ twiddle(src + 224, &tmp1[192], 64, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+
+ memset(tmp0, 0, 128 * sizeof(*tmp0));
+
+ twiddle(&tmp1[ 0], &tmp0[ 0], 256, ff_on2avc_tab_84_1, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ twiddle(&tmp1[ 64], &tmp0[ 0], 256, ff_on2avc_tab_84_2, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ twiddle(&tmp1[128], &tmp0[ 0], 256, ff_on2avc_tab_84_3, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ twiddle(&tmp1[192], &tmp0[ 0], 256, ff_on2avc_tab_84_4, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+ twiddle(src + 256, &tmp0[256], 256, ff_on2avc_tab_84_4, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4);
+ twiddle(src + 320, &tmp0[256], 256, ff_on2avc_tab_84_3, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3);
+ twiddle(src + 384, &tmp0[256], 256, ff_on2avc_tab_84_2, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2);
+ twiddle(src + 448, &tmp0[256], 256, ff_on2avc_tab_84_1, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1);
+ twiddle(src + 512, &tmp0[512], 256, ff_on2avc_tab_40_1, 40, 2, 11, 8, ff_on2avc_tabs_19_40_1);
+ twiddle(src + 640, &tmp0[512], 256, ff_on2avc_tab_40_2, 40, 2, 8, 11, ff_on2avc_tabs_19_40_2);
+
+ wtf_end_1024(c, out, src, tmp0, tmp1);
+ }
+}
+
+static int on2avc_reconstruct_stereo(On2AVCContext *c, AVFrame *dst, int offset)
+{
+ int ch, i;
+
+ for (ch = 0; ch < 2; ch++) {
+ float *out = (float*)dst->extended_data[ch] + offset;
+ float *in = c->coeffs[ch];
+ float *saved = c->delay[ch];
+ float *buf = c->mdct_buf;
+ float *wout = out + 448;
+
+ switch (c->window_type) {
+ case WINDOW_TYPE_EXT7:
+ c->mdct.imdct_half(&c->mdct, buf, in);
+ break;
+ case WINDOW_TYPE_EXT4:
+ c->wtf(c, buf, in, 1024);
+ break;
+ case WINDOW_TYPE_EXT5:
+ c->wtf(c, buf, in, 512);
+ c->mdct.imdct_half(&c->mdct_half, buf + 512, in + 512);
+ for (i = 0; i < 256; i++) {
+ FFSWAP(float, buf[i + 512], buf[1023 - i]);
+ }
+ break;
+ case WINDOW_TYPE_EXT6:
+ c->mdct.imdct_half(&c->mdct_half, buf, in);
+ for (i = 0; i < 256; i++) {
+ FFSWAP(float, buf[i], buf[511 - i]);
+ }
+ c->wtf(c, buf + 512, in + 512, 512);
+ break;
+ }
+
+ memcpy(out, saved, 448 * sizeof(float));
+ c->fdsp.vector_fmul_window(wout, saved + 448, buf, c->short_win, 64);
+ memcpy(wout + 128, buf + 64, 448 * sizeof(float));
+ memcpy(saved, buf + 512, 448 * sizeof(float));
+ memcpy(saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
+ }
+
+ return 0;
+}
+
+// not borrowed from aacdec.c - the codec has original design after all
+static int on2avc_reconstruct_channel(On2AVCContext *c, int channel,
+ AVFrame *dst, int offset)
+{
+ int i;
+ float *out = (float*)dst->extended_data[channel] + offset;
+ float *in = c->coeffs[channel];
+ float *saved = c->delay[channel];
+ float *buf = c->mdct_buf;
+ float *temp = c->temp;
+
+ switch (c->window_type) {
+ case WINDOW_TYPE_LONG_START:
+ case WINDOW_TYPE_LONG_STOP:
+ case WINDOW_TYPE_LONG:
+ c->mdct.imdct_half(&c->mdct, buf, in);
+ break;
+ case WINDOW_TYPE_8SHORT:
+ for (i = 0; i < ON2AVC_SUBFRAME_SIZE; i += ON2AVC_SUBFRAME_SIZE / 8)
+ c->mdct_small.imdct_half(&c->mdct_small, buf + i, in + i);
+ break;
+ }
+
+ if ((c->prev_window_type == WINDOW_TYPE_LONG ||
+ c->prev_window_type == WINDOW_TYPE_LONG_STOP) &&
+ (c->window_type == WINDOW_TYPE_LONG ||
+ c->window_type == WINDOW_TYPE_LONG_START)) {
+ c->fdsp.vector_fmul_window(out, saved, buf, c->long_win, 512);
+ } else {
+ float *wout = out + 448;
+ memcpy(out, saved, 448 * sizeof(float));
+
+ if (c->window_type == WINDOW_TYPE_8SHORT) {
+ c->fdsp.vector_fmul_window(wout + 0*128, saved + 448, buf + 0*128, c->short_win, 64);
+ c->fdsp.vector_fmul_window(wout + 1*128, buf + 0*128 + 64, buf + 1*128, c->short_win, 64);
+ c->fdsp.vector_fmul_window(wout + 2*128, buf + 1*128 + 64, buf + 2*128, c->short_win, 64);
+ c->fdsp.vector_fmul_window(wout + 3*128, buf + 2*128 + 64, buf + 3*128, c->short_win, 64);
+ c->fdsp.vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, c->short_win, 64);
+ memcpy(wout + 4*128, temp, 64 * sizeof(float));
+ } else {
+ c->fdsp.vector_fmul_window(wout, saved + 448, buf, c->short_win, 64);
+ memcpy(wout + 128, buf + 64, 448 * sizeof(float));
+ }
+ }
+
+ // buffer update
+ switch (c->window_type) {
+ case WINDOW_TYPE_8SHORT:
+ memcpy(saved, temp + 64, 64 * sizeof(float));
+ c->fdsp.vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, c->short_win, 64);
+ c->fdsp.vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, c->short_win, 64);
+ c->fdsp.vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, c->short_win, 64);
+ memcpy(saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
+ break;
+ case WINDOW_TYPE_LONG_START:
+ memcpy(saved, buf + 512, 448 * sizeof(float));
+ memcpy(saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
+ break;
+ case WINDOW_TYPE_LONG_STOP:
+ case WINDOW_TYPE_LONG:
+ memcpy(saved, buf + 512, 512 * sizeof(float));
+ break;
+ }
+ return 0;
+}
+
+static int on2avc_decode_subframe(On2AVCContext *c, const uint8_t *buf,
+ int buf_size, AVFrame *dst, int offset)
+{
+ GetBitContext gb;
+ int i, ret;
+
+ init_get_bits(&gb, buf, buf_size * 8);
+ if (get_bits1(&gb)) {
+ av_log(c->avctx, AV_LOG_ERROR, "enh bit set\n");
+ return AVERROR_INVALIDDATA;
+ }
+ c->prev_window_type = c->window_type;
+ c->window_type = get_bits(&gb, 3);
+ if (c->window_type >= WINDOW_TYPE_EXT4 && c->avctx->channels == 1) {
+ av_log(c->avctx, AV_LOG_ERROR, "stereo mode window for mono audio\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ c->band_start = c->modes[c->window_type].band_start;
+ c->num_windows = c->modes[c->window_type].num_windows;
+ c->num_bands = c->modes[c->window_type].num_bands;
+ c->is_long = (c->window_type != WINDOW_TYPE_8SHORT);
+
+ c->grouping[0] = 1;
+ for (i = 1; i < c->num_windows; i++)
+ c->grouping[i] = !get_bits1(&gb);
+
+ on2avc_read_ms_info(c, &gb);
+ for (i = 0; i < c->avctx->channels; i++)
+ if ((ret = on2avc_read_channel_data(c, &gb, i)) < 0)
+ return AVERROR_INVALIDDATA;
+ if (c->avctx->channels == 2 && c->ms_present)
+ on2avc_apply_ms(c);
+ if (c->window_type < WINDOW_TYPE_EXT4) {
+ for (i = 0; i < c->avctx->channels; i++)
+ on2avc_reconstruct_channel(c, i, dst, offset);
+ } else {
+ on2avc_reconstruct_stereo(c, dst, offset);
+ }
+
+ return 0;
+}
+
+static int on2avc_decode_frame(AVCodecContext * avctx, void *data,
+ int *got_frame_ptr, AVPacket *avpkt)
+{
+ AVFrame *frame = data;
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
+ On2AVCContext *c = avctx->priv_data;
+ GetByteContext gb;
+ int num_frames = 0, frame_size, audio_off;
+ int ret;
+
+ if (c->is_av500) {
+ /* get output buffer */
+ frame->nb_samples = ON2AVC_SUBFRAME_SIZE;
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ return ret;
+ }
+
+ if ((ret = on2avc_decode_subframe(c, buf, buf_size, frame, 0)) < 0)
+ return ret;
+ } else {
+ bytestream2_init(&gb, buf, buf_size);
+ while (bytestream2_get_bytes_left(&gb) > 2) {
+ frame_size = bytestream2_get_le16(&gb);
+ if (!frame_size || frame_size > bytestream2_get_bytes_left(&gb)) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid subframe size %d\n",
+ frame_size);
+ return AVERROR_INVALIDDATA;
+ }
+ num_frames++;
+ bytestream2_skip(&gb, frame_size);
+ }
+ if (!num_frames) {
+ av_log(avctx, AV_LOG_ERROR, "No subframes present\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ /* get output buffer */
+ frame->nb_samples = ON2AVC_SUBFRAME_SIZE * num_frames;
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ return ret;
+ }
+
+ audio_off = 0;
+ bytestream2_init(&gb, buf, buf_size);
+ while (bytestream2_get_bytes_left(&gb) > 2) {
+ frame_size = bytestream2_get_le16(&gb);
+ if ((ret = on2avc_decode_subframe(c, gb.buffer, frame_size,
+ frame, audio_off)) < 0)
+ return ret;
+ audio_off += ON2AVC_SUBFRAME_SIZE;
+ bytestream2_skip(&gb, frame_size);
+ }
+ }
+
+ *got_frame_ptr = 1;
+
+ return buf_size;
+}
+
+static av_cold void on2avc_free_vlcs(On2AVCContext *c)
+{
+ int i;
+
+ ff_free_vlc(&c->scale_diff);
+ for (i = 1; i < 16; i++)
+ ff_free_vlc(&c->cb_vlc[i]);
+}
+
+static av_cold int on2avc_decode_init(AVCodecContext *avctx)
+{
+ On2AVCContext *c = avctx->priv_data;
+ int i;
+
+ c->avctx = avctx;
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
+ avctx->channel_layout = (avctx->channels == 2) ? AV_CH_LAYOUT_STEREO
+ : AV_CH_LAYOUT_MONO;
+
+ c->is_av500 = (avctx->codec_tag == 0x500);
+ if (c->is_av500 && avctx->channels == 2) {
+ av_log(avctx, AV_LOG_ERROR, "0x500 version should be mono\n");
+ return AVERROR_INVALIDDATA;
+ }
+ if (avctx->channels == 2)
+ av_log(avctx, AV_LOG_WARNING,
+ "Stereo mode support is not good, patch is welcome\n");
+
+ for (i = 0; i < 20; i++)
+ c->scale_tab[i] = ceil(pow(10.0, i * 0.1) * 16) / 32;
+ for (; i < 128; i++)
+ c->scale_tab[i] = ceil(pow(10.0, i * 0.1) * 0.5);
+
+ if (avctx->sample_rate < 32000 || avctx->channels == 1)
+ memcpy(c->long_win, ff_on2avc_window_long_24000,
+ 1024 * sizeof(*c->long_win));
+ else
+ memcpy(c->long_win, ff_on2avc_window_long_32000,
+ 1024 * sizeof(*c->long_win));
+ memcpy(c->short_win, ff_on2avc_window_short, 128 * sizeof(*c->short_win));
+
+ c->modes = (avctx->sample_rate <= 40000) ? ff_on2avc_modes_40
+ : ff_on2avc_modes_44;
+ c->wtf = (avctx->sample_rate <= 40000) ? wtf_40
+ : wtf_44;
+
+ ff_mdct_init(&c->mdct, 11, 1, 1.0 / (32768.0 * 1024.0));
+ ff_mdct_init(&c->mdct_half, 10, 1, 1.0 / (32768.0 * 512.0));
+ ff_mdct_init(&c->mdct_small, 8, 1, 1.0 / (32768.0 * 128.0));
+ ff_fft_init(&c->fft128, 6, 0);
+ ff_fft_init(&c->fft256, 7, 0);
+ ff_fft_init(&c->fft512, 8, 1);
+ ff_fft_init(&c->fft1024, 9, 1);
+ avpriv_float_dsp_init(&c->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
+
+ if (init_vlc(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS,
+ ff_on2avc_scale_diff_bits, 1, 1,
+ ff_on2avc_scale_diff_codes, 4, 4, 0)) {
+ av_log(avctx, AV_LOG_ERROR, "Cannot init VLC\n");
+ return AVERROR(ENOMEM);
+ }
+ for (i = 1; i < 9; i++) {
+ int idx = i - 1;
+ if (ff_init_vlc_sparse(&c->cb_vlc[i], 9, ff_on2avc_quad_cb_elems[idx],
+ ff_on2avc_quad_cb_bits[idx], 1, 1,
+ ff_on2avc_quad_cb_codes[idx], 4, 4,
+ ff_on2avc_quad_cb_syms[idx], 2, 2, 0)) {
+ av_log(avctx, AV_LOG_ERROR, "Cannot init VLC\n");
+ on2avc_free_vlcs(c);
+ return AVERROR(ENOMEM);
+ }
+ }
+ for (i = 9; i < 16; i++) {
+ int idx = i - 9;
+ if (ff_init_vlc_sparse(&c->cb_vlc[i], 9, ff_on2avc_pair_cb_elems[idx],
+ ff_on2avc_pair_cb_bits[idx], 1, 1,
+ ff_on2avc_pair_cb_codes[idx], 2, 2,
+ ff_on2avc_pair_cb_syms[idx], 2, 2, 0)) {
+ av_log(avctx, AV_LOG_ERROR, "Cannot init VLC\n");
+ on2avc_free_vlcs(c);
+ return AVERROR(ENOMEM);
+ }
+ }
+
+ return 0;
+}
+
+static av_cold int on2avc_decode_close(AVCodecContext *avctx)
+{
+ On2AVCContext *c = avctx->priv_data;
+
+ ff_mdct_end(&c->mdct);
+ ff_mdct_end(&c->mdct_half);
+ ff_mdct_end(&c->mdct_small);
+ ff_fft_end(&c->fft128);
+ ff_fft_end(&c->fft256);
+ ff_fft_end(&c->fft512);
+ ff_fft_end(&c->fft1024);
+
+ on2avc_free_vlcs(c);
+
+ return 0;
+}
+
+
+AVCodec ff_on2avc_decoder = {
+ .name = "on2avc",
+ .long_name = NULL_IF_CONFIG_SMALL("On2 Audio for Video Codec"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_ON2AVC,
+ .priv_data_size = sizeof(On2AVCContext),
+ .init = on2avc_decode_init,
+ .decode = on2avc_decode_frame,
+ .close = on2avc_decode_close,
+ .capabilities = CODEC_CAP_DR1,
+ .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
+ AV_SAMPLE_FMT_NONE },
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/on2avcdata.c b/chromium/third_party/ffmpeg/libavcodec/on2avcdata.c
new file mode 100644
index 00000000000..abe598350b1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/on2avcdata.c
@@ -0,0 +1,9383 @@
+/*
+ * On2 Audio for Video Codec decoder
+ *
+ * Copyright (c) 2013 Konstantin Shishkov
+ *
+ * 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 "on2avcdata.h"
+
+static const int on2avc_swb_start_long[] = {
+ 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64,
+ 72, 80, 88, 96, 108, 120, 132, 144, 156, 172, 188, 204, 224, 244,
+ 264, 288, 312, 340, 368, 400, 432, 464, 496, 528, 560, 592, 624, 656,
+ 688, 720, 752, 784, 816, 848, 880, 1024
+};
+
+static const int on2avc_swb_start_short[] = {
+ 0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 56, 68, 80, 108, 128
+};
+
+static const int on2avc_swb_start_mode_4_40[] = {
+ 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104,
+ 112, 120, 128, 144, 160, 176, 192, 208, 224, 240, 256, 264, 272, 280,
+ 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 400,
+ 416, 432, 448, 464, 480, 496, 512, 520, 528, 536, 544, 552, 560, 568,
+ 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, 656, 664, 672, 680,
+ 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 800, 832, 864,
+ 896, 928, 960, 992, 1024
+};
+
+static const int on2avc_swb_start_mode_5_40[] = {
+ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 136,
+ 144, 152, 160, 168, 176, 184, 192, 208, 224, 240, 256, 264, 272, 280,
+ 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 416,
+ 448, 480, 512, 516, 520, 524, 528, 532, 536, 540, 548, 556, 568, 580,
+ 592, 608, 624, 640, 656, 672, 688, 704, 720, 736, 752, 768, 784, 800,
+ 816, 832, 848, 864, 880, 896, 912, 928, 944, 1024
+};
+
+static const int on2avc_swb_start_mode_6_40[] = {
+ 0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 56, 68, 80, 96,
+ 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, 272, 288, 304, 320,
+ 336, 352, 368, 384, 400, 416, 432, 512, 520, 528, 536, 544, 552, 560,
+ 568, 576, 592, 608, 624, 640, 648, 656, 664, 672, 680, 688, 696, 704,
+ 720, 736, 752, 768, 776, 784, 792, 800, 808, 816, 824, 832, 840, 848,
+ 856, 864, 872, 880, 888, 896, 928, 960, 992, 1024
+};
+
+static const int on2avc_swb_start_mode_4_44[] = {
+ 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104,
+ 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216,
+ 224, 232, 240, 248, 256, 264, 272, 280, 288, 296, 304, 312, 320, 328,
+ 336, 344, 352, 360, 368, 376, 384, 392, 400, 408, 416, 424, 432, 440,
+ 448, 456, 464, 472, 480, 488, 496, 504, 512, 528, 544, 560, 576, 592,
+ 608, 624, 640, 672, 704, 736, 768, 832, 896, 960, 1024
+};
+
+static const int on2avc_swb_start_mode_5_44[] = {
+ 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104,
+ 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216,
+ 224, 232, 240, 248, 256, 272, 288, 304, 320, 352, 384, 448, 512, 516,
+ 520, 524, 528, 532, 536, 540, 548, 556, 568, 580, 592, 608, 624, 640,
+ 656, 672, 688, 704, 720, 736, 752, 768, 784, 800, 816, 832, 848, 864,
+ 880, 896, 912, 928, 944, 1024
+};
+
+static const int on2avc_swb_start_mode_6_44[] = {
+ 0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 56, 68, 80, 96,
+ 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, 272, 288, 304, 320,
+ 336, 352, 368, 384, 400, 416, 432, 512, 520, 528, 536, 544, 552, 560,
+ 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, 656, 664, 672,
+ 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 784, 800,
+ 816, 832, 864, 896, 960, 1024
+};
+
+const On2AVCMode ff_on2avc_modes_40[8] = {
+ { 1, 49, on2avc_swb_start_long },
+ { 1, 49, on2avc_swb_start_long },
+ { 1, 49, on2avc_swb_start_long },
+ { 8, 14, on2avc_swb_start_short },
+ { 1, 88, on2avc_swb_start_mode_4_40 },
+ { 1, 79, on2avc_swb_start_mode_5_40 },
+ { 1, 79, on2avc_swb_start_mode_6_40 },
+ { 1, 49, on2avc_swb_start_long },
+};
+
+const On2AVCMode ff_on2avc_modes_44[8] = {
+ { 1, 49, on2avc_swb_start_long },
+ { 1, 49, on2avc_swb_start_long },
+ { 1, 49, on2avc_swb_start_long },
+ { 8, 14, on2avc_swb_start_short },
+ { 1, 80, on2avc_swb_start_mode_4_44 },
+ { 1, 75, on2avc_swb_start_mode_5_44 },
+ { 1, 75, on2avc_swb_start_mode_6_44 },
+ { 1, 49, on2avc_swb_start_long },
+};
+
+const uint32_t ff_on2avc_scale_diff_codes[ON2AVC_SCALE_DIFFS] = {
+ 0x6FFFF, 0xBFFF2, 0xBFFF3, 0xBFFF4, 0xBFFF5, 0xBFFF6,
+ 0xBFFF7, 0xBFFF8, 0xBFFF9, 0xBFFFA, 0xBFFFB, 0xBFFFC,
+ 0xBFFFD, 0xBFFFE, 0xBFFFF, 0xDF9A0, 0xDF9A1, 0xDF9A2,
+ 0xDF9A3, 0xDF9A4, 0xDF9A5, 0xDF9A6, 0xDF9A7, 0xDF9A8,
+ 0xDF9A9, 0x37FFE, 0x6FCDE, 0x6FFFA, 0x0BFF7, 0x0B7FF,
+ 0x0DF9F, 0x05FF8, 0x0B7FE, 0x05FF9, 0x06FCE, 0x05BFE,
+ 0x037FE, 0x02DFE, 0x00DFA, 0x00DFE, 0x017FC, 0x00DBE,
+ 0x00B7E, 0x005FE, 0x0037D, 0x002DE, 0x0017E, 0x0016C,
+ 0x000DE, 0x000BE, 0x0006C, 0x0005A, 0x0003E, 0x00034,
+ 0x0002C, 0x0001F, 0x0000E, 0x0000E, 0x00006, 0x00002,
+ 0x00000, 0x00004, 0x0000A, 0x0000C, 0x0001E, 0x0001E,
+ 0x0002E, 0x00035, 0x0003F, 0x0005E, 0x0006E, 0x000DA,
+ 0x0016D, 0x0016E, 0x001B6, 0x002FE, 0x0036E, 0x0037C,
+ 0x005BE, 0x006DE, 0x006FE, 0x00DBF, 0x00DFB, 0x016FE,
+ 0x017FD, 0x01BFE, 0x01BF2, 0x02FFE, 0x06FCC, 0x05FFE,
+ 0x05FFA, 0x06FFE, 0x0BFF6, 0x0BFFE, 0x0DF9E, 0x00DF8,
+ 0x0DFFE, 0x37FFC, 0x6FFFB, 0x5FFF8, 0xDF9AA, 0xDF9AB,
+ 0xDF9AC, 0xDF9AD, 0xDF9AE, 0xDF9AF, 0xDF9B0, 0xDF9B1,
+ 0xDF9B2, 0xDF9B3, 0x6FFFE, 0xDF9B4, 0xDF9B5, 0xDF9B6,
+ 0xDF9B7, 0xDF9B8, 0xDF9B9, 0xDF9BA, 0xDF9BB, 0xDF9BE,
+ 0xDF9BF,
+};
+
+const uint8_t ff_on2avc_scale_diff_bits[ON2AVC_SCALE_DIFFS] = {
+ 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21,
+ 21, 19, 20, 20, 16, 16,
+ 17, 15, 16, 15, 16, 15,
+ 15, 14, 13, 13, 13, 13,
+ 12, 11, 11, 10, 9, 9,
+ 9, 8, 8, 7, 7, 7,
+ 6, 5, 5, 4, 3, 3,
+ 2, 3, 4, 5, 5, 6,
+ 6, 7, 7, 7, 8, 9,
+ 9, 9, 10, 10, 11, 11,
+ 11, 12, 12, 13, 13, 13,
+ 13, 14, 14, 14, 16, 15,
+ 15, 16, 16, 16, 17, 13,
+ 17, 19, 20, 19, 21, 21,
+ 21, 21, 21, 21, 21, 21,
+ 21, 21, 20, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21,
+ 21,
+};
+
+#define ON2AVC_CB1_CODES 41
+static const uint32_t on2avc_cb1_codes[ON2AVC_CB1_CODES] = {
+ 0x0000, 0x0022, 0x001C, 0x001B, 0x0024, 0x0030,
+ 0x0029, 0x0027, 0x0021, 0x002B, 0x002E, 0x0020,
+ 0x0026, 0x0033, 0x0031, 0x002C, 0x002A, 0x001E,
+ 0x0094, 0x01FF, 0x01F7, 0x012E, 0x001A, 0x01F5,
+ 0x007E, 0x012C, 0x01FC, 0x002D, 0x0032, 0x0028,
+ 0x002F, 0x001D, 0x01FD, 0x012D, 0x007C, 0x01F4,
+ 0x0023, 0x012F, 0x01F6, 0x01FE, 0x0095,
+};
+
+static const uint8_t on2avc_cb1_bits[ON2AVC_CB1_CODES] = {
+ 1, 6, 5, 5, 6, 6,
+ 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 5,
+ 8, 9, 9, 9, 5, 9,
+ 7, 9, 9, 6, 6, 6,
+ 6, 5, 9, 9, 7, 9,
+ 6, 9, 9, 9, 8,
+};
+
+static const uint16_t on2avc_cb1_syms[ON2AVC_CB1_CODES] = {
+ 0x0000, 0x0011, 0x001F, 0x00F1, 0x00FF, 0x0101,
+ 0x010F, 0x0110, 0x01F0, 0x0F01, 0x0F0F, 0x0F10,
+ 0x0FF0, 0x1001, 0x100F, 0x1010, 0x10F0, 0x1100,
+ 0x1111, 0x111F, 0x11F1, 0x11FF, 0x1F00, 0x1F11,
+ 0x1F1F, 0x1FF1, 0x1FFF, 0xF001, 0xF00F, 0xF010,
+ 0xF0F0, 0xF100, 0xF111, 0xF11F, 0xF1F1, 0xF1FF,
+ 0xFF00, 0xFF11, 0xFF1F, 0xFFF1, 0xFFFF,
+};
+
+#define ON2AVC_CB2_CODES 41
+static const uint32_t on2avc_cb2_codes[ON2AVC_CB2_CODES] = {
+ 0x0006, 0x0003, 0x001F, 0x001E, 0x0000, 0x0014,
+ 0x0009, 0x000E, 0x000D, 0x000C, 0x0015, 0x0008,
+ 0x0010, 0x000F, 0x0004, 0x0012, 0x0007, 0x0016,
+ 0x0005, 0x002F, 0x0017, 0x0006, 0x001D, 0x002C,
+ 0x005E, 0x0014, 0x0016, 0x0006, 0x0011, 0x000A,
+ 0x0013, 0x001C, 0x002D, 0x0015, 0x005F, 0x002E,
+ 0x0002, 0x0007, 0x005D, 0x005C, 0x0004,
+};
+
+static const uint8_t on2avc_cb2_bits[ON2AVC_CB2_CODES] = {
+ 3, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5,
+ 7, 7, 7, 7, 5, 7,
+ 7, 7, 7, 5, 5, 5,
+ 5, 5, 7, 7, 7, 7,
+ 5, 7, 7, 7, 7,
+};
+
+static const uint16_t on2avc_cb2_syms[ON2AVC_CB2_CODES] = {
+ 0x0000, 0x0011, 0x001F, 0x00F1, 0x00FF, 0x0101,
+ 0x010F, 0x0110, 0x01F0, 0x0F01, 0x0F0F, 0x0F10,
+ 0x0FF0, 0x1001, 0x100F, 0x1010, 0x10F0, 0x1100,
+ 0x1111, 0x111F, 0x11F1, 0x11FF, 0x1F00, 0x1F11,
+ 0x1F1F, 0x1FF1, 0x1FFF, 0xF001, 0xF00F, 0xF010,
+ 0xF0F0, 0xF100, 0xF111, 0xF11F, 0xF1F1, 0xF1FF,
+ 0xFF00, 0xFF11, 0xFF1F, 0xFFF1, 0xFFFF,
+};
+
+#define ON2AVC_CB3_CODES 313
+static const uint32_t on2avc_cb3_codes[ON2AVC_CB3_CODES] = {
+ 0x00000, 0x00044, 0x00042, 0x00034, 0x0002E, 0x000CD,
+ 0x002DF, 0x0024A, 0x000CC, 0x0022E, 0x002D6, 0x00031,
+ 0x0003B, 0x00048, 0x00052, 0x00056, 0x001B8, 0x00160,
+ 0x001FA, 0x0015E, 0x0015C, 0x0014E, 0x0003C, 0x0010C,
+ 0x00166, 0x000CA, 0x0324C, 0x00FDA, 0x003DE, 0x002DB,
+ 0x0057F, 0x02C9E, 0x008BF, 0x0037F, 0x021DC, 0x00B1E,
+ 0x002DE, 0x002D2, 0x000C8, 0x014D6, 0x03576, 0x002CA,
+ 0x002CF, 0x003DB, 0x007FE, 0x01F7E, 0x005A3, 0x008BE,
+ 0x02D7E, 0x002D3, 0x0037E, 0x0004D, 0x0004C, 0x00041,
+ 0x0016A, 0x0010D, 0x0015D, 0x0011F, 0x00162, 0x0021E,
+ 0x00055, 0x00161, 0x001BE, 0x0004E, 0x0004A, 0x0004B,
+ 0x003EE, 0x00352, 0x0043A, 0x0033E, 0x0035C, 0x0036C,
+ 0x00050, 0x0032F, 0x003D6, 0x00039, 0x0067E, 0x00536,
+ 0x000FE, 0x001F4, 0x0036D, 0x007EF, 0x00CFE, 0x002D0,
+ 0x00F8C, 0x00D96, 0x001E9, 0x001F6, 0x00476, 0x00367,
+ 0x001F2, 0x01FF6, 0x016BB, 0x007FC, 0x00D5C, 0x00B24,
+ 0x00C92, 0x0014F, 0x01EA6, 0x01936, 0x00366, 0x0035E,
+ 0x00116, 0x00FBE, 0x01B5E, 0x0092F, 0x007EE, 0x00CEE,
+ 0x00B26, 0x0011E, 0x014DF, 0x035DE, 0x00030, 0x00473,
+ 0x005A2, 0x001BC, 0x000D6, 0x002DA, 0x00B5E, 0x007AA,
+ 0x002C8, 0x00D94, 0x00D97, 0x001AA, 0x001EE, 0x0003A,
+ 0x035DF, 0x03D4F, 0x0064F, 0x0064A, 0x02D73, 0x1ABBE,
+ 0x0B1CF, 0x00F8E, 0x06AFF, 0x0475E, 0x00472, 0x00596,
+ 0x003E7, 0x0036E, 0x00196, 0x0357E, 0x03F6E, 0x0324E,
+ 0x0324F, 0x0163B, 0x0192F, 0x001B4, 0x0326A, 0x02C9F,
+ 0x0021F, 0x0F8FF, 0x064D6, 0x007BE, 0x00DDF, 0x033BC,
+ 0x033BD, 0x06AEE, 0x00876, 0x07C7E, 0x0B1CE, 0x00D76,
+ 0x00DDC, 0x001EC, 0x0649B, 0x0B1CD, 0x00F8D, 0x007D6,
+ 0x01AEE, 0x0163F, 0x03E3E, 0x00A6A, 0x06D7E, 0x0DDDF,
+ 0x00F7E, 0x00DAE, 0x0036F, 0x00338, 0x0016C, 0x033BF,
+ 0x036BE, 0x01FF7, 0x01937, 0x01ABA, 0x014D7, 0x0014C,
+ 0x01F7F, 0x0475F, 0x00040, 0x07FFC, 0x03F6F, 0x00477,
+ 0x00496, 0x014DE, 0x0649A, 0x064D7, 0x02C9C, 0x0B1CC,
+ 0x1ABBF, 0x00648, 0x006BA, 0x00364, 0x0032E, 0x00126,
+ 0x03D4E, 0x02C72, 0x011D6, 0x01638, 0x01934, 0x02C9D,
+ 0x0016E, 0x021DD, 0x03DFF, 0x001F0, 0x07FFE, 0x043BF,
+ 0x00D5E, 0x00FAE, 0x0092E, 0x07FFF, 0x0F8FE, 0x02D7F,
+ 0x043BE, 0x06D7F, 0x008E9, 0x00FFA, 0x0021C, 0x06EEE,
+ 0x0D5DE, 0x00F57, 0x00CFF, 0x016BA, 0x07FFD, 0x06AFE,
+ 0x021DE, 0x0DDDE, 0x023AE, 0x00FAF, 0x006D6, 0x0037B,
+ 0x003E6, 0x001B9, 0x01F1E, 0x033BE, 0x0192E, 0x016BE,
+ 0x01FB6, 0x01BBA, 0x0019E, 0x03776, 0x03DFE, 0x00046,
+ 0x00051, 0x0004F, 0x003D7, 0x0033A, 0x00376, 0x00353,
+ 0x00356, 0x003EA, 0x00054, 0x00339, 0x003E2, 0x0002F,
+ 0x0064C, 0x00534, 0x00238, 0x001A8, 0x002C6, 0x00D95,
+ 0x00F52, 0x002CE, 0x007DE, 0x00B2F, 0x000D8, 0x001BA,
+ 0x0036A, 0x0035F, 0x00127, 0x01EFE, 0x016B8, 0x008EA,
+ 0x00CEC, 0x007EC, 0x00A6E, 0x00114, 0x01ABE, 0x00FFE,
+ 0x0037A, 0x0045E, 0x00124, 0x0163E, 0x02D72, 0x00CED,
+ 0x00B2E, 0x00C96, 0x007A8, 0x001FE, 0x0163A, 0x01FFE,
+ 0x00038, 0x0057E, 0x0064E, 0x001F8, 0x001E8, 0x002BE,
+ 0x00DDE, 0x00F56, 0x003DA, 0x00B25, 0x008E8, 0x001F9,
+ 0x00115,
+};
+
+static const uint8_t on2avc_cb3_bits[ON2AVC_CB3_CODES] = {
+ 1, 7, 7, 6, 6, 8,
+ 10, 10, 8, 10, 10, 6,
+ 6, 7, 7, 7, 9, 9,
+ 9, 9, 9, 9, 6, 9,
+ 9, 8, 14, 12, 10, 10,
+ 11, 14, 12, 10, 14, 12,
+ 10, 10, 8, 13, 14, 10,
+ 10, 10, 11, 13, 11, 12,
+ 14, 10, 10, 7, 7, 7,
+ 9, 9, 9, 9, 9, 10,
+ 7, 9, 9, 7, 7, 7,
+ 10, 10, 11, 10, 10, 10,
+ 7, 10, 10, 6, 11, 11,
+ 8, 9, 10, 11, 12, 10,
+ 12, 12, 9, 9, 11, 10,
+ 9, 13, 13, 11, 12, 12,
+ 12, 9, 13, 13, 10, 10,
+ 9, 12, 13, 12, 11, 12,
+ 12, 9, 13, 14, 6, 11,
+ 11, 9, 8, 10, 12, 11,
+ 10, 12, 12, 9, 9, 6,
+ 14, 14, 11, 11, 14, 17,
+ 16, 12, 15, 15, 11, 11,
+ 10, 10, 9, 14, 14, 14,
+ 14, 13, 13, 9, 14, 14,
+ 10, 16, 15, 11, 12, 14,
+ 14, 15, 12, 15, 16, 12,
+ 12, 9, 15, 16, 12, 11,
+ 13, 13, 14, 12, 15, 16,
+ 12, 12, 10, 10, 9, 14,
+ 14, 13, 13, 13, 13, 9,
+ 13, 15, 7, 15, 14, 11,
+ 11, 13, 15, 15, 14, 16,
+ 17, 11, 11, 10, 10, 9,
+ 14, 14, 13, 13, 13, 14,
+ 9, 14, 14, 9, 15, 15,
+ 12, 12, 12, 15, 16, 14,
+ 15, 15, 12, 12, 10, 15,
+ 16, 12, 12, 13, 15, 15,
+ 14, 16, 14, 12, 11, 10,
+ 10, 9, 13, 14, 13, 13,
+ 13, 13, 9, 14, 14, 7,
+ 7, 7, 10, 10, 10, 10,
+ 10, 10, 7, 10, 10, 6,
+ 11, 11, 10, 9, 10, 12,
+ 12, 10, 11, 12, 8, 9,
+ 10, 10, 9, 13, 13, 12,
+ 12, 11, 12, 9, 13, 12,
+ 10, 11, 9, 13, 14, 12,
+ 12, 12, 11, 9, 13, 13,
+ 6, 11, 11, 9, 9, 10,
+ 12, 12, 10, 12, 12, 9,
+ 9,
+};
+
+static const uint16_t on2avc_cb3_syms[ON2AVC_CB3_CODES] = {
+ 0x0000, 0x0002, 0x000E, 0x0011, 0x001F, 0x0020,
+ 0x0022, 0x002E, 0x00E0, 0x00E2, 0x00EE, 0x00F1,
+ 0x00FF, 0x0101, 0x010F, 0x0110, 0x0112, 0x011E,
+ 0x0121, 0x012F, 0x01E1, 0x01EF, 0x01F0, 0x01F2,
+ 0x01FE, 0x0200, 0x0202, 0x020E, 0x0211, 0x021F,
+ 0x0220, 0x0222, 0x022E, 0x02E0, 0x02E2, 0x02EE,
+ 0x02F1, 0x02FF, 0x0E00, 0x0E02, 0x0E0E, 0x0E11,
+ 0x0E1F, 0x0E20, 0x0E22, 0x0E2E, 0x0EE0, 0x0EE2,
+ 0x0EEE, 0x0EF1, 0x0EFF, 0x0F01, 0x0F0F, 0x0F10,
+ 0x0F12, 0x0F1E, 0x0F21, 0x0F2F, 0x0FE1, 0x0FEF,
+ 0x0FF0, 0x0FF2, 0x0FFE, 0x1001, 0x100F, 0x1010,
+ 0x1012, 0x101E, 0x1021, 0x102F, 0x10E1, 0x10EF,
+ 0x10F0, 0x10F2, 0x10FE, 0x1100, 0x1102, 0x110E,
+ 0x1111, 0x111F, 0x1120, 0x1122, 0x112E, 0x11E0,
+ 0x11E2, 0x11EE, 0x11F1, 0x11FF, 0x1201, 0x120F,
+ 0x1210, 0x1212, 0x121E, 0x1221, 0x122F, 0x12E1,
+ 0x12EF, 0x12F0, 0x12F2, 0x12FE, 0x1E01, 0x1E0F,
+ 0x1E10, 0x1E12, 0x1E1E, 0x1E21, 0x1E2F, 0x1EE1,
+ 0x1EEF, 0x1EF0, 0x1EF2, 0x1EFE, 0x1F00, 0x1F02,
+ 0x1F0E, 0x1F11, 0x1F1F, 0x1F20, 0x1F22, 0x1F2E,
+ 0x1FE0, 0x1FE2, 0x1FEE, 0x1FF1, 0x1FFF, 0x2000,
+ 0x2002, 0x200E, 0x2011, 0x201F, 0x2020, 0x2022,
+ 0x202E, 0x20E0, 0x20E2, 0x20EE, 0x20F1, 0x20FF,
+ 0x2101, 0x210F, 0x2110, 0x2112, 0x211E, 0x2121,
+ 0x212F, 0x21E1, 0x21EF, 0x21F0, 0x21F2, 0x21FE,
+ 0x2200, 0x2202, 0x220E, 0x2211, 0x221F, 0x2220,
+ 0x2222, 0x222E, 0x22E0, 0x22E2, 0x22EE, 0x22F1,
+ 0x22FF, 0x2E00, 0x2E02, 0x2E0E, 0x2E11, 0x2E1F,
+ 0x2E20, 0x2E22, 0x2E2E, 0x2EE0, 0x2EE2, 0x2EEE,
+ 0x2EF1, 0x2EFF, 0x2F01, 0x2F0F, 0x2F10, 0x2F12,
+ 0x2F1E, 0x2F21, 0x2F2F, 0x2FE1, 0x2FEF, 0x2FF0,
+ 0x2FF2, 0x2FFE, 0xE000, 0xE002, 0xE00E, 0xE011,
+ 0xE01F, 0xE020, 0xE022, 0xE02E, 0xE0E0, 0xE0E2,
+ 0xE0EE, 0xE0F1, 0xE0FF, 0xE101, 0xE10F, 0xE110,
+ 0xE112, 0xE11E, 0xE121, 0xE12F, 0xE1E1, 0xE1EF,
+ 0xE1F0, 0xE1F2, 0xE1FE, 0xE200, 0xE202, 0xE20E,
+ 0xE211, 0xE21F, 0xE220, 0xE222, 0xE22E, 0xE2E0,
+ 0xE2E2, 0xE2EE, 0xE2F1, 0xE2FF, 0xEE00, 0xEE02,
+ 0xEE0E, 0xEE11, 0xEE1F, 0xEE20, 0xEE22, 0xEE2E,
+ 0xEEE0, 0xEEE2, 0xEEEE, 0xEEF1, 0xEEFF, 0xEF01,
+ 0xEF0F, 0xEF10, 0xEF12, 0xEF1E, 0xEF21, 0xEF2F,
+ 0xEFE1, 0xEFEF, 0xEFF0, 0xEFF2, 0xEFFE, 0xF001,
+ 0xF00F, 0xF010, 0xF012, 0xF01E, 0xF021, 0xF02F,
+ 0xF0E1, 0xF0EF, 0xF0F0, 0xF0F2, 0xF0FE, 0xF100,
+ 0xF102, 0xF10E, 0xF111, 0xF11F, 0xF120, 0xF122,
+ 0xF12E, 0xF1E0, 0xF1E2, 0xF1EE, 0xF1F1, 0xF1FF,
+ 0xF201, 0xF20F, 0xF210, 0xF212, 0xF21E, 0xF221,
+ 0xF22F, 0xF2E1, 0xF2EF, 0xF2F0, 0xF2F2, 0xF2FE,
+ 0xFE01, 0xFE0F, 0xFE10, 0xFE12, 0xFE1E, 0xFE21,
+ 0xFE2F, 0xFEE1, 0xFEEF, 0xFEF0, 0xFEF2, 0xFEFE,
+ 0xFF00, 0xFF02, 0xFF0E, 0xFF11, 0xFF1F, 0xFF20,
+ 0xFF22, 0xFF2E, 0xFFE0, 0xFFE2, 0xFFEE, 0xFFF1,
+ 0xFFFF,
+};
+
+#define ON2AVC_CB4_CODES 313
+static const uint32_t on2avc_cb4_codes[ON2AVC_CB4_CODES] = {
+ 0x000A, 0x013B, 0x0127, 0x0004, 0x0015, 0x012C,
+ 0x065F, 0x08CD, 0x016A, 0x08E7, 0x06BA, 0x001B,
+ 0x001D, 0x0018, 0x000A, 0x0002, 0x00C0, 0x012B,
+ 0x00CE, 0x013C, 0x012A, 0x012D, 0x0020, 0x0128,
+ 0x0121, 0x00FC, 0x066B, 0x0472, 0x010A, 0x004E,
+ 0x06AE, 0x063F, 0x1ABF, 0x0B4E, 0x084E, 0x1ABE,
+ 0x010E, 0x0094, 0x00C8, 0x0464, 0x069A, 0x00C9,
+ 0x00FA, 0x041B, 0x2FDE, 0x08CB, 0x05B7, 0x1ABD,
+ 0x066A, 0x008D, 0x00F8, 0x0003, 0x001A, 0x001E,
+ 0x0120, 0x011E, 0x0138, 0x0125, 0x0170, 0x00C4,
+ 0x000B, 0x013E, 0x00C5, 0x000C, 0x000E, 0x001C,
+ 0x00FE, 0x009C, 0x010F, 0x0115, 0x009F, 0x008C,
+ 0x0008, 0x002E, 0x00CF, 0x001C, 0x0110, 0x002F,
+ 0x002C, 0x0002, 0x0116, 0x01FE, 0x032D, 0x00CB,
+ 0x030D, 0x02EC, 0x002E, 0x0037, 0x00CF, 0x0086,
+ 0x00C8, 0x032C, 0x031E, 0x01AC, 0x030C, 0x02ED,
+ 0x035C, 0x013A, 0x02FF, 0x02E2, 0x00BE, 0x00CE,
+ 0x0126, 0x0356, 0x034E, 0x0347, 0x025F, 0x0306,
+ 0x02DA, 0x0168, 0x02E7, 0x020F, 0x0016, 0x0081,
+ 0x0114, 0x0024, 0x001B, 0x010C, 0x03FE, 0x027F,
+ 0x0084, 0x02F9, 0x0237, 0x0000, 0x001A, 0x011A,
+ 0x05A6, 0x04A6, 0x00F9, 0x00CC, 0x05B6, 0x0BF6,
+ 0x0B96, 0x0446, 0x08CE, 0x007F, 0x002C, 0x000E,
+ 0x0080, 0x00C9, 0x00BA, 0x035E, 0x03EF, 0x0345,
+ 0x02FE, 0x02FB, 0x02E6, 0x00D2, 0x021C, 0x0238,
+ 0x06BB, 0x0B97, 0x007E, 0x01AA, 0x023A, 0x05BE,
+ 0x031D, 0x094E, 0x1ABC, 0x0948, 0x088E, 0x02E4,
+ 0x0273, 0x084C, 0x08CC, 0x094B, 0x02D2, 0x023B,
+ 0x043E, 0x2FDF, 0x063E, 0x109B, 0x08CA, 0x08E6,
+ 0x02DE, 0x02F4, 0x00D4, 0x002D, 0x00CA, 0x020E,
+ 0x0344, 0x02FD, 0x030F, 0x02EE, 0x02D6, 0x0123,
+ 0x02F7, 0x03ED, 0x009E, 0x05CA, 0x060E, 0x000D,
+ 0x004D, 0x0444, 0x043F, 0x094A, 0x05FA, 0x109A,
+ 0x0B4F, 0x00FD, 0x0117, 0x0096, 0x0082, 0x0122,
+ 0x025D, 0x0304, 0x034C, 0x027B, 0x035B, 0x02FC,
+ 0x00FC, 0x035F, 0x03EE, 0x088B, 0x0C1E, 0x088A,
+ 0x02F5, 0x0272, 0x17EE, 0x0C1F, 0x084F, 0x088F,
+ 0x069B, 0x0949, 0x023F, 0x02E3, 0x07FE, 0x041A,
+ 0x0B7E, 0x027A, 0x0336, 0x07FF, 0x08CF, 0x094F,
+ 0x065E, 0x0B7F, 0x02DD, 0x0212, 0x01FB, 0x00C6,
+ 0x0095, 0x00D0, 0x023E, 0x025C, 0x02FC, 0x032E,
+ 0x025E, 0x021E, 0x00BC, 0x021D, 0x035A, 0x0007,
+ 0x000F, 0x0006, 0x00C2, 0x000C, 0x00BD, 0x00CD,
+ 0x0113, 0x0118, 0x001D, 0x00CA, 0x008E, 0x0014,
+ 0x010D, 0x0085, 0x0001, 0x003E, 0x008F, 0x0236,
+ 0x030E, 0x00FF, 0x025E, 0x0337, 0x000A, 0x0026,
+ 0x010B, 0x009D, 0x012E, 0x025F, 0x02EF, 0x0305,
+ 0x02DC, 0x027E, 0x02FE, 0x0124, 0x034F, 0x003E,
+ 0x004F, 0x00BC, 0x016C, 0x02D7, 0x03EC, 0x02FA,
+ 0x02F8, 0x02F6, 0x01FA, 0x00CC, 0x02FF, 0x0334,
+ 0x001E, 0x004C, 0x0112, 0x0036, 0x0022, 0x00FE,
+ 0x031C, 0x0346, 0x0108, 0x020C, 0x001E, 0x0012,
+ 0x0026,
+};
+
+static const uint8_t on2avc_cb4_bits[ON2AVC_CB4_CODES] = {
+ 4, 9, 9, 6, 6, 9,
+ 11, 12, 9, 12, 11, 6,
+ 5, 6, 6, 6, 8, 9,
+ 8, 9, 9, 9, 6, 9,
+ 9, 9, 11, 11, 9, 9,
+ 11, 11, 13, 12, 12, 13,
+ 9, 9, 9, 11, 11, 9,
+ 9, 12, 14, 12, 11, 13,
+ 11, 9, 9, 6, 6, 6,
+ 9, 9, 9, 9, 9, 8,
+ 6, 9, 8, 6, 6, 6,
+ 8, 9, 9, 9, 9, 9,
+ 6, 9, 8, 5, 9, 9,
+ 6, 7, 9, 9, 10, 9,
+ 10, 10, 7, 6, 9, 9,
+ 8, 10, 10, 9, 10, 10,
+ 10, 9, 11, 10, 9, 9,
+ 9, 10, 10, 10, 10, 10,
+ 10, 9, 10, 11, 6, 9,
+ 9, 7, 7, 9, 10, 10,
+ 9, 10, 10, 7, 7, 9,
+ 11, 11, 9, 9, 11, 12,
+ 12, 11, 12, 12, 9, 9,
+ 9, 8, 8, 10, 11, 10,
+ 11, 10, 10, 8, 11, 10,
+ 11, 12, 12, 9, 10, 11,
+ 10, 12, 13, 12, 12, 10,
+ 10, 12, 12, 12, 10, 10,
+ 12, 14, 11, 13, 12, 12,
+ 10, 10, 8, 9, 8, 11,
+ 10, 11, 10, 10, 10, 9,
+ 10, 11, 9, 11, 11, 9,
+ 9, 11, 12, 12, 11, 13,
+ 12, 9, 9, 9, 9, 9,
+ 11, 10, 10, 10, 10, 11,
+ 8, 10, 11, 12, 12, 12,
+ 10, 10, 13, 12, 12, 12,
+ 11, 12, 10, 10, 11, 12,
+ 12, 10, 10, 11, 12, 12,
+ 11, 12, 10, 10, 9, 8,
+ 9, 8, 10, 11, 10, 10,
+ 11, 11, 8, 11, 10, 6,
+ 6, 6, 8, 9, 9, 9,
+ 9, 9, 6, 9, 9, 6,
+ 9, 9, 7, 6, 9, 10,
+ 10, 9, 10, 10, 7, 7,
+ 9, 9, 9, 11, 10, 10,
+ 10, 10, 10, 9, 10, 11,
+ 9, 9, 9, 10, 11, 10,
+ 10, 10, 9, 8, 10, 10,
+ 5, 9, 9, 6, 7, 9,
+ 10, 10, 9, 11, 10, 7,
+ 6,
+};
+
+static const uint16_t on2avc_cb4_syms[ON2AVC_CB4_CODES] = {
+ 0x0000, 0x0002, 0x000E, 0x0011, 0x001F, 0x0020,
+ 0x0022, 0x002E, 0x00E0, 0x00E2, 0x00EE, 0x00F1,
+ 0x00FF, 0x0101, 0x010F, 0x0110, 0x0112, 0x011E,
+ 0x0121, 0x012F, 0x01E1, 0x01EF, 0x01F0, 0x01F2,
+ 0x01FE, 0x0200, 0x0202, 0x020E, 0x0211, 0x021F,
+ 0x0220, 0x0222, 0x022E, 0x02E0, 0x02E2, 0x02EE,
+ 0x02F1, 0x02FF, 0x0E00, 0x0E02, 0x0E0E, 0x0E11,
+ 0x0E1F, 0x0E20, 0x0E22, 0x0E2E, 0x0EE0, 0x0EE2,
+ 0x0EEE, 0x0EF1, 0x0EFF, 0x0F01, 0x0F0F, 0x0F10,
+ 0x0F12, 0x0F1E, 0x0F21, 0x0F2F, 0x0FE1, 0x0FEF,
+ 0x0FF0, 0x0FF2, 0x0FFE, 0x1001, 0x100F, 0x1010,
+ 0x1012, 0x101E, 0x1021, 0x102F, 0x10E1, 0x10EF,
+ 0x10F0, 0x10F2, 0x10FE, 0x1100, 0x1102, 0x110E,
+ 0x1111, 0x111F, 0x1120, 0x1122, 0x112E, 0x11E0,
+ 0x11E2, 0x11EE, 0x11F1, 0x11FF, 0x1201, 0x120F,
+ 0x1210, 0x1212, 0x121E, 0x1221, 0x122F, 0x12E1,
+ 0x12EF, 0x12F0, 0x12F2, 0x12FE, 0x1E01, 0x1E0F,
+ 0x1E10, 0x1E12, 0x1E1E, 0x1E21, 0x1E2F, 0x1EE1,
+ 0x1EEF, 0x1EF0, 0x1EF2, 0x1EFE, 0x1F00, 0x1F02,
+ 0x1F0E, 0x1F11, 0x1F1F, 0x1F20, 0x1F22, 0x1F2E,
+ 0x1FE0, 0x1FE2, 0x1FEE, 0x1FF1, 0x1FFF, 0x2000,
+ 0x2002, 0x200E, 0x2011, 0x201F, 0x2020, 0x2022,
+ 0x202E, 0x20E0, 0x20E2, 0x20EE, 0x20F1, 0x20FF,
+ 0x2101, 0x210F, 0x2110, 0x2112, 0x211E, 0x2121,
+ 0x212F, 0x21E1, 0x21EF, 0x21F0, 0x21F2, 0x21FE,
+ 0x2200, 0x2202, 0x220E, 0x2211, 0x221F, 0x2220,
+ 0x2222, 0x222E, 0x22E0, 0x22E2, 0x22EE, 0x22F1,
+ 0x22FF, 0x2E00, 0x2E02, 0x2E0E, 0x2E11, 0x2E1F,
+ 0x2E20, 0x2E22, 0x2E2E, 0x2EE0, 0x2EE2, 0x2EEE,
+ 0x2EF1, 0x2EFF, 0x2F01, 0x2F0F, 0x2F10, 0x2F12,
+ 0x2F1E, 0x2F21, 0x2F2F, 0x2FE1, 0x2FEF, 0x2FF0,
+ 0x2FF2, 0x2FFE, 0xE000, 0xE002, 0xE00E, 0xE011,
+ 0xE01F, 0xE020, 0xE022, 0xE02E, 0xE0E0, 0xE0E2,
+ 0xE0EE, 0xE0F1, 0xE0FF, 0xE101, 0xE10F, 0xE110,
+ 0xE112, 0xE11E, 0xE121, 0xE12F, 0xE1E1, 0xE1EF,
+ 0xE1F0, 0xE1F2, 0xE1FE, 0xE200, 0xE202, 0xE20E,
+ 0xE211, 0xE21F, 0xE220, 0xE222, 0xE22E, 0xE2E0,
+ 0xE2E2, 0xE2EE, 0xE2F1, 0xE2FF, 0xEE00, 0xEE02,
+ 0xEE0E, 0xEE11, 0xEE1F, 0xEE20, 0xEE22, 0xEE2E,
+ 0xEEE0, 0xEEE2, 0xEEEE, 0xEEF1, 0xEEFF, 0xEF01,
+ 0xEF0F, 0xEF10, 0xEF12, 0xEF1E, 0xEF21, 0xEF2F,
+ 0xEFE1, 0xEFEF, 0xEFF0, 0xEFF2, 0xEFFE, 0xF001,
+ 0xF00F, 0xF010, 0xF012, 0xF01E, 0xF021, 0xF02F,
+ 0xF0E1, 0xF0EF, 0xF0F0, 0xF0F2, 0xF0FE, 0xF100,
+ 0xF102, 0xF10E, 0xF111, 0xF11F, 0xF120, 0xF122,
+ 0xF12E, 0xF1E0, 0xF1E2, 0xF1EE, 0xF1F1, 0xF1FF,
+ 0xF201, 0xF20F, 0xF210, 0xF212, 0xF21E, 0xF221,
+ 0xF22F, 0xF2E1, 0xF2EF, 0xF2F0, 0xF2F2, 0xF2FE,
+ 0xFE01, 0xFE0F, 0xFE10, 0xFE12, 0xFE1E, 0xFE21,
+ 0xFE2F, 0xFEE1, 0xFEEF, 0xFEF0, 0xFEF2, 0xFEFE,
+ 0xFF00, 0xFF02, 0xFF0E, 0xFF11, 0xFF1F, 0xFF20,
+ 0xFF22, 0xFF2E, 0xFFE0, 0xFFE2, 0xFFEE, 0xFFF1,
+ 0xFFFF,
+};
+
+#define ON2AVC_CB5_CODES 1201
+static const uint32_t on2avc_cb5_codes[ON2AVC_CB5_CODES] = {
+ 0x00000, 0x000D6, 0x000E2, 0x00044, 0x0009E, 0x0009A,
+ 0x0003A, 0x004E6, 0x00A29, 0x007FE, 0x0024A, 0x004EE,
+ 0x00496, 0x001EE, 0x001C8, 0x008FA, 0x0050F, 0x001EF,
+ 0x00486, 0x00906, 0x00904, 0x0003E, 0x00094, 0x000A6,
+ 0x00046, 0x00061, 0x0012A, 0x0020D, 0x00060, 0x00066,
+ 0x00452, 0x00692, 0x0087E, 0x00242, 0x0050C, 0x008BE,
+ 0x0024C, 0x0045A, 0x0025A, 0x001C6, 0x002EE, 0x00294,
+ 0x006CE, 0x001EC, 0x00492, 0x00690, 0x00055, 0x00474,
+ 0x0063E, 0x00524, 0x04802, 0x04DC5, 0x00DEF, 0x01A62,
+ 0x00E6A, 0x00A7F, 0x027FB, 0x034B5, 0x036C5, 0x00A3A,
+ 0x036C6, 0x0219B, 0x00296, 0x0090F, 0x027FA, 0x028C8,
+ 0x0052A, 0x0127E, 0x0598E, 0x034B4, 0x00C78, 0x0146E,
+ 0x00F5F, 0x00BAA, 0x00432, 0x0FF63, 0x0598F, 0x0091C,
+ 0x00257, 0x0240B, 0x014E6, 0x00E6B, 0x05173, 0x01647,
+ 0x007F9, 0x022F3, 0x04DC6, 0x022F2, 0x0087F, 0x036C7,
+ 0x01AB9, 0x00C79, 0x06944, 0x043C6, 0x0043E, 0x00218,
+ 0x031C4, 0x014E5, 0x0093E, 0x0FF62, 0x3FAE0, 0x00328,
+ 0x00228, 0x01428, 0x03FEA, 0x007A3, 0x034B3, 0x0D23B,
+ 0x00B29, 0x01AB8, 0x028C7, 0x0598D, 0x00B28, 0x0149B,
+ 0x0149A, 0x008EE, 0x027F9, 0x07FC0, 0x00CFE, 0x0025E,
+ 0x01CBB, 0x026EF, 0x00512, 0x0297B, 0x05172, 0x00D36,
+ 0x00FCA, 0x01EA5, 0x00D86, 0x01FC5, 0x031C3, 0x02CD6,
+ 0x00276, 0x01F8A, 0x04801, 0x00B2A, 0x00329, 0x00FC9,
+ 0x03F0C, 0x00D35, 0x01971, 0x04DC4, 0x036C4, 0x00A4F,
+ 0x00FEA, 0x01FC4, 0x0122A, 0x00058, 0x001CA, 0x0013A,
+ 0x0005E, 0x00054, 0x0053E, 0x0039E, 0x006C6, 0x00284,
+ 0x001C2, 0x0087A, 0x0020E, 0x0050E, 0x006F2, 0x00288,
+ 0x0029E, 0x00457, 0x006F9, 0x005D3, 0x00248, 0x008F7,
+ 0x00068, 0x0069D, 0x00497, 0x0005F, 0x0091D, 0x00738,
+ 0x00057, 0x0005A, 0x00A3E, 0x009CF, 0x00D3E, 0x00D87,
+ 0x00C6B, 0x00CBD, 0x003F6, 0x00A74, 0x00C6E, 0x0049C,
+ 0x012FE, 0x0137F, 0x00DBB, 0x010DA, 0x00CAB, 0x0127F,
+ 0x00056, 0x00A2A, 0x0083E, 0x00040, 0x00BAE, 0x00BA2,
+ 0x0012E, 0x006F0, 0x0096E, 0x0022C, 0x00FDE, 0x011EB,
+ 0x01ABE, 0x007EA, 0x014E7, 0x011F2, 0x00256, 0x009FC,
+ 0x0297C, 0x01C13, 0x006F4, 0x00B26, 0x0144E, 0x021EE,
+ 0x001C0, 0x00707, 0x00B3F, 0x00244, 0x00E0B, 0x02CD8,
+ 0x034B6, 0x00B2B, 0x00914, 0x027FD, 0x028CA, 0x01396,
+ 0x014EB, 0x01972, 0x01B71, 0x013BE, 0x00D9A, 0x00D3F,
+ 0x009C9, 0x014EA, 0x031C6, 0x022F5, 0x027FC, 0x0240D,
+ 0x0297D, 0x006F5, 0x02CD7, 0x0396A, 0x0018C, 0x04DC7,
+ 0x028CB, 0x007E7, 0x0D23C, 0x043C8, 0x008FC, 0x00C7A,
+ 0x031C7, 0x018EB, 0x0396B, 0x0D23D, 0x036C9, 0x01973,
+ 0x018EA, 0x07FC1, 0x08FD8, 0x01673, 0x0067C, 0x027FE,
+ 0x036C8, 0x004BE, 0x08FD9, 0x07FC2, 0x009B6, 0x00148,
+ 0x026F0, 0x05174, 0x0071C, 0x07279, 0x08FD7, 0x005D4,
+ 0x00E0A, 0x01A63, 0x01F8B, 0x0114E, 0x01ABA, 0x05990,
+ 0x043C7, 0x01BEE, 0x3FAE1, 0x1FE94, 0x01CBE, 0x006F3,
+ 0x018E7, 0x0240C, 0x006FA, 0x03967, 0x08FD6, 0x0045B,
+ 0x00DBA, 0x01A65, 0x03969, 0x00CFF, 0x0067E, 0x026F1,
+ 0x028C9, 0x022F4, 0x018D2, 0x01B70, 0x011EA, 0x00BBF,
+ 0x00B3E, 0x0144D, 0x00D3D, 0x0146F, 0x01A64, 0x01FFF,
+ 0x01B6F, 0x03968, 0x024EB, 0x00656, 0x031C5, 0x0727A,
+ 0x0003C, 0x00D22, 0x00D99, 0x0021A, 0x00706, 0x007EE,
+ 0x0013E, 0x00CBC, 0x01C12, 0x01A66, 0x0022E, 0x00E77,
+ 0x01672, 0x004D8, 0x006D3, 0x01CBF, 0x01ABB, 0x008BF,
+ 0x00E76, 0x01BEF, 0x01FC6, 0x001B2, 0x00736, 0x008FB,
+ 0x0021D, 0x000D7, 0x04804, 0x06948, 0x00D37, 0x0396E,
+ 0x06949, 0x0120A, 0x03F0F, 0x1437E, 0x043CB, 0x028D0,
+ 0x0A2BE, 0x08FDD, 0x05996, 0x022F6, 0x1FE96, 0x0FF64,
+ 0x026F2, 0x028CF, 0x04DCB, 0x03F0E, 0x00A3F, 0x05178,
+ 0x05995, 0x00BA3, 0x00A4A, 0x07FC8, 0x0727E, 0x007AA,
+ 0x003D0, 0x0599A, 0x02CDB, 0x034BB, 0x07FC9, 0x0D261,
+ 0x04805, 0x04806, 0x0727F, 0x022F7, 0x018FE, 0x0240F,
+ 0x02CDA, 0x031CB, 0x04DCC, 0x034BA, 0x036CB, 0x0052B,
+ 0x05997, 0x036CE, 0x00907, 0x08FDF, 0x043CD, 0x00E7E,
+ 0x0517A, 0x04DCD, 0x0197E, 0x0A2BF, 0x028D1, 0x04807,
+ 0x028D2, 0x04808, 0x0D262, 0x024ED, 0x01ABF, 0x072C0,
+ 0x1437F, 0x034BE, 0x05179, 0x144F0, 0x072C1, 0x029C1,
+ 0x08FDE, 0x043CC, 0x023AE, 0x00A3B, 0x1FE97, 0x08FE1,
+ 0x0142A, 0x006AC, 0x04809, 0x024EE, 0x00C7B, 0x3FAE3,
+ 0x08FE2, 0x01F8F, 0x0A2C0, 0x023AF, 0x08FE3, 0x02416,
+ 0x072C2, 0x0FF65, 0x00FCB, 0x08FE0, 0x144F1, 0x01EA6,
+ 0x00590, 0x04DCE, 0x0396F, 0x01FC7, 0x05991, 0x3FAE2,
+ 0x0096C, 0x00657, 0x034B8, 0x05992, 0x0240E, 0x0A2BC,
+ 0x08FDA, 0x0114F, 0x0727C, 0x06945, 0x05175, 0x01B72,
+ 0x0727B, 0x07FC3, 0x01472, 0x0A2BB, 0x0D23E, 0x00CBE,
+ 0x00636, 0x034B7, 0x043C9, 0x008AA, 0x08FDB, 0x0D23F,
+ 0x02852, 0x0727D, 0x05994, 0x00E3E, 0x031CA, 0x06947,
+ 0x04DC8, 0x02CD9, 0x1FE95, 0x0D260, 0x028CD, 0x024EC,
+ 0x04803, 0x07FC4, 0x01976, 0x028CC, 0x05993, 0x07FC5,
+ 0x027FF, 0x06946, 0x03FEB, 0x03F0D, 0x0096D, 0x08FDC,
+ 0x04DC9, 0x0097E, 0x003D3, 0x0A2BD, 0x0286E, 0x07FC6,
+ 0x07FC7, 0x034B9, 0x029C0, 0x01F8E, 0x04DCA, 0x05177,
+ 0x01977, 0x03FEE, 0x0297E, 0x028CE, 0x036CA, 0x05176,
+ 0x0297F, 0x00596, 0x02853, 0x043CA, 0x0090E, 0x144FA,
+ 0x0D26A, 0x008AB, 0x000CE, 0x072C3, 0x034BF, 0x02417,
+ 0x3FAF0, 0x3FAEF, 0x026F3, 0x1FEA0, 0x3FAF1, 0x1FE9F,
+ 0x0D269, 0x0FF6A, 0x1FE9D, 0x029C6, 0x3FAEE, 0x1FE9E,
+ 0x036CF, 0x001AA, 0x0480E, 0x0A2C7, 0x000A0, 0x07FCE,
+ 0x3FAF4, 0x008F8, 0x3FAF5, 0x144FB, 0x00A16, 0x024EF,
+ 0x04DD3, 0x0694E, 0x1FEA2, 0x3FAF7, 0x3FAF6, 0x0D26B,
+ 0x04DD2, 0x3FAF2, 0x1FEA1, 0x08FE6, 0x0122B, 0x08FE7,
+ 0x0480F, 0x00C6F, 0x0FF6B, 0x3FAF3, 0x008EF, 0x00C7E,
+ 0x3FAF8, 0x1FEA4, 0x00DF6, 0x00362, 0x0694F, 0x0599B,
+ 0x0142B, 0x1FEA6, 0x1FEA5, 0x03FEF, 0x07FCF, 0x1FEA7,
+ 0x3FAF9, 0x029C7, 0x0D26E, 0x144FE, 0x01C3E, 0x1FEA3,
+ 0x0A2CA, 0x01CE6, 0x0049E, 0x043CF, 0x04EFE, 0x0036B,
+ 0x3FAFE, 0x11F32, 0x01EAE, 0x1FEAA, 0x0D26F, 0x049D2,
+ 0x02EAE, 0x0356A, 0x08FEA, 0x07ABE, 0x08FEB, 0x3FAFF,
+ 0x1FEAB, 0x0292E, 0x144FF, 0x3FAFA, 0x08FE8, 0x01EA7,
+ 0x0B27A, 0x0A2CB, 0x0164E, 0x3FAFB, 0x08FE9, 0x021EF,
+ 0x00A76, 0x1FE9A, 0x144F2, 0x029C3, 0x3FAE8, 0x3FAE7,
+ 0x014EE, 0x03F12, 0x0D264, 0x08FE4, 0x0FF67, 0x1FE9B,
+ 0x144F3, 0x0FF66, 0x0D263, 0x3FAE5, 0x3FAE4, 0x029C2,
+ 0x031FE, 0x0A2C1, 0x1FE98, 0x01FD6, 0x3FAE6, 0x1FE99,
+ 0x01473, 0x00D9B, 0x144F5, 0x144F4, 0x00FD2, 0x0036A,
+ 0x043CE, 0x03F13, 0x0517B, 0x0D267, 0x144F6, 0x01756,
+ 0x0A2C2, 0x144F8, 0x144F7, 0x0480A, 0x0FF68, 0x0D265,
+ 0x01B73, 0x0D266, 0x3FAE9, 0x01A67, 0x00493, 0x0694B,
+ 0x0694A, 0x00082, 0x03F7E, 0x04DCF, 0x009B7, 0x3FAEB,
+ 0x1FE9C, 0x0071D, 0x028D3, 0x0D268, 0x0A2C5, 0x0A2C6,
+ 0x3FAED, 0x3FAEC, 0x08FE5, 0x07FCA, 0x3FAEA, 0x144F9,
+ 0x0A2C3, 0x00D3C, 0x07FCB, 0x0480B, 0x009CA, 0x0FF69,
+ 0x0A2C4, 0x0091E, 0x007EB, 0x1FE85, 0x0FF56, 0x0091F,
+ 0x0019E, 0x0693A, 0x0593E, 0x020FC, 0x1FE86, 0x0FF57,
+ 0x027F4, 0x0146A, 0x04BFC, 0x0CBF9, 0x0CBF8, 0x1FE83,
+ 0x3F7F5, 0x08F9E, 0x3F7F6, 0x1FE84, 0x036C0, 0x00098,
+ 0x0593C, 0x071F9, 0x0006E, 0x0593F, 0x03963, 0x00A3C,
+ 0x13BFD, 0x1FE89, 0x007F2, 0x00FD3, 0x03F08, 0x03D5E,
+ 0x034A9, 0x13BFF, 0x13BFE, 0x071FA, 0x011E8, 0x1FE87,
+ 0x3F7F7, 0x0FF58, 0x01B66, 0x07FB8, 0x05168, 0x0070E,
+ 0x0FF59, 0x1FE88, 0x009B3, 0x00BBC, 0x1FE8B, 0x3F7F8,
+ 0x00FE6, 0x004FC, 0x0CBFC, 0x03FE6, 0x022F0, 0x1FE8C,
+ 0x0CBFD, 0x01CE7, 0x08F9F, 0x0FF5A, 0x071FD, 0x1FE8A,
+ 0x071FB, 0x14378, 0x01AB4, 0x0CBFB, 0x0CBFA, 0x036C1,
+ 0x0037E, 0x05980, 0x071FC, 0x00D5E, 0x3F7FC, 0x08FD0,
+ 0x014EF, 0x3F7FE, 0x3F7FD, 0x01CFE, 0x01FBE, 0x05982,
+ 0x1437A, 0x04BFD, 0x1FE8E, 0x3F7FF, 0x071FF, 0x0FF5B,
+ 0x1FE8D, 0x3F7F9, 0x14379, 0x047F7, 0x05981, 0x071FE,
+ 0x014E2, 0x3F7FB, 0x3F7FA, 0x02CCE, 0x0037F, 0x0A27E,
+ 0x3D5FA, 0x02CCC, 0x1FE80, 0x1FD7E, 0x01496, 0x018E4,
+ 0x3D5FB, 0x05164, 0x070FD, 0x3D5FC, 0x11F33, 0x0277E,
+ 0x0FF54, 0x08F98, 0x07FB6, 0x070FC, 0x026E8, 0x07FB7,
+ 0x034A6, 0x0356B, 0x3D5F9, 0x3D5F8, 0x034A8, 0x0114C,
+ 0x3F7F0, 0x3D5FF, 0x00C74, 0x0024D, 0x05167, 0x049D3,
+ 0x0292F, 0x08F9C, 0x3F7F1, 0x01CB6, 0x03962, 0x070FF,
+ 0x08F9D, 0x08F9A, 0x3D5FD, 0x0A2B0, 0x024E8, 0x070FE,
+ 0x3D5FE, 0x01A5E, 0x00392, 0x08F9B, 0x05166, 0x00099,
+ 0x06939, 0x06938, 0x009B2, 0x0C7FE, 0x3F7F4, 0x007F7,
+ 0x011D6, 0x02EAF, 0x028BE, 0x071F8, 0x0C7FF, 0x1FE82,
+ 0x047F6, 0x06936, 0x3F7F3, 0x3F7F2, 0x1FE81, 0x026EA,
+ 0x0C7FC, 0x0B27B, 0x009FA, 0x0C7FD, 0x13BFC, 0x007A8,
+ 0x000D4, 0x08FD1, 0x0D234, 0x00D34, 0x07274, 0x05988,
+ 0x00F5C, 0x0516D, 0x0516E, 0x0516C, 0x036C3, 0x0A2B4,
+ 0x0D235, 0x036C2, 0x034AC, 0x0D233, 0x07FBA, 0x034AB,
+ 0x0A2B3, 0x1437D, 0x1437C, 0x00B3B, 0x07273, 0x0516B,
+ 0x00D84, 0x009FB, 0x0693F, 0x0598A, 0x007F8, 0x005D6,
+ 0x047FB, 0x024EA, 0x026EC, 0x0516F, 0x047FC, 0x031A7,
+ 0x01397, 0x026ED, 0x02975, 0x02CD1, 0x034AD, 0x07275,
+ 0x027F6, 0x05989, 0x043C1, 0x0693E, 0x00454, 0x034AE,
+ 0x043C2, 0x007F6, 0x0A2B7, 0x07FBB, 0x02408, 0x0598B,
+ 0x047FD, 0x01B6A, 0x04DC1, 0x0FF5F, 0x07FBC, 0x01B6B,
+ 0x07277, 0x0D236, 0x020FD, 0x01B68, 0x0A2B5, 0x0FF5E,
+ 0x02976, 0x043C3, 0x02977, 0x0A2B6, 0x012DE, 0x07276,
+ 0x03FE9, 0x01B69, 0x00A4C, 0x0FF60, 0x1FE93, 0x013BC,
+ 0x00592, 0x02978, 0x02CD3, 0x00D8E, 0x0D237, 0x05170,
+ 0x01FC1, 0x028C2, 0x06941, 0x0D238, 0x07278, 0x034AF,
+ 0x06940, 0x00E5E, 0x08FD2, 0x07FBD, 0x020FE, 0x007E6,
+ 0x043C4, 0x02CD2, 0x0166E, 0x0CBFF, 0x0CBFE, 0x00A5C,
+ 0x005D0, 0x026EB, 0x047F8, 0x01F88, 0x1FE90, 0x1FE8F,
+ 0x00C68, 0x021EC, 0x0A2B1, 0x0D230, 0x04BFE, 0x0693B,
+ 0x028BF, 0x028C0, 0x07270, 0x0FF5C, 0x00E08, 0x00360,
+ 0x0436C, 0x05983, 0x009BE, 0x0FF5D, 0x1FE91, 0x01A60,
+ 0x04BFF, 0x0A2B2, 0x0436E, 0x03F0A, 0x07FB9, 0x05984,
+ 0x01FC0, 0x1FE92, 0x1437B, 0x01646, 0x03F09, 0x0693C,
+ 0x027F5, 0x047F9, 0x034AA, 0x0D231, 0x0436D, 0x01AB6,
+ 0x047FA, 0x07271, 0x00CFA, 0x006CF, 0x07272, 0x05986,
+ 0x00B3A, 0x00654, 0x028C1, 0x0436F, 0x02CD0, 0x03FE8,
+ 0x05987, 0x043C0, 0x0146B, 0x02974, 0x031A6, 0x02CCF,
+ 0x03964, 0x04DC0, 0x0516A, 0x05985, 0x05169, 0x02406,
+ 0x003D6, 0x0D232, 0x0693D, 0x0005C, 0x006F6, 0x0086E,
+ 0x00062, 0x0005B, 0x006F1, 0x007E0, 0x00D98, 0x00BBE,
+ 0x00E72, 0x00D8F, 0x004DA, 0x0137B, 0x0137A, 0x00386,
+ 0x00A7E, 0x00C6A, 0x00CBA, 0x00F5E, 0x00F5D, 0x013BD,
+ 0x00064, 0x009CE, 0x008EC, 0x0003B, 0x00F56, 0x00CAA,
+ 0x00246, 0x008ED, 0x0086C, 0x001ED, 0x00C77, 0x0240A,
+ 0x01B6D, 0x0086F, 0x02CD5, 0x01FC3, 0x0073E, 0x005D2,
+ 0x01970, 0x014E4, 0x00456, 0x00B22, 0x0114D, 0x02198,
+ 0x00138, 0x0069C, 0x00737, 0x0020C, 0x00A4E, 0x04DC2,
+ 0x018E6, 0x00E1E, 0x006D2, 0x047FF, 0x02979, 0x01FFE,
+ 0x04800, 0x021ED, 0x028C6, 0x00917, 0x01671, 0x01CFF,
+ 0x00CFB, 0x00FE7, 0x00A1A, 0x0146D, 0x01670, 0x01B6E,
+ 0x0137E, 0x006D1, 0x01FFD, 0x028C5, 0x00176, 0x05171,
+ 0x0219A, 0x0023C, 0x0A2BA, 0x043C5, 0x006F8, 0x006DF,
+ 0x01EA4, 0x01CBA, 0x027F8, 0x0FF61, 0x08FD5, 0x0177B,
+ 0x02199, 0x0D23A, 0x03966, 0x0297A, 0x00A38, 0x0177A,
+ 0x01A61, 0x00597, 0x07FBF, 0x04DC3, 0x007F4, 0x00196,
+ 0x034B0, 0x03F0B, 0x008F6, 0x0598C, 0x08FD3, 0x003D2,
+ 0x006D0, 0x01FC2, 0x031C1, 0x026EE, 0x0A2B9, 0x0D239,
+ 0x0175F, 0x0175E, 0x031C0, 0x06942, 0x01FF6, 0x00A3D,
+ 0x0166F, 0x027F7, 0x009C8, 0x0A2B8, 0x07FBE, 0x00734,
+ 0x00FC6, 0x03965, 0x06943, 0x010CF, 0x006DE, 0x02CD4,
+ 0x08FD4, 0x034B2, 0x01CB8, 0x028C3, 0x01FFC, 0x0041E,
+ 0x0146C, 0x01B6C, 0x00C76, 0x00B3C, 0x010CE, 0x022F1,
+ 0x0144C, 0x012DF, 0x01436, 0x0073A, 0x034B1, 0x031C2,
+ 0x00042, 0x00DEE, 0x00B3D, 0x001CC, 0x00A17, 0x007E8,
+ 0x0021C, 0x00A28, 0x01CB9, 0x02409, 0x00916, 0x020FF,
+ 0x047FE, 0x00726, 0x00238, 0x011E9, 0x01AB7, 0x0071E,
+ 0x00FC8, 0x028C4, 0x00D85, 0x00239, 0x008EA, 0x007A2,
+ 0x0012C,
+};
+
+static const uint8_t on2avc_cb5_bits[ON2AVC_CB5_CODES] = {
+ 1, 8, 8, 7, 8, 8,
+ 6, 11, 12, 11, 10, 11,
+ 11, 9, 9, 12, 11, 9,
+ 11, 12, 12, 6, 8, 8,
+ 7, 7, 9, 10, 7, 7,
+ 11, 11, 12, 10, 11, 12,
+ 10, 11, 10, 9, 10, 10,
+ 11, 9, 11, 11, 7, 11,
+ 11, 11, 15, 15, 12, 13,
+ 12, 12, 14, 14, 14, 12,
+ 14, 14, 10, 12, 14, 14,
+ 11, 13, 15, 14, 12, 13,
+ 12, 12, 11, 16, 15, 12,
+ 10, 14, 13, 12, 15, 13,
+ 11, 14, 15, 14, 12, 14,
+ 13, 12, 15, 15, 11, 10,
+ 14, 13, 12, 16, 18, 10,
+ 10, 13, 14, 11, 14, 16,
+ 12, 13, 14, 15, 12, 13,
+ 13, 12, 14, 15, 12, 10,
+ 13, 14, 11, 14, 15, 12,
+ 12, 13, 12, 13, 14, 14,
+ 10, 13, 15, 12, 10, 12,
+ 14, 12, 13, 15, 14, 12,
+ 12, 13, 13, 7, 9, 9,
+ 7, 7, 11, 10, 11, 10,
+ 9, 12, 10, 11, 11, 10,
+ 10, 11, 11, 11, 10, 12,
+ 7, 11, 11, 7, 12, 11,
+ 7, 7, 12, 12, 12, 12,
+ 12, 12, 10, 12, 12, 11,
+ 13, 13, 12, 13, 12, 13,
+ 7, 12, 12, 7, 12, 12,
+ 9, 11, 12, 10, 12, 13,
+ 13, 11, 13, 13, 10, 12,
+ 14, 13, 11, 12, 13, 14,
+ 9, 11, 12, 10, 12, 14,
+ 14, 12, 12, 14, 14, 13,
+ 13, 13, 13, 13, 12, 12,
+ 12, 13, 14, 14, 14, 14,
+ 14, 11, 14, 14, 9, 15,
+ 14, 11, 16, 15, 12, 12,
+ 14, 13, 14, 16, 14, 13,
+ 13, 15, 16, 13, 11, 14,
+ 14, 11, 16, 15, 12, 9,
+ 14, 15, 11, 15, 16, 11,
+ 12, 13, 13, 13, 13, 15,
+ 15, 13, 18, 17, 13, 11,
+ 13, 14, 11, 14, 16, 11,
+ 12, 13, 14, 12, 11, 14,
+ 14, 14, 13, 13, 13, 12,
+ 12, 13, 12, 13, 13, 13,
+ 13, 14, 14, 11, 14, 15,
+ 6, 12, 12, 10, 11, 11,
+ 9, 12, 13, 13, 10, 12,
+ 13, 11, 11, 13, 13, 12,
+ 12, 13, 13, 9, 11, 12,
+ 10, 8, 15, 15, 12, 14,
+ 15, 13, 14, 17, 15, 14,
+ 16, 16, 15, 14, 17, 16,
+ 14, 14, 15, 14, 12, 15,
+ 15, 12, 12, 15, 15, 11,
+ 10, 15, 14, 14, 15, 16,
+ 15, 15, 15, 14, 13, 14,
+ 14, 14, 15, 14, 14, 11,
+ 15, 14, 12, 16, 15, 12,
+ 15, 15, 13, 16, 14, 15,
+ 14, 15, 16, 14, 13, 15,
+ 17, 14, 15, 17, 15, 14,
+ 16, 15, 14, 12, 17, 16,
+ 13, 11, 15, 14, 12, 18,
+ 16, 13, 16, 14, 16, 14,
+ 15, 16, 12, 16, 17, 13,
+ 11, 15, 14, 13, 15, 18,
+ 12, 11, 14, 15, 14, 16,
+ 16, 13, 15, 15, 15, 13,
+ 15, 15, 13, 16, 16, 12,
+ 11, 14, 15, 12, 16, 16,
+ 14, 15, 15, 12, 14, 15,
+ 15, 14, 17, 16, 14, 14,
+ 15, 15, 13, 14, 15, 15,
+ 14, 15, 14, 14, 12, 16,
+ 15, 12, 10, 16, 14, 15,
+ 15, 14, 14, 13, 15, 15,
+ 13, 14, 14, 14, 14, 15,
+ 14, 11, 14, 15, 12, 17,
+ 16, 12, 8, 15, 14, 14,
+ 18, 18, 14, 17, 18, 17,
+ 16, 16, 17, 14, 18, 17,
+ 14, 9, 15, 16, 8, 15,
+ 18, 12, 18, 17, 12, 14,
+ 15, 15, 17, 18, 18, 16,
+ 15, 18, 17, 16, 13, 16,
+ 15, 12, 16, 18, 12, 12,
+ 18, 17, 12, 10, 15, 15,
+ 13, 17, 17, 14, 15, 17,
+ 18, 14, 16, 17, 13, 17,
+ 16, 13, 11, 15, 15, 10,
+ 18, 17, 13, 17, 16, 15,
+ 14, 14, 16, 15, 16, 18,
+ 17, 14, 17, 18, 16, 13,
+ 16, 16, 13, 18, 16, 14,
+ 12, 17, 17, 14, 18, 18,
+ 13, 14, 16, 16, 16, 17,
+ 17, 16, 16, 18, 18, 14,
+ 14, 16, 17, 13, 18, 17,
+ 13, 12, 17, 17, 12, 10,
+ 15, 14, 15, 16, 17, 13,
+ 16, 17, 17, 15, 16, 16,
+ 13, 16, 18, 13, 11, 15,
+ 15, 8, 14, 15, 12, 18,
+ 17, 11, 14, 16, 16, 16,
+ 18, 18, 16, 15, 18, 17,
+ 16, 12, 15, 15, 12, 16,
+ 16, 12, 11, 17, 16, 12,
+ 9, 15, 15, 14, 17, 16,
+ 14, 13, 15, 16, 16, 17,
+ 18, 16, 18, 17, 14, 8,
+ 15, 15, 7, 15, 14, 12,
+ 17, 17, 11, 12, 14, 14,
+ 14, 17, 17, 15, 13, 17,
+ 18, 16, 13, 15, 15, 11,
+ 16, 17, 12, 12, 17, 18,
+ 12, 11, 16, 14, 14, 17,
+ 16, 13, 16, 16, 15, 17,
+ 15, 17, 13, 16, 16, 14,
+ 10, 15, 15, 12, 18, 16,
+ 13, 18, 18, 13, 13, 15,
+ 17, 15, 17, 18, 15, 16,
+ 17, 18, 17, 15, 15, 15,
+ 13, 18, 18, 14, 10, 16,
+ 18, 14, 17, 17, 13, 13,
+ 18, 15, 15, 18, 17, 14,
+ 16, 16, 15, 15, 14, 15,
+ 14, 14, 18, 18, 14, 13,
+ 18, 18, 12, 10, 15, 15,
+ 14, 16, 18, 13, 14, 15,
+ 16, 16, 18, 16, 14, 15,
+ 18, 13, 10, 16, 15, 8,
+ 15, 15, 12, 16, 18, 11,
+ 13, 14, 14, 15, 16, 17,
+ 15, 15, 18, 18, 17, 14,
+ 16, 16, 12, 16, 17, 11,
+ 8, 16, 16, 12, 15, 15,
+ 12, 15, 15, 15, 14, 16,
+ 16, 14, 14, 16, 15, 14,
+ 16, 17, 17, 12, 15, 15,
+ 12, 12, 15, 15, 11, 11,
+ 15, 14, 14, 15, 15, 14,
+ 13, 14, 14, 14, 14, 15,
+ 14, 15, 15, 15, 11, 14,
+ 15, 11, 16, 15, 14, 15,
+ 15, 13, 15, 16, 15, 13,
+ 15, 16, 14, 13, 16, 16,
+ 14, 15, 14, 16, 13, 15,
+ 14, 13, 12, 16, 17, 13,
+ 11, 14, 14, 12, 16, 15,
+ 13, 14, 15, 16, 15, 14,
+ 15, 12, 16, 15, 14, 11,
+ 15, 14, 13, 16, 16, 12,
+ 11, 14, 15, 13, 17, 17,
+ 12, 14, 16, 16, 15, 15,
+ 14, 14, 15, 16, 12, 10,
+ 15, 15, 12, 16, 17, 13,
+ 15, 16, 15, 14, 15, 15,
+ 13, 17, 17, 13, 14, 15,
+ 14, 15, 14, 16, 15, 13,
+ 15, 15, 12, 11, 15, 15,
+ 12, 11, 14, 15, 14, 14,
+ 15, 15, 13, 14, 14, 14,
+ 14, 15, 15, 15, 15, 14,
+ 10, 16, 15, 7, 11, 12,
+ 7, 7, 11, 11, 12, 12,
+ 12, 12, 11, 13, 13, 10,
+ 12, 12, 12, 12, 12, 13,
+ 7, 12, 12, 6, 12, 12,
+ 10, 12, 12, 9, 12, 14,
+ 13, 12, 14, 13, 11, 11,
+ 13, 13, 11, 12, 13, 14,
+ 9, 11, 11, 10, 12, 15,
+ 13, 12, 11, 15, 14, 13,
+ 15, 14, 14, 12, 13, 13,
+ 12, 12, 12, 13, 13, 13,
+ 13, 11, 13, 14, 9, 15,
+ 14, 10, 16, 15, 11, 11,
+ 13, 13, 14, 16, 16, 13,
+ 14, 16, 14, 14, 12, 13,
+ 13, 11, 15, 15, 11, 9,
+ 14, 14, 12, 15, 16, 10,
+ 11, 13, 14, 14, 16, 16,
+ 13, 13, 14, 15, 13, 12,
+ 13, 14, 12, 16, 15, 11,
+ 12, 14, 15, 13, 11, 14,
+ 16, 14, 13, 14, 13, 11,
+ 13, 13, 12, 12, 13, 14,
+ 13, 13, 13, 11, 14, 14,
+ 7, 12, 12, 9, 12, 11,
+ 10, 12, 13, 14, 12, 14,
+ 15, 11, 10, 13, 13, 11,
+ 12, 14, 12, 10, 12, 11,
+ 9,
+};
+
+static const uint16_t on2avc_cb5_syms[ON2AVC_CB5_CODES] = {
+ 0x0000, 0x0002, 0x000E, 0x0011, 0x0013, 0x001D,
+ 0x001F, 0x0020, 0x0022, 0x002E, 0x0031, 0x0033,
+ 0x003D, 0x003F, 0x00D1, 0x00D3, 0x00DD, 0x00DF,
+ 0x00E0, 0x00E2, 0x00EE, 0x00F1, 0x00F3, 0x00FD,
+ 0x00FF, 0x0101, 0x0103, 0x010D, 0x010F, 0x0110,
+ 0x0112, 0x011E, 0x0121, 0x0123, 0x012D, 0x012F,
+ 0x0130, 0x0132, 0x013E, 0x01D0, 0x01D2, 0x01DE,
+ 0x01E1, 0x01E3, 0x01ED, 0x01EF, 0x01F0, 0x01F2,
+ 0x01FE, 0x0200, 0x0202, 0x020E, 0x0211, 0x0213,
+ 0x021D, 0x021F, 0x0220, 0x0222, 0x022E, 0x0231,
+ 0x0233, 0x023D, 0x023F, 0x02D1, 0x02D3, 0x02DD,
+ 0x02DF, 0x02E0, 0x02E2, 0x02EE, 0x02F1, 0x02F3,
+ 0x02FD, 0x02FF, 0x0301, 0x0303, 0x030D, 0x030F,
+ 0x0310, 0x0312, 0x031E, 0x0321, 0x0323, 0x032D,
+ 0x032F, 0x0330, 0x0332, 0x033E, 0x03D0, 0x03D2,
+ 0x03DE, 0x03E1, 0x03E3, 0x03ED, 0x03EF, 0x03F0,
+ 0x03F2, 0x03FE, 0x0D01, 0x0D03, 0x0D0D, 0x0D0F,
+ 0x0D10, 0x0D12, 0x0D1E, 0x0D21, 0x0D23, 0x0D2D,
+ 0x0D2F, 0x0D30, 0x0D32, 0x0D3E, 0x0DD0, 0x0DD2,
+ 0x0DDE, 0x0DE1, 0x0DE3, 0x0DED, 0x0DEF, 0x0DF0,
+ 0x0DF2, 0x0DFE, 0x0E00, 0x0E02, 0x0E0E, 0x0E11,
+ 0x0E13, 0x0E1D, 0x0E1F, 0x0E20, 0x0E22, 0x0E2E,
+ 0x0E31, 0x0E33, 0x0E3D, 0x0E3F, 0x0ED1, 0x0ED3,
+ 0x0EDD, 0x0EDF, 0x0EE0, 0x0EE2, 0x0EEE, 0x0EF1,
+ 0x0EF3, 0x0EFD, 0x0EFF, 0x0F01, 0x0F03, 0x0F0D,
+ 0x0F0F, 0x0F10, 0x0F12, 0x0F1E, 0x0F21, 0x0F23,
+ 0x0F2D, 0x0F2F, 0x0F30, 0x0F32, 0x0F3E, 0x0FD0,
+ 0x0FD2, 0x0FDE, 0x0FE1, 0x0FE3, 0x0FED, 0x0FEF,
+ 0x0FF0, 0x0FF2, 0x0FFE, 0x1001, 0x1003, 0x100D,
+ 0x100F, 0x1010, 0x1012, 0x101E, 0x1021, 0x1023,
+ 0x102D, 0x102F, 0x1030, 0x1032, 0x103E, 0x10D0,
+ 0x10D2, 0x10DE, 0x10E1, 0x10E3, 0x10ED, 0x10EF,
+ 0x10F0, 0x10F2, 0x10FE, 0x1100, 0x1102, 0x110E,
+ 0x1111, 0x1113, 0x111D, 0x111F, 0x1120, 0x1122,
+ 0x112E, 0x1131, 0x1133, 0x113D, 0x113F, 0x11D1,
+ 0x11D3, 0x11DD, 0x11DF, 0x11E0, 0x11E2, 0x11EE,
+ 0x11F1, 0x11F3, 0x11FD, 0x11FF, 0x1201, 0x1203,
+ 0x120D, 0x120F, 0x1210, 0x1212, 0x121E, 0x1221,
+ 0x1223, 0x122D, 0x122F, 0x1230, 0x1232, 0x123E,
+ 0x12D0, 0x12D2, 0x12DE, 0x12E1, 0x12E3, 0x12ED,
+ 0x12EF, 0x12F0, 0x12F2, 0x12FE, 0x1300, 0x1302,
+ 0x130E, 0x1311, 0x1313, 0x131D, 0x131F, 0x1320,
+ 0x1322, 0x132E, 0x1331, 0x1333, 0x133D, 0x133F,
+ 0x13D1, 0x13D3, 0x13DD, 0x13DF, 0x13E0, 0x13E2,
+ 0x13EE, 0x13F1, 0x13F3, 0x13FD, 0x13FF, 0x1D00,
+ 0x1D02, 0x1D0E, 0x1D11, 0x1D13, 0x1D1D, 0x1D1F,
+ 0x1D20, 0x1D22, 0x1D2E, 0x1D31, 0x1D33, 0x1D3D,
+ 0x1D3F, 0x1DD1, 0x1DD3, 0x1DDD, 0x1DDF, 0x1DE0,
+ 0x1DE2, 0x1DEE, 0x1DF1, 0x1DF3, 0x1DFD, 0x1DFF,
+ 0x1E01, 0x1E03, 0x1E0D, 0x1E0F, 0x1E10, 0x1E12,
+ 0x1E1E, 0x1E21, 0x1E23, 0x1E2D, 0x1E2F, 0x1E30,
+ 0x1E32, 0x1E3E, 0x1ED0, 0x1ED2, 0x1EDE, 0x1EE1,
+ 0x1EE3, 0x1EED, 0x1EEF, 0x1EF0, 0x1EF2, 0x1EFE,
+ 0x1F00, 0x1F02, 0x1F0E, 0x1F11, 0x1F13, 0x1F1D,
+ 0x1F1F, 0x1F20, 0x1F22, 0x1F2E, 0x1F31, 0x1F33,
+ 0x1F3D, 0x1F3F, 0x1FD1, 0x1FD3, 0x1FDD, 0x1FDF,
+ 0x1FE0, 0x1FE2, 0x1FEE, 0x1FF1, 0x1FF3, 0x1FFD,
+ 0x1FFF, 0x2000, 0x2002, 0x200E, 0x2011, 0x2013,
+ 0x201D, 0x201F, 0x2020, 0x2022, 0x202E, 0x2031,
+ 0x2033, 0x203D, 0x203F, 0x20D1, 0x20D3, 0x20DD,
+ 0x20DF, 0x20E0, 0x20E2, 0x20EE, 0x20F1, 0x20F3,
+ 0x20FD, 0x20FF, 0x2101, 0x2103, 0x210D, 0x210F,
+ 0x2110, 0x2112, 0x211E, 0x2121, 0x2123, 0x212D,
+ 0x212F, 0x2130, 0x2132, 0x213E, 0x21D0, 0x21D2,
+ 0x21DE, 0x21E1, 0x21E3, 0x21ED, 0x21EF, 0x21F0,
+ 0x21F2, 0x21FE, 0x2200, 0x2202, 0x220E, 0x2211,
+ 0x2213, 0x221D, 0x221F, 0x2220, 0x2222, 0x222E,
+ 0x2231, 0x2233, 0x223D, 0x223F, 0x22D1, 0x22D3,
+ 0x22DD, 0x22DF, 0x22E0, 0x22E2, 0x22EE, 0x22F1,
+ 0x22F3, 0x22FD, 0x22FF, 0x2301, 0x2303, 0x230D,
+ 0x230F, 0x2310, 0x2312, 0x231E, 0x2321, 0x2323,
+ 0x232D, 0x232F, 0x2330, 0x2332, 0x233E, 0x23D0,
+ 0x23D2, 0x23DE, 0x23E1, 0x23E3, 0x23ED, 0x23EF,
+ 0x23F0, 0x23F2, 0x23FE, 0x2D01, 0x2D03, 0x2D0D,
+ 0x2D0F, 0x2D10, 0x2D12, 0x2D1E, 0x2D21, 0x2D23,
+ 0x2D2D, 0x2D2F, 0x2D30, 0x2D32, 0x2D3E, 0x2DD0,
+ 0x2DD2, 0x2DDE, 0x2DE1, 0x2DE3, 0x2DED, 0x2DEF,
+ 0x2DF0, 0x2DF2, 0x2DFE, 0x2E00, 0x2E02, 0x2E0E,
+ 0x2E11, 0x2E13, 0x2E1D, 0x2E1F, 0x2E20, 0x2E22,
+ 0x2E2E, 0x2E31, 0x2E33, 0x2E3D, 0x2E3F, 0x2ED1,
+ 0x2ED3, 0x2EDD, 0x2EDF, 0x2EE0, 0x2EE2, 0x2EEE,
+ 0x2EF1, 0x2EF3, 0x2EFD, 0x2EFF, 0x2F01, 0x2F03,
+ 0x2F0D, 0x2F0F, 0x2F10, 0x2F12, 0x2F1E, 0x2F21,
+ 0x2F23, 0x2F2D, 0x2F2F, 0x2F30, 0x2F32, 0x2F3E,
+ 0x2FD0, 0x2FD2, 0x2FDE, 0x2FE1, 0x2FE3, 0x2FED,
+ 0x2FEF, 0x2FF0, 0x2FF2, 0x2FFE, 0x3001, 0x3003,
+ 0x300D, 0x300F, 0x3010, 0x3012, 0x301E, 0x3021,
+ 0x3023, 0x302D, 0x302F, 0x3030, 0x3032, 0x303E,
+ 0x30D0, 0x30D2, 0x30DE, 0x30E1, 0x30E3, 0x30ED,
+ 0x30EF, 0x30F0, 0x30F2, 0x30FE, 0x3100, 0x3102,
+ 0x310E, 0x3111, 0x3113, 0x311D, 0x311F, 0x3120,
+ 0x3122, 0x312E, 0x3131, 0x3133, 0x313D, 0x313F,
+ 0x31D1, 0x31D3, 0x31DD, 0x31DF, 0x31E0, 0x31E2,
+ 0x31EE, 0x31F1, 0x31F3, 0x31FD, 0x31FF, 0x3201,
+ 0x3203, 0x320D, 0x320F, 0x3210, 0x3212, 0x321E,
+ 0x3221, 0x3223, 0x322D, 0x322F, 0x3230, 0x3232,
+ 0x323E, 0x32D0, 0x32D2, 0x32DE, 0x32E1, 0x32E3,
+ 0x32ED, 0x32EF, 0x32F0, 0x32F2, 0x32FE, 0x3300,
+ 0x3302, 0x330E, 0x3311, 0x3313, 0x331D, 0x331F,
+ 0x3320, 0x3322, 0x332E, 0x3331, 0x3333, 0x333D,
+ 0x333F, 0x33D1, 0x33D3, 0x33DD, 0x33DF, 0x33E0,
+ 0x33E2, 0x33EE, 0x33F1, 0x33F3, 0x33FD, 0x33FF,
+ 0x3D00, 0x3D02, 0x3D0E, 0x3D11, 0x3D13, 0x3D1D,
+ 0x3D1F, 0x3D20, 0x3D22, 0x3D2E, 0x3D31, 0x3D33,
+ 0x3D3D, 0x3D3F, 0x3DD1, 0x3DD3, 0x3DDD, 0x3DDF,
+ 0x3DE0, 0x3DE2, 0x3DEE, 0x3DF1, 0x3DF3, 0x3DFD,
+ 0x3DFF, 0x3E01, 0x3E03, 0x3E0D, 0x3E0F, 0x3E10,
+ 0x3E12, 0x3E1E, 0x3E21, 0x3E23, 0x3E2D, 0x3E2F,
+ 0x3E30, 0x3E32, 0x3E3E, 0x3ED0, 0x3ED2, 0x3EDE,
+ 0x3EE1, 0x3EE3, 0x3EED, 0x3EEF, 0x3EF0, 0x3EF2,
+ 0x3EFE, 0x3F00, 0x3F02, 0x3F0E, 0x3F11, 0x3F13,
+ 0x3F1D, 0x3F1F, 0x3F20, 0x3F22, 0x3F2E, 0x3F31,
+ 0x3F33, 0x3F3D, 0x3F3F, 0x3FD1, 0x3FD3, 0x3FDD,
+ 0x3FDF, 0x3FE0, 0x3FE2, 0x3FEE, 0x3FF1, 0x3FF3,
+ 0x3FFD, 0x3FFF, 0xD001, 0xD003, 0xD00D, 0xD00F,
+ 0xD010, 0xD012, 0xD01E, 0xD021, 0xD023, 0xD02D,
+ 0xD02F, 0xD030, 0xD032, 0xD03E, 0xD0D0, 0xD0D2,
+ 0xD0DE, 0xD0E1, 0xD0E3, 0xD0ED, 0xD0EF, 0xD0F0,
+ 0xD0F2, 0xD0FE, 0xD100, 0xD102, 0xD10E, 0xD111,
+ 0xD113, 0xD11D, 0xD11F, 0xD120, 0xD122, 0xD12E,
+ 0xD131, 0xD133, 0xD13D, 0xD13F, 0xD1D1, 0xD1D3,
+ 0xD1DD, 0xD1DF, 0xD1E0, 0xD1E2, 0xD1EE, 0xD1F1,
+ 0xD1F3, 0xD1FD, 0xD1FF, 0xD201, 0xD203, 0xD20D,
+ 0xD20F, 0xD210, 0xD212, 0xD21E, 0xD221, 0xD223,
+ 0xD22D, 0xD22F, 0xD230, 0xD232, 0xD23E, 0xD2D0,
+ 0xD2D2, 0xD2DE, 0xD2E1, 0xD2E3, 0xD2ED, 0xD2EF,
+ 0xD2F0, 0xD2F2, 0xD2FE, 0xD300, 0xD302, 0xD30E,
+ 0xD311, 0xD313, 0xD31D, 0xD31F, 0xD320, 0xD322,
+ 0xD32E, 0xD331, 0xD333, 0xD33D, 0xD33F, 0xD3D1,
+ 0xD3D3, 0xD3DD, 0xD3DF, 0xD3E0, 0xD3E2, 0xD3EE,
+ 0xD3F1, 0xD3F3, 0xD3FD, 0xD3FF, 0xDD00, 0xDD02,
+ 0xDD0E, 0xDD11, 0xDD13, 0xDD1D, 0xDD1F, 0xDD20,
+ 0xDD22, 0xDD2E, 0xDD31, 0xDD33, 0xDD3D, 0xDD3F,
+ 0xDDD1, 0xDDD3, 0xDDDD, 0xDDDF, 0xDDE0, 0xDDE2,
+ 0xDDEE, 0xDDF1, 0xDDF3, 0xDDFD, 0xDDFF, 0xDE01,
+ 0xDE03, 0xDE0D, 0xDE0F, 0xDE10, 0xDE12, 0xDE1E,
+ 0xDE21, 0xDE23, 0xDE2D, 0xDE2F, 0xDE30, 0xDE32,
+ 0xDE3E, 0xDED0, 0xDED2, 0xDEDE, 0xDEE1, 0xDEE3,
+ 0xDEED, 0xDEEF, 0xDEF0, 0xDEF2, 0xDEFE, 0xDF00,
+ 0xDF02, 0xDF0E, 0xDF11, 0xDF13, 0xDF1D, 0xDF1F,
+ 0xDF20, 0xDF22, 0xDF2E, 0xDF31, 0xDF33, 0xDF3D,
+ 0xDF3F, 0xDFD1, 0xDFD3, 0xDFDD, 0xDFDF, 0xDFE0,
+ 0xDFE2, 0xDFEE, 0xDFF1, 0xDFF3, 0xDFFD, 0xDFFF,
+ 0xE000, 0xE002, 0xE00E, 0xE011, 0xE013, 0xE01D,
+ 0xE01F, 0xE020, 0xE022, 0xE02E, 0xE031, 0xE033,
+ 0xE03D, 0xE03F, 0xE0D1, 0xE0D3, 0xE0DD, 0xE0DF,
+ 0xE0E0, 0xE0E2, 0xE0EE, 0xE0F1, 0xE0F3, 0xE0FD,
+ 0xE0FF, 0xE101, 0xE103, 0xE10D, 0xE10F, 0xE110,
+ 0xE112, 0xE11E, 0xE121, 0xE123, 0xE12D, 0xE12F,
+ 0xE130, 0xE132, 0xE13E, 0xE1D0, 0xE1D2, 0xE1DE,
+ 0xE1E1, 0xE1E3, 0xE1ED, 0xE1EF, 0xE1F0, 0xE1F2,
+ 0xE1FE, 0xE200, 0xE202, 0xE20E, 0xE211, 0xE213,
+ 0xE21D, 0xE21F, 0xE220, 0xE222, 0xE22E, 0xE231,
+ 0xE233, 0xE23D, 0xE23F, 0xE2D1, 0xE2D3, 0xE2DD,
+ 0xE2DF, 0xE2E0, 0xE2E2, 0xE2EE, 0xE2F1, 0xE2F3,
+ 0xE2FD, 0xE2FF, 0xE301, 0xE303, 0xE30D, 0xE30F,
+ 0xE310, 0xE312, 0xE31E, 0xE321, 0xE323, 0xE32D,
+ 0xE32F, 0xE330, 0xE332, 0xE33E, 0xE3D0, 0xE3D2,
+ 0xE3DE, 0xE3E1, 0xE3E3, 0xE3ED, 0xE3EF, 0xE3F0,
+ 0xE3F2, 0xE3FE, 0xED01, 0xED03, 0xED0D, 0xED0F,
+ 0xED10, 0xED12, 0xED1E, 0xED21, 0xED23, 0xED2D,
+ 0xED2F, 0xED30, 0xED32, 0xED3E, 0xEDD0, 0xEDD2,
+ 0xEDDE, 0xEDE1, 0xEDE3, 0xEDED, 0xEDEF, 0xEDF0,
+ 0xEDF2, 0xEDFE, 0xEE00, 0xEE02, 0xEE0E, 0xEE11,
+ 0xEE13, 0xEE1D, 0xEE1F, 0xEE20, 0xEE22, 0xEE2E,
+ 0xEE31, 0xEE33, 0xEE3D, 0xEE3F, 0xEED1, 0xEED3,
+ 0xEEDD, 0xEEDF, 0xEEE0, 0xEEE2, 0xEEEE, 0xEEF1,
+ 0xEEF3, 0xEEFD, 0xEEFF, 0xEF01, 0xEF03, 0xEF0D,
+ 0xEF0F, 0xEF10, 0xEF12, 0xEF1E, 0xEF21, 0xEF23,
+ 0xEF2D, 0xEF2F, 0xEF30, 0xEF32, 0xEF3E, 0xEFD0,
+ 0xEFD2, 0xEFDE, 0xEFE1, 0xEFE3, 0xEFED, 0xEFEF,
+ 0xEFF0, 0xEFF2, 0xEFFE, 0xF001, 0xF003, 0xF00D,
+ 0xF00F, 0xF010, 0xF012, 0xF01E, 0xF021, 0xF023,
+ 0xF02D, 0xF02F, 0xF030, 0xF032, 0xF03E, 0xF0D0,
+ 0xF0D2, 0xF0DE, 0xF0E1, 0xF0E3, 0xF0ED, 0xF0EF,
+ 0xF0F0, 0xF0F2, 0xF0FE, 0xF100, 0xF102, 0xF10E,
+ 0xF111, 0xF113, 0xF11D, 0xF11F, 0xF120, 0xF122,
+ 0xF12E, 0xF131, 0xF133, 0xF13D, 0xF13F, 0xF1D1,
+ 0xF1D3, 0xF1DD, 0xF1DF, 0xF1E0, 0xF1E2, 0xF1EE,
+ 0xF1F1, 0xF1F3, 0xF1FD, 0xF1FF, 0xF201, 0xF203,
+ 0xF20D, 0xF20F, 0xF210, 0xF212, 0xF21E, 0xF221,
+ 0xF223, 0xF22D, 0xF22F, 0xF230, 0xF232, 0xF23E,
+ 0xF2D0, 0xF2D2, 0xF2DE, 0xF2E1, 0xF2E3, 0xF2ED,
+ 0xF2EF, 0xF2F0, 0xF2F2, 0xF2FE, 0xF300, 0xF302,
+ 0xF30E, 0xF311, 0xF313, 0xF31D, 0xF31F, 0xF320,
+ 0xF322, 0xF32E, 0xF331, 0xF333, 0xF33D, 0xF33F,
+ 0xF3D1, 0xF3D3, 0xF3DD, 0xF3DF, 0xF3E0, 0xF3E2,
+ 0xF3EE, 0xF3F1, 0xF3F3, 0xF3FD, 0xF3FF, 0xFD00,
+ 0xFD02, 0xFD0E, 0xFD11, 0xFD13, 0xFD1D, 0xFD1F,
+ 0xFD20, 0xFD22, 0xFD2E, 0xFD31, 0xFD33, 0xFD3D,
+ 0xFD3F, 0xFDD1, 0xFDD3, 0xFDDD, 0xFDDF, 0xFDE0,
+ 0xFDE2, 0xFDEE, 0xFDF1, 0xFDF3, 0xFDFD, 0xFDFF,
+ 0xFE01, 0xFE03, 0xFE0D, 0xFE0F, 0xFE10, 0xFE12,
+ 0xFE1E, 0xFE21, 0xFE23, 0xFE2D, 0xFE2F, 0xFE30,
+ 0xFE32, 0xFE3E, 0xFED0, 0xFED2, 0xFEDE, 0xFEE1,
+ 0xFEE3, 0xFEED, 0xFEEF, 0xFEF0, 0xFEF2, 0xFEFE,
+ 0xFF00, 0xFF02, 0xFF0E, 0xFF11, 0xFF13, 0xFF1D,
+ 0xFF1F, 0xFF20, 0xFF22, 0xFF2E, 0xFF31, 0xFF33,
+ 0xFF3D, 0xFF3F, 0xFFD1, 0xFFD3, 0xFFDD, 0xFFDF,
+ 0xFFE0, 0xFFE2, 0xFFEE, 0xFFF1, 0xFFF3, 0xFFFD,
+ 0xFFFF,
+};
+
+#define ON2AVC_CB6_CODES 1201
+static const uint32_t on2avc_cb6_codes[ON2AVC_CB6_CODES] = {
+ 0x0018, 0x0088, 0x0082, 0x0024, 0x05B4, 0x08DF,
+ 0x0044, 0x0197, 0x01DE, 0x021F, 0x0D77, 0x0A72,
+ 0x7E77, 0x0B8B, 0x03F1, 0x0433, 0x073F, 0x1E5C,
+ 0x016A, 0x01C5, 0x00D2, 0x0062, 0x0CE4, 0x0096,
+ 0x0020, 0x0052, 0x00B7, 0x0127, 0x003A, 0x0041,
+ 0x00CC, 0x01B6, 0x0124, 0x07D3, 0x01AE, 0x01C4,
+ 0x00DA, 0x03D8, 0x03F3, 0x1638, 0x03F2, 0x12FC,
+ 0x01E2, 0x0DBC, 0x026C, 0x008A, 0x0054, 0x01A6,
+ 0x0195, 0x0164, 0x01E2, 0x026D, 0x0051, 0x049F,
+ 0x01B3, 0x01E0, 0x01B4, 0x026E, 0x07DE, 0x0129,
+ 0x0292, 0x0DBD, 0x013E, 0x00F3, 0x05B5, 0x09A6,
+ 0x01FB, 0x02CF, 0x01FF, 0x037C, 0x004A, 0x067E,
+ 0x016B, 0x002A, 0x09A7, 0x10EE, 0x1639, 0x0135,
+ 0x0CCA, 0x016A, 0x011B, 0x03EE, 0x07A2, 0x0D7E,
+ 0x028F, 0x0FE2, 0x07DA, 0x0357, 0x92F6, 0x0F31,
+ 0x0217, 0x036A, 0x0CE5, 0x07A1, 0x0229, 0x03D9,
+ 0x0377, 0x00B7, 0x01A6, 0x0655, 0x012E, 0x002B,
+ 0x002E, 0x00F2, 0x06F2, 0x02D0, 0x0F98, 0x07A0,
+ 0x009C, 0x0332, 0x0014, 0x01BD, 0x017E, 0x0331,
+ 0x0371, 0x025B, 0x0498, 0x161F, 0x039E, 0x0654,
+ 0x00C2, 0x06BA, 0x0140, 0x021E, 0x02F8, 0x01B4,
+ 0x0134, 0x03FF, 0x0066, 0x0477, 0x01DF, 0x01FE,
+ 0x0A14, 0x029E, 0x0356, 0x038F, 0x035A, 0x3CB3,
+ 0x01B2, 0x016A, 0x011A, 0x00B6, 0x02DE, 0x01DD,
+ 0x017C, 0x0376, 0x002F, 0x0039, 0x03D7, 0x01BE,
+ 0x0056, 0x0050, 0x017C, 0x01CC, 0x0034, 0x0B3E,
+ 0x0499, 0x0014, 0x08DE, 0x037B, 0x03EB, 0x08BF,
+ 0x186E, 0x050F, 0x0030, 0x0169, 0x07F2, 0x00F6,
+ 0x0042, 0x0198, 0x00BC, 0x002E, 0x023A, 0x01E3,
+ 0x0036, 0x004C, 0x012E, 0x01A1, 0x007D, 0x00C3,
+ 0x0392, 0x0063, 0x0F33, 0x016C, 0x01A7, 0x0E77,
+ 0x01DF, 0x0177, 0x0032, 0x03FE, 0x0322, 0x01AC,
+ 0x0030, 0x017E, 0x011E, 0x0022, 0x01FB, 0x012A,
+ 0x002B, 0x0068, 0x00D4, 0x006E, 0x0015, 0x001C,
+ 0x00E5, 0x01A9, 0x0436, 0x053F, 0x05AE, 0x00B2,
+ 0x072A, 0x02EA, 0x008E, 0x0175, 0x02BE, 0x018E,
+ 0x0002, 0x005E, 0x01D6, 0x0055, 0x006A, 0x07F3,
+ 0x02F9, 0x01D4, 0x016E, 0x03AB, 0x00FF, 0x003C,
+ 0x0192, 0x01D6, 0x0256, 0x0137, 0x0148, 0x022A,
+ 0x039C, 0x016D, 0x0116, 0x038A, 0x033E, 0x0156,
+ 0x03CF, 0x004B, 0x00E6, 0x018F, 0x1E5D, 0x03DA,
+ 0x0292, 0x0108, 0x06F5, 0x03DB, 0x0092, 0x0178,
+ 0x014A, 0x03FF, 0x03EE, 0x0A79, 0x0A16, 0x00F7,
+ 0x01B5, 0x0A15, 0x0D7F, 0x02FA, 0x01E4, 0x0157,
+ 0x01E2, 0x0185, 0x057E, 0x07DB, 0x0098, 0x0DBE,
+ 0x019A, 0x05FE, 0x003B, 0x03F5, 0x01BF, 0x01E4,
+ 0x011E, 0x001B, 0x03AA, 0x0337, 0x1F9C, 0x0942,
+ 0x05AB, 0x0430, 0x24BF, 0x163A, 0x037E, 0x014E,
+ 0x00F4, 0x0217, 0x0059, 0x0F32, 0x03F4, 0x01F2,
+ 0x0031, 0x0136, 0x05C6, 0x0076, 0x0006, 0x02FE,
+ 0x03FB, 0x009D, 0x013F, 0x002E, 0x02E6, 0x00AD,
+ 0x0234, 0x021E, 0x0253, 0x012A, 0x0346, 0x029A,
+ 0x012B, 0x021C, 0x02DA, 0x0004, 0x013C, 0x00F5,
+ 0x004E, 0x017D, 0x01F8, 0x0006, 0x01FA, 0x01F9,
+ 0x007A, 0x0067, 0x033B, 0x033A, 0x0586, 0x05C7,
+ 0x05FF, 0x00C8, 0x014B, 0x024F, 0x02C5, 0x00E7,
+ 0x014C, 0x035C, 0x00A2, 0x006A, 0x01F3, 0x0071,
+ 0x005E, 0x0084, 0x063A, 0x03EF, 0x0064, 0x02FE,
+ 0x0255, 0x003A, 0x061A, 0x0333, 0x037F, 0x00FE,
+ 0x115B, 0x0F9A, 0x00A6, 0x027D, 0x0B5F, 0x013F,
+ 0x029E, 0x0293, 0x07B6, 0x000F, 0x0196, 0x02FB,
+ 0x033F, 0x01FE, 0x019E, 0x01B3, 0x037F, 0x00C4,
+ 0x00DE, 0x02D2, 0x007A, 0x03CA, 0x01E3, 0x02F7,
+ 0x00AE, 0x05AF, 0x02FF, 0x026F, 0x00CA, 0x0356,
+ 0x02C7, 0x02D1, 0x0256, 0x006B, 0x0141, 0x012C,
+ 0x03BE, 0x0026, 0x00F0, 0x03A3, 0x02D6, 0x005F,
+ 0x00FF, 0x03F2, 0x00AE, 0x0257, 0x01FE, 0x035E,
+ 0x01B6, 0x00EE, 0x0658, 0x008F, 0x0232, 0x0657,
+ 0x12FD, 0x00AF, 0x00E6, 0x0426, 0x0666, 0x009E,
+ 0x0467, 0x003F, 0x014A, 0x02D3, 0x12FE, 0x099A,
+ 0x03BF, 0x00DD, 0x04DF, 0x009F, 0x00B8, 0x0863,
+ 0x06F7, 0x01B8, 0x0346, 0x0179, 0x0FE3, 0x0667,
+ 0x0659, 0x01CE, 0x00B3, 0x0372, 0x065A, 0x025E,
+ 0x01AA, 0x0276, 0x027E, 0x02DB, 0x0CE6, 0x115A,
+ 0x02E7, 0x0139, 0x03DA, 0x01FA, 0x021C, 0x0943,
+ 0x0862, 0x011F, 0x08B6, 0x07E6, 0x029F, 0x00E5,
+ 0x0656, 0x049A, 0x000E, 0x0F99, 0x06F6, 0x00DC,
+ 0x00EC, 0x014B, 0x0230, 0x04A2, 0x0016, 0x02EB,
+ 0x03AE, 0x02DF, 0x01AA, 0x033E, 0x0196, 0x092E,
+ 0x06F3, 0x00E7, 0x0B5E, 0x03F2, 0x0086, 0x0347,
+ 0x022A, 0x0A17, 0x01EF, 0x067F, 0x004A, 0x037E,
+ 0x02EE, 0x015E, 0x0696, 0x006A, 0x01CD, 0x0077,
+ 0x073F, 0x0016, 0x01E3, 0x012E, 0x00DB, 0x03BD,
+ 0x0496, 0x01C6, 0x0323, 0x005E, 0x02F6, 0x027C,
+ 0x0235, 0x0231, 0x00DA, 0x01EB, 0x0232, 0x02C6,
+ 0x01F2, 0x016F, 0x02C6, 0x036B, 0x0050, 0x0AFE,
+ 0x0F9B, 0x00C6, 0x014E, 0x02BC, 0x01CA, 0x027F,
+ 0x07A5, 0x0DE1, 0x01F1, 0x039E, 0x0DE2, 0x1E5E,
+ 0x065E, 0x0DE0, 0x115F, 0x00F7, 0x02AB, 0x116E,
+ 0x019B, 0x04CE, 0x00D3, 0x01C7, 0x02D6, 0x01F3,
+ 0x016F, 0x014E, 0x05B7, 0x0FA3, 0x0118, 0x025F,
+ 0x017E, 0x0437, 0x049B, 0x05AE, 0x497A, 0x0D2E,
+ 0x05B6, 0x1E5F, 0x0DE3, 0x0512, 0x031A, 0x01F2,
+ 0x007E, 0x015C, 0x035E, 0x04CF, 0x01C8, 0x0194,
+ 0x12FF, 0x1F7F, 0x00E0, 0x01A2, 0x012F, 0x0087,
+ 0x014C, 0x0643, 0x0D5E, 0x017F, 0x07A6, 0x0513,
+ 0x0D5F, 0x022B, 0x065F, 0x03F6, 0x022E, 0x03F7,
+ 0x0642, 0x036E, 0x00D0, 0x01CB, 0x0378, 0x125EE,
+ 0x035F, 0x014F, 0x035F, 0x116F, 0x0A4F, 0x0102,
+ 0x032A, 0x0173, 0x0536, 0x03A7, 0x075E, 0x1F9F,
+ 0x163B, 0x14DA, 0x526E, 0x165F, 0x0A6E, 0x0596,
+ 0x07A7, 0x042A, 0x0172, 0x19C2, 0x07E6, 0x04A3,
+ 0x0327, 0x02A8, 0x07A3, 0x046E, 0x012F, 0x2EFF,
+ 0x01D7, 0x0266, 0x0BBE, 0x066E, 0x186F, 0x0A73,
+ 0x1336, 0x02A9, 0x0373, 0x017F, 0x1F9E, 0x0B62,
+ 0x03A6, 0x0DBF, 0x035B, 0x063B, 0x053B, 0x10EF,
+ 0x016E, 0x011B, 0x115D, 0x115C, 0x00F2, 0x0176,
+ 0x0393, 0x034A, 0x0107, 0x115E, 0x0B63, 0x023F,
+ 0x002A, 0x0CE7, 0x0A7A, 0x06FA, 0x06FB, 0x02AA,
+ 0x02C2, 0x065B, 0x07A4, 0x02D4, 0x0130, 0x0106,
+ 0x01FB, 0x0B3F, 0x01B7, 0x00F6, 0x0056, 0x053F,
+ 0x0126, 0x0048, 0x0233, 0x017D, 0x00A4, 0x08BE,
+ 0x165E, 0x165D, 0x0A7B, 0x0427, 0x078F, 0x1F7E,
+ 0x0641, 0x02E4, 0x01E6, 0x01DA, 0x00F8, 0x043A,
+ 0x02BE, 0x011C, 0x006F, 0x036D, 0x19C3, 0x0020,
+ 0x06AE, 0x0372, 0x0288, 0x00C0, 0x079D, 0x036E,
+ 0x0117, 0x02FB, 0x0538, 0x06F2, 0x12F9, 0x1337,
+ 0x1E58, 0x0214, 0x005E, 0x0CE0, 0x01EE, 0x0A6E,
+ 0x0215, 0x01C2, 0x12FA, 0x033A, 0x009A, 0x0174,
+ 0x0CE2, 0x09A1, 0x00FE, 0x0250, 0x02CA, 0x035E,
+ 0x03A2, 0x0D7D, 0x2EFE, 0x02E8, 0x24BE, 0x1F7C,
+ 0x10EC, 0x04A2, 0x0052, 0x010D, 0x0277, 0x003A,
+ 0x0CDE, 0x0A6F, 0x0086, 0x00E4, 0x12FB, 0x14DE,
+ 0x009E, 0x0062, 0x03CA, 0x03BC, 0x02CA, 0x14DF,
+ 0x0FE0, 0x030C, 0x03F0, 0x06F3, 0x0796, 0x0B1E,
+ 0x05B0, 0x15FE, 0x013A, 0x0CDF, 0x079E, 0x01E2,
+ 0x0166, 0x02BD, 0x0151, 0x0153, 0x0650, 0x0940,
+ 0x010F, 0x3CB2, 0x10ED, 0x057E, 0x03D4, 0x029E,
+ 0x0358, 0x06F4, 0x7E76, 0x017C, 0x15FF, 0x047D,
+ 0x1158, 0x3F3A, 0x0CE3, 0x005F, 0x043A, 0x032F,
+ 0x010E, 0x1E5A, 0x0A4C, 0x0152, 0x125EF, 0x0B88,
+ 0x057F, 0x059E, 0x042B, 0x2936, 0x0138, 0x03A1,
+ 0x03C6, 0x0E56, 0x12F8, 0x149A, 0x526F, 0x0F2E,
+ 0x079C, 0x02FA, 0x0476, 0x0267, 0x0636, 0x03A0,
+ 0x014E, 0x0092, 0x0D7C, 0x05AF, 0x010C, 0x011C,
+ 0x0A10, 0x177E, 0x0131, 0x09A0, 0x03EA, 0x02C2,
+ 0x02D6, 0x0B89, 0x032E, 0x01E8, 0x0F30, 0x01BA,
+ 0x0532, 0x0A6C, 0x0F6E, 0x04CC, 0x008E, 0x036C,
+ 0x0E57, 0x00D6, 0x0162, 0x0024, 0x0252, 0x0F6F,
+ 0x01AE, 0x0150, 0x0038, 0x07CE, 0x01BB, 0x01F6,
+ 0x026A, 0x038B, 0x01DB, 0x07CF, 0x14DB, 0x24BC,
+ 0x0272, 0x053E, 0x073E, 0x078E, 0x0C36, 0x0176,
+ 0x032B, 0x017A, 0x0190, 0x0CCB, 0x047C, 0x0170,
+ 0x0054, 0x03EC, 0x049D, 0x0197, 0x043B, 0x0432,
+ 0x0192, 0x026A, 0x01F0, 0x0076, 0x0216, 0x0A11,
+ 0x1F7D, 0x02C4, 0x0298, 0x1159, 0x0A4E, 0x0116,
+ 0x00E4, 0x0216, 0x029A, 0x000F, 0x04DA, 0x04D2,
+ 0x002B, 0x0011, 0x049E, 0x045A, 0x01BF, 0x01EF,
+ 0x03CE, 0x01F8, 0x026E, 0x0466, 0x02DC, 0x0168,
+ 0x030E, 0x00B4, 0x01C3, 0x03CC, 0x028D, 0x01AE,
+ 0x038E, 0x01B0, 0x0664, 0x0119, 0x01BE, 0x035B,
+ 0x035F, 0x028E, 0x0A78, 0x01DE, 0x0397, 0x03FE,
+ 0x01B1, 0x028E, 0x07D2, 0x09A2, 0x033C, 0x02C1,
+ 0x0FA0, 0x0359, 0x031E, 0x00C1, 0x03D6, 0x0A12,
+ 0x01C4, 0x0330, 0x075F, 0x0B1F, 0x025A, 0x027B,
+ 0x04DB, 0x02E5, 0x01FA, 0x036F, 0x0A13, 0x02BB,
+ 0x00FA, 0x01D4, 0x01F8, 0x018A, 0x161E, 0x0E75,
+ 0x026B, 0x05B3, 0x01BC, 0x05B2, 0x09A3, 0x0424,
+ 0x047E, 0x01EE, 0x0FE1, 0x161D, 0x024C, 0x017E,
+ 0x026B, 0x01DC, 0x00A5, 0x0F2F, 0x161C, 0x028B,
+ 0x0196, 0x0168, 0x01EF, 0x0394, 0x0E74, 0x013C,
+ 0x00C9, 0x032E, 0x0941, 0x0D76, 0x050C, 0x0228,
+ 0x006C, 0x0236, 0x0D2F, 0x0156, 0x00D2, 0x0B8A,
+ 0x0148, 0x028A, 0x028B, 0x033B, 0x0214, 0x01E9,
+ 0x03C2, 0x049C, 0x02BA, 0x02E9, 0x028C, 0x01FC,
+ 0x0103, 0x0B5C, 0x050D, 0x031C, 0x0268, 0x0651,
+ 0x013A, 0x013B, 0x0118, 0x03D5, 0x0252, 0x0044,
+ 0x0637, 0x01D2, 0x000E, 0x00F0, 0x0323, 0x02C3,
+ 0x019A, 0x016C, 0x0046, 0x03E3, 0x024A, 0x00AC,
+ 0x0269, 0x02C0, 0x0396, 0x027A, 0x0253, 0x0273,
+ 0x073E, 0x0322, 0x003A, 0x025E, 0x0336, 0x0257,
+ 0x00D6, 0x0026, 0x03C3, 0x0034, 0x019A, 0x00FB,
+ 0x0038, 0x0040, 0x0096, 0x01F0, 0x0184, 0x021A,
+ 0x003E, 0x0042, 0x050E, 0x03CE, 0x035E, 0x0FA1,
+ 0x017B, 0x02CD, 0x0058, 0x0326, 0x00E4, 0x002E,
+ 0x004F, 0x000C, 0x0164, 0x0048, 0x0048, 0x0194,
+ 0x0074, 0x006E, 0x0070, 0x006C, 0x01A4, 0x00A3,
+ 0x034F, 0x011E, 0x0374, 0x0157, 0x0138, 0x011D,
+ 0x03CF, 0x033D, 0x0132, 0x0050, 0x023E, 0x005A,
+ 0x0076, 0x01EC, 0x005D, 0x0008, 0x004C, 0x024E,
+ 0x0154, 0x001E, 0x01C6, 0x0027, 0x00FE, 0x01EA,
+ 0x02CE, 0x01DD, 0x02CB, 0x035A, 0x0318, 0x013E,
+ 0x009B, 0x0288, 0x0339, 0x024D, 0x031F, 0x0128,
+ 0x00B6, 0x0028, 0x028A, 0x0289, 0x029F, 0x01FD,
+ 0x029A, 0x00F6, 0x0FA2, 0x0347, 0x0080, 0x01A8,
+ 0x028F, 0x0326, 0x0327, 0x0370, 0x165C, 0x043F,
+ 0x0375, 0x013D, 0x1E5B, 0x04DE, 0x0155, 0x00D8,
+ 0x0319, 0x0096, 0x0640, 0x07E7, 0x007C, 0x0652,
+ 0x0373, 0x05DE, 0x00CF, 0x0E76, 0x0653, 0x01A0,
+ 0x0160, 0x0169, 0x01D5, 0x05AA, 0x053A, 0x0B5D,
+ 0x0254, 0x079A, 0x0533, 0x0425, 0x053E, 0x00A6,
+ 0x030F, 0x01A2, 0x00B0, 0x04A3, 0x079F, 0x011A,
+ 0x01EE, 0x02CC, 0x045E, 0x005C, 0x0024, 0x022C,
+ 0x001A, 0x0338, 0x0132, 0x026C, 0x004E, 0x047F,
+ 0x01B2, 0x0113, 0x043E, 0x0336, 0x00F0, 0x02CE,
+ 0x0112, 0x018B, 0x0010, 0x0114, 0x01BE, 0x03FA,
+ 0x002A, 0x00FA, 0x0033, 0x0060, 0x0146, 0x01DC,
+ 0x0000, 0x0025, 0x037A, 0x034E, 0x012E, 0x029B,
+ 0x079B, 0x00E6, 0x03CD, 0x02DD, 0x0117, 0x017A,
+ 0x002C, 0x03E2, 0x003E, 0x0070, 0x00CE, 0x00B1,
+ 0x003B,
+};
+
+static const uint8_t on2avc_cb6_bits[ON2AVC_CB6_CODES] = {
+ 7, 10, 10, 7, 12, 12,
+ 7, 10, 11, 11, 12, 15,
+ 17, 12, 13, 11, 15, 13,
+ 10, 11, 11, 7, 13, 13,
+ 7, 7, 12, 12, 7, 7,
+ 9, 9, 9, 11, 10, 9,
+ 12, 12, 13, 13, 13, 13,
+ 9, 12, 10, 10, 7, 9,
+ 9, 10, 12, 11, 10, 11,
+ 11, 9, 11, 11, 11, 11,
+ 12, 12, 13, 11, 12, 12,
+ 10, 11, 12, 12, 10, 11,
+ 11, 10, 12, 14, 13, 11,
+ 12, 12, 11, 10, 13, 14,
+ 10, 12, 12, 12, 16, 12,
+ 12, 10, 13, 13, 13, 12,
+ 11, 11, 11, 13, 14, 13,
+ 13, 11, 11, 10, 13, 13,
+ 11, 12, 12, 13, 16, 12,
+ 14, 10, 13, 13, 10, 13,
+ 11, 11, 10, 11, 11, 9,
+ 11, 11, 10, 11, 12, 12,
+ 13, 12, 12, 10, 13, 14,
+ 12, 11, 11, 12, 11, 9,
+ 11, 11, 10, 7, 12, 13,
+ 7, 7, 9, 9, 10, 12,
+ 13, 10, 12, 10, 10, 12,
+ 13, 12, 10, 10, 11, 9,
+ 7, 9, 9, 7, 10, 10,
+ 7, 7, 9, 9, 10, 11,
+ 10, 10, 12, 11, 11, 12,
+ 11, 11, 10, 10, 10, 9,
+ 7, 9, 9, 7, 9, 9,
+ 7, 10, 10, 7, 10, 10,
+ 11, 10, 11, 11, 11, 10,
+ 11, 12, 10, 9, 10, 10,
+ 8, 10, 9, 7, 10, 11,
+ 11, 9, 9, 10, 10, 10,
+ 10, 11, 10, 11, 10, 10,
+ 10, 11, 11, 10, 11, 11,
+ 10, 10, 11, 10, 13, 12,
+ 11, 10, 13, 12, 10, 11,
+ 11, 10, 11, 12, 13, 12,
+ 11, 13, 14, 11, 10, 11,
+ 11, 9, 13, 12, 10, 12,
+ 11, 11, 10, 13, 13, 9,
+ 11, 11, 10, 11, 15, 13,
+ 11, 11, 14, 13, 11, 10,
+ 11, 11, 10, 12, 13, 9,
+ 10, 11, 11, 10, 10, 10,
+ 10, 11, 11, 11, 10, 11,
+ 10, 10, 10, 11, 10, 10,
+ 11, 11, 10, 10, 10, 11,
+ 7, 9, 9, 8, 9, 9,
+ 7, 10, 10, 10, 11, 11,
+ 11, 10, 10, 12, 11, 10,
+ 9, 10, 10, 7, 9, 10,
+ 7, 10, 11, 11, 10, 11,
+ 11, 10, 11, 12, 12, 12,
+ 13, 13, 12, 11, 13, 13,
+ 11, 11, 11, 11, 9, 11,
+ 11, 9, 9, 12, 11, 9,
+ 9, 10, 11, 10, 11, 11,
+ 11, 11, 11, 11, 11, 11,
+ 11, 10, 11, 11, 10, 9,
+ 10, 10, 11, 12, 11, 10,
+ 12, 11, 10, 11, 10, 12,
+ 11, 11, 13, 11, 10, 13,
+ 13, 11, 12, 12, 11, 11,
+ 11, 11, 10, 10, 13, 13,
+ 10, 10, 11, 11, 10, 12,
+ 13, 10, 12, 11, 12, 11,
+ 13, 13, 10, 14, 13, 10,
+ 10, 11, 11, 10, 13, 13,
+ 10, 10, 10, 11, 10, 13,
+ 12, 10, 12, 12, 12, 12,
+ 13, 13, 11, 13, 13, 10,
+ 10, 11, 11, 11, 12, 12,
+ 10, 11, 11, 10, 12, 12,
+ 11, 11, 13, 12, 11, 10,
+ 13, 13, 10, 11, 12, 12,
+ 10, 11, 11, 11, 9, 12,
+ 11, 10, 9, 11, 11, 10,
+ 11, 11, 10, 12, 11, 11,
+ 10, 11, 11, 10, 11, 11,
+ 10, 9, 10, 10, 9, 12,
+ 13, 9, 13, 10, 11, 11,
+ 13, 14, 11, 14, 14, 13,
+ 13, 14, 13, 11, 13, 13,
+ 11, 12, 11, 11, 13, 11,
+ 11, 9, 12, 12, 9, 11,
+ 11, 11, 13, 14, 15, 12,
+ 12, 13, 14, 12, 10, 11,
+ 11, 9, 13, 12, 9, 10,
+ 13, 13, 10, 9, 11, 11,
+ 10, 12, 13, 11, 13, 12,
+ 13, 13, 13, 13, 10, 13,
+ 12, 10, 10, 11, 10, 17,
+ 13, 13, 11, 13, 14, 11,
+ 11, 11, 12, 12, 11, 15,
+ 13, 13, 17, 14, 13, 12,
+ 13, 13, 11, 14, 13, 11,
+ 10, 13, 13, 11, 14, 14,
+ 11, 12, 12, 11, 13, 15,
+ 14, 13, 14, 16, 15, 13,
+ 12, 12, 13, 11, 14, 14,
+ 11, 10, 13, 13, 10, 9,
+ 10, 10, 11, 13, 13, 10,
+ 13, 13, 12, 13, 13, 13,
+ 10, 13, 13, 10, 10, 11,
+ 11, 12, 11, 11, 9, 12,
+ 12, 9, 11, 11, 11, 12,
+ 14, 14, 12, 12, 14, 13,
+ 12, 10, 11, 11, 9, 12,
+ 12, 9, 10, 14, 14, 9,
+ 12, 11, 11, 11, 13, 14,
+ 11, 17, 14, 13, 13, 14,
+ 13, 11, 14, 13, 11, 12,
+ 11, 11, 13, 11, 11, 9,
+ 13, 12, 9, 10, 11, 10,
+ 12, 14, 14, 12, 14, 13,
+ 14, 12, 11, 11, 11, 9,
+ 12, 12, 9, 10, 13, 14,
+ 10, 10, 11, 10, 10, 14,
+ 12, 10, 13, 13, 12, 12,
+ 12, 13, 10, 12, 13, 10,
+ 9, 10, 11, 11, 13, 13,
+ 11, 14, 14, 11, 12, 13,
+ 13, 13, 17, 16, 13, 13,
+ 13, 16, 13, 12, 11, 13,
+ 11, 13, 14, 11, 17, 12,
+ 13, 11, 13, 16, 11, 12,
+ 13, 12, 13, 15, 17, 13,
+ 13, 17, 11, 12, 11, 12,
+ 11, 11, 14, 14, 11, 10,
+ 13, 13, 10, 12, 10, 11,
+ 10, 12, 13, 10, 12, 13,
+ 13, 12, 12, 12, 11, 14,
+ 12, 10, 9, 11, 11, 12,
+ 11, 11, 10, 12, 13, 9,
+ 10, 10, 11, 12, 13, 14,
+ 12, 12, 15, 14, 12, 11,
+ 11, 11, 9, 12, 13, 9,
+ 10, 11, 11, 9, 11, 11,
+ 9, 11, 11, 12, 11, 13,
+ 13, 11, 12, 13, 14, 12,
+ 12, 12, 12, 10, 11, 11,
+ 10, 10, 11, 11, 9, 9,
+ 10, 10, 10, 11, 11, 10,
+ 10, 11, 11, 11, 11, 12,
+ 10, 11, 11, 11, 9, 10,
+ 10, 11, 12, 12, 10, 11,
+ 11, 10, 11, 12, 11, 10,
+ 12, 13, 10, 11, 12, 13,
+ 11, 12, 11, 12, 10, 11,
+ 11, 10, 10, 14, 13, 10,
+ 10, 11, 11, 10, 13, 12,
+ 10, 12, 13, 12, 12, 12,
+ 13, 10, 12, 13, 10, 10,
+ 11, 11, 11, 13, 13, 10,
+ 10, 11, 11, 10, 12, 13,
+ 10, 12, 13, 12, 12, 13,
+ 11, 10, 12, 12, 10, 12,
+ 11, 11, 11, 11, 12, 10,
+ 10, 11, 10, 12, 11, 12,
+ 11, 13, 12, 10, 11, 13,
+ 11, 11, 11, 12, 10, 10,
+ 11, 11, 10, 9, 11, 11,
+ 9, 9, 10, 10, 10, 11,
+ 11, 10, 10, 11, 11, 12,
+ 11, 11, 11, 11, 11, 10,
+ 9, 11, 10, 7, 10, 10,
+ 7, 7, 9, 9, 9, 10,
+ 11, 10, 12, 11, 11, 12,
+ 11, 11, 10, 10, 11, 10,
+ 7, 10, 9, 7, 10, 9,
+ 7, 10, 10, 7, 9, 10,
+ 10, 10, 11, 12, 10, 10,
+ 11, 11, 10, 10, 10, 11,
+ 7, 9, 10, 8, 10, 12,
+ 11, 10, 9, 11, 10, 10,
+ 11, 11, 10, 10, 10, 11,
+ 11, 10, 10, 10, 10, 11,
+ 11, 10, 10, 10, 13, 12,
+ 11, 12, 12, 12, 10, 10,
+ 11, 11, 11, 14, 14, 11,
+ 11, 13, 13, 11, 11, 11,
+ 10, 10, 12, 12, 10, 13,
+ 11, 11, 10, 12, 13, 9,
+ 10, 11, 11, 11, 14, 13,
+ 11, 11, 13, 12, 11, 11,
+ 10, 11, 10, 12, 13, 10,
+ 9, 11, 11, 10, 10, 10,
+ 11, 10, 11, 11, 11, 13,
+ 11, 11, 11, 10, 10, 10,
+ 11, 10, 10, 9, 10, 10,
+ 7, 9, 10, 7, 9, 9,
+ 8, 10, 10, 10, 10, 12,
+ 11, 10, 11, 11, 12, 10,
+ 10, 10, 10, 7, 10, 10,
+ 7,
+};
+
+static const uint16_t on2avc_cb6_syms[ON2AVC_CB6_CODES] = {
+ 0x0000, 0x0002, 0x000E, 0x0011, 0x0013, 0x001D,
+ 0x001F, 0x0020, 0x0022, 0x002E, 0x0031, 0x0033,
+ 0x003D, 0x003F, 0x00D1, 0x00D3, 0x00DD, 0x00DF,
+ 0x00E0, 0x00E2, 0x00EE, 0x00F1, 0x00F3, 0x00FD,
+ 0x00FF, 0x0101, 0x0103, 0x010D, 0x010F, 0x0110,
+ 0x0112, 0x011E, 0x0121, 0x0123, 0x012D, 0x012F,
+ 0x0130, 0x0132, 0x013E, 0x01D0, 0x01D2, 0x01DE,
+ 0x01E1, 0x01E3, 0x01ED, 0x01EF, 0x01F0, 0x01F2,
+ 0x01FE, 0x0200, 0x0202, 0x020E, 0x0211, 0x0213,
+ 0x021D, 0x021F, 0x0220, 0x0222, 0x022E, 0x0231,
+ 0x0233, 0x023D, 0x023F, 0x02D1, 0x02D3, 0x02DD,
+ 0x02DF, 0x02E0, 0x02E2, 0x02EE, 0x02F1, 0x02F3,
+ 0x02FD, 0x02FF, 0x0301, 0x0303, 0x030D, 0x030F,
+ 0x0310, 0x0312, 0x031E, 0x0321, 0x0323, 0x032D,
+ 0x032F, 0x0330, 0x0332, 0x033E, 0x03D0, 0x03D2,
+ 0x03DE, 0x03E1, 0x03E3, 0x03ED, 0x03EF, 0x03F0,
+ 0x03F2, 0x03FE, 0x0D01, 0x0D03, 0x0D0D, 0x0D0F,
+ 0x0D10, 0x0D12, 0x0D1E, 0x0D21, 0x0D23, 0x0D2D,
+ 0x0D2F, 0x0D30, 0x0D32, 0x0D3E, 0x0DD0, 0x0DD2,
+ 0x0DDE, 0x0DE1, 0x0DE3, 0x0DED, 0x0DEF, 0x0DF0,
+ 0x0DF2, 0x0DFE, 0x0E00, 0x0E02, 0x0E0E, 0x0E11,
+ 0x0E13, 0x0E1D, 0x0E1F, 0x0E20, 0x0E22, 0x0E2E,
+ 0x0E31, 0x0E33, 0x0E3D, 0x0E3F, 0x0ED1, 0x0ED3,
+ 0x0EDD, 0x0EDF, 0x0EE0, 0x0EE2, 0x0EEE, 0x0EF1,
+ 0x0EF3, 0x0EFD, 0x0EFF, 0x0F01, 0x0F03, 0x0F0D,
+ 0x0F0F, 0x0F10, 0x0F12, 0x0F1E, 0x0F21, 0x0F23,
+ 0x0F2D, 0x0F2F, 0x0F30, 0x0F32, 0x0F3E, 0x0FD0,
+ 0x0FD2, 0x0FDE, 0x0FE1, 0x0FE3, 0x0FED, 0x0FEF,
+ 0x0FF0, 0x0FF2, 0x0FFE, 0x1001, 0x1003, 0x100D,
+ 0x100F, 0x1010, 0x1012, 0x101E, 0x1021, 0x1023,
+ 0x102D, 0x102F, 0x1030, 0x1032, 0x103E, 0x10D0,
+ 0x10D2, 0x10DE, 0x10E1, 0x10E3, 0x10ED, 0x10EF,
+ 0x10F0, 0x10F2, 0x10FE, 0x1100, 0x1102, 0x110E,
+ 0x1111, 0x1113, 0x111D, 0x111F, 0x1120, 0x1122,
+ 0x112E, 0x1131, 0x1133, 0x113D, 0x113F, 0x11D1,
+ 0x11D3, 0x11DD, 0x11DF, 0x11E0, 0x11E2, 0x11EE,
+ 0x11F1, 0x11F3, 0x11FD, 0x11FF, 0x1201, 0x1203,
+ 0x120D, 0x120F, 0x1210, 0x1212, 0x121E, 0x1221,
+ 0x1223, 0x122D, 0x122F, 0x1230, 0x1232, 0x123E,
+ 0x12D0, 0x12D2, 0x12DE, 0x12E1, 0x12E3, 0x12ED,
+ 0x12EF, 0x12F0, 0x12F2, 0x12FE, 0x1300, 0x1302,
+ 0x130E, 0x1311, 0x1313, 0x131D, 0x131F, 0x1320,
+ 0x1322, 0x132E, 0x1331, 0x1333, 0x133D, 0x133F,
+ 0x13D1, 0x13D3, 0x13DD, 0x13DF, 0x13E0, 0x13E2,
+ 0x13EE, 0x13F1, 0x13F3, 0x13FD, 0x13FF, 0x1D00,
+ 0x1D02, 0x1D0E, 0x1D11, 0x1D13, 0x1D1D, 0x1D1F,
+ 0x1D20, 0x1D22, 0x1D2E, 0x1D31, 0x1D33, 0x1D3D,
+ 0x1D3F, 0x1DD1, 0x1DD3, 0x1DDD, 0x1DDF, 0x1DE0,
+ 0x1DE2, 0x1DEE, 0x1DF1, 0x1DF3, 0x1DFD, 0x1DFF,
+ 0x1E01, 0x1E03, 0x1E0D, 0x1E0F, 0x1E10, 0x1E12,
+ 0x1E1E, 0x1E21, 0x1E23, 0x1E2D, 0x1E2F, 0x1E30,
+ 0x1E32, 0x1E3E, 0x1ED0, 0x1ED2, 0x1EDE, 0x1EE1,
+ 0x1EE3, 0x1EED, 0x1EEF, 0x1EF0, 0x1EF2, 0x1EFE,
+ 0x1F00, 0x1F02, 0x1F0E, 0x1F11, 0x1F13, 0x1F1D,
+ 0x1F1F, 0x1F20, 0x1F22, 0x1F2E, 0x1F31, 0x1F33,
+ 0x1F3D, 0x1F3F, 0x1FD1, 0x1FD3, 0x1FDD, 0x1FDF,
+ 0x1FE0, 0x1FE2, 0x1FEE, 0x1FF1, 0x1FF3, 0x1FFD,
+ 0x1FFF, 0x2000, 0x2002, 0x200E, 0x2011, 0x2013,
+ 0x201D, 0x201F, 0x2020, 0x2022, 0x202E, 0x2031,
+ 0x2033, 0x203D, 0x203F, 0x20D1, 0x20D3, 0x20DD,
+ 0x20DF, 0x20E0, 0x20E2, 0x20EE, 0x20F1, 0x20F3,
+ 0x20FD, 0x20FF, 0x2101, 0x2103, 0x210D, 0x210F,
+ 0x2110, 0x2112, 0x211E, 0x2121, 0x2123, 0x212D,
+ 0x212F, 0x2130, 0x2132, 0x213E, 0x21D0, 0x21D2,
+ 0x21DE, 0x21E1, 0x21E3, 0x21ED, 0x21EF, 0x21F0,
+ 0x21F2, 0x21FE, 0x2200, 0x2202, 0x220E, 0x2211,
+ 0x2213, 0x221D, 0x221F, 0x2220, 0x2222, 0x222E,
+ 0x2231, 0x2233, 0x223D, 0x223F, 0x22D1, 0x22D3,
+ 0x22DD, 0x22DF, 0x22E0, 0x22E2, 0x22EE, 0x22F1,
+ 0x22F3, 0x22FD, 0x22FF, 0x2301, 0x2303, 0x230D,
+ 0x230F, 0x2310, 0x2312, 0x231E, 0x2321, 0x2323,
+ 0x232D, 0x232F, 0x2330, 0x2332, 0x233E, 0x23D0,
+ 0x23D2, 0x23DE, 0x23E1, 0x23E3, 0x23ED, 0x23EF,
+ 0x23F0, 0x23F2, 0x23FE, 0x2D01, 0x2D03, 0x2D0D,
+ 0x2D0F, 0x2D10, 0x2D12, 0x2D1E, 0x2D21, 0x2D23,
+ 0x2D2D, 0x2D2F, 0x2D30, 0x2D32, 0x2D3E, 0x2DD0,
+ 0x2DD2, 0x2DDE, 0x2DE1, 0x2DE3, 0x2DED, 0x2DEF,
+ 0x2DF0, 0x2DF2, 0x2DFE, 0x2E00, 0x2E02, 0x2E0E,
+ 0x2E11, 0x2E13, 0x2E1D, 0x2E1F, 0x2E20, 0x2E22,
+ 0x2E2E, 0x2E31, 0x2E33, 0x2E3D, 0x2E3F, 0x2ED1,
+ 0x2ED3, 0x2EDD, 0x2EDF, 0x2EE0, 0x2EE2, 0x2EEE,
+ 0x2EF1, 0x2EF3, 0x2EFD, 0x2EFF, 0x2F01, 0x2F03,
+ 0x2F0D, 0x2F0F, 0x2F10, 0x2F12, 0x2F1E, 0x2F21,
+ 0x2F23, 0x2F2D, 0x2F2F, 0x2F30, 0x2F32, 0x2F3E,
+ 0x2FD0, 0x2FD2, 0x2FDE, 0x2FE1, 0x2FE3, 0x2FED,
+ 0x2FEF, 0x2FF0, 0x2FF2, 0x2FFE, 0x3001, 0x3003,
+ 0x300D, 0x300F, 0x3010, 0x3012, 0x301E, 0x3021,
+ 0x3023, 0x302D, 0x302F, 0x3030, 0x3032, 0x303E,
+ 0x30D0, 0x30D2, 0x30DE, 0x30E1, 0x30E3, 0x30ED,
+ 0x30EF, 0x30F0, 0x30F2, 0x30FE, 0x3100, 0x3102,
+ 0x310E, 0x3111, 0x3113, 0x311D, 0x311F, 0x3120,
+ 0x3122, 0x312E, 0x3131, 0x3133, 0x313D, 0x313F,
+ 0x31D1, 0x31D3, 0x31DD, 0x31DF, 0x31E0, 0x31E2,
+ 0x31EE, 0x31F1, 0x31F3, 0x31FD, 0x31FF, 0x3201,
+ 0x3203, 0x320D, 0x320F, 0x3210, 0x3212, 0x321E,
+ 0x3221, 0x3223, 0x322D, 0x322F, 0x3230, 0x3232,
+ 0x323E, 0x32D0, 0x32D2, 0x32DE, 0x32E1, 0x32E3,
+ 0x32ED, 0x32EF, 0x32F0, 0x32F2, 0x32FE, 0x3300,
+ 0x3302, 0x330E, 0x3311, 0x3313, 0x331D, 0x331F,
+ 0x3320, 0x3322, 0x332E, 0x3331, 0x3333, 0x333D,
+ 0x333F, 0x33D1, 0x33D3, 0x33DD, 0x33DF, 0x33E0,
+ 0x33E2, 0x33EE, 0x33F1, 0x33F3, 0x33FD, 0x33FF,
+ 0x3D00, 0x3D02, 0x3D0E, 0x3D11, 0x3D13, 0x3D1D,
+ 0x3D1F, 0x3D20, 0x3D22, 0x3D2E, 0x3D31, 0x3D33,
+ 0x3D3D, 0x3D3F, 0x3DD1, 0x3DD3, 0x3DDD, 0x3DDF,
+ 0x3DE0, 0x3DE2, 0x3DEE, 0x3DF1, 0x3DF3, 0x3DFD,
+ 0x3DFF, 0x3E01, 0x3E03, 0x3E0D, 0x3E0F, 0x3E10,
+ 0x3E12, 0x3E1E, 0x3E21, 0x3E23, 0x3E2D, 0x3E2F,
+ 0x3E30, 0x3E32, 0x3E3E, 0x3ED0, 0x3ED2, 0x3EDE,
+ 0x3EE1, 0x3EE3, 0x3EED, 0x3EEF, 0x3EF0, 0x3EF2,
+ 0x3EFE, 0x3F00, 0x3F02, 0x3F0E, 0x3F11, 0x3F13,
+ 0x3F1D, 0x3F1F, 0x3F20, 0x3F22, 0x3F2E, 0x3F31,
+ 0x3F33, 0x3F3D, 0x3F3F, 0x3FD1, 0x3FD3, 0x3FDD,
+ 0x3FDF, 0x3FE0, 0x3FE2, 0x3FEE, 0x3FF1, 0x3FF3,
+ 0x3FFD, 0x3FFF, 0xD001, 0xD003, 0xD00D, 0xD00F,
+ 0xD010, 0xD012, 0xD01E, 0xD021, 0xD023, 0xD02D,
+ 0xD02F, 0xD030, 0xD032, 0xD03E, 0xD0D0, 0xD0D2,
+ 0xD0DE, 0xD0E1, 0xD0E3, 0xD0ED, 0xD0EF, 0xD0F0,
+ 0xD0F2, 0xD0FE, 0xD100, 0xD102, 0xD10E, 0xD111,
+ 0xD113, 0xD11D, 0xD11F, 0xD120, 0xD122, 0xD12E,
+ 0xD131, 0xD133, 0xD13D, 0xD13F, 0xD1D1, 0xD1D3,
+ 0xD1DD, 0xD1DF, 0xD1E0, 0xD1E2, 0xD1EE, 0xD1F1,
+ 0xD1F3, 0xD1FD, 0xD1FF, 0xD201, 0xD203, 0xD20D,
+ 0xD20F, 0xD210, 0xD212, 0xD21E, 0xD221, 0xD223,
+ 0xD22D, 0xD22F, 0xD230, 0xD232, 0xD23E, 0xD2D0,
+ 0xD2D2, 0xD2DE, 0xD2E1, 0xD2E3, 0xD2ED, 0xD2EF,
+ 0xD2F0, 0xD2F2, 0xD2FE, 0xD300, 0xD302, 0xD30E,
+ 0xD311, 0xD313, 0xD31D, 0xD31F, 0xD320, 0xD322,
+ 0xD32E, 0xD331, 0xD333, 0xD33D, 0xD33F, 0xD3D1,
+ 0xD3D3, 0xD3DD, 0xD3DF, 0xD3E0, 0xD3E2, 0xD3EE,
+ 0xD3F1, 0xD3F3, 0xD3FD, 0xD3FF, 0xDD00, 0xDD02,
+ 0xDD0E, 0xDD11, 0xDD13, 0xDD1D, 0xDD1F, 0xDD20,
+ 0xDD22, 0xDD2E, 0xDD31, 0xDD33, 0xDD3D, 0xDD3F,
+ 0xDDD1, 0xDDD3, 0xDDDD, 0xDDDF, 0xDDE0, 0xDDE2,
+ 0xDDEE, 0xDDF1, 0xDDF3, 0xDDFD, 0xDDFF, 0xDE01,
+ 0xDE03, 0xDE0D, 0xDE0F, 0xDE10, 0xDE12, 0xDE1E,
+ 0xDE21, 0xDE23, 0xDE2D, 0xDE2F, 0xDE30, 0xDE32,
+ 0xDE3E, 0xDED0, 0xDED2, 0xDEDE, 0xDEE1, 0xDEE3,
+ 0xDEED, 0xDEEF, 0xDEF0, 0xDEF2, 0xDEFE, 0xDF00,
+ 0xDF02, 0xDF0E, 0xDF11, 0xDF13, 0xDF1D, 0xDF1F,
+ 0xDF20, 0xDF22, 0xDF2E, 0xDF31, 0xDF33, 0xDF3D,
+ 0xDF3F, 0xDFD1, 0xDFD3, 0xDFDD, 0xDFDF, 0xDFE0,
+ 0xDFE2, 0xDFEE, 0xDFF1, 0xDFF3, 0xDFFD, 0xDFFF,
+ 0xE000, 0xE002, 0xE00E, 0xE011, 0xE013, 0xE01D,
+ 0xE01F, 0xE020, 0xE022, 0xE02E, 0xE031, 0xE033,
+ 0xE03D, 0xE03F, 0xE0D1, 0xE0D3, 0xE0DD, 0xE0DF,
+ 0xE0E0, 0xE0E2, 0xE0EE, 0xE0F1, 0xE0F3, 0xE0FD,
+ 0xE0FF, 0xE101, 0xE103, 0xE10D, 0xE10F, 0xE110,
+ 0xE112, 0xE11E, 0xE121, 0xE123, 0xE12D, 0xE12F,
+ 0xE130, 0xE132, 0xE13E, 0xE1D0, 0xE1D2, 0xE1DE,
+ 0xE1E1, 0xE1E3, 0xE1ED, 0xE1EF, 0xE1F0, 0xE1F2,
+ 0xE1FE, 0xE200, 0xE202, 0xE20E, 0xE211, 0xE213,
+ 0xE21D, 0xE21F, 0xE220, 0xE222, 0xE22E, 0xE231,
+ 0xE233, 0xE23D, 0xE23F, 0xE2D1, 0xE2D3, 0xE2DD,
+ 0xE2DF, 0xE2E0, 0xE2E2, 0xE2EE, 0xE2F1, 0xE2F3,
+ 0xE2FD, 0xE2FF, 0xE301, 0xE303, 0xE30D, 0xE30F,
+ 0xE310, 0xE312, 0xE31E, 0xE321, 0xE323, 0xE32D,
+ 0xE32F, 0xE330, 0xE332, 0xE33E, 0xE3D0, 0xE3D2,
+ 0xE3DE, 0xE3E1, 0xE3E3, 0xE3ED, 0xE3EF, 0xE3F0,
+ 0xE3F2, 0xE3FE, 0xED01, 0xED03, 0xED0D, 0xED0F,
+ 0xED10, 0xED12, 0xED1E, 0xED21, 0xED23, 0xED2D,
+ 0xED2F, 0xED30, 0xED32, 0xED3E, 0xEDD0, 0xEDD2,
+ 0xEDDE, 0xEDE1, 0xEDE3, 0xEDED, 0xEDEF, 0xEDF0,
+ 0xEDF2, 0xEDFE, 0xEE00, 0xEE02, 0xEE0E, 0xEE11,
+ 0xEE13, 0xEE1D, 0xEE1F, 0xEE20, 0xEE22, 0xEE2E,
+ 0xEE31, 0xEE33, 0xEE3D, 0xEE3F, 0xEED1, 0xEED3,
+ 0xEEDD, 0xEEDF, 0xEEE0, 0xEEE2, 0xEEEE, 0xEEF1,
+ 0xEEF3, 0xEEFD, 0xEEFF, 0xEF01, 0xEF03, 0xEF0D,
+ 0xEF0F, 0xEF10, 0xEF12, 0xEF1E, 0xEF21, 0xEF23,
+ 0xEF2D, 0xEF2F, 0xEF30, 0xEF32, 0xEF3E, 0xEFD0,
+ 0xEFD2, 0xEFDE, 0xEFE1, 0xEFE3, 0xEFED, 0xEFEF,
+ 0xEFF0, 0xEFF2, 0xEFFE, 0xF001, 0xF003, 0xF00D,
+ 0xF00F, 0xF010, 0xF012, 0xF01E, 0xF021, 0xF023,
+ 0xF02D, 0xF02F, 0xF030, 0xF032, 0xF03E, 0xF0D0,
+ 0xF0D2, 0xF0DE, 0xF0E1, 0xF0E3, 0xF0ED, 0xF0EF,
+ 0xF0F0, 0xF0F2, 0xF0FE, 0xF100, 0xF102, 0xF10E,
+ 0xF111, 0xF113, 0xF11D, 0xF11F, 0xF120, 0xF122,
+ 0xF12E, 0xF131, 0xF133, 0xF13D, 0xF13F, 0xF1D1,
+ 0xF1D3, 0xF1DD, 0xF1DF, 0xF1E0, 0xF1E2, 0xF1EE,
+ 0xF1F1, 0xF1F3, 0xF1FD, 0xF1FF, 0xF201, 0xF203,
+ 0xF20D, 0xF20F, 0xF210, 0xF212, 0xF21E, 0xF221,
+ 0xF223, 0xF22D, 0xF22F, 0xF230, 0xF232, 0xF23E,
+ 0xF2D0, 0xF2D2, 0xF2DE, 0xF2E1, 0xF2E3, 0xF2ED,
+ 0xF2EF, 0xF2F0, 0xF2F2, 0xF2FE, 0xF300, 0xF302,
+ 0xF30E, 0xF311, 0xF313, 0xF31D, 0xF31F, 0xF320,
+ 0xF322, 0xF32E, 0xF331, 0xF333, 0xF33D, 0xF33F,
+ 0xF3D1, 0xF3D3, 0xF3DD, 0xF3DF, 0xF3E0, 0xF3E2,
+ 0xF3EE, 0xF3F1, 0xF3F3, 0xF3FD, 0xF3FF, 0xFD00,
+ 0xFD02, 0xFD0E, 0xFD11, 0xFD13, 0xFD1D, 0xFD1F,
+ 0xFD20, 0xFD22, 0xFD2E, 0xFD31, 0xFD33, 0xFD3D,
+ 0xFD3F, 0xFDD1, 0xFDD3, 0xFDDD, 0xFDDF, 0xFDE0,
+ 0xFDE2, 0xFDEE, 0xFDF1, 0xFDF3, 0xFDFD, 0xFDFF,
+ 0xFE01, 0xFE03, 0xFE0D, 0xFE0F, 0xFE10, 0xFE12,
+ 0xFE1E, 0xFE21, 0xFE23, 0xFE2D, 0xFE2F, 0xFE30,
+ 0xFE32, 0xFE3E, 0xFED0, 0xFED2, 0xFEDE, 0xFEE1,
+ 0xFEE3, 0xFEED, 0xFEEF, 0xFEF0, 0xFEF2, 0xFEFE,
+ 0xFF00, 0xFF02, 0xFF0E, 0xFF11, 0xFF13, 0xFF1D,
+ 0xFF1F, 0xFF20, 0xFF22, 0xFF2E, 0xFF31, 0xFF33,
+ 0xFF3D, 0xFF3F, 0xFFD1, 0xFFD3, 0xFFDD, 0xFFDF,
+ 0xFFE0, 0xFFE2, 0xFFEE, 0xFFF1, 0xFFF3, 0xFFFD,
+ 0xFFFF,
+};
+
+#define ON2AVC_CB7_CODES 3281
+static const uint32_t on2avc_cb7_codes[ON2AVC_CB7_CODES] = {
+ 0x00000, 0x000EA, 0x000E6, 0x000F4, 0x000F6, 0x00047,
+ 0x003E2, 0x004A7, 0x00044, 0x004D3, 0x0082A, 0x0026E,
+ 0x0020E, 0x008A5, 0x02603, 0x02895, 0x049B0, 0x02894,
+ 0x007BE, 0x0069E, 0x01154, 0x01153, 0x0095F, 0x0038E,
+ 0x004AC, 0x0128E, 0x00E5E, 0x00992, 0x02A84, 0x0386A,
+ 0x03F6F, 0x01C54, 0x005D4, 0x00AFB, 0x001BE, 0x00258,
+ 0x00A59, 0x00043, 0x004A6, 0x004D7, 0x00040, 0x0006C,
+ 0x007FF, 0x00D39, 0x0005B, 0x00066, 0x0034A, 0x00124,
+ 0x004B6, 0x00626, 0x0071F, 0x014A3, 0x014A2, 0x0083E,
+ 0x032D4, 0x049B3, 0x0045E, 0x00ED5, 0x02896, 0x00ABA,
+ 0x0107B, 0x009EC, 0x0082C, 0x0082B, 0x00D38, 0x0072B,
+ 0x004FC, 0x049B2, 0x050B1, 0x003FE, 0x009EB, 0x049B1,
+ 0x00966, 0x00F75, 0x03F70, 0x007BC, 0x00054, 0x00394,
+ 0x000E8, 0x0052F, 0x0057A, 0x00458, 0x0FB4B, 0x01C55,
+ 0x00948, 0x032D6, 0x00ED6, 0x0A05F, 0x050B3, 0x00BBD,
+ 0x0197E, 0x024FC, 0x020C6, 0x0094A, 0x0386B, 0x1F2FF,
+ 0x050B4, 0x0A060, 0x0FB4C, 0x009ED, 0x02A85, 0x0FB4D,
+ 0x02605, 0x00ABB, 0x009A2, 0x0145B, 0x0A05D, 0x03F71,
+ 0x00BFF, 0x1F2FE, 0x0FB49, 0x0FB48, 0x050B2, 0x01155,
+ 0x01FD6, 0x032D5, 0x00976, 0x02604, 0x00A5A, 0x0A05E,
+ 0x0FB4A, 0x00DB9, 0x0A063, 0x1F307, 0x0FB4F, 0x1F306,
+ 0x049B4, 0x0FB50, 0x0FB51, 0x050B6, 0x1F308, 0x050B7,
+ 0x1F30A, 0x1F309, 0x0A064, 0x1F30B, 0x0A066, 0x06535,
+ 0x020C7, 0x0A065, 0x032D7, 0x0FB52, 0x02897, 0x0077A,
+ 0x03F72, 0x0FB4E, 0x050B5, 0x0076E, 0x1F301, 0x1F302,
+ 0x06533, 0x01FD7, 0x1F300, 0x0A061, 0x1F304, 0x1F303,
+ 0x07E54, 0x024FD, 0x1F305, 0x06534, 0x02606, 0x0A062,
+ 0x007C0, 0x0A06A, 0x1F30F, 0x0FB54, 0x0386D, 0x009E6,
+ 0x1F310, 0x06538, 0x00DBA, 0x014A4, 0x050B9, 0x1F311,
+ 0x0A06B, 0x0128F, 0x07E55, 0x1F312, 0x0FB55, 0x01C56,
+ 0x07E56, 0x0FB56, 0x1F313, 0x050BA, 0x01C57, 0x02608,
+ 0x0A067, 0x1F30D, 0x1F30C, 0x02607, 0x0386C, 0x0A069,
+ 0x0A068, 0x01557, 0x00ED7, 0x06536, 0x1F30E, 0x0FB53,
+ 0x02609, 0x007BF, 0x050B8, 0x06537, 0x00DE5, 0x00392,
+ 0x03F69, 0x0A055, 0x0FB3C, 0x0A054, 0x00AB7, 0x050AB,
+ 0x0FB3D, 0x00CE6, 0x009E8, 0x014A1, 0x049A8, 0x1F2ED,
+ 0x02890, 0x009E9, 0x049A9, 0x1F2EE, 0x032D1, 0x020C4,
+ 0x049AA, 0x0A056, 0x0FB3E, 0x0FB3F, 0x0A051, 0x0A052,
+ 0x0A053, 0x0FB39, 0x0A050, 0x0096E, 0x0FB3A, 0x1F2EB,
+ 0x029FE, 0x007FE, 0x0128D, 0x049A7, 0x1F2EC, 0x07E50,
+ 0x00E36, 0x03867, 0x0FB3B, 0x006EA, 0x03F6B, 0x1F2F4,
+ 0x1F2F3, 0x03868, 0x049AB, 0x1F2F6, 0x029FF, 0x1F2F5,
+ 0x0A05A, 0x07E52, 0x1F2F7, 0x07E51, 0x03F6C, 0x1F2FA,
+ 0x07E53, 0x025FF, 0x1F2F8, 0x1F2F9, 0x009A0, 0x06532,
+ 0x0FB45, 0x024FB, 0x008B9, 0x01D7D, 0x0FB40, 0x01FD3,
+ 0x0FB42, 0x0A058, 0x050AC, 0x0A057, 0x0FB41, 0x0A059,
+ 0x1F2F0, 0x1F2EF, 0x0FB43, 0x03F6A, 0x0FB44, 0x020C5,
+ 0x1F2F1, 0x1F2F2, 0x004FE, 0x02601, 0x00A58, 0x01FD5,
+ 0x049AD, 0x00A46, 0x02A80, 0x050AD, 0x009E5, 0x01B56,
+ 0x02A81, 0x00A36, 0x01556, 0x032D3, 0x02A82, 0x0FB47,
+ 0x1F2FD, 0x050AE, 0x004BA, 0x00A6B, 0x03F6D, 0x049AE,
+ 0x01317, 0x009A1, 0x00AB8, 0x02891, 0x03869, 0x01FD4,
+ 0x049AC, 0x1F2FB, 0x0FB46, 0x0A05B, 0x02600, 0x032D2,
+ 0x0137E, 0x01C53, 0x02892, 0x00BFE, 0x0A05C, 0x1F2FC,
+ 0x00CE7, 0x00058, 0x00FF7, 0x009EA, 0x00068, 0x00060,
+ 0x004D2, 0x004BD, 0x000EE, 0x003A4, 0x006E2, 0x0137F,
+ 0x0197D, 0x006EB, 0x050B0, 0x03F6E, 0x00E37, 0x00316,
+ 0x02893, 0x004CB, 0x006EE, 0x01152, 0x008AE, 0x0067E,
+ 0x00991, 0x0145A, 0x00AB9, 0x049AF, 0x02A83, 0x00A6C,
+ 0x0045F, 0x02602, 0x006E1, 0x050AF, 0x012D2, 0x0073F,
+ 0x00061, 0x00526, 0x004D6, 0x0013E, 0x003AE, 0x0005E,
+ 0x01D7E, 0x0289F, 0x00059, 0x0006A, 0x0082D, 0x00F77,
+ 0x009EE, 0x006E3, 0x00D3F, 0x1F32B, 0x02A8B, 0x00D3E,
+ 0x032DE, 0x0FB60, 0x02A8C, 0x020CC, 0x03874, 0x0045B,
+ 0x00DE8, 0x0082E, 0x00636, 0x012D6, 0x049B9, 0x0260C,
+ 0x01157, 0x06540, 0x0A073, 0x02504, 0x0289D, 0x050C2,
+ 0x00AFE, 0x0260D, 0x0289E, 0x00A6F, 0x0004E, 0x006EF,
+ 0x0099C, 0x00EDA, 0x0062E, 0x00048, 0x00A3A, 0x01292,
+ 0x013C2, 0x00A72, 0x0012A, 0x028A0, 0x02507, 0x00174,
+ 0x00DE9, 0x00ABF, 0x00EDE, 0x01146, 0x013C3, 0x032E1,
+ 0x049BA, 0x03875, 0x03876, 0x00824, 0x0077B, 0x032E2,
+ 0x01050, 0x00677, 0x00EDB, 0x0145C, 0x02505, 0x032DF,
+ 0x019C0, 0x050C3, 0x06541, 0x0A074, 0x032E0, 0x00A37,
+ 0x02506, 0x00ABE, 0x00E78, 0x02A8D, 0x001B4, 0x02A8E,
+ 0x01D7F, 0x001A4, 0x00DEA, 0x1F32F, 0x050C5, 0x009EF,
+ 0x00977, 0x020CD, 0x01B60, 0x019C3, 0x017DE, 0x0131A,
+ 0x0260F, 0x0A075, 0x01C5C, 0x0FB61, 0x07E62, 0x00E79,
+ 0x02610, 0x0A076, 0x014A7, 0x02611, 0x009FA, 0x007C1,
+ 0x0145D, 0x1F32C, 0x049BB, 0x019C1, 0x06543, 0x1F32D,
+ 0x06544, 0x01FD8, 0x06542, 0x01B5E, 0x06545, 0x1F32E,
+ 0x019C2, 0x005F4, 0x0260E, 0x050C4, 0x01B5F, 0x01C5B,
+ 0x032E3, 0x1F339, 0x1F33A, 0x1F338, 0x0FB63, 0x028A1,
+ 0x1F33B, 0x0FB64, 0x049BC, 0x0A07A, 0x1F33C, 0x0A07B,
+ 0x032E4, 0x07E63, 0x1F33E, 0x07E64, 0x1F33D, 0x0FB65,
+ 0x028A2, 0x02612, 0x02613, 0x050C6, 0x00967, 0x0155A,
+ 0x03F78, 0x1F330, 0x0A077, 0x03877, 0x0A078, 0x1F333,
+ 0x1F331, 0x1F332, 0x03878, 0x1F335, 0x1F336, 0x06546,
+ 0x1F334, 0x06547, 0x1F337, 0x0A079, 0x0FB62, 0x006FE,
+ 0x1F342, 0x0FB69, 0x008A7, 0x009FB, 0x1F343, 0x1F344,
+ 0x050C7, 0x0654A, 0x020CF, 0x1F345, 0x020CE, 0x01FD9,
+ 0x028A5, 0x0A07C, 0x0A07D, 0x050C8, 0x013C6, 0x03F7A,
+ 0x0A07E, 0x0387B, 0x01C5D, 0x03879, 0x06548, 0x1F33F,
+ 0x028A3, 0x00DBE, 0x03F79, 0x1F340, 0x0FB66, 0x028A4,
+ 0x008B2, 0x0FB67, 0x0387A, 0x0131B, 0x005D5, 0x06549,
+ 0x1F341, 0x0FB68, 0x0155B, 0x00DE6, 0x07E59, 0x1F318,
+ 0x00266, 0x00823, 0x01B57, 0x0FB58, 0x1F319, 0x0386F,
+ 0x01B58, 0x02899, 0x050BB, 0x00DBB, 0x01B59, 0x032D9,
+ 0x050BC, 0x1F31A, 0x03F74, 0x032DA, 0x0A06D, 0x06539,
+ 0x03870, 0x0386E, 0x1F315, 0x1F314, 0x024FE, 0x0176A,
+ 0x032D8, 0x0A06C, 0x1F316, 0x07E57, 0x014A5, 0x049B5,
+ 0x07E58, 0x00D3A, 0x0075B, 0x02898, 0x1F317, 0x0FB57,
+ 0x03F73, 0x01B5A, 0x0FB5B, 0x050BE, 0x1F31F, 0x0FB5A,
+ 0x0653B, 0x1F320, 0x0FB5C, 0x07E5C, 0x07E5D, 0x1F322,
+ 0x050BF, 0x0A06F, 0x1F321, 0x0FB5D, 0x1F325, 0x1F323,
+ 0x1F324, 0x01C58, 0x00ED8, 0x0289A, 0x1F326, 0x03F77,
+ 0x013C0, 0x0653A, 0x03F75, 0x1F31B, 0x024FF, 0x03F76,
+ 0x0FB59, 0x07E5A, 0x0A06E, 0x02500, 0x07E5B, 0x02A86,
+ 0x050BD, 0x1F31C, 0x032DB, 0x1F31E, 0x1F31D, 0x049B6,
+ 0x00C49, 0x1F329, 0x1F328, 0x00BBE, 0x008A6, 0x03871,
+ 0x01B5B, 0x02A88, 0x01558, 0x020C9, 0x0FB5F, 0x049B7,
+ 0x014A6, 0x07E5F, 0x1F32A, 0x0197F, 0x01B5C, 0x03872,
+ 0x00726, 0x01156, 0x02501, 0x0104F, 0x00C48, 0x032DC,
+ 0x0653C, 0x0176B, 0x1F327, 0x0653D, 0x0289B, 0x07E5E,
+ 0x0FB5E, 0x0176E, 0x0A071, 0x0A070, 0x0260A, 0x00993,
+ 0x020C8, 0x0176F, 0x02A87, 0x0289C, 0x00042, 0x00CE8,
+ 0x01C5A, 0x00F76, 0x008BA, 0x001C8, 0x02A8A, 0x02503,
+ 0x00136, 0x00A6E, 0x020CB, 0x00A5B, 0x008AF, 0x00ED9,
+ 0x03873, 0x0653F, 0x07E61, 0x050C1, 0x007A9, 0x0067F,
+ 0x013C1, 0x01559, 0x00D3B, 0x00DE7, 0x01B5D, 0x050C0,
+ 0x0260B, 0x02A89, 0x0653E, 0x0A072, 0x07E60, 0x049B8,
+ 0x00A6D, 0x02502, 0x00E5F, 0x012D3, 0x020CA, 0x0015D,
+ 0x032DD, 0x01C59, 0x0018E, 0x000E0, 0x07E77, 0x07E78,
+ 0x07E76, 0x049C5, 0x00BEA, 0x0A090, 0x0A08F, 0x00A3B,
+ 0x03F80, 0x0655A, 0x0655B, 0x050D1, 0x0A091, 0x1F37E,
+ 0x1F37F, 0x1F37C, 0x1F37D, 0x0FB77, 0x0655D, 0x050D2,
+ 0x1F380, 0x0655C, 0x02618, 0x049C3, 0x1F379, 0x0A08D,
+ 0x07E72, 0x07E73, 0x1F37B, 0x1F37A, 0x0A08E, 0x0145E,
+ 0x06558, 0x06559, 0x07E74, 0x049C4, 0x0083F, 0x07E75,
+ 0x0FB76, 0x007AA, 0x008A8, 0x1F382, 0x0FB7B, 0x007AB,
+ 0x004B2, 0x050D5, 0x07E7C, 0x07E7B, 0x032E8, 0x0261A,
+ 0x07E7D, 0x1F383, 0x03F81, 0x1F384, 0x0655F, 0x0FB7C,
+ 0x0A094, 0x0A095, 0x020D3, 0x1F385, 0x050D6, 0x050D7,
+ 0x01B61, 0x0FB78, 0x07E79, 0x028A7, 0x07E7A, 0x0A092,
+ 0x1F381, 0x050D3, 0x0FB79, 0x032E7, 0x0655E, 0x0A093,
+ 0x01DA2, 0x0053B, 0x02619, 0x050D4, 0x0FB7A, 0x020D2,
+ 0x0094B, 0x0A09A, 0x0FB7F, 0x0FB7E, 0x03884, 0x00C4A,
+ 0x0FB80, 0x1F38B, 0x019C6, 0x032E9, 0x01C5F, 0x0FB82,
+ 0x1F38C, 0x0FB81, 0x050D9, 0x07E7E, 0x1F38D, 0x1F38E,
+ 0x03885, 0x050DB, 0x07E7F, 0x06562, 0x050DA, 0x00E7A,
+ 0x02A92, 0x1F386, 0x0A096, 0x06560, 0x06561, 0x1F389,
+ 0x1F387, 0x1F388, 0x050D8, 0x0A098, 0x0FB7D, 0x02A93,
+ 0x0A097, 0x01FDC, 0x1F38A, 0x0A099, 0x020D4, 0x07E82,
+ 0x0FB89, 0x1F394, 0x07E81, 0x0A09E, 0x0FB8B, 0x1F395,
+ 0x07E83, 0x0FB8A, 0x028A8, 0x1F397, 0x1F396, 0x0A09F,
+ 0x0FB8C, 0x03F82, 0x049C6, 0x1F398, 0x1F399, 0x06563,
+ 0x02508, 0x03886, 0x07E84, 0x012E6, 0x0A09B, 0x1F38F,
+ 0x032EA, 0x0FB85, 0x1F390, 0x0FB86, 0x0FB83, 0x0FB84,
+ 0x0A09C, 0x1F392, 0x1F391, 0x0FB87, 0x02A94, 0x1F393,
+ 0x0A09D, 0x07E80, 0x0FB88, 0x006B6, 0x1F39D, 0x1F39E,
+ 0x0A0A1, 0x0A0A2, 0x0155E, 0x1F39F, 0x0A0A3, 0x02509,
+ 0x020D5, 0x0A0A4, 0x1F3A0, 0x07E86, 0x06564, 0x01FDE,
+ 0x0FB90, 0x049C8, 0x06565, 0x050DE, 0x0A0A6, 0x07E87,
+ 0x0A0A5, 0x06566, 0x00E7B, 0x049C7, 0x1F39A, 0x0A0A0,
+ 0x050DC, 0x00DEC, 0x07E85, 0x0FB8D, 0x01FDD, 0x00CE9,
+ 0x050DD, 0x0FB8E, 0x1F39B, 0x03F83, 0x0051F, 0x1F39C,
+ 0x0FB8F, 0x01293, 0x009A3, 0x049BE, 0x1F34E, 0x1F34D,
+ 0x0654B, 0x0115A, 0x0A07F, 0x0654C, 0x00A47, 0x01C5E,
+ 0x049BF, 0x1F350, 0x1F34F, 0x0387C, 0x07E67, 0x1F351,
+ 0x07E66, 0x02A8F, 0x1F353, 0x07E68, 0x1F354, 0x1F352,
+ 0x0A080, 0x00BBF, 0x1F347, 0x1F348, 0x1F346, 0x0FB6A,
+ 0x032E5, 0x07E65, 0x1F349, 0x006E4, 0x012D7, 0x049BD,
+ 0x1F34A, 0x0FB6B, 0x050C9, 0x00DEB, 0x1F34C, 0x1F34B,
+ 0x0052E, 0x07E6A, 0x1F35F, 0x1F35E, 0x0A081, 0x0387D,
+ 0x1F361, 0x0654F, 0x1F360, 0x0A082, 0x0387E, 0x1F363,
+ 0x1F362, 0x050CA, 0x0A084, 0x1F365, 0x03F7D, 0x0A083,
+ 0x1F364, 0x032E6, 0x1F366, 0x0A085, 0x06550, 0x020D0,
+ 0x1F356, 0x1F355, 0x00A73, 0x1F357, 0x1F358, 0x1F359,
+ 0x07E69, 0x0654D, 0x1F35B, 0x0FB6C, 0x1F35A, 0x0654E,
+ 0x03F7B, 0x1F35D, 0x03F7C, 0x0FB6D, 0x1F35C, 0x009AA,
+ 0x03880, 0x1F36B, 0x0A086, 0x1F36A, 0x01FDA, 0x1F36C,
+ 0x0A087, 0x01051, 0x049C2, 0x0FB71, 0x07E6E, 0x0A088,
+ 0x03F7E, 0x06553, 0x1F36E, 0x1F36D, 0x06552, 0x028A6,
+ 0x02A90, 0x0A089, 0x1F36F, 0x03881, 0x0074A, 0x049C0,
+ 0x0FB6F, 0x0FB6E, 0x02614, 0x0FB70, 0x1F368, 0x1F367,
+ 0x07E6B, 0x0387F, 0x049C1, 0x07E6C, 0x06551, 0x050CB,
+ 0x014AA, 0x07E6D, 0x1F369, 0x02615, 0x0072C, 0x1F373,
+ 0x1F372, 0x008BB, 0x00450, 0x07E70, 0x1F375, 0x1F374,
+ 0x050CE, 0x03882, 0x1F376, 0x0FB74, 0x02617, 0x1F377,
+ 0x1F378, 0x07E71, 0x06557, 0x0FB75, 0x050CF, 0x050D0,
+ 0x0A08C, 0x03883, 0x02A91, 0x06555, 0x050CC, 0x06554,
+ 0x0A08A, 0x1F370, 0x050CD, 0x06556, 0x0FB72, 0x02616,
+ 0x07E6F, 0x0A08B, 0x01FDB, 0x0053A, 0x03F7F, 0x0FB73,
+ 0x1F371, 0x020D1, 0x01FE0, 0x1F3F9, 0x1F3F8, 0x02A98,
+ 0x00C4E, 0x0A0B6, 0x0FBB1, 0x1F3FA, 0x0FBB0, 0x1F3FC,
+ 0x1F3FD, 0x1F3FB, 0x0A0B7, 0x1F400, 0x1F401, 0x1F402,
+ 0x1F3FE, 0x1F3FF, 0x1F404, 0x1F405, 0x0FBB2, 0x1F403,
+ 0x1F3EF, 0x1F3F0, 0x1F3ED, 0x1F3EE, 0x1F3F3, 0x1F3F4,
+ 0x0FBAB, 0x1F3F1, 0x1F3F2, 0x0A0B5, 0x1F3F6, 0x1F3F5,
+ 0x0FBAC, 0x01052, 0x0FBAF, 0x1F3F7, 0x0FBAD, 0x0FBAE,
+ 0x004BC, 0x1F40D, 0x1F40E, 0x1F40C, 0x0FBB8, 0x049CC,
+ 0x1F410, 0x1F40F, 0x03F87, 0x0A0B9, 0x0A0BA, 0x1F412,
+ 0x0FBB9, 0x1F411, 0x1F415, 0x1F416, 0x1F413, 0x1F414,
+ 0x1F418, 0x0A0BB, 0x0FBBA, 0x1F417, 0x07E95, 0x07E93,
+ 0x1F406, 0x1F407, 0x0A0B8, 0x07E92, 0x0FBB5, 0x1F408,
+ 0x0FBB3, 0x0FBB4, 0x07E94, 0x0FBB7, 0x1F409, 0x0FBB6,
+ 0x03F86, 0x01DA3, 0x1F40B, 0x1F40A, 0x019C7, 0x06572,
+ 0x1F421, 0x1F420, 0x0250F, 0x00DBF, 0x1F422, 0x1F423,
+ 0x0FBBE, 0x050E2, 0x049CD, 0x1F425, 0x1F424, 0x07E97,
+ 0x1F427, 0x0FBC0, 0x1F428, 0x0FBBF, 0x1F426, 0x1F42A,
+ 0x1F42B, 0x1F429, 0x0A0C0, 0x013C7, 0x0A0BD, 0x1F419,
+ 0x0A0BC, 0x1F41C, 0x1F41D, 0x1F41E, 0x1F41A, 0x1F41B,
+ 0x0FBBC, 0x1F41F, 0x06571, 0x0FBBB, 0x01FE1, 0x0FBBD,
+ 0x0A0BF, 0x0A0BE, 0x07E96, 0x0FBC6, 0x1F437, 0x1F438,
+ 0x1F435, 0x1F436, 0x0A0C3, 0x1F43A, 0x1F439, 0x0FBC7,
+ 0x1F43B, 0x0FBC9, 0x0FBCA, 0x0FBC8, 0x07E99, 0x0A0C4,
+ 0x07E9A, 0x1F43C, 0x1F43D, 0x1F43E, 0x0A0C5, 0x050E4,
+ 0x0FBCB, 0x0FBCC, 0x050E3, 0x07E98, 0x0FBC2, 0x1F42C,
+ 0x0FBC1, 0x1F42F, 0x1F430, 0x1F42D, 0x1F42E, 0x0A0C1,
+ 0x1F432, 0x1F433, 0x0FBC3, 0x1F431, 0x0FBC5, 0x1F434,
+ 0x0FBC4, 0x0A0C2, 0x00AF6, 0x1F444, 0x0FBCF, 0x0261C,
+ 0x014AB, 0x0A0C8, 0x1F446, 0x1F445, 0x06573, 0x0261D,
+ 0x1F448, 0x1F447, 0x02A99, 0x0FBD1, 0x0A0C9, 0x1F449,
+ 0x0FBD0, 0x06574, 0x1F44C, 0x049CF, 0x1F44A, 0x1F44B,
+ 0x032EC, 0x1F440, 0x1F43F, 0x07E9B, 0x01B62, 0x0388A,
+ 0x1F441, 0x07E9C, 0x0A0C6, 0x00D6A, 0x0A0C7, 0x0FBCD,
+ 0x049CE, 0x00EDF, 0x0FBCE, 0x1F443, 0x1F442, 0x07E9D,
+ 0x03888, 0x0FB91, 0x1F3A8, 0x00E96, 0x00CEA, 0x0FB93,
+ 0x0FB94, 0x0FB92, 0x1F3A9, 0x03889, 0x0FB95, 0x0A0A7,
+ 0x0155F, 0x050E0, 0x0A0A8, 0x1F3AB, 0x1F3AA, 0x07E89,
+ 0x07E8A, 0x0A0AA, 0x0FB96, 0x0A0A9, 0x06567, 0x1F3A2,
+ 0x1F3A1, 0x02A95, 0x0250A, 0x06568, 0x1F3A4, 0x1F3A3,
+ 0x050DF, 0x02A96, 0x1F3A5, 0x06569, 0x00C4B, 0x00AFF,
+ 0x03887, 0x1F3A7, 0x1F3A6, 0x07E88, 0x0261B, 0x1F3BC,
+ 0x1F3BD, 0x1F3BA, 0x1F3BB, 0x0656C, 0x0FB97, 0x1F3BE,
+ 0x0656B, 0x1F3C0, 0x0FB98, 0x1F3C1, 0x07E8C, 0x1F3BF,
+ 0x1F3C2, 0x0FB9A, 0x0FB99, 0x0A0AC, 0x0656D, 0x0FB9B,
+ 0x1F3C4, 0x1F3C3, 0x07E8D, 0x049C9, 0x0A0AB, 0x1F3AE,
+ 0x1F3AC, 0x1F3AD, 0x1F3B1, 0x1F3B2, 0x1F3AF, 0x1F3B0,
+ 0x1F3B5, 0x1F3B6, 0x1F3B7, 0x1F3B3, 0x1F3B4, 0x0656A,
+ 0x1F3B9, 0x1F3B8, 0x07E8B, 0x03F84, 0x1F3CF, 0x1F3CE,
+ 0x032EB, 0x0250B, 0x0FB9E, 0x0A0AF, 0x1F3D0, 0x0A0AE,
+ 0x0A0B1, 0x1F3D1, 0x0A0B0, 0x049CA, 0x1F3D3, 0x1F3D4,
+ 0x0FBA0, 0x0FB9F, 0x1F3D2, 0x0FBA1, 0x0A0B2, 0x1F3D5,
+ 0x07E90, 0x07E8E, 0x1F3C6, 0x1F3C5, 0x0656E, 0x1F3C7,
+ 0x1F3C8, 0x0656F, 0x07E8F, 0x0FB9C, 0x0A0AD, 0x0FB9D,
+ 0x1F3C9, 0x050E1, 0x01FDF, 0x1F3CC, 0x1F3CD, 0x1F3CA,
+ 0x1F3CB, 0x00410, 0x0FBA9, 0x1F3DF, 0x1F3DE, 0x0FBA8,
+ 0x02A97, 0x1F3E1, 0x1F3E0, 0x0250E, 0x0FBAA, 0x1F3E3,
+ 0x1F3E4, 0x07E91, 0x1F3E2, 0x1F3E7, 0x1F3E8, 0x1F3E5,
+ 0x1F3E6, 0x1F3EA, 0x1F3EB, 0x1F3EC, 0x1F3E9, 0x0A0B4,
+ 0x03F85, 0x0FBA4, 0x1F3D6, 0x0FBA2, 0x0FBA3, 0x1F3D8,
+ 0x0FBA6, 0x1F3D7, 0x0FBA5, 0x1F3DB, 0x0A0B3, 0x1F3DC,
+ 0x1F3D9, 0x1F3DA, 0x049CB, 0x0FBA7, 0x1F3DD, 0x06570,
+ 0x0014C, 0x1F4A6, 0x1F4A7, 0x1F4A5, 0x0FBE7, 0x00DEF,
+ 0x1F4A9, 0x1F4A8, 0x01166, 0x050EB, 0x050EC, 0x1F4AB,
+ 0x1F4AA, 0x0A0D7, 0x0FBE8, 0x1F4AD, 0x1F4AC, 0x0A0D8,
+ 0x0A0D9, 0x1F4B0, 0x1F4B1, 0x1F4AE, 0x1F4AF, 0x0FBE6,
+ 0x1F49C, 0x1F49D, 0x1F49B, 0x0FBE5, 0x07EA2, 0x1F49F,
+ 0x1F49E, 0x0A0D6, 0x019F6, 0x1F4A1, 0x1F4A2, 0x1F4A0,
+ 0x050EA, 0x01C9E, 0x1F4A4, 0x1F4A3, 0x0133A, 0x00E4E,
+ 0x1F4BE, 0x1F4BD, 0x00BEE, 0x001AE, 0x050EE, 0x1F4C0,
+ 0x1F4BF, 0x050ED, 0x020DA, 0x1F4C2, 0x1F4C1, 0x050EF,
+ 0x0FBEB, 0x1F4C3, 0x1F4C4, 0x0FBE9, 0x0FBEA, 0x1F4C6,
+ 0x1F4C7, 0x1F4C5, 0x0A0DC, 0x1F4B4, 0x1F4B5, 0x1F4B2,
+ 0x1F4B3, 0x03F8A, 0x1F4B7, 0x1F4B8, 0x1F4B6, 0x0A0DA,
+ 0x02A9B, 0x1F4BA, 0x1F4B9, 0x0145F, 0x004AD, 0x0A0DB,
+ 0x1F4BC, 0x1F4BB, 0x03F8B, 0x003A6, 0x0A0DE, 0x1F4D1,
+ 0x1F4D0, 0x0FBED, 0x00DCA, 0x0FBEE, 0x1F4D2, 0x00EFE,
+ 0x02096, 0x0A0DF, 0x1F4D4, 0x1F4D3, 0x07EA6, 0x0FBEF,
+ 0x1F4D6, 0x1F4D5, 0x0A0E0, 0x1F4D9, 0x1F4DA, 0x1F4DB,
+ 0x1F4D7, 0x1F4D8, 0x07EA3, 0x1F4CA, 0x1F4CB, 0x1F4C8,
+ 0x1F4C9, 0x0388E, 0x0FBEC, 0x1F4CC, 0x049D8, 0x00CEB,
+ 0x0657A, 0x0A0DD, 0x1F4CD, 0x049D9, 0x00521, 0x1F4CF,
+ 0x1F4CE, 0x00CFA, 0x01B67, 0x1F4E4, 0x1F4E3, 0x032EF,
+ 0x00292, 0x0FBF2, 0x1F4E6, 0x1F4E5, 0x0FBF1, 0x014D2,
+ 0x0A0E5, 0x0A0E4, 0x028AA, 0x1F4E9, 0x0657F, 0x1F4EA,
+ 0x1F4E7, 0x1F4E8, 0x1F4ED, 0x1F4EE, 0x1F4EB, 0x1F4EC,
+ 0x0412E, 0x1F4DC, 0x0A0E1, 0x0A0E2, 0x049DA, 0x1F4DE,
+ 0x1F4DF, 0x1F4DD, 0x0657B, 0x01B66, 0x1F4E0, 0x0FBF0,
+ 0x0388F, 0x00522, 0x0A0E3, 0x1F4E2, 0x1F4E1, 0x0657E,
+ 0x007C2, 0x0A0EB, 0x1F4F8, 0x1F4F7, 0x0FBF5, 0x00F7A,
+ 0x1F4F9, 0x0FBF6, 0x020DB, 0x028AB, 0x1F4FB, 0x1F4FC,
+ 0x1F4FA, 0x0FBF7, 0x01DFE, 0x0BEFA, 0x1F4FD, 0x07EA7,
+ 0x1F502, 0x13FC2, 0x1F503, 0x1F4FE, 0x1F4FF, 0x1F4F1,
+ 0x0FBF3, 0x1F4F2, 0x1F4EF, 0x1F4F0, 0x02576, 0x0A0E7,
+ 0x1F4F3, 0x0A0E6, 0x07092, 0x0FBF4, 0x1F4F5, 0x1F4F4,
+ 0x049DB, 0x0096F, 0x1F4F6, 0x0A0EA, 0x02623, 0x006FF,
+ 0x1F45C, 0x1F45D, 0x1F45B, 0x07E9E, 0x03F88, 0x1F45F,
+ 0x1F45E, 0x020D7, 0x06575, 0x1F462, 0x0FBD2, 0x1F460,
+ 0x1F461, 0x1F464, 0x0FBD4, 0x0FBD3, 0x1F463, 0x1F467,
+ 0x1F468, 0x1F469, 0x1F465, 0x1F466, 0x1F44F, 0x1F450,
+ 0x1F451, 0x1F44D, 0x1F44E, 0x1F453, 0x1F454, 0x1F452,
+ 0x020D6, 0x0388B, 0x1F457, 0x1F458, 0x1F455, 0x1F456,
+ 0x028A9, 0x1F45A, 0x1F459, 0x00DED, 0x020D8, 0x1F472,
+ 0x1F471, 0x0261F, 0x006F0, 0x0FBD6, 0x1F474, 0x1F473,
+ 0x050E5, 0x049D3, 0x0FBD7, 0x1F475, 0x015EE, 0x1F477,
+ 0x0A0CD, 0x1F478, 0x1F476, 0x050E6, 0x1F47A, 0x1F47B,
+ 0x1F479, 0x0A0CE, 0x0A0CB, 0x1F46A, 0x0A0CA, 0x0261E,
+ 0x049D0, 0x0A0CC, 0x1F46C, 0x1F46B, 0x06576, 0x049D1,
+ 0x1F46E, 0x1F46D, 0x01FE2, 0x004DE, 0x049D2, 0x1F470,
+ 0x1F46F, 0x0FBD5, 0x00376, 0x0FBDB, 0x0FBDC, 0x1F482,
+ 0x0A0D0, 0x00C5E, 0x1F484, 0x1F483, 0x00BEB, 0x020D9,
+ 0x06578, 0x1F486, 0x1F485, 0x07E9F, 0x0A0D1, 0x1F487,
+ 0x07EA0, 0x050E8, 0x1F488, 0x0FBDF, 0x1F489, 0x0FBDD,
+ 0x0FBDE, 0x050E7, 0x0A0CF, 0x1F47D, 0x1F47C, 0x0FBD8,
+ 0x06577, 0x1F47F, 0x1F47E, 0x032ED, 0x012BA, 0x03F89,
+ 0x0FBD9, 0x1F480, 0x032EE, 0x00C4F, 0x1F481, 0x0FBDA,
+ 0x01B63, 0x00DEE, 0x0FBE1, 0x1F491, 0x0115B, 0x001CE,
+ 0x049D6, 0x1F493, 0x1F492, 0x0A0D4, 0x049D7, 0x1F495,
+ 0x1F494, 0x02A9A, 0x0A0D5, 0x0FBE3, 0x1F497, 0x1F496,
+ 0x0FBE2, 0x0FBE4, 0x1F49A, 0x1F498, 0x1F499, 0x049D4,
+ 0x1F48A, 0x0A0D2, 0x0FBE0, 0x049D5, 0x0A0D3, 0x1F48C,
+ 0x1F48B, 0x07EA1, 0x01FE3, 0x1F48E, 0x1F48D, 0x02622,
+ 0x00520, 0x050E9, 0x1F490, 0x1F48F, 0x06579, 0x0018A,
+ 0x09FE6, 0x1F0E6, 0x1F0E5, 0x0459C, 0x00DCB, 0x1F0E7,
+ 0x0FA96, 0x012D0, 0x020A6, 0x1F0E9, 0x1F0EA, 0x1F0E8,
+ 0x0FA97, 0x09FE7, 0x1F0EC, 0x1F0EB, 0x06370, 0x09FE8,
+ 0x1F0EE, 0x1F0EF, 0x0FA98, 0x1F0ED, 0x1F0DC, 0x1F0DD,
+ 0x1F0DE, 0x1F0DA, 0x1F0DB, 0x1F0DF, 0x1F0E0, 0x0FA93,
+ 0x0FA94, 0x0507C, 0x1F0E2, 0x1F0E3, 0x1F0E1, 0x0507B,
+ 0x00AAE, 0x1F0E4, 0x0FA95, 0x00F5D, 0x00DB4, 0x0FA9C,
+ 0x1F0F9, 0x00FF2, 0x003AC, 0x1F0FB, 0x1F0FC, 0x1F0FA,
+ 0x029E0, 0x025CF, 0x1F0FE, 0x1F0FD, 0x029E1, 0x029E2,
+ 0x09FE9, 0x1F180, 0x1F0FF, 0x07E04, 0x0FA9D, 0x1F183,
+ 0x1F181, 0x1F182, 0x0FA9A, 0x1F0F1, 0x0FA99, 0x1F0F0,
+ 0x0384C, 0x1F0F3, 0x1F0F4, 0x1F0F2, 0x0FA9B, 0x019F7,
+ 0x1F0F6, 0x1F0F5, 0x02878, 0x0018C, 0x06371, 0x1F0F8,
+ 0x1F0F7, 0x07E03, 0x002FC, 0x0507E, 0x1F18E, 0x1F18D,
+ 0x06373, 0x00D2C, 0x1F190, 0x1F18F, 0x01356, 0x01357,
+ 0x0FAA0, 0x1F192, 0x1F191, 0x0507F, 0x02879, 0x1F194,
+ 0x1F193, 0x0384D, 0x1F197, 0x0FAA1, 0x0FAA2, 0x1F195,
+ 0x1F196, 0x1F186, 0x1F187, 0x1F188, 0x1F184, 0x1F185,
+ 0x0507D, 0x1F189, 0x0FA9E, 0x06372, 0x020A7, 0x07E05,
+ 0x1F18B, 0x1F18A, 0x09FEA, 0x00AF8, 0x0FA9F, 0x1F18C,
+ 0x00A30, 0x0106F, 0x1F19F, 0x1F19E, 0x01AD6, 0x005F6,
+ 0x1F1A1, 0x1F1A2, 0x1F1A0, 0x0FAA8, 0x0099E, 0x0FAA9,
+ 0x1F1A3, 0x06375, 0x0459E, 0x07E07, 0x1F1A6, 0x1F1A4,
+ 0x1F1A5, 0x09FEC, 0x0FAAA, 0x1F1A7, 0x09FEB, 0x0FAA4,
+ 0x1F199, 0x1F198, 0x0FAA3, 0x0FAA6, 0x0459D, 0x1F19B,
+ 0x1F19A, 0x0FAA5, 0x01C49, 0x07E06, 0x1F19C, 0x03F56,
+ 0x0077E, 0x05080, 0x1F19D, 0x0FAA7, 0x06374, 0x008A2,
+ 0x1F1B3, 0x1F1B4, 0x0FAAE, 0x1F1B2, 0x00AB0, 0x1F1B6,
+ 0x1F1B5, 0x04980, 0x0384E, 0x0FAAF, 0x1F1B8, 0x1F1B7,
+ 0x06377, 0x04981, 0x1F1BA, 0x1F1B9, 0x07E09, 0x07E0A,
+ 0x1F1BC, 0x1F1BD, 0x1F1BB, 0x0FAB0, 0x1F1AA, 0x1F1AB,
+ 0x1F1AC, 0x1F1A8, 0x1F1A9, 0x0FAAC, 0x07E08, 0x0FAAB,
+ 0x1F1AD, 0x029E3, 0x06376, 0x0FAAD, 0x1F1AE, 0x1F1AF,
+ 0x0459F, 0x1F1B1, 0x1F1B0, 0x01AD7, 0x00822, 0x1DFF2,
+ 0x1DFF3, 0x1DFF1, 0x0FA82, 0x03F52, 0x1DFF5, 0x1DFF4,
+ 0x00BF6, 0x062F8, 0x07DFD, 0x1DFF7, 0x1DFF6, 0x09FE0,
+ 0x062F9, 0x1DFF9, 0x1DFF8, 0x029A6, 0x0FA83, 0x1DFFC,
+ 0x1DFFD, 0x1DFFA, 0x1DFFB, 0x13FC3, 0x17DF6, 0x17DF7,
+ 0x0FA80, 0x0412F, 0x05074, 0x1C24C, 0x05F7C, 0x05F7E,
+ 0x03848, 0x05F7F, 0x1C24E, 0x1C24D, 0x07DFC, 0x01FC6,
+ 0x1DFF0, 0x1C24F, 0x02577, 0x029A7, 0x1EF67, 0x1EF66,
+ 0x024EE, 0x003BE, 0x0FA88, 0x1EF69, 0x1EF68, 0x062FA,
+ 0x0384B, 0x1EF6B, 0x1EF6A, 0x015EF, 0x05076, 0x0FA89,
+ 0x1EF6D, 0x1EF6C, 0x07E00, 0x1EF6F, 0x0FA8A, 0x1EF6E,
+ 0x062FB, 0x1EF60, 0x0FA84, 0x1DFFE, 0x1DFFF, 0x07DFE,
+ 0x0FA85, 0x1EF62, 0x1EF61, 0x03F54, 0x0384A, 0x1EF63,
+ 0x0FA86, 0x00E30, 0x002EC, 0x0FA87, 0x1EF65, 0x1EF64,
+ 0x07DFF, 0x002FE, 0x09FE3, 0x1EF7C, 0x1EF7B, 0x07E01,
+ 0x0095C, 0x1EF7E, 0x1EF7D, 0x01456, 0x0133B, 0x05077,
+ 0x1F0C0, 0x1EF7F, 0x062FD, 0x05078, 0x1F0C2, 0x1F0C1,
+ 0x01C46, 0x03F55, 0x1F0C4, 0x1F0C5, 0x1F0C3, 0x0FA8D,
+ 0x1EF72, 0x1EF73, 0x1EF74, 0x1EF70, 0x1EF71, 0x062FC,
+ 0x1EF75, 0x0FA8B, 0x09FE2, 0x0154E, 0x1EF78, 0x0FA8C,
+ 0x1EF76, 0x1EF77, 0x00F5C, 0x1EF7A, 0x1EF79, 0x00DB2,
+ 0x0106E, 0x1F0D3, 0x1F0D2, 0x00ED0, 0x0045A, 0x07E02,
+ 0x0FA8F, 0x1F0D4, 0x1F0D5, 0x01C48, 0x0FA91, 0x0FA90,
+ 0x025CE, 0x032BE, 0x062FF, 0x1F0D7, 0x1F0D6, 0x0FA92,
+ 0x09FE5, 0x1F0D9, 0x1F0D8, 0x09FE4, 0x1F0C8, 0x1F0C9,
+ 0x1F0C6, 0x1F0C7, 0x05079, 0x1F0CB, 0x1F0CC, 0x1F0CA,
+ 0x0FA8E, 0x0507A, 0x1F0CE, 0x1F0CD, 0x024EF, 0x0018F,
+ 0x1F0D0, 0x1F0D1, 0x1F0CF, 0x062FE, 0x04986, 0x1F211,
+ 0x1F210, 0x029E5, 0x0149C, 0x09FFF, 0x1F212, 0x0FAD5,
+ 0x0FAD6, 0x0FAD8, 0x1F214, 0x1F213, 0x0FAD7, 0x0A000,
+ 0x0A001, 0x1F216, 0x1F215, 0x0FAD9, 0x0A003, 0x0FADA,
+ 0x1F217, 0x0A002, 0x0FAD1, 0x1F205, 0x1F203, 0x1F204,
+ 0x1F207, 0x1F208, 0x1F209, 0x1F206, 0x0FAD2, 0x1F20C,
+ 0x0FAD3, 0x1F20A, 0x1F20B, 0x00E31, 0x0FAD4, 0x1F20F,
+ 0x1F20D, 0x1F20E, 0x003BC, 0x1F221, 0x0FADD, 0x1F21F,
+ 0x1F220, 0x01D2E, 0x1F223, 0x1F222, 0x0384F, 0x0A007,
+ 0x1F225, 0x1F226, 0x07E18, 0x1F224, 0x1F229, 0x1F22A,
+ 0x1F227, 0x1F228, 0x01ADD, 0x0A009, 0x1F22B, 0x0A008,
+ 0x04987, 0x0FADC, 0x07E16, 0x1F218, 0x0FADB, 0x07E15,
+ 0x1F21B, 0x1F21C, 0x1F219, 0x1F21A, 0x0637A, 0x0A005,
+ 0x0A006, 0x07E17, 0x0A004, 0x025F0, 0x1F21E, 0x1F21D,
+ 0x01ADC, 0x05088, 0x1F235, 0x1F234, 0x05087, 0x01978,
+ 0x1F238, 0x07E1A, 0x1F236, 0x1F237, 0x07E1C, 0x1F239,
+ 0x0FAE2, 0x07E1B, 0x1F23B, 0x0A00D, 0x1F23C, 0x1F23A,
+ 0x0FAE3, 0x01979, 0x0A00E, 0x1F23D, 0x04989, 0x1F22E,
+ 0x1F22F, 0x1F22C, 0x1F22D, 0x1F231, 0x0A00A, 0x1F232,
+ 0x0FADE, 0x1F230, 0x04988, 0x0FADF, 0x1F233, 0x07E19,
+ 0x01ADE, 0x0A00C, 0x0FAE1, 0x0FAE0, 0x0A00B, 0x032C2,
+ 0x1F249, 0x1F24A, 0x1F248, 0x0A010, 0x05089, 0x1F24C,
+ 0x0A011, 0x1F24B, 0x0A012, 0x0FAEA, 0x1F24E, 0x0508A,
+ 0x1F24D, 0x0A014, 0x1F250, 0x0A013, 0x1F24F, 0x029E6,
+ 0x07E1D, 0x1F253, 0x1F251, 0x1F252, 0x0FAE4, 0x0FAE5,
+ 0x0FAE6, 0x1F23E, 0x1F23F, 0x1F242, 0x0A00F, 0x1F240,
+ 0x1F241, 0x0FAE8, 0x1F244, 0x1F245, 0x0FAE7, 0x1F243,
+ 0x0FAE9, 0x1F247, 0x1F246, 0x03850, 0x01286, 0x1F25E,
+ 0x1F25D, 0x03851, 0x00D2D, 0x1F260, 0x1F261, 0x1F25F,
+ 0x07E1E, 0x00A68, 0x1F262, 0x0A015, 0x0637C, 0x0508C,
+ 0x0498A, 0x1F265, 0x1F263, 0x1F264, 0x03852, 0x0FAEE,
+ 0x1F266, 0x0A016, 0x0FAEB, 0x0FAEC, 0x1F254, 0x1F255,
+ 0x1F258, 0x0637B, 0x1F259, 0x1F256, 0x1F257, 0x032C3,
+ 0x0FAED, 0x0508B, 0x03F59, 0x01310, 0x032C4, 0x1F25C,
+ 0x1F25A, 0x1F25B, 0x04982, 0x09FEE, 0x1F1C4, 0x00FF3,
+ 0x01457, 0x06378, 0x1F1C6, 0x1F1C5, 0x0FAB4, 0x0287B,
+ 0x0FAB6, 0x0FAB5, 0x00FF6, 0x03F57, 0x0FAB7, 0x09FEF,
+ 0x1F1C7, 0x05083, 0x09FF0, 0x1F1C8, 0x0FAB8, 0x01FC8,
+ 0x09FED, 0x0FAB2, 0x0FAB1, 0x1F1BE, 0x07E0B, 0x05081,
+ 0x0FAB3, 0x1F1BF, 0x024F0, 0x0287A, 0x1F1C1, 0x1F1C0,
+ 0x01FC7, 0x00E5A, 0x05082, 0x1F1C3, 0x1F1C2, 0x07E0C,
+ 0x032C0, 0x0FABE, 0x0FABF, 0x1F1D1, 0x1F1D2, 0x07E10,
+ 0x1F1D5, 0x1F1D3, 0x1F1D4, 0x0FAC2, 0x0FAC3, 0x1F1D6,
+ 0x0FAC0, 0x0FAC1, 0x1F1D9, 0x1F1DA, 0x1F1D7, 0x1F1D8,
+ 0x05085, 0x09FF2, 0x1F1DC, 0x1F1DB, 0x0FAC4, 0x0FAB9,
+ 0x0FABA, 0x1F1CA, 0x07E0D, 0x1F1C9, 0x1F1CB, 0x1F1CC,
+ 0x07E0E, 0x0FABB, 0x0FABD, 0x1F1CD, 0x1F1CE, 0x0FABC,
+ 0x09FF1, 0x07E0F, 0x1F1D0, 0x1F1CF, 0x05084, 0x0287C,
+ 0x1F1E6, 0x1F1E5, 0x03F58, 0x0287D, 0x09FF6, 0x1F1E9,
+ 0x1F1E7, 0x1F1E8, 0x07E13, 0x09FF8, 0x1F1EA, 0x09FF7,
+ 0x1F1ED, 0x09FF9, 0x0FAC8, 0x1F1EB, 0x1F1EC, 0x09FFB,
+ 0x04984, 0x09FFA, 0x04983, 0x09FF3, 0x1F1DE, 0x1F1DD,
+ 0x07E11, 0x1F1DF, 0x1F1E0, 0x0FAC6, 0x09FF4, 0x0FAC5,
+ 0x07E12, 0x1F1E2, 0x1F1E1, 0x05086, 0x00ED2, 0x09FF5,
+ 0x1F1E4, 0x1F1E3, 0x0FAC7, 0x004D4, 0x1F1F9, 0x1F1FA,
+ 0x09FFC, 0x0FACD, 0x029E4, 0x0FACE, 0x1F1FB, 0x0287E,
+ 0x09FFD, 0x0FAD0, 0x1F1FC, 0x0FACF, 0x06379, 0x1F1FE,
+ 0x1F1FF, 0x1F1FD, 0x09FFE, 0x04985, 0x07E14, 0x1F202,
+ 0x1F200, 0x1F201, 0x1F1EF, 0x1F1F0, 0x1F1F1, 0x1F1EE,
+ 0x0FAC9, 0x1F1F3, 0x1F1F4, 0x1F1F2, 0x0FACA, 0x032C1,
+ 0x1F1F6, 0x0FACC, 0x1F1F5, 0x0FACB, 0x01C9F, 0x1F1F8,
+ 0x1F1F7, 0x01FC9, 0x000EC, 0x0650B, 0x0650C, 0x07E2B,
+ 0x029EC, 0x00DB6, 0x0FB04, 0x1F298, 0x0098C, 0x01FCC,
+ 0x0650D, 0x07E2C, 0x0FB05, 0x0FB06, 0x0FB08, 0x1F29A,
+ 0x1F299, 0x0FB07, 0x00ED3, 0x05094, 0x1F29B, 0x07E2D,
+ 0x0FB09, 0x03855, 0x06508, 0x0FB02, 0x1F292, 0x0FB01,
+ 0x1F295, 0x1F296, 0x1F293, 0x1F294, 0x05093, 0x0FB03,
+ 0x0650A, 0x07E2A, 0x06509, 0x00BB6, 0x0A02B, 0x1F297,
+ 0x00A54, 0x00708, 0x1F2A2, 0x1F2A1, 0x007A8, 0x004CA,
+ 0x029EE, 0x07E2F, 0x05095, 0x0197B, 0x01C4A, 0x0A02D,
+ 0x07E30, 0x01FCD, 0x0FB0C, 0x0650F, 0x0FB0D, 0x1F2A3,
+ 0x0650E, 0x01D78, 0x06510, 0x07E31, 0x07E32, 0x04993,
+ 0x07E2E, 0x0A02C, 0x03F5D, 0x1F29E, 0x1F29F, 0x03856,
+ 0x1F29C, 0x1F29D, 0x03857, 0x0FB0A, 0x1F2A0, 0x029ED,
+ 0x004B8, 0x024F5, 0x03F5E, 0x0FB0B, 0x03858, 0x008AC,
+ 0x0FB13, 0x07E35, 0x0FB12, 0x06512, 0x01C4C, 0x07E36,
+ 0x0FB14, 0x01550, 0x02882, 0x07E37, 0x07E38, 0x06513,
+ 0x05096, 0x06514, 0x0A032, 0x1F2A7, 0x1F2A8, 0x006E7,
+ 0x032CA, 0x1F2A9, 0x0FB15, 0x029EF, 0x07E34, 0x0A02E,
+ 0x0A02F, 0x0FB0E, 0x07E33, 0x0FB10, 0x06511, 0x1F2A4,
+ 0x0FB0F, 0x04994, 0x02881, 0x0A031, 0x0A030, 0x0FB11,
+ 0x01289, 0x1F2A6, 0x1F2A5, 0x01C4B, 0x05098, 0x1F2AE,
+ 0x1F2AD, 0x07E3A, 0x06519, 0x1F2AF, 0x1F2B0, 0x0FB19,
+ 0x0A038, 0x05099, 0x1F2B2, 0x1F2B1, 0x07E3B, 0x0FB1A,
+ 0x1F2B4, 0x1F2B5, 0x04995, 0x1F2B3, 0x0149D, 0x03F60,
+ 0x0FB1B, 0x025F2, 0x0A033, 0x06516, 0x06515, 0x03F5F,
+ 0x0A035, 0x1F2AA, 0x07E39, 0x0A034, 0x0FB16, 0x06517,
+ 0x1F2AC, 0x1F2AB, 0x0FB17, 0x05097, 0x0A036, 0x0A037,
+ 0x0FB18, 0x06518, 0x0031A, 0x0A03C, 0x1F2BA, 0x1F2B9,
+ 0x07E3F, 0x0057E, 0x0FB1C, 0x1F2BB, 0x00F5E, 0x01551,
+ 0x025F3, 0x1F2BC, 0x07E40, 0x04996, 0x00BB8, 0x1F2BD,
+ 0x04997, 0x0385A, 0x00E32, 0x0651D, 0x1F2BF, 0x1F2BE,
+ 0x07E41, 0x0651A, 0x0A03A, 0x1F2B7, 0x1F2B6, 0x0A039,
+ 0x03859, 0x07E3D, 0x07E3C, 0x0509A, 0x029F0, 0x0651C,
+ 0x0A03B, 0x0651B, 0x07E3E, 0x0096A, 0x1F2B8, 0x0509B,
+ 0x01D79, 0x0073E, 0x0A01C, 0x1F26B, 0x1F26A, 0x0FAF0,
+ 0x01312, 0x0FAF1, 0x1F26C, 0x0074E, 0x00DE2, 0x0637D,
+ 0x0FAF2, 0x1F26D, 0x029E9, 0x025F1, 0x0508D, 0x1F26E,
+ 0x0072A, 0x01288, 0x1F270, 0x1F271, 0x1F26F, 0x0637E,
+ 0x1F267, 0x0A018, 0x0498B, 0x0A017, 0x029E7, 0x0A019,
+ 0x0A01A, 0x1F268, 0x029E8, 0x0175C, 0x0287F, 0x0A01B,
+ 0x1F269, 0x03F5A, 0x02880, 0x0498C, 0x0FAEF, 0x00DB5,
+ 0x07E1F, 0x1F27B, 0x1F27A, 0x0FAF4, 0x024F1, 0x1F27E,
+ 0x0A01F, 0x1F27C, 0x1F27D, 0x0FAF5, 0x1F280, 0x1F27F,
+ 0x06502, 0x0FAF6, 0x1F282, 0x07E21, 0x07E20, 0x1F281,
+ 0x029EA, 0x07E23, 0x07E22, 0x0154F, 0x0637F, 0x06500,
+ 0x0498D, 0x0FAF3, 0x1F272, 0x1F273, 0x0A01D, 0x0508E,
+ 0x032C5, 0x1F275, 0x1F276, 0x1F274, 0x06501, 0x03853,
+ 0x0A01E, 0x1F279, 0x1F277, 0x1F278, 0x0074F, 0x03854,
+ 0x032C7, 0x0FAFA, 0x1F286, 0x029EB, 0x07E25, 0x0A024,
+ 0x024F3, 0x01FCA, 0x0508F, 0x032C8, 0x1F287, 0x0A025,
+ 0x07E26, 0x0A026, 0x1F288, 0x1F289, 0x006E6, 0x0498E,
+ 0x1F28B, 0x1F28A, 0x032C9, 0x032C6, 0x0A021, 0x0A022,
+ 0x0A020, 0x03F5B, 0x1F283, 0x1F284, 0x06503, 0x0FAF7,
+ 0x024F2, 0x07E24, 0x1F285, 0x0FAF8, 0x01313, 0x01ADF,
+ 0x0FAF9, 0x0A023, 0x00AB1, 0x0055E, 0x1F28F, 0x1F28E,
+ 0x00972, 0x005FA, 0x024F4, 0x0FAFE, 0x1F290, 0x04990,
+ 0x020BC, 0x0FAFF, 0x1F291, 0x01D2F, 0x04991, 0x0A02A,
+ 0x05092, 0x0A029, 0x0FB00, 0x04992, 0x06507, 0x06506,
+ 0x01FCB, 0x03F5C, 0x05090, 0x06504, 0x0A027, 0x1F28C,
+ 0x1F28D, 0x07E28, 0x07E27, 0x0A028, 0x05091, 0x0FAFC,
+ 0x0FAFB, 0x0197A, 0x003D6, 0x0FAFD, 0x07E29, 0x0498F,
+ 0x06505, 0x00056, 0x020C0, 0x02888, 0x0005C, 0x0005A,
+ 0x0071E, 0x00CE4, 0x00A32, 0x005D6, 0x00A34, 0x0288A,
+ 0x02889, 0x00A33, 0x049A2, 0x0A046, 0x01D7A, 0x025F9,
+ 0x0A045, 0x01315, 0x01316, 0x07E4B, 0x01458, 0x00676,
+ 0x00F71, 0x01B51, 0x006FD, 0x07E4A, 0x06529, 0x01768,
+ 0x00AB3, 0x07E49, 0x009E4, 0x03F64, 0x050A1, 0x00DE3,
+ 0x00064, 0x008B8, 0x00AB4, 0x00BBB, 0x007FA, 0x0003C,
+ 0x009E7, 0x00AFA, 0x01459, 0x00AB5, 0x001AF, 0x03862,
+ 0x0288C, 0x0019E, 0x00BFD, 0x01C51, 0x0149F, 0x00F73,
+ 0x029FA, 0x07E4C, 0x0A047, 0x1F2D4, 0x03863, 0x00F74,
+ 0x01B52, 0x01B53, 0x050A2, 0x0137D, 0x006E8, 0x008A4,
+ 0x029F9, 0x00E33, 0x006E0, 0x03F65, 0x049A3, 0x1F2D3,
+ 0x03861, 0x00A35, 0x0197C, 0x00F72, 0x012D1, 0x0288B,
+ 0x0015C, 0x01FCF, 0x049A4, 0x001A6, 0x00BBC, 0x1F2D5,
+ 0x0A048, 0x00AB6, 0x0075A, 0x020C2, 0x03864, 0x0104E,
+ 0x050A5, 0x01D7B, 0x0A049, 0x1F2D6, 0x024F8, 0x0652B,
+ 0x1F2D7, 0x03865, 0x025FA, 0x07E4E, 0x014A0, 0x0652C,
+ 0x029FC, 0x00E5D, 0x00CE5, 0x0288D, 0x0098F, 0x006E9,
+ 0x0FB2C, 0x0652A, 0x01C52, 0x0104D, 0x0FB2B, 0x0128B,
+ 0x050A3, 0x07E4D, 0x029FB, 0x00990, 0x01FD0, 0x024F7,
+ 0x050A4, 0x020C1, 0x01B54, 0x1F2DD, 0x0FB30, 0x0FB2E,
+ 0x0FB2F, 0x049A6, 0x1F2DF, 0x1F2DE, 0x0288E, 0x029FD,
+ 0x0FB31, 0x025FD, 0x07E4F, 0x1F2E0, 0x0652E, 0x1F2E2,
+ 0x1F2E1, 0x0A04D, 0x0128C, 0x03F67, 0x0FB33, 0x0FB32,
+ 0x01B55, 0x025FC, 0x03F66, 0x0652D, 0x025FB, 0x0083C,
+ 0x1F2DA, 0x0FB2D, 0x1F2D8, 0x1F2D9, 0x0A04B, 0x050A6,
+ 0x050A7, 0x024F9, 0x0A04A, 0x0A04C, 0x1F2DC, 0x1F2DB,
+ 0x049A5, 0x00538, 0x0FB35, 0x0FB34, 0x01147, 0x0051E,
+ 0x03866, 0x0A04F, 0x1F2E7, 0x024FA, 0x002BC, 0x1F2E8,
+ 0x0FB36, 0x00DE4, 0x01555, 0x050AA, 0x1F2E9, 0x0FB37,
+ 0x0288F, 0x01FD2, 0x1F2EA, 0x0FB38, 0x032D0, 0x0652F,
+ 0x1F2E3, 0x020C3, 0x01FD1, 0x025FE, 0x03F68, 0x0A04E,
+ 0x06530, 0x01769, 0x01D7C, 0x1F2E4, 0x050A8, 0x00ED4,
+ 0x0099F, 0x050A9, 0x1F2E6, 0x1F2E5, 0x06531, 0x00F5F,
+ 0x0FB20, 0x0FB1F, 0x006B4, 0x0067C, 0x029F1, 0x1F2C2,
+ 0x1F2C1, 0x032CB, 0x0149E, 0x0509E, 0x1F2C3, 0x00A6A,
+ 0x00E5B, 0x025F4, 0x0FB21, 0x1F2C4, 0x1F2C5, 0x02883,
+ 0x0651F, 0x0FB22, 0x03F61, 0x0509C, 0x04998, 0x0FB1D,
+ 0x07E42, 0x0175D, 0x0107A, 0x0A03D, 0x07E43, 0x04999,
+ 0x01B50, 0x0509D, 0x0651E, 0x0104A, 0x0137C, 0x0499A,
+ 0x0FB1E, 0x1F2C0, 0x07E44, 0x0385C, 0x07E45, 0x0A040,
+ 0x1F2CA, 0x1F2CB, 0x032CC, 0x1F2CD, 0x1F2CC, 0x0385D,
+ 0x02884, 0x06523, 0x03F63, 0x1F2CE, 0x0FB24, 0x0FB25,
+ 0x1F2D1, 0x1F2CF, 0x1F2D0, 0x00F70, 0x07E46, 0x0FB26,
+ 0x1F2D2, 0x0499C, 0x03F62, 0x0095E, 0x01C4D, 0x0499B,
+ 0x00BF7, 0x06520, 0x1F2C6, 0x0FB23, 0x0A03E, 0x0A03F,
+ 0x1F2C7, 0x025F5, 0x0385B, 0x06521, 0x0509F, 0x1F2C9,
+ 0x1F2C8, 0x06522, 0x00AF9, 0x0A042, 0x0FB27, 0x00A56,
+ 0x006DE, 0x029F2, 0x029F3, 0x032CD, 0x032CE, 0x02886,
+ 0x0385E, 0x07E48, 0x0175F, 0x050A0, 0x0FB29, 0x01C4F,
+ 0x029F4, 0x0FB28, 0x01553, 0x0A043, 0x025F6, 0x01314,
+ 0x006FC, 0x0098E, 0x02885, 0x01552, 0x0A041, 0x06525,
+ 0x0128A, 0x020BD, 0x06524, 0x01C4E, 0x07E47, 0x0499D,
+ 0x00CE2, 0x0071A, 0x06526, 0x01FCE, 0x0175E, 0x024F6,
+ 0x00046, 0x009E2, 0x01C50, 0x00DB7, 0x00BB9, 0x00188,
+ 0x06527, 0x0499E, 0x0017C, 0x00D2F, 0x025F7, 0x00BBA,
+ 0x00DB8, 0x02887, 0x049A1, 0x06528, 0x0499F, 0x049A0,
+ 0x0104C, 0x020BF, 0x0FB2A, 0x029F8, 0x025F8, 0x00A31,
+ 0x0051C, 0x01554, 0x029F5, 0x00BFC, 0x032CF, 0x0A044,
+ 0x0385F, 0x029F6, 0x00AB2, 0x020BE, 0x00E5C, 0x00A57,
+ 0x00D2E, 0x001AC, 0x029F7, 0x03860, 0x00125,
+};
+
+static const uint8_t on2avc_cb7_bits[ON2AVC_CB7_CODES] = {
+ 1, 8, 8, 8, 8, 7,
+ 10, 11, 7, 11, 12, 10,
+ 10, 12, 14, 14, 15, 14,
+ 11, 11, 13, 13, 12, 10,
+ 11, 13, 12, 12, 14, 14,
+ 14, 13, 11, 12, 9, 10,
+ 12, 7, 11, 11, 7, 7,
+ 11, 12, 7, 7, 10, 9,
+ 11, 11, 11, 13, 13, 12,
+ 14, 15, 11, 12, 14, 12,
+ 13, 12, 12, 12, 12, 11,
+ 11, 15, 15, 10, 12, 15,
+ 12, 12, 14, 11, 7, 10,
+ 8, 11, 11, 11, 16, 13,
+ 12, 14, 12, 16, 15, 12,
+ 13, 14, 14, 12, 14, 17,
+ 15, 16, 16, 12, 14, 16,
+ 14, 12, 12, 13, 16, 14,
+ 12, 17, 16, 16, 15, 13,
+ 13, 14, 12, 14, 12, 16,
+ 16, 12, 16, 17, 16, 17,
+ 15, 16, 16, 15, 17, 15,
+ 17, 17, 16, 17, 16, 15,
+ 14, 16, 14, 16, 14, 11,
+ 14, 16, 15, 11, 17, 17,
+ 15, 13, 17, 16, 17, 17,
+ 15, 14, 17, 15, 14, 16,
+ 11, 16, 17, 16, 14, 12,
+ 17, 15, 12, 13, 15, 17,
+ 16, 13, 15, 17, 16, 13,
+ 15, 16, 17, 15, 13, 14,
+ 16, 17, 17, 14, 14, 16,
+ 16, 13, 12, 15, 17, 16,
+ 14, 11, 15, 15, 12, 10,
+ 14, 16, 16, 16, 12, 15,
+ 16, 12, 12, 13, 15, 17,
+ 14, 12, 15, 17, 14, 14,
+ 15, 16, 16, 16, 16, 16,
+ 16, 16, 16, 12, 16, 17,
+ 14, 11, 13, 15, 17, 15,
+ 12, 14, 16, 11, 14, 17,
+ 17, 14, 15, 17, 14, 17,
+ 16, 15, 17, 15, 14, 17,
+ 15, 14, 17, 17, 12, 15,
+ 16, 14, 12, 13, 16, 13,
+ 16, 16, 15, 16, 16, 16,
+ 17, 17, 16, 14, 16, 14,
+ 17, 17, 11, 14, 12, 13,
+ 15, 12, 14, 15, 12, 13,
+ 14, 12, 13, 14, 14, 16,
+ 17, 15, 11, 12, 14, 15,
+ 13, 12, 12, 14, 14, 13,
+ 15, 17, 16, 16, 14, 14,
+ 13, 13, 14, 12, 16, 17,
+ 12, 7, 12, 12, 7, 7,
+ 11, 11, 8, 10, 11, 13,
+ 13, 11, 15, 14, 12, 10,
+ 14, 11, 11, 13, 12, 11,
+ 12, 13, 12, 15, 14, 12,
+ 11, 14, 11, 15, 13, 11,
+ 7, 11, 11, 9, 10, 7,
+ 13, 14, 7, 7, 12, 12,
+ 12, 11, 12, 17, 14, 12,
+ 14, 16, 14, 14, 14, 11,
+ 12, 12, 11, 13, 15, 14,
+ 13, 15, 16, 14, 14, 15,
+ 12, 14, 14, 12, 7, 11,
+ 12, 12, 11, 7, 12, 13,
+ 13, 12, 9, 14, 14, 9,
+ 12, 12, 12, 13, 13, 14,
+ 15, 14, 14, 12, 11, 14,
+ 13, 11, 12, 13, 14, 14,
+ 13, 15, 15, 16, 14, 12,
+ 14, 12, 12, 14, 9, 14,
+ 13, 9, 12, 17, 15, 12,
+ 12, 14, 13, 13, 13, 13,
+ 14, 16, 13, 16, 15, 12,
+ 14, 16, 13, 14, 12, 11,
+ 13, 17, 15, 13, 15, 17,
+ 15, 13, 15, 13, 15, 17,
+ 13, 11, 14, 15, 13, 13,
+ 14, 17, 17, 17, 16, 14,
+ 17, 16, 15, 16, 17, 16,
+ 14, 15, 17, 15, 17, 16,
+ 14, 14, 14, 15, 12, 13,
+ 14, 17, 16, 14, 16, 17,
+ 17, 17, 14, 17, 17, 15,
+ 17, 15, 17, 16, 16, 11,
+ 17, 16, 12, 12, 17, 17,
+ 15, 15, 14, 17, 14, 13,
+ 14, 16, 16, 15, 13, 14,
+ 16, 14, 13, 14, 15, 17,
+ 14, 12, 14, 17, 16, 14,
+ 12, 16, 14, 13, 11, 15,
+ 17, 16, 13, 12, 15, 17,
+ 10, 12, 13, 16, 17, 14,
+ 13, 14, 15, 12, 13, 14,
+ 15, 17, 14, 14, 16, 15,
+ 14, 14, 17, 17, 14, 13,
+ 14, 16, 17, 15, 13, 15,
+ 15, 12, 11, 14, 17, 16,
+ 14, 13, 16, 15, 17, 16,
+ 15, 17, 16, 15, 15, 17,
+ 15, 16, 17, 16, 17, 17,
+ 17, 13, 12, 14, 17, 14,
+ 13, 15, 14, 17, 14, 14,
+ 16, 15, 16, 14, 15, 14,
+ 15, 17, 14, 17, 17, 15,
+ 12, 17, 17, 12, 12, 14,
+ 13, 14, 13, 14, 16, 15,
+ 13, 15, 17, 13, 13, 14,
+ 11, 13, 14, 13, 12, 14,
+ 15, 13, 17, 15, 14, 15,
+ 16, 13, 16, 16, 14, 12,
+ 14, 13, 14, 14, 7, 12,
+ 13, 12, 12, 9, 14, 14,
+ 9, 12, 14, 12, 12, 12,
+ 14, 15, 15, 15, 11, 11,
+ 13, 13, 12, 12, 13, 15,
+ 14, 14, 15, 16, 15, 15,
+ 12, 14, 12, 13, 14, 9,
+ 14, 13, 9, 8, 15, 15,
+ 15, 15, 12, 16, 16, 12,
+ 14, 15, 15, 15, 16, 17,
+ 17, 17, 17, 16, 15, 15,
+ 17, 15, 14, 15, 17, 16,
+ 15, 15, 17, 17, 16, 13,
+ 15, 15, 15, 15, 12, 15,
+ 16, 11, 12, 17, 16, 11,
+ 11, 15, 15, 15, 14, 14,
+ 15, 17, 14, 17, 15, 16,
+ 16, 16, 14, 17, 15, 15,
+ 13, 16, 15, 14, 15, 16,
+ 17, 15, 16, 14, 15, 16,
+ 13, 11, 14, 15, 16, 14,
+ 12, 16, 16, 16, 14, 12,
+ 16, 17, 13, 14, 13, 16,
+ 17, 16, 15, 15, 17, 17,
+ 14, 15, 15, 15, 15, 12,
+ 14, 17, 16, 15, 15, 17,
+ 17, 17, 15, 16, 16, 14,
+ 16, 13, 17, 16, 14, 15,
+ 16, 17, 15, 16, 16, 17,
+ 15, 16, 14, 17, 17, 16,
+ 16, 14, 15, 17, 17, 15,
+ 14, 14, 15, 13, 16, 17,
+ 14, 16, 17, 16, 16, 16,
+ 16, 17, 17, 16, 14, 17,
+ 16, 15, 16, 11, 17, 17,
+ 16, 16, 13, 17, 16, 14,
+ 14, 16, 17, 15, 15, 13,
+ 16, 15, 15, 15, 16, 15,
+ 16, 15, 12, 15, 17, 16,
+ 15, 12, 15, 16, 13, 12,
+ 15, 16, 17, 14, 11, 17,
+ 16, 13, 12, 15, 17, 17,
+ 15, 13, 16, 15, 12, 13,
+ 15, 17, 17, 14, 15, 17,
+ 15, 14, 17, 15, 17, 17,
+ 16, 12, 17, 17, 17, 16,
+ 14, 15, 17, 11, 13, 15,
+ 17, 16, 15, 12, 17, 17,
+ 11, 15, 17, 17, 16, 14,
+ 17, 15, 17, 16, 14, 17,
+ 17, 15, 16, 17, 14, 16,
+ 17, 14, 17, 16, 15, 14,
+ 17, 17, 12, 17, 17, 17,
+ 15, 15, 17, 16, 17, 15,
+ 14, 17, 14, 16, 17, 12,
+ 14, 17, 16, 17, 13, 17,
+ 16, 13, 15, 16, 15, 16,
+ 14, 15, 17, 17, 15, 14,
+ 14, 16, 17, 14, 11, 15,
+ 16, 16, 14, 16, 17, 17,
+ 15, 14, 15, 15, 15, 15,
+ 13, 15, 17, 14, 11, 17,
+ 17, 12, 11, 15, 17, 17,
+ 15, 14, 17, 16, 14, 17,
+ 17, 15, 15, 16, 15, 15,
+ 16, 14, 14, 15, 15, 15,
+ 16, 17, 15, 15, 16, 14,
+ 15, 16, 13, 11, 14, 16,
+ 17, 14, 13, 17, 17, 14,
+ 12, 16, 16, 17, 16, 17,
+ 17, 17, 16, 17, 17, 17,
+ 17, 17, 17, 17, 16, 17,
+ 17, 17, 17, 17, 17, 17,
+ 16, 17, 17, 16, 17, 17,
+ 16, 13, 16, 17, 16, 16,
+ 11, 17, 17, 17, 16, 15,
+ 17, 17, 14, 16, 16, 17,
+ 16, 17, 17, 17, 17, 17,
+ 17, 16, 16, 17, 15, 15,
+ 17, 17, 16, 15, 16, 17,
+ 16, 16, 15, 16, 17, 16,
+ 14, 13, 17, 17, 13, 15,
+ 17, 17, 14, 12, 17, 17,
+ 16, 15, 15, 17, 17, 15,
+ 17, 16, 17, 16, 17, 17,
+ 17, 17, 16, 13, 16, 17,
+ 16, 17, 17, 17, 17, 17,
+ 16, 17, 15, 16, 13, 16,
+ 16, 16, 15, 16, 17, 17,
+ 17, 17, 16, 17, 17, 16,
+ 17, 16, 16, 16, 15, 16,
+ 15, 17, 17, 17, 16, 15,
+ 16, 16, 15, 15, 16, 17,
+ 16, 17, 17, 17, 17, 16,
+ 17, 17, 16, 17, 16, 17,
+ 16, 16, 12, 17, 16, 14,
+ 13, 16, 17, 17, 15, 14,
+ 17, 17, 14, 16, 16, 17,
+ 16, 15, 17, 15, 17, 17,
+ 14, 17, 17, 15, 13, 14,
+ 17, 15, 16, 12, 16, 16,
+ 15, 12, 16, 17, 17, 15,
+ 14, 16, 17, 12, 12, 16,
+ 16, 16, 17, 14, 16, 16,
+ 13, 15, 16, 17, 17, 15,
+ 15, 16, 16, 16, 15, 17,
+ 17, 14, 14, 15, 17, 17,
+ 15, 14, 17, 15, 12, 12,
+ 14, 17, 17, 15, 14, 17,
+ 17, 17, 17, 15, 16, 17,
+ 15, 17, 16, 17, 15, 17,
+ 17, 16, 16, 16, 15, 16,
+ 17, 17, 15, 15, 16, 17,
+ 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 15,
+ 17, 17, 15, 14, 17, 17,
+ 14, 14, 16, 16, 17, 16,
+ 16, 17, 16, 15, 17, 17,
+ 16, 16, 17, 16, 16, 17,
+ 15, 15, 17, 17, 15, 17,
+ 17, 15, 15, 16, 16, 16,
+ 17, 15, 13, 17, 17, 17,
+ 17, 11, 16, 17, 17, 16,
+ 14, 17, 17, 14, 16, 17,
+ 17, 15, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 16,
+ 14, 16, 17, 16, 16, 17,
+ 16, 17, 16, 17, 16, 17,
+ 17, 17, 15, 16, 17, 15,
+ 9, 17, 17, 17, 16, 12,
+ 17, 17, 13, 15, 15, 17,
+ 17, 16, 16, 17, 17, 16,
+ 16, 17, 17, 17, 17, 16,
+ 17, 17, 17, 16, 15, 17,
+ 17, 16, 13, 17, 17, 17,
+ 15, 13, 17, 17, 13, 12,
+ 17, 17, 12, 9, 15, 17,
+ 17, 15, 14, 17, 17, 15,
+ 16, 17, 17, 16, 16, 17,
+ 17, 17, 16, 17, 17, 17,
+ 17, 14, 17, 17, 17, 16,
+ 14, 17, 17, 13, 11, 16,
+ 17, 17, 14, 10, 16, 17,
+ 17, 16, 12, 16, 17, 12,
+ 14, 16, 17, 17, 15, 16,
+ 17, 17, 16, 17, 17, 17,
+ 17, 17, 15, 17, 17, 17,
+ 17, 14, 16, 17, 15, 12,
+ 15, 16, 17, 15, 11, 17,
+ 17, 12, 13, 17, 17, 14,
+ 10, 16, 17, 17, 16, 13,
+ 16, 16, 14, 17, 15, 17,
+ 17, 17, 17, 17, 17, 17,
+ 15, 17, 16, 16, 15, 17,
+ 17, 17, 15, 13, 17, 16,
+ 14, 11, 16, 17, 17, 15,
+ 11, 16, 17, 17, 16, 12,
+ 17, 16, 14, 14, 17, 17,
+ 17, 16, 13, 16, 17, 15,
+ 17, 17, 17, 17, 17, 17,
+ 16, 17, 17, 17, 14, 16,
+ 17, 16, 15, 16, 17, 17,
+ 15, 12, 17, 16, 14, 11,
+ 17, 17, 17, 15, 14, 17,
+ 17, 14, 15, 17, 16, 17,
+ 17, 17, 16, 16, 17, 17,
+ 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17,
+ 14, 14, 17, 17, 17, 17,
+ 14, 17, 17, 12, 14, 17,
+ 17, 14, 11, 16, 17, 17,
+ 15, 15, 16, 17, 13, 17,
+ 16, 17, 17, 15, 17, 17,
+ 17, 16, 16, 17, 16, 14,
+ 15, 16, 17, 17, 15, 15,
+ 17, 17, 13, 11, 15, 17,
+ 17, 16, 10, 16, 16, 17,
+ 16, 12, 17, 17, 12, 14,
+ 15, 17, 17, 15, 16, 17,
+ 15, 15, 17, 16, 17, 16,
+ 16, 15, 16, 17, 17, 16,
+ 15, 17, 17, 14, 13, 14,
+ 16, 17, 14, 12, 17, 16,
+ 13, 12, 16, 17, 13, 9,
+ 15, 17, 17, 16, 15, 17,
+ 17, 14, 16, 16, 17, 17,
+ 16, 16, 17, 17, 17, 15,
+ 17, 16, 16, 15, 16, 17,
+ 17, 15, 13, 17, 17, 14,
+ 11, 15, 17, 17, 15, 9,
+ 16, 17, 17, 15, 12, 17,
+ 16, 13, 14, 17, 17, 17,
+ 16, 16, 17, 17, 15, 16,
+ 17, 17, 16, 17, 17, 17,
+ 17, 17, 17, 17, 17, 16,
+ 16, 15, 17, 17, 17, 15,
+ 12, 17, 16, 12, 12, 16,
+ 17, 12, 10, 17, 17, 17,
+ 14, 14, 17, 17, 14, 14,
+ 16, 17, 17, 15, 16, 17,
+ 17, 17, 16, 17, 16, 17,
+ 14, 17, 17, 17, 16, 13,
+ 17, 17, 14, 9, 15, 17,
+ 17, 15, 10, 15, 17, 17,
+ 15, 12, 17, 17, 13, 13,
+ 16, 17, 17, 15, 14, 17,
+ 17, 14, 17, 16, 16, 17,
+ 17, 17, 17, 17, 17, 17,
+ 15, 17, 16, 15, 14, 15,
+ 17, 17, 16, 12, 16, 17,
+ 12, 13, 17, 17, 13, 11,
+ 17, 17, 17, 16, 12, 16,
+ 17, 15, 15, 15, 17, 17,
+ 17, 16, 16, 17, 16, 16,
+ 17, 17, 16, 16, 15, 17,
+ 17, 16, 13, 15, 17, 14,
+ 11, 15, 17, 16, 15, 12,
+ 17, 17, 16, 17, 12, 17,
+ 17, 15, 14, 16, 17, 17,
+ 15, 15, 17, 17, 15, 15,
+ 17, 17, 17, 16, 17, 17,
+ 17, 17, 17, 16, 15, 16,
+ 17, 14, 15, 16, 17, 17,
+ 15, 17, 17, 13, 12, 17,
+ 17, 17, 16, 14, 17, 17,
+ 12, 15, 15, 17, 17, 16,
+ 15, 17, 17, 14, 16, 17,
+ 17, 17, 17, 17, 17, 17,
+ 16, 15, 15, 17, 15, 15,
+ 14, 15, 17, 17, 15, 13,
+ 17, 17, 14, 14, 17, 17,
+ 14, 10, 16, 17, 17, 15,
+ 14, 17, 17, 13, 15, 16,
+ 17, 17, 15, 17, 16, 17,
+ 15, 17, 16, 17, 17, 15,
+ 16, 17, 17, 14, 14, 17,
+ 16, 12, 10, 16, 17, 17,
+ 15, 10, 16, 17, 17, 15,
+ 12, 17, 17, 13, 13, 15,
+ 17, 17, 15, 15, 17, 17,
+ 13, 14, 17, 17, 17, 16,
+ 17, 17, 17, 17, 17, 15,
+ 17, 16, 16, 13, 17, 16,
+ 17, 17, 12, 17, 17, 12,
+ 13, 17, 17, 12, 11, 15,
+ 16, 17, 17, 13, 16, 16,
+ 14, 14, 15, 17, 17, 16,
+ 16, 17, 17, 16, 17, 17,
+ 17, 17, 15, 17, 17, 17,
+ 16, 15, 17, 17, 14, 9,
+ 17, 17, 17, 15, 15, 17,
+ 17, 14, 13, 16, 17, 16,
+ 16, 16, 17, 17, 16, 16,
+ 16, 17, 17, 16, 16, 16,
+ 17, 16, 16, 17, 17, 17,
+ 17, 17, 17, 17, 16, 17,
+ 16, 17, 17, 12, 16, 17,
+ 17, 17, 10, 17, 16, 17,
+ 17, 13, 17, 17, 14, 16,
+ 17, 17, 15, 17, 17, 17,
+ 17, 17, 13, 16, 17, 16,
+ 15, 16, 15, 17, 16, 15,
+ 17, 17, 17, 17, 15, 16,
+ 16, 15, 16, 14, 17, 17,
+ 13, 15, 17, 17, 15, 13,
+ 17, 15, 17, 17, 15, 17,
+ 16, 15, 17, 16, 17, 17,
+ 16, 13, 16, 17, 15, 17,
+ 17, 17, 17, 17, 16, 17,
+ 16, 17, 15, 16, 17, 15,
+ 13, 16, 16, 16, 16, 14,
+ 17, 17, 17, 16, 15, 17,
+ 16, 17, 16, 16, 17, 15,
+ 17, 16, 17, 16, 17, 14,
+ 15, 17, 17, 17, 16, 16,
+ 16, 17, 17, 17, 16, 17,
+ 17, 16, 17, 17, 16, 17,
+ 16, 17, 17, 14, 13, 17,
+ 17, 14, 12, 17, 17, 17,
+ 15, 12, 17, 16, 15, 15,
+ 15, 17, 17, 17, 14, 16,
+ 17, 16, 16, 16, 17, 17,
+ 17, 15, 17, 17, 17, 14,
+ 16, 15, 14, 13, 14, 17,
+ 17, 17, 15, 16, 17, 12,
+ 13, 15, 17, 17, 16, 14,
+ 16, 16, 12, 14, 16, 16,
+ 17, 15, 16, 17, 16, 13,
+ 16, 16, 16, 17, 15, 15,
+ 16, 17, 14, 14, 17, 17,
+ 13, 12, 15, 17, 17, 15,
+ 14, 16, 16, 17, 17, 15,
+ 17, 17, 17, 16, 16, 17,
+ 16, 16, 17, 17, 17, 17,
+ 15, 16, 17, 17, 16, 16,
+ 16, 17, 15, 17, 17, 17,
+ 15, 16, 16, 17, 17, 16,
+ 16, 15, 17, 17, 15, 14,
+ 17, 17, 14, 14, 16, 17,
+ 17, 17, 15, 16, 17, 16,
+ 17, 16, 16, 17, 17, 16,
+ 15, 16, 15, 16, 17, 17,
+ 15, 17, 17, 16, 16, 16,
+ 15, 17, 17, 15, 12, 16,
+ 17, 17, 16, 11, 17, 17,
+ 16, 16, 14, 16, 17, 14,
+ 16, 16, 17, 16, 15, 17,
+ 17, 17, 16, 15, 15, 17,
+ 17, 17, 17, 17, 17, 17,
+ 16, 17, 17, 17, 16, 14,
+ 17, 16, 17, 16, 13, 17,
+ 17, 13, 8, 15, 15, 15,
+ 14, 12, 16, 17, 12, 13,
+ 15, 15, 16, 16, 16, 17,
+ 17, 16, 12, 15, 17, 15,
+ 16, 14, 15, 16, 17, 16,
+ 17, 17, 17, 17, 15, 16,
+ 15, 15, 15, 12, 16, 17,
+ 12, 11, 17, 17, 11, 11,
+ 14, 15, 15, 13, 13, 16,
+ 15, 13, 16, 15, 16, 17,
+ 15, 13, 15, 15, 15, 15,
+ 15, 16, 14, 17, 17, 14,
+ 17, 17, 14, 16, 17, 14,
+ 11, 14, 14, 16, 14, 12,
+ 16, 15, 16, 15, 13, 15,
+ 16, 13, 14, 15, 15, 15,
+ 15, 15, 16, 17, 17, 11,
+ 14, 17, 16, 14, 15, 16,
+ 16, 16, 15, 16, 15, 17,
+ 16, 15, 14, 16, 16, 16,
+ 13, 17, 17, 13, 15, 17,
+ 17, 15, 15, 17, 17, 16,
+ 16, 15, 17, 17, 15, 16,
+ 17, 17, 15, 17, 13, 14,
+ 16, 14, 16, 15, 15, 14,
+ 16, 17, 15, 16, 16, 15,
+ 17, 17, 16, 15, 16, 16,
+ 16, 15, 10, 16, 17, 17,
+ 15, 11, 16, 17, 12, 13,
+ 14, 17, 15, 15, 12, 17,
+ 15, 14, 12, 15, 17, 17,
+ 15, 15, 16, 17, 17, 16,
+ 14, 15, 15, 15, 14, 15,
+ 16, 15, 15, 12, 17, 15,
+ 13, 11, 16, 17, 17, 16,
+ 13, 16, 17, 11, 12, 15,
+ 16, 17, 14, 14, 15, 17,
+ 11, 13, 17, 17, 17, 15,
+ 17, 16, 15, 16, 14, 16,
+ 16, 17, 14, 13, 14, 16,
+ 17, 14, 14, 15, 16, 12,
+ 15, 17, 17, 16, 14, 17,
+ 16, 17, 17, 16, 17, 17,
+ 15, 16, 17, 15, 15, 17,
+ 14, 15, 15, 13, 15, 15,
+ 15, 16, 17, 17, 16, 15,
+ 14, 17, 17, 17, 15, 14,
+ 16, 17, 17, 17, 11, 14,
+ 14, 16, 17, 14, 15, 16,
+ 14, 13, 15, 14, 17, 16,
+ 15, 16, 17, 17, 11, 15,
+ 17, 17, 14, 14, 16, 16,
+ 16, 14, 17, 17, 15, 16,
+ 14, 15, 17, 16, 13, 13,
+ 16, 16, 12, 11, 17, 17,
+ 12, 11, 14, 16, 17, 15,
+ 14, 16, 17, 13, 15, 16,
+ 15, 16, 16, 15, 15, 15,
+ 13, 14, 15, 15, 16, 17,
+ 17, 15, 15, 16, 15, 16,
+ 16, 13, 10, 16, 15, 15,
+ 15, 7, 14, 14, 7, 7,
+ 11, 12, 12, 11, 12, 14,
+ 14, 12, 15, 16, 13, 14,
+ 16, 13, 13, 15, 13, 11,
+ 12, 13, 11, 15, 15, 13,
+ 12, 15, 12, 14, 15, 12,
+ 7, 12, 12, 12, 11, 6,
+ 12, 12, 13, 12, 9, 14,
+ 14, 9, 12, 13, 13, 12,
+ 14, 15, 16, 17, 14, 12,
+ 13, 13, 15, 13, 11, 12,
+ 14, 12, 11, 14, 15, 17,
+ 14, 12, 13, 12, 13, 14,
+ 9, 13, 15, 9, 12, 17,
+ 16, 12, 11, 14, 14, 13,
+ 15, 13, 16, 17, 14, 15,
+ 17, 14, 14, 15, 13, 15,
+ 14, 12, 12, 14, 12, 11,
+ 16, 15, 13, 13, 16, 13,
+ 15, 15, 14, 12, 13, 14,
+ 15, 14, 13, 17, 16, 16,
+ 16, 15, 17, 17, 14, 14,
+ 16, 14, 15, 17, 15, 17,
+ 17, 16, 13, 14, 16, 16,
+ 13, 14, 14, 15, 14, 12,
+ 17, 16, 17, 17, 16, 15,
+ 15, 14, 16, 16, 17, 17,
+ 15, 11, 16, 16, 13, 11,
+ 14, 16, 17, 14, 10, 17,
+ 16, 12, 13, 15, 17, 16,
+ 14, 13, 17, 16, 14, 15,
+ 17, 14, 13, 14, 14, 16,
+ 15, 13, 13, 17, 15, 12,
+ 12, 15, 17, 17, 15, 12,
+ 16, 16, 11, 11, 14, 17,
+ 17, 14, 13, 15, 17, 12,
+ 12, 14, 16, 17, 17, 14,
+ 15, 16, 14, 15, 15, 16,
+ 15, 13, 13, 16, 15, 15,
+ 13, 15, 15, 13, 13, 15,
+ 16, 17, 15, 14, 15, 16,
+ 17, 17, 14, 17, 17, 14,
+ 14, 15, 14, 17, 16, 16,
+ 17, 17, 17, 12, 15, 16,
+ 17, 15, 14, 12, 13, 15,
+ 12, 15, 17, 16, 16, 16,
+ 17, 14, 14, 15, 15, 17,
+ 17, 15, 12, 16, 16, 12,
+ 11, 14, 14, 14, 14, 14,
+ 14, 15, 13, 15, 16, 13,
+ 14, 16, 13, 16, 14, 13,
+ 11, 12, 14, 13, 16, 15,
+ 13, 14, 15, 13, 15, 15,
+ 12, 11, 15, 13, 13, 14,
+ 7, 12, 13, 12, 12, 9,
+ 15, 15, 9, 12, 14, 12,
+ 12, 14, 15, 15, 15, 15,
+ 13, 14, 16, 14, 14, 12,
+ 11, 13, 14, 12, 14, 16,
+ 14, 14, 12, 14, 12, 12,
+ 12, 9, 14, 14, 9,
+};
+
+static const uint16_t on2avc_cb7_syms[ON2AVC_CB7_CODES] = {
+ 0x0000, 0x0002, 0x0004, 0x000C, 0x000E, 0x0011,
+ 0x0013, 0x001D, 0x001F, 0x0020, 0x0022, 0x0024,
+ 0x002C, 0x002E, 0x0031, 0x0033, 0x003D, 0x003F,
+ 0x0040, 0x0042, 0x0044, 0x004C, 0x004E, 0x00C0,
+ 0x00C2, 0x00C4, 0x00CC, 0x00CE, 0x00D1, 0x00D3,
+ 0x00DD, 0x00DF, 0x00E0, 0x00E2, 0x00E4, 0x00EC,
+ 0x00EE, 0x00F1, 0x00F3, 0x00FD, 0x00FF, 0x0101,
+ 0x0103, 0x010D, 0x010F, 0x0110, 0x0112, 0x0114,
+ 0x011C, 0x011E, 0x0121, 0x0123, 0x012D, 0x012F,
+ 0x0130, 0x0132, 0x0134, 0x013C, 0x013E, 0x0141,
+ 0x0143, 0x014D, 0x014F, 0x01C1, 0x01C3, 0x01CD,
+ 0x01CF, 0x01D0, 0x01D2, 0x01D4, 0x01DC, 0x01DE,
+ 0x01E1, 0x01E3, 0x01ED, 0x01EF, 0x01F0, 0x01F2,
+ 0x01F4, 0x01FC, 0x01FE, 0x0200, 0x0202, 0x0204,
+ 0x020C, 0x020E, 0x0211, 0x0213, 0x021D, 0x021F,
+ 0x0220, 0x0222, 0x0224, 0x022C, 0x022E, 0x0231,
+ 0x0233, 0x023D, 0x023F, 0x0240, 0x0242, 0x0244,
+ 0x024C, 0x024E, 0x02C0, 0x02C2, 0x02C4, 0x02CC,
+ 0x02CE, 0x02D1, 0x02D3, 0x02DD, 0x02DF, 0x02E0,
+ 0x02E2, 0x02E4, 0x02EC, 0x02EE, 0x02F1, 0x02F3,
+ 0x02FD, 0x02FF, 0x0301, 0x0303, 0x030D, 0x030F,
+ 0x0310, 0x0312, 0x0314, 0x031C, 0x031E, 0x0321,
+ 0x0323, 0x032D, 0x032F, 0x0330, 0x0332, 0x0334,
+ 0x033C, 0x033E, 0x0341, 0x0343, 0x034D, 0x034F,
+ 0x03C1, 0x03C3, 0x03CD, 0x03CF, 0x03D0, 0x03D2,
+ 0x03D4, 0x03DC, 0x03DE, 0x03E1, 0x03E3, 0x03ED,
+ 0x03EF, 0x03F0, 0x03F2, 0x03F4, 0x03FC, 0x03FE,
+ 0x0400, 0x0402, 0x0404, 0x040C, 0x040E, 0x0411,
+ 0x0413, 0x041D, 0x041F, 0x0420, 0x0422, 0x0424,
+ 0x042C, 0x042E, 0x0431, 0x0433, 0x043D, 0x043F,
+ 0x0440, 0x0442, 0x0444, 0x044C, 0x044E, 0x04C0,
+ 0x04C2, 0x04C4, 0x04CC, 0x04CE, 0x04D1, 0x04D3,
+ 0x04DD, 0x04DF, 0x04E0, 0x04E2, 0x04E4, 0x04EC,
+ 0x04EE, 0x04F1, 0x04F3, 0x04FD, 0x04FF, 0x0C00,
+ 0x0C02, 0x0C04, 0x0C0C, 0x0C0E, 0x0C11, 0x0C13,
+ 0x0C1D, 0x0C1F, 0x0C20, 0x0C22, 0x0C24, 0x0C2C,
+ 0x0C2E, 0x0C31, 0x0C33, 0x0C3D, 0x0C3F, 0x0C40,
+ 0x0C42, 0x0C44, 0x0C4C, 0x0C4E, 0x0CC0, 0x0CC2,
+ 0x0CC4, 0x0CCC, 0x0CCE, 0x0CD1, 0x0CD3, 0x0CDD,
+ 0x0CDF, 0x0CE0, 0x0CE2, 0x0CE4, 0x0CEC, 0x0CEE,
+ 0x0CF1, 0x0CF3, 0x0CFD, 0x0CFF, 0x0D01, 0x0D03,
+ 0x0D0D, 0x0D0F, 0x0D10, 0x0D12, 0x0D14, 0x0D1C,
+ 0x0D1E, 0x0D21, 0x0D23, 0x0D2D, 0x0D2F, 0x0D30,
+ 0x0D32, 0x0D34, 0x0D3C, 0x0D3E, 0x0D41, 0x0D43,
+ 0x0D4D, 0x0D4F, 0x0DC1, 0x0DC3, 0x0DCD, 0x0DCF,
+ 0x0DD0, 0x0DD2, 0x0DD4, 0x0DDC, 0x0DDE, 0x0DE1,
+ 0x0DE3, 0x0DED, 0x0DEF, 0x0DF0, 0x0DF2, 0x0DF4,
+ 0x0DFC, 0x0DFE, 0x0E00, 0x0E02, 0x0E04, 0x0E0C,
+ 0x0E0E, 0x0E11, 0x0E13, 0x0E1D, 0x0E1F, 0x0E20,
+ 0x0E22, 0x0E24, 0x0E2C, 0x0E2E, 0x0E31, 0x0E33,
+ 0x0E3D, 0x0E3F, 0x0E40, 0x0E42, 0x0E44, 0x0E4C,
+ 0x0E4E, 0x0EC0, 0x0EC2, 0x0EC4, 0x0ECC, 0x0ECE,
+ 0x0ED1, 0x0ED3, 0x0EDD, 0x0EDF, 0x0EE0, 0x0EE2,
+ 0x0EE4, 0x0EEC, 0x0EEE, 0x0EF1, 0x0EF3, 0x0EFD,
+ 0x0EFF, 0x0F01, 0x0F03, 0x0F0D, 0x0F0F, 0x0F10,
+ 0x0F12, 0x0F14, 0x0F1C, 0x0F1E, 0x0F21, 0x0F23,
+ 0x0F2D, 0x0F2F, 0x0F30, 0x0F32, 0x0F34, 0x0F3C,
+ 0x0F3E, 0x0F41, 0x0F43, 0x0F4D, 0x0F4F, 0x0FC1,
+ 0x0FC3, 0x0FCD, 0x0FCF, 0x0FD0, 0x0FD2, 0x0FD4,
+ 0x0FDC, 0x0FDE, 0x0FE1, 0x0FE3, 0x0FED, 0x0FEF,
+ 0x0FF0, 0x0FF2, 0x0FF4, 0x0FFC, 0x0FFE, 0x1001,
+ 0x1003, 0x100D, 0x100F, 0x1010, 0x1012, 0x1014,
+ 0x101C, 0x101E, 0x1021, 0x1023, 0x102D, 0x102F,
+ 0x1030, 0x1032, 0x1034, 0x103C, 0x103E, 0x1041,
+ 0x1043, 0x104D, 0x104F, 0x10C1, 0x10C3, 0x10CD,
+ 0x10CF, 0x10D0, 0x10D2, 0x10D4, 0x10DC, 0x10DE,
+ 0x10E1, 0x10E3, 0x10ED, 0x10EF, 0x10F0, 0x10F2,
+ 0x10F4, 0x10FC, 0x10FE, 0x1100, 0x1102, 0x1104,
+ 0x110C, 0x110E, 0x1111, 0x1113, 0x111D, 0x111F,
+ 0x1120, 0x1122, 0x1124, 0x112C, 0x112E, 0x1131,
+ 0x1133, 0x113D, 0x113F, 0x1140, 0x1142, 0x1144,
+ 0x114C, 0x114E, 0x11C0, 0x11C2, 0x11C4, 0x11CC,
+ 0x11CE, 0x11D1, 0x11D3, 0x11DD, 0x11DF, 0x11E0,
+ 0x11E2, 0x11E4, 0x11EC, 0x11EE, 0x11F1, 0x11F3,
+ 0x11FD, 0x11FF, 0x1201, 0x1203, 0x120D, 0x120F,
+ 0x1210, 0x1212, 0x1214, 0x121C, 0x121E, 0x1221,
+ 0x1223, 0x122D, 0x122F, 0x1230, 0x1232, 0x1234,
+ 0x123C, 0x123E, 0x1241, 0x1243, 0x124D, 0x124F,
+ 0x12C1, 0x12C3, 0x12CD, 0x12CF, 0x12D0, 0x12D2,
+ 0x12D4, 0x12DC, 0x12DE, 0x12E1, 0x12E3, 0x12ED,
+ 0x12EF, 0x12F0, 0x12F2, 0x12F4, 0x12FC, 0x12FE,
+ 0x1300, 0x1302, 0x1304, 0x130C, 0x130E, 0x1311,
+ 0x1313, 0x131D, 0x131F, 0x1320, 0x1322, 0x1324,
+ 0x132C, 0x132E, 0x1331, 0x1333, 0x133D, 0x133F,
+ 0x1340, 0x1342, 0x1344, 0x134C, 0x134E, 0x13C0,
+ 0x13C2, 0x13C4, 0x13CC, 0x13CE, 0x13D1, 0x13D3,
+ 0x13DD, 0x13DF, 0x13E0, 0x13E2, 0x13E4, 0x13EC,
+ 0x13EE, 0x13F1, 0x13F3, 0x13FD, 0x13FF, 0x1401,
+ 0x1403, 0x140D, 0x140F, 0x1410, 0x1412, 0x1414,
+ 0x141C, 0x141E, 0x1421, 0x1423, 0x142D, 0x142F,
+ 0x1430, 0x1432, 0x1434, 0x143C, 0x143E, 0x1441,
+ 0x1443, 0x144D, 0x144F, 0x14C1, 0x14C3, 0x14CD,
+ 0x14CF, 0x14D0, 0x14D2, 0x14D4, 0x14DC, 0x14DE,
+ 0x14E1, 0x14E3, 0x14ED, 0x14EF, 0x14F0, 0x14F2,
+ 0x14F4, 0x14FC, 0x14FE, 0x1C01, 0x1C03, 0x1C0D,
+ 0x1C0F, 0x1C10, 0x1C12, 0x1C14, 0x1C1C, 0x1C1E,
+ 0x1C21, 0x1C23, 0x1C2D, 0x1C2F, 0x1C30, 0x1C32,
+ 0x1C34, 0x1C3C, 0x1C3E, 0x1C41, 0x1C43, 0x1C4D,
+ 0x1C4F, 0x1CC1, 0x1CC3, 0x1CCD, 0x1CCF, 0x1CD0,
+ 0x1CD2, 0x1CD4, 0x1CDC, 0x1CDE, 0x1CE1, 0x1CE3,
+ 0x1CED, 0x1CEF, 0x1CF0, 0x1CF2, 0x1CF4, 0x1CFC,
+ 0x1CFE, 0x1D00, 0x1D02, 0x1D04, 0x1D0C, 0x1D0E,
+ 0x1D11, 0x1D13, 0x1D1D, 0x1D1F, 0x1D20, 0x1D22,
+ 0x1D24, 0x1D2C, 0x1D2E, 0x1D31, 0x1D33, 0x1D3D,
+ 0x1D3F, 0x1D40, 0x1D42, 0x1D44, 0x1D4C, 0x1D4E,
+ 0x1DC0, 0x1DC2, 0x1DC4, 0x1DCC, 0x1DCE, 0x1DD1,
+ 0x1DD3, 0x1DDD, 0x1DDF, 0x1DE0, 0x1DE2, 0x1DE4,
+ 0x1DEC, 0x1DEE, 0x1DF1, 0x1DF3, 0x1DFD, 0x1DFF,
+ 0x1E01, 0x1E03, 0x1E0D, 0x1E0F, 0x1E10, 0x1E12,
+ 0x1E14, 0x1E1C, 0x1E1E, 0x1E21, 0x1E23, 0x1E2D,
+ 0x1E2F, 0x1E30, 0x1E32, 0x1E34, 0x1E3C, 0x1E3E,
+ 0x1E41, 0x1E43, 0x1E4D, 0x1E4F, 0x1EC1, 0x1EC3,
+ 0x1ECD, 0x1ECF, 0x1ED0, 0x1ED2, 0x1ED4, 0x1EDC,
+ 0x1EDE, 0x1EE1, 0x1EE3, 0x1EED, 0x1EEF, 0x1EF0,
+ 0x1EF2, 0x1EF4, 0x1EFC, 0x1EFE, 0x1F00, 0x1F02,
+ 0x1F04, 0x1F0C, 0x1F0E, 0x1F11, 0x1F13, 0x1F1D,
+ 0x1F1F, 0x1F20, 0x1F22, 0x1F24, 0x1F2C, 0x1F2E,
+ 0x1F31, 0x1F33, 0x1F3D, 0x1F3F, 0x1F40, 0x1F42,
+ 0x1F44, 0x1F4C, 0x1F4E, 0x1FC0, 0x1FC2, 0x1FC4,
+ 0x1FCC, 0x1FCE, 0x1FD1, 0x1FD3, 0x1FDD, 0x1FDF,
+ 0x1FE0, 0x1FE2, 0x1FE4, 0x1FEC, 0x1FEE, 0x1FF1,
+ 0x1FF3, 0x1FFD, 0x1FFF, 0x2000, 0x2002, 0x2004,
+ 0x200C, 0x200E, 0x2011, 0x2013, 0x201D, 0x201F,
+ 0x2020, 0x2022, 0x2024, 0x202C, 0x202E, 0x2031,
+ 0x2033, 0x203D, 0x203F, 0x2040, 0x2042, 0x2044,
+ 0x204C, 0x204E, 0x20C0, 0x20C2, 0x20C4, 0x20CC,
+ 0x20CE, 0x20D1, 0x20D3, 0x20DD, 0x20DF, 0x20E0,
+ 0x20E2, 0x20E4, 0x20EC, 0x20EE, 0x20F1, 0x20F3,
+ 0x20FD, 0x20FF, 0x2101, 0x2103, 0x210D, 0x210F,
+ 0x2110, 0x2112, 0x2114, 0x211C, 0x211E, 0x2121,
+ 0x2123, 0x212D, 0x212F, 0x2130, 0x2132, 0x2134,
+ 0x213C, 0x213E, 0x2141, 0x2143, 0x214D, 0x214F,
+ 0x21C1, 0x21C3, 0x21CD, 0x21CF, 0x21D0, 0x21D2,
+ 0x21D4, 0x21DC, 0x21DE, 0x21E1, 0x21E3, 0x21ED,
+ 0x21EF, 0x21F0, 0x21F2, 0x21F4, 0x21FC, 0x21FE,
+ 0x2200, 0x2202, 0x2204, 0x220C, 0x220E, 0x2211,
+ 0x2213, 0x221D, 0x221F, 0x2220, 0x2222, 0x2224,
+ 0x222C, 0x222E, 0x2231, 0x2233, 0x223D, 0x223F,
+ 0x2240, 0x2242, 0x2244, 0x224C, 0x224E, 0x22C0,
+ 0x22C2, 0x22C4, 0x22CC, 0x22CE, 0x22D1, 0x22D3,
+ 0x22DD, 0x22DF, 0x22E0, 0x22E2, 0x22E4, 0x22EC,
+ 0x22EE, 0x22F1, 0x22F3, 0x22FD, 0x22FF, 0x2301,
+ 0x2303, 0x230D, 0x230F, 0x2310, 0x2312, 0x2314,
+ 0x231C, 0x231E, 0x2321, 0x2323, 0x232D, 0x232F,
+ 0x2330, 0x2332, 0x2334, 0x233C, 0x233E, 0x2341,
+ 0x2343, 0x234D, 0x234F, 0x23C1, 0x23C3, 0x23CD,
+ 0x23CF, 0x23D0, 0x23D2, 0x23D4, 0x23DC, 0x23DE,
+ 0x23E1, 0x23E3, 0x23ED, 0x23EF, 0x23F0, 0x23F2,
+ 0x23F4, 0x23FC, 0x23FE, 0x2400, 0x2402, 0x2404,
+ 0x240C, 0x240E, 0x2411, 0x2413, 0x241D, 0x241F,
+ 0x2420, 0x2422, 0x2424, 0x242C, 0x242E, 0x2431,
+ 0x2433, 0x243D, 0x243F, 0x2440, 0x2442, 0x2444,
+ 0x244C, 0x244E, 0x24C0, 0x24C2, 0x24C4, 0x24CC,
+ 0x24CE, 0x24D1, 0x24D3, 0x24DD, 0x24DF, 0x24E0,
+ 0x24E2, 0x24E4, 0x24EC, 0x24EE, 0x24F1, 0x24F3,
+ 0x24FD, 0x24FF, 0x2C00, 0x2C02, 0x2C04, 0x2C0C,
+ 0x2C0E, 0x2C11, 0x2C13, 0x2C1D, 0x2C1F, 0x2C20,
+ 0x2C22, 0x2C24, 0x2C2C, 0x2C2E, 0x2C31, 0x2C33,
+ 0x2C3D, 0x2C3F, 0x2C40, 0x2C42, 0x2C44, 0x2C4C,
+ 0x2C4E, 0x2CC0, 0x2CC2, 0x2CC4, 0x2CCC, 0x2CCE,
+ 0x2CD1, 0x2CD3, 0x2CDD, 0x2CDF, 0x2CE0, 0x2CE2,
+ 0x2CE4, 0x2CEC, 0x2CEE, 0x2CF1, 0x2CF3, 0x2CFD,
+ 0x2CFF, 0x2D01, 0x2D03, 0x2D0D, 0x2D0F, 0x2D10,
+ 0x2D12, 0x2D14, 0x2D1C, 0x2D1E, 0x2D21, 0x2D23,
+ 0x2D2D, 0x2D2F, 0x2D30, 0x2D32, 0x2D34, 0x2D3C,
+ 0x2D3E, 0x2D41, 0x2D43, 0x2D4D, 0x2D4F, 0x2DC1,
+ 0x2DC3, 0x2DCD, 0x2DCF, 0x2DD0, 0x2DD2, 0x2DD4,
+ 0x2DDC, 0x2DDE, 0x2DE1, 0x2DE3, 0x2DED, 0x2DEF,
+ 0x2DF0, 0x2DF2, 0x2DF4, 0x2DFC, 0x2DFE, 0x2E00,
+ 0x2E02, 0x2E04, 0x2E0C, 0x2E0E, 0x2E11, 0x2E13,
+ 0x2E1D, 0x2E1F, 0x2E20, 0x2E22, 0x2E24, 0x2E2C,
+ 0x2E2E, 0x2E31, 0x2E33, 0x2E3D, 0x2E3F, 0x2E40,
+ 0x2E42, 0x2E44, 0x2E4C, 0x2E4E, 0x2EC0, 0x2EC2,
+ 0x2EC4, 0x2ECC, 0x2ECE, 0x2ED1, 0x2ED3, 0x2EDD,
+ 0x2EDF, 0x2EE0, 0x2EE2, 0x2EE4, 0x2EEC, 0x2EEE,
+ 0x2EF1, 0x2EF3, 0x2EFD, 0x2EFF, 0x2F01, 0x2F03,
+ 0x2F0D, 0x2F0F, 0x2F10, 0x2F12, 0x2F14, 0x2F1C,
+ 0x2F1E, 0x2F21, 0x2F23, 0x2F2D, 0x2F2F, 0x2F30,
+ 0x2F32, 0x2F34, 0x2F3C, 0x2F3E, 0x2F41, 0x2F43,
+ 0x2F4D, 0x2F4F, 0x2FC1, 0x2FC3, 0x2FCD, 0x2FCF,
+ 0x2FD0, 0x2FD2, 0x2FD4, 0x2FDC, 0x2FDE, 0x2FE1,
+ 0x2FE3, 0x2FED, 0x2FEF, 0x2FF0, 0x2FF2, 0x2FF4,
+ 0x2FFC, 0x2FFE, 0x3001, 0x3003, 0x300D, 0x300F,
+ 0x3010, 0x3012, 0x3014, 0x301C, 0x301E, 0x3021,
+ 0x3023, 0x302D, 0x302F, 0x3030, 0x3032, 0x3034,
+ 0x303C, 0x303E, 0x3041, 0x3043, 0x304D, 0x304F,
+ 0x30C1, 0x30C3, 0x30CD, 0x30CF, 0x30D0, 0x30D2,
+ 0x30D4, 0x30DC, 0x30DE, 0x30E1, 0x30E3, 0x30ED,
+ 0x30EF, 0x30F0, 0x30F2, 0x30F4, 0x30FC, 0x30FE,
+ 0x3100, 0x3102, 0x3104, 0x310C, 0x310E, 0x3111,
+ 0x3113, 0x311D, 0x311F, 0x3120, 0x3122, 0x3124,
+ 0x312C, 0x312E, 0x3131, 0x3133, 0x313D, 0x313F,
+ 0x3140, 0x3142, 0x3144, 0x314C, 0x314E, 0x31C0,
+ 0x31C2, 0x31C4, 0x31CC, 0x31CE, 0x31D1, 0x31D3,
+ 0x31DD, 0x31DF, 0x31E0, 0x31E2, 0x31E4, 0x31EC,
+ 0x31EE, 0x31F1, 0x31F3, 0x31FD, 0x31FF, 0x3201,
+ 0x3203, 0x320D, 0x320F, 0x3210, 0x3212, 0x3214,
+ 0x321C, 0x321E, 0x3221, 0x3223, 0x322D, 0x322F,
+ 0x3230, 0x3232, 0x3234, 0x323C, 0x323E, 0x3241,
+ 0x3243, 0x324D, 0x324F, 0x32C1, 0x32C3, 0x32CD,
+ 0x32CF, 0x32D0, 0x32D2, 0x32D4, 0x32DC, 0x32DE,
+ 0x32E1, 0x32E3, 0x32ED, 0x32EF, 0x32F0, 0x32F2,
+ 0x32F4, 0x32FC, 0x32FE, 0x3300, 0x3302, 0x3304,
+ 0x330C, 0x330E, 0x3311, 0x3313, 0x331D, 0x331F,
+ 0x3320, 0x3322, 0x3324, 0x332C, 0x332E, 0x3331,
+ 0x3333, 0x333D, 0x333F, 0x3340, 0x3342, 0x3344,
+ 0x334C, 0x334E, 0x33C0, 0x33C2, 0x33C4, 0x33CC,
+ 0x33CE, 0x33D1, 0x33D3, 0x33DD, 0x33DF, 0x33E0,
+ 0x33E2, 0x33E4, 0x33EC, 0x33EE, 0x33F1, 0x33F3,
+ 0x33FD, 0x33FF, 0x3401, 0x3403, 0x340D, 0x340F,
+ 0x3410, 0x3412, 0x3414, 0x341C, 0x341E, 0x3421,
+ 0x3423, 0x342D, 0x342F, 0x3430, 0x3432, 0x3434,
+ 0x343C, 0x343E, 0x3441, 0x3443, 0x344D, 0x344F,
+ 0x34C1, 0x34C3, 0x34CD, 0x34CF, 0x34D0, 0x34D2,
+ 0x34D4, 0x34DC, 0x34DE, 0x34E1, 0x34E3, 0x34ED,
+ 0x34EF, 0x34F0, 0x34F2, 0x34F4, 0x34FC, 0x34FE,
+ 0x3C01, 0x3C03, 0x3C0D, 0x3C0F, 0x3C10, 0x3C12,
+ 0x3C14, 0x3C1C, 0x3C1E, 0x3C21, 0x3C23, 0x3C2D,
+ 0x3C2F, 0x3C30, 0x3C32, 0x3C34, 0x3C3C, 0x3C3E,
+ 0x3C41, 0x3C43, 0x3C4D, 0x3C4F, 0x3CC1, 0x3CC3,
+ 0x3CCD, 0x3CCF, 0x3CD0, 0x3CD2, 0x3CD4, 0x3CDC,
+ 0x3CDE, 0x3CE1, 0x3CE3, 0x3CED, 0x3CEF, 0x3CF0,
+ 0x3CF2, 0x3CF4, 0x3CFC, 0x3CFE, 0x3D00, 0x3D02,
+ 0x3D04, 0x3D0C, 0x3D0E, 0x3D11, 0x3D13, 0x3D1D,
+ 0x3D1F, 0x3D20, 0x3D22, 0x3D24, 0x3D2C, 0x3D2E,
+ 0x3D31, 0x3D33, 0x3D3D, 0x3D3F, 0x3D40, 0x3D42,
+ 0x3D44, 0x3D4C, 0x3D4E, 0x3DC0, 0x3DC2, 0x3DC4,
+ 0x3DCC, 0x3DCE, 0x3DD1, 0x3DD3, 0x3DDD, 0x3DDF,
+ 0x3DE0, 0x3DE2, 0x3DE4, 0x3DEC, 0x3DEE, 0x3DF1,
+ 0x3DF3, 0x3DFD, 0x3DFF, 0x3E01, 0x3E03, 0x3E0D,
+ 0x3E0F, 0x3E10, 0x3E12, 0x3E14, 0x3E1C, 0x3E1E,
+ 0x3E21, 0x3E23, 0x3E2D, 0x3E2F, 0x3E30, 0x3E32,
+ 0x3E34, 0x3E3C, 0x3E3E, 0x3E41, 0x3E43, 0x3E4D,
+ 0x3E4F, 0x3EC1, 0x3EC3, 0x3ECD, 0x3ECF, 0x3ED0,
+ 0x3ED2, 0x3ED4, 0x3EDC, 0x3EDE, 0x3EE1, 0x3EE3,
+ 0x3EED, 0x3EEF, 0x3EF0, 0x3EF2, 0x3EF4, 0x3EFC,
+ 0x3EFE, 0x3F00, 0x3F02, 0x3F04, 0x3F0C, 0x3F0E,
+ 0x3F11, 0x3F13, 0x3F1D, 0x3F1F, 0x3F20, 0x3F22,
+ 0x3F24, 0x3F2C, 0x3F2E, 0x3F31, 0x3F33, 0x3F3D,
+ 0x3F3F, 0x3F40, 0x3F42, 0x3F44, 0x3F4C, 0x3F4E,
+ 0x3FC0, 0x3FC2, 0x3FC4, 0x3FCC, 0x3FCE, 0x3FD1,
+ 0x3FD3, 0x3FDD, 0x3FDF, 0x3FE0, 0x3FE2, 0x3FE4,
+ 0x3FEC, 0x3FEE, 0x3FF1, 0x3FF3, 0x3FFD, 0x3FFF,
+ 0x4000, 0x4002, 0x4004, 0x400C, 0x400E, 0x4011,
+ 0x4013, 0x401D, 0x401F, 0x4020, 0x4022, 0x4024,
+ 0x402C, 0x402E, 0x4031, 0x4033, 0x403D, 0x403F,
+ 0x4040, 0x4042, 0x4044, 0x404C, 0x404E, 0x40C0,
+ 0x40C2, 0x40C4, 0x40CC, 0x40CE, 0x40D1, 0x40D3,
+ 0x40DD, 0x40DF, 0x40E0, 0x40E2, 0x40E4, 0x40EC,
+ 0x40EE, 0x40F1, 0x40F3, 0x40FD, 0x40FF, 0x4101,
+ 0x4103, 0x410D, 0x410F, 0x4110, 0x4112, 0x4114,
+ 0x411C, 0x411E, 0x4121, 0x4123, 0x412D, 0x412F,
+ 0x4130, 0x4132, 0x4134, 0x413C, 0x413E, 0x4141,
+ 0x4143, 0x414D, 0x414F, 0x41C1, 0x41C3, 0x41CD,
+ 0x41CF, 0x41D0, 0x41D2, 0x41D4, 0x41DC, 0x41DE,
+ 0x41E1, 0x41E3, 0x41ED, 0x41EF, 0x41F0, 0x41F2,
+ 0x41F4, 0x41FC, 0x41FE, 0x4200, 0x4202, 0x4204,
+ 0x420C, 0x420E, 0x4211, 0x4213, 0x421D, 0x421F,
+ 0x4220, 0x4222, 0x4224, 0x422C, 0x422E, 0x4231,
+ 0x4233, 0x423D, 0x423F, 0x4240, 0x4242, 0x4244,
+ 0x424C, 0x424E, 0x42C0, 0x42C2, 0x42C4, 0x42CC,
+ 0x42CE, 0x42D1, 0x42D3, 0x42DD, 0x42DF, 0x42E0,
+ 0x42E2, 0x42E4, 0x42EC, 0x42EE, 0x42F1, 0x42F3,
+ 0x42FD, 0x42FF, 0x4301, 0x4303, 0x430D, 0x430F,
+ 0x4310, 0x4312, 0x4314, 0x431C, 0x431E, 0x4321,
+ 0x4323, 0x432D, 0x432F, 0x4330, 0x4332, 0x4334,
+ 0x433C, 0x433E, 0x4341, 0x4343, 0x434D, 0x434F,
+ 0x43C1, 0x43C3, 0x43CD, 0x43CF, 0x43D0, 0x43D2,
+ 0x43D4, 0x43DC, 0x43DE, 0x43E1, 0x43E3, 0x43ED,
+ 0x43EF, 0x43F0, 0x43F2, 0x43F4, 0x43FC, 0x43FE,
+ 0x4400, 0x4402, 0x4404, 0x440C, 0x440E, 0x4411,
+ 0x4413, 0x441D, 0x441F, 0x4420, 0x4422, 0x4424,
+ 0x442C, 0x442E, 0x4431, 0x4433, 0x443D, 0x443F,
+ 0x4440, 0x4442, 0x4444, 0x444C, 0x444E, 0x44C0,
+ 0x44C2, 0x44C4, 0x44CC, 0x44CE, 0x44D1, 0x44D3,
+ 0x44DD, 0x44DF, 0x44E0, 0x44E2, 0x44E4, 0x44EC,
+ 0x44EE, 0x44F1, 0x44F3, 0x44FD, 0x44FF, 0x4C00,
+ 0x4C02, 0x4C04, 0x4C0C, 0x4C0E, 0x4C11, 0x4C13,
+ 0x4C1D, 0x4C1F, 0x4C20, 0x4C22, 0x4C24, 0x4C2C,
+ 0x4C2E, 0x4C31, 0x4C33, 0x4C3D, 0x4C3F, 0x4C40,
+ 0x4C42, 0x4C44, 0x4C4C, 0x4C4E, 0x4CC0, 0x4CC2,
+ 0x4CC4, 0x4CCC, 0x4CCE, 0x4CD1, 0x4CD3, 0x4CDD,
+ 0x4CDF, 0x4CE0, 0x4CE2, 0x4CE4, 0x4CEC, 0x4CEE,
+ 0x4CF1, 0x4CF3, 0x4CFD, 0x4CFF, 0x4D01, 0x4D03,
+ 0x4D0D, 0x4D0F, 0x4D10, 0x4D12, 0x4D14, 0x4D1C,
+ 0x4D1E, 0x4D21, 0x4D23, 0x4D2D, 0x4D2F, 0x4D30,
+ 0x4D32, 0x4D34, 0x4D3C, 0x4D3E, 0x4D41, 0x4D43,
+ 0x4D4D, 0x4D4F, 0x4DC1, 0x4DC3, 0x4DCD, 0x4DCF,
+ 0x4DD0, 0x4DD2, 0x4DD4, 0x4DDC, 0x4DDE, 0x4DE1,
+ 0x4DE3, 0x4DED, 0x4DEF, 0x4DF0, 0x4DF2, 0x4DF4,
+ 0x4DFC, 0x4DFE, 0x4E00, 0x4E02, 0x4E04, 0x4E0C,
+ 0x4E0E, 0x4E11, 0x4E13, 0x4E1D, 0x4E1F, 0x4E20,
+ 0x4E22, 0x4E24, 0x4E2C, 0x4E2E, 0x4E31, 0x4E33,
+ 0x4E3D, 0x4E3F, 0x4E40, 0x4E42, 0x4E44, 0x4E4C,
+ 0x4E4E, 0x4EC0, 0x4EC2, 0x4EC4, 0x4ECC, 0x4ECE,
+ 0x4ED1, 0x4ED3, 0x4EDD, 0x4EDF, 0x4EE0, 0x4EE2,
+ 0x4EE4, 0x4EEC, 0x4EEE, 0x4EF1, 0x4EF3, 0x4EFD,
+ 0x4EFF, 0x4F01, 0x4F03, 0x4F0D, 0x4F0F, 0x4F10,
+ 0x4F12, 0x4F14, 0x4F1C, 0x4F1E, 0x4F21, 0x4F23,
+ 0x4F2D, 0x4F2F, 0x4F30, 0x4F32, 0x4F34, 0x4F3C,
+ 0x4F3E, 0x4F41, 0x4F43, 0x4F4D, 0x4F4F, 0x4FC1,
+ 0x4FC3, 0x4FCD, 0x4FCF, 0x4FD0, 0x4FD2, 0x4FD4,
+ 0x4FDC, 0x4FDE, 0x4FE1, 0x4FE3, 0x4FED, 0x4FEF,
+ 0x4FF0, 0x4FF2, 0x4FF4, 0x4FFC, 0x4FFE, 0xC000,
+ 0xC002, 0xC004, 0xC00C, 0xC00E, 0xC011, 0xC013,
+ 0xC01D, 0xC01F, 0xC020, 0xC022, 0xC024, 0xC02C,
+ 0xC02E, 0xC031, 0xC033, 0xC03D, 0xC03F, 0xC040,
+ 0xC042, 0xC044, 0xC04C, 0xC04E, 0xC0C0, 0xC0C2,
+ 0xC0C4, 0xC0CC, 0xC0CE, 0xC0D1, 0xC0D3, 0xC0DD,
+ 0xC0DF, 0xC0E0, 0xC0E2, 0xC0E4, 0xC0EC, 0xC0EE,
+ 0xC0F1, 0xC0F3, 0xC0FD, 0xC0FF, 0xC101, 0xC103,
+ 0xC10D, 0xC10F, 0xC110, 0xC112, 0xC114, 0xC11C,
+ 0xC11E, 0xC121, 0xC123, 0xC12D, 0xC12F, 0xC130,
+ 0xC132, 0xC134, 0xC13C, 0xC13E, 0xC141, 0xC143,
+ 0xC14D, 0xC14F, 0xC1C1, 0xC1C3, 0xC1CD, 0xC1CF,
+ 0xC1D0, 0xC1D2, 0xC1D4, 0xC1DC, 0xC1DE, 0xC1E1,
+ 0xC1E3, 0xC1ED, 0xC1EF, 0xC1F0, 0xC1F2, 0xC1F4,
+ 0xC1FC, 0xC1FE, 0xC200, 0xC202, 0xC204, 0xC20C,
+ 0xC20E, 0xC211, 0xC213, 0xC21D, 0xC21F, 0xC220,
+ 0xC222, 0xC224, 0xC22C, 0xC22E, 0xC231, 0xC233,
+ 0xC23D, 0xC23F, 0xC240, 0xC242, 0xC244, 0xC24C,
+ 0xC24E, 0xC2C0, 0xC2C2, 0xC2C4, 0xC2CC, 0xC2CE,
+ 0xC2D1, 0xC2D3, 0xC2DD, 0xC2DF, 0xC2E0, 0xC2E2,
+ 0xC2E4, 0xC2EC, 0xC2EE, 0xC2F1, 0xC2F3, 0xC2FD,
+ 0xC2FF, 0xC301, 0xC303, 0xC30D, 0xC30F, 0xC310,
+ 0xC312, 0xC314, 0xC31C, 0xC31E, 0xC321, 0xC323,
+ 0xC32D, 0xC32F, 0xC330, 0xC332, 0xC334, 0xC33C,
+ 0xC33E, 0xC341, 0xC343, 0xC34D, 0xC34F, 0xC3C1,
+ 0xC3C3, 0xC3CD, 0xC3CF, 0xC3D0, 0xC3D2, 0xC3D4,
+ 0xC3DC, 0xC3DE, 0xC3E1, 0xC3E3, 0xC3ED, 0xC3EF,
+ 0xC3F0, 0xC3F2, 0xC3F4, 0xC3FC, 0xC3FE, 0xC400,
+ 0xC402, 0xC404, 0xC40C, 0xC40E, 0xC411, 0xC413,
+ 0xC41D, 0xC41F, 0xC420, 0xC422, 0xC424, 0xC42C,
+ 0xC42E, 0xC431, 0xC433, 0xC43D, 0xC43F, 0xC440,
+ 0xC442, 0xC444, 0xC44C, 0xC44E, 0xC4C0, 0xC4C2,
+ 0xC4C4, 0xC4CC, 0xC4CE, 0xC4D1, 0xC4D3, 0xC4DD,
+ 0xC4DF, 0xC4E0, 0xC4E2, 0xC4E4, 0xC4EC, 0xC4EE,
+ 0xC4F1, 0xC4F3, 0xC4FD, 0xC4FF, 0xCC00, 0xCC02,
+ 0xCC04, 0xCC0C, 0xCC0E, 0xCC11, 0xCC13, 0xCC1D,
+ 0xCC1F, 0xCC20, 0xCC22, 0xCC24, 0xCC2C, 0xCC2E,
+ 0xCC31, 0xCC33, 0xCC3D, 0xCC3F, 0xCC40, 0xCC42,
+ 0xCC44, 0xCC4C, 0xCC4E, 0xCCC0, 0xCCC2, 0xCCC4,
+ 0xCCCC, 0xCCCE, 0xCCD1, 0xCCD3, 0xCCDD, 0xCCDF,
+ 0xCCE0, 0xCCE2, 0xCCE4, 0xCCEC, 0xCCEE, 0xCCF1,
+ 0xCCF3, 0xCCFD, 0xCCFF, 0xCD01, 0xCD03, 0xCD0D,
+ 0xCD0F, 0xCD10, 0xCD12, 0xCD14, 0xCD1C, 0xCD1E,
+ 0xCD21, 0xCD23, 0xCD2D, 0xCD2F, 0xCD30, 0xCD32,
+ 0xCD34, 0xCD3C, 0xCD3E, 0xCD41, 0xCD43, 0xCD4D,
+ 0xCD4F, 0xCDC1, 0xCDC3, 0xCDCD, 0xCDCF, 0xCDD0,
+ 0xCDD2, 0xCDD4, 0xCDDC, 0xCDDE, 0xCDE1, 0xCDE3,
+ 0xCDED, 0xCDEF, 0xCDF0, 0xCDF2, 0xCDF4, 0xCDFC,
+ 0xCDFE, 0xCE00, 0xCE02, 0xCE04, 0xCE0C, 0xCE0E,
+ 0xCE11, 0xCE13, 0xCE1D, 0xCE1F, 0xCE20, 0xCE22,
+ 0xCE24, 0xCE2C, 0xCE2E, 0xCE31, 0xCE33, 0xCE3D,
+ 0xCE3F, 0xCE40, 0xCE42, 0xCE44, 0xCE4C, 0xCE4E,
+ 0xCEC0, 0xCEC2, 0xCEC4, 0xCECC, 0xCECE, 0xCED1,
+ 0xCED3, 0xCEDD, 0xCEDF, 0xCEE0, 0xCEE2, 0xCEE4,
+ 0xCEEC, 0xCEEE, 0xCEF1, 0xCEF3, 0xCEFD, 0xCEFF,
+ 0xCF01, 0xCF03, 0xCF0D, 0xCF0F, 0xCF10, 0xCF12,
+ 0xCF14, 0xCF1C, 0xCF1E, 0xCF21, 0xCF23, 0xCF2D,
+ 0xCF2F, 0xCF30, 0xCF32, 0xCF34, 0xCF3C, 0xCF3E,
+ 0xCF41, 0xCF43, 0xCF4D, 0xCF4F, 0xCFC1, 0xCFC3,
+ 0xCFCD, 0xCFCF, 0xCFD0, 0xCFD2, 0xCFD4, 0xCFDC,
+ 0xCFDE, 0xCFE1, 0xCFE3, 0xCFED, 0xCFEF, 0xCFF0,
+ 0xCFF2, 0xCFF4, 0xCFFC, 0xCFFE, 0xD001, 0xD003,
+ 0xD00D, 0xD00F, 0xD010, 0xD012, 0xD014, 0xD01C,
+ 0xD01E, 0xD021, 0xD023, 0xD02D, 0xD02F, 0xD030,
+ 0xD032, 0xD034, 0xD03C, 0xD03E, 0xD041, 0xD043,
+ 0xD04D, 0xD04F, 0xD0C1, 0xD0C3, 0xD0CD, 0xD0CF,
+ 0xD0D0, 0xD0D2, 0xD0D4, 0xD0DC, 0xD0DE, 0xD0E1,
+ 0xD0E3, 0xD0ED, 0xD0EF, 0xD0F0, 0xD0F2, 0xD0F4,
+ 0xD0FC, 0xD0FE, 0xD100, 0xD102, 0xD104, 0xD10C,
+ 0xD10E, 0xD111, 0xD113, 0xD11D, 0xD11F, 0xD120,
+ 0xD122, 0xD124, 0xD12C, 0xD12E, 0xD131, 0xD133,
+ 0xD13D, 0xD13F, 0xD140, 0xD142, 0xD144, 0xD14C,
+ 0xD14E, 0xD1C0, 0xD1C2, 0xD1C4, 0xD1CC, 0xD1CE,
+ 0xD1D1, 0xD1D3, 0xD1DD, 0xD1DF, 0xD1E0, 0xD1E2,
+ 0xD1E4, 0xD1EC, 0xD1EE, 0xD1F1, 0xD1F3, 0xD1FD,
+ 0xD1FF, 0xD201, 0xD203, 0xD20D, 0xD20F, 0xD210,
+ 0xD212, 0xD214, 0xD21C, 0xD21E, 0xD221, 0xD223,
+ 0xD22D, 0xD22F, 0xD230, 0xD232, 0xD234, 0xD23C,
+ 0xD23E, 0xD241, 0xD243, 0xD24D, 0xD24F, 0xD2C1,
+ 0xD2C3, 0xD2CD, 0xD2CF, 0xD2D0, 0xD2D2, 0xD2D4,
+ 0xD2DC, 0xD2DE, 0xD2E1, 0xD2E3, 0xD2ED, 0xD2EF,
+ 0xD2F0, 0xD2F2, 0xD2F4, 0xD2FC, 0xD2FE, 0xD300,
+ 0xD302, 0xD304, 0xD30C, 0xD30E, 0xD311, 0xD313,
+ 0xD31D, 0xD31F, 0xD320, 0xD322, 0xD324, 0xD32C,
+ 0xD32E, 0xD331, 0xD333, 0xD33D, 0xD33F, 0xD340,
+ 0xD342, 0xD344, 0xD34C, 0xD34E, 0xD3C0, 0xD3C2,
+ 0xD3C4, 0xD3CC, 0xD3CE, 0xD3D1, 0xD3D3, 0xD3DD,
+ 0xD3DF, 0xD3E0, 0xD3E2, 0xD3E4, 0xD3EC, 0xD3EE,
+ 0xD3F1, 0xD3F3, 0xD3FD, 0xD3FF, 0xD401, 0xD403,
+ 0xD40D, 0xD40F, 0xD410, 0xD412, 0xD414, 0xD41C,
+ 0xD41E, 0xD421, 0xD423, 0xD42D, 0xD42F, 0xD430,
+ 0xD432, 0xD434, 0xD43C, 0xD43E, 0xD441, 0xD443,
+ 0xD44D, 0xD44F, 0xD4C1, 0xD4C3, 0xD4CD, 0xD4CF,
+ 0xD4D0, 0xD4D2, 0xD4D4, 0xD4DC, 0xD4DE, 0xD4E1,
+ 0xD4E3, 0xD4ED, 0xD4EF, 0xD4F0, 0xD4F2, 0xD4F4,
+ 0xD4FC, 0xD4FE, 0xDC01, 0xDC03, 0xDC0D, 0xDC0F,
+ 0xDC10, 0xDC12, 0xDC14, 0xDC1C, 0xDC1E, 0xDC21,
+ 0xDC23, 0xDC2D, 0xDC2F, 0xDC30, 0xDC32, 0xDC34,
+ 0xDC3C, 0xDC3E, 0xDC41, 0xDC43, 0xDC4D, 0xDC4F,
+ 0xDCC1, 0xDCC3, 0xDCCD, 0xDCCF, 0xDCD0, 0xDCD2,
+ 0xDCD4, 0xDCDC, 0xDCDE, 0xDCE1, 0xDCE3, 0xDCED,
+ 0xDCEF, 0xDCF0, 0xDCF2, 0xDCF4, 0xDCFC, 0xDCFE,
+ 0xDD00, 0xDD02, 0xDD04, 0xDD0C, 0xDD0E, 0xDD11,
+ 0xDD13, 0xDD1D, 0xDD1F, 0xDD20, 0xDD22, 0xDD24,
+ 0xDD2C, 0xDD2E, 0xDD31, 0xDD33, 0xDD3D, 0xDD3F,
+ 0xDD40, 0xDD42, 0xDD44, 0xDD4C, 0xDD4E, 0xDDC0,
+ 0xDDC2, 0xDDC4, 0xDDCC, 0xDDCE, 0xDDD1, 0xDDD3,
+ 0xDDDD, 0xDDDF, 0xDDE0, 0xDDE2, 0xDDE4, 0xDDEC,
+ 0xDDEE, 0xDDF1, 0xDDF3, 0xDDFD, 0xDDFF, 0xDE01,
+ 0xDE03, 0xDE0D, 0xDE0F, 0xDE10, 0xDE12, 0xDE14,
+ 0xDE1C, 0xDE1E, 0xDE21, 0xDE23, 0xDE2D, 0xDE2F,
+ 0xDE30, 0xDE32, 0xDE34, 0xDE3C, 0xDE3E, 0xDE41,
+ 0xDE43, 0xDE4D, 0xDE4F, 0xDEC1, 0xDEC3, 0xDECD,
+ 0xDECF, 0xDED0, 0xDED2, 0xDED4, 0xDEDC, 0xDEDE,
+ 0xDEE1, 0xDEE3, 0xDEED, 0xDEEF, 0xDEF0, 0xDEF2,
+ 0xDEF4, 0xDEFC, 0xDEFE, 0xDF00, 0xDF02, 0xDF04,
+ 0xDF0C, 0xDF0E, 0xDF11, 0xDF13, 0xDF1D, 0xDF1F,
+ 0xDF20, 0xDF22, 0xDF24, 0xDF2C, 0xDF2E, 0xDF31,
+ 0xDF33, 0xDF3D, 0xDF3F, 0xDF40, 0xDF42, 0xDF44,
+ 0xDF4C, 0xDF4E, 0xDFC0, 0xDFC2, 0xDFC4, 0xDFCC,
+ 0xDFCE, 0xDFD1, 0xDFD3, 0xDFDD, 0xDFDF, 0xDFE0,
+ 0xDFE2, 0xDFE4, 0xDFEC, 0xDFEE, 0xDFF1, 0xDFF3,
+ 0xDFFD, 0xDFFF, 0xE000, 0xE002, 0xE004, 0xE00C,
+ 0xE00E, 0xE011, 0xE013, 0xE01D, 0xE01F, 0xE020,
+ 0xE022, 0xE024, 0xE02C, 0xE02E, 0xE031, 0xE033,
+ 0xE03D, 0xE03F, 0xE040, 0xE042, 0xE044, 0xE04C,
+ 0xE04E, 0xE0C0, 0xE0C2, 0xE0C4, 0xE0CC, 0xE0CE,
+ 0xE0D1, 0xE0D3, 0xE0DD, 0xE0DF, 0xE0E0, 0xE0E2,
+ 0xE0E4, 0xE0EC, 0xE0EE, 0xE0F1, 0xE0F3, 0xE0FD,
+ 0xE0FF, 0xE101, 0xE103, 0xE10D, 0xE10F, 0xE110,
+ 0xE112, 0xE114, 0xE11C, 0xE11E, 0xE121, 0xE123,
+ 0xE12D, 0xE12F, 0xE130, 0xE132, 0xE134, 0xE13C,
+ 0xE13E, 0xE141, 0xE143, 0xE14D, 0xE14F, 0xE1C1,
+ 0xE1C3, 0xE1CD, 0xE1CF, 0xE1D0, 0xE1D2, 0xE1D4,
+ 0xE1DC, 0xE1DE, 0xE1E1, 0xE1E3, 0xE1ED, 0xE1EF,
+ 0xE1F0, 0xE1F2, 0xE1F4, 0xE1FC, 0xE1FE, 0xE200,
+ 0xE202, 0xE204, 0xE20C, 0xE20E, 0xE211, 0xE213,
+ 0xE21D, 0xE21F, 0xE220, 0xE222, 0xE224, 0xE22C,
+ 0xE22E, 0xE231, 0xE233, 0xE23D, 0xE23F, 0xE240,
+ 0xE242, 0xE244, 0xE24C, 0xE24E, 0xE2C0, 0xE2C2,
+ 0xE2C4, 0xE2CC, 0xE2CE, 0xE2D1, 0xE2D3, 0xE2DD,
+ 0xE2DF, 0xE2E0, 0xE2E2, 0xE2E4, 0xE2EC, 0xE2EE,
+ 0xE2F1, 0xE2F3, 0xE2FD, 0xE2FF, 0xE301, 0xE303,
+ 0xE30D, 0xE30F, 0xE310, 0xE312, 0xE314, 0xE31C,
+ 0xE31E, 0xE321, 0xE323, 0xE32D, 0xE32F, 0xE330,
+ 0xE332, 0xE334, 0xE33C, 0xE33E, 0xE341, 0xE343,
+ 0xE34D, 0xE34F, 0xE3C1, 0xE3C3, 0xE3CD, 0xE3CF,
+ 0xE3D0, 0xE3D2, 0xE3D4, 0xE3DC, 0xE3DE, 0xE3E1,
+ 0xE3E3, 0xE3ED, 0xE3EF, 0xE3F0, 0xE3F2, 0xE3F4,
+ 0xE3FC, 0xE3FE, 0xE400, 0xE402, 0xE404, 0xE40C,
+ 0xE40E, 0xE411, 0xE413, 0xE41D, 0xE41F, 0xE420,
+ 0xE422, 0xE424, 0xE42C, 0xE42E, 0xE431, 0xE433,
+ 0xE43D, 0xE43F, 0xE440, 0xE442, 0xE444, 0xE44C,
+ 0xE44E, 0xE4C0, 0xE4C2, 0xE4C4, 0xE4CC, 0xE4CE,
+ 0xE4D1, 0xE4D3, 0xE4DD, 0xE4DF, 0xE4E0, 0xE4E2,
+ 0xE4E4, 0xE4EC, 0xE4EE, 0xE4F1, 0xE4F3, 0xE4FD,
+ 0xE4FF, 0xEC00, 0xEC02, 0xEC04, 0xEC0C, 0xEC0E,
+ 0xEC11, 0xEC13, 0xEC1D, 0xEC1F, 0xEC20, 0xEC22,
+ 0xEC24, 0xEC2C, 0xEC2E, 0xEC31, 0xEC33, 0xEC3D,
+ 0xEC3F, 0xEC40, 0xEC42, 0xEC44, 0xEC4C, 0xEC4E,
+ 0xECC0, 0xECC2, 0xECC4, 0xECCC, 0xECCE, 0xECD1,
+ 0xECD3, 0xECDD, 0xECDF, 0xECE0, 0xECE2, 0xECE4,
+ 0xECEC, 0xECEE, 0xECF1, 0xECF3, 0xECFD, 0xECFF,
+ 0xED01, 0xED03, 0xED0D, 0xED0F, 0xED10, 0xED12,
+ 0xED14, 0xED1C, 0xED1E, 0xED21, 0xED23, 0xED2D,
+ 0xED2F, 0xED30, 0xED32, 0xED34, 0xED3C, 0xED3E,
+ 0xED41, 0xED43, 0xED4D, 0xED4F, 0xEDC1, 0xEDC3,
+ 0xEDCD, 0xEDCF, 0xEDD0, 0xEDD2, 0xEDD4, 0xEDDC,
+ 0xEDDE, 0xEDE1, 0xEDE3, 0xEDED, 0xEDEF, 0xEDF0,
+ 0xEDF2, 0xEDF4, 0xEDFC, 0xEDFE, 0xEE00, 0xEE02,
+ 0xEE04, 0xEE0C, 0xEE0E, 0xEE11, 0xEE13, 0xEE1D,
+ 0xEE1F, 0xEE20, 0xEE22, 0xEE24, 0xEE2C, 0xEE2E,
+ 0xEE31, 0xEE33, 0xEE3D, 0xEE3F, 0xEE40, 0xEE42,
+ 0xEE44, 0xEE4C, 0xEE4E, 0xEEC0, 0xEEC2, 0xEEC4,
+ 0xEECC, 0xEECE, 0xEED1, 0xEED3, 0xEEDD, 0xEEDF,
+ 0xEEE0, 0xEEE2, 0xEEE4, 0xEEEC, 0xEEEE, 0xEEF1,
+ 0xEEF3, 0xEEFD, 0xEEFF, 0xEF01, 0xEF03, 0xEF0D,
+ 0xEF0F, 0xEF10, 0xEF12, 0xEF14, 0xEF1C, 0xEF1E,
+ 0xEF21, 0xEF23, 0xEF2D, 0xEF2F, 0xEF30, 0xEF32,
+ 0xEF34, 0xEF3C, 0xEF3E, 0xEF41, 0xEF43, 0xEF4D,
+ 0xEF4F, 0xEFC1, 0xEFC3, 0xEFCD, 0xEFCF, 0xEFD0,
+ 0xEFD2, 0xEFD4, 0xEFDC, 0xEFDE, 0xEFE1, 0xEFE3,
+ 0xEFED, 0xEFEF, 0xEFF0, 0xEFF2, 0xEFF4, 0xEFFC,
+ 0xEFFE, 0xF001, 0xF003, 0xF00D, 0xF00F, 0xF010,
+ 0xF012, 0xF014, 0xF01C, 0xF01E, 0xF021, 0xF023,
+ 0xF02D, 0xF02F, 0xF030, 0xF032, 0xF034, 0xF03C,
+ 0xF03E, 0xF041, 0xF043, 0xF04D, 0xF04F, 0xF0C1,
+ 0xF0C3, 0xF0CD, 0xF0CF, 0xF0D0, 0xF0D2, 0xF0D4,
+ 0xF0DC, 0xF0DE, 0xF0E1, 0xF0E3, 0xF0ED, 0xF0EF,
+ 0xF0F0, 0xF0F2, 0xF0F4, 0xF0FC, 0xF0FE, 0xF100,
+ 0xF102, 0xF104, 0xF10C, 0xF10E, 0xF111, 0xF113,
+ 0xF11D, 0xF11F, 0xF120, 0xF122, 0xF124, 0xF12C,
+ 0xF12E, 0xF131, 0xF133, 0xF13D, 0xF13F, 0xF140,
+ 0xF142, 0xF144, 0xF14C, 0xF14E, 0xF1C0, 0xF1C2,
+ 0xF1C4, 0xF1CC, 0xF1CE, 0xF1D1, 0xF1D3, 0xF1DD,
+ 0xF1DF, 0xF1E0, 0xF1E2, 0xF1E4, 0xF1EC, 0xF1EE,
+ 0xF1F1, 0xF1F3, 0xF1FD, 0xF1FF, 0xF201, 0xF203,
+ 0xF20D, 0xF20F, 0xF210, 0xF212, 0xF214, 0xF21C,
+ 0xF21E, 0xF221, 0xF223, 0xF22D, 0xF22F, 0xF230,
+ 0xF232, 0xF234, 0xF23C, 0xF23E, 0xF241, 0xF243,
+ 0xF24D, 0xF24F, 0xF2C1, 0xF2C3, 0xF2CD, 0xF2CF,
+ 0xF2D0, 0xF2D2, 0xF2D4, 0xF2DC, 0xF2DE, 0xF2E1,
+ 0xF2E3, 0xF2ED, 0xF2EF, 0xF2F0, 0xF2F2, 0xF2F4,
+ 0xF2FC, 0xF2FE, 0xF300, 0xF302, 0xF304, 0xF30C,
+ 0xF30E, 0xF311, 0xF313, 0xF31D, 0xF31F, 0xF320,
+ 0xF322, 0xF324, 0xF32C, 0xF32E, 0xF331, 0xF333,
+ 0xF33D, 0xF33F, 0xF340, 0xF342, 0xF344, 0xF34C,
+ 0xF34E, 0xF3C0, 0xF3C2, 0xF3C4, 0xF3CC, 0xF3CE,
+ 0xF3D1, 0xF3D3, 0xF3DD, 0xF3DF, 0xF3E0, 0xF3E2,
+ 0xF3E4, 0xF3EC, 0xF3EE, 0xF3F1, 0xF3F3, 0xF3FD,
+ 0xF3FF, 0xF401, 0xF403, 0xF40D, 0xF40F, 0xF410,
+ 0xF412, 0xF414, 0xF41C, 0xF41E, 0xF421, 0xF423,
+ 0xF42D, 0xF42F, 0xF430, 0xF432, 0xF434, 0xF43C,
+ 0xF43E, 0xF441, 0xF443, 0xF44D, 0xF44F, 0xF4C1,
+ 0xF4C3, 0xF4CD, 0xF4CF, 0xF4D0, 0xF4D2, 0xF4D4,
+ 0xF4DC, 0xF4DE, 0xF4E1, 0xF4E3, 0xF4ED, 0xF4EF,
+ 0xF4F0, 0xF4F2, 0xF4F4, 0xF4FC, 0xF4FE, 0xFC01,
+ 0xFC03, 0xFC0D, 0xFC0F, 0xFC10, 0xFC12, 0xFC14,
+ 0xFC1C, 0xFC1E, 0xFC21, 0xFC23, 0xFC2D, 0xFC2F,
+ 0xFC30, 0xFC32, 0xFC34, 0xFC3C, 0xFC3E, 0xFC41,
+ 0xFC43, 0xFC4D, 0xFC4F, 0xFCC1, 0xFCC3, 0xFCCD,
+ 0xFCCF, 0xFCD0, 0xFCD2, 0xFCD4, 0xFCDC, 0xFCDE,
+ 0xFCE1, 0xFCE3, 0xFCED, 0xFCEF, 0xFCF0, 0xFCF2,
+ 0xFCF4, 0xFCFC, 0xFCFE, 0xFD00, 0xFD02, 0xFD04,
+ 0xFD0C, 0xFD0E, 0xFD11, 0xFD13, 0xFD1D, 0xFD1F,
+ 0xFD20, 0xFD22, 0xFD24, 0xFD2C, 0xFD2E, 0xFD31,
+ 0xFD33, 0xFD3D, 0xFD3F, 0xFD40, 0xFD42, 0xFD44,
+ 0xFD4C, 0xFD4E, 0xFDC0, 0xFDC2, 0xFDC4, 0xFDCC,
+ 0xFDCE, 0xFDD1, 0xFDD3, 0xFDDD, 0xFDDF, 0xFDE0,
+ 0xFDE2, 0xFDE4, 0xFDEC, 0xFDEE, 0xFDF1, 0xFDF3,
+ 0xFDFD, 0xFDFF, 0xFE01, 0xFE03, 0xFE0D, 0xFE0F,
+ 0xFE10, 0xFE12, 0xFE14, 0xFE1C, 0xFE1E, 0xFE21,
+ 0xFE23, 0xFE2D, 0xFE2F, 0xFE30, 0xFE32, 0xFE34,
+ 0xFE3C, 0xFE3E, 0xFE41, 0xFE43, 0xFE4D, 0xFE4F,
+ 0xFEC1, 0xFEC3, 0xFECD, 0xFECF, 0xFED0, 0xFED2,
+ 0xFED4, 0xFEDC, 0xFEDE, 0xFEE1, 0xFEE3, 0xFEED,
+ 0xFEEF, 0xFEF0, 0xFEF2, 0xFEF4, 0xFEFC, 0xFEFE,
+ 0xFF00, 0xFF02, 0xFF04, 0xFF0C, 0xFF0E, 0xFF11,
+ 0xFF13, 0xFF1D, 0xFF1F, 0xFF20, 0xFF22, 0xFF24,
+ 0xFF2C, 0xFF2E, 0xFF31, 0xFF33, 0xFF3D, 0xFF3F,
+ 0xFF40, 0xFF42, 0xFF44, 0xFF4C, 0xFF4E, 0xFFC0,
+ 0xFFC2, 0xFFC4, 0xFFCC, 0xFFCE, 0xFFD1, 0xFFD3,
+ 0xFFDD, 0xFFDF, 0xFFE0, 0xFFE2, 0xFFE4, 0xFFEC,
+ 0xFFEE, 0xFFF1, 0xFFF3, 0xFFFD, 0xFFFF,
+};
+
+#define ON2AVC_CB8_CODES 3281
+static const uint32_t on2avc_cb8_codes[ON2AVC_CB8_CODES] = {
+ 0x028C, 0x05E6, 0xFAD9, 0x7DEF, 0x06CE, 0x004C,
+ 0x0178, 0x0A1D, 0x00AE, 0x046E, 0x03D5, 0x3F58,
+ 0x0EAA, 0x0233, 0x1A6A, 0x271F, 0x05CE, 0x0179,
+ 0x02FB, 0x0029, 0x237D, 0x7DF0, 0x03BA, 0xFAD6,
+ 0xFAD7, 0x7DEE, 0xFAD5, 0x0081, 0x033C, 0x1A69,
+ 0xFAD8, 0x05A1, 0x01F1, 0x063D, 0x237C, 0x003E,
+ 0x0323, 0x010C, 0x05A3, 0x05A2, 0x0051, 0x019D,
+ 0xFADB, 0x0EAB, 0x00AA, 0x003E, 0x01A6, 0x7DF2,
+ 0x0058, 0x01F1, 0x029B, 0x03C0, 0x122D, 0x0075,
+ 0x3F5A, 0x0B98, 0x0005, 0x058B, 0x0D68, 0x013F,
+ 0x00D0, 0x05CF, 0x01C0, 0x03BB, 0x046F, 0xFADA,
+ 0x01A0, 0x0972, 0x122C, 0x3F59, 0x0766, 0x05A4,
+ 0x00ED, 0x05A5, 0x0D67, 0x03D0, 0x0046, 0x01FF,
+ 0x7DF1, 0x00D6, 0x017C, 0x0034, 0x08B5, 0x0234,
+ 0x237E, 0x0033, 0x0083, 0x0B99, 0x0EAC, 0x0202,
+ 0x0714, 0x0715, 0x01C3, 0x05A6, 0x0324, 0x13EC,
+ 0x02F8, 0x7DF3, 0x13EB, 0x0140, 0x0470, 0x04F8,
+ 0x0007, 0x0377, 0x0208, 0x04A3, 0x13EA, 0x0006,
+ 0x0188, 0x033D, 0x122E, 0x1A6B, 0x0A1E, 0x0126,
+ 0x03C1, 0x05E7, 0x05D0, 0x04F7, 0x03DB, 0x033E,
+ 0x122F, 0x0082, 0x1A6F, 0x2380, 0x05D2, 0x0009,
+ 0x05A9, 0x1A70, 0x1233, 0x05A7, 0x05A8, 0x0975,
+ 0x2381, 0x1234, 0x0788, 0x2720, 0x1235, 0x05D3,
+ 0xFADD, 0x3F5B, 0x0789, 0x0D69, 0xFADE, 0xFADF,
+ 0x01C4, 0x0EAD, 0x0EA1, 0x1230, 0x0008, 0x13ED,
+ 0x1A6C, 0xFADC, 0x1231, 0x0973, 0x1232, 0x1A6D,
+ 0x13EE, 0x1A6E, 0x0974, 0x237F, 0x05D1, 0x033F,
+ 0x0267, 0x078A, 0xFAE3, 0xFAE2, 0x0B9A, 0x00FC,
+ 0x0EAE, 0x05D6, 0x0325, 0x0326, 0x0B9B, 0x3F5F,
+ 0x3F5E, 0x0471, 0x02F9, 0xFAE4, 0x1A72, 0x03C2,
+ 0x05D7, 0x2721, 0x3F60, 0xFAE5, 0x2382, 0xFAE0,
+ 0x7DF5, 0xFAE1, 0x7DF4, 0x000A, 0x0235, 0x3F5C,
+ 0x1A71, 0x0716, 0x036C, 0x0767, 0x05D4, 0x3F5D,
+ 0x0717, 0x01BF, 0x000B, 0x05D5, 0x0243, 0xFAD0,
+ 0x04F6, 0x7DE5, 0xFACF, 0x0E9E, 0x0074, 0x271A,
+ 0x1A61, 0x015B, 0x0046, 0x06CA, 0x237A, 0x7DE6,
+ 0x0070, 0x1A62, 0x1227, 0x7DE7, 0x0032, 0xFAD1,
+ 0x05CA, 0x7DE8, 0x237B, 0x13E6, 0x05C8, 0x1226,
+ 0x2377, 0x2719, 0x3F54, 0x3F55, 0x13E5, 0x2378,
+ 0x03BF, 0x05C9, 0x01C0, 0x7DE4, 0x7DE3, 0x0A19,
+ 0x0045, 0x1A60, 0x2379, 0x021B, 0x271C, 0x13E7,
+ 0x271B, 0x1A67, 0x059D, 0x0EA6, 0x0EA7, 0x0174,
+ 0x0EA5, 0x0A1A, 0x1FFD, 0x033A, 0x0E9F, 0x3F57,
+ 0x122B, 0xFAD2, 0x0D64, 0x05CC, 0x06CB, 0x1FFE,
+ 0x059E, 0x02F7, 0x1228, 0x7DE9, 0x059B, 0x096C,
+ 0x1A63, 0x1A64, 0x1A65, 0x1229, 0x0EA3, 0x059C,
+ 0x096D, 0x05CB, 0x003C, 0x1A66, 0x0D63, 0x3F56,
+ 0x122A, 0x0EA4, 0x0712, 0x0232, 0x13E8, 0x061E,
+ 0x08B4, 0x016E, 0x0176, 0x033B, 0x0028, 0x05E5,
+ 0x061F, 0x0000, 0x0376, 0x0071, 0x096F, 0x7DEB,
+ 0x0001, 0x05CD, 0xFAD3, 0x0186, 0x0EA9, 0x13E9,
+ 0x06CD, 0x7DEA, 0x0340, 0x271D, 0x0175, 0x01C1,
+ 0x0D65, 0x1FFF, 0x0B97, 0x0EA8, 0x06CC, 0x0375,
+ 0x05E4, 0x08B3, 0x05E3, 0x0341, 0x0EA0, 0x096E,
+ 0x03CF, 0x0056, 0x0970, 0x1A68, 0x029A, 0x010A,
+ 0x00A8, 0x01CA, 0x7DED, 0x00A5, 0x001E, 0x05A0,
+ 0x0D66, 0x0047, 0x0971, 0x0A1C, 0x02CE, 0xFAD4,
+ 0x0004, 0x010F, 0x271E, 0x0415, 0x0212, 0x019F,
+ 0x7DEC, 0x01C2, 0x0187, 0x059F, 0x0A1B, 0x0527,
+ 0x0002, 0x003D, 0x0041, 0x0177, 0x0713, 0x010E,
+ 0x0102, 0x02CF, 0x00CA, 0x0003, 0x01BF, 0x0120,
+ 0x05DE, 0x0043, 0x01D0, 0x018C, 0x00AB, 0x029F,
+ 0x03DF, 0x03C5, 0x0247, 0x08BB, 0x0013, 0x03D2,
+ 0x0015, 0x0EB0, 0x02FA, 0x05E8, 0x0014, 0x0EB1,
+ 0x0476, 0x1A78, 0x01F4, 0x06D1, 0x017C, 0x0042,
+ 0x063F, 0x0011, 0x0012, 0x01C7, 0x04FB, 0x1A77,
+ 0x01AA, 0x04FC, 0x0A21, 0x021D, 0x01EE, 0x02BC,
+ 0x01C2, 0x021E, 0x00AA, 0x00D6, 0x021F, 0x016F,
+ 0x0077, 0x01AB, 0x00AC, 0x0073, 0x078D, 0x00AF,
+ 0x002E, 0x0220, 0x0086, 0x0103, 0x0086, 0x0127,
+ 0x0BA0, 0x05DF, 0x0EA5, 0x03D3, 0x05E0, 0x017D,
+ 0xFAE7, 0x015A, 0x03C6, 0x0768, 0xFAE6, 0x3F65,
+ 0x01F3, 0x0B9F, 0x0016, 0x0EA4, 0x078C, 0x02BD,
+ 0x004D, 0x0116, 0x037A, 0x0076, 0x0056, 0x058E,
+ 0x06D2, 0x0014, 0x009F, 0x0A23, 0x0346, 0x014E,
+ 0x02BF, 0x00A7, 0x0528, 0x0378, 0x0106, 0x01C3,
+ 0x017E, 0x0044, 0x03C7, 0x097F, 0x04A5, 0x020B,
+ 0x05E9, 0x0A24, 0x03D9, 0x0661, 0x0660, 0x014F,
+ 0x02BE, 0x023B, 0x04FD, 0x0313, 0x0017, 0x08BC,
+ 0x0769, 0x0622, 0x0D6C, 0x03D7, 0x01C8, 0x0A22,
+ 0x01AB, 0x0203, 0x076A, 0x03D8, 0x02D1, 0x00A6,
+ 0x05E3, 0x1A79, 0x1A7A, 0x0981, 0x05B1, 0x04FF,
+ 0x0982, 0x0348, 0x0128, 0x08BD, 0x0D6D, 0x13F4,
+ 0x05B2, 0x0624, 0x05B3, 0x0EB2, 0x2729, 0x1237,
+ 0x05B4, 0x0129, 0x0349, 0x2386, 0x0019, 0x04FE,
+ 0x05B0, 0xFAE8, 0x3F66, 0x0623, 0x05E1, 0x05E2,
+ 0x3F67, 0x0980, 0x0347, 0x0BA1, 0x0046, 0x0045,
+ 0x0EA6, 0x01C9, 0x0018, 0x13F3, 0x078E, 0x0152,
+ 0x0983, 0x1238, 0x272B, 0x01F2, 0x028F, 0x05E5,
+ 0x3F69, 0x0418, 0x02FC, 0x017F, 0x0EB3, 0x00EF,
+ 0x0790, 0x0791, 0x1239, 0x05E6, 0x05E7, 0x1A7C,
+ 0x034A, 0x001A, 0x0984, 0x05B5, 0x272A, 0x1A7B,
+ 0x0EA7, 0x0529, 0x02FB, 0x2387, 0x3F68, 0x078F,
+ 0x006D, 0x0D6E, 0x05B6, 0x039F, 0x014E, 0x058F,
+ 0x13F5, 0x05E4, 0x020C, 0x0342, 0x1A73, 0x7DF7,
+ 0x2724, 0x0082, 0x0209, 0x1A74, 0x05DB, 0x03D6,
+ 0x001F, 0x0B9C, 0x04F9, 0x0096, 0x03C3, 0x0620,
+ 0x7DF9, 0x7DF8, 0x0EA2, 0x000C, 0x2725, 0x3F61,
+ 0x0977, 0x0976, 0x2723, 0x05D8, 0x2722, 0x058C,
+ 0x08B6, 0x05D9, 0x2383, 0x0236, 0x036D, 0x0A1F,
+ 0x05AA, 0x019C, 0x01C0, 0x0327, 0x05DA, 0x7DF6,
+ 0x02CF, 0x05DD, 0x0341, 0x05AE, 0x0EAF, 0x2384,
+ 0x0342, 0x13F0, 0x000D, 0x08B7, 0x000E, 0x003F,
+ 0x097B, 0x0343, 0x0D6A, 0x1A75, 0x000F, 0x3F63,
+ 0x05AF, 0x06CF, 0x06D0, 0x2385, 0x13F1, 0x058D,
+ 0x0237, 0x05AB, 0x7DFA, 0x0EA3, 0x03C4, 0x13EF,
+ 0x05DC, 0x2726, 0x1236, 0x017A, 0x0978, 0x05AD,
+ 0x05AC, 0x0340, 0x0238, 0x097A, 0x3F62, 0x0979,
+ 0x03DE, 0x0010, 0x0345, 0x002A, 0x03D1, 0x01A7,
+ 0x01F2, 0x009E, 0x020A, 0x0189, 0x0D6B, 0x03C6,
+ 0x00EE, 0x0A20, 0x017B, 0x04FA, 0x0472, 0x0040,
+ 0x00CB, 0x08B9, 0x02D0, 0x029E, 0x0020, 0x0344,
+ 0x0239, 0x02D0, 0x0B9D, 0x023A, 0x0B9E, 0x028D,
+ 0x03C5, 0x03BE, 0x08B8, 0x078B, 0x0337, 0x0246,
+ 0x004C, 0x0416, 0x0141, 0x04A4, 0x00E2, 0x0213,
+ 0x028E, 0x01A7, 0x021C, 0x00D4, 0x01C6, 0x0072,
+ 0x0067, 0x002B, 0x0473, 0x036F, 0x01E0, 0x036E,
+ 0x0041, 0x3F64, 0x097E, 0x0621, 0x02BB, 0x00D7,
+ 0x2728, 0x2727, 0x01C1, 0x0129, 0x0417, 0x13F2,
+ 0x097C, 0x0142, 0x097D, 0x1A76, 0x08BA, 0x063E,
+ 0x0100, 0x01AA, 0x018A, 0x00EA, 0x014D, 0x001E,
+ 0x01C5, 0x03C7, 0x0053, 0x05EC, 0x012D, 0x004C,
+ 0x0D71, 0x01D0, 0x0023, 0x0D72, 0x0185, 0x02D2,
+ 0x0719, 0x012F, 0x0502, 0x012E, 0x0A28, 0x098E,
+ 0x238B, 0x272D, 0x05EE, 0x05BE, 0x0130, 0xFAEE,
+ 0x272E, 0x0BA2, 0x05EB, 0x01CF, 0xFAED, 0x238A,
+ 0x01CE, 0x098C, 0x7DFD, 0x05BD, 0x004A, 0x0036,
+ 0x0037, 0x0628, 0x02FD, 0x048A, 0x017E, 0x004B,
+ 0x098D, 0x0153, 0x0216, 0x0D73, 0x1A82, 0x0042,
+ 0x017F, 0x026C, 0x020D, 0x0794, 0x0143, 0x007E,
+ 0x062A, 0x0798, 0x004F, 0x0EBA, 0x0BA4, 0x023E,
+ 0x05BF, 0x0EB9, 0x0592, 0x03CC, 0x004E, 0x018E,
+ 0x032C, 0x0629, 0x0BA3, 0x01F7, 0x0EB8, 0x004D,
+ 0x0990, 0x0350, 0x098F, 0x0343, 0x0023, 0x052B,
+ 0x004E, 0x0178, 0x04A6, 0x0291, 0x05ED, 0x00DC,
+ 0x032D, 0x0504, 0x0991, 0x0A29, 0x0593, 0x01F3,
+ 0x0A2A, 0x0505, 0x015B, 0x0666, 0x0087, 0x03DA,
+ 0x0BA5, 0x076D, 0x05C1, 0x03CD, 0x0024, 0x0992,
+ 0x04A7, 0x0131, 0x05C2, 0x272F, 0x01D1, 0x076B,
+ 0x076C, 0x1242, 0x05EF, 0x062B, 0x0EAE, 0x13FD,
+ 0x05C0, 0x0EBB, 0x023F, 0x0D74, 0x0503, 0x02FE,
+ 0x041A, 0x037B, 0x08BE, 0x0240, 0x0316, 0x0EBD,
+ 0x3F70, 0x0EBC, 0x0A2B, 0x0BA7, 0x0053, 0x05C5,
+ 0x13FE, 0x0506, 0x03CE, 0x0026, 0x0994, 0x0038,
+ 0x0027, 0x0132, 0x020E, 0x2731, 0x0EBE, 0x0796,
+ 0x018F, 0x05C6, 0x02FF, 0x0795, 0x1A83, 0x3F6E,
+ 0x0BA6, 0x0025, 0x1243, 0x3F6F, 0x004F, 0x2730,
+ 0x062C, 0x0993, 0x05C3, 0x05C4, 0x0051, 0x0052,
+ 0x0351, 0x062D, 0x0050, 0x01F6, 0x08BF, 0x3F71,
+ 0x238E, 0x05C7, 0x01F7, 0x05C8, 0x062E, 0x012A,
+ 0x032F, 0x0077, 0x1A86, 0x0EBF, 0x03DB, 0x04AA,
+ 0x0BA8, 0x13FF, 0x062F, 0xFAF2, 0x071A, 0x0054,
+ 0xFAF1, 0x2732, 0xFAF0, 0x238C, 0x238D, 0xFAEF,
+ 0x1A84, 0x0392, 0x1244, 0x0995, 0x0799, 0x007F,
+ 0x032E, 0x7DFE, 0x1A85, 0x05EE, 0x018A, 0x0996,
+ 0x0028, 0x0152, 0x025A, 0x0A25, 0x7DFC, 0x3F6B,
+ 0x023C, 0x018B, 0x05B7, 0x0180, 0x00FD, 0x01BA,
+ 0x05EA, 0x123D, 0x05E8, 0x002F, 0x0625, 0x05B9,
+ 0x05B8, 0x0477, 0x13F7, 0x0D6F, 0x3F6C, 0xFAEA,
+ 0x01CB, 0xFAE9, 0x0985, 0x2388, 0x7DFB, 0x034B,
+ 0x01CA, 0x0047, 0x123A, 0x3F6A, 0x017D, 0x0662,
+ 0x123C, 0x123B, 0x0379, 0x024A, 0x13F6, 0x1A7D,
+ 0x016A, 0x0EAA, 0x123F, 0xFAEC, 0x0EA9, 0x13FB,
+ 0x0182, 0x0792, 0x05BA, 0x0181, 0x0D70, 0x001F,
+ 0x001E, 0x05BB, 0x3F6D, 0x0020, 0x2389, 0x1240,
+ 0x0183, 0x0501, 0x1A7F, 0x06D6, 0x0663, 0x06D3,
+ 0x13F8, 0x034C, 0x0EB4, 0x123E, 0x1A7E, 0x13F9,
+ 0x001B, 0x05E9, 0x0EA8, 0x001C, 0xFAEB, 0x05EA,
+ 0x034D, 0x0500, 0x13FA, 0x001D, 0x0048, 0x0794,
+ 0x0075, 0x0795, 0x0793, 0x0074, 0x008A, 0x03C9,
+ 0x05EB, 0x0087, 0x0076, 0x012B, 0x012C, 0x037A,
+ 0x0718, 0x0022, 0x272C, 0x0988, 0x0EB5, 0x0328,
+ 0x03CA, 0x05EC, 0x0EAB, 0x06D7, 0x0021, 0x0664,
+ 0x1A80, 0x0986, 0x0419, 0x03C8, 0x034E, 0x0987,
+ 0x0626, 0x02FC, 0x00AE, 0x01CC, 0x023D, 0x012A,
+ 0x0021, 0x0A26, 0x05BC, 0x01F6, 0x0221, 0x0049,
+ 0x0EB6, 0x0042, 0x02D2, 0x00F2, 0x00AF, 0x0290,
+ 0x0043, 0x052A, 0x13FC, 0x0A27, 0x032A, 0x1241,
+ 0x0EB7, 0x0EAD, 0x034F, 0x0EAC, 0x0022, 0x05ED,
+ 0x0797, 0x032B, 0x0035, 0x0989, 0x0184, 0x037B,
+ 0x098A, 0x1A81, 0x098B, 0x0796, 0x01CD, 0x025B,
+ 0x03CB, 0x0627, 0x02DA, 0x010C, 0x02D1, 0x06EA,
+ 0x0665, 0x0329, 0x0D78, 0x7E05, 0x7E04, 0x140A,
+ 0x0EB3, 0x0ECF, 0x3F7C, 0x1256, 0x05FB, 0x05CF,
+ 0xFAFF, 0x3F7D, 0x0ED0, 0x7E06, 0x3F7E, 0x3F7F,
+ 0xFB00, 0x239B, 0x0ED2, 0x1257, 0x7E07, 0x0ED1,
+ 0x002D, 0x1255, 0x273A, 0x09A4, 0x239A, 0x0ECD,
+ 0x273B, 0x1A8C, 0x002E, 0x09A5, 0xFAFE, 0x273C,
+ 0x0BAF, 0x0BB0, 0x05CE, 0x09A6, 0x00D1, 0x0ECE,
+ 0x09A8, 0x0030, 0x1A8E, 0x0ED3, 0x09A7, 0x0667,
+ 0x1258, 0x2740, 0x0D79, 0x3F80, 0x0189, 0x09A9,
+ 0x0EB5, 0x0359, 0x0ED4, 0x125A, 0x239D, 0x1259,
+ 0x05D1, 0x0D7A, 0x7E0A, 0x7E09, 0x09AA, 0x273D,
+ 0x0EB4, 0x273E, 0x002F, 0x0354, 0x05FC, 0x239C,
+ 0x1A8D, 0x0355, 0x0357, 0x05D0, 0x0358, 0x0356,
+ 0x01D2, 0x0508, 0x7E08, 0x273F, 0x0302, 0x0ED7,
+ 0x239E, 0x3F84, 0x08C4, 0x01D3, 0x0BB1, 0x0509,
+ 0x239F, 0x0303, 0x0133, 0x035C, 0x125B, 0x03D1,
+ 0x0ED8, 0x035D, 0x035E, 0x2743, 0x2744, 0x09AD,
+ 0x018A, 0x0031, 0x09AC, 0x3F82, 0x2741, 0x3F81,
+ 0x035A, 0x3F83, 0x05FD, 0x09AB, 0x0ED5, 0x0ED6,
+ 0x0633, 0x2742, 0x0055, 0x08C3, 0x0636, 0x035B,
+ 0x05FE, 0x0D7B, 0x0039, 0xFB05, 0x7E0B, 0x7E0C,
+ 0x140D, 0x018B, 0x09AF, 0x2746, 0x0032, 0x0056,
+ 0x09B0, 0x03D2, 0x0A30, 0x2747, 0x0057, 0x0EDA,
+ 0x050A, 0x125E, 0x0033, 0x2748, 0x0D7C, 0x03D3,
+ 0x3F85, 0x0034, 0xFB01, 0x140B, 0xFB02, 0x05FF,
+ 0x125C, 0xFB03, 0x125D, 0x1A8F, 0x0600, 0x05D2,
+ 0x0602, 0x2745, 0x0601, 0x0ED9, 0x1A90, 0xFB04,
+ 0x140C, 0x09AE, 0x033A, 0x7E0F, 0x23A2, 0x0A31,
+ 0x0EB6, 0x0058, 0x3F8A, 0x23A3, 0x01D6, 0x04AB,
+ 0x0059, 0x0EDB, 0x02D3, 0x018C, 0x04C6, 0x1260,
+ 0x3F8B, 0x125F, 0x1261, 0x071E, 0x7E10, 0x2749,
+ 0x140E, 0x3F87, 0x3F86, 0x0035, 0x3F88, 0x3F89,
+ 0x7E0D, 0x23A0, 0x1A91, 0x0797, 0x0603, 0x1A92,
+ 0x050B, 0x066A, 0x0306, 0x7E0E, 0x23A1, 0x079B,
+ 0x0BAA, 0x3F73, 0x7E01, 0x0292, 0x0216, 0x0998,
+ 0x1247, 0x2390, 0x0301, 0x0999, 0x1400, 0x1A87,
+ 0x041E, 0x1401, 0x0EC1, 0x2391, 0x3F74, 0x0A2C,
+ 0x1248, 0x3F75, 0x05C9, 0x0EC2, 0x2733, 0x238F,
+ 0xFAF3, 0xFAF4, 0x0EC0, 0x0997, 0x3F72, 0xFAF5,
+ 0x1245, 0x08C0, 0x0BA9, 0x1246, 0x020F, 0x041B,
+ 0x0186, 0x7E00, 0x7DFF, 0x0300, 0xFAFA, 0x2734,
+ 0x05F2, 0x124D, 0x2395, 0x099A, 0x2735, 0x3F77,
+ 0x0EC4, 0x0EC5, 0x1403, 0x0EC6, 0x1402, 0x1A89,
+ 0x3F78, 0x05F5, 0x05F3, 0x05F4, 0x2736, 0x1404,
+ 0x7E02, 0x124E, 0x0D75, 0x0029, 0x2392, 0xFAF7,
+ 0xFAF6, 0x0EC3, 0x1249, 0x2394, 0x2393, 0x05F0,
+ 0xFAF8, 0x124B, 0x124C, 0x124A, 0x3F76, 0x05CA,
+ 0x05F1, 0xFAF9, 0x1A88, 0x0187, 0x05F7, 0x124F,
+ 0x0631, 0x0D76, 0x0EAF, 0x2737, 0x0BAC, 0x099D,
+ 0x0A2D, 0x1250, 0x1407, 0x0BAD, 0x3F7A, 0x2396,
+ 0x2397, 0x0353, 0x1A8B, 0x08C2, 0x05CD, 0x099E,
+ 0x05CC, 0x0352, 0x002A, 0x05CB, 0x03CF, 0x1A8A,
+ 0x1405, 0x1406, 0x099B, 0x0EC7, 0x0630, 0x002B,
+ 0x3F79, 0x08C1, 0x0BAB, 0x0507, 0x05F6, 0x0EC8,
+ 0x099C, 0x0EB0, 0x0A2F, 0x0EB1, 0x2739, 0x09A1,
+ 0x03D0, 0x1252, 0x7E03, 0x0241, 0x0188, 0x0EB2,
+ 0x0BAE, 0x05FA, 0x09A2, 0x1254, 0x2398, 0xFAFB,
+ 0x1253, 0x2399, 0x0ECC, 0xFAFD, 0xFAFC, 0x09A3,
+ 0x1408, 0x09A0, 0x05F8, 0x3F7B, 0x099F, 0x0D77,
+ 0x1409, 0x002C, 0x0EC9, 0x0ECB, 0x0A2E, 0x1251,
+ 0x0ECA, 0x079A, 0x071B, 0x05F9, 0x2738, 0x0632,
+ 0x002E, 0x0012, 0x7E25, 0xFB1C, 0x0262, 0x001C,
+ 0x03D6, 0x018E, 0x007C, 0x0342, 0x052E, 0x7E26,
+ 0xFB1D, 0x01D7, 0x0D7F, 0x126A, 0x2756, 0x09B6,
+ 0xFB20, 0x3F97, 0xFB21, 0xFB1E, 0xFB1F, 0x23AF,
+ 0xFB19, 0xFB1A, 0x23AE, 0x7E24, 0x1A95, 0x2755,
+ 0x2754, 0x05D7, 0x050D, 0x0EE3, 0xFB1B, 0x0EE2,
+ 0x0BB5, 0x00E3, 0x08CB, 0x05D8, 0x01B9, 0x00E7,
+ 0x1412, 0x1A96, 0x015A, 0x009A, 0x007B, 0xFB24,
+ 0x3F99, 0x026D, 0x0026, 0x0EE5, 0x0EE4, 0x0222,
+ 0x05D9, 0x0D82, 0x7E28, 0x3F9A, 0x0A36, 0xFB25,
+ 0xFB26, 0x23B1, 0x7E29, 0x126B, 0x7E27, 0x23B0,
+ 0xFB22, 0x1411, 0x0BB6, 0x3F98, 0x126C, 0x09B7,
+ 0x02C2, 0x0442, 0x0A33, 0x012B, 0x01C1, 0x0034,
+ 0xFB23, 0x126D, 0x03DF, 0x0084, 0x0EB7, 0x23B2,
+ 0x7E2A, 0x052F, 0x018D, 0x0B16, 0x7E2B, 0x01A2,
+ 0x0736, 0x00F3, 0x060F, 0x003B, 0x003B, 0x081A,
+ 0x003F, 0x1416, 0x003E, 0x3F9D, 0x126E, 0x7E2E,
+ 0x7E2C, 0x7E2D, 0x2757, 0x060E, 0xFB28, 0xFB27,
+ 0x3F9B, 0x050E, 0x0EE6, 0x018F, 0x05DA, 0x0136,
+ 0x071F, 0xFB29, 0x1413, 0x0137, 0x3F9C, 0x0EE7,
+ 0x05DB, 0x02DB, 0x05EF, 0x23B5, 0x0EBB, 0x0243,
+ 0xFB2D, 0x0307, 0xFB2E, 0x275A, 0x0293, 0x041F,
+ 0x0686, 0x3F9E, 0x0217, 0x0612, 0x05FA, 0x23B6,
+ 0x7E2F, 0x1A97, 0x275B, 0x0613, 0xFB2F, 0x7E30,
+ 0xFB2A, 0x23B4, 0x126F, 0x23B3, 0x1270, 0x2758,
+ 0xFB2B, 0x0610, 0x0BB7, 0x03D7, 0x2759, 0x0916,
+ 0x050F, 0x0EBA, 0x0BF6, 0xFB2C, 0x0611, 0x00D3,
+ 0x2C5E, 0x7E36, 0xFB34, 0xFB33, 0x3FA2, 0xFB35,
+ 0x2FDE, 0x1417, 0x0A37, 0x3FA3, 0x02A2, 0x7E37,
+ 0xFB36, 0x005E, 0x058A, 0x076F, 0x0886, 0x005F,
+ 0xFB3B, 0x0686, 0x0342, 0xFB37, 0xFB3A, 0x3F9F,
+ 0x3FA0, 0xFB31, 0xFB30, 0x23B7, 0x3FA1, 0x23BB,
+ 0x23BA, 0x1271, 0x0D83, 0x1036, 0x7E32, 0x1272,
+ 0x7E31, 0x7E33, 0x162E, 0x1273, 0xFB32, 0xFB0C,
+ 0x1262, 0xFB0D, 0xFB0B, 0x3F8F, 0x0037, 0x1263,
+ 0x3F90, 0x0EDD, 0x0038, 0x05D3, 0xFB0E, 0x23A7,
+ 0x0606, 0x1265, 0x3F91, 0x1264, 0x0039, 0xFB0F,
+ 0x7E14, 0xFB10, 0x274A, 0x274B, 0xFB07, 0xFB08,
+ 0x23A5, 0xFB06, 0x23A4, 0x0EDC, 0xFB0A, 0xFB09,
+ 0x7E11, 0x0036, 0x0605, 0x3F8C, 0x7E12, 0x0604,
+ 0x3F8E, 0x23A6, 0x7E13, 0x3F8D, 0x03DE, 0x7E19,
+ 0x7E18, 0x0242, 0x0097, 0x08C5, 0xFB13, 0x7E1A,
+ 0x005A, 0x079B, 0x0607, 0x09B2, 0x033B, 0x05D4,
+ 0x09B3, 0xFB14, 0x23A8, 0x0637, 0x7E1B, 0x23AA,
+ 0x23A9, 0x0608, 0x274C, 0xFB12, 0xFB11, 0x7E15,
+ 0x1266, 0x140F, 0x1267, 0x7E16, 0x274D, 0x079E,
+ 0x274E, 0x0EDE, 0x066B, 0x09B1, 0x0D7D, 0x3F92,
+ 0x7E17, 0x079A, 0x002A, 0x00D2, 0x23AC, 0x23AB,
+ 0x02F2, 0x00B6, 0x0BB2, 0x05D5, 0x0066, 0x03A2,
+ 0x003A, 0x060B, 0x060A, 0x0317, 0x079F, 0x0362,
+ 0x2750, 0x050C, 0x3F95, 0x7E1D, 0x7E1E, 0xFB15,
+ 0x23AD, 0x274F, 0x3F93, 0x3F94, 0x7E1C, 0x0609,
+ 0x08C6, 0x0EE0, 0x0EDF, 0x035F, 0x0136, 0x076E,
+ 0x1A93, 0x1268, 0x0A32, 0x024B, 0x08C7, 0x1410,
+ 0x01EC, 0x0036, 0x0EE1, 0x0363, 0x0072, 0x0030,
+ 0x003E, 0x2753, 0x7E21, 0x00D7, 0x0117, 0x003A,
+ 0x0BB4, 0x0126, 0x018D, 0x05D6, 0x7E22, 0xFB16,
+ 0x0D7E, 0x060D, 0xFB18, 0xFB17, 0x7E23, 0x7E1F,
+ 0x2752, 0x1269, 0x2751, 0x09B4, 0x08CA, 0x1A94,
+ 0x3F96, 0x0BB3, 0x0107, 0x09B5, 0x005B, 0x03D6,
+ 0x00B0, 0x0101, 0x7E20, 0x060C, 0x03D7, 0x0032,
+ 0x04DE, 0xFA91, 0x7DA8, 0x088E, 0x0374, 0x7DA9,
+ 0x054E, 0x007A, 0x0223, 0x0152, 0x3F26, 0x7DAA,
+ 0x0610, 0x1A36, 0x13B3, 0x0E58, 0x1A35, 0x7DAD,
+ 0x3F27, 0x7DAE, 0x7DAB, 0x7DAC, 0xFA8D, 0x2347,
+ 0xFA8E, 0xFA8C, 0x7DA6, 0x3F24, 0x2348, 0x7DA7,
+ 0x0E4F, 0x02C8, 0x0376, 0xFA90, 0xFA8F, 0x0116,
+ 0x008A, 0x059A, 0x3F25, 0x0044, 0x00AC, 0x1A37,
+ 0x0153, 0x0066, 0x01DE, 0x049C, 0xFA96, 0x3F28,
+ 0x0370, 0x00EA, 0x054F, 0x3F29, 0x006B, 0x093C,
+ 0x0570, 0x11E2, 0x26E0, 0x1A38, 0x26E1, 0x234A,
+ 0x7DB1, 0x093D, 0x1FD7, 0x2349, 0x7DAF, 0x7DB0,
+ 0x0310, 0x0775, 0xFA93, 0xFA92, 0x13B4, 0x009A,
+ 0x0022, 0x093B, 0x020E, 0x002A, 0x003C, 0xFA95,
+ 0xFA94, 0x033C, 0x00A8, 0x00C9, 0x26E3, 0xFA99,
+ 0x051D, 0x00FA, 0x0154, 0x093E, 0x00DE, 0x0371,
+ 0x002E, 0xFA9A, 0x11E3, 0x0377, 0x0776, 0x7DB2,
+ 0x11E4, 0x11E5, 0x7DB3, 0x3F2B, 0xFA9B, 0x234E,
+ 0x11E6, 0x26E2, 0x059B, 0xFA98, 0xFA97, 0x234B,
+ 0x0A0D, 0x059C, 0x234C, 0x0571, 0x006C, 0x075C,
+ 0x234D, 0x3F2A, 0x06C2, 0x00FE, 0x0311, 0x059D,
+ 0x010A, 0x031C, 0x059E, 0x11E8, 0x0587, 0x2352,
+ 0x0312, 0x7DB6, 0xFA9E, 0x04DF, 0x1FD8, 0x11E9,
+ 0x093F, 0x0A0E, 0x0E5A, 0x11EA, 0x2353, 0x1FD9,
+ 0x0573, 0x11EB, 0x7DB7, 0xFA9F, 0x0E5B, 0xFA9C,
+ 0xFA9D, 0x7DB4, 0x234F, 0x0E59, 0x0572, 0x2351,
+ 0x2350, 0x11E7, 0x049D, 0x3F2D, 0x3F2C, 0x0023,
+ 0x010D, 0x088F, 0x7DB5, 0x26E4, 0x0611, 0xFAA4,
+ 0x1A39, 0xFAA5, 0xFAA3, 0x26E7, 0xFAA6, 0x3F2F,
+ 0x2356, 0x2357, 0x0940, 0x13B8, 0xFAA7, 0x7DBC,
+ 0x1FDA, 0x2358, 0xFAA8, 0x3F30, 0x26E8, 0xFAA9,
+ 0xFAAA, 0xFAAB, 0x2359, 0x7DBD, 0x7DB9, 0x2354,
+ 0x11EC, 0xFAA0, 0x7DB8, 0x13B5, 0x11ED, 0x2355,
+ 0x7DBA, 0x13B6, 0x13B7, 0x7DBB, 0xFAA1, 0x26E5,
+ 0x0612, 0x3F2E, 0x26E6, 0xFAA2, 0x7D9E, 0x0590,
+ 0x7D9F, 0xBF7D, 0x0D0F, 0x13AF, 0x0591, 0x1A1C,
+ 0x1FD3, 0x17EE, 0x0592, 0x3F1A, 0xBF7E, 0x11DC,
+ 0x0593, 0x206F, 0x7DA0, 0x3F1C, 0xBF7F, 0x1A1E,
+ 0x3F1D, 0x1A1D, 0x245C, 0x110E, 0x110F, 0x58BE,
+ 0x0220, 0x0150, 0x1FD2, 0x7D9C, 0x04DC, 0x05E6,
+ 0x0D0E, 0x001E, 0xBF7C, 0x58BF, 0x0B80, 0x054C,
+ 0x13AE, 0x206E, 0x02A3, 0x051C, 0x1A30, 0x245F,
+ 0x0466, 0x7DA1, 0x030A, 0x3F1F, 0xFA82, 0x088C,
+ 0x05E7, 0x04DD, 0x13B0, 0x0790, 0x1A31, 0x1FD4,
+ 0x13B1, 0x7DA2, 0x2638, 0x1A32, 0x2341, 0x2340,
+ 0x2639, 0x3F1E, 0xFA80, 0x0594, 0x11DE, 0x11DF,
+ 0x0596, 0x1A1F, 0x0595, 0x02C4, 0x051A, 0x0E4D,
+ 0x0E4C, 0x040C, 0x245E, 0x0464, 0xFA81, 0x245D,
+ 0x0222, 0x0074, 0x031A, 0x3F21, 0x263B, 0x06EB,
+ 0x0254, 0x0774, 0x0020, 0x0078, 0x0410, 0x02EE,
+ 0x13B2, 0xFA84, 0x06C0, 0x0A0A, 0x0E4E, 0x0597,
+ 0xFA85, 0xFA87, 0x0598, 0x11E0, 0xFA86, 0x263C,
+ 0x1FD5, 0x2343, 0xFA83, 0x3F20, 0x2342, 0x030B,
+ 0x263A, 0x0B81, 0x0586, 0x040E, 0x040F, 0x2345,
+ 0x2344, 0x02C6, 0x0130, 0x030C, 0x054D, 0x01BE,
+ 0x0132, 0x0599, 0x3F23, 0x00FA, 0x012E, 0x03CE,
+ 0xFA8B, 0x263E, 0x02C7, 0x006A, 0x093A, 0x0E6E,
+ 0x0182, 0x0021, 0x00C8, 0x1A33, 0x7DA5, 0x0E6F,
+ 0x1FD6, 0x1A34, 0x2346, 0x263F, 0x3F22, 0x7DA4,
+ 0xFA88, 0x7DA3, 0x030D, 0x0A0C, 0xFA89, 0x11E1,
+ 0x088D, 0x0256, 0x030F, 0x030E, 0x02F8, 0x0060,
+ 0x02B8, 0xFA8A, 0x263D, 0x0257, 0x13BE, 0x7DCD,
+ 0xFAB4, 0x0E83, 0x13BF, 0x015B, 0x26F8, 0x26F7,
+ 0x0B89, 0x0947, 0x3F39, 0x11F9, 0x13C0, 0x26F9,
+ 0x05AF, 0x11FC, 0x11FA, 0x11FB, 0x0E84, 0x11FE,
+ 0xFAB5, 0x11FD, 0x26F5, 0xFAB2, 0x235F, 0x05AC,
+ 0x26F6, 0x05AD, 0x7DCB, 0x7DCA, 0x2360, 0x0946,
+ 0x7DCC, 0xFAB3, 0x057A, 0x0318, 0x11F8, 0x05AE,
+ 0x2361, 0x0B88, 0x26FB, 0x1203, 0x1204, 0x0E85,
+ 0x0E86, 0x0D4F, 0x0E87, 0x0948, 0x0A10, 0x1FE2,
+ 0x057C, 0x1A3F, 0x0D50, 0x015D, 0x057D, 0x1205,
+ 0x1A40, 0x13C2, 0x26FC, 0x26FD, 0x1206, 0x3F3A,
+ 0x1A41, 0x1FE1, 0x0E8E, 0x26FA, 0xFAB6, 0x11FF,
+ 0x1201, 0x7DCE, 0x1200, 0x05B0, 0x13C1, 0x089E,
+ 0x0319, 0x015C, 0x057B, 0x070A, 0x1A3E, 0x1202,
+ 0x011D, 0x031A, 0x7DCF, 0x1209, 0x0E90, 0x015F,
+ 0x002B, 0x05B1, 0x0D54, 0x04E5, 0x0160, 0x05B2,
+ 0x13C4, 0x0E88, 0x1FE5, 0x1FE6, 0x2362, 0x3F3B,
+ 0x13C5, 0x26FF, 0x0161, 0x057E, 0x0779, 0x0D51,
+ 0x13C3, 0x1A42, 0x04E4, 0x1208, 0x1A44, 0x1FE3,
+ 0x1207, 0x1A43, 0x0225, 0x26FE, 0x1FE4, 0x015E,
+ 0x0D53, 0x002A, 0x0E8F, 0x0D52, 0x0778, 0x2701,
+ 0x2363, 0x3F3E, 0x1FE8, 0xFAB8, 0x13C9, 0x2365,
+ 0x2364, 0x031B, 0x120A, 0x0E8B, 0x05B8, 0x0E8A,
+ 0x13CA, 0x3F3F, 0x2702, 0x1FE9, 0x120B, 0x7DD0,
+ 0x094A, 0x2366, 0xFAB9, 0x13CB, 0x1A45, 0x13C7,
+ 0x05B3, 0xFAB7, 0x13C6, 0x3F3D, 0x05B4, 0x3F3C,
+ 0x1FE7, 0x05B5, 0x13C8, 0x0E89, 0x1A46, 0x1A47,
+ 0x05B6, 0x05B7, 0x2700, 0x0949, 0x0122, 0x05B9,
+ 0x2704, 0x031D, 0x0469, 0x094C, 0xFABA, 0x120F,
+ 0x1A48, 0x0638, 0x1210, 0x13CC, 0x01B3, 0x3F42,
+ 0x1A49, 0xFABB, 0x3F41, 0x0E8C, 0x1A4A, 0x2367,
+ 0x3F43, 0x094D, 0x2703, 0x094B, 0x7DD1, 0x3F40,
+ 0x031C, 0x0226, 0x1FEA, 0x7DD2, 0x120C, 0x03DA,
+ 0x0B8A, 0x120D, 0x002C, 0x03CC, 0x04E6, 0x7DD3,
+ 0x120E, 0x089F, 0x04E2, 0x059F, 0xFAAD, 0x0117,
+ 0x0137, 0x0613, 0x235C, 0x3F31, 0x0899, 0x02EF,
+ 0x0025, 0x0942, 0x0468, 0x0E8C, 0x0A0F, 0x13BA,
+ 0x7DBE, 0x13B9, 0x05A0, 0x7DC0, 0x26EB, 0x7DBF,
+ 0x235A, 0x235B, 0x0372, 0x0313, 0x0941, 0x0898,
+ 0x26E9, 0x0574, 0x02C9, 0x051E, 0x0024, 0x1FDB,
+ 0x0467, 0x0791, 0x04E1, 0x26EA, 0xFAAC, 0x04E0,
+ 0x3F34, 0x0E5D, 0x26ED, 0xFAAE, 0x1FDC, 0x0575,
+ 0x0314, 0x7DC4, 0x1FDD, 0x1FDE, 0x05A1, 0x0E5E,
+ 0x26EE, 0x26EF, 0x7DC5, 0x11EE, 0xFAAF, 0x3F35,
+ 0x11EF, 0x26F0, 0x7DC6, 0xFAB0, 0x05A2, 0x7DC1,
+ 0x0E5C, 0x7DC2, 0x00CA, 0x01B0, 0x235D, 0x3F32,
+ 0x075E, 0x0B82, 0x0155, 0x0156, 0x3F33, 0x26EC,
+ 0x0708, 0x0B83, 0x1A3B, 0x7DC3, 0x1A3A, 0x089B,
+ 0x11F2, 0x05A5, 0x0E5F, 0x0027, 0x01B2, 0x089C,
+ 0x26F3, 0x0B85, 0x0157, 0x011C, 0x0944, 0x0577,
+ 0x7DC8, 0x13BB, 0x089D, 0x05A6, 0x0315, 0x0E8D,
+ 0xFAB1, 0x1A3C, 0x03AC, 0x0576, 0x7DC7, 0x0B84,
+ 0x05A3, 0x26F1, 0x26F2, 0x05A4, 0x0224, 0x0943,
+ 0x0D4C, 0x11F0, 0x1FDF, 0x089A, 0x02F0, 0x0D4D,
+ 0x0026, 0x11F1, 0x0777, 0x0E82, 0x0029, 0x05A8,
+ 0x1A3D, 0x0028, 0x00CB, 0x0159, 0x11F6, 0x0709,
+ 0x0614, 0x04E3, 0x015A, 0x0578, 0x0B87, 0x1FE0,
+ 0x05AA, 0x7DC9, 0x05A9, 0x05AB, 0x0579, 0x11F7,
+ 0x3F38, 0x0945, 0x13BC, 0x26F4, 0x235E, 0x3F36,
+ 0x0158, 0x05A7, 0x3F37, 0x0E80, 0x11F3, 0x13BD,
+ 0x0B86, 0x0E81, 0x0316, 0x0317, 0x0D4E, 0x11F5,
+ 0x11F4, 0x075F, 0x06C3, 0x08A6, 0x0B8D, 0x0584,
+ 0x022A, 0x02CA, 0x13D5, 0x0E93, 0x0217, 0x011F,
+ 0x0124, 0x0120, 0x0B8E, 0x06C4, 0x0326, 0x0327,
+ 0x05BC, 0x0B8F, 0xFAC1, 0x0955, 0x1217, 0x7DD9,
+ 0x0328, 0x0323, 0x0324, 0x2369, 0x7DD8, 0x0031,
+ 0x1FF3, 0x1216, 0xFAC0, 0x1215, 0x0032, 0x00CD,
+ 0x03AF, 0x0A12, 0x01BC, 0x0070, 0x0325, 0x0E92,
+ 0x038E, 0x02D7, 0x2708, 0x13D7, 0x0296, 0x039A,
+ 0x00FE, 0x070D, 0x01ED, 0x02D8, 0x0398, 0x077E,
+ 0x0167, 0x0244, 0x0329, 0x01BD, 0x0521, 0x022B,
+ 0x1A50, 0x0122, 0x08A9, 0x0A13, 0x05DD, 0x070C,
+ 0x04E9, 0x0033, 0x0121, 0x13D6, 0x0956, 0x08A7,
+ 0x0585, 0x0166, 0x0204, 0x08A8, 0x0586, 0x04A0,
+ 0x02CB, 0x003D, 0x0588, 0x0289, 0x03C2, 0x03B8,
+ 0x077F, 0x0587, 0x04EB, 0x00CF, 0x01A3, 0x13D9,
+ 0x0617, 0x01A2, 0x06C5, 0x0522, 0x03B9, 0x070E,
+ 0x0762, 0x08AA, 0x1A51, 0x0169, 0x03BA, 0x1218,
+ 0x0523, 0x04EC, 0x3F49, 0x0E96, 0x04EA, 0x02CA,
+ 0x0D59, 0x13D8, 0x03D2, 0x0E95, 0x0957, 0x0E94,
+ 0x0168, 0x0123, 0x031E, 0x0412, 0x032A, 0x00CE,
+ 0x039C, 0x0E95, 0x0D5A, 0x0071, 0x13DC, 0x7DDA,
+ 0x236C, 0x0E96, 0x13DD, 0x032C, 0x1A52, 0x0B90,
+ 0x0589, 0x032D, 0x2709, 0x1FF6, 0x058A, 0x1219,
+ 0x05BD, 0x058B, 0x0035, 0x270A, 0x05DE, 0x095A,
+ 0x1A53, 0x016B, 0x022C, 0x070F, 0x13DA, 0x0958,
+ 0x3F4A, 0x0588, 0x0D5B, 0x13DB, 0x236A, 0x0780,
+ 0x3F4B, 0x1FF4, 0x0959, 0x0034, 0x016A, 0x236B,
+ 0x1FF5, 0x032B, 0x270B, 0x02F3, 0xFAC4, 0x7DDC,
+ 0x1FF7, 0x0124, 0x095C, 0x016C, 0x0072, 0x016A,
+ 0x04EE, 0x270D, 0x270C, 0x022D, 0x04A1, 0x270E,
+ 0x0E97, 0x0618, 0xFAC5, 0x0E98, 0x3F4C, 0x236E,
+ 0x1A54, 0x05BF, 0x032E, 0x121A, 0xFAC2, 0x05BE,
+ 0x01EE, 0x04ED, 0x236D, 0x03BB, 0x0125, 0x00EC,
+ 0x7DDB, 0xFAC3, 0x05DF, 0x00C9, 0x08AB, 0x095B,
+ 0x013C, 0x01FE, 0x0B8B, 0xFABD, 0x7DD4, 0x0615,
+ 0x01EA, 0x0E91, 0x057F, 0x016E, 0x0156, 0x08A1,
+ 0x094E, 0x7DD5, 0x03D1, 0x01B6, 0x1FEC, 0x1FEB,
+ 0xFABE, 0x7DD6, 0x1212, 0x7DD7, 0xFABF, 0x1A4C,
+ 0x0E8D, 0x3F44, 0xFABC, 0x002D, 0x006A, 0x01B5,
+ 0x13CD, 0x08A0, 0x01B4, 0x03D0, 0x006B, 0x1211,
+ 0x3F45, 0x0227, 0x02FE, 0x077A, 0x1A4B, 0x014A,
+ 0x0E91, 0x1FED, 0x2705, 0x0162, 0x094F, 0x002E,
+ 0x04E8, 0x1FEE, 0x0A11, 0x0950, 0x0581, 0x1FEF,
+ 0x1FF0, 0x2706, 0x3F47, 0x1A4F, 0x0582, 0x05BA,
+ 0x002F, 0x031E, 0x13CF, 0x0760, 0x0580, 0x0E92,
+ 0x031D, 0x04E7, 0x1A4D, 0x1A4E, 0x0E8E, 0x01B7,
+ 0x02F1, 0x02F2, 0x3F46, 0x0E8F, 0x0616, 0x0D55,
+ 0x006C, 0x0E93, 0x0E90, 0x13CE, 0x049E, 0x0411,
+ 0x13D0, 0x08A2, 0x03AD, 0x02D3, 0x0228, 0x13D1,
+ 0x006D, 0x006D, 0x0792, 0x01B8, 0x077C, 0x0229,
+ 0x0320, 0x1FF1, 0x3F48, 0x0D56, 0x13D2, 0x01B9,
+ 0x2707, 0x2368, 0x0D57, 0x00CC, 0x0520, 0x1213,
+ 0x0163, 0x051F, 0x0951, 0x1214, 0x0E94, 0x0164,
+ 0x00FC, 0x070B, 0x077B, 0x0761, 0x00C6, 0x017A,
+ 0x031F, 0x0583, 0x01EE, 0x00D4, 0x0165, 0x0952,
+ 0x02C8, 0x00C8, 0x023A, 0x0030, 0x01EC, 0x00FD,
+ 0x02F9, 0x01BB, 0x0953, 0x01A0, 0x13D4, 0x08A5,
+ 0x0030, 0x08A4, 0x077D, 0x006E, 0x0D58, 0x0954,
+ 0x05DC, 0x0123, 0x0321, 0x01BA, 0x0288, 0x05BB,
+ 0x13D3, 0x0322, 0x03AE, 0x0B8C, 0x049F, 0x1FF2,
+ 0x08A3, 0x006E, 0x02D6, 0x006F, 0x011E, 0x0373,
+ 0x03BF, 0x01EA, 0x08AF, 0x0595, 0x0100, 0x0112,
+ 0x0050, 0x02B9, 0x014C, 0x01A4, 0x0258, 0x04F2,
+ 0x0596, 0x00A4, 0x13E1, 0x0124, 0x08B0, 0x04F3,
+ 0x0171, 0x0413, 0x2713, 0x0E9B, 0x046C, 0x00A2,
+ 0x0765, 0x05E0, 0x019C, 0x0964, 0x0335, 0x061C,
+ 0x3F4F, 0x0E9A, 0x009A, 0x0170, 0x0784, 0x003E,
+ 0x012F, 0x01A3, 0x023D, 0x01F0, 0x016B, 0x00A3,
+ 0x023F, 0x03C4, 0x03D4, 0x0377, 0x0052, 0x01BE,
+ 0x0031, 0x0012, 0x0157, 0x021A, 0x0242, 0x039E,
+ 0x04A2, 0x05E1, 0x02F6, 0x1A5D, 0x0336, 0x0126,
+ 0x05E2, 0x2374, 0x05C4, 0x046D, 0x0311, 0x01A5,
+ 0x04F4, 0xFAC8, 0x023E, 0x0A17, 0x0D5F, 0x05C3,
+ 0x08B1, 0x009C, 0x02CD, 0x0299, 0x036A, 0x0376,
+ 0x006C, 0x0037, 0x0785, 0x0076, 0x0040, 0x0965,
+ 0x13E2, 0x02CC, 0x0259, 0x0414, 0x06C6, 0x01A6,
+ 0x033F, 0x0334, 0x0E9C, 0x0786, 0x0127, 0x0966,
+ 0x06C7, 0x063B, 0x0039, 0x0172, 0x0374, 0x003A,
+ 0x0597, 0x0128, 0x00FF, 0x0526, 0x2375, 0x0044,
+ 0x0337, 0x0B95, 0x0230, 0x7DDE, 0x0D60, 0x0185,
+ 0x0D61, 0x0038, 0x0321, 0x003F, 0x009D, 0x0101,
+ 0x03B9, 0x0312, 0x0969, 0x1A5E, 0x1220, 0x2714,
+ 0x003B, 0x0598, 0x2715, 0x1FFB, 0x08B2, 0x096A,
+ 0x0EA1, 0x7DDF, 0x1FFC, 0x0A18, 0x1A5F, 0x1222,
+ 0x1221, 0x0173, 0x0793, 0x061D, 0x096B, 0x7DE0,
+ 0x0787, 0x0231, 0x0711, 0x0EA0, 0xFAC9, 0x121D,
+ 0x05C5, 0x121F, 0x121E, 0x3F50, 0x0E9D, 0x0338,
+ 0x0968, 0x0967, 0x04F5, 0x0B96, 0x05C7, 0x05C6,
+ 0x03BE, 0x01B8, 0x1225, 0x1224, 0x02CE, 0x0160,
+ 0x0102, 0xFACD, 0x3F51, 0x0322, 0xFACE, 0x0339,
+ 0x059A, 0x019E, 0x063C, 0x01BF, 0x7DE2, 0x3F52,
+ 0x0D62, 0x2718, 0x3F53, 0x2717, 0x0EA2, 0x0599,
+ 0x13E3, 0xFACA, 0xFACB, 0x06C8, 0x06C9, 0xFACC,
+ 0x7DE1, 0x0125, 0x01BC, 0x13E4, 0x1223, 0x0336,
+ 0x02BA, 0x028B, 0x2716, 0x2376, 0x02CD, 0x013D,
+ 0x095E, 0x05C0, 0x0016, 0x016F, 0x0525, 0x2371,
+ 0x2370, 0x0205, 0x01C8, 0x058C, 0x0B91, 0x00E6,
+ 0x0639, 0x0330, 0x2372, 0x3F4D, 0x0763, 0x016E,
+ 0x121B, 0x1FF9, 0x058D, 0x016D, 0x1A55, 0x270F,
+ 0x13DE, 0xFAC6, 0x1FF8, 0x236F, 0x1A56, 0x04EF,
+ 0x0298, 0x0E99, 0x095D, 0x01BE, 0x02CC, 0x0524,
+ 0x032F, 0x7DDD, 0x0589, 0x095F, 0x03BC, 0x1A59,
+ 0x0E9A, 0x0E9B, 0x061A, 0x13E0, 0x0E9C, 0x08AD,
+ 0x0332, 0x0A15, 0x0591, 0x0D5D, 0x0590, 0x0960,
+ 0x2373, 0x2711, 0x1A5A, 0x058A, 0x006F, 0x3F4E,
+ 0x2712, 0x0764, 0x08AC, 0x05C1, 0xFAC7, 0x0331,
+ 0x1FFA, 0x13DF, 0x2710, 0x1A57, 0x0E97, 0x058E,
+ 0x0619, 0x0A14, 0x1A58, 0x0D5C, 0x0782, 0x058F,
+ 0x121C, 0x0781, 0x0210, 0x0594, 0x0962, 0x0080,
+ 0x0399, 0x03C3, 0x02F5, 0x0184, 0x028A, 0x046B,
+ 0x0963, 0x0B92, 0x0100, 0x1A5B, 0x0A16, 0x0E9D,
+ 0x03BD, 0x0B93, 0x01A4, 0x0333, 0x0783, 0x033E,
+ 0x00FE, 0x0592, 0x031F, 0x046A, 0x0593, 0x0961,
+ 0x04F0, 0x00FF, 0x02F4, 0x0073, 0x0E98, 0x04F1,
+ 0x033D, 0x0266, 0x02FF, 0x03D3, 0x0320, 0x0206,
+ 0x004E, 0x023C, 0x01EF, 0x0211, 0x0027, 0x000C,
+ 0x063A, 0x08AE, 0x008C, 0x03CE, 0x02D9, 0x02FA,
+ 0x01A2, 0x01A5, 0x061B, 0x0E9E, 0x05C2, 0x022F,
+ 0x039D, 0x01F0, 0x1A5C, 0x0E9F, 0x02CB, 0x03B8,
+ 0x014B, 0x0B94, 0x0E99, 0x013E, 0x016F, 0x0036,
+ 0x0334, 0x0D5E, 0x0310, 0x0207, 0x0044, 0x017B,
+ 0x00DF, 0x0042, 0x022E, 0x0710, 0x007E,
+};
+
+static const uint8_t on2avc_cb8_bits[ON2AVC_CB8_CODES] = {
+ 11, 11, 16, 15, 11, 9,
+ 13, 12, 9, 11, 11, 14,
+ 13, 12, 13, 14, 14, 13,
+ 10, 11, 15, 15, 10, 16,
+ 16, 15, 16, 11, 13, 13,
+ 16, 13, 11, 11, 15, 13,
+ 11, 9, 13, 13, 10, 9,
+ 16, 13, 9, 10, 10, 15,
+ 10, 10, 10, 12, 14, 11,
+ 14, 12, 14, 11, 12, 11,
+ 12, 14, 10, 10, 11, 16,
+ 10, 13, 14, 14, 11, 13,
+ 11, 13, 12, 10, 10, 10,
+ 15, 10, 10, 12, 12, 12,
+ 15, 12, 11, 12, 13, 10,
+ 11, 11, 12, 13, 11, 13,
+ 12, 15, 13, 11, 11, 12,
+ 14, 11, 11, 11, 13, 14,
+ 11, 13, 14, 13, 12, 12,
+ 12, 11, 14, 12, 10, 13,
+ 14, 11, 13, 15, 14, 14,
+ 13, 13, 14, 13, 13, 13,
+ 15, 14, 12, 14, 14, 14,
+ 16, 14, 12, 12, 16, 16,
+ 12, 13, 12, 14, 14, 13,
+ 13, 16, 14, 13, 14, 13,
+ 13, 13, 13, 15, 14, 13,
+ 10, 12, 16, 16, 12, 10,
+ 13, 14, 11, 11, 12, 14,
+ 14, 11, 12, 16, 13, 12,
+ 14, 14, 14, 16, 15, 16,
+ 15, 16, 15, 14, 12, 14,
+ 13, 11, 10, 11, 14, 14,
+ 11, 9, 14, 14, 10, 16,
+ 12, 15, 16, 12, 11, 14,
+ 13, 9, 11, 11, 15, 15,
+ 12, 13, 14, 15, 12, 16,
+ 14, 15, 15, 13, 14, 14,
+ 15, 14, 14, 14, 13, 15,
+ 12, 14, 12, 15, 15, 12,
+ 11, 13, 15, 10, 14, 13,
+ 14, 13, 13, 13, 13, 13,
+ 13, 12, 13, 13, 12, 14,
+ 14, 16, 12, 14, 11, 13,
+ 13, 12, 14, 15, 13, 13,
+ 13, 13, 13, 14, 13, 13,
+ 13, 14, 13, 13, 12, 14,
+ 14, 13, 11, 12, 13, 12,
+ 12, 10, 13, 13, 11, 11,
+ 12, 14, 11, 12, 13, 15,
+ 14, 14, 16, 11, 13, 13,
+ 11, 15, 10, 14, 13, 12,
+ 12, 13, 12, 13, 11, 11,
+ 11, 12, 11, 10, 12, 13,
+ 10, 10, 13, 13, 10, 10,
+ 10, 10, 15, 11, 11, 13,
+ 12, 11, 13, 12, 11, 16,
+ 14, 10, 14, 11, 10, 10,
+ 15, 12, 11, 13, 12, 11,
+ 14, 13, 11, 13, 11, 10,
+ 9, 10, 10, 14, 10, 9,
+ 14, 13, 9, 9, 10, 10,
+ 10, 10, 10, 12, 14, 10,
+ 14, 13, 12, 11, 14, 13,
+ 11, 13, 9, 11, 13, 13,
+ 11, 14, 14, 12, 12, 13,
+ 10, 12, 12, 10, 9, 10,
+ 10, 10, 10, 9, 10, 10,
+ 11, 10, 8, 12, 12, 9,
+ 11, 10, 10, 11, 11, 12,
+ 12, 14, 12, 10, 14, 13,
+ 16, 10, 10, 11, 16, 14,
+ 11, 12, 14, 12, 12, 10,
+ 11, 10, 10, 11, 9, 11,
+ 11, 9, 11, 12, 13, 10,
+ 10, 11, 11, 11, 11, 10,
+ 13, 13, 10, 13, 11, 11,
+ 11, 12, 11, 11, 11, 10,
+ 10, 12, 12, 10, 14, 12,
+ 11, 12, 12, 11, 12, 12,
+ 11, 10, 11, 11, 11, 11,
+ 14, 13, 13, 13, 13, 12,
+ 13, 13, 12, 12, 12, 13,
+ 13, 12, 13, 13, 14, 14,
+ 13, 12, 13, 15, 14, 12,
+ 13, 16, 14, 12, 14, 14,
+ 14, 13, 13, 12, 13, 13,
+ 12, 12, 14, 13, 12, 10,
+ 13, 14, 14, 10, 11, 14,
+ 14, 11, 10, 13, 13, 11,
+ 12, 12, 14, 14, 14, 13,
+ 13, 14, 13, 13, 14, 13,
+ 12, 11, 12, 15, 14, 12,
+ 9, 12, 13, 10, 9, 11,
+ 13, 14, 11, 10, 13, 15,
+ 14, 10, 11, 13, 14, 11,
+ 11, 12, 12, 10, 12, 12,
+ 15, 15, 12, 14, 14, 14,
+ 13, 13, 14, 14, 14, 11,
+ 12, 14, 15, 12, 10, 12,
+ 13, 9, 9, 11, 14, 15,
+ 11, 14, 13, 13, 13, 15,
+ 13, 13, 14, 12, 14, 13,
+ 13, 13, 12, 13, 14, 14,
+ 13, 11, 11, 15, 13, 11,
+ 12, 13, 15, 12, 12, 13,
+ 14, 14, 14, 13, 13, 13,
+ 13, 13, 12, 13, 14, 13,
+ 10, 14, 13, 11, 10, 11,
+ 11, 11, 11, 11, 12, 12,
+ 11, 12, 13, 12, 11, 13,
+ 10, 12, 11, 10, 11, 13,
+ 12, 10, 12, 12, 12, 11,
+ 12, 10, 12, 12, 10, 10,
+ 11, 11, 11, 11, 9, 10,
+ 11, 10, 10, 9, 12, 12,
+ 9, 11, 11, 10, 9, 10,
+ 13, 14, 13, 12, 10, 10,
+ 14, 14, 10, 11, 11, 13,
+ 13, 11, 13, 13, 12, 11,
+ 10, 11, 11, 10, 10, 9,
+ 12, 12, 9, 11, 12, 13,
+ 12, 12, 11, 12, 13, 11,
+ 11, 12, 12, 12, 12, 13,
+ 15, 14, 14, 13, 12, 16,
+ 14, 12, 11, 12, 16, 15,
+ 12, 13, 15, 13, 13, 12,
+ 12, 12, 12, 11, 10, 13,
+ 13, 10, 10, 12, 13, 10,
+ 10, 10, 11, 11, 11, 11,
+ 12, 12, 11, 13, 12, 12,
+ 13, 13, 11, 12, 13, 11,
+ 11, 12, 12, 11, 13, 13,
+ 13, 13, 13, 10, 14, 11,
+ 11, 10, 11, 11, 11, 10,
+ 11, 12, 13, 12, 11, 10,
+ 12, 12, 10, 11, 10, 11,
+ 12, 11, 13, 12, 14, 13,
+ 11, 12, 13, 14, 12, 11,
+ 11, 14, 14, 12, 12, 13,
+ 13, 13, 12, 12, 12, 12,
+ 11, 10, 12, 12, 10, 13,
+ 14, 13, 12, 12, 13, 13,
+ 13, 12, 12, 14, 13, 12,
+ 14, 12, 11, 14, 13, 11,
+ 11, 13, 12, 11, 13, 14,
+ 12, 14, 14, 14, 13, 14,
+ 12, 13, 13, 13, 13, 13,
+ 13, 12, 13, 10, 12, 14,
+ 15, 13, 10, 13, 12, 11,
+ 11, 12, 13, 13, 11, 11,
+ 12, 13, 12, 16, 11, 13,
+ 16, 14, 16, 15, 15, 16,
+ 13, 11, 14, 13, 12, 11,
+ 11, 15, 13, 11, 9, 13,
+ 14, 11, 10, 12, 15, 14,
+ 12, 11, 13, 13, 10, 11,
+ 11, 14, 14, 11, 12, 13,
+ 13, 11, 13, 12, 14, 16,
+ 12, 16, 13, 15, 15, 13,
+ 12, 13, 14, 14, 10, 11,
+ 14, 14, 11, 10, 13, 13,
+ 9, 12, 14, 16, 12, 13,
+ 13, 12, 13, 13, 12, 14,
+ 14, 13, 14, 14, 15, 14,
+ 13, 12, 13, 11, 11, 11,
+ 13, 13, 13, 14, 13, 13,
+ 14, 14, 12, 14, 16, 14,
+ 13, 12, 13, 14, 13, 12,
+ 12, 12, 12, 12, 11, 12,
+ 14, 11, 12, 12, 12, 11,
+ 11, 14, 14, 13, 13, 11,
+ 12, 14, 12, 11, 14, 11,
+ 13, 13, 11, 12, 13, 13,
+ 12, 12, 11, 12, 12, 12,
+ 11, 12, 13, 11, 10, 13,
+ 13, 11, 10, 11, 11, 11,
+ 11, 11, 13, 12, 11, 14,
+ 13, 12, 13, 12, 11, 14,
+ 12, 11, 12, 13, 13, 11,
+ 13, 13, 13, 12, 12, 10,
+ 12, 12, 10, 10, 10, 11,
+ 11, 11, 12, 15, 15, 13,
+ 12, 13, 14, 14, 14, 13,
+ 16, 14, 13, 15, 14, 14,
+ 16, 15, 13, 14, 15, 13,
+ 14, 14, 14, 13, 15, 13,
+ 14, 13, 14, 13, 16, 14,
+ 12, 12, 13, 13, 12, 13,
+ 13, 14, 13, 13, 13, 11,
+ 14, 14, 12, 14, 13, 13,
+ 12, 13, 13, 14, 15, 14,
+ 13, 12, 15, 15, 13, 14,
+ 12, 14, 14, 13, 14, 15,
+ 13, 13, 13, 13, 13, 13,
+ 12, 12, 15, 14, 12, 13,
+ 15, 14, 12, 12, 12, 12,
+ 15, 12, 12, 13, 14, 12,
+ 13, 13, 13, 14, 14, 13,
+ 13, 14, 13, 14, 14, 14,
+ 13, 14, 14, 13, 13, 13,
+ 12, 14, 13, 12, 12, 13,
+ 14, 12, 12, 16, 15, 15,
+ 13, 13, 13, 14, 14, 13,
+ 13, 12, 12, 14, 13, 13,
+ 12, 14, 14, 14, 12, 12,
+ 14, 14, 16, 13, 16, 14,
+ 14, 16, 14, 13, 14, 13,
+ 14, 14, 14, 13, 13, 16,
+ 13, 13, 11, 15, 15, 12,
+ 12, 13, 14, 15, 12, 11,
+ 13, 13, 11, 13, 11, 14,
+ 14, 14, 14, 11, 15, 14,
+ 13, 14, 14, 14, 14, 14,
+ 15, 15, 13, 11, 14, 13,
+ 12, 11, 12, 15, 15, 12,
+ 12, 14, 15, 11, 11, 13,
+ 14, 15, 12, 13, 13, 13,
+ 11, 13, 13, 15, 14, 12,
+ 14, 14, 13, 13, 14, 15,
+ 16, 16, 13, 13, 14, 16,
+ 14, 12, 12, 14, 11, 11,
+ 13, 15, 15, 12, 16, 14,
+ 14, 14, 15, 13, 14, 14,
+ 13, 13, 13, 13, 13, 13,
+ 14, 14, 14, 14, 14, 13,
+ 15, 14, 12, 14, 15, 16,
+ 16, 13, 14, 15, 15, 14,
+ 16, 14, 14, 14, 14, 13,
+ 14, 16, 13, 13, 14, 14,
+ 12, 12, 12, 14, 12, 13,
+ 12, 14, 13, 12, 14, 15,
+ 15, 13, 13, 12, 13, 13,
+ 13, 13, 14, 13, 12, 13,
+ 13, 13, 13, 13, 12, 14,
+ 14, 12, 12, 12, 14, 13,
+ 13, 12, 12, 12, 14, 13,
+ 12, 14, 15, 12, 13, 12,
+ 12, 14, 13, 14, 15, 16,
+ 14, 15, 13, 16, 16, 13,
+ 13, 13, 14, 14, 13, 12,
+ 13, 14, 13, 13, 12, 14,
+ 13, 12, 11, 14, 14, 12,
+ 7, 10, 15, 16, 10, 7,
+ 12, 13, 7, 11, 11, 15,
+ 16, 12, 12, 14, 14, 13,
+ 16, 14, 16, 16, 16, 15,
+ 16, 16, 15, 15, 13, 14,
+ 14, 13, 12, 13, 16, 13,
+ 12, 9, 12, 13, 9, 9,
+ 13, 13, 9, 8, 10, 16,
+ 14, 10, 11, 13, 13, 10,
+ 13, 12, 15, 14, 12, 16,
+ 16, 15, 15, 14, 15, 15,
+ 16, 13, 12, 14, 14, 13,
+ 10, 13, 12, 11, 9, 11,
+ 16, 14, 11, 9, 12, 15,
+ 15, 11, 9, 13, 15, 9,
+ 11, 11, 14, 14, 12, 12,
+ 14, 13, 14, 14, 14, 15,
+ 15, 15, 14, 14, 16, 16,
+ 14, 12, 13, 13, 13, 11,
+ 11, 16, 13, 12, 14, 13,
+ 13, 10, 11, 15, 12, 12,
+ 16, 12, 16, 14, 11, 11,
+ 13, 14, 11, 14, 11, 15,
+ 15, 13, 14, 14, 16, 15,
+ 16, 15, 14, 15, 14, 14,
+ 16, 14, 12, 12, 14, 12,
+ 12, 12, 12, 16, 14, 12,
+ 15, 15, 16, 16, 14, 16,
+ 14, 13, 12, 14, 14, 15,
+ 16, 13, 12, 11, 14, 13,
+ 16, 12, 12, 16, 16, 14,
+ 14, 16, 16, 15, 14, 15,
+ 15, 14, 12, 13, 15, 14,
+ 15, 15, 14, 14, 16, 16,
+ 14, 16, 16, 14, 14, 14,
+ 14, 13, 14, 13, 16, 15,
+ 14, 14, 14, 14, 14, 16,
+ 15, 16, 14, 14, 16, 16,
+ 15, 16, 15, 13, 16, 16,
+ 15, 14, 14, 14, 15, 14,
+ 14, 15, 15, 14, 11, 15,
+ 15, 12, 10, 12, 16, 15,
+ 13, 11, 14, 13, 11, 13,
+ 13, 16, 15, 12, 15, 15,
+ 15, 14, 14, 16, 16, 15,
+ 14, 13, 14, 15, 14, 12,
+ 14, 13, 11, 13, 12, 14,
+ 15, 11, 9, 12, 15, 15,
+ 11, 9, 12, 13, 9, 10,
+ 12, 14, 14, 10, 12, 13,
+ 14, 12, 14, 15, 15, 16,
+ 15, 14, 14, 14, 15, 14,
+ 12, 13, 13, 13, 12, 11,
+ 13, 14, 12, 10, 12, 13,
+ 9, 7, 13, 13, 7, 6,
+ 9, 14, 15, 9, 10, 14,
+ 12, 9, 13, 13, 15, 16,
+ 12, 14, 16, 16, 15, 15,
+ 14, 14, 14, 13, 12, 13,
+ 14, 12, 11, 13, 13, 10,
+ 9, 10, 15, 14, 10, 6,
+ 12, 16, 15, 12, 10, 15,
+ 13, 10, 12, 13, 14, 15,
+ 12, 13, 13, 13, 13, 15,
+ 14, 15, 15, 15, 16, 15,
+ 16, 16, 15, 14, 15, 15,
+ 13, 11, 12, 16, 16, 12,
+ 9, 14, 14, 8, 9, 13,
+ 13, 8, 9, 11, 16, 14,
+ 11, 11, 13, 14, 11, 13,
+ 13, 14, 14, 13, 14, 15,
+ 15, 13, 13, 15, 15, 15,
+ 13, 12, 16, 16, 13, 10,
+ 13, 13, 10, 6, 11, 16,
+ 16, 10, 9, 12, 14, 16,
+ 11, 10, 13, 13, 10, 11,
+ 12, 16, 14, 12, 12, 15,
+ 14, 14, 15, 14, 16, 15,
+ 14, 14, 14, 16, 16, 15,
+ 12, 14, 15, 13, 11, 11,
+ 15, 14, 11, 9, 13, 14,
+ 9, 11, 14, 14, 11, 15,
+ 13, 15, 16, 12, 13, 14,
+ 13, 12, 13, 14, 15, 13,
+ 13, 14, 15, 16, 13, 16,
+ 16, 15, 15, 13, 13, 15,
+ 15, 14, 11, 14, 14, 13,
+ 10, 12, 15, 14, 12, 16,
+ 13, 16, 16, 14, 16, 14,
+ 15, 15, 13, 13, 16, 15,
+ 13, 15, 16, 14, 14, 16,
+ 16, 16, 15, 15, 15, 15,
+ 14, 16, 15, 13, 14, 15,
+ 15, 13, 13, 15, 16, 14,
+ 12, 14, 14, 16, 15, 14,
+ 15, 16, 13, 13, 14, 15,
+ 13, 13, 14, 14, 16, 14,
+ 14, 14, 15, 14, 16, 15,
+ 14, 15, 14, 15, 15, 16,
+ 12, 13, 13, 15, 12, 12,
+ 13, 13, 16, 16, 12, 13,
+ 13, 14, 14, 11, 13, 14,
+ 11, 15, 13, 14, 16, 12,
+ 12, 12, 13, 11, 13, 13,
+ 13, 15, 14, 13, 15, 15,
+ 14, 14, 16, 14, 14, 14,
+ 14, 15, 14, 11, 11, 13,
+ 13, 11, 14, 11, 16, 14,
+ 12, 9, 11, 14, 14, 11,
+ 10, 12, 13, 10, 11, 12,
+ 13, 16, 11, 12, 13, 14,
+ 16, 16, 14, 14, 16, 14,
+ 13, 15, 16, 14, 15, 13,
+ 14, 12, 11, 11, 11, 15,
+ 15, 11, 9, 13, 13, 9,
+ 9, 14, 14, 9, 9, 11,
+ 16, 14, 11, 11, 13, 12,
+ 11, 13, 12, 13, 15, 12,
+ 13, 13, 15, 14, 14, 15,
+ 16, 15, 13, 12, 16, 14,
+ 12, 10, 13, 13, 10, 8,
+ 10, 16, 14, 10, 13, 15,
+ 16, 13, 13, 13, 14, 14,
+ 12, 13, 14, 14, 13, 14,
+ 14, 14, 14, 14, 13, 14,
+ 16, 14, 14, 16, 15, 14,
+ 14, 14, 15, 15, 15, 13,
+ 15, 16, 13, 13, 14, 14,
+ 15, 12, 14, 14, 14, 13,
+ 13, 12, 13, 13, 12, 13,
+ 13, 13, 12, 13, 13, 14,
+ 13, 13, 14, 14, 14, 14,
+ 13, 13, 12, 14, 16, 14,
+ 14, 15, 14, 14, 13, 12,
+ 13, 13, 13, 11, 13, 14,
+ 12, 13, 15, 14, 12, 13,
+ 13, 14, 12, 12, 13, 14,
+ 13, 13, 13, 13, 15, 14,
+ 13, 14, 13, 13, 12, 12,
+ 13, 13, 12, 14, 13, 13,
+ 14, 13, 12, 14, 13, 13,
+ 12, 13, 12, 12, 12, 14,
+ 15, 14, 13, 16, 13, 15,
+ 15, 13, 14, 13, 14, 13,
+ 13, 14, 14, 13, 14, 15,
+ 13, 15, 16, 13, 13, 13,
+ 14, 16, 13, 14, 14, 14,
+ 13, 14, 13, 13, 13, 13,
+ 14, 14, 14, 13, 11, 14,
+ 14, 13, 11, 13, 16, 14,
+ 13, 11, 14, 13, 12, 14,
+ 13, 16, 14, 13, 13, 15,
+ 14, 13, 14, 13, 15, 14,
+ 13, 12, 13, 15, 14, 10,
+ 12, 14, 13, 10, 12, 15,
+ 14, 12, 12, 14, 16, 12,
+ 11, 12, 15, 14, 12, 12,
+ 13, 13, 11, 12, 12, 13,
+ 15, 13, 14, 15, 14, 15,
+ 15, 15, 11, 13, 13, 12,
+ 14, 13, 11, 11, 13, 13,
+ 11, 11, 12, 14, 16, 12,
+ 14, 13, 14, 16, 13, 13,
+ 13, 15, 13, 13, 14, 13,
+ 14, 14, 15, 14, 16, 14,
+ 14, 14, 15, 16, 14, 15,
+ 13, 15, 12, 12, 15, 14,
+ 11, 12, 13, 13, 14, 14,
+ 11, 12, 13, 15, 13, 12,
+ 14, 14, 13, 13, 12, 12,
+ 14, 12, 13, 12, 13, 13,
+ 15, 13, 12, 14, 13, 12,
+ 16, 13, 12, 13, 15, 12,
+ 14, 14, 14, 14, 12, 13,
+ 12, 14, 13, 12, 12, 12,
+ 13, 14, 12, 13, 13, 14,
+ 13, 13, 12, 13, 14, 11,
+ 12, 12, 13, 13, 12, 13,
+ 14, 15, 14, 14, 13, 14,
+ 14, 13, 13, 14, 15, 14,
+ 13, 14, 14, 13, 14, 13,
+ 12, 13, 13, 13, 12, 14,
+ 14, 11, 11, 12, 12, 13,
+ 12, 10, 13, 13, 10, 12,
+ 11, 12, 12, 11, 13, 13,
+ 14, 12, 16, 13, 14, 15,
+ 13, 13, 13, 15, 15, 13,
+ 13, 14, 16, 14, 13, 12,
+ 12, 12, 12, 11, 13, 13,
+ 10, 10, 14, 13, 10, 10,
+ 11, 11, 11, 10, 10, 12,
+ 13, 10, 13, 12, 11, 12,
+ 13, 12, 12, 12, 11, 11,
+ 12, 13, 12, 13, 13, 12,
+ 13, 13, 11, 12, 13, 11,
+ 10, 11, 11, 11, 10, 12,
+ 12, 13, 12, 12, 11, 13,
+ 12, 11, 11, 11, 12, 11,
+ 11, 12, 13, 13, 12, 14,
+ 11, 12, 14, 12, 12, 11,
+ 12, 13, 11, 12, 13, 13,
+ 13, 12, 11, 11, 13, 12,
+ 10, 13, 12, 11, 13, 15,
+ 15, 13, 13, 13, 13, 12,
+ 13, 13, 14, 13, 13, 14,
+ 14, 13, 13, 14, 11, 13,
+ 13, 13, 12, 11, 13, 13,
+ 14, 13, 12, 13, 15, 12,
+ 14, 13, 13, 13, 13, 15,
+ 13, 13, 14, 12, 16, 15,
+ 13, 9, 13, 13, 11, 10,
+ 12, 14, 14, 12, 11, 14,
+ 13, 12, 16, 13, 14, 15,
+ 13, 14, 13, 14, 16, 14,
+ 11, 12, 15, 12, 11, 11,
+ 15, 16, 11, 10, 12, 13,
+ 11, 10, 12, 16, 15, 12,
+ 11, 12, 13, 9, 10, 12,
+ 13, 15, 11, 12, 13, 13,
+ 16, 15, 14, 15, 16, 13,
+ 13, 14, 16, 13, 12, 12,
+ 13, 12, 12, 11, 12, 14,
+ 14, 12, 10, 12, 13, 10,
+ 13, 13, 14, 13, 13, 13,
+ 12, 13, 12, 13, 13, 13,
+ 13, 14, 14, 13, 13, 14,
+ 13, 13, 13, 11, 13, 12,
+ 11, 12, 13, 13, 13, 12,
+ 12, 12, 14, 13, 12, 12,
+ 12, 12, 13, 13, 11, 11,
+ 13, 12, 12, 10, 12, 13,
+ 11, 12, 11, 12, 12, 12,
+ 13, 13, 14, 12, 13, 12,
+ 14, 15, 12, 12, 11, 14,
+ 13, 11, 13, 14, 12, 13,
+ 11, 11, 12, 11, 10, 10,
+ 13, 13, 10, 10, 13, 13,
+ 10, 10, 10, 12, 11, 11,
+ 10, 12, 13, 11, 13, 12,
+ 13, 12, 12, 12, 12, 13,
+ 11, 11, 13, 12, 11, 14,
+ 13, 13, 12, 12, 11, 13,
+ 12, 11, 10, 11, 12, 11,
+ 10, 9, 12, 13, 9, 9,
+ 10, 10, 10, 10, 10, 12,
+ 13, 11, 13, 12, 12, 12,
+ 13, 11, 14, 12, 11, 10,
+ 11, 11, 10, 13, 13, 12,
+ 14, 12, 11, 13, 12, 11,
+ 9, 10, 10, 10, 10, 10,
+ 10, 10, 11, 10, 9, 12,
+ 12, 9, 10, 10, 10, 10,
+ 11, 11, 12, 13, 13, 11,
+ 11, 15, 14, 11, 10, 10,
+ 12, 16, 10, 12, 12, 14,
+ 12, 11, 10, 10, 10, 10,
+ 9, 13, 12, 9, 11, 13,
+ 13, 11, 10, 11, 11, 11,
+ 10, 10, 12, 12, 11, 13,
+ 11, 11, 13, 13, 11, 13,
+ 13, 11, 10, 11, 15, 10,
+ 13, 12, 12, 15, 12, 11,
+ 12, 13, 11, 11, 11, 11,
+ 10, 10, 13, 13, 14, 14,
+ 13, 13, 14, 13, 12, 13,
+ 13, 15, 13, 12, 13, 14,
+ 14, 13, 11, 12, 13, 15,
+ 12, 12, 11, 13, 16, 14,
+ 14, 14, 14, 14, 12, 13,
+ 13, 13, 12, 12, 14, 14,
+ 12, 9, 14, 14, 10, 9,
+ 11, 16, 14, 11, 16, 13,
+ 13, 10, 11, 12, 15, 14,
+ 12, 14, 14, 14, 13, 13,
+ 13, 16, 16, 11, 11, 16,
+ 15, 12, 9, 13, 14, 10,
+ 10, 11, 14, 15, 11, 11,
+ 13, 14, 10, 9, 11, 15,
+ 15, 11, 10, 13, 12, 9,
+ 11, 13, 15, 14, 11, 13,
+ 14, 13, 13, 13, 13, 14,
+ 13, 16, 13, 15, 13, 12,
+ 10, 13, 13, 10, 10, 11,
+ 13, 15, 11, 13, 12, 13,
+ 13, 13, 12, 13, 13, 12,
+ 13, 12, 13, 12, 13, 13,
+ 15, 14, 13, 11, 12, 14,
+ 14, 11, 12, 14, 16, 13,
+ 13, 13, 14, 13, 12, 13,
+ 12, 12, 13, 12, 12, 13,
+ 14, 12, 10, 13, 13, 11,
+ 10, 10, 12, 11, 11, 11,
+ 13, 12, 11, 13, 12, 13,
+ 12, 12, 11, 13, 12, 10,
+ 10, 13, 11, 11, 13, 13,
+ 12, 11, 12, 11, 12, 12,
+ 10, 10, 10, 11, 11, 11,
+ 9, 10, 11, 10, 11, 9,
+ 11, 12, 9, 10, 10, 10,
+ 10, 11, 12, 13, 14, 12,
+ 10, 11, 13, 13, 11, 10,
+ 10, 12, 12, 11, 13, 13,
+ 13, 12, 10, 11, 11, 10,
+ 10, 9, 12, 11, 8,
+};
+
+static const uint16_t on2avc_cb8_syms[ON2AVC_CB8_CODES] = {
+ 0x0000, 0x0002, 0x0004, 0x000C, 0x000E, 0x0011,
+ 0x0013, 0x001D, 0x001F, 0x0020, 0x0022, 0x0024,
+ 0x002C, 0x002E, 0x0031, 0x0033, 0x003D, 0x003F,
+ 0x0040, 0x0042, 0x0044, 0x004C, 0x004E, 0x00C0,
+ 0x00C2, 0x00C4, 0x00CC, 0x00CE, 0x00D1, 0x00D3,
+ 0x00DD, 0x00DF, 0x00E0, 0x00E2, 0x00E4, 0x00EC,
+ 0x00EE, 0x00F1, 0x00F3, 0x00FD, 0x00FF, 0x0101,
+ 0x0103, 0x010D, 0x010F, 0x0110, 0x0112, 0x0114,
+ 0x011C, 0x011E, 0x0121, 0x0123, 0x012D, 0x012F,
+ 0x0130, 0x0132, 0x0134, 0x013C, 0x013E, 0x0141,
+ 0x0143, 0x014D, 0x014F, 0x01C1, 0x01C3, 0x01CD,
+ 0x01CF, 0x01D0, 0x01D2, 0x01D4, 0x01DC, 0x01DE,
+ 0x01E1, 0x01E3, 0x01ED, 0x01EF, 0x01F0, 0x01F2,
+ 0x01F4, 0x01FC, 0x01FE, 0x0200, 0x0202, 0x0204,
+ 0x020C, 0x020E, 0x0211, 0x0213, 0x021D, 0x021F,
+ 0x0220, 0x0222, 0x0224, 0x022C, 0x022E, 0x0231,
+ 0x0233, 0x023D, 0x023F, 0x0240, 0x0242, 0x0244,
+ 0x024C, 0x024E, 0x02C0, 0x02C2, 0x02C4, 0x02CC,
+ 0x02CE, 0x02D1, 0x02D3, 0x02DD, 0x02DF, 0x02E0,
+ 0x02E2, 0x02E4, 0x02EC, 0x02EE, 0x02F1, 0x02F3,
+ 0x02FD, 0x02FF, 0x0301, 0x0303, 0x030D, 0x030F,
+ 0x0310, 0x0312, 0x0314, 0x031C, 0x031E, 0x0321,
+ 0x0323, 0x032D, 0x032F, 0x0330, 0x0332, 0x0334,
+ 0x033C, 0x033E, 0x0341, 0x0343, 0x034D, 0x034F,
+ 0x03C1, 0x03C3, 0x03CD, 0x03CF, 0x03D0, 0x03D2,
+ 0x03D4, 0x03DC, 0x03DE, 0x03E1, 0x03E3, 0x03ED,
+ 0x03EF, 0x03F0, 0x03F2, 0x03F4, 0x03FC, 0x03FE,
+ 0x0400, 0x0402, 0x0404, 0x040C, 0x040E, 0x0411,
+ 0x0413, 0x041D, 0x041F, 0x0420, 0x0422, 0x0424,
+ 0x042C, 0x042E, 0x0431, 0x0433, 0x043D, 0x043F,
+ 0x0440, 0x0442, 0x0444, 0x044C, 0x044E, 0x04C0,
+ 0x04C2, 0x04C4, 0x04CC, 0x04CE, 0x04D1, 0x04D3,
+ 0x04DD, 0x04DF, 0x04E0, 0x04E2, 0x04E4, 0x04EC,
+ 0x04EE, 0x04F1, 0x04F3, 0x04FD, 0x04FF, 0x0C00,
+ 0x0C02, 0x0C04, 0x0C0C, 0x0C0E, 0x0C11, 0x0C13,
+ 0x0C1D, 0x0C1F, 0x0C20, 0x0C22, 0x0C24, 0x0C2C,
+ 0x0C2E, 0x0C31, 0x0C33, 0x0C3D, 0x0C3F, 0x0C40,
+ 0x0C42, 0x0C44, 0x0C4C, 0x0C4E, 0x0CC0, 0x0CC2,
+ 0x0CC4, 0x0CCC, 0x0CCE, 0x0CD1, 0x0CD3, 0x0CDD,
+ 0x0CDF, 0x0CE0, 0x0CE2, 0x0CE4, 0x0CEC, 0x0CEE,
+ 0x0CF1, 0x0CF3, 0x0CFD, 0x0CFF, 0x0D01, 0x0D03,
+ 0x0D0D, 0x0D0F, 0x0D10, 0x0D12, 0x0D14, 0x0D1C,
+ 0x0D1E, 0x0D21, 0x0D23, 0x0D2D, 0x0D2F, 0x0D30,
+ 0x0D32, 0x0D34, 0x0D3C, 0x0D3E, 0x0D41, 0x0D43,
+ 0x0D4D, 0x0D4F, 0x0DC1, 0x0DC3, 0x0DCD, 0x0DCF,
+ 0x0DD0, 0x0DD2, 0x0DD4, 0x0DDC, 0x0DDE, 0x0DE1,
+ 0x0DE3, 0x0DED, 0x0DEF, 0x0DF0, 0x0DF2, 0x0DF4,
+ 0x0DFC, 0x0DFE, 0x0E00, 0x0E02, 0x0E04, 0x0E0C,
+ 0x0E0E, 0x0E11, 0x0E13, 0x0E1D, 0x0E1F, 0x0E20,
+ 0x0E22, 0x0E24, 0x0E2C, 0x0E2E, 0x0E31, 0x0E33,
+ 0x0E3D, 0x0E3F, 0x0E40, 0x0E42, 0x0E44, 0x0E4C,
+ 0x0E4E, 0x0EC0, 0x0EC2, 0x0EC4, 0x0ECC, 0x0ECE,
+ 0x0ED1, 0x0ED3, 0x0EDD, 0x0EDF, 0x0EE0, 0x0EE2,
+ 0x0EE4, 0x0EEC, 0x0EEE, 0x0EF1, 0x0EF3, 0x0EFD,
+ 0x0EFF, 0x0F01, 0x0F03, 0x0F0D, 0x0F0F, 0x0F10,
+ 0x0F12, 0x0F14, 0x0F1C, 0x0F1E, 0x0F21, 0x0F23,
+ 0x0F2D, 0x0F2F, 0x0F30, 0x0F32, 0x0F34, 0x0F3C,
+ 0x0F3E, 0x0F41, 0x0F43, 0x0F4D, 0x0F4F, 0x0FC1,
+ 0x0FC3, 0x0FCD, 0x0FCF, 0x0FD0, 0x0FD2, 0x0FD4,
+ 0x0FDC, 0x0FDE, 0x0FE1, 0x0FE3, 0x0FED, 0x0FEF,
+ 0x0FF0, 0x0FF2, 0x0FF4, 0x0FFC, 0x0FFE, 0x1001,
+ 0x1003, 0x100D, 0x100F, 0x1010, 0x1012, 0x1014,
+ 0x101C, 0x101E, 0x1021, 0x1023, 0x102D, 0x102F,
+ 0x1030, 0x1032, 0x1034, 0x103C, 0x103E, 0x1041,
+ 0x1043, 0x104D, 0x104F, 0x10C1, 0x10C3, 0x10CD,
+ 0x10CF, 0x10D0, 0x10D2, 0x10D4, 0x10DC, 0x10DE,
+ 0x10E1, 0x10E3, 0x10ED, 0x10EF, 0x10F0, 0x10F2,
+ 0x10F4, 0x10FC, 0x10FE, 0x1100, 0x1102, 0x1104,
+ 0x110C, 0x110E, 0x1111, 0x1113, 0x111D, 0x111F,
+ 0x1120, 0x1122, 0x1124, 0x112C, 0x112E, 0x1131,
+ 0x1133, 0x113D, 0x113F, 0x1140, 0x1142, 0x1144,
+ 0x114C, 0x114E, 0x11C0, 0x11C2, 0x11C4, 0x11CC,
+ 0x11CE, 0x11D1, 0x11D3, 0x11DD, 0x11DF, 0x11E0,
+ 0x11E2, 0x11E4, 0x11EC, 0x11EE, 0x11F1, 0x11F3,
+ 0x11FD, 0x11FF, 0x1201, 0x1203, 0x120D, 0x120F,
+ 0x1210, 0x1212, 0x1214, 0x121C, 0x121E, 0x1221,
+ 0x1223, 0x122D, 0x122F, 0x1230, 0x1232, 0x1234,
+ 0x123C, 0x123E, 0x1241, 0x1243, 0x124D, 0x124F,
+ 0x12C1, 0x12C3, 0x12CD, 0x12CF, 0x12D0, 0x12D2,
+ 0x12D4, 0x12DC, 0x12DE, 0x12E1, 0x12E3, 0x12ED,
+ 0x12EF, 0x12F0, 0x12F2, 0x12F4, 0x12FC, 0x12FE,
+ 0x1300, 0x1302, 0x1304, 0x130C, 0x130E, 0x1311,
+ 0x1313, 0x131D, 0x131F, 0x1320, 0x1322, 0x1324,
+ 0x132C, 0x132E, 0x1331, 0x1333, 0x133D, 0x133F,
+ 0x1340, 0x1342, 0x1344, 0x134C, 0x134E, 0x13C0,
+ 0x13C2, 0x13C4, 0x13CC, 0x13CE, 0x13D1, 0x13D3,
+ 0x13DD, 0x13DF, 0x13E0, 0x13E2, 0x13E4, 0x13EC,
+ 0x13EE, 0x13F1, 0x13F3, 0x13FD, 0x13FF, 0x1401,
+ 0x1403, 0x140D, 0x140F, 0x1410, 0x1412, 0x1414,
+ 0x141C, 0x141E, 0x1421, 0x1423, 0x142D, 0x142F,
+ 0x1430, 0x1432, 0x1434, 0x143C, 0x143E, 0x1441,
+ 0x1443, 0x144D, 0x144F, 0x14C1, 0x14C3, 0x14CD,
+ 0x14CF, 0x14D0, 0x14D2, 0x14D4, 0x14DC, 0x14DE,
+ 0x14E1, 0x14E3, 0x14ED, 0x14EF, 0x14F0, 0x14F2,
+ 0x14F4, 0x14FC, 0x14FE, 0x1C01, 0x1C03, 0x1C0D,
+ 0x1C0F, 0x1C10, 0x1C12, 0x1C14, 0x1C1C, 0x1C1E,
+ 0x1C21, 0x1C23, 0x1C2D, 0x1C2F, 0x1C30, 0x1C32,
+ 0x1C34, 0x1C3C, 0x1C3E, 0x1C41, 0x1C43, 0x1C4D,
+ 0x1C4F, 0x1CC1, 0x1CC3, 0x1CCD, 0x1CCF, 0x1CD0,
+ 0x1CD2, 0x1CD4, 0x1CDC, 0x1CDE, 0x1CE1, 0x1CE3,
+ 0x1CED, 0x1CEF, 0x1CF0, 0x1CF2, 0x1CF4, 0x1CFC,
+ 0x1CFE, 0x1D00, 0x1D02, 0x1D04, 0x1D0C, 0x1D0E,
+ 0x1D11, 0x1D13, 0x1D1D, 0x1D1F, 0x1D20, 0x1D22,
+ 0x1D24, 0x1D2C, 0x1D2E, 0x1D31, 0x1D33, 0x1D3D,
+ 0x1D3F, 0x1D40, 0x1D42, 0x1D44, 0x1D4C, 0x1D4E,
+ 0x1DC0, 0x1DC2, 0x1DC4, 0x1DCC, 0x1DCE, 0x1DD1,
+ 0x1DD3, 0x1DDD, 0x1DDF, 0x1DE0, 0x1DE2, 0x1DE4,
+ 0x1DEC, 0x1DEE, 0x1DF1, 0x1DF3, 0x1DFD, 0x1DFF,
+ 0x1E01, 0x1E03, 0x1E0D, 0x1E0F, 0x1E10, 0x1E12,
+ 0x1E14, 0x1E1C, 0x1E1E, 0x1E21, 0x1E23, 0x1E2D,
+ 0x1E2F, 0x1E30, 0x1E32, 0x1E34, 0x1E3C, 0x1E3E,
+ 0x1E41, 0x1E43, 0x1E4D, 0x1E4F, 0x1EC1, 0x1EC3,
+ 0x1ECD, 0x1ECF, 0x1ED0, 0x1ED2, 0x1ED4, 0x1EDC,
+ 0x1EDE, 0x1EE1, 0x1EE3, 0x1EED, 0x1EEF, 0x1EF0,
+ 0x1EF2, 0x1EF4, 0x1EFC, 0x1EFE, 0x1F00, 0x1F02,
+ 0x1F04, 0x1F0C, 0x1F0E, 0x1F11, 0x1F13, 0x1F1D,
+ 0x1F1F, 0x1F20, 0x1F22, 0x1F24, 0x1F2C, 0x1F2E,
+ 0x1F31, 0x1F33, 0x1F3D, 0x1F3F, 0x1F40, 0x1F42,
+ 0x1F44, 0x1F4C, 0x1F4E, 0x1FC0, 0x1FC2, 0x1FC4,
+ 0x1FCC, 0x1FCE, 0x1FD1, 0x1FD3, 0x1FDD, 0x1FDF,
+ 0x1FE0, 0x1FE2, 0x1FE4, 0x1FEC, 0x1FEE, 0x1FF1,
+ 0x1FF3, 0x1FFD, 0x1FFF, 0x2000, 0x2002, 0x2004,
+ 0x200C, 0x200E, 0x2011, 0x2013, 0x201D, 0x201F,
+ 0x2020, 0x2022, 0x2024, 0x202C, 0x202E, 0x2031,
+ 0x2033, 0x203D, 0x203F, 0x2040, 0x2042, 0x2044,
+ 0x204C, 0x204E, 0x20C0, 0x20C2, 0x20C4, 0x20CC,
+ 0x20CE, 0x20D1, 0x20D3, 0x20DD, 0x20DF, 0x20E0,
+ 0x20E2, 0x20E4, 0x20EC, 0x20EE, 0x20F1, 0x20F3,
+ 0x20FD, 0x20FF, 0x2101, 0x2103, 0x210D, 0x210F,
+ 0x2110, 0x2112, 0x2114, 0x211C, 0x211E, 0x2121,
+ 0x2123, 0x212D, 0x212F, 0x2130, 0x2132, 0x2134,
+ 0x213C, 0x213E, 0x2141, 0x2143, 0x214D, 0x214F,
+ 0x21C1, 0x21C3, 0x21CD, 0x21CF, 0x21D0, 0x21D2,
+ 0x21D4, 0x21DC, 0x21DE, 0x21E1, 0x21E3, 0x21ED,
+ 0x21EF, 0x21F0, 0x21F2, 0x21F4, 0x21FC, 0x21FE,
+ 0x2200, 0x2202, 0x2204, 0x220C, 0x220E, 0x2211,
+ 0x2213, 0x221D, 0x221F, 0x2220, 0x2222, 0x2224,
+ 0x222C, 0x222E, 0x2231, 0x2233, 0x223D, 0x223F,
+ 0x2240, 0x2242, 0x2244, 0x224C, 0x224E, 0x22C0,
+ 0x22C2, 0x22C4, 0x22CC, 0x22CE, 0x22D1, 0x22D3,
+ 0x22DD, 0x22DF, 0x22E0, 0x22E2, 0x22E4, 0x22EC,
+ 0x22EE, 0x22F1, 0x22F3, 0x22FD, 0x22FF, 0x2301,
+ 0x2303, 0x230D, 0x230F, 0x2310, 0x2312, 0x2314,
+ 0x231C, 0x231E, 0x2321, 0x2323, 0x232D, 0x232F,
+ 0x2330, 0x2332, 0x2334, 0x233C, 0x233E, 0x2341,
+ 0x2343, 0x234D, 0x234F, 0x23C1, 0x23C3, 0x23CD,
+ 0x23CF, 0x23D0, 0x23D2, 0x23D4, 0x23DC, 0x23DE,
+ 0x23E1, 0x23E3, 0x23ED, 0x23EF, 0x23F0, 0x23F2,
+ 0x23F4, 0x23FC, 0x23FE, 0x2400, 0x2402, 0x2404,
+ 0x240C, 0x240E, 0x2411, 0x2413, 0x241D, 0x241F,
+ 0x2420, 0x2422, 0x2424, 0x242C, 0x242E, 0x2431,
+ 0x2433, 0x243D, 0x243F, 0x2440, 0x2442, 0x2444,
+ 0x244C, 0x244E, 0x24C0, 0x24C2, 0x24C4, 0x24CC,
+ 0x24CE, 0x24D1, 0x24D3, 0x24DD, 0x24DF, 0x24E0,
+ 0x24E2, 0x24E4, 0x24EC, 0x24EE, 0x24F1, 0x24F3,
+ 0x24FD, 0x24FF, 0x2C00, 0x2C02, 0x2C04, 0x2C0C,
+ 0x2C0E, 0x2C11, 0x2C13, 0x2C1D, 0x2C1F, 0x2C20,
+ 0x2C22, 0x2C24, 0x2C2C, 0x2C2E, 0x2C31, 0x2C33,
+ 0x2C3D, 0x2C3F, 0x2C40, 0x2C42, 0x2C44, 0x2C4C,
+ 0x2C4E, 0x2CC0, 0x2CC2, 0x2CC4, 0x2CCC, 0x2CCE,
+ 0x2CD1, 0x2CD3, 0x2CDD, 0x2CDF, 0x2CE0, 0x2CE2,
+ 0x2CE4, 0x2CEC, 0x2CEE, 0x2CF1, 0x2CF3, 0x2CFD,
+ 0x2CFF, 0x2D01, 0x2D03, 0x2D0D, 0x2D0F, 0x2D10,
+ 0x2D12, 0x2D14, 0x2D1C, 0x2D1E, 0x2D21, 0x2D23,
+ 0x2D2D, 0x2D2F, 0x2D30, 0x2D32, 0x2D34, 0x2D3C,
+ 0x2D3E, 0x2D41, 0x2D43, 0x2D4D, 0x2D4F, 0x2DC1,
+ 0x2DC3, 0x2DCD, 0x2DCF, 0x2DD0, 0x2DD2, 0x2DD4,
+ 0x2DDC, 0x2DDE, 0x2DE1, 0x2DE3, 0x2DED, 0x2DEF,
+ 0x2DF0, 0x2DF2, 0x2DF4, 0x2DFC, 0x2DFE, 0x2E00,
+ 0x2E02, 0x2E04, 0x2E0C, 0x2E0E, 0x2E11, 0x2E13,
+ 0x2E1D, 0x2E1F, 0x2E20, 0x2E22, 0x2E24, 0x2E2C,
+ 0x2E2E, 0x2E31, 0x2E33, 0x2E3D, 0x2E3F, 0x2E40,
+ 0x2E42, 0x2E44, 0x2E4C, 0x2E4E, 0x2EC0, 0x2EC2,
+ 0x2EC4, 0x2ECC, 0x2ECE, 0x2ED1, 0x2ED3, 0x2EDD,
+ 0x2EDF, 0x2EE0, 0x2EE2, 0x2EE4, 0x2EEC, 0x2EEE,
+ 0x2EF1, 0x2EF3, 0x2EFD, 0x2EFF, 0x2F01, 0x2F03,
+ 0x2F0D, 0x2F0F, 0x2F10, 0x2F12, 0x2F14, 0x2F1C,
+ 0x2F1E, 0x2F21, 0x2F23, 0x2F2D, 0x2F2F, 0x2F30,
+ 0x2F32, 0x2F34, 0x2F3C, 0x2F3E, 0x2F41, 0x2F43,
+ 0x2F4D, 0x2F4F, 0x2FC1, 0x2FC3, 0x2FCD, 0x2FCF,
+ 0x2FD0, 0x2FD2, 0x2FD4, 0x2FDC, 0x2FDE, 0x2FE1,
+ 0x2FE3, 0x2FED, 0x2FEF, 0x2FF0, 0x2FF2, 0x2FF4,
+ 0x2FFC, 0x2FFE, 0x3001, 0x3003, 0x300D, 0x300F,
+ 0x3010, 0x3012, 0x3014, 0x301C, 0x301E, 0x3021,
+ 0x3023, 0x302D, 0x302F, 0x3030, 0x3032, 0x3034,
+ 0x303C, 0x303E, 0x3041, 0x3043, 0x304D, 0x304F,
+ 0x30C1, 0x30C3, 0x30CD, 0x30CF, 0x30D0, 0x30D2,
+ 0x30D4, 0x30DC, 0x30DE, 0x30E1, 0x30E3, 0x30ED,
+ 0x30EF, 0x30F0, 0x30F2, 0x30F4, 0x30FC, 0x30FE,
+ 0x3100, 0x3102, 0x3104, 0x310C, 0x310E, 0x3111,
+ 0x3113, 0x311D, 0x311F, 0x3120, 0x3122, 0x3124,
+ 0x312C, 0x312E, 0x3131, 0x3133, 0x313D, 0x313F,
+ 0x3140, 0x3142, 0x3144, 0x314C, 0x314E, 0x31C0,
+ 0x31C2, 0x31C4, 0x31CC, 0x31CE, 0x31D1, 0x31D3,
+ 0x31DD, 0x31DF, 0x31E0, 0x31E2, 0x31E4, 0x31EC,
+ 0x31EE, 0x31F1, 0x31F3, 0x31FD, 0x31FF, 0x3201,
+ 0x3203, 0x320D, 0x320F, 0x3210, 0x3212, 0x3214,
+ 0x321C, 0x321E, 0x3221, 0x3223, 0x322D, 0x322F,
+ 0x3230, 0x3232, 0x3234, 0x323C, 0x323E, 0x3241,
+ 0x3243, 0x324D, 0x324F, 0x32C1, 0x32C3, 0x32CD,
+ 0x32CF, 0x32D0, 0x32D2, 0x32D4, 0x32DC, 0x32DE,
+ 0x32E1, 0x32E3, 0x32ED, 0x32EF, 0x32F0, 0x32F2,
+ 0x32F4, 0x32FC, 0x32FE, 0x3300, 0x3302, 0x3304,
+ 0x330C, 0x330E, 0x3311, 0x3313, 0x331D, 0x331F,
+ 0x3320, 0x3322, 0x3324, 0x332C, 0x332E, 0x3331,
+ 0x3333, 0x333D, 0x333F, 0x3340, 0x3342, 0x3344,
+ 0x334C, 0x334E, 0x33C0, 0x33C2, 0x33C4, 0x33CC,
+ 0x33CE, 0x33D1, 0x33D3, 0x33DD, 0x33DF, 0x33E0,
+ 0x33E2, 0x33E4, 0x33EC, 0x33EE, 0x33F1, 0x33F3,
+ 0x33FD, 0x33FF, 0x3401, 0x3403, 0x340D, 0x340F,
+ 0x3410, 0x3412, 0x3414, 0x341C, 0x341E, 0x3421,
+ 0x3423, 0x342D, 0x342F, 0x3430, 0x3432, 0x3434,
+ 0x343C, 0x343E, 0x3441, 0x3443, 0x344D, 0x344F,
+ 0x34C1, 0x34C3, 0x34CD, 0x34CF, 0x34D0, 0x34D2,
+ 0x34D4, 0x34DC, 0x34DE, 0x34E1, 0x34E3, 0x34ED,
+ 0x34EF, 0x34F0, 0x34F2, 0x34F4, 0x34FC, 0x34FE,
+ 0x3C01, 0x3C03, 0x3C0D, 0x3C0F, 0x3C10, 0x3C12,
+ 0x3C14, 0x3C1C, 0x3C1E, 0x3C21, 0x3C23, 0x3C2D,
+ 0x3C2F, 0x3C30, 0x3C32, 0x3C34, 0x3C3C, 0x3C3E,
+ 0x3C41, 0x3C43, 0x3C4D, 0x3C4F, 0x3CC1, 0x3CC3,
+ 0x3CCD, 0x3CCF, 0x3CD0, 0x3CD2, 0x3CD4, 0x3CDC,
+ 0x3CDE, 0x3CE1, 0x3CE3, 0x3CED, 0x3CEF, 0x3CF0,
+ 0x3CF2, 0x3CF4, 0x3CFC, 0x3CFE, 0x3D00, 0x3D02,
+ 0x3D04, 0x3D0C, 0x3D0E, 0x3D11, 0x3D13, 0x3D1D,
+ 0x3D1F, 0x3D20, 0x3D22, 0x3D24, 0x3D2C, 0x3D2E,
+ 0x3D31, 0x3D33, 0x3D3D, 0x3D3F, 0x3D40, 0x3D42,
+ 0x3D44, 0x3D4C, 0x3D4E, 0x3DC0, 0x3DC2, 0x3DC4,
+ 0x3DCC, 0x3DCE, 0x3DD1, 0x3DD3, 0x3DDD, 0x3DDF,
+ 0x3DE0, 0x3DE2, 0x3DE4, 0x3DEC, 0x3DEE, 0x3DF1,
+ 0x3DF3, 0x3DFD, 0x3DFF, 0x3E01, 0x3E03, 0x3E0D,
+ 0x3E0F, 0x3E10, 0x3E12, 0x3E14, 0x3E1C, 0x3E1E,
+ 0x3E21, 0x3E23, 0x3E2D, 0x3E2F, 0x3E30, 0x3E32,
+ 0x3E34, 0x3E3C, 0x3E3E, 0x3E41, 0x3E43, 0x3E4D,
+ 0x3E4F, 0x3EC1, 0x3EC3, 0x3ECD, 0x3ECF, 0x3ED0,
+ 0x3ED2, 0x3ED4, 0x3EDC, 0x3EDE, 0x3EE1, 0x3EE3,
+ 0x3EED, 0x3EEF, 0x3EF0, 0x3EF2, 0x3EF4, 0x3EFC,
+ 0x3EFE, 0x3F00, 0x3F02, 0x3F04, 0x3F0C, 0x3F0E,
+ 0x3F11, 0x3F13, 0x3F1D, 0x3F1F, 0x3F20, 0x3F22,
+ 0x3F24, 0x3F2C, 0x3F2E, 0x3F31, 0x3F33, 0x3F3D,
+ 0x3F3F, 0x3F40, 0x3F42, 0x3F44, 0x3F4C, 0x3F4E,
+ 0x3FC0, 0x3FC2, 0x3FC4, 0x3FCC, 0x3FCE, 0x3FD1,
+ 0x3FD3, 0x3FDD, 0x3FDF, 0x3FE0, 0x3FE2, 0x3FE4,
+ 0x3FEC, 0x3FEE, 0x3FF1, 0x3FF3, 0x3FFD, 0x3FFF,
+ 0x4000, 0x4002, 0x4004, 0x400C, 0x400E, 0x4011,
+ 0x4013, 0x401D, 0x401F, 0x4020, 0x4022, 0x4024,
+ 0x402C, 0x402E, 0x4031, 0x4033, 0x403D, 0x403F,
+ 0x4040, 0x4042, 0x4044, 0x404C, 0x404E, 0x40C0,
+ 0x40C2, 0x40C4, 0x40CC, 0x40CE, 0x40D1, 0x40D3,
+ 0x40DD, 0x40DF, 0x40E0, 0x40E2, 0x40E4, 0x40EC,
+ 0x40EE, 0x40F1, 0x40F3, 0x40FD, 0x40FF, 0x4101,
+ 0x4103, 0x410D, 0x410F, 0x4110, 0x4112, 0x4114,
+ 0x411C, 0x411E, 0x4121, 0x4123, 0x412D, 0x412F,
+ 0x4130, 0x4132, 0x4134, 0x413C, 0x413E, 0x4141,
+ 0x4143, 0x414D, 0x414F, 0x41C1, 0x41C3, 0x41CD,
+ 0x41CF, 0x41D0, 0x41D2, 0x41D4, 0x41DC, 0x41DE,
+ 0x41E1, 0x41E3, 0x41ED, 0x41EF, 0x41F0, 0x41F2,
+ 0x41F4, 0x41FC, 0x41FE, 0x4200, 0x4202, 0x4204,
+ 0x420C, 0x420E, 0x4211, 0x4213, 0x421D, 0x421F,
+ 0x4220, 0x4222, 0x4224, 0x422C, 0x422E, 0x4231,
+ 0x4233, 0x423D, 0x423F, 0x4240, 0x4242, 0x4244,
+ 0x424C, 0x424E, 0x42C0, 0x42C2, 0x42C4, 0x42CC,
+ 0x42CE, 0x42D1, 0x42D3, 0x42DD, 0x42DF, 0x42E0,
+ 0x42E2, 0x42E4, 0x42EC, 0x42EE, 0x42F1, 0x42F3,
+ 0x42FD, 0x42FF, 0x4301, 0x4303, 0x430D, 0x430F,
+ 0x4310, 0x4312, 0x4314, 0x431C, 0x431E, 0x4321,
+ 0x4323, 0x432D, 0x432F, 0x4330, 0x4332, 0x4334,
+ 0x433C, 0x433E, 0x4341, 0x4343, 0x434D, 0x434F,
+ 0x43C1, 0x43C3, 0x43CD, 0x43CF, 0x43D0, 0x43D2,
+ 0x43D4, 0x43DC, 0x43DE, 0x43E1, 0x43E3, 0x43ED,
+ 0x43EF, 0x43F0, 0x43F2, 0x43F4, 0x43FC, 0x43FE,
+ 0x4400, 0x4402, 0x4404, 0x440C, 0x440E, 0x4411,
+ 0x4413, 0x441D, 0x441F, 0x4420, 0x4422, 0x4424,
+ 0x442C, 0x442E, 0x4431, 0x4433, 0x443D, 0x443F,
+ 0x4440, 0x4442, 0x4444, 0x444C, 0x444E, 0x44C0,
+ 0x44C2, 0x44C4, 0x44CC, 0x44CE, 0x44D1, 0x44D3,
+ 0x44DD, 0x44DF, 0x44E0, 0x44E2, 0x44E4, 0x44EC,
+ 0x44EE, 0x44F1, 0x44F3, 0x44FD, 0x44FF, 0x4C00,
+ 0x4C02, 0x4C04, 0x4C0C, 0x4C0E, 0x4C11, 0x4C13,
+ 0x4C1D, 0x4C1F, 0x4C20, 0x4C22, 0x4C24, 0x4C2C,
+ 0x4C2E, 0x4C31, 0x4C33, 0x4C3D, 0x4C3F, 0x4C40,
+ 0x4C42, 0x4C44, 0x4C4C, 0x4C4E, 0x4CC0, 0x4CC2,
+ 0x4CC4, 0x4CCC, 0x4CCE, 0x4CD1, 0x4CD3, 0x4CDD,
+ 0x4CDF, 0x4CE0, 0x4CE2, 0x4CE4, 0x4CEC, 0x4CEE,
+ 0x4CF1, 0x4CF3, 0x4CFD, 0x4CFF, 0x4D01, 0x4D03,
+ 0x4D0D, 0x4D0F, 0x4D10, 0x4D12, 0x4D14, 0x4D1C,
+ 0x4D1E, 0x4D21, 0x4D23, 0x4D2D, 0x4D2F, 0x4D30,
+ 0x4D32, 0x4D34, 0x4D3C, 0x4D3E, 0x4D41, 0x4D43,
+ 0x4D4D, 0x4D4F, 0x4DC1, 0x4DC3, 0x4DCD, 0x4DCF,
+ 0x4DD0, 0x4DD2, 0x4DD4, 0x4DDC, 0x4DDE, 0x4DE1,
+ 0x4DE3, 0x4DED, 0x4DEF, 0x4DF0, 0x4DF2, 0x4DF4,
+ 0x4DFC, 0x4DFE, 0x4E00, 0x4E02, 0x4E04, 0x4E0C,
+ 0x4E0E, 0x4E11, 0x4E13, 0x4E1D, 0x4E1F, 0x4E20,
+ 0x4E22, 0x4E24, 0x4E2C, 0x4E2E, 0x4E31, 0x4E33,
+ 0x4E3D, 0x4E3F, 0x4E40, 0x4E42, 0x4E44, 0x4E4C,
+ 0x4E4E, 0x4EC0, 0x4EC2, 0x4EC4, 0x4ECC, 0x4ECE,
+ 0x4ED1, 0x4ED3, 0x4EDD, 0x4EDF, 0x4EE0, 0x4EE2,
+ 0x4EE4, 0x4EEC, 0x4EEE, 0x4EF1, 0x4EF3, 0x4EFD,
+ 0x4EFF, 0x4F01, 0x4F03, 0x4F0D, 0x4F0F, 0x4F10,
+ 0x4F12, 0x4F14, 0x4F1C, 0x4F1E, 0x4F21, 0x4F23,
+ 0x4F2D, 0x4F2F, 0x4F30, 0x4F32, 0x4F34, 0x4F3C,
+ 0x4F3E, 0x4F41, 0x4F43, 0x4F4D, 0x4F4F, 0x4FC1,
+ 0x4FC3, 0x4FCD, 0x4FCF, 0x4FD0, 0x4FD2, 0x4FD4,
+ 0x4FDC, 0x4FDE, 0x4FE1, 0x4FE3, 0x4FED, 0x4FEF,
+ 0x4FF0, 0x4FF2, 0x4FF4, 0x4FFC, 0x4FFE, 0xC000,
+ 0xC002, 0xC004, 0xC00C, 0xC00E, 0xC011, 0xC013,
+ 0xC01D, 0xC01F, 0xC020, 0xC022, 0xC024, 0xC02C,
+ 0xC02E, 0xC031, 0xC033, 0xC03D, 0xC03F, 0xC040,
+ 0xC042, 0xC044, 0xC04C, 0xC04E, 0xC0C0, 0xC0C2,
+ 0xC0C4, 0xC0CC, 0xC0CE, 0xC0D1, 0xC0D3, 0xC0DD,
+ 0xC0DF, 0xC0E0, 0xC0E2, 0xC0E4, 0xC0EC, 0xC0EE,
+ 0xC0F1, 0xC0F3, 0xC0FD, 0xC0FF, 0xC101, 0xC103,
+ 0xC10D, 0xC10F, 0xC110, 0xC112, 0xC114, 0xC11C,
+ 0xC11E, 0xC121, 0xC123, 0xC12D, 0xC12F, 0xC130,
+ 0xC132, 0xC134, 0xC13C, 0xC13E, 0xC141, 0xC143,
+ 0xC14D, 0xC14F, 0xC1C1, 0xC1C3, 0xC1CD, 0xC1CF,
+ 0xC1D0, 0xC1D2, 0xC1D4, 0xC1DC, 0xC1DE, 0xC1E1,
+ 0xC1E3, 0xC1ED, 0xC1EF, 0xC1F0, 0xC1F2, 0xC1F4,
+ 0xC1FC, 0xC1FE, 0xC200, 0xC202, 0xC204, 0xC20C,
+ 0xC20E, 0xC211, 0xC213, 0xC21D, 0xC21F, 0xC220,
+ 0xC222, 0xC224, 0xC22C, 0xC22E, 0xC231, 0xC233,
+ 0xC23D, 0xC23F, 0xC240, 0xC242, 0xC244, 0xC24C,
+ 0xC24E, 0xC2C0, 0xC2C2, 0xC2C4, 0xC2CC, 0xC2CE,
+ 0xC2D1, 0xC2D3, 0xC2DD, 0xC2DF, 0xC2E0, 0xC2E2,
+ 0xC2E4, 0xC2EC, 0xC2EE, 0xC2F1, 0xC2F3, 0xC2FD,
+ 0xC2FF, 0xC301, 0xC303, 0xC30D, 0xC30F, 0xC310,
+ 0xC312, 0xC314, 0xC31C, 0xC31E, 0xC321, 0xC323,
+ 0xC32D, 0xC32F, 0xC330, 0xC332, 0xC334, 0xC33C,
+ 0xC33E, 0xC341, 0xC343, 0xC34D, 0xC34F, 0xC3C1,
+ 0xC3C3, 0xC3CD, 0xC3CF, 0xC3D0, 0xC3D2, 0xC3D4,
+ 0xC3DC, 0xC3DE, 0xC3E1, 0xC3E3, 0xC3ED, 0xC3EF,
+ 0xC3F0, 0xC3F2, 0xC3F4, 0xC3FC, 0xC3FE, 0xC400,
+ 0xC402, 0xC404, 0xC40C, 0xC40E, 0xC411, 0xC413,
+ 0xC41D, 0xC41F, 0xC420, 0xC422, 0xC424, 0xC42C,
+ 0xC42E, 0xC431, 0xC433, 0xC43D, 0xC43F, 0xC440,
+ 0xC442, 0xC444, 0xC44C, 0xC44E, 0xC4C0, 0xC4C2,
+ 0xC4C4, 0xC4CC, 0xC4CE, 0xC4D1, 0xC4D3, 0xC4DD,
+ 0xC4DF, 0xC4E0, 0xC4E2, 0xC4E4, 0xC4EC, 0xC4EE,
+ 0xC4F1, 0xC4F3, 0xC4FD, 0xC4FF, 0xCC00, 0xCC02,
+ 0xCC04, 0xCC0C, 0xCC0E, 0xCC11, 0xCC13, 0xCC1D,
+ 0xCC1F, 0xCC20, 0xCC22, 0xCC24, 0xCC2C, 0xCC2E,
+ 0xCC31, 0xCC33, 0xCC3D, 0xCC3F, 0xCC40, 0xCC42,
+ 0xCC44, 0xCC4C, 0xCC4E, 0xCCC0, 0xCCC2, 0xCCC4,
+ 0xCCCC, 0xCCCE, 0xCCD1, 0xCCD3, 0xCCDD, 0xCCDF,
+ 0xCCE0, 0xCCE2, 0xCCE4, 0xCCEC, 0xCCEE, 0xCCF1,
+ 0xCCF3, 0xCCFD, 0xCCFF, 0xCD01, 0xCD03, 0xCD0D,
+ 0xCD0F, 0xCD10, 0xCD12, 0xCD14, 0xCD1C, 0xCD1E,
+ 0xCD21, 0xCD23, 0xCD2D, 0xCD2F, 0xCD30, 0xCD32,
+ 0xCD34, 0xCD3C, 0xCD3E, 0xCD41, 0xCD43, 0xCD4D,
+ 0xCD4F, 0xCDC1, 0xCDC3, 0xCDCD, 0xCDCF, 0xCDD0,
+ 0xCDD2, 0xCDD4, 0xCDDC, 0xCDDE, 0xCDE1, 0xCDE3,
+ 0xCDED, 0xCDEF, 0xCDF0, 0xCDF2, 0xCDF4, 0xCDFC,
+ 0xCDFE, 0xCE00, 0xCE02, 0xCE04, 0xCE0C, 0xCE0E,
+ 0xCE11, 0xCE13, 0xCE1D, 0xCE1F, 0xCE20, 0xCE22,
+ 0xCE24, 0xCE2C, 0xCE2E, 0xCE31, 0xCE33, 0xCE3D,
+ 0xCE3F, 0xCE40, 0xCE42, 0xCE44, 0xCE4C, 0xCE4E,
+ 0xCEC0, 0xCEC2, 0xCEC4, 0xCECC, 0xCECE, 0xCED1,
+ 0xCED3, 0xCEDD, 0xCEDF, 0xCEE0, 0xCEE2, 0xCEE4,
+ 0xCEEC, 0xCEEE, 0xCEF1, 0xCEF3, 0xCEFD, 0xCEFF,
+ 0xCF01, 0xCF03, 0xCF0D, 0xCF0F, 0xCF10, 0xCF12,
+ 0xCF14, 0xCF1C, 0xCF1E, 0xCF21, 0xCF23, 0xCF2D,
+ 0xCF2F, 0xCF30, 0xCF32, 0xCF34, 0xCF3C, 0xCF3E,
+ 0xCF41, 0xCF43, 0xCF4D, 0xCF4F, 0xCFC1, 0xCFC3,
+ 0xCFCD, 0xCFCF, 0xCFD0, 0xCFD2, 0xCFD4, 0xCFDC,
+ 0xCFDE, 0xCFE1, 0xCFE3, 0xCFED, 0xCFEF, 0xCFF0,
+ 0xCFF2, 0xCFF4, 0xCFFC, 0xCFFE, 0xD001, 0xD003,
+ 0xD00D, 0xD00F, 0xD010, 0xD012, 0xD014, 0xD01C,
+ 0xD01E, 0xD021, 0xD023, 0xD02D, 0xD02F, 0xD030,
+ 0xD032, 0xD034, 0xD03C, 0xD03E, 0xD041, 0xD043,
+ 0xD04D, 0xD04F, 0xD0C1, 0xD0C3, 0xD0CD, 0xD0CF,
+ 0xD0D0, 0xD0D2, 0xD0D4, 0xD0DC, 0xD0DE, 0xD0E1,
+ 0xD0E3, 0xD0ED, 0xD0EF, 0xD0F0, 0xD0F2, 0xD0F4,
+ 0xD0FC, 0xD0FE, 0xD100, 0xD102, 0xD104, 0xD10C,
+ 0xD10E, 0xD111, 0xD113, 0xD11D, 0xD11F, 0xD120,
+ 0xD122, 0xD124, 0xD12C, 0xD12E, 0xD131, 0xD133,
+ 0xD13D, 0xD13F, 0xD140, 0xD142, 0xD144, 0xD14C,
+ 0xD14E, 0xD1C0, 0xD1C2, 0xD1C4, 0xD1CC, 0xD1CE,
+ 0xD1D1, 0xD1D3, 0xD1DD, 0xD1DF, 0xD1E0, 0xD1E2,
+ 0xD1E4, 0xD1EC, 0xD1EE, 0xD1F1, 0xD1F3, 0xD1FD,
+ 0xD1FF, 0xD201, 0xD203, 0xD20D, 0xD20F, 0xD210,
+ 0xD212, 0xD214, 0xD21C, 0xD21E, 0xD221, 0xD223,
+ 0xD22D, 0xD22F, 0xD230, 0xD232, 0xD234, 0xD23C,
+ 0xD23E, 0xD241, 0xD243, 0xD24D, 0xD24F, 0xD2C1,
+ 0xD2C3, 0xD2CD, 0xD2CF, 0xD2D0, 0xD2D2, 0xD2D4,
+ 0xD2DC, 0xD2DE, 0xD2E1, 0xD2E3, 0xD2ED, 0xD2EF,
+ 0xD2F0, 0xD2F2, 0xD2F4, 0xD2FC, 0xD2FE, 0xD300,
+ 0xD302, 0xD304, 0xD30C, 0xD30E, 0xD311, 0xD313,
+ 0xD31D, 0xD31F, 0xD320, 0xD322, 0xD324, 0xD32C,
+ 0xD32E, 0xD331, 0xD333, 0xD33D, 0xD33F, 0xD340,
+ 0xD342, 0xD344, 0xD34C, 0xD34E, 0xD3C0, 0xD3C2,
+ 0xD3C4, 0xD3CC, 0xD3CE, 0xD3D1, 0xD3D3, 0xD3DD,
+ 0xD3DF, 0xD3E0, 0xD3E2, 0xD3E4, 0xD3EC, 0xD3EE,
+ 0xD3F1, 0xD3F3, 0xD3FD, 0xD3FF, 0xD401, 0xD403,
+ 0xD40D, 0xD40F, 0xD410, 0xD412, 0xD414, 0xD41C,
+ 0xD41E, 0xD421, 0xD423, 0xD42D, 0xD42F, 0xD430,
+ 0xD432, 0xD434, 0xD43C, 0xD43E, 0xD441, 0xD443,
+ 0xD44D, 0xD44F, 0xD4C1, 0xD4C3, 0xD4CD, 0xD4CF,
+ 0xD4D0, 0xD4D2, 0xD4D4, 0xD4DC, 0xD4DE, 0xD4E1,
+ 0xD4E3, 0xD4ED, 0xD4EF, 0xD4F0, 0xD4F2, 0xD4F4,
+ 0xD4FC, 0xD4FE, 0xDC01, 0xDC03, 0xDC0D, 0xDC0F,
+ 0xDC10, 0xDC12, 0xDC14, 0xDC1C, 0xDC1E, 0xDC21,
+ 0xDC23, 0xDC2D, 0xDC2F, 0xDC30, 0xDC32, 0xDC34,
+ 0xDC3C, 0xDC3E, 0xDC41, 0xDC43, 0xDC4D, 0xDC4F,
+ 0xDCC1, 0xDCC3, 0xDCCD, 0xDCCF, 0xDCD0, 0xDCD2,
+ 0xDCD4, 0xDCDC, 0xDCDE, 0xDCE1, 0xDCE3, 0xDCED,
+ 0xDCEF, 0xDCF0, 0xDCF2, 0xDCF4, 0xDCFC, 0xDCFE,
+ 0xDD00, 0xDD02, 0xDD04, 0xDD0C, 0xDD0E, 0xDD11,
+ 0xDD13, 0xDD1D, 0xDD1F, 0xDD20, 0xDD22, 0xDD24,
+ 0xDD2C, 0xDD2E, 0xDD31, 0xDD33, 0xDD3D, 0xDD3F,
+ 0xDD40, 0xDD42, 0xDD44, 0xDD4C, 0xDD4E, 0xDDC0,
+ 0xDDC2, 0xDDC4, 0xDDCC, 0xDDCE, 0xDDD1, 0xDDD3,
+ 0xDDDD, 0xDDDF, 0xDDE0, 0xDDE2, 0xDDE4, 0xDDEC,
+ 0xDDEE, 0xDDF1, 0xDDF3, 0xDDFD, 0xDDFF, 0xDE01,
+ 0xDE03, 0xDE0D, 0xDE0F, 0xDE10, 0xDE12, 0xDE14,
+ 0xDE1C, 0xDE1E, 0xDE21, 0xDE23, 0xDE2D, 0xDE2F,
+ 0xDE30, 0xDE32, 0xDE34, 0xDE3C, 0xDE3E, 0xDE41,
+ 0xDE43, 0xDE4D, 0xDE4F, 0xDEC1, 0xDEC3, 0xDECD,
+ 0xDECF, 0xDED0, 0xDED2, 0xDED4, 0xDEDC, 0xDEDE,
+ 0xDEE1, 0xDEE3, 0xDEED, 0xDEEF, 0xDEF0, 0xDEF2,
+ 0xDEF4, 0xDEFC, 0xDEFE, 0xDF00, 0xDF02, 0xDF04,
+ 0xDF0C, 0xDF0E, 0xDF11, 0xDF13, 0xDF1D, 0xDF1F,
+ 0xDF20, 0xDF22, 0xDF24, 0xDF2C, 0xDF2E, 0xDF31,
+ 0xDF33, 0xDF3D, 0xDF3F, 0xDF40, 0xDF42, 0xDF44,
+ 0xDF4C, 0xDF4E, 0xDFC0, 0xDFC2, 0xDFC4, 0xDFCC,
+ 0xDFCE, 0xDFD1, 0xDFD3, 0xDFDD, 0xDFDF, 0xDFE0,
+ 0xDFE2, 0xDFE4, 0xDFEC, 0xDFEE, 0xDFF1, 0xDFF3,
+ 0xDFFD, 0xDFFF, 0xE000, 0xE002, 0xE004, 0xE00C,
+ 0xE00E, 0xE011, 0xE013, 0xE01D, 0xE01F, 0xE020,
+ 0xE022, 0xE024, 0xE02C, 0xE02E, 0xE031, 0xE033,
+ 0xE03D, 0xE03F, 0xE040, 0xE042, 0xE044, 0xE04C,
+ 0xE04E, 0xE0C0, 0xE0C2, 0xE0C4, 0xE0CC, 0xE0CE,
+ 0xE0D1, 0xE0D3, 0xE0DD, 0xE0DF, 0xE0E0, 0xE0E2,
+ 0xE0E4, 0xE0EC, 0xE0EE, 0xE0F1, 0xE0F3, 0xE0FD,
+ 0xE0FF, 0xE101, 0xE103, 0xE10D, 0xE10F, 0xE110,
+ 0xE112, 0xE114, 0xE11C, 0xE11E, 0xE121, 0xE123,
+ 0xE12D, 0xE12F, 0xE130, 0xE132, 0xE134, 0xE13C,
+ 0xE13E, 0xE141, 0xE143, 0xE14D, 0xE14F, 0xE1C1,
+ 0xE1C3, 0xE1CD, 0xE1CF, 0xE1D0, 0xE1D2, 0xE1D4,
+ 0xE1DC, 0xE1DE, 0xE1E1, 0xE1E3, 0xE1ED, 0xE1EF,
+ 0xE1F0, 0xE1F2, 0xE1F4, 0xE1FC, 0xE1FE, 0xE200,
+ 0xE202, 0xE204, 0xE20C, 0xE20E, 0xE211, 0xE213,
+ 0xE21D, 0xE21F, 0xE220, 0xE222, 0xE224, 0xE22C,
+ 0xE22E, 0xE231, 0xE233, 0xE23D, 0xE23F, 0xE240,
+ 0xE242, 0xE244, 0xE24C, 0xE24E, 0xE2C0, 0xE2C2,
+ 0xE2C4, 0xE2CC, 0xE2CE, 0xE2D1, 0xE2D3, 0xE2DD,
+ 0xE2DF, 0xE2E0, 0xE2E2, 0xE2E4, 0xE2EC, 0xE2EE,
+ 0xE2F1, 0xE2F3, 0xE2FD, 0xE2FF, 0xE301, 0xE303,
+ 0xE30D, 0xE30F, 0xE310, 0xE312, 0xE314, 0xE31C,
+ 0xE31E, 0xE321, 0xE323, 0xE32D, 0xE32F, 0xE330,
+ 0xE332, 0xE334, 0xE33C, 0xE33E, 0xE341, 0xE343,
+ 0xE34D, 0xE34F, 0xE3C1, 0xE3C3, 0xE3CD, 0xE3CF,
+ 0xE3D0, 0xE3D2, 0xE3D4, 0xE3DC, 0xE3DE, 0xE3E1,
+ 0xE3E3, 0xE3ED, 0xE3EF, 0xE3F0, 0xE3F2, 0xE3F4,
+ 0xE3FC, 0xE3FE, 0xE400, 0xE402, 0xE404, 0xE40C,
+ 0xE40E, 0xE411, 0xE413, 0xE41D, 0xE41F, 0xE420,
+ 0xE422, 0xE424, 0xE42C, 0xE42E, 0xE431, 0xE433,
+ 0xE43D, 0xE43F, 0xE440, 0xE442, 0xE444, 0xE44C,
+ 0xE44E, 0xE4C0, 0xE4C2, 0xE4C4, 0xE4CC, 0xE4CE,
+ 0xE4D1, 0xE4D3, 0xE4DD, 0xE4DF, 0xE4E0, 0xE4E2,
+ 0xE4E4, 0xE4EC, 0xE4EE, 0xE4F1, 0xE4F3, 0xE4FD,
+ 0xE4FF, 0xEC00, 0xEC02, 0xEC04, 0xEC0C, 0xEC0E,
+ 0xEC11, 0xEC13, 0xEC1D, 0xEC1F, 0xEC20, 0xEC22,
+ 0xEC24, 0xEC2C, 0xEC2E, 0xEC31, 0xEC33, 0xEC3D,
+ 0xEC3F, 0xEC40, 0xEC42, 0xEC44, 0xEC4C, 0xEC4E,
+ 0xECC0, 0xECC2, 0xECC4, 0xECCC, 0xECCE, 0xECD1,
+ 0xECD3, 0xECDD, 0xECDF, 0xECE0, 0xECE2, 0xECE4,
+ 0xECEC, 0xECEE, 0xECF1, 0xECF3, 0xECFD, 0xECFF,
+ 0xED01, 0xED03, 0xED0D, 0xED0F, 0xED10, 0xED12,
+ 0xED14, 0xED1C, 0xED1E, 0xED21, 0xED23, 0xED2D,
+ 0xED2F, 0xED30, 0xED32, 0xED34, 0xED3C, 0xED3E,
+ 0xED41, 0xED43, 0xED4D, 0xED4F, 0xEDC1, 0xEDC3,
+ 0xEDCD, 0xEDCF, 0xEDD0, 0xEDD2, 0xEDD4, 0xEDDC,
+ 0xEDDE, 0xEDE1, 0xEDE3, 0xEDED, 0xEDEF, 0xEDF0,
+ 0xEDF2, 0xEDF4, 0xEDFC, 0xEDFE, 0xEE00, 0xEE02,
+ 0xEE04, 0xEE0C, 0xEE0E, 0xEE11, 0xEE13, 0xEE1D,
+ 0xEE1F, 0xEE20, 0xEE22, 0xEE24, 0xEE2C, 0xEE2E,
+ 0xEE31, 0xEE33, 0xEE3D, 0xEE3F, 0xEE40, 0xEE42,
+ 0xEE44, 0xEE4C, 0xEE4E, 0xEEC0, 0xEEC2, 0xEEC4,
+ 0xEECC, 0xEECE, 0xEED1, 0xEED3, 0xEEDD, 0xEEDF,
+ 0xEEE0, 0xEEE2, 0xEEE4, 0xEEEC, 0xEEEE, 0xEEF1,
+ 0xEEF3, 0xEEFD, 0xEEFF, 0xEF01, 0xEF03, 0xEF0D,
+ 0xEF0F, 0xEF10, 0xEF12, 0xEF14, 0xEF1C, 0xEF1E,
+ 0xEF21, 0xEF23, 0xEF2D, 0xEF2F, 0xEF30, 0xEF32,
+ 0xEF34, 0xEF3C, 0xEF3E, 0xEF41, 0xEF43, 0xEF4D,
+ 0xEF4F, 0xEFC1, 0xEFC3, 0xEFCD, 0xEFCF, 0xEFD0,
+ 0xEFD2, 0xEFD4, 0xEFDC, 0xEFDE, 0xEFE1, 0xEFE3,
+ 0xEFED, 0xEFEF, 0xEFF0, 0xEFF2, 0xEFF4, 0xEFFC,
+ 0xEFFE, 0xF001, 0xF003, 0xF00D, 0xF00F, 0xF010,
+ 0xF012, 0xF014, 0xF01C, 0xF01E, 0xF021, 0xF023,
+ 0xF02D, 0xF02F, 0xF030, 0xF032, 0xF034, 0xF03C,
+ 0xF03E, 0xF041, 0xF043, 0xF04D, 0xF04F, 0xF0C1,
+ 0xF0C3, 0xF0CD, 0xF0CF, 0xF0D0, 0xF0D2, 0xF0D4,
+ 0xF0DC, 0xF0DE, 0xF0E1, 0xF0E3, 0xF0ED, 0xF0EF,
+ 0xF0F0, 0xF0F2, 0xF0F4, 0xF0FC, 0xF0FE, 0xF100,
+ 0xF102, 0xF104, 0xF10C, 0xF10E, 0xF111, 0xF113,
+ 0xF11D, 0xF11F, 0xF120, 0xF122, 0xF124, 0xF12C,
+ 0xF12E, 0xF131, 0xF133, 0xF13D, 0xF13F, 0xF140,
+ 0xF142, 0xF144, 0xF14C, 0xF14E, 0xF1C0, 0xF1C2,
+ 0xF1C4, 0xF1CC, 0xF1CE, 0xF1D1, 0xF1D3, 0xF1DD,
+ 0xF1DF, 0xF1E0, 0xF1E2, 0xF1E4, 0xF1EC, 0xF1EE,
+ 0xF1F1, 0xF1F3, 0xF1FD, 0xF1FF, 0xF201, 0xF203,
+ 0xF20D, 0xF20F, 0xF210, 0xF212, 0xF214, 0xF21C,
+ 0xF21E, 0xF221, 0xF223, 0xF22D, 0xF22F, 0xF230,
+ 0xF232, 0xF234, 0xF23C, 0xF23E, 0xF241, 0xF243,
+ 0xF24D, 0xF24F, 0xF2C1, 0xF2C3, 0xF2CD, 0xF2CF,
+ 0xF2D0, 0xF2D2, 0xF2D4, 0xF2DC, 0xF2DE, 0xF2E1,
+ 0xF2E3, 0xF2ED, 0xF2EF, 0xF2F0, 0xF2F2, 0xF2F4,
+ 0xF2FC, 0xF2FE, 0xF300, 0xF302, 0xF304, 0xF30C,
+ 0xF30E, 0xF311, 0xF313, 0xF31D, 0xF31F, 0xF320,
+ 0xF322, 0xF324, 0xF32C, 0xF32E, 0xF331, 0xF333,
+ 0xF33D, 0xF33F, 0xF340, 0xF342, 0xF344, 0xF34C,
+ 0xF34E, 0xF3C0, 0xF3C2, 0xF3C4, 0xF3CC, 0xF3CE,
+ 0xF3D1, 0xF3D3, 0xF3DD, 0xF3DF, 0xF3E0, 0xF3E2,
+ 0xF3E4, 0xF3EC, 0xF3EE, 0xF3F1, 0xF3F3, 0xF3FD,
+ 0xF3FF, 0xF401, 0xF403, 0xF40D, 0xF40F, 0xF410,
+ 0xF412, 0xF414, 0xF41C, 0xF41E, 0xF421, 0xF423,
+ 0xF42D, 0xF42F, 0xF430, 0xF432, 0xF434, 0xF43C,
+ 0xF43E, 0xF441, 0xF443, 0xF44D, 0xF44F, 0xF4C1,
+ 0xF4C3, 0xF4CD, 0xF4CF, 0xF4D0, 0xF4D2, 0xF4D4,
+ 0xF4DC, 0xF4DE, 0xF4E1, 0xF4E3, 0xF4ED, 0xF4EF,
+ 0xF4F0, 0xF4F2, 0xF4F4, 0xF4FC, 0xF4FE, 0xFC01,
+ 0xFC03, 0xFC0D, 0xFC0F, 0xFC10, 0xFC12, 0xFC14,
+ 0xFC1C, 0xFC1E, 0xFC21, 0xFC23, 0xFC2D, 0xFC2F,
+ 0xFC30, 0xFC32, 0xFC34, 0xFC3C, 0xFC3E, 0xFC41,
+ 0xFC43, 0xFC4D, 0xFC4F, 0xFCC1, 0xFCC3, 0xFCCD,
+ 0xFCCF, 0xFCD0, 0xFCD2, 0xFCD4, 0xFCDC, 0xFCDE,
+ 0xFCE1, 0xFCE3, 0xFCED, 0xFCEF, 0xFCF0, 0xFCF2,
+ 0xFCF4, 0xFCFC, 0xFCFE, 0xFD00, 0xFD02, 0xFD04,
+ 0xFD0C, 0xFD0E, 0xFD11, 0xFD13, 0xFD1D, 0xFD1F,
+ 0xFD20, 0xFD22, 0xFD24, 0xFD2C, 0xFD2E, 0xFD31,
+ 0xFD33, 0xFD3D, 0xFD3F, 0xFD40, 0xFD42, 0xFD44,
+ 0xFD4C, 0xFD4E, 0xFDC0, 0xFDC2, 0xFDC4, 0xFDCC,
+ 0xFDCE, 0xFDD1, 0xFDD3, 0xFDDD, 0xFDDF, 0xFDE0,
+ 0xFDE2, 0xFDE4, 0xFDEC, 0xFDEE, 0xFDF1, 0xFDF3,
+ 0xFDFD, 0xFDFF, 0xFE01, 0xFE03, 0xFE0D, 0xFE0F,
+ 0xFE10, 0xFE12, 0xFE14, 0xFE1C, 0xFE1E, 0xFE21,
+ 0xFE23, 0xFE2D, 0xFE2F, 0xFE30, 0xFE32, 0xFE34,
+ 0xFE3C, 0xFE3E, 0xFE41, 0xFE43, 0xFE4D, 0xFE4F,
+ 0xFEC1, 0xFEC3, 0xFECD, 0xFECF, 0xFED0, 0xFED2,
+ 0xFED4, 0xFEDC, 0xFEDE, 0xFEE1, 0xFEE3, 0xFEED,
+ 0xFEEF, 0xFEF0, 0xFEF2, 0xFEF4, 0xFEFC, 0xFEFE,
+ 0xFF00, 0xFF02, 0xFF04, 0xFF0C, 0xFF0E, 0xFF11,
+ 0xFF13, 0xFF1D, 0xFF1F, 0xFF20, 0xFF22, 0xFF24,
+ 0xFF2C, 0xFF2E, 0xFF31, 0xFF33, 0xFF3D, 0xFF3F,
+ 0xFF40, 0xFF42, 0xFF44, 0xFF4C, 0xFF4E, 0xFFC0,
+ 0xFFC2, 0xFFC4, 0xFFCC, 0xFFCE, 0xFFD1, 0xFFD3,
+ 0xFFDD, 0xFFDF, 0xFFE0, 0xFFE2, 0xFFE4, 0xFFEC,
+ 0xFFEE, 0xFFF1, 0xFFF3, 0xFFFD, 0xFFFF,
+};
+
+#define ON2AVC_CB9_CODES 121
+static const uint16_t on2avc_cb9_codes[ON2AVC_CB9_CODES] = {
+ 0x0000, 0x000F, 0x0098, 0x026E, 0x045C, 0x00A6,
+ 0x00AC, 0x045D, 0x027E, 0x009A, 0x0012, 0x000E,
+ 0x001A, 0x00DE, 0x022C, 0x053E, 0x00A2, 0x009E,
+ 0x0538, 0x01B2, 0x00BA, 0x0018, 0x00AD, 0x00BF,
+ 0x01BE, 0x037E, 0x05C6, 0x0132, 0x0112, 0x08B5,
+ 0x0457, 0x01B6, 0x00BC, 0x02AE, 0x022A, 0x045E,
+ 0x08B6, 0x08FA, 0x0147, 0x013E, 0x119F, 0x05C7,
+ 0x044F, 0x0170, 0x0456, 0x047F, 0x06C7, 0x0A72,
+ 0x0D8B, 0x0267, 0x0266, 0x0D8A, 0x08B7, 0x05CF,
+ 0x045F, 0x0054, 0x00A4, 0x0118, 0x0142, 0x0234,
+ 0x036F, 0x036E, 0x029E, 0x0156, 0x0114, 0x0088,
+ 0x00A0, 0x00A5, 0x00DA, 0x015F, 0x026F, 0x02E2,
+ 0x02E6, 0x0236, 0x015E, 0x0143, 0x00AA, 0x053A,
+ 0x0466, 0x04FE, 0x09FE, 0x119E, 0x0232, 0x0237,
+ 0x0A73, 0x09FF, 0x08B4, 0x046B, 0x02AF, 0x01B0,
+ 0x037F, 0x053F, 0x08FB, 0x0136, 0x0146, 0x08CE,
+ 0x05CE, 0x044E, 0x01B3, 0x008E, 0x00DD, 0x0226,
+ 0x047E, 0x06C6, 0x00AE, 0x011E, 0x06C4, 0x047C,
+ 0x0172, 0x00BE, 0x0010, 0x0016, 0x00BD, 0x0176,
+ 0x053B, 0x009D, 0x009C, 0x046A, 0x0177, 0x00DC,
+ 0x0019,
+};
+
+static const uint8_t on2avc_cb9_bits[ON2AVC_CB9_CODES] = {
+ 1, 4, 8, 10, 11, 8,
+ 8, 11, 10, 8, 5, 4,
+ 5, 8, 10, 11, 8, 8,
+ 11, 9, 8, 5, 8, 8,
+ 9, 10, 11, 9, 9, 12,
+ 11, 9, 8, 10, 10, 11,
+ 12, 12, 9, 9, 13, 11,
+ 11, 9, 11, 11, 11, 12,
+ 12, 10, 10, 12, 12, 11,
+ 11, 7, 8, 9, 9, 10,
+ 10, 10, 10, 9, 9, 8,
+ 8, 8, 8, 9, 10, 10,
+ 10, 10, 9, 9, 8, 11,
+ 11, 11, 12, 13, 10, 10,
+ 12, 12, 12, 11, 10, 9,
+ 10, 11, 12, 9, 9, 12,
+ 11, 11, 9, 8, 8, 10,
+ 11, 11, 8, 9, 11, 11,
+ 9, 8, 5, 5, 8, 9,
+ 11, 8, 8, 11, 9, 8,
+ 5,
+};
+
+static const uint16_t on2avc_cb9_syms[ON2AVC_CB9_CODES] = {
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005,
+ 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0100,
+ 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x01FB,
+ 0x01FC, 0x01FD, 0x01FE, 0x01FF, 0x0200, 0x0201,
+ 0x0202, 0x0203, 0x0204, 0x0205, 0x02FB, 0x02FC,
+ 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302,
+ 0x0303, 0x0304, 0x0305, 0x03FB, 0x03FC, 0x03FD,
+ 0x03FE, 0x03FF, 0x0400, 0x0401, 0x0402, 0x0403,
+ 0x0404, 0x0405, 0x04FB, 0x04FC, 0x04FD, 0x04FE,
+ 0x04FF, 0x0500, 0x0501, 0x0502, 0x0503, 0x0504,
+ 0x0505, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF,
+ 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05,
+ 0xFBFB, 0xFBFC, 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00,
+ 0xFC01, 0xFC02, 0xFC03, 0xFC04, 0xFC05, 0xFCFB,
+ 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF, 0xFD00, 0xFD01,
+ 0xFD02, 0xFD03, 0xFD04, 0xFD05, 0xFDFB, 0xFDFC,
+ 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02,
+ 0xFE03, 0xFE04, 0xFE05, 0xFEFB, 0xFEFC, 0xFEFD,
+ 0xFEFE, 0xFEFF, 0xFF00, 0xFF01, 0xFF02, 0xFF03,
+ 0xFF04, 0xFF05, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE,
+ 0xFFFF,
+};
+
+#define ON2AVC_CB10_CODES 121
+static const uint16_t on2avc_cb10_codes[ON2AVC_CB10_CODES] = {
+ 0x002E, 0x001A, 0x003C, 0x001F, 0x006E, 0x002E,
+ 0x00AE, 0x006F, 0x002A, 0x003E, 0x0014, 0x0016,
+ 0x0002, 0x000E, 0x004E, 0x00F7, 0x0042, 0x0027,
+ 0x00F6, 0x0046, 0x0014, 0x0008, 0x0032, 0x0016,
+ 0x0030, 0x0012, 0x0056, 0x0018, 0x005F, 0x00DE,
+ 0x006E, 0x0036, 0x001A, 0x0023, 0x003D, 0x003F,
+ 0x007A, 0x008E, 0x0071, 0x0006, 0x0012, 0x000F,
+ 0x0043, 0x003E, 0x00AE, 0x0001, 0x00AB, 0x00C7,
+ 0x0013, 0x000A, 0x0002, 0x01CA, 0x0003, 0x0000,
+ 0x000F, 0x0022, 0x0016, 0x002A, 0x007F, 0x001C,
+ 0x0036, 0x00AF, 0x00C6, 0x000E, 0x0010, 0x0006,
+ 0x008F, 0x001E, 0x0054, 0x000D, 0x00AA, 0x0056,
+ 0x00AC, 0x001D, 0x0076, 0x0013, 0x004F, 0x0057,
+ 0x00E6, 0x00EE, 0x000E, 0x01CB, 0x00AF, 0x000B,
+ 0x0007, 0x00EF, 0x00AD, 0x00E4, 0x0008, 0x005E,
+ 0x0070, 0x001E, 0x00DF, 0x000C, 0x007E, 0x00CE,
+ 0x0002, 0x001A, 0x003C, 0x0002, 0x0020, 0x003A,
+ 0x004D, 0x00CF, 0x0066, 0x0026, 0x002F, 0x001F,
+ 0x0022, 0x001B, 0x0012, 0x000E, 0x0017, 0x0062,
+ 0x00E7, 0x0019, 0x0014, 0x0006, 0x004C, 0x0012,
+ 0x000C,
+};
+
+static const uint8_t on2avc_cb10_bits[ON2AVC_CB10_CODES] = {
+ 6, 5, 6, 8, 9, 8,
+ 8, 9, 8, 6, 5, 5,
+ 5, 6, 7, 8, 7, 7,
+ 8, 7, 6, 5, 6, 6,
+ 6, 7, 8, 7, 7, 8,
+ 7, 6, 6, 8, 7, 7,
+ 7, 8, 7, 8, 9, 8,
+ 7, 7, 9, 9, 8, 8,
+ 9, 8, 9, 9, 9, 9,
+ 9, 8, 7, 7, 7, 8,
+ 8, 9, 8, 8, 7, 6,
+ 8, 7, 7, 8, 8, 9,
+ 8, 8, 7, 7, 7, 9,
+ 8, 8, 9, 9, 8, 8,
+ 9, 8, 8, 8, 8, 7,
+ 7, 8, 8, 8, 7, 8,
+ 8, 7, 7, 7, 6, 6,
+ 7, 8, 7, 7, 8, 7,
+ 6, 6, 5, 5, 6, 7,
+ 8, 7, 7, 9, 7, 6,
+ 5,
+};
+
+static const uint16_t on2avc_cb10_syms[ON2AVC_CB10_CODES] = {
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005,
+ 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0100,
+ 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x01FB,
+ 0x01FC, 0x01FD, 0x01FE, 0x01FF, 0x0200, 0x0201,
+ 0x0202, 0x0203, 0x0204, 0x0205, 0x02FB, 0x02FC,
+ 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302,
+ 0x0303, 0x0304, 0x0305, 0x03FB, 0x03FC, 0x03FD,
+ 0x03FE, 0x03FF, 0x0400, 0x0401, 0x0402, 0x0403,
+ 0x0404, 0x0405, 0x04FB, 0x04FC, 0x04FD, 0x04FE,
+ 0x04FF, 0x0500, 0x0501, 0x0502, 0x0503, 0x0504,
+ 0x0505, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF,
+ 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05,
+ 0xFBFB, 0xFBFC, 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00,
+ 0xFC01, 0xFC02, 0xFC03, 0xFC04, 0xFC05, 0xFCFB,
+ 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF, 0xFD00, 0xFD01,
+ 0xFD02, 0xFD03, 0xFD04, 0xFD05, 0xFDFB, 0xFDFC,
+ 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02,
+ 0xFE03, 0xFE04, 0xFE05, 0xFEFB, 0xFEFC, 0xFEFD,
+ 0xFEFE, 0xFEFF, 0xFF00, 0xFF01, 0xFF02, 0xFF03,
+ 0xFF04, 0xFF05, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE,
+ 0xFFFF,
+};
+
+#define ON2AVC_CB11_CODES 225
+static const uint16_t on2avc_cb11_codes[ON2AVC_CB11_CODES] = {
+ 0x0000, 0x000E, 0x0056, 0x00CD, 0x0173, 0x0232,
+ 0x00C7, 0x014F, 0x01AA, 0x00BE, 0x026F, 0x0192,
+ 0x00BC, 0x0058, 0x000F, 0x000C, 0x0010, 0x004E,
+ 0x0082, 0x0142, 0x01BF, 0x0098, 0x015E, 0x0136,
+ 0x0086, 0x01BB, 0x014E, 0x00BA, 0x003E, 0x0012,
+ 0x0054, 0x0036, 0x0050, 0x008F, 0x014B, 0x0262,
+ 0x00AA, 0x015C, 0x013E, 0x00B7, 0x02BE, 0x0176,
+ 0x00A2, 0x0058, 0x003C, 0x00C2, 0x00A6, 0x008A,
+ 0x00B2, 0x0122, 0x02AC, 0x00CA, 0x012F, 0x014A,
+ 0x00DC, 0x02DE, 0x017A, 0x0134, 0x0092, 0x00B4,
+ 0x0166, 0x0148, 0x016E, 0x013F, 0x0134, 0x02FF,
+ 0x014F, 0x019E, 0x0267, 0x016C, 0x02A6, 0x02CE,
+ 0x013A, 0x010A, 0x0108, 0x026E, 0x02CB, 0x028E,
+ 0x02CF, 0x020F, 0x02DF, 0x010B, 0x02AD, 0x0227,
+ 0x018A, 0x04DB, 0x02A7, 0x02FE, 0x0236, 0x026C,
+ 0x00C6, 0x009C, 0x00C4, 0x00CE, 0x00D6, 0x0135,
+ 0x0156, 0x025A, 0x02FF, 0x0286, 0x015F, 0x0132,
+ 0x00D7, 0x00AC, 0x00A2, 0x0176, 0x0118, 0x0123,
+ 0x0157, 0x01BC, 0x02AE, 0x02EE, 0x04DA, 0x0467,
+ 0x033F, 0x0287, 0x0193, 0x0182, 0x013B, 0x0112,
+ 0x0133, 0x017D, 0x0117, 0x0186, 0x026E, 0x025B,
+ 0x02EF, 0x0466, 0x0316, 0x0237, 0x02F6, 0x01BA,
+ 0x015D, 0x012E, 0x015A, 0x014A, 0x008E, 0x00B6,
+ 0x0135, 0x0100, 0x017B, 0x028C, 0x033E, 0x0297,
+ 0x015B, 0x0102, 0x0140, 0x00D4, 0x00BA, 0x0088,
+ 0x02EE, 0x0283, 0x02BF, 0x020E, 0x02CE, 0x0317,
+ 0x0172, 0x0296, 0x026F, 0x0101, 0x02CF, 0x02F7,
+ 0x01BD, 0x02EF, 0x028F, 0x0263, 0x0164, 0x011A,
+ 0x0147, 0x0292, 0x02FE, 0x015E, 0x02AF, 0x01AB,
+ 0x0130, 0x02CA, 0x0183, 0x014E, 0x017C, 0x017E,
+ 0x00C8, 0x00AA, 0x009E, 0x0132, 0x0152, 0x0226,
+ 0x00CC, 0x017E, 0x0187, 0x00CB, 0x0293, 0x0106,
+ 0x00C0, 0x0087, 0x00BC, 0x005C, 0x003D, 0x005A,
+ 0x00A8, 0x0103, 0x028D, 0x00A4, 0x0116, 0x0146,
+ 0x00B8, 0x01BE, 0x016D, 0x0093, 0x004A, 0x003F,
+ 0x000D, 0x0011, 0x004F, 0x00AE, 0x0166, 0x0266,
+ 0x0090, 0x0109, 0x012C, 0x00A6, 0x0282, 0x017A,
+ 0x00B5, 0x0034, 0x000E,
+};
+
+static const uint8_t on2avc_cb11_bits[ON2AVC_CB11_CODES] = {
+ 2, 4, 7, 9, 10, 11,
+ 9, 10, 10, 9, 11, 10,
+ 9, 7, 4, 4, 5, 7,
+ 9, 9, 10, 9, 10, 10,
+ 9, 10, 9, 8, 7, 5,
+ 7, 7, 8, 9, 9, 10,
+ 9, 10, 10, 9, 10, 9,
+ 9, 8, 7, 9, 8, 9,
+ 9, 10, 10, 9, 10, 10,
+ 9, 10, 10, 9, 9, 8,
+ 10, 9, 9, 10, 10, 10,
+ 9, 10, 10, 9, 11, 10,
+ 10, 10, 10, 11, 10, 10,
+ 10, 11, 10, 10, 10, 11,
+ 10, 11, 11, 10, 11, 10,
+ 9, 9, 9, 9, 9, 10,
+ 10, 11, 11, 10, 10, 10,
+ 9, 9, 8, 10, 10, 10,
+ 10, 10, 10, 10, 11, 12,
+ 11, 10, 10, 10, 10, 10,
+ 10, 9, 10, 10, 10, 11,
+ 11, 12, 11, 11, 10, 10,
+ 10, 10, 10, 9, 9, 9,
+ 9, 10, 10, 10, 11, 11,
+ 10, 10, 9, 9, 9, 9,
+ 11, 10, 10, 11, 11, 11,
+ 10, 11, 10, 10, 11, 10,
+ 10, 10, 10, 10, 9, 10,
+ 10, 10, 11, 9, 10, 10,
+ 9, 10, 10, 10, 9, 9,
+ 9, 8, 9, 9, 10, 11,
+ 9, 10, 10, 9, 10, 10,
+ 9, 9, 8, 7, 7, 8,
+ 9, 10, 10, 9, 10, 10,
+ 9, 10, 9, 9, 8, 7,
+ 4, 5, 7, 8, 9, 10,
+ 9, 10, 10, 9, 10, 9,
+ 8, 7, 5,
+};
+
+static const uint16_t on2avc_cb11_syms[ON2AVC_CB11_CODES] = {
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005,
+ 0x0006, 0x0007, 0x00F9, 0x00FA, 0x00FB, 0x00FC,
+ 0x00FD, 0x00FE, 0x00FF, 0x0100, 0x0101, 0x0102,
+ 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x01F9,
+ 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF,
+ 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205,
+ 0x0206, 0x0207, 0x02F9, 0x02FA, 0x02FB, 0x02FC,
+ 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302,
+ 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x03F9,
+ 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF,
+ 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405,
+ 0x0406, 0x0407, 0x04F9, 0x04FA, 0x04FB, 0x04FC,
+ 0x04FD, 0x04FE, 0x04FF, 0x0500, 0x0501, 0x0502,
+ 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, 0x05F9,
+ 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF,
+ 0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605,
+ 0x0606, 0x0607, 0x06F9, 0x06FA, 0x06FB, 0x06FC,
+ 0x06FD, 0x06FE, 0x06FF, 0x0700, 0x0701, 0x0702,
+ 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x07F9,
+ 0x07FA, 0x07FB, 0x07FC, 0x07FD, 0x07FE, 0x07FF,
+ 0xF900, 0xF901, 0xF902, 0xF903, 0xF904, 0xF905,
+ 0xF906, 0xF907, 0xF9F9, 0xF9FA, 0xF9FB, 0xF9FC,
+ 0xF9FD, 0xF9FE, 0xF9FF, 0xFA00, 0xFA01, 0xFA02,
+ 0xFA03, 0xFA04, 0xFA05, 0xFA06, 0xFA07, 0xFAF9,
+ 0xFAFA, 0xFAFB, 0xFAFC, 0xFAFD, 0xFAFE, 0xFAFF,
+ 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05,
+ 0xFB06, 0xFB07, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC,
+ 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02,
+ 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFCF9,
+ 0xFCFA, 0xFCFB, 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF,
+ 0xFD00, 0xFD01, 0xFD02, 0xFD03, 0xFD04, 0xFD05,
+ 0xFD06, 0xFD07, 0xFDF9, 0xFDFA, 0xFDFB, 0xFDFC,
+ 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02,
+ 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, 0xFEF9,
+ 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0xFEFF,
+ 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05,
+ 0xFF06, 0xFF07, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC,
+ 0xFFFD, 0xFFFE, 0xFFFF,
+};
+
+#define ON2AVC_CB12_CODES 441
+static const uint16_t on2avc_cb12_codes[ON2AVC_CB12_CODES] = {
+ 0x0000, 0x000C, 0x004F, 0x0156, 0x02E6, 0x0462,
+ 0x044C, 0x086A, 0x0222, 0x0228, 0x047F, 0x037A,
+ 0x028F, 0x02B8, 0x0BB7, 0x04B7, 0x02DA, 0x0262,
+ 0x0124, 0x0052, 0x000F, 0x000D, 0x000E, 0x0058,
+ 0x00A2, 0x0129, 0x02C8, 0x0256, 0x044D, 0x016E,
+ 0x02AA, 0x02BE, 0x027F, 0x02A9, 0x016E, 0x0597,
+ 0x02EE, 0x02EE, 0x013A, 0x00A4, 0x004E, 0x000C,
+ 0x0056, 0x004B, 0x0058, 0x0125, 0x010E, 0x01A7,
+ 0x026A, 0x0415, 0x010C, 0x0228, 0x0446, 0x0232,
+ 0x017E, 0x0128, 0x0473, 0x035E, 0x026A, 0x015E,
+ 0x00DB, 0x005E, 0x0048, 0x017A, 0x00AE, 0x00BA,
+ 0x0172, 0x0229, 0x02FB, 0x0458, 0x05A4, 0x015A,
+ 0x0296, 0x05BE, 0x044E, 0x0216, 0x012A, 0x0423,
+ 0x053E, 0x02F0, 0x02F1, 0x011E, 0x0110, 0x009C,
+ 0x026B, 0x0112, 0x011B, 0x01B3, 0x01BF, 0x0263,
+ 0x057E, 0x04B8, 0x016B, 0x02DE, 0x04DE, 0x0416,
+ 0x02DB, 0x02AB, 0x06EE, 0x04CF, 0x025F, 0x02EB,
+ 0x022A, 0x011A, 0x010A, 0x05A5, 0x0238, 0x0217,
+ 0x02D6, 0x025A, 0x0282, 0x044F, 0x043D, 0x01AE,
+ 0x026B, 0x05C2, 0x043C, 0x044F, 0x02DB, 0x05A7,
+ 0x044E, 0x05BF, 0x0297, 0x022A, 0x026C, 0x02BD,
+ 0x0897, 0x0283, 0x02B6, 0x02B7, 0x0264, 0x0459,
+ 0x040B, 0x04DF, 0x0298, 0x0456, 0x0AFF, 0x06B7,
+ 0x0448, 0x0449, 0x08BE, 0x06EF, 0x04B9, 0x0597,
+ 0x049A, 0x02D2, 0x02F8, 0x08F7, 0x0476, 0x0452,
+ 0x0453, 0x045A, 0x05BE, 0x043E, 0x04D2, 0x02F2,
+ 0x02E4, 0x0477, 0x0AFE, 0x05A6, 0x02E3, 0x0BB6,
+ 0x0A7E, 0x05A6, 0x0A66, 0x08BF, 0x05FF, 0x0492,
+ 0x0170, 0x0106, 0x0140, 0x0142, 0x022E, 0x02CF,
+ 0x02B9, 0x02E2, 0x02F3, 0x05A0, 0x088E, 0x0DD7,
+ 0x04F6, 0x047E, 0x045B, 0x0347, 0x029E, 0x026D,
+ 0x01AC, 0x013B, 0x0104, 0x035F, 0x02EC, 0x026E,
+ 0x0233, 0x0207, 0x023E, 0x026E, 0x053F, 0x05A7,
+ 0x0456, 0x04AE, 0x0DD6, 0x0A67, 0x0493, 0x04BA,
+ 0x05D3, 0x05C3, 0x0246, 0x0247, 0x0202, 0x02E8,
+ 0x05AE, 0x0374, 0x0537, 0x05C6, 0x04BB, 0x0686,
+ 0x04D3, 0x04DE, 0x08C3, 0x05BF, 0x04F7, 0x14FB,
+ 0x0997, 0x0A7F, 0x08C2, 0x0417, 0x0434, 0x0477,
+ 0x037B, 0x0463, 0x02EF, 0x0592, 0x02E5, 0x049B,
+ 0x035A, 0x0436, 0x05AF, 0x0687, 0x0896, 0x095F,
+ 0x09BE, 0x0996, 0x0558, 0x088F, 0x0B8E, 0x057E,
+ 0x04CA, 0x05CE, 0x05F3, 0x047A, 0x05A1, 0x02E2,
+ 0x02FA, 0x0204, 0x022C, 0x020E, 0x0360, 0x02AE,
+ 0x05FC, 0x0457, 0x05DA, 0x086B, 0x14FA, 0x04B6,
+ 0x02FE, 0x040A, 0x02E6, 0x0576, 0x044A, 0x028C,
+ 0x0212, 0x0248, 0x02E0, 0x029A, 0x0126, 0x017E,
+ 0x0130, 0x024C, 0x0232, 0x0596, 0x0378, 0x053A,
+ 0x04CC, 0x0A7C, 0x0470, 0x0593, 0x02D8, 0x029C,
+ 0x02D9, 0x02BE, 0x01A0, 0x014E, 0x0120, 0x013C,
+ 0x06EC, 0x04CD, 0x0559, 0x06B6, 0x0420, 0x057F,
+ 0x0596, 0x09BF, 0x0532, 0x055A, 0x095E, 0x08BC,
+ 0x0472, 0x02CA, 0x05F2, 0x05FD, 0x047E, 0x05A2,
+ 0x06EA, 0x05CF, 0x04D2, 0x043F, 0x028E, 0x0422,
+ 0x0460, 0x05DE, 0x053B, 0x08F6, 0x0B8F, 0x02CE,
+ 0x0473, 0x06ED, 0x0421, 0x028D, 0x023C, 0x047F,
+ 0x05A3, 0x044C, 0x044D, 0x0457, 0x02CA, 0x02D8,
+ 0x027C, 0x029E, 0x023E, 0x027D, 0x0361, 0x0414,
+ 0x05BC, 0x08BD, 0x02DA, 0x024A, 0x0437, 0x055B,
+ 0x0379, 0x01BE, 0x05DF, 0x04D3, 0x0268, 0x0206,
+ 0x0213, 0x02BA, 0x0203, 0x0236, 0x0127, 0x0136,
+ 0x0268, 0x0242, 0x02CF, 0x05FE, 0x05D2, 0x0237,
+ 0x0243, 0x0472, 0x0362, 0x027A, 0x02AE, 0x0471,
+ 0x0474, 0x024B, 0x02AF, 0x01A6, 0x012C, 0x0166,
+ 0x0166, 0x00A6, 0x00AC, 0x0100, 0x01B2, 0x020F,
+ 0x0363, 0x0446, 0x016A, 0x022E, 0x0577, 0x02FF,
+ 0x022D, 0x0168, 0x0475, 0x027E, 0x0222, 0x01A2,
+ 0x017B, 0x00D2, 0x00BE, 0x0050, 0x0054, 0x006A,
+ 0x011A, 0x0143, 0x024F, 0x02E7, 0x0447, 0x0110,
+ 0x0233, 0x02D9, 0x02AF, 0x024E, 0x016A, 0x0536,
+ 0x0342, 0x02BC, 0x0176, 0x00DA, 0x0054, 0x004A,
+ 0x000E, 0x0010, 0x004C, 0x00DC, 0x0164, 0x023A,
+ 0x0476, 0x04CE, 0x0118, 0x02CE, 0x025E, 0x0346,
+ 0x02A8, 0x0122, 0x05BD, 0x022F, 0x02EA, 0x014A,
+ 0x00AA, 0x0051, 0x000F,
+};
+
+static const uint8_t on2avc_cb12_bits[ON2AVC_CB12_CODES] = {
+ 2, 4, 7, 9, 10, 11,
+ 12, 13, 10, 11, 11, 11,
+ 11, 10, 12, 12, 11, 11,
+ 9, 7, 4, 4, 5, 7,
+ 9, 10, 10, 11, 12, 10,
+ 10, 11, 11, 10, 9, 12,
+ 11, 10, 10, 9, 7, 5,
+ 7, 7, 8, 9, 10, 10,
+ 11, 12, 10, 10, 11, 11,
+ 10, 10, 12, 11, 10, 10,
+ 9, 8, 7, 9, 9, 9,
+ 9, 10, 10, 11, 11, 10,
+ 11, 11, 11, 11, 10, 12,
+ 11, 10, 10, 10, 9, 9,
+ 10, 10, 10, 10, 10, 11,
+ 11, 12, 10, 11, 11, 12,
+ 11, 10, 12, 12, 11, 10,
+ 10, 10, 10, 11, 10, 11,
+ 10, 11, 11, 12, 12, 10,
+ 11, 11, 12, 11, 10, 12,
+ 12, 11, 11, 11, 10, 10,
+ 12, 11, 11, 11, 11, 11,
+ 12, 12, 10, 11, 12, 12,
+ 11, 11, 12, 12, 12, 11,
+ 11, 11, 10, 12, 12, 12,
+ 12, 11, 12, 12, 12, 10,
+ 11, 12, 12, 11, 11, 12,
+ 13, 12, 12, 12, 11, 12,
+ 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 11, 12, 13,
+ 12, 12, 11, 11, 11, 10,
+ 10, 10, 10, 11, 10, 10,
+ 11, 11, 11, 11, 11, 11,
+ 12, 12, 13, 12, 12, 12,
+ 11, 11, 11, 11, 11, 10,
+ 11, 11, 11, 11, 12, 12,
+ 12, 12, 12, 12, 12, 14,
+ 13, 13, 12, 12, 12, 11,
+ 11, 11, 11, 11, 11, 11,
+ 11, 12, 11, 12, 12, 13,
+ 12, 13, 12, 12, 12, 12,
+ 12, 11, 11, 11, 11, 11,
+ 10, 11, 11, 11, 11, 11,
+ 11, 12, 11, 13, 14, 12,
+ 11, 12, 11, 11, 11, 11,
+ 11, 11, 10, 10, 10, 9,
+ 10, 10, 10, 11, 11, 11,
+ 12, 13, 12, 11, 10, 10,
+ 10, 10, 10, 10, 10, 10,
+ 12, 12, 12, 12, 12, 12,
+ 12, 12, 11, 12, 13, 12,
+ 11, 10, 11, 11, 11, 11,
+ 12, 11, 11, 12, 11, 12,
+ 11, 11, 11, 12, 12, 11,
+ 11, 12, 12, 11, 10, 12,
+ 11, 11, 11, 11, 11, 11,
+ 11, 10, 10, 11, 11, 12,
+ 11, 12, 10, 11, 12, 12,
+ 11, 10, 11, 11, 11, 11,
+ 11, 10, 11, 10, 10, 10,
+ 10, 11, 11, 11, 11, 10,
+ 11, 12, 11, 11, 10, 12,
+ 11, 11, 10, 10, 10, 10,
+ 9, 9, 9, 10, 10, 11,
+ 11, 12, 10, 11, 11, 11,
+ 11, 10, 11, 11, 11, 10,
+ 9, 9, 9, 7, 7, 8,
+ 9, 10, 10, 11, 12, 10,
+ 10, 11, 11, 10, 9, 11,
+ 11, 10, 10, 9, 8, 7,
+ 4, 5, 7, 9, 10, 11,
+ 11, 12, 10, 10, 11, 11,
+ 10, 10, 11, 11, 10, 10,
+ 9, 7, 5,
+};
+
+static const uint16_t on2avc_cb12_syms[ON2AVC_CB12_CODES] = {
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005,
+ 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x00F6,
+ 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC,
+ 0x00FD, 0x00FE, 0x00FF, 0x0100, 0x0101, 0x0102,
+ 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108,
+ 0x0109, 0x010A, 0x01F6, 0x01F7, 0x01F8, 0x01F9,
+ 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF,
+ 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205,
+ 0x0206, 0x0207, 0x0208, 0x0209, 0x020A, 0x02F6,
+ 0x02F7, 0x02F8, 0x02F9, 0x02FA, 0x02FB, 0x02FC,
+ 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302,
+ 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308,
+ 0x0309, 0x030A, 0x03F6, 0x03F7, 0x03F8, 0x03F9,
+ 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF,
+ 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405,
+ 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x04F6,
+ 0x04F7, 0x04F8, 0x04F9, 0x04FA, 0x04FB, 0x04FC,
+ 0x04FD, 0x04FE, 0x04FF, 0x0500, 0x0501, 0x0502,
+ 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, 0x0508,
+ 0x0509, 0x050A, 0x05F6, 0x05F7, 0x05F8, 0x05F9,
+ 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF,
+ 0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605,
+ 0x0606, 0x0607, 0x0608, 0x0609, 0x060A, 0x06F6,
+ 0x06F7, 0x06F8, 0x06F9, 0x06FA, 0x06FB, 0x06FC,
+ 0x06FD, 0x06FE, 0x06FF, 0x0700, 0x0701, 0x0702,
+ 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x0708,
+ 0x0709, 0x070A, 0x07F6, 0x07F7, 0x07F8, 0x07F9,
+ 0x07FA, 0x07FB, 0x07FC, 0x07FD, 0x07FE, 0x07FF,
+ 0x0800, 0x0801, 0x0802, 0x0803, 0x0804, 0x0805,
+ 0x0806, 0x0807, 0x0808, 0x0809, 0x080A, 0x08F6,
+ 0x08F7, 0x08F8, 0x08F9, 0x08FA, 0x08FB, 0x08FC,
+ 0x08FD, 0x08FE, 0x08FF, 0x0900, 0x0901, 0x0902,
+ 0x0903, 0x0904, 0x0905, 0x0906, 0x0907, 0x0908,
+ 0x0909, 0x090A, 0x09F6, 0x09F7, 0x09F8, 0x09F9,
+ 0x09FA, 0x09FB, 0x09FC, 0x09FD, 0x09FE, 0x09FF,
+ 0x0A00, 0x0A01, 0x0A02, 0x0A03, 0x0A04, 0x0A05,
+ 0x0A06, 0x0A07, 0x0A08, 0x0A09, 0x0A0A, 0x0AF6,
+ 0x0AF7, 0x0AF8, 0x0AF9, 0x0AFA, 0x0AFB, 0x0AFC,
+ 0x0AFD, 0x0AFE, 0x0AFF, 0xF600, 0xF601, 0xF602,
+ 0xF603, 0xF604, 0xF605, 0xF606, 0xF607, 0xF608,
+ 0xF609, 0xF60A, 0xF6F6, 0xF6F7, 0xF6F8, 0xF6F9,
+ 0xF6FA, 0xF6FB, 0xF6FC, 0xF6FD, 0xF6FE, 0xF6FF,
+ 0xF700, 0xF701, 0xF702, 0xF703, 0xF704, 0xF705,
+ 0xF706, 0xF707, 0xF708, 0xF709, 0xF70A, 0xF7F6,
+ 0xF7F7, 0xF7F8, 0xF7F9, 0xF7FA, 0xF7FB, 0xF7FC,
+ 0xF7FD, 0xF7FE, 0xF7FF, 0xF800, 0xF801, 0xF802,
+ 0xF803, 0xF804, 0xF805, 0xF806, 0xF807, 0xF808,
+ 0xF809, 0xF80A, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9,
+ 0xF8FA, 0xF8FB, 0xF8FC, 0xF8FD, 0xF8FE, 0xF8FF,
+ 0xF900, 0xF901, 0xF902, 0xF903, 0xF904, 0xF905,
+ 0xF906, 0xF907, 0xF908, 0xF909, 0xF90A, 0xF9F6,
+ 0xF9F7, 0xF9F8, 0xF9F9, 0xF9FA, 0xF9FB, 0xF9FC,
+ 0xF9FD, 0xF9FE, 0xF9FF, 0xFA00, 0xFA01, 0xFA02,
+ 0xFA03, 0xFA04, 0xFA05, 0xFA06, 0xFA07, 0xFA08,
+ 0xFA09, 0xFA0A, 0xFAF6, 0xFAF7, 0xFAF8, 0xFAF9,
+ 0xFAFA, 0xFAFB, 0xFAFC, 0xFAFD, 0xFAFE, 0xFAFF,
+ 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05,
+ 0xFB06, 0xFB07, 0xFB08, 0xFB09, 0xFB0A, 0xFBF6,
+ 0xFBF7, 0xFBF8, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC,
+ 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02,
+ 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFC08,
+ 0xFC09, 0xFC0A, 0xFCF6, 0xFCF7, 0xFCF8, 0xFCF9,
+ 0xFCFA, 0xFCFB, 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF,
+ 0xFD00, 0xFD01, 0xFD02, 0xFD03, 0xFD04, 0xFD05,
+ 0xFD06, 0xFD07, 0xFD08, 0xFD09, 0xFD0A, 0xFDF6,
+ 0xFDF7, 0xFDF8, 0xFDF9, 0xFDFA, 0xFDFB, 0xFDFC,
+ 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02,
+ 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, 0xFE08,
+ 0xFE09, 0xFE0A, 0xFEF6, 0xFEF7, 0xFEF8, 0xFEF9,
+ 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0xFEFF,
+ 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05,
+ 0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFFF6,
+ 0xFFF7, 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC,
+ 0xFFFD, 0xFFFE, 0xFFFF,
+};
+
+#define ON2AVC_CB13_CODES 625
+static const uint16_t on2avc_cb13_codes[ON2AVC_CB13_CODES] = {
+ 0x0000, 0x0015, 0x008E, 0x0338, 0x09FB, 0x0BEC,
+ 0x0C61, 0x13E1, 0x18A7, 0x313B, 0x61BB, 0x05D9,
+ 0x0896, 0x066B, 0x05C6, 0x18A6, 0x40E4, 0x2081,
+ 0x104F, 0x13E0, 0x0C22, 0x07E4, 0x03F7, 0x0087,
+ 0x0014, 0x0016, 0x001D, 0x009C, 0x02E2, 0x037E,
+ 0x0897, 0x0898, 0x0C63, 0x117D, 0x2082, 0x27AA,
+ 0x033B, 0x06C5, 0x04F2, 0x0331, 0x19EB, 0x18A8,
+ 0x13E2, 0x0DE7, 0x0C62, 0x06DF, 0x05C7, 0x02F4,
+ 0x0098, 0x001A, 0x007C, 0x0080, 0x0106, 0x02F5,
+ 0x03EC, 0x0617, 0x0621, 0x08F9, 0x1050, 0x117F,
+ 0x11E0, 0x036A, 0x045A, 0x06C6, 0x037F, 0x117E,
+ 0x2083, 0x0BED, 0x0C9E, 0x0658, 0x04F3, 0x0368,
+ 0x02EE, 0x00FA, 0x008D, 0x031C, 0x01FF, 0x0206,
+ 0x031E, 0x06C8, 0x0659, 0x09B5, 0x0C23, 0x0BEF,
+ 0x0C9F, 0x19EC, 0x04CC, 0x0623, 0x06C7, 0x0622,
+ 0x313C, 0x17BB, 0x11E1, 0x0C64, 0x0BEE, 0x07DC,
+ 0x04CB, 0x0375, 0x0205, 0x026E, 0x0C24, 0x06C9,
+ 0x0324, 0x04DF, 0x0642, 0x09B6, 0x0643, 0x0BF2,
+ 0x083B, 0x1051, 0x27AB, 0x036C, 0x0607, 0x06E2,
+ 0x045B, 0x313D, 0x2084, 0x18A9, 0x13E3, 0x0CA0,
+ 0x0899, 0x066E, 0x06E3, 0x0369, 0x0606, 0x0DE8,
+ 0x061A, 0x0453, 0x065A, 0x065B, 0x089B, 0x089C,
+ 0x09FD, 0x0BA5, 0x18AA, 0x11E2, 0x05C8, 0x09B7,
+ 0x066F, 0x06CA, 0x19ED, 0x2085, 0x2086, 0x0D83,
+ 0x1052, 0x1053, 0x09FC, 0x089A, 0x0644, 0x083E,
+ 0x13E4, 0x08FC, 0x0624, 0x1055, 0x0C65, 0x089D,
+ 0x0645, 0x08FD, 0x0C66, 0x0CA1, 0x1056, 0x05E1,
+ 0x089E, 0x08FA, 0x07E5, 0x313E, 0x2087, 0x11E3,
+ 0x19EE, 0x18AB, 0x1054, 0x19EF, 0x17BC, 0x08FB,
+ 0x07E6, 0x18AD, 0x0BF3, 0x07E7, 0x0C67, 0x1057,
+ 0x07EA, 0x08FF, 0x1058, 0x0DE9, 0x18AE, 0x19F0,
+ 0x0608, 0x089F, 0x08FE, 0x06CB, 0x313F, 0x2088,
+ 0x13E5, 0x3142, 0x11E4, 0x18AC, 0x11E5, 0x0CA2,
+ 0x065E, 0x13E6, 0x27AD, 0x19F1, 0x0D86, 0x0DEA,
+ 0x0CA3, 0x0DEB, 0x17BE, 0x0C2A, 0x13E8, 0x0CA6,
+ 0x0DEE, 0x05FD, 0x0992, 0x0C25, 0x063E, 0x40E5,
+ 0x11E6, 0x3143, 0x18AF, 0x27AC, 0x0C26, 0x17BD,
+ 0x13E7, 0x0C27, 0x11E7, 0x27B2, 0x40E8, 0x18B3,
+ 0x17C0, 0x18FE, 0x19F2, 0x19F3, 0x31FE, 0x17C1,
+ 0x19F6, 0x0BA6, 0x09FE, 0x0DEF, 0x17BF, 0x0C2B,
+ 0x40E6, 0x18B0, 0x40E7, 0x13E9, 0x2089, 0x27AE,
+ 0x27AF, 0x208A, 0x18B1, 0x18B2, 0x27B3, 0xBCEF,
+ 0x2F3A, 0x40EA, 0x17C5, 0x17C6, 0x17C7, 0x19F7,
+ 0x133E, 0x105A, 0x17CA, 0x065F, 0x0CA7, 0x0C7E,
+ 0x1059, 0xBCED, 0x40E9, 0xBCEE, 0x17C2, 0x63FE,
+ 0x208B, 0x208E, 0x208F, 0x17C3, 0x17C4, 0x0625,
+ 0x03ED, 0x045C, 0x04CD, 0x05DA, 0x05CE, 0x05FF,
+ 0x0626, 0x060A, 0x05E3, 0x083F, 0x0BA8, 0x0BA9,
+ 0x40EB, 0x13EA, 0x0CCA, 0x0BA7, 0x08A2, 0x0646,
+ 0x0609, 0x05E2, 0x041E, 0x05FE, 0x0373, 0x0376,
+ 0x099E, 0x05DE, 0x0647, 0x05E6, 0x06D6, 0x07EB,
+ 0x09FF, 0x1B5E, 0x0BAB, 0x08AE, 0x0C36, 0x0FBA,
+ 0x17CB, 0x4CFE, 0x105B, 0x0D87, 0x0DAE, 0x13EB,
+ 0x0BAA, 0x0993, 0x08A3, 0x085E, 0x0600, 0x0601,
+ 0x05DB, 0x0664, 0x04F0, 0x05F8, 0x0634, 0x085F,
+ 0x06F6, 0x08F4, 0x0C5A, 0x0CFC, 0x0DDC, 0x09F6,
+ 0x0C16, 0x115E, 0x13D8, 0x13DA, 0x0C94, 0x0CFA,
+ 0x082E, 0x0B9E, 0x06C2, 0x0BE4, 0x06DA, 0x05C0,
+ 0x0614, 0x05C9, 0x05DF, 0x033A, 0x0336, 0x05FA,
+ 0x04CE, 0x05C1, 0x0890, 0x0891, 0x0838, 0x0839,
+ 0x0CFD, 0x0BA0, 0x61B8, 0x07DE, 0x0635, 0x0B9F,
+ 0x0640, 0x06DB, 0x082F, 0x09AC, 0x04C8, 0x0666,
+ 0x04DE, 0x03F4, 0x0339, 0x2079, 0x267E, 0x179E,
+ 0x30DE, 0x63FF, 0x27A0, 0x1997, 0x36BF, 0x3EEC,
+ 0x99FE, 0x99FF, 0x0C95, 0x1048, 0x0C5B, 0x0636,
+ 0x0C5C, 0x2076, 0x13DB, 0x115F, 0x179C, 0x2077,
+ 0x1046, 0x36BE, 0x1996, 0x2078, 0x61B9, 0x1175,
+ 0x17B0, 0x3EED, 0x19E1, 0x19E2, 0x207A, 0x3EEE,
+ 0xBCEC, 0x3138, 0x3139, 0x07DF, 0x1176, 0x0892,
+ 0x0667, 0x18A0, 0x18A2, 0x13DC, 0x1174, 0x13DD,
+ 0x179F, 0x30DF, 0x19E0, 0x18A3, 0x1049, 0x17B2,
+ 0x207B, 0x17B3, 0x0C17, 0x19E3, 0x17B4, 0x207C,
+ 0x3EEF, 0x207D, 0x19E4, 0x27A1, 0x0C5F, 0x08F5,
+ 0x0DDD, 0x0652, 0x18A4, 0x0C96, 0x0C5D, 0x104A,
+ 0x1177, 0x0CFE, 0x0C5E, 0x0DDE, 0x09F7, 0x17B1,
+ 0x19E6, 0x0C1E, 0x09AE, 0x1179, 0x0DE0, 0x17B5,
+ 0x0BA2, 0x17B6, 0x27A3, 0x40E0, 0x40E1, 0x06DC,
+ 0x09AF, 0x09AD, 0x05C2, 0x19E5, 0x27A2, 0x0DDF,
+ 0x0C1C, 0x0C1D, 0x0BE6, 0x0BA1, 0x1178, 0x0654,
+ 0x13DE, 0x40E2, 0x0893, 0x0668, 0x07E1, 0x0BE7,
+ 0x08F6, 0x0DE1, 0x27A4, 0x104B, 0x19E7, 0x40E3,
+ 0x05D6, 0x09F9, 0x06DD, 0x04CA, 0x17B7, 0x17B8,
+ 0x0C97, 0x0C98, 0x07E0, 0x0C99, 0x0655, 0x09F8,
+ 0x0656, 0x0C9A, 0x0DE2, 0x0669, 0x04D3, 0x061C,
+ 0x0894, 0x13DF, 0x0C1F, 0x104C, 0x27A6, 0x61BA,
+ 0x27A7, 0x066A, 0x061D, 0x0637, 0x04D2, 0x27A5,
+ 0x117A, 0x0C9B, 0x09B0, 0x09B1, 0x05E0, 0x0602,
+ 0x05FB, 0x04F1, 0x08F7, 0x06FA, 0x0603, 0x037C,
+ 0x05C3, 0x0BE8, 0x0895, 0x0C60, 0x117B, 0x19E8,
+ 0x27A8, 0x19E9, 0x0657, 0x083A, 0x06C4, 0x05D7,
+ 0x17B9, 0x0CFF, 0x0DE3, 0x104D, 0x07E2, 0x0641,
+ 0x061E, 0x05D8, 0x0366, 0x0616, 0x032E, 0x0268,
+ 0x02E6, 0x0456, 0x0BA3, 0x06FB, 0x0D80, 0x0DE5,
+ 0x104E, 0x17BA, 0x27A9, 0x0330, 0x07E3, 0x061F,
+ 0x0367, 0x207E, 0x0C9C, 0x117C, 0x0DE4, 0x06DE,
+ 0x0620, 0x0450, 0x042E, 0x02F2, 0x0204, 0x0086,
+ 0x008C, 0x00FE, 0x022A, 0x0372, 0x05CA, 0x0452,
+ 0x08F8, 0x0BA4, 0x19EA, 0x18A5, 0x0306, 0x05FC,
+ 0x03F6, 0x0458, 0x0D81, 0x0BE9, 0x09B2, 0x0C20,
+ 0x09FA, 0x0604, 0x0370, 0x01FE, 0x010A, 0x0084,
+ 0x0012, 0x001C, 0x0088, 0x026A, 0x05CB, 0x063B,
+ 0x09B4, 0x0D82, 0x0DE6, 0x207F, 0x2080, 0x030C,
+ 0x0605, 0x0459, 0x0374, 0x313A, 0x0C9D, 0x0BEA,
+ 0x0BEB, 0x0C21, 0x09B3, 0x063A, 0x0216, 0x009D,
+ 0x001E,
+};
+
+static const uint8_t on2avc_cb13_bits[ON2AVC_CB13_CODES] = {
+ 1, 5, 8, 10, 12, 12,
+ 12, 13, 13, 14, 15, 11,
+ 12, 11, 11, 13, 15, 14,
+ 13, 13, 12, 11, 10, 8,
+ 5, 5, 5, 8, 10, 10,
+ 12, 12, 12, 13, 14, 14,
+ 10, 11, 11, 10, 13, 13,
+ 13, 12, 12, 11, 11, 10,
+ 8, 5, 7, 8, 9, 10,
+ 10, 11, 11, 12, 13, 13,
+ 13, 10, 11, 11, 10, 13,
+ 14, 12, 12, 11, 11, 10,
+ 10, 8, 8, 10, 9, 10,
+ 10, 11, 11, 12, 12, 12,
+ 12, 13, 11, 11, 11, 11,
+ 14, 13, 13, 12, 12, 11,
+ 11, 10, 10, 10, 12, 11,
+ 10, 11, 11, 12, 11, 12,
+ 12, 13, 14, 10, 11, 11,
+ 11, 14, 14, 13, 13, 12,
+ 12, 11, 11, 10, 11, 12,
+ 11, 11, 11, 11, 12, 12,
+ 12, 12, 13, 13, 11, 12,
+ 11, 11, 13, 14, 14, 12,
+ 13, 13, 12, 12, 11, 12,
+ 13, 12, 11, 13, 12, 12,
+ 11, 12, 12, 12, 13, 11,
+ 12, 12, 11, 14, 14, 13,
+ 13, 13, 13, 13, 13, 12,
+ 11, 13, 12, 11, 12, 13,
+ 11, 12, 13, 12, 13, 13,
+ 11, 12, 12, 11, 14, 14,
+ 13, 14, 13, 13, 13, 12,
+ 11, 13, 14, 13, 12, 12,
+ 12, 12, 13, 12, 13, 12,
+ 12, 11, 12, 12, 11, 15,
+ 13, 14, 13, 14, 12, 13,
+ 13, 12, 13, 14, 15, 13,
+ 13, 13, 13, 13, 14, 13,
+ 13, 12, 12, 12, 13, 12,
+ 15, 13, 15, 13, 14, 14,
+ 14, 14, 13, 13, 14, 16,
+ 14, 15, 13, 13, 13, 13,
+ 13, 13, 13, 11, 12, 12,
+ 13, 16, 15, 16, 13, 15,
+ 14, 14, 14, 13, 13, 11,
+ 10, 11, 11, 11, 11, 11,
+ 11, 11, 11, 12, 12, 12,
+ 15, 13, 12, 12, 12, 11,
+ 11, 11, 11, 11, 10, 10,
+ 12, 11, 11, 11, 11, 11,
+ 12, 13, 12, 12, 12, 12,
+ 13, 15, 13, 12, 12, 13,
+ 12, 12, 12, 12, 11, 11,
+ 11, 11, 11, 11, 11, 12,
+ 11, 12, 12, 12, 12, 12,
+ 12, 13, 13, 13, 12, 12,
+ 12, 12, 11, 12, 11, 11,
+ 11, 11, 11, 10, 10, 11,
+ 11, 11, 12, 12, 12, 12,
+ 12, 12, 15, 11, 11, 12,
+ 11, 11, 12, 12, 11, 11,
+ 11, 10, 10, 14, 14, 13,
+ 14, 15, 14, 13, 14, 14,
+ 16, 16, 12, 13, 12, 11,
+ 12, 14, 13, 13, 13, 14,
+ 13, 14, 13, 14, 15, 13,
+ 13, 14, 13, 13, 14, 14,
+ 16, 14, 14, 11, 13, 12,
+ 11, 13, 13, 13, 13, 13,
+ 13, 14, 13, 13, 13, 13,
+ 14, 13, 12, 13, 13, 14,
+ 14, 14, 13, 14, 12, 12,
+ 12, 11, 13, 12, 12, 13,
+ 13, 12, 12, 12, 12, 13,
+ 13, 12, 12, 13, 12, 13,
+ 12, 13, 14, 15, 15, 11,
+ 12, 12, 11, 13, 14, 12,
+ 12, 12, 12, 12, 13, 11,
+ 13, 15, 12, 11, 11, 12,
+ 12, 12, 14, 13, 13, 15,
+ 11, 12, 11, 11, 13, 13,
+ 12, 12, 11, 12, 11, 12,
+ 11, 12, 12, 11, 11, 11,
+ 12, 13, 12, 13, 14, 15,
+ 14, 11, 11, 11, 11, 14,
+ 13, 12, 12, 12, 11, 11,
+ 11, 11, 12, 11, 11, 10,
+ 11, 12, 12, 12, 13, 13,
+ 14, 13, 11, 12, 11, 11,
+ 13, 12, 12, 13, 11, 11,
+ 11, 11, 10, 11, 10, 10,
+ 10, 11, 12, 11, 12, 12,
+ 13, 13, 14, 10, 11, 11,
+ 10, 14, 12, 13, 12, 11,
+ 11, 11, 11, 10, 10, 8,
+ 8, 8, 10, 10, 11, 11,
+ 12, 12, 13, 13, 10, 11,
+ 10, 11, 12, 12, 12, 12,
+ 12, 11, 10, 9, 9, 8,
+ 5, 5, 8, 10, 11, 11,
+ 12, 12, 12, 14, 14, 10,
+ 11, 11, 10, 14, 12, 12,
+ 12, 12, 12, 11, 10, 8,
+ 5,
+};
+
+static const uint16_t on2avc_cb13_syms[ON2AVC_CB13_CODES] = {
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005,
+ 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B,
+ 0x000C, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8,
+ 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE,
+ 0x00FF, 0x0100, 0x0101, 0x0102, 0x0103, 0x0104,
+ 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x010A,
+ 0x010B, 0x010C, 0x01F4, 0x01F5, 0x01F6, 0x01F7,
+ 0x01F8, 0x01F9, 0x01FA, 0x01FB, 0x01FC, 0x01FD,
+ 0x01FE, 0x01FF, 0x0200, 0x0201, 0x0202, 0x0203,
+ 0x0204, 0x0205, 0x0206, 0x0207, 0x0208, 0x0209,
+ 0x020A, 0x020B, 0x020C, 0x02F4, 0x02F5, 0x02F6,
+ 0x02F7, 0x02F8, 0x02F9, 0x02FA, 0x02FB, 0x02FC,
+ 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302,
+ 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308,
+ 0x0309, 0x030A, 0x030B, 0x030C, 0x03F4, 0x03F5,
+ 0x03F6, 0x03F7, 0x03F8, 0x03F9, 0x03FA, 0x03FB,
+ 0x03FC, 0x03FD, 0x03FE, 0x03FF, 0x0400, 0x0401,
+ 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407,
+ 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x04F4,
+ 0x04F5, 0x04F6, 0x04F7, 0x04F8, 0x04F9, 0x04FA,
+ 0x04FB, 0x04FC, 0x04FD, 0x04FE, 0x04FF, 0x0500,
+ 0x0501, 0x0502, 0x0503, 0x0504, 0x0505, 0x0506,
+ 0x0507, 0x0508, 0x0509, 0x050A, 0x050B, 0x050C,
+ 0x05F4, 0x05F5, 0x05F6, 0x05F7, 0x05F8, 0x05F9,
+ 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF,
+ 0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605,
+ 0x0606, 0x0607, 0x0608, 0x0609, 0x060A, 0x060B,
+ 0x060C, 0x06F4, 0x06F5, 0x06F6, 0x06F7, 0x06F8,
+ 0x06F9, 0x06FA, 0x06FB, 0x06FC, 0x06FD, 0x06FE,
+ 0x06FF, 0x0700, 0x0701, 0x0702, 0x0703, 0x0704,
+ 0x0705, 0x0706, 0x0707, 0x0708, 0x0709, 0x070A,
+ 0x070B, 0x070C, 0x07F4, 0x07F5, 0x07F6, 0x07F7,
+ 0x07F8, 0x07F9, 0x07FA, 0x07FB, 0x07FC, 0x07FD,
+ 0x07FE, 0x07FF, 0x0800, 0x0801, 0x0802, 0x0803,
+ 0x0804, 0x0805, 0x0806, 0x0807, 0x0808, 0x0809,
+ 0x080A, 0x080B, 0x080C, 0x08F4, 0x08F5, 0x08F6,
+ 0x08F7, 0x08F8, 0x08F9, 0x08FA, 0x08FB, 0x08FC,
+ 0x08FD, 0x08FE, 0x08FF, 0x0900, 0x0901, 0x0902,
+ 0x0903, 0x0904, 0x0905, 0x0906, 0x0907, 0x0908,
+ 0x0909, 0x090A, 0x090B, 0x090C, 0x09F4, 0x09F5,
+ 0x09F6, 0x09F7, 0x09F8, 0x09F9, 0x09FA, 0x09FB,
+ 0x09FC, 0x09FD, 0x09FE, 0x09FF, 0x0A00, 0x0A01,
+ 0x0A02, 0x0A03, 0x0A04, 0x0A05, 0x0A06, 0x0A07,
+ 0x0A08, 0x0A09, 0x0A0A, 0x0A0B, 0x0A0C, 0x0AF4,
+ 0x0AF5, 0x0AF6, 0x0AF7, 0x0AF8, 0x0AF9, 0x0AFA,
+ 0x0AFB, 0x0AFC, 0x0AFD, 0x0AFE, 0x0AFF, 0x0B00,
+ 0x0B01, 0x0B02, 0x0B03, 0x0B04, 0x0B05, 0x0B06,
+ 0x0B07, 0x0B08, 0x0B09, 0x0B0A, 0x0B0B, 0x0B0C,
+ 0x0BF4, 0x0BF5, 0x0BF6, 0x0BF7, 0x0BF8, 0x0BF9,
+ 0x0BFA, 0x0BFB, 0x0BFC, 0x0BFD, 0x0BFE, 0x0BFF,
+ 0x0C00, 0x0C01, 0x0C02, 0x0C03, 0x0C04, 0x0C05,
+ 0x0C06, 0x0C07, 0x0C08, 0x0C09, 0x0C0A, 0x0C0B,
+ 0x0C0C, 0x0CF4, 0x0CF5, 0x0CF6, 0x0CF7, 0x0CF8,
+ 0x0CF9, 0x0CFA, 0x0CFB, 0x0CFC, 0x0CFD, 0x0CFE,
+ 0x0CFF, 0xF400, 0xF401, 0xF402, 0xF403, 0xF404,
+ 0xF405, 0xF406, 0xF407, 0xF408, 0xF409, 0xF40A,
+ 0xF40B, 0xF40C, 0xF4F4, 0xF4F5, 0xF4F6, 0xF4F7,
+ 0xF4F8, 0xF4F9, 0xF4FA, 0xF4FB, 0xF4FC, 0xF4FD,
+ 0xF4FE, 0xF4FF, 0xF500, 0xF501, 0xF502, 0xF503,
+ 0xF504, 0xF505, 0xF506, 0xF507, 0xF508, 0xF509,
+ 0xF50A, 0xF50B, 0xF50C, 0xF5F4, 0xF5F5, 0xF5F6,
+ 0xF5F7, 0xF5F8, 0xF5F9, 0xF5FA, 0xF5FB, 0xF5FC,
+ 0xF5FD, 0xF5FE, 0xF5FF, 0xF600, 0xF601, 0xF602,
+ 0xF603, 0xF604, 0xF605, 0xF606, 0xF607, 0xF608,
+ 0xF609, 0xF60A, 0xF60B, 0xF60C, 0xF6F4, 0xF6F5,
+ 0xF6F6, 0xF6F7, 0xF6F8, 0xF6F9, 0xF6FA, 0xF6FB,
+ 0xF6FC, 0xF6FD, 0xF6FE, 0xF6FF, 0xF700, 0xF701,
+ 0xF702, 0xF703, 0xF704, 0xF705, 0xF706, 0xF707,
+ 0xF708, 0xF709, 0xF70A, 0xF70B, 0xF70C, 0xF7F4,
+ 0xF7F5, 0xF7F6, 0xF7F7, 0xF7F8, 0xF7F9, 0xF7FA,
+ 0xF7FB, 0xF7FC, 0xF7FD, 0xF7FE, 0xF7FF, 0xF800,
+ 0xF801, 0xF802, 0xF803, 0xF804, 0xF805, 0xF806,
+ 0xF807, 0xF808, 0xF809, 0xF80A, 0xF80B, 0xF80C,
+ 0xF8F4, 0xF8F5, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9,
+ 0xF8FA, 0xF8FB, 0xF8FC, 0xF8FD, 0xF8FE, 0xF8FF,
+ 0xF900, 0xF901, 0xF902, 0xF903, 0xF904, 0xF905,
+ 0xF906, 0xF907, 0xF908, 0xF909, 0xF90A, 0xF90B,
+ 0xF90C, 0xF9F4, 0xF9F5, 0xF9F6, 0xF9F7, 0xF9F8,
+ 0xF9F9, 0xF9FA, 0xF9FB, 0xF9FC, 0xF9FD, 0xF9FE,
+ 0xF9FF, 0xFA00, 0xFA01, 0xFA02, 0xFA03, 0xFA04,
+ 0xFA05, 0xFA06, 0xFA07, 0xFA08, 0xFA09, 0xFA0A,
+ 0xFA0B, 0xFA0C, 0xFAF4, 0xFAF5, 0xFAF6, 0xFAF7,
+ 0xFAF8, 0xFAF9, 0xFAFA, 0xFAFB, 0xFAFC, 0xFAFD,
+ 0xFAFE, 0xFAFF, 0xFB00, 0xFB01, 0xFB02, 0xFB03,
+ 0xFB04, 0xFB05, 0xFB06, 0xFB07, 0xFB08, 0xFB09,
+ 0xFB0A, 0xFB0B, 0xFB0C, 0xFBF4, 0xFBF5, 0xFBF6,
+ 0xFBF7, 0xFBF8, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC,
+ 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02,
+ 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFC08,
+ 0xFC09, 0xFC0A, 0xFC0B, 0xFC0C, 0xFCF4, 0xFCF5,
+ 0xFCF6, 0xFCF7, 0xFCF8, 0xFCF9, 0xFCFA, 0xFCFB,
+ 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF, 0xFD00, 0xFD01,
+ 0xFD02, 0xFD03, 0xFD04, 0xFD05, 0xFD06, 0xFD07,
+ 0xFD08, 0xFD09, 0xFD0A, 0xFD0B, 0xFD0C, 0xFDF4,
+ 0xFDF5, 0xFDF6, 0xFDF7, 0xFDF8, 0xFDF9, 0xFDFA,
+ 0xFDFB, 0xFDFC, 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00,
+ 0xFE01, 0xFE02, 0xFE03, 0xFE04, 0xFE05, 0xFE06,
+ 0xFE07, 0xFE08, 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C,
+ 0xFEF4, 0xFEF5, 0xFEF6, 0xFEF7, 0xFEF8, 0xFEF9,
+ 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0xFEFF,
+ 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05,
+ 0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFF0B,
+ 0xFF0C, 0xFFF4, 0xFFF5, 0xFFF6, 0xFFF7, 0xFFF8,
+ 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE,
+ 0xFFFF,
+};
+
+#define ON2AVC_CB14_CODES 729
+static const uint16_t on2avc_cb14_codes[ON2AVC_CB14_CODES] = {
+ 0x0000, 0x0018, 0x009C, 0x033F, 0x06CF, 0x0860,
+ 0x3ED2, 0x15F8, 0x0CA3, 0x15F9, 0x3ED3, 0x3ED4,
+ 0x3ED5, 0x03B3, 0x0336, 0x3ECF, 0x3ED0, 0x15F5,
+ 0x15F6, 0x3ED1, 0x1FB6, 0x15F7, 0x0D6D, 0x074E,
+ 0x02A4, 0x008C, 0x0017, 0x0016, 0x0024, 0x00A8,
+ 0x02AB, 0x043C, 0x038D, 0x15FA, 0x0CA4, 0x1FB8,
+ 0x15FB, 0x3ED9, 0x1FB9, 0x15FC, 0x01D8, 0x01F1,
+ 0x3ED6, 0x1090, 0x1FB7, 0x0D6E, 0x3ED7, 0x3ED8,
+ 0x074F, 0x0D6F, 0x0750, 0x01F2, 0x0098, 0x0020,
+ 0x0070, 0x009D, 0x00E4, 0x026F, 0x03AE, 0x055D,
+ 0x06D0, 0x0862, 0x0667, 0x09ED, 0x1900, 0x3EDA,
+ 0x1901, 0x01DE, 0x026B, 0x15FD, 0x15FE, 0x1091,
+ 0x15FF, 0x0D70, 0x0666, 0x0689, 0x0861, 0x034E,
+ 0x026E, 0x00E8, 0x008E, 0x019E, 0x01BF, 0x01F3,
+ 0x02B5, 0x054E, 0x0669, 0x09EE, 0x09EF, 0x0D71,
+ 0x0CA5, 0x1FBB, 0x1FBC, 0x3EDF, 0x02A6, 0x01CA,
+ 0x3EDB, 0x3EDC, 0x3EDD, 0x3EDE, 0x1FBA, 0x1092,
+ 0x0863, 0x0751, 0x0668, 0x038E, 0x02B4, 0x01C4,
+ 0x068A, 0x0CA7, 0x06D1, 0x055F, 0x043E, 0x09F0,
+ 0x0865, 0x0866, 0x0867, 0x0752, 0x1902, 0x3EE2,
+ 0x1096, 0x0278, 0x02B6, 0x3EE0, 0x1FBD, 0x3EE1,
+ 0x0864, 0x1FBE, 0x0CA6, 0x1093, 0x1094, 0x1095,
+ 0x0478, 0x043D, 0x055E, 0x3EE5, 0x0CA9, 0x066A,
+ 0x0D75, 0x0560, 0x0561, 0x0868, 0x0D76, 0x0CAA,
+ 0x0CAB, 0x3EE6, 0x3EE7, 0x3EE8, 0x02AC, 0x038F,
+ 0x3EE3, 0x1FBF, 0x3EE4, 0x0D72, 0x0D73, 0x0D74,
+ 0x09F1, 0x068B, 0x0CA8, 0x0479, 0x06D2, 0x1097,
+ 0x1099, 0x09F3, 0x066B, 0x06D3, 0x0CAD, 0x109A,
+ 0x06D4, 0x068C, 0x06D5, 0x0D79, 0x0D7A, 0x109B,
+ 0x1FC1, 0x02B2, 0x0396, 0x3EE9, 0x1903, 0x3EEA,
+ 0x1904, 0x1905, 0x1FC0, 0x09F2, 0x0D77, 0x0D78,
+ 0x1098, 0x0562, 0x0CAC, 0x190C, 0x109C, 0x06D6,
+ 0x0D7C, 0x1FC4, 0x0D7D, 0x09F4, 0x06D7, 0x09F5,
+ 0x3EEE, 0x0CAE, 0x0D7E, 0x3EEF, 0x03AF, 0x043F,
+ 0x3EEB, 0x1906, 0x1FC2, 0x1907, 0x3EEC, 0x1908,
+ 0x1909, 0x190A, 0x1FC3, 0x3EED, 0x0D7B, 0x190B,
+ 0x1FC6, 0x10A1, 0x10A2, 0x0D7F, 0x0CB0, 0x190E,
+ 0x0D80, 0x10A3, 0x0869, 0x190F, 0x1910, 0x10A4,
+ 0x10A5, 0x0753, 0x068D, 0x3EF0, 0x3EF1, 0x190D,
+ 0x1FC5, 0x3EF2, 0x3EF3, 0x109D, 0x109E, 0x0CAF,
+ 0x109F, 0x3EF4, 0x10A0, 0x10A7, 0x3EFC, 0x0CB1,
+ 0x09F7, 0x1911, 0x10A8, 0x09F8, 0x10A9, 0x1912,
+ 0x06D9, 0x09F9, 0x3EFD, 0x1913, 0x068E, 0x06D8,
+ 0x3EF5, 0x3EF6, 0x3EF7, 0x3EF8, 0x3EF9, 0x0D81,
+ 0x3EFA, 0x1FC7, 0x1FC8, 0x10A6, 0x09F6, 0x3EFB,
+ 0x1FCE, 0x0CB2, 0x3F02, 0x10AA, 0x3F03, 0x1FCF,
+ 0x10AB, 0x10AC, 0x1916, 0x3F04, 0x09FA, 0x0D83,
+ 0x3F05, 0x068F, 0x086A, 0x1914, 0x3EFE, 0x1FC9,
+ 0x1FCA, 0x3EFF, 0x0D82, 0x1FCB, 0x1FCC, 0x3F00,
+ 0x1FCD, 0x3F01, 0x1915, 0x3F0F, 0x1918, 0x10AD,
+ 0x0CB3, 0x3F10, 0x1919, 0x3F11, 0x191A, 0x1FD2,
+ 0x0CB4, 0x0CB5, 0x10AE, 0x191B, 0x047A, 0x06DA,
+ 0x3F06, 0x3F07, 0x1917, 0x3F08, 0x3F09, 0x3F0A,
+ 0x3F0B, 0x3F0C, 0x3F0D, 0x3F0E, 0x1FD0, 0x1FD1,
+ 0x3F18, 0x191F, 0x1FDA, 0x3F19, 0x3F1A, 0x10AF,
+ 0x3F1B, 0x10B2, 0x1FDB, 0x0D86, 0x0D87, 0x10B3,
+ 0x0CB6, 0x086B, 0x09FB, 0x3F12, 0x1FD3, 0x1FD4,
+ 0x3F13, 0x1FD5, 0x191E, 0x1FD6, 0x3F14, 0x3F15,
+ 0x3F16, 0x1FD7, 0x3F17, 0x033A, 0x01AA, 0x02B8,
+ 0x01DF, 0x02B9, 0x02BA, 0x086F, 0x03BB, 0x03B2,
+ 0x046A, 0x066F, 0x08DE, 0x0563, 0x046B, 0x0CB7,
+ 0x11BE, 0x086E, 0x066E, 0x06DB, 0x047B, 0x03BA,
+ 0x0A9E, 0x02B7, 0x0340, 0x0264, 0x01CE, 0x01A9,
+ 0x0265, 0x01A8, 0x0266, 0x02A8, 0x036F, 0x03AB,
+ 0x037A, 0x04FE, 0x0683, 0x06C4, 0x0C90, 0x065D,
+ 0x0D3C, 0x0FEC, 0x0436, 0x06C2, 0x0682, 0x0C8E,
+ 0x055A, 0x033B, 0x065C, 0x0348, 0x03AA, 0x0234,
+ 0x036E, 0x01F0, 0x01A6, 0x3E86, 0x3E87, 0x153E,
+ 0x3E88, 0x3E89, 0x0FEF, 0x3E8A, 0x3E8B, 0x3E8C,
+ 0x3E8D, 0x3E8E, 0x3E8F, 0x3E90, 0x09E4, 0x03AC,
+ 0x11BF, 0x1F8E, 0x1F8F, 0x0FEE, 0x3E80, 0x3E81,
+ 0x3E82, 0x3E83, 0x3E84, 0x3E85, 0x1F90, 0x1F91,
+ 0x3E95, 0x3E96, 0x0C91, 0x3E97, 0x3E98, 0x3E99,
+ 0x3E9A, 0x3E9B, 0x3E9C, 0x3E9D, 0x3E9E, 0x3E9F,
+ 0x3EA0, 0x0858, 0x04FF, 0x0FF0, 0x0FF1, 0x153F,
+ 0x0FF2, 0x3E91, 0x1F92, 0x3E92, 0x1F93, 0x3E93,
+ 0x1F94, 0x3E94, 0x0D3D, 0x3EA3, 0x1F99, 0x0FF7,
+ 0x0D3E, 0x3EA4, 0x1F9A, 0x15D9, 0x0D3F, 0x3EA5,
+ 0x3EA6, 0x3EA7, 0x0D58, 0x3EA8, 0x06C5, 0x072E,
+ 0x3EA1, 0x1F95, 0x1F96, 0x0C92, 0x0FF3, 0x0FF4,
+ 0x0FF5, 0x15D8, 0x1F97, 0x0FF6, 0x1F98, 0x3EA2,
+ 0x3EAC, 0x0FF9, 0x1F9C, 0x15DB, 0x1F9D, 0x15DC,
+ 0x0FFA, 0x1F9E, 0x3EAD, 0x3EAE, 0x3EAF, 0x3EB0,
+ 0x3EB1, 0x065E, 0x055B, 0x3EA9, 0x0D59, 0x15DA,
+ 0x0FF8, 0x3EAA, 0x0D5A, 0x3EAB, 0x0D5B, 0x0D5C,
+ 0x0D5D, 0x072F, 0x1F9B, 0x3EB4, 0x1FA0, 0x073C,
+ 0x0D5F, 0x1FA1, 0x1FA2, 0x0FFE, 0x1FA3, 0x1FA4,
+ 0x3EB5, 0x3EB6, 0x3EB7, 0x3EB8, 0x065F, 0x06C6,
+ 0x3EB2, 0x15DD, 0x0FFB, 0x3EB3, 0x1F9F, 0x0D5E,
+ 0x0C93, 0x0C94, 0x0FFC, 0x0FFD, 0x15DE, 0x15DF,
+ 0x1FA7, 0x15E1, 0x06C7, 0x0D62, 0x15E2, 0x0C96,
+ 0x15E3, 0x1082, 0x15E4, 0x1FA8, 0x3EBA, 0x3EBB,
+ 0x3EBC, 0x0660, 0x046E, 0x3EB9, 0x1FA5, 0x0FFF,
+ 0x1FA6, 0x1080, 0x1081, 0x0D60, 0x0C95, 0x15E0,
+ 0x0D61, 0x073D, 0x085A, 0x15E6, 0x09E9, 0x085B,
+ 0x0C97, 0x1083, 0x0C98, 0x0D63, 0x0D64, 0x0C99,
+ 0x15E7, 0x15E8, 0x1FAC, 0x3EBE, 0x0684, 0x037B,
+ 0x1FA9, 0x1FAA, 0x3EBD, 0x073E, 0x1FAB, 0x15E5,
+ 0x06C8, 0x09E5, 0x09E6, 0x09E7, 0x0661, 0x09E8,
+ 0x1FAE, 0x0C9A, 0x06CA, 0x055C, 0x0C9B, 0x3EC0,
+ 0x15EB, 0x1085, 0x1086, 0x15EC, 0x1087, 0x3EC1,
+ 0x3EC2, 0x02A9, 0x02B3, 0x1FAD, 0x15E9, 0x3EBF,
+ 0x15EA, 0x1084, 0x0D65, 0x0662, 0x0D66, 0x06C9,
+ 0x0438, 0x054A, 0x073F, 0x085D, 0x0663, 0x0439,
+ 0x0686, 0x06CB, 0x0C9E, 0x0C9F, 0x1088, 0x15EF,
+ 0x3EC6, 0x1089, 0x1FAF, 0x3EC7, 0x0349, 0x0267,
+ 0x3EC3, 0x3EC4, 0x15ED, 0x15EE, 0x3EC5, 0x09EA,
+ 0x0C9C, 0x0C9D, 0x054B, 0x0685, 0x085C, 0x09EB,
+ 0x01BC, 0x01DC, 0x01BE, 0x03AD, 0x038A, 0x0749,
+ 0x0688, 0x0665, 0x074A, 0x0CA1, 0x0D68, 0x3EC8,
+ 0x1FB1, 0x0236, 0x034A, 0x1FB0, 0x108A, 0x108B,
+ 0x0CA0, 0x0D67, 0x0687, 0x0748, 0x0664, 0x038B,
+ 0x023E, 0x01DA, 0x01DB, 0x006E, 0x0094, 0x00E6,
+ 0x033E, 0x043A, 0x06CD, 0x085E, 0x085F, 0x0D69,
+ 0x0D6A, 0x1FB3, 0x1FB4, 0x3ECA, 0x034B, 0x023F,
+ 0x3EC9, 0x108C, 0x1FB2, 0x15F0, 0x15F1, 0x074B,
+ 0x06CC, 0x074C, 0x038C, 0x0268, 0x0136, 0x0095,
+ 0x0014, 0x001E, 0x0097, 0x019C, 0x074D, 0x0D6C,
+ 0x06CE, 0x0CA2, 0x108E, 0x09EC, 0x3ECD, 0x108F,
+ 0x3ECE, 0x026A, 0x02AA, 0x3ECB, 0x1FB5, 0x15F2,
+ 0x3ECC, 0x15F3, 0x15F4, 0x0D6B, 0x108D, 0x043B,
+ 0x0269, 0x0096, 0x0022,
+};
+
+static const uint8_t on2avc_cb14_bits[ON2AVC_CB14_CODES] = {
+ 1, 5, 8, 10, 11, 12,
+ 14, 13, 12, 13, 14, 14,
+ 14, 10, 10, 14, 14, 13,
+ 13, 14, 13, 13, 12, 11,
+ 10, 8, 5, 5, 6, 8,
+ 10, 11, 10, 13, 12, 13,
+ 13, 14, 13, 13, 9, 9,
+ 14, 13, 13, 12, 14, 14,
+ 11, 12, 11, 9, 8, 6,
+ 7, 8, 8, 10, 10, 11,
+ 11, 12, 11, 12, 13, 14,
+ 13, 9, 10, 13, 13, 13,
+ 13, 12, 11, 11, 12, 10,
+ 10, 8, 8, 9, 9, 9,
+ 10, 11, 11, 12, 12, 12,
+ 12, 13, 13, 14, 10, 9,
+ 14, 14, 14, 14, 13, 13,
+ 12, 11, 11, 10, 10, 9,
+ 11, 12, 11, 11, 11, 12,
+ 12, 12, 12, 11, 13, 14,
+ 13, 10, 10, 14, 13, 14,
+ 12, 13, 12, 13, 13, 13,
+ 11, 11, 11, 14, 12, 11,
+ 12, 11, 11, 12, 12, 12,
+ 12, 14, 14, 14, 10, 10,
+ 14, 13, 14, 12, 12, 12,
+ 12, 11, 12, 11, 11, 13,
+ 13, 12, 11, 11, 12, 13,
+ 11, 11, 11, 12, 12, 13,
+ 13, 10, 10, 14, 13, 14,
+ 13, 13, 13, 12, 12, 12,
+ 13, 11, 12, 13, 13, 11,
+ 12, 13, 12, 12, 11, 12,
+ 14, 12, 12, 14, 10, 11,
+ 14, 13, 13, 13, 14, 13,
+ 13, 13, 13, 14, 12, 13,
+ 13, 13, 13, 12, 12, 13,
+ 12, 13, 12, 13, 13, 13,
+ 13, 11, 11, 14, 14, 13,
+ 13, 14, 14, 13, 13, 12,
+ 13, 14, 13, 13, 14, 12,
+ 12, 13, 13, 12, 13, 13,
+ 11, 12, 14, 13, 11, 11,
+ 14, 14, 14, 14, 14, 12,
+ 14, 13, 13, 13, 12, 14,
+ 13, 12, 14, 13, 14, 13,
+ 13, 13, 13, 14, 12, 12,
+ 14, 11, 12, 13, 14, 13,
+ 13, 14, 12, 13, 13, 14,
+ 13, 14, 13, 14, 13, 13,
+ 12, 14, 13, 14, 13, 13,
+ 12, 12, 13, 13, 11, 11,
+ 14, 14, 13, 14, 14, 14,
+ 14, 14, 14, 14, 13, 13,
+ 14, 13, 13, 14, 14, 13,
+ 14, 13, 13, 12, 12, 13,
+ 12, 12, 12, 14, 13, 13,
+ 14, 13, 13, 13, 14, 14,
+ 14, 13, 14, 10, 9, 10,
+ 9, 10, 10, 12, 10, 10,
+ 11, 11, 12, 11, 11, 12,
+ 13, 12, 11, 11, 11, 10,
+ 12, 10, 10, 10, 9, 9,
+ 10, 9, 10, 10, 10, 10,
+ 10, 11, 11, 11, 12, 11,
+ 12, 12, 11, 11, 11, 12,
+ 11, 10, 11, 10, 10, 10,
+ 10, 9, 9, 14, 14, 13,
+ 14, 14, 12, 14, 14, 14,
+ 14, 14, 14, 14, 12, 10,
+ 13, 13, 13, 12, 14, 14,
+ 14, 14, 14, 14, 13, 13,
+ 14, 14, 12, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14,
+ 14, 12, 11, 12, 12, 13,
+ 12, 14, 13, 14, 13, 14,
+ 13, 14, 12, 14, 13, 12,
+ 12, 14, 13, 13, 12, 14,
+ 14, 14, 12, 14, 11, 11,
+ 14, 13, 13, 12, 12, 12,
+ 12, 13, 13, 12, 13, 14,
+ 14, 12, 13, 13, 13, 13,
+ 12, 13, 14, 14, 14, 14,
+ 14, 11, 11, 14, 12, 13,
+ 12, 14, 12, 14, 12, 12,
+ 12, 11, 13, 14, 13, 11,
+ 12, 13, 13, 12, 13, 13,
+ 14, 14, 14, 14, 11, 11,
+ 14, 13, 12, 14, 13, 12,
+ 12, 12, 12, 12, 13, 13,
+ 13, 13, 11, 12, 13, 12,
+ 13, 13, 13, 13, 14, 14,
+ 14, 11, 11, 14, 13, 12,
+ 13, 13, 13, 12, 12, 13,
+ 12, 11, 12, 13, 12, 12,
+ 12, 13, 12, 12, 12, 12,
+ 13, 13, 13, 14, 11, 10,
+ 13, 13, 14, 11, 13, 13,
+ 11, 12, 12, 12, 11, 12,
+ 13, 12, 11, 11, 12, 14,
+ 13, 13, 13, 13, 13, 14,
+ 14, 10, 10, 13, 13, 14,
+ 13, 13, 12, 11, 12, 11,
+ 11, 11, 11, 12, 11, 11,
+ 11, 11, 12, 12, 13, 13,
+ 14, 13, 13, 14, 10, 10,
+ 14, 14, 13, 13, 14, 12,
+ 12, 12, 11, 11, 12, 12,
+ 9, 9, 9, 10, 10, 11,
+ 11, 11, 11, 12, 12, 14,
+ 13, 10, 10, 13, 13, 13,
+ 12, 12, 11, 11, 11, 10,
+ 10, 9, 9, 7, 8, 8,
+ 10, 11, 11, 12, 12, 12,
+ 12, 13, 13, 14, 10, 10,
+ 14, 13, 13, 13, 13, 11,
+ 11, 11, 10, 10, 9, 8,
+ 5, 5, 8, 9, 11, 12,
+ 11, 12, 13, 12, 14, 13,
+ 14, 10, 10, 14, 13, 13,
+ 14, 13, 13, 12, 13, 11,
+ 10, 8, 6,
+};
+
+static const uint16_t on2avc_cb14_syms[ON2AVC_CB14_CODES] = {
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005,
+ 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B,
+ 0x000C, 0x000D, 0x00F3, 0x00F4, 0x00F5, 0x00F6,
+ 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC,
+ 0x00FD, 0x00FE, 0x00FF, 0x0100, 0x0101, 0x0102,
+ 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108,
+ 0x0109, 0x010A, 0x010B, 0x010C, 0x010D, 0x01F3,
+ 0x01F4, 0x01F5, 0x01F6, 0x01F7, 0x01F8, 0x01F9,
+ 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF,
+ 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205,
+ 0x0206, 0x0207, 0x0208, 0x0209, 0x020A, 0x020B,
+ 0x020C, 0x020D, 0x02F3, 0x02F4, 0x02F5, 0x02F6,
+ 0x02F7, 0x02F8, 0x02F9, 0x02FA, 0x02FB, 0x02FC,
+ 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302,
+ 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308,
+ 0x0309, 0x030A, 0x030B, 0x030C, 0x030D, 0x03F3,
+ 0x03F4, 0x03F5, 0x03F6, 0x03F7, 0x03F8, 0x03F9,
+ 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF,
+ 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405,
+ 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B,
+ 0x040C, 0x040D, 0x04F3, 0x04F4, 0x04F5, 0x04F6,
+ 0x04F7, 0x04F8, 0x04F9, 0x04FA, 0x04FB, 0x04FC,
+ 0x04FD, 0x04FE, 0x04FF, 0x0500, 0x0501, 0x0502,
+ 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, 0x0508,
+ 0x0509, 0x050A, 0x050B, 0x050C, 0x050D, 0x05F3,
+ 0x05F4, 0x05F5, 0x05F6, 0x05F7, 0x05F8, 0x05F9,
+ 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF,
+ 0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605,
+ 0x0606, 0x0607, 0x0608, 0x0609, 0x060A, 0x060B,
+ 0x060C, 0x060D, 0x06F3, 0x06F4, 0x06F5, 0x06F6,
+ 0x06F7, 0x06F8, 0x06F9, 0x06FA, 0x06FB, 0x06FC,
+ 0x06FD, 0x06FE, 0x06FF, 0x0700, 0x0701, 0x0702,
+ 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x0708,
+ 0x0709, 0x070A, 0x070B, 0x070C, 0x070D, 0x07F3,
+ 0x07F4, 0x07F5, 0x07F6, 0x07F7, 0x07F8, 0x07F9,
+ 0x07FA, 0x07FB, 0x07FC, 0x07FD, 0x07FE, 0x07FF,
+ 0x0800, 0x0801, 0x0802, 0x0803, 0x0804, 0x0805,
+ 0x0806, 0x0807, 0x0808, 0x0809, 0x080A, 0x080B,
+ 0x080C, 0x080D, 0x08F3, 0x08F4, 0x08F5, 0x08F6,
+ 0x08F7, 0x08F8, 0x08F9, 0x08FA, 0x08FB, 0x08FC,
+ 0x08FD, 0x08FE, 0x08FF, 0x0900, 0x0901, 0x0902,
+ 0x0903, 0x0904, 0x0905, 0x0906, 0x0907, 0x0908,
+ 0x0909, 0x090A, 0x090B, 0x090C, 0x090D, 0x09F3,
+ 0x09F4, 0x09F5, 0x09F6, 0x09F7, 0x09F8, 0x09F9,
+ 0x09FA, 0x09FB, 0x09FC, 0x09FD, 0x09FE, 0x09FF,
+ 0x0A00, 0x0A01, 0x0A02, 0x0A03, 0x0A04, 0x0A05,
+ 0x0A06, 0x0A07, 0x0A08, 0x0A09, 0x0A0A, 0x0A0B,
+ 0x0A0C, 0x0A0D, 0x0AF3, 0x0AF4, 0x0AF5, 0x0AF6,
+ 0x0AF7, 0x0AF8, 0x0AF9, 0x0AFA, 0x0AFB, 0x0AFC,
+ 0x0AFD, 0x0AFE, 0x0AFF, 0x0B00, 0x0B01, 0x0B02,
+ 0x0B03, 0x0B04, 0x0B05, 0x0B06, 0x0B07, 0x0B08,
+ 0x0B09, 0x0B0A, 0x0B0B, 0x0B0C, 0x0B0D, 0x0BF3,
+ 0x0BF4, 0x0BF5, 0x0BF6, 0x0BF7, 0x0BF8, 0x0BF9,
+ 0x0BFA, 0x0BFB, 0x0BFC, 0x0BFD, 0x0BFE, 0x0BFF,
+ 0x0C00, 0x0C01, 0x0C02, 0x0C03, 0x0C04, 0x0C05,
+ 0x0C06, 0x0C07, 0x0C08, 0x0C09, 0x0C0A, 0x0C0B,
+ 0x0C0C, 0x0C0D, 0x0CF3, 0x0CF4, 0x0CF5, 0x0CF6,
+ 0x0CF7, 0x0CF8, 0x0CF9, 0x0CFA, 0x0CFB, 0x0CFC,
+ 0x0CFD, 0x0CFE, 0x0CFF, 0x0D00, 0x0D01, 0x0D02,
+ 0x0D03, 0x0D04, 0x0D05, 0x0D06, 0x0D07, 0x0D08,
+ 0x0D09, 0x0D0A, 0x0D0B, 0x0D0C, 0x0D0D, 0x0DF3,
+ 0x0DF4, 0x0DF5, 0x0DF6, 0x0DF7, 0x0DF8, 0x0DF9,
+ 0x0DFA, 0x0DFB, 0x0DFC, 0x0DFD, 0x0DFE, 0x0DFF,
+ 0xF300, 0xF301, 0xF302, 0xF303, 0xF304, 0xF305,
+ 0xF306, 0xF307, 0xF308, 0xF309, 0xF30A, 0xF30B,
+ 0xF30C, 0xF30D, 0xF3F3, 0xF3F4, 0xF3F5, 0xF3F6,
+ 0xF3F7, 0xF3F8, 0xF3F9, 0xF3FA, 0xF3FB, 0xF3FC,
+ 0xF3FD, 0xF3FE, 0xF3FF, 0xF400, 0xF401, 0xF402,
+ 0xF403, 0xF404, 0xF405, 0xF406, 0xF407, 0xF408,
+ 0xF409, 0xF40A, 0xF40B, 0xF40C, 0xF40D, 0xF4F3,
+ 0xF4F4, 0xF4F5, 0xF4F6, 0xF4F7, 0xF4F8, 0xF4F9,
+ 0xF4FA, 0xF4FB, 0xF4FC, 0xF4FD, 0xF4FE, 0xF4FF,
+ 0xF500, 0xF501, 0xF502, 0xF503, 0xF504, 0xF505,
+ 0xF506, 0xF507, 0xF508, 0xF509, 0xF50A, 0xF50B,
+ 0xF50C, 0xF50D, 0xF5F3, 0xF5F4, 0xF5F5, 0xF5F6,
+ 0xF5F7, 0xF5F8, 0xF5F9, 0xF5FA, 0xF5FB, 0xF5FC,
+ 0xF5FD, 0xF5FE, 0xF5FF, 0xF600, 0xF601, 0xF602,
+ 0xF603, 0xF604, 0xF605, 0xF606, 0xF607, 0xF608,
+ 0xF609, 0xF60A, 0xF60B, 0xF60C, 0xF60D, 0xF6F3,
+ 0xF6F4, 0xF6F5, 0xF6F6, 0xF6F7, 0xF6F8, 0xF6F9,
+ 0xF6FA, 0xF6FB, 0xF6FC, 0xF6FD, 0xF6FE, 0xF6FF,
+ 0xF700, 0xF701, 0xF702, 0xF703, 0xF704, 0xF705,
+ 0xF706, 0xF707, 0xF708, 0xF709, 0xF70A, 0xF70B,
+ 0xF70C, 0xF70D, 0xF7F3, 0xF7F4, 0xF7F5, 0xF7F6,
+ 0xF7F7, 0xF7F8, 0xF7F9, 0xF7FA, 0xF7FB, 0xF7FC,
+ 0xF7FD, 0xF7FE, 0xF7FF, 0xF800, 0xF801, 0xF802,
+ 0xF803, 0xF804, 0xF805, 0xF806, 0xF807, 0xF808,
+ 0xF809, 0xF80A, 0xF80B, 0xF80C, 0xF80D, 0xF8F3,
+ 0xF8F4, 0xF8F5, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9,
+ 0xF8FA, 0xF8FB, 0xF8FC, 0xF8FD, 0xF8FE, 0xF8FF,
+ 0xF900, 0xF901, 0xF902, 0xF903, 0xF904, 0xF905,
+ 0xF906, 0xF907, 0xF908, 0xF909, 0xF90A, 0xF90B,
+ 0xF90C, 0xF90D, 0xF9F3, 0xF9F4, 0xF9F5, 0xF9F6,
+ 0xF9F7, 0xF9F8, 0xF9F9, 0xF9FA, 0xF9FB, 0xF9FC,
+ 0xF9FD, 0xF9FE, 0xF9FF, 0xFA00, 0xFA01, 0xFA02,
+ 0xFA03, 0xFA04, 0xFA05, 0xFA06, 0xFA07, 0xFA08,
+ 0xFA09, 0xFA0A, 0xFA0B, 0xFA0C, 0xFA0D, 0xFAF3,
+ 0xFAF4, 0xFAF5, 0xFAF6, 0xFAF7, 0xFAF8, 0xFAF9,
+ 0xFAFA, 0xFAFB, 0xFAFC, 0xFAFD, 0xFAFE, 0xFAFF,
+ 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05,
+ 0xFB06, 0xFB07, 0xFB08, 0xFB09, 0xFB0A, 0xFB0B,
+ 0xFB0C, 0xFB0D, 0xFBF3, 0xFBF4, 0xFBF5, 0xFBF6,
+ 0xFBF7, 0xFBF8, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC,
+ 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02,
+ 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFC08,
+ 0xFC09, 0xFC0A, 0xFC0B, 0xFC0C, 0xFC0D, 0xFCF3,
+ 0xFCF4, 0xFCF5, 0xFCF6, 0xFCF7, 0xFCF8, 0xFCF9,
+ 0xFCFA, 0xFCFB, 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF,
+ 0xFD00, 0xFD01, 0xFD02, 0xFD03, 0xFD04, 0xFD05,
+ 0xFD06, 0xFD07, 0xFD08, 0xFD09, 0xFD0A, 0xFD0B,
+ 0xFD0C, 0xFD0D, 0xFDF3, 0xFDF4, 0xFDF5, 0xFDF6,
+ 0xFDF7, 0xFDF8, 0xFDF9, 0xFDFA, 0xFDFB, 0xFDFC,
+ 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02,
+ 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, 0xFE08,
+ 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, 0xFEF3,
+ 0xFEF4, 0xFEF5, 0xFEF6, 0xFEF7, 0xFEF8, 0xFEF9,
+ 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0xFEFF,
+ 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05,
+ 0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFF0B,
+ 0xFF0C, 0xFF0D, 0xFFF3, 0xFFF4, 0xFFF5, 0xFFF6,
+ 0xFFF7, 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC,
+ 0xFFFD, 0xFFFE, 0xFFFF,
+};
+
+#define ON2AVC_CB15_CODES 1089
+static const uint16_t on2avc_cb15_codes[ON2AVC_CB15_CODES] = {
+ 0x00000, 0x0000A, 0x00064, 0x00104, 0x0034B, 0x0047B,
+ 0x007D7, 0x00E14, 0x00957, 0x021FD, 0x013B0, 0x03F08,
+ 0x07A01, 0x0E579, 0x00E15, 0x013A1, 0x003A2, 0x00397,
+ 0x0137F, 0x01F96, 0x021FC, 0x034CD, 0x01E97, 0x01A82,
+ 0x013A0, 0x01A83, 0x0089D, 0x00F6B, 0x0076C, 0x0026A,
+ 0x00118, 0x0006E, 0x00008, 0x0000B, 0x00015, 0x00076,
+ 0x000EC, 0x001D2, 0x003A6, 0x00716, 0x00726, 0x01F98,
+ 0x00E77, 0x01BF0, 0x01A84, 0x021FE, 0x021FF, 0x00D93,
+ 0x01A85, 0x0036E, 0x003B4, 0x00FFE, 0x00FDF, 0x07A02,
+ 0x065AF, 0x01E98, 0x01F97, 0x00E16, 0x00F30, 0x00CF0,
+ 0x00846, 0x00398, 0x0020F, 0x000EB, 0x00074, 0x00012,
+ 0x0007C, 0x00049, 0x0009C, 0x00136, 0x00344, 0x0026D,
+ 0x0076E, 0x00847, 0x00F6C, 0x00958, 0x01A86, 0x00F6D,
+ 0x013A3, 0x013B1, 0x009F8, 0x00F31, 0x0032F, 0x00268,
+ 0x00FE0, 0x0076D, 0x01F99, 0x013A2, 0x03D05, 0x0111A,
+ 0x00FFF, 0x00CF1, 0x0080D, 0x004FA, 0x0040B, 0x0023E,
+ 0x0011B, 0x0008E, 0x00077, 0x0010A, 0x000F8, 0x001B0,
+ 0x001D4, 0x003D9, 0x004C6, 0x006AE, 0x007DE, 0x0080E,
+ 0x00F33, 0x00E78, 0x01BF1, 0x0111B, 0x034CE, 0x00959,
+ 0x0111C, 0x00262, 0x001FA, 0x00F32, 0x00FE1, 0x02200,
+ 0x01F9A, 0x013A4, 0x00E17, 0x00FE2, 0x004B7, 0x00FE3,
+ 0x00717, 0x00453, 0x00366, 0x001C6, 0x0011A, 0x0010E,
+ 0x0032B, 0x0023F, 0x00345, 0x0035A, 0x0036F, 0x007B6,
+ 0x00E19, 0x00705, 0x0076F, 0x0111D, 0x00E79, 0x00D57,
+ 0x01BF4, 0x01A87, 0x0095B, 0x0095C, 0x00216, 0x0039A,
+ 0x00F34, 0x0095A, 0x01BF2, 0x01BF3, 0x01000, 0x00F6E,
+ 0x00F6F, 0x00E18, 0x007DF, 0x008F1, 0x007BE, 0x003BD,
+ 0x003EB, 0x00342, 0x0022D, 0x00772, 0x007BF, 0x00454,
+ 0x00455, 0x0071E, 0x004FB, 0x00727, 0x0080F, 0x009E7,
+ 0x00E7C, 0x01BF6, 0x01A89, 0x01001, 0x01BF7, 0x0089E,
+ 0x00E1A, 0x0027F, 0x00334, 0x00F35, 0x00F36, 0x01BF5,
+ 0x01F9B, 0x013A5, 0x00E7A, 0x0095D, 0x00D58, 0x00E7B,
+ 0x01A88, 0x00FE4, 0x006CE, 0x0040E, 0x00687, 0x006D2,
+ 0x00E1C, 0x00706, 0x00747, 0x006B6, 0x0084E, 0x00CF2,
+ 0x006F2, 0x00D59, 0x00CF3, 0x01004, 0x013A6, 0x00F71,
+ 0x01A8B, 0x01E99, 0x00D5A, 0x00D94, 0x00335, 0x0022E,
+ 0x0095E, 0x00E1B, 0x01A8A, 0x01BF8, 0x01BF9, 0x01002,
+ 0x009F9, 0x00F70, 0x01003, 0x00773, 0x00F37, 0x00812,
+ 0x004D2, 0x004A3, 0x0089F, 0x013A9, 0x013AA, 0x00813,
+ 0x0081E, 0x00707, 0x008A0, 0x00E1E, 0x00D95, 0x008F2,
+ 0x009FB, 0x00E7D, 0x00E7E, 0x00F39, 0x01F9C, 0x00CF4,
+ 0x00F75, 0x00346, 0x0026E, 0x01005, 0x00F72, 0x013A7,
+ 0x0111E, 0x01BFA, 0x00F73, 0x013A8, 0x00F38, 0x00F74,
+ 0x009FA, 0x00FE5, 0x0084F, 0x0095F, 0x00E1D, 0x009EA,
+ 0x01A8D, 0x00E20, 0x00E21, 0x007CE, 0x00D96, 0x01008,
+ 0x00E22, 0x00960, 0x01121, 0x00E7F, 0x01122, 0x01A8E,
+ 0x01BFB, 0x01A8F, 0x008A1, 0x01009, 0x0035F, 0x00368,
+ 0x013B2, 0x01A8C, 0x01F9D, 0x02201, 0x01006, 0x0111F,
+ 0x013AB, 0x013AC, 0x01120, 0x00F76, 0x01007, 0x009FC,
+ 0x008F3, 0x00E1F, 0x01E9A, 0x01F9F, 0x013B3, 0x00F3B,
+ 0x00F77, 0x00F78, 0x00FE7, 0x009FD, 0x00FE8, 0x01123,
+ 0x00D97, 0x01BFF, 0x00E80, 0x01A93, 0x01124, 0x00D9E,
+ 0x00D5B, 0x003DA, 0x003A7, 0x00961, 0x01BFC, 0x01F9E,
+ 0x01BFD, 0x01BFE, 0x01A90, 0x01A91, 0x013AD, 0x00F3A,
+ 0x01A92, 0x00FE6, 0x00962, 0x0085E, 0x00963, 0x013AE,
+ 0x03D06, 0x01C01, 0x013B5, 0x00965, 0x01FA2, 0x02202,
+ 0x009FE, 0x00F79, 0x00F7A, 0x00E23, 0x00E26, 0x00966,
+ 0x013B1, 0x01E9C, 0x00F7B, 0x008A2, 0x003FE, 0x003AB,
+ 0x00964, 0x013B4, 0x01C00, 0x01E9B, 0x01FA0, 0x01FA1,
+ 0x0100A, 0x013AF, 0x03F09, 0x00E81, 0x01A94, 0x01125,
+ 0x01126, 0x01A95, 0x013B0, 0x03D08, 0x01E9E, 0x01FA3,
+ 0x013B4, 0x01A99, 0x0100B, 0x013B9, 0x00F3E, 0x00967,
+ 0x00E27, 0x0100C, 0x01E9F, 0x00968, 0x01C05, 0x00F3F,
+ 0x00E82, 0x0039B, 0x00386, 0x01A96, 0x01C02, 0x03D07,
+ 0x013B6, 0x01C03, 0x01E9D, 0x01127, 0x01A97, 0x01C04,
+ 0x013B2, 0x013B3, 0x013B7, 0x01A98, 0x013B8, 0x03F0A,
+ 0x0E57A, 0x07A03, 0x013BB, 0x01FA4, 0x01A9C, 0x01FA5,
+ 0x01FA6, 0x013BC, 0x0100D, 0x01FA7, 0x013B5, 0x0100E,
+ 0x01A9D, 0x0100F, 0x0096A, 0x01128, 0x00328, 0x003FF,
+ 0x00969, 0x01EA0, 0x01C06, 0x013BA, 0x01A9A, 0x034CF,
+ 0x00F7C, 0x02203, 0x034D2, 0x01EA1, 0x01C07, 0x02204,
+ 0x01A9B, 0x01EA2, 0x06982, 0x03D09, 0x0E57B, 0x01FA8,
+ 0x013C2, 0x013C3, 0x01129, 0x01FA9, 0x0112A, 0x01010,
+ 0x01FAA, 0x01EA6, 0x03F0F, 0x013B6, 0x00CF5, 0x0072A,
+ 0x00F7D, 0x00340, 0x0025F, 0x02205, 0x02206, 0x06983,
+ 0x01C08, 0x013BD, 0x013BE, 0x01EA3, 0x013BF, 0x034D3,
+ 0x01EA4, 0x02207, 0x01A9E, 0x01EA5, 0x03F0B, 0x03F0E,
+ 0x01AA2, 0x00E00, 0x00E3E, 0x00D9F, 0x00D5F, 0x00CF7,
+ 0x00CFE, 0x01011, 0x00E85, 0x00E01, 0x00E02, 0x0096B,
+ 0x00CFF, 0x00F92, 0x00D6E, 0x008CA, 0x00359, 0x00456,
+ 0x01CAE, 0x03D0A, 0x01A9F, 0x0112B, 0x00E83, 0x013B7,
+ 0x00F7E, 0x009FF, 0x00E84, 0x00FE9, 0x009EB, 0x00F7F,
+ 0x008A3, 0x00D5E, 0x00CF6, 0x0112E, 0x0112F, 0x01016,
+ 0x00F93, 0x01FAE, 0x00FEA, 0x00FEB, 0x009A6, 0x00E03,
+ 0x01C0A, 0x01017, 0x01C0B, 0x01FAF, 0x00F9E, 0x013BB,
+ 0x0196A, 0x0039C, 0x003F6, 0x0379A, 0x03D0B, 0x01FAB,
+ 0x01EA7, 0x013B8, 0x01012, 0x01AA3, 0x01C09, 0x013B9,
+ 0x01013, 0x00CB4, 0x00E86, 0x01F3E, 0x013BA, 0x00E87,
+ 0x007FB, 0x003CF, 0x0037A, 0x003AD, 0x00387, 0x0038A,
+ 0x003B5, 0x0039E, 0x0026F, 0x0038B, 0x00272, 0x0039F,
+ 0x00399, 0x0038E, 0x00252, 0x0039A, 0x00018, 0x0001B,
+ 0x003CE, 0x00457, 0x003E8, 0x0067E, 0x0041A, 0x003BE,
+ 0x003BF, 0x003EE, 0x00437, 0x0039D, 0x003AC, 0x00464,
+ 0x003C6, 0x003C7, 0x0041B, 0x007F6, 0x0042E, 0x0025C,
+ 0x0038C, 0x003BA, 0x003E9, 0x003EA, 0x00271, 0x003BB,
+ 0x0026A, 0x0025D, 0x0025E, 0x00389, 0x003EE, 0x004F4,
+ 0x00415, 0x0001A, 0x00017, 0x00388, 0x0038E, 0x003FC,
+ 0x00270, 0x00378, 0x0038A, 0x003AE, 0x003AA, 0x00398,
+ 0x003E8, 0x00358, 0x00414, 0x00384, 0x003B8, 0x006D3,
+ 0x01A6B, 0x00FEA, 0x01BCE, 0x009E4, 0x00E56, 0x01BCF,
+ 0x0131D, 0x009E5, 0x01BD8, 0x01BD9, 0x034C0, 0x01F86,
+ 0x01A6C, 0x01F3F, 0x065AC, 0x072BE, 0x00436, 0x0022C,
+ 0x009E0, 0x00F54, 0x009E2, 0x01104, 0x01105, 0x00FE8,
+ 0x009E3, 0x00FE9, 0x00F55, 0x0131C, 0x01A68, 0x01A6A,
+ 0x00E06, 0x01106, 0x01BCC, 0x00E6E, 0x00E3F, 0x00CB7,
+ 0x00F28, 0x00702, 0x0094E, 0x00F29, 0x00FEC, 0x00F2A,
+ 0x0131E, 0x00F56, 0x0131F, 0x00F57, 0x0110A, 0x0134E,
+ 0x01E86, 0x00712, 0x001F6, 0x0081F, 0x00D6F, 0x00FEB,
+ 0x01107, 0x00CB6, 0x0094C, 0x01BDA, 0x01108, 0x01109,
+ 0x009E6, 0x00E6C, 0x01F88, 0x00E6D, 0x00896, 0x0094D,
+ 0x03F00, 0x01E88, 0x0217C, 0x03F01, 0x03F02, 0x01399,
+ 0x01E89, 0x0E578, 0x0139A, 0x01E8A, 0x01F8A, 0x01F8B,
+ 0x01E8B, 0x03D02, 0x01F8C, 0x0139B, 0x00392, 0x0035E,
+ 0x00F58, 0x009DE, 0x0094F, 0x01358, 0x01359, 0x0135A,
+ 0x0134F, 0x01BDB, 0x0135B, 0x0379B, 0x01F89, 0x01398,
+ 0x034C2, 0x065AD, 0x01E87, 0x03F04, 0x07A00, 0x0217D,
+ 0x01A6D, 0x065AE, 0x01E8C, 0x0217E, 0x01BDD, 0x0135C,
+ 0x01A6E, 0x034C4, 0x01E8D, 0x03F05, 0x01E8E, 0x0217F,
+ 0x0139D, 0x003F7, 0x0032C, 0x034C3, 0x00E07, 0x0110B,
+ 0x009E7, 0x00F59, 0x03D03, 0x00D8A, 0x01F8D, 0x00E6F,
+ 0x00FED, 0x03F03, 0x00FEE, 0x01BDC, 0x0139C, 0x072BF,
+ 0x03F06, 0x021F2, 0x01A70, 0x021F3, 0x0135E, 0x0139E,
+ 0x01F8E, 0x01F8F, 0x0139F, 0x01E91, 0x013A0, 0x0135F,
+ 0x034C6, 0x0110E, 0x01A71, 0x021F4, 0x0026C, 0x00206,
+ 0x0110C, 0x009E8, 0x01BDE, 0x00F5A, 0x00FEF, 0x0135D,
+ 0x00FF0, 0x01E8F, 0x021F0, 0x009E9, 0x01E90, 0x021F1,
+ 0x01A6F, 0x0110D, 0x034C5, 0x021F5, 0x01A73, 0x01BE2,
+ 0x01BE3, 0x01F91, 0x01A74, 0x00E70, 0x021F6, 0x034C8,
+ 0x00FF3, 0x01F92, 0x013A1, 0x013A2, 0x013A3, 0x01A75,
+ 0x01372, 0x003BC, 0x00341, 0x034C7, 0x00950, 0x00FF1,
+ 0x00FF2, 0x009EA, 0x00F5B, 0x01370, 0x01BDF, 0x01371,
+ 0x01A72, 0x01BE0, 0x009EB, 0x01F90, 0x0110F, 0x01BE1,
+ 0x01E92, 0x013A6, 0x00D8B, 0x00FD8, 0x01BE5, 0x00FF4,
+ 0x00FF5, 0x01BE6, 0x013A7, 0x00F5F, 0x01BE7, 0x021F7,
+ 0x021F8, 0x034C9, 0x009EC, 0x013A8, 0x003EF, 0x00269,
+ 0x00CD8, 0x00FD6, 0x00F5C, 0x013A4, 0x00F5D, 0x00F2B,
+ 0x00E08, 0x01110, 0x01BE4, 0x00E09, 0x013A5, 0x00F2C,
+ 0x00898, 0x00F5E, 0x01A76, 0x013A9, 0x00D8C, 0x009DF,
+ 0x009E0, 0x00FF8, 0x00D8D, 0x01374, 0x01A78, 0x01112,
+ 0x01BE8, 0x01A79, 0x01F93, 0x01113, 0x01375, 0x00F61,
+ 0x01376, 0x00399, 0x0027C, 0x009ED, 0x00F60, 0x01373,
+ 0x01A77, 0x00951, 0x009EE, 0x00D50, 0x00CD9, 0x00FF6,
+ 0x00FD9, 0x00FF7, 0x00899, 0x007C8, 0x00D52, 0x01111,
+ 0x009EF, 0x007D3, 0x007D4, 0x0071E, 0x00CDB, 0x00746,
+ 0x00E0A, 0x00E0B, 0x021F9, 0x00FF9, 0x01A7A, 0x00952,
+ 0x013AB, 0x01377, 0x009F0, 0x01E93, 0x003AF, 0x0032E,
+ 0x009E1, 0x007CA, 0x013AA, 0x01114, 0x00F62, 0x00E71,
+ 0x008CB, 0x008CC, 0x0089A, 0x008CD, 0x00840, 0x00CDA,
+ 0x007D2, 0x009E2, 0x00E72, 0x00F63, 0x006D6, 0x00841,
+ 0x0079E, 0x00D53, 0x008CE, 0x00955, 0x00E0C, 0x0137A,
+ 0x00E74, 0x01115, 0x01F94, 0x01116, 0x01BEA, 0x00E0D,
+ 0x01A7B, 0x0038D, 0x0033E, 0x00CDC, 0x00D8E, 0x01BE9,
+ 0x01378, 0x01379, 0x00FDA, 0x00E73, 0x00953, 0x00954,
+ 0x009E3, 0x004D6, 0x007B7, 0x007BA, 0x007BB, 0x004A0,
+ 0x0089B, 0x006D7, 0x0047A, 0x00408, 0x007F7, 0x00E0E,
+ 0x009E4, 0x007D5, 0x00842, 0x00D90, 0x009F1, 0x034CA,
+ 0x01A7C, 0x01A7D, 0x00E0F, 0x01A7E, 0x00329, 0x0021E,
+ 0x00F64, 0x01117, 0x021FA, 0x01118, 0x013AC, 0x013AD,
+ 0x00D8F, 0x008CF, 0x008F0, 0x0071F, 0x004A1, 0x00686,
+ 0x00426, 0x00416, 0x007CB, 0x003D8, 0x00264, 0x00347,
+ 0x003DC, 0x004F6, 0x004D7, 0x00F2D, 0x00F65, 0x009F3,
+ 0x00FDB, 0x00E75, 0x009F4, 0x0137B, 0x013AE, 0x009E5,
+ 0x00E10, 0x0027E, 0x0020C, 0x00FFA, 0x00956, 0x01BEB,
+ 0x01E94, 0x01E95, 0x00D91, 0x009F2, 0x00D54, 0x007BC,
+ 0x007BD, 0x0040A, 0x00385, 0x0036A, 0x0022F, 0x0020E,
+ 0x000FC, 0x000F2, 0x001AE, 0x001C8, 0x0034A, 0x004F7,
+ 0x00452, 0x00CDE, 0x00843, 0x00E76, 0x00F2E, 0x00F67,
+ 0x0137C, 0x01A7F, 0x0080C, 0x00FDC, 0x0021A, 0x001FC,
+ 0x00E11, 0x009F5, 0x01BEC, 0x00F66, 0x013AF, 0x00CDD,
+ 0x00E12, 0x00D55, 0x00703, 0x0080A, 0x00394, 0x00265,
+ 0x001F6, 0x001B6, 0x0010C, 0x00078, 0x0004C, 0x000CC,
+ 0x001A4, 0x00212, 0x00396, 0x006C4, 0x0089C, 0x00CDF,
+ 0x01A80, 0x00F68, 0x00FFD, 0x0137D, 0x01F95, 0x00845,
+ 0x00E13, 0x00267, 0x00266, 0x00FFB, 0x009F6, 0x03D04,
+ 0x01BED, 0x01BEE, 0x034CB, 0x00FFC, 0x00844, 0x007D6,
+ 0x00704, 0x003C8, 0x0032A, 0x00130, 0x000CE, 0x00048,
+ 0x0000C, 0x00014, 0x0007A, 0x000F0, 0x001E6, 0x00417,
+ 0x004A2, 0x004B6, 0x00D92, 0x01A81, 0x009F7, 0x0137E,
+ 0x01E96, 0x03F07, 0x009E6, 0x00FDE, 0x003C9, 0x00268,
+ 0x00F2F, 0x00D56, 0x021FB, 0x034CC, 0x01BEF, 0x00F69,
+ 0x01119, 0x00F6A, 0x00FDD, 0x007FA, 0x003E6, 0x001E2,
+ 0x000EA, 0x00072, 0x00016,
+};
+
+static const uint8_t on2avc_cb15_bits[ON2AVC_CB15_CODES] = {
+ 2, 5, 7, 9, 10, 11,
+ 12, 12, 13, 14, 14, 14,
+ 16, 17, 12, 13, 11, 11,
+ 13, 13, 14, 14, 14, 13,
+ 13, 13, 12, 13, 12, 10,
+ 9, 7, 5, 5, 5, 7,
+ 9, 10, 11, 11, 12, 13,
+ 13, 13, 13, 14, 14, 12,
+ 13, 10, 11, 13, 12, 16,
+ 15, 14, 13, 12, 12, 12,
+ 12, 11, 10, 9, 7, 5,
+ 7, 8, 8, 9, 10, 11,
+ 12, 12, 13, 13, 13, 13,
+ 13, 14, 13, 12, 10, 10,
+ 12, 12, 13, 13, 15, 13,
+ 13, 12, 12, 11, 11, 10,
+ 9, 8, 7, 9, 9, 9,
+ 9, 10, 11, 11, 12, 12,
+ 12, 13, 13, 13, 14, 13,
+ 13, 10, 10, 12, 12, 14,
+ 13, 13, 12, 12, 12, 12,
+ 11, 11, 10, 10, 9, 9,
+ 10, 10, 10, 10, 10, 11,
+ 12, 12, 12, 13, 13, 12,
+ 13, 13, 13, 13, 10, 10,
+ 12, 13, 13, 13, 13, 13,
+ 13, 12, 12, 12, 11, 11,
+ 10, 10, 10, 12, 11, 11,
+ 11, 11, 11, 12, 12, 12,
+ 13, 13, 13, 13, 13, 12,
+ 12, 10, 10, 12, 12, 13,
+ 13, 13, 13, 13, 12, 13,
+ 13, 12, 11, 11, 11, 11,
+ 12, 12, 12, 11, 12, 12,
+ 11, 12, 12, 13, 13, 13,
+ 13, 14, 12, 12, 10, 10,
+ 13, 12, 13, 13, 13, 13,
+ 13, 13, 13, 12, 12, 12,
+ 12, 12, 12, 13, 13, 12,
+ 12, 12, 12, 12, 12, 12,
+ 13, 13, 13, 12, 13, 12,
+ 13, 10, 11, 13, 13, 13,
+ 13, 13, 13, 13, 12, 13,
+ 13, 12, 12, 13, 12, 12,
+ 13, 12, 12, 12, 12, 13,
+ 12, 13, 13, 13, 13, 13,
+ 13, 13, 12, 13, 10, 10,
+ 14, 13, 13, 14, 13, 13,
+ 13, 13, 13, 13, 13, 13,
+ 12, 12, 14, 13, 14, 12,
+ 13, 13, 12, 13, 12, 13,
+ 12, 13, 13, 13, 13, 12,
+ 12, 10, 11, 13, 13, 13,
+ 13, 13, 13, 13, 13, 12,
+ 13, 12, 13, 12, 13, 13,
+ 15, 13, 14, 13, 13, 14,
+ 13, 13, 13, 12, 12, 13,
+ 13, 14, 13, 12, 10, 10,
+ 13, 14, 13, 14, 13, 13,
+ 13, 13, 14, 13, 13, 13,
+ 13, 13, 13, 15, 14, 13,
+ 13, 13, 13, 14, 12, 13,
+ 12, 13, 14, 13, 13, 12,
+ 13, 10, 11, 13, 13, 15,
+ 14, 13, 14, 13, 13, 13,
+ 13, 13, 14, 13, 14, 14,
+ 17, 16, 14, 13, 13, 13,
+ 13, 14, 13, 13, 13, 13,
+ 13, 13, 13, 13, 10, 10,
+ 13, 14, 13, 14, 13, 14,
+ 13, 14, 14, 14, 13, 14,
+ 13, 14, 15, 15, 17, 13,
+ 14, 14, 13, 13, 13, 13,
+ 13, 14, 14, 13, 12, 12,
+ 13, 10, 11, 14, 14, 15,
+ 13, 14, 14, 14, 14, 14,
+ 14, 14, 13, 14, 14, 14,
+ 13, 13, 12, 12, 12, 12,
+ 12, 13, 13, 13, 13, 13,
+ 12, 13, 12, 12, 10, 11,
+ 14, 15, 13, 13, 13, 13,
+ 13, 13, 13, 12, 12, 13,
+ 12, 12, 12, 13, 13, 13,
+ 13, 13, 12, 12, 13, 13,
+ 13, 13, 13, 13, 13, 13,
+ 13, 10, 11, 14, 15, 13,
+ 14, 13, 13, 13, 13, 13,
+ 13, 12, 13, 14, 13, 13,
+ 11, 11, 10, 10, 11, 11,
+ 11, 10, 11, 11, 11, 10,
+ 11, 11, 11, 11, 5, 6,
+ 11, 11, 11, 11, 11, 11,
+ 11, 10, 11, 10, 10, 11,
+ 11, 11, 11, 11, 11, 11,
+ 10, 11, 10, 10, 11, 11,
+ 11, 11, 11, 11, 11, 11,
+ 11, 6, 5, 11, 10, 10,
+ 11, 10, 10, 10, 10, 10,
+ 10, 10, 11, 11, 11, 11,
+ 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 14, 13,
+ 13, 14, 15, 16, 11, 10,
+ 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13,
+ 12, 13, 13, 13, 12, 12,
+ 12, 12, 13, 12, 13, 12,
+ 13, 13, 13, 13, 13, 14,
+ 14, 11, 10, 12, 12, 13,
+ 13, 12, 13, 13, 13, 13,
+ 13, 13, 13, 13, 12, 13,
+ 14, 14, 14, 14, 14, 14,
+ 14, 17, 14, 14, 13, 13,
+ 14, 15, 13, 14, 11, 10,
+ 13, 12, 13, 13, 13, 13,
+ 14, 13, 13, 14, 13, 14,
+ 14, 15, 14, 14, 16, 14,
+ 13, 15, 14, 14, 13, 13,
+ 13, 14, 14, 14, 14, 14,
+ 14, 11, 10, 14, 12, 13,
+ 13, 13, 15, 12, 13, 13,
+ 13, 14, 13, 13, 14, 16,
+ 14, 14, 13, 14, 13, 14,
+ 13, 13, 14, 14, 14, 13,
+ 14, 13, 13, 14, 11, 10,
+ 13, 13, 13, 13, 13, 13,
+ 13, 14, 14, 13, 14, 14,
+ 13, 13, 14, 14, 13, 13,
+ 13, 13, 13, 13, 14, 14,
+ 13, 13, 14, 14, 14, 13,
+ 13, 11, 10, 14, 13, 13,
+ 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13,
+ 14, 14, 12, 12, 13, 13,
+ 13, 13, 14, 13, 13, 14,
+ 14, 14, 13, 14, 10, 10,
+ 12, 12, 13, 14, 13, 12,
+ 12, 13, 13, 12, 14, 12,
+ 12, 13, 13, 14, 12, 12,
+ 12, 13, 12, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13,
+ 13, 10, 10, 13, 13, 13,
+ 13, 13, 13, 12, 12, 13,
+ 12, 13, 12, 12, 12, 13,
+ 13, 12, 12, 12, 12, 12,
+ 12, 12, 14, 13, 13, 13,
+ 14, 13, 13, 14, 10, 10,
+ 12, 12, 14, 13, 13, 13,
+ 12, 12, 12, 12, 12, 12,
+ 12, 12, 13, 13, 11, 12,
+ 11, 12, 12, 13, 12, 13,
+ 13, 13, 13, 13, 13, 12,
+ 13, 10, 10, 12, 12, 13,
+ 13, 13, 12, 13, 13, 13,
+ 12, 12, 11, 11, 11, 12,
+ 12, 11, 11, 11, 11, 12,
+ 12, 12, 12, 12, 13, 14,
+ 13, 13, 12, 13, 10, 10,
+ 13, 13, 14, 13, 14, 14,
+ 12, 12, 12, 12, 12, 11,
+ 11, 11, 12, 10, 10, 10,
+ 10, 11, 12, 12, 13, 13,
+ 12, 13, 13, 13, 14, 12,
+ 12, 10, 10, 13, 13, 13,
+ 14, 14, 12, 13, 12, 11,
+ 11, 11, 11, 10, 10, 10,
+ 9, 9, 9, 10, 10, 11,
+ 11, 12, 12, 13, 12, 13,
+ 13, 13, 12, 12, 10, 10,
+ 12, 13, 13, 13, 14, 12,
+ 12, 12, 12, 12, 11, 10,
+ 9, 9, 9, 7, 8, 8,
+ 9, 10, 11, 11, 12, 12,
+ 13, 13, 13, 13, 13, 12,
+ 12, 10, 10, 13, 13, 15,
+ 13, 13, 14, 13, 12, 12,
+ 12, 10, 10, 9, 8, 8,
+ 5, 5, 7, 9, 10, 11,
+ 12, 12, 12, 13, 13, 13,
+ 14, 14, 12, 12, 10, 11,
+ 12, 12, 14, 14, 13, 13,
+ 13, 13, 12, 11, 11, 10,
+ 9, 7, 5,
+};
+
+static const uint16_t on2avc_cb15_syms[ON2AVC_CB15_CODES] = {
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005,
+ 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B,
+ 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x00F0,
+ 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6,
+ 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC,
+ 0x00FD, 0x00FE, 0x00FF, 0x0100, 0x0101, 0x0102,
+ 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108,
+ 0x0109, 0x010A, 0x010B, 0x010C, 0x010D, 0x010E,
+ 0x010F, 0x0110, 0x01F0, 0x01F1, 0x01F2, 0x01F3,
+ 0x01F4, 0x01F5, 0x01F6, 0x01F7, 0x01F8, 0x01F9,
+ 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF,
+ 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205,
+ 0x0206, 0x0207, 0x0208, 0x0209, 0x020A, 0x020B,
+ 0x020C, 0x020D, 0x020E, 0x020F, 0x0210, 0x02F0,
+ 0x02F1, 0x02F2, 0x02F3, 0x02F4, 0x02F5, 0x02F6,
+ 0x02F7, 0x02F8, 0x02F9, 0x02FA, 0x02FB, 0x02FC,
+ 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302,
+ 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308,
+ 0x0309, 0x030A, 0x030B, 0x030C, 0x030D, 0x030E,
+ 0x030F, 0x0310, 0x03F0, 0x03F1, 0x03F2, 0x03F3,
+ 0x03F4, 0x03F5, 0x03F6, 0x03F7, 0x03F8, 0x03F9,
+ 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF,
+ 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405,
+ 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B,
+ 0x040C, 0x040D, 0x040E, 0x040F, 0x0410, 0x04F0,
+ 0x04F1, 0x04F2, 0x04F3, 0x04F4, 0x04F5, 0x04F6,
+ 0x04F7, 0x04F8, 0x04F9, 0x04FA, 0x04FB, 0x04FC,
+ 0x04FD, 0x04FE, 0x04FF, 0x0500, 0x0501, 0x0502,
+ 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, 0x0508,
+ 0x0509, 0x050A, 0x050B, 0x050C, 0x050D, 0x050E,
+ 0x050F, 0x0510, 0x05F0, 0x05F1, 0x05F2, 0x05F3,
+ 0x05F4, 0x05F5, 0x05F6, 0x05F7, 0x05F8, 0x05F9,
+ 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF,
+ 0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605,
+ 0x0606, 0x0607, 0x0608, 0x0609, 0x060A, 0x060B,
+ 0x060C, 0x060D, 0x060E, 0x060F, 0x0610, 0x06F0,
+ 0x06F1, 0x06F2, 0x06F3, 0x06F4, 0x06F5, 0x06F6,
+ 0x06F7, 0x06F8, 0x06F9, 0x06FA, 0x06FB, 0x06FC,
+ 0x06FD, 0x06FE, 0x06FF, 0x0700, 0x0701, 0x0702,
+ 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x0708,
+ 0x0709, 0x070A, 0x070B, 0x070C, 0x070D, 0x070E,
+ 0x070F, 0x0710, 0x07F0, 0x07F1, 0x07F2, 0x07F3,
+ 0x07F4, 0x07F5, 0x07F6, 0x07F7, 0x07F8, 0x07F9,
+ 0x07FA, 0x07FB, 0x07FC, 0x07FD, 0x07FE, 0x07FF,
+ 0x0800, 0x0801, 0x0802, 0x0803, 0x0804, 0x0805,
+ 0x0806, 0x0807, 0x0808, 0x0809, 0x080A, 0x080B,
+ 0x080C, 0x080D, 0x080E, 0x080F, 0x0810, 0x08F0,
+ 0x08F1, 0x08F2, 0x08F3, 0x08F4, 0x08F5, 0x08F6,
+ 0x08F7, 0x08F8, 0x08F9, 0x08FA, 0x08FB, 0x08FC,
+ 0x08FD, 0x08FE, 0x08FF, 0x0900, 0x0901, 0x0902,
+ 0x0903, 0x0904, 0x0905, 0x0906, 0x0907, 0x0908,
+ 0x0909, 0x090A, 0x090B, 0x090C, 0x090D, 0x090E,
+ 0x090F, 0x0910, 0x09F0, 0x09F1, 0x09F2, 0x09F3,
+ 0x09F4, 0x09F5, 0x09F6, 0x09F7, 0x09F8, 0x09F9,
+ 0x09FA, 0x09FB, 0x09FC, 0x09FD, 0x09FE, 0x09FF,
+ 0x0A00, 0x0A01, 0x0A02, 0x0A03, 0x0A04, 0x0A05,
+ 0x0A06, 0x0A07, 0x0A08, 0x0A09, 0x0A0A, 0x0A0B,
+ 0x0A0C, 0x0A0D, 0x0A0E, 0x0A0F, 0x0A10, 0x0AF0,
+ 0x0AF1, 0x0AF2, 0x0AF3, 0x0AF4, 0x0AF5, 0x0AF6,
+ 0x0AF7, 0x0AF8, 0x0AF9, 0x0AFA, 0x0AFB, 0x0AFC,
+ 0x0AFD, 0x0AFE, 0x0AFF, 0x0B00, 0x0B01, 0x0B02,
+ 0x0B03, 0x0B04, 0x0B05, 0x0B06, 0x0B07, 0x0B08,
+ 0x0B09, 0x0B0A, 0x0B0B, 0x0B0C, 0x0B0D, 0x0B0E,
+ 0x0B0F, 0x0B10, 0x0BF0, 0x0BF1, 0x0BF2, 0x0BF3,
+ 0x0BF4, 0x0BF5, 0x0BF6, 0x0BF7, 0x0BF8, 0x0BF9,
+ 0x0BFA, 0x0BFB, 0x0BFC, 0x0BFD, 0x0BFE, 0x0BFF,
+ 0x0C00, 0x0C01, 0x0C02, 0x0C03, 0x0C04, 0x0C05,
+ 0x0C06, 0x0C07, 0x0C08, 0x0C09, 0x0C0A, 0x0C0B,
+ 0x0C0C, 0x0C0D, 0x0C0E, 0x0C0F, 0x0C10, 0x0CF0,
+ 0x0CF1, 0x0CF2, 0x0CF3, 0x0CF4, 0x0CF5, 0x0CF6,
+ 0x0CF7, 0x0CF8, 0x0CF9, 0x0CFA, 0x0CFB, 0x0CFC,
+ 0x0CFD, 0x0CFE, 0x0CFF, 0x0D00, 0x0D01, 0x0D02,
+ 0x0D03, 0x0D04, 0x0D05, 0x0D06, 0x0D07, 0x0D08,
+ 0x0D09, 0x0D0A, 0x0D0B, 0x0D0C, 0x0D0D, 0x0D0E,
+ 0x0D0F, 0x0D10, 0x0DF0, 0x0DF1, 0x0DF2, 0x0DF3,
+ 0x0DF4, 0x0DF5, 0x0DF6, 0x0DF7, 0x0DF8, 0x0DF9,
+ 0x0DFA, 0x0DFB, 0x0DFC, 0x0DFD, 0x0DFE, 0x0DFF,
+ 0x0E00, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05,
+ 0x0E06, 0x0E07, 0x0E08, 0x0E09, 0x0E0A, 0x0E0B,
+ 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F, 0x0E10, 0x0EF0,
+ 0x0EF1, 0x0EF2, 0x0EF3, 0x0EF4, 0x0EF5, 0x0EF6,
+ 0x0EF7, 0x0EF8, 0x0EF9, 0x0EFA, 0x0EFB, 0x0EFC,
+ 0x0EFD, 0x0EFE, 0x0EFF, 0x0F00, 0x0F01, 0x0F02,
+ 0x0F03, 0x0F04, 0x0F05, 0x0F06, 0x0F07, 0x0F08,
+ 0x0F09, 0x0F0A, 0x0F0B, 0x0F0C, 0x0F0D, 0x0F0E,
+ 0x0F0F, 0x0F10, 0x0FF0, 0x0FF1, 0x0FF2, 0x0FF3,
+ 0x0FF4, 0x0FF5, 0x0FF6, 0x0FF7, 0x0FF8, 0x0FF9,
+ 0x0FFA, 0x0FFB, 0x0FFC, 0x0FFD, 0x0FFE, 0x0FFF,
+ 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005,
+ 0x1006, 0x1007, 0x1008, 0x1009, 0x100A, 0x100B,
+ 0x100C, 0x100D, 0x100E, 0x100F, 0x1010, 0x10F0,
+ 0x10F1, 0x10F2, 0x10F3, 0x10F4, 0x10F5, 0x10F6,
+ 0x10F7, 0x10F8, 0x10F9, 0x10FA, 0x10FB, 0x10FC,
+ 0x10FD, 0x10FE, 0x10FF, 0xF000, 0xF001, 0xF002,
+ 0xF003, 0xF004, 0xF005, 0xF006, 0xF007, 0xF008,
+ 0xF009, 0xF00A, 0xF00B, 0xF00C, 0xF00D, 0xF00E,
+ 0xF00F, 0xF010, 0xF0F0, 0xF0F1, 0xF0F2, 0xF0F3,
+ 0xF0F4, 0xF0F5, 0xF0F6, 0xF0F7, 0xF0F8, 0xF0F9,
+ 0xF0FA, 0xF0FB, 0xF0FC, 0xF0FD, 0xF0FE, 0xF0FF,
+ 0xF100, 0xF101, 0xF102, 0xF103, 0xF104, 0xF105,
+ 0xF106, 0xF107, 0xF108, 0xF109, 0xF10A, 0xF10B,
+ 0xF10C, 0xF10D, 0xF10E, 0xF10F, 0xF110, 0xF1F0,
+ 0xF1F1, 0xF1F2, 0xF1F3, 0xF1F4, 0xF1F5, 0xF1F6,
+ 0xF1F7, 0xF1F8, 0xF1F9, 0xF1FA, 0xF1FB, 0xF1FC,
+ 0xF1FD, 0xF1FE, 0xF1FF, 0xF200, 0xF201, 0xF202,
+ 0xF203, 0xF204, 0xF205, 0xF206, 0xF207, 0xF208,
+ 0xF209, 0xF20A, 0xF20B, 0xF20C, 0xF20D, 0xF20E,
+ 0xF20F, 0xF210, 0xF2F0, 0xF2F1, 0xF2F2, 0xF2F3,
+ 0xF2F4, 0xF2F5, 0xF2F6, 0xF2F7, 0xF2F8, 0xF2F9,
+ 0xF2FA, 0xF2FB, 0xF2FC, 0xF2FD, 0xF2FE, 0xF2FF,
+ 0xF300, 0xF301, 0xF302, 0xF303, 0xF304, 0xF305,
+ 0xF306, 0xF307, 0xF308, 0xF309, 0xF30A, 0xF30B,
+ 0xF30C, 0xF30D, 0xF30E, 0xF30F, 0xF310, 0xF3F0,
+ 0xF3F1, 0xF3F2, 0xF3F3, 0xF3F4, 0xF3F5, 0xF3F6,
+ 0xF3F7, 0xF3F8, 0xF3F9, 0xF3FA, 0xF3FB, 0xF3FC,
+ 0xF3FD, 0xF3FE, 0xF3FF, 0xF400, 0xF401, 0xF402,
+ 0xF403, 0xF404, 0xF405, 0xF406, 0xF407, 0xF408,
+ 0xF409, 0xF40A, 0xF40B, 0xF40C, 0xF40D, 0xF40E,
+ 0xF40F, 0xF410, 0xF4F0, 0xF4F1, 0xF4F2, 0xF4F3,
+ 0xF4F4, 0xF4F5, 0xF4F6, 0xF4F7, 0xF4F8, 0xF4F9,
+ 0xF4FA, 0xF4FB, 0xF4FC, 0xF4FD, 0xF4FE, 0xF4FF,
+ 0xF500, 0xF501, 0xF502, 0xF503, 0xF504, 0xF505,
+ 0xF506, 0xF507, 0xF508, 0xF509, 0xF50A, 0xF50B,
+ 0xF50C, 0xF50D, 0xF50E, 0xF50F, 0xF510, 0xF5F0,
+ 0xF5F1, 0xF5F2, 0xF5F3, 0xF5F4, 0xF5F5, 0xF5F6,
+ 0xF5F7, 0xF5F8, 0xF5F9, 0xF5FA, 0xF5FB, 0xF5FC,
+ 0xF5FD, 0xF5FE, 0xF5FF, 0xF600, 0xF601, 0xF602,
+ 0xF603, 0xF604, 0xF605, 0xF606, 0xF607, 0xF608,
+ 0xF609, 0xF60A, 0xF60B, 0xF60C, 0xF60D, 0xF60E,
+ 0xF60F, 0xF610, 0xF6F0, 0xF6F1, 0xF6F2, 0xF6F3,
+ 0xF6F4, 0xF6F5, 0xF6F6, 0xF6F7, 0xF6F8, 0xF6F9,
+ 0xF6FA, 0xF6FB, 0xF6FC, 0xF6FD, 0xF6FE, 0xF6FF,
+ 0xF700, 0xF701, 0xF702, 0xF703, 0xF704, 0xF705,
+ 0xF706, 0xF707, 0xF708, 0xF709, 0xF70A, 0xF70B,
+ 0xF70C, 0xF70D, 0xF70E, 0xF70F, 0xF710, 0xF7F0,
+ 0xF7F1, 0xF7F2, 0xF7F3, 0xF7F4, 0xF7F5, 0xF7F6,
+ 0xF7F7, 0xF7F8, 0xF7F9, 0xF7FA, 0xF7FB, 0xF7FC,
+ 0xF7FD, 0xF7FE, 0xF7FF, 0xF800, 0xF801, 0xF802,
+ 0xF803, 0xF804, 0xF805, 0xF806, 0xF807, 0xF808,
+ 0xF809, 0xF80A, 0xF80B, 0xF80C, 0xF80D, 0xF80E,
+ 0xF80F, 0xF810, 0xF8F0, 0xF8F1, 0xF8F2, 0xF8F3,
+ 0xF8F4, 0xF8F5, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9,
+ 0xF8FA, 0xF8FB, 0xF8FC, 0xF8FD, 0xF8FE, 0xF8FF,
+ 0xF900, 0xF901, 0xF902, 0xF903, 0xF904, 0xF905,
+ 0xF906, 0xF907, 0xF908, 0xF909, 0xF90A, 0xF90B,
+ 0xF90C, 0xF90D, 0xF90E, 0xF90F, 0xF910, 0xF9F0,
+ 0xF9F1, 0xF9F2, 0xF9F3, 0xF9F4, 0xF9F5, 0xF9F6,
+ 0xF9F7, 0xF9F8, 0xF9F9, 0xF9FA, 0xF9FB, 0xF9FC,
+ 0xF9FD, 0xF9FE, 0xF9FF, 0xFA00, 0xFA01, 0xFA02,
+ 0xFA03, 0xFA04, 0xFA05, 0xFA06, 0xFA07, 0xFA08,
+ 0xFA09, 0xFA0A, 0xFA0B, 0xFA0C, 0xFA0D, 0xFA0E,
+ 0xFA0F, 0xFA10, 0xFAF0, 0xFAF1, 0xFAF2, 0xFAF3,
+ 0xFAF4, 0xFAF5, 0xFAF6, 0xFAF7, 0xFAF8, 0xFAF9,
+ 0xFAFA, 0xFAFB, 0xFAFC, 0xFAFD, 0xFAFE, 0xFAFF,
+ 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05,
+ 0xFB06, 0xFB07, 0xFB08, 0xFB09, 0xFB0A, 0xFB0B,
+ 0xFB0C, 0xFB0D, 0xFB0E, 0xFB0F, 0xFB10, 0xFBF0,
+ 0xFBF1, 0xFBF2, 0xFBF3, 0xFBF4, 0xFBF5, 0xFBF6,
+ 0xFBF7, 0xFBF8, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC,
+ 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02,
+ 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFC08,
+ 0xFC09, 0xFC0A, 0xFC0B, 0xFC0C, 0xFC0D, 0xFC0E,
+ 0xFC0F, 0xFC10, 0xFCF0, 0xFCF1, 0xFCF2, 0xFCF3,
+ 0xFCF4, 0xFCF5, 0xFCF6, 0xFCF7, 0xFCF8, 0xFCF9,
+ 0xFCFA, 0xFCFB, 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF,
+ 0xFD00, 0xFD01, 0xFD02, 0xFD03, 0xFD04, 0xFD05,
+ 0xFD06, 0xFD07, 0xFD08, 0xFD09, 0xFD0A, 0xFD0B,
+ 0xFD0C, 0xFD0D, 0xFD0E, 0xFD0F, 0xFD10, 0xFDF0,
+ 0xFDF1, 0xFDF2, 0xFDF3, 0xFDF4, 0xFDF5, 0xFDF6,
+ 0xFDF7, 0xFDF8, 0xFDF9, 0xFDFA, 0xFDFB, 0xFDFC,
+ 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02,
+ 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, 0xFE08,
+ 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, 0xFE0E,
+ 0xFE0F, 0xFE10, 0xFEF0, 0xFEF1, 0xFEF2, 0xFEF3,
+ 0xFEF4, 0xFEF5, 0xFEF6, 0xFEF7, 0xFEF8, 0xFEF9,
+ 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0xFEFF,
+ 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05,
+ 0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFF0B,
+ 0xFF0C, 0xFF0D, 0xFF0E, 0xFF0F, 0xFF10, 0xFFF0,
+ 0xFFF1, 0xFFF2, 0xFFF3, 0xFFF4, 0xFFF5, 0xFFF6,
+ 0xFFF7, 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC,
+ 0xFFFD, 0xFFFE, 0xFFFF,
+};
+
+const uint32_t * const ff_on2avc_quad_cb_codes[] = {
+ on2avc_cb1_codes, on2avc_cb2_codes, on2avc_cb3_codes, on2avc_cb4_codes,
+ on2avc_cb5_codes, on2avc_cb6_codes, on2avc_cb7_codes, on2avc_cb8_codes
+};
+
+const uint8_t * const ff_on2avc_quad_cb_bits[] = {
+ on2avc_cb1_bits, on2avc_cb2_bits, on2avc_cb3_bits, on2avc_cb4_bits,
+ on2avc_cb5_bits, on2avc_cb6_bits, on2avc_cb7_bits, on2avc_cb8_bits
+};
+
+const uint16_t * const ff_on2avc_quad_cb_syms[] = {
+ on2avc_cb1_syms, on2avc_cb2_syms, on2avc_cb3_syms, on2avc_cb4_syms,
+ on2avc_cb5_syms, on2avc_cb6_syms, on2avc_cb7_syms, on2avc_cb8_syms
+};
+
+const int ff_on2avc_quad_cb_elems[] = {
+ ON2AVC_CB1_CODES, ON2AVC_CB2_CODES, ON2AVC_CB3_CODES, ON2AVC_CB4_CODES,
+ ON2AVC_CB5_CODES, ON2AVC_CB6_CODES, ON2AVC_CB7_CODES, ON2AVC_CB8_CODES,
+};
+
+const uint16_t * const ff_on2avc_pair_cb_codes[] = {
+ on2avc_cb9_codes, on2avc_cb10_codes, on2avc_cb11_codes, on2avc_cb12_codes,
+ on2avc_cb13_codes, on2avc_cb14_codes, on2avc_cb15_codes
+};
+
+const uint8_t * const ff_on2avc_pair_cb_bits[] = {
+ on2avc_cb9_bits, on2avc_cb10_bits, on2avc_cb11_bits, on2avc_cb12_bits,
+ on2avc_cb13_bits, on2avc_cb14_bits, on2avc_cb15_bits
+};
+
+const uint16_t * const ff_on2avc_pair_cb_syms[] = {
+ on2avc_cb9_syms, on2avc_cb10_syms, on2avc_cb11_syms, on2avc_cb12_syms,
+ on2avc_cb13_syms, on2avc_cb14_syms, on2avc_cb15_syms
+};
+
+const int ff_on2avc_pair_cb_elems[] = {
+ ON2AVC_CB9_CODES, ON2AVC_CB10_CODES, ON2AVC_CB11_CODES, ON2AVC_CB12_CODES,
+ ON2AVC_CB13_CODES, ON2AVC_CB14_CODES, ON2AVC_CB15_CODES,
+};
+
+const float ff_on2avc_window_long_32000[1024] = {
+ 0.0007669903, 0.0023009691, 0.0038349426, 0.005368907,
+ 0.0069028586, 0.0084367944, 0.0099707097, 0.011504602,
+ 0.013038467, 0.014572302, 0.016106103, 0.017639864,
+ 0.019173585, 0.020707261, 0.022240886, 0.023774462,
+ 0.025307981, 0.026841439, 0.028374836, 0.029908165,
+ 0.031441424, 0.032974608, 0.034507714, 0.036040742,
+ 0.037573684, 0.039106537, 0.040639296, 0.042171963,
+ 0.043704528, 0.04523699, 0.046769347, 0.048301592,
+ 0.049833726, 0.051365741, 0.052897636, 0.054429408,
+ 0.05596105, 0.057492562, 0.059023935, 0.060555171,
+ 0.062086266, 0.063617215, 0.065148011, 0.066678658,
+ 0.068209141, 0.069739468, 0.071269631, 0.07279963,
+ 0.074329451, 0.0758591, 0.077388577, 0.078917861,
+ 0.080446966, 0.081975877, 0.083504602, 0.085033126,
+ 0.086561449, 0.08808957, 0.089617483, 0.091145188,
+ 0.092672676, 0.094199941, 0.095726989, 0.097253814,
+ 0.098780409, 0.10030677, 0.1018329, 0.10335878,
+ 0.10488442, 0.10640982, 0.10793497, 0.10945986,
+ 0.11098449, 0.11250886, 0.11403297, 0.11555681,
+ 0.11708038, 0.11860367, 0.12012669, 0.12164942,
+ 0.12317186, 0.12469402, 0.12621588, 0.12773743,
+ 0.12925871, 0.13077965, 0.13230032, 0.13382065,
+ 0.13534068, 0.13686039, 0.13837977, 0.13989884,
+ 0.14141756, 0.14293596, 0.14445402, 0.14597175,
+ 0.14748912, 0.14900614, 0.15052283, 0.15203916,
+ 0.15355512, 0.15507074, 0.15658598, 0.15810084,
+ 0.15961535, 0.16112947, 0.16264322, 0.16415659,
+ 0.16566956, 0.16718215, 0.16869435, 0.17020614,
+ 0.17171754, 0.17322853, 0.17473911, 0.1762493,
+ 0.17775905, 0.17926839, 0.18077731, 0.1822858,
+ 0.18379387, 0.1853015, 0.18680871, 0.18831545,
+ 0.18982176, 0.19132763, 0.19283305, 0.19433801,
+ 0.19584252, 0.19734655, 0.19885014, 0.20035326,
+ 0.2018559, 0.20335805, 0.20485975, 0.20636097,
+ 0.20786168, 0.20936191, 0.21086164, 0.21236089,
+ 0.21385963, 0.21535787, 0.2168556, 0.21835282,
+ 0.21984953, 0.22134572, 0.2228414, 0.22433653,
+ 0.22583115, 0.22732525, 0.22881879, 0.2303118,
+ 0.23180428, 0.2332962, 0.23478758, 0.2362784,
+ 0.23776866, 0.23925838, 0.24074753, 0.24223609,
+ 0.24372411, 0.24521156, 0.24669841, 0.2481847,
+ 0.24967039, 0.2511555, 0.25264001, 0.25412393,
+ 0.25560725, 0.25708997, 0.25857207, 0.2600536,
+ 0.26153448, 0.26301476, 0.26449442, 0.26597348,
+ 0.26745188, 0.26892966, 0.27040681, 0.27188334,
+ 0.27335921, 0.27483445, 0.27630904, 0.27778298,
+ 0.27925625, 0.28072888, 0.28220084, 0.28367215,
+ 0.28514278, 0.28661272, 0.28808203, 0.28955063,
+ 0.29101855, 0.2924858, 0.29395235, 0.29541823,
+ 0.2968834, 0.29834786, 0.29981163, 0.30127469,
+ 0.30273703, 0.30419868, 0.30565959, 0.30711982,
+ 0.3085793, 0.31003806, 0.31149608, 0.31295338,
+ 0.31440994, 0.31586576, 0.31732082, 0.31877515,
+ 0.32022873, 0.32168156, 0.32313362, 0.32458493,
+ 0.32603547, 0.32748523, 0.32893425, 0.33038247,
+ 0.33182994, 0.3332766, 0.33472249, 0.3361676,
+ 0.33761191, 0.33905542, 0.34049815, 0.34194005,
+ 0.34338117, 0.34482148, 0.34626096, 0.34769964,
+ 0.34913751, 0.35057455, 0.35201076, 0.35344613,
+ 0.35488069, 0.35631442, 0.35774729, 0.35917932,
+ 0.36061054, 0.36204088, 0.36347035, 0.36489901,
+ 0.36632678, 0.36775371, 0.36917976, 0.37060493,
+ 0.37202924, 0.37345266, 0.37487522, 0.37629691,
+ 0.3777177, 0.37913758, 0.38055661, 0.3819747,
+ 0.38339192, 0.38480824, 0.38622364, 0.38763815,
+ 0.38905171, 0.3904644, 0.39187613, 0.39328697,
+ 0.39469689, 0.39610586, 0.3975139, 0.39892101,
+ 0.40032718, 0.40173239, 0.40313667, 0.40454,
+ 0.40594238, 0.4073438, 0.40874428, 0.41014379,
+ 0.41154233, 0.41293988, 0.4143365, 0.41573212,
+ 0.41712677, 0.41852042, 0.41991311, 0.42130479,
+ 0.42269549, 0.4240852, 0.4254739, 0.42686161,
+ 0.42824832, 0.429634, 0.43101871, 0.43240237,
+ 0.43378502, 0.43516666, 0.43654725, 0.43792683,
+ 0.43930539, 0.44068289, 0.44205937, 0.44343483,
+ 0.4448092, 0.44618255, 0.44755486, 0.44892609,
+ 0.45029628, 0.45166543, 0.45303348, 0.45440048,
+ 0.45576641, 0.45713127, 0.45849505, 0.45985776,
+ 0.4612194, 0.46257991, 0.46393937, 0.46529773,
+ 0.46665499, 0.46801114, 0.46936622, 0.47072017,
+ 0.47207302, 0.47342476, 0.4747754, 0.47612491,
+ 0.47747329, 0.47882056, 0.4801667, 0.48151168,
+ 0.48285556, 0.4841983, 0.48553991, 0.48688036,
+ 0.48821968, 0.48955783, 0.49089485, 0.49223071,
+ 0.49356541, 0.49489892, 0.49623129, 0.4975625,
+ 0.49889255, 0.50022137, 0.50154907, 0.50287557,
+ 0.50420088, 0.50552505, 0.50684798, 0.50816971,
+ 0.50949025, 0.5108096, 0.51212776, 0.51344472,
+ 0.51476043, 0.51607502, 0.51738828, 0.51870042,
+ 0.52001131, 0.52132094, 0.52262932, 0.52393657,
+ 0.52524251, 0.52654725, 0.52785075, 0.52915299,
+ 0.53045398, 0.53175372, 0.53305221, 0.53434944,
+ 0.53564548, 0.53694022, 0.53823364, 0.53952587,
+ 0.54081678, 0.54210645, 0.5433948, 0.54468191,
+ 0.54596776, 0.5472523, 0.54853553, 0.5498175,
+ 0.55109817, 0.55237752, 0.55365556, 0.55493236,
+ 0.55620778, 0.55748194, 0.5587548, 0.56002629,
+ 0.56129652, 0.56256539, 0.56383294, 0.56509918,
+ 0.56636411, 0.56762767, 0.56888992, 0.57015079,
+ 0.57141036, 0.57266855, 0.57392544, 0.57518095,
+ 0.57643509, 0.57768792, 0.57893938, 0.58018941,
+ 0.58143812, 0.58268547, 0.58393145, 0.58517605,
+ 0.58641928, 0.58766115, 0.58890164, 0.5901407,
+ 0.59137839, 0.59261465, 0.5938496, 0.59508306,
+ 0.59631521, 0.59754586, 0.59877521, 0.60000306,
+ 0.60122955, 0.6024546, 0.60367823, 0.60490048,
+ 0.60612124, 0.60734063, 0.6085586, 0.60977507,
+ 0.61099017, 0.61220378, 0.61341602, 0.61462677,
+ 0.61583608, 0.61704391, 0.61825031, 0.61945528,
+ 0.62065876, 0.6218608, 0.62306136, 0.62426049,
+ 0.62545812, 0.62665427, 0.62784898, 0.62904221,
+ 0.63023394, 0.63142419, 0.63261294, 0.63380021,
+ 0.63498598, 0.63617027, 0.63735306, 0.63853437,
+ 0.63971412, 0.64089245, 0.64206922, 0.6432445,
+ 0.64441824, 0.64559048, 0.64676118, 0.64793038,
+ 0.64909804, 0.6502642, 0.65142882, 0.65259188,
+ 0.6537534, 0.65491343, 0.6560719, 0.65722883,
+ 0.6583842, 0.65953803, 0.66069031, 0.66184098,
+ 0.66299015, 0.66413778, 0.6652838, 0.66642827,
+ 0.66757119, 0.6687125, 0.66985226, 0.67099047,
+ 0.67212707, 0.67326206, 0.6743955, 0.67552739,
+ 0.67665762, 0.67778629, 0.67891335, 0.68003887,
+ 0.68116271, 0.68228501, 0.6834057, 0.68452471,
+ 0.68564218, 0.68675804, 0.68787223, 0.68898487,
+ 0.69009584, 0.6912052, 0.6923129, 0.69341904,
+ 0.69452351, 0.69562632, 0.69672751, 0.6978271,
+ 0.69892502, 0.70002127, 0.70111591, 0.70220888,
+ 0.70330018, 0.70438987, 0.70547789, 0.70656425,
+ 0.70764893, 0.70873195, 0.7098133, 0.71089298,
+ 0.71197098, 0.71304733, 0.714122, 0.71519494,
+ 0.71626627, 0.71733588, 0.71840382, 0.71947002,
+ 0.72053456, 0.72159743, 0.72265857, 0.72371799,
+ 0.72477573, 0.72583181, 0.72688609, 0.72793871,
+ 0.7289896, 0.73003882, 0.73108631, 0.73213202,
+ 0.73317605, 0.73421836, 0.73525894, 0.73629779,
+ 0.73733491, 0.7383703, 0.7394039, 0.74043584,
+ 0.74146599, 0.7424944, 0.74352109, 0.744546,
+ 0.74556917, 0.74659055, 0.74761021, 0.74862814,
+ 0.74964422, 0.75065863, 0.7516712, 0.75268203,
+ 0.75369114, 0.7546984, 0.75570393, 0.75670767,
+ 0.75770962, 0.75870979, 0.75970817, 0.76070476,
+ 0.76169956, 0.76269257, 0.7636838, 0.76467323,
+ 0.76566082, 0.76664668, 0.7676307, 0.76861292,
+ 0.7695933, 0.77057189, 0.77154869, 0.77252364,
+ 0.77349681, 0.77446812, 0.77543765, 0.77640533,
+ 0.77737117, 0.77833521, 0.77929735, 0.78025776,
+ 0.78121626, 0.78217292, 0.78312778, 0.7840808,
+ 0.78503191, 0.78598124, 0.78692871, 0.78787434,
+ 0.78881806, 0.78975999, 0.79070002, 0.7916382,
+ 0.79257452, 0.79350895, 0.79444152, 0.79537225,
+ 0.79630107, 0.79722804, 0.79815316, 0.79907638,
+ 0.79999769, 0.80091715, 0.8018347, 0.80275041,
+ 0.80366421, 0.8045761, 0.80548608, 0.80639422,
+ 0.80730045, 0.80820471, 0.80910712, 0.81000763,
+ 0.81090623, 0.81180298, 0.81269777, 0.81359059,
+ 0.81448156, 0.81537062, 0.81625772, 0.8171429,
+ 0.81802619, 0.81890756, 0.81978697, 0.82066447,
+ 0.82154006, 0.82241368, 0.8232854, 0.82415515,
+ 0.825023, 0.82588887, 0.82675278, 0.82761478,
+ 0.82847482, 0.82933295, 0.83018905, 0.83104324,
+ 0.83189547, 0.83274573, 0.83359408, 0.83444041,
+ 0.83528483, 0.83612722, 0.83696771, 0.83780622,
+ 0.83864272, 0.83947724, 0.84030986, 0.84114045,
+ 0.84196901, 0.84279567, 0.8436203, 0.84444296,
+ 0.84526366, 0.84608233, 0.84689903, 0.84771377,
+ 0.84852648, 0.84933716, 0.85014588, 0.85095257,
+ 0.85175729, 0.85255998, 0.85336071, 0.85415941,
+ 0.85495609, 0.85575074, 0.85654342, 0.85733408,
+ 0.85812265, 0.85890925, 0.85969388, 0.86047643,
+ 0.86125696, 0.86203545, 0.86281192, 0.86358637,
+ 0.86435878, 0.86512917, 0.86589754, 0.86666387,
+ 0.86742812, 0.86819035, 0.86895055, 0.86970872,
+ 0.8704648, 0.8712188, 0.87197083, 0.87272078,
+ 0.8734687, 0.87421453, 0.87495828, 0.8757,
+ 0.87643969, 0.8771773, 0.87791282, 0.87864625,
+ 0.87937766, 0.88010699, 0.88083428, 0.88155943,
+ 0.88228256, 0.88300359, 0.88372254, 0.88443947,
+ 0.88515425, 0.88586694, 0.88657761, 0.88728613,
+ 0.88799256, 0.88869697, 0.88939923, 0.89009941,
+ 0.8907975, 0.8914935, 0.89218742, 0.89287919,
+ 0.89356887, 0.89425647, 0.89494199, 0.89562535,
+ 0.89630663, 0.89698577, 0.89766282, 0.89833778,
+ 0.8990106, 0.89968133, 0.90034992, 0.90101641,
+ 0.90168077, 0.90234298, 0.9030031, 0.90366107,
+ 0.90431696, 0.90497071, 0.9056223, 0.90627176,
+ 0.90691912, 0.90756428, 0.90820736, 0.90884835,
+ 0.90948713, 0.91012377, 0.91075826, 0.91139066,
+ 0.91202086, 0.91264898, 0.91327488, 0.91389865,
+ 0.91452032, 0.91513979, 0.91575712, 0.9163723,
+ 0.91698527, 0.91759616, 0.91820484, 0.91881138,
+ 0.91941577, 0.92001796, 0.92061806, 0.92121589,
+ 0.92181164, 0.92240518, 0.92299652, 0.92358577,
+ 0.92417276, 0.92475766, 0.92534029, 0.92592078,
+ 0.92649913, 0.92707527, 0.92764926, 0.92822099,
+ 0.92879063, 0.92935801, 0.92992324, 0.93048626,
+ 0.93104708, 0.93160576, 0.93216223, 0.93271649,
+ 0.93326855, 0.93381846, 0.93436611, 0.93491161,
+ 0.93545485, 0.93599594, 0.93653482, 0.9370715,
+ 0.93760598, 0.93813825, 0.93866825, 0.93919611,
+ 0.93972176, 0.94024521, 0.94076639, 0.94128537,
+ 0.9418022, 0.94231677, 0.94282907, 0.94333923,
+ 0.94384712, 0.94435281, 0.94485629, 0.94535756,
+ 0.94585657, 0.94635338, 0.94684792, 0.94734025,
+ 0.94783038, 0.94831824, 0.9488039, 0.9492873,
+ 0.94976848, 0.95024747, 0.95072412, 0.95119864,
+ 0.95167089, 0.95214087, 0.95260859, 0.9530741,
+ 0.9535374, 0.95399845, 0.95445722, 0.95491374,
+ 0.95536804, 0.95582008, 0.95626986, 0.95671743,
+ 0.95716268, 0.95760572, 0.9580465, 0.95848507,
+ 0.95892131, 0.95935535, 0.95978713, 0.96021664,
+ 0.96064389, 0.96106887, 0.96149158, 0.96191204,
+ 0.96233022, 0.96274614, 0.9631598, 0.96357119,
+ 0.96398038, 0.96438724, 0.96479183, 0.96519411,
+ 0.96559417, 0.96599197, 0.96638745, 0.96678072,
+ 0.96717167, 0.96756035, 0.96794677, 0.96833086,
+ 0.96871275, 0.96909231, 0.96946961, 0.96984458,
+ 0.97021735, 0.97058779, 0.97095597, 0.97132182,
+ 0.97168541, 0.97204667, 0.97240573, 0.97276247,
+ 0.97311687, 0.97346902, 0.9738189, 0.97416645,
+ 0.97451174, 0.97485471, 0.97519541, 0.97553378,
+ 0.97586989, 0.97620368, 0.9765352, 0.9768644,
+ 0.97719133, 0.97751594, 0.97783822, 0.97815824,
+ 0.97847593, 0.97879136, 0.97910446, 0.97941524,
+ 0.97972369, 0.98002988, 0.98033381, 0.98063534,
+ 0.98093462, 0.98123157, 0.98152626, 0.98181856,
+ 0.98210859, 0.9823963, 0.98268169, 0.98296481,
+ 0.98324561, 0.98352402, 0.98380023, 0.98407406,
+ 0.98434556, 0.98461479, 0.98488164, 0.98514622,
+ 0.98540848, 0.98566842, 0.98592603, 0.98618132,
+ 0.98643428, 0.98668498, 0.98693329, 0.98717928,
+ 0.98742294, 0.98766434, 0.98790336, 0.98814011,
+ 0.98837447, 0.98860651, 0.98883629, 0.98906368,
+ 0.98928875, 0.98951149, 0.98973197, 0.98995006,
+ 0.99016583, 0.99037921, 0.99059033, 0.99079913,
+ 0.9910056, 0.99120969, 0.99141145, 0.99161088,
+ 0.991808, 0.99200279, 0.99219525, 0.99238533,
+ 0.99257314, 0.99275857, 0.99294168, 0.99312246,
+ 0.99330086, 0.99347699, 0.99365073, 0.99382216,
+ 0.9939912, 0.99415797, 0.99432236, 0.99448442,
+ 0.99464417, 0.99480152, 0.99495655, 0.99510926,
+ 0.99525958, 0.99540764, 0.99555331, 0.9956966,
+ 0.99583763, 0.99597627, 0.99611259, 0.99624652,
+ 0.99637812, 0.99650741, 0.9966343, 0.99675888,
+ 0.99688113, 0.99700099, 0.99711853, 0.99723375,
+ 0.99734658, 0.99745709, 0.99756527, 0.99767107,
+ 0.99777448, 0.99787563, 0.9979744, 0.99807078,
+ 0.99816483, 0.99825656, 0.99834591, 0.99843293,
+ 0.99851763, 0.99859995, 0.99867994, 0.99875754,
+ 0.99883282, 0.99890572, 0.99897629, 0.99904448,
+ 0.99911034, 0.99917388, 0.99923503, 0.99929386,
+ 0.99935031, 0.99940443, 0.99945617, 0.99950558,
+ 0.99955267, 0.99959737, 0.99963969, 0.99967968,
+ 0.99971735, 0.99975264, 0.9997856, 0.99981618,
+ 0.99984443, 0.9998703, 0.99989384, 0.999915,
+ 0.99993384, 0.99995029, 0.99996442, 0.99997616,
+ 0.99998558, 0.99999267, 0.99999738, 0.9999997,
+};
+
+const float ff_on2avc_window_long_24000[1024] = {
+ 0.00000102, 0.0000091700003, 0.000025470001, 0.00004993,
+ 0.000082530001, 0.00012328, 0.00017219, 0.00022924,
+ 0.00029443001, 0.00036778001, 0.00044927001, 0.00053890003,
+ 0.00063666998, 0.00074257998, 0.00085662998, 0.00097881001,
+ 0.00110913, 0.00124758, 0.00139415, 0.00154885,
+ 0.00171168, 0.00188262, 0.00206168, 0.00224885,
+ 0.0024441299, 0.00264751, 0.0028589999, 0.0030785799,
+ 0.0033062601, 0.00354202, 0.00378588, 0.00403781,
+ 0.0042978101, 0.0045658899, 0.0048420299, 0.0051262402,
+ 0.0054184902, 0.0057187998, 0.00602715, 0.0063435398,
+ 0.00666796, 0.00700041, 0.0073408699, 0.0076893498,
+ 0.0080458401, 0.0084103197, 0.0087828003, 0.0091632698,
+ 0.0095517104, 0.0099481298, 0.01035251, 0.01076485,
+ 0.01118513, 0.01161336, 0.01204952, 0.0124936,
+ 0.0129456, 0.01340551, 0.01387332, 0.01434902,
+ 0.0148326, 0.01532405, 0.015823361, 0.016330531,
+ 0.01684555, 0.017368389, 0.01789907, 0.018437561,
+ 0.01898385, 0.019537929, 0.020099809, 0.020669449,
+ 0.02124686, 0.021832019, 0.02242492, 0.02302555,
+ 0.023633899, 0.02424995, 0.024873709, 0.02550514,
+ 0.026144249, 0.026791019, 0.02744543, 0.02810749,
+ 0.02877716, 0.029454449, 0.030139331, 0.030831801,
+ 0.031531841, 0.032239441, 0.032954589, 0.033677269,
+ 0.03440747, 0.035145171, 0.035890371, 0.036643039,
+ 0.03740317, 0.038170759, 0.038945779, 0.039728221,
+ 0.040518072, 0.041315299, 0.04211992, 0.042931888,
+ 0.04375121, 0.044577859, 0.045411821, 0.046253089,
+ 0.047101639, 0.04795745, 0.048820522, 0.04969082,
+ 0.05056835, 0.051453069, 0.052344982, 0.053244069,
+ 0.054150298, 0.055063669, 0.055984162, 0.056911752,
+ 0.057846431, 0.058788169, 0.059736971, 0.060692791,
+ 0.061655629, 0.062625468, 0.063602284, 0.064586058,
+ 0.065576769, 0.06657441, 0.067578949, 0.06859038,
+ 0.069608673, 0.070633821, 0.071665794, 0.072704569,
+ 0.073750138, 0.074802481, 0.075861573, 0.076927401,
+ 0.077999942, 0.079079159, 0.080165058, 0.081257619,
+ 0.082356803, 0.083462588, 0.084574983, 0.085693933,
+ 0.086819433, 0.087951459, 0.089089997, 0.090235017,
+ 0.091386512, 0.092544436, 0.093708791, 0.094879538,
+ 0.09605667, 0.097240157, 0.098429978, 0.099626116,
+ 0.10082854, 0.10203723, 0.10325217, 0.10447333,
+ 0.1057007, 0.10693424, 0.10817393, 0.10941976,
+ 0.1106717, 0.11192972, 0.1131938, 0.11446393,
+ 0.11574007, 0.1170222, 0.1183103, 0.11960435,
+ 0.12090432, 0.12221018, 0.12352192, 0.12483951,
+ 0.12616292, 0.12749213, 0.12882711, 0.13016786,
+ 0.13151433, 0.13286649, 0.13422433, 0.13558783,
+ 0.13695695, 0.13833167, 0.13971195, 0.1410978,
+ 0.14248917, 0.14388604, 0.14528839, 0.1466962,
+ 0.14810941, 0.14952803, 0.150952, 0.15238133,
+ 0.15381598, 0.15525591, 0.15670112, 0.15815157,
+ 0.15960722, 0.16106807, 0.16253406, 0.16400519,
+ 0.16548143, 0.16696274, 0.1684491, 0.1699405,
+ 0.17143688, 0.17293824, 0.17444454, 0.17595574,
+ 0.17747185, 0.17899281, 0.1805186, 0.1820492,
+ 0.18358457, 0.18512468, 0.18666951, 0.18821906,
+ 0.18977325, 0.19133207, 0.19289552, 0.19446352,
+ 0.19603609, 0.19761316, 0.19919474, 0.20078079,
+ 0.20237127, 0.20396616, 0.20556541, 0.20716903,
+ 0.20877695, 0.21038917, 0.21200565, 0.21362637,
+ 0.21525128, 0.21688037, 0.21851361, 0.22015095,
+ 0.22179238, 0.22343788, 0.22508739, 0.2267409,
+ 0.22839837, 0.23005977, 0.2317251, 0.23339429,
+ 0.23506732, 0.2367442, 0.23842482, 0.24010922,
+ 0.24179734, 0.24348916, 0.24518465, 0.24688376,
+ 0.24858648, 0.25029278, 0.2520026, 0.25371596,
+ 0.25543278, 0.25715306, 0.25887677, 0.26060385,
+ 0.26233432, 0.26406807, 0.26580516, 0.26754549,
+ 0.26928905, 0.27103582, 0.27278578, 0.27453887,
+ 0.27629507, 0.27805433, 0.27981666, 0.281582,
+ 0.28335032, 0.28512162, 0.28689581, 0.28867289,
+ 0.29045284, 0.29223564, 0.29402119, 0.29580954,
+ 0.2976006, 0.29939437, 0.30119082, 0.3029899,
+ 0.30479157, 0.30659583, 0.30840263, 0.31021196,
+ 0.31202373, 0.31383798, 0.31565461, 0.31747365,
+ 0.31929505, 0.32111874, 0.32294473, 0.32477298,
+ 0.32660347, 0.32843611, 0.33027095, 0.33210787,
+ 0.33394691, 0.33578804, 0.33763117, 0.33947629,
+ 0.34132338, 0.34317243, 0.34502336, 0.34687617,
+ 0.3487308, 0.35058725, 0.35244548, 0.35430545,
+ 0.35616711, 0.35803047, 0.35989544, 0.36176205,
+ 0.36363024, 0.36549997, 0.36737123, 0.36924395,
+ 0.37111813, 0.37299374, 0.37487072, 0.37674904,
+ 0.3786287, 0.38050967, 0.38239187, 0.38427529,
+ 0.38615993, 0.3880457, 0.3899326, 0.39182061,
+ 0.39370969, 0.39559978, 0.39749089, 0.39938298,
+ 0.40127596, 0.40316987, 0.40506464, 0.40696028,
+ 0.40885669, 0.41075388, 0.41265181, 0.41455048,
+ 0.41644979, 0.41834977, 0.42025036, 0.42215151,
+ 0.42405322, 0.42595547, 0.42785817, 0.42976135,
+ 0.43166494, 0.43356892, 0.43547326, 0.43737793,
+ 0.43928292, 0.44118813, 0.4430936, 0.44499925,
+ 0.44690508, 0.44881102, 0.45071709, 0.45262322,
+ 0.4545294, 0.45643559, 0.45834175, 0.46024784,
+ 0.46215388, 0.46405977, 0.46596554, 0.46787113,
+ 0.46977648, 0.47168162, 0.47358647, 0.47549102,
+ 0.47739524, 0.4792991, 0.48120254, 0.48310557,
+ 0.48500812, 0.48691019, 0.48881173, 0.49071273,
+ 0.49261314, 0.49451295, 0.4964121, 0.4983106,
+ 0.50020838, 0.50210541, 0.50400168, 0.50589716,
+ 0.50779182, 0.50968558, 0.5115785, 0.51347047,
+ 0.51536149, 0.51725155, 0.5191406, 0.52102858,
+ 0.52291554, 0.52480137, 0.52668607, 0.52856964,
+ 0.53045195, 0.53233314, 0.53421301, 0.53609163,
+ 0.53796893, 0.53984493, 0.54171956, 0.54359275,
+ 0.54546458, 0.54733491, 0.54920375, 0.55107111,
+ 0.55293691, 0.55480117, 0.55666381, 0.55852479,
+ 0.56038415, 0.56224185, 0.56409782, 0.565952,
+ 0.56780452, 0.56965512, 0.571504, 0.57335097,
+ 0.57519609, 0.57703924, 0.57888049, 0.58071983,
+ 0.58255708, 0.58439237, 0.58622563, 0.58805674,
+ 0.58988583, 0.59171271, 0.59353751, 0.5953601,
+ 0.59718043, 0.59899855, 0.60081446, 0.60262799,
+ 0.60443926, 0.6062482, 0.6080547, 0.60985887,
+ 0.6116606, 0.61345983, 0.61525661, 0.61705089,
+ 0.61884266, 0.62063187, 0.62241846, 0.62420249,
+ 0.62598389, 0.62776262, 0.62953866, 0.63131201,
+ 0.63308257, 0.63485044, 0.63661551, 0.63837773,
+ 0.6401372, 0.64189374, 0.64364743, 0.6453982,
+ 0.64714605, 0.64889091, 0.65063286, 0.6523717,
+ 0.65410763, 0.65584046, 0.65757018, 0.65929681,
+ 0.6610204, 0.66274077, 0.66445798, 0.66617203,
+ 0.6678828, 0.66959041, 0.67129469, 0.67299575,
+ 0.67469347, 0.67638785, 0.67807889, 0.67976654,
+ 0.68145084, 0.68313169, 0.68480909, 0.68648309,
+ 0.68815356, 0.68982053, 0.69148397, 0.69314384,
+ 0.6948002, 0.69645292, 0.69810206, 0.69974756,
+ 0.70138937, 0.70302755, 0.70466202, 0.70629281,
+ 0.70791984, 0.70954311, 0.71116263, 0.71277833,
+ 0.71439022, 0.71599829, 0.71760249, 0.71920282,
+ 0.72079927, 0.72239184, 0.72398043, 0.72556508,
+ 0.72714579, 0.72872251, 0.73029518, 0.73186392,
+ 0.73342854, 0.73498911, 0.73654562, 0.73809808,
+ 0.73964638, 0.74119055, 0.74273056, 0.74426645,
+ 0.74579811, 0.74732566, 0.74884892, 0.75036794,
+ 0.75188273, 0.75339329, 0.75489956, 0.75640148,
+ 0.75789917, 0.75939244, 0.76088142, 0.76236606,
+ 0.76384634, 0.76532215, 0.76679361, 0.76826066,
+ 0.76972324, 0.77118134, 0.77263504, 0.77408427,
+ 0.77552897, 0.77696913, 0.77840483, 0.779836,
+ 0.78126258, 0.78268462, 0.78410208, 0.78551495,
+ 0.78692323, 0.78832692, 0.7897259, 0.79112029,
+ 0.79251003, 0.79389513, 0.79527551, 0.79665124,
+ 0.79802221, 0.79938853, 0.80075008, 0.80210692,
+ 0.80345899, 0.80480635, 0.80614889, 0.80748665,
+ 0.80881965, 0.81014782, 0.81147122, 0.8127898,
+ 0.81410348, 0.8154124, 0.81671643, 0.81801558,
+ 0.81930989, 0.82059932, 0.8218838, 0.82316345,
+ 0.82443815, 0.82570797, 0.82697284, 0.82823282,
+ 0.8294878, 0.83073789, 0.83198297, 0.8332231,
+ 0.83445829, 0.83568847, 0.8369137, 0.83813387,
+ 0.83934909, 0.8405593, 0.84176451, 0.84296465,
+ 0.84415978, 0.84534991, 0.84653497, 0.84771496,
+ 0.84888995, 0.85005987, 0.85122472, 0.85238451,
+ 0.85353923, 0.85468888, 0.85583341, 0.85697287,
+ 0.85810727, 0.85923654, 0.86036074, 0.86147982,
+ 0.86259383, 0.86370265, 0.86480641, 0.86590505,
+ 0.86699861, 0.86808699, 0.86917025, 0.87024838,
+ 0.87132144, 0.87238932, 0.87345207, 0.87450963,
+ 0.87556213, 0.87660944, 0.87765163, 0.87868869,
+ 0.87972057, 0.88074732, 0.88176894, 0.88278538,
+ 0.88379669, 0.88480288, 0.88580388, 0.88679975,
+ 0.88779044, 0.88877606, 0.88975644, 0.89073175,
+ 0.89170188, 0.89266688, 0.89362669, 0.89458138,
+ 0.89553094, 0.89647537, 0.89741462, 0.89834881,
+ 0.89927781, 0.90020168, 0.90112042, 0.90203404,
+ 0.90294254, 0.90384591, 0.90474415, 0.90563726,
+ 0.90652531, 0.90740818, 0.90828604, 0.90915871,
+ 0.91002631, 0.91088885, 0.91174626, 0.91259861,
+ 0.91344583, 0.91428804, 0.91512513, 0.91595721,
+ 0.91678417, 0.91760612, 0.918423, 0.91923481,
+ 0.92004162, 0.92084336, 0.92164016, 0.92243183,
+ 0.92321855, 0.92400026, 0.92477697, 0.92554867,
+ 0.92631537, 0.92707711, 0.92783386, 0.92858565,
+ 0.92933249, 0.93007439, 0.93081135, 0.93154335,
+ 0.93227047, 0.93299264, 0.93370992, 0.93442225,
+ 0.93512976, 0.93583232, 0.93653005, 0.93722296,
+ 0.93791091, 0.9385941, 0.9392724, 0.93994594,
+ 0.94061458, 0.94127852, 0.94193757, 0.94259191,
+ 0.94324142, 0.94388616, 0.9445262, 0.94516146,
+ 0.94579202, 0.94641781, 0.94703895, 0.94765538,
+ 0.9482671, 0.94887418, 0.94947654, 0.95007432,
+ 0.95066744, 0.95125592, 0.9518398, 0.95241904,
+ 0.95299375, 0.95356387, 0.95412946, 0.95469046,
+ 0.95524693, 0.95579892, 0.95634633, 0.95688927,
+ 0.9574278, 0.9579618, 0.95849133, 0.95901644,
+ 0.95953715, 0.96005344, 0.96056533, 0.96107286,
+ 0.96157598, 0.96207482, 0.96256924, 0.96305943,
+ 0.9635452, 0.96402675, 0.96450406, 0.96497703,
+ 0.96544582, 0.96591038, 0.9663707, 0.9668268,
+ 0.96727878, 0.96772653, 0.96817023, 0.96860969,
+ 0.9690451, 0.9694764, 0.96990365, 0.97032678,
+ 0.97074586, 0.97116095, 0.97157204, 0.97197908,
+ 0.97238219, 0.9727813, 0.97317648, 0.97356778,
+ 0.97395509, 0.97433859, 0.97471815, 0.9750939,
+ 0.97546583, 0.97583389, 0.9761982, 0.97655869,
+ 0.97691542, 0.97726846, 0.97761768, 0.97796327,
+ 0.97830516, 0.97864336, 0.97897792, 0.97930884,
+ 0.97963619, 0.97995991, 0.9802801, 0.98059666,
+ 0.98090976, 0.98121929, 0.98152536, 0.98182797,
+ 0.98212707, 0.98242277, 0.98271501, 0.98300391,
+ 0.98328942, 0.98357159, 0.98385036, 0.98412585,
+ 0.98439807, 0.984667, 0.98493266, 0.9851951,
+ 0.98545432, 0.98571032, 0.98596323, 0.98621291,
+ 0.98645949, 0.98670292, 0.9869433, 0.98718059,
+ 0.98741484, 0.98764604, 0.98787427, 0.98809952,
+ 0.98832178, 0.98854107, 0.98875749, 0.98897099,
+ 0.98918158, 0.98938936, 0.98959428, 0.98979634,
+ 0.98999566, 0.99019217, 0.99038595, 0.99057698,
+ 0.99076533, 0.99095094, 0.99113393, 0.99131429,
+ 0.99149197, 0.99166709, 0.99183959, 0.99200952,
+ 0.99217695, 0.99234182, 0.99250424, 0.99266416,
+ 0.99282163, 0.99297667, 0.99312931, 0.99327952,
+ 0.9934274, 0.99357295, 0.99371612, 0.99385703,
+ 0.99399561, 0.99413198, 0.99426609, 0.994398,
+ 0.9945277, 0.99465519, 0.9947806, 0.9949038,
+ 0.99502492, 0.99514401, 0.99526095, 0.99537587,
+ 0.99548876, 0.99559963, 0.99570858, 0.99581552,
+ 0.99592048, 0.9960236, 0.99612474, 0.99622405,
+ 0.9963215, 0.99641711, 0.99651092, 0.99660289,
+ 0.99669313, 0.99678159, 0.99686831, 0.99695337,
+ 0.9970367, 0.99711835, 0.99719834, 0.99727672,
+ 0.99735349, 0.99742872, 0.99750233, 0.99757439,
+ 0.9976449, 0.99771392, 0.99778146, 0.99784756,
+ 0.99791217, 0.99797535, 0.9980371, 0.99809748,
+ 0.99815649, 0.99821413, 0.99827045, 0.99832547,
+ 0.99837923, 0.99843168, 0.99848282, 0.99853277,
+ 0.99858153, 0.99862903, 0.99867541, 0.99872059,
+ 0.99876463, 0.99880755, 0.99884939, 0.9988901,
+ 0.99892974, 0.99896836, 0.99900591, 0.99904245,
+ 0.99907798, 0.99911255, 0.99914616, 0.99917883,
+ 0.99921054, 0.99924135, 0.99927121, 0.99930024,
+ 0.99932843, 0.99935573, 0.9993822, 0.99940789,
+ 0.99943274, 0.99945682, 0.99948019, 0.99950278,
+ 0.99952459, 0.99954569, 0.99956614, 0.99958587,
+ 0.99960488, 0.9996233, 0.99964106, 0.99965817,
+ 0.99967468, 0.99969059, 0.99970591, 0.99972069,
+ 0.99973488, 0.99974853, 0.99976164, 0.99977428,
+ 0.99978638, 0.999798, 0.99980915, 0.99981982,
+ 0.99983001, 0.99983978, 0.99984914, 0.99985808,
+ 0.99986666, 0.99987477, 0.99988258, 0.99988997,
+ 0.99989706, 0.99990374, 0.99991012, 0.9999162,
+ 0.99992198, 0.9999274, 0.99993259, 0.99993742,
+ 0.99994206, 0.99994642, 0.99995053, 0.9999544,
+ 0.99995804, 0.99996144, 0.99996465, 0.99996763,
+ 0.99997044, 0.99997306, 0.9999755, 0.99997777,
+ 0.99997985, 0.99998182, 0.99998367, 0.99998534,
+ 0.99998689, 0.99998826, 0.99998957, 0.99999076,
+ 0.99999183, 0.99999285, 0.99999374, 0.99999452,
+ 0.99999523, 0.99999589, 0.99999648, 0.99999702,
+ 0.9999975, 0.99999785, 0.99999821, 0.99999857,
+ 0.99999881, 0.99999905, 0.99999923, 0.9999994,
+ 0.99999952, 0.99999964, 0.9999997, 0.99999982,
+ 0.99999982, 0.99999988, 0.99999994, 0.99999994,
+ 0.99999994, 1.0, 1.0, 1.0,
+ 1.0, 1.0, 1.0, 1.0,
+};
+
+const float ff_on2avc_window_short[128] = {
+ 1.320684e-12, 1.3218859e-12, 1.324119e-12, 1.3269172e-12,
+ 1.3297907e-12, 1.3316993e-12, 1.3321618e-12, 1.3303409e-12,
+ 1.3297163e-12, 1.3598052e-12, 1.6224489e-12, 3.238457e-12,
+ 1.1376874e-11, 4.6434454e-11, 1.80557e-10, 6.4489758e-10,
+ 2.1179569e-9, 6.4429635e-9, 1.8292885e-8, 4.880043e-8,
+ 1.2303467e-7, 2.946195e-7, 6.729764e-7, 0.0000014718792,
+ 0.0000030924566, 0.0000062596109, 0.000012238012, 0.000023162085,
+ 0.000042523086, 0.000075864329, 0.00013174133, 0.00022300506,
+ 0.00036846122, 0.00059494411, 0.00093981833, 0.001453883,
+ 0.0022046037, 0.0032795328, 0.004789711, 0.0068727732,
+ 0.0096954042, 0.01345476, 0.018378416, 0.02472244,
+ 0.032767218, 0.042810757, 0.055159383, 0.070115872,
+ 0.087965287, 0.10895917, 0.1332987, 0.16111787,
+ 0.19246797, 0.22730421, 0.26547599, 0.30672187,
+ 0.35066974, 0.39684334, 0.44467437, 0.49352086,
+ 0.54269004, 0.59146535, 0.6391356, 0.68502444,
+ 0.72851861, 0.76909274, 0.80632913, 0.83993185,
+ 0.8697328, 0.89569116, 0.91788524, 0.93649811,
+ 0.95179814, 0.96411639, 0.97382277, 0.9813022,
+ 0.98693413, 0.99107492, 0.9940452, 0.99612254,
+ 0.99753785, 0.99847656, 0.99908221, 0.99946207,
+ 0.99969339, 0.99983019, 0.99990857, 0.99995208,
+ 0.9999755, 0.99998766, 0.9999938, 0.99999678,
+ 0.99999821, 0.99999893, 0.99999923, 0.99999946,
+ 0.99999958, 0.9999997, 0.99999982, 0.99999994,
+ 1.0000001, 1.0000002, 1.0000004, 1.0000005,
+ 1.0000006, 1.0000008, 1.000001, 1.000001,
+ 1.0000011, 1.0000012, 1.0000013, 1.0000014,
+ 1.0000014, 1.0000015, 1.0000015, 1.0000015,
+ 1.0000015, 1.0000014, 1.0000014, 1.0000014,
+ 1.0000013, 1.0000013, 1.0000012, 1.0000012,
+ 1.0000011, 1.0000011, 1.0000011, 1.0000011,
+};
+
+const double ff_on2avc_tab_10_1[] = {
+ 0.0033357253, -0.012580752, -0.0062414902, 0.077571494, -0.03224487,
+ -0.24229489, 0.13842815, 0.72430853, 0.60382927, 0.1601024
+};
+
+const double ff_on2avc_tab_10_2[] = {
+ -0.1601024, 0.60382927, -0.72430853, 0.13842815, 0.24229489,
+ -0.03224487, -0.077571494, -0.0062414902, 0.012580752, 0.0033357253,
+ 0.33266699, 0.80689015, 0.45988244, -0.13500994, -0.085442654,
+ 0.035226542, -0.035226543, -0.085442656, 0.13500994, 0.45988246,
+ -0.80689017, 0.332667
+};
+
+const double ff_on2avc_tab_20_1[] = {
+ -0.0014416961, -0.00056214974, 0.020948911, 0.025363335, -0.10427845,
+ -0.2318503, 0.06892613, 0.63810513, 0.6843251, 0.20162185,
+ -0.033582, 0.07313663, 0.08143964, -0.0063137698, -0.012688661,
+ 0.0089685127, 0.0035534843, -0.0016078273, -0.000095677464, 0.0002453756
+};
+
+const double ff_on2avc_tab_20_2[] = {
+ -0.0002453755997325089, -0.00009567746389569924, 0.001607827298247261,
+ 0.003553484296126244, -0.008968512690223166, -0.01268866098616772,
+ 0.006313769793117177, 0.08143963991122029, -0.07313662992027165,
+ -0.03358199996339129, -0.2016218497802062, 0.6843250992539974,
+ -0.6381051293043832, 0.06892612992486163, 0.2318502997472533,
+ -0.1042784498863231, -0.0253633349723507, 0.02094891097716299,
+ 0.0005621497393871844, -0.001441696098428365
+};
+
+const double ff_on2avc_tab_40_1[] = {
+ -0.0000017445457, -0.000001814441, 0.000038676008, 0.000045716169,
+ -0.00041789492, -0.00062315149, 0.0027052457, 0.0053753308,
+ -0.010572396, -0.030726394, 0.01871785, 0.11585315,
+ 0.03958068, -0.25000242, -0.29886274, 0.18287176,
+ 0.65781885, 0.548686, 0.17696839, 0.08330372,
+ 0.14234582, 0.064187778, -0.03396015, -0.013302871,
+ 0.020618859, 0.0018984093, -0.010561246, -0.00010918036,
+ 0.0035190253, -0.00057674024, -0.0010263441, 0.00030131618,
+ 0.00022613687, -0.000089637969, -0.000032248444, 0.00001882641,
+ 0.0000029119687, -0.0000023940844, -1.3944369e-7, 1.3407205e-7,
+};
+
+const double ff_on2avc_tab_40_2[] = {
+ -1.340720502155867e-7, -1.394436902242243e-7, 0.000002394084403849667,
+ 0.000002911968704682421, -0.00001882641003027271, -0.00003224844405185522,
+ 0.00008963796914413709, 0.0002261368703636262, -0.0003013161804845139,
+ -0.001026344101650353, 0.0005767402409273933, 0.003519025305658563,
+ 0.0001091803601755611, -0.01056124601698239, -0.001898409303052626,
+ 0.02061885903315495, 0.0133028710213909, -0.03396015005460763,
+ -0.0641877781032134, 0.1423458202288909, -0.08330372013395167,
+ 0.1769683902845637, -0.5486860008822824, 0.6578188510577671,
+ -0.1828717602940562, -0.2988627404805687, 0.2500024204020018,
+ 0.03958068006364539, -0.1158531501862909, 0.01871785003009814,
+ 0.03072639404940778, -0.01057239601700032, -0.005375330808643486,
+ 0.002705245704350012, 0.0006231514910020222, -0.0004178949206719714,
+ -0.00004571616907351121, 0.00003867600806219069, 0.000001814441002917606,
+ -0.000001744545702805214
+};
+
+const double ff_on2avc_tab_84_1[] = {
+ -0.003834605569340214, -0.01399666493880675, -0.02423522354202532,
+ -0.02098660725909453, -0.003033811991149968, 0.02580968794845409,
+ 0.05022200106698627, 0.05480106279059652, 0.0370527194554745,
+ 0.01293943431893363, 0.012874098608023, 0.06242007669752228,
+ 0.1711674720067008, 0.3168985339332503, 0.4463224645440312,
+ 0.4997307843290636, 0.442680199327905, 0.2862974432523162,
+ 0.08192922995482327, -0.100687848630388, -0.2010749890073668,
+ -0.1970564705797125, -0.1136363541357198, -0.006482554176098804,
+ 0.06983853153253429, 0.08958734697447382, 0.0598384364842016,
+ 0.009627953684538691, -0.02776530291935209, -0.03485384358824609,
+ -0.01638430987962629, 0.01132787970877885, 0.02744697607433038,
+ 0.02280082564277705, 0.003817601656862559, -0.01536124106173835,
+ -0.02070943469222549, -0.01286651718416282, 0.0005632574484435138,
+ 0.007577496599690143, 0.01014022979594007, 0.006400316454349855,
+ -0.001317309067039239, -0.00317940336781777, -0.002405842901164466,
+ -0.001661745856529503, -0.00005380161101133026, 0.0009898316472595594,
+ 0.0007039765787268925, -0.000189661703240109, -0.0001182674960570266,
+ 0.0002115051270037225, -0.00008565649434604059, -0.0001252806220197323,
+ 0.0001500012974557671, 0.00002957208561445737, -0.000118882457357092,
+ -0.000007421996284144832, 0.00004351015061547388, -0.000005737099377545248,
+ -0.0000164747057254053, 0.00001923482660002518, -0.00001093031593938137,
+ -0.00001002792095051621, 0.00001250573423880376, 0.000004127061570609871,
+ -0.000003458244341720683, -0.000003058993334597815, 0.000002160520943418329,
+ 8.907414904197164e-7, -0.000001316252923085336, 3.681255415998394e-7,
+ 6.245867533258108e-7, -1.129925213069921e-7, 3.315839446922364e-7,
+ -1.356572071896963e-7, -4.318309977365961e-7, -1.367503553365523e-7,
+ 4.470828965968303e-8, 9.212902857354196e-8, 3.695547755036224e-8,
+ 1.505766197979149e-8, -6.958994047152974e-9, -8.758631202056997e-9
+};
+
+const double ff_on2avc_tab_84_2[] = {
+ 0.002715349650922232, -0.01033050750152524, -0.01528172942791371,
+ 0.005838722508994047, 0.01599086024371182, -0.01737535183522147,
+ -0.01418596452135431, 0.05969677252151454, 0.07139735966046348,
+ -0.06379927990205171, -0.1516174471801191, 0.008365792873769096,
+ 0.1866714915958021, 0.04432405351099893, -0.2179875184285703,
+ -0.1089585577690529, 0.2761321070772847, 0.294949416655377,
+ -0.1811068533291373, -0.4710662031299601, -0.1397679263799359,
+ 0.3386633432956985, 0.3588950861292916, 0.03198338392910033,
+ -0.1801130026394404, -0.178622266226761, -0.1270863570294224,
+ -0.0332786110926095, 0.1326619748641741, 0.2077421015185226,
+ 0.07027624884033033, -0.1065486044522993, -0.125884731750194,
+ -0.0399897264540468, 0.003687144241560403, 0.01609004681595481,
+ 0.04950212493135606, 0.05748681524682781, 0.004041844771574074,
+ -0.04142122345639772, -0.02559310071302269, 0.002755316641486144,
+ 0.003184997421951853, -0.005531116810971506, 0.008338191103621911,
+ 0.01252616152446114, -0.003312308536298372, -0.007161498814519848,
+ 0.001337745209122465, 0.002343332617933073, -0.001621098790238126,
+ -0.00129682569402033, 0.001491028268251773, 0.0003044153446278188,
+ -0.0007048834926788463, 0.00004445131250124058, 0.0003635790848622476,
+ -0.000143533732887211, -0.00002972390773997905, 0.0001176094971737509,
+ -0.00006171908908217019, -0.0001084231902960109, 0.00007896973444840752,
+ 0.0000499995995843891, -0.00006444906759864038, -0.000018321011061942,
+ 0.00001482481130354497, 0.00001058934262851235, -0.000004798424433342611,
+ -4.761276869473942e-7, 0.00000188617755070578, -0.000001674634418015107,
+ -1.53944330645465e-7, 9.240123633592371e-7, -0.000001235630235014779,
+ 4.925891606823236e-8, 0.000001206615355189743, 3.647623817617871e-7,
+ -1.087267533862797e-7, -2.529052443169693e-7, -1.1961026302477e-7,
+ -4.873569574324943e-8, 2.252351108799612e-8, 2.834822470870021e-8
+};
+
+const double ff_on2avc_tab_84_3[] = {
+ -0.00434676231664159, 0.006714123005267953, 0.008698054407437532,
+ -0.01370846523601941, 0.01012828941725749, -0.007068078935658625,
+ -0.008138346009558437, 0.0467353028783406, -0.0658381497176358,
+ 0.01310067828595943, 0.07269279617480232, -0.1069564909021104,
+ 0.06762691282426264, 0.01034035065310993, -0.1175699606097785,
+ 0.192812157569135, -0.1084409432849384, -0.1353394082449725,
+ 0.290587999391769, -0.1665935202779336, -0.09927986222827791,
+ 0.2394316349364771, -0.196937680294991, 0.04675035632757467,
+ 0.160737603124711, -0.2866953475517299, 0.11533530450257,
+ 0.2313808347485174, -0.285955205900817, -0.07033046899644142,
+ 0.3010809341153604, -0.03711556319204814, -0.2854261021892172,
+ 0.1326266190726841, 0.2334442000696142, -0.2160410554670428,
+ -0.122575309612308, 0.2186808995859664, 0.02544075501374961,
+ -0.1660358993667236, 0.02009196196614523, 0.1162583994153812,
+ -0.03991958608138682, -0.07115975637749203, 0.04270444046513863,
+ 0.03536651879157764, -0.02655940136961219, -0.0166541988800009,
+ 0.01811758653663791, 0.003161066879299114, -0.006590249135122636,
+ 0.0000224660373347443, 0.002764837297017082, -0.001816050098089884,
+ 0.000221385824782758, 0.001325129169916481, -0.0009313048485056467,
+ -0.001002997644614651, 0.0006461390960813223, 0.0005091843808757102,
+ -0.0004981831027749185, -0.0002132118318370338, 0.0001692041329121999,
+ 0.00009203280989519006, -0.0000726634301061485, -0.000003776173954180476,
+ 0.000005650286559057409, 1.015871235188678e-8, 0.000009297695668468626,
+ 0.000008217172691037263, -0.000005352793597674221, -0.000004293043830914206,
+ 0.00000406840557498943, 0.000001957539844881767, -0.000001357985014138161,
+ -7.970430363552399e-7, 5.338776009119553e-7, 1.022190984936616e-7,
+ 7.153181993493103e-9, -9.647767193713991e-8, -1.087063157245304e-7,
+ -4.429283737485961e-8, 2.047021589652069e-8, 2.576393519656189e-8
+};
+
+const double ff_on2avc_tab_84_4[] = {
+ -0.0008804814258974317, 0.001677984795861344, 0.0019438229200474,
+ -0.002374701634816941, 0.002842769830143803, -0.00313020546738317,
+ -0.002246992394582708, 0.01055408593972395, -0.01218520382203817,
+ -0.0006735617784857061, 0.02057268271156303, -0.03472338199007904,
+ 0.02960799007316684, -0.003269335988224603, -0.02972969305167542,
+ 0.05008512160999294, -0.04400487480883553, 0.01713790123047206,
+ 0.001794796985095048, 0.02465108569696885, -0.1185046238791295,
+ 0.2661533909042693, -0.4170434096290337, 0.5056971209966197,
+ -0.4839205146480338, 0.348475120088803, -0.1457287020663733,
+ -0.04963861239550338, 0.1710032440522816, -0.1892135762829684,
+ 0.1231345995813251, -0.02389080306388811, -0.054785057318703,
+ 0.08416222204781872, -0.0666027804409105, 0.02377207113744183,
+ 0.01203829040820619, -0.02516530033022068, 0.01840432198285431,
+ -0.006286010406016099, -0.004035603243854861, 0.006949156667744018,
+ -0.00161215048516293, -0.001828701991824727, 0.0009090589499595256,
+ 0.0009761363135882747, -0.002142429121283414, 0.0004188485015062717,
+ 0.001809279129203381, -0.000932687525032396, -0.0009486028487922317,
+ 0.0009397940062201393, 0.000281183371137153, -0.0009248586848561844,
+ 0.0002152615409451283, 0.0005477801444594987, -0.0002659748756010768,
+ -0.0002773742035095173, 0.0002260622852620992, 0.0001512792970069076,
+ -0.0001768728566277711, -0.00002986876958461399, 0.00005130565743733275,
+ 0.000004374757277468806, -0.00002195539036180244, 0.000002913282980087422,
+ 3.818084416943484e-7, -0.000006288075796943977, 0.000006984829418122699,
+ 0.00000614694006919441, -0.000005946919055089292, -0.000001264733599421358,
+ 0.000004339214975250828, 0.000001188830031229202, -2.565690994853701e-7,
+ -8.929058735983076e-7, -5.618418560386023e-7, -2.216635610199557e-7,
+ 9.901798023372271e-8, 1.312667895662033e-7, 6.845290101279972e-9,
+ 2.7891417275888e-9, -1.289019550645086e-9, -1.62236765541716e-9
+};
+
+static const double tabs_4_10[4 * 2][10] = {
+ { 0.92756648, 0.17727433, -0.31028851, -0.041293536, 0.099339873,
+ -0.0079929986, -0.016111206, 0.004271808, 0.0, 0.0 },
+ { 0.0, 0.0, 0.16008016, 0.60374538, 0.7244924,
+ 0.13948189, -0.24189853, -0.03548063, 0.075736174, 0.0034171261 },
+ { 0.0, 0.0, -2.0495447e-10, -7.6501622e-10, 0.15922493,
+ 0.60051988, 0.72580564, 0.15828764, -0.23272256, -0.089524832 },
+ { 0.0, 0.0, 1.7673448e-10, 6.4163071e-10, 0.000032608112,
+ 0.00012297965, 0.15178394, 0.57192786, 0.73750254, 0.32549984 },
+ { 0.32549984, -0.73750254, 0.57192786, -0.15178394, 0.00012297965,
+ -0.000032608112, 6.4163071e-10, -1.7673448e-10, 0.0, 0.0 },
+ { -0.089524832, 0.23272256, 0.15828764, -0.72580564, 0.60051988,
+ -0.15922493, -7.6501621e-10, 2.0495446e-10, 0.0, 0.0 },
+ { 0.0034171261, -0.075736174, -0.03548063, 0.24189853, 0.13948189,
+ -0.7244924, 0.60374538, -0.16008016, 0.0, 0.0 },
+ { 0.0, 0.0, 0.004271808, 0.016111206, -0.0079929986,
+ -0.099339873, -0.041293536, 0.31028851, 0.17727433, -0.92756648 }
+};
+
+const double * const ff_on2avc_tabs_4_10_1[4] = {
+ tabs_4_10[0], tabs_4_10[1], tabs_4_10[2], tabs_4_10[3]
+};
+
+const double * const ff_on2avc_tabs_4_10_2[4] = {
+ tabs_4_10[4], tabs_4_10[5], tabs_4_10[6], tabs_4_10[7]
+};
+
+static const double tabs_9_20[9 * 2][20] = {
+ { 0.20265566, 0.6892313, 0.64164786, 0.066309055, -0.23597194,
+ -0.10432145, 0.027402007, 0.02147583, -0.0011571443, -0.0016923795,
+ 0.00010941944, 0.000063155164, -0.000012061176, -0.0000094681391, 6.8164837e-7,
+ 8.0672986e-7, -1.2001096e-8, -3.0778157e-8, 0.0, 0.0, },
+ { 0.07340142, -0.033796895, 0.20223772, 0.68677248, 0.64011737,
+ 0.068365159, -0.23333401, -0.10451285, 0.025911516, 0.021156819,
+ -0.00066987817, -0.0015032608, 0.000010536012, 0.000009012748, -4.0880101e-7,
+ -6.3486186e-7, 5.2718557e-9, 1.3520266e-8, 0.0, 0.0, },
+ { -0.0063151262, 0.081450872, 0.073146431, -0.033591262, 0.20164331,
+ 0.68441526, 0.63817515, 0.068893633, -0.23191782, -0.10429366,
+ 0.025382739, 0.020958119, -0.0005645414, -0.0014434993, 1.2043506e-7,
+ 1.5836305e-7, -1.9186041e-9, -4.9204755e-9, 0.0, 0.0, },
+ { 0.0089685824, -0.012688761, -0.0063138246, 0.081440272, 0.073137193,
+ -0.033582316, 0.20162334, 0.68433035, 0.63810986, 0.068926154,
+ -0.23185254, -0.1042793, 0.025363699, 0.020949148, -0.00056217266,
+ -0.0014417225, 4.1287276e-10, 1.0588585e-9, 0.0, 0.0, },
+ { -0.0016078274, 0.0035534844, 0.008968513, -0.012688661, -0.00631377,
+ 0.081439643, 0.073136632, -0.033582001, 0.20162186, 0.68432512,
+ 0.63810515, 0.068926132, -0.23185031, -0.10427845, 0.025363336,
+ 0.020948912, -0.00056214976, -0.0014416961, 0.0, 0.0, },
+ { 0.0, 0.0, 0.00024537589, -0.000095677578, -0.0016078292,
+ 0.0035534886, 0.0089685234, -0.012688676, -0.0063137774, 0.081439737,
+ 0.073136717, -0.03358204, 0.20162209, 0.68432592, 0.63810589,
+ 0.068926212, -0.23185058, -0.10427857, 0.025363365, 0.020948936, },
+ { 0.0, 0.0, -1.091532e-8, 4.2561286e-9, 0.00024558029,
+ -0.000095887463, -0.0016090989, 0.0035559773, 0.0089736609, -0.01269917,
+ -0.0063204498, 0.081485332, 0.073167353, -0.033630667, 0.20170289,
+ 0.68469343, 0.63846175, 0.068968176, -0.23197726, -0.10433598, },
+ { 0.0, 0.0, 7.1344765e-8, -2.7818928e-8, -0.000002528456,
+ 0.0000018368197, 0.00026997937, -0.00013252441, -0.001740633, 0.0038067121,
+ 0.0093531772, -0.013821566, -0.0070879361, 0.084739015, 0.074159694,
+ -0.040471924, 0.20317226, 0.70739793, 0.66214244, 0.072193371, },
+ { 0.0, 0.0, -1.7745724e-7, 6.919457e-8, 0.0000079212679,
+ -0.0000052051852, -0.00011186159, 0.00013087209, 0.0010011907, -0.0014292895,
+ -0.0047484872, 0.010485041, 0.016207683, -0.039758642, -0.022104737,
+ 0.14309317, 0.071659816, -0.21620638, 0.12174763, 0.95412469, },
+ { 0.96811974, -0.066460839, -0.18990589, -0.12699724, 0.074900229,
+ 0.019365102, -0.0094028752, -0.0073225687, 0.0024846173, 0.001133314,
+ -0.000066782094, -0.00017127018, -5.1701849e-12, -2.6883967e-12, 8.4434004e-13,
+ 4.5714433e-13, -2.0336233e-14, -4.8142821e-14, 0.0, 0.0, },
+ { 0.070051015, -0.67622735, 0.69971496, -0.18987268, -0.023601022,
+ -0.073694534, 0.076964926, 0.0049448517, -0.011660957, -0.0084153664,
+ 0.003416879, 0.0015114204, -0.000092440393, -0.00023707381, -7.8278594e-12,
+ -3.4041849e-12, 2.1213123e-13, 5.424444e-13, 0.0, 0.0, },
+ { -0.10400446, 0.23379783, 0.070139677, -0.63985915, 0.68278382,
+ -0.20175657, -0.032740047, -0.072931763, 0.08122816, 0.006212184,
+ -0.012650812, -0.0089459474, 0.0035507517, 0.0016049328, -0.000095625024,
+ -0.00024524111, -5.4947649e-15, -1.3849329e-14, 0.0, 0.0, },
+ { 0.020927727, -0.025453371, -0.10434942, 0.23188113, 0.068987354,
+ -0.63810296, 0.68429767, -0.20162896, -0.033573142, -0.073133229,
+ 0.081437918, 0.006312788, -0.012688459, -0.00896836, 0.0035534757,
+ 0.0016078143, -0.000095677348, -0.0002453753, 0.0, 0.0, },
+ { 0.0, 0.0, -0.001441696, 0.00056214971, 0.020948908,
+ -0.025363333, -0.10427841, 0.23185026, 0.068925853, -0.63810466,
+ 0.68432625, -0.20162446, -0.033584819, -0.073127012, 0.081444767,
+ 0.0062889982, -0.012692356, -0.008907458, 0.0035730328, 0.001494756, },
+ { 0.0, 0.0, -8.891553e-14, 3.465479e-14, -0.0014416744,
+ 0.00056214128, 0.020948423, -0.025362886, -0.10427345, 0.23184342,
+ 0.06889794, -0.63805105, 0.68441106, -0.20186695, -0.033718945,
+ -0.072480772, 0.081576567, 0.0047896878, -0.012951761, -0.0055205304, },
+ { 0.0, 0.0, 3.1384661e-12, -1.2236911e-12, -4.5712737e-11,
+ 5.5252991e-11, -0.0014413395, 0.00056201026, 0.020940121, -0.025355656,
+ -0.10419478, 0.23172734, 0.068557589, -0.63726677, 0.68504332,
+ -0.20430545, -0.034154654, -0.067051635, 0.082518833, -0.0074921348, },
+ { 0.0, 0.0, 2.1591083e-13, -8.4449036e-14, 1.2247511e-13,
+ 2.5428931e-12, -3.0481069e-11, 2.2021003e-11, -0.0014310921, 0.00055801468,
+ 0.020774997, -0.025169051, -0.10308717, 0.22974304, 0.064648504,
+ -0.62768798, 0.69288569, -0.23617203, -0.037952156, 0.0066274123, },
+ { 0.0, 0.0, 6.0226175e-14, -2.3096046e-14, -7.8692048e-13,
+ 1.0072813e-12, 5.1344469e-12, -8.9372637e-12, -3.4167908e-11, 5.4327109e-11,
+ -0.0014266369, 0.00055627748, 0.020644778, -0.025065139, -0.10169917,
+ 0.22783, 0.058894795, -0.61350902, 0.69559873, -0.27013783, }
+};
+
+const double* const ff_on2avc_tabs_9_20_1[9] = {
+ tabs_9_20[0], tabs_9_20[1], tabs_9_20[2], tabs_9_20[3], tabs_9_20[4],
+ tabs_9_20[5], tabs_9_20[6], tabs_9_20[7], tabs_9_20[8]
+};
+
+const double* const ff_on2avc_tabs_9_20_2[9] = {
+ tabs_9_20[ 9], tabs_9_20[10], tabs_9_20[11], tabs_9_20[12], tabs_9_20[13],
+ tabs_9_20[14], tabs_9_20[15], tabs_9_20[16], tabs_9_20[17]
+};
+
+static const double tabs_19_40[19 * 2][40] = {
+ { 0.56930638, 0.68416675, 0.20290636, -0.29270057, -0.25598083, 0.030953821, 0.11394564, 0.022880839,
+ -0.028207704, -0.012215512, 0.003721839, 0.003276676, 0.00026276625, -0.00056233677, -0.00035737156, 0.000045825146,
+ 0.00015152336, 0.000014158357, -0.000048183036, -0.000010022261, 0.000012417808, 0.0000037410435, -0.0000026072561, -0.000001014039,
+ 4.4228357e-7, 2.1030097e-7, -5.993645000000001e-8, -3.3779106e-8, 6.3845155e-9, 4.1681669e-9, -5.2093484e-10, -3.8565026e-10,
+ 3.1069535e-11, 2.5581578e-11, -1.2377426e-12, -1.114565e-12, 2.5948758e-14, 2.4949169e-14, 0.0, 0.0, },
+ { 0.083936735, 0.17821863, 0.5557409800000001, 0.66602779, 0.18178906, -0.30696561, -0.25275335, 0.044259687,
+ 0.11887063, 0.016608155, -0.032850108, -0.009887007200000001, 0.0065059949, 0.0025768587, -0.001107713, -0.00043230142,
+ 0.00021702341, 0.00006287448900000001, -0.000052147048, -0.000013629236, 0.000012262655, 0.0000039527411, -0.0000024594151, -9.9628076e-7,
+ 4.0201906e-7, 1.9618194e-7, -5.2873852e-8, -3.0291222e-8, 5.4982857e-9, 3.6241851e-9, -4.4014692e-10, -3.274108e-10,
+ 2.5877833e-11, 2.1342274e-11, -1.021061e-12, -9.1957797e-13, 2.1361163e-14, 2.0538295e-14, 0.0, 0.0, },
+ { 0.06426235399999999, 0.14252447, 0.08331282299999999, 0.17697664, 0.54915213, 0.65833374, 0.18253037, -0.29973661,
+ -0.2501844, 0.040186639, 0.1162191, 0.01848039, -0.030986232, -0.010520451, 0.0054986371, 0.0027059342,
+ -0.00066811525, -0.00042405191, 0.000058970897, 0.000041824657, -0.0000050297476, -0.0000027888321, 6.4141372e-7, 2.6119558e-7,
+ -1.0436111e-7, -5.1153743e-8, 1.3625299e-8, 7.8592626e-9, -1.3937291e-9, -9.315507e-10, 1.0721353e-10, 8.1948407e-11,
+ -5.7676714e-12, -4.9562407e-12, 1.8554768e-13, 1.7299401e-13, -1.8580814e-15, -1.786505e-15, 0.0, 0.0, },
+ { -0.013307048, -0.033975901, 0.06420919899999999, 0.14239611, 0.083308942, 0.17697702, 0.54882206, 0.65796781,
+ 0.18278485, -0.29910579, -0.25007544, 0.039720818, 0.11595345, 0.018673713, -0.030787294, -0.010566866,
+ 0.0054007477, 0.002707498, -0.0006312670199999999, -0.00041960532, 0.000047781271, 0.000039310002, -0.0000022421464, -0.0000019114661,
+ 7.288871400000001e-8, 3.3940173e-8, -1.0341206e-8, -5.5262517e-9, 1.2264303e-9, 7.3318115e-10, -1.205231e-10, -7.999549799999999e-11,
+ 9.360987e-12, 7.031617e-12, -5.2275601e-13, -4.536133e-13, 1.6843252e-14, 1.6194422e-14, 0.0, 0.0, },
+ { 0.0018985257, 0.020620645, -0.013303786, -0.033963287, 0.064192393, 0.14235646, 0.08330606, 0.176973,
+ 0.5487176499999999, 0.65785432, 0.1828607, -0.29890778, -0.25001974, 0.039603104, 0.11587197, 0.018712544,
+ -0.030736214, -0.010572356, 0.0053789802, 0.002705838, -0.00062416865, -0.00041818516, 0.000045935153, 0.000038762853,
+ -0.0000018498967, -0.0000017627229, 4.1333815e-9, 2.700156e-9, -3.0391538e-10, -2.6291895e-10, 7.6542367e-12, 1.2019785e-11,
+ 9.0469833e-13, 5.0485213e-13, -1.0391267e-13, -9.305248e-14, 2.356875e-15, 2.2660843e-15, 0.0, 0.0, },
+ { -0.0001091778, -0.010561339, 0.0018984228, 0.020619062, -0.013302974, -0.033960505, 0.064188298, 0.14234701,
+ 0.08330394300000001, 0.17696883, 0.54868941, 0.6578225599999999, 0.18287011, -0.29886826, -0.25000476, 0.039583069,
+ 0.11585553, 0.018717708, -0.030727247, -0.010572428, 0.0053756484, 0.0027053082, -0.0006232358500000001, -0.00041792434,
+ 0.000045731688, 0.000038685285, -0.0000018149671, -0.0000017460375, -5.167502e-10, 9.390694299999999e-12, 1.594319e-10, 5.8184529e-11,
+ -2.4161347e-11, -1.4454629e-11, 2.1037566e-12, 1.7321615e-12, -9.986456699999999e-14, -9.6017617e-14, 0.0, 0.0, },
+ { -0.0005767410599999999, 0.0035190291, -0.00010917955, -0.010561258, 0.0018984108, 0.020618888, -0.013302882, -0.033960202,
+ 0.064187838, 0.14234596, 0.083303668, 0.17696827, 0.54868618, 0.65781893, 0.18287097, -0.298864,
+ -0.25000294, 0.039581151, 0.11585376, 0.018718064, -0.03072639, -0.010572378, 0.0053753363, 0.0027052073,
+ -0.00062317825, -0.00041788417, 0.000045733074, 0.000038677454, -0.0000018196051, -0.0000017460967, 9.887897300000001e-10, 4.6848142e-10,
+ -1.2195123e-10, -7.9561868e-11, 9.378916700000001e-12, 7.8791268e-12, -3.9130514e-13, -3.7623141e-13, 0.0, 0.0, },
+ { 0.00030131631, -0.0010263444, -0.00057674065, 0.0035190268, -0.00010917966, -0.010561251, 0.0018984097, 0.020618873,
+ -0.013302874, -0.033960176, 0.064187798, 0.14234586, 0.083303637, 0.17696821, 0.54868588, 0.65781858,
+ 0.182871, -0.29886366, -0.25000278, 0.039580995, 0.11585361, 0.018718039, -0.03072645, -0.010572511,
+ 0.0053752804, 0.0027052669, -0.00062312096, -0.00041789128, 0.000045707579, 0.000038673143, -0.0000018129216, -0.0000017437794,
+ -1.7501699e-10, -1.1843802e-10, 1.2678547e-11, 1.0773126e-11, -4.8703456e-13, -4.6827318e-13, 0.0, 0.0, },
+ { -0.000089637995, 0.00022613691, 0.0003013163, -0.0010263444, -0.00057674064, 0.0035190267, -0.00010917963, -0.010561251,
+ 0.0018984096, 0.020618873, -0.013302874, -0.033960176, 0.06418779600000001, 0.14234586, 0.083303635, 0.1769682,
+ 0.54868587, 0.65781858, 0.18287099, -0.29886369, -0.2500028, 0.039580943, 0.11585345, 0.018717863,
+ -0.030726497, -0.010572431, 0.005375347, 0.002705256, -0.00062315197, -0.00041789626, 0.000045715815, 0.000038675974,
+ -0.0000018143635, -0.0000017445048, -7.806062e-12, -6.3155567e-12, 4.0893858e-13, 3.9318559e-13, 0.0, 0.0, },
+ { 0.000018826413, -0.000032248448, -0.000089637995, 0.00022613691, 0.0003013163, -0.0010263444, -0.00057674066, 0.0035190267,
+ -0.00010917957, -0.010561251, 0.0018984095, 0.020618874, -0.013302874, -0.033960178, 0.06418779600000001, 0.14234587,
+ 0.083303632, 0.17696819, 0.54868589, 0.65781861, 0.18287101, -0.29886365, -0.25000267, 0.039581091,
+ 0.11585349, 0.018717796, -0.030726553, -0.010572422, 0.0053753731, 0.0027052603, -0.00062315889, -0.00041789864,
+ 0.000045717027, 0.000038676583, -0.0000018145039, -0.0000017445989, 2.4971934e-12, 2.4009973e-12, 0.0, 0.0, },
+ { -0.0000023940844, 0.0000029119687, 0.00001882641, -0.000032248444, -0.000089637969, 0.00022613687, 0.00030131618, -0.0010263441,
+ -0.00057674024, 0.0035190253, -0.00010918036, -0.010561246, 0.0018984093, 0.020618859, -0.013302871, -0.03396015,
+ 0.064187778, 0.14234582, 0.08330372, 0.17696839, 0.548686, 0.65781885, 0.18287176, -0.29886274,
+ -0.25000242, 0.03958068, 0.11585315, 0.01871785, -0.030726394, -0.010572396, 0.0053753308, 0.0027052457,
+ -0.00062315149, -0.00041789492, 0.000045716169, 0.000038676008, -0.000001814441, -0.0000017445457, 0.0, 0.0, },
+ { 0.0, 0.0, 1.3407205e-7, -1.3944369e-7, -0.0000023940844, 0.0000029119687, 0.00001882641, -0.000032248444,
+ -0.000089637969, 0.00022613687, 0.00030131618, -0.0010263441, -0.00057674024, 0.0035190253, -0.00010918036, -0.010561246,
+ 0.0018984093, 0.020618859, -0.013302871, -0.03396015, 0.064187778, 0.14234582, 0.08330372, 0.17696839,
+ 0.548686, 0.65781885, 0.18287176, -0.29886274, -0.25000242, 0.03958068, 0.11585315, 0.01871785,
+ -0.030726394, -0.010572396, 0.0053753308, 0.0027052457, -0.00062315149, -0.00041789492, 0.000045716169, 0.000038676008, },
+ { 0.0, 0.0, -1.8454182e-13, 1.9193555e-13, 1.3407535e-7, -1.394477e-7, -0.0000023941103, 0.0000029120131,
+ 0.000018826533, -0.000032248755, -0.000089638384, 0.00022613828, 0.00030131697, -0.0010263489, -0.00057674009, 0.0035190398,
+ -0.00010918297, -0.010561274, 0.0018984276, 0.020618906, -0.013302959, -0.033960346, 0.06418766400000001, 0.14234558,
+ 0.08330296500000001, 0.17696749, 0.54868575, 0.65781926, 0.1828721, -0.2988628, -0.25000258, 0.039580654,
+ 0.11585319, 0.018717865, -0.030726402, -0.0105724, 0.0053753317, 0.0027052463, -0.00062315156, -0.00041789497, },
+ { 0.0, 0.0, -2.9968756e-14, 3.1169464e-14, 3.4461485e-13, -4.5274253e-13, 1.3407128e-7, -1.3944066e-7,
+ -0.0000023940918, 0.0000029119648, 0.000018826475, -0.000032248545, -0.000089638294, 0.00022613761, 0.00030131711, -0.001026347,
+ -0.00057674067, 0.0035190367, -0.00010918012, -0.010561271, 0.0018984144, 0.020618881, -0.013302985, -0.033960402,
+ 0.06418755499999999, 0.14234546, 0.083302923, 0.17696757, 0.54868595, 0.65781945, 0.18287214, -0.29886289,
+ -0.25000265, 0.039580667, 0.11585323, 0.01871787, -0.03072641, -0.010572403, 0.0053753332, 0.0027052471, },
+ { 0.0, 0.0, 3.4053947e-14, -3.541833e-14, -5.9108424e-13, 7.219441e-13, 3.686965e-12, -6.9987332e-12,
+ 1.3406826e-7, -1.3941009e-7, -0.0000023941744, 0.0000029119806, 0.000018827177, -0.000032249608, -0.000089641497, 0.00022614485,
+ 0.00030132559, -0.0010263798, -0.00057675334, 0.0035191463, -0.00010917896, -0.01056153, 0.001898552, 0.020619502,
+ -0.013303345, -0.033961425, 0.06418858299999999, 0.1423474, 0.083301974, 0.17696773, 0.54869501, 0.65783272,
+ 0.18287661, -0.29886847, -0.2500077, 0.039581297, 0.11585546, 0.018718257, -0.030726991, -0.010572606, },
+ { 0.0, 0.0, 3.8851186e-14, -4.0407771e-14, -9.0297499e-13, 1.0614292e-12, 1.2369841e-11, -1.7194763e-11,
+ -1.3889432e-10, 2.127443e-10, 1.3529716e-7, -1.415165e-7, -0.000002401917, 0.0000029279859, 0.000018862624, -0.000032344139,
+ -0.00008976013300000001, 0.00022657145, 0.00030158676, -0.0010279007, -0.00057694943, 0.0035236425, -0.00011001072, -0.010572116,
+ 0.0019036557, 0.020640207, -0.013321797, -0.034004076, 0.064218883, 0.14240437, 0.083244411, 0.17692659,
+ 0.54894337, 0.65823916, 0.1830245, -0.29903361, -0.250163, 0.039598328, 0.11592277, 0.018730262, },
+ { 0.0, 0.0, -2.5424375e-14, 2.6443011e-14, 1.3072139e-12, -1.4396059e-12, -2.9838328e-11, 3.6121355e-11,
+ 4.2808479e-10, -5.8577848e-10, -4.3953309e-9, 6.8915491e-9, 1.6727789e-7, -2.00599e-7, -0.0000025787194, 0.0000033304637,
+ 0.000019584144, -0.000034476114, -0.00009189714, 0.00023541633, 0.00030555578, -0.0010574794, -0.000577822, 0.0036058258,
+ -0.00013178926, -0.010757609, 0.0020075294, 0.020999334, -0.013644546, -0.03471548, 0.0647074, 0.14319792,
+ 0.081890324, 0.17546099, 0.55189921, 0.66398787, 0.18532974, -0.30125552, -0.25236809, 0.039796138, },
+ { 0.0, 0.0, 5.450404e-14, -5.6687762e-14, -2.413723e-12, 2.68197e-12, 5.4122889e-11, -6.597469100000001e-11,
+ -7.9689529e-10, 1.0842539e-9, 8.4827594e-9, -1.309149e-8, -6.848642999999999e-8, 1.2194237e-7, 5.5864479e-7, -0.0000010344816,
+ -0.0000044039463, 0.0000081482122, 0.000025993389, -0.000056794375, -0.0001079834, 0.00031887419, 0.00032752081, -0.0013147952,
+ -0.00055367277, 0.0042710356, -0.00037367267, -0.01217995, 0.0029410132, 0.023714229, -0.016091617, -0.03973309,
+ 0.068419296, 0.14835553, 0.070059102, 0.15950508, 0.56354819, 0.6963379, 0.20020752, -0.31277075, },
+ { 0.0, 0.0, 2.0986643e-14, -2.1827479e-14, -6.2317928e-13, 7.1419835e-13, 4.9978335e-12, -7.9628623e-12,
+ 6.4574499e-11, -3.0391734e-11, -2.093182e-9, 2.2676782e-9, 2.7596774e-8, -3.8208137e-8, -2.3879395e-7, 4.0380176e-7,
+ 0.0000016333254, -0.0000032376466, -0.0000094150001, 0.000021168371, 0.000043315086, -0.00011711363, -0.0001502271, 0.0005427171400000001,
+ 0.00038159158, -0.0019974544, -0.0004777833, 0.0060120078, -0.0010436508, -0.015880165, 0.0054219755, 0.030749996,
+ -0.022330626, -0.052220715, 0.07871199800000001, 0.16235935, 0.039966293, 0.11703729, 0.58925396, 0.77487668, },
+ { 0.76082901, -0.61501045, 0.070732318, -0.076233884, 0.16721565, -0.04604786, -0.038872216, 0.0073908504,
+ 0.018642214, -0.00059960166, -0.009041801, 0.000017181816, 0.0029672586, 0.0004791856, -0.00087051626, -0.0002528999,
+ 0.00019443347, 0.00007609031299999999, -0.000028013417, -0.000016226544, 0.0000025515355, 0.0000020939308, -1.2352758e-7, -1.1871399e-7,
+ 3.7653573e-11, -5.1553467e-12, -1.2189794e-11, -1.0694795e-12, 4.391544e-12, 1.0258575e-12, -1.1546382e-12, -3.8647265e-13,
+ 1.8127896e-13, 1.0023162e-13, -1.7537934e-14, -1.43414e-14, 8.6649097e-16, 8.3311729e-16, 0.0, 0.0, },
+ { -0.29020148, -0.17058579, 0.73009051, -0.54522599, 0.15148724, -0.089863731, 0.14246903, -0.057880136,
+ -0.032908729, 0.011933145, 0.019248716, -0.001642844, -0.009891541, 0.00011758938, 0.0032933357, 0.00053302425,
+ -0.00096384007, -0.00028170914, 0.00021364396, 0.000084221396, -0.000030604054, -0.000017803479, 0.0000027741657, 0.0000022790848,
+ -1.3343692e-7, -1.2837358e-7, -2.8291166e-11, -4.5113932e-12, 9.653859800000001e-12, 2.5188373e-12, -1.9411097e-12, -8.4860379e-13,
+ 2.4055653e-13, 1.6608885e-13, -1.7834093e-14, -1.5689603e-14, 5.0113872e-16, 4.818492e-16, 0.0, 0.0, },
+ { 0.029507585, 0.23915664, -0.31374537, -0.19147782, 0.66761054, -0.54476742, 0.17718214, -0.085893937,
+ 0.14081423, -0.0629847, -0.033056336, 0.013055001, 0.020096625, -0.0018682292, -0.010351996, 0.00012827752,
+ 0.0034538681, 0.00056125575, -0.0010101514, -0.00029566086, 0.00022323168, 0.00008825740999999999, -0.000031896814, -0.000018596176,
+ 0.0000028845736, 0.0000023710501, -1.3832474e-7, -1.3304067e-7, -1.7294869e-11, -2.81197e-12, 6.3974866e-12, 1.5855057e-12,
+ -1.1972211e-12, -5.6338465e-13, 1.3134602e-13, 1.0379039e-13, -7.732033400000001e-15, -7.434189599999999e-15, 0.0, 0.0, },
+ { 0.02137026, -0.11253601, 0.042589994, 0.25148145, -0.29992597, -0.18470705, 0.65790258, -0.54797686,
+ 0.17746938, -0.083682167, 0.14200727, -0.064059583, -0.033780176, 0.013281042, 0.020536256, -0.0019008618,
+ -0.010532156, 0.00011385908, 0.0035109303, 0.00057440761, -0.0010245672, -0.0003006148, 0.00022585476, 0.00008948980099999999,
+ -0.000032218587, -0.000018804752, 0.0000029102318, 0.0000023922344, -1.3952226e-7, -1.3403637e-7, 3.9608302e-11, 1.3905461e-11,
+ -6.1363765e-12, -3.3840174e-12, 5.9012281e-13, 4.7995226e-13, -3.0052643e-14, -2.8894955e-14, 0.0, 0.0, },
+ { -0.01101232, 0.030164564, 0.018237721, -0.11605179, 0.039730974, 0.25027003, -0.29882164, -0.18303474,
+ 0.65775001, -0.54862086, 0.17703165, -0.083330352, 0.1423101, -0.064180839, -0.033943639, 0.013302586,
+ 0.020612508, -0.0018991492, -0.010559265, 0.00010961366, 0.003518543, 0.00057658118, -0.0010262483, -0.00030127666,
+ 0.00022612153, 0.000089630847, -0.000032246277, -0.000018825371, 0.0000029116033, 0.0000023939368, -1.3937709e-7, -1.3404451e-7,
+ -9.1223008e-12, -5.4094957e-12, 8.1321806e-13, 6.7296866e-13, -3.7437071e-14, -3.5994924e-14, 0.0, 0.0, },
+ { 0.0027523866, -0.0053151929, -0.010522001, 0.030746051, 0.018701664, -0.11588024, 0.039576589, 0.25001961,
+ -0.29885452, -0.18288052, 0.65781266, -0.54868261, 0.1769717, -0.08330388900000001, 0.14234344, -0.064187437,
+ -0.03395959, 0.013303046, 0.020618614, -0.0018984637, -0.010561198, 0.00010920031, 0.0035190207, 0.00057673481,
+ -0.0010263442, -0.00030131581, 0.00022613719, 0.000089638071, -0.000032248498, -0.000018826446, 0.0000029119606, 0.0000023940888,
+ -1.3944039e-7, -1.3407106e-7, -4.6440655e-13, -3.5507487e-13, 3.1428853e-14, 3.0218153e-14, 0.0, 0.0, },
+ { -0.000421003, 0.00061919433, 0.0027019638, -0.0053765775, -0.010571322, 0.030728141, 0.018718075, -0.11585434,
+ 0.039580128, 0.25000318, -0.29886234, -0.18287235, 0.6578189800000001, -0.54868567, 0.17696763, -0.083302976,
+ 0.14234552, -0.064187667, -0.033960326, 0.013302963, 0.0206189, -0.0018984291, -0.010561273, 0.00010918342,
+ 0.0035190396, 0.00057673999, -0.0010263489, -0.00030131696, 0.00022613828, 0.000089638382, -0.000032248755, -0.000018826533,
+ 0.0000029120131, 0.0000023941103, -1.394477e-7, -1.3407534e-7, 1.9191457e-13, 1.8452165e-13, 0.0, 0.0, },
+ { 0.000038791283, -0.000045569699, -0.00041777535, 0.00062319501, 0.0027052056, -0.005375393, -0.010572402, 0.030726437,
+ 0.018717868, -0.11585317, 0.039580663, 0.25000243, -0.29886273, -0.18287176, 0.65781885, -0.548686,
+ 0.17696839, -0.08330372, 0.14234582, -0.064187778, -0.03396015, 0.013302871, 0.020618859, -0.0018984093,
+ -0.010561246, 0.00010918036, 0.0035190253, 0.00057674024, -0.0010263441, -0.00030131618, 0.00022613687, 0.000089637969,
+ -0.000032248444, -0.00001882641, 0.0000029119687, 0.0000023940844, -1.3944369e-7, -1.3407205e-7, 0.0, 0.0, },
+ { 0.0, 0.0, -0.0000017445457, 0.000001814441, 0.000038676008, -0.000045716169, -0.00041789492, 0.00062315149,
+ 0.0027052457, -0.0053753308, -0.010572396, 0.030726394, 0.01871785, -0.11585315, 0.03958068, 0.25000242,
+ -0.29886274, -0.18287176, 0.65781885, -0.548686, 0.17696839, -0.08330372, 0.14234582, -0.064187778,
+ -0.03396015, 0.013302872, 0.020618859, -0.0018984103, -0.010561245, 0.00010918227, 0.0035190235, 0.0005767369100000001,
+ -0.0010263409, -0.00030131137, 0.00022613101, 0.000089630778, -0.000032235242, -0.000018797134, 0.0000029311054, 0.0000023933095, },
+ { 0.0, 0.0, 2.400996e-12, -2.497192e-12, -0.0000017445989, 0.0000018145039, 0.000038676583, -0.000045717027,
+ -0.00041789864, 0.00062315889, 0.0027052603, -0.0053753731, -0.010572422, 0.030726553, 0.018717796, -0.11585349,
+ 0.039581091, 0.25000267, -0.29886365, -0.182871, 0.65781861, -0.54868589, 0.17696819, -0.083303628,
+ 0.14234587, -0.064187807, -0.033960174, 0.013302897, 0.020618859, -0.0018984526, -0.010561213, 0.00010925545,
+ 0.0035189544, 0.0005766278600000001, -0.0010262111, -0.00030114598, 0.00022584654, 0.00008902247699999999, -0.000032552144, -0.000018664449, },
+ { 0.0, 0.0, 3.9319783e-13, -4.0895132e-13, -6.3160719e-12, 7.8066363e-12, -0.0000017445047, 0.0000018143635,
+ 0.000038675973, -0.000045715815, -0.00041789626, 0.00062315196, 0.002705256, -0.005375347, -0.010572431, 0.030726497,
+ 0.018717863, -0.11585345, 0.039580944, 0.25000279, -0.29886369, -0.18287097, 0.65781858, -0.54868592,
+ 0.1769682, -0.083303514, 0.14234582, -0.064188067, -0.033960018, 0.013303399, 0.020618438, -0.0018993478,
+ -0.010560376, 0.0001106233, 0.0035173821, 0.0005745302, -0.0010229283, -0.00029453156, 0.00022779928, 0.000085362615, },
+ { 0.0, 0.0, -4.6834912e-13, 4.8711355e-13, 1.0776346e-11, -1.2682135e-11, -1.1850617e-10, 1.751009e-10,
+ -0.0000017437784, 0.0000018129203, 0.000038673133, -0.000045707564, -0.00041789121, 0.0006231208299999999, 0.0027052664, -0.0053752795,
+ -0.010572509, 0.030726445, 0.018718032, -0.11585358, 0.039581016, 0.25000268, -0.2988637, -0.18287068,
+ 0.65781858, -0.54868677, 0.17696847, -0.08330162200000001, 0.14234476, -0.064191787, -0.033957024, 0.013310076,
+ 0.020612258, -0.0019097554, -0.010548644, 0.00012671842, 0.0034937666, 0.00052913399, -0.0010278304, -0.00025627314, },
+ { 0.0, 0.0, -3.7591141e-13, 3.9097232e-13, 7.8654833e-12, -9.3637194e-12, -7.9270845e-11, 1.2159335e-10,
+ 4.6441491e-10, -9.8316498e-10, -0.0000017460554, 0.00000181954, 0.000038677134, -0.000045732491, -0.00041788222, 0.00062317407,
+ 0.0027051979, -0.0053753121, -0.010572343, 0.030726274, 0.018717964, -0.1158533, 0.039581338, 0.25000143,
+ -0.29886407, -0.1828668, 0.65781782, -0.54869588, 0.17697338, -0.083284289, 0.14233111, -0.06422307200000001,
+ -0.033928145, 0.013359197, 0.020557279, -0.0019859605, -0.010440679, 0.00032845982, 0.0034922164, 0.00031950723, },
+ { 0.0, 0.0, -9.7008176e-14, 1.0089481e-13, 1.77473e-12, -2.1511483e-12, -1.5372262e-11, 2.5287645e-11,
+ 7.115903100000001e-11, -1.77311e-10, -1.2348213e-10, 7.2542972e-10, -0.0000017450016, 0.0000018130844, 0.000038678971, -0.00004571817,
+ -0.00041789388, 0.00062315711, 0.0027051921, -0.0053752707, -0.010572087, 0.030725736, 0.018717011, -0.11585044,
+ 0.03958358, 0.24999022, -0.29886524, -0.18283501, 0.65780555, -0.5487611999999999, 0.17702181, -0.083173702,
+ 0.14222973, -0.064399687, -0.033732817, 0.01363355, 0.020184552, -0.0026582356, -0.010334243, 0.0011989638, },
+ { 0.0, 0.0, 4.8096417e-15, -5.0023409e-15, -2.0363605e-13, 2.2693214e-13, 2.9268545e-12, -3.8691566e-12,
+ -2.2830499e-11, 4.010721e-11, 1.0030539e-10, -2.6202135e-10, -1.750769e-10, 1.0448174e-9, -0.0000017449923, 0.000001812272,
+ 0.000038676696, -0.00004571407, -0.0004178554, 0.00062310242, 0.0027048621, -0.0053746982, -0.010570284, 0.03072167,
+ 0.018710471, -0.11582959, 0.039596876, 0.24991347, -0.29886368, -0.18263206, 0.65769914, -0.54914259,
+ 0.17734742, -0.082618805, 0.14162772, -0.06527709199999999, -0.032607813, 0.015574165, 0.01947389, -0.0058478027, },
+ { 0.0, 0.0, 1.1620773e-14, -1.2086359e-14, -2.5281225e-13, 2.9951516e-13, 2.5798868e-12, -3.9238172e-12,
+ -1.5091708e-11, 3.1934537e-11, 4.7586293e-11, -1.6454863e-10, -2.4363315e-11, 5.0961544e-10, -4.3869198e-10, -6.2033089e-10,
+ -0.0000017425281, 0.0000018129976, 0.000038659328, -0.000045695417, -0.00041768461, 0.00062286511, 0.0027034675, -0.0053722734,
+ -0.010562778, 0.030704525, 0.018683973, -0.1157433, 0.039644886, 0.24960502, -0.29882338, -0.18185802,
+ 0.65720216, -0.55036798, 0.17856616, -0.080914163, 0.13954371, -0.06882522000000001, -0.030723701, 0.022700612, },
+ { 0.0, 0.0, 3.3760298e-15, -3.5112922e-15, -6.3206989e-14, 7.636481800000001e-14, 5.5558903e-13, -9.0603035e-13,
+ -2.6533985e-12, 6.4749011e-12, 5.3634022e-12, -2.7507239e-11, 1.1363474e-11, 5.960222e-11, -1.0091373e-10, 2.5808497e-11,
+ 1.3953072e-10, -2.6651685e-10, -0.000001742256, 0.0000018124516, 0.000038611107, -0.000045640594, -0.00041703113, 0.00062197544,
+ 0.0026981501, -0.0053630599, -0.010535085, 0.030640024, 0.018595029, -0.11543077, 0.039765416, 0.24856666,
+ -0.29852909, -0.17958773, 0.6555599600000001, -0.5538587699999999, 0.18206628, -0.07570165600000001, 0.13430764, -0.08408151899999999, },
+ { 0.0, 0.0, 5.9918017e-16, -6.2318032e-16, -9.9379759e-15, 1.2221683e-14, 8.0845727e-14, -1.3829585e-13,
+ -3.7650038e-13, 9.459626799999999e-13, 9.869205499999999e-13, -4.1121055e-12, -1.1120552e-12, 1.2402418e-11, -2.0576524e-12, -2.6724353e-11,
+ 1.4957979e-12, 9.137734800000001e-11, -1.5845915e-9, 1.4784326e-9, -0.0000016861848, 0.0000017493852, 0.000037821856, -0.000044585784,
+ -0.00041031894, 0.00061056275, 0.0026598482, -0.0052790669, -0.010386803, 0.030195423, 0.018217984, -0.11365566,
+ 0.040288546, 0.24321245, -0.29862004, -0.16484799, 0.64946229, -0.58650413, 0.20634045, -0.014365476, },
+ { 0.0, 0.0, 6.6467568e-17, -6.912305e-17, -6.2475603e-16, 8.5867071e-16, 8.7357039e-16, -5.4126396e-15,
+ 2.2202664e-14, -5.4492598e-15, -1.70592e-13, 2.8319481e-13, 6.331548e-13, -1.7748409e-12, -1.7196603e-12, 6.8530479e-12,
+ 2.0919589e-12, -1.9194583e-11, -1.3868107e-8, 1.4507548e-8, 2.4548427e-7, -2.9905628e-7, -0.0000035971494, 0.0000050451109,
+ 0.00004672424, -0.000067456818, -0.00044153822, 0.00071430062, 0.0027532286, -0.0056688462, -0.010727074, 0.031800916,
+ 0.019871848, -0.11989559, 0.036659135, 0.26632201, -0.3057397, -0.23220335, 0.68741352, -0.54024027, }
+};
+
+const double* const ff_on2avc_tabs_19_40_1[19] = {
+ tabs_19_40[ 0], tabs_19_40[ 1], tabs_19_40[ 2], tabs_19_40[ 3],
+ tabs_19_40[ 4], tabs_19_40[ 5], tabs_19_40[ 6], tabs_19_40[ 7],
+ tabs_19_40[ 8], tabs_19_40[ 9], tabs_19_40[10], tabs_19_40[11],
+ tabs_19_40[12], tabs_19_40[13], tabs_19_40[14], tabs_19_40[15],
+ tabs_19_40[16], tabs_19_40[17], tabs_19_40[18],
+};
+
+const double* const ff_on2avc_tabs_19_40_2[19] = {
+ tabs_19_40[19], tabs_19_40[20], tabs_19_40[21], tabs_19_40[22],
+ tabs_19_40[23], tabs_19_40[24], tabs_19_40[25], tabs_19_40[26],
+ tabs_19_40[27], tabs_19_40[28], tabs_19_40[29], tabs_19_40[30],
+ tabs_19_40[31], tabs_19_40[32], tabs_19_40[33], tabs_19_40[34],
+ tabs_19_40[35], tabs_19_40[36], tabs_19_40[37],
+};
+
+static const double tabs_20_84[20 * 4][84] = {
+ { -0.10690582, 0.094662183, 0.31757963, 0.48370235, 0.53678916, 0.46705598, 0.31621123, 0.15326227,
+ 0.038302765, -0.0054998811, 0.0073520352, 0.043879657, 0.067374408, 0.060077687, 0.027405389, -0.009983873000000001,
+ -0.032034985, -0.033515334, -0.017328881, -0.0009890252300000001, 0.0060597434, 0.0056072468, 0.002571725, -0.0007936099700000001,
+ -0.0027018322, -0.0027530703, -0.0014845177, 0.000064203217, 0.0010169666, 0.0011425746, 0.0006388587, -0.0000018624399,
+ -0.0003856745, -0.00043471053, -0.00023808948, -0.0000010996843, 0.00013049299, 0.00014628934, 0.00008690307399999999, 0.000020136779,
+ -0.00001317216, -0.000017142035, -0.0000073231078, 0.0000027043389, 0.0000059557329, 0.0000045096238, 0.0000020887956, 1.9940697e-7,
+ -5.9358256e-7, -7.422066799999999e-7, -7.3570645e-7, -7.3115553e-7, -7.2933999e-7, -6.8435909e-7, -5.0707974e-7, -3.8679328e-7,
+ -3.4522208e-7, -2.8271694e-7, -1.3713424e-7, 8.1184249e-9, 9.007577e-8, 1.0329366e-7, 6.463027099999999e-8, 2.1860912e-8,
+ 5.1066896e-10, -2.670761e-9, -8.5876196e-10, 4.9520519e-9, 1.0149098e-8, 1.0748594e-8, 5.7620398e-9, 1.747266e-12,
+ -3.1210565e-9, -3.4682633e-9, -1.969792e-9, -4.3451013e-10, 2.1837603e-10, 2.5217949e-10, 1.4564222e-10, 3.9900967e-11,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0065157518, -0.11553191, -0.2003235, -0.20418917, -0.10172818, 0.084274311, 0.29189952, 0.4498939,
+ 0.5060534800000001, 0.44955248, 0.316223, 0.16751007, 0.057934971, 0.009822325, 0.01258206, 0.039193775,
+ 0.05803246, 0.052804012, 0.026596935, -0.0041283092, -0.023092596, -0.026167999, -0.014874145, -0.0035171769,
+ 0.0010177737, 0.0010448012, 0.00056458234, -0.00002147272, -0.00037997699, -0.00042776572, -0.00024136656, -0.0000050238535,
+ 0.0001358557, 0.00015438052, 0.000084239467, -1.6787043e-7, -0.000046506822, -0.000051573195, -0.00003026341, -0.0000066056329,
+ 0.0000050707828, 0.0000063933192, 0.0000029272058, -5.6899116e-7, -0.0000017091248, -0.000001263969, -5.570908e-7, -1.1465662e-8,
+ 2.1544169e-7, 2.5116122e-7, 2.3708156e-7, 2.2251093e-7, 2.1287918e-7, 1.9828806e-7, 1.5178343e-7, 1.2339394e-7,
+ 1.1450823e-7, 9.427839099999999e-8, 4.5909852e-8, -2.8333617e-9, -3.0612544e-8, -3.510426e-8, -2.1859204e-8, -6.9884918e-9,
+ 6.0182974e-10, 1.7346196e-9, 7.5210778e-10, -1.6045901e-9, -3.5459042e-9, -3.7642404e-9, -2.0232963e-9, -2.1548766e-11,
+ 1.0548306e-9, 1.1724849e-9, 6.6598834e-10, 1.4716004e-10, -7.3310163e-11, -8.4658191e-11, -4.8892981e-11, -1.3394998e-11,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.009584246100000001, 0.060037953, 0.08995716600000001, 0.07015256, -0.0064981541, -0.11412419, -0.19788136, -0.20183985,
+ -0.10090064, 0.082591928, 0.28777272, 0.44450316, 0.50121997, 0.44689528, 0.31636017, 0.16979842,
+ 0.060835882, 0.011721646, 0.012592987, 0.037481155, 0.055630623, 0.050971284, 0.026138847, -0.0031939983,
+ -0.021447285, -0.024707738, -0.014251364, -0.0038152781, 0.00019304198, 0.00021786771, 0.00012308297, 0.0000035156435,
+ -0.000067129672, -0.000076387194, -0.000041781791, -4.7347618e-7, 0.000021885498, 0.000024212644, 0.000014093384, 0.0000029734778,
+ -0.0000024267734, -0.0000029909187, -0.0000014079434, 1.6425532e-7, 6.695171e-7, 4.7998271e-7, 2.0415765e-7, -5.5631332e-10,
+ -8.1446112e-8, -9.140500800000001e-8, -8.6951648e-8, -8.2795203e-8, -7.961575299999999e-8, -7.5512625e-8, -6.0512776e-8, -5.3113926e-8,
+ -5.1924925e-8, -4.3533669e-8, -2.1569411e-8, 9.781164100000001e-10, 1.3993484e-8, 1.6121335e-8, 9.9502597e-9, 2.8301122e-9,
+ -9.3071063e-10, -1.4828863e-9, -7.242862e-10, 6.7853969e-10, 1.7198254e-9, 1.833935e-9, 9.910411099999999e-10, 3.1189792e-11,
+ -4.7625005e-10, -5.2977179e-10, -3.0102006e-10, -6.6842961e-11, 3.2454035e-11, 3.7477749e-11, 2.1644673e-11, 5.9298973e-12,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.01136632, -0.016408158, -0.0349332, -0.02784739, 0.0096145776, 0.059932587, 0.089753479, 0.069975671,
+ -0.0064946134, -0.11385923, -0.19742994, -0.20142361, -0.10079378, 0.08221251, 0.28695123, 0.44351114,
+ 0.50044723, 0.44666598, 0.31676682, 0.17065633, 0.061771278, 0.012354413, 0.012717225, 0.037140244,
+ 0.05507189, 0.050498426, 0.025957566, -0.0030533473, -0.02111719, -0.024381244, -0.01407801, -0.0038307086,
+ 0.000057284264, 0.000064716373, 0.000035447225, 3.3642675e-7, -0.000018979267, -0.000021222982, -0.000012582227, -0.0000029191463,
+ 0.0000018740006, 0.0000024460463, 0.0000010713877, -3.2487878e-7, -7.6781933e-7, -5.6583195e-7, -2.5068165e-7, -1.2347619e-8,
+ 8.297339600000001e-8, 9.823114000000001e-8, 9.7588203e-8, 9.926988499999999e-8, 1.0070428e-7, 9.5071923e-8, 7.044354799999999e-8, 5.3494703e-8,
+ 4.7613879e-8, 3.8919429e-8, 1.8845507e-8, -1.4101785e-9, -1.3040795e-8, -1.4945684e-8, -9.300971000000001e-9, -2.9841161e-9,
+ 2.2386009e-10, 6.990386e-10, 2.9986977e-10, -6.7535232e-10, -1.4832646e-9, -1.5740818e-9, -8.4577404e-10, -7.8396292e-12,
+ 4.4323404e-10, 4.9265612e-10, 2.7983182e-10, 6.1820257e-11, -3.0829599e-11, -3.5601859e-11, -2.0561283e-11, -5.6330855e-12,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.015370512, 0.0038188528, 0.022815308, 0.027466485, 0.011338678, -0.016392314, -0.034877413, -0.027788336,
+ 0.009626457999999999, 0.059869085, 0.089638544, 0.06987961299999999, -0.0064874855, -0.11370564, -0.19717232, -0.20118491,
+ -0.10072609, 0.08200856400000001, 0.28649294, 0.44293937, 0.49997057, 0.44646556, 0.31690834, 0.17106178,
+ 0.062258998, 0.012728592, 0.012858441, 0.03704681, 0.054844697, 0.050274532, 0.025838622, -0.0030395781,
+ -0.021015878, -0.024267531, -0.014014183, -0.0038334853, 0.000012294908, 0.000013971577, 0.0000084331492, 0.0000021207154,
+ -0.0000010613403, -0.0000014692243, -5.674645600000001e-7, 3.6813259e-7, 6.6471952e-7, 5.0732461e-7, 2.3990309e-7, 3.2527713e-8,
+ -5.2940032e-8, -7.0272097e-8, -7.4243847e-8, -8.004311e-8, -8.432345e-8, -7.9953609e-8, -5.7174812e-8, -4.0198391e-8,
+ -3.3846855e-8, -2.7391787e-8, -1.3164822e-8, 9.3143613e-10, 8.8830013e-9, 1.0178346e-8, 6.3897086e-9, 2.2544123e-9,
+ 2.3155551e-10, -6.9016433e-11, 2.2668746e-11, 5.0194474e-10, 9.691114e-10, 1.0241351e-9, 5.4764968e-10, -5.1352834e-12,
+ -3.0704315e-10, -3.4111839e-10, -1.9371648e-10, -4.2664063e-11, 2.1615536e-11, 2.4961507e-11, 1.4416119e-11, 3.9495215e-12,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.0075782552, 0.00056335562, -0.012867845, -0.020711565, -0.015362833, 0.0038178887, 0.022803262, 0.027450127,
+ 0.01132947, -0.016385813, -0.034857713, -0.027768817, 0.009628209800000001, 0.059844065, 0.08959629, 0.069845594,
+ -0.0064833885, -0.11364823, -0.19707655, -0.20109459, -0.10069589, 0.08194085600000001, 0.28632947, 0.44272522,
+ 0.49977611, 0.44635552, 0.31691232, 0.17116302, 0.062405028, 0.012858212, 0.012929921, 0.037051865,
+ 0.054806207, 0.050228229, 0.025812903, -0.0030350316, -0.020990856, -0.02423998, -0.013999649, -0.0038354321,
+ 3.9449016e-7, 6.2546153e-7, 2.2880436e-7, -1.9648504e-7, -3.2799492e-7, -2.4605577e-7, -1.1018746e-7, -3.7855249e-9,
+ 4.0799542e-8, 4.9097347e-8, 4.6905093e-8, 4.6627152e-8, 4.7685199e-8, 4.451826e-8, 3.0728316e-8, 1.9838579e-8,
+ 1.5327733e-8, 1.1920072e-8, 5.4900593e-9, -8.1671795e-10, -4.4234746e-9, -5.0171323e-9, -3.160912e-9, -1.1972669e-9,
+ -2.7582833e-10, -1.3699591e-10, -1.0291296e-10, -2.4784306e-10, -4.2875658e-10, -4.5038598e-10, -2.3901171e-10, 9.433746099999999e-12,
+ 1.480739e-10, 1.6435722e-10, 9.329815700000001e-11, 2.0425522e-11, -1.0664812e-11, -1.2315669e-11, -7.1127172e-12, -1.9486403e-12,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0031794207, -0.0013173157, 0.0064003509, 0.010140285, 0.0075775394, 0.00056326184, -0.012866591, -0.020709553,
+ -0.015361329, 0.00381762, 0.022800959, 0.027447143, 0.011327957, -0.016384398, -0.034854051, -0.027765481,
+ 0.009627986, 0.059838762, 0.089587849, 0.069838924, -0.0064825988, -0.11363701, -0.19705759, -0.2010761,
+ -0.10068835, 0.081929799, 0.28629916, 0.44268271, 0.49973345, 0.44632462, 0.31689976, 0.17116777,
+ 0.062419762, 0.01287363, 0.012939169, 0.037052802, 0.054801411, 0.050222414, 0.025809986, -0.0030336964,
+ -0.020986623, -0.024235277, -0.013996668, -0.0038345525, 6.739720499999999e-8, 4.946956e-8, 2.0815264e-8, -1.3278463e-9,
+ -1.0398185e-8, -1.1792365e-8, -1.0980052e-8, -1.0573121e-8, -1.0506413e-8, -9.6865614e-9, -6.7673913e-9, -4.517767e-9,
+ -3.5747705e-9, -2.7739698e-9, -1.2696313e-9, 2.1657762e-10, 1.0751539e-9, 1.2157822e-9, 7.633168300000001e-10, 2.8106144e-10,
+ 5.1205725e-11, 1.6271833e-11, 1.5300631e-11, 5.7579735e-11, 1.0429514e-10, 1.0968885e-10, 5.8276177e-11, -2.045035e-12,
+ -3.5598539e-11, -3.951248e-11, -2.2429257e-11, -4.9097703e-12, 2.5651279e-12, 2.9621962e-12, 1.7107689e-12, 4.6869195e-13,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.0009898319599999999, -0.00005380164, -0.0016617464, -0.0024058437, -0.0031794045, -0.0013173095, 0.0064003186, 0.010140233,
+ 0.0075774991, 0.0005632576800000001, -0.012866521, -0.020709442, -0.015361246, 0.003817603, 0.022800833, 0.027446985,
+ 0.011327883, -0.016384315, -0.034853855, -0.027765311, 0.0096279578, 0.059838456, 0.089587375, 0.069838553,
+ -0.0064825573, -0.11363639, -0.19705653, -0.20107505, -0.10068788, 0.08192925500000001, 0.28629754, 0.44268034,
+ 0.49973095, 0.44632262, 0.31689865, 0.17116753, 0.062420092, 0.012874085, 0.012939407, 0.03705269,
+ 0.054801034, 0.050221973, 0.02580966, -0.0030338396, -0.020986632, -0.024235242, -0.013996676, -0.0038346105,
+ -2.2089352e-9, -9.1397999e-10, 4.1441104e-10, 1.5632064e-9, 2.1674468e-9, 2.2213076e-9, 1.6242991e-9, 1.220069e-9,
+ 1.1433859e-9, 1.0132949e-9, 5.303622e-10, 6.3673309e-11, -1.7092595e-10, -2.0591998e-10, -1.3238559e-10, -5.2482661e-11,
+ -1.557149e-11, -1.0780691e-11, -7.849213899999999e-12, -1.390567e-11, -2.2913106e-11, -2.4240643e-11, -1.3014573e-11, -9.3497669e-14,
+ 6.8837583e-12, 7.660260199999999e-12, 4.3533487e-12, 9.690445799999999e-13, -4.6444337e-13, -5.3633676e-13, -3.097527e-13, -8.486160400000001e-14,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.00021150513, -0.0001182675, -0.00018966171, 0.0007039766, 0.0009898316799999999, -0.000053801616, -0.0016617459, -0.002405843,
+ -0.0031794035, -0.0013173091, 0.0064003166, 0.01014023, 0.0075774968, 0.00056325744, -0.012866517, -0.020709435,
+ -0.015361241, 0.0038176018, 0.022800826, 0.027446977, 0.01132788, -0.01638431, -0.034853844, -0.027765303,
+ 0.0096279543, 0.059838438, 0.089587349, 0.06983853299999999, -0.0064825542, -0.11363636, -0.19705648, -0.20107499,
+ -0.10068785, 0.08192923000000001, 0.28629745, 0.44268021, 0.4997308, 0.44632248, 0.31689855, 0.17116749,
+ 0.062420089, 0.012874107, 0.01293944, 0.037052722, 0.054801064, 0.050222001, 0.025809687, -0.0030338132,
+ -0.020986608, -0.024235225, -0.013996666, -0.0038346066, -1.0807056e-9, -9.6194735e-10, -5.8042675e-10, -2.3026093e-10,
+ -5.2462083e-11, 8.934574699999999e-12, 2.8753664e-11, 4.2948201e-11, 5.7629255e-11, 6.1074334e-11, 3.9278999e-11, 2.0849977e-11,
+ 1.506808e-11, 1.3966739e-11, 7.822410799999999e-12, 2.9708823e-12, 1.5662219e-12, 1.4169493e-12, 5.9549711e-13, -6.4389303e-13,
+ -1.5821434e-12, -1.7440449e-12, -9.8694023e-13, -2.0617409e-13, 1.3336526e-13, 1.540095e-13, 8.8945717e-14, 2.4368072e-14,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.000029572086, 0.0001500013, -0.00012528062, -0.000085656495, 0.00021150513, -0.0001182675, -0.00018966171, 0.00070397658,
+ 0.00098983166, -0.000053801612, -0.0016617459, -0.0024058429, -0.0031794034, -0.0013173091, 0.0064003165, 0.01014023,
+ 0.0075774967, 0.00056325745, -0.012866517, -0.020709435, -0.015361241, 0.0038176017, 0.022800826, 0.027446976,
+ 0.01132788, -0.01638431, -0.034853844, -0.027765303, 0.0096279538, 0.059838437, 0.089587348, 0.06983853199999999,
+ -0.0064825542, -0.11363636, -0.19705647, -0.20107499, -0.10068785, 0.08192923000000001, 0.28629745, 0.4426802,
+ 0.49973079, 0.44632247, 0.31689854, 0.17116747, 0.062420078, 0.012874099, 0.012939434, 0.037052719,
+ 0.054801063, 0.050222001, 0.025809688, -0.0030338124, -0.020986608, -0.024235224, -0.013996665, -0.0038346058,
+ -1.7349485e-10, -1.4014027e-10, -6.733694999999999e-11, 2.3535906e-12, 3.9700971e-11, 4.5614905e-11, 2.9175877e-11, 1.2428934e-11,
+ 5.1956468e-12, 4.160356e-12, 2.590853e-12, 2.6563084e-12, 3.7861708e-12, 3.9536444e-12, 2.0858696e-12, -1.2971498e-13,
+ -1.3858912e-12, -1.5382753e-12, -8.7320447e-13, -1.911529e-13, 9.9847212e-14, 1.1530303e-13, 6.6591419e-14, 1.8243762e-14,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0000057370994, 0.000043510151, -0.0000074219963, -0.00011888246, 0.000029572086, 0.0001500013, -0.00012528062, -0.000085656494,
+ 0.00021150513, -0.0001182675, -0.0001896617, 0.00070397658, 0.00098983165, -0.000053801611, -0.0016617459, -0.0024058429,
+ -0.0031794034, -0.0013173091, 0.0064003165, 0.01014023, 0.0075774966, 0.00056325745, -0.012866517, -0.020709435,
+ -0.015361241, 0.0038176017, 0.022800826, 0.027446976, 0.01132788, -0.01638431, -0.034853844, -0.027765303,
+ 0.009627953700000001, 0.059838437, 0.089587347, 0.06983853199999999, -0.0064825542, -0.11363635, -0.19705647, -0.20107499,
+ -0.10068785, 0.08192923000000001, 0.28629744, 0.4426802, 0.49973078, 0.44632246, 0.31689853, 0.17116747,
+ 0.062420077, 0.012874099, 0.012939434, 0.037052719, 0.054801063, 0.050222001, 0.025809688, -0.003033812,
+ -0.020986607, -0.024235224, -0.013996665, -0.0038346056, 8.9844115e-13, 1.8039035e-12, 1.1116515e-12, -1.2672024e-13,
+ -9.559857e-13, -1.0248827e-12, -5.1382188e-13, 1.808146e-13, 6.3147038e-13, 6.9078155e-13, 3.8644389e-13, 6.3822893e-14,
+ -8.5035914e-14, -9.6170938e-14, -5.5045873e-14, -1.3511746e-14, 3.2585157e-15, 3.7629168e-15, 2.1732123e-15, 5.9538554e-16,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.000010027921, -0.000010930316, 0.000019234827, -0.000016474706, -0.0000057370994, 0.000043510151, -0.0000074219963, -0.00011888246,
+ 0.000029572086, 0.0001500013, -0.00012528062, -0.000085656494, 0.00021150513, -0.0001182675, -0.0001896617, 0.00070397658,
+ 0.00098983165, -0.000053801611, -0.0016617459, -0.0024058429, -0.0031794034, -0.0013173091, 0.0064003165, 0.01014023,
+ 0.0075774966, 0.00056325745, -0.012866517, -0.020709435, -0.015361241, 0.0038176017, 0.022800826, 0.027446976,
+ 0.01132788, -0.01638431, -0.034853844, -0.027765303, 0.009627953700000001, 0.059838436, 0.089587347, 0.06983853199999999,
+ -0.0064825542, -0.11363635, -0.19705647, -0.20107499, -0.10068785, 0.08192923000000001, 0.28629744, 0.4426802,
+ 0.49973078, 0.44632246, 0.31689853, 0.17116747, 0.062420077, 0.012874099, 0.012939434, 0.037052719,
+ 0.054801063, 0.050222001, 0.025809688, -0.003033812, -0.020986607, -0.024235224, -0.013996665, -0.0038346056,
+ -5.2802279e-13, -3.8437399e-13, -2.4041388e-13, -2.8463768e-13, -4.2600563e-13, -4.4368416e-13, -2.3294104e-13, 1.9132449e-14,
+ 1.637729e-13, 1.8161207e-13, 1.0304955e-13, 2.2420723e-14, -1.2069513e-14, -1.393781e-14, -8.0495588e-15, -2.2053027e-15,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0000030589933, -0.0000034582443, 0.0000041270616, 0.000012505734, -0.000010027921, -0.000010930316, 0.000019234827, -0.000016474706,
+ -0.0000057370994, 0.000043510151, -0.0000074219963, -0.00011888246, 0.000029572086, 0.0001500013, -0.00012528062, -0.000085656494,
+ 0.00021150513, -0.0001182675, -0.0001896617, 0.00070397658, 0.00098983165, -0.000053801611, -0.0016617459, -0.0024058429,
+ -0.0031794034, -0.0013173091, 0.0064003165, 0.01014023, 0.0075774966, 0.00056325745, -0.012866517, -0.020709435,
+ -0.015361241, 0.0038176017, 0.022800826, 0.027446976, 0.01132788, -0.01638431, -0.034853844, -0.027765303,
+ 0.009627953700000001, 0.059838436, 0.089587347, 0.06983853199999999, -0.0064825542, -0.11363635, -0.19705647, -0.20107499,
+ -0.10068785, 0.08192923000000001, 0.28629744, 0.4426802, 0.49973078, 0.44632246, 0.31689853, 0.17116747,
+ 0.062420077, 0.012874099, 0.012939434, 0.037052719, 0.054801063, 0.050222001, 0.025809688, -0.003033812,
+ -0.020986607, -0.024235224, -0.013996665, -0.0038346056, -6.2170478e-14, -6.383222999999999e-14, -3.2934372e-14, 5.0060707e-15,
+ 2.7669088e-14, 3.0656054e-14, 1.738787e-14, 3.7610419e-15, -2.0823764e-15, -2.4047173e-15, -1.388806e-15, -3.8048514e-16,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 3.6812554e-7, -0.0000013162529, 8.907414900000001e-7, 0.0000021605209, -0.0000030589933, -0.0000034582443, 0.0000041270616, 0.000012505734,
+ -0.000010027921, -0.000010930316, 0.000019234827, -0.000016474706, -0.0000057370994, 0.000043510151, -0.0000074219963, -0.00011888246,
+ 0.000029572086, 0.0001500013, -0.00012528062, -0.000085656494, 0.00021150513, -0.0001182675, -0.0001896617, 0.00070397658,
+ 0.00098983165, -0.000053801611, -0.0016617459, -0.0024058429, -0.0031794034, -0.0013173091, 0.0064003165, 0.01014023,
+ 0.0075774966, 0.00056325745, -0.012866517, -0.020709435, -0.015361241, 0.0038176017, 0.022800826, 0.027446976,
+ 0.01132788, -0.01638431, -0.034853844, -0.027765303, 0.009627953700000001, 0.059838436, 0.089587347, 0.06983853199999999,
+ -0.0064825542, -0.11363635, -0.19705647, -0.20107499, -0.10068785, 0.08192923000000001, 0.28629744, 0.4426802,
+ 0.49973078, 0.44632246, 0.31689853, 0.17116747, 0.062420077, 0.012874099, 0.012939434, 0.037052719,
+ 0.054801063, 0.050222001, 0.025809688, -0.003033812, -0.020986607, -0.024235224, -0.013996665, -0.0038346056,
+ 6.8070256e-15, 7.5939277e-15, 4.3204891e-15, 9.7727649e-16, -4.2864944e-16, -4.9500211e-16, -2.8588054e-16, -7.832144999999999e-17,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -1.3565721e-7, 3.3158394e-7, -1.1299252e-7, 6.2458675e-7, 3.6812554e-7, -0.0000013162529, 8.907414900000001e-7, 0.0000021605209,
+ -0.0000030589933, -0.0000034582443, 0.0000041270616, 0.000012505734, -0.000010027921, -0.000010930316, 0.000019234827, -0.000016474706,
+ -0.0000057370994, 0.000043510151, -0.0000074219963, -0.00011888246, 0.000029572086, 0.0001500013, -0.00012528062, -0.000085656494,
+ 0.00021150513, -0.0001182675, -0.0001896617, 0.00070397658, 0.00098983165, -0.000053801611, -0.0016617459, -0.0024058429,
+ -0.0031794034, -0.0013173091, 0.0064003165, 0.01014023, 0.0075774966, 0.00056325745, -0.012866517, -0.020709435,
+ -0.015361241, 0.0038176017, 0.022800826, 0.027446976, 0.01132788, -0.01638431, -0.034853844, -0.027765303,
+ 0.009627953700000001, 0.059838436, 0.089587347, 0.06983853199999999, -0.0064825542, -0.11363635, -0.19705647, -0.20107499,
+ -0.10068785, 0.08192923000000001, 0.28629744, 0.4426802, 0.49973078, 0.44632246, 0.31689853, 0.17116747,
+ 0.062420077, 0.012874099, 0.012939434, 0.037052719, 0.054801063, 0.050222001, 0.025809688, -0.003033812,
+ -0.020986607, -0.024235224, -0.013996665, -0.0038346056, 4.0075758e-16, 4.6279274e-16, 2.6727853e-16, 7.3225139e-17,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 9.2129029e-8, 4.470829e-8, -1.3675036e-7, -4.31831e-7, -1.3565721e-7, 3.3158394e-7, -1.1299252e-7, 6.2458675e-7,
+ 3.6812554e-7, -0.0000013162529, 8.907414900000001e-7, 0.0000021605209, -0.0000030589933, -0.0000034582443, 0.0000041270616, 0.000012505734,
+ -0.000010027921, -0.000010930316, 0.000019234827, -0.000016474706, -0.0000057370994, 0.000043510151, -0.0000074219963, -0.00011888246,
+ 0.000029572086, 0.0001500013, -0.00012528062, -0.000085656494, 0.00021150513, -0.0001182675, -0.0001896617, 0.00070397658,
+ 0.00098983165, -0.000053801611, -0.0016617459, -0.0024058429, -0.0031794034, -0.0013173091, 0.0064003165, 0.01014023,
+ 0.0075774966, 0.00056325745, -0.012866517, -0.020709435, -0.015361241, 0.0038176017, 0.022800826, 0.027446976,
+ 0.01132788, -0.01638431, -0.034853844, -0.027765303, 0.009627953700000001, 0.059838436, 0.089587347, 0.06983853199999999,
+ -0.0064825542, -0.11363635, -0.19705647, -0.20107499, -0.10068785, 0.08192923000000001, 0.28629744, 0.4426802,
+ 0.49973078, 0.44632246, 0.31689853, 0.17116747, 0.062420077, 0.012874099, 0.012939434, 0.037052719,
+ 0.054801063, 0.050222001, 0.025809688, -0.003033812, -0.020986607, -0.024235224, -0.013996665, -0.0038346056,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.0, 0.0, 0.0, 0.0, -8.764059600000001e-9, -6.963307e-9, 1.5066994e-8, 3.6978382e-8,
+ 9.2186128e-8, 4.4735999e-8, -1.3683511e-7, -4.3209863e-7, -1.3574128e-7, 3.3178945e-7, -1.1306255e-7, 6.2497386e-7,
+ 3.683537e-7, -0.0000013170687, 8.9129355e-7, 0.00000216186, -0.0000030608892, -0.0000034603877, 0.0000041296194, 0.000012513485,
+ -0.000010034136, -0.00001093709, 0.000019246748, -0.000016484916, -0.0000057406551, 0.000043537117, -0.0000074265962, -0.00011895614,
+ 0.000029590414, 0.00015009426, -0.00012535827, -0.00008570958199999999, 0.00021163621, -0.0001183408, -0.00018977925, 0.00070441288,
+ 0.0009904451199999999, -0.000053834956, -0.0016627758, -0.002407334, -0.0031813739, -0.0013181255, 0.0064042832, 0.010146514,
+ 0.0075821929, 0.00056360654, -0.012874492, -0.02072227, -0.015370762, 0.0038199677, 0.022814957, 0.027463987,
+ 0.0113349, -0.016394464, -0.034875445, -0.027782511, 0.009633920799999999, 0.059875523, 0.089642871, 0.069881816,
+ -0.0064865719, -0.11370678, -0.1971786, -0.20119961, -0.10075025, 0.08198000699999999, 0.28647488, 0.44295456,
+ 0.5000405, 0.44659908, 0.31709494, 0.17127356, 0.062458763, 0.012882078, 0.012947454, 0.037075684,
+ 0.054835027, 0.050253127, 0.025825684, -0.0030356923, },
+ { 0.0, 0.0, 0.0, 0.0, 2.3914563e-11, 1.9000834e-11, -4.1113434e-11, -1.0090322e-10,
+ -9.0429743e-9, -7.1071213e-9, 1.5487424e-8, 3.8272917e-8, 9.284437599999999e-8, 4.3970329e-8, -1.3695386e-7, -4.3515323e-7,
+ -1.3717026e-7, 3.3641935e-7, -1.1584767e-7, 6.2102624e-7, 3.7785615e-7, -0.0000013117388, 8.8280807e-7, 0.0000021344647,
+ -0.0000030430666, -0.0000034413485, 0.0000040899953, 0.000012597541, -0.000010049803, -0.000011090041, 0.00001932711, -0.000016211794,
+ -0.0000058393238, 0.000043263497, -0.0000071077195, -0.0001190937, 0.000029105316, 0.00015088585, -0.00012523184, -0.00008789934600000001,
+ 0.00020959441, -0.00011856341, -0.0001858346, 0.00071318131, 0.0010022188, -0.000050406274, -0.0016854432, -0.0024425377,
+ -0.0032119973, -0.0013237792, 0.0064594112, 0.010234742, 0.0076478105, 0.00055494281, -0.012976947, -0.020861916,
+ -0.015449686, 0.0038766312, 0.022981361, 0.027625553, 0.011344005, -0.016609039, -0.035228952, -0.028059949,
+ 0.0096817025, 0.060372756, 0.090460822, 0.070649035, -0.006231908, -0.11428553, -0.19857599, -0.20303655,
+ -0.10242931, 0.08101735, 0.28650414, 0.44387032, 0.50143144, 0.44795843, 0.31804973, 0.17170719,
+ 0.062504161, 0.012785176, 0.012917411, 0.037199735, },
+ { 0.0, 0.0, 0.0, 0.0, 1.7208769e-11, 1.3672881e-11, -2.9584969e-11, -7.260932400000001e-11,
+ -1.9502299e-10, -9.8973137e-11, 2.9276962e-10, 9.0756433e-10, -8.4024356e-9, -7.5848188e-9, 1.5160135e-8, 3.5281047e-8,
+ 9.1795739e-8, 4.8119378e-8, -1.3958217e-7, -4.3792198e-7, -1.299519e-7, 3.3845784e-7, -1.2042094e-7, 6.0758667e-7,
+ 3.8536054e-7, -0.000001308981, 8.6541935e-7, 0.0000022271281, -0.0000030839153, -0.0000035840001, 0.0000041996021, 0.000012795353,
+ -0.000010161269, -0.000011227452, 0.000019595831, -0.000016605111, -0.0000061431566, 0.000044269118, -0.0000072986449, -0.00012118588,
+ 0.000028160432, 0.0001509061, -0.00012314444, -0.000080367843, 0.00022072872, -0.00011654453, -0.00020614453, 0.00068484311,
+ 0.00097637937, -0.000057369856, -0.0016371767, -0.0023647844, -0.0031580486, -0.0013325879, 0.0063771053, 0.010119985,
+ 0.0075805926, 0.00060526641, -0.012846336, -0.020747422, -0.015463245, 0.0036989769, 0.022719278, 0.027446179,
+ 0.01143065, -0.016173272, -0.034553004, -0.027441455, 0.009878847, 0.059889938, 0.089299875, 0.06910726,
+ -0.0076681795, -0.11513091, -0.19851945, -0.20202798, -0.10067452, 0.08315763499999999, 0.28866517, 0.44579776,
+ 0.5030154, 0.44918495, 0.31895639, 0.17236043, },
+ { 0.0, 0.0, 0.0, 0.0, 3.6851694e-10, 2.9279771e-10, -6.335468899999999e-10, -1.5548913e-9,
+ -4.6510001e-9, -2.4966087e-9, 7.0855764e-9, 2.1437864e-8, 1.3169401e-8, -1.0542802e-8, -6.1601155e-9, -6.1575439e-8,
+ -3.4073418e-8, 7.724169599999999e-8, -3.4452297e-8, -1.1253081e-8, 2.9592187e-7, 1.2560497e-7, -3.1939331e-7, -9.671230100000001e-7,
+ -3.3711275e-8, 5.7369354e-7, -5.5258612e-7, 0.0000029538269, -3.0498174e-7, -0.0000051446274, 0.0000037421504, 0.000007933204999999999,
+ -0.0000073627242, -0.0000087743051, 0.000012632452, 0.000011519312, -0.000022548551, 0.0000044186995, 0.000026652061, -0.00007250452599999999,
+ -0.000029667452, 0.000072190638, 0.000031608516, -0.000030718401, 0.00028455347, 0.00027795666, -0.00062873194, -0.00071930588,
+ -0.00018882003, -0.00033095544, 0.00067798053, 0.0026897514, 0.0026281934, -0.00029899771, -0.0042160247, -0.0059853387,
+ -0.0062551191, -0.0010063188, 0.012567797, 0.017963467, 0.011342289, -0.0027790647, -0.025355323, -0.035902046,
+ -0.022213305, 0.014809325, 0.049440119, 0.055745988, 0.022283613, -0.034643741, -0.077415581, -0.07472068,
+ -0.015256075, 0.073924579, 0.13781927, 0.12632161, 0.023452078, -0.13385396, -0.26083401, -0.26880791,
+ -0.11637654, 0.16325051, 0.4764406, 0.7149867, },
+ { -0.8535439, -0.35968119, 0.065351407, 0.059333029, -0.1269521, -0.076877898, -0.10933188, 0.15495355,
+ 0.054522357, -0.23877106, -0.00046647111, 0.089122653, -0.026462813, 0.048335133, -0.0079782051, -0.016659518,
+ 0.047159549, -0.037963054, -0.011292312, 0.027672996, -0.018929343, 0.0034709715, 0.0029394227, -0.0041317473,
+ 0.0053664905, -0.0034050512, -0.0026283962, 0.001701639, -1.4621633e-18, -7.386584000000001e-18, -8.5187602e-19, 8.977116299999999e-18,
+ 1.7897277e-18, -9.0759985e-18, 1.7650852e-18, 1.3050953e-18, -1.1888393e-18, 3.6267152e-18, -1.5965868e-18, -2.9834012e-19,
+ 2.6322817e-18, -2.3718141e-18, 6.9968316e-19, 2.1831511e-18, -1.8853562e-18, 1.9795454e-19, 2.0018813e-19, -4.9845616e-19,
+ 7.4533925e-19, -3.7752172e-19, -3.6230857e-19, 3.6040853e-19, -6.196548599999999e-20, -1.1505867e-19, 9.5248123e-20, 3.1535333e-20,
+ -7.2976602e-20, 3.3552326e-20, -3.6298577e-20, -2.6232003e-20, 3.7424549e-20, -4.9240473e-20, -5.6073546e-21, 3.8346556e-20,
+ -2.6796095e-20, 2.3158911e-21, 4.7582374e-21, -2.8967253e-21, 6.5855823e-21, -9.9663562e-21, -5.6020698e-21, 4.1833883e-21,
+ 1.0439859e-21, 1.7132787e-22, -5.812353400000001e-23, 3.0334018e-22, 2.9773051e-22, -3.5694498e-22, -2.5609715e-22, 1.0779825e-22,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.0097491326, 0.49799784, 0.49667555, -0.028559998, -0.42222797, -0.18514687, 0.2500187, 0.31609299,
+ -0.068894788, -0.23630869, 0.051357429, 0.18649924, -0.0027572124, -0.13295343, -0.066275158, 0.0590209,
+ 0.064667315, -0.024369346, -0.018853311, 0.022018745, -0.00008582693, -0.012650973, -0.008405076799999999, 0.0012936423,
+ 0.0016217257, -0.0010289889, -0.00079428773, 0.0005142265, 3.837204e-18, -5.1417775e-18, 1.6180876e-18, 1.3329307e-18,
+ -3.4207218e-18, 4.2353711e-18, 1.1016565e-18, -6.9071994e-18, 4.800252e-18, 4.6916197e-18, -3.6758436e-18, -2.1583284e-18,
+ 7.2104057e-19, 2.2650924e-19, 1.4887113e-18, -9.0359689e-19, -1.9341924e-18, 2.0497686e-18, 3.4265221e-19, -1.0853157e-18,
+ 6.8534707e-19, -3.3981292e-19, -5.8153225e-21, 3.4694372e-19, -3.6884567e-19, 2.325747e-19, 1.1847485e-19, -1.9271002e-19,
+ 1.0387854e-19, -4.2515241e-21, -4.4545004e-20, 4.429267e-21, -4.2326837e-21, 4.0949538e-21, 1.7076984e-20, -3.7107451e-21,
+ -1.6750204e-20, 9.3038469e-21, 3.4943875e-21, -4.5159418e-21, 4.0634963e-21, -2.835022e-21, 1.4147726e-22, 2.8528805e-21,
+ -2.5032938e-21, -4.1947499e-22, -1.4819835e-22, -4.270146e-22, 8.2949421e-22, -3.9522162e-22, -3.2534223e-22, 2.5448899e-22,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.043868099, -0.11359779, -0.23884371, -0.31126971, -0.03080143, 0.38884179, 0.3428215, -0.14827109,
+ -0.46703243, -0.19177262, 0.29481908, 0.27261094, -0.11727332, -0.20703374, 0.041159567, 0.17723309,
+ 0.019225426, -0.14351258, -0.060622382, 0.07083052099999999, 0.054619012, -0.014728714, -0.017162395, 0.0148445,
+ 0.0059330378, -0.014589274, -0.009891233100000001, 0.0026891131, -1.4871029e-17, 4.5609802e-18, -6.5993686e-18, -2.0104526e-17,
+ 8.4690133e-18, -4.8460668e-18, -3.5542414e-18, -2.7023903e-18, 1.2011757e-18, 2.8554601e-18, -1.4641397e-19, -5.2258014e-18,
+ 2.1733685e-18, 3.3779312e-18, -1.3649109e-19, -2.1880083e-18, -1.5772341e-19, 1.5069148e-18, 1.3492288e-18, -8.802379500000001e-19,
+ -1.0697808e-18, 6.9070831e-19, 2.3374065e-19, -1.1077769e-19, 1.3077631e-19, -2.8574171e-19, 1.415901e-19, 1.7828577e-19,
+ -1.5396053e-19, 7.5893357e-20, -4.3050603e-20, -8.3679005e-20, 1.3347946e-19, -5.4974401e-20, -1.7493216e-21, 3.3365805e-20,
+ -5.8985959e-20, 1.9211594e-20, 8.331346600000001e-21, -1.0148857e-20, 6.4122352e-21, -1.8011728e-20, -2.2948955e-21, 1.1046082e-20,
+ -6.5384535e-21, -1.9688739e-21, -1.1027418e-21, -7.3109031e-22, 3.475493e-21, -1.7477936e-21, -1.424523e-21, 1.075262e-21,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.11350485, 0.078457191, 0.23123985, 0.16377816, -0.0053257425, -0.11081688, -0.17690723, -0.1882482,
+ 0.024386161, 0.35978077, 0.34619534, -0.13380312, -0.47092927, -0.18321328, 0.29495422, 0.27700897,
+ -0.1107013, -0.2220893, 0.041645458, 0.187296, 0.010609985, -0.14990385, -0.063127034, 0.071396236,
+ 0.059312169, -0.014899249, -0.018035052, 0.015904326, 0.0060997472, -0.01511777, -0.01047208, 0.0025348521,
+ 0.000094772741, 0.00018699728, -0.00009023797399999999, -0.00018613552, 0.000039646997, 0.00012704541, 0.000021476997, -0.00007741941,
+ -0.000031298152, 0.000067956454, 0.000037690455, -0.000029151857, -0.000015545855, 0.000014856125, 0.000015237388, -0.0000027604675,
+ -0.0000057556044, -1.3476965e-8, 0.0000028285011, 9.4403854e-7, -2.2498423e-7, -0.0000015897131, -6.5328073e-7, 6.4520141e-7,
+ 5.13012e-7, -5.7050618e-7, -4.7024882e-7, 1.9002285e-7, 1.6475241e-7, -7.181441e-8, -8.440031899999999e-8, 2.4316993e-8,
+ 5.7585708e-9, 1.4360563e-8, 5.5108486e-9, -4.6057052e-9, -5.3604255e-9, 5.1973797e-9, 4.9569464e-9, -1.6041796e-9,
+ -1.868336e-9, 7.621408200000001e-10, 5.8431354e-10, -4.9659479e-10, 2.442538e-10, -1.5448383e-10, -1.1904637e-10, 7.7304831e-11,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.018943425, -0.00023134148, -0.051032993, -0.14158766, -0.1219561, 0.060207541, 0.20496175, 0.1352868,
+ -0.028897426, -0.12425083, -0.17929974, -0.18396477, 0.0280128, 0.35786456, 0.34036011, -0.13789513,
+ -0.4700605, -0.17977395, 0.29670633, 0.27653234, -0.1105855, -0.21980639, 0.044009223, 0.18725153,
+ 0.008622334299999999, -0.15146531, -0.063196745, 0.07186579, 0.059376049, -0.014785703, -0.017430318, 0.016309961,
+ 0.0058585315, -0.015503177, -0.010351797, 0.0028796789, 0.000030161127, -0.00010871535, -0.000054762367, 0.000049991893,
+ 0.000030931583, -0.000034949267, -0.000026658113, 0.000012548204, 0.0000085226258, -0.0000033484801, -0.000006354489, -6.016628e-7,
+ 0.0000018156312, 0.0000016799919, -2.9269113e-7, -0.0000011148862, -3.2141225e-7, 0.0000011159281, 6.2161289e-7, -4.3728317e-7,
+ -3.2357674e-7, 2.9479843e-7, 2.5855335e-7, -9.861939099999999e-8, -7.7174471e-8, 2.357143e-8, 3.4866513e-8, -7.2848793e-9,
+ 4.1725233e-10, -1.0232913e-8, -5.1858942e-9, 3.493822e-9, 3.2966092e-9, -2.9205056e-9, -2.772405e-9, 9.5707304e-10,
+ 9.349160000000001e-10, -3.607995e-10, -2.7638764e-10, 2.4385053e-10, -1.3420421e-10, 8.4880481e-11, 6.5409521e-11, -4.2474809e-11,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.042099341, 0.0049466918, 0.060032676, 0.053056167, 0.019616496, 0.0062036013, -0.038995874, -0.12624839,
+ -0.10751575, 0.069583591, 0.20780096, 0.13338201, -0.032366324, -0.12649959, -0.17867505, -0.18073608,
+ 0.031238128, 0.35847857, 0.33866999, -0.13958546, -0.47087746, -0.18085881, 0.29523238, 0.27623237,
+ -0.10915239, -0.21827969, 0.044204705, 0.18674789, 0.008460475699999999, -0.15160207, -0.063812811, 0.071407823,
+ 0.059707723, -0.014212698, -0.017418974, 0.015975258, 0.0058538568, -0.015264018, -0.01033238, 0.0027038771,
+ -0.0000012051987, 0.000010834885, 0.0000041549531, -0.0000052634061, -0.0000023429131, 0.0000034400397, 0.0000028289785, -9.1863911e-7,
+ -0.0000012270482, 4.0351997e-7, 7.5101858e-7, 4.7474055e-9, -1.4510685e-7, -1.8989353e-7, -3.8281943e-8, 8.072763899999999e-8,
+ 7.066967400000001e-8, -9.4210763e-8, -7.3956251e-8, 3.115984e-8, 2.9133811e-8, -1.5014384e-8, -1.606001e-8, 5.2321014e-9,
+ 1.7924899e-9, 1.7024681e-9, 3.7814988e-10, -4.778233e-10, -7.9390088e-10, 8.1430637e-10, 7.7594964e-10, -2.4383214e-10,
+ -3.0886716e-10, 1.3001907e-10, 9.9726822e-11, -8.3004062e-11, 3.8036166e-11, -2.4056832e-11, -1.8538371e-11, 1.2038213e-11,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0051186317, 0.0026082139, 0.0011561029, -0.027835056, -0.043654175, 0.0024567809, 0.056866436, 0.049722261,
+ 0.016705706, 0.0041957359, -0.039911418, -0.12626296, -0.10711407, 0.069886621, 0.207737, 0.13299916,
+ -0.032807178, -0.12670819, -0.17850805, -0.18026528, 0.03173076, 0.3587233, 0.33861929, -0.13974791,
+ -0.47100956, -0.18098662, 0.29508412, 0.27616175, -0.10905287, -0.21808239, 0.04432355, 0.18671439,
+ 0.008368981899999999, -0.15163858, -0.063790702, 0.071424185, 0.059696165, -0.014211805, -0.017387543, 0.016000355,
+ 0.0058451304, -0.015287092, -0.010335228, 0.0027174845, 0.0000020768948, -5.7483511e-7, -0.0000013986923, -2.0846925e-7,
+ 3.3989431e-7, 4.6234671e-7, 1.5124727e-8, -2.6644477e-7, -1.0785895e-7, 2.5703709e-7, 1.5722009e-7, -9.7984161e-8,
+ -7.3898702e-8, 6.035174000000001e-8, 5.4781732e-8, -2.0282833e-8, -1.4592424e-8, 3.0544033e-9, 5.8925631e-9, -9.0937458e-10,
+ 5.4095235e-10, -2.3396208e-9, -1.3722115e-9, 7.9084999e-10, 7.5764257e-10, -6.0261359e-10, -5.6187916e-10, 2.161657e-10,
+ 1.5585732e-10, -5.5402911e-11, -4.2385399e-11, 3.9580331e-11, -2.5135395e-11, 1.5897448e-11, 1.225069e-11, -7.9551986e-12,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0071084674, -0.0033836798, 0.012325746, 0.008056183999999999, -0.0058137499, 0.0029806292, 0.0026693637, -0.025573967,
+ -0.041351054, 0.0041008264, 0.057495506, 0.049458219, 0.016024743, 0.0036418724, -0.039989343, -0.12584118,
+ -0.10648721, 0.07032519399999999, 0.20775682, 0.13264239, -0.033314247, -0.12711621, -0.17863318, -0.18010455,
+ 0.032003531, 0.35891666, 0.33867579, -0.13976955, -0.47107608, -0.18111434, 0.29494862, 0.2761335,
+ -0.10895874, -0.21798696, 0.044327136, 0.18667373, 0.0083638593, -0.15162138, -0.063800826, 0.071398434,
+ 0.059697546, -0.0141866, -0.017375994, 0.015991099, 0.005839154, -0.015281732, -0.010330736, 0.0027152827,
+ 6.7571268e-8, 1.0574211e-7, 1.1225055e-8, -5.6939946e-8, -2.7184582e-8, 5.4989418e-8, 3.5491693e-8, -2.0532338e-8,
+ -1.5851011e-8, 1.199146e-8, 1.1153341e-8, -4.0527661e-9, -2.70396e-9, 3.3976271e-10, 9.757715999999999e-10, -9.7092189e-11,
+ 1.7708423e-10, -4.9642505e-10, -3.1843656e-10, 1.6615e-10, 1.6237103e-10, -1.1900391e-10, -1.092032e-10, 4.5808636e-11,
+ 2.4606003e-11, -7.796026e-12, -5.9521785e-12, 6.0340975e-12, -4.5217706e-12, 2.8598959e-12, 2.2038568e-12, -1.4311127e-12,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.001265786, -0.0016609477, 0.00222941, 0.0011762007, -0.0073250731, -0.0034332159, 0.012471328, 0.0083430294,
+ -0.0054961577, 0.003215434, 0.0027593588, -0.025616888, -0.041455975, 0.0040184504, 0.057488632, 0.049527597,
+ 0.016124517, 0.0037132221, -0.039983743, -0.12589765, -0.1065697, 0.070258873, 0.20773562, 0.13266656,
+ -0.033268011, -0.12707599, -0.17861669, -0.18011328, 0.031979675, 0.35889134, 0.33866157, -0.13976776,
+ -0.4710648, -0.18110469, 0.29495129, 0.27613251, -0.10895966, -0.21798881, 0.044323721, 0.18667181,
+ 0.0083658499, -0.15161776, -0.06379945300000001, 0.071397486, 0.059696885, -0.014186055, -0.017375485, 0.015990851,
+ 0.005838785, -0.015281695, -0.010330521, 0.0027153303, -1.3725082e-9, 2.288355e-8, 1.1355676e-8, -8.889336600000001e-9,
+ -7.3277766e-9, 7.1743165e-9, 6.1308246e-9, -2.3901982e-9, -1.9373079e-9, 6.9554647e-10, 9.1814463e-10, -2.40284e-10,
+ -1.9481616e-11, -2.0716003e-10, -1.0771373e-10, 6.454408900000001e-11, 7.9297993e-11, -6.596152699999999e-11, -6.131494e-11, 2.3139144e-11,
+ 1.8220157e-11, -6.889387e-12, -5.2758971e-12, 4.7202158e-12, -2.698161e-12, 1.706513e-12, 1.3150514e-12, -8.5395143e-13,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.000050159503, -0.00071212184, 0.00028363207, 0.0014615066, -0.0013267837, -0.0016433511, 0.0023330548, 0.0013382911,
+ -0.0071554962, -0.0033071427, 0.012526538, 0.0083335545, -0.0055376737, 0.0031805864, 0.0027555735, -0.025588465,
+ -0.041414908, 0.0040466304, 0.057487914, 0.049499743, 0.016086099, 0.0036837639, -0.0399912, -0.12588418,
+ -0.10654688, 0.070278005, 0.20774306, 0.13266193, -0.033279293, -0.1270871, -0.17862262, -0.18011286,
+ 0.031983838, 0.35889559, 0.33866366, -0.13976788, -0.47106632, -0.18110697, 0.29494939, 0.27613212,
+ -0.10895856, -0.21798754, 0.04432405, 0.1866715, 0.008365786, -0.15161747, -0.063799301, 0.07139735799999999,
+ 0.05969678, -0.014185963, -0.017375356, 0.015990858, 0.0058387245, -0.015281726, -0.010330507, 0.0027153486,
+ -7.4751925e-10, 1.1363937e-9, 8.6711229e-10, -3.7268833e-10, -3.6811377e-10, 2.0482729e-10, 2.0980924e-10, -7.258209800000001e-11,
+ -2.7266282e-11, -1.5979419e-11, -9.5719216e-13, 3.8460406e-12, 8.9396574e-12, -9.508538499999999e-12, -9.0540185e-12, 2.7940998e-12,
+ 3.7212707e-12, -1.5943743e-12, -1.2232114e-12, 1.0063401e-12, -4.4202812e-13, 2.7957097e-13, 2.154394e-13, -1.3989921e-13,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.00011533996, -0.000026734332, -0.00013506823, 0.00037552805, 0.000056473736, -0.00069611, 0.00030822484, 0.0014903898,
+ -0.001299667, -0.001623524, 0.0023429619, 0.0013395122, -0.0071588879, -0.0033105472, 0.012526018, 0.008336244899999999,
+ -0.0055337618, 0.0031829767, 0.0027548042, -0.025592198, -0.041419704, 0.0040431007, 0.057487257, 0.049501718,
+ 0.016089174, 0.0036863006, -0.039990188, -0.12588473, -0.10654831, 0.070276592, 0.2077423, 0.13266197,
+ -0.033278735, -0.12708649, -0.17862233, -0.18011298, 0.031983453, 0.35889516, 0.33866339, -0.13976791,
+ -0.47106621, -0.18110686, 0.29494942, 0.27613211, -0.10895856, -0.21798752, 0.044324057, 0.1866715,
+ 0.008365790600000001, -0.15161745, -0.063799281, 0.07139736200000001, 0.059696773, -0.014185967, -0.017375353, 0.015990861,
+ 0.0058387231, -0.01528173, -0.010330508, 0.0027153498, 1.2421473e-10, -1.6472405e-11, -4.5499511e-11, 4.6952921e-12,
+ -7.622754700000001e-12, 2.2440782e-11, 1.4394938e-11, -7.4419077e-12, -7.478396099999999e-12, 5.4641676e-12, 5.0064067e-12, -2.1114128e-12,
+ -1.1146915e-12, 3.5181885e-13, 2.6859057e-13, -2.7304861e-13, 2.0563143e-13, -1.3005576e-13, -1.0022199e-13, 6.5081053e-14,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.000048301379, 0.000081244009, -0.00010202271, -0.0000527072, 0.00012665087, -0.000023161991, -0.00014073862, 0.00036301218,
+ 0.000042236451, -0.00070675058, 0.00030414781, 0.0014924293, -0.0012947379, -0.0016196213, 0.002343374, 0.0013363966,
+ -0.0071634301, -0.0033138343, 0.01252572, 0.0083387958, -0.0055300282, 0.0031859358, 0.0027557003, -0.02559331,
+ -0.041421766, 0.0040413078, 0.057486526, 0.049502138, 0.016090249, 0.0036873704, -0.039989605, -0.12588475,
+ -0.1065487, 0.070276145, 0.20774205, 0.13266197, -0.033278579, -0.12708632, -0.17862224, -0.180113,
+ 0.031983382, 0.35889508, 0.33866334, -0.13976793, -0.4710662, -0.18110685, 0.29494942, 0.27613211,
+ -0.10895856, -0.21798752, 0.044324053, 0.18667149, 0.0083657926, -0.15161745, -0.06379928, 0.07139736000000001,
+ 0.059696773, -0.014185965, -0.017375352, 0.01599086, 0.0058387226, -0.015281729, -0.010330508, 0.0027153497,
+ 8.4895945e-13, 8.9873902e-12, 4.4939672e-12, -2.8829398e-12, -3.2827318e-12, 2.8288238e-12, 2.6521985e-12, -9.600575e-13,
+ -8.4408406e-13, 3.2522644e-13, 2.4913156e-13, -2.2004175e-13, 1.2146722e-13, -7.6823174e-14, -5.920069e-14, 3.8443518e-14,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.00001049566, 0.000014942095, -0.00001798232, -0.000063966374, 0.000050491712, 0.000079338435, -0.00010824893, -0.000061723045,
+ 0.00011751212, -0.000029813667, -0.00014355097, 0.00036364052, 0.000044544686, -0.00070482097, 0.00030440767, 0.0014909545,
+ -0.0012969238, -0.0016211718, 0.0023433177, 0.0013377839, -0.0071614371, -0.0033122572, 0.012526182, 0.008338179500000001,
+ -0.0055311464, 0.0031849683, 0.0027553009, -0.0255931, -0.041421213, 0.0040418568, 0.057486821, 0.049502123,
+ 0.01609004, 0.0036871372, -0.03998973, -0.12588473, -0.1065486, 0.070276251, 0.2077421, 0.13266198,
+ -0.033278611, -0.12708636, -0.17862227, -0.180113, 0.031983384, 0.35889509, 0.33866334, -0.13976793,
+ -0.4710662, -0.18110685, 0.29494942, 0.27613211, -0.10895856, -0.21798752, 0.044324053, 0.18667149,
+ 0.0083657929, -0.15161745, -0.06379928, 0.07139736000000001, 0.059696773, -0.014185965, -0.017375352, 0.01599086,
+ 0.0058387225, -0.015281729, -0.010330508, 0.0027153497, -2.141137e-13, 1.8621291e-13, 1.7348502e-13, -6.3446602e-14,
+ -5.5329986e-14, 2.1752068e-14, 1.6668418e-14, -1.452183e-14, 7.7079643e-15, -4.8735409e-15, -3.7557779e-15, 2.4394086e-15,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0000016862516, 0.0000019060019, -4.248487e-7, -0.0000047292013, 0.000010654859, 0.000014866629, -0.000018311699, -0.000064466384,
+ 0.000049972355, 0.000078950867, -0.00010842286, -0.0000617001, 0.0001176368, -0.000029701701, -0.00014352575, 0.00036357185,
+ 0.000044435351, -0.00070489915, 0.00030440706, 0.0014910288, -0.0012968196, -0.0016210916, 0.0023433373, 0.0013377465,
+ -0.0071614998, -0.0033123101, 0.012526161, 0.0083381915, -0.0055311158, 0.0031849984, 0.0027553172, -0.025593101,
+ -0.041421224, 0.0040418445, 0.057486815, 0.049502125, 0.016090047, 0.003687144, -0.039989727, -0.12588473,
+ -0.1065486, 0.070276249, 0.2077421, 0.13266197, -0.033278611, -0.12708636, -0.17862227, -0.180113,
+ 0.031983384, 0.35889509, 0.33866334, -0.13976793, -0.4710662, -0.18110685, 0.29494942, 0.27613211,
+ -0.10895856, -0.21798752, 0.044324054, 0.18667149, 0.0083657929, -0.15161745, -0.06379928, 0.07139736000000001,
+ 0.059696773, -0.014185965, -0.017375352, 0.01599086, 0.0058387225, -0.015281729, -0.010330508, 0.0027153497,
+ -9.093892299999999e-16, 1.5923447e-15, 1.2350047e-15, -5.1775324e-16, -5.9423787e-16, 3.7692653e-16, 2.903267e-16, -1.8815403e-16,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 8.5507366e-8, -0.0000012851265, 7.857136300000001e-7, -3.4801813e-7, -0.0000018684855, 0.0000017467446, -5.336318e-7, -0.0000047832847,
+ 0.000010639476, 0.00001486632, -0.000018315371, -0.000064480605, 0.000049952572, 0.000078935834, -0.0001084256, -0.000061690695,
+ 0.00011765129, -0.000029690251, -0.00014352319, 0.00036356698, 0.000044428438, -0.00070490357, 0.00030440683, 0.0014910323,
+ -0.0012968146, -0.0016210877, 0.0023433385, 0.0013377449, -0.0071615031, -0.0033123133, 0.012526159, 0.008338191300000001,
+ -0.0055311149, 0.0031849995, 0.0027553178, -0.025593101, -0.041421224, 0.0040418441, 0.057486815, 0.049502125,
+ 0.016090047, 0.0036871443, -0.039989726, -0.12588473, -0.1065486, 0.070276249, 0.2077421, 0.13266197,
+ -0.033278611, -0.12708636, -0.17862227, -0.180113, 0.031983384, 0.35889509, 0.33866334, -0.13976793,
+ -0.4710662, -0.18110685, 0.29494942, 0.27613211, -0.10895856, -0.21798752, 0.044324054, 0.18667149,
+ 0.0083657929, -0.15161745, -0.06379928, 0.07139736000000001, 0.059696773, -0.014185965, -0.017375352, 0.01599086,
+ 0.0058387225, -0.015281729, -0.010330508, 0.0027153497, -2.284982e-15, 1.4420459e-15, 1.1116432e-15, -7.2294759e-16,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -2.565031e-7, -1.0384266e-7, 3.7843906e-7, 0.0000012258276, 6.8475377e-8, -0.0000012217701, 9.2978511e-7, -1.5535891e-7,
+ -0.0000016795333, 0.0000018820924, -4.7671008e-7, -0.0000047953669, 0.000010593913, 0.000014828085, -0.000018320832, -0.000064451905,
+ 0.000049995467, 0.000078966429, -0.0001084242, -0.000061717862, 0.00011761178, -0.000029721923, -0.00014353291, 0.00036357866,
+ 0.000044450187, -0.00070488461, 0.00030441474, 0.0014910283, -0.0012968253, -0.0016210983, 0.0023433329, 0.0013377452,
+ -0.007161499, -0.0033123087, 0.012526161, 0.0083381911, -0.0055311167, 0.0031849975, 0.0027553167, -0.025593101,
+ -0.041421223, 0.0040418448, 0.057486815, 0.049502125, 0.016090047, 0.0036871442, -0.039989726, -0.12588473,
+ -0.1065486, 0.070276249, 0.2077421, 0.13266197, -0.033278611, -0.12708636, -0.17862227, -0.180113,
+ 0.031983384, 0.35889509, 0.33866334, -0.13976793, -0.4710662, -0.18110685, 0.29494942, 0.27613211,
+ -0.10895856, -0.21798752, 0.044324054, 0.18667149, 0.0083657929, -0.15161745, -0.06379928, 0.07139736000000001,
+ 0.059696773, -0.014185965, -0.017375352, 0.01599086, 0.0058387225, -0.015281729, -0.010330508, 0.0027153497,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.0, 0.0, 0.0, 0.0, 2.8347963e-8, 2.2523303e-8, -4.8735247e-8, -1.1960916e-7,
+ -2.5287662e-7, -1.0870486e-7, 3.6471382e-7, 0.0000012064933, 4.9010332e-8, -0.0000012357305, 9.2436549e-7, -1.5276658e-7,
+ -0.000001674434, 0.0000018850808, -4.7547238e-7, -0.0000047991778, 0.000010587354, 0.000014826825, -0.00001832123, -0.00006445143200000001,
+ 0.000050010787, 0.000078981352, -0.00010843969, -0.000061781033, 0.00011764661, -0.000029652232, -0.00014362553, 0.00036355273,
+ 0.000044555001, -0.00070494037, 0.00030431608, 0.0014913269, -0.0012968481, -0.0016216969, 0.0023436473, 0.0013391667,
+ -0.0071627289, -0.0033138138, 0.012528415, 0.008339137700000001, -0.0055374361, 0.0031823423, 0.0027663458, -0.025586039,
+ -0.041424124, 0.0040475437, 0.057484017, 0.049470067, 0.016054175, 0.0036921246, -0.039935715, -0.12582517,
+ -0.1064918, 0.07029540300000001, 0.20762795, 0.13246998, -0.033414365, -0.12705281, -0.17833346, -0.1797243,
+ 0.032220064, 0.3587368, 0.33807475, -0.1405286, -0.47145321, -0.18066022, 0.2961133, 0.27732297,
+ -0.10855845, -0.2187329, 0.042752897, 0.18508766, 0.0077641669, -0.15053787, -0.06122282, 0.074228853,
+ 0.06099463, -0.015859301, -0.02241404, 0.008369957900000001, },
+ { 0.0, 0.0, 0.0, 0.0, 3.1104865e-11, 2.4713744e-11, -5.3474856e-11, -1.3124141e-10,
+ 2.8076073e-8, 2.240846e-8, -4.8344655e-8, -1.1830887e-7, -2.5288366e-7, -1.1009094e-7, 3.6581885e-7, 0.0000012066097,
+ 4.7227712e-8, -0.0000012339054, 9.2397559e-7, -1.5830681e-7, -0.0000016623097, 0.000001902708, -4.9736841e-7, -0.0000048746571,
+ 0.000010641936, 0.000014916903, -0.00001844127, -0.000064515498, 0.000050156285, 0.00007894542200000001, -0.00010861116, -0.000061388997,
+ 0.0001176581, -0.000030448803, -0.00014326261, 0.00036539096, 0.000043163251, -0.00070690185, 0.00030701988, 0.0014924274,
+ -0.001304832, -0.0016246302, 0.002357033, 0.0013474944, -0.0071698505, -0.0033108691, 0.012533524, 0.0083162698,
+ -0.0055818492, 0.003181139, 0.0028309669, -0.025523938, -0.041427794, 0.0040395529, 0.057468792, 0.049353567,
+ 0.015859766, 0.0037180721, -0.039555569, -0.12557329, -0.10652434, 0.070261595, 0.20734565, 0.1317388,
+ -0.03404103, -0.12662826, -0.1770882, -0.17860175, 0.032710046, 0.35856033, 0.33678034, -0.14316156,
+ -0.473647, -0.17975323, 0.30028384, 0.28157025, -0.10762441, -0.22181434, 0.037393303, 0.18007816,
+ 0.006253649, -0.14515602, -0.046992144, 0.09621433, },
+ { 0.0, 0.0, 0.0, 0.0, 4.9302209e-11, 3.9172078e-11, -8.4759363e-11, -2.0802185e-10,
+ -8.0623665e-11, 9.6317379e-11, 1.6817782e-11, 5.8283731e-10, 2.5759293e-8, 1.9418005e-8, -4.3417929e-8, -1.0682495e-7,
+ -2.5975641e-7, -1.2300478e-7, 3.8217799e-7, 0.000001218181, 4.4579459e-8, -0.0000012107338, 9.0779212e-7, -3.1709409e-7,
+ -0.0000014767929, 0.0000022412612, -9.1037095e-7, -0.0000058521315, 0.000011594129, 0.00001609105, -0.000020289796, -0.000065763475,
+ 0.000052689099, 0.00007888203399999999, -0.00011191315, -0.000056305446, 0.00011794491, -0.000041636402, -0.00013852035, 0.00039353835,
+ 0.000016087667, -0.00074771176, 0.00036439677, 0.0015550243, -0.001424237, -0.0016912016, 0.0025549356, 0.0014235625,
+ -0.0074529838, -0.0033190717, 0.012908787, 0.0082218319, -0.0061297864, 0.0033308454, 0.003480986, -0.025683031,
+ -0.041995976, 0.0044737841, 0.057981001, 0.048634771, 0.014743331, 0.0040970547, -0.037749205, -0.12495603,
+ -0.10679701, 0.070623223, 0.20681414, 0.12717576, -0.038987624, -0.12484364, -0.16903315, -0.17130917,
+ 0.036125929, 0.35914755, 0.33062642, -0.16026408, -0.49087723, -0.17615148, 0.32895563, 0.31348535,
+ -0.097420887, -0.24067157, -0.0068642378, 0.11219697, },
+ { 0.0, 0.0, 0.0, 0.0, 1.6669958e-11, 1.3244779e-11, -2.8658655e-11, -7.0335904e-11,
+ 2.2814041e-10, 2.3549011e-10, -4.3339335e-10, -8.805498899999999e-10, -1.2935862e-9, -5.515234299999999e-10, 1.8861269e-9, 7.3446094e-9,
+ 1.2543352e-8, 1.545426e-9, -1.5165886e-8, -4.9146175e-8, -2.9234586e-7, -1.7639541e-7, 4.5374829e-7, 0.0000012209487,
+ 1.2278171e-7, -9.685260999999999e-7, 6.4489216e-7, -0.0000015008025, -3.9354283e-7, 0.0000042281365, -0.0000033565057, -0.000010303686,
+ 0.000017012562, 0.000020906574, -0.00002961357, -0.000069633977, 0.000062129587, 0.000073870575, -0.00012292418, -0.00001682869,
+ 0.00010857498, -0.00011195588, -0.00009026875400000001, 0.00053011919, -0.00014608608, -0.00092560829, 0.00067049494, 0.0018019183,
+ -0.0020404998, -0.0019316755, 0.0035226148, 0.0016869094, -0.008693585, -0.0032849721, 0.014554009, 0.0078151739,
+ -0.0084537802, 0.0041605347, 0.0058665682, -0.026774198, -0.045914986, 0.0049123195, 0.063776951, 0.050441966,
+ 0.013630997, 0.0075108398, -0.037034514, -0.1403178, -0.12671833, 0.072889677, 0.2323412, 0.15268124,
+ -0.024786402, -0.12259352, -0.19576372, -0.23414639, -0.010289108, 0.39690249, 0.43370648, -0.089458844,
+ -0.50864478, -0.25076346, 0.23238368, 0.17867278, },
+ { -0.10336098, 0.43698355, -0.05205054, -0.38094273, 0.25644551, 0.2346896, -0.37978468, 0.12285758,
+ 0.11406574, -0.19346287, 0.25076721, -0.1000306, -0.21361052, 0.30863792, -0.1077896, -0.13642263,
+ 0.19131498, -0.10816236, 0.011856046, 0.073645325, -0.10939103, 0.064372891, 0.015456895, -0.058566397,
+ 0.042702958, -0.009002869700000001, -0.0076727162, 0.0096952662, -0.01108636, 0.0070343222, 0.0054298699, -0.0035153294,
+ -2.8212126e-17, 2.9364612e-17, -2.8497598e-18, -6.5598367e-18, 2.2196917e-17, -1.5966312e-17, -6.8415466e-19, 1.0256422e-17,
+ -1.0903092e-17, 6.136113e-18, 1.5503946e-18, -3.4403994e-18, 4.7292107e-18, -3.142732e-18, -1.0747554e-18, 2.4408853e-18,
+ -1.2884504e-18, 7.997105e-20, 4.4808753e-19, -5.2762049e-19, 1.8594686e-19, 1.0847923e-19, -3.3301754e-19, 1.4273141e-19,
+ 2.0535414e-19, -1.8929296e-19, 1.2177378e-20, 7.566992799999999e-20, -1.7612349e-19, 5.9536839e-20, -1.1724752e-20, -8.3718063e-20,
+ 8.1945198e-20, 1.3593323e-21, -1.0939206e-21, 2.7296664e-20, -2.9975079e-20, -5.1646176e-22, 7.0238119e-21, -1.9083712e-21,
+ 1.5417738e-21, -4.847092e-22, -6.900116e-22, 7.7780343e-22, 1.6035611e-21, -1.1671024e-21, -8.809386700000001e-22, 5.1907549e-22,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.2381574, 0.24787821, 0.14738553, -0.31977596, -0.062372762, 0.32513857, -0.068171486, -0.31736026,
+ 0.24711974, 0.14518414, -0.30433735, 0.15030169, 0.051580316, -0.2025471, 0.24903716, -0.097704256,
+ -0.18039066, 0.29862922, -0.1263385, -0.11264106, 0.19168629, -0.12019892, 0.009955064200000001, 0.07220718399999999,
+ -0.10756871, 0.069730504, 0.014077653, -0.063847716, 0.046485607, -0.009319401499999999, -0.0075936564, 0.01014513,
+ -0.012827683, 0.008134040299999999, 0.0063368034, -0.0040889465, -0.0000063505191, 0.000006950383, -0.00001241348, 0.000007111846,
+ -0.0000064631173, 0.0000079486222, -0.0000051804315, 9.788376799999999e-7, -0.0000012868637, 0.0000029161477, -2.1119116e-7, -5.2479358e-7,
+ 1.2924158e-8, 4.5152466e-7, 5.6881144e-7, -1.4409161e-7, -1.6287584e-7, 6.6652555e-8, 1.7433987e-7, -6.663249100000001e-8,
+ 1.629114e-8, -4.3365806e-8, -8.7838571e-9, 1.3558251e-8, -8.1414893e-10, -6.6948214e-9, -7.456150700000001e-9, 8.8064106e-10,
+ 3.8271749e-9, -2.1546977e-9, -2.1125387e-9, 1.2521301e-9, -3.3478394e-10, 2.9664332e-10, 2.5333064e-10, -1.2786898e-10,
+ -8.9606122e-12, 6.8636006e-12, 6.0126818e-12, -3.2434772e-12, 1.7503469e-13, -1.4327545e-13, -1.2368103e-13, 6.4898593e-14,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.16594546, 0.021972375, 0.21257073, -0.13795719, -0.23325892, 0.22979788, 0.13646732, -0.28662031,
+ -0.036960515, 0.3065747, -0.073102404, -0.295528, 0.23381221, 0.12263712, -0.28890599, 0.15882495,
+ 0.047578576, -0.19677918, 0.24338164, -0.098716897, -0.17095421, 0.29074244, -0.13382557, -0.10865891,
+ 0.19302541, -0.11817653, 0.01048866, 0.06894270199999999, -0.10712826, 0.071793709, 0.01314768, -0.065370729,
+ 0.046759544, -0.0084408238, -0.0072321374, 0.010164083, -0.013519027, 0.008576618899999999, 0.0066295855, -0.0042906449,
+ -9.998778500000001e-7, 0.0000015478204, -0.0000017517036, 7.332273e-7, -0.0000010317518, 0.0000016602753, -9.682844000000001e-7, 2.5190377e-7,
+ -3.2823674e-7, 5.8315547e-7, 5.514423999999999e-10, -5.4213323e-8, -7.0818943e-8, 1.1415268e-7, 9.940506e-8, -5.6015297e-8,
+ 5.7225635e-10, 2.8129944e-9, 2.4769282e-8, -5.8898787e-9, -9.4554702e-11, -6.4790772e-9, 3.0551283e-9, 2.0083669e-9,
+ -1.638693e-9, -1.0561361e-9, -1.5904414e-9, -2.499696e-10, 1.3374645e-9, -7.3325746e-10, -6.863901e-10, 4.357945e-10,
+ -1.3965471e-10, 1.0984232e-10, 9.5653262e-11, -5.1031561e-11, 1.6616273e-12, -1.3601326e-12, -1.1741202e-12, 6.1609085e-13,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.069104323, -0.04237214, 0.10967353, 0.011282401, -0.17415051, 0.021403053, 0.21945724, -0.12028611,
+ -0.21523085, 0.23230499, 0.12991487, -0.28748783, -0.035689801, 0.30409908, -0.070474384, -0.28821646,
+ 0.23193231, 0.1174521, -0.28651538, 0.16020319, 0.046143787, -0.19745216, 0.24009639, -0.099156989,
+ -0.16726204, 0.29091257, -0.13494079, -0.10845704, 0.19287637, -0.11779632, 0.01034376, 0.06791125000000001,
+ -0.10701528, 0.07252636899999999, 0.013108627, -0.065758523, 0.046754171, -0.0082023024, -0.0071059064, 0.010140732,
+ -0.013675539, 0.008677084200000001, 0.0066982, -0.0043362722, -4.2928634e-7, 5.5762325e-7, -6.0251197e-7, 2.8545178e-7,
+ -2.4847952e-7, 3.2216043e-7, -1.1454465e-7, -9.7613984e-9, -1.4180537e-8, 6.336785500000001e-8, 3.1840419e-8, -2.378838e-8,
+ -4.0718732e-9, 1.1746141e-8, 1.8788076e-8, -7.626240800000001e-9, 9.9899638e-10, -3.5145479e-9, 3.664563e-9, 1.5251639e-9,
+ -2.2503938e-9, -1.5662936e-10, -5.6682878e-10, -5.3093496e-10, 1.0615418e-9, -6.1065908e-10, -5.6545207e-10, 3.5065135e-10,
+ -9.9709455e-11, 7.8470462e-11, 6.8324958e-11, -3.6442805e-11, 1.1691909e-12, -9.570465999999999e-13, -8.2616046e-13, 4.3350747e-13,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.015911608, -0.027299969, 0.033186044, 0.039995417, -0.07342411, -0.041121331, 0.1163226, 0.020910495,
+ -0.16563933, 0.024714618, 0.21754715, -0.12284876, -0.2152654, 0.23413165, 0.13237649, -0.28594259,
+ -0.036907369, 0.30169717, -0.07026452499999999, -0.2863606, 0.23127057, 0.11548435, -0.28671725, 0.1606467,
+ 0.04670782, -0.19688757, 0.23957645, -0.099297892, -0.16668393, 0.29063735, -0.13529883, -0.10844124,
+ 0.19282211, -0.11760804, 0.01034761, 0.06766707499999999, -0.10697097, 0.072675087, 0.013100453, -0.065832161,
+ 0.046742062, -0.0081473039, -0.0070743643, 0.010131315, -0.013705653, 0.0086962898, 0.0067125396, -0.0043457398,
+ -8.1627608e-8, 8.543780100000001e-8, -5.3712589e-8, 1.327336e-9, 1.9107335e-9, 1.6196752e-8, 3.2215588e-9, -4.4466373e-9,
+ -2.1746539e-9, 5.3420267e-9, 5.952181e-9, -3.0205576e-9, 6.0999665e-10, -9.590371300000001e-10, 1.368256e-9, 5.2928793e-10,
+ -9.1403627e-10, 6.763270499999999e-11, -6.7608191e-11, -2.3474385e-10, 3.5310168e-10, -2.0783083e-10, -1.9147887e-10, 1.1741923e-10,
+ -3.1338961e-11, 2.4671859e-11, 2.1480394e-11, -1.1455478e-11, 3.6436943e-13, -2.9825622e-13, -2.5746655e-13, 1.3509928e-13,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.00010953376, -0.0066695294, 0.002925938, 0.017851646, -0.016853728, -0.026665938, 0.035370231, 0.042794613,
+ -0.07111854500000001, -0.040033922, 0.11610379, 0.020099525, -0.16589307, 0.025495639, 0.21858618, -0.12263584,
+ -0.21596224, 0.23352451, 0.13258257, -0.28549906, -0.037093532, 0.30113508, -0.070353631, -0.28601051,
+ 0.23138871, 0.11537757, -0.28669649, 0.16070747, 0.046747369, -0.1969158, 0.2394417, -0.099292696,
+ -0.1665998, 0.29059798, -0.1353337, -0.10844426, 0.19281049, -0.1175694, 0.010342358, 0.067627653,
+ -0.1069576, 0.07269242200000001, 0.013100911, -0.065838073, 0.046735578, -0.008138709100000001, -0.0070683408, 0.010128424,
+ -0.013708364, 0.008697987799999999, 0.0067140604, -0.0043467264, 1.9622188e-9, 1.7406201e-10, -1.672447e-9, 5.4651109e-10,
+ -4.7595869e-10, 9.2437526e-10, 4.7383151e-10, -4.4720428e-10, 1.7140273e-10, -5.2404856e-11, 1.685328e-10, 6.967566999999999e-11,
+ -1.444021e-10, 4.4055443e-11, 3.0290447e-11, -4.1955458e-11, 3.608598e-11, -2.2614881e-11, -2.0559587e-11, 1.2228308e-11,
+ -2.6688281e-12, 2.1036316e-12, 1.8310149e-12, -9.7598049e-13, 3.0073196e-14, -2.4616691e-14, -2.1250116e-14, 1.1150436e-14,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.0012742472, 0.00027493115, -0.0016569906, 0.0029734957, 0.00020414488, -0.0064933966, 0.0031591306, 0.018059611,
+ -0.016689805, -0.026524664, 0.035438013, 0.042736753, -0.071193733, -0.039967886, 0.11625315, 0.02011879,
+ -0.16603009, 0.025409457, 0.21865285, -0.12256659, -0.21601375, 0.23345319, 0.13261377, -0.28543431,
+ -0.037106847, 0.30108709, -0.07034105, -0.28596614, 0.23138499, 0.11534424, -0.28669767, 0.16073009,
+ 0.046750734, -0.19693178, 0.23943261, -0.099283807, -0.16659433, 0.29059092, -0.13533815, -0.10844243,
+ 0.19281158, -0.11756903, 0.010340932, 0.067626614, -0.10695672, 0.07269291, 0.013100859, -0.065838181,
+ 0.046735249, -0.008138348300000001, -0.007068071, 0.010128278, -0.013708444, 0.0086980397, 0.006714112, -0.0043467551,
+ 7.6250582e-11, -2.4269293e-10, -4.4500305e-10, 1.6738798e-10, -1.7254536e-11, 8.666511200000001e-11, -8.2471298e-11, -3.5152726e-11,
+ 4.9015492e-11, 6.2600825e-12, 1.5877804e-11, 1.1149878e-11, -2.4816445e-11, 1.4173131e-11, 1.3144982e-11, -8.180377100000001e-12,
+ 2.3708542e-12, -1.8656596e-12, -1.6244826e-12, 8.664931e-13, -2.7867857e-14, 2.2811437e-14, 1.9691784e-14, -1.0332754e-14,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.00048543251, 0.00067050041, -0.0009308460499999999, -0.00083948251, 0.001402981, 0.00026296786, -0.0018168877, 0.0027381465,
+ 0.0000065882746, -0.0065710155, 0.0031962766, 0.018128669, -0.016675065, -0.026579325, 0.035371358, 0.0427177,
+ -0.071163305, -0.039936092, 0.11625122, 0.020099619, -0.16602767, 0.025440594, 0.21867805, -0.12257452,
+ -0.21603854, 0.2334434, 0.13262307, -0.28542753, -0.037114116, 0.30108227, -0.070331567, -0.28595691,
+ 0.23138119, 0.11533681, -0.28669552, 0.16073649, 0.046750369, -0.19693692, 0.23943193, -0.09928029300000001,
+ -0.16659375, 0.29058837, -0.13533921, -0.10844109, 0.1928121, -0.11756991, 0.010340415, 0.067626916,
+ -0.10695652, 0.072692795, 0.01310069, -0.065838151, 0.046735307, -0.0081383532, -0.0070680841, 0.010128292,
+ -0.013708463, 0.0086980527, 0.0067141216, -0.0043467614, -2.102711e-11, 3.3417224e-11, -3.8409085e-11, -1.7490935e-11,
+ 2.7166852e-11, -1.5216838e-12, 2.6753955e-12, 6.9083671e-12, -1.0809558e-11, 6.3270183e-12, 5.836294e-12, -3.5887054e-12,
+ 9.731098600000001e-13, -7.6601753e-13, -6.6694169e-13, 3.5569341e-13, -1.1340318e-14, 9.282481500000001e-15, 8.012984599999999e-15, -4.2046742e-15,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.00008874163200000001, 0.00017255261, -0.00020334688, -0.00048589084, 0.0005194140799999999, 0.00065162184, -0.0010030955, -0.00093500466,
+ 0.0013229135, 0.00022422489, -0.0018110625, 0.002766036, 0.000019216306, -0.0065926605, 0.0031624642, 0.018119477,
+ -0.016655318, -0.026561899, 0.035366048, 0.042705799, -0.07115904100000001, -0.039919962, 0.11625833, 0.020092471,
+ -0.16603572, 0.025440328, 0.21868056, -0.12257518, -0.2160409, 0.23344412, 0.13262646, -0.28542614,
+ -0.0371155, 0.301081, -0.070330532, -0.28595529, 0.23138086, 0.11533536, -0.28669534, 0.16073756,
+ 0.046750343, -0.19693765, 0.23943165, -0.099279878, -0.16659353, 0.29058801, -0.1353394, -0.10844095,
+ 0.19281216, -0.11756996, 0.010340352, 0.067626914, -0.10695649, 0.072692796, 0.013100678, -0.06583815,
+ 0.046735303, -0.0081383464, -0.0070680792, 0.01012829, -0.013708465, 0.0086980544, 0.006714123, -0.0043467623,
+ 4.1692516e-12, -7.121456e-13, -1.7304044e-13, 1.1302171e-12, -1.37798e-12, 8.2446267e-13, 7.569006e-13, -4.6045708e-13,
+ 1.1710488e-13, -9.2217873e-14, -8.028399700000001e-14, 4.2809906e-14, -1.3535472e-15, 1.1074076e-15, 9.559748499999999e-16, -5.0178012e-16,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 4.9186471e-7, 0.0000051461586, -0.0000052735889, -0.000074617715, 0.000090338235, 0.00016829914, -0.00021319587, -0.00049763725,
+ 0.00050951791, 0.00064579957, -0.0010036791, -0.0009315934, 0.0013254699, 0.00022183375, -0.0018160248, 0.0027645817,
+ 0.000022431098, -0.0065899474, 0.0031613131, 0.01811749, -0.016654443, -0.026559467, 0.035366631, 0.042704497,
+ -0.07115983400000001, -0.039919625, 0.11625849, 0.020092045, -0.16603593, 0.025440686, 0.21868092, -0.12257525,
+ -0.21604106, 0.23344415, 0.13262661, -0.28542607, -0.037115559, 0.30108091, -0.07033048, -0.28595519,
+ 0.23138084, 0.1153353, -0.28669535, 0.16073761, 0.046750358, -0.19693768, 0.23943163, -0.099279862,
+ -0.16659352, 0.290588, -0.13533941, -0.10844094, 0.19281216, -0.11756996, 0.010340351, 0.067626913,
+ -0.10695649, 0.072692796, 0.013100678, -0.06583815, 0.046735303, -0.008138345999999999, -0.0070680789, 0.010128289,
+ -0.013708465, 0.0086980544, 0.006714123, -0.0043467623, 2.3376946e-13, -1.3432021e-13, -1.2440416e-13, 7.7199335e-14,
+ -2.2028344e-14, 1.7343448e-14, 1.5100496e-14, -8.051784e-15, 2.6023509e-16, -2.1274301e-16, -1.8354782e-16, 9.640321599999999e-17,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0000040937358, -0.0000055585317, 0.0000076082811, 0.0000085197263, -6.5244263e-7, 0.0000052950016, -0.0000037713108, -0.00007243937499999999,
+ 0.000092169031, 0.00016904946, -0.00021350235, -0.00049827953, 0.00050935188, 0.00064630511, -0.0010030326, -0.00093141393,
+ 0.0013251546, 0.00022152265, -0.0018159844, 0.0027647772, 0.000022393482, -0.0065902524, 0.0031610922, 0.018117583,
+ -0.016654221, -0.026559397, 0.035366549, 0.042704454, -0.071159768, -0.039919598, 0.11625841, 0.020091976,
+ -0.1660359, 0.025440742, 0.2186809, -0.1225753, -0.21604106, 0.23344419, 0.13262662, -0.2854261,
+ -0.037115562, 0.30108093, -0.07033047100000001, -0.2859552, 0.23138084, 0.1153353, -0.28669535, 0.1607376,
+ 0.046750357, -0.19693768, 0.23943163, -0.099279862, -0.16659352, 0.290588, -0.13533941, -0.10844094,
+ 0.19281216, -0.11756996, 0.010340351, 0.067626913, -0.10695649, 0.072692796, 0.013100678, -0.06583815,
+ 0.046735303, -0.008138345999999999, -0.0070680789, 0.010128289, -0.013708465, 0.0086980544, 0.006714123, -0.0043467623,
+ -8.131355e-15, 6.378939e-15, 5.55643e-15, -2.9687905e-15, 9.4777622e-17, -7.491754e-17, -6.5217812e-17, 3.4928497e-17,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -7.6914904e-7, -0.0000013872766, 0.0000018717906, 0.0000039601571, -0.0000043842735, -0.0000054015677, 0.000008218305099999999, 0.000009330314099999999,
+ 3.0916655e-8, 0.0000056292333, -0.0000038169114, -0.000072676369, 0.000092055843, 0.00016922368, -0.00021322119, -0.0004981985,
+ 0.00050919173, 0.00064616029, -0.00100299, -0.0009313142, 0.0013251208, 0.00022138627, -0.0018160486, 0.0027648352,
+ 0.000022464236, -0.0065902472, 0.0031610699, 0.018117587, -0.0166542, -0.026559402, 0.03536652, 0.042704441,
+ -0.071159757, -0.039919587, 0.1162584, 0.020091963, -0.1660359, 0.025440754, 0.2186809, -0.12257531,
+ -0.21604106, 0.2334442, 0.13262662, -0.2854261, -0.037115563, 0.30108093, -0.07033046900000001, -0.28595521,
+ 0.23138083, 0.1153353, -0.28669535, 0.1607376, 0.046750356, -0.19693768, 0.23943163, -0.099279862,
+ -0.16659352, 0.290588, -0.13533941, -0.10844094, 0.19281216, -0.11756996, 0.010340351, 0.067626913,
+ -0.10695649, 0.072692796, 0.013100678, -0.06583815, 0.046735303, -0.008138345999999999, -0.0070680789, 0.010128289,
+ -0.013708465, 0.0086980544, 0.006714123, -0.0043467623, 9.764870899999999e-18, -1.4718019e-17, -1.1346244e-17, 4.1658833e-18,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -1.0208573e-7, 1.3018186e-8, 1.194814e-7, 5.5588767e-7, -7.7832783e-7, -0.000001347968, 0.0000019573526, 0.0000040619503,
+ -0.0000042970883, -0.0000053486099, 0.000008225291299999999, 0.000009300481599999999, 5.6623086e-9, 0.0000056459329, -0.0000037749505, -0.000072660374,
+ 0.000092031895, 0.00016920012, -0.00021321372, -0.00049818143, 0.00050918639, 0.0006461392299999999, -0.0010029982, -0.00093130473,
+ 0.0013251297, 0.00022138567, -0.0018160509, 0.002764837, 0.000022466322, -0.0065902489, 0.0031610667, 0.018117586,
+ -0.016654199, -0.026559401, 0.035366519, 0.04270444, -0.071159756, -0.039919586, 0.1162584, 0.020091962,
+ -0.1660359, 0.025440755, 0.2186809, -0.12257531, -0.21604106, 0.2334442, 0.13262662, -0.2854261,
+ -0.037115563, 0.30108093, -0.07033046900000001, -0.28595521, 0.23138083, 0.1153353, -0.28669535, 0.1607376,
+ 0.046750356, -0.19693768, 0.23943163, -0.099279862, -0.16659352, 0.290588, -0.13533941, -0.10844094,
+ 0.19281216, -0.11756996, 0.010340351, 0.067626913, -0.10695649, 0.072692796, 0.013100678, -0.06583815,
+ 0.046735303, -0.008138345999999999, -0.0070680789, 0.010128289, -0.013708465, 0.0086980544, 0.006714123, -0.0043467623,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.0, 0.0, 0.0, 0.0, 2.5759653e-8, 2.0466814e-8, -4.4285476e-8, -1.0868825e-7,
+ -9.6447646e-8, 7.1631101e-9, 1.0217806e-7, 5.3372984e-7, -7.9697132e-7, -0.0000013577621, 0.0000019572844, 0.0000040680546,
+ -0.0000042928595, -0.0000053527451, 0.000008217056199999999, 0.0000092987249, 8.7710696e-9, 0.0000056470119, -0.0000037725847, -0.00007265115,
+ 0.000092025111, 0.00016919001, -0.00021319519, -0.0004981714, 0.00050916083, 0.00064614419, -0.0010029715, -0.00093137957,
+ 0.0013251136, 0.00022150757, -0.001816076, 0.0027646198, 0.000022551485, -0.0065901118, 0.0031609105, 0.018118037,
+ -0.01665361, -0.026559824, 0.03536572, 0.042704521, -0.071159823, -0.039919898, 0.11625875, 0.020089684,
+ -0.16603036, 0.025448944, 0.21867067, -0.12260165, -0.21601898, 0.23347556, 0.13258048, -0.28544691,
+ -0.037013621, 0.30109905, -0.07049103, -0.28599544, 0.23154326, 0.11529805, -0.28686781, 0.16093501,
+ 0.047036544, -0.19708734, 0.2391103, -0.099324941, -0.16644021, 0.29049677, -0.13552768, -0.10796588,
+ 0.193457, -0.11803531, 0.0092231821, 0.0674976, -0.10592521, 0.07331246399999999, 0.012536859, -0.066336276,
+ 0.047126045, -0.0081144835, -0.0086391006, 0.0076846839, },
+ { 0.0, 0.0, 0.0, 0.0, -2.310967e-13, -1.8361323e-13, 3.9729678e-13, 9.750711799999999e-13,
+ 2.5735935e-8, 2.0447217e-8, -4.424413e-8, -1.0858931e-7, -9.6323217e-8, 7.1885059e-9, 1.020196e-7, 5.3307751e-7,
+ -7.9586216e-7, -0.0000013560898, 0.0000019547474, 0.0000040629048, -0.0000042915417, -0.0000053492893, 0.000008213601799999999, 0.0000093049104,
+ -1.7246536e-8, 0.0000056052413, -0.000003712541, -0.00007247102700000001, 0.0000919272, 0.00016897358, -0.00021294943, -0.0004979377,
+ 0.00050890982, 0.00064625727, -0.0010028059, -0.00093287896, 0.0013259411, 0.00022450974, -0.0018185077, 0.0027565327,
+ 0.000028529945, -0.0065815284, 0.0031491404, 0.018115062, -0.016634876, -0.026565874, 0.035342312, 0.042743219,
+ -0.07115894, -0.03999209, 0.11628727, 0.020224178, -0.16612642, 0.025312132, 0.21889516, -0.12262658,
+ -0.21642083, 0.23358692, 0.1330733, -0.28544717, -0.037080723, 0.30159241, -0.070810965, -0.28752889,
+ 0.23108101, 0.11569811, -0.28635917, 0.16342308, 0.049077681, -0.19783438, 0.23674534, -0.10382321,
+ -0.16979763, 0.29279912, -0.12921646, -0.10115504, 0.19504154, -0.1252006, -0.00050619406, 0.062627694,
+ -0.1038641, 0.081254391, 0.025697232, -0.045830207, },
+ { 0.0, 0.0, 0.0, 0.0, 7.9593377e-13, 6.3239315e-13, -1.3683533e-12, -3.3583002e-12,
+ -6.753506499999999e-11, -5.1069531e-11, 1.1413876e-10, 2.8886963e-10, 2.6130704e-8, 2.0529246e-8, -4.474577e-8, -1.1054977e-7,
+ -9.6160198e-8, 9.648097099999999e-9, 9.9857966e-8, 5.312347799999999e-7, -7.8437136e-7, -0.000001350296, 0.0000019393909, 0.0000040340277,
+ -0.0000042756633, -0.0000053244108, 0.0000081703425, 0.0000093387318, -1.5955554e-7, 0.0000053730519, -0.0000033880106, -0.000071543951,
+ 0.00009094828600000001, 0.00016742405, -0.00021075319, -0.0004944841499999999, 0.00050572369, 0.00064373234, -0.00099767183, -0.00093517257,
+ 0.0013226017, 0.00023579616, -0.0018202749, 0.0027128501, 0.00005199085, -0.0065177271, 0.0030889539, 0.018017381,
+ -0.016482816, -0.026474392, 0.035105113, 0.042707457, -0.070871596, -0.040071693, 0.11582208, 0.020809495,
+ -0.16571684, 0.024391395, 0.21913828, -0.1225116, -0.2170174, 0.23390508, 0.13334994, -0.28507333,
+ -0.037333319, 0.30268512, -0.071040561, -0.29189115, 0.23459309, 0.11814362, -0.29366771, 0.168199,
+ 0.055144579, -0.20517408, 0.23406798, -0.10369417, -0.16592475, 0.30024422, -0.13665322, -0.10712787,
+ 0.20336628, -0.12304478, -0.012787691, 0.034758271, },
+ { 0.0, 0.0, 0.0, 0.0, -1.2748221e-12, -1.0128842e-12, 2.1916484e-12, 5.3788837e-12,
+ 1.0921985e-10, 8.2631556e-11, -1.8461942e-10, -4.6710814e-10, -1.2157947e-9, -5.9037309e-10, 1.8031028e-9, 5.6089956e-9,
+ 2.8816076e-8, 1.7242481e-8, -4.5066022e-8, -1.2254137e-7, -1.0212736e-7, 2.8041794e-8, 8.8809173e-8, 5.15863e-7,
+ -7.6703574e-7, -0.0000013448302, 0.0000019407723, 0.0000040046758, -0.0000041631243, -0.0000052761599, 0.000007990014, 0.0000094025477,
+ -3.7236461e-7, 0.0000050912212, -0.0000031816081, -0.000070497896, 0.00009005617, 0.00016543404, -0.00020781314, -0.00049140692,
+ 0.00050388753, 0.00064366586, -0.0009956896499999999, -0.00094188997, 0.0013264845, 0.00025337108, -0.0018357686, 0.0026434454,
+ 0.00010431219, -0.0064094357, 0.0029459426, 0.017888665, -0.016208348, -0.026453452, 0.034900135, 0.042639749,
+ -0.070925263, -0.04027267, 0.11533201, 0.023882331, -0.16561734, 0.020518705, 0.22247747, -0.12340487,
+ -0.2241639, 0.23400827, 0.14119997, -0.2774529, -0.045453944, 0.30578931, -0.060811587, -0.32120566,
+ 0.22629458, 0.14143909, -0.2932926, 0.18901876, 0.059268121, -0.24117229, 0.23667102, -0.10932962,
+ -0.18469158, 0.33038169, -0.098611492, -0.050527617, },
+ { 0.0, 0.0, 0.0, 0.0, -1.1957895e-23, -9.4222313e-24, 2.0608172e-23, 5.0220109e-23,
+ 1.0491953e-22, 4.314021e-23, -1.5016783e-22, -4.9824641e-22, 1.442234e-22, 6.4439341e-22, -6.6049116e-22, -6.2852714e-22,
+ 7.7306433e-22, -1.7153432e-22, -3.6703031e-22, 2.3998726e-21, 2.3787518e-8, 1.8899893e-8, -4.089502e-8, -1.0036718e-7,
+ -9.1381028e-8, 4.773524e-9, 9.8339297e-8, 5.0264551e-7, -6.6787209e-7, -0.0000012072564, 0.0000016961125, 0.0000034579349,
+ -0.0000043011076, -0.0000049521991, 0.0000079675964, 0.000010237278, -6.1866699e-7, 0.0000026148365, -6.6753709e-7, -0.000062941151,
+ 0.00008091389800000001, 0.00015367342, -0.00019217485, -0.00046113989, 0.00047238288, 0.00061502943, -0.00093819179, -0.00095701101,
+ 0.0013112531, 0.00036070637, -0.0018631093, 0.0022451801, 0.00035463833, -0.0057958687, 0.0023086156, 0.016757115,
+ -0.014807134, -0.025281505, 0.032288107, 0.042350832, -0.06623280400000001, -0.040838204, 0.10990365, 0.024012049,
+ -0.16246351, 0.01632983, 0.21889693, -0.10804326, -0.21710906, 0.22495868, 0.13671564, -0.29314566,
+ -0.049448497, 0.30568883, -0.036034483, -0.32110046, 0.24258397, 0.18749043, -0.41990029, 0.17429974,
+ 0.14715901, -0.27307926, 0.27262049, -0.13077844, },
+ { 0.0, 0.0, 0.0, 0.0, -1.1573241e-23, -9.2381678e-24, 1.9865137e-23, 4.8930224e-23,
+ 1.1706339e-22, 5.6286956e-23, -1.7324546e-22, -5.5311775e-22, -1.6848279e-22, 4.316996e-22, -1.5922221e-22, 7.5685334e-22,
+ 3.4316913e-22, -1.7509105e-21, 1.3472139e-21, 3.3351924e-21, -4.5929126e-10, -3.6492062e-10, 7.8960427e-10, 1.9378973e-9,
+ 2.5820175e-8, 1.902087e-8, -4.3254959e-8, -1.1120419e-7, -1.2565313e-7, -8.519962999999999e-9, 1.4601723e-7, 6.3621432e-7,
+ -2.6331083e-7, -0.0000010138949, 0.00000110968, 0.0000016838337, -0.0000035744646, -0.0000026460073, 0.0000053205335, 0.000007853747200000001,
+ 8.9215155e-8, 3.1123563e-7, 0.0000013795845, -0.000044677231, 0.00006865306099999999, 0.00011781359, -0.00015710027, -0.00036064286,
+ 0.00038031484, 0.00050338751, -0.00077590559, -0.0008674142, 0.0010777226, 0.00039442868, -0.0015444235, 0.0016459382,
+ 0.00035101212, -0.0046446429, 0.0018138366, 0.01452449, -0.013180724, -0.022957383, 0.028828912, 0.041597157,
+ -0.061093708, -0.041857191, 0.10188836, 0.033085447, -0.15855498, -0.0034829442, 0.23182062, -0.090326764,
+ -0.24246823, 0.22358741, 0.14781968, -0.26594426, -0.097818221, 0.28723329, 0.07952021200000001, -0.41757914,
+ 0.21073239, 0.2897774, -0.48889789, 0.22573225, },
+ { 0.0, 0.0, 0.0, 0.0, -1.0733383e-23, -8.6079257e-24, 1.872705e-23, 4.5550867e-23,
+ 4.5417363e-23, -1.2189591e-25, -4.7937773e-23, -2.4038838e-22, 2.7755606e-22, 5.4224665e-22, -7.515297e-22, -1.4797002e-21,
+ 1.0502481e-21, 1.4065423e-21, -1.940141e-21, -6.9675157e-22, 1.4806259e-8, 1.1764015e-8, -2.5454621e-8, -6.247236e-8,
+ -1.3486342e-7, -5.8989698e-8, 1.9527931e-7, 6.419069e-7, 1.1234638e-7, -5.855622599999999e-7, 3.4054381e-7, -4.5951567e-7,
+ -0.0000013005443, 9.7272754e-7, 2.3198668e-7, -4.0989736e-7, 0.00000479093, 0.0000044838884, -0.000006090609, -0.000028617073,
+ 0.000020212565, 0.000037572762, -0.000049522919, -0.000030274147, 0.000059032777, 4.0388774e-7, -0.000078724649, 0.00008755813499999999,
+ 0.00012618231, -0.00018340068, -0.000059928571, 0.00036247195, -0.00015621759, -0.00031281978, 0.00022071986, 0.000021631567,
+ -0.0023678938, -0.0016216755, 0.0046514578, 0.0060223091, -0.0016579749, -0.0022419727, 0.00179991, -0.003098703,
+ -0.031223321, -0.015841757, 0.053425774, 0.058517397, -0.03700466, -0.026055767, 0.044009586, -0.030427122,
+ -0.17559441, -0.0033383422, 0.33021097, 0.014343156, -0.23379297, 0.10912792, 0.010642794, -0.24289997,
+ -0.17351534, 0.4024428, 0.46042496, -0.56361982, },
+ { 0.37382874, -0.51867853, 0.47943749, -0.09378391899999999, -0.18905132, 0.29135353, -0.16447188, -0.07414341200000001,
+ 0.26094242, -0.23048843, 0.053840185, 0.12786236, -0.1799737, 0.10120967, 0.0045846861, -0.07467683,
+ 0.08096257900000001, -0.039817601, -0.013746566, 0.036482493, -0.028176001, 0.009026072, 0.0074018258, -0.0070228506,
+ 0.0057997749, -0.0036799712, -0.0028406099, 0.0018390274, 1.0642048e-17, -2.3879718e-17, 1.2954511e-17, 1.4028154e-17,
+ -1.4083962e-17, 7.6461113e-18, 2.0534728e-18, -6.184756e-18, 8.647686299999999e-18, -2.4031171e-18, -3.2001736e-18, 4.6656292e-18,
+ -2.3971523e-19, 3.7425143e-20, 1.7166598e-18, -2.1279204e-19, -6.6740118e-19, 1.5729731e-19, -4.4520642e-19, -4.4010561e-19,
+ 8.861819300000001e-19, -1.5574435e-20, -1.5525456e-19, 3.1233122e-19, -3.2127869e-19, -9.465079100000001e-20, 8.2112468e-20, -6.74227e-20,
+ -2.618406e-20, 9.9322619e-20, -1.5963306e-20, -4.8528886e-20, 1.2366602e-20, -5.19528e-20, -1.0067795e-20, 3.7232067e-20,
+ -2.9793349e-20, 2.8624007e-21, 9.8584485e-21, -1.3461486e-21, 4.4190518e-21, -9.6223827e-21, -6.3801957e-21, 2.9912514e-21,
+ 3.1636145e-21, -2.3855177e-22, -4.4689007e-22, 8.2869664e-22, -7.0758818e-23, -1.2663701e-22, -7.723131e-23, -9.1997408e-24,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.03134196, -0.17628012, 0.35590505, -0.50759131, 0.53725117, -0.45869154, 0.26412691, -0.076134326,
+ -0.007651761, -0.0021413273, 0.022998087, -0.047846877, 0.055539014, -0.025170751, -0.012140822, 0.032370535,
+ -0.029020686, 0.015322765, -0.00035189435, -0.0094576725, 0.0073349447, -0.00025913263, -0.0029728115, 0.00072206717,
+ -0.00059596822, 0.0014931631, 0.00129906, -0.00046872852, -0.00047383082, 0.00030064681, 0.00023207255, -0.00015024512,
+ 8.7917553e-18, 3.9419635e-18, 5.4735481e-19, 2.4625179e-18, -3.8542589e-18, 2.3167755e-19, 1.966174e-18, -1.1347933e-18,
+ -6.7944871e-19, 4.0203463e-19, -1.9518285e-19, -2.2669119e-19, 5.6957285e-19, -3.1249475e-19, 7.4451522e-20, 2.8108751e-19,
+ -4.0423298e-19, -9.275415100000001e-21, 5.3010949e-20, -2.2545586e-20, 1.1869787e-19, -5.9328308e-20, -3.3977341e-20, 5.9668567e-20,
+ -4.12458e-21, -3.107239e-20, -1.4927732e-20, 3.7425643e-21, 1.7937482e-20, 1.4043326e-20, -7.4193836e-22, -3.6709159e-21,
+ 2.4343311e-21, -2.8813358e-22, -7.7778006e-22, -4.9534229e-22, -1.8648303e-21, 2.2475477e-21, 1.3430748e-21, -9.8408921e-22,
+ -2.0997709e-22, 5.6528297e-23, 6.807894400000001e-23, -7.0085213e-23, -6.2883165e-23, 6.8688301e-23, 5.0209405e-23, -2.238441e-23,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.030822248, 0.12957914, -0.18512573, 0.16675695, -0.052857771, -0.13908969, 0.35276876, -0.49791235,
+ 0.51417242, -0.41258809, 0.26195585, -0.11804311, 0.023964219, 0.0010232861, 0.019152748, -0.044474532,
+ 0.047642352, -0.027203395, -0.0031796077, 0.027978106, -0.033547664, 0.020082559, -0.0007510504099999999, -0.011684609,
+ 0.009989718599999999, -0.0019747698, -0.0029026379, 0.0026834211, -0.002285624, 0.0018836202, 0.0016300179, -0.00085116188,
+ -2.7174786e-17, 2.4608677e-17, -5.4277816e-18, -1.5178824e-17, 1.5015794e-17, -4.5329942e-18, 5.0668817e-18, 6.2404078e-18,
+ -9.9984244e-18, 4.9554126e-18, 1.637905e-18, -2.8010555e-18, 3.3434367e-18, -2.1472836e-18, -6.7005628e-19, 1.7342157e-18,
+ -7.3535143e-19, 3.8043225e-19, 2.1005548e-19, -4.6648549e-19, 2.3804352e-19, -6.6845216e-20, -1.9323802e-19, 6.5692847e-20,
+ 2.8876787e-20, -8.108969599999999e-21, 4.8925104e-20, 1.6282379e-20, -7.870229800000001e-20, 1.2005518e-20, -3.4489745e-21, -2.1516959e-20,
+ 2.5544882e-20, -2.6720197e-21, -6.2833653e-22, 1.1517223e-20, -9.406839299999999e-21, -2.564765e-21, 4.7206229e-22, -2.3146181e-22,
+ 1.3258513e-21, -8.4052303e-22, -7.1310092e-22, 5.6324852e-22, 5.6863617e-22, -2.894814e-22, -2.3203236e-22, 1.7479559e-22,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.025421777, -0.067751664, 0.083134478, -0.052379526, -0.022274344, 0.12127978, -0.18958, 0.17343447,
+ -0.05080082, -0.14787227, 0.35019791, -0.48373671, 0.50542054, -0.41685964, 0.26577468, -0.11826206,
+ 0.02521028, 0.00094495453, 0.017027144, -0.043362773, 0.049765927, -0.029643921, -0.0032568805, 0.029534942,
+ -0.034563771, 0.020453298, -0.00076002331, -0.012130441, 0.010544552, -0.0022418113, -0.0031245172, 0.0028394937,
+ -0.0023731879, 0.0019425839, 0.0016769152, -0.00087992019, -5.2958493e-18, -4.0877396e-18, 2.772253e-18, -2.0311297e-18,
+ -2.288765e-18, 7.9289036e-18, 2.5284364e-18, -2.5402696e-18, 9.968205199999999e-19, -5.0944616e-19, 3.9140977e-19, 1.4230412e-18,
+ -1.2705171e-18, -6.1873396e-20, 3.8139103e-19, 1.7084439e-19, 2.5432643e-19, -3.3303833e-19, -1.4171105e-19, 4.2784771e-20,
+ 5.5757122e-20, -2.5390025e-20, -1.0232878e-19, 3.4361784e-20, 7.5020104e-20, -1.3646375e-20, 2.4618801e-20, 1.8847275e-20,
+ -5.9354063e-20, 1.3866702e-20, -4.6895811e-21, -1.278071e-20, 1.7077252e-20, -8.771959499999999e-21, 4.4899158e-22, 1.03643e-20,
+ -1.0025575e-20, -2.4458956e-21, -9.209271300000001e-22, -1.5410242e-21, 3.3222615e-21, -9.566303300000001e-22, -8.9521542e-22, 9.720106e-22,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0071228475, 0.019049761, -0.024644883, 0.010765621, 0.023054686, -0.065592104, 0.084161342, -0.055948254,
+ -0.023192439, 0.12405666, -0.19005779, 0.17094339, -0.04939618, -0.14612657, 0.34892501, -0.48406091,
+ 0.5052392999999999, -0.41645337, 0.26618139, -0.11881742, 0.024890949, 0.0016351911, 0.017138476, -0.043848154,
+ 0.049926304, -0.02967179, -0.0032277214, 0.029567187, -0.034684308, 0.020548686, -0.00069180842, -0.012172774,
+ 0.010553003, -0.0022464053, -0.0031296428, 0.0028424184, -0.0023745904, 0.0019437318, 0.0016779062, -0.00088044017,
+ -1.8475243e-17, 1.4568058e-17, -2.0010569e-18, -1.4842759e-17, 9.308017300000001e-18, 2.7885175e-18, 1.4098213e-18, 7.8711632e-19,
+ -4.1060061e-18, 3.3844641e-18, 1.6399896e-18, -2.4498493e-18, 4.7428963e-19, 8.4630943e-19, -4.6354074e-19, -1.2947061e-19,
+ 2.8272731e-19, 1.5542018e-19, 2.3918721e-19, -2.0130475e-19, -2.9555998e-19, 2.7180211e-19, 9.5026985e-20, -2.3738958e-19,
+ 5.1395559e-20, 1.2154465e-20, 2.7573762e-20, 5.0529356e-20, -7.842936e-20, -2.2160648e-20, 1.9633519e-20, 8.7787609e-21,
+ -2.3803114e-21, -1.0067923e-20, -7.660827199999999e-21, 2.4925729e-21, 9.6896307e-21, -5.5581321e-21, -4.3914061e-21, 3.0391488e-21,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0018057424, -0.0016866646, 0.0069035273, -0.0041188241, -0.0064422689, 0.018372935, -0.025072938, 0.012034045,
+ 0.023684689, -0.066573572, 0.084151978, -0.054928148, -0.023777293, 0.12329836, -0.18937441, 0.17096458,
+ -0.049532242, -0.14576154, 0.3484839, -0.48395708, 0.50564701, -0.41694937, 0.26615718, -0.11857785,
+ 0.024683551, 0.0018054855, 0.017143896, -0.044001563, 0.050065196, -0.029716819, -0.0032594908, 0.029601577,
+ -0.034723419, 0.020572699, -0.00067340378, -0.012185211, 0.010554037, -0.0022469977, -0.0031302016, 0.0028427593,
+ -0.0023746848, 0.0019438091, 0.0016779729, -0.00088047518, -2.0693739e-17, 8.560389100000001e-18, -4.7354788e-18, -1.0263813e-17,
+ 1.0286909e-17, 2.8410305e-18, 2.8973959e-18, 3.0084238e-18, -5.0483408e-18, 6.748686e-19, 1.0579793e-18, -1.0668294e-18,
+ 7.5172508e-19, -8.7941528e-20, -3.5368006e-19, 3.726905e-19, 3.9127407e-19, -2.2086158e-19, -2.5947048e-20, -8.9091678e-20,
+ -2.4548966e-20, 1.9645497e-19, -4.8562499e-20, -1.6401124e-19, 1.1905575e-19, 6.000222099999999e-20, 3.6002571e-20, 1.1443347e-20,
+ -7.0656252e-20, 2.7338021e-20, 2.4165017e-20, -2.1090532e-20, 1.1579904e-21, -4.3668812e-22, -4.3928957e-22, 3.7120868e-22,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.00068393172, -0.0023926981, 0.00072610966, 0.0010990308, -0.0018198967, -0.0019500797, 0.0070152584, -0.0036896504,
+ -0.0065067349, 0.018163296, -0.02497928, 0.011948147, 0.023789348, -0.066379495, 0.083933271, -0.054793027,
+ -0.023683757, 0.12297215, -0.18920335, 0.17105637, -0.049743734, -0.14562801, 0.34847623, -0.48400863,
+ 0.50575808, -0.41704877, 0.26614614, -0.118491, 0.024627691, 0.0018094971, 0.017148822, -0.044012176,
+ 0.050085326, -0.029729752, -0.0032694011, 0.029607998, -0.034723337, 0.020572644, -0.00067351244, -0.012185184,
+ 0.010554055, -0.0022469936, -0.0031302016, 0.0028427628, -0.0023746918, 0.0019438149, 0.0016779778, -0.00088047778,
+ -2.3067914e-17, 5.4003058e-18, -1.251809e-18, -5.2066413e-18, 7.792644200000001e-18, -3.7935423e-19, 3.7777487e-19, 3.4931246e-18,
+ -2.7529126e-18, 5.0329172e-19, 1.6457288e-19, -6.692252e-19, 9.4932395e-19, -6.4945309e-19, 1.0398817e-19, 1.9002636e-19,
+ -1.7541128e-19, -3.5753619e-20, -1.0769248e-20, -1.2646435e-19, 9.2812895e-20, -1.1354876e-19, -3.8668441e-20, 5.710273e-20,
+ -3.4373439e-20, 1.9479008e-20, 9.9343437e-21, -9.122147999999999e-21, 6.8532923e-21, -9.546463e-21, -6.5673988e-21, 2.5025079e-21,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.0010687183, -0.0010450744, -0.0010070066, 0.0020253044, 0.0005517824499999999, -0.0022959155, 0.00097057671, 0.0010924508,
+ -0.0019312501, -0.0017546407, 0.0070874093, -0.0040113854, -0.006331699, 0.018446531, -0.025235592, 0.012062147,
+ 0.02384824, -0.066697913, 0.084157576, -0.054739183, -0.023923087, 0.12315927, -0.18921469, 0.17097969,
+ -0.049615501, -0.14573626, 0.34846795, -0.48391368, 0.5056902599999999, -0.41703911, 0.26615604, -0.11850642,
+ 0.02465109, 0.0017948116, 0.01713781, -0.044004865, 0.050085147, -0.029729697, -0.0032693156, 0.029607987,
+ -0.03472338, 0.020572672, -0.00067355155, -0.012185201, 0.010554082, -0.0022469952, -0.0031302068, 0.0028427695,
+ -0.0023746995, 0.0019438212, 0.0016779833, -0.00088048065, -2.1000047e-17, 7.565723700000001e-18, 2.5190234e-18, -7.738874199999999e-18,
+ 5.1613258e-18, 1.8630382e-18, 4.7500716e-18, 1.5683656e-18, -3.5332673e-18, 2.0768143e-18, -1.4987312e-18, -3.5413893e-21,
+ 2.4420979e-18, -1.345524e-18, 4.3500825e-20, 6.943662e-19, -6.1374977e-19, 1.0242197e-18, 2.718543e-20, -8.3072249e-19,
+ 5.9251615e-19, -4.9885031e-20, -4.0607809e-20, 1.0117644e-19, -2.4097676e-19, 1.301706e-19, 1.0250316e-19, -7.4365919e-20,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.00056402136, 0.00021333467, -0.00091125097, 0.00036685809, 0.0010149448, -0.00096200703, -0.00094793227, 0.0018387994,
+ 0.00040516071, -0.0021710487, 0.0010161009, 0.0009399139400000001, -0.0018566059, -0.0016341052, 0.0069538839, -0.0040202907,
+ -0.0062841631, 0.018383441, -0.02517064, 0.012052401, 0.02377528, -0.066607666, 0.084161445, -0.054781921,
+ -0.02388942, 0.12313141, -0.18921571, 0.17100415, -0.049638042, -0.14572902, 0.34847456, -0.48392014,
+ 0.50569705, -0.41704335, 0.26615332, -0.11850458, 0.02465106, 0.0017948162, 0.0171379, -0.044004883,
+ 0.050085129, -0.029729696, -0.0032693338, 0.029607991, -0.034723382, 0.020572681, -0.00067355989, -0.012185204,
+ 0.010554086, -0.0022469929, -0.0031302058, 0.0028427698, -0.0023747013, 0.0019438227, 0.0016779846, -0.0008804813,
+ -9.379688700000001e-18, 2.6146403e-18, 1.5746634e-18, -1.0728369e-17, 4.5804656e-18, 7.107964500000001e-18, 2.3260764e-18, -1.9169252e-19,
+ -7.0226566e-19, -1.873713e-18, 9.4236304e-19, 4.1572967e-19, -1.2076212e-18, 7.4089255e-19, -2.6527306e-20, -6.578718e-19,
+ 8.7291408e-19, -4.7704746e-21, -8.057007799999999e-20, 1.7753254e-19, -2.2058122e-19, 7.1324509e-20, 6.6889699e-20, -6.6102385e-20,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.00014271253, 0.00023780917, -0.00025714186, -0.00024317058, 0.00057409128, 0.00023010554, -0.00093069112, 0.00027243145,
+ 0.00094306671, -0.00094563757, -0.00092816994, 0.001821437, 0.00041076611, -0.0021577244, 0.00098623583, 0.00091431244,
+ -0.0018365761, -0.0016126829, 0.0069466743, -0.0040339626, -0.0062805659, 0.018399842, -0.025165617, 0.012042197,
+ 0.023770284, -0.066603485, 0.08416202, -0.054785429, -0.023889813, 0.12313399, -0.18921405, 0.17100357,
+ -0.049638649, -0.14572867, 0.34847509, -0.48392049, 0.5056971, -0.4170434, 0.26615338, -0.11850462,
+ 0.024651084, 0.0017947992, 0.017137901, -0.044004876, 0.050085122, -0.029729693, -0.0032693353, 0.02960799,
+ -0.034723382, 0.020572683, -0.00067356152, -0.012185204, 0.010554086, -0.0022469925, -0.0031302055, 0.0028427698,
+ -0.0023747016, 0.0019438229, 0.0016779848, -0.00088048141, -2.8978181e-17, 8.47362e-18, -4.2763004e-18, -6.8278819e-18,
+ 1.0819706e-17, 1.2087701e-18, 1.1162283e-18, 2.1511478e-18, -3.1994618e-18, 5.9178468e-19, 2.1698119e-19, -1.3697938e-18,
+ 9.570426299999999e-19, 1.7932389e-19, 9.624209700000001e-20, 1.6376431e-19, -2.5332735e-19, 9.4050075e-20, 7.611858e-20, -7.3344331e-20,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.0000018447549, 0.000053840851, -0.000026051496, -0.00017560402, 0.00015359699, 0.0002298131, -0.00027785099, -0.00026917927,
+ 0.0005488749299999999, 0.00021718602, -0.00092552858, 0.0002822896, 0.00093939925, -0.00095067092, -0.00093089337, 0.0018096997,
+ 0.00041718788, -0.0021417498, 0.00097583578, 0.00090879181, -0.0018277373, -0.0016127741, 0.006949134, -0.0040349802,
+ -0.0062864137, 0.018404312, -0.025165254, 0.012038182, 0.023772235, -0.066602884, 0.084162157, -0.054785014,
+ -0.023890803, 0.1231346, -0.18921358, 0.17100325, -0.049638615, -0.1457287, 0.34847512, -0.48392051,
+ 0.50569712, -0.41704341, 0.26615339, -0.11850462, 0.024651086, 0.0017947971, 0.017137901, -0.044004875,
+ 0.050085122, -0.029729693, -0.0032693359, 0.02960799, -0.034723382, 0.020572683, -0.00067356177, -0.012185204,
+ 0.010554086, -0.0022469924, -0.0031302055, 0.0028427698, -0.0023747016, 0.0019438229, 0.0016779848, -0.00088048143,
+ -3.6791394e-17, 4.052262e-18, -1.969778e-18, -7.0296556e-18, 9.7759458e-18, -3.3222873e-18, 4.6273224e-19, 5.2111855e-18,
+ -4.4401574e-18, -1.2256545e-18, -5.4477758e-19, -6.7353127e-19, 1.469541e-18, -4.7402283e-19, -4.2509837e-19, 4.3223452e-19,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0000065232055, 3.1277378e-7, 0.0000025601527, -0.000023637333, 0.0000027834083, 0.000051419076, -0.000029530267, -0.00017738859,
+ 0.00015142412, 0.00022660426, -0.00027806924, -0.00026668364, 0.00054837847, 0.0002158698, -0.00092505622, 0.00028086916,
+ 0.00093984668, -0.00094828387, -0.00093257586, 0.0018090192, 0.00041872951, -0.0021422683, 0.00097615257, 0.00090894629,
+ -0.0018286964, -0.0016120872, 0.0069491938, -0.0040356127, -0.0062860363, 0.018404337, -0.025165282, 0.012038277,
+ 0.023772074, -0.066602783, 0.08416222499999999, -0.05478506, -0.023890801, 0.1231346, -0.18921358, 0.17100324,
+ -0.049638612, -0.1457287, 0.34847512, -0.48392051, 0.50569712, -0.41704341, 0.26615339, -0.11850462,
+ 0.024651086, 0.001794797, 0.017137901, -0.044004875, 0.050085122, -0.029729693, -0.003269336, 0.02960799,
+ -0.034723382, 0.020572683, -0.00067356178, -0.012185204, 0.010554086, -0.0022469924, -0.0031302055, 0.0028427698,
+ -0.0023747016, 0.0019438229, 0.0016779848, -0.00088048143, -1.6713031e-17, 5.5425368e-19, 1.4245021e-18, -1.0072591e-18,
+ 5.3286569e-18, 1.4946097e-18, 2.8736484e-19, 9.387527700000001e-19, -4.2179426e-19, -9.975578300000001e-19, -5.809857e-19, -5.1089939e-20,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -0.0000010713313, -0.0000062302572, 0.0000055244516, 0.0000061175856, -0.0000071482518, 3.4513491e-9, 0.0000030429546, -0.000021759169,
+ 0.0000044190563, 0.000051269961, -0.000030117431, -0.00017718171, 0.00015149658, 0.0002263981, -0.00027757249, -0.00026613844,
+ 0.00054793064, 0.00021538327, -0.00092477868, 0.00028111234, 0.00093967287, -0.00094853506, -0.0009326781, 0.0018092101,
+ 0.00041887081, -0.0021424066, 0.00097614709, 0.00090906261, -0.0018287172, -0.0016121413, 0.0069491642, -0.0040356085,
+ -0.0062860096, 0.018404321, -0.0251653, 0.01203829, 0.023772072, -0.066602781, 0.08416222199999999, -0.054785057,
+ -0.023890803, 0.1231346, -0.18921358, 0.17100324, -0.049638612, -0.1457287, 0.34847512, -0.48392051,
+ 0.50569712, -0.41704341, 0.26615339, -0.11850462, 0.024651086, 0.001794797, 0.017137901, -0.044004875,
+ 0.050085122, -0.029729693, -0.003269336, 0.02960799, -0.034723382, 0.020572683, -0.00067356178, -0.012185204,
+ 0.010554086, -0.0022469924, -0.0031302055, 0.0028427698, -0.0023747016, 0.0019438229, 0.0016779848, -0.00088048143,
+ -1.8941367e-17, 1.5711291e-18, 2.3452836e-18, -3.899545e-18, 3.6296061e-18, -1.9151907e-19, -4.1068595e-19, 9.915058199999999e-19,
+ 0.0, 0.0, 0.0, 0.0, },
+ { -9.0889843e-7, -2.2626776e-7, 0.000001260977, 0.0000044608021, -0.0000011469721, -0.0000059094081, 0.0000061283667, 0.0000069729643,
+ -0.000006297129, 3.7634729e-7, 0.0000029524362, -0.00002191209, 0.0000043424749, 0.000051262029, -0.000029845963, -0.00017685033,
+ 0.00015126363, 0.00022604271, -0.00027738458, -0.00026596286, 0.00054779433, 0.00021525271, -0.0009248599599999999, 0.00028119182,
+ 0.0009397919999999999, -0.00094860626, -0.00093268933, 0.001809279, 0.00041885032, -0.0021424302, 0.00097613531, 0.00090905965,
+ -0.0018287021, -0.0016121504, 0.0069491565, -0.0040356031, -0.0062860105, 0.018404322, -0.0251653, 0.01203829,
+ 0.023772071, -0.06660278, 0.08416222199999999, -0.054785057, -0.023890803, 0.1231346, -0.18921358, 0.17100324,
+ -0.049638612, -0.1457287, 0.34847512, -0.48392051, 0.50569712, -0.41704341, 0.26615339, -0.11850462,
+ 0.024651086, 0.001794797, 0.017137901, -0.044004875, 0.050085122, -0.029729693, -0.003269336, 0.02960799,
+ -0.034723382, 0.020572683, -0.00067356178, -0.012185204, 0.010554086, -0.0022469924, -0.0031302055, 0.0028427698,
+ -0.0023747016, 0.0019438229, 0.0016779848, -0.00088048143, 6.1878754e-18, -3.6655866e-18, -2.9841768e-18, 1.9922148e-18,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 1.3144978e-7, 9.8657161e-8, -2.2253182e-7, -5.6333606e-7, -8.9434942e-7, -2.5701115e-7, 0.0000011890586, 0.0000043393418,
+ -0.0000012646187, -0.0000059468393, 0.0000061464536, 0.0000069842975, -0.000006287677, 3.8234005e-7, 0.000002913009, -0.000021955667,
+ 0.000004374943, 0.000051305901, -0.000029868643, -0.00017687301, 0.00015127913, 0.00022606239, -0.00027737419, -0.00026597498,
+ 0.00054778017, 0.00021526158, -0.00092485866, 0.00028118337, 0.00093979398, -0.00094860284, -0.00093268751, 0.0018092791,
+ 0.0004188485, -0.0021424291, 0.00097613632, 0.00090905895, -0.001828702, -0.0016121505, 0.0069491567, -0.0040356032,
+ -0.0062860104, 0.018404322, -0.0251653, 0.01203829, 0.023772071, -0.06660278, 0.08416222199999999, -0.054785057,
+ -0.023890803, 0.1231346, -0.18921358, 0.17100324, -0.049638612, -0.1457287, 0.34847512, -0.48392051,
+ 0.50569712, -0.41704341, 0.26615339, -0.11850462, 0.024651086, 0.001794797, 0.017137901, -0.044004875,
+ 0.050085122, -0.029729693, -0.003269336, 0.02960799, -0.034723382, 0.020572683, -0.00067356178, -0.012185204,
+ 0.010554086, -0.0022469924, -0.0031302055, 0.0028427698, -0.0023747016, 0.0019438229, 0.0016779848, -0.00088048143,
+ 0.0, 0.0, 0.0, 0.0, },
+ { 0.0, 0.0, 0.0, 0.0, -1.622356e-9, -1.2890103e-9, 2.7891217e-9, 6.845241e-9,
+ 1.3126578e-7, 9.901721900000001e-8, -2.2166186e-7, -5.6183755e-7, -8.9289394e-7, -2.5656308e-7, 0.0000011888122, 0.0000043391602,
+ -0.0000012647803, -0.0000059469017, 0.0000061469773, 0.0000069850389, -0.0000062879678, 3.8158828e-7, 0.0000029133662, -0.000021955518,
+ 0.0000043746943, 0.000051306159, -0.000029869367, -0.00017687376, 0.00015128051, 0.00022606404, -0.00027737624, -0.00026598254,
+ 0.00054778393, 0.00021526722, -0.00092486527, 0.00028119529, 0.00093978004, -0.0009486419, -0.00093265228, 0.0018094229,
+ 0.00041867283, -0.0021426906, 0.00097650436, 0.00090964586, -0.0018293513, -0.0016126855, 0.0069502949, -0.0040354262,
+ -0.0062870574, 0.018405222, -0.025164144, 0.012032827, 0.023774346, -0.066591942, 0.084151854, -0.054804601,
+ -0.023862503, 0.12315689, -0.1892543, 0.17095475, -0.049559377, -0.14567882, 0.3483179, -0.4838932,
+ 0.50588033, -0.41713971, 0.26600252, -0.11841888, 0.024871591, 0.0016210723, 0.016891466, -0.043640211,
+ 0.050057842, -0.03006571, -0.0030367974, 0.029556911, -0.034590027, 0.020929563, -0.0012983588, -0.012419997,
+ 0.010951201, -0.002389025, -0.0031262218, 0.0028105997, },
+ { 0.0, 0.0, 0.0, 0.0, -3.6439133e-24, -2.8986979e-24, 6.2660146e-24, 1.5379692e-23,
+ -1.6222016e-9, -1.2888876e-9, 2.7888562e-9, 6.8445893e-9, 1.312523e-7, 9.9007009e-8, -2.2163906e-7, -5.6177991e-7,
+ -8.9272771e-7, -2.5647732e-7, 0.0000011885618, 0.0000043383995, -0.0000012650025, -0.0000059463278, 0.0000061467672, 0.0000069861743,
+ -0.0000062897555, 3.7727988e-7, 0.0000029191314, -0.000021941306, 0.0000043687192, 0.000051291624, -0.000029855051, -0.00017686176,
+ 0.00015125309, 0.0002260747, -0.00027735745, -0.00026608583, 0.00054791784, 0.00021551982, -0.00092512611, 0.00028035321,
+ 0.00094065862, -0.00094742205, -0.00093450757, 0.0018076545, 0.00042131052, -0.0021417278, 0.00097239854, 0.00091159722,
+ -0.0018264239, -0.0016199728, 0.0069502154, -0.0040114121, -0.0063040316, 0.018365516, -0.025118693, 0.012102578,
+ 0.023644377, -0.066685113, 0.084356401, -0.054595596, -0.024125527, 0.12301898, -0.1887722, 0.17066016,
+ -0.050419921, -0.14528907, 0.34913412, -0.4838335, 0.50558311, -0.41643331, 0.26613447, -0.12101845,
+ 0.024625157, 0.0033560726, 0.016841212, -0.041760408, 0.050984407, -0.03285494, -0.004117546, 0.028617951,
+ -0.035237369, 0.023732977, 0.0015240184, -0.008435701800000001, },
+ { 0.0, 0.0, 0.0, 0.0, -1.0431812e-23, -8.2803737e-24, 1.7939522e-23, 4.4007904e-23,
+ 6.4884103e-23, 1.7524634e-23, -8.5803103e-23, -3.2496948e-22, -1.6203806e-9, -1.2874408e-9, 2.7857256e-9, 6.836906e-9,
+ 1.3109947e-7, 9.889150299999999e-8, -2.2138082e-7, -5.611261e-7, -8.9219889e-7, -2.5658335e-7, 0.0000011880548, 0.0000043354995,
+ -0.0000012608301, -0.000005938918, 0.0000061362301, 0.0000069641375, -0.0000062687907, 4.0459468e-7, 0.0000028787034, -0.000021983378,
+ 0.0000044129115, 0.000051289938, -0.000029905595, -0.00017666359, 0.00015087211, 0.00022542775, -0.0002765433, -0.00026376228,
+ 0.00054507147, 0.00021169912, -0.00091924555, 0.00028840249, 0.00093079662, -0.00095471267, -0.00091771013, 0.0018095019,
+ 0.00040700431, -0.0021236987, 0.0009811498199999999, 0.0008245475, -0.0017754444, -0.0014644008, 0.0068040412, -0.0043451443,
+ -0.0058442993, 0.018818003, -0.025939109, 0.011340895, 0.024930389, -0.0661234, 0.082217785, -0.054081764,
+ -0.020897545, 0.12165048, -0.1920747, 0.17211359, -0.048140833, -0.14851256, 0.3472333, -0.47646397,
+ 0.50599354, -0.42288577, 0.26917601, -0.12432367, 0.022587169, 0.010412511, 0.015359906, -0.041565257,
+ 0.055431988, -0.038165138, -0.009985203099999999, 0.018675575, },
+ { 0.0, 0.0, 0.0, 0.0, 3.2812725e-24, 2.5848368e-24, -5.6275193e-24, -1.3782151e-23,
+ -2.3902558e-23, -8.1365251e-24, 3.3008241e-23, 1.1640815e-22, -7.3250277e-23, -1.8762401e-22, 2.2730087e-22, 3.3780674e-22,
+ -1.616205e-9, -1.2841231e-9, 2.778547e-9, 6.8192879e-9, 1.3237482e-7, 9.9918388e-8, -2.2358368e-7, -5.6648665e-7,
+ -8.9932696e-7, -2.5816482e-7, 0.0000011972154, 0.0000043720435, -0.000001292952, -0.0000060081096, 0.0000062263636, 0.000007122935,
+ -0.0000063986485, 2.6724076e-7, 0.0000030929214, -0.000021946257, 0.0000047207535, 0.000052048986, -0.000030742059, -0.00018076981,
+ 0.00015544318, 0.00023291138, -0.00028644303, -0.00028176127, 0.00056447015, 0.0002311271, -0.00095483998, 0.00027379593,
+ 0.00096725386, -0.0009771671, -0.00095367853, 0.0019658873, 0.00033910824, -0.0024180526, 0.0012134667, 0.0015009697,
+ -0.0026057442, -0.0024276335, 0.0084128255, -0.0028188375, -0.008494489799999999, 0.017721873, -0.021825093, 0.010970745,
+ 0.018597655, -0.064282876, 0.08981873999999999, -0.057812995, -0.02662704, 0.12911772, -0.1885168, 0.15985436,
+ -0.050361919, -0.13554452, 0.34264685, -0.47581746, 0.51144248, -0.43326474, 0.2710083, -0.12265704,
+ 0.015729342, 0.016261307, 0.026089652, -0.029242654, },
+ { 0.0, 0.0, 0.0, 0.0, -2.2778956e-24, -1.8076424e-24, 3.9250879e-24, 9.6136326e-24,
+ 2.5282692e-23, 1.2550767e-23, -3.7660392e-23, -1.1740747e-22, -2.9437921e-23, 9.5145047e-23, -4.2770808e-23, 1.4239399e-22,
+ 1.9286708e-23, -4.034217e-22, 3.6553584e-22, 9.7305538e-22, -1.4431934e-9, -1.1466603e-9, 2.481109e-9, 6.0892965e-9,
+ 1.2633458e-7, 9.568202499999999e-8, -2.136268e-7, -5.4014939e-7, -8.7095084e-7, -2.5802661e-7, 0.000001165696, 0.000004230512,
+ -0.0000012146636, -0.0000057632352, 0.0000059410362, 0.000006652386, -0.0000059549064, 6.5404746e-7, 0.0000024605114, -0.000022134786,
+ 0.0000037026798, 0.000049710525, -0.000028167748, -0.00016723509, 0.00014401584, 0.00021121699, -0.00026020494, -0.00023896016,
+ 0.00052168195, 0.0001958936, -0.00088205854, 0.0002546882, 0.0009008995099999999, -0.00085354557, -0.00092916911, 0.0015016721,
+ 0.00054407697, -0.0017561327, 0.0006602936, 0.00048076711, -0.00071974471, -0.0009798873499999999, 0.0049969489, -0.004765169,
+ -0.0048724692, 0.017594955, -0.026661957, 0.015885895, 0.027476655, -0.070054739, 0.081437923, -0.056044498,
+ -0.027087963, 0.12330761, -0.18331454, 0.17796109, -0.049807749, -0.14814388, 0.33642099, -0.49016986,
+ 0.51434408, -0.41486443, 0.27672635, -0.10432054, },
+};
+
+const double* const ff_on2avc_tabs_20_84_1[20] = {
+ tabs_20_84[ 0], tabs_20_84[ 1], tabs_20_84[ 2], tabs_20_84[ 3],
+ tabs_20_84[ 4], tabs_20_84[ 5], tabs_20_84[ 6], tabs_20_84[ 7],
+ tabs_20_84[ 8], tabs_20_84[ 9], tabs_20_84[10], tabs_20_84[11],
+ tabs_20_84[12], tabs_20_84[13], tabs_20_84[14], tabs_20_84[15],
+ tabs_20_84[16], tabs_20_84[17], tabs_20_84[18], tabs_20_84[19]
+};
+
+const double* const ff_on2avc_tabs_20_84_2[20] = {
+ tabs_20_84[20], tabs_20_84[21], tabs_20_84[22], tabs_20_84[23],
+ tabs_20_84[24], tabs_20_84[25], tabs_20_84[26], tabs_20_84[27],
+ tabs_20_84[28], tabs_20_84[29], tabs_20_84[30], tabs_20_84[31],
+ tabs_20_84[32], tabs_20_84[33], tabs_20_84[34], tabs_20_84[35],
+ tabs_20_84[36], tabs_20_84[37], tabs_20_84[38], tabs_20_84[39]
+};
+
+const double* const ff_on2avc_tabs_20_84_3[20] = {
+ tabs_20_84[40], tabs_20_84[41], tabs_20_84[42], tabs_20_84[43],
+ tabs_20_84[44], tabs_20_84[45], tabs_20_84[46], tabs_20_84[47],
+ tabs_20_84[48], tabs_20_84[49], tabs_20_84[50], tabs_20_84[51],
+ tabs_20_84[52], tabs_20_84[53], tabs_20_84[54], tabs_20_84[55],
+ tabs_20_84[56], tabs_20_84[57], tabs_20_84[58], tabs_20_84[59]
+};
+
+const double* const ff_on2avc_tabs_20_84_4[20] = {
+ tabs_20_84[60], tabs_20_84[61], tabs_20_84[62], tabs_20_84[63],
+ tabs_20_84[64], tabs_20_84[65], tabs_20_84[66], tabs_20_84[67],
+ tabs_20_84[68], tabs_20_84[69], tabs_20_84[70], tabs_20_84[71],
+ tabs_20_84[72], tabs_20_84[73], tabs_20_84[74], tabs_20_84[75],
+ tabs_20_84[76], tabs_20_84[77], tabs_20_84[78], tabs_20_84[79]
+};
+
+const float ff_on2avc_ctab_1[2048] = {
+ 2.0, -4.4408921e-16, 1.998863, -0.067429408, 1.9954522, -0.13479699, 1.9897684, -0.20204064,
+ 1.9818133, -0.26909772, 1.9715892, -0.33590481, 1.9590992, -0.40239748, 1.9443476, -0.46851003,
+ 1.9273404, -0.5341754, 1.9080848, -0.59932488, 1.8865899, -0.66388828, 1.8628675, -0.72779351,
+ 1.8369317, -0.79096675, 1.8087995, -0.85333258, 1.7784914, -0.91481382, 1.7460314, -0.9753319,
+ 1.7114476, -1.0348068, 1.6747727, -1.0931578, 1.6360439, -1.1503029, 1.5953034, -1.2061599,
+ 1.5525988, -1.2606467, 1.5079833, -1.3136812, 1.4615158, -1.3651828, 1.4132608, -1.4150716,
+ 1.3632895, -1.4632699, 1.3116785, -1.5097026, 1.2585107, -1.5542974, 1.2038751, -1.5969861,
+ 1.1478662, -1.637704, 1.0905846, -1.6763921, 1.0321362, -1.7129962, 0.97263169, -1.7474687,
+ 0.9121868, -1.7797679, 0.85092157, -1.8098596, 0.78895974, -1.8377171, 0.72642845, -1.8633214,
+ 0.66345739, -1.8866621, 0.60017854, -1.9077374, 0.5367251, -1.9265541, 0.47323114, -1.9431282,
+ 0.4098306, -1.9574846, 0.34665683, -1.9696577, 0.28384155, -1.9796903, 0.22151428, -1.9876345,
+ 0.15980156, -1.993551, 0.09882611, -1.9975084, 0.038706206, -1.9995835, -0.02044509, -1.99986,
+ -0.078520596, -1.9984288, -0.13541964, -1.9953866, -0.19104865, -1.9908354, -0.24532171, -1.984882,
+ -0.29816103, -1.9776367, -0.34949744, -1.9692125, -0.39927062, -1.9597243, -0.44742957, -1.949288,
+ -0.49393275, -1.938019, -0.5387482, -1.9260317, -0.58185375, -1.9134382, -0.62323707, -1.900347,
+ -0.66289538, -1.8868629, -0.70083576, -1.8730848, -0.73707455, -1.8591057, -0.77163762, -1.8450115,
+ -0.80455959, -1.83088, -0.83588386, -1.8167808, -0.8656621, -1.8027737, -0.89395374, -1.7889093,
+ -0.9208256, -1.7752278, -0.94635135, -1.761759, -0.97061092, -1.7485228, -0.99368966, -1.7355278,
+ -1.0156779, -1.7227728, -1.0366703, -1.710247, -1.0567647, -1.6979295, -1.0760615, -1.6857911,
+ -1.0946627, -1.673794, -1.112671, -1.6618937, -1.1301892, -1.650039, -1.1473182, -1.6381736,
+ -1.164157, -1.6262373, -1.1808009, -1.6141669, -1.1973405, -1.6018976, -1.2138611, -1.5893645,
+ -1.2304406, -1.5765032, -1.2471493, -1.5632517, -1.2640481, -1.5495512, -1.2811878, -1.5353475,
+ -1.2986077, -1.5205914, -1.3163352, -1.5052403, -1.3343842, -1.4892588, -1.3527551, -1.4726188,
+ -1.3714331, -1.4553007, -1.390389, -1.4372933, -1.4095774, -1.4185938, -1.4289376, -1.3992081,
+ -1.4483931, -1.3791504, -1.4678518, -1.3584429, -1.4872066, -1.3371153, -1.5063359, -1.3152039,
+ -1.525104, -1.2927508, -1.5433633, -1.2698036, -1.5609542, -1.2464136, -1.5777074, -1.222635,
+ -1.5934458, -1.198524, -1.6079853, -1.1741376, -1.6211381, -1.1495321, -1.6327139, -1.1247627,
+ -1.6425229, -1.0998815, -1.6503778, -1.0749379, -1.656096, -1.0499765, -1.6595027, -1.0250366,
+ -1.6604328, -1.0001521, -1.6587337, -0.97535098, -1.6542674, -0.95065427, -1.6469128, -0.92607677,
+ -1.6365674, -0.90162659, -1.6231499, -0.87730545, -1.6066011, -0.85310918, -1.5868859, -0.82902807,
+ -1.5639942, -0.80504757, -1.5379412, -0.78114909, -1.5087692, -0.75731099, -1.4765463, -0.73350942,
+ -1.4413673, -0.70971948, -1.4033529, -0.68591642, -1.3626487, -0.66207647, -1.3194243, -0.63817829,
+ -1.2738714, -0.61420387, -1.2262026, -0.59013963, -1.1766489, -0.56597722, -1.1254574, -0.54171461,
+ -1.0728892, -0.51735634, -1.0192158, -0.49291453, -0.96471739, -0.468409, -0.90967888, -0.44386747,
+ -0.85438752, -0.41932571, -0.79912966, -0.39482722, -0.74418765, -0.37042305, -0.68983728, -0.34617117,
+ -0.63634455, -0.32213587, -0.58396345, -0.29838684, -0.53293306, -0.27499828, -0.48347571, -0.25204778,
+ -0.43579489, -0.22961509, -0.39007342, -0.20778094, -0.34647217, -0.18662569, -0.30512896, -0.16622795,
+ -0.26615775, -0.14666332, -0.22964823, -0.12800303, -0.19566566, -0.11031273, -0.1642511, -0.093651295,
+ -0.13542198, -0.078069784, -0.10917274, -0.063610479, -0.085476093, -0.050306138, -0.064284235, -0.038179338,
+ -0.04553042, -0.02724205, -0.029130703, -0.017495384, -0.014985808, -0.0089295385, -0.0029831429, -0.0015239252,
+ 0.0070011336, 0.0047524893, 0.015099987, 0.0099406661, 0.021453392, 0.014090803, 0.026206236, 0.017261485,
+ 0.029506302, 0.019518688, 0.03150234, 0.020934677, 0.032342274, 0.021586809, 0.032171525, 0.021556264,
+ 0.031131554, 0.020926755, 0.029358514, 0.019783208, 0.026982145, 0.018210486, 0.024124846, 0.016292138,
+ 0.020900913, 0.014109233, 0.017415999, 0.011739281, 0.013766737, 0.0092552658, 0.010040524, 0.0067248093,
+ 0.006315473, 0.0042094728, 0.0026604859, 0.0017642101, -0.00086453988, -0.00056303042, -0.004208413, -0.0027315477,
+ -0.0073282644, -0.0047079842, -0.010189103, -0.0064662765, -0.01276332, -0.0079874769, -0.015030168, -0.009259454,
+ -0.016975222, -0.01027649, -0.018589836, -0.01103879, -0.019870605, -0.011551925, -0.020818852, -0.011826212,
+ -0.021440107, -0.011876071, -0.02174365, -0.011719362, -0.021742038, -0.011376713, -0.021450687, -0.010870866,
+ -0.020887457, -0.010226041, -0.020072276, -0.0094673438, -0.019026764, -0.0086202007, -0.017773898, -0.0077098534,
+ -0.016337669, -0.0067608948, -0.014742769, -0.0057968628, -0.013014285, -0.0048398855, -0.011177403, -0.0039103772,
+ -0.0092571331, -0.0030267884, -0.0072780494, -0.002205404, -0.0052640433, -0.0014601871, -0.0032381038, -0.00080267049,
+ -0.0012221149, -0.00024189093, 0.00076331489, 0.00021563418, 0.0026989998, 0.00056588947, 0.0045672944, 0.00080730428,
+ 0.0063521829, 0.00094065693, 0.0080393394, 0.00096894189, 0.0096161636, 0.00089720206, 0.011071794, 0.00073232828,
+ 0.012397096, 0.00048283004, 0.013584645, 0.00015858111, 0.014628679, -0.00022945412, 0.015525063, -0.00066950807,
+ 0.016271239, -0.0011493041, 0.016866164, -0.0016563499, 0.017310271, -0.0021782229, 0.017605407, -0.0027028411,
+ 0.017754791, -0.0032187088, 0.017762953, -0.0037151384, 0.017635692, -0.0041824332, 0.017380001, -0.0046120379,
+ 0.017004017, -0.0049966443, 0.016516931, -0.0053302632, 0.015928905, -0.0056082504, 0.015250954, -0.0058273012,
+ 0.014494829, -0.0059854095, 0.013672867, -0.0060818009, 0.012797831, -0.0061168405, 0.011882732, -0.0060919276,
+ 0.010940637, -0.0060093803, 0.0099844718, -0.0058723139, 0.0090268105, -0.0056845243, 0.0080796788, -0.0054503735,
+ 0.0071543544, -0.005174689, 0.006261189, -0.0048626713, 0.0054094414, -0.0045198193, 0.0046071433, -0.0041518649,
+ 0.0038609891, -0.0037647239, 0.0031762596, -0.0033644575, 0.0025567838, -0.0029572411, 0.0020049347, -0.00254934,
+ 0.0015216633, -0.0021470881, 0.0011065686, -0.0017568644, 0.00075800065, -0.0013850661, 0.0004731935, -0.0010380755,
+ 0.00024842433, -0.00072221586, 0.00007919284, -0.00044369671, -0.000039584535, -0.00020854612, -0.0001133715, -0.000022529672,
+ -0.0001478067, 0.000108944, -0.00014850247, 0.00018093004, -0.0001208542, 0.00018906515, -0.000069866226, 0.00012969374,
+ -2.220446e-16, -5.5511151e-17, 0.000084950341, -0.00020185817, 0.00018195057, -0.00047661722, 0.00028878354, -0.0008237827,
+ 0.00040406833, -0.0012415157, 0.00052723964, -0.0017265369, 0.00065848755, -0.0022740522, 0.00079865806, -0.0028777081,
+ 0.00094911765, -0.0035295789, 0.0011115847, -0.0042201951, 0.0012879343, -0.0049386127, 0.0014799823, -0.0056725289,
+ 0.0016892579, -0.0064084502, 0.0019167721, -0.0071319067, 0.002162795, -0.0078277159, 0.0024266504, -0.0084802955,
+ 0.0027065387, -0.0090740146, 0.0029994014, -0.0095935827, 0.0033008344, -0.010024459, 0.0036050577, -0.01035328,
+ 0.003904952, -0.010568285, 0.0041921646, -0.010659733, 0.0044572824, -0.010620279, 0.0046900786, -0.01044532,
+ 0.0048798202, -0.010133266, 0.0050156307, -0.0096857436, 0.0050868993, -0.0091077117, 0.0050837183, -0.0084074708,
+ 0.0049973316, -0.0075965733, 0.0048205811, -0.0066896221, 0.0045483187, -0.0057039633, 0.0041777813, -0.0046592737,
+ 0.0037088934, -0.0035770566, 0.0031444894, -0.002480061, 0.0024904367, -0.0013916414, 0.0017556528, -0.0003350777,
+ 0.0009520037, 0.00066711544, 0.000094088718, 0.0015938688, -0.00080108939, 0.0024262008, -0.0017145583, 0.0031477951,
+ -0.0026259006, 0.0037454946, -0.00351385, 0.0042096875, -0.0043569384, 0.0045345738, -0.0051341685, 0.0047182986,
+ -0.0058256849, 0.0047629494, -0.0064134183, 0.0046744202, -0.0068816775, 0.0044621397, -0.0072176624, 0.0041386886,
+ -0.0074118823, 0.0037193133, -0.0074584596, 0.0032213603, -0.00735531, 0.0026636559, -0.0071041943, 0.0020658553,
+ -0.006710636, 0.0014477872, -0.0061837193, 0.00082882162, -0.0055357711, 0.00022728172, -0.0047819447, -0.00034007721,
+ -0.0039397213, -0.00085850636, -0.0030283579, -0.0013156059, -0.0020682951, -0.0017015649, -0.0010805541, -0.0020092935,
+ -0.000086142623, -0.0022344531, 0.00089450512, -0.0023753855, 0.0018420418, -0.0024329573, 0.0027386551, -0.0024103273,
+ 0.0035684374, -0.0023126558, 0.0043176766, -0.0021467698, 0.0049750544, -0.0019208054, 0.0055317623, -0.0016438378,
+ 0.0059815329, -0.0013255208, 0.0063205939, -0.00097574567, 0.0065475609, -0.00060433155, 0.0066632666, -0.00022075657,
+ 0.0066705542, 0.00016606481, 0.0065740347, 0.0005479547, 0.0063798288, 0.000917595, 0.0060953014, 0.0012686022,
+ 0.0057287971, 0.0015955586, 0.0052893902, 0.0018940041, 0.0047866534, 0.0021603971, 0.0042304504, 0.0023920508,
+ 0.0036307548, 0.0025870528, 0.0029974992, 0.0027441746, 0.0023404511, 0.0028627797, 0.0016691157, 0.0029427363,
+ 0.00099266251, 0.0029843359, 0.00031987071, 0.0029882274, -0.0003409097, 0.0029553634, -0.00098178594, 0.0028869633,
+ -0.0015953446, 0.0027844929, -0.0021746708, 0.0026496551, -0.0027133694, 0.0024843954, -0.0032055897, 0.0022909143,
+ -0.0036460557, 0.0020716845, -0.0040301029, 0.001829469, -0.0043537221, 0.0015673359, -0.0046136077, 0.0012886674,
+ -0.0048072096, 0.00099715649, -0.0049327859, 0.00069679262, -0.0049894531, 0.000391832, -0.0049772309, 0.000086752072,
+ -0.0048970757, -0.00021380912, -0.0047509046, -0.00050512824, -0.0045416015, -0.00078248454, -0.0042730039, -0.0010412579,
+ -0.0039498731, -0.0012770331, -0.0035778389, -0.0014857076, -0.0031633279, -0.0016635971, -0.0027134682, -0.001807537,
+ -0.0022359758, -0.0019149748, -0.0017390279, -0.0019840484, -0.0012311181, -0.0020136512, -0.00072090683, -0.0020034772,
+ -0.0002170627, -0.0019540484, 0.00027189584, -0.0018667208, 0.00073775765, -0.00174367, 0.0011727696, -0.0015878571,
+ 0.0015697783, -0.0014029766, 0.001922359, -0.0011933852, 0.0022249303, -0.00096401788, 0.0024728517, -0.00072028884,
+ 0.0026625025, -0.00046798357, 0.0027913428, -0.00021314165, 0.0028579531, 0.000038065922, 0.0028620549, 0.00027946298,
+ 0.0028045103, 0.00050499593, 0.0026873015, 0.00070886087, 0.0025134915, 0.00088562793, 0.0022871648, 0.0010303608,
+ 0.0020133494, 0.0011387296, 0.0016979213, 0.0012071145, 0.0013474913, 0.0012326987, 0.00096927787, 0.0012135465,
+ 0.00057096494, 0.001148668, 0.00016054846, 0.0010380625, -0.00025382591, 0.00088274491, -0.00066403102, 0.00068474718,
+ -0.0010621285, 0.0004470984, -0.001440537, 0.00017377918, -0.0017921957, -0.00013034795, -0.0021107141, -0.00045963225,
+ -0.0023905102, -0.00080775097, -0.0026269264, -0.0011678453, -0.0028163234, -0.0015326737, -0.002956148, -0.0018947766,
+ -0.003044971, -0.0022466506, -0.0030824956, -0.0025809242, -0.0030695351, -0.0028905307, -0.003007961, -0.0031688737,
+ -0.0029006239, -0.0034099782, -0.0027512501, -0.0036086228, -0.0025643157, -0.0037604517, -0.0023449084, -0.0038620592,
+ -0.0020985759, -0.0039110477, -0.0018311698, -0.003906057, -0.0015486911, -0.0038467669, -0.0012571397, -0.0037338703,
+ -0.00096237543, -0.0035690248, -0.00066999131, -0.003354782, -0.00038520579, -0.003094499, -0.00011277314, -0.0027922371,
+ 0.00014308578, -0.0024526515, 0.00037873242, -0.0020808775, 0.00059113972, -0.0016824141, 0.0007779033, -0.0012630108,
+ 0.00093723694, -0.00082856242, 0.0010679543, -0.00038500843, 0.0011694405, 0.000061755964, 0.0012416149, 0.00050595973,
+ 0.0012848899, 0.00094202528, 0.0013001257, 0.0013646283, 0.0012885842, 0.0017687485, 0.0012518835, 0.0021497128,
+ 0.0011919539, 0.0025032314, 0.0011109948, 0.0028254308, 0.0010114345, 0.0031128798, 0.00089589041, 0.0033626144,
+ 0.00076713093, 0.0035721601, 0.00062803685, 0.0037395512, 0.00048156266, 0.0038633479, 0.00033069632, 0.0039426503,
+ 0.00017841732, 0.0039771087, 0.000027653001, 0.0039669303, -0.00011876698, 0.0039128768, -0.00025815735, 0.0038162593,
+ -0.00038802426, 0.0036789209, -0.00050611183, 0.0035032146, -0.00061044592, 0.003291968, -0.00069937482, 0.0030484418,
+ -0.00077160395, 0.0027762763, -0.00082622346, 0.0024794317, -0.00086272735, 0.0021621194, -0.0008810226, 0.0018287286,
+ -0.00088142743, 0.0014837491, -0.00086465816, 0.0011316916, -0.00083180465, 0.00077700929, -0.00078429491, 0.0004240229,
+ -0.00072384975, 0.000076850592, -0.00065242866, -0.00026065443, -0.00057216937, -0.00058495684, -0.00048532296, -0.0008928816,
+ -0.00039418644, -0.0011816447, -0.00030103643, -0.0014488718, -0.00020806548, -0.0016926047, -0.0001173238, -0.0019112971,
+ -0.000030668409, -0.0021038, 0.000050278504, -0.0022693386, 0.00012416096, -0.0024074819, 0.00018990933, -0.0025181088,
+ 0.00024674923, -0.0026013714, 0.00029419933, -0.0026576561, 0.00033205902, -0.0026875495, 0.0003603872, -0.0026918037,
+ 0.00037947373, -0.0026713097, 0.00038980544, -0.0026270729, 0.00039202863, -0.0025601962, 0.00038691019, -0.0024718693,
+ 0.00037529902, -0.0023633612, 0.00035808972, -0.0022360198, 0.00033618973, -0.0020912744, 0.00031049116, -0.001930638,
+ 0.00028184787, -0.0017557153, 0.0002510584, -0.0015682059, 0.0002188544, -0.001369908, 0.00018589437, -0.0011627187,
+ 0.00015276202, -0.00094863074, 0.00011996848, -0.00072972412, 0.000087957334, -0.00050815433, 0.000057111374, -0.00028613486,
+ 0.000027760274, -0.00006591557, 1.8815049e-7, 0.00015024227, -0.000025359737, 0.00036009445, -0.000048671653, 0.00056144409,
+ -0.000069565853, 0.0007521729, -0.000087888977, 0.00093027257, -0.00010351629, 0.0010938746, -0.00011635367, 0.0012412785,
+ -0.0001263407, 0.0013709769, -0.0001334548, 0.0014816767, -0.0001377154, 0.001572317, -0.00013918804, 0.0016420815,
+ -0.00013798742, 0.0016904076, -0.00013427943, 0.0017169899, -0.0001282813, 0.0017217799, -0.00012026003, 0.0017049827,
+ -0.00011052855, 0.0016670482, -0.000099440098, 0.0016086611, -0.000087380431, 0.0015307277, -0.000074758427, 0.0014343602,
+ -0.000061995306, 0.0013208598, -0.000049512866, 0.0011916994, -0.000037721158, 0.0010485043, -0.000027006179, 0.00089303311,
+ -0.000017717955, 0.00072715874, -0.000010159566, 0.0005528488, -0.0000045775087, 0.00037214643, -0.0000011537802, 0.00018715112,
+};
+
+const float ff_on2avc_ctab_2[2048] = {
+ 6.1062266e-16, -0.0047176247, 0.000025801086, 0.00017171795, 0.00010278686, 0.00033237049, 0.00022971108, 0.00047108173,
+ 0.00040451737, 0.00057735282, 0.00062436966, 0.00064124417, 0.00088569394, 0.00065355049, 0.0011842304, 0.0006059666,
+ 0.0015150951, 0.00049124041, 0.0018728492, 0.00030331188, 0.0022515757, 0.000037434522, 0.0026449619, -0.00030972183,
+ 0.0030463862, -0.00073999004, 0.003449009, -0.0012536477, 0.0038458654, -0.0018493842, 0.0042299605, -0.0025242937,
+ 0.0045943661, -0.0032738955, 0.0049323193, -0.0040921802, 0.0052373176, -0.0049716844, 0.0055032219, -0.0059035895,
+ 0.0057243509, -0.0068778461, 0.005895582, -0.0078833178, 0.006012449, -0.0089079468, 0.0060712346, -0.0099389348,
+ 0.0060690674, -0.010962932, 0.0060040066, -0.01196624, 0.0058751269, -0.01293501, 0.0056825895, -0.013855449,
+ 0.0054277065, -0.014714016, 0.005112987, -0.015497606, 0.0047421698, -0.016193733, 0.0043202331, -0.016790686,
+ 0.0038533837, -0.017277677, 0.0033490176, -0.017644968, 0.0028156566, -0.017883981, 0.0022628529, -0.017987385,
+ 0.0017010663, -0.017949177, 0.0011415118, -0.017764734, 0.00059597875, -0.017430862, 0.000076625569, -0.016945831,
+ -0.00040424766, -0.016309388, -0.00083444483, -0.015522776, -0.0012021317, -0.014588747, -0.0014961021, -0.013511552,
+ -0.0017060443, -0.012296947, -0.0018228046, -0.010952174, -0.001838639, -0.0094859507, -0.0017474507, -0.0079084486,
+ -0.0015450044, -0.0062312619, -0.0012291165, -0.0044673691, -0.0007998143, -0.0026310843, -0.00025946245, -0.00073799869,
+ 0.00038714762, 0.0011950907, 0.0011327467, 0.003150264, 0.0019675777, 0.0051085735, 0.002879428, 0.007050151,
+ 0.0038537064, 0.0089543248, 0.0048735668, 0.010799746, 0.0059200767, 0.012564532, 0.0069724373, 0.014226408,
+ 0.0080082528, 0.015762862, 0.0090038506, 0.017151318, 0.0099346545, 0.018369311, 0.010775609, 0.019394677,
+ 0.011501653, 0.020205766, 0.012088243, 0.020781681, 0.012511919, 0.021102531, 0.012750908, 0.021149736,
+ 0.012785755, 0.020906361, 0.012599968, 0.020357504, 0.012180677, 0.019490732, 0.011519265, 0.018296573,
+ 0.010611986, 0.016769076, 0.0094605172, 0.014906418, 0.0080724526, 0.012711582, 0.006461692, 0.010193078,
+ 0.0046487241, 0.0073657078, 0.0026607637, 0.0042513679, 0.0005317349, 0.00087985705, -0.0016979208, -0.0027103117,
+ -0.0039816312, -0.0064711315, -0.0062672808, -0.010344372, -0.0084980074, -0.014260936, -0.010613214, -0.018140316,
+ -0.012549785, -0.02189021, -0.0142435, -0.02540629, -0.015630638, -0.028572179, -0.016649729, -0.031259675,
+ -0.017243449, -0.033329193, -0.017360613, -0.034630522, -0.016958216, -0.035003848, -0.016003506, -0.03428109,
+ -0.014476006, -0.032287523, -0.012369478, -0.028843746, -0.0096937334, -0.023767876, -0.0064762742, -0.016878078,
+ -0.0027636932, -0.0079952935, 0.0013771985, 0.0030537986, 0.0058585741, 0.016433664, 0.010571149, 0.032296669,
+ 0.015384134, 0.050779779, 0.020145604, 0.072001241, 0.024683299, 0.096057333, 0.028805861, 0.12301921,
+ 0.032304518, 0.15292998, 0.034955185, 0.18580194, 0.036520973, 0.22161427, 0.036755085, 0.26031092,
+ 0.035404034, 0.30179903, 0.032211188, 0.34594777, 0.026920509, 0.39258778, 0.019280523, 0.44151106,
+ 0.0090483893, 0.49247134, -0.004005983, 0.54518533, -0.020095825, 0.59933424, -0.039413493, 0.65456611,
+ -0.062126629, 0.71049863, -0.088374533, 0.76672238, -0.11826489, 0.82280493, -0.1518708, 0.87829489,
+ -0.18922837, 0.93272704, -0.23033462, 0.98562711, -0.27514613, 1.0365173, -0.32357812, 1.084922,
+ -0.37550423, 1.1303729, -0.43075687, 1.1724157, -0.48912829, 1.210615, -0.55037224, 1.2445599,
+ -0.61420608, 1.2738692, -0.68031394, 1.2981967, -0.74834985, 1.3172354, -0.81794167, 1.330721,
+ -0.8886956, 1.3384365, -0.96020055, 1.3402138, -1.0320334, 1.3359363, -1.1037641, 1.3255405,
+ -1.1749605, 1.3090167, -1.2451944, 1.2864087, -1.3140464, 1.257813, -1.3811105, 1.2233779,
+ -1.4460001, 1.1833013, -1.5083516, 1.1378273, -1.5678285, 1.0872437, -1.6241266, 1.0318775,
+ -1.6769751, 0.97209138, -1.7261413, 0.90827817, -1.7714316, 0.84085637, -1.8126934, 0.77026486,
+ -1.8498163, 0.69695753, -1.882732, 0.62139785, -1.9114146, 0.54405344, -1.9358792, 0.46539098,
+ -1.9561808, 0.38587096, -1.9724123, 0.3059431, -1.9847021, 0.22604167, -1.9932109, 0.14658169,
+ -1.9981292, 0.067955181, -1.9996731, -0.00947183, -1.9980807, -0.085361861, -1.9936082, -0.15940794,
+ -1.9865264, -0.23133504, -1.9771156, -0.30090088, -1.9656627, -0.36789626, -1.952457, -0.43214479,
+ -1.9377865, -0.49350214, -1.9219347, -0.55185497, -1.905178, -0.60711914, -1.8877819, -0.65923816,
+ -1.8699998, -0.70818067, -1.8520706, -0.75393814, -1.8342167, -0.79652262, -1.8166438, -0.83596373,
+ -1.7995393, -0.87230623, -1.7830721, -0.9056074, -1.7673923, -0.93593466, -1.7526317, -0.96336293,
+ -1.7389038, -0.98797268, -1.7263044, -1.0098475, -1.7149128, -1.0290729, -1.7047921, -1.0457342,
+ -1.6959906, -1.0599151, -1.6885422, -1.0716969, -1.6824687, -1.0811574, -1.677779, -1.0883702,
+ -1.6744717, -1.0934039, -1.6725357, -1.0963222, -1.67195, -1.0971831, -1.6726862, -1.0960395,
+ -1.6747082, -1.0929389, -1.6779734, -1.0879233, -1.6824325, -1.08103, -1.6880317, -1.0722916,
+ -1.6947116, -1.0617367, -1.7024086, -1.04939, -1.7110549, -1.0352732, -1.7205796, -1.0194054,
+ -1.730908, -1.0018036, -1.7419629, -0.9824838, -1.7536641, -0.96146131, -1.7659295, -0.93875134,
+ -1.7786744, -0.91437006, -1.7918122, -0.88833487, -1.8052548, -0.86066544, -1.8189124, -0.83138382,
+ -1.8326937, -0.80051541, -1.8465064, -0.76808912, -1.860257, -0.73413789, -1.8738515, -0.69869894,
+ -1.8871957, -0.66181415, -1.9001952, -0.62353003, -1.9127564, -0.58389789, -1.924787, -0.54297411,
+ -1.9361968, -0.50081998, -1.946898, -0.45750189, -1.9568071, -0.41309139, -1.9658449, -0.36766547,
+ -1.9739379, -0.32130671, -1.9810196, -0.27410358, -1.9870309, -0.22615109, -1.9919212, -0.17755121,
+ -1.9956495, -0.12841354, -1.9981841, -0.078856133, -1.9995037, -0.029006185, -1.9995972, 0.020999053,
+ -1.9984629, 0.071011581, -1.9961088, 0.12087195, -1.9925506, 0.17040877, -1.9878117, 0.21943836,
+ -1.9819202, 0.26776481, -1.9749084, 0.31518021, -1.9668094, 0.36146545, -1.9576563, 0.40639135,
+ -1.9474785, 0.44972011, -1.9363006, 0.49120751, -1.9241393, 0.53060538, -1.9110016, 0.5676645,
+ -1.8968834, 0.60213798, -1.8817675, 0.63378489, -1.8656229, 0.6623742, -1.8484042, 0.68768901,
+ -1.8300512, 0.70953059, -1.8104898, 0.7277227, -1.7896332, 0.74211556, -1.7673825, 0.75258982,
+ -1.7436302, 0.75905991, -1.718262, 0.76147729, -1.6911598, 0.75983286, -1.6622057, 0.75415885,
+ -1.6312853, 0.7445302, -1.598292, 0.73106503, -1.5631305, 0.71392417, -1.5257218, 0.69331038,
+ -1.4860063, 0.66946632, -1.4439477, 0.64267194, -1.3995371, 0.6132409, -1.3527952, 0.58151656,
+ -1.3037754, 0.54786724, -1.2525655, 0.51268071, -1.199289, 0.47635838, -1.1441054, 0.43930924,
+ -1.0872105, 0.40194324, -1.0288347, 0.36466473, -0.96924144, 0.32786602, -0.90872473, 0.2919209,
+ -0.84760505, 0.25717854, -0.7862255, 0.22395785, -0.7249468, 0.19254236, -0.66414177, 0.16317582,
+ -0.60418916, 0.13605864, -0.54546744, 0.11134519, -0.4883481, 0.089142092, -0.43318909, 0.069507554,
+ -0.38032803, 0.052451812, -0.33007616, 0.037938587, -0.28271216, 0.025887616, -0.23847705, 0.016178153,
+ -0.19756962, 0.0086534023, -0.16014262, 0.0031256941, -0.12630016, -0.00061766239, -0.096096113, -0.0028080596,
+ -0.069533631, -0.003688961, -0.046565846, -0.0035091597, -0.027097713, -0.0025161188, -0.010989046, -0.00094958977,
+ 0.0019415142, 0.00096430612, 0.011911541, 0.0030183611, 0.019169118, 0.0050287801, 0.023986517, 0.006838772,
+ 0.026653459, 0.0083211483, 0.027470166, 0.0093798656, 0.026740402, 0.0099505046, 0.0247647, 0.0099997027,
+ 0.021834008, 0.0095235975, 0.018223884, 0.0085453819, 0.014189421, 0.0071120788, 0.0099610332, 0.0052907071,
+ 0.0057411729, 0.0031639794, 0.0017020478, 0.00082572823, -0.0020156475, -0.0016237673, -0.0053030066, -0.0040823757,
+ -0.0080822473, -0.0064504636, -0.01030519, -0.0086348522, -0.011950996, -0.010552257, -0.013023298, -0.012132118,
+ -0.013546856, -0.013318742, -0.013563911, -0.014072724, -0.013130371, -0.014371663, -0.012311992, -0.014210164,
+ -0.011180677, -0.013599193, -0.0098110167, -0.012564868, -0.0082771704, -0.011146758, -0.0066501619, -0.0093958043,
+ -0.0049956408, -0.0073719709, -0.0033721365, -0.0051417369, -0.0018298116, -0.0027755348, -0.00040969814, -0.00034523915,
+ 0.00085661822, 0.0020782049, 0.0019469126, 0.004426945, 0.002847892, 0.0066381125, 0.0035544888, 0.0086554019,
+ 0.0040689427, 0.010430313, 0.0043997411, 0.011923047, 0.0045604752, 0.013103063, 0.0045686788, 0.013949312,
+ 0.0044446858, 0.014450175, 0.0042105624, 0.014603134, 0.0038891311, 0.014414242, 0.0035031161, 0.01389739,
+ 0.0030744188, 0.01307346, 0.0026235317, 0.011969374, 0.0021690836, 0.010617082, 0.0017275107, 0.009052542,
+ 0.0013128433, 0.0073146918, 0.00093659078, 0.0054444592, 0.0006077115, 0.0034838144, 0.00033265035, 0.0014748911,
+ 0.00011543075, -0.00054083008, -0.000042213407, -0.0025232558, -0.00014067636, -0.0044343388, -0.00018229883, -0.0062386589,
+ -0.00017117237, -0.0079039233, -0.00011293451, -0.0094013978, -0.000014556788, -0.010706257, 0.00011587302, -0.011797872,
+ 0.00026937437, -0.012660023, 0.00043630364, -0.013281046, 0.0006065903, -0.013653914, 0.00076997973, -0.013776246,
+ 0.00091628113, -0.013650244, 0.0010356199, -0.013282579, 0.0011186899, -0.012684184, 0.0011570023, -0.011869996,
+ 0.0011431255, -0.010858623, 0.0010709089, -0.0096719572, 0.00093568477, -0.0083347168, 0.00073444104, -0.0068739466,
+ 0.00046595652, -0.0053184745, 0.00013089461, -0.0036983292, -0.00026815146, -0.002044142, -0.00072666444, -0.00038653665,
+ -0.001238263, 0.0012444736, -0.0017948141, 0.0028200729, -0.0023865986, 0.0043131965, -0.0030025232, 0.0056990399,
+ -0.0036303743, 0.0069555123, -0.0042571067, 0.0080636218, -0.0048691588, 0.0090077901, -0.0054527833, 0.0097760875,
+ -0.0059943851, 0.010360379, -0.0064808549, 0.010756395, -0.0068998942, 0.010963713, -0.0072403145, 0.010985666,
+ -0.0074923136, 0.010829174, -0.0076477141, 0.010504506, -0.0077001643, 0.010024985, -0.0076453011, 0.0094066458,
+ -0.0074808616, 0.0086678378, -0.0072067594, 0.0078288056, -0.0068251076, 0.0069112377, -0.0063402043, 0.0059377975,
+ -0.0057584713, 0.0049316445, -0.0050883559, 0.0039159562, -0.004340189, 0.0029134497, -0.0035260066, 0.0019459217,
+ -0.002659336, 0.001033804, -0.0017549467, 0.00019574871, -0.00082857109, -0.00055175176, 0.00010340517, -0.0011947021,
+ 0.0010242764, -0.0017218908, 0.0019173701, -0.0021251177, 0.0027664138, -0.0023993575, 0.0035559093, -0.0025428517,
+ 0.0042715017, -0.0025571233, 0.0049003414, -0.0024469129, 0.0054314188, -0.0022200351, 0.0058558695, -0.0018871534,
+ 0.0061672316, -0.0014614828, 0.0063616517, -0.00095842173, 0.0064380248, -0.00039512504, 0.0063980608, 0.00020997033,
+ 0.0062462785, 0.00083765347, 0.0059899129, 0.0014684666, 0.005638747, 0.0020832333, 0.0052048638, 0.0026635726,
+ 0.0047023292, 0.0031923822, 0.0041468102, 0.0036542746, 0.0035551451, 0.0040359539, 0.0029448776, 0.0043265228,
+ 0.0023337679, 0.0045177112, 0.0017393016, 0.0046040174, 0.001178207, 0.0045827716, 0.00066600286, 0.0044541075,
+ 0.00021658542, 0.004220861, -0.0001581293, 0.0038883933, -0.0004484996, 0.0034643558, -0.00064738019, 0.0029584002,
+ -0.00075026811, 0.0023818521, -0.000755371, 0.0017473593, -0.00066359824, 0.0010685247, -0.00047847957, 0.00035953996,
+ -0.00020601597, -0.00036517272, 0.00014552828, -0.0010913002, 0.00056588452, -0.0018049506, 0.001043079, -0.0024929349,
+ 0.0015637625, -0.0031430104, 0.0021135611, -0.003744086, 0.0026774362, -0.0042863889, 0.0032400466, -0.0047615874,
+ 0.0037861052, -0.0051628826, 0.0043007191, -0.005485056, 0.0047697132, -0.0057244869, 0.0051799244, -0.00587914,
+ 0.0055194702, -0.0059485212, 0.0057779811, -0.0059336093, 0.005946802, -0.0058367676, 0.006019149, -0.0056616301,
+ 0.0059902342, -0.0054129749, 0.0058573456, -0.0050965813, 0.0056198868, -0.0047190739, 0.0052793743, -0.0042877593,
+ 0.0048393975, -0.0038104532, 0.0043055299, -0.0032953112, 0.0036852097, -0.0027506526, 0.0029875766, -0.002184795,
+ 0.0022232747, -0.0016058958, 0.0014042265, -0.0010218052, 0.00054337748, -0.00043993912, -0.00034557868, 0.00013282956,
+ -0.0012484904, 0.00069025467, -0.0021510462, 0.0012267748, -0.0030390718, 0.0017375433, -0.0038988206, 0.0022184309,
+ -0.0047172462, 0.0026660003, -0.0054822522, 0.0030774584, -0.0061829095, 0.0034505837, -0.0068096397, 0.0037836414,
+ -0.0073543512, 0.004075285, -0.0078105354, 0.0043244553, -0.008173313, 0.0045302799, -0.0084394356, 0.0046919878,
+ -0.0086072432, 0.004808831, -0.0086765829, 0.00488004, -0.0086486926, 0.0049047922, -0.0085260663, 0.004882222,
+ -0.0083122877, 0.0048114532, -0.0080118719, 0.0046916641, -0.0076300949, 0.0045221797, -0.0071728369, 0.0043025846,
+ -0.0066464432, 0.0040328531, -0.0060576024, 0.0037134863, -0.0054132543, 0.0033456483, -0.0047205254, 0.0029312912,
+ -0.0039866935, 0.0024732621, -0.0032191742, 0.0019753794, -0.0024255351, 0.0014424763, -0.001613521, 0.0008803992,
+ -0.00079109054, 0.00029596357, 0.00003354808, -0.00030313883, 0.00085190887, -0.00090847781, 0.001655216, -0.0015110652,
+ 0.0024344153, -0.0021015715, 0.0031802151, -0.002670571, 0.0038831618, -0.0032088049, 0.00453375, -0.0037074534,
+ 0.0051225699, -0.0041584023, 0.0056404881, -0.0045544938, 0.0060788556, -0.0048897523, 0.0064297421, -0.0051595722,
+ 0.0066861785, -0.005360858, 0.006842406, -0.0054921173, 0.0068941191, -0.0055534914, 0.0068386863, -0.0055467347,
+ 0.0066753477, -0.0054751309, 0.0064053647, -0.005343359, 0.0060321307, -0.0051573105, 0.0055612195, -0.0049238643,
+ 0.0050003757, -0.0046506319, 0.0043594413, -0.0043456783, 0.0036502162, -0.0040172371, 0.002886259, -0.0036734226,
+ 0.0020826256, -0.0033219547, 0.0012555593, -0.002969909, 0.00042213459, -0.0026234936, -0.0004001323, -0.0022878707,
+ -0.0011936954, -0.0019670199, -0.0019414022, -0.0016636539, -0.0026269152, -0.0013791855, -0.0032351194, -0.0011137482,
+ -0.0037525038, -0.00086626812, -0.0041675051, -0.00063458277, -0.0044708052, -0.00041560392, -0.0046555689, -0.00020551546,
+};
+
+const float ff_on2avc_ctab_3[2048] = {
+ -1.6653345e-16, -0.0028429052, -0.000042537456, 0.00019487554, -0.00016862253, 0.00040306276, -0.00037372447, 0.00063729816,
+ -0.0006504606, 0.00090918731, -0.00098884385, 0.0012286865, -0.0013766177, 0.0016036412, -0.0017996682, 0.0020393939,
+ -0.0022425, 0.0025384782, -0.0026887599, 0.0031004087, -0.0031217942, 0.0037215743, -0.0035252157, 0.0043952391,
+ -0.0038834687, 0.0051116538, -0.0041823699, 0.005858277, -0.0044096061, 0.0066200914, -0.0045551774, 0.0073800222,
+ -0.0046117627, 0.0081194276, -0.0045750043, 0.0088186627, -0.0044436962, 0.0094576869, -0.0042198659, 0.010016704,
+ -0.0039087553, 0.010476815, -0.0035186927, 0.010820654, -0.0030608606, 0.011033002, -0.002548967, 0.011101345,
+ -0.001998829, 0.011016356, -0.0014278793, 0.010772308, -0.00085461611, 0.01036737, -0.00029800553, 0.0098037962,
+ 0.00022313831, 0.0090879966, 0.00069077854, 0.0082304832, 0.001088266, 0.0072456878, 0.0014009145, 0.0061516552,
+ 0.0016165223, 0.0049696299, 0.0017258222, 0.0037235275, 0.0017228439, 0.002439322, 0.0016051769, 0.0011443575,
+ 0.0013741244, -0.0001333931, 0.0010347385, -0.001366102, 0.00059573731, -0.0025268681, 0.00006930346, -0.0035904851,
+ -0.00052923308, -0.0045341686, -0.001181817, -0.0053382241, -0.0018681852, -0.0059866291, -0.0025664624, -0.0064675175,
+ -0.0032538211, -0.0067735398, -0.0039071804, -0.0069020987, -0.0045039295, -0.0068554399, -0.0050226445, -0.0066406005,
+ -0.0054437858, -0.0062692142, -0.0057503423, -0.0057571726, -0.0059284149, -0.0051241596, -0.0059677036, -0.0043930644,
+ -0.0058618966, -0.003589293, -0.0056089377, -0.0027400018, -0.0052111652, -0.0018732708, -0.0046753148, -0.0010172459,
+ -0.0040123845, -0.00019927412, -0.0032373657, 0.00055493839, -0.0023688413, 0.0012221204, -0.0014284686, 0.0017821564,
+ -0.00044035583, 0.00221871, 0.00056964607, 0.0025197288, 0.0015747172, 0.002677816, 0.0025478832, 0.0026904519,
+ 0.003462845, 0.0025600623, 0.0042947996, 0.0022939243, 0.0050212229, 0.0019039178, 0.0056225881, 0.0014061241,
+ 0.0060830046, 0.00082028762, 0.0063907388, 0.00016915375, 0.0065386193, -0.00052229298, 0.0065242914, -0.0012276688,
+ 0.0063503282, -0.001920081, 0.00602418, -0.0025730385, 0.0055579683, -0.0031613547, 0.0049681277, -0.0036620118,
+ 0.0042749047, -0.0040549575, 0.0035017261, -0.0043238075, 0.0026744606, -0.0044564288, 0.0018205947, -0.0044453838,
+ 0.00096834335, -0.0042882231, 0.00014573456, -0.0039876048, -0.0006203127, -0.003551251, -0.0013048799, -0.0029917257,
+ -0.0018858829, -0.0023260501, -0.0023448193, -0.0015751625, -0.0026674026, -0.00076324248, -0.0028440619, 0.000083084451,
+ -0.0028702877, 0.00093562948, -0.00274681, 0.0017655863, -0.0024796019, 0.002544506, -0.0020797059, 0.0032452703,
+ -0.001562885, 0.0038430272, -0.00094911043, 0.0043160599, -0.00026189955, 0.0046465569, 0.00047247464, 0.0048212567,
+ 0.001225878, 0.0048319423, 0.0019692846, 0.0046757692, 0.0026737878, 0.0043554134, 0.0033116213, 0.0038790288,
+ 0.0038571535, 0.0032600202, 0.0042878226, 0.0025166313, 0.0045849765, 0.0016713619, 0.004734592, 0.00075023499,
+ 0.0047278423, -0.00021806663, 0.0045614946, -0.0012031641, 0.0042381193, -0.0021740133, 0.003766102, -0.0030999696,
+ 0.0031594534, -0.0039518503, 0.0024374237, -0.0047029546, 0.0016239271, -0.0053300103, 0.00074679783, -0.0058140075,
+ -0.00016310361, -0.0061408947, -0.0010729014, -0.0063021071, -0.0019488039, -0.0062949071, -0.0027572513, -0.0061225249,
+ -0.0034660769, -0.0057940902, -0.0040456373, -0.0053243539, -0.0044698785, -0.0047332067, -0.0047172923, -0.0040450124,
+ -0.0047717378, -0.0032877706, -0.0046230876, -0.0024921419, -0.0042676828, -0.0016903625, -0.0037085724, -0.00091508962,
+ -0.0029555273, -0.0001982145, -0.0020248254, 0.00043031544, -0.00093881134, 0.00094362238, 0.00027475748, 0.0013189322,
+ 0.0015835584, 0.0015384787, 0.0029517193, 0.001590244, 0.0043409695, 0.0014685061, 0.005711888, 0.001174171,
+ 0.0070252069, 0.0007148743, 0.0082431259, 0.00010484495, 0.0093305949, -0.00063546957, 0.010256512, -0.0014800054,
+ 0.010994808, -0.0023978967, 0.011525363, -0.0033544756, 0.01183473, -0.0043124277, 0.011916637, -0.0052330629,
+ 0.011772243, -0.0060776612, 0.011410139, -0.0068088472, 0.010846091, -0.0073919417, 0.010102529, -0.0077962507,
+ 0.0092077944, -0.0079962341, 0.0081951711, -0.0079725226, 0.0071017356, -0.0077127367, 0.0059670559, -0.0072120731,
+ 0.0048317886, -0.0064736474, 0.0037362196, -0.0055085579, 0.0027188035, -0.0043356786, 0.0018147465, -0.0029811764,
+ 0.001054692, -0.0014777631, 0.00046354943, 0.00013628764, 0.000059517231, 0.0018183383, -0.00014666733, 0.0035227551,
+ -0.00015221786, 0.0052024024, 0.000037492653, 0.0068102139, 0.00040901723, 0.008300784, 0.00094121607, 0.0096319281,
+ 0.0016059257, 0.010766147, 0.002368897, 0.011671957, 0.0031909735, 0.012325018, 0.0040294742, 0.012709031,
+ 0.0048397309, 0.012816358, 0.0055767358, 0.012648351, 0.0061968337, 0.01221535, 0.0066594072, 0.011536373,
+ 0.0069284872, 0.010638482, 0.0069742394, 0.0095558539, 0.0067742579, 0.0083285747, 0.0063146283, 0.0070012063,
+ 0.0055907099, 0.0056211669, 0.0046076039, 0.0042369836, 0.0033802853, 0.0028964775, 0.0019333874, 0.0016449478,
+ 0.00030063081, 0.00052342116, -0.0014760793, -0.0004329654, -0.0033478751, -0.0011963865, -0.0052604238, -0.0017474962,
+ -0.0071556596, -0.0020762917, -0.0089736925, -0.0021826318, -0.010654833, -0.0020763816, -0.012141662, -0.0017771672,
+ -0.013381075, -0.0013137354, -0.014326238, -0.00072293397, -0.014938361, -0.000048335231, -0.015188256, 0.00066145579,
+ -0.015057592, 0.0013547561, -0.014539802, 0.0019789573, -0.013640625, 0.0024828047, -0.012378214, 0.002818716,
+ -0.01078283, 0.0029450601, -0.0088961152, 0.0028283037, -0.0067699435, 0.0024449378, -0.0044648955, 0.0017831039,
+ -0.002048397, 0.00084384187, 0.00040742956, -0.00035810683, 0.0028281235, -0.0017939941, 0.0051393877, -0.0034212973,
+ 0.0072696419, -0.0051845112, 0.0091525484, -0.0070165028, 0.010729411, -0.0088404194, 0.011951371, -0.010572106,
+ 0.01278131, -0.012122994, 0.013195385, -0.013403381, 0.013184131, -0.01432602, 0.01275308, -0.014809915,
+ 0.011922853, -0.01478422, 0.010728708, -0.01419212, 0.0092195272, -0.012994564, 0.0074562789, -0.011173738,
+ 0.0055099544, -0.0087361531, 0.0034590533, -0.0057152319, 0.0013866695, -0.0021732997, -0.00062274013, 0.0017971178,
+ -0.0024868115, 0.0060727512, -0.0041288515, 0.010499856, -0.0054814275, 0.014895321, -0.0064898543, 0.019048614,
+ -0.0071154684, 0.022724561, -0.0073385658, 0.025666898, -0.0071609118, 0.027602537, -0.0066077164, 0.028246468,
+ -0.0057289964, 0.027307168, -0.004600253, 0.0244924, -0.0033224206, 0.019515269, -0.0020210496, 0.012100382,
+ -0.00084472145, 0.0019899437, 0.000037296293, -0.01105034, 0.00043811565, -0.027225735, 0.00015696014, -0.046707455,
+ -0.0010165154, -0.069628276, -0.0032974123, -0.096078917, -0.0069003948, -0.12610528, -0.01203424, -0.15970659,
+ -0.018896269, -0.19683464, -0.027666792, -0.23739384, -0.038503725, -0.28124255, -0.051537503, -0.32819515,
+ -0.06686642, -0.3780252, -0.084552586, -0.43046936, -0.10461849, -0.48523226, -0.12704438, -0.54199159,
+ -0.15176651, -0.60040426, -0.17867628, -0.66011244, -0.20762028, -0.72074997, -0.23840135, -0.7819488,
+ -0.27078056, -0.8433454, -0.30448011, -0.90458667, -0.33918688, -0.96533567, -0.37455717, -1.0252765,
+ -0.41022155, -1.0841192, -0.44579068, -1.1416026, -0.48086143, -1.1974978, -0.51502305, -1.2516102,
+ -0.54786384, -1.3037796, -0.57897753, -1.3538816, -0.60796958, -1.4018263, -0.63446349, -1.4475567,
+ -0.65810603, -1.4910469, -0.67857265, -1.5322988, -0.6955719, -1.571339, -0.70884931, -1.6082149,
+ -0.71819037, -1.6429906, -0.72342294, -1.6757429, -0.72441858, -1.7065566, -0.72109336, -1.7355207,
+ -0.71340775, -1.7627244, -0.70136583, -1.7882535, -0.68501353, -1.8121873, -0.664437, -1.8345959,
+ -0.63975936, -1.8555384, -0.61113822, -1.8750609, -0.5787617, -1.8931965, -0.54284513, -1.9099646,
+ -0.50362706, -1.9253712, -0.46136531, -1.9394104, -0.41633323, -1.9520659, -0.36881575, -1.9633123,
+ -0.31910598, -1.9731183, -0.26750168, -1.9814487, -0.21430217, -1.9882675, -0.15980564, -1.9935409,
+ -0.1043066, -1.9972394, -0.048093725, -1.9993412, 0.0085518388, -1.9998351, 0.06535802, -1.9987217,
+ 0.12206294, -1.9960158, 0.17841578, -1.9917485, 0.23417741, -1.9859674, 0.28912079, -1.978738,
+ 0.34303114, -1.9701437, 0.39570591, -1.9602853, 0.44695485, -1.9492812, 0.49659961, -1.9372654,
+ 0.54447347, -1.924387, 0.59042108, -1.9108082, 0.63429779, -1.8967023, 0.6759693, -1.8822519,
+ 0.71531093, -1.8676466, 0.7522071, -1.8530809, 0.78655046, -1.8387512, 0.81824118, -1.8248546,
+ 0.84718591, -1.8115855, 0.87329692, -1.799134, 0.89649087, -1.7876834, 0.91668761, -1.7774082,
+ 0.93380904, -1.7684723, 0.94777751, -1.7610264, 0.95851475, -1.7552065, 0.96594018, -1.7511318,
+ 0.96996975, -1.7489027, 0.9705146, -1.7485988, 0.96748, -1.7502769, 0.96076453, -1.7539688,
+ 0.95025921, -1.7596794, 0.93584764, -1.7673841, 0.91740602, -1.7770265, 0.8948037, -1.788517,
+ 0.86790472, -1.8017294, 0.83656931, -1.8164997, 0.80065662, -1.8326236, 0.76002777, -1.8498554,
+ 0.71454966, -1.8679065, 0.66409934, -1.8864441, 0.60856909, -1.9050918, 0.54787195, -1.9234295,
+ 0.48194784, -1.9409947, 0.41076976, -1.9572846, 0.33435044, -1.9717588, 0.25274888, -1.9838443,
+ 0.16607688, -1.9929391, 0.07450521, -1.9984198, -0.021730689, -1.999648, -0.12232572, -1.9959785,
+ -0.22690098, -1.9867691, -0.33500072, -1.9713904, -0.44609061, -1.9492363, -0.55955714, -1.9197356,
+ -0.67470908, -1.8823639, -0.79077995, -1.8366553, -0.90693277, -1.7822139, -1.0222664, -1.718726,
+ -1.1358232, -1.64597, -1.2465994, -1.5638269, -1.3535558, -1.4722892, -1.4556309, -1.3714676,
+ -1.5517555, -1.2615976, -1.6408671, -1.1430426, -1.7219268, -1.016296, -1.7939352, -0.88198137,
+ -1.8559498, -0.7408486, -1.9071014, -0.59376967, -1.9466108, -0.44173092, -1.9738038, -0.28582337,
+ -1.9881259, -0.12723051, -1.9891552, 0.032785702, -1.976613, 0.19290088, -1.9503736, 0.35174593,
+ -1.9104701, 0.50792599, -1.8570991, 0.6600405, -1.7906219, 0.80670393, -1.7115632, 0.94656676,
+ -1.6206069, 1.0783361, -1.518589, 1.2007964, -1.4064881, 1.3128283, -1.2854123, 1.4134272,
+ -1.1565856, 1.5017194, -1.0213295, 1.5769756, -0.8810457, 1.6386244, -0.73719448, 1.6862605,
+ -0.5912739, 1.7196511, -0.44479746, 1.7387406, -0.2992714, 1.74365, -0.15617253, 1.734675,
+ -0.016926099, 1.7122809, 0.11711492, 1.677093, 0.24468948, 1.629887, 0.36464623, 1.5715742,
+ 0.47595924, 1.5031863, 0.57774144, 1.4258577, 0.66925532, 1.3408059, 0.74992096, 1.2493112,
+ 0.81932145, 1.1526958, 0.87720448, 1.0523019, 0.92348218, 0.94947082, 0.95822722, 0.84552169,
+ 0.98166639, 0.74173182, 0.99417198, 0.63931787, 0.99625009, 0.53941888, 0.98852777, 0.44308114,
+ 0.97173774, 0.35124525, 0.94670212, 0.2647354, 0.91431493, 0.18425134, 0.87552404, 0.11036279,
+ 0.83131295, 0.04350647, 0.78268248, -0.016014282, 0.7306332, -0.068027422, 0.67614836, -0.11248776,
+ 0.62017834, -0.1494704, 0.56362599, -0.17916223, 0.50733423, -0.20185167, 0.45207494, -0.21791716,
+ 0.39854008, -0.22781442, 0.34733471, -0.2320631, 0.29897237, -0.23123281, 0.25387216, -0.22592908,
+ 0.21235825, -0.21677956, 0.17466106, -0.20442055, 0.14092025, -0.1894843, 0.11118954, -0.17258726,
+ 0.085442781, -0.15431944, 0.06358128, -0.13523506, 0.04544213, -0.11584474, 0.030807279, -0.096609004,
+ 0.01941302, -0.077933475, 0.010959785, -0.060165603, 0.005121904, -0.043592878, 0.0015571543, -0.028442509,
+ -0.000084115498, -0.014882491, -0.00015046289, -0.003023857, 0.0010184186, 0.0070759403, 0.0030985889, 0.01540874,
+ 0.0057877772, 0.022010626, 0.0088102622, 0.026956297, 0.011920679, 0.030353062, 0.014906751, 0.032334596,
+ 0.017590966, 0.033054668, 0.019831251, 0.032680977, 0.021520695, 0.031389244, 0.022586443, 0.029357675,
+ 0.022987815, 0.026761938, 0.02271381, 0.023770688, 0.021780089, 0.020541752, 0.020225555, 0.017218968,
+ 0.018108679, 0.013929741, 0.015503671, 0.010783297, 0.012496619, 0.0078696031, 0.0091816904, 0.0052589499,
+ 0.0056575048, 0.0030021123, 0.0020237456, 0.0011310551, -0.0016219205, -0.00033990419, -0.0051865601, -0.0014125451,
+ -0.0085842935, -0.0021028898, -0.011738192, -0.0024391229, -0.01458175, -0.0024593701, -0.017059926, -0.002209408,
+ -0.019129775, -0.001740378, -0.020760702, -0.0011065705, -0.021934342, -0.00036333143, -0.022644157, 0.00043485823,
+ -0.022894738, 0.0012360946, -0.022700895, 0.0019925251, -0.022086568, 0.0026615674, -0.021083612, 0.0032068638,
+ -0.019730492, 0.0035989694, -0.018070942, 0.0038157802, -0.01615262, 0.0038427161, -0.014025783, 0.0036726766,
+ -0.011742038, 0.0033057902, -0.0093531534, 0.0027489865, -0.0069099898, 0.0020154165, -0.0044615306, 0.0011237526,
+ -0.0020540373, 0.000097393946, 0.00026966495, -0.0010363915, 0.0024707811, -0.002247364, 0.0045150127, -0.0035032234,
+ 0.0063729058, -0.0047705099, 0.0080200844, -0.0060154819, 0.0094373813, -0.0072049443, 0.010610872, -0.0083070258,
+ 0.011531814, -0.0092918845, 0.012196518, -0.010132339, 0.01260614, -0.010804415, 0.012766409, -0.011287811,
+ 0.012687304, -0.011566276, 0.01238268, -0.011627889, 0.011869849, -0.011465268, 0.011169123, -0.011075674,
+ 0.010303336, -0.010461045, 0.0092973243, -0.009627942, 0.0081774024, -0.0085874097, 0.00697082, -0.0073547787,
+ 0.0057052155, -0.0059493748, 0.0044080694, -0.0043941792, 0.0031061731, -0.0027154128, 0.0018251112, -0.00094207097,
+ 0.00058877678, 0.00089459657, -0.00058107794, 0.0027616499, -0.0016652432, 0.0046250583, -0.0026473978, 0.0064503294,
+ -0.0035143902, 0.0082031535, -0.0042564487, 0.0098500587, -0.004867312, 0.011359059, -0.0053442805, 0.012700289,
+ -0.0056881784, 0.013846606, -0.005903231, 0.014774157, -0.005996861, 0.015462888, -0.0059794001, 0.015896989,
+ -0.0058637299, 0.01606526, -0.0056648538, 0.015961399, -0.0053994185, 0.01558418, -0.0050851903, 0.014937551,
+ -0.0047405036, 0.014030606, -0.0043836995, 0.012877463, -0.0040325602, 0.011497032, -0.0037037728, 0.0099126762,
+ -0.0034124162, 0.0081517817, -0.0031715068, 0.0062452359, -0.0029916021, 0.0042268233, -0.0028804804, 0.002132565,
+};
+
+const float ff_on2avc_ctab_4[2048] = {
+ 0.0, 1.9999924, -0.0000058932724, -0.00018632905, -0.000023430526, -0.00036967263, -0.000052186413, -0.00054710143,
+ -0.000091459828, -0.00071579742, -0.00014028551, -0.00087310647, -0.00019745006, -0.0010165883, -0.00026151221, -0.0011440613,
+ -0.00033082708, -0.0012536434, -0.00040357397, -0.0013437853, -0.00047778775, -0.0014132988, -0.00055139291, -0.0014613763,
+ -0.0006222403, -0.0014876042, -0.00068814593, -0.0014919674, -0.00074693147, -0.0014748453, -0.00079646555, -0.0014370022,
+ -0.00083470601, -0.0013795681, -0.00085974159, -0.001304013, -0.00086983346, -0.0012121156, -0.00086345506, -0.0011059257,
+ -0.00083932967, -0.00098772196, -0.00079646567, -0.00085996656, -0.00073418743, -0.0007252564, -0.00065216236, -0.00058627356,
+ -0.00055042218, -0.00044573518, -0.0004293785, -0.00030634343, -0.00028983151, -0.00017073752, -0.00013297109, -0.000041447816,
+ 0.000039629722, 0.000079147045, 0.00022602957, 0.00018885947, 0.00042394208, 0.00028572831, 0.00063076714, 0.0003680501,
+ 0.00084363052, 0.00043440601, 0.0010594303, 0.00048368447, 0.0012748899, 0.0005150995, 0.0014866164, 0.0005282049,
+ 0.0016911632, 0.00052290427, 0.0018850935, 0.00049945683, 0.0020650467, 0.00045847919, 0.0022278025, 0.00040094266,
+ 0.0023703419, 0.00032816609, 0.0024899046, 0.00024180381, 0.0025840413, 0.0001438281, 0.0026506572, 0.00003650627,
+ 0.0026880486, -0.000077628843, 0.002694932, -0.00019581451, 0.0026704618, -0.00031510059, 0.002614242, -0.00043239864,
+ 0.0025263282, -0.0005445375, 0.0024072223, -0.00064832467, 0.0022578605, -0.00074061239, 0.0020795963, -0.00081836781,
+ 0.0018741783, -0.00087874458, 0.0016437257, -0.0009191549, 0.0013906998, -0.00093733944, 0.0011178757, -0.0009314327,
+ 0.0008283116, -0.00090002158, 0.0005253178, -0.00084219524, 0.0002124242, -0.00075758353, -0.00010665277, -0.00064638274,
+ -0.0004280459, -0.00050936721, -0.00074777508, -0.00034788603, -0.0010617886, -0.00016384445, -0.0013660089, 0.000040329032,
+ -0.0016563823, 0.00026172952, -0.001928934, 0.0004970344, -0.0021798278, 0.00074257207, -0.0024054295, 0.00099439803,
+ -0.0026023739, 0.0012483762, -0.0027676339, 0.0015002612, -0.0028985876, 0.0017457816, -0.0029930845, 0.0019807185,
+ -0.0030495061, 0.0022009795, -0.0030668175, 0.0024026663, -0.0030446108, 0.002582133, -0.0029831338, 0.0027360369,
+ -0.0028833048, 0.0028613801, -0.0027467103, 0.0029555426, -0.002575587, 0.0030163093, -0.0023727834, 0.0030418884,
+ -0.0021417083, 0.0030309267, -0.00188626, 0.0029825219, -0.001610745, 0.0028962295, -0.0013197823, 0.0027720702,
+ -0.0010182032, 0.002610537, -0.00071094313, 0.0024125993, -0.00040293398, 0.0021797076, -0.000098998527, 0.0019137961,
+ 0.00019625042, 0.0016172826, 0.0004785021, 0.0012930647, 0.00074382918, 0.00094451016, 0.00098875654, 0.00057544146,
+ 0.0012103159, 0.00019011059, 0.0014060856, -0.00020683407, 0.0015742163, -0.00061039196, 0.0017134408, -0.001015265,
+ 0.0018230709, -0.0014159229, 0.0019029821, -0.0018066789, 0.0019535855, -0.0021817745, 0.0019757913, -0.0025354712,
+ 0.0019709636, -0.002862151, 0.0019408683, -0.0031564159, 0.0018876162, -0.0034131943, 0.0018136023, -0.003627843,
+ 0.0017214427, -0.0037962461, 0.0016139107, -0.0039149108, 0.0014938725, -0.0039810524, 0.0013642251, -0.0039926702,
+ 0.0012278357, -0.0039486135, 0.001087485, -0.0038486305, 0.0009458157, -0.0036934058, 0.00080528553, -0.0034845807,
+ 0.00066812726, -0.0032247561, 0.0005363166, -0.0029174781, 0.00041154691, -0.0025672072, 0.00029521331, -0.0021792662,
+ 0.00018840475, -0.0017597722, 0.000091904491, -0.0013155513, 0.0000061986657, -0.00085403392, -0.000068508154, -0.00038313636,
+ -0.00013227122, 0.000088872715, -0.00018537903, 0.00055351778, -0.00022832313, 0.0010022718, -0.00026176605, 0.0014267182,
+ -0.0002865085, 0.0018187162, -0.00030345729, 0.002170566, -0.00031359497, 0.0024751695, -0.00031795207, 0.0027261837,
+ -0.0003175826, 0.0029181617, -0.00031354246, 0.0030466772, -0.00030687143, 0.0031084325, -0.00029857742, 0.0031013431,
+ -0.00028962348, 0.0030245974, -0.00028091561, 0.0028786955, -0.00027329178, 0.0026654552, -0.00026751086, 0.0023879989,
+ -0.00026424107, 0.0020507087, -0.0002640482, 0.0016591615, -0.0002673828, 0.0012200392, -0.00027456757, 0.00074101909,
+ -0.00028578506, 0.00023064682, -0.00030106661, -0.00030180693, -0.00032028355, -0.00084650156, -0.00034314199, -0.0013931919,
+ -0.00036918154, -0.0019314003, -0.00039777948, -0.002450594, -0.00042816071, -0.0029403649, -0.00045941351, -0.0033906079,
+ -0.00049051136, -0.0037916978, -0.00052034017, -0.0041346624, -0.00054773013, -0.0044113463, -0.00057149079, -0.0046145683,
+ -0.00059044833, -0.0047382633, -0.00060348323, -0.0047776136, -0.00060956669, -0.0047291601, -0.00060779473, -0.0045908964,
+ -0.00059741817, -0.0043623378, -0.00057786785, -0.0040445696, -0.00054877391, -0.0036402657, -0.00050997949, -0.0031536825,
+ -0.00046154787, -0.0025906207, -0.0004037637, -0.0019583604, -0.00033712928, -0.0012655669, -0.00026235546, -0.0005221676,
+ -0.0001803489, 0.00026079561, -0.000092195645, 0.0010713381, 8.5773814e-7, 0.001896725, 0.000097425305, 0.0027236806,
+ 0.00019600448, 0.0035386102, 0.00029500009, 0.0043278327, 0.00039274961, 0.0050778165, 0.00048754914, 0.0057754163,
+ 0.00057768018, 0.0064081079, 0.00066143664, 0.0069642127, 0.00073715224, 0.0074331141, 0.00080322672, 0.0078054559,
+ 0.00085815141, 0.0080733243, 0.00090053247, 0.0082304087, 0.00092911115, 0.0082721328, 0.00094278029, 0.0081957681,
+ 0.0009405961, 0.0080005014, 0.00092178461, 0.0076874876, 0.00088574266, 0.0072598509, 0.00083203381, 0.0067226603,
+ 0.00076037919, 0.0060828608, 0.00067064527, 0.0053491686, 0.0005628299, 0.0045319302, 0.00043704818, 0.0036429393,
+ 0.00029352194, 0.0026952275, 0.00013257378, 0.0017028196, -0.000045370962, 0.00068046764, -0.00023977279, -0.00035663525,
+ -0.00044995558, -0.0013931503, -0.00067507266, -0.0024138922, -0.00091406191, -0.0034041218, -0.0011655915, -0.0043498254,
+ -0.0014279993, -0.0052379691, -0.0016992289, -0.0060567264, -0.0019767685, -0.0067956652, -0.0022575972, -0.0074458965,
+ -0.0025381455, -0.0080001755, -0.0028142736, -0.0084529584, -0.0030812761, -0.0088004144, -0.0033339155, -0.0090403967,
+ -0.0035664875, -0.0091723735, -0.0037729202, -0.0091973282, -0.0039469078, -0.0091176452, -0.0040820716, -0.0089369677,
+ -0.004172151, -0.0086600557, -0.0042112102, -0.0082926471, -0.0041938564, -0.0078413244, -0.0041154595, -0.0073133917,
+ -0.0039723613, -0.0067167743, -0.0037620636, -0.0060599349, -0.0034833867, -0.0053518065, -0.0031365866, -0.0046017431,
+ -0.0027234256, -0.0038194789, -0.002247188, -0.0030150977, -0.001712642, -0.0021989932, -0.0011259451, -0.0013818274,
+ -0.00049449678, -0.00057446648, 0.00017325579, 0.00021210148, 0.0008680491, 0.00096687989, 0.0015800633, 0.0016790066,
+ 0.0022991966, 0.0023379293, 0.0030153422, 0.0029336107, 0.0037186535, 0.0034567595, 0.0043997848, 0.0038990804,
+ 0.0050500971, 0.0042535327, 0.0056618182, 0.0045145866, 0.0062281508, 0.0046784664, 0.006743324, 0.0047433623,
+ 0.0072025894, 0.0047096047, 0.0076021603, 0.0045797802, 0.0079391068, 0.0043587871, 0.0082112048, 0.004053812,
+ 0.0084167644, 0.0036742303, 0.0085544325, 0.0032314239, 0.0086230049, 0.0027385168, 0.008621241, 0.0022100355,
+ 0.0085477121, 0.0016615022, 0.008400687, 0.0011089721, 0.0081780711, 0.00056853076, 0.0078773974, 0.000055770324,
+ 0.0074958913, -0.00041473741, 0.007030596, -0.00082994968, 0.006478562, -0.0011788219, 0.0058371006, -0.0014527178,
+ 0.0051040803, -0.0016457422, 0.0042782673, -0.001754979, 0.0033596819, -0.0017806236, 0.0023499657, -0.0017259984,
+ 0.0012527303, -0.001597449, 0.000073873452, -0.0014041185, -0.0011781569, -0.001157607, -0.0024921719, -0.00087152363,
+ -0.0038541388, -0.00056094711, -0.005247179, -0.00024181118, -0.0066516823, 0.000069761314, -0.0080455355, 0.00035815299,
+ -0.0094044767, 0.00060894678, -0.010702565, 0.00080959394, -0.011912759, 0.00095002784, -0.013007595, 0.0010231955,
+ -0.013959945, 0.0010254832, -0.014743825, 0.00095701526, -0.015335241, 0.0008218062, -0.015713034, 0.00062775693,
+ -0.015859697, 0.0003864867, -0.015762128, 0.00011300056, -0.015412294, -0.00017480124, -0.014807777, -0.00045675918,
+ -0.01395216, -0.00071121694, -0.012855255, -0.00091588532, -0.01153313, -0.0010487777, -0.010007947, -0.0010891829,
+ -0.0083075836, -0.0010186376, -0.0064650625, -0.00082186121, -0.0045177857, -0.00048761227, -0.0025065942, -0.0000094309362,
+ -0.00047468659, 0.00061376783, 0.0015335816, 0.0013772795, 0.0034739727, 0.0022703977, 0.0053036748, 0.0032764203,
+ 0.0069826017, 0.0043728831, 0.0084746322, 0.0055320212, 0.0097487466, 0.0067214468, 0.010780025, 0.0079050288,
+ 0.011550448, 0.009043945, 0.012049492, 0.010097877, 0.012274483, 0.011026301, 0.012230681, 0.011789839,
+ 0.011931112, 0.012351614, 0.01139613, 0.012678572, 0.010652733, 0.012742704, 0.0097336508, 0.012522144,
+ 0.0086762328, 0.012002093, 0.0075211856, 0.011175527, 0.0063111861, 0.010043681, 0.0050894427, 0.0086162686,
+ 0.0038982306, 0.006911451, 0.0027774705, 0.0049555404, 0.0017633948, 0.0027824503, 0.00088734273, 0.00043292236,
+ 0.00017473225, -0.0020464575, -0.00035576228, -0.0046044104, -0.00069279957, -0.0071862484, -0.00083271071, -0.009735249,
+ -0.00077958073, -0.012194071, -0.00054507388, -0.01450618, -0.00014801256, -0.016617225, 0.00038627203, -0.018476345,
+ 0.0010267919, -0.020037353, 0.0017379262, -0.021259794, 0.0024805821, -0.022109814, 0.003213454, -0.022560883,
+ 0.0038943416, -0.022594307, 0.004481487, -0.022199562, 0.0049348958, -0.021374447, 0.0052176043, -0.020125058,
+ 0.0052968613, -0.018465608, 0.0051452029, -0.016418114, 0.0047413921, -0.014011954, 0.0040712133, -0.011283341,
+ 0.0031281023, -0.0082747173, 0.0019136185, -0.0050341059, 0.00043774495, -0.001614425, -0.0012809716, 0.0019271988,
+ -0.0032154371, 0.0055301157, -0.0053301733, 0.009130815, -0.0075816144, 0.012663559, -0.0099185258, 0.016060976,
+ -0.012282523, 0.019254617, -0.014608691, 0.022175461, -0.016826265, 0.024754377, -0.018859385, 0.026922559,
+ -0.02062788, 0.028611908, -0.022048112, 0.029755389, -0.023033798, 0.03028737, -0.023496887, 0.030143932,
+ -0.023348402, 0.029263169, -0.022499284, 0.027585492, -0.020861225, 0.025053922, -0.018347459, 0.021614388,
+ -0.014873539, 0.017216032, -0.010358062, 0.011811542, -0.0047233663, 0.0053574666, 0.0021038246, -0.0021854306,
+ 0.010191803, -0.010851817, 0.019603329, -0.020671425, 0.030395132, -0.031668674, 0.04261747, -0.043862291,
+ 0.056313749, -0.057264935, 0.07152018, -0.071882829, 0.088265501, -0.087715395, 0.10657079, -0.10475491,
+ 0.12644924, -0.1229862, 0.14790612, -0.14238638, 0.17093869, -0.16292457, 0.19553615, -0.18456177,
+ 0.22167984, -0.20725067, 0.24934319, -0.23093559, 0.27849197, -0.25555256, 0.3090845, -0.28102925,
+ 0.34107187, -0.30728522, 0.37439832, -0.33423212, 0.40900153, -0.361774, 0.44481304, -0.38980758,
+ 0.48175868, -0.41822296, 0.51975912, -0.44690385, 0.55873019, -0.47572839, 0.59858364, -0.50456971,
+ 0.63922757, -0.53329676, 0.68056691, -0.56177497, 0.72250432, -0.58986712, 0.76494032, -0.61743438,
+ 0.80777425, -0.64433688, 0.8509047, -0.67043501, 0.89423001, -0.69559014, 0.93764895, -0.71966553,
+ 0.98106116, -0.74252748, 1.0243676, -0.76404625, 1.0674711, -0.78409678, 1.1102771, -0.80255991,
+ 1.152693, -0.81932294, 1.1946301, -0.83428079, 1.2360026, -0.84733653, 1.2767284, -0.85840225,
+ 1.3167298, -0.86739963, 1.3559328, -0.87426066, 1.3942684, -0.87892807, 1.4316717, -0.88135582,
+ 1.468083, -0.88150936, 1.5034472, -0.87936598, 1.5377145, -0.87491488, 1.5708399, -0.86815733,
+ 1.6027837, -0.85910636, 1.6335113, -0.84778708, 1.6629931, -0.83423591, 1.6912047, -0.81850064,
+ 1.7181267, -0.80063975, 1.7437447, -0.78072208, 1.7680489, -0.75882602, 1.7910345, -0.73503911,
+ 1.8127009, -0.70945716, 1.833052, -0.68218356, 1.8520958, -0.65332848, 1.8698444, -0.62300795,
+ 1.8863133, -0.59134328, 1.9015219, -0.55845982, 1.9154925, -0.52448642, 1.9282508, -0.48955446,
+ 1.9398252, -0.45379704, 1.9502468, -0.41734815, 1.9595492, -0.38034189, 1.9677683, -0.34291169,
+ 1.9749422, -0.30518964, 1.9811107, -0.26730573, 1.9863157, -0.22938718, 1.9906008, -0.1915579,
+ 1.994011, -0.15393782, 1.9965928, -0.11664244, 1.998394, -0.079782248, 1.9994637, -0.043462355,
+ 1.9998517, -0.0077820257, 1.9996089, 0.027165633, 1.9987869, 0.061293982, 1.997438, 0.094523117,
+ 1.9956142, 0.12678003, 1.9933683, 0.15799879, 1.9907526, 0.18812059, 1.9878191, 0.21709381,
+ 1.9846191, 0.24487394, 1.981203, 0.27142358, 1.97762, 0.29671216, 1.9739178, 0.3207159,
+ 1.9701425, 0.3434175, 1.9663377, 0.36480582, 1.9625452, 0.38487554, 1.9588039, 0.40362692,
+ 1.95515, 0.42106527, 1.9516169, 0.43720058, 1.9482347, 0.45204708, 1.9450303, 0.46562275,
+ 1.9420276, 0.47794896, 1.9392464, 0.48904994, 1.9367039, 0.49895242, 1.9344136, 0.50768507,
+ 1.9323857, 0.51527834, 1.9306273, 0.52176386, 1.929143, 0.52717417, 1.9279337, 0.53154266,
+ 1.9269985, 0.53490293, 1.9263337, 0.5372889, 1.9259334, 0.5387345, 1.9257902, 0.53927344,
+ 1.9258945, 0.53893936, 1.9262359, 0.53776574, 1.9268025, 0.53578556, 1.9275814, 0.53303164,
+ 1.9285592, 0.5295366, 1.9297218, 0.52533281, 1.9310548, 0.52045238, 1.9325439, 0.51492745,
+ 1.9341741, 0.50879002, 1.9359311, 0.50207198, 1.9378004, 0.4948054, 1.9397678, 0.48702216,
+ 1.9418195, 0.47875434, 1.943942, 0.47003385, 1.9461217, 0.46089265, 1.9483463, 0.45136252,
+ 1.9506031, 0.44147509, 1.9528806, 0.43126175, 1.9551672, 0.42075339, 1.9574521, 0.40998054,
+ 1.9597249, 0.39897302, 1.9619763, 0.38775995, 1.964197, 0.37636963, 1.9663788, 0.3648293,
+ 1.968514, 0.35316524, 1.9705957, 0.3414025, 1.9726177, 0.32956493, 1.9745748, 0.31767496,
+ 1.9764622, 0.30575377, 1.9782765, 0.29382104, 1.9800144, 0.28189498, 1.981674, 0.26999241,
+ 1.9832535, 0.25812861, 1.9847524, 0.24631737, 1.9861704, 0.23457102, 1.9875079, 0.22290041,
+ 1.988766, 0.21131492, 1.9899458, 0.1998225, 1.9910489, 0.18842971, 1.9920776, 0.17714165,
+ 1.9930336, 0.16596206, 1.9939193, 0.15489329, 1.9947368, 0.14393641, 1.9954883, 0.13309111,
+ 1.996176, 0.1223558, 1.9968017, 0.11172768, 1.9973674, 0.1012027, 1.9978747, 0.090775654,
+ 1.998325, 0.080440246, 1.9987197, 0.070189148, 1.9990598, 0.060014058, 1.9993461, 0.049905833,
+ 1.9995795, 0.039854541, 1.9997605, 0.029849617, 1.9998894, 0.019879945, 1.9999666, 0.0099340044,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/on2avcdata.h b/chromium/third_party/ffmpeg/libavcodec/on2avcdata.h
new file mode 100644
index 00000000000..7f498e58e4e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/on2avcdata.h
@@ -0,0 +1,82 @@
+/*
+ * On2 Audio for Video Codec decoder
+ *
+ * Copyright (c) 2013 Konstantin Shishkov
+ *
+ * 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_ON2AVC_DATA_H
+#define AVCODEC_ON2AVC_DATA_H
+
+#include <stdint.h>
+
+#define ON2AVC_MAX_BANDS 112
+#define ON2AVC_ESC_CB 15
+
+typedef struct On2AVCMode {
+ int num_windows;
+ int num_bands;
+ const int *band_start;
+} On2AVCMode;
+
+extern const On2AVCMode ff_on2avc_modes_40[8];
+extern const On2AVCMode ff_on2avc_modes_44[8];
+
+#define ON2AVC_SCALE_DIFFS 121
+extern const uint32_t ff_on2avc_scale_diff_codes[];
+extern const uint8_t ff_on2avc_scale_diff_bits[];
+
+extern const uint32_t * const ff_on2avc_quad_cb_codes[];
+extern const uint8_t * const ff_on2avc_quad_cb_bits[];
+extern const uint16_t * const ff_on2avc_quad_cb_syms[];
+extern const int ff_on2avc_quad_cb_elems[];
+extern const uint16_t * const ff_on2avc_pair_cb_codes[];
+extern const uint8_t * const ff_on2avc_pair_cb_bits[];
+extern const uint16_t * const ff_on2avc_pair_cb_syms[];
+extern const int ff_on2avc_pair_cb_elems[];
+
+extern const float ff_on2avc_window_long_32000[1024];
+extern const float ff_on2avc_window_long_24000[1024];
+extern const float ff_on2avc_window_short[128];
+
+extern const double ff_on2avc_tab_10_1[];
+extern const double ff_on2avc_tab_10_2[];
+extern const double ff_on2avc_tab_20_1[];
+extern const double ff_on2avc_tab_20_2[];
+extern const double ff_on2avc_tab_40_1[];
+extern const double ff_on2avc_tab_40_2[];
+extern const double ff_on2avc_tab_84_1[];
+extern const double ff_on2avc_tab_84_2[];
+extern const double ff_on2avc_tab_84_3[];
+extern const double ff_on2avc_tab_84_4[];
+extern const double* const ff_on2avc_tabs_4_10_1[4];
+extern const double* const ff_on2avc_tabs_4_10_2[4];
+extern const double* const ff_on2avc_tabs_9_20_1[9];
+extern const double* const ff_on2avc_tabs_9_20_2[9];
+extern const double* const ff_on2avc_tabs_19_40_1[19];
+extern const double* const ff_on2avc_tabs_19_40_2[19];
+extern const double* const ff_on2avc_tabs_20_84_1[20];
+extern const double* const ff_on2avc_tabs_20_84_2[20];
+extern const double* const ff_on2avc_tabs_20_84_3[20];
+extern const double* const ff_on2avc_tabs_20_84_4[20];
+extern const float ff_on2avc_ctab_1[2048];
+extern const float ff_on2avc_ctab_2[2048];
+extern const float ff_on2avc_ctab_3[2048];
+extern const float ff_on2avc_ctab_4[2048];
+
+#endif /* AVCODEC_ON2AVC_DATA_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/options.c b/chromium/third_party/ffmpeg/libavcodec/options.c
index 5ee9d6bd739..b31483baa3a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/options.c
+++ b/chromium/third_party/ffmpeg/libavcodec/options.c
@@ -156,6 +156,9 @@ AVCodecContext *avcodec_alloc_context3(const AVCodec *codec)
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
{
+ const AVCodec *orig_codec = dest->codec;
+ uint8_t *orig_priv_data = dest->priv_data;
+
if (avcodec_is_open(dest)) { // check that the dest context is uninitialized
av_log(dest, AV_LOG_ERROR,
"Tried to copy AVCodecContext %p into already-initialized %p\n",
@@ -168,9 +171,10 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
memcpy(dest, src, sizeof(*dest));
+ dest->priv_data = orig_priv_data;
+ dest->codec = orig_codec;
+
/* set values specific to opened codecs back to their default state */
- dest->priv_data = NULL;
- dest->codec = NULL;
dest->slice_offset = NULL;
dest->hwaccel = NULL;
dest->internal = NULL;
@@ -181,6 +185,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
dest->intra_matrix = NULL;
dest->inter_matrix = NULL;
dest->rc_override = NULL;
+ dest->subtitle_header = NULL;
if (src->rc_eq) {
dest->rc_eq = av_strdup(src->rc_eq);
if (!dest->rc_eq)
@@ -202,6 +207,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
alloc_and_copy_or_fail(inter_matrix, 64 * sizeof(int16_t), 0);
alloc_and_copy_or_fail(rc_override, src->rc_override_count * sizeof(*src->rc_override), 0);
alloc_and_copy_or_fail(subtitle_header, src->subtitle_header_size, 1);
+ av_assert0(dest->subtitle_header_size == src->subtitle_header_size);
#undef alloc_and_copy_or_fail
return 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/options_table.h b/chromium/third_party/ffmpeg/libavcodec/options_table.h
index 49af29cbccf..f115ea718fc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/options_table.h
+++ b/chromium/third_party/ffmpeg/libavcodec/options_table.h
@@ -54,16 +54,24 @@ static const AVOption avcodec_options[] = {
{"qpel", "use 1/4-pel motion compensation", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_QPEL }, INT_MIN, INT_MAX, V|E, "flags"},
{"loop", "use loop filter", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_LOOP_FILTER }, INT_MIN, INT_MAX, V|E, "flags"},
{"qscale", "use fixed qscale", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_QSCALE }, INT_MIN, INT_MAX, 0, "flags"},
+#if FF_API_GMC
{"gmc", "use gmc", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"},
+#endif
+#if FF_API_MV0
{"mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_MV0 }, INT_MIN, INT_MAX, V|E, "flags"},
+#endif
+#if FF_API_INPUT_PRESERVED
{"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"},
+#endif
{"pass1", "use internal 2-pass ratecontrol in first pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"},
{"pass2", "use internal 2-pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"},
{"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"},
{"emu_edge", "do not draw edges", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_EMU_EDGE }, INT_MIN, INT_MAX, 0, "flags"},
{"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"},
{"truncated", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, 0, "flags"},
+#if FF_API_NORMALIZE_AQP
{"naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_NORMALIZE_AQP }, INT_MIN, INT_MAX, V|E, "flags"},
+#endif
{"ildct", "use interlaced DCT", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"},
{"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"},
{"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"},
@@ -155,6 +163,7 @@ static const AVOption avcodec_options[] = {
{"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
{"buffer", "detect improper bitstream length", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BUFFER }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
{"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_EXPLODE }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
+{"ignore_err", "ignore errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_IGNORE_ERR }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
{"careful", "consider things that violate the spec, are fast to check and have not been seen in the wild as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CAREFUL }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
{"compliant", "consider all spec non compliancies as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_COMPLIANT }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
{"aggressive", "consider things that a sane encoder should not do as an error", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_AGGRESSIVE }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
@@ -197,7 +206,9 @@ static const AVOption avcodec_options[] = {
{"simplemmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"arm", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_ARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_ALTIVEC }, INT_MIN, INT_MAX, V|E|D, "idct"},
+#if FF_API_ARCH_SH4
{"sh4", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SH4 }, INT_MIN, INT_MAX, V|E|D, "idct"},
+#endif
{"simplearm", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplearmv5te", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARMV5TE }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplearmv6", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARMV6 }, INT_MIN, INT_MAX, V|E|D, "idct"},
@@ -212,6 +223,7 @@ static const AVOption avcodec_options[] = {
{"ec", "set error concealment strategy", OFFSET(error_concealment), AV_OPT_TYPE_FLAGS, {.i64 = 3 }, INT_MIN, INT_MAX, V|D, "ec"},
{"guess_mvs", "iterative motion vector (MV) search (slow)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_GUESS_MVS }, INT_MIN, INT_MAX, V|D, "ec"},
{"deblock", "use strong deblock filter for damaged MBs", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_DEBLOCK }, INT_MIN, INT_MAX, V|D, "ec"},
+{"favor_inter", "favor predicting from the previous frame", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_FAVOR_INTER }, INT_MIN, INT_MAX, V|D, "ec"},
{"bits_per_coded_sample", NULL, OFFSET(bits_per_coded_sample), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
{"pred", "prediction method", OFFSET(prediction_method), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "pred"},
{"left", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PRED_LEFT }, INT_MIN, INT_MAX, V|E, "pred"},
@@ -238,6 +250,7 @@ static const AVOption avcodec_options[] = {
{"vis_mb_type", "visualize block types", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_MB_TYPE }, INT_MIN, INT_MAX, V|D, "debug"},
{"buffers", "picture buffer allocations", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_BUFFERS }, INT_MIN, INT_MAX, V|D, "debug"},
{"thread_ops", "threading operations", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_THREADS }, INT_MIN, INT_MAX, V|A|D, "debug"},
+{"nomc", "skip motion compensation", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_NOMC }, INT_MIN, INT_MAX, V|A|D, "debug"},
{"vismv", "visualize motion vectors (MVs)", OFFSET(debug_mv), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|D, "debug_mv"},
{"pf", "forward predicted MVs of P-frames", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_MV_P_FOR }, INT_MIN, INT_MAX, V|D, "debug_mv"},
{"bf", "forward predicted MVs of B-frames", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_MV_B_FOR }, INT_MIN, INT_MAX, V|D, "debug_mv"},
@@ -386,7 +399,7 @@ static const AVOption avcodec_options[] = {
{"em", "Emergency", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_EMERGENCY }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"vo", "Voice Over", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_VOICE_OVER }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"ka", "Karaoke", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_KARAOKE }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
-{"request_sample_fmt", "sample format audio decoders should prefer", OFFSET(request_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT, {.i64=AV_SAMPLE_FMT_NONE}, -1, AV_SAMPLE_FMT_NB-1, A|D, "request_sample_fmt"},
+{"request_sample_fmt", "sample format audio decoders should prefer", OFFSET(request_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT, {.i64=AV_SAMPLE_FMT_NONE}, -1, INT_MAX, A|D, "request_sample_fmt"},
{"pkt_timebase", NULL, OFFSET(pkt_timebase), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0},
{"sub_charenc", "set input text subtitles character encoding", OFFSET(sub_charenc), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, S|D},
{"sub_charenc_mode", "set input text subtitles character encoding mode", OFFSET(sub_charenc_mode), AV_OPT_TYPE_FLAGS, {.i64 = FF_SUB_CHARENC_MODE_AUTOMATIC}, -1, INT_MAX, S|D, "sub_charenc_mode"},
diff --git a/chromium/third_party/ffmpeg/libavcodec/opus.c b/chromium/third_party/ffmpeg/libavcodec/opus.c
new file mode 100644
index 00000000000..e76c510a775
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/opus.c
@@ -0,0 +1,428 @@
+/*
+ * Copyright (c) 2012 Andrew D'Addesio
+ * Copyright (c) 2013-2014 Mozilla Corporation
+ *
+ * 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
+ * Opus decoder/parser shared code
+ */
+
+#include <stdint.h>
+
+#include "libavutil/error.h"
+
+#include "opus.h"
+#include "vorbis.h"
+
+static const uint16_t opus_frame_duration[32] = {
+ 480, 960, 1920, 2880,
+ 480, 960, 1920, 2880,
+ 480, 960, 1920, 2880,
+ 480, 960,
+ 480, 960,
+ 120, 240, 480, 960,
+ 120, 240, 480, 960,
+ 120, 240, 480, 960,
+ 120, 240, 480, 960,
+};
+
+/**
+ * Read a 1- or 2-byte frame length
+ */
+static inline int xiph_lacing_16bit(const uint8_t **ptr, const uint8_t *end)
+{
+ int val;
+
+ if (*ptr >= end)
+ return AVERROR_INVALIDDATA;
+ val = *(*ptr)++;
+ if (val >= 252) {
+ if (*ptr >= end)
+ return AVERROR_INVALIDDATA;
+ val += 4 * *(*ptr)++;
+ }
+ return val;
+}
+
+/**
+ * Read a multi-byte length (used for code 3 packet padding size)
+ */
+static inline int xiph_lacing_full(const uint8_t **ptr, const uint8_t *end)
+{
+ int val = 0;
+ int next;
+
+ while (1) {
+ if (*ptr >= end || val > INT_MAX - 254)
+ return AVERROR_INVALIDDATA;
+ next = *(*ptr)++;
+ val += next;
+ if (next < 255)
+ break;
+ else
+ val--;
+ }
+ return val;
+}
+
+/**
+ * Parse Opus packet info from raw packet data
+ */
+int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size,
+ int self_delimiting)
+{
+ const uint8_t *ptr = buf;
+ const uint8_t *end = buf + buf_size;
+ int padding = 0;
+ int frame_bytes, i;
+
+ if (buf_size < 1)
+ goto fail;
+
+ /* TOC byte */
+ i = *ptr++;
+ pkt->code = (i ) & 0x3;
+ pkt->stereo = (i >> 2) & 0x1;
+ pkt->config = (i >> 3) & 0x1F;
+
+ /* code 2 and code 3 packets have at least 1 byte after the TOC */
+ if (pkt->code >= 2 && buf_size < 2)
+ goto fail;
+
+ switch (pkt->code) {
+ case 0:
+ /* 1 frame */
+ pkt->frame_count = 1;
+ pkt->vbr = 0;
+
+ if (self_delimiting) {
+ int len = xiph_lacing_16bit(&ptr, end);
+ if (len < 0 || len > end - ptr)
+ goto fail;
+ end = ptr + len;
+ buf_size = end - buf;
+ }
+
+ frame_bytes = end - ptr;
+ if (frame_bytes > MAX_FRAME_SIZE)
+ goto fail;
+ pkt->frame_offset[0] = ptr - buf;
+ pkt->frame_size[0] = frame_bytes;
+ break;
+ case 1:
+ /* 2 frames, equal size */
+ pkt->frame_count = 2;
+ pkt->vbr = 0;
+
+ if (self_delimiting) {
+ int len = xiph_lacing_16bit(&ptr, end);
+ if (len < 0 || 2 * len > end - ptr)
+ goto fail;
+ end = ptr + 2 * len;
+ buf_size = end - buf;
+ }
+
+ frame_bytes = end - ptr;
+ if (frame_bytes & 1 || frame_bytes >> 1 > MAX_FRAME_SIZE)
+ goto fail;
+ pkt->frame_offset[0] = ptr - buf;
+ pkt->frame_size[0] = frame_bytes >> 1;
+ pkt->frame_offset[1] = pkt->frame_offset[0] + pkt->frame_size[0];
+ pkt->frame_size[1] = frame_bytes >> 1;
+ break;
+ case 2:
+ /* 2 frames, different sizes */
+ pkt->frame_count = 2;
+ pkt->vbr = 1;
+
+ /* read 1st frame size */
+ frame_bytes = xiph_lacing_16bit(&ptr, end);
+ if (frame_bytes < 0)
+ goto fail;
+
+ if (self_delimiting) {
+ int len = xiph_lacing_16bit(&ptr, end);
+ if (len < 0 || len + frame_bytes > end - ptr)
+ goto fail;
+ end = ptr + frame_bytes + len;
+ buf_size = end - buf;
+ }
+
+ pkt->frame_offset[0] = ptr - buf;
+ pkt->frame_size[0] = frame_bytes;
+
+ /* calculate 2nd frame size */
+ frame_bytes = end - ptr - pkt->frame_size[0];
+ if (frame_bytes < 0 || frame_bytes > MAX_FRAME_SIZE)
+ goto fail;
+ pkt->frame_offset[1] = pkt->frame_offset[0] + pkt->frame_size[0];
+ pkt->frame_size[1] = frame_bytes;
+ break;
+ case 3:
+ /* 1 to 48 frames, can be different sizes */
+ i = *ptr++;
+ pkt->frame_count = (i ) & 0x3F;
+ padding = (i >> 6) & 0x01;
+ pkt->vbr = (i >> 7) & 0x01;
+
+ if (pkt->frame_count == 0 || pkt->frame_count > MAX_FRAMES)
+ goto fail;
+
+ /* read padding size */
+ if (padding) {
+ padding = xiph_lacing_full(&ptr, end);
+ if (padding < 0)
+ goto fail;
+ }
+
+ /* read frame sizes */
+ if (pkt->vbr) {
+ /* for VBR, all frames except the final one have their size coded
+ in the bitstream. the last frame size is implicit. */
+ int total_bytes = 0;
+ for (i = 0; i < pkt->frame_count - 1; i++) {
+ frame_bytes = xiph_lacing_16bit(&ptr, end);
+ if (frame_bytes < 0)
+ goto fail;
+ pkt->frame_size[i] = frame_bytes;
+ total_bytes += frame_bytes;
+ }
+
+ if (self_delimiting) {
+ int len = xiph_lacing_16bit(&ptr, end);
+ if (len < 0 || len + total_bytes + padding > end - ptr)
+ goto fail;
+ end = ptr + total_bytes + len + padding;
+ buf_size = end - buf;
+ }
+
+ frame_bytes = end - ptr - padding;
+ if (total_bytes > frame_bytes)
+ goto fail;
+ pkt->frame_offset[0] = ptr - buf;
+ for (i = 1; i < pkt->frame_count; i++)
+ pkt->frame_offset[i] = pkt->frame_offset[i-1] + pkt->frame_size[i-1];
+ pkt->frame_size[pkt->frame_count-1] = frame_bytes - total_bytes;
+ } else {
+ /* for CBR, the remaining packet bytes are divided evenly between
+ the frames */
+ if (self_delimiting) {
+ frame_bytes = xiph_lacing_16bit(&ptr, end);
+ if (frame_bytes < 0 || pkt->frame_count * frame_bytes + padding > end - ptr)
+ goto fail;
+ end = ptr + pkt->frame_count * frame_bytes + padding;
+ buf_size = end - buf;
+ } else {
+ frame_bytes = end - ptr - padding;
+ if (frame_bytes % pkt->frame_count ||
+ frame_bytes / pkt->frame_count > MAX_FRAME_SIZE)
+ goto fail;
+ frame_bytes /= pkt->frame_count;
+ }
+
+ pkt->frame_offset[0] = ptr - buf;
+ pkt->frame_size[0] = frame_bytes;
+ for (i = 1; i < pkt->frame_count; i++) {
+ pkt->frame_offset[i] = pkt->frame_offset[i-1] + pkt->frame_size[i-1];
+ pkt->frame_size[i] = frame_bytes;
+ }
+ }
+ }
+
+ pkt->packet_size = buf_size;
+ pkt->data_size = pkt->packet_size - padding;
+
+ /* total packet duration cannot be larger than 120ms */
+ pkt->frame_duration = opus_frame_duration[pkt->config];
+ if (pkt->frame_duration * pkt->frame_count > MAX_PACKET_DUR)
+ goto fail;
+
+ /* set mode and bandwidth */
+ if (pkt->config < 12) {
+ pkt->mode = OPUS_MODE_SILK;
+ pkt->bandwidth = pkt->config >> 2;
+ } else if (pkt->config < 16) {
+ pkt->mode = OPUS_MODE_HYBRID;
+ pkt->bandwidth = OPUS_BANDWIDTH_SUPERWIDEBAND + (pkt->config >= 14);
+ } else {
+ pkt->mode = OPUS_MODE_CELT;
+ pkt->bandwidth = (pkt->config - 16) >> 2;
+ /* skip mediumband */
+ if (pkt->bandwidth)
+ pkt->bandwidth++;
+ }
+
+ return 0;
+
+fail:
+ memset(pkt, 0, sizeof(*pkt));
+ return AVERROR_INVALIDDATA;
+}
+
+static int channel_reorder_vorbis(int nb_channels, int channel_idx)
+{
+ return ff_vorbis_channel_layout_offsets[nb_channels - 1][channel_idx];
+}
+
+static int channel_reorder_unknown(int nb_channels, int channel_idx)
+{
+ return channel_idx;
+}
+
+av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
+ OpusContext *s)
+{
+ static const uint8_t default_channel_map[2] = { 0, 1 };
+ uint8_t default_extradata[19] = {
+ 'O', 'p', 'u', 's', 'H', 'e', 'a', 'd',
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+
+ int (*channel_reorder)(int, int) = channel_reorder_unknown;
+
+ const uint8_t *extradata, *channel_map;
+ int extradata_size;
+ int version, channels, map_type, streams, stereo_streams, i, j;
+ uint64_t layout;
+
+ if (!avctx->extradata) {
+ if (avctx->channels > 2) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Multichannel configuration without extradata.\n");
+ return AVERROR(EINVAL);
+ }
+ default_extradata[9] = (avctx->channels == 1) ? 1 : 2;
+ extradata = default_extradata;
+ extradata_size = sizeof(default_extradata);
+ } else {
+ extradata = avctx->extradata;
+ extradata_size = avctx->extradata_size;
+ }
+
+ if (extradata_size < 19) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n",
+ extradata_size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ version = extradata[8];
+ if (version > 15) {
+ avpriv_request_sample(avctx, "Extradata version %d", version);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ avctx->delay = AV_RL16(extradata + 10);
+
+ channels = extradata[9];
+ if (!channels) {
+ av_log(avctx, AV_LOG_ERROR, "Zero channel count specified in the extadata\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ s->gain_i = AV_RL16(extradata + 16);
+ if (s->gain_i)
+ s->gain = pow(10, s->gain_i / (20.0 * 256));
+
+ map_type = extradata[18];
+ if (!map_type) {
+ if (channels > 2) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Channel mapping 0 is only specified for up to 2 channels\n");
+ return AVERROR_INVALIDDATA;
+ }
+ layout = (channels == 1) ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
+ streams = 1;
+ stereo_streams = channels - 1;
+ channel_map = default_channel_map;
+ } else if (map_type == 1 || map_type == 255) {
+ if (extradata_size < 21 + channels) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n",
+ extradata_size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ streams = extradata[19];
+ stereo_streams = extradata[20];
+ if (!streams || stereo_streams > streams ||
+ streams + stereo_streams > 255) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid stream/stereo stream count: %d/%d\n", streams, stereo_streams);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (map_type == 1) {
+ if (channels > 8) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Channel mapping 1 is only specified for up to 8 channels\n");
+ return AVERROR_INVALIDDATA;
+ }
+ layout = ff_vorbis_channel_layouts[channels - 1];
+ channel_reorder = channel_reorder_vorbis;
+ } else
+ layout = 0;
+
+ channel_map = extradata + 21;
+ } else {
+ avpriv_request_sample(avctx, "Mapping type %d", map_type);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ s->channel_maps = av_mallocz_array(channels, sizeof(*s->channel_maps));
+ if (!s->channel_maps)
+ return AVERROR(ENOMEM);
+
+ for (i = 0; i < channels; i++) {
+ ChannelMap *map = &s->channel_maps[i];
+ uint8_t idx = channel_map[channel_reorder(channels, i)];
+
+ if (idx == 255) {
+ map->silence = 1;
+ continue;
+ } else if (idx >= streams + stereo_streams) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid channel map for output channel %d: %d\n", i, idx);
+ return AVERROR_INVALIDDATA;
+ }
+
+ /* check that we din't see this index yet */
+ map->copy = 0;
+ for (j = 0; j < i; j++)
+ if (channel_map[channel_reorder(channels, j)] == idx) {
+ map->copy = 1;
+ map->copy_idx = j;
+ break;
+ }
+
+ if (idx < 2 * stereo_streams) {
+ map->stream_idx = idx / 2;
+ map->channel_idx = idx & 1;
+ } else {
+ map->stream_idx = idx - stereo_streams;
+ map->channel_idx = 0;
+ }
+ }
+
+ avctx->channels = channels;
+ avctx->channel_layout = layout;
+ s->nb_streams = streams;
+ s->nb_stereo_streams = stereo_streams;
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/opus.h b/chromium/third_party/ffmpeg/libavcodec/opus.h
new file mode 100644
index 00000000000..a1e8ed0e18a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/opus.h
@@ -0,0 +1,411 @@
+/*
+ * Opus decoder/demuxer common functions
+ * Copyright (c) 2012 Andrew D'Addesio
+ * Copyright (c) 2013-2014 Mozilla Corporation
+ *
+ * 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_OPUS_H
+#define AVCODEC_OPUS_H
+
+#include <stdint.h>
+
+#include "libavutil/audio_fifo.h"
+#include "libavutil/float_dsp.h"
+#include "libavutil/frame.h"
+
+#include "libswresample/swresample.h"
+
+#include "avcodec.h"
+#include "get_bits.h"
+
+#define MAX_FRAME_SIZE 1275
+#define MAX_FRAMES 48
+#define MAX_PACKET_DUR 5760
+
+#define CELT_SHORT_BLOCKSIZE 120
+#define CELT_OVERLAP CELT_SHORT_BLOCKSIZE
+#define CELT_MAX_LOG_BLOCKS 3
+#define CELT_MAX_FRAME_SIZE (CELT_SHORT_BLOCKSIZE * (1 << CELT_MAX_LOG_BLOCKS))
+#define CELT_MAX_BANDS 21
+#define CELT_VECTORS 11
+#define CELT_ALLOC_STEPS 6
+#define CELT_FINE_OFFSET 21
+#define CELT_MAX_FINE_BITS 8
+#define CELT_NORM_SCALE 16384
+#define CELT_QTHETA_OFFSET 4
+#define CELT_QTHETA_OFFSET_TWOPHASE 16
+#define CELT_DEEMPH_COEFF 0.85000610f
+#define CELT_POSTFILTER_MINPERIOD 15
+#define CELT_ENERGY_SILENCE (-28.0f)
+
+#define SILK_HISTORY 322
+#define SILK_MAX_LPC 16
+
+#define ROUND_MULL(a,b,s) (((MUL64(a, b) >> (s - 1)) + 1) >> 1)
+#define ROUND_MUL16(a,b) ((MUL16(a, b) + 16384) >> 15)
+#define opus_ilog(i) (av_log2(i) + !!(i))
+
+enum OpusMode {
+ OPUS_MODE_SILK,
+ OPUS_MODE_HYBRID,
+ OPUS_MODE_CELT
+};
+
+enum OpusBandwidth {
+ OPUS_BANDWIDTH_NARROWBAND,
+ OPUS_BANDWIDTH_MEDIUMBAND,
+ OPUS_BANDWIDTH_WIDEBAND,
+ OPUS_BANDWIDTH_SUPERWIDEBAND,
+ OPUS_BANDWIDTH_FULLBAND
+};
+
+typedef struct RawBitsContext {
+ const uint8_t *position;
+ unsigned int bytes;
+ unsigned int cachelen;
+ unsigned int cacheval;
+} RawBitsContext;
+
+typedef struct OpusRangeCoder {
+ GetBitContext gb;
+ RawBitsContext rb;
+ unsigned int range;
+ unsigned int value;
+ unsigned int total_read_bits;
+} OpusRangeCoder;
+
+typedef struct SilkContext SilkContext;
+
+typedef struct CeltContext CeltContext;
+
+typedef struct OpusPacket {
+ int packet_size; /**< packet size */
+ int data_size; /**< size of the useful data -- packet size - padding */
+ int code; /**< packet code: specifies the frame layout */
+ int stereo; /**< whether this packet is mono or stereo */
+ int vbr; /**< vbr flag */
+ int config; /**< configuration: tells the audio mode,
+ ** bandwidth, and frame duration */
+ int frame_count; /**< frame count */
+ int frame_offset[MAX_FRAMES]; /**< frame offsets */
+ int frame_size[MAX_FRAMES]; /**< frame sizes */
+ int frame_duration; /**< frame duration, in samples @ 48kHz */
+ enum OpusMode mode; /**< mode */
+ enum OpusBandwidth bandwidth; /**< bandwidth */
+} OpusPacket;
+
+typedef struct OpusStreamContext {
+ AVCodecContext *avctx;
+ int output_channels;
+
+ OpusRangeCoder rc;
+ OpusRangeCoder redundancy_rc;
+ SilkContext *silk;
+ CeltContext *celt;
+ AVFloatDSPContext *fdsp;
+
+ float silk_buf[2][960];
+ float *silk_output[2];
+ DECLARE_ALIGNED(32, float, celt_buf)[2][960];
+ float *celt_output[2];
+
+ float redundancy_buf[2][960];
+ float *redundancy_output[2];
+
+ /* data buffers for the final output data */
+ float *out[2];
+ int out_size;
+
+ float *out_dummy;
+ int out_dummy_allocated_size;
+
+ SwrContext *swr;
+ AVAudioFifo *celt_delay;
+ int silk_samplerate;
+ /* number of samples we still want to get from the resampler */
+ int delayed_samples;
+
+ OpusPacket packet;
+
+ int redundancy_idx;
+} OpusStreamContext;
+
+// a mapping between an opus stream and an output channel
+typedef struct ChannelMap {
+ int stream_idx;
+ int channel_idx;
+
+ // when a single decoded channel is mapped to multiple output channels, we
+ // write to the first output directly and copy from it to the others
+ // this field is set to 1 for those copied output channels
+ int copy;
+ // this is the index of the output channel to copy from
+ int copy_idx;
+
+ // this channel is silent
+ int silence;
+} ChannelMap;
+
+typedef struct OpusContext {
+ OpusStreamContext *streams;
+ int nb_streams;
+ int nb_stereo_streams;
+
+ AVFloatDSPContext fdsp;
+ int16_t gain_i;
+ float gain;
+
+ ChannelMap *channel_maps;
+} OpusContext;
+
+static av_always_inline void opus_rc_normalize(OpusRangeCoder *rc)
+{
+ while (rc->range <= 1<<23) {
+ rc->value = ((rc->value << 8) | (get_bits(&rc->gb, 8) ^ 0xFF)) & ((1u << 31) - 1);
+ rc->range <<= 8;
+ rc->total_read_bits += 8;
+ }
+}
+
+static av_always_inline void opus_rc_update(OpusRangeCoder *rc, unsigned int scale,
+ unsigned int low, unsigned int high,
+ unsigned int total)
+{
+ rc->value -= scale * (total - high);
+ rc->range = low ? scale * (high - low)
+ : rc->range - scale * (total - high);
+ opus_rc_normalize(rc);
+}
+
+static av_always_inline unsigned int opus_rc_getsymbol(OpusRangeCoder *rc, const uint16_t *cdf)
+{
+ unsigned int k, scale, total, symbol, low, high;
+
+ total = *cdf++;
+
+ scale = rc->range / total;
+ symbol = rc->value / scale + 1;
+ symbol = total - FFMIN(symbol, total);
+
+ for (k = 0; cdf[k] <= symbol; k++);
+ high = cdf[k];
+ low = k ? cdf[k-1] : 0;
+
+ opus_rc_update(rc, scale, low, high, total);
+
+ return k;
+}
+
+static av_always_inline unsigned int opus_rc_p2model(OpusRangeCoder *rc, unsigned int bits)
+{
+ unsigned int k, scale;
+ scale = rc->range >> bits; // in this case, scale = symbol
+
+ if (rc->value >= scale) {
+ rc->value -= scale;
+ rc->range -= scale;
+ k = 0;
+ } else {
+ rc->range = scale;
+ k = 1;
+ }
+ opus_rc_normalize(rc);
+ return k;
+}
+
+/**
+ * CELT: estimate bits of entropy that have thus far been consumed for the
+ * current CELT frame, to integer and fractional (1/8th bit) precision
+ */
+static av_always_inline unsigned int opus_rc_tell(const OpusRangeCoder *rc)
+{
+ return rc->total_read_bits - av_log2(rc->range) - 1;
+}
+
+static av_always_inline unsigned int opus_rc_tell_frac(const OpusRangeCoder *rc)
+{
+ unsigned int i, total_bits, rcbuffer, range;
+
+ total_bits = rc->total_read_bits << 3;
+ rcbuffer = av_log2(rc->range) + 1;
+ range = rc->range >> (rcbuffer-16);
+
+ for (i = 0; i < 3; i++) {
+ int bit;
+ range = range * range >> 15;
+ bit = range >> 16;
+ rcbuffer = rcbuffer << 1 | bit;
+ range >>= bit;
+ }
+
+ return total_bits - rcbuffer;
+}
+
+/**
+ * CELT: read 1-25 raw bits at the end of the frame, backwards byte-wise
+ */
+static av_always_inline unsigned int opus_getrawbits(OpusRangeCoder *rc, unsigned int count)
+{
+ unsigned int value = 0;
+
+ while (rc->rb.bytes && rc->rb.cachelen < count) {
+ rc->rb.cacheval |= *--rc->rb.position << rc->rb.cachelen;
+ rc->rb.cachelen += 8;
+ rc->rb.bytes--;
+ }
+
+ value = rc->rb.cacheval & ((1<<count)-1);
+ rc->rb.cacheval >>= count;
+ rc->rb.cachelen -= count;
+ rc->total_read_bits += count;
+
+ return value;
+}
+
+/**
+ * CELT: read a uniform distribution
+ */
+static av_always_inline unsigned int opus_rc_unimodel(OpusRangeCoder *rc, unsigned int size)
+{
+ unsigned int bits, k, scale, total;
+
+ bits = opus_ilog(size - 1);
+ total = (bits > 8) ? ((size - 1) >> (bits - 8)) + 1 : size;
+
+ scale = rc->range / total;
+ k = rc->value / scale + 1;
+ k = total - FFMIN(k, total);
+ opus_rc_update(rc, scale, k, k + 1, total);
+
+ if (bits > 8) {
+ k = k << (bits - 8) | opus_getrawbits(rc, bits - 8);
+ return FFMIN(k, size - 1);
+ } else
+ return k;
+}
+
+static av_always_inline int opus_rc_laplace(OpusRangeCoder *rc, unsigned int symbol, int decay)
+{
+ /* extends the range coder to model a Laplace distribution */
+ int value = 0;
+ unsigned int scale, low = 0, center;
+
+ scale = rc->range >> 15;
+ center = rc->value / scale + 1;
+ center = (1 << 15) - FFMIN(center, 1 << 15);
+
+ if (center >= symbol) {
+ value++;
+ low = symbol;
+ symbol = 1 + ((32768 - 32 - symbol) * (16384-decay) >> 15);
+
+ while (symbol > 1 && center >= low + 2 * symbol) {
+ value++;
+ symbol *= 2;
+ low += symbol;
+ symbol = (((symbol - 2) * decay) >> 15) + 1;
+ }
+
+ if (symbol <= 1) {
+ int distance = (center - low) >> 1;
+ value += distance;
+ low += 2 * distance;
+ }
+
+ if (center < low + symbol)
+ value *= -1;
+ else
+ low += symbol;
+ }
+
+ opus_rc_update(rc, scale, low, FFMIN(low + symbol, 32768), 32768);
+
+ return value;
+}
+
+static av_always_inline unsigned int opus_rc_stepmodel(OpusRangeCoder *rc, int k0)
+{
+ /* Use a probability of 3 up to itheta=8192 and then use 1 after */
+ unsigned int k, scale, symbol, total = (k0+1)*3 + k0;
+ scale = rc->range / total;
+ symbol = rc->value / scale + 1;
+ symbol = total - FFMIN(symbol, total);
+
+ k = (symbol < (k0+1)*3) ? symbol/3 : symbol - (k0+1)*2;
+
+ opus_rc_update(rc, scale, (k <= k0) ? 3*(k+0) : (k-1-k0) + 3*(k0+1),
+ (k <= k0) ? 3*(k+1) : (k-0-k0) + 3*(k0+1), total);
+ return k;
+}
+
+static av_always_inline unsigned int opus_rc_trimodel(OpusRangeCoder *rc, int qn)
+{
+ unsigned int k, scale, symbol, total, low, center;
+
+ total = ((qn>>1) + 1) * ((qn>>1) + 1);
+ scale = rc->range / total;
+ center = rc->value / scale + 1;
+ center = total - FFMIN(center, total);
+
+ if (center < total >> 1) {
+ k = (ff_sqrt(8 * center + 1) - 1) >> 1;
+ low = k * (k + 1) >> 1;
+ symbol = k + 1;
+ } else {
+ k = (2*(qn + 1) - ff_sqrt(8*(total - center - 1) + 1)) >> 1;
+ low = total - ((qn + 1 - k) * (qn + 2 - k) >> 1);
+ symbol = qn + 1 - k;
+ }
+
+ opus_rc_update(rc, scale, low, low + symbol, total);
+
+ return k;
+}
+
+int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size,
+ int self_delimited);
+
+int ff_opus_parse_extradata(AVCodecContext *avctx, OpusContext *s);
+
+int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels);
+void ff_silk_free(SilkContext **ps);
+void ff_silk_flush(SilkContext *s);
+
+/**
+ * Decode the LP layer of one Opus frame (which may correspond to several SILK
+ * frames).
+ */
+int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc,
+ float *output[2],
+ enum OpusBandwidth bandwidth, int coded_channels,
+ int duration_ms);
+
+int ff_celt_init(AVCodecContext *avctx, CeltContext **s, int output_channels);
+
+void ff_celt_free(CeltContext **s);
+
+void ff_celt_flush(CeltContext *s);
+
+int ff_celt_decode_frame(CeltContext *s, OpusRangeCoder *rc,
+ float **output, int coded_channels, int frame_size,
+ int startband, int endband);
+
+extern const float ff_celt_window2[120];
+
+#endif /* AVCODEC_OPUS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/opus_celt.c b/chromium/third_party/ffmpeg/libavcodec/opus_celt.c
new file mode 100644
index 00000000000..26d15392f29
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/opus_celt.c
@@ -0,0 +1,2221 @@
+/*
+ * Copyright (c) 2012 Andrew D'Addesio
+ * Copyright (c) 2013-2014 Mozilla Corporation
+ *
+ * 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
+ * Opus CELT decoder
+ */
+
+#include <stdint.h>
+
+#include "libavutil/float_dsp.h"
+
+#include "opus.h"
+#include "opus_imdct.h"
+
+enum CeltSpread {
+ CELT_SPREAD_NONE,
+ CELT_SPREAD_LIGHT,
+ CELT_SPREAD_NORMAL,
+ CELT_SPREAD_AGGRESSIVE
+};
+
+typedef struct CeltFrame {
+ float energy[CELT_MAX_BANDS];
+ float prev_energy[2][CELT_MAX_BANDS];
+
+ uint8_t collapse_masks[CELT_MAX_BANDS];
+
+ /* buffer for mdct output + postfilter */
+ DECLARE_ALIGNED(32, float, buf)[2048];
+
+ /* postfilter parameters */
+ int pf_period_new;
+ float pf_gains_new[3];
+ int pf_period;
+ float pf_gains[3];
+ int pf_period_old;
+ float pf_gains_old[3];
+
+ float deemph_coeff;
+} CeltFrame;
+
+struct CeltContext {
+ // constant values that do not change during context lifetime
+ AVCodecContext *avctx;
+ CeltIMDCTContext *imdct[4];
+ AVFloatDSPContext dsp;
+ int output_channels;
+
+ // values that have inter-frame effect and must be reset on flush
+ CeltFrame frame[2];
+ uint32_t seed;
+ int flushed;
+
+ // values that only affect a single frame
+ int coded_channels;
+ int framebits;
+ int duration;
+
+ /* number of iMDCT blocks in the frame */
+ int blocks;
+ /* size of each block */
+ int blocksize;
+
+ int startband;
+ int endband;
+ int codedbands;
+
+ int anticollapse_bit;
+
+ int intensitystereo;
+ int dualstereo;
+ enum CeltSpread spread;
+
+ int remaining;
+ int remaining2;
+ int fine_bits [CELT_MAX_BANDS];
+ int fine_priority[CELT_MAX_BANDS];
+ int pulses [CELT_MAX_BANDS];
+ int tf_change [CELT_MAX_BANDS];
+
+ DECLARE_ALIGNED(32, float, coeffs)[2][CELT_MAX_FRAME_SIZE];
+ DECLARE_ALIGNED(32, float, scratch)[22 * 8]; // MAX(celt_freq_range) * 1<<CELT_MAX_LOG_BLOCKS
+};
+
+static const uint16_t celt_model_tapset[] = { 4, 2, 3, 4 };
+
+static const uint16_t celt_model_spread[] = { 32, 7, 9, 30, 32 };
+
+static const uint16_t celt_model_alloc_trim[] = {
+ 128, 2, 4, 9, 19, 41, 87, 109, 119, 124, 126, 128
+};
+
+static const uint16_t celt_model_energy_small[] = { 4, 2, 3, 4 };
+
+static const uint8_t celt_freq_bands[] = { /* in steps of 200Hz */
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 34, 40, 48, 60, 78, 100
+};
+
+static const uint8_t celt_freq_range[] = {
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 6, 6, 8, 12, 18, 22
+};
+
+static const uint8_t celt_log_freq_range[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 16, 16, 16, 21, 21, 24, 29, 34, 36
+};
+
+static const int8_t celt_tf_select[4][2][2][2] = {
+ { { { 0, -1 }, { 0, -1 } }, { { 0, -1 }, { 0, -1 } } },
+ { { { 0, -1 }, { 0, -2 } }, { { 1, 0 }, { 1, -1 } } },
+ { { { 0, -2 }, { 0, -3 } }, { { 2, 0 }, { 1, -1 } } },
+ { { { 0, -2 }, { 0, -3 } }, { { 3, 0 }, { 1, -1 } } }
+};
+
+static const float celt_mean_energy[] = {
+ 6.437500f, 6.250000f, 5.750000f, 5.312500f, 5.062500f,
+ 4.812500f, 4.500000f, 4.375000f, 4.875000f, 4.687500f,
+ 4.562500f, 4.437500f, 4.875000f, 4.625000f, 4.312500f,
+ 4.500000f, 4.375000f, 4.625000f, 4.750000f, 4.437500f,
+ 3.750000f, 3.750000f, 3.750000f, 3.750000f, 3.750000f
+};
+
+static const float celt_alpha_coef[] = {
+ 29440.0f/32768.0f, 26112.0f/32768.0f, 21248.0f/32768.0f, 16384.0f/32768.0f
+};
+
+static const float celt_beta_coef[] = { /* TODO: precompute 1 minus this if the code ends up neater */
+ 30147.0f/32768.0f, 22282.0f/32768.0f, 12124.0f/32768.0f, 6554.0f/32768.0f
+};
+
+static const uint8_t celt_coarse_energy_dist[4][2][42] = {
+ {
+ { // 120-sample inter
+ 72, 127, 65, 129, 66, 128, 65, 128, 64, 128, 62, 128, 64, 128,
+ 64, 128, 92, 78, 92, 79, 92, 78, 90, 79, 116, 41, 115, 40,
+ 114, 40, 132, 26, 132, 26, 145, 17, 161, 12, 176, 10, 177, 11
+ }, { // 120-sample intra
+ 24, 179, 48, 138, 54, 135, 54, 132, 53, 134, 56, 133, 55, 132,
+ 55, 132, 61, 114, 70, 96, 74, 88, 75, 88, 87, 74, 89, 66,
+ 91, 67, 100, 59, 108, 50, 120, 40, 122, 37, 97, 43, 78, 50
+ }
+ }, {
+ { // 240-sample inter
+ 83, 78, 84, 81, 88, 75, 86, 74, 87, 71, 90, 73, 93, 74,
+ 93, 74, 109, 40, 114, 36, 117, 34, 117, 34, 143, 17, 145, 18,
+ 146, 19, 162, 12, 165, 10, 178, 7, 189, 6, 190, 8, 177, 9
+ }, { // 240-sample intra
+ 23, 178, 54, 115, 63, 102, 66, 98, 69, 99, 74, 89, 71, 91,
+ 73, 91, 78, 89, 86, 80, 92, 66, 93, 64, 102, 59, 103, 60,
+ 104, 60, 117, 52, 123, 44, 138, 35, 133, 31, 97, 38, 77, 45
+ }
+ }, {
+ { // 480-sample inter
+ 61, 90, 93, 60, 105, 42, 107, 41, 110, 45, 116, 38, 113, 38,
+ 112, 38, 124, 26, 132, 27, 136, 19, 140, 20, 155, 14, 159, 16,
+ 158, 18, 170, 13, 177, 10, 187, 8, 192, 6, 175, 9, 159, 10
+ }, { // 480-sample intra
+ 21, 178, 59, 110, 71, 86, 75, 85, 84, 83, 91, 66, 88, 73,
+ 87, 72, 92, 75, 98, 72, 105, 58, 107, 54, 115, 52, 114, 55,
+ 112, 56, 129, 51, 132, 40, 150, 33, 140, 29, 98, 35, 77, 42
+ }
+ }, {
+ { // 960-sample inter
+ 42, 121, 96, 66, 108, 43, 111, 40, 117, 44, 123, 32, 120, 36,
+ 119, 33, 127, 33, 134, 34, 139, 21, 147, 23, 152, 20, 158, 25,
+ 154, 26, 166, 21, 173, 16, 184, 13, 184, 10, 150, 13, 139, 15
+ }, { // 960-sample intra
+ 22, 178, 63, 114, 74, 82, 84, 83, 92, 82, 103, 62, 96, 72,
+ 96, 67, 101, 73, 107, 72, 113, 55, 118, 52, 125, 52, 118, 52,
+ 117, 55, 135, 49, 137, 39, 157, 32, 145, 29, 97, 33, 77, 40
+ }
+ }
+};
+
+static const uint8_t celt_static_alloc[11][21] = { /* 1/32 bit/sample */
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 90, 80, 75, 69, 63, 56, 49, 40, 34, 29, 20, 18, 10, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 110, 100, 90, 84, 78, 71, 65, 58, 51, 45, 39, 32, 26, 20, 12, 0, 0, 0, 0, 0, 0 },
+ { 118, 110, 103, 93, 86, 80, 75, 70, 65, 59, 53, 47, 40, 31, 23, 15, 4, 0, 0, 0, 0 },
+ { 126, 119, 112, 104, 95, 89, 83, 78, 72, 66, 60, 54, 47, 39, 32, 25, 17, 12, 1, 0, 0 },
+ { 134, 127, 120, 114, 103, 97, 91, 85, 78, 72, 66, 60, 54, 47, 41, 35, 29, 23, 16, 10, 1 },
+ { 144, 137, 130, 124, 113, 107, 101, 95, 88, 82, 76, 70, 64, 57, 51, 45, 39, 33, 26, 15, 1 },
+ { 152, 145, 138, 132, 123, 117, 111, 105, 98, 92, 86, 80, 74, 67, 61, 55, 49, 43, 36, 20, 1 },
+ { 162, 155, 148, 142, 133, 127, 121, 115, 108, 102, 96, 90, 84, 77, 71, 65, 59, 53, 46, 30, 1 },
+ { 172, 165, 158, 152, 143, 137, 131, 125, 118, 112, 106, 100, 94, 87, 81, 75, 69, 63, 56, 45, 20 },
+ { 200, 200, 200, 200, 200, 200, 200, 200, 198, 193, 188, 183, 178, 173, 168, 163, 158, 153, 148, 129, 104 }
+};
+
+static const uint8_t celt_static_caps[4][2][21] = {
+ { // 120-sample
+ {224, 224, 224, 224, 224, 224, 224, 224, 160, 160,
+ 160, 160, 185, 185, 185, 178, 178, 168, 134, 61, 37},
+ {224, 224, 224, 224, 224, 224, 224, 224, 240, 240,
+ 240, 240, 207, 207, 207, 198, 198, 183, 144, 66, 40},
+ }, { // 240-sample
+ {160, 160, 160, 160, 160, 160, 160, 160, 185, 185,
+ 185, 185, 193, 193, 193, 183, 183, 172, 138, 64, 38},
+ {240, 240, 240, 240, 240, 240, 240, 240, 207, 207,
+ 207, 207, 204, 204, 204, 193, 193, 180, 143, 66, 40},
+ }, { // 480-sample
+ {185, 185, 185, 185, 185, 185, 185, 185, 193, 193,
+ 193, 193, 193, 193, 193, 183, 183, 172, 138, 65, 39},
+ {207, 207, 207, 207, 207, 207, 207, 207, 204, 204,
+ 204, 204, 201, 201, 201, 188, 188, 176, 141, 66, 40},
+ }, { // 960-sample
+ {193, 193, 193, 193, 193, 193, 193, 193, 193, 193,
+ 193, 193, 194, 194, 194, 184, 184, 173, 139, 65, 39},
+ {204, 204, 204, 204, 204, 204, 204, 204, 201, 201,
+ 201, 201, 198, 198, 198, 187, 187, 175, 140, 66, 40}
+ }
+};
+
+static const uint8_t celt_cache_bits[392] = {
+ 40, 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, 7, 7, 7, 7, 7, 7, 7, 7, 40, 15, 23, 28,
+ 31, 34, 36, 38, 39, 41, 42, 43, 44, 45, 46, 47, 47, 49, 50,
+ 51, 52, 53, 54, 55, 55, 57, 58, 59, 60, 61, 62, 63, 63, 65,
+ 66, 67, 68, 69, 70, 71, 71, 40, 20, 33, 41, 48, 53, 57, 61,
+ 64, 66, 69, 71, 73, 75, 76, 78, 80, 82, 85, 87, 89, 91, 92,
+ 94, 96, 98, 101, 103, 105, 107, 108, 110, 112, 114, 117, 119, 121, 123,
+ 124, 126, 128, 40, 23, 39, 51, 60, 67, 73, 79, 83, 87, 91, 94,
+ 97, 100, 102, 105, 107, 111, 115, 118, 121, 124, 126, 129, 131, 135, 139,
+ 142, 145, 148, 150, 153, 155, 159, 163, 166, 169, 172, 174, 177, 179, 35,
+ 28, 49, 65, 78, 89, 99, 107, 114, 120, 126, 132, 136, 141, 145, 149,
+ 153, 159, 165, 171, 176, 180, 185, 189, 192, 199, 205, 211, 216, 220, 225,
+ 229, 232, 239, 245, 251, 21, 33, 58, 79, 97, 112, 125, 137, 148, 157,
+ 166, 174, 182, 189, 195, 201, 207, 217, 227, 235, 243, 251, 17, 35, 63,
+ 86, 106, 123, 139, 152, 165, 177, 187, 197, 206, 214, 222, 230, 237, 250,
+ 25, 31, 55, 75, 91, 105, 117, 128, 138, 146, 154, 161, 168, 174, 180,
+ 185, 190, 200, 208, 215, 222, 229, 235, 240, 245, 255, 16, 36, 65, 89,
+ 110, 128, 144, 159, 173, 185, 196, 207, 217, 226, 234, 242, 250, 11, 41,
+ 74, 103, 128, 151, 172, 191, 209, 225, 241, 255, 9, 43, 79, 110, 138,
+ 163, 186, 207, 227, 246, 12, 39, 71, 99, 123, 144, 164, 182, 198, 214,
+ 228, 241, 253, 9, 44, 81, 113, 142, 168, 192, 214, 235, 255, 7, 49,
+ 90, 127, 160, 191, 220, 247, 6, 51, 95, 134, 170, 203, 234, 7, 47,
+ 87, 123, 155, 184, 212, 237, 6, 52, 97, 137, 174, 208, 240, 5, 57,
+ 106, 151, 192, 231, 5, 59, 111, 158, 202, 243, 5, 55, 103, 147, 187,
+ 224, 5, 60, 113, 161, 206, 248, 4, 65, 122, 175, 224, 4, 67, 127,
+ 182, 234
+};
+
+static const int16_t celt_cache_index[105] = {
+ -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 41, 41, 41,
+ 82, 82, 123, 164, 200, 222, 0, 0, 0, 0, 0, 0, 0, 0, 41,
+ 41, 41, 41, 123, 123, 123, 164, 164, 240, 266, 283, 295, 41, 41, 41,
+ 41, 41, 41, 41, 41, 123, 123, 123, 123, 240, 240, 240, 266, 266, 305,
+ 318, 328, 336, 123, 123, 123, 123, 123, 123, 123, 123, 240, 240, 240, 240,
+ 305, 305, 305, 318, 318, 343, 351, 358, 364, 240, 240, 240, 240, 240, 240,
+ 240, 240, 305, 305, 305, 305, 343, 343, 343, 351, 351, 370, 376, 382, 387,
+};
+
+static const uint8_t celt_log2_frac[] = {
+ 0, 8, 13, 16, 19, 21, 23, 24, 26, 27, 28, 29, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 37
+};
+
+static const uint8_t celt_bit_interleave[] = {
+ 0, 1, 1, 1, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3
+};
+
+static const uint8_t celt_bit_deinterleave[] = {
+ 0x00, 0x03, 0x0C, 0x0F, 0x30, 0x33, 0x3C, 0x3F,
+ 0xC0, 0xC3, 0xCC, 0xCF, 0xF0, 0xF3, 0xFC, 0xFF
+};
+
+static const uint8_t celt_hadamard_ordery[] = {
+ 1, 0,
+ 3, 0, 2, 1,
+ 7, 0, 4, 3, 6, 1, 5, 2,
+ 15, 0, 8, 7, 12, 3, 11, 4, 14, 1, 9, 6, 13, 2, 10, 5
+};
+
+static const uint16_t celt_qn_exp2[] = {
+ 16384, 17866, 19483, 21247, 23170, 25267, 27554, 30048
+};
+
+static const uint32_t celt_pvq_u[1272] = {
+ /* N = 0, K = 0...176 */
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ /* N = 1, K = 1...176 */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ /* N = 2, K = 2...176 */
+ 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41,
+ 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79,
+ 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113,
+ 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143,
+ 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173,
+ 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203,
+ 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233,
+ 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, 261, 263,
+ 265, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 291, 293,
+ 295, 297, 299, 301, 303, 305, 307, 309, 311, 313, 315, 317, 319, 321, 323,
+ 325, 327, 329, 331, 333, 335, 337, 339, 341, 343, 345, 347, 349, 351,
+ /* N = 3, K = 3...176 */
+ 13, 25, 41, 61, 85, 113, 145, 181, 221, 265, 313, 365, 421, 481, 545, 613,
+ 685, 761, 841, 925, 1013, 1105, 1201, 1301, 1405, 1513, 1625, 1741, 1861,
+ 1985, 2113, 2245, 2381, 2521, 2665, 2813, 2965, 3121, 3281, 3445, 3613, 3785,
+ 3961, 4141, 4325, 4513, 4705, 4901, 5101, 5305, 5513, 5725, 5941, 6161, 6385,
+ 6613, 6845, 7081, 7321, 7565, 7813, 8065, 8321, 8581, 8845, 9113, 9385, 9661,
+ 9941, 10225, 10513, 10805, 11101, 11401, 11705, 12013, 12325, 12641, 12961,
+ 13285, 13613, 13945, 14281, 14621, 14965, 15313, 15665, 16021, 16381, 16745,
+ 17113, 17485, 17861, 18241, 18625, 19013, 19405, 19801, 20201, 20605, 21013,
+ 21425, 21841, 22261, 22685, 23113, 23545, 23981, 24421, 24865, 25313, 25765,
+ 26221, 26681, 27145, 27613, 28085, 28561, 29041, 29525, 30013, 30505, 31001,
+ 31501, 32005, 32513, 33025, 33541, 34061, 34585, 35113, 35645, 36181, 36721,
+ 37265, 37813, 38365, 38921, 39481, 40045, 40613, 41185, 41761, 42341, 42925,
+ 43513, 44105, 44701, 45301, 45905, 46513, 47125, 47741, 48361, 48985, 49613,
+ 50245, 50881, 51521, 52165, 52813, 53465, 54121, 54781, 55445, 56113, 56785,
+ 57461, 58141, 58825, 59513, 60205, 60901, 61601,
+ /* N = 4, K = 4...176 */
+ 63, 129, 231, 377, 575, 833, 1159, 1561, 2047, 2625, 3303, 4089, 4991, 6017,
+ 7175, 8473, 9919, 11521, 13287, 15225, 17343, 19649, 22151, 24857, 27775,
+ 30913, 34279, 37881, 41727, 45825, 50183, 54809, 59711, 64897, 70375, 76153,
+ 82239, 88641, 95367, 102425, 109823, 117569, 125671, 134137, 142975, 152193,
+ 161799, 171801, 182207, 193025, 204263, 215929, 228031, 240577, 253575,
+ 267033, 280959, 295361, 310247, 325625, 341503, 357889, 374791, 392217,
+ 410175, 428673, 447719, 467321, 487487, 508225, 529543, 551449, 573951,
+ 597057, 620775, 645113, 670079, 695681, 721927, 748825, 776383, 804609,
+ 833511, 863097, 893375, 924353, 956039, 988441, 1021567, 1055425, 1090023,
+ 1125369, 1161471, 1198337, 1235975, 1274393, 1313599, 1353601, 1394407,
+ 1436025, 1478463, 1521729, 1565831, 1610777, 1656575, 1703233, 1750759,
+ 1799161, 1848447, 1898625, 1949703, 2001689, 2054591, 2108417, 2163175,
+ 2218873, 2275519, 2333121, 2391687, 2451225, 2511743, 2573249, 2635751,
+ 2699257, 2763775, 2829313, 2895879, 2963481, 3032127, 3101825, 3172583,
+ 3244409, 3317311, 3391297, 3466375, 3542553, 3619839, 3698241, 3777767,
+ 3858425, 3940223, 4023169, 4107271, 4192537, 4278975, 4366593, 4455399,
+ 4545401, 4636607, 4729025, 4822663, 4917529, 5013631, 5110977, 5209575,
+ 5309433, 5410559, 5512961, 5616647, 5721625, 5827903, 5935489, 6044391,
+ 6154617, 6266175, 6379073, 6493319, 6608921, 6725887, 6844225, 6963943,
+ 7085049, 7207551,
+ /* N = 5, K = 5...176 */
+ 321, 681, 1289, 2241, 3649, 5641, 8361, 11969, 16641, 22569, 29961, 39041,
+ 50049, 63241, 78889, 97281, 118721, 143529, 172041, 204609, 241601, 283401,
+ 330409, 383041, 441729, 506921, 579081, 658689, 746241, 842249, 947241,
+ 1061761, 1186369, 1321641, 1468169, 1626561, 1797441, 1981449, 2179241,
+ 2391489, 2618881, 2862121, 3121929, 3399041, 3694209, 4008201, 4341801,
+ 4695809, 5071041, 5468329, 5888521, 6332481, 6801089, 7295241, 7815849,
+ 8363841, 8940161, 9545769, 10181641, 10848769, 11548161, 12280841, 13047849,
+ 13850241, 14689089, 15565481, 16480521, 17435329, 18431041, 19468809,
+ 20549801, 21675201, 22846209, 24064041, 25329929, 26645121, 28010881,
+ 29428489, 30899241, 32424449, 34005441, 35643561, 37340169, 39096641,
+ 40914369, 42794761, 44739241, 46749249, 48826241, 50971689, 53187081,
+ 55473921, 57833729, 60268041, 62778409, 65366401, 68033601, 70781609,
+ 73612041, 76526529, 79526721, 82614281, 85790889, 89058241, 92418049,
+ 95872041, 99421961, 103069569, 106816641, 110664969, 114616361, 118672641,
+ 122835649, 127107241, 131489289, 135983681, 140592321, 145317129, 150160041,
+ 155123009, 160208001, 165417001, 170752009, 176215041, 181808129, 187533321,
+ 193392681, 199388289, 205522241, 211796649, 218213641, 224775361, 231483969,
+ 238341641, 245350569, 252512961, 259831041, 267307049, 274943241, 282741889,
+ 290705281, 298835721, 307135529, 315607041, 324252609, 333074601, 342075401,
+ 351257409, 360623041, 370174729, 379914921, 389846081, 399970689, 410291241,
+ 420810249, 431530241, 442453761, 453583369, 464921641, 476471169, 488234561,
+ 500214441, 512413449, 524834241, 537479489, 550351881, 563454121, 576788929,
+ 590359041, 604167209, 618216201, 632508801,
+ /* N = 6, K = 6...96 (technically V(109,5) fits in 32 bits, but that can't be
+ achieved by splitting an Opus band) */
+ 1683, 3653, 7183, 13073, 22363, 36365, 56695, 85305, 124515, 177045, 246047,
+ 335137, 448427, 590557, 766727, 982729, 1244979, 1560549, 1937199, 2383409,
+ 2908411, 3522221, 4235671, 5060441, 6009091, 7095093, 8332863, 9737793,
+ 11326283, 13115773, 15124775, 17372905, 19880915, 22670725, 25765455,
+ 29189457, 32968347, 37129037, 41699767, 46710137, 52191139, 58175189,
+ 64696159, 71789409, 79491819, 87841821, 96879431, 106646281, 117185651,
+ 128542501, 140763503, 153897073, 167993403, 183104493, 199284183, 216588185,
+ 235074115, 254801525, 275831935, 298228865, 322057867, 347386557, 374284647,
+ 402823977, 433078547, 465124549, 499040399, 534906769, 572806619, 612825229,
+ 655050231, 699571641, 746481891, 795875861, 847850911, 902506913, 959946283,
+ 1020274013, 1083597703, 1150027593, 1219676595, 1292660325, 1369097135,
+ 1449108145, 1532817275, 1620351277, 1711839767, 1807415257, 1907213187,
+ 2011371957, 2120032959,
+ /* N = 7, K = 7...54 (technically V(60,6) fits in 32 bits, but that can't be
+ achieved by splitting an Opus band) */
+ 8989, 19825, 40081, 75517, 134245, 227305, 369305, 579125, 880685, 1303777,
+ 1884961, 2668525, 3707509, 5064793, 6814249, 9041957, 11847485, 15345233,
+ 19665841, 24957661, 31388293, 39146185, 48442297, 59511829, 72616013,
+ 88043969, 106114625, 127178701, 151620757, 179861305, 212358985, 249612805,
+ 292164445, 340600625, 395555537, 457713341, 527810725, 606639529, 695049433,
+ 793950709, 904317037, 1027188385, 1163673953, 1314955181, 1482288821,
+ 1667010073, 1870535785, 2094367717,
+ /* N = 8, K = 8...37 (technically V(40,7) fits in 32 bits, but that can't be
+ achieved by splitting an Opus band) */
+ 48639, 108545, 224143, 433905, 795455, 1392065, 2340495, 3800305, 5984767,
+ 9173505, 13726991, 20103025, 28875327, 40754369, 56610575, 77500017,
+ 104692735, 139703809, 184327311, 240673265, 311207743, 398796225, 506750351,
+ 638878193, 799538175, 993696769, 1226990095, 1505789553, 1837271615,
+ 2229491905,
+ /* N = 9, K = 9...28 (technically V(29,8) fits in 32 bits, but that can't be
+ achieved by splitting an Opus band) */
+ 265729, 598417, 1256465, 2485825, 4673345, 8405905, 14546705, 24331777,
+ 39490049, 62390545, 96220561, 145198913, 214828609, 312193553, 446304145,
+ 628496897, 872893441, 1196924561, 1621925137, 2173806145,
+ /* N = 10, K = 10...24 */
+ 1462563, 3317445, 7059735, 14218905, 27298155, 50250765, 89129247, 152951073,
+ 254831667, 413442773, 654862247, 1014889769, 1541911931, 2300409629,
+ 3375210671,
+ /* N = 11, K = 11...19 (technically V(20,10) fits in 32 bits, but that can't be
+ achieved by splitting an Opus band) */
+ 8097453, 18474633, 39753273, 81270333, 158819253, 298199265, 540279585,
+ 948062325, 1616336765,
+ /* N = 12, K = 12...18 */
+ 45046719, 103274625, 224298231, 464387817, 921406335, 1759885185,
+ 3248227095,
+ /* N = 13, K = 13...16 */
+ 251595969, 579168825, 1267854873, 2653649025,
+ /* N = 14, K = 14 */
+ 1409933619
+};
+
+DECLARE_ALIGNED(32, static const float, celt_window)[120] = {
+ 6.7286966e-05f, 0.00060551348f, 0.0016815970f, 0.0032947962f, 0.0054439943f,
+ 0.0081276923f, 0.011344001f, 0.015090633f, 0.019364886f, 0.024163635f,
+ 0.029483315f, 0.035319905f, 0.041668911f, 0.048525347f, 0.055883718f,
+ 0.063737999f, 0.072081616f, 0.080907428f, 0.090207705f, 0.099974111f,
+ 0.11019769f, 0.12086883f, 0.13197729f, 0.14351214f, 0.15546177f,
+ 0.16781389f, 0.18055550f, 0.19367290f, 0.20715171f, 0.22097682f,
+ 0.23513243f, 0.24960208f, 0.26436860f, 0.27941419f, 0.29472040f,
+ 0.31026818f, 0.32603788f, 0.34200931f, 0.35816177f, 0.37447407f,
+ 0.39092462f, 0.40749142f, 0.42415215f, 0.44088423f, 0.45766484f,
+ 0.47447104f, 0.49127978f, 0.50806798f, 0.52481261f, 0.54149077f,
+ 0.55807973f, 0.57455701f, 0.59090049f, 0.60708841f, 0.62309951f,
+ 0.63891306f, 0.65450896f, 0.66986776f, 0.68497077f, 0.69980010f,
+ 0.71433873f, 0.72857055f, 0.74248043f, 0.75605424f, 0.76927895f,
+ 0.78214257f, 0.79463430f, 0.80674445f, 0.81846456f, 0.82978733f,
+ 0.84070669f, 0.85121779f, 0.86131698f, 0.87100183f, 0.88027111f,
+ 0.88912479f, 0.89756398f, 0.90559094f, 0.91320904f, 0.92042270f,
+ 0.92723738f, 0.93365955f, 0.93969656f, 0.94535671f, 0.95064907f,
+ 0.95558353f, 0.96017067f, 0.96442171f, 0.96834849f, 0.97196334f,
+ 0.97527906f, 0.97830883f, 0.98106616f, 0.98356480f, 0.98581869f,
+ 0.98784191f, 0.98964856f, 0.99125274f, 0.99266849f, 0.99390969f,
+ 0.99499004f, 0.99592297f, 0.99672162f, 0.99739874f, 0.99796667f,
+ 0.99843728f, 0.99882195f, 0.99913147f, 0.99937606f, 0.99956527f,
+ 0.99970802f, 0.99981248f, 0.99988613f, 0.99993565f, 0.99996697f,
+ 0.99998518f, 0.99999457f, 0.99999859f, 0.99999982f, 1.0000000f,
+};
+
+/* square of the window, used for the postfilter */
+const float ff_celt_window2[120] = {
+ 4.5275357e-09f, 3.66647e-07f, 2.82777e-06f, 1.08557e-05f, 2.96371e-05f, 6.60594e-05f,
+ 0.000128686f, 0.000227727f, 0.000374999f, 0.000583881f, 0.000869266f, 0.0012475f,
+ 0.0017363f, 0.00235471f, 0.00312299f, 0.00406253f, 0.00519576f, 0.00654601f,
+ 0.00813743f, 0.00999482f, 0.0121435f, 0.0146093f, 0.017418f, 0.0205957f, 0.0241684f,
+ 0.0281615f, 0.0326003f, 0.0375092f, 0.0429118f, 0.0488308f, 0.0552873f, 0.0623012f,
+ 0.0698908f, 0.0780723f, 0.0868601f, 0.0962664f, 0.106301f, 0.11697f, 0.12828f,
+ 0.140231f, 0.152822f, 0.166049f, 0.179905f, 0.194379f, 0.209457f, 0.225123f, 0.241356f,
+ 0.258133f, 0.275428f, 0.293212f, 0.311453f, 0.330116f, 0.349163f, 0.368556f, 0.388253f,
+ 0.40821f, 0.428382f, 0.448723f, 0.469185f, 0.48972f, 0.51028f, 0.530815f, 0.551277f,
+ 0.571618f, 0.59179f, 0.611747f, 0.631444f, 0.650837f, 0.669884f, 0.688547f, 0.706788f,
+ 0.724572f, 0.741867f, 0.758644f, 0.774877f, 0.790543f, 0.805621f, 0.820095f, 0.833951f,
+ 0.847178f, 0.859769f, 0.87172f, 0.88303f, 0.893699f, 0.903734f, 0.91314f, 0.921928f,
+ 0.930109f, 0.937699f, 0.944713f, 0.951169f, 0.957088f, 0.962491f, 0.9674f, 0.971838f,
+ 0.975832f, 0.979404f, 0.982582f, 0.985391f, 0.987857f, 0.990005f, 0.991863f, 0.993454f,
+ 0.994804f, 0.995937f, 0.996877f, 0.997645f, 0.998264f, 0.998753f, 0.999131f, 0.999416f,
+ 0.999625f, 0.999772f, 0.999871f, 0.999934f, 0.99997f, 0.999989f, 0.999997f, 0.99999964f, 1.0f,
+};
+
+static const uint32_t * const celt_pvq_u_row[15] = {
+ celt_pvq_u + 0, celt_pvq_u + 176, celt_pvq_u + 351,
+ celt_pvq_u + 525, celt_pvq_u + 698, celt_pvq_u + 870,
+ celt_pvq_u + 1041, celt_pvq_u + 1131, celt_pvq_u + 1178,
+ celt_pvq_u + 1207, celt_pvq_u + 1226, celt_pvq_u + 1240,
+ celt_pvq_u + 1248, celt_pvq_u + 1254, celt_pvq_u + 1257
+};
+
+static inline int16_t celt_cos(int16_t x)
+{
+ x = (MUL16(x, x) + 4096) >> 13;
+ x = (32767-x) + ROUND_MUL16(x, (-7651 + ROUND_MUL16(x, (8277 + ROUND_MUL16(-626, x)))));
+ return 1+x;
+}
+
+static inline int celt_log2tan(int isin, int icos)
+{
+ int lc, ls;
+ lc = opus_ilog(icos);
+ ls = opus_ilog(isin);
+ icos <<= 15 - lc;
+ isin <<= 15 - ls;
+ return (ls << 11) - (lc << 11) +
+ ROUND_MUL16(isin, ROUND_MUL16(isin, -2597) + 7932) -
+ ROUND_MUL16(icos, ROUND_MUL16(icos, -2597) + 7932);
+}
+
+static inline uint32_t celt_rng(CeltContext *s)
+{
+ s->seed = 1664525 * s->seed + 1013904223;
+ return s->seed;
+}
+
+static void celt_decode_coarse_energy(CeltContext *s, OpusRangeCoder *rc)
+{
+ int i, j;
+ float prev[2] = {0};
+ float alpha, beta;
+ const uint8_t *model;
+
+ /* use the 2D z-transform to apply prediction in both */
+ /* the time domain (alpha) and the frequency domain (beta) */
+
+ if (opus_rc_tell(rc)+3 <= s->framebits && opus_rc_p2model(rc, 3)) {
+ /* intra frame */
+ alpha = 0;
+ beta = 1.0f - 4915.0f/32768.0f;
+ model = celt_coarse_energy_dist[s->duration][1];
+ } else {
+ alpha = celt_alpha_coef[s->duration];
+ beta = 1.0f - celt_beta_coef[s->duration];
+ model = celt_coarse_energy_dist[s->duration][0];
+ }
+
+ for (i = 0; i < CELT_MAX_BANDS; i++) {
+ for (j = 0; j < s->coded_channels; j++) {
+ CeltFrame *frame = &s->frame[j];
+ float value;
+ int available;
+
+ if (i < s->startband || i >= s->endband) {
+ frame->energy[i] = 0.0;
+ continue;
+ }
+
+ available = s->framebits - opus_rc_tell(rc);
+ if (available >= 15) {
+ /* decode using a Laplace distribution */
+ int k = FFMIN(i, 20) << 1;
+ value = opus_rc_laplace(rc, model[k] << 7, model[k+1] << 6);
+ } else if (available >= 2) {
+ int x = opus_rc_getsymbol(rc, celt_model_energy_small);
+ value = (x>>1) ^ -(x&1);
+ } else if (available >= 1) {
+ value = -(float)opus_rc_p2model(rc, 1);
+ } else value = -1;
+
+ frame->energy[i] = FFMAX(-9.0f, frame->energy[i]) * alpha + prev[j] + value;
+ prev[j] += beta * value;
+ }
+ }
+}
+
+static void celt_decode_fine_energy(CeltContext *s, OpusRangeCoder *rc)
+{
+ int i;
+ for (i = s->startband; i < s->endband; i++) {
+ int j;
+ if (!s->fine_bits[i])
+ continue;
+
+ for (j = 0; j < s->coded_channels; j++) {
+ CeltFrame *frame = &s->frame[j];
+ int q2;
+ float offset;
+ q2 = opus_getrawbits(rc, s->fine_bits[i]);
+ offset = (q2 + 0.5f) * (1 << (14 - s->fine_bits[i])) / 16384.0f - 0.5f;
+ frame->energy[i] += offset;
+ }
+ }
+}
+
+static void celt_decode_final_energy(CeltContext *s, OpusRangeCoder *rc,
+ int bits_left)
+{
+ int priority, i, j;
+
+ for (priority = 0; priority < 2; priority++) {
+ for (i = s->startband; i < s->endband && bits_left >= s->coded_channels; i++) {
+ if (s->fine_priority[i] != priority || s->fine_bits[i] >= CELT_MAX_FINE_BITS)
+ continue;
+
+ for (j = 0; j < s->coded_channels; j++) {
+ int q2;
+ float offset;
+ q2 = opus_getrawbits(rc, 1);
+ offset = (q2 - 0.5f) * (1 << (14 - s->fine_bits[i] - 1)) / 16384.0f;
+ s->frame[j].energy[i] += offset;
+ bits_left--;
+ }
+ }
+ }
+}
+
+static void celt_decode_tf_changes(CeltContext *s, OpusRangeCoder *rc,
+ int transient)
+{
+ int i, diff = 0, tf_select = 0, tf_changed = 0, tf_select_bit;
+ int consumed, bits = transient ? 2 : 4;
+
+ consumed = opus_rc_tell(rc);
+ tf_select_bit = (s->duration != 0 && consumed+bits+1 <= s->framebits);
+
+ for (i = s->startband; i < s->endband; i++) {
+ if (consumed+bits+tf_select_bit <= s->framebits) {
+ diff ^= opus_rc_p2model(rc, bits);
+ consumed = opus_rc_tell(rc);
+ tf_changed |= diff;
+ }
+ s->tf_change[i] = diff;
+ bits = transient ? 4 : 5;
+ }
+
+ if (tf_select_bit && celt_tf_select[s->duration][transient][0][tf_changed] !=
+ celt_tf_select[s->duration][transient][1][tf_changed])
+ tf_select = opus_rc_p2model(rc, 1);
+
+ for (i = s->startband; i < s->endband; i++) {
+ s->tf_change[i] = celt_tf_select[s->duration][transient][tf_select][s->tf_change[i]];
+ }
+}
+
+static void celt_decode_allocation(CeltContext *s, OpusRangeCoder *rc)
+{
+ // approx. maximum bit allocation for each band before boost/trim
+ int cap[CELT_MAX_BANDS];
+ int boost[CELT_MAX_BANDS];
+ int threshold[CELT_MAX_BANDS];
+ int bits1[CELT_MAX_BANDS];
+ int bits2[CELT_MAX_BANDS];
+ int trim_offset[CELT_MAX_BANDS];
+
+ int skip_startband = s->startband;
+ int dynalloc = 6;
+ int alloctrim = 5;
+ int extrabits = 0;
+
+ int skip_bit = 0;
+ int intensitystereo_bit = 0;
+ int dualstereo_bit = 0;
+
+ int remaining, bandbits;
+ int low, high, total, done;
+ int totalbits;
+ int consumed;
+ int i, j;
+
+ consumed = opus_rc_tell(rc);
+
+ /* obtain spread flag */
+ s->spread = CELT_SPREAD_NORMAL;
+ if (consumed + 4 <= s->framebits)
+ s->spread = opus_rc_getsymbol(rc, celt_model_spread);
+
+ /* generate static allocation caps */
+ for (i = 0; i < CELT_MAX_BANDS; i++) {
+ cap[i] = (celt_static_caps[s->duration][s->coded_channels - 1][i] + 64)
+ * celt_freq_range[i] << (s->coded_channels - 1) << s->duration >> 2;
+ }
+
+ /* obtain band boost */
+ totalbits = s->framebits << 3; // convert to 1/8 bits
+ consumed = opus_rc_tell_frac(rc);
+ for (i = s->startband; i < s->endband; i++) {
+ int quanta, band_dynalloc;
+
+ boost[i] = 0;
+
+ quanta = celt_freq_range[i] << (s->coded_channels - 1) << s->duration;
+ quanta = FFMIN(quanta << 3, FFMAX(6 << 3, quanta));
+ band_dynalloc = dynalloc;
+ while (consumed + (band_dynalloc<<3) < totalbits && boost[i] < cap[i]) {
+ int add = opus_rc_p2model(rc, band_dynalloc);
+ consumed = opus_rc_tell_frac(rc);
+ if (!add)
+ break;
+
+ boost[i] += quanta;
+ totalbits -= quanta;
+ band_dynalloc = 1;
+ }
+ /* dynalloc is more likely to occur if it's already been used for earlier bands */
+ if (boost[i])
+ dynalloc = FFMAX(2, dynalloc - 1);
+ }
+
+ /* obtain allocation trim */
+ if (consumed + (6 << 3) <= totalbits)
+ alloctrim = opus_rc_getsymbol(rc, celt_model_alloc_trim);
+
+ /* anti-collapse bit reservation */
+ totalbits = (s->framebits << 3) - opus_rc_tell_frac(rc) - 1;
+ s->anticollapse_bit = 0;
+ if (s->blocks > 1 && s->duration >= 2 &&
+ totalbits >= ((s->duration + 2) << 3))
+ s->anticollapse_bit = 1 << 3;
+ totalbits -= s->anticollapse_bit;
+
+ /* band skip bit reservation */
+ if (totalbits >= 1 << 3)
+ skip_bit = 1 << 3;
+ totalbits -= skip_bit;
+
+ /* intensity/dual stereo bit reservation */
+ if (s->coded_channels == 2) {
+ intensitystereo_bit = celt_log2_frac[s->endband - s->startband];
+ if (intensitystereo_bit <= totalbits) {
+ totalbits -= intensitystereo_bit;
+ if (totalbits >= 1 << 3) {
+ dualstereo_bit = 1 << 3;
+ totalbits -= 1 << 3;
+ }
+ } else
+ intensitystereo_bit = 0;
+ }
+
+ for (i = s->startband; i < s->endband; i++) {
+ int trim = alloctrim - 5 - s->duration;
+ int band = celt_freq_range[i] * (s->endband - i - 1);
+ int duration = s->duration + 3;
+ int scale = duration + s->coded_channels - 1;
+
+ /* PVQ minimum allocation threshold, below this value the band is
+ * skipped */
+ threshold[i] = FFMAX(3 * celt_freq_range[i] << duration >> 4,
+ s->coded_channels << 3);
+
+ trim_offset[i] = trim * (band << scale) >> 6;
+
+ if (celt_freq_range[i] << s->duration == 1)
+ trim_offset[i] -= s->coded_channels << 3;
+ }
+
+ /* bisection */
+ low = 1;
+ high = CELT_VECTORS - 1;
+ while (low <= high) {
+ int center = (low + high) >> 1;
+ done = total = 0;
+
+ for (i = s->endband - 1; i >= s->startband; i--) {
+ bandbits = celt_freq_range[i] * celt_static_alloc[center][i]
+ << (s->coded_channels - 1) << s->duration >> 2;
+
+ if (bandbits)
+ bandbits = FFMAX(0, bandbits + trim_offset[i]);
+ bandbits += boost[i];
+
+ if (bandbits >= threshold[i] || done) {
+ done = 1;
+ total += FFMIN(bandbits, cap[i]);
+ } else if (bandbits >= s->coded_channels << 3)
+ total += s->coded_channels << 3;
+ }
+
+ if (total > totalbits)
+ high = center - 1;
+ else
+ low = center + 1;
+ }
+ high = low--;
+
+ for (i = s->startband; i < s->endband; i++) {
+ bits1[i] = celt_freq_range[i] * celt_static_alloc[low][i]
+ << (s->coded_channels - 1) << s->duration >> 2;
+ bits2[i] = high >= CELT_VECTORS ? cap[i] :
+ celt_freq_range[i] * celt_static_alloc[high][i]
+ << (s->coded_channels - 1) << s->duration >> 2;
+
+ if (bits1[i])
+ bits1[i] = FFMAX(0, bits1[i] + trim_offset[i]);
+ if (bits2[i])
+ bits2[i] = FFMAX(0, bits2[i] + trim_offset[i]);
+ if (low)
+ bits1[i] += boost[i];
+ bits2[i] += boost[i];
+
+ if (boost[i])
+ skip_startband = i;
+ bits2[i] = FFMAX(0, bits2[i] - bits1[i]);
+ }
+
+ /* bisection */
+ low = 0;
+ high = 1 << CELT_ALLOC_STEPS;
+ for (i = 0; i < CELT_ALLOC_STEPS; i++) {
+ int center = (low + high) >> 1;
+ done = total = 0;
+
+ for (j = s->endband - 1; j >= s->startband; j--) {
+ bandbits = bits1[j] + (center * bits2[j] >> CELT_ALLOC_STEPS);
+
+ if (bandbits >= threshold[j] || done) {
+ done = 1;
+ total += FFMIN(bandbits, cap[j]);
+ } else if (bandbits >= s->coded_channels << 3)
+ total += s->coded_channels << 3;
+ }
+ if (total > totalbits)
+ high = center;
+ else
+ low = center;
+ }
+
+ done = total = 0;
+ for (i = s->endband - 1; i >= s->startband; i--) {
+ bandbits = bits1[i] + (low * bits2[i] >> CELT_ALLOC_STEPS);
+
+ if (bandbits >= threshold[i] || done)
+ done = 1;
+ else
+ bandbits = (bandbits >= s->coded_channels << 3) ?
+ s->coded_channels << 3 : 0;
+
+ bandbits = FFMIN(bandbits, cap[i]);
+ s->pulses[i] = bandbits;
+ total += bandbits;
+ }
+
+ /* band skipping */
+ for (s->codedbands = s->endband; ; s->codedbands--) {
+ int allocation;
+ j = s->codedbands - 1;
+
+ if (j == skip_startband) {
+ /* all remaining bands are not skipped */
+ totalbits += skip_bit;
+ break;
+ }
+
+ /* determine the number of bits available for coding "do not skip" markers */
+ remaining = totalbits - total;
+ bandbits = remaining / (celt_freq_bands[j+1] - celt_freq_bands[s->startband]);
+ remaining -= bandbits * (celt_freq_bands[j+1] - celt_freq_bands[s->startband]);
+ allocation = s->pulses[j] + bandbits * celt_freq_range[j]
+ + FFMAX(0, remaining - (celt_freq_bands[j] - celt_freq_bands[s->startband]));
+
+ /* a "do not skip" marker is only coded if the allocation is
+ above the chosen threshold */
+ if (allocation >= FFMAX(threshold[j], (s->coded_channels + 1) <<3 )) {
+ if (opus_rc_p2model(rc, 1))
+ break;
+
+ total += 1 << 3;
+ allocation -= 1 << 3;
+ }
+
+ /* the band is skipped, so reclaim its bits */
+ total -= s->pulses[j];
+ if (intensitystereo_bit) {
+ total -= intensitystereo_bit;
+ intensitystereo_bit = celt_log2_frac[j - s->startband];
+ total += intensitystereo_bit;
+ }
+
+ total += s->pulses[j] = (allocation >= s->coded_channels << 3) ?
+ s->coded_channels << 3 : 0;
+ }
+
+ /* obtain stereo flags */
+ s->intensitystereo = 0;
+ s->dualstereo = 0;
+ if (intensitystereo_bit)
+ s->intensitystereo = s->startband +
+ opus_rc_unimodel(rc, s->codedbands + 1 - s->startband);
+ if (s->intensitystereo <= s->startband)
+ totalbits += dualstereo_bit; /* no intensity stereo means no dual stereo */
+ else if (dualstereo_bit)
+ s->dualstereo = opus_rc_p2model(rc, 1);
+
+ /* supply the remaining bits in this frame to lower bands */
+ remaining = totalbits - total;
+ bandbits = remaining / (celt_freq_bands[s->codedbands] - celt_freq_bands[s->startband]);
+ remaining -= bandbits * (celt_freq_bands[s->codedbands] - celt_freq_bands[s->startband]);
+ for (i = s->startband; i < s->codedbands; i++) {
+ int bits = FFMIN(remaining, celt_freq_range[i]);
+
+ s->pulses[i] += bits + bandbits * celt_freq_range[i];
+ remaining -= bits;
+ }
+
+ for (i = s->startband; i < s->codedbands; i++) {
+ int N = celt_freq_range[i] << s->duration;
+ int prev_extra = extrabits;
+ s->pulses[i] += extrabits;
+
+ if (N > 1) {
+ int dof; // degrees of freedom
+ int temp; // dof * channels * log(dof)
+ int offset; // fine energy quantization offset, i.e.
+ // extra bits assigned over the standard
+ // totalbits/dof
+ int fine_bits, max_bits;
+
+ extrabits = FFMAX(0, s->pulses[i] - cap[i]);
+ s->pulses[i] -= extrabits;
+
+ /* intensity stereo makes use of an extra degree of freedom */
+ dof = N * s->coded_channels
+ + (s->coded_channels == 2 && N > 2 && !s->dualstereo && i < s->intensitystereo);
+ temp = dof * (celt_log_freq_range[i] + (s->duration<<3));
+ offset = (temp >> 1) - dof * CELT_FINE_OFFSET;
+ if (N == 2) /* dof=2 is the only case that doesn't fit the model */
+ offset += dof<<1;
+
+ /* grant an additional bias for the first and second pulses */
+ if (s->pulses[i] + offset < 2 * (dof << 3))
+ offset += temp >> 2;
+ else if (s->pulses[i] + offset < 3 * (dof << 3))
+ offset += temp >> 3;
+
+ fine_bits = (s->pulses[i] + offset + (dof << 2)) / (dof << 3);
+ max_bits = FFMIN((s->pulses[i]>>3) >> (s->coded_channels - 1),
+ CELT_MAX_FINE_BITS);
+
+ max_bits = FFMAX(max_bits, 0);
+
+ s->fine_bits[i] = av_clip(fine_bits, 0, max_bits);
+
+ /* if fine_bits was rounded down or capped,
+ give priority for the final fine energy pass */
+ s->fine_priority[i] = (s->fine_bits[i] * (dof<<3) >= s->pulses[i] + offset);
+
+ /* the remaining bits are assigned to PVQ */
+ s->pulses[i] -= s->fine_bits[i] << (s->coded_channels - 1) << 3;
+ } else {
+ /* all bits go to fine energy except for the sign bit */
+ extrabits = FFMAX(0, s->pulses[i] - (s->coded_channels << 3));
+ s->pulses[i] -= extrabits;
+ s->fine_bits[i] = 0;
+ s->fine_priority[i] = 1;
+ }
+
+ /* hand back a limited number of extra fine energy bits to this band */
+ if (extrabits > 0) {
+ int fineextra = FFMIN(extrabits >> (s->coded_channels + 2),
+ CELT_MAX_FINE_BITS - s->fine_bits[i]);
+ s->fine_bits[i] += fineextra;
+
+ fineextra <<= s->coded_channels + 2;
+ s->fine_priority[i] = (fineextra >= extrabits - prev_extra);
+ extrabits -= fineextra;
+ }
+ }
+ s->remaining = extrabits;
+
+ /* skipped bands dedicate all of their bits for fine energy */
+ for (; i < s->endband; i++) {
+ s->fine_bits[i] = s->pulses[i] >> (s->coded_channels - 1) >> 3;
+ s->pulses[i] = 0;
+ s->fine_priority[i] = s->fine_bits[i] < 1;
+ }
+}
+
+static inline int celt_bits2pulses(const uint8_t *cache, int bits)
+{
+ // TODO: Find the size of cache and make it into an array in the parameters list
+ int i, low = 0, high;
+
+ high = cache[0];
+ bits--;
+
+ for (i = 0; i < 6; i++) {
+ int center = (low + high + 1) >> 1;
+ if (cache[center] >= bits)
+ high = center;
+ else
+ low = center;
+ }
+
+ return (bits - (low == 0 ? -1 : cache[low]) <= cache[high] - bits) ? low : high;
+}
+
+static inline int celt_pulses2bits(const uint8_t *cache, int pulses)
+{
+ // TODO: Find the size of cache and make it into an array in the parameters list
+ return (pulses == 0) ? 0 : cache[pulses] + 1;
+}
+
+static inline void celt_normalize_residual(const int * restrict iy, float * restrict X,
+ int N, float g)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ X[i] = g * iy[i];
+}
+
+static void celt_exp_rotation1(float *X, unsigned int len, unsigned int stride,
+ float c, float s)
+{
+ float *Xptr;
+ int i;
+
+ Xptr = X;
+ for (i = 0; i < len - stride; i++) {
+ float x1, x2;
+ x1 = Xptr[0];
+ x2 = Xptr[stride];
+ Xptr[stride] = c * x2 + s * x1;
+ *Xptr++ = c * x1 - s * x2;
+ }
+
+ Xptr = &X[len - 2 * stride - 1];
+ for (i = len - 2 * stride - 1; i >= 0; i--) {
+ float x1, x2;
+ x1 = Xptr[0];
+ x2 = Xptr[stride];
+ Xptr[stride] = c * x2 + s * x1;
+ *Xptr-- = c * x1 - s * x2;
+ }
+}
+
+static inline void celt_exp_rotation(float *X, unsigned int len,
+ unsigned int stride, unsigned int K,
+ enum CeltSpread spread)
+{
+ unsigned int stride2 = 0;
+ float c, s;
+ float gain, theta;
+ int i;
+
+ if (2*K >= len || spread == CELT_SPREAD_NONE)
+ return;
+
+ gain = (float)len / (len + (20 - 5*spread) * K);
+ theta = M_PI * gain * gain / 4;
+
+ c = cos(theta);
+ s = sin(theta);
+
+ if (len >= stride << 3) {
+ stride2 = 1;
+ /* This is just a simple (equivalent) way of computing sqrt(len/stride) with rounding.
+ It's basically incrementing long as (stride2+0.5)^2 < len/stride. */
+ while ((stride2 * stride2 + stride2) * stride + (stride >> 2) < len)
+ stride2++;
+ }
+
+ /*NOTE: As a minor optimization, we could be passing around log2(B), not B, for both this and for
+ extract_collapse_mask().*/
+ len /= stride;
+ for (i = 0; i < stride; i++) {
+ if (stride2)
+ celt_exp_rotation1(X + i * len, len, stride2, s, c);
+ celt_exp_rotation1(X + i * len, len, 1, c, s);
+ }
+}
+
+static inline unsigned int celt_extract_collapse_mask(const int *iy,
+ unsigned int N,
+ unsigned int B)
+{
+ unsigned int collapse_mask;
+ int N0;
+ int i, j;
+
+ if (B <= 1)
+ return 1;
+
+ /*NOTE: As a minor optimization, we could be passing around log2(B), not B, for both this and for
+ exp_rotation().*/
+ N0 = N/B;
+ collapse_mask = 0;
+ for (i = 0; i < B; i++)
+ for (j = 0; j < N0; j++)
+ collapse_mask |= (iy[i*N0+j]!=0)<<i;
+ return collapse_mask;
+}
+
+static inline void celt_renormalize_vector(float *X, int N, float gain)
+{
+ int i;
+ float g = 1e-15f;
+ for (i = 0; i < N; i++)
+ g += X[i] * X[i];
+ g = gain / sqrtf(g);
+
+ for (i = 0; i < N; i++)
+ X[i] *= g;
+}
+
+static inline void celt_stereo_merge(float *X, float *Y, float mid, int N)
+{
+ int i;
+ float xp = 0, side = 0;
+ float E[2];
+ float mid2;
+ float t, gain[2];
+
+ /* Compute the norm of X+Y and X-Y as |X|^2 + |Y|^2 +/- sum(xy) */
+ for (i = 0; i < N; i++) {
+ xp += X[i] * Y[i];
+ side += Y[i] * Y[i];
+ }
+
+ /* Compensating for the mid normalization */
+ xp *= mid;
+ mid2 = mid;
+ E[0] = mid2 * mid2 + side - 2 * xp;
+ E[1] = mid2 * mid2 + side + 2 * xp;
+ if (E[0] < 6e-4f || E[1] < 6e-4f) {
+ for (i = 0; i < N; i++)
+ Y[i] = X[i];
+ return;
+ }
+
+ t = E[0];
+ gain[0] = 1.0f / sqrtf(t);
+ t = E[1];
+ gain[1] = 1.0f / sqrtf(t);
+
+ for (i = 0; i < N; i++) {
+ float value[2];
+ /* Apply mid scaling (side is already scaled) */
+ value[0] = mid * X[i];
+ value[1] = Y[i];
+ X[i] = gain[0] * (value[0] - value[1]);
+ Y[i] = gain[1] * (value[0] + value[1]);
+ }
+}
+
+static void celt_interleave_hadamard(float *tmp, float *X, int N0,
+ int stride, int hadamard)
+{
+ int i, j;
+ int N = N0*stride;
+
+ if (hadamard) {
+ const uint8_t *ordery = celt_hadamard_ordery + stride - 2;
+ for (i = 0; i < stride; i++)
+ for (j = 0; j < N0; j++)
+ tmp[j*stride+i] = X[ordery[i]*N0+j];
+ } else {
+ for (i = 0; i < stride; i++)
+ for (j = 0; j < N0; j++)
+ tmp[j*stride+i] = X[i*N0+j];
+ }
+
+ for (i = 0; i < N; i++)
+ X[i] = tmp[i];
+}
+
+static void celt_deinterleave_hadamard(float *tmp, float *X, int N0,
+ int stride, int hadamard)
+{
+ int i, j;
+ int N = N0*stride;
+
+ if (hadamard) {
+ const uint8_t *ordery = celt_hadamard_ordery + stride - 2;
+ for (i = 0; i < stride; i++)
+ for (j = 0; j < N0; j++)
+ tmp[ordery[i]*N0+j] = X[j*stride+i];
+ } else {
+ for (i = 0; i < stride; i++)
+ for (j = 0; j < N0; j++)
+ tmp[i*N0+j] = X[j*stride+i];
+ }
+
+ for (i = 0; i < N; i++)
+ X[i] = tmp[i];
+}
+
+static void celt_haar1(float *X, int N0, int stride)
+{
+ int i, j;
+ N0 >>= 1;
+ for (i = 0; i < stride; i++) {
+ for (j = 0; j < N0; j++) {
+ float x0 = X[stride * (2 * j + 0) + i];
+ float x1 = X[stride * (2 * j + 1) + i];
+ X[stride * (2 * j + 0) + i] = (x0 + x1) * M_SQRT1_2;
+ X[stride * (2 * j + 1) + i] = (x0 - x1) * M_SQRT1_2;
+ }
+ }
+}
+
+static inline int celt_compute_qn(int N, int b, int offset, int pulse_cap,
+ int dualstereo)
+{
+ int qn, qb;
+ int N2 = 2 * N - 1;
+ if (dualstereo && N == 2)
+ N2--;
+
+ /* The upper limit ensures that in a stereo split with itheta==16384, we'll
+ * always have enough bits left over to code at least one pulse in the
+ * side; otherwise it would collapse, since it doesn't get folded. */
+ qb = FFMIN3(b - pulse_cap - (4 << 3), (b + N2 * offset) / N2, 8 << 3);
+ qn = (qb < (1 << 3 >> 1)) ? 1 : ((celt_qn_exp2[qb & 0x7] >> (14 - (qb >> 3))) + 1) >> 1 << 1;
+ return qn;
+}
+
+// this code was adapted from libopus
+static inline uint64_t celt_cwrsi(unsigned int N, unsigned int K, unsigned int i, int *y)
+{
+ uint64_t norm = 0;
+ uint32_t p;
+ int s, val;
+ int k0;
+
+ while (N > 2) {
+ uint32_t q;
+
+ /*Lots of pulses case:*/
+ if (K >= N) {
+ const uint32_t *row = celt_pvq_u_row[N];
+
+ /* Are the pulses in this dimension negative? */
+ p = row[K + 1];
+ s = -(i >= p);
+ i -= p & s;
+
+ /*Count how many pulses were placed in this dimension.*/
+ k0 = K;
+ q = row[N];
+ if (q > i) {
+ K = N;
+ do {
+ p = celt_pvq_u_row[--K][N];
+ } while (p > i);
+ } else
+ for (p = row[K]; p > i; p = row[K])
+ K--;
+
+ i -= p;
+ val = (k0 - K + s) ^ s;
+ norm += val * val;
+ *y++ = val;
+ } else { /*Lots of dimensions case:*/
+ /*Are there any pulses in this dimension at all?*/
+ p = celt_pvq_u_row[K ][N];
+ q = celt_pvq_u_row[K + 1][N];
+
+ if (p <= i && i < q) {
+ i -= p;
+ *y++ = 0;
+ } else {
+ /*Are the pulses in this dimension negative?*/
+ s = -(i >= q);
+ i -= q & s;
+
+ /*Count how many pulses were placed in this dimension.*/
+ k0 = K;
+ do p = celt_pvq_u_row[--K][N];
+ while (p > i);
+
+ i -= p;
+ val = (k0 - K + s) ^ s;
+ norm += val * val;
+ *y++ = val;
+ }
+ }
+ N--;
+ }
+
+ /* N == 2 */
+ p = 2 * K + 1;
+ s = -(i >= p);
+ i -= p & s;
+ k0 = K;
+ K = (i + 1) / 2;
+
+ if (K)
+ i -= 2 * K - 1;
+
+ val = (k0 - K + s) ^ s;
+ norm += val * val;
+ *y++ = val;
+
+ /* N==1 */
+ s = -i;
+ val = (K + s) ^ s;
+ norm += val * val;
+ *y = val;
+
+ return norm;
+}
+
+static inline float celt_decode_pulses(OpusRangeCoder *rc, int *y, unsigned int N, unsigned int K)
+{
+ unsigned int idx;
+#define CELT_PVQ_U(n, k) (celt_pvq_u_row[FFMIN(n, k)][FFMAX(n, k)])
+#define CELT_PVQ_V(n, k) (CELT_PVQ_U(n, k) + CELT_PVQ_U(n, k + 1))
+ idx = opus_rc_unimodel(rc, CELT_PVQ_V(N, K));
+ return celt_cwrsi(N, K, idx, y);
+}
+
+/** Decode pulse vector and combine the result with the pitch vector to produce
+ the final normalised signal in the current band. */
+static inline unsigned int celt_alg_unquant(OpusRangeCoder *rc, float *X,
+ unsigned int N, unsigned int K,
+ enum CeltSpread spread,
+ unsigned int blocks, float gain)
+{
+ int y[176];
+
+ gain /= sqrtf(celt_decode_pulses(rc, y, N, K));
+ celt_normalize_residual(y, X, N, gain);
+ celt_exp_rotation(X, N, blocks, K, spread);
+ return celt_extract_collapse_mask(y, N, blocks);
+}
+
+static unsigned int celt_decode_band(CeltContext *s, OpusRangeCoder *rc,
+ const int band, float *X, float *Y,
+ int N, int b, unsigned int blocks,
+ float *lowband, int duration,
+ float *lowband_out, int level,
+ float gain, float *lowband_scratch,
+ int fill)
+{
+ const uint8_t *cache;
+ int dualstereo, split;
+ int imid = 0, iside = 0;
+ unsigned int N0 = N;
+ int N_B;
+ int N_B0;
+ int B0 = blocks;
+ int time_divide = 0;
+ int recombine = 0;
+ int inv = 0;
+ float mid = 0, side = 0;
+ int longblocks = (B0 == 1);
+ unsigned int cm = 0;
+
+ N_B0 = N_B = N / blocks;
+ split = dualstereo = (Y != NULL);
+
+ if (N == 1) {
+ /* special case for one sample */
+ int i;
+ float *x = X;
+ for (i = 0; i <= dualstereo; i++) {
+ int sign = 0;
+ if (s->remaining2 >= 1<<3) {
+ sign = opus_getrawbits(rc, 1);
+ s->remaining2 -= 1 << 3;
+ b -= 1 << 3;
+ }
+ x[0] = sign ? -1.0f : 1.0f;
+ x = Y;
+ }
+ if (lowband_out)
+ lowband_out[0] = X[0];
+ return 1;
+ }
+
+ if (!dualstereo && level == 0) {
+ int tf_change = s->tf_change[band];
+ int k;
+ if (tf_change > 0)
+ recombine = tf_change;
+ /* Band recombining to increase frequency resolution */
+
+ if (lowband &&
+ (recombine || ((N_B & 1) == 0 && tf_change < 0) || B0 > 1)) {
+ int j;
+ for (j = 0; j < N; j++)
+ lowband_scratch[j] = lowband[j];
+ lowband = lowband_scratch;
+ }
+
+ for (k = 0; k < recombine; k++) {
+ if (lowband)
+ celt_haar1(lowband, N >> k, 1 << k);
+ fill = celt_bit_interleave[fill & 0xF] | celt_bit_interleave[fill >> 4] << 2;
+ }
+ blocks >>= recombine;
+ N_B <<= recombine;
+
+ /* Increasing the time resolution */
+ while ((N_B & 1) == 0 && tf_change < 0) {
+ if (lowband)
+ celt_haar1(lowband, N_B, blocks);
+ fill |= fill << blocks;
+ blocks <<= 1;
+ N_B >>= 1;
+ time_divide++;
+ tf_change++;
+ }
+ B0 = blocks;
+ N_B0 = N_B;
+
+ /* Reorganize the samples in time order instead of frequency order */
+ if (B0 > 1 && lowband)
+ celt_deinterleave_hadamard(s->scratch, lowband, N_B >> recombine,
+ B0 << recombine, longblocks);
+ }
+
+ /* If we need 1.5 more bit than we can produce, split the band in two. */
+ cache = celt_cache_bits +
+ celt_cache_index[(duration + 1) * CELT_MAX_BANDS + band];
+ if (!dualstereo && duration >= 0 && b > cache[cache[0]] + 12 && N > 2) {
+ N >>= 1;
+ Y = X + N;
+ split = 1;
+ duration -= 1;
+ if (blocks == 1)
+ fill = (fill & 1) | (fill << 1);
+ blocks = (blocks + 1) >> 1;
+ }
+
+ if (split) {
+ int qn;
+ int itheta = 0;
+ int mbits, sbits, delta;
+ int qalloc;
+ int pulse_cap;
+ int offset;
+ int orig_fill;
+ int tell;
+
+ /* Decide on the resolution to give to the split parameter theta */
+ pulse_cap = celt_log_freq_range[band] + duration * 8;
+ offset = (pulse_cap >> 1) - (dualstereo && N == 2 ? CELT_QTHETA_OFFSET_TWOPHASE :
+ CELT_QTHETA_OFFSET);
+ qn = (dualstereo && band >= s->intensitystereo) ? 1 :
+ celt_compute_qn(N, b, offset, pulse_cap, dualstereo);
+ tell = opus_rc_tell_frac(rc);
+ if (qn != 1) {
+ /* Entropy coding of the angle. We use a uniform pdf for the
+ time split, a step for stereo, and a triangular one for the rest. */
+ if (dualstereo && N > 2)
+ itheta = opus_rc_stepmodel(rc, qn/2);
+ else if (dualstereo || B0 > 1)
+ itheta = opus_rc_unimodel(rc, qn+1);
+ else
+ itheta = opus_rc_trimodel(rc, qn);
+ itheta = itheta * 16384 / qn;
+ /* NOTE: Renormalising X and Y *may* help fixed-point a bit at very high rate.
+ Let's do that at higher complexity */
+ } else if (dualstereo) {
+ inv = (b > 2 << 3 && s->remaining2 > 2 << 3) ? opus_rc_p2model(rc, 2) : 0;
+ itheta = 0;
+ }
+ qalloc = opus_rc_tell_frac(rc) - tell;
+ b -= qalloc;
+
+ orig_fill = fill;
+ if (itheta == 0) {
+ imid = 32767;
+ iside = 0;
+ fill &= (1 << blocks) - 1;
+ delta = -16384;
+ } else if (itheta == 16384) {
+ imid = 0;
+ iside = 32767;
+ fill &= ((1 << blocks) - 1) << blocks;
+ delta = 16384;
+ } else {
+ imid = celt_cos(itheta);
+ iside = celt_cos(16384-itheta);
+ /* This is the mid vs side allocation that minimizes squared error
+ in that band. */
+ delta = ROUND_MUL16((N - 1) << 7, celt_log2tan(iside, imid));
+ }
+
+ mid = imid / 32768.0f;
+ side = iside / 32768.0f;
+
+ /* This is a special case for N=2 that only works for stereo and takes
+ advantage of the fact that mid and side are orthogonal to encode
+ the side with just one bit. */
+ if (N == 2 && dualstereo) {
+ int c;
+ int sign = 0;
+ float tmp;
+ float *x2, *y2;
+ mbits = b;
+ /* Only need one bit for the side */
+ sbits = (itheta != 0 && itheta != 16384) ? 1 << 3 : 0;
+ mbits -= sbits;
+ c = (itheta > 8192);
+ s->remaining2 -= qalloc+sbits;
+
+ x2 = c ? Y : X;
+ y2 = c ? X : Y;
+ if (sbits)
+ sign = opus_getrawbits(rc, 1);
+ sign = 1 - 2 * sign;
+ /* We use orig_fill here because we want to fold the side, but if
+ itheta==16384, we'll have cleared the low bits of fill. */
+ cm = celt_decode_band(s, rc, band, x2, NULL, N, mbits, blocks,
+ lowband, duration, lowband_out, level, gain,
+ lowband_scratch, orig_fill);
+ /* We don't split N=2 bands, so cm is either 1 or 0 (for a fold-collapse),
+ and there's no need to worry about mixing with the other channel. */
+ y2[0] = -sign * x2[1];
+ y2[1] = sign * x2[0];
+ X[0] *= mid;
+ X[1] *= mid;
+ Y[0] *= side;
+ Y[1] *= side;
+ tmp = X[0];
+ X[0] = tmp - Y[0];
+ Y[0] = tmp + Y[0];
+ tmp = X[1];
+ X[1] = tmp - Y[1];
+ Y[1] = tmp + Y[1];
+ } else {
+ /* "Normal" split code */
+ float *next_lowband2 = NULL;
+ float *next_lowband_out1 = NULL;
+ int next_level = 0;
+ int rebalance;
+
+ /* Give more bits to low-energy MDCTs than they would
+ * otherwise deserve */
+ if (B0 > 1 && !dualstereo && (itheta & 0x3fff)) {
+ if (itheta > 8192)
+ /* Rough approximation for pre-echo masking */
+ delta -= delta >> (4 - duration);
+ else
+ /* Corresponds to a forward-masking slope of
+ * 1.5 dB per 10 ms */
+ delta = FFMIN(0, delta + (N << 3 >> (5 - duration)));
+ }
+ mbits = av_clip((b - delta) / 2, 0, b);
+ sbits = b - mbits;
+ s->remaining2 -= qalloc;
+
+ if (lowband && !dualstereo)
+ next_lowband2 = lowband + N; /* >32-bit split case */
+
+ /* Only stereo needs to pass on lowband_out.
+ * Otherwise, it's handled at the end */
+ if (dualstereo)
+ next_lowband_out1 = lowband_out;
+ else
+ next_level = level + 1;
+
+ rebalance = s->remaining2;
+ if (mbits >= sbits) {
+ /* In stereo mode, we do not apply a scaling to the mid
+ * because we need the normalized mid for folding later */
+ cm = celt_decode_band(s, rc, band, X, NULL, N, mbits, blocks,
+ lowband, duration, next_lowband_out1,
+ next_level, dualstereo ? 1.0f : (gain * mid),
+ lowband_scratch, fill);
+
+ rebalance = mbits - (rebalance - s->remaining2);
+ if (rebalance > 3 << 3 && itheta != 0)
+ sbits += rebalance - (3 << 3);
+
+ /* For a stereo split, the high bits of fill are always zero,
+ * so no folding will be done to the side. */
+ cm |= celt_decode_band(s, rc, band, Y, NULL, N, sbits, blocks,
+ next_lowband2, duration, NULL,
+ next_level, gain * side, NULL,
+ fill >> blocks) << ((B0 >> 1) & (dualstereo - 1));
+ } else {
+ /* For a stereo split, the high bits of fill are always zero,
+ * so no folding will be done to the side. */
+ cm = celt_decode_band(s, rc, band, Y, NULL, N, sbits, blocks,
+ next_lowband2, duration, NULL,
+ next_level, gain * side, NULL,
+ fill >> blocks) << ((B0 >> 1) & (dualstereo - 1));
+
+ rebalance = sbits - (rebalance - s->remaining2);
+ if (rebalance > 3 << 3 && itheta != 16384)
+ mbits += rebalance - (3 << 3);
+
+ /* In stereo mode, we do not apply a scaling to the mid because
+ * we need the normalized mid for folding later */
+ cm |= celt_decode_band(s, rc, band, X, NULL, N, mbits, blocks,
+ lowband, duration, next_lowband_out1,
+ next_level, dualstereo ? 1.0f : (gain * mid),
+ lowband_scratch, fill);
+ }
+ }
+ } else {
+ /* This is the basic no-split case */
+ unsigned int q = celt_bits2pulses(cache, b);
+ unsigned int curr_bits = celt_pulses2bits(cache, q);
+ s->remaining2 -= curr_bits;
+
+ /* Ensures we can never bust the budget */
+ while (s->remaining2 < 0 && q > 0) {
+ s->remaining2 += curr_bits;
+ curr_bits = celt_pulses2bits(cache, --q);
+ s->remaining2 -= curr_bits;
+ }
+
+ if (q != 0) {
+ /* Finally do the actual quantization */
+ cm = celt_alg_unquant(rc, X, N, (q < 8) ? q : (8 + (q & 7)) << ((q >> 3) - 1),
+ s->spread, blocks, gain);
+ } else {
+ /* If there's no pulse, fill the band anyway */
+ int j;
+ unsigned int cm_mask = (1 << blocks) - 1;
+ fill &= cm_mask;
+ if (!fill) {
+ for (j = 0; j < N; j++)
+ X[j] = 0.0f;
+ } else {
+ if (lowband == NULL) {
+ /* Noise */
+ for (j = 0; j < N; j++)
+ X[j] = (((int32_t)celt_rng(s)) >> 20);
+ cm = cm_mask;
+ } else {
+ /* Folded spectrum */
+ for (j = 0; j < N; j++) {
+ /* About 48 dB below the "normal" folding level */
+ X[j] = lowband[j] + (((celt_rng(s)) & 0x8000) ? 1.0f / 256 : -1.0f / 256);
+ }
+ cm = fill;
+ }
+ celt_renormalize_vector(X, N, gain);
+ }
+ }
+ }
+
+ /* This code is used by the decoder and by the resynthesis-enabled encoder */
+ if (dualstereo) {
+ int j;
+ if (N != 2)
+ celt_stereo_merge(X, Y, mid, N);
+ if (inv) {
+ for (j = 0; j < N; j++)
+ Y[j] *= -1;
+ }
+ } else if (level == 0) {
+ int k;
+
+ /* Undo the sample reorganization going from time order to frequency order */
+ if (B0 > 1)
+ celt_interleave_hadamard(s->scratch, X, N_B>>recombine,
+ B0<<recombine, longblocks);
+
+ /* Undo time-freq changes that we did earlier */
+ N_B = N_B0;
+ blocks = B0;
+ for (k = 0; k < time_divide; k++) {
+ blocks >>= 1;
+ N_B <<= 1;
+ cm |= cm >> blocks;
+ celt_haar1(X, N_B, blocks);
+ }
+
+ for (k = 0; k < recombine; k++) {
+ cm = celt_bit_deinterleave[cm];
+ celt_haar1(X, N0>>k, 1<<k);
+ }
+ blocks <<= recombine;
+
+ /* Scale output for later folding */
+ if (lowband_out) {
+ int j;
+ float n = sqrtf(N0);
+ for (j = 0; j < N0; j++)
+ lowband_out[j] = n * X[j];
+ }
+ cm &= (1 << blocks) - 1;
+ }
+ return cm;
+}
+
+static void celt_denormalize(CeltContext *s, CeltFrame *frame, float *data)
+{
+ int i, j;
+
+ for (i = s->startband; i < s->endband; i++) {
+ float *dst = data + (celt_freq_bands[i] << s->duration);
+ float norm = pow(2, frame->energy[i] + celt_mean_energy[i]);
+
+ for (j = 0; j < celt_freq_range[i] << s->duration; j++)
+ dst[j] *= norm;
+ }
+}
+
+static void celt_postfilter_apply_transition(CeltFrame *frame, float *data)
+{
+ const int T0 = frame->pf_period_old;
+ const int T1 = frame->pf_period;
+
+ float g00, g01, g02;
+ float g10, g11, g12;
+
+ float x0, x1, x2, x3, x4;
+
+ int i;
+
+ if (frame->pf_gains[0] == 0.0 &&
+ frame->pf_gains_old[0] == 0.0)
+ return;
+
+ g00 = frame->pf_gains_old[0];
+ g01 = frame->pf_gains_old[1];
+ g02 = frame->pf_gains_old[2];
+ g10 = frame->pf_gains[0];
+ g11 = frame->pf_gains[1];
+ g12 = frame->pf_gains[2];
+
+ x1 = data[-T1 + 1];
+ x2 = data[-T1];
+ x3 = data[-T1 - 1];
+ x4 = data[-T1 - 2];
+
+ for (i = 0; i < CELT_OVERLAP; i++) {
+ float w = ff_celt_window2[i];
+ x0 = data[i - T1 + 2];
+
+ data[i] += (1.0 - w) * g00 * data[i - T0] +
+ (1.0 - w) * g01 * (data[i - T0 - 1] + data[i - T0 + 1]) +
+ (1.0 - w) * g02 * (data[i - T0 - 2] + data[i - T0 + 2]) +
+ w * g10 * x2 +
+ w * g11 * (x1 + x3) +
+ w * g12 * (x0 + x4);
+ x4 = x3;
+ x3 = x2;
+ x2 = x1;
+ x1 = x0;
+ }
+}
+
+static void celt_postfilter_apply(CeltFrame *frame,
+ float *data, int len)
+{
+ const int T = frame->pf_period;
+ float g0, g1, g2;
+ float x0, x1, x2, x3, x4;
+ int i;
+
+ if (frame->pf_gains[0] == 0.0 || len <= 0)
+ return;
+
+ g0 = frame->pf_gains[0];
+ g1 = frame->pf_gains[1];
+ g2 = frame->pf_gains[2];
+
+ x4 = data[-T - 2];
+ x3 = data[-T - 1];
+ x2 = data[-T];
+ x1 = data[-T + 1];
+
+ for (i = 0; i < len; i++) {
+ x0 = data[i - T + 2];
+ data[i] += g0 * x2 +
+ g1 * (x1 + x3) +
+ g2 * (x0 + x4);
+ x4 = x3;
+ x3 = x2;
+ x2 = x1;
+ x1 = x0;
+ }
+}
+
+static void celt_postfilter(CeltContext *s, CeltFrame *frame)
+{
+ int len = s->blocksize * s->blocks;
+
+ celt_postfilter_apply_transition(frame, frame->buf + 1024);
+
+ frame->pf_period_old = frame->pf_period;
+ memcpy(frame->pf_gains_old, frame->pf_gains, sizeof(frame->pf_gains));
+
+ frame->pf_period = frame->pf_period_new;
+ memcpy(frame->pf_gains, frame->pf_gains_new, sizeof(frame->pf_gains));
+
+ if (len > CELT_OVERLAP) {
+ celt_postfilter_apply_transition(frame, frame->buf + 1024 + CELT_OVERLAP);
+ celt_postfilter_apply(frame, frame->buf + 1024 + 2 * CELT_OVERLAP,
+ len - 2 * CELT_OVERLAP);
+
+ frame->pf_period_old = frame->pf_period;
+ memcpy(frame->pf_gains_old, frame->pf_gains, sizeof(frame->pf_gains));
+ }
+
+ memmove(frame->buf, frame->buf + len, (1024 + CELT_OVERLAP / 2) * sizeof(float));
+}
+
+static int parse_postfilter(CeltContext *s, OpusRangeCoder *rc, int consumed)
+{
+ static const float postfilter_taps[3][3] = {
+ { 0.3066406250f, 0.2170410156f, 0.1296386719f },
+ { 0.4638671875f, 0.2680664062f, 0.0 },
+ { 0.7998046875f, 0.1000976562f, 0.0 }
+ };
+ int i;
+
+ memset(s->frame[0].pf_gains_new, 0, sizeof(s->frame[0].pf_gains_new));
+ memset(s->frame[1].pf_gains_new, 0, sizeof(s->frame[1].pf_gains_new));
+
+ if (s->startband == 0 && consumed + 16 <= s->framebits) {
+ int has_postfilter = opus_rc_p2model(rc, 1);
+ if (has_postfilter) {
+ float gain;
+ int tapset, octave, period;
+
+ octave = opus_rc_unimodel(rc, 6);
+ period = (16 << octave) + opus_getrawbits(rc, 4 + octave) - 1;
+ gain = 0.09375f * (opus_getrawbits(rc, 3) + 1);
+ tapset = (opus_rc_tell(rc) + 2 <= s->framebits) ?
+ opus_rc_getsymbol(rc, celt_model_tapset) : 0;
+
+ for (i = 0; i < 2; i++) {
+ CeltFrame *frame = &s->frame[i];
+
+ frame->pf_period_new = FFMAX(period, CELT_POSTFILTER_MINPERIOD);
+ frame->pf_gains_new[0] = gain * postfilter_taps[tapset][0];
+ frame->pf_gains_new[1] = gain * postfilter_taps[tapset][1];
+ frame->pf_gains_new[2] = gain * postfilter_taps[tapset][2];
+ }
+ }
+
+ consumed = opus_rc_tell(rc);
+ }
+
+ return consumed;
+}
+
+static void process_anticollapse(CeltContext *s, CeltFrame *frame, float *X)
+{
+ int i, j, k;
+
+ for (i = s->startband; i < s->endband; i++) {
+ int renormalize = 0;
+ float *xptr;
+ float prev[2];
+ float Ediff, r;
+ float thresh, sqrt_1;
+ int depth;
+
+ /* depth in 1/8 bits */
+ depth = (1 + s->pulses[i]) / (celt_freq_range[i] << s->duration);
+ thresh = pow(2, -1.0 - 0.125f * depth);
+ sqrt_1 = 1.0f / sqrtf(celt_freq_range[i] << s->duration);
+
+ xptr = X + (celt_freq_bands[i] << s->duration);
+
+ prev[0] = frame->prev_energy[0][i];
+ prev[1] = frame->prev_energy[1][i];
+ if (s->coded_channels == 1) {
+ CeltFrame *frame1 = &s->frame[1];
+
+ prev[0] = FFMAX(prev[0], frame1->prev_energy[0][i]);
+ prev[1] = FFMAX(prev[1], frame1->prev_energy[1][i]);
+ }
+ Ediff = frame->energy[i] - FFMIN(prev[0], prev[1]);
+ Ediff = FFMAX(0, Ediff);
+
+ /* r needs to be multiplied by 2 or 2*sqrt(2) depending on LM because
+ short blocks don't have the same energy as long */
+ r = pow(2, 1 - Ediff);
+ if (s->duration == 3)
+ r *= M_SQRT2;
+ r = FFMIN(thresh, r) * sqrt_1;
+ for (k = 0; k < 1 << s->duration; k++) {
+ /* Detect collapse */
+ if (!(frame->collapse_masks[i] & 1 << k)) {
+ /* Fill with noise */
+ for (j = 0; j < celt_freq_range[i]; j++)
+ xptr[(j << s->duration) + k] = (celt_rng(s) & 0x8000) ? r : -r;
+ renormalize = 1;
+ }
+ }
+
+ /* We just added some energy, so we need to renormalize */
+ if (renormalize)
+ celt_renormalize_vector(xptr, celt_freq_range[i] << s->duration, 1.0f);
+ }
+}
+
+static void celt_decode_bands(CeltContext *s, OpusRangeCoder *rc)
+{
+ float lowband_scratch[8 * 22];
+ float norm[2 * 8 * 100];
+
+ int totalbits = (s->framebits << 3) - s->anticollapse_bit;
+
+ int update_lowband = 1;
+ int lowband_offset = 0;
+
+ int i, j;
+
+ memset(s->coeffs, 0, sizeof(s->coeffs));
+
+ for (i = s->startband; i < s->endband; i++) {
+ int band_offset = celt_freq_bands[i] << s->duration;
+ int band_size = celt_freq_range[i] << s->duration;
+ float *X = s->coeffs[0] + band_offset;
+ float *Y = (s->coded_channels == 2) ? s->coeffs[1] + band_offset : NULL;
+
+ int consumed = opus_rc_tell_frac(rc);
+ float *norm2 = norm + 8 * 100;
+ int effective_lowband = -1;
+ unsigned int cm[2];
+ int b;
+
+ /* Compute how many bits we want to allocate to this band */
+ if (i != s->startband)
+ s->remaining -= consumed;
+ s->remaining2 = totalbits - consumed - 1;
+ if (i <= s->codedbands - 1) {
+ int curr_balance = s->remaining / FFMIN(3, s->codedbands-i);
+ b = av_clip(FFMIN(s->remaining2 + 1, s->pulses[i] + curr_balance), 0, 16383);
+ } else
+ b = 0;
+
+ if (celt_freq_bands[i] - celt_freq_range[i] >= celt_freq_bands[s->startband] &&
+ (update_lowband || lowband_offset == 0))
+ lowband_offset = i;
+
+ /* Get a conservative estimate of the collapse_mask's for the bands we're
+ going to be folding from. */
+ if (lowband_offset != 0 && (s->spread != CELT_SPREAD_AGGRESSIVE ||
+ s->blocks > 1 || s->tf_change[i] < 0)) {
+ int foldstart, foldend;
+
+ /* This ensures we never repeat spectral content within one band */
+ effective_lowband = FFMAX(celt_freq_bands[s->startband],
+ celt_freq_bands[lowband_offset] - celt_freq_range[i]);
+ foldstart = lowband_offset;
+ while (celt_freq_bands[--foldstart] > effective_lowband);
+ foldend = lowband_offset - 1;
+ while (celt_freq_bands[++foldend] < effective_lowband + celt_freq_range[i]);
+
+ cm[0] = cm[1] = 0;
+ for (j = foldstart; j < foldend; j++) {
+ cm[0] |= s->frame[0].collapse_masks[j];
+ cm[1] |= s->frame[s->coded_channels - 1].collapse_masks[j];
+ }
+ } else
+ /* Otherwise, we'll be using the LCG to fold, so all blocks will (almost
+ always) be non-zero.*/
+ cm[0] = cm[1] = (1 << s->blocks) - 1;
+
+ if (s->dualstereo && i == s->intensitystereo) {
+ /* Switch off dual stereo to do intensity */
+ s->dualstereo = 0;
+ for (j = celt_freq_bands[s->startband] << s->duration; j < band_offset; j++)
+ norm[j] = (norm[j] + norm2[j]) / 2;
+ }
+
+ if (s->dualstereo) {
+ cm[0] = celt_decode_band(s, rc, i, X, NULL, band_size, b / 2, s->blocks,
+ effective_lowband != -1 ? norm + (effective_lowband << s->duration) : NULL, s->duration,
+ norm + band_offset, 0, 1.0f, lowband_scratch, cm[0]);
+
+ cm[1] = celt_decode_band(s, rc, i, Y, NULL, band_size, b/2, s->blocks,
+ effective_lowband != -1 ? norm2 + (effective_lowband << s->duration) : NULL, s->duration,
+ norm2 + band_offset, 0, 1.0f, lowband_scratch, cm[1]);
+ } else {
+ cm[0] = celt_decode_band(s, rc, i, X, Y, band_size, b, s->blocks,
+ effective_lowband != -1 ? norm + (effective_lowband << s->duration) : NULL, s->duration,
+ norm + band_offset, 0, 1.0f, lowband_scratch, cm[0]|cm[1]);
+
+ cm[1] = cm[0];
+ }
+
+ s->frame[0].collapse_masks[i] = (uint8_t)cm[0];
+ s->frame[s->coded_channels - 1].collapse_masks[i] = (uint8_t)cm[1];
+ s->remaining += s->pulses[i] + consumed;
+
+ /* Update the folding position only as long as we have 1 bit/sample depth */
+ update_lowband = (b > band_size << 3);
+ }
+}
+
+int ff_celt_decode_frame(CeltContext *s, OpusRangeCoder *rc,
+ float **output, int coded_channels, int frame_size,
+ int startband, int endband)
+{
+ int i, j;
+
+ int consumed; // bits of entropy consumed thus far for this frame
+ int silence = 0;
+ int transient = 0;
+ int anticollapse = 0;
+ CeltIMDCTContext *imdct;
+ float imdct_scale = 1.0;
+
+ if (coded_channels != 1 && coded_channels != 2) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid number of coded channels: %d\n",
+ coded_channels);
+ return AVERROR_INVALIDDATA;
+ }
+ if (startband < 0 || startband > endband || endband > CELT_MAX_BANDS) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid start/end band: %d %d\n",
+ startband, endband);
+ return AVERROR_INVALIDDATA;
+ }
+
+ s->flushed = 0;
+ s->coded_channels = coded_channels;
+ s->startband = startband;
+ s->endband = endband;
+ s->framebits = rc->rb.bytes * 8;
+
+ s->duration = av_log2(frame_size / CELT_SHORT_BLOCKSIZE);
+ if (s->duration > CELT_MAX_LOG_BLOCKS ||
+ frame_size != CELT_SHORT_BLOCKSIZE * (1 << s->duration)) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid CELT frame size: %d\n",
+ frame_size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (!s->output_channels)
+ s->output_channels = coded_channels;
+
+ memset(s->frame[0].collapse_masks, 0, sizeof(s->frame[0].collapse_masks));
+ memset(s->frame[1].collapse_masks, 0, sizeof(s->frame[1].collapse_masks));
+
+ consumed = opus_rc_tell(rc);
+
+ /* obtain silence flag */
+ if (consumed >= s->framebits)
+ silence = 1;
+ else if (consumed == 1)
+ silence = opus_rc_p2model(rc, 15);
+
+
+ if (silence) {
+ consumed = s->framebits;
+ rc->total_read_bits += s->framebits - opus_rc_tell(rc);
+ }
+
+ /* obtain post-filter options */
+ consumed = parse_postfilter(s, rc, consumed);
+
+ /* obtain transient flag */
+ if (s->duration != 0 && consumed+3 <= s->framebits)
+ transient = opus_rc_p2model(rc, 3);
+
+ s->blocks = transient ? 1 << s->duration : 1;
+ s->blocksize = frame_size / s->blocks;
+
+ imdct = s->imdct[transient ? 0 : s->duration];
+
+ if (coded_channels == 1) {
+ for (i = 0; i < CELT_MAX_BANDS; i++)
+ s->frame[0].energy[i] = FFMAX(s->frame[0].energy[i], s->frame[1].energy[i]);
+ }
+
+ celt_decode_coarse_energy(s, rc);
+ celt_decode_tf_changes (s, rc, transient);
+ celt_decode_allocation (s, rc);
+ celt_decode_fine_energy (s, rc);
+ celt_decode_bands (s, rc);
+
+ if (s->anticollapse_bit)
+ anticollapse = opus_getrawbits(rc, 1);
+
+ celt_decode_final_energy(s, rc, s->framebits - opus_rc_tell(rc));
+
+ /* apply anti-collapse processing and denormalization to
+ * each coded channel */
+ for (i = 0; i < s->coded_channels; i++) {
+ CeltFrame *frame = &s->frame[i];
+
+ if (anticollapse)
+ process_anticollapse(s, frame, s->coeffs[i]);
+
+ celt_denormalize(s, frame, s->coeffs[i]);
+ }
+
+ /* stereo -> mono downmix */
+ if (s->output_channels < s->coded_channels) {
+ s->dsp.vector_fmac_scalar(s->coeffs[0], s->coeffs[1], 1.0, FFALIGN(frame_size, 16));
+ imdct_scale = 0.5;
+ } else if (s->output_channels > s->coded_channels)
+ memcpy(s->coeffs[1], s->coeffs[0], frame_size * sizeof(float));
+
+ if (silence) {
+ for (i = 0; i < 2; i++) {
+ CeltFrame *frame = &s->frame[i];
+
+ for (j = 0; j < FF_ARRAY_ELEMS(frame->energy); j++)
+ frame->energy[j] = CELT_ENERGY_SILENCE;
+ }
+ memset(s->coeffs, 0, sizeof(s->coeffs));
+ }
+
+ /* transform and output for each output channel */
+ for (i = 0; i < s->output_channels; i++) {
+ CeltFrame *frame = &s->frame[i];
+ float m = frame->deemph_coeff;
+
+ /* iMDCT and overlap-add */
+ for (j = 0; j < s->blocks; j++) {
+ float *dst = frame->buf + 1024 + j * s->blocksize;
+
+ imdct->imdct_half(imdct, dst + CELT_OVERLAP / 2, s->coeffs[i] + j,
+ s->blocks, imdct_scale);
+ s->dsp.vector_fmul_window(dst, dst, dst + CELT_OVERLAP / 2,
+ celt_window, CELT_OVERLAP / 2);
+ }
+
+ /* postfilter */
+ celt_postfilter(s, frame);
+
+ /* deemphasis and output scaling */
+ for (j = 0; j < frame_size; j++) {
+ float tmp = frame->buf[1024 - frame_size + j] + m;
+ m = tmp * CELT_DEEMPH_COEFF;
+ output[i][j] = tmp / 32768.;
+ }
+ frame->deemph_coeff = m;
+ }
+
+ if (coded_channels == 1)
+ memcpy(s->frame[1].energy, s->frame[0].energy, sizeof(s->frame[0].energy));
+
+ for (i = 0; i < 2; i++ ) {
+ CeltFrame *frame = &s->frame[i];
+
+ if (!transient) {
+ memcpy(frame->prev_energy[1], frame->prev_energy[0], sizeof(frame->prev_energy[0]));
+ memcpy(frame->prev_energy[0], frame->energy, sizeof(frame->prev_energy[0]));
+ } else {
+ for (j = 0; j < CELT_MAX_BANDS; j++)
+ frame->prev_energy[0][j] = FFMIN(frame->prev_energy[0][j], frame->energy[j]);
+ }
+
+ for (j = 0; j < s->startband; j++) {
+ frame->prev_energy[0][j] = CELT_ENERGY_SILENCE;
+ frame->energy[j] = 0.0;
+ }
+ for (j = s->endband; j < CELT_MAX_BANDS; j++) {
+ frame->prev_energy[0][j] = CELT_ENERGY_SILENCE;
+ frame->energy[j] = 0.0;
+ }
+ }
+
+ s->seed = rc->range;
+
+ return 0;
+}
+
+void ff_celt_flush(CeltContext *s)
+{
+ int i, j;
+
+ if (s->flushed)
+ return;
+
+ for (i = 0; i < 2; i++) {
+ CeltFrame *frame = &s->frame[i];
+
+ for (j = 0; j < CELT_MAX_BANDS; j++)
+ frame->prev_energy[0][j] = frame->prev_energy[1][j] = CELT_ENERGY_SILENCE;
+
+ memset(frame->energy, 0, sizeof(frame->energy));
+ memset(frame->buf, 0, sizeof(frame->buf));
+
+ memset(frame->pf_gains, 0, sizeof(frame->pf_gains));
+ memset(frame->pf_gains_old, 0, sizeof(frame->pf_gains_old));
+ memset(frame->pf_gains_new, 0, sizeof(frame->pf_gains_new));
+
+ frame->deemph_coeff = 0.0;
+ }
+ s->seed = 0;
+
+ s->flushed = 1;
+}
+
+void ff_celt_free(CeltContext **ps)
+{
+ CeltContext *s = *ps;
+ int i;
+
+ if (!s)
+ return;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(s->imdct); i++)
+ ff_celt_imdct_uninit(&s->imdct[i]);
+
+ av_freep(ps);
+}
+
+int ff_celt_init(AVCodecContext *avctx, CeltContext **ps, int output_channels)
+{
+ CeltContext *s;
+ int i, ret;
+
+ if (output_channels != 1 && output_channels != 2) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n",
+ output_channels);
+ return AVERROR(EINVAL);
+ }
+
+ s = av_mallocz(sizeof(*s));
+ if (!s)
+ return AVERROR(ENOMEM);
+
+ s->avctx = avctx;
+ s->output_channels = output_channels;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(s->imdct); i++) {
+ ret = ff_celt_imdct_init(&s->imdct[i], i + 3);
+ if (ret < 0)
+ goto fail;
+ }
+
+ avpriv_float_dsp_init(&s->dsp, avctx->flags & CODEC_FLAG_BITEXACT);
+
+ ff_celt_flush(s);
+
+ *ps = s;
+
+ return 0;
+fail:
+ ff_celt_free(&s);
+ return ret;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/opus_imdct.c b/chromium/third_party/ffmpeg/libavcodec/opus_imdct.c
new file mode 100644
index 00000000000..0a6fca994ec
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/opus_imdct.c
@@ -0,0 +1,272 @@
+/*
+ * Copyright (c) 2013-2014 Mozilla Corporation
+ *
+ * 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
+ * Celt non-power of 2 iMDCT
+ */
+
+#include <float.h>
+#include <math.h>
+#include <stddef.h>
+
+#include "config.h"
+
+#include "libavutil/attributes.h"
+#include "libavutil/common.h"
+
+#include "avfft.h"
+#include "opus.h"
+#include "opus_imdct.h"
+
+// minimal iMDCT size to make SIMD opts easier
+#define CELT_MIN_IMDCT_SIZE 120
+
+// complex c = a * b
+#define CMUL3(cre, cim, are, aim, bre, bim) \
+do { \
+ cre = are * bre - aim * bim; \
+ cim = are * bim + aim * bre; \
+} while (0)
+
+#define CMUL(c, a, b) CMUL3((c).re, (c).im, (a).re, (a).im, (b).re, (b).im)
+
+// complex c = a * b
+// d = a * conjugate(b)
+#define CMUL2(c, d, a, b) \
+do { \
+ float are = (a).re; \
+ float aim = (a).im; \
+ float bre = (b).re; \
+ float bim = (b).im; \
+ float rr = are * bre; \
+ float ri = are * bim; \
+ float ir = aim * bre; \
+ float ii = aim * bim; \
+ (c).re = rr - ii; \
+ (c).im = ri + ir; \
+ (d).re = rr + ii; \
+ (d).im = -ri + ir; \
+} while (0)
+
+av_cold void ff_celt_imdct_uninit(CeltIMDCTContext **ps)
+{
+ CeltIMDCTContext *s = *ps;
+ int i;
+
+ if (!s)
+ return;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(s->exptab); i++)
+ av_freep(&s->exptab[i]);
+
+ av_freep(&s->twiddle_exptab);
+
+ av_freep(&s->tmp);
+
+ av_freep(ps);
+}
+
+static void celt_imdct_half(CeltIMDCTContext *s, float *dst, const float *src,
+ ptrdiff_t stride, float scale);
+
+av_cold int ff_celt_imdct_init(CeltIMDCTContext **ps, int N)
+{
+ CeltIMDCTContext *s;
+ int len2 = 15 * (1 << N);
+ int len = 2 * len2;
+ int i, j;
+
+ if (len2 > CELT_MAX_FRAME_SIZE || len2 < CELT_MIN_IMDCT_SIZE)
+ return AVERROR(EINVAL);
+
+ s = av_mallocz(sizeof(*s));
+ if (!s)
+ return AVERROR(ENOMEM);
+
+ s->fft_n = N - 1;
+ s->len4 = len2 / 2;
+ s->len2 = len2;
+
+ s->tmp = av_malloc(len * 2 * sizeof(*s->tmp));
+ if (!s->tmp)
+ goto fail;
+
+ s->twiddle_exptab = av_malloc(s->len4 * sizeof(*s->twiddle_exptab));
+ if (!s->twiddle_exptab)
+ goto fail;
+
+ for (i = 0; i < s->len4; i++) {
+ s->twiddle_exptab[i].re = cos(2 * M_PI * (i + 0.125 + s->len4) / len);
+ s->twiddle_exptab[i].im = sin(2 * M_PI * (i + 0.125 + s->len4) / len);
+ }
+
+ for (i = 0; i < FF_ARRAY_ELEMS(s->exptab); i++) {
+ int N = 15 * (1 << i);
+ s->exptab[i] = av_malloc(sizeof(*s->exptab[i]) * FFMAX(N, 19));
+ if (!s->exptab[i])
+ goto fail;
+
+ for (j = 0; j < N; j++) {
+ s->exptab[i][j].re = cos(2 * M_PI * j / N);
+ s->exptab[i][j].im = sin(2 * M_PI * j / N);
+ }
+ }
+
+ // wrap around to simplify fft15
+ for (j = 15; j < 19; j++)
+ s->exptab[0][j] = s->exptab[0][j - 15];
+
+ s->imdct_half = celt_imdct_half;
+
+ if (ARCH_AARCH64)
+ ff_celt_imdct_init_aarch64(s);
+
+ *ps = s;
+
+ return 0;
+fail:
+ ff_celt_imdct_uninit(&s);
+ return AVERROR(ENOMEM);
+}
+
+static void fft5(FFTComplex *out, const FFTComplex *in, ptrdiff_t stride)
+{
+ // [0] = exp(2 * i * pi / 5), [1] = exp(2 * i * pi * 2 / 5)
+ static const FFTComplex fact[] = { { 0.30901699437494745, 0.95105651629515353 },
+ { -0.80901699437494734, 0.58778525229247325 } };
+
+ FFTComplex z[4][4];
+
+ CMUL2(z[0][0], z[0][3], in[1 * stride], fact[0]);
+ CMUL2(z[0][1], z[0][2], in[1 * stride], fact[1]);
+ CMUL2(z[1][0], z[1][3], in[2 * stride], fact[0]);
+ CMUL2(z[1][1], z[1][2], in[2 * stride], fact[1]);
+ CMUL2(z[2][0], z[2][3], in[3 * stride], fact[0]);
+ CMUL2(z[2][1], z[2][2], in[3 * stride], fact[1]);
+ CMUL2(z[3][0], z[3][3], in[4 * stride], fact[0]);
+ CMUL2(z[3][1], z[3][2], in[4 * stride], fact[1]);
+
+ out[0].re = in[0].re + in[stride].re + in[2 * stride].re + in[3 * stride].re + in[4 * stride].re;
+ out[0].im = in[0].im + in[stride].im + in[2 * stride].im + in[3 * stride].im + in[4 * stride].im;
+
+ out[1].re = in[0].re + z[0][0].re + z[1][1].re + z[2][2].re + z[3][3].re;
+ out[1].im = in[0].im + z[0][0].im + z[1][1].im + z[2][2].im + z[3][3].im;
+
+ out[2].re = in[0].re + z[0][1].re + z[1][3].re + z[2][0].re + z[3][2].re;
+ out[2].im = in[0].im + z[0][1].im + z[1][3].im + z[2][0].im + z[3][2].im;
+
+ out[3].re = in[0].re + z[0][2].re + z[1][0].re + z[2][3].re + z[3][1].re;
+ out[3].im = in[0].im + z[0][2].im + z[1][0].im + z[2][3].im + z[3][1].im;
+
+ out[4].re = in[0].re + z[0][3].re + z[1][2].re + z[2][1].re + z[3][0].re;
+ out[4].im = in[0].im + z[0][3].im + z[1][2].im + z[2][1].im + z[3][0].im;
+}
+
+static void fft15(CeltIMDCTContext *s, FFTComplex *out, const FFTComplex *in, ptrdiff_t stride)
+{
+ const FFTComplex *exptab = s->exptab[0];
+ FFTComplex tmp[5];
+ FFTComplex tmp1[5];
+ FFTComplex tmp2[5];
+ int k;
+
+ fft5(tmp, in, stride * 3);
+ fft5(tmp1, in + stride, stride * 3);
+ fft5(tmp2, in + 2 * stride, stride * 3);
+
+ for (k = 0; k < 5; k++) {
+ FFTComplex t1, t2;
+
+ CMUL(t1, tmp1[k], exptab[k]);
+ CMUL(t2, tmp2[k], exptab[2 * k]);
+ out[k].re = tmp[k].re + t1.re + t2.re;
+ out[k].im = tmp[k].im + t1.im + t2.im;
+
+ CMUL(t1, tmp1[k], exptab[k + 5]);
+ CMUL(t2, tmp2[k], exptab[2 * (k + 5)]);
+ out[k + 5].re = tmp[k].re + t1.re + t2.re;
+ out[k + 5].im = tmp[k].im + t1.im + t2.im;
+
+ CMUL(t1, tmp1[k], exptab[k + 10]);
+ CMUL(t2, tmp2[k], exptab[2 * k + 5]);
+ out[k + 10].re = tmp[k].re + t1.re + t2.re;
+ out[k + 10].im = tmp[k].im + t1.im + t2.im;
+ }
+}
+
+/*
+ * FFT of the length 15 * (2^N)
+ */
+static void fft_calc(CeltIMDCTContext *s, FFTComplex *out, const FFTComplex *in,
+ int N, ptrdiff_t stride)
+{
+ if (N) {
+ const FFTComplex *exptab = s->exptab[N];
+ const int len2 = 15 * (1 << (N - 1));
+ int k;
+
+ fft_calc(s, out, in, N - 1, stride * 2);
+ fft_calc(s, out + len2, in + stride, N - 1, stride * 2);
+
+ for (k = 0; k < len2; k++) {
+ FFTComplex t;
+
+ CMUL(t, out[len2 + k], exptab[k]);
+
+ out[len2 + k].re = out[k].re - t.re;
+ out[len2 + k].im = out[k].im - t.im;
+
+ out[k].re += t.re;
+ out[k].im += t.im;
+ }
+ } else
+ fft15(s, out, in, stride);
+}
+
+static void celt_imdct_half(CeltIMDCTContext *s, float *dst, const float *src,
+ ptrdiff_t stride, float scale)
+{
+ FFTComplex *z = (FFTComplex *)dst;
+ const int len8 = s->len4 / 2;
+ const float *in1 = src;
+ const float *in2 = src + (s->len2 - 1) * stride;
+ int i;
+
+ for (i = 0; i < s->len4; i++) {
+ FFTComplex tmp = { *in2, *in1 };
+ CMUL(s->tmp[i], tmp, s->twiddle_exptab[i]);
+ in1 += 2 * stride;
+ in2 -= 2 * stride;
+ }
+
+ fft_calc(s, z, s->tmp, s->fft_n, 1);
+
+ for (i = 0; i < len8; i++) {
+ float r0, i0, r1, i1;
+
+ CMUL3(r0, i1, z[len8 - i - 1].im, z[len8 - i - 1].re, s->twiddle_exptab[len8 - i - 1].im, s->twiddle_exptab[len8 - i - 1].re);
+ CMUL3(r1, i0, z[len8 + i].im, z[len8 + i].re, s->twiddle_exptab[len8 + i].im, s->twiddle_exptab[len8 + i].re);
+ z[len8 - i - 1].re = scale * r0;
+ z[len8 - i - 1].im = scale * i0;
+ z[len8 + i].re = scale * r1;
+ z[len8 + i].im = scale * i1;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/opus_imdct.h b/chromium/third_party/ffmpeg/libavcodec/opus_imdct.h
new file mode 100644
index 00000000000..0ca4d973d0e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/opus_imdct.h
@@ -0,0 +1,57 @@
+/*
+ * 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_OPUS_IMDCT_H
+#define AVCODEC_OPUS_IMDCT_H
+
+#include <stddef.h>
+
+#include "avfft.h"
+
+typedef struct CeltIMDCTContext {
+ int fft_n;
+ int len2;
+ int len4;
+
+ FFTComplex *tmp;
+
+ FFTComplex *twiddle_exptab;
+
+ FFTComplex *exptab[6];
+
+ /**
+ * Calculate the middle half of the iMDCT
+ */
+ void (*imdct_half)(struct CeltIMDCTContext *s, float *dst, const float *src,
+ ptrdiff_t src_stride, float scale);
+} CeltIMDCTContext;
+
+/**
+ * Init an iMDCT of the length 2 * 15 * (2^N)
+ */
+int ff_celt_imdct_init(CeltIMDCTContext **s, int N);
+
+/**
+ * Free an iMDCT.
+ */
+void ff_celt_imdct_uninit(CeltIMDCTContext **s);
+
+
+void ff_celt_imdct_init_aarch64(CeltIMDCTContext *s);
+
+#endif /* AVCODEC_OPUS_IMDCT_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/opus_parser.c b/chromium/third_party/ffmpeg/libavcodec/opus_parser.c
new file mode 100644
index 00000000000..7eb72f9c34a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/opus_parser.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2013-2014 Mozilla Corporation
+ *
+ * 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
+ * Opus parser
+ *
+ * Determines the duration for each packet.
+ */
+
+#include "avcodec.h"
+#include "opus.h"
+
+typedef struct OpusParseContext {
+ OpusContext ctx;
+ OpusPacket pkt;
+ int extradata_parsed;
+} OpusParseContext;
+
+static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx,
+ const uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size)
+{
+ OpusParseContext *s = ctx->priv_data;
+ int ret;
+
+ if (!buf_size)
+ return 0;
+
+ if (avctx->extradata && !s->extradata_parsed) {
+ ret = ff_opus_parse_extradata(avctx, &s->ctx);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error parsing Ogg extradata.\n");
+ goto fail;
+ }
+ av_freep(&s->ctx.channel_maps);
+ s->extradata_parsed = 1;
+ }
+
+ ret = ff_opus_parse_packet(&s->pkt, buf, buf_size, s->ctx.nb_streams > 1);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error parsing Opus packet header.\n");
+ goto fail;
+ }
+
+ ctx->duration = s->pkt.frame_count * s->pkt.frame_duration;
+
+fail:
+ *poutbuf = buf;
+ *poutbuf_size = buf_size;
+ return buf_size;
+}
+
+AVCodecParser ff_opus_parser = {
+ .codec_ids = { AV_CODEC_ID_OPUS },
+ .priv_data_size = sizeof(OpusParseContext),
+ .parser_parse = opus_parse,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/opus_silk.c b/chromium/third_party/ffmpeg/libavcodec/opus_silk.c
new file mode 100644
index 00000000000..7a89479fb93
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/opus_silk.c
@@ -0,0 +1,1597 @@
+/*
+ * Copyright (c) 2012 Andrew D'Addesio
+ * Copyright (c) 2013-2014 Mozilla Corporation
+ *
+ * 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
+ * Opus SILK decoder
+ */
+
+#include <stdint.h>
+
+#include "opus.h"
+
+typedef struct SilkFrame {
+ int coded;
+ int log_gain;
+ int16_t nlsf[16];
+ float lpc[16];
+
+ float output [2 * SILK_HISTORY];
+ float lpc_history[2 * SILK_HISTORY];
+ int primarylag;
+
+ int prev_voiced;
+} SilkFrame;
+
+struct SilkContext {
+ AVCodecContext *avctx;
+ int output_channels;
+
+ int midonly;
+ int subframes;
+ int sflength;
+ int flength;
+ int nlsf_interp_factor;
+
+ enum OpusBandwidth bandwidth;
+ int wb;
+
+ SilkFrame frame[2];
+ float prev_stereo_weights[2];
+ float stereo_weights[2];
+
+ int prev_coded_channels;
+};
+
+static const uint16_t silk_model_stereo_s1[] = {
+ 256, 7, 9, 10, 11, 12, 22, 46, 54, 55, 56, 59, 82, 174, 197, 200,
+ 201, 202, 210, 234, 244, 245, 246, 247, 249, 256
+};
+
+static const uint16_t silk_model_stereo_s2[] = {256, 85, 171, 256};
+
+static const uint16_t silk_model_stereo_s3[] = {256, 51, 102, 154, 205, 256};
+
+static const uint16_t silk_model_mid_only[] = {256, 192, 256};
+
+static const uint16_t silk_model_frame_type_inactive[] = {256, 26, 256};
+
+static const uint16_t silk_model_frame_type_active[] = {256, 24, 98, 246, 256};
+
+static const uint16_t silk_model_gain_highbits[3][9] = {
+ {256, 32, 144, 212, 241, 253, 254, 255, 256},
+ {256, 2, 19, 64, 124, 186, 233, 252, 256},
+ {256, 1, 4, 30, 101, 195, 245, 254, 256}
+};
+
+static const uint16_t silk_model_gain_lowbits[] = {256, 32, 64, 96, 128, 160, 192, 224, 256};
+
+static const uint16_t silk_model_gain_delta[] = {
+ 256, 6, 11, 22, 53, 185, 206, 214, 218, 221, 223, 225, 227, 228, 229, 230,
+ 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246,
+ 247, 248, 249, 250, 251, 252, 253, 254, 255, 256
+};
+static const uint16_t silk_model_lsf_s1[2][2][33] = {
+ {
+ { // NB or MB, unvoiced
+ 256, 44, 78, 108, 127, 148, 160, 171, 174, 177, 179, 195, 197, 199, 200, 205,
+ 207, 208, 211, 214, 215, 216, 218, 220, 222, 225, 226, 235, 244, 246, 253, 255, 256
+ }, { // NB or MB, voiced
+ 256, 1, 11, 12, 20, 23, 31, 39, 53, 66, 80, 81, 95, 107, 120, 131,
+ 142, 154, 165, 175, 185, 196, 204, 213, 221, 228, 236, 237, 238, 244, 245, 251, 256
+ }
+ }, {
+ { // WB, unvoiced
+ 256, 31, 52, 55, 72, 73, 81, 98, 102, 103, 121, 137, 141, 143, 146, 147,
+ 157, 158, 161, 177, 188, 204, 206, 208, 211, 213, 224, 225, 229, 238, 246, 253, 256
+ }, { // WB, voiced
+ 256, 1, 5, 21, 26, 44, 55, 60, 74, 89, 90, 93, 105, 118, 132, 146,
+ 152, 166, 178, 180, 186, 187, 199, 211, 222, 232, 235, 245, 250, 251, 252, 253, 256
+ }
+ }
+};
+
+static const uint16_t silk_model_lsf_s2[32][10] = {
+ // NB, MB
+ { 256, 1, 2, 3, 18, 242, 253, 254, 255, 256 },
+ { 256, 1, 2, 4, 38, 221, 253, 254, 255, 256 },
+ { 256, 1, 2, 6, 48, 197, 252, 254, 255, 256 },
+ { 256, 1, 2, 10, 62, 185, 246, 254, 255, 256 },
+ { 256, 1, 4, 20, 73, 174, 248, 254, 255, 256 },
+ { 256, 1, 4, 21, 76, 166, 239, 254, 255, 256 },
+ { 256, 1, 8, 32, 85, 159, 226, 252, 255, 256 },
+ { 256, 1, 2, 20, 83, 161, 219, 249, 255, 256 },
+
+ // WB
+ { 256, 1, 2, 3, 12, 244, 253, 254, 255, 256 },
+ { 256, 1, 2, 4, 32, 218, 253, 254, 255, 256 },
+ { 256, 1, 2, 5, 47, 199, 252, 254, 255, 256 },
+ { 256, 1, 2, 12, 61, 187, 252, 254, 255, 256 },
+ { 256, 1, 5, 24, 72, 172, 249, 254, 255, 256 },
+ { 256, 1, 2, 16, 70, 170, 242, 254, 255, 256 },
+ { 256, 1, 2, 17, 78, 165, 226, 251, 255, 256 },
+ { 256, 1, 8, 29, 79, 156, 237, 254, 255, 256 }
+};
+
+static const uint16_t silk_model_lsf_s2_ext[] = { 256, 156, 216, 240, 249, 253, 255, 256 };
+
+static const uint16_t silk_model_lsf_interpolation_offset[] = { 256, 13, 35, 64, 75, 256 };
+
+static const uint16_t silk_model_pitch_highbits[] = {
+ 256, 3, 6, 12, 23, 44, 74, 106, 125, 136, 146, 158, 171, 184, 196, 207,
+ 216, 224, 231, 237, 241, 243, 245, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256
+};
+
+static const uint16_t silk_model_pitch_lowbits_nb[]= { 256, 64, 128, 192, 256 };
+
+static const uint16_t silk_model_pitch_lowbits_mb[]= { 256, 43, 85, 128, 171, 213, 256 };
+
+static const uint16_t silk_model_pitch_lowbits_wb[]= { 256, 32, 64, 96, 128, 160, 192, 224, 256 };
+
+static const uint16_t silk_model_pitch_delta[] = {
+ 256, 46, 48, 50, 53, 57, 63, 73, 88, 114, 152, 182, 204, 219, 229, 236,
+ 242, 246, 250, 252, 254, 256
+};
+
+static const uint16_t silk_model_pitch_contour_nb10ms[] = { 256, 143, 193, 256 };
+
+static const uint16_t silk_model_pitch_contour_nb20ms[] = {
+ 256, 68, 80, 101, 118, 137, 159, 189, 213, 230, 246, 256
+};
+
+static const uint16_t silk_model_pitch_contour_mbwb10ms[] = {
+ 256, 91, 137, 176, 195, 209, 221, 229, 236, 242, 247, 252, 256
+};
+
+static const uint16_t silk_model_pitch_contour_mbwb20ms[] = {
+ 256, 33, 55, 73, 89, 104, 118, 132, 145, 158, 168, 177, 186, 194, 200, 206,
+ 212, 217, 221, 225, 229, 232, 235, 238, 240, 242, 244, 246, 248, 250, 252, 253,
+ 254, 255, 256
+};
+
+static const uint16_t silk_model_ltp_filter[] = { 256, 77, 157, 256 };
+
+static const uint16_t silk_model_ltp_filter0_sel[] = {
+ 256, 185, 200, 213, 226, 235, 244, 250, 256
+};
+
+static const uint16_t silk_model_ltp_filter1_sel[] = {
+ 256, 57, 91, 112, 132, 147, 160, 172, 185, 195, 205, 214, 224, 233, 241, 248, 256
+};
+
+static const uint16_t silk_model_ltp_filter2_sel[] = {
+ 256, 15, 31, 45, 57, 69, 81, 92, 103, 114, 124, 133, 142, 151, 160, 168,
+ 176, 184, 192, 199, 206, 212, 218, 223, 227, 232, 236, 240, 244, 247, 251, 254, 256
+};
+
+static const uint16_t silk_model_ltp_scale_index[] = { 256, 128, 192, 256 };
+
+static const uint16_t silk_model_lcg_seed[] = { 256, 64, 128, 192, 256 };
+
+static const uint16_t silk_model_exc_rate[2][10] = {
+ { 256, 15, 66, 78, 124, 169, 182, 215, 242, 256 }, // unvoiced
+ { 256, 33, 63, 99, 116, 150, 199, 217, 238, 256 } // voiced
+};
+
+static const uint16_t silk_model_pulse_count[11][19] = {
+ { 256, 131, 205, 230, 238, 241, 244, 245, 246,
+ 247, 248, 249, 250, 251, 252, 253, 254, 255, 256 },
+ { 256, 58, 151, 211, 234, 241, 244, 245, 246,
+ 247, 248, 249, 250, 251, 252, 253, 254, 255, 256 },
+ { 256, 43, 94, 140, 173, 197, 213, 224, 232,
+ 238, 241, 244, 247, 249, 250, 251, 253, 254, 256 },
+ { 256, 17, 69, 140, 197, 228, 240, 245, 246,
+ 247, 248, 249, 250, 251, 252, 253, 254, 255, 256 },
+ { 256, 6, 27, 68, 121, 170, 205, 226, 237,
+ 243, 246, 248, 250, 251, 252, 253, 254, 255, 256 },
+ { 256, 7, 21, 43, 71, 100, 128, 153, 173,
+ 190, 203, 214, 223, 230, 235, 239, 243, 246, 256 },
+ { 256, 2, 7, 21, 50, 92, 138, 179, 210,
+ 229, 240, 246, 249, 251, 252, 253, 254, 255, 256 },
+ { 256, 1, 3, 7, 17, 36, 65, 100, 137,
+ 171, 199, 219, 233, 241, 246, 250, 252, 254, 256 },
+ { 256, 1, 3, 5, 10, 19, 33, 53, 77,
+ 104, 132, 158, 181, 201, 216, 227, 235, 241, 256 },
+ { 256, 1, 2, 3, 9, 36, 94, 150, 189,
+ 214, 228, 238, 244, 247, 250, 252, 253, 254, 256 },
+ { 256, 2, 3, 9, 36, 94, 150, 189, 214,
+ 228, 238, 244, 247, 250, 252, 253, 254, 256, 256 }
+};
+
+static const uint16_t silk_model_pulse_location[4][168] = {
+ {
+ 256, 126, 256,
+ 256, 56, 198, 256,
+ 256, 25, 126, 230, 256,
+ 256, 12, 72, 180, 244, 256,
+ 256, 7, 42, 126, 213, 250, 256,
+ 256, 4, 24, 83, 169, 232, 253, 256,
+ 256, 3, 15, 53, 125, 200, 242, 254, 256,
+ 256, 2, 10, 35, 89, 162, 221, 248, 255, 256,
+ 256, 2, 7, 24, 63, 126, 191, 233, 251, 255, 256,
+ 256, 1, 5, 17, 45, 94, 157, 211, 241, 252, 255, 256,
+ 256, 1, 5, 13, 33, 70, 125, 182, 223, 245, 253, 255, 256,
+ 256, 1, 4, 11, 26, 54, 98, 151, 199, 232, 248, 254, 255, 256,
+ 256, 1, 3, 9, 21, 42, 77, 124, 172, 212, 237, 249, 254, 255, 256,
+ 256, 1, 2, 6, 16, 33, 60, 97, 144, 187, 220, 241, 250, 254, 255, 256,
+ 256, 1, 2, 3, 11, 25, 47, 80, 120, 163, 201, 229, 245, 253, 254, 255, 256,
+ 256, 1, 2, 3, 4, 17, 35, 62, 98, 139, 180, 214, 238, 252, 253, 254, 255, 256
+ },{
+ 256, 127, 256,
+ 256, 53, 202, 256,
+ 256, 22, 127, 233, 256,
+ 256, 11, 72, 183, 246, 256,
+ 256, 6, 41, 127, 215, 251, 256,
+ 256, 4, 24, 83, 170, 232, 253, 256,
+ 256, 3, 16, 56, 127, 200, 241, 254, 256,
+ 256, 3, 12, 39, 92, 162, 218, 246, 255, 256,
+ 256, 3, 11, 30, 67, 124, 185, 229, 249, 255, 256,
+ 256, 3, 10, 25, 53, 97, 151, 200, 233, 250, 255, 256,
+ 256, 1, 8, 21, 43, 77, 123, 171, 209, 237, 251, 255, 256,
+ 256, 1, 2, 13, 35, 62, 97, 139, 186, 219, 244, 254, 255, 256,
+ 256, 1, 2, 8, 22, 48, 85, 128, 171, 208, 234, 248, 254, 255, 256,
+ 256, 1, 2, 6, 16, 36, 67, 107, 149, 189, 220, 240, 250, 254, 255, 256,
+ 256, 1, 2, 5, 13, 29, 55, 90, 128, 166, 201, 227, 243, 251, 254, 255, 256,
+ 256, 1, 2, 4, 10, 22, 43, 73, 109, 147, 183, 213, 234, 246, 252, 254, 255, 256
+ },{
+ 256, 127, 256,
+ 256, 49, 206, 256,
+ 256, 20, 127, 236, 256,
+ 256, 11, 71, 184, 246, 256,
+ 256, 7, 43, 127, 214, 250, 256,
+ 256, 6, 30, 87, 169, 229, 252, 256,
+ 256, 5, 23, 62, 126, 194, 236, 252, 256,
+ 256, 6, 20, 49, 96, 157, 209, 239, 253, 256,
+ 256, 1, 16, 39, 74, 125, 175, 215, 245, 255, 256,
+ 256, 1, 2, 23, 55, 97, 149, 195, 236, 254, 255, 256,
+ 256, 1, 7, 23, 50, 86, 128, 170, 206, 233, 249, 255, 256,
+ 256, 1, 6, 18, 39, 70, 108, 148, 186, 217, 238, 250, 255, 256,
+ 256, 1, 4, 13, 30, 56, 90, 128, 166, 200, 226, 243, 252, 255, 256,
+ 256, 1, 4, 11, 25, 47, 76, 110, 146, 180, 209, 231, 245, 252, 255, 256,
+ 256, 1, 3, 8, 19, 37, 62, 93, 128, 163, 194, 219, 237, 248, 253, 255, 256,
+ 256, 1, 2, 6, 15, 30, 51, 79, 111, 145, 177, 205, 226, 241, 250, 254, 255, 256
+ },{
+ 256, 128, 256,
+ 256, 42, 214, 256,
+ 256, 21, 128, 235, 256,
+ 256, 12, 72, 184, 245, 256,
+ 256, 8, 42, 128, 214, 249, 256,
+ 256, 8, 31, 86, 176, 231, 251, 256,
+ 256, 5, 20, 58, 130, 202, 238, 253, 256,
+ 256, 6, 18, 45, 97, 174, 221, 241, 251, 256,
+ 256, 6, 25, 53, 88, 128, 168, 203, 231, 250, 256,
+ 256, 4, 18, 40, 71, 108, 148, 185, 216, 238, 252, 256,
+ 256, 3, 13, 31, 57, 90, 128, 166, 199, 225, 243, 253, 256,
+ 256, 2, 10, 23, 44, 73, 109, 147, 183, 212, 233, 246, 254, 256,
+ 256, 1, 6, 16, 33, 58, 90, 128, 166, 198, 223, 240, 250, 255, 256,
+ 256, 1, 5, 12, 25, 46, 75, 110, 146, 181, 210, 231, 244, 251, 255, 256,
+ 256, 1, 3, 8, 18, 35, 60, 92, 128, 164, 196, 221, 238, 248, 253, 255, 256,
+ 256, 1, 3, 7, 14, 27, 48, 76, 110, 146, 180, 208, 229, 242, 249, 253, 255, 256
+ }
+};
+
+static const uint16_t silk_model_excitation_lsb[] = {256, 136, 256};
+
+static const uint16_t silk_model_excitation_sign[3][2][7][3] = {
+ { // Inactive
+ { // Low offset
+ {256, 2, 256},
+ {256, 207, 256},
+ {256, 189, 256},
+ {256, 179, 256},
+ {256, 174, 256},
+ {256, 163, 256},
+ {256, 157, 256}
+ }, { // High offset
+ {256, 58, 256},
+ {256, 245, 256},
+ {256, 238, 256},
+ {256, 232, 256},
+ {256, 225, 256},
+ {256, 220, 256},
+ {256, 211, 256}
+ }
+ }, { // Unvoiced
+ { // Low offset
+ {256, 1, 256},
+ {256, 210, 256},
+ {256, 190, 256},
+ {256, 178, 256},
+ {256, 169, 256},
+ {256, 162, 256},
+ {256, 152, 256}
+ }, { // High offset
+ {256, 48, 256},
+ {256, 242, 256},
+ {256, 235, 256},
+ {256, 224, 256},
+ {256, 214, 256},
+ {256, 205, 256},
+ {256, 190, 256}
+ }
+ }, { // Voiced
+ { // Low offset
+ {256, 1, 256},
+ {256, 162, 256},
+ {256, 152, 256},
+ {256, 147, 256},
+ {256, 144, 256},
+ {256, 141, 256},
+ {256, 138, 256}
+ }, { // High offset
+ {256, 8, 256},
+ {256, 203, 256},
+ {256, 187, 256},
+ {256, 176, 256},
+ {256, 168, 256},
+ {256, 161, 256},
+ {256, 154, 256}
+ }
+ }
+};
+
+static const int16_t silk_stereo_weights[] = {
+ -13732, -10050, -8266, -7526, -6500, -5000, -2950, -820,
+ 820, 2950, 5000, 6500, 7526, 8266, 10050, 13732
+};
+
+static const uint8_t silk_lsf_s2_model_sel_nbmb[32][10] = {
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 3, 1, 2, 2, 1, 2, 1, 1, 1 },
+ { 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+ { 1, 2, 2, 2, 2, 1, 2, 1, 1, 1 },
+ { 2, 3, 3, 3, 3, 2, 2, 2, 2, 2 },
+ { 0, 5, 3, 3, 2, 2, 2, 2, 1, 1 },
+ { 0, 2, 2, 2, 2, 2, 2, 2, 2, 1 },
+ { 2, 3, 6, 4, 4, 4, 5, 4, 5, 5 },
+ { 2, 4, 5, 5, 4, 5, 4, 6, 4, 4 },
+ { 2, 4, 4, 7, 4, 5, 4, 5, 5, 4 },
+ { 4, 3, 3, 3, 2, 3, 2, 2, 2, 2 },
+ { 1, 5, 5, 6, 4, 5, 4, 5, 5, 5 },
+ { 2, 7, 4, 6, 5, 5, 5, 5, 5, 5 },
+ { 2, 7, 5, 5, 5, 5, 5, 6, 5, 4 },
+ { 3, 3, 5, 4, 4, 5, 4, 5, 4, 4 },
+ { 2, 3, 3, 5, 5, 4, 4, 4, 4, 4 },
+ { 2, 4, 4, 6, 4, 5, 4, 5, 5, 5 },
+ { 2, 5, 4, 6, 5, 5, 5, 4, 5, 4 },
+ { 2, 7, 4, 5, 4, 5, 4, 5, 5, 5 },
+ { 2, 5, 4, 6, 7, 6, 5, 6, 5, 4 },
+ { 3, 6, 7, 4, 6, 5, 5, 6, 4, 5 },
+ { 2, 7, 6, 4, 4, 4, 5, 4, 5, 5 },
+ { 4, 5, 5, 4, 6, 6, 5, 6, 5, 4 },
+ { 2, 5, 5, 6, 5, 6, 4, 6, 4, 4 },
+ { 4, 5, 5, 5, 3, 7, 4, 5, 5, 4 },
+ { 2, 3, 4, 5, 5, 6, 4, 5, 5, 4 },
+ { 2, 3, 2, 3, 3, 4, 2, 3, 3, 3 },
+ { 1, 1, 2, 2, 2, 2, 2, 3, 2, 2 },
+ { 4, 5, 5, 6, 6, 6, 5, 6, 4, 5 },
+ { 3, 5, 5, 4, 4, 4, 4, 3, 3, 2 },
+ { 2, 5, 3, 7, 5, 5, 4, 4, 5, 4 },
+ { 4, 4, 5, 4, 5, 6, 5, 6, 5, 4 }
+};
+
+static const uint8_t silk_lsf_s2_model_sel_wb[32][16] = {
+ { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 },
+ { 10, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, 8, 11 },
+ { 10, 13, 13, 11, 15, 12, 12, 13, 10, 13, 12, 13, 13, 12, 11, 11 },
+ { 8, 10, 9, 10, 10, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 9 },
+ { 8, 14, 13, 12, 14, 12, 15, 13, 12, 12, 12, 13, 13, 12, 12, 11 },
+ { 8, 11, 13, 13, 12, 11, 11, 13, 11, 11, 11, 11, 11, 11, 10, 12 },
+ { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 },
+ { 8, 10, 14, 11, 15, 10, 13, 11, 12, 13, 13, 12, 11, 11, 10, 11 },
+ { 8, 14, 10, 14, 14, 12, 13, 12, 14, 13, 12, 12, 13, 11, 11, 11 },
+ { 10, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 },
+ { 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9 },
+ { 10, 10, 11, 12, 13, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 11 },
+ { 10, 10, 11, 11, 12, 11, 11, 11, 11, 11, 11, 11, 11, 10, 9, 11 },
+ { 11, 12, 12, 12, 14, 12, 12, 13, 11, 13, 12, 12, 13, 12, 11, 12 },
+ { 8, 14, 12, 13, 12, 15, 13, 10, 14, 13, 15, 12, 12, 11, 13, 11 },
+ { 8, 9, 8, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 9, 8 },
+ { 9, 14, 13, 15, 13, 12, 13, 11, 12, 13, 12, 12, 12, 11, 11, 12 },
+ { 9, 11, 11, 12, 12, 11, 11, 13, 10, 11, 11, 13, 13, 13, 11, 12 },
+ { 10, 11, 11, 10, 10, 10, 11, 10, 9, 10, 9, 10, 9, 9, 9, 12 },
+ { 8, 10, 11, 13, 11, 11, 10, 10, 10, 9, 9, 8, 8, 8, 8, 8 },
+ { 11, 12, 11, 13, 11, 11, 10, 10, 9, 9, 9, 9, 9, 10, 10, 12 },
+ { 10, 14, 11, 15, 15, 12, 13, 12, 13, 11, 13, 11, 11, 10, 11, 11 },
+ { 10, 11, 13, 14, 14, 11, 13, 11, 12, 12, 11, 11, 11, 11, 10, 12 },
+ { 9, 11, 11, 12, 12, 12, 12, 11, 13, 13, 13, 11, 9, 9, 9, 9 },
+ { 10, 13, 11, 14, 14, 12, 15, 12, 12, 13, 11, 12, 12, 11, 11, 11 },
+ { 8, 14, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 },
+ { 8, 14, 14, 11, 13, 10, 13, 13, 11, 12, 12, 15, 15, 12, 12, 12 },
+ { 11, 11, 15, 11, 13, 12, 11, 11, 11, 10, 10, 11, 11, 11, 10, 11 },
+ { 8, 8, 9, 8, 8, 8, 10, 9, 10, 9, 9, 10, 10, 10, 9, 9 },
+ { 8, 11, 10, 13, 11, 11, 10, 11, 10, 9, 8, 8, 9, 8, 8, 9 },
+ { 11, 13, 13, 12, 15, 13, 11, 11, 10, 11, 10, 10, 9, 8, 9, 8 },
+ { 10, 11, 13, 11, 12, 11, 11, 11, 10, 9, 10, 14, 12, 8, 8, 8 }
+};
+
+static const uint8_t silk_lsf_pred_weights_nbmb[2][9] = {
+ {179, 138, 140, 148, 151, 149, 153, 151, 163},
+ {116, 67, 82, 59, 92, 72, 100, 89, 92}
+};
+
+static const uint8_t silk_lsf_pred_weights_wb[2][15] = {
+ {175, 148, 160, 176, 178, 173, 174, 164, 177, 174, 196, 182, 198, 192, 182},
+ { 68, 62, 66, 60, 72, 117, 85, 90, 118, 136, 151, 142, 160, 142, 155}
+};
+
+static const uint8_t silk_lsf_weight_sel_nbmb[32][9] = {
+ { 0, 1, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 1, 1, 0, 0, 0, 0, 1, 0 },
+ { 0, 1, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 1, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 0, 1, 1, 0, 0, 0, 1, 0 },
+ { 0, 1, 1, 0, 0, 1, 1, 0, 0 },
+ { 0, 0, 1, 1, 0, 1, 0, 1, 1 },
+ { 0, 0, 1, 1, 0, 0, 1, 1, 1 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 1, 0, 1, 1, 1, 1, 1, 0 },
+ { 0, 1, 0, 1, 1, 1, 1, 1, 0 },
+ { 0, 1, 1, 1, 1, 1, 1, 1, 0 },
+ { 1, 0, 1, 1, 0, 1, 1, 1, 1 },
+ { 0, 1, 1, 1, 1, 1, 0, 1, 0 },
+ { 0, 0, 1, 1, 0, 1, 0, 1, 0 },
+ { 0, 0, 1, 1, 1, 0, 1, 1, 1 },
+ { 0, 1, 1, 0, 0, 1, 1, 1, 0 },
+ { 0, 0, 0, 1, 1, 1, 0, 1, 0 },
+ { 0, 1, 1, 0, 0, 1, 0, 1, 0 },
+ { 0, 1, 1, 0, 0, 0, 1, 1, 0 },
+ { 0, 0, 0, 0, 0, 1, 1, 1, 1 },
+ { 0, 0, 1, 1, 0, 0, 0, 1, 1 },
+ { 0, 0, 0, 1, 0, 1, 1, 1, 1 },
+ { 0, 1, 1, 1, 1, 1, 1, 1, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 1, 0, 1, 1, 0, 1, 0 },
+ { 1, 0, 0, 1, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 1, 1, 0, 1, 0, 1 },
+ { 1, 0, 1, 1, 0, 1, 1, 1, 1 }
+};
+
+static const uint8_t silk_lsf_weight_sel_wb[32][15] = {
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
+ { 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0 },
+ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0 },
+ { 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1 },
+ { 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
+ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0 },
+ { 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0 },
+ { 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0 },
+ { 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1 },
+ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0 },
+ { 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0 },
+ { 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0 },
+ { 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0 },
+ { 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0 },
+ { 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
+ { 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1 },
+ { 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
+ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 },
+ { 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0 }
+};
+
+static const uint8_t silk_lsf_codebook_nbmb[32][10] = {
+ { 12, 35, 60, 83, 108, 132, 157, 180, 206, 228 },
+ { 15, 32, 55, 77, 101, 125, 151, 175, 201, 225 },
+ { 19, 42, 66, 89, 114, 137, 162, 184, 209, 230 },
+ { 12, 25, 50, 72, 97, 120, 147, 172, 200, 223 },
+ { 26, 44, 69, 90, 114, 135, 159, 180, 205, 225 },
+ { 13, 22, 53, 80, 106, 130, 156, 180, 205, 228 },
+ { 15, 25, 44, 64, 90, 115, 142, 168, 196, 222 },
+ { 19, 24, 62, 82, 100, 120, 145, 168, 190, 214 },
+ { 22, 31, 50, 79, 103, 120, 151, 170, 203, 227 },
+ { 21, 29, 45, 65, 106, 124, 150, 171, 196, 224 },
+ { 30, 49, 75, 97, 121, 142, 165, 186, 209, 229 },
+ { 19, 25, 52, 70, 93, 116, 143, 166, 192, 219 },
+ { 26, 34, 62, 75, 97, 118, 145, 167, 194, 217 },
+ { 25, 33, 56, 70, 91, 113, 143, 165, 196, 223 },
+ { 21, 34, 51, 72, 97, 117, 145, 171, 196, 222 },
+ { 20, 29, 50, 67, 90, 117, 144, 168, 197, 221 },
+ { 22, 31, 48, 66, 95, 117, 146, 168, 196, 222 },
+ { 24, 33, 51, 77, 116, 134, 158, 180, 200, 224 },
+ { 21, 28, 70, 87, 106, 124, 149, 170, 194, 217 },
+ { 26, 33, 53, 64, 83, 117, 152, 173, 204, 225 },
+ { 27, 34, 65, 95, 108, 129, 155, 174, 210, 225 },
+ { 20, 26, 72, 99, 113, 131, 154, 176, 200, 219 },
+ { 34, 43, 61, 78, 93, 114, 155, 177, 205, 229 },
+ { 23, 29, 54, 97, 124, 138, 163, 179, 209, 229 },
+ { 30, 38, 56, 89, 118, 129, 158, 178, 200, 231 },
+ { 21, 29, 49, 63, 85, 111, 142, 163, 193, 222 },
+ { 27, 48, 77, 103, 133, 158, 179, 196, 215, 232 },
+ { 29, 47, 74, 99, 124, 151, 176, 198, 220, 237 },
+ { 33, 42, 61, 76, 93, 121, 155, 174, 207, 225 },
+ { 29, 53, 87, 112, 136, 154, 170, 188, 208, 227 },
+ { 24, 30, 52, 84, 131, 150, 166, 186, 203, 229 },
+ { 37, 48, 64, 84, 104, 118, 156, 177, 201, 230 }
+};
+
+static const uint8_t silk_lsf_codebook_wb[32][16] = {
+ { 7, 23, 38, 54, 69, 85, 100, 116, 131, 147, 162, 178, 193, 208, 223, 239 },
+ { 13, 25, 41, 55, 69, 83, 98, 112, 127, 142, 157, 171, 187, 203, 220, 236 },
+ { 15, 21, 34, 51, 61, 78, 92, 106, 126, 136, 152, 167, 185, 205, 225, 240 },
+ { 10, 21, 36, 50, 63, 79, 95, 110, 126, 141, 157, 173, 189, 205, 221, 237 },
+ { 17, 20, 37, 51, 59, 78, 89, 107, 123, 134, 150, 164, 184, 205, 224, 240 },
+ { 10, 15, 32, 51, 67, 81, 96, 112, 129, 142, 158, 173, 189, 204, 220, 236 },
+ { 8, 21, 37, 51, 65, 79, 98, 113, 126, 138, 155, 168, 179, 192, 209, 218 },
+ { 12, 15, 34, 55, 63, 78, 87, 108, 118, 131, 148, 167, 185, 203, 219, 236 },
+ { 16, 19, 32, 36, 56, 79, 91, 108, 118, 136, 154, 171, 186, 204, 220, 237 },
+ { 11, 28, 43, 58, 74, 89, 105, 120, 135, 150, 165, 180, 196, 211, 226, 241 },
+ { 6, 16, 33, 46, 60, 75, 92, 107, 123, 137, 156, 169, 185, 199, 214, 225 },
+ { 11, 19, 30, 44, 57, 74, 89, 105, 121, 135, 152, 169, 186, 202, 218, 234 },
+ { 12, 19, 29, 46, 57, 71, 88, 100, 120, 132, 148, 165, 182, 199, 216, 233 },
+ { 17, 23, 35, 46, 56, 77, 92, 106, 123, 134, 152, 167, 185, 204, 222, 237 },
+ { 14, 17, 45, 53, 63, 75, 89, 107, 115, 132, 151, 171, 188, 206, 221, 240 },
+ { 9, 16, 29, 40, 56, 71, 88, 103, 119, 137, 154, 171, 189, 205, 222, 237 },
+ { 16, 19, 36, 48, 57, 76, 87, 105, 118, 132, 150, 167, 185, 202, 218, 236 },
+ { 12, 17, 29, 54, 71, 81, 94, 104, 126, 136, 149, 164, 182, 201, 221, 237 },
+ { 15, 28, 47, 62, 79, 97, 115, 129, 142, 155, 168, 180, 194, 208, 223, 238 },
+ { 8, 14, 30, 45, 62, 78, 94, 111, 127, 143, 159, 175, 192, 207, 223, 239 },
+ { 17, 30, 49, 62, 79, 92, 107, 119, 132, 145, 160, 174, 190, 204, 220, 235 },
+ { 14, 19, 36, 45, 61, 76, 91, 108, 121, 138, 154, 172, 189, 205, 222, 238 },
+ { 12, 18, 31, 45, 60, 76, 91, 107, 123, 138, 154, 171, 187, 204, 221, 236 },
+ { 13, 17, 31, 43, 53, 70, 83, 103, 114, 131, 149, 167, 185, 203, 220, 237 },
+ { 17, 22, 35, 42, 58, 78, 93, 110, 125, 139, 155, 170, 188, 206, 224, 240 },
+ { 8, 15, 34, 50, 67, 83, 99, 115, 131, 146, 162, 178, 193, 209, 224, 239 },
+ { 13, 16, 41, 66, 73, 86, 95, 111, 128, 137, 150, 163, 183, 206, 225, 241 },
+ { 17, 25, 37, 52, 63, 75, 92, 102, 119, 132, 144, 160, 175, 191, 212, 231 },
+ { 19, 31, 49, 65, 83, 100, 117, 133, 147, 161, 174, 187, 200, 213, 227, 242 },
+ { 18, 31, 52, 68, 88, 103, 117, 126, 138, 149, 163, 177, 192, 207, 223, 239 },
+ { 16, 29, 47, 61, 76, 90, 106, 119, 133, 147, 161, 176, 193, 209, 224, 240 },
+ { 15, 21, 35, 50, 61, 73, 86, 97, 110, 119, 129, 141, 175, 198, 218, 237 }
+};
+
+static const uint16_t silk_lsf_min_spacing_nbmb[] = {
+ 250, 3, 6, 3, 3, 3, 4, 3, 3, 3, 461
+};
+
+static const uint16_t silk_lsf_min_spacing_wb[] = {
+ 100, 3, 40, 3, 3, 3, 5, 14, 14, 10, 11, 3, 8, 9, 7, 3, 347
+};
+
+static const uint8_t silk_lsf_ordering_nbmb[] = {
+ 0, 9, 6, 3, 4, 5, 8, 1, 2, 7
+};
+
+static const uint8_t silk_lsf_ordering_wb[] = {
+ 0, 15, 8, 7, 4, 11, 12, 3, 2, 13, 10, 5, 6, 9, 14, 1
+};
+
+static const int16_t silk_cosine[] = { /* (0.12) */
+ 4096, 4095, 4091, 4085,
+ 4076, 4065, 4052, 4036,
+ 4017, 3997, 3973, 3948,
+ 3920, 3889, 3857, 3822,
+ 3784, 3745, 3703, 3659,
+ 3613, 3564, 3513, 3461,
+ 3406, 3349, 3290, 3229,
+ 3166, 3102, 3035, 2967,
+ 2896, 2824, 2751, 2676,
+ 2599, 2520, 2440, 2359,
+ 2276, 2191, 2106, 2019,
+ 1931, 1842, 1751, 1660,
+ 1568, 1474, 1380, 1285,
+ 1189, 1093, 995, 897,
+ 799, 700, 601, 501,
+ 401, 301, 201, 101,
+ 0, -101, -201, -301,
+ -401, -501, -601, -700,
+ -799, -897, -995, -1093,
+ -1189, -1285, -1380, -1474,
+ -1568, -1660, -1751, -1842,
+ -1931, -2019, -2106, -2191,
+ -2276, -2359, -2440, -2520,
+ -2599, -2676, -2751, -2824,
+ -2896, -2967, -3035, -3102,
+ -3166, -3229, -3290, -3349,
+ -3406, -3461, -3513, -3564,
+ -3613, -3659, -3703, -3745,
+ -3784, -3822, -3857, -3889,
+ -3920, -3948, -3973, -3997,
+ -4017, -4036, -4052, -4065,
+ -4076, -4085, -4091, -4095,
+ -4096
+};
+
+static const uint16_t silk_pitch_scale[] = { 4, 6, 8};
+
+static const uint16_t silk_pitch_min_lag[] = { 16, 24, 32};
+
+static const uint16_t silk_pitch_max_lag[] = {144, 216, 288};
+
+static const int8_t silk_pitch_offset_nb10ms[3][2] = {
+ { 0, 0},
+ { 1, 0},
+ { 0, 1}
+};
+
+static const int8_t silk_pitch_offset_nb20ms[11][4] = {
+ { 0, 0, 0, 0},
+ { 2, 1, 0, -1},
+ {-1, 0, 1, 2},
+ {-1, 0, 0, 1},
+ {-1, 0, 0, 0},
+ { 0, 0, 0, 1},
+ { 0, 0, 1, 1},
+ { 1, 1, 0, 0},
+ { 1, 0, 0, 0},
+ { 0, 0, 0, -1},
+ { 1, 0, 0, -1}
+};
+
+static const int8_t silk_pitch_offset_mbwb10ms[12][2] = {
+ { 0, 0},
+ { 0, 1},
+ { 1, 0},
+ {-1, 1},
+ { 1, -1},
+ {-1, 2},
+ { 2, -1},
+ {-2, 2},
+ { 2, -2},
+ {-2, 3},
+ { 3, -2},
+ {-3, 3}
+};
+
+static const int8_t silk_pitch_offset_mbwb20ms[34][4] = {
+ { 0, 0, 0, 0},
+ { 0, 0, 1, 1},
+ { 1, 1, 0, 0},
+ {-1, 0, 0, 0},
+ { 0, 0, 0, 1},
+ { 1, 0, 0, 0},
+ {-1, 0, 0, 1},
+ { 0, 0, 0, -1},
+ {-1, 0, 1, 2},
+ { 1, 0, 0, -1},
+ {-2, -1, 1, 2},
+ { 2, 1, 0, -1},
+ {-2, 0, 0, 2},
+ {-2, 0, 1, 3},
+ { 2, 1, -1, -2},
+ {-3, -1, 1, 3},
+ { 2, 0, 0, -2},
+ { 3, 1, 0, -2},
+ {-3, -1, 2, 4},
+ {-4, -1, 1, 4},
+ { 3, 1, -1, -3},
+ {-4, -1, 2, 5},
+ { 4, 2, -1, -3},
+ { 4, 1, -1, -4},
+ {-5, -1, 2, 6},
+ { 5, 2, -1, -4},
+ {-6, -2, 2, 6},
+ {-5, -2, 2, 5},
+ { 6, 2, -1, -5},
+ {-7, -2, 3, 8},
+ { 6, 2, -2, -6},
+ { 5, 2, -2, -5},
+ { 8, 3, -2, -7},
+ {-9, -3, 3, 9}
+};
+
+static const int8_t silk_ltp_filter0_taps[8][5] = {
+ { 4, 6, 24, 7, 5},
+ { 0, 0, 2, 0, 0},
+ { 12, 28, 41, 13, -4},
+ { -9, 15, 42, 25, 14},
+ { 1, -2, 62, 41, -9},
+ {-10, 37, 65, -4, 3},
+ { -6, 4, 66, 7, -8},
+ { 16, 14, 38, -3, 33}
+};
+
+static const int8_t silk_ltp_filter1_taps[16][5] = {
+ { 13, 22, 39, 23, 12},
+ { -1, 36, 64, 27, -6},
+ { -7, 10, 55, 43, 17},
+ { 1, 1, 8, 1, 1},
+ { 6, -11, 74, 53, -9},
+ {-12, 55, 76, -12, 8},
+ { -3, 3, 93, 27, -4},
+ { 26, 39, 59, 3, -8},
+ { 2, 0, 77, 11, 9},
+ { -8, 22, 44, -6, 7},
+ { 40, 9, 26, 3, 9},
+ { -7, 20, 101, -7, 4},
+ { 3, -8, 42, 26, 0},
+ {-15, 33, 68, 2, 23},
+ { -2, 55, 46, -2, 15},
+ { 3, -1, 21, 16, 41}
+};
+
+static const int8_t silk_ltp_filter2_taps[32][5] = {
+ { -6, 27, 61, 39, 5},
+ {-11, 42, 88, 4, 1},
+ { -2, 60, 65, 6, -4},
+ { -1, -5, 73, 56, 1},
+ { -9, 19, 94, 29, -9},
+ { 0, 12, 99, 6, 4},
+ { 8, -19, 102, 46, -13},
+ { 3, 2, 13, 3, 2},
+ { 9, -21, 84, 72, -18},
+ {-11, 46, 104, -22, 8},
+ { 18, 38, 48, 23, 0},
+ {-16, 70, 83, -21, 11},
+ { 5, -11, 117, 22, -8},
+ { -6, 23, 117, -12, 3},
+ { 3, -8, 95, 28, 4},
+ {-10, 15, 77, 60, -15},
+ { -1, 4, 124, 2, -4},
+ { 3, 38, 84, 24, -25},
+ { 2, 13, 42, 13, 31},
+ { 21, -4, 56, 46, -1},
+ { -1, 35, 79, -13, 19},
+ { -7, 65, 88, -9, -14},
+ { 20, 4, 81, 49, -29},
+ { 20, 0, 75, 3, -17},
+ { 5, -9, 44, 92, -8},
+ { 1, -3, 22, 69, 31},
+ { -6, 95, 41, -12, 5},
+ { 39, 67, 16, -4, 1},
+ { 0, -6, 120, 55, -36},
+ {-13, 44, 122, 4, -24},
+ { 81, 5, 11, 3, 7},
+ { 2, 0, 9, 10, 88}
+};
+
+static const uint16_t silk_ltp_scale_factor[] = {15565, 12288, 8192};
+
+static const uint8_t silk_shell_blocks[3][2] = {
+ { 5, 10}, // NB
+ { 8, 15}, // MB
+ {10, 20} // WB
+};
+
+static const uint8_t silk_quant_offset[2][2] = { /* (0.23) */
+ {25, 60}, // Inactive or Unvoiced
+ { 8, 25} // Voiced
+};
+
+static const int silk_stereo_interp_len[3] = {
+ 64, 96, 128
+};
+
+static inline void silk_stabilize_lsf(int16_t nlsf[16], int order, const uint16_t min_delta[17])
+{
+ int pass, i;
+ for (pass = 0; pass < 20; pass++) {
+ int k, min_diff = 0;
+ for (i = 0; i < order+1; i++) {
+ int low = i != 0 ? nlsf[i-1] : 0;
+ int high = i != order ? nlsf[i] : 32768;
+ int diff = (high - low) - (min_delta[i]);
+
+ if (diff < min_diff) {
+ min_diff = diff;
+ k = i;
+
+ if (pass == 20)
+ break;
+ }
+ }
+ if (min_diff == 0) /* no issues; stabilized */
+ return;
+
+ /* wiggle one or two LSFs */
+ if (k == 0) {
+ /* repel away from lower bound */
+ nlsf[0] = min_delta[0];
+ } else if (k == order) {
+ /* repel away from higher bound */
+ nlsf[order-1] = 32768 - min_delta[order];
+ } else {
+ /* repel away from current position */
+ int min_center = 0, max_center = 32768, center_val;
+
+ /* lower extent */
+ for (i = 0; i < k; i++)
+ min_center += min_delta[i];
+ min_center += min_delta[k] >> 1;
+
+ /* upper extent */
+ for (i = order; i > k; i--)
+ max_center -= min_delta[k];
+ max_center -= min_delta[k] >> 1;
+
+ /* move apart */
+ center_val = nlsf[k - 1] + nlsf[k];
+ center_val = (center_val >> 1) + (center_val & 1); // rounded divide by 2
+ center_val = FFMIN(max_center, FFMAX(min_center, center_val));
+
+ nlsf[k - 1] = center_val - (min_delta[k] >> 1);
+ nlsf[k] = nlsf[k - 1] + min_delta[k];
+ }
+ }
+
+ /* resort to the fall-back method, the standard method for LSF stabilization */
+
+ /* sort; as the LSFs should be nearly sorted, use insertion sort */
+ for (i = 1; i < order; i++) {
+ int j, value = nlsf[i];
+ for (j = i - 1; j >= 0 && nlsf[j] > value; j--)
+ nlsf[j + 1] = nlsf[j];
+ nlsf[j + 1] = value;
+ }
+
+ /* push forwards to increase distance */
+ if (nlsf[0] < min_delta[0])
+ nlsf[0] = min_delta[0];
+ for (i = 1; i < order; i++)
+ if (nlsf[i] < nlsf[i - 1] + min_delta[i])
+ nlsf[i] = nlsf[i - 1] + min_delta[i];
+
+ /* push backwards to increase distance */
+ if (nlsf[order-1] > 32768 - min_delta[order])
+ nlsf[order-1] = 32768 - min_delta[order];
+ for (i = order-2; i >= 0; i--)
+ if (nlsf[i] > nlsf[i + 1] - min_delta[i+1])
+ nlsf[i] = nlsf[i + 1] - min_delta[i+1];
+
+ return;
+}
+
+static inline int silk_is_lpc_stable(const int16_t lpc[16], int order)
+{
+ int k, j, DC_resp = 0;
+ int32_t lpc32[2][16]; // Q24
+ int totalinvgain = 1 << 30; // 1.0 in Q30
+ int32_t *row = lpc32[0], *prevrow;
+
+ /* initialize the first row for the Levinson recursion */
+ for (k = 0; k < order; k++) {
+ DC_resp += lpc[k];
+ row[k] = lpc[k] * 4096;
+ }
+
+ if (DC_resp >= 4096)
+ return 0;
+
+ /* check if prediction gain pushes any coefficients too far */
+ for (k = order - 1; 1; k--) {
+ int rc; // Q31; reflection coefficient
+ int gaindiv; // Q30; inverse of the gain (the divisor)
+ int gain; // gain for this reflection coefficient
+ int fbits; // fractional bits used for the gain
+ int error; // Q29; estimate of the error of our partial estimate of 1/gaindiv
+
+ if (FFABS(row[k]) > 16773022)
+ return 0;
+
+ rc = -(row[k] * 128);
+ gaindiv = (1 << 30) - MULH(rc, rc);
+
+ totalinvgain = MULH(totalinvgain, gaindiv) << 2;
+ if (k == 0)
+ return (totalinvgain >= 107374);
+
+ /* approximate 1.0/gaindiv */
+ fbits = opus_ilog(gaindiv);
+ gain = ((1 << 29) - 1) / (gaindiv >> (fbits + 1 - 16)); // Q<fbits-16>
+ error = (1 << 29) - MULL(gaindiv << (15 + 16 - fbits), gain, 16);
+ gain = ((gain << 16) + (error * gain >> 13));
+
+ /* switch to the next row of the LPC coefficients */
+ prevrow = row;
+ row = lpc32[k & 1];
+
+ for (j = 0; j < k; j++) {
+ int x = prevrow[j] - ROUND_MULL(prevrow[k - j - 1], rc, 31);
+ row[j] = ROUND_MULL(x, gain, fbits);
+ }
+ }
+}
+
+static void silk_lsp2poly(const int32_t lsp[16], int32_t pol[16], int half_order)
+{
+ int i, j;
+
+ pol[0] = 65536; // 1.0 in Q16
+ pol[1] = -lsp[0];
+
+ for (i = 1; i < half_order; i++) {
+ pol[i + 1] = pol[i - 1] * 2 - ROUND_MULL(lsp[2 * i], pol[i], 16);
+ for (j = i; j > 1; j--)
+ pol[j] += pol[j - 2] - ROUND_MULL(lsp[2 * i], pol[j - 1], 16);
+
+ pol[1] -= lsp[2 * i];
+ }
+}
+
+static void silk_lsf2lpc(const int16_t nlsf[16], float lpcf[16], int order)
+{
+ int i, k;
+ int32_t lsp[16]; // Q17; 2*cos(LSF)
+ int32_t p[9], q[9]; // Q16
+ int32_t lpc32[16]; // Q17
+ int16_t lpc[16]; // Q12
+
+ /* convert the LSFs to LSPs, i.e. 2*cos(LSF) */
+ for (k = 0; k < order; k++) {
+ int index = nlsf[k] >> 8;
+ int offset = nlsf[k] & 255;
+ int k2 = (order == 10) ? silk_lsf_ordering_nbmb[k] : silk_lsf_ordering_wb[k];
+
+ /* interpolate and round */
+ lsp[k2] = silk_cosine[index] * 256;
+ lsp[k2] += (silk_cosine[index + 1] - silk_cosine[index]) * offset;
+ lsp[k2] = (lsp[k2] + 4) >> 3;
+ }
+
+ silk_lsp2poly(lsp , p, order >> 1);
+ silk_lsp2poly(lsp + 1, q, order >> 1);
+
+ /* reconstruct A(z) */
+ for (k = 0; k < order>>1; k++) {
+ lpc32[k] = -p[k + 1] - p[k] - q[k + 1] + q[k];
+ lpc32[order-k-1] = -p[k + 1] - p[k] + q[k + 1] - q[k];
+ }
+
+ /* limit the range of the LPC coefficients to each fit within an int16_t */
+ for (i = 0; i < 10; i++) {
+ int j;
+ unsigned int maxabs = 0;
+ for (j = 0, k = 0; j < order; j++) {
+ unsigned int x = FFABS(lpc32[k]);
+ if (x > maxabs) {
+ maxabs = x; // Q17
+ k = j;
+ }
+ }
+
+ maxabs = (maxabs + 16) >> 5; // convert to Q12
+
+ if (maxabs > 32767) {
+ /* perform bandwidth expansion */
+ unsigned int chirp, chirp_base; // Q16
+ maxabs = FFMIN(maxabs, 163838); // anything above this overflows chirp's numerator
+ chirp_base = chirp = 65470 - ((maxabs - 32767) << 14) / ((maxabs * (k+1)) >> 2);
+
+ for (k = 0; k < order; k++) {
+ lpc32[k] = ROUND_MULL(lpc32[k], chirp, 16);
+ chirp = (chirp_base * chirp + 32768) >> 16;
+ }
+ } else break;
+ }
+
+ if (i == 10) {
+ /* time's up: just clamp */
+ for (k = 0; k < order; k++) {
+ int x = (lpc32[k] + 16) >> 5;
+ lpc[k] = av_clip_int16(x);
+ lpc32[k] = lpc[k] << 5; // shortcut mandated by the spec; drops lower 5 bits
+ }
+ } else {
+ for (k = 0; k < order; k++)
+ lpc[k] = (lpc32[k] + 16) >> 5;
+ }
+
+ /* if the prediction gain causes the LPC filter to become unstable,
+ apply further bandwidth expansion on the Q17 coefficients */
+ for (i = 1; i <= 16 && !silk_is_lpc_stable(lpc, order); i++) {
+ unsigned int chirp, chirp_base;
+ chirp_base = chirp = 65536 - (1 << i);
+
+ for (k = 0; k < order; k++) {
+ lpc32[k] = ROUND_MULL(lpc32[k], chirp, 16);
+ lpc[k] = (lpc32[k] + 16) >> 5;
+ chirp = (chirp_base * chirp + 32768) >> 16;
+ }
+ }
+
+ for (i = 0; i < order; i++)
+ lpcf[i] = lpc[i] / 4096.0f;
+}
+
+static inline void silk_decode_lpc(SilkContext *s, SilkFrame *frame,
+ OpusRangeCoder *rc,
+ float lpc_leadin[16], float lpc[16],
+ int *lpc_order, int *has_lpc_leadin, int voiced)
+{
+ int i;
+ int order; // order of the LP polynomial; 10 for NB/MB and 16 for WB
+ int8_t lsf_i1, lsf_i2[16]; // stage-1 and stage-2 codebook indices
+ int16_t lsf_res[16]; // residual as a Q10 value
+ int16_t nlsf[16]; // Q15
+
+ *lpc_order = order = s->wb ? 16 : 10;
+
+ /* obtain LSF stage-1 and stage-2 indices */
+ lsf_i1 = opus_rc_getsymbol(rc, silk_model_lsf_s1[s->wb][voiced]);
+ for (i = 0; i < order; i++) {
+ int index = s->wb ? silk_lsf_s2_model_sel_wb [lsf_i1][i] :
+ silk_lsf_s2_model_sel_nbmb[lsf_i1][i];
+ lsf_i2[i] = opus_rc_getsymbol(rc, silk_model_lsf_s2[index]) - 4;
+ if (lsf_i2[i] == -4)
+ lsf_i2[i] -= opus_rc_getsymbol(rc, silk_model_lsf_s2_ext);
+ else if (lsf_i2[i] == 4)
+ lsf_i2[i] += opus_rc_getsymbol(rc, silk_model_lsf_s2_ext);
+ }
+
+ /* reverse the backwards-prediction step */
+ for (i = order - 1; i >= 0; i--) {
+ int qstep = s->wb ? 9830 : 11796;
+
+ lsf_res[i] = lsf_i2[i] * 1024;
+ if (lsf_i2[i] < 0) lsf_res[i] += 102;
+ else if (lsf_i2[i] > 0) lsf_res[i] -= 102;
+ lsf_res[i] = (lsf_res[i] * qstep) >> 16;
+
+ if (i + 1 < order) {
+ int weight = s->wb ? silk_lsf_pred_weights_wb [silk_lsf_weight_sel_wb [lsf_i1][i]][i] :
+ silk_lsf_pred_weights_nbmb[silk_lsf_weight_sel_nbmb[lsf_i1][i]][i];
+ lsf_res[i] += (lsf_res[i+1] * weight) >> 8;
+ }
+ }
+
+ /* reconstruct the NLSF coefficients from the supplied indices */
+ for (i = 0; i < order; i++) {
+ const uint8_t * codebook = s->wb ? silk_lsf_codebook_wb [lsf_i1] :
+ silk_lsf_codebook_nbmb[lsf_i1];
+ int cur, prev, next, weight_sq, weight, ipart, fpart, y, value;
+
+ /* find the weight of the residual */
+ /* TODO: precompute */
+ cur = codebook[i];
+ prev = i ? codebook[i - 1] : 0;
+ next = i + 1 < order ? codebook[i + 1] : 256;
+ weight_sq = (1024 / (cur - prev) + 1024 / (next - cur)) << 16;
+
+ /* approximate square-root with mandated fixed-point arithmetic */
+ ipart = opus_ilog(weight_sq);
+ fpart = (weight_sq >> (ipart-8)) & 127;
+ y = ((ipart & 1) ? 32768 : 46214) >> ((32 - ipart)>>1);
+ weight = y + ((213 * fpart * y) >> 16);
+
+ value = cur * 128 + (lsf_res[i] * 16384) / weight;
+ nlsf[i] = av_clip(value, 0, 32767);
+ }
+
+ /* stabilize the NLSF coefficients */
+ silk_stabilize_lsf(nlsf, order, s->wb ? silk_lsf_min_spacing_wb :
+ silk_lsf_min_spacing_nbmb);
+
+ /* produce an interpolation for the first 2 subframes, */
+ /* and then convert both sets of NLSFs to LPC coefficients */
+ *has_lpc_leadin = 0;
+ if (s->subframes == 4) {
+ int offset = opus_rc_getsymbol(rc, silk_model_lsf_interpolation_offset);
+ if (offset != 4 && frame->coded) {
+ *has_lpc_leadin = 1;
+ if (offset != 0) {
+ int16_t nlsf_leadin[16];
+ for (i = 0; i < order; i++)
+ nlsf_leadin[i] = frame->nlsf[i] +
+ ((nlsf[i] - frame->nlsf[i]) * offset >> 2);
+ silk_lsf2lpc(nlsf_leadin, lpc_leadin, order);
+ } else /* avoid re-computation for a (roughly) 1-in-4 occurrence */
+ memcpy(lpc_leadin, frame->lpc, 16 * sizeof(float));
+ } else
+ offset = 4;
+ s->nlsf_interp_factor = offset;
+
+ silk_lsf2lpc(nlsf, lpc, order);
+ } else {
+ s->nlsf_interp_factor = 4;
+ silk_lsf2lpc(nlsf, lpc, order);
+ }
+
+ memcpy(frame->nlsf, nlsf, order * sizeof(nlsf[0]));
+ memcpy(frame->lpc, lpc, order * sizeof(lpc[0]));
+}
+
+static inline void silk_count_children(OpusRangeCoder *rc, int model, int32_t total,
+ int32_t child[2])
+{
+ if (total != 0) {
+ child[0] = opus_rc_getsymbol(rc,
+ silk_model_pulse_location[model] + (((total - 1 + 5) * (total - 1)) >> 1));
+ child[1] = total - child[0];
+ } else {
+ child[0] = 0;
+ child[1] = 0;
+ }
+}
+
+static inline void silk_decode_excitation(SilkContext *s, OpusRangeCoder *rc,
+ float* excitationf,
+ int qoffset_high, int active, int voiced)
+{
+ int i;
+ uint32_t seed;
+ int shellblocks;
+ int ratelevel;
+ uint8_t pulsecount[20]; // total pulses in each shell block
+ uint8_t lsbcount[20] = {0}; // raw lsbits defined for each pulse in each shell block
+ int32_t excitation[320]; // Q23
+
+ /* excitation parameters */
+ seed = opus_rc_getsymbol(rc, silk_model_lcg_seed);
+ shellblocks = silk_shell_blocks[s->bandwidth][s->subframes >> 2];
+ ratelevel = opus_rc_getsymbol(rc, silk_model_exc_rate[voiced]);
+
+ for (i = 0; i < shellblocks; i++) {
+ pulsecount[i] = opus_rc_getsymbol(rc, silk_model_pulse_count[ratelevel]);
+ if (pulsecount[i] == 17) {
+ while (pulsecount[i] == 17 && ++lsbcount[i] != 10)
+ pulsecount[i] = opus_rc_getsymbol(rc, silk_model_pulse_count[9]);
+ if (lsbcount[i] == 10)
+ pulsecount[i] = opus_rc_getsymbol(rc, silk_model_pulse_count[10]);
+ }
+ }
+
+ /* decode pulse locations using PVQ */
+ for (i = 0; i < shellblocks; i++) {
+ if (pulsecount[i] != 0) {
+ int a, b, c, d;
+ int32_t * location = excitation + 16*i;
+ int32_t branch[4][2];
+ branch[0][0] = pulsecount[i];
+
+ /* unrolled tail recursion */
+ for (a = 0; a < 1; a++) {
+ silk_count_children(rc, 0, branch[0][a], branch[1]);
+ for (b = 0; b < 2; b++) {
+ silk_count_children(rc, 1, branch[1][b], branch[2]);
+ for (c = 0; c < 2; c++) {
+ silk_count_children(rc, 2, branch[2][c], branch[3]);
+ for (d = 0; d < 2; d++) {
+ silk_count_children(rc, 3, branch[3][d], location);
+ location += 2;
+ }
+ }
+ }
+ }
+ } else
+ memset(excitation + 16*i, 0, 16*sizeof(int32_t));
+ }
+
+ /* decode least significant bits */
+ for (i = 0; i < shellblocks << 4; i++) {
+ int bit;
+ for (bit = 0; bit < lsbcount[i >> 4]; bit++)
+ excitation[i] = (excitation[i] << 1) |
+ opus_rc_getsymbol(rc, silk_model_excitation_lsb);
+ }
+
+ /* decode signs */
+ for (i = 0; i < shellblocks << 4; i++) {
+ if (excitation[i] != 0) {
+ int sign = opus_rc_getsymbol(rc, silk_model_excitation_sign[active +
+ voiced][qoffset_high][FFMIN(pulsecount[i >> 4], 6)]);
+ if (sign == 0)
+ excitation[i] *= -1;
+ }
+ }
+
+ /* assemble the excitation */
+ for (i = 0; i < shellblocks << 4; i++) {
+ int value = excitation[i];
+ excitation[i] = value * 256 | silk_quant_offset[voiced][qoffset_high];
+ if (value < 0) excitation[i] += 20;
+ else if (value > 0) excitation[i] -= 20;
+
+ /* invert samples pseudorandomly */
+ seed = 196314165 * seed + 907633515;
+ if (seed & 0x80000000)
+ excitation[i] *= -1;
+ seed += value;
+
+ excitationf[i] = excitation[i] / 8388608.0f;
+ }
+}
+
+/** Maximum residual history according to 4.2.7.6.1 */
+#define SILK_MAX_LAG (288 + LTP_ORDER / 2)
+
+/** Order of the LTP filter */
+#define LTP_ORDER 5
+
+static void silk_decode_frame(SilkContext *s, OpusRangeCoder *rc,
+ int frame_num, int channel, int coded_channels, int active, int active1)
+{
+ /* per frame */
+ int voiced; // combines with active to indicate inactive, active, or active+voiced
+ int qoffset_high;
+ int order; // order of the LPC coefficients
+ float lpc_leadin[16], lpc_body[16], residual[SILK_MAX_LAG + SILK_HISTORY];
+ int has_lpc_leadin;
+ float ltpscale;
+
+ /* per subframe */
+ struct {
+ float gain;
+ int pitchlag;
+ float ltptaps[5];
+ } sf[4];
+
+ SilkFrame * const frame = s->frame + channel;
+
+ int i;
+
+ /* obtain stereo weights */
+ if (coded_channels == 2 && channel == 0) {
+ int n, wi[2], ws[2], w[2];
+ n = opus_rc_getsymbol(rc, silk_model_stereo_s1);
+ wi[0] = opus_rc_getsymbol(rc, silk_model_stereo_s2) + 3 * (n / 5);
+ ws[0] = opus_rc_getsymbol(rc, silk_model_stereo_s3);
+ wi[1] = opus_rc_getsymbol(rc, silk_model_stereo_s2) + 3 * (n % 5);
+ ws[1] = opus_rc_getsymbol(rc, silk_model_stereo_s3);
+
+ for (i = 0; i < 2; i++)
+ w[i] = silk_stereo_weights[wi[i]] +
+ (((silk_stereo_weights[wi[i] + 1] - silk_stereo_weights[wi[i]]) * 6554) >> 16)
+ * (ws[i]*2 + 1);
+
+ s->stereo_weights[0] = (w[0] - w[1]) / 8192.0;
+ s->stereo_weights[1] = w[1] / 8192.0;
+
+ /* and read the mid-only flag */
+ s->midonly = active1 ? 0 : opus_rc_getsymbol(rc, silk_model_mid_only);
+ }
+
+ /* obtain frame type */
+ if (!active) {
+ qoffset_high = opus_rc_getsymbol(rc, silk_model_frame_type_inactive);
+ voiced = 0;
+ } else {
+ int type = opus_rc_getsymbol(rc, silk_model_frame_type_active);
+ qoffset_high = type & 1;
+ voiced = type >> 1;
+ }
+
+ /* obtain subframe quantization gains */
+ for (i = 0; i < s->subframes; i++) {
+ int log_gain; //Q7
+ int ipart, fpart, lingain;
+
+ if (i == 0 && (frame_num == 0 || !frame->coded)) {
+ /* gain is coded absolute */
+ int x = opus_rc_getsymbol(rc, silk_model_gain_highbits[active + voiced]);
+ log_gain = (x<<3) | opus_rc_getsymbol(rc, silk_model_gain_lowbits);
+
+ if (frame->coded)
+ log_gain = FFMAX(log_gain, frame->log_gain - 16);
+ } else {
+ /* gain is coded relative */
+ int delta_gain = opus_rc_getsymbol(rc, silk_model_gain_delta);
+ log_gain = av_clip(FFMAX((delta_gain<<1) - 16,
+ frame->log_gain + delta_gain - 4), 0, 63);
+ }
+
+ frame->log_gain = log_gain;
+
+ /* approximate 2**(x/128) with a Q7 (i.e. non-integer) input */
+ log_gain = (log_gain * 0x1D1C71 >> 16) + 2090;
+ ipart = log_gain >> 7;
+ fpart = log_gain & 127;
+ lingain = (1 << ipart) + ((-174 * fpart * (128-fpart) >>16) + fpart) * ((1<<ipart) >> 7);
+ sf[i].gain = lingain / 65536.0f;
+ }
+
+ /* obtain LPC filter coefficients */
+ silk_decode_lpc(s, frame, rc, lpc_leadin, lpc_body, &order, &has_lpc_leadin, voiced);
+
+ /* obtain pitch lags, if this is a voiced frame */
+ if (voiced) {
+ int lag_absolute = (!frame_num || !frame->prev_voiced);
+ int primarylag; // primary pitch lag for the entire SILK frame
+ int ltpfilter;
+ const int8_t * offsets;
+
+ if (!lag_absolute) {
+ int delta = opus_rc_getsymbol(rc, silk_model_pitch_delta);
+ if (delta)
+ primarylag = frame->primarylag + delta - 9;
+ else
+ lag_absolute = 1;
+ }
+
+ if (lag_absolute) {
+ /* primary lag is coded absolute */
+ int highbits, lowbits;
+ const uint16_t *model[] = {
+ silk_model_pitch_lowbits_nb, silk_model_pitch_lowbits_mb,
+ silk_model_pitch_lowbits_wb
+ };
+ highbits = opus_rc_getsymbol(rc, silk_model_pitch_highbits);
+ lowbits = opus_rc_getsymbol(rc, model[s->bandwidth]);
+
+ primarylag = silk_pitch_min_lag[s->bandwidth] +
+ highbits*silk_pitch_scale[s->bandwidth] + lowbits;
+ }
+ frame->primarylag = primarylag;
+
+ if (s->subframes == 2)
+ offsets = (s->bandwidth == OPUS_BANDWIDTH_NARROWBAND)
+ ? silk_pitch_offset_nb10ms[opus_rc_getsymbol(rc,
+ silk_model_pitch_contour_nb10ms)]
+ : silk_pitch_offset_mbwb10ms[opus_rc_getsymbol(rc,
+ silk_model_pitch_contour_mbwb10ms)];
+ else
+ offsets = (s->bandwidth == OPUS_BANDWIDTH_NARROWBAND)
+ ? silk_pitch_offset_nb20ms[opus_rc_getsymbol(rc,
+ silk_model_pitch_contour_nb20ms)]
+ : silk_pitch_offset_mbwb20ms[opus_rc_getsymbol(rc,
+ silk_model_pitch_contour_mbwb20ms)];
+
+ for (i = 0; i < s->subframes; i++)
+ sf[i].pitchlag = av_clip(primarylag + offsets[i],
+ silk_pitch_min_lag[s->bandwidth],
+ silk_pitch_max_lag[s->bandwidth]);
+
+ /* obtain LTP filter coefficients */
+ ltpfilter = opus_rc_getsymbol(rc, silk_model_ltp_filter);
+ for (i = 0; i < s->subframes; i++) {
+ int index, j;
+ const uint16_t *filter_sel[] = {
+ silk_model_ltp_filter0_sel, silk_model_ltp_filter1_sel,
+ silk_model_ltp_filter2_sel
+ };
+ const int8_t (*filter_taps[])[5] = {
+ silk_ltp_filter0_taps, silk_ltp_filter1_taps, silk_ltp_filter2_taps
+ };
+ index = opus_rc_getsymbol(rc, filter_sel[ltpfilter]);
+ for (j = 0; j < 5; j++)
+ sf[i].ltptaps[j] = filter_taps[ltpfilter][index][j] / 128.0f;
+ }
+ }
+
+ /* obtain LTP scale factor */
+ if (voiced && frame_num == 0)
+ ltpscale = silk_ltp_scale_factor[opus_rc_getsymbol(rc,
+ silk_model_ltp_scale_index)] / 16384.0f;
+ else ltpscale = 15565.0f/16384.0f;
+
+ /* generate the excitation signal for the entire frame */
+ silk_decode_excitation(s, rc, residual + SILK_MAX_LAG, qoffset_high,
+ active, voiced);
+
+ /* skip synthesising the side channel if we want mono-only */
+ if (s->output_channels == channel)
+ return;
+
+ /* generate the output signal */
+ for (i = 0; i < s->subframes; i++) {
+ const float * lpc_coeff = (i < 2 && has_lpc_leadin) ? lpc_leadin : lpc_body;
+ float *dst = frame->output + SILK_HISTORY + i * s->sflength;
+ float *resptr = residual + SILK_MAX_LAG + i * s->sflength;
+ float *lpc = frame->lpc_history + SILK_HISTORY + i * s->sflength;
+ float sum;
+ int j, k;
+
+ if (voiced) {
+ int out_end;
+ float scale;
+
+ if (i < 2 || s->nlsf_interp_factor == 4) {
+ out_end = -i * s->sflength;
+ scale = ltpscale;
+ } else {
+ out_end = -(i - 2) * s->sflength;
+ scale = 1.0f;
+ }
+
+ /* when the LPC coefficients change, a re-whitening filter is used */
+ /* to produce a residual that accounts for the change */
+ for (j = - sf[i].pitchlag - LTP_ORDER/2; j < out_end; j++) {
+ sum = dst[j];
+ for (k = 0; k < order; k++)
+ sum -= lpc_coeff[k] * dst[j - k - 1];
+ resptr[j] = av_clipf(sum, -1.0f, 1.0f) * scale / sf[i].gain;
+ }
+
+ if (out_end) {
+ float rescale = sf[i-1].gain / sf[i].gain;
+ for (j = out_end; j < 0; j++)
+ resptr[j] *= rescale;
+ }
+
+ /* LTP synthesis */
+ for (j = 0; j < s->sflength; j++) {
+ sum = resptr[j];
+ for (k = 0; k < LTP_ORDER; k++)
+ sum += sf[i].ltptaps[k] * resptr[j - sf[i].pitchlag + LTP_ORDER/2 - k];
+ resptr[j] = sum;
+ }
+ }
+
+ /* LPC synthesis */
+ for (j = 0; j < s->sflength; j++) {
+ sum = resptr[j] * sf[i].gain;
+ for (k = 1; k <= order; k++)
+ sum += lpc_coeff[k - 1] * lpc[j - k];
+
+ lpc[j] = sum;
+ dst[j] = av_clipf(sum, -1.0f, 1.0f);
+ }
+ }
+
+ frame->prev_voiced = voiced;
+ memmove(frame->lpc_history, frame->lpc_history + s->flength, SILK_HISTORY * sizeof(float));
+ memmove(frame->output, frame->output + s->flength, SILK_HISTORY * sizeof(float));
+
+ frame->coded = 1;
+}
+
+static void silk_unmix_ms(SilkContext *s, float *l, float *r)
+{
+ float *mid = s->frame[0].output + SILK_HISTORY - s->flength;
+ float *side = s->frame[1].output + SILK_HISTORY - s->flength;
+ float w0_prev = s->prev_stereo_weights[0];
+ float w1_prev = s->prev_stereo_weights[1];
+ float w0 = s->stereo_weights[0];
+ float w1 = s->stereo_weights[1];
+ int n1 = silk_stereo_interp_len[s->bandwidth];
+ int i;
+
+ for (i = 0; i < n1; i++) {
+ float interp0 = w0_prev + i * (w0 - w0_prev) / n1;
+ float interp1 = w1_prev + i * (w1 - w1_prev) / n1;
+ float p0 = 0.25 * (mid[i - 2] + 2 * mid[i - 1] + mid[i]);
+
+ l[i] = av_clipf((1 + interp1) * mid[i - 1] + side[i - 1] + interp0 * p0, -1.0, 1.0);
+ r[i] = av_clipf((1 - interp1) * mid[i - 1] - side[i - 1] - interp0 * p0, -1.0, 1.0);
+ }
+
+ for (; i < s->flength; i++) {
+ float p0 = 0.25 * (mid[i - 2] + 2 * mid[i - 1] + mid[i]);
+
+ l[i] = av_clipf((1 + w1) * mid[i - 1] + side[i - 1] + w0 * p0, -1.0, 1.0);
+ r[i] = av_clipf((1 - w1) * mid[i - 1] - side[i - 1] - w0 * p0, -1.0, 1.0);
+ }
+
+ memcpy(s->prev_stereo_weights, s->stereo_weights, sizeof(s->stereo_weights));
+}
+
+static void silk_flush_frame(SilkFrame *frame)
+{
+ if (!frame->coded)
+ return;
+
+ memset(frame->output, 0, sizeof(frame->output));
+ memset(frame->lpc_history, 0, sizeof(frame->lpc_history));
+
+ memset(frame->lpc, 0, sizeof(frame->lpc));
+ memset(frame->nlsf, 0, sizeof(frame->nlsf));
+
+ frame->log_gain = 0;
+
+ frame->primarylag = 0;
+ frame->prev_voiced = 0;
+ frame->coded = 0;
+}
+
+int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc,
+ float *output[2],
+ enum OpusBandwidth bandwidth,
+ int coded_channels,
+ int duration_ms)
+{
+ int active[2][6], redundancy[2];
+ int nb_frames, i, j;
+
+ if (bandwidth > OPUS_BANDWIDTH_WIDEBAND ||
+ coded_channels > 2 || duration_ms > 60) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid parameters passed "
+ "to the SILK decoder.\n");
+ return AVERROR(EINVAL);
+ }
+
+ nb_frames = 1 + (duration_ms > 20) + (duration_ms > 40);
+ s->subframes = duration_ms / nb_frames / 5; // 5ms subframes
+ s->sflength = 20 * (bandwidth + 2);
+ s->flength = s->sflength * s->subframes;
+ s->bandwidth = bandwidth;
+ s->wb = bandwidth == OPUS_BANDWIDTH_WIDEBAND;
+
+ /* make sure to flush the side channel when switching from mono to stereo */
+ if (coded_channels > s->prev_coded_channels)
+ silk_flush_frame(&s->frame[1]);
+ s->prev_coded_channels = coded_channels;
+
+ /* read the LP-layer header bits */
+ for (i = 0; i < coded_channels; i++) {
+ for (j = 0; j < nb_frames; j++)
+ active[i][j] = opus_rc_p2model(rc, 1);
+
+ redundancy[i] = opus_rc_p2model(rc, 1);
+ if (redundancy[i]) {
+ av_log(s->avctx, AV_LOG_ERROR, "LBRR frames present; this is unsupported\n");
+ return AVERROR_PATCHWELCOME;
+ }
+ }
+
+ for (i = 0; i < nb_frames; i++) {
+ for (j = 0; j < coded_channels && !s->midonly; j++)
+ silk_decode_frame(s, rc, i, j, coded_channels, active[j][i], active[1][i]);
+
+ /* reset the side channel if it is not coded */
+ if (s->midonly && s->frame[1].coded)
+ silk_flush_frame(&s->frame[1]);
+
+ if (coded_channels == 1 || s->output_channels == 1) {
+ for (j = 0; j < s->output_channels; j++) {
+ memcpy(output[j] + i * s->flength,
+ s->frame[0].output + SILK_HISTORY - s->flength - 2,
+ s->flength * sizeof(float));
+ }
+ } else {
+ silk_unmix_ms(s, output[0] + i * s->flength, output[1] + i * s->flength);
+ }
+
+ s->midonly = 0;
+ }
+
+ return nb_frames * s->flength;
+}
+
+void ff_silk_free(SilkContext **ps)
+{
+ av_freep(ps);
+}
+
+void ff_silk_flush(SilkContext *s)
+{
+ silk_flush_frame(&s->frame[0]);
+ silk_flush_frame(&s->frame[1]);
+
+ memset(s->prev_stereo_weights, 0, sizeof(s->prev_stereo_weights));
+}
+
+int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels)
+{
+ SilkContext *s;
+
+ if (output_channels != 1 && output_channels != 2) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n",
+ output_channels);
+ return AVERROR(EINVAL);
+ }
+
+ s = av_mallocz(sizeof(*s));
+ if (!s)
+ return AVERROR(ENOMEM);
+
+ s->avctx = avctx;
+ s->output_channels = output_channels;
+
+ ff_silk_flush(s);
+
+ *ps = s;
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/opusdec.c b/chromium/third_party/ffmpeg/libavcodec/opusdec.c
new file mode 100644
index 00000000000..1a994c46437
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/opusdec.c
@@ -0,0 +1,673 @@
+/*
+ * Opus decoder
+ * Copyright (c) 2012 Andrew D'Addesio
+ * Copyright (c) 2013-2014 Mozilla Corporation
+ *
+ * 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
+ * Opus decoder
+ * @author Andrew D'Addesio, Anton Khirnov
+ *
+ * Codec homepage: http://opus-codec.org/
+ * Specification: http://tools.ietf.org/html/rfc6716
+ * Ogg Opus specification: https://tools.ietf.org/html/draft-ietf-codec-oggopus-03
+ *
+ * Ogg-contained .opus files can be produced with opus-tools:
+ * http://git.xiph.org/?p=opus-tools.git
+ */
+
+#include <stdint.h>
+
+#include "libavutil/attributes.h"
+#include "libavutil/audio_fifo.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/opt.h"
+
+#include "libswresample/swresample.h"
+
+#include "avcodec.h"
+#include "celp_filters.h"
+#include "fft.h"
+#include "get_bits.h"
+#include "internal.h"
+#include "mathops.h"
+#include "opus.h"
+
+static const uint16_t silk_frame_duration_ms[16] = {
+ 10, 20, 40, 60,
+ 10, 20, 40, 60,
+ 10, 20, 40, 60,
+ 10, 20,
+ 10, 20,
+};
+
+/* number of samples of silence to feed to the resampler
+ * at the beginning */
+static const int silk_resample_delay[] = {
+ 4, 8, 11, 11, 11
+};
+
+static const uint8_t celt_band_end[] = { 13, 17, 17, 19, 21 };
+
+static int get_silk_samplerate(int config)
+{
+ if (config < 4)
+ return 8000;
+ else if (config < 8)
+ return 12000;
+ return 16000;
+}
+
+/**
+ * Range decoder
+ */
+static int opus_rc_init(OpusRangeCoder *rc, const uint8_t *data, int size)
+{
+ int ret = init_get_bits8(&rc->gb, data, size);
+ if (ret < 0)
+ return ret;
+
+ rc->range = 128;
+ rc->value = 127 - get_bits(&rc->gb, 7);
+ rc->total_read_bits = 9;
+ opus_rc_normalize(rc);
+
+ return 0;
+}
+
+static void opus_raw_init(OpusRangeCoder *rc, const uint8_t *rightend,
+ unsigned int bytes)
+{
+ rc->rb.position = rightend;
+ rc->rb.bytes = bytes;
+ rc->rb.cachelen = 0;
+ rc->rb.cacheval = 0;
+}
+
+static void opus_fade(float *out,
+ const float *in1, const float *in2,
+ const float *window, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ out[i] = in2[i] * window[i] + in1[i] * (1.0 - window[i]);
+}
+
+static int opus_flush_resample(OpusStreamContext *s, int nb_samples)
+{
+ int celt_size = av_audio_fifo_size(s->celt_delay);
+ int ret, i;
+ ret = swr_convert(s->swr,
+ (uint8_t**)s->out, nb_samples,
+ NULL, 0);
+ if (ret < 0)
+ return ret;
+ else if (ret != nb_samples) {
+ av_log(s->avctx, AV_LOG_ERROR, "Wrong number of flushed samples: %d\n",
+ ret);
+ return AVERROR_BUG;
+ }
+
+ if (celt_size) {
+ if (celt_size != nb_samples) {
+ av_log(s->avctx, AV_LOG_ERROR, "Wrong number of CELT delay samples.\n");
+ return AVERROR_BUG;
+ }
+ av_audio_fifo_read(s->celt_delay, (void**)s->celt_output, nb_samples);
+ for (i = 0; i < s->output_channels; i++) {
+ s->fdsp->vector_fmac_scalar(s->out[i],
+ s->celt_output[i], 1.0,
+ nb_samples);
+ }
+ }
+
+ if (s->redundancy_idx) {
+ for (i = 0; i < s->output_channels; i++)
+ opus_fade(s->out[i], s->out[i],
+ s->redundancy_output[i] + 120 + s->redundancy_idx,
+ ff_celt_window2 + s->redundancy_idx, 120 - s->redundancy_idx);
+ s->redundancy_idx = 0;
+ }
+
+ s->out[0] += nb_samples;
+ s->out[1] += nb_samples;
+ s->out_size -= nb_samples * sizeof(float);
+
+ return 0;
+}
+
+static int opus_init_resample(OpusStreamContext *s)
+{
+ float delay[16] = { 0.0 };
+ uint8_t *delayptr[2] = { (uint8_t*)delay, (uint8_t*)delay };
+ int ret;
+
+ av_opt_set_int(s->swr, "in_sample_rate", s->silk_samplerate, 0);
+ ret = swr_init(s->swr);
+ if (ret < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "Error opening the resampler.\n");
+ return ret;
+ }
+
+ ret = swr_convert(s->swr,
+ NULL, 0,
+ delayptr, silk_resample_delay[s->packet.bandwidth]);
+ if (ret < 0) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Error feeding initial silence to the resampler.\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static int opus_decode_redundancy(OpusStreamContext *s, const uint8_t *data, int size)
+{
+ int ret;
+ enum OpusBandwidth bw = s->packet.bandwidth;
+
+ if (s->packet.mode == OPUS_MODE_SILK &&
+ bw == OPUS_BANDWIDTH_MEDIUMBAND)
+ bw = OPUS_BANDWIDTH_WIDEBAND;
+
+ ret = opus_rc_init(&s->redundancy_rc, data, size);
+ if (ret < 0)
+ goto fail;
+ opus_raw_init(&s->redundancy_rc, data + size, size);
+
+ ret = ff_celt_decode_frame(s->celt, &s->redundancy_rc,
+ s->redundancy_output,
+ s->packet.stereo + 1, 240,
+ 0, celt_band_end[s->packet.bandwidth]);
+ if (ret < 0)
+ goto fail;
+
+ return 0;
+fail:
+ av_log(s->avctx, AV_LOG_ERROR, "Error decoding the redundancy frame.\n");
+ return ret;
+}
+
+static int opus_decode_frame(OpusStreamContext *s, const uint8_t *data, int size)
+{
+ int samples = s->packet.frame_duration;
+ int redundancy = 0;
+ int redundancy_size, redundancy_pos;
+ int ret, i, consumed;
+ int delayed_samples = s->delayed_samples;
+
+ ret = opus_rc_init(&s->rc, data, size);
+ if (ret < 0)
+ return ret;
+
+ /* decode the silk frame */
+ if (s->packet.mode == OPUS_MODE_SILK || s->packet.mode == OPUS_MODE_HYBRID) {
+ if (!swr_is_initialized(s->swr)) {
+ ret = opus_init_resample(s);
+ if (ret < 0)
+ return ret;
+ }
+
+ samples = ff_silk_decode_superframe(s->silk, &s->rc, s->silk_output,
+ FFMIN(s->packet.bandwidth, OPUS_BANDWIDTH_WIDEBAND),
+ s->packet.stereo + 1,
+ silk_frame_duration_ms[s->packet.config]);
+ if (samples < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "Error decoding a SILK frame.\n");
+ return samples;
+ }
+ samples = swr_convert(s->swr,
+ (uint8_t**)s->out, s->packet.frame_duration,
+ (uint8_t**)s->silk_output, samples);
+ if (samples < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "Error resampling SILK data.\n");
+ return samples;
+ }
+ s->delayed_samples += s->packet.frame_duration - samples;
+ } else
+ ff_silk_flush(s->silk);
+
+ // decode redundancy information
+ consumed = opus_rc_tell(&s->rc);
+ if (s->packet.mode == OPUS_MODE_HYBRID && consumed + 37 <= size * 8)
+ redundancy = opus_rc_p2model(&s->rc, 12);
+ else if (s->packet.mode == OPUS_MODE_SILK && consumed + 17 <= size * 8)
+ redundancy = 1;
+
+ if (redundancy) {
+ redundancy_pos = opus_rc_p2model(&s->rc, 1);
+
+ if (s->packet.mode == OPUS_MODE_HYBRID)
+ redundancy_size = opus_rc_unimodel(&s->rc, 256) + 2;
+ else
+ redundancy_size = size - (consumed + 7) / 8;
+ size -= redundancy_size;
+ if (size < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid redundancy frame size.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (redundancy_pos) {
+ ret = opus_decode_redundancy(s, data + size, redundancy_size);
+ if (ret < 0)
+ return ret;
+ ff_celt_flush(s->celt);
+ }
+ }
+
+ /* decode the CELT frame */
+ if (s->packet.mode == OPUS_MODE_CELT || s->packet.mode == OPUS_MODE_HYBRID) {
+ float *out_tmp[2] = { s->out[0], s->out[1] };
+ float **dst = (s->packet.mode == OPUS_MODE_CELT) ?
+ out_tmp : s->celt_output;
+ int celt_output_samples = samples;
+ int delay_samples = av_audio_fifo_size(s->celt_delay);
+
+ if (delay_samples) {
+ if (s->packet.mode == OPUS_MODE_HYBRID) {
+ av_audio_fifo_read(s->celt_delay, (void**)s->celt_output, delay_samples);
+
+ for (i = 0; i < s->output_channels; i++) {
+ s->fdsp->vector_fmac_scalar(out_tmp[i], s->celt_output[i], 1.0,
+ delay_samples);
+ out_tmp[i] += delay_samples;
+ }
+ celt_output_samples -= delay_samples;
+ } else {
+ av_log(s->avctx, AV_LOG_WARNING,
+ "Spurious CELT delay samples present.\n");
+ av_audio_fifo_drain(s->celt_delay, delay_samples);
+ if (s->avctx->err_recognition & AV_EF_EXPLODE)
+ return AVERROR_BUG;
+ }
+ }
+
+ opus_raw_init(&s->rc, data + size, size);
+
+ ret = ff_celt_decode_frame(s->celt, &s->rc, dst,
+ s->packet.stereo + 1,
+ s->packet.frame_duration,
+ (s->packet.mode == OPUS_MODE_HYBRID) ? 17 : 0,
+ celt_band_end[s->packet.bandwidth]);
+ if (ret < 0)
+ return ret;
+
+ if (s->packet.mode == OPUS_MODE_HYBRID) {
+ int celt_delay = s->packet.frame_duration - celt_output_samples;
+ void *delaybuf[2] = { s->celt_output[0] + celt_output_samples,
+ s->celt_output[1] + celt_output_samples };
+
+ for (i = 0; i < s->output_channels; i++) {
+ s->fdsp->vector_fmac_scalar(out_tmp[i],
+ s->celt_output[i], 1.0,
+ celt_output_samples);
+ }
+
+ ret = av_audio_fifo_write(s->celt_delay, delaybuf, celt_delay);
+ if (ret < 0)
+ return ret;
+ }
+ } else
+ ff_celt_flush(s->celt);
+
+ if (s->redundancy_idx) {
+ for (i = 0; i < s->output_channels; i++)
+ opus_fade(s->out[i], s->out[i],
+ s->redundancy_output[i] + 120 + s->redundancy_idx,
+ ff_celt_window2 + s->redundancy_idx, 120 - s->redundancy_idx);
+ s->redundancy_idx = 0;
+ }
+ if (redundancy) {
+ if (!redundancy_pos) {
+ ff_celt_flush(s->celt);
+ ret = opus_decode_redundancy(s, data + size, redundancy_size);
+ if (ret < 0)
+ return ret;
+
+ for (i = 0; i < s->output_channels; i++) {
+ opus_fade(s->out[i] + samples - 120 + delayed_samples,
+ s->out[i] + samples - 120 + delayed_samples,
+ s->redundancy_output[i] + 120,
+ ff_celt_window2, 120 - delayed_samples);
+ if (delayed_samples)
+ s->redundancy_idx = 120 - delayed_samples;
+ }
+ } else {
+ for (i = 0; i < s->output_channels; i++) {
+ memcpy(s->out[i] + delayed_samples, s->redundancy_output[i], 120 * sizeof(float));
+ opus_fade(s->out[i] + 120 + delayed_samples,
+ s->redundancy_output[i] + 120,
+ s->out[i] + 120 + delayed_samples,
+ ff_celt_window2, 120);
+ }
+ }
+ }
+
+ return samples;
+}
+
+static int opus_decode_subpacket(OpusStreamContext *s,
+ const uint8_t *buf, int buf_size,
+ int nb_samples)
+{
+ int output_samples = 0;
+ int flush_needed = 0;
+ int i, j, ret;
+
+ /* check if we need to flush the resampler */
+ if (swr_is_initialized(s->swr)) {
+ if (buf) {
+ int64_t cur_samplerate;
+ av_opt_get_int(s->swr, "in_sample_rate", 0, &cur_samplerate);
+ flush_needed = (s->packet.mode == OPUS_MODE_CELT) || (cur_samplerate != s->silk_samplerate);
+ } else {
+ flush_needed = !!s->delayed_samples;
+ }
+ }
+
+ if (!buf && !flush_needed)
+ return 0;
+
+ /* use dummy output buffers if the channel is not mapped to anything */
+ if (!s->out[0] ||
+ (s->output_channels == 2 && !s->out[1])) {
+ av_fast_malloc(&s->out_dummy, &s->out_dummy_allocated_size, s->out_size);
+ if (!s->out_dummy)
+ return AVERROR(ENOMEM);
+ if (!s->out[0])
+ s->out[0] = s->out_dummy;
+ if (!s->out[1])
+ s->out[1] = s->out_dummy;
+ }
+
+ /* flush the resampler if necessary */
+ if (flush_needed) {
+ ret = opus_flush_resample(s, s->delayed_samples);
+ if (ret < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "Error flushing the resampler.\n");
+ return ret;
+ }
+ swr_close(s->swr);
+ output_samples += s->delayed_samples;
+ s->delayed_samples = 0;
+
+ if (!buf)
+ goto finish;
+ }
+
+ /* decode all the frames in the packet */
+ for (i = 0; i < s->packet.frame_count; i++) {
+ int size = s->packet.frame_size[i];
+ int samples = opus_decode_frame(s, buf + s->packet.frame_offset[i], size);
+
+ if (samples < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "Error decoding an Opus frame.\n");
+ if (s->avctx->err_recognition & AV_EF_EXPLODE)
+ return samples;
+
+ for (j = 0; j < s->output_channels; j++)
+ memset(s->out[j], 0, s->packet.frame_duration * sizeof(float));
+ samples = s->packet.frame_duration;
+ }
+ output_samples += samples;
+
+ for (j = 0; j < s->output_channels; j++)
+ s->out[j] += samples;
+ s->out_size -= samples * sizeof(float);
+ }
+
+finish:
+ s->out[0] = s->out[1] = NULL;
+ s->out_size = 0;
+
+ return output_samples;
+}
+
+static int opus_decode_packet(AVCodecContext *avctx, void *data,
+ int *got_frame_ptr, AVPacket *avpkt)
+{
+ OpusContext *c = avctx->priv_data;
+ AVFrame *frame = data;
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
+ int coded_samples = 0;
+ int decoded_samples = 0;
+ int i, ret;
+
+ /* decode the header of the first sub-packet to find out the sample count */
+ if (buf) {
+ OpusPacket *pkt = &c->streams[0].packet;
+ ret = ff_opus_parse_packet(pkt, buf, buf_size, c->nb_streams > 1);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error parsing the packet header.\n");
+ return ret;
+ }
+ coded_samples += pkt->frame_count * pkt->frame_duration;
+ c->streams[0].silk_samplerate = get_silk_samplerate(pkt->config);
+ }
+
+ frame->nb_samples = coded_samples + c->streams[0].delayed_samples;
+
+ /* no input or buffered data => nothing to do */
+ if (!frame->nb_samples) {
+ *got_frame_ptr = 0;
+ return 0;
+ }
+
+ /* setup the data buffers */
+ ret = ff_get_buffer(avctx, frame, 0);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ return ret;
+ }
+ frame->nb_samples = 0;
+
+ for (i = 0; i < avctx->channels; i++) {
+ ChannelMap *map = &c->channel_maps[i];
+ if (!map->copy)
+ c->streams[map->stream_idx].out[map->channel_idx] = (float*)frame->extended_data[i];
+ }
+
+ for (i = 0; i < c->nb_streams; i++)
+ c->streams[i].out_size = frame->linesize[0];
+
+ /* decode each sub-packet */
+ for (i = 0; i < c->nb_streams; i++) {
+ OpusStreamContext *s = &c->streams[i];
+
+ if (i && buf) {
+ ret = ff_opus_parse_packet(&s->packet, buf, buf_size, i != c->nb_streams - 1);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error parsing the packet header.\n");
+ return ret;
+ }
+ s->silk_samplerate = get_silk_samplerate(s->packet.config);
+ }
+
+ ret = opus_decode_subpacket(&c->streams[i], buf,
+ s->packet.data_size, coded_samples);
+ if (ret < 0)
+ return ret;
+ if (decoded_samples && ret != decoded_samples) {
+ av_log(avctx, AV_LOG_ERROR, "Different numbers of decoded samples "
+ "in a multi-channel stream\n");
+ return AVERROR_INVALIDDATA;
+ }
+ decoded_samples = ret;
+ buf += s->packet.packet_size;
+ buf_size -= s->packet.packet_size;
+ }
+
+ for (i = 0; i < avctx->channels; i++) {
+ ChannelMap *map = &c->channel_maps[i];
+
+ /* handle copied channels */
+ if (map->copy) {
+ memcpy(frame->extended_data[i],
+ frame->extended_data[map->copy_idx],
+ frame->linesize[0]);
+ } else if (map->silence) {
+ memset(frame->extended_data[i], 0, frame->linesize[0]);
+ }
+
+ if (c->gain_i) {
+ c->fdsp.vector_fmul_scalar((float*)frame->extended_data[i],
+ (float*)frame->extended_data[i],
+ c->gain, FFALIGN(decoded_samples, 8));
+ }
+ }
+
+ frame->nb_samples = decoded_samples;
+ *got_frame_ptr = !!decoded_samples;
+
+ return avpkt->size;
+}
+
+static av_cold void opus_decode_flush(AVCodecContext *ctx)
+{
+ OpusContext *c = ctx->priv_data;
+ int i;
+
+ for (i = 0; i < c->nb_streams; i++) {
+ OpusStreamContext *s = &c->streams[i];
+
+ memset(&s->packet, 0, sizeof(s->packet));
+ s->delayed_samples = 0;
+
+ if (s->celt_delay)
+ av_audio_fifo_drain(s->celt_delay, av_audio_fifo_size(s->celt_delay));
+ swr_close(s->swr);
+
+ ff_silk_flush(s->silk);
+ ff_celt_flush(s->celt);
+ }
+}
+
+static av_cold int opus_decode_close(AVCodecContext *avctx)
+{
+ OpusContext *c = avctx->priv_data;
+ int i;
+
+ for (i = 0; i < c->nb_streams; i++) {
+ OpusStreamContext *s = &c->streams[i];
+
+ ff_silk_free(&s->silk);
+ ff_celt_free(&s->celt);
+
+ av_freep(&s->out_dummy);
+ s->out_dummy_allocated_size = 0;
+
+ av_audio_fifo_free(s->celt_delay);
+ swr_free(&s->swr);
+ }
+
+ av_freep(&c->streams);
+ c->nb_streams = 0;
+
+ av_freep(&c->channel_maps);
+
+ return 0;
+}
+
+static av_cold int opus_decode_init(AVCodecContext *avctx)
+{
+ OpusContext *c = avctx->priv_data;
+ int ret, i, j;
+
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
+ avctx->sample_rate = 48000;
+
+ avpriv_float_dsp_init(&c->fdsp, 0);
+
+ /* find out the channel configuration */
+ ret = ff_opus_parse_extradata(avctx, c);
+ if (ret < 0)
+ return ret;
+
+ /* allocate and init each independent decoder */
+ c->streams = av_mallocz_array(c->nb_streams, sizeof(*c->streams));
+ if (!c->streams) {
+ c->nb_streams = 0;
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ for (i = 0; i < c->nb_streams; i++) {
+ OpusStreamContext *s = &c->streams[i];
+ uint64_t layout;
+
+ s->output_channels = (i < c->nb_stereo_streams) ? 2 : 1;
+
+ s->avctx = avctx;
+
+ for (j = 0; j < s->output_channels; j++) {
+ s->silk_output[j] = s->silk_buf[j];
+ s->celt_output[j] = s->celt_buf[j];
+ s->redundancy_output[j] = s->redundancy_buf[j];
+ }
+
+ s->fdsp = &c->fdsp;
+
+ s->swr =swr_alloc();
+ if (!s->swr)
+ goto fail;
+
+ layout = (s->output_channels == 1) ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
+ av_opt_set_int(s->swr, "in_sample_fmt", avctx->sample_fmt, 0);
+ av_opt_set_int(s->swr, "out_sample_fmt", avctx->sample_fmt, 0);
+ av_opt_set_int(s->swr, "in_channel_layout", layout, 0);
+ av_opt_set_int(s->swr, "out_channel_layout", layout, 0);
+ av_opt_set_int(s->swr, "out_sample_rate", avctx->sample_rate, 0);
+ av_opt_set_int(s->swr, "filter_size", 16, 0);
+
+ ret = ff_silk_init(avctx, &s->silk, s->output_channels);
+ if (ret < 0)
+ goto fail;
+
+ ret = ff_celt_init(avctx, &s->celt, s->output_channels);
+ if (ret < 0)
+ goto fail;
+
+ s->celt_delay = av_audio_fifo_alloc(avctx->sample_fmt,
+ s->output_channels, 1024);
+ if (!s->celt_delay) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ }
+
+ return 0;
+fail:
+ opus_decode_close(avctx);
+ return ret;
+}
+
+AVCodec ff_opus_decoder = {
+ .name = "opus",
+ .long_name = NULL_IF_CONFIG_SMALL("Opus"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_OPUS,
+ .priv_data_size = sizeof(OpusContext),
+ .init = opus_decode_init,
+ .close = opus_decode_close,
+ .decode = opus_decode_packet,
+ .flush = opus_decode_flush,
+ .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/paf.c b/chromium/third_party/ffmpeg/libavcodec/paf.c
index 76c90c9f49a..05164ee32cf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/paf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/paf.c
@@ -19,16 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
+
#include "libavcodec/paf.h"
-#include "bytestream.h"
#include "avcodec.h"
+#include "bytestream.h"
#include "copy_block.h"
#include "internal.h"
+#include "mathops.h"
-
-static const uint8_t block_sequences[16][8] =
-{
+static const uint8_t block_sequences[16][8] = {
{ 0, 0, 0, 0, 0, 0, 0, 0 },
{ 2, 0, 0, 0, 0, 0, 0, 0 },
{ 5, 7, 0, 0, 0, 0, 0, 0 },
@@ -44,22 +45,25 @@ static const uint8_t block_sequences[16][8] =
{ 2, 4, 5, 7, 0, 0, 0, 0 },
{ 2, 4, 5, 0, 0, 0, 0, 0 },
{ 2, 4, 6, 0, 0, 0, 0, 0 },
- { 2, 4, 5, 7, 5, 7, 0, 0 }
+ { 2, 4, 5, 7, 5, 7, 0, 0 },
};
typedef struct PAFVideoDecContext {
AVFrame *pic;
GetByteContext gb;
- int current_frame;
+ int width;
+ int height;
+
+ int current_frame;
uint8_t *frame[4];
- int frame_size;
- int video_size;
+ int frame_size;
+ int video_size;
uint8_t *opcodes;
} PAFVideoDecContext;
-static av_cold int paf_vid_close(AVCodecContext *avctx)
+static av_cold int paf_video_close(AVCodecContext *avctx)
{
PAFVideoDecContext *c = avctx->priv_data;
int i;
@@ -72,13 +76,18 @@ static av_cold int paf_vid_close(AVCodecContext *avctx)
return 0;
}
-static av_cold int paf_vid_init(AVCodecContext *avctx)
+static av_cold int paf_video_init(AVCodecContext *avctx)
{
PAFVideoDecContext *c = avctx->priv_data;
int i;
+ c->width = avctx->width;
+ c->height = avctx->height;
+
if (avctx->height & 3 || avctx->width & 3) {
- av_log(avctx, AV_LOG_ERROR, "width and height must be multiplies of 4\n");
+ av_log(avctx, AV_LOG_ERROR,
+ "width %d and height %d must be multiplie of 4.\n",
+ avctx->width, avctx->height);
return AVERROR_INVALIDDATA;
}
@@ -88,12 +97,12 @@ static av_cold int paf_vid_init(AVCodecContext *avctx)
if (!c->pic)
return AVERROR(ENOMEM);
- c->frame_size = FFALIGN(avctx->height, 256) * avctx->width;
- c->video_size = avctx->height * avctx->width;
+ c->frame_size = avctx->width * FFALIGN(avctx->height, 256);
+ c->video_size = avctx->width * avctx->height;
for (i = 0; i < 4; i++) {
c->frame[i] = av_mallocz(c->frame_size);
if (!c->frame[i]) {
- paf_vid_close(avctx);
+ paf_video_close(avctx);
return AVERROR(ENOMEM);
}
}
@@ -101,58 +110,59 @@ static av_cold int paf_vid_init(AVCodecContext *avctx)
return 0;
}
-static int get_video_page_offset(AVCodecContext *avctx, uint8_t a, uint8_t b)
+static void read4x4block(PAFVideoDecContext *c, uint8_t *dst, int width)
{
- int x, y;
-
- x = b & 0x7F;
- y = ((a & 0x3F) << 1) | (b >> 7 & 1);
-
- return y * 2 * avctx->width + x * 2;
-}
-
-static void copy4h(AVCodecContext *avctx, uint8_t *dst)
-{
- PAFVideoDecContext *c = avctx->priv_data;
int i;
for (i = 0; i < 4; i++) {
bytestream2_get_buffer(&c->gb, dst, 4);
- dst += avctx->width;
+ dst += width;
}
}
-static void copy_color_mask(AVCodecContext *avctx, uint8_t mask, uint8_t *dst, uint8_t color)
+static void copy_color_mask(uint8_t *dst, int width, uint8_t mask, uint8_t color)
{
int i;
for (i = 0; i < 4; i++) {
- if ((mask >> 4) & (1 << (3 - i)))
+ if (mask & (1 << 7 - i))
dst[i] = color;
- if ((mask & 15) & (1 << (3 - i)))
- dst[avctx->width + i] = color;
+ if (mask & (1 << 3 - i))
+ dst[width + i] = color;
}
}
-static void copy_src_mask(AVCodecContext *avctx, uint8_t mask, uint8_t *dst, const uint8_t *src)
+static void copy_src_mask(uint8_t *dst, int width, uint8_t mask, const uint8_t *src)
{
int i;
for (i = 0; i < 4; i++) {
- if ((mask >> 4) & (1 << (3 - i)))
+ if (mask & (1 << 7 - i))
dst[i] = src[i];
- if ((mask & 15) & (1 << (3 - i)))
- dst[avctx->width + i] = src[avctx->width + i];
+ if (mask & (1 << 3 - i))
+ dst[width + i] = src[width + i];
}
}
-static int decode_0(AVCodecContext *avctx, uint8_t code, uint8_t *pkt)
+static void set_src_position(PAFVideoDecContext *c,
+ const uint8_t **p,
+ const uint8_t **pend)
+{
+ int val = bytestream2_get_be16(&c->gb);
+ int page = val >> 14;
+ int x = (val & 0x7F);
+ int y = ((val >> 7) & 0x7F);
+
+ *p = c->frame[page] + x * 2 + y * 2 * c->width;
+ *pend = c->frame[page] + c->frame_size;
+}
+
+static int decode_0(PAFVideoDecContext *c, uint8_t *pkt, uint8_t code)
{
- PAFVideoDecContext *c = avctx->priv_data;
uint32_t opcode_size, offset;
- uint8_t *dst, *dend, mask = 0, color = 0, a, b, p;
+ uint8_t *dst, *dend, mask = 0, color = 0;
const uint8_t *src, *send, *opcodes;
- int i, j, x = 0;
+ int i, j, op = 0;
i = bytestream2_get_byte(&c->gb);
if (i) {
@@ -164,21 +174,22 @@ static int decode_0(AVCodecContext *avctx, uint8_t code, uint8_t *pkt)
bytestream2_skip(&c->gb, 4 - align);
}
do {
- a = bytestream2_get_byte(&c->gb);
- b = bytestream2_get_byte(&c->gb);
- p = (a & 0xC0) >> 6;
- dst = c->frame[p] + get_video_page_offset(avctx, a, b);
- dend = c->frame[p] + c->frame_size;
- offset = (b & 0x7F) * 2;
+ int page, val, x, y;
+ val = bytestream2_get_be16(&c->gb);
+ page = val >> 14;
+ x = (val & 0x7F) * 2;
+ y = ((val >> 7) & 0x7F) * 2;
+ dst = c->frame[page] + x + y * c->width;
+ dend = c->frame[page] + c->frame_size;
+ offset = (x & 0x7F) * 2;
j = bytestream2_get_le16(&c->gb) + offset;
-
do {
offset++;
- if (dst + 3 * avctx->width + 4 > dend)
+ if (dst + 3 * c->width + 4 > dend)
return AVERROR_INVALIDDATA;
- copy4h(avctx, dst);
+ read4x4block(c, dst, c->width);
if ((offset & 0x3F) == 0)
- dst += avctx->width * 3;
+ dst += c->width * 3;
dst += 4;
} while (offset < j);
} while (--i);
@@ -187,18 +198,14 @@ static int decode_0(AVCodecContext *avctx, uint8_t code, uint8_t *pkt)
dst = c->frame[c->current_frame];
dend = c->frame[c->current_frame] + c->frame_size;
do {
- a = bytestream2_get_byte(&c->gb);
- b = bytestream2_get_byte(&c->gb);
- p = (a & 0xC0) >> 6;
- src = c->frame[p] + get_video_page_offset(avctx, a, b);
- send = c->frame[p] + c->frame_size;
- if ((src + 3 * avctx->width + 4 > send) ||
- (dst + 3 * avctx->width + 4 > dend))
+ set_src_position(c, &src, &send);
+ if ((src + 3 * c->width + 4 > send) ||
+ (dst + 3 * c->width + 4 > dend))
return AVERROR_INVALIDDATA;
- copy_block4(dst, src, avctx->width, avctx->width, 4);
+ copy_block4(dst, src, c->width, c->width, 4);
i++;
if ((i & 0x3F) == 0)
- dst += avctx->width * 3;
+ dst += c->width * 3;
dst += 4;
} while (i < c->video_size / 16);
@@ -213,60 +220,53 @@ static int decode_0(AVCodecContext *avctx, uint8_t code, uint8_t *pkt)
dst = c->frame[c->current_frame];
- for (i = 0; i < avctx->height; i += 4, dst += avctx->width * 3) {
- for (j = 0; j < avctx->width; j += 4, dst += 4) {
+ for (i = 0; i < c->height; i += 4, dst += c->width * 3)
+ for (j = 0; j < c->width; j += 4, dst += 4) {
int opcode, k = 0;
-
- if (x > opcode_size)
+ if (op > opcode_size)
return AVERROR_INVALIDDATA;
if (j & 4) {
- opcode = opcodes[x] & 15;
- x++;
+ opcode = opcodes[op] & 15;
+ op++;
} else {
- opcode = opcodes[x] >> 4;
+ opcode = opcodes[op] >> 4;
}
while (block_sequences[opcode][k]) {
-
- offset = avctx->width * 2;
+ offset = c->width * 2;
code = block_sequences[opcode][k++];
switch (code) {
case 2:
offset = 0;
case 3:
- color = bytestream2_get_byte(&c->gb);
+ color = bytestream2_get_byte(&c->gb);
case 4:
- mask = bytestream2_get_byte(&c->gb);
- copy_color_mask(avctx, mask, dst + offset, color);
+ mask = bytestream2_get_byte(&c->gb);
+ copy_color_mask(dst + offset, c->width, mask, color);
break;
case 5:
offset = 0;
case 6:
- a = bytestream2_get_byte(&c->gb);
- b = bytestream2_get_byte(&c->gb);
- p = (a & 0xC0) >> 6;
- src = c->frame[p] + get_video_page_offset(avctx, a, b);
- send = c->frame[p] + c->frame_size;
+ set_src_position(c, &src, &send);
case 7:
- if (src + offset + avctx->width + 4 > send)
+ if (src + offset + c->width + 4 > send)
return AVERROR_INVALIDDATA;
mask = bytestream2_get_byte(&c->gb);
- copy_src_mask(avctx, mask, dst + offset, src + offset);
+ copy_src_mask(dst + offset, c->width, mask, src + offset);
break;
}
}
}
- }
return 0;
}
-static int paf_vid_decode(AVCodecContext *avctx, void *data,
- int *got_frame, AVPacket *pkt)
+static int paf_video_decode(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *pkt)
{
PAFVideoDecContext *c = avctx->priv_data;
- uint8_t code, *dst, *src, *end;
+ uint8_t code, *dst, *end;
int i, frame, ret;
if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
@@ -275,12 +275,12 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data,
bytestream2_init(&c->gb, pkt->data, pkt->size);
code = bytestream2_get_byte(&c->gb);
- if (code & 0x20) {
+ if (code & 0x20) { // frame is keyframe
for (i = 0; i < 4; i++)
memset(c->frame[i], 0, c->frame_size);
memset(c->pic->data[1], 0, AVPALETTE_SIZE);
- c->current_frame = 0;
+ c->current_frame = 0;
c->pic->key_frame = 1;
c->pic->pict_type = AV_PICTURE_TYPE_I;
} else {
@@ -288,7 +288,7 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data,
c->pic->pict_type = AV_PICTURE_TYPE_P;
}
- if (code & 0x40) {
+ if (code & 0x40) { // palette update
uint32_t *out = (uint32_t *)c->pic->data[1];
int index, count;
@@ -297,7 +297,7 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data,
if (index + count > 256)
return AVERROR_INVALIDDATA;
- if (bytestream2_get_bytes_left(&c->gb) < 3*count)
+ if (bytestream2_get_bytes_left(&c->gb) < 3 * count)
return AVERROR_INVALIDDATA;
out += index;
@@ -310,24 +310,32 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data,
g = g << 2 | g >> 4;
b = bytestream2_get_byteu(&c->gb);
b = b << 2 | b >> 4;
- *out++ = 0xFFU << 24 | r << 16 | g << 8 | b;
+ *out++ = (0xFFU << 24) | (r << 16) | (g << 8) | b;
}
c->pic->palette_has_changed = 1;
}
switch (code & 0x0F) {
case 0:
- if ((ret = decode_0(avctx, code, pkt->data)) < 0)
+ /* Block-based motion compensation using 4x4 blocks with either
+ * horizontal or vertical vectors; might incorporate VQ as well. */
+ if ((ret = decode_0(c, pkt->data, code)) < 0)
return ret;
break;
case 1:
+ /* Uncompressed data. This mode specifies that (width * height) bytes
+ * should be copied directly from the encoded buffer into the output. */
dst = c->frame[c->current_frame];
+ // possibly chunk length data
bytestream2_skip(&c->gb, 2);
if (bytestream2_get_bytes_left(&c->gb) < c->video_size)
return AVERROR_INVALIDDATA;
bytestream2_get_bufferu(&c->gb, dst, c->video_size);
break;
case 2:
+ /* Copy reference frame: Consume the next byte in the stream as the
+ * reference frame (which should be 0, 1, 2, or 3, and should not be
+ * the same as the current frame number). */
frame = bytestream2_get_byte(&c->gb);
if (frame > 3)
return AVERROR_INVALIDDATA;
@@ -335,6 +343,7 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data,
memcpy(c->frame[c->current_frame], c->frame[frame], c->frame_size);
break;
case 4:
+ /* Run length encoding.*/
dst = c->frame[c->current_frame];
end = dst + c->video_size;
@@ -364,24 +373,20 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
- dst = c->pic->data[0];
- src = c->frame[c->current_frame];
- for (i = 0; i < avctx->height; i++) {
- memcpy(dst, src, avctx->width);
- dst += c->pic->linesize[0];
- src += avctx->width;
- }
+ av_image_copy_plane(c->pic->data[0], c->pic->linesize[0],
+ c->frame[c->current_frame], c->width,
+ c->width, c->height);
c->current_frame = (c->current_frame + 1) & 3;
if ((ret = av_frame_ref(data, c->pic)) < 0)
return ret;
- *got_frame = 1;
+ *got_frame = 1;
return pkt->size;
}
-static av_cold int paf_aud_init(AVCodecContext *avctx)
+static av_cold int paf_audio_init(AVCodecContext *avctx)
{
if (avctx->channels != 2) {
av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n");
@@ -394,14 +399,14 @@ static av_cold int paf_aud_init(AVCodecContext *avctx)
return 0;
}
-static int paf_aud_decode(AVCodecContext *avctx, void *data,
- int *got_frame_ptr, AVPacket *pkt)
+static int paf_audio_decode(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *pkt)
{
AVFrame *frame = data;
- uint8_t *buf = pkt->data;
int16_t *output_samples;
- const uint8_t *t;
- int frames, ret, i, j, k;
+ const uint8_t *src = pkt->data;
+ int frames, ret, i, j;
+ int16_t cb[256];
frames = pkt->size / PAF_SOUND_FRAME_SIZE;
if (frames < 1)
@@ -412,40 +417,42 @@ static int paf_aud_decode(AVCodecContext *avctx, void *data,
return ret;
output_samples = (int16_t *)frame->data[0];
- for (i = 0; i < frames; i++) {
- t = buf + 256 * sizeof(uint16_t);
- for (j = 0; j < PAF_SOUND_SAMPLES; j++) {
- for (k = 0; k < 2; k++) {
- *output_samples++ = AV_RL16(buf + *t * 2);
- t++;
- }
- }
- buf += PAF_SOUND_FRAME_SIZE;
+ // codebook of 256 16-bit samples and 8-bit indices to it
+ for (j = 0; j < frames; j++) {
+ for (i = 0; i < 256; i++)
+ cb[i] = sign_extend(AV_RL16(src + i * 2), 16);
+ src += 256 * 2;
+ // always 2 channels
+ for (i = 0; i < PAF_SOUND_SAMPLES * 2; i++)
+ *output_samples++ = cb[*src++];
}
-
- *got_frame_ptr = 1;
+ *got_frame = 1;
return pkt->size;
}
+#if CONFIG_PAF_VIDEO_DECODER
AVCodec ff_paf_video_decoder = {
.name = "paf_video",
.long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_PAF_VIDEO,
.priv_data_size = sizeof(PAFVideoDecContext),
- .init = paf_vid_init,
- .close = paf_vid_close,
- .decode = paf_vid_decode,
+ .init = paf_video_init,
+ .close = paf_video_close,
+ .decode = paf_video_decode,
.capabilities = CODEC_CAP_DR1,
};
+#endif
+#if CONFIG_PAF_AUDIO_DECODER
AVCodec ff_paf_audio_decoder = {
- .name = "paf_audio",
- .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Audio"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_PAF_AUDIO,
- .init = paf_aud_init,
- .decode = paf_aud_decode,
- .capabilities = CODEC_CAP_DR1,
+ .name = "paf_audio",
+ .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Audio"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_PAF_AUDIO,
+ .init = paf_audio_init,
+ .decode = paf_audio_decode,
+ .capabilities = CODEC_CAP_DR1,
};
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/parser.c b/chromium/third_party/ffmpeg/libavcodec/parser.c
index 083ce022b5d..3169e2501f9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/parser.c
@@ -23,15 +23,19 @@
#include <stdint.h>
#include <string.h>
-#include "parser.h"
#include "libavutil/atomic.h"
#include "libavutil/mem.h"
+#include "parser.h"
+
static AVCodecParser *av_first_parser = NULL;
-AVCodecParser* av_parser_next(AVCodecParser *p){
- if(p) return p->next;
- else return av_first_parser;
+AVCodecParser *av_parser_next(AVCodecParser *p)
+{
+ if (p)
+ return p->next;
+ else
+ return av_first_parser;
}
void av_register_codec_parser(AVCodecParser *parser)
@@ -47,10 +51,10 @@ AVCodecParserContext *av_parser_init(int codec_id)
AVCodecParser *parser;
int ret;
- if(codec_id == AV_CODEC_ID_NONE)
+ if (codec_id == AV_CODEC_ID_NONE)
return NULL;
- for(parser = av_first_parser; parser != NULL; parser = parser->next) {
+ for (parser = av_first_parser; parser != NULL; parser = parser->next) {
if (parser->codec_ids[0] == codec_id ||
parser->codec_ids[1] == codec_id ||
parser->codec_ids[2] == codec_id ||
@@ -59,7 +63,8 @@ AVCodecParserContext *av_parser_init(int codec_id)
goto found;
}
return NULL;
- found:
+
+found:
s = av_mallocz(sizeof(AVCodecParserContext));
if (!s)
goto err_out;
@@ -74,7 +79,7 @@ AVCodecParserContext *av_parser_init(int codec_id)
if (ret != 0)
goto err_out;
}
- s->key_frame = -1;
+ s->key_frame = -1;
s->convergence_duration = 0;
s->dts_sync_point = INT_MIN;
s->dts_ref_dts_delta = INT_MIN;
@@ -88,72 +93,72 @@ err_out:
return NULL;
}
-void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove){
+void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove)
+{
int i;
- s->dts= s->pts= AV_NOPTS_VALUE;
- s->pos= -1;
- s->offset= 0;
- for(i = 0; i < AV_PARSER_PTS_NB; i++) {
- if ( s->cur_offset + off >= s->cur_frame_offset[i]
- && (s->frame_offset < s->cur_frame_offset[i] ||
- (!s->frame_offset && !s->next_frame_offset)) // first field/frame
+ s->dts =
+ s->pts = AV_NOPTS_VALUE;
+ s->pos = -1;
+ s->offset = 0;
+ for (i = 0; i < AV_PARSER_PTS_NB; i++) {
+ if (s->cur_offset + off >= s->cur_frame_offset[i] &&
+ (s->frame_offset < s->cur_frame_offset[i] ||
+ (!s->frame_offset && !s->next_frame_offset)) && // first field/frame
// check disabled since MPEG-TS does not send complete PES packets
- && /*s->next_frame_offset + off <*/ s->cur_frame_end[i]){
- s->dts= s->cur_frame_dts[i];
- s->pts= s->cur_frame_pts[i];
- s->pos= s->cur_frame_pos[i];
+ /*s->next_frame_offset + off <*/ s->cur_frame_end[i]){
+
+ s->dts = s->cur_frame_dts[i];
+ s->pts = s->cur_frame_pts[i];
+ s->pos = s->cur_frame_pos[i];
s->offset = s->next_frame_offset - s->cur_frame_offset[i];
- if(remove)
- s->cur_frame_offset[i]= INT64_MAX;
- if(s->cur_offset + off < s->cur_frame_end[i])
+ if (remove)
+ s->cur_frame_offset[i] = INT64_MAX;
+ if (s->cur_offset + off < s->cur_frame_end[i])
break;
}
}
}
-int av_parser_parse2(AVCodecParserContext *s,
- AVCodecContext *avctx,
+int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
- int64_t pts, int64_t dts,
- int64_t pos)
+ int64_t pts, int64_t dts, int64_t pos)
{
int index, i;
uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE];
- if(!(s->flags & PARSER_FLAG_FETCHED_OFFSET)) {
+ if (!(s->flags & PARSER_FLAG_FETCHED_OFFSET)) {
s->next_frame_offset =
s->cur_offset = pos;
- s->flags |= PARSER_FLAG_FETCHED_OFFSET;
+ s->flags |= PARSER_FLAG_FETCHED_OFFSET;
}
if (buf_size == 0) {
/* padding is always necessary even if EOF, so we add it here */
memset(dummy_buf, 0, sizeof(dummy_buf));
buf = dummy_buf;
- } else if (s->cur_offset + buf_size !=
- s->cur_frame_end[s->cur_frame_start_index]) { /* skip remainder packets */
+ } else if (s->cur_offset + buf_size != s->cur_frame_end[s->cur_frame_start_index]) { /* skip remainder packets */
/* add a new packet descriptor */
- i = (s->cur_frame_start_index + 1) & (AV_PARSER_PTS_NB - 1);
- s->cur_frame_start_index = i;
- s->cur_frame_offset[i] = s->cur_offset;
- s->cur_frame_end[i] = s->cur_offset + buf_size;
- s->cur_frame_pts[i] = pts;
- s->cur_frame_dts[i] = dts;
- s->cur_frame_pos[i] = pos;
+ i = (s->cur_frame_start_index + 1) & (AV_PARSER_PTS_NB - 1);
+ s->cur_frame_start_index = i;
+ s->cur_frame_offset[i] = s->cur_offset;
+ s->cur_frame_end[i] = s->cur_offset + buf_size;
+ s->cur_frame_pts[i] = pts;
+ s->cur_frame_dts[i] = dts;
+ s->cur_frame_pos[i] = pos;
}
- if (s->fetch_timestamp){
- s->fetch_timestamp=0;
- s->last_pts = s->pts;
- s->last_dts = s->dts;
- s->last_pos = s->pos;
+ if (s->fetch_timestamp) {
+ s->fetch_timestamp = 0;
+ s->last_pts = s->pts;
+ s->last_dts = s->dts;
+ s->last_pos = s->pos;
ff_fetch_timestamp(s, 0, 0);
}
-
/* WARNING: the returned index can be negative */
- index = s->parser->parser_parse(s, avctx, (const uint8_t **)poutbuf, poutbuf_size, buf, buf_size);
+ index = s->parser->parser_parse(s, avctx, (const uint8_t **) poutbuf,
+ poutbuf_size, buf, buf_size);
/* update the file pointer */
if (*poutbuf_size) {
/* fill the data for the current frame */
@@ -161,7 +166,7 @@ int av_parser_parse2(AVCodecParserContext *s,
/* offset of the next frame */
s->next_frame_offset = s->cur_offset + index;
- s->fetch_timestamp=1;
+ s->fetch_timestamp = 1;
}
if (index < 0)
index = 0;
@@ -169,32 +174,32 @@ int av_parser_parse2(AVCodecParserContext *s,
return index;
}
-int av_parser_change(AVCodecParserContext *s,
- AVCodecContext *avctx,
+int av_parser_change(AVCodecParserContext *s, AVCodecContext *avctx,
uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size, int keyframe){
-
- if(s && s->parser->split){
- if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){
- int i= s->parser->split(avctx, buf, buf_size);
- buf += i;
+ const uint8_t *buf, int buf_size, int keyframe)
+{
+ if (s && s->parser->split) {
+ if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER ||
+ avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER) {
+ int i = s->parser->split(avctx, buf, buf_size);
+ buf += i;
buf_size -= i;
}
}
/* cast to avoid warning about discarding qualifiers */
- *poutbuf= (uint8_t *) buf;
- *poutbuf_size= buf_size;
- if(avctx->extradata){
- if( (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))
- /*||(s->pict_type != AV_PICTURE_TYPE_I && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/
- /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
- int size= buf_size + avctx->extradata_size;
- *poutbuf_size= size;
- *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ *poutbuf = (uint8_t *) buf;
+ *poutbuf_size = buf_size;
+ if (avctx->extradata) {
+ if (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)) {
+ int size = buf_size + avctx->extradata_size;
+
+ *poutbuf_size = size;
+ *poutbuf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
- memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ memcpy(*poutbuf + avctx->extradata_size, buf,
+ buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
return 1;
}
}
@@ -204,7 +209,7 @@ int av_parser_change(AVCodecParserContext *s,
void av_parser_close(AVCodecParserContext *s)
{
- if(s){
+ if (s) {
if (s->parser->parser_close)
s->parser->parser_close(s);
av_free(s->priv_data);
@@ -212,33 +217,33 @@ void av_parser_close(AVCodecParserContext *s)
}
}
-/*****************************************************/
-
-int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
+int ff_combine_frame(ParseContext *pc, int next,
+ const uint8_t **buf, int *buf_size)
{
- if(pc->overread){
+ if (pc->overread) {
av_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n",
pc->overread, pc->state, next, pc->index, pc->overread_index);
- av_dlog(NULL, "%X %X %X %X\n", (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]);
+ av_dlog(NULL, "%X %X %X %X\n",
+ (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]);
}
/* Copy overread bytes from last frame into buffer. */
- for(; pc->overread>0; pc->overread--){
- pc->buffer[pc->index++]= pc->buffer[pc->overread_index++];
- }
+ for (; pc->overread > 0; pc->overread--)
+ pc->buffer[pc->index++] = pc->buffer[pc->overread_index++];
/* flush remaining if EOF */
- if(!*buf_size && next == END_NOT_FOUND){
- next= 0;
- }
+ if (!*buf_size && next == END_NOT_FOUND)
+ next = 0;
- pc->last_index= pc->index;
+ pc->last_index = pc->index;
/* copy into buffer end return */
- if(next == END_NOT_FOUND){
- void* new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size, (*buf_size) + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (next == END_NOT_FOUND) {
+ void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
+ *buf_size + pc->index +
+ FF_INPUT_BUFFER_PADDING_SIZE);
- if(!new_buffer) {
+ if (!new_buffer) {
pc->index = 0;
return AVERROR(ENOMEM);
}
@@ -248,13 +253,15 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s
return -1;
}
- *buf_size=
- pc->overread_index= pc->index + next;
+ *buf_size =
+ pc->overread_index = pc->index + next;
/* append to buffer */
- if(pc->index){
- void* new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size, next + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
- if(!new_buffer) {
+ if (pc->index) {
+ void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
+ next + pc->index +
+ FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!new_buffer) {
pc->overread_index =
pc->index = 0;
return AVERROR(ENOMEM);
@@ -264,20 +271,21 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s
memcpy(&pc->buffer[pc->index], *buf,
next + FF_INPUT_BUFFER_PADDING_SIZE);
pc->index = 0;
- *buf= pc->buffer;
+ *buf = pc->buffer;
}
/* store overread bytes */
- for(;next < 0; next++){
- pc->state = (pc->state<<8) | pc->buffer[pc->last_index + next];
- pc->state64 = (pc->state64<<8) | pc->buffer[pc->last_index + next];
+ for (; next < 0; next++) {
+ pc->state = pc->state << 8 | pc->buffer[pc->last_index + next];
+ pc->state64 = pc->state64 << 8 | pc->buffer[pc->last_index + next];
pc->overread++;
}
- if(pc->overread){
+ if (pc->overread) {
av_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n",
pc->overread, pc->state, next, pc->index, pc->overread_index);
- av_dlog(NULL, "%X %X %X %X\n", (*buf)[0], (*buf)[1],(*buf)[2],(*buf)[3]);
+ av_dlog(NULL, "%X %X %X %X\n",
+ (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]);
}
return 0;
@@ -290,18 +298,15 @@ void ff_parse_close(AVCodecParserContext *s)
av_freep(&pc->buffer);
}
-/*************************/
-
-int ff_mpeg4video_split(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
+int ff_mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
{
int i;
- uint32_t state= -1;
+ uint32_t state = -1;
- for(i=0; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(state == 0x1B3 || state == 0x1B6)
- return i-3;
+ for (i = 0; i < buf_size; i++) {
+ state = state << 8 | buf[i];
+ if (state == 0x1B3 || state == 0x1B6)
+ return i - 3;
}
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/pcm-dvd.c b/chromium/third_party/ffmpeg/libavcodec/pcm-dvd.c
index 77da8bf7e7c..9b4c40ee224 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pcm-dvd.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pcm-dvd.c
@@ -70,6 +70,7 @@ static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header)
/* early exit if the header didn't change apart from the frame number */
if (s->last_header == header_int)
return 0;
+ s->last_header = -1;
if (avctx->debug & FF_DEBUG_PICT_INFO)
av_dlog(avctx, "pcm_dvd_parse_header: header = %02x%02x%02x\n",
diff --git a/chromium/third_party/ffmpeg/libavcodec/pgssubdec.c b/chromium/third_party/ffmpeg/libavcodec/pgssubdec.c
index f45f0bfc874..b2c779a3caa 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pgssubdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pgssubdec.c
@@ -25,9 +25,9 @@
*/
#include "avcodec.h"
-#include "dsputil.h"
#include "bytestream.h"
#include "internal.h"
+#include "mathops.h"
#include "libavutil/colorspace.h"
#include "libavutil/imgutils.h"
@@ -232,7 +232,7 @@ static int parse_picture_segment(AVCodecContext *avctx,
ctx->pictures[picture_id].w = width;
ctx->pictures[picture_id].h = height;
- av_fast_malloc(&ctx->pictures[picture_id].rle, &ctx->pictures[picture_id].rle_buffer_size, rle_bitmap_len);
+ av_fast_padded_malloc(&ctx->pictures[picture_id].rle, &ctx->pictures[picture_id].rle_buffer_size, rle_bitmap_len);
if (!ctx->pictures[picture_id].rle)
return -1;
@@ -260,7 +260,7 @@ static void parse_palette_segment(AVCodecContext *avctx,
PGSSubContext *ctx = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
int color_id;
int y, cb, cr, alpha;
int r, g, b, r_add, g_add, b_add;
diff --git a/chromium/third_party/ffmpeg/libavcodec/pixels.h b/chromium/third_party/ffmpeg/libavcodec/pixels.h
new file mode 100644
index 00000000000..98eacd4df61
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/pixels.h
@@ -0,0 +1,37 @@
+/*
+ * 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_PIXELS_H
+#define AVCODEC_PIXELS_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+/* pixel operations */
+#define CALL_2X_PIXELS_MACRO(STATIC, a, b, n) \
+STATIC void a(uint8_t *block, const uint8_t *pixels, \
+ ptrdiff_t line_size, int h) \
+{ \
+ b(block, pixels, line_size, h); \
+ b(block + n, pixels + n, line_size, h); \
+}
+
+#define CALL_2X_PIXELS(a, b, n) CALL_2X_PIXELS_MACRO(static, a, b, n)
+#define CALL_2X_PIXELS_EXPORT(a, b, n) CALL_2X_PIXELS_MACRO(, a, b, n)
+
+#endif /* AVCODEC_PIXELS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/png.c b/chromium/third_party/ffmpeg/libavcodec/png.c
index b398d910003..ef52b51bd43 100644
--- a/chromium/third_party/ffmpeg/libavcodec/png.c
+++ b/chromium/third_party/ffmpeg/libavcodec/png.c
@@ -66,7 +66,7 @@ int ff_png_pass_row_size(int pass, int bits_per_pixel, int width)
xmin = ff_png_pass_xmin[pass];
if (width <= xmin)
return 0;
- shift = ff_png_pass_xshift[pass];
+ shift = ff_png_pass_xshift[pass];
pass_width = (width - xmin + (1 << shift) - 1) >> shift;
return (pass_width * bits_per_pixel + 7) >> 3;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/png_parser.c b/chromium/third_party/ffmpeg/libavcodec/png_parser.c
index 6f153d91d6f..530d5a0bad9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/png_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/png_parser.c
@@ -27,12 +27,11 @@
#include "parser.h"
#include "png.h"
-typedef struct PNGParseContext
-{
+typedef struct PNGParseContext {
ParseContext pc;
- uint32_t index;
- uint32_t chunk_length;
- uint32_t remaining_size;
+ uint32_t chunk_pos; ///< position inside current chunk
+ uint32_t chunk_length; ///< length of the current chunk
+ uint32_t remaining_size; ///< remaining size of the current chunk
} PNGParseContext;
static int png_parse(AVCodecParserContext *s, AVCodecContext *avctx,
@@ -60,38 +59,37 @@ static int png_parse(AVCodecParserContext *s, AVCodecContext *avctx,
}
}
ppc->pc.state64 = state64;
- } else
- if (ppc->remaining_size) {
- i = FFMIN(ppc->remaining_size, buf_size);
- ppc->remaining_size -= i;
- if (ppc->remaining_size)
- goto flush;
- if (ppc->index == -1) {
- next = i;
- goto flush;
- }
+ } else if (ppc->remaining_size) {
+ i = FFMIN(ppc->remaining_size, buf_size);
+ ppc->remaining_size -= i;
+ if (ppc->remaining_size)
+ goto flush;
+ if (ppc->chunk_pos == -1) {
+ next = i;
+ goto flush;
}
+ }
- for (;ppc->pc.frame_start_found && i < buf_size; i++) {
- ppc->pc.state = (ppc->pc.state<<8) | buf[i];
- if (ppc->index == 3) {
+ for (; ppc->pc.frame_start_found && i < buf_size; i++) {
+ ppc->pc.state = (ppc->pc.state << 8) | buf[i];
+ if (ppc->chunk_pos == 3) {
ppc->chunk_length = ppc->pc.state;
if (ppc->chunk_length > 0x7fffffff) {
- ppc->index = ppc->pc.frame_start_found = 0;
+ ppc->chunk_pos = ppc->pc.frame_start_found = 0;
goto flush;
}
ppc->chunk_length += 4;
- } else if (ppc->index == 7) {
+ } else if (ppc->chunk_pos == 7) {
if (ppc->chunk_length >= buf_size - i)
- ppc->remaining_size = ppc->chunk_length - buf_size + i + 1;
+ ppc->remaining_size = ppc->chunk_length - buf_size + i + 1;
if (ppc->pc.state == MKBETAG('I', 'E', 'N', 'D')) {
if (ppc->remaining_size)
- ppc->index = -1;
+ ppc->chunk_pos = -1;
else
next = ppc->chunk_length + i + 1;
break;
} else {
- ppc->index = 0;
+ ppc->chunk_pos = 0;
if (ppc->remaining_size)
break;
else
@@ -99,13 +97,14 @@ static int png_parse(AVCodecParserContext *s, AVCodecContext *avctx,
continue;
}
}
- ppc->index++;
+ ppc->chunk_pos++;
}
+
flush:
if (ff_combine_frame(&ppc->pc, next, &buf, &buf_size) < 0)
return buf_size;
- ppc->index = ppc->pc.frame_start_found = 0;
+ ppc->chunk_pos = ppc->pc.frame_start_found = 0;
*poutbuf = buf;
*poutbuf_size = buf_size;
diff --git a/chromium/third_party/ffmpeg/libavcodec/pngdec.c b/chromium/third_party/ffmpeg/libavcodec/pngdec.c
index 3d21e502881..fd771fc9466 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pngdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pngdec.c
@@ -85,8 +85,8 @@ static const uint8_t png_pass_dsp_mask[NB_PASSES] = {
};
/* NOTE: we try to construct a good looking image at each pass. width
- is the original image width. We also do pixel format conversion at
- this stage */
+ * is the original image width. We also do pixel format conversion at
+ * this stage */
static void png_put_interlaced_row(uint8_t *dst, int width,
int bits_per_pixel, int pass,
int color_type, const uint8_t *src)
@@ -157,7 +157,8 @@ static void png_put_interlaced_row(uint8_t *dst, int width,
}
}
-void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp)
+void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top,
+ int w, int bpp)
{
int i;
for (i = 0; i < w; i++) {
@@ -184,29 +185,35 @@ void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w
}
}
-#define UNROLL1(bpp, op) {\
- r = dst[0];\
- if(bpp >= 2) g = dst[1];\
- if(bpp >= 3) b = dst[2];\
- if(bpp >= 4) a = dst[3];\
- for(; i <= size - bpp; i+=bpp) {\
- dst[i+0] = r = op(r, src[i+0], last[i+0]);\
- if(bpp == 1) continue;\
- dst[i+1] = g = op(g, src[i+1], last[i+1]);\
- if(bpp == 2) continue;\
- dst[i+2] = b = op(b, src[i+2], last[i+2]);\
- if(bpp == 3) continue;\
- dst[i+3] = a = op(a, src[i+3], last[i+3]);\
- }\
+#define UNROLL1(bpp, op) { \
+ r = dst[0]; \
+ if (bpp >= 2) \
+ g = dst[1]; \
+ if (bpp >= 3) \
+ b = dst[2]; \
+ if (bpp >= 4) \
+ a = dst[3]; \
+ for (; i <= size - bpp; i += bpp) { \
+ dst[i + 0] = r = op(r, src[i + 0], last[i + 0]); \
+ if (bpp == 1) \
+ continue; \
+ dst[i + 1] = g = op(g, src[i + 1], last[i + 1]); \
+ if (bpp == 2) \
+ continue; \
+ dst[i + 2] = b = op(b, src[i + 2], last[i + 2]); \
+ if (bpp == 3) \
+ continue; \
+ dst[i + 3] = a = op(a, src[i + 3], last[i + 3]); \
+ } \
}
#define UNROLL_FILTER(op)\
- if(bpp == 1) UNROLL1(1, op)\
- else if(bpp == 2) UNROLL1(2, op)\
- else if(bpp == 3) UNROLL1(3, op)\
- else if(bpp == 4) UNROLL1(4, op)\
+ if (bpp == 1) UNROLL1(1, op)\
+ else if (bpp == 2) UNROLL1(2, op)\
+ else if (bpp == 3) UNROLL1(3, op)\
+ else if (bpp == 4) UNROLL1(4, op)\
for (; i < size; i++) {\
- dst[i] = op(dst[i-bpp], src[i], last[i]);\
+ dst[i] = op(dst[i - bpp], src[i], last[i]);\
}\
/* NOTE: 'dst' can be equal to 'last' */
@@ -220,18 +227,17 @@ static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
memcpy(dst, src, size);
break;
case PNG_FILTER_VALUE_SUB:
- for (i = 0; i < bpp; i++) {
+ for (i = 0; i < bpp; i++)
dst[i] = src[i];
- }
if (bpp == 4) {
- p = *(int*)dst;
+ p = *(int *)dst;
for (; i < size; i += bpp) {
- int s = *(int*)(src + i);
+ unsigned s = *(int *)(src + i);
p = ((s & 0x7f7f7f7f) + (p & 0x7f7f7f7f)) ^ ((s ^ p) & 0x80808080);
- *(int*)(dst + i) = p;
+ *(int *)(dst + i) = p;
}
} else {
-#define OP_SUB(x,s,l) x+s
+#define OP_SUB(x, s, l) x + s
UNROLL_FILTER(OP_SUB);
}
break;
@@ -240,19 +246,20 @@ static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
break;
case PNG_FILTER_VALUE_AVG:
for (i = 0; i < bpp; i++) {
- p = (last[i] >> 1);
+ p = (last[i] >> 1);
dst[i] = p + src[i];
}
-#define OP_AVG(x,s,l) (((x + l) >> 1) + s) & 0xff
+#define OP_AVG(x, s, l) (((x + l) >> 1) + s) & 0xff
UNROLL_FILTER(OP_AVG);
break;
case PNG_FILTER_VALUE_PAETH:
for (i = 0; i < bpp; i++) {
- p = last[i];
+ p = last[i];
dst[i] = p + src[i];
}
if (bpp > 2 && size > 4) {
- // would write off the end of the array if we let it process the last pixel with bpp=3
+ /* would write off the end of the array if we let it process
+ * the last pixel with bpp=3 */
int w = bpp == 4 ? size : size - 3;
dsp->add_paeth_prediction(dst + i, src + i, last + i, w - i, bpp);
i = w;
@@ -269,9 +276,9 @@ static void deloco_ ## NAME(TYPE *dst, int size, int alpha) \
{ \
int i; \
for (i = 0; i < size; i += 3 + alpha) { \
- int g = dst [i+1]; \
- dst[i+0] += g; \
- dst[i+2] += g; \
+ int g = dst [i + 1]; \
+ dst[i + 0] += g; \
+ dst[i + 2] += g; \
} \
}
@@ -322,12 +329,12 @@ static void png_handle_row(PNGDecContext *s)
ptr = s->image_buf + s->image_linesize * s->y;
if ((ff_png_pass_ymask[s->pass] << (s->y & 7)) & 0x80) {
/* if we already read one row, it is time to stop to
- wait for the next one */
+ * wait for the next one */
if (got_line)
break;
png_filter_row(&s->dsp, s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
s->last_row, s->pass_row_size, s->bpp);
- FFSWAP(uint8_t*, s->last_row, s->tmp_row);
+ FFSWAP(uint8_t *, s->last_row, s->tmp_row);
FFSWAP(unsigned int, s->last_row_size, s->tmp_row_size);
got_line = 1;
}
@@ -346,8 +353,8 @@ static void png_handle_row(PNGDecContext *s)
s->pass++;
s->y = 0;
s->pass_row_size = ff_png_pass_row_size(s->pass,
- s->bits_per_pixel,
- s->width);
+ s->bits_per_pixel,
+ s->width);
s->crow_size = s->pass_row_size + 1;
if (s->pass_row_size != 0)
break;
@@ -356,7 +363,7 @@ static void png_handle_row(PNGDecContext *s)
}
}
}
- the_end: ;
+the_end:;
}
}
@@ -382,7 +389,8 @@ static int png_decode_idat(PNGDecContext *s, int length)
s->zstream.next_out = s->crow_buf;
}
if (ret == Z_STREAM_END && s->zstream.avail_in > 0) {
- av_log(NULL, AV_LOG_WARNING, "%d undecompressed bytes left in buffer\n", s->zstream.avail_in);
+ av_log(NULL, AV_LOG_WARNING,
+ "%d undecompressed bytes left in buffer\n", s->zstream.avail_in);
return 0;
}
}
@@ -509,9 +517,9 @@ static int decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
- PNGDecContext * const s = avctx->priv_data;
- const uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
+ PNGDecContext *const s = avctx->priv_data;
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
AVFrame *p;
AVDictionary *metadata = NULL;
uint32_t tag, length;
@@ -546,6 +554,9 @@ static int decode_frame(AVCodecContext *avctx,
for (;;) {
if (bytestream2_get_bytes_left(&s->gb) <= 0) {
av_log(avctx, AV_LOG_ERROR, "No bytes left\n");
+ if ( s->state & PNG_ALLIMAGE
+ && avctx->strict_std_compliance <= FF_COMPLIANCE_NORMAL)
+ goto exit_loop;
goto fail;
}
@@ -581,7 +592,7 @@ static int decode_frame(AVCodecContext *avctx,
s->state |= PNG_IHDR;
if (avctx->debug & FF_DEBUG_PICT_INFO)
av_log(avctx, AV_LOG_DEBUG, "width=%d height=%d depth=%d color_type=%d "
- "compression_type=%d filter_type=%d interlace_type=%d\n",
+ "compression_type=%d filter_type=%d interlace_type=%d\n",
s->width, s->height, s->bit_depth, s->color_type,
s->compression_type, s->filter_type, s->interlace_type);
break;
@@ -657,10 +668,10 @@ static int decode_frame(AVCodecContext *avctx,
if (!s->interlace_type) {
s->crow_size = s->row_size + 1;
} else {
- s->pass = 0;
+ s->pass = 0;
s->pass_row_size = ff_png_pass_row_size(s->pass,
- s->bits_per_pixel,
- s->width);
+ s->bits_per_pixel,
+ s->width);
s->crow_size = s->pass_row_size + 1;
}
av_dlog(avctx, "row_size=%d crow_size =%d\n",
@@ -696,42 +707,41 @@ static int decode_frame(AVCodecContext *avctx,
bytestream2_skip(&s->gb, 4); /* crc */
break;
case MKTAG('P', 'L', 'T', 'E'):
- {
- int n, i, r, g, b;
-
- if ((length % 3) != 0 || length > 256 * 3)
- goto skip_tag;
- /* read the palette */
- n = length / 3;
- for (i = 0; i < n; i++) {
- r = bytestream2_get_byte(&s->gb);
- g = bytestream2_get_byte(&s->gb);
- b = bytestream2_get_byte(&s->gb);
- s->palette[i] = (0xFFU << 24) | (r << 16) | (g << 8) | b;
- }
- for (; i < 256; i++) {
- s->palette[i] = (0xFFU << 24);
- }
- s->state |= PNG_PLTE;
- bytestream2_skip(&s->gb, 4); /* crc */
+ {
+ int n, i, r, g, b;
+
+ if ((length % 3) != 0 || length > 256 * 3)
+ goto skip_tag;
+ /* read the palette */
+ n = length / 3;
+ for (i = 0; i < n; i++) {
+ r = bytestream2_get_byte(&s->gb);
+ g = bytestream2_get_byte(&s->gb);
+ b = bytestream2_get_byte(&s->gb);
+ s->palette[i] = (0xFFU << 24) | (r << 16) | (g << 8) | b;
}
- break;
+ for (; i < 256; i++)
+ s->palette[i] = (0xFFU << 24);
+ s->state |= PNG_PLTE;
+ bytestream2_skip(&s->gb, 4); /* crc */
+ }
+ break;
case MKTAG('t', 'R', 'N', 'S'):
- {
- int v, i;
-
- /* read the transparency. XXX: Only palette mode supported */
- if (s->color_type != PNG_COLOR_TYPE_PALETTE ||
- length > 256 ||
- !(s->state & PNG_PLTE))
- goto skip_tag;
- for (i = 0; i < length; i++) {
- v = bytestream2_get_byte(&s->gb);
- s->palette[i] = (s->palette[i] & 0x00ffffff) | (v << 24);
- }
- bytestream2_skip(&s->gb, 4); /* crc */
+ {
+ int v, i;
+
+ /* read the transparency. XXX: Only palette mode supported */
+ if (s->color_type != PNG_COLOR_TYPE_PALETTE ||
+ length > 256 ||
+ !(s->state & PNG_PLTE))
+ goto skip_tag;
+ for (i = 0; i < length; i++) {
+ v = bytestream2_get_byte(&s->gb);
+ s->palette[i] = (s->palette[i] & 0x00ffffff) | (v << 24);
}
- break;
+ bytestream2_skip(&s->gb, 4); /* crc */
+ }
+ break;
case MKTAG('t', 'E', 'X', 't'):
if (decode_text_chunk(s, length, 0, &metadata) < 0)
av_log(avctx, AV_LOG_WARNING, "Broken tEXt chunk\n");
@@ -752,12 +762,12 @@ static int decode_frame(AVCodecContext *avctx,
goto exit_loop;
default:
/* skip tag */
- skip_tag:
+skip_tag:
bytestream2_skip(&s->gb, length + 4);
break;
}
}
- exit_loop:
+exit_loop:
if (s->bits_per_pixel == 1 && s->color_type == PNG_COLOR_TYPE_PALETTE){
int i, j, k;
@@ -831,9 +841,9 @@ static int decode_frame(AVCodecContext *avctx,
}
}
- /* handle p-frames only if a predecessor frame is available */
- if (s->last_picture.f->data[0]) {
- if ( !(avpkt->flags & AV_PKT_FLAG_KEY) && avctx->codec_tag != AV_RL32("MPNG")
+ /* handle p-frames only if a predecessor frame is available */
+ if (s->last_picture.f->data[0]) {
+ if ( !(avpkt->flags & AV_PKT_FLAG_KEY) && avctx->codec_tag != AV_RL32("MPNG")
&& s->last_picture.f->width == p->width
&& s->last_picture.f->height== p->height
&& s->last_picture.f->format== p->format
@@ -844,9 +854,8 @@ static int decode_frame(AVCodecContext *avctx,
ff_thread_await_progress(&s->last_picture, INT_MAX, 0);
for (j = 0; j < s->height; j++) {
- for (i = 0; i < s->width * s->bpp; i++) {
+ for (i = 0; i < s->width * s->bpp; i++)
pd[i] += pd_last[i];
- }
pd += s->image_linesize;
pd_last += s->image_linesize;
}
@@ -863,11 +872,11 @@ static int decode_frame(AVCodecContext *avctx,
*got_frame = 1;
ret = bytestream2_tell(&s->gb);
- the_end:
+the_end:
inflateEnd(&s->zstream);
s->crow_buf = NULL;
return ret;
- fail:
+fail:
av_dict_free(&metadata);
ff_thread_report_progress(&s->picture, INT_MAX, 0);
ret = AVERROR_INVALIDDATA;
diff --git a/chromium/third_party/ffmpeg/libavcodec/pngdsp.c b/chromium/third_party/ffmpeg/libavcodec/pngdsp.c
index 5ab1c351b25..d2753163dad 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pngdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pngdsp.c
@@ -25,13 +25,13 @@
#include "pngdsp.h"
// 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size
-#define pb_7f (~0UL/255 * 0x7f)
-#define pb_80 (~0UL/255 * 0x80)
+#define pb_7f (~0UL / 255 * 0x7f)
+#define pb_80 (~0UL / 255 * 0x80)
static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w)
{
long i;
- for (i = 0; i <= w - (int)sizeof(long); i += sizeof(long)) {
+ for (i = 0; i <= w - (int) sizeof(long); i += sizeof(long)) {
long a = *(long *)(src1 + i);
long b = *(long *)(src2 + i);
*(long *)(dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);
@@ -45,5 +45,6 @@ av_cold void ff_pngdsp_init(PNGDSPContext *dsp)
dsp->add_bytes_l2 = add_bytes_l2_c;
dsp->add_paeth_prediction = ff_add_png_paeth_prediction;
- if (ARCH_X86) ff_pngdsp_init_x86(dsp);
+ if (ARCH_X86)
+ ff_pngdsp_init_x86(dsp);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/pngenc.c b/chromium/third_party/ffmpeg/libavcodec/pngenc.c
index bf61be1609e..8d9eaa37dc2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pngenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pngenc.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 "internal.h"
#include "bytestream.h"
@@ -57,11 +58,11 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size,
static const int masks[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
mask = masks[pass];
- switch(bits_per_pixel) {
+ switch (bits_per_pixel) {
case 1:
memset(dst, 0, row_size);
dst_x = 0;
- for(x = 0; x < width; x++) {
+ for (x = 0; x < width; x++) {
j = (x & 7);
if ((mask << j) & 0x80) {
b = (src[x >> 3] >> (7 - j)) & 1;
@@ -74,7 +75,7 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size,
bpp = bits_per_pixel >> 3;
d = dst;
s = src;
- for(x = 0; x < width; x++) {
+ for (x = 0; x < width; x++) {
j = x & 7;
if ((mask << j) & 0x80) {
memcpy(d, s, bpp);
@@ -86,17 +87,18 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size,
}
}
-static void sub_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp)
+static void sub_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top,
+ int w, int bpp)
{
int i;
- for(i = 0; i < w; i++) {
+ for (i = 0; i < w; i++) {
int a, b, c, p, pa, pb, pc;
a = src[i - bpp];
b = top[i];
c = top[i - bpp];
- p = b - c;
+ p = b - c;
pc = a - c;
pa = abs(p);
@@ -113,32 +115,47 @@ static void sub_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, i
}
}
+static void sub_left_prediction(DSPContext *dsp, uint8_t *dst, const uint8_t *src, int bpp, int size)
+{
+ const uint8_t *src1 = src + bpp;
+ const uint8_t *src2 = src;
+ int x, unaligned_w;
+
+ memcpy(dst, src, bpp);
+ dst += bpp;
+ size -= bpp;
+ unaligned_w = FFMIN(32 - bpp, size);
+ for (x = 0; x < unaligned_w; x++)
+ *dst++ = *src1++ - *src2++;
+ size -= unaligned_w;
+ dsp->diff_bytes(dst, src1, src2, size);
+}
+
static void png_filter_row(DSPContext *dsp, uint8_t *dst, int filter_type,
uint8_t *src, uint8_t *top, int size, int bpp)
{
int i;
- switch(filter_type) {
+ switch (filter_type) {
case PNG_FILTER_VALUE_NONE:
memcpy(dst, src, size);
break;
case PNG_FILTER_VALUE_SUB:
- dsp->diff_bytes(dst, src, src-bpp, size);
- memcpy(dst, src, bpp);
+ sub_left_prediction(dsp, dst, src, bpp, size);
break;
case PNG_FILTER_VALUE_UP:
dsp->diff_bytes(dst, src, top, size);
break;
case PNG_FILTER_VALUE_AVG:
- for(i = 0; i < bpp; i++)
+ for (i = 0; i < bpp; i++)
dst[i] = src[i] - (top[i] >> 1);
- for(; i < size; i++)
- dst[i] = src[i] - ((src[i-bpp] + top[i]) >> 1);
+ for (; i < size; i++)
+ dst[i] = src[i] - ((src[i - bpp] + top[i]) >> 1);
break;
case PNG_FILTER_VALUE_PAETH:
- for(i = 0; i < bpp; i++)
+ for (i = 0; i < bpp; i++)
dst[i] = src[i] - top[i];
- sub_png_paeth_prediction(dst+i, src+i, top+i, size-i, bpp);
+ sub_png_paeth_prediction(dst + i, src + i, top + i, size - i, bpp);
break;
}
}
@@ -148,26 +165,26 @@ static uint8_t *png_choose_filter(PNGEncContext *s, uint8_t *dst,
{
int pred = s->filter_type;
av_assert0(bpp || !pred);
- if(!top && pred)
+ if (!top && pred)
pred = PNG_FILTER_VALUE_SUB;
- if(pred == PNG_FILTER_VALUE_MIXED) {
+ if (pred == PNG_FILTER_VALUE_MIXED) {
int i;
int cost, bcost = INT_MAX;
uint8_t *buf1 = dst, *buf2 = dst + size + 16;
- for(pred=0; pred<5; pred++) {
- png_filter_row(&s->dsp, buf1+1, pred, src, top, size, bpp);
+ for (pred = 0; pred < 5; pred++) {
+ png_filter_row(&s->dsp, buf1 + 1, pred, src, top, size, bpp);
buf1[0] = pred;
cost = 0;
- for(i=0; i<=size; i++)
- cost += abs((int8_t)buf1[i]);
- if(cost < bcost) {
+ for (i = 0; i <= size; i++)
+ cost += abs((int8_t) buf1[i]);
+ if (cost < bcost) {
bcost = cost;
- FFSWAP(uint8_t*, buf1, buf2);
+ FFSWAP(uint8_t *, buf1, buf2);
}
}
return buf2;
} else {
- png_filter_row(&s->dsp, dst+1, pred, src, top, size, bpp);
+ png_filter_row(&s->dsp, dst + 1, pred, src, top, size, bpp);
dst[0] = pred;
return dst;
}
@@ -198,16 +215,17 @@ static int png_write_row(PNGEncContext *s, const uint8_t *data, int size)
int ret;
s->zstream.avail_in = size;
- s->zstream.next_in = (uint8_t *)data;
+ s->zstream.next_in = (uint8_t *)data;
while (s->zstream.avail_in > 0) {
ret = deflate(&s->zstream, Z_NO_FLUSH);
if (ret != Z_OK)
return -1;
if (s->zstream.avail_out == 0) {
- if(s->bytestream_end - s->bytestream > IOBUF_SIZE + 100)
- png_write_chunk(&s->bytestream, MKTAG('I', 'D', 'A', 'T'), s->buf, IOBUF_SIZE);
+ if (s->bytestream_end - s->bytestream > IOBUF_SIZE + 100)
+ png_write_chunk(&s->bytestream,
+ MKTAG('I', 'D', 'A', 'T'), s->buf, IOBUF_SIZE);
s->zstream.avail_out = IOBUF_SIZE;
- s->zstream.next_out = s->buf;
+ s->zstream.next_out = s->buf;
}
}
return 0;
@@ -216,19 +234,19 @@ static int png_write_row(PNGEncContext *s, const uint8_t *data, int size)
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
- PNGEncContext *s = avctx->priv_data;
- const AVFrame * const p = pict;
+ PNGEncContext *s = avctx->priv_data;
+ const AVFrame *const p = pict;
int bit_depth, color_type, y, len, row_size, ret, is_progressive;
int bits_per_pixel, pass_row_size, enc_row_size;
int64_t max_packet_size;
int compression_level;
- uint8_t *ptr, *top;
- uint8_t *crow_base = NULL, *crow_buf, *crow;
+ uint8_t *ptr, *top, *crow_buf, *crow;
+ uint8_t *crow_base = NULL;
uint8_t *progressive_buf = NULL;
- uint8_t *top_buf = NULL;
+ uint8_t *top_buf = NULL;
is_progressive = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
- switch(avctx->pix_fmt) {
+ switch (avctx->pix_fmt) {
case AV_PIX_FMT_RGBA64BE:
bit_depth = 16;
color_type = PNG_COLOR_TYPE_RGB_ALPHA;
@@ -238,19 +256,19 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
color_type = PNG_COLOR_TYPE_RGB;
break;
case AV_PIX_FMT_RGBA:
- bit_depth = 8;
+ bit_depth = 8;
color_type = PNG_COLOR_TYPE_RGB_ALPHA;
break;
case AV_PIX_FMT_RGB24:
- bit_depth = 8;
+ bit_depth = 8;
color_type = PNG_COLOR_TYPE_RGB;
break;
case AV_PIX_FMT_GRAY16BE:
- bit_depth = 16;
+ bit_depth = 16;
color_type = PNG_COLOR_TYPE_GRAY;
break;
case AV_PIX_FMT_GRAY8:
- bit_depth = 8;
+ bit_depth = 8;
color_type = PNG_COLOR_TYPE_GRAY;
break;
case AV_PIX_FMT_GRAY8A:
@@ -258,25 +276,25 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
break;
case AV_PIX_FMT_MONOBLACK:
- bit_depth = 1;
+ bit_depth = 1;
color_type = PNG_COLOR_TYPE_GRAY;
break;
case AV_PIX_FMT_PAL8:
- bit_depth = 8;
+ bit_depth = 8;
color_type = PNG_COLOR_TYPE_PALETTE;
break;
default:
return -1;
}
bits_per_pixel = ff_png_get_nb_channels(color_type) * bit_depth;
- row_size = (avctx->width * bits_per_pixel + 7) >> 3;
+ row_size = (avctx->width * bits_per_pixel + 7) >> 3;
s->zstream.zalloc = ff_png_zalloc;
- s->zstream.zfree = ff_png_zfree;
+ s->zstream.zfree = ff_png_zfree;
s->zstream.opaque = NULL;
- compression_level = avctx->compression_level == FF_COMPRESSION_DEFAULT ?
- Z_DEFAULT_COMPRESSION :
- av_clip(avctx->compression_level, 0, 9);
+ compression_level = avctx->compression_level == FF_COMPRESSION_DEFAULT
+ ? Z_DEFAULT_COMPRESSION
+ : av_clip(avctx->compression_level, 0, 9);
ret = deflateInit2(&s->zstream, compression_level,
Z_DEFLATED, 15, 8, Z_DEFAULT_STRATEGY);
if (ret != Z_OK)
@@ -298,7 +316,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
crow_base = av_malloc((row_size + 32) << (s->filter_type == PNG_FILTER_VALUE_MIXED));
if (!crow_base)
goto fail;
- crow_buf = crow_base + 15; // pixel data should be aligned, but there's a control byte before it
+ // pixel data should be aligned, but there's a control byte before it
+ crow_buf = crow_base + 15;
if (is_progressive) {
progressive_buf = av_malloc(row_size + 1);
if (!progressive_buf)
@@ -316,8 +335,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
AV_WB32(s->buf, avctx->width);
AV_WB32(s->buf + 4, avctx->height);
- s->buf[8] = bit_depth;
- s->buf[9] = color_type;
+ s->buf[8] = bit_depth;
+ s->buf[9] = color_type;
s->buf[10] = 0; /* compression type */
s->buf[11] = 0; /* filter type */
s->buf[12] = is_progressive; /* interlace type */
@@ -342,61 +361,64 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint32_t *palette;
uint8_t *alpha_ptr;
- palette = (uint32_t *)p->data[1];
- ptr = s->buf;
+ palette = (uint32_t *)p->data[1];
+ ptr = s->buf;
alpha_ptr = s->buf + 256 * 3;
has_alpha = 0;
- for(i = 0; i < 256; i++) {
- v = palette[i];
+ for (i = 0; i < 256; i++) {
+ v = palette[i];
alpha = v >> 24;
if (alpha != 0xff)
has_alpha = 1;
*alpha_ptr++ = alpha;
bytestream_put_be24(&ptr, v);
}
- png_write_chunk(&s->bytestream, MKTAG('P', 'L', 'T', 'E'), s->buf, 256 * 3);
+ png_write_chunk(&s->bytestream,
+ MKTAG('P', 'L', 'T', 'E'), s->buf, 256 * 3);
if (has_alpha) {
- png_write_chunk(&s->bytestream, MKTAG('t', 'R', 'N', 'S'), s->buf + 256 * 3, 256);
+ png_write_chunk(&s->bytestream,
+ MKTAG('t', 'R', 'N', 'S'), s->buf + 256 * 3, 256);
}
}
/* now put each row */
s->zstream.avail_out = IOBUF_SIZE;
- s->zstream.next_out = s->buf;
+ s->zstream.next_out = s->buf;
if (is_progressive) {
int pass;
- for(pass = 0; pass < NB_PASSES; pass++) {
+ for (pass = 0; pass < NB_PASSES; pass++) {
/* NOTE: a pass is completely omitted if no pixels would be
- output */
+ * output */
pass_row_size = ff_png_pass_row_size(pass, bits_per_pixel, avctx->width);
if (pass_row_size > 0) {
top = NULL;
- for(y = 0; y < avctx->height; y++) {
+ for (y = 0; y < avctx->height; y++)
if ((ff_png_pass_ymask[pass] << (y & 7)) & 0x80) {
ptr = p->data[0] + y * p->linesize[0];
- FFSWAP(uint8_t*, progressive_buf, top_buf);
+ FFSWAP(uint8_t *, progressive_buf, top_buf);
png_get_interlaced_row(progressive_buf, pass_row_size,
bits_per_pixel, pass,
ptr, avctx->width);
- crow = png_choose_filter(s, crow_buf, progressive_buf, top, pass_row_size, bits_per_pixel>>3);
+ crow = png_choose_filter(s, crow_buf, progressive_buf,
+ top, pass_row_size, bits_per_pixel >> 3);
png_write_row(s, crow, pass_row_size + 1);
top = progressive_buf;
}
- }
}
}
} else {
top = NULL;
- for(y = 0; y < avctx->height; y++) {
+ for (y = 0; y < avctx->height; y++) {
ptr = p->data[0] + y * p->linesize[0];
- crow = png_choose_filter(s, crow_buf, ptr, top, row_size, bits_per_pixel>>3);
+ crow = png_choose_filter(s, crow_buf, ptr, top,
+ row_size, bits_per_pixel >> 3);
png_write_row(s, crow, row_size + 1);
top = ptr;
}
}
/* compress last bytes */
- for(;;) {
+ for (;;) {
ret = deflate(&s->zstream, Z_FINISH);
if (ret == Z_OK || ret == Z_STREAM_END) {
len = IOBUF_SIZE - s->zstream.avail_out;
@@ -404,7 +426,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
png_write_chunk(&s->bytestream, MKTAG('I', 'D', 'A', 'T'), s->buf, len);
}
s->zstream.avail_out = IOBUF_SIZE;
- s->zstream.next_out = s->buf;
+ s->zstream.next_out = s->buf;
if (ret == Z_STREAM_END)
break;
} else {
@@ -418,21 +440,22 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
*got_packet = 1;
ret = 0;
- the_end:
+the_end:
av_free(crow_base);
av_free(progressive_buf);
av_free(top_buf);
deflateEnd(&s->zstream);
return ret;
- fail:
+fail:
ret = -1;
goto the_end;
}
-static av_cold int png_enc_init(AVCodecContext *avctx){
+static av_cold int png_enc_init(AVCodecContext *avctx)
+{
PNGEncContext *s = avctx->priv_data;
- switch(avctx->pix_fmt) {
+ switch (avctx->pix_fmt) {
case AV_PIX_FMT_RGBA:
avctx->bits_per_coded_sample = 32;
break;
@@ -458,8 +481,10 @@ static av_cold int png_enc_init(AVCodecContext *avctx){
ff_dsputil_init(&s->dsp, avctx);
- s->filter_type = av_clip(avctx->prediction_method, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_MIXED);
- if(avctx->pix_fmt == AV_PIX_FMT_MONOBLACK)
+ s->filter_type = av_clip(avctx->prediction_method,
+ PNG_FILTER_VALUE_NONE,
+ PNG_FILTER_VALUE_MIXED);
+ if (avctx->pix_fmt == AV_PIX_FMT_MONOBLACK)
s->filter_type = PNG_FILTER_VALUE_NONE;
if (s->dpi && s->dpm) {
@@ -503,7 +528,7 @@ AVCodec ff_png_encoder = {
.close = png_enc_close,
.encode2 = encode_frame,
.capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
- .pix_fmts = (const enum AVPixelFormat[]){
+ .pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE,
AV_PIX_FMT_PAL8,
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/Makefile b/chromium/third_party/ffmpeg/libavcodec/ppc/Makefile
index 71b23da10ea..80ed14bb190 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/Makefile
@@ -1,7 +1,6 @@
-OBJS += ppc/dsputil_ppc.o \
- ppc/fmtconvert_altivec.o \
- ppc/videodsp_ppc.o \
+OBJS += ppc/fmtconvert_altivec.o \
+OBJS-$(CONFIG_DSPUTIL) += ppc/dsputil_ppc.o
OBJS-$(CONFIG_FFT) += ppc/fft_altivec.o
OBJS-$(CONFIG_H264CHROMA) += ppc/h264chroma_init.o
OBJS-$(CONFIG_H264DSP) += ppc/h264dsp.o
@@ -9,12 +8,15 @@ OBJS-$(CONFIG_H264QPEL) += ppc/h264qpel.o
OBJS-$(CONFIG_HPELDSP) += ppc/hpeldsp_altivec.o
OBJS-$(CONFIG_MPEGAUDIODSP) += ppc/mpegaudiodsp_altivec.o
OBJS-$(CONFIG_MPEGVIDEO) += ppc/mpegvideo_altivec.o
+OBJS-$(CONFIG_VIDEODSP) += ppc/videodsp_ppc.o
+OBJS-$(CONFIG_VP3DSP) += ppc/vp3dsp_altivec.o
+
OBJS-$(CONFIG_VC1_DECODER) += ppc/vc1dsp_altivec.o
OBJS-$(CONFIG_VORBIS_DECODER) += ppc/vorbisdsp_altivec.o
-OBJS-$(CONFIG_VP3DSP) += ppc/vp3dsp_altivec.o
+OBJS-$(CONFIG_VP7_DECODER) += ppc/vp8dsp_altivec.o
OBJS-$(CONFIG_VP8_DECODER) += ppc/vp8dsp_altivec.o
-ALTIVEC-OBJS += ppc/dsputil_altivec.o \
+ALTIVEC-OBJS-$(CONFIG_DSPUTIL) += ppc/dsputil_altivec.o \
ppc/fdct_altivec.o \
ppc/gmc_altivec.o \
ppc/idct_altivec.o \
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_altivec.c
index f36e394fb22..cb6f1e13294 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_altivec.c
@@ -24,49 +24,50 @@
#if HAVE_ALTIVEC_H
#include <altivec.h>
#endif
+
#include "libavutil/attributes.h"
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
+#include "libavcodec/mpegvideo.h"
#include "dsputil_altivec.h"
-static int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int sad16_x2_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int i;
- int s;
- const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
+ int i, s = 0;
+ const vector unsigned char zero =
+ (const vector unsigned char) vec_splat_u8(0);
vector unsigned char perm1 = vec_lvsl(0, pix2);
vector unsigned char perm2 = vec_add(perm1, vec_splat_u8(1));
- vector unsigned char pix2l, pix2r;
- vector unsigned char pix1v, pix2v, pix2iv, avgv, t5;
- vector unsigned int sad;
+ vector unsigned int sad = (vector unsigned int) vec_splat_u32(0);
vector signed int sumdiffs;
- s = 0;
- sad = (vector unsigned int)vec_splat_u32(0);
for (i = 0; i < h; i++) {
/* Read unaligned pixels into our vectors. The vectors are as follows:
- pix1v: pix1[0]-pix1[15]
- pix2v: pix2[0]-pix2[15] pix2iv: pix2[1]-pix2[16] */
- pix1v = vec_ld( 0, pix1);
- pix2l = vec_ld( 0, pix2);
- pix2r = vec_ld(16, pix2);
- pix2v = vec_perm(pix2l, pix2r, perm1);
- pix2iv = vec_perm(pix2l, pix2r, perm2);
-
- /* Calculate the average vector */
- avgv = vec_avg(pix2v, pix2iv);
-
- /* Calculate a sum of abs differences vector */
- t5 = vec_sub(vec_max(pix1v, avgv), vec_min(pix1v, avgv));
-
- /* Add each 4 pixel group together and put 4 results into sad */
+ * pix1v: pix1[0] - pix1[15]
+ * pix2v: pix2[0] - pix2[15] pix2iv: pix2[1] - pix2[16] */
+ vector unsigned char pix1v = vec_ld(0, pix1);
+ vector unsigned char pix2l = vec_ld(0, pix2);
+ vector unsigned char pix2r = vec_ld(16, pix2);
+ vector unsigned char pix2v = vec_perm(pix2l, pix2r, perm1);
+ vector unsigned char pix2iv = vec_perm(pix2l, pix2r, perm2);
+
+ /* Calculate the average vector. */
+ vector unsigned char avgv = vec_avg(pix2v, pix2iv);
+
+ /* Calculate a sum of abs differences vector. */
+ vector unsigned char t5 = vec_sub(vec_max(pix1v, avgv),
+ vec_min(pix1v, avgv));
+
+ /* Add each 4 pixel group together and put 4 results into sad. */
sad = vec_sum4s(t5, sad);
pix1 += line_size;
pix2 += line_size;
}
- /* Sum up the four partial sums, and put the result into s */
+ /* Sum up the four partial sums, and put the result into s. */
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
sumdiffs = vec_splat(sumdiffs, 3);
vec_ste(sumdiffs, 0, &s);
@@ -74,152 +75,148 @@ static int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size
return s;
}
-static int sad16_y2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int sad16_y2_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int i;
- int s;
- const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
+ int i, s = 0;
+ const vector unsigned char zero =
+ (const vector unsigned char) vec_splat_u8(0);
vector unsigned char perm = vec_lvsl(0, pix2);
- vector unsigned char pix2l, pix2r;
- vector unsigned char pix1v, pix2v, pix3v, avgv, t5;
- vector unsigned int sad;
+ vector unsigned char pix1v, pix3v, avgv, t5;
+ vector unsigned int sad = (vector unsigned int) vec_splat_u32(0);
vector signed int sumdiffs;
uint8_t *pix3 = pix2 + line_size;
- s = 0;
- sad = (vector unsigned int)vec_splat_u32(0);
-
/* Due to the fact that pix3 = pix2 + line_size, the pix3 of one
- iteration becomes pix2 in the next iteration. We can use this
- fact to avoid a potentially expensive unaligned read, each
- time around the loop.
- Read unaligned pixels into our vectors. The vectors are as follows:
- pix2v: pix2[0]-pix2[15]
- Split the pixel vectors into shorts */
- pix2l = vec_ld( 0, pix2);
- pix2r = vec_ld(15, pix2);
- pix2v = vec_perm(pix2l, pix2r, perm);
+ * iteration becomes pix2 in the next iteration. We can use this
+ * fact to avoid a potentially expensive unaligned read, each
+ * time around the loop.
+ * Read unaligned pixels into our vectors. The vectors are as follows:
+ * pix2v: pix2[0] - pix2[15]
+ * Split the pixel vectors into shorts. */
+ vector unsigned char pix2l = vec_ld(0, pix2);
+ vector unsigned char pix2r = vec_ld(15, pix2);
+ vector unsigned char pix2v = vec_perm(pix2l, pix2r, perm);
for (i = 0; i < h; i++) {
/* Read unaligned pixels into our vectors. The vectors are as follows:
- pix1v: pix1[0]-pix1[15]
- pix3v: pix3[0]-pix3[15] */
- pix1v = vec_ld(0, pix1);
+ * pix1v: pix1[0] - pix1[15]
+ * pix3v: pix3[0] - pix3[15] */
+ pix1v = vec_ld(0, pix1);
- pix2l = vec_ld( 0, pix3);
+ pix2l = vec_ld(0, pix3);
pix2r = vec_ld(15, pix3);
pix3v = vec_perm(pix2l, pix2r, perm);
- /* Calculate the average vector */
+ /* Calculate the average vector. */
avgv = vec_avg(pix2v, pix3v);
- /* Calculate a sum of abs differences vector */
+ /* Calculate a sum of abs differences vector. */
t5 = vec_sub(vec_max(pix1v, avgv), vec_min(pix1v, avgv));
- /* Add each 4 pixel group together and put 4 results into sad */
+ /* Add each 4 pixel group together and put 4 results into sad. */
sad = vec_sum4s(t5, sad);
pix1 += line_size;
pix2v = pix3v;
pix3 += line_size;
-
}
- /* Sum up the four partial sums, and put the result into s */
+ /* Sum up the four partial sums, and put the result into s. */
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
sumdiffs = vec_splat(sumdiffs, 3);
vec_ste(sumdiffs, 0, &s);
return s;
}
-static int sad16_xy2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int sad16_xy2_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int i;
- int s;
+ int i, s = 0;
uint8_t *pix3 = pix2 + line_size;
- const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
- const vector unsigned short two = (const vector unsigned short)vec_splat_u16(2);
+ const vector unsigned char zero =
+ (const vector unsigned char) vec_splat_u8(0);
+ const vector unsigned short two =
+ (const vector unsigned short) vec_splat_u16(2);
vector unsigned char avgv, t5;
vector unsigned char perm1 = vec_lvsl(0, pix2);
vector unsigned char perm2 = vec_add(perm1, vec_splat_u8(1));
- vector unsigned char pix2l, pix2r;
- vector unsigned char pix1v, pix2v, pix3v, pix2iv, pix3iv;
- vector unsigned short pix2lv, pix2hv, pix2ilv, pix2ihv;
+ vector unsigned char pix1v, pix3v, pix3iv;
vector unsigned short pix3lv, pix3hv, pix3ilv, pix3ihv;
vector unsigned short avghv, avglv;
- vector unsigned short t1, t2, t3, t4;
- vector unsigned int sad;
+ vector unsigned int sad = (vector unsigned int) vec_splat_u32(0);
vector signed int sumdiffs;
- sad = (vector unsigned int)vec_splat_u32(0);
-
- s = 0;
-
/* Due to the fact that pix3 = pix2 + line_size, the pix3 of one
- iteration becomes pix2 in the next iteration. We can use this
- fact to avoid a potentially expensive unaligned read, as well
- as some splitting, and vector addition each time around the loop.
- Read unaligned pixels into our vectors. The vectors are as follows:
- pix2v: pix2[0]-pix2[15] pix2iv: pix2[1]-pix2[16]
- Split the pixel vectors into shorts */
- pix2l = vec_ld( 0, pix2);
- pix2r = vec_ld(16, pix2);
- pix2v = vec_perm(pix2l, pix2r, perm1);
- pix2iv = vec_perm(pix2l, pix2r, perm2);
-
- pix2hv = (vector unsigned short) vec_mergeh(zero, pix2v);
- pix2lv = (vector unsigned short) vec_mergel(zero, pix2v);
- pix2ihv = (vector unsigned short) vec_mergeh(zero, pix2iv);
- pix2ilv = (vector unsigned short) vec_mergel(zero, pix2iv);
- t1 = vec_add(pix2hv, pix2ihv);
- t2 = vec_add(pix2lv, pix2ilv);
+ * iteration becomes pix2 in the next iteration. We can use this
+ * fact to avoid a potentially expensive unaligned read, as well
+ * as some splitting, and vector addition each time around the loop.
+ * Read unaligned pixels into our vectors. The vectors are as follows:
+ * pix2v: pix2[0] - pix2[15] pix2iv: pix2[1] - pix2[16]
+ * Split the pixel vectors into shorts. */
+ vector unsigned char pix2l = vec_ld(0, pix2);
+ vector unsigned char pix2r = vec_ld(16, pix2);
+ vector unsigned char pix2v = vec_perm(pix2l, pix2r, perm1);
+ vector unsigned char pix2iv = vec_perm(pix2l, pix2r, perm2);
+
+ vector unsigned short pix2hv =
+ (vector unsigned short) vec_mergeh(zero, pix2v);
+ vector unsigned short pix2lv =
+ (vector unsigned short) vec_mergel(zero, pix2v);
+ vector unsigned short pix2ihv =
+ (vector unsigned short) vec_mergeh(zero, pix2iv);
+ vector unsigned short pix2ilv =
+ (vector unsigned short) vec_mergel(zero, pix2iv);
+ vector unsigned short t1 = vec_add(pix2hv, pix2ihv);
+ vector unsigned short t2 = vec_add(pix2lv, pix2ilv);
+ vector unsigned short t3, t4;
for (i = 0; i < h; i++) {
/* Read unaligned pixels into our vectors. The vectors are as follows:
- pix1v: pix1[0]-pix1[15]
- pix3v: pix3[0]-pix3[15] pix3iv: pix3[1]-pix3[16] */
- pix1v = vec_ld(0, pix1);
+ * pix1v: pix1[0] - pix1[15]
+ * pix3v: pix3[0] - pix3[15] pix3iv: pix3[1] - pix3[16] */
+ pix1v = vec_ld(0, pix1);
- pix2l = vec_ld( 0, pix3);
+ pix2l = vec_ld(0, pix3);
pix2r = vec_ld(16, pix3);
pix3v = vec_perm(pix2l, pix2r, perm1);
pix3iv = vec_perm(pix2l, pix2r, perm2);
/* Note that AltiVec does have vec_avg, but this works on vector pairs
- and rounds up. We could do avg(avg(a,b),avg(c,d)), but the rounding
- would mean that, for example, avg(3,0,0,1) = 2, when it should be 1.
- Instead, we have to split the pixel vectors into vectors of shorts,
- and do the averaging by hand. */
+ * and rounds up. We could do avg(avg(a, b), avg(c, d)), but the
+ * rounding would mean that, for example, avg(3, 0, 0, 1) = 2, when
+ * it should be 1. Instead, we have to split the pixel vectors into
+ * vectors of shorts and do the averaging by hand. */
- /* Split the pixel vectors into shorts */
+ /* Split the pixel vectors into shorts. */
pix3hv = (vector unsigned short) vec_mergeh(zero, pix3v);
pix3lv = (vector unsigned short) vec_mergel(zero, pix3v);
pix3ihv = (vector unsigned short) vec_mergeh(zero, pix3iv);
pix3ilv = (vector unsigned short) vec_mergel(zero, pix3iv);
- /* Do the averaging on them */
+ /* Do the averaging on them. */
t3 = vec_add(pix3hv, pix3ihv);
t4 = vec_add(pix3lv, pix3ilv);
avghv = vec_sr(vec_add(vec_add(t1, t3), two), two);
avglv = vec_sr(vec_add(vec_add(t2, t4), two), two);
- /* Pack the shorts back into a result */
+ /* Pack the shorts back into a result. */
avgv = vec_pack(avghv, avglv);
- /* Calculate a sum of abs differences vector */
+ /* Calculate a sum of abs differences vector. */
t5 = vec_sub(vec_max(pix1v, avgv), vec_min(pix1v, avgv));
- /* Add each 4 pixel group together and put 4 results into sad */
+ /* Add each 4 pixel group together and put 4 results into sad. */
sad = vec_sum4s(t5, sad);
pix1 += line_size;
pix3 += line_size;
- /* Transfer the calculated values for pix3 into pix2 */
+ /* Transfer the calculated values for pix3 into pix2. */
t1 = t3;
t2 = t4;
}
- /* Sum up the four partial sums, and put the result into s */
+ /* Sum up the four partial sums, and put the result into s. */
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
sumdiffs = vec_splat(sumdiffs, 3);
vec_ste(sumdiffs, 0, &s);
@@ -227,39 +224,36 @@ static int sad16_xy2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_siz
return s;
}
-static int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int sad16_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int i;
- int s;
- const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
+ int i, s;
+ const vector unsigned int zero =
+ (const vector unsigned int) vec_splat_u32(0);
vector unsigned char perm = vec_lvsl(0, pix2);
- vector unsigned char t1, t2, t3,t4, t5;
- vector unsigned int sad;
+ vector unsigned int sad = (vector unsigned int) vec_splat_u32(0);
vector signed int sumdiffs;
- sad = (vector unsigned int)vec_splat_u32(0);
-
-
for (i = 0; i < h; i++) {
- /* Read potentially unaligned pixels into t1 and t2 */
- vector unsigned char pix2l = vec_ld( 0, pix2);
+ /* Read potentially unaligned pixels into t1 and t2. */
+ vector unsigned char pix2l = vec_ld(0, pix2);
vector unsigned char pix2r = vec_ld(15, pix2);
- t1 = vec_ld(0, pix1);
- t2 = vec_perm(pix2l, pix2r, perm);
+ vector unsigned char t1 = vec_ld(0, pix1);
+ vector unsigned char t2 = vec_perm(pix2l, pix2r, perm);
- /* Calculate a sum of abs differences vector */
- t3 = vec_max(t1, t2);
- t4 = vec_min(t1, t2);
- t5 = vec_sub(t3, t4);
+ /* Calculate a sum of abs differences vector. */
+ vector unsigned char t3 = vec_max(t1, t2);
+ vector unsigned char t4 = vec_min(t1, t2);
+ vector unsigned char t5 = vec_sub(t3, t4);
- /* Add each 4 pixel group together and put 4 results into sad */
+ /* Add each 4 pixel group together and put 4 results into sad. */
sad = vec_sum4s(t5, sad);
pix1 += line_size;
pix2 += line_size;
}
- /* Sum up the four partial sums, and put the result into s */
+ /* Sum up the four partial sums, and put the result into s. */
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
sumdiffs = vec_splat(sumdiffs, 3);
vec_ste(sumdiffs, 0, &s);
@@ -267,44 +261,46 @@ static int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, i
return s;
}
-static int sad8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int sad8_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int i;
- int s;
- const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
- const vector unsigned char permclear = (vector unsigned char){255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0};
+ int i, s;
+ const vector unsigned int zero =
+ (const vector unsigned int) vec_splat_u32(0);
+ const vector unsigned char permclear =
+ (vector unsigned char)
+ { 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0 };
vector unsigned char perm1 = vec_lvsl(0, pix1);
vector unsigned char perm2 = vec_lvsl(0, pix2);
- vector unsigned char t1, t2, t3,t4, t5;
- vector unsigned int sad;
+ vector unsigned int sad = (vector unsigned int) vec_splat_u32(0);
vector signed int sumdiffs;
- sad = (vector unsigned int)vec_splat_u32(0);
-
for (i = 0; i < h; i++) {
- /* Read potentially unaligned pixels into t1 and t2
- Since we're reading 16 pixels, and actually only want 8,
- mask out the last 8 pixels. The 0s don't change the sum. */
- vector unsigned char pix1l = vec_ld( 0, pix1);
- vector unsigned char pix1r = vec_ld(15, pix1);
- vector unsigned char pix2l = vec_ld( 0, pix2);
- vector unsigned char pix2r = vec_ld(15, pix2);
- t1 = vec_and(vec_perm(pix1l, pix1r, perm1), permclear);
- t2 = vec_and(vec_perm(pix2l, pix2r, perm2), permclear);
-
- /* Calculate a sum of abs differences vector */
- t3 = vec_max(t1, t2);
- t4 = vec_min(t1, t2);
- t5 = vec_sub(t3, t4);
-
- /* Add each 4 pixel group together and put 4 results into sad */
+ /* Read potentially unaligned pixels into t1 and t2.
+ * Since we're reading 16 pixels, and actually only want 8,
+ * mask out the last 8 pixels. The 0s don't change the sum. */
+ vector unsigned char pix1l = vec_ld(0, pix1);
+ vector unsigned char pix1r = vec_ld(7, pix1);
+ vector unsigned char pix2l = vec_ld(0, pix2);
+ vector unsigned char pix2r = vec_ld(7, pix2);
+ vector unsigned char t1 = vec_and(vec_perm(pix1l, pix1r, perm1),
+ permclear);
+ vector unsigned char t2 = vec_and(vec_perm(pix2l, pix2r, perm2),
+ permclear);
+
+ /* Calculate a sum of abs differences vector. */
+ vector unsigned char t3 = vec_max(t1, t2);
+ vector unsigned char t4 = vec_min(t1, t2);
+ vector unsigned char t5 = vec_sub(t3, t4);
+
+ /* Add each 4 pixel group together and put 4 results into sad. */
sad = vec_sum4s(t5, sad);
pix1 += line_size;
pix2 += line_size;
}
- /* Sum up the four partial sums, and put the result into s */
+ /* Sum up the four partial sums, and put the result into s. */
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
sumdiffs = vec_splat(sumdiffs, 3);
vec_ste(sumdiffs, 0, &s);
@@ -314,29 +310,25 @@ static int sad8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, in
static int pix_norm1_altivec(uint8_t *pix, int line_size)
{
- int i;
- int s;
- const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
+ int i, s = 0;
+ const vector unsigned int zero =
+ (const vector unsigned int) vec_splat_u32(0);
vector unsigned char perm = vec_lvsl(0, pix);
- vector unsigned char pixv;
- vector unsigned int sv;
+ vector unsigned int sv = (vector unsigned int) vec_splat_u32(0);
vector signed int sum;
- sv = (vector unsigned int)vec_splat_u32(0);
-
- s = 0;
for (i = 0; i < 16; i++) {
- /* Read in the potentially unaligned pixels */
- vector unsigned char pixl = vec_ld( 0, pix);
+ /* Read the potentially unaligned pixels. */
+ vector unsigned char pixl = vec_ld(0, pix);
vector unsigned char pixr = vec_ld(15, pix);
- pixv = vec_perm(pixl, pixr, perm);
+ vector unsigned char pixv = vec_perm(pixl, pixr, perm);
- /* Square the values, and add them to our sum */
+ /* Square the values, and add them to our sum. */
sv = vec_msum(pixv, pixv, sv);
pix += line_size;
}
- /* Sum up the four partial sums, and put the result into s */
+ /* Sum up the four partial sums, and put the result into s. */
sum = vec_sums((vector signed int) sv, (vector signed int) zero);
sum = vec_splat(sum, 3);
vec_ste(sum, 0, &s);
@@ -344,52 +336,51 @@ static int pix_norm1_altivec(uint8_t *pix, int line_size)
return s;
}
-/**
- * Sum of Squared Errors for a 8x8 block.
- * AltiVec-enhanced.
- * It's the sad8_altivec code above w/ squaring added.
- */
-static int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+/* Sum of Squared Errors for an 8x8 block, AltiVec-enhanced.
+ * It's the sad8_altivec code above w/ squaring added. */
+static int sse8_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int i;
- int s;
- const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
- const vector unsigned char permclear = (vector unsigned char){255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0};
+ int i, s;
+ const vector unsigned int zero =
+ (const vector unsigned int) vec_splat_u32(0);
+ const vector unsigned char permclear =
+ (vector unsigned char)
+ { 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0 };
vector unsigned char perm1 = vec_lvsl(0, pix1);
vector unsigned char perm2 = vec_lvsl(0, pix2);
- vector unsigned char t1, t2, t3,t4, t5;
- vector unsigned int sum;
+ vector unsigned int sum = (vector unsigned int) vec_splat_u32(0);
vector signed int sumsqr;
- sum = (vector unsigned int)vec_splat_u32(0);
-
for (i = 0; i < h; i++) {
- /* Read potentially unaligned pixels into t1 and t2
- Since we're reading 16 pixels, and actually only want 8,
- mask out the last 8 pixels. The 0s don't change the sum. */
- vector unsigned char pix1l = vec_ld( 0, pix1);
- vector unsigned char pix1r = vec_ld(15, pix1);
- vector unsigned char pix2l = vec_ld( 0, pix2);
- vector unsigned char pix2r = vec_ld(15, pix2);
- t1 = vec_and(vec_perm(pix1l, pix1r, perm1), permclear);
- t2 = vec_and(vec_perm(pix2l, pix2r, perm2), permclear);
+ /* Read potentially unaligned pixels into t1 and t2.
+ * Since we're reading 16 pixels, and actually only want 8,
+ * mask out the last 8 pixels. The 0s don't change the sum. */
+ vector unsigned char pix1l = vec_ld(0, pix1);
+ vector unsigned char pix1r = vec_ld(7, pix1);
+ vector unsigned char pix2l = vec_ld(0, pix2);
+ vector unsigned char pix2r = vec_ld(7, pix2);
+ vector unsigned char t1 = vec_and(vec_perm(pix1l, pix1r, perm1),
+ permclear);
+ vector unsigned char t2 = vec_and(vec_perm(pix2l, pix2r, perm2),
+ permclear);
/* Since we want to use unsigned chars, we can take advantage
- of the fact that abs(a-b)^2 = (a-b)^2. */
+ * of the fact that abs(a - b) ^ 2 = (a - b) ^ 2. */
- /* Calculate abs differences vector */
- t3 = vec_max(t1, t2);
- t4 = vec_min(t1, t2);
- t5 = vec_sub(t3, t4);
+ /* Calculate abs differences vector. */
+ vector unsigned char t3 = vec_max(t1, t2);
+ vector unsigned char t4 = vec_min(t1, t2);
+ vector unsigned char t5 = vec_sub(t3, t4);
- /* Square the values and add them to our sum */
+ /* Square the values and add them to our sum. */
sum = vec_msum(t5, t5, sum);
pix1 += line_size;
pix2 += line_size;
}
- /* Sum up the four partial sums, and put the result into s */
+ /* Sum up the four partial sums, and put the result into s. */
sumsqr = vec_sums((vector signed int) sum, (vector signed int) zero);
sumsqr = vec_splat(sumsqr, 3);
vec_ste(sumsqr, 0, &s);
@@ -397,46 +388,41 @@ static int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, in
return s;
}
-/**
- * Sum of Squared Errors for a 16x16 block.
- * AltiVec-enhanced.
- * It's the sad16_altivec code above w/ squaring added.
- */
-static int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+/* Sum of Squared Errors for a 16x16 block, AltiVec-enhanced.
+ * It's the sad16_altivec code above w/ squaring added. */
+static int sse16_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
{
- int i;
- int s;
- const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
+ int i, s;
+ const vector unsigned int zero =
+ (const vector unsigned int) vec_splat_u32(0);
vector unsigned char perm = vec_lvsl(0, pix2);
- vector unsigned char t1, t2, t3,t4, t5;
- vector unsigned int sum;
+ vector unsigned int sum = (vector unsigned int) vec_splat_u32(0);
vector signed int sumsqr;
- sum = (vector unsigned int)vec_splat_u32(0);
-
for (i = 0; i < h; i++) {
- /* Read potentially unaligned pixels into t1 and t2 */
- vector unsigned char pix2l = vec_ld( 0, pix2);
+ /* Read potentially unaligned pixels into t1 and t2. */
+ vector unsigned char pix2l = vec_ld(0, pix2);
vector unsigned char pix2r = vec_ld(15, pix2);
- t1 = vec_ld(0, pix1);
- t2 = vec_perm(pix2l, pix2r, perm);
+ vector unsigned char t1 = vec_ld(0, pix1);
+ vector unsigned char t2 = vec_perm(pix2l, pix2r, perm);
/* Since we want to use unsigned chars, we can take advantage
- of the fact that abs(a-b)^2 = (a-b)^2. */
+ * of the fact that abs(a - b) ^ 2 = (a - b) ^ 2. */
- /* Calculate abs differences vector */
- t3 = vec_max(t1, t2);
- t4 = vec_min(t1, t2);
- t5 = vec_sub(t3, t4);
+ /* Calculate abs differences vector. */
+ vector unsigned char t3 = vec_max(t1, t2);
+ vector unsigned char t4 = vec_min(t1, t2);
+ vector unsigned char t5 = vec_sub(t3, t4);
- /* Square the values and add them to our sum */
+ /* Square the values and add them to our sum. */
sum = vec_msum(t5, t5, sum);
pix1 += line_size;
pix2 += line_size;
}
- /* Sum up the four partial sums, and put the result into s */
+ /* Sum up the four partial sums, and put the result into s. */
sumsqr = vec_sums((vector signed int) sum, (vector signed int) zero);
sumsqr = vec_splat(sumsqr, 3);
vec_ste(sumsqr, 0, &s);
@@ -444,32 +430,28 @@ static int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, i
return s;
}
-static int pix_sum_altivec(uint8_t * pix, int line_size)
+static int pix_sum_altivec(uint8_t *pix, int line_size)
{
- const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
+ int i, s;
+ const vector unsigned int zero =
+ (const vector unsigned int) vec_splat_u32(0);
vector unsigned char perm = vec_lvsl(0, pix);
- vector unsigned char t1;
- vector unsigned int sad;
+ vector unsigned int sad = (vector unsigned int) vec_splat_u32(0);
vector signed int sumdiffs;
- int i;
- int s;
-
- sad = (vector unsigned int)vec_splat_u32(0);
-
for (i = 0; i < 16; i++) {
- /* Read the potentially unaligned 16 pixels into t1 */
- vector unsigned char pixl = vec_ld( 0, pix);
+ /* Read the potentially unaligned 16 pixels into t1. */
+ vector unsigned char pixl = vec_ld(0, pix);
vector unsigned char pixr = vec_ld(15, pix);
- t1 = vec_perm(pixl, pixr, perm);
+ vector unsigned char t1 = vec_perm(pixl, pixr, perm);
- /* Add each 4 pixel group together and put 4 results into sad */
+ /* Add each 4 pixel group together and put 4 results into sad. */
sad = vec_sum4s(t1, sad);
pix += line_size;
}
- /* Sum up the four partial sums, and put the result into s */
+ /* Sum up the four partial sums, and put the result into s. */
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
sumdiffs = vec_splat(sumdiffs, 3);
vec_ste(sumdiffs, 0, &s);
@@ -477,107 +459,107 @@ static int pix_sum_altivec(uint8_t * pix, int line_size)
return s;
}
-static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, int line_size)
+static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels,
+ int line_size)
{
int i;
vector unsigned char perm = vec_lvsl(0, pixels);
- vector unsigned char bytes;
- const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
- vector signed short shorts;
+ const vector unsigned char zero =
+ (const vector unsigned char) vec_splat_u8(0);
for (i = 0; i < 8; i++) {
- // Read potentially unaligned pixels.
- // We're reading 16 pixels, and actually only want 8,
- // but we simply ignore the extras.
- vector unsigned char pixl = vec_ld( 0, pixels);
- vector unsigned char pixr = vec_ld(15, pixels);
- bytes = vec_perm(pixl, pixr, perm);
+ /* Read potentially unaligned pixels.
+ * We're reading 16 pixels, and actually only want 8,
+ * but we simply ignore the extras. */
+ vector unsigned char pixl = vec_ld(0, pixels);
+ vector unsigned char pixr = vec_ld(7, pixels);
+ vector unsigned char bytes = vec_perm(pixl, pixr, perm);
- // convert the bytes into shorts
- shorts = (vector signed short)vec_mergeh(zero, bytes);
+ // Convert the bytes into shorts.
+ vector signed short shorts = (vector signed short) vec_mergeh(zero,
+ bytes);
- // save the data to the block, we assume the block is 16-byte aligned
- vec_st(shorts, i*16, (vector signed short*)block);
+ // Save the data to the block, we assume the block is 16-byte aligned.
+ vec_st(shorts, i * 16, (vector signed short *) block);
pixels += line_size;
}
}
static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
- const uint8_t *s2, int stride)
+ const uint8_t *s2, int stride)
{
int i;
vector unsigned char perm1 = vec_lvsl(0, s1);
vector unsigned char perm2 = vec_lvsl(0, s2);
- vector unsigned char bytes, pixl, pixr;
- const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
+ const vector unsigned char zero =
+ (const vector unsigned char) vec_splat_u8(0);
vector signed short shorts1, shorts2;
for (i = 0; i < 4; i++) {
- // Read potentially unaligned pixels
- // We're reading 16 pixels, and actually only want 8,
- // but we simply ignore the extras.
- pixl = vec_ld( 0, s1);
- pixr = vec_ld(15, s1);
- bytes = vec_perm(pixl, pixr, perm1);
-
- // convert the bytes into shorts
- shorts1 = (vector signed short)vec_mergeh(zero, bytes);
-
- // Do the same for the second block of pixels
- pixl = vec_ld( 0, s2);
- pixr = vec_ld(15, s2);
+ /* Read potentially unaligned pixels.
+ * We're reading 16 pixels, and actually only want 8,
+ * but we simply ignore the extras. */
+ vector unsigned char pixl = vec_ld(0, s1);
+ vector unsigned char pixr = vec_ld(15, s1);
+ vector unsigned char bytes = vec_perm(pixl, pixr, perm1);
+
+ // Convert the bytes into shorts.
+ shorts1 = (vector signed short) vec_mergeh(zero, bytes);
+
+ // Do the same for the second block of pixels.
+ pixl = vec_ld(0, s2);
+ pixr = vec_ld(15, s2);
bytes = vec_perm(pixl, pixr, perm2);
- // convert the bytes into shorts
- shorts2 = (vector signed short)vec_mergeh(zero, bytes);
+ // Convert the bytes into shorts.
+ shorts2 = (vector signed short) vec_mergeh(zero, bytes);
- // Do the subtraction
+ // Do the subtraction.
shorts1 = vec_sub(shorts1, shorts2);
- // save the data to the block, we assume the block is 16-byte aligned
- vec_st(shorts1, 0, (vector signed short*)block);
+ // Save the data to the block, we assume the block is 16-byte aligned.
+ vec_st(shorts1, 0, (vector signed short *) block);
- s1 += stride;
- s2 += stride;
+ s1 += stride;
+ s2 += stride;
block += 8;
+ /* The code below is a copy of the code above...
+ * This is a manual unroll. */
- // The code below is a copy of the code above... This is a manual
- // unroll.
-
- // Read potentially unaligned pixels
- // We're reading 16 pixels, and actually only want 8,
- // but we simply ignore the extras.
- pixl = vec_ld( 0, s1);
- pixr = vec_ld(15, s1);
+ /* Read potentially unaligned pixels.
+ * We're reading 16 pixels, and actually only want 8,
+ * but we simply ignore the extras. */
+ pixl = vec_ld(0, s1);
+ pixr = vec_ld(15, s1);
bytes = vec_perm(pixl, pixr, perm1);
- // convert the bytes into shorts
- shorts1 = (vector signed short)vec_mergeh(zero, bytes);
+ // Convert the bytes into shorts.
+ shorts1 = (vector signed short) vec_mergeh(zero, bytes);
- // Do the same for the second block of pixels
- pixl = vec_ld( 0, s2);
- pixr = vec_ld(15, s2);
+ // Do the same for the second block of pixels.
+ pixl = vec_ld(0, s2);
+ pixr = vec_ld(15, s2);
bytes = vec_perm(pixl, pixr, perm2);
- // convert the bytes into shorts
- shorts2 = (vector signed short)vec_mergeh(zero, bytes);
+ // Convert the bytes into shorts.
+ shorts2 = (vector signed short) vec_mergeh(zero, bytes);
- // Do the subtraction
+ // Do the subtraction.
shorts1 = vec_sub(shorts1, shorts2);
- // save the data to the block, we assume the block is 16-byte aligned
- vec_st(shorts1, 0, (vector signed short*)block);
+ // Save the data to the block, we assume the block is 16-byte aligned.
+ vec_st(shorts1, 0, (vector signed short *) block);
- s1 += stride;
- s2 += stride;
+ s1 += stride;
+ s2 += stride;
block += 8;
}
}
-
-static void clear_block_altivec(int16_t *block) {
+static void clear_block_altivec(int16_t *block)
+{
LOAD_ZERO;
vec_st(zero_s16v, 0, block);
vec_st(zero_s16v, 16, block);
@@ -589,148 +571,155 @@ static void clear_block_altivec(int16_t *block) {
vec_st(zero_s16v, 112, block);
}
-
-static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) {
+static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w)
+{
register int i;
register vector unsigned char vdst, vsrc;
- /* dst and src are 16 bytes-aligned (guaranteed) */
- for (i = 0 ; (i + 15) < w ; i+=16) {
- vdst = vec_ld(i, (unsigned char*)dst);
- vsrc = vec_ld(i, (unsigned char*)src);
+ /* dst and src are 16 bytes-aligned (guaranteed). */
+ for (i = 0; i + 15 < w; i += 16) {
+ vdst = vec_ld(i, (unsigned char *) dst);
+ vsrc = vec_ld(i, (unsigned char *) src);
vdst = vec_add(vsrc, vdst);
- vec_st(vdst, i, (unsigned char*)dst);
+ vec_st(vdst, i, (unsigned char *) dst);
}
- /* if w is not a multiple of 16 */
- for (; (i < w) ; i++) {
+ /* If w is not a multiple of 16. */
+ for (; i < w; i++)
dst[i] = src[i];
- }
}
-static int hadamard8_diff8x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
+static int hadamard8_diff8x8_altivec(MpegEncContext *s, uint8_t *dst,
+ uint8_t *src, int stride, int h)
+{
int sum;
register const vector unsigned char vzero =
- (const vector unsigned char)vec_splat_u8(0);
+ (const vector unsigned char) vec_splat_u8(0);
register vector signed short temp0, temp1, temp2, temp3, temp4,
temp5, temp6, temp7;
{
- register const vector signed short vprod1 =(const vector signed short)
- { 1,-1, 1,-1, 1,-1, 1,-1 };
- register const vector signed short vprod2 =(const vector signed short)
- { 1, 1,-1,-1, 1, 1,-1,-1 };
- register const vector signed short vprod3 =(const vector signed short)
- { 1, 1, 1, 1,-1,-1,-1,-1 };
- register const vector unsigned char perm1 = (const vector unsigned char)
- {0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
- 0x0A, 0x0B, 0x08, 0x09, 0x0E, 0x0F, 0x0C, 0x0D};
- register const vector unsigned char perm2 = (const vector unsigned char)
- {0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
- 0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B};
- register const vector unsigned char perm3 = (const vector unsigned char)
- {0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-#define ONEITERBUTTERFLY(i, res) \
- { \
- register vector unsigned char src1, src2, srcO; \
- register vector unsigned char dst1, dst2, dstO; \
- register vector signed short srcV, dstV; \
- register vector signed short but0, but1, but2, op1, op2, op3; \
- src1 = vec_ld(stride * i, src); \
- src2 = vec_ld((stride * i) + 15, src); \
- srcO = vec_perm(src1, src2, vec_lvsl(stride * i, src)); \
- dst1 = vec_ld(stride * i, dst); \
- dst2 = vec_ld((stride * i) + 15, dst); \
- dstO = vec_perm(dst1, dst2, vec_lvsl(stride * i, dst)); \
- /* promote the unsigned chars to signed shorts */ \
- /* we're in the 8x8 function, we only care for the first 8 */ \
- srcV = (vector signed short)vec_mergeh((vector signed char)vzero, \
- (vector signed char)srcO); \
- dstV = (vector signed short)vec_mergeh((vector signed char)vzero, \
- (vector signed char)dstO); \
- /* subtractions inside the first butterfly */ \
- but0 = vec_sub(srcV, dstV); \
- op1 = vec_perm(but0, but0, perm1); \
- but1 = vec_mladd(but0, vprod1, op1); \
- op2 = vec_perm(but1, but1, perm2); \
- but2 = vec_mladd(but1, vprod2, op2); \
- op3 = vec_perm(but2, but2, perm3); \
- res = vec_mladd(but2, vprod3, op3); \
+ register const vector signed short vprod1 =
+ (const vector signed short) { 1, -1, 1, -1, 1, -1, 1, -1 };
+ register const vector signed short vprod2 =
+ (const vector signed short) { 1, 1, -1, -1, 1, 1, -1, -1 };
+ register const vector signed short vprod3 =
+ (const vector signed short) { 1, 1, 1, 1, -1, -1, -1, -1 };
+ register const vector unsigned char perm1 =
+ (const vector unsigned char)
+ { 0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
+ 0x0A, 0x0B, 0x08, 0x09, 0x0E, 0x0F, 0x0C, 0x0D };
+ register const vector unsigned char perm2 =
+ (const vector unsigned char)
+ { 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
+ 0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B };
+ register const vector unsigned char perm3 =
+ (const vector unsigned char)
+ { 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
+
+#define ONEITERBUTTERFLY(i, res) \
+ { \
+ register vector unsigned char src1 = vec_ld(stride * i, src); \
+ register vector unsigned char src2 = vec_ld(stride * i + 15, src); \
+ register vector unsigned char srcO = \
+ vec_perm(src1, src2, vec_lvsl(stride * i, src)); \
+ register vector unsigned char dst1 = vec_ld(stride * i, dst); \
+ register vector unsigned char dst2 = vec_ld(stride * i + 15, dst); \
+ register vector unsigned char dstO = \
+ vec_perm(dst1, dst2, vec_lvsl(stride * i, dst)); \
+ \
+ /* Promote the unsigned chars to signed shorts. */ \
+ /* We're in the 8x8 function, we only care for the first 8. */ \
+ register vector signed short srcV = \
+ (vector signed short) vec_mergeh((vector signed char) vzero, \
+ (vector signed char) srcO); \
+ register vector signed short dstV = \
+ (vector signed short) vec_mergeh((vector signed char) vzero, \
+ (vector signed char) dstO); \
+ \
+ /* subtractions inside the first butterfly */ \
+ register vector signed short but0 = vec_sub(srcV, dstV); \
+ register vector signed short op1 = vec_perm(but0, but0, perm1); \
+ register vector signed short but1 = vec_mladd(but0, vprod1, op1); \
+ register vector signed short op2 = vec_perm(but1, but1, perm2); \
+ register vector signed short but2 = vec_mladd(but1, vprod2, op2); \
+ register vector signed short op3 = vec_perm(but2, but2, perm3); \
+ res = vec_mladd(but2, vprod3, op3); \
}
- ONEITERBUTTERFLY(0, temp0);
- ONEITERBUTTERFLY(1, temp1);
- ONEITERBUTTERFLY(2, temp2);
- ONEITERBUTTERFLY(3, temp3);
- ONEITERBUTTERFLY(4, temp4);
- ONEITERBUTTERFLY(5, temp5);
- ONEITERBUTTERFLY(6, temp6);
- ONEITERBUTTERFLY(7, temp7);
+ ONEITERBUTTERFLY(0, temp0);
+ ONEITERBUTTERFLY(1, temp1);
+ ONEITERBUTTERFLY(2, temp2);
+ ONEITERBUTTERFLY(3, temp3);
+ ONEITERBUTTERFLY(4, temp4);
+ ONEITERBUTTERFLY(5, temp5);
+ ONEITERBUTTERFLY(6, temp6);
+ ONEITERBUTTERFLY(7, temp7);
}
#undef ONEITERBUTTERFLY
{
- register vector signed int vsum;
- register vector signed short line0 = vec_add(temp0, temp1);
- register vector signed short line1 = vec_sub(temp0, temp1);
- register vector signed short line2 = vec_add(temp2, temp3);
- register vector signed short line3 = vec_sub(temp2, temp3);
- register vector signed short line4 = vec_add(temp4, temp5);
- register vector signed short line5 = vec_sub(temp4, temp5);
- register vector signed short line6 = vec_add(temp6, temp7);
- register vector signed short line7 = vec_sub(temp6, temp7);
-
- register vector signed short line0B = vec_add(line0, line2);
- register vector signed short line2B = vec_sub(line0, line2);
- register vector signed short line1B = vec_add(line1, line3);
- register vector signed short line3B = vec_sub(line1, line3);
- register vector signed short line4B = vec_add(line4, line6);
- register vector signed short line6B = vec_sub(line4, line6);
- register vector signed short line5B = vec_add(line5, line7);
- register vector signed short line7B = vec_sub(line5, line7);
-
- register vector signed short line0C = vec_add(line0B, line4B);
- register vector signed short line4C = vec_sub(line0B, line4B);
- register vector signed short line1C = vec_add(line1B, line5B);
- register vector signed short line5C = vec_sub(line1B, line5B);
- register vector signed short line2C = vec_add(line2B, line6B);
- register vector signed short line6C = vec_sub(line2B, line6B);
- register vector signed short line3C = vec_add(line3B, line7B);
- register vector signed short line7C = vec_sub(line3B, line7B);
-
- vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
- vsum = vec_sum4s(vec_abs(line1C), vsum);
- vsum = vec_sum4s(vec_abs(line2C), vsum);
- vsum = vec_sum4s(vec_abs(line3C), vsum);
- vsum = vec_sum4s(vec_abs(line4C), vsum);
- vsum = vec_sum4s(vec_abs(line5C), vsum);
- vsum = vec_sum4s(vec_abs(line6C), vsum);
- vsum = vec_sum4s(vec_abs(line7C), vsum);
- vsum = vec_sums(vsum, (vector signed int)vzero);
- vsum = vec_splat(vsum, 3);
- vec_ste(vsum, 0, &sum);
+ register vector signed int vsum;
+ register vector signed short line0 = vec_add(temp0, temp1);
+ register vector signed short line1 = vec_sub(temp0, temp1);
+ register vector signed short line2 = vec_add(temp2, temp3);
+ register vector signed short line3 = vec_sub(temp2, temp3);
+ register vector signed short line4 = vec_add(temp4, temp5);
+ register vector signed short line5 = vec_sub(temp4, temp5);
+ register vector signed short line6 = vec_add(temp6, temp7);
+ register vector signed short line7 = vec_sub(temp6, temp7);
+
+ register vector signed short line0B = vec_add(line0, line2);
+ register vector signed short line2B = vec_sub(line0, line2);
+ register vector signed short line1B = vec_add(line1, line3);
+ register vector signed short line3B = vec_sub(line1, line3);
+ register vector signed short line4B = vec_add(line4, line6);
+ register vector signed short line6B = vec_sub(line4, line6);
+ register vector signed short line5B = vec_add(line5, line7);
+ register vector signed short line7B = vec_sub(line5, line7);
+
+ register vector signed short line0C = vec_add(line0B, line4B);
+ register vector signed short line4C = vec_sub(line0B, line4B);
+ register vector signed short line1C = vec_add(line1B, line5B);
+ register vector signed short line5C = vec_sub(line1B, line5B);
+ register vector signed short line2C = vec_add(line2B, line6B);
+ register vector signed short line6C = vec_sub(line2B, line6B);
+ register vector signed short line3C = vec_add(line3B, line7B);
+ register vector signed short line7C = vec_sub(line3B, line7B);
+
+ vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
+ vsum = vec_sum4s(vec_abs(line1C), vsum);
+ vsum = vec_sum4s(vec_abs(line2C), vsum);
+ vsum = vec_sum4s(vec_abs(line3C), vsum);
+ vsum = vec_sum4s(vec_abs(line4C), vsum);
+ vsum = vec_sum4s(vec_abs(line5C), vsum);
+ vsum = vec_sum4s(vec_abs(line6C), vsum);
+ vsum = vec_sum4s(vec_abs(line7C), vsum);
+ vsum = vec_sums(vsum, (vector signed int) vzero);
+ vsum = vec_splat(vsum, 3);
+ vec_ste(vsum, 0, &sum);
}
return sum;
}
/*
-16x8 works with 16 elements; it allows to avoid replicating loads, and
-give the compiler more rooms for scheduling. It's only used from
-inside hadamard8_diff16_altivec.
-
-Unfortunately, it seems gcc-3.3 is a bit dumb, and the compiled code has a LOT
-of spill code, it seems gcc (unlike xlc) cannot keep everything in registers
-by itself. The following code include hand-made registers allocation. It's not
-clean, but on a 7450 the resulting code is much faster (best case fall from
-700+ cycles to 550).
-
-xlc doesn't add spill code, but it doesn't know how to schedule for the 7450,
-and its code isn't much faster than gcc-3.3 on the 7450 (but uses 25% less
-instructions...)
-
-On the 970, the hand-made RA is still a win (around 690 vs. around 780), but
-xlc goes to around 660 on the regular C code...
-*/
-
-static int hadamard8_diff16x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h) {
+ * 16x8 works with 16 elements; it allows to avoid replicating loads, and
+ * gives the compiler more room for scheduling. It's only used from
+ * inside hadamard8_diff16_altivec.
+ *
+ * Unfortunately, it seems gcc-3.3 is a bit dumb, and the compiled code has
+ * a LOT of spill code, it seems gcc (unlike xlc) cannot keep everything in
+ * registers by itself. The following code includes hand-made register
+ * allocation. It's not clean, but on a 7450 the resulting code is much faster
+ * (best case falls from 700+ cycles to 550).
+ *
+ * xlc doesn't add spill code, but it doesn't know how to schedule for the
+ * 7450, and its code isn't much faster than gcc-3.3 on the 7450 (but uses
+ * 25% fewer instructions...)
+ *
+ * On the 970, the hand-made RA is still a win (around 690 vs. around 780),
+ * but xlc goes to around 660 on the regular C code...
+ */
+static int hadamard8_diff16x8_altivec(MpegEncContext *s, uint8_t *dst,
+ uint8_t *src, int stride, int h)
+{
int sum;
register vector signed short
temp0 __asm__ ("v0"),
@@ -751,211 +740,216 @@ static int hadamard8_diff16x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst,
temp6S __asm__ ("v14"),
temp7S __asm__ ("v15");
register const vector unsigned char vzero __asm__ ("v31") =
- (const vector unsigned char)vec_splat_u8(0);
+ (const vector unsigned char) vec_splat_u8(0);
{
- register const vector signed short vprod1 __asm__ ("v16") =
- (const vector signed short){ 1,-1, 1,-1, 1,-1, 1,-1 };
- register const vector signed short vprod2 __asm__ ("v17") =
- (const vector signed short){ 1, 1,-1,-1, 1, 1,-1,-1 };
- register const vector signed short vprod3 __asm__ ("v18") =
- (const vector signed short){ 1, 1, 1, 1,-1,-1,-1,-1 };
- register const vector unsigned char perm1 __asm__ ("v19") =
- (const vector unsigned char)
- {0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
- 0x0A, 0x0B, 0x08, 0x09, 0x0E, 0x0F, 0x0C, 0x0D};
- register const vector unsigned char perm2 __asm__ ("v20") =
- (const vector unsigned char)
- {0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
- 0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B};
- register const vector unsigned char perm3 __asm__ ("v21") =
- (const vector unsigned char)
- {0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-#define ONEITERBUTTERFLY(i, res1, res2) \
- { \
- register vector unsigned char src1 __asm__ ("v22"), \
- src2 __asm__ ("v23"), \
- dst1 __asm__ ("v24"), \
- dst2 __asm__ ("v25"), \
- srcO __asm__ ("v22"), \
- dstO __asm__ ("v23"); \
- \
- register vector signed short srcV __asm__ ("v24"), \
- dstV __asm__ ("v25"), \
- srcW __asm__ ("v26"), \
- dstW __asm__ ("v27"), \
- but0 __asm__ ("v28"), \
- but0S __asm__ ("v29"), \
- op1 __asm__ ("v30"), \
- but1 __asm__ ("v22"), \
- op1S __asm__ ("v23"), \
- but1S __asm__ ("v24"), \
- op2 __asm__ ("v25"), \
- but2 __asm__ ("v26"), \
- op2S __asm__ ("v27"), \
- but2S __asm__ ("v28"), \
- op3 __asm__ ("v29"), \
- op3S __asm__ ("v30"); \
- \
- src1 = vec_ld(stride * i, src); \
- src2 = vec_ld((stride * i) + 16, src); \
- srcO = vec_perm(src1, src2, vec_lvsl(stride * i, src)); \
- dst1 = vec_ld(stride * i, dst); \
- dst2 = vec_ld((stride * i) + 16, dst); \
- dstO = vec_perm(dst1, dst2, vec_lvsl(stride * i, dst)); \
- /* promote the unsigned chars to signed shorts */ \
- srcV = (vector signed short)vec_mergeh((vector signed char)vzero, \
- (vector signed char)srcO); \
- dstV = (vector signed short)vec_mergeh((vector signed char)vzero, \
- (vector signed char)dstO); \
- srcW = (vector signed short)vec_mergel((vector signed char)vzero, \
- (vector signed char)srcO); \
- dstW = (vector signed short)vec_mergel((vector signed char)vzero, \
- (vector signed char)dstO); \
- /* subtractions inside the first butterfly */ \
- but0 = vec_sub(srcV, dstV); \
- but0S = vec_sub(srcW, dstW); \
- op1 = vec_perm(but0, but0, perm1); \
- but1 = vec_mladd(but0, vprod1, op1); \
- op1S = vec_perm(but0S, but0S, perm1); \
- but1S = vec_mladd(but0S, vprod1, op1S); \
- op2 = vec_perm(but1, but1, perm2); \
- but2 = vec_mladd(but1, vprod2, op2); \
- op2S = vec_perm(but1S, but1S, perm2); \
- but2S = vec_mladd(but1S, vprod2, op2S); \
- op3 = vec_perm(but2, but2, perm3); \
- res1 = vec_mladd(but2, vprod3, op3); \
- op3S = vec_perm(but2S, but2S, perm3); \
- res2 = vec_mladd(but2S, vprod3, op3S); \
+ register const vector signed short vprod1 __asm__ ("v16") =
+ (const vector signed short) { 1, -1, 1, -1, 1, -1, 1, -1 };
+
+ register const vector signed short vprod2 __asm__ ("v17") =
+ (const vector signed short) { 1, 1, -1, -1, 1, 1, -1, -1 };
+
+ register const vector signed short vprod3 __asm__ ("v18") =
+ (const vector signed short) { 1, 1, 1, 1, -1, -1, -1, -1 };
+
+ register const vector unsigned char perm1 __asm__ ("v19") =
+ (const vector unsigned char)
+ { 0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
+ 0x0A, 0x0B, 0x08, 0x09, 0x0E, 0x0F, 0x0C, 0x0D };
+
+ register const vector unsigned char perm2 __asm__ ("v20") =
+ (const vector unsigned char)
+ { 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
+ 0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B };
+
+ register const vector unsigned char perm3 __asm__ ("v21") =
+ (const vector unsigned char)
+ { 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
+
+#define ONEITERBUTTERFLY(i, res1, res2) \
+ { \
+ register vector unsigned char src1 __asm__ ("v22") = \
+ vec_ld(stride * i, src); \
+ register vector unsigned char src2 __asm__ ("v23") = \
+ vec_ld(stride * i + 16, src); \
+ register vector unsigned char srcO __asm__ ("v22") = \
+ vec_perm(src1, src2, vec_lvsl(stride * i, src)); \
+ register vector unsigned char dst1 __asm__ ("v24") = \
+ vec_ld(stride * i, dst); \
+ register vector unsigned char dst2 __asm__ ("v25") = \
+ vec_ld(stride * i + 16, dst); \
+ register vector unsigned char dstO __asm__ ("v23") = \
+ vec_perm(dst1, dst2, vec_lvsl(stride * i, dst)); \
+ \
+ /* Promote the unsigned chars to signed shorts. */ \
+ register vector signed short srcV __asm__ ("v24") = \
+ (vector signed short) vec_mergeh((vector signed char) vzero, \
+ (vector signed char) srcO); \
+ register vector signed short dstV __asm__ ("v25") = \
+ (vector signed short) vec_mergeh((vector signed char) vzero, \
+ (vector signed char) dstO); \
+ register vector signed short srcW __asm__ ("v26") = \
+ (vector signed short) vec_mergel((vector signed char) vzero, \
+ (vector signed char) srcO); \
+ register vector signed short dstW __asm__ ("v27") = \
+ (vector signed short) vec_mergel((vector signed char) vzero, \
+ (vector signed char) dstO); \
+ \
+ /* subtractions inside the first butterfly */ \
+ register vector signed short but0 __asm__ ("v28") = \
+ vec_sub(srcV, dstV); \
+ register vector signed short but0S __asm__ ("v29") = \
+ vec_sub(srcW, dstW); \
+ register vector signed short op1 __asm__ ("v30") = \
+ vec_perm(but0, but0, perm1); \
+ register vector signed short but1 __asm__ ("v22") = \
+ vec_mladd(but0, vprod1, op1); \
+ register vector signed short op1S __asm__ ("v23") = \
+ vec_perm(but0S, but0S, perm1); \
+ register vector signed short but1S __asm__ ("v24") = \
+ vec_mladd(but0S, vprod1, op1S); \
+ register vector signed short op2 __asm__ ("v25") = \
+ vec_perm(but1, but1, perm2); \
+ register vector signed short but2 __asm__ ("v26") = \
+ vec_mladd(but1, vprod2, op2); \
+ register vector signed short op2S __asm__ ("v27") = \
+ vec_perm(but1S, but1S, perm2); \
+ register vector signed short but2S __asm__ ("v28") = \
+ vec_mladd(but1S, vprod2, op2S); \
+ register vector signed short op3 __asm__ ("v29") = \
+ vec_perm(but2, but2, perm3); \
+ register vector signed short op3S __asm__ ("v30") = \
+ vec_perm(but2S, but2S, perm3); \
+ res1 = vec_mladd(but2, vprod3, op3); \
+ res2 = vec_mladd(but2S, vprod3, op3S); \
}
- ONEITERBUTTERFLY(0, temp0, temp0S);
- ONEITERBUTTERFLY(1, temp1, temp1S);
- ONEITERBUTTERFLY(2, temp2, temp2S);
- ONEITERBUTTERFLY(3, temp3, temp3S);
- ONEITERBUTTERFLY(4, temp4, temp4S);
- ONEITERBUTTERFLY(5, temp5, temp5S);
- ONEITERBUTTERFLY(6, temp6, temp6S);
- ONEITERBUTTERFLY(7, temp7, temp7S);
+ ONEITERBUTTERFLY(0, temp0, temp0S);
+ ONEITERBUTTERFLY(1, temp1, temp1S);
+ ONEITERBUTTERFLY(2, temp2, temp2S);
+ ONEITERBUTTERFLY(3, temp3, temp3S);
+ ONEITERBUTTERFLY(4, temp4, temp4S);
+ ONEITERBUTTERFLY(5, temp5, temp5S);
+ ONEITERBUTTERFLY(6, temp6, temp6S);
+ ONEITERBUTTERFLY(7, temp7, temp7S);
}
#undef ONEITERBUTTERFLY
{
- register vector signed int vsum;
- register vector signed short line0S, line1S, line2S, line3S, line4S,
- line5S, line6S, line7S, line0BS,line2BS,
- line1BS,line3BS,line4BS,line6BS,line5BS,
- line7BS,line0CS,line4CS,line1CS,line5CS,
- line2CS,line6CS,line3CS,line7CS;
-
- register vector signed short line0 = vec_add(temp0, temp1);
- register vector signed short line1 = vec_sub(temp0, temp1);
- register vector signed short line2 = vec_add(temp2, temp3);
- register vector signed short line3 = vec_sub(temp2, temp3);
- register vector signed short line4 = vec_add(temp4, temp5);
- register vector signed short line5 = vec_sub(temp4, temp5);
- register vector signed short line6 = vec_add(temp6, temp7);
- register vector signed short line7 = vec_sub(temp6, temp7);
-
- register vector signed short line0B = vec_add(line0, line2);
- register vector signed short line2B = vec_sub(line0, line2);
- register vector signed short line1B = vec_add(line1, line3);
- register vector signed short line3B = vec_sub(line1, line3);
- register vector signed short line4B = vec_add(line4, line6);
- register vector signed short line6B = vec_sub(line4, line6);
- register vector signed short line5B = vec_add(line5, line7);
- register vector signed short line7B = vec_sub(line5, line7);
-
- register vector signed short line0C = vec_add(line0B, line4B);
- register vector signed short line4C = vec_sub(line0B, line4B);
- register vector signed short line1C = vec_add(line1B, line5B);
- register vector signed short line5C = vec_sub(line1B, line5B);
- register vector signed short line2C = vec_add(line2B, line6B);
- register vector signed short line6C = vec_sub(line2B, line6B);
- register vector signed short line3C = vec_add(line3B, line7B);
- register vector signed short line7C = vec_sub(line3B, line7B);
-
- vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
- vsum = vec_sum4s(vec_abs(line1C), vsum);
- vsum = vec_sum4s(vec_abs(line2C), vsum);
- vsum = vec_sum4s(vec_abs(line3C), vsum);
- vsum = vec_sum4s(vec_abs(line4C), vsum);
- vsum = vec_sum4s(vec_abs(line5C), vsum);
- vsum = vec_sum4s(vec_abs(line6C), vsum);
- vsum = vec_sum4s(vec_abs(line7C), vsum);
-
- line0S = vec_add(temp0S, temp1S);
- line1S = vec_sub(temp0S, temp1S);
- line2S = vec_add(temp2S, temp3S);
- line3S = vec_sub(temp2S, temp3S);
- line4S = vec_add(temp4S, temp5S);
- line5S = vec_sub(temp4S, temp5S);
- line6S = vec_add(temp6S, temp7S);
- line7S = vec_sub(temp6S, temp7S);
-
- line0BS = vec_add(line0S, line2S);
- line2BS = vec_sub(line0S, line2S);
- line1BS = vec_add(line1S, line3S);
- line3BS = vec_sub(line1S, line3S);
- line4BS = vec_add(line4S, line6S);
- line6BS = vec_sub(line4S, line6S);
- line5BS = vec_add(line5S, line7S);
- line7BS = vec_sub(line5S, line7S);
-
- line0CS = vec_add(line0BS, line4BS);
- line4CS = vec_sub(line0BS, line4BS);
- line1CS = vec_add(line1BS, line5BS);
- line5CS = vec_sub(line1BS, line5BS);
- line2CS = vec_add(line2BS, line6BS);
- line6CS = vec_sub(line2BS, line6BS);
- line3CS = vec_add(line3BS, line7BS);
- line7CS = vec_sub(line3BS, line7BS);
-
- vsum = vec_sum4s(vec_abs(line0CS), vsum);
- vsum = vec_sum4s(vec_abs(line1CS), vsum);
- vsum = vec_sum4s(vec_abs(line2CS), vsum);
- vsum = vec_sum4s(vec_abs(line3CS), vsum);
- vsum = vec_sum4s(vec_abs(line4CS), vsum);
- vsum = vec_sum4s(vec_abs(line5CS), vsum);
- vsum = vec_sum4s(vec_abs(line6CS), vsum);
- vsum = vec_sum4s(vec_abs(line7CS), vsum);
- vsum = vec_sums(vsum, (vector signed int)vzero);
- vsum = vec_splat(vsum, 3);
- vec_ste(vsum, 0, &sum);
+ register vector signed int vsum;
+
+ register vector signed short line0 = vec_add(temp0, temp1);
+ register vector signed short line1 = vec_sub(temp0, temp1);
+ register vector signed short line2 = vec_add(temp2, temp3);
+ register vector signed short line3 = vec_sub(temp2, temp3);
+ register vector signed short line4 = vec_add(temp4, temp5);
+ register vector signed short line5 = vec_sub(temp4, temp5);
+ register vector signed short line6 = vec_add(temp6, temp7);
+ register vector signed short line7 = vec_sub(temp6, temp7);
+
+ register vector signed short line0B = vec_add(line0, line2);
+ register vector signed short line2B = vec_sub(line0, line2);
+ register vector signed short line1B = vec_add(line1, line3);
+ register vector signed short line3B = vec_sub(line1, line3);
+ register vector signed short line4B = vec_add(line4, line6);
+ register vector signed short line6B = vec_sub(line4, line6);
+ register vector signed short line5B = vec_add(line5, line7);
+ register vector signed short line7B = vec_sub(line5, line7);
+
+ register vector signed short line0C = vec_add(line0B, line4B);
+ register vector signed short line4C = vec_sub(line0B, line4B);
+ register vector signed short line1C = vec_add(line1B, line5B);
+ register vector signed short line5C = vec_sub(line1B, line5B);
+ register vector signed short line2C = vec_add(line2B, line6B);
+ register vector signed short line6C = vec_sub(line2B, line6B);
+ register vector signed short line3C = vec_add(line3B, line7B);
+ register vector signed short line7C = vec_sub(line3B, line7B);
+
+ register vector signed short line0S = vec_add(temp0S, temp1S);
+ register vector signed short line1S = vec_sub(temp0S, temp1S);
+ register vector signed short line2S = vec_add(temp2S, temp3S);
+ register vector signed short line3S = vec_sub(temp2S, temp3S);
+ register vector signed short line4S = vec_add(temp4S, temp5S);
+ register vector signed short line5S = vec_sub(temp4S, temp5S);
+ register vector signed short line6S = vec_add(temp6S, temp7S);
+ register vector signed short line7S = vec_sub(temp6S, temp7S);
+
+ register vector signed short line0BS = vec_add(line0S, line2S);
+ register vector signed short line2BS = vec_sub(line0S, line2S);
+ register vector signed short line1BS = vec_add(line1S, line3S);
+ register vector signed short line3BS = vec_sub(line1S, line3S);
+ register vector signed short line4BS = vec_add(line4S, line6S);
+ register vector signed short line6BS = vec_sub(line4S, line6S);
+ register vector signed short line5BS = vec_add(line5S, line7S);
+ register vector signed short line7BS = vec_sub(line5S, line7S);
+
+ register vector signed short line0CS = vec_add(line0BS, line4BS);
+ register vector signed short line4CS = vec_sub(line0BS, line4BS);
+ register vector signed short line1CS = vec_add(line1BS, line5BS);
+ register vector signed short line5CS = vec_sub(line1BS, line5BS);
+ register vector signed short line2CS = vec_add(line2BS, line6BS);
+ register vector signed short line6CS = vec_sub(line2BS, line6BS);
+ register vector signed short line3CS = vec_add(line3BS, line7BS);
+ register vector signed short line7CS = vec_sub(line3BS, line7BS);
+
+ vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
+ vsum = vec_sum4s(vec_abs(line1C), vsum);
+ vsum = vec_sum4s(vec_abs(line2C), vsum);
+ vsum = vec_sum4s(vec_abs(line3C), vsum);
+ vsum = vec_sum4s(vec_abs(line4C), vsum);
+ vsum = vec_sum4s(vec_abs(line5C), vsum);
+ vsum = vec_sum4s(vec_abs(line6C), vsum);
+ vsum = vec_sum4s(vec_abs(line7C), vsum);
+
+ vsum = vec_sum4s(vec_abs(line0CS), vsum);
+ vsum = vec_sum4s(vec_abs(line1CS), vsum);
+ vsum = vec_sum4s(vec_abs(line2CS), vsum);
+ vsum = vec_sum4s(vec_abs(line3CS), vsum);
+ vsum = vec_sum4s(vec_abs(line4CS), vsum);
+ vsum = vec_sum4s(vec_abs(line5CS), vsum);
+ vsum = vec_sum4s(vec_abs(line6CS), vsum);
+ vsum = vec_sum4s(vec_abs(line7CS), vsum);
+ vsum = vec_sums(vsum, (vector signed int) vzero);
+ vsum = vec_splat(vsum, 3);
+ vec_ste(vsum, 0, &sum);
}
return sum;
}
-static int hadamard8_diff16_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
- int score;
- score = hadamard8_diff16x8_altivec(s, dst, src, stride, 8);
- if (h==16) {
- dst += 8*stride;
- src += 8*stride;
+static int hadamard8_diff16_altivec(MpegEncContext *s, uint8_t *dst,
+ uint8_t *src, int stride, int h)
+{
+ int score = hadamard8_diff16x8_altivec(s, dst, src, stride, 8);
+
+ if (h == 16) {
+ dst += 8 * stride;
+ src += 8 * stride;
score += hadamard8_diff16x8_altivec(s, dst, src, stride, 8);
}
return score;
}
-av_cold void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx)
+av_cold void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
{
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
c->pix_abs[0][1] = sad16_x2_altivec;
c->pix_abs[0][2] = sad16_y2_altivec;
c->pix_abs[0][3] = sad16_xy2_altivec;
c->pix_abs[0][0] = sad16_altivec;
c->pix_abs[1][0] = sad8_altivec;
- c->sad[0]= sad16_altivec;
- c->sad[1]= sad8_altivec;
+
+ c->sad[0] = sad16_altivec;
+ c->sad[1] = sad8_altivec;
+ c->sse[0] = sse16_altivec;
+ c->sse[1] = sse8_altivec;
+
c->pix_norm1 = pix_norm1_altivec;
- c->sse[1]= sse8_altivec;
- c->sse[0]= sse16_altivec;
- c->pix_sum = pix_sum_altivec;
+ c->pix_sum = pix_sum_altivec;
+
c->diff_pixels = diff_pixels_altivec;
- c->add_bytes= add_bytes_altivec;
+ c->add_bytes = add_bytes_altivec;
+
if (!high_bit_depth) {
- c->get_pixels = get_pixels_altivec;
- c->clear_block = clear_block_altivec;
+ c->get_pixels = get_pixels_altivec;
+ c->clear_block = clear_block_altivec;
}
c->hadamard8_diff[0] = hadamard8_diff16_altivec;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_altivec.h b/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_altivec.h
index 0e769ab0606..cdbfc35ac3f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_altivec.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_altivec.h
@@ -24,11 +24,8 @@
#define AVCODEC_PPC_DSPUTIL_ALTIVEC_H
#include <stdint.h>
-#include "libavcodec/dsputil.h"
-
-void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
+#include "libavcodec/dsputil.h"
void ff_fdct_altivec(int16_t *block);
void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
@@ -36,8 +33,8 @@ void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
void ff_idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
void ff_idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
-void ff_dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx);
-void ff_float_init_altivec(DSPContext* c, AVCodecContext *avctx);
-void ff_int_init_altivec(DSPContext* c, AVCodecContext *avctx);
+void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
+void ff_int_init_altivec(DSPContext *c, AVCodecContext *avctx);
#endif /* AVCODEC_PPC_DSPUTIL_ALTIVEC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_ppc.c b/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_ppc.c
index 7454ea0f1e8..cbb1cfbcc8c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_ppc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/dsputil_ppc.c
@@ -26,126 +26,112 @@
#include "libavutil/cpu.h"
#include "libavutil/mem.h"
#include "libavutil/ppc/cpu.h"
+#include "libavcodec/avcodec.h"
+#include "libavcodec/dsputil.h"
#include "dsputil_altivec.h"
/* ***** WARNING ***** WARNING ***** WARNING ***** */
/*
-clear_blocks_dcbz32_ppc will not work properly on PowerPC processors with a
-cache line size not equal to 32 bytes.
-Fortunately all processor used by Apple up to at least the 7450 (aka second
-generation G4) use 32 bytes cache line.
-This is due to the use of the 'dcbz' instruction. It simply clear to zero a
-single cache line, so you need to know the cache line size to use it !
-It's absurd, but it's fast...
-
-update 24/06/2003 : Apple released yesterday the G5, with a PPC970. cache line
-size: 128 bytes. Oups.
-The semantic of dcbz was changed, it always clear 32 bytes. so the function
-below will work, but will be slow. So I fixed check_dcbz_effect to use dcbzl,
-which is defined to clear a cache line (as dcbz before). So we still can
-distinguish, and use dcbz (32 bytes) or dcbzl (one cache line) as required.
-
-see <http://developer.apple.com/technotes/tn/tn2087.html>
-and <http://developer.apple.com/technotes/tn/tn2086.html>
-*/
+ * clear_blocks_dcbz32_ppc will not work properly on PowerPC processors with
+ * a cache line size not equal to 32 bytes. Fortunately all processors used
+ * by Apple up to at least the 7450 (AKA second generation G4) use 32-byte
+ * cache lines. This is due to the use of the 'dcbz' instruction. It simply
+ * clears a single cache line to zero, so you need to know the cache line
+ * size to use it! It's absurd, but it's fast...
+ *
+ * update 24/06/2003: Apple released the G5 yesterday, with a PPC970.
+ * cache line size: 128 bytes. Oups.
+ * The semantics of dcbz was changed, it always clears 32 bytes. So the function
+ * below will work, but will be slow. So I fixed check_dcbz_effect to use dcbzl,
+ * which is defined to clear a cache line (as dcbz before). So we can still
+ * distinguish, and use dcbz (32 bytes) or dcbzl (one cache line) as required.
+ *
+ * see <http://developer.apple.com/technotes/tn/tn2087.html>
+ * and <http://developer.apple.com/technotes/tn/tn2086.html>
+ */
static void clear_blocks_dcbz32_ppc(int16_t *blocks)
{
- register int misal = ((unsigned long)blocks & 0x00000010);
- register int i = 0;
+ register int misal = (unsigned long) blocks & 0x00000010, i = 0;
+
if (misal) {
- ((unsigned long*)blocks)[0] = 0L;
- ((unsigned long*)blocks)[1] = 0L;
- ((unsigned long*)blocks)[2] = 0L;
- ((unsigned long*)blocks)[3] = 0L;
+ ((unsigned long *) blocks)[0] = 0L;
+ ((unsigned long *) blocks)[1] = 0L;
+ ((unsigned long *) blocks)[2] = 0L;
+ ((unsigned long *) blocks)[3] = 0L;
i += 16;
}
- for ( ; i < sizeof(int16_t)*6*64-31 ; i += 32) {
- __asm__ volatile("dcbz %0,%1" : : "b" (blocks), "r" (i) : "memory");
- }
+ for (; i < sizeof(int16_t) * 6 * 64 - 31; i += 32)
+ __asm__ volatile ("dcbz %0,%1" :: "b" (blocks), "r" (i) : "memory");
if (misal) {
- ((unsigned long*)blocks)[188] = 0L;
- ((unsigned long*)blocks)[189] = 0L;
- ((unsigned long*)blocks)[190] = 0L;
- ((unsigned long*)blocks)[191] = 0L;
+ ((unsigned long *) blocks)[188] = 0L;
+ ((unsigned long *) blocks)[189] = 0L;
+ ((unsigned long *) blocks)[190] = 0L;
+ ((unsigned long *) blocks)[191] = 0L;
i += 16;
}
}
-/* same as above, when dcbzl clear a whole 128B cache line
- i.e. the PPC970 aka G5 */
-#if HAVE_DCBZL
+/* Same as above, when dcbzl clears a whole 128 bytes cache line
+ * i.e. the PPC970 AKA G5. */
static void clear_blocks_dcbz128_ppc(int16_t *blocks)
{
- register int misal = ((unsigned long)blocks & 0x0000007f);
- register int i = 0;
+#if HAVE_DCBZL
+ register int misal = (unsigned long) blocks & 0x0000007f, i = 0;
+
if (misal) {
- // we could probably also optimize this case,
- // but there's not much point as the machines
- // aren't available yet (2003-06-26)
- memset(blocks, 0, sizeof(int16_t)*6*64);
+ /* We could probably also optimize this case,
+ * but there's not much point as the machines
+ * aren't available yet (2003-06-26). */
+ memset(blocks, 0, sizeof(int16_t) * 6 * 64);
+ } else {
+ for (; i < sizeof(int16_t) * 6 * 64; i += 128)
+ __asm__ volatile ("dcbzl %0,%1" :: "b" (blocks), "r" (i) : "memory");
}
- else
- for ( ; i < sizeof(int16_t)*6*64 ; i += 128) {
- __asm__ volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory");
- }
-}
#else
-static void clear_blocks_dcbz128_ppc(int16_t *blocks)
-{
- memset(blocks, 0, sizeof(int16_t)*6*64);
-}
+ memset(blocks, 0, sizeof(int16_t) * 6 * 64);
#endif
+}
-#if HAVE_DCBZL
-/* check dcbz report how many bytes are set to 0 by dcbz */
-/* update 24/06/2003 : replace dcbz by dcbzl to get
- the intended effect (Apple "fixed" dcbz)
- unfortunately this cannot be used unless the assembler
- knows about dcbzl ... */
+/* Check dcbz report how many bytes are set to 0 by dcbz. */
+/* update 24/06/2003: Replace dcbz by dcbzl to get the intended effect
+ * (Apple "fixed" dcbz). Unfortunately this cannot be used unless the
+ * assembler knows about dcbzl ... */
static long check_dcbzl_effect(void)
{
+ long count = 0;
+#if HAVE_DCBZL
register char *fakedata = av_malloc(1024);
register char *fakedata_middle;
- register long zero = 0;
- register long i = 0;
- long count = 0;
+ register long zero = 0, i = 0;
- if (!fakedata) {
+ if (!fakedata)
return 0L;
- }
- fakedata_middle = (fakedata + 512);
+ fakedata_middle = fakedata + 512;
memset(fakedata, 0xFF, 1024);
- /* below the constraint "b" seems to mean "Address base register"
- in gcc-3.3 / RS/6000 speaks. seems to avoid using r0, so.... */
- __asm__ volatile("dcbzl %0, %1" : : "b" (fakedata_middle), "r" (zero));
+ /* Below the constraint "b" seems to mean "address base register"
+ * in gcc-3.3 / RS/6000 speaks. Seems to avoid using r0, so.... */
+ __asm__ volatile ("dcbzl %0, %1" :: "b" (fakedata_middle), "r" (zero));
- for (i = 0; i < 1024 ; i ++) {
- if (fakedata[i] == (char)0)
+ for (i = 0; i < 1024; i++)
+ if (fakedata[i] == (char) 0)
count++;
- }
av_free(fakedata);
+#endif
return count;
}
-#else
-static long check_dcbzl_effect(void)
-{
- return 0;
-}
-#endif
-av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx)
+av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
{
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
int mm_flags = av_get_cpu_flags();
-
- // Common optimizations whether AltiVec is available or not
+ // common optimizations whether AltiVec is available or not
if (!high_bit_depth) {
- switch (check_dcbzl_effect()) {
+ switch (check_dcbzl_effect()) {
case 32:
c->clear_blocks = clear_blocks_dcbz32_ppc;
break;
@@ -154,30 +140,29 @@ av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx)
break;
default:
break;
- }
+ }
}
if (PPC_ALTIVEC(mm_flags)) {
- ff_dsputil_init_altivec(c, avctx);
+ ff_dsputil_init_altivec(c, avctx, high_bit_depth);
ff_int_init_altivec(c, avctx);
c->gmc1 = ff_gmc1_altivec;
+ if (!high_bit_depth) {
#if CONFIG_ENCODERS
- if (avctx->bits_per_raw_sample <= 8 &&
- (avctx->dct_algo == FF_DCT_AUTO ||
- avctx->dct_algo == FF_DCT_ALTIVEC)) {
- c->fdct = ff_fdct_altivec;
- }
+ if (avctx->dct_algo == FF_DCT_AUTO ||
+ avctx->dct_algo == FF_DCT_ALTIVEC) {
+ c->fdct = ff_fdct_altivec;
+ }
#endif //CONFIG_ENCODERS
-
- if (avctx->lowres == 0 && avctx->bits_per_raw_sample <= 8) {
+ if (avctx->lowres == 0) {
if ((avctx->idct_algo == FF_IDCT_AUTO) ||
(avctx->idct_algo == FF_IDCT_ALTIVEC)) {
- c->idct_put = ff_idct_put_altivec;
- c->idct_add = ff_idct_add_altivec;
+ c->idct_put = ff_idct_put_altivec;
+ c->idct_add = ff_idct_add_altivec;
c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
}
+ }
}
-
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/fdct_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/fdct_altivec.c
index ff816e2a5f3..e6f36497ac7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/fdct_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/fdct_altivec.c
@@ -22,39 +22,37 @@
#if HAVE_ALTIVEC_H
#include <altivec.h>
#endif
+
#include "libavutil/common.h"
#include "dsputil_altivec.h"
-#define vs16(v) ((vector signed short)(v))
-#define vs32(v) ((vector signed int)(v))
-#define vu8(v) ((vector unsigned char)(v))
-#define vu16(v) ((vector unsigned short)(v))
-#define vu32(v) ((vector unsigned int)(v))
-
-
-#define C1 0.98078525066375732421875000 /* cos(1*PI/16) */
-#define C2 0.92387950420379638671875000 /* cos(2*PI/16) */
-#define C3 0.83146959543228149414062500 /* cos(3*PI/16) */
-#define C4 0.70710676908493041992187500 /* cos(4*PI/16) */
-#define C5 0.55557024478912353515625000 /* cos(5*PI/16) */
-#define C6 0.38268342614173889160156250 /* cos(6*PI/16) */
-#define C7 0.19509032368659973144531250 /* cos(7*PI/16) */
-#define SQRT_2 1.41421353816986083984375000 /* sqrt(2) */
-
+#define vs16(v) ((vector signed short) (v))
+#define vs32(v) ((vector signed int) (v))
+#define vu8(v) ((vector unsigned char) (v))
+#define vu16(v) ((vector unsigned short) (v))
+#define vu32(v) ((vector unsigned int) (v))
+
+#define C1 0.98078525066375732421875000 /* cos(1 * PI / 16) */
+#define C2 0.92387950420379638671875000 /* cos(2 * PI / 16) */
+#define C3 0.83146959543228149414062500 /* cos(3 * PI / 16) */
+#define C4 0.70710676908493041992187500 /* cos(4 * PI / 16) */
+#define C5 0.55557024478912353515625000 /* cos(5 * PI / 16) */
+#define C6 0.38268342614173889160156250 /* cos(6 * PI / 16) */
+#define C7 0.19509032368659973144531250 /* cos(7 * PI / 16) */
+#define SQRT_2 1.41421353816986083984375000 /* sqrt(2) */
#define W0 -(2 * C2)
-#define W1 (2 * C6)
+#define W1 (2 * C6)
#define W2 (SQRT_2 * C6)
#define W3 (SQRT_2 * C3)
#define W4 (SQRT_2 * (-C1 + C3 + C5 - C7))
-#define W5 (SQRT_2 * ( C1 + C3 - C5 + C7))
-#define W6 (SQRT_2 * ( C1 + C3 + C5 - C7))
-#define W7 (SQRT_2 * ( C1 + C3 - C5 - C7))
-#define W8 (SQRT_2 * ( C7 - C3))
+#define W5 (SQRT_2 * (C1 + C3 - C5 + C7))
+#define W6 (SQRT_2 * (C1 + C3 + C5 - C7))
+#define W7 (SQRT_2 * (C1 + C3 - C5 - C7))
+#define W8 (SQRT_2 * (C7 - C3))
#define W9 (SQRT_2 * (-C1 - C3))
#define WA (SQRT_2 * (-C3 - C5))
-#define WB (SQRT_2 * ( C5 - C3))
-
+#define WB (SQRT_2 * (C5 - C3))
static vector float fdctconsts[3] = {
{ W0, W1, W2, W3 },
@@ -75,8 +73,7 @@ static vector float fdctconsts[3] = {
#define LD_WA vec_splat(cnsts2, 2)
#define LD_WB vec_splat(cnsts2, 3)
-
-#define FDCTROW(b0,b1,b2,b3,b4,b5,b6,b7) /* {{{ */ \
+#define FDCTROW(b0, b1, b2, b3, b4, b5, b6, b7) /* {{{ */ \
x0 = vec_add(b0, b7); /* x0 = b0 + b7; */ \
x7 = vec_sub(b0, b7); /* x7 = b0 - b7; */ \
x1 = vec_add(b1, b6); /* x1 = b1 + b6; */ \
@@ -91,49 +88,49 @@ static vector float fdctconsts[3] = {
b0 = vec_add(b7, b1); /* b0 = b7 + b1; */ \
b4 = vec_sub(b7, b1); /* b4 = b7 - b1; */ \
\
- b2 = vec_sub(x0, x3); /* b2 = x0 - x3; */ \
- b6 = vec_sub(x1, x2); /* b6 = x1 - x2; */ \
- b5 = vec_add(b6, b2); /* b5 = b6 + b2; */ \
+ b2 = vec_sub(x0, x3); /* b2 = x0 - x3; */ \
+ b6 = vec_sub(x1, x2); /* b6 = x1 - x2; */ \
+ b5 = vec_add(b6, b2); /* b5 = b6 + b2; */ \
cnst = LD_W2; \
- b5 = vec_madd(cnst, b5, mzero); /* b5 = b5 * W2; */ \
+ b5 = vec_madd(cnst, b5, mzero); /* b5 = b5 * W2; */ \
cnst = LD_W1; \
- b2 = vec_madd(cnst, b2, b5); /* b2 = b5 + b2 * W1; */ \
+ b2 = vec_madd(cnst, b2, b5); /* b2 = b5 + b2 * W1; */ \
cnst = LD_W0; \
- b6 = vec_madd(cnst, b6, b5); /* b6 = b5 + b6 * W0; */ \
+ b6 = vec_madd(cnst, b6, b5); /* b6 = b5 + b6 * W0; */ \
\
- x0 = vec_add(x4, x7); /* x0 = x4 + x7; */ \
- x1 = vec_add(x5, x6); /* x1 = x5 + x6; */ \
- x2 = vec_add(x4, x6); /* x2 = x4 + x6; */ \
- x3 = vec_add(x5, x7); /* x3 = x5 + x7; */ \
- x8 = vec_add(x2, x3); /* x8 = x2 + x3; */ \
+ x0 = vec_add(x4, x7); /* x0 = x4 + x7; */ \
+ x1 = vec_add(x5, x6); /* x1 = x5 + x6; */ \
+ x2 = vec_add(x4, x6); /* x2 = x4 + x6; */ \
+ x3 = vec_add(x5, x7); /* x3 = x5 + x7; */ \
+ x8 = vec_add(x2, x3); /* x8 = x2 + x3; */ \
cnst = LD_W3; \
- x8 = vec_madd(cnst, x8, mzero); /* x8 = x8 * W3; */ \
+ x8 = vec_madd(cnst, x8, mzero); /* x8 = x8 * W3; */ \
\
cnst = LD_W8; \
- x0 = vec_madd(cnst, x0, mzero); /* x0 *= W8; */ \
+ x0 = vec_madd(cnst, x0, mzero); /* x0 *= W8; */ \
cnst = LD_W9; \
- x1 = vec_madd(cnst, x1, mzero); /* x1 *= W9; */ \
+ x1 = vec_madd(cnst, x1, mzero); /* x1 *= W9; */ \
cnst = LD_WA; \
- x2 = vec_madd(cnst, x2, x8); /* x2 = x2 * WA + x8; */ \
+ x2 = vec_madd(cnst, x2, x8); /* x2 = x2 * WA + x8; */ \
cnst = LD_WB; \
- x3 = vec_madd(cnst, x3, x8); /* x3 = x3 * WB + x8; */ \
+ x3 = vec_madd(cnst, x3, x8); /* x3 = x3 * WB + x8; */ \
\
cnst = LD_W4; \
- b7 = vec_madd(cnst, x4, x0); /* b7 = x4 * W4 + x0; */ \
+ b7 = vec_madd(cnst, x4, x0); /* b7 = x4 * W4 + x0; */ \
cnst = LD_W5; \
- b5 = vec_madd(cnst, x5, x1); /* b5 = x5 * W5 + x1; */ \
+ b5 = vec_madd(cnst, x5, x1); /* b5 = x5 * W5 + x1; */ \
cnst = LD_W6; \
- b3 = vec_madd(cnst, x6, x1); /* b3 = x6 * W6 + x1; */ \
+ b3 = vec_madd(cnst, x6, x1); /* b3 = x6 * W6 + x1; */ \
cnst = LD_W7; \
- b1 = vec_madd(cnst, x7, x0); /* b1 = x7 * W7 + x0; */ \
+ b1 = vec_madd(cnst, x7, x0); /* b1 = x7 * W7 + x0; */ \
\
b7 = vec_add(b7, x2); /* b7 = b7 + x2; */ \
b5 = vec_add(b5, x3); /* b5 = b5 + x3; */ \
b3 = vec_add(b3, x2); /* b3 = b3 + x2; */ \
- b1 = vec_add(b1, x3); /* b1 = b1 + x3; */ \
+ b1 = vec_add(b1, x3) /* b1 = b1 + x3; */ \
/* }}} */
-#define FDCTCOL(b0,b1,b2,b3,b4,b5,b6,b7) /* {{{ */ \
+#define FDCTCOL(b0, b1, b2, b3, b4, b5, b6, b7) /* {{{ */ \
x0 = vec_add(b0, b7); /* x0 = b0 + b7; */ \
x7 = vec_sub(b0, b7); /* x7 = b0 - b7; */ \
x1 = vec_add(b1, b6); /* x1 = b1 + b6; */ \
@@ -148,56 +145,53 @@ static vector float fdctconsts[3] = {
b0 = vec_add(b7, b1); /* b0 = b7 + b1; */ \
b4 = vec_sub(b7, b1); /* b4 = b7 - b1; */ \
\
- b2 = vec_sub(x0, x3); /* b2 = x0 - x3; */ \
- b6 = vec_sub(x1, x2); /* b6 = x1 - x2; */ \
- b5 = vec_add(b6, b2); /* b5 = b6 + b2; */ \
+ b2 = vec_sub(x0, x3); /* b2 = x0 - x3; */ \
+ b6 = vec_sub(x1, x2); /* b6 = x1 - x2; */ \
+ b5 = vec_add(b6, b2); /* b5 = b6 + b2; */ \
cnst = LD_W2; \
- b5 = vec_madd(cnst, b5, mzero); /* b5 = b5 * W2; */ \
+ b5 = vec_madd(cnst, b5, mzero); /* b5 = b5 * W2; */ \
cnst = LD_W1; \
- b2 = vec_madd(cnst, b2, b5); /* b2 = b5 + b2 * W1; */ \
+ b2 = vec_madd(cnst, b2, b5); /* b2 = b5 + b2 * W1; */ \
cnst = LD_W0; \
- b6 = vec_madd(cnst, b6, b5); /* b6 = b5 + b6 * W0; */ \
+ b6 = vec_madd(cnst, b6, b5); /* b6 = b5 + b6 * W0; */ \
\
- x0 = vec_add(x4, x7); /* x0 = x4 + x7; */ \
- x1 = vec_add(x5, x6); /* x1 = x5 + x6; */ \
- x2 = vec_add(x4, x6); /* x2 = x4 + x6; */ \
- x3 = vec_add(x5, x7); /* x3 = x5 + x7; */ \
- x8 = vec_add(x2, x3); /* x8 = x2 + x3; */ \
+ x0 = vec_add(x4, x7); /* x0 = x4 + x7; */ \
+ x1 = vec_add(x5, x6); /* x1 = x5 + x6; */ \
+ x2 = vec_add(x4, x6); /* x2 = x4 + x6; */ \
+ x3 = vec_add(x5, x7); /* x3 = x5 + x7; */ \
+ x8 = vec_add(x2, x3); /* x8 = x2 + x3; */ \
cnst = LD_W3; \
- x8 = vec_madd(cnst, x8, mzero); /* x8 = x8 * W3; */ \
+ x8 = vec_madd(cnst, x8, mzero); /* x8 = x8 * W3; */ \
\
cnst = LD_W8; \
- x0 = vec_madd(cnst, x0, mzero); /* x0 *= W8; */ \
+ x0 = vec_madd(cnst, x0, mzero); /* x0 *= W8; */ \
cnst = LD_W9; \
- x1 = vec_madd(cnst, x1, mzero); /* x1 *= W9; */ \
+ x1 = vec_madd(cnst, x1, mzero); /* x1 *= W9; */ \
cnst = LD_WA; \
- x2 = vec_madd(cnst, x2, x8); /* x2 = x2 * WA + x8; */ \
+ x2 = vec_madd(cnst, x2, x8); /* x2 = x2 * WA + x8; */ \
cnst = LD_WB; \
- x3 = vec_madd(cnst, x3, x8); /* x3 = x3 * WB + x8; */ \
+ x3 = vec_madd(cnst, x3, x8); /* x3 = x3 * WB + x8; */ \
\
cnst = LD_W4; \
- b7 = vec_madd(cnst, x4, x0); /* b7 = x4 * W4 + x0; */ \
+ b7 = vec_madd(cnst, x4, x0); /* b7 = x4 * W4 + x0; */ \
cnst = LD_W5; \
- b5 = vec_madd(cnst, x5, x1); /* b5 = x5 * W5 + x1; */ \
+ b5 = vec_madd(cnst, x5, x1); /* b5 = x5 * W5 + x1; */ \
cnst = LD_W6; \
- b3 = vec_madd(cnst, x6, x1); /* b3 = x6 * W6 + x1; */ \
+ b3 = vec_madd(cnst, x6, x1); /* b3 = x6 * W6 + x1; */ \
cnst = LD_W7; \
- b1 = vec_madd(cnst, x7, x0); /* b1 = x7 * W7 + x0; */ \
+ b1 = vec_madd(cnst, x7, x0); /* b1 = x7 * W7 + x0; */ \
\
b7 = vec_add(b7, x2); /* b7 += x2; */ \
b5 = vec_add(b5, x3); /* b5 += x3; */ \
b3 = vec_add(b3, x2); /* b3 += x2; */ \
- b1 = vec_add(b1, x3); /* b1 += x3; */ \
+ b1 = vec_add(b1, x3) /* b1 += x3; */ \
/* }}} */
-
-
/* two dimensional discrete cosine transform */
-
void ff_fdct_altivec(int16_t *block)
{
vector signed short *bp;
- vector float *cp;
+ vector float *cp = fdctconsts;
vector float b00, b10, b20, b30, b40, b50, b60, b70;
vector float b01, b11, b21, b31, b41, b51, b61, b71;
vector float mzero, cnst, cnsts0, cnsts1, cnsts2;
@@ -205,92 +199,91 @@ void ff_fdct_altivec(int16_t *block)
/* setup constants {{{ */
/* mzero = -0.0 */
- mzero = ((vector float)vec_splat_u32(-1));
- mzero = ((vector float)vec_sl(vu32(mzero), vu32(mzero)));
- cp = fdctconsts;
- cnsts0 = vec_ld(0, cp); cp++;
- cnsts1 = vec_ld(0, cp); cp++;
+ mzero = ((vector float) vec_splat_u32(-1));
+ mzero = ((vector float) vec_sl(vu32(mzero), vu32(mzero)));
+ cnsts0 = vec_ld(0, cp);
+ cp++;
+ cnsts1 = vec_ld(0, cp);
+ cp++;
cnsts2 = vec_ld(0, cp);
/* }}} */
-
/* 8x8 matrix transpose (vector short[8]) {{{ */
-#define MERGE_S16(hl,a,b) vec_merge##hl(vs16(a), vs16(b))
+#define MERGE_S16(hl, a, b) vec_merge ## hl(vs16(a), vs16(b))
- bp = (vector signed short*)block;
- b00 = ((vector float)vec_ld(0, bp));
- b40 = ((vector float)vec_ld(16*4, bp));
- b01 = ((vector float)MERGE_S16(h, b00, b40));
- b11 = ((vector float)MERGE_S16(l, b00, b40));
+ bp = (vector signed short *) block;
+ b00 = ((vector float) vec_ld(0, bp));
+ b40 = ((vector float) vec_ld(16 * 4, bp));
+ b01 = ((vector float) MERGE_S16(h, b00, b40));
+ b11 = ((vector float) MERGE_S16(l, b00, b40));
bp++;
- b10 = ((vector float)vec_ld(0, bp));
- b50 = ((vector float)vec_ld(16*4, bp));
- b21 = ((vector float)MERGE_S16(h, b10, b50));
- b31 = ((vector float)MERGE_S16(l, b10, b50));
+ b10 = ((vector float) vec_ld(0, bp));
+ b50 = ((vector float) vec_ld(16 * 4, bp));
+ b21 = ((vector float) MERGE_S16(h, b10, b50));
+ b31 = ((vector float) MERGE_S16(l, b10, b50));
bp++;
- b20 = ((vector float)vec_ld(0, bp));
- b60 = ((vector float)vec_ld(16*4, bp));
- b41 = ((vector float)MERGE_S16(h, b20, b60));
- b51 = ((vector float)MERGE_S16(l, b20, b60));
+ b20 = ((vector float) vec_ld(0, bp));
+ b60 = ((vector float) vec_ld(16 * 4, bp));
+ b41 = ((vector float) MERGE_S16(h, b20, b60));
+ b51 = ((vector float) MERGE_S16(l, b20, b60));
bp++;
- b30 = ((vector float)vec_ld(0, bp));
- b70 = ((vector float)vec_ld(16*4, bp));
- b61 = ((vector float)MERGE_S16(h, b30, b70));
- b71 = ((vector float)MERGE_S16(l, b30, b70));
-
- x0 = ((vector float)MERGE_S16(h, b01, b41));
- x1 = ((vector float)MERGE_S16(l, b01, b41));
- x2 = ((vector float)MERGE_S16(h, b11, b51));
- x3 = ((vector float)MERGE_S16(l, b11, b51));
- x4 = ((vector float)MERGE_S16(h, b21, b61));
- x5 = ((vector float)MERGE_S16(l, b21, b61));
- x6 = ((vector float)MERGE_S16(h, b31, b71));
- x7 = ((vector float)MERGE_S16(l, b31, b71));
-
- b00 = ((vector float)MERGE_S16(h, x0, x4));
- b10 = ((vector float)MERGE_S16(l, x0, x4));
- b20 = ((vector float)MERGE_S16(h, x1, x5));
- b30 = ((vector float)MERGE_S16(l, x1, x5));
- b40 = ((vector float)MERGE_S16(h, x2, x6));
- b50 = ((vector float)MERGE_S16(l, x2, x6));
- b60 = ((vector float)MERGE_S16(h, x3, x7));
- b70 = ((vector float)MERGE_S16(l, x3, x7));
+ b30 = ((vector float) vec_ld(0, bp));
+ b70 = ((vector float) vec_ld(16 * 4, bp));
+ b61 = ((vector float) MERGE_S16(h, b30, b70));
+ b71 = ((vector float) MERGE_S16(l, b30, b70));
+
+ x0 = ((vector float) MERGE_S16(h, b01, b41));
+ x1 = ((vector float) MERGE_S16(l, b01, b41));
+ x2 = ((vector float) MERGE_S16(h, b11, b51));
+ x3 = ((vector float) MERGE_S16(l, b11, b51));
+ x4 = ((vector float) MERGE_S16(h, b21, b61));
+ x5 = ((vector float) MERGE_S16(l, b21, b61));
+ x6 = ((vector float) MERGE_S16(h, b31, b71));
+ x7 = ((vector float) MERGE_S16(l, b31, b71));
+
+ b00 = ((vector float) MERGE_S16(h, x0, x4));
+ b10 = ((vector float) MERGE_S16(l, x0, x4));
+ b20 = ((vector float) MERGE_S16(h, x1, x5));
+ b30 = ((vector float) MERGE_S16(l, x1, x5));
+ b40 = ((vector float) MERGE_S16(h, x2, x6));
+ b50 = ((vector float) MERGE_S16(l, x2, x6));
+ b60 = ((vector float) MERGE_S16(h, x3, x7));
+ b70 = ((vector float) MERGE_S16(l, x3, x7));
#undef MERGE_S16
/* }}} */
+ /* Some of the initial calculations can be done as vector short
+ * before conversion to vector float. The following code section
+ * takes advantage of this. */
-/* Some of the initial calculations can be done as vector short before
- * conversion to vector float. The following code section takes advantage
- * of this.
- */
/* fdct rows {{{ */
- x0 = ((vector float)vec_add(vs16(b00), vs16(b70)));
- x7 = ((vector float)vec_sub(vs16(b00), vs16(b70)));
- x1 = ((vector float)vec_add(vs16(b10), vs16(b60)));
- x6 = ((vector float)vec_sub(vs16(b10), vs16(b60)));
- x2 = ((vector float)vec_add(vs16(b20), vs16(b50)));
- x5 = ((vector float)vec_sub(vs16(b20), vs16(b50)));
- x3 = ((vector float)vec_add(vs16(b30), vs16(b40)));
- x4 = ((vector float)vec_sub(vs16(b30), vs16(b40)));
-
- b70 = ((vector float)vec_add(vs16(x0), vs16(x3)));
- b10 = ((vector float)vec_add(vs16(x1), vs16(x2)));
-
- b00 = ((vector float)vec_add(vs16(b70), vs16(b10)));
- b40 = ((vector float)vec_sub(vs16(b70), vs16(b10)));
-
-#define CTF0(n) \
- b##n##1 = ((vector float)vec_unpackl(vs16(b##n##0))); \
- b##n##0 = ((vector float)vec_unpackh(vs16(b##n##0))); \
- b##n##1 = vec_ctf(vs32(b##n##1), 0); \
- b##n##0 = vec_ctf(vs32(b##n##0), 0);
+ x0 = ((vector float) vec_add(vs16(b00), vs16(b70)));
+ x7 = ((vector float) vec_sub(vs16(b00), vs16(b70)));
+ x1 = ((vector float) vec_add(vs16(b10), vs16(b60)));
+ x6 = ((vector float) vec_sub(vs16(b10), vs16(b60)));
+ x2 = ((vector float) vec_add(vs16(b20), vs16(b50)));
+ x5 = ((vector float) vec_sub(vs16(b20), vs16(b50)));
+ x3 = ((vector float) vec_add(vs16(b30), vs16(b40)));
+ x4 = ((vector float) vec_sub(vs16(b30), vs16(b40)));
+
+ b70 = ((vector float) vec_add(vs16(x0), vs16(x3)));
+ b10 = ((vector float) vec_add(vs16(x1), vs16(x2)));
+
+ b00 = ((vector float) vec_add(vs16(b70), vs16(b10)));
+ b40 = ((vector float) vec_sub(vs16(b70), vs16(b10)));
+
+#define CTF0(n) \
+ b ## n ## 1 = ((vector float) vec_unpackl(vs16(b ## n ## 0))); \
+ b ## n ## 0 = ((vector float) vec_unpackh(vs16(b ## n ## 0))); \
+ b ## n ## 1 = vec_ctf(vs32(b ## n ## 1), 0); \
+ b ## n ## 0 = vec_ctf(vs32(b ## n ## 0), 0)
CTF0(0);
CTF0(4);
- b20 = ((vector float)vec_sub(vs16(x0), vs16(x3)));
- b60 = ((vector float)vec_sub(vs16(x1), vs16(x2)));
+ b20 = ((vector float) vec_sub(vs16(x0), vs16(x3)));
+ b60 = ((vector float) vec_sub(vs16(x1), vs16(x2)));
CTF0(2);
CTF0(6);
@@ -301,20 +294,20 @@ void ff_fdct_altivec(int16_t *block)
x1 = vec_add(b61, b21);
cnst = LD_W2;
- x0 = vec_madd(cnst, x0, mzero);
- x1 = vec_madd(cnst, x1, mzero);
+ x0 = vec_madd(cnst, x0, mzero);
+ x1 = vec_madd(cnst, x1, mzero);
cnst = LD_W1;
- b20 = vec_madd(cnst, b20, x0);
- b21 = vec_madd(cnst, b21, x1);
+ b20 = vec_madd(cnst, b20, x0);
+ b21 = vec_madd(cnst, b21, x1);
cnst = LD_W0;
- b60 = vec_madd(cnst, b60, x0);
- b61 = vec_madd(cnst, b61, x1);
+ b60 = vec_madd(cnst, b60, x0);
+ b61 = vec_madd(cnst, b61, x1);
-#define CTFX(x,b) \
- b##0 = ((vector float)vec_unpackh(vs16(x))); \
- b##1 = ((vector float)vec_unpackl(vs16(x))); \
- b##0 = vec_ctf(vs32(b##0), 0); \
- b##1 = vec_ctf(vs32(b##1), 0); \
+#define CTFX(x, b) \
+ b ## 0 = ((vector float) vec_unpackh(vs16(x))); \
+ b ## 1 = ((vector float) vec_unpackl(vs16(x))); \
+ b ## 0 = vec_ctf(vs32(b ## 0), 0); \
+ b ## 1 = vec_ctf(vs32(b ## 1), 0)
CTFX(x4, b7);
CTFX(x5, b5);
@@ -323,64 +316,62 @@ void ff_fdct_altivec(int16_t *block)
#undef CTFX
-
- x0 = vec_add(b70, b10);
- x1 = vec_add(b50, b30);
- x2 = vec_add(b70, b30);
- x3 = vec_add(b50, b10);
- x8 = vec_add(x2, x3);
+ x0 = vec_add(b70, b10);
+ x1 = vec_add(b50, b30);
+ x2 = vec_add(b70, b30);
+ x3 = vec_add(b50, b10);
+ x8 = vec_add(x2, x3);
cnst = LD_W3;
- x8 = vec_madd(cnst, x8, mzero);
+ x8 = vec_madd(cnst, x8, mzero);
cnst = LD_W8;
- x0 = vec_madd(cnst, x0, mzero);
+ x0 = vec_madd(cnst, x0, mzero);
cnst = LD_W9;
- x1 = vec_madd(cnst, x1, mzero);
+ x1 = vec_madd(cnst, x1, mzero);
cnst = LD_WA;
- x2 = vec_madd(cnst, x2, x8);
+ x2 = vec_madd(cnst, x2, x8);
cnst = LD_WB;
- x3 = vec_madd(cnst, x3, x8);
+ x3 = vec_madd(cnst, x3, x8);
cnst = LD_W4;
- b70 = vec_madd(cnst, b70, x0);
+ b70 = vec_madd(cnst, b70, x0);
cnst = LD_W5;
- b50 = vec_madd(cnst, b50, x1);
+ b50 = vec_madd(cnst, b50, x1);
cnst = LD_W6;
- b30 = vec_madd(cnst, b30, x1);
+ b30 = vec_madd(cnst, b30, x1);
cnst = LD_W7;
- b10 = vec_madd(cnst, b10, x0);
+ b10 = vec_madd(cnst, b10, x0);
b70 = vec_add(b70, x2);
b50 = vec_add(b50, x3);
b30 = vec_add(b30, x2);
b10 = vec_add(b10, x3);
-
- x0 = vec_add(b71, b11);
- x1 = vec_add(b51, b31);
- x2 = vec_add(b71, b31);
- x3 = vec_add(b51, b11);
- x8 = vec_add(x2, x3);
+ x0 = vec_add(b71, b11);
+ x1 = vec_add(b51, b31);
+ x2 = vec_add(b71, b31);
+ x3 = vec_add(b51, b11);
+ x8 = vec_add(x2, x3);
cnst = LD_W3;
- x8 = vec_madd(cnst, x8, mzero);
+ x8 = vec_madd(cnst, x8, mzero);
cnst = LD_W8;
- x0 = vec_madd(cnst, x0, mzero);
+ x0 = vec_madd(cnst, x0, mzero);
cnst = LD_W9;
- x1 = vec_madd(cnst, x1, mzero);
+ x1 = vec_madd(cnst, x1, mzero);
cnst = LD_WA;
- x2 = vec_madd(cnst, x2, x8);
+ x2 = vec_madd(cnst, x2, x8);
cnst = LD_WB;
- x3 = vec_madd(cnst, x3, x8);
+ x3 = vec_madd(cnst, x3, x8);
cnst = LD_W4;
- b71 = vec_madd(cnst, b71, x0);
+ b71 = vec_madd(cnst, b71, x0);
cnst = LD_W5;
- b51 = vec_madd(cnst, b51, x1);
+ b51 = vec_madd(cnst, b51, x1);
cnst = LD_W6;
- b31 = vec_madd(cnst, b31, x1);
+ b31 = vec_madd(cnst, b31, x1);
cnst = LD_W7;
- b11 = vec_madd(cnst, b11, x0);
+ b11 = vec_madd(cnst, b11, x0);
b71 = vec_add(b71, x2);
b51 = vec_add(b51, x3);
@@ -388,7 +379,6 @@ void ff_fdct_altivec(int16_t *block)
b11 = vec_add(b11, x3);
/* }}} */
-
/* 8x8 matrix transpose (vector float[8][2]) {{{ */
x0 = vec_mergel(b00, b20);
x1 = vec_mergeh(b00, b20);
@@ -431,28 +421,34 @@ void ff_fdct_altivec(int16_t *block)
b31 = vec_mergel(x4, x6);
/* }}} */
-
FDCTCOL(b00, b10, b20, b30, b40, b50, b60, b70);
FDCTCOL(b01, b11, b21, b31, b41, b51, b61, b71);
-
/* round, convert back to short {{{ */
-#define CTS(n) \
- b##n##0 = vec_round(b##n##0); \
- b##n##1 = vec_round(b##n##1); \
- b##n##0 = ((vector float)vec_cts(b##n##0, 0)); \
- b##n##1 = ((vector float)vec_cts(b##n##1, 0)); \
- b##n##0 = ((vector float)vec_pack(vs32(b##n##0), vs32(b##n##1))); \
- vec_st(vs16(b##n##0), 0, bp);
-
- bp = (vector signed short*)block;
- CTS(0); bp++;
- CTS(1); bp++;
- CTS(2); bp++;
- CTS(3); bp++;
- CTS(4); bp++;
- CTS(5); bp++;
- CTS(6); bp++;
+#define CTS(n) \
+ b ## n ## 0 = vec_round(b ## n ## 0); \
+ b ## n ## 1 = vec_round(b ## n ## 1); \
+ b ## n ## 0 = ((vector float) vec_cts(b ## n ## 0, 0)); \
+ b ## n ## 1 = ((vector float) vec_cts(b ## n ## 1, 0)); \
+ b ## n ## 0 = ((vector float) vec_pack(vs32(b ## n ## 0), \
+ vs32(b ## n ## 1))); \
+ vec_st(vs16(b ## n ## 0), 0, bp)
+
+ bp = (vector signed short *) block;
+ CTS(0);
+ bp++;
+ CTS(1);
+ bp++;
+ CTS(2);
+ bp++;
+ CTS(3);
+ bp++;
+ CTS(4);
+ bp++;
+ CTS(5);
+ bp++;
+ CTS(6);
+ bp++;
CTS(7);
#undef CTS
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/fft_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/fft_altivec.c
index 2357198f1ee..8f14d27e17f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/fft_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/fft_altivec.c
@@ -27,12 +27,12 @@
#include "libavcodec/fft.h"
/**
- * Do a complex FFT with the parameters defined in ff_fft_init(). The
- * input data must be permuted before with s->revtab table. No
- * 1.0/sqrt(n) normalization is done.
- * AltiVec-enabled
- * This code assumes that the 'z' pointer is 16 bytes-aligned
- * It also assumes all FFTComplex are 8 bytes-aligned pair of float
+ * Do a complex FFT with the parameters defined in ff_fft_init().
+ * The input data must be permuted before with s->revtab table.
+ * No 1.0 / sqrt(n) normalization is done.
+ * AltiVec-enabled:
+ * This code assumes that the 'z' pointer is 16 bytes-aligned.
+ * It also assumes all FFTComplex are 8 bytes-aligned pairs of floats.
*/
void ff_fft_calc_altivec(FFTContext *s, FFTComplex *z);
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c
index cd32e39384a..011633e4fe0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c
@@ -24,7 +24,6 @@
#include "libavutil/mem.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/fmtconvert.h"
-#include "dsputil_altivec.h"
#if HAVE_ALTIVEC
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/gmc_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/gmc_altivec.c
index 45d850a2965..683a056b63f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/gmc_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/gmc_altivec.c
@@ -1,6 +1,6 @@
/*
- * GMC (Global Motion Compensation)
- * AltiVec-enabled
+ * GMC (Global Motion Compensation), AltiVec-enabled
+ *
* Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org>
*
* This file is part of FFmpeg.
@@ -25,102 +25,96 @@
#include "libavutil/ppc/util_altivec.h"
#include "dsputil_altivec.h"
-/*
- altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8,
- to preserve proper dst alignment.
-*/
-void ff_gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder)
+/* AltiVec-enhanced gmc1. ATM this code assumes stride is a multiple of 8
+ * to preserve proper dst alignment. */
+void ff_gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */,
+ int stride, int h, int x16, int y16, int rounder)
{
- const DECLARE_ALIGNED(16, unsigned short, rounder_a) = rounder;
- const DECLARE_ALIGNED(16, unsigned short, ABCD)[8] =
- {
- (16-x16)*(16-y16), /* A */
- ( x16)*(16-y16), /* B */
- (16-x16)*( y16), /* C */
- ( x16)*( y16), /* D */
- 0, 0, 0, 0 /* padding */
- };
- register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
- register const vector unsigned short vcsr8 = (const vector unsigned short)vec_splat_u16(8);
- register vector unsigned char dstv, dstv2, src_0, src_1, srcvA, srcvB, srcvC, srcvD;
- register vector unsigned short Av, Bv, Cv, Dv, rounderV, tempA, tempB, tempC, tempD;
int i;
- unsigned long dst_odd = (unsigned long)dst & 0x0000000F;
- unsigned long src_really_odd = (unsigned long)src & 0x0000000F;
-
- tempA = vec_ld(0, (const unsigned short*)ABCD);
- Av = vec_splat(tempA, 0);
- Bv = vec_splat(tempA, 1);
- Cv = vec_splat(tempA, 2);
- Dv = vec_splat(tempA, 3);
-
- rounderV = vec_splat((vec_u16)vec_lde(0, &rounder_a), 0);
-
- // we'll be able to pick-up our 9 char elements
- // at src from those 32 bytes
- // we load the first batch here, as inside the loop
- // we can re-use 'src+stride' from one iteration
- // as the 'src' of the next.
- src_0 = vec_ld(0, src);
- src_1 = vec_ld(16, src);
- srcvA = vec_perm(src_0, src_1, vec_lvsl(0, src));
-
- if (src_really_odd != 0x0000000F) {
- // if (src & 0xF) == 0xF, then (src+1) is properly aligned
- // on the second vector.
+ const DECLARE_ALIGNED(16, unsigned short, rounder_a) = rounder;
+ const DECLARE_ALIGNED(16, unsigned short, ABCD)[8] = {
+ (16 - x16) * (16 - y16), /* A */
+ (x16) * (16 - y16), /* B */
+ (16 - x16) * (y16), /* C */
+ (x16) * (y16), /* D */
+ 0, 0, 0, 0 /* padding */
+ };
+ register const vector unsigned char vczero =
+ (const vector unsigned char) vec_splat_u8(0);
+ register const vector unsigned short vcsr8 =
+ (const vector unsigned short) vec_splat_u16(8);
+ register vector unsigned char dstv, dstv2, srcvB, srcvC, srcvD;
+ register vector unsigned short tempB, tempC, tempD;
+ unsigned long dst_odd = (unsigned long) dst & 0x0000000F;
+ unsigned long src_really_odd = (unsigned long) src & 0x0000000F;
+ register vector unsigned short tempA =
+ vec_ld(0, (const unsigned short *) ABCD);
+ register vector unsigned short Av = vec_splat(tempA, 0);
+ register vector unsigned short Bv = vec_splat(tempA, 1);
+ register vector unsigned short Cv = vec_splat(tempA, 2);
+ register vector unsigned short Dv = vec_splat(tempA, 3);
+ register vector unsigned short rounderV =
+ vec_splat((vec_u16) vec_lde(0, &rounder_a), 0);
+
+ /* we'll be able to pick-up our 9 char elements at src from those
+ * 32 bytes we load the first batch here, as inside the loop we can
+ * reuse 'src + stride' from one iteration as the 'src' of the next. */
+ register vector unsigned char src_0 = vec_ld(0, src);
+ register vector unsigned char src_1 = vec_ld(16, src);
+ register vector unsigned char srcvA = vec_perm(src_0, src_1,
+ vec_lvsl(0, src));
+
+ if (src_really_odd != 0x0000000F)
+ /* If (src & 0xF) == 0xF, then (src + 1) is properly aligned
+ * on the second vector. */
srcvB = vec_perm(src_0, src_1, vec_lvsl(1, src));
- } else {
+ else
srcvB = src_1;
- }
srcvA = vec_mergeh(vczero, srcvA);
srcvB = vec_mergeh(vczero, srcvB);
- for(i=0; i<h; i++) {
- dst_odd = (unsigned long)dst & 0x0000000F;
- src_really_odd = (((unsigned long)src) + stride) & 0x0000000F;
+ for (i = 0; i < h; i++) {
+ dst_odd = (unsigned long) dst & 0x0000000F;
+ src_really_odd = (((unsigned long) src) + stride) & 0x0000000F;
dstv = vec_ld(0, dst);
- // we we'll be able to pick-up our 9 char elements
- // at src + stride from those 32 bytes
- // then reuse the resulting 2 vectors srvcC and srcvD
- // as the next srcvA and srcvB
- src_0 = vec_ld(stride + 0, src);
+ /* We'll be able to pick-up our 9 char elements at src + stride from
+ * those 32 bytes then reuse the resulting 2 vectors srvcC and srcvD
+ * as the next srcvA and srcvB. */
+ src_0 = vec_ld(stride + 0, src);
src_1 = vec_ld(stride + 16, src);
srcvC = vec_perm(src_0, src_1, vec_lvsl(stride + 0, src));
- if (src_really_odd != 0x0000000F) {
- // if (src & 0xF) == 0xF, then (src+1) is properly aligned
- // on the second vector.
+ if (src_really_odd != 0x0000000F)
+ /* If (src & 0xF) == 0xF, then (src + 1) is properly aligned
+ * on the second vector. */
srcvD = vec_perm(src_0, src_1, vec_lvsl(stride + 1, src));
- } else {
+ else
srcvD = src_1;
- }
srcvC = vec_mergeh(vczero, srcvC);
srcvD = vec_mergeh(vczero, srcvD);
-
- // OK, now we (finally) do the math :-)
- // those four instructions replaces 32 int muls & 32 int adds.
- // isn't AltiVec nice ?
- tempA = vec_mladd((vector unsigned short)srcvA, Av, rounderV);
- tempB = vec_mladd((vector unsigned short)srcvB, Bv, tempA);
- tempC = vec_mladd((vector unsigned short)srcvC, Cv, tempB);
- tempD = vec_mladd((vector unsigned short)srcvD, Dv, tempC);
+ /* OK, now we (finally) do the math :-)
+ * Those four instructions replace 32 int muls & 32 int adds.
+ * Isn't AltiVec nice? */
+ tempA = vec_mladd((vector unsigned short) srcvA, Av, rounderV);
+ tempB = vec_mladd((vector unsigned short) srcvB, Bv, tempA);
+ tempC = vec_mladd((vector unsigned short) srcvC, Cv, tempB);
+ tempD = vec_mladd((vector unsigned short) srcvD, Dv, tempC);
srcvA = srcvC;
srcvB = srcvD;
tempD = vec_sr(tempD, vcsr8);
- dstv2 = vec_pack(tempD, (vector unsigned short)vczero);
+ dstv2 = vec_pack(tempD, (vector unsigned short) vczero);
- if (dst_odd) {
- dstv2 = vec_perm(dstv, dstv2, vcprm(0,1,s0,s1));
- } else {
- dstv2 = vec_perm(dstv, dstv2, vcprm(s0,s1,2,3));
- }
+ if (dst_odd)
+ dstv2 = vec_perm(dstv, dstv2, vcprm(0, 1, s0, s1));
+ else
+ dstv2 = vec_perm(dstv, dstv2, vcprm(s0, s1, 2, 3));
vec_st(dstv2, 0, dst);
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/h264chroma_init.c b/chromium/third_party/ffmpeg/libavcodec/ppc/h264chroma_init.c
index 921f2deecb6..edf05ec9ba0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/h264chroma_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/h264chroma_init.c
@@ -25,7 +25,6 @@
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/h264chroma.h"
-#include "dsputil_altivec.h"
#if HAVE_ALTIVEC
#define PUT_OP_U8_ALTIVEC(d, s, dst) d = s
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/h264dsp.c b/chromium/third_party/ffmpeg/libavcodec/ppc/h264dsp.c
index 9e749b5bc66..f532197a524 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/h264dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/h264dsp.c
@@ -750,7 +750,7 @@ av_cold void ff_h264dsp_init_ppc(H264DSPContext *c, const int bit_depth,
if (bit_depth == 8) {
c->h264_idct_add = h264_idct_add_altivec;
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
c->h264_idct_add8 = h264_idct_add8_altivec;
c->h264_idct_add16 = h264_idct_add16_altivec;
c->h264_idct_add16intra = h264_idct_add16intra_altivec;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/h264qpel.c b/chromium/third_party/ffmpeg/libavcodec/ppc/h264qpel.c
index 1f50ec99297..41477677281 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/h264qpel.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/h264qpel.c
@@ -25,7 +25,7 @@
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/h264qpel.h"
-#include "dsputil_altivec.h"
+#include "hpeldsp_altivec.h"
#if HAVE_ALTIVEC
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/hpeldsp_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/hpeldsp_altivec.c
index 345ec39b95d..d82a7032654 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/hpeldsp_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/hpeldsp_altivec.c
@@ -31,7 +31,7 @@
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/hpeldsp.h"
-#include "dsputil_altivec.h"
+#include "hpeldsp_altivec.h"
#if HAVE_ALTIVEC
/* next one assumes that ((line_size % 16) == 0) */
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/hpeldsp_altivec.h b/chromium/third_party/ffmpeg/libavcodec/ppc/hpeldsp_altivec.h
new file mode 100644
index 00000000000..590809f5394
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/hpeldsp_altivec.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2002 Brian Foley
+ * Copyright (c) 2002 Dieter Shirley
+ * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
+ *
+ * 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_PPC_HPELDSP_ALTIVEC_H
+#define AVCODEC_PPC_HPELDSP_ALTIVEC_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+
+#endif /* AVCODEC_PPC_HPELDSP_ALTIVEC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/idct_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/idct_altivec.c
index c6f2cd8b8aa..cb6bd67a6fb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/idct_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/idct_altivec.c
@@ -18,199 +18,204 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/*
- * NOTE: This code is based on GPL code from the libmpeg2 project. The
+/* NOTE: This code is based on GPL code from the libmpeg2 project. The
* author, Michel Lespinasses, has given explicit permission to release
* under LGPL as part of FFmpeg.
- */
-
-/*
+ *
* FFmpeg integration by Dieter Shirley
*
* This file is a direct copy of the AltiVec IDCT module from the libmpeg2
* project. I've deleted all of the libmpeg2-specific code, renamed the
* functions and reordered the function parameters. The only change to the
* IDCT function itself was to factor out the partial transposition, and to
- * perform a full transpose at the end of the function.
- */
+ * perform a full transpose at the end of the function. */
-
-#include <stdlib.h> /* malloc(), free() */
+#include <stdlib.h>
#include <string.h>
#include "config.h"
#if HAVE_ALTIVEC_H
#include <altivec.h>
#endif
+
#include "libavutil/ppc/types_altivec.h"
#include "dsputil_altivec.h"
#define IDCT_HALF \
/* 1st stage */ \
- t1 = vec_mradds (a1, vx7, vx1 ); \
- t8 = vec_mradds (a1, vx1, vec_subs (zero, vx7)); \
- t7 = vec_mradds (a2, vx5, vx3); \
- t3 = vec_mradds (ma2, vx3, vx5); \
+ t1 = vec_mradds(a1, vx7, vx1); \
+ t8 = vec_mradds(a1, vx1, vec_subs(zero, vx7)); \
+ t7 = vec_mradds(a2, vx5, vx3); \
+ t3 = vec_mradds(ma2, vx3, vx5); \
\
/* 2nd stage */ \
- t5 = vec_adds (vx0, vx4); \
- t0 = vec_subs (vx0, vx4); \
- t2 = vec_mradds (a0, vx6, vx2); \
- t4 = vec_mradds (a0, vx2, vec_subs (zero, vx6)); \
- t6 = vec_adds (t8, t3); \
- t3 = vec_subs (t8, t3); \
- t8 = vec_subs (t1, t7); \
- t1 = vec_adds (t1, t7); \
+ t5 = vec_adds(vx0, vx4); \
+ t0 = vec_subs(vx0, vx4); \
+ t2 = vec_mradds(a0, vx6, vx2); \
+ t4 = vec_mradds(a0, vx2, vec_subs(zero, vx6)); \
+ t6 = vec_adds(t8, t3); \
+ t3 = vec_subs(t8, t3); \
+ t8 = vec_subs(t1, t7); \
+ t1 = vec_adds(t1, t7); \
\
/* 3rd stage */ \
- t7 = vec_adds (t5, t2); \
- t2 = vec_subs (t5, t2); \
- t5 = vec_adds (t0, t4); \
- t0 = vec_subs (t0, t4); \
- t4 = vec_subs (t8, t3); \
- t3 = vec_adds (t8, t3); \
+ t7 = vec_adds(t5, t2); \
+ t2 = vec_subs(t5, t2); \
+ t5 = vec_adds(t0, t4); \
+ t0 = vec_subs(t0, t4); \
+ t4 = vec_subs(t8, t3); \
+ t3 = vec_adds(t8, t3); \
\
/* 4th stage */ \
- vy0 = vec_adds (t7, t1); \
- vy7 = vec_subs (t7, t1); \
- vy1 = vec_mradds (c4, t3, t5); \
- vy6 = vec_mradds (mc4, t3, t5); \
- vy2 = vec_mradds (c4, t4, t0); \
- vy5 = vec_mradds (mc4, t4, t0); \
- vy3 = vec_adds (t2, t6); \
- vy4 = vec_subs (t2, t6);
-
-
-#define IDCT \
- vec_s16 vx0, vx1, vx2, vx3, vx4, vx5, vx6, vx7; \
- vec_s16 vy0, vy1, vy2, vy3, vy4, vy5, vy6, vy7; \
- vec_s16 a0, a1, a2, ma2, c4, mc4, zero, bias; \
- vec_s16 t0, t1, t2, t3, t4, t5, t6, t7, t8; \
- vec_u16 shift; \
- \
- c4 = vec_splat (constants[0], 0); \
- a0 = vec_splat (constants[0], 1); \
- a1 = vec_splat (constants[0], 2); \
- a2 = vec_splat (constants[0], 3); \
- mc4 = vec_splat (constants[0], 4); \
- ma2 = vec_splat (constants[0], 5); \
- bias = (vec_s16)vec_splat ((vec_s32)constants[0], 3); \
- \
- zero = vec_splat_s16 (0); \
- shift = vec_splat_u16 (4); \
- \
- vx0 = vec_mradds (vec_sl (block[0], shift), constants[1], zero); \
- vx1 = vec_mradds (vec_sl (block[1], shift), constants[2], zero); \
- vx2 = vec_mradds (vec_sl (block[2], shift), constants[3], zero); \
- vx3 = vec_mradds (vec_sl (block[3], shift), constants[4], zero); \
- vx4 = vec_mradds (vec_sl (block[4], shift), constants[1], zero); \
- vx5 = vec_mradds (vec_sl (block[5], shift), constants[4], zero); \
- vx6 = vec_mradds (vec_sl (block[6], shift), constants[3], zero); \
- vx7 = vec_mradds (vec_sl (block[7], shift), constants[2], zero); \
- \
- IDCT_HALF \
- \
- vx0 = vec_mergeh (vy0, vy4); \
- vx1 = vec_mergel (vy0, vy4); \
- vx2 = vec_mergeh (vy1, vy5); \
- vx3 = vec_mergel (vy1, vy5); \
- vx4 = vec_mergeh (vy2, vy6); \
- vx5 = vec_mergel (vy2, vy6); \
- vx6 = vec_mergeh (vy3, vy7); \
- vx7 = vec_mergel (vy3, vy7); \
- \
- vy0 = vec_mergeh (vx0, vx4); \
- vy1 = vec_mergel (vx0, vx4); \
- vy2 = vec_mergeh (vx1, vx5); \
- vy3 = vec_mergel (vx1, vx5); \
- vy4 = vec_mergeh (vx2, vx6); \
- vy5 = vec_mergel (vx2, vx6); \
- vy6 = vec_mergeh (vx3, vx7); \
- vy7 = vec_mergel (vx3, vx7); \
- \
- vx0 = vec_adds (vec_mergeh (vy0, vy4), bias); \
- vx1 = vec_mergel (vy0, vy4); \
- vx2 = vec_mergeh (vy1, vy5); \
- vx3 = vec_mergel (vy1, vy5); \
- vx4 = vec_mergeh (vy2, vy6); \
- vx5 = vec_mergel (vy2, vy6); \
- vx6 = vec_mergeh (vy3, vy7); \
- vx7 = vec_mergel (vy3, vy7); \
- \
- IDCT_HALF \
- \
- shift = vec_splat_u16 (6); \
- vx0 = vec_sra (vy0, shift); \
- vx1 = vec_sra (vy1, shift); \
- vx2 = vec_sra (vy2, shift); \
- vx3 = vec_sra (vy3, shift); \
- vx4 = vec_sra (vy4, shift); \
- vx5 = vec_sra (vy5, shift); \
- vx6 = vec_sra (vy6, shift); \
- vx7 = vec_sra (vy7, shift);
-
+ vy0 = vec_adds(t7, t1); \
+ vy7 = vec_subs(t7, t1); \
+ vy1 = vec_mradds(c4, t3, t5); \
+ vy6 = vec_mradds(mc4, t3, t5); \
+ vy2 = vec_mradds(c4, t4, t0); \
+ vy5 = vec_mradds(mc4, t4, t0); \
+ vy3 = vec_adds(t2, t6); \
+ vy4 = vec_subs(t2, t6)
+
+#define IDCT \
+ vec_s16 vy0, vy1, vy2, vy3, vy4, vy5, vy6, vy7; \
+ vec_s16 t0, t1, t2, t3, t4, t5, t6, t7, t8; \
+ \
+ vec_s16 c4 = vec_splat(constants[0], 0); \
+ vec_s16 a0 = vec_splat(constants[0], 1); \
+ vec_s16 a1 = vec_splat(constants[0], 2); \
+ vec_s16 a2 = vec_splat(constants[0], 3); \
+ vec_s16 mc4 = vec_splat(constants[0], 4); \
+ vec_s16 ma2 = vec_splat(constants[0], 5); \
+ vec_s16 bias = (vec_s16) vec_splat((vec_s32) constants[0], 3); \
+ \
+ vec_s16 zero = vec_splat_s16(0); \
+ vec_u16 shift = vec_splat_u16(4); \
+ \
+ vec_s16 vx0 = vec_mradds(vec_sl(block[0], shift), constants[1], zero); \
+ vec_s16 vx1 = vec_mradds(vec_sl(block[1], shift), constants[2], zero); \
+ vec_s16 vx2 = vec_mradds(vec_sl(block[2], shift), constants[3], zero); \
+ vec_s16 vx3 = vec_mradds(vec_sl(block[3], shift), constants[4], zero); \
+ vec_s16 vx4 = vec_mradds(vec_sl(block[4], shift), constants[1], zero); \
+ vec_s16 vx5 = vec_mradds(vec_sl(block[5], shift), constants[4], zero); \
+ vec_s16 vx6 = vec_mradds(vec_sl(block[6], shift), constants[3], zero); \
+ vec_s16 vx7 = vec_mradds(vec_sl(block[7], shift), constants[2], zero); \
+ \
+ IDCT_HALF; \
+ \
+ vx0 = vec_mergeh(vy0, vy4); \
+ vx1 = vec_mergel(vy0, vy4); \
+ vx2 = vec_mergeh(vy1, vy5); \
+ vx3 = vec_mergel(vy1, vy5); \
+ vx4 = vec_mergeh(vy2, vy6); \
+ vx5 = vec_mergel(vy2, vy6); \
+ vx6 = vec_mergeh(vy3, vy7); \
+ vx7 = vec_mergel(vy3, vy7); \
+ \
+ vy0 = vec_mergeh(vx0, vx4); \
+ vy1 = vec_mergel(vx0, vx4); \
+ vy2 = vec_mergeh(vx1, vx5); \
+ vy3 = vec_mergel(vx1, vx5); \
+ vy4 = vec_mergeh(vx2, vx6); \
+ vy5 = vec_mergel(vx2, vx6); \
+ vy6 = vec_mergeh(vx3, vx7); \
+ vy7 = vec_mergel(vx3, vx7); \
+ \
+ vx0 = vec_adds(vec_mergeh(vy0, vy4), bias); \
+ vx1 = vec_mergel(vy0, vy4); \
+ vx2 = vec_mergeh(vy1, vy5); \
+ vx3 = vec_mergel(vy1, vy5); \
+ vx4 = vec_mergeh(vy2, vy6); \
+ vx5 = vec_mergel(vy2, vy6); \
+ vx6 = vec_mergeh(vy3, vy7); \
+ vx7 = vec_mergel(vy3, vy7); \
+ \
+ IDCT_HALF; \
+ \
+ shift = vec_splat_u16(6); \
+ vx0 = vec_sra(vy0, shift); \
+ vx1 = vec_sra(vy1, shift); \
+ vx2 = vec_sra(vy2, shift); \
+ vx3 = vec_sra(vy3, shift); \
+ vx4 = vec_sra(vy4, shift); \
+ vx5 = vec_sra(vy5, shift); \
+ vx6 = vec_sra(vy6, shift); \
+ vx7 = vec_sra(vy7, shift)
static const vec_s16 constants[5] = {
- {23170, 13573, 6518, 21895, -23170, -21895, 32, 31},
- {16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725},
- {22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521},
- {21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692},
- {19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722}
+ { 23170, 13573, 6518, 21895, -23170, -21895, 32, 31 },
+ { 16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725 },
+ { 22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521 },
+ { 21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692 },
+ { 19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722 }
};
-void ff_idct_put_altivec(uint8_t* dest, int stride, int16_t *blk)
+void ff_idct_put_altivec(uint8_t *dest, int stride, int16_t *blk)
{
- vec_s16 *block = (vec_s16*)blk;
+ vec_s16 *block = (vec_s16 *) blk;
vec_u8 tmp;
- IDCT
-
-#define COPY(dest,src) \
- tmp = vec_packsu (src, src); \
- vec_ste ((vec_u32)tmp, 0, (unsigned int *)dest); \
- vec_ste ((vec_u32)tmp, 4, (unsigned int *)dest);
-
- COPY (dest, vx0) dest += stride;
- COPY (dest, vx1) dest += stride;
- COPY (dest, vx2) dest += stride;
- COPY (dest, vx3) dest += stride;
- COPY (dest, vx4) dest += stride;
- COPY (dest, vx5) dest += stride;
- COPY (dest, vx6) dest += stride;
- COPY (dest, vx7)
+ IDCT;
+
+#define COPY(dest, src) \
+ tmp = vec_packsu(src, src); \
+ vec_ste((vec_u32) tmp, 0, (unsigned int *) dest); \
+ vec_ste((vec_u32) tmp, 4, (unsigned int *) dest)
+
+ COPY(dest, vx0);
+ dest += stride;
+ COPY(dest, vx1);
+ dest += stride;
+ COPY(dest, vx2);
+ dest += stride;
+ COPY(dest, vx3);
+ dest += stride;
+ COPY(dest, vx4);
+ dest += stride;
+ COPY(dest, vx5);
+ dest += stride;
+ COPY(dest, vx6);
+ dest += stride;
+ COPY(dest, vx7);
}
-void ff_idct_add_altivec(uint8_t* dest, int stride, int16_t *blk)
+void ff_idct_add_altivec(uint8_t *dest, int stride, int16_t *blk)
{
- vec_s16 *block = (vec_s16*)blk;
+ vec_s16 *block = (vec_s16 *) blk;
vec_u8 tmp;
vec_s16 tmp2, tmp3;
vec_u8 perm0;
vec_u8 perm1;
vec_u8 p0, p1, p;
- IDCT
-
- p0 = vec_lvsl (0, dest);
- p1 = vec_lvsl (stride, dest);
- p = vec_splat_u8 (-1);
- perm0 = vec_mergeh (p, p0);
- perm1 = vec_mergeh (p, p1);
-
-#define ADD(dest,src,perm) \
- /* *(uint64_t *)&tmp = *(uint64_t *)dest; */ \
- tmp = vec_ld (0, dest); \
- tmp2 = (vec_s16)vec_perm (tmp, (vec_u8)zero, perm); \
- tmp3 = vec_adds (tmp2, src); \
- tmp = vec_packsu (tmp3, tmp3); \
- vec_ste ((vec_u32)tmp, 0, (unsigned int *)dest); \
- vec_ste ((vec_u32)tmp, 4, (unsigned int *)dest);
-
- ADD (dest, vx0, perm0) dest += stride;
- ADD (dest, vx1, perm1) dest += stride;
- ADD (dest, vx2, perm0) dest += stride;
- ADD (dest, vx3, perm1) dest += stride;
- ADD (dest, vx4, perm0) dest += stride;
- ADD (dest, vx5, perm1) dest += stride;
- ADD (dest, vx6, perm0) dest += stride;
- ADD (dest, vx7, perm1)
+ IDCT;
+
+ p0 = vec_lvsl(0, dest);
+ p1 = vec_lvsl(stride, dest);
+ p = vec_splat_u8(-1);
+ perm0 = vec_mergeh(p, p0);
+ perm1 = vec_mergeh(p, p1);
+
+#define ADD(dest, src, perm) \
+ /* *(uint64_t *) &tmp = *(uint64_t *) dest; */ \
+ tmp = vec_ld(0, dest); \
+ tmp2 = (vec_s16) vec_perm(tmp, (vec_u8) zero, perm); \
+ tmp3 = vec_adds(tmp2, src); \
+ tmp = vec_packsu(tmp3, tmp3); \
+ vec_ste((vec_u32) tmp, 0, (unsigned int *) dest); \
+ vec_ste((vec_u32) tmp, 4, (unsigned int *) dest)
+
+ ADD(dest, vx0, perm0);
+ dest += stride;
+ ADD(dest, vx1, perm1);
+ dest += stride;
+ ADD(dest, vx2, perm0);
+ dest += stride;
+ ADD(dest, vx3, perm1);
+ dest += stride;
+ ADD(dest, vx4, perm0);
+ dest += stride;
+ ADD(dest, vx5, perm1);
+ dest += stride;
+ ADD(dest, vx6, perm0);
+ dest += stride;
+ ADD(dest, vx7, perm1);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/int_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/int_altivec.c
index d4e0c852ea0..fe0e5f68e0a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/int_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/int_altivec.c
@@ -19,9 +19,9 @@
*/
/**
- ** @file
- ** integer misc ops.
- **/
+ * @file
+ * miscellaneous integer operations
+ */
#include "config.h"
#if HAVE_ALTIVEC_H
@@ -31,51 +31,50 @@
#include "libavutil/attributes.h"
#include "libavutil/ppc/types_altivec.h"
#include "libavcodec/dsputil.h"
-
#include "dsputil_altivec.h"
static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2,
- int size) {
- int i, size16;
+ int size)
+{
+ int i, size16 = size >> 4;
vector signed char vpix1;
- vector signed short vpix2, vdiff, vpix1l,vpix1h;
- union { vector signed int vscore;
- int32_t score[4];
- } u;
- u.vscore = vec_splat_s32(0);
-//
-//XXX lazy way, fix it later
-
-#define vec_unaligned_load(b) \
- vec_perm(vec_ld(0,b),vec_ld(15,b),vec_lvsl(0, b));
-
- size16 = size >> 4;
- while(size16) {
-// score += (pix1[i]-pix2[i])*(pix1[i]-pix2[i]);
- //load pix1 and the first batch of pix2
+ vector signed short vpix2, vdiff, vpix1l, vpix1h;
+ union {
+ vector signed int vscore;
+ int32_t score[4];
+ } u = { .vscore = vec_splat_s32(0) };
+
+// XXX lazy way, fix it later
+
+#define vec_unaligned_load(b) \
+ vec_perm(vec_ld(0, b), vec_ld(15, b), vec_lvsl(0, b));
+
+ while (size16) {
+ // score += (pix1[i] - pix2[i]) * (pix1[i] - pix2[i]);
+ // load pix1 and the first batch of pix2
vpix1 = vec_unaligned_load(pix1);
vpix2 = vec_unaligned_load(pix2);
pix2 += 8;
- //unpack
+ // unpack
vpix1h = vec_unpackh(vpix1);
vdiff = vec_sub(vpix1h, vpix2);
vpix1l = vec_unpackl(vpix1);
// load another batch from pix2
- vpix2 = vec_unaligned_load(pix2);
+ vpix2 = vec_unaligned_load(pix2);
u.vscore = vec_msum(vdiff, vdiff, u.vscore);
- vdiff = vec_sub(vpix1l, vpix2);
+ vdiff = vec_sub(vpix1l, vpix2);
u.vscore = vec_msum(vdiff, vdiff, u.vscore);
- pix1 += 16;
- pix2 += 8;
+ pix1 += 16;
+ pix2 += 8;
size16--;
}
u.vscore = vec_sums(u.vscore, vec_splat_s32(0));
size %= 16;
- for (i = 0; i < size; i++) {
- u.score[3] += (pix1[i]-pix2[i])*(pix1[i]-pix2[i]);
- }
+ for (i = 0; i < size; i++)
+ u.score[3] += (pix1[i] - pix2[i]) * (pix1[i] - pix2[i]);
+
return u.score[3];
}
@@ -88,56 +87,64 @@ static int32_t scalarproduct_int16_altivec(const int16_t *v1, const int16_t *v2,
register vec_s32 res = vec_splat_s32(0), t;
int32_t ires;
- for(i = 0; i < order; i += 8){
+ for (i = 0; i < order; i += 8) {
vec1 = vec_unaligned_load(v1);
- t = vec_msum(vec1, vec_ld(0, v2), zero_s32v);
- res = vec_sums(t, res);
- v1 += 8;
- v2 += 8;
+ t = vec_msum(vec1, vec_ld(0, v2), zero_s32v);
+ res = vec_sums(t, res);
+ v1 += 8;
+ v2 += 8;
}
res = vec_splat(res, 3);
vec_ste(res, 0, &ires);
+
return ires;
}
-static int32_t scalarproduct_and_madd_int16_altivec(int16_t *v1, const int16_t *v2, const int16_t *v3, int order, int mul)
+static int32_t scalarproduct_and_madd_int16_altivec(int16_t *v1,
+ const int16_t *v2,
+ const int16_t *v3,
+ int order, int mul)
{
LOAD_ZERO;
- vec_s16 *pv1 = (vec_s16*)v1;
- register vec_s16 muls = {mul,mul,mul,mul,mul,mul,mul,mul};
+ vec_s16 *pv1 = (vec_s16 *) v1;
+ register vec_s16 muls = { mul, mul, mul, mul, mul, mul, mul, mul };
register vec_s16 t0, t1, i0, i1, i4;
register vec_s16 i2 = vec_ld(0, v2), i3 = vec_ld(0, v3);
register vec_s32 res = zero_s32v;
register vec_u8 align = vec_lvsl(0, v2);
int32_t ires;
+
order >>= 4;
do {
- i1 = vec_ld(16, v2);
- t0 = vec_perm(i2, i1, align);
- i2 = vec_ld(32, v2);
- t1 = vec_perm(i1, i2, align);
- i0 = pv1[0];
- i1 = pv1[1];
- res = vec_msum(t0, i0, res);
- res = vec_msum(t1, i1, res);
- i4 = vec_ld(16, v3);
- t0 = vec_perm(i3, i4, align);
- i3 = vec_ld(32, v3);
- t1 = vec_perm(i4, i3, align);
+ i1 = vec_ld(16, v2);
+ t0 = vec_perm(i2, i1, align);
+ i2 = vec_ld(32, v2);
+ t1 = vec_perm(i1, i2, align);
+ i0 = pv1[0];
+ i1 = pv1[1];
+ res = vec_msum(t0, i0, res);
+ res = vec_msum(t1, i1, res);
+ i4 = vec_ld(16, v3);
+ t0 = vec_perm(i3, i4, align);
+ i3 = vec_ld(32, v3);
+ t1 = vec_perm(i4, i3, align);
pv1[0] = vec_mladd(t0, muls, i0);
pv1[1] = vec_mladd(t1, muls, i1);
- pv1 += 2;
- v2 += 16;
- v3 += 16;
- } while(--order);
+ pv1 += 2;
+ v2 += 16;
+ v3 += 16;
+ } while (--order);
res = vec_splat(vec_sums(res, zero_s32v), 3);
vec_ste(res, 0, &ires);
+
return ires;
}
av_cold void ff_int_init_altivec(DSPContext *c, AVCodecContext *avctx)
{
c->ssd_int8_vs_int16 = ssd_int8_vs_int16_altivec;
+
c->scalarproduct_int16 = scalarproduct_int16_altivec;
+
c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_altivec;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c
index 091f9a39114..09f6f29e7a7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c
@@ -25,7 +25,6 @@
#include "libavutil/internal.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/mpegaudiodsp.h"
-#include "dsputil_altivec.h"
#if HAVE_ALTIVEC
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/mpegvideo_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/mpegvideo_altivec.c
index cedc1c8bf63..d39c8f32542 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/mpegvideo_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/mpegvideo_altivec.c
@@ -30,7 +30,6 @@
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/mpegvideo.h"
-#include "dsputil_altivec.h"
#if HAVE_ALTIVEC
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/vc1dsp_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/vc1dsp_altivec.c
index 1b73dd03fa6..adaae0ca5e7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/vc1dsp_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/vc1dsp_altivec.c
@@ -21,6 +21,7 @@
#include "config.h"
#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/vc1dsp.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/vp3dsp_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/vp3dsp_altivec.c
index 56c2d0b8224..5915a43d292 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/vp3dsp_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/vp3dsp_altivec.c
@@ -26,7 +26,6 @@
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/vp3dsp.h"
-#include "dsputil_altivec.h"
#if HAVE_ALTIVEC
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c b/chromium/third_party/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c
index c858d8a45f8..2d558a5171d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c
@@ -26,7 +26,7 @@
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/vp8dsp.h"
-#include "dsputil_altivec.h"
+#include "hpeldsp_altivec.h"
#if HAVE_ALTIVEC
#define REPT4(...) { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ }
@@ -311,7 +311,8 @@ static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *s
#endif /* HAVE_ALTIVEC */
-av_cold void ff_vp8dsp_init_ppc(VP8DSPContext *c)
+
+av_cold void ff_vp78dsp_init_ppc(VP8DSPContext *c)
{
#if HAVE_ALTIVEC
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
diff --git a/chromium/third_party/ffmpeg/libavcodec/proresdsp.c b/chromium/third_party/ffmpeg/libavcodec/proresdsp.c
index 4ff219e58b5..b5230649508 100644
--- a/chromium/third_party/ffmpeg/libavcodec/proresdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/proresdsp.c
@@ -20,9 +20,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/common.h"
-#include "dct.h"
#include "dsputil.h"
#include "proresdsp.h"
#include "simple_idct.h"
@@ -31,9 +31,8 @@
#define CLIP_MIN (1 << (PRORES_BITS_PER_SAMPLE - 8)) ///< minimum value for clipping resulting pixels
#define CLIP_MAX (1 << PRORES_BITS_PER_SAMPLE) - CLIP_MIN - 1 ///< maximum value for clipping resulting pixels
-#define CLIP_AND_BIAS(x) (av_clip((x) + BIAS, CLIP_MIN, CLIP_MAX))
+#define CLIP(x) (av_clip((x), CLIP_MIN, CLIP_MAX))
-#if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER
/**
* Add bias value, clamp and output pixels of a slice
*/
@@ -45,7 +44,7 @@ static void put_pixels(uint16_t *dst, int stride, const int16_t *in)
for (x = 0; x < 8; x++) {
src_offset = (y << 3) + x;
- dst[dst_offset + x] = CLIP_AND_BIAS(in[src_offset]);
+ dst[dst_offset + x] = CLIP(in[src_offset]);
}
}
}
@@ -55,38 +54,15 @@ static void prores_idct_put_c(uint16_t *out, int linesize, int16_t *block, const
ff_prores_idct(block, qmat);
put_pixels(out, linesize >> 1, block);
}
-#endif
-
-#if CONFIG_PRORES_KS_ENCODER
-static void prores_fdct_c(const uint16_t *src, int linesize, int16_t *block)
-{
- int x, y;
- const uint16_t *tsrc = src;
-
- for (y = 0; y < 8; y++) {
- for (x = 0; x < 8; x++)
- block[y * 8 + x] = tsrc[x];
- tsrc += linesize >> 1;
- }
- ff_jpeg_fdct_islow_10(block);
-}
-#endif
av_cold void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
{
-#if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER
dsp->idct_put = prores_idct_put_c;
dsp->idct_permutation_type = FF_NO_IDCT_PERM;
- if (ARCH_X86) ff_proresdsp_x86_init(dsp, avctx);
+ if (ARCH_X86)
+ ff_proresdsp_init_x86(dsp, avctx);
ff_init_scantable_permutation(dsp->idct_permutation,
dsp->idct_permutation_type);
-#endif
-#if CONFIG_PRORES_KS_ENCODER
- dsp->fdct = prores_fdct_c;
- dsp->dct_permutation_type = FF_NO_IDCT_PERM;
- ff_init_scantable_permutation(dsp->dct_permutation,
- dsp->dct_permutation_type);
-#endif
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/proresdsp.h b/chromium/third_party/ffmpeg/libavcodec/proresdsp.h
index 706162af529..07871cfbd82 100644
--- a/chromium/third_party/ffmpeg/libavcodec/proresdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/proresdsp.h
@@ -31,14 +31,11 @@
typedef struct ProresDSPContext {
int idct_permutation_type;
uint8_t idct_permutation[64];
- int dct_permutation_type;
- uint8_t dct_permutation[64];
void (* idct_put) (uint16_t *out, int linesize, int16_t *block, const int16_t *qmat);
- void (* fdct) (const uint16_t *src, int linesize, int16_t *block);
} ProresDSPContext;
void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx);
-void ff_proresdsp_x86_init(ProresDSPContext *dsp, AVCodecContext *avctx);
+void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx);
#endif /* AVCODEC_PRORESDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/proresenc_kostya.c b/chromium/third_party/ffmpeg/libavcodec/proresenc_kostya.c
index 71c2cb49f2a..ea1fd8ae7fc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/proresenc_kostya.c
+++ b/chromium/third_party/ffmpeg/libavcodec/proresenc_kostya.c
@@ -26,11 +26,11 @@
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
+#include "dct.h"
#include "dsputil.h"
#include "put_bits.h"
#include "bytestream.h"
#include "internal.h"
-#include "proresdsp.h"
#include "proresdata.h"
#define CFACTOR_Y422 2
@@ -193,9 +193,11 @@ typedef struct ProresContext {
int16_t quants[MAX_STORED_Q][64];
int16_t custom_q[64];
const uint8_t *quant_mat;
+ const uint8_t *scantable;
- ProresDSPContext dsp;
- ScanTable scantable;
+ void (* fdct)(DSPContext *dsp, const uint16_t *src,
+ int linesize, int16_t *block);
+ DSPContext dsp;
int mb_width, mb_height;
int mbs_per_slice;
@@ -264,27 +266,27 @@ static void get_slice_data(ProresContext *ctx, const uint16_t *src,
mb_width * sizeof(*emu_buf));
}
if (!is_chroma) {
- ctx->dsp.fdct(esrc, elinesize, blocks);
+ ctx->fdct(&ctx->dsp, esrc, elinesize, blocks);
blocks += 64;
if (blocks_per_mb > 2) {
- ctx->dsp.fdct(esrc + 8, elinesize, blocks);
+ ctx->fdct(&ctx->dsp, esrc + 8, elinesize, blocks);
blocks += 64;
}
- ctx->dsp.fdct(esrc + elinesize * 4, elinesize, blocks);
+ ctx->fdct(&ctx->dsp, esrc + elinesize * 4, elinesize, blocks);
blocks += 64;
if (blocks_per_mb > 2) {
- ctx->dsp.fdct(esrc + elinesize * 4 + 8, elinesize, blocks);
+ ctx->fdct(&ctx->dsp, esrc + elinesize * 4 + 8, elinesize, blocks);
blocks += 64;
}
} else {
- ctx->dsp.fdct(esrc, elinesize, blocks);
+ ctx->fdct(&ctx->dsp, esrc, elinesize, blocks);
blocks += 64;
- ctx->dsp.fdct(esrc + elinesize * 4, elinesize, blocks);
+ ctx->fdct(&ctx->dsp, esrc + elinesize * 4, elinesize, blocks);
blocks += 64;
if (blocks_per_mb > 2) {
- ctx->dsp.fdct(esrc + 8, elinesize, blocks);
+ ctx->fdct(&ctx->dsp, esrc + 8, elinesize, blocks);
blocks += 64;
- ctx->dsp.fdct(esrc + elinesize * 4 + 8, elinesize, blocks);
+ ctx->fdct(&ctx->dsp, esrc + elinesize * 4 + 8, elinesize, blocks);
blocks += 64;
}
}
@@ -429,7 +431,7 @@ static int encode_slice_plane(ProresContext *ctx, PutBitContext *pb,
encode_dcs(pb, blocks, blocks_per_slice, qmat[0]);
encode_acs(pb, blocks, blocks_per_slice, plane_size_factor,
- ctx->scantable.permutated, qmat);
+ ctx->scantable, qmat);
flush_put_bits(pb);
return (put_bits_count(pb) - saved_pos) >> 3;
@@ -676,7 +678,7 @@ static int estimate_slice_plane(ProresContext *ctx, int *error, int plane,
bits = estimate_dcs(error, td->blocks[plane], blocks_per_slice, qmat[0]);
bits += estimate_acs(error, td->blocks[plane], blocks_per_slice,
- plane_size_factor, ctx->scantable.permutated, qmat);
+ plane_size_factor, ctx->scantable, qmat);
return FFALIGN(bits, 8);
}
@@ -1064,6 +1066,20 @@ static av_cold int encode_close(AVCodecContext *avctx)
return 0;
}
+static void prores_fdct(DSPContext *dsp, const uint16_t *src,
+ int linesize, int16_t *block)
+{
+ int x, y;
+ const uint16_t *tsrc = src;
+
+ for (y = 0; y < 8; y++) {
+ for (x = 0; x < 8; x++)
+ block[y * 8 + x] = tsrc[x];
+ tsrc += linesize >> 1;
+ }
+ dsp->fdct(block);
+}
+
static av_cold int encode_init(AVCodecContext *avctx)
{
ProresContext *ctx = avctx->priv_data;
@@ -1077,10 +1093,10 @@ static av_cold int encode_init(AVCodecContext *avctx)
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
- ff_proresdsp_init(&ctx->dsp, avctx);
- ff_init_scantable(ctx->dsp.dct_permutation, &ctx->scantable,
- interlaced ? ff_prores_interlaced_scan
- : ff_prores_progressive_scan);
+ ctx->fdct = prores_fdct;
+ ctx->scantable = interlaced ? ff_prores_interlaced_scan
+ : ff_prores_progressive_scan;
+ ff_dsputil_init(&ctx->dsp, avctx);
mps = ctx->mbs_per_slice;
if (mps & (mps - 1)) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/psymodel.c b/chromium/third_party/ffmpeg/libavcodec/psymodel.c
index bfc85b3bc56..22d2497f785 100644
--- a/chromium/third_party/ffmpeg/libavcodec/psymodel.c
+++ b/chromium/third_party/ffmpeg/libavcodec/psymodel.c
@@ -35,10 +35,10 @@ av_cold int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx, int num_lens,
int i, j, k = 0;
ctx->avctx = avctx;
- ctx->ch = av_mallocz(sizeof(ctx->ch[0]) * avctx->channels * 2);
- ctx->group = av_mallocz(sizeof(ctx->group[0]) * num_groups);
- ctx->bands = av_malloc (sizeof(ctx->bands[0]) * num_lens);
- ctx->num_bands = av_malloc (sizeof(ctx->num_bands[0]) * num_lens);
+ ctx->ch = av_mallocz_array(sizeof(ctx->ch[0]), avctx->channels * 2);
+ ctx->group = av_mallocz_array(sizeof(ctx->group[0]), num_groups);
+ ctx->bands = av_malloc_array (sizeof(ctx->bands[0]), num_lens);
+ ctx->num_bands = av_malloc_array (sizeof(ctx->num_bands[0]), num_lens);
memcpy(ctx->bands, bands, sizeof(ctx->bands[0]) * num_lens);
memcpy(ctx->num_bands, num_bands, sizeof(ctx->num_bands[0]) * num_lens);
@@ -112,7 +112,7 @@ av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *av
FF_FILTER_MODE_LOWPASS, FILT_ORDER,
cutoff_coeff, 0.0, 0.0);
if (ctx->fcoeffs) {
- ctx->fstate = av_mallocz(sizeof(ctx->fstate[0]) * avctx->channels);
+ ctx->fstate = av_mallocz_array(sizeof(ctx->fstate[0]), avctx->channels);
for (i = 0; i < avctx->channels; i++)
ctx->fstate[i] = ff_iir_filter_init_state(FILT_ORDER);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/pthread_frame.c b/chromium/third_party/ffmpeg/libavcodec/pthread_frame.c
index 51a163384b7..f01ac559024 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pthread_frame.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pthread_frame.c
@@ -121,8 +121,13 @@ typedef struct FrameThreadContext {
int die; ///< Set when threads should exit.
} FrameThreadContext;
+#if FF_API_GET_BUFFER
#define THREAD_SAFE_CALLBACKS(avctx) \
((avctx)->thread_safe_callbacks || (!(avctx)->get_buffer && (avctx)->get_buffer2 == avcodec_default_get_buffer2))
+#else
+#define THREAD_SAFE_CALLBACKS(avctx) \
+((avctx)->thread_safe_callbacks || (avctx)->get_buffer2 == avcodec_default_get_buffer2)
+#endif
/**
* Codec worker thread.
@@ -152,6 +157,13 @@ static attribute_align_arg void *frame_worker_thread(void *arg)
p->got_frame = 0;
p->result = codec->decode(avctx, p->frame, &p->got_frame, &p->avpkt);
+ if ((p->result < 0 || !p->got_frame) && p->frame->buf[0]) {
+ if (avctx->internal->allocate_progress)
+ av_log(avctx, AV_LOG_ERROR, "A frame threaded decoder did not "
+ "free the frame on failure. This is a bug, please report it.\n");
+ av_frame_unref(p->frame);
+ }
+
if (p->state == STATE_SETTING_UP) ff_thread_finish_setup(avctx);
pthread_mutex_lock(&p->progress_mutex);
@@ -219,6 +231,7 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
dst->sample_rate = src->sample_rate;
dst->sample_fmt = src->sample_fmt;
dst->channel_layout = src->channel_layout;
+ dst->internal->hwaccel_priv_data = src->internal->hwaccel_priv_data;
}
if (for_user) {
@@ -310,6 +323,7 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
FrameThreadContext *fctx = p->parent;
PerThreadContext *prev_thread = fctx->prev_thread;
const AVCodec *codec = p->avctx->codec;
+ int ret;
if (!avpkt->size && !(codec->capabilities & CODEC_CAP_DELAY)) return 0;
@@ -333,6 +347,7 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
}
}
+ av_packet_free_side_data(&p->avpkt);
av_buffer_unref(&p->avpkt.buf);
p->avpkt = *avpkt;
if (avpkt->buf)
@@ -347,6 +362,10 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
memcpy(p->buf, avpkt->data, avpkt->size);
memset(p->buf + avpkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
}
+ if ((ret = av_copy_packet_side_data(&p->avpkt, avpkt)) < 0) {
+ pthread_mutex_unlock(&p->mutex);
+ return ret;
+ }
p->state = STATE_SETTING_UP;
pthread_cond_signal(&p->input_cond);
@@ -585,6 +604,7 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
pthread_cond_destroy(&p->input_cond);
pthread_cond_destroy(&p->progress_cond);
pthread_cond_destroy(&p->output_cond);
+ av_packet_free_side_data(&p->avpkt);
av_buffer_unref(&p->avpkt.buf);
av_freep(&p->buf);
av_freep(&p->released_buffers);
@@ -650,6 +670,7 @@ int ff_frame_thread_init(AVCodecContext *avctx)
p->frame = av_frame_alloc();
if (!p->frame) {
err = AVERROR(ENOMEM);
+ av_freep(&copy);
goto error;
}
@@ -719,8 +740,6 @@ void ff_thread_flush(AVCodecContext *avctx)
if (fctx->prev_thread) {
if (fctx->prev_thread != &fctx->threads[0])
update_context_from_thread(fctx->threads[0].avctx, fctx->prev_thread->avctx, 0);
- if (avctx->codec->flush)
- avctx->codec->flush(fctx->threads[0].avctx);
}
fctx->next_decoding = fctx->next_finished = 0;
@@ -733,6 +752,9 @@ void ff_thread_flush(AVCodecContext *avctx)
av_frame_unref(p->frame);
release_delayed_buffers(p);
+
+ if (avctx->codec->flush)
+ avctx->codec->flush(p->avctx);
}
}
@@ -816,7 +838,7 @@ enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixe
PerThreadContext *p = avctx->internal->thread_ctx;
if (!(avctx->active_thread_type & FF_THREAD_FRAME) || avctx->thread_safe_callbacks ||
avctx->get_format == avcodec_default_get_format)
- return avctx->get_format(avctx, fmt);
+ return ff_get_format(avctx, fmt);
if (p->state != STATE_SETTING_UP) {
av_log(avctx, AV_LOG_ERROR, "get_format() cannot be called after ff_thread_finish_setup()\n");
return -1;
@@ -859,7 +881,7 @@ FF_DISABLE_DEPRECATION_WARNINGS
avctx->get_buffer2 == avcodec_default_get_buffer2);
FF_ENABLE_DEPRECATION_WARNINGS
- if (!f->f->buf[0])
+ if (!f->f || !f->f->buf[0])
return;
if (avctx->debug & FF_DEBUG_BUFFERS)
diff --git a/chromium/third_party/ffmpeg/libavcodec/put_bits.h b/chromium/third_party/ffmpeg/libavcodec/put_bits.h
index e2c4a617912..8081fb9ea5a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/put_bits.h
+++ b/chromium/third_party/ffmpeg/libavcodec/put_bits.h
@@ -27,16 +27,11 @@
#define AVCODEC_PUT_BITS_H
#include <stdint.h>
-#include <stdlib.h>
+#include <stddef.h>
#include <assert.h>
-#include "libavutil/bswap.h"
-#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
-#include "libavutil/log.h"
#include "libavutil/avassert.h"
-#include "mathops.h"
-#include "config.h"
typedef struct PutBitContext {
uint32_t bit_buf;
diff --git a/chromium/third_party/ffmpeg/libavcodec/qcelpdata.h b/chromium/third_party/ffmpeg/libavcodec/qcelpdata.h
index 7ddeed40cc7..931c990b09d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qcelpdata.h
+++ b/chromium/third_party/ffmpeg/libavcodec/qcelpdata.h
@@ -66,7 +66,7 @@ typedef struct QCELPFrame {
} QCELPFrame;
/**
- * pre-calculated table for hammsinc function
+ * Pre-calculated table for hammsinc function.
* Only half of the table is needed because of symmetry.
*
* TIA/EIA/IS-733 2.4.5.2-2/3
@@ -82,7 +82,7 @@ typedef struct QCELPBitmap {
#define QCELP_OF(variable, bit, len) {offsetof(QCELPFrame, variable), bit, len}
/**
- * bitmap unpacking tables for RATE_FULL
+ * Bitmap unpacking tables for RATE_FULL
*
* TIA/EIA/IS-733 Table 2.4.7.1-1
*/
@@ -169,7 +169,7 @@ static const QCELPBitmap qcelp_rate_full_bitmap[] = {
};
/**
- * bitmap unpacking tables for RATE_HALF
+ * Bitmap unpacking tables for RATE_HALF
*
* TIA/EIA/IS-733 Table 2.4.7.2-1
*/
@@ -211,7 +211,7 @@ static const QCELPBitmap qcelp_rate_half_bitmap[] = {
};
/**
- * bitmap unpacking tables for RATE_QUARTER
+ * Bitmap unpacking tables for RATE_QUARTER
*
* TIA/EIA/IS-733 Table 2.4.7.3-1
*/
@@ -232,7 +232,7 @@ static const QCELPBitmap qcelp_rate_quarter_bitmap[] = {
};
/**
- * bitmap unpacking tables for RATE_OCTAVE
+ * Bitmap unpacking tables for RATE_OCTAVE
*
* trick: CBSEED is written into QCELPContext.cbsign[15],
* which is not used for RATE_OCTAVE.
@@ -262,7 +262,7 @@ static const QCELPBitmap qcelp_rate_octave_bitmap[] = {
};
/**
- * position of the bitmapping data for each packet type in
+ * Bitmapping data position for each packet type in
* the QCELPContext
*/
static const QCELPBitmap * const qcelp_unpacking_bitmaps_per_rate[5] = {
@@ -420,12 +420,12 @@ static const qcelp_vector * const qcelp_lspvq[5] = {
};
/**
- * the final gain scalefactor before clipping into a usable output float
+ * The final gain scalefactor before clipping into a usable output float
*/
#define QCELP_SCALE 8192.
/**
- * table for computing Ga (decoded linear codebook gain magnitude)
+ * Table for computing Ga (decoded linear codebook gain magnitude)
*
* @note The table could fit in int16_t in x*8 form, but it seems
* to be slower on x86
@@ -452,7 +452,7 @@ static const float qcelp_g12ga[61] = {
1000.000/QCELP_SCALE};
/**
- * circular codebook for rate 1 frames in x*100 form
+ * Circular codebook for rate 1 frames in x*100 form
*
* TIA/EIA/IS-733 2.4.6.1-2
*/
@@ -477,7 +477,7 @@ static const int16_t qcelp_rate_full_codebook[128] = {
#define QCELP_RATE_FULL_CODEBOOK_RATIO .01
/**
- * circular codebook for rate 1/2 frames in x*2 form
+ * Circular codebook for rate 1/2 frames in x*2 form
*
* TIA/EIA/IS-733 2.4.6.1-1
*/
@@ -511,7 +511,7 @@ static const int8_t qcelp_rate_half_codebook[128] = {
#define QCELP_SQRT1887 1.373681186
/**
- * table for impulse response of BPF used to filter
+ * Table for impulse response of BPF used to filter
* the white excitation for bitrate 1/4 synthesis
*
* Only half the tables are needed because of symmetry.
@@ -526,14 +526,14 @@ static const double qcelp_rnd_fir_coefs[11] = {
/**
* This spread factor is used, for bitrate 1/8 and I_F_Q,
- * to force the LSP frequencies to be at least 80 Hz apart.
+ * to force LSP frequencies to be at least 80 Hz apart.
*
* TIA/EIA/IS-733 2.4.3.3.2
*/
#define QCELP_LSP_SPREAD_FACTOR 0.02
/**
- * predictor coefficient for the conversion of LSP codes
+ * Predictor coefficient for the conversion of LSP codes
* to LSP frequencies for 1/8 and I_F_Q
*
* TIA/EIA/IS-733 2.4.3.2.7-2
@@ -541,7 +541,7 @@ static const double qcelp_rnd_fir_coefs[11] = {
#define QCELP_LSP_OCTAVE_PREDICTOR 29.0/32
/**
- * initial coefficient to perform bandwidth expansion on LPC
+ * Initial coefficient to perform bandwidth expansion on LPC
*
* @note: 0.9883 looks like an approximation of 253/256.
*
diff --git a/chromium/third_party/ffmpeg/libavcodec/qcelpdec.c b/chromium/third_party/ffmpeg/libavcodec/qcelpdec.c
index 9650711e008..6f08607a583 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qcelpdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qcelpdec.c
@@ -319,7 +319,8 @@ static void compute_svector(QCELPContext *q, const float *gain,
tmp_gain = gain[i] * QCELP_RATE_FULL_CODEBOOK_RATIO;
cindex = -q->frame.cindex[i];
for (j = 0; j < 10; j++)
- *cdn_vector++ = tmp_gain * qcelp_rate_full_codebook[cindex++ & 127];
+ *cdn_vector++ = tmp_gain *
+ qcelp_rate_full_codebook[cindex++ & 127];
}
break;
case RATE_HALF:
@@ -327,7 +328,8 @@ static void compute_svector(QCELPContext *q, const float *gain,
tmp_gain = gain[i] * QCELP_RATE_HALF_CODEBOOK_RATIO;
cindex = -q->frame.cindex[i];
for (j = 0; j < 40; j++)
- *cdn_vector++ = tmp_gain * qcelp_rate_half_codebook[cindex++ & 127];
+ *cdn_vector++ = tmp_gain *
+ qcelp_rate_half_codebook[cindex++ & 127];
}
break;
case RATE_QUARTER:
@@ -372,7 +374,8 @@ static void compute_svector(QCELPContext *q, const float *gain,
for (i = 0; i < 4; i++) {
tmp_gain = gain[i] * QCELP_RATE_FULL_CODEBOOK_RATIO;
for (j = 0; j < 40; j++)
- *cdn_vector++ = tmp_gain * qcelp_rate_full_codebook[cbseed++ & 127];
+ *cdn_vector++ = tmp_gain *
+ qcelp_rate_full_codebook[cbseed++ & 127];
}
break;
case SILENCE:
@@ -433,7 +436,8 @@ static const float *do_pitchfilter(float memory[303], const float v_in[160],
for (v_len = v_in + 40; v_in < v_len; v_in++) {
if (pfrac[i]) { // If it is a fractional lag...
for (j = 0, *v_out = 0.0; j < 4; j++)
- *v_out += qcelp_hammsinc_table[j] * (v_lag[j - 4] + v_lag[3 - j]);
+ *v_out += qcelp_hammsinc_table[j] *
+ (v_lag[j - 4] + v_lag[3 - j]);
} else
*v_out = *v_lag;
@@ -509,7 +513,8 @@ static void apply_pitch_filters(QCELPContext *q, float *cdn_vector)
apply_gain_ctrl(cdn_vector, v_synthesis_filtered, v_pre_filtered);
} else {
- memcpy(q->pitch_synthesis_filter_mem, cdn_vector + 17, 143 * sizeof(float));
+ memcpy(q->pitch_synthesis_filter_mem,
+ cdn_vector + 17, 143 * sizeof(float));
memcpy(q->pitch_pre_filter_mem, cdn_vector + 17, 143 * sizeof(float));
memset(q->pitch_gain, 0, sizeof(q->pitch_gain));
memset(q->pitch_lag, 0, sizeof(q->pitch_lag));
@@ -628,7 +633,7 @@ static qcelp_packet_rate determine_bitrate(AVCodecContext *avctx,
(*buf)++;
} else if ((bitrate = buf_size2bitrate(buf_size + 1)) >= 0) {
av_log(avctx, AV_LOG_WARNING,
- "Bitrate byte is missing, guessing the bitrate from packet size.\n");
+ "Bitrate byte missing, guessing bitrate from packet size.\n");
} else
return I_F_Q;
@@ -698,7 +703,7 @@ static int qcelp_decode_frame(AVCodecContext *avctx, void *data,
outbuffer = (float *)frame->data[0];
if ((q->bitrate = determine_bitrate(avctx, buf_size, &buf)) == I_F_Q) {
- warn_insufficient_frame_quality(avctx, "bitrate cannot be determined.");
+ warn_insufficient_frame_quality(avctx, "Bitrate cannot be determined.");
goto erasure;
}
@@ -766,7 +771,8 @@ erasure:
formant_mem = q->formant_mem + 10;
for (i = 0; i < 4; i++) {
interpolate_lpc(q, quantized_lspf, lpc, i);
- ff_celp_lp_synthesis_filterf(formant_mem, lpc, outbuffer + i * 40, 40, 10);
+ ff_celp_lp_synthesis_filterf(formant_mem, lpc,
+ outbuffer + i * 40, 40, 10);
formant_mem += 40;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/qtrleenc.c b/chromium/third_party/ffmpeg/libavcodec/qtrleenc.c
index 7f9525abe07..8750e3097a7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qtrleenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qtrleenc.c
@@ -106,7 +106,7 @@ static av_cold int qtrle_encode_init(AVCodecContext *avctx)
s->rlecode_table = av_mallocz(s->logical_width);
s->skip_table = av_mallocz(s->logical_width);
- s->length_table = av_mallocz((s->logical_width + 1)*sizeof(int));
+ s->length_table = av_mallocz_array(s->logical_width + 1, sizeof(int));
if (!s->skip_table || !s->length_table || !s->rlecode_table) {
av_log(avctx, AV_LOG_ERROR, "Error allocating memory.\n");
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavcodec/ra144.c b/chromium/third_party/ffmpeg/libavcodec/ra144.c
index fe9a5bcb3c7..992972182f5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ra144.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ra144.c
@@ -1681,12 +1681,9 @@ unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy)
}
/** inverse root mean square */
-int ff_irms(const int16_t *data)
+int ff_irms(DSPContext *dsp, const int16_t *data)
{
- unsigned int i, sum = 0;
-
- for (i=0; i < BLOCKSIZE; i++)
- sum += data[i] * data[i];
+ unsigned int sum = dsp->scalarproduct_int16(data, data, BLOCKSIZE);
if (sum == 0)
return 0; /* OOPS - division by zero */
@@ -1698,14 +1695,13 @@ void ff_subblock_synthesis(RA144Context *ractx, const int16_t *lpc_coefs,
int cba_idx, int cb1_idx, int cb2_idx,
int gval, int gain)
{
- int16_t buffer_a[BLOCKSIZE];
int16_t *block;
int m[3];
if (cba_idx) {
cba_idx += BLOCKSIZE/2 - 1;
- ff_copy_and_dup(buffer_a, ractx->adapt_cb, cba_idx);
- m[0] = (ff_irms(buffer_a) * gval) >> 12;
+ ff_copy_and_dup(ractx->buffer_a, ractx->adapt_cb, cba_idx);
+ m[0] = (ff_irms(&ractx->dsp, ractx->buffer_a) * gval) >> 12;
} else {
m[0] = 0;
}
@@ -1716,7 +1712,7 @@ void ff_subblock_synthesis(RA144Context *ractx, const int16_t *lpc_coefs,
block = ractx->adapt_cb + BUFFERSIZE - BLOCKSIZE;
- add_wav(block, gain, cba_idx, m, cba_idx? buffer_a: NULL,
+ add_wav(block, gain, cba_idx, m, cba_idx? ractx->buffer_a: NULL,
ff_cb1_vects[cb1_idx], ff_cb2_vects[cb2_idx]);
memcpy(ractx->curr_sblock, ractx->curr_sblock + BLOCKSIZE,
diff --git a/chromium/third_party/ffmpeg/libavcodec/ra144.h b/chromium/third_party/ffmpeg/libavcodec/ra144.h
index 763495dce78..c2ee59b2dc6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ra144.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ra144.h
@@ -25,6 +25,7 @@
#include <stdint.h>
#include "lpc.h"
#include "audio_frame_queue.h"
+#include "dsputil.h"
#define NBLOCKS 4 ///< number of subblocks within a block
#define BLOCKSIZE 40 ///< subblock size in 16-bit words
@@ -35,6 +36,7 @@
typedef struct RA144Context {
AVCodecContext *avctx;
+ DSPContext dsp;
LPCContext lpc_ctx;
AudioFrameQueue afq;
int last_frame;
@@ -57,6 +59,8 @@ typedef struct RA144Context {
/** Adaptive codebook, its size is two units bigger to avoid a
* buffer overflow. */
int16_t adapt_cb[146+2];
+
+ DECLARE_ALIGNED(16, int16_t, buffer_a)[FFALIGN(BLOCKSIZE,16)];
} RA144Context;
void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset);
@@ -68,7 +72,7 @@ unsigned int ff_rms(const int *data);
int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold,
int energy);
unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy);
-int ff_irms(const int16_t *data);
+int ff_irms(DSPContext *dsp, const int16_t *data/*align 16*/);
void ff_subblock_synthesis(RA144Context *ractx, const int16_t *lpc_coefs,
int cba_idx, int cb1_idx, int cb2_idx,
int gval, int gain);
diff --git a/chromium/third_party/ffmpeg/libavcodec/ra144dec.c b/chromium/third_party/ffmpeg/libavcodec/ra144dec.c
index b7add7f3656..ab7cc68306c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ra144dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ra144dec.c
@@ -34,6 +34,7 @@ static av_cold int ra144_decode_init(AVCodecContext * avctx)
RA144Context *ractx = avctx->priv_data;
ractx->avctx = avctx;
+ ff_dsputil_init(&ractx->dsp, avctx);
ractx->lpc_coef[0] = ractx->lpc_tables[0];
ractx->lpc_coef[1] = ractx->lpc_tables[1];
diff --git a/chromium/third_party/ffmpeg/libavcodec/ra144enc.c b/chromium/third_party/ffmpeg/libavcodec/ra144enc.c
index 3558254e568..1f4e5bae45b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ra144enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ra144enc.c
@@ -29,12 +29,12 @@
#include "avcodec.h"
#include "audio_frame_queue.h"
+#include "celp_filters.h"
#include "internal.h"
+#include "mathops.h"
#include "put_bits.h"
-#include "celp_filters.h"
#include "ra144.h"
-
static av_cold int ra144_encode_close(AVCodecContext *avctx)
{
RA144Context *ractx = avctx->priv_data;
@@ -61,6 +61,7 @@ static av_cold int ra144_encode_init(AVCodecContext * avctx)
ractx->lpc_coef[0] = ractx->lpc_tables[0];
ractx->lpc_coef[1] = ractx->lpc_tables[1];
ractx->avctx = avctx;
+ ff_dsputil_init(&ractx->dsp, avctx);
ret = ff_lpc_init(&ractx->lpc_ctx, avctx->frame_size, LPC_ORDER,
FF_LPC_TYPE_LEVINSON);
if (ret < 0)
@@ -334,7 +335,6 @@ static void ra144_encode_subblock(RA144Context *ractx,
float data[BLOCKSIZE] = { 0 }, work[LPC_ORDER + BLOCKSIZE];
float coefs[LPC_ORDER];
float zero[BLOCKSIZE], cba[BLOCKSIZE], cb1[BLOCKSIZE], cb2[BLOCKSIZE];
- int16_t cba_vect[BLOCKSIZE];
int cba_idx, cb1_idx, cb2_idx, gain;
int i, n;
unsigned m[3];
@@ -373,8 +373,8 @@ static void ra144_encode_subblock(RA144Context *ractx,
*/
memcpy(cba, work + LPC_ORDER, sizeof(cba));
- ff_copy_and_dup(cba_vect, ractx->adapt_cb, cba_idx + BLOCKSIZE / 2 - 1);
- m[0] = (ff_irms(cba_vect) * rms) >> 12;
+ ff_copy_and_dup(ractx->buffer_a, ractx->adapt_cb, cba_idx + BLOCKSIZE / 2 - 1);
+ m[0] = (ff_irms(&ractx->dsp, ractx->buffer_a) * rms) >> 12;
}
fixed_cb_search(work + LPC_ORDER, coefs, data, cba_idx, &cb1_idx, &cb2_idx);
for (i = 0; i < BLOCKSIZE; i++) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/ratecontrol.c b/chromium/third_party/ffmpeg/libavcodec/ratecontrol.c
index 7db248ecf5f..a621f8f79a1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ratecontrol.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ratecontrol.c
@@ -28,6 +28,7 @@
#include "libavutil/attributes.h"
#include "avcodec.h"
#include "ratecontrol.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "libavutil/eval.h"
@@ -46,11 +47,11 @@ void ff_write_pass1_stats(MpegEncContext *s)
{
snprintf(s->avctx->stats_out, 256,
"in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d "
- "fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d;\n",
- s->current_picture_ptr->f.display_picture_number,
- s->current_picture_ptr->f.coded_picture_number,
+ "fcode:%d bcode:%d mc-var:%"PRId64" var:%"PRId64" icount:%d skipcount:%d hbits:%d;\n",
+ s->current_picture_ptr->f->display_picture_number,
+ s->current_picture_ptr->f->coded_picture_number,
s->pict_type,
- s->current_picture.f.quality,
+ s->current_picture.f->quality,
s->i_tex_bits,
s->p_tex_bits,
s->mv_bits,
@@ -206,7 +207,7 @@ av_cold int ff_rate_control_init(MpegEncContext *s)
assert(picture_number < rcc->num_entries);
rce = &rcc->entry[picture_number];
- e += sscanf(p, " in:%*d out:%*d type:%d q:%f itex:%d ptex:%d mv:%d misc:%d fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d",
+ e += sscanf(p, " in:%*d out:%*d type:%d q:%f itex:%d ptex:%d mv:%d misc:%d fcode:%d bcode:%d mc-var:%"SCNd64" var:%"SCNd64" icount:%d skipcount:%d hbits:%d",
&rce->pict_type, &rce->qscale, &rce->i_tex_bits, &rce->p_tex_bits,
&rce->mv_bits, &rce->misc_bits,
&rce->f_code, &rce->b_code,
@@ -688,7 +689,7 @@ static void adaptive_quantization(MpegEncContext *s, double q)
}
/* handle qmin/qmax clipping */
- if (s->flags & CODEC_FLAG_NORMALIZE_AQP) {
+ if (s->mpv_flags & FF_MPV_FLAG_NAQ) {
float factor = bits_sum / cplx_sum;
for (i = 0; i < s->mb_num; i++) {
float newq = q * cplx_tab[i] / bits_tab[i];
@@ -713,7 +714,7 @@ static void adaptive_quantization(MpegEncContext *s, double q)
float newq = q * cplx_tab[i] / bits_tab[i];
int intq;
- if (s->flags & CODEC_FLAG_NORMALIZE_AQP) {
+ if (s->mpv_flags & FF_MPV_FLAG_NAQ) {
newq *= bits_sum / cplx_sum;
}
@@ -753,7 +754,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
RateControlEntry local_rce, *rce;
double bits;
double rate_factor;
- int var;
+ int64_t var;
const int pict_type = s->pict_type;
Picture * const pic = &s->current_picture;
emms_c();
@@ -769,8 +770,9 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
fps = get_fps(s->avctx);
/* update predictors */
if (picture_number > 2 && !dry_run) {
- const int last_var = s->last_pict_type == AV_PICTURE_TYPE_I ? rcc->last_mb_var_sum
- : rcc->last_mc_mb_var_sum;
+ const int64_t last_var =
+ s->last_pict_type == AV_PICTURE_TYPE_I ? rcc->last_mb_var_sum
+ : rcc->last_mc_mb_var_sum;
av_assert1(s->frame_bits >= s->stuffing_bits);
update_predictor(&rcc->pred[s->last_pict_type],
rcc->last_qscale,
@@ -798,10 +800,10 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
else
dts_pic = s->last_picture_ptr;
- if (!dts_pic || dts_pic->f.pts == AV_NOPTS_VALUE)
+ if (!dts_pic || dts_pic->f->pts == AV_NOPTS_VALUE)
wanted_bits = (uint64_t)(s->bit_rate * (double)picture_number / fps);
else
- wanted_bits = (uint64_t)(s->bit_rate * (double)dts_pic->f.pts / fps);
+ wanted_bits = (uint64_t)(s->bit_rate * (double)dts_pic->f->pts / fps);
}
diff = s->total_bits - wanted_bits;
@@ -817,7 +819,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
assert(pict_type == rce->new_pict_type);
q = rce->new_qscale / br_compensation;
- av_dlog(s, "%f %f %f last:%d var:%d type:%d//\n", q, rce->new_qscale,
+ av_dlog(s, "%f %f %f last:%d var:%"PRId64" type:%d//\n", q, rce->new_qscale,
br_compensation, s->frame_bits, var, pict_type);
} else {
rce->pict_type =
@@ -879,7 +881,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
if (s->avctx->debug & FF_DEBUG_RC) {
av_log(s->avctx, AV_LOG_DEBUG,
"%c qp:%d<%2.1f<%d %d want:%d total:%d comp:%f st_q:%2.2f "
- "size:%d var:%d/%d br:%d fps:%d\n",
+ "size:%d var:%"PRId64"/%"PRId64" br:%d fps:%d\n",
av_get_picture_type_char(pict_type),
qmin, q, qmax, picture_number,
(int)wanted_bits / 1000, (int)s->total_bits / 1000,
@@ -950,8 +952,8 @@ static int init_pass2(MpegEncContext *s)
return -1;
}
- qscale = av_malloc(sizeof(double) * rcc->num_entries);
- blurred_qscale = av_malloc(sizeof(double) * rcc->num_entries);
+ qscale = av_malloc_array(rcc->num_entries, sizeof(double));
+ blurred_qscale = av_malloc_array(rcc->num_entries, sizeof(double));
toobig = 0;
for (step = 256 * 256; step > 0.0000001; step *= 0.5) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/ratecontrol.h b/chromium/third_party/ffmpeg/libavcodec/ratecontrol.h
index 959b6a23534..eeb4bb96c0c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ratecontrol.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ratecontrol.h
@@ -49,8 +49,8 @@ typedef struct RateControlEntry{
uint64_t expected_bits;
int new_pict_type;
float new_qscale;
- int mc_mb_var_sum;
- int mb_var_sum;
+ int64_t mc_mb_var_sum;
+ int64_t mb_var_sum;
int i_count;
int skip_count;
int f_code;
@@ -71,8 +71,8 @@ typedef struct RateControlContext{
double pass1_wanted_bits; ///< bits which should have been outputed by the pass1 code (including complexity init)
double last_qscale;
double last_qscale_for[5]; ///< last qscale for a specific pict type, used for max_diff & ipb factor stuff
- int last_mc_mb_var_sum;
- int last_mb_var_sum;
+ int64_t last_mc_mb_var_sum;
+ int64_t last_mb_var_sum;
uint64_t i_cplx_sum[5];
uint64_t p_cplx_sum[5];
uint64_t mv_bits_sum[5];
diff --git a/chromium/third_party/ffmpeg/libavcodec/raw.c b/chromium/third_party/ffmpeg/libavcodec/raw.c
index c3f3de16947..551a1722fc6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/raw.c
+++ b/chromium/third_party/ffmpeg/libavcodec/raw.c
@@ -53,6 +53,7 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
{ AV_PIX_FMT_YUYV422, MKTAG('V', '4', '2', '2') },
{ AV_PIX_FMT_YUYV422, MKTAG('V', 'Y', 'U', 'Y') },
{ AV_PIX_FMT_YUYV422, MKTAG('Y', 'U', 'N', 'V') },
+ { AV_PIX_FMT_YVYU422, MKTAG('Y', 'V', 'Y', 'U') }, /* Philips */
{ AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') },
{ AV_PIX_FMT_UYVY422, MKTAG('H', 'D', 'Y', 'C') },
{ AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'V') },
@@ -178,6 +179,22 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
{ AV_PIX_FMT_GBRP16LE, MKTAG('G', '3', 00 , 16 ) },
{ AV_PIX_FMT_GBRP16BE, MKTAG(16 , 00 , '3', 'G') },
+ { AV_PIX_FMT_XYZ12LE, MKTAG('X', 'Y', 'Z' , 36 ) },
+ { AV_PIX_FMT_XYZ12BE, MKTAG(36 , 'Z' , 'Y', 'X') },
+
+ { AV_PIX_FMT_BAYER_BGGR8, MKTAG(0xBA, 'B', 'G', 8 ) },
+ { AV_PIX_FMT_BAYER_BGGR16LE, MKTAG(0xBA, 'B', 'G', 16 ) },
+ { AV_PIX_FMT_BAYER_BGGR16BE, MKTAG(16 , 'G', 'B', 0xBA) },
+ { AV_PIX_FMT_BAYER_RGGB8, MKTAG(0xBA, 'R', 'G', 8 ) },
+ { AV_PIX_FMT_BAYER_RGGB16LE, MKTAG(0xBA, 'R', 'G', 16 ) },
+ { AV_PIX_FMT_BAYER_RGGB16BE, MKTAG(16 , 'G', 'R', 0xBA) },
+ { AV_PIX_FMT_BAYER_GBRG8, MKTAG(0xBA, 'G', 'B', 8 ) },
+ { AV_PIX_FMT_BAYER_GBRG16LE, MKTAG(0xBA, 'G', 'B', 16 ) },
+ { AV_PIX_FMT_BAYER_GBRG16BE, MKTAG(16, 'B', 'G', 0xBA) },
+ { AV_PIX_FMT_BAYER_GRBG8, MKTAG(0xBA, 'G', 'R', 8 ) },
+ { AV_PIX_FMT_BAYER_GRBG16LE, MKTAG(0xBA, 'G', 'R', 16 ) },
+ { AV_PIX_FMT_BAYER_GRBG16BE, MKTAG(16, 'R', 'G', 0xBA) },
+
/* quicktime */
{ AV_PIX_FMT_YUV420P, MKTAG('R', '4', '2', '0') }, /* Radius DV YUV PAL */
{ AV_PIX_FMT_YUV411P, MKTAG('R', '4', '1', '1') }, /* Radius DV YUV NTSC */
@@ -203,7 +220,6 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
/* special */
{ AV_PIX_FMT_RGB565LE,MKTAG( 3 , 0 , 0 , 0 ) }, /* flipped RGB565LE */
{ AV_PIX_FMT_YUV444P, MKTAG('Y', 'V', '2', '4') }, /* YUV444P, swapped UV */
- { AV_PIX_FMT_YUYV422, MKTAG('Y', 'V', 'Y', 'U') }, /* YUYV, swapped UV */
{ AV_PIX_FMT_NONE, 0 },
};
@@ -218,3 +234,28 @@ unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat fmt)
}
return 0;
}
+
+const PixelFormatTag avpriv_pix_fmt_bps_avi[] = {
+ { AV_PIX_FMT_MONOWHITE, 1 },
+ { AV_PIX_FMT_PAL8, 2 },
+ { AV_PIX_FMT_PAL8, 4 },
+ { AV_PIX_FMT_PAL8, 8 },
+ { AV_PIX_FMT_RGB444LE, 12 },
+ { AV_PIX_FMT_RGB555LE, 15 },
+ { AV_PIX_FMT_RGB555LE, 16 },
+ { AV_PIX_FMT_BGR24, 24 },
+ { AV_PIX_FMT_BGRA, 32 },
+ { AV_PIX_FMT_NONE, 0 },
+};
+
+const PixelFormatTag avpriv_pix_fmt_bps_mov[] = {
+ { AV_PIX_FMT_MONOWHITE, 1 },
+ { AV_PIX_FMT_PAL8, 2 },
+ { AV_PIX_FMT_PAL8, 4 },
+ { AV_PIX_FMT_PAL8, 8 },
+ { AV_PIX_FMT_RGB555BE, 16 },
+ { AV_PIX_FMT_RGB24, 24 },
+ { AV_PIX_FMT_ARGB, 32 },
+ { AV_PIX_FMT_MONOWHITE,33 },
+ { AV_PIX_FMT_NONE, 0 },
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/raw.h b/chromium/third_party/ffmpeg/libavcodec/raw.h
index 3e59f28e33d..a4179930a3b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/raw.h
+++ b/chromium/third_party/ffmpeg/libavcodec/raw.h
@@ -41,4 +41,7 @@ enum AVPixelFormat ff_find_pix_fmt(const PixelFormatTag *tags, unsigned int four
#endif
enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc);
+extern av_export const PixelFormatTag avpriv_pix_fmt_bps_avi[];
+extern av_export const PixelFormatTag avpriv_pix_fmt_bps_mov[];
+
#endif /* AVCODEC_RAW_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/rawdec.c b/chromium/third_party/ffmpeg/libavcodec/rawdec.c
index 3f4a8fc86d7..a03b1be9fe6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rawdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rawdec.c
@@ -25,6 +25,8 @@
*/
#include "avcodec.h"
+#include "dsputil.h"
+#include "get_bits.h"
#include "internal.h"
#include "raw.h"
#include "libavutil/avassert.h"
@@ -41,7 +43,12 @@ typedef struct RawVideoContext {
int flip;
int is_2_4_bpp; // 2 or 4 bpp raw in avi/mov
int is_yuv2;
+ int is_lt_16bpp; // 16bpp pixfmt and bits_per_coded_sample < 16
int tff;
+
+ DSPContext dsp;
+ void *bitstream_buf;
+ unsigned int bitstream_buf_size;
} RawVideoContext;
static const AVOption options[]={
@@ -55,44 +62,6 @@ static const AVClass rawdec_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-static const PixelFormatTag pix_fmt_bps_avi[] = {
- { AV_PIX_FMT_MONOWHITE, 1 },
- { AV_PIX_FMT_PAL8, 2 },
- { AV_PIX_FMT_PAL8, 4 },
- { AV_PIX_FMT_PAL8, 8 },
- { AV_PIX_FMT_RGB444LE, 12 },
- { AV_PIX_FMT_RGB555LE, 15 },
- { AV_PIX_FMT_RGB555LE, 16 },
- { AV_PIX_FMT_BGR24, 24 },
- { AV_PIX_FMT_BGRA, 32 },
- { AV_PIX_FMT_NONE, 0 },
-};
-
-static const PixelFormatTag pix_fmt_bps_mov[] = {
- { AV_PIX_FMT_MONOWHITE, 1 },
- { AV_PIX_FMT_PAL8, 2 },
- { AV_PIX_FMT_PAL8, 4 },
- { AV_PIX_FMT_PAL8, 8 },
- // FIXME swscale does not support 16 bit in .mov, sample 16bit.mov
- // http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
- { AV_PIX_FMT_RGB555BE, 16 },
- { AV_PIX_FMT_RGB24, 24 },
- { AV_PIX_FMT_ARGB, 32 },
- { AV_PIX_FMT_MONOWHITE,33 },
- { AV_PIX_FMT_NONE, 0 },
-};
-
-enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags,
- unsigned int fourcc)
-{
- while (tags->pix_fmt >= 0) {
- if (tags->fourcc == fourcc)
- return tags->pix_fmt;
- tags++;
- }
- return AV_PIX_FMT_NONE;
-}
-
#if LIBAVCODEC_VERSION_MAJOR < 55
enum AVPixelFormat ff_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc)
{
@@ -105,17 +74,19 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
RawVideoContext *context = avctx->priv_data;
const AVPixFmtDescriptor *desc;
+ ff_dsputil_init(&context->dsp, avctx);
+
if ( avctx->codec_tag == MKTAG('r','a','w',' ')
|| avctx->codec_tag == MKTAG('N','O','1','6'))
- avctx->pix_fmt = avpriv_find_pix_fmt(pix_fmt_bps_mov,
+ avctx->pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_mov,
avctx->bits_per_coded_sample);
else if (avctx->codec_tag == MKTAG('W', 'R', 'A', 'W'))
- avctx->pix_fmt = avpriv_find_pix_fmt(pix_fmt_bps_avi,
+ avctx->pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_avi,
avctx->bits_per_coded_sample);
- else if (avctx->codec_tag)
+ else if (avctx->codec_tag && (avctx->codec_tag & 0xFFFFFF) != MKTAG('B','I','T', 0))
avctx->pix_fmt = avpriv_find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag);
else if (avctx->pix_fmt == AV_PIX_FMT_NONE && avctx->bits_per_coded_sample)
- avctx->pix_fmt = avpriv_find_pix_fmt(pix_fmt_bps_avi,
+ avctx->pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_avi,
avctx->bits_per_coded_sample);
desc = av_pix_fmt_desc_get(avctx->pix_fmt);
@@ -142,6 +113,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
FFALIGN(avctx->width, 16),
avctx->height);
} else {
+ context->is_lt_16bpp = av_get_bits_per_pixel(desc) == 16 && avctx->bits_per_coded_sample && avctx->bits_per_coded_sample < 16;
context->frame_size = avpicture_get_size(avctx->pix_fmt, avctx->width,
avctx->height);
}
@@ -166,6 +138,34 @@ static void flip(AVCodecContext *avctx, AVPicture *picture)
picture->linesize[0] *= -1;
}
+/*
+ * Scale sample to 16-bit resolution
+ */
+#define SCALE16(x, bits) (((x) << (16 - (bits))) | ((x) >> (2 * (bits) - 16)))
+
+/**
+ * Scale buffer to 16 bits per coded sample resolution
+ */
+#define MKSCALE16(name, r16, w16) \
+static void name(AVCodecContext *avctx, uint8_t * dst, const uint8_t *buf, int buf_size, int packed) \
+{ \
+ int i; \
+ if (!packed) { \
+ for (i = 0; i + 1 < buf_size; i += 2) \
+ w16(dst + i, SCALE16(r16(buf + i), avctx->bits_per_coded_sample)); \
+ } else { \
+ GetBitContext gb; \
+ init_get_bits(&gb, buf, buf_size * 8); \
+ for (i = 0; i < avctx->width * avctx->height; i++) { \
+ int sample = get_bits(&gb, avctx->bits_per_coded_sample); \
+ w16(dst + i*2, SCALE16(sample, avctx->bits_per_coded_sample)); \
+ } \
+ } \
+}
+
+MKSCALE16(scale16be, AV_RB16, AV_WB16)
+MKSCALE16(scale16le, AV_RL16, AV_WL16)
+
static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
@@ -175,15 +175,18 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
int buf_size = avpkt->size;
int linesize_align = 4;
int res, len;
- int need_copy = !avpkt->buf || context->is_2_4_bpp || context->is_yuv2;
+ int need_copy = !avpkt->buf || context->is_2_4_bpp || context->is_yuv2 || context->is_lt_16bpp;
AVFrame *frame = data;
AVPicture *picture = data;
frame->pict_type = AV_PICTURE_TYPE_I;
frame->key_frame = 1;
- frame->reordered_opaque = avctx->reordered_opaque;
- frame->pkt_pts = avctx->internal->pkt->pts;
+
+ res = ff_decode_frame_props(avctx, frame);
+ if (res < 0)
+ return res;
+
av_frame_set_pkt_pos (frame, avctx->internal->pkt->pos);
av_frame_set_pkt_duration(frame, avctx->internal->pkt->duration);
@@ -224,6 +227,30 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
linesize_align = 16;
}
buf = dst;
+ } else if (context->is_lt_16bpp) {
+ uint8_t *dst = frame->buf[0]->data;
+ int packed = (avctx->codec_tag & 0xFFFFFF) == MKTAG('B','I','T', 0);
+ int swap = avctx->codec_tag >> 24;
+
+ if (packed && swap) {
+ av_fast_padded_malloc(&context->bitstream_buf, &context->bitstream_buf_size, buf_size);
+ if (!context->bitstream_buf)
+ return AVERROR(ENOMEM);
+ if (swap == 16)
+ context->dsp.bswap16_buf(context->bitstream_buf, (const uint16_t*)buf, buf_size / 2);
+ else if (swap == 32)
+ context->dsp.bswap_buf(context->bitstream_buf, (const uint32_t*)buf, buf_size / 4);
+ else
+ return AVERROR_INVALIDDATA;
+ buf = context->bitstream_buf;
+ }
+
+ if (desc->flags & AV_PIX_FMT_FLAG_BE)
+ scale16be(avctx, dst, buf, buf_size, packed);
+ else
+ scale16le(avctx, dst, buf, buf_size, packed);
+
+ buf = dst;
} else if (need_copy) {
memcpy(frame->buf[0]->data, buf, buf_size);
buf = frame->buf[0]->data;
@@ -234,7 +261,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
buf += buf_size - context->frame_size;
len = context->frame_size - (avctx->pix_fmt==AV_PIX_FMT_PAL8 ? AVPALETTE_SIZE : 0);
- if (buf_size < len) {
+ if (buf_size < len && (avctx->codec_tag & 0xFFFFFF) != MKTAG('B','I','T', 0)) {
av_log(avctx, AV_LOG_ERROR, "Invalid buffer size, packet size %d < expected frame_size %d\n", buf_size, len);
av_buffer_unref(&frame->buf[0]);
return AVERROR(EINVAL);
@@ -319,16 +346,6 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
line += picture->linesize[0];
}
}
- if (avctx->codec_tag == AV_RL32("YVYU") &&
- avctx->pix_fmt == AV_PIX_FMT_YUYV422) {
- int x, y;
- uint8_t *line = picture->data[0];
- for(y = 0; y < avctx->height; y++) {
- for(x = 0; x < avctx->width - 1; x += 2)
- FFSWAP(uint8_t, line[2*x + 1], line[2*x + 3]);
- line += picture->linesize[0];
- }
- }
if (avctx->field_order > AV_FIELD_PROGRESSIVE) { /* we have interlaced material flagged in container */
frame->interlaced_frame = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/rawenc.c b/chromium/third_party/ffmpeg/libavcodec/rawenc.c
index 036261d1ec6..c5d3d2e9559 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rawenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rawenc.c
@@ -31,7 +31,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/internal.h"
-static av_cold int raw_init_encoder(AVCodecContext *avctx)
+static av_cold int raw_encode_init(AVCodecContext *avctx)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
@@ -75,6 +75,6 @@ AVCodec ff_rawvideo_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_RAWVIDEO,
.priv_data_size = sizeof(AVFrame),
- .init = raw_init_encoder,
+ .init = raw_encode_init,
.encode2 = raw_encode,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/rnd_avg.h b/chromium/third_party/ffmpeg/libavcodec/rnd_avg.h
index 50ab59a0fc9..344775e31fd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rnd_avg.h
+++ b/chromium/third_party/ffmpeg/libavcodec/rnd_avg.h
@@ -25,14 +25,8 @@
#include <stddef.h>
#include <stdint.h>
-#define CALL_2X_PIXELS(a, b, n)\
-static void a(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
- b(block , pixels , line_size, h);\
- b(block+n, pixels+n, line_size, h);\
-}
-
-#define BYTE_VEC32(c) ((c)*0x01010101UL)
-#define BYTE_VEC64(c) ((c)*0x0001000100010001UL)
+#define BYTE_VEC32(c) ((c) * 0x01010101UL)
+#define BYTE_VEC64(c) ((c) * 0x0001000100010001UL)
static inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/roqvideo.h b/chromium/third_party/ffmpeg/libavcodec/roqvideo.h
index 39dda0c88b2..3da6eaa9910 100644
--- a/chromium/third_party/ffmpeg/libavcodec/roqvideo.h
+++ b/chromium/third_party/ffmpeg/libavcodec/roqvideo.h
@@ -43,6 +43,7 @@ struct RoqTempData;
typedef struct RoqContext {
+ const AVClass *class;
AVCodecContext *avctx;
AVFrame *last_frame;
AVFrame *current_frame;
@@ -69,6 +70,9 @@ typedef struct RoqContext {
const AVFrame *frame_to_enc;
uint8_t *out_buf;
struct RoqTempData *tmpData;
+
+ int quake3_compat; // Quake 3 compatibility option
+
} RoqContext;
#define RoQ_INFO 0x1001
diff --git a/chromium/third_party/ffmpeg/libavcodec/roqvideodec.c b/chromium/third_party/ffmpeg/libavcodec/roqvideodec.c
index 8e7dffe5ccd..322345ef1c0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/roqvideodec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/roqvideodec.c
@@ -79,7 +79,7 @@ static void roqvideo_decode_frame(RoqContext *ri)
for (yp = ypos; yp < ypos + 16; yp += 8)
for (xp = xpos; xp < xpos + 16; xp += 8) {
if (bytestream2_tell(&ri->gb) >= chunk_start + chunk_size) {
- av_log(ri->avctx, AV_LOG_ERROR, "Input buffer too small\n");
+ av_log(ri->avctx, AV_LOG_VERBOSE, "Chunk is too short\n");
return;
}
if (vqflg_pos < 0) {
@@ -114,7 +114,7 @@ static void roqvideo_decode_frame(RoqContext *ri)
if(k & 0x02) y += 4;
if (bytestream2_tell(&ri->gb) >= chunk_start + chunk_size) {
- av_log(ri->avctx, AV_LOG_ERROR, "Input buffer too small\n");
+ av_log(ri->avctx, AV_LOG_VERBOSE, "Chunk is too short\n");
return;
}
if (vqflg_pos < 0) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/roqvideoenc.c b/chromium/third_party/ffmpeg/libavcodec/roqvideoenc.c
index 37bd8d5cb69..cae157b7687 100644
--- a/chromium/third_party/ffmpeg/libavcodec/roqvideoenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/roqvideoenc.c
@@ -57,6 +57,7 @@
#include <string.h>
#include "libavutil/attributes.h"
+#include "libavutil/opt.h"
#include "roqvideo.h"
#include "bytestream.h"
#include "elbg.h"
@@ -69,7 +70,7 @@
* Maximum number of generated 4x4 codebooks. Can't be 256 to workaround a
* Quake 3 bug.
*/
-#define MAX_CBS_4x4 255
+#define MAX_CBS_4x4 256
#define MAX_CBS_2x2 256 ///< Maximum number of 2x2 codebooks.
@@ -248,7 +249,7 @@ static void create_cel_evals(RoqContext *enc, RoqTempdata *tempData)
{
int n=0, x, y, i;
- tempData->cel_evals = av_malloc(enc->width*enc->height/64 * sizeof(CelEvaluation));
+ tempData->cel_evals = av_malloc_array(enc->width*enc->height/64, sizeof(CelEvaluation));
/* Map to the ROQ quadtree order */
for (y=0; y<enc->height; y+=16)
@@ -540,7 +541,7 @@ static void remap_codebooks(RoqContext *enc, RoqTempdata *tempData)
int i, j, idx=0;
/* Make remaps for the final codebook usage */
- for (i=0; i<MAX_CBS_4x4; i++) {
+ for (i=0; i<(enc->quake3_compat ? MAX_CBS_4x4-1 : MAX_CBS_4x4); i++) {
if (tempData->codebooks.usedCB4[i]) {
tempData->i2f4[i] = idx;
tempData->f2i4[idx] = i;
@@ -798,11 +799,11 @@ static void generate_codebook(RoqContext *enc, RoqTempdata *tempdata,
int i, j, k;
int c_size = size*size/4;
int *buf;
- int *codebook = av_malloc(6*c_size*cbsize*sizeof(int));
+ int *codebook = av_malloc_array(6*c_size, cbsize*sizeof(int));
int *closest_cb;
if (size == 4)
- closest_cb = av_malloc(6*c_size*inputCount*sizeof(int));
+ closest_cb = av_malloc_array(6*c_size, inputCount*sizeof(int));
else
closest_cb = tempdata->closest_cb2;
@@ -833,8 +834,8 @@ static void generate_new_codebooks(RoqContext *enc, RoqTempdata *tempData)
int max = enc->width*enc->height/16;
uint8_t mb2[3*4];
roq_cell *results4 = av_malloc(sizeof(roq_cell)*MAX_CBS_4x4*4);
- uint8_t *yuvClusters=av_malloc(sizeof(int)*max*6*4);
- int *points = av_malloc(max*6*4*sizeof(int));
+ uint8_t *yuvClusters=av_malloc_array(max, sizeof(int)*6*4);
+ int *points = av_malloc_array(max, 6*4*sizeof(int));
int bias;
/* Subsample YUV data */
@@ -847,11 +848,11 @@ static void generate_new_codebooks(RoqContext *enc, RoqTempdata *tempData)
}
/* Create 4x4 codebooks */
- generate_codebook(enc, tempData, points, max, results4, 4, MAX_CBS_4x4);
+ generate_codebook(enc, tempData, points, max, results4, 4, (enc->quake3_compat ? MAX_CBS_4x4-1 : MAX_CBS_4x4));
- codebooks->numCB4 = MAX_CBS_4x4;
+ codebooks->numCB4 = (enc->quake3_compat ? MAX_CBS_4x4-1 : MAX_CBS_4x4);
- tempData->closest_cb2 = av_malloc(max*4*sizeof(int));
+ tempData->closest_cb2 = av_malloc_array(max, 4*sizeof(int));
/* Create 2x2 codebooks */
generate_codebook(enc, tempData, points, max*4, enc->cb2x2, 2, MAX_CBS_2x2);
@@ -901,10 +902,10 @@ static void roq_encode_video(RoqContext *enc)
gather_data_for_cel(tempData->cel_evals + i, enc, tempData);
/* Quake 3 can't handle chunks bigger than 65535 bytes */
- if (tempData->mainChunkSize/8 > 65535) {
+ if (tempData->mainChunkSize/8 > 65535 && enc->quake3_compat) {
av_log(enc->avctx, AV_LOG_ERROR,
- "Warning, generated a frame too big (%d > 65535), "
- "try using a smaller qscale value.\n",
+ "Warning, generated a frame too big for Quake (%d > 65535), "
+ "now switching to a bigger qscale value.\n",
tempData->mainChunkSize/8);
enc->lambda *= 1.5;
tempData->mainChunkSize = 0;
@@ -962,7 +963,7 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
enc->framesSinceKeyframe = 0;
if ((avctx->width & 0xf) || (avctx->height & 0xf)) {
av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n");
- return -1;
+ return AVERROR(EINVAL);
}
if (((avctx->width)&(avctx->width-1))||((avctx->height)&(avctx->height-1)))
@@ -984,16 +985,16 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
enc->tmpData = av_malloc(sizeof(RoqTempdata));
enc->this_motion4 =
- av_mallocz((enc->width*enc->height/16)*sizeof(motion_vect));
+ av_mallocz_array((enc->width*enc->height/16), sizeof(motion_vect));
enc->last_motion4 =
- av_malloc ((enc->width*enc->height/16)*sizeof(motion_vect));
+ av_malloc_array ((enc->width*enc->height/16), sizeof(motion_vect));
enc->this_motion8 =
- av_mallocz((enc->width*enc->height/64)*sizeof(motion_vect));
+ av_mallocz_array((enc->width*enc->height/64), sizeof(motion_vect));
enc->last_motion8 =
- av_malloc ((enc->width*enc->height/64)*sizeof(motion_vect));
+ av_malloc_array ((enc->width*enc->height/64), sizeof(motion_vect));
return 0;
}
@@ -1073,6 +1074,20 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
+#define OFFSET(x) offsetof(RoqContext, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "quake3_compat", "Whether to respect known limitations in Quake 3 decoder", OFFSET(quake3_compat), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
+ { NULL },
+};
+
+static const AVClass roq_class = {
+ .class_name = "RoQ",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_roq_encoder = {
.name = "roqvideo",
.long_name = NULL_IF_CONFIG_SMALL("id RoQ video"),
@@ -1082,7 +1097,7 @@ AVCodec ff_roq_encoder = {
.init = roq_encode_init,
.encode2 = roq_encode_frame,
.close = roq_encode_end,
- .supported_framerates = (const AVRational[]){ {30,1}, {0,0} },
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P,
AV_PIX_FMT_NONE },
+ .priv_class = &roq_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/rpza.c b/chromium/third_party/ffmpeg/libavcodec/rpza.c
index d4e2b17addf..aac437e41c9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rpza.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rpza.c
@@ -34,13 +34,14 @@
* pixels shall be stored in native CPU endianness.
*/
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
#include "avcodec.h"
+#include "bytestream.h"
#include "internal.h"
typedef struct RpzaContext {
@@ -48,9 +49,7 @@ typedef struct RpzaContext {
AVCodecContext *avctx;
AVFrame *frame;
- const unsigned char *buf;
- int size;
-
+ GetByteContext gb;
} RpzaContext;
#define ADVANCE_BLOCK() \
@@ -74,15 +73,11 @@ static void rpza_decode_stream(RpzaContext *s)
int width = s->avctx->width;
int stride = s->frame->linesize[0] / 2;
int row_inc = stride - 4;
- int stream_ptr = 0;
int chunk_size;
- unsigned char opcode;
- int n_blocks;
- unsigned short colorA = 0, colorB;
- unsigned short color4[4];
- unsigned char index, idx;
- unsigned short ta, tb;
- unsigned short *pixels = (unsigned short *)s->frame->data[0];
+ uint16_t colorA = 0, colorB;
+ uint16_t color4[4];
+ uint16_t ta, tb;
+ uint16_t *pixels = (uint16_t *)s->frame->data[0];
int row_ptr = 0;
int pixel_ptr = -4;
@@ -91,34 +86,31 @@ static void rpza_decode_stream(RpzaContext *s)
int total_blocks;
/* First byte is always 0xe1. Warn if it's different */
- if (s->buf[stream_ptr] != 0xe1)
+ if (bytestream2_peek_byte(&s->gb) != 0xe1)
av_log(s->avctx, AV_LOG_ERROR, "First chunk byte is 0x%02x instead of 0xe1\n",
- s->buf[stream_ptr]);
+ bytestream2_peek_byte(&s->gb));
/* Get chunk size, ingnoring first byte */
- chunk_size = AV_RB32(&s->buf[stream_ptr]) & 0x00FFFFFF;
- stream_ptr += 4;
+ chunk_size = bytestream2_get_be32(&s->gb) & 0x00FFFFFF;
/* If length mismatch use size from MOV file and try to decode anyway */
- if (chunk_size != s->size)
- av_log(s->avctx, AV_LOG_ERROR, "MOV chunk size != encoded chunk size; using MOV chunk size\n");
-
- chunk_size = s->size;
+ if (chunk_size != bytestream2_get_bytes_left(&s->gb) - 4)
+ av_log(s->avctx, AV_LOG_WARNING, "MOV chunk size != encoded chunk size\n");
/* Number of 4x4 blocks in frame. */
total_blocks = ((s->avctx->width + 3) / 4) * ((s->avctx->height + 3) / 4);
/* Process chunk data */
- while (stream_ptr < chunk_size) {
- opcode = s->buf[stream_ptr++]; /* Get opcode */
+ while (bytestream2_get_bytes_left(&s->gb)) {
+ uint8_t opcode = bytestream2_get_byte(&s->gb); /* Get opcode */
- n_blocks = (opcode & 0x1f) + 1; /* Extract block counter from opcode */
+ int n_blocks = (opcode & 0x1f) + 1; /* Extract block counter from opcode */
/* If opcode MSbit is 0, we need more data to decide what to do */
if ((opcode & 0x80) == 0) {
- colorA = (opcode << 8) | (s->buf[stream_ptr++]);
+ colorA = (opcode << 8) | bytestream2_get_byte(&s->gb);
opcode = 0;
- if ((s->buf[stream_ptr] & 0x80) != 0) {
+ if ((bytestream2_peek_byte(&s->gb) & 0x80) != 0) {
/* Must behave as opcode 110xxxxx, using colorA computed
* above. Use fake opcode 0x20 to enter switch block at
* the right place */
@@ -127,6 +119,8 @@ static void rpza_decode_stream(RpzaContext *s)
}
}
+ n_blocks = FFMIN(n_blocks, total_blocks);
+
switch (opcode & 0xe0) {
/* Skip blocks */
@@ -138,8 +132,7 @@ static void rpza_decode_stream(RpzaContext *s)
/* Fill blocks with one color */
case 0xa0:
- colorA = AV_RB16 (&s->buf[stream_ptr]);
- stream_ptr += 2;
+ colorA = bytestream2_get_be16(&s->gb);
while (n_blocks--) {
ADVANCE_BLOCK()
block_ptr = row_ptr + pixel_ptr;
@@ -155,11 +148,9 @@ static void rpza_decode_stream(RpzaContext *s)
/* Fill blocks with 4 colors */
case 0xc0:
- colorA = AV_RB16 (&s->buf[stream_ptr]);
- stream_ptr += 2;
+ colorA = bytestream2_get_be16(&s->gb);
case 0x20:
- colorB = AV_RB16 (&s->buf[stream_ptr]);
- stream_ptr += 2;
+ colorB = bytestream2_get_be16(&s->gb);
/* sort out the colors */
color4[0] = colorB;
@@ -185,15 +176,15 @@ static void rpza_decode_stream(RpzaContext *s)
color4[1] |= ((11 * ta + 21 * tb) >> 5);
color4[2] |= ((21 * ta + 11 * tb) >> 5);
- if (s->size - stream_ptr < n_blocks * 4)
+ if (bytestream2_get_bytes_left(&s->gb) < n_blocks * 4)
return;
while (n_blocks--) {
ADVANCE_BLOCK();
block_ptr = row_ptr + pixel_ptr;
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- index = s->buf[stream_ptr++];
+ uint8_t index = bytestream2_get_byteu(&s->gb);
for (pixel_x = 0; pixel_x < 4; pixel_x++){
- idx = (index >> (2 * (3 - pixel_x))) & 0x03;
+ uint8_t idx = (index >> (2 * (3 - pixel_x))) & 0x03;
pixels[block_ptr] = color4[idx];
block_ptr++;
}
@@ -204,17 +195,15 @@ static void rpza_decode_stream(RpzaContext *s)
/* Fill block with 16 colors */
case 0x00:
- if (s->size - stream_ptr < 30)
+ if (bytestream2_get_bytes_left(&s->gb) < 30)
return;
ADVANCE_BLOCK();
block_ptr = row_ptr + pixel_ptr;
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
for (pixel_x = 0; pixel_x < 4; pixel_x++){
/* We already have color of upper left pixel */
- if ((pixel_y != 0) || (pixel_x !=0)) {
- colorA = AV_RB16 (&s->buf[stream_ptr]);
- stream_ptr += 2;
- }
+ if ((pixel_y != 0) || (pixel_x != 0))
+ colorA = bytestream2_get_be16u(&s->gb);
pixels[block_ptr] = colorA;
block_ptr++;
}
@@ -226,7 +215,7 @@ static void rpza_decode_stream(RpzaContext *s)
default:
av_log(s->avctx, AV_LOG_ERROR, "Unknown opcode %d in rpza chunk."
" Skip remaining %d bytes of chunk data.\n", opcode,
- chunk_size - stream_ptr);
+ bytestream2_get_bytes_left(&s->gb));
return;
} /* Opcode switch */
}
@@ -250,13 +239,10 @@ static int rpza_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
- const uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
RpzaContext *s = avctx->priv_data;
int ret;
- s->buf = buf;
- s->size = buf_size;
+ bytestream2_init(&s->gb, avpkt->data, avpkt->size);
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return ret;
@@ -269,7 +255,7 @@ static int rpza_decode_frame(AVCodecContext *avctx,
*got_frame = 1;
/* always report that the buffer was completely consumed */
- return buf_size;
+ return avpkt->size;
}
static av_cold int rpza_decode_end(AVCodecContext *avctx)
diff --git a/chromium/third_party/ffmpeg/libavcodec/rtjpeg.c b/chromium/third_party/ffmpeg/libavcodec/rtjpeg.c
index 860d95821d1..e67ba7565d1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rtjpeg.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rtjpeg.c
@@ -121,7 +121,7 @@ int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
if (res < 0) \
return res; \
if (res > 0) \
- c->dsp->idct_put(dst, stride, block); \
+ c->dsp.idct_put(dst, stride, block); \
} while (0)
int16_t *block = c->block;
BLOCK(c->lquant, y1, f->linesize[0]);
@@ -148,7 +148,6 @@ int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
/**
* @brief initialize an RTJpegContext, may be called multiple times
* @param c context to initialize
- * @param dsp specifies the idct to use for decoding
* @param width width of image, will be rounded down to the nearest multiple
* of 16 for decoding
* @param height height of image, will be rounded down to the nearest multiple
@@ -156,21 +155,29 @@ int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
* @param lquant luma quantization table to use
* @param cquant chroma quantization table to use
*/
-void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
- int width, int height,
+void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height,
const uint32_t *lquant, const uint32_t *cquant) {
int i;
- c->dsp = dsp;
for (i = 0; i < 64; i++) {
- int z = ff_zigzag_direct[i];
- int p = c->dsp->idct_permutation[i];
- z = ((z << 3) | (z >> 3)) & 63; // rtjpeg uses a transposed variant
-
- // permute the scan and quantization tables for the chosen idct
- c->scan[i] = c->dsp->idct_permutation[z];
+ int p = c->dsp.idct_permutation[i];
c->lquant[p] = lquant[i];
c->cquant[p] = cquant[i];
}
c->w = width;
c->h = height;
}
+
+void ff_rtjpeg_init(RTJpegContext *c, AVCodecContext *avctx)
+{
+ int i;
+
+ ff_dsputil_init(&c->dsp, avctx);
+
+ for (i = 0; i < 64; i++) {
+ int z = ff_zigzag_direct[i];
+ z = ((z << 3) | (z >> 3)) & 63; // rtjpeg uses a transposed variant
+
+ // permute the scan and quantization tables for the chosen idct
+ c->scan[i] = c->dsp.idct_permutation[z];
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/rtjpeg.h b/chromium/third_party/ffmpeg/libavcodec/rtjpeg.h
index 294b06c6978..3be4cfcad24 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rtjpeg.h
+++ b/chromium/third_party/ffmpeg/libavcodec/rtjpeg.h
@@ -31,16 +31,17 @@
typedef struct RTJpegContext {
int w, h;
- DSPContext *dsp;
+ DSPContext dsp;
uint8_t scan[64];
uint32_t lquant[64];
uint32_t cquant[64];
DECLARE_ALIGNED(16, int16_t, block)[64];
} RTJpegContext;
-void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
- int width, int height,
- const uint32_t *lquant, const uint32_t *cquant);
+void ff_rtjpeg_init(RTJpegContext *c, AVCodecContext *avctx);
+
+void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height,
+ const uint32_t *lquant, const uint32_t *cquant);
int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
const uint8_t *buf, int buf_size);
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv10.c b/chromium/third_party/ffmpeg/libavcodec/rv10.c
index 4d48a49f3c5..3fb94c8ad79 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv10.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv10.c
@@ -25,19 +25,22 @@
* RV10/RV20 decoder
*/
+#include <inttypes.h>
+
#include "libavutil/imgutils.h"
+
#include "avcodec.h"
#include "error_resilience.h"
+#include "h263.h"
#include "internal.h"
#include "mpegvideo.h"
#include "mpeg4video.h"
-#include "h263.h"
#define RV_GET_MAJOR_VER(x) ((x) >> 28)
#define RV_GET_MINOR_VER(x) (((x) >> 20) & 0xFF)
#define RV_GET_MICRO_VER(x) (((x) >> 12) & 0xFF)
-#define DC_VLC_BITS 14 //FIXME find a better solution
+#define DC_VLC_BITS 14 // FIXME find a better solution
typedef struct RVDecContext {
MpegEncContext m;
@@ -194,18 +197,18 @@ int ff_rv_decode_dc(MpegEncContext *s, int n)
code = get_vlc2(&s->gb, rv_dc_lum.table, DC_VLC_BITS, 2);
if (code < 0) {
/* XXX: I don't understand why they use LONGER codes than
- necessary. The following code would be completely useless
- if they had thought about it !!! */
+ * necessary. The following code would be completely useless
+ * if they had thought about it !!! */
code = get_bits(&s->gb, 7);
if (code == 0x7c) {
- code = (int8_t)(get_bits(&s->gb, 7) + 1);
+ code = (int8_t) (get_bits(&s->gb, 7) + 1);
} else if (code == 0x7d) {
code = -128 + get_bits(&s->gb, 7);
} else if (code == 0x7e) {
if (get_bits1(&s->gb) == 0)
- code = (int8_t)(get_bits(&s->gb, 8) + 1);
+ code = (int8_t) (get_bits(&s->gb, 8) + 1);
else
- code = (int8_t)(get_bits(&s->gb, 8));
+ code = (int8_t) (get_bits(&s->gb, 8));
} else if (code == 0x7f) {
skip_bits(&s->gb, 11);
code = 1;
@@ -219,7 +222,7 @@ int ff_rv_decode_dc(MpegEncContext *s, int n)
if (code < 0) {
code = get_bits(&s->gb, 9);
if (code == 0x1fc) {
- code = (int8_t)(get_bits(&s->gb, 7) + 1);
+ code = (int8_t) (get_bits(&s->gb, 7) + 1);
} else if (code == 0x1fd) {
code = -128 + get_bits(&s->gb, 7);
} else if (code == 0x1fe) {
@@ -277,7 +280,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
}
}
/* if multiple packets per frame are sent, the position at which
- to display the macroblocks is coded here */
+ * to display the macroblocks is coded here */
mb_xy = s->mb_x + s->mb_y * s->mb_width;
if (show_bits(&s->gb, 12) == 0 || (mb_xy && mb_xy < s->mb_num)) {
@@ -290,7 +293,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
mb_count = s->mb_width * s->mb_height;
}
skip_bits(&s->gb, 3); /* ignored */
- s->f_code = 1;
+ s->f_code = 1;
s->unrestricted_mv = 1;
return mb_count;
@@ -300,14 +303,22 @@ static int rv20_decode_picture_header(RVDecContext *rv)
{
MpegEncContext *s = &rv->m;
int seq, mb_pos, i, ret;
- int rpr_bits;
+ int rpr_max;
i = get_bits(&s->gb, 2);
- switch(i) {
- case 0: s->pict_type = AV_PICTURE_TYPE_I; break;
- case 1: s->pict_type = AV_PICTURE_TYPE_I; break; //hmm ...
- case 2: s->pict_type = AV_PICTURE_TYPE_P; break;
- case 3: s->pict_type = AV_PICTURE_TYPE_B; break;
+ switch (i) {
+ case 0:
+ s->pict_type = AV_PICTURE_TYPE_I;
+ break;
+ case 1:
+ s->pict_type = AV_PICTURE_TYPE_I;
+ break; // hmm ...
+ case 2:
+ s->pict_type = AV_PICTURE_TYPE_P;
+ break;
+ case 3:
+ s->pict_type = AV_PICTURE_TYPE_B;
+ break;
default:
av_log(s->avctx, AV_LOG_ERROR, "unknown frame type\n");
return AVERROR_INVALIDDATA;
@@ -341,10 +352,10 @@ static int rv20_decode_picture_header(RVDecContext *rv)
else
seq = get_bits(&s->gb, 13) << 2;
- rpr_bits = s->avctx->extradata[1] & 7;
- if (rpr_bits) {
+ rpr_max = s->avctx->extradata[1] & 7;
+ if (rpr_max) {
int f, new_w, new_h;
- rpr_bits = FFMIN((rpr_bits >> 1) + 1, 3);
+ int rpr_bits = av_log2(rpr_max) + 1;
f = get_bits(&s->gb, rpr_bits);
@@ -354,10 +365,10 @@ static int rv20_decode_picture_header(RVDecContext *rv)
return AVERROR_INVALIDDATA;
}
- new_w = 4 * ((uint8_t*)s->avctx->extradata)[6 + 2 * f];
- new_h = 4 * ((uint8_t*)s->avctx->extradata)[7 + 2 * f];
+ 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->orig_width ;
+ new_w = s->orig_width;
new_h = s->orig_height;
}
if (new_w != s->width || new_h != s->height) {
@@ -387,7 +398,7 @@ static int rv20_decode_picture_header(RVDecContext *rv)
}
if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
- av_log(s->avctx, AV_LOG_DEBUG, "F %d/%d\n", f, rpr_bits);
+ av_log(s->avctx, AV_LOG_DEBUG, "F %d/%d/%d\n", f, rpr_bits, rpr_max);
}
}
if (av_image_check_size(s->width, s->height, 0, s->avctx) < 0)
@@ -424,7 +435,8 @@ static int rv20_decode_picture_header(RVDecContext *rv)
s->no_rounding = get_bits1(&s->gb);
if (RV_GET_MINOR_VER(rv->sub_id) <= 1 && s->pict_type == AV_PICTURE_TYPE_B)
- skip_bits(&s->gb, 5); // binary decoder reads 3+2 bits here but they don't seem to be used
+ // binary decoder reads 3+2 bits here but they don't seem to be used
+ skip_bits(&s->gb, 5);
s->f_code = 1;
s->unrestricted_mv = 1;
@@ -434,18 +446,20 @@ static int rv20_decode_picture_header(RVDecContext *rv)
s->loop_filter = 1;
if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
- av_log(s->avctx, AV_LOG_INFO, "num:%5d x:%2d y:%2d type:%d qscale:%2d rnd:%d\n",
- seq, s->mb_x, s->mb_y, s->pict_type, s->qscale, s->no_rounding);
+ av_log(s->avctx, AV_LOG_INFO,
+ "num:%5d x:%2d y:%2d type:%d qscale:%2d rnd:%d\n",
+ seq, s->mb_x, s->mb_y, s->pict_type, s->qscale,
+ s->no_rounding);
}
av_assert0(s->pict_type != AV_PICTURE_TYPE_B || !s->low_delay);
- return s->mb_width*s->mb_height - mb_pos;
+ return s->mb_width * s->mb_height - mb_pos;
}
static av_cold int rv10_decode_init(AVCodecContext *avctx)
{
- RVDecContext *rv = avctx->priv_data;
+ RVDecContext *rv = avctx->priv_data;
MpegEncContext *s = &rv->m;
static int done = 0;
int major_ver, minor_ver, micro_ver, ret;
@@ -460,15 +474,17 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
ff_MPV_decode_defaults(s);
- s->avctx = avctx;
- s->out_format = FMT_H263;
- s->codec_id = avctx->codec_id;
+ s->avctx = avctx;
+ s->out_format = FMT_H263;
+ s->codec_id = avctx->codec_id;
- s->orig_width = s->width = avctx->coded_width;
- s->orig_height = 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;
- rv->sub_id = AV_RB32((uint8_t*)avctx->extradata + 4);
+ s->h263_long_vectors = ((uint8_t *) avctx->extradata)[3] & 1;
+ rv->sub_id = AV_RB32((uint8_t *) avctx->extradata + 4);
major_ver = RV_GET_MAJOR_VER(rv->sub_id);
minor_ver = RV_GET_MINOR_VER(rv->sub_id);
@@ -493,8 +509,8 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
}
if (avctx->debug & FF_DEBUG_PICT_INFO) {
- av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", rv->sub_id,
- ((uint32_t*)avctx->extradata)[0]);
+ av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%"PRIX32"\n", rv->sub_id,
+ ((uint32_t *) avctx->extradata)[0]);
}
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
@@ -527,10 +543,10 @@ static av_cold int rv10_decode_end(AVCodecContext *avctx)
return 0;
}
-static int rv10_decode_packet(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size, int buf_size2)
+static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf,
+ int buf_size, int buf_size2)
{
- RVDecContext *rv = avctx->priv_data;
+ RVDecContext *rv = avctx->priv_data;
MpegEncContext *s = &rv->m;
int mb_count, mb_pos, left, start_mb_x, active_bits_size, ret;
@@ -552,14 +568,15 @@ static int rv10_decode_packet(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
}
mb_pos = s->mb_y * s->mb_width + s->mb_x;
- left = s->mb_width * s->mb_height - mb_pos;
+ left = s->mb_width * s->mb_height - mb_pos;
if (mb_count > left) {
av_log(s->avctx, AV_LOG_ERROR, "COUNT ERROR\n");
return AVERROR_INVALIDDATA;
}
if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr == NULL) {
- if (s->current_picture_ptr) { // FIXME write parser so we always have complete frames?
+ // FIXME write parser so we always have complete frames?
+ if (s->current_picture_ptr) {
ff_er_frame_end(&s->er);
ff_MPV_frame_end(s);
s->mb_x = s->mb_y = s->resync_mb_x = s->resync_mb_y = 0;
@@ -568,7 +585,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
return ret;
ff_mpeg_er_frame_start(s);
} else {
- if (s->current_picture_ptr->f.pict_type != s->pict_type) {
+ if (s->current_picture_ptr->f->pict_type != s->pict_type) {
av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
return AVERROR_INVALIDDATA;
}
@@ -588,9 +605,11 @@ static int rv10_decode_packet(AVCodecContext *avctx,
start_mb_x = s->mb_x;
s->resync_mb_y = s->mb_y;
if (s->h263_aic) {
- s->y_dc_scale_table = s->c_dc_scale_table = ff_aic_dc_scale_table;
+ s->y_dc_scale_table =
+ s->c_dc_scale_table = ff_aic_dc_scale_table;
} else {
- s->y_dc_scale_table = s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
+ s->y_dc_scale_table =
+ s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
}
if (s->modified_quant)
@@ -639,7 +658,8 @@ static int rv10_decode_packet(AVCodecContext *avctx,
}
if (ret == SLICE_ERROR || active_bits_size < get_bits_count(&s->gb)) {
- av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y);
+ av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x,
+ s->mb_y);
return AVERROR_INVALIDDATA;
}
if (s->pict_type != AV_PICTURE_TYPE_B)
@@ -659,7 +679,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
break;
}
- ff_er_add_slice(&s->er, start_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y,
+ ff_er_add_slice(&s->er, start_mb_x, s->resync_mb_y, s->mb_x - 1, s->mb_y,
ER_MB_END);
return active_bits_size;
@@ -673,14 +693,13 @@ static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n)
return AV_RL32(buf + n * 8);
}
-static int rv10_decode_frame(AVCodecContext *avctx,
- void *data, int *got_frame,
+static int rv10_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
- MpegEncContext *s = avctx->priv_data;
- AVFrame *pict = data;
+ MpegEncContext *s = avctx->priv_data;
+ AVFrame *pict = data;
int i, ret;
int slice_count;
const uint8_t *slices_hdr = NULL;
@@ -699,7 +718,8 @@ static int rv10_decode_frame(AVCodecContext *avctx,
buf_size--;
if (!slice_count || buf_size <= 8 * slice_count) {
- av_log(avctx, AV_LOG_ERROR, "Invalid slice count: %d.\n", slice_count);
+ av_log(avctx, AV_LOG_ERROR, "Invalid slice count: %d.\n",
+ slice_count);
return AVERROR_INVALIDDATA;
}
@@ -730,7 +750,10 @@ static int rv10_decode_frame(AVCodecContext *avctx,
offset + FFMAX(size, size2) > buf_size)
return AVERROR_INVALIDDATA;
- if (rv10_decode_packet(avctx, buf + offset, size, size2) > 8 * size)
+ if ((ret = rv10_decode_packet(avctx, buf + offset, size, size2)) < 0)
+ return ret;
+
+ if (ret > 8 * size)
i++;
}
@@ -739,12 +762,12 @@ static int rv10_decode_frame(AVCodecContext *avctx,
ff_MPV_frame_end(s);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
return ret;
ff_print_debug_info(s, s->current_picture_ptr, pict);
ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_QSCALE_TYPE_MPEG1);
} else if (s->last_picture_ptr != NULL) {
- if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
return ret;
ff_print_debug_info(s, s->last_picture_ptr, pict);
ff_mpv_export_qp_table(s, pict,s->last_picture_ptr, FF_QSCALE_TYPE_MPEG1);
@@ -772,7 +795,10 @@ AVCodec ff_rv10_decoder = {
.decode = rv10_decode_frame,
.capabilities = CODEC_CAP_DR1,
.max_lowres = 3,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
AVCodec ff_rv20_decoder = {
@@ -787,5 +813,8 @@ AVCodec ff_rv20_decoder = {
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
.flush = ff_mpeg_flush,
.max_lowres = 3,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv30.c b/chromium/third_party/ffmpeg/libavcodec/rv30.c
index 7690da70cde..fd8fd4f9874 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv30.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv30.c
@@ -25,6 +25,7 @@
*/
#include "avcodec.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "golomb.h"
@@ -34,6 +35,7 @@
static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceInfo *si)
{
+ AVCodecContext *avctx = r->s.avctx;
int mb_bits;
int w = r->s.width, h = r->s.height;
int mb_size;
@@ -49,13 +51,20 @@ static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceIn
si->quant = get_bits(gb, 5);
skip_bits1(gb);
si->pts = get_bits(gb, 13);
- rpr = get_bits(gb, r->rpr);
- if (r->s.avctx->extradata_size < 8 + rpr*2) {
- av_log(r->s.avctx, AV_LOG_WARNING,
- "Extradata does not contain selected resolution\n");
- rpr = 0;
- }
+ rpr = get_bits(gb, av_log2(r->max_rpr) + 1);
if(rpr){
+ if (rpr > r->max_rpr) {
+ av_log(avctx, AV_LOG_ERROR, "rpr too large\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (avctx->extradata_size < rpr * 2 + 8) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Insufficient extradata - need at least %d bytes, got %d\n",
+ 8 + rpr * 2, avctx->extradata_size);
+ return AVERROR(EINVAL);
+ }
+
w = r->s.avctx->extradata[6 + rpr*2] << 2;
h = r->s.avctx->extradata[7 + rpr*2] << 2;
}
@@ -124,7 +133,7 @@ static int rv30_decode_mb_info(RV34DecContext *r)
static inline void rv30_weak_loop_filter(uint8_t *src, const int step,
const int stride, const int lim)
{
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
int i, diff;
for(i = 0; i < 4; i++){
@@ -162,7 +171,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row)
if(mb_x)
left_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos - 1]];
for(j = 0; j < 16; j += 4){
- Y = s->current_picture_ptr->f.data[0] + mb_x*16 + (row*16 + j) * s->linesize + 4 * !mb_x;
+ Y = s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize + 4 * !mb_x;
for(i = !mb_x; i < 4; i++, Y += 4){
int ij = i + j;
loc_lim = 0;
@@ -182,7 +191,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row)
if(mb_x)
left_cbp = (r->cbp_chroma[mb_pos - 1] >> (k*4)) & 0xF;
for(j = 0; j < 8; j += 4){
- C = s->current_picture_ptr->f.data[k + 1] + mb_x*8 + (row*8 + j) * s->uvlinesize + 4 * !mb_x;
+ C = s->current_picture_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j) * s->uvlinesize + 4 * !mb_x;
for(i = !mb_x; i < 2; i++, C += 4){
int ij = i + (j >> 1);
loc_lim = 0;
@@ -204,7 +213,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row)
if(row)
top_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos - s->mb_stride]];
for(j = 4*!row; j < 16; j += 4){
- Y = s->current_picture_ptr->f.data[0] + mb_x*16 + (row*16 + j) * s->linesize;
+ Y = s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize;
for(i = 0; i < 4; i++, Y += 4){
int ij = i + j;
loc_lim = 0;
@@ -224,7 +233,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row)
if(row)
top_cbp = (r->cbp_chroma[mb_pos - s->mb_stride] >> (k*4)) & 0xF;
for(j = 4*!row; j < 8; j += 4){
- C = s->current_picture_ptr->f.data[k+1] + mb_x*8 + (row*8 + j) * s->uvlinesize;
+ C = s->current_picture_ptr->f->data[k+1] + mb_x*8 + (row*8 + j) * s->uvlinesize;
for(i = 0; i < 2; i++, C += 4){
int ij = i + (j >> 1);
loc_lim = 0;
@@ -257,12 +266,13 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
return -1;
}
- r->rpr = (avctx->extradata[1] & 7) >> 1;
- r->rpr = FFMIN(r->rpr + 1, 3);
- if(avctx->extradata_size - 8 < (r->rpr - 1) * 2){
- av_log(avctx, AV_LOG_ERROR, "Insufficient extradata - need at least %d bytes, got %d\n",
- 6 + r->rpr * 2, avctx->extradata_size);
+
+ r->max_rpr = avctx->extradata[1] & 7;
+ if(avctx->extradata_size < 2*r->max_rpr + 8){
+ av_log(avctx, AV_LOG_WARNING, "Insufficient extradata - need at least %d bytes, got %d\n",
+ 2*r->max_rpr + 8, avctx->extradata_size);
}
+
r->parse_slice_header = rv30_parse_slice_header;
r->decode_intra_types = rv30_decode_intra_types;
r->decode_mb_info = rv30_decode_mb_info;
@@ -284,7 +294,10 @@ AVCodec ff_rv30_decoder = {
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
CODEC_CAP_FRAME_THREADS,
.flush = ff_mpeg_flush,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
.init_thread_copy = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_update_thread_context),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv30data.h b/chromium/third_party/ffmpeg/libavcodec/rv30data.h
index 9cc48a6a31f..5c4cb9710b9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv30data.h
+++ b/chromium/third_party/ffmpeg/libavcodec/rv30data.h
@@ -58,7 +58,7 @@ static const uint8_t rv30_itype_code[9*9*2] = {
*
* This is really a three-dimensional matrix with dimensions
* [-1..9][-1..9][0..9]. The first and second coordinates are
- * detemined by the top and left neighbors (-1 if unavailable).
+ * determined by the top and left neighbors (-1 if unavailable).
*/
static const uint8_t rv30_itype_from_context[900] = {
0, 9, 9, 9, 9, 9, 9, 9, 9,
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv30dsp.c b/chromium/third_party/ffmpeg/libavcodec/rv30dsp.c
index 5e47b647cb6..bd084bff7a5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv30dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv30dsp.c
@@ -27,12 +27,13 @@
#include "avcodec.h"
#include "h264chroma.h"
#include "h264qpel.h"
+#include "mathops.h"
#include "rv34dsp.h"
#define RV30_LOWPASS(OPNAME, OP) \
static av_unused void OPNAME ## rv30_tpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, const int C1, const int C2){\
const int h = 8;\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i;\
for(i = 0; i < h; i++)\
{\
@@ -51,7 +52,7 @@ static av_unused void OPNAME ## rv30_tpel8_h_lowpass(uint8_t *dst, uint8_t *src,
\
static void OPNAME ## rv30_tpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, const int C1, const int C2){\
const int w = 8;\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i;\
for(i = 0; i < w; i++)\
{\
@@ -82,7 +83,7 @@ static void OPNAME ## rv30_tpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstSt
static void OPNAME ## rv30_tpel8_hv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
const int w = 8;\
const int h = 8;\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i, j;\
for(j = 0; j < h; j++){\
for(i = 0; i < w; i++){\
@@ -101,7 +102,7 @@ static void OPNAME ## rv30_tpel8_hv_lowpass(uint8_t *dst, uint8_t *src, int dstS
static void OPNAME ## rv30_tpel8_hhv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
const int w = 8;\
const int h = 8;\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i, j;\
for(j = 0; j < h; j++){\
for(i = 0; i < w; i++){\
@@ -120,7 +121,7 @@ static void OPNAME ## rv30_tpel8_hhv_lowpass(uint8_t *dst, uint8_t *src, int dst
static void OPNAME ## rv30_tpel8_hvv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
const int w = 8;\
const int h = 8;\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i, j;\
for(j = 0; j < h; j++){\
for(i = 0; i < w; i++){\
@@ -139,7 +140,7 @@ static void OPNAME ## rv30_tpel8_hvv_lowpass(uint8_t *dst, uint8_t *src, int dst
static void OPNAME ## rv30_tpel8_hhvv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
const int w = 8;\
const int h = 8;\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i, j;\
for(j = 0; j < h; j++){\
for(i = 0; i < w; i++){\
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv34.c b/chromium/third_party/ffmpeg/libavcodec/rv34.c
index 1aee59ce73a..4bae2c4112e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv34.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv34.c
@@ -29,6 +29,7 @@
#include "avcodec.h"
#include "error_resilience.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "golomb.h"
#include "internal.h"
@@ -708,9 +709,9 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type,
}
dxy = ly*4 + lx;
- srcY = dir ? s->next_picture_ptr->f.data[0] : s->last_picture_ptr->f.data[0];
- srcU = dir ? s->next_picture_ptr->f.data[1] : s->last_picture_ptr->f.data[1];
- srcV = dir ? s->next_picture_ptr->f.data[2] : s->last_picture_ptr->f.data[2];
+ srcY = dir ? s->next_picture_ptr->f->data[0] : s->last_picture_ptr->f->data[0];
+ srcU = dir ? s->next_picture_ptr->f->data[1] : s->last_picture_ptr->f->data[1];
+ srcV = dir ? s->next_picture_ptr->f->data[2] : s->last_picture_ptr->f->data[2];
src_x = s->mb_x * 16 + xoff + mx;
src_y = s->mb_y * 16 + yoff + my;
uvsrc_x = s->mb_x * 8 + (xoff >> 1) + umx;
@@ -1362,11 +1363,11 @@ static int rv34_decoder_alloc(RV34DecContext *r)
{
r->intra_types_stride = r->s.mb_width * 4 + 4;
- r->cbp_chroma = av_malloc(r->s.mb_stride * r->s.mb_height *
+ r->cbp_chroma = av_mallocz(r->s.mb_stride * r->s.mb_height *
sizeof(*r->cbp_chroma));
- r->cbp_luma = av_malloc(r->s.mb_stride * r->s.mb_height *
+ r->cbp_luma = av_mallocz(r->s.mb_stride * r->s.mb_height *
sizeof(*r->cbp_luma));
- r->deblock_coefs = av_malloc(r->s.mb_stride * r->s.mb_height *
+ r->deblock_coefs = av_mallocz(r->s.mb_stride * r->s.mb_height *
sizeof(*r->deblock_coefs));
r->intra_types_hist = av_malloc(r->intra_types_stride * 4 * 2 *
sizeof(*r->intra_types_hist));
@@ -1489,8 +1490,6 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
s->height = avctx->height;
r->s.avctx = avctx;
- avctx->flags |= CODEC_FLAG_EMU_EDGE;
- r->s.flags |= CODEC_FLAG_EMU_EDGE;
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
avctx->has_b_frames = 1;
s->low_delay = 0;
@@ -1592,13 +1591,13 @@ static int finish_frame(AVCodecContext *avctx, AVFrame *pict)
ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
return ret;
ff_print_debug_info(s, s->current_picture_ptr, pict);
ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_QSCALE_TYPE_MPEG1);
got_picture = 1;
} else if (s->last_picture_ptr != NULL) {
- if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
return ret;
ff_print_debug_info(s, s->last_picture_ptr, pict);
ff_mpv_export_qp_table(s, pict, s->last_picture_ptr, FF_QSCALE_TYPE_MPEG1);
@@ -1637,7 +1636,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
if (buf_size == 0) {
/* special case for last picture */
if (s->low_delay==0 && s->next_picture_ptr) {
- if ((ret = av_frame_ref(pict, &s->next_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0)
return ret;
s->next_picture_ptr = NULL;
@@ -1665,7 +1664,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n");
return AVERROR_INVALIDDATA;
}
- if ((!s->last_picture_ptr || !s->last_picture_ptr->f.data[0]) &&
+ if ((!s->last_picture_ptr || !s->last_picture_ptr->f->data[0]) &&
si.type == AV_PICTURE_TYPE_B) {
av_log(avctx, AV_LOG_ERROR, "Invalid decoder state: B-frame without "
"reference data.\n");
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv34.h b/chromium/third_party/ffmpeg/libavcodec/rv34.h
index 475f17a496e..870164c6e5d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv34.h
+++ b/chromium/third_party/ffmpeg/libavcodec/rv34.h
@@ -102,7 +102,7 @@ typedef struct RV34DecContext{
int dmv[4][2]; ///< differential motion vectors for the current macroblock
int rv30; ///< indicates which RV variasnt is currently decoded
- int rpr; ///< one field size in RV30 slice header
+ int max_rpr;
int cur_pts, last_pts, next_pts;
int scaled_weight;
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv34dsp.h b/chromium/third_party/ffmpeg/libavcodec/rv34dsp.h
index 7e28b26147e..75f9ff8e669 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv34dsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/rv34dsp.h
@@ -81,6 +81,7 @@ void ff_rv40dsp_init(RV34DSPContext *c);
void ff_rv34dsp_init_arm(RV34DSPContext *c);
void ff_rv34dsp_init_x86(RV34DSPContext *c);
+void ff_rv40dsp_init_aarch64(RV34DSPContext *c);
void ff_rv40dsp_init_x86(RV34DSPContext *c);
void ff_rv40dsp_init_arm(RV34DSPContext *c);
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv40.c b/chromium/third_party/ffmpeg/libavcodec/rv40.c
index 17a2f917286..043fd724a9e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv40.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv40.c
@@ -27,6 +27,7 @@
#include "libavutil/imgutils.h"
#include "avcodec.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "golomb.h"
@@ -455,7 +456,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row)
}
for(j = 0; j < 16; j += 4){
- Y = s->current_picture_ptr->f.data[0] + mb_x*16 + (row*16 + j) * s->linesize;
+ Y = s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize;
for(i = 0; i < 4; i++, Y += 4){
int ij = i + j;
int clip_cur = y_to_deblock & (MASK_CUR << ij) ? clip[POS_CUR] : 0;
@@ -500,7 +501,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row)
}
for(k = 0; k < 2; k++){
for(j = 0; j < 2; j++){
- C = s->current_picture_ptr->f.data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize;
+ C = s->current_picture_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize;
for(i = 0; i < 2; i++, C += 4){
int ij = i + j*2;
int clip_cur = c_to_deblock[k] & (MASK_CUR << ij) ? clip[POS_CUR] : 0;
@@ -575,7 +576,10 @@ AVCodec ff_rv40_decoder = {
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
CODEC_CAP_FRAME_THREADS,
.flush = ff_mpeg_flush,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
.init_thread_copy = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_update_thread_context),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv40dsp.c b/chromium/third_party/ffmpeg/libavcodec/rv40dsp.c
index bdd9a3e3e69..7df554962f6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv40dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv40dsp.c
@@ -24,16 +24,20 @@
* RV40 decoder motion compensation functions
*/
+#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "h264qpel.h"
+#include "mathops.h"
+#include "pixels.h"
+#include "rnd_avg.h"
#include "rv34dsp.h"
#include "libavutil/avassert.h"
-#include "libavutil/common.h"
#define RV40_LOWPASS(OPNAME, OP) \
static av_unused void OPNAME ## rv40_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,\
const int h, const int C1, const int C2, const int SHIFT){\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i;\
for(i = 0; i < h; i++)\
{\
@@ -52,7 +56,7 @@ static av_unused void OPNAME ## rv40_qpel8_h_lowpass(uint8_t *dst, uint8_t *src,
\
static void OPNAME ## rv40_qpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,\
const int w, const int C1, const int C2, const int SHIFT){\
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
int i;\
for(i = 0; i < w; i++)\
{\
@@ -203,6 +207,83 @@ RV40_MC(put_, 16)
RV40_MC(avg_, 8)
RV40_MC(avg_, 16)
+#define PIXOP2(OPNAME, OP) \
+static inline void OPNAME ## _pixels8_xy2_8_c(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ /* FIXME HIGH BIT DEPTH */ \
+ int j; \
+ \
+ for (j = 0; j < 2; j++) { \
+ int i; \
+ const uint32_t a = AV_RN32(pixels); \
+ const uint32_t b = AV_RN32(pixels + 1); \
+ uint32_t l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x02020202UL; \
+ uint32_t h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ uint32_t l1, h1; \
+ \
+ pixels += line_size; \
+ for (i = 0; i < h; i += 2) { \
+ uint32_t a = AV_RN32(pixels); \
+ uint32_t b = AV_RN32(pixels + 1); \
+ l1 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL); \
+ h1 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) block), \
+ h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ pixels += line_size; \
+ block += line_size; \
+ a = AV_RN32(pixels); \
+ b = AV_RN32(pixels + 1); \
+ l0 = (a & 0x03030303UL) + \
+ (b & 0x03030303UL) + \
+ 0x02020202UL; \
+ h0 = ((a & 0xFCFCFCFCUL) >> 2) + \
+ ((b & 0xFCFCFCFCUL) >> 2); \
+ OP(*((uint32_t *) block), \
+ h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL)); \
+ pixels += line_size; \
+ block += line_size; \
+ } \
+ pixels += 4 - line_size * (h + 1); \
+ block += 4 - line_size * h; \
+ } \
+} \
+ \
+CALL_2X_PIXELS(OPNAME ## _pixels16_xy2_8_c, \
+ OPNAME ## _pixels8_xy2_8_c, \
+ 8) \
+
+#define op_avg(a, b) a = rnd_avg32(a, b)
+#define op_put(a, b) a = b
+PIXOP2(avg, op_avg)
+PIXOP2(put, op_put)
+#undef op_avg
+#undef op_put
+
+static void put_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
+{
+ put_pixels16_xy2_8_c(dst, src, stride, 16);
+}
+static void avg_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
+{
+ avg_pixels16_xy2_8_c(dst, src, stride, 16);
+}
+static void put_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
+{
+ put_pixels8_xy2_8_c(dst, src, stride, 8);
+}
+static void avg_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
+{
+ avg_pixels8_xy2_8_c(dst, src, stride, 8);
+}
+
static const int rv40_bias[4][4] = {
{ 0, 16, 32, 16 },
{ 32, 28, 32, 28 },
@@ -351,7 +432,7 @@ static av_always_inline void rv40_weak_loop_filter(uint8_t *src,
const int lim_q1,
const int lim_p1)
{
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
int i, t, u, diff;
for (i = 0; i < 4; i++, src += stride) {
@@ -552,7 +633,7 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c)
c->put_pixels_tab[0][12] = put_rv40_qpel16_mc03_c;
c->put_pixels_tab[0][13] = put_rv40_qpel16_mc13_c;
c->put_pixels_tab[0][14] = put_rv40_qpel16_mc23_c;
- c->put_pixels_tab[0][15] = ff_put_rv40_qpel16_mc33_c;
+ c->put_pixels_tab[0][15] = put_rv40_qpel16_mc33_c;
c->avg_pixels_tab[0][ 0] = qpel.avg_h264_qpel_pixels_tab[0][0];
c->avg_pixels_tab[0][ 1] = avg_rv40_qpel16_mc10_c;
c->avg_pixels_tab[0][ 2] = qpel.avg_h264_qpel_pixels_tab[0][2];
@@ -568,7 +649,7 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c)
c->avg_pixels_tab[0][12] = avg_rv40_qpel16_mc03_c;
c->avg_pixels_tab[0][13] = avg_rv40_qpel16_mc13_c;
c->avg_pixels_tab[0][14] = avg_rv40_qpel16_mc23_c;
- c->avg_pixels_tab[0][15] = ff_avg_rv40_qpel16_mc33_c;
+ c->avg_pixels_tab[0][15] = avg_rv40_qpel16_mc33_c;
c->put_pixels_tab[1][ 0] = qpel.put_h264_qpel_pixels_tab[1][0];
c->put_pixels_tab[1][ 1] = put_rv40_qpel8_mc10_c;
c->put_pixels_tab[1][ 2] = qpel.put_h264_qpel_pixels_tab[1][2];
@@ -584,7 +665,7 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c)
c->put_pixels_tab[1][12] = put_rv40_qpel8_mc03_c;
c->put_pixels_tab[1][13] = put_rv40_qpel8_mc13_c;
c->put_pixels_tab[1][14] = put_rv40_qpel8_mc23_c;
- c->put_pixels_tab[1][15] = ff_put_rv40_qpel8_mc33_c;
+ c->put_pixels_tab[1][15] = put_rv40_qpel8_mc33_c;
c->avg_pixels_tab[1][ 0] = qpel.avg_h264_qpel_pixels_tab[1][0];
c->avg_pixels_tab[1][ 1] = avg_rv40_qpel8_mc10_c;
c->avg_pixels_tab[1][ 2] = qpel.avg_h264_qpel_pixels_tab[1][2];
@@ -600,7 +681,7 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c)
c->avg_pixels_tab[1][12] = avg_rv40_qpel8_mc03_c;
c->avg_pixels_tab[1][13] = avg_rv40_qpel8_mc13_c;
c->avg_pixels_tab[1][14] = avg_rv40_qpel8_mc23_c;
- c->avg_pixels_tab[1][15] = ff_avg_rv40_qpel8_mc33_c;
+ c->avg_pixels_tab[1][15] = avg_rv40_qpel8_mc33_c;
c->put_chroma_pixels_tab[0] = put_rv40_chroma_mc8_c;
c->put_chroma_pixels_tab[1] = put_rv40_chroma_mc4_c;
@@ -619,6 +700,8 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c)
c->rv40_loop_filter_strength[0] = rv40_h_loop_filter_strength;
c->rv40_loop_filter_strength[1] = rv40_v_loop_filter_strength;
+ if (ARCH_AARCH64)
+ ff_rv40dsp_init_aarch64(c);
if (ARCH_ARM)
ff_rv40dsp_init_arm(c);
if (ARCH_X86)
diff --git a/chromium/third_party/ffmpeg/libavcodec/s302menc.c b/chromium/third_party/ffmpeg/libavcodec/s302menc.c
index a7e5b1d26b8..540ac29dab0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/s302menc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/s302menc.c
@@ -22,6 +22,7 @@
#include "avcodec.h"
#include "internal.h"
+#include "mathops.h"
#include "put_bits.h"
#define AES3_HEADER_LEN 4
diff --git a/chromium/third_party/ffmpeg/libavcodec/sanm.c b/chromium/third_party/ffmpeg/libavcodec/sanm.c
index a6c1c01e5c8..880ef8fa223 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sanm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sanm.c
@@ -20,26 +20,253 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-// #define DEBUG 1
+#include "libavutil/avassert.h"
+#include "libavutil/bswap.h"
+#include "libavutil/imgutils.h"
#include "avcodec.h"
-#include "copy_block.h"
#include "bytestream.h"
+#include "copy_block.h"
#include "internal.h"
-#include "libavutil/bswap.h"
-#include "libavutil/imgutils.h"
-#include "sanm_data.h"
-#include "libavutil/avassert.h"
#define NGLYPHS 256
+#define GLYPH_COORD_VECT_SIZE 16
+#define PALETTE_SIZE 256
+#define PALETTE_DELTA 768
+
+static const int8_t glyph4_x[GLYPH_COORD_VECT_SIZE] = {
+ 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, 0, 0, 1, 2, 2, 1
+};
+
+static const int8_t glyph4_y[GLYPH_COORD_VECT_SIZE] = {
+ 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 2, 1, 1, 1, 2, 2
+};
+
+static const int8_t glyph8_x[GLYPH_COORD_VECT_SIZE] = {
+ 0, 2, 5, 7, 7, 7, 7, 7, 7, 5, 2, 0, 0, 0, 0, 0
+};
-typedef struct {
+static const int8_t glyph8_y[GLYPH_COORD_VECT_SIZE] = {
+ 0, 0, 0, 0, 1, 3, 4, 6, 7, 7, 7, 7, 6, 4, 3, 1
+};
+
+static const int8_t motion_vectors[256][2] = {
+ { 0, 0 }, { -1, -43 }, { 6, -43 }, { -9, -42 }, { 13, -41 },
+ { -16, -40 }, { 19, -39 }, { -23, -36 }, { 26, -34 }, { -2, -33 },
+ { 4, -33 }, { -29, -32 }, { -9, -32 }, { 11, -31 }, { -16, -29 },
+ { 32, -29 }, { 18, -28 }, { -34, -26 }, { -22, -25 }, { -1, -25 },
+ { 3, -25 }, { -7, -24 }, { 8, -24 }, { 24, -23 }, { 36, -23 },
+ { -12, -22 }, { 13, -21 }, { -38, -20 }, { 0, -20 }, { -27, -19 },
+ { -4, -19 }, { 4, -19 }, { -17, -18 }, { -8, -17 }, { 8, -17 },
+ { 18, -17 }, { 28, -17 }, { 39, -17 }, { -12, -15 }, { 12, -15 },
+ { -21, -14 }, { -1, -14 }, { 1, -14 }, { -41, -13 }, { -5, -13 },
+ { 5, -13 }, { 21, -13 }, { -31, -12 }, { -15, -11 }, { -8, -11 },
+ { 8, -11 }, { 15, -11 }, { -2, -10 }, { 1, -10 }, { 31, -10 },
+ { -23, -9 }, { -11, -9 }, { -5, -9 }, { 4, -9 }, { 11, -9 },
+ { 42, -9 }, { 6, -8 }, { 24, -8 }, { -18, -7 }, { -7, -7 },
+ { -3, -7 }, { -1, -7 }, { 2, -7 }, { 18, -7 }, { -43, -6 },
+ { -13, -6 }, { -4, -6 }, { 4, -6 }, { 8, -6 }, { -33, -5 },
+ { -9, -5 }, { -2, -5 }, { 0, -5 }, { 2, -5 }, { 5, -5 },
+ { 13, -5 }, { -25, -4 }, { -6, -4 }, { -3, -4 }, { 3, -4 },
+ { 9, -4 }, { -19, -3 }, { -7, -3 }, { -4, -3 }, { -2, -3 },
+ { -1, -3 }, { 0, -3 }, { 1, -3 }, { 2, -3 }, { 4, -3 },
+ { 6, -3 }, { 33, -3 }, { -14, -2 }, { -10, -2 }, { -5, -2 },
+ { -3, -2 }, { -2, -2 }, { -1, -2 }, { 0, -2 }, { 1, -2 },
+ { 2, -2 }, { 3, -2 }, { 5, -2 }, { 7, -2 }, { 14, -2 },
+ { 19, -2 }, { 25, -2 }, { 43, -2 }, { -7, -1 }, { -3, -1 },
+ { -2, -1 }, { -1, -1 }, { 0, -1 }, { 1, -1 }, { 2, -1 },
+ { 3, -1 }, { 10, -1 }, { -5, 0 }, { -3, 0 }, { -2, 0 },
+ { -1, 0 }, { 1, 0 }, { 2, 0 }, { 3, 0 }, { 5, 0 },
+ { 7, 0 }, { -10, 1 }, { -7, 1 }, { -3, 1 }, { -2, 1 },
+ { -1, 1 }, { 0, 1 }, { 1, 1 }, { 2, 1 }, { 3, 1 },
+ { -43, 2 }, { -25, 2 }, { -19, 2 }, { -14, 2 }, { -5, 2 },
+ { -3, 2 }, { -2, 2 }, { -1, 2 }, { 0, 2 }, { 1, 2 },
+ { 2, 2 }, { 3, 2 }, { 5, 2 }, { 7, 2 }, { 10, 2 },
+ { 14, 2 }, { -33, 3 }, { -6, 3 }, { -4, 3 }, { -2, 3 },
+ { -1, 3 }, { 0, 3 }, { 1, 3 }, { 2, 3 }, { 4, 3 },
+ { 19, 3 }, { -9, 4 }, { -3, 4 }, { 3, 4 }, { 7, 4 },
+ { 25, 4 }, { -13, 5 }, { -5, 5 }, { -2, 5 }, { 0, 5 },
+ { 2, 5 }, { 5, 5 }, { 9, 5 }, { 33, 5 }, { -8, 6 },
+ { -4, 6 }, { 4, 6 }, { 13, 6 }, { 43, 6 }, { -18, 7 },
+ { -2, 7 }, { 0, 7 }, { 2, 7 }, { 7, 7 }, { 18, 7 },
+ { -24, 8 }, { -6, 8 }, { -42, 9 }, { -11, 9 }, { -4, 9 },
+ { 5, 9 }, { 11, 9 }, { 23, 9 }, { -31, 10 }, { -1, 10 },
+ { 2, 10 }, { -15, 11 }, { -8, 11 }, { 8, 11 }, { 15, 11 },
+ { 31, 12 }, { -21, 13 }, { -5, 13 }, { 5, 13 }, { 41, 13 },
+ { -1, 14 }, { 1, 14 }, { 21, 14 }, { -12, 15 }, { 12, 15 },
+ { -39, 17 }, { -28, 17 }, { -18, 17 }, { -8, 17 }, { 8, 17 },
+ { 17, 18 }, { -4, 19 }, { 0, 19 }, { 4, 19 }, { 27, 19 },
+ { 38, 20 }, { -13, 21 }, { 12, 22 }, { -36, 23 }, { -24, 23 },
+ { -8, 24 }, { 7, 24 }, { -3, 25 }, { 1, 25 }, { 22, 25 },
+ { 34, 26 }, { -18, 28 }, { -32, 29 }, { 16, 29 }, { -11, 31 },
+ { 9, 32 }, { 29, 32 }, { -4, 33 }, { 2, 33 }, { -26, 34 },
+ { 23, 36 }, { -19, 39 }, { 16, 40 }, { -13, 41 }, { 9, 42 },
+ { -6, 43 }, { 1, 43 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
+};
+
+static const int8_t c37_mv[] = {
+ 0, 0, 1, 0, 2, 0, 3, 0, 5, 0,
+ 8, 0, 13, 0, 21, 0, -1, 0, -2, 0,
+ -3, 0, -5, 0, -8, 0, -13, 0, -17, 0,
+ -21, 0, 0, 1, 1, 1, 2, 1, 3, 1,
+ 5, 1, 8, 1, 13, 1, 21, 1, -1, 1,
+ -2, 1, -3, 1, -5, 1, -8, 1, -13, 1,
+ -17, 1, -21, 1, 0, 2, 1, 2, 2, 2,
+ 3, 2, 5, 2, 8, 2, 13, 2, 21, 2,
+ -1, 2, -2, 2, -3, 2, -5, 2, -8, 2,
+ -13, 2, -17, 2, -21, 2, 0, 3, 1, 3,
+ 2, 3, 3, 3, 5, 3, 8, 3, 13, 3,
+ 21, 3, -1, 3, -2, 3, -3, 3, -5, 3,
+ -8, 3, -13, 3, -17, 3, -21, 3, 0, 5,
+ 1, 5, 2, 5, 3, 5, 5, 5, 8, 5,
+ 13, 5, 21, 5, -1, 5, -2, 5, -3, 5,
+ -5, 5, -8, 5, -13, 5, -17, 5, -21, 5,
+ 0, 8, 1, 8, 2, 8, 3, 8, 5, 8,
+ 8, 8, 13, 8, 21, 8, -1, 8, -2, 8,
+ -3, 8, -5, 8, -8, 8, -13, 8, -17, 8,
+ -21, 8, 0, 13, 1, 13, 2, 13, 3, 13,
+ 5, 13, 8, 13, 13, 13, 21, 13, -1, 13,
+ -2, 13, -3, 13, -5, 13, -8, 13, -13, 13,
+ -17, 13, -21, 13, 0, 21, 1, 21, 2, 21,
+ 3, 21, 5, 21, 8, 21, 13, 21, 21, 21,
+ -1, 21, -2, 21, -3, 21, -5, 21, -8, 21,
+ -13, 21, -17, 21, -21, 21, 0, -1, 1, -1,
+ 2, -1, 3, -1, 5, -1, 8, -1, 13, -1,
+ 21, -1, -1, -1, -2, -1, -3, -1, -5, -1,
+ -8, -1, -13, -1, -17, -1, -21, -1, 0, -2,
+ 1, -2, 2, -2, 3, -2, 5, -2, 8, -2,
+ 13, -2, 21, -2, -1, -2, -2, -2, -3, -2,
+ -5, -2, -8, -2, -13, -2, -17, -2, -21, -2,
+ 0, -3, 1, -3, 2, -3, 3, -3, 5, -3,
+ 8, -3, 13, -3, 21, -3, -1, -3, -2, -3,
+ -3, -3, -5, -3, -8, -3, -13, -3, -17, -3,
+ -21, -3, 0, -5, 1, -5, 2, -5, 3, -5,
+ 5, -5, 8, -5, 13, -5, 21, -5, -1, -5,
+ -2, -5, -3, -5, -5, -5, -8, -5, -13, -5,
+ -17, -5, -21, -5, 0, -8, 1, -8, 2, -8,
+ 3, -8, 5, -8, 8, -8, 13, -8, 21, -8,
+ -1, -8, -2, -8, -3, -8, -5, -8, -8, -8,
+ -13, -8, -17, -8, -21, -8, 0, -13, 1, -13,
+ 2, -13, 3, -13, 5, -13, 8, -13, 13, -13,
+ 21, -13, -1, -13, -2, -13, -3, -13, -5, -13,
+ -8, -13, -13, -13, -17, -13, -21, -13, 0, -17,
+ 1, -17, 2, -17, 3, -17, 5, -17, 8, -17,
+ 13, -17, 21, -17, -1, -17, -2, -17, -3, -17,
+ -5, -17, -8, -17, -13, -17, -17, -17, -21, -17,
+ 0, -21, 1, -21, 2, -21, 3, -21, 5, -21,
+ 8, -21, 13, -21, 21, -21, -1, -21, -2, -21,
+ -3, -21, -5, -21, -8, -21, -13, -21, -17, -21,
+ 0, 0, -8, -29, 8, -29, -18, -25, 17, -25,
+ 0, -23, -6, -22, 6, -22, -13, -19, 12, -19,
+ 0, -18, 25, -18, -25, -17, -5, -17, 5, -17,
+ -10, -15, 10, -15, 0, -14, -4, -13, 4, -13,
+ 19, -13, -19, -12, -8, -11, -2, -11, 0, -11,
+ 2, -11, 8, -11, -15, -10, -4, -10, 4, -10,
+ 15, -10, -6, -9, -1, -9, 1, -9, 6, -9,
+ -29, -8, -11, -8, -8, -8, -3, -8, 3, -8,
+ 8, -8, 11, -8, 29, -8, -5, -7, -2, -7,
+ 0, -7, 2, -7, 5, -7, -22, -6, -9, -6,
+ -6, -6, -3, -6, -1, -6, 1, -6, 3, -6,
+ 6, -6, 9, -6, 22, -6, -17, -5, -7, -5,
+ -4, -5, -2, -5, 0, -5, 2, -5, 4, -5,
+ 7, -5, 17, -5, -13, -4, -10, -4, -5, -4,
+ -3, -4, -1, -4, 0, -4, 1, -4, 3, -4,
+ 5, -4, 10, -4, 13, -4, -8, -3, -6, -3,
+ -4, -3, -3, -3, -2, -3, -1, -3, 0, -3,
+ 1, -3, 2, -3, 4, -3, 6, -3, 8, -3,
+ -11, -2, -7, -2, -5, -2, -3, -2, -2, -2,
+ -1, -2, 0, -2, 1, -2, 2, -2, 3, -2,
+ 5, -2, 7, -2, 11, -2, -9, -1, -6, -1,
+ -4, -1, -3, -1, -2, -1, -1, -1, 0, -1,
+ 1, -1, 2, -1, 3, -1, 4, -1, 6, -1,
+ 9, -1, -31, 0, -23, 0, -18, 0, -14, 0,
+ -11, 0, -7, 0, -5, 0, -4, 0, -3, 0,
+ -2, 0, -1, 0, 0, -31, 1, 0, 2, 0,
+ 3, 0, 4, 0, 5, 0, 7, 0, 11, 0,
+ 14, 0, 18, 0, 23, 0, 31, 0, -9, 1,
+ -6, 1, -4, 1, -3, 1, -2, 1, -1, 1,
+ 0, 1, 1, 1, 2, 1, 3, 1, 4, 1,
+ 6, 1, 9, 1, -11, 2, -7, 2, -5, 2,
+ -3, 2, -2, 2, -1, 2, 0, 2, 1, 2,
+ 2, 2, 3, 2, 5, 2, 7, 2, 11, 2,
+ -8, 3, -6, 3, -4, 3, -2, 3, -1, 3,
+ 0, 3, 1, 3, 2, 3, 3, 3, 4, 3,
+ 6, 3, 8, 3, -13, 4, -10, 4, -5, 4,
+ -3, 4, -1, 4, 0, 4, 1, 4, 3, 4,
+ 5, 4, 10, 4, 13, 4, -17, 5, -7, 5,
+ -4, 5, -2, 5, 0, 5, 2, 5, 4, 5,
+ 7, 5, 17, 5, -22, 6, -9, 6, -6, 6,
+ -3, 6, -1, 6, 1, 6, 3, 6, 6, 6,
+ 9, 6, 22, 6, -5, 7, -2, 7, 0, 7,
+ 2, 7, 5, 7, -29, 8, -11, 8, -8, 8,
+ -3, 8, 3, 8, 8, 8, 11, 8, 29, 8,
+ -6, 9, -1, 9, 1, 9, 6, 9, -15, 10,
+ -4, 10, 4, 10, 15, 10, -8, 11, -2, 11,
+ 0, 11, 2, 11, 8, 11, 19, 12, -19, 13,
+ -4, 13, 4, 13, 0, 14, -10, 15, 10, 15,
+ -5, 17, 5, 17, 25, 17, -25, 18, 0, 18,
+ -12, 19, 13, 19, -6, 22, 6, 22, 0, 23,
+ -17, 25, 18, 25, -8, 29, 8, 29, 0, 31,
+ 0, 0, -6, -22, 6, -22, -13, -19, 12, -19,
+ 0, -18, -5, -17, 5, -17, -10, -15, 10, -15,
+ 0, -14, -4, -13, 4, -13, 19, -13, -19, -12,
+ -8, -11, -2, -11, 0, -11, 2, -11, 8, -11,
+ -15, -10, -4, -10, 4, -10, 15, -10, -6, -9,
+ -1, -9, 1, -9, 6, -9, -11, -8, -8, -8,
+ -3, -8, 0, -8, 3, -8, 8, -8, 11, -8,
+ -5, -7, -2, -7, 0, -7, 2, -7, 5, -7,
+ -22, -6, -9, -6, -6, -6, -3, -6, -1, -6,
+ 1, -6, 3, -6, 6, -6, 9, -6, 22, -6,
+ -17, -5, -7, -5, -4, -5, -2, -5, -1, -5,
+ 0, -5, 1, -5, 2, -5, 4, -5, 7, -5,
+ 17, -5, -13, -4, -10, -4, -5, -4, -3, -4,
+ -2, -4, -1, -4, 0, -4, 1, -4, 2, -4,
+ 3, -4, 5, -4, 10, -4, 13, -4, -8, -3,
+ -6, -3, -4, -3, -3, -3, -2, -3, -1, -3,
+ 0, -3, 1, -3, 2, -3, 3, -3, 4, -3,
+ 6, -3, 8, -3, -11, -2, -7, -2, -5, -2,
+ -4, -2, -3, -2, -2, -2, -1, -2, 0, -2,
+ 1, -2, 2, -2, 3, -2, 4, -2, 5, -2,
+ 7, -2, 11, -2, -9, -1, -6, -1, -5, -1,
+ -4, -1, -3, -1, -2, -1, -1, -1, 0, -1,
+ 1, -1, 2, -1, 3, -1, 4, -1, 5, -1,
+ 6, -1, 9, -1, -23, 0, -18, 0, -14, 0,
+ -11, 0, -7, 0, -5, 0, -4, 0, -3, 0,
+ -2, 0, -1, 0, 0, -23, 1, 0, 2, 0,
+ 3, 0, 4, 0, 5, 0, 7, 0, 11, 0,
+ 14, 0, 18, 0, 23, 0, -9, 1, -6, 1,
+ -5, 1, -4, 1, -3, 1, -2, 1, -1, 1,
+ 0, 1, 1, 1, 2, 1, 3, 1, 4, 1,
+ 5, 1, 6, 1, 9, 1, -11, 2, -7, 2,
+ -5, 2, -4, 2, -3, 2, -2, 2, -1, 2,
+ 0, 2, 1, 2, 2, 2, 3, 2, 4, 2,
+ 5, 2, 7, 2, 11, 2, -8, 3, -6, 3,
+ -4, 3, -3, 3, -2, 3, -1, 3, 0, 3,
+ 1, 3, 2, 3, 3, 3, 4, 3, 6, 3,
+ 8, 3, -13, 4, -10, 4, -5, 4, -3, 4,
+ -2, 4, -1, 4, 0, 4, 1, 4, 2, 4,
+ 3, 4, 5, 4, 10, 4, 13, 4, -17, 5,
+ -7, 5, -4, 5, -2, 5, -1, 5, 0, 5,
+ 1, 5, 2, 5, 4, 5, 7, 5, 17, 5,
+ -22, 6, -9, 6, -6, 6, -3, 6, -1, 6,
+ 1, 6, 3, 6, 6, 6, 9, 6, 22, 6,
+ -5, 7, -2, 7, 0, 7, 2, 7, 5, 7,
+ -11, 8, -8, 8, -3, 8, 0, 8, 3, 8,
+ 8, 8, 11, 8, -6, 9, -1, 9, 1, 9,
+ 6, 9, -15, 10, -4, 10, 4, 10, 15, 10,
+ -8, 11, -2, 11, 0, 11, 2, 11, 8, 11,
+ 19, 12, -19, 13, -4, 13, 4, 13, 0, 14,
+ -10, 15, 10, 15, -5, 17, 5, 17, 0, 18,
+ -12, 19, 13, 19, -6, 22, 6, 22, 0, 23,
+};
+
+typedef struct SANMVideoContext {
AVCodecContext *avctx;
GetByteContext gb;
int version, subversion;
- uint32_t pal[256];
- int16_t delta_pal[768];
+ uint32_t pal[PALETTE_SIZE];
+ int16_t delta_pal[PALETTE_DELTA];
int pitch;
int width, height;
@@ -66,7 +293,7 @@ typedef struct {
int8_t p8x8glyphs[NGLYPHS][64];
} SANMVideoContext;
-typedef struct {
+typedef struct SANMFrameHeader {
int seq_num, codec, rotate_code, rle_output_size;
uint16_t bg_color;
@@ -100,17 +327,16 @@ static enum GlyphEdge which_edge(int x, int y, int edge_size)
{
const int edge_max = edge_size - 1;
- if (!y) {
+ if (!y)
return BOTTOM_EDGE;
- } else if (y == edge_max) {
+ else if (y == edge_max)
return TOP_EDGE;
- } else if (!x) {
+ else if (!x)
return LEFT_EDGE;
- } else if (x == edge_max) {
+ else if (x == edge_max)
return RIGHT_EDGE;
- } else {
+ else
return NO_EDGE;
- }
}
static enum GlyphDir which_direction(enum GlyphEdge edge0, enum GlyphEdge edge1)
@@ -118,27 +344,24 @@ static enum GlyphDir which_direction(enum GlyphEdge edge0, enum GlyphEdge edge1)
if ((edge0 == LEFT_EDGE && edge1 == RIGHT_EDGE) ||
(edge1 == LEFT_EDGE && edge0 == RIGHT_EDGE) ||
(edge0 == BOTTOM_EDGE && edge1 != TOP_EDGE) ||
- (edge1 == BOTTOM_EDGE && edge0 != TOP_EDGE)) {
+ (edge1 == BOTTOM_EDGE && edge0 != TOP_EDGE))
return DIR_UP;
- } else if ((edge0 == TOP_EDGE && edge1 != BOTTOM_EDGE) ||
- (edge1 == TOP_EDGE && edge0 != BOTTOM_EDGE)) {
+ else if ((edge0 == TOP_EDGE && edge1 != BOTTOM_EDGE) ||
+ (edge1 == TOP_EDGE && edge0 != BOTTOM_EDGE))
return DIR_DOWN;
- } else if ((edge0 == LEFT_EDGE && edge1 != RIGHT_EDGE) ||
- (edge1 == LEFT_EDGE && edge0 != RIGHT_EDGE)) {
+ else if ((edge0 == LEFT_EDGE && edge1 != RIGHT_EDGE) ||
+ (edge1 == LEFT_EDGE && edge0 != RIGHT_EDGE))
return DIR_LEFT;
- } else if ((edge0 == TOP_EDGE && edge1 == BOTTOM_EDGE) ||
- (edge1 == TOP_EDGE && edge0 == BOTTOM_EDGE) ||
- (edge0 == RIGHT_EDGE && edge1 != LEFT_EDGE) ||
- (edge1 == RIGHT_EDGE && edge0 != LEFT_EDGE)) {
+ else if ((edge0 == TOP_EDGE && edge1 == BOTTOM_EDGE) ||
+ (edge1 == TOP_EDGE && edge0 == BOTTOM_EDGE) ||
+ (edge0 == RIGHT_EDGE && edge1 != LEFT_EDGE) ||
+ (edge1 == RIGHT_EDGE && edge0 != LEFT_EDGE))
return DIR_RIGHT;
- }
return NO_DIR;
}
-/**
- * Interpolate two points.
- */
+/* Interpolate two points. */
static void interp_point(int8_t *points, int x0, int y0, int x1, int y1,
int pos, int npoints)
{
@@ -152,11 +375,11 @@ static void interp_point(int8_t *points, int x0, int y0, int x1, int y1,
}
/**
- * Construct glyphs by iterating through vectors coordinates.
+ * Construct glyphs by iterating through vector coordinates.
*
* @param pglyphs pointer to table where glyphs are stored
- * @param xvec pointer to x component of vectors coordinates
- * @param yvec pointer to y component of vectors coordinates
+ * @param xvec pointer to x component of vector coordinates
+ * @param yvec pointer to y component of vector coordinates
* @param side_length glyph width/height.
*/
static void make_glyphs(int8_t *pglyphs, const int8_t *xvec, const int8_t *yvec,
@@ -167,15 +390,15 @@ static void make_glyphs(int8_t *pglyphs, const int8_t *xvec, const int8_t *yvec,
int i, j;
for (i = 0; i < GLYPH_COORD_VECT_SIZE; i++) {
- int x0 = xvec[i];
- int y0 = yvec[i];
+ int x0 = xvec[i];
+ int y0 = yvec[i];
enum GlyphEdge edge0 = which_edge(x0, y0, side_length);
for (j = 0; j < GLYPH_COORD_VECT_SIZE; j++, pglyph += glyph_size) {
- int x1 = xvec[j];
- int y1 = yvec[j];
- enum GlyphEdge edge1 = which_edge(x1, y1, side_length);
- enum GlyphDir dir = which_direction(edge0, edge1);
+ int x1 = xvec[j];
+ int y1 = yvec[j];
+ enum GlyphEdge edge1 = which_edge(x1, y1, side_length);
+ enum GlyphDir dir = which_direction(edge0, edge1);
int npoints = FFMAX(FFABS(x1 - x0), FFABS(y1 - y0));
int ipoint;
@@ -217,7 +440,7 @@ static void init_sizes(SANMVideoContext *ctx, int width, int height)
ctx->height = height;
ctx->npixels = width * height;
- ctx->aligned_width = FFALIGN(width, 8);
+ ctx->aligned_width = FFALIGN(width, 8);
ctx->aligned_height = FFALIGN(height, 8);
ctx->buf_size = ctx->aligned_width * ctx->aligned_height * sizeof(ctx->frm0[0]);
@@ -242,9 +465,11 @@ static av_cold int init_buffers(SANMVideoContext *ctx)
av_fast_padded_malloc(&ctx->frm1, &ctx->frm1_size, ctx->buf_size);
av_fast_padded_malloc(&ctx->frm2, &ctx->frm2_size, ctx->buf_size);
if (!ctx->version)
- av_fast_padded_malloc(&ctx->stored_frame, &ctx->stored_frame_size, ctx->buf_size);
+ av_fast_padded_malloc(&ctx->stored_frame,
+ &ctx->stored_frame_size, ctx->buf_size);
- if (!ctx->frm0 || !ctx->frm1 || !ctx->frm2 || (!ctx->stored_frame && !ctx->version)) {
+ if (!ctx->frm0 || !ctx->frm1 || !ctx->frm2 ||
+ (!ctx->stored_frame && !ctx->version)) {
destroy_buffers(ctx);
return AVERROR(ENOMEM);
}
@@ -254,7 +479,6 @@ static av_cold int init_buffers(SANMVideoContext *ctx)
static void rotate_bufs(SANMVideoContext *ctx, int rotate_code)
{
- av_dlog(ctx->avctx, "rotate %d\n", rotate_code);
if (rotate_code == 2)
FFSWAP(uint16_t*, ctx->frm1, ctx->frm2);
FFSWAP(uint16_t*, ctx->frm2, ctx->frm0);
@@ -264,14 +488,14 @@ static av_cold int decode_init(AVCodecContext *avctx)
{
SANMVideoContext *ctx = avctx->priv_data;
- ctx->avctx = avctx;
- ctx->version = !avctx->extradata_size;
+ ctx->avctx = avctx;
+ ctx->version = !avctx->extradata_size;
avctx->pix_fmt = ctx->version ? AV_PIX_FMT_RGB565 : AV_PIX_FMT_PAL8;
init_sizes(ctx, avctx->width, avctx->height);
if (init_buffers(ctx)) {
- av_log(avctx, AV_LOG_ERROR, "error allocating buffers\n");
+ av_log(avctx, AV_LOG_ERROR, "Error allocating buffers.\n");
return AVERROR(ENOMEM);
}
@@ -282,12 +506,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
int i;
if (avctx->extradata_size < 1026) {
- av_log(avctx, AV_LOG_ERROR, "not enough extradata\n");
+ av_log(avctx, AV_LOG_ERROR, "Not enough extradata.\n");
return AVERROR_INVALIDDATA;
}
ctx->subversion = AV_RL16(avctx->extradata);
- for (i = 0; i < 256; i++)
+ for (i = 0; i < PALETTE_SIZE; i++)
ctx->pal[i] = 0xFFU << 24 | AV_RL32(avctx->extradata + 2 + i * 4);
}
@@ -332,7 +556,7 @@ static int rle_decode(SANMVideoContext *ctx, uint8_t *dst, const int out_size)
static int old_codec1(SANMVideoContext *ctx, int top,
int left, int width, int height)
{
- uint8_t *dst = ((uint8_t*)ctx->frm0) + left + top * ctx->pitch;
+ uint8_t *dst = ((uint8_t *)ctx->frm0) + left + top * ctx->pitch;
int i, j, len, flag, code, val, pos, end;
for (i = 0; i < height; i++) {
@@ -400,22 +624,21 @@ static int old_codec37(SANMVideoContext *ctx, int top,
{
int stride = ctx->pitch;
int i, j, k, t;
- int skip_run = 0;
- int compr, mvoff, seq, flags;
- uint32_t decoded_size;
uint8_t *dst, *prev;
+ int skip_run = 0;
+ int compr = bytestream2_get_byte(&ctx->gb);
+ int mvoff = bytestream2_get_byte(&ctx->gb);
+ int seq = bytestream2_get_le16(&ctx->gb);
+ uint32_t decoded_size = bytestream2_get_le32(&ctx->gb);
+ int flags;
- compr = bytestream2_get_byte(&ctx->gb);
- mvoff = bytestream2_get_byte(&ctx->gb);
- seq = bytestream2_get_le16(&ctx->gb);
- decoded_size = bytestream2_get_le32(&ctx->gb);
bytestream2_skip(&ctx->gb, 4);
- flags = bytestream2_get_byte(&ctx->gb);
+ flags = bytestream2_get_byte(&ctx->gb);
bytestream2_skip(&ctx->gb, 3);
if (decoded_size > ctx->height * stride - left - top * stride) {
decoded_size = ctx->height * stride - left - top * stride;
- av_log(ctx->avctx, AV_LOG_WARNING, "decoded size is too large\n");
+ av_log(ctx->avctx, AV_LOG_WARNING, "Decoded size is too large.\n");
}
ctx->rotate_code = 0;
@@ -427,10 +650,10 @@ static int old_codec37(SANMVideoContext *ctx, int top,
prev = ((uint8_t*)ctx->frm2) + left + top * stride;
if (mvoff > 2) {
- av_log(ctx->avctx, AV_LOG_ERROR, "invalid motion base value %d\n", mvoff);
+ av_log(ctx->avctx, AV_LOG_ERROR, "Invalid motion base value %d.\n", mvoff);
return AVERROR_INVALIDDATA;
}
- av_dlog(ctx->avctx, "compression %d\n", compr);
+
switch (compr) {
case 0:
for (i = 0; i < height; i++) {
@@ -489,7 +712,7 @@ static int old_codec37(SANMVideoContext *ctx, int top,
} else {
int mx, my;
- mx = c37_mv[(mvoff * 255 + code) * 2 ];
+ mx = c37_mv[(mvoff * 255 + code) * 2];
my = c37_mv[(mvoff * 255 + code) * 2 + 1];
codec37_mv(dst + i, prev + i + mx + my * stride,
ctx->height, stride, i + mx, j + my);
@@ -534,8 +757,8 @@ static int old_codec37(SANMVideoContext *ctx, int top,
}
break;
default:
- av_log(ctx->avctx, AV_LOG_ERROR,
- "subcodec 37 compression %d not implemented\n", compr);
+ avpriv_report_missing_feature(ctx->avctx,
+ "Subcodec 37 compression %d", compr);
return AVERROR_PATCHWELCOME;
}
@@ -559,10 +782,10 @@ static int process_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *prev1,
if (size == 2) {
if (bytestream2_get_bytes_left(&ctx->gb) < 4)
return AVERROR_INVALIDDATA;
- dst[0] = bytestream2_get_byteu(&ctx->gb);
- dst[1] = bytestream2_get_byteu(&ctx->gb);
- dst[0+stride] = bytestream2_get_byteu(&ctx->gb);
- dst[1+stride] = bytestream2_get_byteu(&ctx->gb);
+ dst[0] = bytestream2_get_byteu(&ctx->gb);
+ dst[1] = bytestream2_get_byteu(&ctx->gb);
+ dst[0 + stride] = bytestream2_get_byteu(&ctx->gb);
+ dst[1 + stride] = bytestream2_get_byteu(&ctx->gb);
} else {
size >>= 1;
if (process_block(ctx, dst, prev1, prev2, stride, tbl, size))
@@ -615,13 +838,13 @@ static int process_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *prev1,
} else {
int mx = motion_vectors[code][0];
int my = motion_vectors[code][1];
- int index = prev2 - (const uint8_t*)ctx->frm2;
+ int index = prev2 - (const uint8_t *)ctx->frm2;
- av_assert2(index >= 0 && index < (ctx->buf_size>>1));
+ av_assert2(index >= 0 && index < (ctx->buf_size >> 1));
- if (index < - mx - my*stride ||
- (ctx->buf_size>>1) - index < mx + size + (my + size - 1)*stride) {
- av_log(ctx->avctx, AV_LOG_ERROR, "MV is invalid \n");
+ if (index < -mx - my * stride ||
+ (ctx->buf_size >> 1) - index < mx + size + (my + size - 1) * stride) {
+ av_log(ctx->avctx, AV_LOG_ERROR, "MV is invalid.\n");
return AVERROR_INVALIDDATA;
}
@@ -635,25 +858,25 @@ static int process_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *prev1,
static int old_codec47(SANMVideoContext *ctx, int top,
int left, int width, int height)
{
- int i, j, seq, compr, new_rot, tbl_pos, skip;
- int stride = ctx->pitch;
- uint8_t *dst = ((uint8_t*)ctx->frm0) + left + top * stride;
- uint8_t *prev1 = (uint8_t*)ctx->frm1;
- uint8_t *prev2 = (uint8_t*)ctx->frm2;
uint32_t decoded_size;
+ int i, j;
+ int stride = ctx->pitch;
+ uint8_t *dst = (uint8_t *)ctx->frm0 + left + top * stride;
+ uint8_t *prev1 = (uint8_t *)ctx->frm1;
+ uint8_t *prev2 = (uint8_t *)ctx->frm2;
+ int tbl_pos = bytestream2_tell(&ctx->gb);
+ int seq = bytestream2_get_le16(&ctx->gb);
+ int compr = bytestream2_get_byte(&ctx->gb);
+ int new_rot = bytestream2_get_byte(&ctx->gb);
+ int skip = bytestream2_get_byte(&ctx->gb);
- tbl_pos = bytestream2_tell(&ctx->gb);
- seq = bytestream2_get_le16(&ctx->gb);
- compr = bytestream2_get_byte(&ctx->gb);
- new_rot = bytestream2_get_byte(&ctx->gb);
- skip = bytestream2_get_byte(&ctx->gb);
bytestream2_skip(&ctx->gb, 9);
decoded_size = bytestream2_get_le32(&ctx->gb);
bytestream2_skip(&ctx->gb, 8);
if (decoded_size > ctx->height * stride - left - top * stride) {
decoded_size = ctx->height * stride - left - top * stride;
- av_log(ctx->avctx, AV_LOG_WARNING, "decoded size is too large\n");
+ av_log(ctx->avctx, AV_LOG_WARNING, "Decoded size is too large.\n");
}
if (skip & 1)
@@ -663,7 +886,7 @@ static int old_codec47(SANMVideoContext *ctx, int top,
memset(prev1, 0, ctx->height * stride);
memset(prev2, 0, ctx->height * stride);
}
- av_dlog(ctx->avctx, "compression %d\n", compr);
+
switch (compr) {
case 0:
if (bytestream2_get_bytes_left(&ctx->gb) < width * height)
@@ -678,8 +901,10 @@ static int old_codec47(SANMVideoContext *ctx, int top,
return AVERROR_INVALIDDATA;
for (j = 0; j < height; j += 2) {
for (i = 0; i < width; i += 2) {
- dst[i] = dst[i + 1] =
- dst[stride + i] = dst[stride + i + 1] = bytestream2_get_byteu(&ctx->gb);
+ dst[i] =
+ dst[i + 1] =
+ dst[stride + i] =
+ dst[stride + i + 1] = bytestream2_get_byteu(&ctx->gb);
}
dst += stride * 2;
}
@@ -687,11 +912,10 @@ static int old_codec47(SANMVideoContext *ctx, int top,
case 2:
if (seq == ctx->prev_seq + 1) {
for (j = 0; j < height; j += 8) {
- for (i = 0; i < width; i += 8) {
+ for (i = 0; i < width; i += 8)
if (process_block(ctx, dst + i, prev1 + i, prev2 + i, stride,
tbl_pos + 8, 8))
return AVERROR_INVALIDDATA;
- }
dst += stride * 8;
prev1 += stride * 8;
prev2 += stride * 8;
@@ -709,8 +933,8 @@ static int old_codec47(SANMVideoContext *ctx, int top,
return AVERROR_INVALIDDATA;
break;
default:
- av_log(ctx->avctx, AV_LOG_ERROR,
- "subcodec 47 compression %d not implemented\n", compr);
+ avpriv_report_missing_feature(ctx->avctx,
+ "Subcodec 47 compression %d", compr);
return AVERROR_PATCHWELCOME;
}
if (seq == ctx->prev_seq + 1)
@@ -724,34 +948,31 @@ static int old_codec47(SANMVideoContext *ctx, int top,
static int process_frame_obj(SANMVideoContext *ctx)
{
- uint16_t codec, top, left, w, h;
-
- codec = bytestream2_get_le16u(&ctx->gb);
- left = bytestream2_get_le16u(&ctx->gb);
- top = bytestream2_get_le16u(&ctx->gb);
- w = bytestream2_get_le16u(&ctx->gb);
- h = bytestream2_get_le16u(&ctx->gb);
+ uint16_t codec = bytestream2_get_le16u(&ctx->gb);
+ uint16_t left = bytestream2_get_le16u(&ctx->gb);
+ uint16_t top = bytestream2_get_le16u(&ctx->gb);
+ uint16_t w = bytestream2_get_le16u(&ctx->gb);
+ uint16_t h = bytestream2_get_le16u(&ctx->gb);
if (!w || !h) {
- av_log(ctx->avctx, AV_LOG_ERROR, "dimensions are invalid\n");
+ av_log(ctx->avctx, AV_LOG_ERROR, "Dimensions are invalid.\n");
return AVERROR_INVALIDDATA;
}
if (ctx->width < left + w || ctx->height < top + h) {
int ret = ff_set_dimensions(ctx->avctx, FFMAX(left + w, ctx->width),
- FFMAX(top + h, ctx->height));
+ FFMAX(top + h, ctx->height));
if (ret < 0)
return ret;
init_sizes(ctx, FFMAX(left + w, ctx->width),
- FFMAX(top + h, ctx->height));
+ FFMAX(top + h, ctx->height));
if (init_buffers(ctx)) {
- av_log(ctx->avctx, AV_LOG_ERROR, "error resizing buffers\n");
+ av_log(ctx->avctx, AV_LOG_ERROR, "Error resizing buffers.\n");
return AVERROR(ENOMEM);
}
}
bytestream2_skip(&ctx->gb, 4);
- av_dlog(ctx->avctx, "subcodec %d\n", codec);
switch (codec) {
case 1:
case 3:
@@ -764,7 +985,7 @@ static int process_frame_obj(SANMVideoContext *ctx)
return old_codec47(ctx, top, left, w, h);
break;
default:
- avpriv_request_sample(ctx->avctx, "unknown subcodec %d", codec);
+ avpriv_request_sample(ctx->avctx, "Subcodec %d", codec);
return AVERROR_PATCHWELCOME;
}
}
@@ -775,7 +996,7 @@ static int decode_0(SANMVideoContext *ctx)
int x, y;
if (bytestream2_get_bytes_left(&ctx->gb) < ctx->width * ctx->height * 2) {
- av_log(ctx->avctx, AV_LOG_ERROR, "insufficient data for raw frame\n");
+ av_log(ctx->avctx, AV_LOG_ERROR, "Insufficient data for raw frame.\n");
return AVERROR_INVALIDDATA;
}
for (y = 0; y < ctx->height; y++) {
@@ -788,7 +1009,7 @@ static int decode_0(SANMVideoContext *ctx)
static int decode_nop(SANMVideoContext *ctx)
{
- avpriv_request_sample(ctx->avctx, "unknown/unsupported compression type");
+ avpriv_request_sample(ctx->avctx, "Unknown/unsupported compression type");
return AVERROR_PATCHWELCOME;
}
@@ -821,15 +1042,16 @@ static void fill_block(uint16_t *pdest, uint16_t color, int block_size, int pitc
*pdest++ = color;
}
-static int draw_glyph(SANMVideoContext *ctx, uint16_t *dst, int index, uint16_t fg_color,
- uint16_t bg_color, int block_size, int pitch)
+static int draw_glyph(SANMVideoContext *ctx, uint16_t *dst, int index,
+ uint16_t fg_color, uint16_t bg_color, int block_size,
+ int pitch)
{
int8_t *pglyph;
uint16_t colors[2] = { fg_color, bg_color };
int x, y;
if (index >= NGLYPHS) {
- av_log(ctx->avctx, AV_LOG_ERROR, "ignoring nonexistent glyph #%u\n", index);
+ av_log(ctx->avctx, AV_LOG_ERROR, "Ignoring nonexistent glyph #%u.\n", index);
return AVERROR_INVALIDDATA;
}
@@ -853,9 +1075,12 @@ static int opcode_0xf7(SANMVideoContext *ctx, int cx, int cy, int block_size, in
return AVERROR_INVALIDDATA;
indices = bytestream2_get_le32u(&ctx->gb);
- dst[0] = ctx->codebook[indices & 0xFF]; indices >>= 8;
- dst[1] = ctx->codebook[indices & 0xFF]; indices >>= 8;
- dst[pitch] = ctx->codebook[indices & 0xFF]; indices >>= 8;
+ dst[0] = ctx->codebook[indices & 0xFF];
+ indices >>= 8;
+ dst[1] = ctx->codebook[indices & 0xFF];
+ indices >>= 8;
+ dst[pitch] = ctx->codebook[indices & 0xFF];
+ indices >>= 8;
dst[pitch + 1] = ctx->codebook[indices & 0xFF];
} else {
uint16_t fgcolor, bgcolor;
@@ -909,10 +1134,10 @@ static int good_mvec(SANMVideoContext *ctx, int cx, int cy, int mx, int my,
int good = start_pos >= 0 && end_pos < (ctx->buf_size >> 1);
- if (!good) {
- av_log(ctx->avctx, AV_LOG_ERROR, "ignoring invalid motion vector (%i, %i)->(%u, %u), block size = %u\n",
+ if (!good)
+ av_log(ctx->avctx, AV_LOG_ERROR,
+ "Ignoring invalid motion vector (%i, %i)->(%u, %u), block size = %u\n",
cx + mx, cy + my, cx, cy, block_size);
- }
return good;
}
@@ -927,7 +1152,6 @@ static int codec2subblock(SANMVideoContext *ctx, int cx, int cy, int blk_size)
opcode = bytestream2_get_byteu(&ctx->gb);
- av_dlog(ctx->avctx, "opcode 0x%0X cx %d cy %d blk %d\n", opcode, cx, cy, blk_size);
switch (opcode) {
default:
mx = motion_vectors[opcode][0];
@@ -989,11 +1213,11 @@ static int codec2subblock(SANMVideoContext *ctx, int cx, int cy, int blk_size)
opcode_0xf8(ctx, cx, cy, blk_size, ctx->pitch);
} else {
blk_size >>= 1;
- if (codec2subblock(ctx, cx , cy , blk_size))
+ if (codec2subblock(ctx, cx, cy, blk_size))
return AVERROR_INVALIDDATA;
- if (codec2subblock(ctx, cx + blk_size, cy , blk_size))
+ if (codec2subblock(ctx, cx + blk_size, cy, blk_size))
return AVERROR_INVALIDDATA;
- if (codec2subblock(ctx, cx , cy + blk_size, blk_size))
+ if (codec2subblock(ctx, cx, cy + blk_size, blk_size))
return AVERROR_INVALIDDATA;
if (codec2subblock(ctx, cx + blk_size, cy + blk_size, blk_size))
return AVERROR_INVALIDDATA;
@@ -1007,12 +1231,10 @@ static int decode_2(SANMVideoContext *ctx)
{
int cx, cy, ret;
- for (cy = 0; cy < ctx->aligned_height; cy += 8) {
- for (cx = 0; cx < ctx->aligned_width; cx += 8) {
+ for (cy = 0; cy < ctx->aligned_height; cy += 8)
+ for (cx = 0; cx < ctx->aligned_width; cx += 8)
if (ret = codec2subblock(ctx, cx, cy, 8))
return ret;
- }
- }
return 0;
}
@@ -1058,7 +1280,7 @@ static int decode_6(SANMVideoContext *ctx)
uint16_t *frm = ctx->frm0;
if (bytestream2_get_bytes_left(&ctx->gb) < npixels) {
- av_log(ctx->avctx, AV_LOG_ERROR, "insufficient data for frame\n");
+ av_log(ctx->avctx, AV_LOG_ERROR, "Insufficient data for frame.\n");
return AVERROR_INVALIDDATA;
}
while (npixels--)
@@ -1075,7 +1297,7 @@ static int decode_8(SANMVideoContext *ctx)
av_fast_malloc(&ctx->rle_buf, &ctx->rle_buf_size, npixels);
if (!ctx->rle_buf) {
- av_log(ctx->avctx, AV_LOG_ERROR, "RLE buffer allocation failed\n");
+ av_log(ctx->avctx, AV_LOG_ERROR, "RLE buffer allocation failed.\n");
return AVERROR(ENOMEM);
}
rsrc = ctx->rle_buf;
@@ -1101,7 +1323,7 @@ static int read_frame_header(SANMVideoContext *ctx, SANMFrameHeader *hdr)
int i, ret;
if ((ret = bytestream2_get_bytes_left(&ctx->gb)) < 560) {
- av_log(ctx->avctx, AV_LOG_ERROR, "too short input frame (%d bytes)\n",
+ av_log(ctx->avctx, AV_LOG_ERROR, "Input frame too short (%d bytes).\n",
ret);
return AVERROR_INVALIDDATA;
}
@@ -1111,7 +1333,7 @@ static int read_frame_header(SANMVideoContext *ctx, SANMFrameHeader *hdr)
hdr->height = bytestream2_get_le32u(&ctx->gb);
if (hdr->width != ctx->width || hdr->height != ctx->height) {
- av_log(ctx->avctx, AV_LOG_ERROR, "variable size frames are not implemented\n");
+ avpriv_report_missing_feature(ctx->avctx, "Variable size frames");
return AVERROR_PATCHWELCOME;
}
@@ -1133,7 +1355,6 @@ static int read_frame_header(SANMVideoContext *ctx, SANMFrameHeader *hdr)
bytestream2_skip(&ctx->gb, 8); // skip pad
- av_dlog(ctx->avctx, "subcodec %d\n", hdr->codec);
return 0;
}
@@ -1186,17 +1407,17 @@ static int decode_frame(AVCodecContext *avctx, void *data,
pos = bytestream2_tell(&ctx->gb);
if (bytestream2_get_bytes_left(&ctx->gb) < size) {
- av_log(avctx, AV_LOG_ERROR, "incorrect chunk size %d\n", size);
+ av_log(avctx, AV_LOG_ERROR, "Incorrect chunk size %d.\n", size);
break;
}
switch (sig) {
case MKBETAG('N', 'P', 'A', 'L'):
- if (size != 256 * 3) {
- av_log(avctx, AV_LOG_ERROR, "incorrect palette block size %d\n",
- size);
+ if (size != PALETTE_SIZE * 3) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Incorrect palette block size %d.\n", size);
return AVERROR_INVALIDDATA;
}
- for (i = 0; i < 256; i++)
+ for (i = 0; i < PALETTE_SIZE; i++)
ctx->pal[i] = 0xFFU << 24 | bytestream2_get_be24u(&ctx->gb);
break;
case MKBETAG('F', 'O', 'B', 'J'):
@@ -1210,7 +1431,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
uint8_t tmp[3];
int j;
- for (i = 0; i < 256; i++) {
+ for (i = 0; i < PALETTE_SIZE; i++) {
for (j = 0; j < 3; j++) {
int t = (ctx->pal[i] >> (16 - j * 8)) & 0xFF;
tmp[j] = av_clip_uint8((t * 129 + ctx->delta_pal[i * 3 + j]) >> 7);
@@ -1218,16 +1439,16 @@ static int decode_frame(AVCodecContext *avctx, void *data,
ctx->pal[i] = 0xFFU << 24 | AV_RB24(tmp);
}
} else {
- if (size < 768 * 2 + 4) {
- av_log(avctx, AV_LOG_ERROR, "incorrect palette change block size %d\n",
+ if (size < PALETTE_DELTA * 2 + 4) {
+ av_log(avctx, AV_LOG_ERROR, "Incorrect palette change block size %d.\n",
size);
return AVERROR_INVALIDDATA;
}
bytestream2_skipu(&ctx->gb, 4);
- for (i = 0; i < 768; i++)
+ for (i = 0; i < PALETTE_DELTA; i++)
ctx->delta_pal[i] = bytestream2_get_le16u(&ctx->gb);
- if (size >= 768 * 5 + 4) {
- for (i = 0; i < 256; i++)
+ if (size >= PALETTE_DELTA * 5 + 4) {
+ for (i = 0; i < PALETTE_SIZE; i++)
ctx->pal[i] = 0xFFU << 24 | bytestream2_get_be24u(&ctx->gb);
} else {
memset(ctx->pal, 0, sizeof(ctx->pal));
@@ -1242,7 +1463,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
break;
default:
bytestream2_skip(&ctx->gb, size);
- av_log(avctx, AV_LOG_DEBUG, "unknown/unsupported chunk %x\n", sig);
+ av_log(avctx, AV_LOG_DEBUG, "Unknown/unsupported chunk %x.\n", sig);
break;
}
@@ -1273,12 +1494,11 @@ static int decode_frame(AVCodecContext *avctx, void *data,
if (header.codec < FF_ARRAY_ELEMS(v1_decoders)) {
if ((ret = v1_decoders[header.codec](ctx))) {
av_log(avctx, AV_LOG_ERROR,
- "subcodec %d: error decoding frame\n", header.codec);
+ "Subcodec %d: error decoding frame.\n", header.codec);
return ret;
}
} else {
- avpriv_request_sample(avctx, "subcodec %d",
- header.codec);
+ avpriv_request_sample(avctx, "Subcodec %d", header.codec);
return AVERROR_PATCHWELCOME;
}
@@ -1288,14 +1508,14 @@ static int decode_frame(AVCodecContext *avctx, void *data,
if (ctx->rotate_code)
rotate_bufs(ctx, ctx->rotate_code);
- *got_frame_ptr = 1;
+ *got_frame_ptr = 1;
return pkt->size;
}
AVCodec ff_sanm_decoder = {
.name = "sanm",
- .long_name = NULL_IF_CONFIG_SMALL("LucasArts SMUSH video"),
+ .long_name = NULL_IF_CONFIG_SMALL("LucasArts SANM/Smush video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_SANM,
.priv_data_size = sizeof(SANMVideoContext),
diff --git a/chromium/third_party/ffmpeg/libavcodec/sanm_data.h b/chromium/third_party/ffmpeg/libavcodec/sanm_data.h
deleted file mode 100644
index 8fccf38eea8..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/sanm_data.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * LucasArts Smush video decoder
- * Copyright (c) 2006 Cyril Zorin
- *
- * 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_SANM_DATA_H
-#define AVCODEC_SANM_DATA_H
-
-#include <stdint.h>
-
-#define GLYPH_COORD_VECT_SIZE 16
-
-static const int8_t glyph4_x[GLYPH_COORD_VECT_SIZE] =
- { 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, 0, 0, 1, 2, 2, 1 };
-static const int8_t glyph4_y[GLYPH_COORD_VECT_SIZE] =
- { 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 2, 1, 1, 1, 2, 2 };
-static const int8_t glyph8_x[GLYPH_COORD_VECT_SIZE] =
- { 0, 2, 5, 7, 7, 7, 7, 7, 7, 5, 2, 0, 0, 0, 0, 0 };
-static const int8_t glyph8_y[GLYPH_COORD_VECT_SIZE] =
- { 0, 0, 0, 0, 1, 3, 4, 6, 7, 7, 7, 7, 6, 4, 3, 1 };
-
-static const int8_t motion_vectors[256][2] =
-{
- { 0, 0}, { -1, -43}, { 6, -43}, { -9, -42}, { 13, -41},
- {-16, -40}, { 19, -39}, {-23, -36}, { 26, -34}, { -2, -33},
- { 4, -33}, {-29, -32}, { -9, -32}, { 11, -31}, {-16, -29},
- { 32, -29}, { 18, -28}, {-34, -26}, {-22, -25}, { -1, -25},
- { 3, -25}, { -7, -24}, { 8, -24}, { 24, -23}, { 36, -23},
- {-12, -22}, { 13, -21}, {-38, -20}, { 0, -20}, {-27, -19},
- { -4, -19}, { 4, -19}, {-17, -18}, { -8, -17}, { 8, -17},
- { 18, -17}, { 28, -17}, { 39, -17}, {-12, -15}, { 12, -15},
- {-21, -14}, { -1, -14}, { 1, -14}, {-41, -13}, { -5, -13},
- { 5, -13}, { 21, -13}, {-31, -12}, {-15, -11}, { -8, -11},
- { 8, -11}, { 15, -11}, { -2, -10}, { 1, -10}, { 31, -10},
- {-23, -9}, {-11, -9}, { -5, -9}, { 4, -9}, { 11, -9},
- { 42, -9}, { 6, -8}, { 24, -8}, {-18, -7}, { -7, -7},
- { -3, -7}, { -1, -7}, { 2, -7}, { 18, -7}, {-43, -6},
- {-13, -6}, { -4, -6}, { 4, -6}, { 8, -6}, {-33, -5},
- { -9, -5}, { -2, -5}, { 0, -5}, { 2, -5}, { 5, -5},
- { 13, -5}, {-25, -4}, { -6, -4}, { -3, -4}, { 3, -4},
- { 9, -4}, {-19, -3}, { -7, -3}, { -4, -3}, { -2, -3},
- { -1, -3}, { 0, -3}, { 1, -3}, { 2, -3}, { 4, -3},
- { 6, -3}, { 33, -3}, {-14, -2}, {-10, -2}, { -5, -2},
- { -3, -2}, { -2, -2}, { -1, -2}, { 0, -2}, { 1, -2},
- { 2, -2}, { 3, -2}, { 5, -2}, { 7, -2}, { 14, -2},
- { 19, -2}, { 25, -2}, { 43, -2}, { -7, -1}, { -3, -1},
- { -2, -1}, { -1, -1}, { 0, -1}, { 1, -1}, { 2, -1},
- { 3, -1}, { 10, -1}, { -5, 0}, { -3, 0}, { -2, 0},
- { -1, 0}, { 1, 0}, { 2, 0}, { 3, 0}, { 5, 0},
- { 7, 0}, {-10, 1}, { -7, 1}, { -3, 1}, { -2, 1},
- { -1, 1}, { 0, 1}, { 1, 1}, { 2, 1}, { 3, 1},
- {-43, 2}, {-25, 2}, {-19, 2}, {-14, 2}, { -5, 2},
- { -3, 2}, { -2, 2}, { -1, 2}, { 0, 2}, { 1, 2},
- { 2, 2}, { 3, 2}, { 5, 2}, { 7, 2}, { 10, 2},
- { 14, 2}, {-33, 3}, { -6, 3}, { -4, 3}, { -2, 3},
- { -1, 3}, { 0, 3}, { 1, 3}, { 2, 3}, { 4, 3},
- { 19, 3}, { -9, 4}, { -3, 4}, { 3, 4}, { 7, 4},
- { 25, 4}, {-13, 5}, { -5, 5}, { -2, 5}, { 0, 5},
- { 2, 5}, { 5, 5}, { 9, 5}, { 33, 5}, { -8, 6},
- { -4, 6}, { 4, 6}, { 13, 6}, { 43, 6}, {-18, 7},
- { -2, 7}, { 0, 7}, { 2, 7}, { 7, 7}, { 18, 7},
- {-24, 8}, { -6, 8}, {-42, 9}, {-11, 9}, { -4, 9},
- { 5, 9}, { 11, 9}, { 23, 9}, {-31, 10}, { -1, 10},
- { 2, 10}, {-15, 11}, { -8, 11}, { 8, 11}, { 15, 11},
- { 31, 12}, {-21, 13}, { -5, 13}, { 5, 13}, { 41, 13},
- { -1, 14}, { 1, 14}, { 21, 14}, {-12, 15}, { 12, 15},
- {-39, 17}, {-28, 17}, {-18, 17}, { -8, 17}, { 8, 17},
- { 17, 18}, { -4, 19}, { 0, 19}, { 4, 19}, { 27, 19},
- { 38, 20}, {-13, 21}, { 12, 22}, {-36, 23}, {-24, 23},
- { -8, 24}, { 7, 24}, { -3, 25}, { 1, 25}, { 22, 25},
- { 34, 26}, {-18, 28}, {-32, 29}, { 16, 29}, {-11, 31},
- { 9, 32}, { 29, 32}, { -4, 33}, { 2, 33}, {-26, 34},
- { 23, 36}, {-19, 39}, { 16, 40}, {-13, 41}, { 9, 42},
- { -6, 43}, { 1, 43}, { 0, 0}, { 0, 0}, { 0, 0},
-};
-
-static const int8_t c37_mv[] = {
- 0, 0, 1, 0, 2, 0, 3, 0, 5, 0,
- 8, 0, 13, 0, 21, 0, -1, 0, -2, 0,
- -3, 0, -5, 0, -8, 0, -13, 0, -17, 0,
- -21, 0, 0, 1, 1, 1, 2, 1, 3, 1,
- 5, 1, 8, 1, 13, 1, 21, 1, -1, 1,
- -2, 1, -3, 1, -5, 1, -8, 1, -13, 1,
- -17, 1, -21, 1, 0, 2, 1, 2, 2, 2,
- 3, 2, 5, 2, 8, 2, 13, 2, 21, 2,
- -1, 2, -2, 2, -3, 2, -5, 2, -8, 2,
- -13, 2, -17, 2, -21, 2, 0, 3, 1, 3,
- 2, 3, 3, 3, 5, 3, 8, 3, 13, 3,
- 21, 3, -1, 3, -2, 3, -3, 3, -5, 3,
- -8, 3, -13, 3, -17, 3, -21, 3, 0, 5,
- 1, 5, 2, 5, 3, 5, 5, 5, 8, 5,
- 13, 5, 21, 5, -1, 5, -2, 5, -3, 5,
- -5, 5, -8, 5, -13, 5, -17, 5, -21, 5,
- 0, 8, 1, 8, 2, 8, 3, 8, 5, 8,
- 8, 8, 13, 8, 21, 8, -1, 8, -2, 8,
- -3, 8, -5, 8, -8, 8, -13, 8, -17, 8,
- -21, 8, 0, 13, 1, 13, 2, 13, 3, 13,
- 5, 13, 8, 13, 13, 13, 21, 13, -1, 13,
- -2, 13, -3, 13, -5, 13, -8, 13, -13, 13,
- -17, 13, -21, 13, 0, 21, 1, 21, 2, 21,
- 3, 21, 5, 21, 8, 21, 13, 21, 21, 21,
- -1, 21, -2, 21, -3, 21, -5, 21, -8, 21,
- -13, 21, -17, 21, -21, 21, 0, -1, 1, -1,
- 2, -1, 3, -1, 5, -1, 8, -1, 13, -1,
- 21, -1, -1, -1, -2, -1, -3, -1, -5, -1,
- -8, -1, -13, -1, -17, -1, -21, -1, 0, -2,
- 1, -2, 2, -2, 3, -2, 5, -2, 8, -2,
- 13, -2, 21, -2, -1, -2, -2, -2, -3, -2,
- -5, -2, -8, -2, -13, -2, -17, -2, -21, -2,
- 0, -3, 1, -3, 2, -3, 3, -3, 5, -3,
- 8, -3, 13, -3, 21, -3, -1, -3, -2, -3,
- -3, -3, -5, -3, -8, -3, -13, -3, -17, -3,
- -21, -3, 0, -5, 1, -5, 2, -5, 3, -5,
- 5, -5, 8, -5, 13, -5, 21, -5, -1, -5,
- -2, -5, -3, -5, -5, -5, -8, -5, -13, -5,
- -17, -5, -21, -5, 0, -8, 1, -8, 2, -8,
- 3, -8, 5, -8, 8, -8, 13, -8, 21, -8,
- -1, -8, -2, -8, -3, -8, -5, -8, -8, -8,
- -13, -8, -17, -8, -21, -8, 0, -13, 1, -13,
- 2, -13, 3, -13, 5, -13, 8, -13, 13, -13,
- 21, -13, -1, -13, -2, -13, -3, -13, -5, -13,
- -8, -13, -13, -13, -17, -13, -21, -13, 0, -17,
- 1, -17, 2, -17, 3, -17, 5, -17, 8, -17,
- 13, -17, 21, -17, -1, -17, -2, -17, -3, -17,
- -5, -17, -8, -17, -13, -17, -17, -17, -21, -17,
- 0, -21, 1, -21, 2, -21, 3, -21, 5, -21,
- 8, -21, 13, -21, 21, -21, -1, -21, -2, -21,
- -3, -21, -5, -21, -8, -21, -13, -21, -17, -21,
- 0, 0, -8, -29, 8, -29, -18, -25, 17, -25,
- 0, -23, -6, -22, 6, -22, -13, -19, 12, -19,
- 0, -18, 25, -18, -25, -17, -5, -17, 5, -17,
- -10, -15, 10, -15, 0, -14, -4, -13, 4, -13,
- 19, -13, -19, -12, -8, -11, -2, -11, 0, -11,
- 2, -11, 8, -11, -15, -10, -4, -10, 4, -10,
- 15, -10, -6, -9, -1, -9, 1, -9, 6, -9,
- -29, -8, -11, -8, -8, -8, -3, -8, 3, -8,
- 8, -8, 11, -8, 29, -8, -5, -7, -2, -7,
- 0, -7, 2, -7, 5, -7, -22, -6, -9, -6,
- -6, -6, -3, -6, -1, -6, 1, -6, 3, -6,
- 6, -6, 9, -6, 22, -6, -17, -5, -7, -5,
- -4, -5, -2, -5, 0, -5, 2, -5, 4, -5,
- 7, -5, 17, -5, -13, -4, -10, -4, -5, -4,
- -3, -4, -1, -4, 0, -4, 1, -4, 3, -4,
- 5, -4, 10, -4, 13, -4, -8, -3, -6, -3,
- -4, -3, -3, -3, -2, -3, -1, -3, 0, -3,
- 1, -3, 2, -3, 4, -3, 6, -3, 8, -3,
- -11, -2, -7, -2, -5, -2, -3, -2, -2, -2,
- -1, -2, 0, -2, 1, -2, 2, -2, 3, -2,
- 5, -2, 7, -2, 11, -2, -9, -1, -6, -1,
- -4, -1, -3, -1, -2, -1, -1, -1, 0, -1,
- 1, -1, 2, -1, 3, -1, 4, -1, 6, -1,
- 9, -1, -31, 0, -23, 0, -18, 0, -14, 0,
- -11, 0, -7, 0, -5, 0, -4, 0, -3, 0,
- -2, 0, -1, 0, 0, -31, 1, 0, 2, 0,
- 3, 0, 4, 0, 5, 0, 7, 0, 11, 0,
- 14, 0, 18, 0, 23, 0, 31, 0, -9, 1,
- -6, 1, -4, 1, -3, 1, -2, 1, -1, 1,
- 0, 1, 1, 1, 2, 1, 3, 1, 4, 1,
- 6, 1, 9, 1, -11, 2, -7, 2, -5, 2,
- -3, 2, -2, 2, -1, 2, 0, 2, 1, 2,
- 2, 2, 3, 2, 5, 2, 7, 2, 11, 2,
- -8, 3, -6, 3, -4, 3, -2, 3, -1, 3,
- 0, 3, 1, 3, 2, 3, 3, 3, 4, 3,
- 6, 3, 8, 3, -13, 4, -10, 4, -5, 4,
- -3, 4, -1, 4, 0, 4, 1, 4, 3, 4,
- 5, 4, 10, 4, 13, 4, -17, 5, -7, 5,
- -4, 5, -2, 5, 0, 5, 2, 5, 4, 5,
- 7, 5, 17, 5, -22, 6, -9, 6, -6, 6,
- -3, 6, -1, 6, 1, 6, 3, 6, 6, 6,
- 9, 6, 22, 6, -5, 7, -2, 7, 0, 7,
- 2, 7, 5, 7, -29, 8, -11, 8, -8, 8,
- -3, 8, 3, 8, 8, 8, 11, 8, 29, 8,
- -6, 9, -1, 9, 1, 9, 6, 9, -15, 10,
- -4, 10, 4, 10, 15, 10, -8, 11, -2, 11,
- 0, 11, 2, 11, 8, 11, 19, 12, -19, 13,
- -4, 13, 4, 13, 0, 14, -10, 15, 10, 15,
- -5, 17, 5, 17, 25, 17, -25, 18, 0, 18,
- -12, 19, 13, 19, -6, 22, 6, 22, 0, 23,
- -17, 25, 18, 25, -8, 29, 8, 29, 0, 31,
- 0, 0, -6, -22, 6, -22, -13, -19, 12, -19,
- 0, -18, -5, -17, 5, -17, -10, -15, 10, -15,
- 0, -14, -4, -13, 4, -13, 19, -13, -19, -12,
- -8, -11, -2, -11, 0, -11, 2, -11, 8, -11,
- -15, -10, -4, -10, 4, -10, 15, -10, -6, -9,
- -1, -9, 1, -9, 6, -9, -11, -8, -8, -8,
- -3, -8, 0, -8, 3, -8, 8, -8, 11, -8,
- -5, -7, -2, -7, 0, -7, 2, -7, 5, -7,
- -22, -6, -9, -6, -6, -6, -3, -6, -1, -6,
- 1, -6, 3, -6, 6, -6, 9, -6, 22, -6,
- -17, -5, -7, -5, -4, -5, -2, -5, -1, -5,
- 0, -5, 1, -5, 2, -5, 4, -5, 7, -5,
- 17, -5, -13, -4, -10, -4, -5, -4, -3, -4,
- -2, -4, -1, -4, 0, -4, 1, -4, 2, -4,
- 3, -4, 5, -4, 10, -4, 13, -4, -8, -3,
- -6, -3, -4, -3, -3, -3, -2, -3, -1, -3,
- 0, -3, 1, -3, 2, -3, 3, -3, 4, -3,
- 6, -3, 8, -3, -11, -2, -7, -2, -5, -2,
- -4, -2, -3, -2, -2, -2, -1, -2, 0, -2,
- 1, -2, 2, -2, 3, -2, 4, -2, 5, -2,
- 7, -2, 11, -2, -9, -1, -6, -1, -5, -1,
- -4, -1, -3, -1, -2, -1, -1, -1, 0, -1,
- 1, -1, 2, -1, 3, -1, 4, -1, 5, -1,
- 6, -1, 9, -1, -23, 0, -18, 0, -14, 0,
- -11, 0, -7, 0, -5, 0, -4, 0, -3, 0,
- -2, 0, -1, 0, 0, -23, 1, 0, 2, 0,
- 3, 0, 4, 0, 5, 0, 7, 0, 11, 0,
- 14, 0, 18, 0, 23, 0, -9, 1, -6, 1,
- -5, 1, -4, 1, -3, 1, -2, 1, -1, 1,
- 0, 1, 1, 1, 2, 1, 3, 1, 4, 1,
- 5, 1, 6, 1, 9, 1, -11, 2, -7, 2,
- -5, 2, -4, 2, -3, 2, -2, 2, -1, 2,
- 0, 2, 1, 2, 2, 2, 3, 2, 4, 2,
- 5, 2, 7, 2, 11, 2, -8, 3, -6, 3,
- -4, 3, -3, 3, -2, 3, -1, 3, 0, 3,
- 1, 3, 2, 3, 3, 3, 4, 3, 6, 3,
- 8, 3, -13, 4, -10, 4, -5, 4, -3, 4,
- -2, 4, -1, 4, 0, 4, 1, 4, 2, 4,
- 3, 4, 5, 4, 10, 4, 13, 4, -17, 5,
- -7, 5, -4, 5, -2, 5, -1, 5, 0, 5,
- 1, 5, 2, 5, 4, 5, 7, 5, 17, 5,
- -22, 6, -9, 6, -6, 6, -3, 6, -1, 6,
- 1, 6, 3, 6, 6, 6, 9, 6, 22, 6,
- -5, 7, -2, 7, 0, 7, 2, 7, 5, 7,
- -11, 8, -8, 8, -3, 8, 0, 8, 3, 8,
- 8, 8, 11, 8, -6, 9, -1, 9, 1, 9,
- 6, 9, -15, 10, -4, 10, 4, 10, 15, 10,
- -8, 11, -2, 11, 0, 11, 2, 11, 8, 11,
- 19, 12, -19, 13, -4, 13, 4, 13, 0, 14,
- -10, 15, 10, 15, -5, 17, 5, 17, 0, 18,
- -12, 19, 13, 19, -6, 22, 6, 22, 0, 23,
-};
-#endif /* AVCODEC_SANM_DATA_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/sbrdsp.c b/chromium/third_party/ffmpeg/libavcodec/sbrdsp.c
index b4d5824e923..e4f053b1076 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sbrdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sbrdsp.c
@@ -110,6 +110,11 @@ static void sbr_qmf_deint_bfly_c(float *v, const float *src0, const float *src1)
}
}
+
+#if 0
+ /* This code is slower because it multiplies memory accesses.
+ * It is left for educational purposes and because it may offer
+ * a better reference for writing arch-specific DSP functions. */
static av_always_inline void autocorrelate(const float x[40][2],
float phi[3][2][2], int lag)
{
@@ -138,14 +143,13 @@ static av_always_inline void autocorrelate(const float x[40][2],
static void sbr_autocorrelate_c(const float x[40][2], float phi[3][2][2])
{
-#if 0
- /* This code is slower because it multiplies memory accesses.
- * It is left for educational purposes and because it may offer
- * a better reference for writing arch-specific DSP functions. */
autocorrelate(x, phi, 0);
autocorrelate(x, phi, 1);
autocorrelate(x, phi, 2);
+}
#else
+static void sbr_autocorrelate_c(const float x[40][2], float phi[3][2][2])
+{
float real_sum2 = x[0][0] * x[2][0] + x[0][1] * x[2][1];
float imag_sum2 = x[0][0] * x[2][1] - x[0][1] * x[2][0];
float real_sum1 = 0.0f, imag_sum1 = 0.0f, real_sum0 = 0.0f;
diff --git a/chromium/third_party/ffmpeg/libavcodec/sgi.h b/chromium/third_party/ffmpeg/libavcodec/sgi.h
index be17f2e2374..5ec891e4311 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sgi.h
+++ b/chromium/third_party/ffmpeg/libavcodec/sgi.h
@@ -1,4 +1,4 @@
- /*
+/*
* SGI image encoder
* Xiaohui Sun <tjnksxh@hotmail.com>
*
diff --git a/chromium/third_party/ffmpeg/libavcodec/sgidec.c b/chromium/third_party/ffmpeg/libavcodec/sgidec.c
index 35063ea53be..6f51ec35315 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sgidec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sgidec.c
@@ -27,6 +27,7 @@
#include "sgi.h"
typedef struct SgiState {
+ AVCodecContext *avctx;
unsigned int width;
unsigned int height;
unsigned int depth;
@@ -39,15 +40,16 @@ typedef struct SgiState {
* Expand an RLE row into a channel.
* @param s the current image state
* @param out_buf Points to one line after the output buffer.
- * @param out_end end of line in output buffer
+ * @param len length of out_buf in bytes
* @param pixelstride pixel stride of input buffer
* @return size of output in bytes, else return error code.
*/
-static int expand_rle_row(SgiState *s, uint8_t *out_buf,
- uint8_t *out_end, int pixelstride)
+static int expand_rle_row8(SgiState *s, uint8_t *out_buf,
+ int len, int pixelstride)
{
unsigned char pixel, count;
unsigned char *orig = out_buf;
+ uint8_t *out_end = out_buf + len;
while (out_buf < out_end) {
if (bytestream2_get_bytes_left(&s->g) < 1)
@@ -58,8 +60,10 @@ static int expand_rle_row(SgiState *s, uint8_t *out_buf,
}
/* Check for buffer overflow. */
- if (out_end - out_buf <= pixelstride * (count - 1))
+ if (out_end - out_buf <= pixelstride * (count - 1)) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n");
return AVERROR_INVALIDDATA;
+ }
if (pixel & 0x80) {
while (count--) {
@@ -78,6 +82,46 @@ static int expand_rle_row(SgiState *s, uint8_t *out_buf,
return (out_buf - orig) / pixelstride;
}
+static int expand_rle_row16(SgiState *s, uint16_t *out_buf,
+ int len, int pixelstride)
+{
+ unsigned short pixel;
+ unsigned char count;
+ unsigned short *orig = out_buf;
+ uint16_t *out_end = out_buf + len;
+
+ while (out_buf < out_end) {
+ if (bytestream2_get_bytes_left(&s->g) < 2)
+ return AVERROR_INVALIDDATA;
+ pixel = bytestream2_get_be16u(&s->g);
+ if (!(count = (pixel & 0x7f)))
+ break;
+
+ /* Check for buffer overflow. */
+ if (pixelstride * (count - 1) >= len) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (pixel & 0x80) {
+ while (count--) {
+ pixel = bytestream2_get_ne16(&s->g);
+ AV_WN16A(out_buf, pixel);
+ out_buf += pixelstride;
+ }
+ } else {
+ pixel = bytestream2_get_ne16(&s->g);
+
+ while (count--) {
+ AV_WN16A(out_buf, pixel);
+ out_buf += pixelstride;
+ }
+ }
+ }
+ return (out_buf - orig) / pixelstride;
+}
+
+
/**
* Read a run length encoded SGI image.
* @param out_buf output buffer
@@ -91,22 +135,26 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
GetByteContext g_table = s->g;
unsigned int y, z;
unsigned int start_offset;
+ int linesize, ret;
/* size of RLE offset and length tables */
- if (len * 2 > bytestream2_get_bytes_left(&s->g)) {
+ if (len * 2 > bytestream2_get_bytes_left(&s->g)) {
return AVERROR_INVALIDDATA;
}
for (z = 0; z < s->depth; z++) {
dest_row = out_buf;
for (y = 0; y < s->height; y++) {
+ linesize = s->width * s->depth * s->bytes_per_channel;
dest_row -= s->linesize;
start_offset = bytestream2_get_be32(&g_table);
bytestream2_seek(&s->g, start_offset, SEEK_SET);
- if (expand_rle_row(s, dest_row + z, dest_row + s->width*s->depth,
- s->depth) != s->width) {
+ if (s->bytes_per_channel == 1)
+ ret = expand_rle_row8(s, dest_row + z, linesize, s->depth);
+ else
+ ret = expand_rle_row16(s, (uint16_t *)dest_row + z, linesize, s->depth);
+ if (ret != s->width)
return AVERROR_INVALIDDATA;
- }
}
}
return 0;
@@ -118,7 +166,7 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
* @param s the current image state
* @return 0 if read success, else return error code.
*/
-static int read_uncompressed_sgi(unsigned char* out_buf, SgiState *s)
+static int read_uncompressed_sgi(unsigned char *out_buf, SgiState *s)
{
int x, y, z;
unsigned int offset = s->height * s->width * s->bytes_per_channel;
@@ -180,7 +228,7 @@ static int decode_frame(AVCodecContext *avctx,
s->height = bytestream2_get_be16u(&s->g);
s->depth = bytestream2_get_be16u(&s->g);
- if (s->bytes_per_channel != 1 && (s->bytes_per_channel != 2 || rle)) {
+ if (s->bytes_per_channel != 1 && s->bytes_per_channel != 2) {
av_log(avctx, AV_LOG_ERROR, "wrong channel number\n");
return AVERROR_INVALIDDATA;
}
@@ -231,6 +279,15 @@ static int decode_frame(AVCodecContext *avctx,
return avpkt->size;
}
+static av_cold int sgi_decode_init(AVCodecContext *avctx)
+{
+ SgiState *s = avctx->priv_data;
+
+ s->avctx = avctx;
+
+ return 0;
+}
+
AVCodec ff_sgi_decoder = {
.name = "sgi",
.long_name = NULL_IF_CONFIG_SMALL("SGI image"),
@@ -238,5 +295,6 @@ AVCodec ff_sgi_decoder = {
.id = AV_CODEC_ID_SGI,
.priv_data_size = sizeof(SgiState),
.decode = decode_frame,
+ .init = sgi_decode_init,
.capabilities = CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/sgienc.c b/chromium/third_party/ffmpeg/libavcodec/sgienc.c
index 0e4f304a23c..21026afcccb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sgienc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sgienc.c
@@ -31,9 +31,12 @@
static av_cold int encode_init(AVCodecContext *avctx)
{
if (avctx->width > 65535 || avctx->height > 65535) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Unsupported resolution %dx%d.\n", avctx->width, avctx->height);
av_log(avctx, AV_LOG_ERROR, "SGI does not support resolutions above 65535x65535\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
+
avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
@@ -47,7 +50,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame * const p = frame;
uint8_t *offsettab, *lengthtab, *in_buf, *encode_buf, *buf;
int x, y, z, length, tablesize, ret;
- unsigned int width, height, depth, dimension, bytes_per_channel, pixmax, put_be;
+ unsigned int width, height, depth, dimension;
+ unsigned int bytes_per_channel, pixmax, put_be;
unsigned char *end_buf;
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
@@ -132,14 +136,14 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
memset(buf, 0, SGI_HEADER_SIZE);
buf += 80;
- /* colormap */
+ /* colormap */
bytestream_put_be32(&buf, 0L);
/* The rest of the 512 byte header is unused. */
buf += 404;
offsettab = buf;
- if (avctx->coder_type != FF_CODER_TYPE_RAW) {
+ if (avctx->coder_type != FF_CODER_TYPE_RAW) {
/* Skip RLE offset table. */
buf += tablesize;
lengthtab = buf;
@@ -180,7 +184,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
for (y = 0; y < height; y++) {
for (x = 0; x < width * depth; x += depth)
if (bytes_per_channel == 1) {
- bytestream_put_byte(&buf, in_buf[x]);
+ bytestream_put_byte(&buf, in_buf[x]);
} else {
if (put_be) {
bytestream_put_be16(&buf, ((uint16_t *)in_buf)[x]);
@@ -195,7 +199,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
/* total length */
- pkt->size = buf - pkt->data;
+ pkt->size = buf - pkt->data;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
@@ -209,18 +213,18 @@ static av_cold int encode_close(AVCodecContext *avctx)
}
AVCodec ff_sgi_encoder = {
- .name = "sgi",
- .long_name = NULL_IF_CONFIG_SMALL("SGI image"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_SGI,
- .init = encode_init,
- .encode2 = encode_frame,
- .close = encode_close,
- .pix_fmts = (const enum AVPixelFormat[]){
+ .name = "sgi",
+ .long_name = NULL_IF_CONFIG_SMALL("SGI image"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_SGI,
+ .init = encode_init,
+ .encode2 = encode_frame,
+ .close = encode_close,
+ .pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE,
AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_RGBA64BE,
- AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE,
- AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
+ AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY8,
+ AV_PIX_FMT_NONE
},
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/sgirledec.c b/chromium/third_party/ffmpeg/libavcodec/sgirledec.c
index fd3cc5e78a6..5e2cd3a4d38 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sgirledec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sgirledec.c
@@ -1,5 +1,5 @@
/*
- * SGI RLE 8-bit decoder
+ * Silicon Graphics RLE 8-bit video decoder
* Copyright (c) 2012 Peter Ross
*
* This file is part of FFmpeg.
@@ -21,9 +21,13 @@
/**
* @file
- * SGI RLE 8-bit decoder
+ * Silicon Graphics RLE 8-bit video decoder
+ * @note Data is packed in rbg323 with rle, contained in mv or mov.
+ * The algorithm and pixfmt are subtly different from SGI images.
*/
+#include "libavutil/common.h"
+
#include "avcodec.h"
#include "internal.h"
@@ -42,39 +46,44 @@ static av_cold int sgirle_decode_init(AVCodecContext *avctx)
}
/**
- * Convert SGI RGB332 pixel into AV_PIX_FMT_BGR8
- * SGI RGB332 is packed RGB 3:3:2, 8bpp, (msb)3R 2B 3G(lsb)
+ * Convert SGI RBG323 pixel into AV_PIX_FMT_BGR8
+ * SGI RGB data is packed as 8bpp, (msb)3R 2B 3G(lsb)
*/
-#define RGB332_TO_BGR8(x) (((x << 3) & 0xC0) | ((x << 3) & 0x38) | ((x >> 5) & 7))
-
-static av_always_inline void memcpy_rgb332_to_bgr8(uint8_t *dst, const uint8_t *src, int size)
+#define RBG323_TO_BGR8(x) (((x << 3) & 0xC0) | \
+ ((x << 3) & 0x38) | \
+ ((x >> 5) & 7))
+static av_always_inline
+void rbg323_to_bgr8(uint8_t *dst, const uint8_t *src, int size)
{
int i;
for (i = 0; i < size; i++)
- dst[i] = RGB332_TO_BGR8(src[i]);
+ dst[i] = RBG323_TO_BGR8(src[i]);
}
/**
* @param[out] dst Destination buffer
- * @param[in] src Source buffer
+ * @param[in] src Source buffer
* @param src_size Source buffer size (bytes)
- * @param width Width of destination buffer (pixels)
- * @param height Height of destination buffer (pixels)
+ * @param width Width of destination buffer (pixels)
+ * @param height Height of destination buffer (pixels)
* @param linesize Line size of destination buffer (bytes)
+ *
* @return <0 on error
*/
-static int decode_sgirle8(AVCodecContext *avctx, uint8_t *dst, const uint8_t *src, int src_size, int width, int height, int linesize)
+static int decode_sgirle8(AVCodecContext *avctx, uint8_t *dst,
+ const uint8_t *src, int src_size,
+ int width, int height, ptrdiff_t linesize)
{
const uint8_t *src_end = src + src_size;
int x = 0, y = 0;
-#define INC_XY(n) \
- x += n; \
- if (x >= width) { \
- y++; \
- if (y >= height) \
- return 0; \
- x = 0; \
+#define INC_XY(n) \
+ x += n; \
+ if (x >= width) { \
+ y++; \
+ if (y >= height) \
+ return 0; \
+ x = 0; \
}
while (src_end - src >= 2) {
@@ -84,9 +93,9 @@ static int decode_sgirle8(AVCodecContext *avctx, uint8_t *dst, const uint8_t *sr
int length = FFMIN(v, width - x);
if (length <= 0)
break;
- memset(dst + y*linesize + x, RGB332_TO_BGR8(*src), length);
+ memset(dst + y * linesize + x, RBG323_TO_BGR8(*src), length);
INC_XY(length);
- v -= length;
+ v -= length;
} while (v > 0);
src++;
} else if (v >= 0xC1) {
@@ -95,7 +104,7 @@ static int decode_sgirle8(AVCodecContext *avctx, uint8_t *dst, const uint8_t *sr
int length = FFMIN3(v, width - x, src_end - src);
if (src_end - src < length || length <= 0)
break;
- memcpy_rgb332_to_bgr8(dst + y*linesize + x, src, length);
+ rbg323_to_bgr8(dst + y * linesize + x, src, length);
INC_XY(length);
src += length;
v -= length;
@@ -108,9 +117,8 @@ static int decode_sgirle8(AVCodecContext *avctx, uint8_t *dst, const uint8_t *sr
return 0;
}
-static int sgirle_decode_frame(AVCodecContext *avctx,
- void *data, int *got_frame,
- AVPacket *avpkt)
+static int sgirle_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
{
SGIRLEContext *s = avctx->priv_data;
int ret;
@@ -118,11 +126,12 @@ static int sgirle_decode_frame(AVCodecContext *avctx,
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return ret;
- ret = decode_sgirle8(avctx, s->frame->data[0], avpkt->data, avpkt->size, avctx->width, avctx->height, s->frame->linesize[0]);
+ ret = decode_sgirle8(avctx, s->frame->data[0], avpkt->data, avpkt->size,
+ avctx->width, avctx->height, s->frame->linesize[0]);
if (ret < 0)
return ret;
- *got_frame = 1;
+ *got_frame = 1;
if ((ret = av_frame_ref(data, s->frame)) < 0)
return ret;
@@ -140,7 +149,7 @@ static av_cold int sgirle_decode_end(AVCodecContext *avctx)
AVCodec ff_sgirle_decoder = {
.name = "sgirle",
- .long_name = NULL_IF_CONFIG_SMALL("SGI RLE 8-bit"),
+ .long_name = NULL_IF_CONFIG_SMALL("Silicon Graphics RLE 8-bit video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_SGIRLE,
.priv_data_size = sizeof(SGIRLEContext),
diff --git a/chromium/third_party/ffmpeg/libavcodec/sh4/Makefile b/chromium/third_party/ffmpeg/libavcodec/sh4/Makefile
deleted file mode 100644
index 01a573b9579..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/sh4/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-OBJS += sh4/dsputil_sh4.o \
- sh4/idct_sh4.o \
diff --git a/chromium/third_party/ffmpeg/libavcodec/sh4/README b/chromium/third_party/ffmpeg/libavcodec/sh4/README
new file mode 100644
index 00000000000..8dd61fe8756
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/sh4/README
@@ -0,0 +1,6 @@
+SH4 optimizations have been removed in
+commit d6096a67422534918405abb46dafbbac4608cbc3
+The last revission with the optimizations is cbfc9046e1c7e295b74f252902ae6f255eef4e78
+
+If you want to maintain these (or other) SH4 optimizations in ffmpeg, then please
+contact ffmpeg-devel@ffmpeg.org
diff --git a/chromium/third_party/ffmpeg/libavcodec/sh4/dsputil_sh4.c b/chromium/third_party/ffmpeg/libavcodec/sh4/dsputil_sh4.c
deleted file mode 100644
index 82b75ae6c34..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/sh4/dsputil_sh4.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * sh4 dsputil
- *
- * Copyright (c) 2003 BERO <bero@geocities.co.jp>
- *
- * 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 "libavutil/attributes.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
-#include "dsputil_sh4.h"
-#include "sh4.h"
-
-static void memzero_align8(void *dst,size_t size)
-{
- int fpscr;
- fp_single_enter(fpscr);
- dst = (char *)dst + size;
- size /= 32;
- __asm__ volatile (
- " fldi0 fr0\n"
- " fldi0 fr1\n"
- " fschg\n" // double
- "1: \n" \
- " dt %1\n"
- " fmov dr0,@-%0\n"
- " fmov dr0,@-%0\n"
- " fmov dr0,@-%0\n"
- " bf.s 1b\n"
- " fmov dr0,@-%0\n"
- " fschg" //back to single
- : "+r"(dst),"+r"(size) :: "memory" );
- fp_single_leave(fpscr);
-}
-
-static void clear_blocks_sh4(int16_t *blocks)
-{
- memzero_align8(blocks,sizeof(int16_t)*6*64);
-}
-
-static void idct_put(uint8_t *dest, int line_size, int16_t *block)
-{
- int i;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- ff_idct_sh4(block);
- for(i=0;i<8;i++) {
- dest[0] = cm[block[0]];
- dest[1] = cm[block[1]];
- dest[2] = cm[block[2]];
- dest[3] = cm[block[3]];
- dest[4] = cm[block[4]];
- dest[5] = cm[block[5]];
- dest[6] = cm[block[6]];
- dest[7] = cm[block[7]];
- dest+=line_size;
- block+=8;
- }
-}
-static void idct_add(uint8_t *dest, int line_size, int16_t *block)
-{
- int i;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- ff_idct_sh4(block);
- for(i=0;i<8;i++) {
- dest[0] = cm[dest[0]+block[0]];
- dest[1] = cm[dest[1]+block[1]];
- dest[2] = cm[dest[2]+block[2]];
- dest[3] = cm[dest[3]+block[3]];
- dest[4] = cm[dest[4]+block[4]];
- dest[5] = cm[dest[5]+block[5]];
- dest[6] = cm[dest[6]+block[6]];
- dest[7] = cm[dest[7]+block[7]];
- dest+=line_size;
- block+=8;
- }
-}
-
-av_cold void ff_dsputil_init_sh4(DSPContext *c, AVCodecContext *avctx)
-{
- const int idct_algo= avctx->idct_algo;
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
- if (!high_bit_depth)
- c->clear_blocks = clear_blocks_sh4;
- if (avctx->bits_per_raw_sample <= 8 &&
- (idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SH4)) {
- c->idct_put = idct_put;
- c->idct_add = idct_add;
- c->idct = ff_idct_sh4;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
- }
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/sh4/idct_sh4.c b/chromium/third_party/ffmpeg/libavcodec/sh4/idct_sh4.c
deleted file mode 100644
index d4e87110971..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/sh4/idct_sh4.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * idct for sh4
- *
- * Copyright (c) 2001-2003 BERO <bero@geocities.co.jp>
- *
- * 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 "dsputil_sh4.h"
-#include "sh4.h"
-
-#define c1 1.38703984532214752434 /* sqrt(2)*cos(1*pi/16) */
-#define c2 1.30656296487637657577 /* sqrt(2)*cos(2*pi/16) */
-#define c3 1.17587560241935884520 /* sqrt(2)*cos(3*pi/16) */
-#define c4 1.00000000000000000000 /* sqrt(2)*cos(4*pi/16) */
-#define c5 0.78569495838710234903 /* sqrt(2)*cos(5*pi/16) */
-#define c6 0.54119610014619712324 /* sqrt(2)*cos(6*pi/16) */
-#define c7 0.27589937928294311353 /* sqrt(2)*cos(7*pi/16) */
-
-static const float even_table[] __attribute__ ((aligned(8))) = {
- c4, c4, c4, c4,
- c2, c6,-c6,-c2,
- c4,-c4,-c4, c4,
- c6,-c2, c2,-c6
-};
-
-static const float odd_table[] __attribute__ ((aligned(8))) = {
- c1, c3, c5, c7,
- c3,-c7,-c1,-c5,
- c5,-c1, c7, c3,
- c7,-c5, c3,-c1
-};
-
-#undef c1
-#undef c2
-#undef c3
-#undef c4
-#undef c5
-#undef c6
-#undef c7
-
-#define load_matrix(table) \
- do { \
- const float *t = table; \
- __asm__ volatile( \
- " fschg\n" \
- " fmov @%0+,xd0\n" \
- " fmov @%0+,xd2\n" \
- " fmov @%0+,xd4\n" \
- " fmov @%0+,xd6\n" \
- " fmov @%0+,xd8\n" \
- " fmov @%0+,xd10\n" \
- " fmov @%0+,xd12\n" \
- " fmov @%0+,xd14\n" \
- " fschg\n" \
- : "+r"(t) \
- ); \
- } while (0)
-
-#define ftrv() \
- __asm__ volatile("ftrv xmtrx,fv0" \
- : "+f"(fr0),"+f"(fr1),"+f"(fr2),"+f"(fr3));
-
-#define DEFREG \
- register float fr0 __asm__("fr0"); \
- register float fr1 __asm__("fr1"); \
- register float fr2 __asm__("fr2"); \
- register float fr3 __asm__("fr3")
-
-#define DESCALE(x,n) (x)*(1.0f/(1<<(n)))
-
-/* this code work worse on gcc cvs. 3.2.3 work fine */
-
-
-//optimized
-
-void ff_idct_sh4(int16_t *block)
-{
- DEFREG;
-
- int i;
- float tblock[8*8],*fblock;
- int ofs1,ofs2,ofs3;
- int fpscr;
-
- fp_single_enter(fpscr);
-
- /* row */
-
- /* even part */
- load_matrix(even_table);
-
- fblock = tblock+4;
- i = 8;
- do {
- fr0 = block[0];
- fr1 = block[2];
- fr2 = block[4];
- fr3 = block[6];
- block+=8;
- ftrv();
- *--fblock = fr3;
- *--fblock = fr2;
- *--fblock = fr1;
- *--fblock = fr0;
- fblock+=8+4;
- } while(--i);
- block-=8*8;
- fblock-=8*8+4;
-
- load_matrix(odd_table);
-
- i = 8;
-
- do {
- float t0,t1,t2,t3;
- fr0 = block[1];
- fr1 = block[3];
- fr2 = block[5];
- fr3 = block[7];
- block+=8;
- ftrv();
- t0 = *fblock++;
- t1 = *fblock++;
- t2 = *fblock++;
- t3 = *fblock++;
- fblock+=4;
- *--fblock = t0 - fr0;
- *--fblock = t1 - fr1;
- *--fblock = t2 - fr2;
- *--fblock = t3 - fr3;
- *--fblock = t3 + fr3;
- *--fblock = t2 + fr2;
- *--fblock = t1 + fr1;
- *--fblock = t0 + fr0;
- fblock+=8;
- } while(--i);
- block-=8*8;
- fblock-=8*8;
-
- /* col */
-
- /* even part */
- load_matrix(even_table);
-
- ofs1 = sizeof(float)*2*8;
- ofs2 = sizeof(float)*4*8;
- ofs3 = sizeof(float)*6*8;
-
- i = 8;
-
-#define OA(fblock,ofs) *(float*)((char*)fblock + ofs)
-
- do {
- fr0 = OA(fblock, 0);
- fr1 = OA(fblock,ofs1);
- fr2 = OA(fblock,ofs2);
- fr3 = OA(fblock,ofs3);
- ftrv();
- OA(fblock,0 ) = fr0;
- OA(fblock,ofs1) = fr1;
- OA(fblock,ofs2) = fr2;
- OA(fblock,ofs3) = fr3;
- fblock++;
- } while(--i);
- fblock-=8;
-
- load_matrix(odd_table);
-
- i=8;
- do {
- float t0,t1,t2,t3;
- t0 = OA(fblock, 0); /* [8*0] */
- t1 = OA(fblock,ofs1); /* [8*2] */
- t2 = OA(fblock,ofs2); /* [8*4] */
- t3 = OA(fblock,ofs3); /* [8*6] */
- fblock+=8;
- fr0 = OA(fblock, 0); /* [8*1] */
- fr1 = OA(fblock,ofs1); /* [8*3] */
- fr2 = OA(fblock,ofs2); /* [8*5] */
- fr3 = OA(fblock,ofs3); /* [8*7] */
- fblock+=-8+1;
- ftrv();
- block[8*0] = DESCALE(t0 + fr0,3);
- block[8*7] = DESCALE(t0 - fr0,3);
- block[8*1] = DESCALE(t1 + fr1,3);
- block[8*6] = DESCALE(t1 - fr1,3);
- block[8*2] = DESCALE(t2 + fr2,3);
- block[8*5] = DESCALE(t2 - fr2,3);
- block[8*3] = DESCALE(t3 + fr3,3);
- block[8*4] = DESCALE(t3 - fr3,3);
- block++;
- } while(--i);
-
- fp_single_leave(fpscr);
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/sh4/sh4.h b/chromium/third_party/ffmpeg/libavcodec/sh4/sh4.h
deleted file mode 100644
index 5d46540cb62..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/sh4/sh4.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2008 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
- */
-
-#ifndef AVCODEC_SH4_SH4_H
-#define AVCODEC_SH4_SH4_H
-
-#ifdef __SH4__
-# define fp_single_enter(fpscr) \
- do { \
- __asm__ volatile ("sts fpscr, %0 \n\t" \
- "and %1, %0 \n\t" \
- "lds %0, fpscr \n\t" \
- : "=&r"(fpscr) : "r"(~(1<<19))); \
- } while (0)
-
-# define fp_single_leave(fpscr) \
- do { \
- __asm__ volatile ("or %1, %0 \n\t" \
- "lds %0, fpscr \n\t" \
- : "+r"(fpscr) : "r"(1<<19)); \
- } while (0)
-#else
-# define fp_single_enter(fpscr) ((void)fpscr)
-# define fp_single_leave(fpscr)
-#endif
-
-#endif /* AVCODEC_SH4_SH4_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/shorten.c b/chromium/third_party/ffmpeg/libavcodec/shorten.c
index 2bd35d22d04..5c4bf816b9e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/shorten.c
+++ b/chromium/third_party/ffmpeg/libavcodec/shorten.c
@@ -432,6 +432,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
return AVERROR(ENOMEM);
}
+ memset(tmp_ptr, 0, s->allocated_bitstream_size);
s->bitstream = tmp_ptr;
}
@@ -504,9 +505,16 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
while (len--)
get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
break;
- case FN_BITSHIFT:
- s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
+ case FN_BITSHIFT: {
+ unsigned bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
+ if (bitshift > 31) {
+ av_log(avctx, AV_LOG_ERROR, "bitshift %d is invalid\n",
+ bitshift);
+ return AVERROR_PATCHWELCOME;
+ }
+ s->bitshift = bitshift;
break;
+ }
case FN_BLOCKSIZE: {
unsigned blocksize = get_uint(s, av_log2(s->blocksize));
if (blocksize > s->blocksize) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/simple_idct.c b/chromium/third_party/ffmpeg/libavcodec/simple_idct.c
index 73f62b40215..eeb627999c0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/simple_idct.c
+++ b/chromium/third_party/ffmpeg/libavcodec/simple_idct.c
@@ -232,6 +232,8 @@ void ff_prores_idct(int16_t *block, const int16_t *qmat)
for (i = 0; i < 8; i++)
idctRowCondDC_10(block + i*8, 2);
- for (i = 0; i < 8; i++)
+ for (i = 0; i < 8; i++) {
+ block[i] += 8192;
idctSparseCol_10(block + i);
+ }
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/simple_idct_template.c b/chromium/third_party/ffmpeg/libavcodec/simple_idct_template.c
index 64a7be02c54..95844a2f33c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/simple_idct_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/simple_idct_template.c
@@ -30,6 +30,8 @@
written by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>)
*/
+#include "simple_idct.h"
+
#include "bit_depth_template.c"
#undef W1
@@ -65,13 +67,13 @@
#elif BIT_DEPTH == 10 || BIT_DEPTH == 12
#if BIT_DEPTH == 10
-#define W1 90901
-#define W2 85627
-#define W3 77062
-#define W4 65535
-#define W5 51491
-#define W6 35468
-#define W7 18081
+#define W1 (22725*4) // 90901
+#define W2 (21407*4) // 85627
+#define W3 (19265*4) // 77062
+#define W4 (16384*4) // 65535
+#define W5 (12873*4) // 51491
+#define W6 ( 8867*4) // 35468
+#define W7 ( 4520*4) // 18081
#define ROW_SHIFT 15
#define COL_SHIFT 20
@@ -107,10 +109,10 @@ static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift)
#define ROW0_MASK (0xffffLL << 48 * HAVE_BIGENDIAN)
if (((((uint64_t *)row)[0] & ~ROW0_MASK) | ((uint64_t *)row)[1]) == 0) {
uint64_t temp;
- if (DC_SHIFT - extra_shift > 0) {
+ if (DC_SHIFT - extra_shift >= 0) {
temp = (row[0] << (DC_SHIFT - extra_shift)) & 0xffff;
} else {
- temp = (row[0] >> (extra_shift - DC_SHIFT)) & 0xffff;
+ temp = ((row[0] + (1<<(extra_shift - DC_SHIFT-1))) >> (extra_shift - DC_SHIFT)) & 0xffff;
}
temp += temp << 16;
temp += temp << 32;
@@ -124,10 +126,10 @@ static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift)
((uint32_t*)row)[3] |
row[1])) {
uint32_t temp;
- if (DC_SHIFT - extra_shift > 0) {
+ if (DC_SHIFT - extra_shift >= 0) {
temp = (row[0] << (DC_SHIFT - extra_shift)) & 0xffff;
} else {
- temp = (row[0] >> (extra_shift - DC_SHIFT)) & 0xffff;
+ temp = ((row[0] + (1<<(extra_shift - DC_SHIFT-1))) >> (extra_shift - DC_SHIFT)) & 0xffff;
}
temp += temp << 16;
((uint32_t*)row)[0]=((uint32_t*)row)[1] =
@@ -136,7 +138,7 @@ static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift)
}
#endif
- a0 = (W4 * row[0]) + (1 << (ROW_SHIFT - 1));
+ a0 = (W4 * row[0]) + (1 << (ROW_SHIFT + extra_shift - 1));
a1 = a0;
a2 = a0;
a3 = a0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/smacker.c b/chromium/third_party/ffmpeg/libavcodec/smacker.c
index 717e9ea033f..644beb34da0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/smacker.c
+++ b/chromium/third_party/ffmpeg/libavcodec/smacker.c
@@ -271,7 +271,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
huff.length = ((size + 3) >> 2) + 4;
huff.maxlength = 0;
huff.current = 0;
- huff.values = av_mallocz(huff.length * sizeof(int));
+ huff.values = av_mallocz_array(huff.length, sizeof(int));
if (!huff.values) {
err = AVERROR(ENOMEM);
goto error;
@@ -662,7 +662,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "channels mismatch\n");
return AVERROR(EINVAL);
}
- if (bits && avctx->sample_fmt == AV_SAMPLE_FMT_U8) {
+ if (bits == (avctx->sample_fmt == AV_SAMPLE_FMT_U8)) {
av_log(avctx, AV_LOG_ERROR, "sample format mismatch\n");
return AVERROR(EINVAL);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/smvjpegdec.c b/chromium/third_party/ffmpeg/libavcodec/smvjpegdec.c
index f883ecf80ac..e546c3e49c9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/smvjpegdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/smvjpegdec.c
@@ -153,8 +153,11 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_siz
/* We shouldn't get here if frames_per_jpeg <= 0 because this was rejected
in init */
- avcodec_set_dimensions(avctx, mjpeg_data->width,
- mjpeg_data->height / s->frames_per_jpeg);
+ ret = ff_set_dimensions(avctx, mjpeg_data->width, mjpeg_data->height / s->frames_per_jpeg);
+ if (ret < 0) {
+ av_log(s, AV_LOG_ERROR, "Failed to set dimensions\n");
+ return ret;
+ }
if (*data_size) {
s->picture[1]->extended_data = NULL;
diff --git a/chromium/third_party/ffmpeg/libavcodec/snow.c b/chromium/third_party/ffmpeg/libavcodec/snow.c
index c645b120fbf..3961e678703 100644
--- a/chromium/third_party/ffmpeg/libavcodec/snow.c
+++ b/chromium/third_party/ffmpeg/libavcodec/snow.c
@@ -88,7 +88,7 @@ int ff_snow_alloc_blocks(SnowContext *s){
s->b_height= h;
av_free(s->block);
- s->block= av_mallocz(w * h * sizeof(BlockNode) << (s->block_max_depth*2));
+ s->block= av_mallocz_array(w * h, sizeof(BlockNode) << (s->block_max_depth*2));
if (!s->block)
return AVERROR(ENOMEM);
@@ -455,11 +455,11 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){
width= s->avctx->width;
height= s->avctx->height;
- FF_ALLOCZ_OR_GOTO(avctx, s->spatial_idwt_buffer, width * height * sizeof(IDWTELEM), fail);
- FF_ALLOCZ_OR_GOTO(avctx, s->spatial_dwt_buffer, width * height * sizeof(DWTELEM), fail); //FIXME this does not belong here
- FF_ALLOCZ_OR_GOTO(avctx, s->temp_dwt_buffer, width * sizeof(DWTELEM), fail);
- FF_ALLOCZ_OR_GOTO(avctx, s->temp_idwt_buffer, width * sizeof(IDWTELEM), fail);
- FF_ALLOC_OR_GOTO(avctx, s->run_buffer, ((width + 1) >> 1) * ((height + 1) >> 1) * sizeof(*s->run_buffer), fail);
+ FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->spatial_idwt_buffer, width, height * sizeof(IDWTELEM), fail);
+ FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->spatial_dwt_buffer, width, height * sizeof(DWTELEM), fail); //FIXME this does not belong here
+ FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->temp_dwt_buffer, width, sizeof(DWTELEM), fail);
+ FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->temp_idwt_buffer, width, sizeof(IDWTELEM), fail);
+ FF_ALLOC_ARRAY_OR_GOTO(avctx, s->run_buffer, ((width + 1) >> 1), ((height + 1) >> 1) * sizeof(*s->run_buffer), fail);
for(i=0; i<MAX_REF_FRAMES; i++) {
for(j=0; j<MAX_REF_FRAMES; j++)
@@ -488,7 +488,7 @@ int ff_snow_common_init_after_header(AVCodecContext *avctx) {
if ((ret = ff_get_buffer(s->avctx, s->mconly_picture,
AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
- FF_ALLOCZ_OR_GOTO(avctx, s->scratchbuf, FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256)*7*MB_SIZE, fail);
+ FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->scratchbuf, FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256), 7*MB_SIZE, fail);
emu_buf_size = FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * (2 * MB_SIZE + HTAPS_MAX - 1);
FF_ALLOC_OR_GOTO(avctx, s->emu_edge_buffer, emu_buf_size, fail);
}
@@ -537,7 +537,7 @@ int ff_snow_common_init_after_header(AVCodecContext *avctx) {
b->parent= &s->plane[plane_index].band[level-1][orientation];
//FIXME avoid this realloc
av_freep(&b->x_coeff);
- b->x_coeff=av_mallocz(((b->width+1) * b->height+1)*sizeof(x_and_coeff));
+ b->x_coeff=av_mallocz_array(((b->width+1) * b->height+1), sizeof(x_and_coeff));
if (!b->x_coeff)
goto fail;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/snow.h b/chromium/third_party/ffmpeg/libavcodec/snow.h
index 1222a776de6..60b00623a0f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/snow.h
+++ b/chromium/third_party/ffmpeg/libavcodec/snow.h
@@ -318,7 +318,8 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer
if(!sliced && !offset_dst)
dst -= src_x;
src_x=0;
- }else if(src_x + b_w > w){
+ }
+ if(src_x + b_w > w){
b_w = w - src_x;
}
if(src_y<0){
@@ -327,7 +328,8 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer
if(!sliced && !offset_dst)
dst -= src_y*dst_stride;
src_y=0;
- }else if(src_y + b_h> h){
+ }
+ if(src_y + b_h> h){
b_h = h - src_y;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/snow_dwt.c b/chromium/third_party/ffmpeg/libavcodec/snow_dwt.c
index 28edf6aafb8..cd94c13309b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/snow_dwt.c
+++ b/chromium/third_party/ffmpeg/libavcodec/snow_dwt.c
@@ -35,17 +35,17 @@ int ff_slice_buffer_init(slice_buffer *buf, int line_count,
buf->line_count = line_count;
buf->line_width = line_width;
buf->data_count = max_allocated_lines;
- buf->line = av_mallocz(sizeof(IDWTELEM *) * line_count);
+ buf->line = av_mallocz_array(line_count, sizeof(IDWTELEM *));
if (!buf->line)
return AVERROR(ENOMEM);
- buf->data_stack = av_malloc(sizeof(IDWTELEM *) * max_allocated_lines);
+ buf->data_stack = av_malloc_array(max_allocated_lines, sizeof(IDWTELEM *));
if (!buf->data_stack) {
av_freep(&buf->line);
return AVERROR(ENOMEM);
}
for (i = 0; i < max_allocated_lines; i++) {
- buf->data_stack[i] = av_malloc(sizeof(IDWTELEM) * line_width);
+ buf->data_stack[i] = av_malloc_array(line_width, sizeof(IDWTELEM));
if (!buf->data_stack[i]) {
for (i--; i >=0; i--)
av_freep(&buf->data_stack[i]);
@@ -745,7 +745,7 @@ void ff_spatial_idwt(IDWTELEM *buffer, IDWTELEM *temp, int width, int height,
decomposition_count, y);
}
-static inline int w_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size,
+static inline int w_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size,
int w, int h, int type)
{
int s, i, j;
@@ -814,32 +814,32 @@ static inline int w_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size,
return s >> 9;
}
-static int w53_8_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int w53_8_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{
return w_c(v, pix1, pix2, line_size, 8, h, 1);
}
-static int w97_8_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int w97_8_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{
return w_c(v, pix1, pix2, line_size, 8, h, 0);
}
-static int w53_16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int w53_16_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{
return w_c(v, pix1, pix2, line_size, 16, h, 1);
}
-static int w97_16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+static int w97_16_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{
return w_c(v, pix1, pix2, line_size, 16, h, 0);
}
-int ff_w53_32_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+int ff_w53_32_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{
return w_c(v, pix1, pix2, line_size, 32, h, 1);
}
-int ff_w97_32_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
+int ff_w97_32_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{
return w_c(v, pix1, pix2, line_size, 32, h, 0);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/snow_dwt.h b/chromium/third_party/ffmpeg/libavcodec/snow_dwt.h
index 0806b389e26..e9291896729 100644
--- a/chromium/third_party/ffmpeg/libavcodec/snow_dwt.h
+++ b/chromium/third_party/ffmpeg/libavcodec/snow_dwt.h
@@ -105,8 +105,8 @@ void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride,
int src_y, int src_stride, slice_buffer *sb,
int add, uint8_t *dst8);
-int ff_w53_32_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
-int ff_w97_32_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
+int ff_w53_32_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
+int ff_w97_32_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
void ff_spatial_dwt(int *buffer, int *temp, int width, int height, int stride,
int type, int decomposition_count);
diff --git a/chromium/third_party/ffmpeg/libavcodec/snowdec.c b/chromium/third_party/ffmpeg/libavcodec/snowdec.c
index c9d40b84e34..7287a2e64c8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/snowdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/snowdec.c
@@ -262,7 +262,7 @@ static void decode_qlogs(SnowContext *s){
tmp= get_symbol(&s->c, s->header_state, 0);\
if(!(check)){\
av_log(s->avctx, AV_LOG_ERROR, "Error " #dst " is %d\n", tmp);\
- return -1;\
+ return AVERROR_INVALIDDATA;\
}\
dst= tmp;
@@ -332,7 +332,7 @@ static int decode_header(SnowContext *s){
p->diag_mc= get_rac(&s->c, s->header_state);
htaps= get_symbol(&s->c, s->header_state, 0)*2 + 2;
if((unsigned)htaps > HTAPS_MAX || htaps==0)
- return -1;
+ return AVERROR_INVALIDDATA;
p->htaps= htaps;
for(i= htaps/2; i; i--){
p->hcoeff[i]= get_symbol(&s->c, s->header_state, 0) * (1-2*(i&1));
@@ -353,12 +353,12 @@ static int decode_header(SnowContext *s){
s->spatial_decomposition_type+= get_symbol(&s->c, s->header_state, 1);
if(s->spatial_decomposition_type > 1U){
av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_type %d not supported\n", s->spatial_decomposition_type);
- return -1;
+ return AVERROR_INVALIDDATA;
}
if(FFMIN(s->avctx-> width>>s->chroma_h_shift,
s->avctx->height>>s->chroma_v_shift) >> (s->spatial_decomposition_count-1) <= 1){
av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_count %d too large for size\n", s->spatial_decomposition_count);
- return -1;
+ return AVERROR_INVALIDDATA;
}
@@ -369,7 +369,7 @@ static int decode_header(SnowContext *s){
if(s->block_max_depth > 1 || s->block_max_depth < 0){
av_log(s->avctx, AV_LOG_ERROR, "block_max_depth= %d is too large\n", s->block_max_depth);
s->block_max_depth= 0;
- return -1;
+ return AVERROR_INVALIDDATA;
}
return 0;
@@ -418,8 +418,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
s->current_picture->pict_type= AV_PICTURE_TYPE_I; //FIXME I vs. P
- if(decode_header(s)<0)
- return -1;
+ if ((res = decode_header(s)) < 0)
+ return res;
if ((res=ff_snow_common_init_after_header(avctx)) < 0)
return res;
@@ -441,11 +441,17 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
ff_snow_alloc_blocks(s);
- if(ff_snow_frame_start(s) < 0)
- return -1;
+ if((res = ff_snow_frame_start(s)) < 0)
+ return res;
//keyframe flag duplication mess FIXME
if(avctx->debug&FF_DEBUG_PICT_INFO)
- av_log(avctx, AV_LOG_ERROR, "keyframe:%d qlog:%d\n", s->keyframe, s->qlog);
+ av_log(avctx, AV_LOG_ERROR,
+ "keyframe:%d qlog:%d qbias: %d mvscale: %d "
+ "decomposition_type:%d decomposition_count:%d\n",
+ s->keyframe, s->qlog, s->qbias, s->mv_scale,
+ s->spatial_decomposition_type,
+ s->spatial_decomposition_count
+ );
if ((res = decode_blocks(s)) < 0)
return res;
@@ -562,9 +568,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
ff_snow_release_buffer(avctx);
if(!(s->avctx->debug&2048))
- av_frame_ref(picture, s->current_picture);
+ res = av_frame_ref(picture, s->current_picture);
else
- av_frame_ref(picture, s->mconly_picture);
+ res = av_frame_ref(picture, s->mconly_picture);
+
+ if (res < 0)
+ return res;
*got_frame = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/snowenc.c b/chromium/third_party/ffmpeg/libavcodec/snowenc.c
index 517728586a0..5067a363ceb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/snowenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/snowenc.c
@@ -38,12 +38,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
SnowContext *s = avctx->priv_data;
int plane_index, ret;
- if(avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){
- av_log(avctx, AV_LOG_ERROR, "This codec is under development, files encoded with it may not be decodable with future versions!!!\n"
- "Use vstrict=-2 / -strict -2 to use it anyway.\n");
- return -1;
- }
-
if(avctx->prediction_method == DWT_97
&& (avctx->flags & CODEC_FLAG_QSCALE)
&& avctx->global_quality == 0){
@@ -78,7 +72,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->m.bit_rate= avctx->bit_rate;
s->m.me.temp =
- s->m.me.scratchpad= av_mallocz((avctx->width+64)*2*16*2*sizeof(uint8_t));
+ s->m.me.scratchpad= av_mallocz_array((avctx->width+64), 2*16*2*sizeof(uint8_t));
s->m.me.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
s->m.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t));
@@ -137,8 +131,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
int i;
int size= s->b_width * s->b_height << 2*s->block_max_depth;
for(i=0; i<s->max_ref_frames; i++){
- s->ref_mvs[i]= av_mallocz(size*sizeof(int16_t[2]));
- s->ref_scores[i]= av_mallocz(size*sizeof(uint32_t));
+ s->ref_mvs[i]= av_mallocz_array(size, sizeof(int16_t[2]));
+ s->ref_scores[i]= av_mallocz_array(size, sizeof(uint32_t));
if (!s->ref_mvs[i] || !s->ref_scores[i])
return AVERROR(ENOMEM);
}
@@ -167,7 +161,7 @@ static int pix_sum(uint8_t * pix, int line_size, int w, int h)
static int pix_norm1(uint8_t * pix, int line_size, int w)
{
int s, i, j;
- uint32_t *sq = ff_squareTbl + 256;
+ uint32_t *sq = ff_square_tab + 256;
s = 0;
for (i = 0; i < w; i++) {
@@ -1502,8 +1496,8 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict)
}
/* ugly, ratecontrol just takes a sqrt again */
- coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
av_assert0(coef_sum < INT_MAX);
+ coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
if(pict->pict_type == AV_PICTURE_TYPE_I){
s->m.current_picture.mb_var_sum= coef_sum;
@@ -1549,7 +1543,7 @@ static void calculate_visual_weight(SnowContext *s, Plane *p){
}
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
- AVFrame *pict, int *got_packet)
+ const AVFrame *pict, int *got_packet)
{
SnowContext *s = avctx->priv_data;
RangeCoder * const c= &s->c;
@@ -1611,8 +1605,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
avctx->coded_frame= s->current_picture;
s->m.current_picture_ptr= &s->m.current_picture;
- s->m.last_picture.f.pts = s->m.current_picture.f.pts;
- s->m.current_picture.f.pts = pict->pts;
+ s->m.current_picture.f = s->current_picture;
+ s->m.current_picture.f->pts = pict->pts;
if(pic->pict_type == AV_PICTURE_TYPE_P){
int block_width = (width +15)>>4;
int block_height= (height+15)>>4;
@@ -1622,14 +1616,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
av_assert0(s->last_picture[0]->data[0]);
s->m.avctx= s->avctx;
- s->m.current_picture.f.data[0] = s->current_picture->data[0];
- s->m. last_picture.f.data[0] = s->last_picture[0]->data[0];
- s->m. new_picture.f.data[0] = s-> input_picture->data[0];
+ s->m. last_picture.f = s->last_picture[0];
+ s->m. new_picture.f = s->input_picture;
s->m. last_picture_ptr= &s->m. last_picture;
- s->m.linesize=
- s->m. last_picture.f.linesize[0] =
- s->m. new_picture.f.linesize[0] =
- s->m.current_picture.f.linesize[0] = stride;
+ s->m.linesize = stride;
s->m.uvlinesize= s->current_picture->linesize[1];
s->m.width = width;
s->m.height= height;
@@ -1664,10 +1654,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
redo_frame:
- if (pic->pict_type == AV_PICTURE_TYPE_I)
- s->spatial_decomposition_count= 5;
- else
- s->spatial_decomposition_count= 5;
+ s->spatial_decomposition_count= 5;
while( !(width >>(s->chroma_h_shift + s->spatial_decomposition_count))
|| !(height>>(s->chroma_v_shift + s->spatial_decomposition_count)))
@@ -1824,9 +1811,9 @@ redo_frame:
s->current_picture->quality = pict->quality;
s->m.frame_bits = 8*(s->c.bytestream - s->c.bytestream_start);
s->m.p_tex_bits = s->m.frame_bits - s->m.misc_bits - s->m.mv_bits;
- s->m.current_picture.f.display_picture_number =
- s->m.current_picture.f.coded_picture_number = avctx->frame_number;
- s->m.current_picture.f.quality = pic->quality;
+ s->m.current_picture.f->display_picture_number =
+ s->m.current_picture.f->coded_picture_number = avctx->frame_number;
+ s->m.current_picture.f->quality = pic->quality;
s->m.total_bits += 8*(s->c.bytestream - s->c.bytestream_start);
if(s->pass1_rc)
if (ff_rate_estimate_qscale(&s->m, 0) < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/sonic.c b/chromium/third_party/ffmpeg/libavcodec/sonic.c
index 31bbe46a445..a5e573a7aa4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sonic.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sonic.c
@@ -22,6 +22,8 @@
#include "get_bits.h"
#include "golomb.h"
#include "internal.h"
+#include "rangecoder.h"
+
/**
* @file
@@ -45,6 +47,8 @@
#define RIGHT_SIDE 2
typedef struct SonicContext {
+ int version;
+ int minor_version;
int lossless, decorrelation;
int num_taps, downsampling;
@@ -85,7 +89,94 @@ static inline int shift_down(int a,int b)
return (a>>b)+(a<0);
}
+static av_always_inline av_flatten void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed, uint64_t rc_stat[256][2], uint64_t rc_stat2[32][2]){
+ int i;
+
+#define put_rac(C,S,B) \
+do{\
+ if(rc_stat){\
+ rc_stat[*(S)][B]++;\
+ rc_stat2[(S)-state][B]++;\
+ }\
+ put_rac(C,S,B);\
+}while(0)
+
+ if(v){
+ const int a= FFABS(v);
+ const int e= av_log2(a);
+ put_rac(c, state+0, 0);
+ if(e<=9){
+ for(i=0; i<e; i++){
+ put_rac(c, state+1+i, 1); //1..10
+ }
+ put_rac(c, state+1+i, 0);
+
+ for(i=e-1; i>=0; i--){
+ put_rac(c, state+22+i, (a>>i)&1); //22..31
+ }
+
+ if(is_signed)
+ put_rac(c, state+11 + e, v < 0); //11..21
+ }else{
+ for(i=0; i<e; i++){
+ put_rac(c, state+1+FFMIN(i,9), 1); //1..10
+ }
+ put_rac(c, state+1+9, 0);
+
+ for(i=e-1; i>=0; i--){
+ put_rac(c, state+22+FFMIN(i,9), (a>>i)&1); //22..31
+ }
+
+ if(is_signed)
+ put_rac(c, state+11 + 10, v < 0); //11..21
+ }
+ }else{
+ put_rac(c, state+0, 1);
+ }
+#undef put_rac
+}
+
+static inline av_flatten int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
+ if(get_rac(c, state+0))
+ return 0;
+ else{
+ int i, e, a;
+ e= 0;
+ while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
+ e++;
+ }
+
+ a= 1;
+ for(i=e-1; i>=0; i--){
+ a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31
+ }
+
+ e= -(is_signed && get_rac(c, state+11 + FFMIN(e, 10))); //11..21
+ return (a^e)-e;
+ }
+}
+
#if 1
+static inline int intlist_write(RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
+{
+ int i;
+
+ for (i = 0; i < entries; i++)
+ put_symbol(c, state, buf[i], 1, NULL, NULL);
+
+ return 1;
+}
+
+static inline int intlist_read(RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
+{
+ int i;
+
+ for (i = 0; i < entries; i++)
+ buf[i] = get_symbol(c, state, 1);
+
+ return 1;
+}
+#elif 1
static inline int intlist_write(PutBitContext *pb, int *buf, int entries, int base_2_part)
{
int i;
@@ -193,7 +284,7 @@ static int intlist_write(PutBitContext *pb, int *buf, int entries, int base_2_pa
bits = av_calloc(entries*max, sizeof(*bits));
if (!bits)
{
-// av_free(copy);
+ av_free(copy);
return AVERROR(ENOMEM);
}
@@ -249,8 +340,8 @@ static int intlist_write(PutBitContext *pb, int *buf, int entries, int base_2_pa
if (buf[i])
put_bits(pb, 1, buf[i] < 0);
-// av_free(bits);
-// av_free(copy);
+ av_free(bits);
+ av_free(copy);
return 0;
}
@@ -341,7 +432,7 @@ static int intlist_read(GetBitContext *gb, int *buf, int entries, int base_2_par
pos++;
}
-// av_free(bits);
+ av_free(bits);
// read signs
for (i = 0; i < entries; i++)
@@ -499,7 +590,9 @@ static av_cold int sonic_encode_init(AVCodecContext *avctx)
{
SonicContext *s = avctx->priv_data;
PutBitContext pb;
- int i, version = 0;
+ int i;
+
+ s->version = 2;
if (avctx->channels > MAX_CHANNELS)
{
@@ -571,9 +664,13 @@ static av_cold int sonic_encode_init(AVCodecContext *avctx)
return AVERROR(ENOMEM);
init_put_bits(&pb, avctx->extradata, 16*8);
- put_bits(&pb, 2, version); // version
- if (version == 1)
+ put_bits(&pb, 2, s->version); // version
+ if (s->version >= 1)
{
+ if (s->version >= 2) {
+ put_bits(&pb, 8, s->version);
+ put_bits(&pb, 8, s->minor_version);
+ }
put_bits(&pb, 2, s->channels);
put_bits(&pb, 4, code_samplerate(s->samplerate));
}
@@ -588,8 +685,8 @@ static av_cold int sonic_encode_init(AVCodecContext *avctx)
flush_put_bits(&pb);
avctx->extradata_size = put_bits_count(&pb)/8;
- av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n",
- version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);
+ av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d.%d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n",
+ s->version, s->minor_version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);
avctx->frame_size = s->block_align*s->downsampling;
@@ -617,15 +714,18 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const AVFrame *frame, int *got_packet_ptr)
{
SonicContext *s = avctx->priv_data;
- PutBitContext pb;
+ RangeCoder c;
int i, j, ch, quant = 0, x = 0;
int ret;
const short *samples = (const int16_t*)frame->data[0];
+ uint8_t state[32];
if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size * 5 + 1000)) < 0)
return ret;
- init_put_bits(&pb, avpkt->data, avpkt->size);
+ ff_init_range_encoder(&c, avpkt->data, avpkt->size);
+ ff_build_rac_states(&c, 0.05*(1LL<<32), 256-8);
+ memset(state, 128, sizeof(state));
// short -> internal
for (i = 0; i < s->frame_size; i++)
@@ -671,7 +771,7 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
// generate taps
modified_levinson_durbin(s->window, s->window_size,
s->predictor_k, s->num_taps, s->channels, s->tap_quant);
- if ((ret = intlist_write(&pb, s->predictor_k, s->num_taps, 0)) < 0)
+ if ((ret = intlist_write(&c, state, s->predictor_k, s->num_taps, 0)) < 0)
return ret;
for (ch = 0; ch < s->channels; ch++)
@@ -701,7 +801,7 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
energy2 = sqrt(energy2/(s->channels*s->block_align));
- energy1 = sqrt(2.0)*energy1/(s->channels*s->block_align);
+ energy1 = M_SQRT2*energy1/(s->channels*s->block_align);
// increase bitrate when samples are like a gaussian distribution
// reduce bitrate when samples are like a two-tailed exponential distribution
@@ -714,7 +814,7 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
quant = av_clip(quant, 1, 65534);
- set_ue_golomb(&pb, quant);
+ put_symbol(&c, state, quant, 0, NULL, NULL);
quant *= SAMPLE_FACTOR;
}
@@ -726,16 +826,16 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
for (i = 0; i < s->block_align; i++)
s->coded_samples[ch][i] = ROUNDED_DIV(s->coded_samples[ch][i], quant);
- if ((ret = intlist_write(&pb, s->coded_samples[ch], s->block_align, 1)) < 0)
+ if ((ret = intlist_write(&c, state, s->coded_samples[ch], s->block_align, 1)) < 0)
return ret;
}
// av_log(avctx, AV_LOG_DEBUG, "used bytes: %d\n", (put_bits_count(&pb)+7)/8);
- flush_put_bits(&pb);
- avpkt->size = (put_bits_count(&pb)+7)/8;
+ avpkt->size = ff_rac_terminate(&c);
*got_packet_ptr = 1;
return 0;
+
}
#endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */
@@ -747,7 +847,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
{
SonicContext *s = avctx->priv_data;
GetBitContext gb;
- int i, version;
+ int i;
s->channels = avctx->channels;
s->samplerate = avctx->sample_rate;
@@ -760,14 +860,18 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
- version = get_bits(&gb, 2);
- if (version > 1)
+ s->version = get_bits(&gb, 2);
+ if (s->version >= 2) {
+ s->version = get_bits(&gb, 8);
+ s->minor_version = get_bits(&gb, 8);
+ }
+ if (s->version != 2)
{
av_log(avctx, AV_LOG_ERROR, "Unsupported Sonic version, please report\n");
return AVERROR_INVALIDDATA;
}
- if (version == 1)
+ if (s->version >= 1)
{
s->channels = get_bits(&gb, 2);
s->samplerate = samplerate_table[get_bits(&gb, 4)];
@@ -804,8 +908,8 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
s->frame_size = s->channels*s->block_align*s->downsampling;
// avctx->frame_size = s->block_align;
- av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n",
- version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);
+ av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d.%d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n",
+ s->version, s->minor_version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);
// generate taps
s->tap_quant = av_calloc(s->num_taps, sizeof(*s->tap_quant));
@@ -858,7 +962,8 @@ static int sonic_decode_frame(AVCodecContext *avctx,
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
SonicContext *s = avctx->priv_data;
- GetBitContext gb;
+ RangeCoder c;
+ uint8_t state[32];
int i, quant, ch, j, ret;
int16_t *samples;
AVFrame *frame = data;
@@ -872,9 +977,11 @@ static int sonic_decode_frame(AVCodecContext *avctx,
// av_log(NULL, AV_LOG_INFO, "buf_size: %d\n", buf_size);
- init_get_bits8(&gb, buf, buf_size);
+ memset(state, 128, sizeof(state));
+ ff_init_range_decoder(&c, buf, buf_size);
+ ff_build_rac_states(&c, 0.05*(1LL<<32), 256-8);
- intlist_read(&gb, s->predictor_k, s->num_taps, 0);
+ intlist_read(&c, state, s->predictor_k, s->num_taps, 0);
// dequantize
for (i = 0; i < s->num_taps; i++)
@@ -883,7 +990,7 @@ static int sonic_decode_frame(AVCodecContext *avctx,
if (s->lossless)
quant = 1;
else
- quant = get_ue_golomb(&gb) * SAMPLE_FACTOR;
+ quant = get_symbol(&c, state, 0) * SAMPLE_FACTOR;
// av_log(NULL, AV_LOG_INFO, "quant: %d\n", quant);
@@ -893,7 +1000,7 @@ static int sonic_decode_frame(AVCodecContext *avctx,
predictor_init_state(s->predictor_k, s->predictor_state[ch], s->num_taps);
- intlist_read(&gb, s->coded_samples[ch], s->block_align, 1);
+ intlist_read(&c, state, s->coded_samples[ch], s->block_align, 1);
for (i = 0; i < s->block_align; i++)
{
@@ -938,11 +1045,9 @@ static int sonic_decode_frame(AVCodecContext *avctx,
for (i = 0; i < s->frame_size; i++)
samples[i] = av_clip_int16(s->int_samples[i]);
- align_get_bits(&gb);
-
*got_frame_ptr = 1;
- return (get_bits_count(&gb)+7)/8;
+ return buf_size;
}
AVCodec ff_sonic_decoder = {
diff --git a/chromium/third_party/ffmpeg/libavcodec/sp5xdec.c b/chromium/third_party/ffmpeg/libavcodec/sp5xdec.c
index 81f3c24a099..74961984201 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sp5xdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sp5xdec.c
@@ -117,5 +117,6 @@ AVCodec ff_amv_decoder = {
.init = ff_mjpeg_decode_init,
.close = ff_mjpeg_decode_end,
.decode = sp5x_decode_frame,
+ .max_lowres = 3,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/sparc/Makefile b/chromium/third_party/ffmpeg/libavcodec/sparc/Makefile
deleted file mode 100644
index aeb0f475372..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/sparc/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-VIS-OBJS += sparc/dsputil_vis.o \
- sparc/simple_idct_vis.o \
-
-VIS-OBJS-$(CONFIG_HPELDSP) += sparc/hpeldsp_vis.o
diff --git a/chromium/third_party/ffmpeg/libavcodec/sparc/README b/chromium/third_party/ffmpeg/libavcodec/sparc/README
new file mode 100644
index 00000000000..f9f2349cd45
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/sparc/README
@@ -0,0 +1,6 @@
+SPARC optimizations have been removed in
+commit b4dd424d96f09f9bafb88e47f37df65dc4529143
+The last revission with the optimizations is fb1b70c1ed50951c5fc1a309c3c446b2eaaf564b
+
+If you want to maintain these (or other) SPARC optimizations in ffmpeg, then please
+contact ffmpeg-devel@ffmpeg.org
diff --git a/chromium/third_party/ffmpeg/libavcodec/sparc/hpeldsp_vis.c b/chromium/third_party/ffmpeg/libavcodec/sparc/hpeldsp_vis.c
deleted file mode 100644
index be2a85d8f69..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/sparc/hpeldsp_vis.c
+++ /dev/null
@@ -1,3524 +0,0 @@
-/*
- * Copyright (C) 2003 David S. Miller <davem@redhat.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
- */
-
-/* The *no_round* functions have been added by James A. Morrison, 2003,2004.
- The vis code from libmpeg2 was adapted for libavcodec by James A. Morrison.
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/mem.h"
-#include "libavcodec/hpeldsp.h"
-#include "vis.h"
-
-/* The trick used in some of this file is the formula from the MMX
- * motion comp code, which is:
- *
- * (x+y+1)>>1 == (x|y)-((x^y)>>1)
- *
- * This allows us to average 8 bytes at a time in a 64-bit FPU reg.
- * We avoid overflows by masking before we do the shift, and we
- * implement the shift by multiplying by 1/2 using mul8x16. So in
- * VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask
- * of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and
- * the value 0x80808080 is in f8):
- *
- * fxor f0, f2, f10
- * fand f10, f4, f10
- * fmul8x16 f8, f10, f10
- * fand f10, f6, f10
- * for f0, f2, f12
- * fpsub16 f12, f10, f10
- */
-
-#define DUP4(x) {x, x, x, x}
-#define DUP8(x) {x, x, x, x, x, x, x, x}
-DECLARE_ALIGNED(8, static const int16_t, constants1)[] = DUP4 (1);
-DECLARE_ALIGNED(8, static const int16_t, constants2)[] = DUP4 (2);
-DECLARE_ALIGNED(8, static const int16_t, constants3)[] = DUP4 (3);
-DECLARE_ALIGNED(8, static const int16_t, constants6)[] = DUP4 (6);
-DECLARE_ALIGNED(8, static const int8_t, constants_fe)[] = DUP8 (0xfe);
-DECLARE_ALIGNED(8, static const int8_t, constants_7f)[] = DUP8 (0x7f);
-DECLARE_ALIGNED(8, static const int8_t, constants128)[] = DUP8 (128);
-DECLARE_ALIGNED(8, static const int16_t, constants256_512)[] =
- {256, 512, 256, 512};
-DECLARE_ALIGNED(8, static const int16_t, constants256_1024)[] =
- {256, 1024, 256, 1024};
-
-#define REF_0 0
-#define REF_0_1 1
-#define REF_2 2
-#define REF_2_1 3
-#define REF_4 4
-#define REF_4_1 5
-#define REF_6 6
-#define REF_6_1 7
-#define REF_S0 8
-#define REF_S0_1 9
-#define REF_S2 10
-#define REF_S2_1 11
-#define REF_S4 12
-#define REF_S4_1 13
-#define REF_S6 14
-#define REF_S6_1 15
-#define DST_0 16
-#define DST_1 17
-#define DST_2 18
-#define DST_3 19
-#define CONST_1 20
-#define CONST_2 20
-#define CONST_3 20
-#define CONST_6 20
-#define MASK_fe 20
-#define CONST_128 22
-#define CONST_256 22
-#define CONST_512 22
-#define CONST_1024 22
-#define TMP0 24
-#define TMP1 25
-#define TMP2 26
-#define TMP3 27
-#define TMP4 28
-#define TMP5 29
-#define ZERO 30
-#define MASK_7f 30
-
-#define TMP6 32
-#define TMP8 34
-#define TMP10 36
-#define TMP12 38
-#define TMP14 40
-#define TMP16 42
-#define TMP18 44
-#define TMP20 46
-#define TMP22 48
-#define TMP24 50
-#define TMP26 52
-#define TMP28 54
-#define TMP30 56
-#define TMP32 58
-
-static void MC_put_o_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- ref = vis_alignaddr(ref);
- do { /* 5 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_st64(REF_0, dest[0]);
-
- vis_faligndata(TMP2, TMP4, REF_2);
- vis_st64_2(REF_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_o_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- ref = vis_alignaddr(ref);
- do { /* 4 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
- ref += stride;
-
- /* stall */
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_st64(REF_0, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-
-static void MC_avg_o_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- int stride_8 = stride + 8;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(dest[0], DST_0);
-
- vis_ld64(dest[8], DST_2);
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP2, TMP4, REF_2);
-
- vis_ld64(constants128[0], CONST_128);
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 24 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_xor(DST_2, REF_2, TMP8);
-
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_or(DST_0, REF_0, TMP10);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP8, TMP8);
-
- vis_or(DST_2, REF_2, TMP12);
- vis_ld64_2(dest, stride_8, DST_2);
-
- vis_ld64(ref[0], TMP14);
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-
- dest += stride;
- vis_ld64_2(ref, 8, TMP16);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 16, TMP18);
- vis_faligndata(TMP2, TMP4, REF_2);
- ref += stride;
-
- vis_xor(DST_0, REF_0, TMP20);
-
- vis_and(TMP20, MASK_fe, TMP20);
-
- vis_xor(DST_2, REF_2, TMP22);
- vis_mul8x16(CONST_128, TMP20, TMP20);
-
- vis_and(TMP22, MASK_fe, TMP22);
-
- vis_or(DST_0, REF_0, TMP24);
- vis_mul8x16(CONST_128, TMP22, TMP22);
-
- vis_or(DST_2, REF_2, TMP26);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_faligndata(TMP14, TMP16, REF_0);
-
- vis_ld64_2(dest, stride_8, DST_2);
- vis_faligndata(TMP16, TMP18, REF_2);
-
- vis_and(TMP20, MASK_7f, TMP20);
-
- vis_and(TMP22, MASK_7f, TMP22);
-
- vis_psub16(TMP24, TMP20, TMP20);
- vis_st64(TMP20, dest[0]);
-
- vis_psub16(TMP26, TMP22, TMP22);
- vis_st64_2(TMP22, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_xor(DST_2, REF_2, TMP8);
-
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_or(DST_0, REF_0, TMP10);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP8, TMP8);
-
- vis_or(DST_2, REF_2, TMP12);
- vis_ld64_2(dest, stride_8, DST_2);
-
- vis_ld64(ref[0], TMP14);
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-
- dest += stride;
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_2);
-
- vis_xor(DST_0, REF_0, TMP20);
-
- vis_and(TMP20, MASK_fe, TMP20);
-
- vis_xor(DST_2, REF_2, TMP22);
- vis_mul8x16(CONST_128, TMP20, TMP20);
-
- vis_and(TMP22, MASK_fe, TMP22);
-
- vis_or(DST_0, REF_0, TMP24);
- vis_mul8x16(CONST_128, TMP22, TMP22);
-
- vis_or(DST_2, REF_2, TMP26);
-
- vis_and(TMP20, MASK_7f, TMP20);
-
- vis_and(TMP22, MASK_7f, TMP22);
-
- vis_psub16(TMP24, TMP20, TMP20);
- vis_st64(TMP20, dest[0]);
-
- vis_psub16(TMP26, TMP22, TMP22);
- vis_st64_2(TMP22, dest, 8);
-}
-
-static void MC_avg_o_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(dest[0], DST_0);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants128[0], CONST_128);
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 12 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP4);
-
- vis_ld64(ref[8], TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_or(DST_0, REF_0, TMP6);
- vis_ld64_2(dest, stride, DST_0);
- ref += stride;
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_ld64(ref[0], TMP12);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(ref[8], TMP2);
- vis_xor(DST_0, REF_0, TMP0);
- ref += stride;
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_psub16(TMP6, TMP4, TMP4);
- vis_st64(TMP4, dest[0]);
- dest += stride;
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_or(DST_0, REF_0, TMP6);
- vis_ld64_2(dest, stride, DST_0);
-
- vis_faligndata(TMP12, TMP2, REF_0);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_psub16(TMP6, TMP0, TMP4);
- vis_st64(TMP4, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP4);
-
- vis_ld64(ref[8], TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_or(DST_0, REF_0, TMP6);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_xor(DST_0, REF_0, TMP0);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_psub16(TMP6, TMP4, TMP4);
- vis_st64(TMP4, dest[0]);
- dest += stride;
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_or(DST_0, REF_0, TMP6);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_psub16(TMP6, TMP0, TMP4);
- vis_st64(TMP4, dest[0]);
-}
-
-static void MC_put_x_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants128[0], CONST_128);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 34 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_and(TMP6, MASK_fe, TMP6);
- ref += stride;
-
- vis_ld64(ref[0], TMP14);
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_ld64_2(ref, 8, TMP16);
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_or(REF_0, REF_2, TMP10);
-
- vis_ld64_2(ref, 16, TMP18);
- ref += stride;
- vis_or(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_or(REF_0, REF_2, TMP10);
-
- vis_or(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP14, TMP16, REF_0);
-
- vis_faligndata(TMP16, TMP18, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP14, TMP16, REF_2);
- vis_faligndata(TMP16, TMP18, REF_6);
- } else {
- vis_src1(TMP16, REF_2);
- vis_src1(TMP18, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_or(REF_0, REF_2, TMP10);
-
- vis_or(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_or(REF_0, REF_2, TMP10);
-
- vis_or(REF_4, REF_6, TMP12);
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-}
-
-static void MC_put_x_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
-
- vis_ld64(constants128[0], CONST_128);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 20 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
- ref += stride;
-
- vis_ld64(ref[0], TMP8);
- vis_or(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, 8, TMP10);
- ref += stride;
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_psub16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_or(REF_0, REF_2, TMP14);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_alignaddr_g0((void *)off);
- vis_faligndata(TMP8, TMP10, REF_0);
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP8, TMP10, REF_2);
- } else {
- vis_src1(TMP10, REF_2);
- }
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_psub16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_or(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_psub16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_or(REF_0, REF_2, TMP14);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_psub16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-}
-
-static void MC_avg_x_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- vis_ld64(constants3[0], CONST_3);
- vis_fzero(ZERO);
- vis_ld64(constants256_512[0], CONST_256);
-
- ref = vis_alignaddr(ref);
- do { /* 26 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(dest[8], DST_2);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_mul8x16au(REF_0, CONST_256, TMP0);
-
- vis_pmerge(ZERO, REF_2, TMP4);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_mul8x16al(DST_0, CONST_512, TMP4);
- vis_padd16(TMP2, TMP6, TMP2);
-
- vis_mul8x16al(DST_1, CONST_512, TMP6);
-
- vis_mul8x16au(REF_6, CONST_256, TMP12);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_6_1, CONST_256, TMP14);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4, CONST_256, TMP16);
-
- vis_padd16(TMP0, CONST_3, TMP8);
- vis_mul8x16au(REF_4_1, CONST_256, TMP18);
-
- vis_padd16(TMP2, CONST_3, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_padd16(TMP16, TMP12, TMP0);
-
- vis_st64(DST_0, dest[0]);
- vis_mul8x16al(DST_2, CONST_512, TMP4);
- vis_padd16(TMP18, TMP14, TMP2);
-
- vis_mul8x16al(DST_3, CONST_512, TMP6);
- vis_padd16(TMP0, CONST_3, TMP0);
-
- vis_padd16(TMP2, CONST_3, TMP2);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64(DST_2, dest[8]);
-
- ref += stride;
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_x_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_times_2 = stride << 1;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- vis_ld64(constants3[0], CONST_3);
- vis_fzero(ZERO);
- vis_ld64(constants256_512[0], CONST_256);
-
- ref = vis_alignaddr(ref);
- height >>= 2;
- do { /* 47 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64(ref[0], TMP4);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 8, TMP6);
- ref += stride;
-
- vis_ld64(ref[0], TMP8);
-
- vis_ld64_2(ref, 8, TMP10);
- ref += stride;
- vis_faligndata(TMP4, TMP6, REF_4);
-
- vis_ld64(ref[0], TMP12);
-
- vis_ld64_2(ref, 8, TMP14);
- ref += stride;
- vis_faligndata(TMP8, TMP10, REF_S0);
-
- vis_faligndata(TMP12, TMP14, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_ld64_2(dest, stride, DST_2);
- vis_faligndata(TMP4, TMP6, REF_6);
-
- vis_faligndata(TMP8, TMP10, REF_S2);
-
- vis_faligndata(TMP12, TMP14, REF_S6);
- } else {
- vis_ld64(dest[0], DST_0);
- vis_src1(TMP2, REF_2);
-
- vis_ld64_2(dest, stride, DST_2);
- vis_src1(TMP6, REF_6);
-
- vis_src1(TMP10, REF_S2);
-
- vis_src1(TMP14, REF_S6);
- }
-
- vis_pmerge(ZERO, REF_0, TMP0);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_pmerge(ZERO, REF_2, TMP4);
- vis_mul8x16au(REF_2_1, CONST_256, TMP6);
-
- vis_padd16(TMP0, CONST_3, TMP0);
- vis_mul8x16al(DST_0, CONST_512, TMP16);
-
- vis_padd16(TMP2, CONST_3, TMP2);
- vis_mul8x16al(DST_1, CONST_512, TMP18);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_4, CONST_256, TMP8);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP10);
-
- vis_padd16(TMP0, TMP16, TMP0);
- vis_mul8x16au(REF_6, CONST_256, TMP12);
-
- vis_padd16(TMP2, TMP18, TMP2);
- vis_mul8x16au(REF_6_1, CONST_256, TMP14);
-
- vis_padd16(TMP8, CONST_3, TMP8);
- vis_mul8x16al(DST_2, CONST_512, TMP16);
-
- vis_padd16(TMP8, TMP12, TMP8);
- vis_mul8x16al(DST_3, CONST_512, TMP18);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_pack16(TMP0, DST_0);
-
- vis_pack16(TMP2, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- vis_padd16(TMP10, CONST_3, TMP10);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_padd16(TMP8, TMP16, TMP8);
-
- vis_ld64_2(dest, stride_times_2, TMP4/*DST_2*/);
- vis_padd16(TMP10, TMP18, TMP10);
- vis_pack16(TMP8, DST_2);
-
- vis_pack16(TMP10, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
-
- vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
- vis_pmerge(ZERO, REF_S0, TMP0);
-
- vis_pmerge(ZERO, REF_S2, TMP24);
- vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
-
- vis_padd16(TMP0, CONST_3, TMP0);
- vis_mul8x16au(REF_S4, CONST_256, TMP8);
-
- vis_padd16(TMP2, CONST_3, TMP2);
- vis_mul8x16au(REF_S4_1, CONST_256, TMP10);
-
- vis_padd16(TMP0, TMP24, TMP0);
- vis_mul8x16au(REF_S6, CONST_256, TMP12);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_S6_1, CONST_256, TMP14);
-
- vis_padd16(TMP8, CONST_3, TMP8);
- vis_mul8x16al(DST_0, CONST_512, TMP16);
-
- vis_padd16(TMP10, CONST_3, TMP10);
- vis_mul8x16al(DST_1, CONST_512, TMP18);
-
- vis_padd16(TMP8, TMP12, TMP8);
- vis_mul8x16al(TMP4/*DST_2*/, CONST_512, TMP20);
-
- vis_mul8x16al(TMP5/*DST_3*/, CONST_512, TMP22);
- vis_padd16(TMP0, TMP16, TMP0);
-
- vis_padd16(TMP2, TMP18, TMP2);
- vis_pack16(TMP0, DST_0);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_pack16(TMP2, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_padd16(TMP8, TMP20, TMP8);
-
- vis_padd16(TMP10, TMP22, TMP10);
- vis_pack16(TMP8, DST_2);
-
- vis_pack16(TMP10, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_y_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- ref = vis_alignaddr(ref);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
-
- vis_ld64(ref[0], TMP6);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 8, TMP8);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64_2(ref, 16, TMP10);
- ref += stride;
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP6, TMP8, REF_2);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP8, TMP10, REF_6);
-
- vis_ld64(constants128[0], CONST_128);
- height = (height >> 1) - 1;
- do { /* 24 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP16);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
- vis_or(REF_0, REF_2, TMP14);
-
- vis_ld64(ref[0], TMP6);
- vis_or(REF_4, REF_6, TMP18);
-
- vis_ld64_2(ref, 8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(TMP16, MASK_fe, TMP16);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_mul8x16(CONST_128, TMP16, TMP16);
- vis_xor(REF_0, REF_2, TMP0);
-
- vis_xor(REF_4, REF_6, TMP2);
-
- vis_or(REF_0, REF_2, TMP20);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_and(TMP16, MASK_7f, TMP16);
-
- vis_psub16(TMP14, TMP12, TMP12);
- vis_st64(TMP12, dest[0]);
-
- vis_psub16(TMP18, TMP16, TMP16);
- vis_st64_2(TMP16, dest, 8);
- dest += stride;
-
- vis_or(REF_4, REF_6, TMP18);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP2, MASK_fe, TMP2);
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_faligndata(TMP6, TMP8, REF_2);
- vis_mul8x16(CONST_128, TMP2, TMP2);
-
- vis_faligndata(TMP8, TMP10, REF_6);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_and(TMP2, MASK_7f, TMP2);
-
- vis_psub16(TMP20, TMP0, TMP0);
- vis_st64(TMP0, dest[0]);
-
- vis_psub16(TMP18, TMP2, TMP2);
- vis_st64_2(TMP2, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP16);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_or(REF_0, REF_2, TMP14);
-
- vis_or(REF_4, REF_6, TMP18);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(TMP16, MASK_fe, TMP16);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_mul8x16(CONST_128, TMP16, TMP16);
- vis_xor(REF_0, REF_2, TMP0);
-
- vis_xor(REF_4, REF_6, TMP2);
-
- vis_or(REF_0, REF_2, TMP20);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_and(TMP16, MASK_7f, TMP16);
-
- vis_psub16(TMP14, TMP12, TMP12);
- vis_st64(TMP12, dest[0]);
-
- vis_psub16(TMP18, TMP16, TMP16);
- vis_st64_2(TMP16, dest, 8);
- dest += stride;
-
- vis_or(REF_4, REF_6, TMP18);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP2, MASK_fe, TMP2);
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_mul8x16(CONST_128, TMP2, TMP2);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_and(TMP2, MASK_7f, TMP2);
-
- vis_psub16(TMP20, TMP0, TMP0);
- vis_st64(TMP0, dest[0]);
-
- vis_psub16(TMP18, TMP2, TMP2);
- vis_st64_2(TMP2, dest, 8);
-}
-
-static void MC_put_y_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- ref = vis_alignaddr(ref);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
-
- vis_ld64(ref[0], TMP4);
-
- vis_ld64_2(ref, 8, TMP6);
- ref += stride;
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP4, TMP6, REF_2);
-
- vis_ld64(constants128[0], CONST_128);
- height = (height >> 1) - 1;
- do { /* 12 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_or(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_mul8x16(CONST_128, TMP12, TMP12);
- vis_or(REF_0, REF_2, TMP14);
-
- vis_psub16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_psub16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_or(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_mul8x16(CONST_128, TMP12, TMP12);
- vis_or(REF_0, REF_2, TMP14);
-
- vis_psub16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_psub16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
-}
-
-static void MC_avg_y_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants3[0], CONST_3);
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_6);
- height >>= 1;
-
- do { /* 31 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_pmerge(ZERO, REF_2, TMP12);
- vis_mul8x16au(REF_2_1, CONST_256, TMP14);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_pmerge(ZERO, REF_6, TMP16);
- vis_mul8x16au(REF_6_1, CONST_256, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(dest, 8, DST_2);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_pmerge(ZERO, REF_0, TMP0);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_pmerge(ZERO, REF_4, TMP4);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
-
- vis_ld64_2(dest, stride, REF_S0/*DST_4*/);
- vis_faligndata(TMP6, TMP8, REF_2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
- vis_ld64_2(dest, stride_8, REF_S2/*DST_6*/);
- vis_faligndata(TMP8, TMP10, REF_6);
- vis_mul8x16al(DST_0, CONST_512, TMP20);
-
- vis_padd16(TMP0, CONST_3, TMP0);
- vis_mul8x16al(DST_1, CONST_512, TMP22);
-
- vis_padd16(TMP2, CONST_3, TMP2);
- vis_mul8x16al(DST_2, CONST_512, TMP24);
-
- vis_padd16(TMP4, CONST_3, TMP4);
- vis_mul8x16al(DST_3, CONST_512, TMP26);
-
- vis_padd16(TMP6, CONST_3, TMP6);
-
- vis_padd16(TMP12, TMP20, TMP12);
- vis_mul8x16al(REF_S0, CONST_512, TMP20);
-
- vis_padd16(TMP14, TMP22, TMP14);
- vis_mul8x16al(REF_S0_1, CONST_512, TMP22);
-
- vis_padd16(TMP16, TMP24, TMP16);
- vis_mul8x16al(REF_S2, CONST_512, TMP24);
-
- vis_padd16(TMP18, TMP26, TMP18);
- vis_mul8x16al(REF_S2_1, CONST_512, TMP26);
-
- vis_padd16(TMP12, TMP0, TMP12);
- vis_mul8x16au(REF_2, CONST_256, TMP28);
-
- vis_padd16(TMP14, TMP2, TMP14);
- vis_mul8x16au(REF_2_1, CONST_256, TMP30);
-
- vis_padd16(TMP16, TMP4, TMP16);
- vis_mul8x16au(REF_6, CONST_256, REF_S4);
-
- vis_padd16(TMP18, TMP6, TMP18);
- vis_mul8x16au(REF_6_1, CONST_256, REF_S6);
-
- vis_pack16(TMP12, DST_0);
- vis_padd16(TMP28, TMP0, TMP12);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP30, TMP2, TMP14);
-
- vis_pack16(TMP16, DST_2);
- vis_padd16(REF_S4, TMP4, TMP16);
-
- vis_pack16(TMP18, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- vis_padd16(REF_S6, TMP6, TMP18);
-
- vis_padd16(TMP12, TMP20, TMP12);
-
- vis_padd16(TMP14, TMP22, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_padd16(TMP16, TMP24, TMP16);
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
-
- vis_padd16(TMP18, TMP26, TMP18);
- vis_pack16(TMP16, DST_2);
-
- vis_pack16(TMP18, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_y_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- int stride_8 = stride + 8;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(constants3[0], CONST_3);
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_ld64(constants256_512[0], CONST_256);
-
- height >>= 1;
- do { /* 20 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_pmerge(ZERO, REF_2, TMP8);
- vis_mul8x16au(REF_2_1, CONST_256, TMP10);
-
- vis_ld64_2(ref, stride_8, TMP2);
- ref += stride;
-
- vis_ld64(dest[0], DST_0);
-
- vis_ld64_2(dest, stride, DST_2);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride, TMP4);
- vis_mul8x16al(DST_0, CONST_512, TMP16);
- vis_pmerge(ZERO, REF_0, TMP12);
-
- vis_ld64_2(ref, stride_8, TMP6);
- ref += stride;
- vis_mul8x16al(DST_1, CONST_512, TMP18);
- vis_pmerge(ZERO, REF_0_1, TMP14);
-
- vis_padd16(TMP12, CONST_3, TMP12);
- vis_mul8x16al(DST_2, CONST_512, TMP24);
-
- vis_padd16(TMP14, CONST_3, TMP14);
- vis_mul8x16al(DST_3, CONST_512, TMP26);
-
- vis_faligndata(TMP4, TMP6, REF_2);
-
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_mul8x16au(REF_2, CONST_256, TMP20);
-
- vis_padd16(TMP8, TMP16, TMP0);
- vis_mul8x16au(REF_2_1, CONST_256, TMP22);
-
- vis_padd16(TMP10, TMP18, TMP2);
- vis_pack16(TMP0, DST_0);
-
- vis_pack16(TMP2, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- vis_padd16(TMP12, TMP20, TMP12);
-
- vis_padd16(TMP14, TMP22, TMP14);
-
- vis_padd16(TMP12, TMP24, TMP0);
-
- vis_padd16(TMP14, TMP26, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_xy_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants2[0], CONST_2);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- vis_faligndata(TMP2, TMP4, REF_S6);
- } else {
- vis_src1(TMP2, REF_S2);
- vis_src1(TMP4, REF_S6);
- }
-
- height >>= 1;
- do {
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S0_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_mul8x16au(REF_S2, CONST_256, TMP16);
- vis_pmerge(ZERO, REF_S2_1, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
- vis_mul8x16au(REF_S4, CONST_256, TMP20);
- vis_pmerge(ZERO, REF_S4_1, TMP22);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_mul8x16au(REF_S6, CONST_256, TMP24);
- vis_pmerge(ZERO, REF_S6_1, TMP26);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_faligndata(TMP6, TMP8, REF_S0);
-
- vis_faligndata(TMP8, TMP10, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- vis_faligndata(TMP6, TMP8, REF_S2);
- vis_faligndata(TMP8, TMP10, REF_S6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- vis_src1(TMP8, REF_S2);
- vis_src1(TMP10, REF_S6);
- }
-
- vis_mul8x16au(REF_0, CONST_256, TMP0);
- vis_pmerge(ZERO, REF_0_1, TMP2);
-
- vis_mul8x16au(REF_2, CONST_256, TMP4);
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_padd16(TMP0, CONST_2, TMP8);
- vis_mul8x16au(REF_4, CONST_256, TMP0);
-
- vis_padd16(TMP2, CONST_2, TMP10);
- vis_mul8x16au(REF_4_1, CONST_256, TMP2);
-
- vis_padd16(TMP8, TMP4, TMP8);
- vis_mul8x16au(REF_6, CONST_256, TMP4);
-
- vis_padd16(TMP10, TMP6, TMP10);
- vis_mul8x16au(REF_6_1, CONST_256, TMP6);
-
- vis_padd16(TMP12, TMP8, TMP12);
-
- vis_padd16(TMP14, TMP10, TMP14);
-
- vis_padd16(TMP12, TMP16, TMP12);
-
- vis_padd16(TMP14, TMP18, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP0, CONST_2, TMP12);
-
- vis_mul8x16au(REF_S0, CONST_256, TMP0);
- vis_padd16(TMP2, CONST_2, TMP14);
-
- vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
- vis_padd16(TMP12, TMP4, TMP12);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP4);
- vis_padd16(TMP14, TMP6, TMP14);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
- vis_padd16(TMP20, TMP12, TMP20);
-
- vis_padd16(TMP22, TMP14, TMP22);
-
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP22, TMP26, TMP22);
- vis_pack16(TMP20, DST_2);
-
- vis_pack16(TMP22, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- vis_padd16(TMP0, TMP4, TMP24);
-
- vis_mul8x16au(REF_S4, CONST_256, TMP0);
- vis_padd16(TMP2, TMP6, TMP26);
-
- vis_mul8x16au(REF_S4_1, CONST_256, TMP2);
- vis_padd16(TMP24, TMP8, TMP24);
-
- vis_padd16(TMP26, TMP10, TMP26);
- vis_pack16(TMP24, DST_0);
-
- vis_pack16(TMP26, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_pmerge(ZERO, REF_S6, TMP4);
-
- vis_pmerge(ZERO, REF_S6_1, TMP6);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_padd16(TMP2, TMP6, TMP2);
-
- vis_padd16(TMP0, TMP12, TMP0);
-
- vis_padd16(TMP2, TMP14, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_xy_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(constants2[0], CONST_2);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- } else {
- vis_src1(TMP2, REF_S2);
- }
-
- height >>= 1;
- do { /* 26 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP8);
- vis_pmerge(ZERO, REF_S2, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- ref += stride;
- vis_mul8x16au(REF_S0_1, CONST_256, TMP10);
- vis_pmerge(ZERO, REF_S2_1, TMP14);
-
- vis_ld64_2(ref, stride, TMP4);
-
- vis_ld64_2(ref, stride_8, TMP6);
- ref += stride;
- vis_faligndata(TMP0, TMP2, REF_S4);
-
- vis_pmerge(ZERO, REF_S4, TMP18);
-
- vis_pmerge(ZERO, REF_S4_1, TMP20);
-
- vis_faligndata(TMP4, TMP6, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S6);
- vis_faligndata(TMP4, TMP6, REF_S2);
- } else {
- vis_src1(TMP2, REF_S6);
- vis_src1(TMP6, REF_S2);
- }
-
- vis_padd16(TMP18, CONST_2, TMP18);
- vis_mul8x16au(REF_S6, CONST_256, TMP22);
-
- vis_padd16(TMP20, CONST_2, TMP20);
- vis_mul8x16au(REF_S6_1, CONST_256, TMP24);
-
- vis_mul8x16au(REF_S0, CONST_256, TMP26);
- vis_pmerge(ZERO, REF_S0_1, TMP28);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP30);
- vis_padd16(TMP18, TMP22, TMP18);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP32);
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP8, TMP18, TMP8);
-
- vis_padd16(TMP10, TMP20, TMP10);
-
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- vis_padd16(TMP18, TMP26, TMP18);
-
- vis_padd16(TMP20, TMP28, TMP20);
-
- vis_padd16(TMP18, TMP30, TMP18);
-
- vis_padd16(TMP20, TMP32, TMP20);
- vis_pack16(TMP18, DST_2);
-
- vis_pack16(TMP20, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_xy_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants6[0], CONST_6);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- vis_ld64(constants256_1024[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- vis_faligndata(TMP2, TMP4, REF_S6);
- } else {
- vis_src1(TMP2, REF_S2);
- vis_src1(TMP4, REF_S6);
- }
-
- height >>= 1;
- do { /* 55 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S0_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_mul8x16au(REF_S2, CONST_256, TMP16);
- vis_pmerge(ZERO, REF_S2_1, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
- vis_mul8x16au(REF_S4, CONST_256, TMP20);
- vis_pmerge(ZERO, REF_S4_1, TMP22);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_mul8x16au(REF_S6, CONST_256, TMP24);
- vis_pmerge(ZERO, REF_S6_1, TMP26);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP6, TMP8, REF_S0);
-
- vis_ld64_2(dest, 8, DST_2);
- vis_faligndata(TMP8, TMP10, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- vis_faligndata(TMP6, TMP8, REF_S2);
- vis_faligndata(TMP8, TMP10, REF_S6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- vis_src1(TMP8, REF_S2);
- vis_src1(TMP10, REF_S6);
- }
-
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_0, TMP0);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_pmerge(ZERO, REF_0_1, TMP2);
-
- vis_mul8x16au(REF_2, CONST_256, TMP4);
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_mul8x16al(DST_2, CONST_1024, REF_0);
- vis_padd16(TMP0, CONST_6, TMP0);
-
- vis_mul8x16al(DST_3, CONST_1024, REF_2);
- vis_padd16(TMP2, CONST_6, TMP2);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_4, CONST_256, TMP4);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
- vis_padd16(TMP12, TMP0, TMP12);
- vis_mul8x16au(REF_6, CONST_256, TMP8);
-
- vis_padd16(TMP14, TMP2, TMP14);
- vis_mul8x16au(REF_6_1, CONST_256, TMP10);
-
- vis_padd16(TMP12, TMP16, TMP12);
- vis_mul8x16au(REF_S0, CONST_256, REF_4);
-
- vis_padd16(TMP14, TMP18, TMP14);
- vis_mul8x16au(REF_S0_1, CONST_256, REF_6);
-
- vis_padd16(TMP12, TMP30, TMP12);
-
- vis_padd16(TMP14, TMP32, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP4, CONST_6, TMP4);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_padd16(TMP6, CONST_6, TMP6);
- vis_mul8x16au(REF_S2, CONST_256, TMP12);
-
- vis_padd16(TMP4, TMP8, TMP4);
- vis_mul8x16au(REF_S2_1, CONST_256, TMP14);
-
- vis_padd16(TMP6, TMP10, TMP6);
-
- vis_padd16(TMP20, TMP4, TMP20);
-
- vis_padd16(TMP22, TMP6, TMP22);
-
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP22, TMP26, TMP22);
-
- vis_padd16(TMP20, REF_0, TMP20);
- vis_mul8x16au(REF_S4, CONST_256, REF_0);
-
- vis_padd16(TMP22, REF_2, TMP22);
- vis_pack16(TMP20, DST_2);
-
- vis_pack16(TMP22, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
-
- vis_ld64_2(dest, 8, DST_2);
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_S4_1, REF_2);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_padd16(REF_4, TMP0, TMP8);
-
- vis_mul8x16au(REF_S6, CONST_256, REF_4);
- vis_padd16(REF_6, TMP2, TMP10);
-
- vis_mul8x16au(REF_S6_1, CONST_256, REF_6);
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
-
- vis_padd16(TMP8, TMP30, TMP8);
-
- vis_padd16(TMP10, TMP32, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
-
- vis_padd16(REF_0, TMP4, REF_0);
-
- vis_mul8x16al(DST_2, CONST_1024, TMP30);
- vis_padd16(REF_2, TMP6, REF_2);
-
- vis_mul8x16al(DST_3, CONST_1024, TMP32);
- vis_padd16(REF_0, REF_4, REF_0);
-
- vis_padd16(REF_2, REF_6, REF_2);
-
- vis_padd16(REF_0, TMP30, REF_0);
-
- /* stall */
-
- vis_padd16(REF_2, TMP32, REF_2);
- vis_pack16(REF_0, DST_2);
-
- vis_pack16(REF_2, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_xy_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
-
- vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64(constants6[0], CONST_6);
-
- vis_ld64(constants256_1024[0], CONST_256);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- } else {
- vis_src1(TMP2, REF_S2);
- }
-
- height >>= 1;
- do { /* 31 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP8);
- vis_pmerge(ZERO, REF_S0_1, TMP10);
-
- vis_ld64_2(ref, stride_8, TMP2);
- ref += stride;
- vis_mul8x16au(REF_S2, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S2_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride, TMP4);
- vis_faligndata(TMP0, TMP2, REF_S4);
-
- vis_ld64_2(ref, stride_8, TMP6);
- ref += stride;
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP4, TMP6, REF_S0);
-
- vis_ld64_2(dest, stride, DST_2);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S6);
- vis_faligndata(TMP4, TMP6, REF_S2);
- } else {
- vis_src1(TMP2, REF_S6);
- vis_src1(TMP6, REF_S2);
- }
-
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_S4, TMP22);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_pmerge(ZERO, REF_S4_1, TMP24);
-
- vis_mul8x16au(REF_S6, CONST_256, TMP26);
- vis_pmerge(ZERO, REF_S6_1, TMP28);
-
- vis_mul8x16au(REF_S0, CONST_256, REF_S4);
- vis_padd16(TMP22, CONST_6, TMP22);
-
- vis_mul8x16au(REF_S0_1, CONST_256, REF_S6);
- vis_padd16(TMP24, CONST_6, TMP24);
-
- vis_mul8x16al(DST_2, CONST_1024, REF_0);
- vis_padd16(TMP22, TMP26, TMP22);
-
- vis_mul8x16al(DST_3, CONST_1024, REF_2);
- vis_padd16(TMP24, TMP28, TMP24);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP26);
- vis_padd16(TMP8, TMP22, TMP8);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP28);
- vis_padd16(TMP10, TMP24, TMP10);
-
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
-
- vis_padd16(TMP8, TMP30, TMP8);
-
- vis_padd16(TMP10, TMP32, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_padd16(REF_S4, TMP22, TMP12);
-
- vis_padd16(REF_S6, TMP24, TMP14);
-
- vis_padd16(TMP12, TMP26, TMP12);
-
- vis_padd16(TMP14, TMP28, TMP14);
-
- vis_padd16(TMP12, REF_0, TMP12);
-
- vis_padd16(TMP14, REF_2, TMP14);
- vis_pack16(TMP12, DST_2);
-
- vis_pack16(TMP14, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-/* End of rounding code */
-
-/* Start of no rounding code */
-/* The trick used in some of this file is the formula from the MMX
- * motion comp code, which is:
- *
- * (x+y)>>1 == (x&y)+((x^y)>>1)
- *
- * This allows us to average 8 bytes at a time in a 64-bit FPU reg.
- * We avoid overflows by masking before we do the shift, and we
- * implement the shift by multiplying by 1/2 using mul8x16. So in
- * VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask
- * of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and
- * the value 0x80808080 is in f8):
- *
- * fxor f0, f2, f10
- * fand f10, f4, f10
- * fmul8x16 f8, f10, f10
- * fand f10, f6, f10
- * fand f0, f2, f12
- * fpadd16 f12, f10, f10
- */
-
-static void MC_put_no_round_o_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- ref = vis_alignaddr(ref);
- do { /* 5 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_st64(REF_0, dest[0]);
-
- vis_faligndata(TMP2, TMP4, REF_2);
- vis_st64_2(REF_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_no_round_o_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- ref = vis_alignaddr(ref);
- do { /* 4 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
- ref += stride;
-
- /* stall */
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_st64(REF_0, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-
-static void MC_avg_no_round_o_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- int stride_8 = stride + 8;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(dest[0], DST_0);
-
- vis_ld64(dest[8], DST_2);
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP2, TMP4, REF_2);
-
- vis_ld64(constants128[0], CONST_128);
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 24 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_xor(DST_2, REF_2, TMP8);
-
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_and(DST_0, REF_0, TMP10);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP8, TMP8);
-
- vis_and(DST_2, REF_2, TMP12);
- vis_ld64_2(dest, stride_8, DST_2);
-
- vis_ld64(ref[0], TMP14);
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-
- dest += stride;
- vis_ld64_2(ref, 8, TMP16);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 16, TMP18);
- vis_faligndata(TMP2, TMP4, REF_2);
- ref += stride;
-
- vis_xor(DST_0, REF_0, TMP20);
-
- vis_and(TMP20, MASK_fe, TMP20);
-
- vis_xor(DST_2, REF_2, TMP22);
- vis_mul8x16(CONST_128, TMP20, TMP20);
-
- vis_and(TMP22, MASK_fe, TMP22);
-
- vis_and(DST_0, REF_0, TMP24);
- vis_mul8x16(CONST_128, TMP22, TMP22);
-
- vis_and(DST_2, REF_2, TMP26);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_faligndata(TMP14, TMP16, REF_0);
-
- vis_ld64_2(dest, stride_8, DST_2);
- vis_faligndata(TMP16, TMP18, REF_2);
-
- vis_and(TMP20, MASK_7f, TMP20);
-
- vis_and(TMP22, MASK_7f, TMP22);
-
- vis_padd16(TMP24, TMP20, TMP20);
- vis_st64(TMP20, dest[0]);
-
- vis_padd16(TMP26, TMP22, TMP22);
- vis_st64_2(TMP22, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_xor(DST_2, REF_2, TMP8);
-
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_and(DST_0, REF_0, TMP10);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP8, TMP8);
-
- vis_and(DST_2, REF_2, TMP12);
- vis_ld64_2(dest, stride_8, DST_2);
-
- vis_ld64(ref[0], TMP14);
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-
- dest += stride;
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_2);
-
- vis_xor(DST_0, REF_0, TMP20);
-
- vis_and(TMP20, MASK_fe, TMP20);
-
- vis_xor(DST_2, REF_2, TMP22);
- vis_mul8x16(CONST_128, TMP20, TMP20);
-
- vis_and(TMP22, MASK_fe, TMP22);
-
- vis_and(DST_0, REF_0, TMP24);
- vis_mul8x16(CONST_128, TMP22, TMP22);
-
- vis_and(DST_2, REF_2, TMP26);
-
- vis_and(TMP20, MASK_7f, TMP20);
-
- vis_and(TMP22, MASK_7f, TMP22);
-
- vis_padd16(TMP24, TMP20, TMP20);
- vis_st64(TMP20, dest[0]);
-
- vis_padd16(TMP26, TMP22, TMP22);
- vis_st64_2(TMP22, dest, 8);
-}
-
-static void MC_put_no_round_x_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants128[0], CONST_128);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 34 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_and(TMP6, MASK_fe, TMP6);
- ref += stride;
-
- vis_ld64(ref[0], TMP14);
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_ld64_2(ref, 8, TMP16);
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_and(REF_0, REF_2, TMP10);
-
- vis_ld64_2(ref, 16, TMP18);
- ref += stride;
- vis_and(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_and(REF_0, REF_2, TMP10);
-
- vis_and(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP14, TMP16, REF_0);
-
- vis_faligndata(TMP16, TMP18, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP14, TMP16, REF_2);
- vis_faligndata(TMP16, TMP18, REF_6);
- } else {
- vis_src1(TMP16, REF_2);
- vis_src1(TMP18, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_and(REF_0, REF_2, TMP10);
-
- vis_and(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_and(REF_0, REF_2, TMP10);
-
- vis_and(REF_4, REF_6, TMP12);
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-}
-
-static void MC_put_no_round_x_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
-
- vis_ld64(constants128[0], CONST_128);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 20 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
- ref += stride;
-
- vis_ld64(ref[0], TMP8);
- vis_and(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, 8, TMP10);
- ref += stride;
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_padd16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(REF_0, REF_2, TMP14);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_alignaddr_g0((void *)off);
- vis_faligndata(TMP8, TMP10, REF_0);
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP8, TMP10, REF_2);
- } else {
- vis_src1(TMP10, REF_2);
- }
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_padd16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_and(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_padd16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(REF_0, REF_2, TMP14);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_padd16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-}
-
-static void MC_avg_no_round_x_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- vis_ld64(constants3[0], CONST_3);
- vis_fzero(ZERO);
- vis_ld64(constants256_512[0], CONST_256);
-
- ref = vis_alignaddr(ref);
- do { /* 26 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(dest[8], DST_2);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_mul8x16au(REF_0, CONST_256, TMP0);
-
- vis_pmerge(ZERO, REF_2, TMP4);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_mul8x16al(DST_0, CONST_512, TMP4);
- vis_padd16(TMP2, TMP6, TMP2);
-
- vis_mul8x16al(DST_1, CONST_512, TMP6);
-
- vis_mul8x16au(REF_6, CONST_256, TMP12);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_6_1, CONST_256, TMP14);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4, CONST_256, TMP16);
-
- vis_padd16(TMP0, CONST_3, TMP8);
- vis_mul8x16au(REF_4_1, CONST_256, TMP18);
-
- vis_padd16(TMP2, CONST_3, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_padd16(TMP16, TMP12, TMP0);
-
- vis_st64(DST_0, dest[0]);
- vis_mul8x16al(DST_2, CONST_512, TMP4);
- vis_padd16(TMP18, TMP14, TMP2);
-
- vis_mul8x16al(DST_3, CONST_512, TMP6);
- vis_padd16(TMP0, CONST_3, TMP0);
-
- vis_padd16(TMP2, CONST_3, TMP2);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64(DST_2, dest[8]);
-
- ref += stride;
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_no_round_y_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- ref = vis_alignaddr(ref);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
-
- vis_ld64(ref[0], TMP6);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 8, TMP8);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64_2(ref, 16, TMP10);
- ref += stride;
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP6, TMP8, REF_2);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP8, TMP10, REF_6);
-
- vis_ld64(constants128[0], CONST_128);
- height = (height >> 1) - 1;
- do { /* 24 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP16);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
- vis_and(REF_0, REF_2, TMP14);
-
- vis_ld64(ref[0], TMP6);
- vis_and(REF_4, REF_6, TMP18);
-
- vis_ld64_2(ref, 8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(TMP16, MASK_fe, TMP16);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_mul8x16(CONST_128, TMP16, TMP16);
- vis_xor(REF_0, REF_2, TMP0);
-
- vis_xor(REF_4, REF_6, TMP2);
-
- vis_and(REF_0, REF_2, TMP20);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_and(TMP16, MASK_7f, TMP16);
-
- vis_padd16(TMP14, TMP12, TMP12);
- vis_st64(TMP12, dest[0]);
-
- vis_padd16(TMP18, TMP16, TMP16);
- vis_st64_2(TMP16, dest, 8);
- dest += stride;
-
- vis_and(REF_4, REF_6, TMP18);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP2, MASK_fe, TMP2);
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_faligndata(TMP6, TMP8, REF_2);
- vis_mul8x16(CONST_128, TMP2, TMP2);
-
- vis_faligndata(TMP8, TMP10, REF_6);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_and(TMP2, MASK_7f, TMP2);
-
- vis_padd16(TMP20, TMP0, TMP0);
- vis_st64(TMP0, dest[0]);
-
- vis_padd16(TMP18, TMP2, TMP2);
- vis_st64_2(TMP2, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP16);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_and(REF_0, REF_2, TMP14);
-
- vis_and(REF_4, REF_6, TMP18);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(TMP16, MASK_fe, TMP16);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_mul8x16(CONST_128, TMP16, TMP16);
- vis_xor(REF_0, REF_2, TMP0);
-
- vis_xor(REF_4, REF_6, TMP2);
-
- vis_and(REF_0, REF_2, TMP20);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_and(TMP16, MASK_7f, TMP16);
-
- vis_padd16(TMP14, TMP12, TMP12);
- vis_st64(TMP12, dest[0]);
-
- vis_padd16(TMP18, TMP16, TMP16);
- vis_st64_2(TMP16, dest, 8);
- dest += stride;
-
- vis_and(REF_4, REF_6, TMP18);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP2, MASK_fe, TMP2);
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_mul8x16(CONST_128, TMP2, TMP2);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_and(TMP2, MASK_7f, TMP2);
-
- vis_padd16(TMP20, TMP0, TMP0);
- vis_st64(TMP0, dest[0]);
-
- vis_padd16(TMP18, TMP2, TMP2);
- vis_st64_2(TMP2, dest, 8);
-}
-
-static void MC_put_no_round_y_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- ref = vis_alignaddr(ref);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
-
- vis_ld64(ref[0], TMP4);
-
- vis_ld64_2(ref, 8, TMP6);
- ref += stride;
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP4, TMP6, REF_2);
-
- vis_ld64(constants128[0], CONST_128);
- height = (height >> 1) - 1;
- do { /* 12 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_and(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_mul8x16(CONST_128, TMP12, TMP12);
- vis_and(REF_0, REF_2, TMP14);
-
- vis_padd16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_padd16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_and(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_mul8x16(CONST_128, TMP12, TMP12);
- vis_and(REF_0, REF_2, TMP14);
-
- vis_padd16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_padd16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
-}
-
-static void MC_avg_no_round_y_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants3[0], CONST_3);
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_6);
- height >>= 1;
-
- do { /* 31 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_pmerge(ZERO, REF_2, TMP12);
- vis_mul8x16au(REF_2_1, CONST_256, TMP14);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_pmerge(ZERO, REF_6, TMP16);
- vis_mul8x16au(REF_6_1, CONST_256, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(dest, 8, DST_2);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_pmerge(ZERO, REF_0, TMP0);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_pmerge(ZERO, REF_4, TMP4);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
-
- vis_ld64_2(dest, stride, REF_S0/*DST_4*/);
- vis_faligndata(TMP6, TMP8, REF_2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
- vis_ld64_2(dest, stride_8, REF_S2/*DST_6*/);
- vis_faligndata(TMP8, TMP10, REF_6);
- vis_mul8x16al(DST_0, CONST_512, TMP20);
-
- vis_padd16(TMP0, CONST_3, TMP0);
- vis_mul8x16al(DST_1, CONST_512, TMP22);
-
- vis_padd16(TMP2, CONST_3, TMP2);
- vis_mul8x16al(DST_2, CONST_512, TMP24);
-
- vis_padd16(TMP4, CONST_3, TMP4);
- vis_mul8x16al(DST_3, CONST_512, TMP26);
-
- vis_padd16(TMP6, CONST_3, TMP6);
-
- vis_padd16(TMP12, TMP20, TMP12);
- vis_mul8x16al(REF_S0, CONST_512, TMP20);
-
- vis_padd16(TMP14, TMP22, TMP14);
- vis_mul8x16al(REF_S0_1, CONST_512, TMP22);
-
- vis_padd16(TMP16, TMP24, TMP16);
- vis_mul8x16al(REF_S2, CONST_512, TMP24);
-
- vis_padd16(TMP18, TMP26, TMP18);
- vis_mul8x16al(REF_S2_1, CONST_512, TMP26);
-
- vis_padd16(TMP12, TMP0, TMP12);
- vis_mul8x16au(REF_2, CONST_256, TMP28);
-
- vis_padd16(TMP14, TMP2, TMP14);
- vis_mul8x16au(REF_2_1, CONST_256, TMP30);
-
- vis_padd16(TMP16, TMP4, TMP16);
- vis_mul8x16au(REF_6, CONST_256, REF_S4);
-
- vis_padd16(TMP18, TMP6, TMP18);
- vis_mul8x16au(REF_6_1, CONST_256, REF_S6);
-
- vis_pack16(TMP12, DST_0);
- vis_padd16(TMP28, TMP0, TMP12);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP30, TMP2, TMP14);
-
- vis_pack16(TMP16, DST_2);
- vis_padd16(REF_S4, TMP4, TMP16);
-
- vis_pack16(TMP18, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- vis_padd16(REF_S6, TMP6, TMP18);
-
- vis_padd16(TMP12, TMP20, TMP12);
-
- vis_padd16(TMP14, TMP22, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_padd16(TMP16, TMP24, TMP16);
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
-
- vis_padd16(TMP18, TMP26, TMP18);
- vis_pack16(TMP16, DST_2);
-
- vis_pack16(TMP18, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_no_round_xy_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants1[0], CONST_1);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- vis_faligndata(TMP2, TMP4, REF_S6);
- } else {
- vis_src1(TMP2, REF_S2);
- vis_src1(TMP4, REF_S6);
- }
-
- height >>= 1;
- do {
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S0_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_mul8x16au(REF_S2, CONST_256, TMP16);
- vis_pmerge(ZERO, REF_S2_1, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
- vis_mul8x16au(REF_S4, CONST_256, TMP20);
- vis_pmerge(ZERO, REF_S4_1, TMP22);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_mul8x16au(REF_S6, CONST_256, TMP24);
- vis_pmerge(ZERO, REF_S6_1, TMP26);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_faligndata(TMP6, TMP8, REF_S0);
-
- vis_faligndata(TMP8, TMP10, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- vis_faligndata(TMP6, TMP8, REF_S2);
- vis_faligndata(TMP8, TMP10, REF_S6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- vis_src1(TMP8, REF_S2);
- vis_src1(TMP10, REF_S6);
- }
-
- vis_mul8x16au(REF_0, CONST_256, TMP0);
- vis_pmerge(ZERO, REF_0_1, TMP2);
-
- vis_mul8x16au(REF_2, CONST_256, TMP4);
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_padd16(TMP0, CONST_2, TMP8);
- vis_mul8x16au(REF_4, CONST_256, TMP0);
-
- vis_padd16(TMP2, CONST_1, TMP10);
- vis_mul8x16au(REF_4_1, CONST_256, TMP2);
-
- vis_padd16(TMP8, TMP4, TMP8);
- vis_mul8x16au(REF_6, CONST_256, TMP4);
-
- vis_padd16(TMP10, TMP6, TMP10);
- vis_mul8x16au(REF_6_1, CONST_256, TMP6);
-
- vis_padd16(TMP12, TMP8, TMP12);
-
- vis_padd16(TMP14, TMP10, TMP14);
-
- vis_padd16(TMP12, TMP16, TMP12);
-
- vis_padd16(TMP14, TMP18, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP0, CONST_1, TMP12);
-
- vis_mul8x16au(REF_S0, CONST_256, TMP0);
- vis_padd16(TMP2, CONST_1, TMP14);
-
- vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
- vis_padd16(TMP12, TMP4, TMP12);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP4);
- vis_padd16(TMP14, TMP6, TMP14);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
- vis_padd16(TMP20, TMP12, TMP20);
-
- vis_padd16(TMP22, TMP14, TMP22);
-
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP22, TMP26, TMP22);
- vis_pack16(TMP20, DST_2);
-
- vis_pack16(TMP22, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- vis_padd16(TMP0, TMP4, TMP24);
-
- vis_mul8x16au(REF_S4, CONST_256, TMP0);
- vis_padd16(TMP2, TMP6, TMP26);
-
- vis_mul8x16au(REF_S4_1, CONST_256, TMP2);
- vis_padd16(TMP24, TMP8, TMP24);
-
- vis_padd16(TMP26, TMP10, TMP26);
- vis_pack16(TMP24, DST_0);
-
- vis_pack16(TMP26, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_pmerge(ZERO, REF_S6, TMP4);
-
- vis_pmerge(ZERO, REF_S6_1, TMP6);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_padd16(TMP2, TMP6, TMP2);
-
- vis_padd16(TMP0, TMP12, TMP0);
-
- vis_padd16(TMP2, TMP14, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_no_round_xy_8_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(constants1[0], CONST_1);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- } else {
- vis_src1(TMP2, REF_S2);
- }
-
- height >>= 1;
- do { /* 26 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP8);
- vis_pmerge(ZERO, REF_S2, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- ref += stride;
- vis_mul8x16au(REF_S0_1, CONST_256, TMP10);
- vis_pmerge(ZERO, REF_S2_1, TMP14);
-
- vis_ld64_2(ref, stride, TMP4);
-
- vis_ld64_2(ref, stride_8, TMP6);
- ref += stride;
- vis_faligndata(TMP0, TMP2, REF_S4);
-
- vis_pmerge(ZERO, REF_S4, TMP18);
-
- vis_pmerge(ZERO, REF_S4_1, TMP20);
-
- vis_faligndata(TMP4, TMP6, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S6);
- vis_faligndata(TMP4, TMP6, REF_S2);
- } else {
- vis_src1(TMP2, REF_S6);
- vis_src1(TMP6, REF_S2);
- }
-
- vis_padd16(TMP18, CONST_1, TMP18);
- vis_mul8x16au(REF_S6, CONST_256, TMP22);
-
- vis_padd16(TMP20, CONST_1, TMP20);
- vis_mul8x16au(REF_S6_1, CONST_256, TMP24);
-
- vis_mul8x16au(REF_S0, CONST_256, TMP26);
- vis_pmerge(ZERO, REF_S0_1, TMP28);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP30);
- vis_padd16(TMP18, TMP22, TMP18);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP32);
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP8, TMP18, TMP8);
-
- vis_padd16(TMP10, TMP20, TMP10);
-
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- vis_padd16(TMP18, TMP26, TMP18);
-
- vis_padd16(TMP20, TMP28, TMP20);
-
- vis_padd16(TMP18, TMP30, TMP18);
-
- vis_padd16(TMP20, TMP32, TMP20);
- vis_pack16(TMP18, DST_2);
-
- vis_pack16(TMP20, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_no_round_xy_16_vis (uint8_t * dest, const uint8_t * ref,
- const ptrdiff_t stride, int height)
-{
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants6[0], CONST_6);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- vis_ld64(constants256_1024[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- vis_faligndata(TMP2, TMP4, REF_S6);
- } else {
- vis_src1(TMP2, REF_S2);
- vis_src1(TMP4, REF_S6);
- }
-
- height >>= 1;
- do { /* 55 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S0_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_mul8x16au(REF_S2, CONST_256, TMP16);
- vis_pmerge(ZERO, REF_S2_1, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
- vis_mul8x16au(REF_S4, CONST_256, TMP20);
- vis_pmerge(ZERO, REF_S4_1, TMP22);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_mul8x16au(REF_S6, CONST_256, TMP24);
- vis_pmerge(ZERO, REF_S6_1, TMP26);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP6, TMP8, REF_S0);
-
- vis_ld64_2(dest, 8, DST_2);
- vis_faligndata(TMP8, TMP10, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- vis_faligndata(TMP6, TMP8, REF_S2);
- vis_faligndata(TMP8, TMP10, REF_S6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- vis_src1(TMP8, REF_S2);
- vis_src1(TMP10, REF_S6);
- }
-
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_0, TMP0);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_pmerge(ZERO, REF_0_1, TMP2);
-
- vis_mul8x16au(REF_2, CONST_256, TMP4);
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_mul8x16al(DST_2, CONST_1024, REF_0);
- vis_padd16(TMP0, CONST_6, TMP0);
-
- vis_mul8x16al(DST_3, CONST_1024, REF_2);
- vis_padd16(TMP2, CONST_6, TMP2);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_4, CONST_256, TMP4);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
- vis_padd16(TMP12, TMP0, TMP12);
- vis_mul8x16au(REF_6, CONST_256, TMP8);
-
- vis_padd16(TMP14, TMP2, TMP14);
- vis_mul8x16au(REF_6_1, CONST_256, TMP10);
-
- vis_padd16(TMP12, TMP16, TMP12);
- vis_mul8x16au(REF_S0, CONST_256, REF_4);
-
- vis_padd16(TMP14, TMP18, TMP14);
- vis_mul8x16au(REF_S0_1, CONST_256, REF_6);
-
- vis_padd16(TMP12, TMP30, TMP12);
-
- vis_padd16(TMP14, TMP32, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP4, CONST_6, TMP4);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_padd16(TMP6, CONST_6, TMP6);
- vis_mul8x16au(REF_S2, CONST_256, TMP12);
-
- vis_padd16(TMP4, TMP8, TMP4);
- vis_mul8x16au(REF_S2_1, CONST_256, TMP14);
-
- vis_padd16(TMP6, TMP10, TMP6);
-
- vis_padd16(TMP20, TMP4, TMP20);
-
- vis_padd16(TMP22, TMP6, TMP22);
-
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP22, TMP26, TMP22);
-
- vis_padd16(TMP20, REF_0, TMP20);
- vis_mul8x16au(REF_S4, CONST_256, REF_0);
-
- vis_padd16(TMP22, REF_2, TMP22);
- vis_pack16(TMP20, DST_2);
-
- vis_pack16(TMP22, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
-
- vis_ld64_2(dest, 8, DST_2);
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_S4_1, REF_2);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_padd16(REF_4, TMP0, TMP8);
-
- vis_mul8x16au(REF_S6, CONST_256, REF_4);
- vis_padd16(REF_6, TMP2, TMP10);
-
- vis_mul8x16au(REF_S6_1, CONST_256, REF_6);
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
-
- vis_padd16(TMP8, TMP30, TMP8);
-
- vis_padd16(TMP10, TMP32, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
-
- vis_padd16(REF_0, TMP4, REF_0);
-
- vis_mul8x16al(DST_2, CONST_1024, TMP30);
- vis_padd16(REF_2, TMP6, REF_2);
-
- vis_mul8x16al(DST_3, CONST_1024, TMP32);
- vis_padd16(REF_0, REF_4, REF_0);
-
- vis_padd16(REF_2, REF_6, REF_2);
-
- vis_padd16(REF_0, TMP30, REF_0);
-
- /* stall */
-
- vis_padd16(REF_2, TMP32, REF_2);
- vis_pack16(REF_0, DST_2);
-
- vis_pack16(REF_2, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-/* End of no rounding code */
-
-av_cold void ff_hpeldsp_init_vis(HpelDSPContext *c, int flags)
-{
- /* VIS-specific optimizations */
- int accel = vis_level ();
-
- if (accel & ACCEL_SPARC_VIS) {
- c->put_pixels_tab[0][0] = MC_put_o_16_vis;
- c->put_pixels_tab[0][1] = MC_put_x_16_vis;
- c->put_pixels_tab[0][2] = MC_put_y_16_vis;
- c->put_pixels_tab[0][3] = MC_put_xy_16_vis;
-
- c->put_pixels_tab[1][0] = MC_put_o_8_vis;
- c->put_pixels_tab[1][1] = MC_put_x_8_vis;
- c->put_pixels_tab[1][2] = MC_put_y_8_vis;
- c->put_pixels_tab[1][3] = MC_put_xy_8_vis;
-
- c->avg_pixels_tab[0][0] = MC_avg_o_16_vis;
- c->avg_pixels_tab[0][1] = MC_avg_x_16_vis;
- c->avg_pixels_tab[0][2] = MC_avg_y_16_vis;
- c->avg_pixels_tab[0][3] = MC_avg_xy_16_vis;
-
- c->avg_pixels_tab[1][0] = MC_avg_o_8_vis;
- c->avg_pixels_tab[1][1] = MC_avg_x_8_vis;
- c->avg_pixels_tab[1][2] = MC_avg_y_8_vis;
- c->avg_pixels_tab[1][3] = MC_avg_xy_8_vis;
-
- c->put_no_rnd_pixels_tab[0][0] = MC_put_no_round_o_16_vis;
- c->put_no_rnd_pixels_tab[0][1] = MC_put_no_round_x_16_vis;
- c->put_no_rnd_pixels_tab[0][2] = MC_put_no_round_y_16_vis;
- c->put_no_rnd_pixels_tab[0][3] = MC_put_no_round_xy_16_vis;
-
- c->put_no_rnd_pixels_tab[1][0] = MC_put_no_round_o_8_vis;
- c->put_no_rnd_pixels_tab[1][1] = MC_put_no_round_x_8_vis;
- c->put_no_rnd_pixels_tab[1][2] = MC_put_no_round_y_8_vis;
- c->put_no_rnd_pixels_tab[1][3] = MC_put_no_round_xy_8_vis;
-
- c->avg_no_rnd_pixels_tab[0] = MC_avg_no_round_o_16_vis;
- c->avg_no_rnd_pixels_tab[1] = MC_avg_no_round_x_16_vis;
- c->avg_no_rnd_pixels_tab[2] = MC_avg_no_round_y_16_vis;
- c->avg_no_rnd_pixels_tab[3] = MC_avg_no_round_xy_16_vis;
- }
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/sparc/simple_idct_vis.c b/chromium/third_party/ffmpeg/libavcodec/sparc/simple_idct_vis.c
deleted file mode 100644
index c9923e09251..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/sparc/simple_idct_vis.c
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * SPARC VIS optimized inverse DCT
- * Copyright (c) 2007 Denes Balatoni < dbalatoni XatX interware XdotX hu >
- *
- * I did consult the following fine web page about dct
- * http://www.geocities.com/ssavekar/dct.htm
- *
- * 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 "dsputil_vis.h"
-#include "libavutil/mem.h"
-
-static const DECLARE_ALIGNED(8, int16_t, coeffs)[28] = {
- - 1259,- 1259,- 1259,- 1259,
- - 4989,- 4989,- 4989,- 4989,
- -11045,-11045,-11045,-11045,
- -19195,-19195,-19195,-19195,
- -29126,-29126,-29126,-29126,
- 25080, 25080, 25080, 25080,
- 12785, 12785, 12785, 12785
-};
-static const DECLARE_ALIGNED(8, uint16_t, scale)[4] = {
- 65536>>6, 65536>>6, 65536>>6, 65536>>6
-};
-static const DECLARE_ALIGNED(8, uint16_t, rounder)[4] = {
- 1<<5, 1<<5, 1<<5, 1<<5
-};
-static const DECLARE_ALIGNED(8, uint16_t, expand)[4] = {
- 1<<14, 1<<14, 1<<14, 1<<14
-};
-
-#define INIT_IDCT \
- "ldd [%1], %%f32 \n\t"\
- "ldd [%1+8], %%f34 \n\t"\
- "ldd [%1+16], %%f36 \n\t"\
- "ldd [%1+24], %%f38 \n\t"\
- "ldd [%1+32], %%f40 \n\t"\
- "ldd [%1+40], %%f42 \n\t"\
- "ldd [%1+48], %%f44 \n\t"\
- "ldd [%0], %%f46 \n\t"\
- "fzero %%f62 \n\t"\
-
-#define LOADSCALE(in) \
- "ldd [" in "], %%f0 \n\t"\
- "ldd [" in "+16], %%f2 \n\t"\
- "ldd [" in "+32], %%f4 \n\t"\
- "ldd [" in "+48], %%f6 \n\t"\
- "ldd [" in "+64], %%f8 \n\t"\
- "ldd [" in "+80], %%f10 \n\t"\
- "ldd [" in "+96], %%f12 \n\t"\
- "ldd [" in "+112], %%f14 \n\t"\
- "fpadd16 %%f0, %%f0, %%f0 \n\t"\
- "fpadd16 %%f2, %%f2, %%f2 \n\t"\
- "fpadd16 %%f4, %%f4, %%f4 \n\t"\
- "fpadd16 %%f6, %%f6, %%f6 \n\t"\
- "fpadd16 %%f8, %%f8, %%f8 \n\t"\
- "fpadd16 %%f10, %%f10, %%f10 \n\t"\
- "fpadd16 %%f12, %%f12, %%f12 \n\t"\
- "fpadd16 %%f14, %%f14, %%f14 \n\t"\
-\
- "fpadd16 %%f0, %%f0, %%f0 \n\t"\
- "fpadd16 %%f2, %%f2, %%f2 \n\t"\
- "fpadd16 %%f4, %%f4, %%f4 \n\t"\
- "fpadd16 %%f6, %%f6, %%f6 \n\t"\
- "fpadd16 %%f8, %%f8, %%f8 \n\t"\
- "fpadd16 %%f10, %%f10, %%f10 \n\t"\
- "fpadd16 %%f12, %%f12, %%f12 \n\t"\
- "fpadd16 %%f14, %%f14, %%f14 \n\t"\
-\
- "fpadd16 %%f0, %%f0, %%f0 \n\t"\
- "fpadd16 %%f2, %%f2, %%f2 \n\t"\
- "fpadd16 %%f4, %%f4, %%f4 \n\t"\
- "fpadd16 %%f6, %%f6, %%f6 \n\t"\
- "fpadd16 %%f8, %%f8, %%f8 \n\t"\
- "fpadd16 %%f10, %%f10, %%f10 \n\t"\
- "fpadd16 %%f12, %%f12, %%f12 \n\t"\
- "fpadd16 %%f14, %%f14, %%f14 \n\t"\
-\
- "fpadd16 %%f0, %%f0, %%f0 \n\t"\
- "fpadd16 %%f2, %%f2, %%f2 \n\t"\
- "fpadd16 %%f4, %%f4, %%f4 \n\t"\
- "fpadd16 %%f6, %%f6, %%f6 \n\t"\
- "fpadd16 %%f8, %%f8, %%f8 \n\t"\
- "fpadd16 %%f10, %%f10, %%f10 \n\t"\
- "fpadd16 %%f12, %%f12, %%f12 \n\t"\
- "fpadd16 %%f14, %%f14, %%f14 \n\t"\
-
-#define LOAD(in) \
- "ldd [" in "], %%f16 \n\t"\
- "ldd [" in "+8], %%f18 \n\t"\
- "ldd [" in "+16], %%f20 \n\t"\
- "ldd [" in "+24], %%f22 \n\t"\
- "ldd [" in "+32], %%f24 \n\t"\
- "ldd [" in "+40], %%f26 \n\t"\
- "ldd [" in "+48], %%f28 \n\t"\
- "ldd [" in "+56], %%f30 \n\t"\
-
-#define TRANSPOSE \
- "fpmerge %%f16, %%f24, %%f0 \n\t"\
- "fpmerge %%f20, %%f28, %%f2 \n\t"\
- "fpmerge %%f17, %%f25, %%f4 \n\t"\
- "fpmerge %%f21, %%f29, %%f6 \n\t"\
- "fpmerge %%f18, %%f26, %%f8 \n\t"\
- "fpmerge %%f22, %%f30, %%f10 \n\t"\
- "fpmerge %%f19, %%f27, %%f12 \n\t"\
- "fpmerge %%f23, %%f31, %%f14 \n\t"\
-\
- "fpmerge %%f0, %%f2, %%f16 \n\t"\
- "fpmerge %%f1, %%f3, %%f18 \n\t"\
- "fpmerge %%f4, %%f6, %%f20 \n\t"\
- "fpmerge %%f5, %%f7, %%f22 \n\t"\
- "fpmerge %%f8, %%f10, %%f24 \n\t"\
- "fpmerge %%f9, %%f11, %%f26 \n\t"\
- "fpmerge %%f12, %%f14, %%f28 \n\t"\
- "fpmerge %%f13, %%f15, %%f30 \n\t"\
-\
- "fpmerge %%f16, %%f17, %%f0 \n\t"\
- "fpmerge %%f18, %%f19, %%f2 \n\t"\
- "fpmerge %%f20, %%f21, %%f4 \n\t"\
- "fpmerge %%f22, %%f23, %%f6 \n\t"\
- "fpmerge %%f24, %%f25, %%f8 \n\t"\
- "fpmerge %%f26, %%f27, %%f10 \n\t"\
- "fpmerge %%f28, %%f29, %%f12 \n\t"\
- "fpmerge %%f30, %%f31, %%f14 \n\t"\
-
-#define IDCT4ROWS \
- /* 1. column */\
- "fmul8ulx16 %%f0, %%f38, %%f28 \n\t"\
- "for %%f4, %%f6, %%f60 \n\t"\
- "fmul8ulx16 %%f2, %%f32, %%f18 \n\t"\
- "fmul8ulx16 %%f2, %%f36, %%f22 \n\t"\
- "fmul8ulx16 %%f2, %%f40, %%f26 \n\t"\
- "fmul8ulx16 %%f2, %%f44, %%f30 \n\t"\
-\
- ADDROUNDER\
-\
- "fmul8sux16 %%f0, %%f38, %%f48 \n\t"\
- "fcmpd %%fcc0, %%f62, %%f60 \n\t"\
- "for %%f8, %%f10, %%f60 \n\t"\
- "fmul8sux16 %%f2, %%f32, %%f50 \n\t"\
- "fmul8sux16 %%f2, %%f36, %%f52 \n\t"\
- "fmul8sux16 %%f2, %%f40, %%f54 \n\t"\
- "fmul8sux16 %%f2, %%f44, %%f56 \n\t"\
-\
- "fpadd16 %%f48, %%f28, %%f28 \n\t"\
- "fcmpd %%fcc1, %%f62, %%f60 \n\t"\
- "for %%f12, %%f14, %%f60 \n\t"\
- "fpadd16 %%f50, %%f18, %%f18 \n\t"\
- "fpadd16 %%f52, %%f22, %%f22 \n\t"\
- "fpadd16 %%f54, %%f26, %%f26 \n\t"\
- "fpadd16 %%f56, %%f30, %%f30 \n\t"\
-\
- "fpadd16 %%f28, %%f0, %%f16 \n\t"\
- "fcmpd %%fcc2, %%f62, %%f60 \n\t"\
- "fpadd16 %%f28, %%f0, %%f20 \n\t"\
- "fpadd16 %%f28, %%f0, %%f24 \n\t"\
- "fpadd16 %%f28, %%f0, %%f28 \n\t"\
- "fpadd16 %%f18, %%f2, %%f18 \n\t"\
- "fpadd16 %%f22, %%f2, %%f22 \n\t"\
- /* 2. column */\
- "fbe %%fcc0, 3f \n\t"\
- "fpadd16 %%f26, %%f2, %%f26 \n\t"\
- "fmul8ulx16 %%f4, %%f34, %%f48 \n\t"\
- "fmul8ulx16 %%f4, %%f42, %%f50 \n\t"\
- "fmul8ulx16 %%f6, %%f36, %%f52 \n\t"\
- "fmul8ulx16 %%f6, %%f44, %%f54 \n\t"\
- "fmul8ulx16 %%f6, %%f32, %%f56 \n\t"\
- "fmul8ulx16 %%f6, %%f40, %%f58 \n\t"\
-\
- "fpadd16 %%f16, %%f48, %%f16 \n\t"\
- "fpadd16 %%f20, %%f50, %%f20 \n\t"\
- "fpsub16 %%f24, %%f50, %%f24 \n\t"\
- "fpsub16 %%f28, %%f48, %%f28 \n\t"\
- "fpadd16 %%f18, %%f52, %%f18 \n\t"\
- "fpsub16 %%f22, %%f54, %%f22 \n\t"\
- "fpsub16 %%f26, %%f56, %%f26 \n\t"\
- "fpsub16 %%f30, %%f58, %%f30 \n\t"\
-\
- "fmul8sux16 %%f4, %%f34, %%f48 \n\t"\
- "fmul8sux16 %%f4, %%f42, %%f50 \n\t"\
- "fmul8sux16 %%f6, %%f36, %%f52 \n\t"\
- "fmul8sux16 %%f6, %%f44, %%f54 \n\t"\
- "fmul8sux16 %%f6, %%f32, %%f56 \n\t"\
- "fmul8sux16 %%f6, %%f40, %%f58 \n\t"\
-\
- "fpadd16 %%f16, %%f48, %%f16 \n\t"\
- "fpadd16 %%f20, %%f50, %%f20 \n\t"\
- "fpsub16 %%f24, %%f50, %%f24 \n\t"\
- "fpsub16 %%f28, %%f48, %%f28 \n\t"\
- "fpadd16 %%f18, %%f52, %%f18 \n\t"\
- "fpsub16 %%f22, %%f54, %%f22 \n\t"\
- "fpsub16 %%f26, %%f56, %%f26 \n\t"\
- "fpsub16 %%f30, %%f58, %%f30 \n\t"\
-\
- "fpadd16 %%f16, %%f4, %%f16 \n\t"\
- "fpsub16 %%f28, %%f4, %%f28 \n\t"\
- "fpadd16 %%f18, %%f6, %%f18 \n\t"\
- "fpsub16 %%f26, %%f6, %%f26 \n\t"\
- /* 3. column */\
- "3: \n\t"\
- "fbe %%fcc1, 4f \n\t"\
- "fpsub16 %%f30, %%f6, %%f30 \n\t"\
- "fmul8ulx16 %%f8, %%f38, %%f48 \n\t"\
- "fmul8ulx16 %%f10, %%f40, %%f50 \n\t"\
- "fmul8ulx16 %%f10, %%f32, %%f52 \n\t"\
- "fmul8ulx16 %%f10, %%f44, %%f54 \n\t"\
- "fmul8ulx16 %%f10, %%f36, %%f56 \n\t"\
-\
- "fpadd16 %%f16, %%f48, %%f16 \n\t"\
- "fpsub16 %%f20, %%f48, %%f20 \n\t"\
- "fpsub16 %%f24, %%f48, %%f24 \n\t"\
- "fpadd16 %%f28, %%f48, %%f28 \n\t"\
- "fpadd16 %%f18, %%f50, %%f18 \n\t"\
- "fpsub16 %%f22, %%f52, %%f22 \n\t"\
- "fpadd16 %%f26, %%f54, %%f26 \n\t"\
- "fpadd16 %%f30, %%f56, %%f30 \n\t"\
-\
- "fmul8sux16 %%f8, %%f38, %%f48 \n\t"\
- "fmul8sux16 %%f10, %%f40, %%f50 \n\t"\
- "fmul8sux16 %%f10, %%f32, %%f52 \n\t"\
- "fmul8sux16 %%f10, %%f44, %%f54 \n\t"\
- "fmul8sux16 %%f10, %%f36, %%f56 \n\t"\
-\
- "fpadd16 %%f16, %%f48, %%f16 \n\t"\
- "fpsub16 %%f20, %%f48, %%f20 \n\t"\
- "fpsub16 %%f24, %%f48, %%f24 \n\t"\
- "fpadd16 %%f28, %%f48, %%f28 \n\t"\
- "fpadd16 %%f18, %%f50, %%f18 \n\t"\
- "fpsub16 %%f22, %%f52, %%f22 \n\t"\
- "fpadd16 %%f26, %%f54, %%f26 \n\t"\
- "fpadd16 %%f30, %%f56, %%f30 \n\t"\
-\
- "fpadd16 %%f16, %%f8, %%f16 \n\t"\
- "fpsub16 %%f20, %%f8, %%f20 \n\t"\
- "fpsub16 %%f24, %%f8, %%f24 \n\t"\
- "fpadd16 %%f28, %%f8, %%f28 \n\t"\
- "fpadd16 %%f18, %%f10, %%f18 \n\t"\
- "fpsub16 %%f22, %%f10, %%f22 \n\t"\
- /* 4. column */\
- "4: \n\t"\
- "fbe %%fcc2, 5f \n\t"\
- "fpadd16 %%f30, %%f10, %%f30 \n\t"\
- "fmul8ulx16 %%f12, %%f42, %%f48 \n\t"\
- "fmul8ulx16 %%f12, %%f34, %%f50 \n\t"\
- "fmul8ulx16 %%f14, %%f44, %%f52 \n\t"\
- "fmul8ulx16 %%f14, %%f40, %%f54 \n\t"\
- "fmul8ulx16 %%f14, %%f36, %%f56 \n\t"\
- "fmul8ulx16 %%f14, %%f32, %%f58 \n\t"\
-\
- "fpadd16 %%f16, %%f48, %%f16 \n\t"\
- "fpsub16 %%f20, %%f50, %%f20 \n\t"\
- "fpadd16 %%f24, %%f50, %%f24 \n\t"\
- "fpsub16 %%f28, %%f48, %%f28 \n\t"\
- "fpadd16 %%f18, %%f52, %%f18 \n\t"\
- "fpsub16 %%f22, %%f54, %%f22 \n\t"\
- "fpadd16 %%f26, %%f56, %%f26 \n\t"\
- "fpsub16 %%f30, %%f58, %%f30 \n\t"\
-\
- "fmul8sux16 %%f12, %%f42, %%f48 \n\t"\
- "fmul8sux16 %%f12, %%f34, %%f50 \n\t"\
- "fmul8sux16 %%f14, %%f44, %%f52 \n\t"\
- "fmul8sux16 %%f14, %%f40, %%f54 \n\t"\
- "fmul8sux16 %%f14, %%f36, %%f56 \n\t"\
- "fmul8sux16 %%f14, %%f32, %%f58 \n\t"\
-\
- "fpadd16 %%f16, %%f48, %%f16 \n\t"\
- "fpsub16 %%f20, %%f50, %%f20 \n\t"\
- "fpadd16 %%f24, %%f50, %%f24 \n\t"\
- "fpsub16 %%f28, %%f48, %%f28 \n\t"\
- "fpadd16 %%f18, %%f52, %%f18 \n\t"\
- "fpsub16 %%f22, %%f54, %%f22 \n\t"\
- "fpadd16 %%f26, %%f56, %%f26 \n\t"\
- "fpsub16 %%f30, %%f58, %%f30 \n\t"\
-\
- "fpsub16 %%f20, %%f12, %%f20 \n\t"\
- "fpadd16 %%f24, %%f12, %%f24 \n\t"\
- "fpsub16 %%f22, %%f14, %%f22 \n\t"\
- "fpadd16 %%f26, %%f14, %%f26 \n\t"\
- "fpsub16 %%f30, %%f14, %%f30 \n\t"\
- /* final butterfly */\
- "5: \n\t"\
- "fpsub16 %%f16, %%f18, %%f48 \n\t"\
- "fpsub16 %%f20, %%f22, %%f50 \n\t"\
- "fpsub16 %%f24, %%f26, %%f52 \n\t"\
- "fpsub16 %%f28, %%f30, %%f54 \n\t"\
- "fpadd16 %%f16, %%f18, %%f16 \n\t"\
- "fpadd16 %%f20, %%f22, %%f20 \n\t"\
- "fpadd16 %%f24, %%f26, %%f24 \n\t"\
- "fpadd16 %%f28, %%f30, %%f28 \n\t"\
-
-#define STOREROWS(out) \
- "std %%f48, [" out "+112] \n\t"\
- "std %%f50, [" out "+96] \n\t"\
- "std %%f52, [" out "+80] \n\t"\
- "std %%f54, [" out "+64] \n\t"\
- "std %%f16, [" out "] \n\t"\
- "std %%f20, [" out "+16] \n\t"\
- "std %%f24, [" out "+32] \n\t"\
- "std %%f28, [" out "+48] \n\t"\
-
-#define SCALEROWS \
- "fmul8sux16 %%f46, %%f48, %%f48 \n\t"\
- "fmul8sux16 %%f46, %%f50, %%f50 \n\t"\
- "fmul8sux16 %%f46, %%f52, %%f52 \n\t"\
- "fmul8sux16 %%f46, %%f54, %%f54 \n\t"\
- "fmul8sux16 %%f46, %%f16, %%f16 \n\t"\
- "fmul8sux16 %%f46, %%f20, %%f20 \n\t"\
- "fmul8sux16 %%f46, %%f24, %%f24 \n\t"\
- "fmul8sux16 %%f46, %%f28, %%f28 \n\t"\
-
-#define PUTPIXELSCLAMPED(dest) \
- "fpack16 %%f48, %%f14 \n\t"\
- "fpack16 %%f50, %%f12 \n\t"\
- "fpack16 %%f16, %%f0 \n\t"\
- "fpack16 %%f20, %%f2 \n\t"\
- "fpack16 %%f24, %%f4 \n\t"\
- "fpack16 %%f28, %%f6 \n\t"\
- "fpack16 %%f54, %%f8 \n\t"\
- "fpack16 %%f52, %%f10 \n\t"\
- "st %%f0, [%3+" dest "] \n\t"\
- "st %%f2, [%5+" dest "] \n\t"\
- "st %%f4, [%6+" dest "] \n\t"\
- "st %%f6, [%7+" dest "] \n\t"\
- "st %%f8, [%8+" dest "] \n\t"\
- "st %%f10, [%9+" dest "] \n\t"\
- "st %%f12, [%10+" dest "] \n\t"\
- "st %%f14, [%11+" dest "] \n\t"\
-
-#define ADDPIXELSCLAMPED(dest) \
- "ldd [%5], %%f18 \n\t"\
- "ld [%3+" dest"], %%f0 \n\t"\
- "ld [%6+" dest"], %%f2 \n\t"\
- "ld [%7+" dest"], %%f4 \n\t"\
- "ld [%8+" dest"], %%f6 \n\t"\
- "ld [%9+" dest"], %%f8 \n\t"\
- "ld [%10+" dest"], %%f10 \n\t"\
- "ld [%11+" dest"], %%f12 \n\t"\
- "ld [%12+" dest"], %%f14 \n\t"\
- "fmul8x16 %%f0, %%f18, %%f0 \n\t"\
- "fmul8x16 %%f2, %%f18, %%f2 \n\t"\
- "fmul8x16 %%f4, %%f18, %%f4 \n\t"\
- "fmul8x16 %%f6, %%f18, %%f6 \n\t"\
- "fmul8x16 %%f8, %%f18, %%f8 \n\t"\
- "fmul8x16 %%f10, %%f18, %%f10 \n\t"\
- "fmul8x16 %%f12, %%f18, %%f12 \n\t"\
- "fmul8x16 %%f14, %%f18, %%f14 \n\t"\
- "fpadd16 %%f0, %%f16, %%f0 \n\t"\
- "fpadd16 %%f2, %%f20, %%f2 \n\t"\
- "fpadd16 %%f4, %%f24, %%f4 \n\t"\
- "fpadd16 %%f6, %%f28, %%f6 \n\t"\
- "fpadd16 %%f8, %%f54, %%f8 \n\t"\
- "fpadd16 %%f10, %%f52, %%f10 \n\t"\
- "fpadd16 %%f12, %%f50, %%f12 \n\t"\
- "fpadd16 %%f14, %%f48, %%f14 \n\t"\
- "fpack16 %%f0, %%f0 \n\t"\
- "fpack16 %%f2, %%f2 \n\t"\
- "fpack16 %%f4, %%f4 \n\t"\
- "fpack16 %%f6, %%f6 \n\t"\
- "fpack16 %%f8, %%f8 \n\t"\
- "fpack16 %%f10, %%f10 \n\t"\
- "fpack16 %%f12, %%f12 \n\t"\
- "fpack16 %%f14, %%f14 \n\t"\
- "st %%f0, [%3+" dest "] \n\t"\
- "st %%f2, [%6+" dest "] \n\t"\
- "st %%f4, [%7+" dest "] \n\t"\
- "st %%f6, [%8+" dest "] \n\t"\
- "st %%f8, [%9+" dest "] \n\t"\
- "st %%f10, [%10+" dest "] \n\t"\
- "st %%f12, [%11+" dest "] \n\t"\
- "st %%f14, [%12+" dest "] \n\t"\
-
-
-void ff_simple_idct_vis(int16_t *data) {
- int out1, out2, out3, out4;
- DECLARE_ALIGNED(8, int16_t, temp)[8*8];
-
- __asm__ volatile(
- INIT_IDCT
-
-#define ADDROUNDER
-
- // shift right 16-4=12
- LOADSCALE("%2+8")
- IDCT4ROWS
- STOREROWS("%3+8")
- LOADSCALE("%2+0")
- IDCT4ROWS
- "std %%f48, [%3+112] \n\t"
- "std %%f50, [%3+96] \n\t"
- "std %%f52, [%3+80] \n\t"
- "std %%f54, [%3+64] \n\t"
-
- // shift right 16+4
- "ldd [%3+8], %%f18 \n\t"
- "ldd [%3+24], %%f22 \n\t"
- "ldd [%3+40], %%f26 \n\t"
- "ldd [%3+56], %%f30 \n\t"
- TRANSPOSE
- IDCT4ROWS
- SCALEROWS
- STOREROWS("%2+0")
- LOAD("%3+64")
- TRANSPOSE
- IDCT4ROWS
- SCALEROWS
- STOREROWS("%2+8")
-
- : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4)
- : "0" (scale), "1" (coeffs), "2" (data), "3" (temp)
- );
-}
-
-void ff_simple_idct_put_vis(uint8_t *dest, int line_size, int16_t *data) {
- int out1, out2, out3, out4, out5;
- int r1, r2, r3, r4, r5, r6, r7;
-
- __asm__ volatile(
- "wr %%g0, 0x8, %%gsr \n\t"
-
- INIT_IDCT
-
- "add %3, %4, %5 \n\t"
- "add %5, %4, %6 \n\t"
- "add %6, %4, %7 \n\t"
- "add %7, %4, %8 \n\t"
- "add %8, %4, %9 \n\t"
- "add %9, %4, %10 \n\t"
- "add %10, %4, %11 \n\t"
-
- // shift right 16-4=12
- LOADSCALE("%2+8")
- IDCT4ROWS
- STOREROWS("%2+8")
- LOADSCALE("%2+0")
- IDCT4ROWS
- "std %%f48, [%2+112] \n\t"
- "std %%f50, [%2+96] \n\t"
- "std %%f52, [%2+80] \n\t"
- "std %%f54, [%2+64] \n\t"
-
-#undef ADDROUNDER
-#define ADDROUNDER "fpadd16 %%f28, %%f46, %%f28 \n\t"
-
- // shift right 16+4
- "ldd [%2+8], %%f18 \n\t"
- "ldd [%2+24], %%f22 \n\t"
- "ldd [%2+40], %%f26 \n\t"
- "ldd [%2+56], %%f30 \n\t"
- TRANSPOSE
- IDCT4ROWS
- PUTPIXELSCLAMPED("0")
- LOAD("%2+64")
- TRANSPOSE
- IDCT4ROWS
- PUTPIXELSCLAMPED("4")
-
- : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5),
- "=r" (r1), "=r" (r2), "=r" (r3), "=r" (r4), "=r" (r5), "=r" (r6), "=r" (r7)
- : "0" (rounder), "1" (coeffs), "2" (data), "3" (dest), "4" (line_size)
- );
-}
-
-void ff_simple_idct_add_vis(uint8_t *dest, int line_size, int16_t *data) {
- int out1, out2, out3, out4, out5, out6;
- int r1, r2, r3, r4, r5, r6, r7;
-
- __asm__ volatile(
- "wr %%g0, 0x8, %%gsr \n\t"
-
- INIT_IDCT
-
- "add %3, %4, %6 \n\t"
- "add %6, %4, %7 \n\t"
- "add %7, %4, %8 \n\t"
- "add %8, %4, %9 \n\t"
- "add %9, %4, %10 \n\t"
- "add %10, %4, %11 \n\t"
- "add %11, %4, %12 \n\t"
-
-#undef ADDROUNDER
-#define ADDROUNDER
-
- // shift right 16-4=12
- LOADSCALE("%2+8")
- IDCT4ROWS
- STOREROWS("%2+8")
- LOADSCALE("%2+0")
- IDCT4ROWS
- "std %%f48, [%2+112] \n\t"
- "std %%f50, [%2+96] \n\t"
- "std %%f52, [%2+80] \n\t"
- "std %%f54, [%2+64] \n\t"
-
-#undef ADDROUNDER
-#define ADDROUNDER "fpadd16 %%f28, %%f46, %%f28 \n\t"
-
- // shift right 16+4
- "ldd [%2+8], %%f18 \n\t"
- "ldd [%2+24], %%f22 \n\t"
- "ldd [%2+40], %%f26 \n\t"
- "ldd [%2+56], %%f30 \n\t"
- TRANSPOSE
- IDCT4ROWS
- ADDPIXELSCLAMPED("0")
- LOAD("%2+64")
- TRANSPOSE
- IDCT4ROWS
- ADDPIXELSCLAMPED("4")
-
- : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5), "=r" (out6),
- "=r" (r1), "=r" (r2), "=r" (r3), "=r" (r4), "=r" (r5), "=r" (r6), "=r" (r7)
- : "0" (rounder), "1" (coeffs), "2" (data), "3" (dest), "4" (line_size), "5" (expand)
- );
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/sparc/vis.h b/chromium/third_party/ffmpeg/libavcodec/sparc/vis.h
deleted file mode 100644
index 107ff96d8e2..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/sparc/vis.h
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright (C) 2003 David S. Miller <davem@redhat.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
- */
-
-/* You may be asking why I hard-code the instruction opcodes and don't
- * use the normal VIS assembler mnenomics for the VIS instructions.
- *
- * The reason is that Sun, in their infinite wisdom, decided that a binary
- * using a VIS instruction will cause it to be marked (in the ELF headers)
- * as doing so, and this prevents the OS from loading such binaries if the
- * current cpu doesn't have VIS. There is no way to easily override this
- * behavior of the assembler that I am aware of.
- *
- * This totally defeats what libmpeg2 is trying to do which is allow a
- * single binary to be created, and then detect the availability of VIS
- * at runtime.
- *
- * I'm not saying that tainting the binary by default is bad, rather I'm
- * saying that not providing a way to override this easily unnecessarily
- * ties people's hands.
- *
- * Thus, we do the opcode encoding by hand and output 32-bit words in
- * the assembler to keep the binary from becoming tainted.
- */
-
-#ifndef AVCODEC_SPARC_VIS_H
-#define AVCODEC_SPARC_VIS_H
-
-#define ACCEL_SPARC_VIS 1
-#define ACCEL_SPARC_VIS2 2
-
-static inline int vis_level(void)
-{
- int accel = 0;
- accel |= ACCEL_SPARC_VIS;
- accel |= ACCEL_SPARC_VIS2;
- return accel;
-}
-
-#define vis_opc_base ((0x1 << 31) | (0x36 << 19))
-#define vis_opf(X) ((X) << 5)
-#define vis_sreg(X) (X)
-#define vis_dreg(X) (((X)&0x1f)|((X)>>5))
-#define vis_rs1_s(X) (vis_sreg(X) << 14)
-#define vis_rs1_d(X) (vis_dreg(X) << 14)
-#define vis_rs2_s(X) (vis_sreg(X) << 0)
-#define vis_rs2_d(X) (vis_dreg(X) << 0)
-#define vis_rd_s(X) (vis_sreg(X) << 25)
-#define vis_rd_d(X) (vis_dreg(X) << 25)
-
-#define vis_ss2s(opf,rs1,rs2,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_s(rs1) | \
- vis_rs2_s(rs2) | \
- vis_rd_s(rd)))
-
-#define vis_dd2d(opf,rs1,rs2,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_d(rs1) | \
- vis_rs2_d(rs2) | \
- vis_rd_d(rd)))
-
-#define vis_ss2d(opf,rs1,rs2,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_s(rs1) | \
- vis_rs2_s(rs2) | \
- vis_rd_d(rd)))
-
-#define vis_sd2d(opf,rs1,rs2,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_s(rs1) | \
- vis_rs2_d(rs2) | \
- vis_rd_d(rd)))
-
-#define vis_d2s(opf,rs2,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs2_d(rs2) | \
- vis_rd_s(rd)))
-
-#define vis_s2d(opf,rs2,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs2_s(rs2) | \
- vis_rd_d(rd)))
-
-#define vis_d12d(opf,rs1,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_d(rs1) | \
- vis_rd_d(rd)))
-
-#define vis_d22d(opf,rs2,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs2_d(rs2) | \
- vis_rd_d(rd)))
-
-#define vis_s12s(opf,rs1,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_s(rs1) | \
- vis_rd_s(rd)))
-
-#define vis_s22s(opf,rs2,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs2_s(rs2) | \
- vis_rd_s(rd)))
-
-#define vis_s(opf,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rd_s(rd)))
-
-#define vis_d(opf,rd) \
- __asm__ volatile (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rd_d(rd)))
-
-#define vis_r2m(op,rd,mem) \
- __asm__ volatile (#op "\t%%f" #rd ", [%0]" : : "r" (&(mem)) )
-
-#define vis_r2m_2(op,rd,mem1,mem2) \
- __asm__ volatile (#op "\t%%f" #rd ", [%0 + %1]" : : "r" (mem1), "r" (mem2) )
-
-#define vis_m2r(op,mem,rd) \
- __asm__ volatile (#op "\t[%0], %%f" #rd : : "r" (&(mem)) )
-
-#define vis_m2r_2(op,mem1,mem2,rd) \
- __asm__ volatile (#op "\t[%0 + %1], %%f" #rd : : "r" (mem1), "r" (mem2) )
-
-static inline void vis_set_gsr(unsigned int val)
-{
- __asm__ volatile("mov %0,%%asr19"
- : : "r" (val));
-}
-
-#define VIS_GSR_ALIGNADDR_MASK 0x0000007
-#define VIS_GSR_ALIGNADDR_SHIFT 0
-#define VIS_GSR_SCALEFACT_MASK 0x0000078
-#define VIS_GSR_SCALEFACT_SHIFT 3
-
-#define vis_ld32(mem,rs1) vis_m2r(ld, mem, rs1)
-#define vis_ld32_2(mem1,mem2,rs1) vis_m2r_2(ld, mem1, mem2, rs1)
-#define vis_st32(rs1,mem) vis_r2m(st, rs1, mem)
-#define vis_st32_2(rs1,mem1,mem2) vis_r2m_2(st, rs1, mem1, mem2)
-#define vis_ld64(mem,rs1) vis_m2r(ldd, mem, rs1)
-#define vis_ld64_2(mem1,mem2,rs1) vis_m2r_2(ldd, mem1, mem2, rs1)
-#define vis_st64(rs1,mem) vis_r2m(std, rs1, mem)
-#define vis_st64_2(rs1,mem1,mem2) vis_r2m_2(std, rs1, mem1, mem2)
-
-/* 16 and 32 bit partitioned addition and subtraction. The normal
- * versions perform 4 16-bit or 2 32-bit additions or subtractions.
- * The 's' versions perform 2 16-bit or 1 32-bit additions or
- * subtractions.
- */
-
-#define vis_padd16(rs1,rs2,rd) vis_dd2d(0x50, rs1, rs2, rd)
-#define vis_padd16s(rs1,rs2,rd) vis_ss2s(0x51, rs1, rs2, rd)
-#define vis_padd32(rs1,rs2,rd) vis_dd2d(0x52, rs1, rs2, rd)
-#define vis_padd32s(rs1,rs2,rd) vis_ss2s(0x53, rs1, rs2, rd)
-#define vis_psub16(rs1,rs2,rd) vis_dd2d(0x54, rs1, rs2, rd)
-#define vis_psub16s(rs1,rs2,rd) vis_ss2s(0x55, rs1, rs2, rd)
-#define vis_psub32(rs1,rs2,rd) vis_dd2d(0x56, rs1, rs2, rd)
-#define vis_psub32s(rs1,rs2,rd) vis_ss2s(0x57, rs1, rs2, rd)
-
-/* Pixel formatting instructions. */
-
-#define vis_pack16(rs2,rd) vis_d2s( 0x3b, rs2, rd)
-#define vis_pack32(rs1,rs2,rd) vis_dd2d(0x3a, rs1, rs2, rd)
-#define vis_packfix(rs2,rd) vis_d2s( 0x3d, rs2, rd)
-#define vis_expand(rs2,rd) vis_s2d( 0x4d, rs2, rd)
-#define vis_pmerge(rs1,rs2,rd) vis_ss2d(0x4b, rs1, rs2, rd)
-
-/* Partitioned multiply instructions. */
-
-#define vis_mul8x16(rs1,rs2,rd) vis_sd2d(0x31, rs1, rs2, rd)
-#define vis_mul8x16au(rs1,rs2,rd) vis_ss2d(0x33, rs1, rs2, rd)
-#define vis_mul8x16al(rs1,rs2,rd) vis_ss2d(0x35, rs1, rs2, rd)
-#define vis_mul8sux16(rs1,rs2,rd) vis_dd2d(0x36, rs1, rs2, rd)
-#define vis_mul8ulx16(rs1,rs2,rd) vis_dd2d(0x37, rs1, rs2, rd)
-#define vis_muld8sux16(rs1,rs2,rd) vis_ss2d(0x38, rs1, rs2, rd)
-#define vis_muld8ulx16(rs1,rs2,rd) vis_ss2d(0x39, rs1, rs2, rd)
-
-/* Alignment instructions. */
-
-static inline const void *vis_alignaddr(const void *ptr)
-{
- __asm__ volatile("alignaddr %0, %%g0, %0"
- : "=&r" (ptr)
- : "0" (ptr));
-
- return ptr;
-}
-
-static inline void vis_alignaddr_g0(void *ptr)
-{
- __asm__ volatile("alignaddr %0, %%g0, %%g0"
- : : "r" (ptr));
-}
-
-#define vis_faligndata(rs1,rs2,rd) vis_dd2d(0x48, rs1, rs2, rd)
-
-/* Logical operate instructions. */
-
-#define vis_fzero(rd) vis_d( 0x60, rd)
-#define vis_fzeros(rd) vis_s( 0x61, rd)
-#define vis_fone(rd) vis_d( 0x7e, rd)
-#define vis_fones(rd) vis_s( 0x7f, rd)
-#define vis_src1(rs1,rd) vis_d12d(0x74, rs1, rd)
-#define vis_src1s(rs1,rd) vis_s12s(0x75, rs1, rd)
-#define vis_src2(rs2,rd) vis_d22d(0x78, rs2, rd)
-#define vis_src2s(rs2,rd) vis_s22s(0x79, rs2, rd)
-#define vis_not1(rs1,rd) vis_d12d(0x6a, rs1, rd)
-#define vis_not1s(rs1,rd) vis_s12s(0x6b, rs1, rd)
-#define vis_not2(rs2,rd) vis_d22d(0x66, rs2, rd)
-#define vis_not2s(rs2,rd) vis_s22s(0x67, rs2, rd)
-#define vis_or(rs1,rs2,rd) vis_dd2d(0x7c, rs1, rs2, rd)
-#define vis_ors(rs1,rs2,rd) vis_ss2s(0x7d, rs1, rs2, rd)
-#define vis_nor(rs1,rs2,rd) vis_dd2d(0x62, rs1, rs2, rd)
-#define vis_nors(rs1,rs2,rd) vis_ss2s(0x63, rs1, rs2, rd)
-#define vis_and(rs1,rs2,rd) vis_dd2d(0x70, rs1, rs2, rd)
-#define vis_ands(rs1,rs2,rd) vis_ss2s(0x71, rs1, rs2, rd)
-#define vis_nand(rs1,rs2,rd) vis_dd2d(0x6e, rs1, rs2, rd)
-#define vis_nands(rs1,rs2,rd) vis_ss2s(0x6f, rs1, rs2, rd)
-#define vis_xor(rs1,rs2,rd) vis_dd2d(0x6c, rs1, rs2, rd)
-#define vis_xors(rs1,rs2,rd) vis_ss2s(0x6d, rs1, rs2, rd)
-#define vis_xnor(rs1,rs2,rd) vis_dd2d(0x72, rs1, rs2, rd)
-#define vis_xnors(rs1,rs2,rd) vis_ss2s(0x73, rs1, rs2, rd)
-#define vis_ornot1(rs1,rs2,rd) vis_dd2d(0x7a, rs1, rs2, rd)
-#define vis_ornot1s(rs1,rs2,rd) vis_ss2s(0x7b, rs1, rs2, rd)
-#define vis_ornot2(rs1,rs2,rd) vis_dd2d(0x76, rs1, rs2, rd)
-#define vis_ornot2s(rs1,rs2,rd) vis_ss2s(0x77, rs1, rs2, rd)
-#define vis_andnot1(rs1,rs2,rd) vis_dd2d(0x68, rs1, rs2, rd)
-#define vis_andnot1s(rs1,rs2,rd) vis_ss2s(0x69, rs1, rs2, rd)
-#define vis_andnot2(rs1,rs2,rd) vis_dd2d(0x64, rs1, rs2, rd)
-#define vis_andnot2s(rs1,rs2,rd) vis_ss2s(0x65, rs1, rs2, rd)
-
-/* Pixel component distance. */
-
-#define vis_pdist(rs1,rs2,rd) vis_dd2d(0x3e, rs1, rs2, rd)
-
-#endif /* AVCODEC_SPARC_VIS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/startcode.c b/chromium/third_party/ffmpeg/libavcodec/startcode.c
new file mode 100644
index 00000000000..5df76951505
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/startcode.c
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2003-2010 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
+ */
+
+/**
+ * @file
+ * Accelerated start code search function for start codes common to
+ * MPEG-1/2/4 video, VC-1, H.264/5
+ * @author Michael Niedermayer <michaelni@gmx.at>
+ */
+
+#include "startcode.h"
+#include "config.h"
+
+int ff_startcode_find_candidate_c(const uint8_t *buf, int size)
+{
+ int i = 0;
+#if HAVE_FAST_UNALIGNED
+ /* we check i < size instead of i + 3 / 7 because it is
+ * simpler and there must be FF_INPUT_BUFFER_PADDING_SIZE
+ * bytes at the end.
+ */
+# if HAVE_FAST_64BIT
+ while (i < size &&
+ !((~*(const uint64_t *)(buf + i) &
+ (*(const uint64_t *)(buf + i) - 0x0101010101010101ULL)) &
+ 0x8080808080808080ULL))
+ i += 8;
+# else
+ while (i < size &&
+ !((~*(const uint32_t *)(buf + i) &
+ (*(const uint32_t *)(buf + i) - 0x01010101U)) &
+ 0x80808080U))
+ i += 4;
+# endif
+#endif
+ for (; i < size; i++)
+ if (!buf[i])
+ break;
+ return i;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/startcode.h b/chromium/third_party/ffmpeg/libavcodec/startcode.h
new file mode 100644
index 00000000000..cc55d5f642a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/startcode.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2003-2010 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
+ */
+
+/**
+ * @file
+ * Accelerated start code search function for start codes common to
+ * MPEG-1/2/4 video, VC-1, H.264/5
+ * @author Michael Niedermayer <michaelni@gmx.at>
+ */
+
+#ifndef AVCODEC_STARTCODE_H
+#define AVCODEC_STARTCODE_H
+
+#include <stdint.h>
+
+int ff_startcode_find_candidate_c(const uint8_t *buf, int size);
+
+#endif /* AVCODEC_STARTCODE_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/svq1enc.c b/chromium/third_party/ffmpeg/libavcodec/svq1enc.c
index 2d7e848fc71..93a1cc16266 100644
--- a/chromium/third_party/ffmpeg/libavcodec/svq1enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/svq1enc.c
@@ -32,9 +32,10 @@
#include "mpegvideo.h"
#include "h263.h"
#include "internal.h"
-#include "libavutil/avassert.h"
+#include "mpegutils.h"
#include "svq1.h"
#include "svq1enc_cb.h"
+#include "libavutil/avassert.h"
typedef struct SVQ1Context {
@@ -257,6 +258,15 @@ static int encode_block(SVQ1Context *s, uint8_t *src, uint8_t *ref,
return best_score;
}
+static void init_block_index(MpegEncContext *s){
+ s->block_index[0]= s->b8_stride*(s->mb_y*2 ) + s->mb_x*2;
+ s->block_index[1]= s->b8_stride*(s->mb_y*2 ) + 1 + s->mb_x*2;
+ s->block_index[2]= s->b8_stride*(s->mb_y*2 + 1) + s->mb_x*2;
+ s->block_index[3]= s->b8_stride*(s->mb_y*2 + 1) + 1 + s->mb_x*2;
+ s->block_index[4]= s->mb_stride*(s->mb_y + 1) + s->b8_stride*s->mb_height*2 + s->mb_x;
+ s->block_index[5]= s->mb_stride*(s->mb_y + s->mb_height + 2) + s->b8_stride*s->mb_height*2 + s->mb_x;
+}
+
static int svq1_encode_plane(SVQ1Context *s, int plane,
unsigned char *src_plane,
unsigned char *ref_plane,
@@ -285,11 +295,11 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
s->m.avctx = s->avctx;
s->m.current_picture_ptr = &s->m.current_picture;
s->m.last_picture_ptr = &s->m.last_picture;
- s->m.last_picture.f.data[0] = ref_plane;
+ s->m.last_picture.f->data[0] = ref_plane;
s->m.linesize =
- s->m.last_picture.f.linesize[0] =
- s->m.new_picture.f.linesize[0] =
- s->m.current_picture.f.linesize[0] = stride;
+ s->m.last_picture.f->linesize[0] =
+ s->m.new_picture.f->linesize[0] =
+ s->m.current_picture.f->linesize[0] = stride;
s->m.width = width;
s->m.height = height;
s->m.mb_width = block_width;
@@ -337,7 +347,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
s->m.me.dia_size = s->avctx->dia_size;
s->m.first_slice_line = 1;
for (y = 0; y < block_height; y++) {
- s->m.new_picture.f.data[0] = src - y * 16 * stride; // ugly
+ s->m.new_picture.f->data[0] = src - y * 16 * stride; // ugly
s->m.mb_y = y;
for (i = 0; i < 16 && i + 16 * y < height; i++) {
@@ -352,8 +362,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
for (x = 0; x < block_width; x++) {
s->m.mb_x = x;
- ff_init_block_index(&s->m);
- ff_update_block_index(&s->m);
+ init_block_index(&s->m);
ff_estimate_p_frame_motion(&s->m, x, y);
}
@@ -393,8 +402,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
}
s->m.mb_x = x;
- ff_init_block_index(&s->m);
- ff_update_block_index(&s->m);
+ init_block_index(&s->m);
if (f->pict_type == AV_PICTURE_TYPE_I ||
(s->m.mb_type[x + y * s->m.mb_stride] &
@@ -507,6 +515,9 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx)
s->rd_total / (double)(avctx->width * avctx->height *
avctx->frame_number));
+ s->m.mb_type = NULL;
+ ff_MPV_common_end(&s->m);
+
av_freep(&s->m.me.scratchpad);
av_freep(&s->m.me.map);
av_freep(&s->m.me.score_map);
@@ -529,6 +540,7 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx)
static av_cold int svq1_encode_init(AVCodecContext *avctx)
{
SVQ1Context *const s = avctx->priv_data;
+ int ret;
ff_dsputil_init(&s->dsp, avctx);
ff_hpeldsp_init(&s->hdsp, avctx->flags);
@@ -552,6 +564,12 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
s->avctx = avctx;
s->m.avctx = avctx;
+
+ if ((ret = ff_MPV_common_init(&s->m)) < 0) {
+ svq1_encode_end(avctx);
+ return ret;
+ }
+
s->m.picture_structure = PICT_FRAME;
s->m.me.temp =
s->m.me.scratchpad = av_mallocz((avctx->width + 64) *
diff --git a/chromium/third_party/ffmpeg/libavcodec/svq3.c b/chromium/third_party/ffmpeg/libavcodec/svq3.c
index 189be48c368..97233b19d61 100644
--- a/chromium/third_party/ffmpeg/libavcodec/svq3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/svq3.c
@@ -40,10 +40,12 @@
* http://samples.mplayerhq.hu/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
*/
+#include <inttypes.h>
+
#include "libavutil/attributes.h"
#include "internal.h"
#include "avcodec.h"
-#include "mpegvideo.h"
+#include "mpegutils.h"
#include "h264.h"
#include "h264data.h" // FIXME FIXME FIXME
@@ -52,6 +54,7 @@
#include "golomb.h"
#include "hpeldsp.h"
#include "rectangle.h"
+#include "tpeldsp.h"
#include "vdpau_internal.h"
#if CONFIG_ZLIB
@@ -69,9 +72,10 @@
typedef struct {
H264Context h;
HpelDSPContext hdsp;
- Picture *cur_pic;
- Picture *next_pic;
- Picture *last_pic;
+ TpelDSPContext tdsp;
+ H264Picture *cur_pic;
+ H264Picture *next_pic;
+ H264Picture *last_pic;
int halfpel_flag;
int thirdpel_flag;
int unknown_flag;
@@ -158,6 +162,8 @@ static const uint32_t svq3_dequant_coeff[32] = {
61694, 68745, 77615, 89113, 100253, 109366, 126635, 141533
};
+static int svq3_decode_end(AVCodecContext *avctx);
+
void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp)
{
const int qmul = svq3_dequant_coeff[qp];
@@ -296,8 +302,8 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
int mx, int my, int dxy,
int thirdpel, int dir, int avg)
{
- H264Context *h = &s->h;
- const Picture *pic = (dir == 0) ? s->last_pic : s->next_pic;
+ H264Context *h = &s->h;
+ const H264Picture *pic = (dir == 0) ? s->last_pic : s->next_pic;
uint8_t *src, *dest;
int i, emu = 0;
int blocksize = 2 - (width >> 3); // 16->0, 8->1, 4->2
@@ -324,9 +330,9 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
src = h->edge_emu_buffer;
}
if (thirdpel)
- (avg ? h->dsp.avg_tpel_pixels_tab
- : h->dsp.put_tpel_pixels_tab)[dxy](dest, src, h->linesize,
- width, height);
+ (avg ? s->tdsp.avg_tpel_pixels_tab
+ : s->tdsp.put_tpel_pixels_tab)[dxy](dest, src, h->linesize,
+ width, height);
else
(avg ? s->hdsp.avg_pixels_tab
: s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src, h->linesize,
@@ -352,10 +358,10 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
src = h->edge_emu_buffer;
}
if (thirdpel)
- (avg ? h->dsp.avg_tpel_pixels_tab
- : h->dsp.put_tpel_pixels_tab)[dxy](dest, src,
- h->uvlinesize,
- width, height);
+ (avg ? s->tdsp.avg_tpel_pixels_tab
+ : s->tdsp.put_tpel_pixels_tab)[dxy](dest, src,
+ h->uvlinesize,
+ width, height);
else
(avg ? s->hdsp.avg_pixels_tab
: s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src,
@@ -619,7 +625,8 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
vlc = svq3_get_ue_golomb(&h->gb);
if (vlc >= 25U) {
- av_log(h->avctx, AV_LOG_ERROR, "luma prediction:%d\n", vlc);
+ av_log(h->avctx, AV_LOG_ERROR,
+ "luma prediction:%"PRIu32"\n", vlc);
return -1;
}
@@ -688,7 +695,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
if (!IS_INTRA16x16(mb_type) &&
(!IS_SKIP(mb_type) || h->pict_type == AV_PICTURE_TYPE_B)) {
if ((vlc = svq3_get_ue_golomb(&h->gb)) >= 48U){
- av_log(h->avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc);
+ av_log(h->avctx, AV_LOG_ERROR, "cbp_vlc=%"PRIu32"\n", vlc);
return -1;
}
@@ -810,7 +817,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
}
if ((slice_id = svq3_get_ue_golomb(&h->gb)) >= 3) {
- av_log(h->avctx, AV_LOG_ERROR, "illegal slice type %d \n", slice_id);
+ av_log(h->avctx, AV_LOG_ERROR, "illegal slice type %u \n", slice_id);
return -1;
}
@@ -868,26 +875,28 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
unsigned char *extradata_end;
unsigned int size;
int marker_found = 0;
+ int ret;
s->cur_pic = av_mallocz(sizeof(*s->cur_pic));
s->last_pic = av_mallocz(sizeof(*s->last_pic));
s->next_pic = av_mallocz(sizeof(*s->next_pic));
if (!s->next_pic || !s->last_pic || !s->cur_pic) {
- av_freep(&s->cur_pic);
- av_freep(&s->last_pic);
- av_freep(&s->next_pic);
- return AVERROR(ENOMEM);
+ ret = AVERROR(ENOMEM);
+ goto fail;
}
- if (ff_h264_decode_init(avctx) < 0)
- return -1;
+ if ((ret = ff_h264_decode_init(avctx)) < 0)
+ goto fail;
ff_hpeldsp_init(&s->hdsp, avctx->flags);
+ ff_tpeldsp_init(&s->tdsp);
+
h->flags = avctx->flags;
h->is_complex = 1;
h->sps.chroma_format_idc = 1;
h->picture_structure = PICT_FRAME;
- avctx->pix_fmt = avctx->codec->pix_fmts[0];
+ avctx->pix_fmt = AV_PIX_FMT_YUVJ420P;
+ avctx->color_range = AVCOL_RANGE_JPEG;
h->chroma_qp[0] = h->chroma_qp[1] = 4;
h->chroma_x_shift = h->chroma_y_shift = 1;
@@ -915,8 +924,10 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
int frame_size_code;
size = AV_RB32(&extradata[4]);
- if (size > extradata_end - extradata - 8)
- return AVERROR_INVALIDDATA;
+ if (size > extradata_end - extradata - 8) {
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
init_get_bits(&gb, extradata + 8, size * 8);
/* 'frame size code' and optional 'width, height' */
@@ -970,8 +981,10 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
/* unknown field */
skip_bits1(&gb);
- if (skip_1stop_8data_bits(&gb) < 0)
- return AVERROR_INVALIDDATA;
+ if (skip_1stop_8data_bits(&gb) < 0) {
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
s->unknown_flag = get_bits1(&gb);
avctx->has_b_frames = !h->low_delay;
@@ -989,11 +1002,13 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
uint8_t *buf;
if (watermark_height <= 0 ||
- (uint64_t)watermark_width * 4 > UINT_MAX / watermark_height)
- return -1;
+ (uint64_t)watermark_width * 4 > UINT_MAX / watermark_height) {
+ ret = -1;
+ goto fail;
+ }
buf = av_malloc(buf_len);
- av_log(avctx, AV_LOG_DEBUG, "watermark size: %dx%d\n",
+ av_log(avctx, AV_LOG_DEBUG, "watermark size: %ux%u\n",
watermark_width, watermark_height);
av_log(avctx, AV_LOG_DEBUG,
"u1: %x u2: %x u3: %x compressed data size: %d offset: %d\n",
@@ -1003,17 +1018,19 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR,
"could not uncompress watermark logo\n");
av_free(buf);
- return -1;
+ ret = -1;
+ goto fail;
}
s->watermark_key = ff_svq1_packet_checksum(buf, buf_len, 0);
s->watermark_key = s->watermark_key << 16 | s->watermark_key;
av_log(avctx, AV_LOG_DEBUG,
- "watermark key %#x\n", s->watermark_key);
+ "watermark key %#"PRIx32"\n", s->watermark_key);
av_free(buf);
#else
av_log(avctx, AV_LOG_ERROR,
"this svq3 file contains watermark which need zlib support compiled in\n");
- return -1;
+ ret = -1;
+ goto fail;
#endif
}
}
@@ -1028,15 +1045,18 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
s->h_edge_pos = h->mb_width * 16;
s->v_edge_pos = h->mb_height * 16;
- if (ff_h264_alloc_tables(h) < 0) {
+ if ((ret = ff_h264_alloc_tables(h)) < 0) {
av_log(avctx, AV_LOG_ERROR, "svq3 memory allocation failed\n");
- return AVERROR(ENOMEM);
+ goto fail;
}
return 0;
+fail:
+ svq3_decode_end(avctx);
+ return ret;
}
-static void free_picture(AVCodecContext *avctx, Picture *pic)
+static void free_picture(AVCodecContext *avctx, H264Picture *pic)
{
int i;
for (i = 0; i < 2; i++) {
@@ -1048,7 +1068,7 @@ static void free_picture(AVCodecContext *avctx, Picture *pic)
av_frame_unref(&pic->f);
}
-static int get_buffer(AVCodecContext *avctx, Picture *pic)
+static int get_buffer(AVCodecContext *avctx, H264Picture *pic)
{
SVQ3Context *s = avctx->priv_data;
H264Context *h = &s->h;
@@ -1142,7 +1162,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
h->pict_type = h->slice_type;
if (h->pict_type != AV_PICTURE_TYPE_B)
- FFSWAP(Picture*, s->next_pic, s->last_pic);
+ FFSWAP(H264Picture*, s->next_pic, s->last_pic);
av_frame_unref(&s->cur_pic->f);
@@ -1175,6 +1195,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
if (h->pict_type != AV_PICTURE_TYPE_I) {
if (!s->last_pic->f.data[0]) {
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
+ av_frame_unref(&s->last_pic->f);
ret = get_buffer(avctx, s->last_pic);
if (ret < 0)
return ret;
@@ -1187,6 +1208,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
if (h->pict_type == AV_PICTURE_TYPE_B && !s->next_pic->f.data[0]) {
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
+ av_frame_unref(&s->next_pic->f);
ret = get_buffer(avctx, s->next_pic);
if (ret < 0)
return ret;
@@ -1284,9 +1306,10 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
(h->pict_type == AV_PICTURE_TYPE_P && mb_type < 8) ? (mb_type - 1) : -1;
}
- ff_draw_horiz_band(avctx, NULL, s->cur_pic, s->last_pic->f.data[0] ? s->last_pic : NULL,
- 16 * h->mb_y, 16, h->picture_structure, 0, 0,
- h->low_delay, h->mb_height * 16, h->mb_width * 16);
+ ff_draw_horiz_band(avctx, &s->cur_pic->f,
+ s->last_pic->f.data[0] ? &s->last_pic->f : NULL,
+ 16 * h->mb_y, 16, h->picture_structure, 0,
+ h->low_delay);
}
left = buf_size*8 - get_bits_count(&h->gb);
@@ -1313,7 +1336,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
*got_frame = 1;
if (h->pict_type != AV_PICTURE_TYPE_B) {
- FFSWAP(Picture*, s->cur_pic, s->next_pic);
+ FFSWAP(H264Picture*, s->cur_pic, s->next_pic);
} else {
av_frame_unref(&s->cur_pic->f);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/svq3.h b/chromium/third_party/ffmpeg/libavcodec/svq3.h
index 7a57d8ad017..5007a8c1c0d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/svq3.h
+++ b/chromium/third_party/ffmpeg/libavcodec/svq3.h
@@ -24,4 +24,4 @@
void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp);
void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, int stride, int qp, int dc);
-#endif /* AVCODEC_DSPUTIL_H */
+#endif /* AVCODEC_SVQ3_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/synth_filter.c b/chromium/third_party/ffmpeg/libavcodec/synth_filter.c
index 5f105309746..d49ffe642d6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/synth_filter.c
+++ b/chromium/third_party/ffmpeg/libavcodec/synth_filter.c
@@ -61,4 +61,5 @@ av_cold void ff_synth_filter_init(SynthFilterContext *c)
c->synth_filter_float = synth_filter_float;
if (ARCH_ARM) ff_synth_filter_init_arm(c);
+ if (ARCH_X86) ff_synth_filter_init_x86(c);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/synth_filter.h b/chromium/third_party/ffmpeg/libavcodec/synth_filter.h
index 33edcc437ff..b63fd779b5e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/synth_filter.h
+++ b/chromium/third_party/ffmpeg/libavcodec/synth_filter.h
@@ -33,5 +33,6 @@ typedef struct SynthFilterContext {
void ff_synth_filter_init(SynthFilterContext *c);
void ff_synth_filter_init_arm(SynthFilterContext *c);
+void ff_synth_filter_init_x86(SynthFilterContext *c);
#endif /* AVCODEC_SYNTH_FILTER_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/takdec.c b/chromium/third_party/ffmpeg/libavcodec/takdec.c
index fcbe10ad3cf..d76946f6ef4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/takdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/takdec.c
@@ -686,8 +686,8 @@ static int tak_decode_frame(AVCodecContext *avctx, void *data,
if ((ret = ff_tak_decode_frame_header(avctx, gb, &s->ti, 0)) < 0)
return ret;
+ hsize = get_bits_count(gb) / 8;
if (avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_COMPLIANT)) {
- hsize = get_bits_count(gb) / 8;
if (ff_tak_check_crc(pkt->data, hsize)) {
av_log(avctx, AV_LOG_ERROR, "CRC error\n");
if (avctx->err_recognition & AV_EF_EXPLODE)
@@ -721,11 +721,9 @@ static int tak_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
- if (s->ti.bps != avctx->bits_per_raw_sample) {
- avctx->bits_per_raw_sample = s->ti.bps;
- if ((ret = set_bps_params(avctx)) < 0)
- return ret;
- }
+ avctx->bits_per_raw_sample = s->ti.bps;
+ if ((ret = set_bps_params(avctx)) < 0)
+ return ret;
if (s->ti.sample_rate != avctx->sample_rate) {
avctx->sample_rate = s->ti.sample_rate;
set_sample_rate_params(avctx);
diff --git a/chromium/third_party/ffmpeg/libavcodec/tiff.c b/chromium/third_party/ffmpeg/libavcodec/tiff.c
index cd209674ca7..1caad84845f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tiff.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tiff.c
@@ -53,11 +53,13 @@ typedef struct TiffContext {
int palette_is_set;
int le;
enum TiffCompr compr;
- int invert;
+ enum TiffPhotometric photometric;
int planar;
+ int subsampling[2];
int fax_opts;
int predictor;
int fill_order;
+ uint32_t res[4];
int strips, rps, sstype;
int sot;
@@ -66,6 +68,8 @@ typedef struct TiffContext {
uint8_t *deinvert_buf;
int deinvert_buf_size;
+ uint8_t *yuv_line;
+ unsigned int yuv_line_size;
int geotag_count;
TiffGeoTag *geotags;
@@ -79,6 +83,7 @@ static void free_geotags(TiffContext *const s)
av_freep(&s->geotags[i].val);
}
av_freep(&s->geotags);
+ s->geotag_count = 0;
}
#define RET_GEOKEY(TYPE, array, element)\
@@ -194,7 +199,7 @@ static char *doubles2str(double *dp, int count, const char *sep)
char *ap, *ap0;
uint64_t component_len;
if (!sep) sep = ", ";
- component_len = 15LL + strlen(sep);
+ component_len = 24LL + strlen(sep);
if (count >= (INT_MAX - 1)/component_len)
return NULL;
ap = av_malloc(component_len * count + 1);
@@ -203,7 +208,7 @@ static char *doubles2str(double *dp, int count, const char *sep)
ap0 = ap;
ap[0] = '\0';
for (i = 0; i < count; i++) {
- unsigned l = snprintf(ap, component_len, "%f%s", dp[i], sep);
+ unsigned l = snprintf(ap, component_len, "%.15g%s", dp[i], sep);
if(l >= component_len) {
av_free(ap0);
return NULL;
@@ -219,7 +224,7 @@ static int add_metadata(int count, int type,
{
switch(type) {
case TIFF_DOUBLE: return ff_tadd_doubles_metadata(count, name, sep, &s->gb, s->le, avpriv_frame_get_metadatap(frame));
- case TIFF_SHORT : return ff_tadd_shorts_metadata(count, name, sep, &s->gb, s->le, avpriv_frame_get_metadatap(frame));
+ case TIFF_SHORT : return ff_tadd_shorts_metadata(count, name, sep, &s->gb, s->le, 0, avpriv_frame_get_metadatap(frame));
case TIFF_STRING: return ff_tadd_string_metadata(count, name, &s->gb, s->le, avpriv_frame_get_metadatap(frame));
default : return AVERROR_INVALIDDATA;
};
@@ -378,12 +383,43 @@ static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,
return ret;
}
-static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
- const uint8_t *src, int size, int lines)
+static void unpack_yuv(TiffContext *s, AVFrame *p,
+ const uint8_t *src, int lnum)
{
+ int i, j, k;
+ int w = (s->width - 1) / s->subsampling[0] + 1;
+ uint8_t *pu = &p->data[1][lnum / s->subsampling[1] * p->linesize[1]];
+ uint8_t *pv = &p->data[2][lnum / s->subsampling[1] * p->linesize[2]];
+ if (s->width % s->subsampling[0] || s->height % s->subsampling[1]) {
+ for (i = 0; i < w; i++) {
+ for (j = 0; j < s->subsampling[1]; j++)
+ for (k = 0; k < s->subsampling[0]; k++)
+ p->data[0][FFMIN(lnum + j, s->height-1) * p->linesize[0] +
+ FFMIN(i * s->subsampling[0] + k, s->width-1)] = *src++;
+ *pu++ = *src++;
+ *pv++ = *src++;
+ }
+ }else{
+ for (i = 0; i < w; i++) {
+ for (j = 0; j < s->subsampling[1]; j++)
+ for (k = 0; k < s->subsampling[0]; k++)
+ p->data[0][(lnum + j) * p->linesize[0] +
+ i * s->subsampling[0] + k] = *src++;
+ *pu++ = *src++;
+ *pv++ = *src++;
+ }
+ }
+}
+
+
+static int tiff_unpack_strip(TiffContext *s, AVFrame *p, uint8_t *dst, int stride,
+ const uint8_t *src, int size, int strip_start, int lines)
+{
+ PutByteContext pb;
int c, line, pixels, code, ret;
const uint8_t *ssrc = src;
- int width = ((s->width * s->bpp) + 7) >> 3;
+ int width = ((s->width * s->bpp) + 7) >> 3;
+ int is_yuv = s->photometric == TIFF_PHOTOMETRIC_YCBCR;
if (s->planar)
width /= s->bppcount;
@@ -391,7 +427,26 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
if (size <= 0)
return AVERROR_INVALIDDATA;
+ if (is_yuv) {
+ int bytes_per_row = (((s->width - 1) / s->subsampling[0] + 1) * s->bpp *
+ s->subsampling[0] * s->subsampling[1] + 7) >> 3;
+ av_fast_padded_malloc(&s->yuv_line, &s->yuv_line_size, bytes_per_row);
+ if (s->yuv_line == NULL) {
+ av_log(s->avctx, AV_LOG_ERROR, "Not enough memory\n");
+ return AVERROR(ENOMEM);
+ }
+ dst = s->yuv_line;
+ stride = 0;
+ width = s->width * s->subsampling[1] + 2*(s->width / s->subsampling[0]);
+ av_assert0(width <= bytes_per_row);
+ av_assert0(s->bpp == 24);
+ }
+
if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE) {
+ if (is_yuv) {
+ av_log(s->avctx, AV_LOG_ERROR, "YUV deflate is unsupported");
+ return AVERROR_PATCHWELCOME;
+ }
#if CONFIG_ZLIB
return tiff_unpack_zlib(s, dst, stride, src, size, width, lines);
#else
@@ -414,21 +469,49 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
av_log(s->avctx, AV_LOG_ERROR, "Error initializing LZW decoder\n");
return ret;
}
+ for (line = 0; line < lines; line++) {
+ pixels = ff_lzw_decode(s->lzw, dst, width);
+ if (pixels < width) {
+ av_log(s->avctx, AV_LOG_ERROR, "Decoded only %i bytes of %i\n",
+ pixels, width);
+ return AVERROR_INVALIDDATA;
+ }
+ if (s->bpp < 8 && s->avctx->pix_fmt == AV_PIX_FMT_PAL8)
+ horizontal_fill(s->bpp, dst, 1, dst, 0, width, 0);
+ if (is_yuv) {
+ unpack_yuv(s, p, dst, strip_start + line);
+ line += s->subsampling[1] - 1;
+ }
+ dst += stride;
+ }
+ return 0;
}
if (s->compr == TIFF_CCITT_RLE ||
s->compr == TIFF_G3 ||
s->compr == TIFF_G4) {
+ if (is_yuv)
+ return AVERROR_INVALIDDATA;
+
return tiff_unpack_fax(s, dst, stride, src, size, width, lines);
}
+
+ bytestream2_init(&s->gb, src, size);
+ bytestream2_init_writer(&pb, dst, is_yuv ? s->yuv_line_size : (stride * lines));
+
for (line = 0; line < lines; line++) {
if (src - ssrc > size) {
av_log(s->avctx, AV_LOG_ERROR, "Source data overread\n");
return AVERROR_INVALIDDATA;
}
+
+ if (bytestream2_get_bytes_left(&s->gb) == 0 || bytestream2_get_eof(&pb))
+ break;
+ bytestream2_seek_p(&pb, stride * line, SEEK_SET);
switch (s->compr) {
case TIFF_RAW:
if (ssrc + size - src < width)
return AVERROR_INVALIDDATA;
+
if (!s->fill_order) {
horizontal_fill(s->bpp * (s->avctx->pix_fmt == AV_PIX_FMT_PAL8),
dst, 1, src, 0, width, 0);
@@ -477,16 +560,10 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
dst[i] = ff_reverse[dst[i]];
}
break;
- case TIFF_LZW:
- pixels = ff_lzw_decode(s->lzw, dst, width);
- if (pixels < width) {
- av_log(s->avctx, AV_LOG_ERROR, "Decoded only %i bytes of %i\n",
- pixels, width);
- return AVERROR_INVALIDDATA;
- }
- if (s->bpp < 8 && s->avctx->pix_fmt == AV_PIX_FMT_PAL8)
- horizontal_fill(s->bpp, dst, 1, dst, 0, width, 0);
- break;
+ }
+ if (is_yuv) {
+ unpack_yuv(s, p, dst, strip_start + line);
+ line += s->subsampling[1] - 1;
}
dst += stride;
}
@@ -510,7 +587,25 @@ static int init_image(TiffContext *s, ThreadFrame *frame)
s->avctx->pix_fmt = AV_PIX_FMT_PAL8;
break;
case 243:
- s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
+ if (s->photometric == TIFF_PHOTOMETRIC_YCBCR) {
+ if (s->subsampling[0] == 1 && s->subsampling[1] == 1) {
+ s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
+ } else if (s->subsampling[0] == 2 && s->subsampling[1] == 1) {
+ s->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
+ } else if (s->subsampling[0] == 4 && s->subsampling[1] == 1) {
+ s->avctx->pix_fmt = AV_PIX_FMT_YUV411P;
+ } else if (s->subsampling[0] == 1 && s->subsampling[1] == 2) {
+ s->avctx->pix_fmt = AV_PIX_FMT_YUV440P;
+ } else if (s->subsampling[0] == 2 && s->subsampling[1] == 2) {
+ s->avctx->pix_fmt = AV_PIX_FMT_YUV420P;
+ } else if (s->subsampling[0] == 4 && s->subsampling[1] == 4) {
+ s->avctx->pix_fmt = AV_PIX_FMT_YUV410P;
+ } else {
+ av_log(s->avctx, AV_LOG_ERROR, "Unsupported YCbCr subsampling\n");
+ return AVERROR_PATCHWELCOME;
+ }
+ } else
+ s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
break;
case 161:
s->avctx->pix_fmt = s->le ? AV_PIX_FMT_GRAY16LE : AV_PIX_FMT_GRAY16BE;
@@ -565,12 +660,22 @@ static int init_image(TiffContext *s, ThreadFrame *frame)
return 0;
}
+static void set_sar(TiffContext *s, unsigned tag, unsigned num, unsigned den)
+{
+ int offset = tag == TIFF_YRES ? 2 : 0;
+ s->res[offset++] = num;
+ s->res[offset] = den;
+ if (s->res[0] && s->res[1] && s->res[2] && s->res[3])
+ av_reduce(&s->avctx->sample_aspect_ratio.num, &s->avctx->sample_aspect_ratio.den,
+ s->res[2] * (uint64_t)s->res[1], s->res[0] * (uint64_t)s->res[3], INT32_MAX);
+}
+
static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
{
- unsigned tag, type, count, off, value = 0;
- int i, j, k, pos, start;
+ unsigned tag, type, count, off, value = 0, value2 = 0;
+ int i, start;
+ int pos;
int ret;
- uint32_t *pal;
double *dp;
ret = ff_tread_tag(&s->gb, s->le, &tag, &type, &count, &start);
@@ -586,6 +691,10 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
case TIFF_LONG:
value = ff_tget(&s->gb, type, s->le);
break;
+ case TIFF_RATIONAL:
+ value = ff_tget(&s->gb, TIFF_LONG, s->le);
+ value2 = ff_tget(&s->gb, TIFF_LONG, s->le);
+ break;
case TIFF_STRING:
if (count <= 4) {
break;
@@ -675,46 +784,35 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
}
break;
case TIFF_ROWSPERSTRIP:
- if (type == TIFF_LONG && value == UINT_MAX)
+ if (!value || (type == TIFF_LONG && value == UINT_MAX))
value = s->height;
- if (value < 1) {
- av_log(s->avctx, AV_LOG_ERROR,
- "Incorrect value of rows per strip\n");
- return AVERROR_INVALIDDATA;
- }
- s->rps = value;
+ s->rps = FFMIN(value, s->height);
break;
case TIFF_STRIP_OFFS:
if (count == 1) {
- s->strippos = 0;
- s->stripoff = value;
+ s->strippos = 0;
+ s->stripoff = value;
} else
s->strippos = off;
s->strips = count;
if (s->strips == 1)
s->rps = s->height;
s->sot = type;
- if (s->strippos > bytestream2_size(&s->gb)) {
- av_log(s->avctx, AV_LOG_ERROR,
- "Tag referencing position outside the image\n");
- return AVERROR_INVALIDDATA;
- }
break;
case TIFF_STRIP_SIZE:
if (count == 1) {
s->stripsizesoff = 0;
- s->stripsize = value;
- s->strips = 1;
+ s->stripsize = value;
+ s->strips = 1;
} else {
s->stripsizesoff = off;
}
s->strips = count;
s->sstype = type;
- if (s->stripsizesoff > bytestream2_size(&s->gb)) {
- av_log(s->avctx, AV_LOG_ERROR,
- "Tag referencing position outside the image\n");
- return AVERROR_INVALIDDATA;
- }
+ break;
+ case TIFF_XRES:
+ case TIFF_YRES:
+ set_sar(s, tag, value, value2);
break;
case TIFF_TILE_BYTE_COUNTS:
case TIFF_TILE_LENGTH:
@@ -726,20 +824,31 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
case TIFF_PREDICTOR:
s->predictor = value;
break;
- case TIFF_INVERT:
+ case TIFF_PHOTOMETRIC:
switch (value) {
- case 0:
- s->invert = 1;
- break;
- case 1:
- s->invert = 0;
- break;
- case 2:
- case 3:
+ case TIFF_PHOTOMETRIC_WHITE_IS_ZERO:
+ case TIFF_PHOTOMETRIC_BLACK_IS_ZERO:
+ case TIFF_PHOTOMETRIC_RGB:
+ case TIFF_PHOTOMETRIC_PALETTE:
+ case TIFF_PHOTOMETRIC_YCBCR:
+ s->photometric = value;
break;
+ case TIFF_PHOTOMETRIC_ALPHA_MASK:
+ case TIFF_PHOTOMETRIC_SEPARATED:
+ case TIFF_PHOTOMETRIC_CIE_LAB:
+ case TIFF_PHOTOMETRIC_ICC_LAB:
+ case TIFF_PHOTOMETRIC_ITU_LAB:
+ case TIFF_PHOTOMETRIC_CFA:
+ case TIFF_PHOTOMETRIC_LOG_L:
+ case TIFF_PHOTOMETRIC_LOG_LUV:
+ case TIFF_PHOTOMETRIC_LINEAR_RAW:
+ avpriv_report_missing_feature(s->avctx,
+ "PhotometricInterpretation 0x%04X",
+ value);
+ return AVERROR_PATCHWELCOME;
default:
- av_log(s->avctx, AV_LOG_ERROR, "Color mode %d is not supported\n",
- value);
+ av_log(s->avctx, AV_LOG_ERROR, "PhotometricInterpretation %u is "
+ "unknown\n", value);
return AVERROR_INVALIDDATA;
}
break;
@@ -751,25 +860,39 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
}
s->fill_order = value - 1;
break;
- case TIFF_PAL:
- pal = (uint32_t *) s->palette;
+ case TIFF_PAL: {
+ GetByteContext pal_gb[3];
off = type_sizes[type];
- if (count / 3 > 256 || bytestream2_get_bytes_left(&s->gb) < count / 3 * off * 3)
+ if (count / 3 > 256 ||
+ bytestream2_get_bytes_left(&s->gb) < count / 3 * off * 3)
return AVERROR_INVALIDDATA;
+
+ pal_gb[0] = pal_gb[1] = pal_gb[2] = s->gb;
+ bytestream2_skip(&pal_gb[1], count / 3 * off);
+ bytestream2_skip(&pal_gb[2], count / 3 * off * 2);
+
off = (type_sizes[type] - 1) << 3;
- for (k = 2; k >= 0; k--) {
- for (i = 0; i < count / 3; i++) {
- if (k == 2)
- pal[i] = 0xFFU << 24;
- j = (ff_tget(&s->gb, type, s->le) >> off) << (k * 8);
- pal[i] |= j;
- }
+ for (i = 0; i < count / 3; i++) {
+ uint32_t p = 0xFF000000;
+ p |= (ff_tget(&pal_gb[0], type, s->le) >> off) << 16;
+ p |= (ff_tget(&pal_gb[1], type, s->le) >> off) << 8;
+ p |= ff_tget(&pal_gb[2], type, s->le) >> off;
+ s->palette[i] = p;
}
s->palette_is_set = 1;
break;
+ }
case TIFF_PLANAR:
s->planar = value == 2;
break;
+ case TIFF_YCBCR_SUBSAMPLING:
+ if (count != 2) {
+ av_log(s->avctx, AV_LOG_ERROR, "subsample count invalid\n");
+ return AVERROR_INVALIDDATA;
+ }
+ for (i = 0; i < count; i++)
+ s->subsampling[i] = ff_tget(&s->gb, type, s->le);
+ break;
case TIFF_T4OPTIONS:
if (s->compr == TIFF_G3)
s->fax_opts = value;
@@ -804,7 +927,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
s->geotag_count = 0;
return -1;
}
- s->geotags = av_mallocz(sizeof(TiffGeoTag) * s->geotag_count);
+ s->geotags = av_mallocz_array(s->geotag_count, sizeof(TiffGeoTag));
if (!s->geotags) {
av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");
s->geotag_count = 0;
@@ -826,7 +949,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
return AVERROR_INVALIDDATA;
if (bytestream2_get_bytes_left(&s->gb) < count * sizeof(int64_t))
return AVERROR_INVALIDDATA;
- dp = av_malloc(count * sizeof(double));
+ dp = av_malloc_array(count, sizeof(double));
if (!dp) {
av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");
goto end;
@@ -946,12 +1069,12 @@ static int decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "IFD offset is greater than image size\n");
return AVERROR_INVALIDDATA;
}
- s->le = le;
+ s->le = le;
// TIFF_BPP is not a required tag and defaults to 1
- s->bppcount = s->bpp = 1;
- s->invert = 0;
- s->compr = TIFF_RAW;
- s->fill_order = 0;
+ s->bppcount = s->bpp = 1;
+ s->photometric = TIFF_PHOTOMETRIC_NONE;
+ s->compr = TIFF_RAW;
+ s->fill_order = 0;
free_geotags(s);
// Reset these offsets so we can tell if they were set this frame
@@ -999,12 +1122,14 @@ static int decode_frame(AVCodecContext *avctx,
if (s->stripsizesoff) {
if (s->stripsizesoff >= (unsigned)avpkt->size)
return AVERROR_INVALIDDATA;
- bytestream2_init(&stripsizes, avpkt->data + s->stripsizesoff, avpkt->size - s->stripsizesoff);
+ bytestream2_init(&stripsizes, avpkt->data + s->stripsizesoff,
+ avpkt->size - s->stripsizesoff);
}
if (s->strippos) {
if (s->strippos >= (unsigned)avpkt->size)
return AVERROR_INVALIDDATA;
- bytestream2_init(&stripdata, avpkt->data + s->strippos, avpkt->size - s->strippos);
+ bytestream2_init(&stripdata, avpkt->data + s->strippos,
+ avpkt->size - s->strippos);
}
if (s->rps <= 0) {
@@ -1018,12 +1143,12 @@ static int decode_frame(AVCodecContext *avctx,
dst = p->data[plane];
for (i = 0; i < s->height; i += s->rps) {
if (s->stripsizesoff)
- ssize = ff_tget(&stripsizes, s->sstype, s->le);
+ ssize = ff_tget(&stripsizes, s->sstype, le);
else
ssize = s->stripsize;
if (s->strippos)
- soff = ff_tget(&stripdata, s->sot, s->le);
+ soff = ff_tget(&stripdata, s->sot, le);
else
soff = s->stripoff;
@@ -1031,7 +1156,7 @@ static int decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Invalid strip size/offset\n");
return AVERROR_INVALIDDATA;
}
- if ((ret = tiff_unpack_strip(s, dst, stride, avpkt->data + soff, ssize,
+ if ((ret = tiff_unpack_strip(s, p, dst, stride, avpkt->data + soff, ssize, i,
FFMIN(s->rps, s->height - i))) < 0) {
if (avctx->err_recognition & AV_EF_EXPLODE)
return ret;
@@ -1040,6 +1165,10 @@ static int decode_frame(AVCodecContext *avctx,
dst += s->rps * stride;
}
if (s->predictor == 2) {
+ if (s->photometric == TIFF_PHOTOMETRIC_YCBCR) {
+ av_log(s->avctx, AV_LOG_ERROR, "predictor == 2 with YUV is unsupported");
+ return AVERROR_PATCHWELCOME;
+ }
dst = p->data[plane];
soff = s->bpp >> 3;
if (s->planar)
@@ -1072,12 +1201,12 @@ static int decode_frame(AVCodecContext *avctx,
}
}
- if (s->invert) {
+ if (s->photometric == TIFF_PHOTOMETRIC_WHITE_IS_ZERO) {
dst = p->data[plane];
for (i = 0; i < s->height; i++) {
for (j = 0; j < p->linesize[plane]; j++)
dst[j] = (s->avctx->pix_fmt == AV_PIX_FMT_PAL8 ? (1<<s->bpp) - 1 : 255) - dst[j];
- dst += p->linesize[plane];
+ dst += stride;
}
}
}
@@ -1100,6 +1229,8 @@ static av_cold int tiff_init(AVCodecContext *avctx)
s->width = 0;
s->height = 0;
+ s->subsampling[0] =
+ s->subsampling[1] = 1;
s->avctx = avctx;
ff_lzw_decode_open(&s->lzw);
ff_ccitt_unpack_init();
diff --git a/chromium/third_party/ffmpeg/libavcodec/tiff.h b/chromium/third_party/ffmpeg/libavcodec/tiff.h
index ae189b6fdd9..11e9f1629df 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tiff.h
+++ b/chromium/third_party/ffmpeg/libavcodec/tiff.h
@@ -40,7 +40,7 @@ enum TiffTags {
TIFF_HEIGHT,
TIFF_BPP,
TIFF_COMPR,
- TIFF_INVERT = 0x106,
+ TIFF_PHOTOMETRIC = 0x106,
TIFF_FILL_ORDER = 0x10A,
TIFF_DOCUMENT_NAME = 0x10D,
TIFF_IMAGE_DESCRIPTION = 0x10E,
@@ -146,6 +146,24 @@ enum TiffGeoTagKey {
TIFF_VERTICAL_UNITS_GEOKEY = 4099
};
+enum TiffPhotometric {
+ TIFF_PHOTOMETRIC_NONE = -1,
+ TIFF_PHOTOMETRIC_WHITE_IS_ZERO, /* mono or grayscale, 0 is white */
+ TIFF_PHOTOMETRIC_BLACK_IS_ZERO, /* mono or grayscale, 0 is black */
+ TIFF_PHOTOMETRIC_RGB, /* RGB or RGBA*/
+ TIFF_PHOTOMETRIC_PALETTE, /* Uses a palette */
+ TIFF_PHOTOMETRIC_ALPHA_MASK, /* Transparency mask */
+ TIFF_PHOTOMETRIC_SEPARATED, /* CMYK or some other ink set */
+ TIFF_PHOTOMETRIC_YCBCR, /* YCbCr */
+ TIFF_PHOTOMETRIC_CIE_LAB = 8, /* 1976 CIE L*a*b* */
+ TIFF_PHOTOMETRIC_ICC_LAB, /* ICC L*a*b* */
+ TIFF_PHOTOMETRIC_ITU_LAB, /* ITU L*a*b* */
+ TIFF_PHOTOMETRIC_CFA = 32803, /* Color Filter Array (DNG) */
+ TIFF_PHOTOMETRIC_LOG_L = 32844, /* CIE Log2(L) */
+ TIFF_PHOTOMETRIC_LOG_LUV, /* CIE Log L*u*v* */
+ TIFF_PHOTOMETRIC_LINEAR_RAW = 34892, /* Linear Raw (DNG) */
+};
+
enum TiffGeoTagType {
GEOTIFF_SHORT = 0,
GEOTIFF_DOUBLE = 34736,
diff --git a/chromium/third_party/ffmpeg/libavcodec/tiff_common.c b/chromium/third_party/ffmpeg/libavcodec/tiff_common.c
index ce91219150d..35119af558b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tiff_common.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tiff_common.c
@@ -42,15 +42,13 @@ int ff_tis_ifd(unsigned tag)
unsigned ff_tget_short(GetByteContext *gb, int le)
{
- unsigned v = le ? bytestream2_get_le16(gb) : bytestream2_get_be16(gb);
- return v;
+ return le ? bytestream2_get_le16(gb) : bytestream2_get_be16(gb);
}
unsigned ff_tget_long(GetByteContext *gb, int le)
{
- unsigned v = le ? bytestream2_get_le32(gb) : bytestream2_get_be32(gb);
- return v;
+ return le ? bytestream2_get_le32(gb) : bytestream2_get_be32(gb);
}
@@ -64,18 +62,14 @@ double ff_tget_double(GetByteContext *gb, int le)
unsigned ff_tget(GetByteContext *gb, int type, int le)
{
switch (type) {
- case TIFF_BYTE:
- return bytestream2_get_byte(gb);
- case TIFF_SHORT:
- return ff_tget_short(gb, le);
- case TIFF_LONG:
- return ff_tget_long(gb, le);
- default:
- return UINT_MAX;
+ case TIFF_BYTE: return bytestream2_get_byte(gb);
+ case TIFF_SHORT: return ff_tget_short(gb, le);
+ case TIFF_LONG: return ff_tget_long(gb, le);
+ default: return UINT_MAX;
}
}
-static char *auto_sep(int count, char *sep, int i, int columns)
+static const char *auto_sep(int count, const char *sep, int i, int columns)
{
if (sep)
return i ? sep : "";
@@ -165,7 +159,7 @@ int ff_tadd_doubles_metadata(int count, const char *name, const char *sep,
av_bprint_init(&bp, 10 * count, 100 * count);
for (i = 0; i < count; i++) {
- av_bprintf(&bp, "%s%f", auto_sep(count, sep, i, 4), ff_tget_double(gb, le));
+ av_bprintf(&bp, "%s%.15g", auto_sep(count, sep, i, 4), ff_tget_double(gb, le));
}
if ((i = av_bprint_finalize(&bp, &ap))) {
@@ -182,7 +176,7 @@ int ff_tadd_doubles_metadata(int count, const char *name, const char *sep,
int ff_tadd_shorts_metadata(int count, const char *name, const char *sep,
- GetByteContext *gb, int le, AVDictionary **metadata)
+ GetByteContext *gb, int le, int is_signed, AVDictionary **metadata)
{
AVBPrint bp;
char *ap;
@@ -196,7 +190,8 @@ int ff_tadd_shorts_metadata(int count, const char *name, const char *sep,
av_bprint_init(&bp, 10 * count, AV_BPRINT_SIZE_UNLIMITED);
for (i = 0; i < count; i++) {
- av_bprintf(&bp, "%s%5i", auto_sep(count, sep, i, 8), ff_tget_short(gb, le));
+ int v = is_signed ? (int16_t)ff_tget_short(gb, le) : ff_tget_short(gb, le);
+ av_bprintf(&bp, "%s%5i", auto_sep(count, sep, i, 8), v);
}
if ((i = av_bprint_finalize(&bp, &ap))) {
@@ -213,7 +208,7 @@ int ff_tadd_shorts_metadata(int count, const char *name, const char *sep,
int ff_tadd_bytes_metadata(int count, const char *name, const char *sep,
- GetByteContext *gb, int le, AVDictionary **metadata)
+ GetByteContext *gb, int le, int is_signed, AVDictionary **metadata)
{
AVBPrint bp;
char *ap;
@@ -227,7 +222,8 @@ int ff_tadd_bytes_metadata(int count, const char *name, const char *sep,
av_bprint_init(&bp, 10 * count, AV_BPRINT_SIZE_UNLIMITED);
for (i = 0; i < count; i++) {
- av_bprintf(&bp, "%s%3i", auto_sep(count, sep, i, 16), bytestream2_get_byte(gb));
+ int v = is_signed ? (int8_t)bytestream2_get_byte(gb) : bytestream2_get_byte(gb);
+ av_bprintf(&bp, "%s%3i", auto_sep(count, sep, i, 16), v);
}
if ((i = av_bprint_finalize(&bp, &ap))) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/tiff_common.h b/chromium/third_party/ffmpeg/libavcodec/tiff_common.h
index 01a7b0891b7..16c9e50850d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tiff_common.h
+++ b/chromium/third_party/ffmpeg/libavcodec/tiff_common.h
@@ -121,13 +121,13 @@ int ff_tadd_doubles_metadata(int count, const char *name, const char *sep,
* into the metadata dictionary.
*/
int ff_tadd_shorts_metadata(int count, const char *name, const char *sep,
- GetByteContext *gb, int le, AVDictionary **metadata);
+ GetByteContext *gb, int le, int is_signed, AVDictionary **metadata);
/** Adds count bytes converted to a string
* into the metadata dictionary.
*/
int ff_tadd_bytes_metadata(int count, const char *name, const char *sep,
- GetByteContext *gb, int le, AVDictionary **metadata);
+ GetByteContext *gb, int le, int is_signed, AVDictionary **metadata);
/** Adds a string of count characters
* into the metadata dictionary.
diff --git a/chromium/third_party/ffmpeg/libavcodec/tiffenc.c b/chromium/third_party/ffmpeg/libavcodec/tiffenc.c
index 7b1e5104bda..456b3bf54ac 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tiffenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tiffenc.c
@@ -58,7 +58,7 @@ typedef struct TiffEncoderContext {
unsigned int bpp; ///< bits per pixel
int compr; ///< compression level
int bpp_tab_size; ///< bpp_tab size
- int photometric_interpretation; ///< photometric interpretation
+ enum TiffPhotometric photometric_interpretation; ///< photometric interpretation
int strips; ///< number of strips
uint32_t *strip_sizes;
unsigned int strip_sizes_size;
@@ -254,7 +254,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
alpha = 1;
case AV_PIX_FMT_RGB48LE:
case AV_PIX_FMT_RGB24:
- s->photometric_interpretation = 2;
+ s->photometric_interpretation = TIFF_PHOTOMETRIC_RGB;
break;
case AV_PIX_FMT_GRAY8:
avctx->bits_per_coded_sample = 0x28;
@@ -262,13 +262,13 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
alpha = avctx->pix_fmt == AV_PIX_FMT_GRAY8A;
case AV_PIX_FMT_GRAY16LE:
case AV_PIX_FMT_MONOBLACK:
- s->photometric_interpretation = 1;
+ s->photometric_interpretation = TIFF_PHOTOMETRIC_BLACK_IS_ZERO;
break;
case AV_PIX_FMT_PAL8:
- s->photometric_interpretation = 3;
+ s->photometric_interpretation = TIFF_PHOTOMETRIC_PALETTE;
break;
case AV_PIX_FMT_MONOWHITE:
- s->photometric_interpretation = 0;
+ s->photometric_interpretation = TIFF_PHOTOMETRIC_WHITE_IS_ZERO;
break;
case AV_PIX_FMT_YUV420P:
case AV_PIX_FMT_YUV422P:
@@ -277,7 +277,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
case AV_PIX_FMT_YUV410P:
case AV_PIX_FMT_YUV411P:
av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &shift_h, &shift_v);
- s->photometric_interpretation = 6;
+ s->photometric_interpretation = TIFF_PHOTOMETRIC_YCBCR;
s->subsampling[0] = 1 << shift_h;
s->subsampling[1] = 1 << shift_v;
is_yuv = 1;
@@ -426,9 +426,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (s->bpp_tab_size)
add_entry(s, TIFF_BPP, TIFF_SHORT, s->bpp_tab_size, bpp_tab);
- add_entry1(s, TIFF_COMPR, TIFF_SHORT, s->compr);
- add_entry1(s, TIFF_INVERT, TIFF_SHORT, s->photometric_interpretation);
- add_entry(s, TIFF_STRIP_OFFS, TIFF_LONG, strips, s->strip_offsets);
+ add_entry1(s, TIFF_COMPR, TIFF_SHORT, s->compr);
+ add_entry1(s, TIFF_PHOTOMETRIC, TIFF_SHORT, s->photometric_interpretation);
+ add_entry(s, TIFF_STRIP_OFFS, TIFF_LONG, strips, s->strip_offsets);
if (s->bpp_tab_size)
add_entry1(s, TIFF_SAMPLES_PER_PIXEL, TIFF_SHORT, s->bpp_tab_size);
@@ -436,6 +436,13 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
add_entry1(s, TIFF_ROWSPERSTRIP, TIFF_LONG, s->rps);
add_entry(s, TIFF_STRIP_SIZE, TIFF_LONG, strips, s->strip_sizes);
add_entry(s, TIFF_XRES, TIFF_RATIONAL, 1, res);
+ if (avctx->sample_aspect_ratio.num > 0 &&
+ avctx->sample_aspect_ratio.den > 0) {
+ AVRational y = av_mul_q(av_make_q(s->dpi, 1),
+ avctx->sample_aspect_ratio);
+ res[0] = y.num;
+ res[1] = y.den;
+ }
add_entry(s, TIFF_YRES, TIFF_RATIONAL, 1, res);
add_entry1(s, TIFF_RES_UNIT, TIFF_SHORT, 2);
diff --git a/chromium/third_party/ffmpeg/libavcodec/tpel_template.c b/chromium/third_party/ffmpeg/libavcodec/tpel_template.c
new file mode 100644
index 00000000000..6e2502507b2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/tpel_template.c
@@ -0,0 +1,80 @@
+/*
+ * 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 <stddef.h>
+#include <stdint.h>
+
+#include "libavutil/intreadwrite.h"
+#include "pixels.h"
+#include "rnd_avg.h"
+
+#include "bit_depth_template.c"
+
+#define DEF_TPEL(OPNAME, OP) \
+static inline void FUNCC(OPNAME ## _pixels2)(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ int i; \
+ for (i = 0; i < h; i++) { \
+ OP(*((pixel2 *) block), AV_RN2P(pixels)); \
+ pixels += line_size; \
+ block += line_size; \
+ } \
+} \
+ \
+static inline void FUNCC(OPNAME ## _pixels4)(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ int i; \
+ for (i = 0; i < h; i++) { \
+ OP(*((pixel4 *) block), AV_RN4P(pixels)); \
+ pixels += line_size; \
+ block += line_size; \
+ } \
+} \
+ \
+static inline void FUNCC(OPNAME ## _pixels8)(uint8_t *block, \
+ const uint8_t *pixels, \
+ ptrdiff_t line_size, \
+ int h) \
+{ \
+ int i; \
+ for (i = 0; i < h; i++) { \
+ OP(*((pixel4 *) block), AV_RN4P(pixels)); \
+ OP(*((pixel4 *) (block + 4 * sizeof(pixel))), \
+ AV_RN4P(pixels + 4 * sizeof(pixel))); \
+ pixels += line_size; \
+ block += line_size; \
+ } \
+} \
+ \
+CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16), \
+ FUNCC(OPNAME ## _pixels8), \
+ 8 * sizeof(pixel))
+
+#define op_avg(a, b) a = rnd_avg_pixel4(a, b)
+#define op_put(a, b) a = b
+
+DEF_TPEL(avg, op_avg)
+DEF_TPEL(put, op_put)
+#undef op_avg
+#undef op_put
diff --git a/chromium/third_party/ffmpeg/libavcodec/tpeldsp.c b/chromium/third_party/ffmpeg/libavcodec/tpeldsp.c
new file mode 100644
index 00000000000..b5af72cac06
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/tpeldsp.c
@@ -0,0 +1,333 @@
+/*
+ * thirdpel DSP functions
+ *
+ * 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
+ * thirdpel DSP functions
+ */
+
+#include <stdint.h>
+
+#include "libavutil/attributes.h"
+#include "tpeldsp.h"
+
+#define BIT_DEPTH 8
+#include "tpel_template.c"
+
+static inline void put_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ switch (width) {
+ case 2:
+ put_pixels2_8_c(dst, src, stride, height);
+ break;
+ case 4:
+ put_pixels4_8_c(dst, src, stride, height);
+ break;
+ case 8:
+ put_pixels8_8_c(dst, src, stride, height);
+ break;
+ case 16:
+ put_pixels16_8_c(dst, src, stride, height);
+ break;
+ }
+}
+
+static inline void put_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = ((2 * src[j] + src[j + 1] + 1) *
+ 683) >> 11;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void put_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = ((src[j] + 2 * src[j + 1] + 1) *
+ 683) >> 11;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void put_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = ((2 * src[j] + src[j + stride] + 1) *
+ 683) >> 11;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void put_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = ((4 * src[j] + 3 * src[j + 1] +
+ 3 * src[j + stride] + 2 * src[j + stride + 1] + 6) *
+ 2731) >> 15;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void put_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = ((3 * src[j] + 2 * src[j + 1] +
+ 4 * src[j + stride] + 3 * src[j + stride + 1] + 6) *
+ 2731) >> 15;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void put_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = ((src[j] + 2 * src[j + stride] + 1) *
+ 683) >> 11;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void put_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = ((3 * src[j] + 4 * src[j + 1] +
+ 2 * src[j + stride] + 3 * src[j + stride + 1] + 6) *
+ 2731) >> 15;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void put_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = ((2 * src[j] + 3 * src[j + 1] +
+ 3 * src[j + stride] + 4 * src[j + stride + 1] + 6) *
+ 2731) >> 15;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void avg_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ switch (width) {
+ case 2:
+ avg_pixels2_8_c(dst, src, stride, height);
+ break;
+ case 4:
+ avg_pixels4_8_c(dst, src, stride, height);
+ break;
+ case 8:
+ avg_pixels8_8_c(dst, src, stride, height);
+ break;
+ case 16:
+ avg_pixels16_8_c(dst, src, stride, height);
+ break;
+ }
+}
+
+static inline void avg_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = (dst[j] +
+ (((2 * src[j] + src[j + 1] + 1) *
+ 683) >> 11) + 1) >> 1;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void avg_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = (dst[j] +
+ (((src[j] + 2 * src[j + 1] + 1) *
+ 683) >> 11) + 1) >> 1;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void avg_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = (dst[j] +
+ (((2 * src[j] + src[j + stride] + 1) *
+ 683) >> 11) + 1) >> 1;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void avg_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = (dst[j] +
+ (((4 * src[j] + 3 * src[j + 1] +
+ 3 * src[j + stride] + 2 * src[j + stride + 1] + 6) *
+ 2731) >> 15) + 1) >> 1;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void avg_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = (dst[j] +
+ (((3 * src[j] + 2 * src[j + 1] +
+ 4 * src[j + stride] + 3 * src[j + stride + 1] + 6) *
+ 2731) >> 15) + 1) >> 1;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void avg_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = (dst[j] +
+ (((src[j] + 2 * src[j + stride] + 1) *
+ 683) >> 11) + 1) >> 1;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void avg_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = (dst[j] +
+ (((3 * src[j] + 4 * src[j + 1] +
+ 2 * src[j + stride] + 3 * src[j + stride + 1] + 6) *
+ 2731) >> 15) + 1) >> 1;
+ src += stride;
+ dst += stride;
+ }
+}
+
+static inline void avg_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src,
+ int stride, int width, int height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++)
+ dst[j] = (dst[j] +
+ (((2 * src[j] + 3 * src[j + 1] +
+ 3 * src[j + stride] + 4 * src[j + stride + 1] + 6) *
+ 2731) >> 15) + 1) >> 1;
+ src += stride;
+ dst += stride;
+ }
+}
+
+av_cold void ff_tpeldsp_init(TpelDSPContext *c)
+{
+ c->put_tpel_pixels_tab[ 0] = put_tpel_pixels_mc00_c;
+ c->put_tpel_pixels_tab[ 1] = put_tpel_pixels_mc10_c;
+ c->put_tpel_pixels_tab[ 2] = put_tpel_pixels_mc20_c;
+ c->put_tpel_pixels_tab[ 4] = put_tpel_pixels_mc01_c;
+ c->put_tpel_pixels_tab[ 5] = put_tpel_pixels_mc11_c;
+ c->put_tpel_pixels_tab[ 6] = put_tpel_pixels_mc21_c;
+ c->put_tpel_pixels_tab[ 8] = put_tpel_pixels_mc02_c;
+ c->put_tpel_pixels_tab[ 9] = put_tpel_pixels_mc12_c;
+ c->put_tpel_pixels_tab[10] = put_tpel_pixels_mc22_c;
+
+ c->avg_tpel_pixels_tab[ 0] = avg_tpel_pixels_mc00_c;
+ c->avg_tpel_pixels_tab[ 1] = avg_tpel_pixels_mc10_c;
+ c->avg_tpel_pixels_tab[ 2] = avg_tpel_pixels_mc20_c;
+ c->avg_tpel_pixels_tab[ 4] = avg_tpel_pixels_mc01_c;
+ c->avg_tpel_pixels_tab[ 5] = avg_tpel_pixels_mc11_c;
+ c->avg_tpel_pixels_tab[ 6] = avg_tpel_pixels_mc21_c;
+ c->avg_tpel_pixels_tab[ 8] = avg_tpel_pixels_mc02_c;
+ c->avg_tpel_pixels_tab[ 9] = avg_tpel_pixels_mc12_c;
+ c->avg_tpel_pixels_tab[10] = avg_tpel_pixels_mc22_c;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/tpeldsp.h b/chromium/third_party/ffmpeg/libavcodec/tpeldsp.h
new file mode 100644
index 00000000000..3732f179f46
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/tpeldsp.h
@@ -0,0 +1,59 @@
+/*
+ * thirdpel DSP functions
+ *
+ * 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
+ * thirdpel DSP functions
+ */
+
+#ifndef AVCODEC_TPELDSP_H
+#define AVCODEC_TPELDSP_H
+
+#include <stdint.h>
+
+/* add and put pixel (decoding) */
+// blocksizes for hpel_pixels_func are 8x4,8x8 16x8 16x16
+// h for hpel_pixels_func is limited to {width/2, width} but never larger
+// than 16 and never smaller than 4
+typedef void (*tpel_mc_func)(uint8_t *block /* align width (8 or 16) */,
+ const uint8_t *pixels /* align 1 */,
+ int line_size, int w, int h);
+
+/**
+ * thirdpel DSP context
+ */
+typedef struct TpelDSPContext {
+ /**
+ * Thirdpel motion compensation with rounding (a + b + 1) >> 1.
+ * this is an array[12] of motion compensation functions for the
+ * 9 thirdpel positions<br>
+ * *pixels_tab[xthirdpel + 4 * ythirdpel]
+ * @param block destination where the result is stored
+ * @param pixels source
+ * @param line_size number of bytes in a horizontal line of block
+ * @param h height
+ */
+ tpel_mc_func put_tpel_pixels_tab[11]; // FIXME individual func ptr per width?
+ tpel_mc_func avg_tpel_pixels_tab[11]; // FIXME individual func ptr per width?
+} TpelDSPContext;
+
+void ff_tpeldsp_init(TpelDSPContext *c);
+
+#endif /* AVCODEC_TPELDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/truemotion1.c b/chromium/third_party/ffmpeg/libavcodec/truemotion1.c
index 6528a1f3912..ed799592407 100644
--- a/chromium/third_party/ffmpeg/libavcodec/truemotion1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/truemotion1.c
@@ -317,12 +317,17 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
const uint8_t *sel_vector_table;
header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f;
- if (s->buf[0] < 0x10 || header.header_size >= s->size)
+ if (s->buf[0] < 0x10)
{
av_log(s->avctx, AV_LOG_ERROR, "invalid header size (%d)\n", s->buf[0]);
return AVERROR_INVALIDDATA;
}
+ if (header.header_size + 1 > s->size) {
+ av_log(s->avctx, AV_LOG_ERROR, "Input packet too small.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
/* unscramble the header bytes with a XOR operation */
for (i = 1; i < header.header_size; i++)
header_buffer[i - 1] = s->buf[i] ^ s->buf[i + 1];
diff --git a/chromium/third_party/ffmpeg/libavcodec/truemotion2.c b/chromium/third_party/ffmpeg/libavcodec/truemotion2.c
index a1683f5b1ad..c3c2701ee54 100644
--- a/chromium/third_party/ffmpeg/libavcodec/truemotion2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/truemotion2.c
@@ -24,6 +24,8 @@
* Duck TrueMotion2 decoder.
*/
+#include <inttypes.h>
+
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
@@ -246,7 +248,8 @@ static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf)
case TM2_NEW_HEADER_MAGIC:
return 0;
default:
- av_log(ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic);
+ av_log(ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08"PRIX32"\n",
+ magic);
return AVERROR_INVALIDDATA;
}
}
@@ -259,7 +262,8 @@ static int tm2_read_deltas(TM2Context *ctx, int stream_id)
d = get_bits(&ctx->gb, 9);
mb = get_bits(&ctx->gb, 5);
- if ((d < 1) || (d > TM2_DELTAS) || (mb < 1) || (mb > 32)) {
+ av_assert2(mb < 32);
+ if ((d < 1) || (d > TM2_DELTAS) || (mb < 1)) {
av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect delta table: %i deltas x %i bits\n", d, mb);
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/tscc2.c b/chromium/third_party/ffmpeg/libavcodec/tscc2.c
index bdc75256b3b..487af5462ca 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tscc2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tscc2.c
@@ -24,6 +24,8 @@
* TechSmith Screen Codec 2 decoder
*/
+#include <inttypes.h>
+
#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "get_bits.h"
@@ -227,7 +229,8 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
bytestream2_init(&gb, buf, buf_size);
frame_type = bytestream2_get_byte(&gb);
if (frame_type > 1) {
- av_log(avctx, AV_LOG_ERROR, "Incorrect frame type %d\n", frame_type);
+ av_log(avctx, AV_LOG_ERROR, "Incorrect frame type %"PRIu32"\n",
+ frame_type);
return AVERROR_INVALIDDATA;
}
@@ -309,7 +312,7 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
}
}
if (bytestream2_get_bytes_left(&gb) < size) {
- av_log(avctx, AV_LOG_ERROR, "Invalid slice size (%d/%d)\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid slice size (%"PRIu32"/%u)\n",
size, bytestream2_get_bytes_left(&gb));
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/tta.c b/chromium/third_party/ffmpeg/libavcodec/tta.c
index b917881d652..87bfe7b8118 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tta.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tta.c
@@ -30,6 +30,7 @@
#define BITSTREAM_READER_LE
#include <limits.h>
#include "ttadata.h"
+#include "ttadsp.h"
#include "avcodec.h"
#include "get_bits.h"
#include "thread.h"
@@ -56,39 +57,9 @@ typedef struct TTAContext {
uint8_t crc_pass[8];
uint8_t *pass;
TTAChannel *ch_ctx;
+ TTADSPContext dsp;
} TTAContext;
-static inline void ttafilter_process(TTAFilter *c, int32_t *in)
-{
- register int32_t *dl = c->dl, *qm = c->qm, *dx = c->dx, sum = c->round;
-
- if (c->error < 0) {
- qm[0] -= dx[0]; qm[1] -= dx[1]; qm[2] -= dx[2]; qm[3] -= dx[3];
- qm[4] -= dx[4]; qm[5] -= dx[5]; qm[6] -= dx[6]; qm[7] -= dx[7];
- } else if (c->error > 0) {
- qm[0] += dx[0]; qm[1] += dx[1]; qm[2] += dx[2]; qm[3] += dx[3];
- qm[4] += dx[4]; qm[5] += dx[5]; qm[6] += dx[6]; qm[7] += dx[7];
- }
-
- sum += dl[0] * qm[0] + dl[1] * qm[1] + dl[2] * qm[2] + dl[3] * qm[3] +
- dl[4] * qm[4] + dl[5] * qm[5] + dl[6] * qm[6] + dl[7] * qm[7];
-
- dx[0] = dx[1]; dx[1] = dx[2]; dx[2] = dx[3]; dx[3] = dx[4];
- dl[0] = dl[1]; dl[1] = dl[2]; dl[2] = dl[3]; dl[3] = dl[4];
-
- dx[4] = ((dl[4] >> 30) | 1);
- dx[5] = ((dl[5] >> 30) | 2) & ~1;
- dx[6] = ((dl[6] >> 30) | 2) & ~1;
- dx[7] = ((dl[7] >> 30) | 4) & ~3;
-
- c->error = *in;
- *in += (sum >> c->shift);
-
- dl[4] = -dl[5]; dl[5] = -dl[6];
- dl[6] = *in - dl[7]; dl[7] = *in;
- dl[5] += dl[6]; dl[4] += dl[5];
-}
-
static const int64_t tta_channel_layouts[7] = {
AV_CH_LAYOUT_STEREO,
AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY,
@@ -133,12 +104,12 @@ static int allocate_buffers(AVCodecContext *avctx)
TTAContext *s = avctx->priv_data;
if (s->bps < 3) {
- s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels);
+ s->decode_buffer = av_mallocz_array(sizeof(int32_t)*s->frame_length, s->channels);
if (!s->decode_buffer)
return AVERROR(ENOMEM);
} else
s->decode_buffer = NULL;
- s->ch_ctx = av_malloc(avctx->channels * sizeof(*s->ch_ctx));
+ s->ch_ctx = av_malloc_array(avctx->channels, sizeof(*s->ch_ctx));
if (!s->ch_ctx) {
av_freep(&s->decode_buffer);
return AVERROR(ENOMEM);
@@ -234,6 +205,8 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
return AVERROR_INVALIDDATA;
}
+ ff_ttadsp_init(&s->dsp);
+
return allocate_buffers(avctx);
}
@@ -335,7 +308,8 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
*p = 1 + ((value >> 1) ^ ((value & 1) - 1));
// run hybrid filter
- ttafilter_process(filter, p);
+ s->dsp.ttafilter_process_dec(filter->qm, filter->dx, filter->dl, &filter->error, p,
+ filter->shift, filter->round);
// fixed order prediction
#define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k)
diff --git a/chromium/third_party/ffmpeg/libavcodec/ttadsp.c b/chromium/third_party/ffmpeg/libavcodec/ttadsp.c
new file mode 100644
index 00000000000..30b7ab9eb7b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/ttadsp.c
@@ -0,0 +1,57 @@
+/*
+ * 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 "ttadsp.h"
+
+static void ttafilter_process_dec_c(int32_t *qm, int32_t *dx, int32_t *dl,
+ int32_t *error, int32_t *in, int32_t shift,
+ int32_t round) {
+ if (*error < 0) {
+ qm[0] -= dx[0]; qm[1] -= dx[1]; qm[2] -= dx[2]; qm[3] -= dx[3];
+ qm[4] -= dx[4]; qm[5] -= dx[5]; qm[6] -= dx[6]; qm[7] -= dx[7];
+ } else if (*error > 0) {
+ qm[0] += dx[0]; qm[1] += dx[1]; qm[2] += dx[2]; qm[3] += dx[3];
+ qm[4] += dx[4]; qm[5] += dx[5]; qm[6] += dx[6]; qm[7] += dx[7];
+ }
+
+ round += dl[0] * qm[0] + dl[1] * qm[1] + dl[2] * qm[2] + dl[3] * qm[3] +
+ dl[4] * qm[4] + dl[5] * qm[5] + dl[6] * qm[6] + dl[7] * qm[7];
+
+ dx[0] = dx[1]; dx[1] = dx[2]; dx[2] = dx[3]; dx[3] = dx[4];
+ dl[0] = dl[1]; dl[1] = dl[2]; dl[2] = dl[3]; dl[3] = dl[4];
+
+ dx[4] = ((dl[4] >> 30) | 1);
+ dx[5] = ((dl[5] >> 30) | 2) & ~1;
+ dx[6] = ((dl[6] >> 30) | 2) & ~1;
+ dx[7] = ((dl[7] >> 30) | 4) & ~3;
+
+ *error = *in;
+ *in += (round >> shift);
+
+ dl[4] = -dl[5]; dl[5] = -dl[6];
+ dl[6] = *in - dl[7]; dl[7] = *in;
+ dl[5] += dl[6]; dl[4] += dl[5];
+}
+
+av_cold void ff_ttadsp_init(TTADSPContext *c)
+{
+ c->ttafilter_process_dec = ttafilter_process_dec_c;
+
+ if (ARCH_X86)
+ ff_ttadsp_init_x86(c);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/ttadsp.h b/chromium/third_party/ffmpeg/libavcodec/ttadsp.h
new file mode 100644
index 00000000000..56930f1c855
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/ttadsp.h
@@ -0,0 +1,34 @@
+/*
+ * 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_TTADSP_H
+#define AVCODEC_TTADSP_H
+
+#include <stdint.h>
+#include "ttadata.h"
+
+typedef struct TTADSPContext {
+ void (*ttafilter_process_dec)(int32_t *qm, int32_t *dx, int32_t *dl,
+ int32_t *error, int32_t *in, int32_t shift,
+ int32_t round);
+} TTADSPContext;
+
+void ff_ttadsp_init(TTADSPContext *c);
+void ff_ttadsp_init_x86(TTADSPContext *c);
+
+#endif /* AVCODEC_TTADSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/ttaenc.c b/chromium/third_party/ffmpeg/libavcodec/ttaenc.c
index e95dd6b22f1..75d16642ea8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ttaenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ttaenc.c
@@ -53,7 +53,7 @@ static av_cold int tta_encode_init(AVCodecContext *avctx)
s->bps = avctx->bits_per_raw_sample >> 3;
avctx->frame_size = 256 * avctx->sample_rate / 245;
- s->ch_ctx = av_malloc(avctx->channels * sizeof(*s->ch_ctx));
+ s->ch_ctx = av_malloc_array(avctx->channels, sizeof(*s->ch_ctx));
if (!s->ch_ctx)
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavcodec/utils.c b/chromium/third_party/ffmpeg/libavcodec/utils.c
index a79d9b39fba..b1ba1f46829 100644
--- a/chromium/third_party/ffmpeg/libavcodec/utils.c
+++ b/chromium/third_party/ffmpeg/libavcodec/utils.c
@@ -46,6 +46,7 @@
#include "thread.h"
#include "frame_thread_encoder.h"
#include "internal.h"
+#include "raw.h"
#include "bytestream.h"
#include "version.h"
#include <stdlib.h>
@@ -117,18 +118,23 @@ static int volatile entangled_thread_counter = 0;
static void *codec_mutex;
static void *avformat_mutex;
-// TODO(dalecurtis): Reenable once AVCODEC 55 is standard.
-// #if FF_API_FAST_MALLOC && CONFIG_SHARED && HAVE_SYMVER
-// FF_SYMVER(void*, av_fast_realloc, (void *ptr, unsigned int *size, size_t min_size), "LIBAVCODEC_55")
-// {
-// return av_fast_realloc(ptr, size, min_size);
-// }
+#if CONFIG_RAISE_MAJOR
+# define LIBNAME "LIBAVCODEC_155"
+#else
+# define LIBNAME "LIBAVCODEC_55"
+#endif
+
+#if FF_API_FAST_MALLOC && CONFIG_SHARED && HAVE_SYMVER
+FF_SYMVER(void*, av_fast_realloc, (void *ptr, unsigned int *size, size_t min_size), LIBNAME)
+{
+ return av_fast_realloc(ptr, size, min_size);
+}
-// FF_SYMVER(void, av_fast_malloc, (void *ptr, unsigned int *size, size_t min_size), "LIBAVCODEC_55")
-// {
-// av_fast_malloc(ptr, size, min_size);
-// }
-// #endif
+FF_SYMVER(void, av_fast_malloc, (void *ptr, unsigned int *size, size_t min_size), LIBNAME)
+{
+ av_fast_malloc(ptr, size, min_size);
+}
+#endif
static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size, int zero_realloc)
{
@@ -170,6 +176,7 @@ void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size)
/* encoder management */
static AVCodec *first_avcodec = NULL;
+static AVCodec **last_avcodec = &first_avcodec;
AVCodec *av_codec_next(const AVCodec *c)
{
@@ -205,25 +212,31 @@ av_cold void avcodec_register(AVCodec *codec)
{
AVCodec **p;
avcodec_init();
- p = &first_avcodec;
+ p = last_avcodec;
codec->next = NULL;
while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, codec))
p = &(*p)->next;
+ last_avcodec = &codec->next;
if (codec->init_static_data)
codec->init_static_data(codec);
}
+#if FF_API_EMU_EDGE
unsigned avcodec_get_edge_width(void)
{
return EDGE_WIDTH;
}
+#endif
#if FF_API_SET_DIMENSIONS
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
{
- ff_set_dimensions(s, width, height);
+ int ret = ff_set_dimensions(s, width, height);
+ if (ret < 0) {
+ av_log(s, AV_LOG_WARNING, "Failed to set dimensions %d %d\n", width, height);
+ }
}
#endif
@@ -242,11 +255,25 @@ int ff_set_dimensions(AVCodecContext *s, int width, int height)
return ret;
}
-#if HAVE_NEON || ARCH_PPC || HAVE_MMX
-# define STRIDE_ALIGN 16
-#else
-# define STRIDE_ALIGN 8
-#endif
+int ff_side_data_update_matrix_encoding(AVFrame *frame,
+ enum AVMatrixEncoding matrix_encoding)
+{
+ AVFrameSideData *side_data;
+ enum AVMatrixEncoding *data;
+
+ side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_MATRIXENCODING);
+ if (!side_data)
+ side_data = av_frame_new_side_data(frame, AV_FRAME_DATA_MATRIXENCODING,
+ sizeof(enum AVMatrixEncoding));
+
+ if (!side_data)
+ return AVERROR(ENOMEM);
+
+ data = (enum AVMatrixEncoding*)side_data->data;
+ *data = matrix_encoding;
+
+ return 0;
+}
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
int linesize_align[AV_NUM_DATA_POINTERS])
@@ -258,6 +285,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
switch (s->pix_fmt) {
case AV_PIX_FMT_YUV420P:
case AV_PIX_FMT_YUYV422:
+ case AV_PIX_FMT_YVYU422:
case AV_PIX_FMT_UYVY422:
case AV_PIX_FMT_YUV422P:
case AV_PIX_FMT_YUV440P:
@@ -284,6 +312,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
case AV_PIX_FMT_YUV420P14BE:
case AV_PIX_FMT_YUV420P16LE:
case AV_PIX_FMT_YUV420P16BE:
+ case AV_PIX_FMT_YUVA420P9LE:
+ case AV_PIX_FMT_YUVA420P9BE:
+ case AV_PIX_FMT_YUVA420P10LE:
+ case AV_PIX_FMT_YUVA420P10BE:
+ case AV_PIX_FMT_YUVA420P16LE:
+ case AV_PIX_FMT_YUVA420P16BE:
case AV_PIX_FMT_YUV422P9LE:
case AV_PIX_FMT_YUV422P9BE:
case AV_PIX_FMT_YUV422P10LE:
@@ -294,6 +328,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
case AV_PIX_FMT_YUV422P14BE:
case AV_PIX_FMT_YUV422P16LE:
case AV_PIX_FMT_YUV422P16BE:
+ case AV_PIX_FMT_YUVA422P9LE:
+ case AV_PIX_FMT_YUVA422P9BE:
+ case AV_PIX_FMT_YUVA422P10LE:
+ case AV_PIX_FMT_YUVA422P10BE:
+ case AV_PIX_FMT_YUVA422P16LE:
+ case AV_PIX_FMT_YUVA422P16BE:
case AV_PIX_FMT_YUV444P9LE:
case AV_PIX_FMT_YUV444P9BE:
case AV_PIX_FMT_YUV444P10LE:
@@ -304,18 +344,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
case AV_PIX_FMT_YUV444P14BE:
case AV_PIX_FMT_YUV444P16LE:
case AV_PIX_FMT_YUV444P16BE:
- case AV_PIX_FMT_YUVA420P9LE:
- case AV_PIX_FMT_YUVA420P9BE:
- case AV_PIX_FMT_YUVA420P10LE:
- case AV_PIX_FMT_YUVA420P10BE:
- case AV_PIX_FMT_YUVA420P16LE:
- case AV_PIX_FMT_YUVA420P16BE:
- case AV_PIX_FMT_YUVA422P9LE:
- case AV_PIX_FMT_YUVA422P9BE:
- case AV_PIX_FMT_YUVA422P10LE:
- case AV_PIX_FMT_YUVA422P10BE:
- case AV_PIX_FMT_YUVA422P16LE:
- case AV_PIX_FMT_YUVA422P16BE:
case AV_PIX_FMT_YUVA444P9LE:
case AV_PIX_FMT_YUVA444P9BE:
case AV_PIX_FMT_YUVA444P10LE:
@@ -446,7 +474,7 @@ int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
planar = av_sample_fmt_is_planar(sample_fmt);
if (planar && nb_channels > AV_NUM_DATA_POINTERS) {
- if (!(frame->extended_data = av_mallocz(nb_channels *
+ if (!(frame->extended_data = av_mallocz_array(nb_channels,
sizeof(*frame->extended_data))))
return AVERROR(ENOMEM);
} else {
@@ -581,9 +609,9 @@ static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame)
frame->linesize[0] = pool->linesize[0];
if (planes > AV_NUM_DATA_POINTERS) {
- frame->extended_data = av_mallocz(planes * sizeof(*frame->extended_data));
+ frame->extended_data = av_mallocz_array(planes, sizeof(*frame->extended_data));
frame->nb_extended_buf = planes - AV_NUM_DATA_POINTERS;
- frame->extended_buf = av_mallocz(frame->nb_extended_buf *
+ frame->extended_buf = av_mallocz_array(frame->nb_extended_buf,
sizeof(*frame->extended_buf));
if (!frame->extended_data || !frame->extended_buf) {
av_freep(&frame->extended_data);
@@ -719,11 +747,26 @@ FF_ENABLE_DEPRECATION_WARNINGS
int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
{
- if (avctx->internal->pkt) {
- frame->pkt_pts = avctx->internal->pkt->pts;
- av_frame_set_pkt_pos (frame, avctx->internal->pkt->pos);
- av_frame_set_pkt_duration(frame, avctx->internal->pkt->duration);
- av_frame_set_pkt_size (frame, avctx->internal->pkt->size);
+ AVPacket *pkt = avctx->internal->pkt;
+
+ if (pkt) {
+ uint8_t *packet_sd;
+ AVFrameSideData *frame_sd;
+ int size;
+ frame->pkt_pts = pkt->pts;
+ av_frame_set_pkt_pos (frame, pkt->pos);
+ av_frame_set_pkt_duration(frame, pkt->duration);
+ av_frame_set_pkt_size (frame, pkt->size);
+
+ /* copy the replaygain data to the output frame */
+ packet_sd = av_packet_get_side_data(pkt, AV_PKT_DATA_REPLAYGAIN, &size);
+ if (packet_sd) {
+ frame_sd = av_frame_new_side_data(frame, AV_FRAME_DATA_REPLAYGAIN, size);
+ if (!frame_sd)
+ return AVERROR(ENOMEM);
+
+ memcpy(frame_sd->data, packet_sd, size);
+ }
} else {
frame->pkt_pts = AV_NOPTS_VALUE;
av_frame_set_pkt_pos (frame, -1);
@@ -734,10 +777,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
switch (avctx->codec->type) {
case AVMEDIA_TYPE_VIDEO:
- frame->width = FFMAX(avctx->width, FF_CEIL_RSHIFT(avctx->coded_width, avctx->lowres));
- frame->height = FFMAX(avctx->height, FF_CEIL_RSHIFT(avctx->coded_height, avctx->lowres));
- if (frame->format < 0)
- frame->format = avctx->pix_fmt;
+ frame->format = avctx->pix_fmt;
if (!frame->sample_aspect_ratio.num)
frame->sample_aspect_ratio = avctx->sample_aspect_ratio;
if (av_frame_get_colorspace(frame) == AVCOL_SPC_UNSPECIFIED)
@@ -784,6 +824,7 @@ int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame)
typedef struct CompatReleaseBufPriv {
AVCodecContext avctx;
AVFrame frame;
+ uint8_t avframe_padding[1024]; // hack to allow linking to a avutil with larger AVFrame
} CompatReleaseBufPriv;
static void compat_free_buffer(void *opaque, uint8_t *data)
@@ -802,8 +843,15 @@ static void compat_release_buffer(void *opaque, uint8_t *data)
FF_ENABLE_DEPRECATION_WARNINGS
#endif
+int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
+{
+ return ff_init_buffer_info(avctx, frame);
+}
+
static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
{
+ const AVHWAccel *hwaccel = avctx->hwaccel;
+ int override_dimensions = 1;
int ret;
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
@@ -812,9 +860,24 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
return AVERROR(EINVAL);
}
}
+ if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (frame->width <= 0 || frame->height <= 0) {
+ frame->width = FFMAX(avctx->width, FF_CEIL_RSHIFT(avctx->coded_width, avctx->lowres));
+ frame->height = FFMAX(avctx->height, FF_CEIL_RSHIFT(avctx->coded_height, avctx->lowres));
+ override_dimensions = 0;
+ }
+ }
+ ret = ff_decode_frame_props(avctx, frame);
+ if (ret < 0)
+ return ret;
if ((ret = ff_init_buffer_info(avctx, frame)) < 0)
return ret;
+ if (hwaccel && hwaccel->alloc_frame) {
+ ret = hwaccel->alloc_frame(avctx, frame);
+ goto end;
+ }
+
#if FF_API_GET_BUFFER
FF_DISABLE_DEPRECATION_WARNINGS
/*
@@ -841,7 +904,7 @@ FF_DISABLE_DEPRECATION_WARNINGS
* avcodec_default_get_buffer
*/
if (frame->buf[0])
- goto end;
+ goto end0;
priv = av_mallocz(sizeof(*priv));
if (!priv) {
@@ -898,7 +961,7 @@ do { \
if (planes > FF_ARRAY_ELEMS(frame->buf)) {
frame->nb_extended_buf = planes - FF_ARRAY_ELEMS(frame->buf);
- frame->extended_buf = av_malloc(sizeof(*frame->extended_buf) *
+ frame->extended_buf = av_malloc_array(sizeof(*frame->extended_buf),
frame->nb_extended_buf);
if (!frame->extended_buf) {
ret = AVERROR(ENOMEM);
@@ -917,7 +980,7 @@ do { \
av_buffer_unref(&dummy_buf);
-end:
+end0:
frame->width = avctx->width;
frame->height = avctx->height;
@@ -934,7 +997,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
ret = avctx->get_buffer2(avctx, frame, flags);
- if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+end:
+ if (avctx->codec_type == AVMEDIA_TYPE_VIDEO && !override_dimensions) {
frame->width = avctx->width;
frame->height = avctx->height;
}
@@ -952,7 +1016,7 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
static int reget_buffer_internal(AVCodecContext *avctx, AVFrame *frame)
{
- AVFrame tmp;
+ AVFrame *tmp;
int ret;
av_assert0(avctx->codec_type == AVMEDIA_TYPE_VIDEO);
@@ -969,20 +1033,22 @@ static int reget_buffer_internal(AVCodecContext *avctx, AVFrame *frame)
return ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);
if (av_frame_is_writable(frame))
- return 0;
+ return ff_decode_frame_props(avctx, frame);
+
+ tmp = av_frame_alloc();
+ if (!tmp)
+ return AVERROR(ENOMEM);
- av_frame_move_ref(&tmp, frame);
+ av_frame_move_ref(tmp, frame);
ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);
if (ret < 0) {
- av_frame_unref(&tmp);
+ av_frame_free(&tmp);
return ret;
}
- av_image_copy(frame->data, frame->linesize, tmp.data, tmp.linesize,
- frame->format, frame->width, frame->height);
-
- av_frame_unref(&tmp);
+ av_frame_copy(frame, tmp);
+ av_frame_free(&tmp);
return 0;
}
@@ -1034,6 +1100,17 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
return 0;
}
+enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags,
+ unsigned int fourcc)
+{
+ while (tags->pix_fmt >= 0) {
+ if (tags->fourcc == fourcc)
+ return tags->pix_fmt;
+ tags++;
+ }
+ return AV_PIX_FMT_NONE;
+}
+
static int is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
@@ -1047,6 +1124,65 @@ enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const en
return fmt[0];
}
+static AVHWAccel *find_hwaccel(enum AVCodecID codec_id,
+ enum AVPixelFormat pix_fmt)
+{
+ AVHWAccel *hwaccel = NULL;
+
+ while ((hwaccel = av_hwaccel_next(hwaccel)))
+ if (hwaccel->id == codec_id
+ && hwaccel->pix_fmt == pix_fmt)
+ return hwaccel;
+ return NULL;
+}
+
+
+int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
+{
+ const AVPixFmtDescriptor *desc;
+ enum AVPixelFormat ret = avctx->get_format(avctx, fmt);
+
+ desc = av_pix_fmt_desc_get(ret);
+ if (!desc)
+ return AV_PIX_FMT_NONE;
+
+ if (avctx->hwaccel && avctx->hwaccel->uninit)
+ avctx->hwaccel->uninit(avctx);
+ av_freep(&avctx->internal->hwaccel_priv_data);
+ avctx->hwaccel = NULL;
+
+ if (desc->flags & AV_PIX_FMT_FLAG_HWACCEL) {
+ AVHWAccel *hwaccel;
+ int err;
+
+ hwaccel = find_hwaccel(avctx->codec_id, ret);
+ if (!hwaccel) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Could not find an AVHWAccel for the pixel format: %s",
+ desc->name);
+ return AV_PIX_FMT_NONE;
+ }
+
+ if (hwaccel->priv_data_size) {
+ avctx->internal->hwaccel_priv_data = av_mallocz(hwaccel->priv_data_size);
+ if (!avctx->internal->hwaccel_priv_data)
+ return AV_PIX_FMT_NONE;
+ }
+
+ if (hwaccel->init) {
+ err = hwaccel->init(avctx);
+ if (err < 0) {
+ av_freep(&avctx->internal->hwaccel_priv_data);
+ return AV_PIX_FMT_NONE;
+ }
+ }
+ avctx->hwaccel = hwaccel;
+ }
+
+ return ret;
+}
+
+#if FF_API_AVFRAME_LAVC
void avcodec_get_frame_defaults(AVFrame *frame)
{
#if LIBAVCODEC_VERSION_MAJOR >= 55
@@ -1057,55 +1193,25 @@ void avcodec_get_frame_defaults(AVFrame *frame)
#endif
memset(frame, 0, sizeof(AVFrame));
-
- frame->pts =
- frame->pkt_dts =
- frame->pkt_pts = AV_NOPTS_VALUE;
- av_frame_set_best_effort_timestamp(frame, AV_NOPTS_VALUE);
- av_frame_set_pkt_duration (frame, 0);
- av_frame_set_pkt_pos (frame, -1);
- av_frame_set_pkt_size (frame, -1);
- frame->key_frame = 1;
- frame->sample_aspect_ratio = (AVRational) {0, 1 };
- frame->format = -1; /* unknown */
- frame->extended_data = frame->data;
- av_frame_set_colorspace(frame, AVCOL_SPC_UNSPECIFIED);
+ av_frame_unref(frame);
}
-#if FF_API_AVFRAME_LAVC
AVFrame *avcodec_alloc_frame(void)
{
- AVFrame *frame = av_malloc(sizeof(AVFrame));
-
- if (frame == NULL)
- return NULL;
-
- frame->extended_data = NULL;
- avcodec_get_frame_defaults(frame);
-
- return frame;
+ return av_frame_alloc();
}
-#endif
void avcodec_free_frame(AVFrame **frame)
{
- AVFrame *f;
-
- if (!frame || !*frame)
- return;
-
- f = *frame;
-
- if (f->extended_data != f->data)
- av_freep(&f->extended_data);
-
- av_freep(frame);
+ av_frame_free(frame);
}
+#endif
MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)
MAKE_ACCESSORS(AVCodecContext, codec, const AVCodecDescriptor *, codec_descriptor)
MAKE_ACCESSORS(AVCodecContext, codec, int, lowres)
MAKE_ACCESSORS(AVCodecContext, codec, int, seek_preroll)
+MAKE_ACCESSORS(AVCodecContext, codec, uint16_t*, chroma_intra_matrix)
int av_codec_get_max_lowres(const AVCodec *codec)
{
@@ -1524,7 +1630,11 @@ int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
av_fast_padded_malloc(&avctx->internal->byte_buffer, &avctx->internal->byte_buffer_size, size);
avpkt->data = avctx->internal->byte_buffer;
avpkt->size = avctx->internal->byte_buffer_size;
+#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
avpkt->destruct = NULL;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
}
}
@@ -1608,7 +1718,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
const AVFrame *frame,
int *got_packet_ptr)
{
- AVFrame tmp;
+ AVFrame *extended_frame = NULL;
AVFrame *padded_frame = NULL;
int ret;
AVPacket user_pkt = *avpkt;
@@ -1633,9 +1743,13 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
}
av_log(avctx, AV_LOG_WARNING, "extended_data is not set.\n");
- tmp = *frame;
- tmp.extended_data = tmp.data;
- frame = &tmp;
+ extended_frame = av_frame_alloc();
+ if (!extended_frame)
+ return AVERROR(ENOMEM);
+
+ memcpy(extended_frame, frame, sizeof(AVFrame));
+ extended_frame->extended_data = extended_frame->data;
+ frame = extended_frame;
}
/* check for valid frame size */
@@ -1643,14 +1757,15 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
if (avctx->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {
if (frame->nb_samples > avctx->frame_size) {
av_log(avctx, AV_LOG_ERROR, "more samples than frame size (avcodec_encode_audio2)\n");
- return AVERROR(EINVAL);
+ ret = AVERROR(EINVAL);
+ goto end;
}
} else if (!(avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)) {
if (frame->nb_samples < avctx->frame_size &&
!avctx->internal->last_audio_frame) {
ret = pad_last_frame(avctx, &padded_frame, frame);
if (ret < 0)
- return ret;
+ goto end;
frame = padded_frame;
avctx->internal->last_audio_frame = 1;
@@ -1691,7 +1806,11 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
}
avpkt->buf = user_pkt.buf;
avpkt->data = user_pkt.data;
+#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
avpkt->destruct = user_pkt.destruct;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
} else {
if (av_dup_packet(avpkt) < 0) {
ret = AVERROR(ENOMEM);
@@ -1722,6 +1841,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
end:
av_frame_free(&padded_frame);
+ av_free(extended_frame);
return ret;
}
@@ -1732,7 +1852,6 @@ int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
const short *samples)
{
AVPacket pkt;
- AVFrame frame0 = { { 0 } };
AVFrame *frame;
int ret, samples_size, got_packet;
@@ -1741,8 +1860,9 @@ int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
pkt.size = buf_size;
if (samples) {
- frame = &frame0;
- avcodec_get_frame_defaults(frame);
+ frame = av_frame_alloc();
+ if (!frame)
+ return AVERROR(ENOMEM);
if (avctx->frame_size) {
frame->nb_samples = avctx->frame_size;
@@ -1753,13 +1873,16 @@ int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
if (!av_get_bits_per_sample(avctx->codec_id)) {
av_log(avctx, AV_LOG_ERROR, "avcodec_encode_audio() does not "
"support this codec\n");
+ av_frame_free(&frame);
return AVERROR(EINVAL);
}
nb_samples = (int64_t)buf_size * 8 /
(av_get_bits_per_sample(avctx->codec_id) *
avctx->channels);
- if (nb_samples >= INT_MAX)
+ if (nb_samples >= INT_MAX) {
+ av_frame_free(&frame);
return AVERROR(EINVAL);
+ }
frame->nb_samples = nb_samples;
}
@@ -1771,8 +1894,10 @@ int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
if ((ret = avcodec_fill_audio_frame(frame, avctx->channels,
avctx->sample_fmt,
(const uint8_t *)samples,
- samples_size, 1)) < 0)
+ samples_size, 1)) < 0) {
+ av_frame_free(&frame);
return ret;
+ }
/* fabricate frame pts from sample count.
* this is needed because the avcodec_encode_audio() API does not have
@@ -1799,6 +1924,7 @@ int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
if (frame && frame->extended_data != frame->data)
av_freep(&frame->extended_data);
+ av_frame_free(&frame);
return ret ? ret : pkt.size;
}
@@ -1885,7 +2011,11 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
}
avpkt->buf = user_pkt.buf;
avpkt->data = user_pkt.data;
+#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
avpkt->destruct = user_pkt.destruct;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
} else {
if (av_dup_packet(avpkt) < 0) {
ret = AVERROR(ENOMEM);
@@ -1949,11 +2079,15 @@ static int64_t guess_correct_pts(AVCodecContext *ctx,
if (dts != AV_NOPTS_VALUE) {
ctx->pts_correction_num_faulty_dts += dts <= ctx->pts_correction_last_dts;
ctx->pts_correction_last_dts = dts;
- }
+ } else if (reordered_pts != AV_NOPTS_VALUE)
+ ctx->pts_correction_last_dts = reordered_pts;
+
if (reordered_pts != AV_NOPTS_VALUE) {
ctx->pts_correction_num_faulty_pts += reordered_pts <= ctx->pts_correction_last_pts;
ctx->pts_correction_last_pts = reordered_pts;
- }
+ } else if(dts != AV_NOPTS_VALUE)
+ ctx->pts_correction_last_pts = dts;
+
if ((ctx->pts_correction_num_faulty_pts<=ctx->pts_correction_num_faulty_dts || dts == AV_NOPTS_VALUE)
&& reordered_pts != AV_NOPTS_VALUE)
pts = reordered_pts;
@@ -2050,7 +2184,7 @@ static int unrefcount_frame(AVCodecInternal *avci, AVFrame *frame)
memcpy(frame->data, avci->to_free->data, sizeof(frame->data));
memcpy(frame->linesize, avci->to_free->linesize, sizeof(frame->linesize));
if (avci->to_free->extended_data != avci->to_free->data) {
- int planes = av_get_channel_layout_nb_channels(avci->to_free->channel_layout);
+ int planes = av_frame_get_channels(avci->to_free);
int size = planes * sizeof(*frame->extended_data);
if (!size) {
@@ -2098,7 +2232,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
if ((avctx->coded_width || avctx->coded_height) && av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx))
return AVERROR(EINVAL);
- avcodec_get_frame_defaults(picture);
+ av_frame_unref(picture);
if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
int did_split = av_packet_split_side_data(&tmp);
@@ -2161,7 +2295,7 @@ fail:
/* many decoders assign whole AVFrames, thus overwriting extended_data;
* make sure it's set correctly */
- picture->extended_data = picture->data;
+ av_assert0(!picture->extended_data || picture->extended_data == picture->data);
return ret;
}
@@ -2171,9 +2305,11 @@ int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa
int *frame_size_ptr,
AVPacket *avpkt)
{
- AVFrame frame = { { 0 } };
+ AVFrame *frame = av_frame_alloc();
int ret, got_frame = 0;
+ if (!frame)
+ return AVERROR(ENOMEM);
if (avctx->get_buffer != avcodec_default_get_buffer) {
av_log(avctx, AV_LOG_ERROR, "Custom get_buffer() for use with"
"avcodec_decode_audio3() detected. Overriding with avcodec_default_get_buffer\n");
@@ -2183,26 +2319,27 @@ int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa
avctx->release_buffer = avcodec_default_release_buffer;
}
- ret = avcodec_decode_audio4(avctx, &frame, &got_frame, avpkt);
+ ret = avcodec_decode_audio4(avctx, frame, &got_frame, avpkt);
if (ret >= 0 && got_frame) {
int ch, plane_size;
int planar = av_sample_fmt_is_planar(avctx->sample_fmt);
int data_size = av_samples_get_buffer_size(&plane_size, avctx->channels,
- frame.nb_samples,
+ frame->nb_samples,
avctx->sample_fmt, 1);
if (*frame_size_ptr < data_size) {
av_log(avctx, AV_LOG_ERROR, "output buffer size is too small for "
"the current frame (%d < %d)\n", *frame_size_ptr, data_size);
+ av_frame_free(&frame);
return AVERROR(EINVAL);
}
- memcpy(samples, frame.extended_data[0], plane_size);
+ memcpy(samples, frame->extended_data[0], plane_size);
if (planar && avctx->channels > 1) {
uint8_t *out = ((uint8_t *)samples) + plane_size;
for (ch = 1; ch < avctx->channels; ch++) {
- memcpy(out, frame.extended_data[ch], plane_size);
+ memcpy(out, frame->extended_data[ch], plane_size);
out += plane_size;
}
}
@@ -2210,6 +2347,7 @@ int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa
} else {
*frame_size_ptr = 0;
}
+ av_frame_free(&frame);
return ret;
}
@@ -2236,7 +2374,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
return AVERROR(EINVAL);
}
- avcodec_get_frame_defaults(frame);
+ av_frame_unref(frame);
if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
uint8_t *side;
@@ -2405,8 +2543,6 @@ end:
iconv_close(cd);
return ret;
#else
- // ICONV is not on all platforms. Unblock compile by returning a
- // value. Assert with abort() is removed here, too.
return AVERROR(EINVAL);
#endif
}
@@ -2586,6 +2722,11 @@ av_cold int avcodec_close(AVCodecContext *avctx)
for (i = 0; i < FF_ARRAY_ELEMS(pool->pools); i++)
av_buffer_pool_uninit(&pool->pools[i]);
av_freep(&avctx->internal->pool);
+
+ if (avctx->hwaccel && avctx->hwaccel->uninit)
+ avctx->hwaccel->uninit(avctx);
+ av_freep(&avctx->internal->hwaccel_priv_data);
+
av_freep(&avctx->internal);
}
@@ -2608,15 +2749,25 @@ static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
//This is for future deprecatec codec ids, its empty since
//last major bump but will fill up again over time, please don't remove it
// case AV_CODEC_ID_UTVIDEO_DEPRECATED: return AV_CODEC_ID_UTVIDEO;
- case AV_CODEC_ID_OPUS_DEPRECATED: return AV_CODEC_ID_OPUS;
- case AV_CODEC_ID_TAK_DEPRECATED : return AV_CODEC_ID_TAK;
- case AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED : return AV_CODEC_ID_PCM_S24LE_PLANAR;
- case AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED : return AV_CODEC_ID_PCM_S32LE_PLANAR;
- case AV_CODEC_ID_ESCAPE130_DEPRECATED : return AV_CODEC_ID_ESCAPE130;
- case AV_CODEC_ID_G2M_DEPRECATED : return AV_CODEC_ID_G2M;
- case AV_CODEC_ID_WEBP_DEPRECATED: return AV_CODEC_ID_WEBP;
- case AV_CODEC_ID_HEVC_DEPRECATED: return AV_CODEC_ID_HEVC;
- default : return id;
+ case AV_CODEC_ID_BRENDER_PIX_DEPRECATED : return AV_CODEC_ID_BRENDER_PIX;
+ case AV_CODEC_ID_OPUS_DEPRECATED : return AV_CODEC_ID_OPUS;
+ case AV_CODEC_ID_TAK_DEPRECATED : return AV_CODEC_ID_TAK;
+ case AV_CODEC_ID_PAF_AUDIO_DEPRECATED : return AV_CODEC_ID_PAF_AUDIO;
+ case AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED : return AV_CODEC_ID_PCM_S24LE_PLANAR;
+ case AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED : return AV_CODEC_ID_PCM_S32LE_PLANAR;
+ case AV_CODEC_ID_ADPCM_VIMA_DEPRECATED : return AV_CODEC_ID_ADPCM_VIMA;
+ case AV_CODEC_ID_ESCAPE130_DEPRECATED : return AV_CODEC_ID_ESCAPE130;
+ case AV_CODEC_ID_EXR_DEPRECATED : return AV_CODEC_ID_EXR;
+ case AV_CODEC_ID_G2M_DEPRECATED : return AV_CODEC_ID_G2M;
+ case AV_CODEC_ID_PAF_VIDEO_DEPRECATED : return AV_CODEC_ID_PAF_VIDEO;
+ case AV_CODEC_ID_WEBP_DEPRECATED : return AV_CODEC_ID_WEBP;
+ case AV_CODEC_ID_HEVC_DEPRECATED : return AV_CODEC_ID_HEVC;
+ case AV_CODEC_ID_MVC1_DEPRECATED : return AV_CODEC_ID_MVC1;
+ case AV_CODEC_ID_MVC2_DEPRECATED : return AV_CODEC_ID_MVC2;
+ case AV_CODEC_ID_SANM_DEPRECATED : return AV_CODEC_ID_SANM;
+ case AV_CODEC_ID_SGIRLE_DEPRECATED : return AV_CODEC_ID_SGIRLE;
+ case AV_CODEC_ID_VP7_DEPRECATED : return AV_CODEC_ID_VP7;
+ default : return id;
}
}
@@ -2920,6 +3071,10 @@ int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
case AV_CODEC_ID_ADPCM_G722:
case AV_CODEC_ID_ADPCM_YAMAHA:
return 4;
+ case AV_CODEC_ID_DSD_LSBF:
+ case AV_CODEC_ID_DSD_MSBF:
+ case AV_CODEC_ID_DSD_LSBF_PLANAR:
+ case AV_CODEC_ID_DSD_MSBF_PLANAR:
case AV_CODEC_ID_PCM_ALAW:
case AV_CODEC_ID_PCM_MULAW:
case AV_CODEC_ID_PCM_S8:
@@ -3220,13 +3375,15 @@ FF_ENABLE_DEPRECATION_WARNINGS
#endif /* FF_API_MISSING_SAMPLE */
static AVHWAccel *first_hwaccel = NULL;
+static AVHWAccel **last_hwaccel = &first_hwaccel;
void av_register_hwaccel(AVHWAccel *hwaccel)
{
- AVHWAccel **p = &first_hwaccel;
+ AVHWAccel **p = last_hwaccel;
hwaccel->next = NULL;
while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, hwaccel))
p = &(*p)->next;
+ last_hwaccel = &hwaccel->next;
}
AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel)
@@ -3234,20 +3391,6 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel)
return hwaccel ? hwaccel->next : first_hwaccel;
}
-AVHWAccel *ff_find_hwaccel(AVCodecContext *avctx)
-{
- enum AVCodecID codec_id = avctx->codec->id;
- enum AVPixelFormat pix_fmt = avctx->pix_fmt;
-
- AVHWAccel *hwaccel = NULL;
-
- while ((hwaccel = av_hwaccel_next(hwaccel)))
- if (hwaccel->id == codec_id
- && hwaccel->pix_fmt == pix_fmt)
- return hwaccel;
- return NULL;
-}
-
int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op))
{
if (lockmgr_cb) {
@@ -3349,7 +3492,7 @@ int ff_thread_ref_frame(ThreadFrame *dst, ThreadFrame *src)
enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
{
- return avctx->get_format(avctx, fmt);
+ return ff_get_format(avctx, fmt);
}
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
@@ -3360,7 +3503,8 @@ int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
{
- av_frame_unref(f->f);
+ if (f->f)
+ av_frame_unref(f->f);
}
void ff_thread_finish_setup(AVCodecContext *avctx)
diff --git a/chromium/third_party/ffmpeg/libavcodec/utvideodec.c b/chromium/third_party/ffmpeg/libavcodec/utvideodec.c
index e3ef22d2a24..2bd177d0923 100644
--- a/chromium/third_party/ffmpeg/libavcodec/utvideodec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/utvideodec.c
@@ -24,6 +24,7 @@
* Ut Video decoder
*/
+#include <inttypes.h>
#include <stdlib.h>
#include "libavutil/intreadwrite.h"
@@ -367,7 +368,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return AVERROR_INVALIDDATA;
}
c->frame_info = bytestream2_get_le32u(&gb);
- av_log(avctx, AV_LOG_DEBUG, "frame information flags %X\n", c->frame_info);
+ av_log(avctx, AV_LOG_DEBUG, "frame information flags %"PRIX32"\n",
+ c->frame_info);
c->frame_pred = (c->frame_info >> 8) & 3;
@@ -481,14 +483,14 @@ static av_cold int decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d.%d.%d\n",
avctx->extradata[3], avctx->extradata[2],
avctx->extradata[1], avctx->extradata[0]);
- av_log(avctx, AV_LOG_DEBUG, "Original format %X\n",
+ av_log(avctx, AV_LOG_DEBUG, "Original format %"PRIX32"\n",
AV_RB32(avctx->extradata + 4));
c->frame_info_size = AV_RL32(avctx->extradata + 8);
c->flags = AV_RL32(avctx->extradata + 12);
if (c->frame_info_size != 4)
avpriv_request_sample(avctx, "Frame info not 4 bytes");
- av_log(avctx, AV_LOG_DEBUG, "Encoding parameters %08X\n", c->flags);
+ av_log(avctx, AV_LOG_DEBUG, "Encoding parameters %08"PRIX32"\n", c->flags);
c->slices = (c->flags >> 24) + 1;
c->compression = c->flags & 1;
c->interlaced = c->flags & 0x800;
diff --git a/chromium/third_party/ffmpeg/libavcodec/utvideoenc.c b/chromium/third_party/ffmpeg/libavcodec/utvideoenc.c
index e5a858d5ae1..0db85a871ff 100644
--- a/chromium/third_party/ffmpeg/libavcodec/utvideoenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/utvideoenc.c
@@ -58,7 +58,7 @@ static av_cold int utvideo_encode_close(AVCodecContext *avctx)
static av_cold int utvideo_encode_init(AVCodecContext *avctx)
{
UtvideoContext *c = avctx->priv_data;
- int i;
+ int i, subsampled_height;
uint32_t original_format;
c->avctx = avctx;
@@ -83,7 +83,10 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
c->planes = 3;
- avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
+ if (avctx->colorspace == AVCOL_SPC_BT709)
+ avctx->codec_tag = MKTAG('U', 'L', 'H', '0');
+ else
+ avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
original_format = UTVIDEO_420;
break;
case AV_PIX_FMT_YUV422P:
@@ -93,7 +96,10 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
c->planes = 3;
- avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
+ if (avctx->colorspace == AVCOL_SPC_BT709)
+ avctx->codec_tag = MKTAG('U', 'L', 'H', '2');
+ else
+ avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
original_format = UTVIDEO_422;
break;
default:
@@ -126,6 +132,26 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
return AVERROR_OPTION_NOT_FOUND;
}
+ /*
+ * Check the asked slice count for obviously invalid
+ * values (> 256 or negative).
+ */
+ if (avctx->slices > 256 || avctx->slices < 0) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Slice count %d is not supported in Ut Video (theoretical range is 0-256).\n",
+ avctx->slices);
+ return AVERROR(EINVAL);
+ }
+
+ /* Check that the slice count is not larger than the subsampled height */
+ subsampled_height = avctx->height >> av_pix_fmt_desc_get(avctx->pix_fmt)->log2_chroma_h;
+ if (avctx->slices > subsampled_height) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Slice count %d is larger than the subsampling-applied height %d.\n",
+ avctx->slices, subsampled_height);
+ return AVERROR(EINVAL);
+ }
+
avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame) {
@@ -175,9 +201,19 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
/*
* Set how many slices are going to be used.
- * Set one slice for now.
+ * By default uses multiple slices depending on the subsampled height.
+ * This enables multithreading in the official decoder.
*/
- c->slices = 1;
+ if (!avctx->slices) {
+ c->slices = subsampled_height / 120;
+
+ if (!c->slices)
+ c->slices = 1;
+ else if (c->slices > 256)
+ c->slices = 256;
+ } else {
+ c->slices = avctx->slices;
+ }
/* Set compression mode */
c->compression = COMP_HUFF;
@@ -363,6 +399,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src,
uint32_t offset = 0, slice_len = 0;
int i, sstart, send = 0;
int symbol;
+ int ret;
/* Do prediction / make planes */
switch (c->frame_pred) {
@@ -429,7 +466,8 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src,
}
/* Calculate huffman lengths */
- ff_huff_gen_len_table(lengths, counts);
+ if ((ret = ff_huff_gen_len_table(lengths, counts, 256)) < 0)
+ return ret;
/*
* Write the plane's header into the output packet:
@@ -456,7 +494,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src,
* get the offset in bits and convert to bytes.
*/
offset += write_huff_codes(dst + sstart * width, c->slice_bits,
- width * (send - sstart), width,
+ width * height + 4, width,
send - sstart, he) >> 3;
slice_len = offset - slice_len;
@@ -513,7 +551,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream2_init_writer(&pb, dst, pkt->size);
- av_fast_padded_malloc(&c->slice_bits, &c->slice_bits_size, width * height);
+ av_fast_padded_malloc(&c->slice_bits, &c->slice_bits_size, width * height + 4);
if (!c->slice_bits) {
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer 2.\n");
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_h264.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_h264.c
index ea0f43420da..8eb8a66f159 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_h264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_h264.c
@@ -22,6 +22,7 @@
#include "vaapi_internal.h"
#include "h264.h"
+#include "mpegutils.h"
/**
* @file
@@ -51,14 +52,14 @@ static void init_vaapi_pic(VAPictureH264 *va_pic)
* supersedes pic's field type if nonzero.
*/
static void fill_vaapi_pic(VAPictureH264 *va_pic,
- Picture *pic,
+ H264Picture *pic,
int pic_structure)
{
if (pic_structure == 0)
pic_structure = pic->reference;
pic_structure &= PICT_FRAME; /* PICT_TOP_FIELD|PICT_BOTTOM_FIELD */
- va_pic->picture_id = ff_vaapi_get_surface_id(pic);
+ va_pic->picture_id = ff_vaapi_get_surface_id(&pic->f);
va_pic->frame_idx = pic->long_ref ? pic->pic_id : pic->frame_num;
va_pic->flags = 0;
@@ -89,7 +90,7 @@ typedef struct DPB {
* available. The decoded picture buffer's size must be large enough
* to receive the new VA API picture object.
*/
-static int dpb_add(DPB *dpb, Picture *pic)
+static int dpb_add(DPB *dpb, H264Picture *pic)
{
int i;
@@ -98,7 +99,7 @@ static int dpb_add(DPB *dpb, Picture *pic)
for (i = 0; i < dpb->size; i++) {
VAPictureH264 * const va_pic = &dpb->va_pics[i];
- if (va_pic->picture_id == ff_vaapi_get_surface_id(pic)) {
+ if (va_pic->picture_id == ff_vaapi_get_surface_id(&pic->f)) {
VAPictureH264 temp_va_pic;
fill_vaapi_pic(&temp_va_pic, pic, 0);
@@ -133,13 +134,13 @@ static int fill_vaapi_ReferenceFrames(VAPictureParameterBufferH264 *pic_param,
init_vaapi_pic(&dpb.va_pics[i]);
for (i = 0; i < h->short_ref_count; i++) {
- Picture * const pic = h->short_ref[i];
+ H264Picture * const pic = h->short_ref[i];
if (pic && pic->reference && dpb_add(&dpb, pic) < 0)
return -1;
}
for (i = 0; i < 16; i++) {
- Picture * const pic = h->long_ref[i];
+ H264Picture * const pic = h->long_ref[i];
if (pic && pic->reference && dpb_add(&dpb, pic) < 0)
return -1;
}
@@ -155,7 +156,7 @@ static int fill_vaapi_ReferenceFrames(VAPictureParameterBufferH264 *pic_param,
* @param[in] ref_count The number of reference pictures in ref_list
*/
static void fill_vaapi_RefPicList(VAPictureH264 RefPicList[32],
- Picture *ref_list,
+ H264Picture *ref_list,
unsigned int ref_count)
{
unsigned int i, n = 0;
@@ -298,7 +299,7 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
if (ret < 0)
goto finish;
- ret = ff_vaapi_render_picture(vactx, ff_vaapi_get_surface_id(h->cur_pic_ptr));
+ ret = ff_vaapi_render_picture(vactx, ff_vaapi_get_surface_id(&h->cur_pic_ptr->f));
if (ret < 0)
goto finish;
@@ -333,8 +334,8 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
slice_param->cabac_init_idc = h->cabac_init_idc;
slice_param->slice_qp_delta = h->qscale - h->pps.init_qp;
slice_param->disable_deblocking_filter_idc = h->deblocking_filter < 2 ? !h->deblocking_filter : h->deblocking_filter;
- slice_param->slice_alpha_c0_offset_div2 = h->slice_alpha_c0_offset / 2 - 26;
- slice_param->slice_beta_offset_div2 = h->slice_beta_offset / 2 - 26;
+ slice_param->slice_alpha_c0_offset_div2 = h->slice_alpha_c0_offset / 2;
+ slice_param->slice_beta_offset_div2 = h->slice_beta_offset / 2;
slice_param->luma_log2_weight_denom = h->luma_log2_weight_denom;
slice_param->chroma_log2_weight_denom = h->chroma_log2_weight_denom;
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_internal.h b/chromium/third_party/ffmpeg/libavcodec/vaapi_internal.h
index 1ac0e9fe35d..918c718d14b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_internal.h
@@ -35,10 +35,10 @@
* @{
*/
-/** Extract VASurfaceID from a Picture */
-static inline VASurfaceID ff_vaapi_get_surface_id(Picture *pic)
+/** Extract VASurfaceID from an AVFrame */
+static inline VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
{
- return (uintptr_t)pic->f.data[3];
+ return (uintptr_t)pic->data[3];
}
/** Common AVHWAccel.end_frame() implementation */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg.c
index 5afa4060013..63879e5fe43 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg.c
@@ -35,7 +35,7 @@ int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
goto finish;
ret = ff_vaapi_render_picture(vactx,
- ff_vaapi_get_surface_id(s->current_picture_ptr));
+ ff_vaapi_get_surface_id(s->current_picture_ptr->f));
if (ret < 0)
goto finish;
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c
index cdc70eefa87..0988433487e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "mpegutils.h"
#include "vaapi_internal.h"
/** Reconstruct bitstream f_code */
@@ -72,10 +73,10 @@ static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_
switch (s->pict_type) {
case AV_PICTURE_TYPE_B:
- pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
+ pic_param->backward_reference_picture = ff_vaapi_get_surface_id(s->next_picture.f);
// fall-through
case AV_PICTURE_TYPE_P:
- pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
+ pic_param->forward_reference_picture = ff_vaapi_get_surface_id(s->last_picture.f);
break;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c
index 9ed007f2d8f..28c12a0812a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c
@@ -81,7 +81,7 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
pic_param->quant_precision = s->quant_precision;
pic_param->vop_fields.value = 0; /* reset all bits */
pic_param->vop_fields.bits.vop_coding_type = s->pict_type - AV_PICTURE_TYPE_I;
- pic_param->vop_fields.bits.backward_reference_vop_coding_type = s->pict_type == AV_PICTURE_TYPE_B ? s->next_picture.f.pict_type - AV_PICTURE_TYPE_I : 0;
+ pic_param->vop_fields.bits.backward_reference_vop_coding_type = s->pict_type == AV_PICTURE_TYPE_B ? s->next_picture.f->pict_type - AV_PICTURE_TYPE_I : 0;
pic_param->vop_fields.bits.vop_rounding_type = s->no_rounding;
pic_param->vop_fields.bits.intra_dc_vlc_thr = mpeg4_get_intra_dc_vlc_thr(ctx);
pic_param->vop_fields.bits.top_field_first = s->top_field_first;
@@ -95,9 +95,9 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
pic_param->TRD = s->pp_time;
if (s->pict_type == AV_PICTURE_TYPE_B)
- pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
+ pic_param->backward_reference_picture = ff_vaapi_get_surface_id(s->next_picture.f);
if (s->pict_type != AV_PICTURE_TYPE_I)
- pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
+ pic_param->forward_reference_picture = ff_vaapi_get_surface_id(s->last_picture.f);
/* Fill in VAIQMatrixBufferMPEG4 */
/* Only the first inverse quantisation method uses the weighting matrices */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_vc1.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_vc1.c
index 266fa3c5bad..bba46d337ff 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_vc1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_vc1.c
@@ -258,10 +258,10 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
switch (s->pict_type) {
case AV_PICTURE_TYPE_B:
- pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
+ pic_param->backward_reference_picture = ff_vaapi_get_surface_id(s->next_picture.f);
// fall-through
case AV_PICTURE_TYPE_P:
- pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
+ pic_param->forward_reference_picture = ff_vaapi_get_surface_id(s->last_picture.f);
break;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vble.c b/chromium/third_party/ffmpeg/libavcodec/vble.c
index a8c71ed9c94..ed08b832a9a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vble.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vble.c
@@ -189,7 +189,7 @@ static av_cold int vble_decode_init(AVCodecContext *avctx)
ctx->size = avpicture_get_size(avctx->pix_fmt,
avctx->width, avctx->height);
- ctx->val = av_malloc(ctx->size * sizeof(*ctx->val));
+ ctx->val = av_malloc_array(ctx->size, sizeof(*ctx->val));
if (!ctx->val) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate values buffer.\n");
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1.c b/chromium/third_party/ffmpeg/libavcodec/vc1.c
index 181a4df3780..c7f3561cbc7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1.c
@@ -47,21 +47,6 @@
* @{
*/
-/**
- * Imode types
- * @{
- */
-enum Imode {
- IMODE_RAW,
- IMODE_NORM2,
- IMODE_DIFF2,
- IMODE_NORM6,
- IMODE_DIFF6,
- IMODE_ROWSKIP,
- IMODE_COLSKIP
-};
-/** @} */ //imode defines
-
/** Decode rows by checking if they are skipped
* @param plane Buffer to store decoded bits
* @param[in] width Width of this buffer
@@ -137,12 +122,16 @@ static int bitplane_decoding(uint8_t* data, int *raw_flag, VC1Context *v)
case IMODE_NORM2:
if ((height * width) & 1) {
*planep++ = get_bits1(gb);
- offset = 1;
+ y = offset = 1;
+ if (offset == width) {
+ offset = 0;
+ planep += stride - width;
+ }
}
else
- offset = 0;
+ y = offset = 0;
// decode bitplane as one long line
- for (y = offset; y < height * width; y += 2) {
+ for (; y < height * width; y += 2) {
code = get_vlc2(gb, ff_vc1_norm2_vlc.table, VC1_NORM2_VLC_BITS, 1);
*planep++ = code & 1;
offset++;
@@ -304,6 +293,7 @@ int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitCo
v->zz_4x8 = ff_vc1_adv_progressive_4x8_zz;
return decode_sequence_header_adv(v, gb);
} else {
+ v->chromaformat = 1;
v->zz_8x4 = ff_wmv2_scantableA;
v->zz_4x8 = ff_wmv2_scantableB;
v->res_y411 = get_bits1(gb);
@@ -382,7 +372,11 @@ int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitCo
if (v->res_sprite) {
int w = get_bits(gb, 11);
int h = get_bits(gb, 11);
- avcodec_set_dimensions(v->s.avctx, w, h);
+ int ret = ff_set_dimensions(v->s.avctx, w, h);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to set dimensions %d %d\n", w, h);
+ return ret;
+ }
skip_bits(gb, 5); //frame rate
v->res_x8 = get_bits1(gb);
if (get_bits1(gb)) { // something to do with DC VLC selection
@@ -526,6 +520,7 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex
{
int i;
int w,h;
+ int ret;
av_log(avctx, AV_LOG_DEBUG, "Entry point: %08X\n", show_bits_long(gb, 32));
v->broken_link = get_bits1(gb);
@@ -555,7 +550,11 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex
w = v->max_coded_width;
h = v->max_coded_height;
}
- avcodec_set_dimensions(avctx, w, h);
+ if ((ret = ff_set_dimensions(avctx, w, h)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to set dimensions %d %d\n", w, h);
+ return ret;
+ }
+
if (v->extended_mv)
v->extended_dmv = get_bits1(gb);
if ((v->range_mapy_flag = get_bits1(gb))) {
@@ -607,26 +606,40 @@ static void rotate_luts(VC1Context *v)
C = A; \
} else { \
DEF; \
- memcpy(&tmp, &L , sizeof(tmp)); \
- memcpy(&L , &N , sizeof(tmp)); \
- memcpy(&N , &tmp, sizeof(tmp)); \
+ memcpy(&tmp, L , sizeof(tmp)); \
+ memcpy(L , N , sizeof(tmp)); \
+ memcpy(N , &tmp, sizeof(tmp)); \
C = N; \
} \
} while(0)
- ROTATE(int tmp, v->last_use_ic, v->next_use_ic, v->curr_use_ic, v->aux_use_ic);
+ ROTATE(int tmp, &v->last_use_ic, &v->next_use_ic, v->curr_use_ic, &v->aux_use_ic);
ROTATE(uint8_t tmp[2][256], v->last_luty, v->next_luty, v->curr_luty, v->aux_luty);
ROTATE(uint8_t tmp[2][256], v->last_lutuv, v->next_lutuv, v->curr_lutuv, v->aux_lutuv);
INIT_LUT(32, 0, v->curr_luty[0], v->curr_lutuv[0], 0);
INIT_LUT(32, 0, v->curr_luty[1], v->curr_lutuv[1], 0);
- v->curr_use_ic = 0;
+ *v->curr_use_ic = 0;
+}
+
+static int read_bfraction(VC1Context *v, GetBitContext* gb) {
+ int bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
+
+ if (bfraction_lut_index == 21 || bfraction_lut_index < 0) {
+ av_log(v->s.avctx, AV_LOG_ERROR, "bfraction invalid\n");
+ return AVERROR_INVALIDDATA;
+ }
+ v->bfraction_lut_index = bfraction_lut_index;
+ v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index];
+ return 0;
}
int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
{
int pqindex, lowquant, status;
+ v->field_mode = 0;
+ v->fcm = 0;
if (v->finterpflag)
v->interpfrm = get_bits1(gb);
if (!v->s.avctx->codec)
@@ -654,8 +667,8 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
v->bi_type = 0;
if (v->s.pict_type == AV_PICTURE_TYPE_B) {
- v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
- v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index];
+ if (read_bfraction(v, gb) < 0)
+ return AVERROR_INVALIDDATA;
if (v->bfraction == 0) {
v->s.pict_type = AV_PICTURE_TYPE_BI;
}
@@ -847,7 +860,7 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
int mbmodetab, imvtab, icbptab, twomvbptab, fourmvbptab; /* useful only for debugging */
int field_mode, fcm;
- v->numref=0;
+ v->numref = 0;
v->p_frame_skipped = 0;
if (v->second_field) {
if(v->fcm!=2 || v->field_mode!=1)
@@ -855,7 +868,7 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
if (v->fptype & 4)
v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_BI : AV_PICTURE_TYPE_B;
- v->s.current_picture_ptr->f.pict_type = v->s.pict_type;
+ v->s.current_picture_ptr->f->pict_type = v->s.pict_type;
if (!v->pic_header_flag)
goto parse_common_info;
}
@@ -875,12 +888,17 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
v->field_mode = field_mode;
v->fcm = fcm;
+ av_assert0( v->s.mb_height == v->s.height + 15 >> 4
+ || v->s.mb_height == FFALIGN(v->s.height + 15 >> 4, 2));
if (v->field_mode) {
+ v->s.mb_height = FFALIGN(v->s.height + 15 >> 4, 2);
v->fptype = get_bits(gb, 3);
v->s.pict_type = (v->fptype & 2) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
if (v->fptype & 4) // B-picture
v->s.pict_type = (v->fptype & 2) ? AV_PICTURE_TYPE_BI : AV_PICTURE_TYPE_B;
+
} else {
+ v->s.mb_height = v->s.height + 15 >> 4;
switch (get_unary(gb, 0, 4)) {
case 0:
v->s.pict_type = AV_PICTURE_TYPE_P;
@@ -933,8 +951,8 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
v->refdist += get_unary(gb, 0, 16);
}
if ((v->s.pict_type == AV_PICTURE_TYPE_B) || (v->s.pict_type == AV_PICTURE_TYPE_BI)) {
- v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
- v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index];
+ if (read_bfraction(v, gb) < 0)
+ return AVERROR_INVALIDDATA;
v->frfd = (v->bfraction * v->refdist) >> 8;
v->brfd = v->refdist - v->frfd - 1;
if (v->brfd < 0)
@@ -946,8 +964,8 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
if (v->finterpflag)
v->interpfrm = get_bits1(gb);
if (v->s.pict_type == AV_PICTURE_TYPE_B) {
- v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
- v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index];
+ if (read_bfraction(v, gb) < 0)
+ return AVERROR_INVALIDDATA;
if (v->bfraction == 0) {
v->s.pict_type = AV_PICTURE_TYPE_BI; /* XXX: should not happen here */
}
@@ -1021,8 +1039,6 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
v->reffield = get_bits1(gb);
v->ref_field_type[0] = v->reffield ^ !v->cur_field_type;
}
- } else {
- v->numref = 0;
}
if (v->extended_mv)
v->mvrange = get_unary(gb, 0, 3);
@@ -1110,7 +1126,7 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
INIT_LUT(v->lumscale2, v->lumshift2, v->curr_luty[v->cur_field_type^1], v->curr_lutuv[v->cur_field_type^1], 0);
INIT_LUT(v->lumscale , v->lumshift , v->last_luty[v->cur_field_type ], v->last_lutuv[v->cur_field_type ], 1);
}
- v->next_use_ic = v->curr_use_ic = 1;
+ v->next_use_ic = *v->curr_use_ic = 1;
} else {
INIT_LUT(v->lumscale , v->lumshift , v->last_luty[0], v->last_lutuv[0], 1);
INIT_LUT(v->lumscale2, v->lumshift2, v->last_luty[1], v->last_lutuv[1], 1);
@@ -1193,8 +1209,8 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
break;
case AV_PICTURE_TYPE_B:
if (v->fcm == ILACE_FRAME) {
- v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
- v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index];
+ if (read_bfraction(v, gb) < 0)
+ return AVERROR_INVALIDDATA;
if (v->bfraction == 0) {
return -1;
}
@@ -1699,5 +1715,7 @@ av_cold int ff_vc1_init_common(VC1Context *v)
v->pq = -1;
v->mvrange = 0; /* 7.1.1.18, p80 */
+ ff_vc1dsp_init(&v->vc1dsp);
+
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1.h b/chromium/third_party/ffmpeg/libavcodec/vc1.h
index 0cf4e0f9f77..662b58b4d9b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1.h
@@ -175,6 +175,21 @@ enum FrameCodingMode {
ILACE_FIELD ///< in the bitstream is reported as 11b
};
+/**
+ * Imode types
+ * @{
+ */
+enum Imode {
+ IMODE_RAW,
+ IMODE_NORM2,
+ IMODE_DIFF2,
+ IMODE_NORM6,
+ IMODE_DIFF6,
+ IMODE_ROWSKIP,
+ IMODE_COLSKIP
+};
+/** @} */ //imode defines
+
/** The VC1 Context
* @todo Change size wherever another size is more efficient
* Many members are only used for Advanced Profile
@@ -300,7 +315,7 @@ typedef struct VC1Context{
uint8_t aux_luty[2][256], aux_lutuv[2][256]; ///< lookup tables used for intensity compensation
uint8_t next_luty[2][256], next_lutuv[2][256]; ///< lookup tables used for intensity compensation
uint8_t (*curr_luty)[256] ,(*curr_lutuv)[256];
- int last_use_ic, curr_use_ic, next_use_ic, aux_use_ic;
+ int last_use_ic, *curr_use_ic, next_use_ic, aux_use_ic;
int rnd; ///< rounding control
/** Frame decoding info for S/M profiles only */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1_parser.c b/chromium/third_party/ffmpeg/libavcodec/vc1_parser.c
index cc29ce148b1..0021febaf56 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1_parser.c
@@ -30,122 +30,88 @@
#include "vc1.h"
#include "get_bits.h"
+/** The maximum number of bytes of a sequence, entry point or
+ * frame header whose values we pay any attention to */
+#define UNESCAPED_THRESHOLD 37
+
+/** The maximum number of bytes of a sequence, entry point or
+ * frame header which must be valid memory (because they are
+ * used to update the bitstream cache in skip_bits() calls)
+ */
+#define UNESCAPED_LIMIT 144
+
+typedef enum {
+ NO_MATCH,
+ ONE_ZERO,
+ TWO_ZEROS,
+ ONE
+} VC1ParseSearchState;
+
typedef struct {
ParseContext pc;
VC1Context v;
+ uint8_t prev_start_code;
+ size_t bytes_to_skip;
+ uint8_t unesc_buffer[UNESCAPED_LIMIT];
+ size_t unesc_index;
+ VC1ParseSearchState search_state;
} VC1ParseContext;
-static void vc1_extract_headers(AVCodecParserContext *s, AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
+static void vc1_extract_header(AVCodecParserContext *s, AVCodecContext *avctx,
+ const uint8_t *buf, int buf_size)
{
+ /* Parse the header we just finished unescaping */
VC1ParseContext *vpc = s->priv_data;
GetBitContext gb;
- const uint8_t *start, *end, *next;
- uint8_t *buf2 = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
+ int ret;
vpc->v.s.avctx = avctx;
vpc->v.parse_only = 1;
- vpc->v.first_pic_header_flag = 1;
- next = buf;
- s->repeat_pict = 0;
-
- for(start = buf, end = buf + buf_size; next < end; start = next){
- int buf2_size, size;
- int ret;
-
- next = find_next_marker(start + 4, end);
- size = next - start - 4;
- buf2_size = vc1_unescape_buffer(start + 4, size, buf2);
- init_get_bits(&gb, buf2, buf2_size * 8);
- if(size <= 0) continue;
- switch(AV_RB32(start)){
- case VC1_CODE_SEQHDR:
- ff_vc1_decode_sequence_header(avctx, &vpc->v, &gb);
- break;
- case VC1_CODE_ENTRYPOINT:
- ff_vc1_decode_entry_point(avctx, &vpc->v, &gb);
- break;
- case VC1_CODE_FRAME:
- if(vpc->v.profile < PROFILE_ADVANCED)
- ret = ff_vc1_parse_frame_header (&vpc->v, &gb);
- else
- ret = ff_vc1_parse_frame_header_adv(&vpc->v, &gb);
-
- if (ret < 0)
- break;
-
- /* keep AV_PICTURE_TYPE_BI internal to VC1 */
- if (vpc->v.s.pict_type == AV_PICTURE_TYPE_BI)
- s->pict_type = AV_PICTURE_TYPE_B;
- else
- s->pict_type = vpc->v.s.pict_type;
-
- if (avctx->ticks_per_frame > 1){
- // process pulldown flags
- s->repeat_pict = 1;
- // Pulldown flags are only valid when 'broadcast' has been set.
- // So ticks_per_frame will be 2
- if (vpc->v.rff){
- // repeat field
- s->repeat_pict = 2;
- }else if (vpc->v.rptfrm){
- // repeat frames
- s->repeat_pict = vpc->v.rptfrm * 2 + 1;
- }
- }
-
- if (vpc->v.broadcast && vpc->v.interlace && !vpc->v.psf)
- s->field_order = vpc->v.tff ? AV_FIELD_TT : AV_FIELD_BB;
- else
- s->field_order = AV_FIELD_PROGRESSIVE;
+ init_get_bits(&gb, buf, buf_size * 8);
+ switch (vpc->prev_start_code) {
+ case VC1_CODE_SEQHDR & 0xFF:
+ ff_vc1_decode_sequence_header(avctx, &vpc->v, &gb);
+ break;
+ case VC1_CODE_ENTRYPOINT & 0xFF:
+ ff_vc1_decode_entry_point(avctx, &vpc->v, &gb);
+ break;
+ case VC1_CODE_FRAME & 0xFF:
+ if(vpc->v.profile < PROFILE_ADVANCED)
+ ret = ff_vc1_parse_frame_header (&vpc->v, &gb);
+ else
+ ret = ff_vc1_parse_frame_header_adv(&vpc->v, &gb);
+ if (ret < 0)
break;
- }
- }
- av_free(buf2);
-}
+ /* keep AV_PICTURE_TYPE_BI internal to VC1 */
+ if (vpc->v.s.pict_type == AV_PICTURE_TYPE_BI)
+ s->pict_type = AV_PICTURE_TYPE_B;
+ else
+ s->pict_type = vpc->v.s.pict_type;
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-static int vc1_find_frame_end(ParseContext *pc, const uint8_t *buf,
- int buf_size) {
- int pic_found, i;
- uint32_t state;
-
- pic_found= pc->frame_start_found;
- state= pc->state;
-
- i=0;
- if(!pic_found){
- for(i=0; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(state == VC1_CODE_FRAME || state == VC1_CODE_FIELD){
- i++;
- pic_found=1;
- break;
+ if (avctx->ticks_per_frame > 1){
+ // process pulldown flags
+ s->repeat_pict = 1;
+ // Pulldown flags are only valid when 'broadcast' has been set.
+ // So ticks_per_frame will be 2
+ if (vpc->v.rff){
+ // repeat field
+ s->repeat_pict = 2;
+ }else if (vpc->v.rptfrm){
+ // repeat frames
+ s->repeat_pict = vpc->v.rptfrm * 2 + 1;
}
+ }else{
+ s->repeat_pict = 0;
}
- }
- if(pic_found){
- /* EOF considered as end of frame */
- if (buf_size == 0)
- return 0;
- for(; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(IS_MARKER(state) && state != VC1_CODE_FIELD && state != VC1_CODE_SLICE){
- pc->frame_start_found=0;
- pc->state=-1;
- return i-3;
- }
- }
+ if (vpc->v.broadcast && vpc->v.interlace && !vpc->v.psf)
+ s->field_order = vpc->v.tff ? AV_FIELD_TT : AV_FIELD_BB;
+ else
+ s->field_order = AV_FIELD_PROGRESSIVE;
+
+ break;
}
- pc->frame_start_found= pic_found;
- pc->state= state;
- return END_NOT_FOUND;
}
static int vc1_parse(AVCodecParserContext *s,
@@ -153,22 +119,127 @@ static int vc1_parse(AVCodecParserContext *s,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
+ /* Here we do the searching for frame boundaries and headers at
+ * the same time. Only a minimal amount at the start of each
+ * header is unescaped. */
VC1ParseContext *vpc = s->priv_data;
- int next;
+ int pic_found = vpc->pc.frame_start_found;
+ uint8_t *unesc_buffer = vpc->unesc_buffer;
+ size_t unesc_index = vpc->unesc_index;
+ VC1ParseSearchState search_state = vpc->search_state;
+ int next = END_NOT_FOUND;
+ int i = vpc->bytes_to_skip;
+
+ if (pic_found && buf_size == 0) {
+ /* EOF considered as end of frame */
+ memset(unesc_buffer + unesc_index, 0, UNESCAPED_THRESHOLD - unesc_index);
+ vc1_extract_header(s, avctx, unesc_buffer, unesc_index);
+ next = 0;
+ }
+ while (i < buf_size) {
+ int start_code_found = 0;
+ uint8_t b;
+ while (i < buf_size && unesc_index < UNESCAPED_THRESHOLD) {
+ b = buf[i++];
+ unesc_buffer[unesc_index++] = b;
+ if (search_state <= ONE_ZERO)
+ search_state = b ? NO_MATCH : search_state + 1;
+ else if (search_state == TWO_ZEROS) {
+ if (b == 1)
+ search_state = ONE;
+ else if (b > 1) {
+ if (b == 3)
+ unesc_index--; // swallow emulation prevention byte
+ search_state = NO_MATCH;
+ }
+ }
+ else { // search_state == ONE
+ // Header unescaping terminates early due to detection of next start code
+ search_state = NO_MATCH;
+ start_code_found = 1;
+ break;
+ }
+ }
+ if ((s->flags & PARSER_FLAG_COMPLETE_FRAMES) &&
+ unesc_index >= UNESCAPED_THRESHOLD &&
+ vpc->prev_start_code == (VC1_CODE_FRAME & 0xFF))
+ {
+ // No need to keep scanning the rest of the buffer for
+ // start codes if we know it contains a complete frame and
+ // we've already unescaped all we need of the frame header
+ vc1_extract_header(s, avctx, unesc_buffer, unesc_index);
+ break;
+ }
+ if (unesc_index >= UNESCAPED_THRESHOLD && !start_code_found) {
+ while (i < buf_size) {
+ if (search_state == NO_MATCH) {
+ i += vpc->v.vc1dsp.vc1_find_start_code_candidate(buf + i, buf_size - i);
+ if (i < buf_size) {
+ search_state = ONE_ZERO;
+ }
+ i++;
+ } else {
+ b = buf[i++];
+ if (search_state == ONE_ZERO)
+ search_state = b ? NO_MATCH : TWO_ZEROS;
+ else if (search_state == TWO_ZEROS) {
+ if (b >= 1)
+ search_state = b == 1 ? ONE : NO_MATCH;
+ }
+ else { // search_state == ONE
+ search_state = NO_MATCH;
+ start_code_found = 1;
+ break;
+ }
+ }
+ }
+ }
+ if (start_code_found) {
+ vc1_extract_header(s, avctx, unesc_buffer, unesc_index);
+
+ vpc->prev_start_code = b;
+ unesc_index = 0;
+
+ if (!(s->flags & PARSER_FLAG_COMPLETE_FRAMES)) {
+ if (!pic_found && (b == (VC1_CODE_FRAME & 0xFF) || b == (VC1_CODE_FIELD & 0xFF))) {
+ pic_found = 1;
+ }
+ else if (pic_found && b != (VC1_CODE_FIELD & 0xFF) && b != (VC1_CODE_SLICE & 0xFF)) {
+ next = i - 4;
+ pic_found = b == (VC1_CODE_FRAME & 0xFF);
+ break;
+ }
+ }
+ }
+ }
- if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
- next= buf_size;
- }else{
- next= vc1_find_frame_end(&vpc->pc, buf, buf_size);
+ vpc->pc.frame_start_found = pic_found;
+ vpc->unesc_index = unesc_index;
+ vpc->search_state = search_state;
+ if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
+ next = buf_size;
+ } else {
if (ff_combine_frame(&vpc->pc, next, &buf, &buf_size) < 0) {
+ vpc->bytes_to_skip = 0;
*poutbuf = NULL;
*poutbuf_size = 0;
return buf_size;
}
}
- vc1_extract_headers(s, avctx, buf, buf_size);
+ vpc->v.first_pic_header_flag = 1;
+
+ /* If we return with a valid pointer to a combined frame buffer
+ * then on the next call then we'll have been unhelpfully rewound
+ * by up to 4 bytes (depending upon whether the start code
+ * overlapped the input buffer, and if so by how much). We don't
+ * want this: it will either cause spurious second detections of
+ * the start code we've already seen, or cause extra bytes to be
+ * inserted at the start of the unescaped buffer. */
+ vpc->bytes_to_skip = 4;
+ if (next < 0 && next != END_NOT_FOUND)
+ vpc->bytes_to_skip += next;
*poutbuf = buf;
*poutbuf_size = buf_size;
@@ -199,6 +270,11 @@ static av_cold int vc1_parse_init(AVCodecParserContext *s)
{
VC1ParseContext *vpc = s->priv_data;
vpc->v.s.slice_context_count = 1;
+ vpc->v.first_pic_header_flag = 1;
+ vpc->prev_start_code = 0;
+ vpc->bytes_to_skip = 0;
+ vpc->unesc_index = 0;
+ vpc->search_state = NO_MATCH;
return ff_vc1_init_common(&vpc->v);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1dec.c b/chromium/third_party/ffmpeg/libavcodec/vc1dec.c
index 87846449ec7..c53c594bbe8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1dec.c
@@ -29,6 +29,7 @@
#include "internal.h"
#include "avcodec.h"
#include "error_resilience.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "h263.h"
#include "h264chroma.h"
@@ -59,29 +60,15 @@ static const int offset_table2[9] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 };
* @{
*/
-/**
- * Imode types
- * @{
- */
-enum Imode {
- IMODE_RAW,
- IMODE_NORM2,
- IMODE_DIFF2,
- IMODE_NORM6,
- IMODE_DIFF6,
- IMODE_ROWSKIP,
- IMODE_COLSKIP
-};
-/** @} */ //imode defines
static void init_block_index(VC1Context *v)
{
MpegEncContext *s = &v->s;
ff_init_block_index(s);
if (v->field_mode && !(v->second_field ^ v->tff)) {
- s->dest[0] += s->current_picture_ptr->f.linesize[0];
- s->dest[1] += s->current_picture_ptr->f.linesize[1];
- s->dest[2] += s->current_picture_ptr->f.linesize[2];
+ s->dest[0] += s->current_picture_ptr->f->linesize[0];
+ s->dest[1] += s->current_picture_ptr->f->linesize[1];
+ s->dest[2] += s->current_picture_ptr->f->linesize[2];
}
}
@@ -354,7 +341,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
if ((!v->field_mode ||
(v->ref_field_type[dir] == 1 && v->cur_field_type == 1)) &&
- !v->s.last_picture.f.data[0])
+ !v->s.last_picture.f->data[0])
return;
mx = s->mv[dir][0][0];
@@ -386,24 +373,24 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
}
if (!dir) {
if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->second_field) {
- srcY = s->current_picture.f.data[0];
- srcU = s->current_picture.f.data[1];
- srcV = s->current_picture.f.data[2];
+ srcY = s->current_picture.f->data[0];
+ srcU = s->current_picture.f->data[1];
+ srcV = s->current_picture.f->data[2];
luty = v->curr_luty;
lutuv = v->curr_lutuv;
- use_ic = v->curr_use_ic;
+ use_ic = *v->curr_use_ic;
} else {
- srcY = s->last_picture.f.data[0];
- srcU = s->last_picture.f.data[1];
- srcV = s->last_picture.f.data[2];
+ srcY = s->last_picture.f->data[0];
+ srcU = s->last_picture.f->data[1];
+ srcV = s->last_picture.f->data[2];
luty = v->last_luty;
lutuv = v->last_lutuv;
use_ic = v->last_use_ic;
}
} else {
- srcY = s->next_picture.f.data[0];
- srcU = s->next_picture.f.data[1];
- srcV = s->next_picture.f.data[2];
+ srcY = s->next_picture.f->data[0];
+ srcU = s->next_picture.f->data[1];
+ srcV = s->next_picture.f->data[2];
luty = v->next_luty;
lutuv = v->next_lutuv;
use_ic = v->next_use_ic;
@@ -436,9 +423,9 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
if (v->field_mode && v->ref_field_type[dir]) {
- srcY += s->current_picture_ptr->f.linesize[0];
- srcU += s->current_picture_ptr->f.linesize[1];
- srcV += s->current_picture_ptr->f.linesize[2];
+ srcY += s->current_picture_ptr->f->linesize[0];
+ srcU += s->current_picture_ptr->f->linesize[1];
+ srcV += s->current_picture_ptr->f->linesize[2];
}
/* for grayscale we should not try to read from unknown area */
@@ -523,11 +510,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
if (s->mspel) {
dxy = ((my & 3) << 2) | (mx & 3);
- v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] , srcY , s->linesize, v->rnd);
- v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8, srcY + 8, s->linesize, v->rnd);
- srcY += s->linesize * 8;
- v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8 * s->linesize , srcY , s->linesize, v->rnd);
- v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8 * s->linesize + 8, srcY + 8, s->linesize, v->rnd);
+ v->vc1dsp.put_vc1_mspel_pixels_tab[0][dxy](s->dest[0] , srcY , s->linesize, v->rnd);
} else { // hpel mc - always used for luma
dxy = (my & 2) | ((mx & 2) >> 1);
if (!v->rnd)
@@ -575,7 +558,7 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
if ((!v->field_mode ||
(v->ref_field_type[dir] == 1 && v->cur_field_type == 1)) &&
- !v->s.last_picture.f.data[0])
+ !v->s.last_picture.f->data[0])
return;
mx = s->mv[dir][n][0];
@@ -583,16 +566,16 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
if (!dir) {
if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->second_field) {
- srcY = s->current_picture.f.data[0];
+ srcY = s->current_picture.f->data[0];
luty = v->curr_luty;
- use_ic = v->curr_use_ic;
+ use_ic = *v->curr_use_ic;
} else {
- srcY = s->last_picture.f.data[0];
+ srcY = s->last_picture.f->data[0];
luty = v->last_luty;
use_ic = v->last_use_ic;
}
} else {
- srcY = s->next_picture.f.data[0];
+ srcY = s->next_picture.f->data[0];
luty = v->next_luty;
use_ic = v->next_use_ic;
}
@@ -692,7 +675,7 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
srcY += src_y * s->linesize + src_x;
if (v->field_mode && v->ref_field_type[dir])
- srcY += s->current_picture_ptr->f.linesize[0];
+ srcY += s->current_picture_ptr->f->linesize[0];
if (fieldmv && !(src_y & 1))
v_edge_pos--;
@@ -741,9 +724,9 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
if (s->mspel) {
dxy = ((my & 3) << 2) | (mx & 3);
if (avg)
- v->vc1dsp.avg_vc1_mspel_pixels_tab[dxy](s->dest[0] + off, srcY, s->linesize << fieldmv, v->rnd);
+ v->vc1dsp.avg_vc1_mspel_pixels_tab[1][dxy](s->dest[0] + off, srcY, s->linesize << fieldmv, v->rnd);
else
- v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + off, srcY, s->linesize << fieldmv, v->rnd);
+ v->vc1dsp.put_vc1_mspel_pixels_tab[1][dxy](s->dest[0] + off, srcY, s->linesize << fieldmv, v->rnd);
} else { // hpel mc - always used for luma
dxy = (my & 2) | ((mx & 2) >> 1);
if (!v->rnd)
@@ -822,7 +805,7 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
uint8_t (*lutuv)[256];
int use_ic;
- if (!v->field_mode && !v->s.last_picture.f.data[0])
+ if (!v->field_mode && !v->s.last_picture.f->data[0])
return;
if (s->flags & CODEC_FLAG_GRAY)
return;
@@ -853,7 +836,7 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
if (dominant)
chroma_ref_type = !v->cur_field_type;
}
- if (v->field_mode && chroma_ref_type == 1 && v->cur_field_type == 1 && !v->s.last_picture.f.data[0])
+ if (v->field_mode && chroma_ref_type == 1 && v->cur_field_type == 1 && !v->s.last_picture.f->data[0])
return;
s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = tx;
s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = ty;
@@ -884,19 +867,19 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
if (!dir) {
if (v->field_mode && (v->cur_field_type != chroma_ref_type) && v->second_field) {
- srcU = s->current_picture.f.data[1];
- srcV = s->current_picture.f.data[2];
+ srcU = s->current_picture.f->data[1];
+ srcV = s->current_picture.f->data[2];
lutuv = v->curr_lutuv;
- use_ic = v->curr_use_ic;
+ use_ic = *v->curr_use_ic;
} else {
- srcU = s->last_picture.f.data[1];
- srcV = s->last_picture.f.data[2];
+ srcU = s->last_picture.f->data[1];
+ srcV = s->last_picture.f->data[2];
lutuv = v->last_lutuv;
use_ic = v->last_use_ic;
}
} else {
- srcU = s->next_picture.f.data[1];
- srcV = s->next_picture.f.data[2];
+ srcU = s->next_picture.f->data[1];
+ srcV = s->next_picture.f->data[2];
lutuv = v->next_lutuv;
use_ic = v->next_use_ic;
}
@@ -911,8 +894,8 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
if (v->field_mode) {
if (chroma_ref_type) {
- srcU += s->current_picture_ptr->f.linesize[1];
- srcV += s->current_picture_ptr->f.linesize[2];
+ srcU += s->current_picture_ptr->f->linesize[1];
+ srcV += s->current_picture_ptr->f->linesize[2];
}
}
@@ -1017,13 +1000,13 @@ static void vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg)
uvsrc_x = av_clip(uvsrc_x, -8, s->avctx->coded_width >> 1);
uvsrc_y = av_clip(uvsrc_y, -8, s->avctx->coded_height >> 1);
if (i < 2 ? dir : dir2) {
- srcU = s->next_picture.f.data[1];
- srcV = s->next_picture.f.data[2];
+ srcU = s->next_picture.f->data[1];
+ srcV = s->next_picture.f->data[2];
lutuv = v->next_lutuv;
use_ic = v->next_use_ic;
} else {
- srcU = s->last_picture.f.data[1];
- srcV = s->last_picture.f.data[2];
+ srcU = s->last_picture.f->data[1];
+ srcV = s->last_picture.f->data[2];
lutuv = v->last_lutuv;
use_ic = v->last_use_ic;
}
@@ -1918,7 +1901,7 @@ static void vc1_interp_mc(VC1Context *v)
int v_edge_pos = s->v_edge_pos >> v->field_mode;
int use_ic = v->next_use_ic;
- if (!v->field_mode && !v->s.next_picture.f.data[0])
+ if (!v->field_mode && !v->s.next_picture.f->data[0])
return;
mx = s->mv[1][0][0];
@@ -1926,17 +1909,18 @@ static void vc1_interp_mc(VC1Context *v)
uvmx = (mx + ((mx & 3) == 3)) >> 1;
uvmy = (my + ((my & 3) == 3)) >> 1;
if (v->field_mode) {
- if (v->cur_field_type != v->ref_field_type[1])
+ if (v->cur_field_type != v->ref_field_type[1]) {
my = my - 2 + 4 * v->cur_field_type;
uvmy = uvmy - 2 + 4 * v->cur_field_type;
+ }
}
if (v->fastuvmc) {
uvmx = uvmx + ((uvmx < 0) ? -(uvmx & 1) : (uvmx & 1));
uvmy = uvmy + ((uvmy < 0) ? -(uvmy & 1) : (uvmy & 1));
}
- srcY = s->next_picture.f.data[0];
- srcU = s->next_picture.f.data[1];
- srcV = s->next_picture.f.data[2];
+ srcY = s->next_picture.f->data[0];
+ srcU = s->next_picture.f->data[1];
+ srcV = s->next_picture.f->data[2];
src_x = s->mb_x * 16 + (mx >> 2);
src_y = s->mb_y * 16 + (my >> 2);
@@ -1960,9 +1944,9 @@ static void vc1_interp_mc(VC1Context *v)
srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
if (v->field_mode && v->ref_field_type[1]) {
- srcY += s->current_picture_ptr->f.linesize[0];
- srcU += s->current_picture_ptr->f.linesize[1];
- srcV += s->current_picture_ptr->f.linesize[2];
+ srcY += s->current_picture_ptr->f->linesize[0];
+ srcU += s->current_picture_ptr->f->linesize[1];
+ srcV += s->current_picture_ptr->f->linesize[2];
}
/* for grayscale we should not try to read from unknown area */
@@ -2051,11 +2035,7 @@ static void vc1_interp_mc(VC1Context *v)
if (s->mspel) {
dxy = ((my & 3) << 2) | (mx & 3);
- v->vc1dsp.avg_vc1_mspel_pixels_tab[dxy](s->dest[0] + off , srcY , s->linesize, v->rnd);
- v->vc1dsp.avg_vc1_mspel_pixels_tab[dxy](s->dest[0] + off + 8, srcY + 8, s->linesize, v->rnd);
- srcY += s->linesize * 8;
- v->vc1dsp.avg_vc1_mspel_pixels_tab[dxy](s->dest[0] + off + 8 * s->linesize , srcY , s->linesize, v->rnd);
- v->vc1dsp.avg_vc1_mspel_pixels_tab[dxy](s->dest[0] + off + 8 * s->linesize + 8, srcY + 8, s->linesize, v->rnd);
+ v->vc1dsp.avg_vc1_mspel_pixels_tab[0][dxy](s->dest[0] + off , srcY , s->linesize, v->rnd);
} else { // hpel mc
dxy = (my & 2) | ((mx & 2) >> 1);
@@ -2127,6 +2107,8 @@ static inline void vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2],
int r_x, r_y;
const uint8_t *is_intra = v->mb_type[0];
+ av_assert0(!v->field_mode);
+
r_x = v->range_x;
r_y = v->range_y;
/* scale MV difference to be quad-pel */
@@ -2139,13 +2121,15 @@ static inline void vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2],
xy = s->block_index[0];
if (s->mb_intra) {
- s->current_picture.motion_val[0][xy + v->blocks_off][0] =
- s->current_picture.motion_val[0][xy + v->blocks_off][1] =
- s->current_picture.motion_val[1][xy + v->blocks_off][0] =
- s->current_picture.motion_val[1][xy + v->blocks_off][1] = 0;
+ s->current_picture.motion_val[0][xy][0] =
+ s->current_picture.motion_val[0][xy][1] =
+ s->current_picture.motion_val[1][xy][0] =
+ s->current_picture.motion_val[1][xy][1] = 0;
return;
}
- if (!v->field_mode) {
+ if (direct && s->next_picture_ptr->field_picture)
+ av_log(s->avctx, AV_LOG_WARNING, "Mixed frame/field direct mode not supported\n");
+
s->mv[0][0][0] = scale_mv(s->next_picture.motion_val[1][xy][0], v->bfraction, 0, s->quarter_sample);
s->mv[0][0][1] = scale_mv(s->next_picture.motion_val[1][xy][1], v->bfraction, 0, s->quarter_sample);
s->mv[1][0][0] = scale_mv(s->next_picture.motion_val[1][xy][0], v->bfraction, 1, s->quarter_sample);
@@ -2156,12 +2140,11 @@ static inline void vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2],
s->mv[0][0][1] = av_clip(s->mv[0][0][1], -60 - (s->mb_y << 6), (s->mb_height << 6) - 4 - (s->mb_y << 6));
s->mv[1][0][0] = av_clip(s->mv[1][0][0], -60 - (s->mb_x << 6), (s->mb_width << 6) - 4 - (s->mb_x << 6));
s->mv[1][0][1] = av_clip(s->mv[1][0][1], -60 - (s->mb_y << 6), (s->mb_height << 6) - 4 - (s->mb_y << 6));
- }
if (direct) {
- s->current_picture.motion_val[0][xy + v->blocks_off][0] = s->mv[0][0][0];
- s->current_picture.motion_val[0][xy + v->blocks_off][1] = s->mv[0][0][1];
- s->current_picture.motion_val[1][xy + v->blocks_off][0] = s->mv[1][0][0];
- s->current_picture.motion_val[1][xy + v->blocks_off][1] = s->mv[1][0][1];
+ s->current_picture.motion_val[0][xy][0] = s->mv[0][0][0];
+ s->current_picture.motion_val[0][xy][1] = s->mv[0][0][1];
+ s->current_picture.motion_val[1][xy][0] = s->mv[1][0][0];
+ s->current_picture.motion_val[1][xy][1] = s->mv[1][0][1];
return;
}
@@ -4356,6 +4339,10 @@ static void vc1_decode_b_mb_intfi(VC1Context *v)
if (bmvtype == BMV_TYPE_DIRECT) {
dmv_x[0] = dmv_y[0] = pred_flag[0] = 0;
dmv_x[1] = dmv_y[1] = pred_flag[0] = 0;
+ if (!s->next_picture_ptr->field_picture) {
+ av_log(s->avctx, AV_LOG_ERROR, "Mixed field/frame direct mode not supported\n");
+ return;
+ }
}
vc1_pred_b_mv_intfi(v, 0, dmv_x, dmv_y, 1, pred_flag);
vc1_b_mc(v, dmv_x, dmv_y, (bmvtype == BMV_TYPE_DIRECT), bmvtype);
@@ -4463,6 +4450,8 @@ static int vc1_decode_b_mb_intfr(VC1Context *v)
direct = v->direct_mb_plane[mb_pos];
if (direct) {
+ if (s->next_picture_ptr->field_picture)
+ av_log(s->avctx, AV_LOG_WARNING, "Mixed frame/field direct mode not supported\n");
s->mv[0][0][0] = s->current_picture.motion_val[0][s->block_index[0]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][0], v->bfraction, 0, s->quarter_sample);
s->mv[0][0][1] = s->current_picture.motion_val[0][s->block_index[0]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][1], v->bfraction, 0, s->quarter_sample);
s->mv[1][0][0] = s->current_picture.motion_val[1][s->block_index[0]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][0], v->bfraction, 1, s->quarter_sample);
@@ -5173,7 +5162,7 @@ static void vc1_decode_skip_blocks(VC1Context *v)
{
MpegEncContext *s = &v->s;
- if (!v->s.last_picture.f.data[0])
+ if (!v->s.last_picture.f->data[0])
return;
ff_er_add_slice(&s->er, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, ER_MB_END);
@@ -5182,9 +5171,9 @@ static void vc1_decode_skip_blocks(VC1Context *v)
s->mb_x = 0;
init_block_index(v);
ff_update_block_index(s);
- memcpy(s->dest[0], s->last_picture.f.data[0] + s->mb_y * 16 * s->linesize, s->linesize * 16);
- memcpy(s->dest[1], s->last_picture.f.data[1] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
- memcpy(s->dest[2], s->last_picture.f.data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
+ memcpy(s->dest[0], s->last_picture.f->data[0] + s->mb_y * 16 * s->linesize, s->linesize * 16);
+ memcpy(s->dest[1], s->last_picture.f->data[1] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
+ memcpy(s->dest[2], s->last_picture.f->data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
ff_mpeg_draw_horiz_band(s, s->mb_y * 16, 16);
s->first_slice_line = 0;
}
@@ -5288,7 +5277,7 @@ static void vc1_sprite_parse_transform(GetBitContext* gb, int c[7])
c[6] = 1 << 16;
}
-static void vc1_parse_sprites(VC1Context *v, GetBitContext* gb, SpriteData* sd)
+static int vc1_parse_sprites(VC1Context *v, GetBitContext* gb, SpriteData* sd)
{
AVCodecContext *avctx = v->s.avctx;
int sprite, i;
@@ -5332,7 +5321,7 @@ static void vc1_parse_sprites(VC1Context *v, GetBitContext* gb, SpriteData* sd)
sd->effect_pcount2 = get_bits(gb, 16);
if (sd->effect_pcount2 > 10) {
av_log(avctx, AV_LOG_ERROR, "Too many effect parameters\n");
- return;
+ return AVERROR_INVALIDDATA;
} else if (sd->effect_pcount2) {
i = -1;
av_log(avctx, AV_LOG_DEBUG, "Effect params 2: ");
@@ -5349,10 +5338,14 @@ static void vc1_parse_sprites(VC1Context *v, GetBitContext* gb, SpriteData* sd)
av_log(avctx, AV_LOG_DEBUG, "Effect flag set\n");
if (get_bits_count(gb) >= gb->size_in_bits +
- (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE ? 64 : 0))
+ (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE ? 64 : 0)) {
av_log(avctx, AV_LOG_ERROR, "Buffer overrun\n");
+ return AVERROR_INVALIDDATA;
+ }
if (get_bits_count(gb) < gb->size_in_bits - 8)
av_log(avctx, AV_LOG_WARNING, "Buffer not fully read\n");
+
+ return 0;
}
static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
@@ -5364,7 +5357,7 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
int ysub[2];
MpegEncContext *s = &v->s;
- for (i = 0; i < 2; i++) {
+ for (i = 0; i <= v->two_sprites; i++) {
xoff[i] = av_clip(sd->coefs[i][2], 0, v->sprite_width-1 << 16);
xadv[i] = sd->coefs[i][0];
if (xadv[i] != 1<<16 || (v->sprite_width << 16) - (v->output_width << 16) - xoff[i])
@@ -5383,15 +5376,15 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
v->sprite_output_frame->linesize[plane] * row;
for (sprite = 0; sprite <= v->two_sprites; sprite++) {
- uint8_t *iplane = s->current_picture.f.data[plane];
- int iline = s->current_picture.f.linesize[plane];
+ uint8_t *iplane = s->current_picture.f->data[plane];
+ int iline = s->current_picture.f->linesize[plane];
int ycoord = yoff[sprite] + yadv[sprite] * row;
int yline = ycoord >> 16;
int next_line;
ysub[sprite] = ycoord & 0xFFFF;
if (sprite) {
- iplane = s->last_picture.f.data[plane];
- iline = s->last_picture.f.linesize[plane];
+ iplane = s->last_picture.f->data[plane];
+ iline = s->last_picture.f->linesize[plane];
}
next_line = FFMIN(yline + 1, (v->sprite_height >> !!plane) - 1) * iline;
if (!(xoff[sprite] & 0xFFFF) && xadv[sprite] == 1 << 16) {
@@ -5442,7 +5435,7 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
}
if (!plane) {
- for (i = 0; i < 2; i++) {
+ for (i = 0; i <= v->two_sprites; i++) {
xoff[i] >>= 1;
yoff[i] >>= 1;
}
@@ -5459,14 +5452,18 @@ static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
AVCodecContext *avctx = s->avctx;
SpriteData sd;
- vc1_parse_sprites(v, gb, &sd);
+ memset(&sd, 0, sizeof(sd));
+
+ ret = vc1_parse_sprites(v, gb, &sd);
+ if (ret < 0)
+ return ret;
- if (!s->current_picture.f.data[0]) {
+ if (!s->current_picture.f->data[0]) {
av_log(avctx, AV_LOG_ERROR, "Got no sprites\n");
return -1;
}
- if (v->two_sprites && (!s->last_picture_ptr || !s->last_picture.f.data[0])) {
+ if (v->two_sprites && (!s->last_picture_ptr || !s->last_picture.f->data[0])) {
av_log(avctx, AV_LOG_WARNING, "Need two sprites, only got one\n");
v->two_sprites = 0;
}
@@ -5484,7 +5481,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx)
{
VC1Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
- AVFrame *f = &s->current_picture.f;
+ AVFrame *f = s->current_picture.f;
int plane, i;
/* Windows Media Image codecs have a convergence interval of two keyframes.
@@ -5504,14 +5501,15 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
{
MpegEncContext *s = &v->s;
int i;
+ int mb_height = FFALIGN(s->mb_height, 2);
/* Allocate mb bitplanes */
- v->mv_type_mb_plane = av_malloc (s->mb_stride * s->mb_height);
- v->direct_mb_plane = av_malloc (s->mb_stride * s->mb_height);
- v->forward_mb_plane = av_malloc (s->mb_stride * s->mb_height);
- v->fieldtx_plane = av_mallocz(s->mb_stride * s->mb_height);
- v->acpred_plane = av_malloc (s->mb_stride * s->mb_height);
- v->over_flags_plane = av_malloc (s->mb_stride * s->mb_height);
+ v->mv_type_mb_plane = av_malloc (s->mb_stride * mb_height);
+ v->direct_mb_plane = av_malloc (s->mb_stride * mb_height);
+ v->forward_mb_plane = av_malloc (s->mb_stride * mb_height);
+ v->fieldtx_plane = av_mallocz(s->mb_stride * mb_height);
+ v->acpred_plane = av_malloc (s->mb_stride * mb_height);
+ v->over_flags_plane = av_malloc (s->mb_stride * mb_height);
v->n_allocated_blks = s->mb_width + 2;
v->block = av_malloc(sizeof(*v->block) * v->n_allocated_blks);
@@ -5521,24 +5519,24 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
v->ttblk = v->ttblk_base + s->mb_stride;
v->is_intra_base = av_mallocz(sizeof(v->is_intra_base[0]) * 2 * s->mb_stride);
v->is_intra = v->is_intra_base + s->mb_stride;
- v->luma_mv_base = av_malloc(sizeof(v->luma_mv_base[0]) * 2 * s->mb_stride);
+ v->luma_mv_base = av_mallocz(sizeof(v->luma_mv_base[0]) * 2 * s->mb_stride);
v->luma_mv = v->luma_mv_base + s->mb_stride;
/* allocate block type info in that way so it could be used with s->block_index[] */
- v->mb_type_base = av_malloc(s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2);
+ v->mb_type_base = av_malloc(s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
v->mb_type[0] = v->mb_type_base + s->b8_stride + 1;
- v->mb_type[1] = v->mb_type_base + s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride + 1;
- v->mb_type[2] = v->mb_type[1] + s->mb_stride * (s->mb_height + 1);
+ v->mb_type[1] = v->mb_type_base + s->b8_stride * (mb_height * 2 + 1) + s->mb_stride + 1;
+ v->mb_type[2] = v->mb_type[1] + s->mb_stride * (mb_height + 1);
/* allocate memory to store block level MV info */
- v->blk_mv_type_base = av_mallocz( s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2);
+ v->blk_mv_type_base = av_mallocz( s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
v->blk_mv_type = v->blk_mv_type_base + s->b8_stride + 1;
- v->mv_f_base = av_mallocz(2 * (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2));
+ v->mv_f_base = av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2));
v->mv_f[0] = v->mv_f_base + s->b8_stride + 1;
- v->mv_f[1] = v->mv_f[0] + (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2);
- v->mv_f_next_base = av_mallocz(2 * (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2));
+ v->mv_f[1] = v->mv_f[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
+ v->mv_f_next_base = av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2));
v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1;
- v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2);
+ v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
/* Init coded blocks info */
if (v->profile == PROFILE_ADVANCED) {
@@ -5608,13 +5606,10 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
if (!avctx->extradata_size || !avctx->extradata)
return -1;
if (!(avctx->flags & CODEC_FLAG_GRAY))
- avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);
+ avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
else
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
- avctx->hwaccel = ff_find_hwaccel(avctx);
v->s.avctx = avctx;
- avctx->flags |= CODEC_FLAG_EMU_EDGE;
- v->s.flags |= CODEC_FLAG_EMU_EDGE;
if ((ret = ff_vc1_init_common(v)) < 0)
return ret;
@@ -5629,7 +5624,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
ff_vc1_decode_end(avctx);
ff_h264chroma_init(&v->h264chroma, 8);
- ff_vc1dsp_init(&v->vc1dsp);
if (avctx->codec_id == AV_CODEC_ID_WMV3 || avctx->codec_id == AV_CODEC_ID_WMV3IMAGE) {
int count = 0;
@@ -5805,7 +5799,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == VC1_CODE_ENDOFSEQ)) {
/* special case for last picture */
if (s->low_delay == 0 && s->next_picture_ptr) {
- if ((ret = av_frame_ref(pict, &s->next_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0)
return ret;
s->next_picture_ptr = NULL;
@@ -5850,7 +5844,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if (avctx->hwaccel ||
s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
buf_start_second_field = start;
- tmp = av_realloc(slices, sizeof(*slices) * (n_slices+1));
+ tmp = av_realloc_array(slices, sizeof(*slices), (n_slices+1));
if (!tmp)
goto err;
slices = tmp;
@@ -5863,7 +5857,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
buf_size3 << 3);
/* assuming that the field marker is at the exact middle,
hope it's correct */
- slices[n_slices].mby_start = s->mb_height >> 1;
+ slices[n_slices].mby_start = s->mb_height + 1 >> 1;
n_slices1 = n_slices - 1; // index of the last slice of the first field
n_slices++;
break;
@@ -5875,7 +5869,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
break;
case VC1_CODE_SLICE: {
int buf_size3;
- tmp = av_realloc(slices, sizeof(*slices) * (n_slices+1));
+ tmp = av_realloc_array(slices, sizeof(*slices), (n_slices+1));
if (!tmp)
goto err;
slices = tmp;
@@ -5904,7 +5898,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if (avctx->hwaccel ||
s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
buf_start_second_field = divider;
- tmp = av_realloc(slices, sizeof(*slices) * (n_slices+1));
+ tmp = av_realloc_array(slices, sizeof(*slices), (n_slices+1));
if (!tmp)
goto err;
slices = tmp;
@@ -5914,7 +5908,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
buf_size3 = vc1_unescape_buffer(divider + 4, buf + buf_size - divider - 4, slices[n_slices].buf);
init_get_bits(&slices[n_slices].gb, slices[n_slices].buf,
buf_size3 << 3);
- slices[n_slices].mby_start = s->mb_height >> 1;
+ slices[n_slices].mby_start = s->mb_height + 1 >> 1;
n_slices1 = n_slices - 1;
n_slices++;
}
@@ -5997,12 +5991,13 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
}
// for skipping the frame
- s->current_picture.f.pict_type = s->pict_type;
- s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+ s->current_picture.f->pict_type = s->pict_type;
+ s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
/* skip B-frames if we don't have reference frames */
if (s->last_picture_ptr == NULL && (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) {
- goto err;
+ av_log(v->s.avctx, AV_LOG_DEBUG, "Skipping B frame without reference frames\n");
+ goto end;
}
if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||
@@ -6021,19 +6016,20 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
goto err;
}
- v->s.current_picture_ptr->f.interlaced_frame = (v->fcm != PROGRESSIVE);
- v->s.current_picture_ptr->f.top_field_first = v->tff;
+ v->s.current_picture_ptr->field_picture = v->field_mode;
+ v->s.current_picture_ptr->f->interlaced_frame = (v->fcm != PROGRESSIVE);
+ v->s.current_picture_ptr->f->top_field_first = v->tff;
// process pulldown flags
- s->current_picture_ptr->f.repeat_pict = 0;
+ s->current_picture_ptr->f->repeat_pict = 0;
// Pulldown flags are only valid when 'broadcast' has been set.
// So ticks_per_frame will be 2
if (v->rff) {
// repeat field
- s->current_picture_ptr->f.repeat_pict = 1;
+ s->current_picture_ptr->f->repeat_pict = 1;
} else if (v->rptfrm) {
// repeat frames
- s->current_picture_ptr->f.repeat_pict = v->rptfrm * 2;
+ s->current_picture_ptr->f->repeat_pict = v->rptfrm * 2;
}
s->me.qpel_put = s->dsp.put_qpel_pixels_tab;
@@ -6067,7 +6063,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "parsing header for second field failed");
goto err;
}
- v->s.current_picture_ptr->f.pict_type = v->s.pict_type;
+ v->s.current_picture_ptr->f->pict_type = v->s.pict_type;
if (avctx->hwaccel->start_frame(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field) < 0)
goto err;
@@ -6092,9 +6088,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
v->bits = buf_size * 8;
v->end_mb_x = s->mb_width;
if (v->field_mode) {
- s->current_picture.f.linesize[0] <<= 1;
- s->current_picture.f.linesize[1] <<= 1;
- s->current_picture.f.linesize[2] <<= 1;
+ s->current_picture.f->linesize[0] <<= 1;
+ s->current_picture.f->linesize[1] <<= 1;
+ s->current_picture.f->linesize[2] <<= 1;
s->linesize <<= 1;
s->uvlinesize <<= 1;
}
@@ -6111,6 +6107,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
continue;
}
v->second_field = 1;
+ av_assert0((s->mb_height & 1) == 0);
v->blocks_off = s->b8_stride * (s->mb_height&~1);
v->mb_off = s->mb_stride * s->mb_height >> 1;
} else {
@@ -6163,9 +6160,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
}
if (v->field_mode) {
v->second_field = 0;
- s->current_picture.f.linesize[0] >>= 1;
- s->current_picture.f.linesize[1] >>= 1;
- s->current_picture.f.linesize[2] >>= 1;
+ s->current_picture.f->linesize[0] >>= 1;
+ s->current_picture.f->linesize[1] >>= 1;
+ s->current_picture.f->linesize[2] >>= 1;
s->linesize >>= 1;
s->uvlinesize >>= 1;
if (v->s.pict_type != AV_PICTURE_TYPE_BI && v->s.pict_type != AV_PICTURE_TYPE_B) {
@@ -6200,12 +6197,12 @@ image:
*got_frame = 1;
} else {
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
goto err;
ff_print_debug_info(s, s->current_picture_ptr, pict);
*got_frame = 1;
} else if (s->last_picture_ptr != NULL) {
- if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
goto err;
ff_print_debug_info(s, s->last_picture_ptr, pict);
*got_frame = 1;
@@ -6237,13 +6234,13 @@ static const AVProfile profiles[] = {
};
static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = {
-#if CONFIG_DXVA2
+#if CONFIG_VC1_DXVA2_HWACCEL
AV_PIX_FMT_DXVA2_VLD,
#endif
-#if CONFIG_VAAPI
+#if CONFIG_VC1_VAAPI_HWACCEL
AV_PIX_FMT_VAAPI_VLD,
#endif
-#if CONFIG_VDPAU
+#if CONFIG_VC1_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU,
#endif
AV_PIX_FMT_YUV420P,
@@ -6326,7 +6323,10 @@ AVCodec ff_wmv3image_decoder = {
.decode = vc1_decode_frame,
.capabilities = CODEC_CAP_DR1,
.flush = vc1_sprite_flush,
- .pix_fmts = ff_pixfmt_list_420
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
#endif
@@ -6342,6 +6342,9 @@ AVCodec ff_vc1image_decoder = {
.decode = vc1_decode_frame,
.capabilities = CODEC_CAP_DR1,
.flush = vc1_sprite_flush,
- .pix_fmts = ff_pixfmt_list_420
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1dsp.c b/chromium/third_party/ffmpeg/libavcodec/vc1dsp.c
index aab9d1aa6d5..787a6a63986 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1dsp.c
@@ -20,79 +20,79 @@
*/
/**
-* @file
+ * @file
* VC-1 and WMV3 decoder
*
*/
#include "libavutil/avassert.h"
#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
+#include "dsputil.h"
#include "h264chroma.h"
#include "rnd_avg.h"
#include "vc1dsp.h"
+#include "startcode.h"
-
-/** Apply overlap transform to horizontal edge
-*/
-static void vc1_v_overlap_c(uint8_t* src, int stride)
+/* Apply overlap transform to horizontal edge */
+static void vc1_v_overlap_c(uint8_t *src, int stride)
{
int i;
int a, b, c, d;
int d1, d2;
int rnd = 1;
- for(i = 0; i < 8; i++) {
- a = src[-2*stride];
- b = src[-stride];
- c = src[0];
- d = src[stride];
+ for (i = 0; i < 8; i++) {
+ a = src[-2 * stride];
+ b = src[-stride];
+ c = src[0];
+ d = src[stride];
d1 = (a - d + 3 + rnd) >> 3;
d2 = (a - d + b - c + 4 - rnd) >> 3;
- src[-2*stride] = a - d1;
- src[-stride] = av_clip_uint8(b - d2);
- src[0] = av_clip_uint8(c + d2);
- src[stride] = d + d1;
+ src[-2 * stride] = a - d1;
+ src[-stride] = av_clip_uint8(b - d2);
+ src[0] = av_clip_uint8(c + d2);
+ src[stride] = d + d1;
src++;
rnd = !rnd;
}
}
-/** Apply overlap transform to vertical edge
-*/
-static void vc1_h_overlap_c(uint8_t* src, int stride)
+/* Apply overlap transform to vertical edge */
+static void vc1_h_overlap_c(uint8_t *src, int stride)
{
int i;
int a, b, c, d;
int d1, d2;
int rnd = 1;
- for(i = 0; i < 8; i++) {
- a = src[-2];
- b = src[-1];
- c = src[0];
- d = src[1];
+ for (i = 0; i < 8; i++) {
+ a = src[-2];
+ b = src[-1];
+ c = src[0];
+ d = src[1];
d1 = (a - d + 3 + rnd) >> 3;
d2 = (a - d + b - c + 4 - rnd) >> 3;
src[-2] = a - d1;
src[-1] = av_clip_uint8(b - d2);
- src[0] = av_clip_uint8(c + d2);
- src[1] = d + d1;
- src += stride;
- rnd = !rnd;
+ src[0] = av_clip_uint8(c + d2);
+ src[1] = d + d1;
+ src += stride;
+ rnd = !rnd;
}
}
-static void vc1_v_s_overlap_c(int16_t *top, int16_t *bottom)
+static void vc1_v_s_overlap_c(int16_t *top, int16_t *bottom)
{
int i;
int a, b, c, d;
int d1, d2;
int rnd1 = 4, rnd2 = 3;
- for(i = 0; i < 8; i++) {
- a = top[48];
- b = top[56];
- c = bottom[0];
- d = bottom[8];
+ for (i = 0; i < 8; i++) {
+ a = top[48];
+ b = top[56];
+ c = bottom[0];
+ d = bottom[8];
d1 = a - d;
d2 = a - d + b - c;
@@ -114,11 +114,11 @@ static void vc1_h_s_overlap_c(int16_t *left, int16_t *right)
int a, b, c, d;
int d1, d2;
int rnd1 = 4, rnd2 = 3;
- for(i = 0; i < 8; i++) {
- a = left[6];
- b = left[7];
- c = right[0];
- d = right[1];
+ for (i = 0; i < 8; i++) {
+ a = left[6];
+ b = left[7];
+ c = right[0];
+ d = right[1];
d1 = a - d;
d2 = a - d + b - c;
@@ -128,9 +128,9 @@ static void vc1_h_s_overlap_c(int16_t *left, int16_t *right)
right[1] = ((d << 3) + d1 + rnd2) >> 3;
right += 8;
- left += 8;
- rnd2 = 7 - rnd2;
- rnd1 = 7 - rnd1;
+ left += 8;
+ rnd2 = 7 - rnd2;
+ rnd1 = 7 - rnd1;
}
}
@@ -142,31 +142,38 @@ static void vc1_h_s_overlap_c(int16_t *left, int16_t *right)
* @return whether other 3 pairs should be filtered or not
* @see 8.6
*/
-static av_always_inline int vc1_filter_line(uint8_t* src, int stride, int pq){
- int a0 = (2*(src[-2*stride] - src[ 1*stride]) - 5*(src[-1*stride] - src[ 0*stride]) + 4) >> 3;
+static av_always_inline int vc1_filter_line(uint8_t *src, int stride, int pq)
+{
+ int a0 = (2 * (src[-2 * stride] - src[1 * stride]) -
+ 5 * (src[-1 * stride] - src[0 * stride]) + 4) >> 3;
int a0_sign = a0 >> 31; /* Store sign */
+
a0 = (a0 ^ a0_sign) - a0_sign; /* a0 = FFABS(a0); */
- if(a0 < pq){
- int a1 = FFABS((2*(src[-4*stride] - src[-1*stride]) - 5*(src[-3*stride] - src[-2*stride]) + 4) >> 3);
- int a2 = FFABS((2*(src[ 0*stride] - src[ 3*stride]) - 5*(src[ 1*stride] - src[ 2*stride]) + 4) >> 3);
- if(a1 < a0 || a2 < a0){
- int clip = src[-1*stride] - src[ 0*stride];
+ if (a0 < pq) {
+ int a1 = FFABS((2 * (src[-4 * stride] - src[-1 * stride]) -
+ 5 * (src[-3 * stride] - src[-2 * stride]) + 4) >> 3);
+ int a2 = FFABS((2 * (src[ 0 * stride] - src[ 3 * stride]) -
+ 5 * (src[ 1 * stride] - src[ 2 * stride]) + 4) >> 3);
+ if (a1 < a0 || a2 < a0) {
+ int clip = src[-1 * stride] - src[0 * stride];
int clip_sign = clip >> 31;
- clip = ((clip ^ clip_sign) - clip_sign)>>1;
- if(clip){
- int a3 = FFMIN(a1, a2);
- int d = 5 * (a3 - a0);
+
+ clip = ((clip ^ clip_sign) - clip_sign) >> 1;
+ if (clip) {
+ int a3 = FFMIN(a1, a2);
+ int d = 5 * (a3 - a0);
int d_sign = (d >> 31);
- d = ((d ^ d_sign) - d_sign) >> 3;
+
+ d = ((d ^ d_sign) - d_sign) >> 3;
d_sign ^= a0_sign;
- if( d_sign ^ clip_sign )
+ if (d_sign ^ clip_sign)
d = 0;
- else{
+ else {
d = FFMIN(d, clip);
- d = (d ^ d_sign) - d_sign; /* Restore sign */
- src[-1*stride] = av_clip_uint8(src[-1*stride] - d);
- src[ 0*stride] = av_clip_uint8(src[ 0*stride] + d);
+ d = (d ^ d_sign) - d_sign; /* Restore sign */
+ src[-1 * stride] = av_clip_uint8(src[-1 * stride] - d);
+ src[ 0 * stride] = av_clip_uint8(src[ 0 * stride] + d);
}
return 1;
}
@@ -184,17 +191,18 @@ static av_always_inline int vc1_filter_line(uint8_t* src, int stride, int pq){
* @param pq block quantizer
* @see 8.6
*/
-static inline void vc1_loop_filter(uint8_t* src, int step, int stride, int len, int pq)
+static inline void vc1_loop_filter(uint8_t *src, int step, int stride,
+ int len, int pq)
{
int i;
int filt3;
- for(i = 0; i < len; i += 4){
- filt3 = vc1_filter_line(src + 2*step, stride, pq);
- if(filt3){
- vc1_filter_line(src + 0*step, stride, pq);
- vc1_filter_line(src + 1*step, stride, pq);
- vc1_filter_line(src + 3*step, stride, pq);
+ for (i = 0; i < len; i += 4) {
+ filt3 = vc1_filter_line(src + 2 * step, stride, pq);
+ if (filt3) {
+ vc1_filter_line(src + 0 * step, stride, pq);
+ vc1_filter_line(src + 1 * step, stride, pq);
+ vc1_filter_line(src + 3 * step, stride, pq);
}
src += step * 4;
}
@@ -230,15 +238,16 @@ static void vc1_h_loop_filter16_c(uint8_t *src, int stride, int pq)
vc1_loop_filter(src, stride, 1, 16, pq);
}
-/** Do inverse transform on 8x8 block
-*/
+/* Do inverse transform on 8x8 block */
static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, int16_t *block)
{
int i;
int dc = block[0];
+
dc = (3 * dc + 1) >> 1;
dc = (3 * dc + 16) >> 5;
- for(i = 0; i < 8; i++){
+
+ for (i = 0; i < 8; i++) {
dest[0] = av_clip_uint8(dest[0] + dc);
dest[1] = av_clip_uint8(dest[1] + dc);
dest[2] = av_clip_uint8(dest[2] + dc);
@@ -254,12 +263,12 @@ static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, int16_t *block)
static void vc1_inv_trans_8x8_c(int16_t block[64])
{
int i;
- register int t1,t2,t3,t4,t5,t6,t7,t8;
+ register int t1, t2, t3, t4, t5, t6, t7, t8;
int16_t *src, *dst, temp[64];
src = block;
dst = temp;
- for(i = 0; i < 8; i++){
+ for (i = 0; i < 8; i++) {
t1 = 12 * (src[ 0] + src[32]) + 4;
t2 = 12 * (src[ 0] - src[32]) + 4;
t3 = 16 * src[16] + 6 * src[48];
@@ -290,7 +299,7 @@ static void vc1_inv_trans_8x8_c(int16_t block[64])
src = temp;
dst = block;
- for(i = 0; i < 8; i++){
+ for (i = 0; i < 8; i++) {
t1 = 12 * (src[ 0] + src[32]) + 64;
t2 = 12 * (src[ 0] - src[32]) + 64;
t3 = 16 * src[16] + 6 * src[48];
@@ -320,15 +329,16 @@ static void vc1_inv_trans_8x8_c(int16_t block[64])
}
}
-/** Do inverse transform on 8x4 part of block
-*/
+/* Do inverse transform on 8x4 part of block */
static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, int16_t *block)
{
int i;
int dc = block[0];
- dc = ( 3 * dc + 1) >> 1;
+
+ dc = (3 * dc + 1) >> 1;
dc = (17 * dc + 64) >> 7;
- for(i = 0; i < 4; i++){
+
+ for (i = 0; i < 4; i++) {
dest[0] = av_clip_uint8(dest[0] + dc);
dest[1] = av_clip_uint8(dest[1] + dc);
dest[2] = av_clip_uint8(dest[2] + dc);
@@ -344,12 +354,13 @@ static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, int16_t *block)
static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block)
{
int i;
- register int t1,t2,t3,t4,t5,t6,t7,t8;
+ register int t1, t2, t3, t4, t5, t6, t7, t8;
int16_t *src, *dst;
src = block;
dst = block;
- for(i = 0; i < 4; i++){
+
+ for (i = 0; i < 4; i++) {
t1 = 12 * (src[0] + src[4]) + 4;
t2 = 12 * (src[0] - src[4]) + 4;
t3 = 16 * src[2] + 6 * src[6];
@@ -379,31 +390,32 @@ static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block)
}
src = block;
- for(i = 0; i < 8; i++){
+ for (i = 0; i < 8; i++) {
t1 = 17 * (src[ 0] + src[16]) + 64;
t2 = 17 * (src[ 0] - src[16]) + 64;
t3 = 22 * src[ 8] + 10 * src[24];
t4 = 22 * src[24] - 10 * src[ 8];
- dest[0*linesize] = av_clip_uint8(dest[0*linesize] + ((t1 + t3) >> 7));
- dest[1*linesize] = av_clip_uint8(dest[1*linesize] + ((t2 - t4) >> 7));
- dest[2*linesize] = av_clip_uint8(dest[2*linesize] + ((t2 + t4) >> 7));
- dest[3*linesize] = av_clip_uint8(dest[3*linesize] + ((t1 - t3) >> 7));
+ dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t1 + t3) >> 7));
+ dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t2 - t4) >> 7));
+ dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t2 + t4) >> 7));
+ dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t1 - t3) >> 7));
- src ++;
+ src++;
dest++;
}
}
-/** Do inverse transform on 4x8 parts of block
-*/
+/* Do inverse transform on 4x8 parts of block */
static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, int16_t *block)
{
int i;
int dc = block[0];
+
dc = (17 * dc + 4) >> 3;
dc = (12 * dc + 64) >> 7;
- for(i = 0; i < 8; i++){
+
+ for (i = 0; i < 8; i++) {
dest[0] = av_clip_uint8(dest[0] + dc);
dest[1] = av_clip_uint8(dest[1] + dc);
dest[2] = av_clip_uint8(dest[2] + dc);
@@ -415,12 +427,13 @@ static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, int16_t *block)
static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block)
{
int i;
- register int t1,t2,t3,t4,t5,t6,t7,t8;
+ register int t1, t2, t3, t4, t5, t6, t7, t8;
int16_t *src, *dst;
src = block;
dst = block;
- for(i = 0; i < 8; i++){
+
+ for (i = 0; i < 8; i++) {
t1 = 17 * (src[0] + src[2]) + 4;
t2 = 17 * (src[0] - src[2]) + 4;
t3 = 22 * src[1] + 10 * src[3];
@@ -436,7 +449,7 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block)
}
src = block;
- for(i = 0; i < 4; i++){
+ for (i = 0; i < 4; i++) {
t1 = 12 * (src[ 0] + src[32]) + 64;
t2 = 12 * (src[ 0] - src[32]) + 64;
t3 = 16 * src[16] + 6 * src[48];
@@ -452,29 +465,30 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block)
t3 = 9 * src[ 8] - 16 * src[24] + 4 * src[40] + 15 * src[56];
t4 = 4 * src[ 8] - 9 * src[24] + 15 * src[40] - 16 * src[56];
- dest[0*linesize] = av_clip_uint8(dest[0*linesize] + ((t5 + t1) >> 7));
- dest[1*linesize] = av_clip_uint8(dest[1*linesize] + ((t6 + t2) >> 7));
- dest[2*linesize] = av_clip_uint8(dest[2*linesize] + ((t7 + t3) >> 7));
- dest[3*linesize] = av_clip_uint8(dest[3*linesize] + ((t8 + t4) >> 7));
- dest[4*linesize] = av_clip_uint8(dest[4*linesize] + ((t8 - t4 + 1) >> 7));
- dest[5*linesize] = av_clip_uint8(dest[5*linesize] + ((t7 - t3 + 1) >> 7));
- dest[6*linesize] = av_clip_uint8(dest[6*linesize] + ((t6 - t2 + 1) >> 7));
- dest[7*linesize] = av_clip_uint8(dest[7*linesize] + ((t5 - t1 + 1) >> 7));
+ dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t5 + t1) >> 7));
+ dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t6 + t2) >> 7));
+ dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t7 + t3) >> 7));
+ dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t8 + t4) >> 7));
+ dest[4 * linesize] = av_clip_uint8(dest[4 * linesize] + ((t8 - t4 + 1) >> 7));
+ dest[5 * linesize] = av_clip_uint8(dest[5 * linesize] + ((t7 - t3 + 1) >> 7));
+ dest[6 * linesize] = av_clip_uint8(dest[6 * linesize] + ((t6 - t2 + 1) >> 7));
+ dest[7 * linesize] = av_clip_uint8(dest[7 * linesize] + ((t5 - t1 + 1) >> 7));
- src ++;
+ src++;
dest++;
}
}
-/** Do inverse transform on 4x4 part of block
-*/
+/* Do inverse transform on 4x4 part of block */
static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, int16_t *block)
{
int i;
int dc = block[0];
+
dc = (17 * dc + 4) >> 3;
dc = (17 * dc + 64) >> 7;
- for(i = 0; i < 4; i++){
+
+ for (i = 0; i < 4; i++) {
dest[0] = av_clip_uint8(dest[0] + dc);
dest[1] = av_clip_uint8(dest[1] + dc);
dest[2] = av_clip_uint8(dest[2] + dc);
@@ -486,12 +500,12 @@ static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, int16_t *block)
static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, int16_t *block)
{
int i;
- register int t1,t2,t3,t4;
+ register int t1, t2, t3, t4;
int16_t *src, *dst;
src = block;
dst = block;
- for(i = 0; i < 4; i++){
+ for (i = 0; i < 4; i++) {
t1 = 17 * (src[0] + src[2]) + 4;
t2 = 17 * (src[0] - src[2]) + 4;
t3 = 22 * src[1] + 10 * src[3];
@@ -507,117 +521,186 @@ static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, int16_t *block)
}
src = block;
- for(i = 0; i < 4; i++){
- t1 = 17 * (src[ 0] + src[16]) + 64;
- t2 = 17 * (src[ 0] - src[16]) + 64;
- t3 = 22 * src[ 8] + 10 * src[24];
- t4 = 22 * src[24] - 10 * src[ 8];
+ for (i = 0; i < 4; i++) {
+ t1 = 17 * (src[0] + src[16]) + 64;
+ t2 = 17 * (src[0] - src[16]) + 64;
+ t3 = 22 * src[8] + 10 * src[24];
+ t4 = 22 * src[24] - 10 * src[8];
- dest[0*linesize] = av_clip_uint8(dest[0*linesize] + ((t1 + t3) >> 7));
- dest[1*linesize] = av_clip_uint8(dest[1*linesize] + ((t2 - t4) >> 7));
- dest[2*linesize] = av_clip_uint8(dest[2*linesize] + ((t2 + t4) >> 7));
- dest[3*linesize] = av_clip_uint8(dest[3*linesize] + ((t1 - t3) >> 7));
+ dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t1 + t3) >> 7));
+ dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t2 - t4) >> 7));
+ dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t2 + t4) >> 7));
+ dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t1 - t3) >> 7));
- src ++;
+ src++;
dest++;
}
}
/* motion compensation functions */
-/** Filter in case of 2 filters */
-#define VC1_MSPEL_FILTER_16B(DIR, TYPE) \
-static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src, int stride, int mode) \
-{ \
- switch(mode){ \
- case 0: /* no shift - should not occur */ \
- return 0; \
- case 1: /* 1/4 shift */ \
- return -4*src[-stride] + 53*src[0] + 18*src[stride] - 3*src[stride*2]; \
- case 2: /* 1/2 shift */ \
- return -src[-stride] + 9*src[0] + 9*src[stride] - src[stride*2]; \
- case 3: /* 3/4 shift */ \
- return -3*src[-stride] + 18*src[0] + 53*src[stride] - 4*src[stride*2]; \
- } \
- return 0; /* should not occur */ \
+
+/* Filter in case of 2 filters */
+#define VC1_MSPEL_FILTER_16B(DIR, TYPE) \
+static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src, \
+ int stride, \
+ int mode) \
+{ \
+ switch(mode) { \
+ case 0: /* no shift - should not occur */ \
+ return 0; \
+ case 1: /* 1/4 shift */ \
+ return -4 * src[-stride] + 53 * src[0] + \
+ 18 * src[stride] - 3 * src[stride * 2]; \
+ case 2: /* 1/2 shift */ \
+ return -1 * src[-stride] + 9 * src[0] + \
+ 9 * src[stride] - 1 * src[stride * 2]; \
+ case 3: /* 3/4 shift */ \
+ return -3 * src[-stride] + 18 * src[0] + \
+ 53 * src[stride] - 4 * src[stride * 2]; \
+ } \
+ return 0; /* should not occur */ \
}
VC1_MSPEL_FILTER_16B(ver, uint8_t)
VC1_MSPEL_FILTER_16B(hor, int16_t)
-
-/** Filter used to interpolate fractional pel values
- */
-static av_always_inline int vc1_mspel_filter(const uint8_t *src, int stride, int mode, int r)
+/* Filter used to interpolate fractional pel values */
+static av_always_inline int vc1_mspel_filter(const uint8_t *src, int stride,
+ int mode, int r)
{
- switch(mode){
- case 0: //no shift
+ switch (mode) {
+ case 0: // no shift
return src[0];
case 1: // 1/4 shift
- return (-4*src[-stride] + 53*src[0] + 18*src[stride] - 3*src[stride*2] + 32 - r) >> 6;
+ return (-4 * src[-stride] + 53 * src[0] +
+ 18 * src[stride] - 3 * src[stride * 2] + 32 - r) >> 6;
case 2: // 1/2 shift
- return (-src[-stride] + 9*src[0] + 9*src[stride] - src[stride*2] + 8 - r) >> 4;
+ return (-1 * src[-stride] + 9 * src[0] +
+ 9 * src[stride] - 1 * src[stride * 2] + 8 - r) >> 4;
case 3: // 3/4 shift
- return (-3*src[-stride] + 18*src[0] + 53*src[stride] - 4*src[stride*2] + 32 - r) >> 6;
+ return (-3 * src[-stride] + 18 * src[0] +
+ 53 * src[stride] - 4 * src[stride * 2] + 32 - r) >> 6;
}
- return 0; //should not occur
+ return 0; // should not occur
}
-/** Function used to do motion compensation with bicubic interpolation
- */
-#define VC1_MSPEL_MC(OP, OP4, OPNAME)\
-static av_always_inline void OPNAME ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int hmode, int vmode, int rnd)\
-{\
- int i, j;\
-\
- if (vmode) { /* Horizontal filter to apply */\
- int r;\
-\
- if (hmode) { /* Vertical filter to apply, output to tmp */\
- static const int shift_value[] = { 0, 5, 1, 5 };\
- int shift = (shift_value[hmode]+shift_value[vmode])>>1;\
- int16_t tmp[11*8], *tptr = tmp;\
-\
- r = (1<<(shift-1)) + rnd-1;\
-\
- src -= 1;\
- for(j = 0; j < 8; j++) {\
- for(i = 0; i < 11; i++)\
- tptr[i] = (vc1_mspel_ver_filter_16bits(src + i, stride, vmode)+r)>>shift;\
- src += stride;\
- tptr += 11;\
- }\
-\
- r = 64-rnd;\
- tptr = tmp+1;\
- for(j = 0; j < 8; j++) {\
- for(i = 0; i < 8; i++)\
- OP(dst[i], (vc1_mspel_hor_filter_16bits(tptr + i, 1, hmode)+r)>>7);\
- dst += stride;\
- tptr += 11;\
- }\
-\
- return;\
- }\
- else { /* No horizontal filter, output 8 lines to dst */\
- r = 1-rnd;\
-\
- for(j = 0; j < 8; j++) {\
- for(i = 0; i < 8; i++)\
- OP(dst[i], vc1_mspel_filter(src + i, stride, vmode, r));\
- src += stride;\
- dst += stride;\
- }\
- return;\
- }\
- }\
-\
- /* Horizontal mode with no vertical mode */\
- for(j = 0; j < 8; j++) {\
- for(i = 0; i < 8; i++)\
- OP(dst[i], vc1_mspel_filter(src + i, 1, hmode, rnd));\
- dst += stride;\
- src += stride;\
- }\
+/* Function used to do motion compensation with bicubic interpolation */
+#define VC1_MSPEL_MC(OP, OP4, OPNAME) \
+static av_always_inline void OPNAME ## vc1_mspel_mc(uint8_t *dst, \
+ const uint8_t *src, \
+ ptrdiff_t stride, \
+ int hmode, \
+ int vmode, \
+ int rnd) \
+{ \
+ int i, j; \
+ \
+ if (vmode) { /* Horizontal filter to apply */ \
+ int r; \
+ \
+ if (hmode) { /* Vertical filter to apply, output to tmp */ \
+ static const int shift_value[] = { 0, 5, 1, 5 }; \
+ int shift = (shift_value[hmode] + shift_value[vmode]) >> 1; \
+ int16_t tmp[11 * 8], *tptr = tmp; \
+ \
+ r = (1 << (shift - 1)) + rnd - 1; \
+ \
+ src -= 1; \
+ for (j = 0; j < 8; j++) { \
+ for (i = 0; i < 11; i++) \
+ tptr[i] = (vc1_mspel_ver_filter_16bits(src + i, stride, vmode) + r) >> shift; \
+ src += stride; \
+ tptr += 11; \
+ } \
+ \
+ r = 64 - rnd; \
+ tptr = tmp + 1; \
+ for (j = 0; j < 8; j++) { \
+ for (i = 0; i < 8; i++) \
+ OP(dst[i], (vc1_mspel_hor_filter_16bits(tptr + i, 1, hmode) + r) >> 7); \
+ dst += stride; \
+ tptr += 11; \
+ } \
+ \
+ return; \
+ } else { /* No horizontal filter, output 8 lines to dst */ \
+ r = 1 - rnd; \
+ \
+ for (j = 0; j < 8; j++) { \
+ for (i = 0; i < 8; i++) \
+ OP(dst[i], vc1_mspel_filter(src + i, stride, vmode, r)); \
+ src += stride; \
+ dst += stride; \
+ } \
+ return; \
+ } \
+ } \
+ \
+ /* Horizontal mode with no vertical mode */ \
+ for (j = 0; j < 8; j++) { \
+ for (i = 0; i < 8; i++) \
+ OP(dst[i], vc1_mspel_filter(src + i, 1, hmode, rnd)); \
+ dst += stride; \
+ src += stride; \
+ } \
+}\
+static av_always_inline void OPNAME ## vc1_mspel_mc_16(uint8_t *dst, \
+ const uint8_t *src, \
+ ptrdiff_t stride, \
+ int hmode, \
+ int vmode, \
+ int rnd) \
+{ \
+ int i, j; \
+ \
+ if (vmode) { /* Horizontal filter to apply */ \
+ int r; \
+ \
+ if (hmode) { /* Vertical filter to apply, output to tmp */ \
+ static const int shift_value[] = { 0, 5, 1, 5 }; \
+ int shift = (shift_value[hmode] + shift_value[vmode]) >> 1; \
+ int16_t tmp[19 * 16], *tptr = tmp; \
+ \
+ r = (1 << (shift - 1)) + rnd - 1; \
+ \
+ src -= 1; \
+ for (j = 0; j < 16; j++) { \
+ for (i = 0; i < 19; i++) \
+ tptr[i] = (vc1_mspel_ver_filter_16bits(src + i, stride, vmode) + r) >> shift; \
+ src += stride; \
+ tptr += 19; \
+ } \
+ \
+ r = 64 - rnd; \
+ tptr = tmp + 1; \
+ for (j = 0; j < 16; j++) { \
+ for (i = 0; i < 16; i++) \
+ OP(dst[i], (vc1_mspel_hor_filter_16bits(tptr + i, 1, hmode) + r) >> 7); \
+ dst += stride; \
+ tptr += 19; \
+ } \
+ \
+ return; \
+ } else { /* No horizontal filter, output 8 lines to dst */ \
+ r = 1 - rnd; \
+ \
+ for (j = 0; j < 16; j++) { \
+ for (i = 0; i < 16; i++) \
+ OP(dst[i], vc1_mspel_filter(src + i, stride, vmode, r)); \
+ src += stride; \
+ dst += stride; \
+ } \
+ return; \
+ } \
+ } \
+ \
+ /* Horizontal mode with no vertical mode */ \
+ for (j = 0; j < 16; j++) { \
+ for (i = 0; i < 16; i++) \
+ OP(dst[i], vc1_mspel_filter(src + i, 1, hmode, rnd)); \
+ dst += stride; \
+ src += stride; \
+ } \
}\
static void OPNAME ## pixels8x8_c(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int rnd){\
int i;\
@@ -627,6 +710,17 @@ static void OPNAME ## pixels8x8_c(uint8_t *block, const uint8_t *pixels, ptrdiff
pixels+=line_size;\
block +=line_size;\
}\
+}\
+static void OPNAME ## pixels16x16_c(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int rnd){\
+ int i;\
+ for(i=0; i<16; i++){\
+ OP4(*(uint32_t*)(block ), AV_RN32(pixels ));\
+ OP4(*(uint32_t*)(block+ 4), AV_RN32(pixels+ 4));\
+ OP4(*(uint32_t*)(block+ 8), AV_RN32(pixels+ 8));\
+ OP4(*(uint32_t*)(block+12), AV_RN32(pixels+12));\
+ pixels+=line_size;\
+ block +=line_size;\
+ }\
}
#define op_put(a, b) a = av_clip_uint8(b)
@@ -639,18 +733,30 @@ VC1_MSPEL_MC(op_avg, op4_avg, avg_)
/* pixel functions - really are entry points to vc1_mspel_mc */
-#define PUT_VC1_MSPEL(a, b)\
-static void put_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, \
- const uint8_t *src, \
- ptrdiff_t stride, int rnd) \
-{ \
- put_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
-} \
-static void avg_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, \
- const uint8_t *src, \
- ptrdiff_t stride, int rnd) \
-{ \
- avg_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
+#define PUT_VC1_MSPEL(a, b) \
+static void put_vc1_mspel_mc ## a ## b ## _c(uint8_t *dst, \
+ const uint8_t *src, \
+ ptrdiff_t stride, int rnd) \
+{ \
+ put_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
+} \
+static void avg_vc1_mspel_mc ## a ## b ## _c(uint8_t *dst, \
+ const uint8_t *src, \
+ ptrdiff_t stride, int rnd) \
+{ \
+ avg_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
+} \
+static void put_vc1_mspel_mc ## a ## b ## _16_c(uint8_t *dst, \
+ const uint8_t *src, \
+ ptrdiff_t stride, int rnd) \
+{ \
+ put_vc1_mspel_mc_16(dst, src, stride, a, b, rnd); \
+} \
+static void avg_vc1_mspel_mc ## a ## b ## _16_c(uint8_t *dst, \
+ const uint8_t *src, \
+ ptrdiff_t stride, int rnd) \
+{ \
+ avg_vc1_mspel_mc_16(dst, src, stride, a, b, rnd); \
}
PUT_VC1_MSPEL(1, 0)
@@ -672,110 +778,128 @@ PUT_VC1_MSPEL(1, 3)
PUT_VC1_MSPEL(2, 3)
PUT_VC1_MSPEL(3, 3)
-static void put_no_rnd_vc1_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){
- const int A=(8-x)*(8-y);
- const int B=( x)*(8-y);
- const int C=(8-x)*( y);
- const int D=( x)*( y);
+#define chroma_mc(a) \
+ ((A * src[a] + B * src[a + 1] + \
+ C * src[stride + a] + D * src[stride + a + 1] + 32 - 4) >> 6)
+static void put_no_rnd_vc1_chroma_mc8_c(uint8_t *dst /* align 8 */,
+ uint8_t *src /* align 1 */,
+ int stride, int h, int x, int y)
+{
+ const int A = (8 - x) * (8 - y);
+ const int B = (x) * (8 - y);
+ const int C = (8 - x) * (y);
+ const int D = (x) * (y);
int i;
- av_assert2(x<8 && y<8 && x>=0 && y>=0);
-
- for(i=0; i<h; i++)
- {
- dst[0] = (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + 32 - 4) >> 6;
- dst[1] = (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + 32 - 4) >> 6;
- dst[2] = (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + 32 - 4) >> 6;
- dst[3] = (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + 32 - 4) >> 6;
- dst[4] = (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + 32 - 4) >> 6;
- dst[5] = (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + 32 - 4) >> 6;
- dst[6] = (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + 32 - 4) >> 6;
- dst[7] = (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + 32 - 4) >> 6;
- dst+= stride;
- src+= stride;
+ av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0);
+
+ for (i = 0; i < h; i++) {
+ dst[0] = chroma_mc(0);
+ dst[1] = chroma_mc(1);
+ dst[2] = chroma_mc(2);
+ dst[3] = chroma_mc(3);
+ dst[4] = chroma_mc(4);
+ dst[5] = chroma_mc(5);
+ dst[6] = chroma_mc(6);
+ dst[7] = chroma_mc(7);
+ dst += stride;
+ src += stride;
}
}
-static void put_no_rnd_vc1_chroma_mc4_c(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y){
- const int A=(8-x)*(8-y);
- const int B=( x)*(8-y);
- const int C=(8-x)*( y);
- const int D=( x)*( y);
+static void put_no_rnd_vc1_chroma_mc4_c(uint8_t *dst, uint8_t *src,
+ int stride, int h, int x, int y)
+{
+ const int A = (8 - x) * (8 - y);
+ const int B = (x) * (8 - y);
+ const int C = (8 - x) * (y);
+ const int D = (x) * (y);
int i;
- av_assert2(x<8 && y<8 && x>=0 && y>=0);
+ av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0);
- for(i=0; i<h; i++)
- {
- dst[0] = (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + 32 - 4) >> 6;
- dst[1] = (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + 32 - 4) >> 6;
- dst[2] = (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + 32 - 4) >> 6;
- dst[3] = (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + 32 - 4) >> 6;
- dst+= stride;
- src+= stride;
+ for (i = 0; i < h; i++) {
+ dst[0] = chroma_mc(0);
+ dst[1] = chroma_mc(1);
+ dst[2] = chroma_mc(2);
+ dst[3] = chroma_mc(3);
+ dst += stride;
+ src += stride;
}
}
-#define avg2(a,b) ((a+b+1)>>1)
-static void avg_no_rnd_vc1_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){
- const int A=(8-x)*(8-y);
- const int B=( x)*(8-y);
- const int C=(8-x)*( y);
- const int D=( x)*( y);
+#define avg2(a, b) (((a) + (b) + 1) >> 1)
+static void avg_no_rnd_vc1_chroma_mc8_c(uint8_t *dst /* align 8 */,
+ uint8_t *src /* align 1 */,
+ int stride, int h, int x, int y)
+{
+ const int A = (8 - x) * (8 - y);
+ const int B = (x) * (8 - y);
+ const int C = (8 - x) * (y);
+ const int D = (x) * (y);
int i;
- av_assert2(x<8 && y<8 && x>=0 && y>=0);
-
- for(i=0; i<h; i++)
- {
- dst[0] = avg2(dst[0], ((A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + 32 - 4) >> 6));
- dst[1] = avg2(dst[1], ((A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + 32 - 4) >> 6));
- dst[2] = avg2(dst[2], ((A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + 32 - 4) >> 6));
- dst[3] = avg2(dst[3], ((A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + 32 - 4) >> 6));
- dst[4] = avg2(dst[4], ((A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + 32 - 4) >> 6));
- dst[5] = avg2(dst[5], ((A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + 32 - 4) >> 6));
- dst[6] = avg2(dst[6], ((A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + 32 - 4) >> 6));
- dst[7] = avg2(dst[7], ((A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + 32 - 4) >> 6));
- dst+= stride;
- src+= stride;
+ av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0);
+
+ for (i = 0; i < h; i++) {
+ dst[0] = avg2(dst[0], chroma_mc(0));
+ dst[1] = avg2(dst[1], chroma_mc(1));
+ dst[2] = avg2(dst[2], chroma_mc(2));
+ dst[3] = avg2(dst[3], chroma_mc(3));
+ dst[4] = avg2(dst[4], chroma_mc(4));
+ dst[5] = avg2(dst[5], chroma_mc(5));
+ dst[6] = avg2(dst[6], chroma_mc(6));
+ dst[7] = avg2(dst[7], chroma_mc(7));
+ dst += stride;
+ src += stride;
}
}
-static void avg_no_rnd_vc1_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){
- const int A=(8-x)*(8-y);
- const int B=( x)*(8-y);
- const int C=(8-x)*( y);
- const int D=( x)*( y);
+static void avg_no_rnd_vc1_chroma_mc4_c(uint8_t *dst /* align 8 */,
+ uint8_t *src /* align 1 */,
+ int stride, int h, int x, int y)
+{
+ const int A = (8 - x) * (8 - y);
+ const int B = ( x) * (8 - y);
+ const int C = (8 - x) * ( y);
+ const int D = ( x) * ( y);
int i;
- av_assert2(x<8 && y<8 && x>=0 && y>=0);
+ av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0);
- for(i=0; i<h; i++)
- {
- dst[0] = avg2(dst[0], ((A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + 32 - 4) >> 6));
- dst[1] = avg2(dst[1], ((A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + 32 - 4) >> 6));
- dst[2] = avg2(dst[2], ((A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + 32 - 4) >> 6));
- dst[3] = avg2(dst[3], ((A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + 32 - 4) >> 6));
- dst+= stride;
- src+= stride;
+ for (i = 0; i < h; i++) {
+ dst[0] = avg2(dst[0], chroma_mc(0));
+ dst[1] = avg2(dst[1], chroma_mc(1));
+ dst[2] = avg2(dst[2], chroma_mc(2));
+ dst[3] = avg2(dst[3], chroma_mc(3));
+ dst += stride;
+ src += stride;
}
}
#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
-static void sprite_h_c(uint8_t *dst, const uint8_t *src, int offset, int advance, int count)
+static void sprite_h_c(uint8_t *dst, const uint8_t *src, int offset,
+ int advance, int count)
{
while (count--) {
- int a = src[(offset >> 16) ];
+ int a = src[(offset >> 16)];
int b = src[(offset >> 16) + 1];
- *dst++ = a + ((b - a) * (offset&0xFFFF) >> 16);
+ *dst++ = a + ((b - a) * (offset & 0xFFFF) >> 16);
offset += advance;
}
}
-static av_always_inline void sprite_v_template(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1,
- int two_sprites, const uint8_t *src2a, const uint8_t *src2b, int offset2,
- int alpha, int scaled, int width)
+static av_always_inline void sprite_v_template(uint8_t *dst,
+ const uint8_t *src1a,
+ const uint8_t *src1b,
+ int offset1,
+ int two_sprites,
+ const uint8_t *src2a,
+ const uint8_t *src2b,
+ int offset2,
+ int alpha, int scaled,
+ int width)
{
int a1, b1, a2, b2;
while (width--) {
@@ -796,98 +920,117 @@ static av_always_inline void sprite_v_template(uint8_t *dst, const uint8_t *src1
}
}
-static void sprite_v_single_c(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset, int width)
+static void sprite_v_single_c(uint8_t *dst, const uint8_t *src1a,
+ const uint8_t *src1b,
+ int offset, int width)
{
sprite_v_template(dst, src1a, src1b, offset, 0, NULL, NULL, 0, 0, 1, width);
}
-static void sprite_v_double_noscale_c(uint8_t *dst, const uint8_t *src1a, const uint8_t *src2a, int alpha, int width)
+static void sprite_v_double_noscale_c(uint8_t *dst, const uint8_t *src1a,
+ const uint8_t *src2a,
+ int alpha, int width)
{
sprite_v_template(dst, src1a, NULL, 0, 1, src2a, NULL, 0, alpha, 0, width);
}
-static void sprite_v_double_onescale_c(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1,
- const uint8_t *src2a, int alpha, int width)
+static void sprite_v_double_onescale_c(uint8_t *dst,
+ const uint8_t *src1a,
+ const uint8_t *src1b,
+ int offset1,
+ const uint8_t *src2a,
+ int alpha, int width)
{
- sprite_v_template(dst, src1a, src1b, offset1, 1, src2a, NULL, 0, alpha, 1, width);
+ sprite_v_template(dst, src1a, src1b, offset1, 1, src2a, NULL, 0, alpha, 1,
+ width);
}
-static void sprite_v_double_twoscale_c(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1,
- const uint8_t *src2a, const uint8_t *src2b, int offset2,
- int alpha, int width)
+static void sprite_v_double_twoscale_c(uint8_t *dst,
+ const uint8_t *src1a,
+ const uint8_t *src1b,
+ int offset1,
+ const uint8_t *src2a,
+ const uint8_t *src2b,
+ int offset2,
+ int alpha,
+ int width)
{
- sprite_v_template(dst, src1a, src1b, offset1, 1, src2a, src2b, offset2, alpha, 2, width);
+ sprite_v_template(dst, src1a, src1b, offset1, 1, src2a, src2b, offset2,
+ alpha, 2, width);
}
-#endif
+#endif /* CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER */
+#define FN_ASSIGN(X, Y) \
+ dsp->put_vc1_mspel_pixels_tab[1][X+4*Y] = put_vc1_mspel_mc##X##Y##_c; \
+ dsp->put_vc1_mspel_pixels_tab[0][X+4*Y] = put_vc1_mspel_mc##X##Y##_16_c; \
+ dsp->avg_vc1_mspel_pixels_tab[1][X+4*Y] = avg_vc1_mspel_mc##X##Y##_c; \
+ dsp->avg_vc1_mspel_pixels_tab[0][X+4*Y] = avg_vc1_mspel_mc##X##Y##_16_c
-av_cold void ff_vc1dsp_init(VC1DSPContext* dsp) {
- dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;
- dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c;
- dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c;
- dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c;
+av_cold void ff_vc1dsp_init(VC1DSPContext *dsp)
+{
+ dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;
+ dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c;
+ dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c;
+ dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c;
dsp->vc1_inv_trans_8x8_dc = vc1_inv_trans_8x8_dc_c;
dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_c;
dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_c;
dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_c;
- dsp->vc1_h_overlap = vc1_h_overlap_c;
- dsp->vc1_v_overlap = vc1_v_overlap_c;
- dsp->vc1_h_s_overlap = vc1_h_s_overlap_c;
- dsp->vc1_v_s_overlap = vc1_v_s_overlap_c;
- dsp->vc1_v_loop_filter4 = vc1_v_loop_filter4_c;
- dsp->vc1_h_loop_filter4 = vc1_h_loop_filter4_c;
- dsp->vc1_v_loop_filter8 = vc1_v_loop_filter8_c;
- dsp->vc1_h_loop_filter8 = vc1_h_loop_filter8_c;
- dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_c;
- dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_c;
-
- dsp->put_vc1_mspel_pixels_tab[ 0] = put_pixels8x8_c;
- dsp->put_vc1_mspel_pixels_tab[ 1] = put_vc1_mspel_mc10_c;
- dsp->put_vc1_mspel_pixels_tab[ 2] = put_vc1_mspel_mc20_c;
- dsp->put_vc1_mspel_pixels_tab[ 3] = put_vc1_mspel_mc30_c;
- dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_c;
- dsp->put_vc1_mspel_pixels_tab[ 5] = put_vc1_mspel_mc11_c;
- dsp->put_vc1_mspel_pixels_tab[ 6] = put_vc1_mspel_mc21_c;
- dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_c;
- dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_c;
- dsp->put_vc1_mspel_pixels_tab[ 9] = put_vc1_mspel_mc12_c;
- dsp->put_vc1_mspel_pixels_tab[10] = put_vc1_mspel_mc22_c;
- dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_c;
- dsp->put_vc1_mspel_pixels_tab[12] = put_vc1_mspel_mc03_c;
- dsp->put_vc1_mspel_pixels_tab[13] = put_vc1_mspel_mc13_c;
- dsp->put_vc1_mspel_pixels_tab[14] = put_vc1_mspel_mc23_c;
- dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_c;
-
- dsp->avg_vc1_mspel_pixels_tab[ 0] = avg_pixels8x8_c;
- dsp->avg_vc1_mspel_pixels_tab[ 1] = avg_vc1_mspel_mc10_c;
- dsp->avg_vc1_mspel_pixels_tab[ 2] = avg_vc1_mspel_mc20_c;
- dsp->avg_vc1_mspel_pixels_tab[ 3] = avg_vc1_mspel_mc30_c;
- dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_c;
- dsp->avg_vc1_mspel_pixels_tab[ 5] = avg_vc1_mspel_mc11_c;
- dsp->avg_vc1_mspel_pixels_tab[ 6] = avg_vc1_mspel_mc21_c;
- dsp->avg_vc1_mspel_pixels_tab[ 7] = avg_vc1_mspel_mc31_c;
- dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_c;
- dsp->avg_vc1_mspel_pixels_tab[ 9] = avg_vc1_mspel_mc12_c;
- dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_c;
- dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_c;
- dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_c;
- dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_c;
- dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_c;
- dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_c;
-
- dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= put_no_rnd_vc1_chroma_mc8_c;
- dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= avg_no_rnd_vc1_chroma_mc8_c;
+
+ dsp->vc1_h_overlap = vc1_h_overlap_c;
+ dsp->vc1_v_overlap = vc1_v_overlap_c;
+ dsp->vc1_h_s_overlap = vc1_h_s_overlap_c;
+ dsp->vc1_v_s_overlap = vc1_v_s_overlap_c;
+
+ dsp->vc1_v_loop_filter4 = vc1_v_loop_filter4_c;
+ dsp->vc1_h_loop_filter4 = vc1_h_loop_filter4_c;
+ dsp->vc1_v_loop_filter8 = vc1_v_loop_filter8_c;
+ dsp->vc1_h_loop_filter8 = vc1_h_loop_filter8_c;
+ dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_c;
+ dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_c;
+
+ dsp->put_vc1_mspel_pixels_tab[0][0] = put_pixels16x16_c;
+ dsp->avg_vc1_mspel_pixels_tab[0][0] = avg_pixels16x16_c;
+ dsp->put_vc1_mspel_pixels_tab[1][0] = put_pixels8x8_c;
+ dsp->avg_vc1_mspel_pixels_tab[1][0] = avg_pixels8x8_c;
+ FN_ASSIGN(0, 1);
+ FN_ASSIGN(0, 2);
+ FN_ASSIGN(0, 3);
+
+ FN_ASSIGN(1, 0);
+ FN_ASSIGN(1, 1);
+ FN_ASSIGN(1, 2);
+ FN_ASSIGN(1, 3);
+
+ FN_ASSIGN(2, 0);
+ FN_ASSIGN(2, 1);
+ FN_ASSIGN(2, 2);
+ FN_ASSIGN(2, 3);
+
+ FN_ASSIGN(3, 0);
+ FN_ASSIGN(3, 1);
+ FN_ASSIGN(3, 2);
+ FN_ASSIGN(3, 3);
+
+ dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_c;
+ dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = avg_no_rnd_vc1_chroma_mc8_c;
dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = put_no_rnd_vc1_chroma_mc4_c;
dsp->avg_no_rnd_vc1_chroma_pixels_tab[1] = avg_no_rnd_vc1_chroma_mc4_c;
#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
- dsp->sprite_h = sprite_h_c;
- dsp->sprite_v_single = sprite_v_single_c;
- dsp->sprite_v_double_noscale = sprite_v_double_noscale_c;
+ dsp->sprite_h = sprite_h_c;
+ dsp->sprite_v_single = sprite_v_single_c;
+ dsp->sprite_v_double_noscale = sprite_v_double_noscale_c;
dsp->sprite_v_double_onescale = sprite_v_double_onescale_c;
dsp->sprite_v_double_twoscale = sprite_v_double_twoscale_c;
-#endif
+#endif /* CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER */
+
+ dsp->vc1_find_start_code_candidate = ff_startcode_find_candidate_c;
+ if (ARCH_AARCH64)
+ ff_vc1dsp_init_aarch64(dsp);
+ if (ARCH_ARM)
+ ff_vc1dsp_init_arm(dsp);
if (ARCH_PPC)
ff_vc1dsp_init_ppc(dsp);
if (ARCH_X86)
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1dsp.h b/chromium/third_party/ffmpeg/libavcodec/vc1dsp.h
index a0d60480546..aa5b6d34fd7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1dsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1dsp.h
@@ -28,7 +28,6 @@
#ifndef AVCODEC_VC1DSP_H
#define AVCODEC_VC1DSP_H
-#include "dsputil.h"
#include "hpeldsp.h"
#include "h264chroma.h"
@@ -58,8 +57,8 @@ typedef struct VC1DSPContext {
/* put 8x8 block with bicubic interpolation and quarterpel precision
* last argument is actually round value instead of height
*/
- vc1op_pixels_func put_vc1_mspel_pixels_tab[16];
- vc1op_pixels_func avg_vc1_mspel_pixels_tab[16];
+ vc1op_pixels_func put_vc1_mspel_pixels_tab[2][16];
+ vc1op_pixels_func avg_vc1_mspel_pixels_tab[2][16];
/* This is really one func used in VC-1 decoding */
h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3];
@@ -74,9 +73,19 @@ typedef struct VC1DSPContext {
void (*sprite_v_double_twoscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1,
const uint8_t *src2a, const uint8_t *src2b, int offset2,
int alpha, int width);
+
+ /**
+ * Search buf from the start for up to size bytes. Return the index
+ * of a zero byte, or >= size if not found. Ideally, use lookahead
+ * to filter out any zero bytes that are known to not be followed by
+ * one or more further zero bytes and a one byte.
+ */
+ int (*vc1_find_start_code_candidate)(const uint8_t *buf, int size);
} VC1DSPContext;
void ff_vc1dsp_init(VC1DSPContext* c);
+void ff_vc1dsp_init_aarch64(VC1DSPContext* dsp);
+void ff_vc1dsp_init_arm(VC1DSPContext* dsp);
void ff_vc1dsp_init_ppc(VC1DSPContext *c);
void ff_vc1dsp_init_x86(VC1DSPContext* dsp);
diff --git a/chromium/third_party/ffmpeg/libavcodec/vda.c b/chromium/third_party/ffmpeg/libavcodec/vda.c
new file mode 100644
index 00000000000..170580f16ab
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/vda.c
@@ -0,0 +1,72 @@
+/*
+ * 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 "config.h"
+
+#include "libavutil/mem.h"
+
+#include "vda.h"
+#include "vda_internal.h"
+
+#if CONFIG_H264_VDA_HWACCEL
+AVVDAContext *av_vda_alloc_context(void)
+{
+ AVVDAContext *ret = av_mallocz(sizeof(*ret));
+
+ if (ret)
+ ret->output_callback = ff_vda_output_callback;
+
+ return ret;
+}
+
+int av_vda_default_init(AVCodecContext *avctx)
+{
+ avctx->hwaccel_context = av_vda_alloc_context();
+ if (!avctx->hwaccel_context)
+ return AVERROR(ENOMEM);
+ return ff_vda_default_init(avctx);
+}
+
+void av_vda_default_free(AVCodecContext *avctx)
+{
+ ff_vda_default_free(avctx);
+ av_freep(&avctx->hwaccel_context);
+}
+
+void ff_vda_default_free(AVCodecContext *avctx)
+{
+ AVVDAContext *vda = avctx->hwaccel_context;
+ if (vda && vda->decoder)
+ VDADecoderDestroy(vda->decoder);
+}
+
+#else
+AVVDAContext *av_vda_alloc_context(void)
+{
+ return NULL;
+}
+
+int av_vda_default_init(AVCodecContext *avctx)
+{
+ return AVERROR(ENOSYS);
+}
+
+void av_vda_default_free(AVCodecContext *ctx)
+{
+}
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/vda.h b/chromium/third_party/ffmpeg/libavcodec/vda.h
index b3d6399a655..12330aa3637 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vda.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vda.h
@@ -29,6 +29,8 @@
* Public libavcodec VDA header.
*/
+#include "libavcodec/avcodec.h"
+
#include <stdint.h>
// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
@@ -41,6 +43,12 @@
#include "libavcodec/version.h"
+// extra flags not defined in VDADecoder.h
+enum {
+ kVDADecodeInfo_Asynchronous = 1UL << 0,
+ kVDADecodeInfo_FrameDropped = 1UL << 1
+};
+
/**
* @defgroup lavc_codec_hwaccel_vda VDA
* @ingroup lavc_codec_hwaccel
@@ -112,26 +120,17 @@ struct vda_context {
OSType cv_pix_fmt_type;
/**
- * The current bitstream buffer.
- *
- * - encoding: unused
- * - decoding: Set/Unset by libavcodec.
+ * unused
*/
uint8_t *priv_bitstream;
/**
- * The current size of the bitstream.
- *
- * - encoding: unused
- * - decoding: Set/Unset by libavcodec.
+ * unused
*/
int priv_bitstream_size;
/**
- * The reference size used for fast reallocation.
- *
- * - encoding: unused
- * - decoding: Set/Unset by libavcodec.
+ * unused
*/
int priv_allocated_size;
@@ -156,6 +155,58 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
/**
+ * This struct holds all the information that needs to be passed
+ * between the caller and libavcodec for initializing VDA decoding.
+ * Its size is not a part of the public ABI, it must be allocated with
+ * av_vda_alloc_context() and freed with av_free().
+ */
+typedef struct AVVDAContext {
+ /**
+ * VDA decoder object. Created and freed by the caller.
+ */
+ VDADecoder decoder;
+
+ /**
+ * The output callback that must be passed to VDADecoderCreate.
+ * Set by av_vda_alloc_context().
+ */
+ VDADecoderOutputCallback output_callback;
+} AVVDAContext;
+
+/**
+ * Allocate and initialize a VDA context.
+ *
+ * This function should be called from the get_format() callback when the caller
+ * selects the AV_PIX_FMT_VDA format. The caller must then create the decoder
+ * object (using the output callback provided by libavcodec) that will be used
+ * for VDA-accelerated decoding.
+ *
+ * When decoding with VDA is finished, the caller must destroy the decoder
+ * object and free the VDA context using av_free().
+ *
+ * @return the newly allocated context or NULL on failure
+ */
+AVVDAContext *av_vda_alloc_context(void);
+
+/**
+ * This is a convenience function that creates and sets up the VDA context using
+ * an internal implementation.
+ *
+ * @param avctx the corresponding codec context
+ *
+ * @return >= 0 on success, a negative AVERROR code on failure
+ */
+int av_vda_default_init(AVCodecContext *avctx);
+
+/**
+ * This function must be called to free the VDA context initialized with
+ * av_vda_default_init().
+ *
+ * @param avctx the corresponding codec context
+ */
+void av_vda_default_free(AVCodecContext *avctx);
+
+/**
* @}
*/
diff --git a/chromium/third_party/ffmpeg/libavcodec/vda_h264.c b/chromium/third_party/ffmpeg/libavcodec/vda_h264.c
index e0561e2914d..61fb3c02c95 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vda_h264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vda_h264.c
@@ -31,6 +31,21 @@
struct vda_buffer {
CVPixelBufferRef cv_buffer;
};
+#include "internal.h"
+#include "vda_internal.h"
+
+typedef struct VDAContext {
+ // The current bitstream buffer.
+ uint8_t *bitstream;
+
+ // The current size of the bitstream.
+ int bitstream_size;
+
+ // The reference size used for fast reallocation.
+ int allocated_size;
+
+ CVImageBufferRef frame;
+} VDAContext;
/* Decoder callback that adds the vda frame to the queue in display order. */
static void vda_decoder_callback(void *vda_hw_ctx,
@@ -41,6 +56,9 @@ static void vda_decoder_callback(void *vda_hw_ctx,
{
struct vda_context *vda_ctx = vda_hw_ctx;
+ if (infoFlags & kVDADecodeInfo_FrameDropped)
+ vda_ctx->cv_buffer = NULL;
+
if (!image_buffer)
return;
@@ -50,15 +68,15 @@ static void vda_decoder_callback(void *vda_hw_ctx,
vda_ctx->cv_buffer = CVPixelBufferRetain(image_buffer);
}
-static int vda_sync_decode(struct vda_context *vda_ctx)
+static int vda_sync_decode(VDAContext *ctx, struct vda_context *vda_ctx)
{
OSStatus status;
CFDataRef coded_frame;
uint32_t flush_flags = 1 << 0; ///< kVDADecoderFlush_emitFrames
coded_frame = CFDataCreate(kCFAllocatorDefault,
- vda_ctx->priv_bitstream,
- vda_ctx->priv_bitstream_size);
+ ctx->bitstream,
+ ctx->bitstream_size);
status = VDADecoderDecode(vda_ctx->decoder, 0, coded_frame, NULL);
@@ -71,42 +89,44 @@ static int vda_sync_decode(struct vda_context *vda_ctx)
}
-static int vda_h264_start_frame(AVCodecContext *avctx,
+static int vda_old_h264_start_frame(AVCodecContext *avctx,
av_unused const uint8_t *buffer,
av_unused uint32_t size)
{
+ VDAContext *vda = avctx->internal->hwaccel_priv_data;
struct vda_context *vda_ctx = avctx->hwaccel_context;
if (!vda_ctx->decoder)
return -1;
- vda_ctx->priv_bitstream_size = 0;
+ vda->bitstream_size = 0;
return 0;
}
-static int vda_h264_decode_slice(AVCodecContext *avctx,
+static int vda_old_h264_decode_slice(AVCodecContext *avctx,
const uint8_t *buffer,
uint32_t size)
{
+ VDAContext *vda = avctx->internal->hwaccel_priv_data;
struct vda_context *vda_ctx = avctx->hwaccel_context;
void *tmp;
if (!vda_ctx->decoder)
return -1;
- tmp = av_fast_realloc(vda_ctx->priv_bitstream,
- &vda_ctx->priv_allocated_size,
- vda_ctx->priv_bitstream_size + size + 4);
+ tmp = av_fast_realloc(vda->bitstream,
+ &vda->allocated_size,
+ vda->bitstream_size + size + 4);
if (!tmp)
return AVERROR(ENOMEM);
- vda_ctx->priv_bitstream = tmp;
+ vda->bitstream = tmp;
- AV_WB32(vda_ctx->priv_bitstream + vda_ctx->priv_bitstream_size, size);
- memcpy(vda_ctx->priv_bitstream + vda_ctx->priv_bitstream_size + 4, buffer, size);
+ AV_WB32(vda->bitstream + vda->bitstream_size, size);
+ memcpy(vda->bitstream + vda->bitstream_size + 4, buffer, size);
- vda_ctx->priv_bitstream_size += size + 4;
+ vda->bitstream_size += size + 4;
return 0;
}
@@ -118,19 +138,20 @@ static void vda_h264_release_buffer(void *opaque, uint8_t *data)
av_free(context);
}
-static int vda_h264_end_frame(AVCodecContext *avctx)
+static int vda_old_h264_end_frame(AVCodecContext *avctx)
{
H264Context *h = avctx->priv_data;
+ VDAContext *vda = avctx->internal->hwaccel_priv_data;
struct vda_context *vda_ctx = avctx->hwaccel_context;
AVFrame *frame = &h->cur_pic_ptr->f;
struct vda_buffer *context;
AVBufferRef *buffer;
int status;
- if (!vda_ctx->decoder || !vda_ctx->priv_bitstream)
+ if (!vda_ctx->decoder || !vda->bitstream)
return -1;
- status = vda_sync_decode(vda_ctx);
+ status = vda_sync_decode(vda, vda_ctx);
frame->data[3] = (void*)vda_ctx->cv_buffer;
if (status)
@@ -224,7 +245,7 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
status = VDADecoderCreate(config_info,
buffer_attributes,
- vda_decoder_callback,
+ (VDADecoderOutputCallback *)vda_decoder_callback,
vda_ctx,
&vda_ctx->decoder);
@@ -247,17 +268,264 @@ int ff_vda_destroy_decoder(struct vda_context *vda_ctx)
if (vda_ctx->decoder)
status = VDADecoderDestroy(vda_ctx->decoder);
- av_freep(&vda_ctx->priv_bitstream);
-
return status;
}
-AVHWAccel ff_h264_vda_hwaccel = {
+static int vda_h264_uninit(AVCodecContext *avctx)
+{
+ VDAContext *vda = avctx->internal->hwaccel_priv_data;
+ if (vda) {
+ av_freep(&vda->bitstream);
+ if (vda->frame)
+ CVPixelBufferRelease(vda->frame);
+ }
+ return 0;
+}
+
+AVHWAccel ff_h264_vda_old_hwaccel = {
.name = "h264_vda",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
.pix_fmt = AV_PIX_FMT_VDA_VLD,
+ .start_frame = vda_old_h264_start_frame,
+ .decode_slice = vda_old_h264_decode_slice,
+ .end_frame = vda_old_h264_end_frame,
+ .uninit = vda_h264_uninit,
+ .priv_data_size = sizeof(VDAContext),
+};
+
+void ff_vda_output_callback(void *opaque,
+ CFDictionaryRef user_info,
+ OSStatus status,
+ uint32_t infoFlags,
+ CVImageBufferRef image_buffer)
+{
+ AVCodecContext *ctx = opaque;
+ VDAContext *vda = ctx->internal->hwaccel_priv_data;
+
+
+ if (vda->frame) {
+ CVPixelBufferRelease(vda->frame);
+ vda->frame = NULL;
+ }
+
+ if (!image_buffer)
+ return;
+
+ vda->frame = CVPixelBufferRetain(image_buffer);
+}
+
+static int vda_h264_start_frame(AVCodecContext *avctx,
+ const uint8_t *buffer,
+ uint32_t size)
+{
+ VDAContext *vda = avctx->internal->hwaccel_priv_data;
+
+ vda->bitstream_size = 0;
+
+ return 0;
+}
+
+static int vda_h264_decode_slice(AVCodecContext *avctx,
+ const uint8_t *buffer,
+ uint32_t size)
+{
+ VDAContext *vda = avctx->internal->hwaccel_priv_data;
+ void *tmp;
+
+ tmp = av_fast_realloc(vda->bitstream,
+ &vda->allocated_size,
+ vda->bitstream_size + size + 4);
+ if (!tmp)
+ return AVERROR(ENOMEM);
+
+ vda->bitstream = tmp;
+
+ AV_WB32(vda->bitstream + vda->bitstream_size, size);
+ memcpy(vda->bitstream + vda->bitstream_size + 4, buffer, size);
+
+ vda->bitstream_size += size + 4;
+
+ return 0;
+}
+
+static void release_buffer(void *opaque, uint8_t *data)
+{
+ CVImageBufferRef frame = (CVImageBufferRef)data;
+ CVPixelBufferRelease(frame);
+}
+
+static int vda_h264_end_frame(AVCodecContext *avctx)
+{
+ H264Context *h = avctx->priv_data;
+ VDAContext *vda = avctx->internal->hwaccel_priv_data;
+ AVVDAContext *vda_ctx = avctx->hwaccel_context;
+ AVFrame *frame = &h->cur_pic_ptr->f;
+ uint32_t flush_flags = 1 << 0; ///< kVDADecoderFlush_emitFrames
+ CFDataRef coded_frame;
+ OSStatus status;
+
+ if (!vda->bitstream_size)
+ return AVERROR_INVALIDDATA;
+
+
+ coded_frame = CFDataCreate(kCFAllocatorDefault,
+ vda->bitstream,
+ vda->bitstream_size);
+
+ status = VDADecoderDecode(vda_ctx->decoder, 0, coded_frame, NULL);
+
+ if (status == kVDADecoderNoErr)
+ status = VDADecoderFlush(vda_ctx->decoder, flush_flags);
+
+ CFRelease(coded_frame);
+
+ if (status != kVDADecoderNoErr) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status);
+ return AVERROR_UNKNOWN;
+ }
+
+ if (vda->frame) {
+ av_buffer_unref(&frame->buf[0]);
+
+ frame->buf[0] = av_buffer_create((uint8_t*)vda->frame,
+ sizeof(vda->frame),
+ release_buffer, NULL,
+ AV_BUFFER_FLAG_READONLY);
+ if (!frame->buf)
+ return AVERROR(ENOMEM);
+
+ frame->data[3] = (uint8_t*)vda->frame;
+ vda->frame = NULL;
+ }
+
+ return 0;
+}
+
+int ff_vda_default_init(AVCodecContext *avctx)
+{
+ AVVDAContext *vda_ctx = avctx->hwaccel_context;
+ OSStatus status = kVDADecoderNoErr;
+ CFNumberRef height;
+ CFNumberRef width;
+ CFNumberRef format;
+ CFDataRef avc_data;
+ CFMutableDictionaryRef config_info;
+ CFMutableDictionaryRef buffer_attributes;
+ CFMutableDictionaryRef io_surface_properties;
+ CFNumberRef cv_pix_fmt;
+ int32_t fmt = 'avc1', pix_fmt = kCVPixelFormatType_422YpCbCr8;
+
+ // kCVPixelFormatType_420YpCbCr8Planar;
+
+ /* Each VCL NAL in the bitstream sent to the decoder
+ * is preceded by a 4 bytes length header.
+ * Change the avcC atom header if needed, to signal headers of 4 bytes. */
+ if (avctx->extradata_size >= 4 && (avctx->extradata[4] & 0x03) != 0x03) {
+ uint8_t *rw_extradata;
+
+ if (!(rw_extradata = av_malloc(avctx->extradata_size)))
+ return AVERROR(ENOMEM);
+
+ memcpy(rw_extradata, avctx->extradata, avctx->extradata_size);
+
+ rw_extradata[4] |= 0x03;
+
+ avc_data = CFDataCreate(kCFAllocatorDefault, rw_extradata, avctx->extradata_size);
+
+ av_freep(&rw_extradata);
+ } else {
+ avc_data = CFDataCreate(kCFAllocatorDefault,
+ avctx->extradata, avctx->extradata_size);
+ }
+
+ config_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
+ 4,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
+ height = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &avctx->height);
+ width = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &avctx->width);
+ format = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &fmt);
+ CFDictionarySetValue(config_info, kVDADecoderConfiguration_Height, height);
+ CFDictionarySetValue(config_info, kVDADecoderConfiguration_Width, width);
+ CFDictionarySetValue(config_info, kVDADecoderConfiguration_avcCData, avc_data);
+ CFDictionarySetValue(config_info, kVDADecoderConfiguration_SourceFormat, format);
+
+ buffer_attributes = CFDictionaryCreateMutable(kCFAllocatorDefault,
+ 2,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ io_surface_properties = CFDictionaryCreateMutable(kCFAllocatorDefault,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ cv_pix_fmt = CFNumberCreate(kCFAllocatorDefault,
+ kCFNumberSInt32Type,
+ &pix_fmt);
+
+ CFDictionarySetValue(buffer_attributes,
+ kCVPixelBufferPixelFormatTypeKey,
+ cv_pix_fmt);
+ CFDictionarySetValue(buffer_attributes,
+ kCVPixelBufferIOSurfacePropertiesKey,
+ io_surface_properties);
+
+ status = VDADecoderCreate(config_info,
+ buffer_attributes,
+ (VDADecoderOutputCallback *)ff_vda_output_callback,
+ avctx,
+ &vda_ctx->decoder);
+
+ CFRelease(format);
+ CFRelease(height);
+ CFRelease(width);
+ CFRelease(avc_data);
+ CFRelease(config_info);
+ CFRelease(cv_pix_fmt);
+ CFRelease(io_surface_properties);
+ CFRelease(buffer_attributes);
+
+ if (status != kVDADecoderNoErr) {
+ av_log(avctx, AV_LOG_ERROR, "Cannot initialize VDA %d\n", status);
+ }
+
+ switch (status) {
+ case kVDADecoderHardwareNotSupportedErr:
+ case kVDADecoderFormatNotSupportedErr:
+ return AVERROR(ENOSYS);
+ case kVDADecoderConfigurationError:
+ return AVERROR(EINVAL);
+ case kVDADecoderDecoderFailedErr:
+ return AVERROR_INVALIDDATA;
+ case kVDADecoderNoErr:
+ return 0;
+ default:
+ return AVERROR_UNKNOWN;
+ }
+}
+
+static int vda_h264_alloc_frame(AVCodecContext *avctx, AVFrame *frame)
+{
+ frame->width = avctx->width;
+ frame->height = avctx->height;
+ frame->format = avctx->pix_fmt;
+ frame->buf[0] = av_buffer_alloc(1);
+
+ if (!frame->buf[0])
+ return AVERROR(ENOMEM);
+ return 0;
+}
+
+AVHWAccel ff_h264_vda_hwaccel = {
+ .name = "h264_vda",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_H264,
+ .pix_fmt = AV_PIX_FMT_VDA,
+ .alloc_frame = vda_h264_alloc_frame,
.start_frame = vda_h264_start_frame,
.decode_slice = vda_h264_decode_slice,
.end_frame = vda_h264_end_frame,
+ .uninit = vda_h264_uninit,
+ .priv_data_size = sizeof(VDAContext),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vda_h264_dec.c b/chromium/third_party/ffmpeg/libavcodec/vda_h264_dec.c
index e5fa8071b3b..c00e7e4e155 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vda_h264_dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vda_h264_dec.c
@@ -180,7 +180,7 @@ static av_cold int vdadec_init(AVCodecContext *avctx)
VDADecoderContext *ctx = avctx->priv_data;
struct vda_context *vda_ctx = &ctx->vda_ctx;
OSStatus status;
- int ret;
+ int ret, i;
ctx->h264_initialized = 0;
@@ -235,6 +235,16 @@ static av_cold int vdadec_init(AVCodecContext *avctx)
}
ctx->h264_initialized = 1;
+ for (i = 0; i < MAX_SPS_COUNT; i++) {
+ SPS *sps = ctx->h264ctx.sps_buffers[i];
+ if (sps && (sps->bit_depth_luma != 8 ||
+ sps->chroma_format_idc == 2 ||
+ sps->chroma_format_idc == 3)) {
+ av_log(avctx, AV_LOG_ERROR, "Format is not supported.\n");
+ goto failed;
+ }
+ }
+
return 0;
failed:
diff --git a/chromium/third_party/ffmpeg/libavcodec/vda_internal.h b/chromium/third_party/ffmpeg/libavcodec/vda_internal.h
new file mode 100644
index 00000000000..457916b0588
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/vda_internal.h
@@ -0,0 +1,33 @@
+/*
+ * 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_VDA_INTERNAL_H
+#define AVCODEC_VDA_INTERNAL_H
+
+#include "vda.h"
+
+void ff_vda_output_callback(void *vda_hw_ctx,
+ CFDictionaryRef user_info,
+ OSStatus status,
+ uint32_t infoFlags,
+ CVImageBufferRef image_buffer);
+
+int ff_vda_default_init(AVCodecContext *avctx);
+void ff_vda_default_free(AVCodecContext *avctx);
+
+#endif /* AVCODEC_VDA_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau.c b/chromium/third_party/ffmpeg/libavcodec/vdpau.c
index 32a3843e9bd..0dc5355262f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau.c
@@ -45,12 +45,10 @@ AVVDPAUContext *av_alloc_vdpaucontext(void)
MAKE_ACCESSORS(AVVDPAUContext, vdpau_hwaccel, AVVDPAU_Render2, render2)
-int ff_vdpau_common_start_frame(Picture *pic,
+int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx,
av_unused const uint8_t *buffer,
av_unused uint32_t size)
{
- struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-
pic_ctx->bitstream_buffers_allocated = 0;
pic_ctx->bitstream_buffers_used = 0;
pic_ctx->bitstream_buffers = NULL;
@@ -67,10 +65,19 @@ int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
MpegEncContext *s = avctx->priv_data;
Picture *pic = s->current_picture_ptr;
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
- VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);
+ VdpVideoSurface surf = ff_vdpau_get_surface_id(pic->f);
+
+#if FF_API_BUFS_VDPAU
+FF_DISABLE_DEPRECATION_WARNINGS
+ hwctx->info = pic_ctx->info;
+ hwctx->bitstream_buffers = pic_ctx->bitstream_buffers;
+ hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used;
+ hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
if (!hwctx->render) {
- res = hwctx->render2(avctx, &pic->f, (void *)&pic_ctx->info,
+ res = hwctx->render2(avctx, pic->f, (void *)&pic_ctx->info,
pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
} else
hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info,
@@ -79,13 +86,21 @@ int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
av_freep(&pic_ctx->bitstream_buffers);
+#if FF_API_BUFS_VDPAU
+FF_DISABLE_DEPRECATION_WARNINGS
+ hwctx->bitstream_buffers = NULL;
+ hwctx->bitstream_buffers_used = 0;
+ hwctx->bitstream_buffers_allocated = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
return res;
}
#endif
-int ff_vdpau_add_buffer(Picture *pic, const uint8_t *buf, uint32_t size)
+int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx,
+ const uint8_t *buf, uint32_t size)
{
- struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
VdpBitstreamBuffer *buffers = pic_ctx->bitstream_buffers;
buffers = av_fast_realloc(buffers, &pic_ctx->bitstream_buffers_allocated,
@@ -108,7 +123,7 @@ void ff_vdpau_h264_set_reference_frames(H264Context *h)
{
struct vdpau_render_state *render, *render_ref;
VdpReferenceFrameH264 *rf, *rf2;
- Picture *pic;
+ H264Picture *pic;
int i, list, pic_frame_idx;
render = (struct vdpau_render_state *)h->cur_pic_ptr->f.data[0];
@@ -118,7 +133,7 @@ void ff_vdpau_h264_set_reference_frames(H264Context *h)
#define H264_RF_COUNT FF_ARRAY_ELEMS(render->info.h264.referenceFrames)
for (list = 0; list < 2; ++list) {
- Picture **lp = list ? h->long_ref : h->short_ref;
+ H264Picture **lp = list ? h->long_ref : h->short_ref;
int ls = list ? 16 : h->short_ref_count;
for (i = 0; i < ls; ++i) {
@@ -261,7 +276,7 @@ void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf,
if (!s->current_picture_ptr) return;
- render = (struct vdpau_render_state *)s->current_picture_ptr->f.data[0];
+ render = (struct vdpau_render_state *)s->current_picture_ptr->f->data[0];
assert(render);
/* fill VdpPictureInfoMPEG1Or2 struct */
@@ -290,18 +305,18 @@ void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf,
switch(s->pict_type){
case AV_PICTURE_TYPE_B:
- next = (struct vdpau_render_state *)s->next_picture.f.data[0];
+ next = (struct vdpau_render_state *)s->next_picture.f->data[0];
assert(next);
render->info.mpeg.backward_reference = next->surface;
// no return here, going to set forward prediction
case AV_PICTURE_TYPE_P:
- last = (struct vdpau_render_state *)s->last_picture.f.data[0];
+ last = (struct vdpau_render_state *)s->last_picture.f->data[0];
if (!last) // FIXME: Does this test make sense?
last = render; // predict second field from the first
render->info.mpeg.forward_reference = last->surface;
}
- ff_vdpau_add_data_chunk(s->current_picture_ptr->f.data[0], buf, buf_size);
+ ff_vdpau_add_data_chunk(s->current_picture_ptr->f->data[0], buf, buf_size);
render->info.mpeg.slice_count = slice_count;
@@ -318,7 +333,7 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
VC1Context *v = s->avctx->priv_data;
struct vdpau_render_state *render, *last, *next;
- render = (struct vdpau_render_state *)s->current_picture.f.data[0];
+ render = (struct vdpau_render_state *)s->current_picture.f->data[0];
assert(render);
/* fill LvPictureInfoVC1 struct */
@@ -362,18 +377,18 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
switch(s->pict_type){
case AV_PICTURE_TYPE_B:
- next = (struct vdpau_render_state *)s->next_picture.f.data[0];
+ next = (struct vdpau_render_state *)s->next_picture.f->data[0];
assert(next);
render->info.vc1.backward_reference = next->surface;
// no break here, going to set forward prediction
case AV_PICTURE_TYPE_P:
- last = (struct vdpau_render_state *)s->last_picture.f.data[0];
+ last = (struct vdpau_render_state *)s->last_picture.f->data[0];
if (!last) // FIXME: Does this test make sense?
last = render; // predict second field from the first
render->info.vc1.forward_reference = last->surface;
}
- ff_vdpau_add_data_chunk(s->current_picture_ptr->f.data[0], buf, buf_size);
+ ff_vdpau_add_data_chunk(s->current_picture_ptr->f->data[0], buf, buf_size);
render->info.vc1.slice_count = 1;
@@ -392,7 +407,7 @@ void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *ctx, const uint8_t *buf,
if (!s->current_picture_ptr) return;
- render = (struct vdpau_render_state *)s->current_picture_ptr->f.data[0];
+ render = (struct vdpau_render_state *)s->current_picture_ptr->f->data[0];
assert(render);
/* fill VdpPictureInfoMPEG4Part2 struct */
@@ -421,18 +436,18 @@ void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *ctx, const uint8_t *buf,
switch (s->pict_type) {
case AV_PICTURE_TYPE_B:
- next = (struct vdpau_render_state *)s->next_picture.f.data[0];
+ next = (struct vdpau_render_state *)s->next_picture.f->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 AV_PICTURE_TYPE_P:
- last = (struct vdpau_render_state *)s->last_picture.f.data[0];
+ last = (struct vdpau_render_state *)s->last_picture.f->data[0];
assert(last);
render->info.mpeg4.forward_reference = last->surface;
}
- ff_vdpau_add_data_chunk(s->current_picture_ptr->f.data[0], buf, buf_size);
+ ff_vdpau_add_data_chunk(s->current_picture_ptr->f->data[0], buf, buf_size);
ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
render->bitstream_buffers_used = 0;
@@ -463,7 +478,7 @@ do { \
default: return AVERROR(EINVAL);
}
case AV_CODEC_ID_H264:
- switch (avctx->profile) {
+ switch (avctx->profile & ~FF_PROFILE_H264_INTRA) {
case FF_PROFILE_H264_CONSTRAINED_BASELINE:
case FF_PROFILE_H264_BASELINE: PROFILE(VDP_DECODER_PROFILE_H264_BASELINE);
case FF_PROFILE_H264_MAIN: PROFILE(VDP_DECODER_PROFILE_H264_MAIN);
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau_h264.c b/chromium/third_party/ffmpeg/libavcodec/vdpau_h264.c
index 3f6415d4f85..05a41d04026 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau_h264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau_h264.c
@@ -25,6 +25,7 @@
#include "avcodec.h"
#include "h264.h"
+#include "mpegutils.h"
#include "vdpau.h"
#include "vdpau_internal.h"
@@ -46,10 +47,10 @@ static void vdpau_h264_clear_rf(VdpReferenceFrameH264 *rf)
rf->frame_idx = 0;
}
-static void vdpau_h264_set_rf(VdpReferenceFrameH264 *rf, Picture *pic,
+static void vdpau_h264_set_rf(VdpReferenceFrameH264 *rf, H264Picture *pic,
int pic_structure)
{
- VdpVideoSurface surface = ff_vdpau_get_surface_id(pic);
+ VdpVideoSurface surface = ff_vdpau_get_surface_id(&pic->f);
if (pic_structure == 0)
pic_structure = pic->reference;
@@ -74,11 +75,11 @@ static void vdpau_h264_set_reference_frames(AVCodecContext *avctx)
#define H264_RF_COUNT FF_ARRAY_ELEMS(info->referenceFrames)
for (list = 0; list < 2; ++list) {
- Picture **lp = list ? h->long_ref : h->short_ref;
+ H264Picture **lp = list ? h->long_ref : h->short_ref;
int i, ls = list ? 16 : h->short_ref_count;
for (i = 0; i < ls; ++i) {
- Picture *pic = lp[i];
+ H264Picture *pic = lp[i];
VdpReferenceFrameH264 *rf2;
VdpVideoSurface surface_ref;
int pic_frame_idx;
@@ -86,7 +87,7 @@ static void vdpau_h264_set_reference_frames(AVCodecContext *avctx)
if (!pic || !pic->reference)
continue;
pic_frame_idx = pic->long_ref ? pic->pic_id : pic->frame_num;
- surface_ref = ff_vdpau_get_surface_id(pic);
+ surface_ref = ff_vdpau_get_surface_id(&pic->f);
rf2 = &info->referenceFrames[0];
while (rf2 != rf) {
@@ -118,7 +119,7 @@ static int vdpau_h264_start_frame(AVCodecContext *avctx,
const uint8_t *buffer, uint32_t size)
{
H264Context * const h = avctx->priv_data;
- Picture *pic = h->cur_pic_ptr;
+ H264Picture *pic = h->cur_pic_ptr;
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
VdpPictureInfoH264 *info = &pic_ctx->info.h264;
@@ -161,7 +162,7 @@ static int vdpau_h264_start_frame(AVCodecContext *avctx,
vdpau_h264_set_reference_frames(avctx);
- return ff_vdpau_common_start_frame(pic, buffer, size);
+ return ff_vdpau_common_start_frame(pic_ctx, buffer, size);
}
static const uint8_t start_code_prefix[3] = { 0x00, 0x00, 0x01 };
@@ -170,15 +171,15 @@ static int vdpau_h264_decode_slice(AVCodecContext *avctx,
const uint8_t *buffer, uint32_t size)
{
H264Context *h = avctx->priv_data;
- Picture *pic = h->cur_pic_ptr;
+ H264Picture *pic = h->cur_pic_ptr;
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
int val;
- val = ff_vdpau_add_buffer(pic, start_code_prefix, 3);
+ val = ff_vdpau_add_buffer(pic_ctx, start_code_prefix, 3);
if (val)
return val;
- val = ff_vdpau_add_buffer(pic, buffer, size);
+ val = ff_vdpau_add_buffer(pic_ctx, buffer, size);
if (val)
return val;
@@ -191,9 +192,18 @@ static int vdpau_h264_end_frame(AVCodecContext *avctx)
int res = 0;
AVVDPAUContext *hwctx = avctx->hwaccel_context;
H264Context *h = avctx->priv_data;
- Picture *pic = h->cur_pic_ptr;
+ H264Picture *pic = h->cur_pic_ptr;
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
- VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);
+ VdpVideoSurface surf = ff_vdpau_get_surface_id(&pic->f);
+
+#if FF_API_BUFS_VDPAU
+FF_DISABLE_DEPRECATION_WARNINGS
+ hwctx->info = pic_ctx->info;
+ hwctx->bitstream_buffers = pic_ctx->bitstream_buffers;
+ hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used;
+ hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
if (!hwctx->render) {
res = hwctx->render2(avctx, &pic->f, (void *)&pic_ctx->info,
@@ -205,6 +215,14 @@ static int vdpau_h264_end_frame(AVCodecContext *avctx)
ff_h264_draw_horiz_band(h, 0, h->avctx->height);
av_freep(&pic_ctx->bitstream_buffers);
+#if FF_API_BUFS_VDPAU
+FF_DISABLE_DEPRECATION_WARNINGS
+ hwctx->bitstream_buffers = NULL;
+ hwctx->bitstream_buffers_used = 0;
+ hwctx->bitstream_buffers_allocated = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
return res;
}
@@ -216,5 +234,5 @@ AVHWAccel ff_h264_vdpau_hwaccel = {
.start_frame = vdpau_h264_start_frame,
.end_frame = vdpau_h264_end_frame,
.decode_slice = vdpau_h264_decode_slice,
- .priv_data_size = sizeof(struct vdpau_picture_context),
+ .frame_priv_data_size = sizeof(struct vdpau_picture_context),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h b/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h
index cc634111b44..a7319ed77e7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h
@@ -36,10 +36,10 @@
#include "mpegvideo.h"
#include "version.h"
-/** Extract VdpVideoSurface from a Picture */
-static inline uintptr_t ff_vdpau_get_surface_id(Picture *pic)
+/** Extract VdpVideoSurface from an AVFrame */
+static inline uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
{
- return (uintptr_t)pic->f.data[3];
+ return (uintptr_t)pic->data[3];
}
#if CONFIG_VDPAU
@@ -75,12 +75,15 @@ struct vdpau_picture_context {
*/
VdpBitstreamBuffer *bitstream_buffers;
};
+#else
+struct vdpau_picture_context;
#endif
-int ff_vdpau_common_start_frame(Picture *pic,
+int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic,
const uint8_t *buffer, uint32_t size);
int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx);
-int ff_vdpau_add_buffer(Picture *pic, const uint8_t *buf, uint32_t buf_size);
+int ff_vdpau_add_buffer(struct vdpau_picture_context *pic, const uint8_t *buf,
+ uint32_t buf_size);
void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf,
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c b/chromium/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c
index f21b34152b6..84a971c5b17 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c
@@ -43,12 +43,12 @@ static int vdpau_mpeg_start_frame(AVCodecContext *avctx,
switch (s->pict_type) {
case AV_PICTURE_TYPE_B:
- ref = ff_vdpau_get_surface_id(&s->next_picture);
+ ref = ff_vdpau_get_surface_id(s->next_picture.f);
assert(ref != VDP_INVALID_HANDLE);
info->backward_reference = ref;
/* fall through to forward prediction */
case AV_PICTURE_TYPE_P:
- ref = ff_vdpau_get_surface_id(&s->last_picture);
+ ref = ff_vdpau_get_surface_id(s->last_picture.f);
info->forward_reference = ref;
}
@@ -75,7 +75,7 @@ static int vdpau_mpeg_start_frame(AVCodecContext *avctx,
info->non_intra_quantizer_matrix[i] = s->inter_matrix[i];
}
- return ff_vdpau_common_start_frame(pic, buffer, size);
+ return ff_vdpau_common_start_frame(pic_ctx, buffer, size);
}
static int vdpau_mpeg_decode_slice(AVCodecContext *avctx,
@@ -86,7 +86,7 @@ static int vdpau_mpeg_decode_slice(AVCodecContext *avctx,
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
int val;
- val = ff_vdpau_add_buffer(pic, buffer, size);
+ val = ff_vdpau_add_buffer(pic_ctx, buffer, size);
if (val < 0)
return val;
@@ -103,7 +103,7 @@ AVHWAccel ff_mpeg1_vdpau_hwaccel = {
.start_frame = vdpau_mpeg_start_frame,
.end_frame = ff_vdpau_mpeg_end_frame,
.decode_slice = vdpau_mpeg_decode_slice,
- .priv_data_size = sizeof(struct vdpau_picture_context),
+ .frame_priv_data_size = sizeof(struct vdpau_picture_context),
};
#endif
@@ -116,6 +116,6 @@ AVHWAccel ff_mpeg2_vdpau_hwaccel = {
.start_frame = vdpau_mpeg_start_frame,
.end_frame = ff_vdpau_mpeg_end_frame,
.decode_slice = vdpau_mpeg_decode_slice,
- .priv_data_size = sizeof(struct vdpau_picture_context),
+ .frame_priv_data_size = sizeof(struct vdpau_picture_context),
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c b/chromium/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c
index 282796eafad..64669a6e0f1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c
@@ -46,13 +46,13 @@ static int vdpau_mpeg4_start_frame(AVCodecContext *avctx,
switch (s->pict_type) {
case AV_PICTURE_TYPE_B:
- ref = ff_vdpau_get_surface_id(&s->next_picture);
+ ref = ff_vdpau_get_surface_id(s->next_picture.f);
assert(ref != VDP_INVALID_HANDLE);
info->backward_reference = ref;
info->vop_coding_type = 2;
/* fall-through */
case AV_PICTURE_TYPE_P:
- ref = ff_vdpau_get_surface_id(&s->last_picture);
+ ref = ff_vdpau_get_surface_id(s->last_picture.f);
assert(ref != VDP_INVALID_HANDLE);
info->forward_reference = ref;
}
@@ -77,8 +77,8 @@ static int vdpau_mpeg4_start_frame(AVCodecContext *avctx,
info->non_intra_quantizer_matrix[i] = s->inter_matrix[i];
}
- ff_vdpau_common_start_frame(pic, buffer, size);
- return ff_vdpau_add_buffer(pic, buffer, size);
+ ff_vdpau_common_start_frame(pic_ctx, buffer, size);
+ return ff_vdpau_add_buffer(pic_ctx, buffer, size);
}
static int vdpau_mpeg4_decode_slice(av_unused AVCodecContext *avctx,
@@ -97,7 +97,7 @@ AVHWAccel ff_h263_vdpau_hwaccel = {
.start_frame = vdpau_mpeg4_start_frame,
.end_frame = ff_vdpau_mpeg_end_frame,
.decode_slice = vdpau_mpeg4_decode_slice,
- .priv_data_size = sizeof(struct vdpau_picture_context),
+ .frame_priv_data_size = sizeof(struct vdpau_picture_context),
};
#endif
@@ -110,6 +110,6 @@ AVHWAccel ff_mpeg4_vdpau_hwaccel = {
.start_frame = vdpau_mpeg4_start_frame,
.end_frame = ff_vdpau_mpeg_end_frame,
.decode_slice = vdpau_mpeg4_decode_slice,
- .priv_data_size = sizeof(struct vdpau_picture_context),
+ .frame_priv_data_size = sizeof(struct vdpau_picture_context),
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau_vc1.c b/chromium/third_party/ffmpeg/libavcodec/vdpau_vc1.c
index c655529aaff..13c41df66ad 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau_vc1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau_vc1.c
@@ -45,14 +45,14 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx,
switch (s->pict_type) {
case AV_PICTURE_TYPE_B:
if (s->next_picture_ptr) {
- ref = ff_vdpau_get_surface_id(&s->next_picture);
+ ref = ff_vdpau_get_surface_id(s->next_picture.f);
assert(ref != VDP_INVALID_HANDLE);
info->backward_reference = ref;
}
/* fall-through */
case AV_PICTURE_TYPE_P:
if (s->last_picture_ptr) {
- ref = ff_vdpau_get_surface_id(&s->last_picture);
+ ref = ff_vdpau_get_surface_id(s->last_picture.f);
assert(ref != VDP_INVALID_HANDLE);
info->forward_reference = ref;
}
@@ -93,7 +93,7 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx,
info->deblockEnable = v->postprocflag & 1;
info->pquant = v->pq;
- return ff_vdpau_common_start_frame(pic, buffer, size);
+ return ff_vdpau_common_start_frame(pic_ctx, buffer, size);
}
static int vdpau_vc1_decode_slice(AVCodecContext *avctx,
@@ -105,7 +105,7 @@ static int vdpau_vc1_decode_slice(AVCodecContext *avctx,
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
int val;
- val = ff_vdpau_add_buffer(pic, buffer, size);
+ val = ff_vdpau_add_buffer(pic_ctx, buffer, size);
if (val < 0)
return val;
@@ -122,7 +122,7 @@ AVHWAccel ff_wmv3_vdpau_hwaccel = {
.start_frame = vdpau_vc1_start_frame,
.end_frame = ff_vdpau_mpeg_end_frame,
.decode_slice = vdpau_vc1_decode_slice,
- .priv_data_size = sizeof(struct vdpau_picture_context),
+ .frame_priv_data_size = sizeof(struct vdpau_picture_context),
};
#endif
@@ -134,5 +134,5 @@ AVHWAccel ff_vc1_vdpau_hwaccel = {
.start_frame = vdpau_vc1_start_frame,
.end_frame = ff_vdpau_mpeg_end_frame,
.decode_slice = vdpau_vc1_decode_slice,
- .priv_data_size = sizeof(struct vdpau_picture_context),
+ .frame_priv_data_size = sizeof(struct vdpau_picture_context),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/version.h b/chromium/third_party/ffmpeg/libavcodec/version.h
index eab162284ca..680c0603256 100644
--- a/chromium/third_party/ffmpeg/libavcodec/version.h
+++ b/chromium/third_party/ffmpeg/libavcodec/version.h
@@ -26,10 +26,10 @@
* Libavcodec version macros.
*/
-#include "libavutil/avutil.h"
+#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 55
-#define LIBAVCODEC_VERSION_MINOR 45
+#define LIBAVCODEC_VERSION_MINOR 62
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -138,5 +138,29 @@
#ifndef FF_API_NEG_LINESIZES
#define FF_API_NEG_LINESIZES (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
+#ifndef FF_API_EMU_EDGE
+#define FF_API_EMU_EDGE (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_ARCH_SH4
+#define FF_API_ARCH_SH4 (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_ARCH_SPARC
+#define FF_API_ARCH_SPARC (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_INPUT_PRESERVED
+#define FF_API_INPUT_PRESERVED (LIBAVCODEC_VERSION_MAJOR < 57)
+#endif
+#ifndef FF_API_NORMALIZE_AQP
+#define FF_API_NORMALIZE_AQP (LIBAVCODEC_VERSION_MAJOR < 57)
+#endif
+#ifndef FF_API_GMC
+#define FF_API_GMC (LIBAVCODEC_VERSION_MAJOR < 57)
+#endif
+#ifndef FF_API_MV0
+#define FF_API_MV0 (LIBAVCODEC_VERSION_MAJOR < 57)
+#endif
+#ifndef FF_API_CODEC_NAME
+#define FF_API_CODEC_NAME (LIBAVCODEC_VERSION_MAJOR < 57)
+#endif
#endif /* AVCODEC_VERSION_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/videodsp.c b/chromium/third_party/ffmpeg/libavcodec/videodsp.c
index 13e4a7b4b14..ba618a7bbc6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/videodsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/videodsp.c
@@ -44,6 +44,8 @@ av_cold void ff_videodsp_init(VideoDSPContext *ctx, int bpc)
ctx->emulated_edge_mc = ff_emulated_edge_mc_16;
}
+ if (ARCH_AARCH64)
+ ff_videodsp_init_aarch64(ctx, bpc);
if (ARCH_ARM)
ff_videodsp_init_arm(ctx, bpc);
if (ARCH_PPC)
diff --git a/chromium/third_party/ffmpeg/libavcodec/videodsp.h b/chromium/third_party/ffmpeg/libavcodec/videodsp.h
index 0bb15f2c942..fc01a31dcac 100644
--- a/chromium/third_party/ffmpeg/libavcodec/videodsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/videodsp.h
@@ -79,6 +79,7 @@ typedef struct VideoDSPContext {
void ff_videodsp_init(VideoDSPContext *ctx, int bpc);
/* for internal use only (i.e. called by ff_videodsp_init() */
+void ff_videodsp_init_aarch64(VideoDSPContext *ctx, int bpc);
void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc);
void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc);
void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc);
diff --git a/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c b/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c
index c569c30d607..f4ff2ba6469 100644
--- a/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <assert.h>
+
#include "bit_depth_template.c"
void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
ptrdiff_t buf_linesize,
diff --git a/chromium/third_party/ffmpeg/libavcodec/vima.c b/chromium/third_party/ffmpeg/libavcodec/vima.c
index f040e1b16b5..ba3f07aad6f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vima.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vima.c
@@ -26,16 +26,16 @@
*/
#include "libavutil/channel_layout.h"
+
+#include "adpcm_data.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
-#include "adpcm_data.h"
static int predict_table_init = 0;
static uint16_t predict_table[5786 * 2];
-static const uint8_t size_table[] =
-{
+static const uint8_t size_table[] = {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
@@ -44,64 +44,42 @@ static const uint8_t size_table[] =
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
};
-static const int8_t index_table1[] =
-{
+static const int8_t index_table1[] = {
-1, 4, -1, 4
};
-static const int8_t index_table2[] =
-{
+static const int8_t index_table2[] = {
-1, -1, 2, 6, -1, -1, 2, 6
};
-static const int8_t index_table3[] =
-{
- -1, -1, -1, -1, 1, 2, 4, 6,
- -1, -1, -1, -1, 1, 2, 4, 6
+static const int8_t index_table3[] = {
+ -1, -1, -1, -1, 1, 2, 4, 6, -1, -1, -1, -1, 1, 2, 4, 6
};
-static const int8_t index_table4[] =
-{
- -1, -1, -1, -1, -1, -1, -1, -1,
- 1, 1, 1, 2, 2, 4, 5, 6,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 1, 1, 1, 2, 2, 4, 5, 6
+static const int8_t index_table4[] = {
+ -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 2, 2, 4, 5, 6,
+ -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 2, 2, 4, 5, 6
};
-static const int8_t index_table5[] =
-{
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 1, 1, 1, 1, 1, 2, 2, 2,
- 2, 4, 4, 4, 5, 5, 6, 6,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 1, 1, 1, 1, 1, 2, 2, 2,
- 2, 4, 4, 4, 5, 5, 6, 6
+static const int8_t index_table5[] = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 5, 5, 6, 6,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 5, 5, 6, 6
};
-static const int8_t index_table6[] =
-{
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 2, 2, 2, 2, 2,
- 2, 2, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 6, 6, 6, 6,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 2, 2, 2, 2, 2,
- 2, 2, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 6, 6, 6, 6
+static const int8_t index_table6[] = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
+ 2, 2, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
+ 2, 2, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6
};
-static const int8_t* const step_index_tables[] =
-{
+static const int8_t *const step_index_tables[] = {
index_table1, index_table2, index_table3,
index_table4, index_table5, index_table6
};
@@ -140,12 +118,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *pkt)
{
- GetBitContext gb;
- AVFrame *frame = data;
- int16_t pcm_data[2];
- uint32_t samples;
- int8_t channel_hint[2];
- int ret, chan, channels = 1;
+ GetBitContext gb;
+ AVFrame *frame = data;
+ int16_t pcm_data[2];
+ uint32_t samples;
+ int8_t channel_hint[2];
+ int ret, chan;
+ int channels = 1;
if (pkt->size < 13)
return AVERROR_INVALIDDATA;
@@ -168,12 +147,12 @@ static int decode_frame(AVCodecContext *avctx, void *data,
channels = 2;
}
avctx->channels = channels;
- avctx->channel_layout = (channels == 2) ? AV_CH_LAYOUT_STEREO :
- AV_CH_LAYOUT_MONO;
+ avctx->channel_layout = (channels == 2) ? AV_CH_LAYOUT_STEREO
+ : AV_CH_LAYOUT_MONO;
pcm_data[0] = get_sbits(&gb, 16);
if (channels > 1) {
channel_hint[1] = get_sbits(&gb, 8);
- pcm_data[1] = get_sbits(&gb, 16);
+ pcm_data[1] = get_sbits(&gb, 16);
}
frame->nb_samples = samples;
@@ -181,7 +160,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return ret;
for (chan = 0; chan < channels; chan++) {
- uint16_t *dest = (uint16_t*)frame->data[0] + chan;
+ uint16_t *dest = (uint16_t *)frame->data[0] + chan;
int step_index = channel_hint[chan];
int output = pcm_data[chan];
int sample;
@@ -211,9 +190,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
if (lookup)
diff += ff_adpcm_step_table[step_index] >> (lookup_size - 1);
if (highbit)
- diff = -diff;
+ diff = -diff;
- output = av_clip_int16(output + diff);
+ output = av_clip_int16(output + diff);
}
*dest = output;
@@ -223,17 +202,27 @@ static int decode_frame(AVCodecContext *avctx, void *data,
}
}
- *got_frame_ptr = 1;
+ *got_frame_ptr = 1;
return pkt->size;
}
+AVCodec ff_adpcm_vima_decoder = {
+ .name = "adpcm_vima",
+ .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_ADPCM_VIMA,
+ .init = decode_init,
+ .decode = decode_frame,
+ .capabilities = CODEC_CAP_DR1,
+};
+
AVCodec ff_vima_decoder = {
- .name = "vima",
- .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_VIMA,
- .init = decode_init,
- .decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .name = "vima",
+ .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_ADPCM_VIMA,
+ .init = decode_init,
+ .decode = decode_frame,
+ .capabilities = CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vmdav.c b/chromium/third_party/ffmpeg/libavcodec/vmdav.c
index e67377acce2..c1fb80b97d9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vmdav.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vmdav.c
@@ -76,7 +76,7 @@ typedef struct VmdVideoContext {
#define QUEUE_SIZE 0x1000
#define QUEUE_MASK 0x0FFF
-static void lz_unpack(const unsigned char *src, int src_len,
+static int lz_unpack(const unsigned char *src, int src_len,
unsigned char *dest, int dest_len)
{
unsigned char *d;
@@ -97,7 +97,7 @@ static void lz_unpack(const unsigned char *src, int src_len,
dataleft = bytestream2_get_le32(&gb);
memset(queue, 0x20, QUEUE_SIZE);
if (bytestream2_get_bytes_left(&gb) < 4)
- return;
+ return AVERROR_INVALIDDATA;
if (bytestream2_peek_le32(&gb) == 0x56781234) {
bytestream2_skipu(&gb, 4);
qpos = 0x111;
@@ -111,7 +111,7 @@ static void lz_unpack(const unsigned char *src, int src_len,
tag = bytestream2_get_byteu(&gb);
if ((tag == 0xFF) && (dataleft > 8)) {
if (d_end - d < 8 || bytestream2_get_bytes_left(&gb) < 8)
- return;
+ return AVERROR_INVALIDDATA;
for (i = 0; i < 8; i++) {
queue[qpos++] = *d++ = bytestream2_get_byteu(&gb);
qpos &= QUEUE_MASK;
@@ -123,7 +123,7 @@ static void lz_unpack(const unsigned char *src, int src_len,
break;
if (tag & 0x01) {
if (d_end - d < 1 || bytestream2_get_bytes_left(&gb) < 1)
- return;
+ return AVERROR_INVALIDDATA;
queue[qpos++] = *d++ = bytestream2_get_byteu(&gb);
qpos &= QUEUE_MASK;
dataleft--;
@@ -135,7 +135,7 @@ static void lz_unpack(const unsigned char *src, int src_len,
chainlen = bytestream2_get_byte(&gb) + 0xF + 3;
}
if (d_end - d < chainlen)
- return;
+ return AVERROR_INVALIDDATA;
for (j = 0; j < chainlen; j++) {
*d = queue[chainofs++ & QUEUE_MASK];
queue[qpos++] = *d++;
@@ -147,6 +147,7 @@ static void lz_unpack(const unsigned char *src, int src_len,
}
}
}
+ return d - dest;
}
static int rle_unpack(const unsigned char *src, unsigned char *dest,
int src_count, int src_size, int dest_len)
@@ -279,15 +280,18 @@ static int vmd_decode(VmdVideoContext *s, AVFrame *frame)
return AVERROR_INVALIDDATA;
meth = bytestream2_get_byteu(&gb);
if (meth & 0x80) {
+ int size;
if (!s->unpack_buffer_size) {
av_log(s->avctx, AV_LOG_ERROR,
"Trying to unpack LZ-compressed frame with no LZ buffer\n");
return AVERROR_INVALIDDATA;
}
- lz_unpack(gb.buffer, bytestream2_get_bytes_left(&gb),
- s->unpack_buffer, s->unpack_buffer_size);
+ size = lz_unpack(gb.buffer, bytestream2_get_bytes_left(&gb),
+ s->unpack_buffer, s->unpack_buffer_size);
+ if (size < 0)
+ return size;
meth &= 0x7F;
- bytestream2_init(&gb, s->unpack_buffer, s->unpack_buffer_size);
+ bytestream2_init(&gb, s->unpack_buffer, size);
}
dp = &frame->data[0][frame_y * frame->linesize[0] + frame_x];
diff --git a/chromium/third_party/ffmpeg/libavcodec/vmnc.c b/chromium/third_party/ffmpeg/libavcodec/vmnc.c
index 5f91ab1b319..46bd52ee267 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vmnc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vmnc.c
@@ -291,6 +291,11 @@ static int decode_hextile(VmncContext *c, uint8_t* dst, GetByteContext *gb,
fg = vmnc_get_pixel(gb, bpp, c->bigendian);
xy = bytestream2_get_byte(gb);
wh = bytestream2_get_byte(gb);
+ if ( (xy >> 4) + (wh >> 4) + 1 > w - i
+ || (xy & 0xF) + (wh & 0xF)+1 > h - j) {
+ av_log(c->avctx, AV_LOG_ERROR, "Rectangle outside picture\n");
+ return AVERROR_INVALIDDATA;
+ }
paint_rect(dst2, xy >> 4, xy & 0xF,
(wh>>4)+1, (wh & 0xF)+1, fg, bpp, stride);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vorbis.c b/chromium/third_party/ffmpeg/libavcodec/vorbis.c
index 6eb765d7d0f..86d10407f4a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vorbis.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vorbis.c
@@ -71,7 +71,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
codes[p] = 0;
if (bits[p] > 32)
- return 1;
+ return AVERROR_INVALIDDATA;
for (i = 0; i < bits[p]; ++i)
exit_at_level[i+1] = 1 << i;
@@ -85,9 +85,14 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
++p;
+ for (i = p; (bits[i] == 0) && (i < num); ++i)
+ ;
+ if (i == num)
+ return 0;
+
for (; p < num; ++p) {
if (bits[p] > 32)
- return 1;
+ return AVERROR_INVALIDDATA;
if (bits[p] == 0)
continue;
// find corresponding exit(node which the tree can grow further from)
@@ -95,7 +100,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
if (exit_at_level[i])
break;
if (!i) // overspecified tree
- return 1;
+ return AVERROR_INVALIDDATA;
code = exit_at_level[i];
exit_at_level[i] = 0;
// construct code (append 0s to end) and introduce new exits
@@ -116,7 +121,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
//no exits should be left (underspecified tree - ie. unused valid vlcs - not allowed by SPEC)
for (p = 1; p < 33; p++)
if (exit_at_level[p])
- return 1;
+ return AVERROR_INVALIDDATA;
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vorbisdec.c b/chromium/third_party/ffmpeg/libavcodec/vorbisdec.c
index a2f7dd27f8e..87d1bbb97a3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vorbisdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vorbisdec.c
@@ -151,7 +151,7 @@ typedef struct vorbis_context_s {
uint8_t mode_count;
vorbis_mode *modes;
uint8_t mode_number; // mode number for the current packet
- uint8_t previous_window;
+ int8_t previous_window;
float *channel_residues;
float *saved;
} vorbis_context;
@@ -378,7 +378,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
}
// Weed out unused vlcs and build codevector vector
- codebook_setup->codevectors = used_entries ? av_mallocz(used_entries *
+ codebook_setup->codevectors = used_entries ? av_mallocz_array(used_entries,
codebook_setup->dimensions *
sizeof(*codebook_setup->codevectors))
: NULL;
@@ -561,7 +561,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
for (j = 0; j < floor_setup->data.t1.partitions; ++j)
floor_setup->data.t1.x_list_dim+=floor_setup->data.t1.class_dimensions[floor_setup->data.t1.partition_class[j]];
- floor_setup->data.t1.list = av_mallocz(floor_setup->data.t1.x_list_dim *
+ floor_setup->data.t1.list = av_mallocz_array(floor_setup->data.t1.x_list_dim,
sizeof(*floor_setup->data.t1.list));
if (!floor_setup->data.t1.list)
return AVERROR(ENOMEM);
@@ -640,8 +640,8 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
/* codebook dim is for padding if codebook dim doesn't *
* divide order+1 then we need to read more data */
floor_setup->data.t0.lsp =
- av_malloc((floor_setup->data.t0.order + 1 + max_codebook_dim)
- * sizeof(*floor_setup->data.t0.lsp));
+ av_malloc_array((floor_setup->data.t0.order + 1 + max_codebook_dim),
+ sizeof(*floor_setup->data.t0.lsp));
if (!floor_setup->data.t0.lsp)
return AVERROR(ENOMEM);
@@ -701,8 +701,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
res_setup->partition_size = get_bits(gb, 24) + 1;
/* Validations to prevent a buffer overflow later. */
if (res_setup->begin>res_setup->end ||
- res_setup->end > (res_setup->type == 2 ? vc->audio_channels : 1) * vc->blocksize[1] / 2 ||
- (res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
+ (res_setup->end-res_setup->begin) / res_setup->partition_size > FFMIN(V_MAX_PARTITIONS, 65535)) {
av_log(vc->avctx, AV_LOG_ERROR,
"partition out of bounds: type, begin, end, size, blocksize: %"PRIu16", %"PRIu32", %"PRIu32", %u, %"PRIu32"\n",
res_setup->type, res_setup->begin, res_setup->end,
@@ -715,7 +714,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
res_setup->ptns_to_read =
(res_setup->end - res_setup->begin) / res_setup->partition_size;
- res_setup->classifs = av_malloc(res_setup->ptns_to_read *
+ res_setup->classifs = av_malloc_array(res_setup->ptns_to_read,
vc->audio_channels *
sizeof(*res_setup->classifs));
if (!res_setup->classifs)
@@ -808,7 +807,7 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
}
if (mapping_setup->submaps>1) {
- mapping_setup->mux = av_mallocz(vc->audio_channels *
+ mapping_setup->mux = av_mallocz_array(vc->audio_channels,
sizeof(*mapping_setup->mux));
if (!mapping_setup->mux)
return AVERROR(ENOMEM);
@@ -843,7 +842,7 @@ static int create_map(vorbis_context *vc, unsigned floor_number)
for (blockflag = 0; blockflag < 2; ++blockflag) {
n = vc->blocksize[blockflag] / 2;
floors[floor_number].data.t0.map[blockflag] =
- av_malloc((n + 1) * sizeof(int32_t)); // n + sentinel
+ av_malloc_array(n + 1, sizeof(int32_t)); // n + sentinel
if (!floors[floor_number].data.t0.map[blockflag])
return AVERROR(ENOMEM);
@@ -984,12 +983,12 @@ static int vorbis_parse_id_hdr(vorbis_context *vc)
return AVERROR_INVALIDDATA;
}
- vc->channel_residues = av_malloc((vc->blocksize[1] / 2) * vc->audio_channels * sizeof(*vc->channel_residues));
- vc->saved = av_mallocz((vc->blocksize[1] / 4) * vc->audio_channels * sizeof(*vc->saved));
+ vc->channel_residues = av_malloc_array(vc->blocksize[1] / 2, vc->audio_channels * sizeof(*vc->channel_residues));
+ vc->saved = av_mallocz_array(vc->blocksize[1] / 4, vc->audio_channels * sizeof(*vc->saved));
if (!vc->channel_residues || !vc->saved)
return AVERROR(ENOMEM);
- vc->previous_window = 0;
+ vc->previous_window = -1;
ff_mdct_init(&vc->mdct[0], bl0, 1, -1.0);
ff_mdct_init(&vc->mdct[1], bl1, 1, -1.0);
@@ -1372,6 +1371,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
unsigned pass, ch_used, i, j, k, l;
unsigned max_output = (ch - 1) * vlen;
int ptns_to_read = vr->ptns_to_read;
+ int libvorbis_bug = 0;
if (vr_type == 2) {
for (j = 1; j < ch; ++j)
@@ -1386,8 +1386,13 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
}
if (max_output > ch_left * vlen) {
- av_log(vc->avctx, AV_LOG_ERROR, "Insufficient output buffer\n");
- return AVERROR_INVALIDDATA;
+ if (max_output <= ch_left * vlen + vr->partition_size*ch_used/ch) {
+ ptns_to_read--;
+ libvorbis_bug = 1;
+ } else {
+ av_log(vc->avctx, AV_LOG_ERROR, "Insufficient output buffer\n");
+ return AVERROR_INVALIDDATA;
+ }
}
av_dlog(NULL, " residue type 0/1/2 decode begin, ch: %d cpc %d \n", ch, c_p_c);
@@ -1496,6 +1501,14 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
voffset += vr->partition_size;
}
}
+ if (libvorbis_bug && !pass) {
+ for (j = 0; j < ch_used; ++j) {
+ if (!do_not_decode[j]) {
+ get_vlc2(&vc->gb, vc->codebooks[vr->classbook].vlc.table,
+ vc->codebooks[vr->classbook].nb_bits, 3);
+ }
+ }
+ }
}
return 0;
}
@@ -1548,7 +1561,7 @@ static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr)
{
GetBitContext *gb = &vc->gb;
FFTContext *mdct;
- unsigned previous_window = vc->previous_window;
+ int previous_window = vc->previous_window;
unsigned mode_number, blockflag, blocksize;
int i, j;
uint8_t no_residue[255];
@@ -1581,9 +1594,11 @@ static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr)
blocksize = vc->blocksize[blockflag];
vlen = blocksize / 2;
if (blockflag) {
- previous_window = get_bits(gb, 1);
- skip_bits1(gb); // next_window
- }
+ int code = get_bits(gb, 2);
+ if (previous_window < 0)
+ previous_window = code>>1;
+ } else if (previous_window < 0)
+ previous_window = 0;
memset(ch_res_ptr, 0, sizeof(float) * vc->audio_channels * vlen); //FIXME can this be removed ?
for (i = 0; i < vc->audio_channels; ++i)
@@ -1812,7 +1827,8 @@ static av_cold void vorbis_decode_flush(AVCodecContext *avctx)
memset(vc->saved, 0, (vc->blocksize[1] / 4) * vc->audio_channels *
sizeof(*vc->saved));
}
- vc->previous_window = 0;
+ vc->previous_window = -1;
+ vc->first_frame = 0;
}
AVCodec ff_vorbis_decoder = {
diff --git a/chromium/third_party/ffmpeg/libavcodec/vorbisdsp.c b/chromium/third_party/ffmpeg/libavcodec/vorbisdsp.c
index 784375697eb..362a276296b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vorbisdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vorbisdsp.c
@@ -25,6 +25,8 @@ av_cold void ff_vorbisdsp_init(VorbisDSPContext *dsp)
{
dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling;
+ if (ARCH_AARCH64)
+ ff_vorbisdsp_init_aarch64(dsp);
if (ARCH_ARM)
ff_vorbisdsp_init_arm(dsp);
if (ARCH_PPC)
diff --git a/chromium/third_party/ffmpeg/libavcodec/vorbisdsp.h b/chromium/third_party/ffmpeg/libavcodec/vorbisdsp.h
index ed14049c8ce..7abec4e4b7b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vorbisdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vorbisdsp.h
@@ -30,6 +30,7 @@ typedef struct VorbisDSPContext {
void ff_vorbisdsp_init(VorbisDSPContext *dsp);
/* for internal use only */
+void ff_vorbisdsp_init_aarch64(VorbisDSPContext *dsp);
void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp);
void ff_vorbisdsp_init_arm(VorbisDSPContext *dsp);
void ff_vorbisdsp_init_ppc(VorbisDSPContext *dsp);
diff --git a/chromium/third_party/ffmpeg/libavcodec/vorbisenc.c b/chromium/third_party/ffmpeg/libavcodec/vorbisenc.c
index 9ef629681e3..fa6bccc1d0c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vorbisenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vorbisenc.c
@@ -25,9 +25,11 @@
*/
#include <float.h>
+
#include "avcodec.h"
#include "internal.h"
#include "fft.h"
+#include "mathops.h"
#include "vorbis.h"
#include "vorbis_enc_data.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp3.c b/chromium/third_party/ffmpeg/libavcodec/vp3.c
index 626642f4ad0..95b7994723c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp3.c
@@ -34,20 +34,21 @@
#include <string.h>
#include "libavutil/imgutils.h"
+
#include "avcodec.h"
-#include "internal.h"
-#include "dsputil.h"
#include "get_bits.h"
#include "hpeldsp.h"
+#include "internal.h"
+#include "mathops.h"
+#include "thread.h"
#include "videodsp.h"
#include "vp3data.h"
#include "vp3dsp.h"
#include "xiph.h"
-#include "thread.h"
#define FRAGMENT_PIXELS 8
-//FIXME split things out into their own arrays
+// FIXME split things out into their own arrays
typedef struct Vp3Fragment {
int16_t dc;
uint8_t coding_method;
@@ -81,51 +82,49 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb);
/* There are 6 preset schemes, plus a free-form scheme */
-static const int ModeAlphabet[6][CODING_MODE_COUNT] =
-{
+static const int ModeAlphabet[6][CODING_MODE_COUNT] = {
/* scheme 1: Last motion vector dominates */
- { MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
- MODE_INTER_PLUS_MV, MODE_INTER_NO_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
+ { MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
+ MODE_INTER_PLUS_MV, MODE_INTER_NO_MV,
+ MODE_INTRA, MODE_USING_GOLDEN,
+ MODE_GOLDEN_MV, MODE_INTER_FOURMV },
/* scheme 2 */
- { MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
- MODE_INTER_NO_MV, MODE_INTER_PLUS_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
+ { MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
+ MODE_INTER_NO_MV, MODE_INTER_PLUS_MV,
+ MODE_INTRA, MODE_USING_GOLDEN,
+ MODE_GOLDEN_MV, MODE_INTER_FOURMV },
/* scheme 3 */
- { MODE_INTER_LAST_MV, MODE_INTER_PLUS_MV,
- MODE_INTER_PRIOR_LAST, MODE_INTER_NO_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
+ { MODE_INTER_LAST_MV, MODE_INTER_PLUS_MV,
+ MODE_INTER_PRIOR_LAST, MODE_INTER_NO_MV,
+ MODE_INTRA, MODE_USING_GOLDEN,
+ MODE_GOLDEN_MV, MODE_INTER_FOURMV },
/* scheme 4 */
- { MODE_INTER_LAST_MV, MODE_INTER_PLUS_MV,
- MODE_INTER_NO_MV, MODE_INTER_PRIOR_LAST,
- MODE_INTRA, MODE_USING_GOLDEN,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
+ { MODE_INTER_LAST_MV, MODE_INTER_PLUS_MV,
+ MODE_INTER_NO_MV, MODE_INTER_PRIOR_LAST,
+ MODE_INTRA, MODE_USING_GOLDEN,
+ MODE_GOLDEN_MV, MODE_INTER_FOURMV },
/* scheme 5: No motion vector dominates */
- { MODE_INTER_NO_MV, MODE_INTER_LAST_MV,
- MODE_INTER_PRIOR_LAST, MODE_INTER_PLUS_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
+ { MODE_INTER_NO_MV, MODE_INTER_LAST_MV,
+ MODE_INTER_PRIOR_LAST, MODE_INTER_PLUS_MV,
+ MODE_INTRA, MODE_USING_GOLDEN,
+ MODE_GOLDEN_MV, MODE_INTER_FOURMV },
/* scheme 6 */
- { MODE_INTER_NO_MV, MODE_USING_GOLDEN,
- MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
- MODE_INTER_PLUS_MV, MODE_INTRA,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
-
+ { MODE_INTER_NO_MV, MODE_USING_GOLDEN,
+ MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
+ MODE_INTER_PLUS_MV, MODE_INTRA,
+ MODE_GOLDEN_MV, MODE_INTER_FOURMV },
};
static const uint8_t hilbert_offset[16][2] = {
- {0,0}, {1,0}, {1,1}, {0,1},
- {0,2}, {0,3}, {1,3}, {1,2},
- {2,2}, {2,3}, {3,3}, {3,2},
- {3,1}, {2,1}, {2,0}, {3,0}
+ { 0, 0 }, { 1, 0 }, { 1, 1 }, { 0, 1 },
+ { 0, 2 }, { 0, 3 }, { 1, 3 }, { 1, 2 },
+ { 2, 2 }, { 2, 3 }, { 3, 3 }, { 3, 2 },
+ { 3, 1 }, { 2, 1 }, { 2, 0 }, { 3, 0 }
};
#define MIN_DEQUANT_VAL 2
@@ -184,7 +183,7 @@ typedef struct Vp3DecodeContext {
uint32_t coded_ac_scale_factor[64];
uint8_t base_matrix[384][64];
uint8_t qr_count[2][3];
- uint8_t qr_size [2][3][64];
+ uint8_t qr_size[2][3][64];
uint16_t qr_base[2][3][64];
/**
@@ -211,7 +210,8 @@ typedef struct Vp3DecodeContext {
#define TOKEN_COEFF(coeff) (((coeff) << 2) + 2)
/**
- * number of blocks that contain DCT coefficients at the given level or higher
+ * number of blocks that contain DCT coefficients at
+ * the given level or higher
*/
int num_coded_frags[3][64];
int total_num_coded_frags;
@@ -255,7 +255,7 @@ typedef struct Vp3DecodeContext {
uint32_t huffman_table[80][32][2];
uint8_t filter_limit_values[64];
- DECLARE_ALIGNED(8, int, bounding_values_array)[256+2];
+ DECLARE_ALIGNED(8, int, bounding_values_array)[256 + 2];
} Vp3DecodeContext;
/************************************************************************
@@ -313,7 +313,6 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx)
ff_free_vlc(&s->mode_code_vlc);
ff_free_vlc(&s->motion_vector_vlc);
-
return 0;
}
@@ -330,19 +329,22 @@ static int init_block_mapping(Vp3DecodeContext *s)
int x, y, i, j = 0;
for (plane = 0; plane < 3; plane++) {
- int sb_width = plane ? s->c_superblock_width : s->y_superblock_width;
- int sb_height = plane ? s->c_superblock_height : s->y_superblock_height;
+ int sb_width = plane ? s->c_superblock_width
+ : s->y_superblock_width;
+ int sb_height = plane ? s->c_superblock_height
+ : s->y_superblock_height;
int frag_width = s->fragment_width[!!plane];
int frag_height = s->fragment_height[!!plane];
for (sb_y = 0; sb_y < sb_height; sb_y++)
for (sb_x = 0; sb_x < sb_width; sb_x++)
for (i = 0; i < 16; i++) {
- x = 4*sb_x + hilbert_offset[i][0];
- y = 4*sb_y + hilbert_offset[i][1];
+ x = 4 * sb_x + hilbert_offset[i][0];
+ y = 4 * sb_y + hilbert_offset[i][1];
if (x < frag_width && y < frag_height)
- s->superblock_fragments[j++] = s->fragment_start[plane] + y*frag_width + x;
+ s->superblock_fragments[j++] = s->fragment_start[plane] +
+ y * frag_width + x;
else
s->superblock_fragments[j++] = -1;
}
@@ -361,30 +363,31 @@ static void init_dequantizer(Vp3DecodeContext *s, int qpi)
int dc_scale_factor = s->coded_dc_scale_factor[s->qps[qpi]];
int i, plane, inter, qri, bmi, bmj, qistart;
- for(inter=0; inter<2; inter++){
- for(plane=0; plane<3; plane++){
- int sum=0;
- for(qri=0; qri<s->qr_count[inter][plane]; qri++){
- sum+= s->qr_size[inter][plane][qri];
- if(s->qps[qpi] <= sum)
+ for (inter = 0; inter < 2; inter++) {
+ for (plane = 0; plane < 3; plane++) {
+ int sum = 0;
+ for (qri = 0; qri < s->qr_count[inter][plane]; qri++) {
+ sum += s->qr_size[inter][plane][qri];
+ if (s->qps[qpi] <= sum)
break;
}
- qistart= sum - s->qr_size[inter][plane][qri];
- bmi= s->qr_base[inter][plane][qri ];
- bmj= s->qr_base[inter][plane][qri+1];
- for(i=0; i<64; i++){
- int coeff= ( 2*(sum -s->qps[qpi])*s->base_matrix[bmi][i]
- - 2*(qistart-s->qps[qpi])*s->base_matrix[bmj][i]
- + s->qr_size[inter][plane][qri])
- / (2*s->qr_size[inter][plane][qri]);
-
- int qmin= 8<<(inter + !i);
- int qscale= i ? ac_scale_factor : dc_scale_factor;
+ qistart = sum - s->qr_size[inter][plane][qri];
+ bmi = s->qr_base[inter][plane][qri];
+ bmj = s->qr_base[inter][plane][qri + 1];
+ for (i = 0; i < 64; i++) {
+ int coeff = (2 * (sum - s->qps[qpi]) * s->base_matrix[bmi][i] -
+ 2 * (qistart - s->qps[qpi]) * s->base_matrix[bmj][i] +
+ s->qr_size[inter][plane][qri]) /
+ (2 * s->qr_size[inter][plane][qri]);
+
+ int qmin = 8 << (inter + !i);
+ int qscale = i ? ac_scale_factor : dc_scale_factor;
s->qmat[qpi][inter][plane][s->idct_permutation[i]] =
av_clip((qscale * coeff) / 100 * 4, qmin, 4096);
}
- // all DC coefficients use the same quant so as not to interfere with DC prediction
+ /* all DC coefficients use the same quant so as not to interfere
+ * with DC prediction */
s->qmat[qpi][inter][plane][0] = s->qmat[0][inter][plane][0];
}
}
@@ -398,7 +401,7 @@ static void init_dequantizer(Vp3DecodeContext *s, int qpi)
*/
static void init_loop_filter(Vp3DecodeContext *s)
{
- int *bounding_values= s->bounding_values_array+127;
+ int *bounding_values = s->bounding_values_array + 127;
int filter_limit;
int x;
int value;
@@ -427,7 +430,9 @@ static void init_loop_filter(Vp3DecodeContext *s)
*/
static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
{
- int superblock_starts[3] = { 0, s->u_superblock_start, s->v_superblock_start };
+ int superblock_starts[3] = {
+ 0, s->u_superblock_start, s->v_superblock_start
+ };
int bit = 0;
int current_superblock = 0;
int current_run = 0;
@@ -439,11 +444,9 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
if (s->keyframe) {
memset(s->superblock_coding, SB_FULLY_CODED, s->superblock_count);
-
} else {
-
/* unpack the list of partially-coded superblocks */
- bit = get_bits1(gb) ^ 1;
+ bit = get_bits1(gb) ^ 1;
current_run = 0;
while (current_superblock < s->superblock_count && get_bits_left(gb) > 0) {
@@ -452,13 +455,14 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
else
bit ^= 1;
- current_run = get_vlc2(gb,
- s->superblock_run_length_vlc.table, 6, 2) + 1;
- if (current_run == 34)
- current_run += get_bits(gb, 12);
+ current_run = get_vlc2(gb, s->superblock_run_length_vlc.table,
+ 6, 2) + 1;
+ if (current_run == 34)
+ current_run += get_bits(gb, 12);
if (current_superblock + current_run > s->superblock_count) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid partially coded superblock run length\n");
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Invalid partially coded superblock run length\n");
return -1;
}
@@ -475,33 +479,33 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
int superblocks_decoded = 0;
current_superblock = 0;
- bit = get_bits1(gb) ^ 1;
- current_run = 0;
-
- while (superblocks_decoded < s->superblock_count - num_partial_superblocks
- && get_bits_left(gb) > 0) {
+ bit = get_bits1(gb) ^ 1;
+ current_run = 0;
+ while (superblocks_decoded < s->superblock_count - num_partial_superblocks &&
+ get_bits_left(gb) > 0) {
if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
bit = get_bits1(gb);
else
bit ^= 1;
- current_run = get_vlc2(gb,
- s->superblock_run_length_vlc.table, 6, 2) + 1;
- if (current_run == 34)
- current_run += get_bits(gb, 12);
+ current_run = get_vlc2(gb, s->superblock_run_length_vlc.table,
+ 6, 2) + 1;
+ if (current_run == 34)
+ current_run += get_bits(gb, 12);
for (j = 0; j < current_run; current_superblock++) {
if (current_superblock >= s->superblock_count) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid fully coded superblock run length\n");
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Invalid fully coded superblock run length\n");
return -1;
}
- /* skip any superblocks already marked as partially coded */
- if (s->superblock_coding[current_superblock] == SB_NOT_CODED) {
- s->superblock_coding[current_superblock] = 2*bit;
- j++;
- }
+ /* skip any superblocks already marked as partially coded */
+ if (s->superblock_coding[current_superblock] == SB_NOT_CODED) {
+ s->superblock_coding[current_superblock] = 2 * bit;
+ j++;
+ }
}
superblocks_decoded += current_run;
}
@@ -510,9 +514,8 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
/* if there were partial blocks, initialize bitstream for
* unpacking fragment codings */
if (num_partial_superblocks) {
-
current_run = 0;
- bit = get_bits1(gb);
+ bit = get_bits1(gb);
/* toggle the bit because as soon as the first run length is
* fetched the bit will be toggled again */
bit ^= 1;
@@ -526,30 +529,27 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
for (plane = 0; plane < 3; plane++) {
int sb_start = superblock_starts[plane];
- int sb_end = sb_start + (plane ? s->c_superblock_count : s->y_superblock_count);
+ int sb_end = sb_start + (plane ? s->c_superblock_count
+ : s->y_superblock_count);
int num_coded_frags = 0;
- for (i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) {
-
- /* iterate through all 16 fragments in a superblock */
- for (j = 0; j < 16; j++) {
-
- /* if the fragment is in bounds, check its coding status */
- current_fragment = s->superblock_fragments[i * 16 + j];
- if (current_fragment != -1) {
- int coded = s->superblock_coding[i];
-
- if (s->superblock_coding[i] == SB_PARTIALLY_CODED) {
-
- /* fragment may or may not be coded; this is the case
- * that cares about the fragment coding runs */
- if (current_run-- == 0) {
- bit ^= 1;
- current_run = get_vlc2(gb,
- s->fragment_run_length_vlc.table, 5, 2);
+ for (i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) {
+ /* iterate through all 16 fragments in a superblock */
+ for (j = 0; j < 16; j++) {
+ /* if the fragment is in bounds, check its coding status */
+ current_fragment = s->superblock_fragments[i * 16 + j];
+ if (current_fragment != -1) {
+ int coded = s->superblock_coding[i];
+
+ if (s->superblock_coding[i] == SB_PARTIALLY_CODED) {
+ /* fragment may or may not be coded; this is the case
+ * that cares about the fragment coding runs */
+ if (current_run-- == 0) {
+ bit ^= 1;
+ current_run = get_vlc2(gb, s->fragment_run_length_vlc.table, 5, 2);
+ }
+ coded = bit;
}
- coded = bit;
- }
if (coded) {
/* default mode; actual mode will be decoded in
@@ -563,14 +563,15 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
s->all_fragments[current_fragment].coding_method =
MODE_COPY;
}
+ }
}
}
- }
s->total_num_coded_frags += num_coded_frags;
for (i = 0; i < 64; i++)
s->num_coded_frags[plane][i] = num_coded_frags;
if (plane < 2)
- s->coded_fragment_list[plane+1] = s->coded_fragment_list[plane] + num_coded_frags;
+ s->coded_fragment_list[plane + 1] = s->coded_fragment_list[plane] +
+ num_coded_frags;
}
return 0;
}
@@ -593,9 +594,7 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb)
if (s->keyframe) {
for (i = 0; i < s->fragment_count; i++)
s->all_fragments[i].coding_method = MODE_INTRA;
-
} else {
-
/* fetch the mode coding scheme for this frame */
scheme = get_bits(gb, 3);
@@ -607,7 +606,7 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb)
custom_mode_alphabet[get_bits(gb, 3)] = i;
alphabet = custom_mode_alphabet;
} else
- alphabet = ModeAlphabet[scheme-1];
+ alphabet = ModeAlphabet[scheme - 1];
/* iterate through all of the macroblocks that contain 1 or more
* coded fragments */
@@ -616,65 +615,70 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb)
if (get_bits_left(gb) <= 0)
return -1;
- for (j = 0; j < 4; j++) {
- int mb_x = 2*sb_x + (j>>1);
- int mb_y = 2*sb_y + (((j>>1)+j)&1);
- current_macroblock = mb_y * s->macroblock_width + mb_x;
+ for (j = 0; j < 4; j++) {
+ int mb_x = 2 * sb_x + (j >> 1);
+ int mb_y = 2 * sb_y + (((j >> 1) + j) & 1);
+ current_macroblock = mb_y * s->macroblock_width + mb_x;
- if (mb_x >= s->macroblock_width || mb_y >= s->macroblock_height)
- continue;
+ if (mb_x >= s->macroblock_width ||
+ mb_y >= s->macroblock_height)
+ continue;
-#define BLOCK_X (2*mb_x + (k&1))
-#define BLOCK_Y (2*mb_y + (k>>1))
- /* coding modes are only stored if the macroblock has at least one
- * luma block coded, otherwise it must be INTER_NO_MV */
- for (k = 0; k < 4; k++) {
- current_fragment = BLOCK_Y*s->fragment_width[0] + BLOCK_X;
- if (s->all_fragments[current_fragment].coding_method != MODE_COPY)
- break;
- }
- if (k == 4) {
- s->macroblock_coding[current_macroblock] = MODE_INTER_NO_MV;
- continue;
- }
+#define BLOCK_X (2 * mb_x + (k & 1))
+#define BLOCK_Y (2 * mb_y + (k >> 1))
+ /* coding modes are only stored if the macroblock has
+ * at least one luma block coded, otherwise it must be
+ * INTER_NO_MV */
+ for (k = 0; k < 4; k++) {
+ current_fragment = BLOCK_Y *
+ s->fragment_width[0] + BLOCK_X;
+ if (s->all_fragments[current_fragment].coding_method != MODE_COPY)
+ break;
+ }
+ if (k == 4) {
+ s->macroblock_coding[current_macroblock] = MODE_INTER_NO_MV;
+ continue;
+ }
- /* mode 7 means get 3 bits for each coding mode */
- if (scheme == 7)
- coding_mode = get_bits(gb, 3);
- else
- coding_mode = alphabet
- [get_vlc2(gb, s->mode_code_vlc.table, 3, 3)];
+ /* mode 7 means get 3 bits for each coding mode */
+ if (scheme == 7)
+ coding_mode = get_bits(gb, 3);
+ else
+ coding_mode = alphabet[get_vlc2(gb, s->mode_code_vlc.table, 3, 3)];
- s->macroblock_coding[current_macroblock] = coding_mode;
- for (k = 0; k < 4; k++) {
- frag = s->all_fragments + BLOCK_Y*s->fragment_width[0] + BLOCK_X;
- if (frag->coding_method != MODE_COPY)
- frag->coding_method = coding_mode;
- }
+ s->macroblock_coding[current_macroblock] = coding_mode;
+ for (k = 0; k < 4; k++) {
+ frag = s->all_fragments + BLOCK_Y * s->fragment_width[0] + BLOCK_X;
+ if (frag->coding_method != MODE_COPY)
+ frag->coding_method = coding_mode;
+ }
-#define SET_CHROMA_MODES \
- if (frag[s->fragment_start[1]].coding_method != MODE_COPY) \
- frag[s->fragment_start[1]].coding_method = coding_mode;\
- if (frag[s->fragment_start[2]].coding_method != MODE_COPY) \
+#define SET_CHROMA_MODES \
+ if (frag[s->fragment_start[1]].coding_method != MODE_COPY) \
+ frag[s->fragment_start[1]].coding_method = coding_mode; \
+ if (frag[s->fragment_start[2]].coding_method != MODE_COPY) \
frag[s->fragment_start[2]].coding_method = coding_mode;
- if (s->chroma_y_shift) {
- frag = s->all_fragments + mb_y*s->fragment_width[1] + mb_x;
- SET_CHROMA_MODES
- } else if (s->chroma_x_shift) {
- frag = s->all_fragments + 2*mb_y*s->fragment_width[1] + mb_x;
- for (k = 0; k < 2; k++) {
- SET_CHROMA_MODES
- frag += s->fragment_width[1];
- }
- } else {
- for (k = 0; k < 4; k++) {
- frag = s->all_fragments + BLOCK_Y*s->fragment_width[1] + BLOCK_X;
+ if (s->chroma_y_shift) {
+ frag = s->all_fragments + mb_y *
+ s->fragment_width[1] + mb_x;
SET_CHROMA_MODES
+ } else if (s->chroma_x_shift) {
+ frag = s->all_fragments +
+ 2 * mb_y * s->fragment_width[1] + mb_x;
+ for (k = 0; k < 2; k++) {
+ SET_CHROMA_MODES
+ frag += s->fragment_width[1];
+ }
+ } else {
+ for (k = 0; k < 4; k++) {
+ frag = s->all_fragments +
+ BLOCK_Y * s->fragment_width[1] + BLOCK_X;
+ SET_CHROMA_MODES
+ }
}
}
}
- }
}
}
@@ -712,151 +716,152 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
if (get_bits_left(gb) <= 0)
return -1;
- for (j = 0; j < 4; j++) {
- int mb_x = 2*sb_x + (j>>1);
- int mb_y = 2*sb_y + (((j>>1)+j)&1);
- current_macroblock = mb_y * s->macroblock_width + mb_x;
+ for (j = 0; j < 4; j++) {
+ int mb_x = 2 * sb_x + (j >> 1);
+ int mb_y = 2 * sb_y + (((j >> 1) + j) & 1);
+ current_macroblock = mb_y * s->macroblock_width + mb_x;
- if (mb_x >= s->macroblock_width || mb_y >= s->macroblock_height ||
- (s->macroblock_coding[current_macroblock] == MODE_COPY))
- continue;
+ if (mb_x >= s->macroblock_width ||
+ mb_y >= s->macroblock_height ||
+ s->macroblock_coding[current_macroblock] == MODE_COPY)
+ continue;
- switch (s->macroblock_coding[current_macroblock]) {
+ switch (s->macroblock_coding[current_macroblock]) {
+ case MODE_INTER_PLUS_MV:
+ case MODE_GOLDEN_MV:
+ /* all 6 fragments use the same motion vector */
+ if (coding_mode == 0) {
+ motion_x[0] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
+ motion_y[0] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
+ } else {
+ motion_x[0] = fixed_motion_vector_table[get_bits(gb, 6)];
+ motion_y[0] = fixed_motion_vector_table[get_bits(gb, 6)];
+ }
- case MODE_INTER_PLUS_MV:
- case MODE_GOLDEN_MV:
- /* all 6 fragments use the same motion vector */
- if (coding_mode == 0) {
- motion_x[0] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
- motion_y[0] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
- } else {
- motion_x[0] = fixed_motion_vector_table[get_bits(gb, 6)];
- motion_y[0] = fixed_motion_vector_table[get_bits(gb, 6)];
- }
+ /* vector maintenance, only on MODE_INTER_PLUS_MV */
+ if (s->macroblock_coding[current_macroblock] == MODE_INTER_PLUS_MV) {
+ prior_last_motion_x = last_motion_x;
+ prior_last_motion_y = last_motion_y;
+ last_motion_x = motion_x[0];
+ last_motion_y = motion_y[0];
+ }
+ break;
- /* vector maintenance, only on MODE_INTER_PLUS_MV */
- if (s->macroblock_coding[current_macroblock] ==
- MODE_INTER_PLUS_MV) {
+ case MODE_INTER_FOURMV:
+ /* vector maintenance */
prior_last_motion_x = last_motion_x;
prior_last_motion_y = last_motion_y;
- last_motion_x = motion_x[0];
- last_motion_y = motion_y[0];
- }
- break;
-
- case MODE_INTER_FOURMV:
- /* vector maintenance */
- prior_last_motion_x = last_motion_x;
- prior_last_motion_y = last_motion_y;
- /* fetch 4 vectors from the bitstream, one for each
- * Y fragment, then average for the C fragment vectors */
- for (k = 0; k < 4; k++) {
- current_fragment = BLOCK_Y*s->fragment_width[0] + BLOCK_X;
- if (s->all_fragments[current_fragment].coding_method != MODE_COPY) {
- if (coding_mode == 0) {
- motion_x[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
- motion_y[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
+ /* fetch 4 vectors from the bitstream, one for each
+ * Y fragment, then average for the C fragment vectors */
+ for (k = 0; k < 4; k++) {
+ current_fragment = BLOCK_Y * s->fragment_width[0] + BLOCK_X;
+ if (s->all_fragments[current_fragment].coding_method != MODE_COPY) {
+ if (coding_mode == 0) {
+ motion_x[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
+ motion_y[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
+ } else {
+ motion_x[k] = fixed_motion_vector_table[get_bits(gb, 6)];
+ motion_y[k] = fixed_motion_vector_table[get_bits(gb, 6)];
+ }
+ last_motion_x = motion_x[k];
+ last_motion_y = motion_y[k];
} else {
- motion_x[k] = fixed_motion_vector_table[get_bits(gb, 6)];
- motion_y[k] = fixed_motion_vector_table[get_bits(gb, 6)];
+ motion_x[k] = 0;
+ motion_y[k] = 0;
}
- last_motion_x = motion_x[k];
- last_motion_y = motion_y[k];
- } else {
- motion_x[k] = 0;
- motion_y[k] = 0;
}
- }
- break;
-
- case MODE_INTER_LAST_MV:
- /* all 6 fragments use the last motion vector */
- motion_x[0] = last_motion_x;
- motion_y[0] = last_motion_y;
-
- /* no vector maintenance (last vector remains the
- * last vector) */
- break;
-
- case MODE_INTER_PRIOR_LAST:
- /* all 6 fragments use the motion vector prior to the
- * last motion vector */
- motion_x[0] = prior_last_motion_x;
- motion_y[0] = prior_last_motion_y;
-
- /* vector maintenance */
- prior_last_motion_x = last_motion_x;
- prior_last_motion_y = last_motion_y;
- last_motion_x = motion_x[0];
- last_motion_y = motion_y[0];
- break;
-
- default:
- /* covers intra, inter without MV, golden without MV */
- motion_x[0] = 0;
- motion_y[0] = 0;
-
- /* no vector maintenance */
- break;
- }
+ break;
- /* assign the motion vectors to the correct fragments */
- for (k = 0; k < 4; k++) {
- current_fragment =
- BLOCK_Y*s->fragment_width[0] + BLOCK_X;
- if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
- s->motion_val[0][current_fragment][0] = motion_x[k];
- s->motion_val[0][current_fragment][1] = motion_y[k];
- } else {
- s->motion_val[0][current_fragment][0] = motion_x[0];
- s->motion_val[0][current_fragment][1] = motion_y[0];
- }
- }
+ case MODE_INTER_LAST_MV:
+ /* all 6 fragments use the last motion vector */
+ motion_x[0] = last_motion_x;
+ motion_y[0] = last_motion_y;
- if (s->chroma_y_shift) {
- if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
- motion_x[0] = RSHIFT(motion_x[0] + motion_x[1] + motion_x[2] + motion_x[3], 2);
- motion_y[0] = RSHIFT(motion_y[0] + motion_y[1] + motion_y[2] + motion_y[3], 2);
- }
- motion_x[0] = (motion_x[0]>>1) | (motion_x[0]&1);
- motion_y[0] = (motion_y[0]>>1) | (motion_y[0]&1);
- frag = mb_y*s->fragment_width[1] + mb_x;
- s->motion_val[1][frag][0] = motion_x[0];
- s->motion_val[1][frag][1] = motion_y[0];
- } else if (s->chroma_x_shift) {
- if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
- motion_x[0] = RSHIFT(motion_x[0] + motion_x[1], 1);
- motion_y[0] = RSHIFT(motion_y[0] + motion_y[1], 1);
- motion_x[1] = RSHIFT(motion_x[2] + motion_x[3], 1);
- motion_y[1] = RSHIFT(motion_y[2] + motion_y[3], 1);
- } else {
- motion_x[1] = motion_x[0];
- motion_y[1] = motion_y[0];
- }
- motion_x[0] = (motion_x[0]>>1) | (motion_x[0]&1);
- motion_x[1] = (motion_x[1]>>1) | (motion_x[1]&1);
-
- frag = 2*mb_y*s->fragment_width[1] + mb_x;
- for (k = 0; k < 2; k++) {
- s->motion_val[1][frag][0] = motion_x[k];
- s->motion_val[1][frag][1] = motion_y[k];
- frag += s->fragment_width[1];
+ /* no vector maintenance (last vector remains the
+ * last vector) */
+ break;
+
+ case MODE_INTER_PRIOR_LAST:
+ /* all 6 fragments use the motion vector prior to the
+ * last motion vector */
+ motion_x[0] = prior_last_motion_x;
+ motion_y[0] = prior_last_motion_y;
+
+ /* vector maintenance */
+ prior_last_motion_x = last_motion_x;
+ prior_last_motion_y = last_motion_y;
+ last_motion_x = motion_x[0];
+ last_motion_y = motion_y[0];
+ break;
+
+ default:
+ /* covers intra, inter without MV, golden without MV */
+ motion_x[0] = 0;
+ motion_y[0] = 0;
+
+ /* no vector maintenance */
+ break;
}
- } else {
+
+ /* assign the motion vectors to the correct fragments */
for (k = 0; k < 4; k++) {
- frag = BLOCK_Y*s->fragment_width[1] + BLOCK_X;
+ current_fragment =
+ BLOCK_Y * s->fragment_width[0] + BLOCK_X;
+ if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
+ s->motion_val[0][current_fragment][0] = motion_x[k];
+ s->motion_val[0][current_fragment][1] = motion_y[k];
+ } else {
+ s->motion_val[0][current_fragment][0] = motion_x[0];
+ s->motion_val[0][current_fragment][1] = motion_y[0];
+ }
+ }
+
+ if (s->chroma_y_shift) {
if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
+ motion_x[0] = RSHIFT(motion_x[0] + motion_x[1] +
+ motion_x[2] + motion_x[3], 2);
+ motion_y[0] = RSHIFT(motion_y[0] + motion_y[1] +
+ motion_y[2] + motion_y[3], 2);
+ }
+ motion_x[0] = (motion_x[0] >> 1) | (motion_x[0] & 1);
+ motion_y[0] = (motion_y[0] >> 1) | (motion_y[0] & 1);
+ frag = mb_y * s->fragment_width[1] + mb_x;
+ s->motion_val[1][frag][0] = motion_x[0];
+ s->motion_val[1][frag][1] = motion_y[0];
+ } else if (s->chroma_x_shift) {
+ if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
+ motion_x[0] = RSHIFT(motion_x[0] + motion_x[1], 1);
+ motion_y[0] = RSHIFT(motion_y[0] + motion_y[1], 1);
+ motion_x[1] = RSHIFT(motion_x[2] + motion_x[3], 1);
+ motion_y[1] = RSHIFT(motion_y[2] + motion_y[3], 1);
+ } else {
+ motion_x[1] = motion_x[0];
+ motion_y[1] = motion_y[0];
+ }
+ motion_x[0] = (motion_x[0] >> 1) | (motion_x[0] & 1);
+ motion_x[1] = (motion_x[1] >> 1) | (motion_x[1] & 1);
+
+ frag = 2 * mb_y * s->fragment_width[1] + mb_x;
+ for (k = 0; k < 2; k++) {
s->motion_val[1][frag][0] = motion_x[k];
s->motion_val[1][frag][1] = motion_y[k];
- } else {
- s->motion_val[1][frag][0] = motion_x[0];
- s->motion_val[1][frag][1] = motion_y[0];
+ frag += s->fragment_width[1];
+ }
+ } else {
+ for (k = 0; k < 4; k++) {
+ frag = BLOCK_Y * s->fragment_width[1] + BLOCK_X;
+ if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
+ s->motion_val[1][frag][0] = motion_x[k];
+ s->motion_val[1][frag][1] = motion_y[k];
+ } else {
+ s->motion_val[1][frag][0] = motion_x[0];
+ s->motion_val[1][frag][1] = motion_y[0];
+ }
}
}
}
}
- }
}
return 0;
@@ -867,10 +872,10 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb)
int qpi, i, j, bit, run_length, blocks_decoded, num_blocks_at_qpi;
int num_blocks = s->total_num_coded_frags;
- for (qpi = 0; qpi < s->nqps-1 && num_blocks > 0; qpi++) {
+ for (qpi = 0; qpi < s->nqps - 1 && num_blocks > 0; qpi++) {
i = blocks_decoded = num_blocks_at_qpi = 0;
- bit = get_bits1(gb) ^ 1;
+ bit = get_bits1(gb) ^ 1;
run_length = 0;
do {
@@ -917,34 +922,37 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb)
* be passed into the next call to this same function.
*/
static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
- VLC *table, int coeff_index,
- int plane,
- int eob_run)
+ VLC *table, int coeff_index,
+ int plane,
+ int eob_run)
{
int i, j = 0;
int token;
- int zero_run = 0;
+ int zero_run = 0;
int16_t coeff = 0;
int bits_to_get;
int blocks_ended;
int coeff_i = 0;
- int num_coeffs = s->num_coded_frags[plane][coeff_index];
+ int num_coeffs = s->num_coded_frags[plane][coeff_index];
int16_t *dct_tokens = s->dct_tokens[plane][coeff_index];
/* local references to structure members to avoid repeated deferences */
- int *coded_fragment_list = s->coded_fragment_list[plane];
+ int *coded_fragment_list = s->coded_fragment_list[plane];
Vp3Fragment *all_fragments = s->all_fragments;
- VLC_TYPE (*vlc_table)[2] = table->table;
+ VLC_TYPE(*vlc_table)[2] = table->table;
if (num_coeffs < 0)
- av_log(s->avctx, AV_LOG_ERROR, "Invalid number of coefficents at level %d\n", coeff_index);
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Invalid number of coefficents at level %d\n", coeff_index);
if (eob_run > num_coeffs) {
- coeff_i = blocks_ended = num_coeffs;
- eob_run -= num_coeffs;
+ coeff_i =
+ blocks_ended = num_coeffs;
+ eob_run -= num_coeffs;
} else {
- coeff_i = blocks_ended = eob_run;
- eob_run = 0;
+ coeff_i =
+ blocks_ended = eob_run;
+ eob_run = 0;
}
// insert fake EOB token to cover the split between planes or zzi
@@ -952,66 +960,66 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
dct_tokens[j++] = blocks_ended << 2;
while (coeff_i < num_coeffs && get_bits_left(gb) > 0) {
- /* decode a VLC into a token */
- token = get_vlc2(gb, vlc_table, 11, 3);
- /* use the token to get a zero run, a coefficient, and an eob run */
- if ((unsigned) token <= 6U) {
- eob_run = eob_run_base[token];
- if (eob_run_get_bits[token])
- eob_run += get_bits(gb, eob_run_get_bits[token]);
-
- // record only the number of blocks ended in this plane,
- // any spill will be recorded in the next plane.
- if (eob_run > num_coeffs - coeff_i) {
- dct_tokens[j++] = TOKEN_EOB(num_coeffs - coeff_i);
- blocks_ended += num_coeffs - coeff_i;
- eob_run -= num_coeffs - coeff_i;
- coeff_i = num_coeffs;
- } else {
- dct_tokens[j++] = TOKEN_EOB(eob_run);
- blocks_ended += eob_run;
- coeff_i += eob_run;
- eob_run = 0;
- }
- } else if (token >= 0) {
- bits_to_get = coeff_get_bits[token];
- if (bits_to_get)
- bits_to_get = get_bits(gb, bits_to_get);
- coeff = coeff_tables[token][bits_to_get];
-
- zero_run = zero_run_base[token];
- if (zero_run_get_bits[token])
- zero_run += get_bits(gb, zero_run_get_bits[token]);
-
- if (zero_run) {
- dct_tokens[j++] = TOKEN_ZERO_RUN(coeff, zero_run);
- } else {
- // Save DC into the fragment structure. DC prediction is
- // done in raster order, so the actual DC can't be in with
- // other tokens. We still need the token in dct_tokens[]
- // however, or else the structure collapses on itself.
- if (!coeff_index)
- all_fragments[coded_fragment_list[coeff_i]].dc = coeff;
-
- dct_tokens[j++] = TOKEN_COEFF(coeff);
- }
-
- if (coeff_index + zero_run > 64) {
- av_log(s->avctx, AV_LOG_DEBUG, "Invalid zero run of %d with"
- " %d coeffs left\n", zero_run, 64-coeff_index);
- zero_run = 64 - coeff_index;
- }
-
- // zero runs code multiple coefficients,
- // so don't try to decode coeffs for those higher levels
- for (i = coeff_index+1; i <= coeff_index+zero_run; i++)
- s->num_coded_frags[plane][i]--;
- coeff_i++;
+ /* decode a VLC into a token */
+ token = get_vlc2(gb, vlc_table, 11, 3);
+ /* use the token to get a zero run, a coefficient, and an eob run */
+ if ((unsigned) token <= 6U) {
+ eob_run = eob_run_base[token];
+ if (eob_run_get_bits[token])
+ eob_run += get_bits(gb, eob_run_get_bits[token]);
+
+ // record only the number of blocks ended in this plane,
+ // any spill will be recorded in the next plane.
+ if (eob_run > num_coeffs - coeff_i) {
+ dct_tokens[j++] = TOKEN_EOB(num_coeffs - coeff_i);
+ blocks_ended += num_coeffs - coeff_i;
+ eob_run -= num_coeffs - coeff_i;
+ coeff_i = num_coeffs;
} else {
- av_log(s->avctx, AV_LOG_ERROR,
- "Invalid token %d\n", token);
- return -1;
+ dct_tokens[j++] = TOKEN_EOB(eob_run);
+ blocks_ended += eob_run;
+ coeff_i += eob_run;
+ eob_run = 0;
}
+ } else if (token >= 0) {
+ bits_to_get = coeff_get_bits[token];
+ if (bits_to_get)
+ bits_to_get = get_bits(gb, bits_to_get);
+ coeff = coeff_tables[token][bits_to_get];
+
+ zero_run = zero_run_base[token];
+ if (zero_run_get_bits[token])
+ zero_run += get_bits(gb, zero_run_get_bits[token]);
+
+ if (zero_run) {
+ dct_tokens[j++] = TOKEN_ZERO_RUN(coeff, zero_run);
+ } else {
+ // Save DC into the fragment structure. DC prediction is
+ // done in raster order, so the actual DC can't be in with
+ // other tokens. We still need the token in dct_tokens[]
+ // however, or else the structure collapses on itself.
+ if (!coeff_index)
+ all_fragments[coded_fragment_list[coeff_i]].dc = coeff;
+
+ dct_tokens[j++] = TOKEN_COEFF(coeff);
+ }
+
+ if (coeff_index + zero_run > 64) {
+ av_log(s->avctx, AV_LOG_DEBUG,
+ "Invalid zero run of %d with %d coeffs left\n",
+ zero_run, 64 - coeff_index);
+ zero_run = 64 - coeff_index;
+ }
+
+ // zero runs code multiple coefficients,
+ // so don't try to decode coeffs for those higher levels
+ for (i = coeff_index + 1; i <= coeff_index + zero_run; i++)
+ s->num_coded_frags[plane][i]--;
+ coeff_i++;
+ } else {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid token %d\n", token);
+ return -1;
+ }
}
if (blocks_ended > s->num_coded_frags[plane][coeff_index])
@@ -1020,14 +1028,14 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
// decrement the number of blocks that have higher coeffecients for each
// EOB run at this level
if (blocks_ended)
- for (i = coeff_index+1; i < 64; i++)
+ for (i = coeff_index + 1; i < 64; i++)
s->num_coded_frags[plane][i] -= blocks_ended;
// setup the next buffer
if (plane < 2)
- s->dct_tokens[plane+1][coeff_index] = dct_tokens + j;
+ s->dct_tokens[plane + 1][coeff_index] = dct_tokens + j;
else if (coeff_index < 63)
- s->dct_tokens[0][coeff_index+1] = dct_tokens + j;
+ s->dct_tokens[0][coeff_index + 1] = dct_tokens + j;
return eob_run;
}
@@ -1059,7 +1067,7 @@ 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,
- 0, residual_eob_run);
+ 0, residual_eob_run);
if (residual_eob_run < 0)
return residual_eob_run;
@@ -1068,21 +1076,20 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
/* unpack the C plane DC coefficients */
residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_c_table], 0,
- 1, residual_eob_run);
+ 1, residual_eob_run);
if (residual_eob_run < 0)
return residual_eob_run;
residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_c_table], 0,
- 2, residual_eob_run);
+ 2, residual_eob_run);
if (residual_eob_run < 0)
return residual_eob_run;
/* reverse prediction of the C-plane DC coefficients */
- if (!(s->avctx->flags & CODEC_FLAG_GRAY))
- {
+ if (!(s->avctx->flags & CODEC_FLAG_GRAY)) {
reverse_dc_prediction(s, s->fragment_start[1],
- s->fragment_width[1], s->fragment_height[1]);
+ s->fragment_width[1], s->fragment_height[1]);
reverse_dc_prediction(s, s->fragment_start[2],
- s->fragment_width[1], s->fragment_height[1]);
+ s->fragment_width[1], s->fragment_height[1]);
}
/* fetch the AC table indexes */
@@ -1109,19 +1116,19 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
/* decode all AC coefficents */
for (i = 1; i <= 63; i++) {
- residual_eob_run = unpack_vlcs(s, gb, y_tables[i], i,
- 0, residual_eob_run);
- if (residual_eob_run < 0)
- return residual_eob_run;
-
- residual_eob_run = unpack_vlcs(s, gb, c_tables[i], i,
- 1, residual_eob_run);
- if (residual_eob_run < 0)
- return residual_eob_run;
- residual_eob_run = unpack_vlcs(s, gb, c_tables[i], i,
- 2, residual_eob_run);
- if (residual_eob_run < 0)
- return residual_eob_run;
+ residual_eob_run = unpack_vlcs(s, gb, y_tables[i], i,
+ 0, residual_eob_run);
+ if (residual_eob_run < 0)
+ return residual_eob_run;
+
+ residual_eob_run = unpack_vlcs(s, gb, c_tables[i], i,
+ 1, residual_eob_run);
+ if (residual_eob_run < 0)
+ return residual_eob_run;
+ residual_eob_run = unpack_vlcs(s, gb, c_tables[i], i,
+ 2, residual_eob_run);
+ if (residual_eob_run < 0)
+ return residual_eob_run;
}
return 0;
@@ -1132,8 +1139,8 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
* the frame. Much of this function is adapted directly from the original
* VP3 source code.
*/
-#define COMPATIBLE_FRAME(x) \
- (compatible_frame[s->all_fragments[x].coding_method] == current_frame_type)
+#define COMPATIBLE_FRAME(x) \
+ (compatible_frame[s->all_fragments[x].coding_method] == current_frame_type)
#define DC_COEFF(u) s->all_fragments[u].dc
static void reverse_dc_prediction(Vp3DecodeContext *s,
@@ -1141,7 +1148,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
int fragment_width,
int fragment_height)
{
-
#define PUL 8
#define PU 4
#define PUR 2
@@ -1166,22 +1172,22 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
* 3: left multiplier
*/
static const int predictor_transform[16][4] = {
- { 0, 0, 0, 0},
- { 0, 0, 0,128}, // PL
- { 0, 0,128, 0}, // PUR
- { 0, 0, 53, 75}, // PUR|PL
- { 0,128, 0, 0}, // PU
- { 0, 64, 0, 64}, // PU|PL
- { 0,128, 0, 0}, // PU|PUR
- { 0, 0, 53, 75}, // PU|PUR|PL
- {128, 0, 0, 0}, // PUL
- { 0, 0, 0,128}, // PUL|PL
- { 64, 0, 64, 0}, // PUL|PUR
- { 0, 0, 53, 75}, // PUL|PUR|PL
- { 0,128, 0, 0}, // PUL|PU
- {-104,116, 0,116}, // PUL|PU|PL
- { 24, 80, 24, 0}, // PUL|PU|PUR
- {-104,116, 0,116} // PUL|PU|PUR|PL
+ { 0, 0, 0, 0 },
+ { 0, 0, 0, 128 }, // PL
+ { 0, 0, 128, 0 }, // PUR
+ { 0, 0, 53, 75 }, // PUR|PL
+ { 0, 128, 0, 0 }, // PU
+ { 0, 64, 0, 64 }, // PU |PL
+ { 0, 128, 0, 0 }, // PU |PUR
+ { 0, 0, 53, 75 }, // PU |PUR|PL
+ { 128, 0, 0, 0 }, // PUL
+ { 0, 0, 0, 128 }, // PUL|PL
+ { 64, 0, 64, 0 }, // PUL|PUR
+ { 0, 0, 53, 75 }, // PUL|PUR|PL
+ { 0, 128, 0, 0 }, // PUL|PU
+ { -104, 116, 0, 116 }, // PUL|PU |PL
+ { 24, 80, 24, 0 }, // PUL|PU |PUR
+ { -104, 116, 0, 116 } // PUL|PU |PUR|PL
};
/* This table shows which types of blocks can use other blocks for
@@ -1208,54 +1214,55 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
int transform = 0;
- vul = vu = vur = vl = 0;
- last_dc[0] = last_dc[1] = last_dc[2] = 0;
+ vul =
+ vu =
+ vur =
+ vl = 0;
+ last_dc[0] =
+ last_dc[1] =
+ last_dc[2] = 0;
/* for each fragment row... */
for (y = 0; y < fragment_height; y++) {
-
/* for each fragment in a row... */
for (x = 0; x < fragment_width; x++, i++) {
/* reverse prediction if this block was coded */
if (s->all_fragments[i].coding_method != MODE_COPY) {
-
current_frame_type =
compatible_frame[s->all_fragments[i].coding_method];
- transform= 0;
- if(x){
- l= i-1;
+ transform = 0;
+ if (x) {
+ l = i - 1;
vl = DC_COEFF(l);
- if(COMPATIBLE_FRAME(l))
+ if (COMPATIBLE_FRAME(l))
transform |= PL;
}
- if(y){
- u= i-fragment_width;
+ if (y) {
+ u = i - fragment_width;
vu = DC_COEFF(u);
- if(COMPATIBLE_FRAME(u))
+ if (COMPATIBLE_FRAME(u))
transform |= PU;
- if(x){
- ul= i-fragment_width-1;
+ if (x) {
+ ul = i - fragment_width - 1;
vul = DC_COEFF(ul);
- if(COMPATIBLE_FRAME(ul))
+ if (COMPATIBLE_FRAME(ul))
transform |= PUL;
}
- if(x + 1 < fragment_width){
- ur= i-fragment_width+1;
+ if (x + 1 < fragment_width) {
+ ur = i - fragment_width + 1;
vur = DC_COEFF(ur);
- if(COMPATIBLE_FRAME(ur))
+ if (COMPATIBLE_FRAME(ur))
transform |= PUR;
}
}
if (transform == 0) {
-
/* if there were no fragments to predict from, use last
* DC saved */
predicted_dc = last_dc[current_frame_type];
} else {
-
/* apply the appropriate predictor transform */
predicted_dc =
(predictor_transform[transform][0] * vul) +
@@ -1286,39 +1293,39 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
}
}
-static void apply_loop_filter(Vp3DecodeContext *s, int plane, int ystart, int yend)
+static void apply_loop_filter(Vp3DecodeContext *s, int plane,
+ int ystart, int yend)
{
int x, y;
- int *bounding_values= s->bounding_values_array+127;
+ int *bounding_values = s->bounding_values_array + 127;
int width = s->fragment_width[!!plane];
int height = s->fragment_height[!!plane];
- int fragment = s->fragment_start [plane] + ystart * width;
+ int fragment = s->fragment_start[plane] + ystart * width;
ptrdiff_t stride = s->current_frame.f->linesize[plane];
- uint8_t *plane_data = s->current_frame.f->data [plane];
- if (!s->flipped_image) stride = -stride;
- plane_data += s->data_offset[plane] + 8*ystart*stride;
+ uint8_t *plane_data = s->current_frame.f->data[plane];
+ if (!s->flipped_image)
+ stride = -stride;
+ plane_data += s->data_offset[plane] + 8 * ystart * stride;
for (y = ystart; y < yend; y++) {
-
for (x = 0; x < width; x++) {
/* 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 )
- {
+ if (s->all_fragments[fragment].coding_method != MODE_COPY) {
/* do not perform left edge filter for left columns frags */
if (x > 0) {
s->vp3dsp.h_loop_filter(
- plane_data + 8*x,
+ plane_data + 8 * x,
stride, bounding_values);
}
/* do not perform top edge filter for top row fragments */
if (y > 0) {
s->vp3dsp.v_loop_filter(
- plane_data + 8*x,
+ plane_data + 8 * x,
stride, bounding_values);
}
@@ -1328,7 +1335,7 @@ static void apply_loop_filter(Vp3DecodeContext *s, int plane, int ystart, int ye
if ((x < width - 1) &&
(s->all_fragments[fragment + 1].coding_method == MODE_COPY)) {
s->vp3dsp.h_loop_filter(
- plane_data + 8*x + 8,
+ plane_data + 8 * x + 8,
stride, bounding_values);
}
@@ -1338,14 +1345,14 @@ static void apply_loop_filter(Vp3DecodeContext *s, int plane, int ystart, int ye
if ((y < height - 1) &&
(s->all_fragments[fragment + width].coding_method == MODE_COPY)) {
s->vp3dsp.v_loop_filter(
- plane_data + 8*x + 8*stride,
+ plane_data + 8 * x + 8 * stride,
stride, bounding_values);
}
}
fragment++;
}
- plane_data += 8*stride;
+ plane_data += 8 * stride;
}
}
@@ -1364,7 +1371,7 @@ static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag,
int token = *s->dct_tokens[plane][i];
switch (token & 3) {
case 0: // EOB
- if (--token < 4) // 0-3 are token types, so the EOB run must now be 0
+ if (--token < 4) // 0-3 are token types so the EOB run must now be 0
s->dct_tokens[plane][i]++;
else
*s->dct_tokens[plane][i] = token & ~3;
@@ -1403,30 +1410,32 @@ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y)
int h, cy, i;
int offset[AV_NUM_DATA_POINTERS];
- if (HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_FRAME) {
- int y_flipped = s->flipped_image ? s->avctx->height-y : y;
+ if (HAVE_THREADS && s->avctx->active_thread_type & FF_THREAD_FRAME) {
+ int y_flipped = s->flipped_image ? s->avctx->height - y : y;
- // At the end of the frame, report INT_MAX instead of the height of the frame.
- // This makes the other threads' ff_thread_await_progress() calls cheaper, because
- // they don't have to clip their values.
- ff_thread_report_progress(&s->current_frame, y_flipped==s->avctx->height ? INT_MAX : y_flipped-1, 0);
+ /* At the end of the frame, report INT_MAX instead of the height of
+ * the frame. This makes the other threads' ff_thread_await_progress()
+ * calls cheaper, because they don't have to clip their values. */
+ ff_thread_report_progress(&s->current_frame,
+ y_flipped == s->avctx->height ? INT_MAX
+ : y_flipped - 1,
+ 0);
}
- if(s->avctx->draw_horiz_band==NULL)
+ if (s->avctx->draw_horiz_band == NULL)
return;
- h= y - s->last_slice_end;
- s->last_slice_end= y;
+ h = y - s->last_slice_end;
+ s->last_slice_end = y;
y -= h;
- if (!s->flipped_image) {
+ if (!s->flipped_image)
y = s->avctx->height - y - h;
- }
- cy = y >> s->chroma_y_shift;
- offset[0] = s->current_frame.f->linesize[0]*y;
- offset[1] = s->current_frame.f->linesize[1]*cy;
- offset[2] = s->current_frame.f->linesize[2]*cy;
+ cy = y >> s->chroma_y_shift;
+ offset[0] = s->current_frame.f->linesize[0] * y;
+ offset[1] = s->current_frame.f->linesize[1] * cy;
+ offset[2] = s->current_frame.f->linesize[2] * cy;
for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
offset[i] = 0;
@@ -1438,11 +1447,12 @@ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y)
* Wait for the reference frame of the current fragment.
* The progress value is in luma pixel rows.
*/
-static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, int motion_y, int y)
+static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment,
+ int motion_y, int y)
{
ThreadFrame *ref_frame;
int ref_row;
- int border = motion_y&1;
+ int border = motion_y & 1;
if (fragment->coding_method == MODE_USING_GOLDEN ||
fragment->coding_method == MODE_GOLDEN_MV)
@@ -1450,7 +1460,7 @@ static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, int
else
ref_frame = &s->last_frame;
- ref_row = y + (motion_y>>1);
+ ref_row = y + (motion_y >> 1);
ref_row = FFMAX(FFABS(ref_row), ref_row + 8 + border);
ff_thread_await_progress(ref_frame, ref_row, 0);
@@ -1473,38 +1483,43 @@ static void render_slice(Vp3DecodeContext *s, int slice)
return;
for (plane = 0; plane < 3; plane++) {
- uint8_t *output_plane = s->current_frame.f->data [plane] + s->data_offset[plane];
- uint8_t * last_plane = s-> last_frame.f->data [plane] + s->data_offset[plane];
- uint8_t *golden_plane = s-> golden_frame.f->data [plane] + s->data_offset[plane];
- ptrdiff_t stride = s->current_frame.f->linesize[plane];
- int plane_width = s->width >> (plane && s->chroma_x_shift);
- int plane_height = s->height >> (plane && s->chroma_y_shift);
- int8_t (*motion_val)[2] = s->motion_val[!!plane];
-
- int sb_x, sb_y = slice << (!plane && s->chroma_y_shift);
- int slice_height = sb_y + 1 + (!plane && s->chroma_y_shift);
- int slice_width = plane ? s->c_superblock_width : s->y_superblock_width;
-
- int fragment_width = s->fragment_width[!!plane];
- int fragment_height = s->fragment_height[!!plane];
- int fragment_start = s->fragment_start[plane];
- int do_await = !plane && HAVE_THREADS && (s->avctx->active_thread_type&FF_THREAD_FRAME);
-
- if (!s->flipped_image) stride = -stride;
+ uint8_t *output_plane = s->current_frame.f->data[plane] +
+ s->data_offset[plane];
+ uint8_t *last_plane = s->last_frame.f->data[plane] +
+ s->data_offset[plane];
+ uint8_t *golden_plane = s->golden_frame.f->data[plane] +
+ s->data_offset[plane];
+ ptrdiff_t stride = s->current_frame.f->linesize[plane];
+ int plane_width = s->width >> (plane && s->chroma_x_shift);
+ int plane_height = s->height >> (plane && s->chroma_y_shift);
+ int8_t(*motion_val)[2] = s->motion_val[!!plane];
+
+ int sb_x, sb_y = slice << (!plane && s->chroma_y_shift);
+ int slice_height = sb_y + 1 + (!plane && s->chroma_y_shift);
+ int slice_width = plane ? s->c_superblock_width
+ : s->y_superblock_width;
+
+ int fragment_width = s->fragment_width[!!plane];
+ int fragment_height = s->fragment_height[!!plane];
+ int fragment_start = s->fragment_start[plane];
+
+ int do_await = !plane && HAVE_THREADS &&
+ (s->avctx->active_thread_type & FF_THREAD_FRAME);
+
+ if (!s->flipped_image)
+ stride = -stride;
if (CONFIG_GRAY && plane && (s->avctx->flags & CODEC_FLAG_GRAY))
continue;
/* for each superblock row in the slice (both of them)... */
for (; sb_y < slice_height; sb_y++) {
-
/* for each superblock in a row... */
for (sb_x = 0; sb_x < slice_width; sb_x++) {
-
/* for each block in a superblock... */
for (j = 0; j < 16; j++) {
- x = 4*sb_x + hilbert_offset[j][0];
- y = 4*sb_y + hilbert_offset[j][1];
- fragment = y*fragment_width + x;
+ x = 4 * sb_x + hilbert_offset[j][0];
+ y = 4 * sb_y + hilbert_offset[j][1];
+ fragment = y * fragment_width + x;
i = fragment_start + fragment;
@@ -1512,119 +1527,126 @@ static void render_slice(Vp3DecodeContext *s, int slice)
if (x >= fragment_width || y >= fragment_height)
continue;
- first_pixel = 8*y*stride + 8*x;
-
- if (do_await && s->all_fragments[i].coding_method != MODE_INTRA)
- await_reference_row(s, &s->all_fragments[i], motion_val[fragment][1], (16*y) >> s->chroma_y_shift);
-
- /* transform if this block was coded */
- if (s->all_fragments[i].coding_method != MODE_COPY) {
- if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) ||
- (s->all_fragments[i].coding_method == MODE_GOLDEN_MV))
- motion_source= golden_plane;
- else
- motion_source= last_plane;
-
- motion_source += first_pixel;
- motion_halfpel_index = 0;
-
- /* sort out the motion vector if this fragment is coded
- * using a motion vector method */
- if ((s->all_fragments[i].coding_method > MODE_INTRA) &&
- (s->all_fragments[i].coding_method != MODE_USING_GOLDEN)) {
- int src_x, src_y;
- motion_x = motion_val[fragment][0];
- motion_y = motion_val[fragment][1];
-
- src_x= (motion_x>>1) + 8*x;
- src_y= (motion_y>>1) + 8*y;
-
- motion_halfpel_index = motion_x & 0x01;
- motion_source += (motion_x >> 1);
-
- motion_halfpel_index |= (motion_y & 0x01) << 1;
- motion_source += ((motion_y >> 1) * stride);
-
- if(src_x<0 || src_y<0 || src_x + 9 >= plane_width || src_y + 9 >= plane_height){
- uint8_t *temp= s->edge_emu_buffer;
- if(stride<0) temp -= 8*stride;
-
- s->vdsp.emulated_edge_mc(temp, motion_source,
- stride, stride,
- 9, 9, src_x, src_y,
- plane_width,
- plane_height);
- motion_source= temp;
+ first_pixel = 8 * y * stride + 8 * x;
+
+ if (do_await &&
+ s->all_fragments[i].coding_method != MODE_INTRA)
+ await_reference_row(s, &s->all_fragments[i],
+ motion_val[fragment][1],
+ (16 * y) >> s->chroma_y_shift);
+
+ /* transform if this block was coded */
+ if (s->all_fragments[i].coding_method != MODE_COPY) {
+ if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) ||
+ (s->all_fragments[i].coding_method == MODE_GOLDEN_MV))
+ motion_source = golden_plane;
+ else
+ motion_source = last_plane;
+
+ motion_source += first_pixel;
+ motion_halfpel_index = 0;
+
+ /* sort out the motion vector if this fragment is coded
+ * using a motion vector method */
+ if ((s->all_fragments[i].coding_method > MODE_INTRA) &&
+ (s->all_fragments[i].coding_method != MODE_USING_GOLDEN)) {
+ int src_x, src_y;
+ motion_x = motion_val[fragment][0];
+ motion_y = motion_val[fragment][1];
+
+ src_x = (motion_x >> 1) + 8 * x;
+ src_y = (motion_y >> 1) + 8 * y;
+
+ motion_halfpel_index = motion_x & 0x01;
+ motion_source += (motion_x >> 1);
+
+ motion_halfpel_index |= (motion_y & 0x01) << 1;
+ motion_source += ((motion_y >> 1) * stride);
+
+ if (src_x < 0 || src_y < 0 ||
+ src_x + 9 >= plane_width ||
+ src_y + 9 >= plane_height) {
+ uint8_t *temp = s->edge_emu_buffer;
+ if (stride < 0)
+ temp -= 8 * stride;
+
+ s->vdsp.emulated_edge_mc(temp, motion_source,
+ stride, stride,
+ 9, 9, src_x, src_y,
+ plane_width,
+ plane_height);
+ motion_source = temp;
+ }
}
- }
-
- /* first, take care of copying a block from either the
- * previous or the golden frame */
- if (s->all_fragments[i].coding_method != MODE_INTRA) {
- /* Note, it is possible to implement all MC cases with
- put_no_rnd_pixels_l2 which would look more like the
- VP3 source but this would be slower as
- put_no_rnd_pixels_tab is better optimzed */
- if(motion_halfpel_index != 3){
- s->hdsp.put_no_rnd_pixels_tab[1][motion_halfpel_index](
- output_plane + first_pixel,
- motion_source, stride, 8);
- }else{
- int d= (motion_x ^ motion_y)>>31; // d is 0 if motion_x and _y have the same sign, else -1
- s->vp3dsp.put_no_rnd_pixels_l2(
- output_plane + first_pixel,
- motion_source - d,
- motion_source + stride + 1 + d,
- stride, 8);
+ /* first, take care of copying a block from either the
+ * previous or the golden frame */
+ if (s->all_fragments[i].coding_method != MODE_INTRA) {
+ /* Note, it is possible to implement all MC cases
+ * with put_no_rnd_pixels_l2 which would look more
+ * like the VP3 source but this would be slower as
+ * put_no_rnd_pixels_tab is better optimzed */
+ if (motion_halfpel_index != 3) {
+ s->hdsp.put_no_rnd_pixels_tab[1][motion_halfpel_index](
+ output_plane + first_pixel,
+ motion_source, stride, 8);
+ } else {
+ /* d is 0 if motion_x and _y have the same sign,
+ * else -1 */
+ int d = (motion_x ^ motion_y) >> 31;
+ s->vp3dsp.put_no_rnd_pixels_l2(output_plane + first_pixel,
+ motion_source - d,
+ motion_source + stride + 1 + d,
+ stride, 8);
+ }
}
- }
- /* invert DCT and place (or add) in final output */
+ /* invert DCT and place (or add) in final output */
- if (s->all_fragments[i].coding_method == MODE_INTRA) {
- vp3_dequant(s, s->all_fragments + i, plane, 0, block);
- s->vp3dsp.idct_put(
- output_plane + first_pixel,
- stride,
- block);
- } else {
- if (vp3_dequant(s, s->all_fragments + i, plane, 1, block)) {
- s->vp3dsp.idct_add(
- output_plane + first_pixel,
- stride,
- block);
+ if (s->all_fragments[i].coding_method == MODE_INTRA) {
+ vp3_dequant(s, s->all_fragments + i,
+ plane, 0, block);
+ s->vp3dsp.idct_put(output_plane + first_pixel,
+ stride,
+ block);
} else {
- s->vp3dsp.idct_dc_add(output_plane + first_pixel, stride, block);
+ if (vp3_dequant(s, s->all_fragments + i,
+ plane, 1, block)) {
+ s->vp3dsp.idct_add(output_plane + first_pixel,
+ stride,
+ block);
+ } else {
+ s->vp3dsp.idct_dc_add(output_plane + first_pixel,
+ stride, block);
+ }
}
+ } else {
+ /* copy directly from the previous frame */
+ s->hdsp.put_pixels_tab[1][0](
+ output_plane + first_pixel,
+ last_plane + first_pixel,
+ stride, 8);
}
- } else {
-
- /* copy directly from the previous frame */
- s->hdsp.put_pixels_tab[1][0](
- output_plane + first_pixel,
- last_plane + first_pixel,
- stride, 8);
-
- }
}
}
// Filter up to the last row in the superblock row
if (!s->skip_loop_filter)
- apply_loop_filter(s, plane, 4*sb_y - !!sb_y, FFMIN(4*sb_y+3, fragment_height-1));
+ apply_loop_filter(s, plane, 4 * sb_y - !!sb_y,
+ FFMIN(4 * sb_y + 3, fragment_height - 1));
}
}
- /* this looks like a good place for slice dispatch... */
- /* algorithm:
- * if (slice == s->macroblock_height - 1)
- * dispatch (both last slice & 2nd-to-last slice);
- * else if (slice > 0)
- * dispatch (slice - 1);
- */
+ /* this looks like a good place for slice dispatch... */
+ /* algorithm:
+ * if (slice == s->macroblock_height - 1)
+ * dispatch (both last slice & 2nd-to-last slice);
+ * else if (slice > 0)
+ * dispatch (slice - 1);
+ */
- vp3_draw_horiz_band(s, FFMIN((32 << s->chroma_y_shift) * (slice + 1) -16, s->height-16));
+ vp3_draw_horiz_band(s, FFMIN((32 << s->chroma_y_shift) * (slice + 1) - 16,
+ s->height - 16));
}
/// Allocate tables for per-frame data in Vp3DecodeContext
@@ -1637,19 +1659,23 @@ static av_cold int allocate_tables(AVCodecContext *avctx)
c_fragment_count = s->fragment_width[1] * s->fragment_height[1];
s->superblock_coding = av_mallocz(s->superblock_count);
- s->all_fragments = av_mallocz(s->fragment_count * sizeof(Vp3Fragment));
+ s->all_fragments = av_mallocz(s->fragment_count * sizeof(Vp3Fragment));
+
s->coded_fragment_list[0] = av_mallocz(s->fragment_count * sizeof(int));
- s->dct_tokens_base = av_mallocz(64*s->fragment_count * sizeof(*s->dct_tokens_base));
+
+ s->dct_tokens_base = av_mallocz(64 * s->fragment_count *
+ sizeof(*s->dct_tokens_base));
s->motion_val[0] = av_mallocz(y_fragment_count * sizeof(*s->motion_val[0]));
s->motion_val[1] = av_mallocz(c_fragment_count * sizeof(*s->motion_val[1]));
/* work out the block mapping tables */
s->superblock_fragments = av_mallocz(s->superblock_count * 16 * sizeof(int));
- s->macroblock_coding = av_mallocz(s->macroblock_count + 1);
+ s->macroblock_coding = av_mallocz(s->macroblock_count + 1);
- if (!s->superblock_coding || !s->all_fragments || !s->dct_tokens_base ||
- !s->coded_fragment_list[0] || !s->superblock_fragments || !s->macroblock_coding ||
- !s->motion_val[0] || !s->motion_val[1]) {
+ if (!s->superblock_coding || !s->all_fragments ||
+ !s->dct_tokens_base || !s->coded_fragment_list[0] ||
+ !s->superblock_fragments || !s->macroblock_coding ||
+ !s->motion_val[0] || !s->motion_val[1]) {
vp3_decode_end(avctx);
return -1;
}
@@ -1689,13 +1715,13 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
avctx->internal->allocate_progress = 1;
- if (avctx->codec_tag == MKTAG('V','P','3','0'))
+ if (avctx->codec_tag == MKTAG('V', 'P', '3', '0'))
s->version = 0;
else
s->version = 1;
- s->avctx = avctx;
- s->width = FFALIGN(avctx->width, 16);
+ s->avctx = avctx;
+ s->width = FFALIGN(avctx->width, 16);
s->height = FFALIGN(avctx->height, 16);
if (avctx->codec_id != AV_CODEC_ID_THEORA)
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
@@ -1705,10 +1731,10 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
for (i = 0; i < 64; i++) {
-#define T(x) (x >> 3) | ((x & 7) << 3)
- s->idct_permutation[i] = T(i);
- s->idct_scantable[i] = T(ff_zigzag_direct[i]);
-#undef T
+#define TRANSPOSE(x) (x >> 3) | ((x & 7) << 3)
+ s->idct_permutation[i] = TRANSPOSE(i);
+ s->idct_scantable[i] = TRANSPOSE(ff_zigzag_direct[i]);
+#undef TRANSPOSE
}
/* initialize to an impossible value which will force a recalculation
@@ -1718,135 +1744,132 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, &s->chroma_y_shift);
- s->y_superblock_width = (s->width + 31) / 32;
+ s->y_superblock_width = (s->width + 31) / 32;
s->y_superblock_height = (s->height + 31) / 32;
- s->y_superblock_count = s->y_superblock_width * s->y_superblock_height;
+ s->y_superblock_count = s->y_superblock_width * s->y_superblock_height;
/* work out the dimensions for the C planes */
- c_width = s->width >> s->chroma_x_shift;
- c_height = s->height >> s->chroma_y_shift;
- s->c_superblock_width = (c_width + 31) / 32;
+ c_width = s->width >> s->chroma_x_shift;
+ c_height = s->height >> s->chroma_y_shift;
+ s->c_superblock_width = (c_width + 31) / 32;
s->c_superblock_height = (c_height + 31) / 32;
- s->c_superblock_count = s->c_superblock_width * s->c_superblock_height;
+ s->c_superblock_count = s->c_superblock_width * s->c_superblock_height;
- s->superblock_count = s->y_superblock_count + (s->c_superblock_count * 2);
+ s->superblock_count = s->y_superblock_count + (s->c_superblock_count * 2);
s->u_superblock_start = s->y_superblock_count;
s->v_superblock_start = s->u_superblock_start + s->c_superblock_count;
- s->macroblock_width = (s->width + 15) / 16;
+ s->macroblock_width = (s->width + 15) / 16;
s->macroblock_height = (s->height + 15) / 16;
- s->macroblock_count = s->macroblock_width * s->macroblock_height;
+ s->macroblock_count = s->macroblock_width * s->macroblock_height;
- s->fragment_width[0] = s->width / FRAGMENT_PIXELS;
+ s->fragment_width[0] = s->width / FRAGMENT_PIXELS;
s->fragment_height[0] = s->height / FRAGMENT_PIXELS;
- s->fragment_width[1] = s->fragment_width[0] >> s->chroma_x_shift;
+ s->fragment_width[1] = s->fragment_width[0] >> s->chroma_x_shift;
s->fragment_height[1] = s->fragment_height[0] >> s->chroma_y_shift;
/* fragment count covers all 8x8 blocks for all 3 planes */
y_fragment_count = s->fragment_width[0] * s->fragment_height[0];
c_fragment_count = s->fragment_width[1] * s->fragment_height[1];
- s->fragment_count = y_fragment_count + 2*c_fragment_count;
+ s->fragment_count = y_fragment_count + 2 * c_fragment_count;
s->fragment_start[1] = y_fragment_count;
s->fragment_start[2] = y_fragment_count + c_fragment_count;
- if (!s->theora_tables)
- {
+ if (!s->theora_tables) {
for (i = 0; i < 64; i++) {
s->coded_dc_scale_factor[i] = vp31_dc_scale_factor[i];
s->coded_ac_scale_factor[i] = vp31_ac_scale_factor[i];
- s->base_matrix[0][i] = vp31_intra_y_dequant[i];
- s->base_matrix[1][i] = vp31_intra_c_dequant[i];
- s->base_matrix[2][i] = vp31_inter_dequant[i];
- s->filter_limit_values[i] = vp31_filter_limit_values[i];
+ s->base_matrix[0][i] = vp31_intra_y_dequant[i];
+ s->base_matrix[1][i] = vp31_intra_c_dequant[i];
+ s->base_matrix[2][i] = vp31_inter_dequant[i];
+ s->filter_limit_values[i] = vp31_filter_limit_values[i];
}
- for(inter=0; inter<2; inter++){
- for(plane=0; plane<3; plane++){
- s->qr_count[inter][plane]= 1;
- s->qr_size [inter][plane][0]= 63;
- s->qr_base [inter][plane][0]=
- s->qr_base [inter][plane][1]= 2*inter + (!!plane)*!inter;
+ for (inter = 0; inter < 2; inter++) {
+ for (plane = 0; plane < 3; plane++) {
+ s->qr_count[inter][plane] = 1;
+ s->qr_size[inter][plane][0] = 63;
+ s->qr_base[inter][plane][0] =
+ s->qr_base[inter][plane][1] = 2 * inter + (!!plane) * !inter;
}
}
/* init VLC tables */
for (i = 0; i < 16; i++) {
-
/* DC histograms */
init_vlc(&s->dc_vlc[i], 11, 32,
- &dc_bias[i][0][1], 4, 2,
- &dc_bias[i][0][0], 4, 2, 0);
+ &dc_bias[i][0][1], 4, 2,
+ &dc_bias[i][0][0], 4, 2, 0);
/* group 1 AC histograms */
init_vlc(&s->ac_vlc_1[i], 11, 32,
- &ac_bias_0[i][0][1], 4, 2,
- &ac_bias_0[i][0][0], 4, 2, 0);
+ &ac_bias_0[i][0][1], 4, 2,
+ &ac_bias_0[i][0][0], 4, 2, 0);
/* group 2 AC histograms */
init_vlc(&s->ac_vlc_2[i], 11, 32,
- &ac_bias_1[i][0][1], 4, 2,
- &ac_bias_1[i][0][0], 4, 2, 0);
+ &ac_bias_1[i][0][1], 4, 2,
+ &ac_bias_1[i][0][0], 4, 2, 0);
/* group 3 AC histograms */
init_vlc(&s->ac_vlc_3[i], 11, 32,
- &ac_bias_2[i][0][1], 4, 2,
- &ac_bias_2[i][0][0], 4, 2, 0);
+ &ac_bias_2[i][0][1], 4, 2,
+ &ac_bias_2[i][0][0], 4, 2, 0);
/* group 4 AC histograms */
init_vlc(&s->ac_vlc_4[i], 11, 32,
- &ac_bias_3[i][0][1], 4, 2,
- &ac_bias_3[i][0][0], 4, 2, 0);
+ &ac_bias_3[i][0][1], 4, 2,
+ &ac_bias_3[i][0][0], 4, 2, 0);
}
} else {
-
for (i = 0; i < 16; i++) {
/* DC histograms */
if (init_vlc(&s->dc_vlc[i], 11, 32,
- &s->huffman_table[i][0][1], 8, 4,
- &s->huffman_table[i][0][0], 8, 4, 0) < 0)
+ &s->huffman_table[i][0][1], 8, 4,
+ &s->huffman_table[i][0][0], 8, 4, 0) < 0)
goto vlc_fail;
/* group 1 AC histograms */
if (init_vlc(&s->ac_vlc_1[i], 11, 32,
- &s->huffman_table[i+16][0][1], 8, 4,
- &s->huffman_table[i+16][0][0], 8, 4, 0) < 0)
+ &s->huffman_table[i + 16][0][1], 8, 4,
+ &s->huffman_table[i + 16][0][0], 8, 4, 0) < 0)
goto vlc_fail;
/* group 2 AC histograms */
if (init_vlc(&s->ac_vlc_2[i], 11, 32,
- &s->huffman_table[i+16*2][0][1], 8, 4,
- &s->huffman_table[i+16*2][0][0], 8, 4, 0) < 0)
+ &s->huffman_table[i + 16 * 2][0][1], 8, 4,
+ &s->huffman_table[i + 16 * 2][0][0], 8, 4, 0) < 0)
goto vlc_fail;
/* group 3 AC histograms */
if (init_vlc(&s->ac_vlc_3[i], 11, 32,
- &s->huffman_table[i+16*3][0][1], 8, 4,
- &s->huffman_table[i+16*3][0][0], 8, 4, 0) < 0)
+ &s->huffman_table[i + 16 * 3][0][1], 8, 4,
+ &s->huffman_table[i + 16 * 3][0][0], 8, 4, 0) < 0)
goto vlc_fail;
/* group 4 AC histograms */
if (init_vlc(&s->ac_vlc_4[i], 11, 32,
- &s->huffman_table[i+16*4][0][1], 8, 4,
- &s->huffman_table[i+16*4][0][0], 8, 4, 0) < 0)
+ &s->huffman_table[i + 16 * 4][0][1], 8, 4,
+ &s->huffman_table[i + 16 * 4][0][0], 8, 4, 0) < 0)
goto vlc_fail;
}
}
init_vlc(&s->superblock_run_length_vlc, 6, 34,
- &superblock_run_length_vlc_table[0][1], 4, 2,
- &superblock_run_length_vlc_table[0][0], 4, 2, 0);
+ &superblock_run_length_vlc_table[0][1], 4, 2,
+ &superblock_run_length_vlc_table[0][0], 4, 2, 0);
init_vlc(&s->fragment_run_length_vlc, 5, 30,
- &fragment_run_length_vlc_table[0][1], 4, 2,
- &fragment_run_length_vlc_table[0][0], 4, 2, 0);
+ &fragment_run_length_vlc_table[0][1], 4, 2,
+ &fragment_run_length_vlc_table[0][0], 4, 2, 0);
init_vlc(&s->mode_code_vlc, 3, 8,
- &mode_code_vlc_table[0][1], 2, 1,
- &mode_code_vlc_table[0][0], 2, 1, 0);
+ &mode_code_vlc_table[0][1], 2, 1,
+ &mode_code_vlc_table[0][0], 2, 1, 0);
init_vlc(&s->motion_vector_vlc, 6, 63,
- &motion_vector_vlc_table[0][1], 2, 1,
- &motion_vector_vlc_table[0][0], 2, 1, 0);
+ &motion_vector_vlc_table[0][1], 2, 1,
+ &motion_vector_vlc_table[0][0], 2, 1, 0);
return allocate_tables(avctx);
@@ -1861,7 +1884,6 @@ static int update_frames(AVCodecContext *avctx)
Vp3DecodeContext *s = avctx->priv_data;
int ret = 0;
-
/* shuffle frames (last = current) */
ff_thread_release_buffer(avctx, &s->last_frame);
ret = ff_thread_ref_frame(&s->last_frame, &s->current_frame);
@@ -1901,11 +1923,12 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *
Vp3DecodeContext *s = dst->priv_data, *s1 = src->priv_data;
int qps_changed = 0, i, err;
-#define copy_fields(to, from, start_field, end_field) memcpy(&to->start_field, &from->start_field, (char*)&to->end_field - (char*)&to->start_field)
+#define copy_fields(to, from, start_field, end_field) \
+ memcpy(&to->start_field, &from->start_field, \
+ (char *) &to->end_field - (char *) &to->start_field)
- if (!s1->current_frame.f->data[0]
- ||s->width != s1->width
- ||s->height!= s1->height) {
+ if (!s1->current_frame.f->data[0] ||
+ s->width != s1->width || s->height != s1->height) {
if (s != s1)
ref_frames(s, s1);
return -1;
@@ -1921,8 +1944,10 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *
return err;
y_fragment_count = s->fragment_width[0] * s->fragment_height[0];
c_fragment_count = s->fragment_width[1] * s->fragment_height[1];
- memcpy(s->motion_val[0], s1->motion_val[0], y_fragment_count * sizeof(*s->motion_val[0]));
- memcpy(s->motion_val[1], s1->motion_val[1], c_fragment_count * sizeof(*s->motion_val[1]));
+ memcpy(s->motion_val[0], s1->motion_val[0],
+ y_fragment_count * sizeof(*s->motion_val[0]));
+ memcpy(s->motion_val[1], s1->motion_val[1],
+ c_fragment_count * sizeof(*s->motion_val[1]));
}
// copy previous frame data
@@ -1940,7 +1965,8 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *
}
if (s->qps[0] != s1->qps[0])
- memcpy(&s->bounding_values_array, &s1->bounding_values_array, sizeof(s->bounding_values_array));
+ memcpy(&s->bounding_values_array, &s1->bounding_values_array,
+ sizeof(s->bounding_values_array));
if (qps_changed)
copy_fields(s, s1, qps, superblock_count);
@@ -1954,8 +1980,8 @@ static int vp3_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
- const uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
Vp3DecodeContext *s = avctx->priv_data;
GetBitContext gb;
int i, ret;
@@ -1963,8 +1989,7 @@ static int vp3_decode_frame(AVCodecContext *avctx,
init_get_bits(&gb, buf, buf_size * 8);
#if CONFIG_THEORA_DECODER
- if (s->theora && get_bits1(&gb))
- {
+ if (s->theora && get_bits1(&gb)) {
int type = get_bits(&gb, 7);
skip_bits_long(&gb, 6*8); /* "theora" */
@@ -1990,7 +2015,8 @@ static int vp3_decode_frame(AVCodecContext *avctx,
return ret;
}
- av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n");
+ av_log(avctx, AV_LOG_ERROR,
+ "Header packet passed to frame decoder, skipping\n");
return -1;
}
#endif
@@ -2005,19 +2031,20 @@ static int vp3_decode_frame(AVCodecContext *avctx,
for (i = 0; i < 3; i++)
s->last_qps[i] = s->qps[i];
- s->nqps=0;
- do{
- s->qps[s->nqps++]= get_bits(&gb, 6);
- } while(s->theora >= 0x030200 && s->nqps<3 && get_bits1(&gb));
+ s->nqps = 0;
+ do {
+ s->qps[s->nqps++] = get_bits(&gb, 6);
+ } while (s->theora >= 0x030200 && s->nqps < 3 && get_bits1(&gb));
for (i = s->nqps; i < 3; i++)
s->qps[i] = -1;
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n",
- s->keyframe?"key":"", avctx->frame_number+1, s->qps[0]);
+ s->keyframe ? "key" : "", avctx->frame_number + 1, s->qps[0]);
s->skip_loop_filter = !s->filter_limit_values[s->qps[0]] ||
- avctx->skip_loop_filter >= (s->keyframe ? AVDISCARD_ALL : AVDISCARD_NONKEY);
+ avctx->skip_loop_filter >= (s->keyframe ? AVDISCARD_ALL
+ : AVDISCARD_NONKEY);
if (s->qps[0] != s->last_qps[0])
init_loop_filter(s);
@@ -2031,41 +2058,44 @@ static int vp3_decode_frame(AVCodecContext *avctx,
if (avctx->skip_frame >= AVDISCARD_NONKEY && !s->keyframe)
return buf_size;
- s->current_frame.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
+ s->current_frame.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I
+ : AV_PICTURE_TYPE_P;
s->current_frame.f->key_frame = s->keyframe;
if (ff_thread_get_buffer(avctx, &s->current_frame, AV_GET_BUFFER_FLAG_REF) < 0)
goto error;
if (!s->edge_emu_buffer)
- s->edge_emu_buffer = av_malloc(9*FFABS(s->current_frame.f->linesize[0]));
+ s->edge_emu_buffer = av_malloc(9 * FFABS(s->current_frame.f->linesize[0]));
if (s->keyframe) {
- if (!s->theora)
- {
+ if (!s->theora) {
skip_bits(&gb, 4); /* width code */
skip_bits(&gb, 4); /* height code */
- if (s->version)
- {
+ if (s->version) {
s->version = get_bits(&gb, 5);
if (avctx->frame_number == 0)
- av_log(s->avctx, AV_LOG_DEBUG, "VP version: %d\n", s->version);
+ av_log(s->avctx, AV_LOG_DEBUG,
+ "VP version: %d\n", s->version);
}
}
- if (s->version || s->theora)
- {
- if (get_bits1(&gb))
- av_log(s->avctx, AV_LOG_ERROR, "Warning, unsupported keyframe coding type?!\n");
+ if (s->version || s->theora) {
+ if (get_bits1(&gb))
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Warning, unsupported keyframe coding type?!\n");
skip_bits(&gb, 2); /* reserved? */
}
} else {
if (!s->golden_frame.f->data[0]) {
- av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n");
+ av_log(s->avctx, AV_LOG_WARNING,
+ "vp3: first frame not a keyframe\n");
s->golden_frame.f->pict_type = AV_PICTURE_TYPE_I;
- if (ff_thread_get_buffer(avctx, &s->golden_frame, AV_GET_BUFFER_FLAG_REF) < 0)
+ if (ff_thread_get_buffer(avctx, &s->golden_frame,
+ AV_GET_BUFFER_FLAG_REF) < 0)
goto error;
ff_thread_release_buffer(avctx, &s->last_frame);
- if ((ret = ff_thread_ref_frame(&s->last_frame, &s->golden_frame)) < 0)
+ if ((ret = ff_thread_ref_frame(&s->last_frame,
+ &s->golden_frame)) < 0)
goto error;
ff_thread_report_progress(&s->last_frame, INT_MAX, 0);
}
@@ -2074,23 +2104,23 @@ static int vp3_decode_frame(AVCodecContext *avctx,
memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment));
ff_thread_finish_setup(avctx);
- if (unpack_superblocks(s, &gb)){
+ if (unpack_superblocks(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n");
goto error;
}
- if (unpack_modes(s, &gb)){
+ if (unpack_modes(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_modes\n");
goto error;
}
- if (unpack_vectors(s, &gb)){
+ if (unpack_vectors(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_vectors\n");
goto error;
}
- if (unpack_block_qpis(s, &gb)){
+ if (unpack_block_qpis(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_block_qpis\n");
goto error;
}
- if (unpack_dct_coeffs(s, &gb)){
+ if (unpack_dct_coeffs(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_dct_coeffs\n");
goto error;
}
@@ -2100,7 +2130,7 @@ static int vp3_decode_frame(AVCodecContext *avctx,
if (s->flipped_image)
s->data_offset[i] = 0;
else
- s->data_offset[i] = (height-1) * s->current_frame.f->linesize[i];
+ s->data_offset[i] = (height - 1) * s->current_frame.f->linesize[i];
}
s->last_slice_end = 0;
@@ -2109,8 +2139,8 @@ static int vp3_decode_frame(AVCodecContext *avctx,
// filter the last row
for (i = 0; i < 3; i++) {
- int row = (s->height >> (3+(i && s->chroma_y_shift))) - 1;
- apply_loop_filter(s, i, row, row+1);
+ int row = (s->height >> (3 + (i && s->chroma_y_shift))) - 1;
+ apply_loop_filter(s, i, row, row + 1);
}
vp3_draw_horiz_band(s, s->avctx->height);
@@ -2118,7 +2148,7 @@ static int vp3_decode_frame(AVCodecContext *avctx,
return ret;
*got_frame = 1;
- if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME)) {
+ if (!HAVE_THREADS || !(s->avctx->active_thread_type & FF_THREAD_FRAME)) {
ret = update_frames(avctx);
if (ret < 0)
return ret;
@@ -2129,7 +2159,7 @@ static int vp3_decode_frame(AVCodecContext *avctx,
error:
ff_thread_report_progress(&s->current_frame, INT_MAX, 0);
- if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME))
+ if (!HAVE_THREADS || !(s->avctx->active_thread_type & FF_THREAD_FRAME))
av_frame_unref(s->current_frame.f);
return -1;
@@ -2151,9 +2181,8 @@ static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb)
s->huffman_table[s->hti][token][0] = s->hbits;
s->huffman_table[s->hti][token][1] = s->huff_code_size;
s->entries++;
- }
- else {
- if (s->huff_code_size >= 32) {/* overflow */
+ } else {
+ if (s->huff_code_size >= 32) { /* overflow */
av_log(avctx, AV_LOG_ERROR, "huffman tree overflow\n");
return -1;
}
@@ -2203,16 +2232,18 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
s->theora = get_bits_long(gb, 24);
av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->theora);
- /* 3.2.0 aka alpha3 has the same frame orientation as original vp3 */
- /* but previous versions have the image flipped relative to vp3 */
- if (s->theora < 0x030200)
- {
+ /* 3.2.0 aka alpha3 has the same frame orientation as original vp3
+ * but previous versions have the image flipped relative to vp3 */
+ if (s->theora < 0x030200) {
s->flipped_image = 1;
- av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n");
+ av_log(avctx, AV_LOG_DEBUG,
+ "Old (<alpha3) Theora bitstream, flipped image\n");
}
- visible_width = s->width = get_bits(gb, 16) << 4;
- visible_height = s->height = get_bits(gb, 16) << 4;
+ visible_width =
+ s->width = get_bits(gb, 16) << 4;
+ visible_height =
+ s->height = get_bits(gb, 16) << 4;
if (s->theora >= 0x030200) {
visible_width = get_bits_long(gb, 24);
@@ -2230,7 +2261,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
return AVERROR_INVALIDDATA;
}
av_reduce(&avctx->time_base.num, &avctx->time_base.den,
- fps.den, fps.num, 1<<30);
+ fps.den, fps.num, 1 << 30);
}
aspect.num = get_bits_long(gb, 24);
@@ -2238,7 +2269,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
if (aspect.num && aspect.den) {
av_reduce(&avctx->sample_aspect_ratio.num,
&avctx->sample_aspect_ratio.den,
- aspect.num, aspect.den, 1<<30);
+ aspect.num, aspect.den, 1 << 30);
}
if (s->theora < 0x030200)
@@ -2248,8 +2279,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
skip_bits(gb, 6); /* quality hint */
- if (s->theora >= 0x030200)
- {
+ if (s->theora >= 0x030200) {
skip_bits(gb, 5); /* keyframe frequency force */
avctx->pix_fmt = theora_pix_fmts[get_bits(gb, 2)];
if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
@@ -2261,20 +2291,20 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
// align_get_bits(gb);
- if ( visible_width <= s->width && visible_width > s->width-16
- && visible_height <= s->height && visible_height > s->height-16
- && !offset_x && (offset_y == s->height - visible_height))
+ if (visible_width <= s->width && visible_width > s->width - 16 &&
+ visible_height <= s->height && visible_height > s->height - 16 &&
+ !offset_x && (offset_y == s->height - visible_height))
ret = ff_set_dimensions(avctx, visible_width, visible_height);
else
ret = ff_set_dimensions(avctx, s->width, s->height);
if (ret < 0)
return ret;
- if (colorspace == 1) {
+ if (colorspace == 1)
avctx->color_primaries = AVCOL_PRI_BT470M;
- } else if (colorspace == 2) {
+ else if (colorspace == 2)
avctx->color_primaries = AVCOL_PRI_BT470BG;
- }
+
if (colorspace == 1 || colorspace == 2) {
avctx->colorspace = AVCOL_SPC_BT470BG;
avctx->color_trc = AVCOL_TRC_BT709;
@@ -2317,48 +2347,50 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb)
else
matrices = 3;
- if(matrices > 384){
+ if (matrices > 384) {
av_log(avctx, AV_LOG_ERROR, "invalid number of base matrixes\n");
return -1;
}
- for(n=0; n<matrices; n++){
+ for (n = 0; n < matrices; n++)
for (i = 0; i < 64; i++)
- s->base_matrix[n][i]= get_bits(gb, 8);
- }
+ s->base_matrix[n][i] = get_bits(gb, 8);
for (inter = 0; inter <= 1; inter++) {
for (plane = 0; plane <= 2; plane++) {
- int newqr= 1;
+ int newqr = 1;
if (inter || plane > 0)
newqr = get_bits1(gb);
if (!newqr) {
int qtj, plj;
- if(inter && get_bits1(gb)){
+ if (inter && get_bits1(gb)) {
qtj = 0;
plj = plane;
- }else{
- qtj= (3*inter + plane - 1) / 3;
- plj= (plane + 2) % 3;
+ } else {
+ qtj = (3 * inter + plane - 1) / 3;
+ plj = (plane + 2) % 3;
}
- s->qr_count[inter][plane]= s->qr_count[qtj][plj];
- memcpy(s->qr_size[inter][plane], s->qr_size[qtj][plj], sizeof(s->qr_size[0][0]));
- memcpy(s->qr_base[inter][plane], s->qr_base[qtj][plj], sizeof(s->qr_base[0][0]));
+ s->qr_count[inter][plane] = s->qr_count[qtj][plj];
+ memcpy(s->qr_size[inter][plane], s->qr_size[qtj][plj],
+ sizeof(s->qr_size[0][0]));
+ memcpy(s->qr_base[inter][plane], s->qr_base[qtj][plj],
+ sizeof(s->qr_base[0][0]));
} else {
- int qri= 0;
- int qi = 0;
-
- for(;;){
- i= get_bits(gb, av_log2(matrices-1)+1);
- if(i>= matrices){
- av_log(avctx, AV_LOG_ERROR, "invalid base matrix index\n");
+ int qri = 0;
+ int qi = 0;
+
+ for (;;) {
+ i = get_bits(gb, av_log2(matrices - 1) + 1);
+ if (i >= matrices) {
+ av_log(avctx, AV_LOG_ERROR,
+ "invalid base matrix index\n");
return -1;
}
- s->qr_base[inter][plane][qri]= i;
- if(qi >= 63)
+ s->qr_base[inter][plane][qri] = i;
+ if (qi >= 63)
break;
- i = get_bits(gb, av_log2(63-qi)+1) + 1;
- s->qr_size[inter][plane][qri++]= i;
+ i = get_bits(gb, av_log2(63 - qi) + 1) + 1;
+ s->qr_size[inter][plane][qri++] = i;
qi += i;
}
@@ -2366,21 +2398,21 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb)
av_log(avctx, AV_LOG_ERROR, "invalid qi %d > 63\n", qi);
return -1;
}
- s->qr_count[inter][plane]= qri;
+ s->qr_count[inter][plane] = qri;
}
}
}
/* Huffman tables */
for (s->hti = 0; s->hti < 80; s->hti++) {
- s->entries = 0;
+ s->entries = 0;
s->huff_code_size = 1;
if (!get_bits1(gb)) {
s->hbits = 0;
- if(read_huffman_tree(avctx, gb))
+ if (read_huffman_tree(avctx, gb))
return -1;
s->hbits = 1;
- if(read_huffman_tree(avctx, gb))
+ if (read_huffman_tree(avctx, gb))
return -1;
}
}
@@ -2403,40 +2435,37 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
s->theora = 1;
- if (!avctx->extradata_size)
- {
+ if (!avctx->extradata_size) {
av_log(avctx, AV_LOG_ERROR, "Missing extradata!\n");
return -1;
}
if (avpriv_split_xiph_headers(avctx->extradata, avctx->extradata_size,
- 42, header_start, header_len) < 0) {
+ 42, header_start, header_len) < 0) {
av_log(avctx, AV_LOG_ERROR, "Corrupt extradata\n");
return -1;
}
- for(i=0;i<3;i++) {
- if (header_len[i] <= 0)
- continue;
- init_get_bits(&gb, header_start[i], header_len[i] * 8);
+ for (i = 0; i < 3; i++) {
+ if (header_len[i] <= 0)
+ continue;
+ init_get_bits(&gb, header_start[i], header_len[i] * 8);
- ptype = get_bits(&gb, 8);
+ ptype = get_bits(&gb, 8);
- if (!(ptype & 0x80))
- {
- av_log(avctx, AV_LOG_ERROR, "Invalid extradata!\n");
-// return -1;
- }
+ if (!(ptype & 0x80)) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid extradata!\n");
+// return -1;
+ }
- // FIXME: Check for this as well.
- skip_bits_long(&gb, 6*8); /* "theora" */
+ // FIXME: Check for this as well.
+ skip_bits_long(&gb, 6 * 8); /* "theora" */
- switch(ptype)
- {
+ switch (ptype) {
case 0x80:
if (theora_decode_header(avctx, &gb) < 0)
return -1;
- break;
+ break;
case 0x81:
// FIXME: is this needed? it breaks sometimes
// theora_decode_comments(avctx, gb);
@@ -2446,14 +2475,17 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
return -1;
break;
default:
- av_log(avctx, AV_LOG_ERROR, "Unknown Theora config packet: %d\n", ptype&~0x80);
+ av_log(avctx, AV_LOG_ERROR,
+ "Unknown Theora config packet: %d\n", ptype & ~0x80);
+ break;
+ }
+ if (ptype != 0x81 && 8 * header_len[i] != get_bits_count(&gb))
+ av_log(avctx, AV_LOG_WARNING,
+ "%d bits left in packet %X\n",
+ 8 * header_len[i] - get_bits_count(&gb), ptype);
+ if (s->theora < 0x030200)
break;
}
- if(ptype != 0x81 && 8*header_len[i] != get_bits_count(&gb))
- av_log(avctx, AV_LOG_WARNING, "%d bits left in packet %X\n", 8*header_len[i] - get_bits_count(&gb), ptype);
- if (s->theora < 0x030200)
- break;
- }
return vp3_decode_init(avctx);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp3_parser.c b/chromium/third_party/ffmpeg/libavcodec/vp3_parser.c
index ce15309356c..7ee046c5437 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp3_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp3_parser.c
@@ -21,22 +21,24 @@
#include "parser.h"
static int parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- const uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
+ AVCodecContext *avctx,
+ const uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size)
{
- if(avctx->codec_id == AV_CODEC_ID_THEORA)
- s->pict_type= (buf[0]&0x40) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
+ if (avctx->codec_id == AV_CODEC_ID_THEORA)
+ s->pict_type = (buf[0] & 0x40) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
else
- s->pict_type= (buf[0]&0x80) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
+ s->pict_type = (buf[0] & 0x80) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
- *poutbuf = buf;
+ *poutbuf = buf;
*poutbuf_size = buf_size;
return buf_size;
}
AVCodecParser ff_vp3_parser = {
- .codec_ids = { AV_CODEC_ID_THEORA, AV_CODEC_ID_VP3, AV_CODEC_ID_VP6,
- AV_CODEC_ID_VP6F, AV_CODEC_ID_VP6A },
- .parser_parse = parse,
+ .codec_ids = {
+ AV_CODEC_ID_THEORA, AV_CODEC_ID_VP3,
+ AV_CODEC_ID_VP6, AV_CODEC_ID_VP6F, AV_CODEC_ID_VP6A
+ },
+ .parser_parse = parse,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp3data.h b/chromium/third_party/ffmpeg/libavcodec/vp3data.h
index 904ec6abf58..bffc5bcc6bd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp3data.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vp3data.h
@@ -26,175 +26,175 @@
/* these coefficients dequantize intraframe Y plane coefficients
* (note: same as JPEG) */
-static const int16_t vp31_intra_y_dequant[64] =
-{ 16, 11, 10, 16, 24, 40, 51, 61,
- 12, 12, 14, 19, 26, 58, 60, 55,
- 14, 13, 16, 24, 40, 57, 69, 56,
- 14, 17, 22, 29, 51, 87, 80, 62,
- 18, 22, 37, 58, 68, 109, 103, 77,
- 24, 35, 55, 64, 81, 104, 113, 92,
- 49, 64, 78, 87, 103, 121, 120, 101,
- 72, 92, 95, 98, 112, 100, 103, 99
+static const int16_t vp31_intra_y_dequant[64] = {
+ 16, 11, 10, 16, 24, 40, 51, 61,
+ 12, 12, 14, 19, 26, 58, 60, 55,
+ 14, 13, 16, 24, 40, 57, 69, 56,
+ 14, 17, 22, 29, 51, 87, 80, 62,
+ 18, 22, 37, 58, 68, 109, 103, 77,
+ 24, 35, 55, 64, 81, 104, 113, 92,
+ 49, 64, 78, 87, 103, 121, 120, 101,
+ 72, 92, 95, 98, 112, 100, 103, 99
};
/* these coefficients dequantize intraframe C plane coefficients
* (note: same as JPEG) */
-static const int16_t vp31_intra_c_dequant[64] =
-{ 17, 18, 24, 47, 99, 99, 99, 99,
- 18, 21, 26, 66, 99, 99, 99, 99,
- 24, 26, 56, 99, 99, 99, 99, 99,
- 47, 66, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99
+static const int16_t vp31_intra_c_dequant[64] = {
+ 17, 18, 24, 47, 99, 99, 99, 99,
+ 18, 21, 26, 66, 99, 99, 99, 99,
+ 24, 26, 56, 99, 99, 99, 99, 99,
+ 47, 66, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99
};
/* these coefficients dequantize interframe coefficients (all planes) */
-static const int16_t vp31_inter_dequant[64] =
-{ 16, 16, 16, 20, 24, 28, 32, 40,
- 16, 16, 20, 24, 28, 32, 40, 48,
- 16, 20, 24, 28, 32, 40, 48, 64,
- 20, 24, 28, 32, 40, 48, 64, 64,
- 24, 28, 32, 40, 48, 64, 64, 64,
- 28, 32, 40, 48, 64, 64, 64, 96,
- 32, 40, 48, 64, 64, 64, 96, 128,
- 40, 48, 64, 64, 64, 96, 128, 128
+static const int16_t vp31_inter_dequant[64] = {
+ 16, 16, 16, 20, 24, 28, 32, 40,
+ 16, 16, 20, 24, 28, 32, 40, 48,
+ 16, 20, 24, 28, 32, 40, 48, 64,
+ 20, 24, 28, 32, 40, 48, 64, 64,
+ 24, 28, 32, 40, 48, 64, 64, 64,
+ 28, 32, 40, 48, 64, 64, 64, 96,
+ 32, 40, 48, 64, 64, 64, 96, 128,
+ 40, 48, 64, 64, 64, 96, 128, 128
};
-static const int16_t vp31_dc_scale_factor[64] =
-{ 220, 200, 190, 180, 170, 170, 160, 160,
- 150, 150, 140, 140, 130, 130, 120, 120,
- 110, 110, 100, 100, 90, 90, 90, 80,
- 80, 80, 70, 70, 70, 60, 60, 60,
- 60, 50, 50, 50, 50, 40, 40, 40,
- 40, 40, 30, 30, 30, 30, 30, 30,
- 30, 20, 20, 20, 20, 20, 20, 20,
- 20, 10, 10, 10, 10, 10, 10, 10
+static const int16_t vp31_dc_scale_factor[64] = {
+ 220, 200, 190, 180, 170, 170, 160, 160,
+ 150, 150, 140, 140, 130, 130, 120, 120,
+ 110, 110, 100, 100, 90, 90, 90, 80,
+ 80, 80, 70, 70, 70, 60, 60, 60,
+ 60, 50, 50, 50, 50, 40, 40, 40,
+ 40, 40, 30, 30, 30, 30, 30, 30,
+ 30, 20, 20, 20, 20, 20, 20, 20,
+ 20, 10, 10, 10, 10, 10, 10, 10
};
-static const uint32_t vp31_ac_scale_factor[64] =
-{ 500, 450, 400, 370, 340, 310, 285, 265,
- 245, 225, 210, 195, 185, 180, 170, 160,
- 150, 145, 135, 130, 125, 115, 110, 107,
- 100, 96, 93, 89, 85, 82, 75, 74,
- 70, 68, 64, 60, 57, 56, 52, 50,
- 49, 45, 44, 43, 40, 38, 37, 35,
- 33, 32, 30, 29, 28, 25, 24, 22,
- 21, 19, 18, 17, 15, 13, 12, 10
+static const uint32_t vp31_ac_scale_factor[64] = {
+ 500, 450, 400, 370, 340, 310, 285, 265,
+ 245, 225, 210, 195, 185, 180, 170, 160,
+ 150, 145, 135, 130, 125, 115, 110, 107,
+ 100, 96, 93, 89, 85, 82, 75, 74,
+ 70, 68, 64, 60, 57, 56, 52, 50,
+ 49, 45, 44, 43, 40, 38, 37, 35,
+ 33, 32, 30, 29, 28, 25, 24, 22,
+ 21, 19, 18, 17, 15, 13, 12, 10
};
-static const uint8_t vp31_filter_limit_values[64] =
-{ 30, 25, 20, 20, 15, 15, 14, 14,
- 13, 13, 12, 12, 11, 11, 10, 10,
- 9, 9, 8, 8, 7, 7, 7, 7,
- 6, 6, 6, 6, 5, 5, 5, 5,
- 4, 4, 4, 4, 3, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
+static const uint8_t vp31_filter_limit_values[64] = {
+ 30, 25, 20, 20, 15, 15, 14, 14,
+ 13, 13, 12, 12, 11, 11, 10, 10,
+ 9, 9, 8, 8, 7, 7, 7, 7,
+ 6, 6, 6, 6, 5, 5, 5, 5,
+ 4, 4, 4, 4, 3, 3, 3, 3,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
};
static const uint16_t superblock_run_length_vlc_table[34][2] = {
- { 0, 1 },
+ { 0, 1 },
- { 4, 3 }, { 5, 3 },
+ { 4, 3 }, { 5, 3 },
- { 0xC, 4 }, { 0xD, 4 },
+ { 0xC, 4 }, { 0xD, 4 },
- { 0x38, 6 }, { 0x39, 6 }, { 0x3A, 6 }, { 0x3B, 6 },
+ { 0x38, 6 }, { 0x39, 6 }, { 0x3A, 6 }, { 0x3B, 6 },
- { 0xF0, 8 }, { 0xF1, 8 }, { 0xF2, 8 }, { 0xF3, 8 },
- { 0xF4, 8 }, { 0xF5, 8 }, { 0xF6, 8 }, { 0xF7, 8 },
+ { 0xF0, 8 }, { 0xF1, 8 }, { 0xF2, 8 }, { 0xF3, 8 },
+ { 0xF4, 8 }, { 0xF5, 8 }, { 0xF6, 8 }, { 0xF7, 8 },
- { 0x3E0, 10 }, { 0x3E1, 10 }, { 0x3E2, 10 }, { 0x3E3, 10 },
- { 0x3E4, 10 }, { 0x3E5, 10 }, { 0x3E6, 10 }, { 0x3E7, 10 },
- { 0x3E8, 10 }, { 0x3E9, 10 }, { 0x3EA, 10 }, { 0x3EB, 10 },
- { 0x3EC, 10 }, { 0x3ED, 10 }, { 0x3EE, 10 }, { 0x3EF, 10 },
+ { 0x3E0, 10 }, { 0x3E1, 10 }, { 0x3E2, 10 }, { 0x3E3, 10 },
+ { 0x3E4, 10 }, { 0x3E5, 10 }, { 0x3E6, 10 }, { 0x3E7, 10 },
+ { 0x3E8, 10 }, { 0x3E9, 10 }, { 0x3EA, 10 }, { 0x3EB, 10 },
+ { 0x3EC, 10 }, { 0x3ED, 10 }, { 0x3EE, 10 }, { 0x3EF, 10 },
- { 0x3F, 6 } /* this last VLC is a special case for reading 12 more
- bits from stream and adding the value 34 */
+ { 0x3F, 6 } /* this last VLC is a special case for reading 12 more
+ * bits from stream and adding the value 34 */
};
static const uint16_t fragment_run_length_vlc_table[30][2] = {
/* 1 -> 2 */
- { 0x0, 2 }, { 0x1, 2 },
+ { 0x0, 2 }, { 0x1, 2 },
/* 3 -> 4 */
- { 0x4, 3 }, { 0x5, 3 },
+ { 0x4, 3 }, { 0x5, 3 },
/* 5 -> 6 */
- { 0xC, 4 }, { 0xD, 4 },
+ { 0xC, 4 }, { 0xD, 4 },
/* 7 -> 10 */
- { 0x38, 6 }, { 0x39, 6 },
- { 0x3A, 6 }, { 0x3B, 6 },
+ { 0x38, 6 }, { 0x39, 6 },
+ { 0x3A, 6 }, { 0x3B, 6 },
/* 11 -> 14 */
- { 0x78, 7 }, { 0x79, 7 },
- { 0x7A, 7 }, { 0x7B, 7 },
+ { 0x78, 7 }, { 0x79, 7 },
+ { 0x7A, 7 }, { 0x7B, 7 },
/* 15 -> 30 */
- { 0x1F0, 9 }, { 0x1F1, 9 }, { 0x1F2, 9 }, { 0x1F3, 9 },
- { 0x1F4, 9 }, { 0x1F5, 9 }, { 0x1F6, 9 }, { 0x1F7, 9 },
- { 0x1F8, 9 }, { 0x1F9, 9 }, { 0x1FA, 9 }, { 0x1FB, 9 },
- { 0x1FC, 9 }, { 0x1FD, 9 }, { 0x1FE, 9 }, { 0x1FF, 9 }
+ { 0x1F0, 9 }, { 0x1F1, 9 }, { 0x1F2, 9 }, { 0x1F3, 9 },
+ { 0x1F4, 9 }, { 0x1F5, 9 }, { 0x1F6, 9 }, { 0x1F7, 9 },
+ { 0x1F8, 9 }, { 0x1F9, 9 }, { 0x1FA, 9 }, { 0x1FB, 9 },
+ { 0x1FC, 9 }, { 0x1FD, 9 }, { 0x1FE, 9 }, { 0x1FF, 9 }
};
static const uint8_t mode_code_vlc_table[8][2] = {
- { 0, 1 }, { 2, 2 },
- { 6, 3 }, { 14, 4 },
- { 30, 5 }, { 62, 6 },
- { 126, 7 }, { 127, 7 }
+ { 0, 1 }, { 2, 2 },
+ { 6, 3 }, { 14, 4 },
+ { 30, 5 }, { 62, 6 },
+ { 126, 7 }, { 127, 7 }
};
static const uint8_t motion_vector_vlc_table[63][2] = {
- { 0, 3 },
- { 1, 3 },
- { 2, 3 },
+ { 0, 3 },
+ { 1, 3 },
+ { 2, 3 },
- { 6, 4 }, { 7, 4 },
+ { 6, 4 }, { 7, 4 },
- { 8, 4 }, { 9, 4 },
+ { 8, 4 }, { 9, 4 },
- { 40, 6 }, { 41, 6 }, { 42, 6 }, { 43, 6 },
- { 44, 6 }, { 45, 6 }, { 46, 6 }, { 47, 6 },
+ { 40, 6 }, { 41, 6 }, { 42, 6 }, { 43, 6 },
+ { 44, 6 }, { 45, 6 }, { 46, 6 }, { 47, 6 },
- { 96, 7 }, { 97, 7 }, { 98, 7 }, { 99, 7 },
- { 100, 7 }, { 101, 7 }, { 102, 7 }, { 103, 7 },
- { 104, 7 }, { 105, 7 }, { 106, 7 }, { 107, 7 },
- { 108, 7 }, { 109, 7 }, { 110, 7 }, { 111, 7 },
+ { 96, 7 }, { 97, 7 }, { 98, 7 }, { 99, 7 },
+ { 100, 7 }, { 101, 7 }, { 102, 7 }, { 103, 7 },
+ { 104, 7 }, { 105, 7 }, { 106, 7 }, { 107, 7 },
+ { 108, 7 }, { 109, 7 }, { 110, 7 }, { 111, 7 },
- { 0xE0, 8 }, { 0xE1, 8 }, { 0xE2, 8 }, { 0xE3, 8 },
- { 0xE4, 8 }, { 0xE5, 8 }, { 0xE6, 8 }, { 0xE7, 8 },
- { 0xE8, 8 }, { 0xE9, 8 }, { 0xEA, 8 }, { 0xEB, 8 },
- { 0xEC, 8 }, { 0xED, 8 }, { 0xEE, 8 }, { 0xEF, 8 },
+ { 0xE0, 8 }, { 0xE1, 8 }, { 0xE2, 8 }, { 0xE3, 8 },
+ { 0xE4, 8 }, { 0xE5, 8 }, { 0xE6, 8 }, { 0xE7, 8 },
+ { 0xE8, 8 }, { 0xE9, 8 }, { 0xEA, 8 }, { 0xEB, 8 },
+ { 0xEC, 8 }, { 0xED, 8 }, { 0xEE, 8 }, { 0xEF, 8 },
- { 0xF0, 8 }, { 0xF1, 8 }, { 0xF2, 8 }, { 0xF3, 8 },
- { 0xF4, 8 }, { 0xF5, 8 }, { 0xF6, 8 }, { 0xF7, 8 },
- { 0xF8, 8 }, { 0xF9, 8 }, { 0xFA, 8 }, { 0xFB, 8 },
- { 0xFC, 8 }, { 0xFD, 8 }, { 0xFE, 8 }, { 0xFF, 8 }
+ { 0xF0, 8 }, { 0xF1, 8 }, { 0xF2, 8 }, { 0xF3, 8 },
+ { 0xF4, 8 }, { 0xF5, 8 }, { 0xF6, 8 }, { 0xF7, 8 },
+ { 0xF8, 8 }, { 0xF9, 8 }, { 0xFA, 8 }, { 0xFB, 8 },
+ { 0xFC, 8 }, { 0xFD, 8 }, { 0xFE, 8 }, { 0xFF, 8 }
};
static const int motion_vector_table[63] = {
- 0, 1, -1,
- 2, -2,
- 3, -3,
- 4, -4, 5, -5, 6, -6, 7, -7,
- 8, -8, 9, -9, 10, -10, 11, -11, 12, -12, 13, -13, 14, -14, 15, -15,
+ 0, 1, -1,
+ 2, -2,
+ 3, -3,
+ 4, -4, 5, -5, 6, -6, 7, -7,
+ 8, -8, 9, -9, 10, -10, 11, -11, 12, -12, 13, -13, 14, -14, 15, -15,
16, -16, 17, -17, 18, -18, 19, -19, 20, -20, 21, -21, 22, -22, 23, -23,
24, -24, 25, -25, 26, -26, 27, -27, 28, -28, 29, -29, 30, -30, 31, -31
};
static const int8_t fixed_motion_vector_table[64] = {
- 0, 0, 1, -1, 2, -2, 3, -3,
- 4, -4, 5, -5, 6, -6, 7, -7,
- 8, -8, 9, -9, 10, -10, 11, -11,
- 12, -12, 13, -13, 14, -14, 15, -15,
- 16, -16, 17, -17, 18, -18, 19, -19,
- 20, -20, 21, -21, 22, -22, 23, -23,
- 24, -24, 25, -25, 26, -26, 27, -27,
- 28, -28, 29, -29, 30, -30, 31, -31
+ 0, 0, 1, -1, 2, -2, 3, -3,
+ 4, -4, 5, -5, 6, -6, 7, -7,
+ 8, -8, 9, -9, 10, -10, 11, -11,
+ 12, -12, 13, -13, 14, -14, 15, -15,
+ 16, -16, 17, -17, 18, -18, 19, -19,
+ 20, -20, 21, -21, 22, -22, 23, -23,
+ 24, -24, 25, -25, 26, -26, 27, -27,
+ 28, -28, 29, -29, 30, -30, 31, -31
};
/* only tokens 0..6 indicate eob runs */
@@ -206,27 +206,27 @@ static const int eob_run_get_bits[7] = {
};
static const int zero_run_base[32] = {
- 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
- 0, 0, /* 7..8 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9..22 */
- 1, 2, 3, 4, 5, /* 23..27 */
- 6, 10, 1, 2 /* 28..31 */
+ 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
+ 0, 0, /* 7..8 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9..22 */
+ 1, 2, 3, 4, 5, /* 23..27 */
+ 6, 10, 1, 2 /* 28..31 */
};
static const int zero_run_get_bits[32] = {
- 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
- 3, 6, /* 7..8 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9..22 */
- 0, 0, 0, 0, 0, /* 23..27 */
- 2, 3, 0, 1 /* 28..31 */
+ 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
+ 3, 6, /* 7..8 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9..22 */
+ 0, 0, 0, 0, 0, /* 23..27 */
+ 2, 3, 0, 1 /* 28..31 */
};
static const int coeff_get_bits[32] = {
- 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
- 0, 0, 0, 0, 0, 0, /* 7..12 use constant coeffs */
- 1, 1, 1, 1, /* 13..16 are constants but still need sign bit */
- 2, 3, 4, 5, 6, 10, /* 17..22, for reading large coeffs */
- 1, 1, 1, 1, 1, 1, 1, /* 23..29 are constants but still need sign bit */
- 2, 2 /* 30..31 */
+ 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
+ 0, 0, 0, 0, 0, 0, /* 7..12 use constant coeffs */
+ 1, 1, 1, 1, /* 13..16 are constants but still need sign bit */
+ 2, 3, 4, 5, 6,10, /* 17..22, for reading large coeffs */
+ 1, 1, 1, 1, 1, 1, 1, /* 23..29 are constants but still need sign bit */
+ 2, 2 /* 30..31 */
};
static const int16_t coeff_table_token_7_8[1] = { 0 };
@@ -257,17 +257,17 @@ static const int16_t coeff_table_token_19[16] = {
};
static const int16_t coeff_table_token_20[32] = {
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36,
+ 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, 31, 32, 33, 34, 35, 36,
-21, -22, -23, -24, -25, -26, -27, -28,
-29, -30, -31, -32, -33, -34, -35, -36
};
static const int16_t coeff_table_token_21[64] = {
- 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 66, 67, 68,
+ 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 67, 68,
-37, -38, -39, -40, -41, -42, -43, -44,
-45, -46, -47, -48, -49, -50, -51, -52,
-53, -54, -55, -56, -57, -58, -59, -60,
@@ -275,74 +275,74 @@ static const int16_t coeff_table_token_21[64] = {
};
static const int16_t coeff_table_token_22[1024] = {
- 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92,
- 93, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, 104, 105, 106, 107, 108,
- 109, 110, 111, 112, 113, 114, 115, 116,
- 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 127, 128, 129, 130, 131, 132,
- 133, 134, 135, 136, 137, 138, 139, 140,
- 141, 142, 143, 144, 145, 146, 147, 148,
- 149, 150, 151, 152, 153, 154, 155, 156,
- 157, 158, 159, 160, 161, 162, 163, 164,
- 165, 166, 167, 168, 169, 170, 171, 172,
- 173, 174, 175, 176, 177, 178, 179, 180,
- 181, 182, 183, 184, 185, 186, 187, 188,
- 189, 190, 191, 192, 193, 194, 195, 196,
- 197, 198, 199, 200, 201, 202, 203, 204,
- 205, 206, 207, 208, 209, 210, 211, 212,
- 213, 214, 215, 216, 217, 218, 219, 220,
- 221, 222, 223, 224, 225, 226, 227, 228,
- 229, 230, 231, 232, 233, 234, 235, 236,
- 237, 238, 239, 240, 241, 242, 243, 244,
- 245, 246, 247, 248, 249, 250, 251, 252,
- 253, 254, 255, 256, 257, 258, 259, 260,
- 261, 262, 263, 264, 265, 266, 267, 268,
- 269, 270, 271, 272, 273, 274, 275, 276,
- 277, 278, 279, 280, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292,
- 293, 294, 295, 296, 297, 298, 299, 300,
- 301, 302, 303, 304, 305, 306, 307, 308,
- 309, 310, 311, 312, 313, 314, 315, 316,
- 317, 318, 319, 320, 321, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332,
- 333, 334, 335, 336, 337, 338, 339, 340,
- 341, 342, 343, 344, 345, 346, 347, 348,
- 349, 350, 351, 352, 353, 354, 355, 356,
- 357, 358, 359, 360, 361, 362, 363, 364,
- 365, 366, 367, 368, 369, 370, 371, 372,
- 373, 374, 375, 376, 377, 378, 379, 380,
- 381, 382, 383, 384, 385, 386, 387, 388,
- 389, 390, 391, 392, 393, 394, 395, 396,
- 397, 398, 399, 400, 401, 402, 403, 404,
- 405, 406, 407, 408, 409, 410, 411, 412,
- 413, 414, 415, 416, 417, 418, 419, 420,
- 421, 422, 423, 424, 425, 426, 427, 428,
- 429, 430, 431, 432, 433, 434, 435, 436,
- 437, 438, 439, 440, 441, 442, 443, 444,
- 445, 446, 447, 448, 449, 450, 451, 452,
- 453, 454, 455, 456, 457, 458, 459, 460,
- 461, 462, 463, 464, 465, 466, 467, 468,
- 469, 470, 471, 472, 473, 474, 475, 476,
- 477, 478, 479, 480, 481, 482, 483, 484,
- 485, 486, 487, 488, 489, 490, 491, 492,
- 493, 494, 495, 496, 497, 498, 499, 500,
- 501, 502, 503, 504, 505, 506, 507, 508,
- 509, 510, 511, 512, 513, 514, 515, 516,
- 517, 518, 519, 520, 521, 522, 523, 524,
- 525, 526, 527, 528, 529, 530, 531, 532,
- 533, 534, 535, 536, 537, 538, 539, 540,
- 541, 542, 543, 544, 545, 546, 547, 548,
- 549, 550, 551, 552, 553, 554, 555, 556,
- 557, 558, 559, 560, 561, 562, 563, 564,
- 565, 566, 567, 568, 569, 570, 571, 572,
- 573, 574, 575, 576, 577, 578, 579, 580,
- -69, -70, -71, -72, -73, -74, -75, -76,
- -77, -78, -79, -80, -81, -82, -83, -84,
- -85, -86, -87, -88, -89, -90, -91, -92,
- -93, -94, -95, -96, -97, -98, -99, -100,
+ 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, 90, 91, 92,
+ 93, 94, 95, 96, 97, 98, 99, 100,
+ 101, 102, 103, 104, 105, 106, 107, 108,
+ 109, 110, 111, 112, 113, 114, 115, 116,
+ 117, 118, 119, 120, 121, 122, 123, 124,
+ 125, 126, 127, 128, 129, 130, 131, 132,
+ 133, 134, 135, 136, 137, 138, 139, 140,
+ 141, 142, 143, 144, 145, 146, 147, 148,
+ 149, 150, 151, 152, 153, 154, 155, 156,
+ 157, 158, 159, 160, 161, 162, 163, 164,
+ 165, 166, 167, 168, 169, 170, 171, 172,
+ 173, 174, 175, 176, 177, 178, 179, 180,
+ 181, 182, 183, 184, 185, 186, 187, 188,
+ 189, 190, 191, 192, 193, 194, 195, 196,
+ 197, 198, 199, 200, 201, 202, 203, 204,
+ 205, 206, 207, 208, 209, 210, 211, 212,
+ 213, 214, 215, 216, 217, 218, 219, 220,
+ 221, 222, 223, 224, 225, 226, 227, 228,
+ 229, 230, 231, 232, 233, 234, 235, 236,
+ 237, 238, 239, 240, 241, 242, 243, 244,
+ 245, 246, 247, 248, 249, 250, 251, 252,
+ 253, 254, 255, 256, 257, 258, 259, 260,
+ 261, 262, 263, 264, 265, 266, 267, 268,
+ 269, 270, 271, 272, 273, 274, 275, 276,
+ 277, 278, 279, 280, 281, 282, 283, 284,
+ 285, 286, 287, 288, 289, 290, 291, 292,
+ 293, 294, 295, 296, 297, 298, 299, 300,
+ 301, 302, 303, 304, 305, 306, 307, 308,
+ 309, 310, 311, 312, 313, 314, 315, 316,
+ 317, 318, 319, 320, 321, 322, 323, 324,
+ 325, 326, 327, 328, 329, 330, 331, 332,
+ 333, 334, 335, 336, 337, 338, 339, 340,
+ 341, 342, 343, 344, 345, 346, 347, 348,
+ 349, 350, 351, 352, 353, 354, 355, 356,
+ 357, 358, 359, 360, 361, 362, 363, 364,
+ 365, 366, 367, 368, 369, 370, 371, 372,
+ 373, 374, 375, 376, 377, 378, 379, 380,
+ 381, 382, 383, 384, 385, 386, 387, 388,
+ 389, 390, 391, 392, 393, 394, 395, 396,
+ 397, 398, 399, 400, 401, 402, 403, 404,
+ 405, 406, 407, 408, 409, 410, 411, 412,
+ 413, 414, 415, 416, 417, 418, 419, 420,
+ 421, 422, 423, 424, 425, 426, 427, 428,
+ 429, 430, 431, 432, 433, 434, 435, 436,
+ 437, 438, 439, 440, 441, 442, 443, 444,
+ 445, 446, 447, 448, 449, 450, 451, 452,
+ 453, 454, 455, 456, 457, 458, 459, 460,
+ 461, 462, 463, 464, 465, 466, 467, 468,
+ 469, 470, 471, 472, 473, 474, 475, 476,
+ 477, 478, 479, 480, 481, 482, 483, 484,
+ 485, 486, 487, 488, 489, 490, 491, 492,
+ 493, 494, 495, 496, 497, 498, 499, 500,
+ 501, 502, 503, 504, 505, 506, 507, 508,
+ 509, 510, 511, 512, 513, 514, 515, 516,
+ 517, 518, 519, 520, 521, 522, 523, 524,
+ 525, 526, 527, 528, 529, 530, 531, 532,
+ 533, 534, 535, 536, 537, 538, 539, 540,
+ 541, 542, 543, 544, 545, 546, 547, 548,
+ 549, 550, 551, 552, 553, 554, 555, 556,
+ 557, 558, 559, 560, 561, 562, 563, 564,
+ 565, 566, 567, 568, 569, 570, 571, 572,
+ 573, 574, 575, 576, 577, 578, 579, 580,
+ -69, -70, -71, -72, -73, -74, -75, -76,
+ -77, -78, -79, -80, -81, -82, -83, -84,
+ -85, -86, -87, -88, -89, -90, -91, -92,
+ -93, -94, -95, -96, -97, -98, -99, -100,
-101, -102, -103, -104, -105, -106, -107, -108,
-109, -110, -111, -112, -113, -114, -115, -116,
-117, -118, -119, -120, -121, -122, -123, -124,
@@ -444,2738 +444,2738 @@ static const int16_t *const coeff_tables[32] = {
};
static const uint16_t dc_bias[16][32][2] = {
- { /* DC bias table 0 */
- { 0x2D, 6 },
- { 0x26, 7 },
- { 0x166, 9 },
- { 0x4E, 8 },
- { 0x2CE, 10 },
- { 0x59E, 11 },
- { 0x27D, 11 },
- { 0x8, 5 },
- { 0x4F9, 12 },
- { 0xF, 4 },
- { 0xE, 4 },
- { 0x1B, 5 },
- { 0x6, 4 },
- { 0x8, 4 },
- { 0x5, 4 },
- { 0x1A, 5 },
- { 0x15, 5 },
- { 0x7, 4 },
- { 0xC, 4 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0x9, 4 },
- { 0x17, 5 },
- { 0x29, 6 },
- { 0x28, 6 },
- { 0xB2, 8 },
- { 0x4F8, 12 },
- { 0x59F, 11 },
- { 0x9E, 9 },
- { 0x13F, 10 },
- { 0x12, 6 },
- { 0x58, 7 }
- },
- { /* DC bias table 1 */
- { 0x10, 5 },
- { 0x47, 7 },
- { 0x1FF, 9 },
- { 0x8C, 8 },
- { 0x3FC, 10 },
- { 0x46A, 11 },
- { 0x469, 11 },
- { 0x22, 6 },
- { 0x11A1, 13 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0x4, 4 },
- { 0x5, 4 },
- { 0x9, 4 },
- { 0x6, 4 },
- { 0x1E, 5 },
- { 0x16, 5 },
- { 0x7, 4 },
- { 0xC, 4 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xA, 4 },
- { 0x17, 5 },
- { 0x7D, 7 },
- { 0x7E, 7 },
- { 0x11B, 9 },
- { 0x8D1, 12 },
- { 0x3FD, 10 },
- { 0x46B, 11 },
- { 0x11A0, 13 },
- { 0x7C, 7 },
- { 0xFE, 8 }
- },
- { /* DC bias table 2 */
- { 0x16, 5 },
- { 0x20, 6 },
- { 0x86, 8 },
- { 0x87, 8 },
- { 0x367, 10 },
- { 0x6CC, 11 },
- { 0x6CB, 11 },
- { 0x6E, 7 },
- { 0x366D, 14 },
- { 0xF, 4 },
- { 0xE, 4 },
- { 0x4, 4 },
- { 0x5, 4 },
- { 0xA, 4 },
- { 0x6, 4 },
- { 0x1A, 5 },
- { 0x11, 5 },
- { 0x7, 4 },
- { 0xC, 4 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0x9, 4 },
- { 0x17, 5 },
- { 0x6F, 7 },
- { 0x6D, 7 },
- { 0x364, 10 },
- { 0xD9A, 12 },
- { 0x6CA, 11 },
- { 0x1B37, 13 },
- { 0x366C, 14 },
- { 0x42, 7 },
- { 0xD8, 8 }
- },
- { /* DC bias table 3 */
- { 0x0, 4 },
- { 0x2D, 6 },
- { 0xF7, 8 },
- { 0x58, 7 },
- { 0x167, 9 },
- { 0x2CB, 10 },
- { 0x2CA, 10 },
- { 0xE, 6 },
- { 0x1661, 13 },
- { 0x3, 3 },
- { 0x2, 3 },
- { 0x8, 4 },
- { 0x9, 4 },
- { 0xD, 4 },
- { 0x2, 4 },
- { 0x1F, 5 },
- { 0x17, 5 },
- { 0x1, 4 },
- { 0xC, 4 },
- { 0xE, 4 },
- { 0xA, 4 },
- { 0x6, 5 },
- { 0x78, 7 },
- { 0xF, 6 },
- { 0x7A, 7 },
- { 0x164, 9 },
- { 0x599, 11 },
- { 0x2CD, 10 },
- { 0xB31, 12 },
- { 0x1660, 13 },
- { 0x79, 7 },
- { 0xF6, 8 }
- },
- { /* DC bias table 4 */
- { 0x3, 4 },
- { 0x3C, 6 },
- { 0xF, 7 },
- { 0x7A, 7 },
- { 0x1D, 8 },
- { 0x20, 9 },
- { 0x72, 10 },
- { 0x6, 6 },
- { 0x399, 13 },
- { 0x4, 3 },
- { 0x5, 3 },
- { 0x5, 4 },
- { 0x6, 4 },
- { 0xE, 4 },
- { 0x4, 4 },
- { 0x0, 4 },
- { 0x19, 5 },
- { 0x2, 4 },
- { 0xD, 4 },
- { 0x7, 4 },
- { 0x1F, 5 },
- { 0x30, 6 },
- { 0x11, 8 },
- { 0x31, 6 },
- { 0x5, 6 },
- { 0x21, 9 },
- { 0xE7, 11 },
- { 0x38, 9 },
- { 0x1CD, 12 },
- { 0x398, 13 },
- { 0x7B, 7 },
- { 0x9, 7 }
- },
- { /* DC bias table 5 */
- { 0x9, 4 },
- { 0x2, 5 },
- { 0x74, 7 },
- { 0x7, 6 },
- { 0xEC, 8 },
- { 0xD1, 9 },
- { 0x1A6, 10 },
- { 0x6, 6 },
- { 0xD21, 13 },
- { 0x5, 3 },
- { 0x6, 3 },
- { 0x8, 4 },
- { 0x7, 4 },
- { 0xF, 4 },
- { 0x4, 4 },
- { 0x0, 4 },
- { 0x1C, 5 },
- { 0x2, 4 },
- { 0x5, 4 },
- { 0x3, 4 },
- { 0xC, 5 },
- { 0x35, 7 },
- { 0x1A7, 10 },
- { 0x1B, 6 },
- { 0x77, 7 },
- { 0x1A5, 10 },
- { 0x349, 11 },
- { 0xD0, 9 },
- { 0x691, 12 },
- { 0xD20, 13 },
- { 0x75, 7 },
- { 0xED, 8 }
- },
- { /* DC bias table 6 */
- { 0xA, 4 },
- { 0xC, 5 },
- { 0x12, 6 },
- { 0x1B, 6 },
- { 0xB7, 8 },
- { 0x16C, 9 },
- { 0x99, 9 },
- { 0x5A, 7 },
- { 0x16D8, 13 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x0, 3 },
- { 0x5, 4 },
- { 0x17, 5 },
- { 0xE, 5 },
- { 0x2, 4 },
- { 0x3, 4 },
- { 0xF, 5 },
- { 0x1A, 6 },
- { 0x4D, 8 },
- { 0x2DB3, 14 },
- { 0x2C, 6 },
- { 0x11, 6 },
- { 0x2DA, 10 },
- { 0x5B7, 11 },
- { 0x98, 9 },
- { 0xB6D, 12 },
- { 0x2DB2, 14 },
- { 0x10, 6 },
- { 0x27, 7 }
- },
- { /* DC bias table 7 */
- { 0xD, 4 },
- { 0xF, 5 },
- { 0x1D, 6 },
- { 0x8, 5 },
- { 0x51, 7 },
- { 0x56, 8 },
- { 0xAF, 9 },
- { 0x2A, 7 },
- { 0x148A, 13 },
- { 0x7, 3 },
- { 0x0, 2 },
- { 0x8, 4 },
- { 0x9, 4 },
- { 0xC, 4 },
- { 0x6, 4 },
- { 0x17, 5 },
- { 0xB, 5 },
- { 0x16, 5 },
- { 0x15, 5 },
- { 0x9, 5 },
- { 0x50, 7 },
- { 0xAE, 9 },
- { 0x2917, 14 },
- { 0x1C, 6 },
- { 0x14, 6 },
- { 0x290, 10 },
- { 0x523, 11 },
- { 0x149, 9 },
- { 0xA44, 12 },
- { 0x2916, 14 },
- { 0x53, 7 },
- { 0xA5, 8 }
- },
- { /* DC bias table 8 */
- { 0x1, 4 },
- { 0x1D, 6 },
- { 0xF5, 8 },
- { 0xF4, 8 },
- { 0x24D, 10 },
- { 0x499, 11 },
- { 0x498, 11 },
- { 0x1, 5 },
- { 0x21, 6 },
- { 0x6, 3 },
- { 0x5, 3 },
- { 0x6, 4 },
- { 0x5, 4 },
- { 0x2, 4 },
- { 0x7, 5 },
- { 0x25, 6 },
- { 0x7B, 7 },
- { 0x1C, 6 },
- { 0x20, 6 },
- { 0xD, 6 },
- { 0x48, 7 },
- { 0x92, 8 },
- { 0x127, 9 },
- { 0xE, 4 },
- { 0x4, 4 },
- { 0x11, 5 },
- { 0xC, 6 },
- { 0x3C, 6 },
- { 0xF, 5 },
- { 0x0, 5 },
- { 0x1F, 5 },
- { 0x13, 5 }
- },
- { /* DC bias table 9 */
- { 0x5, 4 },
- { 0x3C, 6 },
- { 0x40, 7 },
- { 0xD, 7 },
- { 0x31, 9 },
- { 0x61, 10 },
- { 0x60, 10 },
- { 0x2, 5 },
- { 0xF5, 8 },
- { 0x6, 3 },
- { 0x5, 3 },
- { 0x7, 4 },
- { 0x6, 4 },
- { 0x2, 4 },
- { 0x9, 5 },
- { 0x25, 6 },
- { 0x7, 6 },
- { 0x21, 6 },
- { 0x24, 6 },
- { 0x10, 6 },
- { 0x41, 7 },
- { 0xF4, 8 },
- { 0x19, 8 },
- { 0xE, 4 },
- { 0x3, 4 },
- { 0x11, 5 },
- { 0x11, 6 },
- { 0x3F, 6 },
- { 0x3E, 6 },
- { 0x7B, 7 },
- { 0x0, 4 },
- { 0x13, 5 }
- },
- { /* DC bias table 10 */
- { 0xA, 4 },
- { 0x7, 5 },
- { 0x1, 6 },
- { 0x9, 6 },
- { 0x131, 9 },
- { 0x261, 10 },
- { 0x260, 10 },
- { 0x15, 6 },
- { 0x1, 7 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x8, 4 },
- { 0x7, 4 },
- { 0x6, 4 },
- { 0x12, 5 },
- { 0x2F, 6 },
- { 0x14, 6 },
- { 0x27, 6 },
- { 0x2D, 6 },
- { 0x16, 6 },
- { 0x4D, 7 },
- { 0x99, 8 },
- { 0x0, 7 },
- { 0x4, 4 },
- { 0x1, 4 },
- { 0x5, 5 },
- { 0x17, 6 },
- { 0x2E, 6 },
- { 0x2C, 6 },
- { 0x8, 6 },
- { 0x6, 5 },
- { 0x1, 5 }
- },
- { /* DC bias table 11 */
- { 0x0, 3 },
- { 0xE, 5 },
- { 0x17, 6 },
- { 0x2A, 6 },
- { 0x10, 7 },
- { 0xF9, 10 },
- { 0xF8, 10 },
- { 0x1E, 7 },
- { 0x3F, 8 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x6, 4 },
- { 0xF, 5 },
- { 0x5, 5 },
- { 0x16, 6 },
- { 0x29, 6 },
- { 0x2B, 6 },
- { 0x15, 6 },
- { 0x50, 7 },
- { 0x11, 7 },
- { 0x7D, 9 },
- { 0x4, 4 },
- { 0x17, 5 },
- { 0x6, 5 },
- { 0x14, 6 },
- { 0x2C, 6 },
- { 0x2D, 6 },
- { 0xE, 6 },
- { 0x9, 6 },
- { 0x51, 7 }
- },
- { /* DC bias table 12 */
- { 0x2, 3 },
- { 0x18, 5 },
- { 0x2F, 6 },
- { 0xD, 5 },
- { 0x53, 7 },
- { 0x295, 10 },
- { 0x294, 10 },
- { 0xA4, 8 },
- { 0x7C, 8 },
- { 0x0, 2 },
- { 0x7, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x1B, 5 },
- { 0xC, 5 },
- { 0x28, 6 },
- { 0x6A, 7 },
- { 0x1E, 6 },
- { 0x1D, 6 },
- { 0x69, 7 },
- { 0xD7, 8 },
- { 0x7D, 8 },
- { 0x14B, 9 },
- { 0x19, 5 },
- { 0x16, 5 },
- { 0x2E, 6 },
- { 0x1C, 6 },
- { 0x2B, 6 },
- { 0x2A, 6 },
- { 0x68, 7 },
- { 0x3F, 7 },
- { 0xD6, 8 }
- },
- { /* DC bias table 13 */
- { 0x2, 3 },
- { 0x1B, 5 },
- { 0xC, 5 },
- { 0x18, 5 },
- { 0x29, 6 },
- { 0x7F, 8 },
- { 0x2F0, 10 },
- { 0x198, 9 },
- { 0x179, 9 },
- { 0x0, 2 },
- { 0x7, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x1A, 5 },
- { 0xD, 5 },
- { 0x2A, 6 },
- { 0x64, 7 },
- { 0x1E, 6 },
- { 0x67, 7 },
- { 0x5F, 7 },
- { 0xCD, 8 },
- { 0x7E, 8 },
- { 0x2F1, 10 },
- { 0x16, 5 },
- { 0xE, 5 },
- { 0x2E, 6 },
- { 0x65, 7 },
- { 0x2B, 6 },
- { 0x28, 6 },
- { 0x3E, 7 },
- { 0xBD, 8 },
- { 0x199, 9 }
- },
- { /* DC bias table 14 */
- { 0x2, 3 },
- { 0x7, 4 },
- { 0x16, 5 },
- { 0x6, 4 },
- { 0x36, 6 },
- { 0x5C, 7 },
- { 0x15D, 9 },
- { 0x15C, 9 },
- { 0x2BF, 10 },
- { 0x0, 2 },
- { 0x7, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x18, 5 },
- { 0x34, 6 },
- { 0x2A, 6 },
- { 0x5E, 7 },
- { 0x6A, 7 },
- { 0x64, 7 },
- { 0x5D, 7 },
- { 0xCB, 8 },
- { 0xAD, 8 },
- { 0x2BE, 10 },
- { 0x14, 5 },
- { 0x33, 6 },
- { 0x6E, 7 },
- { 0x5F, 7 },
- { 0x6F, 7 },
- { 0x6B, 7 },
- { 0xCA, 8 },
- { 0xAC, 8 },
- { 0x15E, 9 }
- },
- { /* DC bias table 15 */
- { 0xF, 4 },
- { 0x1D, 5 },
- { 0x18, 5 },
- { 0xB, 4 },
- { 0x19, 5 },
- { 0x29, 6 },
- { 0xD6, 8 },
- { 0x551, 11 },
- { 0xAA1, 12 },
- { 0x1, 2 },
- { 0x0, 2 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x1B, 5 },
- { 0x38, 6 },
- { 0x28, 6 },
- { 0x57, 7 },
- { 0x6A, 7 },
- { 0x68, 7 },
- { 0x56, 7 },
- { 0xE5, 8 },
- { 0x155, 9 },
- { 0xAA0, 12 },
- { 0x73, 7 },
- { 0x69, 7 },
- { 0xD7, 8 },
- { 0xAB, 8 },
- { 0xE4, 8 },
- { 0xA9, 8 },
- { 0x151, 9 },
- { 0x150, 9 },
- { 0x2A9, 10 }
- }
+ { /* DC bias table 0 */
+ { 0x2D, 6 },
+ { 0x26, 7 },
+ { 0x166, 9 },
+ { 0x4E, 8 },
+ { 0x2CE, 10 },
+ { 0x59E, 11 },
+ { 0x27D, 11 },
+ { 0x8, 5 },
+ { 0x4F9, 12 },
+ { 0xF, 4 },
+ { 0xE, 4 },
+ { 0x1B, 5 },
+ { 0x6, 4 },
+ { 0x8, 4 },
+ { 0x5, 4 },
+ { 0x1A, 5 },
+ { 0x15, 5 },
+ { 0x7, 4 },
+ { 0xC, 4 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0x9, 4 },
+ { 0x17, 5 },
+ { 0x29, 6 },
+ { 0x28, 6 },
+ { 0xB2, 8 },
+ { 0x4F8, 12 },
+ { 0x59F, 11 },
+ { 0x9E, 9 },
+ { 0x13F, 10 },
+ { 0x12, 6 },
+ { 0x58, 7 }
+ },
+ { /* DC bias table 1 */
+ { 0x10, 5 },
+ { 0x47, 7 },
+ { 0x1FF, 9 },
+ { 0x8C, 8 },
+ { 0x3FC, 10 },
+ { 0x46A, 11 },
+ { 0x469, 11 },
+ { 0x22, 6 },
+ { 0x11A1, 13 },
+ { 0xE, 4 },
+ { 0xD, 4 },
+ { 0x4, 4 },
+ { 0x5, 4 },
+ { 0x9, 4 },
+ { 0x6, 4 },
+ { 0x1E, 5 },
+ { 0x16, 5 },
+ { 0x7, 4 },
+ { 0xC, 4 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0xA, 4 },
+ { 0x17, 5 },
+ { 0x7D, 7 },
+ { 0x7E, 7 },
+ { 0x11B, 9 },
+ { 0x8D1, 12 },
+ { 0x3FD, 10 },
+ { 0x46B, 11 },
+ { 0x11A0, 13 },
+ { 0x7C, 7 },
+ { 0xFE, 8 }
+ },
+ { /* DC bias table 2 */
+ { 0x16, 5 },
+ { 0x20, 6 },
+ { 0x86, 8 },
+ { 0x87, 8 },
+ { 0x367, 10 },
+ { 0x6CC, 11 },
+ { 0x6CB, 11 },
+ { 0x6E, 7 },
+ { 0x366D, 14 },
+ { 0xF, 4 },
+ { 0xE, 4 },
+ { 0x4, 4 },
+ { 0x5, 4 },
+ { 0xA, 4 },
+ { 0x6, 4 },
+ { 0x1A, 5 },
+ { 0x11, 5 },
+ { 0x7, 4 },
+ { 0xC, 4 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0x9, 4 },
+ { 0x17, 5 },
+ { 0x6F, 7 },
+ { 0x6D, 7 },
+ { 0x364, 10 },
+ { 0xD9A, 12 },
+ { 0x6CA, 11 },
+ { 0x1B37, 13 },
+ { 0x366C, 14 },
+ { 0x42, 7 },
+ { 0xD8, 8 }
+ },
+ { /* DC bias table 3 */
+ { 0x0, 4 },
+ { 0x2D, 6 },
+ { 0xF7, 8 },
+ { 0x58, 7 },
+ { 0x167, 9 },
+ { 0x2CB, 10 },
+ { 0x2CA, 10 },
+ { 0xE, 6 },
+ { 0x1661, 13 },
+ { 0x3, 3 },
+ { 0x2, 3 },
+ { 0x8, 4 },
+ { 0x9, 4 },
+ { 0xD, 4 },
+ { 0x2, 4 },
+ { 0x1F, 5 },
+ { 0x17, 5 },
+ { 0x1, 4 },
+ { 0xC, 4 },
+ { 0xE, 4 },
+ { 0xA, 4 },
+ { 0x6, 5 },
+ { 0x78, 7 },
+ { 0xF, 6 },
+ { 0x7A, 7 },
+ { 0x164, 9 },
+ { 0x599, 11 },
+ { 0x2CD, 10 },
+ { 0xB31, 12 },
+ { 0x1660, 13 },
+ { 0x79, 7 },
+ { 0xF6, 8 }
+ },
+ { /* DC bias table 4 */
+ { 0x3, 4 },
+ { 0x3C, 6 },
+ { 0xF, 7 },
+ { 0x7A, 7 },
+ { 0x1D, 8 },
+ { 0x20, 9 },
+ { 0x72, 10 },
+ { 0x6, 6 },
+ { 0x399, 13 },
+ { 0x4, 3 },
+ { 0x5, 3 },
+ { 0x5, 4 },
+ { 0x6, 4 },
+ { 0xE, 4 },
+ { 0x4, 4 },
+ { 0x0, 4 },
+ { 0x19, 5 },
+ { 0x2, 4 },
+ { 0xD, 4 },
+ { 0x7, 4 },
+ { 0x1F, 5 },
+ { 0x30, 6 },
+ { 0x11, 8 },
+ { 0x31, 6 },
+ { 0x5, 6 },
+ { 0x21, 9 },
+ { 0xE7, 11 },
+ { 0x38, 9 },
+ { 0x1CD, 12 },
+ { 0x398, 13 },
+ { 0x7B, 7 },
+ { 0x9, 7 }
+ },
+ { /* DC bias table 5 */
+ { 0x9, 4 },
+ { 0x2, 5 },
+ { 0x74, 7 },
+ { 0x7, 6 },
+ { 0xEC, 8 },
+ { 0xD1, 9 },
+ { 0x1A6, 10 },
+ { 0x6, 6 },
+ { 0xD21, 13 },
+ { 0x5, 3 },
+ { 0x6, 3 },
+ { 0x8, 4 },
+ { 0x7, 4 },
+ { 0xF, 4 },
+ { 0x4, 4 },
+ { 0x0, 4 },
+ { 0x1C, 5 },
+ { 0x2, 4 },
+ { 0x5, 4 },
+ { 0x3, 4 },
+ { 0xC, 5 },
+ { 0x35, 7 },
+ { 0x1A7, 10 },
+ { 0x1B, 6 },
+ { 0x77, 7 },
+ { 0x1A5, 10 },
+ { 0x349, 11 },
+ { 0xD0, 9 },
+ { 0x691, 12 },
+ { 0xD20, 13 },
+ { 0x75, 7 },
+ { 0xED, 8 }
+ },
+ { /* DC bias table 6 */
+ { 0xA, 4 },
+ { 0xC, 5 },
+ { 0x12, 6 },
+ { 0x1B, 6 },
+ { 0xB7, 8 },
+ { 0x16C, 9 },
+ { 0x99, 9 },
+ { 0x5A, 7 },
+ { 0x16D8, 13 },
+ { 0x7, 3 },
+ { 0x6, 3 },
+ { 0x9, 4 },
+ { 0x8, 4 },
+ { 0x0, 3 },
+ { 0x5, 4 },
+ { 0x17, 5 },
+ { 0xE, 5 },
+ { 0x2, 4 },
+ { 0x3, 4 },
+ { 0xF, 5 },
+ { 0x1A, 6 },
+ { 0x4D, 8 },
+ { 0x2DB3, 14 },
+ { 0x2C, 6 },
+ { 0x11, 6 },
+ { 0x2DA, 10 },
+ { 0x5B7, 11 },
+ { 0x98, 9 },
+ { 0xB6D, 12 },
+ { 0x2DB2, 14 },
+ { 0x10, 6 },
+ { 0x27, 7 }
+ },
+ { /* DC bias table 7 */
+ { 0xD, 4 },
+ { 0xF, 5 },
+ { 0x1D, 6 },
+ { 0x8, 5 },
+ { 0x51, 7 },
+ { 0x56, 8 },
+ { 0xAF, 9 },
+ { 0x2A, 7 },
+ { 0x148A, 13 },
+ { 0x7, 3 },
+ { 0x0, 2 },
+ { 0x8, 4 },
+ { 0x9, 4 },
+ { 0xC, 4 },
+ { 0x6, 4 },
+ { 0x17, 5 },
+ { 0xB, 5 },
+ { 0x16, 5 },
+ { 0x15, 5 },
+ { 0x9, 5 },
+ { 0x50, 7 },
+ { 0xAE, 9 },
+ { 0x2917, 14 },
+ { 0x1C, 6 },
+ { 0x14, 6 },
+ { 0x290, 10 },
+ { 0x523, 11 },
+ { 0x149, 9 },
+ { 0xA44, 12 },
+ { 0x2916, 14 },
+ { 0x53, 7 },
+ { 0xA5, 8 }
+ },
+ { /* DC bias table 8 */
+ { 0x1, 4 },
+ { 0x1D, 6 },
+ { 0xF5, 8 },
+ { 0xF4, 8 },
+ { 0x24D, 10 },
+ { 0x499, 11 },
+ { 0x498, 11 },
+ { 0x1, 5 },
+ { 0x21, 6 },
+ { 0x6, 3 },
+ { 0x5, 3 },
+ { 0x6, 4 },
+ { 0x5, 4 },
+ { 0x2, 4 },
+ { 0x7, 5 },
+ { 0x25, 6 },
+ { 0x7B, 7 },
+ { 0x1C, 6 },
+ { 0x20, 6 },
+ { 0xD, 6 },
+ { 0x48, 7 },
+ { 0x92, 8 },
+ { 0x127, 9 },
+ { 0xE, 4 },
+ { 0x4, 4 },
+ { 0x11, 5 },
+ { 0xC, 6 },
+ { 0x3C, 6 },
+ { 0xF, 5 },
+ { 0x0, 5 },
+ { 0x1F, 5 },
+ { 0x13, 5 }
+ },
+ { /* DC bias table 9 */
+ { 0x5, 4 },
+ { 0x3C, 6 },
+ { 0x40, 7 },
+ { 0xD, 7 },
+ { 0x31, 9 },
+ { 0x61, 10 },
+ { 0x60, 10 },
+ { 0x2, 5 },
+ { 0xF5, 8 },
+ { 0x6, 3 },
+ { 0x5, 3 },
+ { 0x7, 4 },
+ { 0x6, 4 },
+ { 0x2, 4 },
+ { 0x9, 5 },
+ { 0x25, 6 },
+ { 0x7, 6 },
+ { 0x21, 6 },
+ { 0x24, 6 },
+ { 0x10, 6 },
+ { 0x41, 7 },
+ { 0xF4, 8 },
+ { 0x19, 8 },
+ { 0xE, 4 },
+ { 0x3, 4 },
+ { 0x11, 5 },
+ { 0x11, 6 },
+ { 0x3F, 6 },
+ { 0x3E, 6 },
+ { 0x7B, 7 },
+ { 0x0, 4 },
+ { 0x13, 5 }
+ },
+ { /* DC bias table 10 */
+ { 0xA, 4 },
+ { 0x7, 5 },
+ { 0x1, 6 },
+ { 0x9, 6 },
+ { 0x131, 9 },
+ { 0x261, 10 },
+ { 0x260, 10 },
+ { 0x15, 6 },
+ { 0x1, 7 },
+ { 0x7, 3 },
+ { 0x6, 3 },
+ { 0x8, 4 },
+ { 0x7, 4 },
+ { 0x6, 4 },
+ { 0x12, 5 },
+ { 0x2F, 6 },
+ { 0x14, 6 },
+ { 0x27, 6 },
+ { 0x2D, 6 },
+ { 0x16, 6 },
+ { 0x4D, 7 },
+ { 0x99, 8 },
+ { 0x0, 7 },
+ { 0x4, 4 },
+ { 0x1, 4 },
+ { 0x5, 5 },
+ { 0x17, 6 },
+ { 0x2E, 6 },
+ { 0x2C, 6 },
+ { 0x8, 6 },
+ { 0x6, 5 },
+ { 0x1, 5 }
+ },
+ { /* DC bias table 11 */
+ { 0x0, 3 },
+ { 0xE, 5 },
+ { 0x17, 6 },
+ { 0x2A, 6 },
+ { 0x10, 7 },
+ { 0xF9, 10 },
+ { 0xF8, 10 },
+ { 0x1E, 7 },
+ { 0x3F, 8 },
+ { 0x7, 3 },
+ { 0x6, 3 },
+ { 0x9, 4 },
+ { 0x8, 4 },
+ { 0x6, 4 },
+ { 0xF, 5 },
+ { 0x5, 5 },
+ { 0x16, 6 },
+ { 0x29, 6 },
+ { 0x2B, 6 },
+ { 0x15, 6 },
+ { 0x50, 7 },
+ { 0x11, 7 },
+ { 0x7D, 9 },
+ { 0x4, 4 },
+ { 0x17, 5 },
+ { 0x6, 5 },
+ { 0x14, 6 },
+ { 0x2C, 6 },
+ { 0x2D, 6 },
+ { 0xE, 6 },
+ { 0x9, 6 },
+ { 0x51, 7 }
+ },
+ { /* DC bias table 12 */
+ { 0x2, 3 },
+ { 0x18, 5 },
+ { 0x2F, 6 },
+ { 0xD, 5 },
+ { 0x53, 7 },
+ { 0x295, 10 },
+ { 0x294, 10 },
+ { 0xA4, 8 },
+ { 0x7C, 8 },
+ { 0x0, 2 },
+ { 0x7, 3 },
+ { 0x9, 4 },
+ { 0x8, 4 },
+ { 0x1B, 5 },
+ { 0xC, 5 },
+ { 0x28, 6 },
+ { 0x6A, 7 },
+ { 0x1E, 6 },
+ { 0x1D, 6 },
+ { 0x69, 7 },
+ { 0xD7, 8 },
+ { 0x7D, 8 },
+ { 0x14B, 9 },
+ { 0x19, 5 },
+ { 0x16, 5 },
+ { 0x2E, 6 },
+ { 0x1C, 6 },
+ { 0x2B, 6 },
+ { 0x2A, 6 },
+ { 0x68, 7 },
+ { 0x3F, 7 },
+ { 0xD6, 8 }
+ },
+ { /* DC bias table 13 */
+ { 0x2, 3 },
+ { 0x1B, 5 },
+ { 0xC, 5 },
+ { 0x18, 5 },
+ { 0x29, 6 },
+ { 0x7F, 8 },
+ { 0x2F0, 10 },
+ { 0x198, 9 },
+ { 0x179, 9 },
+ { 0x0, 2 },
+ { 0x7, 3 },
+ { 0x9, 4 },
+ { 0x8, 4 },
+ { 0x1A, 5 },
+ { 0xD, 5 },
+ { 0x2A, 6 },
+ { 0x64, 7 },
+ { 0x1E, 6 },
+ { 0x67, 7 },
+ { 0x5F, 7 },
+ { 0xCD, 8 },
+ { 0x7E, 8 },
+ { 0x2F1, 10 },
+ { 0x16, 5 },
+ { 0xE, 5 },
+ { 0x2E, 6 },
+ { 0x65, 7 },
+ { 0x2B, 6 },
+ { 0x28, 6 },
+ { 0x3E, 7 },
+ { 0xBD, 8 },
+ { 0x199, 9 }
+ },
+ { /* DC bias table 14 */
+ { 0x2, 3 },
+ { 0x7, 4 },
+ { 0x16, 5 },
+ { 0x6, 4 },
+ { 0x36, 6 },
+ { 0x5C, 7 },
+ { 0x15D, 9 },
+ { 0x15C, 9 },
+ { 0x2BF, 10 },
+ { 0x0, 2 },
+ { 0x7, 3 },
+ { 0x9, 4 },
+ { 0x8, 4 },
+ { 0x18, 5 },
+ { 0x34, 6 },
+ { 0x2A, 6 },
+ { 0x5E, 7 },
+ { 0x6A, 7 },
+ { 0x64, 7 },
+ { 0x5D, 7 },
+ { 0xCB, 8 },
+ { 0xAD, 8 },
+ { 0x2BE, 10 },
+ { 0x14, 5 },
+ { 0x33, 6 },
+ { 0x6E, 7 },
+ { 0x5F, 7 },
+ { 0x6F, 7 },
+ { 0x6B, 7 },
+ { 0xCA, 8 },
+ { 0xAC, 8 },
+ { 0x15E, 9 }
+ },
+ { /* DC bias table 15 */
+ { 0xF, 4 },
+ { 0x1D, 5 },
+ { 0x18, 5 },
+ { 0xB, 4 },
+ { 0x19, 5 },
+ { 0x29, 6 },
+ { 0xD6, 8 },
+ { 0x551, 11 },
+ { 0xAA1, 12 },
+ { 0x1, 2 },
+ { 0x0, 2 },
+ { 0x9, 4 },
+ { 0x8, 4 },
+ { 0x1B, 5 },
+ { 0x38, 6 },
+ { 0x28, 6 },
+ { 0x57, 7 },
+ { 0x6A, 7 },
+ { 0x68, 7 },
+ { 0x56, 7 },
+ { 0xE5, 8 },
+ { 0x155, 9 },
+ { 0xAA0, 12 },
+ { 0x73, 7 },
+ { 0x69, 7 },
+ { 0xD7, 8 },
+ { 0xAB, 8 },
+ { 0xE4, 8 },
+ { 0xA9, 8 },
+ { 0x151, 9 },
+ { 0x150, 9 },
+ { 0x2A9, 10 }
+ }
};
static const uint16_t ac_bias_0[16][32][2] = {
- { /* AC bias group 1, table 0 */
- { 0x8, 5 },
- { 0x25, 7 },
- { 0x17A, 9 },
- { 0x2F7, 10 },
- { 0xBDB, 12 },
- { 0x17B4, 13 },
- { 0x2F6B, 14 },
- { 0x1D, 5 },
- { 0x2F6A, 14 },
- { 0x8, 4 },
- { 0x7, 4 },
- { 0x1, 4 },
- { 0x2, 4 },
- { 0xA, 4 },
- { 0x6, 4 },
- { 0x0, 4 },
- { 0x1C, 5 },
- { 0x9, 4 },
- { 0xD, 4 },
- { 0xF, 4 },
- { 0xC, 4 },
- { 0x3, 4 },
- { 0xA, 5 },
- { 0x16, 5 },
- { 0x13, 6 },
- { 0x5D, 7 },
- { 0x24, 7 },
- { 0xBC, 8 },
- { 0x5C, 7 },
- { 0x5EC, 11 },
- { 0xB, 5 },
- { 0x5F, 7 }
- },
- { /* AC bias group 1, table 1 */
- { 0xF, 5 },
- { 0x10, 6 },
- { 0x4B, 8 },
- { 0xC6, 8 },
- { 0x31D, 10 },
- { 0xC71, 12 },
- { 0xC70, 12 },
- { 0x1, 4 },
- { 0xC73, 12 },
- { 0x8, 4 },
- { 0x9, 4 },
- { 0x2, 4 },
- { 0x3, 4 },
- { 0xB, 4 },
- { 0x6, 4 },
- { 0x0, 4 },
- { 0x1C, 5 },
- { 0x5, 4 },
- { 0xD, 4 },
- { 0xF, 4 },
- { 0xA, 4 },
- { 0x19, 5 },
- { 0x13, 6 },
- { 0x1D, 5 },
- { 0x30, 6 },
- { 0x62, 7 },
- { 0x24, 7 },
- { 0x4A, 8 },
- { 0x18F, 9 },
- { 0xC72, 12 },
- { 0xE, 5 },
- { 0x11, 6 }
- },
- { /* AC bias group 1, table 2 */
- { 0x1B, 5 },
- { 0x3, 6 },
- { 0x8D, 8 },
- { 0x40, 7 },
- { 0x239, 10 },
- { 0x471, 11 },
- { 0x8E0, 12 },
- { 0x3, 4 },
- { 0x11C3, 13 },
- { 0xA, 4 },
- { 0x9, 4 },
- { 0x4, 4 },
- { 0x5, 4 },
- { 0xE, 4 },
- { 0x7, 4 },
- { 0x1, 4 },
- { 0x1E, 5 },
- { 0x6, 4 },
- { 0xC, 4 },
- { 0xB, 4 },
- { 0x2, 4 },
- { 0x0, 5 },
- { 0x41, 7 },
- { 0x1F, 5 },
- { 0x22, 6 },
- { 0x2, 6 },
- { 0x8F, 8 },
- { 0x8C, 8 },
- { 0x11D, 9 },
- { 0x11C2, 13 },
- { 0x1A, 5 },
- { 0x21, 6 }
- },
- { /* AC bias group 1, table 3 */
- { 0x1F, 5 },
- { 0x3, 6 },
- { 0x3, 7 },
- { 0x43, 7 },
- { 0xB, 9 },
- { 0x15, 10 },
- { 0x51, 12 },
- { 0x3, 4 },
- { 0x50, 12 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x4, 4 },
- { 0x6, 4 },
- { 0xE, 4 },
- { 0xA, 4 },
- { 0x1, 4 },
- { 0x1E, 5 },
- { 0x5, 4 },
- { 0x9, 4 },
- { 0x7, 4 },
- { 0x11, 5 },
- { 0x2, 6 },
- { 0x4, 8 },
- { 0x2, 4 },
- { 0x2D, 6 },
- { 0x20, 6 },
- { 0x42, 7 },
- { 0x1, 7 },
- { 0x0, 7 },
- { 0x29, 11 },
- { 0x17, 5 },
- { 0x2C, 6 }
- },
- { /* AC bias group 1, table 4 */
- { 0x3, 4 },
- { 0x1F, 6 },
- { 0x3A, 7 },
- { 0x5D, 7 },
- { 0x173, 9 },
- { 0x2E4, 10 },
- { 0x172D, 13 },
- { 0x4, 4 },
- { 0x172C, 13 },
- { 0xF, 4 },
- { 0xE, 4 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0xC, 4 },
- { 0xA, 4 },
- { 0x1, 4 },
- { 0x16, 5 },
- { 0x2, 4 },
- { 0x5, 4 },
- { 0x1A, 5 },
- { 0x2F, 6 },
- { 0x38, 7 },
- { 0x5CA, 11 },
- { 0x6, 4 },
- { 0x37, 6 },
- { 0x1E, 6 },
- { 0x3B, 7 },
- { 0x39, 7 },
- { 0xB8, 8 },
- { 0xB97, 12 },
- { 0x0, 4 },
- { 0x36, 6 }
- },
- { /* AC bias group 1, table 5 */
- { 0x6, 4 },
- { 0x37, 6 },
- { 0x5D, 7 },
- { 0xC, 6 },
- { 0xB9, 8 },
- { 0x2E3, 10 },
- { 0x5C4, 11 },
- { 0x4, 4 },
- { 0x1715, 13 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0x8, 4 },
- { 0x7, 4 },
- { 0xC, 4 },
- { 0x9, 4 },
- { 0x1D, 5 },
- { 0x16, 5 },
- { 0x1C, 5 },
- { 0x1A, 5 },
- { 0xB, 5 },
- { 0x5E, 7 },
- { 0x170, 9 },
- { 0x1714, 13 },
- { 0xA, 4 },
- { 0xA, 5 },
- { 0x36, 6 },
- { 0x5F, 7 },
- { 0x1B, 7 },
- { 0x1A, 7 },
- { 0xB8B, 12 },
- { 0x2, 4 },
- { 0x7, 5 }
- },
- { /* AC bias group 1, table 6 */
- { 0xC, 4 },
- { 0xB, 5 },
- { 0x79, 7 },
- { 0x22, 6 },
- { 0xF0, 8 },
- { 0x119, 9 },
- { 0x230, 10 },
- { 0x1D, 5 },
- { 0x8C4, 12 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xA, 4 },
- { 0x9, 4 },
- { 0xB, 4 },
- { 0x7, 4 },
- { 0x1C, 5 },
- { 0x3D, 6 },
- { 0xD, 5 },
- { 0x8, 5 },
- { 0x15, 6 },
- { 0x8D, 8 },
- { 0x118B, 13 },
- { 0x118A, 13 },
- { 0xD, 4 },
- { 0x10, 5 },
- { 0x9, 5 },
- { 0x14, 6 },
- { 0x47, 7 },
- { 0xF1, 8 },
- { 0x463, 11 },
- { 0x1F, 5 },
- { 0xC, 5 }
- },
- { /* AC bias group 1, table 7 */
- { 0x0, 3 },
- { 0x1A, 5 },
- { 0x33, 6 },
- { 0xC, 5 },
- { 0x46, 7 },
- { 0x1E3, 9 },
- { 0x3C5, 10 },
- { 0x17, 5 },
- { 0x1E21, 13 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x9, 4 },
- { 0xA, 4 },
- { 0x7, 4 },
- { 0x1B, 5 },
- { 0x3D, 6 },
- { 0x1B, 6 },
- { 0x22, 6 },
- { 0x79, 7 },
- { 0xF0, 8 },
- { 0x1E20, 13 },
- { 0x1E23, 13 },
- { 0x1E22, 13 },
- { 0xE, 4 },
- { 0x16, 5 },
- { 0x18, 5 },
- { 0x32, 6 },
- { 0x1A, 6 },
- { 0x47, 7 },
- { 0x789, 11 },
- { 0x1F, 5 },
- { 0x10, 5 }
- },
- { /* AC bias group 1, table 8 */
- { 0x1D, 5 },
- { 0x61, 7 },
- { 0x4E, 8 },
- { 0x9E, 9 },
- { 0x27C, 11 },
- { 0x9F5, 13 },
- { 0x9F4, 13 },
- { 0x3, 4 },
- { 0x60, 7 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0xB, 4 },
- { 0xA, 4 },
- { 0x9, 4 },
- { 0x5, 4 },
- { 0xD, 5 },
- { 0x31, 6 },
- { 0x8, 5 },
- { 0x38, 6 },
- { 0x12, 6 },
- { 0x26, 7 },
- { 0x13F, 10 },
- { 0x4FB, 12 },
- { 0xD, 4 },
- { 0x2, 4 },
- { 0xC, 5 },
- { 0x39, 6 },
- { 0x1C, 6 },
- { 0xF, 5 },
- { 0x1D, 6 },
- { 0x8, 4 },
- { 0x19, 5 }
- },
- { /* AC bias group 1, table 9 */
- { 0x7, 4 },
- { 0x19, 6 },
- { 0xAB, 8 },
- { 0xAA, 8 },
- { 0x119, 10 },
- { 0x461, 12 },
- { 0x460, 12 },
- { 0x1B, 5 },
- { 0x47, 8 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xC, 4 },
- { 0xB, 4 },
- { 0x9, 4 },
- { 0x5, 4 },
- { 0xD, 5 },
- { 0x35, 6 },
- { 0x3D, 6 },
- { 0x3C, 6 },
- { 0x18, 6 },
- { 0x22, 7 },
- { 0x8D, 9 },
- { 0x231, 11 },
- { 0xE, 4 },
- { 0x1F, 5 },
- { 0x9, 5 },
- { 0x2B, 6 },
- { 0x10, 6 },
- { 0x34, 6 },
- { 0x54, 7 },
- { 0x8, 4 },
- { 0x14, 5 }
- },
- { /* AC bias group 1, table 10 */
- { 0xC, 4 },
- { 0x5, 5 },
- { 0x8, 6 },
- { 0x5B, 7 },
- { 0x4D, 9 },
- { 0x131, 11 },
- { 0x261, 12 },
- { 0x1A, 5 },
- { 0x12, 7 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0xA, 4 },
- { 0x9, 4 },
- { 0x6, 4 },
- { 0x1B, 5 },
- { 0x6, 5 },
- { 0x1C, 6 },
- { 0x2C, 6 },
- { 0x15, 6 },
- { 0x5A, 7 },
- { 0x27, 8 },
- { 0x99, 10 },
- { 0x260, 12 },
- { 0xE, 4 },
- { 0x4, 4 },
- { 0xF, 5 },
- { 0x7, 5 },
- { 0x1D, 6 },
- { 0xB, 5 },
- { 0x14, 6 },
- { 0x8, 4 },
- { 0x17, 5 }
- },
- { /* AC bias group 1, table 11 */
- { 0xF, 4 },
- { 0x13, 5 },
- { 0x75, 7 },
- { 0x24, 6 },
- { 0x95, 8 },
- { 0x251, 10 },
- { 0x4A0, 11 },
- { 0x10, 5 },
- { 0xC8, 8 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x1, 4 },
- { 0x0, 4 },
- { 0x1A, 5 },
- { 0x11, 5 },
- { 0x2C, 6 },
- { 0x65, 7 },
- { 0x74, 7 },
- { 0x4B, 7 },
- { 0xC9, 8 },
- { 0x129, 9 },
- { 0x943, 12 },
- { 0x942, 12 },
- { 0x3, 3 },
- { 0xA, 4 },
- { 0x1C, 5 },
- { 0x18, 5 },
- { 0x33, 6 },
- { 0x17, 5 },
- { 0x2D, 6 },
- { 0x1B, 5 },
- { 0x3B, 6 }
- },
- { /* AC bias group 1, table 12 */
- { 0x3, 3 },
- { 0x1A, 5 },
- { 0x2D, 6 },
- { 0x38, 6 },
- { 0x28, 7 },
- { 0x395, 10 },
- { 0xE51, 12 },
- { 0x37, 6 },
- { 0xE4, 8 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0x1F, 5 },
- { 0x1E, 5 },
- { 0x17, 5 },
- { 0x3A, 6 },
- { 0x73, 7 },
- { 0x2A, 7 },
- { 0x2B, 7 },
- { 0x29, 7 },
- { 0x1CB, 9 },
- { 0x729, 11 },
- { 0x1CA1, 13 },
- { 0x1CA0, 13 },
- { 0x4, 3 },
- { 0xA, 4 },
- { 0x4, 4 },
- { 0x18, 5 },
- { 0x36, 6 },
- { 0xB, 5 },
- { 0x2C, 6 },
- { 0x19, 5 },
- { 0x3B, 6 }
- },
- { /* AC bias group 1, table 13 */
- { 0x4, 3 },
- { 0x4, 4 },
- { 0x3F, 6 },
- { 0x17, 5 },
- { 0x75, 7 },
- { 0x1F5, 9 },
- { 0x7D1, 11 },
- { 0x17, 6 },
- { 0x1F6, 9 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0x1B, 5 },
- { 0x1A, 5 },
- { 0xA, 5 },
- { 0x32, 6 },
- { 0x74, 7 },
- { 0xF8, 8 },
- { 0xF9, 8 },
- { 0x1F7, 9 },
- { 0x3E9, 10 },
- { 0xFA0, 12 },
- { 0x1F43, 13 },
- { 0x1F42, 13 },
- { 0x3, 3 },
- { 0xA, 4 },
- { 0x1E, 5 },
- { 0x1C, 5 },
- { 0x3B, 6 },
- { 0x18, 5 },
- { 0x16, 6 },
- { 0x16, 5 },
- { 0x33, 6 }
- },
- { /* AC bias group 1, table 14 */
- { 0x4, 3 },
- { 0x7, 4 },
- { 0x18, 5 },
- { 0x1E, 5 },
- { 0x36, 6 },
- { 0x31, 7 },
- { 0x177, 9 },
- { 0x77, 7 },
- { 0x176, 9 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0x1A, 5 },
- { 0x19, 5 },
- { 0x3A, 6 },
- { 0x19, 6 },
- { 0x5C, 7 },
- { 0xBA, 8 },
- { 0x61, 8 },
- { 0xC1, 9 },
- { 0x180, 10 },
- { 0x302, 11 },
- { 0x607, 12 },
- { 0x606, 12 },
- { 0x2, 3 },
- { 0xA, 4 },
- { 0x1F, 5 },
- { 0x1C, 5 },
- { 0x37, 6 },
- { 0x16, 5 },
- { 0x76, 7 },
- { 0xD, 5 },
- { 0x2F, 6 }
- },
- { /* AC bias group 1, table 15 */
- { 0x0, 3 },
- { 0xA, 4 },
- { 0x1A, 5 },
- { 0xC, 4 },
- { 0x1D, 5 },
- { 0x39, 6 },
- { 0x78, 7 },
- { 0x5E, 7 },
- { 0x393, 11 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x16, 5 },
- { 0xF, 5 },
- { 0x2E, 6 },
- { 0x5F, 7 },
- { 0x73, 8 },
- { 0xE5, 9 },
- { 0x1C8, 10 },
- { 0xE4A, 13 },
- { 0x1C97, 14 },
- { 0x1C96, 14 },
- { 0xE49, 13 },
- { 0xE48, 13 },
- { 0x4, 3 },
- { 0x6, 4 },
- { 0x1F, 5 },
- { 0x1B, 5 },
- { 0x1D, 6 },
- { 0x38, 6 },
- { 0x38, 7 },
- { 0x3D, 6 },
- { 0x79, 7 }
- }
+ { /* AC bias group 1, table 0 */
+ { 0x8, 5 },
+ { 0x25, 7 },
+ { 0x17A, 9 },
+ { 0x2F7, 10 },
+ { 0xBDB, 12 },
+ { 0x17B4, 13 },
+ { 0x2F6B, 14 },
+ { 0x1D, 5 },
+ { 0x2F6A, 14 },
+ { 0x8, 4 },
+ { 0x7, 4 },
+ { 0x1, 4 },
+ { 0x2, 4 },
+ { 0xA, 4 },
+ { 0x6, 4 },
+ { 0x0, 4 },
+ { 0x1C, 5 },
+ { 0x9, 4 },
+ { 0xD, 4 },
+ { 0xF, 4 },
+ { 0xC, 4 },
+ { 0x3, 4 },
+ { 0xA, 5 },
+ { 0x16, 5 },
+ { 0x13, 6 },
+ { 0x5D, 7 },
+ { 0x24, 7 },
+ { 0xBC, 8 },
+ { 0x5C, 7 },
+ { 0x5EC, 11 },
+ { 0xB, 5 },
+ { 0x5F, 7 }
+ },
+ { /* AC bias group 1, table 1 */
+ { 0xF, 5 },
+ { 0x10, 6 },
+ { 0x4B, 8 },
+ { 0xC6, 8 },
+ { 0x31D, 10 },
+ { 0xC71, 12 },
+ { 0xC70, 12 },
+ { 0x1, 4 },
+ { 0xC73, 12 },
+ { 0x8, 4 },
+ { 0x9, 4 },
+ { 0x2, 4 },
+ { 0x3, 4 },
+ { 0xB, 4 },
+ { 0x6, 4 },
+ { 0x0, 4 },
+ { 0x1C, 5 },
+ { 0x5, 4 },
+ { 0xD, 4 },
+ { 0xF, 4 },
+ { 0xA, 4 },
+ { 0x19, 5 },
+ { 0x13, 6 },
+ { 0x1D, 5 },
+ { 0x30, 6 },
+ { 0x62, 7 },
+ { 0x24, 7 },
+ { 0x4A, 8 },
+ { 0x18F, 9 },
+ { 0xC72, 12 },
+ { 0xE, 5 },
+ { 0x11, 6 }
+ },
+ { /* AC bias group 1, table 2 */
+ { 0x1B, 5 },
+ { 0x3, 6 },
+ { 0x8D, 8 },
+ { 0x40, 7 },
+ { 0x239, 10 },
+ { 0x471, 11 },
+ { 0x8E0, 12 },
+ { 0x3, 4 },
+ { 0x11C3, 13 },
+ { 0xA, 4 },
+ { 0x9, 4 },
+ { 0x4, 4 },
+ { 0x5, 4 },
+ { 0xE, 4 },
+ { 0x7, 4 },
+ { 0x1, 4 },
+ { 0x1E, 5 },
+ { 0x6, 4 },
+ { 0xC, 4 },
+ { 0xB, 4 },
+ { 0x2, 4 },
+ { 0x0, 5 },
+ { 0x41, 7 },
+ { 0x1F, 5 },
+ { 0x22, 6 },
+ { 0x2, 6 },
+ { 0x8F, 8 },
+ { 0x8C, 8 },
+ { 0x11D, 9 },
+ { 0x11C2, 13 },
+ { 0x1A, 5 },
+ { 0x21, 6 }
+ },
+ { /* AC bias group 1, table 3 */
+ { 0x1F, 5 },
+ { 0x3, 6 },
+ { 0x3, 7 },
+ { 0x43, 7 },
+ { 0xB, 9 },
+ { 0x15, 10 },
+ { 0x51, 12 },
+ { 0x3, 4 },
+ { 0x50, 12 },
+ { 0xD, 4 },
+ { 0xC, 4 },
+ { 0x4, 4 },
+ { 0x6, 4 },
+ { 0xE, 4 },
+ { 0xA, 4 },
+ { 0x1, 4 },
+ { 0x1E, 5 },
+ { 0x5, 4 },
+ { 0x9, 4 },
+ { 0x7, 4 },
+ { 0x11, 5 },
+ { 0x2, 6 },
+ { 0x4, 8 },
+ { 0x2, 4 },
+ { 0x2D, 6 },
+ { 0x20, 6 },
+ { 0x42, 7 },
+ { 0x1, 7 },
+ { 0x0, 7 },
+ { 0x29, 11 },
+ { 0x17, 5 },
+ { 0x2C, 6 }
+ },
+ { /* AC bias group 1, table 4 */
+ { 0x3, 4 },
+ { 0x1F, 6 },
+ { 0x3A, 7 },
+ { 0x5D, 7 },
+ { 0x173, 9 },
+ { 0x2E4, 10 },
+ { 0x172D, 13 },
+ { 0x4, 4 },
+ { 0x172C, 13 },
+ { 0xF, 4 },
+ { 0xE, 4 },
+ { 0x9, 4 },
+ { 0x8, 4 },
+ { 0xC, 4 },
+ { 0xA, 4 },
+ { 0x1, 4 },
+ { 0x16, 5 },
+ { 0x2, 4 },
+ { 0x5, 4 },
+ { 0x1A, 5 },
+ { 0x2F, 6 },
+ { 0x38, 7 },
+ { 0x5CA, 11 },
+ { 0x6, 4 },
+ { 0x37, 6 },
+ { 0x1E, 6 },
+ { 0x3B, 7 },
+ { 0x39, 7 },
+ { 0xB8, 8 },
+ { 0xB97, 12 },
+ { 0x0, 4 },
+ { 0x36, 6 }
+ },
+ { /* AC bias group 1, table 5 */
+ { 0x6, 4 },
+ { 0x37, 6 },
+ { 0x5D, 7 },
+ { 0xC, 6 },
+ { 0xB9, 8 },
+ { 0x2E3, 10 },
+ { 0x5C4, 11 },
+ { 0x4, 4 },
+ { 0x1715, 13 },
+ { 0x0, 3 },
+ { 0xF, 4 },
+ { 0x8, 4 },
+ { 0x7, 4 },
+ { 0xC, 4 },
+ { 0x9, 4 },
+ { 0x1D, 5 },
+ { 0x16, 5 },
+ { 0x1C, 5 },
+ { 0x1A, 5 },
+ { 0xB, 5 },
+ { 0x5E, 7 },
+ { 0x170, 9 },
+ { 0x1714, 13 },
+ { 0xA, 4 },
+ { 0xA, 5 },
+ { 0x36, 6 },
+ { 0x5F, 7 },
+ { 0x1B, 7 },
+ { 0x1A, 7 },
+ { 0xB8B, 12 },
+ { 0x2, 4 },
+ { 0x7, 5 }
+ },
+ { /* AC bias group 1, table 6 */
+ { 0xC, 4 },
+ { 0xB, 5 },
+ { 0x79, 7 },
+ { 0x22, 6 },
+ { 0xF0, 8 },
+ { 0x119, 9 },
+ { 0x230, 10 },
+ { 0x1D, 5 },
+ { 0x8C4, 12 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0xA, 4 },
+ { 0x9, 4 },
+ { 0xB, 4 },
+ { 0x7, 4 },
+ { 0x1C, 5 },
+ { 0x3D, 6 },
+ { 0xD, 5 },
+ { 0x8, 5 },
+ { 0x15, 6 },
+ { 0x8D, 8 },
+ { 0x118B, 13 },
+ { 0x118A, 13 },
+ { 0xD, 4 },
+ { 0x10, 5 },
+ { 0x9, 5 },
+ { 0x14, 6 },
+ { 0x47, 7 },
+ { 0xF1, 8 },
+ { 0x463, 11 },
+ { 0x1F, 5 },
+ { 0xC, 5 }
+ },
+ { /* AC bias group 1, table 7 */
+ { 0x0, 3 },
+ { 0x1A, 5 },
+ { 0x33, 6 },
+ { 0xC, 5 },
+ { 0x46, 7 },
+ { 0x1E3, 9 },
+ { 0x3C5, 10 },
+ { 0x17, 5 },
+ { 0x1E21, 13 },
+ { 0x2, 3 },
+ { 0x1, 3 },
+ { 0x9, 4 },
+ { 0xA, 4 },
+ { 0x7, 4 },
+ { 0x1B, 5 },
+ { 0x3D, 6 },
+ { 0x1B, 6 },
+ { 0x22, 6 },
+ { 0x79, 7 },
+ { 0xF0, 8 },
+ { 0x1E20, 13 },
+ { 0x1E23, 13 },
+ { 0x1E22, 13 },
+ { 0xE, 4 },
+ { 0x16, 5 },
+ { 0x18, 5 },
+ { 0x32, 6 },
+ { 0x1A, 6 },
+ { 0x47, 7 },
+ { 0x789, 11 },
+ { 0x1F, 5 },
+ { 0x10, 5 }
+ },
+ { /* AC bias group 1, table 8 */
+ { 0x1D, 5 },
+ { 0x61, 7 },
+ { 0x4E, 8 },
+ { 0x9E, 9 },
+ { 0x27C, 11 },
+ { 0x9F5, 13 },
+ { 0x9F4, 13 },
+ { 0x3, 4 },
+ { 0x60, 7 },
+ { 0x0, 3 },
+ { 0xF, 4 },
+ { 0xB, 4 },
+ { 0xA, 4 },
+ { 0x9, 4 },
+ { 0x5, 4 },
+ { 0xD, 5 },
+ { 0x31, 6 },
+ { 0x8, 5 },
+ { 0x38, 6 },
+ { 0x12, 6 },
+ { 0x26, 7 },
+ { 0x13F, 10 },
+ { 0x4FB, 12 },
+ { 0xD, 4 },
+ { 0x2, 4 },
+ { 0xC, 5 },
+ { 0x39, 6 },
+ { 0x1C, 6 },
+ { 0xF, 5 },
+ { 0x1D, 6 },
+ { 0x8, 4 },
+ { 0x19, 5 }
+ },
+ { /* AC bias group 1, table 9 */
+ { 0x7, 4 },
+ { 0x19, 6 },
+ { 0xAB, 8 },
+ { 0xAA, 8 },
+ { 0x119, 10 },
+ { 0x461, 12 },
+ { 0x460, 12 },
+ { 0x1B, 5 },
+ { 0x47, 8 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0xC, 4 },
+ { 0xB, 4 },
+ { 0x9, 4 },
+ { 0x5, 4 },
+ { 0xD, 5 },
+ { 0x35, 6 },
+ { 0x3D, 6 },
+ { 0x3C, 6 },
+ { 0x18, 6 },
+ { 0x22, 7 },
+ { 0x8D, 9 },
+ { 0x231, 11 },
+ { 0xE, 4 },
+ { 0x1F, 5 },
+ { 0x9, 5 },
+ { 0x2B, 6 },
+ { 0x10, 6 },
+ { 0x34, 6 },
+ { 0x54, 7 },
+ { 0x8, 4 },
+ { 0x14, 5 }
+ },
+ { /* AC bias group 1, table 10 */
+ { 0xC, 4 },
+ { 0x5, 5 },
+ { 0x8, 6 },
+ { 0x5B, 7 },
+ { 0x4D, 9 },
+ { 0x131, 11 },
+ { 0x261, 12 },
+ { 0x1A, 5 },
+ { 0x12, 7 },
+ { 0x0, 3 },
+ { 0xF, 4 },
+ { 0xA, 4 },
+ { 0x9, 4 },
+ { 0x6, 4 },
+ { 0x1B, 5 },
+ { 0x6, 5 },
+ { 0x1C, 6 },
+ { 0x2C, 6 },
+ { 0x15, 6 },
+ { 0x5A, 7 },
+ { 0x27, 8 },
+ { 0x99, 10 },
+ { 0x260, 12 },
+ { 0xE, 4 },
+ { 0x4, 4 },
+ { 0xF, 5 },
+ { 0x7, 5 },
+ { 0x1D, 6 },
+ { 0xB, 5 },
+ { 0x14, 6 },
+ { 0x8, 4 },
+ { 0x17, 5 }
+ },
+ { /* AC bias group 1, table 11 */
+ { 0xF, 4 },
+ { 0x13, 5 },
+ { 0x75, 7 },
+ { 0x24, 6 },
+ { 0x95, 8 },
+ { 0x251, 10 },
+ { 0x4A0, 11 },
+ { 0x10, 5 },
+ { 0xC8, 8 },
+ { 0x2, 3 },
+ { 0x1, 3 },
+ { 0x1, 4 },
+ { 0x0, 4 },
+ { 0x1A, 5 },
+ { 0x11, 5 },
+ { 0x2C, 6 },
+ { 0x65, 7 },
+ { 0x74, 7 },
+ { 0x4B, 7 },
+ { 0xC9, 8 },
+ { 0x129, 9 },
+ { 0x943, 12 },
+ { 0x942, 12 },
+ { 0x3, 3 },
+ { 0xA, 4 },
+ { 0x1C, 5 },
+ { 0x18, 5 },
+ { 0x33, 6 },
+ { 0x17, 5 },
+ { 0x2D, 6 },
+ { 0x1B, 5 },
+ { 0x3B, 6 }
+ },
+ { /* AC bias group 1, table 12 */
+ { 0x3, 3 },
+ { 0x1A, 5 },
+ { 0x2D, 6 },
+ { 0x38, 6 },
+ { 0x28, 7 },
+ { 0x395, 10 },
+ { 0xE51, 12 },
+ { 0x37, 6 },
+ { 0xE4, 8 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0x1F, 5 },
+ { 0x1E, 5 },
+ { 0x17, 5 },
+ { 0x3A, 6 },
+ { 0x73, 7 },
+ { 0x2A, 7 },
+ { 0x2B, 7 },
+ { 0x29, 7 },
+ { 0x1CB, 9 },
+ { 0x729, 11 },
+ { 0x1CA1, 13 },
+ { 0x1CA0, 13 },
+ { 0x4, 3 },
+ { 0xA, 4 },
+ { 0x4, 4 },
+ { 0x18, 5 },
+ { 0x36, 6 },
+ { 0xB, 5 },
+ { 0x2C, 6 },
+ { 0x19, 5 },
+ { 0x3B, 6 }
+ },
+ { /* AC bias group 1, table 13 */
+ { 0x4, 3 },
+ { 0x4, 4 },
+ { 0x3F, 6 },
+ { 0x17, 5 },
+ { 0x75, 7 },
+ { 0x1F5, 9 },
+ { 0x7D1, 11 },
+ { 0x17, 6 },
+ { 0x1F6, 9 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0x1B, 5 },
+ { 0x1A, 5 },
+ { 0xA, 5 },
+ { 0x32, 6 },
+ { 0x74, 7 },
+ { 0xF8, 8 },
+ { 0xF9, 8 },
+ { 0x1F7, 9 },
+ { 0x3E9, 10 },
+ { 0xFA0, 12 },
+ { 0x1F43, 13 },
+ { 0x1F42, 13 },
+ { 0x3, 3 },
+ { 0xA, 4 },
+ { 0x1E, 5 },
+ { 0x1C, 5 },
+ { 0x3B, 6 },
+ { 0x18, 5 },
+ { 0x16, 6 },
+ { 0x16, 5 },
+ { 0x33, 6 }
+ },
+ { /* AC bias group 1, table 14 */
+ { 0x4, 3 },
+ { 0x7, 4 },
+ { 0x18, 5 },
+ { 0x1E, 5 },
+ { 0x36, 6 },
+ { 0x31, 7 },
+ { 0x177, 9 },
+ { 0x77, 7 },
+ { 0x176, 9 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0x1A, 5 },
+ { 0x19, 5 },
+ { 0x3A, 6 },
+ { 0x19, 6 },
+ { 0x5C, 7 },
+ { 0xBA, 8 },
+ { 0x61, 8 },
+ { 0xC1, 9 },
+ { 0x180, 10 },
+ { 0x302, 11 },
+ { 0x607, 12 },
+ { 0x606, 12 },
+ { 0x2, 3 },
+ { 0xA, 4 },
+ { 0x1F, 5 },
+ { 0x1C, 5 },
+ { 0x37, 6 },
+ { 0x16, 5 },
+ { 0x76, 7 },
+ { 0xD, 5 },
+ { 0x2F, 6 }
+ },
+ { /* AC bias group 1, table 15 */
+ { 0x0, 3 },
+ { 0xA, 4 },
+ { 0x1A, 5 },
+ { 0xC, 4 },
+ { 0x1D, 5 },
+ { 0x39, 6 },
+ { 0x78, 7 },
+ { 0x5E, 7 },
+ { 0x393, 11 },
+ { 0x2, 3 },
+ { 0x1, 3 },
+ { 0x16, 5 },
+ { 0xF, 5 },
+ { 0x2E, 6 },
+ { 0x5F, 7 },
+ { 0x73, 8 },
+ { 0xE5, 9 },
+ { 0x1C8, 10 },
+ { 0xE4A, 13 },
+ { 0x1C97, 14 },
+ { 0x1C96, 14 },
+ { 0xE49, 13 },
+ { 0xE48, 13 },
+ { 0x4, 3 },
+ { 0x6, 4 },
+ { 0x1F, 5 },
+ { 0x1B, 5 },
+ { 0x1D, 6 },
+ { 0x38, 6 },
+ { 0x38, 7 },
+ { 0x3D, 6 },
+ { 0x79, 7 }
+ }
};
static const uint16_t ac_bias_1[16][32][2] = {
- { /* AC bias group 2, table 0 */
- { 0xB, 5 },
- { 0x2B, 7 },
- { 0x54, 8 },
- { 0x1B7, 9 },
- { 0x6D9, 11 },
- { 0xDB1, 12 },
- { 0xDB0, 12 },
- { 0x2, 4 },
- { 0xAB, 9 },
- { 0x9, 4 },
- { 0xA, 4 },
- { 0x7, 4 },
- { 0x8, 4 },
- { 0xF, 4 },
- { 0xC, 4 },
- { 0x3, 4 },
- { 0x1D, 5 },
- { 0x4, 4 },
- { 0xB, 4 },
- { 0x6, 4 },
- { 0x1A, 5 },
- { 0x3, 6 },
- { 0xAA, 9 },
- { 0x1, 4 },
- { 0x0, 5 },
- { 0x14, 6 },
- { 0x6C, 7 },
- { 0xDA, 8 },
- { 0x2, 6 },
- { 0x36D, 10 },
- { 0x1C, 5 },
- { 0x37, 6 }
- },
- { /* AC bias group 2, table 1 */
- { 0x1D, 5 },
- { 0x4, 6 },
- { 0xB6, 8 },
- { 0x6A, 8 },
- { 0x5B9, 11 },
- { 0x16E1, 13 },
- { 0x16E0, 13 },
- { 0x7, 4 },
- { 0x16F, 9 },
- { 0xC, 4 },
- { 0xD, 4 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0xF, 4 },
- { 0xA, 4 },
- { 0x3, 4 },
- { 0x17, 5 },
- { 0x2, 4 },
- { 0x4, 4 },
- { 0x1C, 5 },
- { 0x2C, 6 },
- { 0x6B, 8 },
- { 0xB71, 12 },
- { 0x5, 4 },
- { 0x3, 5 },
- { 0x1B, 6 },
- { 0x5A, 7 },
- { 0x34, 7 },
- { 0x5, 6 },
- { 0x2DD, 10 },
- { 0x0, 4 },
- { 0xC, 5 }
- },
- { /* AC bias group 2, table 2 */
- { 0x3, 4 },
- { 0x7F, 7 },
- { 0xA1, 8 },
- { 0xA0, 8 },
- { 0x20C, 10 },
- { 0x834, 12 },
- { 0x106B, 13 },
- { 0x7, 4 },
- { 0x82, 8 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0x0, 3 },
- { 0x9, 4 },
- { 0x2, 4 },
- { 0x11, 5 },
- { 0x1E, 5 },
- { 0x15, 5 },
- { 0x3E, 6 },
- { 0x40, 7 },
- { 0x41B, 11 },
- { 0x106A, 13 },
- { 0x6, 4 },
- { 0xA, 5 },
- { 0x29, 6 },
- { 0x7E, 7 },
- { 0x51, 7 },
- { 0x21, 6 },
- { 0x107, 9 },
- { 0x4, 4 },
- { 0xB, 5 }
- },
- { /* AC bias group 2, table 3 */
- { 0x7, 4 },
- { 0x1B, 6 },
- { 0xF6, 8 },
- { 0xE9, 8 },
- { 0x3A1, 10 },
- { 0x740, 11 },
- { 0xE82, 12 },
- { 0x1F, 5 },
- { 0x1EF, 9 },
- { 0x1, 3 },
- { 0x2, 3 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0xD, 4 },
- { 0x8, 4 },
- { 0x1C, 5 },
- { 0x3, 5 },
- { 0x12, 5 },
- { 0x2, 5 },
- { 0x75, 7 },
- { 0x1D1, 9 },
- { 0x1D07, 13 },
- { 0x1D06, 13 },
- { 0xA, 4 },
- { 0x13, 5 },
- { 0x3B, 6 },
- { 0x1A, 6 },
- { 0x7A, 7 },
- { 0x3C, 6 },
- { 0x1EE, 9 },
- { 0x0, 4 },
- { 0xC, 5 }
- },
- { /* AC bias group 2, table 4 */
- { 0xD, 4 },
- { 0x3D, 6 },
- { 0x42, 7 },
- { 0x37, 7 },
- { 0xD9, 9 },
- { 0x362, 11 },
- { 0x6C6, 12 },
- { 0x1F, 5 },
- { 0x86, 8 },
- { 0x1, 3 },
- { 0x2, 3 },
- { 0xC, 4 },
- { 0xB, 4 },
- { 0xA, 4 },
- { 0x1, 4 },
- { 0xF, 5 },
- { 0x25, 6 },
- { 0x3C, 6 },
- { 0x1A, 6 },
- { 0x87, 8 },
- { 0x1B0, 10 },
- { 0xD8F, 13 },
- { 0xD8E, 13 },
- { 0xE, 4 },
- { 0x13, 5 },
- { 0xC, 5 },
- { 0x24, 6 },
- { 0x20, 6 },
- { 0x11, 5 },
- { 0x6D, 8 },
- { 0x0, 4 },
- { 0xE, 5 }
- },
- { /* AC bias group 2, table 5 */
- { 0x0, 3 },
- { 0x12, 5 },
- { 0x76, 7 },
- { 0x77, 7 },
- { 0x14D, 9 },
- { 0x533, 11 },
- { 0x14C9, 13 },
- { 0x13, 5 },
- { 0xA5, 8 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0x8, 4 },
- { 0x1A, 5 },
- { 0x2B, 6 },
- { 0x75, 7 },
- { 0x74, 7 },
- { 0xA7, 8 },
- { 0x298, 10 },
- { 0x14C8, 13 },
- { 0x14CB, 13 },
- { 0x14CA, 13 },
- { 0xF, 4 },
- { 0x1C, 5 },
- { 0x7, 5 },
- { 0x2A, 6 },
- { 0x28, 6 },
- { 0x1B, 5 },
- { 0xA4, 8 },
- { 0x2, 4 },
- { 0x6, 5 }
- },
- { /* AC bias group 2, table 6 */
- { 0x2, 3 },
- { 0x1A, 5 },
- { 0x2B, 6 },
- { 0x3A, 6 },
- { 0xED, 8 },
- { 0x283, 10 },
- { 0xA0A, 12 },
- { 0x4, 5 },
- { 0xA1, 8 },
- { 0x4, 3 },
- { 0x3, 3 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0x1F, 5 },
- { 0x6, 5 },
- { 0x77, 7 },
- { 0xA3, 8 },
- { 0xA2, 8 },
- { 0x140, 9 },
- { 0x1417, 13 },
- { 0x1416, 13 },
- { 0xA09, 12 },
- { 0xA08, 12 },
- { 0x0, 3 },
- { 0x1E, 5 },
- { 0x7, 5 },
- { 0x2A, 6 },
- { 0x29, 6 },
- { 0x1C, 5 },
- { 0xEC, 8 },
- { 0x1B, 5 },
- { 0x5, 5 }
- },
- { /* AC bias group 2, table 7 */
- { 0x2, 3 },
- { 0x2, 4 },
- { 0x18, 5 },
- { 0x1D, 5 },
- { 0x35, 6 },
- { 0xE4, 8 },
- { 0x1CF, 11 },
- { 0x1D, 7 },
- { 0x72, 9 },
- { 0x4, 3 },
- { 0x5, 3 },
- { 0x6, 4 },
- { 0x7, 4 },
- { 0x6, 5 },
- { 0x73, 7 },
- { 0x38, 8 },
- { 0x1CE, 11 },
- { 0x39B, 12 },
- { 0x398, 12 },
- { 0x733, 13 },
- { 0x732, 13 },
- { 0x735, 13 },
- { 0x734, 13 },
- { 0x0, 3 },
- { 0x1F, 5 },
- { 0x1B, 5 },
- { 0x34, 6 },
- { 0xF, 6 },
- { 0x1E, 5 },
- { 0xE5, 8 },
- { 0x19, 5 },
- { 0x38, 6 }
- },
- { /* AC bias group 2, table 8 */
- { 0x16, 5 },
- { 0x50, 7 },
- { 0x172, 9 },
- { 0x2E7, 10 },
- { 0x1732, 13 },
- { 0x2E67, 14 },
- { 0x2E66, 14 },
- { 0x6, 4 },
- { 0x51, 7 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x9, 4 },
- { 0x1C, 5 },
- { 0x9, 5 },
- { 0x1C, 6 },
- { 0x1D, 6 },
- { 0x5D, 7 },
- { 0xB8, 8 },
- { 0x5CD, 11 },
- { 0x1731, 13 },
- { 0x1730, 13 },
- { 0xF, 4 },
- { 0x5, 4 },
- { 0xF, 5 },
- { 0x8, 5 },
- { 0x29, 6 },
- { 0x1D, 5 },
- { 0x2F, 6 },
- { 0x8, 4 },
- { 0x15, 5 }
- },
- { /* AC bias group 2, table 9 */
- { 0x9, 4 },
- { 0x21, 6 },
- { 0x40, 7 },
- { 0xAD, 8 },
- { 0x2B0, 10 },
- { 0x1589, 13 },
- { 0x1588, 13 },
- { 0x1C, 5 },
- { 0x5F, 7 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x6, 4 },
- { 0x11, 5 },
- { 0x2A, 6 },
- { 0x57, 7 },
- { 0x5E, 7 },
- { 0x41, 7 },
- { 0x159, 9 },
- { 0x563, 11 },
- { 0x158B, 13 },
- { 0x158A, 13 },
- { 0x1, 3 },
- { 0x5, 4 },
- { 0x14, 5 },
- { 0x3B, 6 },
- { 0x2E, 6 },
- { 0x4, 4 },
- { 0x3A, 6 },
- { 0x7, 4 },
- { 0x16, 5 }
- },
- { /* AC bias group 2, table 10 */
- { 0xE, 4 },
- { 0x7, 5 },
- { 0x46, 7 },
- { 0x45, 7 },
- { 0x64, 9 },
- { 0x32A, 12 },
- { 0x657, 13 },
- { 0x18, 5 },
- { 0xD, 6 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0xA, 4 },
- { 0xB, 4 },
- { 0x1A, 5 },
- { 0x36, 6 },
- { 0x47, 7 },
- { 0x44, 7 },
- { 0x18, 7 },
- { 0x33, 8 },
- { 0xCB, 10 },
- { 0x656, 13 },
- { 0x329, 12 },
- { 0x328, 12 },
- { 0x2, 3 },
- { 0x6, 4 },
- { 0x19, 5 },
- { 0xE, 5 },
- { 0x37, 6 },
- { 0x9, 4 },
- { 0xF, 5 },
- { 0x2, 4 },
- { 0x10, 5 }
- },
- { /* AC bias group 2, table 11 */
- { 0x3, 3 },
- { 0x18, 5 },
- { 0x23, 6 },
- { 0x77, 7 },
- { 0x194, 9 },
- { 0x1956, 13 },
- { 0x32AF, 14 },
- { 0x3A, 6 },
- { 0x76, 7 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x1F, 5 },
- { 0x1E, 5 },
- { 0x14, 5 },
- { 0x22, 6 },
- { 0x64, 7 },
- { 0x197, 9 },
- { 0x196, 9 },
- { 0x32B, 10 },
- { 0x654, 11 },
- { 0x32AE, 14 },
- { 0x1955, 13 },
- { 0x1954, 13 },
- { 0x0, 3 },
- { 0x9, 4 },
- { 0x1C, 5 },
- { 0x15, 5 },
- { 0x10, 5 },
- { 0xD, 4 },
- { 0x17, 5 },
- { 0x16, 5 },
- { 0x33, 6 }
- },
- { /* AC bias group 2, table 12 */
- { 0x5, 3 },
- { 0x6, 4 },
- { 0x3E, 6 },
- { 0x10, 5 },
- { 0x48, 7 },
- { 0x93F, 12 },
- { 0x24FA, 14 },
- { 0x32, 6 },
- { 0x67, 7 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x1B, 5 },
- { 0x1E, 5 },
- { 0x34, 6 },
- { 0x66, 7 },
- { 0x92, 8 },
- { 0x126, 9 },
- { 0x24E, 10 },
- { 0x49E, 11 },
- { 0x49F7, 15 },
- { 0x49F6, 15 },
- { 0x24F9, 14 },
- { 0x24F8, 14 },
- { 0x0, 3 },
- { 0x7, 4 },
- { 0x18, 5 },
- { 0x11, 5 },
- { 0x3F, 6 },
- { 0xE, 4 },
- { 0x13, 5 },
- { 0x35, 6 },
- { 0x25, 6 }
- },
- { /* AC bias group 2, table 13 */
- { 0x5, 3 },
- { 0x8, 4 },
- { 0x12, 5 },
- { 0x1C, 5 },
- { 0x1C, 6 },
- { 0xEA, 9 },
- { 0x1D75, 14 },
- { 0x1E, 6 },
- { 0x66, 7 },
- { 0x1, 3 },
- { 0x2, 3 },
- { 0x1B, 5 },
- { 0x1A, 5 },
- { 0x1F, 6 },
- { 0x3B, 7 },
- { 0x74, 8 },
- { 0x1D6, 10 },
- { 0x3AF, 11 },
- { 0x1D74, 14 },
- { 0x1D77, 14 },
- { 0x1D76, 14 },
- { 0xEB9, 13 },
- { 0xEB8, 13 },
- { 0xF, 4 },
- { 0x6, 4 },
- { 0x13, 5 },
- { 0x3B, 6 },
- { 0x3A, 6 },
- { 0x0, 3 },
- { 0x18, 5 },
- { 0x32, 6 },
- { 0x67, 7 }
- },
- { /* AC bias group 2, table 14 */
- { 0x4, 3 },
- { 0xA, 4 },
- { 0x1B, 5 },
- { 0xC, 4 },
- { 0xD, 5 },
- { 0xE6, 8 },
- { 0x684, 11 },
- { 0x72, 7 },
- { 0xE7, 8 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x17, 5 },
- { 0x16, 5 },
- { 0x18, 6 },
- { 0xD1, 8 },
- { 0x1A0, 9 },
- { 0x686, 11 },
- { 0xD0F, 12 },
- { 0xD0A, 12 },
- { 0x1A17, 13 },
- { 0x1A16, 13 },
- { 0x1A1D, 13 },
- { 0x1A1C, 13 },
- { 0xF, 4 },
- { 0x1D, 5 },
- { 0xE, 5 },
- { 0x35, 6 },
- { 0x38, 6 },
- { 0x0, 3 },
- { 0xF, 5 },
- { 0x19, 6 },
- { 0x69, 7 }
- },
- { /* AC bias group 2, table 15 */
- { 0x3, 3 },
- { 0xC, 4 },
- { 0x1B, 5 },
- { 0x0, 3 },
- { 0x3, 4 },
- { 0x2E, 6 },
- { 0x51, 9 },
- { 0xBC, 8 },
- { 0x53, 9 },
- { 0x4, 3 },
- { 0x2, 3 },
- { 0x16, 5 },
- { 0x15, 5 },
- { 0x15, 7 },
- { 0x50, 9 },
- { 0xA4, 10 },
- { 0x294, 12 },
- { 0x52B, 13 },
- { 0x52A, 13 },
- { 0x52D, 13 },
- { 0x52C, 13 },
- { 0x52F, 13 },
- { 0x52E, 13 },
- { 0xE, 4 },
- { 0x1A, 5 },
- { 0x4, 5 },
- { 0x28, 6 },
- { 0x29, 6 },
- { 0xF, 4 },
- { 0xB, 6 },
- { 0x5F, 7 },
- { 0xBD, 8 }
- }
+ { /* AC bias group 2, table 0 */
+ { 0xB, 5 },
+ { 0x2B, 7 },
+ { 0x54, 8 },
+ { 0x1B7, 9 },
+ { 0x6D9, 11 },
+ { 0xDB1, 12 },
+ { 0xDB0, 12 },
+ { 0x2, 4 },
+ { 0xAB, 9 },
+ { 0x9, 4 },
+ { 0xA, 4 },
+ { 0x7, 4 },
+ { 0x8, 4 },
+ { 0xF, 4 },
+ { 0xC, 4 },
+ { 0x3, 4 },
+ { 0x1D, 5 },
+ { 0x4, 4 },
+ { 0xB, 4 },
+ { 0x6, 4 },
+ { 0x1A, 5 },
+ { 0x3, 6 },
+ { 0xAA, 9 },
+ { 0x1, 4 },
+ { 0x0, 5 },
+ { 0x14, 6 },
+ { 0x6C, 7 },
+ { 0xDA, 8 },
+ { 0x2, 6 },
+ { 0x36D, 10 },
+ { 0x1C, 5 },
+ { 0x37, 6 }
+ },
+ { /* AC bias group 2, table 1 */
+ { 0x1D, 5 },
+ { 0x4, 6 },
+ { 0xB6, 8 },
+ { 0x6A, 8 },
+ { 0x5B9, 11 },
+ { 0x16E1, 13 },
+ { 0x16E0, 13 },
+ { 0x7, 4 },
+ { 0x16F, 9 },
+ { 0xC, 4 },
+ { 0xD, 4 },
+ { 0x9, 4 },
+ { 0x8, 4 },
+ { 0xF, 4 },
+ { 0xA, 4 },
+ { 0x3, 4 },
+ { 0x17, 5 },
+ { 0x2, 4 },
+ { 0x4, 4 },
+ { 0x1C, 5 },
+ { 0x2C, 6 },
+ { 0x6B, 8 },
+ { 0xB71, 12 },
+ { 0x5, 4 },
+ { 0x3, 5 },
+ { 0x1B, 6 },
+ { 0x5A, 7 },
+ { 0x34, 7 },
+ { 0x5, 6 },
+ { 0x2DD, 10 },
+ { 0x0, 4 },
+ { 0xC, 5 }
+ },
+ { /* AC bias group 2, table 2 */
+ { 0x3, 4 },
+ { 0x7F, 7 },
+ { 0xA1, 8 },
+ { 0xA0, 8 },
+ { 0x20C, 10 },
+ { 0x834, 12 },
+ { 0x106B, 13 },
+ { 0x7, 4 },
+ { 0x82, 8 },
+ { 0xE, 4 },
+ { 0xD, 4 },
+ { 0xB, 4 },
+ { 0xC, 4 },
+ { 0x0, 3 },
+ { 0x9, 4 },
+ { 0x2, 4 },
+ { 0x11, 5 },
+ { 0x1E, 5 },
+ { 0x15, 5 },
+ { 0x3E, 6 },
+ { 0x40, 7 },
+ { 0x41B, 11 },
+ { 0x106A, 13 },
+ { 0x6, 4 },
+ { 0xA, 5 },
+ { 0x29, 6 },
+ { 0x7E, 7 },
+ { 0x51, 7 },
+ { 0x21, 6 },
+ { 0x107, 9 },
+ { 0x4, 4 },
+ { 0xB, 5 }
+ },
+ { /* AC bias group 2, table 3 */
+ { 0x7, 4 },
+ { 0x1B, 6 },
+ { 0xF6, 8 },
+ { 0xE9, 8 },
+ { 0x3A1, 10 },
+ { 0x740, 11 },
+ { 0xE82, 12 },
+ { 0x1F, 5 },
+ { 0x1EF, 9 },
+ { 0x1, 3 },
+ { 0x2, 3 },
+ { 0xB, 4 },
+ { 0xC, 4 },
+ { 0xD, 4 },
+ { 0x8, 4 },
+ { 0x1C, 5 },
+ { 0x3, 5 },
+ { 0x12, 5 },
+ { 0x2, 5 },
+ { 0x75, 7 },
+ { 0x1D1, 9 },
+ { 0x1D07, 13 },
+ { 0x1D06, 13 },
+ { 0xA, 4 },
+ { 0x13, 5 },
+ { 0x3B, 6 },
+ { 0x1A, 6 },
+ { 0x7A, 7 },
+ { 0x3C, 6 },
+ { 0x1EE, 9 },
+ { 0x0, 4 },
+ { 0xC, 5 }
+ },
+ { /* AC bias group 2, table 4 */
+ { 0xD, 4 },
+ { 0x3D, 6 },
+ { 0x42, 7 },
+ { 0x37, 7 },
+ { 0xD9, 9 },
+ { 0x362, 11 },
+ { 0x6C6, 12 },
+ { 0x1F, 5 },
+ { 0x86, 8 },
+ { 0x1, 3 },
+ { 0x2, 3 },
+ { 0xC, 4 },
+ { 0xB, 4 },
+ { 0xA, 4 },
+ { 0x1, 4 },
+ { 0xF, 5 },
+ { 0x25, 6 },
+ { 0x3C, 6 },
+ { 0x1A, 6 },
+ { 0x87, 8 },
+ { 0x1B0, 10 },
+ { 0xD8F, 13 },
+ { 0xD8E, 13 },
+ { 0xE, 4 },
+ { 0x13, 5 },
+ { 0xC, 5 },
+ { 0x24, 6 },
+ { 0x20, 6 },
+ { 0x11, 5 },
+ { 0x6D, 8 },
+ { 0x0, 4 },
+ { 0xE, 5 }
+ },
+ { /* AC bias group 2, table 5 */
+ { 0x0, 3 },
+ { 0x12, 5 },
+ { 0x76, 7 },
+ { 0x77, 7 },
+ { 0x14D, 9 },
+ { 0x533, 11 },
+ { 0x14C9, 13 },
+ { 0x13, 5 },
+ { 0xA5, 8 },
+ { 0x2, 3 },
+ { 0x3, 3 },
+ { 0xB, 4 },
+ { 0xC, 4 },
+ { 0x8, 4 },
+ { 0x1A, 5 },
+ { 0x2B, 6 },
+ { 0x75, 7 },
+ { 0x74, 7 },
+ { 0xA7, 8 },
+ { 0x298, 10 },
+ { 0x14C8, 13 },
+ { 0x14CB, 13 },
+ { 0x14CA, 13 },
+ { 0xF, 4 },
+ { 0x1C, 5 },
+ { 0x7, 5 },
+ { 0x2A, 6 },
+ { 0x28, 6 },
+ { 0x1B, 5 },
+ { 0xA4, 8 },
+ { 0x2, 4 },
+ { 0x6, 5 }
+ },
+ { /* AC bias group 2, table 6 */
+ { 0x2, 3 },
+ { 0x1A, 5 },
+ { 0x2B, 6 },
+ { 0x3A, 6 },
+ { 0xED, 8 },
+ { 0x283, 10 },
+ { 0xA0A, 12 },
+ { 0x4, 5 },
+ { 0xA1, 8 },
+ { 0x4, 3 },
+ { 0x3, 3 },
+ { 0xB, 4 },
+ { 0xC, 4 },
+ { 0x1F, 5 },
+ { 0x6, 5 },
+ { 0x77, 7 },
+ { 0xA3, 8 },
+ { 0xA2, 8 },
+ { 0x140, 9 },
+ { 0x1417, 13 },
+ { 0x1416, 13 },
+ { 0xA09, 12 },
+ { 0xA08, 12 },
+ { 0x0, 3 },
+ { 0x1E, 5 },
+ { 0x7, 5 },
+ { 0x2A, 6 },
+ { 0x29, 6 },
+ { 0x1C, 5 },
+ { 0xEC, 8 },
+ { 0x1B, 5 },
+ { 0x5, 5 }
+ },
+ { /* AC bias group 2, table 7 */
+ { 0x2, 3 },
+ { 0x2, 4 },
+ { 0x18, 5 },
+ { 0x1D, 5 },
+ { 0x35, 6 },
+ { 0xE4, 8 },
+ { 0x1CF, 11 },
+ { 0x1D, 7 },
+ { 0x72, 9 },
+ { 0x4, 3 },
+ { 0x5, 3 },
+ { 0x6, 4 },
+ { 0x7, 4 },
+ { 0x6, 5 },
+ { 0x73, 7 },
+ { 0x38, 8 },
+ { 0x1CE, 11 },
+ { 0x39B, 12 },
+ { 0x398, 12 },
+ { 0x733, 13 },
+ { 0x732, 13 },
+ { 0x735, 13 },
+ { 0x734, 13 },
+ { 0x0, 3 },
+ { 0x1F, 5 },
+ { 0x1B, 5 },
+ { 0x34, 6 },
+ { 0xF, 6 },
+ { 0x1E, 5 },
+ { 0xE5, 8 },
+ { 0x19, 5 },
+ { 0x38, 6 }
+ },
+ { /* AC bias group 2, table 8 */
+ { 0x16, 5 },
+ { 0x50, 7 },
+ { 0x172, 9 },
+ { 0x2E7, 10 },
+ { 0x1732, 13 },
+ { 0x2E67, 14 },
+ { 0x2E66, 14 },
+ { 0x6, 4 },
+ { 0x51, 7 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0xD, 4 },
+ { 0xC, 4 },
+ { 0x9, 4 },
+ { 0x1C, 5 },
+ { 0x9, 5 },
+ { 0x1C, 6 },
+ { 0x1D, 6 },
+ { 0x5D, 7 },
+ { 0xB8, 8 },
+ { 0x5CD, 11 },
+ { 0x1731, 13 },
+ { 0x1730, 13 },
+ { 0xF, 4 },
+ { 0x5, 4 },
+ { 0xF, 5 },
+ { 0x8, 5 },
+ { 0x29, 6 },
+ { 0x1D, 5 },
+ { 0x2F, 6 },
+ { 0x8, 4 },
+ { 0x15, 5 }
+ },
+ { /* AC bias group 2, table 9 */
+ { 0x9, 4 },
+ { 0x21, 6 },
+ { 0x40, 7 },
+ { 0xAD, 8 },
+ { 0x2B0, 10 },
+ { 0x1589, 13 },
+ { 0x1588, 13 },
+ { 0x1C, 5 },
+ { 0x5F, 7 },
+ { 0x0, 3 },
+ { 0xF, 4 },
+ { 0xD, 4 },
+ { 0xC, 4 },
+ { 0x6, 4 },
+ { 0x11, 5 },
+ { 0x2A, 6 },
+ { 0x57, 7 },
+ { 0x5E, 7 },
+ { 0x41, 7 },
+ { 0x159, 9 },
+ { 0x563, 11 },
+ { 0x158B, 13 },
+ { 0x158A, 13 },
+ { 0x1, 3 },
+ { 0x5, 4 },
+ { 0x14, 5 },
+ { 0x3B, 6 },
+ { 0x2E, 6 },
+ { 0x4, 4 },
+ { 0x3A, 6 },
+ { 0x7, 4 },
+ { 0x16, 5 }
+ },
+ { /* AC bias group 2, table 10 */
+ { 0xE, 4 },
+ { 0x7, 5 },
+ { 0x46, 7 },
+ { 0x45, 7 },
+ { 0x64, 9 },
+ { 0x32A, 12 },
+ { 0x657, 13 },
+ { 0x18, 5 },
+ { 0xD, 6 },
+ { 0x0, 3 },
+ { 0xF, 4 },
+ { 0xA, 4 },
+ { 0xB, 4 },
+ { 0x1A, 5 },
+ { 0x36, 6 },
+ { 0x47, 7 },
+ { 0x44, 7 },
+ { 0x18, 7 },
+ { 0x33, 8 },
+ { 0xCB, 10 },
+ { 0x656, 13 },
+ { 0x329, 12 },
+ { 0x328, 12 },
+ { 0x2, 3 },
+ { 0x6, 4 },
+ { 0x19, 5 },
+ { 0xE, 5 },
+ { 0x37, 6 },
+ { 0x9, 4 },
+ { 0xF, 5 },
+ { 0x2, 4 },
+ { 0x10, 5 }
+ },
+ { /* AC bias group 2, table 11 */
+ { 0x3, 3 },
+ { 0x18, 5 },
+ { 0x23, 6 },
+ { 0x77, 7 },
+ { 0x194, 9 },
+ { 0x1956, 13 },
+ { 0x32AF, 14 },
+ { 0x3A, 6 },
+ { 0x76, 7 },
+ { 0x2, 3 },
+ { 0x1, 3 },
+ { 0x1F, 5 },
+ { 0x1E, 5 },
+ { 0x14, 5 },
+ { 0x22, 6 },
+ { 0x64, 7 },
+ { 0x197, 9 },
+ { 0x196, 9 },
+ { 0x32B, 10 },
+ { 0x654, 11 },
+ { 0x32AE, 14 },
+ { 0x1955, 13 },
+ { 0x1954, 13 },
+ { 0x0, 3 },
+ { 0x9, 4 },
+ { 0x1C, 5 },
+ { 0x15, 5 },
+ { 0x10, 5 },
+ { 0xD, 4 },
+ { 0x17, 5 },
+ { 0x16, 5 },
+ { 0x33, 6 }
+ },
+ { /* AC bias group 2, table 12 */
+ { 0x5, 3 },
+ { 0x6, 4 },
+ { 0x3E, 6 },
+ { 0x10, 5 },
+ { 0x48, 7 },
+ { 0x93F, 12 },
+ { 0x24FA, 14 },
+ { 0x32, 6 },
+ { 0x67, 7 },
+ { 0x2, 3 },
+ { 0x1, 3 },
+ { 0x1B, 5 },
+ { 0x1E, 5 },
+ { 0x34, 6 },
+ { 0x66, 7 },
+ { 0x92, 8 },
+ { 0x126, 9 },
+ { 0x24E, 10 },
+ { 0x49E, 11 },
+ { 0x49F7, 15 },
+ { 0x49F6, 15 },
+ { 0x24F9, 14 },
+ { 0x24F8, 14 },
+ { 0x0, 3 },
+ { 0x7, 4 },
+ { 0x18, 5 },
+ { 0x11, 5 },
+ { 0x3F, 6 },
+ { 0xE, 4 },
+ { 0x13, 5 },
+ { 0x35, 6 },
+ { 0x25, 6 }
+ },
+ { /* AC bias group 2, table 13 */
+ { 0x5, 3 },
+ { 0x8, 4 },
+ { 0x12, 5 },
+ { 0x1C, 5 },
+ { 0x1C, 6 },
+ { 0xEA, 9 },
+ { 0x1D75, 14 },
+ { 0x1E, 6 },
+ { 0x66, 7 },
+ { 0x1, 3 },
+ { 0x2, 3 },
+ { 0x1B, 5 },
+ { 0x1A, 5 },
+ { 0x1F, 6 },
+ { 0x3B, 7 },
+ { 0x74, 8 },
+ { 0x1D6, 10 },
+ { 0x3AF, 11 },
+ { 0x1D74, 14 },
+ { 0x1D77, 14 },
+ { 0x1D76, 14 },
+ { 0xEB9, 13 },
+ { 0xEB8, 13 },
+ { 0xF, 4 },
+ { 0x6, 4 },
+ { 0x13, 5 },
+ { 0x3B, 6 },
+ { 0x3A, 6 },
+ { 0x0, 3 },
+ { 0x18, 5 },
+ { 0x32, 6 },
+ { 0x67, 7 }
+ },
+ { /* AC bias group 2, table 14 */
+ { 0x4, 3 },
+ { 0xA, 4 },
+ { 0x1B, 5 },
+ { 0xC, 4 },
+ { 0xD, 5 },
+ { 0xE6, 8 },
+ { 0x684, 11 },
+ { 0x72, 7 },
+ { 0xE7, 8 },
+ { 0x2, 3 },
+ { 0x1, 3 },
+ { 0x17, 5 },
+ { 0x16, 5 },
+ { 0x18, 6 },
+ { 0xD1, 8 },
+ { 0x1A0, 9 },
+ { 0x686, 11 },
+ { 0xD0F, 12 },
+ { 0xD0A, 12 },
+ { 0x1A17, 13 },
+ { 0x1A16, 13 },
+ { 0x1A1D, 13 },
+ { 0x1A1C, 13 },
+ { 0xF, 4 },
+ { 0x1D, 5 },
+ { 0xE, 5 },
+ { 0x35, 6 },
+ { 0x38, 6 },
+ { 0x0, 3 },
+ { 0xF, 5 },
+ { 0x19, 6 },
+ { 0x69, 7 }
+ },
+ { /* AC bias group 2, table 15 */
+ { 0x3, 3 },
+ { 0xC, 4 },
+ { 0x1B, 5 },
+ { 0x0, 3 },
+ { 0x3, 4 },
+ { 0x2E, 6 },
+ { 0x51, 9 },
+ { 0xBC, 8 },
+ { 0x53, 9 },
+ { 0x4, 3 },
+ { 0x2, 3 },
+ { 0x16, 5 },
+ { 0x15, 5 },
+ { 0x15, 7 },
+ { 0x50, 9 },
+ { 0xA4, 10 },
+ { 0x294, 12 },
+ { 0x52B, 13 },
+ { 0x52A, 13 },
+ { 0x52D, 13 },
+ { 0x52C, 13 },
+ { 0x52F, 13 },
+ { 0x52E, 13 },
+ { 0xE, 4 },
+ { 0x1A, 5 },
+ { 0x4, 5 },
+ { 0x28, 6 },
+ { 0x29, 6 },
+ { 0xF, 4 },
+ { 0xB, 6 },
+ { 0x5F, 7 },
+ { 0xBD, 8 }
+ }
};
static const uint16_t ac_bias_2[16][32][2] = {
- { /* AC bias group 3, table 0 */
- { 0x3, 4 },
- { 0x9, 6 },
- { 0xD0, 8 },
- { 0x1A3, 9 },
- { 0x344, 10 },
- { 0xD14, 12 },
- { 0x1A2B, 13 },
- { 0x4, 4 },
- { 0x15, 7 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0xE, 4 },
- { 0x9, 4 },
- { 0x1B, 5 },
- { 0xA, 5 },
- { 0x14, 5 },
- { 0xD, 5 },
- { 0x2A, 6 },
- { 0x14, 7 },
- { 0x68B, 11 },
- { 0x1A2A, 13 },
- { 0x8, 4 },
- { 0xB, 5 },
- { 0x2B, 6 },
- { 0xB, 6 },
- { 0x69, 7 },
- { 0x35, 6 },
- { 0x8, 6 },
- { 0x7, 4 },
- { 0xC, 5 }
- },
- { /* AC bias group 3, table 1 */
- { 0xA, 4 },
- { 0x3C, 6 },
- { 0x32, 7 },
- { 0x30, 7 },
- { 0xC5, 9 },
- { 0x621, 12 },
- { 0x620, 12 },
- { 0x1F, 5 },
- { 0x33, 7 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x4, 4 },
- { 0xD, 5 },
- { 0x26, 6 },
- { 0x27, 6 },
- { 0x14, 6 },
- { 0x63, 8 },
- { 0x189, 10 },
- { 0x623, 12 },
- { 0x622, 12 },
- { 0xB, 4 },
- { 0x12, 5 },
- { 0x3D, 6 },
- { 0x22, 6 },
- { 0x15, 6 },
- { 0xB, 5 },
- { 0x23, 6 },
- { 0x7, 4 },
- { 0x10, 5 }
- },
- { /* AC bias group 3, table 2 */
- { 0xF, 4 },
- { 0xC, 5 },
- { 0x43, 7 },
- { 0x10, 6 },
- { 0x44, 8 },
- { 0x114, 10 },
- { 0x455, 12 },
- { 0x18, 5 },
- { 0x23, 7 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0x9, 4 },
- { 0x19, 5 },
- { 0x9, 5 },
- { 0x17, 6 },
- { 0x16, 6 },
- { 0x42, 7 },
- { 0x8B, 9 },
- { 0x454, 12 },
- { 0x457, 12 },
- { 0x456, 12 },
- { 0xB, 4 },
- { 0x15, 5 },
- { 0xA, 5 },
- { 0x29, 6 },
- { 0x20, 6 },
- { 0xD, 5 },
- { 0x28, 6 },
- { 0x7, 4 },
- { 0x11, 5 }
- },
- { /* AC bias group 3, table 3 */
- { 0x1, 3 },
- { 0x1A, 5 },
- { 0x29, 6 },
- { 0x2A, 6 },
- { 0xA0, 8 },
- { 0x285, 10 },
- { 0x1425, 13 },
- { 0x2, 5 },
- { 0x0, 7 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0xC, 4 },
- { 0xB, 4 },
- { 0x8, 4 },
- { 0x12, 5 },
- { 0x1, 6 },
- { 0x51, 7 },
- { 0x1, 7 },
- { 0x143, 9 },
- { 0x508, 11 },
- { 0x1424, 13 },
- { 0x1427, 13 },
- { 0x1426, 13 },
- { 0xF, 4 },
- { 0x1C, 5 },
- { 0x3, 5 },
- { 0x37, 6 },
- { 0x2B, 6 },
- { 0x13, 5 },
- { 0x36, 6 },
- { 0x1D, 5 },
- { 0x1, 5 }
- },
- { /* AC bias group 3, table 4 */
- { 0x4, 3 },
- { 0x1F, 5 },
- { 0x3D, 6 },
- { 0x6, 5 },
- { 0x16, 7 },
- { 0x53, 9 },
- { 0x14A, 11 },
- { 0x34, 6 },
- { 0x2A, 8 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0x1C, 5 },
- { 0x37, 6 },
- { 0x17, 7 },
- { 0x2B, 8 },
- { 0x28, 8 },
- { 0xA4, 10 },
- { 0x52D, 13 },
- { 0x52C, 13 },
- { 0x52F, 13 },
- { 0x52E, 13 },
- { 0x0, 3 },
- { 0x1D, 5 },
- { 0x7, 5 },
- { 0x4, 5 },
- { 0x35, 6 },
- { 0x14, 5 },
- { 0x36, 6 },
- { 0x15, 5 },
- { 0x3C, 6 }
- },
- { /* AC bias group 3, table 5 */
- { 0x4, 3 },
- { 0xA, 4 },
- { 0x7, 5 },
- { 0x1D, 5 },
- { 0x9, 6 },
- { 0x1F3, 9 },
- { 0x7C7, 11 },
- { 0x8, 6 },
- { 0x1F0, 9 },
- { 0x3, 3 },
- { 0x2, 3 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x17, 5 },
- { 0x7D, 7 },
- { 0x1F2, 9 },
- { 0x7C6, 11 },
- { 0x7C5, 11 },
- { 0x1F12, 13 },
- { 0x3E27, 14 },
- { 0x3E26, 14 },
- { 0x1F11, 13 },
- { 0x1F10, 13 },
- { 0x0, 3 },
- { 0x1E, 5 },
- { 0x6, 5 },
- { 0x39, 6 },
- { 0x38, 6 },
- { 0x3F, 6 },
- { 0x2C, 6 },
- { 0x5, 5 },
- { 0x2D, 6 }
- },
- { /* AC bias group 3, table 6 */
- { 0x2, 3 },
- { 0x7, 4 },
- { 0x18, 5 },
- { 0x3, 4 },
- { 0x5, 5 },
- { 0x35, 7 },
- { 0x4F, 9 },
- { 0x12, 7 },
- { 0x4E5, 13 },
- { 0x5, 3 },
- { 0x4, 3 },
- { 0xD, 4 },
- { 0xE, 4 },
- { 0x33, 6 },
- { 0x26, 8 },
- { 0x9D, 10 },
- { 0x4E4, 13 },
- { 0x4E7, 13 },
- { 0x4E6, 13 },
- { 0x4E1, 13 },
- { 0x4E0, 13 },
- { 0x4E3, 13 },
- { 0x4E2, 13 },
- { 0x0, 3 },
- { 0x1F, 5 },
- { 0xC, 5 },
- { 0x3D, 6 },
- { 0x3C, 6 },
- { 0x32, 6 },
- { 0x34, 7 },
- { 0x1B, 6 },
- { 0x8, 6 }
- },
- { /* AC bias group 3, table 7 */
- { 0x0, 3 },
- { 0x4, 4 },
- { 0x1C, 5 },
- { 0xF, 4 },
- { 0x2, 4 },
- { 0x7, 5 },
- { 0x75, 7 },
- { 0xE8, 8 },
- { 0x1D2A, 13 },
- { 0x5, 3 },
- { 0x4, 3 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x77, 7 },
- { 0xE96, 12 },
- { 0x3A57, 14 },
- { 0x3A56, 14 },
- { 0x3A5D, 14 },
- { 0x3A5C, 14 },
- { 0x3A5F, 14 },
- { 0x3A5E, 14 },
- { 0x1D29, 13 },
- { 0x1D28, 13 },
- { 0x3, 3 },
- { 0x6, 5 },
- { 0xA, 5 },
- { 0x2C, 7 },
- { 0x17, 6 },
- { 0x76, 7 },
- { 0x1D3, 9 },
- { 0x3A4, 10 },
- { 0x2D, 7 }
- },
- { /* AC bias group 3, table 8 */
- { 0xA, 4 },
- { 0x24, 6 },
- { 0xBF, 8 },
- { 0x85, 8 },
- { 0x211, 10 },
- { 0x842, 12 },
- { 0x1087, 13 },
- { 0x18, 5 },
- { 0x20, 6 },
- { 0x1, 3 },
- { 0x2, 3 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0x7, 4 },
- { 0x13, 5 },
- { 0x25, 6 },
- { 0x5E, 7 },
- { 0x43, 7 },
- { 0xBE, 8 },
- { 0x109, 9 },
- { 0x1086, 13 },
- { 0x841, 12 },
- { 0x840, 12 },
- { 0xF, 4 },
- { 0x1, 4 },
- { 0x11, 5 },
- { 0x0, 5 },
- { 0x2E, 6 },
- { 0x19, 5 },
- { 0x1, 5 },
- { 0x6, 4 },
- { 0x16, 5 }
- },
- { /* AC bias group 3, table 9 */
- { 0x2, 3 },
- { 0xF, 5 },
- { 0x6F, 7 },
- { 0x61, 7 },
- { 0x374, 10 },
- { 0x1BA8, 13 },
- { 0x3753, 14 },
- { 0x12, 5 },
- { 0x36, 6 },
- { 0x0, 3 },
- { 0x1, 3 },
- { 0xA, 4 },
- { 0xB, 4 },
- { 0x1A, 5 },
- { 0x31, 6 },
- { 0x60, 7 },
- { 0xDC, 8 },
- { 0x1BB, 9 },
- { 0x6EB, 11 },
- { 0x1BAB, 13 },
- { 0x3752, 14 },
- { 0x3755, 14 },
- { 0x3754, 14 },
- { 0xE, 4 },
- { 0x6, 4 },
- { 0x13, 5 },
- { 0xE, 5 },
- { 0x3E, 6 },
- { 0x8, 4 },
- { 0x1E, 5 },
- { 0x19, 5 },
- { 0x3F, 6 }
- },
- { /* AC bias group 3, table 10 */
- { 0x3, 3 },
- { 0x1C, 5 },
- { 0x25, 6 },
- { 0x24, 6 },
- { 0x1DA, 9 },
- { 0x1DBD, 13 },
- { 0x3B7C, 14 },
- { 0x3C, 6 },
- { 0x3D, 6 },
- { 0x0, 3 },
- { 0x1, 3 },
- { 0xB, 4 },
- { 0xA, 4 },
- { 0xB, 5 },
- { 0x77, 7 },
- { 0xEC, 8 },
- { 0x3B6, 10 },
- { 0x76E, 11 },
- { 0x1DBF, 13 },
- { 0x76FB, 15 },
- { 0x76FA, 15 },
- { 0x3B79, 14 },
- { 0x3B78, 14 },
- { 0xD, 4 },
- { 0x1F, 5 },
- { 0x13, 5 },
- { 0xA, 5 },
- { 0x8, 5 },
- { 0xC, 4 },
- { 0x8, 4 },
- { 0x9, 5 },
- { 0x3A, 6 }
- },
- { /* AC bias group 3, table 11 */
- { 0x5, 3 },
- { 0x3, 4 },
- { 0x4, 5 },
- { 0x10, 5 },
- { 0x8F, 8 },
- { 0x475, 11 },
- { 0x11D1, 13 },
- { 0x79, 7 },
- { 0x27, 6 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0x1, 4 },
- { 0x0, 4 },
- { 0x26, 6 },
- { 0x46, 7 },
- { 0x11C, 9 },
- { 0x477, 11 },
- { 0x8ED, 12 },
- { 0x11D0, 13 },
- { 0x11D3, 13 },
- { 0x11D2, 13 },
- { 0x11D9, 13 },
- { 0x11D8, 13 },
- { 0xD, 4 },
- { 0x1F, 5 },
- { 0x12, 5 },
- { 0x5, 5 },
- { 0x3D, 6 },
- { 0xC, 4 },
- { 0xE, 4 },
- { 0x22, 6 },
- { 0x78, 7 }
- },
- { /* AC bias group 3, table 12 */
- { 0x5, 3 },
- { 0xC, 4 },
- { 0x1B, 5 },
- { 0x0, 4 },
- { 0x6, 6 },
- { 0x3E2, 10 },
- { 0x3E3D, 14 },
- { 0xF, 7 },
- { 0x34, 6 },
- { 0x3, 3 },
- { 0x2, 3 },
- { 0x1E, 5 },
- { 0x1D, 5 },
- { 0x7D, 7 },
- { 0x1F0, 9 },
- { 0x7C6, 11 },
- { 0x3E3C, 14 },
- { 0x3E3F, 14 },
- { 0x3E3E, 14 },
- { 0x3E39, 14 },
- { 0x3E38, 14 },
- { 0x3E3B, 14 },
- { 0x3E3A, 14 },
- { 0x8, 4 },
- { 0x1C, 5 },
- { 0x2, 5 },
- { 0x3F, 6 },
- { 0x35, 6 },
- { 0x9, 4 },
- { 0x1, 3 },
- { 0xE, 7 },
- { 0xF9, 8 }
- },
- { /* AC bias group 3, table 13 */
- { 0x4, 3 },
- { 0xB, 4 },
- { 0x1, 4 },
- { 0xA, 4 },
- { 0x1E, 6 },
- { 0xE0, 9 },
- { 0xE1E, 13 },
- { 0x71, 8 },
- { 0x39, 7 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0xD, 5 },
- { 0xC, 5 },
- { 0x20, 7 },
- { 0x1C2, 10 },
- { 0x1C3F, 14 },
- { 0x1C3E, 14 },
- { 0xE19, 13 },
- { 0xE18, 13 },
- { 0xE1B, 13 },
- { 0xE1A, 13 },
- { 0xE1D, 13 },
- { 0xE1C, 13 },
- { 0x0, 4 },
- { 0x9, 5 },
- { 0x1D, 6 },
- { 0x1F, 6 },
- { 0x11, 6 },
- { 0x5, 4 },
- { 0x1, 3 },
- { 0x43, 8 },
- { 0x42, 8 }
- },
- { /* AC bias group 3, table 14 */
- { 0x4, 3 },
- { 0xD, 4 },
- { 0x7, 4 },
- { 0x2, 3 },
- { 0x14, 5 },
- { 0x16C, 9 },
- { 0x16D1, 13 },
- { 0x2DF, 10 },
- { 0x16E, 9 },
- { 0x0, 2 },
- { 0x7, 3 },
- { 0x2C, 6 },
- { 0x2B, 6 },
- { 0x2DE, 10 },
- { 0x16D0, 13 },
- { 0x16D3, 13 },
- { 0x16D2, 13 },
- { 0x2DB5, 14 },
- { 0x2DB4, 14 },
- { 0x2DB7, 14 },
- { 0x2DB6, 14 },
- { 0x16D9, 13 },
- { 0x16D8, 13 },
- { 0xC, 5 },
- { 0x2A, 6 },
- { 0x5A, 7 },
- { 0x1B, 6 },
- { 0x1A, 6 },
- { 0x17, 5 },
- { 0xC, 4 },
- { 0x5B7, 11 },
- { 0x5B5, 11 }
- },
- { /* AC bias group 3, table 15 */
- { 0x2, 2 },
- { 0xF, 4 },
- { 0x1C, 5 },
- { 0xC, 4 },
- { 0x3B, 6 },
- { 0x1AC, 9 },
- { 0x1AD8, 13 },
- { 0x35B3, 14 },
- { 0x35B2, 14 },
- { 0x1, 2 },
- { 0x0, 2 },
- { 0x69, 7 },
- { 0x68, 7 },
- { 0x35BD, 14 },
- { 0x35BC, 14 },
- { 0x35BF, 14 },
- { 0x35BE, 14 },
- { 0x35B9, 14 },
- { 0x35B8, 14 },
- { 0x35BB, 14 },
- { 0x35BA, 14 },
- { 0x35B5, 14 },
- { 0x35B4, 14 },
- { 0x1A9, 9 },
- { 0x1A8, 9 },
- { 0x35A, 10 },
- { 0xD7, 8 },
- { 0xD5, 8 },
- { 0x3A, 6 },
- { 0x1B, 5 },
- { 0x35B7, 14 },
- { 0x35B6, 14 }
- }
+ { /* AC bias group 3, table 0 */
+ { 0x3, 4 },
+ { 0x9, 6 },
+ { 0xD0, 8 },
+ { 0x1A3, 9 },
+ { 0x344, 10 },
+ { 0xD14, 12 },
+ { 0x1A2B, 13 },
+ { 0x4, 4 },
+ { 0x15, 7 },
+ { 0x0, 3 },
+ { 0xF, 4 },
+ { 0xB, 4 },
+ { 0xC, 4 },
+ { 0xE, 4 },
+ { 0x9, 4 },
+ { 0x1B, 5 },
+ { 0xA, 5 },
+ { 0x14, 5 },
+ { 0xD, 5 },
+ { 0x2A, 6 },
+ { 0x14, 7 },
+ { 0x68B, 11 },
+ { 0x1A2A, 13 },
+ { 0x8, 4 },
+ { 0xB, 5 },
+ { 0x2B, 6 },
+ { 0xB, 6 },
+ { 0x69, 7 },
+ { 0x35, 6 },
+ { 0x8, 6 },
+ { 0x7, 4 },
+ { 0xC, 5 }
+ },
+ { /* AC bias group 3, table 1 */
+ { 0xA, 4 },
+ { 0x3C, 6 },
+ { 0x32, 7 },
+ { 0x30, 7 },
+ { 0xC5, 9 },
+ { 0x621, 12 },
+ { 0x620, 12 },
+ { 0x1F, 5 },
+ { 0x33, 7 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0xE, 4 },
+ { 0xD, 4 },
+ { 0xC, 4 },
+ { 0x4, 4 },
+ { 0xD, 5 },
+ { 0x26, 6 },
+ { 0x27, 6 },
+ { 0x14, 6 },
+ { 0x63, 8 },
+ { 0x189, 10 },
+ { 0x623, 12 },
+ { 0x622, 12 },
+ { 0xB, 4 },
+ { 0x12, 5 },
+ { 0x3D, 6 },
+ { 0x22, 6 },
+ { 0x15, 6 },
+ { 0xB, 5 },
+ { 0x23, 6 },
+ { 0x7, 4 },
+ { 0x10, 5 }
+ },
+ { /* AC bias group 3, table 2 */
+ { 0xF, 4 },
+ { 0xC, 5 },
+ { 0x43, 7 },
+ { 0x10, 6 },
+ { 0x44, 8 },
+ { 0x114, 10 },
+ { 0x455, 12 },
+ { 0x18, 5 },
+ { 0x23, 7 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0xE, 4 },
+ { 0xD, 4 },
+ { 0x9, 4 },
+ { 0x19, 5 },
+ { 0x9, 5 },
+ { 0x17, 6 },
+ { 0x16, 6 },
+ { 0x42, 7 },
+ { 0x8B, 9 },
+ { 0x454, 12 },
+ { 0x457, 12 },
+ { 0x456, 12 },
+ { 0xB, 4 },
+ { 0x15, 5 },
+ { 0xA, 5 },
+ { 0x29, 6 },
+ { 0x20, 6 },
+ { 0xD, 5 },
+ { 0x28, 6 },
+ { 0x7, 4 },
+ { 0x11, 5 }
+ },
+ { /* AC bias group 3, table 3 */
+ { 0x1, 3 },
+ { 0x1A, 5 },
+ { 0x29, 6 },
+ { 0x2A, 6 },
+ { 0xA0, 8 },
+ { 0x285, 10 },
+ { 0x1425, 13 },
+ { 0x2, 5 },
+ { 0x0, 7 },
+ { 0x2, 3 },
+ { 0x3, 3 },
+ { 0xC, 4 },
+ { 0xB, 4 },
+ { 0x8, 4 },
+ { 0x12, 5 },
+ { 0x1, 6 },
+ { 0x51, 7 },
+ { 0x1, 7 },
+ { 0x143, 9 },
+ { 0x508, 11 },
+ { 0x1424, 13 },
+ { 0x1427, 13 },
+ { 0x1426, 13 },
+ { 0xF, 4 },
+ { 0x1C, 5 },
+ { 0x3, 5 },
+ { 0x37, 6 },
+ { 0x2B, 6 },
+ { 0x13, 5 },
+ { 0x36, 6 },
+ { 0x1D, 5 },
+ { 0x1, 5 }
+ },
+ { /* AC bias group 3, table 4 */
+ { 0x4, 3 },
+ { 0x1F, 5 },
+ { 0x3D, 6 },
+ { 0x6, 5 },
+ { 0x16, 7 },
+ { 0x53, 9 },
+ { 0x14A, 11 },
+ { 0x34, 6 },
+ { 0x2A, 8 },
+ { 0x2, 3 },
+ { 0x3, 3 },
+ { 0xB, 4 },
+ { 0xC, 4 },
+ { 0x1C, 5 },
+ { 0x37, 6 },
+ { 0x17, 7 },
+ { 0x2B, 8 },
+ { 0x28, 8 },
+ { 0xA4, 10 },
+ { 0x52D, 13 },
+ { 0x52C, 13 },
+ { 0x52F, 13 },
+ { 0x52E, 13 },
+ { 0x0, 3 },
+ { 0x1D, 5 },
+ { 0x7, 5 },
+ { 0x4, 5 },
+ { 0x35, 6 },
+ { 0x14, 5 },
+ { 0x36, 6 },
+ { 0x15, 5 },
+ { 0x3C, 6 }
+ },
+ { /* AC bias group 3, table 5 */
+ { 0x4, 3 },
+ { 0xA, 4 },
+ { 0x7, 5 },
+ { 0x1D, 5 },
+ { 0x9, 6 },
+ { 0x1F3, 9 },
+ { 0x7C7, 11 },
+ { 0x8, 6 },
+ { 0x1F0, 9 },
+ { 0x3, 3 },
+ { 0x2, 3 },
+ { 0xD, 4 },
+ { 0xC, 4 },
+ { 0x17, 5 },
+ { 0x7D, 7 },
+ { 0x1F2, 9 },
+ { 0x7C6, 11 },
+ { 0x7C5, 11 },
+ { 0x1F12, 13 },
+ { 0x3E27, 14 },
+ { 0x3E26, 14 },
+ { 0x1F11, 13 },
+ { 0x1F10, 13 },
+ { 0x0, 3 },
+ { 0x1E, 5 },
+ { 0x6, 5 },
+ { 0x39, 6 },
+ { 0x38, 6 },
+ { 0x3F, 6 },
+ { 0x2C, 6 },
+ { 0x5, 5 },
+ { 0x2D, 6 }
+ },
+ { /* AC bias group 3, table 6 */
+ { 0x2, 3 },
+ { 0x7, 4 },
+ { 0x18, 5 },
+ { 0x3, 4 },
+ { 0x5, 5 },
+ { 0x35, 7 },
+ { 0x4F, 9 },
+ { 0x12, 7 },
+ { 0x4E5, 13 },
+ { 0x5, 3 },
+ { 0x4, 3 },
+ { 0xD, 4 },
+ { 0xE, 4 },
+ { 0x33, 6 },
+ { 0x26, 8 },
+ { 0x9D, 10 },
+ { 0x4E4, 13 },
+ { 0x4E7, 13 },
+ { 0x4E6, 13 },
+ { 0x4E1, 13 },
+ { 0x4E0, 13 },
+ { 0x4E3, 13 },
+ { 0x4E2, 13 },
+ { 0x0, 3 },
+ { 0x1F, 5 },
+ { 0xC, 5 },
+ { 0x3D, 6 },
+ { 0x3C, 6 },
+ { 0x32, 6 },
+ { 0x34, 7 },
+ { 0x1B, 6 },
+ { 0x8, 6 }
+ },
+ { /* AC bias group 3, table 7 */
+ { 0x0, 3 },
+ { 0x4, 4 },
+ { 0x1C, 5 },
+ { 0xF, 4 },
+ { 0x2, 4 },
+ { 0x7, 5 },
+ { 0x75, 7 },
+ { 0xE8, 8 },
+ { 0x1D2A, 13 },
+ { 0x5, 3 },
+ { 0x4, 3 },
+ { 0xD, 4 },
+ { 0xC, 4 },
+ { 0x77, 7 },
+ { 0xE96, 12 },
+ { 0x3A57, 14 },
+ { 0x3A56, 14 },
+ { 0x3A5D, 14 },
+ { 0x3A5C, 14 },
+ { 0x3A5F, 14 },
+ { 0x3A5E, 14 },
+ { 0x1D29, 13 },
+ { 0x1D28, 13 },
+ { 0x3, 3 },
+ { 0x6, 5 },
+ { 0xA, 5 },
+ { 0x2C, 7 },
+ { 0x17, 6 },
+ { 0x76, 7 },
+ { 0x1D3, 9 },
+ { 0x3A4, 10 },
+ { 0x2D, 7 }
+ },
+ { /* AC bias group 3, table 8 */
+ { 0xA, 4 },
+ { 0x24, 6 },
+ { 0xBF, 8 },
+ { 0x85, 8 },
+ { 0x211, 10 },
+ { 0x842, 12 },
+ { 0x1087, 13 },
+ { 0x18, 5 },
+ { 0x20, 6 },
+ { 0x1, 3 },
+ { 0x2, 3 },
+ { 0xE, 4 },
+ { 0xD, 4 },
+ { 0x7, 4 },
+ { 0x13, 5 },
+ { 0x25, 6 },
+ { 0x5E, 7 },
+ { 0x43, 7 },
+ { 0xBE, 8 },
+ { 0x109, 9 },
+ { 0x1086, 13 },
+ { 0x841, 12 },
+ { 0x840, 12 },
+ { 0xF, 4 },
+ { 0x1, 4 },
+ { 0x11, 5 },
+ { 0x0, 5 },
+ { 0x2E, 6 },
+ { 0x19, 5 },
+ { 0x1, 5 },
+ { 0x6, 4 },
+ { 0x16, 5 }
+ },
+ { /* AC bias group 3, table 9 */
+ { 0x2, 3 },
+ { 0xF, 5 },
+ { 0x6F, 7 },
+ { 0x61, 7 },
+ { 0x374, 10 },
+ { 0x1BA8, 13 },
+ { 0x3753, 14 },
+ { 0x12, 5 },
+ { 0x36, 6 },
+ { 0x0, 3 },
+ { 0x1, 3 },
+ { 0xA, 4 },
+ { 0xB, 4 },
+ { 0x1A, 5 },
+ { 0x31, 6 },
+ { 0x60, 7 },
+ { 0xDC, 8 },
+ { 0x1BB, 9 },
+ { 0x6EB, 11 },
+ { 0x1BAB, 13 },
+ { 0x3752, 14 },
+ { 0x3755, 14 },
+ { 0x3754, 14 },
+ { 0xE, 4 },
+ { 0x6, 4 },
+ { 0x13, 5 },
+ { 0xE, 5 },
+ { 0x3E, 6 },
+ { 0x8, 4 },
+ { 0x1E, 5 },
+ { 0x19, 5 },
+ { 0x3F, 6 }
+ },
+ { /* AC bias group 3, table 10 */
+ { 0x3, 3 },
+ { 0x1C, 5 },
+ { 0x25, 6 },
+ { 0x24, 6 },
+ { 0x1DA, 9 },
+ { 0x1DBD, 13 },
+ { 0x3B7C, 14 },
+ { 0x3C, 6 },
+ { 0x3D, 6 },
+ { 0x0, 3 },
+ { 0x1, 3 },
+ { 0xB, 4 },
+ { 0xA, 4 },
+ { 0xB, 5 },
+ { 0x77, 7 },
+ { 0xEC, 8 },
+ { 0x3B6, 10 },
+ { 0x76E, 11 },
+ { 0x1DBF, 13 },
+ { 0x76FB, 15 },
+ { 0x76FA, 15 },
+ { 0x3B79, 14 },
+ { 0x3B78, 14 },
+ { 0xD, 4 },
+ { 0x1F, 5 },
+ { 0x13, 5 },
+ { 0xA, 5 },
+ { 0x8, 5 },
+ { 0xC, 4 },
+ { 0x8, 4 },
+ { 0x9, 5 },
+ { 0x3A, 6 }
+ },
+ { /* AC bias group 3, table 11 */
+ { 0x5, 3 },
+ { 0x3, 4 },
+ { 0x4, 5 },
+ { 0x10, 5 },
+ { 0x8F, 8 },
+ { 0x475, 11 },
+ { 0x11D1, 13 },
+ { 0x79, 7 },
+ { 0x27, 6 },
+ { 0x2, 3 },
+ { 0x3, 3 },
+ { 0x1, 4 },
+ { 0x0, 4 },
+ { 0x26, 6 },
+ { 0x46, 7 },
+ { 0x11C, 9 },
+ { 0x477, 11 },
+ { 0x8ED, 12 },
+ { 0x11D0, 13 },
+ { 0x11D3, 13 },
+ { 0x11D2, 13 },
+ { 0x11D9, 13 },
+ { 0x11D8, 13 },
+ { 0xD, 4 },
+ { 0x1F, 5 },
+ { 0x12, 5 },
+ { 0x5, 5 },
+ { 0x3D, 6 },
+ { 0xC, 4 },
+ { 0xE, 4 },
+ { 0x22, 6 },
+ { 0x78, 7 }
+ },
+ { /* AC bias group 3, table 12 */
+ { 0x5, 3 },
+ { 0xC, 4 },
+ { 0x1B, 5 },
+ { 0x0, 4 },
+ { 0x6, 6 },
+ { 0x3E2, 10 },
+ { 0x3E3D, 14 },
+ { 0xF, 7 },
+ { 0x34, 6 },
+ { 0x3, 3 },
+ { 0x2, 3 },
+ { 0x1E, 5 },
+ { 0x1D, 5 },
+ { 0x7D, 7 },
+ { 0x1F0, 9 },
+ { 0x7C6, 11 },
+ { 0x3E3C, 14 },
+ { 0x3E3F, 14 },
+ { 0x3E3E, 14 },
+ { 0x3E39, 14 },
+ { 0x3E38, 14 },
+ { 0x3E3B, 14 },
+ { 0x3E3A, 14 },
+ { 0x8, 4 },
+ { 0x1C, 5 },
+ { 0x2, 5 },
+ { 0x3F, 6 },
+ { 0x35, 6 },
+ { 0x9, 4 },
+ { 0x1, 3 },
+ { 0xE, 7 },
+ { 0xF9, 8 }
+ },
+ { /* AC bias group 3, table 13 */
+ { 0x4, 3 },
+ { 0xB, 4 },
+ { 0x1, 4 },
+ { 0xA, 4 },
+ { 0x1E, 6 },
+ { 0xE0, 9 },
+ { 0xE1E, 13 },
+ { 0x71, 8 },
+ { 0x39, 7 },
+ { 0x7, 3 },
+ { 0x6, 3 },
+ { 0xD, 5 },
+ { 0xC, 5 },
+ { 0x20, 7 },
+ { 0x1C2, 10 },
+ { 0x1C3F, 14 },
+ { 0x1C3E, 14 },
+ { 0xE19, 13 },
+ { 0xE18, 13 },
+ { 0xE1B, 13 },
+ { 0xE1A, 13 },
+ { 0xE1D, 13 },
+ { 0xE1C, 13 },
+ { 0x0, 4 },
+ { 0x9, 5 },
+ { 0x1D, 6 },
+ { 0x1F, 6 },
+ { 0x11, 6 },
+ { 0x5, 4 },
+ { 0x1, 3 },
+ { 0x43, 8 },
+ { 0x42, 8 }
+ },
+ { /* AC bias group 3, table 14 */
+ { 0x4, 3 },
+ { 0xD, 4 },
+ { 0x7, 4 },
+ { 0x2, 3 },
+ { 0x14, 5 },
+ { 0x16C, 9 },
+ { 0x16D1, 13 },
+ { 0x2DF, 10 },
+ { 0x16E, 9 },
+ { 0x0, 2 },
+ { 0x7, 3 },
+ { 0x2C, 6 },
+ { 0x2B, 6 },
+ { 0x2DE, 10 },
+ { 0x16D0, 13 },
+ { 0x16D3, 13 },
+ { 0x16D2, 13 },
+ { 0x2DB5, 14 },
+ { 0x2DB4, 14 },
+ { 0x2DB7, 14 },
+ { 0x2DB6, 14 },
+ { 0x16D9, 13 },
+ { 0x16D8, 13 },
+ { 0xC, 5 },
+ { 0x2A, 6 },
+ { 0x5A, 7 },
+ { 0x1B, 6 },
+ { 0x1A, 6 },
+ { 0x17, 5 },
+ { 0xC, 4 },
+ { 0x5B7, 11 },
+ { 0x5B5, 11 }
+ },
+ { /* AC bias group 3, table 15 */
+ { 0x2, 2 },
+ { 0xF, 4 },
+ { 0x1C, 5 },
+ { 0xC, 4 },
+ { 0x3B, 6 },
+ { 0x1AC, 9 },
+ { 0x1AD8, 13 },
+ { 0x35B3, 14 },
+ { 0x35B2, 14 },
+ { 0x1, 2 },
+ { 0x0, 2 },
+ { 0x69, 7 },
+ { 0x68, 7 },
+ { 0x35BD, 14 },
+ { 0x35BC, 14 },
+ { 0x35BF, 14 },
+ { 0x35BE, 14 },
+ { 0x35B9, 14 },
+ { 0x35B8, 14 },
+ { 0x35BB, 14 },
+ { 0x35BA, 14 },
+ { 0x35B5, 14 },
+ { 0x35B4, 14 },
+ { 0x1A9, 9 },
+ { 0x1A8, 9 },
+ { 0x35A, 10 },
+ { 0xD7, 8 },
+ { 0xD5, 8 },
+ { 0x3A, 6 },
+ { 0x1B, 5 },
+ { 0x35B7, 14 },
+ { 0x35B6, 14 }
+ }
};
static const uint16_t ac_bias_3[16][32][2] = {
- { /* AC bias group 4, table 0 */
- { 0x0, 3 },
- { 0x10, 5 },
- { 0x72, 7 },
- { 0x71, 7 },
- { 0x154, 9 },
- { 0xAAB, 12 },
- { 0xAA8, 12 },
- { 0x14, 5 },
- { 0x70, 7 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0xC, 4 },
- { 0xB, 4 },
- { 0x3, 4 },
- { 0x11, 5 },
- { 0x73, 7 },
- { 0x54, 7 },
- { 0xAB, 8 },
- { 0x2AB, 10 },
- { 0x1553, 13 },
- { 0x1552, 13 },
- { 0x1555, 13 },
- { 0x1554, 13 },
- { 0xD, 4 },
- { 0x1E, 5 },
- { 0x12, 5 },
- { 0x3E, 6 },
- { 0x2B, 6 },
- { 0x2, 4 },
- { 0x3F, 6 },
- { 0x1D, 5 },
- { 0x13, 5 }
- },
- { /* AC bias group 4, table 1 */
- { 0x3, 3 },
- { 0x1F, 5 },
- { 0x29, 6 },
- { 0x3D, 6 },
- { 0xC, 7 },
- { 0x69, 10 },
- { 0x345, 13 },
- { 0x2, 5 },
- { 0x28, 6 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0xE, 4 },
- { 0xC, 4 },
- { 0x15, 5 },
- { 0x7, 6 },
- { 0x1B, 8 },
- { 0x6B, 10 },
- { 0x6A, 10 },
- { 0x344, 13 },
- { 0x347, 13 },
- { 0x346, 13 },
- { 0x1A1, 12 },
- { 0x1A0, 12 },
- { 0xB, 4 },
- { 0x1A, 5 },
- { 0x12, 5 },
- { 0x0, 5 },
- { 0x3C, 6 },
- { 0x8, 4 },
- { 0x1B, 5 },
- { 0x13, 5 },
- { 0x1, 5 }
- },
- { /* AC bias group 4, table 2 */
- { 0x4, 3 },
- { 0x4, 4 },
- { 0x3F, 6 },
- { 0x14, 5 },
- { 0x56, 7 },
- { 0x15C, 9 },
- { 0x15D5, 13 },
- { 0x3C, 6 },
- { 0x2A, 6 },
- { 0x0, 3 },
- { 0x1, 3 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0xC, 5 },
- { 0xAF, 8 },
- { 0x2BB, 10 },
- { 0x15D4, 13 },
- { 0x15D7, 13 },
- { 0x15D6, 13 },
- { 0x15D1, 13 },
- { 0x15D0, 13 },
- { 0x15D3, 13 },
- { 0x15D2, 13 },
- { 0xB, 4 },
- { 0x19, 5 },
- { 0xD, 5 },
- { 0x3E, 6 },
- { 0x31, 6 },
- { 0x7, 4 },
- { 0x5, 4 },
- { 0x3D, 6 },
- { 0x30, 6 }
- },
- { /* AC bias group 4, table 3 */
- { 0x5, 3 },
- { 0x8, 4 },
- { 0x1A, 5 },
- { 0x0, 4 },
- { 0x36, 6 },
- { 0x11, 8 },
- { 0x106, 12 },
- { 0xA, 7 },
- { 0x6E, 7 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0x3, 4 },
- { 0x2, 4 },
- { 0x6F, 7 },
- { 0x21, 9 },
- { 0x20F, 13 },
- { 0x20E, 13 },
- { 0x101, 12 },
- { 0x100, 12 },
- { 0x103, 12 },
- { 0x102, 12 },
- { 0x105, 12 },
- { 0x104, 12 },
- { 0xC, 4 },
- { 0x1E, 5 },
- { 0x3, 5 },
- { 0x3E, 6 },
- { 0x3F, 6 },
- { 0x9, 4 },
- { 0xE, 4 },
- { 0xB, 7 },
- { 0x9, 7 }
- },
- { /* AC bias group 4, table 4 */
- { 0x2, 3 },
- { 0xE, 4 },
- { 0x1E, 5 },
- { 0xC, 4 },
- { 0x1F, 5 },
- { 0x6E, 7 },
- { 0xAD, 10 },
- { 0xAF, 10 },
- { 0x14, 7 },
- { 0x4, 3 },
- { 0x3, 3 },
- { 0x1A, 5 },
- { 0x17, 5 },
- { 0x2A, 8 },
- { 0x576, 13 },
- { 0xAEF, 14 },
- { 0xAEE, 14 },
- { 0x571, 13 },
- { 0x570, 13 },
- { 0x573, 13 },
- { 0x572, 13 },
- { 0x575, 13 },
- { 0x574, 13 },
- { 0x3, 4 },
- { 0x16, 5 },
- { 0x4, 5 },
- { 0x36, 6 },
- { 0xB, 6 },
- { 0xA, 4 },
- { 0x0, 3 },
- { 0x6F, 7 },
- { 0xAC, 10 }
- },
- { /* AC bias group 4, table 5 */
- { 0x4, 3 },
- { 0x5, 4 },
- { 0x3, 3 },
- { 0x1, 3 },
- { 0x4, 4 },
- { 0x2F, 6 },
- { 0x526, 11 },
- { 0x1495, 13 },
- { 0xA6, 8 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x2D, 6 },
- { 0x2C, 6 },
- { 0x1494, 13 },
- { 0x1497, 13 },
- { 0x1496, 13 },
- { 0x1491, 13 },
- { 0x1490, 13 },
- { 0x1493, 13 },
- { 0x1492, 13 },
- { 0x293D, 14 },
- { 0x293C, 14 },
- { 0x293F, 14 },
- { 0x0, 3 },
- { 0x28, 6 },
- { 0xA5, 8 },
- { 0x148, 9 },
- { 0xA7, 8 },
- { 0x2E, 6 },
- { 0x15, 5 },
- { 0xA4E, 12 },
- { 0x293E, 14 }
- },
- { /* AC bias group 4, table 6 */
- { 0x4, 3 },
- { 0x5, 4 },
- { 0x3, 3 },
- { 0x1, 3 },
- { 0x4, 4 },
- { 0x2F, 6 },
- { 0x526, 11 },
- { 0x1495, 13 },
- { 0xA6, 8 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x2D, 6 },
- { 0x2C, 6 },
- { 0x1494, 13 },
- { 0x1497, 13 },
- { 0x1496, 13 },
- { 0x1491, 13 },
- { 0x1490, 13 },
- { 0x1493, 13 },
- { 0x1492, 13 },
- { 0x293D, 14 },
- { 0x293C, 14 },
- { 0x293F, 14 },
- { 0x0, 3 },
- { 0x28, 6 },
- { 0xA5, 8 },
- { 0x148, 9 },
- { 0xA7, 8 },
- { 0x2E, 6 },
- { 0x15, 5 },
- { 0xA4E, 12 },
- { 0x293E, 14 }
- },
- { /* AC bias group 4, table 7 */
- { 0x4, 3 },
- { 0x5, 4 },
- { 0x3, 3 },
- { 0x1, 3 },
- { 0x4, 4 },
- { 0x2F, 6 },
- { 0x526, 11 },
- { 0x1495, 13 },
- { 0xA6, 8 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x2D, 6 },
- { 0x2C, 6 },
- { 0x1494, 13 },
- { 0x1497, 13 },
- { 0x1496, 13 },
- { 0x1491, 13 },
- { 0x1490, 13 },
- { 0x1493, 13 },
- { 0x1492, 13 },
- { 0x293D, 14 },
- { 0x293C, 14 },
- { 0x293F, 14 },
- { 0x0, 3 },
- { 0x28, 6 },
- { 0xA5, 8 },
- { 0x148, 9 },
- { 0xA7, 8 },
- { 0x2E, 6 },
- { 0x15, 5 },
- { 0xA4E, 12 },
- { 0x293E, 14 }
- },
- { /* AC bias group 4, table 8 */
- { 0x3, 3 },
- { 0x11, 5 },
- { 0x20, 6 },
- { 0x74, 7 },
- { 0x10D, 9 },
- { 0x863, 12 },
- { 0x860, 12 },
- { 0xA, 5 },
- { 0x75, 7 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xB, 4 },
- { 0xA, 4 },
- { 0x18, 5 },
- { 0x38, 6 },
- { 0x42, 7 },
- { 0x10F, 9 },
- { 0x10E, 9 },
- { 0x219, 10 },
- { 0x10C3, 13 },
- { 0x10C2, 13 },
- { 0x10C5, 13 },
- { 0x10C4, 13 },
- { 0xF, 4 },
- { 0x4, 4 },
- { 0x19, 5 },
- { 0xB, 5 },
- { 0x39, 6 },
- { 0x9, 4 },
- { 0x1B, 5 },
- { 0x1A, 5 },
- { 0x3B, 6 }
- },
- { /* AC bias group 4, table 9 */
- { 0x5, 3 },
- { 0x1, 4 },
- { 0x3E, 6 },
- { 0x1, 5 },
- { 0xE2, 8 },
- { 0x1C6F, 13 },
- { 0x38D9, 14 },
- { 0x39, 6 },
- { 0x1F, 6 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x0, 5 },
- { 0x70, 7 },
- { 0x1C7, 9 },
- { 0x38C, 10 },
- { 0x71A, 11 },
- { 0x38D8, 14 },
- { 0x38DB, 14 },
- { 0x38DA, 14 },
- { 0x38DD, 14 },
- { 0x38DC, 14 },
- { 0xD, 4 },
- { 0x1D, 5 },
- { 0xE, 5 },
- { 0x3F, 6 },
- { 0x3C, 6 },
- { 0xC, 4 },
- { 0x6, 4 },
- { 0x3D, 6 },
- { 0x1E, 6 }
- },
- { /* AC bias group 4, table 10 */
- { 0x6, 3 },
- { 0xB, 4 },
- { 0x11, 5 },
- { 0x1E, 5 },
- { 0x74, 7 },
- { 0x3AA, 10 },
- { 0x1D5C, 13 },
- { 0x1, 6 },
- { 0x21, 6 },
- { 0x1, 3 },
- { 0x2, 3 },
- { 0x7, 4 },
- { 0x6, 4 },
- { 0x3E, 6 },
- { 0xEB, 8 },
- { 0x1D4, 9 },
- { 0xEAF, 12 },
- { 0x3ABB, 14 },
- { 0x3ABA, 14 },
- { 0x1D59, 13 },
- { 0x1D58, 13 },
- { 0x1D5B, 13 },
- { 0x1D5A, 13 },
- { 0xA, 4 },
- { 0x1C, 5 },
- { 0x1, 5 },
- { 0x3F, 6 },
- { 0x3B, 6 },
- { 0x1, 4 },
- { 0x9, 4 },
- { 0x20, 6 },
- { 0x0, 6 }
- },
- { /* AC bias group 4, table 11 */
- { 0x4, 3 },
- { 0xA, 4 },
- { 0x17, 5 },
- { 0x4, 4 },
- { 0x16, 6 },
- { 0x16A, 9 },
- { 0x16B1, 13 },
- { 0x17, 7 },
- { 0x5B, 7 },
- { 0x6, 3 },
- { 0x7, 3 },
- { 0x1, 4 },
- { 0x0, 4 },
- { 0xA, 6 },
- { 0x2D7, 10 },
- { 0xB5A, 12 },
- { 0x16B0, 13 },
- { 0x16B3, 13 },
- { 0x16B2, 13 },
- { 0x2D6D, 14 },
- { 0x2D6C, 14 },
- { 0x2D6F, 14 },
- { 0x2D6E, 14 },
- { 0x6, 4 },
- { 0xA, 5 },
- { 0x4, 5 },
- { 0x2C, 6 },
- { 0x17, 6 },
- { 0x3, 4 },
- { 0x7, 4 },
- { 0x16, 7 },
- { 0xB4, 8 }
- },
- { /* AC bias group 4, table 12 */
- { 0x5, 3 },
- { 0xD, 4 },
- { 0x5, 4 },
- { 0x9, 4 },
- { 0x33, 6 },
- { 0x193, 9 },
- { 0x192C, 13 },
- { 0x61, 8 },
- { 0x31, 7 },
- { 0x0, 2 },
- { 0x7, 3 },
- { 0x10, 5 },
- { 0x11, 5 },
- { 0xC8, 8 },
- { 0x192F, 13 },
- { 0x325B, 14 },
- { 0x325A, 14 },
- { 0x1929, 13 },
- { 0x1928, 13 },
- { 0x192B, 13 },
- { 0x192A, 13 },
- { 0x325D, 14 },
- { 0x325C, 14 },
- { 0x18, 5 },
- { 0x1A, 6 },
- { 0x1B, 6 },
- { 0x65, 7 },
- { 0x19, 6 },
- { 0x4, 4 },
- { 0x7, 4 },
- { 0x60, 8 },
- { 0x324, 10 }
- },
- { /* AC bias group 4, table 13 */
- { 0x6, 3 },
- { 0x0, 3 },
- { 0x2, 4 },
- { 0xF, 4 },
- { 0x39, 6 },
- { 0x1D9, 9 },
- { 0x1D82, 13 },
- { 0x761, 11 },
- { 0x3BE, 10 },
- { 0x1, 2 },
- { 0x2, 2 },
- { 0xF, 6 },
- { 0xE, 6 },
- { 0x762, 11 },
- { 0x3B07, 14 },
- { 0x3B06, 14 },
- { 0x3B1D, 14 },
- { 0x3B1C, 14 },
- { 0x3B1F, 14 },
- { 0x3B1E, 14 },
- { 0x3B19, 14 },
- { 0x3B18, 14 },
- { 0x3B1B, 14 },
- { 0x38, 6 },
- { 0x1DE, 9 },
- { 0xED, 8 },
- { 0x3BF, 10 },
- { 0xEE, 8 },
- { 0x3A, 6 },
- { 0x6, 5 },
- { 0xEC0, 12 },
- { 0x3B1A, 14 }
- },
- { /* AC bias group 4, table 14 */
- { 0x0, 2 },
- { 0x2, 3 },
- { 0xF, 5 },
- { 0x6, 4 },
- { 0x1C, 6 },
- { 0x1D0, 10 },
- { 0xE8C, 13 },
- { 0x1D1B, 14 },
- { 0x1D1A, 14 },
- { 0x3, 2 },
- { 0x2, 2 },
- { 0xEA, 9 },
- { 0xE9, 9 },
- { 0xE89, 13 },
- { 0xE88, 13 },
- { 0xE8B, 13 },
- { 0xE8A, 13 },
- { 0x1D65, 14 },
- { 0x1D64, 14 },
- { 0x1D67, 14 },
- { 0x1D66, 14 },
- { 0x1D61, 14 },
- { 0x1D60, 14 },
- { 0x3AD, 11 },
- { 0x1D63, 14 },
- { 0x1D62, 14 },
- { 0x1D1D, 14 },
- { 0x1D1C, 14 },
- { 0x3B, 7 },
- { 0x1D7, 10 },
- { 0x1D1F, 14 },
- { 0x1D1E, 14 }
- },
- { /* AC bias group 4, table 15 */
- { 0x2, 2 },
- { 0xF, 4 },
- { 0x1C, 5 },
- { 0xC, 4 },
- { 0x3B, 6 },
- { 0x1AC, 9 },
- { 0x1AD8, 13 },
- { 0x35B3, 14 },
- { 0x35B2, 14 },
- { 0x1, 2 },
- { 0x0, 2 },
- { 0x69, 7 },
- { 0x68, 7 },
- { 0x35BD, 14 },
- { 0x35BC, 14 },
- { 0x35BF, 14 },
- { 0x35BE, 14 },
- { 0x35B9, 14 },
- { 0x35B8, 14 },
- { 0x35BB, 14 },
- { 0x35BA, 14 },
- { 0x35B5, 14 },
- { 0x35B4, 14 },
- { 0x1A9, 9 },
- { 0x1A8, 9 },
- { 0x35A, 10 },
- { 0xD7, 8 },
- { 0xD5, 8 },
- { 0x3A, 6 },
- { 0x1B, 5 },
- { 0x35B7, 14 },
- { 0x35B6, 14 }
- }
+ { /* AC bias group 4, table 0 */
+ { 0x0, 3 },
+ { 0x10, 5 },
+ { 0x72, 7 },
+ { 0x71, 7 },
+ { 0x154, 9 },
+ { 0xAAB, 12 },
+ { 0xAA8, 12 },
+ { 0x14, 5 },
+ { 0x70, 7 },
+ { 0x2, 3 },
+ { 0x3, 3 },
+ { 0xC, 4 },
+ { 0xB, 4 },
+ { 0x3, 4 },
+ { 0x11, 5 },
+ { 0x73, 7 },
+ { 0x54, 7 },
+ { 0xAB, 8 },
+ { 0x2AB, 10 },
+ { 0x1553, 13 },
+ { 0x1552, 13 },
+ { 0x1555, 13 },
+ { 0x1554, 13 },
+ { 0xD, 4 },
+ { 0x1E, 5 },
+ { 0x12, 5 },
+ { 0x3E, 6 },
+ { 0x2B, 6 },
+ { 0x2, 4 },
+ { 0x3F, 6 },
+ { 0x1D, 5 },
+ { 0x13, 5 }
+ },
+ { /* AC bias group 4, table 1 */
+ { 0x3, 3 },
+ { 0x1F, 5 },
+ { 0x29, 6 },
+ { 0x3D, 6 },
+ { 0xC, 7 },
+ { 0x69, 10 },
+ { 0x345, 13 },
+ { 0x2, 5 },
+ { 0x28, 6 },
+ { 0x2, 3 },
+ { 0x1, 3 },
+ { 0xE, 4 },
+ { 0xC, 4 },
+ { 0x15, 5 },
+ { 0x7, 6 },
+ { 0x1B, 8 },
+ { 0x6B, 10 },
+ { 0x6A, 10 },
+ { 0x344, 13 },
+ { 0x347, 13 },
+ { 0x346, 13 },
+ { 0x1A1, 12 },
+ { 0x1A0, 12 },
+ { 0xB, 4 },
+ { 0x1A, 5 },
+ { 0x12, 5 },
+ { 0x0, 5 },
+ { 0x3C, 6 },
+ { 0x8, 4 },
+ { 0x1B, 5 },
+ { 0x13, 5 },
+ { 0x1, 5 }
+ },
+ { /* AC bias group 4, table 2 */
+ { 0x4, 3 },
+ { 0x4, 4 },
+ { 0x3F, 6 },
+ { 0x14, 5 },
+ { 0x56, 7 },
+ { 0x15C, 9 },
+ { 0x15D5, 13 },
+ { 0x3C, 6 },
+ { 0x2A, 6 },
+ { 0x0, 3 },
+ { 0x1, 3 },
+ { 0xE, 4 },
+ { 0xD, 4 },
+ { 0xC, 5 },
+ { 0xAF, 8 },
+ { 0x2BB, 10 },
+ { 0x15D4, 13 },
+ { 0x15D7, 13 },
+ { 0x15D6, 13 },
+ { 0x15D1, 13 },
+ { 0x15D0, 13 },
+ { 0x15D3, 13 },
+ { 0x15D2, 13 },
+ { 0xB, 4 },
+ { 0x19, 5 },
+ { 0xD, 5 },
+ { 0x3E, 6 },
+ { 0x31, 6 },
+ { 0x7, 4 },
+ { 0x5, 4 },
+ { 0x3D, 6 },
+ { 0x30, 6 }
+ },
+ { /* AC bias group 4, table 3 */
+ { 0x5, 3 },
+ { 0x8, 4 },
+ { 0x1A, 5 },
+ { 0x0, 4 },
+ { 0x36, 6 },
+ { 0x11, 8 },
+ { 0x106, 12 },
+ { 0xA, 7 },
+ { 0x6E, 7 },
+ { 0x2, 3 },
+ { 0x3, 3 },
+ { 0x3, 4 },
+ { 0x2, 4 },
+ { 0x6F, 7 },
+ { 0x21, 9 },
+ { 0x20F, 13 },
+ { 0x20E, 13 },
+ { 0x101, 12 },
+ { 0x100, 12 },
+ { 0x103, 12 },
+ { 0x102, 12 },
+ { 0x105, 12 },
+ { 0x104, 12 },
+ { 0xC, 4 },
+ { 0x1E, 5 },
+ { 0x3, 5 },
+ { 0x3E, 6 },
+ { 0x3F, 6 },
+ { 0x9, 4 },
+ { 0xE, 4 },
+ { 0xB, 7 },
+ { 0x9, 7 }
+ },
+ { /* AC bias group 4, table 4 */
+ { 0x2, 3 },
+ { 0xE, 4 },
+ { 0x1E, 5 },
+ { 0xC, 4 },
+ { 0x1F, 5 },
+ { 0x6E, 7 },
+ { 0xAD, 10 },
+ { 0xAF, 10 },
+ { 0x14, 7 },
+ { 0x4, 3 },
+ { 0x3, 3 },
+ { 0x1A, 5 },
+ { 0x17, 5 },
+ { 0x2A, 8 },
+ { 0x576, 13 },
+ { 0xAEF, 14 },
+ { 0xAEE, 14 },
+ { 0x571, 13 },
+ { 0x570, 13 },
+ { 0x573, 13 },
+ { 0x572, 13 },
+ { 0x575, 13 },
+ { 0x574, 13 },
+ { 0x3, 4 },
+ { 0x16, 5 },
+ { 0x4, 5 },
+ { 0x36, 6 },
+ { 0xB, 6 },
+ { 0xA, 4 },
+ { 0x0, 3 },
+ { 0x6F, 7 },
+ { 0xAC, 10 }
+ },
+ { /* AC bias group 4, table 5 */
+ { 0x4, 3 },
+ { 0x5, 4 },
+ { 0x3, 3 },
+ { 0x1, 3 },
+ { 0x4, 4 },
+ { 0x2F, 6 },
+ { 0x526, 11 },
+ { 0x1495, 13 },
+ { 0xA6, 8 },
+ { 0x7, 3 },
+ { 0x6, 3 },
+ { 0x2D, 6 },
+ { 0x2C, 6 },
+ { 0x1494, 13 },
+ { 0x1497, 13 },
+ { 0x1496, 13 },
+ { 0x1491, 13 },
+ { 0x1490, 13 },
+ { 0x1493, 13 },
+ { 0x1492, 13 },
+ { 0x293D, 14 },
+ { 0x293C, 14 },
+ { 0x293F, 14 },
+ { 0x0, 3 },
+ { 0x28, 6 },
+ { 0xA5, 8 },
+ { 0x148, 9 },
+ { 0xA7, 8 },
+ { 0x2E, 6 },
+ { 0x15, 5 },
+ { 0xA4E, 12 },
+ { 0x293E, 14 }
+ },
+ { /* AC bias group 4, table 6 */
+ { 0x4, 3 },
+ { 0x5, 4 },
+ { 0x3, 3 },
+ { 0x1, 3 },
+ { 0x4, 4 },
+ { 0x2F, 6 },
+ { 0x526, 11 },
+ { 0x1495, 13 },
+ { 0xA6, 8 },
+ { 0x7, 3 },
+ { 0x6, 3 },
+ { 0x2D, 6 },
+ { 0x2C, 6 },
+ { 0x1494, 13 },
+ { 0x1497, 13 },
+ { 0x1496, 13 },
+ { 0x1491, 13 },
+ { 0x1490, 13 },
+ { 0x1493, 13 },
+ { 0x1492, 13 },
+ { 0x293D, 14 },
+ { 0x293C, 14 },
+ { 0x293F, 14 },
+ { 0x0, 3 },
+ { 0x28, 6 },
+ { 0xA5, 8 },
+ { 0x148, 9 },
+ { 0xA7, 8 },
+ { 0x2E, 6 },
+ { 0x15, 5 },
+ { 0xA4E, 12 },
+ { 0x293E, 14 }
+ },
+ { /* AC bias group 4, table 7 */
+ { 0x4, 3 },
+ { 0x5, 4 },
+ { 0x3, 3 },
+ { 0x1, 3 },
+ { 0x4, 4 },
+ { 0x2F, 6 },
+ { 0x526, 11 },
+ { 0x1495, 13 },
+ { 0xA6, 8 },
+ { 0x7, 3 },
+ { 0x6, 3 },
+ { 0x2D, 6 },
+ { 0x2C, 6 },
+ { 0x1494, 13 },
+ { 0x1497, 13 },
+ { 0x1496, 13 },
+ { 0x1491, 13 },
+ { 0x1490, 13 },
+ { 0x1493, 13 },
+ { 0x1492, 13 },
+ { 0x293D, 14 },
+ { 0x293C, 14 },
+ { 0x293F, 14 },
+ { 0x0, 3 },
+ { 0x28, 6 },
+ { 0xA5, 8 },
+ { 0x148, 9 },
+ { 0xA7, 8 },
+ { 0x2E, 6 },
+ { 0x15, 5 },
+ { 0xA4E, 12 },
+ { 0x293E, 14 }
+ },
+ { /* AC bias group 4, table 8 */
+ { 0x3, 3 },
+ { 0x11, 5 },
+ { 0x20, 6 },
+ { 0x74, 7 },
+ { 0x10D, 9 },
+ { 0x863, 12 },
+ { 0x860, 12 },
+ { 0xA, 5 },
+ { 0x75, 7 },
+ { 0x1, 3 },
+ { 0x0, 3 },
+ { 0xB, 4 },
+ { 0xA, 4 },
+ { 0x18, 5 },
+ { 0x38, 6 },
+ { 0x42, 7 },
+ { 0x10F, 9 },
+ { 0x10E, 9 },
+ { 0x219, 10 },
+ { 0x10C3, 13 },
+ { 0x10C2, 13 },
+ { 0x10C5, 13 },
+ { 0x10C4, 13 },
+ { 0xF, 4 },
+ { 0x4, 4 },
+ { 0x19, 5 },
+ { 0xB, 5 },
+ { 0x39, 6 },
+ { 0x9, 4 },
+ { 0x1B, 5 },
+ { 0x1A, 5 },
+ { 0x3B, 6 }
+ },
+ { /* AC bias group 4, table 9 */
+ { 0x5, 3 },
+ { 0x1, 4 },
+ { 0x3E, 6 },
+ { 0x1, 5 },
+ { 0xE2, 8 },
+ { 0x1C6F, 13 },
+ { 0x38D9, 14 },
+ { 0x39, 6 },
+ { 0x1F, 6 },
+ { 0x2, 3 },
+ { 0x1, 3 },
+ { 0x9, 4 },
+ { 0x8, 4 },
+ { 0x0, 5 },
+ { 0x70, 7 },
+ { 0x1C7, 9 },
+ { 0x38C, 10 },
+ { 0x71A, 11 },
+ { 0x38D8, 14 },
+ { 0x38DB, 14 },
+ { 0x38DA, 14 },
+ { 0x38DD, 14 },
+ { 0x38DC, 14 },
+ { 0xD, 4 },
+ { 0x1D, 5 },
+ { 0xE, 5 },
+ { 0x3F, 6 },
+ { 0x3C, 6 },
+ { 0xC, 4 },
+ { 0x6, 4 },
+ { 0x3D, 6 },
+ { 0x1E, 6 }
+ },
+ { /* AC bias group 4, table 10 */
+ { 0x6, 3 },
+ { 0xB, 4 },
+ { 0x11, 5 },
+ { 0x1E, 5 },
+ { 0x74, 7 },
+ { 0x3AA, 10 },
+ { 0x1D5C, 13 },
+ { 0x1, 6 },
+ { 0x21, 6 },
+ { 0x1, 3 },
+ { 0x2, 3 },
+ { 0x7, 4 },
+ { 0x6, 4 },
+ { 0x3E, 6 },
+ { 0xEB, 8 },
+ { 0x1D4, 9 },
+ { 0xEAF, 12 },
+ { 0x3ABB, 14 },
+ { 0x3ABA, 14 },
+ { 0x1D59, 13 },
+ { 0x1D58, 13 },
+ { 0x1D5B, 13 },
+ { 0x1D5A, 13 },
+ { 0xA, 4 },
+ { 0x1C, 5 },
+ { 0x1, 5 },
+ { 0x3F, 6 },
+ { 0x3B, 6 },
+ { 0x1, 4 },
+ { 0x9, 4 },
+ { 0x20, 6 },
+ { 0x0, 6 }
+ },
+ { /* AC bias group 4, table 11 */
+ { 0x4, 3 },
+ { 0xA, 4 },
+ { 0x17, 5 },
+ { 0x4, 4 },
+ { 0x16, 6 },
+ { 0x16A, 9 },
+ { 0x16B1, 13 },
+ { 0x17, 7 },
+ { 0x5B, 7 },
+ { 0x6, 3 },
+ { 0x7, 3 },
+ { 0x1, 4 },
+ { 0x0, 4 },
+ { 0xA, 6 },
+ { 0x2D7, 10 },
+ { 0xB5A, 12 },
+ { 0x16B0, 13 },
+ { 0x16B3, 13 },
+ { 0x16B2, 13 },
+ { 0x2D6D, 14 },
+ { 0x2D6C, 14 },
+ { 0x2D6F, 14 },
+ { 0x2D6E, 14 },
+ { 0x6, 4 },
+ { 0xA, 5 },
+ { 0x4, 5 },
+ { 0x2C, 6 },
+ { 0x17, 6 },
+ { 0x3, 4 },
+ { 0x7, 4 },
+ { 0x16, 7 },
+ { 0xB4, 8 }
+ },
+ { /* AC bias group 4, table 12 */
+ { 0x5, 3 },
+ { 0xD, 4 },
+ { 0x5, 4 },
+ { 0x9, 4 },
+ { 0x33, 6 },
+ { 0x193, 9 },
+ { 0x192C, 13 },
+ { 0x61, 8 },
+ { 0x31, 7 },
+ { 0x0, 2 },
+ { 0x7, 3 },
+ { 0x10, 5 },
+ { 0x11, 5 },
+ { 0xC8, 8 },
+ { 0x192F, 13 },
+ { 0x325B, 14 },
+ { 0x325A, 14 },
+ { 0x1929, 13 },
+ { 0x1928, 13 },
+ { 0x192B, 13 },
+ { 0x192A, 13 },
+ { 0x325D, 14 },
+ { 0x325C, 14 },
+ { 0x18, 5 },
+ { 0x1A, 6 },
+ { 0x1B, 6 },
+ { 0x65, 7 },
+ { 0x19, 6 },
+ { 0x4, 4 },
+ { 0x7, 4 },
+ { 0x60, 8 },
+ { 0x324, 10 }
+ },
+ { /* AC bias group 4, table 13 */
+ { 0x6, 3 },
+ { 0x0, 3 },
+ { 0x2, 4 },
+ { 0xF, 4 },
+ { 0x39, 6 },
+ { 0x1D9, 9 },
+ { 0x1D82, 13 },
+ { 0x761, 11 },
+ { 0x3BE, 10 },
+ { 0x1, 2 },
+ { 0x2, 2 },
+ { 0xF, 6 },
+ { 0xE, 6 },
+ { 0x762, 11 },
+ { 0x3B07, 14 },
+ { 0x3B06, 14 },
+ { 0x3B1D, 14 },
+ { 0x3B1C, 14 },
+ { 0x3B1F, 14 },
+ { 0x3B1E, 14 },
+ { 0x3B19, 14 },
+ { 0x3B18, 14 },
+ { 0x3B1B, 14 },
+ { 0x38, 6 },
+ { 0x1DE, 9 },
+ { 0xED, 8 },
+ { 0x3BF, 10 },
+ { 0xEE, 8 },
+ { 0x3A, 6 },
+ { 0x6, 5 },
+ { 0xEC0, 12 },
+ { 0x3B1A, 14 }
+ },
+ { /* AC bias group 4, table 14 */
+ { 0x0, 2 },
+ { 0x2, 3 },
+ { 0xF, 5 },
+ { 0x6, 4 },
+ { 0x1C, 6 },
+ { 0x1D0, 10 },
+ { 0xE8C, 13 },
+ { 0x1D1B, 14 },
+ { 0x1D1A, 14 },
+ { 0x3, 2 },
+ { 0x2, 2 },
+ { 0xEA, 9 },
+ { 0xE9, 9 },
+ { 0xE89, 13 },
+ { 0xE88, 13 },
+ { 0xE8B, 13 },
+ { 0xE8A, 13 },
+ { 0x1D65, 14 },
+ { 0x1D64, 14 },
+ { 0x1D67, 14 },
+ { 0x1D66, 14 },
+ { 0x1D61, 14 },
+ { 0x1D60, 14 },
+ { 0x3AD, 11 },
+ { 0x1D63, 14 },
+ { 0x1D62, 14 },
+ { 0x1D1D, 14 },
+ { 0x1D1C, 14 },
+ { 0x3B, 7 },
+ { 0x1D7, 10 },
+ { 0x1D1F, 14 },
+ { 0x1D1E, 14 }
+ },
+ { /* AC bias group 4, table 15 */
+ { 0x2, 2 },
+ { 0xF, 4 },
+ { 0x1C, 5 },
+ { 0xC, 4 },
+ { 0x3B, 6 },
+ { 0x1AC, 9 },
+ { 0x1AD8, 13 },
+ { 0x35B3, 14 },
+ { 0x35B2, 14 },
+ { 0x1, 2 },
+ { 0x0, 2 },
+ { 0x69, 7 },
+ { 0x68, 7 },
+ { 0x35BD, 14 },
+ { 0x35BC, 14 },
+ { 0x35BF, 14 },
+ { 0x35BE, 14 },
+ { 0x35B9, 14 },
+ { 0x35B8, 14 },
+ { 0x35BB, 14 },
+ { 0x35BA, 14 },
+ { 0x35B5, 14 },
+ { 0x35B4, 14 },
+ { 0x1A9, 9 },
+ { 0x1A8, 9 },
+ { 0x35A, 10 },
+ { 0xD7, 8 },
+ { 0xD5, 8 },
+ { 0x3A, 6 },
+ { 0x1B, 5 },
+ { 0x35B7, 14 },
+ { 0x35B6, 14 }
+ }
};
#endif /* AVCODEC_VP3DATA_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp3dsp.c b/chromium/third_party/ffmpeg/libavcodec/vp3dsp.c
index 56566293d7a..b72952d2302 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp3dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp3dsp.c
@@ -26,8 +26,9 @@
#include "libavutil/attributes.h"
#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
+
#include "avcodec.h"
-#include "dsputil.h"
#include "rnd_avg.h"
#include "vp3dsp.h"
@@ -40,9 +41,10 @@
#define xC6S2 25080
#define xC7S1 12785
-#define M(a,b) (((a) * (b))>>16)
+#define M(a, b) (((a) * (b)) >> 16)
-static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int type)
+static av_always_inline void idct(uint8_t *dst, int stride,
+ int16_t *input, int type)
{
int16_t *ip = input;
@@ -54,8 +56,8 @@ static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int
/* Inverse DCT on the rows now */
for (i = 0; i < 8; i++) {
/* Check for non-zero values */
- if ( ip[0 * 8] | ip[1 * 8] | ip[2 * 8] | ip[3 * 8] |
- ip[4 * 8] | ip[5 * 8] | ip[6 * 8] | ip[7 * 8] ) {
+ if (ip[0 * 8] | ip[1 * 8] | ip[2 * 8] | ip[3 * 8] |
+ ip[4 * 8] | ip[5 * 8] | ip[6 * 8] | ip[7 * 8]) {
A = M(xC1S7, ip[1 * 8]) + M(xC7S1, ip[7 * 8]);
B = M(xC7S1, ip[1 * 8]) - M(xC1S7, ip[7 * 8]);
C = M(xC3S5, ip[3 * 8]) + M(xC5S3, ip[5 * 8]);
@@ -83,14 +85,14 @@ static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int
Hd = Bd + H;
/* Final sequence of operations over-write original inputs. */
- ip[0 * 8] = Gd + Cd ;
- ip[7 * 8] = Gd - Cd ;
+ ip[0 * 8] = Gd + Cd;
+ ip[7 * 8] = Gd - Cd;
ip[1 * 8] = Add + Hd;
ip[2 * 8] = Add - Hd;
- ip[3 * 8] = Ed + Dd ;
- ip[4 * 8] = Ed - Dd ;
+ ip[3 * 8] = Ed + Dd;
+ ip[4 * 8] = Ed - Dd;
ip[5 * 8] = Fd + Bdd;
ip[6 * 8] = Fd - Bdd;
@@ -101,11 +103,10 @@ static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int
ip = input;
- for ( i = 0; i < 8; i++) {
+ for (i = 0; i < 8; i++) {
/* Check for non-zero values (bitwise or faster than ||) */
- if ( ip[1] | ip[2] | ip[3] |
- ip[4] | ip[5] | ip[6] | ip[7] ) {
-
+ if (ip[1] | ip[2] | ip[3] |
+ ip[4] | ip[5] | ip[6] | ip[7]) {
A = M(xC1S7, ip[1]) + M(xC7S1, ip[7]);
B = M(xC7S1, ip[1]) - M(xC1S7, ip[7]);
C = M(xC3S5, ip[3]) + M(xC5S3, ip[5]);
@@ -120,9 +121,9 @@ static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int
E = M(xC4S4, (ip[0] + ip[4])) + 8;
F = M(xC4S4, (ip[0] - ip[4])) + 8;
- if(type==1){ //HACK
- E += 16*128;
- F += 16*128;
+ if (type == 1) { // HACK
+ E += 16 * 128;
+ F += 16 * 128;
}
G = M(xC2S6, ip[2]) + M(xC6S2, ip[6]);
@@ -139,52 +140,51 @@ static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int
/* Final sequence of operations over-write original inputs. */
if (type == 1) {
- dst[0*stride] = av_clip_uint8((Gd + Cd ) >> 4);
- dst[7*stride] = av_clip_uint8((Gd - Cd ) >> 4);
+ dst[0 * stride] = av_clip_uint8((Gd + Cd) >> 4);
+ dst[7 * stride] = av_clip_uint8((Gd - Cd) >> 4);
- dst[1*stride] = av_clip_uint8((Add + Hd ) >> 4);
- dst[2*stride] = av_clip_uint8((Add - Hd ) >> 4);
+ dst[1 * stride] = av_clip_uint8((Add + Hd) >> 4);
+ dst[2 * stride] = av_clip_uint8((Add - Hd) >> 4);
- dst[3*stride] = av_clip_uint8((Ed + Dd ) >> 4);
- dst[4*stride] = av_clip_uint8((Ed - Dd ) >> 4);
+ dst[3 * stride] = av_clip_uint8((Ed + Dd) >> 4);
+ dst[4 * stride] = av_clip_uint8((Ed - Dd) >> 4);
- dst[5*stride] = av_clip_uint8((Fd + Bdd ) >> 4);
- dst[6*stride] = av_clip_uint8((Fd - Bdd ) >> 4);
- }else{
- dst[0*stride] = av_clip_uint8(dst[0*stride] + ((Gd + Cd ) >> 4));
- dst[7*stride] = av_clip_uint8(dst[7*stride] + ((Gd - Cd ) >> 4));
+ dst[5 * stride] = av_clip_uint8((Fd + Bdd) >> 4);
+ dst[6 * stride] = av_clip_uint8((Fd - Bdd) >> 4);
+ } else {
+ dst[0 * stride] = av_clip_uint8(dst[0 * stride] + ((Gd + Cd) >> 4));
+ dst[7 * stride] = av_clip_uint8(dst[7 * stride] + ((Gd - Cd) >> 4));
- dst[1*stride] = av_clip_uint8(dst[1*stride] + ((Add + Hd ) >> 4));
- dst[2*stride] = av_clip_uint8(dst[2*stride] + ((Add - Hd ) >> 4));
+ dst[1 * stride] = av_clip_uint8(dst[1 * stride] + ((Add + Hd) >> 4));
+ dst[2 * stride] = av_clip_uint8(dst[2 * stride] + ((Add - Hd) >> 4));
- dst[3*stride] = av_clip_uint8(dst[3*stride] + ((Ed + Dd ) >> 4));
- dst[4*stride] = av_clip_uint8(dst[4*stride] + ((Ed - Dd ) >> 4));
+ dst[3 * stride] = av_clip_uint8(dst[3 * stride] + ((Ed + Dd) >> 4));
+ dst[4 * stride] = av_clip_uint8(dst[4 * stride] + ((Ed - Dd) >> 4));
- dst[5*stride] = av_clip_uint8(dst[5*stride] + ((Fd + Bdd ) >> 4));
- dst[6*stride] = av_clip_uint8(dst[6*stride] + ((Fd - Bdd ) >> 4));
+ dst[5 * stride] = av_clip_uint8(dst[5 * stride] + ((Fd + Bdd) >> 4));
+ dst[6 * stride] = av_clip_uint8(dst[6 * stride] + ((Fd - Bdd) >> 4));
}
-
} else {
if (type == 1) {
- dst[0*stride]=
- dst[1*stride]=
- dst[2*stride]=
- dst[3*stride]=
- dst[4*stride]=
- dst[5*stride]=
- dst[6*stride]=
- dst[7*stride]= av_clip_uint8(128 + ((xC4S4 * ip[0] + (IdctAdjustBeforeShift<<16))>>20));
- }else{
- if(ip[0]){
- int v= ((xC4S4 * ip[0] + (IdctAdjustBeforeShift<<16))>>20);
- dst[0*stride] = av_clip_uint8(dst[0*stride] + v);
- dst[1*stride] = av_clip_uint8(dst[1*stride] + v);
- dst[2*stride] = av_clip_uint8(dst[2*stride] + v);
- dst[3*stride] = av_clip_uint8(dst[3*stride] + v);
- dst[4*stride] = av_clip_uint8(dst[4*stride] + v);
- dst[5*stride] = av_clip_uint8(dst[5*stride] + v);
- dst[6*stride] = av_clip_uint8(dst[6*stride] + v);
- dst[7*stride] = av_clip_uint8(dst[7*stride] + v);
+ dst[0*stride] =
+ dst[1*stride] =
+ dst[2*stride] =
+ dst[3*stride] =
+ dst[4*stride] =
+ dst[5*stride] =
+ dst[6*stride] =
+ dst[7*stride] = av_clip_uint8(128 + ((xC4S4 * ip[0] + (IdctAdjustBeforeShift << 16)) >> 20));
+ } else {
+ if (ip[0]) {
+ int v = (xC4S4 * ip[0] + (IdctAdjustBeforeShift << 16)) >> 20;
+ dst[0 * stride] = av_clip_uint8(dst[0 * stride] + v);
+ dst[1 * stride] = av_clip_uint8(dst[1 * stride] + v);
+ dst[2 * stride] = av_clip_uint8(dst[2 * stride] + v);
+ dst[3 * stride] = av_clip_uint8(dst[3 * stride] + v);
+ dst[4 * stride] = av_clip_uint8(dst[4 * stride] + v);
+ dst[5 * stride] = av_clip_uint8(dst[5 * stride] + v);
+ dst[6 * stride] = av_clip_uint8(dst[6 * stride] + v);
+ dst[7 * stride] = av_clip_uint8(dst[7 * stride] + v);
}
}
}
@@ -194,26 +194,26 @@ static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int
}
}
-static void vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size,
- int16_t *block/*align 16*/)
+static void vp3_idct_put_c(uint8_t *dest /* align 8 */, int line_size,
+ int16_t *block /* align 16 */)
{
idct(dest, line_size, block, 1);
memset(block, 0, sizeof(*block) * 64);
}
-static void vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size,
- int16_t *block/*align 16*/)
+static void vp3_idct_add_c(uint8_t *dest /* align 8 */, int line_size,
+ int16_t *block /* align 16 */)
{
idct(dest, line_size, block, 2);
memset(block, 0, sizeof(*block) * 64);
}
-static void vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size,
- int16_t *block/*align 16*/)
+static void vp3_idct_dc_add_c(uint8_t *dest /* align 8 */, int line_size,
+ int16_t *block /* align 16 */)
{
int i, dc = (block[0] + 15) >> 5;
- for(i = 0; i < 8; i++){
+ for (i = 0; i < 8; i++) {
dest[0] = av_clip_uint8(dest[0] + dc);
dest[1] = av_clip_uint8(dest[1] + dc);
dest[2] = av_clip_uint8(dest[2] + dc);
@@ -222,7 +222,7 @@ static void vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size,
dest[5] = av_clip_uint8(dest[5] + dc);
dest[6] = av_clip_uint8(dest[6] + dc);
dest[7] = av_clip_uint8(dest[7] + dc);
- dest += line_size;
+ dest += line_size;
}
block[0] = 0;
}
@@ -232,15 +232,15 @@ static void vp3_v_loop_filter_c(uint8_t *first_pixel, int stride,
{
unsigned char *end;
int filter_value;
- const int nstride= -stride;
+ const int nstride = -stride;
- for (end= first_pixel + 8; first_pixel < end; first_pixel++) {
- filter_value =
- (first_pixel[2 * nstride] - first_pixel[ stride])
- +3*(first_pixel[0 ] - first_pixel[nstride]);
+ for (end = first_pixel + 8; first_pixel < end; first_pixel++) {
+ filter_value = (first_pixel[2 * nstride] - first_pixel[stride]) +
+ (first_pixel[0] - first_pixel[nstride]) * 3;
filter_value = bounding_values[(filter_value + 4) >> 3];
+
first_pixel[nstride] = av_clip_uint8(first_pixel[nstride] + filter_value);
- first_pixel[0] = av_clip_uint8(first_pixel[0] - filter_value);
+ first_pixel[0] = av_clip_uint8(first_pixel[0] - filter_value);
}
}
@@ -250,11 +250,11 @@ static void vp3_h_loop_filter_c(uint8_t *first_pixel, int stride,
unsigned char *end;
int filter_value;
- for (end= first_pixel + 8*stride; first_pixel != end; first_pixel += stride) {
- filter_value =
- (first_pixel[-2] - first_pixel[ 1])
- +3*(first_pixel[ 0] - first_pixel[-1]);
+ for (end = first_pixel + 8 * stride; first_pixel != end; first_pixel += stride) {
+ filter_value = (first_pixel[-2] - first_pixel[1]) +
+ (first_pixel[ 0] - first_pixel[-1]) * 3;
filter_value = bounding_values[(filter_value + 4) >> 3];
+
first_pixel[-1] = av_clip_uint8(first_pixel[-1] + filter_value);
first_pixel[ 0] = av_clip_uint8(first_pixel[ 0] - filter_value);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp5.c b/chromium/third_party/ffmpeg/libavcodec/vp5.c
index 756dc9270c6..1923d6335c8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp5.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp5.c
@@ -85,7 +85,7 @@ static void vp5_parse_vector_adjustment(VP56Context *s, VP56mv *vect)
for (comp=0; comp<2; comp++) {
int delta = 0;
- if (vp56_rac_get_prob(c, model->vector_dct[comp])) {
+ if (vp56_rac_get_prob_branchy(c, model->vector_dct[comp])) {
int sign = vp56_rac_get_prob(c, model->vector_sig[comp]);
di = vp56_rac_get_prob(c, model->vector_pdi[comp][0]);
di |= vp56_rac_get_prob(c, model->vector_pdi[comp][1]) << 1;
@@ -108,19 +108,19 @@ static void vp5_parse_vector_models(VP56Context *s)
int comp, node;
for (comp=0; comp<2; comp++) {
- if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][0]))
+ if (vp56_rac_get_prob_branchy(c, vp5_vmc_pct[comp][0]))
model->vector_dct[comp] = vp56_rac_gets_nn(c, 7);
- if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][1]))
+ if (vp56_rac_get_prob_branchy(c, vp5_vmc_pct[comp][1]))
model->vector_sig[comp] = vp56_rac_gets_nn(c, 7);
- if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][2]))
+ if (vp56_rac_get_prob_branchy(c, vp5_vmc_pct[comp][2]))
model->vector_pdi[comp][0] = vp56_rac_gets_nn(c, 7);
- if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][3]))
+ if (vp56_rac_get_prob_branchy(c, vp5_vmc_pct[comp][3]))
model->vector_pdi[comp][1] = vp56_rac_gets_nn(c, 7);
}
for (comp=0; comp<2; comp++)
for (node=0; node<7; node++)
- if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][4 + node]))
+ if (vp56_rac_get_prob_branchy(c, vp5_vmc_pct[comp][4 + node]))
model->vector_pdv[comp][node] = vp56_rac_gets_nn(c, 7);
}
@@ -137,7 +137,7 @@ static int vp5_parse_coeff_models(VP56Context *s)
for (pt=0; pt<2; pt++)
for (node=0; node<11; node++)
- if (vp56_rac_get_prob(c, vp5_dccv_pct[pt][node])) {
+ if (vp56_rac_get_prob_branchy(c, vp5_dccv_pct[pt][node])) {
def_prob[node] = vp56_rac_gets_nn(c, 7);
model->coeff_dccv[pt][node] = def_prob[node];
} else if (s->frames[VP56_FRAME_CURRENT]->key_frame) {
@@ -148,7 +148,7 @@ static int vp5_parse_coeff_models(VP56Context *s)
for (pt=0; pt<2; pt++)
for (cg=0; cg<6; cg++)
for (node=0; node<11; node++)
- if (vp56_rac_get_prob(c, vp5_ract_pct[ct][pt][cg][node])) {
+ if (vp56_rac_get_prob_branchy(c, vp5_ract_pct[ct][pt][cg][node])) {
def_prob[node] = vp56_rac_gets_nn(c, 7);
model->coeff_ract[pt][ct][cg][node] = def_prob[node];
} else if (s->frames[VP56_FRAME_CURRENT]->key_frame) {
@@ -193,9 +193,9 @@ static void vp5_parse_coeff(VP56Context *s)
coeff_idx = 0;
for (;;) {
- if (vp56_rac_get_prob(c, model2[0])) {
- if (vp56_rac_get_prob(c, model2[2])) {
- if (vp56_rac_get_prob(c, model2[3])) {
+ if (vp56_rac_get_prob_branchy(c, model2[0])) {
+ if (vp56_rac_get_prob_branchy(c, model2[2])) {
+ if (vp56_rac_get_prob_branchy(c, model2[3])) {
s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 4;
idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1);
sign = vp56_rac_get(c);
@@ -203,7 +203,7 @@ static void vp5_parse_coeff(VP56Context *s)
for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--)
coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i;
} else {
- if (vp56_rac_get_prob(c, model2[4])) {
+ if (vp56_rac_get_prob_branchy(c, model2[4])) {
coeff = 3 + vp56_rac_get_prob(c, model1[5]);
s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 3;
} else {
@@ -224,7 +224,7 @@ static void vp5_parse_coeff(VP56Context *s)
coeff *= s->dequant_ac;
s->block_coeff[b][permute[coeff_idx]] = coeff;
} else {
- if (ct && !vp56_rac_get_prob(c, model2[1]))
+ if (ct && !vp56_rac_get_prob_branchy(c, model2[1]))
break;
ct = 0;
s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp56.c b/chromium/third_party/ffmpeg/libavcodec/vp56.c
index a0cb060d68a..ba39b56436a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp56.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp56.c
@@ -83,16 +83,16 @@ static void vp56_parse_mb_type_models(VP56Context *s)
int i, ctx, type;
for (ctx=0; ctx<3; ctx++) {
- if (vp56_rac_get_prob(c, 174)) {
+ if (vp56_rac_get_prob_branchy(c, 174)) {
int idx = vp56_rac_gets(c, 4);
memcpy(model->mb_types_stats[ctx],
ff_vp56_pre_def_mb_type_stats[idx][ctx],
sizeof(model->mb_types_stats[ctx]));
}
- if (vp56_rac_get_prob(c, 254)) {
+ if (vp56_rac_get_prob_branchy(c, 254)) {
for (type=0; type<10; type++) {
for(i=0; i<2; i++) {
- if (vp56_rac_get_prob(c, 205)) {
+ if (vp56_rac_get_prob_branchy(c, 205)) {
int delta, sign = vp56_rac_get(c);
delta = vp56_rac_get_tree(c, ff_vp56_pmbtm_tree,
@@ -153,7 +153,7 @@ static VP56mb vp56_parse_mb_type(VP56Context *s,
uint8_t *mb_type_model = s->modelp->mb_type[ctx][prev_type];
VP56RangeCoder *c = &s->c;
- if (vp56_rac_get_prob(c, mb_type_model[0]))
+ if (vp56_rac_get_prob_branchy(c, mb_type_model[0]))
return prev_type;
else
return vp56_rac_get_tree(c, ff_vp56_pmbt_tree, mb_type_model);
@@ -700,9 +700,9 @@ av_cold int ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s,
ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);
for (i = 0; i < 64; i++) {
-#define T(x) (x >> 3) | ((x & 7) << 3)
- s->idct_scantable[i] = T(ff_zigzag_direct[i]);
-#undef T
+#define TRANSPOSE(x) (x >> 3) | ((x & 7) << 3)
+ s->idct_scantable[i] = TRANSPOSE(ff_zigzag_direct[i]);
+#undef TRANSPOSE
}
for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp56.h b/chromium/third_party/ffmpeg/libavcodec/vp56.h
index 9a952969203..1af5eaf5026 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp56.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vp56.h
@@ -26,7 +26,6 @@
#ifndef AVCODEC_VP56_H
#define AVCODEC_VP56_H
-#include "dsputil.h"
#include "get_bits.h"
#include "hpeldsp.h"
#include "bytestream.h"
@@ -364,7 +363,7 @@ int vp56_rac_get_tree(VP56RangeCoder *c,
const uint8_t *probs)
{
while (tree->val > 0) {
- if (vp56_rac_get_prob(c, probs[tree->prob_idx]))
+ if (vp56_rac_get_prob_branchy(c, probs[tree->prob_idx]))
tree += tree->val;
else
tree++;
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp6.c b/chromium/third_party/ffmpeg/libavcodec/vp6.c
index f552524db67..a18b8ff5234 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp6.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp6.c
@@ -211,20 +211,20 @@ static void vp6_parse_vector_models(VP56Context *s)
int comp, node;
for (comp=0; comp<2; comp++) {
- if (vp56_rac_get_prob(c, vp6_sig_dct_pct[comp][0]))
+ if (vp56_rac_get_prob_branchy(c, vp6_sig_dct_pct[comp][0]))
model->vector_dct[comp] = vp56_rac_gets_nn(c, 7);
- if (vp56_rac_get_prob(c, vp6_sig_dct_pct[comp][1]))
+ if (vp56_rac_get_prob_branchy(c, vp6_sig_dct_pct[comp][1]))
model->vector_sig[comp] = vp56_rac_gets_nn(c, 7);
}
for (comp=0; comp<2; comp++)
for (node=0; node<7; node++)
- if (vp56_rac_get_prob(c, vp6_pdv_pct[comp][node]))
+ if (vp56_rac_get_prob_branchy(c, vp6_pdv_pct[comp][node]))
model->vector_pdv[comp][node] = vp56_rac_gets_nn(c, 7);
for (comp=0; comp<2; comp++)
for (node=0; node<8; node++)
- if (vp56_rac_get_prob(c, vp6_fdv_pct[comp][node]))
+ if (vp56_rac_get_prob_branchy(c, vp6_fdv_pct[comp][node]))
model->vector_fdv[comp][node] = vp56_rac_gets_nn(c, 7);
}
@@ -270,7 +270,7 @@ static int vp6_parse_coeff_models(VP56Context *s)
for (pt=0; pt<2; pt++)
for (node=0; node<11; node++)
- if (vp56_rac_get_prob(c, vp6_dccv_pct[pt][node])) {
+ if (vp56_rac_get_prob_branchy(c, vp6_dccv_pct[pt][node])) {
def_prob[node] = vp56_rac_gets_nn(c, 7);
model->coeff_dccv[pt][node] = def_prob[node];
} else if (s->frames[VP56_FRAME_CURRENT]->key_frame) {
@@ -279,21 +279,21 @@ static int vp6_parse_coeff_models(VP56Context *s)
if (vp56_rac_get(c)) {
for (pos=1; pos<64; pos++)
- if (vp56_rac_get_prob(c, vp6_coeff_reorder_pct[pos]))
+ if (vp56_rac_get_prob_branchy(c, vp6_coeff_reorder_pct[pos]))
model->coeff_reorder[pos] = vp56_rac_gets(c, 4);
vp6_coeff_order_table_init(s);
}
for (cg=0; cg<2; cg++)
for (node=0; node<14; node++)
- if (vp56_rac_get_prob(c, vp6_runv_pct[cg][node]))
+ if (vp56_rac_get_prob_branchy(c, vp6_runv_pct[cg][node]))
model->coeff_runv[cg][node] = vp56_rac_gets_nn(c, 7);
for (ct=0; ct<3; ct++)
for (pt=0; pt<2; pt++)
for (cg=0; cg<6; cg++)
for (node=0; node<11; node++)
- if (vp56_rac_get_prob(c, vp6_ract_pct[ct][pt][cg][node])) {
+ if (vp56_rac_get_prob_branchy(c, vp6_ract_pct[ct][pt][cg][node])) {
def_prob[node] = vp56_rac_gets_nn(c, 7);
model->coeff_ract[pt][ct][cg][node] = def_prob[node];
} else if (s->frames[VP56_FRAME_CURRENT]->key_frame) {
@@ -339,7 +339,7 @@ static void vp6_parse_vector_adjustment(VP56Context *s, VP56mv *vect)
for (comp=0; comp<2; comp++) {
int i, delta = 0;
- if (vp56_rac_get_prob(c, model->vector_dct[comp])) {
+ if (vp56_rac_get_prob_branchy(c, model->vector_dct[comp])) {
static const uint8_t prob_order[] = {0, 1, 2, 7, 6, 5, 4};
for (i=0; i<sizeof(prob_order); i++) {
int j = prob_order[i];
@@ -354,7 +354,7 @@ static void vp6_parse_vector_adjustment(VP56Context *s, VP56mv *vect)
model->vector_pdv[comp]);
}
- if (delta && vp56_rac_get_prob(c, model->vector_sig[comp]))
+ if (delta && vp56_rac_get_prob_branchy(c, model->vector_sig[comp]))
delta = -delta;
if (!comp)
@@ -462,16 +462,16 @@ static void vp6_parse_coeff(VP56Context *s)
coeff_idx = 0;
for (;;) {
- if ((coeff_idx>1 && ct==0) || vp56_rac_get_prob(c, model2[0])) {
+ if ((coeff_idx>1 && ct==0) || vp56_rac_get_prob_branchy(c, model2[0])) {
/* parse a coeff */
- if (vp56_rac_get_prob(c, model2[2])) {
- if (vp56_rac_get_prob(c, model2[3])) {
+ if (vp56_rac_get_prob_branchy(c, model2[2])) {
+ if (vp56_rac_get_prob_branchy(c, model2[3])) {
idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1);
coeff = ff_vp56_coeff_bias[idx+5];
for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--)
coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i;
} else {
- if (vp56_rac_get_prob(c, model2[4]))
+ if (vp56_rac_get_prob_branchy(c, model2[4]))
coeff = 3 + vp56_rac_get_prob(c, model1[5]);
else
coeff = 2;
@@ -492,7 +492,7 @@ static void vp6_parse_coeff(VP56Context *s)
/* parse a run */
ct = 0;
if (coeff_idx > 0) {
- if (!vp56_rac_get_prob(c, model2[1]))
+ if (!vp56_rac_get_prob_branchy(c, model2[1]))
break;
model3 = model->coeff_runv[coeff_idx >= 6];
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp8.c b/chromium/third_party/ffmpeg/libavcodec/vp8.c
index 4aaef888a42..8421be8a7cb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp8.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp8.c
@@ -1,10 +1,11 @@
/*
- * VP8 compatible video decoder
+ * VP7/VP8 compatible video decoder
*
* Copyright (C) 2010 David Conrad
* Copyright (C) 2010 Ronald S. Bultje
* Copyright (C) 2010 Jason Garrett-Glaser
* Copyright (C) 2012 Daniel Kang
+ * Copyright (C) 2014 Peter Ross
*
* This file is part of FFmpeg.
*
@@ -24,17 +25,26 @@
*/
#include "libavutil/imgutils.h"
+
#include "avcodec.h"
#include "internal.h"
-#include "vp8.h"
-#include "vp8data.h"
#include "rectangle.h"
#include "thread.h"
+#include "vp8.h"
+#include "vp8data.h"
#if ARCH_ARM
# include "arm/vp8.h"
#endif
+#if CONFIG_VP7_DECODER && CONFIG_VP8_DECODER
+#define VPX(vp7, f) (vp7 ? vp7_ ## f : vp8_ ## f)
+#elif CONFIG_VP7_DECODER
+#define VPX(vp7, f) vp7_ ## f
+#else // CONFIG_VP8_DECODER
+#define VPX(vp7, f) vp8_ ## f
+#endif
+
static void free_buffers(VP8Context *s)
{
int i;
@@ -74,6 +84,7 @@ static void vp8_release_frame(VP8Context *s, VP8Frame *f)
ff_thread_release_buffer(s->avctx, &f->tf);
}
+#if CONFIG_VP8_DECODER
static int vp8_ref_frame(VP8Context *s, VP8Frame *dst, VP8Frame *src)
{
int ret;
@@ -90,7 +101,7 @@ static int vp8_ref_frame(VP8Context *s, VP8Frame *dst, VP8Frame *src)
return 0;
}
-
+#endif /* CONFIG_VP8_DECODER */
static void vp8_decode_flush_impl(AVCodecContext *avctx, int free_mem)
{
@@ -110,7 +121,32 @@ static void vp8_decode_flush(AVCodecContext *avctx)
vp8_decode_flush_impl(avctx, 0);
}
-static int update_dimensions(VP8Context *s, int width, int height)
+static VP8Frame *vp8_find_free_buffer(VP8Context *s)
+{
+ VP8Frame *frame = NULL;
+ int i;
+
+ // find a free buffer
+ for (i = 0; i < 5; i++)
+ if (&s->frames[i] != s->framep[VP56_FRAME_CURRENT] &&
+ &s->frames[i] != s->framep[VP56_FRAME_PREVIOUS] &&
+ &s->frames[i] != s->framep[VP56_FRAME_GOLDEN] &&
+ &s->frames[i] != s->framep[VP56_FRAME_GOLDEN2]) {
+ frame = &s->frames[i];
+ break;
+ }
+ if (i == 5) {
+ av_log(s->avctx, AV_LOG_FATAL, "Ran out of free frames!\n");
+ abort();
+ }
+ if (frame->tf.f->data[0])
+ vp8_release_frame(s, frame);
+
+ return frame;
+}
+
+static av_always_inline
+int update_dimensions(VP8Context *s, int width, int height, int is_vp7)
{
AVCodecContext *avctx = s->avctx;
int i, ret;
@@ -124,22 +160,25 @@ static int update_dimensions(VP8Context *s, int width, int height)
return ret;
}
- s->mb_width = (s->avctx->coded_width +15) / 16;
- s->mb_height = (s->avctx->coded_height+15) / 16;
+ s->mb_width = (s->avctx->coded_width + 15) / 16;
+ s->mb_height = (s->avctx->coded_height + 15) / 16;
- s->mb_layout = (avctx->active_thread_type == FF_THREAD_SLICE) && (FFMIN(s->num_coeff_partitions, avctx->thread_count) > 1);
+ s->mb_layout = is_vp7 || avctx->active_thread_type == FF_THREAD_SLICE &&
+ FFMIN(s->num_coeff_partitions, avctx->thread_count) > 1;
if (!s->mb_layout) { // Frame threading and one thread
- s->macroblocks_base = av_mallocz((s->mb_width+s->mb_height*2+1)*sizeof(*s->macroblocks));
- s->intra4x4_pred_mode_top = av_mallocz(s->mb_width*4);
- }
- else // Sliced threading
- s->macroblocks_base = av_mallocz((s->mb_width+2)*(s->mb_height+2)*sizeof(*s->macroblocks));
- s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
- s->top_border = av_mallocz((s->mb_width+1)*sizeof(*s->top_border));
- s->thread_data = av_mallocz(MAX_THREADS*sizeof(VP8ThreadData));
+ s->macroblocks_base = av_mallocz((s->mb_width + s->mb_height * 2 + 1) *
+ sizeof(*s->macroblocks));
+ s->intra4x4_pred_mode_top = av_mallocz(s->mb_width * 4);
+ } else // Sliced threading
+ s->macroblocks_base = av_mallocz((s->mb_width + 2) * (s->mb_height + 2) *
+ sizeof(*s->macroblocks));
+ s->top_nnz = av_mallocz(s->mb_width * sizeof(*s->top_nnz));
+ s->top_border = av_mallocz((s->mb_width + 1) * sizeof(*s->top_border));
+ s->thread_data = av_mallocz(MAX_THREADS * sizeof(VP8ThreadData));
for (i = 0; i < MAX_THREADS; i++) {
- s->thread_data[i].filter_strength = av_mallocz(s->mb_width*sizeof(*s->thread_data[0].filter_strength));
+ s->thread_data[i].filter_strength =
+ av_mallocz(s->mb_width * sizeof(*s->thread_data[0].filter_strength));
#if HAVE_THREADS
pthread_mutex_init(&s->thread_data[i].lock, NULL);
pthread_cond_init(&s->thread_data[i].cond, NULL);
@@ -150,11 +189,22 @@ static int update_dimensions(VP8Context *s, int width, int height)
(!s->intra4x4_pred_mode_top && !s->mb_layout))
return AVERROR(ENOMEM);
- s->macroblocks = s->macroblocks_base + 1;
+ s->macroblocks = s->macroblocks_base + 1;
return 0;
}
+static int vp7_update_dimensions(VP8Context *s, int width, int height)
+{
+ return update_dimensions(s, width, height, IS_VP7);
+}
+
+static int vp8_update_dimensions(VP8Context *s, int width, int height)
+{
+ return update_dimensions(s, width, height, IS_VP8);
+}
+
+
static void parse_segment_info(VP8Context *s)
{
VP56RangeCoder *c = &s->c;
@@ -207,13 +257,13 @@ static int setup_partitions(VP8Context *s, const uint8_t *buf, int buf_size)
s->num_coeff_partitions = 1 << vp8_rac_get_uint(&s->c, 2);
- buf += 3*(s->num_coeff_partitions-1);
- buf_size -= 3*(s->num_coeff_partitions-1);
+ buf += 3 * (s->num_coeff_partitions - 1);
+ buf_size -= 3 * (s->num_coeff_partitions - 1);
if (buf_size < 0)
return -1;
- for (i = 0; i < s->num_coeff_partitions-1; i++) {
- int size = AV_RL24(sizes + 3*i);
+ for (i = 0; i < s->num_coeff_partitions - 1; i++) {
+ int size = AV_RL24(sizes + 3 * i);
if (buf_size - size < 0)
return -1;
@@ -226,7 +276,26 @@ static int setup_partitions(VP8Context *s, const uint8_t *buf, int buf_size)
return 0;
}
-static void get_quants(VP8Context *s)
+static void vp7_get_quants(VP8Context *s)
+{
+ VP56RangeCoder *c = &s->c;
+
+ int yac_qi = vp8_rac_get_uint(c, 7);
+ int ydc_qi = vp8_rac_get(c) ? vp8_rac_get_uint(c, 7) : yac_qi;
+ int y2dc_qi = vp8_rac_get(c) ? vp8_rac_get_uint(c, 7) : yac_qi;
+ int y2ac_qi = vp8_rac_get(c) ? vp8_rac_get_uint(c, 7) : yac_qi;
+ int uvdc_qi = vp8_rac_get(c) ? vp8_rac_get_uint(c, 7) : yac_qi;
+ int uvac_qi = vp8_rac_get(c) ? vp8_rac_get_uint(c, 7) : yac_qi;
+
+ s->qmat[0].luma_qmul[0] = vp7_ydc_qlookup[ydc_qi];
+ s->qmat[0].luma_qmul[1] = vp7_yac_qlookup[yac_qi];
+ s->qmat[0].luma_dc_qmul[0] = vp7_y2dc_qlookup[y2dc_qi];
+ s->qmat[0].luma_dc_qmul[1] = vp7_y2ac_qlookup[y2ac_qi];
+ s->qmat[0].chroma_qmul[0] = FFMIN(vp7_ydc_qlookup[uvdc_qi], 132);
+ s->qmat[0].chroma_qmul[1] = vp7_yac_qlookup[uvac_qi];
+}
+
+static void vp8_get_quants(VP8Context *s)
{
VP56RangeCoder *c = &s->c;
int i, base_qi;
@@ -246,13 +315,13 @@ static void get_quants(VP8Context *s)
} else
base_qi = yac_qi;
- s->qmat[i].luma_qmul[0] = vp8_dc_qlookup[av_clip_uintp2(base_qi + ydc_delta , 7)];
- s->qmat[i].luma_qmul[1] = vp8_ac_qlookup[av_clip_uintp2(base_qi , 7)];
- s->qmat[i].luma_dc_qmul[0] = 2 * vp8_dc_qlookup[av_clip_uintp2(base_qi + y2dc_delta, 7)];
+ s->qmat[i].luma_qmul[0] = vp8_dc_qlookup[av_clip_uintp2(base_qi + ydc_delta, 7)];
+ s->qmat[i].luma_qmul[1] = vp8_ac_qlookup[av_clip_uintp2(base_qi, 7)];
+ s->qmat[i].luma_dc_qmul[0] = vp8_dc_qlookup[av_clip_uintp2(base_qi + y2dc_delta, 7)] * 2;
/* 101581>>16 is equivalent to 155/100 */
- s->qmat[i].luma_dc_qmul[1] = (101581 * vp8_ac_qlookup[av_clip_uintp2(base_qi + y2ac_delta, 7)]) >> 16;
- s->qmat[i].chroma_qmul[0] = vp8_dc_qlookup[av_clip_uintp2(base_qi + uvdc_delta, 7)];
- s->qmat[i].chroma_qmul[1] = vp8_ac_qlookup[av_clip_uintp2(base_qi + uvac_delta, 7)];
+ s->qmat[i].luma_dc_qmul[1] = vp8_ac_qlookup[av_clip_uintp2(base_qi + y2ac_delta, 7)] * 101581 >> 16;
+ s->qmat[i].chroma_qmul[0] = vp8_dc_qlookup[av_clip_uintp2(base_qi + uvdc_delta, 7)];
+ s->qmat[i].chroma_qmul[1] = vp8_ac_qlookup[av_clip_uintp2(base_qi + uvac_delta, 7)];
s->qmat[i].luma_dc_qmul[1] = FFMAX(s->qmat[i].luma_dc_qmul[1], 8);
s->qmat[i].chroma_qmul[0] = FFMIN(s->qmat[i].chroma_qmul[0], 132);
@@ -288,6 +357,54 @@ static VP56Frame ref_to_update(VP8Context *s, int update, VP56Frame ref)
return VP56_FRAME_NONE;
}
+static void vp78_reset_probability_tables(VP8Context *s)
+{
+ int i, j;
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 16; j++)
+ memcpy(s->prob->token[i][j], vp8_token_default_probs[i][vp8_coeff_band[j]],
+ sizeof(s->prob->token[i][j]));
+}
+
+static void vp78_update_probability_tables(VP8Context *s)
+{
+ VP56RangeCoder *c = &s->c;
+ int i, j, k, l, m;
+
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 8; j++)
+ for (k = 0; k < 3; k++)
+ for (l = 0; l < NUM_DCT_TOKENS-1; l++)
+ if (vp56_rac_get_prob_branchy(c, vp8_token_update_probs[i][j][k][l])) {
+ int prob = vp8_rac_get_uint(c, 8);
+ for (m = 0; vp8_coeff_band_indexes[j][m] >= 0; m++)
+ s->prob->token[i][vp8_coeff_band_indexes[j][m]][k][l] = prob;
+ }
+}
+
+#define VP7_MVC_SIZE 17
+#define VP8_MVC_SIZE 19
+
+static void vp78_update_pred16x16_pred8x8_mvc_probabilities(VP8Context *s,
+ int mvc_size)
+{
+ VP56RangeCoder *c = &s->c;
+ int i, j;
+
+ if (vp8_rac_get(c))
+ for (i = 0; i < 4; i++)
+ s->prob->pred16x16[i] = vp8_rac_get_uint(c, 8);
+ if (vp8_rac_get(c))
+ for (i = 0; i < 3; i++)
+ s->prob->pred8x8c[i] = vp8_rac_get_uint(c, 8);
+
+ // 17.2 MV probability update
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < mvc_size; j++)
+ if (vp56_rac_get_prob_branchy(c, vp8_mv_update_prob[i][j]))
+ s->prob->mvc[i][j] = vp8_rac_get_nn(c);
+}
+
static void update_refs(VP8Context *s)
{
VP56RangeCoder *c = &s->c;
@@ -299,10 +416,220 @@ static void update_refs(VP8Context *s)
s->update_altref = ref_to_update(s, update_altref, VP56_FRAME_GOLDEN2);
}
-static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
+static void copy_chroma(AVFrame *dst, AVFrame *src, int width, int height)
+{
+ int i, j;
+
+ for (j = 1; j < 3; j++) {
+ for (i = 0; i < height / 2; i++)
+ memcpy(dst->data[j] + i * dst->linesize[j],
+ src->data[j] + i * src->linesize[j], width / 2);
+ }
+}
+
+static void fade(uint8_t *dst, int dst_linesize,
+ const uint8_t *src, int src_linesize,
+ int width, int height,
+ int alpha, int beta)
+{
+ int i, j;
+ for (j = 0; j < height; j++) {
+ for (i = 0; i < width; i++) {
+ uint8_t y = src[j * src_linesize + i];
+ dst[j * dst_linesize + i] = av_clip_uint8(y + ((y * beta) >> 8) + alpha);
+ }
+ }
+}
+
+static int vp7_fade_frame(VP8Context *s, VP56RangeCoder *c)
+{
+ int alpha = (int8_t) vp8_rac_get_uint(c, 8);
+ int beta = (int8_t) vp8_rac_get_uint(c, 8);
+ int ret;
+
+ if (!s->keyframe && (alpha || beta)) {
+ int width = s->mb_width * 16;
+ int height = s->mb_height * 16;
+ AVFrame *src, *dst;
+
+ if (!s->framep[VP56_FRAME_PREVIOUS] ||
+ !s->framep[VP56_FRAME_GOLDEN]) {
+ av_log(s->avctx, AV_LOG_WARNING, "Discarding interframe without a prior keyframe!\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ dst =
+ src = s->framep[VP56_FRAME_PREVIOUS]->tf.f;
+
+ /* preserve the golden frame, write a new previous frame */
+ if (s->framep[VP56_FRAME_GOLDEN] == s->framep[VP56_FRAME_PREVIOUS]) {
+ s->framep[VP56_FRAME_PREVIOUS] = vp8_find_free_buffer(s);
+ if ((ret = vp8_alloc_frame(s, s->framep[VP56_FRAME_PREVIOUS], 1)) < 0)
+ return ret;
+
+ dst = s->framep[VP56_FRAME_PREVIOUS]->tf.f;
+
+ copy_chroma(dst, src, width, height);
+ }
+
+ fade(dst->data[0], dst->linesize[0],
+ src->data[0], src->linesize[0],
+ width, height, alpha, beta);
+ }
+
+ return 0;
+}
+
+static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
+{
+ VP56RangeCoder *c = &s->c;
+ int part1_size, hscale, vscale, i, j, ret;
+ int width = s->avctx->width;
+ int height = s->avctx->height;
+
+ s->profile = (buf[0] >> 1) & 7;
+ if (s->profile > 1) {
+ avpriv_request_sample(s->avctx, "Unknown profile %d", s->profile);
+ return AVERROR_INVALIDDATA;
+ }
+
+ s->keyframe = !(buf[0] & 1);
+ s->invisible = 0;
+ part1_size = AV_RL24(buf) >> 4;
+
+ if (buf_size < 4 - s->profile + part1_size) {
+ av_log(s->avctx, AV_LOG_ERROR, "Buffer size %d is too small, needed : %d\n", buf_size, 4 - s->profile + part1_size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ buf += 4 - s->profile;
+ buf_size -= 4 - s->profile;
+
+ memcpy(s->put_pixels_tab, s->vp8dsp.put_vp8_epel_pixels_tab, sizeof(s->put_pixels_tab));
+
+ ff_vp56_init_range_decoder(c, buf, part1_size);
+ buf += part1_size;
+ buf_size -= part1_size;
+
+ /* A. Dimension information (keyframes only) */
+ if (s->keyframe) {
+ width = vp8_rac_get_uint(c, 12);
+ height = vp8_rac_get_uint(c, 12);
+ hscale = vp8_rac_get_uint(c, 2);
+ vscale = vp8_rac_get_uint(c, 2);
+ if (hscale || vscale)
+ avpriv_request_sample(s->avctx, "Upscaling");
+
+ s->update_golden = s->update_altref = VP56_FRAME_CURRENT;
+ vp78_reset_probability_tables(s);
+ memcpy(s->prob->pred16x16, vp8_pred16x16_prob_inter,
+ sizeof(s->prob->pred16x16));
+ memcpy(s->prob->pred8x8c, vp8_pred8x8c_prob_inter,
+ sizeof(s->prob->pred8x8c));
+ for (i = 0; i < 2; i++)
+ memcpy(s->prob->mvc[i], vp7_mv_default_prob[i],
+ sizeof(vp7_mv_default_prob[i]));
+ memset(&s->segmentation, 0, sizeof(s->segmentation));
+ memset(&s->lf_delta, 0, sizeof(s->lf_delta));
+ memcpy(s->prob[0].scan, zigzag_scan, sizeof(s->prob[0].scan));
+ }
+
+ if (s->keyframe || s->profile > 0)
+ memset(s->inter_dc_pred, 0 , sizeof(s->inter_dc_pred));
+
+ /* B. Decoding information for all four macroblock-level features */
+ for (i = 0; i < 4; i++) {
+ s->feature_enabled[i] = vp8_rac_get(c);
+ if (s->feature_enabled[i]) {
+ s->feature_present_prob[i] = vp8_rac_get_uint(c, 8);
+
+ for (j = 0; j < 3; j++)
+ s->feature_index_prob[i][j] =
+ vp8_rac_get(c) ? vp8_rac_get_uint(c, 8) : 255;
+
+ if (vp7_feature_value_size[s->profile][i])
+ for (j = 0; j < 4; j++)
+ s->feature_value[i][j] =
+ vp8_rac_get(c) ? vp8_rac_get_uint(c, vp7_feature_value_size[s->profile][i]) : 0;
+ }
+ }
+
+ s->segmentation.enabled = 0;
+ s->segmentation.update_map = 0;
+ s->lf_delta.enabled = 0;
+
+ s->num_coeff_partitions = 1;
+ ff_vp56_init_range_decoder(&s->coeff_partition[0], buf, buf_size);
+
+ if (!s->macroblocks_base || /* first frame */
+ width != s->avctx->width || height != s->avctx->height ||
+ (width + 15) / 16 != s->mb_width || (height + 15) / 16 != s->mb_height) {
+ if ((ret = vp7_update_dimensions(s, width, height)) < 0)
+ return ret;
+ }
+
+ /* C. Dequantization indices */
+ vp7_get_quants(s);
+
+ /* D. Golden frame update flag (a Flag) for interframes only */
+ if (!s->keyframe) {
+ s->update_golden = vp8_rac_get(c) ? VP56_FRAME_CURRENT : VP56_FRAME_NONE;
+ s->sign_bias[VP56_FRAME_GOLDEN] = 0;
+ }
+
+ s->update_last = 1;
+ s->update_probabilities = 1;
+ s->fade_present = 1;
+
+ if (s->profile > 0) {
+ s->update_probabilities = vp8_rac_get(c);
+ if (!s->update_probabilities)
+ s->prob[1] = s->prob[0];
+
+ if (!s->keyframe)
+ s->fade_present = vp8_rac_get(c);
+ }
+
+ /* E. Fading information for previous frame */
+ if (s->fade_present && vp8_rac_get(c)) {
+ if ((ret = vp7_fade_frame(s ,c)) < 0)
+ return ret;
+ }
+
+ /* F. Loop filter type */
+ if (!s->profile)
+ s->filter.simple = vp8_rac_get(c);
+
+ /* G. DCT coefficient ordering specification */
+ if (vp8_rac_get(c))
+ for (i = 1; i < 16; i++)
+ s->prob[0].scan[i] = zigzag_scan[vp8_rac_get_uint(c, 4)];
+
+ /* H. Loop filter levels */
+ if (s->profile > 0)
+ s->filter.simple = vp8_rac_get(c);
+ s->filter.level = vp8_rac_get_uint(c, 6);
+ s->filter.sharpness = vp8_rac_get_uint(c, 3);
+
+ /* I. DCT coefficient probability update; 13.3 Token Probability Updates */
+ vp78_update_probability_tables(s);
+
+ s->mbskip_enabled = 0;
+
+ /* J. The remaining frame header data occurs ONLY FOR INTERFRAMES */
+ if (!s->keyframe) {
+ s->prob->intra = vp8_rac_get_uint(c, 8);
+ s->prob->last = vp8_rac_get_uint(c, 8);
+ vp78_update_pred16x16_pred8x8_mvc_probabilities(s, VP7_MVC_SIZE);
+ }
+
+ return 0;
+}
+
+static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
{
VP56RangeCoder *c = &s->c;
- int header_size, hscale, vscale, i, j, k, l, m, ret;
+ int header_size, hscale, vscale, ret;
int width = s->avctx->width;
int height = s->avctx->height;
@@ -317,24 +644,27 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
av_log(s->avctx, AV_LOG_WARNING, "Unknown profile %d\n", s->profile);
if (!s->profile)
- memcpy(s->put_pixels_tab, s->vp8dsp.put_vp8_epel_pixels_tab, sizeof(s->put_pixels_tab));
+ memcpy(s->put_pixels_tab, s->vp8dsp.put_vp8_epel_pixels_tab,
+ sizeof(s->put_pixels_tab));
else // profile 1-3 use bilinear, 4+ aren't defined so whatever
- memcpy(s->put_pixels_tab, s->vp8dsp.put_vp8_bilinear_pixels_tab, sizeof(s->put_pixels_tab));
+ memcpy(s->put_pixels_tab, s->vp8dsp.put_vp8_bilinear_pixels_tab,
+ sizeof(s->put_pixels_tab));
- if (header_size > buf_size - 7*s->keyframe) {
+ if (header_size > buf_size - 7 * s->keyframe) {
av_log(s->avctx, AV_LOG_ERROR, "Header size larger than data provided\n");
return AVERROR_INVALIDDATA;
}
if (s->keyframe) {
if (AV_RL24(buf) != 0x2a019d) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid start code 0x%x\n", AV_RL24(buf));
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Invalid start code 0x%x\n", AV_RL24(buf));
return AVERROR_INVALIDDATA;
}
- width = AV_RL16(buf+3) & 0x3fff;
- height = AV_RL16(buf+5) & 0x3fff;
- hscale = buf[4] >> 6;
- vscale = buf[6] >> 6;
+ width = AV_RL16(buf + 3) & 0x3fff;
+ height = AV_RL16(buf + 5) & 0x3fff;
+ hscale = buf[4] >> 6;
+ vscale = buf[6] >> 6;
buf += 7;
buf_size -= 7;
@@ -342,13 +672,13 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
avpriv_request_sample(s->avctx, "Upscaling");
s->update_golden = s->update_altref = VP56_FRAME_CURRENT;
- for (i = 0; i < 4; i++)
- for (j = 0; j < 16; j++)
- memcpy(s->prob->token[i][j], vp8_token_default_probs[i][vp8_coeff_band[j]],
- sizeof(s->prob->token[i][j]));
- memcpy(s->prob->pred16x16, vp8_pred16x16_prob_inter, sizeof(s->prob->pred16x16));
- memcpy(s->prob->pred8x8c , vp8_pred8x8c_prob_inter , sizeof(s->prob->pred8x8c));
- memcpy(s->prob->mvc , vp8_mv_default_prob , sizeof(s->prob->mvc));
+ vp78_reset_probability_tables(s);
+ memcpy(s->prob->pred16x16, vp8_pred16x16_prob_inter,
+ sizeof(s->prob->pred16x16));
+ memcpy(s->prob->pred8x8c, vp8_pred8x8c_prob_inter,
+ sizeof(s->prob->pred8x8c));
+ memcpy(s->prob->mvc, vp8_mv_default_prob,
+ sizeof(s->prob->mvc));
memset(&s->segmentation, 0, sizeof(s->segmentation));
memset(&s->lf_delta, 0, sizeof(s->lf_delta));
}
@@ -382,12 +712,12 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
}
if (!s->macroblocks_base || /* first frame */
- width != s->avctx->width || height != s->avctx->height || (width+15)/16 != s->mb_width || (height+15)/16 != s->mb_height) {
- if ((ret = update_dimensions(s, width, height)) < 0)
+ width != s->avctx->width || height != s->avctx->height ||
+ (width+15)/16 != s->mb_width || (height+15)/16 != s->mb_height)
+ if ((ret = vp8_update_dimensions(s, width, height)) < 0)
return ret;
- }
- get_quants(s);
+ vp8_get_quants(s);
if (!s->keyframe) {
update_refs(s);
@@ -402,15 +732,7 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
s->update_last = s->keyframe || vp8_rac_get(c);
- for (i = 0; i < 4; i++)
- for (j = 0; j < 8; j++)
- for (k = 0; k < 3; k++)
- for (l = 0; l < NUM_DCT_TOKENS-1; l++)
- if (vp56_rac_get_prob_branchy(c, vp8_token_update_probs[i][j][k][l])) {
- int prob = vp8_rac_get_uint(c, 8);
- for (m = 0; vp8_coeff_band_indexes[j][m] >= 0; m++)
- s->prob->token[i][vp8_coeff_band_indexes[j][m]][k][l] = prob;
- }
+ vp78_update_probability_tables(s);
if ((s->mbskip_enabled = vp8_rac_get(c)))
s->prob->mbskip = vp8_rac_get_uint(c, 8);
@@ -419,25 +741,14 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
s->prob->intra = vp8_rac_get_uint(c, 8);
s->prob->last = vp8_rac_get_uint(c, 8);
s->prob->golden = vp8_rac_get_uint(c, 8);
-
- if (vp8_rac_get(c))
- for (i = 0; i < 4; i++)
- s->prob->pred16x16[i] = vp8_rac_get_uint(c, 8);
- if (vp8_rac_get(c))
- for (i = 0; i < 3; i++)
- s->prob->pred8x8c[i] = vp8_rac_get_uint(c, 8);
-
- // 17.2 MV probability update
- for (i = 0; i < 2; i++)
- for (j = 0; j < 19; j++)
- if (vp56_rac_get_prob_branchy(c, vp8_mv_update_prob[i][j]))
- s->prob->mvc[i][j] = vp8_rac_get_nn(c);
+ vp78_update_pred16x16_pred8x8_mvc_probabilities(s, VP8_MVC_SIZE);
}
return 0;
}
-static av_always_inline void clamp_mv(VP8Context *s, VP56mv *dst, const VP56mv *src)
+static av_always_inline
+void clamp_mv(VP8Context *s, VP56mv *dst, const VP56mv *src)
{
dst->x = av_clip(src->x, s->mv_min.x, s->mv_max.x);
dst->y = av_clip(src->y, s->mv_min.y, s->mv_max.y);
@@ -446,7 +757,7 @@ static av_always_inline void clamp_mv(VP8Context *s, VP56mv *dst, const VP56mv *
/**
* Motion vector coding, 17.1.
*/
-static int read_mv_component(VP56RangeCoder *c, const uint8_t *p)
+static av_always_inline int read_mv_component(VP56RangeCoder *c, const uint8_t *p, int vp7)
{
int bit, x = 0;
@@ -455,33 +766,46 @@ static int read_mv_component(VP56RangeCoder *c, const uint8_t *p)
for (i = 0; i < 3; i++)
x += vp56_rac_get_prob(c, p[9 + i]) << i;
- for (i = 9; i > 3; i--)
+ for (i = (vp7 ? 7 : 9); i > 3; i--)
x += vp56_rac_get_prob(c, p[9 + i]) << i;
- if (!(x & 0xFFF0) || vp56_rac_get_prob(c, p[12]))
+ if (!(x & (vp7 ? 0xF0 : 0xFFF0)) || vp56_rac_get_prob(c, p[12]))
x += 8;
} else {
// small_mvtree
- const uint8_t *ps = p+2;
+ const uint8_t *ps = p + 2;
bit = vp56_rac_get_prob(c, *ps);
- ps += 1 + 3*bit;
- x += 4*bit;
+ ps += 1 + 3 * bit;
+ x += 4 * bit;
bit = vp56_rac_get_prob(c, *ps);
ps += 1 + bit;
- x += 2*bit;
+ x += 2 * bit;
x += vp56_rac_get_prob(c, *ps);
}
return (x && vp56_rac_get_prob(c, p[1])) ? -x : x;
}
+static int vp7_read_mv_component(VP56RangeCoder *c, const uint8_t *p)
+{
+ return read_mv_component(c, p, 1);
+}
+
+static int vp8_read_mv_component(VP56RangeCoder *c, const uint8_t *p)
+{
+ return read_mv_component(c, p, 0);
+}
+
static av_always_inline
-const uint8_t *get_submv_prob(uint32_t left, uint32_t top)
+const uint8_t *get_submv_prob(uint32_t left, uint32_t top, int is_vp7)
{
+ if (is_vp7)
+ return vp7_submv_prob;
+
if (left == top)
- return vp8_submv_prob[4-!!left];
+ return vp8_submv_prob[4 - !!left];
if (!top)
return vp8_submv_prob[2];
- return vp8_submv_prob[1-!!left];
+ return vp8_submv_prob[1 - !!left];
}
/**
@@ -489,15 +813,15 @@ const uint8_t *get_submv_prob(uint32_t left, uint32_t top)
* @returns the number of motion vectors parsed (2, 4 or 16)
*/
static av_always_inline
-int decode_splitmvs(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb, int layout)
+int decode_splitmvs(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb,
+ int layout, int is_vp7)
{
int part_idx;
int n, num;
VP8Macroblock *top_mb;
VP8Macroblock *left_mb = &mb[-1];
- const uint8_t *mbsplits_left = vp8_mbsplits[left_mb->partitioning],
- *mbsplits_top,
- *mbsplits_cur, *firstidx;
+ const uint8_t *mbsplits_left = vp8_mbsplits[left_mb->partitioning];
+ const uint8_t *mbsplits_top, *mbsplits_cur, *firstidx;
VP56mv *top_mv;
VP56mv *left_mv = left_mb->bmv;
VP56mv *cur_mv = mb->bmv;
@@ -505,23 +829,22 @@ int decode_splitmvs(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb, int lay
if (!layout) // layout is inlined, s->mb_layout is not
top_mb = &mb[2];
else
- top_mb = &mb[-s->mb_width-1];
+ top_mb = &mb[-s->mb_width - 1];
mbsplits_top = vp8_mbsplits[top_mb->partitioning];
- top_mv = top_mb->bmv;
+ top_mv = top_mb->bmv;
if (vp56_rac_get_prob_branchy(c, vp8_mbsplit_prob[0])) {
- if (vp56_rac_get_prob_branchy(c, vp8_mbsplit_prob[1])) {
+ if (vp56_rac_get_prob_branchy(c, vp8_mbsplit_prob[1]))
part_idx = VP8_SPLITMVMODE_16x8 + vp56_rac_get_prob(c, vp8_mbsplit_prob[2]);
- } else {
+ else
part_idx = VP8_SPLITMVMODE_8x8;
- }
} else {
part_idx = VP8_SPLITMVMODE_4x4;
}
- num = vp8_mbsplit_count[part_idx];
- mbsplits_cur = vp8_mbsplits[part_idx],
- firstidx = vp8_mbfirstidx[part_idx];
+ num = vp8_mbsplit_count[part_idx];
+ mbsplits_cur = vp8_mbsplits[part_idx],
+ firstidx = vp8_mbfirstidx[part_idx];
mb->partitioning = part_idx;
for (n = 0; n < num; n++) {
@@ -532,19 +855,21 @@ int decode_splitmvs(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb, int lay
if (!(k & 3))
left = AV_RN32A(&left_mv[mbsplits_left[k + 3]]);
else
- left = AV_RN32A(&cur_mv[mbsplits_cur[k - 1]]);
+ left = AV_RN32A(&cur_mv[mbsplits_cur[k - 1]]);
if (k <= 3)
above = AV_RN32A(&top_mv[mbsplits_top[k + 12]]);
else
above = AV_RN32A(&cur_mv[mbsplits_cur[k - 4]]);
- submv_prob = get_submv_prob(left, above);
+ submv_prob = get_submv_prob(left, above, is_vp7);
if (vp56_rac_get_prob_branchy(c, submv_prob[0])) {
if (vp56_rac_get_prob_branchy(c, submv_prob[1])) {
if (vp56_rac_get_prob_branchy(c, submv_prob[2])) {
- mb->bmv[n].y = mb->mv.y + read_mv_component(c, s->prob->mvc[0]);
- mb->bmv[n].x = mb->mv.x + read_mv_component(c, s->prob->mvc[1]);
+ mb->bmv[n].y = mb->mv.y +
+ read_mv_component(c, s->prob->mvc[0], is_vp7);
+ mb->bmv[n].x = mb->mv.x +
+ read_mv_component(c, s->prob->mvc[1], is_vp7);
} else {
AV_ZERO32(&mb->bmv[n]);
}
@@ -559,12 +884,133 @@ int decode_splitmvs(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb, int lay
return num;
}
+/**
+ * The vp7 reference decoder uses a padding macroblock column (added to right
+ * edge of the frame) to guard against illegal macroblock offsets. The
+ * algorithm has bugs that permit offsets to straddle the padding column.
+ * This function replicates those bugs.
+ *
+ * @param[out] edge_x macroblock x address
+ * @param[out] edge_y macroblock y address
+ *
+ * @return macroblock offset legal (boolean)
+ */
+static int vp7_calculate_mb_offset(int mb_x, int mb_y, int mb_width,
+ int xoffset, int yoffset, int boundary,
+ int *edge_x, int *edge_y)
+{
+ int vwidth = mb_width + 1;
+ int new = (mb_y + yoffset) * vwidth + mb_x + xoffset;
+ if (new < boundary || new % vwidth == vwidth - 1)
+ return 0;
+ *edge_y = new / vwidth;
+ *edge_x = new % vwidth;
+ return 1;
+}
+
+static const VP56mv *get_bmv_ptr(const VP8Macroblock *mb, int subblock)
+{
+ return &mb->bmv[mb->mode == VP8_MVMODE_SPLIT ? vp8_mbsplits[mb->partitioning][subblock] : 0];
+}
+
static av_always_inline
-void decode_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int layout)
+void vp7_decode_mvs(VP8Context *s, VP8Macroblock *mb,
+ int mb_x, int mb_y, int layout)
{
- VP8Macroblock *mb_edge[3] = { 0 /* top */,
+ VP8Macroblock *mb_edge[12];
+ enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR };
+ enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
+ int idx = CNT_ZERO;
+ VP56mv near_mv[3];
+ uint8_t cnt[3] = { 0 };
+ VP56RangeCoder *c = &s->c;
+ int i;
+
+ AV_ZERO32(&near_mv[0]);
+ AV_ZERO32(&near_mv[1]);
+ AV_ZERO32(&near_mv[2]);
+
+ for (i = 0; i < VP7_MV_PRED_COUNT; i++) {
+ const VP7MVPred * pred = &vp7_mv_pred[i];
+ int edge_x, edge_y;
+
+ if (vp7_calculate_mb_offset(mb_x, mb_y, s->mb_width, pred->xoffset,
+ pred->yoffset, !s->profile, &edge_x, &edge_y)) {
+ VP8Macroblock *edge = mb_edge[i] = (s->mb_layout == 1)
+ ? s->macroblocks_base + 1 + edge_x +
+ (s->mb_width + 1) * (edge_y + 1)
+ : s->macroblocks + edge_x +
+ (s->mb_height - edge_y - 1) * 2;
+ uint32_t mv = AV_RN32A(get_bmv_ptr(edge, vp7_mv_pred[i].subblock));
+ if (mv) {
+ if (AV_RN32A(&near_mv[CNT_NEAREST])) {
+ if (mv == AV_RN32A(&near_mv[CNT_NEAREST])) {
+ idx = CNT_NEAREST;
+ } else if (AV_RN32A(&near_mv[CNT_NEAR])) {
+ if (mv != AV_RN32A(&near_mv[CNT_NEAR]))
+ continue;
+ idx = CNT_NEAR;
+ } else {
+ AV_WN32A(&near_mv[CNT_NEAR], mv);
+ idx = CNT_NEAR;
+ }
+ } else {
+ AV_WN32A(&near_mv[CNT_NEAREST], mv);
+ idx = CNT_NEAREST;
+ }
+ } else {
+ idx = CNT_ZERO;
+ }
+ } else {
+ idx = CNT_ZERO;
+ }
+ cnt[idx] += vp7_mv_pred[i].score;
+ }
+
+ mb->partitioning = VP8_SPLITMVMODE_NONE;
+
+ if (vp56_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_ZERO]][0])) {
+ mb->mode = VP8_MVMODE_MV;
+
+ if (vp56_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_NEAREST]][1])) {
+
+ if (vp56_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_NEAR]][2])) {
+
+ if (cnt[CNT_NEAREST] > cnt[CNT_NEAR])
+ AV_WN32A(&mb->mv, cnt[CNT_ZERO] > cnt[CNT_NEAREST] ? 0 : AV_RN32A(&near_mv[CNT_NEAREST]));
+ else
+ AV_WN32A(&mb->mv, cnt[CNT_ZERO] > cnt[CNT_NEAR] ? 0 : AV_RN32A(&near_mv[CNT_NEAR]));
+
+ if (vp56_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_NEAR]][3])) {
+ mb->mode = VP8_MVMODE_SPLIT;
+ mb->mv = mb->bmv[decode_splitmvs(s, c, mb, layout, IS_VP7) - 1];
+ } else {
+ mb->mv.y += vp7_read_mv_component(c, s->prob->mvc[0]);
+ mb->mv.x += vp7_read_mv_component(c, s->prob->mvc[1]);
+ mb->bmv[0] = mb->mv;
+ }
+ } else {
+ mb->mv = near_mv[CNT_NEAR];
+ mb->bmv[0] = mb->mv;
+ }
+ } else {
+ mb->mv = near_mv[CNT_NEAREST];
+ mb->bmv[0] = mb->mv;
+ }
+ } else {
+ mb->mode = VP8_MVMODE_ZERO;
+ AV_ZERO32(&mb->mv);
+ mb->bmv[0] = mb->mv;
+ }
+}
+
+static av_always_inline
+void vp8_decode_mvs(VP8Context *s, VP8Macroblock *mb,
+ int mb_x, int mb_y, int layout)
+{
+ VP8Macroblock *mb_edge[3] = { 0 /* top */,
mb - 1 /* left */,
- 0 /* top-left */ };
+ 0 /* top-left */ };
enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV };
enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
int idx = CNT_ZERO;
@@ -577,10 +1023,9 @@ void decode_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int layout
if (!layout) { // layout is inlined (s->mb_layout is not)
mb_edge[0] = mb + 2;
mb_edge[2] = mb + 1;
- }
- else {
- mb_edge[0] = mb - s->mb_width-1;
- mb_edge[2] = mb - s->mb_width-2;
+ } else {
+ mb_edge[0] = mb - s->mb_width - 1;
+ mb_edge[2] = mb - s->mb_width - 2;
}
AV_ZERO32(&near_mv[0]);
@@ -588,24 +1033,25 @@ void decode_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int layout
AV_ZERO32(&near_mv[2]);
/* Process MB on top, left and top-left */
- #define MV_EDGE_CHECK(n)\
- {\
- VP8Macroblock *edge = mb_edge[n];\
- int edge_ref = edge->ref_frame;\
- if (edge_ref != VP56_FRAME_CURRENT) {\
- uint32_t mv = AV_RN32A(&edge->mv);\
- if (mv) {\
- if (cur_sign_bias != sign_bias[edge_ref]) {\
- /* SWAR negate of the values in mv. */\
- mv = ~mv;\
- mv = ((mv&0x7fff7fff) + 0x00010001) ^ (mv&0x80008000);\
- }\
- if (!n || mv != AV_RN32A(&near_mv[idx]))\
- AV_WN32A(&near_mv[++idx], mv);\
- cnt[idx] += 1 + (n != 2);\
- } else\
- cnt[CNT_ZERO] += 1 + (n != 2);\
- }\
+#define MV_EDGE_CHECK(n) \
+ { \
+ VP8Macroblock *edge = mb_edge[n]; \
+ int edge_ref = edge->ref_frame; \
+ if (edge_ref != VP56_FRAME_CURRENT) { \
+ uint32_t mv = AV_RN32A(&edge->mv); \
+ if (mv) { \
+ if (cur_sign_bias != sign_bias[edge_ref]) { \
+ /* SWAR negate of the values in mv. */ \
+ mv = ~mv; \
+ mv = ((mv & 0x7fff7fff) + \
+ 0x00010001) ^ (mv & 0x80008000); \
+ } \
+ if (!n || mv != AV_RN32A(&near_mv[idx])) \
+ AV_WN32A(&near_mv[++idx], mv); \
+ cnt[idx] += 1 + (n != 2); \
+ } else \
+ cnt[CNT_ZERO] += 1 + (n != 2); \
+ } \
}
MV_EDGE_CHECK(0)
@@ -617,7 +1063,8 @@ void decode_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int layout
mb->mode = VP8_MVMODE_MV;
/* If we have three distinct MVs, merge first and last if they're the same */
- if (cnt[CNT_SPLITMV] && AV_RN32A(&near_mv[1 + VP8_EDGE_TOP]) == AV_RN32A(&near_mv[1 + VP8_EDGE_TOPLEFT]))
+ if (cnt[CNT_SPLITMV] &&
+ AV_RN32A(&near_mv[1 + VP8_EDGE_TOP]) == AV_RN32A(&near_mv[1 + VP8_EDGE_TOPLEFT]))
cnt[CNT_NEAREST] += 1;
/* Swap near and nearest if necessary */
@@ -628,7 +1075,6 @@ void decode_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int layout
if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_NEAREST]][1])) {
if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_NEAR]][2])) {
-
/* Choose the best mv out of 0,0 and the nearest mv */
clamp_mv(s, &mb->mv, &near_mv[CNT_ZERO + (cnt[CNT_NEAREST] >= cnt[CNT_ZERO])]);
cnt[CNT_SPLITMV] = ((mb_edge[VP8_EDGE_LEFT]->mode == VP8_MVMODE_SPLIT) +
@@ -637,10 +1083,10 @@ void decode_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int layout
if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_SPLITMV]][3])) {
mb->mode = VP8_MVMODE_SPLIT;
- mb->mv = mb->bmv[decode_splitmvs(s, c, mb, layout) - 1];
+ mb->mv = mb->bmv[decode_splitmvs(s, c, mb, layout, IS_VP8) - 1];
} else {
- mb->mv.y += read_mv_component(c, s->prob->mvc[0]);
- mb->mv.x += read_mv_component(c, s->prob->mvc[1]);
+ mb->mv.y += vp8_read_mv_component(c, s->prob->mvc[0]);
+ mb->mv.x += vp8_read_mv_component(c, s->prob->mvc[1]);
mb->bmv[0] = mb->mv;
}
} else {
@@ -664,41 +1110,59 @@ void decode_intra4x4_modes(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb,
{
uint8_t *intra4x4 = mb->intra4x4_pred_mode_mb;
- if (layout == 1) {
+ if (layout) {
VP8Macroblock *mb_top = mb - s->mb_width - 1;
memcpy(mb->intra4x4_pred_mode_top, mb_top->intra4x4_pred_mode_top, 4);
}
if (keyframe) {
int x, y;
- uint8_t* top;
- uint8_t* const left = s->intra4x4_pred_mode_left;
- if (layout == 1)
+ uint8_t *top;
+ uint8_t *const left = s->intra4x4_pred_mode_left;
+ if (layout)
top = mb->intra4x4_pred_mode_top;
else
top = s->intra4x4_pred_mode_top + 4 * mb_x;
for (y = 0; y < 4; y++) {
for (x = 0; x < 4; x++) {
const uint8_t *ctx;
- ctx = vp8_pred4x4_prob_intra[top[x]][left[y]];
+ ctx = vp8_pred4x4_prob_intra[top[x]][left[y]];
*intra4x4 = vp8_rac_get_tree(c, vp8_pred4x4_tree, ctx);
- left[y] = top[x] = *intra4x4;
+ left[y] = top[x] = *intra4x4;
intra4x4++;
}
}
} else {
int i;
for (i = 0; i < 16; i++)
- intra4x4[i] = vp8_rac_get_tree(c, vp8_pred4x4_tree, vp8_pred4x4_prob_inter);
+ intra4x4[i] = vp8_rac_get_tree(c, vp8_pred4x4_tree,
+ vp8_pred4x4_prob_inter);
}
}
static av_always_inline
void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
- uint8_t *segment, uint8_t *ref, int layout)
+ uint8_t *segment, uint8_t *ref, int layout, int is_vp7)
{
VP56RangeCoder *c = &s->c;
-
- if (s->segmentation.update_map) {
+ const char *vp7_feature_name[] = { "q-index",
+ "lf-delta",
+ "partial-golden-update",
+ "blit-pitch" };
+ if (is_vp7) {
+ int i;
+ *segment = 0;
+ for (i = 0; i < 4; i++) {
+ if (s->feature_enabled[i]) {
+ if (vp56_rac_get_prob_branchy(c, s->feature_present_prob[i])) {
+ int index = vp8_rac_get_tree(c, vp7_feature_index_tree,
+ s->feature_index_prob[i]);
+ av_log(s->avctx, AV_LOG_WARNING,
+ "Feature %s present in macroblock (value 0x%x)\n",
+ vp7_feature_name[i], s->feature_value[i][index]);
+ }
+ }
+ }
+ } else if (s->segmentation.update_map) {
int bit = vp56_rac_get_prob(c, s->prob->segmentid[0]);
*segment = vp56_rac_get_prob(c, s->prob->segmentid[1+bit]) + 2*bit;
} else if (s->segmentation.enabled)
@@ -708,32 +1172,39 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
mb->skip = s->mbskip_enabled ? vp56_rac_get_prob(c, s->prob->mbskip) : 0;
if (s->keyframe) {
- mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_intra, vp8_pred16x16_prob_intra);
+ mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_intra,
+ vp8_pred16x16_prob_intra);
if (mb->mode == MODE_I4x4) {
decode_intra4x4_modes(s, c, mb, mb_x, 1, layout);
} else {
- const uint32_t modes = vp8_pred4x4_mode[mb->mode] * 0x01010101u;
- if (s->mb_layout == 1)
+ const uint32_t modes = (is_vp7 ? vp7_pred4x4_mode
+ : vp8_pred4x4_mode)[mb->mode] * 0x01010101u;
+ if (s->mb_layout)
AV_WN32A(mb->intra4x4_pred_mode_top, modes);
else
AV_WN32A(s->intra4x4_pred_mode_top + 4 * mb_x, modes);
- AV_WN32A( s->intra4x4_pred_mode_left, modes);
+ AV_WN32A(s->intra4x4_pred_mode_left, modes);
}
- mb->chroma_pred_mode = vp8_rac_get_tree(c, vp8_pred8x8c_tree, vp8_pred8x8c_prob_intra);
- mb->ref_frame = VP56_FRAME_CURRENT;
+ mb->chroma_pred_mode = vp8_rac_get_tree(c, vp8_pred8x8c_tree,
+ vp8_pred8x8c_prob_intra);
+ mb->ref_frame = VP56_FRAME_CURRENT;
} else if (vp56_rac_get_prob_branchy(c, s->prob->intra)) {
// inter MB, 16.2
if (vp56_rac_get_prob_branchy(c, s->prob->last))
- mb->ref_frame = vp56_rac_get_prob(c, s->prob->golden) ?
- VP56_FRAME_GOLDEN2 /* altref */ : VP56_FRAME_GOLDEN;
+ mb->ref_frame =
+ (!is_vp7 && vp56_rac_get_prob(c, s->prob->golden)) ? VP56_FRAME_GOLDEN2 /* altref */
+ : VP56_FRAME_GOLDEN;
else
mb->ref_frame = VP56_FRAME_PREVIOUS;
- s->ref_count[mb->ref_frame-1]++;
+ s->ref_count[mb->ref_frame - 1]++;
// motion vectors, 16.3
- decode_mvs(s, mb, mb_x, mb_y, layout);
+ if (is_vp7)
+ vp7_decode_mvs(s, mb, mb_x, mb_y, layout);
+ else
+ vp8_decode_mvs(s, mb, mb_x, mb_y, layout);
} else {
// intra MB, 16.1
mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_inter, s->prob->pred16x16);
@@ -741,31 +1212,35 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
if (mb->mode == MODE_I4x4)
decode_intra4x4_modes(s, c, mb, mb_x, 0, layout);
- mb->chroma_pred_mode = vp8_rac_get_tree(c, vp8_pred8x8c_tree, s->prob->pred8x8c);
- mb->ref_frame = VP56_FRAME_CURRENT;
- mb->partitioning = VP8_SPLITMVMODE_NONE;
+ mb->chroma_pred_mode = vp8_rac_get_tree(c, vp8_pred8x8c_tree,
+ s->prob->pred8x8c);
+ mb->ref_frame = VP56_FRAME_CURRENT;
+ mb->partitioning = VP8_SPLITMVMODE_NONE;
AV_ZERO32(&mb->bmv[0]);
}
}
-#ifndef decode_block_coeffs_internal
/**
- * @param r arithmetic bitstream reader context
+ * @param r arithmetic bitstream reader context
* @param block destination for block coefficients
* @param probs probabilities to use when reading trees from the bitstream
- * @param i initial coeff index, 0 unless a separate DC block is coded
- * @param qmul array holding the dc/ac dequant factor at position 0/1
+ * @param i initial coeff index, 0 unless a separate DC block is coded
+ * @param qmul array holding the dc/ac dequant factor at position 0/1
+ *
* @return 0 if no coeffs were decoded
* otherwise, the index of the last coeff decoded plus one
*/
-static int decode_block_coeffs_internal(VP56RangeCoder *r, int16_t block[16],
- uint8_t probs[16][3][NUM_DCT_TOKENS-1],
- int i, uint8_t *token_prob, int16_t qmul[2])
+static av_always_inline
+int decode_block_coeffs_internal(VP56RangeCoder *r, int16_t block[16],
+ uint8_t probs[16][3][NUM_DCT_TOKENS - 1],
+ int i, uint8_t *token_prob, int16_t qmul[2],
+ const uint8_t scan[16], int vp7)
{
VP56RangeCoder c = *r;
goto skip_eob;
do {
int coeff;
+restart:
if (!vp56_rac_get_prob_branchy(&c, token_prob[0])) // DCT_EOB
break;
@@ -774,12 +1249,14 @@ skip_eob:
if (++i == 16)
break; // invalid input; blocks should end with EOB
token_prob = probs[i][0];
+ if (vp7)
+ goto restart;
goto skip_eob;
}
if (!vp56_rac_get_prob_branchy(&c, token_prob[2])) { // DCT_1
coeff = 1;
- token_prob = probs[i+1][1];
+ token_prob = probs[i + 1][1];
} else {
if (!vp56_rac_get_prob_branchy(&c, token_prob[3])) { // DCT 2,3,4
coeff = vp56_rac_get_prob_branchy(&c, token_prob[4]);
@@ -790,87 +1267,150 @@ skip_eob:
// DCT_CAT*
if (!vp56_rac_get_prob_branchy(&c, token_prob[6])) {
if (!vp56_rac_get_prob_branchy(&c, token_prob[7])) { // DCT_CAT1
- coeff = 5 + vp56_rac_get_prob(&c, vp8_dct_cat1_prob[0]);
+ coeff = 5 + vp56_rac_get_prob(&c, vp8_dct_cat1_prob[0]);
} else { // DCT_CAT2
coeff = 7;
coeff += vp56_rac_get_prob(&c, vp8_dct_cat2_prob[0]) << 1;
coeff += vp56_rac_get_prob(&c, vp8_dct_cat2_prob[1]);
}
} else { // DCT_CAT3 and up
- int a = vp56_rac_get_prob(&c, token_prob[8]);
- int b = vp56_rac_get_prob(&c, token_prob[9+a]);
- int cat = (a<<1) + b;
- coeff = 3 + (8<<cat);
+ int a = vp56_rac_get_prob(&c, token_prob[8]);
+ int b = vp56_rac_get_prob(&c, token_prob[9 + a]);
+ int cat = (a << 1) + b;
+ coeff = 3 + (8 << cat);
coeff += vp8_rac_get_coeff(&c, ff_vp8_dct_cat_prob[cat]);
}
}
- token_prob = probs[i+1][2];
+ token_prob = probs[i + 1][2];
}
- block[zigzag_scan[i]] = (vp8_rac_get(&c) ? -coeff : coeff) * qmul[!!i];
+ block[scan[i]] = (vp8_rac_get(&c) ? -coeff : coeff) * qmul[!!i];
} while (++i < 16);
*r = c;
return i;
}
+
+static av_always_inline
+int inter_predict_dc(int16_t block[16], int16_t pred[2])
+{
+ int16_t dc = block[0];
+ int ret = 0;
+
+ if (pred[1] > 3) {
+ dc += pred[0];
+ ret = 1;
+ }
+
+ if (!pred[0] | !dc | ((int32_t)pred[0] ^ (int32_t)dc) >> 31) {
+ block[0] = pred[0] = dc;
+ pred[1] = 0;
+ } else {
+ if (pred[0] == dc)
+ pred[1]++;
+ block[0] = pred[0] = dc;
+ }
+
+ return ret;
+}
+
+static int vp7_decode_block_coeffs_internal(VP56RangeCoder *r,
+ int16_t block[16],
+ uint8_t probs[16][3][NUM_DCT_TOKENS - 1],
+ int i, uint8_t *token_prob,
+ int16_t qmul[2],
+ const uint8_t scan[16])
+{
+ return decode_block_coeffs_internal(r, block, probs, i,
+ token_prob, qmul, scan, IS_VP7);
+}
+
+#ifndef vp8_decode_block_coeffs_internal
+static int vp8_decode_block_coeffs_internal(VP56RangeCoder *r,
+ int16_t block[16],
+ uint8_t probs[16][3][NUM_DCT_TOKENS - 1],
+ int i, uint8_t *token_prob,
+ int16_t qmul[2])
+{
+ return decode_block_coeffs_internal(r, block, probs, i,
+ token_prob, qmul, zigzag_scan, IS_VP8);
+}
#endif
/**
- * @param c arithmetic bitstream reader context
- * @param block destination for block coefficients
- * @param probs probabilities to use when reading trees from the bitstream
- * @param i initial coeff index, 0 unless a separate DC block is coded
+ * @param c arithmetic bitstream reader context
+ * @param block destination for block coefficients
+ * @param probs probabilities to use when reading trees from the bitstream
+ * @param i initial coeff index, 0 unless a separate DC block is coded
* @param zero_nhood the initial prediction context for number of surrounding
* all-zero blocks (only left/top, so 0-2)
- * @param qmul array holding the dc/ac dequant factor at position 0/1
+ * @param qmul array holding the dc/ac dequant factor at position 0/1
+ * @param scan scan pattern (VP7 only)
+ *
* @return 0 if no coeffs were decoded
* otherwise, the index of the last coeff decoded plus one
*/
static av_always_inline
int decode_block_coeffs(VP56RangeCoder *c, int16_t block[16],
- uint8_t probs[16][3][NUM_DCT_TOKENS-1],
- int i, int zero_nhood, int16_t qmul[2])
+ uint8_t probs[16][3][NUM_DCT_TOKENS - 1],
+ int i, int zero_nhood, int16_t qmul[2],
+ const uint8_t scan[16], int vp7)
{
uint8_t *token_prob = probs[i][zero_nhood];
if (!vp56_rac_get_prob_branchy(c, token_prob[0])) // DCT_EOB
return 0;
- return decode_block_coeffs_internal(c, block, probs, i, token_prob, qmul);
+ return vp7 ? vp7_decode_block_coeffs_internal(c, block, probs, i,
+ token_prob, qmul, scan)
+ : vp8_decode_block_coeffs_internal(c, block, probs, i,
+ token_prob, qmul);
}
static av_always_inline
-void decode_mb_coeffs(VP8Context *s, VP8ThreadData *td, VP56RangeCoder *c, VP8Macroblock *mb,
- uint8_t t_nnz[9], uint8_t l_nnz[9])
+void decode_mb_coeffs(VP8Context *s, VP8ThreadData *td, VP56RangeCoder *c,
+ VP8Macroblock *mb, uint8_t t_nnz[9], uint8_t l_nnz[9],
+ int is_vp7)
{
int i, x, y, luma_start = 0, luma_ctx = 3;
int nnz_pred, nnz, nnz_total = 0;
int segment = mb->segment;
int block_dc = 0;
- if (mb->mode != MODE_I4x4 && mb->mode != VP8_MVMODE_SPLIT) {
+ if (mb->mode != MODE_I4x4 && (is_vp7 || mb->mode != VP8_MVMODE_SPLIT)) {
nnz_pred = t_nnz[8] + l_nnz[8];
// decode DC values and do hadamard
- nnz = decode_block_coeffs(c, td->block_dc, s->prob->token[1], 0, nnz_pred,
- s->qmat[segment].luma_dc_qmul);
+ nnz = decode_block_coeffs(c, td->block_dc, s->prob->token[1], 0,
+ nnz_pred, s->qmat[segment].luma_dc_qmul,
+ zigzag_scan, is_vp7);
l_nnz[8] = t_nnz[8] = !!nnz;
+
+ if (is_vp7 && mb->mode > MODE_I4x4) {
+ nnz |= inter_predict_dc(td->block_dc,
+ s->inter_dc_pred[mb->ref_frame - 1]);
+ }
+
if (nnz) {
nnz_total += nnz;
- block_dc = 1;
+ block_dc = 1;
if (nnz == 1)
s->vp8dsp.vp8_luma_dc_wht_dc(td->block, td->block_dc);
else
s->vp8dsp.vp8_luma_dc_wht(td->block, td->block_dc);
}
luma_start = 1;
- luma_ctx = 0;
+ luma_ctx = 0;
}
// luma blocks
for (y = 0; y < 4; y++)
for (x = 0; x < 4; x++) {
nnz_pred = l_nnz[y] + t_nnz[x];
- nnz = decode_block_coeffs(c, td->block[y][x], s->prob->token[luma_ctx], luma_start,
- nnz_pred, s->qmat[segment].luma_qmul);
- // nnz+block_dc may be one more than the actual last index, but we don't care
+ nnz = decode_block_coeffs(c, td->block[y][x],
+ s->prob->token[luma_ctx],
+ luma_start, nnz_pred,
+ s->qmat[segment].luma_qmul,
+ s->prob[0].scan, is_vp7);
+ /* nnz+block_dc may be one more than the actual last index,
+ * but we don't care */
td->non_zero_count_cache[y][x] = nnz + block_dc;
t_nnz[x] = l_nnz[y] = !!nnz;
nnz_total += nnz;
@@ -882,11 +1422,13 @@ void decode_mb_coeffs(VP8Context *s, VP8ThreadData *td, VP56RangeCoder *c, VP8Ma
for (i = 4; i < 6; i++)
for (y = 0; y < 2; y++)
for (x = 0; x < 2; x++) {
- nnz_pred = l_nnz[i+2*y] + t_nnz[i+2*x];
- nnz = decode_block_coeffs(c, td->block[i][(y<<1)+x], s->prob->token[2], 0,
- nnz_pred, s->qmat[segment].chroma_qmul);
- td->non_zero_count_cache[i][(y<<1)+x] = nnz;
- t_nnz[i+2*x] = l_nnz[i+2*y] = !!nnz;
+ nnz_pred = l_nnz[i + 2 * y] + t_nnz[i + 2 * x];
+ nnz = decode_block_coeffs(c, td->block[i][(y << 1) + x],
+ s->prob->token[2], 0, nnz_pred,
+ s->qmat[segment].chroma_qmul,
+ s->prob[0].scan, is_vp7);
+ td->non_zero_count_cache[i][(y << 1) + x] = nnz;
+ t_nnz[i + 2 * x] = l_nnz[i + 2 * y] = !!nnz;
nnz_total += nnz;
}
@@ -898,105 +1440,98 @@ void decode_mb_coeffs(VP8Context *s, VP8ThreadData *td, VP56RangeCoder *c, VP8Ma
}
static av_always_inline
-void backup_mb_border(uint8_t *top_border, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr,
+void backup_mb_border(uint8_t *top_border, uint8_t *src_y,
+ uint8_t *src_cb, uint8_t *src_cr,
int linesize, int uvlinesize, int simple)
{
- AV_COPY128(top_border, src_y + 15*linesize);
+ AV_COPY128(top_border, src_y + 15 * linesize);
if (!simple) {
- AV_COPY64(top_border+16, src_cb + 7*uvlinesize);
- AV_COPY64(top_border+24, src_cr + 7*uvlinesize);
+ AV_COPY64(top_border + 16, src_cb + 7 * uvlinesize);
+ AV_COPY64(top_border + 24, src_cr + 7 * uvlinesize);
}
}
static av_always_inline
-void xchg_mb_border(uint8_t *top_border, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr,
- int linesize, int uvlinesize, int mb_x, int mb_y, int mb_width,
- int simple, int xchg)
+void xchg_mb_border(uint8_t *top_border, uint8_t *src_y, uint8_t *src_cb,
+ uint8_t *src_cr, int linesize, int uvlinesize, int mb_x,
+ int mb_y, int mb_width, int simple, int xchg)
{
- uint8_t *top_border_m1 = top_border-32; // for TL prediction
- src_y -= linesize;
+ uint8_t *top_border_m1 = top_border - 32; // for TL prediction
+ src_y -= linesize;
src_cb -= uvlinesize;
src_cr -= uvlinesize;
-#define XCHG(a,b,xchg) do { \
- if (xchg) AV_SWAP64(b,a); \
- else AV_COPY64(b,a); \
+#define XCHG(a, b, xchg) \
+ do { \
+ if (xchg) \
+ AV_SWAP64(b, a); \
+ else \
+ AV_COPY64(b, a); \
} while (0)
- XCHG(top_border_m1+8, src_y-8, xchg);
- XCHG(top_border, src_y, xchg);
- XCHG(top_border+8, src_y+8, 1);
- if (mb_x < mb_width-1)
- XCHG(top_border+32, src_y+16, 1);
+ XCHG(top_border_m1 + 8, src_y - 8, xchg);
+ XCHG(top_border, src_y, xchg);
+ XCHG(top_border + 8, src_y + 8, 1);
+ if (mb_x < mb_width - 1)
+ XCHG(top_border + 32, src_y + 16, 1);
// only copy chroma for normal loop filter
// or to initialize the top row to 127
if (!simple || !mb_y) {
- XCHG(top_border_m1+16, src_cb-8, xchg);
- XCHG(top_border_m1+24, src_cr-8, xchg);
- XCHG(top_border+16, src_cb, 1);
- XCHG(top_border+24, src_cr, 1);
+ XCHG(top_border_m1 + 16, src_cb - 8, xchg);
+ XCHG(top_border_m1 + 24, src_cr - 8, xchg);
+ XCHG(top_border + 16, src_cb, 1);
+ XCHG(top_border + 24, src_cr, 1);
}
}
static av_always_inline
int check_dc_pred8x8_mode(int mode, int mb_x, int mb_y)
{
- if (!mb_x) {
+ if (!mb_x)
return mb_y ? TOP_DC_PRED8x8 : DC_128_PRED8x8;
- } else {
+ else
return mb_y ? mode : LEFT_DC_PRED8x8;
- }
}
static av_always_inline
-int check_tm_pred8x8_mode(int mode, int mb_x, int mb_y)
+int check_tm_pred8x8_mode(int mode, int mb_x, int mb_y, int vp7)
{
- if (!mb_x) {
- return mb_y ? VERT_PRED8x8 : DC_129_PRED8x8;
- } else {
+ if (!mb_x)
+ return mb_y ? VERT_PRED8x8 : (vp7 ? DC_128_PRED8x8 : DC_129_PRED8x8);
+ else
return mb_y ? mode : HOR_PRED8x8;
- }
}
static av_always_inline
-int check_intra_pred8x8_mode(int mode, int mb_x, int mb_y)
-{
- if (mode == DC_PRED8x8) {
- return check_dc_pred8x8_mode(mode, mb_x, mb_y);
- } else {
- return mode;
- }
-}
-
-static av_always_inline
-int check_intra_pred8x8_mode_emuedge(int mode, int mb_x, int mb_y)
+int check_intra_pred8x8_mode_emuedge(int mode, int mb_x, int mb_y, int vp7)
{
switch (mode) {
case DC_PRED8x8:
return check_dc_pred8x8_mode(mode, mb_x, mb_y);
case VERT_PRED8x8:
- return !mb_y ? DC_127_PRED8x8 : mode;
+ return !mb_y ? (vp7 ? DC_128_PRED8x8 : DC_127_PRED8x8) : mode;
case HOR_PRED8x8:
- return !mb_x ? DC_129_PRED8x8 : mode;
- case PLANE_PRED8x8 /*TM*/:
- return check_tm_pred8x8_mode(mode, mb_x, mb_y);
+ return !mb_x ? (vp7 ? DC_128_PRED8x8 : DC_129_PRED8x8) : mode;
+ case PLANE_PRED8x8: /* TM */
+ return check_tm_pred8x8_mode(mode, mb_x, mb_y, vp7);
}
return mode;
}
static av_always_inline
-int check_tm_pred4x4_mode(int mode, int mb_x, int mb_y)
+int check_tm_pred4x4_mode(int mode, int mb_x, int mb_y, int vp7)
{
if (!mb_x) {
- return mb_y ? VERT_VP8_PRED : DC_129_PRED;
+ return mb_y ? VERT_VP8_PRED : (vp7 ? DC_128_PRED : DC_129_PRED);
} else {
return mb_y ? mode : HOR_VP8_PRED;
}
}
static av_always_inline
-int check_intra_pred4x4_mode_emuedge(int mode, int mb_x, int mb_y, int *copy_buf)
+int check_intra_pred4x4_mode_emuedge(int mode, int mb_x, int mb_y,
+ int *copy_buf, int vp7)
{
switch (mode) {
case VERT_PRED:
@@ -1007,7 +1542,7 @@ int check_intra_pred4x4_mode_emuedge(int mode, int mb_x, int mb_y, int *copy_buf
/* fall-through */
case DIAG_DOWN_LEFT_PRED:
case VERT_LEFT_PRED:
- return !mb_y ? DC_127_PRED : mode;
+ return !mb_y ? (vp7 ? DC_128_PRED : DC_127_PRED) : mode;
case HOR_PRED:
if (!mb_y) {
*copy_buf = 1;
@@ -1015,10 +1550,11 @@ int check_intra_pred4x4_mode_emuedge(int mode, int mb_x, int mb_y, int *copy_buf
}
/* fall-through */
case HOR_UP_PRED:
- return !mb_x ? DC_129_PRED : mode;
+ return !mb_x ? (vp7 ? DC_128_PRED : DC_129_PRED) : mode;
case TM_VP8_PRED:
- return check_tm_pred4x4_mode(mode, mb_x, mb_y);
- case DC_PRED: // 4x4 DC doesn't use the same "H.264-style" exceptions as 16x16/8x8 DC
+ return check_tm_pred4x4_mode(mode, mb_x, mb_y, vp7);
+ case DC_PRED: /* 4x4 DC doesn't use the same "H.264-style" exceptions
+ * as 16x16/8x8 DC */
case DIAG_DOWN_RIGHT_PRED:
case VERT_RIGHT_PRED:
case HOR_DOWN_PRED:
@@ -1031,30 +1567,27 @@ int check_intra_pred4x4_mode_emuedge(int mode, int mb_x, int mb_y, int *copy_buf
static av_always_inline
void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
- VP8Macroblock *mb, int mb_x, int mb_y)
+ VP8Macroblock *mb, int mb_x, int mb_y, int is_vp7)
{
- AVCodecContext *avctx = s->avctx;
int x, y, mode, nnz;
uint32_t tr;
- // for the first row, we need to run xchg_mb_border to init the top edge to 127
- // otherwise, skip it if we aren't going to deblock
- if (!(avctx->flags & CODEC_FLAG_EMU_EDGE && !mb_y) && (s->deblock_filter || !mb_y) && td->thread_nr == 0)
- xchg_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2],
+ /* for the first row, we need to run xchg_mb_border to init the top edge
+ * to 127 otherwise, skip it if we aren't going to deblock */
+ if (mb_y && (s->deblock_filter || !mb_y) && td->thread_nr == 0)
+ xchg_mb_border(s->top_border[mb_x + 1], dst[0], dst[1], dst[2],
s->linesize, s->uvlinesize, mb_x, mb_y, s->mb_width,
s->filter.simple, 1);
if (mb->mode < MODE_I4x4) {
- if (avctx->flags & CODEC_FLAG_EMU_EDGE) { // tested
- mode = check_intra_pred8x8_mode_emuedge(mb->mode, mb_x, mb_y);
- } else {
- mode = check_intra_pred8x8_mode(mb->mode, mb_x, mb_y);
- }
+ mode = check_intra_pred8x8_mode_emuedge(mb->mode, mb_x, mb_y, is_vp7);
s->hpc.pred16x16[mode](dst[0], s->linesize);
} else {
uint8_t *ptr = dst[0];
uint8_t *intra4x4 = mb->intra4x4_pred_mode_mb;
- uint8_t tr_top[4] = { 127, 127, 127, 127 };
+ const uint8_t lo = is_vp7 ? 128 : 127;
+ const uint8_t hi = is_vp7 ? 128 : 129;
+ uint8_t tr_top[4] = { lo, lo, lo, lo };
// all blocks on the right edge of the macroblock use bottom edge
// the top macroblock for their topright edge
@@ -1062,10 +1595,9 @@ void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
// if we're on the right edge of the frame, said edge is extended
// from the top macroblock
- if (!(!mb_y && avctx->flags & CODEC_FLAG_EMU_EDGE) &&
- mb_x == s->mb_width-1) {
- tr = tr_right[-1]*0x01010101u;
- tr_right = (uint8_t *)&tr;
+ if (mb_y && mb_x == s->mb_width - 1) {
+ tr = tr_right[-1] * 0x01010101u;
+ tr_right = (uint8_t *) &tr;
}
if (mb->skip)
@@ -1075,78 +1607,74 @@ void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
uint8_t *topright = ptr + 4 - s->linesize;
for (x = 0; x < 4; x++) {
int copy = 0, linesize = s->linesize;
- uint8_t *dst = ptr+4*x;
- DECLARE_ALIGNED(4, uint8_t, copy_dst)[5*8];
+ uint8_t *dst = ptr + 4 * x;
+ DECLARE_ALIGNED(4, uint8_t, copy_dst)[5 * 8];
- if ((y == 0 || x == 3) && mb_y == 0 && avctx->flags & CODEC_FLAG_EMU_EDGE) {
+ if ((y == 0 || x == 3) && mb_y == 0) {
topright = tr_top;
} else if (x == 3)
topright = tr_right;
- if (avctx->flags & CODEC_FLAG_EMU_EDGE) { // mb_x+x or mb_y+y is a hack but works
- mode = check_intra_pred4x4_mode_emuedge(intra4x4[x], mb_x + x, mb_y + y, &copy);
- if (copy) {
- dst = copy_dst + 12;
- linesize = 8;
- if (!(mb_y + y)) {
- copy_dst[3] = 127U;
- AV_WN32A(copy_dst+4, 127U * 0x01010101U);
- } else {
- AV_COPY32(copy_dst+4, ptr+4*x-s->linesize);
- if (!(mb_x + x)) {
- copy_dst[3] = 129U;
- } else {
- copy_dst[3] = ptr[4*x-s->linesize-1];
- }
- }
+ mode = check_intra_pred4x4_mode_emuedge(intra4x4[x], mb_x + x,
+ mb_y + y, &copy, is_vp7);
+ if (copy) {
+ dst = copy_dst + 12;
+ linesize = 8;
+ if (!(mb_y + y)) {
+ copy_dst[3] = lo;
+ AV_WN32A(copy_dst + 4, lo * 0x01010101U);
+ } else {
+ AV_COPY32(copy_dst + 4, ptr + 4 * x - s->linesize);
if (!(mb_x + x)) {
- copy_dst[11] =
- copy_dst[19] =
- copy_dst[27] =
- copy_dst[35] = 129U;
+ copy_dst[3] = hi;
} else {
- copy_dst[11] = ptr[4*x -1];
- copy_dst[19] = ptr[4*x+s->linesize -1];
- copy_dst[27] = ptr[4*x+s->linesize*2-1];
- copy_dst[35] = ptr[4*x+s->linesize*3-1];
+ copy_dst[3] = ptr[4 * x - s->linesize - 1];
}
}
- } else {
- mode = intra4x4[x];
+ if (!(mb_x + x)) {
+ copy_dst[11] =
+ copy_dst[19] =
+ copy_dst[27] =
+ copy_dst[35] = hi;
+ } else {
+ copy_dst[11] = ptr[4 * x - 1];
+ copy_dst[19] = ptr[4 * x + s->linesize - 1];
+ copy_dst[27] = ptr[4 * x + s->linesize * 2 - 1];
+ copy_dst[35] = ptr[4 * x + s->linesize * 3 - 1];
+ }
}
s->hpc.pred4x4[mode](dst, topright, linesize);
if (copy) {
- AV_COPY32(ptr+4*x , copy_dst+12);
- AV_COPY32(ptr+4*x+s->linesize , copy_dst+20);
- AV_COPY32(ptr+4*x+s->linesize*2, copy_dst+28);
- AV_COPY32(ptr+4*x+s->linesize*3, copy_dst+36);
+ AV_COPY32(ptr + 4 * x, copy_dst + 12);
+ AV_COPY32(ptr + 4 * x + s->linesize, copy_dst + 20);
+ AV_COPY32(ptr + 4 * x + s->linesize * 2, copy_dst + 28);
+ AV_COPY32(ptr + 4 * x + s->linesize * 3, copy_dst + 36);
}
nnz = td->non_zero_count_cache[y][x];
if (nnz) {
if (nnz == 1)
- s->vp8dsp.vp8_idct_dc_add(ptr+4*x, td->block[y][x], s->linesize);
+ s->vp8dsp.vp8_idct_dc_add(ptr + 4 * x,
+ td->block[y][x], s->linesize);
else
- s->vp8dsp.vp8_idct_add(ptr+4*x, td->block[y][x], s->linesize);
+ s->vp8dsp.vp8_idct_add(ptr + 4 * x,
+ td->block[y][x], s->linesize);
}
topright += 4;
}
- ptr += 4*s->linesize;
+ ptr += 4 * s->linesize;
intra4x4 += 4;
}
}
- if (avctx->flags & CODEC_FLAG_EMU_EDGE) {
- mode = check_intra_pred8x8_mode_emuedge(mb->chroma_pred_mode, mb_x, mb_y);
- } else {
- mode = check_intra_pred8x8_mode(mb->chroma_pred_mode, mb_x, mb_y);
- }
+ mode = check_intra_pred8x8_mode_emuedge(mb->chroma_pred_mode,
+ mb_x, mb_y, is_vp7);
s->hpc.pred8x8[mode](dst[1], s->uvlinesize);
s->hpc.pred8x8[mode](dst[2], s->uvlinesize);
- if (!(avctx->flags & CODEC_FLAG_EMU_EDGE && !mb_y) && (s->deblock_filter || !mb_y) && td->thread_nr == 0)
- xchg_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2],
+ if (mb_y && (s->deblock_filter || !mb_y) && td->thread_nr == 0)
+ xchg_mb_border(s->top_border[mb_x + 1], dst[0], dst[1], dst[2],
s->linesize, s->uvlinesize, mb_x, mb_y, s->mb_width,
s->filter.simple, 0);
}
@@ -1161,18 +1689,18 @@ static const uint8_t subpel_idx[3][8] = {
/**
* luma MC function
*
- * @param s VP8 decoding context
- * @param dst target buffer for block data at block position
- * @param ref reference picture buffer at origin (0, 0)
- * @param mv motion vector (relative to block position) to get pixel data from
- * @param x_off horizontal position of block from origin (0, 0)
- * @param y_off vertical position of block from origin (0, 0)
- * @param block_w width of block (16, 8 or 4)
- * @param block_h height of block (always same as block_w)
- * @param width width of src/dst plane data
- * @param height height of src/dst plane data
+ * @param s VP8 decoding context
+ * @param dst target buffer for block data at block position
+ * @param ref reference picture buffer at origin (0, 0)
+ * @param mv motion vector (relative to block position) to get pixel data from
+ * @param x_off horizontal position of block from origin (0, 0)
+ * @param y_off vertical position of block from origin (0, 0)
+ * @param block_w width of block (16, 8 or 4)
+ * @param block_h height of block (always same as block_w)
+ * @param width width of src/dst plane data
+ * @param height height of src/dst plane data
* @param linesize size of a single line of plane data, including padding
- * @param mc_func motion compensation function pointers (bilinear or sixtap MC)
+ * @param mc_func motion compensation function pointers (bilinear or sixtap MC)
*/
static av_always_inline
void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
@@ -1185,8 +1713,9 @@ void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
if (AV_RN32A(mv)) {
int src_linesize = linesize;
- int mx = (mv->x << 1)&7, mx_idx = subpel_idx[0][mx];
- int my = (mv->y << 1)&7, my_idx = subpel_idx[0][my];
+
+ int mx = (mv->x << 1) & 7, mx_idx = subpel_idx[0][mx];
+ int my = (mv->y << 1) & 7, my_idx = subpel_idx[0][my];
x_off += mv->x >> 2;
y_off += mv->y >> 2;
@@ -1198,48 +1727,51 @@ void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
src - my_idx * linesize - mx_idx,
- 32, linesize,
+ EDGE_EMU_LINESIZE, linesize,
block_w + subpel_idx[1][mx],
block_h + subpel_idx[1][my],
- x_off - mx_idx, y_off - my_idx, width, height);
- src = td->edge_emu_buffer + mx_idx + 32 * my_idx;
- src_linesize = 32;
+ x_off - mx_idx, y_off - my_idx,
+ width, height);
+ src = td->edge_emu_buffer + mx_idx + EDGE_EMU_LINESIZE * my_idx;
+ src_linesize = EDGE_EMU_LINESIZE;
}
mc_func[my_idx][mx_idx](dst, linesize, src, src_linesize, block_h, mx, my);
} else {
ff_thread_await_progress(ref, (3 + y_off + block_h) >> 4, 0);
- mc_func[0][0](dst, linesize, src + y_off * linesize + x_off, linesize, block_h, 0, 0);
+ mc_func[0][0](dst, linesize, src + y_off * linesize + x_off,
+ linesize, block_h, 0, 0);
}
}
/**
* chroma MC function
*
- * @param s VP8 decoding context
- * @param dst1 target buffer for block data at block position (U plane)
- * @param dst2 target buffer for block data at block position (V plane)
- * @param ref reference picture buffer at origin (0, 0)
- * @param mv motion vector (relative to block position) to get pixel data from
- * @param x_off horizontal position of block from origin (0, 0)
- * @param y_off vertical position of block from origin (0, 0)
- * @param block_w width of block (16, 8 or 4)
- * @param block_h height of block (always same as block_w)
- * @param width width of src/dst plane data
- * @param height height of src/dst plane data
+ * @param s VP8 decoding context
+ * @param dst1 target buffer for block data at block position (U plane)
+ * @param dst2 target buffer for block data at block position (V plane)
+ * @param ref reference picture buffer at origin (0, 0)
+ * @param mv motion vector (relative to block position) to get pixel data from
+ * @param x_off horizontal position of block from origin (0, 0)
+ * @param y_off vertical position of block from origin (0, 0)
+ * @param block_w width of block (16, 8 or 4)
+ * @param block_h height of block (always same as block_w)
+ * @param width width of src/dst plane data
+ * @param height height of src/dst plane data
* @param linesize size of a single line of plane data, including padding
- * @param mc_func motion compensation function pointers (bilinear or sixtap MC)
+ * @param mc_func motion compensation function pointers (bilinear or sixtap MC)
*/
static av_always_inline
-void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1, uint8_t *dst2,
- ThreadFrame *ref, const VP56mv *mv, int x_off, int y_off,
- int block_w, int block_h, int width, int height, ptrdiff_t linesize,
+void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1,
+ uint8_t *dst2, ThreadFrame *ref, const VP56mv *mv,
+ int x_off, int y_off, int block_w, int block_h,
+ int width, int height, ptrdiff_t linesize,
vp8_mc_func mc_func[3][3])
{
uint8_t *src1 = ref->f->data[1], *src2 = ref->f->data[2];
if (AV_RN32A(mv)) {
- int mx = mv->x&7, mx_idx = subpel_idx[0][mx];
- int my = mv->y&7, my_idx = subpel_idx[0][my];
+ int mx = mv->x & 7, mx_idx = subpel_idx[0][mx];
+ int my = mv->y & 7, my_idx = subpel_idx[0][my];
x_off += mv->x >> 3;
y_off += mv->y >> 3;
@@ -1252,21 +1784,21 @@ void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1, uint8_t *dst
y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
src1 - my_idx * linesize - mx_idx,
- 32, linesize,
+ EDGE_EMU_LINESIZE, linesize,
block_w + subpel_idx[1][mx],
block_h + subpel_idx[1][my],
x_off - mx_idx, y_off - my_idx, width, height);
- src1 = td->edge_emu_buffer + mx_idx + 32 * my_idx;
- mc_func[my_idx][mx_idx](dst1, linesize, src1, 32, block_h, mx, my);
+ src1 = td->edge_emu_buffer + mx_idx + EDGE_EMU_LINESIZE * my_idx;
+ mc_func[my_idx][mx_idx](dst1, linesize, src1, EDGE_EMU_LINESIZE, block_h, mx, my);
s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
src2 - my_idx * linesize - mx_idx,
- 32, linesize,
+ EDGE_EMU_LINESIZE, linesize,
block_w + subpel_idx[1][mx],
block_h + subpel_idx[1][my],
x_off - mx_idx, y_off - my_idx, width, height);
- src2 = td->edge_emu_buffer + mx_idx + 32 * my_idx;
- mc_func[my_idx][mx_idx](dst2, linesize, src2, 32, block_h, mx, my);
+ src2 = td->edge_emu_buffer + mx_idx + EDGE_EMU_LINESIZE * my_idx;
+ mc_func[my_idx][mx_idx](dst2, linesize, src2, EDGE_EMU_LINESIZE, block_h, mx, my);
} else {
mc_func[my_idx][mx_idx](dst1, linesize, src1, linesize, block_h, mx, my);
mc_func[my_idx][mx_idx](dst2, linesize, src2, linesize, block_h, mx, my);
@@ -1281,8 +1813,7 @@ void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1, uint8_t *dst
static av_always_inline
void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
ThreadFrame *ref_frame, int x_off, int y_off,
- int bx_off, int by_off,
- int block_w, int block_h,
+ int bx_off, int by_off, int block_w, int block_h,
int width, int height, VP56mv *mv)
{
VP56mv uvmv = *mv;
@@ -1295,13 +1826,19 @@ void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
/* U/V */
if (s->profile == 3) {
+ /* this block only applies VP8; it is safe to check
+ * only the profile, as VP7 profile <= 1 */
uvmv.x &= ~7;
uvmv.y &= ~7;
}
- x_off >>= 1; y_off >>= 1;
- bx_off >>= 1; by_off >>= 1;
- width >>= 1; height >>= 1;
- block_w >>= 1; block_h >>= 1;
+ x_off >>= 1;
+ y_off >>= 1;
+ bx_off >>= 1;
+ by_off >>= 1;
+ width >>= 1;
+ height >>= 1;
+ block_w >>= 1;
+ block_h >>= 1;
vp8_mc_chroma(s, td, dst[1] + by_off * s->uvlinesize + bx_off,
dst[2] + by_off * s->uvlinesize + bx_off, ref_frame,
&uvmv, x_off + bx_off, y_off + by_off,
@@ -1310,22 +1847,24 @@ void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
}
/* Fetch pixels for estimated mv 4 macroblocks ahead.
- * Optimized for 64-byte cache lines. Inspired by ffh264 prefetch_motion. */
-static av_always_inline void prefetch_motion(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int mb_xy, int ref)
+ * Optimized for 64-byte cache lines. Inspired by ffh264 prefetch_motion. */
+static av_always_inline
+void prefetch_motion(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
+ int mb_xy, int ref)
{
/* Don't prefetch refs that haven't been used very often this frame. */
- if (s->ref_count[ref-1] > (mb_xy >> 5)) {
+ if (s->ref_count[ref - 1] > (mb_xy >> 5)) {
int x_off = mb_x << 4, y_off = mb_y << 4;
- int mx = (mb->mv.x>>2) + x_off + 8;
- int my = (mb->mv.y>>2) + y_off;
- uint8_t **src= s->framep[ref]->tf.f->data;
- int off= mx + (my + (mb_x&3)*4)*s->linesize + 64;
+ int mx = (mb->mv.x >> 2) + x_off + 8;
+ int my = (mb->mv.y >> 2) + y_off;
+ uint8_t **src = s->framep[ref]->tf.f->data;
+ int off = mx + (my + (mb_x & 3) * 4) * s->linesize + 64;
/* For threading, a ff_thread_await_progress here might be useful, but
* it actually slows down the decoder. Since a bad prefetch doesn't
* generate bad decoder output, we don't run it here. */
- s->vdsp.prefetch(src[0]+off, s->linesize, 4);
- off= (mx>>1) + ((my>>1) + (mb_x&7))*s->uvlinesize + 64;
- s->vdsp.prefetch(src[1]+off, src[2]-src[1], 2);
+ s->vdsp.prefetch(src[0] + off, s->linesize, 4);
+ off = (mx >> 1) + ((my >> 1) + (mb_x & 7)) * s->uvlinesize + 64;
+ s->vdsp.prefetch(src[1] + off, src[2] - src[1], 2);
}
}
@@ -1337,7 +1876,7 @@ void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
VP8Macroblock *mb, int mb_x, int mb_y)
{
int x_off = mb_x << 4, y_off = mb_y << 4;
- int width = 16*s->mb_width, height = 16*s->mb_height;
+ int width = 16 * s->mb_width, height = 16 * s->mb_height;
ThreadFrame *ref = &s->framep[mb->ref_frame]->tf;
VP56mv *bmv = mb->bmv;
@@ -1353,35 +1892,38 @@ void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
/* Y */
for (y = 0; y < 4; y++) {
for (x = 0; x < 4; x++) {
- vp8_mc_luma(s, td, dst[0] + 4*y*s->linesize + x*4,
- ref, &bmv[4*y + x],
- 4*x + x_off, 4*y + y_off, 4, 4,
+ vp8_mc_luma(s, td, dst[0] + 4 * y * s->linesize + x * 4,
+ ref, &bmv[4 * y + x],
+ 4 * x + x_off, 4 * y + y_off, 4, 4,
width, height, s->linesize,
s->put_pixels_tab[2]);
}
}
/* U/V */
- x_off >>= 1; y_off >>= 1; width >>= 1; height >>= 1;
+ x_off >>= 1;
+ y_off >>= 1;
+ width >>= 1;
+ height >>= 1;
for (y = 0; y < 2; y++) {
for (x = 0; x < 2; x++) {
- uvmv.x = mb->bmv[ 2*y * 4 + 2*x ].x +
- mb->bmv[ 2*y * 4 + 2*x+1].x +
- mb->bmv[(2*y+1) * 4 + 2*x ].x +
- mb->bmv[(2*y+1) * 4 + 2*x+1].x;
- uvmv.y = mb->bmv[ 2*y * 4 + 2*x ].y +
- mb->bmv[ 2*y * 4 + 2*x+1].y +
- mb->bmv[(2*y+1) * 4 + 2*x ].y +
- mb->bmv[(2*y+1) * 4 + 2*x+1].y;
- uvmv.x = (uvmv.x + 2 + (uvmv.x >> (INT_BIT-1))) >> 2;
- uvmv.y = (uvmv.y + 2 + (uvmv.y >> (INT_BIT-1))) >> 2;
+ uvmv.x = mb->bmv[2 * y * 4 + 2 * x ].x +
+ mb->bmv[2 * y * 4 + 2 * x + 1].x +
+ mb->bmv[(2 * y + 1) * 4 + 2 * x ].x +
+ mb->bmv[(2 * y + 1) * 4 + 2 * x + 1].x;
+ uvmv.y = mb->bmv[2 * y * 4 + 2 * x ].y +
+ mb->bmv[2 * y * 4 + 2 * x + 1].y +
+ mb->bmv[(2 * y + 1) * 4 + 2 * x ].y +
+ mb->bmv[(2 * y + 1) * 4 + 2 * x + 1].y;
+ uvmv.x = (uvmv.x + 2 + (uvmv.x >> (INT_BIT - 1))) >> 2;
+ uvmv.y = (uvmv.y + 2 + (uvmv.y >> (INT_BIT - 1))) >> 2;
if (s->profile == 3) {
uvmv.x &= ~7;
uvmv.y &= ~7;
}
- vp8_mc_chroma(s, td, dst[1] + 4*y*s->uvlinesize + x*4,
- dst[2] + 4*y*s->uvlinesize + x*4, ref, &uvmv,
- 4*x + x_off, 4*y + y_off, 4, 4,
+ vp8_mc_chroma(s, td, dst[1] + 4 * y * s->uvlinesize + x * 4,
+ dst[2] + 4 * y * s->uvlinesize + x * 4, ref,
+ &uvmv, 4 * x + x_off, 4 * y + y_off, 4, 4,
width, height, s->uvlinesize,
s->put_pixels_tab[2]);
}
@@ -1413,8 +1955,8 @@ void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
}
}
-static av_always_inline void idct_mb(VP8Context *s, VP8ThreadData *td,
- uint8_t *dst[3], VP8Macroblock *mb)
+static av_always_inline
+void idct_mb(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3], VP8Macroblock *mb)
{
int x, y, ch;
@@ -1423,12 +1965,16 @@ static av_always_inline void idct_mb(VP8Context *s, VP8ThreadData *td,
for (y = 0; y < 4; y++) {
uint32_t nnz4 = AV_RL32(td->non_zero_count_cache[y]);
if (nnz4) {
- if (nnz4&~0x01010101) {
+ if (nnz4 & ~0x01010101) {
for (x = 0; x < 4; x++) {
- if ((uint8_t)nnz4 == 1)
- s->vp8dsp.vp8_idct_dc_add(y_dst+4*x, td->block[y][x], s->linesize);
- else if((uint8_t)nnz4 > 1)
- s->vp8dsp.vp8_idct_add(y_dst+4*x, td->block[y][x], s->linesize);
+ if ((uint8_t) nnz4 == 1)
+ s->vp8dsp.vp8_idct_dc_add(y_dst + 4 * x,
+ td->block[y][x],
+ s->linesize);
+ else if ((uint8_t) nnz4 > 1)
+ s->vp8dsp.vp8_idct_add(y_dst + 4 * x,
+ td->block[y][x],
+ s->linesize);
nnz4 >>= 8;
if (!nnz4)
break;
@@ -1437,36 +1983,43 @@ static av_always_inline void idct_mb(VP8Context *s, VP8ThreadData *td,
s->vp8dsp.vp8_idct_dc_add4y(y_dst, td->block[y], s->linesize);
}
}
- y_dst += 4*s->linesize;
+ y_dst += 4 * s->linesize;
}
}
for (ch = 0; ch < 2; ch++) {
- uint32_t nnz4 = AV_RL32(td->non_zero_count_cache[4+ch]);
+ uint32_t nnz4 = AV_RL32(td->non_zero_count_cache[4 + ch]);
if (nnz4) {
- uint8_t *ch_dst = dst[1+ch];
- if (nnz4&~0x01010101) {
+ uint8_t *ch_dst = dst[1 + ch];
+ if (nnz4 & ~0x01010101) {
for (y = 0; y < 2; y++) {
for (x = 0; x < 2; x++) {
- if ((uint8_t)nnz4 == 1)
- s->vp8dsp.vp8_idct_dc_add(ch_dst+4*x, td->block[4+ch][(y<<1)+x], s->uvlinesize);
- else if((uint8_t)nnz4 > 1)
- s->vp8dsp.vp8_idct_add(ch_dst+4*x, td->block[4+ch][(y<<1)+x], s->uvlinesize);
+ if ((uint8_t) nnz4 == 1)
+ s->vp8dsp.vp8_idct_dc_add(ch_dst + 4 * x,
+ td->block[4 + ch][(y << 1) + x],
+ s->uvlinesize);
+ else if ((uint8_t) nnz4 > 1)
+ s->vp8dsp.vp8_idct_add(ch_dst + 4 * x,
+ td->block[4 + ch][(y << 1) + x],
+ s->uvlinesize);
nnz4 >>= 8;
if (!nnz4)
goto chroma_idct_end;
}
- ch_dst += 4*s->uvlinesize;
+ ch_dst += 4 * s->uvlinesize;
}
} else {
- s->vp8dsp.vp8_idct_dc_add4uv(ch_dst, td->block[4+ch], s->uvlinesize);
+ s->vp8dsp.vp8_idct_dc_add4uv(ch_dst, td->block[4 + ch], s->uvlinesize);
}
}
-chroma_idct_end: ;
+chroma_idct_end:
+ ;
}
}
-static av_always_inline void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb, VP8FilterStrength *f )
+static av_always_inline
+void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb,
+ VP8FilterStrength *f, int is_vp7)
{
int interior_limit, filter_level;
@@ -1493,12 +2046,15 @@ static av_always_inline void filter_level_for_mb(VP8Context *s, VP8Macroblock *m
f->filter_level = filter_level;
f->inner_limit = interior_limit;
- f->inner_filter = !mb->skip || mb->mode == MODE_I4x4 || mb->mode == VP8_MVMODE_SPLIT;
+ f->inner_filter = is_vp7 || !mb->skip || mb->mode == MODE_I4x4 ||
+ mb->mode == VP8_MVMODE_SPLIT;
}
-static av_always_inline void filter_mb(VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f, int mb_x, int mb_y)
+static av_always_inline
+void filter_mb(VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f,
+ int mb_x, int mb_y, int is_vp7)
{
- int mbedge_lim, bedge_lim, hev_thresh;
+ int mbedge_lim, bedge_lim_y, bedge_lim_uv, hev_thresh;
int filter_level = f->filter_level;
int inner_limit = f->inner_limit;
int inner_filter = f->inner_filter;
@@ -1518,88 +2074,106 @@ static av_always_inline void filter_mb(VP8Context *s, uint8_t *dst[3], VP8Filter
if (!filter_level)
return;
- bedge_lim = 2*filter_level + inner_limit;
- mbedge_lim = bedge_lim + 4;
+ if (is_vp7) {
+ bedge_lim_y = filter_level;
+ bedge_lim_uv = filter_level * 2;
+ mbedge_lim = filter_level + 2;
+ } else {
+ bedge_lim_y =
+ bedge_lim_uv = filter_level * 2 + inner_limit;
+ mbedge_lim = bedge_lim_y + 4;
+ }
hev_thresh = hev_thresh_lut[s->keyframe][filter_level];
if (mb_x) {
- s->vp8dsp.vp8_h_loop_filter16y(dst[0], linesize,
+ s->vp8dsp.vp8_h_loop_filter16y(dst[0], linesize,
mbedge_lim, inner_limit, hev_thresh);
- s->vp8dsp.vp8_h_loop_filter8uv(dst[1], dst[2], uvlinesize,
+ s->vp8dsp.vp8_h_loop_filter8uv(dst[1], dst[2], uvlinesize,
mbedge_lim, inner_limit, hev_thresh);
}
- if (inner_filter) {
- s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0]+ 4, linesize, bedge_lim,
- inner_limit, hev_thresh);
- s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0]+ 8, linesize, bedge_lim,
- inner_limit, hev_thresh);
- s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0]+12, linesize, bedge_lim,
- inner_limit, hev_thresh);
- s->vp8dsp.vp8_h_loop_filter8uv_inner(dst[1] + 4, dst[2] + 4,
- uvlinesize, bedge_lim,
- inner_limit, hev_thresh);
+#define H_LOOP_FILTER_16Y_INNER(cond) \
+ if (cond && inner_filter) { \
+ s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 4, linesize, \
+ bedge_lim_y, inner_limit, \
+ hev_thresh); \
+ s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 8, linesize, \
+ bedge_lim_y, inner_limit, \
+ hev_thresh); \
+ s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 12, linesize, \
+ bedge_lim_y, inner_limit, \
+ hev_thresh); \
+ s->vp8dsp.vp8_h_loop_filter8uv_inner(dst[1] + 4, dst[2] + 4, \
+ uvlinesize, bedge_lim_uv, \
+ inner_limit, hev_thresh); \
}
+ H_LOOP_FILTER_16Y_INNER(!is_vp7)
+
if (mb_y) {
- s->vp8dsp.vp8_v_loop_filter16y(dst[0], linesize,
+ s->vp8dsp.vp8_v_loop_filter16y(dst[0], linesize,
mbedge_lim, inner_limit, hev_thresh);
- s->vp8dsp.vp8_v_loop_filter8uv(dst[1], dst[2], uvlinesize,
+ s->vp8dsp.vp8_v_loop_filter8uv(dst[1], dst[2], uvlinesize,
mbedge_lim, inner_limit, hev_thresh);
}
if (inner_filter) {
- s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0]+ 4*linesize,
- linesize, bedge_lim,
+ s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0] + 4 * linesize,
+ linesize, bedge_lim_y,
inner_limit, hev_thresh);
- s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0]+ 8*linesize,
- linesize, bedge_lim,
+ s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0] + 8 * linesize,
+ linesize, bedge_lim_y,
inner_limit, hev_thresh);
- s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0]+12*linesize,
- linesize, bedge_lim,
+ s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0] + 12 * linesize,
+ linesize, bedge_lim_y,
inner_limit, hev_thresh);
- s->vp8dsp.vp8_v_loop_filter8uv_inner(dst[1] + 4 * uvlinesize,
- dst[2] + 4 * uvlinesize,
- uvlinesize, bedge_lim,
+ s->vp8dsp.vp8_v_loop_filter8uv_inner(dst[1] + 4 * uvlinesize,
+ dst[2] + 4 * uvlinesize,
+ uvlinesize, bedge_lim_uv,
inner_limit, hev_thresh);
}
+
+ H_LOOP_FILTER_16Y_INNER(is_vp7)
}
-static av_always_inline void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f, int mb_x, int mb_y)
+static av_always_inline
+void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f,
+ int mb_x, int mb_y)
{
int mbedge_lim, bedge_lim;
int filter_level = f->filter_level;
- int inner_limit = f->inner_limit;
+ int inner_limit = f->inner_limit;
int inner_filter = f->inner_filter;
- int linesize = s->linesize;
+ int linesize = s->linesize;
if (!filter_level)
return;
- bedge_lim = 2*filter_level + inner_limit;
+ bedge_lim = 2 * filter_level + inner_limit;
mbedge_lim = bedge_lim + 4;
if (mb_x)
s->vp8dsp.vp8_h_loop_filter_simple(dst, linesize, mbedge_lim);
if (inner_filter) {
- s->vp8dsp.vp8_h_loop_filter_simple(dst+ 4, linesize, bedge_lim);
- s->vp8dsp.vp8_h_loop_filter_simple(dst+ 8, linesize, bedge_lim);
- s->vp8dsp.vp8_h_loop_filter_simple(dst+12, linesize, bedge_lim);
+ s->vp8dsp.vp8_h_loop_filter_simple(dst + 4, linesize, bedge_lim);
+ s->vp8dsp.vp8_h_loop_filter_simple(dst + 8, linesize, bedge_lim);
+ s->vp8dsp.vp8_h_loop_filter_simple(dst + 12, linesize, bedge_lim);
}
if (mb_y)
s->vp8dsp.vp8_v_loop_filter_simple(dst, linesize, mbedge_lim);
if (inner_filter) {
- s->vp8dsp.vp8_v_loop_filter_simple(dst+ 4*linesize, linesize, bedge_lim);
- s->vp8dsp.vp8_v_loop_filter_simple(dst+ 8*linesize, linesize, bedge_lim);
- s->vp8dsp.vp8_v_loop_filter_simple(dst+12*linesize, linesize, bedge_lim);
+ s->vp8dsp.vp8_v_loop_filter_simple(dst + 4 * linesize, linesize, bedge_lim);
+ s->vp8dsp.vp8_v_loop_filter_simple(dst + 8 * linesize, linesize, bedge_lim);
+ s->vp8dsp.vp8_v_loop_filter_simple(dst + 12 * linesize, linesize, bedge_lim);
}
}
#define MARGIN (16 << 2)
-static void vp8_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe,
- VP8Frame *prev_frame)
+static av_always_inline
+void vp78_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe,
+ VP8Frame *prev_frame, int is_vp7)
{
VP8Context *s = avctx->priv_data;
int mb_x, mb_y;
@@ -1607,19 +2181,21 @@ static void vp8_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe,
s->mv_min.y = -MARGIN;
s->mv_max.y = ((s->mb_height - 1) << 6) + MARGIN;
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
- VP8Macroblock *mb = s->macroblocks_base + ((s->mb_width+1)*(mb_y + 1) + 1);
- int mb_xy = mb_y*s->mb_width;
+ VP8Macroblock *mb = s->macroblocks_base +
+ ((s->mb_width + 1) * (mb_y + 1) + 1);
+ int mb_xy = mb_y * s->mb_width;
- AV_WN32A(s->intra4x4_pred_mode_left, DC_PRED*0x01010101);
+ AV_WN32A(s->intra4x4_pred_mode_left, DC_PRED * 0x01010101);
s->mv_min.x = -MARGIN;
s->mv_max.x = ((s->mb_width - 1) << 6) + MARGIN;
for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) {
if (mb_y == 0)
- AV_WN32A((mb-s->mb_width-1)->intra4x4_pred_mode_top, DC_PRED*0x01010101);
+ AV_WN32A((mb - s->mb_width - 1)->intra4x4_pred_mode_top,
+ DC_PRED * 0x01010101);
decode_mb_mode(s, mb, mb_x, mb_y, curframe->seg_map->data + mb_xy,
prev_frame && prev_frame->seg_map ?
- prev_frame->seg_map->data + mb_xy : NULL, 1);
+ prev_frame->seg_map->data + mb_xy : NULL, 1, is_vp7);
s->mv_min.x -= 64;
s->mv_max.x -= 64;
}
@@ -1628,115 +2204,132 @@ static void vp8_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe,
}
}
+static void vp7_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *cur_frame,
+ VP8Frame *prev_frame)
+{
+ vp78_decode_mv_mb_modes(avctx, cur_frame, prev_frame, IS_VP7);
+}
+
+static void vp8_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *cur_frame,
+ VP8Frame *prev_frame)
+{
+ vp78_decode_mv_mb_modes(avctx, cur_frame, prev_frame, IS_VP8);
+}
+
#if HAVE_THREADS
-#define check_thread_pos(td, otd, mb_x_check, mb_y_check)\
- do {\
- int tmp = (mb_y_check << 16) | (mb_x_check & 0xFFFF);\
- if (otd->thread_mb_pos < tmp) {\
- pthread_mutex_lock(&otd->lock);\
- td->wait_mb_pos = tmp;\
- do {\
- if (otd->thread_mb_pos >= tmp)\
- break;\
- pthread_cond_wait(&otd->cond, &otd->lock);\
- } while (1);\
- td->wait_mb_pos = INT_MAX;\
- pthread_mutex_unlock(&otd->lock);\
- }\
- } while(0);
-
-#define update_pos(td, mb_y, mb_x)\
- do {\
- int pos = (mb_y << 16) | (mb_x & 0xFFFF);\
- int sliced_threading = (avctx->active_thread_type == FF_THREAD_SLICE) && (num_jobs > 1);\
- int is_null = (next_td == NULL) || (prev_td == NULL);\
- int pos_check = (is_null) ? 1 :\
- (next_td != td && pos >= next_td->wait_mb_pos) ||\
- (prev_td != td && pos >= prev_td->wait_mb_pos);\
- td->thread_mb_pos = pos;\
- if (sliced_threading && pos_check) {\
- pthread_mutex_lock(&td->lock);\
- pthread_cond_broadcast(&td->cond);\
- pthread_mutex_unlock(&td->lock);\
- }\
- } while(0);
+#define check_thread_pos(td, otd, mb_x_check, mb_y_check) \
+ do { \
+ int tmp = (mb_y_check << 16) | (mb_x_check & 0xFFFF); \
+ if (otd->thread_mb_pos < tmp) { \
+ pthread_mutex_lock(&otd->lock); \
+ td->wait_mb_pos = tmp; \
+ do { \
+ if (otd->thread_mb_pos >= tmp) \
+ break; \
+ pthread_cond_wait(&otd->cond, &otd->lock); \
+ } while (1); \
+ td->wait_mb_pos = INT_MAX; \
+ pthread_mutex_unlock(&otd->lock); \
+ } \
+ } while (0);
+
+#define update_pos(td, mb_y, mb_x) \
+ do { \
+ int pos = (mb_y << 16) | (mb_x & 0xFFFF); \
+ int sliced_threading = (avctx->active_thread_type == FF_THREAD_SLICE) && \
+ (num_jobs > 1); \
+ int is_null = (next_td == NULL) || (prev_td == NULL); \
+ int pos_check = (is_null) ? 1 \
+ : (next_td != td && \
+ pos >= next_td->wait_mb_pos) || \
+ (prev_td != td && \
+ pos >= prev_td->wait_mb_pos); \
+ td->thread_mb_pos = pos; \
+ if (sliced_threading && pos_check) { \
+ pthread_mutex_lock(&td->lock); \
+ pthread_cond_broadcast(&td->cond); \
+ pthread_mutex_unlock(&td->lock); \
+ } \
+ } while (0);
#else
#define check_thread_pos(td, otd, mb_x_check, mb_y_check)
#define update_pos(td, mb_y, mb_x)
#endif
-static void vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
- int jobnr, int threadnr)
+static av_always_inline void decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
+ int jobnr, int threadnr, int is_vp7)
{
VP8Context *s = avctx->priv_data;
VP8ThreadData *prev_td, *next_td, *td = &s->thread_data[threadnr];
- int mb_y = td->thread_mb_pos>>16;
- int i, y, mb_x, mb_xy = mb_y*s->mb_width;
+ int mb_y = td->thread_mb_pos >> 16;
+ int mb_x, mb_xy = mb_y * s->mb_width;
int num_jobs = s->num_jobs;
VP8Frame *curframe = s->curframe, *prev_frame = s->prev_frame;
- VP56RangeCoder *c = &s->coeff_partition[mb_y & (s->num_coeff_partitions-1)];
+ VP56RangeCoder *c = &s->coeff_partition[mb_y & (s->num_coeff_partitions - 1)];
VP8Macroblock *mb;
uint8_t *dst[3] = {
- curframe->tf.f->data[0] + 16*mb_y*s->linesize,
- curframe->tf.f->data[1] + 8*mb_y*s->uvlinesize,
- curframe->tf.f->data[2] + 8*mb_y*s->uvlinesize
+ curframe->tf.f->data[0] + 16 * mb_y * s->linesize,
+ curframe->tf.f->data[1] + 8 * mb_y * s->uvlinesize,
+ curframe->tf.f->data[2] + 8 * mb_y * s->uvlinesize
};
- if (mb_y == 0) prev_td = td;
- else prev_td = &s->thread_data[(jobnr + num_jobs - 1)%num_jobs];
- if (mb_y == s->mb_height-1) next_td = td;
- else next_td = &s->thread_data[(jobnr + 1)%num_jobs];
+ if (mb_y == 0)
+ prev_td = td;
+ else
+ prev_td = &s->thread_data[(jobnr + num_jobs - 1) % num_jobs];
+ if (mb_y == s->mb_height - 1)
+ next_td = td;
+ else
+ next_td = &s->thread_data[(jobnr + 1) % num_jobs];
if (s->mb_layout == 1)
- mb = s->macroblocks_base + ((s->mb_width+1)*(mb_y + 1) + 1);
+ mb = s->macroblocks_base + ((s->mb_width + 1) * (mb_y + 1) + 1);
else {
// Make sure the previous frame has read its segmentation map,
// if we re-use the same map.
if (prev_frame && s->segmentation.enabled &&
!s->segmentation.update_map)
ff_thread_await_progress(&prev_frame->tf, mb_y, 0);
- mb = s->macroblocks + (s->mb_height - mb_y - 1)*2;
+ mb = s->macroblocks + (s->mb_height - mb_y - 1) * 2;
memset(mb - 1, 0, sizeof(*mb)); // zero left macroblock
- AV_WN32A(s->intra4x4_pred_mode_left, DC_PRED*0x01010101);
+ AV_WN32A(s->intra4x4_pred_mode_left, DC_PRED * 0x01010101);
}
- memset(td->left_nnz, 0, sizeof(td->left_nnz));
- // left edge of 129 for intra prediction
- if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) {
- for (i = 0; i < 3; i++)
- for (y = 0; y < 16>>!!i; y++)
- dst[i][y*curframe->tf.f->linesize[i]-1] = 129;
- if (mb_y == 1) {
- s->top_border[0][15] = s->top_border[0][23] = s->top_border[0][31] = 129;
- }
- }
+ if (!is_vp7 || mb_y == 0)
+ memset(td->left_nnz, 0, sizeof(td->left_nnz));
s->mv_min.x = -MARGIN;
- s->mv_max.x = ((s->mb_width - 1) << 6) + MARGIN;
+ s->mv_max.x = ((s->mb_width - 1) << 6) + MARGIN;
for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) {
// Wait for previous thread to read mb_x+2, and reach mb_y-1.
if (prev_td != td) {
if (threadnr != 0) {
- check_thread_pos(td, prev_td, mb_x+1, mb_y-1);
+ check_thread_pos(td, prev_td,
+ mb_x + (is_vp7 ? 2 : 1),
+ mb_y - (is_vp7 ? 2 : 1));
} else {
- check_thread_pos(td, prev_td, (s->mb_width+3) + (mb_x+1), mb_y-1);
+ check_thread_pos(td, prev_td,
+ mb_x + (is_vp7 ? 2 : 1) + s->mb_width + 3,
+ mb_y - (is_vp7 ? 2 : 1));
}
}
- s->vdsp.prefetch(dst[0] + (mb_x&3)*4*s->linesize + 64, s->linesize, 4);
- s->vdsp.prefetch(dst[1] + (mb_x&7)*s->uvlinesize + 64, dst[2] - dst[1], 2);
+ s->vdsp.prefetch(dst[0] + (mb_x & 3) * 4 * s->linesize + 64,
+ s->linesize, 4);
+ s->vdsp.prefetch(dst[1] + (mb_x & 7) * s->uvlinesize + 64,
+ dst[2] - dst[1], 2);
if (!s->mb_layout)
decode_mb_mode(s, mb, mb_x, mb_y, curframe->seg_map->data + mb_xy,
prev_frame && prev_frame->seg_map ?
- prev_frame->seg_map->data + mb_xy : NULL, 0);
+ prev_frame->seg_map->data + mb_xy : NULL, 0, is_vp7);
prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_PREVIOUS);
if (!mb->skip)
- decode_mb_coeffs(s, td, c, mb, s->top_nnz[mb_x], td->left_nnz);
+ decode_mb_coeffs(s, td, c, mb, s->top_nnz[mb_x], td->left_nnz, is_vp7);
if (mb->mode <= MODE_I4x4)
- intra_predict(s, td, dst, mb, mb_x, mb_y);
+ intra_predict(s, td, dst, mb, mb_x, mb_y, is_vp7);
else
inter_predict(s, td, dst, mb, mb_x, mb_y);
@@ -1748,7 +2341,8 @@ static void vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
AV_ZERO64(td->left_nnz);
AV_WN64(s->top_nnz[mb_x], 0); // array of 9, so unaligned
- // Reset DC block predictors if they would exist if the mb had coefficients
+ /* Reset DC block predictors if they would exist
+ * if the mb had coefficients */
if (mb->mode != MODE_I4x4 && mb->mode != VP8_MVMODE_SPLIT) {
td->left_nnz[8] = 0;
s->top_nnz[mb_x][8] = 0;
@@ -1756,100 +2350,134 @@ static void vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
}
if (s->deblock_filter)
- filter_level_for_mb(s, mb, &td->filter_strength[mb_x]);
+ filter_level_for_mb(s, mb, &td->filter_strength[mb_x], is_vp7);
- if (s->deblock_filter && num_jobs != 1 && threadnr == num_jobs-1) {
+ if (s->deblock_filter && num_jobs != 1 && threadnr == num_jobs - 1) {
if (s->filter.simple)
- backup_mb_border(s->top_border[mb_x+1], dst[0], NULL, NULL, s->linesize, 0, 1);
+ backup_mb_border(s->top_border[mb_x + 1], dst[0],
+ NULL, NULL, s->linesize, 0, 1);
else
- backup_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2], s->linesize, s->uvlinesize, 0);
+ backup_mb_border(s->top_border[mb_x + 1], dst[0],
+ dst[1], dst[2], s->linesize, s->uvlinesize, 0);
}
prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_GOLDEN2);
- dst[0] += 16;
- dst[1] += 8;
- dst[2] += 8;
+ dst[0] += 16;
+ dst[1] += 8;
+ dst[2] += 8;
s->mv_min.x -= 64;
s->mv_max.x -= 64;
- if (mb_x == s->mb_width+1) {
- update_pos(td, mb_y, s->mb_width+3);
+ if (mb_x == s->mb_width + 1) {
+ update_pos(td, mb_y, s->mb_width + 3);
} else {
update_pos(td, mb_y, mb_x);
}
}
}
-static void vp8_filter_mb_row(AVCodecContext *avctx, void *tdata,
- int jobnr, int threadnr)
+static void vp7_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
+ int jobnr, int threadnr)
+{
+ decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 1);
+}
+
+static void vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
+ int jobnr, int threadnr)
+{
+ decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 0);
+}
+
+static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
+ int jobnr, int threadnr, int is_vp7)
{
VP8Context *s = avctx->priv_data;
VP8ThreadData *td = &s->thread_data[threadnr];
- int mb_x, mb_y = td->thread_mb_pos>>16, num_jobs = s->num_jobs;
+ int mb_x, mb_y = td->thread_mb_pos >> 16, num_jobs = s->num_jobs;
AVFrame *curframe = s->curframe->tf.f;
VP8Macroblock *mb;
VP8ThreadData *prev_td, *next_td;
uint8_t *dst[3] = {
- curframe->data[0] + 16*mb_y*s->linesize,
- curframe->data[1] + 8*mb_y*s->uvlinesize,
- curframe->data[2] + 8*mb_y*s->uvlinesize
+ curframe->data[0] + 16 * mb_y * s->linesize,
+ curframe->data[1] + 8 * mb_y * s->uvlinesize,
+ curframe->data[2] + 8 * mb_y * s->uvlinesize
};
if (s->mb_layout == 1)
- mb = s->macroblocks_base + ((s->mb_width+1)*(mb_y + 1) + 1);
+ mb = s->macroblocks_base + ((s->mb_width + 1) * (mb_y + 1) + 1);
else
- mb = s->macroblocks + (s->mb_height - mb_y - 1)*2;
+ mb = s->macroblocks + (s->mb_height - mb_y - 1) * 2;
- if (mb_y == 0) prev_td = td;
- else prev_td = &s->thread_data[(jobnr + num_jobs - 1)%num_jobs];
- if (mb_y == s->mb_height-1) next_td = td;
- else next_td = &s->thread_data[(jobnr + 1)%num_jobs];
+ if (mb_y == 0)
+ prev_td = td;
+ else
+ prev_td = &s->thread_data[(jobnr + num_jobs - 1) % num_jobs];
+ if (mb_y == s->mb_height - 1)
+ next_td = td;
+ else
+ next_td = &s->thread_data[(jobnr + 1) % num_jobs];
for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb++) {
VP8FilterStrength *f = &td->filter_strength[mb_x];
- if (prev_td != td) {
- check_thread_pos(td, prev_td, (mb_x+1) + (s->mb_width+3), mb_y-1);
- }
+ if (prev_td != td)
+ check_thread_pos(td, prev_td,
+ (mb_x + 1) + (s->mb_width + 3), mb_y - 1);
if (next_td != td)
- if (next_td != &s->thread_data[0]) {
- check_thread_pos(td, next_td, mb_x+1, mb_y+1);
- }
+ if (next_td != &s->thread_data[0])
+ check_thread_pos(td, next_td, mb_x + 1, mb_y + 1);
if (num_jobs == 1) {
if (s->filter.simple)
- backup_mb_border(s->top_border[mb_x+1], dst[0], NULL, NULL, s->linesize, 0, 1);
+ backup_mb_border(s->top_border[mb_x + 1], dst[0],
+ NULL, NULL, s->linesize, 0, 1);
else
- backup_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2], s->linesize, s->uvlinesize, 0);
+ backup_mb_border(s->top_border[mb_x + 1], dst[0],
+ dst[1], dst[2], s->linesize, s->uvlinesize, 0);
}
if (s->filter.simple)
filter_mb_simple(s, dst[0], f, mb_x, mb_y);
else
- filter_mb(s, dst, f, mb_x, mb_y);
+ filter_mb(s, dst, f, mb_x, mb_y, is_vp7);
dst[0] += 16;
dst[1] += 8;
dst[2] += 8;
- update_pos(td, mb_y, (s->mb_width+3) + mb_x);
+ update_pos(td, mb_y, (s->mb_width + 3) + mb_x);
}
}
-static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
- int jobnr, int threadnr)
+static void vp7_filter_mb_row(AVCodecContext *avctx, void *tdata,
+ int jobnr, int threadnr)
+{
+ filter_mb_row(avctx, tdata, jobnr, threadnr, 1);
+}
+
+static void vp8_filter_mb_row(AVCodecContext *avctx, void *tdata,
+ int jobnr, int threadnr)
+{
+ filter_mb_row(avctx, tdata, jobnr, threadnr, 0);
+}
+
+static av_always_inline
+int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr,
+ int threadnr, int is_vp7)
{
VP8Context *s = avctx->priv_data;
VP8ThreadData *td = &s->thread_data[jobnr];
VP8ThreadData *next_td = NULL, *prev_td = NULL;
VP8Frame *curframe = s->curframe;
int mb_y, num_jobs = s->num_jobs;
+
td->thread_nr = threadnr;
for (mb_y = jobnr; mb_y < s->mb_height; mb_y += num_jobs) {
- if (mb_y >= s->mb_height) break;
- td->thread_mb_pos = mb_y<<16;
- vp8_decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr);
+ if (mb_y >= s->mb_height)
+ break;
+ td->thread_mb_pos = mb_y << 16;
+ s->decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr);
if (s->deblock_filter)
- vp8_filter_mb_row(avctx, tdata, jobnr, threadnr);
+ s->filter_mb_row(avctx, tdata, jobnr, threadnr);
update_pos(td, mb_y, INT_MAX & 0xFFFF);
s->mv_min.y -= 64;
@@ -1862,24 +2490,44 @@ static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
return 0;
}
-int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
- AVPacket *avpkt)
+static int vp7_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
+ int jobnr, int threadnr)
+{
+ return vp78_decode_mb_row_sliced(avctx, tdata, jobnr, threadnr, IS_VP7);
+}
+
+static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
+ int jobnr, int threadnr)
+{
+ return vp78_decode_mb_row_sliced(avctx, tdata, jobnr, threadnr, IS_VP8);
+}
+
+
+static av_always_inline
+int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
+ AVPacket *avpkt, int is_vp7)
{
VP8Context *s = avctx->priv_data;
int ret, i, referenced, num_jobs;
enum AVDiscard skip_thresh;
VP8Frame *av_uninit(curframe), *prev_frame;
- if ((ret = decode_frame_header(s, avpkt->data, avpkt->size)) < 0)
+ if (is_vp7)
+ ret = vp7_decode_frame_header(s, avpkt->data, avpkt->size);
+ else
+ ret = vp8_decode_frame_header(s, avpkt->data, avpkt->size);
+
+ if (ret < 0)
goto err;
prev_frame = s->framep[VP56_FRAME_CURRENT];
- referenced = s->update_last || s->update_golden == VP56_FRAME_CURRENT
- || s->update_altref == VP56_FRAME_CURRENT;
+ referenced = s->update_last || s->update_golden == VP56_FRAME_CURRENT ||
+ s->update_altref == VP56_FRAME_CURRENT;
- skip_thresh = !referenced ? AVDISCARD_NONREF :
- !s->keyframe ? AVDISCARD_NONKEY : AVDISCARD_ALL;
+ skip_thresh = !referenced ? AVDISCARD_NONREF
+ : !s->keyframe ? AVDISCARD_NONKEY
+ : AVDISCARD_ALL;
if (avctx->skip_frame >= skip_thresh) {
s->invisible = 1;
@@ -1893,88 +2541,75 @@ int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (s->frames[i].tf.f->data[0] &&
&s->frames[i] != prev_frame &&
&s->frames[i] != s->framep[VP56_FRAME_PREVIOUS] &&
- &s->frames[i] != s->framep[VP56_FRAME_GOLDEN] &&
+ &s->frames[i] != s->framep[VP56_FRAME_GOLDEN] &&
&s->frames[i] != s->framep[VP56_FRAME_GOLDEN2])
vp8_release_frame(s, &s->frames[i]);
- // find a free buffer
- for (i = 0; i < 5; i++)
- if (&s->frames[i] != prev_frame &&
- &s->frames[i] != s->framep[VP56_FRAME_PREVIOUS] &&
- &s->frames[i] != s->framep[VP56_FRAME_GOLDEN] &&
- &s->frames[i] != s->framep[VP56_FRAME_GOLDEN2]) {
- curframe = s->framep[VP56_FRAME_CURRENT] = &s->frames[i];
- break;
- }
- if (i == 5) {
- av_log(avctx, AV_LOG_FATAL, "Ran out of free frames!\n");
- abort();
- }
- if (curframe->tf.f->data[0])
- vp8_release_frame(s, curframe);
+ curframe = s->framep[VP56_FRAME_CURRENT] = vp8_find_free_buffer(s);
- // Given that arithmetic probabilities are updated every frame, it's quite likely
- // that the values we have on a random interframe are complete junk if we didn't
- // start decode on a keyframe. So just don't display anything rather than junk.
+ /* Given that arithmetic probabilities are updated every frame, it's quite
+ * likely that the values we have on a random interframe are complete
+ * junk if we didn't start decode on a keyframe. So just don't display
+ * anything rather than junk. */
if (!s->keyframe && (!s->framep[VP56_FRAME_PREVIOUS] ||
- !s->framep[VP56_FRAME_GOLDEN] ||
+ !s->framep[VP56_FRAME_GOLDEN] ||
!s->framep[VP56_FRAME_GOLDEN2])) {
- av_log(avctx, AV_LOG_WARNING, "Discarding interframe without a prior keyframe!\n");
+ av_log(avctx, AV_LOG_WARNING,
+ "Discarding interframe without a prior keyframe!\n");
ret = AVERROR_INVALIDDATA;
goto err;
}
curframe->tf.f->key_frame = s->keyframe;
- curframe->tf.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
+ curframe->tf.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I
+ : AV_PICTURE_TYPE_P;
if ((ret = vp8_alloc_frame(s, curframe, referenced)) < 0)
goto err;
// check if golden and altref are swapped
- if (s->update_altref != VP56_FRAME_NONE) {
- s->next_framep[VP56_FRAME_GOLDEN2] = s->framep[s->update_altref];
- } else {
- s->next_framep[VP56_FRAME_GOLDEN2] = s->framep[VP56_FRAME_GOLDEN2];
- }
- if (s->update_golden != VP56_FRAME_NONE) {
- s->next_framep[VP56_FRAME_GOLDEN] = s->framep[s->update_golden];
- } else {
- s->next_framep[VP56_FRAME_GOLDEN] = s->framep[VP56_FRAME_GOLDEN];
- }
- if (s->update_last) {
+ if (s->update_altref != VP56_FRAME_NONE)
+ s->next_framep[VP56_FRAME_GOLDEN2] = s->framep[s->update_altref];
+ else
+ s->next_framep[VP56_FRAME_GOLDEN2] = s->framep[VP56_FRAME_GOLDEN2];
+
+ if (s->update_golden != VP56_FRAME_NONE)
+ s->next_framep[VP56_FRAME_GOLDEN] = s->framep[s->update_golden];
+ else
+ s->next_framep[VP56_FRAME_GOLDEN] = s->framep[VP56_FRAME_GOLDEN];
+
+ if (s->update_last)
s->next_framep[VP56_FRAME_PREVIOUS] = curframe;
- } else {
+ else
s->next_framep[VP56_FRAME_PREVIOUS] = s->framep[VP56_FRAME_PREVIOUS];
- }
- s->next_framep[VP56_FRAME_CURRENT] = curframe;
+
+ s->next_framep[VP56_FRAME_CURRENT] = curframe;
ff_thread_finish_setup(avctx);
s->linesize = curframe->tf.f->linesize[0];
s->uvlinesize = curframe->tf.f->linesize[1];
- memset(s->top_nnz, 0, s->mb_width*sizeof(*s->top_nnz));
- /* Zero macroblock structures for top/top-left prediction from outside the frame. */
+ memset(s->top_nnz, 0, s->mb_width * sizeof(*s->top_nnz));
+ /* Zero macroblock structures for top/top-left prediction
+ * from outside the frame. */
if (!s->mb_layout)
- memset(s->macroblocks + s->mb_height*2 - 1, 0, (s->mb_width+1)*sizeof(*s->macroblocks));
+ memset(s->macroblocks + s->mb_height * 2 - 1, 0,
+ (s->mb_width + 1) * sizeof(*s->macroblocks));
if (!s->mb_layout && s->keyframe)
- memset(s->intra4x4_pred_mode_top, DC_PRED, s->mb_width*4);
+ memset(s->intra4x4_pred_mode_top, DC_PRED, s->mb_width * 4);
- // top edge of 127 for intra prediction
- if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) {
- s->top_border[0][15] = s->top_border[0][23] = 127;
- s->top_border[0][31] = 127;
- memset(s->top_border[1], 127, s->mb_width*sizeof(*s->top_border));
- }
memset(s->ref_count, 0, sizeof(s->ref_count));
-
if (s->mb_layout == 1) {
// Make sure the previous frame has read its segmentation map,
// if we re-use the same map.
if (prev_frame && s->segmentation.enabled &&
!s->segmentation.update_map)
ff_thread_await_progress(&prev_frame->tf, 1, 0);
- vp8_decode_mv_mb_modes(avctx, curframe, prev_frame);
+ if (is_vp7)
+ vp7_decode_mv_mb_modes(avctx, curframe, prev_frame);
+ else
+ vp8_decode_mv_mb_modes(avctx, curframe, prev_frame);
}
if (avctx->active_thread_type == FF_THREAD_FRAME)
@@ -1988,9 +2623,14 @@ int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s->mv_max.y = ((s->mb_height - 1) << 6) + MARGIN;
for (i = 0; i < MAX_THREADS; i++) {
s->thread_data[i].thread_mb_pos = 0;
- s->thread_data[i].wait_mb_pos = INT_MAX;
+ s->thread_data[i].wait_mb_pos = INT_MAX;
}
- avctx->execute2(avctx, vp8_decode_mb_row_sliced, s->thread_data, NULL, num_jobs);
+ if (is_vp7)
+ avctx->execute2(avctx, vp7_decode_mb_row_sliced, s->thread_data, NULL,
+ num_jobs);
+ else
+ avctx->execute2(avctx, vp8_decode_mb_row_sliced, s->thread_data, NULL,
+ num_jobs);
ff_thread_report_progress(&curframe->tf, INT_MAX, 0);
memcpy(&s->framep[0], &s->next_framep[0], sizeof(s->framep[0]) * 4);
@@ -2004,7 +2644,7 @@ skip_decode:
if (!s->invisible) {
if ((ret = av_frame_ref(data, curframe->tf.f)) < 0)
return ret;
- *got_frame = 1;
+ *got_frame = 1;
}
return avpkt->size;
@@ -2013,6 +2653,20 @@ err:
return ret;
}
+int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
+ AVPacket *avpkt)
+{
+ return vp78_decode_frame(avctx, data, got_frame, avpkt, IS_VP8);
+}
+
+#if CONFIG_VP7_DECODER
+static int vp7_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
+ AVPacket *avpkt)
+{
+ return vp78_decode_frame(avctx, data, got_frame, avpkt, IS_VP7);
+}
+#endif /* CONFIG_VP7_DECODER */
+
av_cold int ff_vp8_decode_free(AVCodecContext *avctx)
{
VP8Context *s = avctx->priv_data;
@@ -2036,12 +2690,14 @@ static av_cold int vp8_init_frames(VP8Context *s)
return 0;
}
-av_cold int ff_vp8_decode_init(AVCodecContext *avctx)
+static av_always_inline
+int vp78_decode_init(AVCodecContext *avctx, int is_vp7)
{
VP8Context *s = avctx->priv_data;
int ret;
s->avctx = avctx;
+ s->vp7 = avctx->codec->id == AV_CODEC_ID_VP7;
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
avctx->internal->allocate_progress = 1;
@@ -2053,8 +2709,22 @@ av_cold int ff_vp8_decode_init(AVCodecContext *avctx)
#endif
ff_videodsp_init(&s->vdsp, 8);
- ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1);
- ff_vp8dsp_init(&s->vp8dsp);
+
+ ff_vp78dsp_init(&s->vp8dsp);
+ if (CONFIG_VP7_DECODER && is_vp7) {
+ ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP7, 8, 1);
+ ff_vp7dsp_init(&s->vp8dsp);
+ s->decode_mb_row_no_filter = vp7_decode_mb_row_no_filter;
+ s->filter_mb_row = vp7_filter_mb_row;
+ } else if (CONFIG_VP8_DECODER && !is_vp7) {
+ ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1);
+ ff_vp8dsp_init(&s->vp8dsp);
+ s->decode_mb_row_no_filter = vp8_decode_mb_row_no_filter;
+ s->filter_mb_row = vp8_filter_mb_row;
+ }
+
+ /* does not change for VP8 */
+ memcpy(s->prob[0].scan, zigzag_scan, sizeof(s->prob[0].scan));
if ((ret = vp8_init_frames(s)) < 0) {
ff_vp8_decode_free(avctx);
@@ -2064,6 +2734,19 @@ av_cold int ff_vp8_decode_init(AVCodecContext *avctx)
return 0;
}
+#if CONFIG_VP7_DECODER
+static int vp7_decode_init(AVCodecContext *avctx)
+{
+ return vp78_decode_init(avctx, IS_VP7);
+}
+#endif /* CONFIG_VP7_DECODER */
+
+av_cold int ff_vp8_decode_init(AVCodecContext *avctx)
+{
+ return vp78_decode_init(avctx, IS_VP8);
+}
+
+#if CONFIG_VP8_DECODER
static av_cold int vp8_decode_init_thread_copy(AVCodecContext *avctx)
{
VP8Context *s = avctx->priv_data;
@@ -2079,10 +2762,10 @@ static av_cold int vp8_decode_init_thread_copy(AVCodecContext *avctx)
return 0;
}
-#define REBASE(pic) \
- pic ? pic - &s_src->frames[0] + &s->frames[0] : NULL
+#define REBASE(pic) pic ? pic - &s_src->frames[0] + &s->frames[0] : NULL
-static int vp8_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
+static int vp8_decode_update_thread_context(AVCodecContext *dst,
+ const AVCodecContext *src)
{
VP8Context *s = dst->priv_data, *s_src = src->priv_data;
int i;
@@ -2094,9 +2777,9 @@ static int vp8_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo
s->mb_height = s_src->mb_height;
}
- s->prob[0] = s_src->prob[!s_src->update_probabilities];
+ s->prob[0] = s_src->prob[!s_src->update_probabilities];
s->segmentation = s_src->segmentation;
- s->lf_delta = s_src->lf_delta;
+ s->lf_delta = s_src->lf_delta;
memcpy(s->sign_bias, s_src->sign_bias, sizeof(s->sign_bias));
for (i = 0; i < FF_ARRAY_ELEMS(s_src->frames); i++) {
@@ -2114,7 +2797,24 @@ static int vp8_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo
return 0;
}
+#endif /* CONFIG_VP8_DECODER */
+#if CONFIG_VP7_DECODER
+AVCodec ff_vp7_decoder = {
+ .name = "vp7",
+ .long_name = NULL_IF_CONFIG_SMALL("On2 VP7"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_VP7,
+ .priv_data_size = sizeof(VP8Context),
+ .init = vp7_decode_init,
+ .close = ff_vp8_decode_free,
+ .decode = vp7_decode_frame,
+ .capabilities = CODEC_CAP_DR1,
+ .flush = vp8_decode_flush,
+};
+#endif /* CONFIG_VP7_DECODER */
+
+#if CONFIG_VP8_DECODER
AVCodec ff_vp8_decoder = {
.name = "vp8",
.long_name = NULL_IF_CONFIG_SMALL("On2 VP8"),
@@ -2129,4 +2829,4 @@ AVCodec ff_vp8_decoder = {
.init_thread_copy = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
};
-
+#endif /* CONFIG_VP7_DECODER */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp8.h b/chromium/third_party/ffmpeg/libavcodec/vp8.h
index c9a7906df03..534c08160b9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp8.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vp8.h
@@ -28,16 +28,17 @@
#include "libavutil/buffer.h"
-#include "vp56.h"
-#include "vp8dsp.h"
#include "h264pred.h"
#include "thread.h"
+#include "vp56.h"
+#include "vp8dsp.h"
+
#if HAVE_PTHREADS
-#include <pthread.h>
+# include <pthread.h>
#elif HAVE_OS2THREADS
-#include "compat/os2threads.h"
+# include "compat/os2threads.h"
#elif HAVE_W32THREADS
-#include "compat/w32pthreads.h"
+# include "compat/w32pthreads.h"
#endif
#define VP8_MAX_QUANT 127
@@ -84,7 +85,7 @@ typedef struct VP8FilterStrength {
typedef struct VP8Macroblock {
uint8_t skip;
- // todo: make it possible to check for at least (i4x4 or split_mv)
+ // TODO: make it possible to check for at least (i4x4 or split_mv)
// in one op. are others needed?
uint8_t mode;
uint8_t ref_frame;
@@ -92,7 +93,7 @@ typedef struct VP8Macroblock {
uint8_t chroma_pred_mode;
uint8_t segment;
uint8_t intra4x4_pred_mode_mb[16];
- uint8_t intra4x4_pred_mode_top[4];
+ DECLARE_ALIGNED(4, uint8_t, intra4x4_pred_mode_top)[4];
VP56mv mv;
VP56mv bmv[16];
} VP8Macroblock;
@@ -118,11 +119,13 @@ typedef struct VP8ThreadData {
int thread_nr;
#if HAVE_THREADS
pthread_mutex_t lock;
- pthread_cond_t cond;
+ pthread_cond_t cond;
#endif
int thread_mb_pos; // (mb_y << 16) | (mb_x & 0xFFFF)
int wait_mb_pos; // What the current thread is waiting on.
- DECLARE_ALIGNED(16, uint8_t, edge_emu_buffer)[21*32];
+
+#define EDGE_EMU_LINESIZE 32
+ DECLARE_ALIGNED(16, uint8_t, edge_emu_buffer)[21 * EDGE_EMU_LINESIZE];
VP8FilterStrength *filter_strength;
} VP8ThreadData;
@@ -203,7 +206,7 @@ typedef struct VP8Context {
* [7] - split mv
* i16x16 modes never have any adjustment
*/
- int8_t mode[VP8_MVMODE_SPLIT+1];
+ int8_t mode[VP8_MVMODE_SPLIT + 1];
/**
* filter strength adjustment for macroblocks that reference:
@@ -215,7 +218,7 @@ typedef struct VP8Context {
int8_t ref[4];
} lf_delta;
- uint8_t (*top_border)[16+8+8];
+ uint8_t (*top_border)[16 + 8 + 8];
uint8_t (*top_nnz)[9];
VP56RangeCoder c; ///< header context, includes mb modes and motion vectors
@@ -234,8 +237,9 @@ typedef struct VP8Context {
uint8_t golden;
uint8_t pred16x16[4];
uint8_t pred8x8c[3];
- uint8_t token[4][16][3][NUM_DCT_TOKENS-1];
+ uint8_t token[4][16][3][NUM_DCT_TOKENS - 1];
uint8_t mvc[2][19];
+ uint8_t scan[16];
} prob[2];
VP8Macroblock *macroblocks_base;
@@ -269,6 +273,31 @@ typedef struct VP8Context {
* 1 -> Macroblocks for entire frame alloced (sliced thread).
*/
int mb_layout;
+
+ void (*decode_mb_row_no_filter)(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr);
+ void (*filter_mb_row)(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr);
+
+ int vp7;
+
+ /**
+ * Fade bit present in bitstream (VP7)
+ */
+ int fade_present;
+
+ /**
+ * Interframe DC prediction (VP7)
+ * [0] VP56_FRAME_PREVIOUS
+ * [1] VP56_FRAME_GOLDEN
+ */
+ uint16_t inter_dc_pred[2][2];
+
+ /**
+ * Macroblock features (VP7)
+ */
+ uint8_t feature_enabled[4];
+ uint8_t feature_present_prob[4];
+ uint8_t feature_index_prob[4][3];
+ uint8_t feature_value[4][4];
} VP8Context;
int ff_vp8_decode_init(AVCodecContext *avctx);
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp8_parser.c b/chromium/third_party/ffmpeg/libavcodec/vp8_parser.c
index 096961fec1a..afc7f991e64 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp8_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp8_parser.c
@@ -21,18 +21,19 @@
#include "parser.h"
static int parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- const uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
+ AVCodecContext *avctx,
+ const uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size)
{
- s->pict_type= (buf[0]&0x01) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
+ s->pict_type = (buf[0] & 0x01) ? AV_PICTURE_TYPE_P
+ : AV_PICTURE_TYPE_I;
- *poutbuf = buf;
+ *poutbuf = buf;
*poutbuf_size = buf_size;
return buf_size;
}
AVCodecParser ff_vp8_parser = {
- .codec_ids = { AV_CODEC_ID_VP8 },
- .parser_parse = parse,
+ .codec_ids = { AV_CODEC_ID_VP8 },
+ .parser_parse = parse,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp8data.h b/chromium/third_party/ffmpeg/libavcodec/vp8data.h
index 0ea24d7ed87..f9dbf56feb9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp8data.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vp8data.h
@@ -30,28 +30,89 @@
#include "vp8.h"
#include "h264pred.h"
-static const uint8_t vp8_pred4x4_mode[] =
-{
+static const uint8_t vp7_pred4x4_mode[] = {
+ [DC_PRED8x8] = DC_PRED,
+ [VERT_PRED8x8] = TM_VP8_PRED,
+ [HOR_PRED8x8] = TM_VP8_PRED,
+ [PLANE_PRED8x8] = TM_VP8_PRED,
+};
+
+static const uint8_t vp8_pred4x4_mode[] = {
[DC_PRED8x8] = DC_PRED,
[VERT_PRED8x8] = VERT_PRED,
[HOR_PRED8x8] = HOR_PRED,
[PLANE_PRED8x8] = TM_VP8_PRED,
};
-static const int8_t vp8_pred16x16_tree_intra[4][2] =
-{
- { -MODE_I4x4, 1 }, // '0'
- { 2, 3 },
- { -DC_PRED8x8, -VERT_PRED8x8 }, // '100', '101'
- { -HOR_PRED8x8, -PLANE_PRED8x8 }, // '110', '111'
+static const int8_t vp8_pred16x16_tree_intra[4][2] = {
+ { -MODE_I4x4, 1 }, // '0'
+ { 2, 3 },
+ { -DC_PRED8x8, -VERT_PRED8x8 }, // '100', '101'
+ { -HOR_PRED8x8, -PLANE_PRED8x8 }, // '110', '111'
};
-static const int8_t vp8_pred16x16_tree_inter[4][2] =
-{
- { -DC_PRED8x8, 1 }, // '0'
- { 2, 3 },
- { -VERT_PRED8x8, -HOR_PRED8x8 }, // '100', '101'
- { -PLANE_PRED8x8, -MODE_I4x4 }, // '110', '111'
+static const int8_t vp8_pred16x16_tree_inter[4][2] = {
+ { -DC_PRED8x8, 1 }, // '0'
+ { 2, 3 },
+ { -VERT_PRED8x8, -HOR_PRED8x8 }, // '100', '101'
+ { -PLANE_PRED8x8, -MODE_I4x4 }, // '110', '111'
+};
+
+typedef struct VP7MVPred {
+ int8_t yoffset;
+ int8_t xoffset;
+ uint8_t subblock;
+ uint8_t score;
+} VP7MVPred;
+
+#define VP7_MV_PRED_COUNT 12
+static const VP7MVPred vp7_mv_pred[VP7_MV_PRED_COUNT] = {
+ { -1, 0, 12, 8 },
+ { 0, -1, 3, 8 },
+ { -1, -1, 15, 2 },
+ { -1, 1, 12, 2 },
+ { -2, 0, 12, 2 },
+ { 0, -2, 3, 2 },
+ { -1, -2, 15, 1 },
+ { -2, -1, 15, 1 },
+ { -2, 1, 12, 1 },
+ { -1, 2, 12, 1 },
+ { -2, -2, 15, 1 },
+ { -2, 2, 12, 1 },
+};
+
+static const int vp7_mode_contexts[31][4] = {
+ { 3, 3, 1, 246 },
+ { 7, 89, 66, 239 },
+ { 10, 90, 78, 238 },
+ { 14, 118, 95, 241 },
+ { 14, 123, 106, 238 },
+ { 20, 140, 109, 240 },
+ { 13, 155, 103, 238 },
+ { 21, 158, 99, 240 },
+ { 27, 82, 108, 232 },
+ { 19, 99, 123, 217 },
+ { 45, 139, 148, 236 },
+ { 50, 117, 144, 235 },
+ { 57, 128, 164, 238 },
+ { 69, 139, 171, 239 },
+ { 74, 154, 179, 238 },
+ { 112, 165, 186, 242 },
+ { 98, 143, 185, 245 },
+ { 105, 153, 190, 250 },
+ { 124, 167, 192, 245 },
+ { 131, 186, 203, 246 },
+ { 59, 184, 222, 224 },
+ { 148, 215, 214, 213 },
+ { 137, 211, 210, 219 },
+ { 190, 227, 128, 228 },
+ { 183, 228, 128, 228 },
+ { 194, 234, 128, 228 },
+ { 202, 236, 128, 228 },
+ { 205, 240, 128, 228 },
+ { 205, 244, 128, 228 },
+ { 225, 246, 128, 228 },
+ { 233, 251, 128, 228 },
};
static const int vp8_mode_contexts[6][4] = {
@@ -64,26 +125,30 @@ static const int vp8_mode_contexts[6][4] = {
};
static const uint8_t vp8_mbsplits[5][16] = {
- { 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1 },
- { 0, 0, 1, 1, 0, 0, 1, 1,
- 0, 0, 1, 1, 0, 0, 1, 1 },
- { 0, 0, 1, 1, 0, 0, 1, 1,
- 2, 2, 3, 3, 2, 2, 3, 3 },
- { 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15 },
- { 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0 }
+ { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 },
+ { 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1 },
+ { 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3 },
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
static const uint8_t vp8_mbfirstidx[4][16] = {
- { 0, 8 }, { 0, 2 }, { 0, 2, 8, 10 },
- { 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15 }
+ { 0, 8 },
+ { 0, 2 },
+ { 0, 2, 8, 10 },
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
};
-static const uint8_t vp8_mbsplit_count[4] = { 2, 2, 4, 16 };
-static const uint8_t vp8_mbsplit_prob[3] = { 110, 111, 150 };
+static const uint8_t vp8_mbsplit_count[4] = {
+ 2, 2, 4, 16
+};
+static const uint8_t vp8_mbsplit_prob[3] = {
+ 110, 111, 150
+};
+
+static const uint8_t vp7_submv_prob[3] = {
+ 180, 162, 25
+};
static const uint8_t vp8_submv_prob[5][3] = {
{ 147, 136, 18 },
@@ -93,39 +158,42 @@ static const uint8_t vp8_submv_prob[5][3] = {
{ 208, 1, 1 }
};
-static const uint8_t vp8_pred16x16_prob_intra[4] = { 145, 156, 163, 128 };
-static const uint8_t vp8_pred16x16_prob_inter[4] = { 112, 86, 140, 37 };
+static const uint8_t vp8_pred16x16_prob_intra[4] = {
+ 145, 156, 163, 128
+};
+static const uint8_t vp8_pred16x16_prob_inter[4] = {
+ 112, 86, 140, 37
+};
-static const int8_t vp8_pred4x4_tree[9][2] =
-{
- { -DC_PRED, 1 }, // '0'
- { -TM_VP8_PRED, 2 }, // '10'
- { -VERT_PRED, 3 }, // '110'
- { 4, 6 },
- { -HOR_PRED, 5 }, // '11100'
- { -DIAG_DOWN_RIGHT_PRED, -VERT_RIGHT_PRED }, // '111010', '111011'
- { -DIAG_DOWN_LEFT_PRED, 7 }, // '11110'
- { -VERT_LEFT_PRED, 8 }, // '111110'
- { -HOR_DOWN_PRED, -HOR_UP_PRED }, // '1111110', '1111111'
-};
-
-static const int8_t vp8_pred8x8c_tree[3][2] =
-{
- { -DC_PRED8x8, 1 }, // '0'
- { -VERT_PRED8x8, 2 }, // '10
- { -HOR_PRED8x8, -PLANE_PRED8x8 }, // '110', '111'
+static const int8_t vp8_pred4x4_tree[9][2] = {
+ { -DC_PRED, 1 }, // '0'
+ { -TM_VP8_PRED, 2 }, // '10'
+ { -VERT_PRED, 3 }, // '110'
+ { 4, 6 },
+ { -HOR_PRED, 5 }, // '11100'
+ { -DIAG_DOWN_RIGHT_PRED, -VERT_RIGHT_PRED }, // '111010', '111011'
+ { -DIAG_DOWN_LEFT_PRED, 7 }, // '11110'
+ { -VERT_LEFT_PRED, 8 }, // '111110'
+ { -HOR_DOWN_PRED, -HOR_UP_PRED }, // '1111110', '1111111'
};
-static const uint8_t vp8_pred8x8c_prob_intra[3] = { 142, 114, 183 };
-static const uint8_t vp8_pred8x8c_prob_inter[3] = { 162, 101, 204 };
+static const int8_t vp8_pred8x8c_tree[3][2] = {
+ { -DC_PRED8x8, 1 }, // '0'
+ { -VERT_PRED8x8, 2 }, // '10
+ { -HOR_PRED8x8, -PLANE_PRED8x8 }, // '110', '111'
+};
-static const uint8_t vp8_pred4x4_prob_inter[9] =
-{
+static const uint8_t vp8_pred8x8c_prob_intra[3] = {
+ 142, 114, 183
+};
+static const uint8_t vp8_pred8x8c_prob_inter[3] = {
+ 162, 101, 204
+};
+static const uint8_t vp8_pred4x4_prob_inter[9] = {
120, 90, 79, 133, 87, 85, 80, 111, 151
};
-static const uint8_t vp8_pred4x4_prob_intra[10][10][9] =
-{
+static const uint8_t vp8_pred4x4_prob_intra[10][10][9] = {
{
{ 39, 53, 200, 87, 26, 21, 43, 232, 171 },
{ 56, 34, 51, 104, 114, 102, 29, 93, 77 },
@@ -248,50 +316,57 @@ static const uint8_t vp8_pred4x4_prob_intra[10][10][9] =
},
};
-static const int8_t vp8_segmentid_tree[][2] =
-{
- { 1, 2 },
- { -0, -1 }, // '00', '01'
- { -2, -3 }, // '10', '11'
+static const int8_t vp8_segmentid_tree[][2] = {
+ { 1, 2 },
+ { -0, -1 }, // '00', '01'
+ { -2, -3 }, // '10', '11'
};
-static const uint8_t vp8_coeff_band[16] =
-{
+static const uint8_t vp8_coeff_band[16] = {
0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7
};
/* Inverse of vp8_coeff_band: mappings of bands to coefficient indexes.
* Each list is -1-terminated. */
-static const int8_t vp8_coeff_band_indexes[8][10] =
-{
- {0, -1},
- {1, -1},
- {2, -1},
- {3, -1},
- {5, -1},
- {6, -1},
- {4, 7, 8, 9, 10, 11, 12, 13, 14, -1},
- {15, -1}
-};
-
-static const uint8_t vp8_dct_cat1_prob[] = { 159, 0 };
-static const uint8_t vp8_dct_cat2_prob[] = { 165, 145, 0 };
-static const uint8_t vp8_dct_cat3_prob[] = { 173, 148, 140, 0 };
-static const uint8_t vp8_dct_cat4_prob[] = { 176, 155, 140, 135, 0 };
-static const uint8_t vp8_dct_cat5_prob[] = { 180, 157, 141, 134, 130, 0 };
-static const uint8_t vp8_dct_cat6_prob[] = { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0 };
+static const int8_t vp8_coeff_band_indexes[8][10] = {
+ { 0, -1 },
+ { 1, -1 },
+ { 2, -1 },
+ { 3, -1 },
+ { 5, -1 },
+ { 6, -1 },
+ { 4, 7, 8, 9, 10, 11, 12, 13, 14, -1 },
+ { 15, -1 }
+};
+
+static const uint8_t vp8_dct_cat1_prob[] = {
+ 159, 0
+};
+static const uint8_t vp8_dct_cat2_prob[] = {
+ 165, 145, 0
+};
+static const uint8_t vp8_dct_cat3_prob[] = {
+ 173, 148, 140, 0
+};
+static const uint8_t vp8_dct_cat4_prob[] = {
+ 176, 155, 140, 135, 0
+};
+static const uint8_t vp8_dct_cat5_prob[] = {
+ 180, 157, 141, 134, 130, 0
+};
+static const uint8_t vp8_dct_cat6_prob[] = {
+ 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0
+};
// only used for cat3 and above; cat 1 and 2 are referenced directly
-const uint8_t * const ff_vp8_dct_cat_prob[] =
-{
+const uint8_t *const ff_vp8_dct_cat_prob[] = {
vp8_dct_cat3_prob,
vp8_dct_cat4_prob,
vp8_dct_cat5_prob,
vp8_dct_cat6_prob,
};
-static const uint8_t vp8_token_default_probs[4][8][3][NUM_DCT_TOKENS-1] =
-{
+static const uint8_t vp8_token_default_probs[4][8][3][NUM_DCT_TOKENS - 1] = {
{
{
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
@@ -462,8 +537,7 @@ static const uint8_t vp8_token_default_probs[4][8][3][NUM_DCT_TOKENS-1] =
},
};
-static const uint8_t vp8_token_update_probs[4][8][3][NUM_DCT_TOKENS-1] =
-{
+static const uint8_t vp8_token_update_probs[4][8][3][NUM_DCT_TOKENS - 1] = {
{
{
{ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
@@ -636,14 +710,13 @@ static const uint8_t vp8_token_update_probs[4][8][3][NUM_DCT_TOKENS-1] =
// fixme: copied from h264data.h
static const uint8_t zigzag_scan[16]={
- 0+0*4, 1+0*4, 0+1*4, 0+2*4,
- 1+1*4, 2+0*4, 3+0*4, 2+1*4,
- 1+2*4, 0+3*4, 1+3*4, 2+2*4,
- 3+1*4, 3+2*4, 2+3*4, 3+3*4,
+ 0 + 0 * 4, 1 + 0 * 4, 0 + 1 * 4, 0 + 2 * 4,
+ 1 + 1 * 4, 2 + 0 * 4, 3 + 0 * 4, 2 + 1 * 4,
+ 1 + 2 * 4, 0 + 3 * 4, 1 + 3 * 4, 2 + 2 * 4,
+ 3 + 1 * 4, 3 + 2 * 4, 2 + 3 * 4, 3 + 3 * 4,
};
-static const uint8_t vp8_dc_qlookup[VP8_MAX_QUANT+1] =
-{
+static const uint8_t vp8_dc_qlookup[VP8_MAX_QUANT + 1] = {
4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17,
18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43,
@@ -654,8 +727,7 @@ static const uint8_t vp8_dc_qlookup[VP8_MAX_QUANT+1] =
122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157,
};
-static const uint16_t vp8_ac_qlookup[VP8_MAX_QUANT+1] =
-{
+static const uint16_t vp8_ac_qlookup[VP8_MAX_QUANT + 1] = {
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
@@ -670,11 +742,22 @@ static const uint8_t vp8_mv_update_prob[2][19] = {
{ 237,
246,
253, 253, 254, 254, 254, 254, 254,
- 254, 254, 254, 254, 254, 250, 250, 252, 254, 254 },
+ 254, 254, 254, 254, 254, 250, 250, 252, /* VP8 only: */ 254, 254 },
{ 231,
243,
245, 253, 254, 254, 254, 254, 254,
- 254, 254, 254, 254, 254, 251, 251, 254, 254, 254 }
+ 254, 254, 254, 254, 254, 251, 251, 254, /* VP8 only: */ 254, 254 }
+};
+
+static const uint8_t vp7_mv_default_prob[2][17] = {
+ { 162,
+ 128,
+ 225, 146, 172, 147, 214, 39, 156,
+ 247, 210, 135, 68, 138, 220, 239, 246 },
+ { 164,
+ 128,
+ 204, 170, 119, 235, 140, 230, 228,
+ 244, 184, 201, 44, 173, 221, 239, 253 }
};
static const uint8_t vp8_mv_default_prob[2][19] = {
@@ -688,4 +771,68 @@ static const uint8_t vp8_mv_default_prob[2][19] = {
128, 130, 130, 74, 148, 180, 203, 236, 254, 254 }
};
+static const uint8_t vp7_feature_value_size[2][4] = {
+ { 7, 6, 0, 8 },
+ { 7, 6, 0, 5 },
+};
+
+static const int8_t vp7_feature_index_tree[4][2] =
+{
+ { 1, 2 },
+ { -0, -1 }, // '00', '01'
+ { -2, -3 }, // '10', '11'
+};
+
+static const uint16_t vp7_ydc_qlookup[] = {
+ 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 39, 39, 40, 41,
+ 41, 42, 43, 43, 44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 52,
+ 53, 53, 54, 56, 57, 58, 59, 60, 62, 63, 65, 66, 68, 70, 72,
+ 74, 76, 79, 81, 84, 87, 90, 93, 96, 100, 104, 108, 112, 116, 121,
+ 126, 131, 136, 142, 148, 154, 160, 167, 174, 182, 189, 198, 206, 215, 224,
+ 234, 244, 254, 265, 277, 288, 301, 313, 327, 340, 355, 370, 385, 401, 417,
+ 434, 452, 470, 489, 509, 529, 550, 572,
+};
+
+static const uint16_t vp7_yac_qlookup[] = {
+ 4, 4, 5, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, 15,
+ 16, 17, 19, 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35,
+ 37, 38, 40, 41, 42, 44, 45, 46, 48, 49, 50, 51, 53, 54,
+ 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 67, 68, 69, 70,
+ 72, 73, 75, 76, 78, 80, 82, 84, 86, 88, 91, 93, 96, 99,
+ 102, 105, 109, 112, 116, 121, 125, 130, 135, 140, 146, 152, 158, 165,
+ 172, 180, 188, 196, 205, 214, 224, 234, 245, 256, 268, 281, 294, 308,
+ 322, 337, 353, 369, 386, 404, 423, 443, 463, 484, 506, 529, 553, 578,
+ 604, 631, 659, 688, 718, 749, 781, 814, 849, 885, 922, 960, 1000, 1041,
+ 1083, 1127,
+};
+
+static const uint16_t vp7_y2dc_qlookup[] = {
+ 7, 9, 11, 13, 15, 17, 19, 21, 23, 26, 28, 30, 33, 35,
+ 37, 39, 42, 44, 46, 48, 51, 53, 55, 57, 59, 61, 63, 65,
+ 67, 69, 70, 72, 74, 75, 77, 78, 80, 81, 83, 84, 85, 87,
+ 88, 89, 90, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 104,
+ 105, 106, 108, 109, 111, 113, 114, 116, 118, 120, 123, 125, 128, 131,
+ 134, 137, 140, 144, 148, 152, 156, 161, 166, 171, 176, 182, 188, 195,
+ 202, 209, 217, 225, 234, 243, 253, 263, 274, 285, 297, 309, 322, 336,
+ 350, 365, 381, 397, 414, 432, 450, 470, 490, 511, 533, 556, 579, 604,
+ 630, 656, 684, 713, 742, 773, 805, 838, 873, 908, 945, 983, 1022, 1063,
+ 1105, 1148,
+};
+
+static const uint16_t vp7_y2ac_qlookup[] = {
+ 7, 9, 11, 13, 16, 18, 21, 24, 26, 29, 32, 35,
+ 38, 41, 43, 46, 49, 52, 55, 58, 61, 64, 66, 69,
+ 72, 74, 77, 79, 82, 84, 86, 88, 91, 93, 95, 97,
+ 98, 100, 102, 104, 105, 107, 109, 110, 112, 113, 115, 116,
+ 117, 119, 120, 122, 123, 125, 127, 128, 130, 132, 134, 136,
+ 138, 141, 143, 146, 149, 152, 155, 158, 162, 166, 171, 175,
+ 180, 185, 191, 197, 204, 210, 218, 226, 234, 243, 252, 262,
+ 273, 284, 295, 308, 321, 335, 350, 365, 381, 398, 416, 435,
+ 455, 476, 497, 520, 544, 569, 595, 622, 650, 680, 711, 743,
+ 776, 811, 848, 885, 925, 965, 1008, 1052, 1097, 1144, 1193, 1244,
+ 1297, 1351, 1407, 1466, 1526, 1588, 1652, 1719,
+};
+
#endif /* AVCODEC_VP8DATA_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp8dsp.c b/chromium/third_party/ffmpeg/libavcodec/vp8dsp.c
index ba267fdcd20..f2a7f320797 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp8dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp8dsp.c
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2010 David Conrad
* Copyright (C) 2010 Ronald S. Bultje
+ * Copyright (C) 2014 Peter Ross
*
* This file is part of FFmpeg.
*
@@ -24,36 +25,148 @@
* VP8 compatible video decoder
*/
-#include "dsputil.h"
-#include "vp8dsp.h"
#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
+
+#include "mathops.h"
+#include "vp8dsp.h"
+
+#define MK_IDCT_DC_ADD4_C(name) \
+static void name ## _idct_dc_add4uv_c(uint8_t *dst, int16_t block[4][16], \
+ ptrdiff_t stride) \
+{ \
+ name ## _idct_dc_add_c(dst + stride * 0 + 0, block[0], stride); \
+ name ## _idct_dc_add_c(dst + stride * 0 + 4, block[1], stride); \
+ name ## _idct_dc_add_c(dst + stride * 4 + 0, block[2], stride); \
+ name ## _idct_dc_add_c(dst + stride * 4 + 4, block[3], stride); \
+} \
+ \
+static void name ## _idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], \
+ ptrdiff_t stride) \
+{ \
+ name ## _idct_dc_add_c(dst + 0, block[0], stride); \
+ name ## _idct_dc_add_c(dst + 4, block[1], stride); \
+ name ## _idct_dc_add_c(dst + 8, block[2], stride); \
+ name ## _idct_dc_add_c(dst + 12, block[3], stride); \
+}
+
+#if CONFIG_VP7_DECODER
+static void vp7_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16])
+{
+ int i, a1, b1, c1, d1;
+ int16_t tmp[16];
+
+ for (i = 0; i < 4; i++) {
+ a1 = (dc[i * 4 + 0] + dc[i * 4 + 2]) * 23170;
+ b1 = (dc[i * 4 + 0] - dc[i * 4 + 2]) * 23170;
+ c1 = dc[i * 4 + 1] * 12540 - dc[i * 4 + 3] * 30274;
+ d1 = dc[i * 4 + 1] * 30274 + dc[i * 4 + 3] * 12540;
+ tmp[i * 4 + 0] = (a1 + d1) >> 14;
+ tmp[i * 4 + 3] = (a1 - d1) >> 14;
+ tmp[i * 4 + 1] = (b1 + c1) >> 14;
+ tmp[i * 4 + 2] = (b1 - c1) >> 14;
+ }
+
+ for (i = 0; i < 4; i++) {
+ a1 = (tmp[i + 0] + tmp[i + 8]) * 23170;
+ b1 = (tmp[i + 0] - tmp[i + 8]) * 23170;
+ c1 = tmp[i + 4] * 12540 - tmp[i + 12] * 30274;
+ d1 = tmp[i + 4] * 30274 + tmp[i + 12] * 12540;
+ AV_ZERO64(dc + i * 4);
+ block[0][i][0] = (a1 + d1 + 0x20000) >> 18;
+ block[3][i][0] = (a1 - d1 + 0x20000) >> 18;
+ block[1][i][0] = (b1 + c1 + 0x20000) >> 18;
+ block[2][i][0] = (b1 - c1 + 0x20000) >> 18;
+ }
+}
+
+static void vp7_luma_dc_wht_dc_c(int16_t block[4][4][16], int16_t dc[16])
+{
+ int i, val = (23170 * (23170 * dc[0] >> 14) + 0x20000) >> 18;
+ dc[0] = 0;
+
+ for (i = 0; i < 4; i++) {
+ block[i][0][0] = val;
+ block[i][1][0] = val;
+ block[i][2][0] = val;
+ block[i][3][0] = val;
+ }
+}
+
+static void vp7_idct_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride)
+{
+ int i, a1, b1, c1, d1;
+ int16_t tmp[16];
+
+ for (i = 0; i < 4; i++) {
+ a1 = (block[i * 4 + 0] + block[i * 4 + 2]) * 23170;
+ b1 = (block[i * 4 + 0] - block[i * 4 + 2]) * 23170;
+ c1 = block[i * 4 + 1] * 12540 - block[i * 4 + 3] * 30274;
+ d1 = block[i * 4 + 1] * 30274 + block[i * 4 + 3] * 12540;
+ AV_ZERO64(block + i * 4);
+ tmp[i * 4 + 0] = (a1 + d1) >> 14;
+ tmp[i * 4 + 3] = (a1 - d1) >> 14;
+ tmp[i * 4 + 1] = (b1 + c1) >> 14;
+ tmp[i * 4 + 2] = (b1 - c1) >> 14;
+ }
+
+ for (i = 0; i < 4; i++) {
+ a1 = (tmp[i + 0] + tmp[i + 8]) * 23170;
+ b1 = (tmp[i + 0] - tmp[i + 8]) * 23170;
+ c1 = tmp[i + 4] * 12540 - tmp[i + 12] * 30274;
+ d1 = tmp[i + 4] * 30274 + tmp[i + 12] * 12540;
+ dst[0 * stride + i] = av_clip_uint8(dst[0 * stride + i] +
+ ((a1 + d1 + 0x20000) >> 18));
+ dst[3 * stride + i] = av_clip_uint8(dst[3 * stride + i] +
+ ((a1 - d1 + 0x20000) >> 18));
+ dst[1 * stride + i] = av_clip_uint8(dst[1 * stride + i] +
+ ((b1 + c1 + 0x20000) >> 18));
+ dst[2 * stride + i] = av_clip_uint8(dst[2 * stride + i] +
+ ((b1 - c1 + 0x20000) >> 18));
+ }
+}
+
+static void vp7_idct_dc_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride)
+{
+ int i, dc = (23170 * (23170 * block[0] >> 14) + 0x20000) >> 18;
+ block[0] = 0;
+
+ for (i = 0; i < 4; i++) {
+ dst[0] = av_clip_uint8(dst[0] + dc);
+ dst[1] = av_clip_uint8(dst[1] + dc);
+ dst[2] = av_clip_uint8(dst[2] + dc);
+ dst[3] = av_clip_uint8(dst[3] + dc);
+ dst += stride;
+ }
+}
+
+MK_IDCT_DC_ADD4_C(vp7)
+#endif /* CONFIG_VP7_DECODER */
// TODO: Maybe add dequant
+#if CONFIG_VP8_DECODER
static void vp8_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16])
{
int i, t0, t1, t2, t3;
for (i = 0; i < 4; i++) {
- t0 = dc[0*4+i] + dc[3*4+i];
- t1 = dc[1*4+i] + dc[2*4+i];
- t2 = dc[1*4+i] - dc[2*4+i];
- t3 = dc[0*4+i] - dc[3*4+i];
-
- dc[0*4+i] = t0 + t1;
- dc[1*4+i] = t3 + t2;
- dc[2*4+i] = t0 - t1;
- dc[3*4+i] = t3 - t2;
+ t0 = dc[0 * 4 + i] + dc[3 * 4 + i];
+ t1 = dc[1 * 4 + i] + dc[2 * 4 + i];
+ t2 = dc[1 * 4 + i] - dc[2 * 4 + i];
+ t3 = dc[0 * 4 + i] - dc[3 * 4 + i];
+
+ dc[0 * 4 + i] = t0 + t1;
+ dc[1 * 4 + i] = t3 + t2;
+ dc[2 * 4 + i] = t0 - t1;
+ dc[3 * 4 + i] = t3 - t2;
}
for (i = 0; i < 4; i++) {
- t0 = dc[i*4+0] + dc[i*4+3] + 3; // rounding
- t1 = dc[i*4+1] + dc[i*4+2];
- t2 = dc[i*4+1] - dc[i*4+2];
- t3 = dc[i*4+0] - dc[i*4+3] + 3; // rounding
- dc[i*4+0] = 0;
- dc[i*4+1] = 0;
- dc[i*4+2] = 0;
- dc[i*4+3] = 0;
+ t0 = dc[i * 4 + 0] + dc[i * 4 + 3] + 3; // rounding
+ t1 = dc[i * 4 + 1] + dc[i * 4 + 2];
+ t2 = dc[i * 4 + 1] - dc[i * 4 + 2];
+ t3 = dc[i * 4 + 0] - dc[i * 4 + 3] + 3; // rounding
+ AV_ZERO64(dc + i * 4);
block[i][0][0] = (t0 + t1) >> 3;
block[i][1][0] = (t3 + t2) >> 3;
@@ -75,8 +188,8 @@ static void vp8_luma_dc_wht_dc_c(int16_t block[4][4][16], int16_t dc[16])
}
}
-#define MUL_20091(a) ((((a)*20091) >> 16) + (a))
-#define MUL_35468(a) (((a)*35468) >> 16)
+#define MUL_20091(a) ((((a) * 20091) >> 16) + (a))
+#define MUL_35468(a) (((a) * 35468) >> 16)
static void vp8_idct_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride)
{
@@ -84,32 +197,32 @@ static void vp8_idct_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride)
int16_t tmp[16];
for (i = 0; i < 4; i++) {
- t0 = block[0*4+i] + block[2*4+i];
- t1 = block[0*4+i] - block[2*4+i];
- t2 = MUL_35468(block[1*4+i]) - MUL_20091(block[3*4+i]);
- t3 = MUL_20091(block[1*4+i]) + MUL_35468(block[3*4+i]);
- block[0*4+i] = 0;
- block[1*4+i] = 0;
- block[2*4+i] = 0;
- block[3*4+i] = 0;
-
- tmp[i*4+0] = t0 + t3;
- tmp[i*4+1] = t1 + t2;
- tmp[i*4+2] = t1 - t2;
- tmp[i*4+3] = t0 - t3;
+ t0 = block[0 * 4 + i] + block[2 * 4 + i];
+ t1 = block[0 * 4 + i] - block[2 * 4 + i];
+ t2 = MUL_35468(block[1 * 4 + i]) - MUL_20091(block[3 * 4 + i]);
+ t3 = MUL_20091(block[1 * 4 + i]) + MUL_35468(block[3 * 4 + i]);
+ block[0 * 4 + i] = 0;
+ block[1 * 4 + i] = 0;
+ block[2 * 4 + i] = 0;
+ block[3 * 4 + i] = 0;
+
+ tmp[i * 4 + 0] = t0 + t3;
+ tmp[i * 4 + 1] = t1 + t2;
+ tmp[i * 4 + 2] = t1 - t2;
+ tmp[i * 4 + 3] = t0 - t3;
}
for (i = 0; i < 4; i++) {
- t0 = tmp[0*4+i] + tmp[2*4+i];
- t1 = tmp[0*4+i] - tmp[2*4+i];
- t2 = MUL_35468(tmp[1*4+i]) - MUL_20091(tmp[3*4+i]);
- t3 = MUL_20091(tmp[1*4+i]) + MUL_35468(tmp[3*4+i]);
+ t0 = tmp[0 * 4 + i] + tmp[2 * 4 + i];
+ t1 = tmp[0 * 4 + i] - tmp[2 * 4 + i];
+ t2 = MUL_35468(tmp[1 * 4 + i]) - MUL_20091(tmp[3 * 4 + i]);
+ t3 = MUL_20091(tmp[1 * 4 + i]) + MUL_35468(tmp[3 * 4 + i]);
dst[0] = av_clip_uint8(dst[0] + ((t0 + t3 + 4) >> 3));
dst[1] = av_clip_uint8(dst[1] + ((t1 + t2 + 4) >> 3));
dst[2] = av_clip_uint8(dst[2] + ((t1 - t2 + 4) >> 3));
dst[3] = av_clip_uint8(dst[3] + ((t0 - t3 + 4) >> 3));
- dst += stride;
+ dst += stride;
}
}
@@ -123,46 +236,34 @@ static void vp8_idct_dc_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride)
dst[1] = av_clip_uint8(dst[1] + dc);
dst[2] = av_clip_uint8(dst[2] + dc);
dst[3] = av_clip_uint8(dst[3] + dc);
- dst += stride;
+ dst += stride;
}
}
-static void vp8_idct_dc_add4uv_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride)
-{
- vp8_idct_dc_add_c(dst+stride*0+0, block[0], stride);
- vp8_idct_dc_add_c(dst+stride*0+4, block[1], stride);
- vp8_idct_dc_add_c(dst+stride*4+0, block[2], stride);
- vp8_idct_dc_add_c(dst+stride*4+4, block[3], stride);
-}
-
-static void vp8_idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride)
-{
- vp8_idct_dc_add_c(dst+ 0, block[0], stride);
- vp8_idct_dc_add_c(dst+ 4, block[1], stride);
- vp8_idct_dc_add_c(dst+ 8, block[2], stride);
- vp8_idct_dc_add_c(dst+12, block[3], stride);
-}
+MK_IDCT_DC_ADD4_C(vp8)
+#endif /* CONFIG_VP8_DECODER */
// because I like only having two parameters to pass functions...
-#define LOAD_PIXELS\
- int av_unused p3 = p[-4*stride];\
- int av_unused p2 = p[-3*stride];\
- int av_unused p1 = p[-2*stride];\
- int av_unused p0 = p[-1*stride];\
- int av_unused q0 = p[ 0*stride];\
- int av_unused q1 = p[ 1*stride];\
- int av_unused q2 = p[ 2*stride];\
- int av_unused q3 = p[ 3*stride];
-
-#define clip_int8(n) (cm[n+0x80]-0x80)
-
-static av_always_inline void filter_common(uint8_t *p, ptrdiff_t stride, int is4tap)
+#define LOAD_PIXELS \
+ int av_unused p3 = p[-4 * stride]; \
+ int av_unused p2 = p[-3 * stride]; \
+ int av_unused p1 = p[-2 * stride]; \
+ int av_unused p0 = p[-1 * stride]; \
+ int av_unused q0 = p[ 0 * stride]; \
+ int av_unused q1 = p[ 1 * stride]; \
+ int av_unused q2 = p[ 2 * stride]; \
+ int av_unused q3 = p[ 3 * stride];
+
+#define clip_int8(n) (cm[n + 0x80] - 0x80)
+
+static av_always_inline void filter_common(uint8_t *p, ptrdiff_t stride,
+ int is4tap, int is_vp7)
{
LOAD_PIXELS
int a, f1, f2;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
- a = 3*(q0 - p0);
+ a = 3 * (q0 - p0);
if (is4tap)
a += clip_int8(p1 - q1);
@@ -171,222 +272,286 @@ static av_always_inline void filter_common(uint8_t *p, ptrdiff_t stride, int is4
// We deviate from the spec here with c(a+3) >> 3
// since that's what libvpx does.
- f1 = FFMIN(a+4, 127) >> 3;
- f2 = FFMIN(a+3, 127) >> 3;
+ f1 = FFMIN(a + 4, 127) >> 3;
+
+ if (is_vp7)
+ f2 = f1 - ((a & 7) == 4);
+ else
+ f2 = FFMIN(a + 3, 127) >> 3;
// Despite what the spec says, we do need to clamp here to
// be bitexact with libvpx.
- p[-1*stride] = cm[p0 + f2];
- p[ 0*stride] = cm[q0 - f1];
+ p[-1 * stride] = cm[p0 + f2];
+ p[ 0 * stride] = cm[q0 - f1];
// only used for _inner on blocks without high edge variance
if (!is4tap) {
- a = (f1+1)>>1;
- p[-2*stride] = cm[p1 + a];
- p[ 1*stride] = cm[q1 - a];
+ a = (f1 + 1) >> 1;
+ p[-2 * stride] = cm[p1 + a];
+ p[ 1 * stride] = cm[q1 - a];
}
}
-static av_always_inline int simple_limit(uint8_t *p, ptrdiff_t stride, int flim)
+static av_always_inline void vp7_filter_common(uint8_t *p, ptrdiff_t stride,
+ int is4tap)
+{
+ filter_common(p, stride, is4tap, IS_VP7);
+}
+
+static av_always_inline void vp8_filter_common(uint8_t *p, ptrdiff_t stride,
+ int is4tap)
+{
+ filter_common(p, stride, is4tap, IS_VP8);
+}
+
+static av_always_inline int vp7_simple_limit(uint8_t *p, ptrdiff_t stride,
+ int flim)
+{
+ LOAD_PIXELS
+ return FFABS(p0 - q0) <= flim;
+}
+
+static av_always_inline int vp8_simple_limit(uint8_t *p, ptrdiff_t stride,
+ int flim)
{
LOAD_PIXELS
- return 2*FFABS(p0-q0) + (FFABS(p1-q1) >> 1) <= flim;
+ return 2 * FFABS(p0 - q0) + (FFABS(p1 - q1) >> 1) <= flim;
}
/**
* E - limit at the macroblock edge
* I - limit for interior difference
*/
-static av_always_inline int normal_limit(uint8_t *p, ptrdiff_t stride, int E, int I)
-{
- LOAD_PIXELS
- return simple_limit(p, stride, E)
- && FFABS(p3-p2) <= I && FFABS(p2-p1) <= I && FFABS(p1-p0) <= I
- && FFABS(q3-q2) <= I && FFABS(q2-q1) <= I && FFABS(q1-q0) <= I;
+#define NORMAL_LIMIT(vpn) \
+static av_always_inline int vp ## vpn ## _normal_limit(uint8_t *p, \
+ ptrdiff_t stride, \
+ int E, int I) \
+{ \
+ LOAD_PIXELS \
+ return vp ## vpn ## _simple_limit(p, stride, E) && \
+ FFABS(p3 - p2) <= I && FFABS(p2 - p1) <= I && \
+ FFABS(p1 - p0) <= I && FFABS(q3 - q2) <= I && \
+ FFABS(q2 - q1) <= I && FFABS(q1 - q0) <= I; \
}
+NORMAL_LIMIT(7)
+NORMAL_LIMIT(8)
+
// high edge variance
static av_always_inline int hev(uint8_t *p, ptrdiff_t stride, int thresh)
{
LOAD_PIXELS
- return FFABS(p1-p0) > thresh || FFABS(q1-q0) > thresh;
+ return FFABS(p1 - p0) > thresh || FFABS(q1 - q0) > thresh;
}
static av_always_inline void filter_mbedge(uint8_t *p, ptrdiff_t stride)
{
int a0, a1, a2, w;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
LOAD_PIXELS
- w = clip_int8(p1-q1);
- w = clip_int8(w + 3*(q0-p0));
+ w = clip_int8(p1 - q1);
+ w = clip_int8(w + 3 * (q0 - p0));
- a0 = (27*w + 63) >> 7;
- a1 = (18*w + 63) >> 7;
- a2 = ( 9*w + 63) >> 7;
+ a0 = (27 * w + 63) >> 7;
+ a1 = (18 * w + 63) >> 7;
+ a2 = (9 * w + 63) >> 7;
- p[-3*stride] = cm[p2 + a2];
- p[-2*stride] = cm[p1 + a1];
- p[-1*stride] = cm[p0 + a0];
- p[ 0*stride] = cm[q0 - a0];
- p[ 1*stride] = cm[q1 - a1];
- p[ 2*stride] = cm[q2 - a2];
+ p[-3 * stride] = cm[p2 + a2];
+ p[-2 * stride] = cm[p1 + a1];
+ p[-1 * stride] = cm[p0 + a0];
+ p[ 0 * stride] = cm[q0 - a0];
+ p[ 1 * stride] = cm[q1 - a1];
+ p[ 2 * stride] = cm[q2 - a2];
}
-#define LOOP_FILTER(dir, size, stridea, strideb, maybe_inline) \
-static maybe_inline void vp8_ ## dir ## _loop_filter ## size ## _c(uint8_t *dst, ptrdiff_t stride,\
- int flim_E, int flim_I, int hev_thresh)\
-{\
- int i;\
-\
- for (i = 0; i < size; i++)\
- if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\
- if (hev(dst+i*stridea, strideb, hev_thresh))\
- filter_common(dst+i*stridea, strideb, 1);\
- else\
- filter_mbedge(dst+i*stridea, strideb);\
- }\
-}\
-\
-static maybe_inline void vp8_ ## dir ## _loop_filter ## size ## _inner_c(uint8_t *dst, ptrdiff_t stride,\
- int flim_E, int flim_I, int hev_thresh)\
-{\
- int i;\
-\
- for (i = 0; i < size; i++)\
- if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\
- int hv = hev(dst+i*stridea, strideb, hev_thresh);\
- if (hv) \
- filter_common(dst+i*stridea, strideb, 1);\
- else \
- filter_common(dst+i*stridea, strideb, 0);\
- }\
+#define LOOP_FILTER(vpn, dir, size, stridea, strideb, maybe_inline) \
+static maybe_inline \
+void vpn ## _ ## dir ## _loop_filter ## size ## _c(uint8_t *dst, \
+ ptrdiff_t stride, \
+ int flim_E, int flim_I, \
+ int hev_thresh) \
+{ \
+ int i; \
+ for (i = 0; i < size; i++) \
+ if (vpn ## _normal_limit(dst + i * stridea, strideb, \
+ flim_E, flim_I)) { \
+ if (hev(dst + i * stridea, strideb, hev_thresh)) \
+ vpn ## _filter_common(dst + i * stridea, strideb, 1); \
+ else \
+ filter_mbedge(dst + i * stridea, strideb); \
+ } \
+} \
+ \
+static maybe_inline \
+void vpn ## _ ## dir ## _loop_filter ## size ## _inner_c(uint8_t *dst, \
+ ptrdiff_t stride, \
+ int flim_E, \
+ int flim_I, \
+ int hev_thresh) \
+{ \
+ int i; \
+ for (i = 0; i < size; i++) \
+ if (vpn ## _normal_limit(dst + i * stridea, strideb, \
+ flim_E, flim_I)) { \
+ int hv = hev(dst + i * stridea, strideb, hev_thresh); \
+ if (hv) \
+ vpn ## _filter_common(dst + i * stridea, strideb, 1); \
+ else \
+ vpn ## _filter_common(dst + i * stridea, strideb, 0); \
+ } \
}
-LOOP_FILTER(v, 16, 1, stride,)
-LOOP_FILTER(h, 16, stride, 1,)
-
-#define UV_LOOP_FILTER(dir, stridea, strideb) \
-LOOP_FILTER(dir, 8, stridea, strideb, av_always_inline) \
-static void vp8_ ## dir ## _loop_filter8uv_c(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride,\
- int fE, int fI, int hev_thresh)\
-{\
- vp8_ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh);\
- vp8_ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh);\
-}\
-static void vp8_ ## dir ## _loop_filter8uv_inner_c(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride,\
- int fE, int fI, int hev_thresh)\
-{\
- vp8_ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, hev_thresh);\
- vp8_ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, hev_thresh);\
+#define UV_LOOP_FILTER(vpn, dir, stridea, strideb) \
+LOOP_FILTER(vpn, dir, 8, stridea, strideb, av_always_inline) \
+static void vpn ## _ ## dir ## _loop_filter8uv_c(uint8_t *dstU, \
+ uint8_t *dstV, \
+ ptrdiff_t stride, int fE, \
+ int fI, int hev_thresh) \
+{ \
+ vpn ## _ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh); \
+ vpn ## _ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh); \
+} \
+ \
+static void vpn ## _ ## dir ## _loop_filter8uv_inner_c(uint8_t *dstU, \
+ uint8_t *dstV, \
+ ptrdiff_t stride, \
+ int fE, int fI, \
+ int hev_thresh) \
+{ \
+ vpn ## _ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, \
+ hev_thresh); \
+ vpn ## _ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, \
+ hev_thresh); \
}
-UV_LOOP_FILTER(v, 1, stride)
-UV_LOOP_FILTER(h, stride, 1)
-
-static void vp8_v_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, int flim)
-{
- int i;
-
- for (i = 0; i < 16; i++)
- if (simple_limit(dst+i, stride, flim))
- filter_common(dst+i, stride, 1);
+#define LOOP_FILTER_SIMPLE(vpn) \
+static void vpn ## _v_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \
+ int flim) \
+{ \
+ int i; \
+ for (i = 0; i < 16; i++) \
+ if (vpn ## _simple_limit(dst + i, stride, flim)) \
+ vpn ## _filter_common(dst + i, stride, 1); \
+} \
+ \
+static void vpn ## _h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \
+ int flim) \
+{ \
+ int i; \
+ for (i = 0; i < 16; i++) \
+ if (vpn ## _simple_limit(dst + i * stride, 1, flim)) \
+ vpn ## _filter_common(dst + i * stride, 1, 1); \
}
-static void vp8_h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, int flim)
-{
- int i;
-
- for (i = 0; i < 16; i++)
- if (simple_limit(dst+i*stride, 1, flim))
- filter_common(dst+i*stride, 1, 1);
-}
+#define LOOP_FILTERS(vpn) \
+ LOOP_FILTER(vpn, v, 16, 1, stride, ) \
+ LOOP_FILTER(vpn, h, 16, stride, 1, ) \
+ UV_LOOP_FILTER(vpn, v, 1, stride) \
+ UV_LOOP_FILTER(vpn, h, stride, 1) \
+ LOOP_FILTER_SIMPLE(vpn) \
static const uint8_t subpel_filters[7][6] = {
- { 0, 6, 123, 12, 1, 0 },
- { 2, 11, 108, 36, 8, 1 },
- { 0, 9, 93, 50, 6, 0 },
- { 3, 16, 77, 77, 16, 3 },
- { 0, 6, 50, 93, 9, 0 },
- { 1, 8, 36, 108, 11, 2 },
- { 0, 1, 12, 123, 6, 0 },
+ { 0, 6, 123, 12, 1, 0 },
+ { 2, 11, 108, 36, 8, 1 },
+ { 0, 9, 93, 50, 6, 0 },
+ { 3, 16, 77, 77, 16, 3 },
+ { 0, 6, 50, 93, 9, 0 },
+ { 1, 8, 36, 108, 11, 2 },
+ { 0, 1, 12, 123, 6, 0 },
};
-#define PUT_PIXELS(WIDTH) \
-static void put_vp8_pixels ## WIDTH ##_c(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, int h, int x, int y) { \
- int i; \
- for (i = 0; i < h; i++, dst+= dststride, src+= srcstride) { \
- memcpy(dst, src, WIDTH); \
- } \
+#define PUT_PIXELS(WIDTH) \
+static void put_vp8_pixels ## WIDTH ## _c(uint8_t *dst, ptrdiff_t dststride, \
+ uint8_t *src, ptrdiff_t srcstride, \
+ int h, int x, int y) \
+{ \
+ int i; \
+ for (i = 0; i < h; i++, dst += dststride, src += srcstride) \
+ memcpy(dst, src, WIDTH); \
}
PUT_PIXELS(16)
PUT_PIXELS(8)
PUT_PIXELS(4)
-#define FILTER_6TAP(src, F, stride) \
- cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + F[0]*src[x-2*stride] + \
- F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + F[5]*src[x+3*stride] + 64) >> 7]
-
-#define FILTER_4TAP(src, F, stride) \
- cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + \
- F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + 64) >> 7]
-
-#define VP8_EPEL_H(SIZE, TAPS) \
-static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) \
-{ \
- const uint8_t *filter = subpel_filters[mx-1]; \
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
- int x, y; \
-\
- for (y = 0; y < h; y++) { \
- for (x = 0; x < SIZE; x++) \
- dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \
- dst += dststride; \
- src += srcstride; \
- } \
+#define FILTER_6TAP(src, F, stride) \
+ cm[(F[2] * src[x + 0 * stride] - F[1] * src[x - 1 * stride] + \
+ F[0] * src[x - 2 * stride] + F[3] * src[x + 1 * stride] - \
+ F[4] * src[x + 2 * stride] + F[5] * src[x + 3 * stride] + 64) >> 7]
+
+#define FILTER_4TAP(src, F, stride) \
+ cm[(F[2] * src[x + 0 * stride] - F[1] * src[x - 1 * stride] + \
+ F[3] * src[x + 1 * stride] - F[4] * src[x + 2 * stride] + 64) >> 7]
+
+#define VP8_EPEL_H(SIZE, TAPS) \
+static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, \
+ ptrdiff_t dststride, \
+ uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ const uint8_t *filter = subpel_filters[mx - 1]; \
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
+ int x, y; \
+ for (y = 0; y < h; y++) { \
+ for (x = 0; x < SIZE; x++) \
+ dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \
+ dst += dststride; \
+ src += srcstride; \
+ } \
}
-#define VP8_EPEL_V(SIZE, TAPS) \
-static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) \
-{ \
- const uint8_t *filter = subpel_filters[my-1]; \
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
- int x, y; \
-\
- for (y = 0; y < h; y++) { \
- for (x = 0; x < SIZE; x++) \
- dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \
- dst += dststride; \
- src += srcstride; \
- } \
+
+#define VP8_EPEL_V(SIZE, TAPS) \
+static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, \
+ ptrdiff_t dststride, \
+ uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ const uint8_t *filter = subpel_filters[my - 1]; \
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
+ int x, y; \
+ for (y = 0; y < h; y++) { \
+ for (x = 0; x < SIZE; x++) \
+ dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \
+ dst += dststride; \
+ src += srcstride; \
+ } \
}
-#define VP8_EPEL_HV(SIZE, HTAPS, VTAPS) \
-static void put_vp8_epel ## SIZE ## _h ## HTAPS ## v ## VTAPS ## _c(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) \
-{ \
- const uint8_t *filter = subpel_filters[mx-1]; \
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
- int x, y; \
- uint8_t tmp_array[(2*SIZE+VTAPS-1)*SIZE]; \
- uint8_t *tmp = tmp_array; \
- src -= (2-(VTAPS==4))*srcstride; \
-\
- for (y = 0; y < h+VTAPS-1; y++) { \
- for (x = 0; x < SIZE; x++) \
- tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \
- tmp += SIZE; \
- src += srcstride; \
- } \
-\
- tmp = tmp_array + (2-(VTAPS==4))*SIZE; \
- filter = subpel_filters[my-1]; \
-\
- for (y = 0; y < h; y++) { \
- for (x = 0; x < SIZE; x++) \
- dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \
- dst += dststride; \
- tmp += SIZE; \
- } \
+
+#define VP8_EPEL_HV(SIZE, HTAPS, VTAPS) \
+static void \
+put_vp8_epel ## SIZE ## _h ## HTAPS ## v ## VTAPS ## _c(uint8_t *dst, \
+ ptrdiff_t dststride, \
+ uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, \
+ int my) \
+{ \
+ const uint8_t *filter = subpel_filters[mx - 1]; \
+ const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
+ int x, y; \
+ uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \
+ uint8_t *tmp = tmp_array; \
+ src -= (2 - (VTAPS == 4)) * srcstride; \
+ \
+ for (y = 0; y < h + VTAPS - 1; y++) { \
+ for (x = 0; x < SIZE; x++) \
+ tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \
+ tmp += SIZE; \
+ src += srcstride; \
+ } \
+ tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \
+ filter = subpel_filters[my - 1]; \
+ \
+ for (y = 0; y < h; y++) { \
+ for (x = 0; x < SIZE; x++) \
+ dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \
+ dst += dststride; \
+ tmp += SIZE; \
+ } \
}
VP8_EPEL_H(16, 4)
@@ -401,6 +566,7 @@ VP8_EPEL_V(4, 4)
VP8_EPEL_V(16, 6)
VP8_EPEL_V(8, 6)
VP8_EPEL_V(4, 6)
+
VP8_EPEL_HV(16, 4, 4)
VP8_EPEL_HV(8, 4, 4)
VP8_EPEL_HV(4, 4, 4)
@@ -414,74 +580,78 @@ VP8_EPEL_HV(16, 6, 6)
VP8_EPEL_HV(8, 6, 6)
VP8_EPEL_HV(4, 6, 6)
-#define VP8_BILINEAR(SIZE) \
-static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \
-{ \
- int a = 8-mx, b = mx; \
- int x, y; \
-\
- for (y = 0; y < h; y++) { \
- for (x = 0; x < SIZE; x++) \
- dst[x] = (a*src[x] + b*src[x+1] + 4) >> 3; \
- dst += dstride; \
- src += sstride; \
- } \
-} \
-static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \
-{ \
- int c = 8-my, d = my; \
- int x, y; \
-\
- for (y = 0; y < h; y++) { \
- for (x = 0; x < SIZE; x++) \
- dst[x] = (c*src[x] + d*src[x+sstride] + 4) >> 3; \
- dst += dstride; \
- src += sstride; \
- } \
-} \
-\
-static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \
-{ \
- int a = 8-mx, b = mx; \
- int c = 8-my, d = my; \
- int x, y; \
- uint8_t tmp_array[(2*SIZE+1)*SIZE]; \
- uint8_t *tmp = tmp_array; \
-\
- for (y = 0; y < h+1; y++) { \
- for (x = 0; x < SIZE; x++) \
- tmp[x] = (a*src[x] + b*src[x+1] + 4) >> 3; \
- tmp += SIZE; \
- src += sstride; \
- } \
-\
- tmp = tmp_array; \
-\
- for (y = 0; y < h; y++) { \
- for (x = 0; x < SIZE; x++) \
- dst[x] = (c*tmp[x] + d*tmp[x+SIZE] + 4) >> 3; \
- dst += dstride; \
- tmp += SIZE; \
- } \
+#define VP8_BILINEAR(SIZE) \
+static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, ptrdiff_t dstride, \
+ uint8_t *src, ptrdiff_t sstride, \
+ int h, int mx, int my) \
+{ \
+ int a = 8 - mx, b = mx; \
+ int x, y; \
+ for (y = 0; y < h; y++) { \
+ for (x = 0; x < SIZE; x++) \
+ dst[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \
+ dst += dstride; \
+ src += sstride; \
+ } \
+} \
+ \
+static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, ptrdiff_t dstride, \
+ uint8_t *src, ptrdiff_t sstride, \
+ int h, int mx, int my) \
+{ \
+ int c = 8 - my, d = my; \
+ int x, y; \
+ for (y = 0; y < h; y++) { \
+ for (x = 0; x < SIZE; x++) \
+ dst[x] = (c * src[x] + d * src[x + sstride] + 4) >> 3; \
+ dst += dstride; \
+ src += sstride; \
+ } \
+} \
+ \
+static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, \
+ ptrdiff_t dstride, \
+ uint8_t *src, \
+ ptrdiff_t sstride, \
+ int h, int mx, int my) \
+{ \
+ int a = 8 - mx, b = mx; \
+ int c = 8 - my, d = my; \
+ int x, y; \
+ uint8_t tmp_array[(2 * SIZE + 1) * SIZE]; \
+ uint8_t *tmp = tmp_array; \
+ for (y = 0; y < h + 1; y++) { \
+ for (x = 0; x < SIZE; x++) \
+ tmp[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \
+ tmp += SIZE; \
+ src += sstride; \
+ } \
+ tmp = tmp_array; \
+ for (y = 0; y < h; y++) { \
+ for (x = 0; x < SIZE; x++) \
+ dst[x] = (c * tmp[x] + d * tmp[x + SIZE] + 4) >> 3; \
+ dst += dstride; \
+ tmp += SIZE; \
+ } \
}
VP8_BILINEAR(16)
VP8_BILINEAR(8)
VP8_BILINEAR(4)
-#define VP8_MC_FUNC(IDX, SIZE) \
- dsp->put_vp8_epel_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
- dsp->put_vp8_epel_pixels_tab[IDX][0][1] = put_vp8_epel ## SIZE ## _h4_c; \
- dsp->put_vp8_epel_pixels_tab[IDX][0][2] = put_vp8_epel ## SIZE ## _h6_c; \
- dsp->put_vp8_epel_pixels_tab[IDX][1][0] = put_vp8_epel ## SIZE ## _v4_c; \
+#define VP78_MC_FUNC(IDX, SIZE) \
+ dsp->put_vp8_epel_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
+ dsp->put_vp8_epel_pixels_tab[IDX][0][1] = put_vp8_epel ## SIZE ## _h4_c; \
+ dsp->put_vp8_epel_pixels_tab[IDX][0][2] = put_vp8_epel ## SIZE ## _h6_c; \
+ dsp->put_vp8_epel_pixels_tab[IDX][1][0] = put_vp8_epel ## SIZE ## _v4_c; \
dsp->put_vp8_epel_pixels_tab[IDX][1][1] = put_vp8_epel ## SIZE ## _h4v4_c; \
dsp->put_vp8_epel_pixels_tab[IDX][1][2] = put_vp8_epel ## SIZE ## _h6v4_c; \
- dsp->put_vp8_epel_pixels_tab[IDX][2][0] = put_vp8_epel ## SIZE ## _v6_c; \
+ dsp->put_vp8_epel_pixels_tab[IDX][2][0] = put_vp8_epel ## SIZE ## _v6_c; \
dsp->put_vp8_epel_pixels_tab[IDX][2][1] = put_vp8_epel ## SIZE ## _h4v6_c; \
dsp->put_vp8_epel_pixels_tab[IDX][2][2] = put_vp8_epel ## SIZE ## _h6v6_c
-#define VP8_BILINEAR_MC_FUNC(IDX, SIZE) \
- dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
+#define VP78_BILINEAR_MC_FUNC(IDX, SIZE) \
+ dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][0][1] = put_vp8_bilinear ## SIZE ## _h_c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][0][2] = put_vp8_bilinear ## SIZE ## _h_c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][1][0] = put_vp8_bilinear ## SIZE ## _v_c; \
@@ -491,6 +661,54 @@ VP8_BILINEAR(4)
dsp->put_vp8_bilinear_pixels_tab[IDX][2][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][2][2] = put_vp8_bilinear ## SIZE ## _hv_c
+av_cold void ff_vp78dsp_init(VP8DSPContext *dsp)
+{
+ VP78_MC_FUNC(0, 16);
+ VP78_MC_FUNC(1, 8);
+ VP78_MC_FUNC(2, 4);
+
+ VP78_BILINEAR_MC_FUNC(0, 16);
+ VP78_BILINEAR_MC_FUNC(1, 8);
+ VP78_BILINEAR_MC_FUNC(2, 4);
+
+ if (ARCH_ARM)
+ ff_vp78dsp_init_arm(dsp);
+ if (ARCH_PPC)
+ ff_vp78dsp_init_ppc(dsp);
+ if (ARCH_X86)
+ ff_vp78dsp_init_x86(dsp);
+}
+
+#if CONFIG_VP7_DECODER
+LOOP_FILTERS(vp7)
+
+av_cold void ff_vp7dsp_init(VP8DSPContext *dsp)
+{
+ dsp->vp8_luma_dc_wht = vp7_luma_dc_wht_c;
+ dsp->vp8_luma_dc_wht_dc = vp7_luma_dc_wht_dc_c;
+ dsp->vp8_idct_add = vp7_idct_add_c;
+ dsp->vp8_idct_dc_add = vp7_idct_dc_add_c;
+ dsp->vp8_idct_dc_add4y = vp7_idct_dc_add4y_c;
+ dsp->vp8_idct_dc_add4uv = vp7_idct_dc_add4uv_c;
+
+ dsp->vp8_v_loop_filter16y = vp7_v_loop_filter16_c;
+ dsp->vp8_h_loop_filter16y = vp7_h_loop_filter16_c;
+ dsp->vp8_v_loop_filter8uv = vp7_v_loop_filter8uv_c;
+ dsp->vp8_h_loop_filter8uv = vp7_h_loop_filter8uv_c;
+
+ dsp->vp8_v_loop_filter16y_inner = vp7_v_loop_filter16_inner_c;
+ dsp->vp8_h_loop_filter16y_inner = vp7_h_loop_filter16_inner_c;
+ dsp->vp8_v_loop_filter8uv_inner = vp7_v_loop_filter8uv_inner_c;
+ dsp->vp8_h_loop_filter8uv_inner = vp7_h_loop_filter8uv_inner_c;
+
+ dsp->vp8_v_loop_filter_simple = vp7_v_loop_filter_simple_c;
+ dsp->vp8_h_loop_filter_simple = vp7_h_loop_filter_simple_c;
+}
+#endif /* CONFIG_VP7_DECODER */
+
+#if CONFIG_VP8_DECODER
+LOOP_FILTERS(vp8)
+
av_cold void ff_vp8dsp_init(VP8DSPContext *dsp)
{
dsp->vp8_luma_dc_wht = vp8_luma_dc_wht_c;
@@ -513,18 +731,9 @@ av_cold void ff_vp8dsp_init(VP8DSPContext *dsp)
dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c;
dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c;
- VP8_MC_FUNC(0, 16);
- VP8_MC_FUNC(1, 8);
- VP8_MC_FUNC(2, 4);
-
- VP8_BILINEAR_MC_FUNC(0, 16);
- VP8_BILINEAR_MC_FUNC(1, 8);
- VP8_BILINEAR_MC_FUNC(2, 4);
-
if (ARCH_ARM)
ff_vp8dsp_init_arm(dsp);
- if (ARCH_PPC)
- ff_vp8dsp_init_ppc(dsp);
if (ARCH_X86)
ff_vp8dsp_init_x86(dsp);
}
+#endif /* CONFIG_VP8_DECODER */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp8dsp.h b/chromium/third_party/ffmpeg/libavcodec/vp8dsp.h
index 58ec65a5688..5fdd3af70da 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp8dsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vp8dsp.h
@@ -30,8 +30,8 @@
#include <stddef.h>
#include <stdint.h>
-typedef void (*vp8_mc_func)(uint8_t *dst/*align 8*/, ptrdiff_t dstStride,
- uint8_t *src/*align 1*/, ptrdiff_t srcStride,
+typedef void (*vp8_mc_func)(uint8_t *dst /* align 8 */, ptrdiff_t dstStride,
+ uint8_t *src /* align 1 */, ptrdiff_t srcStride,
int h, int x, int y);
typedef struct VP8DSPContext {
@@ -88,9 +88,18 @@ void ff_put_vp8_pixels8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
void ff_put_vp8_pixels4_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
int h, int x, int y);
+void ff_vp7dsp_init(VP8DSPContext *c);
+
+void ff_vp78dsp_init(VP8DSPContext *c);
+void ff_vp78dsp_init_arm(VP8DSPContext *c);
+void ff_vp78dsp_init_ppc(VP8DSPContext *c);
+void ff_vp78dsp_init_x86(VP8DSPContext *c);
+
void ff_vp8dsp_init(VP8DSPContext *c);
-void ff_vp8dsp_init_x86(VP8DSPContext *c);
void ff_vp8dsp_init_arm(VP8DSPContext *c);
-void ff_vp8dsp_init_ppc(VP8DSPContext *c);
+void ff_vp8dsp_init_x86(VP8DSPContext *c);
+
+#define IS_VP7 1
+#define IS_VP8 0
#endif /* AVCODEC_VP8DSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9.c b/chromium/third_party/ffmpeg/libavcodec/vp9.c
index a52924c7c90..000e9918a52 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9.c
@@ -210,19 +210,31 @@ typedef struct VP9Context {
enum CompPredMode comppredmode;
// contextual (left/above) cache
- uint8_t left_partition_ctx[8], *above_partition_ctx;
- uint8_t left_mode_ctx[16], *above_mode_ctx;
+ DECLARE_ALIGNED(16, uint8_t, left_y_nnz_ctx)[16];
+ DECLARE_ALIGNED(16, uint8_t, left_mode_ctx)[16];
+ DECLARE_ALIGNED(16, VP56mv, left_mv_ctx)[16][2];
+ DECLARE_ALIGNED(8, uint8_t, left_uv_nnz_ctx)[2][8];
+ DECLARE_ALIGNED(8, uint8_t, left_partition_ctx)[8];
+ DECLARE_ALIGNED(8, uint8_t, left_skip_ctx)[8];
+ DECLARE_ALIGNED(8, uint8_t, left_txfm_ctx)[8];
+ DECLARE_ALIGNED(8, uint8_t, left_segpred_ctx)[8];
+ DECLARE_ALIGNED(8, uint8_t, left_intra_ctx)[8];
+ DECLARE_ALIGNED(8, uint8_t, left_comp_ctx)[8];
+ DECLARE_ALIGNED(8, uint8_t, left_ref_ctx)[8];
+ DECLARE_ALIGNED(8, uint8_t, left_filter_ctx)[8];
+ uint8_t *above_partition_ctx;
+ uint8_t *above_mode_ctx;
// FIXME maybe merge some of the below in a flags field?
- uint8_t left_y_nnz_ctx[16], *above_y_nnz_ctx;
- uint8_t left_uv_nnz_ctx[2][8], *above_uv_nnz_ctx[2];
- uint8_t left_skip_ctx[8], *above_skip_ctx; // 1bit
- uint8_t left_txfm_ctx[8], *above_txfm_ctx; // 2bit
- uint8_t left_segpred_ctx[8], *above_segpred_ctx; // 1bit
- uint8_t left_intra_ctx[8], *above_intra_ctx; // 1bit
- uint8_t left_comp_ctx[8], *above_comp_ctx; // 1bit
- uint8_t left_ref_ctx[8], *above_ref_ctx; // 2bit
- uint8_t left_filter_ctx[8], *above_filter_ctx;
- VP56mv left_mv_ctx[16][2], (*above_mv_ctx)[2];
+ uint8_t *above_y_nnz_ctx;
+ uint8_t *above_uv_nnz_ctx[2];
+ uint8_t *above_skip_ctx; // 1bit
+ uint8_t *above_txfm_ctx; // 2bit
+ uint8_t *above_segpred_ctx; // 1bit
+ uint8_t *above_intra_ctx; // 1bit
+ uint8_t *above_comp_ctx; // 1bit
+ uint8_t *above_ref_ctx; // 2bit
+ uint8_t *above_filter_ctx;
+ VP56mv (*above_mv_ctx)[2];
// whole-frame cache
uint8_t *intra_pred_data[3];
@@ -230,9 +242,10 @@ typedef struct VP9Context {
DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer)[71*80];
// block reconstruction intermediates
+ int block_alloc_using_2pass;
int16_t *block_base, *block, *uvblock_base[2], *uvblock[2];
uint8_t *eob_base, *uveob_base[2], *eob, *uveob[2];
- VP56mv min_mv, max_mv;
+ struct { int x, y; } min_mv, max_mv;
DECLARE_ALIGNED(32, uint8_t, tmp_y)[64*64];
DECLARE_ALIGNED(32, uint8_t, tmp_uv)[2][32*32];
} VP9Context;
@@ -264,7 +277,8 @@ static int vp9_alloc_frame(AVCodecContext *ctx, VP9Frame *f)
f->mv = (struct VP9mvrefPair *) (f->extradata->data + sz);
// retain segmentation map if it doesn't update
- if (s->segmentation.enabled && !s->segmentation.update_map) {
+ if (s->segmentation.enabled && !s->segmentation.update_map &&
+ !s->intraonly && !s->keyframe) {
memcpy(f->segmentation_map, s->frames[LAST_FRAME].segmentation_map, sz);
}
@@ -301,7 +315,7 @@ static int update_size(AVCodecContext *ctx, int w, int h)
av_assert0(w > 0 && h > 0);
- if (s->above_partition_ctx && w == ctx->width && h == ctx->height)
+ if (s->intra_pred_data[0] && w == ctx->width && h == ctx->height)
return 0;
ctx->width = w;
@@ -312,32 +326,46 @@ static int update_size(AVCodecContext *ctx, int w, int h)
s->rows = (h + 7) >> 3;
#define assign(var, type, n) var = (type) p; p += s->sb_cols * n * sizeof(*var)
- av_freep(&s->above_partition_ctx);
+ av_freep(&s->intra_pred_data[0]);
p = av_malloc(s->sb_cols * (240 + sizeof(*s->lflvl) + 16 * sizeof(*s->above_mv_ctx)));
if (!p)
return AVERROR(ENOMEM);
+ assign(s->intra_pred_data[0], uint8_t *, 64);
+ assign(s->intra_pred_data[1], uint8_t *, 32);
+ assign(s->intra_pred_data[2], uint8_t *, 32);
+ assign(s->above_y_nnz_ctx, uint8_t *, 16);
+ assign(s->above_mode_ctx, uint8_t *, 16);
+ assign(s->above_mv_ctx, VP56mv(*)[2], 16);
assign(s->above_partition_ctx, uint8_t *, 8);
assign(s->above_skip_ctx, uint8_t *, 8);
assign(s->above_txfm_ctx, uint8_t *, 8);
- assign(s->above_mode_ctx, uint8_t *, 16);
- assign(s->above_y_nnz_ctx, uint8_t *, 16);
assign(s->above_uv_nnz_ctx[0], uint8_t *, 8);
assign(s->above_uv_nnz_ctx[1], uint8_t *, 8);
- assign(s->intra_pred_data[0], uint8_t *, 64);
- assign(s->intra_pred_data[1], uint8_t *, 32);
- assign(s->intra_pred_data[2], uint8_t *, 32);
assign(s->above_segpred_ctx, uint8_t *, 8);
assign(s->above_intra_ctx, uint8_t *, 8);
assign(s->above_comp_ctx, uint8_t *, 8);
assign(s->above_ref_ctx, uint8_t *, 8);
assign(s->above_filter_ctx, uint8_t *, 8);
assign(s->lflvl, struct VP9Filter *, 1);
- assign(s->above_mv_ctx, VP56mv(*)[2], 16);
#undef assign
+ // these will be re-allocated a little later
+ av_freep(&s->b_base);
+ av_freep(&s->block_base);
+
+ return 0;
+}
+
+static int update_block_buffers(AVCodecContext *ctx)
+{
+ VP9Context *s = ctx->priv_data;
+
+ if (s->b_base && s->block_base && s->block_alloc_using_2pass == s->uses_2pass)
+ return 0;
+
av_free(s->b_base);
av_free(s->block_base);
- if (ctx->active_thread_type == FF_THREAD_FRAME && s->refreshctx && !s->parallelmode) {
+ if (s->uses_2pass) {
int sbs = s->sb_cols * s->sb_rows;
s->b_base = av_malloc(sizeof(VP9Block) * s->cols * s->rows);
@@ -360,6 +388,7 @@ static int update_size(AVCodecContext *ctx, int w, int h)
s->uveob_base[0] = s->eob_base + 256;
s->uveob_base[1] = s->uveob_base[0] + 64;
}
+ s->block_alloc_using_2pass = s->uses_2pass;
return 0;
}
@@ -466,7 +495,6 @@ static int decode_frame_header(AVCodecContext *ctx,
last_invisible = s->invisible;
s->invisible = !get_bits1(&s->gb);
s->errorres = get_bits1(&s->gb);
- // FIXME disable this upon resolution change
s->use_last_frame_mvs = !s->errorres && !last_invisible;
if (s->keyframe) {
if (get_bits_long(&s->gb, 24) != VP9_SYNCCODE) { // synccode
@@ -525,6 +553,11 @@ static int decode_frame_header(AVCodecContext *ctx,
w = get_bits(&s->gb, 16) + 1;
h = get_bits(&s->gb, 16) + 1;
}
+ // Note that in this code, "CUR_FRAME" is actually before we
+ // have formally allocated a frame, and thus actually represents
+ // the _last_ frame
+ s->use_last_frame_mvs &= s->frames[CUR_FRAME].tf.f->width == w &&
+ s->frames[CUR_FRAME].tf.f->height == h;
if (get_bits1(&s->gb)) // display size
skip_bits(&s->gb, 32);
s->highprecisionmvs = get_bits1(&s->gb);
@@ -588,10 +621,19 @@ static int decode_frame_header(AVCodecContext *ctx,
for (i = 0; i < 7; i++)
s->prob.seg[i] = get_bits1(&s->gb) ?
get_bits(&s->gb, 8) : 255;
- if ((s->segmentation.temporal = get_bits1(&s->gb)))
+ if ((s->segmentation.temporal = get_bits1(&s->gb))) {
for (i = 0; i < 3; i++)
s->prob.segpred[i] = get_bits1(&s->gb) ?
get_bits(&s->gb, 8) : 255;
+ }
+ }
+ if ((!s->segmentation.update_map || s->segmentation.temporal) &&
+ (w != s->frames[CUR_FRAME].tf.f->width ||
+ h != s->frames[CUR_FRAME].tf.f->height)) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Reference segmap (temp=%d,update=%d) enabled on size-change!\n",
+ s->segmentation.temporal, s->segmentation.update_map);
+ return AVERROR_INVALIDDATA;
}
if (get_bits1(&s->gb)) {
@@ -1159,7 +1201,7 @@ static void fill_mv(VP9Context *s,
VP9Block *b = s->b;
if (mode == ZEROMV) {
- memset(mv, 0, sizeof(*mv) * 2);
+ AV_ZERO64(mv);
} else {
int hp;
@@ -1226,6 +1268,52 @@ static void fill_mv(VP9Context *s,
}
}
+static av_always_inline void setctx_2d(uint8_t *ptr, int w, int h,
+ ptrdiff_t stride, int v)
+{
+ switch (w) {
+ case 1:
+ do {
+ *ptr = v;
+ ptr += stride;
+ } while (--h);
+ break;
+ case 2: {
+ int v16 = v * 0x0101;
+ do {
+ AV_WN16A(ptr, v16);
+ ptr += stride;
+ } while (--h);
+ break;
+ }
+ case 4: {
+ uint32_t v32 = v * 0x01010101;
+ do {
+ AV_WN32A(ptr, v32);
+ ptr += stride;
+ } while (--h);
+ break;
+ }
+ case 8: {
+#if HAVE_FAST_64BIT
+ uint64_t v64 = v * 0x0101010101010101ULL;
+ do {
+ AV_WN64A(ptr, v64);
+ ptr += stride;
+ } while (--h);
+#else
+ uint32_t v32 = v * 0x01010101;
+ do {
+ AV_WN32A(ptr, v32);
+ AV_WN32A(ptr + 4, v32);
+ ptr += stride;
+ } while (--h);
+#endif
+ break;
+ }
+ }
+}
+
static void decode_mode(AVCodecContext *ctx)
{
static const uint8_t left_ctx[N_BS_SIZES] = {
@@ -1245,12 +1333,12 @@ static void decode_mode(AVCodecContext *ctx)
int w4 = FFMIN(s->cols - col, bwh_tab[1][b->bs][0]);
int h4 = FFMIN(s->rows - row, bwh_tab[1][b->bs][1]), y;
int have_a = row > 0, have_l = col > s->tiling.tile_col_start;
+ int vref, filter_id;
if (!s->segmentation.enabled) {
b->seg_id = 0;
} else if (s->keyframe || s->intraonly) {
- b->seg_id = s->segmentation.update_map ?
- vp8_rac_get_tree(&s->c, vp9_segmentation_tree, s->prob.seg) : 0;
+ b->seg_id = vp8_rac_get_tree(&s->c, vp9_segmentation_tree, s->prob.seg);
} else if (!s->segmentation.update_map ||
(s->segmentation.temporal &&
vp56_rac_get_prob_branchy(&s->c,
@@ -1276,11 +1364,10 @@ static void decode_mode(AVCodecContext *ctx)
memset(&s->above_segpred_ctx[col], 0, w4);
memset(&s->left_segpred_ctx[row7], 0, h4);
}
- if ((s->segmentation.enabled && s->segmentation.update_map) || s->keyframe) {
- uint8_t *segmap = s->frames[CUR_FRAME].segmentation_map;
-
- for (y = 0; y < h4; y++)
- memset(&segmap[(y + row) * 8 * s->sb_cols + col], b->seg_id, w4);
+ if (s->segmentation.enabled &&
+ (s->segmentation.update_map || s->keyframe || s->intraonly)) {
+ setctx_2d(&s->frames[CUR_FRAME].segmentation_map[row * 8 * s->sb_cols + col],
+ w4, h4, 8 * s->sb_cols, b->seg_id);
}
b->skip = s->segmentation.enabled &&
@@ -1738,9 +1825,10 @@ static void decode_mode(AVCodecContext *ctx)
c = 3;
}
- b->filter = vp8_rac_get_tree(&s->c, vp9_filter_tree,
+ filter_id = vp8_rac_get_tree(&s->c, vp9_filter_tree,
s->prob.p.filter[c]);
- s->counts.filter[c][b->filter]++;
+ s->counts.filter[c][filter_id]++;
+ b->filter = vp9_filter_lut[filter_id];
} else {
b->filter = s->filtermode;
}
@@ -1797,27 +1885,80 @@ static void decode_mode(AVCodecContext *ctx)
AV_COPY32(&b->mv[2][1], &b->mv[0][1]);
AV_COPY32(&b->mv[3][1], &b->mv[0][1]);
}
+
+ vref = b->ref[b->comp ? s->signbias[s->varcompref[0]] : 0];
+ }
+
+#if HAVE_FAST_64BIT
+#define SPLAT_CTX(var, val, n) \
+ switch (n) { \
+ case 1: var = val; break; \
+ case 2: AV_WN16A(&var, val * 0x0101); break; \
+ case 4: AV_WN32A(&var, val * 0x01010101); break; \
+ case 8: AV_WN64A(&var, val * 0x0101010101010101ULL); break; \
+ case 16: { \
+ uint64_t v64 = val * 0x0101010101010101ULL; \
+ AV_WN64A( &var, v64); \
+ AV_WN64A(&((uint8_t *) &var)[8], v64); \
+ break; \
+ } \
+ }
+#else
+#define SPLAT_CTX(var, val, n) \
+ switch (n) { \
+ case 1: var = val; break; \
+ case 2: AV_WN16A(&var, val * 0x0101); break; \
+ case 4: AV_WN32A(&var, val * 0x01010101); break; \
+ case 8: { \
+ uint32_t v32 = val * 0x01010101; \
+ AV_WN32A( &var, v32); \
+ AV_WN32A(&((uint8_t *) &var)[4], v32); \
+ break; \
+ } \
+ case 16: { \
+ uint32_t v32 = val * 0x01010101; \
+ AV_WN32A( &var, v32); \
+ AV_WN32A(&((uint8_t *) &var)[4], v32); \
+ AV_WN32A(&((uint8_t *) &var)[8], v32); \
+ AV_WN32A(&((uint8_t *) &var)[12], v32); \
+ break; \
+ } \
+ }
+#endif
+
+ switch (bwh_tab[1][b->bs][0]) {
+#define SET_CTXS(dir, off, n) \
+ do { \
+ SPLAT_CTX(s->dir##_skip_ctx[off], b->skip, n); \
+ SPLAT_CTX(s->dir##_txfm_ctx[off], b->tx, n); \
+ SPLAT_CTX(s->dir##_partition_ctx[off], dir##_ctx[b->bs], n); \
+ if (!s->keyframe && !s->intraonly) { \
+ SPLAT_CTX(s->dir##_intra_ctx[off], b->intra, n); \
+ SPLAT_CTX(s->dir##_comp_ctx[off], b->comp, n); \
+ SPLAT_CTX(s->dir##_mode_ctx[off], b->mode[3], n); \
+ if (!b->intra) { \
+ SPLAT_CTX(s->dir##_ref_ctx[off], vref, n); \
+ if (s->filtermode == FILTER_SWITCHABLE) { \
+ SPLAT_CTX(s->dir##_filter_ctx[off], filter_id, n); \
+ } \
+ } \
+ } \
+ } while (0)
+ case 1: SET_CTXS(above, col, 1); break;
+ case 2: SET_CTXS(above, col, 2); break;
+ case 4: SET_CTXS(above, col, 4); break;
+ case 8: SET_CTXS(above, col, 8); break;
}
+ switch (bwh_tab[1][b->bs][1]) {
+ case 1: SET_CTXS(left, row7, 1); break;
+ case 2: SET_CTXS(left, row7, 2); break;
+ case 4: SET_CTXS(left, row7, 4); break;
+ case 8: SET_CTXS(left, row7, 8); break;
+ }
+#undef SPLAT_CTX
+#undef SET_CTXS
- // FIXME this can probably be optimized
- memset(&s->above_skip_ctx[col], b->skip, w4);
- memset(&s->left_skip_ctx[row7], b->skip, h4);
- memset(&s->above_txfm_ctx[col], b->tx, w4);
- memset(&s->left_txfm_ctx[row7], b->tx, h4);
- memset(&s->above_partition_ctx[col], above_ctx[b->bs], w4);
- memset(&s->left_partition_ctx[row7], left_ctx[b->bs], h4);
if (!s->keyframe && !s->intraonly) {
- memset(&s->above_intra_ctx[col], b->intra, w4);
- memset(&s->left_intra_ctx[row7], b->intra, h4);
- memset(&s->above_comp_ctx[col], b->comp, w4);
- memset(&s->left_comp_ctx[row7], b->comp, h4);
- memset(&s->above_mode_ctx[col], b->mode[3], w4);
- memset(&s->left_mode_ctx[row7], b->mode[3], h4);
- if (s->filtermode == FILTER_SWITCHABLE && !b->intra ) {
- memset(&s->above_filter_ctx[col], b->filter, w4);
- memset(&s->left_filter_ctx[row7], b->filter, h4);
- b->filter = vp9_filter_lut[b->filter];
- }
if (b->bs > BS_8x8) {
int mv0 = AV_RN32A(&b->mv[3][0]), mv1 = AV_RN32A(&b->mv[3][1]);
@@ -1841,14 +1982,6 @@ static void decode_mode(AVCodecContext *ctx)
AV_WN32A(&s->left_mv_ctx[row7 * 2 + n][1], mv1);
}
}
-
- if (!b->intra) { // FIXME write 0xff or -1 if intra, so we can use this
- // as a direct check in above branches
- int vref = b->ref[b->comp ? s->signbias[s->varcompref[0]] : 0];
-
- memset(&s->above_ref_ctx[col], vref, w4);
- memset(&s->left_ref_ctx[row7], vref, h4);
- }
}
// FIXME kinda ugly
@@ -1878,12 +2011,13 @@ static void decode_mode(AVCodecContext *ctx)
}
}
-// FIXME remove tx argument, and merge cnt/eob arguments?
-static int decode_coeffs_b(VP56RangeCoder *c, int16_t *coef, int n_coeffs,
- enum TxfmMode tx, unsigned (*cnt)[6][3],
- unsigned (*eob)[6][2], uint8_t (*p)[6][11],
- int nnz, const int16_t *scan, const int16_t (*nb)[2],
- const int16_t *band_counts, const int16_t *qmul)
+// FIXME merge cnt/eob arguments?
+static av_always_inline int
+decode_coeffs_b_generic(VP56RangeCoder *c, int16_t *coef, int n_coeffs,
+ int is_tx32x32, unsigned (*cnt)[6][3],
+ unsigned (*eob)[6][2], uint8_t (*p)[6][11],
+ int nnz, const int16_t *scan, const int16_t (*nb)[2],
+ const int16_t *band_counts, const int16_t *qmul)
{
int i = 0, band = 0, band_left = band_counts[band];
uint8_t *tp = p[0][nnz];
@@ -1975,7 +2109,7 @@ static int decode_coeffs_b(VP56RangeCoder *c, int16_t *coef, int n_coeffs,
}
if (!--band_left)
band_left = band_counts[++band];
- if (tx == TX_32X32) // FIXME slow
+ if (is_tx32x32)
coef[rc] = ((vp8_rac_get(c) ? -val : val) * qmul[!!i]) / 2;
else
coef[rc] = (vp8_rac_get(c) ? -val : val) * qmul[!!i];
@@ -1986,6 +2120,26 @@ static int decode_coeffs_b(VP56RangeCoder *c, int16_t *coef, int n_coeffs,
return i;
}
+static int decode_coeffs_b(VP56RangeCoder *c, int16_t *coef, int n_coeffs,
+ unsigned (*cnt)[6][3], unsigned (*eob)[6][2],
+ uint8_t (*p)[6][11], int nnz, const int16_t *scan,
+ const int16_t (*nb)[2], const int16_t *band_counts,
+ const int16_t *qmul)
+{
+ return decode_coeffs_b_generic(c, coef, n_coeffs, 0, cnt, eob, p,
+ nnz, scan, nb, band_counts, qmul);
+}
+
+static int decode_coeffs_b32(VP56RangeCoder *c, int16_t *coef, int n_coeffs,
+ unsigned (*cnt)[6][3], unsigned (*eob)[6][2],
+ uint8_t (*p)[6][11], int nnz, const int16_t *scan,
+ const int16_t (*nb)[2], const int16_t *band_counts,
+ const int16_t *qmul)
+{
+ return decode_coeffs_b_generic(c, coef, n_coeffs, 1, cnt, eob, p,
+ nnz, scan, nb, band_counts, qmul);
+}
+
static void decode_coeffs(AVCodecContext *ctx)
{
VP9Context *s = ctx->priv_data;
@@ -1997,8 +2151,7 @@ static void decode_coeffs(AVCodecContext *ctx)
int w4 = bwh_tab[1][b->bs][0] << 1, h4 = bwh_tab[1][b->bs][1] << 1;
int end_x = FFMIN(2 * (s->cols - col), w4);
int end_y = FFMIN(2 * (s->rows - row), h4);
- int n, pl, x, y, step1d = 1 << b->tx, step = 1 << (b->tx * 2);
- int uvstep1d = 1 << b->uvtx, uvstep = 1 << (b->uvtx * 2), res;
+ int n, pl, x, y, res;
int16_t (*qmul)[2] = s->segmentation.feat[b->seg_id].qmul;
int tx = 4 * s->lossless + b->tx;
const int16_t * const *yscans = vp9_scans[tx];
@@ -2016,37 +2169,101 @@ static void decode_coeffs(AVCodecContext *ctx)
const int16_t *y_band_counts = band_counts[b->tx];
const int16_t *uv_band_counts = band_counts[b->uvtx];
- /* y tokens */
- if (b->tx > TX_4X4) { // FIXME slow
- for (y = 0; y < end_y; y += step1d)
- for (x = 1; x < step1d; x++)
- l[y] |= l[y + x];
- for (x = 0; x < end_x; x += step1d)
- for (y = 1; y < step1d; y++)
- a[x] |= a[x + y];
+#define MERGE(la, end, step, rd) \
+ for (n = 0; n < end; n += step) \
+ la[n] = !!rd(&la[n])
+#define MERGE_CTX(step, rd) \
+ do { \
+ MERGE(l, end_y, step, rd); \
+ MERGE(a, end_x, step, rd); \
+ } while (0)
+
+#define DECODE_Y_COEF_LOOP(step, mode_index, v) \
+ for (n = 0, y = 0; y < end_y; y += step) { \
+ for (x = 0; x < end_x; x += step, n += step * step) { \
+ enum TxfmType txtp = vp9_intra_txfm_type[b->mode[mode_index]]; \
+ res = decode_coeffs_b##v(&s->c, s->block + 16 * n, 16 * step * step, \
+ c, e, p, a[x] + l[y], yscans[txtp], \
+ ynbs[txtp], y_band_counts, qmul[0]); \
+ a[x] = l[y] = !!res; \
+ if (step >= 4) { \
+ AV_WN16A(&s->eob[n], res); \
+ } else { \
+ s->eob[n] = res; \
+ } \
+ } \
}
- for (n = 0, y = 0; y < end_y; y += step1d) {
- for (x = 0; x < end_x; x += step1d, n += step) {
- enum TxfmType txtp = vp9_intra_txfm_type[b->mode[b->tx == TX_4X4 &&
- b->bs > BS_8x8 ?
- n : 0]];
- int nnz = a[x] + l[y];
- res = decode_coeffs_b(&s->c, s->block + 16 * n, 16 * step,
- b->tx, c, e, p, nnz, yscans[txtp],
- ynbs[txtp], y_band_counts, qmul[0]);
- a[x] = l[y] = !!res;
- if (b->tx > TX_8X8) {
- AV_WN16A(&s->eob[n], res);
- } else {
- s->eob[n] = res;
- }
- }
+
+#define SPLAT(la, end, step, cond) \
+ if (step == 2) { \
+ for (n = 1; n < end; n += step) \
+ la[n] = la[n - 1]; \
+ } else if (step == 4) { \
+ if (cond) { \
+ for (n = 0; n < end; n += step) \
+ AV_WN32A(&la[n], la[n] * 0x01010101); \
+ } else { \
+ for (n = 0; n < end; n += step) \
+ memset(&la[n + 1], la[n], FFMIN(end - n - 1, 3)); \
+ } \
+ } else /* step == 8 */ { \
+ if (cond) { \
+ if (HAVE_FAST_64BIT) { \
+ for (n = 0; n < end; n += step) \
+ AV_WN64A(&la[n], la[n] * 0x0101010101010101ULL); \
+ } else { \
+ for (n = 0; n < end; n += step) { \
+ uint32_t v32 = la[n] * 0x01010101; \
+ AV_WN32A(&la[n], v32); \
+ AV_WN32A(&la[n + 4], v32); \
+ } \
+ } \
+ } else { \
+ for (n = 0; n < end; n += step) \
+ memset(&la[n + 1], la[n], FFMIN(end - n - 1, 7)); \
+ } \
}
- if (b->tx > TX_4X4) { // FIXME slow
- for (y = 0; y < end_y; y += step1d)
- memset(&l[y + 1], l[y], FFMIN(end_y - y - 1, step1d - 1));
- for (x = 0; x < end_x; x += step1d)
- memset(&a[x + 1], a[x], FFMIN(end_x - x - 1, step1d - 1));
+#define SPLAT_CTX(step) \
+ do { \
+ SPLAT(a, end_x, step, end_x == w4); \
+ SPLAT(l, end_y, step, end_y == h4); \
+ } while (0)
+
+ /* y tokens */
+ switch (b->tx) {
+ case TX_4X4:
+ DECODE_Y_COEF_LOOP(1, b->bs > BS_8x8 ? n : 0,);
+ break;
+ case TX_8X8:
+ MERGE_CTX(2, AV_RN16A);
+ DECODE_Y_COEF_LOOP(2, 0,);
+ SPLAT_CTX(2);
+ break;
+ case TX_16X16:
+ MERGE_CTX(4, AV_RN32A);
+ DECODE_Y_COEF_LOOP(4, 0,);
+ SPLAT_CTX(4);
+ break;
+ case TX_32X32:
+ MERGE_CTX(8, AV_RN64A);
+ DECODE_Y_COEF_LOOP(8, 0, 32);
+ SPLAT_CTX(8);
+ break;
+ }
+
+#define DECODE_UV_COEF_LOOP(step) \
+ for (n = 0, y = 0; y < end_y; y += step) { \
+ for (x = 0; x < end_x; x += step, n += step * step) { \
+ res = decode_coeffs_b(&s->c, s->uvblock[pl] + 16 * n, \
+ 16 * step * step, c, e, p, a[x] + l[y], \
+ uvscan, uvnb, uv_band_counts, qmul[1]); \
+ a[x] = l[y] = !!res; \
+ if (step >= 4) { \
+ AV_WN16A(&s->uveob[pl][n], res); \
+ } else { \
+ s->uveob[pl][n] = res; \
+ } \
+ } \
}
p = s->prob.coef[b->uvtx][1 /* uv */][!b->intra];
@@ -2059,33 +2276,31 @@ static void decode_coeffs(AVCodecContext *ctx)
for (pl = 0; pl < 2; pl++) {
a = &s->above_uv_nnz_ctx[pl][col];
l = &s->left_uv_nnz_ctx[pl][row & 7];
- if (b->uvtx > TX_4X4) { // FIXME slow
- for (y = 0; y < end_y; y += uvstep1d)
- for (x = 1; x < uvstep1d; x++)
- l[y] |= l[y + x];
- for (x = 0; x < end_x; x += uvstep1d)
- for (y = 1; y < uvstep1d; y++)
- a[x] |= a[x + y];
- }
- for (n = 0, y = 0; y < end_y; y += uvstep1d) {
- for (x = 0; x < end_x; x += uvstep1d, n += uvstep) {
- int nnz = a[x] + l[y];
- res = decode_coeffs_b(&s->c, s->uvblock[pl] + 16 * n,
- 16 * uvstep, b->uvtx, c, e, p, nnz,
- uvscan, uvnb, uv_band_counts, qmul[1]);
- a[x] = l[y] = !!res;
- if (b->uvtx > TX_8X8) {
- AV_WN16A(&s->uveob[pl][n], res);
- } else {
- s->uveob[pl][n] = res;
- }
- }
- }
- if (b->uvtx > TX_4X4) { // FIXME slow
- for (y = 0; y < end_y; y += uvstep1d)
- memset(&l[y + 1], l[y], FFMIN(end_y - y - 1, uvstep1d - 1));
- for (x = 0; x < end_x; x += uvstep1d)
- memset(&a[x + 1], a[x], FFMIN(end_x - x - 1, uvstep1d - 1));
+ switch (b->uvtx) {
+ case TX_4X4:
+ DECODE_UV_COEF_LOOP(1);
+ break;
+ case TX_8X8:
+ MERGE_CTX(2, AV_RN16A);
+ DECODE_UV_COEF_LOOP(2);
+ SPLAT_CTX(2);
+ break;
+ case TX_16X16:
+ MERGE_CTX(4, AV_RN32A);
+ DECODE_UV_COEF_LOOP(4);
+ SPLAT_CTX(4);
+ break;
+ case TX_32X32:
+ MERGE_CTX(8, AV_RN64A);
+ // a 64x64 (max) uv block can ever only contain 1 tx32x32 block
+ // so there is no need to loop
+ res = decode_coeffs_b32(&s->c, s->uvblock[pl],
+ 1024, c, e, p, a[0] + l[0],
+ uvscan, uvnb, uv_band_counts, qmul[1]);
+ a[0] = l[0] = !!res;
+ AV_WN16A(&s->uveob[pl][0], res);
+ SPLAT_CTX(8);
+ break;
}
}
}
@@ -2211,11 +2426,11 @@ static av_always_inline int check_intra_mode(VP9Context *s, int mode, uint8_t **
if (n_px_need <= n_px_have) {
for (i = 0; i < n_px_need; i++)
- l[i] = dst[i * stride - 1];
+ l[n_px_need - 1 - i] = dst[i * stride - 1];
} else {
for (i = 0; i < n_px_have; i++)
- l[i] = dst[i * stride - 1];
- memset(&l[i], l[i - 1], n_px_need - n_px_have);
+ l[n_px_need - 1 - i] = dst[i * stride - 1];
+ memset(l, l[n_px_need - n_px_have], n_px_need - n_px_have);
}
} else {
memset(l, 129, 4 << tx);
@@ -2237,6 +2452,8 @@ static void intra_recon(AVCodecContext *ctx, ptrdiff_t y_off, ptrdiff_t uv_off)
int tx = 4 * s->lossless + b->tx, uvtx = b->uvtx + 4 * s->lossless;
int uvstep1d = 1 << b->uvtx, p;
uint8_t *dst = s->dst[0], *dst_r = s->frames[CUR_FRAME].tf.f->data[0] + y_off;
+ LOCAL_ALIGNED_32(uint8_t, a_buf, [64]);
+ LOCAL_ALIGNED_32(uint8_t, l, [32]);
for (n = 0, y = 0; y < end_y; y += step1d) {
uint8_t *ptr = dst, *ptr_r = dst_r;
@@ -2244,8 +2461,7 @@ static void intra_recon(AVCodecContext *ctx, ptrdiff_t y_off, ptrdiff_t uv_off)
ptr_r += 4 * step1d, n += step) {
int mode = b->mode[b->bs > BS_8x8 && b->tx == TX_4X4 ?
y * 2 + x : 0];
- LOCAL_ALIGNED_16(uint8_t, a_buf, [48]);
- uint8_t *a = &a_buf[16], l[32];
+ uint8_t *a = &a_buf[32];
enum TxfmType txtp = vp9_intra_txfm_type[mode];
int eob = b->skip ? 0 : b->tx > TX_8X8 ? AV_RN16A(&s->eob[n]) : s->eob[n];
@@ -2276,8 +2492,7 @@ static void intra_recon(AVCodecContext *ctx, ptrdiff_t y_off, ptrdiff_t uv_off)
for (x = 0; x < end_x; x += uvstep1d, ptr += 4 * uvstep1d,
ptr_r += 4 * uvstep1d, n += step) {
int mode = b->uvmode;
- LOCAL_ALIGNED_16(uint8_t, a_buf, [48]);
- uint8_t *a = &a_buf[16], l[32];
+ uint8_t *a = &a_buf[16];
int eob = b->skip ? 0 : b->uvtx > TX_8X8 ? AV_RN16A(&s->uveob[p][n]) : s->uveob[p][n];
mode = check_intra_mode(s, mode, &a, ptr_r,
@@ -2381,48 +2596,53 @@ static void inter_recon(AVCodecContext *ctx)
VP9Context *s = ctx->priv_data;
VP9Block *b = s->b;
int row = s->row, col = s->col;
- ThreadFrame *tref1 = &s->refs[s->refidx[b->ref[0]]];
- AVFrame *ref1 = tref1->f;
- ThreadFrame *tref2 = b->comp ? &s->refs[s->refidx[b->ref[1]]] : NULL;
- AVFrame *ref2 = b->comp ? tref2->f : NULL;
- int w = ctx->width, h = ctx->height;
+ ThreadFrame *tref1 = &s->refs[s->refidx[b->ref[0]]], *tref2;
+ AVFrame *ref1 = tref1->f, *ref2;
+ int w1 = ref1->width, h1 = ref1->height, w2, h2;
ptrdiff_t ls_y = s->y_stride, ls_uv = s->uv_stride;
+ if (b->comp) {
+ tref2 = &s->refs[s->refidx[b->ref[1]]];
+ ref2 = tref2->f;
+ w2 = ref2->width;
+ h2 = ref2->height;
+ }
+
// y inter pred
if (b->bs > BS_8x8) {
if (b->bs == BS_8x4) {
mc_luma_dir(s, s->dsp.mc[3][b->filter][0], s->dst[0], ls_y,
ref1->data[0], ref1->linesize[0], tref1,
- row << 3, col << 3, &b->mv[0][0], 8, 4, w, h);
+ row << 3, col << 3, &b->mv[0][0], 8, 4, w1, h1);
mc_luma_dir(s, s->dsp.mc[3][b->filter][0],
s->dst[0] + 4 * ls_y, ls_y,
ref1->data[0], ref1->linesize[0], tref1,
- (row << 3) + 4, col << 3, &b->mv[2][0], 8, 4, w, h);
+ (row << 3) + 4, col << 3, &b->mv[2][0], 8, 4, w1, h1);
if (b->comp) {
mc_luma_dir(s, s->dsp.mc[3][b->filter][1], s->dst[0], ls_y,
ref2->data[0], ref2->linesize[0], tref2,
- row << 3, col << 3, &b->mv[0][1], 8, 4, w, h);
+ row << 3, col << 3, &b->mv[0][1], 8, 4, w2, h2);
mc_luma_dir(s, s->dsp.mc[3][b->filter][1],
s->dst[0] + 4 * ls_y, ls_y,
ref2->data[0], ref2->linesize[0], tref2,
- (row << 3) + 4, col << 3, &b->mv[2][1], 8, 4, w, h);
+ (row << 3) + 4, col << 3, &b->mv[2][1], 8, 4, w2, h2);
}
} else if (b->bs == BS_4x8) {
mc_luma_dir(s, s->dsp.mc[4][b->filter][0], s->dst[0], ls_y,
ref1->data[0], ref1->linesize[0], tref1,
- row << 3, col << 3, &b->mv[0][0], 4, 8, w, h);
+ row << 3, col << 3, &b->mv[0][0], 4, 8, w1, h1);
mc_luma_dir(s, s->dsp.mc[4][b->filter][0], s->dst[0] + 4, ls_y,
ref1->data[0], ref1->linesize[0], tref1,
- row << 3, (col << 3) + 4, &b->mv[1][0], 4, 8, w, h);
+ row << 3, (col << 3) + 4, &b->mv[1][0], 4, 8, w1, h1);
if (b->comp) {
mc_luma_dir(s, s->dsp.mc[4][b->filter][1], s->dst[0], ls_y,
ref2->data[0], ref2->linesize[0], tref2,
- row << 3, col << 3, &b->mv[0][1], 4, 8, w, h);
+ row << 3, col << 3, &b->mv[0][1], 4, 8, w2, h2);
mc_luma_dir(s, s->dsp.mc[4][b->filter][1], s->dst[0] + 4, ls_y,
ref2->data[0], ref2->linesize[0], tref2,
- row << 3, (col << 3) + 4, &b->mv[1][1], 4, 8, w, h);
+ row << 3, (col << 3) + 4, &b->mv[1][1], 4, 8, w2, h2);
}
} else {
av_assert2(b->bs == BS_4x4);
@@ -2431,34 +2651,34 @@ static void inter_recon(AVCodecContext *ctx)
// do a w8 instead of a w4 call
mc_luma_dir(s, s->dsp.mc[4][b->filter][0], s->dst[0], ls_y,
ref1->data[0], ref1->linesize[0], tref1,
- row << 3, col << 3, &b->mv[0][0], 4, 4, w, h);
+ row << 3, col << 3, &b->mv[0][0], 4, 4, w1, h1);
mc_luma_dir(s, s->dsp.mc[4][b->filter][0], s->dst[0] + 4, ls_y,
ref1->data[0], ref1->linesize[0], tref1,
- row << 3, (col << 3) + 4, &b->mv[1][0], 4, 4, w, h);
+ row << 3, (col << 3) + 4, &b->mv[1][0], 4, 4, w1, h1);
mc_luma_dir(s, s->dsp.mc[4][b->filter][0],
s->dst[0] + 4 * ls_y, ls_y,
ref1->data[0], ref1->linesize[0], tref1,
- (row << 3) + 4, col << 3, &b->mv[2][0], 4, 4, w, h);
+ (row << 3) + 4, col << 3, &b->mv[2][0], 4, 4, w1, h1);
mc_luma_dir(s, s->dsp.mc[4][b->filter][0],
s->dst[0] + 4 * ls_y + 4, ls_y,
ref1->data[0], ref1->linesize[0], tref1,
- (row << 3) + 4, (col << 3) + 4, &b->mv[3][0], 4, 4, w, h);
+ (row << 3) + 4, (col << 3) + 4, &b->mv[3][0], 4, 4, w1, h1);
if (b->comp) {
mc_luma_dir(s, s->dsp.mc[4][b->filter][1], s->dst[0], ls_y,
ref2->data[0], ref2->linesize[0], tref2,
- row << 3, col << 3, &b->mv[0][1], 4, 4, w, h);
+ row << 3, col << 3, &b->mv[0][1], 4, 4, w2, h2);
mc_luma_dir(s, s->dsp.mc[4][b->filter][1], s->dst[0] + 4, ls_y,
ref2->data[0], ref2->linesize[0], tref2,
- row << 3, (col << 3) + 4, &b->mv[1][1], 4, 4, w, h);
+ row << 3, (col << 3) + 4, &b->mv[1][1], 4, 4, w2, h2);
mc_luma_dir(s, s->dsp.mc[4][b->filter][1],
s->dst[0] + 4 * ls_y, ls_y,
ref2->data[0], ref2->linesize[0], tref2,
- (row << 3) + 4, col << 3, &b->mv[2][1], 4, 4, w, h);
+ (row << 3) + 4, col << 3, &b->mv[2][1], 4, 4, w2, h2);
mc_luma_dir(s, s->dsp.mc[4][b->filter][1],
s->dst[0] + 4 * ls_y + 4, ls_y,
ref2->data[0], ref2->linesize[0], tref2,
- (row << 3) + 4, (col << 3) + 4, &b->mv[3][1], 4, 4, w, h);
+ (row << 3) + 4, (col << 3) + 4, &b->mv[3][1], 4, 4, w2, h2);
}
}
} else {
@@ -2467,12 +2687,12 @@ static void inter_recon(AVCodecContext *ctx)
mc_luma_dir(s, s->dsp.mc[bwl][b->filter][0], s->dst[0], ls_y,
ref1->data[0], ref1->linesize[0], tref1,
- row << 3, col << 3, &b->mv[0][0],bw, bh, w, h);
+ row << 3, col << 3, &b->mv[0][0],bw, bh, w1, h1);
if (b->comp)
mc_luma_dir(s, s->dsp.mc[bwl][b->filter][1], s->dst[0], ls_y,
ref2->data[0], ref2->linesize[0], tref2,
- row << 3, col << 3, &b->mv[0][1], bw, bh, w, h);
+ row << 3, col << 3, &b->mv[0][1], bw, bh, w2, h2);
}
// uv inter pred
@@ -2481,8 +2701,12 @@ static void inter_recon(AVCodecContext *ctx)
int bw = bwh_tab[1][b->bs][0] * 4, bh = bwh_tab[1][b->bs][1] * 4;
VP56mv mvuv;
- w = (w + 1) >> 1;
- h = (h + 1) >> 1;
+ w1 = (w1 + 1) >> 1;
+ h1 = (h1 + 1) >> 1;
+ if (b->comp) {
+ w2 = (w2 + 1) >> 1;
+ h2 = (h2 + 1) >> 1;
+ }
if (b->bs > BS_8x8) {
mvuv.x = ROUNDED_DIV(b->mv[0][0].x + b->mv[1][0].x + b->mv[2][0].x + b->mv[3][0].x, 4);
mvuv.y = ROUNDED_DIV(b->mv[0][0].y + b->mv[1][0].y + b->mv[2][0].y + b->mv[3][0].y, 4);
@@ -2494,7 +2718,7 @@ static void inter_recon(AVCodecContext *ctx)
s->dst[1], s->dst[2], ls_uv,
ref1->data[1], ref1->linesize[1],
ref1->data[2], ref1->linesize[2], tref1,
- row << 2, col << 2, &mvuv, bw, bh, w, h);
+ row << 2, col << 2, &mvuv, bw, bh, w1, h1);
if (b->comp) {
if (b->bs > BS_8x8) {
@@ -2507,7 +2731,7 @@ static void inter_recon(AVCodecContext *ctx)
s->dst[1], s->dst[2], ls_uv,
ref2->data[1], ref2->linesize[1],
ref2->data[2], ref2->linesize[2], tref2,
- row << 2, col << 2, &mvuv, bw, bh, w, h);
+ row << 2, col << 2, &mvuv, bw, bh, w2, h2);
}
}
@@ -2698,7 +2922,7 @@ static void decode_b(AVCodecContext *ctx, int row, int col,
VP9Context *s = ctx->priv_data;
VP9Block *b = s->b;
enum BlockSize bs = bl * 3 + bp;
- int y, w4 = bwh_tab[1][bs][0], h4 = bwh_tab[1][bs][1], lvl;
+ int w4 = bwh_tab[1][bs][0], h4 = bwh_tab[1][bs][1], lvl;
int emu[2];
AVFrame *f = s->frames[CUR_FRAME].tf.f;
@@ -2720,13 +2944,34 @@ static void decode_b(AVCodecContext *ctx, int row, int col,
if (!b->skip) {
decode_coeffs(ctx);
} else {
- int pl;
+ int row7 = s->row7;
+
+#define SPLAT_ZERO_CTX(v, n) \
+ switch (n) { \
+ case 1: v = 0; break; \
+ case 2: AV_ZERO16(&v); break; \
+ case 4: AV_ZERO32(&v); break; \
+ case 8: AV_ZERO64(&v); break; \
+ case 16: AV_ZERO128(&v); break; \
+ }
+#define SPLAT_ZERO_YUV(dir, var, off, n) \
+ do { \
+ SPLAT_ZERO_CTX(s->dir##_y_##var[off * 2], n * 2); \
+ SPLAT_ZERO_CTX(s->dir##_uv_##var[0][off], n); \
+ SPLAT_ZERO_CTX(s->dir##_uv_##var[1][off], n); \
+ } while (0)
- memset(&s->above_y_nnz_ctx[col * 2], 0, w4 * 2);
- memset(&s->left_y_nnz_ctx[(row & 7) << 1], 0, h4 * 2);
- for (pl = 0; pl < 2; pl++) {
- memset(&s->above_uv_nnz_ctx[pl][col], 0, w4);
- memset(&s->left_uv_nnz_ctx[pl][row & 7], 0, h4);
+ switch (w4) {
+ case 1: SPLAT_ZERO_YUV(above, nnz_ctx, col, 1); break;
+ case 2: SPLAT_ZERO_YUV(above, nnz_ctx, col, 2); break;
+ case 4: SPLAT_ZERO_YUV(above, nnz_ctx, col, 4); break;
+ case 8: SPLAT_ZERO_YUV(above, nnz_ctx, col, 8); break;
+ }
+ switch (h4) {
+ case 1: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 1); break;
+ case 2: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 2); break;
+ case 4: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 4); break;
+ case 8: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 8); break;
}
}
if (s->pass == 1) {
@@ -2746,9 +2991,9 @@ static void decode_b(AVCodecContext *ctx, int row, int col,
// allows to support emu-edge and so on even if we have large block
// overhangs
emu[0] = (col + w4) * 8 > f->linesize[0] ||
- (row + h4) > s->rows + 2 * !(ctx->flags & CODEC_FLAG_EMU_EDGE);
+ (row + h4) > s->rows;
emu[1] = (col + w4) * 4 > f->linesize[1] ||
- (row + h4) > s->rows + 2 * !(ctx->flags & CODEC_FLAG_EMU_EDGE);
+ (row + h4) > s->rows;
if (emu[0]) {
s->dst[0] = s->tmp_y;
s->y_stride = 64;
@@ -2806,12 +3051,11 @@ static void decode_b(AVCodecContext *ctx, int row, int col,
(lvl = s->segmentation.feat[b->seg_id].lflvl[b->intra ? 0 : b->ref[0] + 1]
[b->mode[3] != ZEROMV]) > 0) {
int x_end = FFMIN(s->cols - col, w4), y_end = FFMIN(s->rows - row, h4);
- int skip_inter = !b->intra && b->skip;
+ int skip_inter = !b->intra && b->skip, col7 = s->col7, row7 = s->row7;
- for (y = 0; y < h4; y++)
- memset(&lflvl->level[((row & 7) + y) * 8 + (col & 7)], lvl, w4);
- mask_edges(lflvl, 0, row & 7, col & 7, x_end, y_end, 0, 0, b->tx, skip_inter);
- mask_edges(lflvl, 1, row & 7, col & 7, x_end, y_end,
+ setctx_2d(&lflvl->level[row7 * 8 + col7], w4, h4, 8, lvl);
+ mask_edges(lflvl, 0, row7, col7, x_end, y_end, 0, 0, b->tx, skip_inter);
+ mask_edges(lflvl, 1, row7, col7, x_end, y_end,
s->cols & 1 && col + w4 >= s->cols ? s->cols & 7 : 0,
s->rows & 1 && row + h4 >= s->rows ? s->rows & 7 : 0,
b->uvtx, skip_inter);
@@ -3449,6 +3693,13 @@ static void adapt_probs(VP9Context *s)
}
}
+static void free_buffers(VP9Context *s)
+{
+ av_freep(&s->intra_pred_data[0]);
+ av_freep(&s->b_base);
+ av_freep(&s->block_base);
+}
+
static av_cold int vp9_decode_free(AVCodecContext *ctx)
{
VP9Context *s = ctx->priv_data;
@@ -3467,11 +3718,9 @@ static av_cold int vp9_decode_free(AVCodecContext *ctx)
ff_thread_release_buffer(ctx, &s->next_refs[i]);
av_frame_free(&s->next_refs[i].f);
}
- av_freep(&s->above_partition_ctx);
+ free_buffers(s);
av_freep(&s->c_b);
s->c_b_size = 0;
- av_freep(&s->b_base);
- av_freep(&s->block_base);
return 0;
}
@@ -3544,16 +3793,24 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
memset(s->above_segpred_ctx, 0, s->cols);
s->pass = s->uses_2pass =
ctx->active_thread_type == FF_THREAD_FRAME && s->refreshctx && !s->parallelmode;
+ if ((res = update_block_buffers(ctx)) < 0) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Failed to allocate block buffers\n");
+ return res;
+ }
if (s->refreshctx && s->parallelmode) {
int j, k, l, m;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 4; i++) {
for (j = 0; j < 2; j++)
for (k = 0; k < 2; k++)
for (l = 0; l < 6; l++)
for (m = 0; m < 6; m++)
memcpy(s->prob_ctx[s->framectxid].coef[i][j][k][l][m],
s->prob.coef[i][j][k][l][m], 3);
+ if (s->txfmmode == i)
+ break;
+ }
s->prob_ctx[s->framectxid].p = s->prob.p;
ff_thread_finish_setup(ctx);
}
@@ -3583,11 +3840,15 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
data += 4;
size -= 4;
}
- if (tile_size > size)
+ if (tile_size > size) {
+ ff_thread_report_progress(&s->frames[CUR_FRAME].tf, INT_MAX, 0);
return AVERROR_INVALIDDATA;
+ }
ff_vp56_init_range_decoder(&s->c_b[tile_col], data, tile_size);
- if (vp56_rac_get_prob_branchy(&s->c_b[tile_col], 128)) // marker bit
+ if (vp56_rac_get_prob_branchy(&s->c_b[tile_col], 128)) { // marker bit
+ ff_thread_report_progress(&s->frames[CUR_FRAME].tf, INT_MAX, 0);
return AVERROR_INVALIDDATA;
+ }
data += tile_size;
size -= tile_size;
}
@@ -3758,7 +4019,11 @@ static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo
int i, res;
VP9Context *s = dst->priv_data, *ssrc = src->priv_data;
- // FIXME scalability, size, etc.
+ // detect size changes in other threads
+ if (s->intra_pred_data[0] &&
+ (!ssrc->intra_pred_data[0] || s->cols != ssrc->cols || s->rows != ssrc->rows)) {
+ free_buffers(s);
+ }
for (i = 0; i < 2; i++) {
if (s->frames[i].tf.f->data[0])
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9_parser.c b/chromium/third_party/ffmpeg/libavcodec/vp9_parser.c
index 24f588f4412..af033c25e64 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9_parser.c
@@ -73,14 +73,14 @@ static int parse(AVCodecParserContext *ctx,
#define case_n(a, rd) \
case a: \
while (n_frames--) { \
- int sz = rd; \
+ unsigned sz = rd; \
idx += a; \
if (sz > size) { \
s->n_frames = 0; \
- av_log(ctx, AV_LOG_ERROR, \
- "Superframe packet size too big: %d > %d\n", \
+ av_log(avctx, AV_LOG_ERROR, \
+ "Superframe packet size too big: %u > %d\n", \
sz, size); \
- return AVERROR_INVALIDDATA; \
+ return size; \
} \
if (first) { \
first = 0; \
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9dsp.c b/chromium/third_party/ffmpeg/libavcodec/vp9dsp.c
index ec0b411c937..e2f99f72c84 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9dsp.c
@@ -84,10 +84,10 @@ static void vert_32x32_c(uint8_t *dst, ptrdiff_t stride,
static void hor_4x4_c(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top)
{
- AV_WN32A(dst + stride * 0, left[0] * 0x01010101U);
- AV_WN32A(dst + stride * 1, left[1] * 0x01010101U);
- AV_WN32A(dst + stride * 2, left[2] * 0x01010101U);
- AV_WN32A(dst + stride * 3, left[3] * 0x01010101U);
+ AV_WN32A(dst + stride * 0, left[3] * 0x01010101U);
+ AV_WN32A(dst + stride * 1, left[2] * 0x01010101U);
+ AV_WN32A(dst + stride * 2, left[1] * 0x01010101U);
+ AV_WN32A(dst + stride * 3, left[0] * 0x01010101U);
}
static void hor_8x8_c(uint8_t *dst, ptrdiff_t stride,
@@ -96,7 +96,7 @@ static void hor_8x8_c(uint8_t *dst, ptrdiff_t stride,
int y;
for (y = 0; y < 8; y++) {
- AV_WN64A(dst, left[y] * 0x0101010101010101ULL);
+ AV_WN64A(dst, left[7 - y] * 0x0101010101010101ULL);
dst += stride;
}
}
@@ -107,7 +107,7 @@ static void hor_16x16_c(uint8_t *dst, ptrdiff_t stride,
int y;
for (y = 0; y < 16; y++) {
- uint64_t p8 = left[y] * 0x0101010101010101ULL;
+ uint64_t p8 = left[15 - y] * 0x0101010101010101ULL;
AV_WN64A(dst + 0, p8);
AV_WN64A(dst + 8, p8);
@@ -121,7 +121,7 @@ static void hor_32x32_c(uint8_t *dst, ptrdiff_t stride,
int y;
for (y = 0; y < 32; y++) {
- uint64_t p8 = left[y] * 0x0101010101010101ULL;
+ uint64_t p8 = left[31 - y] * 0x0101010101010101ULL;
AV_WN64A(dst + 0, p8);
AV_WN64A(dst + 8, p8);
@@ -137,7 +137,7 @@ static void tm_4x4_c(uint8_t *dst, ptrdiff_t stride,
int y, tl = top[-1];
for (y = 0; y < 4; y++) {
- int l_m_tl = left[y] - tl;
+ int l_m_tl = left[3 - y] - tl;
dst[0] = av_clip_uint8(top[0] + l_m_tl);
dst[1] = av_clip_uint8(top[1] + l_m_tl);
@@ -153,7 +153,7 @@ static void tm_8x8_c(uint8_t *dst, ptrdiff_t stride,
int y, tl = top[-1];
for (y = 0; y < 8; y++) {
- int l_m_tl = left[y] - tl;
+ int l_m_tl = left[7 - y] - tl;
dst[0] = av_clip_uint8(top[0] + l_m_tl);
dst[1] = av_clip_uint8(top[1] + l_m_tl);
@@ -173,7 +173,7 @@ static void tm_16x16_c(uint8_t *dst, ptrdiff_t stride,
int y, tl = top[-1];
for (y = 0; y < 16; y++) {
- int l_m_tl = left[y] - tl;
+ int l_m_tl = left[15 - y] - tl;
dst[ 0] = av_clip_uint8(top[ 0] + l_m_tl);
dst[ 1] = av_clip_uint8(top[ 1] + l_m_tl);
@@ -201,7 +201,7 @@ static void tm_32x32_c(uint8_t *dst, ptrdiff_t stride,
int y, tl = top[-1];
for (y = 0; y < 32; y++) {
- int l_m_tl = left[y] - tl;
+ int l_m_tl = left[31 - y] - tl;
dst[ 0] = av_clip_uint8(top[ 0] + l_m_tl);
dst[ 1] = av_clip_uint8(top[ 1] + l_m_tl);
@@ -613,7 +613,7 @@ static void diag_downright_4x4_c(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top)
{
int tl = top[-1], a0 = top[0], a1 = top[1], a2 = top[2], a3 = top[3],
- l0 = left[0], l1 = left[1], l2 = left[2], l3 = left[3];
+ l0 = left[3], l1 = left[2], l2 = left[1], l3 = left[0];
DST(0,3) = (l1 + l2 * 2 + l3 + 2) >> 2;
DST(0,2) = DST(1,3) = (l0 + l1 * 2 + l2 + 2) >> 2;
@@ -632,11 +632,11 @@ static void diag_downright_##size##x##size##_c(uint8_t *dst, ptrdiff_t stride, \
uint8_t v[size + size - 1]; \
\
for (i = 0; i < size - 2; i++) { \
- v[i ] = (left[size - 1 - i] + left[size - 2 - i] * 2 + left[size - 3 - i] + 2) >> 2; \
- v[size + 1 + i] = (top[i] + top[i + 1] * 2 + top[i + 2] + 2) >> 2; \
+ v[i ] = (left[i] + left[i + 1] * 2 + left[i + 2] + 2) >> 2; \
+ v[size + 1 + i] = (top[i] + top[i + 1] * 2 + top[i + 2] + 2) >> 2; \
} \
- v[size - 2] = (left[1] + left[0] * 2 + top[-1] + 2) >> 2; \
- v[size - 1] = (left[0] + top[-1] * 2 + top[ 0] + 2) >> 2; \
+ v[size - 2] = (left[size - 2] + left[size - 1] * 2 + top[-1] + 2) >> 2; \
+ v[size - 1] = (left[size - 1] + top[-1] * 2 + top[ 0] + 2) >> 2; \
v[size ] = (top[-1] + top[0] * 2 + top[ 1] + 2) >> 2; \
\
for (j = 0; j < size; j++) \
@@ -651,7 +651,7 @@ static void vert_right_4x4_c(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top)
{
int tl = top[-1], a0 = top[0], a1 = top[1], a2 = top[2], a3 = top[3],
- l0 = left[0], l1 = left[1], l2 = left[2];
+ l0 = left[3], l1 = left[2], l2 = left[1];
DST(0,3) = (l0 + l1 * 2 + l2 + 2) >> 2;
DST(0,2) = (tl + l0 * 2 + l1 + 2) >> 2;
@@ -673,14 +673,14 @@ static void vert_right_##size##x##size##_c(uint8_t *dst, ptrdiff_t stride, \
uint8_t ve[size + size/2 - 1], vo[size + size/2 - 1]; \
\
for (i = 0; i < size/2 - 2; i++) { \
- vo[i] = (left[size - 4 - i*2] + left[size - 3 - i*2] * 2 + left[size - 2 - i*2] + 2) >> 2; \
- ve[i] = (left[size - 5 - i*2] + left[size - 4 - i*2] * 2 + left[size - 3 - i*2] + 2) >> 2; \
+ vo[i] = (left[i*2 + 3] + left[i*2 + 2] * 2 + left[i*2 + 1] + 2) >> 2; \
+ ve[i] = (left[i*2 + 4] + left[i*2 + 3] * 2 + left[i*2 + 2] + 2) >> 2; \
} \
- vo[size/2 - 2] = (left[0] + left[1] * 2 + left[2] + 2) >> 2; \
- ve[size/2 - 2] = (top[-1] + left[0] * 2 + left[1] + 2) >> 2; \
+ vo[size/2 - 2] = (left[size - 1] + left[size - 2] * 2 + left[size - 3] + 2) >> 2; \
+ ve[size/2 - 2] = (top[-1] + left[size - 1] * 2 + left[size - 2] + 2) >> 2; \
\
ve[size/2 - 1] = (top[-1] + top[0] + 1) >> 1; \
- vo[size/2 - 1] = (left[0] + top[-1] * 2 + top[0] + 2) >> 2; \
+ vo[size/2 - 1] = (left[size - 1] + top[-1] * 2 + top[0] + 2) >> 2; \
for (i = 0; i < size - 1; i++) { \
ve[size/2 + i] = (top[i] + top[i + 1] + 1) >> 1; \
vo[size/2 + i] = (top[i - 1] + top[i] * 2 + top[i + 1] + 2) >> 2; \
@@ -699,7 +699,7 @@ def_vert_right(32)
static void hor_down_4x4_c(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top)
{
- int l0 = left[0], l1 = left[1], l2 = left[2], l3 = left[3],
+ int l0 = left[3], l1 = left[2], l2 = left[1], l3 = left[0],
tl = top[-1], a0 = top[0], a1 = top[1], a2 = top[2];
DST(2,0) = (tl + a0 * 2 + a1 + 2) >> 2;
@@ -722,14 +722,14 @@ static void hor_down_##size##x##size##_c(uint8_t *dst, ptrdiff_t stride, \
uint8_t v[size * 3 - 2]; \
\
for (i = 0; i < size - 2; i++) { \
- v[i*2 ] = (left[size - 2 - i] + left[size - 1 - i] + 1) >> 1; \
- v[i*2 + 1] = (left[size - 3 - i] + left[size - 2 - i] * 2 + left[size - 1 - i] + 2) >> 2; \
+ v[i*2 ] = (left[i + 1] + left[i + 0] + 1) >> 1; \
+ v[i*2 + 1] = (left[i + 2] + left[i + 1] * 2 + left[i + 0] + 2) >> 2; \
v[size*2 + i] = (top[i - 1] + top[i] * 2 + top[i + 1] + 2) >> 2; \
} \
- v[size*2 - 2] = (top[-1] + left[0] + 1) >> 1; \
- v[size*2 - 4] = (left[0] + left[1] + 1) >> 1; \
- v[size*2 - 1] = (top[0] + top[-1] * 2 + left[0] + 2) >> 2; \
- v[size*2 - 3] = (top[-1] + left[0] * 2 + left[1] + 2) >> 2; \
+ v[size*2 - 2] = (top[-1] + left[size - 1] + 1) >> 1; \
+ v[size*2 - 4] = (left[size - 1] + left[size - 2] + 1) >> 1; \
+ v[size*2 - 1] = (top[0] + top[-1] * 2 + left[size - 1] + 2) >> 2; \
+ v[size*2 - 3] = (top[-1] + left[size - 1] * 2 + left[size - 2] + 2) >> 2; \
\
for (j = 0; j < size; j++) \
memcpy(dst + j*stride, v + size*2 - 2 - j*2, size); \
@@ -786,7 +786,7 @@ def_vert_left(32)
static void hor_up_4x4_c(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top)
{
- int l0 = left[0], l1 = left[1], l2 = left[2], l3 = left[3];
+ int l0 = left[3], l1 = left[2], l2 = left[1], l3 = left[0];
DST(0,0) = (l0 + l1 + 1) >> 1;
DST(1,0) = (l0 + l1 * 2 + l2 + 2) >> 2;
@@ -805,17 +805,17 @@ static void hor_up_##size##x##size##_c(uint8_t *dst, ptrdiff_t stride, \
uint8_t v[size*2 - 2]; \
\
for (i = 0; i < size - 2; i++) { \
- v[i*2 ] = (left[i] + left[i + 1] + 1) >> 1; \
- v[i*2 + 1] = (left[i] + left[i + 1] * 2 + left[i + 2] + 2) >> 2; \
+ v[i*2 ] = (left[size - i - 1] + left[size - i - 2] + 1) >> 1; \
+ v[i*2 + 1] = (left[size - i - 1] + left[size - i - 2] * 2 + left[size - i - 3] + 2) >> 2; \
} \
- v[size*2 - 4] = (left[size - 2] + left[size - 1] + 1) >> 1; \
- v[size*2 - 3] = (left[size - 2] + left[size - 1] * 3 + 2) >> 2; \
+ v[size*2 - 4] = (left[1] + left[0] + 1) >> 1; \
+ v[size*2 - 3] = (left[1] + left[0] * 3 + 2) >> 2; \
\
for (j = 0; j < size / 2; j++) \
memcpy(dst + j*stride, v + j*2, size); \
for (j = size / 2; j < size; j++) { \
memcpy(dst + j*stride, v + j*2, size*2 - 2 - j*2); \
- memset(dst + j*stride + size*2 - 2 - j*2, left[size - 1], \
+ memset(dst + j*stride + size*2 - 2 - j*2, left[0], \
2 + j*2 - size); \
} \
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9dsp.h b/chromium/third_party/ffmpeg/libavcodec/vp9dsp.h
index 74124e44bed..db0a92e210c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9dsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9dsp.h
@@ -104,7 +104,7 @@ typedef struct VP9DSPContext {
* dimension 2: filter type (0: smooth, 1: regular, 2: sharp, 3: bilin)
* dimension 3: averaging type (0: put, 1: avg)
* dimension 4: x subpel interpolation (0: none, 1: 8tap/bilin)
- * dimension 5: y subpel interpolation (1: none, 1: 8tap/bilin)
+ * dimension 5: y subpel interpolation (0: none, 1: 8tap/bilin)
*
* dst/stride are aligned by hsize
*/
diff --git a/chromium/third_party/ffmpeg/libavcodec/vqavideo.c b/chromium/third_party/ffmpeg/libavcodec/vqavideo.c
index 911e71339c4..c34849d5773 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vqavideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vqavideo.c
@@ -179,7 +179,7 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
/* allocate decode buffer */
s->decode_buffer_size = (s->width / s->vector_width) *
(s->height / s->vector_height) * 2;
- s->decode_buffer = av_malloc(s->decode_buffer_size);
+ s->decode_buffer = av_mallocz(s->decode_buffer_size);
if (!s->decode_buffer)
goto fail;
@@ -238,7 +238,7 @@ static int decode_format80(VqaContext *s, int src_size,
/* 0x80 means that frame is finished */
if (opcode == 0x80)
- return 0;
+ break;
if (dest_index >= dest_size) {
av_log(s->avctx, AV_LOG_ERROR, "decode_format80 problem: dest_index (%d) exceeded dest_size (%d)\n",
@@ -303,9 +303,11 @@ static int decode_format80(VqaContext *s, int src_size,
* codebook entry; it is not important for compressed codebooks because
* not every entry needs to be filled */
if (check_size)
- if (dest_index < dest_size)
+ if (dest_index < dest_size) {
av_log(s->avctx, AV_LOG_ERROR, "decode_format80 problem: decode finished with dest_index (%d) < dest_size (%d)\n",
dest_index, dest_size);
+ memset(dest + dest_index, 0, dest_size - dest_index);
+ }
return 0; // let's display what we decoded anyway
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/wavpack.c b/chromium/third_party/ffmpeg/libavcodec/wavpack.c
index 6036a5c7ddf..a2d82e6c2ec 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wavpack.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wavpack.c
@@ -487,6 +487,13 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb,
} while (!last && count < s->samples);
wv_reset_saved_context(s);
+
+ if (last && count < s->samples) {
+ int size = av_get_bytes_per_sample(type);
+ memset((uint8_t*)dst_l + count*size, 0, (s->samples-count)*size);
+ memset((uint8_t*)dst_r + count*size, 0, (s->samples-count)*size);
+ }
+
if ((s->avctx->err_recognition & AV_EF_CRCCHECK) &&
wv_check_crc(s, crc, crc_extra_bits))
return AVERROR_INVALIDDATA;
@@ -548,6 +555,12 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb,
} while (!last && count < s->samples);
wv_reset_saved_context(s);
+
+ if (last && count < s->samples) {
+ int size = av_get_bytes_per_sample(type);
+ memset((uint8_t*)dst + count*size, 0, (s->samples-count)*size);
+ }
+
if (s->avctx->err_recognition & AV_EF_CRCCHECK) {
int ret = wv_check_crc(s, crc, crc_extra_bits);
if (ret < 0 && s->avctx->err_recognition & AV_EF_EXPLODE)
@@ -609,7 +622,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
ThreadFrame tframe = { .f = frame };
WavpackFrameContext *s;
GetByteContext gb;
- void *samples_l, *samples_r;
+ void *samples_l = NULL, *samples_r = NULL;
int ret;
int got_terms = 0, got_weights = 0, got_samples = 0,
got_entropy = 0, got_bs = 0, got_float = 0, got_hybrid = 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/webp.c b/chromium/third_party/ffmpeg/libavcodec/webp.c
index c6d41bea15c..19cb1fc2236 100644
--- a/chromium/third_party/ffmpeg/libavcodec/webp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/webp.c
@@ -31,16 +31,20 @@
* Lossless decoder
* Compressed alpha for lossy
*
+ * @author James Almer <jamrial@gmail.com>
+ * Exif metadata
+ *
* Unimplemented:
* - Animation
* - ICC profile
- * - Exif and XMP metadata
+ * - XMP metadata
*/
#define BITSTREAM_READER_LE
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
+#include "exif.h"
#include "internal.h"
#include "get_bits.h"
#include "thread.h"
@@ -191,6 +195,8 @@ typedef struct WebPContext {
enum AlphaFilter alpha_filter; /* filtering method for alpha chunk */
uint8_t *alpha_data; /* alpha chunk data */
int alpha_data_size; /* alpha chunk data size */
+ int has_exif; /* set after an EXIF chunk has been processed */
+ AVDictionary *exif_metadata; /* EXIF chunk data */
int width; /* image width */
int height; /* image height */
int lossless; /* indicates lossless or lossy */
@@ -303,7 +309,7 @@ static int huff_reader_build_canonical(HuffReader *r, int *code_lengths,
if (max_code_length == 0 || max_code_length > MAX_HUFFMAN_CODE_LENGTH)
return AVERROR(EINVAL);
- codes = av_malloc(alphabet_size * sizeof(*codes));
+ codes = av_malloc_array(alphabet_size, sizeof(*codes));
if (!codes)
return AVERROR(ENOMEM);
@@ -1326,6 +1332,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s->height = 0;
*got_frame = 0;
s->has_alpha = 0;
+ s->has_exif = 0;
bytestream2_init(&gb, avpkt->data, avpkt->size);
if (bytestream2_get_bytes_left(&gb) < 12)
@@ -1345,6 +1352,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return AVERROR_INVALIDDATA;
}
+ av_dict_free(&s->exif_metadata);
while (bytestream2_get_bytes_left(&gb) > 0) {
char chunk_str[5] = { 0 };
@@ -1418,10 +1426,44 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
break;
}
+ case MKTAG('E', 'X', 'I', 'F'): {
+ int le, ifd_offset, exif_offset = bytestream2_tell(&gb);
+ GetByteContext exif_gb;
+
+ if (s->has_exif) {
+ av_log(avctx, AV_LOG_VERBOSE, "Ignoring extra EXIF chunk\n");
+ goto exif_end;
+ }
+ if (!(vp8x_flags & VP8X_FLAG_EXIF_METADATA))
+ av_log(avctx, AV_LOG_WARNING,
+ "EXIF chunk present, but Exif bit not set in the "
+ "VP8X header\n");
+
+ s->has_exif = 1;
+ bytestream2_init(&exif_gb, avpkt->data + exif_offset,
+ avpkt->size - exif_offset);
+ if (ff_tdecode_header(&exif_gb, &le, &ifd_offset) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "invalid TIFF header "
+ "in Exif data\n");
+ goto exif_end;
+ }
+
+ bytestream2_seek(&exif_gb, ifd_offset, SEEK_SET);
+ if (avpriv_exif_decode_ifd(avctx, &exif_gb, le, 0, &s->exif_metadata) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "error decoding Exif data\n");
+ goto exif_end;
+ }
+
+ av_dict_copy(avpriv_frame_get_metadatap(data), s->exif_metadata, 0);
+
+exif_end:
+ av_dict_free(&s->exif_metadata);
+ bytestream2_skip(&gb, chunk_size);
+ break;
+ }
case MKTAG('I', 'C', 'C', 'P'):
case MKTAG('A', 'N', 'I', 'M'):
case MKTAG('A', 'N', 'M', 'F'):
- case MKTAG('E', 'X', 'I', 'F'):
case MKTAG('X', 'M', 'P', ' '):
AV_WL32(chunk_str, chunk_type);
av_log(avctx, AV_LOG_VERBOSE, "skipping unsupported chunk: %s\n",
diff --git a/chromium/third_party/ffmpeg/libavcodec/wma.c b/chromium/third_party/ffmpeg/libavcodec/wma.c
index 0122ee6fe3f..f2519f543ba 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wma.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wma.c
@@ -45,10 +45,10 @@ static av_cold void init_coef_vlc(VLC *vlc, uint16_t **prun_table,
init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
- run_table = av_malloc(n * sizeof(uint16_t));
- level_table = av_malloc(n * sizeof(uint16_t));
- flevel_table= av_malloc(n * sizeof(*flevel_table));
- int_table = av_malloc(n * sizeof(uint16_t));
+ run_table = av_malloc_array(n, sizeof(uint16_t));
+ level_table = av_malloc_array(n, sizeof(uint16_t));
+ flevel_table= av_malloc_array(n, sizeof(*flevel_table));
+ int_table = av_malloc_array(n, sizeof(uint16_t));
i = 2;
level = 1;
k = 0;
@@ -386,9 +386,9 @@ int ff_wma_end(AVCodecContext *avctx)
}
for (i = 0; i < 2; i++) {
ff_free_vlc(&s->coef_vlc[i]);
- av_free(s->run_table[i]);
- av_free(s->level_table[i]);
- av_free(s->int_table[i]);
+ av_freep(&s->run_table[i]);
+ av_freep(&s->level_table[i]);
+ av_freep(&s->int_table[i]);
}
return 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmadec.c b/chromium/third_party/ffmpeg/libavcodec/wmadec.c
index e6a0b04779e..466c1a9a105 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmadec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmadec.c
@@ -100,6 +100,9 @@ static av_cold int wma_decode_init(AVCodecContext * avctx)
}
}
+ for (i=0; i<MAX_CHANNELS; i++)
+ s->max_exponent[i] = 1.0;
+
if(ff_wma_init(avctx, flags2)<0)
return -1;
@@ -924,7 +927,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
samples_offset += s->frame_len;
}
- av_dlog(s->avctx, "%d %d %d %d outbytes:%td eaten:%d\n",
+ av_dlog(s->avctx, "%d %d %d %d outbytes:%"PTRDIFF_SPECIFIER" eaten:%d\n",
s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len,
(int8_t *)samples - (int8_t *)data, avctx->block_align);
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmalosslessdec.c b/chromium/third_party/ffmpeg/libavcodec/wmalosslessdec.c
index 7a80248ffc4..99139eba78e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmalosslessdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmalosslessdec.c
@@ -22,6 +22,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
@@ -127,8 +129,8 @@ typedef struct WmallDecodeCtx {
int8_t mclms_order;
int8_t mclms_scaling;
- int16_t mclms_coeffs[128];
- int16_t mclms_coeffs_cur[4];
+ int16_t mclms_coeffs[WMALL_MAX_CHANNELS * WMALL_MAX_CHANNELS * 32];
+ int16_t mclms_coeffs_cur[WMALL_MAX_CHANNELS * WMALL_MAX_CHANNELS];
int16_t mclms_prevvalues[WMALL_MAX_CHANNELS * 2 * 32];
int16_t mclms_updates[WMALL_MAX_CHANNELS * 2 * 32];
int mclms_recent;
@@ -197,7 +199,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
avpriv_report_missing_feature(avctx, "Bit-depth higher than 16");
return AVERROR_PATCHWELCOME;
} else {
- av_log(avctx, AV_LOG_ERROR, "Unknown bit-depth: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "Unknown bit-depth: %"PRIu8"\n",
s->bits_per_sample);
return AVERROR_INVALIDDATA;
}
@@ -239,7 +241,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->bV3RTM = s->decode_flags & 0x100;
if (s->max_num_subframes > MAX_SUBFRAMES) {
- av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %i\n",
+ av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %"PRIu8"\n",
s->max_num_subframes);
return AVERROR_INVALIDDATA;
}
@@ -257,7 +259,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
if (s->num_channels < 0) {
- av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n",
+ av_log(avctx, AV_LOG_ERROR, "invalid number of channels %"PRId8"\n",
s->num_channels);
return AVERROR_INVALIDDATA;
} else if (s->num_channels > WMALL_MAX_CHANNELS) {
@@ -348,11 +350,11 @@ static int decode_tilehdr(WmallDecodeCtx *s)
if (num_samples[c] == min_channel_len) {
if (fixed_channel_layout || channels_for_cur_subframe == 1 ||
(min_channel_len == s->samples_per_frame - s->min_samples_per_subframe)) {
- contains_subframe[c] = in_use = 1;
+ contains_subframe[c] = 1;
} else {
- if (get_bits1(&s->gb))
- contains_subframe[c] = in_use = 1;
+ contains_subframe[c] = get_bits1(&s->gb);
}
+ in_use |= contains_subframe[c];
} else
contains_subframe[c] = 0;
}
@@ -382,7 +384,7 @@ static int decode_tilehdr(WmallDecodeCtx *s)
++chan->num_subframes;
if (num_samples[c] > s->samples_per_frame) {
av_log(s->avctx, AV_LOG_ERROR, "broken frame: "
- "channel len(%d) > samples_per_frame(%d)\n",
+ "channel len(%"PRIu16") > samples_per_frame(%"PRIu16")\n",
num_samples[c], s->samples_per_frame);
return AVERROR_INVALIDDATA;
}
@@ -652,10 +654,10 @@ static void mclms_update(WmallDecodeCtx *s, int icoef, int *pred)
if (s->mclms_recent == 0) {
memcpy(&s->mclms_prevvalues[order * num_channels],
s->mclms_prevvalues,
- 2 * order * num_channels);
+ sizeof(int16_t) * order * num_channels);
memcpy(&s->mclms_updates[order * num_channels],
s->mclms_updates,
- 2 * order * num_channels);
+ sizeof(int16_t) * order * num_channels);
s->mclms_recent = num_channels * order;
}
}
@@ -1038,9 +1040,10 @@ static int decode_frame(WmallDecodeCtx *s)
len = get_bits(gb, s->log2_frame_size);
/* decode tile information */
- if (decode_tilehdr(s)) {
+ if ((ret = decode_tilehdr(s))) {
s->packet_loss = 1;
- return 0;
+ av_frame_unref(s->frame);
+ return ret;
}
/* read drc info */
@@ -1075,8 +1078,11 @@ static int decode_frame(WmallDecodeCtx *s)
/* decode all subframes */
while (!s->parsed_all_subframes) {
+ int decoded_samples = s->channel[0].decoded_samples;
if (decode_subframe(s) < 0) {
s->packet_loss = 1;
+ if (s->frame->nb_samples)
+ s->frame->nb_samples = decoded_samples;
return 0;
}
}
@@ -1090,7 +1096,8 @@ static int decode_frame(WmallDecodeCtx *s)
if (len != (get_bits_count(gb) - s->frame_offset) + 2) {
/* FIXME: not sure if this is always an error */
av_log(s->avctx, AV_LOG_ERROR,
- "frame[%i] would have to skip %i bits\n", s->frame_num,
+ "frame[%"PRIu32"] would have to skip %i bits\n",
+ s->frame_num,
len - (get_bits_count(gb) - s->frame_offset) - 1);
s->packet_loss = 1;
return 0;
@@ -1209,7 +1216,8 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
if (!s->packet_loss &&
((s->packet_sequence_number + 1) & 0xF) != packet_sequence_number) {
s->packet_loss = 1;
- av_log(avctx, AV_LOG_ERROR, "Packet loss detected! seq %x vs %x\n",
+ av_log(avctx, AV_LOG_ERROR,
+ "Packet loss detected! seq %"PRIx8" vs %x\n",
s->packet_sequence_number, packet_sequence_number);
}
s->packet_sequence_number = packet_sequence_number;
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmaprodec.c b/chromium/third_party/ffmpeg/libavcodec/wmaprodec.c
index d57c24dddf5..2f6c4858919 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmaprodec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmaprodec.c
@@ -86,6 +86,8 @@
* subframe in order to reconstruct the output samples.
*/
+#include <inttypes.h>
+
#include "libavutil/float_dsp.h"
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
@@ -237,7 +239,7 @@ typedef struct WMAProDecodeCtx {
static av_cold void dump_context(WMAProDecodeCtx *s)
{
#define PRINT(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %d\n", a, b);
-#define PRINT_HEX(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %x\n", a, b);
+#define PRINT_HEX(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %"PRIx32"\n", a, b);
PRINT("ed sample bit depth", s->bits_per_sample);
PRINT_HEX("ed decode flags", s->decode_flags);
@@ -336,7 +338,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->dynamic_range_compression = (s->decode_flags & 0x80);
if (s->max_num_subframes > MAX_SUBFRAMES) {
- av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %i\n",
+ av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %"PRId8"\n",
s->max_num_subframes);
return AVERROR_INVALIDDATA;
}
@@ -1421,7 +1423,8 @@ static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
if (len != (get_bits_count(gb) - s->frame_offset) + 2) {
/** FIXME: not sure if this is always an error */
av_log(s->avctx, AV_LOG_ERROR,
- "frame[%i] would have to skip %i bits\n", s->frame_num,
+ "frame[%"PRIu32"] would have to skip %i bits\n",
+ s->frame_num,
len - (get_bits_count(gb) - s->frame_offset) - 1);
s->packet_loss = 1;
return 0;
@@ -1553,7 +1556,8 @@ static int decode_packet(AVCodecContext *avctx, void *data,
if (!s->packet_loss &&
((s->packet_sequence_number + 1) & 0xF) != packet_sequence_number) {
s->packet_loss = 1;
- av_log(avctx, AV_LOG_ERROR, "Packet loss detected! seq %x vs %x\n",
+ av_log(avctx, AV_LOG_ERROR,
+ "Packet loss detected! seq %"PRIx8" vs %x\n",
s->packet_sequence_number, packet_sequence_number);
}
s->packet_sequence_number = packet_sequence_number;
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmv2.c b/chromium/third_party/ffmpeg/libavcodec/wmv2.c
index 30c8bc1d3a6..b8df6ca065d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmv2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmv2.c
@@ -117,17 +117,17 @@ void ff_mspel_motion(MpegEncContext *s,
uvlinesize = s->uvlinesize;
ptr = ref_picture[0] + (src_y * linesize) + src_x;
- if(src_x<1 || src_y<1 || src_x + 17 >= s->h_edge_pos
- || src_y + h+1 >= v_edge_pos){
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
- ptr - 1 - s->linesize,
- s->linesize, s->linesize,
- 19, 19,
- src_x - 1, src_y - 1,
- s->h_edge_pos, s->v_edge_pos);
- ptr= s->edge_emu_buffer + 1 + s->linesize;
- emu=1;
- }
+ if(src_x<1 || src_y<1 || src_x + 17 >= s->h_edge_pos
+ || src_y + h+1 >= v_edge_pos){
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ ptr - 1 - s->linesize,
+ s->linesize, s->linesize,
+ 19, 19,
+ src_x - 1, src_y - 1,
+ s->h_edge_pos, s->v_edge_pos);
+ ptr= s->edge_emu_buffer + 1 + s->linesize;
+ emu=1;
+ }
s->dsp.put_mspel_pixels_tab[dxy](dest_y , ptr , linesize);
s->dsp.put_mspel_pixels_tab[dxy](dest_y+8 , ptr+8 , linesize);
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c b/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c
index 4f2a5e996dc..f35c818fc56 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c
@@ -19,6 +19,7 @@
*/
#include "avcodec.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "h263.h"
#include "mathops.h"
@@ -476,5 +477,8 @@ AVCodec ff_wmv2_decoder = {
.close = wmv2_decode_end,
.decode = ff_h263_decode_frame,
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
- .pix_fmts = ff_pixfmt_list_420,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/wnv1.c b/chromium/third_party/ffmpeg/libavcodec/wnv1.c
index d8532e4b16b..99aee3cd1c5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wnv1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wnv1.c
@@ -78,6 +78,7 @@ static int decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
return AVERROR(ENOMEM);
}
+ memset(rbuf + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
av_free(rbuf);
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/Makefile b/chromium/third_party/ffmpeg/libavcodec/x86/Makefile
index 2d2d5a09af2..1607d42b90e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/Makefile
@@ -1,28 +1,37 @@
OBJS += x86/constants.o \
x86/fmtconvert_init.o \
-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o
OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_init.o
-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp.o
OBJS-$(CONFIG_DCT) += x86/dct_init.o
-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o
OBJS-$(CONFIG_DSPUTIL) += x86/dsputil_init.o \
x86/dsputil_x86.o
OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o \
x86/fdct.o \
x86/motion_est.o
OBJS-$(CONFIG_FFT) += x86/fft_init.o
+OBJS-$(CONFIG_FLAC_DECODER) += x86/flacdsp_init.o
+OBJS-$(CONFIG_FLAC_ENCODER) += x86/flacdsp_init.o
OBJS-$(CONFIG_H263DSP) += x86/h263dsp_init.o
OBJS-$(CONFIG_H264CHROMA) += x86/h264chroma_init.o
OBJS-$(CONFIG_H264DSP) += x86/h264dsp_init.o
OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o
OBJS-$(CONFIG_H264QPEL) += x86/h264_qpel.o
+OBJS-$(CONFIG_HEVC_DECODER) += x86/hevcdsp_init.o
OBJS-$(CONFIG_HPELDSP) += x86/hpeldsp_init.o
+OBJS-$(CONFIG_LLVIDDSP) += x86/lossless_videodsp_init.o
OBJS-$(CONFIG_LPC) += x86/lpc.o
-OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o
OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodsp.o
OBJS-$(CONFIG_MPEGVIDEO) += x86/mpegvideo.o
OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoenc.o
+OBJS-$(CONFIG_VIDEODSP) += x86/videodsp_init.o
+OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp_init.o
+OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
+
+OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o
+OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp.o
+OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp_init.o
+OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc_init.o
+OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o
OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp_init.o
OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp_init.o
OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp_init.o
@@ -30,27 +39,25 @@ OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp_init.o
OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp_init.o \
x86/rv40dsp_init.o
OBJS-$(CONFIG_V210_DECODER) += x86/v210-init.o
+OBJS-$(CONFIG_TTA_DECODER) += x86/ttadsp_init.o
OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp.o
OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_init.o
-OBJS-$(CONFIG_VIDEODSP) += x86/videodsp_init.o
OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp_init.o
-OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp_init.o
OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp_init.o
+OBJS-$(CONFIG_VP7_DECODER) += x86/vp8dsp_init.o
OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp_init.o
OBJS-$(CONFIG_VP9_DECODER) += x86/vp9dsp_init.o
OBJS-$(CONFIG_WEBP_DECODER) += x86/vp8dsp_init.o
-OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
MMX-OBJS-$(CONFIG_DSPUTIL) += x86/dsputil_mmx.o \
x86/fpel_mmx.o \
x86/idct_mmx_xvid.o \
x86/idct_sse2_xvid.o \
- x86/rnd_mmx.o \
x86/simple_idct.o
MMX-OBJS-$(CONFIG_DIRAC_DECODER) += x86/dirac_dwt.o
MMX-OBJS-$(CONFIG_HPELDSP) += x86/fpel_mmx.o \
- x86/hpeldsp_mmx.o \
- x86/rnd_mmx.o
+ x86/hpeldsp_mmx.o
+
MMX-OBJS-$(CONFIG_SNOW_DECODER) += x86/snowdsp.o
MMX-OBJS-$(CONFIG_SNOW_ENCODER) += x86/snowdsp.o
MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
@@ -58,17 +65,18 @@ MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
YASM-OBJS += x86/deinterlace.o \
x86/fmtconvert.o \
-YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o
YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o
YASM-OBJS-$(CONFIG_DCT) += x86/dct32.o
YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o\
x86/dwt_yasm.o
+YASM-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o
YASM-OBJS-$(CONFIG_DSPUTIL) += x86/dsputil.o \
x86/fpel.o \
x86/mpeg4qpel.o \
x86/qpel.o
YASM-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc.o
YASM-OBJS-$(CONFIG_FFT) += x86/fft.o
+YASM-OBJS-$(CONFIG_FLAC_DECODER) += x86/flacdsp.o
YASM-OBJS-$(CONFIG_H263DSP) += x86/h263_loopfilter.o
YASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \
x86/h264_chromamc_10bit.o
@@ -84,23 +92,33 @@ YASM-OBJS-$(CONFIG_H264QPEL) += x86/h264_qpel_8bit.o \
x86/h264_qpel_10bit.o \
x86/fpel.o \
x86/qpel.o
+YASM-OBJS-$(CONFIG_HEVC_DECODER) += x86/hevc_mc.o
YASM-OBJS-$(CONFIG_HPELDSP) += x86/fpel.o \
x86/hpeldsp.o
+YASM-OBJS-$(CONFIG_LLVIDDSP) += x86/lossless_videodsp.o
YASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36.o
+YASM-OBJS-$(CONFIG_VIDEODSP) += x86/videodsp.o
+YASM-OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp.o
+
+YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o
+YASM-OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp.o
YASM-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp.o
YASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o
YASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o
YASM-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp.o
YASM-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp.o \
x86/rv40dsp.o
+YASM-OBJS-$(CONFIG_TTA_DECODER) += x86/ttadsp.o
YASM-OBJS-$(CONFIG_V210_DECODER) += x86/v210.o
YASM-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp.o
-YASM-OBJS-$(CONFIG_VIDEODSP) += x86/videodsp.o
YASM-OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp.o
-YASM-OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp.o
YASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp.o
+YASM-OBJS-$(CONFIG_VP7_DECODER) += x86/vp8dsp.o \
+ x86/vp8dsp_loopfilter.o
YASM-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp.o \
x86/vp8dsp_loopfilter.o
-YASM-OBJS-$(CONFIG_VP9_DECODER) += x86/vp9itxfm.o \
+YASM-OBJS-$(CONFIG_VP9_DECODER) += x86/vp9intrapred.o \
+ x86/vp9itxfm.o \
+ x86/vp9lpf.o \
x86/vp9mc.o
YASM-OBJS-$(CONFIG_WEBP_DECODER) += x86/vp8dsp.o
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/ac3dsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/ac3dsp.asm
index 89a64f50d4b..b24441614b7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/ac3dsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/ac3dsp.asm
@@ -1,5 +1,5 @@
;*****************************************************************************
-;* x86-optimized AC-3 DSP utils
+;* x86-optimized AC-3 DSP functions
;* Copyright (c) 2011 Justin Ruggles
;*
;* This file is part of FFmpeg.
@@ -35,6 +35,10 @@ pw_bap_mul2: dw 5, 7, 0, 7, 5, 7, 0, 7
pd_1: times 4 dd 1
pd_151: times 4 dd 151
+; used in ff_apply_window_int16()
+pb_revwords: SHUFFLE_MASK_W 7, 6, 5, 4, 3, 2, 1, 0
+pd_16384: times 4 dd 16384
+
SECTION .text
;-----------------------------------------------------------------------------
@@ -419,3 +423,130 @@ AC3_EXTRACT_EXPONENTS
INIT_XMM ssse3
AC3_EXTRACT_EXPONENTS
%endif
+
+;-----------------------------------------------------------------------------
+; void ff_apply_window_int16(int16_t *output, const int16_t *input,
+; const int16_t *window, unsigned int len)
+;-----------------------------------------------------------------------------
+
+%macro REVERSE_WORDS 1-2
+%if cpuflag(ssse3) && notcpuflag(atom)
+ pshufb %1, %2
+%elif cpuflag(sse2)
+ pshuflw %1, %1, 0x1B
+ pshufhw %1, %1, 0x1B
+ pshufd %1, %1, 0x4E
+%elif cpuflag(mmxext)
+ pshufw %1, %1, 0x1B
+%endif
+%endmacro
+
+%macro MUL16FIXED 3
+%if cpuflag(ssse3) ; dst, src, unused
+; dst = ((dst * src) + (1<<14)) >> 15
+ pmulhrsw %1, %2
+%elif cpuflag(mmxext) ; dst, src, temp
+; dst = (dst * src) >> 15
+; pmulhw cuts off the bottom bit, so we have to lshift by 1 and add it back
+; in from the pmullw result.
+ mova %3, %1
+ pmulhw %1, %2
+ pmullw %3, %2
+ psrlw %3, 15
+ psllw %1, 1
+ por %1, %3
+%endif
+%endmacro
+
+%macro APPLY_WINDOW_INT16 1 ; %1 bitexact version
+%if %1
+cglobal apply_window_int16, 4,5,6, output, input, window, offset, offset2
+%else
+cglobal apply_window_int16_round, 4,5,6, output, input, window, offset, offset2
+%endif
+ lea offset2q, [offsetq-mmsize]
+%if cpuflag(ssse3) && notcpuflag(atom)
+ mova m5, [pb_revwords]
+ ALIGN 16
+%elif %1
+ mova m5, [pd_16384]
+%endif
+.loop:
+%if cpuflag(ssse3)
+ ; This version does the 16x16->16 multiplication in-place without expanding
+ ; to 32-bit. The ssse3 version is bit-identical.
+ mova m0, [windowq+offset2q]
+ mova m1, [ inputq+offset2q]
+ pmulhrsw m1, m0
+ REVERSE_WORDS m0, m5
+ pmulhrsw m0, [ inputq+offsetq ]
+ mova [outputq+offset2q], m1
+ mova [outputq+offsetq ], m0
+%elif %1
+ ; This version expands 16-bit to 32-bit, multiplies by the window,
+ ; adds 16384 for rounding, right shifts 15, then repacks back to words to
+ ; save to the output. The window is reversed for the second half.
+ mova m3, [windowq+offset2q]
+ mova m4, [ inputq+offset2q]
+ pxor m0, m0
+ punpcklwd m0, m3
+ punpcklwd m1, m4
+ pmaddwd m0, m1
+ paddd m0, m5
+ psrad m0, 15
+ pxor m2, m2
+ punpckhwd m2, m3
+ punpckhwd m1, m4
+ pmaddwd m2, m1
+ paddd m2, m5
+ psrad m2, 15
+ packssdw m0, m2
+ mova [outputq+offset2q], m0
+ REVERSE_WORDS m3
+ mova m4, [ inputq+offsetq]
+ pxor m0, m0
+ punpcklwd m0, m3
+ punpcklwd m1, m4
+ pmaddwd m0, m1
+ paddd m0, m5
+ psrad m0, 15
+ pxor m2, m2
+ punpckhwd m2, m3
+ punpckhwd m1, m4
+ pmaddwd m2, m1
+ paddd m2, m5
+ psrad m2, 15
+ packssdw m0, m2
+ mova [outputq+offsetq], m0
+%else
+ ; This version does the 16x16->16 multiplication in-place without expanding
+ ; to 32-bit. The mmxext and sse2 versions do not use rounding, and
+ ; therefore are not bit-identical to the C version.
+ mova m0, [windowq+offset2q]
+ mova m1, [ inputq+offset2q]
+ mova m2, [ inputq+offsetq ]
+ MUL16FIXED m1, m0, m3
+ REVERSE_WORDS m0
+ MUL16FIXED m2, m0, m3
+ mova [outputq+offset2q], m1
+ mova [outputq+offsetq ], m2
+%endif
+ add offsetd, mmsize
+ sub offset2d, mmsize
+ jae .loop
+ REP_RET
+%endmacro
+
+INIT_MMX mmxext
+APPLY_WINDOW_INT16 0
+INIT_XMM sse2
+APPLY_WINDOW_INT16 0
+
+INIT_MMX mmxext
+APPLY_WINDOW_INT16 1
+INIT_XMM sse2
+APPLY_WINDOW_INT16 1
+INIT_XMM ssse3
+APPLY_WINDOW_INT16 1
+INIT_XMM ssse3, atom
+APPLY_WINDOW_INT16 1
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/ac3dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/ac3dsp_init.c
index 5819d0021c6..30a85f996ea 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/ac3dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/ac3dsp_init.c
@@ -1,5 +1,5 @@
/*
- * x86-optimized AC-3 DSP utils
+ * x86-optimized AC-3 DSP functions
* Copyright (c) 2011 Justin Ruggles
*
* This file is part of FFmpeg.
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/attributes.h"
#include "libavutil/mem.h"
#include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
-#include "dsputil_x86.h"
#include "libavcodec/ac3.h"
#include "libavcodec/ac3dsp.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/cabac.h b/chromium/third_party/ffmpeg/libavcodec/x86/cabac.h
index 558d287032b..3510336f957 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/cabac.h
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/cabac.h
@@ -23,12 +23,13 @@
#include "libavcodec/cabac.h"
#include "libavutil/attributes.h"
+#include "libavutil/macros.h"
#include "libavutil/x86/asm.h"
-#include "libavutil/internal.h"
#include "config.h"
#if (defined(__i386) && defined(__clang__) && (__clang_major__<2 || (__clang_major__==2 && __clang_minor__<10)))\
- || ( !defined(__clang__) && defined(__llvm__) && __GNUC__==4 && __GNUC_MINOR__==2 && __GNUC_PATCHLEVEL__<=1)
+ || ( !defined(__clang__) && defined(__llvm__) && __GNUC__==4 && __GNUC_MINOR__==2 && __GNUC_PATCHLEVEL__<=1)\
+ || (defined(__INTEL_COMPILER) && defined(_MSC_VER))
# define BROKEN_COMPILER 1
#else
# define BROKEN_COMPILER 0
@@ -110,7 +111,7 @@
"2: \n\t"
#else /* BROKEN_RELOCATIONS */
-#define TABLES_ARG
+#define TABLES_ARG NAMED_CONSTRAINTS_ARRAY_ADD(ff_h264_cabac_tables)
#define RIP_ARG
#if HAVE_FAST_CMOV
@@ -184,6 +185,7 @@ static av_always_inline int get_cabac_inline_x86(CABACContext *c,
__asm__ volatile(
"lea "MANGLE(ff_h264_cabac_tables)", %0 \n\t"
: "=&r"(tables)
+ : NAMED_CONSTRAINTS_ARRAY(ff_h264_cabac_tables)
);
#endif
@@ -205,7 +207,7 @@ static av_always_inline int get_cabac_inline_x86(CABACContext *c,
);
return bit & 1;
}
-#endif /* HAVE_7REGS */
+#endif /* HAVE_7REGS && !BROKEN_COMPILER */
#if !BROKEN_COMPILER
#define get_cabac_bypass_sign get_cabac_bypass_sign_x86
@@ -218,7 +220,7 @@ static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
"shl $17, %k1 \n\t"
"add %%eax, %%eax \n\t"
"sub %k1, %%eax \n\t"
- "cltd \n\t"
+ "cdq \n\t"
"and %%edx, %k1 \n\t"
"add %k1, %%eax \n\t"
"xor %%edx, %%ecx \n\t"
@@ -265,7 +267,7 @@ static av_always_inline int get_cabac_bypass_x86(CABACContext *c)
"shl $17, %k1 \n\t"
"add %%eax, %%eax \n\t"
"sub %k1, %%eax \n\t"
- "cltd \n\t"
+ "cdq \n\t"
"and %%edx, %k1 \n\t"
"add %k1, %%eax \n\t"
"inc %%edx \n\t"
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/cavsdsp.c b/chromium/third_party/ffmpeg/libavcodec/x86/cavsdsp.c
index aaa09d1784a..b45126cf011 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/cavsdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/cavsdsp.c
@@ -30,6 +30,7 @@
#include "libavcodec/cavsdsp.h"
#include "constants.h"
#include "dsputil_x86.h"
+#include "fpel.h"
#include "config.h"
#if HAVE_MMX_INLINE
@@ -210,10 +211,10 @@ static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
****************************************************************************/
/* vertical filter [-1 -2 96 42 -7 0] */
-#define QPEL_CAVSV1(A,B,C,D,E,F,OP,MUL2) \
+#define QPEL_CAVSV1(A,B,C,D,E,F,OP,ADD, MUL1, MUL2) \
"movd (%0), "#F" \n\t"\
"movq "#C", %%mm6 \n\t"\
- "pmullw %5, %%mm6 \n\t"\
+ "pmullw "MANGLE(MUL1)", %%mm6\n\t"\
"movq "#D", %%mm7 \n\t"\
"pmullw "MANGLE(MUL2)", %%mm7\n\t"\
"psllw $3, "#E" \n\t"\
@@ -228,35 +229,35 @@ static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
"psubw "#B", %%mm6 \n\t"\
"psraw $1, "#B" \n\t"\
"psubw "#A", %%mm6 \n\t"\
- "paddw %4, %%mm6 \n\t"\
+ "paddw "MANGLE(ADD)", %%mm6 \n\t"\
"psraw $7, %%mm6 \n\t"\
"packuswb %%mm6, %%mm6 \n\t"\
OP(%%mm6, (%1), A, d) \
"add %3, %1 \n\t"
/* vertical filter [ 0 -1 5 5 -1 0] */
-#define QPEL_CAVSV2(A,B,C,D,E,F,OP,MUL2) \
+#define QPEL_CAVSV2(A,B,C,D,E,F,OP,ADD, MUL1, MUL2) \
"movd (%0), "#F" \n\t"\
"movq "#C", %%mm6 \n\t"\
"paddw "#D", %%mm6 \n\t"\
- "pmullw %5, %%mm6 \n\t"\
+ "pmullw "MANGLE(MUL1)", %%mm6\n\t"\
"add %2, %0 \n\t"\
"punpcklbw %%mm7, "#F" \n\t"\
"psubw "#B", %%mm6 \n\t"\
"psubw "#E", %%mm6 \n\t"\
- "paddw %4, %%mm6 \n\t"\
+ "paddw "MANGLE(ADD)", %%mm6 \n\t"\
"psraw $3, %%mm6 \n\t"\
"packuswb %%mm6, %%mm6 \n\t"\
OP(%%mm6, (%1), A, d) \
"add %3, %1 \n\t"
/* vertical filter [ 0 -7 42 96 -2 -1] */
-#define QPEL_CAVSV3(A,B,C,D,E,F,OP,MUL2) \
+#define QPEL_CAVSV3(A,B,C,D,E,F,OP,ADD, MUL1, MUL2) \
"movd (%0), "#F" \n\t"\
"movq "#C", %%mm6 \n\t"\
"pmullw "MANGLE(MUL2)", %%mm6\n\t"\
"movq "#D", %%mm7 \n\t"\
- "pmullw %5, %%mm7 \n\t"\
+ "pmullw "MANGLE(MUL1)", %%mm7\n\t"\
"psllw $3, "#B" \n\t"\
"psubw "#B", %%mm6 \n\t"\
"psraw $3, "#B" \n\t"\
@@ -269,7 +270,7 @@ static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
"psubw "#E", %%mm6 \n\t"\
"psraw $1, "#E" \n\t"\
"psubw "#F", %%mm6 \n\t"\
- "paddw %4, %%mm6 \n\t"\
+ "paddw "MANGLE(ADD)", %%mm6 \n\t"\
"psraw $7, %%mm6 \n\t"\
"packuswb %%mm6, %%mm6 \n\t"\
OP(%%mm6, (%1), A, d) \
@@ -298,32 +299,34 @@ static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
"punpcklbw %%mm7, %%mm2 \n\t"\
"punpcklbw %%mm7, %%mm3 \n\t"\
"punpcklbw %%mm7, %%mm4 \n\t"\
- VOP(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP, MUL2)\
- VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP, MUL2)\
- VOP(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP, MUL2)\
- VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP, MUL2)\
- VOP(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP, MUL2)\
- VOP(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP, MUL2)\
- VOP(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP, MUL2)\
- VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP, MUL2)\
+ VOP(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP, ADD, MUL1, MUL2)\
\
: "+a"(src), "+c"(dst)\
- : "S"((x86_reg)srcStride), "r"((x86_reg)dstStride), "m"(ADD), "m"(MUL1)\
+ : "S"((x86_reg)srcStride), "r"((x86_reg)dstStride)\
+ NAMED_CONSTRAINTS_ADD(ADD,MUL1,MUL2)\
: "memory"\
);\
if(h==16){\
__asm__ volatile(\
- VOP(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP, MUL2)\
- VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP, MUL2)\
- VOP(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP, MUL2)\
- VOP(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP, MUL2)\
- VOP(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP, MUL2)\
- VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP, MUL2)\
- VOP(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP, MUL2)\
- VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP, MUL2)\
+ VOP(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP, ADD, MUL1, MUL2)\
+ VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP, ADD, MUL1, MUL2)\
\
: "+a"(src), "+c"(dst)\
- : "S"((x86_reg)srcStride), "r"((x86_reg)dstStride), "m"(ADD), "m"(MUL1)\
+ : "S"((x86_reg)srcStride), "r"((x86_reg)dstStride)\
+ NAMED_CONSTRAINTS_ADD(ADD,MUL1,MUL2)\
: "memory"\
);\
}\
@@ -336,7 +339,7 @@ static void OPNAME ## cavs_qpel8_h_ ## MMX(uint8_t *dst, uint8_t *src, int dstSt
int h=8;\
__asm__ volatile(\
"pxor %%mm7, %%mm7 \n\t"\
- "movq %5, %%mm6 \n\t"\
+ "movq "MANGLE(ff_pw_5)", %%mm6\n\t"\
"1: \n\t"\
"movq (%0), %%mm0 \n\t"\
"movq 1(%0), %%mm2 \n\t"\
@@ -362,7 +365,7 @@ static void OPNAME ## cavs_qpel8_h_ ## MMX(uint8_t *dst, uint8_t *src, int dstSt
"paddw %%mm3, %%mm5 \n\t"\
"psubw %%mm2, %%mm0 \n\t"\
"psubw %%mm5, %%mm1 \n\t"\
- "movq %6, %%mm5 \n\t"\
+ "movq "MANGLE(ff_pw_4)", %%mm5\n\t"\
"paddw %%mm5, %%mm0 \n\t"\
"paddw %%mm5, %%mm1 \n\t"\
"psraw $3, %%mm0 \n\t"\
@@ -374,7 +377,8 @@ static void OPNAME ## cavs_qpel8_h_ ## MMX(uint8_t *dst, uint8_t *src, int dstSt
"decl %2 \n\t"\
" jnz 1b \n\t"\
: "+a"(src), "+c"(dst), "+m"(h)\
- : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_4)\
+ : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride)\
+ NAMED_CONSTRAINTS_ADD(ff_pw_4,ff_pw_5)\
: "memory"\
);\
}\
@@ -384,7 +388,7 @@ static inline void OPNAME ## cavs_qpel8or16_v1_ ## MMX(uint8_t *dst, uint8_t *sr
}\
\
static inline void OPNAME ## cavs_qpel8or16_v2_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
- QPEL_CAVSVNUM(QPEL_CAVSV2,OP,ff_pw_4,ff_pw_5,ff_pw_5) \
+ QPEL_CAVSVNUM(QPEL_CAVSV2,OP,ff_pw_4,ff_pw_5,ff_pw_42) \
}\
\
static inline void OPNAME ## cavs_qpel8or16_v3_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/constants.h b/chromium/third_party/ffmpeg/libavcodec/x86/constants.h
index 8097bc49f0f..4bf74ff76c8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/constants.h
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/constants.h
@@ -31,6 +31,7 @@ extern const xmm_reg ff_pw_3;
extern const xmm_reg ff_pw_4;
extern const xmm_reg ff_pw_5;
extern const xmm_reg ff_pw_8;
+extern const xmm_reg ff_pw_9;
extern const uint64_t ff_pw_15;
extern const xmm_reg ff_pw_16;
extern const xmm_reg ff_pw_18;
@@ -45,6 +46,7 @@ extern const uint64_t ff_pw_255;
extern const xmm_reg ff_pb_1;
extern const xmm_reg ff_pb_3;
+extern const xmm_reg ff_pb_80;
extern const xmm_reg ff_pb_F8;
extern const uint64_t ff_pb_FC;
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dca.h b/chromium/third_party/ffmpeg/libavcodec/x86/dca.h
new file mode 100644
index 00000000000..c9be50d065b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dca.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2012-2014 Christophe Gisquet <christophe.gisquet@gmail.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
+ */
+
+#ifndef AVCODEC_X86_DCA_H
+#define AVCODEC_X86_DCA_H
+
+#include "config.h"
+
+#if ARCH_X86_64 && HAVE_SSE2_INLINE
+# include "libavutil/x86/asm.h"
+# include "libavutil/mem.h"
+#include "libavcodec/dcadsp.h"
+
+# define int8x8_fmul_int32 int8x8_fmul_int32
+static inline void int8x8_fmul_int32(av_unused DCADSPContext *dsp,
+ float *dst, const int8_t *src, int scale)
+{
+ DECLARE_ALIGNED(16, static const uint32_t, inverse16) = 0x3D800000;
+ __asm__ volatile (
+ "cvtsi2ss %2, %%xmm0 \n\t"
+ "mulss %3, %%xmm0 \n\t"
+ "movq (%1), %%xmm1 \n\t"
+ "punpcklbw %%xmm1, %%xmm1 \n\t"
+ "movaps %%xmm1, %%xmm2 \n\t"
+ "punpcklwd %%xmm1, %%xmm1 \n\t"
+ "punpckhwd %%xmm2, %%xmm2 \n\t"
+ "psrad $24, %%xmm1 \n\t"
+ "psrad $24, %%xmm2 \n\t"
+ "shufps $0, %%xmm0, %%xmm0 \n\t"
+ "cvtdq2ps %%xmm1, %%xmm1 \n\t"
+ "cvtdq2ps %%xmm2, %%xmm2 \n\t"
+ "mulps %%xmm0, %%xmm1 \n\t"
+ "mulps %%xmm0, %%xmm2 \n\t"
+ "movaps %%xmm1, 0(%0) \n\t"
+ "movaps %%xmm2, 16(%0) \n\t"
+ :: "r"(dst), "r"(src), "m"(scale), "m"(inverse16)
+ XMM_CLOBBERS_ONLY("xmm0", "xmm1", "xmm2")
+ );
+}
+
+#endif /* ARCH_X86_64 && HAVE_SSE2_INLINE */
+
+#endif /* AVCODEC_X86_DCA_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dcadsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/dcadsp.asm
new file mode 100644
index 00000000000..1ac237885a2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dcadsp.asm
@@ -0,0 +1,431 @@
+;******************************************************************************
+;* SSE-optimized functions for the DCA decoder
+;* Copyright (C) 2012-2014 Christophe Gisquet <christophe.gisquet@gmail.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 "libavutil/x86/x86util.asm"
+
+SECTION_RODATA
+pf_inv16: times 4 dd 0x3D800000 ; 1/16
+
+SECTION_TEXT
+
+; void decode_hf(float dst[DCA_SUBBANDS][8], const int32_t vq_num[DCA_SUBBANDS],
+; const int8_t hf_vq[1024][32], intptr_t vq_offset,
+; int32_t scale[DCA_SUBBANDS][2], intptr_t start, intptr_t end)
+
+%macro DECODE_HF 0
+cglobal decode_hf, 6,6,5, dst, num, src, offset, scale, start, end
+ lea srcq, [srcq + offsetq]
+ shl startq, 2
+ mov offsetd, endm
+%define DICT offsetq
+ shl offsetq, 2
+ mov endm, offsetq
+.loop:
+%if ARCH_X86_64
+ mov offsetd, [scaleq + 2 * startq]
+ cvtsi2ss m0, offsetd
+%else
+ cvtsi2ss m0, [scaleq + 2 * startq]
+%endif
+ mov offsetd, [numq + startq]
+ mulss m0, [pf_inv16]
+ shl DICT, 5
+ shufps m0, m0, 0
+%if cpuflag(sse2)
+%if cpuflag(sse4)
+ pmovsxbd m1, [srcq + DICT + 0]
+ pmovsxbd m2, [srcq + DICT + 4]
+%else
+ movq m1, [srcq + DICT]
+ punpcklbw m1, m1
+ mova m2, m1
+ punpcklwd m1, m1
+ punpckhwd m2, m2
+ psrad m1, 24
+ psrad m2, 24
+%endif
+ cvtdq2ps m1, m1
+ cvtdq2ps m2, m2
+%else
+ movd mm0, [srcq + DICT + 0]
+ movd mm1, [srcq + DICT + 4]
+ punpcklbw mm0, mm0
+ punpcklbw mm1, mm1
+ movq mm2, mm0
+ movq mm3, mm1
+ punpcklwd mm0, mm0
+ punpcklwd mm1, mm1
+ punpckhwd mm2, mm2
+ punpckhwd mm3, mm3
+ psrad mm0, 24
+ psrad mm1, 24
+ psrad mm2, 24
+ psrad mm3, 24
+ cvtpi2ps m1, mm0
+ cvtpi2ps m2, mm1
+ cvtpi2ps m3, mm2
+ cvtpi2ps m4, mm3
+ shufps m0, m0, 0
+ shufps m1, m3, q1010
+ shufps m2, m4, q1010
+%endif
+ mulps m1, m0
+ mulps m2, m0
+ mova [dstq + 8 * startq + 0], m1
+ mova [dstq + 8 * startq + 16], m2
+ add startq, 4
+ cmp startq, endm
+ jl .loop
+.end:
+%if notcpuflag(sse2)
+ emms
+%endif
+ REP_RET
+%endmacro
+
+%if ARCH_X86_32
+INIT_XMM sse
+DECODE_HF
+%endif
+
+INIT_XMM sse2
+DECODE_HF
+
+INIT_XMM sse4
+DECODE_HF
+
+; %1=v0/v1 %2=in1 %3=in2
+%macro FIR_LOOP 2-3
+.loop%1:
+%define va m1
+%define vb m2
+%if %1
+%define OFFSET 0
+%else
+%define OFFSET NUM_COEF*count
+%endif
+; for v0, incrementing and for v1, decrementing
+ mova va, [cf0q + OFFSET]
+ mova vb, [cf0q + OFFSET + 4*NUM_COEF]
+%if %0 == 3
+ mova m4, [cf0q + OFFSET + mmsize]
+ mova m0, [cf0q + OFFSET + 4*NUM_COEF + mmsize]
+%endif
+ mulps va, %2
+ mulps vb, %2
+%if %0 == 3
+%if cpuflag(fma3)
+ fmaddps va, m4, %3, va
+ fmaddps vb, m0, %3, vb
+%else
+ mulps m4, %3
+ mulps m0, %3
+ addps va, m4
+ addps vb, m0
+%endif
+%endif
+ ; va = va1 va2 va3 va4
+ ; vb = vb1 vb2 vb3 vb4
+%if %1
+ SWAP va, vb
+%endif
+ mova m4, va
+ unpcklps va, vb ; va3 vb3 va4 vb4
+ unpckhps m4, vb ; va1 vb1 va2 vb2
+ addps m4, va ; va1+3 vb1+3 va2+4 vb2+4
+ movhlps vb, m4 ; va1+3 vb1+3
+ addps vb, m4 ; va0..4 vb0..4
+ movlps [outq + count], vb
+%if %1
+ sub cf0q, 8*NUM_COEF
+%endif
+ add count, 8
+ jl .loop%1
+%endmacro
+
+; void dca_lfe_fir(float *out, float *in, float *coefs)
+%macro DCA_LFE_FIR 1
+cglobal dca_lfe_fir%1, 3,3,6-%1, out, in, cf0
+%define IN1 m3
+%define IN2 m5
+%define count inq
+%define NUM_COEF 4*(2-%1)
+%define NUM_OUT 32*(%1+1)
+
+ movu IN1, [inq + 4 - 1*mmsize]
+ shufps IN1, IN1, q0123
+%if %1 == 0
+ movu IN2, [inq + 4 - 2*mmsize]
+ shufps IN2, IN2, q0123
+%endif
+
+ mov count, -4*NUM_OUT
+ add cf0q, 4*NUM_COEF*NUM_OUT
+ add outq, 4*NUM_OUT
+ ; compute v0 first
+%if %1 == 0
+ FIR_LOOP 0, IN1, IN2
+%else
+ FIR_LOOP 0, IN1
+%endif
+ shufps IN1, IN1, q0123
+ mov count, -4*NUM_OUT
+ ; cf1 already correctly positioned
+ add outq, 4*NUM_OUT ; outq now at out2
+ sub cf0q, 8*NUM_COEF
+%if %1 == 0
+ shufps IN2, IN2, q0123
+ FIR_LOOP 1, IN2, IN1
+%else
+ FIR_LOOP 1, IN1
+%endif
+ RET
+%endmacro
+
+INIT_XMM sse
+DCA_LFE_FIR 0
+DCA_LFE_FIR 1
+%if HAVE_FMA3_EXTERNAL
+INIT_XMM fma3
+DCA_LFE_FIR 0
+%endif
+
+%macro SETZERO 1
+%if cpuflag(sse2) && notcpuflag(avx)
+ pxor %1, %1
+%else
+ xorps %1, %1, %1
+%endif
+%endmacro
+
+%macro SHUF 3
+%if cpuflag(avx)
+ mova %3, [%2 - 16]
+ vperm2f128 %1, %3, %3, 1
+ vshufps %1, %1, %1, q0123
+%elif cpuflag(sse2)
+ pshufd %1, [%2], q0123
+%else
+ mova %1, [%2]
+ shufps %1, %1, q0123
+%endif
+%endmacro
+
+%macro INNER_LOOP 1
+ ; reading backwards: ptr1 = synth_buf + j + i; ptr2 = synth_buf + j - i
+ ;~ a += window[i + j] * (-synth_buf[15 - i + j])
+ ;~ b += window[i + j + 16] * (synth_buf[i + j])
+ SHUF m5, ptr2 + j + (15 - 3) * 4, m6
+ mova m6, [ptr1 + j]
+%if ARCH_X86_64
+ SHUF m11, ptr2 + j + (15 - 3) * 4 - mmsize, m12
+ mova m12, [ptr1 + j + mmsize]
+%endif
+%if cpuflag(fma3)
+ fmaddps m2, m6, [win + %1 + j + 16 * 4], m2
+ fnmaddps m1, m5, [win + %1 + j], m1
+%if ARCH_X86_64
+ fmaddps m8, m12, [win + %1 + j + mmsize + 16 * 4], m8
+ fnmaddps m7, m11, [win + %1 + j + mmsize], m7
+%endif
+%else ; non-FMA
+ mulps m6, m6, [win + %1 + j + 16 * 4]
+ mulps m5, m5, [win + %1 + j]
+%if ARCH_X86_64
+ mulps m12, m12, [win + %1 + j + mmsize + 16 * 4]
+ mulps m11, m11, [win + %1 + j + mmsize]
+%endif
+ addps m2, m2, m6
+ subps m1, m1, m5
+%if ARCH_X86_64
+ addps m8, m8, m12
+ subps m7, m7, m11
+%endif
+%endif ; cpuflag(fma3)
+ ;~ c += window[i + j + 32] * (synth_buf[16 + i + j])
+ ;~ d += window[i + j + 48] * (synth_buf[31 - i + j])
+ SHUF m6, ptr2 + j + (31 - 3) * 4, m5
+ mova m5, [ptr1 + j + 16 * 4]
+%if ARCH_X86_64
+ SHUF m12, ptr2 + j + (31 - 3) * 4 - mmsize, m11
+ mova m11, [ptr1 + j + mmsize + 16 * 4]
+%endif
+%if cpuflag(fma3)
+ fmaddps m3, m5, [win + %1 + j + 32 * 4], m3
+ fmaddps m4, m6, [win + %1 + j + 48 * 4], m4
+%if ARCH_X86_64
+ fmaddps m9, m11, [win + %1 + j + mmsize + 32 * 4], m9
+ fmaddps m10, m12, [win + %1 + j + mmsize + 48 * 4], m10
+%endif
+%else ; non-FMA
+ mulps m5, m5, [win + %1 + j + 32 * 4]
+ mulps m6, m6, [win + %1 + j + 48 * 4]
+%if ARCH_X86_64
+ mulps m11, m11, [win + %1 + j + mmsize + 32 * 4]
+ mulps m12, m12, [win + %1 + j + mmsize + 48 * 4]
+%endif
+ addps m3, m3, m5
+ addps m4, m4, m6
+%if ARCH_X86_64
+ addps m9, m9, m11
+ addps m10, m10, m12
+%endif
+%endif ; cpuflag(fma3)
+ sub j, 64 * 4
+%endmacro
+
+; void ff_synth_filter_inner_<opt>(float *synth_buf, float synth_buf2[32],
+; const float window[512], float out[32],
+; intptr_t offset, float scale)
+%macro SYNTH_FILTER 0
+cglobal synth_filter_inner, 0, 6 + 4 * ARCH_X86_64, 7 + 6 * ARCH_X86_64, \
+ synth_buf, synth_buf2, window, out, off, scale
+%define scale m0
+%if ARCH_X86_32 || WIN64
+%if cpuflag(sse2) && notcpuflag(avx)
+ movd scale, scalem
+ SPLATD m0
+%else
+ VBROADCASTSS m0, scalem
+%endif
+; Make sure offset is in a register and not on the stack
+%define OFFQ r4q
+%else
+ SPLATD xmm0
+%if cpuflag(avx)
+ vinsertf128 m0, m0, xmm0, 1
+%endif
+%define OFFQ offq
+%endif
+ ; prepare inner counter limit 1
+ mov r5q, 480
+ sub r5q, offmp
+ and r5q, -64
+ shl r5q, 2
+%if ARCH_X86_32 || notcpuflag(avx)
+ mov OFFQ, r5q
+%define i r5q
+ mov i, 16 * 4 - (ARCH_X86_64 + 1) * mmsize ; main loop counter
+%else
+%define i 0
+%define OFFQ r5q
+%endif
+
+%define buf2 synth_buf2q
+%if ARCH_X86_32
+ mov buf2, synth_buf2mp
+%endif
+.mainloop
+ ; m1 = a m2 = b m3 = c m4 = d
+ SETZERO m3
+ SETZERO m4
+ mova m1, [buf2 + i]
+ mova m2, [buf2 + i + 16 * 4]
+%if ARCH_X86_32
+%define ptr1 r0q
+%define ptr2 r1q
+%define win r2q
+%define j r3q
+ mov win, windowm
+ mov ptr1, synth_bufm
+%if ARCH_X86_32 || notcpuflag(avx)
+ add win, i
+ add ptr1, i
+%endif
+%else ; ARCH_X86_64
+%define ptr1 r6q
+%define ptr2 r7q ; must be loaded
+%define win r8q
+%define j r9q
+ SETZERO m9
+ SETZERO m10
+ mova m7, [buf2 + i + mmsize]
+ mova m8, [buf2 + i + mmsize + 16 * 4]
+ lea win, [windowq + i]
+ lea ptr1, [synth_bufq + i]
+%endif
+ mov ptr2, synth_bufmp
+ ; prepare the inner loop counter
+ mov j, OFFQ
+%if ARCH_X86_32 || notcpuflag(avx)
+ sub ptr2, i
+%endif
+.loop1:
+ INNER_LOOP 0
+ jge .loop1
+
+ mov j, 448 * 4
+ sub j, OFFQ
+ jz .end
+ sub ptr1, j
+ sub ptr2, j
+ add win, OFFQ ; now at j-64, so define OFFSET
+ sub j, 64 * 4
+.loop2:
+ INNER_LOOP 64 * 4
+ jge .loop2
+
+.end:
+%if ARCH_X86_32
+ mov buf2, synth_buf2m ; needed for next iteration anyway
+ mov outq, outmp ; j, which will be set again during it
+%endif
+ ;~ out[i] = a * scale;
+ ;~ out[i + 16] = b * scale;
+ mulps m1, m1, scale
+ mulps m2, m2, scale
+%if ARCH_X86_64
+ mulps m7, m7, scale
+ mulps m8, m8, scale
+%endif
+ ;~ synth_buf2[i] = c;
+ ;~ synth_buf2[i + 16] = d;
+ mova [buf2 + i + 0 * 4], m3
+ mova [buf2 + i + 16 * 4], m4
+%if ARCH_X86_64
+ mova [buf2 + i + 0 * 4 + mmsize], m9
+ mova [buf2 + i + 16 * 4 + mmsize], m10
+%endif
+ ;~ out[i] = a;
+ ;~ out[i + 16] = a;
+ mova [outq + i + 0 * 4], m1
+ mova [outq + i + 16 * 4], m2
+%if ARCH_X86_64
+ mova [outq + i + 0 * 4 + mmsize], m7
+ mova [outq + i + 16 * 4 + mmsize], m8
+%endif
+%if ARCH_X86_32 || notcpuflag(avx)
+ sub i, (ARCH_X86_64 + 1) * mmsize
+ jge .mainloop
+%endif
+ RET
+%endmacro
+
+%if ARCH_X86_32
+INIT_XMM sse
+SYNTH_FILTER
+%endif
+INIT_XMM sse2
+SYNTH_FILTER
+INIT_YMM avx
+SYNTH_FILTER
+INIT_YMM fma3
+SYNTH_FILTER
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dcadsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/dcadsp_init.c
new file mode 100644
index 00000000000..bb86c260371
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dcadsp_init.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2012-2014 Christophe Gisquet <christophe.gisquet@gmail.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 "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/x86/cpu.h"
+#include "libavcodec/dcadsp.h"
+
+void ff_decode_hf_sse(float dst[DCA_SUBBANDS][8], const int vq_num[DCA_SUBBANDS],
+ const int8_t hf_vq[1024][32], intptr_t vq_offset,
+ int scale[DCA_SUBBANDS][2], intptr_t start, intptr_t end);
+void ff_decode_hf_sse2(float dst[DCA_SUBBANDS][8], const int vq_num[DCA_SUBBANDS],
+ const int8_t hf_vq[1024][32], intptr_t vq_offset,
+ int scale[DCA_SUBBANDS][2], intptr_t start, intptr_t end);
+void ff_decode_hf_sse4(float dst[DCA_SUBBANDS][8], const int vq_num[DCA_SUBBANDS],
+ const int8_t hf_vq[1024][32], intptr_t vq_offset,
+ int scale[DCA_SUBBANDS][2], intptr_t start, intptr_t end);
+void ff_dca_lfe_fir0_sse(float *out, const float *in, const float *coefs);
+void ff_dca_lfe_fir1_sse(float *out, const float *in, const float *coefs);
+void ff_dca_lfe_fir0_fma3(float *out, const float *in, const float *coefs);
+
+av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (EXTERNAL_SSE(cpu_flags)) {
+#if ARCH_X86_32
+ s->decode_hf = ff_decode_hf_sse;
+#endif
+ s->lfe_fir[0] = ff_dca_lfe_fir0_sse;
+ s->lfe_fir[1] = ff_dca_lfe_fir1_sse;
+ }
+
+ if (EXTERNAL_SSE2(cpu_flags)) {
+ s->decode_hf = ff_decode_hf_sse2;
+ }
+
+ if (EXTERNAL_SSE4(cpu_flags)) {
+ s->decode_hf = ff_decode_hf_sse4;
+ }
+
+ if (EXTERNAL_FMA3(cpu_flags)) {
+ s->lfe_fir[0] = ff_dca_lfe_fir0_fma3;
+ }
+}
+
+
+#define SYNTH_FILTER_FUNC(opt) \
+void ff_synth_filter_inner_##opt(float *synth_buf_ptr, float synth_buf2[32], \
+ const float window[512], \
+ float out[32], intptr_t offset, float scale); \
+static void synth_filter_##opt(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 *synth_buf= synth_buf_ptr + *synth_buf_offset; \
+ \
+ imdct->imdct_half(imdct, synth_buf, in); \
+ \
+ ff_synth_filter_inner_##opt(synth_buf, synth_buf2, window, \
+ out, *synth_buf_offset, scale); \
+ \
+ *synth_buf_offset = (*synth_buf_offset - 32) & 511; \
+} \
+
+#if HAVE_YASM
+#if ARCH_X86_32
+SYNTH_FILTER_FUNC(sse)
+#endif
+SYNTH_FILTER_FUNC(sse2)
+SYNTH_FILTER_FUNC(avx)
+SYNTH_FILTER_FUNC(fma3)
+#endif /* HAVE_YASM */
+
+av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
+{
+#if HAVE_YASM
+ int cpu_flags = av_get_cpu_flags();
+
+#if ARCH_X86_32
+ if (EXTERNAL_SSE(cpu_flags)) {
+ s->synth_filter_float = synth_filter_sse;
+ }
+#endif
+ if (EXTERNAL_SSE2(cpu_flags)) {
+ s->synth_filter_float = synth_filter_sse2;
+ }
+ if (EXTERNAL_AVX(cpu_flags)) {
+ s->synth_filter_float = synth_filter_avx;
+ }
+ if (EXTERNAL_FMA3(cpu_flags)) {
+ s->synth_filter_float = synth_filter_fma3;
+ }
+#endif /* HAVE_YASM */
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/deinterlace.asm b/chromium/third_party/ffmpeg/libavcodec/x86/deinterlace.asm
index 3812dbe601f..baa9249db2b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/deinterlace.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/deinterlace.asm
@@ -1,5 +1,5 @@
;******************************************************************************
-;* MMX optimized deinterlacing functions
+;* SIMD-optimized deinterlacing functions
;* Copyright (c) 2010 Vitor Sessak
;* Copyright (c) 2002 Michael Niedermayer
;*
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc.asm b/chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc.asm
new file mode 100644
index 00000000000..9dd6d51ee65
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc.asm
@@ -0,0 +1,49 @@
+;************************************************************************
+;* VC3/DNxHD SIMD functions
+;* Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
+;* Copyright (c) 2014 Tiancheng "Timothy" Gu <timothygu99@gmail.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
+;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+;******************************************************************************
+
+%include "libavutil/x86/x86util.asm"
+
+section .text
+
+; void get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels,
+; ptrdiff_t line_size)
+INIT_XMM sse2
+cglobal get_pixels_8x4_sym, 3,3,5, block, pixels, linesize
+ pxor m4, m4
+ movq m0, [pixelsq]
+ add pixelsq, linesizeq
+ movq m1, [pixelsq]
+ movq m2, [pixelsq+linesizeq]
+ movq m3, [pixelsq+linesizeq*2]
+ punpcklbw m0, m4
+ punpcklbw m1, m4
+ punpcklbw m2, m4
+ punpcklbw m3, m4
+ mova [blockq ], m0
+ mova [blockq+16 ], m1
+ mova [blockq+32 ], m2
+ mova [blockq+48 ], m3
+ mova [blockq+64 ], m3
+ mova [blockq+80 ], m2
+ mova [blockq+96 ], m1
+ mova [blockq+112], m0
+ RET
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc.c b/chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc.c
deleted file mode 100644
index c7e776a4c1f..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * VC3/DNxHD SIMD functions
- * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- *
- * VC-3 encoder funded by the British Broadcasting Corporation
- *
- * 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 "libavutil/attributes.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/dnxhdenc.h"
-
-#if HAVE_SSE2_INLINE
-
-static void get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels, int line_size)
-{
- __asm__ volatile(
- "pxor %%xmm5, %%xmm5 \n\t"
- "movq (%0), %%xmm0 \n\t"
- "add %2, %0 \n\t"
- "movq (%0), %%xmm1 \n\t"
- "movq (%0, %2), %%xmm2 \n\t"
- "movq (%0, %2,2), %%xmm3 \n\t"
- "punpcklbw %%xmm5, %%xmm0 \n\t"
- "punpcklbw %%xmm5, %%xmm1 \n\t"
- "punpcklbw %%xmm5, %%xmm2 \n\t"
- "punpcklbw %%xmm5, %%xmm3 \n\t"
- "movdqa %%xmm0, (%1) \n\t"
- "movdqa %%xmm1, 16(%1) \n\t"
- "movdqa %%xmm2, 32(%1) \n\t"
- "movdqa %%xmm3, 48(%1) \n\t"
- "movdqa %%xmm3 , 64(%1) \n\t"
- "movdqa %%xmm2 , 80(%1) \n\t"
- "movdqa %%xmm1 , 96(%1) \n\t"
- "movdqa %%xmm0, 112(%1) \n\t"
- : "+r" (pixels)
- : "r" (block), "r" ((x86_reg)line_size)
- );
-}
-
-#endif /* HAVE_SSE2_INLINE */
-
-av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
-{
-#if HAVE_SSE2_INLINE
- if (INLINE_SSE2(av_get_cpu_flags())) {
- if (ctx->cid_table->bit_depth == 8)
- ctx->get_pixels_8x4_sym = get_pixels_8x4_sym_sse2;
- }
-#endif /* HAVE_SSE2_INLINE */
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/sparc/dsputil_vis.c b/chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc_init.c
index 414d6ca50e0..3b022641883 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sparc/dsputil_vis.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dnxhdenc_init.c
@@ -1,5 +1,8 @@
/*
- * Copyright (C) 2003 David S. Miller <davem@redhat.com>
+ * VC3/DNxHD SIMD functions
+ * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
+ *
+ * VC-3 encoder funded by the British Broadcasting Corporation
*
* This file is part of FFmpeg.
*
@@ -19,22 +22,18 @@
*/
#include "libavutil/attributes.h"
-#include "libavcodec/dsputil.h"
-#include "dsputil_vis.h"
-#include "vis.h"
+#include "libavutil/x86/cpu.h"
+#include "libavcodec/dnxhdenc.h"
-av_cold void ff_dsputil_init_vis(DSPContext *c, AVCodecContext *avctx)
-{
- /* VIS-specific optimizations */
- int accel = vis_level ();
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
+void ff_get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size);
- if (accel & ACCEL_SPARC_VIS && !high_bit_depth) {
- if (avctx->idct_algo == FF_IDCT_SIMPLEVIS) {
- c->idct_put = ff_simple_idct_put_vis;
- c->idct_add = ff_simple_idct_add_vis;
- c->idct = ff_simple_idct_vis;
- c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
- }
- }
+av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
+{
+#if HAVE_SSE2_EXTERNAL
+ if (EXTERNAL_SSE2(av_get_cpu_flags())) {
+ if (ctx->cid_table->bit_depth == 8)
+ ctx->get_pixels_8x4_sym = ff_get_pixels_8x4_sym_sse2;
+ }
+#endif /* HAVE_SSE2_EXTERNAL */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dsputil.asm b/chromium/third_party/ffmpeg/libavcodec/x86/dsputil.asm
index 77069e20f81..c1ea9bf4e20 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dsputil.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dsputil.asm
@@ -29,14 +29,12 @@ 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
-pb_revwords: SHUFFLE_MASK_W 7, 6, 5, 4, 3, 2, 1, 0
-pd_16384: times 4 dd 16384
pb_bswap32: db 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12
SECTION_TEXT
%macro SCALARPRODUCT 0
-; int scalarproduct_int16(int16_t *v1, int16_t *v2, int order)
+; int ff_scalarproduct_int16(int16_t *v1, int16_t *v2, int order)
cglobal scalarproduct_int16, 3,3,3, v1, v2, order
shl orderq, 1
add v1q, orderq
@@ -52,18 +50,15 @@ cglobal scalarproduct_int16, 3,3,3, v1, v2, order
paddd m2, m1
add orderq, mmsize*2
jl .loop
-%if mmsize == 16
- movhlps m0, m2
- paddd m2, m0
- pshuflw m0, m2, 0x4e
-%else
- pshufw m0, m2, 0x4e
-%endif
- paddd m2, m0
+ HADDD m2, m0
movd eax, m2
+%if mmsize == 8
+ emms
+%endif
RET
-; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)
+; int ff_scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3,
+; int order, int mul)
cglobal scalarproduct_and_madd_int16, 4,4,8, v1, v2, v3, order, mul
shl orderq, 1
movd m7, mulm
@@ -97,14 +92,7 @@ cglobal scalarproduct_and_madd_int16, 4,4,8, v1, v2, v3, order, mul
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
+ HADDD m6, m0
movd eax, m6
RET
%endmacro
@@ -159,7 +147,8 @@ align 16
%endif
%endmacro
-; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)
+; int ff_scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3,
+; int order, int mul)
INIT_XMM ssse3
cglobal scalarproduct_and_madd_int16, 4,5,10, v1, v2, v3, order, mul
shl orderq, 1
@@ -197,143 +186,14 @@ SCALARPRODUCT_LOOP 4
SCALARPRODUCT_LOOP 2
SCALARPRODUCT_LOOP 0
.end:
- movhlps m0, m6
- paddd m6, m0
- pshuflw m0, m6, 0x4e
- paddd m6, m0
+ HADDD m6, m0
movd eax, m6
RET
-;-----------------------------------------------------------------------------
-; void ff_apply_window_int16(int16_t *output, const int16_t *input,
-; const int16_t *window, unsigned int len)
-;-----------------------------------------------------------------------------
-
-%macro REVERSE_WORDS 1-2
-%if cpuflag(ssse3) && notcpuflag(atom)
- pshufb %1, %2
-%elif cpuflag(sse2)
- pshuflw %1, %1, 0x1B
- pshufhw %1, %1, 0x1B
- pshufd %1, %1, 0x4E
-%elif cpuflag(mmxext)
- pshufw %1, %1, 0x1B
-%endif
-%endmacro
-
-%macro MUL16FIXED 3
-%if cpuflag(ssse3) ; dst, src, unused
-; dst = ((dst * src) + (1<<14)) >> 15
- pmulhrsw %1, %2
-%elif cpuflag(mmxext) ; dst, src, temp
-; dst = (dst * src) >> 15
-; pmulhw cuts off the bottom bit, so we have to lshift by 1 and add it back
-; in from the pmullw result.
- mova %3, %1
- pmulhw %1, %2
- pmullw %3, %2
- psrlw %3, 15
- psllw %1, 1
- por %1, %3
-%endif
-%endmacro
-
-%macro APPLY_WINDOW_INT16 1 ; %1 bitexact version
-%if %1
-cglobal apply_window_int16, 4,5,6, output, input, window, offset, offset2
-%else
-cglobal apply_window_int16_round, 4,5,6, output, input, window, offset, offset2
-%endif
- lea offset2q, [offsetq-mmsize]
-%if cpuflag(ssse3) && notcpuflag(atom)
- mova m5, [pb_revwords]
- ALIGN 16
-%elif %1
- mova m5, [pd_16384]
-%endif
-.loop:
-%if cpuflag(ssse3)
- ; This version does the 16x16->16 multiplication in-place without expanding
- ; to 32-bit. The ssse3 version is bit-identical.
- mova m0, [windowq+offset2q]
- mova m1, [ inputq+offset2q]
- pmulhrsw m1, m0
- REVERSE_WORDS m0, m5
- pmulhrsw m0, [ inputq+offsetq ]
- mova [outputq+offset2q], m1
- mova [outputq+offsetq ], m0
-%elif %1
- ; This version expands 16-bit to 32-bit, multiplies by the window,
- ; adds 16384 for rounding, right shifts 15, then repacks back to words to
- ; save to the output. The window is reversed for the second half.
- mova m3, [windowq+offset2q]
- mova m4, [ inputq+offset2q]
- pxor m0, m0
- punpcklwd m0, m3
- punpcklwd m1, m4
- pmaddwd m0, m1
- paddd m0, m5
- psrad m0, 15
- pxor m2, m2
- punpckhwd m2, m3
- punpckhwd m1, m4
- pmaddwd m2, m1
- paddd m2, m5
- psrad m2, 15
- packssdw m0, m2
- mova [outputq+offset2q], m0
- REVERSE_WORDS m3
- mova m4, [ inputq+offsetq]
- pxor m0, m0
- punpcklwd m0, m3
- punpcklwd m1, m4
- pmaddwd m0, m1
- paddd m0, m5
- psrad m0, 15
- pxor m2, m2
- punpckhwd m2, m3
- punpckhwd m1, m4
- pmaddwd m2, m1
- paddd m2, m5
- psrad m2, 15
- packssdw m0, m2
- mova [outputq+offsetq], m0
-%else
- ; This version does the 16x16->16 multiplication in-place without expanding
- ; to 32-bit. The mmxext and sse2 versions do not use rounding, and
- ; therefore are not bit-identical to the C version.
- mova m0, [windowq+offset2q]
- mova m1, [ inputq+offset2q]
- mova m2, [ inputq+offsetq ]
- MUL16FIXED m1, m0, m3
- REVERSE_WORDS m0
- MUL16FIXED m2, m0, m3
- mova [outputq+offset2q], m1
- mova [outputq+offsetq ], m2
-%endif
- add offsetd, mmsize
- sub offset2d, mmsize
- jae .loop
- REP_RET
-%endmacro
-
-INIT_MMX mmxext
-APPLY_WINDOW_INT16 0
-INIT_XMM sse2
-APPLY_WINDOW_INT16 0
-
-INIT_MMX mmxext
-APPLY_WINDOW_INT16 1
-INIT_XMM sse2
-APPLY_WINDOW_INT16 1
-INIT_XMM ssse3
-APPLY_WINDOW_INT16 1
-INIT_XMM ssse3, atom
-APPLY_WINDOW_INT16 1
-
-
-; void add_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top)
+; void ff_add_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *top,
+; const uint8_t *diff, int w,
+; int *left, int *left_top)
INIT_MMX mmxext
cglobal add_hfyu_median_prediction, 6,6,0, dst, top, diff, w, left, left_top
movq mm0, [topq]
@@ -436,7 +296,8 @@ cglobal add_hfyu_median_prediction, 6,6,0, dst, top, diff, w, left, left_top
RET
%endmacro
-; int add_hfyu_left_prediction(uint8_t *dst, const uint8_t *src, int w, int left)
+; int ff_add_hfyu_left_prediction(uint8_t *dst, const uint8_t *src,
+; int w, int left)
INIT_MMX ssse3
cglobal add_hfyu_left_prediction, 3,3,7, dst, src, w, left
.skip_prologue:
@@ -465,6 +326,7 @@ cglobal add_hfyu_left_prediction, 3,3,7, dst, src, w, left
.src_unaligned:
ADD_HFYU_LEFT_LOOP 0, 0
+
;-----------------------------------------------------------------------------
; void ff_vector_clip_int32(int32_t *dst, const int32_t *src, int32_t min,
; int32_t max, unsigned int len)
@@ -597,7 +459,7 @@ VECTOR_CLIP_INT32 6, 1, 0, 0
add r0, 16
%endmacro
-; void bswap_buf(uint32_t *dst, const uint32_t *src, int w);
+; void ff_bswap_buf(uint32_t *dst, const uint32_t *src, int w);
%macro BSWAP32_BUF 0
%if cpuflag(ssse3)
cglobal bswap32_buf, 3,4,3
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_init.c
index 4c9f4990218..6c7b5218c46 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_init.c
@@ -25,9 +25,13 @@
#include "libavutil/internal.h"
#include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
+#include "libavcodec/pixels.h"
#include "libavcodec/simple_idct.h"
+#include "libavcodec/version.h"
#include "dsputil_x86.h"
+#include "fpel.h"
#include "idct_xvid.h"
void ff_put_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
@@ -44,29 +48,29 @@ void ff_avg_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
void ff_put_no_rnd_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
int dstStride, int src1Stride, int h);
void ff_put_mpeg4_qpel16_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
- int dstStride, int srcStride, int h);
+ int dstStride, int srcStride, int h);
void ff_avg_mpeg4_qpel16_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
- int dstStride, int srcStride, int h);
+ int dstStride, int srcStride, int h);
void ff_put_no_rnd_mpeg4_qpel16_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
int dstStride, int srcStride,
int h);
void ff_put_mpeg4_qpel8_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
- int dstStride, int srcStride, int h);
+ int dstStride, int srcStride, int h);
void ff_avg_mpeg4_qpel8_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
- int dstStride, int srcStride, int h);
+ int dstStride, int srcStride, int h);
void ff_put_no_rnd_mpeg4_qpel8_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
int dstStride, int srcStride,
int h);
void ff_put_mpeg4_qpel16_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
- int dstStride, int srcStride);
+ int dstStride, int srcStride);
void ff_avg_mpeg4_qpel16_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
- int dstStride, int srcStride);
+ int dstStride, int srcStride);
void ff_put_no_rnd_mpeg4_qpel16_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
int dstStride, int srcStride);
void ff_put_mpeg4_qpel8_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
- int dstStride, int srcStride);
+ int dstStride, int srcStride);
void ff_avg_mpeg4_qpel8_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
- int dstStride, int srcStride);
+ int dstStride, int srcStride);
void ff_put_no_rnd_mpeg4_qpel8_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
int dstStride, int srcStride);
#define ff_put_no_rnd_pixels16_mmxext ff_put_pixels16_mmxext
@@ -92,28 +96,28 @@ void ff_bswap32_buf_sse2(uint32_t *dst, const uint32_t *src, int w);
void ff_add_hfyu_median_prediction_mmxext(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 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_vector_clip_int32_mmx (int32_t *dst, const int32_t *src,
- int32_t min, int32_t max, unsigned int len);
-void ff_vector_clip_int32_sse2 (int32_t *dst, const int32_t *src,
- int32_t min, int32_t max, unsigned int len);
+void ff_vector_clip_int32_mmx(int32_t *dst, const int32_t *src,
+ int32_t min, int32_t max, unsigned int len);
+void ff_vector_clip_int32_sse2(int32_t *dst, const int32_t *src,
+ int32_t min, int32_t max, unsigned int len);
void ff_vector_clip_int32_int_sse2(int32_t *dst, const int32_t *src,
int32_t min, int32_t max, unsigned int len);
-void ff_vector_clip_int32_sse4 (int32_t *dst, const int32_t *src,
- int32_t min, int32_t max, unsigned int len);
+void ff_vector_clip_int32_sse4(int32_t *dst, const int32_t *src,
+ int32_t min, int32_t max, unsigned int len);
#if HAVE_YASM
-PIXELS16(static, ff_avg, , , _mmxext)
-PIXELS16(static, ff_put, , , _mmxext)
+CALL_2X_PIXELS(ff_avg_pixels16_mmxext, ff_avg_pixels8_mmxext, 8)
+CALL_2X_PIXELS(ff_put_pixels16_mmxext, ff_put_pixels8_mmxext, 8)
#define QPEL_OP(OPNAME, RND, MMX) \
-static void OPNAME ## qpel8_mc00_ ## MMX (uint8_t *dst, uint8_t *src, \
- ptrdiff_t stride) \
+static void OPNAME ## qpel8_mc00_ ## MMX(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
{ \
ff_ ## OPNAME ## pixels8_ ## MMX(dst, src, stride, 8); \
} \
@@ -122,7 +126,7 @@ static void OPNAME ## qpel8_mc10_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t temp[8]; \
- uint8_t * const half = (uint8_t*)temp; \
+ uint8_t *const half = (uint8_t *) temp; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, \
stride, 8); \
ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, src, half, \
@@ -140,7 +144,7 @@ static void OPNAME ## qpel8_mc30_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t temp[8]; \
- uint8_t * const half = (uint8_t*)temp; \
+ uint8_t *const half = (uint8_t *) temp; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, \
stride, 8); \
ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, src + 1, half, stride, \
@@ -151,7 +155,7 @@ static void OPNAME ## qpel8_mc01_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t temp[8]; \
- uint8_t * const half = (uint8_t*)temp; \
+ uint8_t *const half = (uint8_t *) temp; \
ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src, \
8, stride); \
ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, src, half, \
@@ -169,7 +173,7 @@ static void OPNAME ## qpel8_mc03_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t temp[8]; \
- uint8_t * const half = (uint8_t*)temp; \
+ uint8_t *const half = (uint8_t *) temp; \
ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src, \
8, stride); \
ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, src + stride, half, stride,\
@@ -180,8 +184,8 @@ static void OPNAME ## qpel8_mc11_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[8 + 9]; \
- uint8_t * const halfH = ((uint8_t*)half) + 64; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 64; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, \
stride, 9); \
ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, \
@@ -195,8 +199,8 @@ static void OPNAME ## qpel8_mc31_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[8 + 9]; \
- uint8_t * const halfH = ((uint8_t*)half) + 64; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 64; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, \
stride, 9); \
ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src + 1, halfH, 8, \
@@ -210,8 +214,8 @@ static void OPNAME ## qpel8_mc13_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[8 + 9]; \
- uint8_t * const halfH = ((uint8_t*)half) + 64; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 64; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, \
stride, 9); \
ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, \
@@ -225,8 +229,8 @@ static void OPNAME ## qpel8_mc33_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[8 + 9]; \
- uint8_t * const halfH = ((uint8_t*)half) + 64; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 64; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, \
stride, 9); \
ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src + 1, halfH, 8, \
@@ -240,8 +244,8 @@ static void OPNAME ## qpel8_mc21_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[8 + 9]; \
- uint8_t * const halfH = ((uint8_t*)half) + 64; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 64; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, \
stride, 9); \
ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
@@ -253,8 +257,8 @@ static void OPNAME ## qpel8_mc23_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[8 + 9]; \
- uint8_t * const halfH = ((uint8_t*)half) + 64; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 64; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, \
stride, 9); \
ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
@@ -266,7 +270,7 @@ static void OPNAME ## qpel8_mc12_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[8 + 9]; \
- uint8_t * const halfH = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, \
stride, 9); \
ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, \
@@ -279,7 +283,7 @@ static void OPNAME ## qpel8_mc32_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[8 + 9]; \
- uint8_t * const halfH = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, \
stride, 9); \
ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src + 1, halfH, 8, \
@@ -292,15 +296,15 @@ static void OPNAME ## qpel8_mc22_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[9]; \
- uint8_t * const halfH = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, \
stride, 9); \
ff_ ## OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, \
stride, 8); \
} \
\
-static void OPNAME ## qpel16_mc00_ ## MMX (uint8_t *dst, uint8_t *src, \
- ptrdiff_t stride) \
+static void OPNAME ## qpel16_mc00_ ## MMX(uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride) \
{ \
ff_ ## OPNAME ## pixels16_ ## MMX(dst, src, stride, 16); \
} \
@@ -309,7 +313,7 @@ static void OPNAME ## qpel16_mc10_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t temp[32]; \
- uint8_t * const half = (uint8_t*)temp; \
+ uint8_t *const half = (uint8_t *) temp; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, \
stride, 16); \
ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, src, half, stride, \
@@ -327,7 +331,7 @@ static void OPNAME ## qpel16_mc30_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t temp[32]; \
- uint8_t * const half = (uint8_t*)temp; \
+ uint8_t *const half = (uint8_t*) temp; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, \
stride, 16); \
ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, src + 1, half, \
@@ -338,7 +342,7 @@ static void OPNAME ## qpel16_mc01_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t temp[32]; \
- uint8_t * const half = (uint8_t*)temp; \
+ uint8_t *const half = (uint8_t *) temp; \
ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16, \
stride); \
ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, src, half, stride, \
@@ -356,7 +360,7 @@ static void OPNAME ## qpel16_mc03_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t temp[32]; \
- uint8_t * const half = (uint8_t*)temp; \
+ uint8_t *const half = (uint8_t *) temp; \
ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16, \
stride); \
ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, src+stride, half, \
@@ -367,8 +371,8 @@ static void OPNAME ## qpel16_mc11_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[16 * 2 + 17 * 2]; \
- uint8_t * const halfH = ((uint8_t*)half) + 256; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 256; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, \
stride, 17); \
ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, \
@@ -383,8 +387,8 @@ static void OPNAME ## qpel16_mc31_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[16 * 2 + 17 * 2]; \
- uint8_t * const halfH = ((uint8_t*)half) + 256; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 256; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, \
stride, 17); \
ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src + 1, halfH, 16, \
@@ -399,8 +403,8 @@ static void OPNAME ## qpel16_mc13_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[16 * 2 + 17 * 2]; \
- uint8_t * const halfH = ((uint8_t*)half) + 256; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 256; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, \
stride, 17); \
ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, \
@@ -415,8 +419,8 @@ static void OPNAME ## qpel16_mc33_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[16 * 2 + 17 * 2]; \
- uint8_t * const halfH = ((uint8_t*)half) + 256; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 256; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, \
stride, 17); \
ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src + 1, halfH, 16, \
@@ -431,8 +435,8 @@ static void OPNAME ## qpel16_mc21_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[16 * 2 + 17 * 2]; \
- uint8_t * const halfH = ((uint8_t*)half) + 256; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 256; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, \
stride, 17); \
ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, \
@@ -445,8 +449,8 @@ static void OPNAME ## qpel16_mc23_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[16 * 2 + 17 * 2]; \
- uint8_t * const halfH = ((uint8_t*)half) + 256; \
- uint8_t * const halfHV = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half + 256; \
+ uint8_t *const halfHV = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, \
stride, 17); \
ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, \
@@ -459,7 +463,7 @@ static void OPNAME ## qpel16_mc12_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[17 * 2]; \
- uint8_t * const halfH = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, \
stride, 17); \
ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, \
@@ -472,7 +476,7 @@ static void OPNAME ## qpel16_mc32_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[17 * 2]; \
- uint8_t * const halfH = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, \
stride, 17); \
ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src + 1, halfH, 16, \
@@ -485,7 +489,7 @@ static void OPNAME ## qpel16_mc22_ ## MMX(uint8_t *dst, uint8_t *src, \
ptrdiff_t stride) \
{ \
uint64_t half[17 * 2]; \
- uint8_t * const halfH = ((uint8_t*)half); \
+ uint8_t *const halfH = (uint8_t *) half; \
ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, \
stride, 17); \
ff_ ## OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, \
@@ -495,10 +499,11 @@ static void OPNAME ## qpel16_mc22_ ## MMX(uint8_t *dst, uint8_t *src, \
QPEL_OP(put_, _, mmxext)
QPEL_OP(avg_, _, mmxext)
QPEL_OP(put_no_rnd_, _no_rnd_, mmxext)
+
#endif /* HAVE_YASM */
#define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU, PREFIX) \
- do { \
+do { \
c->PFX ## _pixels_tab[IDX][ 0] = PREFIX ## PFX ## SIZE ## _mc00_ ## CPU; \
c->PFX ## _pixels_tab[IDX][ 1] = PREFIX ## PFX ## SIZE ## _mc10_ ## CPU; \
c->PFX ## _pixels_tab[IDX][ 2] = PREFIX ## PFX ## SIZE ## _mc20_ ## CPU; \
@@ -515,14 +520,12 @@ QPEL_OP(put_no_rnd_, _no_rnd_, mmxext)
c->PFX ## _pixels_tab[IDX][13] = PREFIX ## PFX ## SIZE ## _mc13_ ## CPU; \
c->PFX ## _pixels_tab[IDX][14] = PREFIX ## PFX ## SIZE ## _mc23_ ## CPU; \
c->PFX ## _pixels_tab[IDX][15] = PREFIX ## PFX ## SIZE ## _mc33_ ## CPU; \
- } while (0)
+} while (0)
static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx,
- int cpu_flags)
+ int cpu_flags, unsigned high_bit_depth)
{
#if HAVE_MMX_INLINE
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
c->put_pixels_clamped = ff_put_pixels_clamped_mmx;
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmx;
c->add_pixels_clamped = ff_add_pixels_clamped_mmx;
@@ -546,11 +549,9 @@ static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx,
}
static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
- int cpu_flags)
+ int cpu_flags, unsigned high_bit_depth)
{
#if HAVE_MMXEXT_INLINE
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX && avctx->lowres == 0) {
c->idct_put = ff_idct_xvid_mmxext_put;
c->idct_add = ff_idct_xvid_mmxext_add;
@@ -577,26 +578,19 @@ static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
}
static av_cold void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx,
- int cpu_flags)
+ int cpu_flags, unsigned high_bit_depth)
{
#if HAVE_SSE_INLINE
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
+ c->vector_clipf = ff_vector_clipf_sse;
+
+ /* XvMCCreateBlocks() may not allocate 16-byte aligned blocks */
+ if (CONFIG_XVMC && avctx->hwaccel && avctx->hwaccel->decode_mb)
+ return;
if (!high_bit_depth) {
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
- if (!(CONFIG_MPEG_XVMC_DECODER && avctx->xvmc_acceleration > 1)) {
- /* XvMCCreateBlocks() may not allocate 16-byte aligned blocks */
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
c->clear_block = ff_clear_block_sse;
c->clear_blocks = ff_clear_blocks_sse;
-#if FF_API_XVMC
- }
-#endif /* FF_API_XVMC */
}
-
- c->vector_clipf = ff_vector_clipf_sse;
#endif /* HAVE_SSE_INLINE */
#if HAVE_YASM
@@ -607,11 +601,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
- int cpu_flags)
+ int cpu_flags, unsigned high_bit_depth)
{
#if HAVE_SSE2_INLINE
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX && avctx->lowres == 0) {
c->idct_put = ff_idct_xvid_sse2_put;
c->idct_add = ff_idct_xvid_sse2_add;
@@ -633,7 +625,7 @@ static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
}
static av_cold void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx,
- int cpu_flags)
+ int cpu_flags, unsigned high_bit_depth)
{
#if HAVE_SSSE3_EXTERNAL
c->add_hfyu_left_prediction = ff_add_hfyu_left_prediction_ssse3;
@@ -647,14 +639,15 @@ static av_cold void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx,
}
static av_cold void dsputil_init_sse4(DSPContext *c, AVCodecContext *avctx,
- int cpu_flags)
+ int cpu_flags, unsigned high_bit_depth)
{
#if HAVE_SSE4_EXTERNAL
c->vector_clip_int32 = ff_vector_clip_int32_sse4;
#endif /* HAVE_SSE4_EXTERNAL */
}
-av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx)
+av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
{
int cpu_flags = av_get_cpu_flags();
@@ -667,7 +660,7 @@ av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx)
#if HAVE_INLINE_ASM
const int idct_algo = avctx->idct_algo;
- if (avctx->lowres == 0 && avctx->bits_per_raw_sample <= 8) {
+ if (avctx->lowres == 0 && !high_bit_depth) {
if (idct_algo == FF_IDCT_AUTO || idct_algo == FF_IDCT_SIMPLEMMX) {
c->idct_put = ff_simple_idct_put_mmx;
c->idct_add = ff_simple_idct_add_mmx;
@@ -681,24 +674,24 @@ av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx)
}
#endif /* HAVE_INLINE_ASM */
- dsputil_init_mmx(c, avctx, cpu_flags);
+ dsputil_init_mmx(c, avctx, cpu_flags, high_bit_depth);
}
if (X86_MMXEXT(cpu_flags))
- dsputil_init_mmxext(c, avctx, cpu_flags);
+ dsputil_init_mmxext(c, avctx, cpu_flags, high_bit_depth);
if (X86_SSE(cpu_flags))
- dsputil_init_sse(c, avctx, cpu_flags);
+ dsputil_init_sse(c, avctx, cpu_flags, high_bit_depth);
if (X86_SSE2(cpu_flags))
- dsputil_init_sse2(c, avctx, cpu_flags);
+ dsputil_init_sse2(c, avctx, cpu_flags, high_bit_depth);
if (EXTERNAL_SSSE3(cpu_flags))
- dsputil_init_ssse3(c, avctx, cpu_flags);
+ dsputil_init_ssse3(c, avctx, cpu_flags, high_bit_depth);
if (EXTERNAL_SSE4(cpu_flags))
- dsputil_init_sse4(c, avctx, cpu_flags);
+ dsputil_init_sse4(c, avctx, cpu_flags, high_bit_depth);
if (CONFIG_ENCODERS)
- ff_dsputilenc_init_mmx(c, avctx);
+ ff_dsputilenc_init_mmx(c, avctx, high_bit_depth);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_mmx.c b/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_mmx.c
index df8cfdb4645..86100ba6ff8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_mmx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_mmx.c
@@ -26,10 +26,13 @@
#include "libavutil/avassert.h"
#include "libavutil/cpu.h"
#include "libavutil/x86/asm.h"
+#include "libavcodec/pixels.h"
#include "libavcodec/videodsp.h"
#include "constants.h"
-#include "dsputil_x86.h"
#include "diracdsp_mmx.h"
+#include "dsputil_x86.h"
+#include "fpel.h"
+#include "inline_asm.h"
#if HAVE_INLINE_ASM
@@ -60,8 +63,8 @@ void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
"movq %%mm2, (%0, %1) \n\t"
"movq %%mm4, (%0, %1, 2) \n\t"
"movq %%mm6, (%0, %2) \n\t"
- :: "r"(pix), "r"((x86_reg)line_size), "r"((x86_reg)line_size * 3),
- "r"(p)
+ :: "r" (pix), "r" ((x86_reg) line_size), "r" ((x86_reg) line_size * 3),
+ "r" (p)
: "memory");
pix += line_size * 4;
p += 32;
@@ -86,7 +89,8 @@ void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
"movq %%mm2, (%0, %1) \n\t"
"movq %%mm4, (%0, %1, 2) \n\t"
"movq %%mm6, (%0, %2) \n\t"
- :: "r"(pix), "r"((x86_reg)line_size), "r"((x86_reg)line_size * 3), "r"(p)
+ :: "r" (pix), "r" ((x86_reg) line_size), "r" ((x86_reg) line_size * 3),
+ "r" (p)
: "memory");
}
@@ -120,8 +124,9 @@ void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
put_signed_pixels_clamped_mmx_half(0)
"lea (%0, %3, 4), %0 \n\t"
put_signed_pixels_clamped_mmx_half(64)
- : "+&r"(pixels), "=&r"(line_skip3)
- : "r"(block), "r"(line_skip)
+ : "+&r" (pixels), "=&r" (line_skip3)
+ : "r" (block), "r" (line_skip)
+ NAMED_CONSTRAINTS_ADD(ff_pb_80)
: "memory");
}
@@ -159,8 +164,8 @@ void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
"packuswb %%mm3, %%mm2 \n\t"
"movq %%mm0, %0 \n\t"
"movq %%mm2, %1 \n\t"
- : "+m"(*pix), "+m"(*(pix + line_size))
- : "r"(p)
+ : "+m" (*pix), "+m" (*(pix + line_size))
+ : "r" (p)
: "memory");
pix += line_size * 2;
p += 16;
@@ -172,7 +177,7 @@ void name(int16_t *blocks) \
{ \
__asm__ volatile ( \
"pxor %%mm7, %%mm7 \n\t" \
- "mov %1, %%"REG_a" \n\t" \
+ "mov $-"#n", %%"REG_a" \n\t" \
"1: \n\t" \
"movq %%mm7, (%0, %%"REG_a") \n\t" \
"movq %%mm7, 8(%0, %%"REG_a") \n\t" \
@@ -180,13 +185,11 @@ void name(int16_t *blocks) \
"movq %%mm7, 24(%0, %%"REG_a") \n\t" \
"add $32, %%"REG_a" \n\t" \
"js 1b \n\t" \
- :: "r"(((uint8_t *)blocks) + 128 * n), \
- "i"(-128 * n) \
- : "%"REG_a \
- ); \
+ :: "r"(((uint8_t *) blocks) + n) \
+ : "%"REG_a); \
}
-CLEAR_BLOCKS(ff_clear_blocks_mmx, 6)
-CLEAR_BLOCKS(ff_clear_block_mmx, 1)
+CLEAR_BLOCKS(ff_clear_blocks_mmx, 768)
+CLEAR_BLOCKS(ff_clear_block_mmx, 128)
void ff_clear_block_sse(int16_t *block)
{
@@ -200,16 +203,15 @@ void ff_clear_block_sse(int16_t *block)
"movaps %%xmm0, 80(%0) \n"
"movaps %%xmm0, 96(%0) \n"
"movaps %%xmm0, 112(%0) \n"
- :: "r"(block)
- : "memory"
- );
+ :: "r" (block)
+ : "memory");
}
void ff_clear_blocks_sse(int16_t *blocks)
{
__asm__ volatile (
"xorps %%xmm0, %%xmm0 \n"
- "mov %1, %%"REG_a" \n"
+ "mov $-768, %%"REG_a" \n"
"1: \n"
"movaps %%xmm0, (%0, %%"REG_a") \n"
"movaps %%xmm0, 16(%0, %%"REG_a") \n"
@@ -221,15 +223,14 @@ void ff_clear_blocks_sse(int16_t *blocks)
"movaps %%xmm0, 112(%0, %%"REG_a") \n"
"add $128, %%"REG_a" \n"
"js 1b \n"
- :: "r"(((uint8_t *)blocks) + 128 * 6),
- "i"(-128 * 6)
- : "%"REG_a
- );
+ :: "r"(((uint8_t *) blocks) + 128 * 6)
+ : "%"REG_a);
}
void ff_add_bytes_mmx(uint8_t *dst, uint8_t *src, int w)
{
x86_reg i = 0;
+
__asm__ volatile (
"jmp 2f \n\t"
"1: \n\t"
@@ -245,10 +246,10 @@ void ff_add_bytes_mmx(uint8_t *dst, uint8_t *src, int w)
"2: \n\t"
"cmp %3, %0 \n\t"
"js 1b \n\t"
- : "+r"(i)
- : "r"(src), "r"(dst), "r"((x86_reg)w - 15)
- );
- for ( ; i < w; i++)
+ : "+r" (i)
+ : "r" (src), "r" (dst), "r" ((x86_reg) w - 15));
+
+ for (; i < w; i++)
dst[i + 0] += src[i + 0];
}
@@ -279,10 +280,10 @@ void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
"add %1, %0 \n\t"
"cmp %3, %0 \n\t"
"jb 1b \n\t"
- : "+r"(ptr)
- : "r"((x86_reg)wrap), "r"((x86_reg)width), "r"(ptr + wrap * height)
- );
- } else if(w==16){
+ : "+r" (ptr)
+ : "r" ((x86_reg) wrap), "r" ((x86_reg) width),
+ "r" (ptr + wrap * height));
+ } else if (w == 16) {
__asm__ volatile (
"1: \n\t"
"movd (%0), %%mm0 \n\t"
@@ -319,9 +320,9 @@ void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
"add %1, %0 \n\t"
"cmp %3, %0 \n\t"
"jb 1b \n\t"
- : "+r"(ptr)
- : "r"((x86_reg)wrap), "r"((x86_reg)width), "r"(ptr + wrap * height)
- );
+ : "+r" (ptr)
+ : "r" ((x86_reg) wrap), "r" ((x86_reg) width),
+ "r" (ptr + wrap * height));
}
/* top and bottom (and hopefully also the corners) */
@@ -338,10 +339,10 @@ void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
"add $8, %0 \n\t"
"cmp %4, %0 \n\t"
"jb 1b \n\t"
- : "+r"(ptr)
- : "r"((x86_reg)buf - (x86_reg)ptr - w), "r"((x86_reg) -wrap),
- "r"((x86_reg) -wrap * 3), "r"(ptr + width + 2 * w)
- );
+ : "+r" (ptr)
+ : "r" ((x86_reg) buf - (x86_reg) ptr - w),
+ "r" ((x86_reg) - wrap), "r" ((x86_reg) - wrap * 3),
+ "r" (ptr + width + 2 * w));
}
}
@@ -358,11 +359,10 @@ void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
"add $8, %0 \n\t"
"cmp %4, %0 \n\t"
"jb 1b \n\t"
- : "+r"(ptr)
- : "r"((x86_reg)last_line - (x86_reg)ptr - w),
- "r"((x86_reg)wrap), "r"((x86_reg)wrap * 3),
- "r"(ptr + width + 2 * w)
- );
+ : "+r" (ptr)
+ : "r" ((x86_reg) last_line - (x86_reg) ptr - w),
+ "r" ((x86_reg) wrap), "r" ((x86_reg) wrap * 3),
+ "r" (ptr + width + 2 * w));
}
}
}
@@ -391,7 +391,7 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
const uint16_t r4[4] = { r, r, r, r };
const uint16_t dxy4[4] = { dxys, dxys, dxys, dxys };
const uint16_t dyy4[4] = { dyys, dyys, dyys, dyys };
- const uint64_t shift2 = 2 * shift;
+ const uint64_t shift2 = 2 * shift;
#define MAX_STRIDE 4096U
#define MAX_H 8U
uint8_t edge_buf[(MAX_H + 1) * MAX_STRIDE];
@@ -401,15 +401,15 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
const int dyh = (dyy - (1 << (16 + shift))) * (h - 1);
const int dxh = dxy * (h - 1);
const int dyw = dyx * (w - 1);
- int need_emu = (unsigned)ix >= width - w ||
- (unsigned)iy >= height - h;
+ int need_emu = (unsigned) ix >= width - w ||
+ (unsigned) iy >= height - h;
if ( // non-constant fullpel offset (3% of blocks)
((ox ^ (ox + dxw)) | (ox ^ (ox + dxh)) | (ox ^ (ox + dxw + dxh)) |
- (oy ^ (oy + dyw)) | (oy ^ (oy + dyh)) | (oy ^ (oy + dyw + dyh))) >> (16 + shift)
+ (oy ^ (oy + dyw)) | (oy ^ (oy + dyh)) | (oy ^ (oy + dyw + dyh))) >> (16 + shift) ||
// uses more than 16 bits of subpel mv (only at huge resolution)
- || (dxx | dxy | dyx | dyy) & 15
- || (need_emu && (h > MAX_H || stride > MAX_STRIDE))) {
+ (dxx | dxy | dyx | dyy) & 15 ||
+ (need_emu && (h > MAX_H || stride > MAX_STRIDE))) {
// FIXME could still use mmx for some of the rows
ff_gmc_c(dst, src, stride, h, ox, oy, dxx, dxy, dyx, dyy,
shift, r, width, height);
@@ -427,8 +427,7 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
"pxor %%mm7, %%mm7 \n\t"
"punpcklwd %%mm6, %%mm6 \n\t"
"punpcklwd %%mm6, %%mm6 \n\t"
- :: "r"(1<<shift)
- );
+ :: "r" (1 << shift));
for (x = 0; x < w; x += 4) {
uint16_t dx4[4] = { oxs - dxys + dxxs * (x + 0),
@@ -450,9 +449,8 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
"movq %%mm5, %1 \n\t"
"psrlw $12, %%mm4 \n\t"
"psrlw $12, %%mm5 \n\t"
- : "+m"(*dx4), "+m"(*dy4)
- : "m"(*dxy4), "m"(*dyy4)
- );
+ : "+m" (*dx4), "+m" (*dy4)
+ : "m" (*dxy4), "m" (*dyy4));
__asm__ volatile (
"movq %%mm6, %%mm2 \n\t"
@@ -488,11 +486,10 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
"packuswb %%mm0, %%mm0 \n\t"
"movd %%mm0, %0 \n\t"
- : "=m"(dst[x + y * stride])
- : "m"(src[0]), "m"(src[1]),
- "m"(src[stride]), "m"(src[stride + 1]),
- "m"(*r4), "m"(shift2)
- );
+ : "=m" (dst[x + y * stride])
+ : "m" (src[0]), "m" (src[1]),
+ "m" (src[stride]), "m" (src[stride + 1]),
+ "m" (*r4), "m" (shift2));
src += stride;
}
src += 4 - h * stride;
@@ -558,7 +555,7 @@ void ff_ ## OPNAME2 ## _dirac_pixels32_ ## EXT(uint8_t *dst, const uint8_t *src[
}
#if HAVE_MMX_INLINE
-PIXELS16(static, ff_avg, , , _mmxext)
+CALL_2X_PIXELS(ff_avg_pixels16_mmxext, ff_avg_pixels8_mmxext, 8)
DIRAC_PIXOP(put, ff_put, mmx)
DIRAC_PIXOP(avg, ff_avg, mmx)
#endif
@@ -629,10 +626,9 @@ void ff_vector_clipf_sse(float *dst, const float *src,
"movaps %%xmm3, 48(%1, %0) \n\t"
"sub $64, %0 \n\t"
"jge 1b \n\t"
- : "+&r"(i)
- : "r"(dst), "r"(src), "m"(min), "m"(max)
- : "memory"
- );
+ : "+&r" (i)
+ : "r" (dst), "r" (src), "m" (min), "m" (max)
+ : "memory");
}
#endif /* HAVE_INLINE_ASM */
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_qns_template.c b/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_qns_template.c
index bde6b0a606f..ebaad252f4e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_qns_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_qns_template.c
@@ -22,6 +22,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <assert.h>
+#include <stdint.h>
+
+#include "libavutil/common.h"
+#include "libavutil/x86/asm.h"
+
+#include "inline_asm.h"
+
#define MAX_ABS (512 >> (SCALE_OFFSET>0 ? SCALE_OFFSET : 0))
static int DEF(try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale)
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_x86.h b/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_x86.h
index 356b2c142f5..6a50a09e5d9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_x86.h
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dsputil_x86.h
@@ -19,96 +19,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef AVCODEC_X86_DSPUTIL_MMX_H
-#define AVCODEC_X86_DSPUTIL_MMX_H
+#ifndef AVCODEC_X86_DSPUTIL_X86_H
+#define AVCODEC_X86_DSPUTIL_X86_H
-#include <stddef.h>
#include <stdint.h>
+#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
-#include "libavutil/x86/asm.h"
-#include "constants.h"
-#define MOVQ_WONE(regd) \
- __asm__ volatile ( \
- "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
- "psrlw $15, %%" #regd ::)
+void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
+void ff_dsputil_init_pix_mmx(DSPContext *c, AVCodecContext *avctx);
-#define JUMPALIGN() __asm__ volatile (".p2align 3"::)
-#define MOVQ_ZERO(regd) __asm__ volatile ("pxor %%"#regd", %%"#regd ::)
-
-#define MOVQ_BFE(regd) \
- __asm__ volatile ( \
- "pcmpeqd %%"#regd", %%"#regd" \n\t" \
- "paddb %%"#regd", %%"#regd" \n\t" ::)
-
-#ifndef PIC
-#define MOVQ_WTWO(regd) __asm__ volatile ("movq %0, %%"#regd" \n\t" :: "m"(ff_wtwo))
-#else
-// for shared library it's better to use this way for accessing constants
-// pcmpeqd -> -1
-#define MOVQ_WTWO(regd) \
- __asm__ volatile ( \
- "pcmpeqd %%"#regd", %%"#regd" \n\t" \
- "psrlw $15, %%"#regd" \n\t" \
- "psllw $1, %%"#regd" \n\t"::)
-
-#endif
-
-// using regr as temporary and for the output result
-// first argument is unmodifed and second is trashed
-// regfe is supposed to contain 0xfefefefefefefefe
-#define PAVGB_MMX_NO_RND(rega, regb, regr, regfe) \
- "movq "#rega", "#regr" \n\t" \
- "pand "#regb", "#regr" \n\t" \
- "pxor "#rega", "#regb" \n\t" \
- "pand "#regfe", "#regb" \n\t" \
- "psrlq $1, "#regb" \n\t" \
- "paddb "#regb", "#regr" \n\t"
-
-#define PAVGB_MMX(rega, regb, regr, regfe) \
- "movq "#rega", "#regr" \n\t" \
- "por "#regb", "#regr" \n\t" \
- "pxor "#rega", "#regb" \n\t" \
- "pand "#regfe", "#regb" \n\t" \
- "psrlq $1, "#regb" \n\t" \
- "psubb "#regb", "#regr" \n\t"
-
-// mm6 is supposed to contain 0xfefefefefefefefe
-#define PAVGBP_MMX_NO_RND(rega, regb, regr, regc, regd, regp) \
- "movq "#rega", "#regr" \n\t" \
- "movq "#regc", "#regp" \n\t" \
- "pand "#regb", "#regr" \n\t" \
- "pand "#regd", "#regp" \n\t" \
- "pxor "#rega", "#regb" \n\t" \
- "pxor "#regc", "#regd" \n\t" \
- "pand %%mm6, "#regb" \n\t" \
- "pand %%mm6, "#regd" \n\t" \
- "psrlq $1, "#regb" \n\t" \
- "psrlq $1, "#regd" \n\t" \
- "paddb "#regb", "#regr" \n\t" \
- "paddb "#regd", "#regp" \n\t"
-
-#define PAVGBP_MMX(rega, regb, regr, regc, regd, regp) \
- "movq "#rega", "#regr" \n\t" \
- "movq "#regc", "#regp" \n\t" \
- "por "#regb", "#regr" \n\t" \
- "por "#regd", "#regp" \n\t" \
- "pxor "#rega", "#regb" \n\t" \
- "pxor "#regc", "#regd" \n\t" \
- "pand %%mm6, "#regb" \n\t" \
- "pand %%mm6, "#regd" \n\t" \
- "psrlq $1, "#regd" \n\t" \
- "psrlq $1, "#regb" \n\t" \
- "psubb "#regb", "#regr" \n\t" \
- "psubb "#regd", "#regp" \n\t"
-
-void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);
-
-void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
-void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
-void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
+void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
+ int line_size);
+void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
+ int line_size);
+void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
+ int line_size);
void ff_clear_block_mmx(int16_t *block);
void ff_clear_block_sse(int16_t *block);
@@ -137,62 +65,8 @@ void ff_gmc_sse(uint8_t *dst, uint8_t *src,
void ff_vector_clipf_sse(float *dst, const float *src,
float min, float max, int len);
-void ff_avg_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-void ff_avg_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-void ff_put_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-void ff_put_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-void ff_avg_pixels8_mmxext(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-void ff_put_pixels8_mmxext(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-void ff_avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-void ff_put_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-
-void ff_avg_pixels8_x2_mmx(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-
-void ff_avg_pixels8_xy2_mmx(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-void ff_avg_pixels16_xy2_mmx(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-
-void ff_put_pixels8_xy2_mmx(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-void ff_put_pixels16_xy2_mmx(uint8_t *block, const uint8_t *pixels,
- ptrdiff_t line_size, int h);
-
void ff_mmx_idct(int16_t *block);
void ff_mmxext_idct(int16_t *block);
-void ff_deinterlace_line_mmx(uint8_t *dst,
- const uint8_t *lum_m4, const uint8_t *lum_m3,
- const uint8_t *lum_m2, const uint8_t *lum_m1,
- const uint8_t *lum,
- int size);
-
-void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4,
- const uint8_t *lum_m3,
- const uint8_t *lum_m2,
- const uint8_t *lum_m1,
- const uint8_t *lum, int size);
-
-#define PIXELS16(STATIC, PFX1, PFX2, TYPE, CPUEXT) \
-STATIC void PFX1 ## _pixels16 ## TYPE ## CPUEXT(uint8_t *block, \
- const uint8_t *pixels, \
- ptrdiff_t line_size, \
- int h) \
-{ \
- PFX2 ## PFX1 ## _pixels8 ## TYPE ## CPUEXT(block, pixels, \
- line_size, h); \
- PFX2 ## PFX1 ## _pixels8 ## TYPE ## CPUEXT(block + 8, pixels + 8, \
- line_size, h); \
-}
-
-#endif /* AVCODEC_X86_DSPUTIL_MMX_H */
+#endif /* AVCODEC_X86_DSPUTIL_X86_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dsputilenc.asm b/chromium/third_party/ffmpeg/libavcodec/x86/dsputilenc.asm
index 1839bee24a3..1f496ad32e7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dsputilenc.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dsputilenc.asm
@@ -209,8 +209,8 @@ hadamard8x8_diff %+ SUFFIX:
hadamard8_16_wrapper %1, 3
%elif cpuflag(mmx)
ALIGN 16
-; int hadamard8_diff_##cpu(void *s, uint8_t *src1, uint8_t *src2,
-; int stride, int h)
+; int ff_hadamard8_diff_ ## cpu(MpegEncContext *s, uint8_t *src1,
+; uint8_t *src2, int stride, int h)
; r0 = void *s = unused, int h = unused (always 8)
; note how r1, r2 and r3 are not clobbered in this function, so 16x16
; can simply call this 2x2x (and that's why we access rsp+gprsize
@@ -275,7 +275,8 @@ INIT_XMM ssse3
HADAMARD8_DIFF 9
INIT_XMM sse2
-; sse16_sse2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h)
+; int ff_sse16_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+; int line_size, int h);
cglobal sse16, 5, 5, 8
shr r4d, 1
pxor m0, m0 ; mm0 = 0
@@ -335,7 +336,7 @@ cglobal sse16, 5, 5, 8
RET
INIT_MMX mmx
-; get_pixels_mmx(int16_t *block, const uint8_t *pixels, int line_size)
+; void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, int line_size)
cglobal get_pixels, 3,4
movsxdifnidn r2, r2d
add r0, 128
@@ -392,7 +393,8 @@ cglobal get_pixels, 3, 4
RET
INIT_MMX mmx
-; diff_pixels_mmx(int16_t *block, const uint8_t *s1, const unint8_t *s2, stride)
+; void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2,
+; int stride);
cglobal diff_pixels, 4,5
movsxdifnidn r3, r3d
pxor m7, m7
@@ -418,7 +420,7 @@ cglobal diff_pixels, 4,5
REP_RET
INIT_MMX mmx
-; pix_sum16_mmx(uint8_t * pix, int line_size)
+; int ff_pix_sum16_mmx(uint8_t *pix, int line_size)
cglobal pix_sum16, 2, 3
movsxdifnidn r1, r1d
mov r2, r1
@@ -453,7 +455,7 @@ cglobal pix_sum16, 2, 3
RET
INIT_MMX mmx
-; pix_norm1_mmx(uint8_t *pix, int line_size)
+; int ff_pix_norm1_mmx(uint8_t *pix, int line_size)
cglobal pix_norm1, 2, 4
movsxdifnidn r1, r1d
mov r2, 16
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dsputilenc_mmx.c b/chromium/third_party/ffmpeg/libavcodec/x86/dsputilenc_mmx.c
index 5de8ade8b1d..1100fb07f76 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dsputilenc_mmx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dsputilenc_mmx.c
@@ -34,637 +34,672 @@
void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, int line_size);
void ff_get_pixels_sse2(int16_t *block, const uint8_t *pixels, int line_size);
-void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride);
-int ff_pix_sum16_mmx(uint8_t * pix, int line_size);
+void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2,
+ int stride);
+int ff_pix_sum16_mmx(uint8_t *pix, int line_size);
int ff_pix_norm1_mmx(uint8_t *pix, int line_size);
#if HAVE_INLINE_ASM
-static int sse8_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
+static int sse8_mmx(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
+{
int tmp;
- __asm__ volatile (
- "movl %4,%%ecx\n"
- "shr $1,%%ecx\n"
- "pxor %%mm0,%%mm0\n" /* mm0 = 0 */
- "pxor %%mm7,%%mm7\n" /* mm7 holds the sum */
- "1:\n"
- "movq (%0),%%mm1\n" /* mm1 = pix1[0][0-7] */
- "movq (%1),%%mm2\n" /* mm2 = pix2[0][0-7] */
- "movq (%0,%3),%%mm3\n" /* mm3 = pix1[1][0-7] */
- "movq (%1,%3),%%mm4\n" /* mm4 = pix2[1][0-7] */
-
- /* todo: mm1-mm2, mm3-mm4 */
- /* algo: subtract mm1 from mm2 with saturation and vice versa */
- /* OR the results to get absolute difference */
- "movq %%mm1,%%mm5\n"
- "movq %%mm3,%%mm6\n"
- "psubusb %%mm2,%%mm1\n"
- "psubusb %%mm4,%%mm3\n"
- "psubusb %%mm5,%%mm2\n"
- "psubusb %%mm6,%%mm4\n"
-
- "por %%mm1,%%mm2\n"
- "por %%mm3,%%mm4\n"
-
- /* now convert to 16-bit vectors so we can square them */
- "movq %%mm2,%%mm1\n"
- "movq %%mm4,%%mm3\n"
-
- "punpckhbw %%mm0,%%mm2\n"
- "punpckhbw %%mm0,%%mm4\n"
- "punpcklbw %%mm0,%%mm1\n" /* mm1 now spread over (mm1,mm2) */
- "punpcklbw %%mm0,%%mm3\n" /* mm4 now spread over (mm3,mm4) */
-
- "pmaddwd %%mm2,%%mm2\n"
- "pmaddwd %%mm4,%%mm4\n"
- "pmaddwd %%mm1,%%mm1\n"
- "pmaddwd %%mm3,%%mm3\n"
-
- "lea (%0,%3,2), %0\n" /* pix1 += 2*line_size */
- "lea (%1,%3,2), %1\n" /* pix2 += 2*line_size */
-
- "paddd %%mm2,%%mm1\n"
- "paddd %%mm4,%%mm3\n"
- "paddd %%mm1,%%mm7\n"
- "paddd %%mm3,%%mm7\n"
-
- "decl %%ecx\n"
- "jnz 1b\n"
-
- "movq %%mm7,%%mm1\n"
- "psrlq $32, %%mm7\n" /* shift hi dword to lo */
- "paddd %%mm7,%%mm1\n"
- "movd %%mm1,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
- : "r" ((x86_reg)line_size) , "m" (h)
- : "%ecx");
+
+ __asm__ volatile (
+ "movl %4, %%ecx \n"
+ "shr $1, %%ecx \n"
+ "pxor %%mm0, %%mm0 \n" /* mm0 = 0 */
+ "pxor %%mm7, %%mm7 \n" /* mm7 holds the sum */
+ "1: \n"
+ "movq (%0), %%mm1 \n" /* mm1 = pix1[0][0 - 7] */
+ "movq (%1), %%mm2 \n" /* mm2 = pix2[0][0 - 7] */
+ "movq (%0, %3), %%mm3 \n" /* mm3 = pix1[1][0 - 7] */
+ "movq (%1, %3), %%mm4 \n" /* mm4 = pix2[1][0 - 7] */
+
+ /* todo: mm1-mm2, mm3-mm4 */
+ /* algo: subtract mm1 from mm2 with saturation and vice versa */
+ /* OR the results to get absolute difference */
+ "movq %%mm1, %%mm5 \n"
+ "movq %%mm3, %%mm6 \n"
+ "psubusb %%mm2, %%mm1 \n"
+ "psubusb %%mm4, %%mm3 \n"
+ "psubusb %%mm5, %%mm2 \n"
+ "psubusb %%mm6, %%mm4 \n"
+
+ "por %%mm1, %%mm2 \n"
+ "por %%mm3, %%mm4 \n"
+
+ /* now convert to 16-bit vectors so we can square them */
+ "movq %%mm2, %%mm1 \n"
+ "movq %%mm4, %%mm3 \n"
+
+ "punpckhbw %%mm0, %%mm2 \n"
+ "punpckhbw %%mm0, %%mm4 \n"
+ "punpcklbw %%mm0, %%mm1 \n" /* mm1 now spread over (mm1, mm2) */
+ "punpcklbw %%mm0, %%mm3 \n" /* mm4 now spread over (mm3, mm4) */
+
+ "pmaddwd %%mm2, %%mm2 \n"
+ "pmaddwd %%mm4, %%mm4 \n"
+ "pmaddwd %%mm1, %%mm1 \n"
+ "pmaddwd %%mm3, %%mm3 \n"
+
+ "lea (%0, %3, 2), %0 \n" /* pix1 += 2 * line_size */
+ "lea (%1, %3, 2), %1 \n" /* pix2 += 2 * line_size */
+
+ "paddd %%mm2, %%mm1 \n"
+ "paddd %%mm4, %%mm3 \n"
+ "paddd %%mm1, %%mm7 \n"
+ "paddd %%mm3, %%mm7 \n"
+
+ "decl %%ecx \n"
+ "jnz 1b \n"
+
+ "movq %%mm7, %%mm1 \n"
+ "psrlq $32, %%mm7 \n" /* shift hi dword to lo */
+ "paddd %%mm7, %%mm1 \n"
+ "movd %%mm1, %2 \n"
+ : "+r" (pix1), "+r" (pix2), "=r" (tmp)
+ : "r" ((x86_reg) line_size), "m" (h)
+ : "%ecx");
+
return tmp;
}
-static int sse16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
+static int sse16_mmx(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
+{
int tmp;
- __asm__ volatile (
- "movl %4,%%ecx\n"
- "pxor %%mm0,%%mm0\n" /* mm0 = 0 */
- "pxor %%mm7,%%mm7\n" /* mm7 holds the sum */
- "1:\n"
- "movq (%0),%%mm1\n" /* mm1 = pix1[0-7] */
- "movq (%1),%%mm2\n" /* mm2 = pix2[0-7] */
- "movq 8(%0),%%mm3\n" /* mm3 = pix1[8-15] */
- "movq 8(%1),%%mm4\n" /* mm4 = pix2[8-15] */
-
- /* todo: mm1-mm2, mm3-mm4 */
- /* algo: subtract mm1 from mm2 with saturation and vice versa */
- /* OR the results to get absolute difference */
- "movq %%mm1,%%mm5\n"
- "movq %%mm3,%%mm6\n"
- "psubusb %%mm2,%%mm1\n"
- "psubusb %%mm4,%%mm3\n"
- "psubusb %%mm5,%%mm2\n"
- "psubusb %%mm6,%%mm4\n"
-
- "por %%mm1,%%mm2\n"
- "por %%mm3,%%mm4\n"
-
- /* now convert to 16-bit vectors so we can square them */
- "movq %%mm2,%%mm1\n"
- "movq %%mm4,%%mm3\n"
-
- "punpckhbw %%mm0,%%mm2\n"
- "punpckhbw %%mm0,%%mm4\n"
- "punpcklbw %%mm0,%%mm1\n" /* mm1 now spread over (mm1,mm2) */
- "punpcklbw %%mm0,%%mm3\n" /* mm4 now spread over (mm3,mm4) */
-
- "pmaddwd %%mm2,%%mm2\n"
- "pmaddwd %%mm4,%%mm4\n"
- "pmaddwd %%mm1,%%mm1\n"
- "pmaddwd %%mm3,%%mm3\n"
-
- "add %3,%0\n"
- "add %3,%1\n"
-
- "paddd %%mm2,%%mm1\n"
- "paddd %%mm4,%%mm3\n"
- "paddd %%mm1,%%mm7\n"
- "paddd %%mm3,%%mm7\n"
-
- "decl %%ecx\n"
- "jnz 1b\n"
-
- "movq %%mm7,%%mm1\n"
- "psrlq $32, %%mm7\n" /* shift hi dword to lo */
- "paddd %%mm7,%%mm1\n"
- "movd %%mm1,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
- : "r" ((x86_reg)line_size) , "m" (h)
- : "%ecx");
+
+ __asm__ volatile (
+ "movl %4, %%ecx\n"
+ "pxor %%mm0, %%mm0\n" /* mm0 = 0 */
+ "pxor %%mm7, %%mm7\n" /* mm7 holds the sum */
+ "1:\n"
+ "movq (%0), %%mm1\n" /* mm1 = pix1[0 - 7] */
+ "movq (%1), %%mm2\n" /* mm2 = pix2[0 - 7] */
+ "movq 8(%0), %%mm3\n" /* mm3 = pix1[8 - 15] */
+ "movq 8(%1), %%mm4\n" /* mm4 = pix2[8 - 15] */
+
+ /* todo: mm1-mm2, mm3-mm4 */
+ /* algo: subtract mm1 from mm2 with saturation and vice versa */
+ /* OR the results to get absolute difference */
+ "movq %%mm1, %%mm5\n"
+ "movq %%mm3, %%mm6\n"
+ "psubusb %%mm2, %%mm1\n"
+ "psubusb %%mm4, %%mm3\n"
+ "psubusb %%mm5, %%mm2\n"
+ "psubusb %%mm6, %%mm4\n"
+
+ "por %%mm1, %%mm2\n"
+ "por %%mm3, %%mm4\n"
+
+ /* now convert to 16-bit vectors so we can square them */
+ "movq %%mm2, %%mm1\n"
+ "movq %%mm4, %%mm3\n"
+
+ "punpckhbw %%mm0, %%mm2\n"
+ "punpckhbw %%mm0, %%mm4\n"
+ "punpcklbw %%mm0, %%mm1\n" /* mm1 now spread over (mm1, mm2) */
+ "punpcklbw %%mm0, %%mm3\n" /* mm4 now spread over (mm3, mm4) */
+
+ "pmaddwd %%mm2, %%mm2\n"
+ "pmaddwd %%mm4, %%mm4\n"
+ "pmaddwd %%mm1, %%mm1\n"
+ "pmaddwd %%mm3, %%mm3\n"
+
+ "add %3, %0\n"
+ "add %3, %1\n"
+
+ "paddd %%mm2, %%mm1\n"
+ "paddd %%mm4, %%mm3\n"
+ "paddd %%mm1, %%mm7\n"
+ "paddd %%mm3, %%mm7\n"
+
+ "decl %%ecx\n"
+ "jnz 1b\n"
+
+ "movq %%mm7, %%mm1\n"
+ "psrlq $32, %%mm7\n" /* shift hi dword to lo */
+ "paddd %%mm7, %%mm1\n"
+ "movd %%mm1, %2\n"
+ : "+r" (pix1), "+r" (pix2), "=r" (tmp)
+ : "r" ((x86_reg) line_size), "m" (h)
+ : "%ecx");
+
return tmp;
}
-static int hf_noise8_mmx(uint8_t * pix1, int line_size, int h) {
+static int hf_noise8_mmx(uint8_t *pix1, int line_size, int h)
+{
int tmp;
- __asm__ volatile (
- "movl %3,%%ecx\n"
- "pxor %%mm7,%%mm7\n"
- "pxor %%mm6,%%mm6\n"
-
- "movq (%0),%%mm0\n"
- "movq %%mm0, %%mm1\n"
- "psllq $8, %%mm0\n"
- "psrlq $8, %%mm1\n"
- "psrlq $8, %%mm0\n"
- "movq %%mm0, %%mm2\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm0\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm2\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm0\n"
- "psubw %%mm3, %%mm2\n"
-
- "add %2,%0\n"
-
- "movq (%0),%%mm4\n"
- "movq %%mm4, %%mm1\n"
- "psllq $8, %%mm4\n"
- "psrlq $8, %%mm1\n"
- "psrlq $8, %%mm4\n"
- "movq %%mm4, %%mm5\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm4\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm5\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm4\n"
- "psubw %%mm3, %%mm5\n"
- "psubw %%mm4, %%mm0\n"
- "psubw %%mm5, %%mm2\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm0, %%mm3\n\t"
- "pcmpgtw %%mm2, %%mm1\n\t"
- "pxor %%mm3, %%mm0\n"
- "pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
- "psubw %%mm1, %%mm2\n"
- "paddw %%mm0, %%mm2\n"
- "paddw %%mm2, %%mm6\n"
-
- "add %2,%0\n"
- "1:\n"
-
- "movq (%0),%%mm0\n"
- "movq %%mm0, %%mm1\n"
- "psllq $8, %%mm0\n"
- "psrlq $8, %%mm1\n"
- "psrlq $8, %%mm0\n"
- "movq %%mm0, %%mm2\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm0\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm2\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm0\n"
- "psubw %%mm3, %%mm2\n"
- "psubw %%mm0, %%mm4\n"
- "psubw %%mm2, %%mm5\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm4, %%mm3\n\t"
- "pcmpgtw %%mm5, %%mm1\n\t"
- "pxor %%mm3, %%mm4\n"
- "pxor %%mm1, %%mm5\n"
- "psubw %%mm3, %%mm4\n"
- "psubw %%mm1, %%mm5\n"
- "paddw %%mm4, %%mm5\n"
- "paddw %%mm5, %%mm6\n"
-
- "add %2,%0\n"
-
- "movq (%0),%%mm4\n"
- "movq %%mm4, %%mm1\n"
- "psllq $8, %%mm4\n"
- "psrlq $8, %%mm1\n"
- "psrlq $8, %%mm4\n"
- "movq %%mm4, %%mm5\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm4\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm5\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm4\n"
- "psubw %%mm3, %%mm5\n"
- "psubw %%mm4, %%mm0\n"
- "psubw %%mm5, %%mm2\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm0, %%mm3\n\t"
- "pcmpgtw %%mm2, %%mm1\n\t"
- "pxor %%mm3, %%mm0\n"
- "pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
- "psubw %%mm1, %%mm2\n"
- "paddw %%mm0, %%mm2\n"
- "paddw %%mm2, %%mm6\n"
-
- "add %2,%0\n"
- "subl $2, %%ecx\n"
- " jnz 1b\n"
-
- "movq %%mm6, %%mm0\n"
- "punpcklwd %%mm7,%%mm0\n"
- "punpckhwd %%mm7,%%mm6\n"
- "paddd %%mm0, %%mm6\n"
-
- "movq %%mm6,%%mm0\n"
- "psrlq $32, %%mm6\n"
- "paddd %%mm6,%%mm0\n"
- "movd %%mm0,%1\n"
- : "+r" (pix1), "=r"(tmp)
- : "r" ((x86_reg)line_size) , "g" (h-2)
- : "%ecx");
- return tmp;
+
+ __asm__ volatile (
+ "movl %3, %%ecx\n"
+ "pxor %%mm7, %%mm7\n"
+ "pxor %%mm6, %%mm6\n"
+
+ "movq (%0), %%mm0\n"
+ "movq %%mm0, %%mm1\n"
+ "psllq $8, %%mm0\n"
+ "psrlq $8, %%mm1\n"
+ "psrlq $8, %%mm0\n"
+ "movq %%mm0, %%mm2\n"
+ "movq %%mm1, %%mm3\n"
+ "punpcklbw %%mm7, %%mm0\n"
+ "punpcklbw %%mm7, %%mm1\n"
+ "punpckhbw %%mm7, %%mm2\n"
+ "punpckhbw %%mm7, %%mm3\n"
+ "psubw %%mm1, %%mm0\n"
+ "psubw %%mm3, %%mm2\n"
+
+ "add %2, %0\n"
+
+ "movq (%0), %%mm4\n"
+ "movq %%mm4, %%mm1\n"
+ "psllq $8, %%mm4\n"
+ "psrlq $8, %%mm1\n"
+ "psrlq $8, %%mm4\n"
+ "movq %%mm4, %%mm5\n"
+ "movq %%mm1, %%mm3\n"
+ "punpcklbw %%mm7, %%mm4\n"
+ "punpcklbw %%mm7, %%mm1\n"
+ "punpckhbw %%mm7, %%mm5\n"
+ "punpckhbw %%mm7, %%mm3\n"
+ "psubw %%mm1, %%mm4\n"
+ "psubw %%mm3, %%mm5\n"
+ "psubw %%mm4, %%mm0\n"
+ "psubw %%mm5, %%mm2\n"
+ "pxor %%mm3, %%mm3\n"
+ "pxor %%mm1, %%mm1\n"
+ "pcmpgtw %%mm0, %%mm3\n\t"
+ "pcmpgtw %%mm2, %%mm1\n\t"
+ "pxor %%mm3, %%mm0\n"
+ "pxor %%mm1, %%mm2\n"
+ "psubw %%mm3, %%mm0\n"
+ "psubw %%mm1, %%mm2\n"
+ "paddw %%mm0, %%mm2\n"
+ "paddw %%mm2, %%mm6\n"
+
+ "add %2, %0\n"
+ "1:\n"
+
+ "movq (%0), %%mm0\n"
+ "movq %%mm0, %%mm1\n"
+ "psllq $8, %%mm0\n"
+ "psrlq $8, %%mm1\n"
+ "psrlq $8, %%mm0\n"
+ "movq %%mm0, %%mm2\n"
+ "movq %%mm1, %%mm3\n"
+ "punpcklbw %%mm7, %%mm0\n"
+ "punpcklbw %%mm7, %%mm1\n"
+ "punpckhbw %%mm7, %%mm2\n"
+ "punpckhbw %%mm7, %%mm3\n"
+ "psubw %%mm1, %%mm0\n"
+ "psubw %%mm3, %%mm2\n"
+ "psubw %%mm0, %%mm4\n"
+ "psubw %%mm2, %%mm5\n"
+ "pxor %%mm3, %%mm3\n"
+ "pxor %%mm1, %%mm1\n"
+ "pcmpgtw %%mm4, %%mm3\n\t"
+ "pcmpgtw %%mm5, %%mm1\n\t"
+ "pxor %%mm3, %%mm4\n"
+ "pxor %%mm1, %%mm5\n"
+ "psubw %%mm3, %%mm4\n"
+ "psubw %%mm1, %%mm5\n"
+ "paddw %%mm4, %%mm5\n"
+ "paddw %%mm5, %%mm6\n"
+
+ "add %2, %0\n"
+
+ "movq (%0), %%mm4\n"
+ "movq %%mm4, %%mm1\n"
+ "psllq $8, %%mm4\n"
+ "psrlq $8, %%mm1\n"
+ "psrlq $8, %%mm4\n"
+ "movq %%mm4, %%mm5\n"
+ "movq %%mm1, %%mm3\n"
+ "punpcklbw %%mm7, %%mm4\n"
+ "punpcklbw %%mm7, %%mm1\n"
+ "punpckhbw %%mm7, %%mm5\n"
+ "punpckhbw %%mm7, %%mm3\n"
+ "psubw %%mm1, %%mm4\n"
+ "psubw %%mm3, %%mm5\n"
+ "psubw %%mm4, %%mm0\n"
+ "psubw %%mm5, %%mm2\n"
+ "pxor %%mm3, %%mm3\n"
+ "pxor %%mm1, %%mm1\n"
+ "pcmpgtw %%mm0, %%mm3\n\t"
+ "pcmpgtw %%mm2, %%mm1\n\t"
+ "pxor %%mm3, %%mm0\n"
+ "pxor %%mm1, %%mm2\n"
+ "psubw %%mm3, %%mm0\n"
+ "psubw %%mm1, %%mm2\n"
+ "paddw %%mm0, %%mm2\n"
+ "paddw %%mm2, %%mm6\n"
+
+ "add %2, %0\n"
+ "subl $2, %%ecx\n"
+ " jnz 1b\n"
+
+ "movq %%mm6, %%mm0\n"
+ "punpcklwd %%mm7, %%mm0\n"
+ "punpckhwd %%mm7, %%mm6\n"
+ "paddd %%mm0, %%mm6\n"
+
+ "movq %%mm6, %%mm0\n"
+ "psrlq $32, %%mm6\n"
+ "paddd %%mm6, %%mm0\n"
+ "movd %%mm0, %1\n"
+ : "+r" (pix1), "=r" (tmp)
+ : "r" ((x86_reg) line_size), "g" (h - 2)
+ : "%ecx");
+
+ return tmp;
}
-static int hf_noise16_mmx(uint8_t * pix1, int line_size, int h) {
+static int hf_noise16_mmx(uint8_t *pix1, int line_size, int h)
+{
int tmp;
- uint8_t * pix= pix1;
- __asm__ volatile (
- "movl %3,%%ecx\n"
- "pxor %%mm7,%%mm7\n"
- "pxor %%mm6,%%mm6\n"
-
- "movq (%0),%%mm0\n"
- "movq 1(%0),%%mm1\n"
- "movq %%mm0, %%mm2\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm0\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm2\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm0\n"
- "psubw %%mm3, %%mm2\n"
-
- "add %2,%0\n"
-
- "movq (%0),%%mm4\n"
- "movq 1(%0),%%mm1\n"
- "movq %%mm4, %%mm5\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm4\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm5\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm4\n"
- "psubw %%mm3, %%mm5\n"
- "psubw %%mm4, %%mm0\n"
- "psubw %%mm5, %%mm2\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm0, %%mm3\n\t"
- "pcmpgtw %%mm2, %%mm1\n\t"
- "pxor %%mm3, %%mm0\n"
- "pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
- "psubw %%mm1, %%mm2\n"
- "paddw %%mm0, %%mm2\n"
- "paddw %%mm2, %%mm6\n"
-
- "add %2,%0\n"
- "1:\n"
-
- "movq (%0),%%mm0\n"
- "movq 1(%0),%%mm1\n"
- "movq %%mm0, %%mm2\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm0\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm2\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm0\n"
- "psubw %%mm3, %%mm2\n"
- "psubw %%mm0, %%mm4\n"
- "psubw %%mm2, %%mm5\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm4, %%mm3\n\t"
- "pcmpgtw %%mm5, %%mm1\n\t"
- "pxor %%mm3, %%mm4\n"
- "pxor %%mm1, %%mm5\n"
- "psubw %%mm3, %%mm4\n"
- "psubw %%mm1, %%mm5\n"
- "paddw %%mm4, %%mm5\n"
- "paddw %%mm5, %%mm6\n"
-
- "add %2,%0\n"
-
- "movq (%0),%%mm4\n"
- "movq 1(%0),%%mm1\n"
- "movq %%mm4, %%mm5\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm4\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm5\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm4\n"
- "psubw %%mm3, %%mm5\n"
- "psubw %%mm4, %%mm0\n"
- "psubw %%mm5, %%mm2\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm0, %%mm3\n\t"
- "pcmpgtw %%mm2, %%mm1\n\t"
- "pxor %%mm3, %%mm0\n"
- "pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
- "psubw %%mm1, %%mm2\n"
- "paddw %%mm0, %%mm2\n"
- "paddw %%mm2, %%mm6\n"
-
- "add %2,%0\n"
- "subl $2, %%ecx\n"
- " jnz 1b\n"
-
- "movq %%mm6, %%mm0\n"
- "punpcklwd %%mm7,%%mm0\n"
- "punpckhwd %%mm7,%%mm6\n"
- "paddd %%mm0, %%mm6\n"
-
- "movq %%mm6,%%mm0\n"
- "psrlq $32, %%mm6\n"
- "paddd %%mm6,%%mm0\n"
- "movd %%mm0,%1\n"
- : "+r" (pix1), "=r"(tmp)
- : "r" ((x86_reg)line_size) , "g" (h-2)
- : "%ecx");
- return tmp + hf_noise8_mmx(pix+8, line_size, h);
+ uint8_t *pix = pix1;
+
+ __asm__ volatile (
+ "movl %3, %%ecx\n"
+ "pxor %%mm7, %%mm7\n"
+ "pxor %%mm6, %%mm6\n"
+
+ "movq (%0), %%mm0\n"
+ "movq 1(%0), %%mm1\n"
+ "movq %%mm0, %%mm2\n"
+ "movq %%mm1, %%mm3\n"
+ "punpcklbw %%mm7, %%mm0\n"
+ "punpcklbw %%mm7, %%mm1\n"
+ "punpckhbw %%mm7, %%mm2\n"
+ "punpckhbw %%mm7, %%mm3\n"
+ "psubw %%mm1, %%mm0\n"
+ "psubw %%mm3, %%mm2\n"
+
+ "add %2, %0\n"
+
+ "movq (%0), %%mm4\n"
+ "movq 1(%0), %%mm1\n"
+ "movq %%mm4, %%mm5\n"
+ "movq %%mm1, %%mm3\n"
+ "punpcklbw %%mm7, %%mm4\n"
+ "punpcklbw %%mm7, %%mm1\n"
+ "punpckhbw %%mm7, %%mm5\n"
+ "punpckhbw %%mm7, %%mm3\n"
+ "psubw %%mm1, %%mm4\n"
+ "psubw %%mm3, %%mm5\n"
+ "psubw %%mm4, %%mm0\n"
+ "psubw %%mm5, %%mm2\n"
+ "pxor %%mm3, %%mm3\n"
+ "pxor %%mm1, %%mm1\n"
+ "pcmpgtw %%mm0, %%mm3\n\t"
+ "pcmpgtw %%mm2, %%mm1\n\t"
+ "pxor %%mm3, %%mm0\n"
+ "pxor %%mm1, %%mm2\n"
+ "psubw %%mm3, %%mm0\n"
+ "psubw %%mm1, %%mm2\n"
+ "paddw %%mm0, %%mm2\n"
+ "paddw %%mm2, %%mm6\n"
+
+ "add %2, %0\n"
+ "1:\n"
+
+ "movq (%0), %%mm0\n"
+ "movq 1(%0), %%mm1\n"
+ "movq %%mm0, %%mm2\n"
+ "movq %%mm1, %%mm3\n"
+ "punpcklbw %%mm7, %%mm0\n"
+ "punpcklbw %%mm7, %%mm1\n"
+ "punpckhbw %%mm7, %%mm2\n"
+ "punpckhbw %%mm7, %%mm3\n"
+ "psubw %%mm1, %%mm0\n"
+ "psubw %%mm3, %%mm2\n"
+ "psubw %%mm0, %%mm4\n"
+ "psubw %%mm2, %%mm5\n"
+ "pxor %%mm3, %%mm3\n"
+ "pxor %%mm1, %%mm1\n"
+ "pcmpgtw %%mm4, %%mm3\n\t"
+ "pcmpgtw %%mm5, %%mm1\n\t"
+ "pxor %%mm3, %%mm4\n"
+ "pxor %%mm1, %%mm5\n"
+ "psubw %%mm3, %%mm4\n"
+ "psubw %%mm1, %%mm5\n"
+ "paddw %%mm4, %%mm5\n"
+ "paddw %%mm5, %%mm6\n"
+
+ "add %2, %0\n"
+
+ "movq (%0), %%mm4\n"
+ "movq 1(%0), %%mm1\n"
+ "movq %%mm4, %%mm5\n"
+ "movq %%mm1, %%mm3\n"
+ "punpcklbw %%mm7, %%mm4\n"
+ "punpcklbw %%mm7, %%mm1\n"
+ "punpckhbw %%mm7, %%mm5\n"
+ "punpckhbw %%mm7, %%mm3\n"
+ "psubw %%mm1, %%mm4\n"
+ "psubw %%mm3, %%mm5\n"
+ "psubw %%mm4, %%mm0\n"
+ "psubw %%mm5, %%mm2\n"
+ "pxor %%mm3, %%mm3\n"
+ "pxor %%mm1, %%mm1\n"
+ "pcmpgtw %%mm0, %%mm3\n\t"
+ "pcmpgtw %%mm2, %%mm1\n\t"
+ "pxor %%mm3, %%mm0\n"
+ "pxor %%mm1, %%mm2\n"
+ "psubw %%mm3, %%mm0\n"
+ "psubw %%mm1, %%mm2\n"
+ "paddw %%mm0, %%mm2\n"
+ "paddw %%mm2, %%mm6\n"
+
+ "add %2, %0\n"
+ "subl $2, %%ecx\n"
+ " jnz 1b\n"
+
+ "movq %%mm6, %%mm0\n"
+ "punpcklwd %%mm7, %%mm0\n"
+ "punpckhwd %%mm7, %%mm6\n"
+ "paddd %%mm0, %%mm6\n"
+
+ "movq %%mm6, %%mm0\n"
+ "psrlq $32, %%mm6\n"
+ "paddd %%mm6, %%mm0\n"
+ "movd %%mm0, %1\n"
+ : "+r" (pix1), "=r" (tmp)
+ : "r" ((x86_reg) line_size), "g" (h - 2)
+ : "%ecx");
+
+ return tmp + hf_noise8_mmx(pix + 8, line_size, h);
}
-static int nsse16_mmx(void *p, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
- MpegEncContext *c = p;
+static int nsse16_mmx(MpegEncContext *c, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
+{
int score1, score2;
- if(c) score1 = c->dsp.sse[0](c, pix1, pix2, line_size, h);
- else score1 = sse16_mmx(c, pix1, pix2, line_size, h);
- score2= hf_noise16_mmx(pix1, line_size, h) - hf_noise16_mmx(pix2, line_size, h);
-
- if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
- else return score1 + FFABS(score2)*8;
+ if (c)
+ score1 = c->dsp.sse[0](c, pix1, pix2, line_size, h);
+ else
+ score1 = sse16_mmx(c, pix1, pix2, line_size, h);
+ score2 = hf_noise16_mmx(pix1, line_size, h) -
+ hf_noise16_mmx(pix2, line_size, h);
+
+ if (c)
+ return score1 + FFABS(score2) * c->avctx->nsse_weight;
+ else
+ return score1 + FFABS(score2) * 8;
}
-static int nsse8_mmx(void *p, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
- MpegEncContext *c = p;
- int score1= sse8_mmx(c, pix1, pix2, line_size, h);
- int score2= hf_noise8_mmx(pix1, line_size, h) - hf_noise8_mmx(pix2, line_size, h);
-
- if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
- else return score1 + FFABS(score2)*8;
+static int nsse8_mmx(MpegEncContext *c, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
+{
+ int score1 = sse8_mmx(c, pix1, pix2, line_size, h);
+ int score2 = hf_noise8_mmx(pix1, line_size, h) -
+ hf_noise8_mmx(pix2, line_size, h);
+
+ if (c)
+ return score1 + FFABS(score2) * c->avctx->nsse_weight;
+ else
+ return score1 + FFABS(score2) * 8;
}
-static int vsad_intra16_mmx(void *v, uint8_t * pix, uint8_t * dummy, int line_size, int h) {
+static int vsad_intra16_mmx(MpegEncContext *v, uint8_t *pix, uint8_t *dummy,
+ int line_size, int h)
+{
int tmp;
- av_assert2( (((int)pix) & 7) == 0);
- av_assert2((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
- "movq (%0), %%mm2\n"\
- "movq 8(%0), %%mm3\n"\
- "add %2,%0\n"\
- "movq %%mm2, " #out0 "\n"\
- "movq %%mm3, " #out1 "\n"\
- "psubusb " #in0 ", %%mm2\n"\
- "psubusb " #in1 ", %%mm3\n"\
- "psubusb " #out0 ", " #in0 "\n"\
- "psubusb " #out1 ", " #in1 "\n"\
- "por %%mm2, " #in0 "\n"\
- "por %%mm3, " #in1 "\n"\
- "movq " #in0 ", %%mm2\n"\
- "movq " #in1 ", %%mm3\n"\
- "punpcklbw %%mm7, " #in0 "\n"\
- "punpcklbw %%mm7, " #in1 "\n"\
- "punpckhbw %%mm7, %%mm2\n"\
- "punpckhbw %%mm7, %%mm3\n"\
- "paddw " #in1 ", " #in0 "\n"\
- "paddw %%mm3, %%mm2\n"\
- "paddw %%mm2, " #in0 "\n"\
- "paddw " #in0 ", %%mm6\n"
-
-
- __asm__ volatile (
- "movl %3,%%ecx\n"
- "pxor %%mm6,%%mm6\n"
- "pxor %%mm7,%%mm7\n"
- "movq (%0),%%mm0\n"
- "movq 8(%0),%%mm1\n"
- "add %2,%0\n"
- "jmp 2f\n"
- "1:\n"
-
- SUM(%%mm4, %%mm5, %%mm0, %%mm1)
- "2:\n"
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
- "subl $2, %%ecx\n"
- "jnz 1b\n"
-
- "movq %%mm6,%%mm0\n"
- "psrlq $32, %%mm6\n"
- "paddw %%mm6,%%mm0\n"
- "movq %%mm0,%%mm6\n"
- "psrlq $16, %%mm0\n"
- "paddw %%mm6,%%mm0\n"
- "movd %%mm0,%1\n"
- : "+r" (pix), "=r"(tmp)
- : "r" ((x86_reg)line_size) , "m" (h)
- : "%ecx");
+ av_assert2((((int) pix) & 7) == 0);
+ av_assert2((line_size & 7) == 0);
+
+#define SUM(in0, in1, out0, out1) \
+ "movq (%0), %%mm2\n" \
+ "movq 8(%0), %%mm3\n" \
+ "add %2,%0\n" \
+ "movq %%mm2, " #out0 "\n" \
+ "movq %%mm3, " #out1 "\n" \
+ "psubusb " #in0 ", %%mm2\n" \
+ "psubusb " #in1 ", %%mm3\n" \
+ "psubusb " #out0 ", " #in0 "\n" \
+ "psubusb " #out1 ", " #in1 "\n" \
+ "por %%mm2, " #in0 "\n" \
+ "por %%mm3, " #in1 "\n" \
+ "movq " #in0 ", %%mm2\n" \
+ "movq " #in1 ", %%mm3\n" \
+ "punpcklbw %%mm7, " #in0 "\n" \
+ "punpcklbw %%mm7, " #in1 "\n" \
+ "punpckhbw %%mm7, %%mm2\n" \
+ "punpckhbw %%mm7, %%mm3\n" \
+ "paddw " #in1 ", " #in0 "\n" \
+ "paddw %%mm3, %%mm2\n" \
+ "paddw %%mm2, " #in0 "\n" \
+ "paddw " #in0 ", %%mm6\n"
+
+
+ __asm__ volatile (
+ "movl %3, %%ecx\n"
+ "pxor %%mm6, %%mm6\n"
+ "pxor %%mm7, %%mm7\n"
+ "movq (%0), %%mm0\n"
+ "movq 8(%0), %%mm1\n"
+ "add %2, %0\n"
+ "jmp 2f\n"
+ "1:\n"
+
+ SUM(%%mm4, %%mm5, %%mm0, %%mm1)
+ "2:\n"
+ SUM(%%mm0, %%mm1, %%mm4, %%mm5)
+
+ "subl $2, %%ecx\n"
+ "jnz 1b\n"
+
+ "movq %%mm6, %%mm0\n"
+ "psrlq $32, %%mm6\n"
+ "paddw %%mm6, %%mm0\n"
+ "movq %%mm0, %%mm6\n"
+ "psrlq $16, %%mm0\n"
+ "paddw %%mm6, %%mm0\n"
+ "movd %%mm0, %1\n"
+ : "+r" (pix), "=r" (tmp)
+ : "r" ((x86_reg) line_size), "m" (h)
+ : "%ecx");
+
return tmp & 0xFFFF;
}
#undef SUM
-static int vsad_intra16_mmxext(void *v, uint8_t *pix, uint8_t *dummy,
+static int vsad_intra16_mmxext(MpegEncContext *v, uint8_t *pix, uint8_t *dummy,
int line_size, int h)
{
int tmp;
- av_assert2( (((int)pix) & 7) == 0);
- av_assert2((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
- "movq (%0), " #out0 "\n"\
- "movq 8(%0), " #out1 "\n"\
- "add %2,%0\n"\
- "psadbw " #out0 ", " #in0 "\n"\
- "psadbw " #out1 ", " #in1 "\n"\
- "paddw " #in1 ", " #in0 "\n"\
- "paddw " #in0 ", %%mm6\n"
-
- __asm__ volatile (
- "movl %3,%%ecx\n"
- "pxor %%mm6,%%mm6\n"
- "pxor %%mm7,%%mm7\n"
- "movq (%0),%%mm0\n"
- "movq 8(%0),%%mm1\n"
- "add %2,%0\n"
- "jmp 2f\n"
- "1:\n"
-
- SUM(%%mm4, %%mm5, %%mm0, %%mm1)
- "2:\n"
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
- "subl $2, %%ecx\n"
- "jnz 1b\n"
-
- "movd %%mm6,%1\n"
- : "+r" (pix), "=r"(tmp)
- : "r" ((x86_reg)line_size) , "m" (h)
- : "%ecx");
+ av_assert2((((int) pix) & 7) == 0);
+ av_assert2((line_size & 7) == 0);
+
+#define SUM(in0, in1, out0, out1) \
+ "movq (%0), " #out0 "\n" \
+ "movq 8(%0), " #out1 "\n" \
+ "add %2, %0\n" \
+ "psadbw " #out0 ", " #in0 "\n" \
+ "psadbw " #out1 ", " #in1 "\n" \
+ "paddw " #in1 ", " #in0 "\n" \
+ "paddw " #in0 ", %%mm6\n"
+
+ __asm__ volatile (
+ "movl %3, %%ecx\n"
+ "pxor %%mm6, %%mm6\n"
+ "pxor %%mm7, %%mm7\n"
+ "movq (%0), %%mm0\n"
+ "movq 8(%0), %%mm1\n"
+ "add %2, %0\n"
+ "jmp 2f\n"
+ "1:\n"
+
+ SUM(%%mm4, %%mm5, %%mm0, %%mm1)
+ "2:\n"
+ SUM(%%mm0, %%mm1, %%mm4, %%mm5)
+
+ "subl $2, %%ecx\n"
+ "jnz 1b\n"
+
+ "movd %%mm6, %1\n"
+ : "+r" (pix), "=r" (tmp)
+ : "r" ((x86_reg) line_size), "m" (h)
+ : "%ecx");
+
return tmp;
}
#undef SUM
-static int vsad16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
+static int vsad16_mmx(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h)
+{
int tmp;
- av_assert2( (((int)pix1) & 7) == 0);
- av_assert2( (((int)pix2) & 7) == 0);
- av_assert2((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
- "movq (%0),%%mm2\n"\
- "movq (%1)," #out0 "\n"\
- "movq 8(%0),%%mm3\n"\
- "movq 8(%1)," #out1 "\n"\
- "add %3,%0\n"\
- "add %3,%1\n"\
- "psubb " #out0 ", %%mm2\n"\
- "psubb " #out1 ", %%mm3\n"\
- "pxor %%mm7, %%mm2\n"\
- "pxor %%mm7, %%mm3\n"\
- "movq %%mm2, " #out0 "\n"\
- "movq %%mm3, " #out1 "\n"\
- "psubusb " #in0 ", %%mm2\n"\
- "psubusb " #in1 ", %%mm3\n"\
- "psubusb " #out0 ", " #in0 "\n"\
- "psubusb " #out1 ", " #in1 "\n"\
- "por %%mm2, " #in0 "\n"\
- "por %%mm3, " #in1 "\n"\
- "movq " #in0 ", %%mm2\n"\
- "movq " #in1 ", %%mm3\n"\
- "punpcklbw %%mm7, " #in0 "\n"\
- "punpcklbw %%mm7, " #in1 "\n"\
- "punpckhbw %%mm7, %%mm2\n"\
- "punpckhbw %%mm7, %%mm3\n"\
- "paddw " #in1 ", " #in0 "\n"\
- "paddw %%mm3, %%mm2\n"\
- "paddw %%mm2, " #in0 "\n"\
- "paddw " #in0 ", %%mm6\n"
-
-
- __asm__ volatile (
- "movl %4,%%ecx\n"
- "pxor %%mm6,%%mm6\n"
- "pcmpeqw %%mm7,%%mm7\n"
- "psllw $15, %%mm7\n"
- "packsswb %%mm7, %%mm7\n"
- "movq (%0),%%mm0\n"
- "movq (%1),%%mm2\n"
- "movq 8(%0),%%mm1\n"
- "movq 8(%1),%%mm3\n"
- "add %3,%0\n"
- "add %3,%1\n"
- "psubb %%mm2, %%mm0\n"
- "psubb %%mm3, %%mm1\n"
- "pxor %%mm7, %%mm0\n"
- "pxor %%mm7, %%mm1\n"
- "jmp 2f\n"
- "1:\n"
-
- SUM(%%mm4, %%mm5, %%mm0, %%mm1)
- "2:\n"
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
- "subl $2, %%ecx\n"
- "jnz 1b\n"
-
- "movq %%mm6,%%mm0\n"
- "psrlq $32, %%mm6\n"
- "paddw %%mm6,%%mm0\n"
- "movq %%mm0,%%mm6\n"
- "psrlq $16, %%mm0\n"
- "paddw %%mm6,%%mm0\n"
- "movd %%mm0,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
- : "r" ((x86_reg)line_size) , "m" (h)
- : "%ecx");
+ av_assert2((((int) pix1) & 7) == 0);
+ av_assert2((((int) pix2) & 7) == 0);
+ av_assert2((line_size & 7) == 0);
+
+#define SUM(in0, in1, out0, out1) \
+ "movq (%0), %%mm2\n" \
+ "movq (%1), " #out0 "\n" \
+ "movq 8(%0), %%mm3\n" \
+ "movq 8(%1), " #out1 "\n" \
+ "add %3, %0\n" \
+ "add %3, %1\n" \
+ "psubb " #out0 ", %%mm2\n" \
+ "psubb " #out1 ", %%mm3\n" \
+ "pxor %%mm7, %%mm2\n" \
+ "pxor %%mm7, %%mm3\n" \
+ "movq %%mm2, " #out0 "\n" \
+ "movq %%mm3, " #out1 "\n" \
+ "psubusb " #in0 ", %%mm2\n" \
+ "psubusb " #in1 ", %%mm3\n" \
+ "psubusb " #out0 ", " #in0 "\n" \
+ "psubusb " #out1 ", " #in1 "\n" \
+ "por %%mm2, " #in0 "\n" \
+ "por %%mm3, " #in1 "\n" \
+ "movq " #in0 ", %%mm2\n" \
+ "movq " #in1 ", %%mm3\n" \
+ "punpcklbw %%mm7, " #in0 "\n" \
+ "punpcklbw %%mm7, " #in1 "\n" \
+ "punpckhbw %%mm7, %%mm2\n" \
+ "punpckhbw %%mm7, %%mm3\n" \
+ "paddw " #in1 ", " #in0 "\n" \
+ "paddw %%mm3, %%mm2\n" \
+ "paddw %%mm2, " #in0 "\n" \
+ "paddw " #in0 ", %%mm6\n"
+
+
+ __asm__ volatile (
+ "movl %4, %%ecx\n"
+ "pxor %%mm6, %%mm6\n"
+ "pcmpeqw %%mm7, %%mm7\n"
+ "psllw $15, %%mm7\n"
+ "packsswb %%mm7, %%mm7\n"
+ "movq (%0), %%mm0\n"
+ "movq (%1), %%mm2\n"
+ "movq 8(%0), %%mm1\n"
+ "movq 8(%1), %%mm3\n"
+ "add %3, %0\n"
+ "add %3, %1\n"
+ "psubb %%mm2, %%mm0\n"
+ "psubb %%mm3, %%mm1\n"
+ "pxor %%mm7, %%mm0\n"
+ "pxor %%mm7, %%mm1\n"
+ "jmp 2f\n"
+ "1:\n"
+
+ SUM(%%mm4, %%mm5, %%mm0, %%mm1)
+ "2:\n"
+ SUM(%%mm0, %%mm1, %%mm4, %%mm5)
+
+ "subl $2, %%ecx\n"
+ "jnz 1b\n"
+
+ "movq %%mm6, %%mm0\n"
+ "psrlq $32, %%mm6\n"
+ "paddw %%mm6, %%mm0\n"
+ "movq %%mm0, %%mm6\n"
+ "psrlq $16, %%mm0\n"
+ "paddw %%mm6, %%mm0\n"
+ "movd %%mm0, %2\n"
+ : "+r" (pix1), "+r" (pix2), "=r" (tmp)
+ : "r" ((x86_reg) line_size), "m" (h)
+ : "%ecx");
+
return tmp & 0x7FFF;
}
#undef SUM
-static int vsad16_mmxext(void *v, uint8_t *pix1, uint8_t *pix2,
+static int vsad16_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
int line_size, int h)
{
int tmp;
- av_assert2( (((int)pix1) & 7) == 0);
- av_assert2( (((int)pix2) & 7) == 0);
- av_assert2((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
- "movq (%0)," #out0 "\n"\
- "movq (%1),%%mm2\n"\
- "movq 8(%0)," #out1 "\n"\
- "movq 8(%1),%%mm3\n"\
- "add %3,%0\n"\
- "add %3,%1\n"\
- "psubb %%mm2, " #out0 "\n"\
- "psubb %%mm3, " #out1 "\n"\
- "pxor %%mm7, " #out0 "\n"\
- "pxor %%mm7, " #out1 "\n"\
- "psadbw " #out0 ", " #in0 "\n"\
- "psadbw " #out1 ", " #in1 "\n"\
- "paddw " #in1 ", " #in0 "\n"\
- "paddw " #in0 ", %%mm6\n"
-
- __asm__ volatile (
- "movl %4,%%ecx\n"
- "pxor %%mm6,%%mm6\n"
- "pcmpeqw %%mm7,%%mm7\n"
- "psllw $15, %%mm7\n"
- "packsswb %%mm7, %%mm7\n"
- "movq (%0),%%mm0\n"
- "movq (%1),%%mm2\n"
- "movq 8(%0),%%mm1\n"
- "movq 8(%1),%%mm3\n"
- "add %3,%0\n"
- "add %3,%1\n"
- "psubb %%mm2, %%mm0\n"
- "psubb %%mm3, %%mm1\n"
- "pxor %%mm7, %%mm0\n"
- "pxor %%mm7, %%mm1\n"
- "jmp 2f\n"
- "1:\n"
-
- SUM(%%mm4, %%mm5, %%mm0, %%mm1)
- "2:\n"
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
- "subl $2, %%ecx\n"
- "jnz 1b\n"
-
- "movd %%mm6,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
- : "r" ((x86_reg)line_size) , "m" (h)
- : "%ecx");
+ av_assert2((((int) pix1) & 7) == 0);
+ av_assert2((((int) pix2) & 7) == 0);
+ av_assert2((line_size & 7) == 0);
+
+#define SUM(in0, in1, out0, out1) \
+ "movq (%0), " #out0 "\n" \
+ "movq (%1), %%mm2\n" \
+ "movq 8(%0), " #out1 "\n" \
+ "movq 8(%1), %%mm3\n" \
+ "add %3, %0\n" \
+ "add %3, %1\n" \
+ "psubb %%mm2, " #out0 "\n" \
+ "psubb %%mm3, " #out1 "\n" \
+ "pxor %%mm7, " #out0 "\n" \
+ "pxor %%mm7, " #out1 "\n" \
+ "psadbw " #out0 ", " #in0 "\n" \
+ "psadbw " #out1 ", " #in1 "\n" \
+ "paddw " #in1 ", " #in0 "\n" \
+ "paddw " #in0 ", %%mm6\n "
+
+ __asm__ volatile (
+ "movl %4, %%ecx\n"
+ "pxor %%mm6, %%mm6\n"
+ "pcmpeqw %%mm7, %%mm7\n"
+ "psllw $15, %%mm7\n"
+ "packsswb %%mm7, %%mm7\n"
+ "movq (%0), %%mm0\n"
+ "movq (%1), %%mm2\n"
+ "movq 8(%0), %%mm1\n"
+ "movq 8(%1), %%mm3\n"
+ "add %3, %0\n"
+ "add %3, %1\n"
+ "psubb %%mm2, %%mm0\n"
+ "psubb %%mm3, %%mm1\n"
+ "pxor %%mm7, %%mm0\n"
+ "pxor %%mm7, %%mm1\n"
+ "jmp 2f\n"
+ "1:\n"
+
+ SUM(%%mm4, %%mm5, %%mm0, %%mm1)
+ "2:\n"
+ SUM(%%mm0, %%mm1, %%mm4, %%mm5)
+
+ "subl $2, %%ecx\n"
+ "jnz 1b\n"
+
+ "movd %%mm6, %2\n"
+ : "+r" (pix1), "+r" (pix2), "=r" (tmp)
+ : "r" ((x86_reg) line_size), "m" (h)
+ : "%ecx");
+
return tmp;
}
#undef SUM
-static void diff_bytes_mmx(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w){
- x86_reg i=0;
- if(w>=16)
- __asm__ volatile(
+static void diff_bytes_mmx(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w)
+{
+ x86_reg i = 0;
+
+ if (w >= 16)
+ __asm__ volatile (
"1: \n\t"
"movq (%2, %0), %%mm0 \n\t"
"movq (%1, %0), %%mm1 \n\t"
@@ -678,20 +713,20 @@ static void diff_bytes_mmx(uint8_t *dst, const uint8_t *src1, const uint8_t *src
"cmp %4, %0 \n\t"
" jb 1b \n\t"
: "+r" (i)
- : "r"(src1), "r"(src2), "r"(dst), "r"((x86_reg)w-15)
- );
- for(; i<w; i++)
- dst[i+0] = src1[i+0]-src2[i+0];
+ : "r" (src1), "r" (src2), "r" (dst), "r" ((x86_reg) w - 15));
+
+ for (; i < w; i++)
+ dst[i + 0] = src1[i + 0] - src2[i + 0];
}
static void sub_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *src1,
const uint8_t *src2, int w,
int *left, int *left_top)
{
- x86_reg i=0;
+ x86_reg i = 0;
uint8_t l, lt;
- __asm__ volatile(
+ __asm__ volatile (
"movq (%1, %0), %%mm0 \n\t" // LT
"psllq $8, %%mm0 \n\t"
"1: \n\t"
@@ -713,139 +748,142 @@ static void sub_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *src1,
"cmp %4, %0 \n\t"
" jb 1b \n\t"
: "+r" (i)
- : "r"(src1), "r"(src2), "r"(dst), "r"((x86_reg)w)
- );
+ : "r" (src1), "r" (src2), "r" (dst), "r" ((x86_reg) w));
- l= *left;
- lt= *left_top;
+ l = *left;
+ lt = *left_top;
- dst[0]= src2[0] - mid_pred(l, src1[0], (l + src1[0] - lt)&0xFF);
+ dst[0] = src2[0] - mid_pred(l, src1[0], (l + src1[0] - lt) & 0xFF);
- *left_top= src1[w-1];
- *left = src2[w-1];
+ *left_top = src1[w - 1];
+ *left = src2[w - 1];
}
-#define MMABS_MMX(a,z)\
- "pxor " #z ", " #z " \n\t"\
- "pcmpgtw " #a ", " #z " \n\t"\
- "pxor " #z ", " #a " \n\t"\
- "psubw " #z ", " #a " \n\t"
-
-#define MMABS_MMXEXT(a, z) \
- "pxor " #z ", " #z " \n\t"\
- "psubw " #a ", " #z " \n\t"\
- "pmaxsw " #z ", " #a " \n\t"
-
-#define MMABS_SSSE3(a,z)\
- "pabsw " #a ", " #a " \n\t"
-
-#define MMABS_SUM(a,z, sum)\
- MMABS(a,z)\
- "paddusw " #a ", " #sum " \n\t"
-
-/* FIXME: HSUM_* saturates at 64k, while an 8x8 hadamard or dct block can get up to
- * about 100k on extreme inputs. But that's very unlikely to occur in natural video,
- * and it's even more unlikely to not have any alternative mvs/modes with lower cost. */
-#define HSUM_MMX(a, t, dst)\
- "movq "#a", "#t" \n\t"\
- "psrlq $32, "#a" \n\t"\
- "paddusw "#t", "#a" \n\t"\
- "movq "#a", "#t" \n\t"\
- "psrlq $16, "#a" \n\t"\
- "paddusw "#t", "#a" \n\t"\
- "movd "#a", "#dst" \n\t"\
-
-#define HSUM_MMXEXT(a, t, dst) \
- "pshufw $0x0E, "#a", "#t" \n\t"\
- "paddusw "#t", "#a" \n\t"\
- "pshufw $0x01, "#a", "#t" \n\t"\
- "paddusw "#t", "#a" \n\t"\
- "movd "#a", "#dst" \n\t"\
-
-#define HSUM_SSE2(a, t, dst)\
- "movhlps "#a", "#t" \n\t"\
- "paddusw "#t", "#a" \n\t"\
- "pshuflw $0x0E, "#a", "#t" \n\t"\
- "paddusw "#t", "#a" \n\t"\
- "pshuflw $0x01, "#a", "#t" \n\t"\
- "paddusw "#t", "#a" \n\t"\
- "movd "#a", "#dst" \n\t"\
-
-#define DCT_SAD4(m,mm,o)\
- "mov"#m" "#o"+ 0(%1), "#mm"2 \n\t"\
- "mov"#m" "#o"+16(%1), "#mm"3 \n\t"\
- "mov"#m" "#o"+32(%1), "#mm"4 \n\t"\
- "mov"#m" "#o"+48(%1), "#mm"5 \n\t"\
- MMABS_SUM(mm##2, mm##6, mm##0)\
- MMABS_SUM(mm##3, mm##7, mm##1)\
- MMABS_SUM(mm##4, mm##6, mm##0)\
- MMABS_SUM(mm##5, mm##7, mm##1)\
-
-#define DCT_SAD_MMX\
- "pxor %%mm0, %%mm0 \n\t"\
- "pxor %%mm1, %%mm1 \n\t"\
- DCT_SAD4(q, %%mm, 0)\
- DCT_SAD4(q, %%mm, 8)\
- DCT_SAD4(q, %%mm, 64)\
- DCT_SAD4(q, %%mm, 72)\
- "paddusw %%mm1, %%mm0 \n\t"\
+#define MMABS_MMX(a,z) \
+ "pxor " #z ", " #z " \n\t" \
+ "pcmpgtw " #a ", " #z " \n\t" \
+ "pxor " #z ", " #a " \n\t" \
+ "psubw " #z ", " #a " \n\t"
+
+#define MMABS_MMXEXT(a, z) \
+ "pxor " #z ", " #z " \n\t" \
+ "psubw " #a ", " #z " \n\t" \
+ "pmaxsw " #z ", " #a " \n\t"
+
+#define MMABS_SSSE3(a,z) \
+ "pabsw " #a ", " #a " \n\t"
+
+#define MMABS_SUM(a,z, sum) \
+ MMABS(a,z) \
+ "paddusw " #a ", " #sum " \n\t"
+
+/* FIXME: HSUM_* saturates at 64k, while an 8x8 hadamard or dct block can get
+ * up to about 100k on extreme inputs. But that's very unlikely to occur in
+ * natural video, and it's even more unlikely to not have any alternative
+ * mvs/modes with lower cost. */
+#define HSUM_MMX(a, t, dst) \
+ "movq " #a ", " #t " \n\t" \
+ "psrlq $32, " #a " \n\t" \
+ "paddusw " #t ", " #a " \n\t" \
+ "movq " #a ", " #t " \n\t" \
+ "psrlq $16, " #a " \n\t" \
+ "paddusw " #t ", " #a " \n\t" \
+ "movd " #a ", " #dst " \n\t" \
+
+#define HSUM_MMXEXT(a, t, dst) \
+ "pshufw $0x0E, " #a ", " #t " \n\t" \
+ "paddusw " #t ", " #a " \n\t" \
+ "pshufw $0x01, " #a ", " #t " \n\t" \
+ "paddusw " #t ", " #a " \n\t" \
+ "movd " #a ", " #dst " \n\t" \
+
+#define HSUM_SSE2(a, t, dst) \
+ "movhlps " #a ", " #t " \n\t" \
+ "paddusw " #t ", " #a " \n\t" \
+ "pshuflw $0x0E, " #a ", " #t " \n\t" \
+ "paddusw " #t ", " #a " \n\t" \
+ "pshuflw $0x01, " #a ", " #t " \n\t" \
+ "paddusw " #t ", " #a " \n\t" \
+ "movd " #a ", " #dst " \n\t" \
+
+#define DCT_SAD4(m, mm, o) \
+ "mov"#m" "#o" + 0(%1), " #mm "2 \n\t" \
+ "mov"#m" "#o" + 16(%1), " #mm "3 \n\t" \
+ "mov"#m" "#o" + 32(%1), " #mm "4 \n\t" \
+ "mov"#m" "#o" + 48(%1), " #mm "5 \n\t" \
+ MMABS_SUM(mm ## 2, mm ## 6, mm ## 0) \
+ MMABS_SUM(mm ## 3, mm ## 7, mm ## 1) \
+ MMABS_SUM(mm ## 4, mm ## 6, mm ## 0) \
+ MMABS_SUM(mm ## 5, mm ## 7, mm ## 1) \
+
+#define DCT_SAD_MMX \
+ "pxor %%mm0, %%mm0 \n\t" \
+ "pxor %%mm1, %%mm1 \n\t" \
+ DCT_SAD4(q, %%mm, 0) \
+ DCT_SAD4(q, %%mm, 8) \
+ DCT_SAD4(q, %%mm, 64) \
+ DCT_SAD4(q, %%mm, 72) \
+ "paddusw %%mm1, %%mm0 \n\t" \
HSUM(%%mm0, %%mm1, %0)
-#define DCT_SAD_SSE2\
- "pxor %%xmm0, %%xmm0 \n\t"\
- "pxor %%xmm1, %%xmm1 \n\t"\
- DCT_SAD4(dqa, %%xmm, 0)\
- DCT_SAD4(dqa, %%xmm, 64)\
- "paddusw %%xmm1, %%xmm0 \n\t"\
+#define DCT_SAD_SSE2 \
+ "pxor %%xmm0, %%xmm0 \n\t" \
+ "pxor %%xmm1, %%xmm1 \n\t" \
+ DCT_SAD4(dqa, %%xmm, 0) \
+ DCT_SAD4(dqa, %%xmm, 64) \
+ "paddusw %%xmm1, %%xmm0 \n\t" \
HSUM(%%xmm0, %%xmm1, %0)
-#define DCT_SAD_FUNC(cpu) \
-static int sum_abs_dctelem_##cpu(int16_t *block){\
- int sum;\
- __asm__ volatile(\
- DCT_SAD\
- :"=r"(sum)\
- :"r"(block)\
- );\
- return sum&0xFFFF;\
+#define DCT_SAD_FUNC(cpu) \
+static int sum_abs_dctelem_ ## cpu(int16_t *block) \
+{ \
+ int sum; \
+ __asm__ volatile ( \
+ DCT_SAD \
+ :"=r"(sum) \
+ :"r"(block)); \
+ return sum & 0xFFFF; \
}
-#define DCT_SAD DCT_SAD_MMX
-#define HSUM(a,t,dst) HSUM_MMX(a,t,dst)
-#define MMABS(a,z) MMABS_MMX(a,z)
+#define DCT_SAD DCT_SAD_MMX
+#define HSUM(a, t, dst) HSUM_MMX(a, t, dst)
+#define MMABS(a, z) MMABS_MMX(a, z)
DCT_SAD_FUNC(mmx)
#undef MMABS
#undef HSUM
-#define HSUM(a,t,dst) HSUM_MMXEXT(a,t,dst)
-#define MMABS(a,z) MMABS_MMXEXT(a,z)
+#define HSUM(a, t, dst) HSUM_MMXEXT(a, t, dst)
+#define MMABS(a, z) MMABS_MMXEXT(a, z)
DCT_SAD_FUNC(mmxext)
#undef HSUM
#undef DCT_SAD
-#define DCT_SAD DCT_SAD_SSE2
-#define HSUM(a,t,dst) HSUM_SSE2(a,t,dst)
+#define DCT_SAD DCT_SAD_SSE2
+#define HSUM(a, t, dst) HSUM_SSE2(a, t, dst)
DCT_SAD_FUNC(sse2)
#undef MMABS
#if HAVE_SSSE3_INLINE
-#define MMABS(a,z) MMABS_SSSE3(a,z)
+#define MMABS(a, z) MMABS_SSSE3(a, z)
DCT_SAD_FUNC(ssse3)
#undef MMABS
#endif
#undef HSUM
#undef DCT_SAD
-static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int size){
+static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2,
+ int size)
+{
int sum;
- x86_reg i=size;
- __asm__ volatile(
+ x86_reg i = size;
+
+ __asm__ volatile (
"pxor %%mm4, %%mm4 \n"
"1: \n"
"sub $8, %0 \n"
- "movq (%2,%0), %%mm2 \n"
- "movq (%3,%0,2), %%mm0 \n"
- "movq 8(%3,%0,2), %%mm1 \n"
+ "movq (%2, %0), %%mm2 \n"
+ "movq (%3, %0, 2), %%mm0 \n"
+ "movq 8(%3, %0, 2), %%mm1 \n"
"punpckhbw %%mm2, %%mm3 \n"
"punpcklbw %%mm2, %%mm2 \n"
"psraw $8, %%mm3 \n"
@@ -861,28 +899,29 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si
"psrlq $32, %%mm3 \n"
"paddd %%mm3, %%mm4 \n"
"movd %%mm4, %1 \n"
- :"+r"(i), "=r"(sum)
- :"r"(pix1), "r"(pix2)
- );
+ : "+r" (i), "=r" (sum)
+ : "r" (pix1), "r" (pix2));
+
return sum;
}
-#define PHADDD(a, t)\
- "movq "#a", "#t" \n\t"\
- "psrlq $32, "#a" \n\t"\
- "paddd "#t", "#a" \n\t"
+#define PHADDD(a, t) \
+ "movq " #a ", " #t " \n\t" \
+ "psrlq $32, " #a " \n\t" \
+ "paddd " #t ", " #a " \n\t"
+
/*
- pmulhw: dst[0-15]=(src[0-15]*dst[0-15])[16-31]
- pmulhrw: dst[0-15]=(src[0-15]*dst[0-15] + 0x8000)[16-31]
- pmulhrsw: dst[0-15]=(src[0-15]*dst[0-15] + 0x4000)[15-30]
+ * pmulhw: dst[0 - 15] = (src[0 - 15] * dst[0 - 15])[16 - 31]
+ * pmulhrw: dst[0 - 15] = (src[0 - 15] * dst[0 - 15] + 0x8000)[16 - 31]
+ * pmulhrsw: dst[0 - 15] = (src[0 - 15] * dst[0 - 15] + 0x4000)[15 - 30]
*/
-#define PMULHRW(x, y, s, o)\
- "pmulhw " #s ", "#x " \n\t"\
- "pmulhw " #s ", "#y " \n\t"\
- "paddw " #o ", "#x " \n\t"\
- "paddw " #o ", "#y " \n\t"\
- "psraw $1, "#x " \n\t"\
- "psraw $1, "#y " \n\t"
+#define PMULHRW(x, y, s, o) \
+ "pmulhw " #s ", " #x " \n\t" \
+ "pmulhw " #s ", " #y " \n\t" \
+ "paddw " #o ", " #x " \n\t" \
+ "paddw " #o ", " #y " \n\t" \
+ "psraw $1, " #x " \n\t" \
+ "psraw $1, " #y " \n\t"
#define DEF(x) x ## _mmx
#define SET_RND MOVQ_WONE
#define SCALE_OFFSET 1
@@ -897,9 +936,9 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si
#define DEF(x) x ## _3dnow
#define SET_RND(x)
#define SCALE_OFFSET 0
-#define PMULHRW(x, y, s, o)\
- "pmulhrw " #s ", "#x " \n\t"\
- "pmulhrw " #s ", "#y " \n\t"
+#define PMULHRW(x, y, s, o) \
+ "pmulhrw " #s ", " #x " \n\t" \
+ "pmulhrw " #s ", " #y " \n\t"
#include "dsputil_qns_template.c"
@@ -913,12 +952,15 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si
#define DEF(x) x ## _ssse3
#define SET_RND(x)
#define SCALE_OFFSET -1
-#define PHADDD(a, t)\
- "pshufw $0x0E, "#a", "#t" \n\t"\
- "paddd "#t", "#a" \n\t" /* faster than phaddd on core2 */
-#define PMULHRW(x, y, s, o)\
- "pmulhrsw " #s ", "#x " \n\t"\
- "pmulhrsw " #s ", "#y " \n\t"
+
+#define PHADDD(a, t) \
+ "pshufw $0x0E, " #a ", " #t " \n\t" \
+ /* faster than phaddd on core2 */ \
+ "paddd " #t ", " #a " \n\t"
+
+#define PMULHRW(x, y, s, o) \
+ "pmulhrsw " #s ", " #x " \n\t" \
+ "pmulhrsw " #s ", " #y " \n\t"
#include "dsputil_qns_template.c"
@@ -931,63 +973,58 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si
#endif /* HAVE_INLINE_ASM */
-int ff_sse16_sse2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h);
+int ff_sse16_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ int line_size, int h);
-#define hadamard_func(cpu) \
-int ff_hadamard8_diff_##cpu (void *s, uint8_t *src1, uint8_t *src2, \
- int stride, int h); \
-int ff_hadamard8_diff16_##cpu(void *s, uint8_t *src1, uint8_t *src2, \
- int stride, int h);
+#define hadamard_func(cpu) \
+ int ff_hadamard8_diff_ ## cpu(MpegEncContext *s, uint8_t *src1, \
+ uint8_t *src2, int stride, int h); \
+ int ff_hadamard8_diff16_ ## cpu(MpegEncContext *s, uint8_t *src1, \
+ uint8_t *src2, int stride, int h);
hadamard_func(mmx)
hadamard_func(mmxext)
hadamard_func(sse2)
hadamard_func(ssse3)
-av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
+av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
{
int cpu_flags = av_get_cpu_flags();
const int dct_algo = avctx->dct_algo;
-#if HAVE_YASM
- int bit_depth = avctx->bits_per_raw_sample;
-
if (EXTERNAL_MMX(cpu_flags)) {
- if (bit_depth <= 8)
+ if (!high_bit_depth)
c->get_pixels = ff_get_pixels_mmx;
c->diff_pixels = ff_diff_pixels_mmx;
- c->pix_sum = ff_pix_sum16_mmx;
-
- c->pix_norm1 = ff_pix_norm1_mmx;
+ c->pix_sum = ff_pix_sum16_mmx;
+ c->pix_norm1 = ff_pix_norm1_mmx;
}
+
if (EXTERNAL_SSE2(cpu_flags))
- if (bit_depth <= 8)
+ if (!high_bit_depth)
c->get_pixels = ff_get_pixels_sse2;
-#endif /* HAVE_YASM */
#if HAVE_INLINE_ASM
if (INLINE_MMX(cpu_flags)) {
- if (avctx->bits_per_raw_sample <= 8 &&
+ if (!high_bit_depth &&
(dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
c->fdct = ff_fdct_mmx;
- c->diff_bytes= diff_bytes_mmx;
- c->sum_abs_dctelem= sum_abs_dctelem_mmx;
+ c->diff_bytes = diff_bytes_mmx;
+ c->sum_abs_dctelem = sum_abs_dctelem_mmx;
- c->sse[0] = sse16_mmx;
- c->sse[1] = sse8_mmx;
- c->vsad[4]= vsad_intra16_mmx;
+ c->sse[0] = sse16_mmx;
+ c->sse[1] = sse8_mmx;
+ c->vsad[4] = vsad_intra16_mmx;
c->nsse[0] = nsse16_mmx;
c->nsse[1] = nsse8_mmx;
- if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
- c->vsad[0] = vsad16_mmx;
- }
-
- if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
- c->try_8x8basis= try_8x8basis_mmx;
+ if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+ c->vsad[0] = vsad16_mmx;
+ c->try_8x8basis = try_8x8basis_mmx;
}
- c->add_8x8basis= add_8x8basis_mmx;
+ c->add_8x8basis = add_8x8basis_mmx;
c->ssd_int8_vs_int16 = ssd_int8_vs_int16_mmx;
}
@@ -1000,14 +1037,14 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
}
if (INLINE_MMXEXT(cpu_flags)) {
- if (avctx->bits_per_raw_sample <= 8 &&
+ if (!high_bit_depth &&
(dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
c->fdct = ff_fdct_mmxext;
c->sum_abs_dctelem = sum_abs_dctelem_mmxext;
c->vsad[4] = vsad_intra16_mmxext;
- if (!(avctx->flags & CODEC_FLAG_BITEXACT)){
+ if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
c->vsad[0] = vsad16_mmxext;
}
@@ -1015,11 +1052,11 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
}
if (INLINE_SSE2(cpu_flags)) {
- if (avctx->bits_per_raw_sample <= 8 &&
+ if (!high_bit_depth &&
(dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
c->fdct = ff_fdct_sse2;
- c->sum_abs_dctelem= sum_abs_dctelem_sse2;
+ c->sum_abs_dctelem = sum_abs_dctelem_sse2;
}
#if HAVE_SSSE3_INLINE
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/fdct.c b/chromium/third_party/ffmpeg/libavcodec/x86/fdct.c
index 11a13bb7043..f0cd471d363 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/fdct.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/fdct.c
@@ -1,5 +1,5 @@
/*
- * MMX optimized forward DCT
+ * SIMD-optimized forward DCT
* The gcc porting is Copyright (c) 2001 Fabrice Bellard.
* cleanup/optimizations are Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
* SSE2 optimization is Copyright (c) 2004 Denes Balatoni.
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/flacdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/flacdsp.asm
new file mode 100644
index 00000000000..37ee87b163f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/flacdsp.asm
@@ -0,0 +1,74 @@
+;******************************************************************************
+;* FLAC DSP SIMD optimizations
+;*
+;* Copyright (C) 2014 Loren Merritt
+;*
+;* 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 "libavutil/x86/x86util.asm"
+
+SECTION .text
+
+%macro LPC_32 1
+INIT_XMM %1
+cglobal flac_lpc_32, 5,6,5, decoded, coeffs, pred_order, qlevel, len, j
+ sub lend, pred_orderd
+ jle .ret
+ lea decodedq, [decodedq+pred_orderq*4-8]
+ lea coeffsq, [coeffsq+pred_orderq*4]
+ neg pred_orderq
+ movd m4, qlevelm
+ALIGN 16
+.loop_sample:
+ movd m0, [decodedq+pred_orderq*4+8]
+ add decodedq, 8
+ movd m1, [coeffsq+pred_orderq*4]
+ pxor m2, m2
+ pxor m3, m3
+ lea jq, [pred_orderq+1]
+ test jq, jq
+ jz .end_order
+.loop_order:
+ PMACSDQL m2, m0, m1, m2, m0
+ movd m0, [decodedq+jq*4]
+ PMACSDQL m3, m1, m0, m3, m1
+ movd m1, [coeffsq+jq*4]
+ inc jq
+ jl .loop_order
+.end_order:
+ PMACSDQL m2, m0, m1, m2, m0
+ psrlq m2, m4
+ movd m0, [decodedq]
+ paddd m0, m2
+ movd [decodedq], m0
+ sub lend, 2
+ jl .ret
+ PMACSDQL m3, m1, m0, m3, m1
+ psrlq m3, m4
+ movd m1, [decodedq+4]
+ paddd m1, m3
+ movd [decodedq+4], m1
+ jg .loop_sample
+.ret:
+ REP_RET
+%endmacro
+
+%if HAVE_XOP_EXTERNAL
+LPC_32 xop
+%endif
+LPC_32 sse4
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/flacdsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/flacdsp_init.c
new file mode 100644
index 00000000000..a071b3d3b79
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/flacdsp_init.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014 James Almer
+ *
+ * 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 "libavcodec/flacdsp.h"
+#include "libavutil/x86/cpu.h"
+#include "config.h"
+
+void ff_flac_lpc_32_sse4(int32_t *samples, const int coeffs[32], int order,
+ int qlevel, int len);
+void ff_flac_lpc_32_xop(int32_t *samples, const int coeffs[32], int order,
+ int qlevel, int len);
+
+av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt,
+ int bps)
+{
+#if HAVE_YASM
+ int cpu_flags = av_get_cpu_flags();
+
+ if (EXTERNAL_SSE4(cpu_flags)) {
+ if (bps > 16 && CONFIG_FLAC_DECODER)
+ c->lpc = ff_flac_lpc_32_sse4;
+ }
+ if (EXTERNAL_XOP(cpu_flags)) {
+ if (bps > 16 && CONFIG_FLAC_DECODER)
+ c->lpc = ff_flac_lpc_32_xop;
+ }
+#endif
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/fmtconvert.asm b/chromium/third_party/ffmpeg/libavcodec/x86/fmtconvert.asm
index 60078e2c2c7..0d3f821c9f8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/fmtconvert.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/fmtconvert.asm
@@ -31,9 +31,10 @@ SECTION_TEXT
%endif
%endmacro
-;---------------------------------------------------------------------------------
-; void int32_to_float_fmul_scalar(float *dst, const int32_t *src, float mul, int len);
-;---------------------------------------------------------------------------------
+;------------------------------------------------------------------------------
+; void ff_int32_to_float_fmul_scalar(float *dst, const int32_t *src, float mul,
+; int len);
+;------------------------------------------------------------------------------
%macro INT32_TO_FLOAT_FMUL_SCALAR 1
%if UNIX64
cglobal int32_to_float_fmul_scalar, 3, 3, %1, dst, src, len
@@ -243,8 +244,10 @@ FLOAT_TO_INT16_INTERLEAVE2
INIT_XMM sse2
FLOAT_TO_INT16_INTERLEAVE2
+;-----------------------------------------------------------------------------
+; void ff_float_to_int16_interleave6(int16_t *dst, const float **src, int len)
+;-----------------------------------------------------------------------------
%macro FLOAT_TO_INT16_INTERLEAVE6 0
-; void float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len)
cglobal float_to_int16_interleave6, 2, 8, 0, dst, src, src1, src2, src3, src4, src5, len
%if ARCH_X86_64
mov lend, r2d
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/fpel.asm b/chromium/third_party/ffmpeg/libavcodec/x86/fpel.asm
index dc363d1a635..de6b1d6c1b5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/fpel.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/fpel.asm
@@ -1,5 +1,5 @@
;******************************************************************************
-;* MMX optimized DSP utils
+;* SIMD-optimized fullpel functions
;* Copyright (c) 2008 Loren Merritt
;* Copyright (c) 2003-2013 Michael Niedermayer
;* Copyright (c) 2013 Daniel Kang
@@ -26,7 +26,8 @@
SECTION .text
INIT_MMX mmxext
-; void pixels(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_put/avg_pixels(uint8_t *block, const uint8_t *pixels,
+; ptrdiff_t line_size, int h)
%macro PIXELS48 2
%if %2 == 4
%define OP movh
@@ -65,7 +66,8 @@ PIXELS48 avg, 8
INIT_XMM sse2
-; void put_pixels16_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_put_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
+; ptrdiff_t line_size, int h)
cglobal put_pixels16, 4,5,4
lea r4, [r2*3]
.loop:
@@ -83,7 +85,8 @@ cglobal put_pixels16, 4,5,4
jnz .loop
REP_RET
-; void avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
+; ptrdiff_t line_size, int h)
cglobal avg_pixels16, 4,5,4
lea r4, [r2*3]
.loop:
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/fpel.h b/chromium/third_party/ffmpeg/libavcodec/x86/fpel.h
new file mode 100644
index 00000000000..2fbbfce26f6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/fpel.h
@@ -0,0 +1,43 @@
+/*
+ * 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_X86_FPEL_H
+#define AVCODEC_X86_FPEL_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+void ff_avg_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels8_mmxext(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels8_mmxext(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+
+
+#endif /* AVCODEC_X86_FPEL_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/fpel_mmx.c b/chromium/third_party/ffmpeg/libavcodec/x86/fpel_mmx.c
index 384ab89d9c5..45cc57e6d71 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/fpel_mmx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/fpel_mmx.c
@@ -25,7 +25,8 @@
#include <stdint.h>
#include "config.h"
-#include "dsputil_x86.h"
+#include "fpel.h"
+#include "inline_asm.h"
#if HAVE_MMX_INLINE
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h263_loopfilter.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h263_loopfilter.asm
index a21baf16294..2fcd1a26e54 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h263_loopfilter.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h263_loopfilter.asm
@@ -101,7 +101,7 @@ SECTION_TEXT
%endmacro
INIT_MMX mmx
-; void h263_v_loop_filter(uint8_t *src, int stride, int qscale)
+; void ff_h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale)
cglobal h263_v_loop_filter, 3,5
movsxdifnidn r1, r1d
movsxdifnidn r2, r2d
@@ -142,7 +142,7 @@ cglobal h263_v_loop_filter, 3,5
%endmacro
-; void h263_h_loop_filter(uint8_t *src, int stride, int qscale)
+; void ff_h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale)
INIT_MMX mmx
cglobal h263_h_loop_filter, 3,5,0,32
movsxdifnidn r1, r1d
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_chromamc.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_chromamc.asm
index 32681aafd7f..107ae51cbcc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_chromamc.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_chromamc.asm
@@ -103,8 +103,9 @@ SECTION .text
%else
%define extra_regs 0
%endif ; rv40
-; put/avg_h264_chroma_mc8_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/,
-; int stride, int h, int mx, int my)
+; void ff_put/avg_h264_chroma_mc8_*(uint8_t *dst /* align 8 */,
+; uint8_t *src /* align 1 */,
+; int stride, int h, int mx, int my)
cglobal %1_%2_chroma_mc8%3, 6, 7 + extra_regs, 0
%if ARCH_X86_64
movsxd r2, r2d
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_chromamc_10bit.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_chromamc_10bit.asm
index beb7c0fe208..c3584820923 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_chromamc_10bit.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_chromamc_10bit.asm
@@ -57,11 +57,10 @@ SECTION .text
%endmacro
;-----------------------------------------------------------------------------
-; void put/avg_h264_chroma_mc8(pixel *dst, pixel *src, int stride, int h, int mx, int my)
+; void ff_put/avg_h264_chroma_mc8(pixel *dst, pixel *src, int stride, int h,
+; int mx, int my)
;-----------------------------------------------------------------------------
%macro CHROMA_MC8 1
-; put/avg_h264_chroma_mc8_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/,
-; int stride, int h, int mx, int my)
cglobal %1_h264_chroma_mc8_10, 6,7,8
movsxdifnidn r2, r2d
mov r6d, r5d
@@ -150,7 +149,8 @@ cglobal %1_h264_chroma_mc8_10, 6,7,8
%endmacro
;-----------------------------------------------------------------------------
-; void put/avg_h264_chroma_mc4(pixel *dst, pixel *src, int stride, int h, int mx, int my)
+; void ff_put/avg_h264_chroma_mc4(pixel *dst, pixel *src, int stride, int h,
+; int mx, int my)
;-----------------------------------------------------------------------------
;TODO: xmm mc4
%macro MC4_OP 2
@@ -200,7 +200,8 @@ cglobal %1_h264_chroma_mc4_10, 6,6,7
%endmacro
;-----------------------------------------------------------------------------
-; void put/avg_h264_chroma_mc2(pixel *dst, pixel *src, int stride, int h, int mx, int my)
+; void ff_put/avg_h264_chroma_mc2(pixel *dst, pixel *src, int stride, int h,
+; int mx, int my)
;-----------------------------------------------------------------------------
%macro CHROMA_MC2 1
cglobal %1_h264_chroma_mc2_10, 6,7
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock.asm
index 1317783bec6..e5cc442943d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock.asm
@@ -283,7 +283,8 @@ cextern pb_3
%if ARCH_X86_64
;-----------------------------------------------------------------------------
-; void deblock_v_luma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
+; void ff_deblock_v_luma(uint8_t *pix, int stride, int alpha, int beta,
+; int8_t *tc0)
;-----------------------------------------------------------------------------
%macro DEBLOCK_LUMA 0
cglobal deblock_v_luma_8, 5,5,10
@@ -328,7 +329,8 @@ cglobal deblock_v_luma_8, 5,5,10
RET
;-----------------------------------------------------------------------------
-; void deblock_h_luma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
+; void ff_deblock_h_luma(uint8_t *pix, int stride, int alpha, int beta,
+; int8_t *tc0)
;-----------------------------------------------------------------------------
INIT_MMX cpuname
cglobal deblock_h_luma_8, 5,9,0,0x60+16*WIN64
@@ -391,7 +393,8 @@ DEBLOCK_LUMA
%macro DEBLOCK_LUMA 2
;-----------------------------------------------------------------------------
-; void deblock_v8_luma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
+; void ff_deblock_v8_luma(uint8_t *pix, int stride, int alpha, int beta,
+; int8_t *tc0)
;-----------------------------------------------------------------------------
cglobal deblock_%1_luma_8, 5,5,8,2*%2
lea r4, [r1*3]
@@ -439,7 +442,8 @@ cglobal deblock_%1_luma_8, 5,5,8,2*%2
RET
;-----------------------------------------------------------------------------
-; void deblock_h_luma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
+; void ff_deblock_h_luma(uint8_t *pix, int stride, int alpha, int beta,
+; int8_t *tc0)
;-----------------------------------------------------------------------------
INIT_MMX cpuname
cglobal deblock_h_luma_8, 0,5,8,0x60+HAVE_ALIGNED_STACK*12
@@ -639,7 +643,7 @@ DEBLOCK_LUMA v, 16
%endif
;-----------------------------------------------------------------------------
-; void deblock_v_luma_intra( uint8_t *pix, int stride, int alpha, int beta )
+; void ff_deblock_v_luma_intra(uint8_t *pix, int stride, int alpha, int beta)
;-----------------------------------------------------------------------------
%if WIN64
cglobal deblock_%1_luma_intra_8, 4,6,16,0x10
@@ -699,7 +703,7 @@ cglobal deblock_%1_luma_intra_8, 4,6,16,ARCH_X86_64*0x50-0x50
INIT_MMX cpuname
%if ARCH_X86_64
;-----------------------------------------------------------------------------
-; void deblock_h_luma_intra( uint8_t *pix, int stride, int alpha, int beta )
+; void ff_deblock_h_luma_intra(uint8_t *pix, int stride, int alpha, int beta)
;-----------------------------------------------------------------------------
cglobal deblock_h_luma_intra_8, 4,9,0,0x80
movsxd r7, r1d
@@ -804,7 +808,8 @@ INIT_MMX mmxext
%define t6 r6
;-----------------------------------------------------------------------------
-; void ff_deblock_v_chroma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
+; void ff_deblock_v_chroma(uint8_t *pix, int stride, int alpha, int beta,
+; int8_t *tc0)
;-----------------------------------------------------------------------------
cglobal deblock_v_chroma_8, 5,6
CHROMA_V_START
@@ -818,7 +823,8 @@ cglobal deblock_v_chroma_8, 5,6
RET
;-----------------------------------------------------------------------------
-; void ff_deblock_h_chroma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
+; void ff_deblock_h_chroma(uint8_t *pix, int stride, int alpha, int beta,
+; int8_t *tc0)
;-----------------------------------------------------------------------------
cglobal deblock_h_chroma_8, 5,7
%if UNIX64
@@ -874,9 +880,9 @@ ff_chroma_inter_body_mmxext:
%define t5 r4
%define t6 r5
-;-----------------------------------------------------------------------------
-; void ff_deblock_v_chroma_intra( uint8_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
+;------------------------------------------------------------------------------
+; void ff_deblock_v_chroma_intra(uint8_t *pix, int stride, int alpha, int beta)
+;------------------------------------------------------------------------------
cglobal deblock_v_chroma_intra_8, 4,5
CHROMA_V_START
movq m0, [t5]
@@ -888,9 +894,9 @@ cglobal deblock_v_chroma_intra_8, 4,5
movq [r0], m2
RET
-;-----------------------------------------------------------------------------
-; void ff_deblock_h_chroma_intra( uint8_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
+;------------------------------------------------------------------------------
+; void ff_deblock_h_chroma_intra(uint8_t *pix, int stride, int alpha, int beta)
+;------------------------------------------------------------------------------
cglobal deblock_h_chroma_intra_8, 4,6
CHROMA_H_START
TRANSPOSE4x8_LOAD bw, wd, dq, PASS8ROWS(t5, r0, r1, t6)
@@ -914,10 +920,10 @@ ff_chroma_intra_body_mmxext:
ret
;-----------------------------------------------------------------------------
-; void h264_loop_filter_strength(int16_t bs[2][4][4], uint8_t nnz[40],
-; int8_t ref[2][40], int16_t mv[2][40][2],
-; int bidir, int edges, int step,
-; int mask_mv0, int mask_mv1, int field);
+; void ff_h264_loop_filter_strength(int16_t bs[2][4][4], uint8_t nnz[40],
+; int8_t ref[2][40], int16_t mv[2][40][2],
+; int bidir, int edges, int step,
+; int mask_mv0, int mask_mv1, int field);
;
; bidir is 0 or 1
; edges is 1 or 4
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock_10bit.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock_10bit.asm
index fdaf510bd62..fc4f4d7770e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock_10bit.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock_10bit.asm
@@ -152,7 +152,8 @@ cextern pw_4
%macro DEBLOCK_LUMA 0
;-----------------------------------------------------------------------------
-; void deblock_v_luma( uint16_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
+; void ff_deblock_v_luma_10(uint16_t *pix, int stride, int alpha, int beta,
+; int8_t *tc0)
;-----------------------------------------------------------------------------
cglobal deblock_v_luma_10, 5,5,8*(mmsize/16)
%assign pad 5*mmsize+12-(stack_offset&15)
@@ -600,7 +601,8 @@ DEBLOCK_LUMA_64
%if ARCH_X86_64
;-----------------------------------------------------------------------------
-; void deblock_v_luma_intra( uint16_t *pix, int stride, int alpha, int beta )
+; void ff_deblock_v_luma_intra_10(uint16_t *pix, int stride, int alpha,
+; int beta)
;-----------------------------------------------------------------------------
%macro DEBLOCK_LUMA_INTRA_64 0
cglobal deblock_v_luma_intra_10, 4,7,16
@@ -651,7 +653,8 @@ cglobal deblock_v_luma_intra_10, 4,7,16
REP_RET
;-----------------------------------------------------------------------------
-; void deblock_h_luma_intra( uint16_t *pix, int stride, int alpha, int beta )
+; void ff_deblock_h_luma_intra_10(uint16_t *pix, int stride, int alpha,
+; int beta)
;-----------------------------------------------------------------------------
cglobal deblock_h_luma_intra_10, 4,7,16
%define t0 m15
@@ -723,7 +726,8 @@ DEBLOCK_LUMA_INTRA_64
%macro DEBLOCK_LUMA_INTRA 0
;-----------------------------------------------------------------------------
-; void deblock_v_luma_intra( uint16_t *pix, int stride, int alpha, int beta )
+; void ff_deblock_v_luma_intra_10(uint16_t *pix, int stride, int alpha,
+; int beta)
;-----------------------------------------------------------------------------
cglobal deblock_v_luma_intra_10, 4,7,8*(mmsize/16)
LUMA_INTRA_INIT 3
@@ -751,7 +755,8 @@ cglobal deblock_v_luma_intra_10, 4,7,8*(mmsize/16)
RET
;-----------------------------------------------------------------------------
-; void deblock_h_luma_intra( uint16_t *pix, int stride, int alpha, int beta )
+; void ff_deblock_h_luma_intra_10(uint16_t *pix, int stride, int alpha,
+; int beta)
;-----------------------------------------------------------------------------
cglobal deblock_h_luma_intra_10, 4,7,8*(mmsize/16)
LUMA_INTRA_INIT 8
@@ -849,7 +854,8 @@ DEBLOCK_LUMA_INTRA
%macro DEBLOCK_CHROMA 0
;-----------------------------------------------------------------------------
-; void deblock_v_chroma( uint16_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
+; void ff_deblock_v_chroma_10(uint16_t *pix, int stride, int alpha, int beta,
+; int8_t *tc0)
;-----------------------------------------------------------------------------
cglobal deblock_v_chroma_10, 5,7-(mmsize/16),8*(mmsize/16)
mov r5, r0
@@ -883,7 +889,8 @@ cglobal deblock_v_chroma_10, 5,7-(mmsize/16),8*(mmsize/16)
%endif
;-----------------------------------------------------------------------------
-; void deblock_v_chroma_intra( uint16_t *pix, int stride, int alpha, int beta )
+; void ff_deblock_v_chroma_intra_10(uint16_t *pix, int stride, int alpha,
+; int beta)
;-----------------------------------------------------------------------------
cglobal deblock_v_chroma_intra_10, 4,6-(mmsize/16),8*(mmsize/16)
mov r4, r0
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_i386.h b/chromium/third_party/ffmpeg/libavcodec/x86/h264_i386.h
index 0dc0a7cb0f3..ef65cf86b78 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_i386.h
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_i386.h
@@ -38,7 +38,7 @@
//FIXME use some macros to avoid duplicating get_cabac (cannot be done yet
//as that would make optimization work hard)
-#if HAVE_7REGS
+#if HAVE_7REGS && !BROKEN_COMPILER
#define decode_significance decode_significance_x86
static int decode_significance_x86(CABACContext *c, int max_coeff,
uint8_t *significant_coeff_ctx_base,
@@ -55,6 +55,7 @@ static int decode_significance_x86(CABACContext *c, int max_coeff,
__asm__ volatile(
"lea "MANGLE(ff_h264_cabac_tables)", %0 \n\t"
: "=&r"(tables)
+ : NAMED_CONSTRAINTS_ARRAY(ff_h264_cabac_tables)
);
#endif
@@ -130,6 +131,7 @@ static int decode_significance_8x8_x86(CABACContext *c,
__asm__ volatile(
"lea "MANGLE(ff_h264_cabac_tables)", %0 \n\t"
: "=&r"(tables)
+ : NAMED_CONSTRAINTS_ARRAY(ff_h264_cabac_tables)
);
#endif
@@ -198,7 +200,7 @@ static int decode_significance_8x8_x86(CABACContext *c,
);
return coeff_count;
}
-#endif /* HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */
+#endif /* HAVE_7REGS && BROKEN_COMPILER */
#endif /* HAVE_INLINE_ASM */
#endif /* AVCODEC_X86_H264_I386_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_idct.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_idct.asm
index 9af98a9a0c1..7fafe195f15 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_idct.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_idct.asm
@@ -80,7 +80,7 @@ SECTION .text
%endmacro
INIT_MMX mmx
-; ff_h264_idct_add_8_mmx(uint8_t *dst, int16_t *block, int stride)
+; void ff_h264_idct_add_8_mmx(uint8_t *dst, int16_t *block, int stride)
cglobal h264_idct_add_8, 3, 3, 0
IDCT4_ADD r0, r1, r2
RET
@@ -202,7 +202,7 @@ cglobal h264_idct_add_8, 3, 3, 0
%endmacro
INIT_MMX mmx
-; ff_h264_idct8_add_8_mmx(uint8_t *dst, int16_t *block, int stride)
+; void ff_h264_idct8_add_8_mmx(uint8_t *dst, int16_t *block, int stride)
cglobal h264_idct8_add_8, 3, 4, 0
%assign pad 128+4-(stack_offset&7)
SUB rsp, pad
@@ -270,7 +270,7 @@ cglobal h264_idct8_add_8, 3, 4, 0
%endmacro
INIT_XMM sse2
-; ff_h264_idct8_add_8_sse2(uint8_t *dst, int16_t *block, int stride)
+; void ff_h264_idct8_add_8_sse2(uint8_t *dst, int16_t *block, int stride)
cglobal h264_idct8_add_8, 3, 4, 10
IDCT8_ADD_SSE r0, r1, r2, r3
RET
@@ -307,7 +307,7 @@ cglobal h264_idct8_add_8, 3, 4, 10
%endmacro
INIT_MMX mmxext
-; ff_h264_idct_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
+; void ff_h264_idct_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
%if ARCH_X86_64
cglobal h264_idct_dc_add_8, 3, 4, 0
movsx r3, word [r1]
@@ -316,7 +316,7 @@ cglobal h264_idct_dc_add_8, 3, 4, 0
DC_ADD_MMXEXT_OP movh, r0, r2, r3
RET
-; ff_h264_idct8_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
+; void ff_h264_idct8_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
cglobal h264_idct8_dc_add_8, 3, 4, 0
movsx r3, word [r1]
mov dword [r1], 0
@@ -326,7 +326,7 @@ cglobal h264_idct8_dc_add_8, 3, 4, 0
DC_ADD_MMXEXT_OP mova, r0, r2, r3
RET
%else
-; ff_h264_idct_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
+; void ff_h264_idct_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
cglobal h264_idct_dc_add_8, 2, 3, 0
movsx r2, word [r1]
mov dword [r1], 0
@@ -335,7 +335,7 @@ cglobal h264_idct_dc_add_8, 2, 3, 0
DC_ADD_MMXEXT_OP movh, r0, r1, r2
RET
-; ff_h264_idct8_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
+; void ff_h264_idct8_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
cglobal h264_idct8_dc_add_8, 2, 3, 0
movsx r2, word [r1]
mov dword [r1], 0
@@ -348,9 +348,9 @@ cglobal h264_idct8_dc_add_8, 2, 3, 0
%endif
INIT_MMX mmx
-; ff_h264_idct_add16_8_mmx(uint8_t *dst, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct_add16_8_mmx(uint8_t *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct_add16_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg
xor r5, r5
%ifdef PIC
@@ -371,9 +371,9 @@ cglobal h264_idct_add16_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride,
jl .nextblock
REP_RET
-; ff_h264_idct8_add4_8_mmx(uint8_t *dst, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct8_add4_8_mmx(uint8_t *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct8_add4_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg
%assign pad 128+4-(stack_offset&7)
SUB rsp, pad
@@ -405,9 +405,9 @@ cglobal h264_idct8_add4_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride,
RET
INIT_MMX mmxext
-; ff_h264_idct_add16_8_mmxext(uint8_t *dst, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct_add16_8_mmxext(uint8_t *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct_add16_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
xor r5, r5
%ifdef PIC
@@ -452,9 +452,9 @@ cglobal h264_idct_add16_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride
REP_RET
INIT_MMX mmx
-; ff_h264_idct_add16intra_8_mmx(uint8_t *dst, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct_add16intra_8_mmx(uint8_t *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct_add16intra_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg
xor r5, r5
%ifdef PIC
@@ -477,9 +477,9 @@ cglobal h264_idct_add16intra_8, 5, 7 + npicregs, 0, dst, block_offset, block, st
REP_RET
INIT_MMX mmxext
-; ff_h264_idct_add16intra_8_mmxext(uint8_t *dst, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct_add16intra_8_mmxext(uint8_t *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct_add16intra_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
xor r5, r5
%ifdef PIC
@@ -521,9 +521,9 @@ cglobal h264_idct_add16intra_8, 5, 8 + npicregs, 0, dst1, block_offset, block, s
jl .nextblock
REP_RET
-; ff_h264_idct8_add4_8_mmxext(uint8_t *dst, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct8_add4_8_mmxext(uint8_t *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct8_add4_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
%assign pad 128+4-(stack_offset&7)
SUB rsp, pad
@@ -583,9 +583,9 @@ cglobal h264_idct8_add4_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride
RET
INIT_XMM sse2
-; ff_h264_idct8_add4_8_sse2(uint8_t *dst, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct8_add4_8_sse2(uint8_t *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct8_add4_8, 5, 8 + npicregs, 10, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
xor r5, r5
%ifdef PIC
@@ -660,8 +660,9 @@ h264_idct_add8_mmx_plane:
jnz .nextblock
rep ret
-; ff_h264_idct_add8_8_mmx(uint8_t **dest, const int *block_offset,
-; int16_t *block, int stride, const uint8_t nnzc[6 * 8])
+; void ff_h264_idct_add8_8_mmx(uint8_t **dest, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
mov r5, 16
add r2, 512
@@ -725,9 +726,9 @@ h264_idct_add8_mmxext_plane:
rep ret
INIT_MMX mmxext
-; ff_h264_idct_add8_8_mmxext(uint8_t **dest, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct_add8_8_mmxext(uint8_t **dest, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
mov r5, 16
add r2, 512
@@ -809,9 +810,9 @@ h264_add8x4_idct_sse2:
%endif
%endmacro
-; ff_h264_idct_add16_8_sse2(uint8_t *dst, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct_add16_8_sse2(uint8_t *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8
%if ARCH_X86_64
mov r5, r0
@@ -857,9 +858,9 @@ cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8
%endif
%endmacro
-; ff_h264_idct_add16intra_8_sse2(uint8_t *dst, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct_add16intra_8_sse2(uint8_t *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8
%if ARCH_X86_64
mov r7, r0
@@ -909,9 +910,9 @@ cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8
%endif
%endmacro
-; ff_h264_idct_add8_8_sse2(uint8_t **dest, const int *block_offset,
-; int16_t *block, int stride,
-; const uint8_t nnzc[6 * 8])
+; void ff_h264_idct_add8_8_sse2(uint8_t **dest, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6 * 8])
cglobal h264_idct_add8_8, 5, 7 + ARCH_X86_64, 8
add r2, 512
%if ARCH_X86_64
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_idct_10bit.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_idct_10bit.asm
index df212888dc8..5c3acb1d380 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_idct_10bit.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_idct_10bit.asm
@@ -32,7 +32,7 @@ pd_32: times 4 dd 32
SECTION .text
;-----------------------------------------------------------------------------
-; void h264_idct_add(pixel *dst, dctcoef *block, int stride)
+; void ff_h264_idct_add_10(pixel *dst, int16_t *block, int stride)
;-----------------------------------------------------------------------------
%macro STORE_DIFFx2 6
psrad %1, 6
@@ -89,7 +89,9 @@ IDCT_ADD_10
%endif
;-----------------------------------------------------------------------------
-; h264_idct_add16(pixel *dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
+; void ff_h264_idct_add16_10(pixel *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6*8])
;-----------------------------------------------------------------------------
;;;;;;; NO FATE SAMPLES TRIGGER THIS
%macro ADD4x4IDCT 0
@@ -163,7 +165,7 @@ IDCT_ADD16_10
%endif
;-----------------------------------------------------------------------------
-; void h264_idct_dc_add(pixel *dst, dctcoef *block, int stride)
+; void ff_h264_idct_dc_add_10(pixel *dst, int16_t *block, int stride)
;-----------------------------------------------------------------------------
%macro IDCT_DC_ADD_OP_10 3
pxor m5, m5
@@ -205,7 +207,7 @@ cglobal h264_idct_dc_add_10,3,3
RET
;-----------------------------------------------------------------------------
-; void h264_idct8_dc_add(pixel *dst, dctcoef *block, int stride)
+; void ff_h264_idct8_dc_add_10(pixel *dst, int16_t *block, int stride)
;-----------------------------------------------------------------------------
%macro IDCT8_DC_ADD 0
cglobal h264_idct8_dc_add_10,3,4,7
@@ -230,7 +232,9 @@ IDCT8_DC_ADD
%endif
;-----------------------------------------------------------------------------
-; h264_idct_add16intra(pixel *dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
+; void ff_h264_idct_add16intra_10(pixel *dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6*8])
;-----------------------------------------------------------------------------
%macro AC 1
.ac%1:
@@ -304,7 +308,9 @@ IDCT_ADD16INTRA_10
%assign last_block 36
;-----------------------------------------------------------------------------
-; h264_idct_add8(pixel **dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
+; void ff_h264_idct_add8_10(pixel **dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6*8])
;-----------------------------------------------------------------------------
%macro IDCT_ADD8 0
cglobal h264_idct_add8_10,5,8,7
@@ -340,7 +346,7 @@ IDCT_ADD8
%endif
;-----------------------------------------------------------------------------
-; void h264_idct8_add(pixel *dst, dctcoef *block, int stride)
+; void ff_h264_idct8_add_10(pixel *dst, int16_t *block, int stride)
;-----------------------------------------------------------------------------
%macro IDCT8_1D 2
SWAP 0, 1
@@ -549,7 +555,9 @@ IDCT8_ADD
%endif
;-----------------------------------------------------------------------------
-; h264_idct8_add4(pixel **dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
+; void ff_h264_idct8_add4_10(pixel **dst, const int *block_offset,
+; int16_t *block, int stride,
+; const uint8_t nnzc[6*8])
;-----------------------------------------------------------------------------
;;;;;;; NO FATE SAMPLES TRIGGER THIS
%macro IDCT8_ADD4_OP 2
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred.asm
index 3064ec5201c..3e13ccb05d2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred.asm
@@ -49,7 +49,7 @@ cextern pw_17
cextern pw_32
;-----------------------------------------------------------------------------
-; void pred16x16_vertical_8(uint8_t *src, int stride)
+; void ff_pred16x16_vertical_8(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmx
@@ -85,7 +85,7 @@ cglobal pred16x16_vertical_8, 2,3
REP_RET
;-----------------------------------------------------------------------------
-; void pred16x16_horizontal_8(uint8_t *src, int stride)
+; void ff_pred16x16_horizontal_8(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_H 0
@@ -126,7 +126,7 @@ INIT_XMM ssse3
PRED16x16_H
;-----------------------------------------------------------------------------
-; void pred16x16_dc_8(uint8_t *src, int stride)
+; void ff_pred16x16_dc_8(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_DC 0
@@ -188,7 +188,7 @@ INIT_XMM ssse3
PRED16x16_DC
;-----------------------------------------------------------------------------
-; void pred16x16_tm_vp8_8(uint8_t *src, int stride)
+; void ff_pred16x16_tm_vp8_8(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_TM 0
@@ -269,7 +269,7 @@ cglobal pred16x16_tm_vp8_8, 2,6,6
REP_RET
;-----------------------------------------------------------------------------
-; void pred16x16_plane_*_8(uint8_t *src, int stride)
+; void ff_pred16x16_plane_*_8(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro H264_PRED16x16_PLANE 1
@@ -550,7 +550,7 @@ H264_PRED16x16_PLANE rv40
H264_PRED16x16_PLANE svq3
;-----------------------------------------------------------------------------
-; void pred8x8_plane_8(uint8_t *src, int stride)
+; void ff_pred8x8_plane_8(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro H264_PRED8x8_PLANE 0
@@ -724,7 +724,7 @@ INIT_XMM ssse3
H264_PRED8x8_PLANE
;-----------------------------------------------------------------------------
-; void pred8x8_vertical_8(uint8_t *src, int stride)
+; void ff_pred8x8_vertical_8(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmx
@@ -741,7 +741,7 @@ cglobal pred8x8_vertical_8, 2,2
RET
;-----------------------------------------------------------------------------
-; void pred8x8_horizontal_8(uint8_t *src, int stride)
+; void ff_pred8x8_horizontal_8(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8_H 0
@@ -769,7 +769,7 @@ INIT_MMX ssse3
PRED8x8_H
;-----------------------------------------------------------------------------
-; void pred8x8_top_dc_8_mmxext(uint8_t *src, int stride)
+; void ff_pred8x8_top_dc_8_mmxext(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
cglobal pred8x8_top_dc_8, 2,5
@@ -803,7 +803,7 @@ cglobal pred8x8_top_dc_8, 2,5
RET
;-----------------------------------------------------------------------------
-; void pred8x8_dc_8_mmxext(uint8_t *src, int stride)
+; void ff_pred8x8_dc_8_mmxext(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
@@ -864,7 +864,7 @@ cglobal pred8x8_dc_8, 2,5
RET
;-----------------------------------------------------------------------------
-; void pred8x8_dc_rv40_8(uint8_t *src, int stride)
+; void ff_pred8x8_dc_rv40_8(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
@@ -901,7 +901,7 @@ cglobal pred8x8_dc_rv40_8, 2,7
REP_RET
;-----------------------------------------------------------------------------
-; void pred8x8_tm_vp8_8(uint8_t *src, int stride)
+; void ff_pred8x8_tm_vp8_8(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8_TM 0
@@ -1013,7 +1013,8 @@ cglobal pred8x8_tm_vp8_8, 2,3,6
%endmacro
;-----------------------------------------------------------------------------
-; void pred8x8l_top_dc_8(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_top_dc_8(uint8_t *src, int has_topleft, int has_topright,
+; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_TOP_DC 0
cglobal pred8x8l_top_dc_8, 4,4
@@ -1068,7 +1069,8 @@ INIT_MMX ssse3
PRED8x8L_TOP_DC
;-----------------------------------------------------------------------------
-;void pred8x8l_dc_8(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_dc_8(uint8_t *src, int has_topleft, int has_topright,
+; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_DC 0
@@ -1171,7 +1173,8 @@ INIT_MMX ssse3
PRED8x8L_DC
;-----------------------------------------------------------------------------
-; void pred8x8l_horizontal_8(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_horizontal_8(uint8_t *src, int has_topleft,
+; int has_topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_HORIZONTAL 0
@@ -1242,7 +1245,8 @@ INIT_MMX ssse3
PRED8x8L_HORIZONTAL
;-----------------------------------------------------------------------------
-; void pred8x8l_vertical_8(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_vertical_8(uint8_t *src, int has_topleft, int has_topright,
+; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_VERTICAL 0
@@ -1292,7 +1296,8 @@ INIT_MMX ssse3
PRED8x8L_VERTICAL
;-----------------------------------------------------------------------------
-;void pred8x8l_down_left_8(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_down_left_8(uint8_t *src, int has_topleft,
+; int has_topright, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
@@ -1492,7 +1497,8 @@ INIT_MMX ssse3
PRED8x8L_DOWN_LEFT
;-----------------------------------------------------------------------------
-;void pred8x8l_down_right_8_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_down_right_8_mmxext(uint8_t *src, int has_topleft,
+; int has_topright, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
@@ -1743,7 +1749,8 @@ INIT_MMX ssse3
PRED8x8L_DOWN_RIGHT
;-----------------------------------------------------------------------------
-; void pred8x8l_vertical_right_8(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_vertical_right_8(uint8_t *src, int has_topleft,
+; int has_topright, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
@@ -1970,7 +1977,8 @@ INIT_MMX ssse3
PRED8x8L_VERTICAL_RIGHT
;-----------------------------------------------------------------------------
-;void pred8x8l_vertical_left_8(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_vertical_left_8(uint8_t *src, int has_topleft,
+; int has_topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_VERTICAL_LEFT 0
@@ -2059,7 +2067,8 @@ INIT_MMX ssse3
PRED8x8L_VERTICAL_LEFT
;-----------------------------------------------------------------------------
-; void pred8x8l_horizontal_up_8(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_horizontal_up_8(uint8_t *src, int has_topleft,
+; int has_topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_HORIZONTAL_UP 0
@@ -2146,7 +2155,8 @@ INIT_MMX ssse3
PRED8x8L_HORIZONTAL_UP
;-----------------------------------------------------------------------------
-;void pred8x8l_horizontal_down_8(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_horizontal_down_8(uint8_t *src, int has_topleft,
+; int has_topright, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
@@ -2393,9 +2403,9 @@ PRED8x8L_HORIZONTAL_DOWN
INIT_MMX ssse3
PRED8x8L_HORIZONTAL_DOWN
-;-----------------------------------------------------------------------------
-; void pred4x4_dc_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
+;-------------------------------------------------------------------------------
+; void ff_pred4x4_dc_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+;-------------------------------------------------------------------------------
INIT_MMX mmxext
cglobal pred4x4_dc_8, 3,5
@@ -2424,7 +2434,8 @@ cglobal pred4x4_dc_8, 3,5
RET
;-----------------------------------------------------------------------------
-; void pred4x4_tm_vp8_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+; void ff_pred4x4_tm_vp8_8_mmxext(uint8_t *src, const uint8_t *topright,
+; int stride)
;-----------------------------------------------------------------------------
%macro PRED4x4_TM 0
@@ -2502,7 +2513,8 @@ cglobal pred4x4_tm_vp8_8, 3,3
RET
;-----------------------------------------------------------------------------
-; void pred4x4_vertical_vp8_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+; void ff_pred4x4_vertical_vp8_8_mmxext(uint8_t *src, const uint8_t *topright,
+; int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
@@ -2522,7 +2534,8 @@ cglobal pred4x4_vertical_vp8_8, 3,3
RET
;-----------------------------------------------------------------------------
-; void pred4x4_down_left_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+; void ff_pred4x4_down_left_8_mmxext(uint8_t *src, const uint8_t *topright,
+; int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
cglobal pred4x4_down_left_8, 3,3
@@ -2547,9 +2560,10 @@ cglobal pred4x4_down_left_8, 3,3
movd [r1+r2*2], m0
RET
-;-----------------------------------------------------------------------------
-; void pred4x4_vertical_left_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
+;------------------------------------------------------------------------------
+; void ff_pred4x4_vertical_left_8_mmxext(uint8_t *src, const uint8_t *topright,
+; int stride)
+;------------------------------------------------------------------------------
INIT_MMX mmxext
cglobal pred4x4_vertical_left_8, 3,3
@@ -2572,9 +2586,10 @@ cglobal pred4x4_vertical_left_8, 3,3
movh [r1+r2*2], m0
RET
-;-----------------------------------------------------------------------------
-; void pred4x4_horizontal_up_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
+;------------------------------------------------------------------------------
+; void ff_pred4x4_horizontal_up_8_mmxext(uint8_t *src, const uint8_t *topright,
+; int stride)
+;------------------------------------------------------------------------------
INIT_MMX mmxext
cglobal pred4x4_horizontal_up_8, 3,3
@@ -2605,9 +2620,10 @@ cglobal pred4x4_horizontal_up_8, 3,3
movd [r1+r2*2], m1
RET
-;-----------------------------------------------------------------------------
-; void pred4x4_horizontal_down_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
+;------------------------------------------------------------------------------
+; void ff_pred4x4_horizontal_down_8_mmxext(uint8_t *src,
+; const uint8_t *topright, int stride)
+;------------------------------------------------------------------------------
INIT_MMX mmxext
cglobal pred4x4_horizontal_down_8, 3,3
@@ -2641,7 +2657,8 @@ cglobal pred4x4_horizontal_down_8, 3,3
RET
;-----------------------------------------------------------------------------
-; void pred4x4_vertical_right_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+; void ff_pred4x4_vertical_right_8_mmxext(uint8_t *src,
+; const uint8_t *topright, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
@@ -2671,7 +2688,8 @@ cglobal pred4x4_vertical_right_8, 3,3
RET
;-----------------------------------------------------------------------------
-; void pred4x4_down_right_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+; void ff_pred4x4_down_right_8_mmxext(uint8_t *src, const uint8_t *topright,
+; int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred_10bit.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred_10bit.asm
index 54eaee53c5c..9dee577e1db 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred_10bit.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred_10bit.asm
@@ -50,7 +50,7 @@ SECTION .text
%endmacro
;-----------------------------------------------------------------------------
-; void pred4x4_down_right(pixel *src, const pixel *topright, int stride)
+; void ff_pred4x4_down_right(pixel *src, const pixel *topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED4x4_DR 0
cglobal pred4x4_down_right_10, 3, 3
@@ -87,9 +87,9 @@ INIT_XMM avx
PRED4x4_DR
%endif
-;-----------------------------------------------------------------------------
-; void pred4x4_vertical_right(pixel *src, const pixel *topright, int stride)
-;-----------------------------------------------------------------------------
+;------------------------------------------------------------------------------
+; void ff_pred4x4_vertical_right(pixel *src, const pixel *topright, int stride)
+;------------------------------------------------------------------------------
%macro PRED4x4_VR 0
cglobal pred4x4_vertical_right_10, 3, 3, 6
sub r0, r2
@@ -126,9 +126,9 @@ INIT_XMM avx
PRED4x4_VR
%endif
-;-----------------------------------------------------------------------------
-; void pred4x4_horizontal_down(pixel *src, const pixel *topright, int stride)
-;-----------------------------------------------------------------------------
+;-------------------------------------------------------------------------------
+; void ff_pred4x4_horizontal_down(pixel *src, const pixel *topright, int stride)
+;-------------------------------------------------------------------------------
%macro PRED4x4_HD 0
cglobal pred4x4_horizontal_down_10, 3, 3
sub r0, r2
@@ -169,24 +169,8 @@ PRED4x4_HD
%endif
;-----------------------------------------------------------------------------
-; void pred4x4_dc(pixel *src, const pixel *topright, int stride)
+; void ff_pred4x4_dc(pixel *src, const pixel *topright, int stride)
;-----------------------------------------------------------------------------
-%macro HADDD 2 ; sum junk
-%if mmsize == 16
- movhlps %2, %1
- paddd %1, %2
- pshuflw %2, %1, 0xE
- paddd %1, %2
-%else
- pshufw %2, %1, 0xE
- paddd %1, %2
-%endif
-%endmacro
-
-%macro HADDW 2
- pmaddwd %1, [pw_1]
- HADDD %1, %2
-%endmacro
INIT_MMX mmxext
cglobal pred4x4_dc_10, 3, 3
@@ -210,7 +194,7 @@ cglobal pred4x4_dc_10, 3, 3
RET
;-----------------------------------------------------------------------------
-; void pred4x4_down_left(pixel *src, const pixel *topright, int stride)
+; void ff_pred4x4_down_left(pixel *src, const pixel *topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED4x4_DL 0
cglobal pred4x4_down_left_10, 3, 3
@@ -240,7 +224,7 @@ PRED4x4_DL
%endif
;-----------------------------------------------------------------------------
-; void pred4x4_vertical_left(pixel *src, const pixel *topright, int stride)
+; void ff_pred4x4_vertical_left(pixel *src, const pixel *topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED4x4_VL 0
cglobal pred4x4_vertical_left_10, 3, 3
@@ -269,7 +253,7 @@ PRED4x4_VL
%endif
;-----------------------------------------------------------------------------
-; void pred4x4_horizontal_up(pixel *src, const pixel *topright, int stride)
+; void ff_pred4x4_horizontal_up(pixel *src, const pixel *topright, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
cglobal pred4x4_horizontal_up_10, 3, 3
@@ -303,7 +287,7 @@ cglobal pred4x4_horizontal_up_10, 3, 3
;-----------------------------------------------------------------------------
-; void pred8x8_vertical(pixel *src, int stride)
+; void ff_pred8x8_vertical(pixel *src, int stride)
;-----------------------------------------------------------------------------
INIT_XMM sse2
cglobal pred8x8_vertical_10, 2, 2
@@ -319,7 +303,7 @@ cglobal pred8x8_vertical_10, 2, 2
RET
;-----------------------------------------------------------------------------
-; void pred8x8_horizontal(pixel *src, int stride)
+; void ff_pred8x8_horizontal(pixel *src, int stride)
;-----------------------------------------------------------------------------
INIT_XMM sse2
cglobal pred8x8_horizontal_10, 2, 3
@@ -339,7 +323,7 @@ cglobal pred8x8_horizontal_10, 2, 3
REP_RET
;-----------------------------------------------------------------------------
-; void predict_8x8_dc(pixel *src, int stride)
+; void ff_predict_8x8_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro MOV8 2-3
; sort of a hack, but it works
@@ -426,7 +410,7 @@ INIT_XMM sse2
PRED8x8_DC pshuflw
;-----------------------------------------------------------------------------
-; void pred8x8_top_dc(pixel *src, int stride)
+; void ff_pred8x8_top_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
INIT_XMM sse2
cglobal pred8x8_top_dc_10, 2, 4
@@ -453,7 +437,7 @@ cglobal pred8x8_top_dc_10, 2, 4
RET
;-----------------------------------------------------------------------------
-; void pred8x8_plane(pixel *src, int stride)
+; void ff_pred8x8_plane(pixel *src, int stride)
;-----------------------------------------------------------------------------
INIT_XMM sse2
cglobal pred8x8_plane_10, 2, 7, 7
@@ -516,7 +500,8 @@ cglobal pred8x8_plane_10, 2, 7, 7
;-----------------------------------------------------------------------------
-; void pred8x8l_128_dc(pixel *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_128_dc(pixel *src, int has_topleft, int has_topright,
+; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_128_DC 0
cglobal pred8x8l_128_dc_10, 4, 4
@@ -540,7 +525,8 @@ INIT_XMM sse2
PRED8x8L_128_DC
;-----------------------------------------------------------------------------
-; void pred8x8l_top_dc(pixel *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_top_dc(pixel *src, int has_topleft, int has_topright,
+; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_TOP_DC 0
cglobal pred8x8l_top_dc_10, 4, 4, 6
@@ -578,9 +564,9 @@ INIT_XMM avx
PRED8x8L_TOP_DC
%endif
-;-----------------------------------------------------------------------------
-;void pred8x8l_dc(pixel *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
+;-------------------------------------------------------------------------------
+; void ff_pred8x8l_dc(pixel *src, int has_topleft, int has_topright, int stride)
+;-------------------------------------------------------------------------------
;TODO: see if scalar is faster
%macro PRED8x8L_DC 0
cglobal pred8x8l_dc_10, 4, 6, 6
@@ -638,7 +624,8 @@ PRED8x8L_DC
%endif
;-----------------------------------------------------------------------------
-; void pred8x8l_vertical(pixel *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_vertical(pixel *src, int has_topleft, int has_topright,
+; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_VERTICAL 0
cglobal pred8x8l_vertical_10, 4, 4, 6
@@ -673,7 +660,8 @@ PRED8x8L_VERTICAL
%endif
;-----------------------------------------------------------------------------
-; void pred8x8l_horizontal(uint8_t *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_horizontal(uint8_t *src, int has_topleft, int has_topright,
+; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_HORIZONTAL 0
cglobal pred8x8l_horizontal_10, 4, 4, 5
@@ -729,7 +717,8 @@ PRED8x8L_HORIZONTAL
%endif
;-----------------------------------------------------------------------------
-;void pred8x8l_down_left(pixel *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_down_left(pixel *src, int has_topleft, int has_topright,
+; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_DOWN_LEFT 0
cglobal pred8x8l_down_left_10, 4, 4, 7
@@ -797,7 +786,8 @@ PRED8x8L_DOWN_LEFT
%endif
;-----------------------------------------------------------------------------
-;void pred8x8l_down_right(pixel *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_down_right(pixel *src, int has_topleft, int has_topright,
+; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_DOWN_RIGHT 0
; standard forbids this when has_topleft is false
@@ -871,7 +861,8 @@ PRED8x8L_DOWN_RIGHT
%endif
;-----------------------------------------------------------------------------
-; void pred8x8l_vertical_right(pixel *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_vertical_right(pixel *src, int has_topleft,
+; int has_topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_VERTICAL_RIGHT 0
; likewise with 8x8l_down_right
@@ -941,7 +932,8 @@ PRED8x8L_VERTICAL_RIGHT
%endif
;-----------------------------------------------------------------------------
-; void pred8x8l_horizontal_up(pixel *src, int has_topleft, int has_topright, int stride)
+; void ff_pred8x8l_horizontal_up(pixel *src, int has_topleft,
+; int has_topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_HORIZONTAL_UP 0
cglobal pred8x8l_horizontal_up_10, 4, 4, 6
@@ -1003,7 +995,7 @@ PRED8x8L_HORIZONTAL_UP
;-----------------------------------------------------------------------------
-; void pred16x16_vertical(pixel *src, int stride)
+; void ff_pred16x16_vertical(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro MOV16 3-5
mova [%1+ 0], %2
@@ -1039,7 +1031,7 @@ INIT_XMM sse2
PRED16x16_VERTICAL
;-----------------------------------------------------------------------------
-; void pred16x16_horizontal(pixel *src, int stride)
+; void ff_pred16x16_horizontal(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_HORIZONTAL 0
cglobal pred16x16_horizontal_10, 2, 3
@@ -1063,7 +1055,7 @@ INIT_XMM sse2
PRED16x16_HORIZONTAL
;-----------------------------------------------------------------------------
-; void pred16x16_dc(pixel *src, int stride)
+; void ff_pred16x16_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_DC 0
cglobal pred16x16_dc_10, 2, 6
@@ -1109,7 +1101,7 @@ INIT_XMM sse2
PRED16x16_DC
;-----------------------------------------------------------------------------
-; void pred16x16_top_dc(pixel *src, int stride)
+; void ff_pred16x16_top_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_TOP_DC 0
cglobal pred16x16_top_dc_10, 2, 3
@@ -1141,7 +1133,7 @@ INIT_XMM sse2
PRED16x16_TOP_DC
;-----------------------------------------------------------------------------
-; void pred16x16_left_dc(pixel *src, int stride)
+; void ff_pred16x16_left_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_LEFT_DC 0
cglobal pred16x16_left_dc_10, 2, 6
@@ -1178,7 +1170,7 @@ INIT_XMM sse2
PRED16x16_LEFT_DC
;-----------------------------------------------------------------------------
-; void pred16x16_128_dc(pixel *src, int stride)
+; void ff_pred16x16_128_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_128_DC 0
cglobal pred16x16_128_dc_10, 2,3
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred_init.c
index ad2984bc043..24110eb2e08 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_intrapred_init.c
@@ -191,16 +191,16 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
if (EXTERNAL_MMX(cpu_flags)) {
h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_8_mmx;
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_8_mmx;
- if (chroma_format_idc == 1) {
+ if (chroma_format_idc <= 1) {
h->pred8x8 [VERT_PRED8x8 ] = ff_pred8x8_vertical_8_mmx;
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_8_mmx;
}
- if (codec_id == AV_CODEC_ID_VP8) {
+ if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_8_mmx;
h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_8_mmx;
h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_8_mmx;
} else {
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_8_mmx;
if (codec_id == AV_CODEC_ID_SVQ3) {
if (cpu_flags & AV_CPU_FLAG_CMOV)
@@ -216,7 +216,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
if (EXTERNAL_MMXEXT(cpu_flags)) {
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_8_mmxext;
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_8_mmxext;
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_horizontal_8_mmxext;
h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_8_mmxext;
h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_8_mmxext;
@@ -231,7 +231,8 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
h->pred4x4 [VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_8_mmxext;
h->pred4x4 [HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_8_mmxext;
h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_8_mmxext;
- if (codec_id == AV_CODEC_ID_VP8 || codec_id == AV_CODEC_ID_H264) {
+ if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8 ||
+ codec_id == AV_CODEC_ID_H264) {
h->pred4x4 [DIAG_DOWN_LEFT_PRED] = ff_pred4x4_down_left_8_mmxext;
}
if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
@@ -241,19 +242,19 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
h->pred4x4 [HOR_UP_PRED ] = ff_pred4x4_horizontal_up_8_mmxext;
}
if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
- if (chroma_format_idc == 1) {
+ if (chroma_format_idc <= 1) {
h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_8_mmxext;
h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_8_mmxext;
}
}
- if (codec_id == AV_CODEC_ID_VP8) {
+ if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_8_mmxext;
h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_8_mmxext;
h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_8_mmxext;
h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_8_mmxext;
h->pred4x4 [VERT_PRED ] = ff_pred4x4_vertical_vp8_8_mmxext;
} else {
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_8_mmxext;
if (codec_id == AV_CODEC_ID_SVQ3) {
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_svq3_8_mmxext;
@@ -276,11 +277,11 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_8_sse2;
h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_8_sse2;
h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_8_sse2;
- if (codec_id == AV_CODEC_ID_VP8) {
+ if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_8_sse2;
h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_8_sse2;
} else {
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_8_sse2;
if (codec_id == AV_CODEC_ID_SVQ3) {
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_8_sse2;
@@ -295,7 +296,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
if (EXTERNAL_SSSE3(cpu_flags)) {
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_8_ssse3;
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_8_ssse3;
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_8_ssse3;
h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_8_ssse3;
h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_8_ssse3;
@@ -307,11 +308,11 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_8_ssse3;
h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_8_ssse3;
h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_8_ssse3;
- if (codec_id == AV_CODEC_ID_VP8) {
+ if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {
h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_8_ssse3;
h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_8_ssse3;
} else {
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_8_ssse3;
if (codec_id == AV_CODEC_ID_SVQ3) {
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_8_ssse3;
@@ -327,7 +328,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
h->pred4x4[DC_PRED ] = ff_pred4x4_dc_10_mmxext;
h->pred4x4[HOR_UP_PRED ] = ff_pred4x4_horizontal_up_10_mmxext;
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_10_mmxext;
h->pred8x8l[DC_128_PRED ] = ff_pred8x8l_128_dc_10_mmxext;
@@ -346,7 +347,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
h->pred4x4[VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_10_sse2;
h->pred4x4[HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_10_sse2;
- if (chroma_format_idc == 1) {
+ if (chroma_format_idc <= 1) {
h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_10_sse2;
h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_10_sse2;
h->pred8x8[PLANE_PRED8x8 ] = ff_pred8x8_plane_10_sse2;
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel.c b/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel.c
index fd6068ffb12..8edaeacde62 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel.c
@@ -25,7 +25,8 @@
#include "libavutil/x86/cpu.h"
#include "libavcodec/h264qpel.h"
#include "libavcodec/mpegvideo.h"
-#include "dsputil_x86.h"
+#include "libavcodec/pixels.h"
+#include "fpel.h"
#if HAVE_YASM
void ff_put_pixels4_mmxext(uint8_t *block, const uint8_t *pixels,
@@ -49,8 +50,8 @@ void ff_avg_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
#define ff_put_pixels16_l2_sse2 ff_put_pixels16_l2_mmxext
#define ff_avg_pixels16_l2_sse2 ff_avg_pixels16_l2_mmxext
-PIXELS16(static, ff_avg, , , _mmxext)
-PIXELS16(static, ff_put, , , _mmxext)
+CALL_2X_PIXELS(ff_avg_pixels16_mmxext, ff_avg_pixels8_mmxext, 8)
+CALL_2X_PIXELS(ff_put_pixels16_mmxext, ff_put_pixels8_mmxext, 8)
#define DEF_QPEL(OPNAME)\
void ff_ ## OPNAME ## _h264_qpel4_h_lowpass_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
@@ -496,7 +497,7 @@ QPEL16_OP(mc31, MMX)\
QPEL16_OP(mc32, MMX)\
QPEL16_OP(mc33, MMX)
-#if ARCH_X86_32 && HAVE_YASM && CONFIG_H264QPEL // ARCH_X86_64 implies SSE2+
+#if ARCH_X86_32 // ARCH_X86_64 implies SSE2+
QPEL16(mmxext)
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm
index 456187140c1..e7ce1b8b44e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm
@@ -167,7 +167,7 @@ stub_%1_h264_qpel%3_%2_10 %+ SUFFIX:
%endmacro
;-----------------------------------------------------------------------------
-; void h264_qpel_mc00(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc00(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro COPY4 0
movu m0, [r1 ]
@@ -221,7 +221,7 @@ MC00 put
MC00 avg
;-----------------------------------------------------------------------------
-; void h264_qpel_mc20(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc20(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC_CACHE 1
%define OP_MOV mova
@@ -305,7 +305,7 @@ cglobal_mc %1, mc20, %2, 3,4,9
MC_CACHE MC20
;-----------------------------------------------------------------------------
-; void h264_qpel_mc30(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc30(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC30 2
cglobal_mc %1, mc30, %2, 3,5,9
@@ -316,7 +316,7 @@ cglobal_mc %1, mc30, %2, 3,5,9
MC_CACHE MC30
;-----------------------------------------------------------------------------
-; void h264_qpel_mc10(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc10(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC10 2
cglobal_mc %1, mc10, %2, 3,5,9
@@ -383,7 +383,7 @@ cglobal_mc %1, mc10, %2, 3,5,9
MC_CACHE MC10
;-----------------------------------------------------------------------------
-; void h264_qpel_mc02(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc02(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro V_FILT 10
v_filt%9_%10_10
@@ -432,7 +432,7 @@ cglobal_mc %1, mc02, %2, 3,4,8
MC MC02
;-----------------------------------------------------------------------------
-; void h264_qpel_mc01(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc01(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC01 2
cglobal_mc %1, mc01, %2, 3,5,8
@@ -458,7 +458,7 @@ cglobal_mc %1, mc01, %2, 3,5,8
MC MC01
;-----------------------------------------------------------------------------
-; void h264_qpel_mc03(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc03(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC03 2
cglobal_mc %1, mc03, %2, 3,5,8
@@ -469,7 +469,7 @@ cglobal_mc %1, mc03, %2, 3,5,8
MC MC03
;-----------------------------------------------------------------------------
-; void h264_qpel_mc11(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc11(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro H_FILT_AVG 2-3
h_filt%1_%2_10:
@@ -551,7 +551,7 @@ cglobal_mc %1, mc11, %2, 3,6,8
MC MC11
;-----------------------------------------------------------------------------
-; void h264_qpel_mc31(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc31(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC31 2
cglobal_mc %1, mc31, %2, 3,6,8
@@ -563,7 +563,7 @@ cglobal_mc %1, mc31, %2, 3,6,8
MC MC31
;-----------------------------------------------------------------------------
-; void h264_qpel_mc13(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc13(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC13 2
cglobal_mc %1, mc13, %2, 3,7,12
@@ -574,7 +574,7 @@ cglobal_mc %1, mc13, %2, 3,7,12
MC MC13
;-----------------------------------------------------------------------------
-; void h264_qpel_mc33(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc33(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC33 2
cglobal_mc %1, mc33, %2, 3,6,8
@@ -586,7 +586,7 @@ cglobal_mc %1, mc33, %2, 3,6,8
MC MC33
;-----------------------------------------------------------------------------
-; void h264_qpel_mc22(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc22(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro FILT_H2 3
psubw %1, %2 ; a-b
@@ -757,7 +757,7 @@ cglobal_mc %1, mc22, %2, 3,7,12
MC MC22
;-----------------------------------------------------------------------------
-; void h264_qpel_mc12(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc12(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC12 2
cglobal_mc %1, mc12, %2, 3,7,12
@@ -802,7 +802,7 @@ cglobal_mc %1, mc12, %2, 3,7,12
MC MC12
;-----------------------------------------------------------------------------
-; void h264_qpel_mc32(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc32(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC32 2
cglobal_mc %1, mc32, %2, 3,7,12
@@ -820,7 +820,7 @@ cglobal_mc %1, mc32, %2, 3,7,12
MC MC32
;-----------------------------------------------------------------------------
-; void h264_qpel_mc21(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc21(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro H_NRD 1
put_h%1_10:
@@ -873,7 +873,7 @@ cglobal_mc %1, mc21, %2, 3,7,12
MC MC21
;-----------------------------------------------------------------------------
-; void h264_qpel_mc23(uint8_t *dst, uint8_t *src, int stride)
+; void ff_h264_qpel_mc23(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro MC23 2
cglobal_mc %1, mc23, %2, 3,7,12
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight.asm
index 4759a063a61..b4fb9db3098 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight.asm
@@ -28,12 +28,12 @@ SECTION .text
;-----------------------------------------------------------------------------
; biweight pred:
;
-; void h264_biweight_16_sse2(uint8_t *dst, uint8_t *src, int stride,
-; int height, int log2_denom, int weightd,
-; int weights, int offset);
+; void ff_h264_biweight_16_sse2(uint8_t *dst, uint8_t *src, int stride,
+; int height, int log2_denom, int weightd,
+; int weights, int offset);
; and
-; void h264_weight_16_sse2(uint8_t *dst, int stride, int height,
-; int log2_denom, int weight, int offset);
+; void ff_h264_weight_16_sse2(uint8_t *dst, int stride, int height,
+; int log2_denom, int weight, int offset);
;-----------------------------------------------------------------------------
%macro WEIGHT_SETUP 0
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight_10bit.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight_10bit.asm
index b7845fd74a4..5d9496224ac 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight_10bit.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight_10bit.asm
@@ -35,8 +35,8 @@ cextern pw_1
SECTION .text
;-----------------------------------------------------------------------------
-; void h264_weight(uint8_t *dst, int stride, int height, int log2_denom,
-; int weight, int offset);
+; void ff_h264_weight_16_10(uint8_t *dst, int stride, int height,
+; int log2_denom, int weight, int offset);
;-----------------------------------------------------------------------------
%macro WEIGHT_PROLOGUE 0
.prologue:
@@ -151,8 +151,9 @@ WEIGHT_FUNC_HALF_MM
;-----------------------------------------------------------------------------
-; void h264_biweight(uint8_t *dst, uint8_t *src, int stride, int height,
-; int log2_denom, int weightd, int weights, int offset);
+; void ff_h264_biweight_16_10(uint8_t *dst, uint8_t *src, int stride,
+; int height, int log2_denom, int weightd,
+; int weights, int offset);
;-----------------------------------------------------------------------------
%if ARCH_X86_32
DECLARE_REG_TMP 3
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264chroma_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/h264chroma_init.c
index 3d8d5b0fe1a..e08af2759e2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264chroma_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264chroma_init.c
@@ -69,7 +69,6 @@ CHROMA_MC(avg, 8, 10, avx)
av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
{
-#if HAVE_YASM
int high_bit_depth = bit_depth > 8;
int cpu_flags = av_get_cpu_flags();
@@ -115,5 +114,4 @@ av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx;
c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_avx;
}
-#endif
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/h264dsp_init.c
index 30801c4bc81..311df5f8561 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264dsp_init.c
@@ -23,7 +23,6 @@
#include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
#include "libavcodec/h264dsp.h"
-#include "dsputil_x86.h"
/***********************************/
/* IDCT */
@@ -214,7 +213,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
#if HAVE_YASM
int cpu_flags = av_get_cpu_flags();
- if (chroma_format_idc == 1 && EXTERNAL_MMXEXT(cpu_flags))
+ if (chroma_format_idc <= 1 && EXTERNAL_MMXEXT(cpu_flags))
c->h264_loop_filter_strength = ff_h264_loop_filter_strength_mmxext;
if (bit_depth == 8) {
@@ -226,7 +225,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
c->h264_idct_add16 = ff_h264_idct_add16_8_mmx;
c->h264_idct8_add4 = ff_h264_idct8_add4_8_mmx;
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_8_mmx;
c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmx;
if (cpu_flags & AV_CPU_FLAG_CMOV)
@@ -237,13 +236,13 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmxext;
c->h264_idct_add16 = ff_h264_idct_add16_8_mmxext;
c->h264_idct8_add4 = ff_h264_idct8_add4_8_mmxext;
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_8_mmxext;
c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmxext;
c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_mmxext;
c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_mmxext;
- if (chroma_format_idc == 1) {
+ if (chroma_format_idc <= 1) {
c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_8_mmxext;
c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_mmxext;
}
@@ -266,7 +265,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
c->h264_idct_add16 = ff_h264_idct_add16_8_sse2;
c->h264_idct8_add4 = ff_h264_idct8_add4_8_sse2;
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_8_sse2;
c->h264_idct_add16intra = ff_h264_idct_add16intra_8_sse2;
c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_sse2;
@@ -309,7 +308,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_sse2;
c->h264_idct_add16 = ff_h264_idct_add16_10_sse2;
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_10_sse2;
c->h264_idct_add16intra = ff_h264_idct_add16intra_10_sse2;
#if HAVE_ALIGNED_STACK
@@ -349,7 +348,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_avx;
c->h264_idct_add16 = ff_h264_idct_add16_10_avx;
- if (chroma_format_idc == 1)
+ if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_10_avx;
c->h264_idct_add16intra = ff_h264_idct_add16intra_10_avx;
#if HAVE_ALIGNED_STACK
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hevc_mc.asm b/chromium/third_party/ffmpeg/libavcodec/x86/hevc_mc.asm
new file mode 100644
index 00000000000..1fae38c6153
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hevc_mc.asm
@@ -0,0 +1,1256 @@
+; /*
+; * Provide SSE luma and chroma mc functions for HEVC decoding
+; * Copyright (c) 2013 Pierre-Edouard LEPERE
+; *
+; * 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 "libavutil/x86/x86util.asm"
+
+SECTION_RODATA
+pw_8: times 8 dw 512
+pw_10: times 8 dw 2048
+pw_bi_8: times 8 dw 256
+pw_bi_10: times 8 dw 1024
+max_pixels_10: times 8 dw 1023
+zero: times 4 dd 0
+one_per_32: times 4 dd 1
+
+SECTION .text
+%macro EPEL_TABLE 4
+hevc_epel_filters_%4_%1 times %2 d%3 -2, 58
+ times %2 d%3 10, -2
+ times %2 d%3 -4, 54
+ times %2 d%3 16, -2
+ times %2 d%3 -6, 46
+ times %2 d%3 28, -4
+ times %2 d%3 -4, 36
+ times %2 d%3 36, -4
+ times %2 d%3 -4, 28
+ times %2 d%3 46, -6
+ times %2 d%3 -2, 16
+ times %2 d%3 54, -4
+ times %2 d%3 -2, 10
+ times %2 d%3 58, -2
+%endmacro
+
+
+
+EPEL_TABLE 8, 8, b, sse4
+EPEL_TABLE 10, 4, w, sse4
+
+%macro QPEL_TABLE 4
+hevc_qpel_filters_%4_%1 times %2 d%3 -1, 4
+ times %2 d%3 -10, 58
+ times %2 d%3 17, -5
+ times %2 d%3 1, 0
+ times %2 d%3 -1, 4
+ times %2 d%3 -11, 40
+ times %2 d%3 40,-11
+ times %2 d%3 4, -1
+ times %2 d%3 0, 1
+ times %2 d%3 -5, 17
+ times %2 d%3 58,-10
+ times %2 d%3 4, -1
+%endmacro
+
+QPEL_TABLE 8, 8, b, sse4
+QPEL_TABLE 10, 4, w, sse4
+
+%define hevc_qpel_filters_sse4_14 hevc_qpel_filters_sse4_10
+
+%if ARCH_X86_64
+
+%macro SIMPLE_BILOAD 4 ;width, tab, r1, r2
+%if %1 <= 4
+ movq %3, [%2] ; load data from source2
+%elif %1 <= 8
+ movdqa %3, [%2] ; load data from source2
+%elif %1 <= 12
+ movdqa %3, [%2] ; load data from source2
+ movq %4, [%2+16] ; load data from source2
+%else
+ movdqa %3, [%2] ; load data from source2
+ movdqa %4, [%2+16] ; load data from source2
+%endif
+%endmacro
+
+%macro SIMPLE_LOAD 4 ;width, bitd, tab, r1
+%if %1 == 2 || (%2 == 8 && %1 <= 4)
+ movd %4, [%3] ; load data from source
+%elif %1 == 4 || (%2 == 8 && %1 <= 8)
+ movq %4, [%3] ; load data from source
+%else
+ movdqu %4, [%3] ; load data from source
+%endif
+%endmacro
+
+%macro SIMPLE_8LOAD 5 ;width, bitd, tab, r1, r2
+%if %1 == 2 || (%2 == 8 && %1 <= 4)
+ movq %4, [%3] ; load data from source2
+%elif %1 == 4 || (%2 == 8 && %1 <= 8)
+ movdqa %4, [%3] ; load data from source2
+%elif %1 <= 12
+ movdqa %4, [%3] ; load data from source2
+ movq %5, [%3+16] ; load data from source2
+%else
+ movdqa %4, [%3] ; load data from source2
+ movdqa %5, [%3+16] ; load data from source2
+%endif
+%endmacro
+
+%macro EPEL_FILTER 2 ; bit depth, filter index
+%ifdef PIC
+ lea rfilterq, [hevc_epel_filters_sse4_%1]
+%else
+ %define rfilterq hevc_epel_filters_sse4_%1
+%endif
+ sub %2q, 1
+ shl %2q, 5 ; multiply by 32
+ movdqa m14, [rfilterq + %2q] ; get 2 first values of filters
+ movdqa m15, [rfilterq + %2q+16] ; get 2 last values of filters
+%endmacro
+
+%macro EPEL_HV_FILTER 1
+%ifdef PIC
+ lea rfilterq, [hevc_epel_filters_sse4_%1]
+%else
+ %define rfilterq hevc_epel_filters_sse4_%1
+%endif
+ sub mxq, 1
+ sub myq, 1
+ shl mxq, 5 ; multiply by 32
+ shl myq, 5 ; multiply by 32
+ movdqa m14, [rfilterq + mxq] ; get 2 first values of filters
+ movdqa m15, [rfilterq + mxq+16] ; get 2 last values of filters
+ lea r3srcq, [srcstrideq*3]
+
+%ifdef PIC
+ lea rfilterq, [hevc_epel_filters_sse4_10]
+%else
+ %define rfilterq hevc_epel_filters_sse4_10
+%endif
+ movdqa m12, [rfilterq + myq] ; get 2 first values of filters
+ movdqa m13, [rfilterq + myq+16] ; get 2 last values of filters
+%endmacro
+
+%macro QPEL_FILTER 2
+%ifdef PIC
+ lea rfilterq, [hevc_qpel_filters_sse4_%1]
+%else
+ %define rfilterq hevc_qpel_filters_sse4_%1
+%endif
+ lea %2q, [%2q*8-8]
+ movdqa m12, [rfilterq + %2q*8] ; get 4 first values of filters
+ movdqa m13, [rfilterq + %2q*8 + 16] ; get 4 first values of filters
+ movdqa m14, [rfilterq + %2q*8 + 32] ; get 4 first values of filters
+ movdqa m15, [rfilterq + %2q*8 + 48] ; get 4 first values of filters
+%endmacro
+
+%macro EPEL_LOAD 4
+%ifdef PIC
+ lea rfilterq, [%2]
+%else
+ %define rfilterq %2
+%endif
+ movdqu m0, [rfilterq ] ;load 128bit of x
+%ifnum %3
+ movdqu m1, [rfilterq+ %3] ;load 128bit of x+stride
+ movdqu m2, [rfilterq+2*%3] ;load 128bit of x+2*stride
+ movdqu m3, [rfilterq+3*%3] ;load 128bit of x+3*stride
+%else
+ movdqu m1, [rfilterq+ %3q] ;load 128bit of x+stride
+ movdqu m2, [rfilterq+2*%3q] ;load 128bit of x+2*stride
+ movdqu m3, [rfilterq+r3srcq] ;load 128bit of x+2*stride
+%endif
+
+%if %1 == 8
+%if %4 > 8
+ SBUTTERFLY bw, 0, 1, 10
+ SBUTTERFLY bw, 2, 3, 10
+%else
+ punpcklbw m0, m1
+ punpcklbw m2, m3
+%endif
+%else
+%if %4 > 4
+ SBUTTERFLY wd, 0, 1, 10
+ SBUTTERFLY wd, 2, 3, 10
+%else
+ punpcklwd m0, m1
+ punpcklwd m2, m3
+%endif
+%endif
+%endmacro
+
+
+%macro QPEL_H_LOAD 4
+%assign %%stride (%1+7)/8
+%if %1 == 8
+%if %3 <= 4
+%define %%load movd
+%elif %3 == 8
+%define %%load movq
+%else
+%define %%load movdqu
+%endif
+%else
+%if %3 == 2
+%define %%load movd
+%elif %3 == 4
+%define %%load movq
+%else
+%define %%load movdqu
+%endif
+%endif
+ %%load m0, [%2-3*%%stride] ;load data from source
+ %%load m1, [%2-2*%%stride]
+ %%load m2, [%2-%%stride ]
+ %%load m3, [%2 ]
+ %%load m4, [%2+%%stride ]
+ %%load m5, [%2+2*%%stride]
+ %%load m6, [%2+3*%%stride]
+ %%load m7, [%2+4*%%stride]
+
+%if %1 == 8
+%if %3 > 8
+ SBUTTERFLY wd, 0, 1, %4
+ SBUTTERFLY wd, 2, 3, %4
+ SBUTTERFLY wd, 4, 5, %4
+ SBUTTERFLY wd, 6, 7, %4
+%else
+ punpcklwd m0, m1
+ punpcklwd m2, m3
+ punpcklwd m4, m5
+ punpcklwd m6, m7
+%endif
+%else
+%if %3 > 4
+ SBUTTERFLY dq, 0, 1, %4
+ SBUTTERFLY dq, 2, 3, %4
+ SBUTTERFLY dq, 4, 5, %4
+ SBUTTERFLY dq, 6, 7, %4
+%else
+ punpckldq m0, m1
+ punpckldq m2, m3
+ punpckldq m4, m5
+ punpckldq m6, m7
+%endif
+%endif
+%endmacro
+
+%macro QPEL_V_LOAD 4
+ lea r12q, [%2]
+ sub r12q, r3srcq
+ movdqu m0, [r12 ] ;load x- 3*srcstride
+ movdqu m1, [r12+ %3q ] ;load x- 2*srcstride
+ movdqu m2, [r12+ 2*%3q ] ;load x-srcstride
+ movdqu m3, [%2 ] ;load x
+ movdqu m4, [%2+ %3q] ;load x+stride
+ movdqu m5, [%2+ 2*%3q] ;load x+2*stride
+ movdqu m6, [%2+r3srcq] ;load x+3*stride
+ movdqu m7, [%2+ 4*%3q] ;load x+4*stride
+%if %1 == 8
+%if %4 > 8
+ SBUTTERFLY bw, 0, 1, 8
+ SBUTTERFLY bw, 2, 3, 8
+ SBUTTERFLY bw, 4, 5, 8
+ SBUTTERFLY bw, 6, 7, 8
+%else
+ punpcklbw m0, m1
+ punpcklbw m2, m3
+ punpcklbw m4, m5
+ punpcklbw m6, m7
+%endif
+%else
+%if %4 > 4
+ SBUTTERFLY wd, 0, 1, 8
+ SBUTTERFLY wd, 2, 3, 8
+ SBUTTERFLY wd, 4, 5, 8
+ SBUTTERFLY wd, 6, 7, 8
+%else
+ punpcklwd m0, m1
+ punpcklwd m2, m3
+ punpcklwd m4, m5
+ punpcklwd m6, m7
+%endif
+%endif
+%endmacro
+
+%macro PEL_10STORE2 3
+ movd [%1], %2
+%endmacro
+%macro PEL_10STORE4 3
+ movq [%1], %2
+%endmacro
+%macro PEL_10STORE6 3
+ movq [%1], %2
+ psrldq %2, 8
+ movd [%1+8], %2
+%endmacro
+%macro PEL_10STORE8 3
+ movdqa [%1], %2
+%endmacro
+%macro PEL_10STORE12 3
+ movdqa [%1], %2
+ movq [%1+16], %3
+%endmacro
+%macro PEL_10STORE16 3
+ PEL_10STORE8 %1, %2, %3
+ movdqa [%1+16], %3
+%endmacro
+
+%macro PEL_8STORE2 3
+ pextrw [%1], %2, 0
+%endmacro
+%macro PEL_8STORE4 3
+ movd [%1], %2
+%endmacro
+%macro PEL_8STORE6 3
+ movd [%1], %2
+ pextrw [%1+4], %2, 2
+%endmacro
+%macro PEL_8STORE8 3
+ movq [%1], %2
+%endmacro
+%macro PEL_8STORE12 3
+ movq [%1], %2
+ psrldq %2, 8
+ movd [%1+8], %2
+%endmacro
+%macro PEL_8STORE16 3
+ movdqa [%1], %2
+%endmacro
+
+%macro LOOP_END 4
+ lea %1q, [%1q+2*%2q] ; dst += dststride
+ lea %3q, [%3q+ %4q] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+%endmacro
+
+
+%macro MC_PIXEL_COMPUTE 2 ;width, bitdepth
+%if %2 == 8
+%if %1 > 8
+ punpckhbw m1, m0, m2
+ psllw m1, 14-%2
+%endif
+ punpcklbw m0, m2
+%endif
+ psllw m0, 14-%2
+%endmacro
+
+
+%macro EPEL_COMPUTE 4 ; bitdepth, width, filter1, filter2
+%if %1 == 8
+ pmaddubsw m0, %3 ;x1*c1+x2*c2
+ pmaddubsw m2, %4 ;x3*c3+x4*c4
+ paddw m0, m2
+%if %2 > 8
+ pmaddubsw m1, %3
+ pmaddubsw m3, %4
+ paddw m1, m3
+%endif
+%else
+ pmaddwd m0, %3
+ pmaddwd m2, %4
+ paddd m0, m2
+%if %2 > 4
+ pmaddwd m1, %3
+ pmaddwd m3, %4
+ paddd m1, m3
+%endif
+ psrad m0, %1-8
+ psrad m1, %1-8
+ packssdw m0, m1
+%endif
+%endmacro
+
+%macro QPEL_HV_COMPUTE 4 ; width, bitdepth, filter idx
+%ifdef PIC
+ lea rfilterq, [hevc_qpel_filters_sse4_%2]
+%else
+ %define rfilterq hevc_qpel_filters_sse4_%2
+%endif
+
+%if %2 == 8
+ pmaddubsw m0, [rfilterq + %3q*8 ] ;x1*c1+x2*c2
+ pmaddubsw m2, [rfilterq + %3q*8+16] ;x3*c3+x4*c4
+ pmaddubsw m4, [rfilterq + %3q*8+32] ;x5*c5+x6*c6
+ pmaddubsw m6, [rfilterq + %3q*8+48] ;x7*c7+x8*c8
+ paddw m0, m2
+ paddw m4, m6
+ paddw m0, m4
+%else
+ pmaddwd m0, [rfilterq + %3q*8 ]
+ pmaddwd m2, [rfilterq + %3q*8+16]
+ pmaddwd m4, [rfilterq + %3q*8+32]
+ pmaddwd m6, [rfilterq + %3q*8+48]
+ paddd m0, m2
+ paddd m4, m6
+ paddd m0, m4
+ psrad m0, %2-8
+%if %1 > 4
+ pmaddwd m1, [rfilterq + %3q*8 ]
+ pmaddwd m3, [rfilterq + %3q*8+16]
+ pmaddwd m5, [rfilterq + %3q*8+32]
+ pmaddwd m7, [rfilterq + %3q*8+48]
+ paddd m1, m3
+ paddd m5, m7
+ paddd m1, m5
+ psrad m1, %2-8
+%endif
+ p%4 m0, m1
+%endif
+%endmacro
+
+%macro QPEL_COMPUTE 2 ; width, bitdepth
+%if %2 == 8
+ pmaddubsw m0, m12 ;x1*c1+x2*c2
+ pmaddubsw m2, m13 ;x3*c3+x4*c4
+ pmaddubsw m4, m14 ;x5*c5+x6*c6
+ pmaddubsw m6, m15 ;x7*c7+x8*c8
+ paddw m0, m2
+ paddw m4, m6
+ paddw m0, m4
+%if %1 > 8
+ pmaddubsw m1, m12
+ pmaddubsw m3, m13
+ pmaddubsw m5, m14
+ pmaddubsw m7, m15
+ paddw m1, m3
+ paddw m5, m7
+ paddw m1, m5
+%endif
+%else
+ pmaddwd m0, m12
+ pmaddwd m2, m13
+ pmaddwd m4, m14
+ pmaddwd m6, m15
+ paddd m0, m2
+ paddd m4, m6
+ paddd m0, m4
+ psrad m0, %2-8
+%if %1 > 4
+ pmaddwd m1, m12
+ pmaddwd m3, m13
+ pmaddwd m5, m14
+ pmaddwd m7, m15
+ paddd m1, m3
+ paddd m5, m7
+ paddd m1, m5
+ psrad m1, %2-8
+%endif
+%endif
+%endmacro
+
+%macro BI_COMPUTE 7 ; width, bitd, src1l, src1h, scr2l, scr2h, pw
+ paddsw %3, %5
+%if %1 > 8
+ paddsw %4, %6
+%endif
+ UNI_COMPUTE %1, %2, %3, %4, %7
+%endmacro
+
+%macro UNI_COMPUTE 5
+ pmulhrsw %3, %5
+%if %1 > 8 || (%2 > 8 && %1 > 4)
+ pmulhrsw %4, %5
+%endif
+%if %2 == 8
+ packuswb %3, %4
+%else
+ pminsw %3, [max_pixels_%2]
+ pmaxsw %3, [zero]
+%if %1 > 8
+ pminsw %4, [max_pixels_%2]
+ pmaxsw %4, [zero]
+%endif
+%endif
+%endmacro
+
+INIT_XMM sse4 ; adds ff_ and _sse4 to function name
+; ******************************
+; void put_hevc_mc_pixels(int16_t *dst, ptrdiff_t dststride,
+; uint8_t *_src, ptrdiff_t _srcstride,
+; int height, int mx, int my)
+; ******************************
+
+%macro HEVC_PUT_HEVC_PEL_PIXELS 2
+cglobal hevc_put_hevc_pel_pixels%1_%2, 5, 5, 3, dst, dststride, src, srcstride,height
+ pxor m2, m2
+.loop
+ SIMPLE_LOAD %1, %2, srcq, m0
+ MC_PIXEL_COMPUTE %1, %2
+ PEL_10STORE%1 dstq, m0, m1
+ LOOP_END dst, dststride, src, srcstride
+ RET
+
+cglobal hevc_put_hevc_uni_pel_pixels%1_%2, 5, 5, 3, dst, dststride, src, srcstride,height
+ pxor m2, m2
+.loop
+ SIMPLE_LOAD %1, %2, srcq, m0
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+cglobal hevc_put_hevc_bi_pel_pixels%1_%2, 7, 7, 6, dst, dststride, src, srcstride, src2, src2stride,height
+ pxor m2, m2
+ movdqa m5, [pw_bi_%2]
+.loop
+ SIMPLE_LOAD %1, %2, srcq, m0
+ SIMPLE_BILOAD %1, src2q, m3, m4
+ MC_PIXEL_COMPUTE %1, %2
+ BI_COMPUTE %1, %2, m0, m1, m3, m4, m5
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ lea src2q, [src2q+2*src2strideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+%endmacro
+
+
+; ******************************
+; void put_hevc_epel_hX(int16_t *dst, ptrdiff_t dststride,
+; uint8_t *_src, ptrdiff_t _srcstride,
+; int width, int height, int mx, int my,
+; int16_t* mcbuffer)
+; ******************************
+
+
+%macro HEVC_PUT_HEVC_EPEL 2
+cglobal hevc_put_hevc_epel_h%1_%2, 6, 7, 15 , dst, dststride, src, srcstride, height, mx, rfilter
+%assign %%stride ((%2 + 7)/8)
+ EPEL_FILTER %2, mx
+.loop
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ PEL_10STORE%1 dstq, m0, m1
+ LOOP_END dst, dststride, src, srcstride
+ RET
+
+cglobal hevc_put_hevc_uni_epel_h%1_%2, 6, 7, 15 , dst, dststride, src, srcstride, height, mx, rfilter
+%assign %%stride ((%2 + 7)/8)
+ movdqa m9, [pw_%2]
+ EPEL_FILTER %2, mx
+.loop
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ UNI_COMPUTE %1, %2, m0, m1, m9
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+cglobal hevc_put_hevc_bi_epel_h%1_%2, 8, 9, 15, dst, dststride, src, srcstride, src2, src2stride,height, mx, rfilter
+ movdqa m9, [pw_bi_%2]
+ EPEL_FILTER %2, mx
+.loop
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SIMPLE_BILOAD %1, src2q, m2, m3
+ BI_COMPUTE %1, %2, m0, m1, m2, m3, m9
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ lea src2q, [src2q+2*src2strideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+; ******************************
+; void put_hevc_epel_v(int16_t *dst, ptrdiff_t dststride,
+; uint8_t *_src, ptrdiff_t _srcstride,
+; int width, int height, int mx, int my,
+; int16_t* mcbuffer)
+; ******************************
+
+cglobal hevc_put_hevc_epel_v%1_%2, 7, 8, 15 , dst, dststride, src, srcstride, height, r3src, my, rfilter
+ lea r3srcq, [srcstrideq*3]
+ sub srcq, srcstrideq
+ EPEL_FILTER %2, my
+.loop
+ EPEL_LOAD %2, srcq, srcstride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ PEL_10STORE%1 dstq, m0, m1
+ LOOP_END dst, dststride, src, srcstride
+ RET
+
+cglobal hevc_put_hevc_uni_epel_v%1_%2, 7, 8, 15 , dst, dststride, src, srcstride, height, r3src, my, rfilter
+ lea r3srcq, [srcstrideq*3]
+ movdqa m9, [pw_%2]
+ sub srcq, srcstrideq
+ EPEL_FILTER %2, my
+.loop
+ EPEL_LOAD %2, srcq, srcstride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ UNI_COMPUTE %1, %2, m0, m1, m9
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+
+cglobal hevc_put_hevc_bi_epel_v%1_%2, 9, 10, 15, dst, dststride, src, srcstride, src2, src2stride,height, r3src, my, rfilter
+ lea r3srcq, [srcstrideq*3]
+ movdqa m9, [pw_bi_%2]
+ sub srcq, srcstrideq
+ EPEL_FILTER %2, my
+.loop
+ EPEL_LOAD %2, srcq, srcstride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SIMPLE_BILOAD %1, src2q, m2, m3
+ BI_COMPUTE %1, %2, m0, m1, m2, m3, m9
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ lea src2q, [src2q+2*src2strideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+%endmacro
+
+
+; ******************************
+; void put_hevc_epel_hv(int16_t *dst, ptrdiff_t dststride,
+; uint8_t *_src, ptrdiff_t _srcstride,
+; int width, int height, int mx, int my)
+; ******************************
+
+%macro HEVC_PUT_HEVC_EPEL_HV 2
+cglobal hevc_put_hevc_epel_hv%1_%2, 7, 9, 12 , dst, dststride, src, srcstride, height, mx, my, r3src, rfilter
+%assign %%stride ((%2 + 7)/8)
+ sub srcq, srcstrideq
+ EPEL_HV_FILTER %2
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m4, m0
+ lea srcq, [srcq + srcstrideq]
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m5, m0
+ lea srcq, [srcq + srcstrideq]
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m6, m0
+ lea srcq, [srcq + srcstrideq]
+.loop
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m7, m0
+ punpcklwd m0, m4, m5
+ punpcklwd m2, m6, m7
+%if %1 > 4
+ punpckhwd m1, m4, m5
+ punpckhwd m3, m6, m7
+%endif
+ EPEL_COMPUTE 14, %1, m12, m13
+ PEL_10STORE%1 dstq, m0, m1
+ movdqa m4, m5
+ movdqa m5, m6
+ movdqa m6, m7
+ LOOP_END dst, dststride, src, srcstride
+ RET
+
+cglobal hevc_put_hevc_uni_epel_hv%1_%2, 7, 9, 12 , dst, dststride, src, srcstride, height, mx, my, r3src, rfilter
+%assign %%stride ((%2 + 7)/8)
+ sub srcq, srcstrideq
+ EPEL_HV_FILTER %2
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m4, m0
+ lea srcq, [srcq + srcstrideq]
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m5, m0
+ lea srcq, [srcq + srcstrideq]
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m6, m0
+ lea srcq, [srcq + srcstrideq]
+.loop
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m7, m0
+ punpcklwd m0, m4, m5
+ punpcklwd m2, m6, m7
+%if %1 > 4
+ punpckhwd m1, m4, m5
+ punpckhwd m3, m6, m7
+%endif
+ EPEL_COMPUTE 14, %1, m12, m13
+ UNI_COMPUTE %1, %2, m0, m1, [pw_%2]
+ PEL_%2STORE%1 dstq, m0, m1
+ movdqa m4, m5
+ movdqa m5, m6
+ movdqa m6, m7
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+
+cglobal hevc_put_hevc_bi_epel_hv%1_%2, 9, 11, 16, dst, dststride, src, srcstride, src2, src2stride, height, mx, my, r3src, rfilter
+%assign %%stride ((%2 + 7)/8)
+ sub srcq, srcstrideq
+ EPEL_HV_FILTER %2
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m4, m0
+ lea srcq, [srcq + srcstrideq]
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m5, m0
+ lea srcq, [srcq + srcstrideq]
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m6, m0
+ lea srcq, [srcq + srcstrideq]
+.loop
+ EPEL_LOAD %2, srcq-%%stride, %%stride, %1
+ EPEL_COMPUTE %2, %1, m14, m15
+ SWAP m7, m0
+ punpcklwd m0, m4, m5
+ punpcklwd m2, m6, m7
+%if %1 > 4
+ punpckhwd m1, m4, m5
+ punpckhwd m3, m6, m7
+%endif
+ EPEL_COMPUTE 14, %1, m12, m13
+ SIMPLE_BILOAD %1, src2q, m8, m9
+ BI_COMPUTE %1, %2, m0, m1, m8, m9, [pw_bi_%2]
+ PEL_%2STORE%1 dstq, m0, m1
+ movdqa m4, m5
+ movdqa m5, m6
+ movdqa m6, m7
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ lea src2q, [src2q+2*src2strideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+%endmacro
+
+; ******************************
+; void put_hevc_qpel_hX_X_X(int16_t *dst, ptrdiff_t dststride,
+; uint8_t *_src, ptrdiff_t _srcstride,
+; int width, int height, int mx, int my)
+; ******************************
+
+%macro HEVC_PUT_HEVC_QPEL 2
+cglobal hevc_put_hevc_qpel_h%1_%2, 6, 7, 15 , dst, dststride, src, srcstride, height, mx, rfilter
+ QPEL_FILTER %2, mx
+.loop
+ QPEL_H_LOAD %2, srcq, %1, 10
+ QPEL_COMPUTE %1, %2
+%if %2 > 8
+ packssdw m0, m1
+%endif
+ PEL_10STORE%1 dstq, m0, m1
+ LOOP_END dst, dststride, src, srcstride
+ RET
+
+cglobal hevc_put_hevc_uni_qpel_h%1_%2, 6, 7, 15 , dst, dststride, src, srcstride, height, mx, rfilter
+ movdqa m9, [pw_%2]
+ QPEL_FILTER %2, mx
+.loop
+ QPEL_H_LOAD %2, srcq, %1, 10
+ QPEL_COMPUTE %1, %2
+%if %2 > 8
+ packssdw m0, m1
+%endif
+ UNI_COMPUTE %1, %2, m0, m1, m9
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+cglobal hevc_put_hevc_bi_qpel_h%1_%2, 8, 9, 16 , dst, dststride, src, srcstride, src2, src2stride, height, mx, rfilter
+ movdqa m9, [pw_bi_%2]
+ QPEL_FILTER %2, mx
+.loop
+ QPEL_H_LOAD %2, srcq, %1, 10
+ QPEL_COMPUTE %1, %2
+%if %2 > 8
+ packssdw m0, m1
+%endif
+ SIMPLE_BILOAD %1, src2q, m10, m11
+ BI_COMPUTE %1, %2, m0, m1, m10, m11, m9
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ lea src2q, [src2q+2*src2strideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+
+; ******************************
+; void put_hevc_qpel_vX_X_X(int16_t *dst, ptrdiff_t dststride,
+; uint8_t *_src, ptrdiff_t _srcstride,
+; int width, int height, int mx, int my)
+; ******************************
+
+cglobal hevc_put_hevc_qpel_v%1_%2, 7, 14, 15 , dst, dststride, src, srcstride, height, r3src, my, rfilter
+ lea r3srcq, [srcstrideq*3]
+ QPEL_FILTER %2, my
+.loop
+ QPEL_V_LOAD %2, srcq, srcstride, %1
+ QPEL_COMPUTE %1, %2
+%if %2 > 8
+ packssdw m0, m1
+%endif
+ PEL_10STORE%1 dstq, m0, m1
+ LOOP_END dst, dststride, src, srcstride
+ RET
+
+cglobal hevc_put_hevc_uni_qpel_v%1_%2, 7, 14, 15 , dst, dststride, src, srcstride, height, r3src, my, rfilter
+ movdqa m9, [pw_%2]
+ lea r3srcq, [srcstrideq*3]
+ QPEL_FILTER %2, my
+.loop
+ QPEL_V_LOAD %2, srcq, srcstride, %1
+ QPEL_COMPUTE %1, %2
+%if %2 > 8
+ packusdw m0, m1
+%endif
+ UNI_COMPUTE %1, %2, m0, m1, m9
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+cglobal hevc_put_hevc_bi_qpel_v%1_%2, 9, 14, 16 , dst, dststride, src, srcstride, src2, src2stride, height, r3src, my, rfilter
+ movdqa m9, [pw_bi_%2]
+ lea r3srcq, [srcstrideq*3]
+ QPEL_FILTER %2, my
+.loop
+ SIMPLE_BILOAD %1, src2q, m10, m11
+ QPEL_V_LOAD %2, srcq, srcstride, %1
+ QPEL_COMPUTE %1, %2
+%if %2 > 8
+ packssdw m0, m1
+%endif
+ BI_COMPUTE %1, %2, m0, m1, m10, m11, m9
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ lea src2q, [src2q+2*src2strideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+%endmacro
+
+
+; ******************************
+; void put_hevc_qpel_hvX_X(int16_t *dst, ptrdiff_t dststride,
+; uint8_t *_src, ptrdiff_t _srcstride,
+; int height, int mx, int my)
+; ******************************
+%macro HEVC_PUT_HEVC_QPEL_HV 2
+cglobal hevc_put_hevc_qpel_hv%1_%2, 7, 9, 12 , dst, dststride, src, srcstride, height, mx, my, r3src, rfilter
+ lea mxq, [mxq*8-8]
+ lea myq, [myq*8-8]
+ lea r3srcq, [srcstrideq*3]
+ sub srcq, r3srcq
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m8, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m9, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m10, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m11, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m12, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m13, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m14, m0
+ lea srcq, [srcq + srcstrideq]
+.loop
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m15, m0
+ punpcklwd m0, m8, m9
+ punpcklwd m2, m10, m11
+ punpcklwd m4, m12, m13
+ punpcklwd m6, m14, m15
+%if %1 > 4
+ punpckhwd m1, m8, m9
+ punpckhwd m3, m10, m11
+ punpckhwd m5, m12, m13
+ punpckhwd m7, m14, m15
+%endif
+ QPEL_HV_COMPUTE %1, 14, my, ackssdw
+ PEL_10STORE%1 dstq, m0, m1
+%if %1 <= 4
+ movq m8, m9
+ movq m9, m10
+ movq m10, m11
+ movq m11, m12
+ movq m12, m13
+ movq m13, m14
+ movq m14, m15
+%else
+ movdqa m8, m9
+ movdqa m9, m10
+ movdqa m10, m11
+ movdqa m11, m12
+ movdqa m12, m13
+ movdqa m13, m14
+ movdqa m14, m15
+%endif
+ LOOP_END dst, dststride, src, srcstride
+ RET
+
+cglobal hevc_put_hevc_uni_qpel_hv%1_%2, 7, 9, 12 , dst, dststride, src, srcstride, height, mx, my, r3src, rfilter
+ lea mxq, [mxq*8-8]
+ lea myq, [myq*8-8]
+ lea r3srcq, [srcstrideq*3]
+ sub srcq, r3srcq
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m8, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m9, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m10, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m11, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m12, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m13, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m14, m0
+ lea srcq, [srcq + srcstrideq]
+.loop
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m15, m0
+ punpcklwd m0, m8, m9
+ punpcklwd m2, m10, m11
+ punpcklwd m4, m12, m13
+ punpcklwd m6, m14, m15
+%if %1 > 4
+ punpckhwd m1, m8, m9
+ punpckhwd m3, m10, m11
+ punpckhwd m5, m12, m13
+ punpckhwd m7, m14, m15
+%endif
+ QPEL_HV_COMPUTE %1, 14, my, ackusdw
+ UNI_COMPUTE %1, %2, m0, m1, [pw_%2]
+ PEL_%2STORE%1 dstq, m0, m1
+
+%if %1 <= 4
+ movq m8, m9
+ movq m9, m10
+ movq m10, m11
+ movq m11, m12
+ movq m12, m13
+ movq m13, m14
+ movq m14, m15
+%else
+ movdqa m8, m9
+ movdqa m9, m10
+ movdqa m10, m11
+ movdqa m11, m12
+ movdqa m12, m13
+ movdqa m13, m14
+ movdqa m14, m15
+%endif
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+cglobal hevc_put_hevc_bi_qpel_hv%1_%2, 9, 11, 16, dst, dststride, src, srcstride, src2, src2stride, height, mx, my, r3src, rfilter
+ lea mxq, [mxq*8-8]
+ lea myq, [myq*8-8]
+ lea r3srcq, [srcstrideq*3]
+ sub srcq, r3srcq
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m8, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m9, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m10, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m11, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m12, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m13, m0
+ lea srcq, [srcq + srcstrideq]
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m14, m0
+ lea srcq, [srcq + srcstrideq]
+.loop
+ QPEL_H_LOAD %2, srcq, %1, 15
+ QPEL_HV_COMPUTE %1, %2, mx, ackssdw
+ SWAP m15, m0
+ punpcklwd m0, m8, m9
+ punpcklwd m2, m10, m11
+ punpcklwd m4, m12, m13
+ punpcklwd m6, m14, m15
+%if %1 > 4
+ punpckhwd m1, m8, m9
+ punpckhwd m3, m10, m11
+ punpckhwd m5, m12, m13
+ punpckhwd m7, m14, m15
+%endif
+ QPEL_HV_COMPUTE %1, 14, my, ackssdw
+ SIMPLE_BILOAD %1, src2q, m8, m9 ;m9 not used in this case
+ BI_COMPUTE %1, %2, m0, m1, m8, m9, [pw_bi_%2]
+ PEL_%2STORE%1 dstq, m0, m1
+
+%if %1 <= 4
+ movq m8, m9
+ movq m9, m10
+ movq m10, m11
+ movq m11, m12
+ movq m12, m13
+ movq m13, m14
+ movq m14, m15
+%else
+ movdqa m8, m9
+ movdqa m9, m10
+ movdqa m10, m11
+ movdqa m11, m12
+ movdqa m12, m13
+ movdqa m13, m14
+ movdqa m14, m15
+%endif
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+srcstrideq] ; src += srcstride
+ lea src2q, [src2q+2*src2strideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+%endmacro
+
+%macro WEIGHTING_FUNCS 2
+cglobal hevc_put_hevc_uni_w%1_%2, 8, 10, 11, dst, dststride, src, srcstride, height, denom, wx, ox, shift
+ lea shiftd, [denomd+14-%2] ; shift = 14 - bitd + denom
+ shl oxd, %2-8 ; ox << (bitd - 8)
+ movd m2, wxd ; WX
+ movd m3, oxd ; OX
+ movd m4, shiftd ; shift
+ punpcklwd m2, m2
+ pshufd m3, m3, 0
+ pshufd m2, m2, 0
+ sub shiftd, 1
+ movd m6, shiftd
+ movdqu m5, [one_per_32]
+ pslld m5, m6
+.loop
+ SIMPLE_LOAD %1, 10, srcq, m0
+ pmulhw m6, m0, m2
+ pmullw m0, m2
+ punpckhwd m1, m0, m6
+ punpcklwd m0, m6
+ paddd m0, m5
+ paddd m1, m5
+ psrad m0, m4
+ psrad m1, m4
+ paddd m0, m3
+ paddd m1, m3
+ packusdw m0, m1
+%if %2 == 8
+ packuswb m0, m0
+%else
+ pminsw m0, [max_pixels_%2]
+%endif
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+2*srcstrideq] ; src += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+
+cglobal hevc_put_hevc_bi_w%1_%2, 12, 14, 14, dst, dststride, src, srcstride, src2, src2stride, height, denom, wx0, wx1, ox0, ox1, shift, temp
+ shl ox0d, %2-8 ; ox << (bitd - 8)
+ shl ox1d, %2-8 ; ox << (bitd - 8)
+ lea shiftd, [denomd+14-%2] ; shift = 14 - bitd + denom
+ movd m2, wx0d ; WX0
+ movd m3, wx1d ; WX1
+ punpcklwd m2, m2
+ punpcklwd m3, m3
+ pshufd m2, m2, 0
+ pshufd m3, m3, 0
+ add ox0d, ox1d
+ add ox0d, 1
+ movd m4, ox0d ; offset
+ pshufd m4, m4, 0
+ movd m5, shiftd ; shift
+ pslld m4, m5
+ add shiftd, 1
+ movd m5, shiftd ; shift
+
+.loop
+ SIMPLE_LOAD %1, 10, srcq, m0
+ SIMPLE_LOAD %1, 10, src2q, m10
+ pmulhw m6, m0, m3
+ pmullw m0, m3
+ pmulhw m7, m10, m2
+ pmullw m10, m2
+ punpckhwd m1, m0, m6
+ punpcklwd m0, m6
+ punpckhwd m11, m10, m7
+ punpcklwd m10, m7
+ paddd m0, m10
+ paddd m1, m11
+ paddd m0, m4
+ paddd m1, m4
+ psrad m0, m5
+ psrad m1, m5
+ packusdw m0, m1
+%if %2 == 8
+ packuswb m0, m0
+%else
+ pminsw m0, [max_pixels_%2]
+%endif
+ PEL_%2STORE%1 dstq, m0, m1
+ lea dstq, [dstq+dststrideq] ; dst += dststride
+ lea srcq, [srcq+2*srcstrideq] ; src += srcstride
+ lea src2q, [src2q+2*src2strideq] ; src2 += srcstride
+ dec heightd ; cmp height
+ jnz .loop ; height loop
+ RET
+%endmacro
+
+WEIGHTING_FUNCS 2, 8
+WEIGHTING_FUNCS 4, 8
+WEIGHTING_FUNCS 6, 8
+WEIGHTING_FUNCS 8, 8
+
+WEIGHTING_FUNCS 2, 10
+WEIGHTING_FUNCS 4, 10
+WEIGHTING_FUNCS 6, 10
+WEIGHTING_FUNCS 8, 10
+
+HEVC_PUT_HEVC_PEL_PIXELS 2, 8
+HEVC_PUT_HEVC_PEL_PIXELS 4, 8
+HEVC_PUT_HEVC_PEL_PIXELS 6, 8
+HEVC_PUT_HEVC_PEL_PIXELS 8, 8
+HEVC_PUT_HEVC_PEL_PIXELS 12, 8
+HEVC_PUT_HEVC_PEL_PIXELS 16, 8
+
+HEVC_PUT_HEVC_PEL_PIXELS 2, 10
+HEVC_PUT_HEVC_PEL_PIXELS 4, 10
+HEVC_PUT_HEVC_PEL_PIXELS 6, 10
+HEVC_PUT_HEVC_PEL_PIXELS 8, 10
+
+
+HEVC_PUT_HEVC_EPEL 2, 8
+HEVC_PUT_HEVC_EPEL 4, 8
+HEVC_PUT_HEVC_EPEL 6, 8
+HEVC_PUT_HEVC_EPEL 8, 8
+HEVC_PUT_HEVC_EPEL 12, 8
+HEVC_PUT_HEVC_EPEL 16, 8
+
+
+HEVC_PUT_HEVC_EPEL 2, 10
+HEVC_PUT_HEVC_EPEL 4, 10
+HEVC_PUT_HEVC_EPEL 6, 10
+HEVC_PUT_HEVC_EPEL 8, 10
+
+
+HEVC_PUT_HEVC_EPEL_HV 2, 8
+HEVC_PUT_HEVC_EPEL_HV 4, 8
+HEVC_PUT_HEVC_EPEL_HV 6, 8
+HEVC_PUT_HEVC_EPEL_HV 8, 8
+
+HEVC_PUT_HEVC_EPEL_HV 2, 10
+HEVC_PUT_HEVC_EPEL_HV 4, 10
+HEVC_PUT_HEVC_EPEL_HV 6, 10
+HEVC_PUT_HEVC_EPEL_HV 8, 10
+
+
+HEVC_PUT_HEVC_QPEL 4, 8
+HEVC_PUT_HEVC_QPEL 8, 8
+HEVC_PUT_HEVC_QPEL 12, 8
+HEVC_PUT_HEVC_QPEL 16, 8
+
+HEVC_PUT_HEVC_QPEL 4, 10
+HEVC_PUT_HEVC_QPEL 8, 10
+
+HEVC_PUT_HEVC_QPEL_HV 2, 8
+HEVC_PUT_HEVC_QPEL_HV 4, 8
+HEVC_PUT_HEVC_QPEL_HV 6, 8
+HEVC_PUT_HEVC_QPEL_HV 8, 8
+
+HEVC_PUT_HEVC_QPEL_HV 2, 10
+HEVC_PUT_HEVC_QPEL_HV 4, 10
+HEVC_PUT_HEVC_QPEL_HV 6, 10
+HEVC_PUT_HEVC_QPEL_HV 8, 10
+
+%endif ; ARCH_X86_64
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hevcdsp.h b/chromium/third_party/ffmpeg/libavcodec/x86/hevcdsp.h
new file mode 100644
index 00000000000..c5a64c708a2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hevcdsp.h
@@ -0,0 +1,123 @@
+/*
+ * HEVC video decoder
+ *
+ * Copyright (C) 2012 - 2013 Guillaume Martres
+ * Copyright (C) 2013 - 2014 Pierre-Edouard Lepere
+ *
+ *
+ * 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_X86_HEVCDSP_H
+#define AVCODEC_X86_HEVCDSP_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#define PEL_LINK(dst, idx1, idx2, idx3, name, D, opt) \
+dst[idx1][idx2][idx3] = ff_hevc_put_hevc_ ## name ## _ ## D ## _##opt; \
+dst ## _bi[idx1][idx2][idx3] = ff_hevc_put_hevc_bi_ ## name ## _ ## D ## _##opt; \
+dst ## _uni[idx1][idx2][idx3] = ff_hevc_put_hevc_uni_ ## name ## _ ## D ## _##opt; \
+dst ## _uni_w[idx1][idx2][idx3] = ff_hevc_put_hevc_uni_w_ ## name ## _ ## D ## _##opt; \
+dst ## _bi_w[idx1][idx2][idx3] = ff_hevc_put_hevc_bi_w_ ## name ## _ ## D ## _##opt
+
+
+#define PEL_PROTOTYPE(name, D, opt) \
+void ff_hevc_put_hevc_ ## name ## _ ## D ## _##opt(int16_t *dst, ptrdiff_t dststride,uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); \
+void ff_hevc_put_hevc_bi_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, ptrdiff_t src2stride, int height, intptr_t mx, intptr_t my, int width); \
+void ff_hevc_put_hevc_uni_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); \
+void ff_hevc_put_hevc_uni_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width); \
+void ff_hevc_put_hevc_bi_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, ptrdiff_t src2stride, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width)
+
+
+///////////////////////////////////////////////////////////////////////////////
+// MC functions
+///////////////////////////////////////////////////////////////////////////////
+
+#define EPEL_PROTOTYPES(fname, bitd, opt) \
+ PEL_PROTOTYPE(fname##4, bitd, opt); \
+ PEL_PROTOTYPE(fname##6, bitd, opt); \
+ PEL_PROTOTYPE(fname##8, bitd, opt); \
+ PEL_PROTOTYPE(fname##12, bitd, opt); \
+ PEL_PROTOTYPE(fname##16, bitd, opt); \
+ PEL_PROTOTYPE(fname##24, bitd, opt); \
+ PEL_PROTOTYPE(fname##32, bitd, opt); \
+ PEL_PROTOTYPE(fname##48, bitd, opt); \
+ PEL_PROTOTYPE(fname##64, bitd, opt)
+
+#define QPEL_PROTOTYPES(fname, bitd, opt) \
+ PEL_PROTOTYPE(fname##4, bitd, opt); \
+ PEL_PROTOTYPE(fname##8, bitd, opt); \
+ PEL_PROTOTYPE(fname##12, bitd, opt); \
+ PEL_PROTOTYPE(fname##16, bitd, opt); \
+ PEL_PROTOTYPE(fname##24, bitd, opt); \
+ PEL_PROTOTYPE(fname##32, bitd, opt); \
+ PEL_PROTOTYPE(fname##48, bitd, opt); \
+ PEL_PROTOTYPE(fname##64, bitd, opt)
+
+#define WEIGHTING_PROTOTYPE(width, bitd, opt) \
+void ff_hevc_put_hevc_uni_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, int16_t *_src, ptrdiff_t _srcstride, int height, int denom, int _wx, int _ox); \
+void ff_hevc_put_hevc_bi_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, int16_t *_src, ptrdiff_t _srcstride, int16_t *_src2, ptrdiff_t _src2stride, int height, int denom, int _wx0, int _wx1, int _ox0, int _ox1)
+
+#define WEIGHTING_PROTOTYPES(bitd, opt) \
+ WEIGHTING_PROTOTYPE(2, bitd, opt); \
+ WEIGHTING_PROTOTYPE(4, bitd, opt); \
+ WEIGHTING_PROTOTYPE(6, bitd, opt); \
+ WEIGHTING_PROTOTYPE(8, bitd, opt); \
+ WEIGHTING_PROTOTYPE(12, bitd, opt); \
+ WEIGHTING_PROTOTYPE(16, bitd, opt); \
+ WEIGHTING_PROTOTYPE(24, bitd, opt); \
+ WEIGHTING_PROTOTYPE(32, bitd, opt); \
+ WEIGHTING_PROTOTYPE(48, bitd, opt); \
+ WEIGHTING_PROTOTYPE(64, bitd, opt)
+
+
+///////////////////////////////////////////////////////////////////////////////
+// QPEL_PIXELS EPEL_PIXELS
+///////////////////////////////////////////////////////////////////////////////
+EPEL_PROTOTYPES(pel_pixels , 8, sse4);
+EPEL_PROTOTYPES(pel_pixels , 10, sse4);
+///////////////////////////////////////////////////////////////////////////////
+// EPEL
+///////////////////////////////////////////////////////////////////////////////
+EPEL_PROTOTYPES(epel_h , 8, sse4);
+EPEL_PROTOTYPES(epel_h , 10, sse4);
+
+EPEL_PROTOTYPES(epel_v , 8, sse4);
+EPEL_PROTOTYPES(epel_v , 10, sse4);
+
+EPEL_PROTOTYPES(epel_hv , 8, sse4);
+EPEL_PROTOTYPES(epel_hv , 10, sse4);
+
+///////////////////////////////////////////////////////////////////////////////
+// QPEL
+///////////////////////////////////////////////////////////////////////////////
+QPEL_PROTOTYPES(qpel_h , 8, sse4);
+QPEL_PROTOTYPES(qpel_h , 10, sse4);
+
+QPEL_PROTOTYPES(qpel_v, 8, sse4);
+QPEL_PROTOTYPES(qpel_v, 10, sse4);
+
+QPEL_PROTOTYPES(qpel_hv, 8, sse4);
+QPEL_PROTOTYPES(qpel_hv, 10, sse4);
+
+
+WEIGHTING_PROTOTYPES(8, sse4);
+WEIGHTING_PROTOTYPES(10, sse4);
+
+
+#endif // AVCODEC_X86_HEVCDSP_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hevcdsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/hevcdsp_init.c
new file mode 100644
index 00000000000..61ac6a98dc9
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hevcdsp_init.c
@@ -0,0 +1,377 @@
+/*
+ * Copyright (c) 2013 Seppo Tomperi
+ * Copyright (c) 2013 - 2014 Pierre-Edouard Lepere
+ *
+ *
+ * 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 "config.h"
+#include "libavutil/cpu.h"
+#include "libavutil/x86/asm.h"
+#include "libavutil/x86/cpu.h"
+#include "libavcodec/get_bits.h" /* required for hevcdsp.h GetBitContext */
+#include "libavcodec/hevcdsp.h"
+#include "libavcodec/x86/hevcdsp.h"
+
+
+#define mc_rep_func(name, bitd, step, W, opt) \
+void ff_hevc_put_hevc_##name##W##_##bitd##_##opt(int16_t *_dst, ptrdiff_t dststride, \
+ uint8_t *_src, ptrdiff_t _srcstride, int height, \
+ intptr_t mx, intptr_t my, int width) \
+{ \
+ int i; \
+ uint8_t *src; \
+ int16_t *dst; \
+ for (i = 0; i < W; i += step) { \
+ src = _src + (i * ((bitd + 7) / 8)); \
+ dst = _dst + i; \
+ ff_hevc_put_hevc_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, height, mx, my, width); \
+ } \
+}
+#define mc_rep_uni_func(name, bitd, step, W, opt) \
+void ff_hevc_put_hevc_uni_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, \
+ uint8_t *_src, ptrdiff_t _srcstride, int height, \
+ intptr_t mx, intptr_t my, int width) \
+{ \
+ int i; \
+ uint8_t *src; \
+ uint8_t *dst; \
+ for (i = 0; i < W; i += step) { \
+ src = _src + (i * ((bitd + 7) / 8)); \
+ dst = _dst + (i * ((bitd + 7) / 8)); \
+ ff_hevc_put_hevc_uni_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, \
+ height, mx, my, width); \
+ } \
+}
+#define mc_rep_bi_func(name, bitd, step, W, opt) \
+void ff_hevc_put_hevc_bi_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, uint8_t *_src, \
+ ptrdiff_t _srcstride, int16_t* _src2, ptrdiff_t _src2stride, \
+ int height, intptr_t mx, intptr_t my, int width) \
+{ \
+ int i; \
+ uint8_t *src; \
+ uint8_t *dst; \
+ int16_t *src2; \
+ for (i = 0; i < W ; i += step) { \
+ src = _src + (i * ((bitd + 7) / 8)); \
+ dst = _dst + (i * ((bitd + 7) / 8)); \
+ src2 = _src2 + i; \
+ ff_hevc_put_hevc_bi_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, src2, \
+ _src2stride, height, mx, my, width); \
+ } \
+}
+
+#define mc_rep_funcs(name, bitd, step, W, opt) \
+ mc_rep_func(name, bitd, step, W, opt); \
+ mc_rep_uni_func(name, bitd, step, W, opt); \
+ mc_rep_bi_func(name, bitd, step, W, opt)
+
+
+#if ARCH_X86_64 && HAVE_SSE4_EXTERNAL
+
+mc_rep_funcs(pel_pixels, 8, 16, 64, sse4);
+mc_rep_funcs(pel_pixels, 8, 16, 48, sse4);
+mc_rep_funcs(pel_pixels, 8, 16, 32, sse4);
+mc_rep_funcs(pel_pixels, 8, 8, 24, sse4);
+
+mc_rep_funcs(pel_pixels,10, 8, 64, sse4);
+mc_rep_funcs(pel_pixels,10, 8, 48, sse4);
+mc_rep_funcs(pel_pixels,10, 8, 32, sse4);
+mc_rep_funcs(pel_pixels,10, 8, 24, sse4);
+mc_rep_funcs(pel_pixels,10, 8, 16, sse4);
+mc_rep_funcs(pel_pixels,10, 4, 12, sse4);
+
+mc_rep_funcs(epel_h, 8, 16, 64, sse4);
+mc_rep_funcs(epel_h, 8, 16, 48, sse4);
+mc_rep_funcs(epel_h, 8, 16, 32, sse4);
+mc_rep_funcs(epel_h, 8, 8, 24, sse4);
+mc_rep_funcs(epel_h,10, 8, 64, sse4);
+mc_rep_funcs(epel_h,10, 8, 48, sse4);
+mc_rep_funcs(epel_h,10, 8, 32, sse4);
+mc_rep_funcs(epel_h,10, 8, 24, sse4);
+mc_rep_funcs(epel_h,10, 8, 16, sse4);
+mc_rep_funcs(epel_h,10, 4, 12, sse4);
+mc_rep_funcs(epel_v, 8, 16, 64, sse4);
+mc_rep_funcs(epel_v, 8, 16, 48, sse4);
+mc_rep_funcs(epel_v, 8, 16, 32, sse4);
+mc_rep_funcs(epel_v, 8, 8, 24, sse4);
+mc_rep_funcs(epel_v,10, 8, 64, sse4);
+mc_rep_funcs(epel_v,10, 8, 48, sse4);
+mc_rep_funcs(epel_v,10, 8, 32, sse4);
+mc_rep_funcs(epel_v,10, 8, 24, sse4);
+mc_rep_funcs(epel_v,10, 8, 16, sse4);
+mc_rep_funcs(epel_v,10, 4, 12, sse4);
+mc_rep_funcs(epel_hv, 8, 8, 64, sse4);
+mc_rep_funcs(epel_hv, 8, 8, 48, sse4);
+mc_rep_funcs(epel_hv, 8, 8, 32, sse4);
+mc_rep_funcs(epel_hv, 8, 8, 24, sse4);
+mc_rep_funcs(epel_hv, 8, 8, 16, sse4);
+mc_rep_funcs(epel_hv, 8, 4, 12, sse4);
+mc_rep_funcs(epel_hv,10, 8, 64, sse4);
+mc_rep_funcs(epel_hv,10, 8, 48, sse4);
+mc_rep_funcs(epel_hv,10, 8, 32, sse4);
+mc_rep_funcs(epel_hv,10, 8, 24, sse4);
+mc_rep_funcs(epel_hv,10, 8, 16, sse4);
+mc_rep_funcs(epel_hv,10, 4, 12, sse4);
+
+mc_rep_funcs(qpel_h, 8, 16, 64, sse4);
+mc_rep_funcs(qpel_h, 8, 16, 48, sse4);
+mc_rep_funcs(qpel_h, 8, 16, 32, sse4);
+mc_rep_funcs(qpel_h, 8, 8, 24, sse4);
+mc_rep_funcs(qpel_h,10, 8, 64, sse4);
+mc_rep_funcs(qpel_h,10, 8, 48, sse4);
+mc_rep_funcs(qpel_h,10, 8, 32, sse4);
+mc_rep_funcs(qpel_h,10, 8, 24, sse4);
+mc_rep_funcs(qpel_h,10, 8, 16, sse4);
+mc_rep_funcs(qpel_h,10, 4, 12, sse4);
+mc_rep_funcs(qpel_v, 8, 16, 64, sse4);
+mc_rep_funcs(qpel_v, 8, 16, 48, sse4);
+mc_rep_funcs(qpel_v, 8, 16, 32, sse4);
+mc_rep_funcs(qpel_v, 8, 8, 24, sse4);
+mc_rep_funcs(qpel_v,10, 8, 64, sse4);
+mc_rep_funcs(qpel_v,10, 8, 48, sse4);
+mc_rep_funcs(qpel_v,10, 8, 32, sse4);
+mc_rep_funcs(qpel_v,10, 8, 24, sse4);
+mc_rep_funcs(qpel_v,10, 8, 16, sse4);
+mc_rep_funcs(qpel_v,10, 4, 12, sse4);
+mc_rep_funcs(qpel_hv, 8, 8, 64, sse4);
+mc_rep_funcs(qpel_hv, 8, 8, 48, sse4);
+mc_rep_funcs(qpel_hv, 8, 8, 32, sse4);
+mc_rep_funcs(qpel_hv, 8, 8, 24, sse4);
+mc_rep_funcs(qpel_hv, 8, 8, 16, sse4);
+mc_rep_funcs(qpel_hv, 8, 4, 12, sse4);
+mc_rep_funcs(qpel_hv,10, 8, 64, sse4);
+mc_rep_funcs(qpel_hv,10, 8, 48, sse4);
+mc_rep_funcs(qpel_hv,10, 8, 32, sse4);
+mc_rep_funcs(qpel_hv,10, 8, 24, sse4);
+mc_rep_funcs(qpel_hv,10, 8, 16, sse4);
+mc_rep_funcs(qpel_hv,10, 4, 12, sse4);
+
+#define mc_rep_uni_w(bitd, step, W, opt) \
+void ff_hevc_put_hevc_uni_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, int16_t *_src, ptrdiff_t _srcstride,\
+ int height, int denom, int _wx, int _ox) \
+{ \
+ int i; \
+ int16_t *src; \
+ uint8_t *dst; \
+ for (i = 0; i < W; i += step) { \
+ src= _src + i; \
+ dst= _dst + (i * ((bitd + 7) / 8)); \
+ ff_hevc_put_hevc_uni_w##step##_##bitd##_##opt(dst, dststride, src, _srcstride, \
+ height, denom, _wx, _ox); \
+ } \
+}
+
+mc_rep_uni_w(8, 6, 12, sse4);
+mc_rep_uni_w(8, 8, 16, sse4);
+mc_rep_uni_w(8, 8, 24, sse4);
+mc_rep_uni_w(8, 8, 32, sse4);
+mc_rep_uni_w(8, 8, 48, sse4);
+mc_rep_uni_w(8, 8, 64, sse4);
+
+mc_rep_uni_w(10, 6, 12, sse4);
+mc_rep_uni_w(10, 8, 16, sse4);
+mc_rep_uni_w(10, 8, 24, sse4);
+mc_rep_uni_w(10, 8, 32, sse4);
+mc_rep_uni_w(10, 8, 48, sse4);
+mc_rep_uni_w(10, 8, 64, sse4);
+
+#define mc_rep_bi_w(bitd, step, W, opt) \
+void ff_hevc_put_hevc_bi_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, int16_t *_src, ptrdiff_t _srcstride, \
+ int16_t *_src2, ptrdiff_t _src2stride, int height, \
+ int denom, int _wx0, int _wx1, int _ox0, int _ox1) \
+{ \
+ int i; \
+ int16_t *src; \
+ int16_t *src2; \
+ uint8_t *dst; \
+ for (i = 0; i < W; i += step) { \
+ src = _src + i; \
+ src2 = _src2 + i; \
+ dst = _dst + (i * ((bitd + 7) / 8)); \
+ ff_hevc_put_hevc_bi_w##step##_##bitd##_##opt(dst, dststride, src, _srcstride, src2, _src2stride, \
+ height, denom, _wx0, _wx1, _ox0, _ox1); \
+ } \
+}
+
+mc_rep_bi_w(8, 6, 12, sse4);
+mc_rep_bi_w(8, 8, 16, sse4);
+mc_rep_bi_w(8, 8, 24, sse4);
+mc_rep_bi_w(8, 8, 32, sse4);
+mc_rep_bi_w(8, 8, 48, sse4);
+mc_rep_bi_w(8, 8, 64, sse4);
+
+mc_rep_bi_w(10, 6, 12, sse4);
+mc_rep_bi_w(10, 8, 16, sse4);
+mc_rep_bi_w(10, 8, 24, sse4);
+mc_rep_bi_w(10, 8, 32, sse4);
+mc_rep_bi_w(10, 8, 48, sse4);
+mc_rep_bi_w(10, 8, 64, sse4);
+
+#define mc_uni_w_func(name, bitd, W, opt) \
+void ff_hevc_put_hevc_uni_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _dststride, \
+ uint8_t *_src, ptrdiff_t _srcstride, \
+ int height, int denom, \
+ int _wx, int _ox, \
+ intptr_t mx, intptr_t my, int width) \
+{ \
+ LOCAL_ALIGNED_16(int16_t, temp, [71 * 64]); \
+ ff_hevc_put_hevc_##name##W##_##bitd##_##opt(temp, 64, _src, _srcstride, height, mx, my, width); \
+ ff_hevc_put_hevc_uni_w##W##_##bitd##_##opt(_dst, _dststride, temp, 64, height, denom, _wx, _ox);\
+}
+
+#define mc_uni_w_funcs(name, bitd, opt) \
+ mc_uni_w_func(name, bitd, 4, opt); \
+ mc_uni_w_func(name, bitd, 8, opt); \
+ mc_uni_w_func(name, bitd, 12, opt); \
+ mc_uni_w_func(name, bitd, 16, opt); \
+ mc_uni_w_func(name, bitd, 24, opt); \
+ mc_uni_w_func(name, bitd, 32, opt); \
+ mc_uni_w_func(name, bitd, 48, opt); \
+ mc_uni_w_func(name, bitd, 64, opt)
+
+mc_uni_w_funcs(pel_pixels, 8, sse4);
+mc_uni_w_func(pel_pixels, 8, 6, sse4);
+mc_uni_w_funcs(epel_h, 8, sse4);
+mc_uni_w_func(epel_h, 8, 6, sse4);
+mc_uni_w_funcs(epel_v, 8, sse4);
+mc_uni_w_func(epel_v, 8, 6, sse4);
+mc_uni_w_funcs(epel_hv, 8, sse4);
+mc_uni_w_func(epel_hv, 8, 6, sse4);
+mc_uni_w_funcs(qpel_h, 8, sse4);
+mc_uni_w_funcs(qpel_v, 8, sse4);
+mc_uni_w_funcs(qpel_hv, 8, sse4);
+
+mc_uni_w_funcs(pel_pixels, 10, sse4);
+mc_uni_w_func(pel_pixels, 10, 6, sse4);
+mc_uni_w_funcs(epel_h, 10, sse4);
+mc_uni_w_func(epel_h, 10, 6, sse4);
+mc_uni_w_funcs(epel_v, 10, sse4);
+mc_uni_w_func(epel_v, 10, 6, sse4);
+mc_uni_w_funcs(epel_hv, 10, sse4);
+mc_uni_w_func(epel_hv, 10, 6, sse4);
+mc_uni_w_funcs(qpel_h, 10, sse4);
+mc_uni_w_funcs(qpel_v, 10, sse4);
+mc_uni_w_funcs(qpel_hv, 10, sse4);
+
+
+#define mc_bi_w_func(name, bitd, W, opt) \
+void ff_hevc_put_hevc_bi_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _dststride, \
+ uint8_t *_src, ptrdiff_t _srcstride, \
+ int16_t *_src2, ptrdiff_t _src2stride, \
+ int height, int denom, \
+ int _wx0, int _wx1, int _ox0, int _ox1, \
+ intptr_t mx, intptr_t my, int width) \
+{ \
+ LOCAL_ALIGNED_16(int16_t, temp, [71 * 64]); \
+ ff_hevc_put_hevc_##name##W##_##bitd##_##opt(temp, 64, _src, _srcstride, height, mx, my, width); \
+ ff_hevc_put_hevc_bi_w##W##_##bitd##_##opt(_dst, _dststride, temp, 64, _src2, _src2stride, \
+ height, denom, _wx0, _wx1, _ox0, _ox1); \
+}
+
+#define mc_bi_w_funcs(name, bitd, opt) \
+ mc_bi_w_func(name, bitd, 4, opt); \
+ mc_bi_w_func(name, bitd, 8, opt); \
+ mc_bi_w_func(name, bitd, 12, opt); \
+ mc_bi_w_func(name, bitd, 16, opt); \
+ mc_bi_w_func(name, bitd, 24, opt); \
+ mc_bi_w_func(name, bitd, 32, opt); \
+ mc_bi_w_func(name, bitd, 48, opt); \
+ mc_bi_w_func(name, bitd, 64, opt)
+
+mc_bi_w_funcs(pel_pixels, 8, sse4);
+mc_bi_w_func(pel_pixels, 8, 6, sse4);
+mc_bi_w_funcs(epel_h, 8, sse4);
+mc_bi_w_func(epel_h, 8, 6, sse4);
+mc_bi_w_funcs(epel_v, 8, sse4);
+mc_bi_w_func(epel_v, 8, 6, sse4);
+mc_bi_w_funcs(epel_hv, 8, sse4);
+mc_bi_w_func(epel_hv, 8, 6, sse4);
+mc_bi_w_funcs(qpel_h, 8, sse4);
+mc_bi_w_funcs(qpel_v, 8, sse4);
+mc_bi_w_funcs(qpel_hv, 8, sse4);
+
+mc_bi_w_funcs(pel_pixels, 10, sse4);
+mc_bi_w_func(pel_pixels, 10, 6, sse4);
+mc_bi_w_funcs(epel_h, 10, sse4);
+mc_bi_w_func(epel_h, 10, 6, sse4);
+mc_bi_w_funcs(epel_v, 10, sse4);
+mc_bi_w_func(epel_v, 10, 6, sse4);
+mc_bi_w_funcs(epel_hv, 10, sse4);
+mc_bi_w_func(epel_hv, 10, 6, sse4);
+mc_bi_w_funcs(qpel_h, 10, sse4);
+mc_bi_w_funcs(qpel_v, 10, sse4);
+mc_bi_w_funcs(qpel_hv, 10, sse4);
+
+#endif //ARCH_X86_64 && HAVE_SSE4_EXTERNAL
+
+
+#define EPEL_LINKS(pointer, my, mx, fname, bitd, opt ) \
+ PEL_LINK(pointer, 1, my , mx , fname##4 , bitd, sse4 ); \
+ PEL_LINK(pointer, 2, my , mx , fname##6 , bitd, sse4 ); \
+ PEL_LINK(pointer, 3, my , mx , fname##8 , bitd, sse4 ); \
+ PEL_LINK(pointer, 4, my , mx , fname##12, bitd, sse4 ); \
+ PEL_LINK(pointer, 5, my , mx , fname##16, bitd, sse4 ); \
+ PEL_LINK(pointer, 6, my , mx , fname##24, bitd, sse4 ); \
+ PEL_LINK(pointer, 7, my , mx , fname##32, bitd, sse4 ); \
+ PEL_LINK(pointer, 8, my , mx , fname##48, bitd, sse4 ); \
+ PEL_LINK(pointer, 9, my , mx , fname##64, bitd, sse4 )
+#define QPEL_LINKS(pointer, my, mx, fname, bitd, sse4) \
+ PEL_LINK(pointer, 1, my , mx , fname##4 , bitd, sse4 ); \
+ PEL_LINK(pointer, 3, my , mx , fname##8 , bitd, sse4 ); \
+ PEL_LINK(pointer, 4, my , mx , fname##12, bitd, sse4 ); \
+ PEL_LINK(pointer, 5, my , mx , fname##16, bitd, sse4 ); \
+ PEL_LINK(pointer, 6, my , mx , fname##24, bitd, sse4 ); \
+ PEL_LINK(pointer, 7, my , mx , fname##32, bitd, sse4 ); \
+ PEL_LINK(pointer, 8, my , mx , fname##48, bitd, sse4 ); \
+ PEL_LINK(pointer, 9, my , mx , fname##64, bitd, sse4 )
+
+
+void ff_hevcdsp_init_x86(HEVCDSPContext *c, const int bit_depth)
+{
+ int mm_flags = av_get_cpu_flags();
+
+ if (bit_depth == 8) {
+ if (EXTERNAL_SSE4(mm_flags) && ARCH_X86_64) {
+
+ EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 8, sse4);
+ EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h, 8, sse4);
+ EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v, 8, sse4);
+ EPEL_LINKS(c->put_hevc_epel, 1, 1, epel_hv, 8, sse4);
+
+ QPEL_LINKS(c->put_hevc_qpel, 0, 0, pel_pixels, 8, sse4);
+ QPEL_LINKS(c->put_hevc_qpel, 0, 1, qpel_h, 8, sse4);
+ QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v, 8, sse4);
+ QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv, 8, sse4);
+
+ }
+ } else if (bit_depth == 10) {
+ if (EXTERNAL_SSE4(mm_flags) && ARCH_X86_64) {
+
+ EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4);
+ EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h, 10, sse4);
+ EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v, 10, sse4);
+ EPEL_LINKS(c->put_hevc_epel, 1, 1, epel_hv, 10, sse4);
+
+ QPEL_LINKS(c->put_hevc_qpel, 0, 0, pel_pixels, 10, sse4);
+ QPEL_LINKS(c->put_hevc_qpel, 0, 1, qpel_h, 10, sse4);
+ QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v, 10, sse4);
+ QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv, 10, sse4);
+ }
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm
index 4eaba6eaca4..171c77b9285 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm
@@ -6,7 +6,7 @@
;* Copyright (c) 2002 Zdenek Kabelac <kabi@informatics.muni.cz>
;* Copyright (c) 2013 Daniel Kang
;*
-;* MMX optimized hpel functions
+;* SIMD-optimized halfpel functions
;*
;* This file is part of FFmpeg.
;*
@@ -32,7 +32,7 @@ cextern pb_1
SECTION_TEXT
-; put_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_put_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro PUT_PIXELS8_X2 0
cglobal put_pixels8_x2, 4,5
lea r4, [r2*2]
@@ -64,7 +64,7 @@ INIT_MMX 3dnow
PUT_PIXELS8_X2
-; put_pixels16_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_put_pixels16_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro PUT_PIXELS_16 0
cglobal put_pixels16_x2, 4,5
lea r4, [r2*2]
@@ -108,7 +108,7 @@ INIT_MMX 3dnow
PUT_PIXELS_16
-; put_no_rnd_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_put_no_rnd_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro PUT_NO_RND_PIXELS8_X2 0
cglobal put_no_rnd_pixels8_x2, 4,5
mova m6, [pb_1]
@@ -149,7 +149,7 @@ INIT_MMX 3dnow
PUT_NO_RND_PIXELS8_X2
-; put_no_rnd_pixels8_x2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_put_no_rnd_pixels8_x2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro PUT_NO_RND_PIXELS8_X2_EXACT 0
cglobal put_no_rnd_pixels8_x2_exact, 4,5
lea r4, [r2*3]
@@ -196,7 +196,7 @@ INIT_MMX 3dnow
PUT_NO_RND_PIXELS8_X2_EXACT
-; put_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_put_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro PUT_PIXELS8_Y2 0
cglobal put_pixels8_y2, 4,5
lea r4, [r2*2]
@@ -230,7 +230,7 @@ INIT_MMX 3dnow
PUT_PIXELS8_Y2
-; put_no_rnd_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_put_no_rnd_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro PUT_NO_RND_PIXELS8_Y2 0
cglobal put_no_rnd_pixels8_y2, 4,5
mova m6, [pb_1]
@@ -267,7 +267,7 @@ INIT_MMX 3dnow
PUT_NO_RND_PIXELS8_Y2
-; put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro PUT_NO_RND_PIXELS8_Y2_EXACT 0
cglobal put_no_rnd_pixels8_y2_exact, 4,5
lea r4, [r2*3]
@@ -309,7 +309,7 @@ INIT_MMX 3dnow
PUT_NO_RND_PIXELS8_Y2_EXACT
-; avg_pixels8(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_avg_pixels8(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro AVG_PIXELS8 0
cglobal avg_pixels8, 4,5
lea r4, [r2*2]
@@ -339,7 +339,7 @@ INIT_MMX 3dnow
AVG_PIXELS8
-; avg_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_avg_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro AVG_PIXELS8_X2 0
cglobal avg_pixels8_x2, 4,5
lea r4, [r2*2]
@@ -375,7 +375,7 @@ INIT_MMX 3dnow
AVG_PIXELS8_X2
-; avg_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_avg_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro AVG_PIXELS8_Y2 0
cglobal avg_pixels8_y2, 4,5
lea r4, [r2*2]
@@ -417,7 +417,7 @@ INIT_MMX 3dnow
AVG_PIXELS8_Y2
-; avg_pixels8_xy2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
+; void ff_avg_pixels8_xy2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro AVG_PIXELS8_XY2 0
cglobal avg_pixels8_xy2, 4,5
mova m6, [pb_1]
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.h b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.h
new file mode 100644
index 00000000000..bfa849c0cf2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.h
@@ -0,0 +1,38 @@
+/*
+ * 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_X86_HPELDSP_H
+#define AVCODEC_X86_HPELDSP_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+void ff_avg_pixels8_x2_mmx(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+
+void ff_avg_pixels8_xy2_mmx(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_avg_pixels16_xy2_mmx(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+
+void ff_put_pixels8_xy2_mmx(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+void ff_put_pixels16_xy2_mmx(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h);
+
+#endif /* AVCODEC_X86_HPELDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c
index 8ecf9091338..f860533f7e5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c
@@ -1,5 +1,5 @@
/*
- * MMX optimized DSP utils
+ * SIMD-optimized halfpel functions
* Copyright (c) 2000, 2001 Fabrice Bellard
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
@@ -22,11 +22,15 @@
* MMX optimization by Nick Kurshev <nickols_k@mail.ru>
*/
+#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/hpeldsp.h"
-#include "dsputil_x86.h"
+#include "libavcodec/pixels.h"
+#include "fpel.h"
+#include "hpeldsp.h"
void ff_put_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h);
@@ -107,11 +111,11 @@ void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels,
#undef PAVGB
#undef STATIC
-PIXELS16(static, avg_no_rnd, , _y2, _mmx)
-PIXELS16(static, put_no_rnd, , _y2, _mmx)
+CALL_2X_PIXELS(avg_no_rnd_pixels16_y2_mmx, avg_no_rnd_pixels8_y2_mmx, 8)
+CALL_2X_PIXELS(put_no_rnd_pixels16_y2_mmx, put_no_rnd_pixels8_y2_mmx, 8)
-PIXELS16(static, avg_no_rnd, , _xy2, _mmx)
-PIXELS16(static, put_no_rnd, , _xy2, _mmx)
+CALL_2X_PIXELS(avg_no_rnd_pixels16_xy2_mmx, avg_no_rnd_pixels8_xy2_mmx, 8)
+CALL_2X_PIXELS(put_no_rnd_pixels16_xy2_mmx, put_no_rnd_pixels8_xy2_mmx, 8)
/***********************************/
/* MMX rounding */
@@ -124,26 +128,35 @@ PIXELS16(static, put_no_rnd, , _xy2, _mmx)
#include "hpeldsp_rnd_template.c"
#undef DEF
+#define DEF(x, y) ff_ ## x ## _ ## y ## _mmx
+#define STATIC
+
+#include "rnd_template.c"
+
+#undef DEF
#undef SET_RND
#undef PAVGBP
#undef PAVGB
-PIXELS16(static, avg, , _y2, _mmx)
-PIXELS16(static, put, , _y2, _mmx)
+CALL_2X_PIXELS(avg_pixels16_y2_mmx, avg_pixels8_y2_mmx, 8)
+CALL_2X_PIXELS(put_pixels16_y2_mmx, put_pixels8_y2_mmx, 8)
+
+CALL_2X_PIXELS_EXPORT(ff_avg_pixels16_xy2_mmx, ff_avg_pixels8_xy2_mmx, 8)
+CALL_2X_PIXELS_EXPORT(ff_put_pixels16_xy2_mmx, ff_put_pixels8_xy2_mmx, 8)
#endif /* HAVE_INLINE_ASM */
#if HAVE_YASM
-#define HPELDSP_AVG_PIXELS16(CPUEXT) \
- PIXELS16(static, put_no_rnd, ff_, _x2, CPUEXT) \
- PIXELS16(static, put, ff_, _y2, CPUEXT) \
- PIXELS16(static, put_no_rnd, ff_, _y2, CPUEXT) \
- PIXELS16(static, avg, ff_, , CPUEXT) \
- PIXELS16(static, avg, ff_, _x2, CPUEXT) \
- PIXELS16(static, avg, ff_, _y2, CPUEXT) \
- PIXELS16(static, avg, ff_, _xy2, CPUEXT)
+#define HPELDSP_AVG_PIXELS16(CPUEXT) \
+ CALL_2X_PIXELS(put_no_rnd_pixels16_x2 ## CPUEXT, ff_put_no_rnd_pixels8_x2 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(put_pixels16_y2 ## CPUEXT, ff_put_pixels8_y2 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(put_no_rnd_pixels16_y2 ## CPUEXT, ff_put_no_rnd_pixels8_y2 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(avg_pixels16 ## CPUEXT, ff_avg_pixels8 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(avg_pixels16_x2 ## CPUEXT, ff_avg_pixels8_x2 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(avg_pixels16_y2 ## CPUEXT, ff_avg_pixels8_y2 ## CPUEXT, 8) \
+ CALL_2X_PIXELS(avg_pixels16_xy2 ## CPUEXT, ff_avg_pixels8_xy2 ## CPUEXT, 8)
HPELDSP_AVG_PIXELS16(_3dnow)
HPELDSP_AVG_PIXELS16(_mmxext)
@@ -251,7 +264,7 @@ static void hpeldsp_init_sse2(HpelDSPContext *c, int flags, int cpu_flags)
#endif /* HAVE_SSE2_EXTERNAL */
}
-void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
+av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
{
int cpu_flags = av_get_cpu_flags();
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_mmx.c b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_mmx.c
index 50db36dc1b1..039ba776a23 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_mmx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_mmx.c
@@ -24,7 +24,8 @@
#include <stdint.h>
#include "config.h"
-#include "dsputil_x86.h"
+#include "hpeldsp.h"
+#include "inline_asm.h"
#if HAVE_MMX_INLINE
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_rnd_template.c b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_rnd_template.c
index 94e06d820a4..c8a68fdf56b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_rnd_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_rnd_template.c
@@ -1,5 +1,5 @@
/*
- * DSP utils mmx functions are compiled twice for rnd/no_rnd
+ * SIMD-optimized halfpel functions are compiled twice for rnd/no_rnd
* Copyright (c) 2000, 2001 Fabrice Bellard
* Copyright (c) 2003-2004 Michael Niedermayer <michaelni@gmx.at>
*
@@ -24,6 +24,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <stddef.h>
+#include <stdint.h>
+
// put_pixels
static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/idct_sse2_xvid.c b/chromium/third_party/ffmpeg/libavcodec/x86/idct_sse2_xvid.c
index af4790ca92c..a1810990cc4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/idct_sse2_xvid.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/idct_sse2_xvid.c
@@ -147,7 +147,7 @@ DECLARE_ASM_CONST(16, int32_t, walkenIdctRounders)[] = {
#endif
-#define ROUND(x) "paddd "MANGLE(x)
+#define ROUND(x) "paddd "x
#define JZ(reg, to) \
"testl "reg","reg" \n\t" \
@@ -343,17 +343,17 @@ DECLARE_ASM_CONST(16, int32_t, walkenIdctRounders)[] = {
"movdqa %%xmm6, 4*16("dct") \n\t" \
"movdqa "SREG2", 7*16("dct") \n\t"
-inline void ff_idct_xvid_sse2(short *block)
+av_extern_inline void ff_idct_xvid_sse2(short *block)
{
__asm__ volatile(
"movq "MANGLE(m127)", %%mm0 \n\t"
- iMTX_MULT("(%0)", MANGLE(iTab1), ROUND(walkenIdctRounders), PUT_EVEN(ROW0))
- iMTX_MULT("1*16(%0)", MANGLE(iTab2), ROUND(walkenIdctRounders+1*16), PUT_ODD(ROW1))
- iMTX_MULT("2*16(%0)", MANGLE(iTab3), ROUND(walkenIdctRounders+2*16), PUT_EVEN(ROW2))
+ iMTX_MULT("(%0)", MANGLE(iTab1), ROUND(MANGLE(walkenIdctRounders)), PUT_EVEN(ROW0))
+ iMTX_MULT("1*16(%0)", MANGLE(iTab2), ROUND("1*16+"MANGLE(walkenIdctRounders)), PUT_ODD(ROW1))
+ iMTX_MULT("2*16(%0)", MANGLE(iTab3), ROUND("2*16+"MANGLE(walkenIdctRounders)), PUT_EVEN(ROW2))
TEST_TWO_ROWS("3*16(%0)", "4*16(%0)", "%%eax", "%%ecx", CLEAR_ODD(ROW3), CLEAR_EVEN(ROW4))
JZ("%%eax", "1f")
- iMTX_MULT("3*16(%0)", MANGLE(iTab4), ROUND(walkenIdctRounders+3*16), PUT_ODD(ROW3))
+ iMTX_MULT("3*16(%0)", MANGLE(iTab4), ROUND("3*16+"MANGLE(walkenIdctRounders)), PUT_ODD(ROW3))
TEST_TWO_ROWS("5*16(%0)", "6*16(%0)", "%%eax", "%%edx", CLEAR_ODD(ROW5), CLEAR_EVEN(ROW6))
TEST_ONE_ROW("7*16(%0)", "%%esi", CLEAR_ODD(ROW7))
@@ -368,20 +368,20 @@ inline void ff_idct_xvid_sse2(short *block)
"2: \n\t"
iMTX_MULT("4*16(%0)", MANGLE(iTab1), "#", PUT_EVEN(ROW4))
"3: \n\t"
- iMTX_MULT("5*16(%0)", MANGLE(iTab4), ROUND(walkenIdctRounders+4*16), PUT_ODD(ROW5))
+ iMTX_MULT("5*16(%0)", MANGLE(iTab4), ROUND("4*16+"MANGLE(walkenIdctRounders)), PUT_ODD(ROW5))
JZ("%%edx", "1f")
"4: \n\t"
- iMTX_MULT("6*16(%0)", MANGLE(iTab3), ROUND(walkenIdctRounders+5*16), PUT_EVEN(ROW6))
+ iMTX_MULT("6*16(%0)", MANGLE(iTab3), ROUND("5*16+"MANGLE(walkenIdctRounders)), PUT_EVEN(ROW6))
JZ("%%esi", "1f")
"5: \n\t"
- iMTX_MULT("7*16(%0)", MANGLE(iTab2), ROUND(walkenIdctRounders+5*16), PUT_ODD(ROW7))
+ iMTX_MULT("7*16(%0)", MANGLE(iTab2), ROUND("5*16+"MANGLE(walkenIdctRounders)), PUT_ODD(ROW7))
#if ARCH_X86_32
iLLM_HEAD
#endif
iLLM_PASS("%0")
"6: \n\t"
: "+r"(block)
- :
+ : NAMED_CONSTRAINTS_ARRAY(m127,iTab1,walkenIdctRounders,iTab2,iTab3,iTab4,tan3,tan1,tan2,sqrt2)
: XMM_CLOBBERS("%xmm0" , "%xmm1" , "%xmm2" , "%xmm3" ,
"%xmm4" , "%xmm5" , "%xmm6" , "%xmm7" ,)
#if ARCH_X86_64
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/imdct36.asm b/chromium/third_party/ffmpeg/libavcodec/x86/imdct36.asm
index d311fbe1a02..ce30b421036 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/imdct36.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/imdct36.asm
@@ -50,7 +50,7 @@ ps_cosh_sse3: dd 1.0, -0.50190991877167369479, 1.0, -5.73685662283492756461
dd 1.0, -0.51763809020504152469, 1.0, -1.93185165257813657349
dd 1.0, -0.55168895948124587824, -1.0, 1.18310079157624925896
dd 1.0, -0.61038729438072803416, -1.0, 0.87172339781054900991
- dd 1.0, 0.70710678118654752439, 0.0, 0.0
+ dd 1.0, -0.70710678118654752439, 0.0, 0.0
costabs: times 4 dd 0.98480773
times 4 dd 0.93969262
@@ -129,6 +129,19 @@ SECTION_TEXT
%endif
%endmacro
+%macro BUTTERF2 3
+%if cpuflag(sse3)
+ mulps %1, %1, [ps_cosh_sse3 + %3]
+ PSHUFD %2, %1, 0xe1
+ addsubps %1, %1, %2
+%else
+ mulps %1, [ps_cosh + %3]
+ PSHUFD %2, %1, 0xe1
+ xorps %1, [ps_p1m1p1m1]
+ addps %1, %2
+%endif
+%endmacro
+
%macro STORE 4
movhlps %2, %1
movss [%3 ], %1
@@ -279,11 +292,7 @@ cglobal imdct36_float, 4,4,9, out, buf, in, win
BUTTERF m7, m2, 16
BUTTERF m3, m6, 32
BUTTERF m4, m1, 48
-
- mulps m5, m5, [ps_cosh + 64]
- PSHUFD m1, m5, 0xe1
- xorps m5, m5, [ps_p1m1p1m1]
- addps m5, m5, m1
+ BUTTERF2 m5, m1, 64
; permutates:
; m0 0 1 2 3 => 2 6 10 14 m1
@@ -358,8 +367,10 @@ cglobal imdct36_float, 4,4,9, out, buf, in, win
RET
%endmacro
+%if ARCH_X86_32
INIT_XMM sse
DEFINE_IMDCT
+%endif
INIT_XMM sse2
DEFINE_IMDCT
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/inline_asm.h b/chromium/third_party/ffmpeg/libavcodec/x86/inline_asm.h
new file mode 100644
index 00000000000..c2f1bf0f9cf
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/inline_asm.h
@@ -0,0 +1,100 @@
+/*
+ * inline assembly helper macros
+ *
+ * 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_X86_INLINE_ASM_H
+#define AVCODEC_X86_INLINE_ASM_H
+
+#include "constants.h"
+
+#define MOVQ_WONE(regd) \
+ __asm__ volatile ( \
+ "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
+ "psrlw $15, %%" #regd ::)
+
+#define JUMPALIGN() __asm__ volatile (".p2align 3"::)
+#define MOVQ_ZERO(regd) __asm__ volatile ("pxor %%"#regd", %%"#regd ::)
+
+#define MOVQ_BFE(regd) \
+ __asm__ volatile ( \
+ "pcmpeqd %%"#regd", %%"#regd" \n\t" \
+ "paddb %%"#regd", %%"#regd" \n\t" ::)
+
+#ifndef PIC
+#define MOVQ_WTWO(regd) __asm__ volatile ("movq %0, %%"#regd" \n\t" :: "m"(ff_wtwo))
+#else
+// for shared library it's better to use this way for accessing constants
+// pcmpeqd -> -1
+#define MOVQ_WTWO(regd) \
+ __asm__ volatile ( \
+ "pcmpeqd %%"#regd", %%"#regd" \n\t" \
+ "psrlw $15, %%"#regd" \n\t" \
+ "psllw $1, %%"#regd" \n\t"::)
+
+#endif
+
+// using regr as temporary and for the output result
+// first argument is unmodifed and second is trashed
+// regfe is supposed to contain 0xfefefefefefefefe
+#define PAVGB_MMX_NO_RND(rega, regb, regr, regfe) \
+ "movq "#rega", "#regr" \n\t" \
+ "pand "#regb", "#regr" \n\t" \
+ "pxor "#rega", "#regb" \n\t" \
+ "pand "#regfe", "#regb" \n\t" \
+ "psrlq $1, "#regb" \n\t" \
+ "paddb "#regb", "#regr" \n\t"
+
+#define PAVGB_MMX(rega, regb, regr, regfe) \
+ "movq "#rega", "#regr" \n\t" \
+ "por "#regb", "#regr" \n\t" \
+ "pxor "#rega", "#regb" \n\t" \
+ "pand "#regfe", "#regb" \n\t" \
+ "psrlq $1, "#regb" \n\t" \
+ "psubb "#regb", "#regr" \n\t"
+
+// mm6 is supposed to contain 0xfefefefefefefefe
+#define PAVGBP_MMX_NO_RND(rega, regb, regr, regc, regd, regp) \
+ "movq "#rega", "#regr" \n\t" \
+ "movq "#regc", "#regp" \n\t" \
+ "pand "#regb", "#regr" \n\t" \
+ "pand "#regd", "#regp" \n\t" \
+ "pxor "#rega", "#regb" \n\t" \
+ "pxor "#regc", "#regd" \n\t" \
+ "pand %%mm6, "#regb" \n\t" \
+ "pand %%mm6, "#regd" \n\t" \
+ "psrlq $1, "#regb" \n\t" \
+ "psrlq $1, "#regd" \n\t" \
+ "paddb "#regb", "#regr" \n\t" \
+ "paddb "#regd", "#regp" \n\t"
+
+#define PAVGBP_MMX(rega, regb, regr, regc, regd, regp) \
+ "movq "#rega", "#regr" \n\t" \
+ "movq "#regc", "#regp" \n\t" \
+ "por "#regb", "#regr" \n\t" \
+ "por "#regd", "#regp" \n\t" \
+ "pxor "#rega", "#regb" \n\t" \
+ "pxor "#regc", "#regd" \n\t" \
+ "pand %%mm6, "#regb" \n\t" \
+ "pand %%mm6, "#regd" \n\t" \
+ "psrlq $1, "#regd" \n\t" \
+ "psrlq $1, "#regb" \n\t" \
+ "psubb "#regb", "#regr" \n\t" \
+ "psubb "#regd", "#regp" \n\t"
+
+#endif /* AVCODEC_X86_INLINE_ASM_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp.asm
new file mode 100644
index 00000000000..bacc1e927a8
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp.asm
@@ -0,0 +1,292 @@
+;******************************************************************************
+;* SIMD lossless video DSP utils
+;* Copyright (c) 2008 Loren Merritt
+;* Copyright (c) 2014 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 "libavutil/x86/x86util.asm"
+
+SECTION_RODATA
+
+pb_ef: times 8 db 14,15
+pb_67: times 8 db 6, 7
+pb_zzzz2323zzzzabab: db -1,-1,-1,-1, 2, 3, 2, 3,-1,-1,-1,-1,10,11,10,11
+pb_zzzzzzzz67676767: db -1,-1,-1,-1,-1,-1,-1,-1, 6, 7, 6, 7, 6, 7, 6, 7
+
+SECTION_TEXT
+
+%macro INT16_LOOP 2 ; %1 = a/u (aligned/unaligned), %2 = add/sub
+ movd m4, maskd
+ SPLATW m4, m4
+ add wd, wd
+ test wq, 2*mmsize - 1
+ jz %%.tomainloop
+%%.wordloop:
+ sub wq, 2
+%ifidn %2, add
+ mov ax, [srcq+wq]
+ add ax, [dstq+wq]
+%else
+ mov ax, [src1q+wq]
+ sub ax, [src2q+wq]
+%endif
+ and ax, maskw
+ mov [dstq+wq], ax
+ test wq, 2*mmsize - 1
+ jnz %%.wordloop
+%%.tomainloop:
+%ifidn %2, add
+ add srcq, wq
+%else
+ add src1q, wq
+ add src2q, wq
+%endif
+ add dstq, wq
+ neg wq
+ jz %%.end
+%%.loop:
+%ifidn %2, add
+ mov%1 m0, [srcq+wq]
+ mov%1 m1, [dstq+wq]
+ mov%1 m2, [srcq+wq+mmsize]
+ mov%1 m3, [dstq+wq+mmsize]
+%else
+ mov%1 m0, [src1q+wq]
+ mov%1 m1, [src2q+wq]
+ mov%1 m2, [src1q+wq+mmsize]
+ mov%1 m3, [src2q+wq+mmsize]
+%endif
+ p%2w m0, m1
+ p%2w m2, m3
+ pand m0, m4
+ pand m2, m4
+ mov%1 [dstq+wq] , m0
+ mov%1 [dstq+wq+mmsize], m2
+ add wq, 2*mmsize
+ jl %%.loop
+%%.end:
+ RET
+%endmacro
+
+INIT_MMX mmx
+cglobal add_int16, 4,4,5, dst, src, mask, w
+ INT16_LOOP a, add
+
+INIT_XMM sse2
+cglobal add_int16, 4,4,5, dst, src, mask, w
+ test srcq, mmsize-1
+ jnz .unaligned
+ test dstq, mmsize-1
+ jnz .unaligned
+ INT16_LOOP a, add
+.unaligned:
+ INT16_LOOP u, add
+
+INIT_MMX mmx
+cglobal diff_int16, 5,5,5, dst, src1, src2, mask, w
+ INT16_LOOP a, sub
+
+INIT_XMM sse2
+cglobal diff_int16, 5,5,5, dst, src1, src2, mask, w
+ test src1q, mmsize-1
+ jnz .unaligned
+ test src2q, mmsize-1
+ jnz .unaligned
+ test dstq, mmsize-1
+ jnz .unaligned
+ INT16_LOOP a, sub
+.unaligned:
+ INT16_LOOP u, sub
+
+
+%macro ADD_HFYU_LEFT_LOOP_INT16 2 ; %1 = dst alignment (a/u), %2 = src alignment (a/u)
+ add wd, wd
+ add srcq, wq
+ add dstq, wq
+ neg wq
+%%.loop:
+ mov%2 m1, [srcq+wq]
+ mova m2, m1
+ pslld m1, 16
+ paddw m1, m2
+ mova m2, m1
+
+ pshufb m1, m3
+ paddw m1, m2
+ pshufb m0, m5
+%if mmsize == 16
+ mova m2, m1
+ pshufb m1, m4
+ paddw m1, m2
+%endif
+ paddw m0, m1
+ pand m0, m7
+%ifidn %1, a
+ 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
+ mov wd, eax
+ shl wd, 8
+ lea eax, [wd+eax-1]
+ movd m1, eax
+ pshufb m0, m1
+ movd eax, m0
+ RET
+%endmacro
+
+; int add_hfyu_left_prediction_int16(uint16_t *dst, const uint16_t *src, unsigned mask, int w, int left)
+INIT_MMX ssse3
+cglobal add_hfyu_left_prediction_int16, 4,4,8, dst, src, mask, w, left
+.skip_prologue:
+ mova m5, [pb_67]
+ mova m3, [pb_zzzz2323zzzzabab]
+ movd m0, leftm
+ psllq m0, 48
+ movd m7, maskm
+ SPLATW m7 ,m7
+ ADD_HFYU_LEFT_LOOP_INT16 a, a
+
+INIT_XMM sse4
+cglobal add_hfyu_left_prediction_int16, 4,4,8, dst, src, mask, w, left
+ mova m5, [pb_ef]
+ mova m4, [pb_zzzzzzzz67676767]
+ mova m3, [pb_zzzz2323zzzzabab]
+ movd m0, leftm
+ pslldq m0, 14
+ movd m7, maskm
+ SPLATW m7 ,m7
+ test srcq, 15
+ jnz .src_unaligned
+ test dstq, 15
+ jnz .dst_unaligned
+ ADD_HFYU_LEFT_LOOP_INT16 a, a
+.dst_unaligned:
+ ADD_HFYU_LEFT_LOOP_INT16 u, a
+.src_unaligned:
+ ADD_HFYU_LEFT_LOOP_INT16 u, u
+
+; void add_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int mask, int w, int *left, int *left_top)
+INIT_MMX mmxext
+cglobal add_hfyu_median_prediction_int16, 7,7,0, dst, top, diff, mask, w, left, left_top
+ add wd, wd
+ movd mm6, maskd
+ SPLATW mm6, mm6
+ movq mm0, [topq]
+ movq mm2, mm0
+ movd mm4, [left_topq]
+ psllq mm2, 16
+ movq mm1, mm0
+ por mm4, mm2
+ movd mm3, [leftq]
+ psubw mm0, mm4 ; t-tl
+ add dstq, wq
+ add topq, wq
+ add diffq, wq
+ neg wq
+ jmp .skip
+.loop:
+ movq mm4, [topq+wq]
+ movq mm0, mm4
+ psllq mm4, 16
+ por mm4, mm1
+ movq mm1, mm0 ; t
+ psubw mm0, mm4 ; t-tl
+.skip:
+ movq mm2, [diffq+wq]
+%assign i 0
+%rep 4
+ movq mm4, mm0
+ paddw mm4, mm3 ; t-tl+l
+ pand mm4, mm6
+ movq mm5, mm3
+ pmaxsw mm3, mm1
+ pminsw mm5, mm1
+ pminsw mm3, mm4
+ pmaxsw mm3, mm5 ; median
+ paddw mm3, mm2 ; +residual
+ pand mm3, mm6
+%if i==0
+ movq mm7, mm3
+ psllq mm7, 48
+%else
+ movq mm4, mm3
+ psrlq mm7, 16
+ psllq mm4, 48
+ por mm7, mm4
+%endif
+%if i<3
+ psrlq mm0, 16
+ psrlq mm1, 16
+ psrlq mm2, 16
+%endif
+%assign i i+1
+%endrep
+ movq [dstq+wq], mm7
+ add wq, 8
+ jl .loop
+ movzx r2d, word [dstq-2]
+ mov [leftq], r2d
+ movzx r2d, word [topq-2]
+ mov [left_topq], r2d
+ RET
+
+cglobal sub_hfyu_median_prediction_int16, 7,7,0, dst, src1, src2, mask, w, left, left_top
+ add wd, wd
+ movd mm7, maskd
+ SPLATW mm7, mm7
+ movq mm0, [src1q]
+ movq mm2, [src2q]
+ psllq mm0, 16
+ psllq mm2, 16
+ movd mm6, [left_topq]
+ por mm0, mm6
+ movd mm6, [leftq]
+ por mm2, mm6
+ xor maskq, maskq
+.loop:
+ movq mm1, [src1q + maskq]
+ movq mm3, [src2q + maskq]
+ movq mm4, mm2
+ psubw mm2, mm0
+ paddw mm2, mm1
+ pand mm2, mm7
+ movq mm5, mm4
+ pmaxsw mm4, mm1
+ pminsw mm1, mm5
+ pminsw mm4, mm2
+ pmaxsw mm4, mm1
+ psubw mm3, mm4
+ pand mm3, mm7
+ movq [dstq + maskq], mm3
+ add maskq, 8
+ movq mm0, [src1q + maskq - 2]
+ movq mm2, [src2q + maskq - 2]
+ cmp maskq, wq
+ jb .loop
+ mov maskd, [src1q + wq - 2]
+ mov [left_topq], maskd
+ mov maskd, [src2q + wq - 2]
+ mov [leftq], maskd
+ RET
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp_init.c
new file mode 100644
index 00000000000..52802e9edff
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp_init.c
@@ -0,0 +1,62 @@
+/*
+ * Lossless video DSP utils
+ *
+ * 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 "../lossless_videodsp.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/x86/cpu.h"
+
+void ff_add_int16_mmx(uint16_t *dst, const uint16_t *src, unsigned mask, int w);
+void ff_add_int16_sse2(uint16_t *dst, const uint16_t *src, unsigned mask, int w);
+void ff_diff_int16_mmx (uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w);
+void ff_diff_int16_sse2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w);
+int ff_add_hfyu_left_prediction_int16_ssse3(uint16_t *dst, const uint16_t *src, unsigned mask, int w, unsigned acc);
+int ff_add_hfyu_left_prediction_int16_sse4(uint16_t *dst, const uint16_t *src, unsigned mask, int w, unsigned acc);
+void ff_add_hfyu_median_prediction_int16_mmxext(uint16_t *dst, const uint16_t *top, const uint16_t *diff, unsigned mask, int w, int *left, int *left_top);
+void ff_sub_hfyu_median_prediction_int16_mmxext(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w, int *left, int *left_top);
+
+
+void ff_llviddsp_init_x86(LLVidDSPContext *c, AVCodecContext *avctx)
+{
+ int cpu_flags = av_get_cpu_flags();
+ const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(avctx->pix_fmt);
+
+ if (EXTERNAL_MMX(cpu_flags)) {
+ c->add_int16 = ff_add_int16_mmx;
+ c->diff_int16 = ff_diff_int16_mmx;
+ }
+
+ if (EXTERNAL_MMXEXT(cpu_flags) && pix_desc->comp[0].depth_minus1<15) {
+ c->add_hfyu_median_prediction_int16 = ff_add_hfyu_median_prediction_int16_mmxext;
+ c->sub_hfyu_median_prediction_int16 = ff_sub_hfyu_median_prediction_int16_mmxext;
+ }
+
+ if (EXTERNAL_SSE2(cpu_flags)) {
+ c->add_int16 = ff_add_int16_sse2;
+ c->diff_int16 = ff_diff_int16_sse2;
+ }
+
+ if (EXTERNAL_SSSE3(cpu_flags)) {
+ c->add_hfyu_left_prediction_int16 = ff_add_hfyu_left_prediction_int16_ssse3;
+ }
+
+ if (EXTERNAL_SSE4(cpu_flags)) {
+ c->add_hfyu_left_prediction_int16 = ff_add_hfyu_left_prediction_int16_sse4;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/lpc.c b/chromium/third_party/ffmpeg/libavcodec/x86/lpc.c
index 8a74755d1b2..3a9493f7284 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/lpc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/lpc.c
@@ -1,5 +1,5 @@
/*
- * MMX optimized LPC DSP utils
+ * SIMD-optimized LPC functions
* Copyright (c) 2007 Loren Merritt
*
* This file is part of FFmpeg.
@@ -72,6 +72,7 @@ static void lpc_apply_welch_window_sse2(const int32_t *data, int len,
"3: \n\t"
:"+&r"(i), "+&r"(j)
:"r"(w_data+n2), "r"(data+n2), "m"(c), "r"(len)
+ NAMED_CONSTRAINTS_ARRAY_ADD(pd_1,pd_2)
XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
"%xmm5", "%xmm6", "%xmm7")
);
@@ -116,6 +117,7 @@ static void lpc_compute_autocorr_sse2(const double *data, int len, int lag,
"movsd %%xmm2, 16(%1) \n\t"
:"+&r"(i)
:"r"(autoc+j), "r"(data+len), "r"(data+len-j)
+ NAMED_CONSTRAINTS_ARRAY_ADD(pd_1)
:"memory"
);
} else {
@@ -139,6 +141,7 @@ static void lpc_compute_autocorr_sse2(const double *data, int len, int lag,
"movsd %%xmm1, %2 \n\t"
:"+&r"(i), "=m"(autoc[j]), "=m"(autoc[j+1])
:"r"(data+len), "r"(data+len-j)
+ NAMED_CONSTRAINTS_ARRAY_ADD(pd_1)
);
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h b/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h
index 9c48afeb209..1cca05d658c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h
@@ -24,6 +24,7 @@
#include "config.h"
#include "libavutil/common.h"
+#include "libavutil/x86/asm.h"
#if HAVE_INLINE_ASM
@@ -88,6 +89,7 @@ static inline av_const int mid_pred(int a, int b, int c)
return i;
}
+#if HAVE_6REGS
#define COPY3_IF_LT(x, y, a, b, c, d)\
__asm__ volatile(\
"cmpl %0, %3 \n\t"\
@@ -97,10 +99,11 @@ __asm__ volatile(\
: "+&r" (x), "+&r" (a), "+r" (c)\
: "r" (y), "r" (b), "r" (d)\
);
+#endif /* HAVE_6REGS */
#endif /* HAVE_I686 */
#define MASK_ABS(mask, level) \
- __asm__ ("cltd \n\t" \
+ __asm__ ("cdq \n\t" \
"xorl %1, %0 \n\t" \
"subl %1, %0 \n\t" \
: "+a"(level), "=&d"(mask))
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mlpdsp.c b/chromium/third_party/ffmpeg/libavcodec/x86/mlpdsp.c
index 94849b7e791..b473625fb7d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mlpdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mlpdsp.c
@@ -26,7 +26,7 @@
#include "libavcodec/mlpdsp.h"
#include "libavcodec/mlp.h"
-#if HAVE_7REGS && HAVE_INLINE_ASM
+#if HAVE_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS
extern char ff_mlp_firorder_8;
extern char ff_mlp_firorder_7;
@@ -178,7 +178,7 @@ static void mlp_filter_channel_x86(int32_t *state, const int32_t *coeff,
av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
{
-#if HAVE_7REGS && HAVE_INLINE_ASM
+#if HAVE_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS
int cpu_flags = av_get_cpu_flags();
if (INLINE_MMX(cpu_flags))
c->mlp_filter_channel = mlp_filter_channel_x86;
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/motion_est.c b/chromium/third_party/ffmpeg/libavcodec/x86/motion_est.c
index 5f5d93e9bcf..f1e782b23d5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/motion_est.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/motion_est.c
@@ -27,22 +27,23 @@
#include "libavutil/mem.h"
#include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
+#include "libavcodec/mpegvideo.h"
#include "dsputil_x86.h"
#if HAVE_INLINE_ASM
-DECLARE_ASM_CONST(8, uint64_t, round_tab)[3]={
-0x0000000000000000ULL,
-0x0001000100010001ULL,
-0x0002000200020002ULL,
+DECLARE_ASM_CONST(8, uint64_t, round_tab)[3] = {
+ 0x0000000000000000ULL,
+ 0x0001000100010001ULL,
+ 0x0002000200020002ULL,
};
-DECLARE_ASM_CONST(8, uint64_t, bone)= 0x0101010101010101LL;
+DECLARE_ASM_CONST(8, uint64_t, bone) = 0x0101010101010101LL;
static inline void sad8_1_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
- x86_reg len= -(x86_reg)stride*h;
- __asm__ volatile(
+ x86_reg len = -(x86_reg)stride * h;
+ __asm__ volatile (
".p2align 4 \n\t"
"1: \n\t"
"movq (%1, %%"REG_a"), %%mm0 \n\t"
@@ -71,14 +72,13 @@ static inline void sad8_1_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
"add %3, %%"REG_a" \n\t"
" js 1b \n\t"
: "+a" (len)
- : "r" (blk1 - len), "r" (blk2 - len), "r" ((x86_reg)stride)
- );
+ : "r" (blk1 - len), "r" (blk2 - len), "r" ((x86_reg) stride));
}
static inline void sad8_1_mmxext(uint8_t *blk1, uint8_t *blk2,
int stride, int h)
{
- __asm__ volatile(
+ __asm__ volatile (
".p2align 4 \n\t"
"1: \n\t"
"movq (%1), %%mm0 \n\t"
@@ -92,14 +92,14 @@ static inline void sad8_1_mmxext(uint8_t *blk1, uint8_t *blk2,
"sub $2, %0 \n\t"
" jg 1b \n\t"
: "+r" (h), "+r" (blk1), "+r" (blk2)
- : "r" ((x86_reg)stride)
- );
+ : "r" ((x86_reg) stride));
}
-static int sad16_sse2(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)
+static int sad16_sse2(MpegEncContext *v, uint8_t *blk2, uint8_t *blk1,
+ int stride, int h)
{
int ret;
- __asm__ volatile(
+ __asm__ volatile (
"pxor %%xmm2, %%xmm2 \n\t"
".p2align 4 \n\t"
"1: \n\t"
@@ -116,16 +116,15 @@ static int sad16_sse2(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)
"movhlps %%xmm2, %%xmm0 \n\t"
"paddw %%xmm0, %%xmm2 \n\t"
"movd %%xmm2, %3 \n\t"
- : "+r" (h), "+r" (blk1), "+r" (blk2), "=r"(ret)
- : "r" ((x86_reg)stride)
- );
+ : "+r" (h), "+r" (blk1), "+r" (blk2), "=r" (ret)
+ : "r" ((x86_reg) stride));
return ret;
}
static inline void sad8_x2a_mmxext(uint8_t *blk1, uint8_t *blk2,
int stride, int h)
{
- __asm__ volatile(
+ __asm__ volatile (
".p2align 4 \n\t"
"1: \n\t"
"movq (%1), %%mm0 \n\t"
@@ -141,14 +140,13 @@ static inline void sad8_x2a_mmxext(uint8_t *blk1, uint8_t *blk2,
"sub $2, %0 \n\t"
" jg 1b \n\t"
: "+r" (h), "+r" (blk1), "+r" (blk2)
- : "r" ((x86_reg)stride)
- );
+ : "r" ((x86_reg) stride));
}
static inline void sad8_y2a_mmxext(uint8_t *blk1, uint8_t *blk2,
int stride, int h)
{
- __asm__ volatile(
+ __asm__ volatile (
"movq (%1), %%mm0 \n\t"
"add %3, %1 \n\t"
".p2align 4 \n\t"
@@ -167,14 +165,13 @@ static inline void sad8_y2a_mmxext(uint8_t *blk1, uint8_t *blk2,
"sub $2, %0 \n\t"
" jg 1b \n\t"
: "+r" (h), "+r" (blk1), "+r" (blk2)
- : "r" ((x86_reg)stride)
- );
+ : "r" ((x86_reg) stride));
}
static inline void sad8_4_mmxext(uint8_t *blk1, uint8_t *blk2,
int stride, int h)
{
- __asm__ volatile(
+ __asm__ volatile (
"movq "MANGLE(bone)", %%mm5 \n\t"
"movq (%1), %%mm0 \n\t"
"pavgb 1(%1), %%mm0 \n\t"
@@ -198,14 +195,15 @@ static inline void sad8_4_mmxext(uint8_t *blk1, uint8_t *blk2,
"sub $2, %0 \n\t"
" jg 1b \n\t"
: "+r" (h), "+r" (blk1), "+r" (blk2)
- : "r" ((x86_reg)stride)
- );
+ : "r" ((x86_reg) stride)
+ NAMED_CONSTRAINTS_ADD(bone));
}
-static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
+static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2,
+ int stride, int h)
{
- x86_reg len= -(x86_reg)stride*h;
- __asm__ volatile(
+ x86_reg len = -(x86_reg)stride * h;
+ __asm__ volatile (
".p2align 4 \n\t"
"1: \n\t"
"movq (%1, %%"REG_a"), %%mm0 \n\t"
@@ -236,15 +234,15 @@ static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int
"add %4, %%"REG_a" \n\t"
" js 1b \n\t"
: "+a" (len)
- : "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" ((x86_reg)stride)
- );
+ : "r" (blk1a - len), "r" (blk1b - len), "r" (blk2 - len),
+ "r" ((x86_reg) stride));
}
static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
- x86_reg len= -(x86_reg)stride*h;
- __asm__ volatile(
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
+ x86_reg len = -(x86_reg)stride * h;
+ __asm__ volatile (
+ "movq (%1, %%"REG_a"), %%mm0 \n\t"
"movq 1(%1, %%"REG_a"), %%mm2 \n\t"
"movq %%mm0, %%mm1 \n\t"
"movq %%mm2, %%mm3 \n\t"
@@ -256,7 +254,7 @@ static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
"paddw %%mm3, %%mm1 \n\t"
".p2align 4 \n\t"
"1: \n\t"
- "movq (%2, %%"REG_a"), %%mm2 \n\t"
+ "movq (%2, %%"REG_a"), %%mm2 \n\t"
"movq 1(%2, %%"REG_a"), %%mm4 \n\t"
"movq %%mm2, %%mm3 \n\t"
"movq %%mm4, %%mm5 \n\t"
@@ -266,7 +264,7 @@ static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
"punpckhbw %%mm7, %%mm5 \n\t"
"paddw %%mm4, %%mm2 \n\t"
"paddw %%mm5, %%mm3 \n\t"
- "movq 16+"MANGLE(round_tab)", %%mm5 \n\t"
+ "movq %5, %%mm5 \n\t"
"paddw %%mm2, %%mm0 \n\t"
"paddw %%mm3, %%mm1 \n\t"
"paddw %%mm5, %%mm0 \n\t"
@@ -289,14 +287,14 @@ static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
"add %4, %%"REG_a" \n\t"
" js 1b \n\t"
: "+a" (len)
- : "r" (blk1 - len), "r" (blk1 -len + stride), "r" (blk2 - len), "r" ((x86_reg)stride)
- );
+ : "r" (blk1 - len), "r" (blk1 - len + stride), "r" (blk2 - len),
+ "r" ((x86_reg) stride), "m" (round_tab[2]));
}
static inline int sum_mmx(void)
{
int ret;
- __asm__ volatile(
+ __asm__ volatile (
"movq %%mm6, %%mm0 \n\t"
"psrlq $32, %%mm6 \n\t"
"paddw %%mm0, %%mm6 \n\t"
@@ -304,129 +302,145 @@ static inline int sum_mmx(void)
"psrlq $16, %%mm6 \n\t"
"paddw %%mm0, %%mm6 \n\t"
"movd %%mm6, %0 \n\t"
- : "=r" (ret)
- );
- return ret&0xFFFF;
+ : "=r" (ret));
+ return ret & 0xFFFF;
}
static inline int sum_mmxext(void)
{
int ret;
- __asm__ volatile(
+ __asm__ volatile (
"movd %%mm6, %0 \n\t"
- : "=r" (ret)
- );
+ : "=r" (ret));
return ret;
}
static inline void sad8_x2a_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
- sad8_2_mmx(blk1, blk1+1, blk2, stride, h);
+ sad8_2_mmx(blk1, blk1 + 1, blk2, stride, h);
}
+
static inline void sad8_y2a_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
- sad8_2_mmx(blk1, blk1+stride, blk2, stride, h);
+ sad8_2_mmx(blk1, blk1 + stride, blk2, stride, h);
}
-
-#define PIX_SAD(suf)\
-static int sad8_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- av_assert2(h==8);\
- __asm__ volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t":);\
-\
- sad8_1_ ## suf(blk1, blk2, stride, 8);\
-\
- return sum_ ## suf();\
-}\
-static int sad8_x2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- av_assert2(h==8);\
- __asm__ volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "movq %0, %%mm5 \n\t"\
- :: "m"(round_tab[1]) \
- );\
-\
- sad8_x2a_ ## suf(blk1, blk2, stride, 8);\
-\
- return sum_ ## suf();\
-}\
-\
-static int sad8_y2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- av_assert2(h==8);\
- __asm__ volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "movq %0, %%mm5 \n\t"\
- :: "m"(round_tab[1]) \
- );\
-\
- sad8_y2a_ ## suf(blk1, blk2, stride, 8);\
-\
- return sum_ ## suf();\
-}\
-\
-static int sad8_xy2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- av_assert2(h==8);\
- __asm__ volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- ::);\
-\
- sad8_4_ ## suf(blk1, blk2, stride, 8);\
-\
- return sum_ ## suf();\
-}\
-\
-static int sad16_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- __asm__ volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t":);\
-\
- sad8_1_ ## suf(blk1 , blk2 , stride, h);\
- sad8_1_ ## suf(blk1+8, blk2+8, stride, h);\
-\
- return sum_ ## suf();\
-}\
-static int sad16_x2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- __asm__ volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "movq %0, %%mm5 \n\t"\
- :: "m"(round_tab[1]) \
- );\
-\
- sad8_x2a_ ## suf(blk1 , blk2 , stride, h);\
- sad8_x2a_ ## suf(blk1+8, blk2+8, stride, h);\
-\
- return sum_ ## suf();\
-}\
-static int sad16_y2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- __asm__ volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "movq %0, %%mm5 \n\t"\
- :: "m"(round_tab[1]) \
- );\
-\
- sad8_y2a_ ## suf(blk1 , blk2 , stride, h);\
- sad8_y2a_ ## suf(blk1+8, blk2+8, stride, h);\
-\
- return sum_ ## suf();\
-}\
-static int sad16_xy2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- __asm__ volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- ::);\
-\
- sad8_4_ ## suf(blk1 , blk2 , stride, h);\
- sad8_4_ ## suf(blk1+8, blk2+8, stride, h);\
-\
- return sum_ ## suf();\
-}\
+#define PIX_SAD(suf) \
+static int sad8_ ## suf(MpegEncContext *v, uint8_t *blk2, \
+ uint8_t *blk1, int stride, int h) \
+{ \
+ av_assert2(h == 8); \
+ __asm__ volatile ( \
+ "pxor %%mm7, %%mm7 \n\t" \
+ "pxor %%mm6, %%mm6 \n\t" \
+ :); \
+ \
+ sad8_1_ ## suf(blk1, blk2, stride, 8); \
+ \
+ return sum_ ## suf(); \
+} \
+ \
+static int sad8_x2_ ## suf(MpegEncContext *v, uint8_t *blk2, \
+ uint8_t *blk1, int stride, int h) \
+{ \
+ av_assert2(h == 8); \
+ __asm__ volatile ( \
+ "pxor %%mm7, %%mm7 \n\t" \
+ "pxor %%mm6, %%mm6 \n\t" \
+ "movq %0, %%mm5 \n\t" \
+ :: "m" (round_tab[1])); \
+ \
+ sad8_x2a_ ## suf(blk1, blk2, stride, 8); \
+ \
+ return sum_ ## suf(); \
+} \
+ \
+static int sad8_y2_ ## suf(MpegEncContext *v, uint8_t *blk2, \
+ uint8_t *blk1, int stride, int h) \
+{ \
+ av_assert2(h == 8); \
+ __asm__ volatile ( \
+ "pxor %%mm7, %%mm7 \n\t" \
+ "pxor %%mm6, %%mm6 \n\t" \
+ "movq %0, %%mm5 \n\t" \
+ :: "m" (round_tab[1])); \
+ \
+ sad8_y2a_ ## suf(blk1, blk2, stride, 8); \
+ \
+ return sum_ ## suf(); \
+} \
+ \
+static int sad8_xy2_ ## suf(MpegEncContext *v, uint8_t *blk2, \
+ uint8_t *blk1, int stride, int h) \
+{ \
+ av_assert2(h == 8); \
+ __asm__ volatile ( \
+ "pxor %%mm7, %%mm7 \n\t" \
+ "pxor %%mm6, %%mm6 \n\t" \
+ ::); \
+ \
+ sad8_4_ ## suf(blk1, blk2, stride, 8); \
+ \
+ return sum_ ## suf(); \
+} \
+ \
+static int sad16_ ## suf(MpegEncContext *v, uint8_t *blk2, \
+ uint8_t *blk1, int stride, int h) \
+{ \
+ __asm__ volatile ( \
+ "pxor %%mm7, %%mm7 \n\t" \
+ "pxor %%mm6, %%mm6 \n\t" \
+ :); \
+ \
+ sad8_1_ ## suf(blk1, blk2, stride, h); \
+ sad8_1_ ## suf(blk1 + 8, blk2 + 8, stride, h); \
+ \
+ return sum_ ## suf(); \
+} \
+ \
+static int sad16_x2_ ## suf(MpegEncContext *v, uint8_t *blk2, \
+ uint8_t *blk1, int stride, int h) \
+{ \
+ __asm__ volatile ( \
+ "pxor %%mm7, %%mm7 \n\t" \
+ "pxor %%mm6, %%mm6 \n\t" \
+ "movq %0, %%mm5 \n\t" \
+ :: "m" (round_tab[1])); \
+ \
+ sad8_x2a_ ## suf(blk1, blk2, stride, h); \
+ sad8_x2a_ ## suf(blk1 + 8, blk2 + 8, stride, h); \
+ \
+ return sum_ ## suf(); \
+} \
+ \
+static int sad16_y2_ ## suf(MpegEncContext *v, uint8_t *blk2, \
+ uint8_t *blk1, int stride, int h) \
+{ \
+ __asm__ volatile ( \
+ "pxor %%mm7, %%mm7 \n\t" \
+ "pxor %%mm6, %%mm6 \n\t" \
+ "movq %0, %%mm5 \n\t" \
+ :: "m" (round_tab[1])); \
+ \
+ sad8_y2a_ ## suf(blk1, blk2, stride, h); \
+ sad8_y2a_ ## suf(blk1 + 8, blk2 + 8, stride, h); \
+ \
+ return sum_ ## suf(); \
+} \
+ \
+static int sad16_xy2_ ## suf(MpegEncContext *v, uint8_t *blk2, \
+ uint8_t *blk1, int stride, int h) \
+{ \
+ __asm__ volatile ( \
+ "pxor %%mm7, %%mm7 \n\t" \
+ "pxor %%mm6, %%mm6 \n\t" \
+ ::); \
+ \
+ sad8_4_ ## suf(blk1, blk2, stride, h); \
+ sad8_4_ ## suf(blk1 + 8, blk2 + 8, stride, h); \
+ \
+ return sum_ ## suf(); \
+} \
PIX_SAD(mmx)
PIX_SAD(mmxext)
@@ -448,17 +462,17 @@ av_cold void ff_dsputil_init_pix_mmx(DSPContext *c, AVCodecContext *avctx)
c->pix_abs[1][2] = sad8_y2_mmx;
c->pix_abs[1][3] = sad8_xy2_mmx;
- c->sad[0]= sad16_mmx;
- c->sad[1]= sad8_mmx;
+ c->sad[0] = sad16_mmx;
+ c->sad[1] = sad8_mmx;
}
if (INLINE_MMXEXT(cpu_flags)) {
c->pix_abs[0][0] = sad16_mmxext;
c->pix_abs[1][0] = sad8_mmxext;
- c->sad[0] = sad16_mmxext;
- c->sad[1] = sad8_mmxext;
+ c->sad[0] = sad16_mmxext;
+ c->sad[1] = sad8_mmxext;
- if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
+ if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
c->pix_abs[0][1] = sad16_x2_mmxext;
c->pix_abs[0][2] = sad16_y2_mmxext;
c->pix_abs[0][3] = sad16_xy2_mmxext;
@@ -468,7 +482,7 @@ av_cold void ff_dsputil_init_pix_mmx(DSPContext *c, AVCodecContext *avctx)
}
}
if (INLINE_SSE2(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_3DNOW) && avctx->codec_id != AV_CODEC_ID_SNOW) {
- c->sad[0]= sad16_sse2;
+ c->sad[0] = sad16_sse2;
}
#endif /* HAVE_INLINE_ASM */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mpeg4qpel.asm b/chromium/third_party/ffmpeg/libavcodec/x86/mpeg4qpel.asm
index ca52375a760..dc0f900c5bd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mpeg4qpel.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mpeg4qpel.asm
@@ -33,7 +33,7 @@ cextern pw_20
SECTION_TEXT
-; put_no_rnd_pixels8_l2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
+; void ff_put_no_rnd_pixels8_l2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
%macro PUT_NO_RND_PIXELS8_L2 0
cglobal put_no_rnd_pixels8_l2, 6,6
movsxdifnidn r4, r4d
@@ -99,7 +99,7 @@ INIT_MMX mmxext
PUT_NO_RND_PIXELS8_L2
-; put_no_rnd_pixels16_l2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
+; void ff_put_no_rnd_pixels16_l2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
%macro PUT_NO_RND_PIXELS16_l2 0
cglobal put_no_rnd_pixels16_l2, 6,6
movsxdifnidn r3, r3d
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c b/chromium/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c
index 9c6f7950a5d..27231674ae7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c
@@ -1,5 +1,5 @@
/*
- * MMX optimized MP3 decoding functions
+ * SIMD-optimized MP3 decoding functions
* Copyright (c) 2010 Vitor Sessak
*
* This file is part of FFmpeg.
@@ -30,7 +30,9 @@
static void imdct36_blocks_ ## CPU(float *out, float *buf, float *in, int count, int switch_point, int block_type);\
void ff_imdct36_float_ ## CPU(float *out, float *buf, float *in, float *win);
+#if ARCH_X86_32
DECL(sse)
+#endif
DECL(sse2)
DECL(sse3)
DECL(ssse3)
@@ -43,7 +45,7 @@ void ff_four_imdct36_float_avx(float *out, float *buf, float *in, float *win,
DECLARE_ALIGNED(16, static float, mdct_win_sse)[2][4][4*40];
-#if HAVE_SSE2_INLINE
+#if HAVE_6REGS && HAVE_SSE_INLINE
#define MACS(rt, ra, rb) rt+=(ra)*(rb)
#define MLSS(rt, ra, rb) rt-=(ra)*(rb)
@@ -187,7 +189,7 @@ static void apply_window_mp3(float *in, float *win, int *unused, float *out,
*out = sum;
}
-#endif /* HAVE_SSE2_INLINE */
+#endif /* HAVE_6REGS && HAVE_SSE_INLINE */
#if HAVE_YASM
#define DECL_IMDCT_BLOCKS(CPU1, CPU2) \
@@ -223,7 +225,9 @@ static void imdct36_blocks_ ## CPU1(float *out, float *buf, float *in, \
}
#if HAVE_SSE
+#if ARCH_X86_32
DECL_IMDCT_BLOCKS(sse,sse)
+#endif
DECL_IMDCT_BLOCKS(sse2,sse)
DECL_IMDCT_BLOCKS(sse3,sse)
DECL_IMDCT_BLOCKS(ssse3,sse)
@@ -251,16 +255,19 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s)
}
}
-#if HAVE_SSE2_INLINE
- if (cpu_flags & AV_CPU_FLAG_SSE2) {
+#if HAVE_6REGS && HAVE_SSE_INLINE
+ if (INLINE_SSE(cpu_flags)) {
s->apply_window_float = apply_window_mp3;
}
-#endif /* HAVE_SSE2_INLINE */
+#endif /* HAVE_SSE_INLINE */
#if HAVE_YASM
+#if HAVE_SSE
+#if ARCH_X86_32
if (EXTERNAL_SSE(cpu_flags)) {
s->imdct36_blocks_float = imdct36_blocks_sse;
}
+#endif
if (EXTERNAL_SSE2(cpu_flags)) {
s->imdct36_blocks_float = imdct36_blocks_sse2;
}
@@ -270,8 +277,11 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s)
if (EXTERNAL_SSSE3(cpu_flags)) {
s->imdct36_blocks_float = imdct36_blocks_ssse3;
}
+#endif
+#if HAVE_AVX_EXTERNAL
if (EXTERNAL_AVX(cpu_flags)) {
s->imdct36_blocks_float = imdct36_blocks_avx;
}
+#endif
#endif /* HAVE_YASM */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideo.c b/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideo.c
index cee3d5f7df1..9353a829338 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideo.c
@@ -25,7 +25,6 @@
#include "libavutil/x86/cpu.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/mpegvideo.h"
-#include "dsputil_x86.h"
#if HAVE_MMX_INLINE
@@ -443,116 +442,6 @@ __asm__ volatile(
);
}
-static void denoise_dct_mmx(MpegEncContext *s, int16_t *block){
- const int intra= s->mb_intra;
- int *sum= s->dct_error_sum[intra];
- uint16_t *offset= s->dct_offset[intra];
-
- s->dct_count[intra]++;
-
- __asm__ volatile(
- "pxor %%mm7, %%mm7 \n\t"
- "1: \n\t"
- "pxor %%mm0, %%mm0 \n\t"
- "pxor %%mm1, %%mm1 \n\t"
- "movq (%0), %%mm2 \n\t"
- "movq 8(%0), %%mm3 \n\t"
- "pcmpgtw %%mm2, %%mm0 \n\t"
- "pcmpgtw %%mm3, %%mm1 \n\t"
- "pxor %%mm0, %%mm2 \n\t"
- "pxor %%mm1, %%mm3 \n\t"
- "psubw %%mm0, %%mm2 \n\t"
- "psubw %%mm1, %%mm3 \n\t"
- "movq %%mm2, %%mm4 \n\t"
- "movq %%mm3, %%mm5 \n\t"
- "psubusw (%2), %%mm2 \n\t"
- "psubusw 8(%2), %%mm3 \n\t"
- "pxor %%mm0, %%mm2 \n\t"
- "pxor %%mm1, %%mm3 \n\t"
- "psubw %%mm0, %%mm2 \n\t"
- "psubw %%mm1, %%mm3 \n\t"
- "movq %%mm2, (%0) \n\t"
- "movq %%mm3, 8(%0) \n\t"
- "movq %%mm4, %%mm2 \n\t"
- "movq %%mm5, %%mm3 \n\t"
- "punpcklwd %%mm7, %%mm4 \n\t"
- "punpckhwd %%mm7, %%mm2 \n\t"
- "punpcklwd %%mm7, %%mm5 \n\t"
- "punpckhwd %%mm7, %%mm3 \n\t"
- "paddd (%1), %%mm4 \n\t"
- "paddd 8(%1), %%mm2 \n\t"
- "paddd 16(%1), %%mm5 \n\t"
- "paddd 24(%1), %%mm3 \n\t"
- "movq %%mm4, (%1) \n\t"
- "movq %%mm2, 8(%1) \n\t"
- "movq %%mm5, 16(%1) \n\t"
- "movq %%mm3, 24(%1) \n\t"
- "add $16, %0 \n\t"
- "add $32, %1 \n\t"
- "add $16, %2 \n\t"
- "cmp %3, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (block), "+r" (sum), "+r" (offset)
- : "r"(block+64)
- );
-}
-
-static void denoise_dct_sse2(MpegEncContext *s, int16_t *block){
- const int intra= s->mb_intra;
- int *sum= s->dct_error_sum[intra];
- uint16_t *offset= s->dct_offset[intra];
-
- s->dct_count[intra]++;
-
- __asm__ volatile(
- "pxor %%xmm7, %%xmm7 \n\t"
- "1: \n\t"
- "pxor %%xmm0, %%xmm0 \n\t"
- "pxor %%xmm1, %%xmm1 \n\t"
- "movdqa (%0), %%xmm2 \n\t"
- "movdqa 16(%0), %%xmm3 \n\t"
- "pcmpgtw %%xmm2, %%xmm0 \n\t"
- "pcmpgtw %%xmm3, %%xmm1 \n\t"
- "pxor %%xmm0, %%xmm2 \n\t"
- "pxor %%xmm1, %%xmm3 \n\t"
- "psubw %%xmm0, %%xmm2 \n\t"
- "psubw %%xmm1, %%xmm3 \n\t"
- "movdqa %%xmm2, %%xmm4 \n\t"
- "movdqa %%xmm3, %%xmm5 \n\t"
- "psubusw (%2), %%xmm2 \n\t"
- "psubusw 16(%2), %%xmm3 \n\t"
- "pxor %%xmm0, %%xmm2 \n\t"
- "pxor %%xmm1, %%xmm3 \n\t"
- "psubw %%xmm0, %%xmm2 \n\t"
- "psubw %%xmm1, %%xmm3 \n\t"
- "movdqa %%xmm2, (%0) \n\t"
- "movdqa %%xmm3, 16(%0) \n\t"
- "movdqa %%xmm4, %%xmm6 \n\t"
- "movdqa %%xmm5, %%xmm0 \n\t"
- "punpcklwd %%xmm7, %%xmm4 \n\t"
- "punpckhwd %%xmm7, %%xmm6 \n\t"
- "punpcklwd %%xmm7, %%xmm5 \n\t"
- "punpckhwd %%xmm7, %%xmm0 \n\t"
- "paddd (%1), %%xmm4 \n\t"
- "paddd 16(%1), %%xmm6 \n\t"
- "paddd 32(%1), %%xmm5 \n\t"
- "paddd 48(%1), %%xmm0 \n\t"
- "movdqa %%xmm4, (%1) \n\t"
- "movdqa %%xmm6, 16(%1) \n\t"
- "movdqa %%xmm5, 32(%1) \n\t"
- "movdqa %%xmm0, 48(%1) \n\t"
- "add $32, %0 \n\t"
- "add $64, %1 \n\t"
- "add $32, %2 \n\t"
- "cmp %3, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (block), "+r" (sum), "+r" (offset)
- : "r"(block+64)
- XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
- "%xmm4", "%xmm5", "%xmm6", "%xmm7")
- );
-}
-
#endif /* HAVE_MMX_INLINE */
av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
@@ -568,10 +457,6 @@ av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
if(!(s->flags & CODEC_FLAG_BITEXACT))
s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_mmx;
s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_mmx;
- s->denoise_dct = denoise_dct_mmx;
- }
- if (INLINE_SSE2(cpu_flags)) {
- s->denoise_dct = denoise_dct_sse2;
}
#endif /* HAVE_MMX_INLINE */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoenc.c b/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoenc.c
index 77fc1635950..f14a268ce0a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoenc.c
@@ -26,11 +26,12 @@
#include "libavcodec/avcodec.h"
#include "libavcodec/dct.h"
#include "libavcodec/mpegvideo.h"
-#include "dsputil_x86.h"
/* not permutated inverse zigzag_direct + 1 for MMX quantizer */
DECLARE_ALIGNED(16, static uint16_t, inv_zigzag_direct16)[64];
+#if HAVE_6REGS
+
#if HAVE_MMX_INLINE
#define COMPILE_TEMPLATE_MMXEXT 0
#define COMPILE_TEMPLATE_SSE2 0
@@ -82,6 +83,120 @@ DECLARE_ALIGNED(16, static uint16_t, inv_zigzag_direct16)[64];
#include "mpegvideoenc_template.c"
#endif /* HAVE_SSSE3_INLINE */
+#endif /* HAVE_6REGS */
+
+#if HAVE_INLINE_ASM
+static void denoise_dct_mmx(MpegEncContext *s, int16_t *block){
+ const int intra= s->mb_intra;
+ int *sum= s->dct_error_sum[intra];
+ uint16_t *offset= s->dct_offset[intra];
+
+ s->dct_count[intra]++;
+
+ __asm__ volatile(
+ "pxor %%mm7, %%mm7 \n\t"
+ "1: \n\t"
+ "pxor %%mm0, %%mm0 \n\t"
+ "pxor %%mm1, %%mm1 \n\t"
+ "movq (%0), %%mm2 \n\t"
+ "movq 8(%0), %%mm3 \n\t"
+ "pcmpgtw %%mm2, %%mm0 \n\t"
+ "pcmpgtw %%mm3, %%mm1 \n\t"
+ "pxor %%mm0, %%mm2 \n\t"
+ "pxor %%mm1, %%mm3 \n\t"
+ "psubw %%mm0, %%mm2 \n\t"
+ "psubw %%mm1, %%mm3 \n\t"
+ "movq %%mm2, %%mm4 \n\t"
+ "movq %%mm3, %%mm5 \n\t"
+ "psubusw (%2), %%mm2 \n\t"
+ "psubusw 8(%2), %%mm3 \n\t"
+ "pxor %%mm0, %%mm2 \n\t"
+ "pxor %%mm1, %%mm3 \n\t"
+ "psubw %%mm0, %%mm2 \n\t"
+ "psubw %%mm1, %%mm3 \n\t"
+ "movq %%mm2, (%0) \n\t"
+ "movq %%mm3, 8(%0) \n\t"
+ "movq %%mm4, %%mm2 \n\t"
+ "movq %%mm5, %%mm3 \n\t"
+ "punpcklwd %%mm7, %%mm4 \n\t"
+ "punpckhwd %%mm7, %%mm2 \n\t"
+ "punpcklwd %%mm7, %%mm5 \n\t"
+ "punpckhwd %%mm7, %%mm3 \n\t"
+ "paddd (%1), %%mm4 \n\t"
+ "paddd 8(%1), %%mm2 \n\t"
+ "paddd 16(%1), %%mm5 \n\t"
+ "paddd 24(%1), %%mm3 \n\t"
+ "movq %%mm4, (%1) \n\t"
+ "movq %%mm2, 8(%1) \n\t"
+ "movq %%mm5, 16(%1) \n\t"
+ "movq %%mm3, 24(%1) \n\t"
+ "add $16, %0 \n\t"
+ "add $32, %1 \n\t"
+ "add $16, %2 \n\t"
+ "cmp %3, %0 \n\t"
+ " jb 1b \n\t"
+ : "+r" (block), "+r" (sum), "+r" (offset)
+ : "r"(block+64)
+ );
+}
+
+static void denoise_dct_sse2(MpegEncContext *s, int16_t *block){
+ const int intra= s->mb_intra;
+ int *sum= s->dct_error_sum[intra];
+ uint16_t *offset= s->dct_offset[intra];
+
+ s->dct_count[intra]++;
+
+ __asm__ volatile(
+ "pxor %%xmm7, %%xmm7 \n\t"
+ "1: \n\t"
+ "pxor %%xmm0, %%xmm0 \n\t"
+ "pxor %%xmm1, %%xmm1 \n\t"
+ "movdqa (%0), %%xmm2 \n\t"
+ "movdqa 16(%0), %%xmm3 \n\t"
+ "pcmpgtw %%xmm2, %%xmm0 \n\t"
+ "pcmpgtw %%xmm3, %%xmm1 \n\t"
+ "pxor %%xmm0, %%xmm2 \n\t"
+ "pxor %%xmm1, %%xmm3 \n\t"
+ "psubw %%xmm0, %%xmm2 \n\t"
+ "psubw %%xmm1, %%xmm3 \n\t"
+ "movdqa %%xmm2, %%xmm4 \n\t"
+ "movdqa %%xmm3, %%xmm5 \n\t"
+ "psubusw (%2), %%xmm2 \n\t"
+ "psubusw 16(%2), %%xmm3 \n\t"
+ "pxor %%xmm0, %%xmm2 \n\t"
+ "pxor %%xmm1, %%xmm3 \n\t"
+ "psubw %%xmm0, %%xmm2 \n\t"
+ "psubw %%xmm1, %%xmm3 \n\t"
+ "movdqa %%xmm2, (%0) \n\t"
+ "movdqa %%xmm3, 16(%0) \n\t"
+ "movdqa %%xmm4, %%xmm6 \n\t"
+ "movdqa %%xmm5, %%xmm0 \n\t"
+ "punpcklwd %%xmm7, %%xmm4 \n\t"
+ "punpckhwd %%xmm7, %%xmm6 \n\t"
+ "punpcklwd %%xmm7, %%xmm5 \n\t"
+ "punpckhwd %%xmm7, %%xmm0 \n\t"
+ "paddd (%1), %%xmm4 \n\t"
+ "paddd 16(%1), %%xmm6 \n\t"
+ "paddd 32(%1), %%xmm5 \n\t"
+ "paddd 48(%1), %%xmm0 \n\t"
+ "movdqa %%xmm4, (%1) \n\t"
+ "movdqa %%xmm6, 16(%1) \n\t"
+ "movdqa %%xmm5, 32(%1) \n\t"
+ "movdqa %%xmm0, 48(%1) \n\t"
+ "add $32, %0 \n\t"
+ "add $64, %1 \n\t"
+ "add $32, %2 \n\t"
+ "cmp %3, %0 \n\t"
+ " jb 1b \n\t"
+ : "+r" (block), "+r" (sum), "+r" (offset)
+ : "r"(block+64)
+ XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
+ "%xmm4", "%xmm5", "%xmm6", "%xmm7")
+ );
+}
+#endif /* HAVE_INLINE_ASM */
+
av_cold void ff_dct_encode_init_x86(MpegEncContext *s)
{
const int dct_algo = s->avctx->dct_algo;
@@ -93,18 +208,26 @@ av_cold void ff_dct_encode_init_x86(MpegEncContext *s)
if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
#if HAVE_MMX_INLINE
int cpu_flags = av_get_cpu_flags();
- if (INLINE_MMX(cpu_flags))
+ if (INLINE_MMX(cpu_flags)) {
+#if HAVE_6REGS
s->dct_quantize = dct_quantize_MMX;
#endif
-#if HAVE_MMXEXT_INLINE
+ s->denoise_dct = denoise_dct_mmx;
+ }
+#endif
+#if HAVE_6REGS && HAVE_MMXEXT_INLINE
if (INLINE_MMXEXT(cpu_flags))
s->dct_quantize = dct_quantize_MMXEXT;
#endif
#if HAVE_SSE2_INLINE
- if (INLINE_SSE2(cpu_flags))
+ if (INLINE_SSE2(cpu_flags)) {
+#if HAVE_6REGS
s->dct_quantize = dct_quantize_SSE2;
#endif
-#if HAVE_SSSE3_INLINE
+ s->denoise_dct = denoise_dct_sse2;
+ }
+#endif
+#if HAVE_6REGS && HAVE_SSSE3_INLINE
if (INLINE_SSSE3(cpu_flags))
s->dct_quantize = dct_quantize_SSSE3;
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c b/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c
index 0defc404fe2..76a5c5a154c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c
@@ -20,6 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <stdint.h>
+
+#include "libavutil/internal.h"
+#include "libavutil/x86/asm.h"
+#include "libavcodec/mpegvideo.h"
+
#undef MMREG_WIDTH
#undef MM
#undef MOVQ
@@ -168,7 +174,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
" js 1b \n\t"
PMAX(MM"3", MM"0")
"movd "MM"3, %%"REG_a" \n\t"
- "movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1
+ "movzbl %%al, %%eax \n\t" // last_non_zero_p1
: "+a" (last_non_zero_p1)
: "r" (block+64), "r" (qmat), "r" (bias),
"r" (inv_zigzag_direct16 + 64), "r" (temp_block + 64)
@@ -202,7 +208,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
" js 1b \n\t"
PMAX(MM"3", MM"0")
"movd "MM"3, %%"REG_a" \n\t"
- "movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1
+ "movzbl %%al, %%eax \n\t" // last_non_zero_p1
: "+a" (last_non_zero_p1)
: "r" (block+64), "r" (qmat+64), "r" (bias+64),
"r" (inv_zigzag_direct16 + 64), "r" (temp_block + 64)
@@ -216,7 +222,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
"psubusw "MM"1, "MM"4 \n\t"
"packuswb "MM"4, "MM"4 \n\t"
#if COMPILE_TEMPLATE_SSE2
- "packuswb "MM"4, "MM"4 \n\t"
+ "packsswb "MM"4, "MM"4 \n\t"
#endif
"movd "MM"4, %0 \n\t" // *overflow
: "=g" (*overflow)
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/proresdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/proresdsp.asm
index aedacc2cdcc..255eb248979 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/proresdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/proresdsp.asm
@@ -231,8 +231,8 @@ section .text align=16
SUMSUB_SHPK m2, m3, m4, m5, m6, m7, %2
%endmacro
-; void prores_idct_put_10_<opt>(uint8_t *pixels, int stride,
-; int16_t *block, const int16_t *qmat);
+; void ff_prores_idct_put_10_<opt>(uint8_t *pixels, int stride,
+; int16_t *block, const int16_t *qmat);
%macro idct_put_fn 1
cglobal prores_idct_put_10, 4, 4, %1
movsxd r1, r1d
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c
index 0273d6141a7..394025b68e4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c
@@ -32,14 +32,11 @@ void ff_prores_idct_put_10_sse4(uint16_t *dst, int linesize,
void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize,
int16_t *block, const int16_t *qmat);
-av_cold void ff_proresdsp_x86_init(ProresDSPContext *dsp, AVCodecContext *avctx)
+av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
{
#if ARCH_X86_64
int cpu_flags = av_get_cpu_flags();
- if(avctx->flags & CODEC_FLAG_BITEXACT)
- return;
-
if (EXTERNAL_SSE2(cpu_flags)) {
dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
dsp->idct_put = ff_prores_idct_put_10_sse2;
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/qpel.asm b/chromium/third_party/ffmpeg/libavcodec/x86/qpel.asm
index c2ffb867176..4e72d5084ff 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/qpel.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/qpel.asm
@@ -1,5 +1,5 @@
;******************************************************************************
-;* MMX optimized DSP utils
+;* SIMD-optimized quarterpel functions
;* Copyright (c) 2008 Loren Merritt
;* Copyright (c) 2003-2013 Michael Niedermayer
;* Copyright (c) 2013 Daniel Kang
@@ -44,7 +44,8 @@ SECTION .text
mova %2, %1
%endmacro
-; void pixels4_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
+; void ff_put/avg_pixels4_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
+; int dstStride, int src1Stride, int h)
%macro PIXELS4_L2 1
%define OP op_%1h
cglobal %1_pixels4_l2, 6,6
@@ -87,7 +88,8 @@ INIT_MMX mmxext
PIXELS4_L2 put
PIXELS4_L2 avg
-; void pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
+; void ff_put/avg_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
+; int dstStride, int src1Stride, int h)
%macro PIXELS8_L2 1
%define OP op_%1
cglobal %1_pixels8_l2, 6,6
@@ -130,7 +132,8 @@ INIT_MMX mmxext
PIXELS8_L2 put
PIXELS8_L2 avg
-; void pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
+; void ff_put/avg_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
+; int dstStride, int src1Stride, int h)
%macro PIXELS16_L2 1
%define OP op_%1
cglobal %1_pixels16_l2, 6,6
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/rnd_template.c b/chromium/third_party/ffmpeg/libavcodec/x86/rnd_template.c
index e37fc19506f..c9fd71eeef9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/rnd_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/rnd_template.c
@@ -1,5 +1,5 @@
/*
- * DSP utils mmx functions are compiled twice for rnd/no_rnd
+ * SIMD-optimized halfpel functions are compiled twice for rnd/no_rnd
* Copyright (c) 2000, 2001 Fabrice Bellard
* Copyright (c) 2003-2004 Michael Niedermayer <michaelni@gmx.at>
*
@@ -27,6 +27,8 @@
#include <stddef.h>
#include <stdint.h>
+#include "inline_asm.h"
+
// put_pixels
STATIC void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/rv34dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/rv34dsp_init.c
index 027efe9668a..99c56f9d09f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/rv34dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/rv34dsp_init.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/rv40dsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/rv40dsp.asm
index 792a54f572a..24a803865fc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/rv40dsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/rv40dsp.asm
@@ -77,9 +77,9 @@ SECTION .text
;-----------------------------------------------------------------------------
; subpel MC functions:
;
-; void [put|rv40]_rv40_qpel_[h|v]_<opt>(uint8_t *dst, int deststride,
-; uint8_t *src, int srcstride,
-; int len, int m);
+; void ff_[put|rv40]_rv40_qpel_[h|v]_<opt>(uint8_t *dst, int deststride,
+; uint8_t *src, int srcstride,
+; int len, int m);
;----------------------------------------------------------------------
%macro LOAD 2
%if WIN64
@@ -438,7 +438,7 @@ FILTER_SSSE3 avg
%endmacro
-; rv40_weight_func_%1(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, int stride)
+; void ff_rv40_weight_func_%1(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, int stride)
; %1=size %2=num of xmm regs
; The weights are FP0.14 notation of fractions depending on pts.
; For timebases without rounding error (i.e. PAL), the fractions
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/rv40dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/rv40dsp_init.c
index 75ba8ba12cd..69480597b11 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/rv40dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/rv40dsp_init.c
@@ -30,7 +30,7 @@
#include "libavutil/attributes.h"
#include "libavutil/mem.h"
#include "libavutil/x86/cpu.h"
-#include "dsputil_x86.h"
+#include "hpeldsp.h"
#if HAVE_YASM
void ff_put_rv40_chroma_mc8_mmx (uint8_t *dst, uint8_t *src,
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp.asm
index adc13c43539..d556f271124 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp.asm
@@ -124,9 +124,9 @@ cglobal sbr_hf_g_filt, 5, 6, 5
.end:
RET
-; static void sbr_hf_gen_c(float (*X_high)[2], const float (*X_low)[2],
-; const float alpha0[2], const float alpha1[2],
-; float bw, int start, int end)
+; void ff_sbr_hf_gen_sse(float (*X_high)[2], const float (*X_low)[2],
+; const float alpha0[2], const float alpha1[2],
+; float bw, int start, int end)
;
cglobal sbr_hf_gen, 4,4,8, X_high, X_low, alpha0, alpha1, BW, S, E
; load alpha factors
@@ -249,7 +249,7 @@ cglobal sbr_neg_odd_64, 1,2,4,z
jne .loop
REP_RET
-; sbr_qmf_deint_bfly(float *v, const float *src0, const float *src1)
+; void ff_sbr_qmf_deint_bfly_sse2(float *v, const float *src0, const float *src1)
%macro SBR_QMF_DEINT_BFLY 0
cglobal sbr_qmf_deint_bfly, 3,5,8, v,src0,src1,vrev,c
mov cq, 64*4-2*mmsize
@@ -423,3 +423,25 @@ apply_noise_main:
add count, mmsize
jl .loop
RET
+
+INIT_XMM sse
+cglobal sbr_qmf_deint_neg, 2,4,4,v,src,vrev,c
+%define COUNT 32*4
+%define OFFSET 32*4
+ mov cq, -COUNT
+ lea vrevq, [vq + OFFSET + COUNT]
+ add vq, OFFSET-mmsize
+ add srcq, 2*COUNT
+ mova m3, [ps_neg]
+.loop:
+ mova m0, [srcq + 2*cq + 0*mmsize]
+ mova m1, [srcq + 2*cq + 1*mmsize]
+ shufps m2, m0, m1, q2020
+ shufps m1, m0, q1313
+ xorps m2, m3
+ mova [vq], m1
+ mova [vrevq + cq], m2
+ sub vq, mmsize
+ add cq, mmsize
+ jl .loop
+ REP_RET
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp_init.c
index 2b912d0e9eb..a2aca742cf3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp_init.c
@@ -51,6 +51,8 @@ void ff_sbr_hf_apply_noise_3_sse2(float (*Y)[2], const float *s_m,
const float *q_filt, int noise,
int kx, int m_max);
+void ff_sbr_qmf_deint_neg_sse(float *v, const float *src);
+
av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
{
int cpu_flags = av_get_cpu_flags();
@@ -63,6 +65,7 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
s->hf_gen = ff_sbr_hf_gen_sse;
s->qmf_post_shuffle = ff_sbr_qmf_post_shuffle_sse;
s->qmf_deint_bfly = ff_sbr_qmf_deint_bfly_sse;
+ s->qmf_deint_neg = ff_sbr_qmf_deint_neg_sse;
}
if (EXTERNAL_SSE2(cpu_flags)) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/simple_idct.c b/chromium/third_party/ffmpeg/libavcodec/x86/simple_idct.c
index c666b1a6df4..3ae30f3488a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/simple_idct.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/simple_idct.c
@@ -21,6 +21,7 @@
*/
#include "libavcodec/simple_idct.h"
#include "libavutil/mem.h"
+#include "libavutil/x86/asm.h"
#include "dsputil_x86.h"
#if HAVE_INLINE_ASM
@@ -1142,6 +1143,7 @@ Temp
"9: \n\t"
:: "r" (block), "r" (temp), "r" (coeffs)
+ NAMED_CONSTRAINTS_ADD(wm1010,d40000)
: "%eax"
);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/snowdsp.c b/chromium/third_party/ffmpeg/libavcodec/x86/snowdsp.c
index 735e7905a0f..67cb868adab 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/snowdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/snowdsp.c
@@ -606,6 +606,7 @@ static void ff_snow_vertical_compose97i_mmx(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM
}
#endif //HAVE_7REGS
+#if HAVE_6REGS
#define snow_inner_add_yblock_sse2_header \
IDWTELEM * * dst_array = sb->line + src_y;\
x86_reg tmp;\
@@ -671,6 +672,7 @@ static void ff_snow_vertical_compose97i_mmx(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM
:"+m"(dst8),"+m"(dst_array),"=&r"(tmp)\
:\
"rm"((x86_reg)(src_x<<1)),"m"(obmc),"a"(block),"m"(b_h),"m"(src_stride):\
+ XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", )\
"%"REG_c"","%"REG_S"","%"REG_D"","%"REG_d"");
#define snow_inner_add_yblock_sse2_end_8\
@@ -872,6 +874,7 @@ static void ff_snow_inner_add_yblock_mmx(const uint8_t *obmc, const int obmc_str
else
ff_snow_inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
}
+#endif /* HAVE_6REGS */
#endif /* HAVE_INLINE_ASM */
@@ -886,7 +889,9 @@ void ff_dwt_init_x86(SnowDWTContext *c)
#if HAVE_7REGS
c->vertical_compose97i = ff_snow_vertical_compose97i_sse2;
#endif
+#if HAVE_6REGS
c->inner_add_yblock = ff_snow_inner_add_yblock_sse2;
+#endif
}
else{
if (mm_flags & AV_CPU_FLAG_MMXEXT) {
@@ -895,7 +900,9 @@ void ff_dwt_init_x86(SnowDWTContext *c)
c->vertical_compose97i = ff_snow_vertical_compose97i_mmx;
#endif
}
+#if HAVE_6REGS
c->inner_add_yblock = ff_snow_inner_add_yblock_mmx;
+#endif
}
}
#endif /* HAVE_INLINE_ASM */
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/ttadsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/ttadsp.asm
new file mode 100644
index 00000000000..8346cabac2a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/ttadsp.asm
@@ -0,0 +1,119 @@
+;******************************************************************************
+;* TTA DSP SIMD optimizations
+;*
+;* Copyright (C) 2014 James Almer
+;*
+;* 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 "libavutil/x86/x86util.asm"
+
+SECTION_RODATA
+
+pd_n0113: dd ~0, ~1, ~1, ~3
+pd_1224: dd 1, 2, 2, 4
+
+SECTION .text
+
+%macro TTA_FILTER 2
+INIT_XMM %1
+cglobal ttafilter_process_dec, 5,5,%2, qm, dx, dl, error, in, shift, round
+ mova m2, [qmq ]
+ mova m3, [qmq + 0x10]
+ mova m4, [dxq ]
+ mova m5, [dxq + 0x10]
+
+ movd m6, [errorq] ; if (filter->error < 0) {
+ SPLATD m6 ; for (int i = 0; i < 8; i++)
+ psignd m0, m4, m6 ; filter->qm[i] -= filter->dx[i];
+ psignd m1, m5, m6 ; } else if (filter->error > 0) {
+ paddd m2, m0 ; for (int i = 0; i < 8; i++)
+ paddd m3, m1 ; filter->qm[i] += filter->dx[i];
+ mova [qmq ], m2 ; }
+ mova [qmq + 0x10], m3 ;
+
+ mova m0, [dlq ]
+ mova m1, [dlq + 0x10]
+
+%if cpuflag(sse4)
+ pmulld m2, m0
+ pmulld m3, m1
+%else
+ pshufd m6, m0, 0xb1
+ pshufd m7, m2, 0xb1
+ pmuludq m6, m7
+ pshufd m6, m6, 0xd8
+ pmuludq m2, m0
+ pshufd m2, m2, 0xd8
+ punpckldq m2, m6
+
+ pshufd m6, m1, 0xb1
+ pshufd m7, m3, 0xb1
+ pmuludq m6, m7
+ pshufd m6, m6, 0xd8
+ pmuludq m3, m1
+ pshufd m3, m3, 0xd8
+ punpckldq m3, m6
+%endif
+ ; Using horizontal add (phaddd) seems to be slower than shuffling stuff around
+ paddd m2, m3 ; int sum = filter->round +
+ ; filter->dl[0] * filter->qm[0] +
+ punpckhqdq m3, m2, m2 ; filter->dl[1] * filter->qm[1] +
+ paddd m2, m3 ; filter->dl[2] * filter->qm[2] +
+ ; filter->dl[3] * filter->qm[3] +
+ movd m6, roundm ; filter->dl[4] * filter->qm[4] +
+ paddd m6, m2 ; filter->dl[5] * filter->qm[5] +
+ pshufd m2, m2, 0x1 ; filter->dl[6] * filter->qm[6] +
+ paddd m6, m2 ; filter->dl[7] * filter->qm[7];
+
+ palignr m5, m4, 4 ; filter->dx[0] = filter->dx[1]; filter->dx[1] = filter->dx[2];
+ ; filter->dx[2] = filter->dx[3]; filter->dx[3] = filter->dx[4];
+
+ palignr m2, m1, m0, 4 ; filter->dl[0] = filter->dl[1]; filter->dl[1] = filter->dl[2];
+ ; filter->dl[2] = filter->dl[3]; filter->dl[3] = filter->dl[4];
+
+ psrad m4, m1, 30 ; filter->dx[4] = ((filter->dl[4] >> 30) | 1);
+ por m4, [pd_1224 ] ; filter->dx[5] = ((filter->dl[5] >> 30) | 2) & ~1;
+ pand m4, [pd_n0113] ; filter->dx[6] = ((filter->dl[6] >> 30) | 2) & ~1;
+ ; filter->dx[7] = ((filter->dl[7] >> 30) | 4) & ~3;
+
+ mova [dlq ], m2
+ mova [dxq ], m5
+ mova [dxq + 0x10], m4
+ movd m0, [inq] ; filter->error = *in;
+ movd [errorq], m0 ;
+
+ movd m2, shiftm ; *in += (sum >> filter->shift);
+ psrad m6, m2 ;
+ paddd m0, m6 ;
+ movd [inq], m0 ;
+
+ psrldq m1, 4 ;
+ pslldq m0, 12 ; filter->dl[4] = -filter->dl[5];
+ pshufd m0, m0, 0xf0 ; filter->dl[5] = -filter->dl[6];
+ psubd m0, m1 ; filter->dl[6] = *in - filter->dl[7];
+ psrldq m1, m0, 4 ; filter->dl[7] = *in;
+ pshufd m1, m1, 0xf4 ; filter->dl[5] += filter->dl[6];
+ paddd m0, m1 ; filter->dl[4] += filter->dl[5];
+ psrldq m1, 4 ;
+ paddd m0, m1 ;
+ mova [dlq + 0x10], m0 ;
+ RET
+%endmacro
+
+TTA_FILTER ssse3, 8
+TTA_FILTER sse4, 7
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/ttadsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/ttadsp_init.c
new file mode 100644
index 00000000000..47dc87f6afd
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/ttadsp_init.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014 James Almer
+ *
+ * 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 "libavcodec/ttadsp.h"
+#include "libavutil/x86/cpu.h"
+#include "config.h"
+
+void ff_ttafilter_process_dec_ssse3(int32_t *qm, int32_t *dx, int32_t *dl,
+ int32_t *error, int32_t *in, int32_t shift,
+ int32_t round);
+void ff_ttafilter_process_dec_sse4(int32_t *qm, int32_t *dx, int32_t *dl,
+ int32_t *error, int32_t *in, int32_t shift,
+ int32_t round);
+
+av_cold void ff_ttadsp_init_x86(TTADSPContext *c)
+{
+#if HAVE_YASM
+ int cpu_flags = av_get_cpu_flags();
+
+ if (EXTERNAL_SSSE3(cpu_flags))
+ c->ttafilter_process_dec = ff_ttafilter_process_dec_ssse3;
+ if (EXTERNAL_SSE4(cpu_flags))
+ c->ttafilter_process_dec = ff_ttafilter_process_dec_sse4;
+#endif
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vc1dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/vc1dsp_init.c
index 9f18131a24b..2bef5f5fb59 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vc1dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vc1dsp_init.c
@@ -24,10 +24,12 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
+#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/x86/cpu.h"
+#include "libavutil/x86/asm.h"
#include "libavcodec/vc1dsp.h"
-#include "dsputil_x86.h"
+#include "fpel.h"
#include "vc1dsp.h"
#include "config.h"
@@ -61,12 +63,17 @@ static void vc1_h_loop_filter16_sse4(uint8_t *src, int stride, int pq)
ff_vc1_h_loop_filter8_sse4(src, stride, pq);
ff_vc1_h_loop_filter8_sse4(src+8*stride, stride, pq);
}
-
static void avg_vc1_mspel_mc00_mmxext(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride, int rnd)
{
ff_avg_pixels8_mmxext(dst, src, stride, 8);
}
+static void avg_vc1_mspel_mc00_16_sse2(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride, int rnd)
+{
+ ff_avg_pixels16_sse2(dst, src, stride, 16);
+}
+
#endif /* HAVE_YASM */
void ff_put_vc1_chroma_mc8_nornd_mmx (uint8_t *dst, uint8_t *src,
@@ -85,10 +92,10 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
{
int cpu_flags = av_get_cpu_flags();
- if (INLINE_MMX(cpu_flags))
+ if (HAVE_6REGS && INLINE_MMX(cpu_flags))
ff_vc1dsp_init_mmx(dsp);
- if (INLINE_MMXEXT(cpu_flags))
+ if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags))
ff_vc1dsp_init_mmxext(dsp);
#define ASSIGN_LF(EXT) \
@@ -110,13 +117,14 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
ASSIGN_LF(mmxext);
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[0] = avg_vc1_mspel_mc00_mmxext;
+ dsp->avg_vc1_mspel_pixels_tab[1][0] = avg_vc1_mspel_mc00_mmxext;
}
if (EXTERNAL_SSE2(cpu_flags)) {
dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_sse2;
dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse2;
dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_sse2;
dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse2;
+ dsp->avg_vc1_mspel_pixels_tab[0][0] = avg_vc1_mspel_mc00_16_sse2;
}
if (EXTERNAL_SSSE3(cpu_flags)) {
ASSIGN_LF(ssse3);
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vc1dsp_mmx.c b/chromium/third_party/ffmpeg/libavcodec/x86/vc1dsp_mmx.c
index 5ceacd348e2..87e4638ca79 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vc1dsp_mmx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vc1dsp_mmx.c
@@ -30,10 +30,10 @@
#include "libavutil/x86/cpu.h"
#include "libavcodec/vc1dsp.h"
#include "constants.h"
-#include "dsputil_x86.h"
+#include "fpel.h"
#include "vc1dsp.h"
-#if HAVE_INLINE_ASM
+#if HAVE_6REGS && HAVE_INLINE_ASM
#define OP_PUT(S,D)
#define OP_AVG(S,D) "pavgb " #S ", " #D " \n\t"
@@ -110,6 +110,7 @@ static void vc1_put_ver_16b_shift2_mmx(int16_t *dst,
: "+r"(src), "+r"(dst)
: "r"(stride), "r"(-2*stride),
"m"(shift), "m"(rnd), "r"(9*stride-4)
+ NAMED_CONSTRAINTS_ADD(ff_pw_9)
: "%"REG_c, "memory"
);
}
@@ -154,6 +155,7 @@ static void OPNAME ## vc1_hor_16b_shift2_mmx(uint8_t *dst, x86_reg stride,\
"jnz 1b \n\t"\
: "+r"(h), "+r" (src), "+r" (dst)\
: "r"(stride), "m"(rnd)\
+ NAMED_CONSTRAINTS_ADD(ff_pw_128,ff_pw_9)\
: "memory"\
);\
}
@@ -212,6 +214,7 @@ static void OPNAME ## vc1_shift2_mmx(uint8_t *dst, const uint8_t *src,\
: "+r"(src), "+r"(dst)\
: "r"(offset), "r"(-2*offset), "g"(stride), "m"(rnd),\
"g"(stride-offset)\
+ NAMED_CONSTRAINTS_ADD(ff_pw_9)\
: "%"REG_c, "memory"\
);\
}
@@ -314,6 +317,7 @@ vc1_put_ver_16b_ ## NAME ## _mmx(int16_t *dst, const uint8_t *src, \
: "+r"(h), "+r" (src), "+r" (dst) \
: "r"(src_stride), "r"(3*src_stride), \
"m"(rnd), "m"(shift) \
+ NAMED_CONSTRAINTS_ADD(ff_pw_3,ff_pw_53,ff_pw_18) \
: "memory" \
); \
}
@@ -351,6 +355,7 @@ OPNAME ## vc1_hor_16b_ ## NAME ## _mmx(uint8_t *dst, x86_reg stride, \
"jnz 1b \n\t" \
: "+r"(h), "+r" (src), "+r" (dst) \
: "r"(stride), "m"(rnd) \
+ NAMED_CONSTRAINTS_ADD(ff_pw_3,ff_pw_18,ff_pw_53,ff_pw_128) \
: "memory" \
); \
}
@@ -386,6 +391,7 @@ OPNAME ## vc1_## NAME ## _mmx(uint8_t *dst, const uint8_t *src, \
"jnz 1b \n\t" \
: "+r"(h), "+r" (src), "+r" (dst) \
: "r"(offset), "r"(3*offset), "g"(stride), "m"(rnd) \
+ NAMED_CONSTRAINTS_ADD(ff_pw_53,ff_pw_18,ff_pw_3) \
: "memory" \
); \
}
@@ -456,6 +462,15 @@ static void OP ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride,\
\
/* Horizontal mode with no vertical mode */\
vc1_put_shift_8bits[hmode](dst, src, stride, rnd, 1);\
+} \
+static void OP ## vc1_mspel_mc_16(uint8_t *dst, const uint8_t *src, \
+ int stride, int hmode, int vmode, int rnd)\
+{ \
+ OP ## vc1_mspel_mc(dst + 0, src + 0, stride, hmode, vmode, rnd); \
+ OP ## vc1_mspel_mc(dst + 8, src + 8, stride, hmode, vmode, rnd); \
+ dst += 8*stride; src += 8*stride; \
+ OP ## vc1_mspel_mc(dst + 0, src + 0, stride, hmode, vmode, rnd); \
+ OP ## vc1_mspel_mc(dst + 8, src + 8, stride, hmode, vmode, rnd); \
}
VC1_MSPEL_MC(put_)
@@ -476,6 +491,20 @@ static void avg_vc1_mspel_mc ## a ## b ## _mmxext(uint8_t *dst, \
int rnd) \
{ \
avg_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
+}\
+static void put_vc1_mspel_mc ## a ## b ## _16_mmx(uint8_t *dst, \
+ const uint8_t *src, \
+ ptrdiff_t stride, \
+ int rnd) \
+{ \
+ put_vc1_mspel_mc_16(dst, src, stride, a, b, rnd); \
+}\
+static void avg_vc1_mspel_mc ## a ## b ## _16_mmxext(uint8_t *dst, \
+ const uint8_t *src,\
+ ptrdiff_t stride, \
+ int rnd) \
+{ \
+ avg_vc1_mspel_mc_16(dst, src, stride, a, b, rnd); \
}
DECLARE_FUNCTION(0, 1)
@@ -704,54 +733,75 @@ static void put_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src,
{
ff_put_pixels8_mmx(dst, src, stride, 8);
}
+static void put_vc1_mspel_mc00_16_mmx(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride, int rnd)
+{
+ ff_put_pixels16_mmx(dst, src, stride, 16);
+}
+static void avg_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride, int rnd)
+{
+ ff_avg_pixels8_mmx(dst, src, stride, 8);
+}
+static void avg_vc1_mspel_mc00_16_mmx(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride, int rnd)
+{
+ ff_avg_pixels16_mmx(dst, src, stride, 16);
+}
+
+#define FN_ASSIGN(OP, X, Y, INSN) \
+ dsp->OP##vc1_mspel_pixels_tab[1][X+4*Y] = OP##vc1_mspel_mc##X##Y##INSN; \
+ dsp->OP##vc1_mspel_pixels_tab[0][X+4*Y] = OP##vc1_mspel_mc##X##Y##_16##INSN
av_cold void ff_vc1dsp_init_mmx(VC1DSPContext *dsp)
{
- dsp->put_vc1_mspel_pixels_tab[ 0] = put_vc1_mspel_mc00_mmx;
- dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_mmx;
- dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_mmx;
- dsp->put_vc1_mspel_pixels_tab[12] = put_vc1_mspel_mc03_mmx;
-
- dsp->put_vc1_mspel_pixels_tab[ 1] = put_vc1_mspel_mc10_mmx;
- dsp->put_vc1_mspel_pixels_tab[ 5] = put_vc1_mspel_mc11_mmx;
- dsp->put_vc1_mspel_pixels_tab[ 9] = put_vc1_mspel_mc12_mmx;
- dsp->put_vc1_mspel_pixels_tab[13] = put_vc1_mspel_mc13_mmx;
-
- dsp->put_vc1_mspel_pixels_tab[ 2] = put_vc1_mspel_mc20_mmx;
- dsp->put_vc1_mspel_pixels_tab[ 6] = put_vc1_mspel_mc21_mmx;
- dsp->put_vc1_mspel_pixels_tab[10] = put_vc1_mspel_mc22_mmx;
- dsp->put_vc1_mspel_pixels_tab[14] = put_vc1_mspel_mc23_mmx;
-
- dsp->put_vc1_mspel_pixels_tab[ 3] = put_vc1_mspel_mc30_mmx;
- dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_mmx;
- dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_mmx;
- dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_mmx;
+ FN_ASSIGN(put_, 0, 0, _mmx);
+ FN_ASSIGN(put_, 0, 1, _mmx);
+ FN_ASSIGN(put_, 0, 2, _mmx);
+ FN_ASSIGN(put_, 0, 3, _mmx);
+
+ FN_ASSIGN(put_, 1, 0, _mmx);
+ FN_ASSIGN(put_, 1, 1, _mmx);
+ FN_ASSIGN(put_, 1, 2, _mmx);
+ FN_ASSIGN(put_, 1, 3, _mmx);
+
+ FN_ASSIGN(put_, 2, 0, _mmx);
+ FN_ASSIGN(put_, 2, 1, _mmx);
+ FN_ASSIGN(put_, 2, 2, _mmx);
+ FN_ASSIGN(put_, 2, 3, _mmx);
+
+ FN_ASSIGN(put_, 3, 0, _mmx);
+ FN_ASSIGN(put_, 3, 1, _mmx);
+ FN_ASSIGN(put_, 3, 2, _mmx);
+ FN_ASSIGN(put_, 3, 3, _mmx);
+
+ FN_ASSIGN(avg_, 0, 0, _mmx);
}
av_cold void ff_vc1dsp_init_mmxext(VC1DSPContext *dsp)
{
- dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_mmxext;
+ FN_ASSIGN(avg_, 0, 1, _mmxext);
+ FN_ASSIGN(avg_, 0, 2, _mmxext);
+ FN_ASSIGN(avg_, 0, 3, _mmxext);
- dsp->avg_vc1_mspel_pixels_tab[ 1] = avg_vc1_mspel_mc10_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[ 5] = avg_vc1_mspel_mc11_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[ 9] = avg_vc1_mspel_mc12_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_mmxext;
+ FN_ASSIGN(avg_, 1, 0, _mmxext);
+ FN_ASSIGN(avg_, 1, 1, _mmxext);
+ FN_ASSIGN(avg_, 1, 2, _mmxext);
+ FN_ASSIGN(avg_, 1, 3, _mmxext);
- dsp->avg_vc1_mspel_pixels_tab[ 2] = avg_vc1_mspel_mc20_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[ 6] = avg_vc1_mspel_mc21_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_mmxext;
+ FN_ASSIGN(avg_, 2, 0, _mmxext);
+ FN_ASSIGN(avg_, 2, 1, _mmxext);
+ FN_ASSIGN(avg_, 2, 2, _mmxext);
+ FN_ASSIGN(avg_, 2, 3, _mmxext);
- dsp->avg_vc1_mspel_pixels_tab[ 3] = avg_vc1_mspel_mc30_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[ 7] = avg_vc1_mspel_mc31_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_mmxext;
- dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_mmxext;
+ FN_ASSIGN(avg_, 3, 0, _mmxext);
+ FN_ASSIGN(avg_, 3, 1, _mmxext);
+ FN_ASSIGN(avg_, 3, 2, _mmxext);
+ FN_ASSIGN(avg_, 3, 3, _mmxext);
dsp->vc1_inv_trans_8x8_dc = vc1_inv_trans_8x8_dc_mmxext;
dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_mmxext;
dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_mmxext;
dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_mmxext;
}
-#endif /* HAVE_INLINE_ASM */
+#endif /* HAVE_6REGS && HAVE_INLINE_ASM */
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/videodsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/videodsp_init.c
index 2013a93b90d..3218abdd88e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/videodsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/videodsp_init.c
@@ -231,7 +231,8 @@ static av_noinline void emulated_edge_mc_sse2(uint8_t *buf, const uint8_t *src,
ptrdiff_t buf_stride,
ptrdiff_t src_stride,
int block_w, int block_h,
- int src_x, int src_y, int w, int h)
+ int src_x, int src_y, int w,
+ int h)
{
emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h,
src_x, src_y, w, h, vfixtbl_sse, &ff_emu_edge_vvar_sse,
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vorbisdsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/vorbisdsp_init.c
index 284a528a0c7..bc1cc43a186 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vorbisdsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vorbisdsp_init.c
@@ -31,7 +31,6 @@ void ff_vorbis_inverse_coupling_sse(float *mag, float *ang,
av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp)
{
-#if HAVE_YASM
int cpu_flags = av_get_cpu_flags();
#if ARCH_X86_32
@@ -40,5 +39,4 @@ av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp)
#endif /* ARCH_X86_32 */
if (EXTERNAL_SSE(cpu_flags))
dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse;
-#endif /* HAVE_YASM */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp_init.c
index 1f02a6f7090..cc3eba4e9af 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp_init.c
@@ -25,7 +25,6 @@
#include "libavutil/x86/cpu.h"
#include "libavutil/x86/asm.h"
#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
#include "libavcodec/vp3dsp.h"
#include "config.h"
@@ -64,6 +63,7 @@ void ff_vp3_h_loop_filter_mmxext(uint8_t *src, int stride,
"paddb "#regb", "#regr" \n\t" \
"paddb "#regd", "#regp" \n\t"
+#if HAVE_6REGS
static void put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a, const uint8_t *b, ptrdiff_t stride, int h)
{
// START_TIMER
@@ -95,15 +95,16 @@ static void put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a, const u
:"memory");
// STOP_TIMER("put_vp_no_rnd_pixels8_l2_mmx")
}
+#endif /*HAVE_6REGS */
#endif /* HAVE_MMX_INLINE */
av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
{
int cpu_flags = av_get_cpu_flags();
-#if HAVE_MMX_INLINE
+#if HAVE_6REGS && HAVE_MMX_INLINE
c->put_no_rnd_pixels_l2 = put_vp_no_rnd_pixels8_l2_mmx;
-#endif /* HAVE_MMX_INLINE */
+#endif /* HAVE_6REGS && HAVE_MMX_INLINE */
#if ARCH_X86_32
if (EXTERNAL_MMX(cpu_flags)) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp56_arith.h b/chromium/third_party/ffmpeg/libavcodec/x86/vp56_arith.h
index e71dbf8ed0f..810cc8dcd81 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp56_arith.h
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp56_arith.h
@@ -24,29 +24,26 @@
#ifndef AVCODEC_X86_VP56_ARITH_H
#define AVCODEC_X86_VP56_ARITH_H
-#if HAVE_INLINE_ASM && HAVE_FAST_CMOV
+#if HAVE_INLINE_ASM && HAVE_FAST_CMOV && HAVE_6REGS
#define vp56_rac_get_prob vp56_rac_get_prob
static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob)
{
unsigned int code_word = vp56_rac_renorm(c);
- unsigned int high = c->high;
- unsigned int low = 1 + (((high - 1) * prob) >> 8);
+ unsigned int low = 1 + (((c->high - 1) * prob) >> 8);
unsigned int low_shift = low << 16;
int bit = 0;
+ c->code_word = code_word;
__asm__(
"subl %4, %1 \n\t"
"subl %3, %2 \n\t"
- "leal (%2, %3), %3 \n\t"
"setae %b0 \n\t"
"cmovb %4, %1 \n\t"
- "cmovb %3, %2 \n\t"
- : "+q"(bit), "+r"(high), "+r"(code_word), "+r"(low_shift)
- : "r"(low)
+ "cmovb %5, %2 \n\t"
+ : "+q"(bit), "+&r"(c->high), "+&r"(c->code_word)
+ : "r"(low_shift), "r"(low), "r"(code_word)
);
- c->high = high;
- c->code_word = code_word;
return bit;
}
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp6dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/vp6dsp_init.c
index 8718e23a83e..82baee7e971 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp6dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp6dsp_init.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp.asm
index 85c7e9948c8..4407dd3dd0d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp.asm
@@ -153,13 +153,13 @@ cextern pw_64
SECTION .text
-;-----------------------------------------------------------------------------
+;-------------------------------------------------------------------------------
; subpel MC functions:
;
-; void put_vp8_epel<size>_h<htap>v<vtap>_<opt>(uint8_t *dst, int deststride,
-; uint8_t *src, int srcstride,
-; int height, int mx, int my);
-;-----------------------------------------------------------------------------
+; void ff_put_vp8_epel<size>_h<htap>v<vtap>_<opt>(uint8_t *dst, int deststride,
+; uint8_t *src, int srcstride,
+; int height, int mx, int my);
+;-------------------------------------------------------------------------------
%macro FILTER_SSSE3 1
cglobal put_vp8_epel%1_h6, 6, 6 + npicregs, 8, dst, dststride, src, srcstride, height, mx, picreg
@@ -884,7 +884,7 @@ cglobal put_vp8_pixels16, 5, 5, 2, dst, dststride, src, srcstride, height
REP_RET
;-----------------------------------------------------------------------------
-; void vp8_idct_dc_add_<opt>(uint8_t *dst, int16_t block[16], int stride);
+; void ff_vp8_idct_dc_add_<opt>(uint8_t *dst, int16_t block[16], int stride);
;-----------------------------------------------------------------------------
%macro ADD_DC 4
@@ -962,7 +962,7 @@ cglobal vp8_idct_dc_add, 3, 3, 6, dst, block, stride
RET
;-----------------------------------------------------------------------------
-; void vp8_idct_dc_add4y_<opt>(uint8_t *dst, int16_t block[4][16], int stride);
+; void ff_vp8_idct_dc_add4y_<opt>(uint8_t *dst, int16_t block[4][16], int stride);
;-----------------------------------------------------------------------------
%if ARCH_X86_32
@@ -1035,7 +1035,7 @@ cglobal vp8_idct_dc_add4y, 3, 3, 6, dst, block, stride
RET
;-----------------------------------------------------------------------------
-; void vp8_idct_dc_add4uv_<opt>(uint8_t *dst, int16_t block[4][16], int stride);
+; void ff_vp8_idct_dc_add4uv_<opt>(uint8_t *dst, int16_t block[4][16], int stride);
;-----------------------------------------------------------------------------
INIT_MMX mmx
@@ -1077,7 +1077,7 @@ cglobal vp8_idct_dc_add4uv, 3, 3, 0, dst, block, stride
RET
;-----------------------------------------------------------------------------
-; void vp8_idct_add_<opt>(uint8_t *dst, int16_t block[16], int stride);
+; void ff_vp8_idct_add_<opt>(uint8_t *dst, int16_t block[16], int stride);
;-----------------------------------------------------------------------------
; calculate %1=mul_35468(%1)-mul_20091(%2); %2=mul_20091(%1)+mul_35468(%2)
@@ -1157,7 +1157,7 @@ INIT_MMX sse
VP8_IDCT_ADD
;-----------------------------------------------------------------------------
-; void vp8_luma_dc_wht_mmxext(int16_t block[4][4][16], int16_t dc[16])
+; void ff_vp8_luma_dc_wht(int16_t block[4][4][16], int16_t dc[16])
;-----------------------------------------------------------------------------
%macro SCATTER_WHT 3
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp_init.c
index dca00f575aa..ff743d62dcb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp_init.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/mem.h"
#include "libavutil/x86/asm.h"
@@ -314,25 +315,69 @@ DECLARE_LOOP_FILTER(sse4)
c->put_vp8_bilinear_pixels_tab[IDX][2][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT
-av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
+av_cold void ff_vp78dsp_init_x86(VP8DSPContext *c)
{
#if HAVE_YASM
int cpu_flags = av_get_cpu_flags();
if (EXTERNAL_MMX(cpu_flags)) {
- c->vp8_idct_dc_add = ff_vp8_idct_dc_add_mmx;
- c->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmx;
#if ARCH_X86_32
- c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_mmx;
- c->vp8_idct_add = ff_vp8_idct_add_mmx;
- c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_mmx;
c->put_vp8_epel_pixels_tab[0][0][0] =
c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmx;
#endif
c->put_vp8_epel_pixels_tab[1][0][0] =
c->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmx;
+ }
+
+ /* note that 4-tap width=16 functions are missing because w=16
+ * is only used for luma, and luma is always a copy or sixtap. */
+ if (EXTERNAL_MMXEXT(cpu_flags)) {
+ VP8_MC_FUNC(2, 4, mmxext);
+ VP8_BILINEAR_MC_FUNC(2, 4, mmxext);
+#if ARCH_X86_32
+ VP8_LUMA_MC_FUNC(0, 16, mmxext);
+ VP8_MC_FUNC(1, 8, mmxext);
+ VP8_BILINEAR_MC_FUNC(0, 16, mmxext);
+ VP8_BILINEAR_MC_FUNC(1, 8, mmxext);
+#endif
+ }
+
+ if (EXTERNAL_SSE(cpu_flags)) {
+ c->put_vp8_epel_pixels_tab[0][0][0] =
+ c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse;
+ }
+
+ if (HAVE_SSE2_EXTERNAL && cpu_flags & (AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_SSE2SLOW)) {
+ VP8_LUMA_MC_FUNC(0, 16, sse2);
+ VP8_MC_FUNC(1, 8, sse2);
+ VP8_BILINEAR_MC_FUNC(0, 16, sse2);
+ VP8_BILINEAR_MC_FUNC(1, 8, sse2);
+ }
+
+ if (EXTERNAL_SSSE3(cpu_flags)) {
+ VP8_LUMA_MC_FUNC(0, 16, ssse3);
+ VP8_MC_FUNC(1, 8, ssse3);
+ VP8_MC_FUNC(2, 4, ssse3);
+ VP8_BILINEAR_MC_FUNC(0, 16, ssse3);
+ VP8_BILINEAR_MC_FUNC(1, 8, ssse3);
+ VP8_BILINEAR_MC_FUNC(2, 4, ssse3);
+ }
+#endif /* HAVE_YASM */
+}
+av_cold void ff_vp8dsp_init_x86(VP8DSPContext *c)
+{
+#if HAVE_YASM
+ int cpu_flags = av_get_cpu_flags();
+
+ if (EXTERNAL_MMX(cpu_flags)) {
+ c->vp8_idct_dc_add = ff_vp8_idct_dc_add_mmx;
+ c->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmx;
#if ARCH_X86_32
+ c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_mmx;
+ c->vp8_idct_add = ff_vp8_idct_add_mmx;
+ c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_mmx;
+
c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx;
c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx;
@@ -351,14 +396,7 @@ av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
/* note that 4-tap width=16 functions are missing because w=16
* is only used for luma, and luma is always a copy or sixtap. */
if (EXTERNAL_MMXEXT(cpu_flags)) {
- VP8_MC_FUNC(2, 4, mmxext);
- VP8_BILINEAR_MC_FUNC(2, 4, mmxext);
#if ARCH_X86_32
- VP8_LUMA_MC_FUNC(0, 16, mmxext);
- VP8_MC_FUNC(1, 8, mmxext);
- VP8_BILINEAR_MC_FUNC(0, 16, mmxext);
- VP8_BILINEAR_MC_FUNC(1, 8, mmxext);
-
c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmxext;
c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmxext;
@@ -377,16 +415,9 @@ av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
if (EXTERNAL_SSE(cpu_flags)) {
c->vp8_idct_add = ff_vp8_idct_add_sse;
c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_sse;
- c->put_vp8_epel_pixels_tab[0][0][0] =
- c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse;
}
if (HAVE_SSE2_EXTERNAL && cpu_flags & (AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_SSE2SLOW)) {
- VP8_LUMA_MC_FUNC(0, 16, sse2);
- VP8_MC_FUNC(1, 8, sse2);
- VP8_BILINEAR_MC_FUNC(0, 16, sse2);
- VP8_BILINEAR_MC_FUNC(1, 8, sse2);
-
c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_sse2;
c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2;
@@ -399,7 +430,7 @@ av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
if (EXTERNAL_SSE2(cpu_flags)) {
c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_sse2;
- c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2;
+ c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2;
c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_sse2;
c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_sse2;
@@ -409,13 +440,6 @@ av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
}
if (EXTERNAL_SSSE3(cpu_flags)) {
- VP8_LUMA_MC_FUNC(0, 16, ssse3);
- VP8_MC_FUNC(1, 8, ssse3);
- VP8_MC_FUNC(2, 4, ssse3);
- VP8_BILINEAR_MC_FUNC(0, 16, ssse3);
- VP8_BILINEAR_MC_FUNC(1, 8, ssse3);
- VP8_BILINEAR_MC_FUNC(2, 4, ssse3);
-
c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_ssse3;
c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_ssse3;
@@ -431,7 +455,7 @@ av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
}
if (EXTERNAL_SSE4(cpu_flags)) {
- c->vp8_idct_dc_add = ff_vp8_idct_dc_add_sse4;
+ c->vp8_idct_dc_add = ff_vp8_idct_dc_add_sse4;
c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse4;
c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse4;
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp_loopfilter.asm b/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp_loopfilter.asm
index 45dd54b6a2a..98bd8a5e388 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp_loopfilter.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp8dsp_loopfilter.asm
@@ -43,7 +43,7 @@ cextern pb_80
SECTION .text
;-----------------------------------------------------------------------------
-; void vp8_h/v_loop_filter_simple_<opt>(uint8_t *dst, int stride, int flim);
+; void ff_vp8_h/v_loop_filter_simple_<opt>(uint8_t *dst, int stride, int flim);
;-----------------------------------------------------------------------------
; macro called with 7 mm register indexes as argument, and 4 regular registers
@@ -429,8 +429,8 @@ INIT_XMM sse4
SIMPLE_LOOPFILTER h, 5
;-----------------------------------------------------------------------------
-; void vp8_h/v_loop_filter<size>_inner_<opt>(uint8_t *dst, [uint8_t *v,] int stride,
-; int flimE, int flimI, int hev_thr);
+; void ff_vp8_h/v_loop_filter<size>_inner_<opt>(uint8_t *dst, [uint8_t *v,] int stride,
+; int flimE, int flimI, int hev_thr);
;-----------------------------------------------------------------------------
%macro INNER_LOOPFILTER 2
@@ -921,8 +921,8 @@ INNER_LOOPFILTER v, 8
INNER_LOOPFILTER h, 8
;-----------------------------------------------------------------------------
-; void vp8_h/v_loop_filter<size>_mbedge_<opt>(uint8_t *dst, [uint8_t *v,] int stride,
-; int flimE, int flimI, int hev_thr);
+; void ff_vp8_h/v_loop_filter<size>_mbedge_<opt>(uint8_t *dst, [uint8_t *v,] int stride,
+; int flimE, int flimI, int hev_thr);
;-----------------------------------------------------------------------------
%macro MBEDGE_LOOPFILTER 2
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp9dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/vp9dsp_init.c
index 3c02520e0ec..3fd274d17ff 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp9dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp9dsp_init.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/mem.h"
#include "libavutil/x86/asm.h"
@@ -29,25 +30,25 @@
#if HAVE_YASM
#define fpel_func(avg, sz, opt) \
-void ff_##avg##sz##_##opt(uint8_t *dst, ptrdiff_t dst_stride, \
- const uint8_t *src, ptrdiff_t src_stride, \
- int h, int mx, int my)
+void ff_vp9_##avg##sz##_##opt(uint8_t *dst, ptrdiff_t dst_stride, \
+ const uint8_t *src, ptrdiff_t src_stride, \
+ int h, int mx, int my)
fpel_func(put, 4, mmx);
fpel_func(put, 8, mmx);
fpel_func(put, 16, sse);
fpel_func(put, 32, sse);
fpel_func(put, 64, sse);
-fpel_func(avg, 4, sse);
-fpel_func(avg, 8, sse);
+fpel_func(avg, 4, mmxext);
+fpel_func(avg, 8, mmxext);
fpel_func(avg, 16, sse2);
fpel_func(avg, 32, sse2);
fpel_func(avg, 64, sse2);
#undef fpel_func
#define mc_func(avg, sz, dir, opt) \
-void ff_##avg##_8tap_1d_##dir##_##sz##_##opt(uint8_t *dst, ptrdiff_t dst_stride, \
- const uint8_t *src, ptrdiff_t src_stride, \
- int h, const int8_t (*filter)[16])
+void ff_vp9_##avg##_8tap_1d_##dir##_##sz##_##opt(uint8_t *dst, ptrdiff_t dst_stride, \
+ const uint8_t *src, ptrdiff_t src_stride, \
+ int h, const int8_t (*filter)[16])
#define mc_funcs(sz) \
mc_func(put, sz, h, ssse3); \
mc_func(avg, sz, h, ssse3); \
@@ -56,20 +57,23 @@ mc_func(avg, sz, v, ssse3)
mc_funcs(4);
mc_funcs(8);
+#if ARCH_X86_64
+mc_funcs(16);
+#endif
#undef mc_funcs
#undef mc_func
#define mc_rep_func(avg, sz, hsz, dir, opt) \
static av_always_inline void \
-ff_##avg##_8tap_1d_##dir##_##sz##_##opt(uint8_t *dst, ptrdiff_t dst_stride, \
- const uint8_t *src, ptrdiff_t src_stride, \
- int h, const int8_t (*filter)[16]) \
+ff_vp9_##avg##_8tap_1d_##dir##_##sz##_##opt(uint8_t *dst, ptrdiff_t dst_stride, \
+ const uint8_t *src, ptrdiff_t src_stride, \
+ int h, const int8_t (*filter)[16]) \
{ \
- ff_##avg##_8tap_1d_##dir##_##hsz##_##opt(dst, dst_stride, src, \
- src_stride, h, filter); \
- ff_##avg##_8tap_1d_##dir##_##hsz##_##opt(dst + hsz, dst_stride, src + hsz, \
- src_stride, h, filter); \
+ ff_vp9_##avg##_8tap_1d_##dir##_##hsz##_##opt(dst, dst_stride, src, \
+ src_stride, h, filter); \
+ ff_vp9_##avg##_8tap_1d_##dir##_##hsz##_##opt(dst + hsz, dst_stride, src + hsz, \
+ src_stride, h, filter); \
}
#define mc_rep_funcs(sz, hsz) \
@@ -78,7 +82,9 @@ mc_rep_func(avg, sz, hsz, h, ssse3); \
mc_rep_func(put, sz, hsz, v, ssse3); \
mc_rep_func(avg, sz, hsz, v, ssse3)
+#if ARCH_X86_32
mc_rep_funcs(16, 8);
+#endif
mc_rep_funcs(32, 16);
mc_rep_funcs(64, 32);
@@ -93,10 +99,10 @@ static void op##_8tap_##fname##_##sz##hv_ssse3(uint8_t *dst, ptrdiff_t dst_strid
int h, int mx, int my) \
{ \
LOCAL_ALIGNED_16(uint8_t, temp, [71 * 64]); \
- ff_put_8tap_1d_h_##sz##_ssse3(temp, 64, src - 3 * src_stride, src_stride, \
- h + 7, ff_filters_ssse3[f][mx - 1]); \
- ff_##op##_8tap_1d_v_##sz##_ssse3(dst, dst_stride, temp + 3 * 64, 64, \
- h, ff_filters_ssse3[f][my - 1]); \
+ ff_vp9_put_8tap_1d_h_##sz##_ssse3(temp, 64, src - 3 * src_stride, src_stride, \
+ h + 7, ff_filters_ssse3[f][mx - 1]); \
+ ff_vp9_##op##_8tap_1d_v_##sz##_ssse3(dst, dst_stride, temp + 3 * 64, 64, \
+ h, ff_filters_ssse3[f][my - 1]); \
}
#define filters_8tap_2d_fn(op, sz) \
@@ -123,8 +129,8 @@ static void op##_8tap_##fname##_##sz##dir##_ssse3(uint8_t *dst, ptrdiff_t dst_st
const uint8_t *src, ptrdiff_t src_stride, \
int h, int mx, int my) \
{ \
- ff_##op##_8tap_1d_##dir##_##sz##_ssse3(dst, dst_stride, src, src_stride, \
- h, ff_filters_ssse3[f][dvar - 1]); \
+ ff_vp9_##op##_8tap_1d_##dir##_##sz##_ssse3(dst, dst_stride, src, src_stride, \
+ h, ff_filters_ssse3[f][dvar - 1]); \
}
#define filters_8tap_1d_fn(op, sz, dir, dvar) \
@@ -151,8 +157,93 @@ filters_8tap_1d_fn3(avg)
#undef filters_8tap_1d_fn3
#undef filter_8tap_1d_fn
-void ff_vp9_idct_idct_4x4_add_ssse3(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
-void ff_vp9_idct_idct_8x8_add_ssse3(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
+#define itxfm_func(typea, typeb, size, opt) \
+void ff_vp9_##typea##_##typeb##_##size##x##size##_add_##opt(uint8_t *dst, ptrdiff_t stride, \
+ int16_t *block, int eob)
+#define itxfm_funcs(size, opt) \
+itxfm_func(idct, idct, size, opt); \
+itxfm_func(iadst, idct, size, opt); \
+itxfm_func(idct, iadst, size, opt); \
+itxfm_func(iadst, iadst, size, opt)
+
+itxfm_funcs(4, ssse3);
+itxfm_funcs(8, ssse3);
+itxfm_funcs(8, avx);
+itxfm_funcs(16, ssse3);
+itxfm_funcs(16, avx);
+itxfm_func(idct, idct, 32, ssse3);
+itxfm_func(idct, idct, 32, avx);
+itxfm_func(iwht, iwht, 4, mmx);
+
+#undef itxfm_func
+#undef itxfm_funcs
+
+#define lpf_funcs(size1, size2, opt) \
+void ff_vp9_loop_filter_v_##size1##_##size2##_##opt(uint8_t *dst, ptrdiff_t stride, \
+ int E, int I, int H); \
+void ff_vp9_loop_filter_h_##size1##_##size2##_##opt(uint8_t *dst, ptrdiff_t stride, \
+ int E, int I, int H)
+
+lpf_funcs(16, 16, sse2);
+lpf_funcs(16, 16, ssse3);
+lpf_funcs(16, 16, avx);
+lpf_funcs(44, 16, sse2);
+lpf_funcs(44, 16, ssse3);
+lpf_funcs(44, 16, avx);
+lpf_funcs(84, 16, sse2);
+lpf_funcs(84, 16, ssse3);
+lpf_funcs(84, 16, avx);
+lpf_funcs(48, 16, sse2);
+lpf_funcs(48, 16, ssse3);
+lpf_funcs(48, 16, avx);
+lpf_funcs(88, 16, sse2);
+lpf_funcs(88, 16, ssse3);
+lpf_funcs(88, 16, avx);
+
+#undef lpf_funcs
+
+#define ipred_func(size, type, opt) \
+void ff_vp9_ipred_##type##_##size##x##size##_##opt(uint8_t *dst, ptrdiff_t stride, \
+ const uint8_t *l, const uint8_t *a)
+
+#define ipred_funcs(type, opt) \
+ipred_func(4, type, opt); \
+ipred_func(8, type, opt); \
+ipred_func(16, type, opt); \
+ipred_func(32, type, opt)
+
+ipred_funcs(dc, ssse3);
+ipred_funcs(dc_left, ssse3);
+ipred_funcs(dc_top, ssse3);
+
+#undef ipred_funcs
+
+ipred_func(8, v, mmx);
+ipred_func(16, v, sse2);
+ipred_func(32, v, sse2);
+
+#define ipred_func_set(size, type, opt1, opt2) \
+ipred_func(size, type, opt1); \
+ipred_func(size, type, opt2)
+
+#define ipred_funcs(type, opt1, opt2) \
+ipred_func(4, type, opt1); \
+ipred_func_set(8, type, opt1, opt2); \
+ipred_func_set(16, type, opt1, opt2); \
+ipred_func_set(32, type, opt1, opt2)
+
+ipred_funcs(h, ssse3, avx);
+ipred_funcs(tm, ssse3, avx);
+ipred_funcs(dl, ssse3, avx);
+ipred_funcs(dr, ssse3, avx);
+ipred_funcs(hu, ssse3, avx);
+ipred_funcs(hd, ssse3, avx);
+ipred_funcs(vl, ssse3, avx);
+ipred_funcs(vr, ssse3, avx);
+
+#undef ipred_funcs
+#undef ipred_func_set
+#undef ipred_func
#endif /* HAVE_YASM */
@@ -165,8 +256,7 @@ av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp)
dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][0][0] = \
dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][0][0] = \
dsp->mc[idx1][FILTER_8TAP_SHARP ][idx2][0][0] = \
- dsp->mc[idx1][FILTER_BILINEAR ][idx2][0][0] = ff_##type##sz##_##opt
-
+ dsp->mc[idx1][FILTER_BILINEAR ][idx2][0][0] = ff_vp9_##type##sz##_##opt
#define init_subpel1(idx1, idx2, idxh, idxv, sz, dir, type, opt) \
dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][idxh][idxv] = type##_8tap_smooth_##sz##dir##_##opt; \
@@ -185,31 +275,117 @@ av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp)
init_subpel2(idx, 0, 1, v, type, opt); \
init_subpel2(idx, 1, 0, h, type, opt)
+#define init_lpf(opt) do { \
+ if (ARCH_X86_64) { \
+ dsp->loop_filter_16[0] = ff_vp9_loop_filter_h_16_16_##opt; \
+ dsp->loop_filter_16[1] = ff_vp9_loop_filter_v_16_16_##opt; \
+ dsp->loop_filter_mix2[0][0][0] = ff_vp9_loop_filter_h_44_16_##opt; \
+ dsp->loop_filter_mix2[0][0][1] = ff_vp9_loop_filter_v_44_16_##opt; \
+ dsp->loop_filter_mix2[0][1][0] = ff_vp9_loop_filter_h_48_16_##opt; \
+ dsp->loop_filter_mix2[0][1][1] = ff_vp9_loop_filter_v_48_16_##opt; \
+ dsp->loop_filter_mix2[1][0][0] = ff_vp9_loop_filter_h_84_16_##opt; \
+ dsp->loop_filter_mix2[1][0][1] = ff_vp9_loop_filter_v_84_16_##opt; \
+ dsp->loop_filter_mix2[1][1][0] = ff_vp9_loop_filter_h_88_16_##opt; \
+ dsp->loop_filter_mix2[1][1][1] = ff_vp9_loop_filter_v_88_16_##opt; \
+ } \
+} while (0)
+
+#define init_ipred(tx, sz, opt) do { \
+ dsp->intra_pred[tx][HOR_PRED] = ff_vp9_ipred_h_##sz##x##sz##_##opt; \
+ dsp->intra_pred[tx][DIAG_DOWN_LEFT_PRED] = ff_vp9_ipred_dl_##sz##x##sz##_##opt; \
+ dsp->intra_pred[tx][DIAG_DOWN_RIGHT_PRED] = ff_vp9_ipred_dr_##sz##x##sz##_##opt; \
+ dsp->intra_pred[tx][HOR_DOWN_PRED] = ff_vp9_ipred_hd_##sz##x##sz##_##opt; \
+ dsp->intra_pred[tx][VERT_LEFT_PRED] = ff_vp9_ipred_vl_##sz##x##sz##_##opt; \
+ dsp->intra_pred[tx][HOR_UP_PRED] = ff_vp9_ipred_hu_##sz##x##sz##_##opt; \
+ if (ARCH_X86_64 || tx != TX_32X32) { \
+ dsp->intra_pred[tx][VERT_RIGHT_PRED] = ff_vp9_ipred_vr_##sz##x##sz##_##opt; \
+ dsp->intra_pred[tx][TM_VP8_PRED] = ff_vp9_ipred_tm_##sz##x##sz##_##opt; \
+ } \
+} while (0)
+#define init_dc_ipred(tx, sz, opt) do { \
+ init_ipred(tx, sz, opt); \
+ dsp->intra_pred[tx][DC_PRED] = ff_vp9_ipred_dc_##sz##x##sz##_##opt; \
+ dsp->intra_pred[tx][LEFT_DC_PRED] = ff_vp9_ipred_dc_left_##sz##x##sz##_##opt; \
+ dsp->intra_pred[tx][TOP_DC_PRED] = ff_vp9_ipred_dc_top_##sz##x##sz##_##opt; \
+} while (0)
+
if (EXTERNAL_MMX(cpu_flags)) {
init_fpel(4, 0, 4, put, mmx);
init_fpel(3, 0, 8, put, mmx);
+ dsp->itxfm_add[4 /* lossless */][DCT_DCT] =
+ dsp->itxfm_add[4 /* lossless */][ADST_DCT] =
+ dsp->itxfm_add[4 /* lossless */][DCT_ADST] =
+ dsp->itxfm_add[4 /* lossless */][ADST_ADST] = ff_vp9_iwht_iwht_4x4_add_mmx;
+ dsp->intra_pred[TX_8X8][VERT_PRED] = ff_vp9_ipred_v_8x8_mmx;
+ }
+
+ if (EXTERNAL_MMXEXT(cpu_flags)) {
+ init_fpel(4, 1, 4, avg, mmxext);
+ init_fpel(3, 1, 8, avg, mmxext);
}
if (EXTERNAL_SSE(cpu_flags)) {
init_fpel(2, 0, 16, put, sse);
init_fpel(1, 0, 32, put, sse);
init_fpel(0, 0, 64, put, sse);
- init_fpel(4, 1, 4, avg, sse);
- init_fpel(3, 1, 8, avg, sse);
}
if (EXTERNAL_SSE2(cpu_flags)) {
init_fpel(2, 1, 16, avg, sse2);
init_fpel(1, 1, 32, avg, sse2);
init_fpel(0, 1, 64, avg, sse2);
+ init_lpf(sse2);
+ dsp->intra_pred[TX_16X16][VERT_PRED] = ff_vp9_ipred_v_16x16_sse2;
+ dsp->intra_pred[TX_32X32][VERT_PRED] = ff_vp9_ipred_v_32x32_sse2;
}
if (EXTERNAL_SSSE3(cpu_flags)) {
init_subpel3(0, put, ssse3);
init_subpel3(1, avg, ssse3);
dsp->itxfm_add[TX_4X4][DCT_DCT] = ff_vp9_idct_idct_4x4_add_ssse3;
- if (ARCH_X86_64)
+ dsp->itxfm_add[TX_4X4][ADST_DCT] = ff_vp9_idct_iadst_4x4_add_ssse3;
+ dsp->itxfm_add[TX_4X4][DCT_ADST] = ff_vp9_iadst_idct_4x4_add_ssse3;
+ dsp->itxfm_add[TX_4X4][ADST_ADST] = ff_vp9_iadst_iadst_4x4_add_ssse3;
+ if (ARCH_X86_64) {
dsp->itxfm_add[TX_8X8][DCT_DCT] = ff_vp9_idct_idct_8x8_add_ssse3;
+ dsp->itxfm_add[TX_8X8][ADST_DCT] = ff_vp9_idct_iadst_8x8_add_ssse3;
+ dsp->itxfm_add[TX_8X8][DCT_ADST] = ff_vp9_iadst_idct_8x8_add_ssse3;
+ dsp->itxfm_add[TX_8X8][ADST_ADST] = ff_vp9_iadst_iadst_8x8_add_ssse3;
+ dsp->itxfm_add[TX_16X16][DCT_DCT] = ff_vp9_idct_idct_16x16_add_ssse3;
+ dsp->itxfm_add[TX_16X16][ADST_DCT] = ff_vp9_idct_iadst_16x16_add_ssse3;
+ dsp->itxfm_add[TX_16X16][DCT_ADST] = ff_vp9_iadst_idct_16x16_add_ssse3;
+ dsp->itxfm_add[TX_16X16][ADST_ADST] = ff_vp9_iadst_iadst_16x16_add_ssse3;
+ dsp->itxfm_add[TX_32X32][ADST_ADST] =
+ dsp->itxfm_add[TX_32X32][ADST_DCT] =
+ dsp->itxfm_add[TX_32X32][DCT_ADST] =
+ dsp->itxfm_add[TX_32X32][DCT_DCT] = ff_vp9_idct_idct_32x32_add_ssse3;
+ }
+ init_lpf(ssse3);
+ init_dc_ipred(TX_4X4, 4, ssse3);
+ init_dc_ipred(TX_8X8, 8, ssse3);
+ init_dc_ipred(TX_16X16, 16, ssse3);
+ init_dc_ipred(TX_32X32, 32, ssse3);
+ }
+
+ if (EXTERNAL_AVX(cpu_flags)) {
+ if (ARCH_X86_64) {
+ dsp->itxfm_add[TX_8X8][DCT_DCT] = ff_vp9_idct_idct_8x8_add_avx;
+ dsp->itxfm_add[TX_8X8][ADST_DCT] = ff_vp9_idct_iadst_8x8_add_avx;
+ dsp->itxfm_add[TX_8X8][DCT_ADST] = ff_vp9_iadst_idct_8x8_add_avx;
+ dsp->itxfm_add[TX_8X8][ADST_ADST] = ff_vp9_iadst_iadst_8x8_add_avx;
+ dsp->itxfm_add[TX_16X16][DCT_DCT] = ff_vp9_idct_idct_16x16_add_avx;
+ dsp->itxfm_add[TX_16X16][ADST_DCT] = ff_vp9_idct_iadst_16x16_add_avx;
+ dsp->itxfm_add[TX_16X16][DCT_ADST] = ff_vp9_iadst_idct_16x16_add_avx;
+ dsp->itxfm_add[TX_16X16][ADST_ADST] = ff_vp9_iadst_iadst_16x16_add_avx;
+ dsp->itxfm_add[TX_32X32][ADST_ADST] =
+ dsp->itxfm_add[TX_32X32][ADST_DCT] =
+ dsp->itxfm_add[TX_32X32][DCT_ADST] =
+ dsp->itxfm_add[TX_32X32][DCT_DCT] = ff_vp9_idct_idct_32x32_add_avx;
+ }
+ init_lpf(avx);
+ init_ipred(TX_8X8, 8, avx);
+ init_ipred(TX_16X16, 16, avx);
+ init_ipred(TX_32X32, 32, avx);
}
#undef init_fpel
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp9intrapred.asm b/chromium/third_party/ffmpeg/libavcodec/x86/vp9intrapred.asm
new file mode 100644
index 00000000000..3faf1c564d9
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp9intrapred.asm
@@ -0,0 +1,1405 @@
+;******************************************************************************
+;* VP9 Intra prediction SIMD optimizations
+;*
+;* Copyright (c) 2013 Ronald S. Bultje <rsbultje gmail com>
+;*
+;* Parts based on:
+;* H.264 intra prediction asm optimizations
+;* Copyright (c) 2010 Jason Garrett-Glaser
+;* Copyright (c) 2010 Holger Lubitz
+;* Copyright (c) 2010 Loren Merritt
+;* Copyright (c) 2010 Ronald S. Bultje
+;*
+;* 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 "libavutil/x86/x86util.asm"
+
+SECTION_RODATA
+
+pw_m256: times 8 dw -256
+pw_m255: times 8 dw -255
+pw_512: times 8 dw 512
+pw_1024: times 8 dw 1024
+pw_2048: times 8 dw 2048
+pw_4096: times 8 dw 4096
+pw_8192: times 8 dw 8192
+
+pb_4x3_4x2_4x1_4x0: times 4 db 3
+ times 4 db 2
+ times 4 db 1
+ times 4 db 0
+pb_8x1_8x0: times 8 db 1
+ times 8 db 0
+pb_8x3_8x2: times 8 db 3
+ times 8 db 2
+pb_0to5_2x7: db 0, 1, 2, 3, 4, 5, 7, 7
+ times 8 db -1
+pb_0to6_9x7: db 0, 1, 2, 3, 4, 5, 6
+ times 9 db 7
+pb_1to6_10x7: db 1, 2, 3, 4, 5, 6
+ times 10 db 7
+pb_2to6_3x7:
+pb_2to6_11x7: db 2, 3, 4, 5, 6
+ times 11 db 7
+pb_1toE_2xF: db 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15
+pb_2toE_3xF: db 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15
+pb_13456_3xm1: db 1, 3, 4, 5, 6
+ times 3 db -1
+pb_6012_4xm1: db 6, 0, 1, 2
+ times 4 db -1
+pb_6xm1_246_8toE: times 6 db -1
+ db 2, 4, 6, 8, 9, 10, 11, 12, 13, 14
+pb_6xm1_BDF_0to6: times 6 db -1
+ db 11, 13, 15, 0, 1, 2, 3, 4, 5, 6
+pb_02468ACE_13579BDF: db 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15
+pb_7to1_9x0: db 7, 6, 5, 4
+pb_3to1_5x0: db 3, 2, 1
+ times 9 db 0
+pb_Fto0: db 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
+
+pb_2: times 16 db 2
+pb_15: times 16 db 15
+
+cextern pb_1
+cextern pb_3
+
+SECTION .text
+
+; dc_NxN(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
+
+INIT_MMX ssse3
+cglobal vp9_ipred_dc_4x4, 4, 4, 0, dst, stride, l, a
+ movd m0, [lq]
+ punpckldq m0, [aq]
+ pxor m1, m1
+ psadbw m0, m1
+ pmulhrsw m0, [pw_4096]
+ pshufb m0, m1
+ movd [dstq+strideq*0], m0
+ movd [dstq+strideq*1], m0
+ lea dstq, [dstq+strideq*2]
+ movd [dstq+strideq*0], m0
+ movd [dstq+strideq*1], m0
+ RET
+
+INIT_MMX ssse3
+cglobal vp9_ipred_dc_8x8, 4, 4, 0, dst, stride, l, a
+ movq m0, [lq]
+ movq m1, [aq]
+ DEFINE_ARGS dst, stride, stride3
+ lea stride3q, [strideq*3]
+ pxor m2, m2
+ psadbw m0, m2
+ psadbw m1, m2
+ paddw m0, m1
+ pmulhrsw m0, [pw_2048]
+ pshufb m0, m2
+ movq [dstq+strideq*0], m0
+ movq [dstq+strideq*1], m0
+ movq [dstq+strideq*2], m0
+ movq [dstq+stride3q ], m0
+ lea dstq, [dstq+strideq*4]
+ movq [dstq+strideq*0], m0
+ movq [dstq+strideq*1], m0
+ movq [dstq+strideq*2], m0
+ movq [dstq+stride3q ], m0
+ RET
+
+INIT_XMM ssse3
+cglobal vp9_ipred_dc_16x16, 4, 4, 3, dst, stride, l, a
+ mova m0, [lq]
+ mova m1, [aq]
+ DEFINE_ARGS dst, stride, stride3, cnt
+ lea stride3q, [strideq*3]
+ pxor m2, m2
+ psadbw m0, m2
+ psadbw m1, m2
+ paddw m0, m1
+ movhlps m1, m0
+ paddw m0, m1
+ pmulhrsw m0, [pw_1024]
+ pshufb m0, m2
+ mov cntd, 4
+.loop:
+ mova [dstq+strideq*0], m0
+ mova [dstq+strideq*1], m0
+ mova [dstq+strideq*2], m0
+ mova [dstq+stride3q ], m0
+ lea dstq, [dstq+strideq*4]
+ dec cntd
+ jg .loop
+ RET
+
+INIT_XMM ssse3
+cglobal vp9_ipred_dc_32x32, 4, 4, 5, dst, stride, l, a
+ mova m0, [lq]
+ mova m1, [lq+16]
+ mova m2, [aq]
+ mova m3, [aq+16]
+ DEFINE_ARGS dst, stride, stride3, cnt
+ lea stride3q, [strideq*3]
+ pxor m4, m4
+ psadbw m0, m4
+ psadbw m1, m4
+ psadbw m2, m4
+ psadbw m3, m4
+ paddw m0, m1
+ paddw m2, m3
+ paddw m0, m2
+ movhlps m1, m0
+ paddw m0, m1
+ pmulhrsw m0, [pw_512]
+ pshufb m0, m4
+ mov cntd, 8
+.loop:
+ mova [dstq+strideq*0+ 0], m0
+ mova [dstq+strideq*0+16], m0
+ mova [dstq+strideq*1+ 0], m0
+ mova [dstq+strideq*1+16], m0
+ mova [dstq+strideq*2+ 0], m0
+ mova [dstq+strideq*2+16], m0
+ mova [dstq+stride3q + 0], m0
+ mova [dstq+stride3q +16], m0
+ lea dstq, [dstq+strideq*4]
+ dec cntd
+ jg .loop
+ RET
+
+; dc_top/left_NxN(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
+
+%macro DC_1D_FUNCS 2 ; dir (top or left), arg (a or l)
+INIT_MMX ssse3
+cglobal vp9_ipred_dc_%1_4x4, 4, 4, 0, dst, stride, l, a
+ movd m0, [%2q]
+ pxor m1, m1
+ psadbw m0, m1
+ pmulhrsw m0, [pw_8192]
+ pshufb m0, m1
+ movd [dstq+strideq*0], m0
+ movd [dstq+strideq*1], m0
+ lea dstq, [dstq+strideq*2]
+ movd [dstq+strideq*0], m0
+ movd [dstq+strideq*1], m0
+ RET
+
+INIT_MMX ssse3
+cglobal vp9_ipred_dc_%1_8x8, 4, 4, 0, dst, stride, l, a
+ movq m0, [%2q]
+ DEFINE_ARGS dst, stride, stride3
+ lea stride3q, [strideq*3]
+ pxor m1, m1
+ psadbw m0, m1
+ pmulhrsw m0, [pw_4096]
+ pshufb m0, m1
+ movq [dstq+strideq*0], m0
+ movq [dstq+strideq*1], m0
+ movq [dstq+strideq*2], m0
+ movq [dstq+stride3q ], m0
+ lea dstq, [dstq+strideq*4]
+ movq [dstq+strideq*0], m0
+ movq [dstq+strideq*1], m0
+ movq [dstq+strideq*2], m0
+ movq [dstq+stride3q ], m0
+ RET
+
+INIT_XMM ssse3
+cglobal vp9_ipred_dc_%1_16x16, 4, 4, 3, dst, stride, l, a
+ mova m0, [%2q]
+ DEFINE_ARGS dst, stride, stride3, cnt
+ lea stride3q, [strideq*3]
+ pxor m2, m2
+ psadbw m0, m2
+ movhlps m1, m0
+ paddw m0, m1
+ pmulhrsw m0, [pw_2048]
+ pshufb m0, m2
+ mov cntd, 4
+.loop:
+ mova [dstq+strideq*0], m0
+ mova [dstq+strideq*1], m0
+ mova [dstq+strideq*2], m0
+ mova [dstq+stride3q ], m0
+ lea dstq, [dstq+strideq*4]
+ dec cntd
+ jg .loop
+ RET
+
+INIT_XMM ssse3
+cglobal vp9_ipred_dc_%1_32x32, 4, 4, 3, dst, stride, l, a
+ mova m0, [%2q]
+ mova m1, [%2q+16]
+ DEFINE_ARGS dst, stride, stride3, cnt
+ lea stride3q, [strideq*3]
+ pxor m2, m2
+ psadbw m0, m2
+ psadbw m1, m2
+ paddw m0, m1
+ movhlps m1, m0
+ paddw m0, m1
+ pmulhrsw m0, [pw_1024]
+ pshufb m0, m2
+ mov cntd, 8
+.loop:
+ mova [dstq+strideq*0+ 0], m0
+ mova [dstq+strideq*0+16], m0
+ mova [dstq+strideq*1+ 0], m0
+ mova [dstq+strideq*1+16], m0
+ mova [dstq+strideq*2+ 0], m0
+ mova [dstq+strideq*2+16], m0
+ mova [dstq+stride3q + 0], m0
+ mova [dstq+stride3q +16], m0
+ lea dstq, [dstq+strideq*4]
+ dec cntd
+ jg .loop
+ RET
+%endmacro
+
+DC_1D_FUNCS top, a
+DC_1D_FUNCS left, l
+
+; v
+
+INIT_MMX mmx
+cglobal vp9_ipred_v_8x8, 4, 4, 0, dst, stride, l, a
+ movq m0, [aq]
+ DEFINE_ARGS dst, stride, stride3
+ lea stride3q, [strideq*3]
+ movq [dstq+strideq*0], m0
+ movq [dstq+strideq*1], m0
+ movq [dstq+strideq*2], m0
+ movq [dstq+stride3q ], m0
+ lea dstq, [dstq+strideq*4]
+ movq [dstq+strideq*0], m0
+ movq [dstq+strideq*1], m0
+ movq [dstq+strideq*2], m0
+ movq [dstq+stride3q ], m0
+ RET
+
+INIT_XMM sse2
+cglobal vp9_ipred_v_16x16, 4, 4, 1, dst, stride, l, a
+ mova m0, [aq]
+ DEFINE_ARGS dst, stride, stride3, cnt
+ lea stride3q, [strideq*3]
+ mov cntd, 4
+.loop:
+ mova [dstq+strideq*0], m0
+ mova [dstq+strideq*1], m0
+ mova [dstq+strideq*2], m0
+ mova [dstq+stride3q ], m0
+ lea dstq, [dstq+strideq*4]
+ dec cntd
+ jg .loop
+ RET
+
+INIT_XMM sse2
+cglobal vp9_ipred_v_32x32, 4, 4, 2, dst, stride, l, a
+ mova m0, [aq]
+ mova m1, [aq+16]
+ DEFINE_ARGS dst, stride, stride3, cnt
+ lea stride3q, [strideq*3]
+ mov cntd, 8
+.loop:
+ mova [dstq+strideq*0+ 0], m0
+ mova [dstq+strideq*0+16], m1
+ mova [dstq+strideq*1+ 0], m0
+ mova [dstq+strideq*1+16], m1
+ mova [dstq+strideq*2+ 0], m0
+ mova [dstq+strideq*2+16], m1
+ mova [dstq+stride3q + 0], m0
+ mova [dstq+stride3q +16], m1
+ lea dstq, [dstq+strideq*4]
+ dec cntd
+ jg .loop
+ RET
+
+; h
+
+INIT_XMM ssse3
+cglobal vp9_ipred_h_4x4, 3, 4, 1, dst, stride, l, stride3
+ movd m0, [lq]
+ pshufb m0, [pb_4x3_4x2_4x1_4x0]
+ lea stride3q, [strideq*3]
+ movd [dstq+strideq*0], m0
+ psrldq m0, 4
+ movd [dstq+strideq*1], m0
+ psrldq m0, 4
+ movd [dstq+strideq*2], m0
+ psrldq m0, 4
+ movd [dstq+stride3q ], m0
+ RET
+
+%macro H_XMM_FUNCS 1
+INIT_XMM %1
+cglobal vp9_ipred_h_8x8, 3, 5, 4, dst, stride, l, stride3, cnt
+ mova m2, [pb_8x1_8x0]
+ mova m3, [pb_8x3_8x2]
+ lea stride3q, [strideq*3]
+ mov cntq, 1
+.loop:
+ movd m0, [lq+cntq*4]
+ pshufb m1, m0, m3
+ pshufb m0, m2
+ movq [dstq+strideq*0], m1
+ movhps [dstq+strideq*1], m1
+ movq [dstq+strideq*2], m0
+ movhps [dstq+stride3q ], m0
+ lea dstq, [dstq+strideq*4]
+ dec cntq
+ jge .loop
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_h_16x16, 3, 5, 8, dst, stride, l, stride3, cnt
+ mova m5, [pb_1]
+ mova m6, [pb_2]
+ mova m7, [pb_3]
+ pxor m4, m4
+ lea stride3q, [strideq*3]
+ mov cntq, 3
+.loop:
+ movd m3, [lq+cntq*4]
+ pshufb m0, m3, m7
+ pshufb m1, m3, m6
+ mova [dstq+strideq*0], m0
+ mova [dstq+strideq*1], m1
+ pshufb m2, m3, m5
+ pshufb m3, m4
+ mova [dstq+strideq*2], m2
+ mova [dstq+stride3q ], m3
+ lea dstq, [dstq+strideq*4]
+ dec cntq
+ jge .loop
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_h_32x32, 3, 5, 8, dst, stride, l, stride3, cnt
+ mova m5, [pb_1]
+ mova m6, [pb_2]
+ mova m7, [pb_3]
+ pxor m4, m4
+ lea stride3q, [strideq*3]
+ mov cntq, 7
+.loop:
+ movd m3, [lq+cntq*4]
+ pshufb m0, m3, m7
+ pshufb m1, m3, m6
+ mova [dstq+strideq*0+ 0], m0
+ mova [dstq+strideq*0+16], m0
+ mova [dstq+strideq*1+ 0], m1
+ mova [dstq+strideq*1+16], m1
+ pshufb m2, m3, m5
+ pshufb m3, m4
+ mova [dstq+strideq*2+ 0], m2
+ mova [dstq+strideq*2+16], m2
+ mova [dstq+stride3q + 0], m3
+ mova [dstq+stride3q +16], m3
+ lea dstq, [dstq+strideq*4]
+ dec cntq
+ jge .loop
+ RET
+%endmacro
+
+H_XMM_FUNCS ssse3
+H_XMM_FUNCS avx
+
+; tm
+
+INIT_MMX ssse3
+cglobal vp9_ipred_tm_4x4, 4, 4, 0, dst, stride, l, a
+ pxor m1, m1
+ pinsrw m2, [aq-1], 0
+ movd m0, [aq]
+ DEFINE_ARGS dst, stride, l, cnt
+ mova m3, [pw_m256]
+ mova m4, [pw_m255]
+ pshufb m2, m3
+ punpcklbw m0, m1
+ psubw m0, m2
+ mov cntq, 1
+.loop:
+ pinsrw m2, [lq+cntq*2], 0
+ pshufb m1, m2, m4
+ pshufb m2, m3
+ paddw m1, m0
+ paddw m2, m0
+ packuswb m1, m1
+ packuswb m2, m2
+ movd [dstq+strideq*0], m1
+ movd [dstq+strideq*1], m2
+ lea dstq, [dstq+strideq*2]
+ dec cntq
+ jge .loop
+ RET
+
+%macro TM_XMM_FUNCS 1
+INIT_XMM %1
+cglobal vp9_ipred_tm_8x8, 4, 4, 5, dst, stride, l, a
+ pxor m1, m1
+ pinsrw m2, [aq-1], 0
+ movh m0, [aq]
+ DEFINE_ARGS dst, stride, l, cnt
+ mova m3, [pw_m256]
+ mova m4, [pw_m255]
+ pshufb m2, m3
+ punpcklbw m0, m1
+ psubw m0, m2
+ mov cntq, 3
+.loop:
+ pinsrw m2, [lq+cntq*2], 0
+ pshufb m1, m2, m4
+ pshufb m2, m3
+ paddw m1, m0
+ paddw m2, m0
+ packuswb m1, m2
+ movh [dstq+strideq*0], m1
+ movhps [dstq+strideq*1], m1
+ lea dstq, [dstq+strideq*2]
+ dec cntq
+ jge .loop
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_tm_16x16, 4, 4, 8, dst, stride, l, a
+ pxor m3, m3
+ pinsrw m2, [aq-1], 0
+ mova m0, [aq]
+ DEFINE_ARGS dst, stride, l, cnt
+ mova m4, [pw_m256]
+ mova m5, [pw_m255]
+ pshufb m2, m4
+ punpckhbw m1, m0, m3
+ punpcklbw m0, m3
+ psubw m1, m2
+ psubw m0, m2
+ mov cntq, 7
+.loop:
+ pinsrw m7, [lq+cntq*2], 0
+ pshufb m3, m7, m5
+ pshufb m7, m4
+ paddw m2, m3, m0
+ paddw m3, m1
+ paddw m6, m7, m0
+ paddw m7, m1
+ packuswb m2, m3
+ packuswb m6, m7
+ mova [dstq+strideq*0], m2
+ mova [dstq+strideq*1], m6
+ lea dstq, [dstq+strideq*2]
+ dec cntq
+ jge .loop
+ RET
+
+%if ARCH_X86_64
+INIT_XMM %1
+cglobal vp9_ipred_tm_32x32, 4, 4, 14, dst, stride, l, a
+ pxor m5, m5
+ pinsrw m4, [aq-1], 0
+ mova m0, [aq]
+ mova m2, [aq+16]
+ DEFINE_ARGS dst, stride, l, cnt
+ mova m8, [pw_m256]
+ mova m9, [pw_m255]
+ pshufb m4, m8
+ punpckhbw m1, m0, m5
+ punpckhbw m3, m2, m5
+ punpcklbw m0, m5
+ punpcklbw m2, m5
+ psubw m1, m4
+ psubw m0, m4
+ psubw m3, m4
+ psubw m2, m4
+ mov cntq, 15
+.loop:
+ pinsrw m13, [lq+cntq*2], 0
+ pshufb m7, m13, m9
+ pshufb m13, m8
+ paddw m4, m7, m0
+ paddw m5, m7, m1
+ paddw m6, m7, m2
+ paddw m7, m3
+ paddw m10, m13, m0
+ paddw m11, m13, m1
+ paddw m12, m13, m2
+ paddw m13, m3
+ packuswb m4, m5
+ packuswb m6, m7
+ packuswb m10, m11
+ packuswb m12, m13
+ mova [dstq+strideq*0+ 0], m4
+ mova [dstq+strideq*0+16], m6
+ mova [dstq+strideq*1+ 0], m10
+ mova [dstq+strideq*1+16], m12
+ lea dstq, [dstq+strideq*2]
+ dec cntq
+ jge .loop
+ RET
+%endif
+%endmacro
+
+TM_XMM_FUNCS ssse3
+TM_XMM_FUNCS avx
+
+; dl
+
+%macro LOWPASS 4 ; left [dst], center, right, tmp
+ pxor m%4, m%1, m%3
+ pand m%4, [pb_1]
+ pavgb m%1, m%3
+ psubusb m%1, m%4
+ pavgb m%1, m%2
+%endmacro
+
+INIT_MMX ssse3
+cglobal vp9_ipred_dl_4x4, 4, 4, 0, dst, stride, l, a
+ movq m1, [aq]
+ pshufb m0, m1, [pb_0to5_2x7]
+ pshufb m2, m1, [pb_2to6_3x7]
+ psrlq m1, 8
+ LOWPASS 0, 1, 2, 3
+
+ pshufw m1, m0, q3321
+ movd [dstq+strideq*0], m0
+ movd [dstq+strideq*2], m1
+ psrlq m0, 8
+ psrlq m1, 8
+ add dstq, strideq
+ movd [dstq+strideq*0], m0
+ movd [dstq+strideq*2], m1
+ RET
+
+%macro DL_XMM_FUNCS 1
+INIT_XMM %1
+cglobal vp9_ipred_dl_8x8, 4, 4, 4, dst, stride, stride5, a
+ movq m0, [aq]
+ lea stride5q, [strideq*5]
+ pshufb m1, m0, [pb_1to6_10x7]
+ psrldq m2, m1, 1
+ shufps m0, m1, q3210
+ LOWPASS 0, 1, 2, 3
+
+ pshufd m1, m0, q3321
+ movq [dstq+strideq*0], m0
+ movq [dstq+strideq*4], m1
+ psrldq m0, 1
+ psrldq m1, 1
+ movq [dstq+strideq*1], m0
+ movq [dstq+stride5q ], m1
+ lea dstq, [dstq+strideq*2]
+ psrldq m0, 1
+ psrldq m1, 1
+ movq [dstq+strideq*0], m0
+ movq [dstq+strideq*4], m1
+ psrldq m0, 1
+ psrldq m1, 1
+ movq [dstq+strideq*1], m0
+ movq [dstq+stride5q ], m1
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_dl_16x16, 4, 4, 6, dst, stride, l, a
+ mova m5, [pb_1toE_2xF]
+ mova m0, [aq]
+ pshufb m1, m0, m5
+ pshufb m2, m1, m5
+ pshufb m4, m0, [pb_15]
+ LOWPASS 0, 1, 2, 3
+ DEFINE_ARGS dst, stride, cnt, stride9
+ lea stride9q, [strideq*3]
+ mov cntd, 4
+ lea stride9q, [stride9q*3]
+
+.loop:
+ movhlps m4, m0
+ mova [dstq+strideq*0], m0
+ pshufb m0, m5
+ mova [dstq+strideq*8], m4
+ movhlps m4, m0
+ mova [dstq+strideq*1], m0
+ pshufb m0, m5
+ mova [dstq+stride9q ], m4
+ lea dstq, [dstq+strideq*2]
+ dec cntd
+ jg .loop
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_dl_32x32, 4, 5, 8, dst, stride, cnt, a, dst16
+ mova m5, [pb_1toE_2xF]
+ mova m0, [aq]
+ mova m1, [aq+16]
+ palignr m2, m1, m0, 1
+ palignr m3, m1, m0, 2
+ LOWPASS 0, 2, 3, 4
+ pshufb m2, m1, m5
+ pshufb m3, m2, m5
+ pshufb m6, m1, [pb_15]
+ LOWPASS 1, 2, 3, 4
+ mova m7, m6
+ lea dst16q, [dstq +strideq*8]
+ mov cntd, 8
+ lea dst16q, [dst16q+strideq*8]
+.loop:
+ movhlps m7, m1
+ mova [dstq +strideq*0+ 0], m0
+ mova [dstq +strideq*0+16], m1
+ movhps [dstq+strideq*8+ 0], m0
+ movq [dstq +strideq*8+ 8], m1
+ mova [dstq +strideq*8+16], m7
+ mova [dst16q+strideq*0+ 0], m1
+ mova [dst16q+strideq*0+16], m6
+ mova [dst16q+strideq*8+ 0], m7
+ mova [dst16q+strideq*8+16], m6
+%if cpuflag(avx)
+ vpalignr m0, m1, m0, 1
+ pshufb m1, m5
+%else
+ palignr m2, m1, m0, 1
+ pshufb m1, m5
+ mova m0, m2
+%endif
+ add dstq, strideq
+ add dst16q, strideq
+ dec cntd
+ jg .loop
+ RET
+%endmacro
+
+DL_XMM_FUNCS ssse3
+DL_XMM_FUNCS avx
+
+; dr
+
+INIT_MMX ssse3
+cglobal vp9_ipred_dr_4x4, 4, 4, 0, dst, stride, l, a
+ movd m0, [lq]
+ punpckldq m0, [aq-1]
+ movd m1, [aq+3]
+ DEFINE_ARGS dst, stride, stride3
+ lea stride3q, [strideq*3]
+ palignr m1, m0, 1
+ psrlq m2, m1, 8
+ LOWPASS 0, 1, 2, 3
+
+ movd [dstq+stride3q ], m0
+ psrlq m0, 8
+ movd [dstq+strideq*2], m0
+ psrlq m0, 8
+ movd [dstq+strideq*1], m0
+ psrlq m0, 8
+ movd [dstq+strideq*0], m0
+ RET
+
+%macro DR_XMM_FUNCS 1
+INIT_XMM %1
+cglobal vp9_ipred_dr_8x8, 4, 4, 4, dst, stride, l, a
+ movq m1, [lq]
+ movhps m1, [aq-1]
+ movd m2, [aq+7]
+ DEFINE_ARGS dst, stride, stride3
+ lea stride3q, [strideq*3]
+ pslldq m0, m1, 1
+ palignr m2, m1, 1
+ LOWPASS 0, 1, 2, 3
+
+ movhps [dstq+strideq*0], m0
+ pslldq m0, 1
+ movhps [dstq+strideq*1], m0
+ pslldq m0, 1
+ movhps [dstq+strideq*2], m0
+ pslldq m0, 1
+ movhps [dstq+stride3q ], m0
+ pslldq m0, 1
+ lea dstq, [dstq+strideq*4]
+ movhps [dstq+strideq*0], m0
+ pslldq m0, 1
+ movhps [dstq+strideq*1], m0
+ pslldq m0, 1
+ movhps [dstq+strideq*2], m0
+ pslldq m0, 1
+ movhps [dstq+stride3q ], m0
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_dr_16x16, 4, 4, 6, dst, stride, l, a
+ mova m1, [lq]
+ movu m2, [aq-1]
+ movd m4, [aq+15]
+ DEFINE_ARGS dst, stride, stride9, cnt
+ lea stride9q, [strideq *3]
+ mov cntd, 4
+ lea stride9q, [stride9q*3]
+ palignr m4, m2, 1
+ palignr m3, m2, m1, 15
+ LOWPASS 3, 2, 4, 5
+ pslldq m0, m1, 1
+ palignr m2, m1, 1
+ LOWPASS 0, 1, 2, 4
+
+.loop:
+ mova [dstq+strideq*0 ], m3
+ movhps [dstq+strideq*8+0], m0
+ movq [dstq+strideq*8+8], m3
+ palignr m3, m0, 15
+ pslldq m0, 1
+ mova [dstq+strideq*1 ], m3
+ movhps [dstq+stride9q +0], m0
+ movq [dstq+stride9q +8], m3
+ palignr m3, m0, 15
+ pslldq m0, 1
+ lea dstq, [dstq+strideq*2]
+ dec cntd
+ jg .loop
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_dr_32x32, 4, 4, 8, dst, stride, l, a
+ mova m1, [lq]
+ mova m2, [lq+16]
+ movu m3, [aq-1]
+ movu m4, [aq+15]
+ movd m5, [aq+31]
+ DEFINE_ARGS dst, stride, stride8, cnt
+ lea stride8q, [strideq*8]
+ palignr m5, m4, 1
+ palignr m6, m4, m3, 15
+ LOWPASS 5, 4, 6, 7
+ palignr m4, m3, 1
+ palignr m6, m3, m2, 15
+ LOWPASS 4, 3, 6, 7
+ palignr m3, m2, 1
+ palignr m6, m2, m1, 15
+ LOWPASS 3, 2, 6, 7
+ palignr m2, m1, 1
+ pslldq m0, m1, 1
+ LOWPASS 2, 1, 0, 6
+ mov cntd, 16
+
+ ; out=m2/m3/m4/m5
+.loop:
+ mova [dstq+stride8q*0+ 0], m4
+ mova [dstq+stride8q*0+16], m5
+ mova [dstq+stride8q*2+ 0], m3
+ mova [dstq+stride8q*2+16], m4
+ palignr m5, m4, 15
+ palignr m4, m3, 15
+ palignr m3, m2, 15
+ pslldq m2, 1
+ add dstq, strideq
+ dec cntd
+ jg .loop
+ RET
+%endmacro
+
+DR_XMM_FUNCS ssse3
+DR_XMM_FUNCS avx
+
+; vl
+
+INIT_MMX ssse3
+cglobal vp9_ipred_vl_4x4, 4, 4, 0, dst, stride, l, a
+ movq m0, [aq]
+ psrlq m1, m0, 8
+ psrlq m2, m1, 8
+ LOWPASS 2, 1, 0, 3
+ pavgb m1, m0
+ movq [dstq+strideq*0], m1
+ movq [dstq+strideq*1], m2
+ lea dstq, [dstq+strideq*2]
+ psrlq m1, 8
+ psrlq m2, 8
+ movq [dstq+strideq*0], m1
+ movq [dstq+strideq*1], m2
+ RET
+
+%macro VL_XMM_FUNCS 1
+INIT_XMM %1
+cglobal vp9_ipred_vl_8x8, 4, 4, 4, dst, stride, l, a
+ movq m0, [aq]
+ pshufb m0, [pb_0to6_9x7]
+ DEFINE_ARGS dst, stride, stride3
+ lea stride3q, [strideq*3]
+ psrldq m1, m0, 1
+ psrldq m2, m0, 2
+ LOWPASS 2, 1, 0, 3
+ pavgb m1, m0
+
+ movq [dstq+strideq*0], m1
+ movq [dstq+strideq*1], m2
+ psrldq m1, 1
+ psrldq m2, 1
+ movq [dstq+strideq*2], m1
+ movq [dstq+stride3q ], m2
+ lea dstq, [dstq+strideq*4]
+ psrldq m1, 1
+ psrldq m2, 1
+ movq [dstq+strideq*0], m1
+ movq [dstq+strideq*1], m2
+ psrldq m1, 1
+ psrldq m2, 1
+ movq [dstq+strideq*2], m1
+ movq [dstq+stride3q ], m2
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_vl_16x16, 4, 4, 5, dst, stride, l, a
+ mova m0, [aq]
+ mova m4, [pb_1toE_2xF]
+ DEFINE_ARGS dst, stride, stride3, cnt
+ lea stride3q, [strideq*3]
+ pshufb m1, m0, m4
+ pshufb m2, m1, m4
+ LOWPASS 2, 1, 0, 3
+ pavgb m1, m0
+ mov cntd, 4
+.loop:
+ mova [dstq+strideq*0], m1
+ mova [dstq+strideq*1], m2
+ pshufb m1, m4
+ pshufb m2, m4
+ mova [dstq+strideq*2], m1
+ mova [dstq+stride3q ], m2
+ pshufb m1, m4
+ pshufb m2, m4
+ lea dstq, [dstq+strideq*4]
+ dec cntd
+ jg .loop
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_vl_32x32, 4, 4, 7, dst, stride, l, a
+ mova m0, [aq]
+ mova m5, [aq+16]
+ mova m4, [pb_1toE_2xF]
+ DEFINE_ARGS dst, stride, dst16, cnt
+ palignr m2, m5, m0, 1
+ palignr m3, m5, m0, 2
+ lea dst16q, [dstq +strideq*8]
+ LOWPASS 3, 2, 0, 6
+ pavgb m2, m0
+ pshufb m0, m5, m4
+ pshufb m1, m0, m4
+ lea dst16q, [dst16q+strideq*8]
+ LOWPASS 1, 0, 5, 6
+ pavgb m0, m5
+ pshufb m5, [pb_15]
+ mov cntd, 8
+
+.loop:
+%macro %%write 3
+ mova [dstq+stride%1+ 0], %2
+ mova [dstq+stride%1+16], %3
+ movhps [dst16q+stride%1 ], %2
+ movu [dst16q+stride%1+ 8], %3
+ movq [dst16q+stride%1+24], m5
+%if cpuflag(avx)
+ palignr %2, %3, %2, 1
+ pshufb %3, m4
+%else
+ palignr m6, %3, %2, 1
+ pshufb %3, m4
+ mova %2, m6
+%endif
+%endmacro
+
+ %%write q*0, m2, m0
+ %%write q*1, m3, m1
+ lea dstq, [dstq +strideq*2]
+ lea dst16q, [dst16q+strideq*2]
+ dec cntd
+ jg .loop
+ RET
+%endmacro
+
+VL_XMM_FUNCS ssse3
+VL_XMM_FUNCS avx
+
+; vr
+
+INIT_MMX ssse3
+cglobal vp9_ipred_vr_4x4, 4, 4, 0, dst, stride, l, a
+ movq m1, [aq-1]
+ punpckldq m2, [lq]
+ movd m0, [aq]
+ DEFINE_ARGS dst, stride, stride3
+ lea stride3q, [strideq*3]
+ pavgb m0, m1
+ palignr m1, m2, 5
+ psrlq m2, m1, 8
+ psllq m3, m1, 8
+ LOWPASS 2, 1, 3, 4
+
+ ; ABCD <- for the following predictor:
+ ; EFGH
+ ; IABC | m0 contains ABCDxxxx
+ ; JEFG | m2 contains xJIEFGHx
+
+ punpckldq m0, m2
+ pshufb m2, [pb_13456_3xm1]
+ movd [dstq+strideq*0], m0
+ pshufb m0, [pb_6012_4xm1]
+ movd [dstq+stride3q ], m2
+ psrlq m2, 8
+ movd [dstq+strideq*2], m0
+ movd [dstq+strideq*1], m2
+ RET
+
+%macro VR_XMM_FUNCS 1
+INIT_XMM %1
+cglobal vp9_ipred_vr_8x8, 4, 4, 5, dst, stride, l, a
+ movu m1, [aq-1]
+ movhps m2, [lq]
+ movq m0, [aq]
+ DEFINE_ARGS dst, stride, stride3
+ lea stride3q, [strideq*3]
+ pavgb m0, m1
+ palignr m1, m2, 9
+ pslldq m2, m1, 1
+ pslldq m3, m1, 2
+ LOWPASS 1, 2, 3, 4
+
+ ; ABCDEFGH <- for the following predictor:
+ ; IJKLMNOP
+ ; QABCDEFG | m0 contains ABCDEFGHxxxxxxxx
+ ; RIJKLMNO | m1 contains xxVUTSRQIJKLMNOP
+ ; SQABCDEF
+ ; TRIJKLMN
+ ; USQABCDE
+ ; VTRIJKLM
+
+ punpcklqdq m0, m1 ; ABCDEFGHxxVUTSRQ
+ movq [dstq+strideq*0], m0
+ pshufb m0, [pb_6xm1_BDF_0to6] ; xxxxxxUSQABCDEFG
+ movhps [dstq+strideq*1], m1
+ pshufb m1, [pb_6xm1_246_8toE] ; xxxxxxVTRIJKLMNO
+ movhps [dstq+strideq*2], m0
+ pslldq m0, 1
+ movhps [dstq+stride3q ], m1
+ lea dstq, [dstq+strideq*4]
+ pslldq m1, 1
+ movhps [dstq+strideq*0], m0
+ pslldq m0, 1
+ movhps [dstq+strideq*1], m1
+ pslldq m1, 1
+ movhps [dstq+strideq*2], m0
+ movhps [dstq+stride3q ], m1
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_vr_16x16, 4, 4, 6, dst, stride, l, a
+ mova m0, [aq]
+ movu m1, [aq-1]
+ mova m2, [lq]
+ DEFINE_ARGS dst, stride, stride3, cnt
+ lea stride3q, [strideq*3]
+ palignr m3, m1, m2, 15
+ LOWPASS 3, 1, 0, 4
+ pavgb m0, m1
+ palignr m1, m2, 1
+ pslldq m4, m2, 1
+ LOWPASS 1, 2, 4, 5
+ pshufb m1, [pb_02468ACE_13579BDF]
+ mov cntd, 4
+
+.loop:
+ movlhps m2, m1
+ mova [dstq+strideq*0], m0
+ mova [dstq+strideq*1], m3
+ palignr m4, m0, m1, 15
+ palignr m5, m3, m2, 15
+ mova [dstq+strideq*2], m4
+ mova [dstq+stride3q ], m5
+ lea dstq, [dstq+strideq*4]
+ palignr m0, m1, 14
+ palignr m3, m2, 14
+ pslldq m1, 2
+ dec cntd
+ jg .loop
+ RET
+
+%if ARCH_X86_64
+INIT_XMM %1
+cglobal vp9_ipred_vr_32x32, 4, 4, 9, dst, stride, l, a
+ mova m0, [aq]
+ mova m2, [aq+16]
+ movu m1, [aq-1]
+ palignr m3, m2, m0, 15
+ palignr m4, m2, m0, 14
+ LOWPASS 4, 3, 2, 5
+ pavgb m3, m2
+ mova m2, [lq+16]
+ palignr m5, m1, m2, 15
+ LOWPASS 5, 1, 0, 6
+ pavgb m0, m1
+ mova m6, [lq]
+ palignr m1, m2, 1
+ palignr m7, m2, m6, 15
+ LOWPASS 1, 2, 7, 8
+ palignr m2, m6, 1
+ pslldq m7, m6, 1
+ LOWPASS 2, 6, 7, 8
+ pshufb m1, [pb_02468ACE_13579BDF]
+ pshufb m2, [pb_02468ACE_13579BDF]
+ DEFINE_ARGS dst, stride, dst16, cnt
+ lea dst16q, [dstq +strideq*8]
+ lea dst16q, [dst16q+strideq*8]
+ SBUTTERFLY qdq, 2, 1, 6
+ mov cntd, 8
+
+.loop:
+ ; even lines (0, 2, 4, ...): m1 | m0, m3
+ ; odd lines (1, 3, 5, ...): m2 | m5, m4
+%macro %%write 4
+ mova [dstq+stride%1+ 0], %3
+ mova [dstq+stride%1+16], %4
+ movhps [dst16q+stride%1 ], %2
+ movu [dst16q+stride%1+ 8], %3
+ movq [dst16q+stride%1+24], %4
+ palignr %4, %3, 15
+ palignr %3, %2, 15
+ pslldq %2, 1
+%endmacro
+
+ %%write q*0, m1, m0, m3
+ %%write q*1, m2, m5, m4
+ lea dstq, [dstq +strideq*2]
+ lea dst16q, [dst16q+strideq*2]
+ dec cntd
+ jg .loop
+ RET
+%endif
+%endmacro
+
+VR_XMM_FUNCS ssse3
+VR_XMM_FUNCS avx
+
+; hd
+
+INIT_MMX ssse3
+cglobal vp9_ipred_hd_4x4, 4, 4, 0, dst, stride, l, a
+ movd m0, [lq]
+ punpckldq m0, [aq-1]
+ DEFINE_ARGS dst, stride, stride3
+ lea stride3q, [strideq*3]
+ psrlq m1, m0, 8
+ psrlq m2, m1, 8
+ LOWPASS 2, 1, 0, 3
+ pavgb m1, m0
+
+ ; DHIJ <- for the following predictor:
+ ; CGDH
+ ; BFCG | m1 contains ABCDxxxx
+ ; AEBF | m2 contains EFGHIJxx
+
+ punpcklbw m1, m2
+ punpckhdq m0, m1, m2
+
+ ; m1 contains AEBFCGDH
+ ; m0 contains CGDHIJxx
+
+ movd [dstq+stride3q ], m1
+ movd [dstq+strideq*1], m0
+ psrlq m1, 16
+ psrlq m0, 16
+ movd [dstq+strideq*2], m1
+ movd [dstq+strideq*0], m0
+ RET
+
+%macro HD_XMM_FUNCS 1
+INIT_XMM %1
+cglobal vp9_ipred_hd_8x8, 4, 4, 4, dst, stride, l, a
+ movq m0, [lq]
+ movhps m0, [aq-1]
+ DEFINE_ARGS dst, stride, stride3, dst4
+ lea stride3q, [strideq*3]
+ lea dst4q, [dstq+strideq*4]
+ psrldq m1, m0, 1
+ psrldq m2, m1, 1
+ LOWPASS 2, 1, 0, 3
+ pavgb m1, m0
+
+ ; HPQRSTUV <- for the following predictor
+ ; GOHPQRST
+ ; FNGOHPQR | m1 contains ABCDEFGHxxxxxxxx
+ ; EMFNGOHP | m2 contains IJKLMNOPQRSTUVxx
+ ; DLEMFNGO
+ ; CKDLEMFN
+ ; BJCKDLEM
+ ; AIBJCKDL
+
+ punpcklbw m1, m2
+ movhlps m2, m2
+
+ ; m1 contains AIBJCKDLEMFNGOHP
+ ; m2 contains QRSTUVxxxxxxxxxx
+
+ movhps [dstq +stride3q ], m1
+ movq [dst4q+stride3q ], m1
+ palignr m3, m2, m1, 2
+ movhps [dstq +strideq*2], m3
+ movq [dst4q+strideq*2], m3
+ palignr m3, m2, m1, 4
+ movhps [dstq +strideq*1], m3
+ movq [dst4q+strideq*1], m3
+ palignr m2, m1, 6
+ movhps [dstq +strideq*0], m2
+ movq [dst4q+strideq*0], m2
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_hd_16x16, 4, 6, 7, dst, stride, l, a
+ mova m0, [lq]
+ movu m3, [aq-1]
+ DEFINE_ARGS dst, stride, stride4, dst4, dst8, dst12
+ lea stride4q, [strideq*4]
+ lea dst4q, [dstq +stride4q]
+ lea dst8q, [dst4q+stride4q]
+ lea dst12q, [dst8q+stride4q]
+ psrldq m4, m3, 1
+ psrldq m5, m3, 2
+ LOWPASS 5, 4, 3, 6
+ palignr m1, m3, m0, 1
+ palignr m2, m3, m0, 2
+ LOWPASS 2, 1, 0, 6
+ pavgb m1, m0
+ SBUTTERFLY bw, 1, 2, 6
+
+ ; I PROBABLY INVERTED L0 ad L16 here
+ ; m1, m2, m5
+.loop:
+ sub stride4q, strideq
+ movhps [dstq +stride4q +0], m2
+ movq [dstq +stride4q +8], m5
+ mova [dst4q+stride4q ], m2
+ movhps [dst8q+stride4q +0], m1
+ movq [dst8q+stride4q +8], m2
+ mova [dst12q+stride4q ], m1
+%if cpuflag(avx)
+ palignr m1, m2, m1, 2
+ palignr m2, m5, m2, 2
+%else
+ palignr m3, m2, m1, 2
+ palignr m0, m5, m2, 2
+ mova m1, m3
+ mova m2, m0
+%endif
+ psrldq m5, 2
+ jg .loop
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_hd_32x32, 4, 6, 8, dst, stride, l, a
+ mova m0, [lq]
+ mova m1, [lq+16]
+ movu m2, [aq-1]
+ movu m3, [aq+15]
+ DEFINE_ARGS dst, stride, stride8, dst8, dst16, dst24
+ lea stride8q, [strideq*8]
+ lea dst8q, [dstq +stride8q]
+ lea dst16q, [dst8q +stride8q]
+ lea dst24q, [dst16q+stride8q]
+ psrldq m4, m3, 1
+ psrldq m5, m3, 2
+ LOWPASS 5, 4, 3, 6
+ palignr m4, m3, m2, 2
+ palignr m3, m2, 1
+ LOWPASS 4, 3, 2, 6
+ palignr m3, m2, m1, 2
+ palignr m2, m1, 1
+ LOWPASS 3, 2, 1, 6
+ pavgb m2, m1
+ palignr m6, m1, m0, 1
+ palignr m1, m0, 2
+ LOWPASS 1, 6, 0, 7
+ pavgb m0, m1
+ SBUTTERFLY bw, 2, 3, 6
+ SBUTTERFLY bw, 0, 1, 6
+
+ ; m0, m1, m2, m3, m4, m5
+.loop:
+ sub stride8q, strideq
+ mova [dstq +stride8q+ 0], m3
+ mova [dstq +stride8q+16], m4
+ mova [dst8q +stride8q+ 0], m2
+ mova [dst8q +stride8q+16], m3
+ mova [dst16q+stride8q+ 0], m1
+ mova [dst16q+stride8q+16], m2
+ mova [dst24q+stride8q+ 0], m0
+ mova [dst24q+stride8q+16], m1
+%if cpuflag(avx)
+ palignr m0, m1, m0, 2
+ palignr m1, m2, m1, 2
+ palignr m2, m3, m2, 2
+ palignr m3, m4, m3, 2
+ palignr m4, m5, m4, 2
+ psrldq m5, 2
+%else
+ psrldq m6, m5, 2
+ palignr m5, m4, 2
+ palignr m4, m3, 2
+ palignr m3, m2, 2
+ palignr m2, m1, 2
+ palignr m1, m0, 2
+ mova m0, m1
+ mova m1, m2
+ mova m2, m3
+ mova m3, m4
+ mova m4, m5
+ mova m5, m6
+%endif
+ jg .loop
+ RET
+%endmacro
+
+HD_XMM_FUNCS ssse3
+HD_XMM_FUNCS avx
+
+INIT_MMX ssse3
+cglobal vp9_ipred_hu_4x4, 3, 3, 0, dst, stride, l
+ movd m0, [lq]
+ pshufb m0, [pb_3to1_5x0]
+ psrlq m1, m0, 8
+ psrlq m2, m1, 8
+ LOWPASS 2, 1, 0, 3
+ pavgb m1, m0
+ DEFINE_ARGS dst, stride, stride3
+ lea stride3q, [strideq*3]
+ SBUTTERFLY bw, 1, 2, 0
+ palignr m2, m1, 2
+ movd [dstq+strideq*0], m1
+ movd [dstq+strideq*1], m2
+ punpckhdq m1, m1
+ punpckhdq m2, m2
+ movd [dstq+strideq*2], m1
+ movd [dstq+stride3q ], m2
+ RET
+
+%macro HU_XMM_FUNCS 1
+INIT_XMM %1
+cglobal vp9_ipred_hu_8x8, 3, 4, 4, dst, stride, l
+ movq m0, [lq]
+ pshufb m0, [pb_7to1_9x0]
+ psrldq m1, m0, 1
+ psrldq m2, m1, 1
+ LOWPASS 2, 1, 0, 3
+ pavgb m1, m0
+ DEFINE_ARGS dst, stride, stride3, dst4
+ lea stride3q, [strideq*3]
+ lea dst4q, [dstq+strideq*4]
+ SBUTTERFLY bw, 1, 2, 0
+ movq [dstq +strideq*0], m1
+ movhps [dst4q+strideq*0], m1
+ palignr m0, m2, m1, 2
+ movq [dstq +strideq*1], m0
+ movhps [dst4q+strideq*1], m0
+ palignr m0, m2, m1, 4
+ movq [dstq +strideq*2], m0
+ movhps [dst4q+strideq*2], m0
+ palignr m2, m1, 6
+ movq [dstq +stride3q ], m2
+ movhps [dst4q+stride3q ], m2
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_hu_16x16, 3, 4, 5, dst, stride, l
+ mova m0, [lq]
+ pshufb m0, [pb_Fto0]
+ mova m3, [pb_2toE_3xF]
+ pshufb m1, m0, [pb_1toE_2xF]
+ pshufb m2, m0, m3
+ LOWPASS 2, 1, 0, 4
+ pavgb m1, m0
+ DEFINE_ARGS dst, stride, stride9, cnt
+ lea stride9q, [strideq *3]
+ mov cntd, 4
+ lea stride9q, [stride9q*3]
+ SBUTTERFLY bw, 1, 2, 0
+
+.loop:
+ mova [dstq+strideq*0], m1
+ mova [dstq+strideq*8], m2
+ palignr m0, m2, m1, 2
+ pshufb m2, m3
+ mova [dstq+strideq*1], m0
+ mova [dstq+stride9q ], m2
+ palignr m1, m2, m0, 2
+ pshufb m2, m3
+ lea dstq, [dstq+strideq*2]
+ dec cntd
+ jg .loop
+ RET
+
+INIT_XMM %1
+cglobal vp9_ipred_hu_32x32, 3, 7, 7, dst, stride, l
+ mova m0, [lq]
+ mova m1, [lq+16]
+ mova m2, [pb_Fto0]
+ mova m4, [pb_2toE_3xF]
+ pshufb m0, m2
+ pshufb m1, m2
+ palignr m2, m0, m1, 1
+ palignr m3, m0, m1, 2
+ LOWPASS 3, 2, 1, 5
+ pavgb m2, m1
+ pshufb m1, m0, m4
+ pshufb m5, m0, [pb_1toE_2xF]
+ LOWPASS 1, 5, 0, 6
+ pavgb m0, m5
+ DEFINE_ARGS dst, stride, cnt, stride0, dst8, dst16, dst24
+ mov cntd, 8
+ xor stride0q, stride0q
+ lea dst8q, [dstq +strideq*8]
+ lea dst16q, [dst8q +strideq*8]
+ lea dst24q, [dst16q+strideq*8]
+ SBUTTERFLY bw, 0, 1, 5
+ SBUTTERFLY bw, 2, 3, 5
+ pshufb m6, m1, [pb_15]
+
+.loop:
+ mova [dstq +stride0q+ 0], m2
+ mova [dstq +stride0q+16], m3
+ mova [dst8q +stride0q+ 0], m3
+ mova [dst8q +stride0q+16], m0
+ mova [dst16q+stride0q+ 0], m0
+ mova [dst16q+stride0q+16], m1
+ mova [dst24q+stride0q+ 0], m1
+ mova [dst24q+stride0q+16], m6
+%if cpuflag(avx)
+ palignr m2, m3, m2, 2
+ palignr m3, m0, m3, 2
+ palignr m0, m1, m0, 2
+ pshufb m1, m4
+%else
+ pshufb m5, m1, m4
+ palignr m1, m0, 2
+ palignr m0, m3, 2
+ palignr m3, m2, 2
+ mova m2, m3
+ mova m3, m0
+ mova m0, m1
+ mova m1, m5
+%endif
+ add stride0q, strideq
+ dec cntd
+ jg .loop
+ RET
+%endmacro
+
+HU_XMM_FUNCS ssse3
+HU_XMM_FUNCS avx
+
+; FIXME 127, 128, 129 ?
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp9itxfm.asm b/chromium/third_party/ffmpeg/libavcodec/x86/vp9itxfm.asm
index ebf30440b2f..8087c2e3362 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp9itxfm.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp9itxfm.asm
@@ -2,6 +2,7 @@
;* VP9 IDCT SIMD optimizations
;*
;* Copyright (C) 2013 Clément Bœsch <u pkh me>
+;* Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
;*
;* This file is part of FFmpeg.
;*
@@ -24,62 +25,174 @@
SECTION_RODATA
-pw_11585x2: times 8 dw 23170
+pw_11585x2: times 8 dw 23170
+pw_m11585x2: times 8 dw -23170
-%macro VP9_IDCT_COEFFS 2
-pw_m%1_%2: dw -%1, %2, -%1, %2, -%1, %2, -%1, %2
-pw_%2_%1: dw %2, %1, %2, %1, %2, %1, %2, %1
+%macro VP9_IDCT_COEFFS 2-3 0
+pw_%1x2: times 8 dw %1*2
+pw_m%1x2: times 8 dw -%1*2
+pw_%2x2: times 8 dw %2*2
+pw_m%2x2: times 8 dw -%2*2
+pw_m%1_%2: times 4 dw -%1, %2
+pw_%2_%1: times 4 dw %2, %1
+pw_m%2_m%1: times 4 dw -%2, -%1
+%if %3 == 1
+pw_m%2_%1: times 4 dw -%2, %1
+pw_%1_%2: times 4 dw %1, %2
+%endif
%endmacro
-%macro VP9_IDCT_COEFFS_ALL 2
-pw_%1x2: times 8 dw %1*2
-pw_%2x2: times 8 dw %2*2
-VP9_IDCT_COEFFS %1, %2
-%endmacro
+VP9_IDCT_COEFFS 15137, 6270, 1
+VP9_IDCT_COEFFS 16069, 3196, 1
+VP9_IDCT_COEFFS 9102, 13623, 1
+VP9_IDCT_COEFFS 16305, 1606
+VP9_IDCT_COEFFS 10394, 12665
+VP9_IDCT_COEFFS 14449, 7723
+VP9_IDCT_COEFFS 4756, 15679
+VP9_IDCT_COEFFS 16364, 804
+VP9_IDCT_COEFFS 11003, 12140
+VP9_IDCT_COEFFS 14811, 7005
+VP9_IDCT_COEFFS 5520, 15426
+VP9_IDCT_COEFFS 15893, 3981
+VP9_IDCT_COEFFS 8423, 14053
+VP9_IDCT_COEFFS 13160, 9760
+VP9_IDCT_COEFFS 2404, 16207
-VP9_IDCT_COEFFS_ALL 15137, 6270
-VP9_IDCT_COEFFS_ALL 16069, 3196
-VP9_IDCT_COEFFS_ALL 9102, 13623
+pw_5283_13377: times 4 dw 5283, 13377
+pw_9929_13377: times 4 dw 9929, 13377
+pw_15212_m13377: times 4 dw 15212, -13377
+pw_15212_9929: times 4 dw 15212, 9929
+pw_m5283_m15212: times 4 dw -5283, -15212
+pw_13377x2: times 8 dw 13377*2
pd_8192: times 4 dd 8192
pw_2048: times 8 dw 2048
pw_1024: times 8 dw 1024
+pw_512: times 8 dw 512
+pw_m1: times 8 dw -1
SECTION .text
; (a*x + b*y + round) >> shift
-%macro VP9_MULSUB_2W_2X 6 ; dst1, dst2, src (unchanged), round, coefs1, coefs2
- pmaddwd m%1, m%3, %5
- pmaddwd m%2, m%3, %6
- paddd m%1, %4
- paddd m%2, %4
+%macro VP9_MULSUB_2W_2X 5 ; dst1, dst2/src, round, coefs1, coefs2
+ pmaddwd m%1, m%2, %4
+ pmaddwd m%2, %5
+ paddd m%1, %3
+ paddd m%2, %3
psrad m%1, 14
psrad m%2, 14
%endmacro
-%macro VP9_UNPACK_MULSUB_2W_4X 7 ; dst1, dst2, coef1, coef2, rnd, tmp1, tmp2
- punpckhwd m%6, m%2, m%1
- VP9_MULSUB_2W_2X %7, %6, %6, %5, [pw_m%3_%4], [pw_%4_%3]
- punpcklwd m%2, m%1
- VP9_MULSUB_2W_2X %1, %2, %2, %5, [pw_m%3_%4], [pw_%4_%3]
+%macro VP9_MULSUB_2W_4X 7 ; dst1, dst2, coef1, coef2, rnd, tmp1/src, tmp2
+ VP9_MULSUB_2W_2X %7, %6, %5, [pw_m%3_%4], [pw_%4_%3]
+ VP9_MULSUB_2W_2X %1, %2, %5, [pw_m%3_%4], [pw_%4_%3]
packssdw m%1, m%7
packssdw m%2, m%6
%endmacro
-%macro VP9_STORE_2X 5 ; reg1, reg2, tmp1, tmp2, zero
- movh m%3, [dstq]
- movh m%4, [dstq+strideq]
+%macro VP9_UNPACK_MULSUB_2W_4X 7-9 ; dst1, dst2, (src1, src2,) coef1, coef2, rnd, tmp1, tmp2
+%if %0 == 7
+ punpckhwd m%6, m%2, m%1
+ punpcklwd m%2, m%1
+ VP9_MULSUB_2W_4X %1, %2, %3, %4, %5, %6, %7
+%else
+ punpckhwd m%8, m%4, m%3
+ punpcklwd m%2, m%4, m%3
+ VP9_MULSUB_2W_4X %1, %2, %5, %6, %7, %8, %9
+%endif
+%endmacro
+
+%macro VP9_UNPACK_MULSUB_2D_4X 6 ; dst1 [src1], dst2 [src2], dst3, dst4, mul1, mul2
+ punpckhwd m%4, m%2, m%1
+ punpcklwd m%2, m%1
+ pmaddwd m%3, m%4, [pw_m%5_%6]
+ pmaddwd m%4, [pw_%6_%5]
+ pmaddwd m%1, m%2, [pw_m%5_%6]
+ pmaddwd m%2, [pw_%6_%5]
+%endmacro
+
+%macro VP9_RND_SH_SUMSUB_BA 6 ; dst1 [src1], dst2 [src2], src3, src4, tmp, round
+ SUMSUB_BA d, %1, %2, %5
+ SUMSUB_BA d, %3, %4, %5
+ paddd m%1, %6
+ paddd m%2, %6
+ paddd m%3, %6
+ paddd m%4, %6
+ psrad m%1, 14
+ psrad m%2, 14
+ psrad m%3, 14
+ psrad m%4, 14
+ packssdw m%1, m%3
+ packssdw m%2, m%4
+%endmacro
+
+%macro VP9_STORE_2X 5-6 dstq ; reg1, reg2, tmp1, tmp2, zero, dst
+ movh m%3, [%6]
+ movh m%4, [%6+strideq]
punpcklbw m%3, m%5
punpcklbw m%4, m%5
paddw m%3, m%1
paddw m%4, m%2
packuswb m%3, m%5
packuswb m%4, m%5
- movh [dstq], m%3
- movh [dstq+strideq], m%4
+ movh [%6], m%3
+ movh [%6+strideq], m%4
+%endmacro
+
+%macro ZERO_BLOCK 4 ; mem, stride, nnzcpl, zero_reg
+%assign %%y 0
+%rep %3
+%assign %%x 0
+%rep %3*2/mmsize
+ mova [%1+%%y+%%x], %4
+%assign %%x (%%x+mmsize)
+%endrep
+%assign %%y (%%y+%2)
+%endrep
%endmacro
;-------------------------------------------------------------------------------------------
+; void vp9_iwht_iwht_4x4_add_<opt>(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
+;-------------------------------------------------------------------------------------------
+
+%macro VP9_IWHT4_1D 0
+ SWAP 1, 2, 3
+ paddw m0, m2
+ psubw m3, m1
+ psubw m4, m0, m3
+ psraw m4, 1
+ psubw m5, m4, m1
+ SWAP 5, 1
+ psubw m4, m2
+ SWAP 4, 2
+ psubw m0, m1
+ paddw m3, m2
+ SWAP 3, 2, 1
+%endmacro
+
+INIT_MMX mmx
+cglobal vp9_iwht_iwht_4x4_add, 3, 3, 0, dst, stride, block, eob
+ mova m0, [blockq+0*8]
+ mova m1, [blockq+1*8]
+ mova m2, [blockq+2*8]
+ mova m3, [blockq+3*8]
+ psraw m0, 2
+ psraw m1, 2
+ psraw m2, 2
+ psraw m3, 2
+
+ VP9_IWHT4_1D
+ TRANSPOSE4x4W 0, 1, 2, 3, 4
+ VP9_IWHT4_1D
+
+ pxor m4, m4
+ VP9_STORE_2X 0, 1, 5, 6, 4
+ lea dstq, [dstq+strideq*2]
+ VP9_STORE_2X 2, 3, 5, 6, 4
+ ZERO_BLOCK blockq, 8, 4, m4
+ RET
+
+;-------------------------------------------------------------------------------------------
; void vp9_idct_idct_4x4_add_<opt>(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
;-------------------------------------------------------------------------------------------
@@ -175,10 +288,73 @@ cglobal vp9_idct_idct_4x4_add, 4,4,0, dst, stride, block, eob
RET
;-------------------------------------------------------------------------------------------
+; void vp9_iadst_iadst_4x4_add_<opt>(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
+;-------------------------------------------------------------------------------------------
+
+%macro VP9_IADST4_1D 0
+ movq2dq xmm0, m0
+ movq2dq xmm1, m1
+ movq2dq xmm2, m2
+ movq2dq xmm3, m3
+ paddw m3, m0
+ punpcklwd xmm0, xmm1
+ punpcklwd xmm2, xmm3
+ pmaddwd xmm1, xmm0, [pw_5283_13377]
+ pmaddwd xmm4, xmm0, [pw_9929_13377]
+ pmaddwd xmm0, [pw_15212_m13377]
+ pmaddwd xmm3, xmm2, [pw_15212_9929]
+ pmaddwd xmm2, [pw_m5283_m15212]
+ psubw m3, m2
+ paddd xmm0, xmm2
+ paddd xmm3, [pd_8192]
+ paddd xmm2, [pd_8192]
+ paddd xmm1, xmm3
+ paddd xmm0, xmm3
+ paddd xmm4, xmm2
+ psrad xmm1, 14
+ psrad xmm0, 14
+ psrad xmm4, 14
+ pmulhrsw m3, [pw_13377x2] ; out2
+ packssdw xmm0, xmm0
+ packssdw xmm1, xmm1
+ packssdw xmm4, xmm4
+ movdq2q m0, xmm0 ; out3
+ movdq2q m1, xmm1 ; out0
+ movdq2q m2, xmm4 ; out1
+ SWAP 0, 1, 2, 3
+%endmacro
+
+%macro IADST4_FN 5
+INIT_MMX %5
+cglobal vp9_%1_%3_4x4_add, 3, 3, 8, dst, stride, block, eob
+ mova m0, [blockq+ 0]
+ mova m1, [blockq+ 8]
+ mova m2, [blockq+16]
+ mova m3, [blockq+24]
+ mova m6, [pw_11585x2]
+ mova m7, [pd_8192] ; rounding
+ VP9_%2_1D
+ TRANSPOSE4x4W 0, 1, 2, 3, 4
+ VP9_%4_1D
+ pxor m4, m4 ; used for the block reset, and VP9_STORE_2X
+ mova [blockq+ 0], m4
+ mova [blockq+ 8], m4
+ mova [blockq+16], m4
+ mova [blockq+24], m4
+ VP9_IDCT4_WRITEOUT
+ RET
+%endmacro
+
+IADST4_FN idct, IDCT4, iadst, IADST4, ssse3
+IADST4_FN iadst, IADST4, idct, IDCT4, ssse3
+IADST4_FN iadst, IADST4, iadst, IADST4, ssse3
+
+%if ARCH_X86_64 ; TODO: 32-bit? (32-bit limited to 8 xmm reg, we use more)
+
+;-------------------------------------------------------------------------------------------
; void vp9_idct_idct_8x8_add_<opt>(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
;-------------------------------------------------------------------------------------------
-%if ARCH_X86_64 ; TODO: 32-bit? (32-bit limited to 8 xmm reg, we use 13 here)
%macro VP9_IDCT8_1D_FINALIZE 0
SUMSUB_BA w, 3, 10, 4 ; m3=t0+t7, m10=t0-t7
SUMSUB_BA w, 1, 2, 4 ; m1=t1+t6, m2=t1-t6
@@ -265,7 +441,8 @@ cglobal vp9_idct_idct_4x4_add, 4,4,0, dst, stride, block, eob
VP9_STORE_2X 10, 11, 6, 7, 4
%endmacro
-INIT_XMM ssse3
+%macro VP9_IDCT_IDCT_8x8_ADD_XMM 1
+INIT_XMM %1
cglobal vp9_idct_idct_8x8_add, 4,4,13, dst, stride, block, eob
mova m12, [pw_11585x2] ; often used
@@ -341,15 +518,1152 @@ cglobal vp9_idct_idct_8x8_add, 4,4,13, dst, stride, block, eob
VP9_IDCT8_1D
TRANSPOSE8x8W 0, 1, 2, 3, 8, 9, 10, 11, 4
VP9_IDCT8_1D
+
pxor m4, m4 ; used for the block reset, and VP9_STORE_2X
- mova [blockq+ 0], m4
- mova [blockq+ 16], m4
- mova [blockq+ 32], m4
- mova [blockq+ 48], m4
- mova [blockq+ 64], m4
- mova [blockq+ 80], m4
- mova [blockq+ 96], m4
- mova [blockq+112], m4
+ ZERO_BLOCK blockq, 16, 8, m4
VP9_IDCT8_WRITEOUT
RET
+%endmacro
+
+VP9_IDCT_IDCT_8x8_ADD_XMM ssse3
+VP9_IDCT_IDCT_8x8_ADD_XMM avx
+
+;---------------------------------------------------------------------------------------------
+; void vp9_iadst_iadst_8x8_add_<opt>(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
+;---------------------------------------------------------------------------------------------
+
+%macro VP9_IADST8_1D 0 ; input/output=m0/1/2/3/8/9/10/11
+ VP9_UNPACK_MULSUB_2D_4X 11, 0, 4, 5, 16305, 1606 ; m11/4=t1[d], m0/5=t0[d]
+ VP9_UNPACK_MULSUB_2D_4X 3, 8, 6, 13, 10394, 12665 ; m3/6=t5[d], m8/13=t4[d]
+ VP9_RND_SH_SUMSUB_BA 8, 0, 13, 5, 14, m7 ; m8=t0[w], m0=t4[w]
+ VP9_RND_SH_SUMSUB_BA 3, 11, 6, 4, 14, m7 ; m3=t1[w], m11=t5[w]
+
+ VP9_UNPACK_MULSUB_2D_4X 9, 2, 4, 5, 14449, 7723 ; m9/4=t3[d], m2/5=t2[d]
+ VP9_UNPACK_MULSUB_2D_4X 1, 10, 6, 13, 4756, 15679 ; m1/6=t7[d], m10/13=t6[d]
+ VP9_RND_SH_SUMSUB_BA 10, 2, 13, 5, 14, m7 ; m10=t2[w], m2=t6[w]
+ VP9_RND_SH_SUMSUB_BA 1, 9, 6, 4, 14, m7 ; m1=t3[w], m9=t7[w]
+
+ ; m8=t0, m3=t1, m10=t2, m1=t3, m0=t4, m11=t5, m2=t6, m9=t7
+
+ VP9_UNPACK_MULSUB_2D_4X 0, 11, 4, 5, 15137, 6270 ; m0/4=t5[d], m11/5=t4[d]
+ VP9_UNPACK_MULSUB_2D_4X 9, 2, 6, 13, 6270, 15137 ; m9/6=t6[d], m2/13=t7[d]
+ VP9_RND_SH_SUMSUB_BA 9, 11, 6, 5, 14, m7
+ psignw m9, [pw_m1] ; m9=out1[w], m11=t6[w]
+ VP9_RND_SH_SUMSUB_BA 2, 0, 13, 4, 14, m7 ; m2=out6[w], m0=t7[w]
+
+ SUMSUB_BA w, 10, 8, 14 ; m10=out0[w], m8=t2[w]
+ SUMSUB_BA w, 1, 3, 14
+ psignw m1, [pw_m1] ; m1=out7[w], m3=t3[w]
+
+ ; m10=out0, m9=out1, m8=t2, m3=t3, m11=t6, m0=t7, m2=out6, m1=out7
+
+ SUMSUB_BA w, 3, 8, 4
+ SUMSUB_BA w, 0, 11, 5
+ pmulhrsw m3, m12
+ pmulhrsw m11, m12
+ pmulhrsw m8, m12 ; out4
+ pmulhrsw m0, m12 ; out2
+ psignw m3, [pw_m1] ; out3
+ psignw m11, [pw_m1] ; out5
+
+ ; m10=out0, m9=out1, m0=out2, m3=out3, m8=out4, m11=out5, m2=out6, m1=out7
+
+ SWAP 0, 10, 2
+ SWAP 11, 1, 9
+%endmacro
+
+%macro IADST8_FN 5
+INIT_XMM %5
+cglobal vp9_%1_%3_8x8_add, 3, 3, 15, dst, stride, block, eob
+ mova m0, [blockq+ 0] ; IN(0)
+ mova m1, [blockq+ 16] ; IN(1)
+ mova m2, [blockq+ 32] ; IN(2)
+ mova m3, [blockq+ 48] ; IN(3)
+ mova m8, [blockq+ 64] ; IN(4)
+ mova m9, [blockq+ 80] ; IN(5)
+ mova m10, [blockq+ 96] ; IN(6)
+ mova m11, [blockq+112] ; IN(7)
+
+ mova m12, [pw_11585x2] ; often used
+ mova m7, [pd_8192] ; rounding
+ VP9_%2_1D
+ TRANSPOSE8x8W 0, 1, 2, 3, 8, 9, 10, 11, 4
+ VP9_%4_1D
+
+ pxor m4, m4 ; used for the block reset, and VP9_STORE_2X
+ ZERO_BLOCK blockq, 16, 8, m4
+ VP9_IDCT8_WRITEOUT
+ RET
+%endmacro
+
+IADST8_FN idct, IDCT8, iadst, IADST8, ssse3
+IADST8_FN idct, IDCT8, iadst, IADST8, avx
+IADST8_FN iadst, IADST8, idct, IDCT8, ssse3
+IADST8_FN iadst, IADST8, idct, IDCT8, avx
+IADST8_FN iadst, IADST8, iadst, IADST8, ssse3
+IADST8_FN iadst, IADST8, iadst, IADST8, avx
+
+;---------------------------------------------------------------------------------------------
+; void vp9_idct_idct_16x16_add_<opt>(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
+;---------------------------------------------------------------------------------------------
+
+; at the end of this macro, m7 is stored in stack_scratch
+; everything else (t0-6 and t8-15) is stored in m0-6 and m8-15
+; the following sumsubs have not been done yet:
+; SUMSUB_BA w, 6, 9, 15 ; t6, t9
+; SUMSUB_BA w, 7, 8, 15 ; t7, t8
+%macro VP9_IDCT16_1D_START 4 ; src, nnzc, stride, stack_scratch
+%if %2 <= 4
+ mova m3, [%1+ 1*%3] ; IN(1)
+ mova m12, [%1+ 2*%3] ; IN(2)
+ mova m0, [%1+ 3*%3] ; IN(3)
+
+ pmulhrsw m15, m12, [pw_16069x2] ; t6-7
+ pmulhrsw m12, [pw_3196x2] ; t4-5
+ pmulhrsw m4, m3, [pw_16305x2] ; t14-15
+ pmulhrsw m3, [pw_1606x2] ; t8-9
+ pmulhrsw m7, m0, [pw_m4756x2] ; t10-11
+ pmulhrsw m0, [pw_15679x2] ; t12-13
+
+ ; m8=t0, m9=t1, m10=t2, m11=t3, m12=t4, m14=t5, m13=t6, m15=t7
+ ; m3=t8, m5=t9, m1=t10, m7=t11, m0=t12, m6=t13, m2=t14, m4=t15
+
+ paddw m14, m15, m12
+ psubw m13, m15, m12
+ pmulhrsw m13, [pw_11585x2] ; t5
+ pmulhrsw m14, [pw_11585x2] ; t6
+
+ VP9_UNPACK_MULSUB_2W_4X 2, 5, 4, 3, 15137, 6270, [pd_8192], 10, 11 ; t9, t14
+ VP9_UNPACK_MULSUB_2W_4X 6, 1, 0, 7, 6270, m15137, [pd_8192], 10, 11 ; t10, t13
+
+ ; m15=t0, m14=t1, m13=t2, m12=t3, m11=t4, m10=t5, m9=t6, m8=t7
+ ; m7=t8, m6=t9, m2=t10, m3=t11, m4=t12, m5=t13, m1=t14, m0=t15
+%else
+ mova m5, [%1+ 1*%3] ; IN(1)
+ mova m14, [%1+ 2*%3] ; IN(2)
+ mova m6, [%1+ 3*%3] ; IN(3)
+ mova m9, [%1+ 4*%3] ; IN(4)
+ mova m7, [%1+ 5*%3] ; IN(5)
+ mova m15, [%1+ 6*%3] ; IN(6)
+ mova m4, [%1+ 7*%3] ; IN(7)
+%if %2 <= 8
+ pmulhrsw m8, m9, [pw_15137x2] ; t3
+ pmulhrsw m9, [pw_6270x2] ; t2
+ pmulhrsw m13, m14, [pw_16069x2] ; t7
+ pmulhrsw m14, [pw_3196x2] ; t4
+ pmulhrsw m12, m15, [pw_m9102x2] ; t5
+ pmulhrsw m15, [pw_13623x2] ; t6
+ pmulhrsw m2, m5, [pw_16305x2] ; t15
+ pmulhrsw m5, [pw_1606x2] ; t8
+ pmulhrsw m3, m4, [pw_m10394x2] ; t9
+ pmulhrsw m4, [pw_12665x2] ; t14
+ pmulhrsw m0, m7, [pw_14449x2] ; t13
+ pmulhrsw m7, [pw_7723x2] ; t10
+ pmulhrsw m1, m6, [pw_m4756x2] ; t11
+ pmulhrsw m6, [pw_15679x2] ; t12
+%else
+ mova m3, [%1+ 9*%3] ; IN(9)
+ mova m12, [%1+10*%3] ; IN(10)
+ mova m0, [%1+11*%3] ; IN(11)
+ mova m8, [%1+12*%3] ; IN(12)
+ mova m1, [%1+13*%3] ; IN(13)
+ mova m13, [%1+14*%3] ; IN(14)
+ mova m2, [%1+15*%3] ; IN(15)
+
+ ; m10=in0, m5=in1, m14=in2, m6=in3, m9=in4, m7=in5, m15=in6, m4=in7
+ ; m11=in8, m3=in9, m12=in10 m0=in11, m8=in12, m1=in13, m13=in14, m2=in15
+
+ VP9_UNPACK_MULSUB_2W_4X 9, 8, 15137, 6270, [pd_8192], 10, 11 ; t2, t3
+ VP9_UNPACK_MULSUB_2W_4X 14, 13, 16069, 3196, [pd_8192], 10, 11 ; t4, t7
+ VP9_UNPACK_MULSUB_2W_4X 12, 15, 9102, 13623, [pd_8192], 10, 11 ; t5, t6
+ VP9_UNPACK_MULSUB_2W_4X 5, 2, 16305, 1606, [pd_8192], 10, 11 ; t8, t15
+ VP9_UNPACK_MULSUB_2W_4X 3, 4, 10394, 12665, [pd_8192], 10, 11 ; t9, t14
+ VP9_UNPACK_MULSUB_2W_4X 7, 0, 14449, 7723, [pd_8192], 10, 11 ; t10, t13
+ VP9_UNPACK_MULSUB_2W_4X 1, 6, 4756, 15679, [pd_8192], 10, 11 ; t11, t12
+%endif
+
+ ; m11=t0, m10=t1, m9=t2, m8=t3, m14=t4, m12=t5, m15=t6, m13=t7
+ ; m5=t8, m3=t9, m7=t10, m1=t11, m6=t12, m0=t13, m4=t14, m2=t15
+
+ SUMSUB_BA w, 12, 14, 10 ; t4, t5
+ SUMSUB_BA w, 15, 13, 10 ; t7, t6
+ SUMSUB_BA w, 3, 5, 10 ; t8, t9
+ SUMSUB_BA w, 7, 1, 10 ; t11, t10
+ SUMSUB_BA w, 0, 6, 10 ; t12, t13
+ SUMSUB_BA w, 4, 2, 10 ; t15, t14
+
+ ; m8=t0, m9=t1, m10=t2, m11=t3, m12=t4, m14=t5, m13=t6, m15=t7
+ ; m3=t8, m5=t9, m1=t10, m7=t11, m0=t12, m6=t13, m2=t14, m4=t15
+
+ SUMSUB_BA w, 14, 13, 10
+ pmulhrsw m13, [pw_11585x2] ; t5
+ pmulhrsw m14, [pw_11585x2] ; t6
+ VP9_UNPACK_MULSUB_2W_4X 2, 5, 15137, 6270, [pd_8192], 10, 11 ; t9, t14
+ VP9_UNPACK_MULSUB_2W_4X 6, 1, 6270, m15137, [pd_8192], 10, 11 ; t10, t13
%endif
+
+ ; m8=t0, m9=t1, m10=t2, m11=t3, m12=t4, m13=t5, m14=t6, m15=t7
+ ; m3=t8, m2=t9, m6=t10, m7=t11, m0=t12, m1=t13, m5=t14, m4=t15
+
+ SUMSUB_BA w, 7, 3, 10 ; t8, t11
+ SUMSUB_BA w, 6, 2, 10 ; t9, t10
+ SUMSUB_BA w, 0, 4, 10 ; t15, t12
+ SUMSUB_BA w, 1, 5, 10 ; t14. t13
+
+ ; m15=t0, m14=t1, m13=t2, m12=t3, m11=t4, m10=t5, m9=t6, m8=t7
+ ; m7=t8, m6=t9, m2=t10, m3=t11, m4=t12, m5=t13, m1=t14, m0=t15
+
+ SUMSUB_BA w, 2, 5, 10
+ SUMSUB_BA w, 3, 4, 10
+ pmulhrsw m5, [pw_11585x2] ; t10
+ pmulhrsw m4, [pw_11585x2] ; t11
+ pmulhrsw m3, [pw_11585x2] ; t12
+ pmulhrsw m2, [pw_11585x2] ; t13
+
+ ; backup first register
+ mova [%4], m7
+
+ ; m15=t0, m14=t1, m13=t2, m12=t3, m11=t4, m10=t5, m9=t6, m8=t7
+ ; m7=t8, m6=t9, m5=t10, m4=t11, m3=t12, m2=t13, m1=t14, m0=t15
+
+ ; from load/start
+%if %2 <= 4
+ mova m11, [%1+ 0*%3] ; IN(0)
+ pmulhrsw m11, [pw_11585x2] ; t0-t3
+
+ psubw m8, m11, m15
+ paddw m15, m11
+ psubw m9, m11, m14
+ paddw m14, m11
+ psubw m10, m11, m13
+ paddw m13, m11
+%else
+ mova m10, [%1+ 0*%3] ; IN(0)
+%if %2 <= 8
+ pmulhrsw m10, [pw_11585x2] ; t0 and t1
+ psubw m11, m10, m8
+ paddw m8, m10
+%else
+ mova m11, [%1+ 8*%3] ; IN(8)
+
+ ; from 3 stages back
+ SUMSUB_BA w, 11, 10, 7
+ pmulhrsw m11, [pw_11585x2] ; t0
+ pmulhrsw m10, [pw_11585x2] ; t1
+
+ ; from 2 stages back
+ SUMSUB_BA w, 8, 11, 7 ; t0, t3
+%endif
+ SUMSUB_BA w, 9, 10, 7 ; t1, t2
+
+ ; from 1 stage back
+ SUMSUB_BA w, 15, 8, 7 ; t0, t7
+ SUMSUB_BA w, 14, 9, 7 ; t1, t6
+ SUMSUB_BA w, 13, 10, 7 ; t2, t5
+%endif
+ SUMSUB_BA w, 12, 11, 7 ; t3, t4
+
+ SUMSUB_BA w, 0, 15, 7 ; t0, t15
+ SUMSUB_BA w, 1, 14, 7 ; t1, t14
+ SUMSUB_BA w, 2, 13, 7 ; t2, t13
+ SUMSUB_BA w, 3, 12, 7 ; t3, t12
+ SUMSUB_BA w, 4, 11, 7 ; t4, t11
+ SUMSUB_BA w, 5, 10, 7 ; t5, t10
+%endmacro
+
+%macro VP9_IDCT16_1D 2-3 16 ; src, pass, nnzc
+ VP9_IDCT16_1D_START %1, %3, 32, tmpq+32
+
+%if %2 == 1
+ ; backup a different register
+ mova [tmpq+16], m15
+ mova m7, [tmpq+32]
+
+ SUMSUB_BA w, 6, 9, 15 ; t6, t9
+ SUMSUB_BA w, 7, 8, 15 ; t7, t8
+
+ TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 15
+ mova [tmpq+ 0], m0
+ mova [tmpq+ 32], m1
+ mova [tmpq+ 64], m2
+ mova [tmpq+ 96], m3
+ mova [tmpq+128], m4
+ mova [tmpq+160], m5
+ mova [tmpq+192], m6
+ mova [tmpq+224], m7
+
+ mova m15, [tmpq+16]
+ TRANSPOSE8x8W 8, 9, 10, 11, 12, 13, 14, 15, 0
+ mova [tmpq+ 16], m8
+ mova [tmpq+ 48], m9
+ mova [tmpq+ 80], m10
+ mova [tmpq+112], m11
+ mova [tmpq+144], m12
+ mova [tmpq+176], m13
+ mova [tmpq+208], m14
+ mova [tmpq+240], m15
+%else ; %2 == 2
+ ; backup more registers
+ mova [tmpq+64], m8
+ mova [tmpq+96], m9
+
+ pxor m7, m7
+ pmulhrsw m0, [pw_512]
+ pmulhrsw m1, [pw_512]
+ VP9_STORE_2X 0, 1, 8, 9, 7
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m2, [pw_512]
+ pmulhrsw m3, [pw_512]
+ VP9_STORE_2X 2, 3, 8, 9, 7
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m4, [pw_512]
+ pmulhrsw m5, [pw_512]
+ VP9_STORE_2X 4, 5, 8, 9, 7
+ lea dstq, [dstq+strideq*2]
+
+ ; restore from cache
+ SWAP 0, 7 ; move zero from m7 to m0
+ mova m7, [tmpq+32]
+ mova m8, [tmpq+64]
+ mova m9, [tmpq+96]
+
+ SUMSUB_BA w, 6, 9, 1 ; t6, t9
+ SUMSUB_BA w, 7, 8, 1 ; t7, t8
+
+ pmulhrsw m6, [pw_512]
+ pmulhrsw m7, [pw_512]
+ VP9_STORE_2X 6, 7, 1, 2, 0
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m8, [pw_512]
+ pmulhrsw m9, [pw_512]
+ VP9_STORE_2X 8, 9, 1, 2, 0
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m10, [pw_512]
+ pmulhrsw m11, [pw_512]
+ VP9_STORE_2X 10, 11, 1, 2, 0
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m12, [pw_512]
+ pmulhrsw m13, [pw_512]
+ VP9_STORE_2X 12, 13, 1, 2, 0
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m14, [pw_512]
+ pmulhrsw m15, [pw_512]
+ VP9_STORE_2X 14, 15, 1, 2, 0
+%endif ; %2 == 1/2
+%endmacro
+
+%macro VP9_STORE_2XFULL 6-7 strideq; dc, tmp1, tmp2, tmp3, tmp4, zero, stride
+ mova m%3, [dstq]
+ mova m%5, [dstq+%7]
+ punpcklbw m%2, m%3, m%6
+ punpckhbw m%3, m%6
+ punpcklbw m%4, m%5, m%6
+ punpckhbw m%5, m%6
+ paddw m%2, m%1
+ paddw m%3, m%1
+ paddw m%4, m%1
+ paddw m%5, m%1
+ packuswb m%2, m%3
+ packuswb m%4, m%5
+ mova [dstq], m%2
+ mova [dstq+%7], m%4
+%endmacro
+
+%macro VP9_IDCT_IDCT_16x16_ADD_XMM 1
+INIT_XMM %1
+cglobal vp9_idct_idct_16x16_add, 4, 6, 16, 512, dst, stride, block, eob
+ ; 2x2=eob=3, 4x4=eob=10
+ cmp eobd, 38
+ jg .idctfull
+ cmp eobd, 1 ; faster path for when only DC is set
+ jne .idct8x8
+
+ ; dc-only
+ movd m0, [blockq]
+ mova m1, [pw_11585x2]
+ pmulhrsw m0, m1
+ pmulhrsw m0, m1
+ SPLATW m0, m0, q0000
+ pmulhrsw m0, [pw_512]
+ pxor m5, m5
+ movd [blockq], m5
+%rep 7
+ VP9_STORE_2XFULL 0, 1, 2, 3, 4, 5
+ lea dstq, [dstq+2*strideq]
+%endrep
+ VP9_STORE_2XFULL 0, 1, 2, 3, 4, 5
+ RET
+
+ DEFINE_ARGS dst, stride, block, cnt, dst_bak, tmp
+.idct8x8:
+ mov tmpq, rsp
+ VP9_IDCT16_1D blockq, 1, 8
+
+ mov cntd, 2
+ mov dst_bakq, dstq
+.loop2_8x8:
+ VP9_IDCT16_1D tmpq, 2, 8
+ lea dstq, [dst_bakq+8]
+ add tmpq, 16
+ dec cntd
+ jg .loop2_8x8
+
+ ; at the end of the loop, m0 should still be zero
+ ; use that to zero out block coefficients
+ ZERO_BLOCK blockq, 32, 8, m0
+ RET
+
+.idctfull:
+ mov cntd, 2
+ mov tmpq, rsp
+.loop1_full:
+ VP9_IDCT16_1D blockq, 1
+ add blockq, 16
+ add tmpq, 256
+ dec cntd
+ jg .loop1_full
+ sub blockq, 32
+
+ mov cntd, 2
+ mov tmpq, rsp
+ mov dst_bakq, dstq
+.loop2_full:
+ VP9_IDCT16_1D tmpq, 2
+ lea dstq, [dst_bakq+8]
+ add tmpq, 16
+ dec cntd
+ jg .loop2_full
+
+ ; at the end of the loop, m0 should still be zero
+ ; use that to zero out block coefficients
+ ZERO_BLOCK blockq, 32, 16, m0
+ RET
+%endmacro
+
+VP9_IDCT_IDCT_16x16_ADD_XMM ssse3
+VP9_IDCT_IDCT_16x16_ADD_XMM avx
+
+;---------------------------------------------------------------------------------------------
+; void vp9_iadst_iadst_16x16_add_<opt>(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
+;---------------------------------------------------------------------------------------------
+
+%macro VP9_IADST16_1D 2 ; src, pass
+%assign %%str 16*%2
+ mova m0, [%1+ 0*32] ; in0
+ mova m1, [%1+15*32] ; in15
+ mova m8, [%1+ 7*32] ; in7
+ mova m9, [%1+ 8*32] ; in8
+
+ VP9_UNPACK_MULSUB_2D_4X 1, 0, 2, 3, 16364, 804 ; m1/2=t1[d], m0/3=t0[d]
+ VP9_UNPACK_MULSUB_2D_4X 8, 9, 11, 10, 11003, 12140 ; m8/11=t9[d], m9/10=t8[d]
+ VP9_RND_SH_SUMSUB_BA 9, 0, 10, 3, 4, [pd_8192] ; m9=t0[w], m0=t8[w]
+ VP9_RND_SH_SUMSUB_BA 8, 1, 11, 2, 4, [pd_8192] ; m8=t1[w], m1=t9[w]
+
+ mova m11, [%1+ 2*32] ; in2
+ mova m10, [%1+13*32] ; in13
+ mova m3, [%1+ 5*32] ; in5
+ mova m2, [%1+10*32] ; in10
+
+ VP9_UNPACK_MULSUB_2D_4X 10, 11, 6, 7, 15893, 3981 ; m10/6=t3[d], m11/7=t2[d]
+ VP9_UNPACK_MULSUB_2D_4X 3, 2, 4, 5, 8423, 14053 ; m3/4=t11[d], m2/5=t10[d]
+ VP9_RND_SH_SUMSUB_BA 2, 11, 5, 7, 12, [pd_8192] ; m2=t2[w], m11=t10[w]
+ VP9_RND_SH_SUMSUB_BA 3, 10, 4, 6, 12, [pd_8192] ; m3=t3[w], m10=t11[w]
+
+ mova [tmpq+ 0*%%str], m9 ; make some scratch space (t0:m9->r0)
+ mova m4, [%1+ 4*32] ; in4
+ mova m5, [%1+11*32] ; in11
+ mova m12, [%1+ 3*32] ; in3
+ mova m13, [%1+12*32] ; in12
+
+ VP9_UNPACK_MULSUB_2D_4X 5, 4, 7, 6, 14811, 7005 ; m5/7=t5[d], m4/6=t4[d]
+ VP9_UNPACK_MULSUB_2D_4X 12, 13, 14, 15, 5520, 15426 ; m12/14=t13[d], m13/15=t12[d]
+ VP9_RND_SH_SUMSUB_BA 13, 4, 15, 6, 9, [pd_8192] ; m13=t4[w], m4=t12[w]
+ VP9_RND_SH_SUMSUB_BA 12, 5, 14, 7, 9, [pd_8192] ; m12=t5[w], m5=t13[w]
+
+ mova [tmpq+ 2*%%str], m8 ; t1:m9->r2
+ mova [tmpq+ 3*%%str], m2 ; t2:m2->r3
+ mova [tmpq+ 4*%%str], m3 ; t3:m3->r4
+ mova [tmpq+ 5*%%str], m13 ; t4:m13->r5
+ mova m2, [%1+ 6*32] ; in6
+ mova m3, [%1+ 9*32] ; in9
+ mova m8, [%1+ 1*32] ; in1
+ mova m9, [%1+14*32] ; in14
+
+ VP9_UNPACK_MULSUB_2D_4X 3, 2, 7, 6, 13160, 9760 ; m3/7=t7[d], m2/6=t6[d]
+ VP9_UNPACK_MULSUB_2D_4X 8, 9, 13, 14, 2404, 16207 ; m8/13=t15[d], m9/14=t14[d]
+ VP9_RND_SH_SUMSUB_BA 9, 2, 14, 6, 15, [pd_8192] ; m9=t6[w], m2=t14[w]
+ VP9_RND_SH_SUMSUB_BA 8, 3, 13, 7, 15, [pd_8192] ; m8=t7[w], m3=t15[w]
+
+ ; r0=t0, r2=t1, r3=t2, r4=t3, r5=t4, m12=t5, m9=t6, m8=t7
+ ; m0=t8, m1=t9, m11=t10, m10=t11, m4=t12, m5=t13, m2=t14, m3=t15
+
+ ; handle t8-15 first
+ VP9_UNPACK_MULSUB_2D_4X 0, 1, 6, 7, 16069, 3196 ; m1/7=t8[d], m0/6=t9[d]
+ VP9_UNPACK_MULSUB_2D_4X 5, 4, 13, 14, 3196, 16069 ; m5/13=t12[d], m4/14=t13[d]
+ VP9_RND_SH_SUMSUB_BA 5, 1, 13, 7, 15, [pd_8192] ; m5=t8[w], m1=t12[w]
+ VP9_RND_SH_SUMSUB_BA 4, 0, 14, 6, 15, [pd_8192] ; m4=t9[w], m0=t13[w]
+
+ VP9_UNPACK_MULSUB_2D_4X 11, 10, 6, 7, 9102, 13623 ; m11/6=t11[d], m10/7=t10[d]
+ VP9_UNPACK_MULSUB_2D_4X 3, 2, 13, 14, 13623, 9102 ; m3/13=t14[d], m2/14=t15[d]
+ VP9_RND_SH_SUMSUB_BA 3, 10, 13, 7, 15, [pd_8192] ; m3=t10[w], m10=t14[w]
+ VP9_RND_SH_SUMSUB_BA 2, 11, 14, 6, 15, [pd_8192] ; m2=t11[w], m11=t15[w]
+
+ ; m5=t8, m4=t9, m3=t10, m2=t11, m1=t12, m0=t13, m10=t14, m11=t15
+
+ VP9_UNPACK_MULSUB_2D_4X 1, 0, 6, 7, 15137, 6270 ; m1/6=t13[d], m0/7=t12[d]
+ VP9_UNPACK_MULSUB_2D_4X 11, 10, 13, 14, 6270, 15137 ; m11/13=t14[d], m10/14=t15[d]
+ VP9_RND_SH_SUMSUB_BA 11, 0, 13, 7, 15, [pd_8192] ; m11=out2[w], m0=t14[w]
+ VP9_RND_SH_SUMSUB_BA 10, 1, 14, 6, 15, [pd_8192]
+ psignw m10, [pw_m1] ; m10=out13[w], m1=t15[w]
+
+ SUMSUB_BA w, 3, 5, 15
+ psignw m3, [pw_m1] ; m3=out1[w], m5=t10[w]
+ SUMSUB_BA w, 2, 4, 15 ; m2=out14[w], m4=t11[w]
+
+ SUMSUB_BA w, 5, 4, 15
+ pmulhrsw m5, [pw_11585x2] ; m5=out6[w]
+ pmulhrsw m4, [pw_11585x2] ; m4=out9[w]
+ SUMSUB_BA w, 1, 0, 15
+ pmulhrsw m1, [pw_m11585x2] ; m1=out5[w]
+ pmulhrsw m0, [pw_11585x2] ; m0=out10[w]
+
+ ; m3=out1, m11=out2, m1=out5, m5=out6, m4=out9, m0=out10, m10=out13, m2=out14
+
+ mova m6, [tmpq+ 0*%%str]
+ mova m7, [tmpq+ 2*%%str]
+ mova m13, [tmpq+ 3*%%str]
+ mova m14, [tmpq+ 4*%%str]
+ mova m15, [tmpq+ 5*%%str]
+ mova [tmpq+ 8*%%str], m5
+ mova [tmpq+ 9*%%str], m4
+ mova [tmpq+10*%%str], m0
+ mova [tmpq+11*%%str], m10
+ mova [tmpq+12*%%str], m2
+
+ ; m6=t0, m7=t1, m13=t2, m14=t3, m15=t4, m12=t5, m9=t6, m8=t7
+ ; m3=out1, m11=out2, m1=out5, r8=out6, r9=out9, r10=out10, r11=out13, r12=out14
+
+ SUMSUB_BA w, 15, 6, 0 ; m15=t0[w], m6=t4[w]
+ SUMSUB_BA w, 12, 7, 0 ; m12=t1[w], m7=t5[w]
+ SUMSUB_BA w, 9, 13, 0 ; m9=t2[w], m13=t6[w]
+ SUMSUB_BA w, 8, 14, 0 ; m8=t3[w], m14=t7[w]
+
+ VP9_UNPACK_MULSUB_2D_4X 6, 7, 0, 2, 15137, 6270 ; m6/0=t5[d], m7/2=t4[d]
+ VP9_UNPACK_MULSUB_2D_4X 14, 13, 4, 5, 6270, 15137 ; m14/4=t6[d], m13/5=t7[d]
+ VP9_RND_SH_SUMSUB_BA 14, 7, 4, 2, 10, [pd_8192]
+ psignw m14, [pw_m1] ; m14=out3[w], m7=t6[w]
+ VP9_RND_SH_SUMSUB_BA 13, 6, 5, 0, 10, [pd_8192] ; m13=out12[w], m6=t7[w]
+ SUMSUB_BA w, 9, 15, 10 ; m9=out0[w], m15=t2[w]
+ SUMSUB_BA w, 8, 12, 10
+ psignw m8, [pw_m1] ; m8=out15[w], m12=t3[w]
+
+ SUMSUB_BA w, 12, 15, 10
+ pmulhrsw m12, [pw_m11585x2] ; m12=out7[w]
+ pmulhrsw m15, [pw_11585x2] ; m15=out8[w]
+ SUMSUB_BA w, 7, 6, 10
+ pmulhrsw m7, [pw_11585x2] ; m7=out4[w]
+ pmulhrsw m6, [pw_11585x2] ; m6=out11[w]
+
+ ; m9=out0, m14=out3, m7=out4, m12=out7, m15=out8, m6=out11, m13=out12, m8=out15
+ ; m3=out1, m11=out2, m1=out5, r8=out6, r9=out9, r10=out10, r11=out13, r12=out14
+
+%if %2 == 1
+ mova m0, [tmpq+ 8*%%str]
+ TRANSPOSE8x8W 9, 3, 11, 14, 7, 1, 0, 12, 2
+ mova [tmpq+ 0*16], m9
+ mova [tmpq+ 2*16], m3
+ mova [tmpq+ 4*16], m11
+ mova [tmpq+ 6*16], m14
+ mova m9, [tmpq+ 9*%%str]
+ mova m3, [tmpq+10*%%str]
+ mova m11, [tmpq+11*%%str]
+ mova m14, [tmpq+12*%%str]
+ mova [tmpq+ 8*16], m7
+ mova [tmpq+10*16], m1
+ mova [tmpq+12*16], m0
+ mova [tmpq+14*16], m12
+
+ TRANSPOSE8x8W 15, 9, 3, 6, 13, 11, 14, 8, 2
+ mova [tmpq+ 1*16], m15
+ mova [tmpq+ 3*16], m9
+ mova [tmpq+ 5*16], m3
+ mova [tmpq+ 7*16], m6
+ mova [tmpq+ 9*16], m13
+ mova [tmpq+11*16], m11
+ mova [tmpq+13*16], m14
+ mova [tmpq+15*16], m8
+%else
+ mova m5, [tmpq+ 8*%%str]
+ pxor m0, m0
+
+ pmulhrsw m9, [pw_512]
+ pmulhrsw m3, [pw_512]
+ VP9_STORE_2X 9, 3, 2, 4, 0
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m11, [pw_512]
+ pmulhrsw m14, [pw_512]
+ VP9_STORE_2X 11, 14, 2, 4, 0
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m7, [pw_512]
+ pmulhrsw m1, [pw_512]
+ VP9_STORE_2X 7, 1, 2, 4, 0
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m5, [pw_512]
+ pmulhrsw m12, [pw_512]
+ VP9_STORE_2X 5, 12, 2, 4, 0
+ lea dstq, [dstq+strideq*2]
+
+ mova m9, [tmpq+ 9*%%str]
+ mova m3, [tmpq+10*%%str]
+ mova m11, [tmpq+11*%%str]
+ mova m14, [tmpq+12*%%str]
+
+ pmulhrsw m15, [pw_512]
+ pmulhrsw m9, [pw_512]
+ VP9_STORE_2X 15, 9, 2, 4, 0
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m3, [pw_512]
+ pmulhrsw m6, [pw_512]
+ VP9_STORE_2X 3, 6, 2, 4, 0
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m13, [pw_512]
+ pmulhrsw m11, [pw_512]
+ VP9_STORE_2X 13, 11, 2, 4, 0
+ lea dstq, [dstq+strideq*2]
+ pmulhrsw m14, [pw_512]
+ pmulhrsw m8, [pw_512]
+ VP9_STORE_2X 14, 8, 2, 4, 0
+%endif
+%endmacro
+
+%macro IADST16_FN 5
+INIT_XMM %5
+cglobal vp9_%1_%3_16x16_add, 3, 6, 16, 512, dst, stride, block, cnt, dst_bak, tmp
+ mov cntd, 2
+ mov tmpq, rsp
+.loop1_full:
+ VP9_%2_1D blockq, 1
+ add blockq, 16
+ add tmpq, 256
+ dec cntd
+ jg .loop1_full
+ sub blockq, 32
+
+ mov cntd, 2
+ mov tmpq, rsp
+ mov dst_bakq, dstq
+.loop2_full:
+ VP9_%4_1D tmpq, 2
+ lea dstq, [dst_bakq+8]
+ add tmpq, 16
+ dec cntd
+ jg .loop2_full
+
+ ; at the end of the loop, m0 should still be zero
+ ; use that to zero out block coefficients
+ ZERO_BLOCK blockq, 32, 16, m0
+ RET
+%endmacro
+
+IADST16_FN idct, IDCT16, iadst, IADST16, ssse3
+IADST16_FN idct, IDCT16, iadst, IADST16, avx
+IADST16_FN iadst, IADST16, idct, IDCT16, ssse3
+IADST16_FN iadst, IADST16, idct, IDCT16, avx
+IADST16_FN iadst, IADST16, iadst, IADST16, ssse3
+IADST16_FN iadst, IADST16, iadst, IADST16, avx
+
+;---------------------------------------------------------------------------------------------
+; void vp9_idct_idct_32x32_add_<opt>(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
+;---------------------------------------------------------------------------------------------
+
+%macro VP9_IDCT32_1D 2-3 32 ; src, pass, nnzc
+%assign %%str 16*%2*%2
+ ; first do t0-15, this can be done identical to idct16x16
+ VP9_IDCT16_1D_START %1, %3/2, 64*2, tmpq+ 4*%%str
+
+ ; backup a different register
+ mova [tmpq+30*%%str], m15 ; t15
+ mova m7, [tmpq+ 4*%%str]
+
+ SUMSUB_BA w, 6, 9, 15 ; t6, t9
+ SUMSUB_BA w, 7, 8, 15 ; t7, t8
+
+ ; store everything on stack to make space available for t16-31
+ ; we store interleaved with the output of the second half (t16-31)
+ ; so we don't need to allocate extra stack space
+ mova [tmpq+ 0*%%str], m0 ; t0
+ mova [tmpq+ 4*%%str], m1 ; t1
+ mova [tmpq+ 8*%%str], m2 ; t2
+ mova [tmpq+12*%%str], m3 ; t3
+ mova [tmpq+16*%%str], m4 ; t4
+ mova [tmpq+20*%%str], m5 ; t5
+ mova [tmpq+24*%%str], m6 ; t6
+ mova [tmpq+28*%%str], m7 ; t7
+ mova [tmpq+ 2*%%str], m8 ; t8
+ mova [tmpq+ 6*%%str], m9 ; t9
+ mova [tmpq+10*%%str], m10 ; t10
+ mova [tmpq+14*%%str], m11 ; t11
+ mova [tmpq+18*%%str], m12 ; t12
+ mova [tmpq+22*%%str], m13 ; t13
+ mova [tmpq+26*%%str], m14 ; t14
+
+ ; then, secondly, do t16-31
+%if %3 <= 8
+ mova m4, [%1+ 1*64]
+ mova m3, [%1+ 3*64]
+ mova m0, [%1+ 5*64]
+ mova m7, [%1+ 7*64]
+
+ pmulhrsw m11, m4, [pw_16364x2] ;t31
+ pmulhrsw m4, [pw_804x2] ;t16
+ pmulhrsw m8, m7, [pw_m5520x2] ;t19
+ pmulhrsw m7, [pw_15426x2] ;t28
+ pmulhrsw m15, m0, [pw_15893x2] ;t27
+ pmulhrsw m0, [pw_3981x2] ;t20
+ pmulhrsw m12, m3, [pw_m2404x2] ;t23
+ pmulhrsw m3, [pw_16207x2] ;t24
+
+ ; m4=t16/17, m8=t18/19, m0=t20/21, m12=t22/23,
+ ; m3=t24/25, m15=t26/27, m7=t28/29, m11=t30/31
+
+ VP9_UNPACK_MULSUB_2W_4X 5, 10, 11, 4, 16069, 3196, [pd_8192], 6, 9 ; t17, t30
+ VP9_UNPACK_MULSUB_2W_4X 9, 6, 7, 8, 3196, m16069, [pd_8192], 1, 14 ; t18, t29
+ ; from 1 stage forward
+ SUMSUB_BA w, 8, 4, 1
+ ; temporary storage
+ mova [tmpq+17*%%str], m8 ; t16
+ mova [tmpq+21*%%str], m4 ; t19
+ VP9_UNPACK_MULSUB_2W_4X 1, 14, 15, 0, 9102, 13623, [pd_8192], 4, 8 ; t21, t26
+ VP9_UNPACK_MULSUB_2W_4X 13, 2, 3, 12, 13623, m9102, [pd_8192], 4, 8 ; t22, t25
+
+ ; m4=t16, m5=t17, m9=t18, m8=t19, m0=t20, m1=t21, m13=t22, m12=t23,
+ ; m3=t24, m2=t25, m14=t26, m15=t27, m7=t28, m6=t29, m10=t30, m11=t31
+%else
+ mova m10, [%1+ 1*64]
+ mova m13, [%1+ 3*64]
+ mova m14, [%1+ 5*64]
+ mova m9, [%1+ 7*64]
+ mova m8, [%1+ 9*64]
+ mova m15, [%1+11*64]
+ mova m12, [%1+13*64]
+ mova m11, [%1+15*64]
+%if %3 <= 16
+ pmulhrsw m5, m10, [pw_16364x2]
+ pmulhrsw m10, [pw_804x2]
+ pmulhrsw m4, m11, [pw_m11003x2]
+ pmulhrsw m11, [pw_12140x2]
+ pmulhrsw m7, m8, [pw_14811x2]
+ pmulhrsw m8, [pw_7005x2]
+ pmulhrsw m6, m9, [pw_m5520x2]
+ pmulhrsw m9, [pw_15426x2]
+ pmulhrsw m1, m14, [pw_15893x2]
+ pmulhrsw m14, [pw_3981x2]
+ pmulhrsw m0, m15, [pw_m8423x2]
+ pmulhrsw m15, [pw_14053x2]
+%else
+ mova m4, [%1+17*64]
+ mova m0, [%1+21*64]
+ mova m7, [%1+23*64]
+ mova m6, [%1+25*64]
+ mova m1, [%1+27*64]
+ mova m5, [%1+31*64]
+
+ ; m10=in1, m4=in17, m8=in9, m6=in25, m14=in5, m0=in21, m12=in13, m2=in29,
+ ; m13=in3, m3=in19, m15=in11, m1=in27, m9=in7, m7=in23, m11=in15, m5=in31
+
+ VP9_UNPACK_MULSUB_2W_4X 10, 5, 16364, 804, [pd_8192], 2, 3 ; t16, t31
+ VP9_UNPACK_MULSUB_2W_4X 4, 11, 11003, 12140, [pd_8192], 2, 3 ; t17, t30
+ VP9_UNPACK_MULSUB_2W_4X 8, 7, 14811, 7005, [pd_8192], 2, 3 ; t18, t29
+ VP9_UNPACK_MULSUB_2W_4X 6, 9, 5520, 15426, [pd_8192], 2, 3 ; t19, t28
+ VP9_UNPACK_MULSUB_2W_4X 14, 1, 15893, 3981, [pd_8192], 2, 3 ; t20, t27
+ VP9_UNPACK_MULSUB_2W_4X 0, 15, 8423, 14053, [pd_8192], 2, 3 ; t21, t26
+%endif
+
+ ; from 1 stage forward
+ SUMSUB_BA w, 4, 10, 2
+ SUMSUB_BA w, 8, 6, 2
+ ; from 2 stages forward
+ SUMSUB_BA w, 8, 4, 2
+ ; temporary storage
+ mova [tmpq+17*%%str], m8 ; t16
+ mova [tmpq+21*%%str], m4 ; t19
+%if %3 <= 16
+ pmulhrsw m3, m12, [pw_13160x2]
+ pmulhrsw m12, [pw_9760x2]
+ pmulhrsw m2, m13, [pw_m2404x2]
+ pmulhrsw m13, [pw_16207x2]
+%else
+ mova m2, [%1+29*64]
+ mova m3, [%1+19*64]
+ VP9_UNPACK_MULSUB_2W_4X 12, 3, 13160, 9760, [pd_8192], 4, 8 ; t22, t25
+ VP9_UNPACK_MULSUB_2W_4X 2, 13, 2404, 16207, [pd_8192], 4, 8 ; t23, t24
+%endif
+
+ ; m10=t16, m4=t17, m8=t18, m6=t19, m14=t20, m0=t21, m12=t22, m2=t23,
+ ; m13=t24, m3=t25, m15=t26, m1=t27, m9=t28, m7=t29, m11=t30, m5=t31
+
+ SUMSUB_BA w, 0, 14, 4
+ SUMSUB_BA w, 12, 2, 4
+ SUMSUB_BA w, 3, 13, 4
+ SUMSUB_BA w, 15, 1, 4
+ SUMSUB_BA w, 7, 9, 4
+ SUMSUB_BA w, 11, 5, 4
+
+ ; m4=t16, m10=t17, m6=t18, m8=t19, m0=t20, m14=t21, m2=t22, m12=t23,
+ ; m3=t24, m13=t25, m1=t26, m15=t27, m7=t28, m9=t29, m5=t30, m11=t31
+
+ VP9_UNPACK_MULSUB_2W_4X 5, 10, 16069, 3196, [pd_8192], 4, 8 ; t17, t30
+ VP9_UNPACK_MULSUB_2W_4X 9, 6, 3196, m16069, [pd_8192], 4, 8 ; t18, t29
+ VP9_UNPACK_MULSUB_2W_4X 1, 14, 9102, 13623, [pd_8192], 4, 8 ; t21, t26
+ VP9_UNPACK_MULSUB_2W_4X 13, 2, 13623, m9102, [pd_8192], 4, 8 ; t22, t25
+%endif
+
+ ; m4=t16, m5=t17, m9=t18, m8=t19, m0=t20, m1=t21, m13=t22, m12=t23,
+ ; m3=t24, m2=t25, m14=t26, m15=t27, m7=t28, m6=t29, m10=t30, m11=t31
+
+ SUMSUB_BA w, 9, 5, 4
+ SUMSUB_BA w, 1, 13, 4
+ SUMSUB_BA w, 0, 12, 4
+ SUMSUB_BA w, 15, 3, 4
+ SUMSUB_BA w, 14, 2, 4
+ SUMSUB_BA w, 6, 10, 4
+ SUMSUB_BA w, 7, 11, 4
+
+ ; m8[s]=t16, m9=t17, m5=t18, m4[s]=t19, m12=t20, m13=t21, m1=t22, m0=t23,
+ ; m15=t24, m14=t25, m2=t26, m3=t27, m11=t28, m10=t29, m6=t30, m7=t31
+
+ mova m8, [tmpq+17*%%str] ; t16
+ ; from 2 stages forward
+ SUMSUB_BA w, 0, 8, 4
+ SUMSUB_BA w, 15, 7, 4
+ ; from 3 stages forward
+ SUMSUB_BA w, 8, 7, 4
+ pmulhrsw m7, [pw_11585x2]
+ pmulhrsw m8, [pw_11585x2]
+ ; store t16/t23
+ mova [tmpq+ 1*%%str], m0 ; t16
+ mova [tmpq+29*%%str], m7 ; t23
+
+ mova m4, [tmpq+21*%%str] ; t19
+ VP9_UNPACK_MULSUB_2W_4X 10, 5, 15137, 6270, [pd_8192], 0, 7 ; t18, t29
+ VP9_UNPACK_MULSUB_2W_4X 11, 4, 15137, 6270, [pd_8192], 0, 7 ; t19, t28
+ VP9_UNPACK_MULSUB_2W_4X 3, 12, 6270, m15137, [pd_8192], 0, 7 ; t20, t27
+ VP9_UNPACK_MULSUB_2W_4X 2, 13, 6270, m15137, [pd_8192], 0, 7 ; t21, t26
+
+ ; m8=t16, m9=t17, m10=t18, m11=t19, m3=t20, m2=t21, m1=t22, m0=t23,
+ ; m15=t24, m14=t25, m13=t26, m12=t27, m4=t28, m5=t29, m6=t30, m7=t31
+
+ SUMSUB_BA w, 1, 9, 0
+ SUMSUB_BA w, 2, 10, 0
+ SUMSUB_BA w, 3, 11, 0
+ SUMSUB_BA w, 12, 4, 0
+ SUMSUB_BA w, 13, 5, 0
+ SUMSUB_BA w, 14, 6, 0
+
+ ; m0=t16, m1=t17, m2=t18, m3=t19, m11=t20, m10=t21, m9=t22, m8=t23,
+ ; m7=t24, m6=t25, m5=t26, m4=t27, m12=t28, m13=t29, m14=t30, m15=t31
+
+ SUMSUB_BA w, 9, 6, 0
+ SUMSUB_BA w, 10, 5, 0
+ SUMSUB_BA w, 11, 4, 0
+
+ pmulhrsw m6, [pw_11585x2]
+ pmulhrsw m9, [pw_11585x2]
+ pmulhrsw m5, [pw_11585x2]
+ pmulhrsw m10, [pw_11585x2]
+ pmulhrsw m4, [pw_11585x2]
+ pmulhrsw m11, [pw_11585x2]
+
+ ; m0=t16, m1=t17, m2=t18, m3=t19, m4=t20, m5=t21, m6=t22, m7=t23,
+ ; m8=t24, m9=t25, m10=t26, m11=t27, m12=t28, m13=t29, m14=t30, m15=t31
+
+ ; store t17-19 (and t20-22 for pass 1) - keep t24-31 in registers for
+ ; final sumsub in pass 1, or keep t20-22 and t24-31 in registers for
+ ; final sumsub of pass 2
+ mova [tmpq+ 5*%%str], m1 ; t17
+ mova [tmpq+ 9*%%str], m2 ; t18
+ mova [tmpq+13*%%str], m3 ; t19
+
+ ; then do final pass to sumsub+store the two halves
+%if %2 == 1
+ mova [tmpq+17*%%str], m4 ; t20
+ mova [tmpq+21*%%str], m5 ; t21
+ mova [tmpq+25*%%str], m6 ; t22
+
+ mova m0, [tmpq+ 0*%%str] ; t0
+ mova m1, [tmpq+ 4*%%str] ; t1
+ mova m2, [tmpq+ 8*%%str] ; t2
+ mova m3, [tmpq+12*%%str] ; t3
+ mova m4, [tmpq+16*%%str] ; t4
+ mova m5, [tmpq+20*%%str] ; t5
+ mova m6, [tmpq+24*%%str] ; t6
+
+ SUMSUB_BA w, 15, 0, 7
+ mova [tmpq+ 3*%%str], m0 ; t15
+ mova m7, [tmpq+28*%%str] ; t7
+ SUMSUB_BA w, 14, 1, 0
+ SUMSUB_BA w, 13, 2, 0
+ SUMSUB_BA w, 12, 3, 0
+ SUMSUB_BA w, 11, 4, 0
+ SUMSUB_BA w, 10, 5, 0
+ SUMSUB_BA w, 9, 6, 0
+ SUMSUB_BA w, 8, 7, 0
+
+ TRANSPOSE8x8W 15, 14, 13, 12, 11, 10, 9, 8, 0
+ mova [tmpq+ 0*%%str], m15
+ mova [tmpq+ 4*%%str], m14
+ mova [tmpq+ 8*%%str], m13
+ mova [tmpq+12*%%str], m12
+ mova [tmpq+16*%%str], m11
+ mova [tmpq+20*%%str], m10
+ mova [tmpq+24*%%str], m9
+ mova [tmpq+28*%%str], m8
+
+ mova m0, [tmpq+ 3*%%str] ; t15
+ TRANSPOSE8x8W 7, 6, 5, 4, 3, 2, 1, 0, 8
+ mova [tmpq+ 3*%%str], m7
+ mova [tmpq+ 7*%%str], m6
+ mova [tmpq+11*%%str], m5
+ mova [tmpq+15*%%str], m4
+ mova [tmpq+19*%%str], m3
+ mova [tmpq+23*%%str], m2
+ mova [tmpq+27*%%str], m1
+ mova [tmpq+31*%%str], m0
+
+ mova m15, [tmpq+ 2*%%str] ; t8
+ mova m14, [tmpq+ 6*%%str] ; t9
+ mova m13, [tmpq+10*%%str] ; t10
+ mova m12, [tmpq+14*%%str] ; t11
+ mova m11, [tmpq+18*%%str] ; t12
+ mova m10, [tmpq+22*%%str] ; t13
+ mova m9, [tmpq+26*%%str] ; t14
+ mova m8, [tmpq+30*%%str] ; t15
+ mova m7, [tmpq+ 1*%%str] ; t16
+ mova m6, [tmpq+ 5*%%str] ; t17
+ mova m5, [tmpq+ 9*%%str] ; t18
+ mova m4, [tmpq+13*%%str] ; t19
+ mova m3, [tmpq+17*%%str] ; t20
+ mova m2, [tmpq+21*%%str] ; t21
+ mova m1, [tmpq+25*%%str] ; t22
+
+ SUMSUB_BA w, 7, 8, 0
+ mova [tmpq+ 2*%%str], m8
+ mova m0, [tmpq+29*%%str] ; t23
+ SUMSUB_BA w, 6, 9, 8
+ SUMSUB_BA w, 5, 10, 8
+ SUMSUB_BA w, 4, 11, 8
+ SUMSUB_BA w, 3, 12, 8
+ SUMSUB_BA w, 2, 13, 8
+ SUMSUB_BA w, 1, 14, 8
+ SUMSUB_BA w, 0, 15, 8
+
+ TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8
+ mova [tmpq+ 1*%%str], m0
+ mova [tmpq+ 5*%%str], m1
+ mova [tmpq+ 9*%%str], m2
+ mova [tmpq+13*%%str], m3
+ mova [tmpq+17*%%str], m4
+ mova [tmpq+21*%%str], m5
+ mova [tmpq+25*%%str], m6
+ mova [tmpq+29*%%str], m7
+
+ mova m8, [tmpq+ 2*%%str]
+ TRANSPOSE8x8W 8, 9, 10, 11, 12, 13, 14, 15, 0
+ mova [tmpq+ 2*%%str], m8
+ mova [tmpq+ 6*%%str], m9
+ mova [tmpq+10*%%str], m10
+ mova [tmpq+14*%%str], m11
+ mova [tmpq+18*%%str], m12
+ mova [tmpq+22*%%str], m13
+ mova [tmpq+26*%%str], m14
+ mova [tmpq+30*%%str], m15
+%else
+ ; t0-7 is in [tmpq+{0,4,8,12,16,20,24,28}*%%str]
+ ; t8-15 is in [tmpq+{2,6,10,14,18,22,26,30}*%%str]
+ ; t16-19 and t23 is in [tmpq+{1,5,9,13,29}*%%str]
+ ; t20-22 is in m4-6
+ ; t24-31 is in m8-15
+ pxor m7, m7
+
+%macro %%STORE_2X2 7-8 1 ; src[1-4], tmp[1-2], zero, inc_dst_ptrs
+ SUMSUB_BA w, %4, %1, %5
+ SUMSUB_BA w, %3, %2, %5
+ pmulhrsw m%4, [pw_512]
+ pmulhrsw m%3, [pw_512]
+ VP9_STORE_2X %4, %3, %5, %6, %7
+%if %8 == 1
+ add dstq, stride2q
+%endif
+ pmulhrsw m%2, [pw_512]
+ pmulhrsw m%1, [pw_512]
+ VP9_STORE_2X %2, %1, %5, %6, %7, dst_endq
+%if %8 == 1
+ sub dst_endq, stride2q
+%endif
+%endmacro
+
+ ; store t0-1 and t30-31
+ mova m0, [tmpq+ 0*%%str]
+ mova m1, [tmpq+ 4*%%str]
+ %%STORE_2X2 0, 1, 14, 15, 2, 3, 7
+
+ ; store t2-3 and t28-29
+ mova m0, [tmpq+ 8*%%str]
+ mova m1, [tmpq+12*%%str]
+ %%STORE_2X2 0, 1, 12, 13, 2, 3, 7
+
+ ; store t4-5 and t26-27
+ mova m0, [tmpq+16*%%str]
+ mova m1, [tmpq+20*%%str]
+ %%STORE_2X2 0, 1, 10, 11, 2, 3, 7
+
+ ; store t6-7 and t24-25
+ mova m0, [tmpq+24*%%str]
+ mova m1, [tmpq+28*%%str]
+ %%STORE_2X2 0, 1, 8, 9, 2, 3, 7
+
+ ; store t8-9 and t22-23
+ mova m0, [tmpq+ 2*%%str]
+ mova m1, [tmpq+ 6*%%str]
+ mova m8, [tmpq+29*%%str]
+ %%STORE_2X2 0, 1, 6, 8, 2, 3, 7
+
+ ; store t10-11 and t20-21
+ mova m0, [tmpq+10*%%str]
+ mova m1, [tmpq+14*%%str]
+ %%STORE_2X2 0, 1, 4, 5, 2, 3, 7
+
+ ; store t12-13 and t18-19
+ mova m0, [tmpq+18*%%str]
+ mova m1, [tmpq+22*%%str]
+ mova m5, [tmpq+13*%%str]
+ mova m4, [tmpq+ 9*%%str]
+ %%STORE_2X2 0, 1, 4, 5, 2, 3, 7
+
+ ; store t14-17
+ mova m0, [tmpq+26*%%str]
+ mova m1, [tmpq+30*%%str]
+ mova m5, [tmpq+ 5*%%str]
+ mova m4, [tmpq+ 1*%%str]
+ %%STORE_2X2 0, 1, 4, 5, 2, 3, 7, 0
+%endif
+%endmacro
+
+%macro VP9_IDCT_IDCT_32x32_ADD_XMM 1
+INIT_XMM %1
+cglobal vp9_idct_idct_32x32_add, 4, 9, 16, 2048, dst, stride, block, eob
+ cmp eobd, 135
+ jg .idctfull
+ cmp eobd, 34
+ jg .idct16x16
+ cmp eobd, 1
+ jg .idct8x8
+
+ ; dc-only case
+ movd m0, [blockq]
+ mova m1, [pw_11585x2]
+ pmulhrsw m0, m1
+ pmulhrsw m0, m1
+ SPLATW m0, m0, q0000
+ pmulhrsw m0, [pw_512]
+ pxor m5, m5
+ movd [blockq], m5
+ DEFINE_ARGS dst, stride, block, cnt
+%rep 31
+ VP9_STORE_2XFULL 0, 1, 2, 3, 4, 5, mmsize
+ add dstq, strideq
+%endrep
+ VP9_STORE_2XFULL 0, 1, 2, 3, 4, 5, mmsize
+ RET
+
+ DEFINE_ARGS dst_bak, stride, block, cnt, dst, stride30, dst_end, stride2, tmp
+.idct8x8:
+ mov tmpq, rsp
+ VP9_IDCT32_1D blockq, 1, 8
+
+ mov stride30q, strideq ; stride
+ lea stride2q, [strideq*2] ; stride*2
+ shl stride30q, 5 ; stride*32
+ mov cntd, 4
+ sub stride30q, stride2q ; stride*30
+.loop2_8x8:
+ mov dstq, dst_bakq
+ lea dst_endq, [dst_bakq+stride30q]
+ VP9_IDCT32_1D tmpq, 2, 8
+ add dst_bakq, 8
+ add tmpq, 16
+ dec cntd
+ jg .loop2_8x8
+
+ ; at the end of the loop, m7 should still be zero
+ ; use that to zero out block coefficients
+ ZERO_BLOCK blockq, 64, 8, m7
+ RET
+
+.idct16x16:
+ mov cntd, 2
+ mov tmpq, rsp
+.loop1_16x16:
+ VP9_IDCT32_1D blockq, 1, 16
+ add blockq, 16
+ add tmpq, 512
+ dec cntd
+ jg .loop1_16x16
+ sub blockq, 32
+
+ mov stride30q, strideq ; stride
+ lea stride2q, [strideq*2] ; stride*2
+ shl stride30q, 5 ; stride*32
+ mov cntd, 4
+ mov tmpq, rsp
+ sub stride30q, stride2q ; stride*30
+.loop2_16x16:
+ mov dstq, dst_bakq
+ lea dst_endq, [dst_bakq+stride30q]
+ VP9_IDCT32_1D tmpq, 2, 16
+ add dst_bakq, 8
+ add tmpq, 16
+ dec cntd
+ jg .loop2_16x16
+
+ ; at the end of the loop, m7 should still be zero
+ ; use that to zero out block coefficients
+ ZERO_BLOCK blockq, 64, 16, m7
+ RET
+
+.idctfull:
+ mov cntd, 4
+ mov tmpq, rsp
+.loop1_full:
+ VP9_IDCT32_1D blockq, 1
+ add blockq, 16
+ add tmpq, 512
+ dec cntd
+ jg .loop1_full
+ sub blockq, 64
+
+ mov stride30q, strideq ; stride
+ lea stride2q, [strideq*2] ; stride*2
+ shl stride30q, 5 ; stride*32
+ mov cntd, 4
+ mov tmpq, rsp
+ sub stride30q, stride2q ; stride*30
+.loop2_full:
+ mov dstq, dst_bakq
+ lea dst_endq, [dst_bakq+stride30q]
+ VP9_IDCT32_1D tmpq, 2
+ add dst_bakq, 8
+ add tmpq, 16
+ dec cntd
+ jg .loop2_full
+
+ ; at the end of the loop, m7 should still be zero
+ ; use that to zero out block coefficients
+ ZERO_BLOCK blockq, 64, 32, m7
+ RET
+%endmacro
+
+VP9_IDCT_IDCT_32x32_ADD_XMM ssse3
+VP9_IDCT_IDCT_32x32_ADD_XMM avx
+
+%endif ; x86-64
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp9lpf.asm b/chromium/third_party/ffmpeg/libavcodec/x86/vp9lpf.asm
new file mode 100644
index 00000000000..c5db0caffb5
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp9lpf.asm
@@ -0,0 +1,817 @@
+;******************************************************************************
+;* VP9 loop filter SIMD optimizations
+;*
+;* Copyright (C) 2013-2014 Clément Bœsch <u pkh me>
+;*
+;* 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
+;******************************************************************************
+
+%if ARCH_X86_64
+
+%include "libavutil/x86/x86util.asm"
+
+SECTION_RODATA
+
+cextern pb_3
+cextern pb_80
+
+pb_4: times 16 db 0x04
+pb_10: times 16 db 0x10
+pb_40: times 16 db 0x40
+pb_81: times 16 db 0x81
+pb_f8: times 16 db 0xf8
+pb_fe: times 16 db 0xfe
+
+pw_4: times 8 dw 4
+pw_8: times 8 dw 8
+
+; with mix functions, two 8-bit thresholds are stored in a 16-bit storage,
+; the following mask is used to splat both in the same register
+mask_mix: times 8 db 0
+ times 8 db 1
+
+mask_mix84: times 8 db 0xff
+ times 8 db 0x00
+mask_mix48: times 8 db 0x00
+ times 8 db 0xff
+
+SECTION .text
+
+; %1 = abs(%2-%3)
+%macro ABSSUB 4 ; dst, src1 (RO), src2 (RO), tmp
+ psubusb %1, %3, %2
+ psubusb %4, %2, %3
+ por %1, %4
+%endmacro
+
+; %1 = %1<=%2
+%macro CMP_LTE 3-4 ; src/dst, cmp, tmp, pb_80
+%if %0 == 4
+ pxor %1, %4
+%endif
+ pcmpgtb %3, %2, %1 ; cmp > src?
+ pcmpeqb %1, %2 ; cmp == src? XXX: avoid this with a -1/+1 well placed?
+ por %1, %3 ; cmp >= src?
+%endmacro
+
+; %1 = abs(%2-%3) <= %4
+%macro ABSSUB_CMP 6-7 [pb_80]; dst, src1, src2, cmp, tmp1, tmp2, [pb_80]
+ ABSSUB %1, %2, %3, %6 ; dst = abs(src1-src2)
+ CMP_LTE %1, %4, %6, %7 ; dst <= cmp
+%endmacro
+
+%macro MASK_APPLY 4 ; %1=new_data/dst %2=old_data %3=mask %4=tmp
+ pand %1, %3 ; new &= mask
+ pandn %4, %3, %2 ; tmp = ~mask & old
+ por %1, %4 ; new&mask | old&~mask
+%endmacro
+
+%macro FILTER_SUBx2_ADDx2 8 ; %1=dst %2=h/l %3=cache %4=sub1 %5=sub2 %6=add1 %7=add2 %8=rshift
+ punpck%2bw %3, %4, m0
+ psubw %1, %3
+ punpck%2bw %3, %5, m0
+ psubw %1, %3
+ punpck%2bw %3, %6, m0
+ paddw %1, %3
+ punpck%2bw %3, %7, m0
+ paddw %3, %1
+ psraw %1, %3, %8
+%endmacro
+
+%macro FILTER_INIT 8 ; tmp1, tmp2, cacheL, cacheH, dstp, filterid, mask, source
+ FILTER%6_INIT %1, l, %3
+ FILTER%6_INIT %2, h, %4
+ packuswb %1, %2
+ MASK_APPLY %1, %8, %7, %2
+ mova %5, %1
+%endmacro
+
+%macro FILTER_UPDATE 11-14 ; tmp1, tmp2, cacheL, cacheH, dstp, -, -, +, +, rshift, mask, [source], [preload reg + value]
+%if %0 == 13 ; no source + preload
+ mova %12, %13
+%elif %0 == 14 ; source + preload
+ mova %13, %14
+%endif
+ FILTER_SUBx2_ADDx2 %1, l, %3, %6, %7, %8, %9, %10
+ FILTER_SUBx2_ADDx2 %2, h, %4, %6, %7, %8, %9, %10
+ packuswb %1, %2
+%if %0 == 12 || %0 == 14
+ MASK_APPLY %1, %12, %11, %2
+%else
+ MASK_APPLY %1, %5, %11, %2
+%endif
+ mova %5, %1
+%endmacro
+
+%macro SRSHIFT3B_2X 4 ; reg1, reg2, [pb_10], tmp
+ mova %4, [pb_f8]
+ pand %1, %4
+ pand %2, %4
+ psrlq %1, 3
+ psrlq %2, 3
+ pxor %1, %3
+ pxor %2, %3
+ psubb %1, %3
+ psubb %2, %3
+%endmacro
+
+%macro EXTRACT_POS_NEG 3 ; i8, neg, pos
+ pxor %3, %3
+ pxor %2, %2
+ pcmpgtb %3, %1 ; i8 < 0 mask
+ psubb %2, %1 ; neg values (only the originally - will be kept)
+ pand %2, %3 ; negative values of i8 (but stored as +)
+ pandn %3, %1 ; positive values of i8
+%endmacro
+
+; clip_u8(u8 + i8)
+%macro SIGN_ADD 5 ; dst, u8, i8, tmp1, tmp2
+ EXTRACT_POS_NEG %3, %4, %5
+ psubusb %1, %2, %4 ; sub the negatives
+ paddusb %1, %5 ; add the positives
+%endmacro
+
+; clip_u8(u8 - i8)
+%macro SIGN_SUB 5 ; dst, u8, i8, tmp1, tmp2
+ EXTRACT_POS_NEG %3, %4, %5
+ psubusb %1, %2, %5 ; sub the positives
+ paddusb %1, %4 ; add the negatives
+%endmacro
+
+%macro FILTER6_INIT 3 ; %1=dst %2=h/l %3=cache
+ punpck%2bw %1, m14, m0 ; p3: B->W
+ paddw %3, %1, %1 ; p3*2
+ paddw %3, %1 ; p3*3
+ punpck%2bw %1, m15, m0 ; p2: B->W
+ paddw %3, %1 ; p3*3 + p2
+ paddw %3, %1 ; p3*3 + p2*2
+ punpck%2bw %1, m10, m0 ; p1: B->W
+ paddw %3, %1 ; p3*3 + p2*2 + p1
+ punpck%2bw %1, m11, m0 ; p0: B->W
+ paddw %3, %1 ; p3*3 + p2*2 + p1 + p0
+ punpck%2bw %1, m12, m0 ; q0: B->W
+ paddw %3, %1 ; p3*3 + p2*2 + p1 + p0 + q0
+ paddw %3, [pw_4] ; p3*3 + p2*2 + p1 + p0 + q0 + 4
+ psraw %1, %3, 3 ; (p3*3 + p2*2 + p1 + p0 + q0 + 4) >> 3
+%endmacro
+
+%macro FILTER14_INIT 3 ; %1=dst %2=h/l %3=cache
+ punpck%2bw %1, m2, m0 ; p7: B->W
+ psllw %3, %1, 3 ; p7*8
+ psubw %3, %1 ; p7*7
+ punpck%2bw %1, m3, m0 ; p6: B->W
+ paddw %3, %1 ; p7*7 + p6
+ paddw %3, %1 ; p7*7 + p6*2
+ punpck%2bw %1, m8, m0 ; p5: B->W
+ paddw %3, %1 ; p7*7 + p6*2 + p5
+ punpck%2bw %1, m9, m0 ; p4: B->W
+ paddw %3, %1 ; p7*7 + p6*2 + p5 + p4
+ punpck%2bw %1, m14, m0 ; p3: B->W
+ paddw %3, %1 ; p7*7 + p6*2 + p5 + p4 + p3
+ punpck%2bw %1, m15, m0 ; p2: B->W
+ paddw %3, %1 ; p7*7 + p6*2 + p5 + .. + p2
+ punpck%2bw %1, m10, m0 ; p1: B->W
+ paddw %3, %1 ; p7*7 + p6*2 + p5 + .. + p1
+ punpck%2bw %1, m11, m0 ; p0: B->W
+ paddw %3, %1 ; p7*7 + p6*2 + p5 + .. + p0
+ punpck%2bw %1, m12, m0 ; q0: B->W
+ paddw %3, %1 ; p7*7 + p6*2 + p5 + .. + p0 + q0
+ paddw %3, [pw_8] ; p7*7 + p6*2 + p5 + .. + p0 + q0 + 8
+ psraw %1, %3, 4 ; (p7*7 + p6*2 + p5 + .. + p0 + q0 + 8) >> 4
+%endmacro
+
+%macro TRANSPOSE16x16B 17
+ mova %17, m%16
+ SBUTTERFLY bw, %1, %2, %16
+ SBUTTERFLY bw, %3, %4, %16
+ SBUTTERFLY bw, %5, %6, %16
+ SBUTTERFLY bw, %7, %8, %16
+ SBUTTERFLY bw, %9, %10, %16
+ SBUTTERFLY bw, %11, %12, %16
+ SBUTTERFLY bw, %13, %14, %16
+ mova m%16, %17
+ mova %17, m%14
+ SBUTTERFLY bw, %15, %16, %14
+ SBUTTERFLY wd, %1, %3, %14
+ SBUTTERFLY wd, %2, %4, %14
+ SBUTTERFLY wd, %5, %7, %14
+ SBUTTERFLY wd, %6, %8, %14
+ SBUTTERFLY wd, %9, %11, %14
+ SBUTTERFLY wd, %10, %12, %14
+ SBUTTERFLY wd, %13, %15, %14
+ mova m%14, %17
+ mova %17, m%12
+ SBUTTERFLY wd, %14, %16, %12
+ SBUTTERFLY dq, %1, %5, %12
+ SBUTTERFLY dq, %2, %6, %12
+ SBUTTERFLY dq, %3, %7, %12
+ SBUTTERFLY dq, %4, %8, %12
+ SBUTTERFLY dq, %9, %13, %12
+ SBUTTERFLY dq, %10, %14, %12
+ SBUTTERFLY dq, %11, %15, %12
+ mova m%12, %17
+ mova %17, m%8
+ SBUTTERFLY dq, %12, %16, %8
+ SBUTTERFLY qdq, %1, %9, %8
+ SBUTTERFLY qdq, %2, %10, %8
+ SBUTTERFLY qdq, %3, %11, %8
+ SBUTTERFLY qdq, %4, %12, %8
+ SBUTTERFLY qdq, %5, %13, %8
+ SBUTTERFLY qdq, %6, %14, %8
+ SBUTTERFLY qdq, %7, %15, %8
+ mova m%8, %17
+ mova %17, m%1
+ SBUTTERFLY qdq, %8, %16, %1
+ mova m%1, %17
+ SWAP %2, %9
+ SWAP %3, %5
+ SWAP %4, %13
+ SWAP %6, %11
+ SWAP %8, %15
+ SWAP %12, %14
+%endmacro
+
+; transpose 16 half lines (high part) to 8 full centered lines
+%macro TRANSPOSE16x8B 16
+ punpcklbw m%1, m%2
+ punpcklbw m%3, m%4
+ punpcklbw m%5, m%6
+ punpcklbw m%7, m%8
+ punpcklbw m%9, m%10
+ punpcklbw m%11, m%12
+ punpcklbw m%13, m%14
+ punpcklbw m%15, m%16
+ SBUTTERFLY wd, %1, %3, %2
+ SBUTTERFLY wd, %5, %7, %2
+ SBUTTERFLY wd, %9, %11, %2
+ SBUTTERFLY wd, %13, %15, %2
+ SBUTTERFLY dq, %1, %5, %2
+ SBUTTERFLY dq, %3, %7, %2
+ SBUTTERFLY dq, %9, %13, %2
+ SBUTTERFLY dq, %11, %15, %2
+ SBUTTERFLY qdq, %1, %9, %2
+ SBUTTERFLY qdq, %3, %11, %2
+ SBUTTERFLY qdq, %5, %13, %2
+ SBUTTERFLY qdq, %7, %15, %2
+ SWAP %5, %1
+ SWAP %6, %9
+ SWAP %7, %1
+ SWAP %8, %13
+ SWAP %9, %3
+ SWAP %10, %11
+ SWAP %11, %1
+ SWAP %12, %15
+%endmacro
+
+%macro DEFINE_REAL_P7_TO_Q7 0-1 0
+%define P7 dst1q + 2*mstrideq + %1
+%define P6 dst1q + mstrideq + %1
+%define P5 dst1q + %1
+%define P4 dst1q + strideq + %1
+%define P3 dstq + 4*mstrideq + %1
+%define P2 dstq + mstride3q + %1
+%define P1 dstq + 2*mstrideq + %1
+%define P0 dstq + mstrideq + %1
+%define Q0 dstq + %1
+%define Q1 dstq + strideq + %1
+%define Q2 dstq + 2*strideq + %1
+%define Q3 dstq + stride3q + %1
+%define Q4 dstq + 4*strideq + %1
+%define Q5 dst2q + mstrideq + %1
+%define Q6 dst2q + %1
+%define Q7 dst2q + strideq + %1
+%endmacro
+
+; ..............AB -> AAAAAAAABBBBBBBB
+%macro SPLATB_MIX 1-2 [mask_mix]
+%if cpuflag(ssse3)
+ pshufb %1, %2
+%else
+ punpcklbw %1, %1
+ punpcklqdq %1, %1
+ pshuflw %1, %1, 0
+ pshufhw %1, %1, 0x55
+%endif
+%endmacro
+
+%macro LOOPFILTER 2 ; %1=v/h %2=size1
+ lea mstrideq, [strideq]
+ neg mstrideq
+
+ lea stride3q, [strideq+2*strideq]
+ mov mstride3q, stride3q
+ neg mstride3q
+
+%ifidn %1, h
+%if %2 > 16
+%define movx movh
+ lea dstq, [dstq + 8*strideq - 4]
+%else
+%define movx movu
+ lea dstq, [dstq + 8*strideq - 8] ; go from top center (h pos) to center left (v pos)
+%endif
+%endif
+
+ lea dst1q, [dstq + 2*mstride3q] ; dst1q = &dst[stride * -6]
+ lea dst2q, [dstq + 2* stride3q] ; dst2q = &dst[stride * +6]
+
+ DEFINE_REAL_P7_TO_Q7
+
+%ifidn %1, h
+ movx m0, [P7]
+ movx m1, [P6]
+ movx m2, [P5]
+ movx m3, [P4]
+ movx m4, [P3]
+ movx m5, [P2]
+ movx m6, [P1]
+ movx m7, [P0]
+ movx m8, [Q0]
+ movx m9, [Q1]
+ movx m10, [Q2]
+ movx m11, [Q3]
+ movx m12, [Q4]
+ movx m13, [Q5]
+ movx m14, [Q6]
+ movx m15, [Q7]
+%define P7 rsp + 0
+%define P6 rsp + 16
+%define P5 rsp + 32
+%define P4 rsp + 48
+%define P3 rsp + 64
+%define P2 rsp + 80
+%define P1 rsp + 96
+%define P0 rsp + 112
+%define Q0 rsp + 128
+%define Q1 rsp + 144
+%define Q2 rsp + 160
+%define Q3 rsp + 176
+%define Q4 rsp + 192
+%define Q5 rsp + 208
+%define Q6 rsp + 224
+%define Q7 rsp + 240
+
+%if %2 == 16
+ TRANSPOSE16x16B 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, [rsp]
+ mova [P7], m0
+ mova [P6], m1
+ mova [P5], m2
+ mova [P4], m3
+%else
+ TRANSPOSE16x8B 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
+%endif
+ mova [P3], m4
+ mova [P2], m5
+ mova [P1], m6
+ mova [P0], m7
+ mova [Q0], m8
+ mova [Q1], m9
+ mova [Q2], m10
+ mova [Q3], m11
+%if %2 == 16
+ mova [Q4], m12
+ mova [Q5], m13
+ mova [Q6], m14
+ mova [Q7], m15
+%endif
+%endif
+
+ ; calc fm mask
+%if %2 == 16
+%if cpuflag(ssse3)
+ pxor m0, m0
+%endif
+ SPLATB_REG m2, I, m0 ; I I I I ...
+ SPLATB_REG m3, E, m0 ; E E E E ...
+%else
+%if cpuflag(ssse3)
+ mova m0, [mask_mix]
+%endif
+ movd m2, Id
+ movd m3, Ed
+ SPLATB_MIX m2, m0
+ SPLATB_MIX m3, m0
+%endif
+ mova m0, [pb_80]
+ pxor m2, m0
+ pxor m3, m0
+%ifidn %1, v
+ mova m8, [P3]
+ mova m9, [P2]
+ mova m10, [P1]
+ mova m11, [P0]
+ mova m12, [Q0]
+ mova m13, [Q1]
+ mova m14, [Q2]
+ mova m15, [Q3]
+%else
+ ; In case of horizontal, P3..Q3 are already present in some registers due
+ ; to the previous transpose, so we just swap registers.
+ SWAP 8, 4, 12
+ SWAP 9, 5, 13
+ SWAP 10, 6, 14
+ SWAP 11, 7, 15
+%endif
+ ABSSUB_CMP m5, m8, m9, m2, m6, m7, m0 ; m5 = abs(p3-p2) <= I
+ ABSSUB_CMP m1, m9, m10, m2, m6, m7, m0 ; m1 = abs(p2-p1) <= I
+ pand m5, m1
+ ABSSUB_CMP m1, m10, m11, m2, m6, m7, m0 ; m1 = abs(p1-p0) <= I
+ pand m5, m1
+ ABSSUB_CMP m1, m12, m13, m2, m6, m7, m0 ; m1 = abs(q1-q0) <= I
+ pand m5, m1
+ ABSSUB_CMP m1, m13, m14, m2, m6, m7, m0 ; m1 = abs(q2-q1) <= I
+ pand m5, m1
+ ABSSUB_CMP m1, m14, m15, m2, m6, m7, m0 ; m1 = abs(q3-q2) <= I
+ pand m5, m1
+ ABSSUB m1, m11, m12, m7 ; abs(p0-q0)
+ paddusb m1, m1 ; abs(p0-q0) * 2
+ ABSSUB m2, m10, m13, m7 ; abs(p1-q1)
+ pand m2, [pb_fe] ; drop lsb so shift can work
+ psrlq m2, 1 ; abs(p1-q1)/2
+ paddusb m1, m2 ; abs(p0-q0)*2 + abs(p1-q1)/2
+ pxor m1, m0
+ pcmpgtb m4, m3, m1 ; E > X?
+ pcmpeqb m3, m1 ; E == X?
+ por m3, m4 ; E >= X?
+ pand m3, m5 ; fm final value
+
+ ; (m3: fm, m8..15: p3 p2 p1 p0 q0 q1 q2 q3)
+ ; calc flat8in (if not 44_16) and hev masks
+ mova m6, [pb_81] ; [1 1 1 1 ...] ^ 0x80
+%if %2 != 44
+ ABSSUB_CMP m2, m8, m11, m6, m4, m5 ; abs(p3 - p0) <= 1
+ mova m8, [pb_80]
+ ABSSUB_CMP m1, m9, m11, m6, m4, m5, m8 ; abs(p2 - p0) <= 1
+ pand m2, m1
+ ABSSUB m4, m10, m11, m5 ; abs(p1 - p0)
+%if %2 == 16
+%if cpuflag(ssse3)
+ pxor m0, m0
+%endif
+ SPLATB_REG m7, H, m0 ; H H H H ...
+%else
+ movd m7, Hd
+ SPLATB_MIX m7
+%endif
+ pxor m7, m8
+ pxor m4, m8
+ pcmpgtb m0, m4, m7 ; abs(p1 - p0) > H (1/2 hev condition)
+ CMP_LTE m4, m6, m5 ; abs(p1 - p0) <= 1
+ pand m2, m4 ; (flat8in)
+ ABSSUB m4, m13, m12, m1 ; abs(q1 - q0)
+ pxor m4, m8
+ pcmpgtb m5, m4, m7 ; abs(q1 - q0) > H (2/2 hev condition)
+ por m0, m5 ; hev final value
+ CMP_LTE m4, m6, m5 ; abs(q1 - q0) <= 1
+ pand m2, m4 ; (flat8in)
+ ABSSUB_CMP m1, m14, m12, m6, m4, m5, m8 ; abs(q2 - q0) <= 1
+ pand m2, m1
+ ABSSUB_CMP m1, m15, m12, m6, m4, m5, m8 ; abs(q3 - q0) <= 1
+ pand m2, m1 ; flat8in final value
+%if %2 == 84 || %2 == 48
+ pand m2, [mask_mix%2]
+%endif
+%else
+ mova m6, [pb_80]
+ movd m7, Hd
+ SPLATB_MIX m7
+ pxor m7, m6
+ ABSSUB m4, m10, m11, m1 ; abs(p1 - p0)
+ pxor m4, m6
+ pcmpgtb m0, m4, m7 ; abs(p1 - p0) > H (1/2 hev condition)
+ ABSSUB m4, m13, m12, m1 ; abs(q1 - q0)
+ pxor m4, m6
+ pcmpgtb m5, m4, m7 ; abs(q1 - q0) > H (2/2 hev condition)
+ por m0, m5 ; hev final value
+%endif
+
+%if %2 == 16
+ ; (m0: hev, m2: flat8in, m3: fm, m6: pb_81, m9..15: p2 p1 p0 q0 q1 q2 q3)
+ ; calc flat8out mask
+ mova m8, [P7]
+ mova m9, [P6]
+ ABSSUB_CMP m1, m8, m11, m6, m4, m5 ; abs(p7 - p0) <= 1
+ ABSSUB_CMP m7, m9, m11, m6, m4, m5 ; abs(p6 - p0) <= 1
+ pand m1, m7
+ mova m8, [P5]
+ mova m9, [P4]
+ ABSSUB_CMP m7, m8, m11, m6, m4, m5 ; abs(p5 - p0) <= 1
+ pand m1, m7
+ ABSSUB_CMP m7, m9, m11, m6, m4, m5 ; abs(p4 - p0) <= 1
+ pand m1, m7
+ mova m14, [Q4]
+ mova m15, [Q5]
+ ABSSUB_CMP m7, m14, m12, m6, m4, m5 ; abs(q4 - q0) <= 1
+ pand m1, m7
+ ABSSUB_CMP m7, m15, m12, m6, m4, m5 ; abs(q5 - q0) <= 1
+ pand m1, m7
+ mova m14, [Q6]
+ mova m15, [Q7]
+ ABSSUB_CMP m7, m14, m12, m6, m4, m5 ; abs(q4 - q0) <= 1
+ pand m1, m7
+ ABSSUB_CMP m7, m15, m12, m6, m4, m5 ; abs(q5 - q0) <= 1
+ pand m1, m7 ; flat8out final value
+%endif
+
+ ; if (fm) {
+ ; if (out && in) filter_14()
+ ; else if (in) filter_6()
+ ; else if (hev) filter_2()
+ ; else filter_4()
+ ; }
+ ;
+ ; f14: fm & out & in
+ ; f6: fm & ~f14 & in => fm & ~(out & in) & in => fm & ~out & in
+ ; f2: fm & ~f14 & ~f6 & hev => fm & ~(out & in) & ~(~out & in) & hev => fm & ~in & hev
+ ; f4: fm & ~f14 & ~f6 & ~f2 => fm & ~(out & in) & ~(~out & in) & ~(~in & hev) => fm & ~in & ~hev
+
+ ; (m0: hev, [m1: flat8out], [m2: flat8in], m3: fm, m8..15: p5 p4 p1 p0 q0 q1 q6 q7)
+ ; filter2()
+%if %2 != 44
+ mova m6, [pb_80] ; already in m6 if 44_16
+%endif
+ pxor m15, m12, m6 ; q0 ^ 0x80
+ pxor m14, m11, m6 ; p0 ^ 0x80
+ psubsb m15, m14 ; (signed) q0 - p0
+ pxor m4, m10, m6 ; p1 ^ 0x80
+ pxor m5, m13, m6 ; q1 ^ 0x80
+ psubsb m4, m5 ; (signed) p1 - q1
+ paddsb m4, m15 ; (q0 - p0) + (p1 - q1)
+ paddsb m4, m15 ; 2*(q0 - p0) + (p1 - q1)
+ paddsb m4, m15 ; 3*(q0 - p0) + (p1 - q1)
+ paddsb m6, m4, [pb_4] ; m6: f1 = clip(f + 4, 127)
+ paddsb m4, [pb_3] ; m4: f2 = clip(f + 3, 127)
+ mova m14, [pb_10] ; will be reused in filter4()
+ SRSHIFT3B_2X m6, m4, m14, m7 ; f1 and f2 sign byte shift by 3
+ SIGN_SUB m7, m12, m6, m5, m9 ; m7 = q0 - f1
+ SIGN_ADD m8, m11, m4, m5, m9 ; m8 = p0 + f2
+%if %2 != 44
+ pandn m6, m2, m3 ; ~mask(in) & mask(fm)
+ pand m6, m0 ; (~mask(in) & mask(fm)) & mask(hev)
+%else
+ pand m6, m3, m0
+%endif
+ MASK_APPLY m7, m12, m6, m5 ; m7 = filter2(q0) & mask / we write it in filter4()
+ MASK_APPLY m8, m11, m6, m5 ; m8 = filter2(p0) & mask / we write it in filter4()
+
+ ; (m0: hev, [m1: flat8out], [m2: flat8in], m3: fm, m7..m8: q0' p0', m10..13: p1 p0 q0 q1, m14: pb_10, m15: q0-p0)
+ ; filter4()
+ mova m4, m15
+ paddsb m15, m4 ; 2 * (q0 - p0)
+ paddsb m15, m4 ; 3 * (q0 - p0)
+ paddsb m6, m15, [pb_4] ; m6: f1 = clip(f + 4, 127)
+ paddsb m15, [pb_3] ; m15: f2 = clip(f + 3, 127)
+ SRSHIFT3B_2X m6, m15, m14, m9 ; f1 and f2 sign byte shift by 3
+%if %2 != 44
+%define p0tmp m7
+%define q0tmp m9
+ pandn m5, m2, m3 ; ~mask(in) & mask(fm)
+ pandn m0, m5 ; ~mask(hev) & (~mask(in) & mask(fm))
+%else
+%define p0tmp m1
+%define q0tmp m2
+ pandn m0, m3
+%endif
+ SIGN_SUB q0tmp, m12, m6, m4, m14 ; q0 - f1
+ MASK_APPLY q0tmp, m7, m0, m5 ; filter4(q0) & mask
+ mova [Q0], q0tmp
+ SIGN_ADD p0tmp, m11, m15, m4, m14 ; p0 + f2
+ MASK_APPLY p0tmp, m8, m0, m5 ; filter4(p0) & mask
+ mova [P0], p0tmp
+ paddb m6, [pb_80] ;
+ pxor m8, m8 ; f=(f1+1)>>1
+ pavgb m6, m8 ;
+ psubb m6, [pb_40] ;
+ SIGN_ADD m7, m10, m6, m8, m9 ; p1 + f
+ SIGN_SUB m4, m13, m6, m8, m9 ; q1 - f
+ MASK_APPLY m7, m10, m0, m14 ; m7 = filter4(p1)
+ MASK_APPLY m4, m13, m0, m14 ; m4 = filter4(q1)
+ mova [P1], m7
+ mova [Q1], m4
+
+ ; ([m1: flat8out], m2: flat8in, m3: fm, m10..13: p1 p0 q0 q1)
+ ; filter6()
+%if %2 != 44
+ pxor m0, m0
+%if %2 > 16
+ pand m3, m2
+%else
+ pand m2, m3 ; mask(fm) & mask(in)
+ pandn m3, m1, m2 ; ~mask(out) & (mask(fm) & mask(in))
+%endif
+ mova m14, [P3]
+ mova m15, [P2]
+ mova m8, [Q2]
+ mova m9, [Q3]
+ FILTER_INIT m4, m5, m6, m7, [P2], 6, m3, m15 ; [p2]
+ FILTER_UPDATE m6, m7, m4, m5, [P1], m14, m15, m10, m13, 3, m3 ; [p1] -p3 -p2 +p1 +q1
+ FILTER_UPDATE m4, m5, m6, m7, [P0], m14, m10, m11, m8, 3, m3 ; [p0] -p3 -p1 +p0 +q2
+ FILTER_UPDATE m6, m7, m4, m5, [Q0], m14, m11, m12, m9, 3, m3 ; [q0] -p3 -p0 +q0 +q3
+ FILTER_UPDATE m4, m5, m6, m7, [Q1], m15, m12, m13, m9, 3, m3 ; [q1] -p2 -q0 +q1 +q3
+ FILTER_UPDATE m6, m7, m4, m5, [Q2], m10, m13, m8, m9, 3, m3, m8 ; [q2] -p1 -q1 +q2 +q3
+%endif
+
+ ; (m0: 0, [m1: flat8out], m2: fm & flat8in, m8..15: q2 q3 p1 p0 q0 q1 p3 p2)
+ ; filter14()
+ ;
+ ; m2 m3 m8 m9 m14 m15 m10 m11 m12 m13
+ ;
+ ; q2 q3 p3 p2 p1 p0 q0 q1
+ ; p6 -7 p7 p6 p5 p4 . . . . .
+ ; p5 -6 -p7 -p6 +p5 +q1 . . . .
+ ; p4 -5 -p7 -p5 +p4 +q2 . . . q2
+ ; p3 -4 -p7 -p4 +p3 +q3 . . . q3
+ ; p2 -3 -p7 -p3 +p2 +q4 . . . q4
+ ; p1 -2 -p7 -p2 +p1 +q5 . . . q5
+ ; p0 -1 -p7 -p1 +p0 +q6 . . . q6
+ ; q0 +0 -p7 -p0 +q0 +q7 . . . q7
+ ; q1 +1 -p6 -q0 +q1 +q7 q1 . . .
+ ; q2 +2 -p5 -q1 +q2 +q7 . q2 . .
+ ; q3 +3 -p4 -q2 +q3 +q7 . q3 . .
+ ; q4 +4 -p3 -q3 +q4 +q7 . q4 . .
+ ; q5 +5 -p2 -q4 +q5 +q7 . q5 . .
+ ; q6 +6 -p1 -q5 +q6 +q7 . q6 . .
+
+%if %2 == 16
+ pand m1, m2 ; mask(out) & (mask(fm) & mask(in))
+ mova m2, [P7]
+ mova m3, [P6]
+ mova m8, [P5]
+ mova m9, [P4]
+ FILTER_INIT m4, m5, m6, m7, [P6], 14, m1, m3
+ FILTER_UPDATE m6, m7, m4, m5, [P5], m2, m3, m8, m13, 4, m1, m8 ; [p5] -p7 -p6 +p5 +q1
+ FILTER_UPDATE m4, m5, m6, m7, [P4], m2, m8, m9, m13, 4, m1, m9, m13, [Q2] ; [p4] -p7 -p5 +p4 +q2
+ FILTER_UPDATE m6, m7, m4, m5, [P3], m2, m9, m14, m13, 4, m1, m14, m13, [Q3] ; [p3] -p7 -p4 +p3 +q3
+ FILTER_UPDATE m4, m5, m6, m7, [P2], m2, m14, m15, m13, 4, m1, m13, [Q4] ; [p2] -p7 -p3 +p2 +q4
+ FILTER_UPDATE m6, m7, m4, m5, [P1], m2, m15, m10, m13, 4, m1, m13, [Q5] ; [p1] -p7 -p2 +p1 +q5
+ FILTER_UPDATE m4, m5, m6, m7, [P0], m2, m10, m11, m13, 4, m1, m13, [Q6] ; [p0] -p7 -p1 +p0 +q6
+ FILTER_UPDATE m6, m7, m4, m5, [Q0], m2, m11, m12, m13, 4, m1, m13, [Q7] ; [q0] -p7 -p0 +q0 +q7
+ FILTER_UPDATE m4, m5, m6, m7, [Q1], m3, m12, m2, m13, 4, m1, m2, [Q1] ; [q1] -p6 -q0 +q1 +q7
+ FILTER_UPDATE m6, m7, m4, m5, [Q2], m8, m2, m3, m13, 4, m1, m3, [Q2] ; [q2] -p5 -q1 +q2 +q7
+ FILTER_UPDATE m4, m5, m6, m7, [Q3], m9, m3, m8, m13, 4, m1, m8, m8, [Q3] ; [q3] -p4 -q2 +q3 +q7
+ FILTER_UPDATE m6, m7, m4, m5, [Q4], m14, m8, m9, m13, 4, m1, m9, m9, [Q4] ; [q4] -p3 -q3 +q4 +q7
+ FILTER_UPDATE m4, m5, m6, m7, [Q5], m15, m9, m14, m13, 4, m1, m14, m14, [Q5] ; [q5] -p2 -q4 +q5 +q7
+ FILTER_UPDATE m6, m7, m4, m5, [Q6], m10, m14, m15, m13, 4, m1, m15, m15, [Q6] ; [q6] -p1 -q5 +q6 +q7
+%endif
+
+%ifidn %1, h
+%if %2 == 16
+ mova m0, [P7]
+ mova m1, [P6]
+ mova m2, [P5]
+ mova m3, [P4]
+ mova m4, [P3]
+ mova m5, [P2]
+ mova m6, [P1]
+ mova m7, [P0]
+ mova m8, [Q0]
+ mova m9, [Q1]
+ mova m10, [Q2]
+ mova m11, [Q3]
+ mova m12, [Q4]
+ mova m13, [Q5]
+ mova m14, [Q6]
+ mova m15, [Q7]
+ TRANSPOSE16x16B 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, [rsp]
+ DEFINE_REAL_P7_TO_Q7
+ movu [P7], m0
+ movu [P6], m1
+ movu [P5], m2
+ movu [P4], m3
+ movu [P3], m4
+ movu [P2], m5
+ movu [P1], m6
+ movu [P0], m7
+ movu [Q0], m8
+ movu [Q1], m9
+ movu [Q2], m10
+ movu [Q3], m11
+ movu [Q4], m12
+ movu [Q5], m13
+ movu [Q6], m14
+ movu [Q7], m15
+%elif %2 == 44
+ SWAP 0, 7 ; m0 = p1
+ SWAP 3, 4 ; m3 = q1
+ DEFINE_REAL_P7_TO_Q7 2
+ SBUTTERFLY bw, 0, 1, 8
+ SBUTTERFLY bw, 2, 3, 8
+ SBUTTERFLY wd, 0, 2, 8
+ SBUTTERFLY wd, 1, 3, 8
+ SBUTTERFLY dq, 0, 4, 8
+ SBUTTERFLY dq, 1, 5, 8
+ SBUTTERFLY dq, 2, 6, 8
+ SBUTTERFLY dq, 3, 7, 8
+ movd [P7], m0
+ punpckhqdq m0, m8
+ movd [P6], m0
+ movd [Q0], m1
+ punpckhqdq m1, m9
+ movd [Q1], m1
+ movd [P3], m2
+ punpckhqdq m2, m10
+ movd [P2], m2
+ movd [Q4], m3
+ punpckhqdq m3, m11
+ movd [Q5], m3
+ movd [P5], m4
+ punpckhqdq m4, m12
+ movd [P4], m4
+ movd [Q2], m5
+ punpckhqdq m5, m13
+ movd [Q3], m5
+ movd [P1], m6
+ punpckhqdq m6, m14
+ movd [P0], m6
+ movd [Q6], m7
+ punpckhqdq m7, m8
+ movd [Q7], m7
+%else
+ ; the following code do a transpose of 8 full lines to 16 half
+ ; lines (high part). It is inlined to avoid the need of a staging area
+ mova m0, [P3]
+ mova m1, [P2]
+ mova m2, [P1]
+ mova m3, [P0]
+ mova m4, [Q0]
+ mova m5, [Q1]
+ mova m6, [Q2]
+ mova m7, [Q3]
+ DEFINE_REAL_P7_TO_Q7
+ SBUTTERFLY bw, 0, 1, 8
+ SBUTTERFLY bw, 2, 3, 8
+ SBUTTERFLY bw, 4, 5, 8
+ SBUTTERFLY bw, 6, 7, 8
+ SBUTTERFLY wd, 0, 2, 8
+ SBUTTERFLY wd, 1, 3, 8
+ SBUTTERFLY wd, 4, 6, 8
+ SBUTTERFLY wd, 5, 7, 8
+ SBUTTERFLY dq, 0, 4, 8
+ SBUTTERFLY dq, 1, 5, 8
+ SBUTTERFLY dq, 2, 6, 8
+ SBUTTERFLY dq, 3, 7, 8
+ movh [P7], m0
+ punpckhqdq m0, m8
+ movh [P6], m0
+ movh [Q0], m1
+ punpckhqdq m1, m9
+ movh [Q1], m1
+ movh [P3], m2
+ punpckhqdq m2, m10
+ movh [P2], m2
+ movh [Q4], m3
+ punpckhqdq m3, m11
+ movh [Q5], m3
+ movh [P5], m4
+ punpckhqdq m4, m12
+ movh [P4], m4
+ movh [Q2], m5
+ punpckhqdq m5, m13
+ movh [Q3], m5
+ movh [P1], m6
+ punpckhqdq m6, m14
+ movh [P0], m6
+ movh [Q6], m7
+ punpckhqdq m7, m8
+ movh [Q7], m7
+%endif
+%endif
+
+ RET
+%endmacro
+
+%macro LPF_16_VH 2
+INIT_XMM %2
+cglobal vp9_loop_filter_v_%1_16, 5,10,16, dst, stride, E, I, H, mstride, dst1, dst2, stride3, mstride3
+ LOOPFILTER v, %1
+cglobal vp9_loop_filter_h_%1_16, 5,10,16, 256, dst, stride, E, I, H, mstride, dst1, dst2, stride3, mstride3
+ LOOPFILTER h, %1
+%endmacro
+
+%macro LPF_16_VH_ALL_OPTS 1
+LPF_16_VH %1, sse2
+LPF_16_VH %1, ssse3
+LPF_16_VH %1, avx
+%endmacro
+
+LPF_16_VH_ALL_OPTS 16
+LPF_16_VH_ALL_OPTS 44
+LPF_16_VH_ALL_OPTS 48
+LPF_16_VH_ALL_OPTS 84
+LPF_16_VH_ALL_OPTS 88
+
+%endif ; x86-64
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp9mc.asm b/chromium/third_party/ffmpeg/libavcodec/x86/vp9mc.asm
index 21c38b4f0d4..7c2a38c8b33 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp9mc.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp9mc.asm
@@ -87,7 +87,7 @@ SECTION .text
%macro filter_h_fn 1
%assign %%px mmsize/2
-cglobal %1_8tap_1d_h_ %+ %%px, 6, 6, 11, dst, dstride, src, sstride, h, filtery
+cglobal vp9_%1_8tap_1d_h_ %+ %%px, 6, 6, 11, dst, dstride, src, sstride, h, filtery
mova m6, [pw_256]
mova m7, [filteryq+ 0]
%if ARCH_X86_64 && mmsize > 8
@@ -145,22 +145,76 @@ INIT_XMM ssse3
filter_h_fn put
filter_h_fn avg
+%if ARCH_X86_64
+%macro filter_hx2_fn 1
+%assign %%px mmsize
+cglobal vp9_%1_8tap_1d_h_ %+ %%px, 6, 6, 14, dst, dstride, src, sstride, h, filtery
+ mova m13, [pw_256]
+ mova m8, [filteryq+ 0]
+ mova m9, [filteryq+16]
+ mova m10, [filteryq+32]
+ mova m11, [filteryq+48]
+.loop:
+ movu m0, [srcq-3]
+ movu m1, [srcq-2]
+ movu m2, [srcq-1]
+ movu m3, [srcq+0]
+ movu m4, [srcq+1]
+ movu m5, [srcq+2]
+ movu m6, [srcq+3]
+ movu m7, [srcq+4]
+ add srcq, sstrideq
+ SBUTTERFLY bw, 0, 1, 12
+ SBUTTERFLY bw, 2, 3, 12
+ SBUTTERFLY bw, 4, 5, 12
+ SBUTTERFLY bw, 6, 7, 12
+ pmaddubsw m0, m8
+ pmaddubsw m1, m8
+ pmaddubsw m2, m9
+ pmaddubsw m3, m9
+ pmaddubsw m4, m10
+ pmaddubsw m5, m10
+ pmaddubsw m6, m11
+ pmaddubsw m7, m11
+ paddw m0, m2
+ paddw m1, m3
+ paddw m4, m6
+ paddw m5, m7
+ paddsw m0, m4
+ paddsw m1, m5
+ pmulhrsw m0, m13
+ pmulhrsw m1, m13
+ packuswb m0, m1
+%ifidn %1, avg
+ pavgb m0, [dstq]
+%endif
+ mova [dstq], m0
+ add dstq, dstrideq
+ dec hd
+ jg .loop
+ RET
+%endmacro
+
+INIT_XMM ssse3
+filter_hx2_fn put
+filter_hx2_fn avg
+
+%endif ; ARCH_X86_64
+
%macro filter_v_fn 1
%assign %%px mmsize/2
%if ARCH_X86_64
-cglobal %1_8tap_1d_v_ %+ %%px, 6, 8, 11, dst, dstride, src, sstride, h, filtery, src4, sstride3
+cglobal vp9_%1_8tap_1d_v_ %+ %%px, 6, 8, 11, dst, dstride, src, sstride, h, filtery, src4, sstride3
%else
-cglobal %1_8tap_1d_v_ %+ %%px, 4, 7, 11, dst, dstride, src, sstride, filtery, src4, sstride3
+cglobal vp9_%1_8tap_1d_v_ %+ %%px, 4, 7, 11, dst, dstride, src, sstride, filtery, src4, sstride3
mov filteryq, r5mp
%define hd r4mp
%endif
- sub srcq, sstrideq
- lea sstride3q, [sstrideq*3]
- sub srcq, sstrideq
mova m6, [pw_256]
- sub srcq, sstrideq
+ lea sstride3q, [sstrideq*3]
+ lea src4q, [srcq+sstrideq]
+ sub srcq, sstride3q
mova m7, [filteryq+ 0]
- lea src4q, [srcq+sstrideq*4]
%if ARCH_X86_64 && mmsize > 8
mova m8, [filteryq+16]
mova m9, [filteryq+32]
@@ -220,6 +274,70 @@ INIT_XMM ssse3
filter_v_fn put
filter_v_fn avg
+%if ARCH_X86_64
+
+%macro filter_vx2_fn 1
+%assign %%px mmsize
+cglobal vp9_%1_8tap_1d_v_ %+ %%px, 6, 8, 14, dst, dstride, src, sstride, h, filtery, src4, sstride3
+ mova m13, [pw_256]
+ lea sstride3q, [sstrideq*3]
+ lea src4q, [srcq+sstrideq]
+ sub srcq, sstride3q
+ mova m8, [filteryq+ 0]
+ mova m9, [filteryq+16]
+ mova m10, [filteryq+32]
+ mova m11, [filteryq+48]
+.loop:
+ ; FIXME maybe reuse loads from previous rows, or just
+ ; more generally unroll this to prevent multiple loads of
+ ; the same data?
+ movu m0, [srcq]
+ movu m1, [srcq+sstrideq]
+ movu m2, [srcq+sstrideq*2]
+ movu m3, [srcq+sstride3q]
+ movu m4, [src4q]
+ movu m5, [src4q+sstrideq]
+ movu m6, [src4q+sstrideq*2]
+ movu m7, [src4q+sstride3q]
+ add srcq, sstrideq
+ add src4q, sstrideq
+ SBUTTERFLY bw, 0, 1, 12
+ SBUTTERFLY bw, 2, 3, 12
+ SBUTTERFLY bw, 4, 5, 12
+ SBUTTERFLY bw, 6, 7, 12
+ pmaddubsw m0, m8
+ pmaddubsw m1, m8
+ pmaddubsw m2, m9
+ pmaddubsw m3, m9
+ pmaddubsw m4, m10
+ pmaddubsw m5, m10
+ pmaddubsw m6, m11
+ pmaddubsw m7, m11
+ paddw m0, m2
+ paddw m1, m3
+ paddw m4, m6
+ paddw m5, m7
+ paddsw m0, m4
+ paddsw m1, m5
+ pmulhrsw m0, m13
+ pmulhrsw m1, m13
+ packuswb m0, m1
+%ifidn %1, avg
+ pavgb m0, [dstq]
+%endif
+ mova [dstq], m0
+ add dstq, dstrideq
+ dec hd
+ jg .loop
+ RET
+%endmacro
+
+INIT_XMM ssse3
+filter_vx2_fn put
+filter_vx2_fn avg
+
+%endif ; ARCH_X86_64
+
%macro fpel_fn 6
%if %2 == 4
%define %%srcfn movh
@@ -230,11 +348,11 @@ filter_v_fn avg
%endif
%if %2 <= 16
-cglobal %1%2, 5, 7, 4, dst, dstride, src, sstride, h, dstride3, sstride3
+cglobal vp9_%1%2, 5, 7, 4, dst, dstride, src, sstride, h, dstride3, sstride3
lea sstride3q, [sstrideq*3]
lea dstride3q, [dstrideq*3]
%else
-cglobal %1%2, 5, 5, 4, dst, dstride, src, sstride, h
+cglobal vp9_%1%2, 5, 5, 4, dst, dstride, src, sstride, h
%endif
.loop:
%%srcfn m0, [srcq]
@@ -263,7 +381,7 @@ cglobal %1%2, 5, 5, 4, dst, dstride, src, sstride, h
INIT_MMX mmx
fpel_fn put, 4, strideq, strideq*2, stride3q, 4
fpel_fn put, 8, strideq, strideq*2, stride3q, 4
-INIT_MMX sse
+INIT_MMX mmxext
fpel_fn avg, 4, strideq, strideq*2, stride3q, 4
fpel_fn avg, 8, strideq, strideq*2, stride3q, 4
INIT_XMM sse
diff --git a/chromium/third_party/ffmpeg/libavcodec/xbmdec.c b/chromium/third_party/ffmpeg/libavcodec/xbmdec.c
index 2976bec8acd..e03ff31fbb7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xbmdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xbmdec.c
@@ -20,17 +20,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/avstring.h"
+
#include "avcodec.h"
#include "internal.h"
#include "mathops.h"
-#include "libavutil/avstring.h"
-
-static av_cold int xbm_decode_init(AVCodecContext *avctx)
-{
- avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
-
- return 0;
-}
static int convert(uint8_t x)
{
@@ -43,42 +37,57 @@ static int convert(uint8_t x)
return x;
}
+static int parse_str_int(const uint8_t *p, int len, const uint8_t *key)
+{
+ const uint8_t *end = p + len;
+
+ for(; p<end - strlen(key); p++) {
+ if (!memcmp(p, key, strlen(key)))
+ break;
+ }
+ p += strlen(key);
+ if (p >= end)
+ return INT_MIN;
+
+ for(; p<end; p++) {
+ char *eptr;
+ int64_t ret = strtol(p, &eptr, 10);
+ if ((const uint8_t *)eptr != p)
+ return ret;
+ }
+ return INT_MIN;
+}
+
static int xbm_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
AVFrame *p = data;
+ int ret, linesize, i, j;
+ int width = 0;
+ int height = 0;
const uint8_t *end, *ptr = avpkt->data;
+ const uint8_t *next;
uint8_t *dst;
- int ret, linesize, i, j;
+ avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
end = avpkt->data + avpkt->size;
- while (!avctx->width || !avctx->height) {
- char name[256];
- int number, len;
-
- ptr += strcspn(ptr, "#");
- if (sscanf(ptr, "#define %255s %u", name, &number) != 2) {
- av_log(avctx, AV_LOG_ERROR, "Unexpected preprocessor directive\n");
- return AVERROR_INVALIDDATA;
- }
- len = strlen(name);
- if ((len > 6) && !avctx->height && !memcmp(name + len - 7, "_height", 7)) {
- avctx->height = number;
- } else if ((len > 5) && !avctx->width && !memcmp(name + len - 6, "_width", 6)) {
- avctx->width = number;
- } else {
- av_log(avctx, AV_LOG_ERROR, "Unknown define '%s'\n", name);
- return AVERROR_INVALIDDATA;
- }
- ptr += strcspn(ptr, "\n\r") + 1;
- }
+ width = parse_str_int(avpkt->data, avpkt->size, "_width");
+ height = parse_str_int(avpkt->data, avpkt->size, "_height");
+
+ if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
+ return ret;
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
return ret;
// goto start of image data
- ptr += strcspn(ptr, "{") + 1;
+ next = ptr + strcspn(ptr, "{");
+ if (!*next)
+ next = ptr + strcspn(ptr, "(");
+ if (!*next)
+ return AVERROR_INVALIDDATA;
+ ptr = next + 1;
linesize = (avctx->width + 7) / 8;
for (i = 0; i < avctx->height; i++) {
@@ -86,15 +95,22 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data,
for (j = 0; j < linesize; j++) {
uint8_t val;
- ptr += strcspn(ptr, "x") + 1;
+ ptr += strcspn(ptr, "x$") + 1;
if (ptr < end && av_isxdigit(*ptr)) {
- val = convert(*ptr);
- ptr++;
+ val = convert(*ptr++);
if (av_isxdigit(*ptr))
- val = (val << 4) + convert(*ptr);
+ val = (val << 4) + convert(*ptr++);
*dst++ = ff_reverse[val];
+ if (av_isxdigit(*ptr) && j+1 < linesize) {
+ j++;
+ val = convert(*ptr++);
+ if (av_isxdigit(*ptr))
+ val = (val << 4) + convert(*ptr++);
+ *dst++ = ff_reverse[val];
+ }
} else {
- av_log(avctx, AV_LOG_ERROR, "Unexpected data at '%.8s'\n", ptr);
+ av_log(avctx, AV_LOG_ERROR,
+ "Unexpected data at %.8s.\n", ptr);
return AVERROR_INVALIDDATA;
}
}
@@ -113,7 +129,6 @@ AVCodec ff_xbm_decoder = {
.long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_XBM,
- .init = xbm_decode_init,
.decode = xbm_decode_frame,
.capabilities = CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/xsubenc.c b/chromium/third_party/ffmpeg/libavcodec/xsubenc.c
index 53f4d6c3a9b..707085488c5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xsubenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xsubenc.c
@@ -142,7 +142,7 @@ static int xsub_encode(AVCodecContext *avctx, unsigned char *buf,
av_log(avctx, AV_LOG_WARNING, "No more than 4 subtitle colors supported (%d found.)\n", h->rects[0]->nb_colors);
// TODO: Palette swapping if color zero is not transparent
- if (((uint32_t *)h->rects[0]->pict.data[1])[0] & 0xff)
+ if (((uint32_t *)h->rects[0]->pict.data[1])[0] & 0xff000000)
av_log(avctx, AV_LOG_WARNING, "Color index 0 is not transparent. Transparency will be messed up.\n");
if (make_tc(startTime, start_tc) || make_tc(endTime, end_tc)) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/xvmc.h b/chromium/third_party/ffmpeg/libavcodec/xvmc.h
index efd69fc913e..c2e187cc16e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xvmc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/xvmc.h
@@ -33,8 +33,6 @@
#include "version.h"
#include "avcodec.h"
-#if FF_API_XVMC
-
/**
* @defgroup lavc_codec_hwaccel_xvmc XvMC
* @ingroup lavc_codec_hwaccel
@@ -169,6 +167,4 @@ attribute_deprecated struct xvmc_pix_fmt {
* @}
*/
-#endif /* FF_API_XVMC */
-
#endif /* AVCODEC_XVMC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/xvmc_internal.h b/chromium/third_party/ffmpeg/libavcodec/xvmc_internal.h
index 6a60add965d..d365ef0266b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xvmc_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/xvmc_internal.h
@@ -25,14 +25,7 @@
#include "mpegvideo.h"
#include "version.h"
-#if FF_API_XVMC
-
void ff_xvmc_init_block(MpegEncContext *s);
void ff_xvmc_pack_pblocks(MpegEncContext *s, int cbp);
-int ff_xvmc_field_start(MpegEncContext*s, AVCodecContext *avctx);
-void ff_xvmc_field_end(MpegEncContext *s);
-void ff_xvmc_decode_mb(MpegEncContext *s);
-
-#endif /* FF_API_XVMC */
#endif /* AVCODEC_XVMC_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/xwddec.c b/chromium/third_party/ffmpeg/libavcodec/xwddec.c
index c28e19fa8b4..62dfdace165 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xwddec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xwddec.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
@@ -75,11 +77,15 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
ncolors = bytestream2_get_be32u(&gb);
bytestream2_skipu(&gb, header_size - (XWD_HEADER_SIZE - 20));
- av_log(avctx, AV_LOG_DEBUG, "pixformat %d, pixdepth %d, bunit %d, bitorder %d, bpad %d\n",
+ av_log(avctx, AV_LOG_DEBUG,
+ "pixformat %"PRIu32", pixdepth %"PRIu32", bunit %"PRIu32", bitorder %"PRIu32", bpad %"PRIu32"\n",
pixformat, pixdepth, bunit, bitorder, bpad);
- av_log(avctx, AV_LOG_DEBUG, "vclass %d, ncolors %d, bpp %d, be %d, lsize %d, xoffset %d\n",
+ av_log(avctx, AV_LOG_DEBUG,
+ "vclass %"PRIu32", ncolors %"PRIu32", bpp %"PRIu32", be %"PRIu32", lsize %"PRIu32", xoffset %"PRIu32"\n",
vclass, ncolors, bpp, be, lsize, xoffset);
- av_log(avctx, AV_LOG_DEBUG, "red %0x, green %0x, blue %0x\n", rgb[0], rgb[1], rgb[2]);
+ av_log(avctx, AV_LOG_DEBUG,
+ "red %0"PRIx32", green %0"PRIx32", blue %0"PRIx32"\n",
+ rgb[0], rgb[1], rgb[2]);
if (pixformat > XWD_Z_PIXMAP) {
av_log(avctx, AV_LOG_ERROR, "invalid pixmap format\n");
@@ -92,7 +98,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
}
if (xoffset) {
- avpriv_request_sample(avctx, "xoffset %d", xoffset);
+ avpriv_request_sample(avctx, "xoffset %"PRIu32"", xoffset);
return AVERROR_PATCHWELCOME;
}
@@ -141,7 +147,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
}
if (pixformat != XWD_Z_PIXMAP) {
- avpriv_report_missing_feature(avctx, "Pixmap format %d", pixformat);
+ avpriv_report_missing_feature(avctx, "Pixmap format %"PRIu32, pixformat);
return AVERROR_PATCHWELCOME;
}
@@ -196,7 +202,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
avpriv_request_sample(avctx,
- "Unknown file: bpp %d, pixdepth %d, vclass %d",
+ "Unknown file: bpp %"PRIu32", pixdepth %"PRIu32", vclass %"PRIu32"",
bpp, pixdepth, vclass);
return AVERROR_PATCHWELCOME;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/zmbv.c b/chromium/third_party/ffmpeg/libavcodec/zmbv.c
index 71e828771a3..21a9e35c39c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/zmbv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/zmbv.c
@@ -145,7 +145,7 @@ static int zmbv_decode_xor_8(ZmbvContext *c)
prev += c->width * c->bh;
}
if (src - c->decomp_buf != c->decomp_len)
- av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
+ av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n",
src-c->decomp_buf, c->decomp_len);
return 0;
}
@@ -219,7 +219,7 @@ static int zmbv_decode_xor_16(ZmbvContext *c)
prev += c->width * c->bh;
}
if (src - c->decomp_buf != c->decomp_len)
- av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
+ av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n",
src-c->decomp_buf, c->decomp_len);
return 0;
}
@@ -377,7 +377,7 @@ static int zmbv_decode_xor_32(ZmbvContext *c)
prev += c->width * c->bh;
}
if (src - c->decomp_buf != c->decomp_len)
- av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
+ av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n",
src-c->decomp_buf, c->decomp_len);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavdevice/Makefile b/chromium/third_party/ffmpeg/libavdevice/Makefile
index 531818a4f54..767df19aa7c 100644
--- a/chromium/third_party/ffmpeg/libavdevice/Makefile
+++ b/chromium/third_party/ffmpeg/libavdevice/Makefile
@@ -1,8 +1,6 @@
include $(SUBDIR)../config.mak
NAME = avdevice
-FFLIBS = avformat avcodec avutil
-FFLIBS-$(CONFIG_LAVFI_INDEV) += avfilter
HEADERS = avdevice.h \
version.h \
@@ -15,8 +13,10 @@ OBJS-$(CONFIG_ALSA_INDEV) += alsa-audio-common.o \
alsa-audio-dec.o timefilter.o
OBJS-$(CONFIG_ALSA_OUTDEV) += alsa-audio-common.o \
alsa-audio-enc.o
+OBJS-$(CONFIG_AVFOUNDATION_INDEV) += avfoundation.o
OBJS-$(CONFIG_BKTR_INDEV) += bktr.o
OBJS-$(CONFIG_CACA_OUTDEV) += caca.o
+OBJS-$(CONFIG_DECKLINK_OUTDEV) += decklink_enc.o decklink_enc_c.o
OBJS-$(CONFIG_DSHOW_INDEV) += dshow.o dshow_enummediatypes.o \
dshow_enumpins.o dshow_filter.o \
dshow_pin.o dshow_common.o
@@ -25,16 +25,19 @@ OBJS-$(CONFIG_FBDEV_INDEV) += fbdev_dec.o \
fbdev_common.o
OBJS-$(CONFIG_FBDEV_OUTDEV) += fbdev_enc.o \
fbdev_common.o
+OBJS-$(CONFIG_GDIGRAB_INDEV) += gdigrab.o
OBJS-$(CONFIG_IEC61883_INDEV) += iec61883.o
OBJS-$(CONFIG_JACK_INDEV) += jack_audio.o timefilter.o
OBJS-$(CONFIG_LAVFI_INDEV) += lavfi.o
OBJS-$(CONFIG_OPENAL_INDEV) += openal-dec.o
+OBJS-$(CONFIG_OPENGL_OUTDEV) += opengl_enc.o
OBJS-$(CONFIG_OSS_INDEV) += oss_audio.o
OBJS-$(CONFIG_OSS_OUTDEV) += oss_audio.o
OBJS-$(CONFIG_PULSE_INDEV) += pulse_audio_dec.o \
pulse_audio_common.o
OBJS-$(CONFIG_PULSE_OUTDEV) += pulse_audio_enc.o \
pulse_audio_common.o
+OBJS-$(CONFIG_QTKIT_INDEV) += qtkit.o
OBJS-$(CONFIG_SDL_OUTDEV) += sdl.o
OBJS-$(CONFIG_SNDIO_INDEV) += sndio_common.o sndio_dec.o
OBJS-$(CONFIG_SNDIO_OUTDEV) += sndio_common.o sndio_enc.o
@@ -54,7 +57,10 @@ OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o
# Windows resource file
SLIBOBJS-$(HAVE_GNU_WINDRES) += avdeviceres.o
+SKIPHEADERS-$(CONFIG_DECKLINK) += decklink_enc.h
SKIPHEADERS-$(CONFIG_DSHOW_INDEV) += dshow_capture.h
+SKIPHEADERS-$(CONFIG_FBDEV_INDEV) += fbdev_common.h
+SKIPHEADERS-$(CONFIG_FBDEV_OUTDEV) += fbdev_common.h
SKIPHEADERS-$(CONFIG_LIBPULSE) += pulse_audio_common.h
SKIPHEADERS-$(CONFIG_V4L2_INDEV) += v4l2-common.h
SKIPHEADERS-$(CONFIG_V4L2_OUTDEV) += v4l2-common.h
diff --git a/chromium/third_party/ffmpeg/libavdevice/alldevices.c b/chromium/third_party/ffmpeg/libavdevice/alldevices.c
index 5178f30861c..ca34959eeec 100644
--- a/chromium/third_party/ffmpeg/libavdevice/alldevices.c
+++ b/chromium/third_party/ffmpeg/libavdevice/alldevices.c
@@ -47,17 +47,22 @@ void avdevice_register_all(void)
/* devices */
REGISTER_INOUTDEV(ALSA, alsa);
+ REGISTER_INDEV (AVFOUNDATION, avfoundation);
REGISTER_INDEV (BKTR, bktr);
REGISTER_OUTDEV (CACA, caca);
+ REGISTER_OUTDEV (DECKLINK, decklink);
REGISTER_INDEV (DSHOW, dshow);
REGISTER_INDEV (DV1394, dv1394);
REGISTER_INOUTDEV(FBDEV, fbdev);
+ REGISTER_INDEV (GDIGRAB, gdigrab);
REGISTER_INDEV (IEC61883, iec61883);
REGISTER_INDEV (JACK, jack);
REGISTER_INDEV (LAVFI, lavfi);
REGISTER_INDEV (OPENAL, openal);
+ REGISTER_OUTDEV (OPENGL, opengl);
REGISTER_INOUTDEV(OSS, oss);
REGISTER_INOUTDEV(PULSE, pulse);
+ REGISTER_INDEV (QTKIT, qtkit);
REGISTER_OUTDEV (SDL, sdl);
REGISTER_INOUTDEV(SNDIO, sndio);
REGISTER_INOUTDEV(V4L2, v4l2);
diff --git a/chromium/third_party/ffmpeg/libavdevice/alsa-audio-dec.c b/chromium/third_party/ffmpeg/libavdevice/alsa-audio-dec.c
index 03154b0b7c1..2cdf356b923 100644
--- a/chromium/third_party/ffmpeg/libavdevice/alsa-audio-dec.c
+++ b/chromium/third_party/ffmpeg/libavdevice/alsa-audio-dec.c
@@ -143,6 +143,7 @@ static const AVClass alsa_demuxer_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
AVInputFormat ff_alsa_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/alsa-audio-enc.c b/chromium/third_party/ffmpeg/libavdevice/alsa-audio-enc.c
index 83e1d2f85f0..e42cc8f5186 100644
--- a/chromium/third_party/ffmpeg/libavdevice/alsa-audio-enc.c
+++ b/chromium/third_party/ffmpeg/libavdevice/alsa-audio-enc.c
@@ -113,6 +113,24 @@ static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
return 0;
}
+static int audio_write_frame(AVFormatContext *s1, int stream_index,
+ AVFrame **frame, unsigned flags)
+{
+ AlsaData *s = s1->priv_data;
+ AVPacket pkt;
+
+ /* ff_alsa_open() should have accepted only supported formats */
+ if ((flags & AV_WRITE_UNCODED_FRAME_QUERY))
+ return av_sample_fmt_is_planar(s1->streams[stream_index]->codec->sample_fmt) ?
+ AVERROR(EINVAL) : 0;
+ /* set only used fields */
+ pkt.data = (*frame)->data[0];
+ pkt.size = (*frame)->nb_samples * s->frame_size;
+ pkt.dts = (*frame)->pkt_dts;
+ pkt.duration = av_frame_get_pkt_duration(*frame);
+ return audio_write_packet(s1, &pkt);
+}
+
static void
audio_get_output_timestamp(AVFormatContext *s1, int stream,
int64_t *dts, int64_t *wall)
@@ -124,6 +142,13 @@ audio_get_output_timestamp(AVFormatContext *s1, int stream,
*dts = s->timestamp - delay;
}
+static const AVClass alsa_muxer_class = {
+ .class_name = "ALSA muxer",
+ .item_name = av_default_item_name,
+ .version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
+};
+
AVOutputFormat ff_alsa_muxer = {
.name = "alsa",
.long_name = NULL_IF_CONFIG_SMALL("ALSA audio output"),
@@ -133,6 +158,8 @@ AVOutputFormat ff_alsa_muxer = {
.write_header = audio_write_header,
.write_packet = audio_write_packet,
.write_trailer = ff_alsa_close,
+ .write_uncoded_frame = audio_write_frame,
.get_output_timestamp = audio_get_output_timestamp,
.flags = AVFMT_NOFILE,
+ .priv_class = &alsa_muxer_class,
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/avdevice.c b/chromium/third_party/ffmpeg/libavdevice/avdevice.c
index b9b18f2576f..6a75bd79d7f 100644
--- a/chromium/third_party/ffmpeg/libavdevice/avdevice.c
+++ b/chromium/third_party/ffmpeg/libavdevice/avdevice.c
@@ -17,9 +17,46 @@
*/
#include "libavutil/avassert.h"
+#include "libavutil/samplefmt.h"
+#include "libavutil/pixfmt.h"
+#include "libavcodec/avcodec.h"
#include "avdevice.h"
#include "config.h"
+#define E AV_OPT_FLAG_ENCODING_PARAM
+#define D AV_OPT_FLAG_DECODING_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM
+#define V AV_OPT_FLAG_VIDEO_PARAM
+#define OFFSET(x) offsetof(AVDeviceCapabilitiesQuery, x)
+
+const AVOption av_device_capabilities[] = {
+ { "codec", "codec", OFFSET(codec), AV_OPT_TYPE_INT,
+ {.i64 = AV_CODEC_ID_NONE}, AV_CODEC_ID_NONE, INT_MAX, E|D|A|V },
+ { "sample_format", "sample format", OFFSET(sample_format), AV_OPT_TYPE_INT,
+ {.i64 = AV_SAMPLE_FMT_NONE}, -1, INT_MAX, E|D|A },
+ { "sample_rate", "sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT,
+ {.i64 = -1}, -1, INT_MAX, E|D|A },
+ { "channels", "channels", OFFSET(channels), AV_OPT_TYPE_INT,
+ {.i64 = -1}, -1, INT_MAX, E|D|A },
+ { "channel_layout", "channel layout", OFFSET(channel_layout), AV_OPT_TYPE_INT64,
+ {.i64 = -1}, -1, INT_MAX, E|D|A },
+ { "pixel_format", "pixel format", OFFSET(pixel_format), AV_OPT_TYPE_INT,
+ {.i64 = AV_PIX_FMT_NONE}, -1, INT_MAX, E|D|V },
+ { "window_size", "window size", OFFSET(window_width), AV_OPT_TYPE_IMAGE_SIZE,
+ {.str = NULL}, -1, INT_MAX, E|D|V },
+ { "frame_size", "frame size", OFFSET(frame_width), AV_OPT_TYPE_IMAGE_SIZE,
+ {.str = NULL}, -1, INT_MAX, E|D|V },
+ { "fps", "fps", OFFSET(fps), AV_OPT_TYPE_RATIONAL,
+ {.dbl = -1}, -1, INT_MAX, E|D|V },
+ { NULL }
+};
+
+#undef E
+#undef D
+#undef A
+#undef V
+#undef OFFSET
+
unsigned avdevice_version(void)
{
av_assert0(LIBAVDEVICE_VERSION_MICRO >= 100);
@@ -36,3 +73,157 @@ const char * avdevice_license(void)
#define LICENSE_PREFIX "libavdevice license: "
return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
}
+
+static void *av_device_next(void *prev, int output,
+ AVClassCategory c1, AVClassCategory c2)
+{
+ const AVClass *pc;
+ AVClassCategory category = AV_CLASS_CATEGORY_NA;
+ do {
+ if (output) {
+ if (!(prev = av_oformat_next(prev)))
+ break;
+ pc = ((AVOutputFormat *)prev)->priv_class;
+ } else {
+ if (!(prev = av_iformat_next(prev)))
+ break;
+ pc = ((AVInputFormat *)prev)->priv_class;
+ }
+ if (!pc)
+ continue;
+ category = pc->category;
+ } while (category != c1 && category != c2);
+ return prev;
+}
+
+AVInputFormat *av_input_audio_device_next(AVInputFormat *d)
+{
+ return av_device_next(d, 0, AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
+ AV_CLASS_CATEGORY_DEVICE_INPUT);
+}
+
+AVInputFormat *av_input_video_device_next(AVInputFormat *d)
+{
+ return av_device_next(d, 0, AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
+ AV_CLASS_CATEGORY_DEVICE_INPUT);
+}
+
+AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d)
+{
+ return av_device_next(d, 1, AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
+ AV_CLASS_CATEGORY_DEVICE_OUTPUT);
+}
+
+AVOutputFormat *av_output_video_device_next(AVOutputFormat *d)
+{
+ return av_device_next(d, 1, AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
+ AV_CLASS_CATEGORY_DEVICE_OUTPUT);
+}
+
+int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type,
+ void *data, size_t data_size)
+{
+ if (!s->oformat || !s->oformat->control_message)
+ return AVERROR(ENOSYS);
+ return s->oformat->control_message(s, type, data, data_size);
+}
+
+int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type,
+ void *data, size_t data_size)
+{
+ if (!s->control_message_cb)
+ return AVERROR(ENOSYS);
+ return s->control_message_cb(s, type, data, data_size);
+}
+
+int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s,
+ AVDictionary **device_options)
+{
+ int ret;
+ av_assert0(s && caps);
+ av_assert0(s->iformat || s->oformat);
+ if ((s->oformat && !s->oformat->create_device_capabilities) ||
+ (s->iformat && !s->iformat->create_device_capabilities))
+ return AVERROR(ENOSYS);
+ *caps = av_mallocz(sizeof(**caps));
+ if (!(*caps))
+ return AVERROR(ENOMEM);
+ (*caps)->device_context = s;
+ if (((ret = av_opt_set_dict(s->priv_data, device_options)) < 0))
+ goto fail;
+ if (s->iformat) {
+ if ((ret = s->iformat->create_device_capabilities(s, *caps)) < 0)
+ goto fail;
+ } else {
+ if ((ret = s->oformat->create_device_capabilities(s, *caps)) < 0)
+ goto fail;
+ }
+ av_opt_set_defaults(*caps);
+ return 0;
+ fail:
+ av_freep(caps);
+ return ret;
+}
+
+void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s)
+{
+ if (!s || !caps || !(*caps))
+ return;
+ av_assert0(s->iformat || s->oformat);
+ if (s->iformat) {
+ if (s->iformat->free_device_capabilities)
+ s->iformat->free_device_capabilities(s, *caps);
+ } else {
+ if (s->oformat->free_device_capabilities)
+ s->oformat->free_device_capabilities(s, *caps);
+ }
+ av_freep(caps);
+}
+
+int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
+{
+ int ret;
+ av_assert0(s);
+ av_assert0(device_list);
+ av_assert0(s->oformat || s->iformat);
+ if ((s->oformat && !s->oformat->get_device_list) ||
+ (s->iformat && !s->iformat->get_device_list)) {
+ *device_list = NULL;
+ return AVERROR(ENOSYS);
+ }
+ *device_list = av_mallocz(sizeof(AVDeviceInfoList));
+ if (!(*device_list))
+ return AVERROR(ENOMEM);
+ /* no default device by default */
+ (*device_list)->default_device = -1;
+ if (s->oformat)
+ ret = s->oformat->get_device_list(s, *device_list);
+ else
+ ret = s->iformat->get_device_list(s, *device_list);
+ if (ret < 0)
+ avdevice_free_list_devices(device_list);
+ return ret;
+}
+
+void avdevice_free_list_devices(AVDeviceInfoList **device_list)
+{
+ AVDeviceInfoList *list;
+ AVDeviceInfo *dev;
+ int i;
+
+ av_assert0(device_list);
+ list = *device_list;
+ if (!list)
+ return;
+
+ for (i = 0; i < list->nb_devices; i++) {
+ dev = list->devices[i];
+ if (dev) {
+ av_free(dev->device_name);
+ av_free(dev->device_description);
+ av_free(dev);
+ }
+ }
+ av_free(list->devices);
+ av_freep(device_list);
+}
diff --git a/chromium/third_party/ffmpeg/libavdevice/avdevice.h b/chromium/third_party/ffmpeg/libavdevice/avdevice.h
index 93a044f2707..a39522819ee 100644
--- a/chromium/third_party/ffmpeg/libavdevice/avdevice.h
+++ b/chromium/third_party/ffmpeg/libavdevice/avdevice.h
@@ -43,6 +43,9 @@
* @}
*/
+#include "libavutil/log.h"
+#include "libavutil/opt.h"
+#include "libavutil/dict.h"
#include "libavformat/avformat.h"
/**
@@ -66,4 +69,419 @@ const char *avdevice_license(void);
*/
void avdevice_register_all(void);
+/**
+ * Audio input devices iterator.
+ *
+ * If d is NULL, returns the first registered input audio/video device,
+ * if d is non-NULL, returns the next registered input audio/video device after d
+ * or NULL if d is the last one.
+ */
+AVInputFormat *av_input_audio_device_next(AVInputFormat *d);
+
+/**
+ * Video input devices iterator.
+ *
+ * If d is NULL, returns the first registered input audio/video device,
+ * if d is non-NULL, returns the next registered input audio/video device after d
+ * or NULL if d is the last one.
+ */
+AVInputFormat *av_input_video_device_next(AVInputFormat *d);
+
+/**
+ * Audio output devices iterator.
+ *
+ * If d is NULL, returns the first registered output audio/video device,
+ * if d is non-NULL, returns the next registered output audio/video device after d
+ * or NULL if d is the last one.
+ */
+AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d);
+
+/**
+ * Video output devices iterator.
+ *
+ * If d is NULL, returns the first registered output audio/video device,
+ * if d is non-NULL, returns the next registered output audio/video device after d
+ * or NULL if d is the last one.
+ */
+AVOutputFormat *av_output_video_device_next(AVOutputFormat *d);
+
+typedef struct AVDeviceRect {
+ int x; /**< x coordinate of top left corner */
+ int y; /**< y coordinate of top left corner */
+ int width; /**< width */
+ int height; /**< height */
+} AVDeviceRect;
+
+/**
+ * Message types used by avdevice_app_to_dev_control_message().
+ */
+enum AVAppToDevMessageType {
+ /**
+ * Dummy message.
+ */
+ AV_APP_TO_DEV_NONE = MKBETAG('N','O','N','E'),
+
+ /**
+ * Window size change message.
+ *
+ * Message is sent to the device every time the application changes the size
+ * of the window device renders to.
+ * Message should also be sent right after window is created.
+ *
+ * data: AVDeviceRect: new window size.
+ */
+ AV_APP_TO_DEV_WINDOW_SIZE = MKBETAG('G','E','O','M'),
+
+ /**
+ * Repaint request message.
+ *
+ * Message is sent to the device when window has to be repainted.
+ *
+ * data: AVDeviceRect: area required to be repainted.
+ * NULL: whole area is required to be repainted.
+ */
+ AV_APP_TO_DEV_WINDOW_REPAINT = MKBETAG('R','E','P','A'),
+
+ /**
+ * Request pause/play.
+ *
+ * Application requests pause/unpause playback.
+ * Mostly usable with devices that have internal buffer.
+ * By default devices are not paused.
+ *
+ * data: NULL
+ */
+ AV_APP_TO_DEV_PAUSE = MKBETAG('P', 'A', 'U', ' '),
+ AV_APP_TO_DEV_PLAY = MKBETAG('P', 'L', 'A', 'Y'),
+ AV_APP_TO_DEV_TOGGLE_PAUSE = MKBETAG('P', 'A', 'U', 'T'),
+
+ /**
+ * Volume control message.
+ *
+ * Set volume level. It may be device-dependent if volume
+ * is changed per stream or system wide. Per stream volume
+ * change is expected when possible.
+ *
+ * data: double: new volume with range of 0.0 - 1.0.
+ */
+ AV_APP_TO_DEV_SET_VOLUME = MKBETAG('S', 'V', 'O', 'L'),
+
+ /**
+ * Mute control messages.
+ *
+ * Change mute state. It may be device-dependent if mute status
+ * is changed per stream or system wide. Per stream mute status
+ * change is expected when possible.
+ *
+ * data: NULL.
+ */
+ AV_APP_TO_DEV_MUTE = MKBETAG(' ', 'M', 'U', 'T'),
+ AV_APP_TO_DEV_UNMUTE = MKBETAG('U', 'M', 'U', 'T'),
+ AV_APP_TO_DEV_TOGGLE_MUTE = MKBETAG('T', 'M', 'U', 'T'),
+
+ /**
+ * Get volume/mute messages.
+ *
+ * Force the device to send AV_DEV_TO_APP_VOLUME_LEVEL_CHANGED or
+ * AV_DEV_TO_APP_MUTE_STATE_CHANGED command respectively.
+ *
+ * data: NULL.
+ */
+ AV_APP_TO_DEV_GET_VOLUME = MKBETAG('G', 'V', 'O', 'L'),
+ AV_APP_TO_DEV_GET_MUTE = MKBETAG('G', 'M', 'U', 'T'),
+};
+
+/**
+ * Message types used by avdevice_dev_to_app_control_message().
+ */
+enum AVDevToAppMessageType {
+ /**
+ * Dummy message.
+ */
+ AV_DEV_TO_APP_NONE = MKBETAG('N','O','N','E'),
+
+ /**
+ * Create window buffer message.
+ *
+ * Device requests to create a window buffer. Exact meaning is device-
+ * and application-dependent. Message is sent before rendering first
+ * frame and all one-shot initializations should be done here.
+ * Application is allowed to ignore preferred window buffer size.
+ *
+ * @note: Application is obligated to inform about window buffer size
+ * with AV_APP_TO_DEV_WINDOW_SIZE message.
+ *
+ * data: AVDeviceRect: preferred size of the window buffer.
+ * NULL: no preferred size of the window buffer.
+ */
+ AV_DEV_TO_APP_CREATE_WINDOW_BUFFER = MKBETAG('B','C','R','E'),
+
+ /**
+ * Prepare window buffer message.
+ *
+ * Device requests to prepare a window buffer for rendering.
+ * Exact meaning is device- and application-dependent.
+ * Message is sent before rendering of each frame.
+ *
+ * data: NULL.
+ */
+ AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER = MKBETAG('B','P','R','E'),
+
+ /**
+ * Display window buffer message.
+ *
+ * Device requests to display a window buffer.
+ * Message is sent when new frame is ready to be displayed.
+ * Usually buffers need to be swapped in handler of this message.
+ *
+ * data: NULL.
+ */
+ AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER = MKBETAG('B','D','I','S'),
+
+ /**
+ * Destroy window buffer message.
+ *
+ * Device requests to destroy a window buffer.
+ * Message is sent when device is about to be destroyed and window
+ * buffer is not required anymore.
+ *
+ * data: NULL.
+ */
+ AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER = MKBETAG('B','D','E','S'),
+
+ /**
+ * Buffer fullness status messages.
+ *
+ * Device signals buffer overflow/underflow.
+ *
+ * data: NULL.
+ */
+ AV_DEV_TO_APP_BUFFER_OVERFLOW = MKBETAG('B','O','F','L'),
+ AV_DEV_TO_APP_BUFFER_UNDERFLOW = MKBETAG('B','U','F','L'),
+
+ /**
+ * Buffer readable/writable.
+ *
+ * Device informs that buffer is readable/writable.
+ * When possible, device informs how many bytes can be read/write.
+ *
+ * @warning Device may not inform when number of bytes than can be read/write changes.
+ *
+ * data: int64_t: amount of bytes available to read/write.
+ * NULL: amount of bytes available to read/write is not known.
+ */
+ AV_DEV_TO_APP_BUFFER_READABLE = MKBETAG('B','R','D',' '),
+ AV_DEV_TO_APP_BUFFER_WRITABLE = MKBETAG('B','W','R',' '),
+
+ /**
+ * Mute state change message.
+ *
+ * Device informs that mute state has changed.
+ *
+ * data: int: 0 for not muted state, non-zero for muted state.
+ */
+ AV_DEV_TO_APP_MUTE_STATE_CHANGED = MKBETAG('C','M','U','T'),
+
+ /**
+ * Volume level change message.
+ *
+ * Device informs that volume level has changed.
+ *
+ * data: double: new volume with range of 0.0 - 1.0.
+ */
+ AV_DEV_TO_APP_VOLUME_LEVEL_CHANGED = MKBETAG('C','V','O','L'),
+};
+
+/**
+ * Send control message from application to device.
+ *
+ * @param s device context.
+ * @param type message type.
+ * @param data message data. Exact type depends on message type.
+ * @param data_size size of message data.
+ * @return >= 0 on success, negative on error.
+ * AVERROR(ENOSYS) when device doesn't implement handler of the message.
+ */
+int avdevice_app_to_dev_control_message(struct AVFormatContext *s,
+ enum AVAppToDevMessageType type,
+ void *data, size_t data_size);
+
+/**
+ * Send control message from device to application.
+ *
+ * @param s device context.
+ * @param type message type.
+ * @param data message data. Can be NULL.
+ * @param data_size size of message data.
+ * @return >= 0 on success, negative on error.
+ * AVERROR(ENOSYS) when application doesn't implement handler of the message.
+ */
+int avdevice_dev_to_app_control_message(struct AVFormatContext *s,
+ enum AVDevToAppMessageType type,
+ void *data, size_t data_size);
+
+/**
+ * Following API allows user to probe device capabilities (supported codecs,
+ * pixel formats, sample formats, resolutions, channel counts, etc).
+ * It is build on top op AVOption API.
+ * Queried capabilities allows to set up converters of video or audio
+ * parameters that fit to the device.
+ *
+ * List of capabilities that can be queried:
+ * - Capabilities valid for both audio and video devices:
+ * - codec: supported audio/video codecs.
+ * type: AV_OPT_TYPE_INT (AVCodecID value)
+ * - Capabilities valid for audio devices:
+ * - sample_format: supported sample formats.
+ * type: AV_OPT_TYPE_INT (AVSampleFormat value)
+ * - sample_rate: supported sample rates.
+ * type: AV_OPT_TYPE_INT
+ * - channels: supported number of channels.
+ * type: AV_OPT_TYPE_INT
+ * - channel_layout: supported channel layouts.
+ * type: AV_OPT_TYPE_INT64
+ * - Capabilities valid for video devices:
+ * - pixel_format: supported pixel formats.
+ * type: AV_OPT_TYPE_INT (AVPixelFormat value)
+ * - window_size: supported window sizes (describes size of the window size presented to the user).
+ * type: AV_OPT_TYPE_IMAGE_SIZE
+ * - frame_size: supported frame sizes (describes size of provided video frames).
+ * type: AV_OPT_TYPE_IMAGE_SIZE
+ * - fps: supported fps values
+ * type: AV_OPT_TYPE_RATIONAL
+ *
+ * Value of the capability may be set by user using av_opt_set() function
+ * and AVDeviceCapabilitiesQuery object. Following queries will
+ * limit results to the values matching already set capabilities.
+ * For example, setting a codec may impact number of formats or fps values
+ * returned during next query. Setting invalid value may limit results to zero.
+ *
+ * Example of the usage basing on opengl output device:
+ *
+ * @code
+ * AVFormatContext *oc = NULL;
+ * AVDeviceCapabilitiesQuery *caps = NULL;
+ * AVOptionRanges *ranges;
+ * int ret;
+ *
+ * if ((ret = avformat_alloc_output_context2(&oc, NULL, "opengl", NULL)) < 0)
+ * goto fail;
+ * if (avdevice_capabilities_create(&caps, oc, NULL) < 0)
+ * goto fail;
+ *
+ * //query codecs
+ * if (av_opt_query_ranges(&ranges, caps, "codec", AV_OPT_MULTI_COMPONENT_RANGE)) < 0)
+ * goto fail;
+ * //pick codec here and set it
+ * av_opt_set(caps, "codec", AV_CODEC_ID_RAWVIDEO, 0);
+ *
+ * //query format
+ * if (av_opt_query_ranges(&ranges, caps, "pixel_format", AV_OPT_MULTI_COMPONENT_RANGE)) < 0)
+ * goto fail;
+ * //pick format here and set it
+ * av_opt_set(caps, "pixel_format", AV_PIX_FMT_YUV420P, 0);
+ *
+ * //query and set more capabilities
+ *
+ * fail:
+ * //clean up code
+ * avdevice_capabilities_free(&query, oc);
+ * avformat_free_context(oc);
+ * @endcode
+ */
+
+/**
+ * Structure describes device capabilities.
+ *
+ * It is used by devices in conjunction with av_device_capabilities AVOption table
+ * to implement capabilities probing API based on AVOption API. Should not be used directly.
+ */
+typedef struct AVDeviceCapabilitiesQuery {
+ const AVClass *av_class;
+ AVFormatContext *device_context;
+ enum AVCodecID codec;
+ enum AVSampleFormat sample_format;
+ enum AVPixelFormat pixel_format;
+ int sample_rate;
+ int channels;
+ int64_t channel_layout;
+ int window_width;
+ int window_height;
+ int frame_width;
+ int frame_height;
+ AVRational fps;
+} AVDeviceCapabilitiesQuery;
+
+/**
+ * AVOption table used by devices to implement device capabilities API. Should not be used by a user.
+ */
+extern const AVOption av_device_capabilities[];
+
+/**
+ * Initialize capabilities probing API based on AVOption API.
+ *
+ * avdevice_capabilities_free() must be called when query capabilities API is
+ * not used anymore.
+ *
+ * @param[out] caps Device capabilities data. Pointer to a NULL pointer must be passed.
+ * @param s Context of the device.
+ * @param device_options An AVDictionary filled with device-private options.
+ * On return this parameter will be destroyed and replaced with a dict
+ * containing options that were not found. May be NULL.
+ * The same options must be passed later to avformat_write_header() for output
+ * devices or avformat_open_input() for input devices, or at any other place
+ * that affects device-private options.
+ *
+ * @return >= 0 on success, negative otherwise.
+ */
+int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s,
+ AVDictionary **device_options);
+
+/**
+ * Free resources created by avdevice_capabilities_create()
+ *
+ * @param caps Device capabilities data to be freed.
+ * @param s Context of the device.
+ */
+void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s);
+
+/**
+ * Structure describes basic parameters of the device.
+ */
+typedef struct AVDeviceInfo {
+ char *device_name; /**< device name, format depends on device */
+ char *device_description; /**< human friendly name */
+} AVDeviceInfo;
+
+/**
+ * List of devices.
+ */
+typedef struct AVDeviceInfoList {
+ AVDeviceInfo **devices; /**< list of autodetected devices */
+ int nb_devices; /**< number of autodetected devices */
+ int default_device; /**< index of default device or -1 if no default */
+} AVDeviceInfoList;
+
+/**
+ * List devices.
+ *
+ * Returns available device names and their parameters.
+ *
+ * @note: Some devices may accept system-dependent device names that cannot be
+ * autodetected. The list returned by this function cannot be assumed to
+ * be always completed.
+ *
+ * @param s device context.
+ * @param[out] device_list list of autodetected devices.
+ * @return count of autodetected devices, negative on error.
+ */
+int avdevice_list_devices(struct AVFormatContext *s, AVDeviceInfoList **device_list);
+
+/**
+ * Convenient function to free result of avdevice_list_devices().
+ *
+ * @param devices device list to be freed.
+ */
+void avdevice_free_list_devices(AVDeviceInfoList **device_list);
+
#endif /* AVDEVICE_AVDEVICE_H */
diff --git a/chromium/third_party/ffmpeg/libavdevice/avfoundation.m b/chromium/third_party/ffmpeg/libavdevice/avfoundation.m
new file mode 100644
index 00000000000..3622be008b1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavdevice/avfoundation.m
@@ -0,0 +1,374 @@
+/*
+ * AVFoundation input device
+ * Copyright (c) 2014 Thilo Borgmann <thilo.borgmann@mail.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
+ */
+
+/**
+ * @file
+ * AVFoundation input device
+ * @author Thilo Borgmann <thilo.borgmann@mail.de>
+ */
+
+#import <AVFoundation/AVFoundation.h>
+#include <pthread.h>
+
+#include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
+#include "libavformat/internal.h"
+#include "libavutil/internal.h"
+#include "libavutil/time.h"
+#include "avdevice.h"
+
+static const int avf_time_base = 100;
+
+static const AVRational avf_time_base_q = {
+ .num = 1,
+ .den = avf_time_base
+};
+
+typedef struct
+{
+ AVClass* class;
+
+ float frame_rate;
+ int frames_captured;
+ int64_t first_pts;
+ pthread_mutex_t frame_lock;
+ pthread_cond_t frame_wait_cond;
+ id avf_delegate;
+
+ int list_devices;
+ int video_device_index;
+
+ AVCaptureSession *capture_session;
+ AVCaptureVideoDataOutput *video_output;
+ CMSampleBufferRef current_frame;
+} AVFContext;
+
+static void lock_frames(AVFContext* ctx)
+{
+ pthread_mutex_lock(&ctx->frame_lock);
+}
+
+static void unlock_frames(AVFContext* ctx)
+{
+ pthread_mutex_unlock(&ctx->frame_lock);
+}
+
+/** FrameReciever class - delegate for AVCaptureSession
+ */
+@interface AVFFrameReceiver : NSObject
+{
+ AVFContext* _context;
+}
+
+- (id)initWithContext:(AVFContext*)context;
+
+- (void) captureOutput:(AVCaptureOutput *)captureOutput
+ didOutputSampleBuffer:(CMSampleBufferRef)videoFrame
+ fromConnection:(AVCaptureConnection *)connection;
+
+@end
+
+@implementation AVFFrameReceiver
+
+- (id)initWithContext:(AVFContext*)context
+{
+ if (self = [super init]) {
+ _context = context;
+ }
+ return self;
+}
+
+- (void) captureOutput:(AVCaptureOutput *)captureOutput
+ didOutputSampleBuffer:(CMSampleBufferRef)videoFrame
+ fromConnection:(AVCaptureConnection *)connection
+{
+ lock_frames(_context);
+
+ if (_context->current_frame != nil) {
+ CFRelease(_context->current_frame);
+ }
+
+ _context->current_frame = (CMSampleBufferRef)CFRetain(videoFrame);
+
+ pthread_cond_signal(&_context->frame_wait_cond);
+
+ unlock_frames(_context);
+
+ ++_context->frames_captured;
+}
+
+@end
+
+static void destroy_context(AVFContext* ctx)
+{
+ [ctx->capture_session stopRunning];
+
+ [ctx->capture_session release];
+ [ctx->video_output release];
+ [ctx->avf_delegate release];
+
+ ctx->capture_session = NULL;
+ ctx->video_output = NULL;
+ ctx->avf_delegate = NULL;
+
+ pthread_mutex_destroy(&ctx->frame_lock);
+ pthread_cond_destroy(&ctx->frame_wait_cond);
+
+ if (ctx->current_frame) {
+ CFRelease(ctx->current_frame);
+ }
+}
+
+static int avf_read_header(AVFormatContext *s)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ AVFContext *ctx = (AVFContext*)s->priv_data;
+ ctx->first_pts = av_gettime();
+
+ pthread_mutex_init(&ctx->frame_lock, NULL);
+ pthread_cond_init(&ctx->frame_wait_cond, NULL);
+
+ // List devices if requested
+ if (ctx->list_devices) {
+ av_log(ctx, AV_LOG_INFO, "AVFoundation video devices:\n");
+ NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
+ for (AVCaptureDevice *device in devices) {
+ const char *name = [[device localizedName] UTF8String];
+ int index = [devices indexOfObject:device];
+ av_log(ctx, AV_LOG_INFO, "[%d] %s\n", index, name);
+ }
+ goto fail;
+ }
+
+ // Find capture device
+ AVCaptureDevice *video_device = nil;
+
+ // check for device index given in filename
+ if (ctx->video_device_index == -1) {
+ sscanf(s->filename, "%d", &ctx->video_device_index);
+ }
+
+ if (ctx->video_device_index >= 0) {
+ NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
+
+ if (ctx->video_device_index >= [devices count]) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid device index\n");
+ goto fail;
+ }
+
+ video_device = [devices objectAtIndex:ctx->video_device_index];
+ } else if (strncmp(s->filename, "", 1) &&
+ strncmp(s->filename, "default", 7)) {
+ NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
+
+ for (AVCaptureDevice *device in devices) {
+ if (!strncmp(s->filename, [[device localizedName] UTF8String], strlen(s->filename))) {
+ video_device = device;
+ break;
+ }
+ }
+
+ if (!video_device) {
+ av_log(ctx, AV_LOG_ERROR, "Video device not found\n");
+ goto fail;
+ }
+ } else {
+ video_device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeMuxed];
+ }
+
+ // Video capture device not found, looking for AVMediaTypeVideo
+ if (!video_device) {
+ video_device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
+
+ if (!video_device) {
+ av_log(s, AV_LOG_ERROR, "No AV capture device found\n");
+ goto fail;
+ }
+ }
+
+ NSString* dev_display_name = [video_device localizedName];
+ av_log(s, AV_LOG_DEBUG, "'%s' opened\n", [dev_display_name UTF8String]);
+
+ // Initialize capture session
+ ctx->capture_session = [[AVCaptureSession alloc] init];
+
+ NSError *error = nil;
+ AVCaptureDeviceInput* capture_dev_input = [[[AVCaptureDeviceInput alloc] initWithDevice:video_device error:&error] autorelease];
+
+ if (!capture_dev_input) {
+ av_log(s, AV_LOG_ERROR, "Failed to create AV capture input device: %s\n",
+ [[error localizedDescription] UTF8String]);
+ goto fail;
+ }
+
+ if (!capture_dev_input) {
+ av_log(s, AV_LOG_ERROR, "Failed to add AV capture input device to session: %s\n",
+ [[error localizedDescription] UTF8String]);
+ goto fail;
+ }
+
+ if ([ctx->capture_session canAddInput:capture_dev_input]) {
+ [ctx->capture_session addInput:capture_dev_input];
+ } else {
+ av_log(s, AV_LOG_ERROR, "can't add video input to capture session\n");
+ goto fail;
+ }
+
+ // Attaching output
+ // FIXME: Allow for a user defined pixel format
+ ctx->video_output = [[AVCaptureVideoDataOutput alloc] init];
+
+ if (!ctx->video_output) {
+ av_log(s, AV_LOG_ERROR, "Failed to init AV video output\n");
+ goto fail;
+ }
+
+ NSNumber *pixel_format = [NSNumber numberWithUnsignedInt:kCVPixelFormatType_24RGB];
+ NSDictionary *capture_dict = [NSDictionary dictionaryWithObject:pixel_format
+ forKey:(id)kCVPixelBufferPixelFormatTypeKey];
+
+ [ctx->video_output setVideoSettings:capture_dict];
+ [ctx->video_output setAlwaysDiscardsLateVideoFrames:YES];
+
+ ctx->avf_delegate = [[AVFFrameReceiver alloc] initWithContext:ctx];
+
+ dispatch_queue_t queue = dispatch_queue_create("avf_queue", NULL);
+ [ctx->video_output setSampleBufferDelegate:ctx->avf_delegate queue:queue];
+ dispatch_release(queue);
+
+ if ([ctx->capture_session canAddOutput:ctx->video_output]) {
+ [ctx->capture_session addOutput:ctx->video_output];
+ } else {
+ av_log(s, AV_LOG_ERROR, "can't add video output to capture session\n");
+ goto fail;
+ }
+
+ [ctx->capture_session startRunning];
+
+ // Take stream info from the first frame.
+ while (ctx->frames_captured < 1) {
+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, YES);
+ }
+
+ lock_frames(ctx);
+
+ AVStream* stream = avformat_new_stream(s, NULL);
+
+ if (!stream) {
+ goto fail;
+ }
+
+ avpriv_set_pts_info(stream, 64, 1, avf_time_base);
+
+ CVImageBufferRef image_buffer = CMSampleBufferGetImageBuffer(ctx->current_frame);
+ CGSize image_buffer_size = CVImageBufferGetEncodedSize(image_buffer);
+
+ stream->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
+ stream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ stream->codec->width = (int)image_buffer_size.width;
+ stream->codec->height = (int)image_buffer_size.height;
+ stream->codec->pix_fmt = AV_PIX_FMT_RGB24;
+
+ CFRelease(ctx->current_frame);
+ ctx->current_frame = nil;
+
+ unlock_frames(ctx);
+ [pool release];
+ return 0;
+
+fail:
+ [pool release];
+ destroy_context(ctx);
+ return AVERROR(EIO);
+}
+
+static int avf_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ AVFContext* ctx = (AVFContext*)s->priv_data;
+
+ do {
+ lock_frames(ctx);
+
+ CVImageBufferRef image_buffer = CMSampleBufferGetImageBuffer(ctx->current_frame);
+
+ if (ctx->current_frame != nil) {
+ if (av_new_packet(pkt, (int)CVPixelBufferGetDataSize(image_buffer)) < 0) {
+ return AVERROR(EIO);
+ }
+
+ pkt->pts = pkt->dts = av_rescale_q(av_gettime() - ctx->first_pts,
+ AV_TIME_BASE_Q,
+ avf_time_base_q);
+ pkt->stream_index = 0;
+ pkt->flags |= AV_PKT_FLAG_KEY;
+
+ CVPixelBufferLockBaseAddress(image_buffer, 0);
+
+ void* data = CVPixelBufferGetBaseAddress(image_buffer);
+ memcpy(pkt->data, data, pkt->size);
+
+ CVPixelBufferUnlockBaseAddress(image_buffer, 0);
+ CFRelease(ctx->current_frame);
+ ctx->current_frame = nil;
+ } else {
+ pkt->data = NULL;
+ pthread_cond_wait(&ctx->frame_wait_cond, &ctx->frame_lock);
+ }
+
+ unlock_frames(ctx);
+ } while (!pkt->data);
+
+ return 0;
+}
+
+static int avf_close(AVFormatContext *s)
+{
+ AVFContext* ctx = (AVFContext*)s->priv_data;
+ destroy_context(ctx);
+ return 0;
+}
+
+static const AVOption options[] = {
+ { "frame_rate", "set frame rate", offsetof(AVFContext, frame_rate), AV_OPT_TYPE_FLOAT, { .dbl = 30.0 }, 0.1, 30.0, AV_OPT_TYPE_VIDEO_RATE, NULL },
+ { "list_devices", "list available devices", offsetof(AVFContext, list_devices), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "list_devices" },
+ { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "list_devices" },
+ { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "list_devices" },
+ { "video_device_index", "select video device by index for devices with same name (starts at 0)", offsetof(AVFContext, video_device_index), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+ { NULL },
+};
+
+static const AVClass avf_class = {
+ .class_name = "AVFoundation input device",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVInputFormat ff_avfoundation_demuxer = {
+ .name = "avfoundation",
+ .long_name = NULL_IF_CONFIG_SMALL("AVFoundation input device"),
+ .priv_data_size = sizeof(AVFContext),
+ .read_header = avf_read_header,
+ .read_packet = avf_read_packet,
+ .read_close = avf_close,
+ .flags = AVFMT_NOFILE,
+ .priv_class = &avf_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavdevice/bktr.c b/chromium/third_party/ffmpeg/libavdevice/bktr.c
index 4e25aa6ad86..50dcc7d214a 100644
--- a/chromium/third_party/ffmpeg/libavdevice/bktr.c
+++ b/chromium/third_party/ffmpeg/libavdevice/bktr.c
@@ -334,6 +334,7 @@ static const AVClass bktr_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
AVInputFormat ff_bktr_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/caca.c b/chromium/third_party/ffmpeg/libavdevice/caca.c
index 0a7470120f0..a1180647871 100644
--- a/chromium/third_party/ffmpeg/libavdevice/caca.c
+++ b/chromium/third_party/ffmpeg/libavdevice/caca.c
@@ -224,6 +224,7 @@ static const AVClass caca_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
AVOutputFormat ff_caca_muxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/decklink_enc.cpp b/chromium/third_party/ffmpeg/libavdevice/decklink_enc.cpp
new file mode 100644
index 00000000000..3d7cbe237cd
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavdevice/decklink_enc.cpp
@@ -0,0 +1,588 @@
+/*
+ * Blackmagic DeckLink output
+ * Copyright (c) 2013-2014 Ramiro Polla
+ *
+ * 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 <DeckLinkAPI.h>
+#ifdef _WIN32
+#include <DeckLinkAPI_i.c>
+typedef unsigned long buffercount_type;
+#else
+#include <DeckLinkAPIDispatch.cpp>
+typedef uint32_t buffercount_type;
+#endif
+
+#include <pthread.h>
+#include <semaphore.h>
+
+extern "C" {
+#include "libavformat/avformat.h"
+#include "libavformat/internal.h"
+#include "libavutil/imgutils.h"
+}
+
+#include "decklink_enc.h"
+
+class decklink_callback;
+
+struct decklink_ctx {
+ /* DeckLink SDK interfaces */
+ IDeckLink *dl;
+ IDeckLinkOutput *dlo;
+ decklink_callback *callback;
+
+ /* DeckLink mode information */
+ IDeckLinkDisplayModeIterator *itermode;
+ BMDTimeValue bmd_tb_den;
+ BMDTimeValue bmd_tb_num;
+ BMDDisplayMode bmd_mode;
+ int bmd_width;
+ int bmd_height;
+
+ /* Streams present */
+ int audio;
+ int video;
+
+ /* Status */
+ int playback_started;
+ int64_t last_pts;
+
+ /* Options */
+ int list_devices;
+ int list_formats;
+ double preroll;
+
+ int frames_preroll;
+ int frames_buffer;
+
+ sem_t semaphore;
+
+ int channels;
+};
+
+/* DeckLink callback class declaration */
+class decklink_frame : public IDeckLinkVideoFrame
+{
+public:
+ decklink_frame(struct decklink_ctx *ctx, AVFrame *avframe, long width,
+ long height, void *buffer) :
+ _ctx(ctx), _avframe(avframe), _width(width),
+ _height(height), _buffer(buffer), _refs(0) { }
+
+ virtual long STDMETHODCALLTYPE GetWidth (void) { return _width; }
+ virtual long STDMETHODCALLTYPE GetHeight (void) { return _height; }
+ virtual long STDMETHODCALLTYPE GetRowBytes (void) { return _width<<1; }
+ virtual BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat(void) { return bmdFormat8BitYUV; }
+ virtual BMDFrameFlags STDMETHODCALLTYPE GetFlags (void) { return bmdVideoOutputFlagDefault; }
+ virtual HRESULT STDMETHODCALLTYPE GetBytes (void **buffer) { *buffer = _buffer; return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE GetTimecode (BMDTimecodeFormat format, IDeckLinkTimecode **timecode) { return S_FALSE; }
+ virtual HRESULT STDMETHODCALLTYPE GetAncillaryData(IDeckLinkVideoFrameAncillary **ancillary) { return S_FALSE; }
+
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) { return E_NOINTERFACE; }
+ virtual ULONG STDMETHODCALLTYPE AddRef(void) { return ++_refs; }
+ virtual ULONG STDMETHODCALLTYPE Release(void) { if (!--_refs) delete this; return _refs; }
+
+ struct decklink_ctx *_ctx;
+ AVFrame *_avframe;
+
+private:
+ long _width;
+ long _height;
+ void *_buffer;
+ int _refs;
+};
+
+class decklink_callback : public IDeckLinkVideoOutputCallback
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE ScheduledFrameCompleted(IDeckLinkVideoFrame *_frame, BMDOutputFrameCompletionResult result)
+ {
+ decklink_frame *frame = static_cast<decklink_frame *>(_frame);
+ struct decklink_ctx *ctx = frame->_ctx;
+ AVFrame *avframe = frame->_avframe;
+
+ av_frame_free(&avframe);
+
+ sem_post(&ctx->semaphore);
+
+ return S_OK;
+ }
+ virtual HRESULT STDMETHODCALLTYPE ScheduledPlaybackHasStopped(void) { return S_OK; }
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) { return E_NOINTERFACE; }
+ virtual ULONG STDMETHODCALLTYPE AddRef(void) { return 1; }
+ virtual ULONG STDMETHODCALLTYPE Release(void) { return 1; }
+};
+
+#ifdef _WIN32
+static IDeckLinkIterator *CreateDeckLinkIteratorInstance(void)
+{
+ IDeckLinkIterator *iter;
+
+ if (CoInitialize(NULL) != S_OK) {
+ av_log(NULL, AV_LOG_ERROR, "COM initialization failed.\n");
+ return NULL;
+ }
+
+ if (CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
+ IID_IDeckLinkIterator, (void**) &iter) != S_OK) {
+ av_log(NULL, AV_LOG_ERROR, "DeckLink drivers not installed.\n");
+ return NULL;
+ }
+
+ return iter;
+}
+#endif
+
+/* free() is needed for a string returned by the DeckLink SDL. */
+#undef free
+
+#ifdef _WIN32
+static char *dup_wchar_to_utf8(wchar_t *w)
+{
+ char *s = NULL;
+ int l = WideCharToMultiByte(CP_UTF8, 0, w, -1, 0, 0, 0, 0);
+ s = (char *) av_malloc(l);
+ if (s)
+ WideCharToMultiByte(CP_UTF8, 0, w, -1, s, l, 0, 0);
+ return s;
+}
+#define DECKLINK_STR OLECHAR *
+#define DECKLINK_STRDUP dup_wchar_to_utf8
+#else
+#define DECKLINK_STR const char *
+#define DECKLINK_STRDUP av_strdup
+#endif
+
+static HRESULT IDeckLink_GetDisplayName(IDeckLink *This, const char **displayName)
+{
+ DECKLINK_STR tmpDisplayName;
+ HRESULT hr = This->GetDisplayName(&tmpDisplayName);
+ if (hr != S_OK)
+ return hr;
+ *displayName = DECKLINK_STRDUP(tmpDisplayName);
+ free((void *) tmpDisplayName);
+ return hr;
+}
+
+static int decklink_set_format(struct decklink_ctx *ctx,
+ int width, int height,
+ int tb_num, int tb_den)
+{
+ BMDDisplayModeSupport support;
+ IDeckLinkDisplayMode *mode;
+
+ if (tb_num == 1) {
+ tb_num *= 1000;
+ tb_den *= 1000;
+ }
+ ctx->bmd_mode = bmdModeUnknown;
+ while ((ctx->bmd_mode == bmdModeUnknown) && ctx->itermode->Next(&mode) == S_OK) {
+ BMDTimeValue bmd_tb_num, bmd_tb_den;
+ int bmd_width = mode->GetWidth();
+ int bmd_height = mode->GetHeight();
+
+ mode->GetFrameRate(&bmd_tb_num, &bmd_tb_den);
+
+ if (bmd_width == width && bmd_height == height &&
+ bmd_tb_num == tb_num && bmd_tb_den == tb_den) {
+ ctx->bmd_mode = mode->GetDisplayMode();
+ ctx->bmd_width = bmd_width;
+ ctx->bmd_height = bmd_height;
+ ctx->bmd_tb_den = bmd_tb_den;
+ ctx->bmd_tb_num = bmd_tb_num;
+ }
+
+ mode->Release();
+ }
+ if (ctx->bmd_mode == bmdModeUnknown)
+ return -1;
+ if (ctx->dlo->DoesSupportVideoMode(ctx->bmd_mode, bmdFormat8BitYUV,
+ bmdVideoOutputFlagDefault,
+ &support, NULL) != S_OK)
+ return -1;
+ if (support == bmdDisplayModeSupported)
+ return 0;
+
+ return -1;
+}
+
+static int decklink_setup_video(AVFormatContext *avctx, AVStream *st)
+{
+ struct decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
+ struct decklink_ctx *ctx = (struct decklink_ctx *) cctx->ctx;
+ AVCodecContext *c = st->codec;
+
+ if (ctx->video) {
+ av_log(avctx, AV_LOG_ERROR, "Only one video stream is supported!\n");
+ return -1;
+ }
+
+ if (c->pix_fmt != AV_PIX_FMT_UYVY422) {
+ av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format!"
+ " Only AV_PIX_FMT_UYVY422 is supported.\n");
+ return -1;
+ }
+ if (decklink_set_format(ctx, c->width, c->height,
+ c->time_base.num, c->time_base.den)) {
+ av_log(avctx, AV_LOG_ERROR, "Unsupported video size or framerate!"
+ " Check available formats with -list_formats 1.\n");
+ return -1;
+ }
+ if (ctx->dlo->EnableVideoOutput(ctx->bmd_mode,
+ bmdVideoOutputFlagDefault) != S_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Could not enable video output!\n");
+ return -1;
+ }
+
+ /* Set callback. */
+ ctx->callback = new decklink_callback();
+ ctx->dlo->SetScheduledFrameCompletionCallback(ctx->callback);
+
+ /* Start video semaphore. */
+ ctx->frames_preroll = c->time_base.den * ctx->preroll;
+ if (c->time_base.den > 1000)
+ ctx->frames_preroll /= 1000;
+
+ /* Buffer twice as many frames as the preroll. */
+ ctx->frames_buffer = ctx->frames_preroll * 2;
+ ctx->frames_buffer = FFMIN(ctx->frames_buffer, 60);
+ sem_init(&ctx->semaphore, 0, ctx->frames_buffer);
+
+ /* The device expects the framerate to be fixed. */
+ avpriv_set_pts_info(st, 64, c->time_base.num, c->time_base.den);
+
+ ctx->video = 1;
+
+ return 0;
+}
+
+static int decklink_setup_audio(AVFormatContext *avctx, AVStream *st)
+{
+ struct decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
+ struct decklink_ctx *ctx = (struct decklink_ctx *) cctx->ctx;
+ AVCodecContext *c = st->codec;
+
+ if (ctx->audio) {
+ av_log(avctx, AV_LOG_ERROR, "Only one audio stream is supported!\n");
+ return -1;
+ }
+ if (c->sample_rate != 48000) {
+ av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate!"
+ " Only 48kHz is supported.\n");
+ return -1;
+ }
+ if (c->channels != 2 && c->channels != 8) {
+ av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels!"
+ " Only stereo and 7.1 are supported.\n");
+ return -1;
+ }
+ if (ctx->dlo->EnableAudioOutput(bmdAudioSampleRate48kHz,
+ bmdAudioSampleType16bitInteger,
+ c->channels,
+ bmdAudioOutputStreamTimestamped) != S_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Could not enable audio output!\n");
+ return -1;
+ }
+ if (ctx->dlo->BeginAudioPreroll() != S_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Could not begin audio preroll!\n");
+ return -1;
+ }
+
+ /* The device expects the sample rate to be fixed. */
+ avpriv_set_pts_info(st, 64, 1, c->sample_rate);
+ ctx->channels = c->channels;
+
+ ctx->audio = 1;
+
+ return 0;
+}
+
+av_cold int ff_decklink_write_trailer(AVFormatContext *avctx)
+{
+ struct decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
+ struct decklink_ctx *ctx = (struct decklink_ctx *) cctx->ctx;
+
+ if (ctx->playback_started) {
+ BMDTimeValue actual;
+ ctx->dlo->StopScheduledPlayback(ctx->last_pts * ctx->bmd_tb_num,
+ &actual, ctx->bmd_tb_den);
+ ctx->dlo->DisableVideoOutput();
+ if (ctx->audio)
+ ctx->dlo->DisableAudioOutput();
+ }
+
+ if (ctx->dlo)
+ ctx->dlo->Release();
+ if (ctx->dl)
+ ctx->dl->Release();
+
+ if (ctx->callback)
+ delete ctx->callback;
+
+ sem_destroy(&ctx->semaphore);
+
+ av_freep(&cctx->ctx);
+
+ return 0;
+}
+
+static int decklink_write_video_packet(AVFormatContext *avctx, AVPacket *pkt)
+{
+ struct decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
+ struct decklink_ctx *ctx = (struct decklink_ctx *) cctx->ctx;
+ AVPicture *avpicture = (AVPicture *) pkt->data;
+ AVFrame *avframe, *tmp;
+ decklink_frame *frame;
+ buffercount_type buffered;
+ HRESULT hr;
+
+ /* HACK while av_uncoded_frame() isn't implemented */
+ int ret;
+
+ tmp = av_frame_alloc();
+ if (!tmp)
+ return AVERROR(ENOMEM);
+ tmp->format = AV_PIX_FMT_UYVY422;
+ tmp->width = ctx->bmd_width;
+ tmp->height = ctx->bmd_height;
+ ret = av_frame_get_buffer(tmp, 32);
+ if (ret < 0) {
+ av_frame_free(&tmp);
+ return ret;
+ }
+ av_image_copy(tmp->data, tmp->linesize, (const uint8_t **) avpicture->data,
+ avpicture->linesize, (AVPixelFormat) tmp->format, tmp->width,
+ tmp->height);
+ avframe = av_frame_clone(tmp);
+ av_frame_free(&tmp);
+ if (!avframe) {
+ av_log(avctx, AV_LOG_ERROR, "Could not clone video frame.\n");
+ return AVERROR(EIO);
+ }
+ /* end HACK */
+
+ frame = new decklink_frame(ctx, avframe, ctx->bmd_width, ctx->bmd_height,
+ (void *) avframe->data[0]);
+ if (!frame) {
+ av_log(avctx, AV_LOG_ERROR, "Could not create new frame.\n");
+ return AVERROR(EIO);
+ }
+
+ /* Always keep at most one second of frames buffered. */
+ sem_wait(&ctx->semaphore);
+
+ /* Schedule frame for playback. */
+ hr = ctx->dlo->ScheduleVideoFrame((struct IDeckLinkVideoFrame *) frame,
+ pkt->pts * ctx->bmd_tb_num,
+ ctx->bmd_tb_num, ctx->bmd_tb_den);
+ if (hr != S_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Could not schedule video frame."
+ " error %08x.\n", (uint32_t) hr);
+ frame->Release();
+ return AVERROR(EIO);
+ }
+
+ ctx->dlo->GetBufferedVideoFrameCount(&buffered);
+ av_log(avctx, AV_LOG_DEBUG, "Buffered video frames: %d.\n", (int) buffered);
+ if (pkt->pts > 2 && buffered <= 2)
+ av_log(avctx, AV_LOG_WARNING, "There are not enough buffered video frames."
+ " Video may misbehave!\n");
+
+ /* Preroll video frames. */
+ if (!ctx->playback_started && pkt->pts > ctx->frames_preroll) {
+ av_log(avctx, AV_LOG_DEBUG, "Ending audio preroll.\n");
+ if (ctx->audio && ctx->dlo->EndAudioPreroll() != S_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Could not end audio preroll!\n");
+ return AVERROR(EIO);
+ }
+ av_log(avctx, AV_LOG_DEBUG, "Starting scheduled playback.\n");
+ if (ctx->dlo->StartScheduledPlayback(0, ctx->bmd_tb_den, 1.0) != S_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Could not start scheduled playback!\n");
+ return AVERROR(EIO);
+ }
+ ctx->playback_started = 1;
+ }
+
+ return 0;
+}
+
+static int decklink_write_audio_packet(AVFormatContext *avctx, AVPacket *pkt)
+{
+ struct decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
+ struct decklink_ctx *ctx = (struct decklink_ctx *) cctx->ctx;
+ int sample_count = pkt->size / (ctx->channels << 1);
+ buffercount_type buffered;
+
+ ctx->dlo->GetBufferedAudioSampleFrameCount(&buffered);
+ if (pkt->pts > 1 && !buffered)
+ av_log(avctx, AV_LOG_WARNING, "There's no buffered audio."
+ " Audio will misbehave!\n");
+
+ if (ctx->dlo->ScheduleAudioSamples(pkt->data, sample_count, pkt->pts,
+ bmdAudioSampleRate48kHz, NULL) != S_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Could not schedule audio samples.\n");
+ return AVERROR(EIO);
+ }
+
+ return 0;
+}
+
+extern "C" {
+
+av_cold int ff_decklink_write_header(AVFormatContext *avctx)
+{
+ struct decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
+ struct decklink_ctx *ctx;
+ IDeckLinkIterator *iter;
+ IDeckLink *dl = NULL;
+ unsigned int n;
+
+ ctx = (struct decklink_ctx *) av_mallocz(sizeof(struct decklink_ctx));
+ if (!ctx)
+ return AVERROR(ENOMEM);
+ ctx->list_devices = cctx->list_devices;
+ ctx->list_formats = cctx->list_formats;
+ ctx->preroll = cctx->preroll;
+ cctx->ctx = ctx;
+
+ iter = CreateDeckLinkIteratorInstance();
+ if (!iter) {
+ av_log(avctx, AV_LOG_ERROR, "Could not create DeckLink iterator\n");
+ return AVERROR(EIO);
+ }
+
+ /* List available devices. */
+ if (ctx->list_devices) {
+ av_log(avctx, AV_LOG_INFO, "Blackmagic DeckLink devices:\n");
+ while (iter->Next(&dl) == S_OK) {
+ const char *displayName;
+ IDeckLink_GetDisplayName(dl, &displayName);
+ av_log(avctx, AV_LOG_INFO, "\t'%s'\n", displayName);
+ av_free((void *) displayName);
+ dl->Release();
+ }
+ iter->Release();
+ return AVERROR_EXIT;
+ }
+
+ /* Open device. */
+ while (iter->Next(&dl) == S_OK) {
+ const char *displayName;
+ IDeckLink_GetDisplayName(dl, &displayName);
+ if (!strcmp(avctx->filename, displayName)) {
+ av_free((void *) displayName);
+ ctx->dl = dl;
+ break;
+ }
+ av_free((void *) displayName);
+ dl->Release();
+ }
+ iter->Release();
+ if (!ctx->dl) {
+ av_log(avctx, AV_LOG_ERROR, "Could not open '%s'\n", avctx->filename);
+ return AVERROR(EIO);
+ }
+
+ /* Get output device. */
+ if (ctx->dl->QueryInterface(IID_IDeckLinkOutput, (void **) &ctx->dlo) != S_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Could not open output device from '%s'\n",
+ avctx->filename);
+ ctx->dl->Release();
+ return AVERROR(EIO);
+ }
+
+ if (ctx->dlo->GetDisplayModeIterator(&ctx->itermode) != S_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Could not get Display Mode Iterator\n");
+ ctx->dl->Release();
+ return AVERROR(EIO);
+ }
+
+ /* List supported formats. */
+ if (ctx->list_formats) {
+ IDeckLinkDisplayMode *mode;
+
+ av_log(avctx, AV_LOG_INFO, "Supported formats for '%s':\n",
+ avctx->filename);
+ while (ctx->itermode->Next(&mode) == S_OK) {
+ BMDTimeValue tb_num, tb_den;
+ mode->GetFrameRate(&tb_num, &tb_den);
+ av_log(avctx, AV_LOG_INFO, "\t%ldx%ld at %d/%d fps",
+ mode->GetWidth(), mode->GetHeight(),
+ (int) tb_den, (int) tb_num);
+ switch (mode->GetFieldDominance()) {
+ case bmdLowerFieldFirst:
+ av_log(avctx, AV_LOG_INFO, " (interlaced, lower field first)"); break;
+ case bmdUpperFieldFirst:
+ av_log(avctx, AV_LOG_INFO, " (interlaced, upper field first)"); break;
+ }
+ av_log(avctx, AV_LOG_INFO, "\n");
+ mode->Release();
+ }
+
+ ctx->itermode->Release();
+ ctx->dlo->Release();
+ ctx->dl->Release();
+ return AVERROR_EXIT;
+ }
+
+ /* Setup streams. */
+ for (n = 0; n < avctx->nb_streams; n++) {
+ AVStream *st = avctx->streams[n];
+ AVCodecContext *c = st->codec;
+ if (c->codec_type == AVMEDIA_TYPE_AUDIO) {
+ if (decklink_setup_audio(avctx, st))
+ goto error;
+ } else if (c->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (decklink_setup_video(avctx, st))
+ goto error;
+ } else {
+ av_log(avctx, AV_LOG_ERROR, "Unsupported stream type.\n");
+ goto error;
+ }
+ }
+ ctx->itermode->Release();
+
+ return 0;
+
+error:
+
+ ctx->dlo->Release();
+ ctx->dl->Release();
+
+ return AVERROR(EIO);
+}
+
+int ff_decklink_write_packet(AVFormatContext *avctx, AVPacket *pkt)
+{
+ struct decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
+ struct decklink_ctx *ctx = (struct decklink_ctx *) cctx->ctx;
+ AVStream *st = avctx->streams[pkt->stream_index];
+
+ ctx->last_pts = FFMAX(ctx->last_pts, pkt->pts);
+
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
+ return decklink_write_video_packet(avctx, pkt);
+ else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
+ return decklink_write_audio_packet(avctx, pkt);
+
+ return AVERROR(EIO);
+}
+
+} /* extern "C" */
diff --git a/chromium/third_party/ffmpeg/libavdevice/decklink_enc.h b/chromium/third_party/ffmpeg/libavdevice/decklink_enc.h
new file mode 100644
index 00000000000..0b9ad8f79ee
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavdevice/decklink_enc.h
@@ -0,0 +1,43 @@
+/*
+ * Blackmagic DeckLink output
+ * Copyright (c) 2013-2014 Ramiro Polla
+ *
+ * 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
+ */
+
+struct decklink_cctx {
+ const AVClass *cclass;
+
+ void *ctx;
+
+ /* Options */
+ int list_devices;
+ int list_formats;
+ double preroll;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int ff_decklink_write_header(AVFormatContext *avctx);
+int ff_decklink_write_packet(AVFormatContext *avctx, AVPacket *pkt);
+int ff_decklink_write_trailer(AVFormatContext *avctx);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
diff --git a/chromium/third_party/ffmpeg/libavdevice/decklink_enc_c.c b/chromium/third_party/ffmpeg/libavdevice/decklink_enc_c.c
new file mode 100644
index 00000000000..7c1804376ae
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavdevice/decklink_enc_c.c
@@ -0,0 +1,56 @@
+/*
+ * Blackmagic DeckLink output
+ * Copyright (c) 2013-2014 Ramiro Polla
+ *
+ * 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 "libavformat/avformat.h"
+#include "libavutil/opt.h"
+
+#include "decklink_enc.h"
+
+#define OFFSET(x) offsetof(struct decklink_cctx, x)
+#define ENC AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "list_devices", "list available devices" , OFFSET(list_devices), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, ENC },
+ { "list_formats", "list supported formats" , OFFSET(list_formats), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, ENC },
+ { "preroll" , "video preroll in seconds", OFFSET(preroll ), AV_OPT_TYPE_DOUBLE, { .dbl = 0.5 }, 0, 5, ENC },
+ { NULL },
+};
+
+static const AVClass decklink_muxer_class = {
+ .class_name = "Blackmagic DeckLink muxer",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
+};
+
+AVOutputFormat ff_decklink_muxer = {
+ .name = "decklink",
+ .long_name = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink output"),
+ .audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .subtitle_codec = AV_CODEC_ID_NONE,
+ .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
+ .priv_class = &decklink_muxer_class,
+ .priv_data_size = sizeof(struct decklink_cctx),
+ .write_header = ff_decklink_write_header,
+ .write_packet = ff_decklink_write_packet,
+ .write_trailer = ff_decklink_write_trailer,
+};
diff --git a/chromium/third_party/ffmpeg/libavdevice/dshow.c b/chromium/third_party/ffmpeg/libavdevice/dshow.c
index 37efabe52ac..adf36a7b32c 100644
--- a/chromium/third_party/ffmpeg/libavdevice/dshow.c
+++ b/chromium/third_party/ffmpeg/libavdevice/dshow.c
@@ -53,7 +53,7 @@ struct dshow_ctx {
int eof;
- int64_t curbufsize;
+ int64_t curbufsize[2];
unsigned int video_frame_num;
IMediaControl *control;
@@ -89,7 +89,7 @@ static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount)
case 24:
return AV_PIX_FMT_BGR24;
case 32:
- return AV_PIX_FMT_RGB32;
+ return AV_PIX_FMT_0RGB32;
}
}
return avpriv_find_pix_fmt(ff_raw_pix_fmt_tags, biCompression); // all others
@@ -180,16 +180,16 @@ static char *dup_wchar_to_utf8(wchar_t *w)
return s;
}
-static int shall_we_drop(AVFormatContext *s)
+static int shall_we_drop(AVFormatContext *s, int index, enum dshowDeviceType devtype)
{
struct dshow_ctx *ctx = s->priv_data;
static const uint8_t dropscore[] = {62, 75, 87, 100};
const int ndropscores = FF_ARRAY_ELEMS(dropscore);
- unsigned int buffer_fullness = (ctx->curbufsize*100)/s->max_picture_buffer;
+ unsigned int buffer_fullness = (ctx->curbufsize[index]*100)/s->max_picture_buffer;
if(dropscore[++ctx->video_frame_num%ndropscores] <= buffer_fullness) {
av_log(s, AV_LOG_ERROR,
- "real-time buffer %d%% full! frame dropped!\n", buffer_fullness);
+ "real-time buffer[%s] too full (%d%% of size: %d)! frame dropped!\n", ctx->device_name[devtype], buffer_fullness, s->max_picture_buffer);
return 1;
}
@@ -197,7 +197,7 @@ static int shall_we_drop(AVFormatContext *s)
}
static void
-callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time)
+callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType devtype)
{
AVFormatContext *s = priv_data;
struct dshow_ctx *ctx = s->priv_data;
@@ -207,7 +207,7 @@ callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time)
WaitForSingleObject(ctx->mutex, INFINITE);
- if(shall_we_drop(s))
+ if(shall_we_drop(s, index, devtype))
goto fail;
pktl_next = av_mallocz(sizeof(AVPacketList));
@@ -225,8 +225,7 @@ callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time)
for(ppktl = &ctx->pktl ; *ppktl ; ppktl = &(*ppktl)->next);
*ppktl = pktl_next;
-
- ctx->curbufsize += buf_size;
+ ctx->curbufsize[index] += buf_size;
SetEvent(ctx->event[1]);
ReleaseMutex(ctx->mutex);
@@ -580,8 +579,9 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
}
}
if (devtype == AudioDevice && ctx->audio_buffer_size) {
- if (dshow_set_audio_buffer_size(avctx, pin) < 0)
- goto next;
+ if (dshow_set_audio_buffer_size(avctx, pin) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "unable to set audio buffer size %d to pin, using pin anyway...", ctx->audio_buffer_size);
+ }
}
if (IPin_EnumMediaTypes(pin, &types) != S_OK)
@@ -773,6 +773,7 @@ dshow_add_device(AVFormatContext *avctx,
codec->codec_type = AVMEDIA_TYPE_VIDEO;
codec->width = bih->biWidth;
codec->height = bih->biHeight;
+ codec->codec_tag = bih->biCompression;
codec->pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount);
if (bih->biCompression == MKTAG('H', 'D', 'Y', 'C')) {
av_log(avctx, AV_LOG_DEBUG, "attempt to use full range for HDYC...\n");
@@ -943,7 +944,8 @@ static int dshow_read_header(AVFormatContext *avctx)
goto error;
}
}
-
+ ctx->curbufsize[0] = 0;
+ ctx->curbufsize[1] = 0;
ctx->mutex = CreateMutex(NULL, 0, NULL);
if (!ctx->mutex) {
av_log(avctx, AV_LOG_ERROR, "Could not create Mutex\n");
@@ -1037,7 +1039,7 @@ static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
*pkt = pktl->pkt;
ctx->pktl = ctx->pktl->next;
av_free(pktl);
- ctx->curbufsize -= pkt->size;
+ ctx->curbufsize[pkt->stream_index] -= pkt->size;
}
ResetEvent(ctx->event[1]);
ReleaseMutex(ctx->mutex);
@@ -1059,7 +1061,7 @@ static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
#define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
{ "video_size", "set video size given a string such as 640x480 or hd720.", OFFSET(requested_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC },
- { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_NONE}, -1, AV_PIX_FMT_NB-1, DEC },
+ { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_NONE}, -1, INT_MAX, DEC },
{ "framerate", "set video frame rate", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "sample_rate", "set audio sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, DEC },
{ "sample_size", "set audio sample size", OFFSET(sample_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 16, DEC },
@@ -1081,6 +1083,7 @@ static const AVClass dshow_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
AVInputFormat ff_dshow_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/dshow_capture.h b/chromium/third_party/ffmpeg/libavdevice/dshow_capture.h
index aff5019b308..e4b4dce3fa5 100644
--- a/chromium/third_party/ffmpeg/libavdevice/dshow_capture.h
+++ b/chromium/third_party/ffmpeg/libavdevice/dshow_capture.h
@@ -254,7 +254,7 @@ struct libAVFilter {
void *priv_data;
int stream_index;
int64_t start_time;
- void (*callback)(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time);
+ void (*callback)(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType type);
};
long WINAPI libAVFilter_QueryInterface (libAVFilter *, const GUID *, void **);
diff --git a/chromium/third_party/ffmpeg/libavdevice/dshow_enummediatypes.c b/chromium/third_party/ffmpeg/libavdevice/dshow_enummediatypes.c
index aaed58b4492..5b69a5b7429 100644
--- a/chromium/third_party/ffmpeg/libavdevice/dshow_enummediatypes.c
+++ b/chromium/third_party/ffmpeg/libavdevice/dshow_enummediatypes.c
@@ -22,7 +22,7 @@
#include "dshow_capture.h"
DECLARE_QUERYINTERFACE(libAVEnumMediaTypes,
- { {&IID_IUnknown,0}, {&IID_IEnumPins,0} })
+ { {&IID_IUnknown,0}, {&IID_IEnumMediaTypes,0} })
DECLARE_ADDREF(libAVEnumMediaTypes)
DECLARE_RELEASE(libAVEnumMediaTypes)
@@ -82,7 +82,7 @@ libAVEnumMediaTypes_Clone(libAVEnumMediaTypes *this, libAVEnumMediaTypes **enums
static int
libAVEnumMediaTypes_Setup(libAVEnumMediaTypes *this, const AM_MEDIA_TYPE *type)
{
- IEnumPinsVtbl *vtbl = this->vtbl;
+ IEnumMediaTypesVtbl *vtbl = this->vtbl;
SETVTBL(vtbl, libAVEnumMediaTypes, QueryInterface);
SETVTBL(vtbl, libAVEnumMediaTypes, AddRef);
SETVTBL(vtbl, libAVEnumMediaTypes, Release);
diff --git a/chromium/third_party/ffmpeg/libavdevice/dshow_pin.c b/chromium/third_party/ffmpeg/libavdevice/dshow_pin.c
index 30e4d9585c9..1c0dca24099 100644
--- a/chromium/third_party/ffmpeg/libavdevice/dshow_pin.c
+++ b/chromium/third_party/ffmpeg/libavdevice/dshow_pin.c
@@ -328,7 +328,7 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
priv_data = pin->filter->priv_data;
index = pin->filter->stream_index;
- pin->filter->callback(priv_data, index, buf, buf_size, curtime);
+ pin->filter->callback(priv_data, index, buf, buf_size, curtime, devtype);
return S_OK;
}
diff --git a/chromium/third_party/ffmpeg/libavdevice/dv1394.c b/chromium/third_party/ffmpeg/libavdevice/dv1394.c
index 0af5ea53c7c..c8241e33f22 100644
--- a/chromium/third_party/ffmpeg/libavdevice/dv1394.c
+++ b/chromium/third_party/ffmpeg/libavdevice/dv1394.c
@@ -224,6 +224,7 @@ static const AVClass dv1394_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
AVInputFormat ff_dv1394_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/fbdev_common.c b/chromium/third_party/ffmpeg/libavdevice/fbdev_common.c
index 45ae08b6983..634780d5880 100644
--- a/chromium/third_party/ffmpeg/libavdevice/fbdev_common.c
+++ b/chromium/third_party/ffmpeg/libavdevice/fbdev_common.c
@@ -20,9 +20,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
#include <stdlib.h>
#include "fbdev_common.h"
#include "libavutil/common.h"
+#include "avdevice.h"
struct rgb_pixfmt_map_entry {
int bits_per_pixel;
@@ -65,3 +69,61 @@ const char* ff_fbdev_default_device()
return dev;
}
+int ff_fbdev_get_device_list(AVDeviceInfoList *device_list)
+{
+ struct fb_var_screeninfo varinfo;
+ struct fb_fix_screeninfo fixinfo;
+ char device_file[12];
+ AVDeviceInfo *device = NULL;
+ int i, fd, ret = 0;
+ const char *default_device = ff_fbdev_default_device();
+
+ if (!device_list)
+ return AVERROR(EINVAL);
+
+ for (i = 0; i <= 31; i++) {
+ snprintf(device_file, sizeof(device_file), "/dev/fb%d", i);
+
+ if ((fd = avpriv_open(device_file, O_RDWR)) < 0)
+ continue;
+ if (ioctl(fd, FBIOGET_VSCREENINFO, &varinfo) == -1)
+ goto fail_device;
+ if (ioctl(fd, FBIOGET_FSCREENINFO, &fixinfo) == -1)
+ goto fail_device;
+
+ device = av_mallocz(sizeof(AVDeviceInfo));
+ if (!device) {
+ ret = AVERROR(ENOMEM);
+ goto fail_device;
+ }
+ device->device_name = av_strdup(device_file);
+ device->device_description = av_strdup(fixinfo.id);
+ if (!device->device_name || !device->device_description) {
+ ret = AVERROR(ENOMEM);
+ goto fail_device;
+ }
+
+ if ((ret = av_dynarray_add_nofree(&device_list->devices,
+ &device_list->nb_devices, device)) < 0)
+ goto fail_device;
+
+ if (default_device && !strcmp(device->device_name, default_device)) {
+ device_list->default_device = device_list->nb_devices - 1;
+ default_device = NULL;
+ }
+ close(fd);
+ continue;
+
+ fail_device:
+ if (device) {
+ av_free(device->device_name);
+ av_free(device->device_description);
+ av_freep(&device);
+ }
+ if (fd >= 0)
+ close(fd);
+ if (ret < 0)
+ return ret;
+ }
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavdevice/fbdev_common.h b/chromium/third_party/ffmpeg/libavdevice/fbdev_common.h
index 40a1ded847c..7b81a8daeb9 100644
--- a/chromium/third_party/ffmpeg/libavdevice/fbdev_common.h
+++ b/chromium/third_party/ffmpeg/libavdevice/fbdev_common.h
@@ -27,8 +27,12 @@
#include <linux/fb.h>
#include "libavutil/pixfmt.h"
+struct AVDeviceInfoList;
+
enum AVPixelFormat ff_get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo);
const char* ff_fbdev_default_device(void);
+int ff_fbdev_get_device_list(struct AVDeviceInfoList *device_list);
+
#endif /* AVDEVICE_FBDEV_COMMON_H */
diff --git a/chromium/third_party/ffmpeg/libavdevice/fbdev_dec.c b/chromium/third_party/ffmpeg/libavdevice/fbdev_dec.c
index 14ebab35c92..d53b9e591b9 100644
--- a/chromium/third_party/ffmpeg/libavdevice/fbdev_dec.c
+++ b/chromium/third_party/ffmpeg/libavdevice/fbdev_dec.c
@@ -205,6 +205,11 @@ static av_cold int fbdev_read_close(AVFormatContext *avctx)
return 0;
}
+static int fbdev_get_device_list(AVFormatContext *s, AVDeviceInfoList *device_list)
+{
+ return ff_fbdev_get_device_list(device_list);
+}
+
#define OFFSET(x) offsetof(FBDevContext, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
@@ -217,6 +222,7 @@ static const AVClass fbdev_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
AVInputFormat ff_fbdev_demuxer = {
@@ -226,6 +232,7 @@ AVInputFormat ff_fbdev_demuxer = {
.read_header = fbdev_read_header,
.read_packet = fbdev_read_packet,
.read_close = fbdev_read_close,
+ .get_device_list = fbdev_get_device_list,
.flags = AVFMT_NOFILE,
.priv_class = &fbdev_class,
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/fbdev_enc.c b/chromium/third_party/ffmpeg/libavdevice/fbdev_enc.c
index 8291b597596..28efc7131b6 100644
--- a/chromium/third_party/ffmpeg/libavdevice/fbdev_enc.c
+++ b/chromium/third_party/ffmpeg/libavdevice/fbdev_enc.c
@@ -29,6 +29,7 @@
#include "libavutil/opt.h"
#include "libavformat/avformat.h"
#include "fbdev_common.h"
+#include "avdevice.h"
typedef struct {
AVClass *class; ///< class for private options
@@ -183,6 +184,11 @@ static av_cold int fbdev_write_trailer(AVFormatContext *h)
return 0;
}
+static int fbdev_get_device_list(AVFormatContext *s, AVDeviceInfoList *device_list)
+{
+ return ff_fbdev_get_device_list(device_list);
+}
+
#define OFFSET(x) offsetof(FBDevContext, x)
#define ENC AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
@@ -196,6 +202,7 @@ static const AVClass fbdev_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
AVOutputFormat ff_fbdev_muxer = {
@@ -207,6 +214,7 @@ AVOutputFormat ff_fbdev_muxer = {
.write_header = fbdev_write_header,
.write_packet = fbdev_write_packet,
.write_trailer = fbdev_write_trailer,
+ .get_device_list = fbdev_get_device_list,
.flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
.priv_class = &fbdev_class,
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/gdigrab.c b/chromium/third_party/ffmpeg/libavdevice/gdigrab.c
new file mode 100644
index 00000000000..bccfef2c87f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavdevice/gdigrab.c
@@ -0,0 +1,630 @@
+/*
+ * GDI video grab interface
+ *
+ * This file is part of FFmpeg.
+ *
+ * Copyright (C) 2013 Calvin Walton <calvin.walton@kepstin.ca>
+ * Copyright (C) 2007-2010 Christophe Gisquet <word1.word2@gmail.com>
+ *
+ * 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
+ * GDI frame device demuxer
+ * @author Calvin Walton <calvin.walton@kepstin.ca>
+ * @author Christophe Gisquet <word1.word2@gmail.com>
+ */
+
+#include "config.h"
+#include "libavformat/internal.h"
+#include "libavutil/opt.h"
+#include "libavutil/time.h"
+#include <windows.h>
+
+/**
+ * GDI Device Demuxer context
+ */
+struct gdigrab {
+ const AVClass *class; /**< Class for private options */
+
+ int frame_size; /**< Size in bytes of the frame pixel data */
+ int header_size; /**< Size in bytes of the DIB header */
+ AVRational time_base; /**< Time base */
+ int64_t time_frame; /**< Current time */
+
+ int draw_mouse; /**< Draw mouse cursor (private option) */
+ int show_region; /**< Draw border (private option) */
+ AVRational framerate; /**< Capture framerate (private option) */
+ int width; /**< Width of the grab frame (private option) */
+ int height; /**< Height of the grab frame (private option) */
+ int offset_x; /**< Capture x offset (private option) */
+ int offset_y; /**< Capture y offset (private option) */
+
+ HWND hwnd; /**< Handle of the window for the grab */
+ HDC source_hdc; /**< Source device context */
+ HDC dest_hdc; /**< Destination, source-compatible DC */
+ BITMAPINFO bmi; /**< Information describing DIB format */
+ HBITMAP hbmp; /**< Information on the bitmap captured */
+ void *buffer; /**< The buffer containing the bitmap image data */
+ RECT clip_rect; /**< The subarea of the screen or window to clip */
+
+ HWND region_hwnd; /**< Handle of the region border window */
+
+ int cursor_error_printed;
+};
+
+#define WIN32_API_ERROR(str) \
+ av_log(s1, AV_LOG_ERROR, str " (error %li)\n", GetLastError())
+
+#define REGION_WND_BORDER 3
+
+/**
+ * Callback to handle Windows messages for the region outline window.
+ *
+ * In particular, this handles painting the frame rectangle.
+ *
+ * @param hwnd The region outline window handle.
+ * @param msg The Windows message.
+ * @param wparam First Windows message parameter.
+ * @param lparam Second Windows message parameter.
+ * @return 0 success, !0 failure
+ */
+static LRESULT CALLBACK
+gdigrab_region_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+ PAINTSTRUCT ps;
+ HDC hdc;
+ RECT rect;
+
+ switch (msg) {
+ case WM_PAINT:
+ hdc = BeginPaint(hwnd, &ps);
+
+ GetClientRect(hwnd, &rect);
+ FrameRect(hdc, &rect, GetStockObject(BLACK_BRUSH));
+
+ rect.left++; rect.top++; rect.right--; rect.bottom--;
+ FrameRect(hdc, &rect, GetStockObject(WHITE_BRUSH));
+
+ rect.left++; rect.top++; rect.right--; rect.bottom--;
+ FrameRect(hdc, &rect, GetStockObject(BLACK_BRUSH));
+
+ EndPaint(hwnd, &ps);
+ break;
+ default:
+ return DefWindowProc(hwnd, msg, wparam, lparam);
+ }
+ return 0;
+}
+
+/**
+ * Initialize the region outline window.
+ *
+ * @param s1 The format context.
+ * @param gdigrab gdigrab context.
+ * @return 0 success, !0 failure
+ */
+static int
+gdigrab_region_wnd_init(AVFormatContext *s1, struct gdigrab *gdigrab)
+{
+ HWND hwnd;
+ RECT rect = gdigrab->clip_rect;
+ HRGN region = NULL;
+ HRGN region_interior = NULL;
+
+ DWORD style = WS_POPUP | WS_VISIBLE;
+ DWORD ex = WS_EX_TOOLWINDOW | WS_EX_TOPMOST | WS_EX_TRANSPARENT;
+
+ rect.left -= REGION_WND_BORDER; rect.top -= REGION_WND_BORDER;
+ rect.right += REGION_WND_BORDER; rect.bottom += REGION_WND_BORDER;
+
+ AdjustWindowRectEx(&rect, style, FALSE, ex);
+
+ // Create a window with no owner; use WC_DIALOG instead of writing a custom
+ // window class
+ hwnd = CreateWindowEx(ex, WC_DIALOG, NULL, style, rect.left, rect.top,
+ rect.right - rect.left, rect.bottom - rect.top,
+ NULL, NULL, NULL, NULL);
+ if (!hwnd) {
+ WIN32_API_ERROR("Could not create region display window");
+ goto error;
+ }
+
+ // Set the window shape to only include the border area
+ GetClientRect(hwnd, &rect);
+ region = CreateRectRgn(0, 0,
+ rect.right - rect.left, rect.bottom - rect.top);
+ region_interior = CreateRectRgn(REGION_WND_BORDER, REGION_WND_BORDER,
+ rect.right - rect.left - REGION_WND_BORDER,
+ rect.bottom - rect.top - REGION_WND_BORDER);
+ CombineRgn(region, region, region_interior, RGN_DIFF);
+ if (!SetWindowRgn(hwnd, region, FALSE)) {
+ WIN32_API_ERROR("Could not set window region");
+ goto error;
+ }
+ // The "region" memory is now owned by the window
+ region = NULL;
+ DeleteObject(region_interior);
+
+ SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) gdigrab_region_wnd_proc);
+
+ ShowWindow(hwnd, SW_SHOW);
+
+ gdigrab->region_hwnd = hwnd;
+
+ return 0;
+
+error:
+ if (region)
+ DeleteObject(region);
+ if (region_interior)
+ DeleteObject(region_interior);
+ if (hwnd)
+ DestroyWindow(hwnd);
+ return 1;
+}
+
+/**
+ * Cleanup/free the region outline window.
+ *
+ * @param s1 The format context.
+ * @param gdigrab gdigrab context.
+ */
+static void
+gdigrab_region_wnd_destroy(AVFormatContext *s1, struct gdigrab *gdigrab)
+{
+ if (gdigrab->region_hwnd)
+ DestroyWindow(gdigrab->region_hwnd);
+ gdigrab->region_hwnd = NULL;
+}
+
+/**
+ * Process the Windows message queue.
+ *
+ * This is important to prevent Windows from thinking the window has become
+ * unresponsive. As well, things like WM_PAINT (to actually draw the window
+ * contents) are handled from the message queue context.
+ *
+ * @param s1 The format context.
+ * @param gdigrab gdigrab context.
+ */
+static void
+gdigrab_region_wnd_update(AVFormatContext *s1, struct gdigrab *gdigrab)
+{
+ HWND hwnd = gdigrab->region_hwnd;
+ MSG msg;
+
+ while (PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE)) {
+ DispatchMessage(&msg);
+ }
+}
+
+/**
+ * Initializes the gdi grab device demuxer (public device demuxer API).
+ *
+ * @param s1 Context from avformat core
+ * @return AVERROR_IO error, 0 success
+ */
+static int
+gdigrab_read_header(AVFormatContext *s1)
+{
+ struct gdigrab *gdigrab = s1->priv_data;
+
+ HWND hwnd;
+ HDC source_hdc = NULL;
+ HDC dest_hdc = NULL;
+ BITMAPINFO bmi;
+ HBITMAP hbmp = NULL;
+ void *buffer = NULL;
+
+ const char *filename = s1->filename;
+ const char *name = NULL;
+ AVStream *st = NULL;
+
+ int bpp;
+ RECT virtual_rect;
+ RECT clip_rect;
+ BITMAP bmp;
+ int ret;
+
+ if (!strncmp(filename, "title=", 6)) {
+ name = filename + 6;
+ hwnd = FindWindow(NULL, name);
+ if (!hwnd) {
+ av_log(s1, AV_LOG_ERROR,
+ "Can't find window '%s', aborting.\n", name);
+ ret = AVERROR(EIO);
+ goto error;
+ }
+ if (gdigrab->show_region) {
+ av_log(s1, AV_LOG_WARNING,
+ "Can't show region when grabbing a window.\n");
+ gdigrab->show_region = 0;
+ }
+ } else if (!strcmp(filename, "desktop")) {
+ hwnd = NULL;
+ } else {
+ av_log(s1, AV_LOG_ERROR,
+ "Please use \"desktop\" or \"title=<windowname>\" to specify your target.\n");
+ ret = AVERROR(EIO);
+ goto error;
+ }
+
+ if (hwnd) {
+ GetClientRect(hwnd, &virtual_rect);
+ } else {
+ virtual_rect.left = GetSystemMetrics(SM_XVIRTUALSCREEN);
+ virtual_rect.top = GetSystemMetrics(SM_YVIRTUALSCREEN);
+ virtual_rect.right = virtual_rect.left + GetSystemMetrics(SM_CXVIRTUALSCREEN);
+ virtual_rect.bottom = virtual_rect.top + GetSystemMetrics(SM_CYVIRTUALSCREEN);
+ }
+
+ /* If no width or height set, use full screen/window area */
+ if (!gdigrab->width || !gdigrab->height) {
+ clip_rect.left = virtual_rect.left;
+ clip_rect.top = virtual_rect.top;
+ clip_rect.right = virtual_rect.right;
+ clip_rect.bottom = virtual_rect.bottom;
+ } else {
+ clip_rect.left = gdigrab->offset_x;
+ clip_rect.top = gdigrab->offset_y;
+ clip_rect.right = gdigrab->width + gdigrab->offset_x;
+ clip_rect.bottom = gdigrab->height + gdigrab->offset_y;
+ }
+
+ if (clip_rect.left < virtual_rect.left ||
+ clip_rect.top < virtual_rect.top ||
+ clip_rect.right > virtual_rect.right ||
+ clip_rect.bottom > virtual_rect.bottom) {
+ av_log(s1, AV_LOG_ERROR,
+ "Capture area (%li,%li),(%li,%li) extends outside window area (%li,%li),(%li,%li)",
+ clip_rect.left, clip_rect.top,
+ clip_rect.right, clip_rect.bottom,
+ virtual_rect.left, virtual_rect.top,
+ virtual_rect.right, virtual_rect.bottom);
+ ret = AVERROR(EIO);
+ goto error;
+ }
+
+ /* This will get the device context for the selected window, or if
+ * none, the primary screen */
+ source_hdc = GetDC(hwnd);
+ if (!source_hdc) {
+ WIN32_API_ERROR("Couldn't get window device context");
+ ret = AVERROR(EIO);
+ goto error;
+ }
+ bpp = GetDeviceCaps(source_hdc, BITSPIXEL);
+
+ if (name) {
+ av_log(s1, AV_LOG_INFO,
+ "Found window %s, capturing %lix%lix%i at (%li,%li)\n",
+ name,
+ clip_rect.right - clip_rect.left,
+ clip_rect.bottom - clip_rect.top,
+ bpp, clip_rect.left, clip_rect.top);
+ } else {
+ av_log(s1, AV_LOG_INFO,
+ "Capturing whole desktop as %lix%lix%i at (%li,%li)\n",
+ clip_rect.right - clip_rect.left,
+ clip_rect.bottom - clip_rect.top,
+ bpp, clip_rect.left, clip_rect.top);
+ }
+
+ if (clip_rect.right - clip_rect.left <= 0 ||
+ clip_rect.bottom - clip_rect.top <= 0 || bpp%8) {
+ av_log(s1, AV_LOG_ERROR, "Invalid properties, aborting\n");
+ ret = AVERROR(EIO);
+ goto error;
+ }
+
+ dest_hdc = CreateCompatibleDC(source_hdc);
+ if (!dest_hdc) {
+ WIN32_API_ERROR("Screen DC CreateCompatibleDC");
+ ret = AVERROR(EIO);
+ goto error;
+ }
+
+ /* Create a DIB and select it into the dest_hdc */
+ bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmi.bmiHeader.biWidth = clip_rect.right - clip_rect.left;
+ bmi.bmiHeader.biHeight = -(clip_rect.bottom - clip_rect.top);
+ bmi.bmiHeader.biPlanes = 1;
+ bmi.bmiHeader.biBitCount = bpp;
+ bmi.bmiHeader.biCompression = BI_RGB;
+ bmi.bmiHeader.biSizeImage = 0;
+ bmi.bmiHeader.biXPelsPerMeter = 0;
+ bmi.bmiHeader.biYPelsPerMeter = 0;
+ bmi.bmiHeader.biClrUsed = 0;
+ bmi.bmiHeader.biClrImportant = 0;
+ hbmp = CreateDIBSection(dest_hdc, &bmi, DIB_RGB_COLORS,
+ &buffer, NULL, 0);
+ if (!hbmp) {
+ WIN32_API_ERROR("Creating DIB Section");
+ ret = AVERROR(EIO);
+ goto error;
+ }
+
+ if (!SelectObject(dest_hdc, hbmp)) {
+ WIN32_API_ERROR("SelectObject");
+ ret = AVERROR(EIO);
+ goto error;
+ }
+
+ /* Get info from the bitmap */
+ GetObject(hbmp, sizeof(BITMAP), &bmp);
+
+ st = avformat_new_stream(s1, NULL);
+ if (!st) {
+ ret = AVERROR(ENOMEM);
+ goto error;
+ }
+ avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
+
+ gdigrab->frame_size = bmp.bmWidthBytes * bmp.bmHeight * bmp.bmPlanes;
+ gdigrab->header_size = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) +
+ (bpp <= 8 ? (1 << bpp) : 0) * sizeof(RGBQUAD) /* palette size */;
+ gdigrab->time_base = av_inv_q(gdigrab->framerate);
+ gdigrab->time_frame = av_gettime() / av_q2d(gdigrab->time_base);
+
+ gdigrab->hwnd = hwnd;
+ gdigrab->source_hdc = source_hdc;
+ gdigrab->dest_hdc = dest_hdc;
+ gdigrab->hbmp = hbmp;
+ gdigrab->bmi = bmi;
+ gdigrab->buffer = buffer;
+ gdigrab->clip_rect = clip_rect;
+
+ gdigrab->cursor_error_printed = 0;
+
+ if (gdigrab->show_region) {
+ if (gdigrab_region_wnd_init(s1, gdigrab)) {
+ ret = AVERROR(EIO);
+ goto error;
+ }
+ }
+
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ st->codec->codec_id = AV_CODEC_ID_BMP;
+ st->codec->time_base = gdigrab->time_base;
+ st->codec->bit_rate = (gdigrab->header_size + gdigrab->frame_size) * 1/av_q2d(gdigrab->time_base) * 8;
+
+ return 0;
+
+error:
+ if (source_hdc)
+ ReleaseDC(hwnd, source_hdc);
+ if (dest_hdc)
+ DeleteDC(dest_hdc);
+ if (hbmp)
+ DeleteObject(hbmp);
+ if (source_hdc)
+ DeleteDC(source_hdc);
+ return ret;
+}
+
+/**
+ * Paints a mouse pointer in a Win32 image.
+ *
+ * @param s1 Context of the log information
+ * @param s Current grad structure
+ */
+static void paint_mouse_pointer(AVFormatContext *s1, struct gdigrab *gdigrab)
+{
+ CURSORINFO ci = {0};
+
+#define CURSOR_ERROR(str) \
+ if (!gdigrab->cursor_error_printed) { \
+ WIN32_API_ERROR(str); \
+ gdigrab->cursor_error_printed = 1; \
+ }
+
+ ci.cbSize = sizeof(ci);
+
+ if (GetCursorInfo(&ci)) {
+ HCURSOR icon = CopyCursor(ci.hCursor);
+ ICONINFO info;
+ POINT pos;
+ RECT clip_rect = gdigrab->clip_rect;
+ HWND hwnd = gdigrab->hwnd;
+
+ if (ci.flags != CURSOR_SHOWING)
+ return;
+
+ if (!icon) {
+ /* Use the standard arrow cursor as a fallback.
+ * You'll probably only hit this in Wine, which can't fetch
+ * the current system cursor. */
+ icon = CopyCursor(LoadCursor(NULL, IDC_ARROW));
+ }
+
+ if (!GetIconInfo(icon, &info)) {
+ CURSOR_ERROR("Could not get icon info");
+ goto icon_error;
+ }
+
+ pos.x = ci.ptScreenPos.x - clip_rect.left - info.xHotspot;
+ pos.y = ci.ptScreenPos.y - clip_rect.top - info.yHotspot;
+
+ if (hwnd) {
+ RECT rect;
+
+ if (GetWindowRect(hwnd, &rect)) {
+ pos.x -= rect.left;
+ pos.y -= rect.top;
+ } else {
+ CURSOR_ERROR("Couldn't get window rectangle");
+ goto icon_error;
+ }
+ }
+
+ av_log(s1, AV_LOG_DEBUG, "Cursor pos (%li,%li) -> (%li,%li)\n",
+ ci.ptScreenPos.x, ci.ptScreenPos.y, pos.x, pos.y);
+
+ if (pos.x >= 0 && pos.x <= clip_rect.right - clip_rect.left &&
+ pos.y >= 0 && pos.y <= clip_rect.bottom - clip_rect.top) {
+ if (!DrawIcon(gdigrab->dest_hdc, pos.x, pos.y, icon))
+ CURSOR_ERROR("Couldn't draw icon");
+ }
+
+icon_error:
+ if (icon)
+ DestroyCursor(icon);
+ } else {
+ CURSOR_ERROR("Couldn't get cursor info");
+ }
+}
+
+/**
+ * Grabs a frame from gdi (public device demuxer API).
+ *
+ * @param s1 Context from avformat core
+ * @param pkt Packet holding the grabbed frame
+ * @return frame size in bytes
+ */
+static int gdigrab_read_packet(AVFormatContext *s1, AVPacket *pkt)
+{
+ struct gdigrab *gdigrab = s1->priv_data;
+
+ HDC dest_hdc = gdigrab->dest_hdc;
+ HDC source_hdc = gdigrab->source_hdc;
+ RECT clip_rect = gdigrab->clip_rect;
+ AVRational time_base = gdigrab->time_base;
+ int64_t time_frame = gdigrab->time_frame;
+
+ BITMAPFILEHEADER bfh;
+ int file_size = gdigrab->header_size + gdigrab->frame_size;
+
+ int64_t curtime, delay;
+
+ /* Calculate the time of the next frame */
+ time_frame += INT64_C(1000000);
+
+ /* Run Window message processing queue */
+ if (gdigrab->show_region)
+ gdigrab_region_wnd_update(s1, gdigrab);
+
+ /* wait based on the frame rate */
+ for (;;) {
+ curtime = av_gettime();
+ delay = time_frame * av_q2d(time_base) - curtime;
+ if (delay <= 0) {
+ if (delay < INT64_C(-1000000) * av_q2d(time_base)) {
+ time_frame += INT64_C(1000000);
+ }
+ break;
+ }
+ if (s1->flags & AVFMT_FLAG_NONBLOCK) {
+ return AVERROR(EAGAIN);
+ } else {
+ av_usleep(delay);
+ }
+ }
+
+ if (av_new_packet(pkt, file_size) < 0)
+ return AVERROR(ENOMEM);
+ pkt->pts = curtime;
+
+ /* Blit screen grab */
+ if (!BitBlt(dest_hdc, 0, 0,
+ clip_rect.right - clip_rect.left,
+ clip_rect.bottom - clip_rect.top,
+ source_hdc,
+ clip_rect.left, clip_rect.top, SRCCOPY | CAPTUREBLT)) {
+ WIN32_API_ERROR("Failed to capture image");
+ return AVERROR(EIO);
+ }
+ if (gdigrab->draw_mouse)
+ paint_mouse_pointer(s1, gdigrab);
+
+ /* Copy bits to packet data */
+
+ bfh.bfType = 0x4d42; /* "BM" in little-endian */
+ bfh.bfSize = file_size;
+ bfh.bfReserved1 = 0;
+ bfh.bfReserved2 = 0;
+ bfh.bfOffBits = gdigrab->header_size;
+
+ memcpy(pkt->data, &bfh, sizeof(bfh));
+
+ memcpy(pkt->data + sizeof(bfh), &gdigrab->bmi.bmiHeader, sizeof(gdigrab->bmi.bmiHeader));
+
+ if (gdigrab->bmi.bmiHeader.biBitCount <= 8)
+ GetDIBColorTable(dest_hdc, 0, 1 << gdigrab->bmi.bmiHeader.biBitCount,
+ (RGBQUAD *) (pkt->data + sizeof(bfh) + sizeof(gdigrab->bmi.bmiHeader)));
+
+ memcpy(pkt->data + gdigrab->header_size, gdigrab->buffer, gdigrab->frame_size);
+
+ gdigrab->time_frame = time_frame;
+
+ return gdigrab->header_size + gdigrab->frame_size;
+}
+
+/**
+ * Closes gdi frame grabber (public device demuxer API).
+ *
+ * @param s1 Context from avformat core
+ * @return 0 success, !0 failure
+ */
+static int gdigrab_read_close(AVFormatContext *s1)
+{
+ struct gdigrab *s = s1->priv_data;
+
+ if (s->show_region)
+ gdigrab_region_wnd_destroy(s1, s);
+
+ if (s->source_hdc)
+ ReleaseDC(s->hwnd, s->source_hdc);
+ if (s->dest_hdc)
+ DeleteDC(s->dest_hdc);
+ if (s->hbmp)
+ DeleteObject(s->hbmp);
+ if (s->source_hdc)
+ DeleteDC(s->source_hdc);
+
+ return 0;
+}
+
+#define OFFSET(x) offsetof(struct gdigrab, x)
+#define DEC AV_OPT_FLAG_DECODING_PARAM
+static const AVOption options[] = {
+ { "draw_mouse", "draw the mouse pointer", OFFSET(draw_mouse), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, DEC },
+ { "show_region", "draw border around capture area", OFFSET(show_region), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
+ { "framerate", "set video frame rate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "ntsc"}, 0, 0, DEC },
+ { "video_size", "set video frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC },
+ { "offset_x", "capture area x offset", OFFSET(offset_x), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC },
+ { "offset_y", "capture area y offset", OFFSET(offset_y), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC },
+ { NULL },
+};
+
+static const AVClass gdigrab_class = {
+ .class_name = "GDIgrab indev",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+/** gdi grabber device demuxer declaration */
+AVInputFormat ff_gdigrab_demuxer = {
+ .name = "gdigrab",
+ .long_name = NULL_IF_CONFIG_SMALL("GDI API Windows frame grabber"),
+ .priv_data_size = sizeof(struct gdigrab),
+ .read_header = gdigrab_read_header,
+ .read_packet = gdigrab_read_packet,
+ .read_close = gdigrab_read_close,
+ .flags = AVFMT_NOFILE,
+ .priv_class = &gdigrab_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavdevice/iec61883.c b/chromium/third_party/ffmpeg/libavdevice/iec61883.c
index a63566e9d4e..401c3dd563a 100644
--- a/chromium/third_party/ffmpeg/libavdevice/iec61883.c
+++ b/chromium/third_party/ffmpeg/libavdevice/iec61883.c
@@ -102,7 +102,7 @@ static int iec61883_callback(unsigned char *data, int length,
DVPacket *packet;
int ret;
-#ifdef THREADS
+#if THREADS
pthread_mutex_lock(&dv->mutex);
#endif
@@ -139,7 +139,7 @@ static int iec61883_callback(unsigned char *data, int length,
ret = 0;
exit:
-#ifdef THREADS
+#if THREADS
pthread_cond_broadcast(&dv->cond);
pthread_mutex_unlock(&dv->mutex);
#endif
@@ -151,7 +151,7 @@ static void *iec61883_receive_task(void *opaque)
struct iec61883_data *dv = (struct iec61883_data *)opaque;
int result;
-#ifdef THREADS
+#if THREADS
while (dv->thread_loop)
#endif
{
@@ -168,7 +168,7 @@ static void *iec61883_receive_task(void *opaque)
raw1394_loop_iterate(dv->raw1394);
} else if (dv->receiving) {
av_log(NULL, AV_LOG_ERROR, "No more input data available\n");
-#ifdef THREADS
+#if THREADS
pthread_mutex_lock(&dv->mutex);
dv->eof = 1;
pthread_cond_broadcast(&dv->cond);
@@ -413,7 +413,7 @@ static int iec61883_read_packet(AVFormatContext *context, AVPacket *pkt)
* Try to parse frames from queue
*/
-#ifdef THREADS
+#if THREADS
pthread_mutex_lock(&dv->mutex);
while ((size = dv->parse_queue(dv, pkt)) == -1)
if (!dv->eof)
@@ -483,6 +483,7 @@ static const AVClass iec61883_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
AVInputFormat ff_iec61883_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/jack_audio.c b/chromium/third_party/ffmpeg/libavdevice/jack_audio.c
index 5ba67316821..759ef9bcdfb 100644
--- a/chromium/third_party/ffmpeg/libavdevice/jack_audio.c
+++ b/chromium/third_party/ffmpeg/libavdevice/jack_audio.c
@@ -163,7 +163,7 @@ static int start_jack(AVFormatContext *context)
sem_init(&self->packet_count, 0, 0);
self->sample_rate = jack_get_sample_rate(self->client);
- self->ports = av_malloc(self->nports * sizeof(*self->ports));
+ self->ports = av_malloc_array(self->nports, sizeof(*self->ports));
self->buffer_size = jack_get_buffer_size(self->client);
/* Register JACK ports */
@@ -206,14 +206,14 @@ static int start_jack(AVFormatContext *context)
}
-static void free_pkt_fifo(AVFifoBuffer *fifo)
+static void free_pkt_fifo(AVFifoBuffer **fifo)
{
AVPacket pkt;
- while (av_fifo_size(fifo)) {
- av_fifo_generic_read(fifo, &pkt, sizeof(pkt), NULL);
+ while (av_fifo_size(*fifo)) {
+ av_fifo_generic_read(*fifo, &pkt, sizeof(pkt), NULL);
av_free_packet(&pkt);
}
- av_fifo_free(fifo);
+ av_fifo_freep(fifo);
}
static void stop_jack(JackData *self)
@@ -224,8 +224,8 @@ static void stop_jack(JackData *self)
jack_client_close(self->client);
}
sem_destroy(&self->packet_count);
- free_pkt_fifo(self->new_pkts);
- free_pkt_fifo(self->filled_pkts);
+ free_pkt_fifo(&self->new_pkts);
+ free_pkt_fifo(&self->filled_pkts);
av_freep(&self->ports);
ff_timefilter_destroy(self->timefilter);
}
@@ -333,6 +333,7 @@ static const AVClass jack_indev_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
AVInputFormat ff_jack_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/lavfi.c b/chromium/third_party/ffmpeg/libavdevice/lavfi.c
index a177ad0271e..1ea7ea7717e 100644
--- a/chromium/third_party/ffmpeg/libavdevice/lavfi.c
+++ b/chromium/third_party/ffmpeg/libavdevice/lavfi.c
@@ -425,6 +425,7 @@ static const AVClass lavfi_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_INPUT,
};
AVInputFormat ff_lavfi_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/libcdio.c b/chromium/third_party/ffmpeg/libavdevice/libcdio.c
index 91052cc40c9..16a4b26956a 100644
--- a/chromium/third_party/ffmpeg/libavdevice/libcdio.c
+++ b/chromium/third_party/ffmpeg/libavdevice/libcdio.c
@@ -177,6 +177,7 @@ static const AVClass libcdio_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
AVInputFormat ff_libcdio_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/libdc1394.c b/chromium/third_party/ffmpeg/libavdevice/libdc1394.c
index 80cb1bee118..e9bd4c98f2a 100644
--- a/chromium/third_party/ffmpeg/libavdevice/libdc1394.c
+++ b/chromium/third_party/ffmpeg/libavdevice/libdc1394.c
@@ -112,6 +112,7 @@ static const AVClass libdc1394_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/openal-dec.c b/chromium/third_party/ffmpeg/libavdevice/openal-dec.c
index 93633ff7d23..4c4ba28c22f 100644
--- a/chromium/third_party/ffmpeg/libavdevice/openal-dec.c
+++ b/chromium/third_party/ffmpeg/libavdevice/openal-dec.c
@@ -236,7 +236,8 @@ static const AVClass class = {
.class_name = "openal",
.item_name = av_default_item_name,
.option = options,
- .version = LIBAVUTIL_VERSION_INT
+ .version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
AVInputFormat ff_openal_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/opengl_enc.c b/chromium/third_party/ffmpeg/libavdevice/opengl_enc.c
new file mode 100644
index 00000000000..28a01181a01
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavdevice/opengl_enc.c
@@ -0,0 +1,1306 @@
+/*
+ * Copyright (c) 2014 Lukasz Marek
+ *
+ * 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
+ */
+
+//TODO: support for more formats
+//TODO: support for more systems.
+//TODO: implement X11, Windows, Mac OS native default window. SDL 1.2 doesn't allow to render to custom thread.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stddef.h>
+
+#include "config.h"
+
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+#if HAVE_OPENGL_GL3_H
+#include <OpenGL/gl3.h>
+#elif HAVE_ES2_GL_H
+#include <ES2/gl.h>
+#else
+#include <GL/gl.h>
+#include <GL/glext.h>
+#endif
+#if HAVE_GLXGETPROCADDRESS
+#include <GL/glx.h>
+#endif
+
+#if HAVE_SDL
+#include <SDL.h>
+#endif
+
+#include "libavutil/common.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/log.h"
+#include "libavutil/opt.h"
+#include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
+#include "libavformat/avformat.h"
+#include "libavformat/internal.h"
+#include "libavdevice/avdevice.h"
+#include "opengl_enc_shaders.h"
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+
+/* FF_GL_RED_COMPONENT is used for plannar pixel types.
+ * Only red component is sampled in shaders.
+ * On some platforms GL_RED is not availabe and GL_LUMINANCE have to be used,
+ * but since OpenGL 3.0 GL_LUMINANCE is deprecated.
+ * GL_RED produces RGBA = value, 0, 0, 1.
+ * GL_LUMINANCE produces RGBA = value, value, value, 1.
+ * Note: GL_INTENSITY may also be used which produce RGBA = value, value, value, value. */
+#if defined(GL_RED)
+#define FF_GL_RED_COMPONENT GL_RED
+#elif defined(GL_LUMINANCE)
+#define FF_GL_RED_COMPONENT GL_LUMINANCE
+#else
+#define FF_GL_RED_COMPONENT 0x1903; //GL_RED
+#endif
+
+/* Constants not defined for iOS */
+#define FF_GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define FF_GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define FF_GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define FF_GL_UNPACK_ROW_LENGTH 0x0CF2
+
+/* MinGW exposes only OpenGL 1.1 API */
+#define FF_GL_ARRAY_BUFFER 0x8892
+#define FF_GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define FF_GL_STATIC_DRAW 0x88E4
+#define FF_GL_FRAGMENT_SHADER 0x8B30
+#define FF_GL_VERTEX_SHADER 0x8B31
+#define FF_GL_COMPILE_STATUS 0x8B81
+#define FF_GL_LINK_STATUS 0x8B82
+#define FF_GL_INFO_LOG_LENGTH 0x8B84
+typedef void (APIENTRY *FF_PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRY *FF_PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef void (APIENTRY *FF_PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRY *FF_PFNGLBUFFERDATAPROC) (GLenum target, ptrdiff_t size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRY *FF_PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef GLint (APIENTRY *FF_PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const char *name);
+typedef void (APIENTRY *FF_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRY *FF_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uintptr_t pointer);
+typedef GLint (APIENTRY *FF_PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const char *name);
+typedef void (APIENTRY *FF_PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRY *FF_PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (APIENTRY *FF_PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef GLuint (APIENTRY *FF_PFNGLCREATEPROGRAMPROC) (void);
+typedef void (APIENTRY *FF_PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRY *FF_PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRY *FF_PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (APIENTRY *FF_PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (APIENTRY *FF_PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, char *infoLog);
+typedef void (APIENTRY *FF_PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef GLuint (APIENTRY *FF_PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (APIENTRY *FF_PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (APIENTRY *FF_PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef void (APIENTRY *FF_PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const char* *string, const GLint *length);
+typedef void (APIENTRY *FF_PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (APIENTRY *FF_PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, char *infoLog);
+
+typedef struct FFOpenGLFunctions {
+ FF_PFNGLACTIVETEXTUREPROC glActiveTexture; //Require GL ARB multitexture
+ FF_PFNGLGENBUFFERSPROC glGenBuffers; //Require GL_ARB_vertex_buffer_object
+ FF_PFNGLDELETEBUFFERSPROC glDeleteBuffers; //Require GL_ARB_vertex_buffer_object
+ FF_PFNGLBUFFERDATAPROC glBufferData; //Require GL_ARB_vertex_buffer_object
+ FF_PFNGLBINDBUFFERPROC glBindBuffer; //Require GL_ARB_vertex_buffer_object
+ FF_PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation; //Require GL_ARB_vertex_shader
+ FF_PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray; //Require GL_ARB_vertex_shader
+ FF_PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer; //Require GL_ARB_vertex_shader
+ FF_PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation; //Require GL_ARB_shader_objects
+ FF_PFNGLUNIFORM1FPROC glUniform1f; //Require GL_ARB_shader_objects
+ FF_PFNGLUNIFORM1IPROC glUniform1i; //Require GL_ARB_shader_objects
+ FF_PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv; //Require GL_ARB_shader_objects
+ FF_PFNGLCREATEPROGRAMPROC glCreateProgram; //Require GL_ARB_shader_objects
+ FF_PFNGLDELETEPROGRAMPROC glDeleteProgram; //Require GL_ARB_shader_objects
+ FF_PFNGLUSEPROGRAMPROC glUseProgram; //Require GL_ARB_shader_objects
+ FF_PFNGLLINKPROGRAMPROC glLinkProgram; //Require GL_ARB_shader_objects
+ FF_PFNGLGETPROGRAMIVPROC glGetProgramiv; //Require GL_ARB_shader_objects
+ FF_PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog; //Require GL_ARB_shader_objects
+ FF_PFNGLATTACHSHADERPROC glAttachShader; //Require GL_ARB_shader_objects
+ FF_PFNGLCREATESHADERPROC glCreateShader; //Require GL_ARB_shader_objects
+ FF_PFNGLDELETESHADERPROC glDeleteShader; //Require GL_ARB_shader_objects
+ FF_PFNGLCOMPILESHADERPROC glCompileShader; //Require GL_ARB_shader_objects
+ FF_PFNGLSHADERSOURCEPROC glShaderSource; //Require GL_ARB_shader_objects
+ FF_PFNGLGETSHADERIVPROC glGetShaderiv; //Require GL_ARB_shader_objects
+ FF_PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog; //Require GL_ARB_shader_objects
+} FFOpenGLFunctions;
+
+#define OPENGL_ERROR_CHECK(ctx) \
+{\
+ GLenum err_code; \
+ if ((err_code = glGetError()) != GL_NO_ERROR) { \
+ av_log(ctx, AV_LOG_ERROR, "OpenGL error occurred in '%s', line %d: %d\n", __FUNCTION__, __LINE__, err_code); \
+ goto fail; \
+ } \
+}\
+
+typedef struct OpenGLVertexInfo
+{
+ float x, y, z; ///<Position
+ float s0, t0; ///<Texture coords
+} OpenGLVertexInfo;
+
+/* defines 2 triangles to display */
+static GLushort g_index[6] =
+{
+ 0, 1, 2,
+ 0, 3, 2,
+};
+
+typedef struct OpenGLContext {
+ AVClass *class; ///< class for private options
+
+#if HAVE_SDL
+ SDL_Surface *surface;
+#endif
+ FFOpenGLFunctions glprocs;
+
+ int inited; ///< Set to 1 when write_header was successfully called.
+ uint8_t background[4]; ///< Background color
+ int no_window; ///< 0 for create default window
+ char *window_title; ///< Title of the window
+
+ /* OpenGL implementation limits */
+ GLint max_texture_size; ///< Maximum texture size
+ GLint max_viewport_width; ///< Maximum viewport size
+ GLint max_viewport_height; ///< Maximum viewport size
+ int non_pow_2_textures; ///< 1 when non power of 2 textures are supported
+ int unpack_subimage; ///< 1 when GL_EXT_unpack_subimage is available
+
+ /* Current OpenGL configuration */
+ GLuint program; ///< Shader program
+ GLuint vertex_shader; ///< Vertex shader
+ GLuint fragment_shader; ///< Fragment shader for current pix_pmt
+ GLuint texture_name[4]; ///< Textures' IDs
+ GLuint index_buffer; ///< Index buffer
+ GLuint vertex_buffer; ///< Vertex buffer
+ OpenGLVertexInfo vertex[4]; ///< VBO
+ GLint projection_matrix_location; ///< Uniforms' locations
+ GLint model_view_matrix_location;
+ GLint color_map_location;
+ GLint chroma_div_w_location;
+ GLint chroma_div_h_location;
+ GLint texture_location[4];
+ GLint position_attrib; ///< Attibutes' locations
+ GLint texture_coords_attrib;
+
+ GLfloat projection_matrix[16]; ///< Projection matrix
+ GLfloat model_view_matrix[16]; ///< Modev view matrix
+ GLfloat color_map[16]; ///< RGBA color map matrix
+ GLfloat chroma_div_w; ///< Chroma subsampling w ratio
+ GLfloat chroma_div_h; ///< Chroma subsampling h ratio
+
+ /* Stream information */
+ GLenum format;
+ GLenum type;
+ int width; ///< Stream width
+ int height; ///< Stream height
+ enum AVPixelFormat pix_fmt; ///< Stream pixel format
+ int picture_width; ///< Rendered width
+ int picture_height; ///< Rendered height
+ int window_width;
+ int window_height;
+} OpenGLContext;
+
+static const struct OpenGLFormatDesc {
+ enum AVPixelFormat fixel_format;
+ const char * const * fragment_shader;
+ GLenum format;
+ GLenum type;
+} opengl_format_desc[] = {
+ { AV_PIX_FMT_YUV420P, &FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_YUV444P, &FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_YUV422P, &FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_YUV410P, &FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_YUV411P, &FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_YUV440P, &FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_YUV420P16, &FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_YUV422P16, &FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_YUV444P16, &FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_YUVA420P, &FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_YUVA444P, &FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_YUVA422P, &FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_YUVA420P16, &FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_YUVA422P16, &FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_YUVA444P16, &FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_RGB24, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGB, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_BGR24, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGB, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_0RGB, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGBA, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_RGB0, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGBA, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_0BGR, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGBA, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_BGR0, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGBA, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_RGB565, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGB, GL_UNSIGNED_SHORT_5_6_5 },
+ { AV_PIX_FMT_BGR565, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGB, GL_UNSIGNED_SHORT_5_6_5 },
+ { AV_PIX_FMT_RGB555, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGBA, FF_GL_UNSIGNED_SHORT_1_5_5_5_REV },
+ { AV_PIX_FMT_BGR555, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGBA, FF_GL_UNSIGNED_SHORT_1_5_5_5_REV },
+ { AV_PIX_FMT_RGB8, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGB, FF_GL_UNSIGNED_BYTE_3_3_2 },
+ { AV_PIX_FMT_BGR8, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGB, FF_GL_UNSIGNED_BYTE_2_3_3_REV },
+ { AV_PIX_FMT_RGB48, &FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET, GL_RGB, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_ARGB, &FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET, GL_RGBA, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_RGBA, &FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET, GL_RGBA, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_ABGR, &FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET, GL_RGBA, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_BGRA, &FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET, GL_RGBA, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_RGBA64, &FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET, GL_RGBA, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_BGRA64, &FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET, GL_RGBA, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_GBRP, &FF_OPENGL_FRAGMENT_SHADER_RGB_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_GBRP16, &FF_OPENGL_FRAGMENT_SHADER_RGB_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_GBRAP, &FF_OPENGL_FRAGMENT_SHADER_RGBA_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_GBRAP16, &FF_OPENGL_FRAGMENT_SHADER_RGBA_PLANAR, FF_GL_RED_COMPONENT, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_GRAY8, &FF_OPENGL_FRAGMENT_SHADER_GRAY, FF_GL_RED_COMPONENT, GL_UNSIGNED_BYTE },
+ { AV_PIX_FMT_GRAY16, &FF_OPENGL_FRAGMENT_SHADER_GRAY, FF_GL_RED_COMPONENT, GL_UNSIGNED_SHORT },
+ { AV_PIX_FMT_NONE, NULL }
+};
+
+static av_cold int opengl_prepare_vertex(AVFormatContext *s);
+static int opengl_draw(AVFormatContext *h, void *intput, int repaint, int is_pkt);
+static av_cold int opengl_init_context(OpenGLContext *opengl);
+
+static av_cold void opengl_deinit_context(OpenGLContext *opengl)
+{
+ glDeleteTextures(4, opengl->texture_name);
+ opengl->texture_name[0] = opengl->texture_name[1] =
+ opengl->texture_name[2] = opengl->texture_name[3] = 0;
+ if (opengl->glprocs.glUseProgram)
+ opengl->glprocs.glUseProgram(0);
+ if (opengl->glprocs.glDeleteProgram) {
+ opengl->glprocs.glDeleteProgram(opengl->program);
+ opengl->program = 0;
+ }
+ if (opengl->glprocs.glDeleteShader) {
+ opengl->glprocs.glDeleteShader(opengl->vertex_shader);
+ opengl->glprocs.glDeleteShader(opengl->fragment_shader);
+ opengl->vertex_shader = opengl->fragment_shader = 0;
+ }
+ if (opengl->glprocs.glBindBuffer) {
+ opengl->glprocs.glBindBuffer(FF_GL_ARRAY_BUFFER, 0);
+ opengl->glprocs.glBindBuffer(FF_GL_ELEMENT_ARRAY_BUFFER, 0);
+ }
+ if (opengl->glprocs.glDeleteBuffers) {
+ opengl->glprocs.glDeleteBuffers(2, &opengl->index_buffer);
+ opengl->vertex_buffer = opengl->index_buffer = 0;
+ }
+}
+
+static int opengl_resize(AVFormatContext *h, int width, int height)
+{
+ int ret = 0;
+ OpenGLContext *opengl = h->priv_data;
+ opengl->window_width = width;
+ opengl->window_height = height;
+ if (opengl->inited) {
+ if (opengl->no_window &&
+ (ret = avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER, NULL , 0)) < 0) {
+ av_log(opengl, AV_LOG_ERROR, "Application failed to prepare window buffer.\n");
+ goto end;
+ }
+ if ((ret = opengl_prepare_vertex(h)) < 0)
+ goto end;
+ ret = opengl_draw(h, NULL, 1, 0);
+ }
+ end:
+ return ret;
+}
+
+static int opengl_control_message(AVFormatContext *h, int type, void *data, size_t data_size)
+{
+ OpenGLContext *opengl = h->priv_data;
+ switch(type) {
+ case AV_APP_TO_DEV_WINDOW_SIZE:
+ if (data) {
+ AVDeviceRect *message = data;
+ return opengl_resize(h, message->width, message->height);
+ }
+ return AVERROR(EINVAL);
+ case AV_APP_TO_DEV_WINDOW_REPAINT:
+ return opengl_resize(h, opengl->window_width, opengl->window_height);
+ }
+ return AVERROR(ENOSYS);
+}
+
+#if HAVE_SDL
+static int opengl_sdl_recreate_window(OpenGLContext *opengl, int width, int height)
+{
+ opengl->surface = SDL_SetVideoMode(width, height,
+ 32, SDL_OPENGL | SDL_RESIZABLE);
+ if (!opengl->surface) {
+ av_log(opengl, AV_LOG_ERROR, "Unable to set video mode: %s\n", SDL_GetError());
+ return AVERROR_EXTERNAL;
+ }
+ SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+ return 0;
+}
+
+static int opengl_sdl_process_events(AVFormatContext *h)
+{
+ int ret;
+ OpenGLContext *opengl = h->priv_data;
+ SDL_Event event;
+ SDL_PumpEvents();
+ while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_ALLEVENTS) > 0) {
+ switch (event.type) {
+ case SDL_QUIT:
+ return AVERROR(EIO);
+ case SDL_KEYDOWN:
+ switch (event.key.keysym.sym) {
+ case SDLK_ESCAPE:
+ case SDLK_q:
+ return AVERROR(EIO);
+ }
+ return 0;
+ case SDL_VIDEORESIZE: {
+ char buffer[100];
+ int reinit;
+ AVDeviceRect message;
+ /* clean up old context because SDL_SetVideoMode may lose its state. */
+ SDL_VideoDriverName(buffer, sizeof(buffer));
+ reinit = !av_strncasecmp(buffer, "quartz", sizeof(buffer));
+ if (reinit) {
+ opengl_deinit_context(opengl);
+ }
+ if ((ret = opengl_sdl_recreate_window(opengl, event.resize.w, event.resize.h)) < 0)
+ return ret;
+ if (reinit && (ret = opengl_init_context(opengl)) < 0)
+ return ret;
+ message.width = opengl->surface->w;
+ message.height = opengl->surface->h;
+ return opengl_control_message(h, AV_APP_TO_DEV_WINDOW_SIZE, &message, sizeof(AVDeviceRect));
+ }
+ }
+ }
+ return 0;
+}
+
+static int av_cold opengl_sdl_create_window(AVFormatContext *h)
+{
+ int ret;
+ char buffer[100];
+ OpenGLContext *opengl = h->priv_data;
+ AVDeviceRect message;
+ if (SDL_Init(SDL_INIT_VIDEO)) {
+ av_log(opengl, AV_LOG_ERROR, "Unable to initialize SDL: %s\n", SDL_GetError());
+ return AVERROR_EXTERNAL;
+ }
+ if ((ret = opengl_sdl_recreate_window(opengl, opengl->window_width,
+ opengl->window_height)) < 0)
+ return ret;
+ av_log(opengl, AV_LOG_INFO, "SDL driver: '%s'.\n", SDL_VideoDriverName(buffer, sizeof(buffer)));
+ message.width = opengl->surface->w;
+ message.height = opengl->surface->h;
+ SDL_WM_SetCaption(opengl->window_title, NULL);
+ opengl_control_message(h, AV_APP_TO_DEV_WINDOW_SIZE, &message, sizeof(AVDeviceRect));
+ return 0;
+}
+
+static int av_cold opengl_sdl_load_procedures(OpenGLContext *opengl)
+{
+ FFOpenGLFunctions *procs = &opengl->glprocs;
+
+#define LOAD_OPENGL_FUN(name, type) \
+ procs->name = (type)SDL_GL_GetProcAddress(#name); \
+ if (!procs->name) { \
+ av_log(opengl, AV_LOG_ERROR, "Cannot load OpenGL function: '%s'\n", #name); \
+ return AVERROR(ENOSYS); \
+ }
+
+ LOAD_OPENGL_FUN(glActiveTexture, FF_PFNGLACTIVETEXTUREPROC)
+ LOAD_OPENGL_FUN(glGenBuffers, FF_PFNGLGENBUFFERSPROC)
+ LOAD_OPENGL_FUN(glDeleteBuffers, FF_PFNGLDELETEBUFFERSPROC)
+ LOAD_OPENGL_FUN(glBufferData, FF_PFNGLBUFFERDATAPROC)
+ LOAD_OPENGL_FUN(glBindBuffer, FF_PFNGLBINDBUFFERPROC)
+ LOAD_OPENGL_FUN(glGetAttribLocation, FF_PFNGLGETATTRIBLOCATIONPROC)
+ LOAD_OPENGL_FUN(glGetUniformLocation, FF_PFNGLGETUNIFORMLOCATIONPROC)
+ LOAD_OPENGL_FUN(glUniform1f, FF_PFNGLUNIFORM1FPROC)
+ LOAD_OPENGL_FUN(glUniform1i, FF_PFNGLUNIFORM1IPROC)
+ LOAD_OPENGL_FUN(glUniformMatrix4fv, FF_PFNGLUNIFORMMATRIX4FVPROC)
+ LOAD_OPENGL_FUN(glCreateProgram, FF_PFNGLCREATEPROGRAMPROC)
+ LOAD_OPENGL_FUN(glDeleteProgram, FF_PFNGLDELETEPROGRAMPROC)
+ LOAD_OPENGL_FUN(glUseProgram, FF_PFNGLUSEPROGRAMPROC)
+ LOAD_OPENGL_FUN(glLinkProgram, FF_PFNGLLINKPROGRAMPROC)
+ LOAD_OPENGL_FUN(glGetProgramiv, FF_PFNGLGETPROGRAMIVPROC)
+ LOAD_OPENGL_FUN(glGetProgramInfoLog, FF_PFNGLGETPROGRAMINFOLOGPROC)
+ LOAD_OPENGL_FUN(glAttachShader, FF_PFNGLATTACHSHADERPROC)
+ LOAD_OPENGL_FUN(glCreateShader, FF_PFNGLCREATESHADERPROC)
+ LOAD_OPENGL_FUN(glDeleteShader, FF_PFNGLDELETESHADERPROC)
+ LOAD_OPENGL_FUN(glCompileShader, FF_PFNGLCOMPILESHADERPROC)
+ LOAD_OPENGL_FUN(glShaderSource, FF_PFNGLSHADERSOURCEPROC)
+ LOAD_OPENGL_FUN(glGetShaderiv, FF_PFNGLGETSHADERIVPROC)
+ LOAD_OPENGL_FUN(glGetShaderInfoLog, FF_PFNGLGETSHADERINFOLOGPROC)
+ LOAD_OPENGL_FUN(glEnableVertexAttribArray, FF_PFNGLENABLEVERTEXATTRIBARRAYPROC)
+ LOAD_OPENGL_FUN(glVertexAttribPointer, FF_PFNGLVERTEXATTRIBPOINTERPROC)
+
+ return 0;
+
+#undef LOAD_OPENGL_FUN
+}
+#endif /* HAVE_SDL */
+
+#if defined(__APPLE__)
+static int av_cold opengl_load_procedures(OpenGLContext *opengl)
+{
+ FFOpenGLFunctions *procs = &opengl->glprocs;
+
+#if HAVE_SDL
+ if (!opengl->no_window)
+ return opengl_sdl_load_procedures(opengl);
+#endif
+
+ procs->glActiveTexture = glActiveTexture;
+ procs->glGenBuffers = glGenBuffers;
+ procs->glDeleteBuffers = glDeleteBuffers;
+ procs->glBufferData = glBufferData;
+ procs->glBindBuffer = glBindBuffer;
+ procs->glGetAttribLocation = glGetAttribLocation;
+ procs->glGetUniformLocation = glGetUniformLocation;
+ procs->glUniform1f = glUniform1f;
+ procs->glUniform1i = glUniform1i;
+ procs->glUniformMatrix4fv = glUniformMatrix4fv;
+ procs->glCreateProgram = glCreateProgram;
+ procs->glDeleteProgram = glDeleteProgram;
+ procs->glUseProgram = glUseProgram;
+ procs->glLinkProgram = glLinkProgram;
+ procs->glGetProgramiv = glGetProgramiv;
+ procs->glGetProgramInfoLog = glGetProgramInfoLog;
+ procs->glAttachShader = glAttachShader;
+ procs->glCreateShader = glCreateShader;
+ procs->glDeleteShader = glDeleteShader;
+ procs->glCompileShader = glCompileShader;
+ procs->glShaderSource = glShaderSource;
+ procs->glGetShaderiv = glGetShaderiv;
+ procs->glGetShaderInfoLog = glGetShaderInfoLog;
+ procs->glEnableVertexAttribArray = glEnableVertexAttribArray;
+ procs->glVertexAttribPointer = (FF_PFNGLVERTEXATTRIBPOINTERPROC) glVertexAttribPointer;
+ return 0;
+}
+#else
+static int av_cold opengl_load_procedures(OpenGLContext *opengl)
+{
+ FFOpenGLFunctions *procs = &opengl->glprocs;
+
+#if HAVE_GLXGETPROCADDRESS
+#define SelectedGetProcAddress glXGetProcAddress
+#elif HAVE_WGLGETPROCADDRESS
+#define SelectedGetProcAddress wglGetProcAddress
+#endif
+
+#define LOAD_OPENGL_FUN(name, type) \
+ procs->name = (type)SelectedGetProcAddress(#name); \
+ if (!procs->name) { \
+ av_log(opengl, AV_LOG_ERROR, "Cannot load OpenGL function: '%s'\n", #name); \
+ return AVERROR(ENOSYS); \
+ }
+
+#if HAVE_SDL
+ if (!opengl->no_window)
+ return opengl_sdl_load_procedures(opengl);
+#endif
+
+ LOAD_OPENGL_FUN(glActiveTexture, FF_PFNGLACTIVETEXTUREPROC)
+ LOAD_OPENGL_FUN(glGenBuffers, FF_PFNGLGENBUFFERSPROC)
+ LOAD_OPENGL_FUN(glDeleteBuffers, FF_PFNGLDELETEBUFFERSPROC)
+ LOAD_OPENGL_FUN(glBufferData, FF_PFNGLBUFFERDATAPROC)
+ LOAD_OPENGL_FUN(glBindBuffer, FF_PFNGLBINDBUFFERPROC)
+ LOAD_OPENGL_FUN(glGetAttribLocation, FF_PFNGLGETATTRIBLOCATIONPROC)
+ LOAD_OPENGL_FUN(glGetUniformLocation, FF_PFNGLGETUNIFORMLOCATIONPROC)
+ LOAD_OPENGL_FUN(glUniform1f, FF_PFNGLUNIFORM1FPROC)
+ LOAD_OPENGL_FUN(glUniform1i, FF_PFNGLUNIFORM1IPROC)
+ LOAD_OPENGL_FUN(glUniformMatrix4fv, FF_PFNGLUNIFORMMATRIX4FVPROC)
+ LOAD_OPENGL_FUN(glCreateProgram, FF_PFNGLCREATEPROGRAMPROC)
+ LOAD_OPENGL_FUN(glDeleteProgram, FF_PFNGLDELETEPROGRAMPROC)
+ LOAD_OPENGL_FUN(glUseProgram, FF_PFNGLUSEPROGRAMPROC)
+ LOAD_OPENGL_FUN(glLinkProgram, FF_PFNGLLINKPROGRAMPROC)
+ LOAD_OPENGL_FUN(glGetProgramiv, FF_PFNGLGETPROGRAMIVPROC)
+ LOAD_OPENGL_FUN(glGetProgramInfoLog, FF_PFNGLGETPROGRAMINFOLOGPROC)
+ LOAD_OPENGL_FUN(glAttachShader, FF_PFNGLATTACHSHADERPROC)
+ LOAD_OPENGL_FUN(glCreateShader, FF_PFNGLCREATESHADERPROC)
+ LOAD_OPENGL_FUN(glDeleteShader, FF_PFNGLDELETESHADERPROC)
+ LOAD_OPENGL_FUN(glCompileShader, FF_PFNGLCOMPILESHADERPROC)
+ LOAD_OPENGL_FUN(glShaderSource, FF_PFNGLSHADERSOURCEPROC)
+ LOAD_OPENGL_FUN(glGetShaderiv, FF_PFNGLGETSHADERIVPROC)
+ LOAD_OPENGL_FUN(glGetShaderInfoLog, FF_PFNGLGETSHADERINFOLOGPROC)
+ LOAD_OPENGL_FUN(glEnableVertexAttribArray, FF_PFNGLENABLEVERTEXATTRIBARRAYPROC)
+ LOAD_OPENGL_FUN(glVertexAttribPointer, FF_PFNGLVERTEXATTRIBPOINTERPROC)
+
+ return 0;
+
+#undef SelectedGetProcAddress
+#undef LOAD_OPENGL_FUN
+}
+#endif
+
+static void opengl_make_identity(float matrix[16])
+{
+ memset(matrix, 0, 16 * sizeof(float));
+ matrix[0] = matrix[5] = matrix[10] = matrix[15] = 1.0f;
+}
+
+static void opengl_make_ortho(float matrix[16], float left, float right,
+ float bottom, float top, float nearZ, float farZ)
+{
+ float ral = right + left;
+ float rsl = right - left;
+ float tab = top + bottom;
+ float tsb = top - bottom;
+ float fan = farZ + nearZ;
+ float fsn = farZ - nearZ;
+
+ memset(matrix, 0, 16 * sizeof(float));
+ matrix[0] = 2.0f / rsl;
+ matrix[5] = 2.0f / tsb;
+ matrix[10] = -2.0f / fsn;
+ matrix[12] = -ral / rsl;
+ matrix[13] = -tab / tsb;
+ matrix[14] = -fan / fsn;
+ matrix[15] = 1.0f;
+}
+
+static av_cold int opengl_read_limits(OpenGLContext *opengl)
+{
+ static const struct{
+ const char *extention;
+ int major;
+ int minor;
+ } required_extensions[] = {
+ { "GL_ARB_multitexture", 1, 3 },
+ { "GL_ARB_vertex_buffer_object", 1, 5 }, //GLX_ARB_vertex_buffer_object
+ { "GL_ARB_vertex_shader", 2, 0 },
+ { "GL_ARB_fragment_shader", 2, 0 },
+ { "GL_ARB_shader_objects", 2, 0 },
+ { NULL, 0, 0 }
+ };
+ int i, major, minor;
+ const char *extensions, *version;
+
+ version = glGetString(GL_VERSION);
+ extensions = glGetString(GL_EXTENSIONS);
+
+ av_log(opengl, AV_LOG_DEBUG, "OpenGL version: %s\n", version);
+ sscanf(version, "%d.%d", &major, &minor);
+
+ for (i = 0; required_extensions[i].extention; i++) {
+ if (major < required_extensions[i].major &&
+ (major == required_extensions[i].major && minor < required_extensions[i].minor) &&
+ !strstr(extensions, required_extensions[i].extention)) {
+ av_log(opengl, AV_LOG_ERROR, "Required extension %s is not supported.\n",
+ required_extensions[i].extention);
+ av_log(opengl, AV_LOG_DEBUG, "Supported extensions are: %s\n", extensions);
+ return AVERROR(ENOSYS);
+ }
+ }
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &opengl->max_texture_size);
+ glGetIntegerv(GL_MAX_VIEWPORT_DIMS, &opengl->max_viewport_width);
+ opengl->non_pow_2_textures = major >= 2 || strstr(extensions, "GL_ARB_texture_non_power_of_two");
+#if defined(GL_ES_VERSION_2_0)
+ opengl->unpack_subimage = !!strstr(extensions, "GL_EXT_unpack_subimage");
+#else
+ opengl->unpack_subimage = 1;
+#endif
+
+ av_log(opengl, AV_LOG_DEBUG, "Non Power of 2 textures support: %s\n", opengl->non_pow_2_textures ? "Yes" : "No");
+ av_log(opengl, AV_LOG_DEBUG, "Unpack Subimage extension support: %s\n", opengl->unpack_subimage ? "Yes" : "No");
+ av_log(opengl, AV_LOG_DEBUG, "Max texture size: %dx%d\n", opengl->max_texture_size, opengl->max_texture_size);
+ av_log(opengl, AV_LOG_DEBUG, "Max viewport size: %dx%d\n",
+ opengl->max_viewport_width, opengl->max_viewport_height);
+
+ OPENGL_ERROR_CHECK(opengl);
+ return 0;
+ fail:
+ return AVERROR_EXTERNAL;
+}
+
+static const char* opengl_get_fragment_shader_code(enum AVPixelFormat format)
+{
+ int i;
+ for (i = 0; i < FF_ARRAY_ELEMS(opengl_format_desc); i++) {
+ if (opengl_format_desc[i].fixel_format == format)
+ return *opengl_format_desc[i].fragment_shader;
+ }
+ return NULL;
+}
+
+static int opengl_type_size(GLenum type)
+{
+ switch(type) {
+ case GL_UNSIGNED_SHORT:
+ case FF_GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ case GL_UNSIGNED_SHORT_5_6_5:
+ return 2;
+ case GL_UNSIGNED_BYTE:
+ case FF_GL_UNSIGNED_BYTE_3_3_2:
+ case FF_GL_UNSIGNED_BYTE_2_3_3_REV:
+ default:
+ break;
+ }
+ return 1;
+}
+
+static av_cold void opengl_get_texture_params(OpenGLContext *opengl)
+{
+ int i;
+ for (i = 0; i < FF_ARRAY_ELEMS(opengl_format_desc); i++) {
+ if (opengl_format_desc[i].fixel_format == opengl->pix_fmt) {
+ opengl->format = opengl_format_desc[i].format;
+ opengl->type = opengl_format_desc[i].type;
+ break;
+ }
+ }
+}
+
+static void opengl_compute_display_area(AVFormatContext *s)
+{
+ AVRational sar, dar; /* sample and display aspect ratios */
+ OpenGLContext *opengl = s->priv_data;
+ AVStream *st = s->streams[0];
+ AVCodecContext *encctx = st->codec;
+
+ /* compute overlay width and height from the codec context information */
+ sar = st->sample_aspect_ratio.num ? st->sample_aspect_ratio : (AVRational){ 1, 1 };
+ dar = av_mul_q(sar, (AVRational){ encctx->width, encctx->height });
+
+ /* we suppose the screen has a 1/1 sample aspect ratio */
+ /* fit in the window */
+ if (av_cmp_q(dar, (AVRational){ opengl->window_width, opengl->window_height }) > 0) {
+ /* fit in width */
+ opengl->picture_width = opengl->window_width;
+ opengl->picture_height = av_rescale(opengl->picture_width, dar.den, dar.num);
+ } else {
+ /* fit in height */
+ opengl->picture_height = opengl->window_height;
+ opengl->picture_width = av_rescale(opengl->picture_height, dar.num, dar.den);
+ }
+}
+
+static av_cold void opengl_get_texture_size(OpenGLContext *opengl, int in_width, int in_height,
+ int *out_width, int *out_height)
+{
+ if (opengl->non_pow_2_textures) {
+ *out_width = in_width;
+ *out_height = in_height;
+ } else {
+ int max = FFMIN(FFMAX(in_width, in_height), opengl->max_texture_size);
+ unsigned power_of_2 = 1;
+ while (power_of_2 < max)
+ power_of_2 *= 2;
+ *out_height = power_of_2;
+ *out_width = power_of_2;
+ av_log(opengl, AV_LOG_DEBUG, "Texture size calculated from %dx%d into %dx%d\n",
+ in_width, in_height, *out_width, *out_height);
+ }
+}
+
+static av_cold void opengl_fill_color_map(OpenGLContext *opengl)
+{
+ const AVPixFmtDescriptor *desc;
+ int shift;
+ enum AVPixelFormat pix_fmt = opengl->pix_fmt;
+
+ /* We need order of components, not exact position, some minor HACKs here */
+ if (pix_fmt == AV_PIX_FMT_RGB565 || pix_fmt == AV_PIX_FMT_BGR555 ||
+ pix_fmt == AV_PIX_FMT_BGR8 || pix_fmt == AV_PIX_FMT_RGB8)
+ pix_fmt = AV_PIX_FMT_RGB24;
+ else if (pix_fmt == AV_PIX_FMT_BGR565 || pix_fmt == AV_PIX_FMT_RGB555)
+ pix_fmt = AV_PIX_FMT_BGR24;
+
+ desc = av_pix_fmt_desc_get(pix_fmt);
+ if (!(desc->flags & AV_PIX_FMT_FLAG_RGB))
+ return;
+
+#define FILL_COMPONENT(i) { \
+ shift = desc->comp[i].depth_minus1 >> 3; \
+ opengl->color_map[(i << 2) + ((desc->comp[i].offset_plus1 - 1) >> shift)] = 1.0; \
+ }
+
+ memset(opengl->color_map, 0, sizeof(opengl->color_map));
+ FILL_COMPONENT(0);
+ FILL_COMPONENT(1);
+ FILL_COMPONENT(2);
+ if (desc->flags & AV_PIX_FMT_FLAG_ALPHA)
+ FILL_COMPONENT(3);
+
+#undef FILL_COMPONENT
+}
+
+static av_cold GLuint opengl_load_shader(OpenGLContext *opengl, GLenum type, const char *source)
+{
+ GLuint shader = opengl->glprocs.glCreateShader(type);
+ GLint result;
+ if (!shader) {
+ av_log(opengl, AV_LOG_ERROR, "glCreateShader() failed\n");
+ return 0;
+ }
+ opengl->glprocs.glShaderSource(shader, 1, &source, NULL);
+ opengl->glprocs.glCompileShader(shader);
+
+ opengl->glprocs.glGetShaderiv(shader, FF_GL_COMPILE_STATUS, &result);
+ if (!result) {
+ char *log;
+ opengl->glprocs.glGetShaderiv(shader, FF_GL_INFO_LOG_LENGTH, &result);
+ if (result) {
+ if ((log = av_malloc(result))) {
+ opengl->glprocs.glGetShaderInfoLog(shader, result, NULL, log);
+ av_log(opengl, AV_LOG_ERROR, "Compile error: %s\n", log);
+ av_free(log);
+ }
+ }
+ goto fail;
+ }
+ OPENGL_ERROR_CHECK(opengl);
+ return shader;
+ fail:
+ opengl->glprocs.glDeleteShader(shader);
+ return 0;
+}
+
+static av_cold int opengl_compile_shaders(OpenGLContext *opengl, enum AVPixelFormat pix_fmt)
+{
+ GLint result;
+ const char *fragment_shader_code = opengl_get_fragment_shader_code(pix_fmt);
+
+ if (!fragment_shader_code) {
+ av_log(opengl, AV_LOG_ERROR, "Provided pixel format '%s' is not supported\n",
+ av_get_pix_fmt_name(pix_fmt));
+ return AVERROR(EINVAL);
+ }
+
+ opengl->vertex_shader = opengl_load_shader(opengl, FF_GL_VERTEX_SHADER,
+ FF_OPENGL_VERTEX_SHADER);
+ if (!opengl->vertex_shader) {
+ av_log(opengl, AV_LOG_ERROR, "Vertex shader loading failed.\n");
+ goto fail;
+ }
+ opengl->fragment_shader = opengl_load_shader(opengl, FF_GL_FRAGMENT_SHADER,
+ fragment_shader_code);
+ if (!opengl->fragment_shader) {
+ av_log(opengl, AV_LOG_ERROR, "Fragment shader loading failed.\n");
+ goto fail;
+ }
+
+ opengl->program = opengl->glprocs.glCreateProgram();
+ if (!opengl->program)
+ goto fail;
+
+ opengl->glprocs.glAttachShader(opengl->program, opengl->vertex_shader);
+ opengl->glprocs.glAttachShader(opengl->program, opengl->fragment_shader);
+ opengl->glprocs.glLinkProgram(opengl->program);
+
+ opengl->glprocs.glGetProgramiv(opengl->program, FF_GL_LINK_STATUS, &result);
+ if (!result) {
+ char *log;
+ opengl->glprocs.glGetProgramiv(opengl->program, FF_GL_INFO_LOG_LENGTH, &result);
+ if (result) {
+ log = av_malloc(result);
+ if (!log)
+ goto fail;
+ opengl->glprocs.glGetProgramInfoLog(opengl->program, result, NULL, log);
+ av_log(opengl, AV_LOG_ERROR, "Link error: %s\n", log);
+ av_free(log);
+ }
+ goto fail;
+ }
+
+ opengl->position_attrib = opengl->glprocs.glGetAttribLocation(opengl->program, "a_position");
+ opengl->texture_coords_attrib = opengl->glprocs.glGetAttribLocation(opengl->program, "a_textureCoords");
+ opengl->projection_matrix_location = opengl->glprocs.glGetUniformLocation(opengl->program, "u_projectionMatrix");
+ opengl->model_view_matrix_location = opengl->glprocs.glGetUniformLocation(opengl->program, "u_modelViewMatrix");
+ opengl->color_map_location = opengl->glprocs.glGetUniformLocation(opengl->program, "u_colorMap");
+ opengl->texture_location[0] = opengl->glprocs.glGetUniformLocation(opengl->program, "u_texture0");
+ opengl->texture_location[1] = opengl->glprocs.glGetUniformLocation(opengl->program, "u_texture1");
+ opengl->texture_location[2] = opengl->glprocs.glGetUniformLocation(opengl->program, "u_texture2");
+ opengl->texture_location[3] = opengl->glprocs.glGetUniformLocation(opengl->program, "u_texture3");
+ opengl->chroma_div_w_location = opengl->glprocs.glGetUniformLocation(opengl->program, "u_chroma_div_w");
+ opengl->chroma_div_h_location = opengl->glprocs.glGetUniformLocation(opengl->program, "u_chroma_div_h");
+
+ OPENGL_ERROR_CHECK(opengl);
+ return 0;
+ fail:
+ opengl->glprocs.glDeleteShader(opengl->vertex_shader);
+ opengl->glprocs.glDeleteShader(opengl->fragment_shader);
+ opengl->glprocs.glDeleteProgram(opengl->program);
+ opengl->fragment_shader = opengl->vertex_shader = opengl->program = 0;
+ return AVERROR_EXTERNAL;
+}
+
+static av_cold int opengl_configure_texture(OpenGLContext *opengl, GLuint texture,
+ GLsizei width, GLsizei height)
+{
+ if (texture) {
+ int new_width, new_height;
+ opengl_get_texture_size(opengl, width, height, &new_width, &new_height);
+ glBindTexture(GL_TEXTURE_2D, texture);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexImage2D(GL_TEXTURE_2D, 0, opengl->format, new_width, new_height, 0,
+ opengl->format, opengl->type, NULL);
+ OPENGL_ERROR_CHECK(NULL);
+ }
+ return 0;
+ fail:
+ return AVERROR_EXTERNAL;
+}
+
+static av_cold int opengl_prepare_vertex(AVFormatContext *s)
+{
+ OpenGLContext *opengl = s->priv_data;
+ int tex_w, tex_h;
+
+ if (opengl->window_width > opengl->max_viewport_width || opengl->window_height > opengl->max_viewport_height) {
+ opengl->window_width = FFMIN(opengl->window_width, opengl->max_viewport_width);
+ opengl->window_height = FFMIN(opengl->window_height, opengl->max_viewport_height);
+ av_log(opengl, AV_LOG_WARNING, "Too big viewport requested, limited to %dx%d", opengl->window_width, opengl->window_height);
+ }
+ glViewport(0, 0, opengl->window_width, opengl->window_height);
+ opengl_make_ortho(opengl->projection_matrix,
+ - (float)opengl->window_width / 2.0f, (float)opengl->window_width / 2.0f,
+ - (float)opengl->window_height / 2.0f, (float)opengl->window_height / 2.0f,
+ 1.0f, -1.0f);
+ opengl_make_identity(opengl->model_view_matrix);
+
+ opengl_compute_display_area(s);
+
+ opengl->vertex[0].z = opengl->vertex[1].z = opengl->vertex[2].z = opengl->vertex[3].z = 0.0f;
+ opengl->vertex[0].x = opengl->vertex[1].x = - (float)opengl->picture_width / 2.0f;
+ opengl->vertex[2].x = opengl->vertex[3].x = (float)opengl->picture_width / 2.0f;
+ opengl->vertex[1].y = opengl->vertex[2].y = - (float)opengl->picture_height / 2.0f;
+ opengl->vertex[0].y = opengl->vertex[3].y = (float)opengl->picture_height / 2.0f;
+
+ opengl_get_texture_size(opengl, opengl->width, opengl->height, &tex_w, &tex_h);
+
+ opengl->vertex[0].s0 = 0.0f;
+ opengl->vertex[0].t0 = 0.0f;
+ opengl->vertex[1].s0 = 0.0f;
+ opengl->vertex[1].t0 = (float)opengl->height / (float)tex_h;
+ opengl->vertex[2].s0 = (float)opengl->width / (float)tex_w;
+ opengl->vertex[2].t0 = (float)opengl->height / (float)tex_h;
+ opengl->vertex[3].s0 = (float)opengl->width / (float)tex_w;
+ opengl->vertex[3].t0 = 0.0f;
+
+ opengl->glprocs.glBindBuffer(FF_GL_ARRAY_BUFFER, opengl->vertex_buffer);
+ opengl->glprocs.glBufferData(FF_GL_ARRAY_BUFFER, sizeof(opengl->vertex), opengl->vertex, FF_GL_STATIC_DRAW);
+ opengl->glprocs.glBindBuffer(FF_GL_ARRAY_BUFFER, 0);
+ OPENGL_ERROR_CHECK(opengl);
+ return 0;
+ fail:
+ return AVERROR_EXTERNAL;
+}
+
+static int opengl_prepare(OpenGLContext *opengl)
+{
+ int i;
+ opengl->glprocs.glUseProgram(opengl->program);
+ opengl->glprocs.glUniformMatrix4fv(opengl->projection_matrix_location, 1, GL_FALSE, opengl->projection_matrix);
+ opengl->glprocs.glUniformMatrix4fv(opengl->model_view_matrix_location, 1, GL_FALSE, opengl->model_view_matrix);
+ for (i = 0; i < 4; i++)
+ if (opengl->texture_location[i] != -1) {
+ opengl->glprocs.glActiveTexture(GL_TEXTURE0 + i);
+ glBindTexture(GL_TEXTURE_2D, opengl->texture_name[i]);
+ opengl->glprocs.glUniform1i(opengl->texture_location[i], i);
+ }
+ if (opengl->color_map_location != -1)
+ opengl->glprocs.glUniformMatrix4fv(opengl->color_map_location, 1, GL_FALSE, opengl->color_map);
+ if (opengl->chroma_div_h_location != -1)
+ opengl->glprocs.glUniform1f(opengl->chroma_div_h_location, opengl->chroma_div_h);
+ if (opengl->chroma_div_w_location != -1)
+ opengl->glprocs.glUniform1f(opengl->chroma_div_w_location, opengl->chroma_div_w);
+
+ OPENGL_ERROR_CHECK(opengl);
+ return 0;
+ fail:
+ return AVERROR_EXTERNAL;
+}
+
+static int opengl_create_window(AVFormatContext *h)
+{
+ OpenGLContext *opengl = h->priv_data;
+ int ret;
+
+ if (!opengl->no_window) {
+#if HAVE_SDL
+ if ((ret = opengl_sdl_create_window(h)) < 0) {
+ av_log(opengl, AV_LOG_ERROR, "Cannot create default SDL window.\n");
+ return ret;
+ }
+#else
+ av_log(opengl, AV_LOG_ERROR, "FFmpeg is compiled without SDL. Cannot create default window.\n");
+ return AVERROR(ENOSYS);
+#endif
+ } else {
+ AVDeviceRect message;
+ message.x = message.y = 0;
+ message.width = opengl->window_width;
+ message.height = opengl->window_height;
+ if ((ret = avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_CREATE_WINDOW_BUFFER,
+ &message , sizeof(message))) < 0) {
+ av_log(opengl, AV_LOG_ERROR, "Application failed to create window buffer.\n");
+ return ret;
+ }
+ if ((ret = avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER, NULL , 0)) < 0) {
+ av_log(opengl, AV_LOG_ERROR, "Application failed to prepare window buffer.\n");
+ return ret;
+ }
+ }
+ return 0;
+}
+
+static int opengl_release_window(AVFormatContext *h)
+{
+ int ret;
+ OpenGLContext *opengl = h->priv_data;
+ if (!opengl->no_window) {
+#if HAVE_SDL
+ SDL_Quit();
+#endif
+ } else if ((ret = avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER, NULL , 0)) < 0) {
+ av_log(opengl, AV_LOG_ERROR, "Application failed to release window buffer.\n");
+ return ret;
+ }
+ return 0;
+}
+
+static av_cold int opengl_write_trailer(AVFormatContext *h)
+{
+ OpenGLContext *opengl = h->priv_data;
+
+ if (opengl->no_window &&
+ avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER, NULL , 0) < 0)
+ av_log(opengl, AV_LOG_ERROR, "Application failed to prepare window buffer.\n");
+
+ opengl_deinit_context(opengl);
+ opengl_release_window(h);
+
+ return 0;
+}
+
+static av_cold int opengl_init_context(OpenGLContext *opengl)
+{
+ int i, ret;
+ const AVPixFmtDescriptor *desc;
+
+ if ((ret = opengl_compile_shaders(opengl, opengl->pix_fmt)) < 0)
+ goto fail;
+
+ desc = av_pix_fmt_desc_get(opengl->pix_fmt);
+ av_assert0(desc->nb_components > 0 && desc->nb_components <= 4);
+ glGenTextures(desc->nb_components, opengl->texture_name);
+
+ opengl->glprocs.glGenBuffers(2, &opengl->index_buffer);
+ if (!opengl->index_buffer || !opengl->vertex_buffer) {
+ av_log(opengl, AV_LOG_ERROR, "Buffer generation failed.\n");
+ ret = AVERROR_EXTERNAL;
+ goto fail;
+ }
+
+ opengl_configure_texture(opengl, opengl->texture_name[0], opengl->width, opengl->height);
+ if (desc->nb_components > 1) {
+ int has_alpha = desc->flags & AV_PIX_FMT_FLAG_ALPHA;
+ int num_planes = desc->nb_components - (has_alpha ? 1 : 0);
+ if (opengl->non_pow_2_textures) {
+ opengl->chroma_div_w = 1.0f;
+ opengl->chroma_div_h = 1.0f;
+ } else {
+ opengl->chroma_div_w = 1 << desc->log2_chroma_w;
+ opengl->chroma_div_h = 1 << desc->log2_chroma_h;
+ }
+ for (i = 1; i < num_planes; i++)
+ if (opengl->non_pow_2_textures)
+ opengl_configure_texture(opengl, opengl->texture_name[i],
+ FF_CEIL_RSHIFT(opengl->width, desc->log2_chroma_w),
+ FF_CEIL_RSHIFT(opengl->height, desc->log2_chroma_h));
+ else
+ opengl_configure_texture(opengl, opengl->texture_name[i], opengl->width, opengl->height);
+ if (has_alpha)
+ opengl_configure_texture(opengl, opengl->texture_name[3], opengl->width, opengl->height);
+ }
+
+ opengl->glprocs.glBindBuffer(FF_GL_ELEMENT_ARRAY_BUFFER, opengl->index_buffer);
+ opengl->glprocs.glBufferData(FF_GL_ELEMENT_ARRAY_BUFFER, sizeof(g_index), g_index, FF_GL_STATIC_DRAW);
+ opengl->glprocs.glBindBuffer(FF_GL_ELEMENT_ARRAY_BUFFER, 0);
+
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ glClearColor((float)opengl->background[0] / 255.0f, (float)opengl->background[1] / 255.0f,
+ (float)opengl->background[2] / 255.0f, 1.0f);
+
+ ret = AVERROR_EXTERNAL;
+ OPENGL_ERROR_CHECK(opengl);
+
+ return 0;
+ fail:
+ return ret;
+}
+
+static av_cold int opengl_write_header(AVFormatContext *h)
+{
+ OpenGLContext *opengl = h->priv_data;
+ AVStream *st;
+ int ret;
+
+ if (h->nb_streams != 1 ||
+ h->streams[0]->codec->codec_type != AVMEDIA_TYPE_VIDEO ||
+ h->streams[0]->codec->codec_id != AV_CODEC_ID_RAWVIDEO) {
+ av_log(opengl, AV_LOG_ERROR, "Only a single video stream is supported.\n");
+ return AVERROR(EINVAL);
+ }
+ st = h->streams[0];
+ opengl->width = st->codec->width;
+ opengl->height = st->codec->height;
+ opengl->pix_fmt = st->codec->pix_fmt;
+ if (!opengl->window_width)
+ opengl->window_width = opengl->width;
+ if (!opengl->window_height)
+ opengl->window_height = opengl->height;
+
+ if (!opengl->window_title && !opengl->no_window)
+ opengl->window_title = av_strdup(h->filename);
+
+ if ((ret = opengl_create_window(h)))
+ goto fail;
+
+ if ((ret = opengl_read_limits(opengl)) < 0)
+ goto fail;
+
+ if (opengl->width > opengl->max_texture_size || opengl->height > opengl->max_texture_size) {
+ av_log(opengl, AV_LOG_ERROR, "Too big picture %dx%d, max supported size is %dx%d\n",
+ opengl->width, opengl->height, opengl->max_texture_size, opengl->max_texture_size);
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+
+ if ((ret = opengl_load_procedures(opengl)) < 0)
+ goto fail;
+
+ opengl_fill_color_map(opengl);
+ opengl_get_texture_params(opengl);
+
+ if ((ret = opengl_init_context(opengl)) < 0)
+ goto fail;
+
+ if ((ret = opengl_prepare_vertex(h)) < 0)
+ goto fail;
+
+ glClear(GL_COLOR_BUFFER_BIT);
+
+#if HAVE_SDL
+ if (!opengl->no_window)
+ SDL_GL_SwapBuffers();
+#endif
+ if (opengl->no_window &&
+ (ret = avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER, NULL , 0)) < 0) {
+ av_log(opengl, AV_LOG_ERROR, "Application failed to display window buffer.\n");
+ goto fail;
+ }
+
+ ret = AVERROR_EXTERNAL;
+ OPENGL_ERROR_CHECK(opengl);
+
+ opengl->inited = 1;
+ return 0;
+
+ fail:
+ opengl_write_trailer(h);
+ return ret;
+}
+
+static uint8_t* opengl_get_plane_pointer(OpenGLContext *opengl, AVPacket *pkt, int comp_index,
+ const AVPixFmtDescriptor *desc)
+{
+ uint8_t *data = pkt->data;
+ int wordsize = opengl_type_size(opengl->type);
+ int width_chroma = FF_CEIL_RSHIFT(opengl->width, desc->log2_chroma_w);
+ int height_chroma = FF_CEIL_RSHIFT(opengl->height, desc->log2_chroma_h);
+ int plane = desc->comp[comp_index].plane;
+
+ switch(plane) {
+ case 0:
+ break;
+ case 1:
+ data += opengl->width * opengl->height * wordsize;
+ break;
+ case 2:
+ data += opengl->width * opengl->height * wordsize;
+ data += width_chroma * height_chroma * wordsize;
+ break;
+ case 3:
+ data += opengl->width * opengl->height * wordsize;
+ data += 2 * width_chroma * height_chroma * wordsize;
+ break;
+ default:
+ return NULL;
+ }
+ return data;
+}
+
+#define LOAD_TEXTURE_DATA(comp_index, sub) \
+{ \
+ int width = sub ? FF_CEIL_RSHIFT(opengl->width, desc->log2_chroma_w) : opengl->width; \
+ int height = sub ? FF_CEIL_RSHIFT(opengl->height, desc->log2_chroma_h): opengl->height; \
+ uint8_t *data; \
+ int plane = desc->comp[comp_index].plane; \
+ \
+ glBindTexture(GL_TEXTURE_2D, opengl->texture_name[comp_index]); \
+ if (!is_pkt) { \
+ GLint length = ((AVFrame *)input)->linesize[plane]; \
+ int bytes_per_pixel = opengl_type_size(opengl->type); \
+ if (!(desc->flags & AV_PIX_FMT_FLAG_PLANAR)) \
+ bytes_per_pixel *= desc->nb_components; \
+ data = ((AVFrame *)input)->data[plane]; \
+ if (!(length % bytes_per_pixel) && \
+ (opengl->unpack_subimage || ((length / bytes_per_pixel) == width))) { \
+ length /= bytes_per_pixel; \
+ if (length != width) \
+ glPixelStorei(FF_GL_UNPACK_ROW_LENGTH, length); \
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, \
+ opengl->format, opengl->type, data); \
+ if (length != width) \
+ glPixelStorei(FF_GL_UNPACK_ROW_LENGTH, 0); \
+ } else { \
+ int h; \
+ for (h = 0; h < height; h++) { \
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, h, width, 1, \
+ opengl->format, opengl->type, data); \
+ data += length; \
+ } \
+ } \
+ } else { \
+ data = opengl_get_plane_pointer(opengl, input, comp_index, desc); \
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, \
+ opengl->format, opengl->type, data); \
+ } \
+}
+
+static int opengl_draw(AVFormatContext *h, void *input, int repaint, int is_pkt)
+{
+ OpenGLContext *opengl = h->priv_data;
+ enum AVPixelFormat pix_fmt = h->streams[0]->codec->pix_fmt;
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+ int ret;
+
+#if HAVE_SDL
+ if (!opengl->no_window && (ret = opengl_sdl_process_events(h)) < 0)
+ goto fail;
+#endif
+ if (opengl->no_window &&
+ (ret = avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER, NULL , 0)) < 0) {
+ av_log(opengl, AV_LOG_ERROR, "Application failed to prepare window buffer.\n");
+ goto fail;
+ }
+
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ if (!repaint) {
+ if (is_pkt)
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ LOAD_TEXTURE_DATA(0, 0)
+ if (desc->flags & AV_PIX_FMT_FLAG_PLANAR) {
+ LOAD_TEXTURE_DATA(1, 1)
+ LOAD_TEXTURE_DATA(2, 1)
+ if (desc->flags & AV_PIX_FMT_FLAG_ALPHA)
+ LOAD_TEXTURE_DATA(3, 0)
+ }
+ }
+ ret = AVERROR_EXTERNAL;
+ OPENGL_ERROR_CHECK(opengl);
+
+ if ((ret = opengl_prepare(opengl)) < 0)
+ goto fail;
+
+ opengl->glprocs.glBindBuffer(FF_GL_ARRAY_BUFFER, opengl->vertex_buffer);
+ opengl->glprocs.glBindBuffer(FF_GL_ELEMENT_ARRAY_BUFFER, opengl->index_buffer);
+ opengl->glprocs.glVertexAttribPointer(opengl->position_attrib, 3, GL_FLOAT, GL_FALSE, sizeof(OpenGLVertexInfo), 0);
+ opengl->glprocs.glEnableVertexAttribArray(opengl->position_attrib);
+ opengl->glprocs.glVertexAttribPointer(opengl->texture_coords_attrib, 2, GL_FLOAT, GL_FALSE, sizeof(OpenGLVertexInfo), 12);
+ opengl->glprocs.glEnableVertexAttribArray(opengl->texture_coords_attrib);
+
+ glDrawElements(GL_TRIANGLES, FF_ARRAY_ELEMS(g_index), GL_UNSIGNED_SHORT, 0);
+
+ ret = AVERROR_EXTERNAL;
+ OPENGL_ERROR_CHECK(opengl);
+
+#if HAVE_SDL
+ if (!opengl->no_window)
+ SDL_GL_SwapBuffers();
+#endif
+ if (opengl->no_window &&
+ (ret = avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER, NULL , 0)) < 0) {
+ av_log(opengl, AV_LOG_ERROR, "Application failed to display window buffer.\n");
+ goto fail;
+ }
+
+ return 0;
+ fail:
+ return ret;
+}
+
+static int opengl_write_packet(AVFormatContext *h, AVPacket *pkt)
+{
+ return opengl_draw(h, pkt, 0, 1);
+}
+
+static int opengl_write_frame(AVFormatContext *h, int stream_index,
+ AVFrame **frame, unsigned flags)
+{
+ if ((flags & AV_WRITE_UNCODED_FRAME_QUERY))
+ return 0;
+ return opengl_draw(h, *frame, 0, 0);
+}
+
+#define OFFSET(x) offsetof(OpenGLContext, x)
+#define ENC AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "background", "set background color", OFFSET(background), AV_OPT_TYPE_COLOR, {.str = "black"}, CHAR_MIN, CHAR_MAX, ENC },
+ { "no_window", "disable default window", OFFSET(no_window), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, ENC },
+ { "window_title", "set window title", OFFSET(window_title), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, ENC },
+ { "window_size", "set window size", OFFSET(window_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, ENC },
+ { NULL }
+};
+
+static const AVClass opengl_class = {
+ .class_name = "opengl outdev",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
+};
+
+AVOutputFormat ff_opengl_muxer = {
+ .name = "opengl",
+ .long_name = NULL_IF_CONFIG_SMALL("OpenGL output"),
+ .priv_data_size = sizeof(OpenGLContext),
+ .audio_codec = AV_CODEC_ID_NONE,
+ .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .write_header = opengl_write_header,
+ .write_packet = opengl_write_packet,
+ .write_uncoded_frame = opengl_write_frame,
+ .write_trailer = opengl_write_trailer,
+ .control_message = opengl_control_message,
+ .flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
+ .priv_class = &opengl_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavdevice/opengl_enc_shaders.h b/chromium/third_party/ffmpeg/libavdevice/opengl_enc_shaders.h
new file mode 100644
index 00000000000..ed8b3d30413
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavdevice/opengl_enc_shaders.h
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2014 Lukasz Marek
+ *
+ * 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 AVDEVICE_OPENGL_SHADERS_H
+#define AVDEVICE_OPENGL_SHADERS_H
+
+#include "libavutil/pixfmt.h"
+
+static const char * const FF_OPENGL_VERTEX_SHADER =
+ "uniform mat4 u_projectionMatrix;"
+ "uniform mat4 u_modelViewMatrix;"
+
+ "attribute vec4 a_position;"
+ "attribute vec2 a_textureCoords;"
+
+ "varying vec2 texture_coordinate;"
+
+ "void main()"
+ "{"
+ "gl_Position = u_projectionMatrix * (a_position * u_modelViewMatrix);"
+ "texture_coordinate = a_textureCoords;"
+ "}";
+
+/**
+ * Fragment shader for packet RGBA formats.
+ */
+static const char * const FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET =
+#if defined(GL_ES_VERSION_2_0)
+ "precision mediump float;"
+#endif
+ "uniform sampler2D u_texture0;"
+ "uniform mat4 u_colorMap;"
+
+ "varying vec2 texture_coordinate;"
+
+ "void main()"
+ "{"
+ "gl_FragColor = texture2D(u_texture0, texture_coordinate) * u_colorMap;"
+ "}";
+
+/**
+ * Fragment shader for packet RGB formats.
+ */
+static const char * const FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET =
+#if defined(GL_ES_VERSION_2_0)
+ "precision mediump float;"
+#endif
+ "uniform sampler2D u_texture0;"
+ "uniform mat4 u_colorMap;"
+
+ "varying vec2 texture_coordinate;"
+
+ "void main()"
+ "{"
+ "gl_FragColor = vec4((texture2D(u_texture0, texture_coordinate) * u_colorMap).rgb, 1.0);"
+ "}";
+
+/**
+ * Fragment shader for planar RGBA formats.
+ */
+static const char * const FF_OPENGL_FRAGMENT_SHADER_RGBA_PLANAR =
+#if defined(GL_ES_VERSION_2_0)
+ "precision mediump float;"
+#endif
+ "uniform sampler2D u_texture0;"
+ "uniform sampler2D u_texture1;"
+ "uniform sampler2D u_texture2;"
+ "uniform sampler2D u_texture3;"
+
+ "varying vec2 texture_coordinate;"
+
+ "void main()"
+ "{"
+ "gl_FragColor = vec4(texture2D(u_texture0, texture_coordinate).r,"
+ "texture2D(u_texture1, texture_coordinate).r,"
+ "texture2D(u_texture2, texture_coordinate).r,"
+ "texture2D(u_texture3, texture_coordinate).r);"
+ "}";
+
+/**
+ * Fragment shader for planar RGB formats.
+ */
+static const char * const FF_OPENGL_FRAGMENT_SHADER_RGB_PLANAR =
+#if defined(GL_ES_VERSION_2_0)
+ "precision mediump float;"
+#endif
+ "uniform sampler2D u_texture0;"
+ "uniform sampler2D u_texture1;"
+ "uniform sampler2D u_texture2;"
+
+ "varying vec2 texture_coordinate;"
+
+ "void main()"
+ "{"
+ "gl_FragColor = vec4(texture2D(u_texture0, texture_coordinate).r,"
+ "texture2D(u_texture1, texture_coordinate).r,"
+ "texture2D(u_texture2, texture_coordinate).r,"
+ "1.0);"
+ "}";
+
+/**
+ * Fragment shader for planar YUV formats.
+ */
+static const char * const FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR =
+#if defined(GL_ES_VERSION_2_0)
+ "precision mediump float;"
+#endif
+ "uniform sampler2D u_texture0;"
+ "uniform sampler2D u_texture1;"
+ "uniform sampler2D u_texture2;"
+ "uniform float u_chroma_div_w;"
+ "uniform float u_chroma_div_h;"
+
+ "varying vec2 texture_coordinate;"
+
+ "void main()"
+ "{"
+ "vec3 yuv;"
+
+ "yuv.r = texture2D(u_texture0, texture_coordinate).r - 0.0625;"
+ "yuv.g = texture2D(u_texture1, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;"
+ "yuv.b = texture2D(u_texture2, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;"
+
+ "gl_FragColor = clamp(vec4(mat3(1.1643, 1.16430, 1.1643,"
+ "0.0, -0.39173, 2.0170,"
+ "1.5958, -0.81290, 0.0) * yuv, 1.0), 0.0, 1.0);"
+
+ "}";
+
+/**
+ * Fragment shader for planar YUVA formats.
+ */
+static const char * const FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR =
+#if defined(GL_ES_VERSION_2_0)
+ "precision mediump float;"
+#endif
+ "uniform sampler2D u_texture0;"
+ "uniform sampler2D u_texture1;"
+ "uniform sampler2D u_texture2;"
+ "uniform sampler2D u_texture3;"
+ "uniform float u_chroma_div_w;"
+ "uniform float u_chroma_div_h;"
+
+ "varying vec2 texture_coordinate;"
+
+ "void main()"
+ "{"
+ "vec3 yuv;"
+
+ "yuv.r = texture2D(u_texture0, texture_coordinate).r - 0.0625;"
+ "yuv.g = texture2D(u_texture1, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;"
+ "yuv.b = texture2D(u_texture2, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;"
+
+ "gl_FragColor = clamp(vec4(mat3(1.1643, 1.16430, 1.1643,"
+ "0.0, -0.39173, 2.0170,"
+ "1.5958, -0.81290, 0.0) * yuv, texture2D(u_texture3, texture_coordinate).r), 0.0, 1.0);"
+ "}";
+
+static const char * const FF_OPENGL_FRAGMENT_SHADER_GRAY =
+#if defined(GL_ES_VERSION_2_0)
+ "precision mediump float;"
+#endif
+ "uniform sampler2D u_texture0;"
+ "varying vec2 texture_coordinate;"
+ "void main()"
+ "{"
+ "float c = texture2D(u_texture0, texture_coordinate).r;"
+ "gl_FragColor = vec4(c, c, c, 1.0);"
+ "}";
+
+#endif /* AVDEVICE_OPENGL_SHADERS_H */
diff --git a/chromium/third_party/ffmpeg/libavdevice/oss_audio.c b/chromium/third_party/ffmpeg/libavdevice/oss_audio.c
index 916908c4259..71bf63689a2 100644
--- a/chromium/third_party/ffmpeg/libavdevice/oss_audio.c
+++ b/chromium/third_party/ffmpeg/libavdevice/oss_audio.c
@@ -296,6 +296,7 @@ static const AVClass oss_demuxer_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
AVInputFormat ff_oss_demuxer = {
@@ -311,6 +312,13 @@ AVInputFormat ff_oss_demuxer = {
#endif
#if CONFIG_OSS_OUTDEV
+static const AVClass oss_muxer_class = {
+ .class_name = "OSS muxer",
+ .item_name = av_default_item_name,
+ .version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
+};
+
AVOutputFormat ff_oss_muxer = {
.name = "oss",
.long_name = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) playback"),
@@ -324,5 +332,6 @@ AVOutputFormat ff_oss_muxer = {
.write_packet = audio_write_packet,
.write_trailer = audio_write_trailer,
.flags = AVFMT_NOFILE,
+ .priv_class = &oss_muxer_class,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavdevice/pulse_audio_common.c b/chromium/third_party/ffmpeg/libavdevice/pulse_audio_common.c
index f7227f65497..5a2568b82be 100644
--- a/chromium/third_party/ffmpeg/libavdevice/pulse_audio_common.c
+++ b/chromium/third_party/ffmpeg/libavdevice/pulse_audio_common.c
@@ -1,5 +1,6 @@
/*
- * Pulseaudio input
+ * Pulseaudio common
+ * Copyright (c) 2014 Lukasz Marek
* Copyright (c) 2011 Luca Barbato <lu_zero@gentoo.org>
*
* This file is part of FFmpeg.
@@ -21,6 +22,9 @@
#include "pulse_audio_common.h"
#include "libavutil/attributes.h"
+#include "libavutil/avstring.h"
+#include "libavutil/mem.h"
+#include "libavutil/avassert.h"
pa_sample_format_t av_cold ff_codec_id_to_pulse_format(enum AVCodecID codec_id)
{
@@ -39,3 +43,207 @@ pa_sample_format_t av_cold ff_codec_id_to_pulse_format(enum AVCodecID codec_id)
default: return PA_SAMPLE_INVALID;
}
}
+
+enum PulseAudioContextState {
+ PULSE_CONTEXT_INITIALIZING,
+ PULSE_CONTEXT_READY,
+ PULSE_CONTEXT_FINISHED
+};
+
+typedef struct PulseAudioDeviceList {
+ AVDeviceInfoList *devices;
+ int error_code;
+ int output;
+ char *default_device;
+} PulseAudioDeviceList;
+
+static void pa_state_cb(pa_context *c, void *userdata)
+{
+ enum PulseAudioContextState *context_state = userdata;
+
+ switch (pa_context_get_state(c)) {
+ case PA_CONTEXT_FAILED:
+ case PA_CONTEXT_TERMINATED:
+ *context_state = PULSE_CONTEXT_FINISHED;
+ break;
+ case PA_CONTEXT_READY:
+ *context_state = PULSE_CONTEXT_READY;
+ break;
+ default:
+ break;
+ }
+}
+
+void ff_pulse_audio_disconnect_context(pa_mainloop **pa_ml, pa_context **pa_ctx)
+{
+ av_assert0(pa_ml);
+ av_assert0(pa_ctx);
+
+ if (*pa_ctx) {
+ pa_context_set_state_callback(*pa_ctx, NULL, NULL);
+ pa_context_disconnect(*pa_ctx);
+ pa_context_unref(*pa_ctx);
+ }
+ if (*pa_ml)
+ pa_mainloop_free(*pa_ml);
+ *pa_ml = NULL;
+ *pa_ctx = NULL;
+}
+
+int ff_pulse_audio_connect_context(pa_mainloop **pa_ml, pa_context **pa_ctx,
+ const char *server, const char *description)
+{
+ int ret;
+ pa_mainloop_api *pa_mlapi = NULL;
+ enum PulseAudioContextState context_state = PULSE_CONTEXT_INITIALIZING;
+
+ av_assert0(pa_ml);
+ av_assert0(pa_ctx);
+
+ *pa_ml = NULL;
+ *pa_ctx = NULL;
+
+ if (!(*pa_ml = pa_mainloop_new()))
+ return AVERROR(ENOMEM);
+ if (!(pa_mlapi = pa_mainloop_get_api(*pa_ml))) {
+ ret = AVERROR_EXTERNAL;
+ goto fail;
+ }
+ if (!(*pa_ctx = pa_context_new(pa_mlapi, description))) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ pa_context_set_state_callback(*pa_ctx, pa_state_cb, &context_state);
+ if (pa_context_connect(*pa_ctx, server, 0, NULL) < 0) {
+ ret = AVERROR_EXTERNAL;
+ goto fail;
+ }
+
+ while (context_state == PULSE_CONTEXT_INITIALIZING)
+ pa_mainloop_iterate(*pa_ml, 1, NULL);
+ if (context_state == PULSE_CONTEXT_FINISHED) {
+ ret = AVERROR_EXTERNAL;
+ goto fail;
+ }
+ return 0;
+
+ fail:
+ ff_pulse_audio_disconnect_context(pa_ml, pa_ctx);
+ return ret;
+}
+
+static void pulse_add_detected_device(PulseAudioDeviceList *info,
+ const char *name, const char *description)
+{
+ int ret;
+ AVDeviceInfo *new_device = NULL;
+
+ if (info->error_code)
+ return;
+
+ new_device = av_mallocz(sizeof(AVDeviceInfo));
+ if (!new_device) {
+ info->error_code = AVERROR(ENOMEM);
+ return;
+ }
+
+ new_device->device_description = av_strdup(description);
+ new_device->device_name = av_strdup(name);
+
+ if (!new_device->device_description || !new_device->device_name) {
+ info->error_code = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ if ((ret = av_dynarray_add_nofree(&info->devices->devices,
+ &info->devices->nb_devices, new_device)) < 0) {
+ info->error_code = ret;
+ goto fail;
+ }
+ return;
+
+ fail:
+ av_free(new_device->device_description);
+ av_free(new_device->device_name);
+ av_free(new_device);
+
+}
+
+static void pulse_audio_source_device_cb(pa_context *c, const pa_source_info *dev,
+ int eol, void *userdata)
+{
+ if (!eol)
+ pulse_add_detected_device(userdata, dev->name, dev->description);
+}
+
+static void pulse_audio_sink_device_cb(pa_context *c, const pa_sink_info *dev,
+ int eol, void *userdata)
+{
+ if (!eol)
+ pulse_add_detected_device(userdata, dev->name, dev->description);
+}
+
+static void pulse_server_info_cb(pa_context *c, const pa_server_info *i, void *userdata)
+{
+ PulseAudioDeviceList *info = userdata;
+ if (info->output)
+ info->default_device = av_strdup(i->default_sink_name);
+ else
+ info->default_device = av_strdup(i->default_source_name);
+ if (!info->default_device)
+ info->error_code = AVERROR(ENOMEM);
+}
+
+int ff_pulse_audio_get_devices(AVDeviceInfoList *devices, const char *server, int output)
+{
+ pa_mainloop *pa_ml = NULL;
+ pa_operation *pa_op = NULL;
+ pa_context *pa_ctx = NULL;
+ enum pa_operation_state op_state;
+ PulseAudioDeviceList dev_list = { 0 };
+ int i;
+
+ dev_list.output = output;
+ dev_list.devices = devices;
+ if (!devices)
+ return AVERROR(EINVAL);
+ devices->nb_devices = 0;
+ devices->devices = NULL;
+
+ if ((dev_list.error_code = ff_pulse_audio_connect_context(&pa_ml, &pa_ctx, server, "Query devices")) < 0)
+ goto fail;
+
+ if (output)
+ pa_op = pa_context_get_sink_info_list(pa_ctx, pulse_audio_sink_device_cb, &dev_list);
+ else
+ pa_op = pa_context_get_source_info_list(pa_ctx, pulse_audio_source_device_cb, &dev_list);
+ while ((op_state = pa_operation_get_state(pa_op)) == PA_OPERATION_RUNNING)
+ pa_mainloop_iterate(pa_ml, 1, NULL);
+ if (op_state != PA_OPERATION_DONE)
+ dev_list.error_code = AVERROR_EXTERNAL;
+ pa_operation_unref(pa_op);
+ if (dev_list.error_code < 0)
+ goto fail;
+
+ pa_op = pa_context_get_server_info(pa_ctx, pulse_server_info_cb, &dev_list);
+ while ((op_state = pa_operation_get_state(pa_op)) == PA_OPERATION_RUNNING)
+ pa_mainloop_iterate(pa_ml, 1, NULL);
+ if (op_state != PA_OPERATION_DONE)
+ dev_list.error_code = AVERROR_EXTERNAL;
+ pa_operation_unref(pa_op);
+ if (dev_list.error_code < 0)
+ goto fail;
+
+ devices->default_device = -1;
+ for (i = 0; i < devices->nb_devices; i++) {
+ if (!strcmp(devices->devices[i]->device_name, dev_list.default_device)) {
+ devices->default_device = i;
+ break;
+ }
+ }
+
+ fail:
+ av_free(dev_list.default_device);
+ ff_pulse_audio_disconnect_context(&pa_ml, &pa_ctx);
+ return dev_list.error_code;
+}
diff --git a/chromium/third_party/ffmpeg/libavdevice/pulse_audio_common.h b/chromium/third_party/ffmpeg/libavdevice/pulse_audio_common.h
index 99ba6a31f16..02534f79a13 100644
--- a/chromium/third_party/ffmpeg/libavdevice/pulse_audio_common.h
+++ b/chromium/third_party/ffmpeg/libavdevice/pulse_audio_common.h
@@ -22,9 +22,17 @@
#ifndef AVDEVICE_PULSE_AUDIO_COMMON_H
#define AVDEVICE_PULSE_AUDIO_COMMON_H
-#include <pulse/simple.h>
+#include <pulse/pulseaudio.h>
#include "libavcodec/avcodec.h"
+#include "avdevice.h"
pa_sample_format_t ff_codec_id_to_pulse_format(enum AVCodecID codec_id);
+int ff_pulse_audio_get_devices(AVDeviceInfoList *devices, const char *server, int output);
+
+int ff_pulse_audio_connect_context(pa_mainloop **pa_ml, pa_context **pa_ctx,
+ const char *server, const char *description);
+
+void ff_pulse_audio_disconnect_context(pa_mainloop **pa_ml, pa_context **pa_ctx);
+
#endif /* AVDEVICE_PULSE_AUDIO_COMMON_H */
diff --git a/chromium/third_party/ffmpeg/libavdevice/pulse_audio_dec.c b/chromium/third_party/ffmpeg/libavdevice/pulse_audio_dec.c
index 639b381c34d..ec94fe1b4ad 100644
--- a/chromium/third_party/ffmpeg/libavdevice/pulse_audio_dec.c
+++ b/chromium/third_party/ffmpeg/libavdevice/pulse_audio_dec.c
@@ -54,7 +54,7 @@ static av_cold int pulse_read_header(AVFormatContext *s)
PulseData *pd = s->priv_data;
AVStream *st;
char *device = NULL;
- int ret;
+ int ret, sample_bytes;
enum AVCodecID codec_id =
s->audio_codec_id == AV_CODEC_ID_NONE ? DEFAULT_CODEC_ID : s->audio_codec_id;
const pa_sample_spec ss = { ff_codec_id_to_pulse_format(codec_id),
@@ -90,11 +90,17 @@ static av_cold int pulse_read_header(AVFormatContext *s)
st->codec->codec_id = codec_id;
st->codec->sample_rate = pd->sample_rate;
st->codec->channels = pd->channels;
- avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
+ avpriv_set_pts_info(st, 64, 1, pd->sample_rate); /* 64 bits pts in us */
pd->pts = AV_NOPTS_VALUE;
- pd->frame_duration = (pd->frame_size * 1000000LL * 8) /
- (pd->sample_rate * pd->channels * av_get_bits_per_sample(codec_id));
+ sample_bytes = (av_get_bits_per_sample(codec_id) >> 3) * pd->channels;
+
+ if (pd->frame_size % sample_bytes) {
+ av_log(s, AV_LOG_WARNING, "frame_size %i is not divisible by %i "
+ "(channels * bytes_per_sample) \n", pd->frame_size, sample_bytes);
+ }
+
+ pd->frame_duration = pd->frame_size / sample_bytes;
return 0;
}
@@ -103,7 +109,6 @@ static int pulse_read_packet(AVFormatContext *s, AVPacket *pkt)
{
PulseData *pd = s->priv_data;
int res;
- pa_usec_t latency;
if (av_new_packet(pkt, pd->frame_size) < 0) {
return AVERROR(ENOMEM);
@@ -116,13 +121,15 @@ static int pulse_read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR(EIO);
}
- if ((latency = pa_simple_get_latency(pd->s, &res)) == (pa_usec_t) -1) {
- av_log(s, AV_LOG_ERROR, "pa_simple_get_latency() failed: %s\n",
- pa_strerror(res));
- return AVERROR(EIO);
- }
-
if (pd->pts == AV_NOPTS_VALUE) {
+ pa_usec_t latency;
+
+ if ((latency = pa_simple_get_latency(pd->s, &res)) == (pa_usec_t) -1) {
+ av_log(s, AV_LOG_ERROR, "pa_simple_get_latency() failed: %s\n",
+ pa_strerror(res));
+ return AVERROR(EIO);
+ }
+
pd->pts = -latency;
}
@@ -140,6 +147,12 @@ static av_cold int pulse_close(AVFormatContext *s)
return 0;
}
+static int pulse_get_device_list(AVFormatContext *h, AVDeviceInfoList *device_list)
+{
+ PulseData *s = h->priv_data;
+ return ff_pulse_audio_get_devices(device_list, s->server, 0);
+}
+
#define OFFSET(a) offsetof(PulseData, a)
#define D AV_OPT_FLAG_DECODING_PARAM
@@ -159,6 +172,7 @@ static const AVClass pulse_demuxer_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
AVInputFormat ff_pulse_demuxer = {
@@ -168,6 +182,7 @@ AVInputFormat ff_pulse_demuxer = {
.read_header = pulse_read_header,
.read_packet = pulse_read_packet,
.read_close = pulse_close,
+ .get_device_list = pulse_get_device_list,
.flags = AVFMT_NOFILE,
.priv_class = &pulse_demuxer_class,
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/pulse_audio_enc.c b/chromium/third_party/ffmpeg/libavdevice/pulse_audio_enc.c
index e0472993918..b07d4c0c843 100644
--- a/chromium/third_party/ffmpeg/libavdevice/pulse_audio_enc.c
+++ b/chromium/third_party/ffmpeg/libavdevice/pulse_audio_enc.c
@@ -18,13 +18,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <pulse/simple.h>
+#include <math.h>
+#include <pulse/pulseaudio.h>
#include <pulse/error.h>
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "libavutil/log.h"
+#include "libavutil/attributes.h"
#include "pulse_audio_common.h"
typedef struct PulseData {
@@ -33,20 +35,421 @@ typedef struct PulseData {
const char *name;
const char *stream_name;
const char *device;
- pa_simple *pa;
int64_t timestamp;
- int buffer_size;
- int buffer_duration;
+ int buffer_size; /**< Buffer size in bytes */
+ int buffer_duration; /**< Buffer size in ms, recalculated to buffer_size */
+ int prebuf;
+ int minreq;
+ int last_result;
+ pa_threaded_mainloop *mainloop;
+ pa_context *ctx;
+ pa_stream *stream;
+ int nonblocking;
+ int mute;
+ pa_volume_t base_volume;
+ pa_volume_t last_volume;
} PulseData;
+static void pulse_audio_sink_device_cb(pa_context *ctx, const pa_sink_info *dev,
+ int eol, void *userdata)
+{
+ PulseData *s = userdata;
+
+ if (s->ctx != ctx)
+ return;
+
+ if (eol) {
+ pa_threaded_mainloop_signal(s->mainloop, 0);
+ } else {
+ if (dev->flags & PA_SINK_FLAT_VOLUME)
+ s->base_volume = dev->base_volume;
+ else
+ s->base_volume = PA_VOLUME_NORM;
+ av_log(s, AV_LOG_DEBUG, "base volume: %u\n", s->base_volume);
+ }
+}
+
+/* Mainloop must be locked before calling this function as it uses pa_threaded_mainloop_wait. */
+static int pulse_update_sink_info(AVFormatContext *h)
+{
+ PulseData *s = h->priv_data;
+ pa_operation *op;
+ if (!(op = pa_context_get_sink_info_by_name(s->ctx, s->device,
+ pulse_audio_sink_device_cb, s))) {
+ av_log(s, AV_LOG_ERROR, "pa_context_get_sink_info_by_name failed.\n");
+ return AVERROR_EXTERNAL;
+ }
+ while (pa_operation_get_state(op) == PA_OPERATION_RUNNING)
+ pa_threaded_mainloop_wait(s->mainloop);
+ pa_operation_unref(op);
+ return 0;
+}
+
+static void pulse_audio_sink_input_cb(pa_context *ctx, const pa_sink_input_info *i,
+ int eol, void *userdata)
+{
+ AVFormatContext *h = userdata;
+ PulseData *s = h->priv_data;
+
+ if (s->ctx != ctx)
+ return;
+
+ if (!eol) {
+ double val;
+ pa_volume_t vol = pa_cvolume_avg(&i->volume);
+ if (s->mute < 0 || (s->mute && !i->mute) || (!s->mute && i->mute)) {
+ s->mute = i->mute;
+ avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_MUTE_STATE_CHANGED, &s->mute, sizeof(s->mute));
+ }
+
+ vol = pa_sw_volume_divide(vol, s->base_volume);
+ if (s->last_volume != vol) {
+ val = (double)vol / PA_VOLUME_NORM;
+ avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_VOLUME_LEVEL_CHANGED, &val, sizeof(val));
+ s->last_volume = vol;
+ }
+ }
+}
+
+/* This function creates new loop so may be called from PA callbacks.
+ Mainloop must be locked before calling this function as it operates on streams. */
+static int pulse_update_sink_input_info(AVFormatContext *h)
+{
+ PulseData *s = h->priv_data;
+ pa_operation *op;
+ enum pa_operation_state op_state;
+ pa_mainloop *ml = NULL;
+ pa_context *ctx = NULL;
+ int ret = 0;
+
+ if ((ret = ff_pulse_audio_connect_context(&ml, &ctx, s->server, "Update sink input information")) < 0)
+ return ret;
+
+ if (!(op = pa_context_get_sink_input_info(ctx, pa_stream_get_index(s->stream),
+ pulse_audio_sink_input_cb, h))) {
+ ret = AVERROR_EXTERNAL;
+ goto fail;
+ }
+
+ while ((op_state = pa_operation_get_state(op)) == PA_OPERATION_RUNNING)
+ pa_mainloop_iterate(ml, 1, NULL);
+ pa_operation_unref(op);
+ if (op_state != PA_OPERATION_DONE) {
+ ret = AVERROR_EXTERNAL;
+ goto fail;
+ }
+
+ fail:
+ ff_pulse_audio_disconnect_context(&ml, &ctx);
+ if (ret)
+ av_log(s, AV_LOG_ERROR, "pa_context_get_sink_input_info failed.\n");
+ return ret;
+}
+
+static void pulse_event(pa_context *ctx, pa_subscription_event_type_t t,
+ uint32_t idx, void *userdata)
+{
+ AVFormatContext *h = userdata;
+ PulseData *s = h->priv_data;
+
+ if (s->ctx != ctx)
+ return;
+
+ if ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK_INPUT) {
+ if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_CHANGE)
+ // Calling from mainloop callback. No need to lock mainloop.
+ pulse_update_sink_input_info(h);
+ }
+}
+
+static void pulse_stream_writable(pa_stream *stream, size_t nbytes, void *userdata)
+{
+ AVFormatContext *h = userdata;
+ PulseData *s = h->priv_data;
+ int64_t val = nbytes;
+
+ if (stream != s->stream)
+ return;
+
+ avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_BUFFER_WRITABLE, &val, sizeof(val));
+ pa_threaded_mainloop_signal(s->mainloop, 0);
+}
+
+static void pulse_overflow(pa_stream *stream, void *userdata)
+{
+ AVFormatContext *h = userdata;
+ avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_BUFFER_OVERFLOW, NULL, 0);
+}
+
+static void pulse_underflow(pa_stream *stream, void *userdata)
+{
+ AVFormatContext *h = userdata;
+ avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_BUFFER_UNDERFLOW, NULL, 0);
+}
+
+static void pulse_stream_state(pa_stream *stream, void *userdata)
+{
+ PulseData *s = userdata;
+
+ if (stream != s->stream)
+ return;
+
+ switch (pa_stream_get_state(s->stream)) {
+ case PA_STREAM_READY:
+ case PA_STREAM_FAILED:
+ case PA_STREAM_TERMINATED:
+ pa_threaded_mainloop_signal(s->mainloop, 0);
+ default:
+ break;
+ }
+}
+
+static int pulse_stream_wait(PulseData *s)
+{
+ pa_stream_state_t state;
+
+ while ((state = pa_stream_get_state(s->stream)) != PA_STREAM_READY) {
+ if (state == PA_STREAM_FAILED || state == PA_STREAM_TERMINATED)
+ return AVERROR_EXTERNAL;
+ pa_threaded_mainloop_wait(s->mainloop);
+ }
+ return 0;
+}
+
+static void pulse_context_state(pa_context *ctx, void *userdata)
+{
+ PulseData *s = userdata;
+
+ if (s->ctx != ctx)
+ return;
+
+ switch (pa_context_get_state(ctx)) {
+ case PA_CONTEXT_READY:
+ case PA_CONTEXT_FAILED:
+ case PA_CONTEXT_TERMINATED:
+ pa_threaded_mainloop_signal(s->mainloop, 0);
+ default:
+ break;
+ }
+}
+
+static int pulse_context_wait(PulseData *s)
+{
+ pa_context_state_t state;
+
+ while ((state = pa_context_get_state(s->ctx)) != PA_CONTEXT_READY) {
+ if (state == PA_CONTEXT_FAILED || state == PA_CONTEXT_TERMINATED)
+ return AVERROR_EXTERNAL;
+ pa_threaded_mainloop_wait(s->mainloop);
+ }
+ return 0;
+}
+
+static void pulse_stream_result(pa_stream *stream, int success, void *userdata)
+{
+ PulseData *s = userdata;
+
+ if (stream != s->stream)
+ return;
+
+ s->last_result = success ? 0 : AVERROR_EXTERNAL;
+ pa_threaded_mainloop_signal(s->mainloop, 0);
+}
+
+static int pulse_finish_stream_operation(PulseData *s, pa_operation *op, const char *name)
+{
+ if (!op) {
+ pa_threaded_mainloop_unlock(s->mainloop);
+ av_log(s, AV_LOG_ERROR, "%s failed.\n", name);
+ return AVERROR_EXTERNAL;
+ }
+ s->last_result = 2;
+ while (s->last_result == 2)
+ pa_threaded_mainloop_wait(s->mainloop);
+ pa_operation_unref(op);
+ pa_threaded_mainloop_unlock(s->mainloop);
+ if (s->last_result != 0)
+ av_log(s, AV_LOG_ERROR, "%s failed.\n", name);
+ return s->last_result;
+}
+
+static int pulse_set_pause(PulseData *s, int pause)
+{
+ pa_operation *op;
+ pa_threaded_mainloop_lock(s->mainloop);
+ op = pa_stream_cork(s->stream, pause, pulse_stream_result, s);
+ return pulse_finish_stream_operation(s, op, "pa_stream_cork");
+}
+
+static int pulse_flash_stream(PulseData *s)
+{
+ pa_operation *op;
+ pa_threaded_mainloop_lock(s->mainloop);
+ op = pa_stream_flush(s->stream, pulse_stream_result, s);
+ return pulse_finish_stream_operation(s, op, "pa_stream_flush");
+}
+
+static void pulse_context_result(pa_context *ctx, int success, void *userdata)
+{
+ PulseData *s = userdata;
+
+ if (s->ctx != ctx)
+ return;
+
+ s->last_result = success ? 0 : AVERROR_EXTERNAL;
+ pa_threaded_mainloop_signal(s->mainloop, 0);
+}
+
+static int pulse_finish_context_operation(PulseData *s, pa_operation *op, const char *name)
+{
+ if (!op) {
+ pa_threaded_mainloop_unlock(s->mainloop);
+ av_log(s, AV_LOG_ERROR, "%s failed.\n", name);
+ return AVERROR_EXTERNAL;
+ }
+ s->last_result = 2;
+ while (s->last_result == 2)
+ pa_threaded_mainloop_wait(s->mainloop);
+ pa_operation_unref(op);
+ pa_threaded_mainloop_unlock(s->mainloop);
+ if (s->last_result != 0)
+ av_log(s, AV_LOG_ERROR, "%s failed.\n", name);
+ return s->last_result;
+}
+
+static int pulse_set_mute(PulseData *s)
+{
+ pa_operation *op;
+ pa_threaded_mainloop_lock(s->mainloop);
+ op = pa_context_set_sink_input_mute(s->ctx, pa_stream_get_index(s->stream),
+ s->mute, pulse_context_result, s);
+ return pulse_finish_context_operation(s, op, "pa_context_set_sink_input_mute");
+}
+
+static int pulse_set_volume(PulseData *s, double volume)
+{
+ pa_operation *op;
+ pa_cvolume cvol;
+ pa_volume_t vol;
+ const pa_sample_spec *ss = pa_stream_get_sample_spec(s->stream);
+
+ vol = pa_sw_volume_multiply(lround(volume * PA_VOLUME_NORM), s->base_volume);
+ pa_cvolume_set(&cvol, ss->channels, PA_VOLUME_NORM);
+ pa_sw_cvolume_multiply_scalar(&cvol, &cvol, vol);
+ pa_threaded_mainloop_lock(s->mainloop);
+ op = pa_context_set_sink_input_volume(s->ctx, pa_stream_get_index(s->stream),
+ &cvol, pulse_context_result, s);
+ return pulse_finish_context_operation(s, op, "pa_context_set_sink_input_volume");
+}
+
+static int pulse_subscribe_events(PulseData *s)
+{
+ pa_operation *op;
+
+ pa_threaded_mainloop_lock(s->mainloop);
+ op = pa_context_subscribe(s->ctx, PA_SUBSCRIPTION_MASK_SINK_INPUT, pulse_context_result, s);
+ return pulse_finish_context_operation(s, op, "pa_context_subscribe");
+}
+
+static void pulse_map_channels_to_pulse(int64_t channel_layout, pa_channel_map *channel_map)
+{
+ channel_map->channels = 0;
+ if (channel_layout & AV_CH_FRONT_LEFT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_FRONT_LEFT;
+ if (channel_layout & AV_CH_FRONT_RIGHT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_FRONT_RIGHT;
+ if (channel_layout & AV_CH_FRONT_CENTER)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_FRONT_CENTER;
+ if (channel_layout & AV_CH_LOW_FREQUENCY)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_LFE;
+ if (channel_layout & AV_CH_BACK_LEFT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_REAR_LEFT;
+ if (channel_layout & AV_CH_BACK_RIGHT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_REAR_RIGHT;
+ if (channel_layout & AV_CH_FRONT_LEFT_OF_CENTER)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER;
+ if (channel_layout & AV_CH_FRONT_RIGHT_OF_CENTER)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER;
+ if (channel_layout & AV_CH_BACK_CENTER)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_REAR_CENTER;
+ if (channel_layout & AV_CH_SIDE_LEFT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_SIDE_LEFT;
+ if (channel_layout & AV_CH_SIDE_RIGHT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_SIDE_RIGHT;
+ if (channel_layout & AV_CH_TOP_CENTER)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_TOP_CENTER;
+ if (channel_layout & AV_CH_TOP_FRONT_LEFT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_TOP_FRONT_LEFT;
+ if (channel_layout & AV_CH_TOP_FRONT_CENTER)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_TOP_FRONT_CENTER;
+ if (channel_layout & AV_CH_TOP_FRONT_RIGHT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_TOP_FRONT_RIGHT;
+ if (channel_layout & AV_CH_TOP_BACK_LEFT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_TOP_REAR_LEFT;
+ if (channel_layout & AV_CH_TOP_BACK_CENTER)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_TOP_REAR_CENTER;
+ if (channel_layout & AV_CH_TOP_BACK_RIGHT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_TOP_REAR_RIGHT;
+ if (channel_layout & AV_CH_STEREO_LEFT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_FRONT_LEFT;
+ if (channel_layout & AV_CH_STEREO_RIGHT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_FRONT_RIGHT;
+ if (channel_layout & AV_CH_WIDE_LEFT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_AUX0;
+ if (channel_layout & AV_CH_WIDE_RIGHT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_AUX1;
+ if (channel_layout & AV_CH_SURROUND_DIRECT_LEFT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_AUX2;
+ if (channel_layout & AV_CH_SURROUND_DIRECT_RIGHT)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_AUX3;
+ if (channel_layout & AV_CH_LOW_FREQUENCY_2)
+ channel_map->map[channel_map->channels++] = PA_CHANNEL_POSITION_LFE;
+}
+
+static av_cold int pulse_write_trailer(AVFormatContext *h)
+{
+ PulseData *s = h->priv_data;
+
+ if (s->mainloop) {
+ pa_threaded_mainloop_lock(s->mainloop);
+ if (s->stream) {
+ pa_stream_disconnect(s->stream);
+ pa_stream_set_state_callback(s->stream, NULL, NULL);
+ pa_stream_set_write_callback(s->stream, NULL, NULL);
+ pa_stream_set_overflow_callback(s->stream, NULL, NULL);
+ pa_stream_set_underflow_callback(s->stream, NULL, NULL);
+ pa_stream_unref(s->stream);
+ s->stream = NULL;
+ }
+ if (s->ctx) {
+ pa_context_disconnect(s->ctx);
+ pa_context_set_state_callback(s->ctx, NULL, NULL);
+ pa_context_set_subscribe_callback(s->ctx, NULL, NULL);
+ pa_context_unref(s->ctx);
+ s->ctx = NULL;
+ }
+ pa_threaded_mainloop_unlock(s->mainloop);
+ pa_threaded_mainloop_stop(s->mainloop);
+ pa_threaded_mainloop_free(s->mainloop);
+ s->mainloop = NULL;
+ }
+
+ return 0;
+}
+
static av_cold int pulse_write_header(AVFormatContext *h)
{
PulseData *s = h->priv_data;
AVStream *st = NULL;
int ret;
- pa_sample_spec ss;
- pa_buffer_attr attr = { -1, -1, -1, -1, -1 };
+ pa_sample_spec sample_spec;
+ pa_buffer_attr buffer_attributes = { -1, -1, -1, -1, -1 };
+ pa_channel_map channel_map;
+ pa_mainloop_api *mainloop_api;
const char *stream_name = s->stream_name;
+ static const pa_stream_flags_t stream_flags = PA_STREAM_INTERPOLATE_TIMING |
+ PA_STREAM_AUTO_TIMING_UPDATE |
+ PA_STREAM_NOT_MONOTONIC;
if (h->nb_streams != 1 || h->streams[0]->codec->codec_type != AVMEDIA_TYPE_AUDIO) {
av_log(s, AV_LOG_ERROR, "Only a single audio stream is supported.\n");
@@ -60,65 +463,171 @@ static av_cold int pulse_write_header(AVFormatContext *h)
else
stream_name = "Playback";
}
+ s->nonblocking = (h->flags & AVFMT_FLAG_NONBLOCK);
if (s->buffer_duration) {
int64_t bytes = s->buffer_duration;
bytes *= st->codec->channels * st->codec->sample_rate *
av_get_bytes_per_sample(st->codec->sample_fmt);
bytes /= 1000;
- attr.tlength = FFMAX(s->buffer_size, av_clip64(bytes, 0, UINT32_MAX - 1));
+ buffer_attributes.tlength = FFMAX(s->buffer_size, av_clip64(bytes, 0, UINT32_MAX - 1));
av_log(s, AV_LOG_DEBUG,
"Buffer duration: %ums recalculated into %"PRId64" bytes buffer.\n",
s->buffer_duration, bytes);
- av_log(s, AV_LOG_DEBUG, "Real buffer length is %u bytes\n", attr.tlength);
+ av_log(s, AV_LOG_DEBUG, "Real buffer length is %u bytes\n", buffer_attributes.tlength);
} else if (s->buffer_size)
- attr.tlength = s->buffer_size;
+ buffer_attributes.tlength = s->buffer_size;
+ if (s->prebuf)
+ buffer_attributes.prebuf = s->prebuf;
+ if (s->minreq)
+ buffer_attributes.minreq = s->minreq;
- ss.format = ff_codec_id_to_pulse_format(st->codec->codec_id);
- ss.rate = st->codec->sample_rate;
- ss.channels = st->codec->channels;
+ sample_spec.format = ff_codec_id_to_pulse_format(st->codec->codec_id);
+ sample_spec.rate = st->codec->sample_rate;
+ sample_spec.channels = st->codec->channels;
+ if (!pa_sample_spec_valid(&sample_spec)) {
+ av_log(s, AV_LOG_ERROR, "Invalid sample spec.\n");
+ return AVERROR(EINVAL);
+ }
- s->pa = pa_simple_new(s->server, // Server
- s->name, // Application name
- PA_STREAM_PLAYBACK,
- s->device, // Device
- stream_name, // Description of a stream
- &ss, // Sample format
- NULL, // Use default channel map
- &attr, // Buffering attributes
- &ret); // Result
+ if (sample_spec.channels == 1) {
+ channel_map.channels = 1;
+ channel_map.map[0] = PA_CHANNEL_POSITION_MONO;
+ } else if (st->codec->channel_layout) {
+ if (av_get_channel_layout_nb_channels(st->codec->channel_layout) != st->codec->channels)
+ return AVERROR(EINVAL);
+ pulse_map_channels_to_pulse(st->codec->channel_layout, &channel_map);
+ /* Unknown channel is present in channel_layout, let PulseAudio use its default. */
+ if (channel_map.channels != sample_spec.channels) {
+ av_log(s, AV_LOG_WARNING, "Unknown channel. Using defaul channel map.\n");
+ channel_map.channels = 0;
+ }
+ } else
+ channel_map.channels = 0;
- if (!s->pa) {
- av_log(s, AV_LOG_ERROR, "pa_simple_new failed: %s\n", pa_strerror(ret));
- return AVERROR(EIO);
+ if (!channel_map.channels)
+ av_log(s, AV_LOG_WARNING, "Using PulseAudio's default channel map.\n");
+ else if (!pa_channel_map_valid(&channel_map)) {
+ av_log(s, AV_LOG_ERROR, "Invalid channel map.\n");
+ return AVERROR(EINVAL);
}
- avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
+ /* start main loop */
+ s->mainloop = pa_threaded_mainloop_new();
+ if (!s->mainloop) {
+ av_log(s, AV_LOG_ERROR, "Cannot create threaded mainloop.\n");
+ return AVERROR(ENOMEM);
+ }
+ if ((ret = pa_threaded_mainloop_start(s->mainloop)) < 0) {
+ av_log(s, AV_LOG_ERROR, "Cannot start threaded mainloop: %s.\n", pa_strerror(ret));
+ pa_threaded_mainloop_free(s->mainloop);
+ s->mainloop = NULL;
+ return AVERROR_EXTERNAL;
+ }
- return 0;
-}
+ pa_threaded_mainloop_lock(s->mainloop);
+
+ mainloop_api = pa_threaded_mainloop_get_api(s->mainloop);
+ if (!mainloop_api) {
+ av_log(s, AV_LOG_ERROR, "Cannot get mainloop API.\n");
+ ret = AVERROR_EXTERNAL;
+ goto fail;
+ }
+
+ s->ctx = pa_context_new(mainloop_api, s->name);
+ if (!s->ctx) {
+ av_log(s, AV_LOG_ERROR, "Cannot create context.\n");
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ pa_context_set_state_callback(s->ctx, pulse_context_state, s);
+ pa_context_set_subscribe_callback(s->ctx, pulse_event, h);
+
+ if ((ret = pa_context_connect(s->ctx, s->server, 0, NULL)) < 0) {
+ av_log(s, AV_LOG_ERROR, "Cannot connect context: %s.\n", pa_strerror(ret));
+ ret = AVERROR_EXTERNAL;
+ goto fail;
+ }
+
+ if ((ret = pulse_context_wait(s)) < 0) {
+ av_log(s, AV_LOG_ERROR, "Context failed.\n");
+ goto fail;
+ }
+
+ s->stream = pa_stream_new(s->ctx, stream_name, &sample_spec,
+ channel_map.channels ? &channel_map : NULL);
+
+ if ((ret = pulse_update_sink_info(h)) < 0) {
+ av_log(s, AV_LOG_ERROR, "Updating sink info failed.\n");
+ goto fail;
+ }
+
+ if (!s->stream) {
+ av_log(s, AV_LOG_ERROR, "Cannot create stream.\n");
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ pa_stream_set_state_callback(s->stream, pulse_stream_state, s);
+ pa_stream_set_write_callback(s->stream, pulse_stream_writable, h);
+ pa_stream_set_overflow_callback(s->stream, pulse_overflow, h);
+ pa_stream_set_underflow_callback(s->stream, pulse_underflow, h);
+
+ if ((ret = pa_stream_connect_playback(s->stream, s->device, &buffer_attributes,
+ stream_flags, NULL, NULL)) < 0) {
+ av_log(s, AV_LOG_ERROR, "pa_stream_connect_playback failed: %s.\n", pa_strerror(ret));
+ ret = AVERROR_EXTERNAL;
+ goto fail;
+ }
+
+ if ((ret = pulse_stream_wait(s)) < 0) {
+ av_log(s, AV_LOG_ERROR, "Stream failed.\n");
+ goto fail;
+ }
+
+ /* read back buffer attributes for future use */
+ buffer_attributes = *pa_stream_get_buffer_attr(s->stream);
+ s->buffer_size = buffer_attributes.tlength;
+ s->prebuf = buffer_attributes.prebuf;
+ s->minreq = buffer_attributes.minreq;
+ av_log(s, AV_LOG_DEBUG, "Real buffer attributes: size: %d, prebuf: %d, minreq: %d\n",
+ s->buffer_size, s->prebuf, s->minreq);
+
+ pa_threaded_mainloop_unlock(s->mainloop);
+
+ if ((ret = pulse_subscribe_events(s)) < 0) {
+ av_log(s, AV_LOG_ERROR, "Event subscription failed.\n");
+ /* a bit ugly but the simplest to lock here*/
+ pa_threaded_mainloop_lock(s->mainloop);
+ goto fail;
+ }
+
+ /* force control messages */
+ s->mute = -1;
+ s->last_volume = PA_VOLUME_INVALID;
+ pa_threaded_mainloop_lock(s->mainloop);
+ if ((ret = pulse_update_sink_input_info(h)) < 0) {
+ av_log(s, AV_LOG_ERROR, "Updating sink input info failed.\n");
+ goto fail;
+ }
+ pa_threaded_mainloop_unlock(s->mainloop);
+
+ avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
-static av_cold int pulse_write_trailer(AVFormatContext *h)
-{
- PulseData *s = h->priv_data;
- pa_simple_flush(s->pa, NULL);
- pa_simple_free(s->pa);
- s->pa = NULL;
return 0;
+ fail:
+ pa_threaded_mainloop_unlock(s->mainloop);
+ pulse_write_trailer(h);
+ return ret;
}
static int pulse_write_packet(AVFormatContext *h, AVPacket *pkt)
{
PulseData *s = h->priv_data;
- int error;
+ int ret;
+ int64_t writable_size;
- if (!pkt) {
- if (pa_simple_flush(s->pa, &error) < 0) {
- av_log(s, AV_LOG_ERROR, "pa_simple_flush failed: %s\n", pa_strerror(error));
- return AVERROR(EIO);
- }
- return 1;
- }
+ if (!pkt)
+ return pulse_flash_stream(s);
if (pkt->dts != AV_NOPTS_VALUE)
s->timestamp = pkt->dts;
@@ -133,52 +642,155 @@ static int pulse_write_packet(AVFormatContext *h, AVPacket *pkt)
s->timestamp += av_rescale_q(samples, r, st->time_base);
}
- if (pa_simple_write(s->pa, pkt->data, pkt->size, &error) < 0) {
- av_log(s, AV_LOG_ERROR, "pa_simple_write failed: %s\n", pa_strerror(error));
- return AVERROR(EIO);
+ pa_threaded_mainloop_lock(s->mainloop);
+ if (!PA_STREAM_IS_GOOD(pa_stream_get_state(s->stream))) {
+ av_log(s, AV_LOG_ERROR, "PulseAudio stream is in invalid state.\n");
+ goto fail;
+ }
+ while (pa_stream_writable_size(s->stream) < s->minreq) {
+ if (s->nonblocking) {
+ pa_threaded_mainloop_unlock(s->mainloop);
+ return AVERROR(EAGAIN);
+ } else
+ pa_threaded_mainloop_wait(s->mainloop);
}
+ if ((ret = pa_stream_write(s->stream, pkt->data, pkt->size, NULL, 0, PA_SEEK_RELATIVE)) < 0) {
+ av_log(s, AV_LOG_ERROR, "pa_stream_write failed: %s\n", pa_strerror(ret));
+ goto fail;
+ }
+ if ((writable_size = pa_stream_writable_size(s->stream)) >= s->minreq)
+ avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_BUFFER_WRITABLE, &writable_size, sizeof(writable_size));
+
+ pa_threaded_mainloop_unlock(s->mainloop);
+
return 0;
+ fail:
+ pa_threaded_mainloop_unlock(s->mainloop);
+ return AVERROR_EXTERNAL;
+}
+
+static int pulse_write_frame(AVFormatContext *h, int stream_index,
+ AVFrame **frame, unsigned flags)
+{
+ AVPacket pkt;
+
+ /* Planar formats are not supported yet. */
+ if (flags & AV_WRITE_UNCODED_FRAME_QUERY)
+ return av_sample_fmt_is_planar(h->streams[stream_index]->codec->sample_fmt) ?
+ AVERROR(EINVAL) : 0;
+
+ pkt.data = (*frame)->data[0];
+ pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * (*frame)->channels;
+ pkt.dts = (*frame)->pkt_dts;
+ pkt.duration = av_frame_get_pkt_duration(*frame);
+ return pulse_write_packet(h, &pkt);
}
+
static void pulse_get_output_timestamp(AVFormatContext *h, int stream, int64_t *dts, int64_t *wall)
{
PulseData *s = h->priv_data;
- pa_usec_t latency = pa_simple_get_latency(s->pa, NULL);
- *wall = av_gettime();
- *dts = s->timestamp - latency;
+ pa_usec_t latency;
+ int neg;
+ pa_threaded_mainloop_lock(s->mainloop);
+ pa_stream_get_latency(s->stream, &latency, &neg);
+ pa_threaded_mainloop_unlock(s->mainloop);
+ if (wall)
+ *wall = av_gettime();
+ if (dts)
+ *dts = s->timestamp - (neg ? -latency : latency);
+}
+
+static int pulse_get_device_list(AVFormatContext *h, AVDeviceInfoList *device_list)
+{
+ PulseData *s = h->priv_data;
+ return ff_pulse_audio_get_devices(device_list, s->server, 1);
+}
+
+static int pulse_control_message(AVFormatContext *h, int type,
+ void *data, size_t data_size)
+{
+ PulseData *s = h->priv_data;
+ int ret;
+
+ switch(type) {
+ case AV_APP_TO_DEV_PAUSE:
+ return pulse_set_pause(s, 1);
+ case AV_APP_TO_DEV_PLAY:
+ return pulse_set_pause(s, 0);
+ case AV_APP_TO_DEV_TOGGLE_PAUSE:
+ return pulse_set_pause(s, !pa_stream_is_corked(s->stream));
+ case AV_APP_TO_DEV_MUTE:
+ if (!s->mute) {
+ s->mute = 1;
+ return pulse_set_mute(s);
+ }
+ return 0;
+ case AV_APP_TO_DEV_UNMUTE:
+ if (s->mute) {
+ s->mute = 0;
+ return pulse_set_mute(s);
+ }
+ return 0;
+ case AV_APP_TO_DEV_TOGGLE_MUTE:
+ s->mute = !s->mute;
+ return pulse_set_mute(s);
+ case AV_APP_TO_DEV_SET_VOLUME:
+ return pulse_set_volume(s, *(double *)data);
+ case AV_APP_TO_DEV_GET_VOLUME:
+ s->last_volume = PA_VOLUME_INVALID;
+ pa_threaded_mainloop_lock(s->mainloop);
+ ret = pulse_update_sink_input_info(h);
+ pa_threaded_mainloop_unlock(s->mainloop);
+ return ret;
+ case AV_APP_TO_DEV_GET_MUTE:
+ s->mute = -1;
+ pa_threaded_mainloop_lock(s->mainloop);
+ ret = pulse_update_sink_input_info(h);
+ pa_threaded_mainloop_unlock(s->mainloop);
+ return ret;
+ default:
+ break;
+ }
+ return AVERROR(ENOSYS);
}
#define OFFSET(a) offsetof(PulseData, a)
#define E AV_OPT_FLAG_ENCODING_PARAM
-
static const AVOption options[] = {
- { "server", "set PulseAudio server", OFFSET(server), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
- { "name", "set application name", OFFSET(name), AV_OPT_TYPE_STRING, {.str = LIBAVFORMAT_IDENT}, 0, 0, E },
- { "stream_name", "set stream description", OFFSET(stream_name), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
- { "device", "set device name", OFFSET(device), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
- { "buffer_size", "set buffer size in bytes", OFFSET(buffer_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
- { "buffer_duration", "set buffer duration in millisecs", OFFSET(buffer_duration), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
+ { "server", "set PulseAudio server", OFFSET(server), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
+ { "name", "set application name", OFFSET(name), AV_OPT_TYPE_STRING, {.str = LIBAVFORMAT_IDENT}, 0, 0, E },
+ { "stream_name", "set stream description", OFFSET(stream_name), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
+ { "device", "set device name", OFFSET(device), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
+ { "buffer_size", "set buffer size in bytes", OFFSET(buffer_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
+ { "buffer_duration", "set buffer duration in millisecs", OFFSET(buffer_duration), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
+ { "prebuf", "set pre-buffering size", OFFSET(prebuf), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
+ { "minreq", "set minimum request size", OFFSET(minreq), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
{ NULL }
};
static const AVClass pulse_muxer_class = {
- .class_name = "Pulse muxer",
+ .class_name = "PulseAudio muxer",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
};
AVOutputFormat ff_pulse_muxer = {
- .name = "pulse",
- .long_name = NULL_IF_CONFIG_SMALL("Pulse audio output"),
- .priv_data_size = sizeof(PulseData),
- .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
- .video_codec = AV_CODEC_ID_NONE,
- .write_header = pulse_write_header,
- .write_packet = pulse_write_packet,
- .write_trailer = pulse_write_trailer,
+ .name = "pulse",
+ .long_name = NULL_IF_CONFIG_SMALL("Pulse audio output"),
+ .priv_data_size = sizeof(PulseData),
+ .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+ .video_codec = AV_CODEC_ID_NONE,
+ .write_header = pulse_write_header,
+ .write_packet = pulse_write_packet,
+ .write_uncoded_frame = pulse_write_frame,
+ .write_trailer = pulse_write_trailer,
.get_output_timestamp = pulse_get_output_timestamp,
- .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
- .priv_class = &pulse_muxer_class,
+ .get_device_list = pulse_get_device_list,
+ .control_message = pulse_control_message,
+ .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
+ .priv_class = &pulse_muxer_class,
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/qtkit.m b/chromium/third_party/ffmpeg/libavdevice/qtkit.m
new file mode 100644
index 00000000000..aa8fa167878
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavdevice/qtkit.m
@@ -0,0 +1,358 @@
+/*
+ * QTKit input device
+ * Copyright (c) 2013 Vadim Kalinsky <vadim@kalinsky.ru>
+ *
+ * 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
+ * QTKit input device
+ * @author Vadim Kalinsky <vadim@kalinsky.ru>
+ */
+
+#import <QTKit/QTKit.h>
+#include <pthread.h>
+
+#include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
+#include "libavformat/internal.h"
+#include "libavutil/internal.h"
+#include "libavutil/time.h"
+#include "avdevice.h"
+
+#define QTKIT_TIMEBASE 100
+
+static const AVRational kQTKitTimeBase_q = {
+ .num = 1,
+ .den = QTKIT_TIMEBASE
+};
+
+typedef struct
+{
+ AVClass* class;
+
+ float frame_rate;
+ int frames_captured;
+ int64_t first_pts;
+ pthread_mutex_t frame_lock;
+ pthread_cond_t frame_wait_cond;
+ id qt_delegate;
+
+ int list_devices;
+ int video_device_index;
+
+ QTCaptureSession* capture_session;
+ QTCaptureDecompressedVideoOutput* video_output;
+ CVImageBufferRef current_frame;
+} CaptureContext;
+
+static void lock_frames(CaptureContext* ctx)
+{
+ pthread_mutex_lock(&ctx->frame_lock);
+}
+
+static void unlock_frames(CaptureContext* ctx)
+{
+ pthread_mutex_unlock(&ctx->frame_lock);
+}
+
+/** FrameReciever class - delegate for QTCaptureSession
+ */
+@interface FFMPEG_FrameReceiver : NSObject
+{
+ CaptureContext* _context;
+}
+
+- (id)initWithContext:(CaptureContext*)context;
+
+- (void)captureOutput:(QTCaptureOutput *)captureOutput
+ didOutputVideoFrame:(CVImageBufferRef)videoFrame
+ withSampleBuffer:(QTSampleBuffer *)sampleBuffer
+ fromConnection:(QTCaptureConnection *)connection;
+
+@end
+
+@implementation FFMPEG_FrameReceiver
+
+- (id)initWithContext:(CaptureContext*)context
+{
+ if (self = [super init]) {
+ _context = context;
+ }
+ return self;
+}
+
+- (void)captureOutput:(QTCaptureOutput *)captureOutput
+ didOutputVideoFrame:(CVImageBufferRef)videoFrame
+ withSampleBuffer:(QTSampleBuffer *)sampleBuffer
+ fromConnection:(QTCaptureConnection *)connection
+{
+ lock_frames(_context);
+ if (_context->current_frame != nil) {
+ CVBufferRelease(_context->current_frame);
+ }
+
+ _context->current_frame = CVBufferRetain(videoFrame);
+
+ pthread_cond_signal(&_context->frame_wait_cond);
+
+ unlock_frames(_context);
+
+ ++_context->frames_captured;
+}
+
+@end
+
+static void destroy_context(CaptureContext* ctx)
+{
+ [ctx->capture_session stopRunning];
+
+ [ctx->capture_session release];
+ [ctx->video_output release];
+ [ctx->qt_delegate release];
+
+ ctx->capture_session = NULL;
+ ctx->video_output = NULL;
+ ctx->qt_delegate = NULL;
+
+ pthread_mutex_destroy(&ctx->frame_lock);
+ pthread_cond_destroy(&ctx->frame_wait_cond);
+
+ if (ctx->current_frame)
+ CVBufferRelease(ctx->current_frame);
+}
+
+static int qtkit_read_header(AVFormatContext *s)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+ CaptureContext* ctx = (CaptureContext*)s->priv_data;
+
+ ctx->first_pts = av_gettime();
+
+ pthread_mutex_init(&ctx->frame_lock, NULL);
+ pthread_cond_init(&ctx->frame_wait_cond, NULL);
+
+ // List devices if requested
+ if (ctx->list_devices) {
+ av_log(ctx, AV_LOG_INFO, "QTKit video devices:\n");
+ NSArray *devices = [QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo];
+ for (QTCaptureDevice *device in devices) {
+ const char *name = [[device localizedDisplayName] UTF8String];
+ int index = [devices indexOfObject:device];
+ av_log(ctx, AV_LOG_INFO, "[%d] %s\n", index, name);
+ }
+ goto fail;
+ }
+
+ // Find capture device
+ QTCaptureDevice *video_device = nil;
+
+ // check for device index given in filename
+ if (ctx->video_device_index == -1) {
+ sscanf(s->filename, "%d", &ctx->video_device_index);
+ }
+
+ if (ctx->video_device_index >= 0) {
+ NSArray *devices = [QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo];
+
+ if (ctx->video_device_index >= [devices count]) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid device index\n");
+ goto fail;
+ }
+
+ video_device = [devices objectAtIndex:ctx->video_device_index];
+ } else if (strncmp(s->filename, "", 1) &&
+ strncmp(s->filename, "default", 7)) {
+ NSArray *devices = [QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo];
+
+ for (QTCaptureDevice *device in devices) {
+ if (!strncmp(s->filename, [[device localizedDisplayName] UTF8String], strlen(s->filename))) {
+ video_device = device;
+ break;
+ }
+ }
+ if (!video_device) {
+ av_log(ctx, AV_LOG_ERROR, "Video device not found\n");
+ goto fail;
+ }
+ } else {
+ video_device = [QTCaptureDevice defaultInputDeviceWithMediaType:QTMediaTypeMuxed];
+ }
+
+ BOOL success = [video_device open:nil];
+
+ // Video capture device not found, looking for QTMediaTypeVideo
+ if (!success) {
+ video_device = [QTCaptureDevice defaultInputDeviceWithMediaType:QTMediaTypeVideo];
+ success = [video_device open:nil];
+
+ if (!success) {
+ av_log(s, AV_LOG_ERROR, "No QT capture device found\n");
+ goto fail;
+ }
+ }
+
+ NSString* dev_display_name = [video_device localizedDisplayName];
+ av_log (s, AV_LOG_DEBUG, "'%s' opened\n", [dev_display_name UTF8String]);
+
+ // Initialize capture session
+ ctx->capture_session = [[QTCaptureSession alloc] init];
+
+ QTCaptureDeviceInput* capture_dev_input = [[[QTCaptureDeviceInput alloc] initWithDevice:video_device] autorelease];
+ success = [ctx->capture_session addInput:capture_dev_input error:nil];
+
+ if (!success) {
+ av_log (s, AV_LOG_ERROR, "Failed to add QT capture device to session\n");
+ goto fail;
+ }
+
+ // Attaching output
+ // FIXME: Allow for a user defined pixel format
+ ctx->video_output = [[QTCaptureDecompressedVideoOutput alloc] init];
+
+ NSDictionary *captureDictionary = [NSDictionary dictionaryWithObject:
+ [NSNumber numberWithUnsignedInt:kCVPixelFormatType_24RGB]
+ forKey:(id)kCVPixelBufferPixelFormatTypeKey];
+
+ [ctx->video_output setPixelBufferAttributes:captureDictionary];
+
+ ctx->qt_delegate = [[FFMPEG_FrameReceiver alloc] initWithContext:ctx];
+
+ [ctx->video_output setDelegate:ctx->qt_delegate];
+ [ctx->video_output setAutomaticallyDropsLateVideoFrames:YES];
+ [ctx->video_output setMinimumVideoFrameInterval:1.0/ctx->frame_rate];
+
+ success = [ctx->capture_session addOutput:ctx->video_output error:nil];
+
+ if (!success) {
+ av_log (s, AV_LOG_ERROR, "can't add video output to capture session\n");
+ goto fail;
+ }
+
+ [ctx->capture_session startRunning];
+
+ // Take stream info from the first frame.
+ while (ctx->frames_captured < 1) {
+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, YES);
+ }
+
+ lock_frames(ctx);
+
+ AVStream* stream = avformat_new_stream(s, NULL);
+
+ if (!stream) {
+ goto fail;
+ }
+
+ avpriv_set_pts_info(stream, 64, 1, QTKIT_TIMEBASE);
+
+ stream->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
+ stream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ stream->codec->width = (int)CVPixelBufferGetWidth (ctx->current_frame);
+ stream->codec->height = (int)CVPixelBufferGetHeight(ctx->current_frame);
+ stream->codec->pix_fmt = AV_PIX_FMT_RGB24;
+
+ CVBufferRelease(ctx->current_frame);
+ ctx->current_frame = nil;
+
+ unlock_frames(ctx);
+
+ [pool release];
+
+ return 0;
+
+fail:
+ [pool release];
+
+ destroy_context(ctx);
+
+ return AVERROR(EIO);
+}
+
+static int qtkit_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ CaptureContext* ctx = (CaptureContext*)s->priv_data;
+
+ do {
+ lock_frames(ctx);
+
+ if (ctx->current_frame != nil) {
+ if (av_new_packet(pkt, (int)CVPixelBufferGetDataSize(ctx->current_frame)) < 0) {
+ return AVERROR(EIO);
+ }
+
+ pkt->pts = pkt->dts = av_rescale_q(av_gettime() - ctx->first_pts, AV_TIME_BASE_Q, kQTKitTimeBase_q);
+ pkt->stream_index = 0;
+ pkt->flags |= AV_PKT_FLAG_KEY;
+
+ CVPixelBufferLockBaseAddress(ctx->current_frame, 0);
+
+ void* data = CVPixelBufferGetBaseAddress(ctx->current_frame);
+ memcpy(pkt->data, data, pkt->size);
+
+ CVPixelBufferUnlockBaseAddress(ctx->current_frame, 0);
+ CVBufferRelease(ctx->current_frame);
+ ctx->current_frame = nil;
+ } else {
+ pkt->data = NULL;
+ pthread_cond_wait(&ctx->frame_wait_cond, &ctx->frame_lock);
+ }
+
+ unlock_frames(ctx);
+ } while (!pkt->data);
+
+ return 0;
+}
+
+static int qtkit_close(AVFormatContext *s)
+{
+ CaptureContext* ctx = (CaptureContext*)s->priv_data;
+
+ destroy_context(ctx);
+
+ return 0;
+}
+
+static const AVOption options[] = {
+ { "frame_rate", "set frame rate", offsetof(CaptureContext, frame_rate), AV_OPT_TYPE_FLOAT, { .dbl = 30.0 }, 0.1, 30.0, AV_OPT_TYPE_VIDEO_RATE, NULL },
+ { "list_devices", "list available devices", offsetof(CaptureContext, list_devices), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "list_devices" },
+ { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "list_devices" },
+ { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "list_devices" },
+ { "video_device_index", "select video device by index for devices with same name (starts at 0)", offsetof(CaptureContext, video_device_index), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+ { NULL },
+};
+
+static const AVClass qtkit_class = {
+ .class_name = "QTKit input device",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
+};
+
+AVInputFormat ff_qtkit_demuxer = {
+ .name = "qtkit",
+ .long_name = NULL_IF_CONFIG_SMALL("QTKit input device"),
+ .priv_data_size = sizeof(CaptureContext),
+ .read_header = qtkit_read_header,
+ .read_packet = qtkit_read_packet,
+ .read_close = qtkit_close,
+ .flags = AVFMT_NOFILE,
+ .priv_class = &qtkit_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavdevice/sdl.c b/chromium/third_party/ffmpeg/libavdevice/sdl.c
index 72d327e8e8d..b98aae5eeb2 100644
--- a/chromium/third_party/ffmpeg/libavdevice/sdl.c
+++ b/chromium/third_party/ffmpeg/libavdevice/sdl.c
@@ -71,12 +71,16 @@ static int sdl_write_trailer(AVFormatContext *s)
if (sdl->overlay)
SDL_FreeYUVOverlay(sdl->overlay);
+ sdl->overlay = NULL;
if (sdl->event_thread)
SDL_WaitThread(sdl->event_thread, NULL);
+ sdl->event_thread = NULL;
if (sdl->mutex)
SDL_DestroyMutex(sdl->mutex);
+ sdl->mutex = NULL;
if (sdl->init_cond)
SDL_DestroyCond(sdl->init_cond);
+ sdl->init_cond = NULL;
if (!sdl->sdl_was_already_inited)
SDL_Quit();
@@ -292,7 +296,7 @@ static int sdl_write_header(AVFormatContext *s)
/* wait until the video system has been inited */
SDL_LockMutex(sdl->mutex);
- if (!sdl->inited) {
+ while (!sdl->inited) {
SDL_CondWait(sdl->init_cond, sdl->mutex);
}
SDL_UnlockMutex(sdl->mutex);
@@ -354,6 +358,7 @@ static const AVClass sdl_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
AVOutputFormat ff_sdl_muxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/sndio_dec.c b/chromium/third_party/ffmpeg/libavdevice/sndio_dec.c
index 806f47867ef..37c6983429e 100644
--- a/chromium/third_party/ffmpeg/libavdevice/sndio_dec.c
+++ b/chromium/third_party/ffmpeg/libavdevice/sndio_dec.c
@@ -104,6 +104,7 @@ static const AVClass sndio_demuxer_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
AVInputFormat ff_sndio_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/sndio_enc.c b/chromium/third_party/ffmpeg/libavdevice/sndio_enc.c
index 84d070e89c4..205cf2411d8 100644
--- a/chromium/third_party/ffmpeg/libavdevice/sndio_enc.c
+++ b/chromium/third_party/ffmpeg/libavdevice/sndio_enc.c
@@ -76,6 +76,13 @@ static int audio_write_trailer(AVFormatContext *s1)
return 0;
}
+static const AVClass sndio_muxer_class = {
+ .class_name = "sndio outdev",
+ .item_name = av_default_item_name,
+ .version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
+};
+
AVOutputFormat ff_sndio_muxer = {
.name = "sndio",
.long_name = NULL_IF_CONFIG_SMALL("sndio audio playback"),
@@ -89,4 +96,5 @@ AVOutputFormat ff_sndio_muxer = {
.write_packet = audio_write_packet,
.write_trailer = audio_write_trailer,
.flags = AVFMT_NOFILE,
+ .priv_class = &sndio_muxer_class,
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/v4l.c b/chromium/third_party/ffmpeg/libavdevice/v4l.c
index bf2c9e372c9..d33f7142a0e 100644
--- a/chromium/third_party/ffmpeg/libavdevice/v4l.c
+++ b/chromium/third_party/ffmpeg/libavdevice/v4l.c
@@ -348,6 +348,7 @@ static const AVClass v4l_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
AVInputFormat ff_v4l_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/v4l2-common.c b/chromium/third_party/ffmpeg/libavdevice/v4l2-common.c
index 572f0ed36b9..c4c75d7b6dd 100644
--- a/chromium/third_party/ffmpeg/libavdevice/v4l2-common.c
+++ b/chromium/third_party/ffmpeg/libavdevice/v4l2-common.c
@@ -49,6 +49,12 @@ const struct fmt_map avpriv_fmt_conversion_table[] = {
#ifdef V4L2_PIX_FMT_CPIA1
{ AV_PIX_FMT_NONE, AV_CODEC_ID_CPIA, V4L2_PIX_FMT_CPIA1 },
#endif
+#ifdef V4L2_PIX_FMT_SRGGB8
+ { AV_PIX_FMT_BAYER_BGGR8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_SBGGR8 },
+ { AV_PIX_FMT_BAYER_GBRG8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_SGBRG8 },
+ { AV_PIX_FMT_BAYER_GRBG8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_SGRBG8 },
+ { AV_PIX_FMT_BAYER_RGGB8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_SRGGB8 },
+#endif
{ AV_PIX_FMT_NONE, AV_CODEC_ID_NONE, 0 },
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/v4l2.c b/chromium/third_party/ffmpeg/libavdevice/v4l2.c
index cb962b7be77..4b3f6a8c73d 100644
--- a/chromium/third_party/ffmpeg/libavdevice/v4l2.c
+++ b/chromium/third_party/ffmpeg/libavdevice/v4l2.c
@@ -447,18 +447,20 @@ static int init_convert_timestamp(AVFormatContext *ctx, int64_t ts)
return 0;
}
#if HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC)
- now = av_gettime_monotonic();
- if (s->ts_mode == V4L_TS_MONO2ABS ||
- (ts <= now + 1 * AV_TIME_BASE && ts >= now - 10 * AV_TIME_BASE)) {
- AVRational tb = {AV_TIME_BASE, 1};
- int64_t period = av_rescale_q(1, tb, ctx->streams[0]->avg_frame_rate);
- av_log(ctx, AV_LOG_INFO, "Detected monotonic timestamps, converting\n");
- /* microseconds instead of seconds, MHz instead of Hz */
- s->timefilter = ff_timefilter_new(1, period, 1.0E-6);
- if (!s->timefilter)
- return AVERROR(ENOMEM);
- s->ts_mode = V4L_TS_CONVERT_READY;
- return 0;
+ if (ctx->streams[0]->avg_frame_rate.num) {
+ now = av_gettime_monotonic();
+ if (s->ts_mode == V4L_TS_MONO2ABS ||
+ (ts <= now + 1 * AV_TIME_BASE && ts >= now - 10 * AV_TIME_BASE)) {
+ AVRational tb = {AV_TIME_BASE, 1};
+ int64_t period = av_rescale_q(1, tb, ctx->streams[0]->avg_frame_rate);
+ av_log(ctx, AV_LOG_INFO, "Detected monotonic timestamps, converting\n");
+ /* microseconds instead of seconds, MHz instead of Hz */
+ s->timefilter = ff_timefilter_new(1, period, 1.0E-6);
+ if (!s->timefilter)
+ return AVERROR(ENOMEM);
+ s->ts_mode = V4L_TS_CONVERT_READY;
+ return 0;
+ }
}
#endif
av_log(ctx, AV_LOG_ERROR, "Unknown timestamps\n");
@@ -742,9 +744,12 @@ static int v4l2_set_parameters(AVFormatContext *s1)
"The driver does not allow to change time per frame\n");
}
}
- s1->streams[0]->avg_frame_rate.num = tpf->denominator;
- s1->streams[0]->avg_frame_rate.den = tpf->numerator;
- s1->streams[0]->r_frame_rate = s1->streams[0]->avg_frame_rate;
+ if (tpf->denominator > 0 && tpf->numerator > 0) {
+ s1->streams[0]->avg_frame_rate.num = tpf->denominator;
+ s1->streams[0]->avg_frame_rate.den = tpf->numerator;
+ s1->streams[0]->r_frame_rate = s1->streams[0]->avg_frame_rate;
+ } else
+ av_log(s1, AV_LOG_WARNING, "Time per frame unknown\n");
return 0;
}
@@ -866,6 +871,9 @@ static int v4l2_read_header(AVFormatContext *s1)
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
+ if ((res = v4l2_set_parameters(s1)) < 0)
+ return res;
+
if (s->pixel_format) {
AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format);
@@ -917,9 +925,6 @@ static int v4l2_read_header(AVFormatContext *s1)
s->frame_format = desired_format;
- if ((res = v4l2_set_parameters(s1)) < 0)
- return res;
-
st->codec->pix_fmt = avpriv_fmt_v4l2ff(desired_format, codec_id);
s->frame_size =
avpicture_get_size(st->codec->pix_fmt, s->width, s->height);
@@ -946,7 +951,8 @@ static int v4l2_read_header(AVFormatContext *s1)
st->codec->codec_tag = MKTAG('Y', 'V', 'U', '9');
st->codec->width = s->width;
st->codec->height = s->height;
- st->codec->bit_rate = s->frame_size * av_q2d(st->avg_frame_rate) * 8;
+ if (st->avg_frame_rate.den)
+ st->codec->bit_rate = s->frame_size * av_q2d(st->avg_frame_rate) * 8;
return 0;
}
@@ -1008,7 +1014,7 @@ static const AVOption options[] = {
{ "default", "use timestamps from the kernel", OFFSET(ts_mode), AV_OPT_TYPE_CONST, {.i64 = V4L_TS_DEFAULT }, 0, 2, DEC, "timestamps" },
{ "abs", "use absolute timestamps (wall clock)", OFFSET(ts_mode), AV_OPT_TYPE_CONST, {.i64 = V4L_TS_ABS }, 0, 2, DEC, "timestamps" },
{ "mono2abs", "force conversion from monotonic to absolute timestamps", OFFSET(ts_mode), AV_OPT_TYPE_CONST, {.i64 = V4L_TS_MONO2ABS }, 0, 2, DEC, "timestamps" },
- { "use_libv4l2", "use libv4l2 (v4l-utils) convertion functions", OFFSET(use_libv4l2), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
+ { "use_libv4l2", "use libv4l2 (v4l-utils) conversion functions", OFFSET(use_libv4l2), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
{ NULL },
};
@@ -1017,6 +1023,7 @@ static const AVClass v4l2_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
AVInputFormat ff_v4l2_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/v4l2enc.c b/chromium/third_party/ffmpeg/libavdevice/v4l2enc.c
index 21f0ef6983e..efe08b589e0 100644
--- a/chromium/third_party/ffmpeg/libavdevice/v4l2enc.c
+++ b/chromium/third_party/ffmpeg/libavdevice/v4l2enc.c
@@ -97,6 +97,13 @@ static int write_trailer(AVFormatContext *s1)
return 0;
}
+static const AVClass v4l2_class = {
+ .class_name = "V4L2 outdev",
+ .item_name = av_default_item_name,
+ .version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
+};
+
AVOutputFormat ff_v4l2_muxer = {
.name = "v4l2",
.long_name = NULL_IF_CONFIG_SMALL("Video4Linux2 output device"),
@@ -107,4 +114,5 @@ AVOutputFormat ff_v4l2_muxer = {
.write_packet = write_packet,
.write_trailer = write_trailer,
.flags = AVFMT_NOFILE,
+ .priv_class = &v4l2_class,
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/version.h b/chromium/third_party/ffmpeg/libavdevice/version.h
index 0bbd48e7a57..163a4c63c25 100644
--- a/chromium/third_party/ffmpeg/libavdevice/version.h
+++ b/chromium/third_party/ffmpeg/libavdevice/version.h
@@ -25,11 +25,11 @@
* Libavdevice version macros
*/
-#include "libavutil/avutil.h"
+#include "libavutil/version.h"
#define LIBAVDEVICE_VERSION_MAJOR 55
-#define LIBAVDEVICE_VERSION_MINOR 5
-#define LIBAVDEVICE_VERSION_MICRO 102
+#define LIBAVDEVICE_VERSION_MINOR 13
+#define LIBAVDEVICE_VERSION_MICRO 101
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \
diff --git a/chromium/third_party/ffmpeg/libavdevice/vfwcap.c b/chromium/third_party/ffmpeg/libavdevice/vfwcap.c
index 014f18c27e6..e5d959350a2 100644
--- a/chromium/third_party/ffmpeg/libavdevice/vfwcap.c
+++ b/chromium/third_party/ffmpeg/libavdevice/vfwcap.c
@@ -469,6 +469,7 @@ static const AVClass vfw_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT
};
AVInputFormat ff_vfwcap_demuxer = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/x11grab.c b/chromium/third_party/ffmpeg/libavdevice/x11grab.c
index 0e7b6ae5ee7..d38c55d1c3b 100644
--- a/chromium/third_party/ffmpeg/libavdevice/x11grab.c
+++ b/chromium/third_party/ffmpeg/libavdevice/x11grab.c
@@ -633,6 +633,7 @@ static const AVClass x11_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
/** x11 grabber device demuxer declaration */
diff --git a/chromium/third_party/ffmpeg/libavdevice/xv.c b/chromium/third_party/ffmpeg/libavdevice/xv.c
index ad604825f28..d1f8907d99c 100644
--- a/chromium/third_party/ffmpeg/libavdevice/xv.c
+++ b/chromium/third_party/ffmpeg/libavdevice/xv.c
@@ -24,7 +24,6 @@
*
* TODO:
* - add support to more formats
- * - add support to window id specification
*/
#include <X11/Xlib.h>
@@ -36,6 +35,7 @@
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
+#include "libavformat/internal.h"
#include "avdevice.h"
typedef struct {
@@ -43,9 +43,12 @@ typedef struct {
GC gc;
Window window;
+ int64_t window_id;
char *window_title;
int window_width, window_height;
int window_x, window_y;
+ int dest_x, dest_y; /**< display area position */
+ unsigned int dest_w, dest_h; /**< display area dimensions */
Display* display;
char *display_name;
@@ -102,6 +105,8 @@ static int xv_write_header(AVFormatContext *s)
unsigned int num_adaptors;
XvAdaptorInfo *ai;
XvImageFormatValues *fv;
+ XColor fgcolor;
+ XWindowAttributes window_attrs;
int num_formats = 0, j, tag, ret;
AVCodecContext *encctx = s->streams[0]->codec;
@@ -129,26 +134,40 @@ static int xv_write_header(AVFormatContext *s)
xv->image_width = encctx->width;
xv->image_height = encctx->height;
if (!xv->window_width && !xv->window_height) {
+ AVRational sar = encctx->sample_aspect_ratio;
xv->window_width = encctx->width;
xv->window_height = encctx->height;
- }
- xv->window = XCreateSimpleWindow(xv->display, DefaultRootWindow(xv->display),
- xv->window_x, xv->window_y,
- xv->window_width, xv->window_height,
- 0, 0, 0);
- if (!xv->window_title) {
- if (!(xv->window_title = av_strdup(s->filename))) {
- ret = AVERROR(ENOMEM);
- goto fail;
+ if (sar.num) {
+ if (sar.num > sar.den)
+ xv->window_width = av_rescale(xv->window_width, sar.num, sar.den);
+ if (sar.num < sar.den)
+ xv->window_height = av_rescale(xv->window_height, sar.den, sar.num);
}
}
- XStoreName(xv->display, xv->window, xv->window_title);
- XMapWindow(xv->display, xv->window);
+ if (!xv->window_id) {
+ xv->window = XCreateSimpleWindow(xv->display, DefaultRootWindow(xv->display),
+ xv->window_x, xv->window_y,
+ xv->window_width, xv->window_height,
+ 0, 0, 0);
+ if (!xv->window_title) {
+ if (!(xv->window_title = av_strdup(s->filename))) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ }
+ XStoreName(xv->display, xv->window, xv->window_title);
+ XMapWindow(xv->display, xv->window);
+ } else
+ xv->window = xv->window_id;
if (XvQueryAdaptors(xv->display, DefaultRootWindow(xv->display), &num_adaptors, &ai) != Success) {
ret = AVERROR_EXTERNAL;
goto fail;
}
+ if (!num_adaptors) {
+ av_log(s, AV_LOG_ERROR, "No X-Video adaptors present\n");
+ return AVERROR(ENODEV);
+ }
xv->xv_port = ai[0].base_id;
XvFreeAdaptorInfo(ai);
@@ -187,42 +206,135 @@ static int xv_write_header(AVFormatContext *s)
XSync(xv->display, False);
shmctl(xv->yuv_shminfo.shmid, IPC_RMID, 0);
+ XGetWindowAttributes(xv->display, xv->window, &window_attrs);
+ fgcolor.red = fgcolor.green = fgcolor.blue = 0;
+ fgcolor.flags = DoRed | DoGreen | DoBlue;
+ XAllocColor(xv->display, window_attrs.colormap, &fgcolor);
+ XSetForeground(xv->display, xv->gc, fgcolor.pixel);
+ //force display area recalculation at first frame
+ xv->window_width = xv->window_height = 0;
+
return 0;
fail:
xv_write_trailer(s);
return ret;
}
-static int xv_write_packet(AVFormatContext *s, AVPacket *pkt)
+static void compute_display_area(AVFormatContext *s)
+{
+ XVContext *xv = s->priv_data;
+ AVRational sar, dar; /* sample and display aspect ratios */
+ AVStream *st = s->streams[0];
+ AVCodecContext *encctx = st->codec;
+
+ /* compute overlay width and height from the codec context information */
+ sar = st->sample_aspect_ratio.num ? st->sample_aspect_ratio : (AVRational){ 1, 1 };
+ dar = av_mul_q(sar, (AVRational){ encctx->width, encctx->height });
+
+ /* we suppose the screen has a 1/1 sample aspect ratio */
+ /* fit in the window */
+ if (av_cmp_q(dar, (AVRational){ xv->dest_w, xv->dest_h }) > 0) {
+ /* fit in width */
+ xv->dest_y = xv->dest_h;
+ xv->dest_x = 0;
+ xv->dest_h = av_rescale(xv->dest_w, dar.den, dar.num);
+ xv->dest_y -= xv->dest_h;
+ xv->dest_y /= 2;
+ } else {
+ /* fit in height */
+ xv->dest_x = xv->dest_w;
+ xv->dest_y = 0;
+ xv->dest_w = av_rescale(xv->dest_h, dar.num, dar.den);
+ xv->dest_x -= xv->dest_w;
+ xv->dest_x /= 2;
+ }
+}
+
+static int xv_repaint(AVFormatContext *s)
{
XVContext *xv = s->priv_data;
- XvImage *img = xv->yuv_image;
XWindowAttributes window_attrs;
- AVPicture pict;
- AVCodecContext *ctx = s->streams[0]->codec;
+
+ XGetWindowAttributes(xv->display, xv->window, &window_attrs);
+ if (window_attrs.width != xv->window_width || window_attrs.height != xv->window_height) {
+ XRectangle rect[2];
+ xv->dest_w = window_attrs.width;
+ xv->dest_h = window_attrs.height;
+ compute_display_area(s);
+ if (xv->dest_x) {
+ rect[0].width = rect[1].width = xv->dest_x;
+ rect[0].height = rect[1].height = window_attrs.height;
+ rect[0].y = rect[1].y = 0;
+ rect[0].x = 0;
+ rect[1].x = xv->dest_w + xv->dest_x;
+ XFillRectangles(xv->display, xv->window, xv->gc, rect, 2);
+ }
+ if (xv->dest_y) {
+ rect[0].width = rect[1].width = window_attrs.width;
+ rect[0].height = rect[1].height = xv->dest_y;
+ rect[0].x = rect[1].x = 0;
+ rect[0].y = 0;
+ rect[1].y = xv->dest_h + xv->dest_y;
+ XFillRectangles(xv->display, xv->window, xv->gc, rect, 2);
+ }
+ }
+
+ if (XvShmPutImage(xv->display, xv->xv_port, xv->window, xv->gc,
+ xv->yuv_image, 0, 0, xv->image_width, xv->image_height,
+ xv->dest_x, xv->dest_y, xv->dest_w, xv->dest_h, True) != Success) {
+ av_log(s, AV_LOG_ERROR, "Could not copy image to XV shared memory buffer\n");
+ return AVERROR_EXTERNAL;
+ }
+ return 0;
+}
+
+static int write_picture(AVFormatContext *s, AVPicture *pict)
+{
+ XVContext *xv = s->priv_data;
+ XvImage *img = xv->yuv_image;
uint8_t *data[3] = {
img->data + img->offsets[0],
img->data + img->offsets[1],
img->data + img->offsets[2]
};
+ av_image_copy(data, img->pitches, (const uint8_t **)pict->data, pict->linesize,
+ xv->image_format, img->width, img->height);
+ return xv_repaint(s);
+}
+
+static int xv_write_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ AVPicture pict;
+ AVCodecContext *ctx = s->streams[0]->codec;
avpicture_fill(&pict, pkt->data, ctx->pix_fmt, ctx->width, ctx->height);
- av_image_copy(data, img->pitches, (const uint8_t **)pict.data, pict.linesize,
- xv->image_format, img->width, img->height);
+ return write_picture(s, &pict);
+}
- XGetWindowAttributes(xv->display, xv->window, &window_attrs);
- if (XvShmPutImage(xv->display, xv->xv_port, xv->window, xv->gc,
- xv->yuv_image, 0, 0, xv->image_width, xv->image_height, 0, 0,
- window_attrs.width, window_attrs.height, True) != Success) {
- av_log(s, AV_LOG_ERROR, "Could not copy image to XV shared memory buffer\n");
- return AVERROR_EXTERNAL;
+static int xv_write_frame(AVFormatContext *s, int stream_index, AVFrame **frame,
+ unsigned flags)
+{
+ /* xv_write_header() should have accepted only supported formats */
+ if ((flags & AV_WRITE_UNCODED_FRAME_QUERY))
+ return 0;
+ return write_picture(s, (AVPicture *)*frame);
+}
+
+static int xv_control_message(AVFormatContext *s, int type, void *data, size_t data_size)
+{
+ switch(type) {
+ case AV_APP_TO_DEV_WINDOW_REPAINT:
+ return xv_repaint(s);
+ default:
+ break;
}
- return 0;
+ return AVERROR(ENOSYS);
}
#define OFFSET(x) offsetof(XVContext, x)
static const AVOption options[] = {
{ "display_name", "set display name", OFFSET(display_name), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
+ { "window_id", "set existing window id", OFFSET(window_id), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "window_size", "set window forced size", OFFSET(window_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "window_title", "set window title", OFFSET(window_title), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "window_x", "set window x offset", OFFSET(window_x), AV_OPT_TYPE_INT, {.i64 = 0 }, -INT_MAX, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
@@ -236,6 +348,7 @@ static const AVClass xv_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
};
AVOutputFormat ff_xv_muxer = {
@@ -246,7 +359,9 @@ AVOutputFormat ff_xv_muxer = {
.video_codec = AV_CODEC_ID_RAWVIDEO,
.write_header = xv_write_header,
.write_packet = xv_write_packet,
+ .write_uncoded_frame = xv_write_frame,
.write_trailer = xv_write_trailer,
+ .control_message = xv_control_message,
.flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS,
.priv_class = &xv_class,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/Makefile b/chromium/third_party/ffmpeg/libavfilter/Makefile
index 3d587fe421b..f981dfac064 100644
--- a/chromium/third_party/ffmpeg/libavfilter/Makefile
+++ b/chromium/third_party/ffmpeg/libavfilter/Makefile
@@ -1,27 +1,6 @@
include $(SUBDIR)../config.mak
NAME = avfilter
-FFLIBS = avutil
-FFLIBS-$(CONFIG_ACONVERT_FILTER) += swresample
-FFLIBS-$(CONFIG_AMOVIE_FILTER) += avformat avcodec
-FFLIBS-$(CONFIG_ARESAMPLE_FILTER) += swresample
-FFLIBS-$(CONFIG_ASYNCTS_FILTER) += avresample
-FFLIBS-$(CONFIG_ATEMPO_FILTER) += avcodec
-FFLIBS-$(CONFIG_DECIMATE_FILTER) += avcodec
-FFLIBS-$(CONFIG_DESHAKE_FILTER) += avcodec
-FFLIBS-$(CONFIG_ELBG_FILTER) += avcodec
-FFLIBS-$(CONFIG_MCDEINT_FILTER) += avcodec
-FFLIBS-$(CONFIG_MOVIE_FILTER) += avformat avcodec
-FFLIBS-$(CONFIG_MP_FILTER) += avcodec
-FFLIBS-$(CONFIG_PAN_FILTER) += swresample
-FFLIBS-$(CONFIG_PP_FILTER) += postproc
-FFLIBS-$(CONFIG_REMOVELOGO_FILTER) += avformat avcodec swscale
-FFLIBS-$(CONFIG_RESAMPLE_FILTER) += avresample
-FFLIBS-$(CONFIG_SAB_FILTER) += swscale
-FFLIBS-$(CONFIG_SCALE_FILTER) += swscale
-FFLIBS-$(CONFIG_SHOWSPECTRUM_FILTER) += avcodec
-FFLIBS-$(CONFIG_SMARTBLUR_FILTER) += swscale
-FFLIBS-$(CONFIG_SUBTITLES_FILTER) += avformat avcodec
HEADERS = asrc_abuffer.h \
avcodec.h \
@@ -70,7 +49,7 @@ OBJS-$(CONFIG_ASENDCMD_FILTER) += f_sendcmd.o
OBJS-$(CONFIG_ASETNSAMPLES_FILTER) += af_asetnsamples.o
OBJS-$(CONFIG_ASETPTS_FILTER) += setpts.o
OBJS-$(CONFIG_ASETRATE_FILTER) += af_asetrate.o
-OBJS-$(CONFIG_ASETTB_FILTER) += f_settb.o
+OBJS-$(CONFIG_ASETTB_FILTER) += settb.o
OBJS-$(CONFIG_ASHOWINFO_FILTER) += af_ashowinfo.o
OBJS-$(CONFIG_ASPLIT_FILTER) += split.o
OBJS-$(CONFIG_ASTATS_FILTER) += af_astats.o
@@ -83,6 +62,7 @@ OBJS-$(CONFIG_BANDPASS_FILTER) += af_biquads.o
OBJS-$(CONFIG_BANDREJECT_FILTER) += af_biquads.o
OBJS-$(CONFIG_BASS_FILTER) += af_biquads.o
OBJS-$(CONFIG_BIQUAD_FILTER) += af_biquads.o
+OBJS-$(CONFIG_BS2B_FILTER) += af_bs2b.o
OBJS-$(CONFIG_CHANNELMAP_FILTER) += af_channelmap.o
OBJS-$(CONFIG_CHANNELSPLIT_FILTER) += af_channelsplit.o
OBJS-$(CONFIG_COMPAND_FILTER) += af_compand.o
@@ -125,6 +105,7 @@ OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o
OBJS-$(CONFIG_CURVES_FILTER) += vf_curves.o
OBJS-$(CONFIG_DCTDNOIZ_FILTER) += vf_dctdnoiz.o
OBJS-$(CONFIG_DECIMATE_FILTER) += vf_decimate.o
+OBJS-$(CONFIG_DEJUDDER_FILTER) += vf_dejudder.o
OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
OBJS-$(CONFIG_DESHAKE_FILTER) += vf_deshake.o
OBJS-$(CONFIG_DRAWBOX_FILTER) += vf_drawbox.o
@@ -140,6 +121,7 @@ OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o
OBJS-$(CONFIG_FORMAT_FILTER) += vf_format.o
OBJS-$(CONFIG_FRAMESTEP_FILTER) += vf_framestep.o
OBJS-$(CONFIG_FPS_FILTER) += vf_fps.o
+OBJS-$(CONFIG_FRAMEPACK_FILTER) += vf_framepack.o
OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o
OBJS-$(CONFIG_GEQ_FILTER) += vf_geq.o
OBJS-$(CONFIG_GRADFUN_FILTER) += vf_gradfun.o
@@ -189,8 +171,9 @@ OBJS-$(CONFIG_SETDAR_FILTER) += vf_aspect.o
OBJS-$(CONFIG_SETFIELD_FILTER) += vf_setfield.o
OBJS-$(CONFIG_SETPTS_FILTER) += setpts.o
OBJS-$(CONFIG_SETSAR_FILTER) += vf_aspect.o
-OBJS-$(CONFIG_SETTB_FILTER) += f_settb.o
+OBJS-$(CONFIG_SETTB_FILTER) += settb.o
OBJS-$(CONFIG_SHOWINFO_FILTER) += vf_showinfo.o
+OBJS-$(CONFIG_SHUFFLEPLANES_FILTER) += vf_shuffleplanes.o
OBJS-$(CONFIG_SMARTBLUR_FILTER) += vf_smartblur.o
OBJS-$(CONFIG_SPLIT_FILTER) += split.o
OBJS-$(CONFIG_SPP_FILTER) += vf_spp.o
diff --git a/chromium/third_party/ffmpeg/libavfilter/aeval.c b/chromium/third_party/ffmpeg/libavfilter/aeval.c
index 3a05fb016ec..45629a98ea2 100644
--- a/chromium/third_party/ffmpeg/libavfilter/aeval.c
+++ b/chromium/third_party/ffmpeg/libavfilter/aeval.c
@@ -105,7 +105,7 @@ static int parse_channel_expressions(AVFilterContext *ctx,
{
EvalContext *eval = ctx->priv;
char *args1 = av_strdup(eval->exprs);
- char *expr, *last_expr, *buf;
+ char *expr, *last_expr = NULL, *buf;
double (* const *func1)(void *, double) = NULL;
const char * const *func1_names = NULL;
int i, ret = 0;
@@ -172,7 +172,7 @@ end:
static av_cold int init(AVFilterContext *ctx)
{
EvalContext *eval = ctx->priv;
- int ret;
+ int ret = 0;
if (eval->chlayout_str) {
if (!strcmp(eval->chlayout_str, "same") && !strcmp(ctx->filter->name, "aeval")) {
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_adelay.c b/chromium/third_party/ffmpeg/libavfilter/af_adelay.c
index 363b84d7318..cfc6b1fdb57 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_adelay.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_adelay.c
@@ -16,7 +16,6 @@
* 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 "libavutil/avstring.h"
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_aecho.c b/chromium/third_party/ffmpeg/libavfilter/af_aecho.c
index 8355e8c452f..c26fdd49a94 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_aecho.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_aecho.c
@@ -16,7 +16,6 @@
* 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 "libavutil/avassert.h"
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_amerge.c b/chromium/third_party/ffmpeg/libavfilter/af_amerge.c
index 82b694bee5d..591d672c48d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_amerge.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_amerge.c
@@ -259,7 +259,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
outbuf->pts = inbuf[0]->pts == AV_NOPTS_VALUE ? AV_NOPTS_VALUE :
inbuf[0]->pts +
av_rescale_q(am->in[0].pos,
- (AVRational){ 1, ctx->inputs[0]->sample_rate },
+ av_make_q(1, ctx->inputs[0]->sample_rate),
ctx->outputs[0]->time_base);
outbuf->nb_samples = nb_samples;
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_apad.c b/chromium/third_party/ffmpeg/libavfilter/af_apad.c
index 88a3a77a19d..15ba8c48345 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_apad.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_apad.c
@@ -16,7 +16,6 @@
* 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
- *
*/
/**
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_aresample.c b/chromium/third_party/ffmpeg/libavfilter/af_aresample.c
index e05c0a179d8..5f34321fe85 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_aresample.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_aresample.c
@@ -98,20 +98,23 @@ static int query_formats(AVFilterContext *ctx)
ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts);
if(out_rate > 0) {
- out_samplerates = ff_make_format_list((int[]){ out_rate, -1 });
+ int ratelist[] = { out_rate, -1 };
+ out_samplerates = ff_make_format_list(ratelist);
} else {
out_samplerates = ff_all_samplerates();
}
ff_formats_ref(out_samplerates, &outlink->in_samplerates);
if(out_format != AV_SAMPLE_FMT_NONE) {
- out_formats = ff_make_format_list((int[]){ out_format, -1 });
+ int formatlist[] = { out_format, -1 };
+ out_formats = ff_make_format_list(formatlist);
} else
out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
ff_formats_ref(out_formats, &outlink->in_formats);
if(out_layout) {
- out_layouts = avfilter_make_format64_list((int64_t[]){ out_layout, -1 });
+ int64_t layout_list[] = { out_layout, -1 };
+ out_layouts = avfilter_make_format64_list(layout_list);
} else
out_layouts = ff_all_channel_counts();
ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_ashowinfo.c b/chromium/third_party/ffmpeg/libavfilter/af_ashowinfo.c
index 783f9a6e3ec..ee95029a3ad 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_ashowinfo.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_ashowinfo.c
@@ -30,7 +30,10 @@
#include "libavutil/attributes.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
+#include "libavutil/downmix_info.h"
+#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
+#include "libavutil/replaygain.h"
#include "libavutil/timestamp.h"
#include "libavutil/samplefmt.h"
@@ -51,6 +54,99 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep(&s->plane_checksums);
}
+static void dump_matrixenc(AVFilterContext *ctx, AVFrameSideData *sd)
+{
+ enum AVMatrixEncoding enc;
+
+ av_log(ctx, AV_LOG_INFO, "matrix encoding: ");
+
+ if (sd->size < sizeof(enum AVMatrixEncoding)) {
+ av_log(ctx, AV_LOG_INFO, "invalid data");
+ return;
+ }
+
+ enc = *(enum AVMatrixEncoding *)sd->data;
+ switch (enc) {
+ case AV_MATRIX_ENCODING_NONE: av_log(ctx, AV_LOG_INFO, "none"); break;
+ case AV_MATRIX_ENCODING_DOLBY: av_log(ctx, AV_LOG_INFO, "Dolby Surround"); break;
+ case AV_MATRIX_ENCODING_DPLII: av_log(ctx, AV_LOG_INFO, "Dolby Pro Logic II"); break;
+ case AV_MATRIX_ENCODING_DPLIIX: av_log(ctx, AV_LOG_INFO, "Dolby Pro Logic IIx"); break;
+ case AV_MATRIX_ENCODING_DPLIIZ: av_log(ctx, AV_LOG_INFO, "Dolby Pro Logic IIz"); break;
+ case AV_MATRIX_ENCODING_DOLBYEX: av_log(ctx, AV_LOG_INFO, "Dolby EX"); break;
+ case AV_MATRIX_ENCODING_DOLBYHEADPHONE: av_log(ctx, AV_LOG_INFO, "Dolby Headphone"); break;
+ default: av_log(ctx, AV_LOG_WARNING, "unknown"); break;
+ }
+}
+
+static void dump_downmix(AVFilterContext *ctx, AVFrameSideData *sd)
+{
+ AVDownmixInfo *di;
+
+ av_log(ctx, AV_LOG_INFO, "downmix: ");
+ if (sd->size < sizeof(*di)) {
+ av_log(ctx, AV_LOG_INFO, "invalid data");
+ return;
+ }
+
+ di = (AVDownmixInfo *)sd->data;
+
+ av_log(ctx, AV_LOG_INFO, "preferred downmix type - ");
+ switch (di->preferred_downmix_type) {
+ case AV_DOWNMIX_TYPE_LORO: av_log(ctx, AV_LOG_INFO, "Lo/Ro"); break;
+ case AV_DOWNMIX_TYPE_LTRT: av_log(ctx, AV_LOG_INFO, "Lt/Rt"); break;
+ case AV_DOWNMIX_TYPE_DPLII: av_log(ctx, AV_LOG_INFO, "Dolby Pro Logic II"); break;
+ default: av_log(ctx, AV_LOG_WARNING, "unknown"); break;
+ }
+
+ av_log(ctx, AV_LOG_INFO, " Mix levels: center %f (%f ltrt) - "
+ "surround %f (%f ltrt) - lfe %f",
+ di->center_mix_level, di->center_mix_level_ltrt,
+ di->surround_mix_level, di->surround_mix_level_ltrt,
+ di->lfe_mix_level);
+}
+
+static void print_gain(AVFilterContext *ctx, const char *str, int32_t gain)
+{
+ av_log(ctx, AV_LOG_INFO, "%s - ", str);
+ if (gain == INT32_MIN)
+ av_log(ctx, AV_LOG_INFO, "unknown");
+ else
+ av_log(ctx, AV_LOG_INFO, "%f", gain / 100000.0f);
+ av_log(ctx, AV_LOG_INFO, ", ");
+}
+
+static void print_peak(AVFilterContext *ctx, const char *str, uint32_t peak)
+{
+ av_log(ctx, AV_LOG_INFO, "%s - ", str);
+ if (!peak)
+ av_log(ctx, AV_LOG_INFO, "unknown");
+ else
+ av_log(ctx, AV_LOG_INFO, "%f", (float)peak / UINT32_MAX);
+ av_log(ctx, AV_LOG_INFO, ", ");
+}
+
+static void dump_replaygain(AVFilterContext *ctx, AVFrameSideData *sd)
+{
+ AVReplayGain *rg;
+
+ av_log(ctx, AV_LOG_INFO, "replaygain: ");
+ if (sd->size < sizeof(*rg)) {
+ av_log(ctx, AV_LOG_INFO, "invalid data");
+ return;
+ }
+ rg = (AVReplayGain*)sd->data;
+
+ print_gain(ctx, "track gain", rg->track_gain);
+ print_peak(ctx, "track peak", rg->track_peak);
+ print_gain(ctx, "album gain", rg->album_gain);
+ print_peak(ctx, "album peak", rg->album_peak);
+}
+
+static void dump_unknown(AVFilterContext *ctx, AVFrameSideData *sd)
+{
+ av_log(ctx, AV_LOG_INFO, "unknown side data type: %d, size %d bytes", sd->type, sd->size);
+}
+
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
{
AVFilterContext *ctx = inlink->dst;
@@ -83,7 +179,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
av_log(ctx, AV_LOG_INFO,
"n:%"PRId64" pts:%s pts_time:%s pos:%"PRId64" "
"fmt:%s channels:%d chlayout:%s rate:%d nb_samples:%d "
- "checksum:%08X ",
+ "checksum:%08"PRIX32" ",
inlink->frame_count,
av_ts2str(buf->pts), av_ts2timestr(buf->pts, &inlink->time_base),
av_frame_get_pkt_pos(buf),
@@ -93,9 +189,23 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
av_log(ctx, AV_LOG_INFO, "plane_checksums: [ ");
for (i = 0; i < planes; i++)
- av_log(ctx, AV_LOG_INFO, "%08X ", s->plane_checksums[i]);
+ av_log(ctx, AV_LOG_INFO, "%08"PRIX32" ", s->plane_checksums[i]);
av_log(ctx, AV_LOG_INFO, "]\n");
+ for (i = 0; i < buf->nb_side_data; i++) {
+ AVFrameSideData *sd = buf->side_data[i];
+
+ av_log(ctx, AV_LOG_INFO, " side data - ");
+ switch (sd->type) {
+ case AV_FRAME_DATA_MATRIXENCODING: dump_matrixenc (ctx, sd); break;
+ case AV_FRAME_DATA_DOWNMIX_INFO: dump_downmix (ctx, sd); break;
+ case AV_FRAME_DATA_REPLAYGAIN: dump_replaygain(ctx, sd); break;
+ default: dump_unknown (ctx, sd); break;
+ }
+
+ av_log(ctx, AV_LOG_INFO, "\n");
+ }
+
return ff_filter_frame(inlink->dst->outputs[0], buf);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_atempo.c b/chromium/third_party/ffmpeg/libavfilter/af_atempo.c
index c474d6a58cd..6a3fd61e604 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_atempo.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_atempo.c
@@ -1058,11 +1058,11 @@ static int push_samples(ATempoContext *atempo,
outlink->time_base);
ret = ff_filter_frame(outlink, atempo->dst_buffer);
- if (ret < 0)
- return ret;
atempo->dst_buffer = NULL;
atempo->dst = NULL;
atempo->dst_end = NULL;
+ if (ret < 0)
+ return ret;
atempo->nsamples_out += n_out;
return 0;
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_bs2b.c b/chromium/third_party/ffmpeg/libavfilter/af_bs2b.c
new file mode 100644
index 00000000000..3dd0bcd99a2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/af_bs2b.c
@@ -0,0 +1,222 @@
+/*
+ * 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
+ * Bauer stereo-to-binaural filter
+ */
+
+#include <bs2b.h>
+
+#include "libavutil/channel_layout.h"
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+
+#include "audio.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+
+typedef struct Bs2bContext {
+ const AVClass *class;
+
+ int profile;
+ int fcut;
+ int feed;
+
+ t_bs2bdp bs2bp;
+
+ void (*filter)(t_bs2bdp bs2bdp, uint8_t *sample, int n);
+} Bs2bContext;
+
+#define OFFSET(x) offsetof(Bs2bContext, x)
+#define A AV_OPT_FLAG_AUDIO_PARAM
+
+static const AVOption options[] = {
+ { "profile", "Apply a pre-defined crossfeed level",
+ OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = BS2B_DEFAULT_CLEVEL }, 0, INT_MAX, A, "profile" },
+ { "default", "default profile", 0, AV_OPT_TYPE_CONST, { .i64 = BS2B_DEFAULT_CLEVEL }, 0, 0, A, "profile" },
+ { "cmoy", "Chu Moy circuit", 0, AV_OPT_TYPE_CONST, { .i64 = BS2B_CMOY_CLEVEL }, 0, 0, A, "profile" },
+ { "jmeier", "Jan Meier circuit", 0, AV_OPT_TYPE_CONST, { .i64 = BS2B_JMEIER_CLEVEL }, 0, 0, A, "profile" },
+ { "fcut", "Set cut frequency (in Hz)",
+ OFFSET(fcut), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, BS2B_MAXFCUT, A },
+ { "feed", "Set feed level (in Hz)",
+ OFFSET(feed), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, BS2B_MAXFEED, A },
+ { NULL },
+};
+
+static const AVClass bs2b_class = {
+ .class_name = "bs2b filter",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ Bs2bContext *bs2b = ctx->priv;
+
+ if (!(bs2b->bs2bp = bs2b_open()))
+ return AVERROR(ENOMEM);
+
+ bs2b_set_level(bs2b->bs2bp, bs2b->profile);
+
+ if (bs2b->fcut)
+ bs2b_set_level_fcut(bs2b->bs2bp, bs2b->fcut);
+
+ if (bs2b->feed)
+ bs2b_set_level_feed(bs2b->bs2bp, bs2b->feed);
+
+ return 0;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ Bs2bContext *bs2b = ctx->priv;
+
+ if (bs2b->bs2bp)
+ bs2b_close(bs2b->bs2bp);
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats = NULL;
+ AVFilterChannelLayouts *layouts = NULL;
+
+ static const enum AVSampleFormat sample_fmts[] = {
+ AV_SAMPLE_FMT_U8,
+ AV_SAMPLE_FMT_S16,
+ AV_SAMPLE_FMT_S32,
+ AV_SAMPLE_FMT_FLT,
+ AV_SAMPLE_FMT_DBL,
+ AV_SAMPLE_FMT_NONE,
+ };
+
+ if (ff_add_channel_layout(&layouts, AV_CH_LAYOUT_STEREO) != 0)
+ return AVERROR(ENOMEM);
+ ff_set_common_channel_layouts(ctx, layouts);
+
+ formats = ff_make_format_list(sample_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_set_common_formats(ctx, formats);
+
+ formats = ff_all_samplerates();
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_set_common_samplerates(ctx, formats);
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
+{
+ int ret;
+ AVFrame *out_frame;
+
+ Bs2bContext *bs2b = inlink->dst->priv;
+ AVFilterLink *outlink = inlink->dst->outputs[0];
+
+ if (av_frame_is_writable(frame)) {
+ out_frame = frame;
+ } else {
+ out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);
+ if (!out_frame)
+ return AVERROR(ENOMEM);
+ av_frame_copy(out_frame, frame);
+ ret = av_frame_copy_props(out_frame, frame);
+ if (ret < 0) {
+ av_frame_free(&out_frame);
+ av_frame_free(&frame);
+ return ret;
+ }
+ }
+
+ bs2b->filter(bs2b->bs2bp, out_frame->extended_data[0], out_frame->nb_samples);
+
+ if (frame != out_frame)
+ av_frame_free(&frame);
+
+ return ff_filter_frame(outlink, out_frame);
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ Bs2bContext *bs2b = ctx->priv;
+ AVFilterLink *inlink = ctx->inputs[0];
+
+ int srate = inlink->sample_rate;
+
+ switch (inlink->format) {
+ case AV_SAMPLE_FMT_U8:
+ bs2b->filter = bs2b_cross_feed_u8;
+ break;
+ case AV_SAMPLE_FMT_S16:
+ bs2b->filter = (void*)bs2b_cross_feed_s16;
+ break;
+ case AV_SAMPLE_FMT_S32:
+ bs2b->filter = (void*)bs2b_cross_feed_s32;
+ break;
+ case AV_SAMPLE_FMT_FLT:
+ bs2b->filter = (void*)bs2b_cross_feed_f;
+ break;
+ case AV_SAMPLE_FMT_DBL:
+ bs2b->filter = (void*)bs2b_cross_feed_d;
+ break;
+ default:
+ return AVERROR_BUG;
+ }
+
+ if ((srate < BS2B_MINSRATE) || (srate > BS2B_MAXSRATE))
+ return AVERROR(ENOSYS);
+
+ bs2b_set_srate(bs2b->bs2bp, srate);
+
+ return 0;
+}
+
+static const AVFilterPad bs2b_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad bs2b_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_af_bs2b = {
+ .name = "bs2b",
+ .description = NULL_IF_CONFIG_SMALL("Bauer stereo-to-binaural filter."),
+ .query_formats = query_formats,
+ .priv_size = sizeof(Bs2bContext),
+ .priv_class = &bs2b_class,
+ .init = init,
+ .uninit = uninit,
+ .inputs = bs2b_inputs,
+ .outputs = bs2b_outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_channelmap.c b/chromium/third_party/ffmpeg/libavfilter/af_channelmap.c
index e5e898703ea..dac19b129d4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_channelmap.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_channelmap.c
@@ -184,7 +184,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
s->map[i].out_channel_idx = i;
break;
case MAP_ONE_STR:
- if (!get_channel(&mapping, &in_ch, separator)) {
+ if (get_channel(&mapping, &in_ch, separator) < 0) {
av_log(ctx, AV_LOG_ERROR, err);
return AVERROR(EINVAL);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_compand.c b/chromium/third_party/ffmpeg/libavfilter/af_compand.c
index ec1e962f828..89430acdecd 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_compand.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_compand.c
@@ -3,6 +3,7 @@
* Copyright (c) 1999 Nick Bailey
* Copyright (c) 2007 Rob Sykes <robs@users.sourceforge.net>
* Copyright (c) 2013 Paul B Mahol
+ * Copyright (c) 2014 Andrew Kelley
*
* This file is part of FFmpeg.
*
@@ -19,15 +20,19 @@
* 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
+ * audio compand filter
*/
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
-#include "avfilter.h"
#include "audio.h"
+#include "avfilter.h"
#include "internal.h"
typedef struct ChanParam {
@@ -43,6 +48,7 @@ typedef struct CompandSegment {
typedef struct CompandContext {
const AVClass *class;
+ int nb_segments;
char *attacks, *decays, *points;
CompandSegment *segments;
ChanParam *channels;
@@ -52,7 +58,7 @@ typedef struct CompandContext {
double gain_dB;
double initial_volume;
double delay;
- uint8_t **delayptrs;
+ AVFrame *delay_frame;
int delay_samples;
int delay_count;
int delay_index;
@@ -65,13 +71,13 @@ typedef struct CompandContext {
#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
static const AVOption compand_options[] = {
- { "attacks", "set time over which increase of volume is determined", OFFSET(attacks), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
- { "decays", "set time over which decrease of volume is determined", OFFSET(decays), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
- { "points", "set points of transfer function", OFFSET(points), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
- { "soft-knee", "set soft-knee", OFFSET(curve_dB), AV_OPT_TYPE_DOUBLE, {.dbl=0.01}, 0.01, 900, A },
- { "gain", "set output gain", OFFSET(gain_dB), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, A },
- { "volume", "set initial volume", OFFSET(initial_volume), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 0, A },
- { "delay", "set delay for samples before sending them to volume adjuster", OFFSET(delay), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 20, A },
+ { "attacks", "set time over which increase of volume is determined", OFFSET(attacks), AV_OPT_TYPE_STRING, { .str = "0.3" }, 0, 0, A },
+ { "decays", "set time over which decrease of volume is determined", OFFSET(decays), AV_OPT_TYPE_STRING, { .str = "0.8" }, 0, 0, A },
+ { "points", "set points of transfer function", OFFSET(points), AV_OPT_TYPE_STRING, { .str = "-70/-70|-60/-20" }, 0, 0, A },
+ { "soft-knee", "set soft-knee", OFFSET(curve_dB), AV_OPT_TYPE_DOUBLE, { .dbl = 0.01 }, 0.01, 900, A },
+ { "gain", "set output gain", OFFSET(gain_dB), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, -900, 900, A },
+ { "volume", "set initial volume", OFFSET(initial_volume), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, -900, 0, A },
+ { "delay", "set delay for samples before sending them to volume adjuster", OFFSET(delay), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, 20, A },
{ NULL }
};
@@ -80,12 +86,7 @@ AVFILTER_DEFINE_CLASS(compand);
static av_cold int init(AVFilterContext *ctx)
{
CompandContext *s = ctx->priv;
-
- if (!s->attacks || !s->decays || !s->points) {
- av_log(ctx, AV_LOG_ERROR, "Missing attacks and/or decays and/or points.\n");
- return AVERROR(EINVAL);
- }
-
+ s->pts = AV_NOPTS_VALUE;
return 0;
}
@@ -95,9 +96,7 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep(&s->channels);
av_freep(&s->segments);
- if (s->delayptrs)
- av_freep(&s->delayptrs[0]);
- av_freep(&s->delayptrs);
+ av_frame_free(&s->delay_frame);
}
static int query_formats(AVFilterContext *ctx)
@@ -133,10 +132,9 @@ static void count_items(char *item_str, int *nb_items)
*nb_items = 1;
for (p = item_str; *p; p++) {
- if (*p == ' ')
+ if (*p == ' ' || *p == '|')
(*nb_items)++;
}
-
}
static void update_volume(ChanParam *cp, double in)
@@ -160,11 +158,10 @@ static double get_volume(CompandContext *s, double in_lin)
in_log = log(in_lin);
- for (i = 1;; i++)
- if (in_log <= s->segments[i + 1].x)
+ for (i = 1; i < s->nb_segments; i++)
+ if (in_log <= s->segments[i].x)
break;
-
- cs = &s->segments[i];
+ cs = &s->segments[i - 1];
in_log -= cs->x;
out_log = cs->y + in_log * (cs->a * in_log + cs->b);
@@ -173,20 +170,28 @@ static double get_volume(CompandContext *s, double in_lin)
static int compand_nodelay(AVFilterContext *ctx, AVFrame *frame)
{
- CompandContext *s = ctx->priv;
+ CompandContext *s = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0];
- const int channels = inlink->channels;
+ const int channels = inlink->channels;
const int nb_samples = frame->nb_samples;
AVFrame *out_frame;
int chan, i;
+ int err;
if (av_frame_is_writable(frame)) {
out_frame = frame;
} else {
out_frame = ff_get_audio_buffer(inlink, nb_samples);
- if (!out_frame)
+ if (!out_frame) {
+ av_frame_free(&frame);
return AVERROR(ENOMEM);
- av_frame_copy_props(out_frame, frame);
+ }
+ err = av_frame_copy_props(out_frame, frame);
+ if (err < 0) {
+ av_frame_free(&out_frame);
+ av_frame_free(&frame);
+ return err;
+ }
}
for (chan = 0; chan < channels; chan++) {
@@ -211,19 +216,25 @@ static int compand_nodelay(AVFilterContext *ctx, AVFrame *frame)
static int compand_delay(AVFilterContext *ctx, AVFrame *frame)
{
- CompandContext *s = ctx->priv;
+ CompandContext *s = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0];
const int channels = inlink->channels;
const int nb_samples = frame->nb_samples;
int chan, i, av_uninit(dindex), oindex, av_uninit(count);
- AVFrame *out_frame = NULL;
+ AVFrame *out_frame = NULL;
+ int err;
+
+ if (s->pts == AV_NOPTS_VALUE) {
+ s->pts = (frame->pts == AV_NOPTS_VALUE) ? 0 : frame->pts;
+ }
av_assert1(channels > 0); /* would corrupt delay_count and delay_index */
for (chan = 0; chan < channels; chan++) {
- const double *src = (double *)frame->extended_data[chan];
- double *dbuf = (double *)s->delayptrs[chan];
- ChanParam *cp = &s->channels[chan];
+ AVFrame *delay_frame = s->delay_frame;
+ const double *src = (double *)frame->extended_data[chan];
+ double *dbuf = (double *)delay_frame->extended_data[chan];
+ ChanParam *cp = &s->channels[chan];
double *dst;
count = s->delay_count;
@@ -235,15 +246,25 @@ static int compand_delay(AVFilterContext *ctx, AVFrame *frame)
if (count >= s->delay_samples) {
if (!out_frame) {
out_frame = ff_get_audio_buffer(inlink, nb_samples - i);
- if (!out_frame)
+ if (!out_frame) {
+ av_frame_free(&frame);
return AVERROR(ENOMEM);
- av_frame_copy_props(out_frame, frame);
+ }
+ err = av_frame_copy_props(out_frame, frame);
+ if (err < 0) {
+ av_frame_free(&out_frame);
+ av_frame_free(&frame);
+ return err;
+ }
out_frame->pts = s->pts;
- s->pts += av_rescale_q(nb_samples - i, (AVRational){1, inlink->sample_rate}, inlink->time_base);
+ s->pts += av_rescale_q(nb_samples - i,
+ (AVRational){ 1, inlink->sample_rate },
+ inlink->time_base);
}
dst = (double *)out_frame->extended_data[chan];
- dst[oindex++] = av_clipd(dbuf[dindex] * get_volume(s, cp->volume), -1, 1);
+ dst[oindex++] = av_clipd(dbuf[dindex] *
+ get_volume(s, cp->volume), -1, 1);
} else {
count++;
}
@@ -263,25 +284,30 @@ static int compand_delay(AVFilterContext *ctx, AVFrame *frame)
static int compand_drain(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
- CompandContext *s = ctx->priv;
- const int channels = outlink->channels;
+ CompandContext *s = ctx->priv;
+ const int channels = outlink->channels;
+ AVFrame *frame = NULL;
int chan, i, dindex;
- AVFrame *frame = NULL;
+ /* 2048 is to limit output frame size during drain */
frame = ff_get_audio_buffer(outlink, FFMIN(2048, s->delay_count));
if (!frame)
return AVERROR(ENOMEM);
frame->pts = s->pts;
- s->pts += av_rescale_q(frame->nb_samples, (AVRational){1, outlink->sample_rate}, outlink->time_base);
+ s->pts += av_rescale_q(frame->nb_samples,
+ (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
+ av_assert0(channels > 0);
for (chan = 0; chan < channels; chan++) {
- double *dbuf = (double *)s->delayptrs[chan];
+ AVFrame *delay_frame = s->delay_frame;
+ double *dbuf = (double *)delay_frame->extended_data[chan];
double *dst = (double *)frame->extended_data[chan];
ChanParam *cp = &s->channels[chan];
dindex = s->delay_index;
for (i = 0; i < frame->nb_samples; i++) {
- dst[i] = av_clipd(dbuf[dindex] * get_volume(s, cp->volume), -1, 1);
+ dst[i] = av_clipd(dbuf[dindex] * get_volume(s, cp->volume),
+ -1, 1);
dindex = MOD(dindex + 1, s->delay_samples);
}
}
@@ -293,68 +319,91 @@ static int compand_drain(AVFilterLink *outlink)
static int config_output(AVFilterLink *outlink)
{
- AVFilterContext *ctx = outlink->src;
- CompandContext *s = ctx->priv;
+ AVFilterContext *ctx = outlink->src;
+ CompandContext *s = ctx->priv;
const int sample_rate = outlink->sample_rate;
- double radius = s->curve_dB * M_LN10 / 20;
+ double radius = s->curve_dB * M_LN10 / 20.0;
+ char *p, *saveptr = NULL;
+ const int channels = outlink->channels;
int nb_attacks, nb_decays, nb_points;
- char *p, *saveptr = NULL;
int new_nb_items, num;
int i;
+ int err;
+
count_items(s->attacks, &nb_attacks);
count_items(s->decays, &nb_decays);
count_items(s->points, &nb_points);
- if ((nb_attacks > outlink->channels) || (nb_decays > outlink->channels)) {
- av_log(ctx, AV_LOG_ERROR, "Number of attacks/decays bigger than number of channels.\n");
+ if (channels <= 0) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid number of channels: %d\n", channels);
+ return AVERROR(EINVAL);
+ }
+
+ if (nb_attacks > channels || nb_decays > channels) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Number of attacks/decays bigger than number of channels.\n");
return AVERROR(EINVAL);
}
uninit(ctx);
- s->channels = av_mallocz_array(outlink->channels, sizeof(*s->channels));
- s->segments = av_mallocz_array((nb_points + 4) * 2, sizeof(*s->segments));
+ s->channels = av_mallocz_array(channels, sizeof(*s->channels));
+ s->nb_segments = (nb_points + 4) * 2;
+ s->segments = av_mallocz_array(s->nb_segments, sizeof(*s->segments));
- if (!s->channels || !s->segments)
+ if (!s->channels || !s->segments) {
+ uninit(ctx);
return AVERROR(ENOMEM);
+ }
p = s->attacks;
for (i = 0, new_nb_items = 0; i < nb_attacks; i++) {
- char *tstr = av_strtok(p, " ", &saveptr);
+ char *tstr = av_strtok(p, " |", &saveptr);
p = NULL;
new_nb_items += sscanf(tstr, "%lf", &s->channels[i].attack) == 1;
- if (s->channels[i].attack < 0)
+ if (s->channels[i].attack < 0) {
+ uninit(ctx);
return AVERROR(EINVAL);
+ }
}
nb_attacks = new_nb_items;
p = s->decays;
for (i = 0, new_nb_items = 0; i < nb_decays; i++) {
- char *tstr = av_strtok(p, " ", &saveptr);
+ char *tstr = av_strtok(p, " |", &saveptr);
p = NULL;
new_nb_items += sscanf(tstr, "%lf", &s->channels[i].decay) == 1;
- if (s->channels[i].decay < 0)
+ if (s->channels[i].decay < 0) {
+ uninit(ctx);
return AVERROR(EINVAL);
+ }
}
nb_decays = new_nb_items;
if (nb_attacks != nb_decays) {
- av_log(ctx, AV_LOG_ERROR, "Number of attacks %d differs from number of decays %d.\n", nb_attacks, nb_decays);
+ av_log(ctx, AV_LOG_ERROR,
+ "Number of attacks %d differs from number of decays %d.\n",
+ nb_attacks, nb_decays);
+ uninit(ctx);
return AVERROR(EINVAL);
}
#define S(x) s->segments[2 * ((x) + 1)]
p = s->points;
for (i = 0, new_nb_items = 0; i < nb_points; i++) {
- char *tstr = av_strtok(p, " ", &saveptr);
+ char *tstr = av_strtok(p, " |", &saveptr);
p = NULL;
if (sscanf(tstr, "%lf/%lf", &S(i).x, &S(i).y) != 2) {
- av_log(ctx, AV_LOG_ERROR, "Invalid and/or missing input/output value.\n");
+ av_log(ctx, AV_LOG_ERROR,
+ "Invalid and/or missing input/output value.\n");
+ uninit(ctx);
return AVERROR(EINVAL);
}
if (i && S(i - 1).x > S(i).x) {
- av_log(ctx, AV_LOG_ERROR, "Transfer function input values must be increasing.\n");
+ av_log(ctx, AV_LOG_ERROR,
+ "Transfer function input values must be increasing.\n");
+ uninit(ctx);
return AVERROR(EINVAL);
}
S(i).y -= S(i).x;
@@ -421,11 +470,11 @@ static int config_output(AVFilterLink *outlink)
L(2).x = x;
L(2).y = y;
- in1 = cx - L(3).x;
+ in1 = cx - L(3).x;
out1 = cy - L(3).y;
- in2 = L(2).x - L(3).x;
+ in2 = L(2).x - L(3).x;
out2 = L(2).y - L(3).y;
- L(3).a = (out2 / in2 - out1 / in1) / (in2-in1);
+ L(3).a = (out2 / in2 - out1 / in1) / (in2 - in1);
L(3).b = out1 / in1 - L(3).a * in1;
}
L(3).x = 0;
@@ -434,7 +483,7 @@ static int config_output(AVFilterLink *outlink)
s->in_min_lin = exp(s->segments[1].x);
s->out_min_lin = exp(s->segments[1].y);
- for (i = 0; i < outlink->channels; i++) {
+ for (i = 0; i < channels; i++) {
ChanParam *cp = &s->channels[i];
if (cp->attack > 1.0 / sample_rate)
@@ -449,25 +498,34 @@ static int config_output(AVFilterLink *outlink)
}
s->delay_samples = s->delay * sample_rate;
- if (s->delay_samples > 0) {
- int ret;
- if ((ret = av_samples_alloc_array_and_samples(&s->delayptrs, NULL,
- outlink->channels,
- s->delay_samples,
- outlink->format, 0)) < 0)
- return ret;
- s->compand = compand_delay;
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
- } else {
+ if (s->delay_samples <= 0) {
s->compand = compand_nodelay;
+ return 0;
}
+
+ s->delay_frame = av_frame_alloc();
+ if (!s->delay_frame) {
+ uninit(ctx);
+ return AVERROR(ENOMEM);
+ }
+
+ s->delay_frame->format = outlink->format;
+ s->delay_frame->nb_samples = s->delay_samples;
+ s->delay_frame->channel_layout = outlink->channel_layout;
+
+ err = av_frame_get_buffer(s->delay_frame, 32);
+ if (err)
+ return err;
+
+ outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+ s->compand = compand_delay;
return 0;
}
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
AVFilterContext *ctx = inlink->dst;
- CompandContext *s = ctx->priv;
+ CompandContext *s = ctx->priv;
return s->compand(ctx, frame);
}
@@ -475,7 +533,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static int request_frame(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
- CompandContext *s = ctx->priv;
+ CompandContext *s = ctx->priv;
int ret;
ret = ff_request_frame(ctx->inputs[0]);
@@ -505,14 +563,16 @@ static const AVFilterPad compand_outputs[] = {
{ NULL }
};
+
AVFilter ff_af_compand = {
- .name = "compand",
- .description = NULL_IF_CONFIG_SMALL("Compress or expand audio dynamic range."),
- .query_formats = query_formats,
- .priv_size = sizeof(CompandContext),
- .priv_class = &compand_class,
- .init = init,
- .uninit = uninit,
- .inputs = compand_inputs,
- .outputs = compand_outputs,
+ .name = "compand",
+ .description = NULL_IF_CONFIG_SMALL(
+ "Compress or expand audio dynamic range."),
+ .query_formats = query_formats,
+ .priv_size = sizeof(CompandContext),
+ .priv_class = &compand_class,
+ .init = init,
+ .uninit = uninit,
+ .inputs = compand_inputs,
+ .outputs = compand_outputs,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_pan.c b/chromium/third_party/ffmpeg/libavfilter/af_pan.c
index d28f3824821..1b78515b557 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_pan.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_pan.c
@@ -370,7 +370,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
if (!outsamples)
return AVERROR(ENOMEM);
- swr_convert(pan->swr, outsamples->data, n, (void *)insamples->data, n);
+ swr_convert(pan->swr, outsamples->extended_data, n,
+ (void *)insamples->extended_data, n);
av_frame_copy_props(outsamples, insamples);
outsamples->channel_layout = outlink->channel_layout;
av_frame_set_channels(outsamples, outlink->channels);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_resample.c b/chromium/third_party/ffmpeg/libavfilter/af_resample.c
index bf32aa73b1a..9d1b1c45671 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_resample.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_resample.c
@@ -251,6 +251,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (ret > 0) {
out->nb_samples = ret;
+
+ ret = av_frame_copy_props(out, in);
+ if (ret < 0) {
+ av_frame_free(&out);
+ goto fail;
+ }
+
+ out->sample_rate = outlink->sample_rate;
if (in->pts != AV_NOPTS_VALUE) {
out->pts = av_rescale_q(in->pts, inlink->time_base,
outlink->time_base) -
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_volume.c b/chromium/third_party/ffmpeg/libavfilter/af_volume.c
index 21fe9a15e0e..e06c3b395ae 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_volume.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_volume.c
@@ -28,7 +28,10 @@
#include "libavutil/common.h"
#include "libavutil/eval.h"
#include "libavutil/float_dsp.h"
+#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
+#include "libavutil/replaygain.h"
+
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
@@ -39,41 +42,85 @@ static const char *precision_str[] = {
"fixed", "float", "double"
};
+static const char *const var_names[] = {
+ "n", ///< frame number (starting at zero)
+ "nb_channels", ///< number of channels
+ "nb_consumed_samples", ///< number of samples consumed by the filter
+ "nb_samples", ///< number of samples in the current frame
+ "pos", ///< position in the file of the frame
+ "pts", ///< frame presentation timestamp
+ "sample_rate", ///< sample rate
+ "startpts", ///< PTS at start of stream
+ "startt", ///< time at start of stream
+ "t", ///< time in the file of the frame
+ "tb", ///< timebase
+ "volume", ///< last set value
+ NULL
+};
+
#define OFFSET(x) offsetof(VolumeContext, x)
#define A AV_OPT_FLAG_AUDIO_PARAM
#define F AV_OPT_FLAG_FILTERING_PARAM
static const AVOption volume_options[] = {
- { "volume", "set volume adjustment",
- OFFSET(volume), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 }, 0, 0x7fffff, A|F },
+ { "volume", "set volume adjustment expression",
+ OFFSET(volume_expr), AV_OPT_TYPE_STRING, { .str = "1.0" }, .flags = A|F },
{ "precision", "select mathematical precision",
OFFSET(precision), AV_OPT_TYPE_INT, { .i64 = PRECISION_FLOAT }, PRECISION_FIXED, PRECISION_DOUBLE, A|F, "precision" },
{ "fixed", "select 8-bit fixed-point", 0, AV_OPT_TYPE_CONST, { .i64 = PRECISION_FIXED }, INT_MIN, INT_MAX, A|F, "precision" },
{ "float", "select 32-bit floating-point", 0, AV_OPT_TYPE_CONST, { .i64 = PRECISION_FLOAT }, INT_MIN, INT_MAX, A|F, "precision" },
{ "double", "select 64-bit floating-point", 0, AV_OPT_TYPE_CONST, { .i64 = PRECISION_DOUBLE }, INT_MIN, INT_MAX, A|F, "precision" },
- { NULL }
+ { "eval", "specify when to evaluate expressions", OFFSET(eval_mode), AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_ONCE}, 0, EVAL_MODE_NB-1, .flags = A|F, "eval" },
+ { "once", "eval volume expression once", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_ONCE}, .flags = A|F, .unit = "eval" },
+ { "frame", "eval volume expression per-frame", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = A|F, .unit = "eval" },
+ { "replaygain", "Apply replaygain side data when present",
+ OFFSET(replaygain), AV_OPT_TYPE_INT, { .i64 = REPLAYGAIN_DROP }, REPLAYGAIN_DROP, REPLAYGAIN_ALBUM, A, "replaygain" },
+ { "drop", "replaygain side data is dropped", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_DROP }, 0, 0, A, "replaygain" },
+ { "ignore", "replaygain side data is ignored", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_IGNORE }, 0, 0, A, "replaygain" },
+ { "track", "track gain is preferred", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_TRACK }, 0, 0, A, "replaygain" },
+ { "album", "album gain is preferred", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_ALBUM }, 0, 0, A, "replaygain" },
+ { "replaygain_preamp", "Apply replaygain pre-amplification",
+ OFFSET(replaygain_preamp), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, -15.0, 15.0, A },
+ { "replaygain_noclip", "Apply replaygain clipping prevention",
+ OFFSET(replaygain_noclip), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, A },
+ { NULL },
};
AVFILTER_DEFINE_CLASS(volume);
-static av_cold int init(AVFilterContext *ctx)
+static int set_expr(AVExpr **pexpr, const char *expr, void *log_ctx)
{
- VolumeContext *vol = ctx->priv;
-
- if (vol->precision == PRECISION_FIXED) {
- vol->volume_i = (int)(vol->volume * 256 + 0.5);
- vol->volume = vol->volume_i / 256.0;
- av_log(ctx, AV_LOG_VERBOSE, "volume:(%d/256)(%f)(%1.2fdB) precision:fixed\n",
- vol->volume_i, vol->volume, 20.0*log(vol->volume)/M_LN10);
- } else {
- av_log(ctx, AV_LOG_VERBOSE, "volume:(%f)(%1.2fdB) precision:%s\n",
- vol->volume, 20.0*log(vol->volume)/M_LN10,
- precision_str[vol->precision]);
+ int ret;
+ AVExpr *old = NULL;
+
+ if (*pexpr)
+ old = *pexpr;
+ ret = av_expr_parse(pexpr, expr, var_names,
+ NULL, NULL, NULL, NULL, 0, log_ctx);
+ if (ret < 0) {
+ av_log(log_ctx, AV_LOG_ERROR,
+ "Error when evaluating the volume expression '%s'\n", expr);
+ *pexpr = old;
+ return ret;
}
+ av_expr_free(old);
return 0;
}
+static av_cold int init(AVFilterContext *ctx)
+{
+ VolumeContext *vol = ctx->priv;
+ return set_expr(&vol->volume_pexpr, vol->volume_expr, ctx);
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ VolumeContext *vol = ctx->priv;
+ av_expr_free(vol->volume_pexpr);
+ av_opt_free(vol);
+}
+
static int query_formats(AVFilterContext *ctx)
{
VolumeContext *vol = ctx->priv;
@@ -199,6 +246,38 @@ static av_cold void volume_init(VolumeContext *vol)
ff_volume_init_x86(vol);
}
+static int set_volume(AVFilterContext *ctx)
+{
+ VolumeContext *vol = ctx->priv;
+
+ vol->volume = av_expr_eval(vol->volume_pexpr, vol->var_values, NULL);
+ if (isnan(vol->volume)) {
+ if (vol->eval_mode == EVAL_MODE_ONCE) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid value NaN for volume\n");
+ return AVERROR(EINVAL);
+ } else {
+ av_log(ctx, AV_LOG_WARNING, "Invalid value NaN for volume, setting to 0\n");
+ vol->volume = 0;
+ }
+ }
+ vol->var_values[VAR_VOLUME] = vol->volume;
+
+ av_log(ctx, AV_LOG_VERBOSE, "n:%f t:%f pts:%f precision:%s ",
+ vol->var_values[VAR_N], vol->var_values[VAR_T], vol->var_values[VAR_PTS],
+ precision_str[vol->precision]);
+
+ if (vol->precision == PRECISION_FIXED) {
+ vol->volume_i = (int)(vol->volume * 256 + 0.5);
+ vol->volume = vol->volume_i / 256.0;
+ av_log(ctx, AV_LOG_VERBOSE, "volume_i:%d/255 ", vol->volume_i);
+ }
+ av_log(ctx, AV_LOG_VERBOSE, "volume:%f volume_dB:%f\n",
+ vol->volume, 20.0*log(vol->volume)/M_LN10);
+
+ volume_init(vol);
+ return 0;
+}
+
static int config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
@@ -209,20 +288,114 @@ static int config_output(AVFilterLink *outlink)
vol->channels = inlink->channels;
vol->planes = av_sample_fmt_is_planar(inlink->format) ? vol->channels : 1;
- volume_init(vol);
+ vol->var_values[VAR_N] =
+ vol->var_values[VAR_NB_CONSUMED_SAMPLES] =
+ vol->var_values[VAR_NB_SAMPLES] =
+ vol->var_values[VAR_POS] =
+ vol->var_values[VAR_PTS] =
+ vol->var_values[VAR_STARTPTS] =
+ vol->var_values[VAR_STARTT] =
+ vol->var_values[VAR_T] =
+ vol->var_values[VAR_VOLUME] = NAN;
+
+ vol->var_values[VAR_NB_CHANNELS] = inlink->channels;
+ vol->var_values[VAR_TB] = av_q2d(inlink->time_base);
+ vol->var_values[VAR_SAMPLE_RATE] = inlink->sample_rate;
+
+ av_log(inlink->src, AV_LOG_VERBOSE, "tb:%f sample_rate:%f nb_channels:%f\n",
+ vol->var_values[VAR_TB],
+ vol->var_values[VAR_SAMPLE_RATE],
+ vol->var_values[VAR_NB_CHANNELS]);
+
+ return set_volume(ctx);
+}
- return 0;
+static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
+ char *res, int res_len, int flags)
+{
+ VolumeContext *vol = ctx->priv;
+ int ret = AVERROR(ENOSYS);
+
+ if (!strcmp(cmd, "volume")) {
+ if ((ret = set_expr(&vol->volume_pexpr, args, ctx)) < 0)
+ return ret;
+ if (vol->eval_mode == EVAL_MODE_ONCE)
+ set_volume(ctx);
+ }
+
+ return ret;
}
+#define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
+#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
+#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)*av_q2d(tb))
+
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
{
+ AVFilterContext *ctx = inlink->dst;
VolumeContext *vol = inlink->dst->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
int nb_samples = buf->nb_samples;
AVFrame *out_buf;
+ int64_t pos;
+ AVFrameSideData *sd = av_frame_get_side_data(buf, AV_FRAME_DATA_REPLAYGAIN);
+ int ret;
+
+ if (sd && vol->replaygain != REPLAYGAIN_IGNORE) {
+ if (vol->replaygain != REPLAYGAIN_DROP) {
+ AVReplayGain *replaygain = (AVReplayGain*)sd->data;
+ int32_t gain = 100000;
+ uint32_t peak = 100000;
+ float g, p;
+
+ if (vol->replaygain == REPLAYGAIN_TRACK &&
+ replaygain->track_gain != INT32_MIN) {
+ gain = replaygain->track_gain;
+
+ if (replaygain->track_peak != 0)
+ peak = replaygain->track_peak;
+ } else if (replaygain->album_gain != INT32_MIN) {
+ gain = replaygain->album_gain;
+
+ if (replaygain->album_peak != 0)
+ peak = replaygain->album_peak;
+ } else {
+ av_log(inlink->dst, AV_LOG_WARNING, "Both ReplayGain gain "
+ "values are unknown.\n");
+ }
+ g = gain / 100000.0f;
+ p = peak / 100000.0f;
+
+ av_log(inlink->dst, AV_LOG_VERBOSE,
+ "Using gain %f dB from replaygain side data.\n", g);
+
+ vol->volume = pow(10, (g + vol->replaygain_preamp) / 20);
+ if (vol->replaygain_noclip)
+ vol->volume = FFMIN(vol->volume, 1.0 / p);
+ vol->volume_i = (int)(vol->volume * 256 + 0.5);
+
+ volume_init(vol);
+ }
+ av_frame_remove_side_data(buf, AV_FRAME_DATA_REPLAYGAIN);
+ }
- if (vol->volume == 1.0 || vol->volume_i == 256)
- return ff_filter_frame(outlink, buf);
+ if (isnan(vol->var_values[VAR_STARTPTS])) {
+ vol->var_values[VAR_STARTPTS] = TS2D(buf->pts);
+ vol->var_values[VAR_STARTT ] = TS2T(buf->pts, inlink->time_base);
+ }
+ vol->var_values[VAR_PTS] = TS2D(buf->pts);
+ vol->var_values[VAR_T ] = TS2T(buf->pts, inlink->time_base);
+ vol->var_values[VAR_N ] = inlink->frame_count;
+
+ pos = av_frame_get_pkt_pos(buf);
+ vol->var_values[VAR_POS] = pos == -1 ? NAN : pos;
+ if (vol->eval_mode == EVAL_MODE_FRAME)
+ set_volume(ctx);
+
+ if (vol->volume == 1.0 || vol->volume_i == 256) {
+ out_buf = buf;
+ goto end;
+ }
/* do volume scaling in-place if input buffer is writable */
if (av_frame_is_writable(buf)) {
@@ -231,7 +404,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
out_buf = ff_get_audio_buffer(inlink, nb_samples);
if (!out_buf)
return AVERROR(ENOMEM);
- av_frame_copy_props(out_buf, buf);
+ ret = av_frame_copy_props(out_buf, buf);
+ if (ret < 0) {
+ av_frame_free(&out_buf);
+ av_frame_free(&buf);
+ return ret;
+ }
}
if (vol->precision != PRECISION_FIXED || vol->volume_i > 0) {
@@ -263,9 +441,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
}
}
+ emms_c();
+
if (buf != out_buf)
av_frame_free(&buf);
+end:
+ vol->var_values[VAR_NB_CONSUMED_SAMPLES] += out_buf->nb_samples;
return ff_filter_frame(outlink, out_buf);
}
@@ -294,7 +476,9 @@ AVFilter ff_af_volume = {
.priv_size = sizeof(VolumeContext),
.priv_class = &volume_class,
.init = init,
+ .uninit = uninit,
.inputs = avfilter_af_volume_inputs,
.outputs = avfilter_af_volume_outputs,
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
+ .process_command = process_command,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_volume.h b/chromium/third_party/ffmpeg/libavfilter/af_volume.h
index bd7932e4d40..e78e042d09e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_volume.h
+++ b/chromium/third_party/ffmpeg/libavfilter/af_volume.h
@@ -25,6 +25,7 @@
#define AVFILTER_AF_VOLUME_H
#include "libavutil/common.h"
+#include "libavutil/eval.h"
#include "libavutil/float_dsp.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
@@ -35,10 +36,47 @@ enum PrecisionType {
PRECISION_DOUBLE,
};
+enum EvalMode {
+ EVAL_MODE_ONCE,
+ EVAL_MODE_FRAME,
+ EVAL_MODE_NB
+};
+
+enum VolumeVarName {
+ VAR_N,
+ VAR_NB_CHANNELS,
+ VAR_NB_CONSUMED_SAMPLES,
+ VAR_NB_SAMPLES,
+ VAR_POS,
+ VAR_PTS,
+ VAR_SAMPLE_RATE,
+ VAR_STARTPTS,
+ VAR_STARTT,
+ VAR_T,
+ VAR_TB,
+ VAR_VOLUME,
+ VAR_VARS_NB
+};
+
+enum ReplayGainType {
+ REPLAYGAIN_DROP,
+ REPLAYGAIN_IGNORE,
+ REPLAYGAIN_TRACK,
+ REPLAYGAIN_ALBUM,
+};
+
typedef struct VolumeContext {
const AVClass *class;
AVFloatDSPContext fdsp;
enum PrecisionType precision;
+ enum EvalMode eval_mode;
+ const char *volume_expr;
+ AVExpr *volume_pexpr;
+ double var_values[VAR_VARS_NB];
+
+ enum ReplayGainType replaygain;
+ double replaygain_preamp;
+ int replaygain_noclip;
double volume;
int volume_i;
int channels;
diff --git a/chromium/third_party/ffmpeg/libavfilter/allfilters.c b/chromium/third_party/ffmpeg/libavfilter/allfilters.c
index d58e8ccd07f..22d643d3e16 100644
--- a/chromium/third_party/ffmpeg/libavfilter/allfilters.c
+++ b/chromium/third_party/ffmpeg/libavfilter/allfilters.c
@@ -80,6 +80,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(BANDREJECT, bandreject, af);
REGISTER_FILTER(BASS, bass, af);
REGISTER_FILTER(BIQUAD, biquad, af);
+ REGISTER_FILTER(BS2B, bs2b, af);
REGISTER_FILTER(CHANNELMAP, channelmap, af);
REGISTER_FILTER(CHANNELSPLIT, channelsplit, af);
REGISTER_FILTER(COMPAND, compand, af);
@@ -122,6 +123,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(CURVES, curves, vf);
REGISTER_FILTER(DCTDNOIZ, dctdnoiz, vf);
REGISTER_FILTER(DECIMATE, decimate, vf);
+ REGISTER_FILTER(DEJUDDER, dejudder, vf);
REGISTER_FILTER(DELOGO, delogo, vf);
REGISTER_FILTER(DESHAKE, deshake, vf);
REGISTER_FILTER(DRAWBOX, drawbox, vf);
@@ -136,6 +138,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(FIELDORDER, fieldorder, vf);
REGISTER_FILTER(FORMAT, format, vf);
REGISTER_FILTER(FPS, fps, vf);
+ REGISTER_FILTER(FRAMEPACK, framepack, vf);
REGISTER_FILTER(FRAMESTEP, framestep, vf);
REGISTER_FILTER(FREI0R, frei0r, vf);
REGISTER_FILTER(GEQ, geq, vf);
@@ -187,6 +190,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(SETSAR, setsar, vf);
REGISTER_FILTER(SETTB, settb, vf);
REGISTER_FILTER(SHOWINFO, showinfo, vf);
+ REGISTER_FILTER(SHUFFLEPLANES, shuffleplanes, vf);
REGISTER_FILTER(SMARTBLUR, smartblur, vf);
REGISTER_FILTER(SPLIT, split, vf);
REGISTER_FILTER(SPP, spp, vf);
diff --git a/chromium/third_party/ffmpeg/libavfilter/audio.c b/chromium/third_party/ffmpeg/libavfilter/audio.c
index 315c273c286..1e1d8e04dfe 100644
--- a/chromium/third_party/ffmpeg/libavfilter/audio.c
+++ b/chromium/third_party/ffmpeg/libavfilter/audio.c
@@ -124,9 +124,9 @@ AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays_channels(uint8_t **
samples->linesize[0] = samplesref->linesize[0] = linesize;
if (planes > FF_ARRAY_ELEMS(samples->data)) {
- samples-> extended_data = av_mallocz(sizeof(*samples->extended_data) *
+ samples-> extended_data = av_mallocz_array(sizeof(*samples->extended_data),
planes);
- samplesref->extended_data = av_mallocz(sizeof(*samplesref->extended_data) *
+ samplesref->extended_data = av_mallocz_array(sizeof(*samplesref->extended_data),
planes);
if (!samples->extended_data || !samplesref->extended_data)
diff --git a/chromium/third_party/ffmpeg/libavfilter/avcodec.c b/chromium/third_party/ffmpeg/libavfilter/avcodec.c
index 605e5d24d8b..ba11a254925 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avcodec.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avcodec.c
@@ -116,7 +116,7 @@ int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
planes = av_sample_fmt_is_planar(src->format) ? nb_channels : 1;
if (planes > FF_ARRAY_ELEMS(dst->data)) {
- dst->extended_data = av_mallocz(planes * sizeof(*dst->extended_data));
+ dst->extended_data = av_mallocz_array(planes, sizeof(*dst->extended_data));
if (!dst->extended_data)
return AVERROR(ENOMEM);
memcpy(dst->extended_data, src->extended_data,
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c b/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c
index 3ca596ccb32..f9ebc0f9676 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c
@@ -186,9 +186,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
p->outpicref->height != outlink->h) {
av_frame_free(&p->outpicref);
p->outpicref = ff_get_video_buffer(outlink, outlink->w, outlink->h);
- if (!p->outpicref)
+ if (!p->outpicref) {
av_frame_free(&insamples);
return AVERROR(ENOMEM);
+ }
for (i = 0; i < outlink->h; i++)
memset(p->outpicref->data[0] + i * p->outpicref->linesize[0], 0, outlink->w * 4);
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_concat.c b/chromium/third_party/ffmpeg/libavfilter/avf_concat.c
index c211dc43d6d..18f373ca0a7 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_concat.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_concat.c
@@ -174,7 +174,7 @@ static int push_frame(AVFilterContext *ctx, unsigned in_no, AVFrame *buf)
if (inlink->sample_rate)
/* use number of audio samples */
in->pts += av_rescale_q(buf->nb_samples,
- (AVRational){ 1, inlink->sample_rate },
+ av_make_q(1, inlink->sample_rate),
outlink->time_base);
else if (in->nb_frames >= 2)
/* use mean duration */
diff --git a/chromium/third_party/ffmpeg/libavfilter/avfilter.c b/chromium/third_party/ffmpeg/libavfilter/avfilter.c
index 2567ce92c1c..7e166e04f8c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avfilter.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avfilter.c
@@ -295,7 +295,7 @@ int avfilter_config_links(AVFilterContext *filter)
if ((config_link = link->dstpad->config_props))
if ((ret = config_link(link)) < 0) {
- av_log(link->src, AV_LOG_ERROR,
+ av_log(link->dst, AV_LOG_ERROR,
"Failed to configure input pad on %s\n",
link->dst->name);
return ret;
@@ -456,6 +456,7 @@ int avfilter_process_command(AVFilterContext *filter, const char *cmd, const cha
}
static AVFilter *first_filter;
+static AVFilter **last_filter = &first_filter;
#if !FF_API_NOCONST_GET_NAME
const
@@ -476,7 +477,7 @@ AVFilter *avfilter_get_by_name(const char *name)
int avfilter_register(AVFilter *filter)
{
- AVFilter **f = &first_filter;
+ AVFilter **f = last_filter;
int i;
/* the filter must select generic or internal exclusively */
@@ -492,6 +493,7 @@ int avfilter_register(AVFilter *filter)
while(*f || avpriv_atomic_ptr_cas((void * volatile *)f, NULL, filter))
f = &(*f)->next;
+ last_filter = &filter->next;
return 0;
}
@@ -997,7 +999,7 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
int (*filter_frame)(AVFilterLink *, AVFrame *);
AVFilterContext *dstctx = link->dst;
AVFilterPad *dst = link->dstpad;
- AVFrame *out;
+ AVFrame *out = NULL;
int ret;
AVFilterCommand *cmd= link->dst->command_queue;
int64_t pts;
@@ -1022,13 +1024,18 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
case AVMEDIA_TYPE_AUDIO:
out = ff_get_audio_buffer(link, frame->nb_samples);
break;
- default: return AVERROR(EINVAL);
+ default:
+ ret = AVERROR(EINVAL);
+ goto fail;
}
if (!out) {
- av_frame_free(&frame);
- return AVERROR(ENOMEM);
+ ret = AVERROR(ENOMEM);
+ goto fail;
}
- av_frame_copy_props(out, frame);
+
+ ret = av_frame_copy_props(out, frame);
+ if (ret < 0)
+ goto fail;
switch (link->type) {
case AVMEDIA_TYPE_VIDEO:
@@ -1041,7 +1048,9 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
av_get_channel_layout_nb_channels(frame->channel_layout),
frame->format);
break;
- default: return AVERROR(EINVAL);
+ default:
+ ret = AVERROR(EINVAL);
+ goto fail;
}
av_frame_free(&frame);
@@ -1074,6 +1083,11 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
link->frame_requested = 0;
ff_update_link_current_pts(link, pts);
return ret;
+
+fail:
+ av_frame_free(&out);
+ av_frame_free(&frame);
+ return ret;
}
static int ff_filter_frame_needs_framing(AVFilterLink *link, AVFrame *frame)
diff --git a/chromium/third_party/ffmpeg/libavfilter/avfilter.h b/chromium/third_party/ffmpeg/libavfilter/avfilter.h
index 3518ad8b3b7..b5220b96d9c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avfilter.h
+++ b/chromium/third_party/ffmpeg/libavfilter/avfilter.h
@@ -199,7 +199,7 @@ typedef struct AVFilterBufferRef {
* Copy properties of src to dst, without copying the actual data
*/
attribute_deprecated
-void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src);
+void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, const AVFilterBufferRef *src);
/**
* Add a new reference to a buffer.
@@ -385,6 +385,12 @@ struct AVFilterPad {
*/
int needs_fifo;
+ /**
+ * The filter expects writable frames from its input link,
+ * duplicating data buffers if needed.
+ *
+ * input pads only.
+ */
int needs_writable;
};
#endif
@@ -662,7 +668,7 @@ struct AVFilterContext {
* allowed threading types. I.e. a threading type needs to be set in both
* to be allowed.
*
- * After the filter is initialzed, libavfilter sets this field to the
+ * After the filter is initialized, libavfilter sets this field to the
* threading type that is actually used (0 for no multithreading).
*/
int thread_type;
@@ -824,7 +830,7 @@ struct AVFilterLink {
/**
* True if the link is closed.
- * If set, all attemps of start_frame, filter_frame or request_frame
+ * If set, all attempts of start_frame, filter_frame or request_frame
* will fail with AVERROR_EOF, and if necessary the reference will be
* destroyed.
* If request_frame returns AVERROR_EOF, this flag is set on the
@@ -1254,19 +1260,21 @@ AVFilterGraph *avfilter_graph_alloc(void);
*
* @return the context of the newly created filter instance (note that it is
* also retrievable directly through AVFilterGraph.filters or with
- * avfilter_graph_get_filter()) on success or NULL or failure.
+ * avfilter_graph_get_filter()) on success or NULL on failure.
*/
AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,
const AVFilter *filter,
const char *name);
/**
- * Get a filter instance with name name from graph.
+ * Get a filter instance identified by instance name from graph.
*
+ * @param graph filter graph to search through.
+ * @param name filter instance name (should be unique in the graph).
* @return the pointer to the found filter instance or NULL if it
* cannot be found.
*/
-AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, char *name);
+AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, const char *name);
#if FF_API_AVFILTER_OPEN
/**
@@ -1378,7 +1386,7 @@ void avfilter_inout_free(AVFilterInOut **inout);
* outputs of the already existing filters, which are provided as
* inputs to the parsed filters.
*
- * @param graph the filter graph where to link the parsed grap context
+ * @param graph the filter graph where to link the parsed graph context
* @param filters string to be parsed
* @param inputs linked list to the inputs of the graph
* @param outputs linked list to the outputs of the graph
@@ -1476,7 +1484,7 @@ int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const
* "all" sends to all filters
* otherwise it can be a filter or filter instance name
* which will send the command to all matching filters.
- * @param cmd the command to sent, for handling simplicity all commands must be alphanummeric only
+ * @param cmd the command to sent, for handling simplicity all commands must be alphanumeric only
* @param arg the argument for the command
* @param ts time at which the command should be sent to the filter
*
diff --git a/chromium/third_party/ffmpeg/libavfilter/avfiltergraph.c b/chromium/third_party/ffmpeg/libavfilter/avfiltergraph.c
index 1fb83c48778..47b5b721e85 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avfiltergraph.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avfiltergraph.c
@@ -31,7 +31,6 @@
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
-#include "libavcodec/avcodec.h" // avcodec_find_best_pix_fmt_of_2()
#include "avfilter.h"
#include "formats.h"
@@ -281,7 +280,7 @@ static int graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)
return 0;
}
-AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, char *name)
+AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, const char *name)
{
int i;
@@ -628,7 +627,7 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref)
int i;
for (i=0; i<link->in_formats->nb_formats; i++) {
enum AVPixelFormat p = link->in_formats->formats[i];
- best= avcodec_find_best_pix_fmt_of_2(best, p, ref->format, has_alpha, NULL);
+ best= av_find_best_pix_fmt_of_2(best, p, ref->format, has_alpha, NULL);
}
av_log(link->src,AV_LOG_DEBUG, "picking %s out of %d ref:%s alpha:%d\n",
av_get_pix_fmt_name(best), link->in_formats->nb_formats,
diff --git a/chromium/third_party/ffmpeg/libavfilter/buffer.c b/chromium/third_party/ffmpeg/libavfilter/buffer.c
index a62618440b4..0327952e792 100644
--- a/chromium/third_party/ffmpeg/libavfilter/buffer.c
+++ b/chromium/third_party/ffmpeg/libavfilter/buffer.c
@@ -79,7 +79,7 @@ AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
if (ref->extended_data && ref->extended_data != ref->data) {
int nb_channels = av_get_channel_layout_nb_channels(ref->audio->channel_layout);
- if (!(ret->extended_data = av_malloc(sizeof(*ret->extended_data) *
+ if (!(ret->extended_data = av_malloc_array(sizeof(*ret->extended_data),
nb_channels))) {
av_freep(&ret->audio);
av_freep(&ret);
@@ -150,7 +150,7 @@ int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
return 0;
}
-void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
+void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, const AVFilterBufferRef *src)
{
// copy common properties
dst->pts = src->pts;
diff --git a/chromium/third_party/ffmpeg/libavfilter/buffersink.c b/chromium/third_party/ffmpeg/libavfilter/buffersink.c
index a6b24adffdd..345af773ff3 100644
--- a/chromium/third_party/ffmpeg/libavfilter/buffersink.c
+++ b/chromium/third_party/ffmpeg/libavfilter/buffersink.c
@@ -36,7 +36,7 @@
#include "buffersink.h"
#include "internal.h"
-typedef struct {
+typedef struct BufferSinkContext {
const AVClass *class;
AVFifoBuffer *fifo; ///< FIFO buffer of video frame references
unsigned warning_limit;
@@ -76,8 +76,7 @@ static av_cold void uninit(AVFilterContext *ctx)
av_fifo_generic_read(sink->fifo, &frame, sizeof(frame), NULL);
av_frame_free(&frame);
}
- av_fifo_free(sink->fifo);
- sink->fifo = NULL;
+ av_fifo_freep(&sink->fifo);
}
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/buffersink.h b/chromium/third_party/ffmpeg/libavfilter/buffersink.h
index ce96d08b361..24cd2feac7b 100644
--- a/chromium/third_party/ffmpeg/libavfilter/buffersink.h
+++ b/chromium/third_party/ffmpeg/libavfilter/buffersink.h
@@ -21,11 +21,18 @@
/**
* @file
+ * @ingroup lavfi_buffersink
* memory buffer sink API for audio and video
*/
#include "avfilter.h"
+/**
+ * @defgroup lavfi_buffersink Buffer sink API
+ * @ingroup lavfi
+ * @{
+ */
+
#if FF_API_AVFILTERBUFFER
/**
* Get an audio/video buffer data from buffer_sink and put it in bufref.
@@ -162,8 +169,12 @@ AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx);
* @param frame pointer to an allocated frame that will be filled with data.
* The data must be freed using av_frame_unref() / av_frame_free()
*
- * @return >= 0 in case of success, a negative AVERROR code in case of
- * failure.
+ * @return
+ * - >= 0 if a frame was successfully returned.
+ * - AVERROR(EAGAIN) if no frames are available at this point; more
+ * input frames must be added to the filtergraph to get more output.
+ * - AVERROR_EOF if there will be no more output frames on this sink.
+ * - A different negative AVERROR code in other failure cases.
*/
int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame);
@@ -178,9 +189,16 @@ int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame);
* frame will contain exactly nb_samples audio samples, except at
* the end of stream, when it can contain less than nb_samples.
*
+ * @return The return codes have the same meaning as for
+ * av_buffersink_get_samples().
+ *
* @warning do not mix this function with av_buffersink_get_frame(). Use only one or
* the other with a single sink, not both.
*/
int av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples);
+/**
+ * @}
+ */
+
#endif /* AVFILTER_BUFFERSINK_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/buffersrc.c b/chromium/third_party/ffmpeg/libavfilter/buffersrc.c
index 6b6210df064..bb44e45d3c6 100644
--- a/chromium/third_party/ffmpeg/libavfilter/buffersrc.c
+++ b/chromium/third_party/ffmpeg/libavfilter/buffersrc.c
@@ -41,7 +41,7 @@
#include "video.h"
#include "avcodec.h"
-typedef struct {
+typedef struct BufferSourceContext {
const AVClass *class;
AVFifoBuffer *fifo;
AVRational time_base; ///< time_base to set in the output link
@@ -58,7 +58,6 @@ typedef struct {
/* audio only */
int sample_rate;
enum AVSampleFormat sample_fmt;
- char *sample_fmt_str;
int channels;
uint64_t channel_layout;
char *channel_layout_str;
@@ -121,7 +120,7 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx,
{
BufferSourceContext *s = ctx->priv;
AVFrame *copy;
- int ret;
+ int refcounted, ret;
s->nb_failed_requests = 0;
@@ -131,6 +130,8 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx,
} else if (s->eof)
return AVERROR(EINVAL);
+ refcounted = !!frame->buf[0];
+
if (!(flags & AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT)) {
switch (ctx->outputs[0]->type) {
@@ -158,10 +159,20 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx,
if (!(copy = av_frame_alloc()))
return AVERROR(ENOMEM);
- av_frame_move_ref(copy, frame);
+
+ if (refcounted) {
+ av_frame_move_ref(copy, frame);
+ } else {
+ ret = av_frame_ref(copy, frame);
+ if (ret < 0) {
+ av_frame_free(&copy);
+ return ret;
+ }
+ }
if ((ret = av_fifo_generic_write(s->fifo, &copy, sizeof(copy), NULL)) < 0) {
- av_frame_move_ref(frame, copy);
+ if (refcounted)
+ av_frame_move_ref(frame, copy);
av_frame_free(&copy);
return ret;
}
@@ -260,7 +271,7 @@ do { \
if (planes > FF_ARRAY_ELEMS(frame->buf)) {
frame->nb_extended_buf = planes - FF_ARRAY_ELEMS(frame->buf);
- frame->extended_buf = av_mallocz(sizeof(*frame->extended_buf) *
+ frame->extended_buf = av_mallocz_array(sizeof(*frame->extended_buf),
frame->nb_extended_buf);
if (!frame->extended_buf) {
ret = AVERROR(ENOMEM);
@@ -326,7 +337,7 @@ static const AVOption buffer_options[] = {
{ "width", NULL, OFFSET(w), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, V },
{ "video_size", NULL, OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, .flags = V },
{ "height", NULL, OFFSET(h), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, V },
- { "pix_fmt", NULL, OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, .flags = V },
+ { "pix_fmt", NULL, OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, { .i64 = AV_PIX_FMT_NONE }, .min = AV_PIX_FMT_NONE, .max = INT_MAX, .flags = V },
#if FF_API_OLD_FILTER_OPTS
/* those 4 are for compatibility with the old option passing system where each filter
* did its own parsing */
@@ -348,7 +359,7 @@ AVFILTER_DEFINE_CLASS(buffer);
static const AVOption abuffer_options[] = {
{ "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, INT_MAX, A },
{ "sample_rate", NULL, OFFSET(sample_rate), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, A },
- { "sample_fmt", NULL, OFFSET(sample_fmt_str), AV_OPT_TYPE_STRING, .flags = A },
+ { "sample_fmt", NULL, OFFSET(sample_fmt), AV_OPT_TYPE_SAMPLE_FMT, { .i64 = AV_SAMPLE_FMT_NONE }, .min = AV_SAMPLE_FMT_NONE, .max = INT_MAX, .flags = A },
{ "channel_layout", NULL, OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, .flags = A },
{ "channels", NULL, OFFSET(channels), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, A },
{ NULL },
@@ -361,10 +372,8 @@ static av_cold int init_audio(AVFilterContext *ctx)
BufferSourceContext *s = ctx->priv;
int ret = 0;
- s->sample_fmt = av_get_sample_fmt(s->sample_fmt_str);
if (s->sample_fmt == AV_SAMPLE_FMT_NONE) {
- av_log(ctx, AV_LOG_ERROR, "Invalid sample format %s\n",
- s->sample_fmt_str);
+ av_log(ctx, AV_LOG_ERROR, "Sample format was not set or was invalid\n");
return AVERROR(EINVAL);
}
@@ -402,7 +411,7 @@ static av_cold int init_audio(AVFilterContext *ctx)
av_log(ctx, AV_LOG_VERBOSE,
"tb:%d/%d samplefmt:%s samplerate:%d chlayout:%s\n",
- s->time_base.num, s->time_base.den, s->sample_fmt_str,
+ s->time_base.num, s->time_base.den, av_get_sample_fmt_name(s->sample_fmt),
s->sample_rate, s->channel_layout_str);
s->warning_limit = 100;
@@ -417,8 +426,7 @@ static av_cold void uninit(AVFilterContext *ctx)
av_fifo_generic_read(s->fifo, &frame, sizeof(frame), NULL);
av_frame_free(&frame);
}
- av_fifo_free(s->fifo);
- s->fifo = NULL;
+ av_fifo_freep(&s->fifo);
}
static int query_formats(AVFilterContext *ctx)
diff --git a/chromium/third_party/ffmpeg/libavfilter/buffersrc.h b/chromium/third_party/ffmpeg/libavfilter/buffersrc.h
index 89613e10cd2..5d124337b5a 100644
--- a/chromium/third_party/ffmpeg/libavfilter/buffersrc.h
+++ b/chromium/third_party/ffmpeg/libavfilter/buffersrc.h
@@ -22,12 +22,19 @@
/**
* @file
+ * @ingroup lavfi_buffersrc
* Memory buffer source API.
*/
#include "libavcodec/avcodec.h"
#include "avfilter.h"
+/**
+ * @defgroup lavfi_buffersrc Buffer source API
+ * @ingroup lavfi
+ * @{
+ */
+
enum {
/**
@@ -79,8 +86,9 @@ unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src);
#if FF_API_AVFILTERBUFFER
/**
- * Add a buffer to the filtergraph s.
+ * Add a buffer to a filtergraph.
*
+ * @param ctx an instance of the buffersrc filter
* @param buf buffer containing frame data to be passed down the filtergraph.
* This function will take ownership of buf, the user must not free it.
* A NULL buf signals EOF -- i.e. no more frames will be sent to this filter.
@@ -88,13 +96,13 @@ unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src);
* @deprecated use av_buffersrc_write_frame() or av_buffersrc_add_frame()
*/
attribute_deprecated
-int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf);
+int av_buffersrc_buffer(AVFilterContext *ctx, AVFilterBufferRef *buf);
#endif
/**
* Add a frame to the buffer source.
*
- * @param s an instance of the buffersrc filter.
+ * @param ctx an instance of the buffersrc filter
* @param frame frame to be added. If the frame is reference counted, this
* function will make a new reference to it. Otherwise the frame data will be
* copied.
@@ -104,12 +112,12 @@ int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf);
* This function is equivalent to av_buffersrc_add_frame_flags() with the
* AV_BUFFERSRC_FLAG_KEEP_REF flag.
*/
-int av_buffersrc_write_frame(AVFilterContext *s, const AVFrame *frame);
+int av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame);
/**
* Add a frame to the buffer source.
*
- * @param s an instance of the buffersrc filter.
+ * @param ctx an instance of the buffersrc filter
* @param frame frame to be added. If the frame is reference counted, this
* function will take ownership of the reference(s) and reset the frame.
* Otherwise the frame data will be copied. If this function returns an error,
@@ -145,4 +153,8 @@ int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src,
AVFrame *frame, int flags);
+/**
+ * @}
+ */
+
#endif /* AVFILTER_BUFFERSRC_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/deshake.h b/chromium/third_party/ffmpeg/libavfilter/deshake.h
index 57929739577..615953cfe3e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/deshake.h
+++ b/chromium/third_party/ffmpeg/libavfilter/deshake.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013 Wei Gao <weigao@multicorewareinc.com>
+ * Copyright (C) 2013 Lenny Wang
*
* This file is part of FFmpeg.
*
@@ -57,12 +58,8 @@ typedef struct {
typedef struct {
cl_command_queue command_queue;
cl_program program;
- cl_kernel kernel;
- size_t matrix_size;
- float matrix_y[9];
- float matrix_uv[9];
- cl_mem cl_matrix_y;
- cl_mem cl_matrix_uv;
+ cl_kernel kernel_luma;
+ cl_kernel kernel_chroma;
int in_plane_size[8];
int out_plane_size[8];
int plane_num;
diff --git a/chromium/third_party/ffmpeg/libavfilter/deshake_opencl.c b/chromium/third_party/ffmpeg/libavfilter/deshake_opencl.c
index e4e4df19e83..caf2bf2e2db 100644
--- a/chromium/third_party/ffmpeg/libavfilter/deshake_opencl.c
+++ b/chromium/third_party/ffmpeg/libavfilter/deshake_opencl.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013 Wei Gao <weigao@multicorewareinc.com>
+ * Copyright (C) 2013 Lenny Wang
*
* This file is part of FFmpeg.
*
@@ -29,8 +30,8 @@
#include "deshake_opencl.h"
#include "libavutil/opencl_internal.h"
-#define MATRIX_SIZE 6
#define PLANE_NUM 3
+#define ROUND_TO_16(a) ((((a - 1)/16)+1)*16)
int ff_opencl_transform(AVFilterContext *ctx,
int width, int height, int cw, int ch,
@@ -39,29 +40,40 @@ int ff_opencl_transform(AVFilterContext *ctx,
enum FillMethod fill, AVFrame *in, AVFrame *out)
{
int ret = 0;
- const size_t global_work_size = width * height + 2 * ch * cw;
cl_int status;
DeshakeContext *deshake = ctx->priv;
- FFOpenclParam opencl_param = {0};
-
- opencl_param.ctx = ctx;
- opencl_param.kernel = deshake->opencl_ctx.kernel;
- ret = av_opencl_buffer_write(deshake->opencl_ctx.cl_matrix_y, (uint8_t *)matrix_y, deshake->opencl_ctx.matrix_size * sizeof(cl_float));
- if (ret < 0)
- return ret;
- ret = av_opencl_buffer_write(deshake->opencl_ctx.cl_matrix_uv, (uint8_t *)matrix_uv, deshake->opencl_ctx.matrix_size * sizeof(cl_float));
- if (ret < 0)
- return ret;
+ float4 packed_matrix_lu = {matrix_y[0], matrix_y[1], matrix_y[2], matrix_y[5]};
+ float4 packed_matrix_ch = {matrix_uv[0], matrix_uv[1], matrix_uv[2], matrix_uv[5]};
+ size_t global_worksize_lu[2] = {(size_t)ROUND_TO_16(width), (size_t)ROUND_TO_16(height)};
+ size_t global_worksize_ch[2] = {(size_t)ROUND_TO_16(cw), (size_t)(2*ROUND_TO_16(ch))};
+ size_t local_worksize[2] = {16, 16};
+ FFOpenclParam param_lu = {0};
+ FFOpenclParam param_ch = {0};
+ param_lu.ctx = param_ch.ctx = ctx;
+ param_lu.kernel = deshake->opencl_ctx.kernel_luma;
+ param_ch.kernel = deshake->opencl_ctx.kernel_chroma;
if ((unsigned int)interpolate > INTERPOLATE_BIQUADRATIC) {
av_log(ctx, AV_LOG_ERROR, "Selected interpolate method is invalid\n");
return AVERROR(EINVAL);
}
- ret = ff_opencl_set_parameter(&opencl_param,
+ ret = ff_opencl_set_parameter(&param_lu,
+ FF_OPENCL_PARAM_INFO(deshake->opencl_ctx.cl_inbuf),
+ FF_OPENCL_PARAM_INFO(deshake->opencl_ctx.cl_outbuf),
+ FF_OPENCL_PARAM_INFO(packed_matrix_lu),
+ FF_OPENCL_PARAM_INFO(interpolate),
+ FF_OPENCL_PARAM_INFO(fill),
+ FF_OPENCL_PARAM_INFO(in->linesize[0]),
+ FF_OPENCL_PARAM_INFO(out->linesize[0]),
+ FF_OPENCL_PARAM_INFO(height),
+ FF_OPENCL_PARAM_INFO(width),
+ NULL);
+ if (ret < 0)
+ return ret;
+ ret = ff_opencl_set_parameter(&param_ch,
FF_OPENCL_PARAM_INFO(deshake->opencl_ctx.cl_inbuf),
FF_OPENCL_PARAM_INFO(deshake->opencl_ctx.cl_outbuf),
- FF_OPENCL_PARAM_INFO(deshake->opencl_ctx.cl_matrix_y),
- FF_OPENCL_PARAM_INFO(deshake->opencl_ctx.cl_matrix_uv),
+ FF_OPENCL_PARAM_INFO(packed_matrix_ch),
FF_OPENCL_PARAM_INFO(interpolate),
FF_OPENCL_PARAM_INFO(fill),
FF_OPENCL_PARAM_INFO(in->linesize[0]),
@@ -76,13 +88,15 @@ int ff_opencl_transform(AVFilterContext *ctx,
if (ret < 0)
return ret;
status = clEnqueueNDRangeKernel(deshake->opencl_ctx.command_queue,
- deshake->opencl_ctx.kernel, 1, NULL,
- &global_work_size, NULL, 0, NULL, NULL);
+ deshake->opencl_ctx.kernel_luma, 2, NULL,
+ global_worksize_lu, local_worksize, 0, NULL, NULL);
+ status |= clEnqueueNDRangeKernel(deshake->opencl_ctx.command_queue,
+ deshake->opencl_ctx.kernel_chroma, 2, NULL,
+ global_worksize_ch, local_worksize, 0, NULL, NULL);
if (status != CL_SUCCESS) {
av_log(ctx, AV_LOG_ERROR, "OpenCL run kernel error occurred: %s\n", av_opencl_errstr(status));
return AVERROR_EXTERNAL;
}
- clFinish(deshake->opencl_ctx.command_queue);
ret = av_opencl_buffer_read_image(out->data, deshake->opencl_ctx.out_plane_size,
deshake->opencl_ctx.plane_num, deshake->opencl_ctx.cl_outbuf,
deshake->opencl_ctx.cl_outbuf_size);
@@ -98,16 +112,7 @@ int ff_opencl_deshake_init(AVFilterContext *ctx)
ret = av_opencl_init(NULL);
if (ret < 0)
return ret;
- deshake->opencl_ctx.matrix_size = MATRIX_SIZE;
- deshake->opencl_ctx.plane_num = PLANE_NUM;
- ret = av_opencl_buffer_create(&deshake->opencl_ctx.cl_matrix_y,
- deshake->opencl_ctx.matrix_size*sizeof(cl_float), CL_MEM_READ_ONLY, NULL);
- if (ret < 0)
- return ret;
- ret = av_opencl_buffer_create(&deshake->opencl_ctx.cl_matrix_uv,
- deshake->opencl_ctx.matrix_size*sizeof(cl_float), CL_MEM_READ_ONLY, NULL);
- if (ret < 0)
- return ret;
+ deshake->opencl_ctx.plane_num = PLANE_NUM;
deshake->opencl_ctx.command_queue = av_opencl_get_command_queue();
if (!deshake->opencl_ctx.command_queue) {
av_log(ctx, AV_LOG_ERROR, "Unable to get OpenCL command queue in filter 'deshake'\n");
@@ -118,10 +123,19 @@ int ff_opencl_deshake_init(AVFilterContext *ctx)
av_log(ctx, AV_LOG_ERROR, "OpenCL failed to compile program 'avfilter_transform'\n");
return AVERROR(EINVAL);
}
- if (!deshake->opencl_ctx.kernel) {
- deshake->opencl_ctx.kernel = clCreateKernel(deshake->opencl_ctx.program, "avfilter_transform", &ret);
+ if (!deshake->opencl_ctx.kernel_luma) {
+ deshake->opencl_ctx.kernel_luma = clCreateKernel(deshake->opencl_ctx.program,
+ "avfilter_transform_luma", &ret);
+ if (ret != CL_SUCCESS) {
+ av_log(ctx, AV_LOG_ERROR, "OpenCL failed to create kernel 'avfilter_transform_luma'\n");
+ return AVERROR(EINVAL);
+ }
+ }
+ if (!deshake->opencl_ctx.kernel_chroma) {
+ deshake->opencl_ctx.kernel_chroma = clCreateKernel(deshake->opencl_ctx.program,
+ "avfilter_transform_chroma", &ret);
if (ret != CL_SUCCESS) {
- av_log(ctx, AV_LOG_ERROR, "OpenCL failed to create kernel 'avfilter_transform'\n");
+ av_log(ctx, AV_LOG_ERROR, "OpenCL failed to create kernel 'avfilter_transform_chroma'\n");
return AVERROR(EINVAL);
}
}
@@ -133,9 +147,8 @@ void ff_opencl_deshake_uninit(AVFilterContext *ctx)
DeshakeContext *deshake = ctx->priv;
av_opencl_buffer_release(&deshake->opencl_ctx.cl_inbuf);
av_opencl_buffer_release(&deshake->opencl_ctx.cl_outbuf);
- av_opencl_buffer_release(&deshake->opencl_ctx.cl_matrix_y);
- av_opencl_buffer_release(&deshake->opencl_ctx.cl_matrix_uv);
- clReleaseKernel(deshake->opencl_ctx.kernel);
+ clReleaseKernel(deshake->opencl_ctx.kernel_luma);
+ clReleaseKernel(deshake->opencl_ctx.kernel_chroma);
clReleaseProgram(deshake->opencl_ctx.program);
deshake->opencl_ctx.command_queue = NULL;
av_opencl_uninit();
diff --git a/chromium/third_party/ffmpeg/libavfilter/deshake_opencl.h b/chromium/third_party/ffmpeg/libavfilter/deshake_opencl.h
index 30d17d44263..5b0a2414b82 100644
--- a/chromium/third_party/ffmpeg/libavfilter/deshake_opencl.h
+++ b/chromium/third_party/ffmpeg/libavfilter/deshake_opencl.h
@@ -23,6 +23,13 @@
#include "deshake.h"
+typedef struct {
+ float x;
+ float y;
+ float z;
+ float w;
+} float4;
+
int ff_opencl_deshake_init(AVFilterContext *ctx);
void ff_opencl_deshake_uninit(AVFilterContext *ctx);
diff --git a/chromium/third_party/ffmpeg/libavfilter/deshake_opencl_kernel.h b/chromium/third_party/ffmpeg/libavfilter/deshake_opencl_kernel.h
index ca0bf839b16..dd45d6f60ba 100644
--- a/chromium/third_party/ffmpeg/libavfilter/deshake_opencl_kernel.h
+++ b/chromium/third_party/ffmpeg/libavfilter/deshake_opencl_kernel.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013 Wei Gao <weigao@multicorewareinc.com>
+ * Copyright (C) 2013 Lenny Wang
*
*
* This file is part of FFmpeg.
@@ -25,16 +26,16 @@
#include "libavutil/opencl.h"
const char *ff_kernel_deshake_opencl = AV_OPENCL_KERNEL(
-
-inline unsigned char pixel(global const unsigned char *src, float x, float y,
+inline unsigned char pixel(global const unsigned char *src, int x, int y,
int w, int h,int stride, unsigned char def)
{
- return (x < 0 || y < 0 || x >= w || y >= h) ? def : src[(int)x + (int)y * stride];
+ return (x < 0 || y < 0 || x >= w || y >= h) ? def : src[x + y * stride];
}
+
unsigned char interpolate_nearest(float x, float y, global const unsigned char *src,
int width, int height, int stride, unsigned char def)
{
- return pixel(src, (int)(x + 0.5), (int)(y + 0.5), width, height, stride, def);
+ return pixel(src, (int)(x + 0.5f), (int)(y + 0.5f), width, height, stride, def);
}
unsigned char interpolate_bilinear(float x, float y, global const unsigned char *src,
@@ -42,21 +43,18 @@ unsigned char interpolate_bilinear(float x, float y, global const unsigned char
{
int x_c, x_f, y_c, y_f;
int v1, v2, v3, v4;
+ x_f = (int)x;
+ y_f = (int)y;
+ x_c = x_f + 1;
+ y_c = y_f + 1;
- if (x < -1 || x > width || y < -1 || y > height) {
+ if (x_f < -1 || x_f > width || y_f < -1 || y_f > height) {
return def;
} else {
- x_f = (int)x;
- x_c = x_f + 1;
-
- y_f = (int)y;
- y_c = y_f + 1;
-
- v1 = pixel(src, x_c, y_c, width, height, stride, def);
+ v4 = pixel(src, x_f, y_f, width, height, stride, def);
v2 = pixel(src, x_c, y_f, width, height, stride, def);
v3 = pixel(src, x_f, y_c, width, height, stride, def);
- v4 = pixel(src, x_f, y_f, width, height, stride, def);
-
+ v1 = pixel(src, x_c, y_c, width, height, stride, def);
return (v1*(x - x_f)*(y - y_f) + v2*((x - x_f)*(y_c - y)) +
v3*(x_c - x)*(y - y_f) + v4*((x_c - x)*(y_c - y)));
}
@@ -68,19 +66,18 @@ unsigned char interpolate_biquadratic(float x, float y, global const unsigned ch
int x_c, x_f, y_c, y_f;
unsigned char v1, v2, v3, v4;
float f1, f2, f3, f4;
+ x_f = (int)x;
+ y_f = (int)y;
+ x_c = x_f + 1;
+ y_c = y_f + 1;
- if (x < - 1 || x > width || y < -1 || y > height)
+ if (x_f < - 1 || x_f > width || y_f < -1 || y_f > height)
return def;
else {
- x_f = (int)x;
- x_c = x_f + 1;
- y_f = (int)y;
- y_c = y_f + 1;
-
- v1 = pixel(src, x_c, y_c, width, height, stride, def);
+ v4 = pixel(src, x_f, y_f, width, height, stride, def);
v2 = pixel(src, x_c, y_f, width, height, stride, def);
v3 = pixel(src, x_f, y_c, width, height, stride, def);
- v4 = pixel(src, x_f, y_f, width, height, stride, def);
+ v1 = pixel(src, x_c, y_c, width, height, stride, def);
f1 = 1 - sqrt((x_c - x) * (y_c - y));
f2 = 1 - sqrt((x_c - x) * (y - y_f));
@@ -107,109 +104,120 @@ inline int mirror(int v, int m)
return v;
}
-kernel void avfilter_transform(global unsigned char *src,
- global unsigned char *dst,
- global float *matrix,
- global float *matrix2,
- int interpolate,
- int fillmethod,
- int src_stride_lu,
- int dst_stride_lu,
- int src_stride_ch,
- int dst_stride_ch,
- int height,
- int width,
- int ch,
- int cw)
+kernel void avfilter_transform_luma(global unsigned char *src,
+ global unsigned char *dst,
+ float4 matrix,
+ int interpolate,
+ int fill,
+ int src_stride_lu,
+ int dst_stride_lu,
+ int height,
+ int width)
{
- int global_id = get_global_id(0);
-
- global unsigned char *dst_y = dst;
- global unsigned char *dst_u = dst_y + height * dst_stride_lu;
- global unsigned char *dst_v = dst_u + ch * dst_stride_ch;
-
- global unsigned char *src_y = src;
- global unsigned char *src_u = src_y + height * src_stride_lu;
- global unsigned char *src_v = src_u + ch * src_stride_ch;
-
- global unsigned char *tempdst;
- global unsigned char *tempsrc;
-
- int x;
- int y;
- float x_s;
- float y_s;
- int tempsrc_stride;
- int tempdst_stride;
- int temp_height;
- int temp_width;
- int curpos;
- unsigned char def = 0;
- if (global_id < width*height) {
- y = global_id/width;
- x = global_id%width;
- x_s = x * matrix[0] + y * matrix[1] + matrix[2];
- y_s = x * matrix[3] + y * matrix[4] + matrix[5];
- tempdst = dst_y;
- tempsrc = src_y;
- tempsrc_stride = src_stride_lu;
- tempdst_stride = dst_stride_lu;
- temp_height = height;
- temp_width = width;
- } else if ((global_id >= width*height)&&(global_id < width*height + ch*cw)) {
- y = (global_id - width*height)/cw;
- x = (global_id - width*height)%cw;
- x_s = x * matrix2[0] + y * matrix2[1] + matrix2[2];
- y_s = x * matrix2[3] + y * matrix2[4] + matrix2[5];
- tempdst = dst_u;
- tempsrc = src_u;
- tempsrc_stride = src_stride_ch;
- tempdst_stride = dst_stride_ch;
- temp_height = ch;
- temp_width = cw;
- } else {
- y = (global_id - width*height - ch*cw)/cw;
- x = (global_id - width*height - ch*cw)%cw;
- x_s = x * matrix2[0] + y * matrix2[1] + matrix2[2];
- y_s = x * matrix2[3] + y * matrix2[4] + matrix2[5];
- tempdst = dst_v;
- tempsrc = src_v;
- tempsrc_stride = src_stride_ch;
- tempdst_stride = dst_stride_ch;
- temp_height = ch;
- temp_width = cw;
- }
- curpos = y * tempdst_stride + x;
- switch (fillmethod) {
- case 0: //FILL_BLANK
- def = 0;
- break;
- case 1: //FILL_ORIGINAL
- def = tempsrc[y*tempsrc_stride+x];
- break;
- case 2: //FILL_CLAMP
- y_s = clipf(y_s, 0, temp_height - 1);
- x_s = clipf(x_s, 0, temp_width - 1);
- def = tempsrc[(int)y_s * tempsrc_stride + (int)x_s];
- break;
- case 3: //FILL_MIRROR
- y_s = mirror(y_s,temp_height - 1);
- x_s = mirror(x_s,temp_width - 1);
- def = tempsrc[(int)y_s * tempsrc_stride + (int)x_s];
- break;
+ int x = get_global_id(0);
+ int y = get_global_id(1);
+ int idx_dst = y * dst_stride_lu + x;
+ unsigned char def = 0;
+ float x_s = x * matrix.x + y * matrix.y + matrix.z;
+ float y_s = x * (-matrix.y) + y * matrix.x + matrix.w;
+
+ if (x < width && y < height) {
+ switch (fill) {
+ case 0: //FILL_BLANK
+ def = 0;
+ break;
+ case 1: //FILL_ORIGINAL
+ def = src[y*src_stride_lu + x];
+ break;
+ case 2: //FILL_CLAMP
+ y_s = clipf(y_s, 0, height - 1);
+ x_s = clipf(x_s, 0, width - 1);
+ def = src[(int)y_s * src_stride_lu + (int)x_s];
+ break;
+ case 3: //FILL_MIRROR
+ y_s = mirror(y_s, height - 1);
+ x_s = mirror(x_s, width - 1);
+ def = src[(int)y_s * src_stride_lu + (int)x_s];
+ break;
+ }
+ switch (interpolate) {
+ case 0: //INTERPOLATE_NEAREST
+ dst[idx_dst] = interpolate_nearest(x_s, y_s, src, width, height, src_stride_lu, def);
+ break;
+ case 1: //INTERPOLATE_BILINEAR
+ dst[idx_dst] = interpolate_bilinear(x_s, y_s, src, width, height, src_stride_lu, def);
+ break;
+ case 2: //INTERPOLATE_BIQUADRATIC
+ dst[idx_dst] = interpolate_biquadratic(x_s, y_s, src, width, height, src_stride_lu, def);
+ break;
+ default:
+ return;
+ }
}
- switch (interpolate) {
- case 0: //INTERPOLATE_NEAREST
- tempdst[curpos] = interpolate_nearest(x_s, y_s, tempsrc, temp_width, temp_height, tempsrc_stride, def);
- break;
- case 1: //INTERPOLATE_BILINEAR
- tempdst[curpos] = interpolate_bilinear(x_s, y_s, tempsrc, temp_width, temp_height, tempsrc_stride, def);
- break;
- case 2: //INTERPOLATE_BIQUADRATIC
- tempdst[curpos] = interpolate_biquadratic(x_s, y_s, tempsrc, temp_width, temp_height, tempsrc_stride, def);
- break;
- default:
- return;
+}
+
+kernel void avfilter_transform_chroma(global unsigned char *src,
+ global unsigned char *dst,
+ float4 matrix,
+ int interpolate,
+ int fill,
+ int src_stride_lu,
+ int dst_stride_lu,
+ int src_stride_ch,
+ int dst_stride_ch,
+ int height,
+ int width,
+ int ch,
+ int cw)
+{
+
+ int x = get_global_id(0);
+ int y = get_global_id(1);
+ int pad_ch = get_global_size(1)>>1;
+ global unsigned char *dst_u = dst + height * dst_stride_lu;
+ global unsigned char *src_u = src + height * src_stride_lu;
+ global unsigned char *dst_v = dst_u + ch * dst_stride_ch;
+ global unsigned char *src_v = src_u + ch * src_stride_ch;
+ src = y < pad_ch ? src_u : src_v;
+ dst = y < pad_ch ? dst_u : dst_v;
+ y = select(y - pad_ch, y, y < pad_ch);
+ float x_s = x * matrix.x + y * matrix.y + matrix.z;
+ float y_s = x * (-matrix.y) + y * matrix.x + matrix.w;
+ int idx_dst = y * dst_stride_ch + x;
+ unsigned char def;
+
+ if (x < cw && y < ch) {
+ switch (fill) {
+ case 0: //FILL_BLANK
+ def = 0;
+ break;
+ case 1: //FILL_ORIGINAL
+ def = src[y*src_stride_ch + x];
+ break;
+ case 2: //FILL_CLAMP
+ y_s = clipf(y_s, 0, ch - 1);
+ x_s = clipf(x_s, 0, cw - 1);
+ def = src[(int)y_s * src_stride_ch + (int)x_s];
+ break;
+ case 3: //FILL_MIRROR
+ y_s = mirror(y_s, ch - 1);
+ x_s = mirror(x_s, cw - 1);
+ def = src[(int)y_s * src_stride_ch + (int)x_s];
+ break;
+ }
+ switch (interpolate) {
+ case 0: //INTERPOLATE_NEAREST
+ dst[idx_dst] = interpolate_nearest(x_s, y_s, src, cw, ch, src_stride_ch, def);
+ break;
+ case 1: //INTERPOLATE_BILINEAR
+ dst[idx_dst] = interpolate_bilinear(x_s, y_s, src, cw, ch, src_stride_ch, def);
+ break;
+ case 2: //INTERPOLATE_BIQUADRATIC
+ dst[idx_dst] = interpolate_biquadratic(x_s, y_s, src, cw, ch, src_stride_ch, def);
+ break;
+ default:
+ return;
+ }
}
}
);
diff --git a/chromium/third_party/ffmpeg/libavfilter/dualinput.c b/chromium/third_party/ffmpeg/libavfilter/dualinput.c
index 97e15cbe019..45f681078d3 100644
--- a/chromium/third_party/ffmpeg/libavfilter/dualinput.c
+++ b/chromium/third_party/ffmpeg/libavfilter/dualinput.c
@@ -57,9 +57,9 @@ int ff_dualinput_init(AVFilterContext *ctx, FFDualInputContext *s)
in[1].after = EXT_INFINITY;
if (s->shortest)
- in[1].after = EXT_STOP;
+ in[0].after = in[1].after = EXT_STOP;
if (!s->repeatlast) {
- in[0].after = EXT_STOP;
+ in[1].after = EXT_NULL;
in[1].sync = 0;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c b/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c
index a2c616098e8..2e510dbea32 100644
--- a/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c
+++ b/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c
@@ -23,7 +23,6 @@
* EBU R.128 implementation
* @see http://tech.ebu.ch/loudness
* @see https://www.youtube.com/watch?v=iuEtQqC-Sqo "EBU R128 Introduction - Florian Camerer"
- * @todo True Peak
* @todo implement start/stop/reset through filter command injection
* @todo support other frequencies to avoid resampling
*/
@@ -37,6 +36,7 @@
#include "libavutil/xga_font_data.h"
#include "libavutil/opt.h"
#include "libavutil/timestamp.h"
+#include "libswresample/swresample.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
@@ -92,6 +92,17 @@ struct rect { int x, y, w, h; };
typedef struct {
const AVClass *class; ///< AVClass context for log and options purpose
+ /* peak metering */
+ int peak_mode; ///< enabled peak modes
+ double *true_peaks; ///< true peaks per channel
+ double *sample_peaks; ///< sample peaks per channel
+ double *true_peaks_per_frame; ///< true peaks in a frame per channel
+#if CONFIG_SWRESAMPLE
+ SwrContext *swr_ctx; ///< over-sampling context for true peak metering
+ double *swr_buf; ///< resampled audio data for true peak metering
+ int swr_linesize;
+#endif
+
/* video */
int do_video; ///< 1 if video output enabled, 0 otherwise
int w, h; ///< size of the video output
@@ -130,6 +141,12 @@ typedef struct {
int metadata; ///< whether or not to inject loudness results in frames
} EBUR128Context;
+enum {
+ PEAK_MODE_NONE = 0,
+ PEAK_MODE_SAMPLES_PEAKS = 1<<1,
+ PEAK_MODE_TRUE_PEAKS = 1<<2,
+};
+
#define OFFSET(x) offsetof(EBUR128Context, x)
#define A AV_OPT_FLAG_AUDIO_PARAM
#define V AV_OPT_FLAG_VIDEO_PARAM
@@ -142,7 +159,11 @@ static const AVOption ebur128_options[] = {
{ "info", "information logging level", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_INFO}, INT_MIN, INT_MAX, A|V|F, "level" },
{ "verbose", "verbose logging level", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_VERBOSE}, INT_MIN, INT_MAX, A|V|F, "level" },
{ "metadata", "inject metadata in the filtergraph", OFFSET(metadata), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, A|V|F },
- { NULL }
+ { "peak", "set peak mode", OFFSET(peak_mode), AV_OPT_TYPE_FLAGS, {.i64 = PEAK_MODE_NONE}, 0, INT_MAX, A|F, "mode" },
+ { "none", "disable any peak mode", 0, AV_OPT_TYPE_CONST, {.i64 = PEAK_MODE_NONE}, INT_MIN, INT_MAX, A|F, "mode" },
+ { "sample", "enable peak-sample mode", 0, AV_OPT_TYPE_CONST, {.i64 = PEAK_MODE_SAMPLES_PEAKS}, INT_MIN, INT_MAX, A|F, "mode" },
+ { "true", "enable true-peak mode", 0, AV_OPT_TYPE_CONST, {.i64 = PEAK_MODE_TRUE_PEAKS}, INT_MIN, INT_MAX, A|F, "mode" },
+ { NULL },
};
AVFILTER_DEFINE_CLASS(ebur128);
@@ -326,9 +347,13 @@ static int config_audio_input(AVFilterLink *inlink)
AVFilterContext *ctx = inlink->dst;
EBUR128Context *ebur128 = ctx->priv;
- /* force 100ms framing in case of metadata injection: the frames must have
- * a granularity of the window overlap to be accurately exploited */
- if (ebur128->metadata)
+ /* Force 100ms framing in case of metadata injection: the frames must have
+ * a granularity of the window overlap to be accurately exploited.
+ * As for the true peaks mode, it just simplifies the resampling buffer
+ * allocation and the lookup in it (since sample buffers differ in size, it
+ * can be more complex to integrate in the one-sample loop of
+ * filter_frame()). */
+ if (ebur128->metadata || (ebur128->peak_mode & PEAK_MODE_TRUE_PEAKS))
inlink->min_samples =
inlink->max_samples =
inlink->partial_buf_size = inlink->sample_rate / 10;
@@ -383,11 +408,44 @@ static int config_audio_output(AVFilterLink *outlink)
outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+#if CONFIG_SWRESAMPLE
+ if (ebur128->peak_mode & PEAK_MODE_TRUE_PEAKS) {
+ int ret;
+
+ ebur128->swr_buf = av_malloc(19200 * nb_channels * sizeof(double));
+ ebur128->true_peaks = av_calloc(nb_channels, sizeof(*ebur128->true_peaks));
+ ebur128->true_peaks_per_frame = av_calloc(nb_channels, sizeof(*ebur128->true_peaks_per_frame));
+ ebur128->swr_ctx = swr_alloc();
+ if (!ebur128->swr_buf || !ebur128->true_peaks ||
+ !ebur128->true_peaks_per_frame || !ebur128->swr_ctx)
+ return AVERROR(ENOMEM);
+
+ av_opt_set_int(ebur128->swr_ctx, "in_channel_layout", outlink->channel_layout, 0);
+ av_opt_set_int(ebur128->swr_ctx, "in_sample_rate", outlink->sample_rate, 0);
+ av_opt_set_sample_fmt(ebur128->swr_ctx, "in_sample_fmt", outlink->format, 0);
+
+ av_opt_set_int(ebur128->swr_ctx, "out_channel_layout", outlink->channel_layout, 0);
+ av_opt_set_int(ebur128->swr_ctx, "out_sample_rate", 192000, 0);
+ av_opt_set_sample_fmt(ebur128->swr_ctx, "out_sample_fmt", outlink->format, 0);
+
+ ret = swr_init(ebur128->swr_ctx);
+ if (ret < 0)
+ return ret;
+ }
+#endif
+
+ if (ebur128->peak_mode & PEAK_MODE_SAMPLES_PEAKS) {
+ ebur128->sample_peaks = av_calloc(nb_channels, sizeof(*ebur128->sample_peaks));
+ if (!ebur128->sample_peaks)
+ return AVERROR(ENOMEM);
+ }
+
return 0;
}
#define ENERGY(loudness) (pow(10, ((loudness) + 0.691) / 10.))
#define LOUDNESS(energy) (-0.691 + 10 * log10(energy))
+#define DBFS(energy) (20 * log10(energy))
static struct hist_entry *get_histogram(void)
{
@@ -416,6 +474,12 @@ static av_cold int init(AVFilterContext *ctx)
ebur128->loglevel = AV_LOG_INFO;
}
+ if (!CONFIG_SWRESAMPLE && (ebur128->peak_mode & PEAK_MODE_TRUE_PEAKS)) {
+ av_log(ctx, AV_LOG_ERROR,
+ "True-peak mode requires libswresample to be performed\n");
+ return AVERROR(EINVAL);
+ }
+
// if meter is +9 scale, scale range is from -18 LU to +9 LU (or 3*9)
// if meter is +18 scale, scale range is from -36 LU to +18 LU (or 3*18)
ebur128->scale_range = 3 * ebur128->meter;
@@ -491,6 +555,26 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
const double *samples = (double *)insamples->data[0];
AVFrame *pic = ebur128->outpicref;
+#if CONFIG_SWRESAMPLE
+ if (ebur128->peak_mode & PEAK_MODE_TRUE_PEAKS) {
+ const double *swr_samples = ebur128->swr_buf;
+ int ret = swr_convert(ebur128->swr_ctx, (uint8_t**)&ebur128->swr_buf, 19200,
+ (const uint8_t **)insamples->data, nb_samples);
+ if (ret < 0)
+ return ret;
+ for (ch = 0; ch < nb_channels; ch++)
+ ebur128->true_peaks_per_frame[ch] = 0.0;
+ for (idx_insample = 0; idx_insample < ret; idx_insample++) {
+ for (ch = 0; ch < nb_channels; ch++) {
+ ebur128->true_peaks[ch] = FFMAX(ebur128->true_peaks[ch], FFABS(*swr_samples));
+ ebur128->true_peaks_per_frame[ch] = FFMAX(ebur128->true_peaks_per_frame[ch],
+ FFABS(*swr_samples));
+ swr_samples++;
+ }
+ }
+ }
+#endif
+
for (idx_insample = 0; idx_insample < nb_samples; idx_insample++) {
const int bin_id_400 = ebur128->i400.cache_pos;
const int bin_id_3000 = ebur128->i3000.cache_pos;
@@ -509,6 +593,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
for (ch = 0; ch < nb_channels; ch++) {
double bin;
+ if (ebur128->peak_mode & PEAK_MODE_SAMPLES_PEAKS)
+ ebur128->sample_peaks[ch] = FFMAX(ebur128->sample_peaks[ch], FFABS(*samples));
+
ebur128->x[ch * 3] = *samples++; // set X[i]
if (!ebur128->ch_weighting[ch])
@@ -677,22 +764,53 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
if (ebur128->metadata) { /* happens only once per filter_frame call */
char metabuf[128];
+#define META_PREFIX "lavfi.r128."
+
#define SET_META(name, var) do { \
snprintf(metabuf, sizeof(metabuf), "%.3f", var); \
- av_dict_set(&insamples->metadata, "lavfi.r128." name, metabuf, 0); \
+ av_dict_set(&insamples->metadata, name, metabuf, 0); \
+} while (0)
+
+#define SET_META_PEAK(name, ptype) do { \
+ if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \
+ char key[64]; \
+ for (ch = 0; ch < nb_channels; ch++) { \
+ snprintf(key, sizeof(key), \
+ META_PREFIX AV_STRINGIFY(name) "_peaks_ch%d", ch); \
+ SET_META(key, ebur128->name##_peaks[ch]); \
+ } \
+ } \
} while (0)
- SET_META("M", loudness_400);
- SET_META("S", loudness_3000);
- SET_META("I", ebur128->integrated_loudness);
- SET_META("LRA", ebur128->loudness_range);
- SET_META("LRA.low", ebur128->lra_low);
- SET_META("LRA.high", ebur128->lra_high);
+
+ SET_META(META_PREFIX "M", loudness_400);
+ SET_META(META_PREFIX "S", loudness_3000);
+ SET_META(META_PREFIX "I", ebur128->integrated_loudness);
+ SET_META(META_PREFIX "LRA", ebur128->loudness_range);
+ SET_META(META_PREFIX "LRA.low", ebur128->lra_low);
+ SET_META(META_PREFIX "LRA.high", ebur128->lra_high);
+
+ SET_META_PEAK(sample, SAMPLES);
+ SET_META_PEAK(true, TRUE);
}
- av_log(ctx, ebur128->loglevel, "t: %-10s " LOG_FMT "\n",
+ av_log(ctx, ebur128->loglevel, "t: %-10s " LOG_FMT,
av_ts2timestr(pts, &outlink->time_base),
loudness_400, loudness_3000,
ebur128->integrated_loudness, ebur128->loudness_range);
+
+#define PRINT_PEAKS(str, sp, ptype) do { \
+ if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \
+ av_log(ctx, ebur128->loglevel, " " str ":"); \
+ for (ch = 0; ch < nb_channels; ch++) \
+ av_log(ctx, ebur128->loglevel, " %5.1f", DBFS(sp[ch])); \
+ av_log(ctx, ebur128->loglevel, " dBFS"); \
+ } \
+} while (0)
+
+ PRINT_PEAKS("SPK", ebur128->sample_peaks, SAMPLES);
+ PRINT_PEAKS("FTPK", ebur128->true_peaks_per_frame, TRUE);
+ PRINT_PEAKS("TPK", ebur128->true_peaks, TRUE);
+ av_log(ctx, ebur128->loglevel, "\n");
}
}
@@ -757,13 +875,33 @@ static av_cold void uninit(AVFilterContext *ctx)
" LRA: %5.1f LU\n"
" Threshold: %5.1f LUFS\n"
" LRA low: %5.1f LUFS\n"
- " LRA high: %5.1f LUFS\n",
+ " LRA high: %5.1f LUFS",
ebur128->integrated_loudness, ebur128->i400.rel_threshold,
ebur128->loudness_range, ebur128->i3000.rel_threshold,
ebur128->lra_low, ebur128->lra_high);
+#define PRINT_PEAK_SUMMARY(str, sp, ptype) do { \
+ int ch; \
+ double maxpeak; \
+ maxpeak = 0.0; \
+ if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \
+ for (ch = 0; ch < ebur128->nb_channels; ch++) \
+ maxpeak = FFMAX(maxpeak, sp[ch]); \
+ av_log(ctx, AV_LOG_INFO, "\n\n " str " peak:\n" \
+ " Peak: %5.1f dBFS", \
+ DBFS(maxpeak)); \
+ } \
+} while (0)
+
+ PRINT_PEAK_SUMMARY("Sample", ebur128->sample_peaks, SAMPLES);
+ PRINT_PEAK_SUMMARY("True", ebur128->true_peaks, TRUE);
+ av_log(ctx, AV_LOG_INFO, "\n");
+
av_freep(&ebur128->y_line_ref);
av_freep(&ebur128->ch_weighting);
+ av_freep(&ebur128->true_peaks);
+ av_freep(&ebur128->sample_peaks);
+ av_freep(&ebur128->true_peaks_per_frame);
av_freep(&ebur128->i400.histogram);
av_freep(&ebur128->i3000.histogram);
for (i = 0; i < ebur128->nb_channels; i++) {
@@ -773,6 +911,10 @@ static av_cold void uninit(AVFilterContext *ctx)
for (i = 0; i < ctx->nb_outputs; i++)
av_freep(&ctx->output_pads[i].name);
av_frame_free(&ebur128->outpicref);
+#if CONFIG_SWRESAMPLE
+ av_freep(&ebur128->swr_buf);
+ swr_free(&ebur128->swr_ctx);
+#endif
}
static const AVFilterPad ebur128_inputs[] = {
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_select.c b/chromium/third_party/ffmpeg/libavfilter/f_select.c
index ec84da8a849..c7c53b43ede 100644
--- a/chromium/third_party/ffmpeg/libavfilter/f_select.c
+++ b/chromium/third_party/ffmpeg/libavfilter/f_select.c
@@ -138,7 +138,7 @@ enum var_name {
VAR_VARS_NB
};
-typedef struct {
+typedef struct SelectContext {
const AVClass *class;
char *expr_str;
AVExpr *expr;
@@ -271,7 +271,7 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame)
for (y = 0; y < frame->height - 8; y += 8) {
for (x = 0; x < frame->width*3 - 8; x += 8) {
- sad += select->c.sad[1](select, p1 + x, p2 + x,
+ sad += select->c.sad[1](NULL, p1 + x, p2 + x,
linesize, 8);
nb_sad += 8 * 8;
}
@@ -279,7 +279,7 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame)
p2 += 8 * linesize;
}
emms_c();
- mafd = nb_sad ? sad / nb_sad : 0;
+ mafd = nb_sad ? (double)sad / nb_sad : 0;
diff = fabs(mafd - select->prev_mafd);
ret = av_clipf(FFMIN(mafd, diff) / 100., 0, 1);
select->prev_mafd = mafd;
diff --git a/chromium/third_party/ffmpeg/libavfilter/fifo.c b/chromium/third_party/ffmpeg/libavfilter/fifo.c
index 5310af24dea..e477cff4cd3 100644
--- a/chromium/third_party/ffmpeg/libavfilter/fifo.c
+++ b/chromium/third_party/ffmpeg/libavfilter/fifo.c
@@ -39,7 +39,7 @@ typedef struct Buf {
struct Buf *next;
} Buf;
-typedef struct {
+typedef struct FifoContext {
Buf root;
Buf *last; ///< last buffered frame
diff --git a/chromium/third_party/ffmpeg/libavfilter/filtfmts.c b/chromium/third_party/ffmpeg/libavfilter/filtfmts.c
index e6c9b039be5..dd757a52746 100644
--- a/chromium/third_party/ffmpeg/libavfilter/filtfmts.c
+++ b/chromium/third_party/ffmpeg/libavfilter/filtfmts.c
@@ -20,7 +20,7 @@
#include <stdio.h>
-#include "libavformat/avformat.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/pixdesc.h"
#include "libavutil/samplefmt.h"
#include "libavfilter/avfilter.h"
@@ -38,7 +38,7 @@ static void print_formats(AVFilterContext *filter_ctx)
for (j = 0; j < fmts->nb_formats; j++) \
if(av_get_pix_fmt_name(fmts->formats[j])) \
printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
- i, filter_ctx->filter->inout##puts[i].name, \
+ i, filter_ctx->inout##put_pads[i].name, \
av_get_pix_fmt_name(fmts->formats[j])); \
} else if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_AUDIO) { \
AVFilterFormats *fmts; \
@@ -47,7 +47,7 @@ static void print_formats(AVFilterContext *filter_ctx)
fmts = filter_ctx->inout##puts[i]->outin##_formats; \
for (j = 0; j < fmts->nb_formats; j++) \
printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
- i, filter_ctx->filter->inout##puts[i].name, \
+ i, filter_ctx->inout##put_pads[i].name, \
av_get_sample_fmt_name(fmts->formats[j])); \
\
layouts = filter_ctx->inout##puts[i]->outin##_channel_layouts; \
@@ -56,7 +56,7 @@ static void print_formats(AVFilterContext *filter_ctx)
av_get_channel_layout_string(buf, sizeof(buf), -1, \
layouts->channel_layouts[j]); \
printf(#INOUT "PUT[%d] %s: chlayout:%s\n", \
- i, filter_ctx->filter->inout##puts[i].name, buf); \
+ i, filter_ctx->inout##put_pads[i].name, buf); \
} \
} \
} \
@@ -113,12 +113,12 @@ int main(int argc, char **argv)
/* create a link for each of the input pads */
for (i = 0; i < filter_ctx->nb_inputs; i++) {
AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
- link->type = filter_ctx->filter->inputs[i].type;
+ link->type = filter_ctx->input_pads[i].type;
filter_ctx->inputs[i] = link;
}
for (i = 0; i < filter_ctx->nb_outputs; i++) {
AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
- link->type = filter_ctx->filter->outputs[i].type;
+ link->type = filter_ctx->output_pads[i].type;
filter_ctx->outputs[i] = link;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/graphdump.c b/chromium/third_party/ffmpeg/libavfilter/graphdump.c
index 1b5932115b5..3d702c6af5f 100644
--- a/chromium/third_party/ffmpeg/libavfilter/graphdump.c
+++ b/chromium/third_party/ffmpeg/libavfilter/graphdump.c
@@ -31,9 +31,10 @@ static int print_link_prop(AVBPrint *buf, AVFilterLink *link)
{
char *format;
char layout[64];
+ AVBPrint dummy_buffer = { 0 };
if (!buf)
- buf = &(AVBPrint){ 0 }; /* dummy buffer */
+ buf = &dummy_buffer;
switch (link->type) {
case AVMEDIA_TYPE_VIDEO:
format = av_x_if_null(av_get_pix_fmt_name(link->format), "?");
diff --git a/chromium/third_party/ffmpeg/libavfilter/internal.h b/chromium/third_party/ffmpeg/libavfilter/internal.h
index 5e19698d073..308b115b89e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/internal.h
+++ b/chromium/third_party/ffmpeg/libavfilter/internal.h
@@ -141,6 +141,14 @@ struct AVFilterPad {
* input pads only.
*/
int needs_fifo;
+
+ /**
+ * The filter expects writable frames from its input link,
+ * duplicating data buffers if needed.
+ *
+ * input pads only.
+ */
+ int needs_writable;
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavfilter/lavfutils.c b/chromium/third_party/ffmpeg/libavfilter/lavfutils.c
index 58d98cfdb68..93f1ef331d0 100644
--- a/chromium/third_party/ffmpeg/libavfilter/lavfutils.c
+++ b/chromium/third_party/ffmpeg/libavfilter/lavfutils.c
@@ -44,6 +44,11 @@ int ff_load_image(uint8_t *data[4], int linesize[4],
return ret;
}
+ if ((ret = avformat_find_stream_info(format_ctx, NULL)) < 0) {
+ av_log(log_ctx, AV_LOG_ERROR, "Find stream info failed\n");
+ return ret;
+ }
+
codec_ctx = format_ctx->streams[0]->codec;
codec = avcodec_find_decoder(codec_ctx->codec_id);
if (!codec) {
diff --git a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/img_format.c b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/img_format.c
index 61bf8988016..dd07f00a0a2 100644
--- a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/img_format.c
+++ b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/img_format.c
@@ -52,6 +52,8 @@ const char *ff_vo_format_name(int format)
case IMGFMT_BGRA: return "BGRA";
case IMGFMT_ARGB: return "ARGB";
case IMGFMT_RGBA: return "RGBA";
+ case IMGFMT_XYZ12LE: return "XYZ 36-bit LE";
+ case IMGFMT_XYZ12BE: return "XYZ 36-bit BE";
case IMGFMT_GBR24P: return "Planar GBR 24-bit";
case IMGFMT_GBR12P: return "Planar GBR 36-bit";
case IMGFMT_GBR14P: return "Planar GBR 42-bit";
@@ -102,6 +104,7 @@ const char *ff_vo_format_name(int format)
case IMGFMT_422P: return "Planar 422P";
case IMGFMT_422A: return "Planar 422P with alpha";
case IMGFMT_411P: return "Planar 411P";
+ case IMGFMT_440P: return "Planar 440P";
case IMGFMT_NV12: return "Planar NV12";
case IMGFMT_NV21: return "Planar NV21";
case IMGFMT_HM12: return "Planar NV12 Macroblock";
@@ -218,6 +221,14 @@ int ff_mp_get_chroma_shift(int format, int *x_shift, int *y_shift, int *componen
xs = 31;
ys = 31;
break;
+ case IMGFMT_NV12:
+ case IMGFMT_NV21:
+ xs = 1;
+ ys = 1;
+ // TODO: allowing this though currently breaks
+ // things all over the place.
+ err = 1;
+ break;
default:
err = 1;
break;
diff --git a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/img_format.h b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/img_format.h
index d4d64d8d35a..b5c0b9007fb 100644
--- a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/img_format.h
+++ b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/img_format.h
@@ -51,6 +51,11 @@
#define IMGFMT_BGR24 (IMGFMT_BGR|24)
#define IMGFMT_BGR32 (IMGFMT_BGR|32)
+#define IMGFMT_XYZ_MASK 0xFFFFFF00
+#define IMGFMT_XYZ (('X'<<24)|('Y'<<16)|('Z'<<8))
+#define IMGFMT_XYZ12LE (IMGFMT_XYZ|12)
+#define IMGFMT_XYZ12BE (IMGFMT_XYZ|12|128)
+
#define IMGFMT_GBR24P (('G'<<24)|('B'<<16)|('R'<<8)|24)
#define IMGFMT_GBR12PLE (('G'<<24)|('B'<<16)|('R'<<8)|36)
#define IMGFMT_GBR12PBE (('G'<<24)|('B'<<16)|('R'<<8)|36|128)
@@ -76,6 +81,7 @@
#define IMGFMT_BGR15LE (IMGFMT_BGR15|128)
#define IMGFMT_BGR16BE IMGFMT_BGR16
#define IMGFMT_BGR16LE (IMGFMT_BGR16|128)
+#define IMGFMT_XYZ12 IMGFMT_XYZ12BE
#define IMGFMT_GBR12P IMGFMT_GBR12PBE
#define IMGFMT_GBR14P IMGFMT_GBR14PBE
#else
@@ -97,6 +103,7 @@
#define IMGFMT_BGR15LE IMGFMT_BGR15
#define IMGFMT_BGR16BE (IMGFMT_BGR16|128)
#define IMGFMT_BGR16LE IMGFMT_BGR16
+#define IMGFMT_XYZ12 IMGFMT_XYZ12LE
#define IMGFMT_GBR12P IMGFMT_GBR12PLE
#define IMGFMT_GBR14P IMGFMT_GBR14PLE
#endif
@@ -107,9 +114,11 @@
#define IMGFMT_IS_RGB(fmt) (((fmt)&IMGFMT_RGB_MASK)==IMGFMT_RGB)
#define IMGFMT_IS_BGR(fmt) (((fmt)&IMGFMT_BGR_MASK)==IMGFMT_BGR)
+#define IMGFMT_IS_XYZ(fmt) (((fmt)&IMGFMT_XYZ_MASK)==IMGFMT_XYZ)
#define IMGFMT_RGB_DEPTH(fmt) ((fmt)&0x7F)
#define IMGFMT_BGR_DEPTH(fmt) ((fmt)&0x7F)
+#define IMGFMT_XYZ_DEPTH(fmt) ((fmt)&0x7F)
/* Planar YUV Formats */
diff --git a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/libvo/video_out.h b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/libvo/video_out.h
index 2a3a0facc65..49d30987ffb 100644
--- a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/libvo/video_out.h
+++ b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/libvo/video_out.h
@@ -30,11 +30,19 @@
#include "../img_format.h"
//#include "vidix/vidix.h"
+
+#define ROTATE(t, x, y) do { \
+ t rot_tmp = x; \
+ x = y; \
+ y = -rot_tmp; \
+} while(0)
+
#define VO_EVENT_EXPOSE 1
#define VO_EVENT_RESIZE 2
#define VO_EVENT_KEYPRESS 4
#define VO_EVENT_REINIT 8
#define VO_EVENT_MOVE 16
+#define VO_EVENT_MOUSE 32
/* Obsolete: VOCTRL_QUERY_VAA 1 */
/* does the device support the required format */
@@ -43,7 +51,6 @@
#define VOCTRL_RESET 3
/* true if vo driver can use GUI created windows */
#define VOCTRL_GUISUPPORT 4
-#define VOCTRL_GUI_NOWINDOW 19
/* used to switch to fullscreen */
#define VOCTRL_FULLSCREEN 5
/* signal a device pause */
@@ -63,7 +70,6 @@
/* equalizer controls */
#define VOCTRL_SET_EQUALIZER 17
#define VOCTRL_GET_EQUALIZER 18
-//#define VOCTRL_GUI_NOWINDOW 19
/* Frame duplication */
#define VOCTRL_DUPLICATE_FRAME 20
// ... 21
@@ -107,6 +113,7 @@ typedef struct {
#define VOFLAG_FLIPPING 0x08
#define VOFLAG_HIDDEN 0x10 //< Use to create a hidden window
#define VOFLAG_STEREO 0x20 //< Use to create a stereo-capable window
+#define VOFLAG_DEPTH 0x40 //< Request a depth buffer
#define VOFLAG_XOVERLAY_SUB_VO 0x10000
typedef struct vo_info_s
@@ -223,6 +230,9 @@ extern int vo_directrendering;
extern int vo_vsync;
extern int vo_fsmode;
extern float vo_panscan;
+extern float vo_border_pos_x;
+extern float vo_border_pos_y;
+extern int vo_rotate;
extern int vo_adapter_num;
extern int vo_refresh_rate;
extern int vo_keepaspect;
@@ -278,4 +288,13 @@ void calc_src_dst_rects(int src_width, int src_height, struct vo_rect *src, stru
struct vo_rect *borders, const struct vo_rect *crop);
void vo_mouse_movement(int posx, int posy);
+static inline int apply_border_pos(int full, int part, float pos) {
+ if (pos >= 0.0 && pos <= 1.0) {
+ return pos*(full - part);
+ }
+ if (pos < 0)
+ return pos * part;
+ return full - part + (pos - 1) * part;
+}
+
#endif /* MPLAYER_VIDEO_OUT_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/mp_image.c b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/mp_image.c
index 100ace92cac..0e4d6d75919 100644
--- a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/mp_image.c
+++ b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/mp_image.c
@@ -128,6 +128,10 @@ void ff_mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){
mpi->flags|=MP_IMGFLAG_SWAPPED;
return;
}
+ if (IMGFMT_IS_XYZ(out_fmt)) {
+ mpi->bpp=3*((IMGFMT_XYZ_DEPTH(out_fmt) + 7) & ~7);
+ return;
+ }
mpi->num_planes=3;
if (out_fmt == IMGFMT_GBR24P) {
mpi->bpp=24;
@@ -243,7 +247,7 @@ mp_image_t* ff_new_mp_image(int w,int h){
void ff_free_mp_image(mp_image_t* mpi){
if(!mpi) return;
if(mpi->flags&MP_IMGFLAG_ALLOCATED){
- /* becouse we allocate the whole image in once */
+ /* because we allocate the whole image at once */
av_free(mpi->planes[0]);
if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
av_free(mpi->planes[1]);
diff --git a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_eq.c b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_eq.c
index c926c518043..f8efa846c90 100644
--- a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_eq.c
+++ b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_eq.c
@@ -37,7 +37,7 @@ struct vf_priv_s {
int contrast;
};
-#if HAVE_MMX
+#if HAVE_MMX && HAVE_6REGS
static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, int sstride,
int w, int h, int brightness, int contrast)
{
@@ -224,7 +224,7 @@ static int vf_open(vf_instance_t *vf, char *args)
if (args) sscanf(args, "%d:%d", &vf->priv->brightness, &vf->priv->contrast);
process = process_C;
-#if HAVE_MMX
+#if HAVE_MMX && HAVE_6REGS
if(ff_gCpuCaps.hasMMX) process = process_MMX;
#endif
diff --git a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_eq2.c b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_eq2.c
index 7a3ef312aa8..c9c3ff69f46 100644
--- a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_eq2.c
+++ b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_eq2.c
@@ -120,7 +120,7 @@ void create_lut (eq2_param_t *par)
par->lut_clean = 1;
}
-#if HAVE_MMX
+#if HAVE_MMX && HAVE_6REGS
static
void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
unsigned w, unsigned h, unsigned dstride, unsigned sstride)
@@ -289,7 +289,7 @@ void check_values (eq2_param_t *par)
if ((par->c == 1.0) && (par->b == 0.0) && (par->g == 1.0)) {
par->adjust = NULL;
}
-#if HAVE_MMX
+#if HAVE_MMX && HAVE_6REGS
else if (par->g == 1.0 && ff_gCpuCaps.hasMMX) {
par->adjust = &affine_1d_MMX;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_fspp.c b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_fspp.c
index a8a33e2644b..6a0f976b671 100644
--- a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_fspp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_fspp.c
@@ -75,7 +75,7 @@ static const short custom_threshold[64]=
20, 27, 26, 23, 20, 15, 11, 5
};
-static const uint8_t __attribute__((aligned(32))) dither[8][8]={
+DECLARE_ALIGNED(32, static const uint8_t, dither)[8][8] = {
{ 0, 48, 12, 60, 3, 51, 15, 63, },
{ 32, 16, 44, 28, 35, 19, 47, 31, },
{ 8, 56, 4, 52, 11, 59, 7, 55, },
@@ -215,11 +215,11 @@ static void store_slice_mmx(uint8_t *dst, int16_t *src, long dst_stride, long sr
"psraw %%mm5, %%mm3 \n\t"
"psraw %%mm5, %%mm4 \n\t"
"1: \n\t"
- "movq %%mm7, (%%"REG_S",%%"REG_a",) \n\t"
+ "movq %%mm7, (%%"REG_S",%%"REG_a") \n\t"
"movq (%%"REG_S"), %%mm0 \n\t"
"movq 8(%%"REG_S"), %%mm1 \n\t"
- "movq %%mm7, 8(%%"REG_S",%%"REG_a",) \n\t"
+ "movq %%mm7, 8(%%"REG_S",%%"REG_a") \n\t"
"paddw %%mm3, %%mm0 \n\t"
"paddw %%mm4, %%mm1 \n\t"
@@ -286,15 +286,15 @@ static void store_slice2_mmx(uint8_t *dst, int16_t *src, long dst_stride, long s
"movq 8(%%"REG_S"), %%mm1 \n\t"
"paddw %%mm3, %%mm0 \n\t"
- "paddw (%%"REG_S",%%"REG_a",), %%mm0 \n\t"
+ "paddw (%%"REG_S",%%"REG_a"), %%mm0 \n\t"
"paddw %%mm4, %%mm1 \n\t"
- "movq 8(%%"REG_S",%%"REG_a",), %%mm6 \n\t"
+ "movq 8(%%"REG_S",%%"REG_a"), %%mm6 \n\t"
- "movq %%mm7, (%%"REG_S",%%"REG_a",) \n\t"
+ "movq %%mm7, (%%"REG_S",%%"REG_a") \n\t"
"psraw %%mm2, %%mm0 \n\t"
"paddw %%mm6, %%mm1 \n\t"
- "movq %%mm7, 8(%%"REG_S",%%"REG_a",) \n\t"
+ "movq %%mm7, 8(%%"REG_S",%%"REG_a") \n\t"
"psraw %%mm2, %%mm1 \n\t"
"packuswb %%mm1, %%mm0 \n\t"
@@ -416,7 +416,7 @@ static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src,
const int stride= is_luma ? p->temp_stride : (width+16);//((width+16+15)&(~15))
const int step=6-p->log2_count;
const int qps= 3 + is_luma;
- int32_t __attribute__((aligned(32))) block_align[4*8*BLOCKSZ+ 4*8*BLOCKSZ];
+ DECLARE_ALIGNED(32, int32_t, block_align)[4*8*BLOCKSZ+ 4*8*BLOCKSZ];
int16_t *block= (int16_t *)block_align;
int16_t *block3=(int16_t *)(block_align+4*8*BLOCKSZ);
@@ -873,7 +873,7 @@ static void column_fidct_c(int16_t* thr_adr, int16_t *data, int16_t *output, int
static void column_fidct_mmx(int16_t* thr_adr, int16_t *data, int16_t *output, int cnt)
{
- uint64_t __attribute__((aligned(8))) temps[4];
+ DECLARE_ALIGNED(8, uint64_t, temps)[4];
__asm__ volatile(
ASMALIGN(4)
"1: \n\t"
@@ -1598,6 +1598,10 @@ static void column_fidct_mmx(int16_t* thr_adr, int16_t *data, int16_t *output,
: "+S"(data), "+D"(output), "+c"(cnt), "=o"(temps)
: "d"(thr_adr)
+ NAMED_CONSTRAINTS_ADD(ff_MM_FIX_0_707106781,MM_2,MM_FIX_1_414213562_A,MM_FIX_1_414213562,MM_FIX_0_382683433,
+ ff_MM_FIX_0_541196100,MM_FIX_1_306562965,MM_FIX_0_847759065)
+ NAMED_CONSTRAINTS_ADD(MM_FIX_0_566454497,MM_FIX_0_198912367,MM_FIX_2_613125930,MM_FIX_1_847759065,
+ MM_FIX_1_082392200)
: "%"REG_a
);
}
@@ -1674,7 +1678,7 @@ static void row_idct_c(int16_t* workspace,
static void row_idct_mmx (int16_t* workspace,
int16_t* output_adr, int output_stride, int cnt)
{
- uint64_t __attribute__((aligned(8))) temps[4];
+ DECLARE_ALIGNED(8, uint64_t, temps)[4];
__asm__ volatile(
"lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t"
"1: \n\t"
@@ -1816,7 +1820,7 @@ static void row_idct_mmx (int16_t* workspace,
"paddw (%%"REG_D"), %%mm5 \n\t"
"psraw $3, %%mm7 \n\t"
- "paddw (%%"REG_D",%%"REG_a",), %%mm1 \n\t"
+ "paddw (%%"REG_D",%%"REG_a"), %%mm1 \n\t"
"paddw %%mm2, %%mm0 \n\t"
"paddw (%%"REG_D",%%"REG_a",2), %%mm7 \n\t"
@@ -1825,7 +1829,7 @@ static void row_idct_mmx (int16_t* workspace,
"movq %%mm5, (%%"REG_D") \n\t"
"paddw %%mm2, %%mm6 \n\t"
- "movq %%mm1, (%%"REG_D",%%"REG_a",) \n\t"
+ "movq %%mm1, (%%"REG_D",%%"REG_a") \n\t"
"psraw $3, %%mm0 \n\t"
"movq %%mm7, (%%"REG_D",%%"REG_a",2) \n\t"
@@ -1837,7 +1841,7 @@ static void row_idct_mmx (int16_t* workspace,
"paddw (%%"REG_D",%%"REG_a",2), %%mm0 \n\t"
"psubw %%mm4, %%mm5 \n\t" //d3
- "paddw (%%"REG_D",%%"REG_d",), %%mm3 \n\t"
+ "paddw (%%"REG_D",%%"REG_d"), %%mm3 \n\t"
"psraw $3, %%mm6 \n\t"
"paddw 1*8+%3, %%mm4 \n\t" //d4
@@ -1852,13 +1856,13 @@ static void row_idct_mmx (int16_t* workspace,
"paddw (%%"REG_D"), %%mm5 \n\t"
"psraw $3, %%mm4 \n\t"
- "paddw (%%"REG_D",%%"REG_a",), %%mm4 \n\t"
+ "paddw (%%"REG_D",%%"REG_a"), %%mm4 \n\t"
"add $"DCTSIZE_S"*2*4, %%"REG_S" \n\t" //4 rows
- "movq %%mm3, (%%"REG_D",%%"REG_d",) \n\t"
+ "movq %%mm3, (%%"REG_D",%%"REG_d") \n\t"
"movq %%mm6, (%%"REG_D",%%"REG_a",4) \n\t"
"movq %%mm5, (%%"REG_D") \n\t"
- "movq %%mm4, (%%"REG_D",%%"REG_a",) \n\t"
+ "movq %%mm4, (%%"REG_D",%%"REG_a") \n\t"
"sub %%"REG_d", %%"REG_D" \n\t"
"add $8, %%"REG_D" \n\t"
@@ -1867,6 +1871,8 @@ static void row_idct_mmx (int16_t* workspace,
: "+S"(workspace), "+D"(output_adr), "+c"(cnt), "=o"(temps)
: "a"(output_stride*sizeof(short))
+ NAMED_CONSTRAINTS_ADD(MM_FIX_1_414213562_A,MM_FIX_2_613125930,MM_FIX_1_847759065,MM_FIX_1_082392200,
+ MM_FIX_1_414213562,MM_DESCALE_RND)
: "%"REG_d
);
}
@@ -1940,14 +1946,14 @@ static void row_fdct_c(int16_t *data, const uint8_t *pixels, int line_size, int
static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size, int cnt)
{
- uint64_t __attribute__((aligned(8))) temps[4];
+ DECLARE_ALIGNED(8, uint64_t, temps)[4];
__asm__ volatile(
"lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t"
"6: \n\t"
"movd (%%"REG_S"), %%mm0 \n\t"
"pxor %%mm7, %%mm7 \n\t"
- "movd (%%"REG_S",%%"REG_a",), %%mm1 \n\t"
+ "movd (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
"punpcklbw %%mm7, %%mm0 \n\t"
"movd (%%"REG_S",%%"REG_a",2), %%mm2 \n\t"
@@ -1962,7 +1968,7 @@ static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size,
"movd (%%"REG_S",%%"REG_a",4), %%mm3 \n\t" //7 ;prefetch!
"movq %%mm1, %%mm6 \n\t"
- "movd (%%"REG_S",%%"REG_d",), %%mm4 \n\t" //6
+ "movd (%%"REG_S",%%"REG_d"), %%mm4 \n\t" //6
"punpcklbw %%mm7, %%mm3 \n\t"
"psubw %%mm3, %%mm5 \n\t"
@@ -1974,16 +1980,16 @@ static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size,
"movd (%%"REG_S",%%"REG_a",2), %%mm3 \n\t" //5
"paddw %%mm4, %%mm1 \n\t"
- "movq %%mm5, 0*8+%3 \n\t" //t7
+ "movq %%mm5, %3 \n\t" //t7
"punpcklbw %%mm7, %%mm3 \n\t"
- "movq %%mm6, 1*8+%3 \n\t" //t6
+ "movq %%mm6, %4 \n\t" //t6
"movq %%mm2, %%mm4 \n\t"
"movd (%%"REG_S"), %%mm5 \n\t" //3
"paddw %%mm3, %%mm2 \n\t"
- "movd (%%"REG_S",%%"REG_a",), %%mm6 \n\t" //4
+ "movd (%%"REG_S",%%"REG_a"), %%mm6 \n\t" //4
"punpcklbw %%mm7, %%mm5 \n\t"
"psubw %%mm3, %%mm4 \n\t"
@@ -2023,7 +2029,7 @@ static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size,
"psubw %%mm1, %%mm5 \n\t" //d1
"movq %%mm0, %%mm6 \n\t"
- "movq 1*8+%3, %%mm1 \n\t"
+ "movq %4, %%mm1 \n\t"
"punpcklwd %%mm5, %%mm0 \n\t"
"punpckhwd %%mm5, %%mm6 \n\t"
@@ -2047,7 +2053,7 @@ static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size,
"movq %%mm7, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
"psllw $2, %%mm3 \n\t" //t10
- "movq 0*8+%3, %%mm2 \n\t"
+ "movq %3, %%mm2 \n\t"
"psllw $2, %%mm4 \n\t" //t11
"pmulhw "MANGLE(ff_MM_FIX_0_707106781)", %%mm4 \n\t" //z3
@@ -2110,8 +2116,9 @@ static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size,
"dec %%"REG_c" \n\t"
"jnz 6b \n\t"
- : "+S"(pixels), "+D"(data), "+c"(cnt), "=o"(temps)
+ : "+S"(pixels), "+D"(data), "+c"(cnt), "=o"(temps), "=o"(temps[1])
: "a"(line_size)
+ NAMED_CONSTRAINTS_ADD(ff_MM_FIX_0_707106781,ff_MM_FIX_0_541196100,MM_FIX_0_382683433,MM_FIX_1_306562965)
: "%"REG_d);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_ilpack.c b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_ilpack.c
index 4db6c0a8b70..fbf58170624 100644
--- a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_ilpack.c
+++ b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_ilpack.c
@@ -125,7 +125,7 @@ static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
"pxor %%mm0, %%mm0 \n\t"
ASMALIGN(4)
- ".Lli0: \n\t"
+ "2: \n\t"
"movq (%%"REG_S"), %%mm1 \n\t"
"movq (%%"REG_S"), %%mm2 \n\t"
@@ -204,7 +204,7 @@ static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
"add $32, %%"REG_D" \n\t"
"decl %%ecx \n\t"
- "jnz .Lli0 \n\t"
+ "jnz 2b \n\t"
"emms \n\t"
"pop %%"REG_BP" \n\t"
:
@@ -233,7 +233,7 @@ static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
"pxor %%mm0, %%mm0 \n\t"
ASMALIGN(4)
- ".Lli1: \n\t"
+ "3: \n\t"
"movq (%%"REG_S"), %%mm1 \n\t"
"movq (%%"REG_S"), %%mm2 \n\t"
@@ -316,7 +316,7 @@ static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
"add $32, %%"REG_D" \n\t"
"decl %%ecx \n\t"
- "jnz .Lli1 \n\t"
+ "jnz 3b \n\t"
"emms \n\t"
"pop %%"REG_BP" \n\t"
:
diff --git a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_pp7.c b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_pp7.c
index 30f95307bb1..89ed4fe679c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_pp7.c
+++ b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_pp7.c
@@ -45,7 +45,7 @@
#define XMAX(a,b) ((a) > (b) ? (a) : (b))
//===========================================================================//
-static const uint8_t __attribute__((aligned(8))) dither[8][8]={
+DECLARE_ALIGNED(8, static const uint8_t, dither)[8][8] = {
{ 0, 48, 12, 60, 3, 51, 15, 63, },
{ 32, 16, 44, 28, 35, 19, 47, 31, },
{ 8, 56, 4, 52, 11, 59, 7, 55, },
diff --git a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_uspp.c b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_uspp.c
index 1fb252386ce..c9d9c1fd169 100644
--- a/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_uspp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/libmpcodecs/vf_uspp.c
@@ -44,7 +44,7 @@
#define BLOCK 16
//===========================================================================//
-static const uint8_t __attribute__((aligned(8))) dither[8][8]={
+DECLARE_ALIGNED(8, static const uint8_t, dither)[8][8] = {
{ 0*4, 48*4, 12*4, 60*4, 3*4, 51*4, 15*4, 63*4, },
{ 32*4, 16*4, 44*4, 28*4, 35*4, 19*4, 47*4, 31*4, },
{ 8*4, 56*4, 4*4, 52*4, 11*4, 59*4, 7*4, 55*4, },
@@ -241,7 +241,8 @@ static int config(struct vf_instance *vf,
avctx_enc->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
avctx_enc->global_quality= 123;
av_dict_set(&opts, "no_bitstream", "1", 0);
- avcodec_open2(avctx_enc, enc, &opts);
+ if (avcodec_open2(avctx_enc, enc, &opts) < 0)
+ return 0;
av_dict_free(&opts);
assert(avctx_enc->codec);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/pthread.c b/chromium/third_party/ffmpeg/libavfilter/pthread.c
index 92c4d08b4d3..070b3bded50 100644
--- a/chromium/third_party/ffmpeg/libavfilter/pthread.c
+++ b/chromium/third_party/ffmpeg/libavfilter/pthread.c
@@ -170,7 +170,7 @@ static int thread_init_internal(ThreadContext *c, int nb_threads)
return 1;
c->nb_threads = nb_threads;
- c->workers = av_mallocz(sizeof(*c->workers) * nb_threads);
+ c->workers = av_mallocz_array(sizeof(*c->workers), nb_threads);
if (!c->workers)
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavfilter/setpts.c b/chromium/third_party/ffmpeg/libavfilter/setpts.c
index cb6b2b9aabc..0db021814d4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/setpts.c
+++ b/chromium/third_party/ffmpeg/libavfilter/setpts.c
@@ -82,7 +82,7 @@ enum var_name {
VAR_VARS_NB
};
-typedef struct {
+typedef struct SetPTSContext {
const AVClass *class;
char *expr_str;
AVExpr *expr;
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_settb.c b/chromium/third_party/ffmpeg/libavfilter/settb.c
index d511c14ce30..83616c13610 100644
--- a/chromium/third_party/ffmpeg/libavfilter/f_settb.c
+++ b/chromium/third_party/ffmpeg/libavfilter/settb.c
@@ -32,9 +32,9 @@
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/rational.h"
+#include "audio.h"
#include "avfilter.h"
#include "internal.h"
-#include "audio.h"
#include "video.h"
static const char *const var_names[] = {
@@ -51,7 +51,7 @@ enum var_name {
VAR_VARS_NB
};
-typedef struct {
+typedef struct SetTBContext {
const AVClass *class;
char *tb_expr;
double var_values[VAR_VARS_NB];
@@ -151,7 +151,7 @@ AVFilter ff_vf_settb = {
.inputs = avfilter_vf_settb_inputs,
.outputs = avfilter_vf_settb_outputs,
};
-#endif
+#endif /* CONFIG_SETTB_FILTER */
#if CONFIG_ASETTB_FILTER
@@ -184,4 +184,4 @@ AVFilter ff_af_asettb = {
.outputs = avfilter_af_asettb_outputs,
.priv_class = &asettb_class,
};
-#endif
+#endif /* CONFIG_ASETTB_FILTER */
diff --git a/chromium/third_party/ffmpeg/libavfilter/src_movie.c b/chromium/third_party/ffmpeg/libavfilter/src_movie.c
index d1289e2fe85..bcc8e054958 100644
--- a/chromium/third_party/ffmpeg/libavfilter/src_movie.c
+++ b/chromium/third_party/ffmpeg/libavfilter/src_movie.c
@@ -44,12 +44,12 @@
#include "internal.h"
#include "video.h"
-typedef struct {
+typedef struct MovieStream {
AVStream *st;
int done;
} MovieStream;
-typedef struct {
+typedef struct MovieContext {
/* common A/V fields */
const AVClass *class;
int64_t seek_point; ///< seekpoint in microseconds
@@ -386,10 +386,10 @@ static int movie_config_output_props(AVFilterLink *outlink)
}
static char *describe_frame_to_str(char *dst, size_t dst_size,
- AVFrame *frame,
- AVFilterLink *link)
+ AVFrame *frame, enum AVMediaType frame_type,
+ AVFilterLink *link)
{
- switch (frame->type) {
+ switch (frame_type) {
case AVMEDIA_TYPE_VIDEO:
snprintf(dst, dst_size,
"video pts:%s time:%s size:%dx%d aspect:%d/%d",
@@ -405,15 +405,12 @@ static char *describe_frame_to_str(char *dst, size_t dst_size,
frame->nb_samples);
break;
default:
- snprintf(dst, dst_size, "%s BUG", av_get_media_type_string(frame->type));
+ snprintf(dst, dst_size, "%s BUG", av_get_media_type_string(frame_type));
break;
}
return dst;
}
-#define describe_frameref(f, link) \
- describe_frame_to_str((char[1024]){0}, 1024, f, link)
-
static int rewind_file(AVFilterContext *ctx)
{
MovieContext *movie = ctx->priv;
@@ -452,6 +449,7 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
{
MovieContext *movie = ctx->priv;
AVPacket *pkt = &movie->pkt;
+ enum AVMediaType frame_type;
MovieStream *st;
int ret, got_frame = 0, pkt_out_id;
AVFilterLink *outlink;
@@ -501,7 +499,8 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
if (!movie->frame)
return AVERROR(ENOMEM);
- switch (st->st->codec->codec_type) {
+ frame_type = st->st->codec->codec_type;
+ switch (frame_type) {
case AVMEDIA_TYPE_VIDEO:
ret = avcodec_decode_video2(st->st->codec, movie->frame, &got_frame, pkt);
break;
@@ -537,10 +536,20 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
return 0;
}
- av_dlog(ctx, "movie_push_frame(): file:'%s' %s\n", movie->file_name,
- describe_frameref(movie->frame, outlink));
-
movie->frame->pts = av_frame_get_best_effort_timestamp(movie->frame);
+ av_dlog(ctx, "movie_push_frame(): file:'%s' %s\n", movie->file_name,
+ describe_frame_to_str((char[1024]){0}, 1024, movie->frame, frame_type, outlink));
+
+ if (st->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (movie->frame->format != outlink->format) {
+ av_log(ctx, AV_LOG_ERROR, "Format changed %s -> %s, discarding frame\n",
+ av_get_pix_fmt_name(outlink->format),
+ av_get_pix_fmt_name(movie->frame->format)
+ );
+ av_frame_free(&movie->frame);
+ return 0;
+ }
+ }
ret = ff_filter_frame(outlink, movie->frame);
movie->frame = NULL;
diff --git a/chromium/third_party/ffmpeg/libavfilter/unsharp.h b/chromium/third_party/ffmpeg/libavfilter/unsharp.h
index 867892085d3..c2aed64a013 100644
--- a/chromium/third_party/ffmpeg/libavfilter/unsharp.h
+++ b/chromium/third_party/ffmpeg/libavfilter/unsharp.h
@@ -64,7 +64,7 @@ typedef struct UnsharpFilterParam {
uint32_t *sc[MAX_MATRIX_SIZE - 1]; ///< finite state machine storage
} UnsharpFilterParam;
-typedef struct {
+typedef struct UnsharpContext {
const AVClass *class;
int lmsize_x, lmsize_y, cmsize_x, cmsize_y;
float lamount, camount;
diff --git a/chromium/third_party/ffmpeg/libavfilter/version.h b/chromium/third_party/ffmpeg/libavfilter/version.h
index 9cc7e3cde1f..7a6321e53e6 100644
--- a/chromium/third_party/ffmpeg/libavfilter/version.h
+++ b/chromium/third_party/ffmpeg/libavfilter/version.h
@@ -27,10 +27,10 @@
* Libavfilter version macros
*/
-#include "libavutil/avutil.h"
+#include "libavutil/version.h"
-#define LIBAVFILTER_VERSION_MAJOR 3
-#define LIBAVFILTER_VERSION_MINOR 92
+#define LIBAVFILTER_VERSION_MAJOR 4
+#define LIBAVFILTER_VERSION_MINOR 5
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -50,43 +50,46 @@
*/
#ifndef FF_API_AVFILTERPAD_PUBLIC
-#define FF_API_AVFILTERPAD_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_AVFILTERPAD_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_FOO_COUNT
-#define FF_API_FOO_COUNT (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_FOO_COUNT (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_FILL_FRAME
-#define FF_API_FILL_FRAME (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_FILL_FRAME (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_BUFFERSRC_BUFFER
-#define FF_API_BUFFERSRC_BUFFER (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_BUFFERSRC_BUFFER (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_AVFILTERBUFFER
-#define FF_API_AVFILTERBUFFER (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_AVFILTERBUFFER (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_OLD_FILTER_OPTS
-#define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_ACONVERT_FILTER
-#define FF_API_ACONVERT_FILTER (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_ACONVERT_FILTER (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_AVFILTER_OPEN
-#define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_AVFILTER_INIT_FILTER
-#define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_OLD_FILTER_REGISTER
-#define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_OLD_GRAPH_PARSE
-#define FF_API_OLD_GRAPH_PARSE (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_OLD_GRAPH_PARSE (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_DRAWTEXT_OLD_TIMELINE
-#define FF_API_DRAWTEXT_OLD_TIMELINE (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_DRAWTEXT_OLD_TIMELINE (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#ifndef FF_API_NOCONST_GET_NAME
-#define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 4)
+#define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 5)
+#endif
+#ifndef FF_API_INTERLACE_LOWPASS_SET
+#define FF_API_INTERLACE_LOWPASS_SET (LIBAVFILTER_VERSION_MAJOR < 5)
#endif
#endif /* AVFILTER_VERSION_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_aspect.c b/chromium/third_party/ffmpeg/libavfilter/vf_aspect.c
index 97fb2169236..84dbee95d5f 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_aspect.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_aspect.c
@@ -56,7 +56,7 @@ enum var_name {
VARS_NB
};
-typedef struct {
+typedef struct AspectContext {
const AVClass *class;
AVRational dar;
AVRational sar;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_blackframe.c b/chromium/third_party/ffmpeg/libavfilter/vf_blackframe.c
index 9b0c973520a..0eeda618f9e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_blackframe.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_blackframe.c
@@ -37,7 +37,7 @@
#include "internal.h"
#include "video.h"
-typedef struct {
+typedef struct BlackFrameContext {
const AVClass *class;
int bamount; ///< black amount
int bthresh; ///< black threshold
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_boxblur.c b/chromium/third_party/ffmpeg/libavfilter/vf_boxblur.c
index 3183f435fcf..1fa5135d980 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_boxblur.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_boxblur.c
@@ -55,13 +55,13 @@ enum var_name {
VARS_NB
};
-typedef struct {
+typedef struct FilterParam {
int radius;
int power;
char *radius_expr;
} FilterParam;
-typedef struct {
+typedef struct BoxBlurContext {
const AVClass *class;
FilterParam luma_param;
FilterParam chroma_param;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_colormatrix.c b/chromium/third_party/ffmpeg/libavfilter/vf_colormatrix.c
index e1b48fa1c33..5ab175b65dc 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_colormatrix.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_colormatrix.c
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
@@ -164,8 +164,8 @@ static av_cold int init(AVFilterContext *ctx)
{
ColorMatrixContext *color = ctx->priv;
- if (color->source == COLOR_MODE_NONE || color->dest == COLOR_MODE_NONE) {
- av_log(ctx, AV_LOG_ERROR, "Unspecified source or destination color space\n");
+ if (color->dest == COLOR_MODE_NONE) {
+ av_log(ctx, AV_LOG_ERROR, "Unspecified destination color space\n");
return AVERROR(EINVAL);
}
@@ -174,10 +174,6 @@ static av_cold int init(AVFilterContext *ctx)
return AVERROR(EINVAL);
}
- color->mode = color->source * 4 + color->dest;
-
- calc_coefficients(ctx);
-
return 0;
}
@@ -346,6 +342,33 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
}
av_frame_copy_props(out, in);
+ if (color->source == COLOR_MODE_NONE) {
+ enum AVColorSpace cs = av_frame_get_colorspace(in);
+ enum ColorMode source;
+
+ switch(cs) {
+ case AVCOL_SPC_BT709 : source = COLOR_MODE_BT709 ; break;
+ case AVCOL_SPC_FCC : source = COLOR_MODE_FCC ; break;
+ case AVCOL_SPC_SMPTE240M : source = COLOR_MODE_SMPTE240M ; break;
+ case AVCOL_SPC_BT470BG : source = COLOR_MODE_BT601 ; break;
+ default :
+ av_log(ctx, AV_LOG_ERROR, "Input frame does not specify a supported colorspace, and none has been specified as source either\n");
+ av_frame_free(&out);
+ return AVERROR(EINVAL);
+ }
+ color->mode = source * 4 + color->dest;
+ } else
+ color->mode = color->source * 4 + color->dest;
+
+ switch(color->dest) {
+ case COLOR_MODE_BT709 : av_frame_set_colorspace(out, AVCOL_SPC_BT709) ; break;
+ case COLOR_MODE_FCC : av_frame_set_colorspace(out, AVCOL_SPC_FCC) ; break;
+ case COLOR_MODE_SMPTE240M: av_frame_set_colorspace(out, AVCOL_SPC_SMPTE240M); break;
+ case COLOR_MODE_BT601 : av_frame_set_colorspace(out, AVCOL_SPC_BT470BG) ; break;
+ }
+
+ calc_coefficients(ctx);
+
if (in->format == AV_PIX_FMT_YUV422P)
process_frame_yuv422p(color, out, in);
else if (in->format == AV_PIX_FMT_YUV420P)
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_copy.c b/chromium/third_party/ffmpeg/libavfilter/vf_copy.c
index fcc85c5ae7a..fb9a906048f 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_copy.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_copy.c
@@ -37,9 +37,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return AVERROR(ENOMEM);
}
av_frame_copy_props(out, in);
- av_image_copy(out->data, out->linesize, (const uint8_t**) in->data, in->linesize,
- in->format, in->width, in->height);
-
+ av_frame_copy(out, in);
av_frame_free(&in);
return ff_filter_frame(outlink, out);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_crop.c b/chromium/third_party/ffmpeg/libavfilter/vf_crop.c
index 261db337718..30ee077436e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_crop.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_crop.c
@@ -73,7 +73,7 @@ enum var_name {
VAR_VARS_NB
};
-typedef struct {
+typedef struct CropContext {
const AVClass *class;
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
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_cropdetect.c b/chromium/third_party/ffmpeg/libavfilter/vf_cropdetect.c
index 4a6b658e028..ed8e7a8c115 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_cropdetect.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_cropdetect.c
@@ -32,7 +32,7 @@
#include "internal.h"
#include "video.h"
-typedef struct {
+typedef struct CropDetectContext {
const AVClass *class;
int x1, y1, x2, y2;
int limit;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_curves.c b/chromium/third_party/ffmpeg/libavfilter/vf_curves.c
index 51234305fe5..b17c391fffc 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_curves.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_curves.c
@@ -69,6 +69,10 @@ typedef struct {
int step;
} CurvesContext;
+typedef struct ThreadData {
+ AVFrame *in, *out;
+} ThreadData;
+
#define OFFSET(x) offsetof(CurvesContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static const AVOption curves_options[] = {
@@ -327,8 +331,10 @@ static int parse_psfile(AVFilterContext *ctx, const char *fname)
return ret;
#define READ16(dst) do { \
- if (size < 2) \
- return AVERROR_INVALIDDATA; \
+ if (size < 2) { \
+ ret = AVERROR_INVALIDDATA; \
+ goto end; \
+ } \
dst = AV_RB16(buf); \
buf += 2; \
size -= 2; \
@@ -473,23 +479,46 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
{
- int x, y, direct = 0;
- AVFilterContext *ctx = inlink->dst;
- CurvesContext *curves = ctx->priv;
- AVFilterLink *outlink = ctx->outputs[0];
- AVFrame *out;
- uint8_t *dst;
- const uint8_t *src;
+ int x, y;
+ const CurvesContext *curves = ctx->priv;
+ const ThreadData *td = arg;
+ const AVFrame *in = td->in;
+ const AVFrame *out = td->out;
+ const int direct = out == in;
const int step = curves->step;
const uint8_t r = curves->rgba_map[R];
const uint8_t g = curves->rgba_map[G];
const uint8_t b = curves->rgba_map[B];
const uint8_t a = curves->rgba_map[A];
+ const int slice_start = (in->height * jobnr ) / nb_jobs;
+ const int slice_end = (in->height * (jobnr+1)) / nb_jobs;
+ uint8_t *dst = out->data[0] + slice_start * out->linesize[0];
+ const uint8_t *src = in->data[0] + slice_start * in->linesize[0];
+
+ for (y = slice_start; y < slice_end; y++) {
+ for (x = 0; x < in->width * step; x += step) {
+ dst[x + r] = curves->graph[R][src[x + r]];
+ dst[x + g] = curves->graph[G][src[x + g]];
+ dst[x + b] = curves->graph[B][src[x + b]];
+ if (!direct && step == 4)
+ dst[x + a] = src[x + a];
+ }
+ dst += out->linesize[0];
+ src += in ->linesize[0];
+ }
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ AVFrame *out;
+ ThreadData td;
if (av_frame_is_writable(in)) {
- direct = 1;
out = in;
} else {
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
@@ -500,22 +529,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props(out, in);
}
- dst = out->data[0];
- src = in ->data[0];
-
- for (y = 0; y < inlink->h; y++) {
- for (x = 0; x < inlink->w * step; x += step) {
- dst[x + r] = curves->graph[R][src[x + r]];
- dst[x + g] = curves->graph[G][src[x + g]];
- dst[x + b] = curves->graph[B][src[x + b]];
- if (!direct && step == 4)
- dst[x + a] = src[x + a];
- }
- dst += out->linesize[0];
- src += in ->linesize[0];
- }
+ td.in = in;
+ td.out = out;
+ ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ctx->graph->nb_threads));
- if (!direct)
+ if (out != in)
av_frame_free(&in);
return ff_filter_frame(outlink, out);
@@ -548,5 +566,5 @@ AVFilter ff_vf_curves = {
.inputs = curves_inputs,
.outputs = curves_outputs,
.priv_class = &curves_class,
- .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_dejudder.c b/chromium/third_party/ffmpeg/libavfilter/vf_dejudder.c
new file mode 100644
index 00000000000..1d96c394e5d
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_dejudder.c
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2014 Nicholas Robbins
+ *
+ * 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
+ * remove judder in video stream
+ *
+ * Algorithm:
+ * - If the old packets had PTS of old_pts[i]. Replace these with new
+ * value based on the running average of the last n=cycle frames. So
+ *
+ * new_pts[i] = Sum(k=i-n+1, i, old_pts[k])/n
+ * + (old_pts[i]-old_pts[i-n])*(n-1)/2n
+ *
+ * For any repeating pattern of length n of judder this will produce
+ * an even progression of PTS's.
+ *
+ * - In order to avoid calculating this sum ever frame, a running tally
+ * is maintained in ctx->new_pts. Each frame the new term at the start
+ * of the sum is added, the one and the end is removed, and the offset
+ * terms (second line in formula above) are recalculated.
+ *
+ * - To aid in this a ringbuffer of the last n-2 PTS's is maintained in
+ * ctx->ringbuff. With the indices of the first two and last two entries
+ * stored in i1, i2, i3, & i4.
+ *
+ * - To ensure that the new PTS's are integers, time_base is divided
+ * by 2n. This removes the division in the new_pts calculation.
+ *
+ * - frame_rate is also multiplied by 2n to allow the frames to fall
+ * where they may in what may now be a VFR output. This produces more
+ * even output then setting frame_rate=1/0 in practice.
+ */
+
+#include "libavutil/opt.h"
+#include "libavutil/mathematics.h"
+#include "avfilter.h"
+#include "internal.h"
+#include "video.h"
+
+typedef struct {
+ const AVClass *class;
+ int64_t *ringbuff;
+ int i1, i2, i3, i4;
+ int64_t new_pts;
+ int start_count;
+
+ /* options */
+ int cycle;
+} DejudderContext;
+
+#define OFFSET(x) offsetof(DejudderContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption dejudder_options[] = {
+ {"cycle", "set the length of the cycle to use for dejuddering",
+ OFFSET(cycle), AV_OPT_TYPE_INT, {.i64 = 4}, 2, 240, .flags = FLAGS},
+ {NULL}
+};
+
+AVFILTER_DEFINE_CLASS(dejudder);
+
+static int config_out_props(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ DejudderContext *dj = ctx->priv;
+ AVFilterLink *inlink = outlink->src->inputs[0];
+
+ outlink->time_base = av_mul_q(inlink->time_base, av_make_q(1, 2 * dj->cycle));
+ outlink->frame_rate = av_mul_q(inlink->frame_rate, av_make_q(2 * dj->cycle, 1));
+
+ av_log(ctx, AV_LOG_VERBOSE, "cycle:%d\n", dj->cycle);
+
+ return 0;
+}
+
+static av_cold int dejudder_init(AVFilterContext *ctx)
+{
+ DejudderContext *dj = ctx->priv;
+
+ dj->ringbuff = av_mallocz(sizeof(*dj->ringbuff) * (dj->cycle+2));
+ if (!dj->ringbuff)
+ return AVERROR(ENOMEM);
+
+ dj->new_pts = 0;
+ dj->i1 = 0;
+ dj->i2 = 1;
+ dj->i3 = 2;
+ dj->i4 = 3;
+ dj->start_count = dj->cycle + 2;
+
+ return 0;
+}
+
+static av_cold void dejudder_uninit(AVFilterContext *ctx)
+{
+ DejudderContext *dj = ctx->priv;
+
+ av_freep(&(dj->ringbuff));
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
+{
+ int k;
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ DejudderContext *dj = ctx->priv;
+ int64_t *judbuff = dj->ringbuff;
+ int64_t next_pts = frame->pts;
+ int64_t offset;
+
+ if (next_pts == AV_NOPTS_VALUE)
+ return ff_filter_frame(outlink, frame);
+
+ if (dj->start_count) {
+ dj->start_count--;
+ dj->new_pts = next_pts * 2 * dj->cycle;
+ } else {
+ if (next_pts < judbuff[dj->i2]) {
+ offset = next_pts + judbuff[dj->i3] - judbuff[dj->i4] - judbuff[dj->i1];
+ for (k = 0; k < dj->cycle + 2; k++)
+ judbuff[k] += offset;
+ }
+ dj->new_pts += (dj->cycle - 1) * (judbuff[dj->i3] - judbuff[dj->i1])
+ + (dj->cycle + 1) * (next_pts - judbuff[dj->i4]);
+ }
+
+ judbuff[dj->i2] = next_pts;
+ dj->i1 = dj->i2;
+ dj->i2 = dj->i3;
+ dj->i3 = dj->i4;
+ dj->i4 = (dj->i4 + 1) % (dj->cycle + 2);
+
+ frame->pts = dj->new_pts;
+
+ for (k = 0; k < dj->cycle + 2; k++)
+ av_log(ctx, AV_LOG_DEBUG, "%"PRId64"\t", judbuff[k]);
+ av_log(ctx, AV_LOG_DEBUG, "next=%"PRId64", new=%"PRId64"\n", next_pts, frame->pts);
+
+ return ff_filter_frame(outlink, frame);
+}
+
+static const AVFilterPad dejudder_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad dejudder_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_out_props,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_dejudder = {
+ .name = "dejudder",
+ .description = NULL_IF_CONFIG_SMALL("Remove judder produced by pullup."),
+ .priv_size = sizeof(DejudderContext),
+ .priv_class = &dejudder_class,
+ .inputs = dejudder_inputs,
+ .outputs = dejudder_outputs,
+ .init = dejudder_init,
+ .uninit = dejudder_uninit,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_delogo.c b/chromium/third_party/ffmpeg/libavfilter/vf_delogo.c
index fbc89838751..6ccdfb21d0a 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_delogo.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_delogo.c
@@ -148,7 +148,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
}
}
-typedef struct {
+typedef struct DelogoContext {
const AVClass *class;
int x, y, w, h, band, show;
} DelogoContext;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_deshake.c b/chromium/third_party/ffmpeg/libavfilter/vf_deshake.c
index 1d62c440a63..6cfb1716297 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_deshake.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_deshake.c
@@ -132,7 +132,7 @@ static void find_block_motion(DeshakeContext *deshake, uint8_t *src1,
int smallest = INT_MAX;
int tmp, tmp2;
- #define CMP(i, j) deshake->c.sad[0](deshake, src1 + cy * stride + cx, \
+ #define CMP(i, j) deshake->c.sad[0](NULL, src1 + cy * stride + cx, \
src2 + (j) * stride + (i), stride, \
deshake->blocksize)
@@ -306,8 +306,8 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
//av_log(NULL, AV_LOG_ERROR, "\n");
}
- p_x = (center_x - width / 2);
- p_y = (center_y - height / 2);
+ p_x = (center_x - width / 2.0);
+ p_y = (center_y - height / 2.0);
t->vector.x += (cos(t->angle)-1)*p_x - sin(t->angle)*p_y;
t->vector.y += sin(t->angle)*p_x + (cos(t->angle)-1)*p_y;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_drawbox.c b/chromium/third_party/ffmpeg/libavfilter/vf_drawbox.c
index dd884a7449f..115df884e13 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_drawbox.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_drawbox.c
@@ -66,7 +66,7 @@ enum var_name {
VARS_NB
};
-typedef struct {
+typedef struct DrawBoxContext {
const AVClass *class;
int x, y, w, h;
int thickness;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c b/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c
index 91b82182343..995a3e2ca30 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c
@@ -26,10 +26,20 @@
* filter by Gustavo Sverzut Barbieri
*/
+#include "config.h"
+
+#if HAVE_SYS_TIME_H
#include <sys/time.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
#include <time.h>
+#include <unistd.h>
+
+#if CONFIG_LIBFONTCONFIG
+#include <fontconfig/fontconfig.h>
+#endif
-#include "config.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/common.h"
@@ -50,9 +60,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
-#if CONFIG_FONTCONFIG
-#include <fontconfig/fontconfig.h>
-#endif
+#include FT_STROKER_H
static const char *const var_names[] = {
"dar",
@@ -118,10 +126,13 @@ enum expansion_mode {
EXP_STRFTIME,
};
-typedef struct {
+typedef struct DrawTextContext {
const AVClass *class;
enum expansion_mode exp_mode; ///< expansion mode to use for the text
int reinit; ///< tells if the filter is being reinited
+#if CONFIG_LIBFONTCONFIG
+ uint8_t *font; ///< font to be used
+#endif
uint8_t *fontfile; ///< font to be used
uint8_t *text; ///< text to be drawn
AVBPrint expanded_text; ///< used to contain the expanded text
@@ -134,6 +145,7 @@ typedef struct {
int max_glyph_w; ///< max glyph width
int max_glyph_h; ///< max glyph height
int shadowx, shadowy;
+ int borderw; ///< border width
unsigned int fontsize; ///< font size to use
short int draw_box; ///< draw box around text - true or false
@@ -144,10 +156,12 @@ typedef struct {
FFDrawContext dc;
FFDrawColor fontcolor; ///< foreground color
FFDrawColor shadowcolor; ///< shadow color
+ FFDrawColor bordercolor; ///< border color
FFDrawColor boxcolor; ///< background color
FT_Library library; ///< freetype font library handle
FT_Face face; ///< freetype font face handle
+ FT_Stroker stroker; ///< freetype stroker handle
struct AVTreeNode *glyphs; ///< rendered glyphs, stored using the UTF-32 char code
char *x_expr; ///< expression for x position
char *y_expr; ///< expression for y position
@@ -178,6 +192,7 @@ static const AVOption drawtext_options[]= {
{"textfile", "set text file", OFFSET(textfile), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS},
{"fontcolor", "set foreground color", OFFSET(fontcolor.rgba), AV_OPT_TYPE_COLOR, {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS},
{"boxcolor", "set box color", OFFSET(boxcolor.rgba), AV_OPT_TYPE_COLOR, {.str="white"}, CHAR_MIN, CHAR_MAX, FLAGS},
+ {"bordercolor", "set border color", OFFSET(bordercolor.rgba), AV_OPT_TYPE_COLOR, {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS},
{"shadowcolor", "set shadow color", OFFSET(shadowcolor.rgba), AV_OPT_TYPE_COLOR, {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS},
{"box", "set box", OFFSET(draw_box), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 , FLAGS},
{"fontsize", "set font size", OFFSET(fontsize), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX , FLAGS},
@@ -185,11 +200,15 @@ static const AVOption drawtext_options[]= {
{"y", "set y expression", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX, FLAGS},
{"shadowx", "set x", OFFSET(shadowx), AV_OPT_TYPE_INT, {.i64=0}, INT_MIN, INT_MAX , FLAGS},
{"shadowy", "set y", OFFSET(shadowy), AV_OPT_TYPE_INT, {.i64=0}, INT_MIN, INT_MAX , FLAGS},
+ {"borderw", "set border width", OFFSET(borderw), AV_OPT_TYPE_INT, {.i64=0}, INT_MIN, INT_MAX , FLAGS},
{"tabsize", "set tab size", OFFSET(tabsize), AV_OPT_TYPE_INT, {.i64=4}, 0, INT_MAX , FLAGS},
{"basetime", "set base time", OFFSET(basetime), AV_OPT_TYPE_INT64, {.i64=AV_NOPTS_VALUE}, INT64_MIN, INT64_MAX , FLAGS},
#if FF_API_DRAWTEXT_OLD_TIMELINE
{"draw", "if false do not draw (deprecated)", OFFSET(draw_expr), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS},
#endif
+#if CONFIG_LIBFONTCONFIG
+ { "font", "Font name", OFFSET(font), AV_OPT_TYPE_STRING, { .str = "Sans" }, .flags = FLAGS },
+#endif
{"expansion", "set the expansion mode", OFFSET(exp_mode), AV_OPT_TYPE_INT, {.i64=EXP_NORMAL}, 0, 2, FLAGS, "expansion"},
{"none", "set no expansion", OFFSET(exp_mode), AV_OPT_TYPE_CONST, {.i64=EXP_NONE}, 0, 0, FLAGS, "expansion"},
@@ -206,7 +225,7 @@ static const AVOption drawtext_options[]= {
{"start_number", "start frame number for n/frame_num variable", OFFSET(start_number), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS},
/* FT_LOAD_* flags */
- { "ft_load_flags", "set font loading flags for libfreetype", OFFSET(ft_load_flags), AV_OPT_TYPE_FLAGS, { .i64 = FT_LOAD_DEFAULT | FT_LOAD_RENDER}, 0, INT_MAX, FLAGS, "ft_load_flags" },
+ { "ft_load_flags", "set font loading flags for libfreetype", OFFSET(ft_load_flags), AV_OPT_TYPE_FLAGS, { .i64 = FT_LOAD_DEFAULT }, 0, INT_MAX, FLAGS, "ft_load_flags" },
{ "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_DEFAULT }, .flags = FLAGS, .unit = "ft_load_flags" },
{ "no_scale", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_NO_SCALE }, .flags = FLAGS, .unit = "ft_load_flags" },
{ "no_hinting", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_NO_HINTING }, .flags = FLAGS, .unit = "ft_load_flags" },
@@ -241,10 +260,11 @@ struct ft_error
#define FT_ERRMSG(e) ft_errors[e].err_msg
-typedef struct {
+typedef struct Glyph {
FT_Glyph *glyph;
uint32_t code;
FT_Bitmap bitmap; ///< array holding bitmaps of font
+ FT_Bitmap border_bitmap; ///< array holding bitmaps of font border
FT_BBox bbox;
int advance;
int bitmap_left;
@@ -264,6 +284,7 @@ static int glyph_cmp(void *key, const void *b)
static int load_glyph(AVFilterContext *ctx, Glyph **glyph_ptr, uint32_t code)
{
DrawTextContext *s = ctx->priv;
+ FT_BitmapGlyph bitmapglyph;
Glyph *glyph;
struct AVTreeNode *node = NULL;
int ret;
@@ -284,10 +305,25 @@ static int load_glyph(AVFilterContext *ctx, Glyph **glyph_ptr, uint32_t code)
ret = AVERROR(EINVAL);
goto error;
}
+ if (s->borderw) {
+ FT_Glyph border_glyph = *glyph->glyph;
+ if (FT_Glyph_StrokeBorder(&border_glyph, s->stroker, 0, 0) ||
+ FT_Glyph_To_Bitmap(&border_glyph, FT_RENDER_MODE_NORMAL, 0, 1)) {
+ ret = AVERROR_EXTERNAL;
+ goto error;
+ }
+ bitmapglyph = (FT_BitmapGlyph) border_glyph;
+ glyph->border_bitmap = bitmapglyph->bitmap;
+ }
+ if (FT_Glyph_To_Bitmap(glyph->glyph, FT_RENDER_MODE_NORMAL, 0, 1)) {
+ ret = AVERROR_EXTERNAL;
+ goto error;
+ }
+ bitmapglyph = (FT_BitmapGlyph) *glyph->glyph;
- glyph->bitmap = s->face->glyph->bitmap;
- glyph->bitmap_left = s->face->glyph->bitmap_left;
- glyph->bitmap_top = s->face->glyph->bitmap_top;
+ glyph->bitmap = bitmapglyph->bitmap;
+ glyph->bitmap_left = bitmapglyph->left;
+ glyph->bitmap_top = bitmapglyph->top;
glyph->advance = s->face->glyph->advance.x >> 6;
/* measure text height to calculate text_height (or the maximum text height) */
@@ -312,68 +348,90 @@ error:
return ret;
}
-static int load_font_file(AVFilterContext *ctx, const char *path, int index,
- const char **error)
+static int load_font_file(AVFilterContext *ctx, const char *path, int index)
{
DrawTextContext *s = ctx->priv;
int err;
err = FT_New_Face(s->library, path, index, &s->face);
if (err) {
- *error = FT_ERRMSG(err);
+ av_log(ctx, AV_LOG_ERROR, "Could not load font \"%s\": %s\n",
+ s->fontfile, FT_ERRMSG(err));
return AVERROR(EINVAL);
}
return 0;
}
-#if CONFIG_FONTCONFIG
-static int load_font_fontconfig(AVFilterContext *ctx, const char **error)
+#if CONFIG_LIBFONTCONFIG
+static int load_font_fontconfig(AVFilterContext *ctx)
{
DrawTextContext *s = ctx->priv;
FcConfig *fontconfig;
- FcPattern *pattern, *fpat;
+ FcPattern *pat, *best;
FcResult result = FcResultMatch;
FcChar8 *filename;
- int err, index;
+ int index;
double size;
+ int err = AVERROR(ENOENT);
fontconfig = FcInitLoadConfigAndFonts();
if (!fontconfig) {
- *error = "impossible to init fontconfig\n";
- return AVERROR(EINVAL);
+ av_log(ctx, AV_LOG_ERROR, "impossible to init fontconfig\n");
+ return AVERROR_UNKNOWN;
}
- pattern = FcNameParse(s->fontfile ? s->fontfile :
+ pat = FcNameParse(s->fontfile ? s->fontfile :
(uint8_t *)(intptr_t)"default");
- if (!pattern) {
- *error = "could not parse fontconfig pattern";
+ if (!pat) {
+ av_log(ctx, AV_LOG_ERROR, "could not parse fontconfig pat");
return AVERROR(EINVAL);
}
- if (!FcConfigSubstitute(fontconfig, pattern, FcMatchPattern)) {
- *error = "could not substitue fontconfig options"; /* very unlikely */
- return AVERROR(EINVAL);
+
+ FcPatternAddString(pat, FC_FAMILY, s->font);
+ if (s->fontsize)
+ FcPatternAddDouble(pat, FC_SIZE, (double)s->fontsize);
+
+ FcDefaultSubstitute(pat);
+
+ if (!FcConfigSubstitute(fontconfig, pat, FcMatchPattern)) {
+ av_log(ctx, AV_LOG_ERROR, "could not substitue fontconfig options"); /* very unlikely */
+ FcPatternDestroy(pat);
+ return AVERROR(ENOMEM);
}
- FcDefaultSubstitute(pattern);
- fpat = FcFontMatch(fontconfig, pattern, &result);
- if (!fpat || result != FcResultMatch) {
- *error = "impossible to find a matching font";
- return AVERROR(EINVAL);
+
+ best = FcFontMatch(fontconfig, pat, &result);
+ FcPatternDestroy(pat);
+
+ if (!best || result != FcResultMatch) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Cannot find a valid font for the family %s\n",
+ s->font);
+ goto fail;
}
- if (FcPatternGetString (fpat, FC_FILE, 0, &filename) != FcResultMatch ||
- FcPatternGetInteger(fpat, FC_INDEX, 0, &index ) != FcResultMatch ||
- FcPatternGetDouble (fpat, FC_SIZE, 0, &size ) != FcResultMatch) {
- *error = "impossible to find font information";
+
+ if (
+ FcPatternGetInteger(best, FC_INDEX, 0, &index ) != FcResultMatch ||
+ FcPatternGetDouble (best, FC_SIZE, 0, &size ) != FcResultMatch) {
+ av_log(ctx, AV_LOG_ERROR, "impossible to find font information");
return AVERROR(EINVAL);
}
+
+ if (FcPatternGetString(best, FC_FILE, 0, &filename) != FcResultMatch) {
+ av_log(ctx, AV_LOG_ERROR, "No file path for %s\n",
+ s->font);
+ goto fail;
+ }
+
av_log(ctx, AV_LOG_INFO, "Using \"%s\"\n", filename);
if (!s->fontsize)
s->fontsize = size + 0.5;
- err = load_font_file(ctx, filename, index, error);
+
+ err = load_font_file(ctx, filename, index);
if (err)
return err;
- FcPatternDestroy(fpat);
- FcPatternDestroy(pattern);
FcConfigDestroy(fontconfig);
- return 0;
+fail:
+ FcPatternDestroy(best);
+ return err;
}
#endif
@@ -381,19 +439,16 @@ static int load_font(AVFilterContext *ctx)
{
DrawTextContext *s = ctx->priv;
int err;
- const char *error = "unknown error\n";
/* load the face, and set up the encoding, which is by default UTF-8 */
- err = load_font_file(ctx, s->fontfile, 0, &error);
+ err = load_font_file(ctx, s->fontfile, 0);
if (!err)
return 0;
-#if CONFIG_FONTCONFIG
- err = load_font_fontconfig(ctx, &error);
+#if CONFIG_LIBFONTCONFIG
+ err = load_font_fontconfig(ctx);
if (!err)
return 0;
#endif
- av_log(ctx, AV_LOG_ERROR, "Could not load font \"%s\": %s\n",
- s->fontfile, error);
return err;
}
@@ -402,6 +457,7 @@ static int load_textfile(AVFilterContext *ctx)
DrawTextContext *s = ctx->priv;
int err;
uint8_t *textbuf;
+ uint8_t *tmp;
size_t textbuf_size;
if ((err = av_file_map(s->textfile, &textbuf, &textbuf_size, 0, ctx)) < 0) {
@@ -411,8 +467,11 @@ static int load_textfile(AVFilterContext *ctx)
return err;
}
- if (!(s->text = av_realloc(s->text, textbuf_size + 1)))
+ if (!(tmp = av_realloc(s->text, textbuf_size + 1))) {
+ av_file_unmap(textbuf, textbuf_size);
return AVERROR(ENOMEM);
+ }
+ s->text = tmp;
memcpy(s->text, textbuf, textbuf_size);
s->text[textbuf_size] = 0;
av_file_unmap(textbuf, textbuf_size);
@@ -432,7 +491,7 @@ static av_cold int init(AVFilterContext *ctx)
"you are encouraged to use the generic timeline support through the 'enable' option\n");
#endif
- if (!s->fontfile && !CONFIG_FONTCONFIG) {
+ if (!s->fontfile && !CONFIG_LIBFONTCONFIG) {
av_log(ctx, AV_LOG_ERROR, "No font filename provided\n");
return AVERROR(EINVAL);
}
@@ -484,6 +543,15 @@ static av_cold int init(AVFilterContext *ctx)
return AVERROR(EINVAL);
}
+ if (s->borderw) {
+ if (FT_Stroker_New(s->library, &s->stroker)) {
+ av_log(ctx, AV_LOG_ERROR, "Coult not init FT stroker\n");
+ return AVERROR_EXTERNAL;
+ }
+ FT_Stroker_Set(s->stroker, s->borderw << 6, FT_STROKER_LINECAP_ROUND,
+ FT_STROKER_LINEJOIN_ROUND, 0);
+ }
+
s->use_kerning = FT_HAS_KERNING(s->face);
/* load the fallback glyph with code 0 */
@@ -540,6 +608,7 @@ static av_cold void uninit(AVFilterContext *ctx)
s->glyphs = NULL;
FT_Done_Face(s->face);
+ FT_Stroker_Done(s->stroker);
FT_Done_FreeType(s->library);
av_bprint_finalize(&s->expanded_text, NULL);
@@ -559,6 +628,7 @@ static int config_input(AVFilterLink *inlink)
ff_draw_init(&s->dc, inlink->format, 0);
ff_draw_color(&s->dc, &s->fontcolor, s->fontcolor.rgba);
ff_draw_color(&s->dc, &s->shadowcolor, s->shadowcolor.rgba);
+ ff_draw_color(&s->dc, &s->bordercolor, s->bordercolor.rgba);
ff_draw_color(&s->dc, &s->boxcolor, s->boxcolor.rgba);
s->var_values[VAR_w] = s->var_values[VAR_W] = s->var_values[VAR_MAIN_W] = inlink->w;
@@ -606,6 +676,8 @@ static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char
int ret;
uninit(ctx);
s->reinit = 1;
+ if ((ret = av_set_options_string(ctx, arg, "=", ":")) < 0)
+ return ret;
if ((ret = init(ctx)) < 0)
return ret;
return config_input(ctx->inputs[0]);
@@ -627,8 +699,41 @@ static int func_pts(AVFilterContext *ctx, AVBPrint *bp,
char *fct, unsigned argc, char **argv, int tag)
{
DrawTextContext *s = ctx->priv;
+ const char *fmt;
+ double pts = s->var_values[VAR_T];
+ int ret;
- av_bprintf(bp, "%.6f", s->var_values[VAR_T]);
+ fmt = argc >= 1 ? argv[0] : "flt";
+ if (argc >= 2) {
+ int64_t delta;
+ if ((ret = av_parse_time(&delta, argv[1], 1)) < 0) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid delta '%s'\n", argv[1]);
+ return ret;
+ }
+ pts += (double)delta / AV_TIME_BASE;
+ }
+ if (!strcmp(fmt, "flt")) {
+ av_bprintf(bp, "%.6f", s->var_values[VAR_T]);
+ } else if (!strcmp(fmt, "hms")) {
+ if (isnan(pts)) {
+ av_bprintf(bp, " ??:??:??.???");
+ } else {
+ int64_t ms = round(pts * 1000);
+ char sign = ' ';
+ if (ms < 0) {
+ sign = '-';
+ ms = -ms;
+ }
+ av_bprintf(bp, "%c%02d:%02d:%02d.%03d", sign,
+ (int)(ms / (60 * 60 * 1000)),
+ (int)(ms / (60 * 1000)) % 60,
+ (int)(ms / 1000) % 60,
+ (int)ms % 1000);
+ }
+ } else {
+ av_log(ctx, AV_LOG_ERROR, "Invalid format '%s'\n", fmt);
+ return AVERROR(EINVAL);
+ }
return 0;
}
@@ -704,7 +809,7 @@ static const struct drawtext_function {
{ "expr", 1, 1, 0, func_eval_expr },
{ "e", 1, 1, 0, func_eval_expr },
{ "pict_type", 0, 0, 0, func_pict_type },
- { "pts", 0, 0, 0, func_pts },
+ { "pts", 0, 2, 0, func_pts },
{ "gmtime", 0, 1, 'G', func_strftime },
{ "localtime", 0, 1, 'L', func_strftime },
{ "frame_num", 0, 0, 0, func_frame_num },
@@ -806,7 +911,8 @@ static int expand_text(AVFilterContext *ctx)
}
static int draw_glyphs(DrawTextContext *s, AVFrame *frame,
- int width, int height, const uint8_t rgbcolor[4], FFDrawColor *color, int x, int y)
+ int width, int height, const uint8_t rgbcolor[4],
+ FFDrawColor *color, int x, int y, int borderw)
{
char *text = s->expanded_text.str;
uint32_t code = 0;
@@ -815,6 +921,7 @@ static int draw_glyphs(DrawTextContext *s, AVFrame *frame,
Glyph *glyph = NULL;
for (i = 0, p = text; *p; i++) {
+ FT_Bitmap bitmap;
Glyph dummy = { 0 };
GET_UTF8(code, *p++, continue;);
@@ -825,18 +932,20 @@ static int draw_glyphs(DrawTextContext *s, AVFrame *frame,
dummy.code = code;
glyph = av_tree_find(s->glyphs, &dummy, (void *)glyph_cmp, NULL);
+ bitmap = borderw ? glyph->border_bitmap : glyph->bitmap;
+
if (glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO &&
glyph->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)
return AVERROR(EINVAL);
- x1 = s->positions[i].x+s->x+x;
- y1 = s->positions[i].y+s->y+y;
+ x1 = s->positions[i].x+s->x+x - borderw;
+ y1 = s->positions[i].y+s->y+y - borderw;
ff_blend_mask(&s->dc, color,
frame->data, frame->linesize, width, height,
- glyph->bitmap.buffer, glyph->bitmap.pitch,
- glyph->bitmap.width, glyph->bitmap.rows,
- glyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO ? 0 : 3,
+ bitmap.buffer, bitmap.pitch,
+ bitmap.width, bitmap.rows,
+ bitmap.pixel_mode == FT_PIXEL_MODE_MONO ? 0 : 3,
0, x1, y1);
}
@@ -997,12 +1106,17 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
if (s->shadowx || s->shadowy) {
if ((ret = draw_glyphs(s, frame, width, height, s->shadowcolor.rgba,
- &s->shadowcolor, s->shadowx, s->shadowy)) < 0)
+ &s->shadowcolor, s->shadowx, s->shadowy, 0)) < 0)
return ret;
}
+ if (s->borderw) {
+ if ((ret = draw_glyphs(s, frame, width, height, s->bordercolor.rgba,
+ &s->bordercolor, 0, 0, s->borderw)) < 0)
+ return ret;
+ }
if ((ret = draw_glyphs(s, frame, width, height, s->fontcolor.rgba,
- &s->fontcolor, 0, 0)) < 0)
+ &s->fontcolor, 0, 0, 0)) < 0)
return ret;
return 0;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_edgedetect.c b/chromium/third_party/ffmpeg/libavfilter/vf_edgedetect.c
index c8ec734734a..c7e3da1aab7 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_edgedetect.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_edgedetect.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Clément Bœsch
+ * Copyright (c) 2012-2014 Clément Bœsch <u pkh me>
*
* This file is part of FFmpeg.
*
@@ -25,19 +25,32 @@
* @see https://en.wikipedia.org/wiki/Canny_edge_detector
*/
+#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
-typedef struct {
- const AVClass *class;
+enum FilterMode {
+ MODE_WIRES,
+ MODE_COLORMIX,
+ NB_MODE
+};
+
+struct plane_info {
uint8_t *tmpbuf;
uint16_t *gradients;
char *directions;
+};
+
+typedef struct {
+ const AVClass *class;
+ struct plane_info planes[3];
+ int nb_planes;
double low, high;
uint8_t low_u8, high_u8;
+ enum FilterMode mode;
} EdgeDetectContext;
#define OFFSET(x) offsetof(EdgeDetectContext, x)
@@ -45,6 +58,9 @@ typedef struct {
static const AVOption edgedetect_options[] = {
{ "high", "set high threshold", OFFSET(high), AV_OPT_TYPE_DOUBLE, {.dbl=50/255.}, 0, 1, FLAGS },
{ "low", "set low threshold", OFFSET(low), AV_OPT_TYPE_DOUBLE, {.dbl=20/255.}, 0, 1, FLAGS },
+ { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_WIRES}, 0, NB_MODE-1, FLAGS, "mode" },
+ { "wires", "white/gray wires on black", 0, AV_OPT_TYPE_CONST, {.i64=MODE_WIRES}, INT_MIN, INT_MAX, FLAGS, "mode" },
+ { "colormix", "mix colors", 0, AV_OPT_TYPE_CONST, {.i64=MODE_COLORMIX}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ NULL }
};
@@ -61,21 +77,36 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- static const enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE};
- ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ const EdgeDetectContext *edgedetect = ctx->priv;
+
+ if (edgedetect->mode == MODE_WIRES) {
+ static const enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE};
+ ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ } else if (edgedetect->mode == MODE_COLORMIX) {
+ static const enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_GBRP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE};
+ ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ } else {
+ av_assert0(0);
+ }
return 0;
}
static int config_props(AVFilterLink *inlink)
{
+ int p;
AVFilterContext *ctx = inlink->dst;
EdgeDetectContext *edgedetect = ctx->priv;
- edgedetect->tmpbuf = av_malloc(inlink->w * inlink->h);
- edgedetect->gradients = av_calloc(inlink->w * inlink->h, sizeof(*edgedetect->gradients));
- edgedetect->directions = av_malloc(inlink->w * inlink->h);
- if (!edgedetect->tmpbuf || !edgedetect->gradients || !edgedetect->directions)
- return AVERROR(ENOMEM);
+ edgedetect->nb_planes = inlink->format == AV_PIX_FMT_GRAY8 ? 1 : 3;
+ for (p = 0; p < edgedetect->nb_planes; p++) {
+ struct plane_info *plane = &edgedetect->planes[p];
+
+ plane->tmpbuf = av_malloc(inlink->w * inlink->h);
+ plane->gradients = av_calloc(inlink->w * inlink->h, sizeof(*plane->gradients));
+ plane->directions = av_malloc(inlink->w * inlink->h);
+ if (!plane->tmpbuf || !plane->gradients || !plane->directions)
+ return AVERROR(ENOMEM);
+ }
return 0;
}
@@ -154,15 +185,16 @@ static int get_rounded_direction(int gx, int gy)
return DIRECTION_VERTICAL;
}
-static void sobel(AVFilterContext *ctx, int w, int h,
- uint16_t *dst, int dst_linesize,
- const uint8_t *src, int src_linesize)
+static void sobel(int w, int h,
+ uint16_t *dst, int dst_linesize,
+ int8_t *dir, int dir_linesize,
+ const uint8_t *src, int src_linesize)
{
int i, j;
- EdgeDetectContext *edgedetect = ctx->priv;
for (j = 1; j < h - 1; j++) {
dst += dst_linesize;
+ dir += dir_linesize;
src += src_linesize;
for (i = 1; i < w - 1; i++) {
const int gx =
@@ -175,17 +207,17 @@ static void sobel(AVFilterContext *ctx, int w, int h,
-1*src[-src_linesize + i+1] + 1*src[ src_linesize + i+1];
dst[i] = FFABS(gx) + FFABS(gy);
- edgedetect->directions[j*w + i] = get_rounded_direction(gx, gy);
+ dir[i] = get_rounded_direction(gx, gy);
}
}
}
-static void non_maximum_suppression(AVFilterContext *ctx, int w, int h,
+static void non_maximum_suppression(int w, int h,
uint8_t *dst, int dst_linesize,
+ const int8_t *dir, int dir_linesize,
const uint16_t *src, int src_linesize)
{
int i, j;
- EdgeDetectContext *edgedetect = ctx->priv;
#define COPY_MAXIMA(ay, ax, by, bx) do { \
if (src[i] > src[(ay)*src_linesize + i+(ax)] && \
@@ -195,9 +227,10 @@ static void non_maximum_suppression(AVFilterContext *ctx, int w, int h,
for (j = 1; j < h - 1; j++) {
dst += dst_linesize;
+ dir += dir_linesize;
src += src_linesize;
for (i = 1; i < w - 1; i++) {
- switch (edgedetect->directions[j*w + i]) {
+ switch (dir[i]) {
case DIRECTION_45UP: COPY_MAXIMA( 1, -1, -1, 1); break;
case DIRECTION_45DOWN: COPY_MAXIMA(-1, -1, 1, 1); break;
case DIRECTION_HORIZONTAL: COPY_MAXIMA( 0, -1, 0, 1); break;
@@ -207,14 +240,11 @@ static void non_maximum_suppression(AVFilterContext *ctx, int w, int h,
}
}
-static void double_threshold(AVFilterContext *ctx, int w, int h,
+static void double_threshold(int low, int high, int w, int h,
uint8_t *dst, int dst_linesize,
const uint8_t *src, int src_linesize)
{
int i, j;
- EdgeDetectContext *edgedetect = ctx->priv;
- const int low = edgedetect->low_u8;
- const int high = edgedetect->high_u8;
for (j = 0; j < h; j++) {
for (i = 0; i < w; i++) {
@@ -242,17 +272,29 @@ static void double_threshold(AVFilterContext *ctx, int w, int h,
}
}
+static void color_mix(int w, int h,
+ uint8_t *dst, int dst_linesize,
+ const uint8_t *src, int src_linesize)
+{
+ int i, j;
+
+ for (j = 0; j < h; j++) {
+ for (i = 0; i < w; i++)
+ dst[i] = (dst[i] + src[i]) >> 1;
+ dst += dst_linesize;
+ src += src_linesize;
+ }
+}
+
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterContext *ctx = inlink->dst;
EdgeDetectContext *edgedetect = ctx->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
- uint8_t *tmpbuf = edgedetect->tmpbuf;
- uint16_t *gradients = edgedetect->gradients;
- int direct = 0;
+ int p, direct = 0;
AVFrame *out;
- if (av_frame_is_writable(in)) {
+ if (edgedetect->mode != MODE_COLORMIX && av_frame_is_writable(in)) {
direct = 1;
out = in;
} else {
@@ -264,27 +306,43 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props(out, in);
}
- /* gaussian filter to reduce noise */
- gaussian_blur(ctx, inlink->w, inlink->h,
- tmpbuf, inlink->w,
- in->data[0], in->linesize[0]);
-
- /* compute the 16-bits gradients and directions for the next step */
- sobel(ctx, inlink->w, inlink->h,
- gradients, inlink->w,
- tmpbuf, inlink->w);
-
- /* non_maximum_suppression() will actually keep & clip what's necessary and
- * ignore the rest, so we need a clean output buffer */
- memset(tmpbuf, 0, inlink->w * inlink->h);
- non_maximum_suppression(ctx, inlink->w, inlink->h,
- tmpbuf, inlink->w,
- gradients, inlink->w);
-
- /* keep high values, or low values surrounded by high values */
- double_threshold(ctx, inlink->w, inlink->h,
- out->data[0], out->linesize[0],
- tmpbuf, inlink->w);
+ for (p = 0; p < edgedetect->nb_planes; p++) {
+ struct plane_info *plane = &edgedetect->planes[p];
+ uint8_t *tmpbuf = plane->tmpbuf;
+ uint16_t *gradients = plane->gradients;
+ int8_t *directions = plane->directions;
+
+ /* gaussian filter to reduce noise */
+ gaussian_blur(ctx, inlink->w, inlink->h,
+ tmpbuf, inlink->w,
+ in->data[p], in->linesize[p]);
+
+ /* compute the 16-bits gradients and directions for the next step */
+ sobel(inlink->w, inlink->h,
+ gradients, inlink->w,
+ directions,inlink->w,
+ tmpbuf, inlink->w);
+
+ /* non_maximum_suppression() will actually keep & clip what's necessary and
+ * ignore the rest, so we need a clean output buffer */
+ memset(tmpbuf, 0, inlink->w * inlink->h);
+ non_maximum_suppression(inlink->w, inlink->h,
+ tmpbuf, inlink->w,
+ directions,inlink->w,
+ gradients, inlink->w);
+
+ /* keep high values, or low values surrounded by high values */
+ double_threshold(edgedetect->low_u8, edgedetect->high_u8,
+ inlink->w, inlink->h,
+ out->data[p], out->linesize[p],
+ tmpbuf, inlink->w);
+
+ if (edgedetect->mode == MODE_COLORMIX) {
+ color_mix(inlink->w, inlink->h,
+ out->data[p], out->linesize[p],
+ in->data[p], in->linesize[p]);
+ }
+ }
if (!direct)
av_frame_free(&in);
@@ -293,10 +351,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static av_cold void uninit(AVFilterContext *ctx)
{
+ int p;
EdgeDetectContext *edgedetect = ctx->priv;
- av_freep(&edgedetect->tmpbuf);
- av_freep(&edgedetect->gradients);
- av_freep(&edgedetect->directions);
+
+ for (p = 0; p < edgedetect->nb_planes; p++) {
+ struct plane_info *plane = &edgedetect->planes[p];
+ av_freep(&plane->tmpbuf);
+ av_freep(&plane->gradients);
+ av_freep(&plane->directions);
+ }
}
static const AVFilterPad edgedetect_inputs[] = {
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_elbg.c b/chromium/third_party/ffmpeg/libavfilter/vf_elbg.c
index 2781281f71c..be0885d30b8 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_elbg.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_elbg.c
@@ -33,10 +33,10 @@
#include "internal.h"
#include "video.h"
-typedef struct {
+typedef struct ColorContext {
const AVClass *class;
AVLFG lfg;
- int lfg_seed;
+ unsigned int lfg_seed;
int max_steps_nb;
int *codeword;
int codeword_length;
@@ -56,7 +56,7 @@ static const AVOption elbg_options[] = {
{ "nb_steps", "set max number of steps used to compute the mapping", OFFSET(max_steps_nb), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, FLAGS },
{ "n", "set max number of steps used to compute the mapping", OFFSET(max_steps_nb), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, FLAGS },
{ "seed", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT, {.i64 = -1}, -1, UINT32_MAX, FLAGS },
- { "s", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
+ { "s", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT32_MAX, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_fade.c b/chromium/third_party/ffmpeg/libavfilter/vf_fade.c
index cc10b122ca3..80ce75dcdaa 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_fade.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_fade.c
@@ -49,7 +49,7 @@
#define FADE_IN 0
#define FADE_OUT 1
-typedef struct {
+typedef struct FadeContext {
const AVClass *class;
int type;
int factor, fade_per_frame;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_fieldorder.c b/chromium/third_party/ffmpeg/libavfilter/vf_fieldorder.c
index 84088a0428d..36189af270e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_fieldorder.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_fieldorder.c
@@ -32,7 +32,7 @@
#include "internal.h"
#include "video.h"
-typedef struct {
+typedef struct FieldOrderContext {
const AVClass *class;
int dst_tff; ///< output bff/tff
int line_size[4]; ///< bytes of pixel data per line for each plane
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_format.c b/chromium/third_party/ffmpeg/libavfilter/vf_format.c
index 2e9ff27be7a..8a41153c20e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_format.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_format.c
@@ -35,7 +35,7 @@
#include "internal.h"
#include "video.h"
-typedef struct {
+typedef struct FormatContext {
const AVClass *class;
char *pix_fmts;
/**
@@ -55,6 +55,9 @@ static av_cold int init(AVFilterContext *ctx)
int pix_fmt_name_len, ret;
enum AVPixelFormat pix_fmt;
+ if (!s->pix_fmts)
+ return AVERROR(EINVAL);
+
/* parse the list of formats */
for (cur = s->pix_fmts; cur; cur = sep ? sep + 1 : NULL) {
if (!(sep = strchr(cur, '|')))
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_fps.c b/chromium/third_party/ffmpeg/libavfilter/vf_fps.c
index e6266ccb502..ad7297aab45 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_fps.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_fps.c
@@ -45,7 +45,6 @@ typedef struct FPSContext {
/* timestamps in input timebase */
int64_t first_pts; ///< pts of the first frame that arrived on this filter
- int64_t pts; ///< pts of the first frame currently in the fifo
double start_time; ///< pts, in seconds, of the expected first frame
@@ -83,7 +82,6 @@ static av_cold int init(AVFilterContext *ctx)
if (!(s->fifo = av_fifo_alloc(2*sizeof(AVFrame*))))
return AVERROR(ENOMEM);
- s->pts = AV_NOPTS_VALUE;
s->first_pts = AV_NOPTS_VALUE;
av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", s->framerate.num, s->framerate.den);
@@ -105,7 +103,7 @@ static av_cold void uninit(AVFilterContext *ctx)
if (s->fifo) {
s->drop += av_fifo_size(s->fifo) / sizeof(AVFrame*);
flush_fifo(s->fifo);
- av_fifo_free(s->fifo);
+ av_fifo_freep(&s->fifo);
}
av_log(ctx, AV_LOG_VERBOSE, "%d frames in, %d frames out; %d frames dropped, "
@@ -179,7 +177,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
s->frames_in++;
/* discard frames until we get the first timestamp */
- if (s->pts == AV_NOPTS_VALUE) {
+ if (s->first_pts == AV_NOPTS_VALUE) {
if (buf->pts != AV_NOPTS_VALUE) {
ret = write_to_fifo(s->fifo, buf);
if (ret < 0)
@@ -188,13 +186,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
if (s->start_time != DBL_MAX && s->start_time != AV_NOPTS_VALUE) {
double first_pts = s->start_time * AV_TIME_BASE;
first_pts = FFMIN(FFMAX(first_pts, INT64_MIN), INT64_MAX);
- s->first_pts = s->pts = av_rescale_q(first_pts, AV_TIME_BASE_Q,
+ s->first_pts = av_rescale_q(first_pts, AV_TIME_BASE_Q,
inlink->time_base);
av_log(ctx, AV_LOG_VERBOSE, "Set first pts to (in:%"PRId64" out:%"PRId64")\n",
s->first_pts, av_rescale_q(first_pts, AV_TIME_BASE_Q,
outlink->time_base));
} else {
- s->first_pts = s->pts = buf->pts;
+ s->first_pts = buf->pts;
}
} else {
av_log(ctx, AV_LOG_WARNING, "Discarding initial frame(s) with no "
@@ -211,8 +209,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
}
/* number of output frames */
- delta = av_rescale_q_rnd(buf->pts - s->pts, inlink->time_base,
- outlink->time_base, s->rounding);
+ delta = av_rescale_q_rnd(buf->pts - s->first_pts, inlink->time_base,
+ outlink->time_base, s->rounding) - s->frames_out ;
if (delta < 1) {
/* drop the frame and everything buffered except the first */
@@ -267,7 +265,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
flush_fifo(s->fifo);
ret = write_to_fifo(s->fifo, buf);
- s->pts = s->first_pts + av_rescale_q(s->frames_out, outlink->time_base, inlink->time_base);
return ret;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_framepack.c b/chromium/third_party/ffmpeg/libavfilter/vf_framepack.c
new file mode 100644
index 00000000000..8a7d4e8f32b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_framepack.c
@@ -0,0 +1,363 @@
+/*
+ * Copyright (c) 2013 Vittorio Giovara
+ *
+ * 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
+ * Generate a frame packed video, by combining two views in a single surface.
+ */
+
+#include <string.h>
+
+#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/rational.h"
+#include "libavutil/stereo3d.h"
+
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+#define LEFT 0
+#define RIGHT 1
+
+typedef struct FramepackContext {
+ const AVClass *class;
+
+ const AVPixFmtDescriptor *pix_desc; ///< agreed pixel format
+
+ enum AVStereo3DType format; ///< frame pack type output
+
+ AVFrame *input_views[2]; ///< input frames
+
+ int64_t double_pts; ///< new pts for frameseq mode
+} FramepackContext;
+
+static const enum AVPixelFormat formats_supported[] = {
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVJ420P,
+ AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
+ AV_PIX_FMT_NONE
+};
+
+static int query_formats(AVFilterContext *ctx)
+{
+ // this will ensure that formats are the same on all pads
+ ff_set_common_formats(ctx, ff_make_format_list(formats_supported));
+ return 0;
+}
+
+static av_cold void framepack_uninit(AVFilterContext *ctx)
+{
+ FramepackContext *s = ctx->priv;
+
+ // clean any leftover frame
+ av_frame_free(&s->input_views[LEFT]);
+ av_frame_free(&s->input_views[RIGHT]);
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ FramepackContext *s = outlink->src->priv;
+
+ int width = ctx->inputs[LEFT]->w;
+ int height = ctx->inputs[LEFT]->h;
+ AVRational time_base = ctx->inputs[LEFT]->time_base;
+
+ // check size and fps match on the other input
+ if (width != ctx->inputs[RIGHT]->w ||
+ height != ctx->inputs[RIGHT]->h) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Left and right sizes differ (%dx%d vs %dx%d).\n",
+ width, height,
+ ctx->inputs[RIGHT]->w, ctx->inputs[RIGHT]->h);
+ return AVERROR_INVALIDDATA;
+ } else if (av_cmp_q(time_base, ctx->inputs[RIGHT]->time_base) != 0) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Left and right framerates differ (%d/%d vs %d/%d).\n",
+ time_base.num, time_base.den,
+ ctx->inputs[RIGHT]->time_base.num,
+ ctx->inputs[RIGHT]->time_base.den);
+ return AVERROR_INVALIDDATA;
+ }
+
+ s->pix_desc = av_pix_fmt_desc_get(outlink->format);
+ if (!s->pix_desc)
+ return AVERROR_BUG;
+
+ // modify output properties as needed
+ switch (s->format) {
+ case AV_STEREO3D_FRAMESEQUENCE:
+ time_base.den *= 2;
+ s->double_pts = AV_NOPTS_VALUE;
+ break;
+ case AV_STEREO3D_COLUMNS:
+ case AV_STEREO3D_SIDEBYSIDE:
+ width *= 2;
+ break;
+ case AV_STEREO3D_LINES:
+ case AV_STEREO3D_TOPBOTTOM:
+ height *= 2;
+ break;
+ default:
+ av_log(ctx, AV_LOG_ERROR, "Unknown packing mode.");
+ return AVERROR_INVALIDDATA;
+ }
+
+ outlink->w = width;
+ outlink->h = height;
+ outlink->time_base = time_base;
+
+ return 0;
+}
+
+static void horizontal_frame_pack(FramepackContext *s,
+ AVFrame *dst,
+ int interleaved)
+{
+ int plane, i;
+ int length = dst->width / 2;
+ int lines = dst->height;
+
+ for (plane = 0; plane < s->pix_desc->nb_components; plane++) {
+ const uint8_t *leftp = s->input_views[LEFT]->data[plane];
+ const uint8_t *rightp = s->input_views[RIGHT]->data[plane];
+ uint8_t *dstp = dst->data[plane];
+
+ if (plane == 1 || plane == 2) {
+ length = -(-(dst->width / 2) >> s->pix_desc->log2_chroma_w);
+ lines = -(-(dst->height) >> s->pix_desc->log2_chroma_h);
+ }
+
+ if (interleaved) {
+ for (i = 0; i < lines; i++) {
+ int j;
+ int k = 0;
+
+ for (j = 0; j < length; j++) {
+ dstp[k++] = leftp[j];
+ dstp[k++] = rightp[j];
+ }
+
+ dstp += dst->linesize[plane];
+ leftp += s->input_views[LEFT]->linesize[plane];
+ rightp += s->input_views[RIGHT]->linesize[plane];
+ }
+ } else {
+ av_image_copy_plane(dst->data[plane], dst->linesize[plane],
+ leftp, s->input_views[LEFT]->linesize[plane],
+ length, lines);
+ av_image_copy_plane(dst->data[plane] + length, dst->linesize[plane],
+ rightp, s->input_views[RIGHT]->linesize[plane],
+ length, lines);
+ }
+ }
+}
+
+static void vertical_frame_pack(FramepackContext *s,
+ AVFrame *dst,
+ int interleaved)
+{
+ int plane, offset;
+ int length = dst->width;
+ int lines = dst->height / 2;
+
+ for (plane = 0; plane < s->pix_desc->nb_components; plane++) {
+ if (plane == 1 || plane == 2) {
+ length = -(-(dst->width) >> s->pix_desc->log2_chroma_w);
+ lines = -(-(dst->height / 2) >> s->pix_desc->log2_chroma_h);
+ }
+
+ offset = interleaved ? dst->linesize[plane] : dst->linesize[plane] * lines;
+
+ av_image_copy_plane(dst->data[plane],
+ dst->linesize[plane] << interleaved,
+ s->input_views[LEFT]->data[plane],
+ s->input_views[LEFT]->linesize[plane],
+ length, lines);
+ av_image_copy_plane(dst->data[plane] + offset,
+ dst->linesize[plane] << interleaved,
+ s->input_views[RIGHT]->data[plane],
+ s->input_views[RIGHT]->linesize[plane],
+ length, lines);
+ }
+}
+
+static av_always_inline void spatial_frame_pack(FramepackContext *s, AVFrame *dst)
+{
+ switch (s->format) {
+ case AV_STEREO3D_SIDEBYSIDE:
+ horizontal_frame_pack(s, dst, 0);
+ break;
+ case AV_STEREO3D_COLUMNS:
+ horizontal_frame_pack(s, dst, 1);
+ break;
+ case AV_STEREO3D_TOPBOTTOM:
+ vertical_frame_pack(s, dst, 0);
+ break;
+ case AV_STEREO3D_LINES:
+ vertical_frame_pack(s, dst, 1);
+ break;
+ }
+}
+
+static int filter_frame_left(AVFilterLink *inlink, AVFrame *frame)
+{
+ FramepackContext *s = inlink->dst->priv;
+ s->input_views[LEFT] = frame;
+ return 0;
+}
+
+static int filter_frame_right(AVFilterLink *inlink, AVFrame *frame)
+{
+ FramepackContext *s = inlink->dst->priv;
+ s->input_views[RIGHT] = frame;
+ return 0;
+}
+
+static int request_frame(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ FramepackContext *s = ctx->priv;
+ AVStereo3D *stereo;
+ int ret, i;
+
+ /* get a frame on the either input, stop as soon as a video ends */
+ for (i = 0; i < 2; i++) {
+ if (!s->input_views[i]) {
+ ret = ff_request_frame(ctx->inputs[i]);
+ if (ret < 0)
+ return ret;
+ }
+ }
+
+ if (s->format == AV_STEREO3D_FRAMESEQUENCE) {
+ if (s->double_pts == AV_NOPTS_VALUE)
+ s->double_pts = s->input_views[LEFT]->pts;
+
+ for (i = 0; i < 2; i++) {
+ // set correct timestamps
+ s->input_views[i]->pts = s->double_pts++;
+
+ // set stereo3d side data
+ stereo = av_stereo3d_create_side_data(s->input_views[i]);
+ if (!stereo)
+ return AVERROR(ENOMEM);
+ stereo->type = s->format;
+
+ // filter the frame and immediately relinquish its pointer
+ ret = ff_filter_frame(outlink, s->input_views[i]);
+ s->input_views[i] = NULL;
+ if (ret < 0)
+ return ret;
+ }
+ return ret;
+ } else {
+ AVFrame *dst = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!dst)
+ return AVERROR(ENOMEM);
+
+ spatial_frame_pack(s, dst);
+
+ // get any property from the original frame
+ ret = av_frame_copy_props(dst, s->input_views[LEFT]);
+ if (ret < 0) {
+ av_frame_free(&dst);
+ return ret;
+ }
+
+ for (i = 0; i < 2; i++)
+ av_frame_free(&s->input_views[i]);
+
+ // set stereo3d side data
+ stereo = av_stereo3d_create_side_data(dst);
+ if (!stereo) {
+ av_frame_free(&dst);
+ return AVERROR(ENOMEM);
+ }
+ stereo->type = s->format;
+
+ return ff_filter_frame(outlink, dst);
+ }
+}
+
+#define OFFSET(x) offsetof(FramepackContext, x)
+#define V AV_OPT_FLAG_VIDEO_PARAM
+static const AVOption options[] = {
+ { "format", "Frame pack output format", OFFSET(format), AV_OPT_TYPE_INT,
+ { .i64 = AV_STEREO3D_SIDEBYSIDE }, 0, INT_MAX, .flags = V, .unit = "format" },
+ { "sbs", "Views are packed next to each other", 0, AV_OPT_TYPE_CONST,
+ { .i64 = AV_STEREO3D_SIDEBYSIDE }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
+ { "tab", "Views are packed on top of each other", 0, AV_OPT_TYPE_CONST,
+ { .i64 = AV_STEREO3D_TOPBOTTOM }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
+ { "frameseq", "Views are one after the other", 0, AV_OPT_TYPE_CONST,
+ { .i64 = AV_STEREO3D_FRAMESEQUENCE }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
+ { "lines", "Views are interleaved by lines", 0, AV_OPT_TYPE_CONST,
+ { .i64 = AV_STEREO3D_LINES }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
+ { "columns", "Views are interleaved by columns", 0, AV_OPT_TYPE_CONST,
+ { .i64 = AV_STEREO3D_COLUMNS }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
+ { NULL },
+};
+
+static const AVClass framepack_class = {
+ .class_name = "framepack",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static const AVFilterPad framepack_inputs[] = {
+ {
+ .name = "left",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame_left,
+ .needs_fifo = 1,
+ },
+ {
+ .name = "right",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame_right,
+ .needs_fifo = 1,
+ },
+ { NULL }
+};
+
+static const AVFilterPad framepack_outputs[] = {
+ {
+ .name = "packed",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ .request_frame = request_frame,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_framepack = {
+ .name = "framepack",
+ .description = NULL_IF_CONFIG_SMALL("Generate a frame packed stereoscopic video."),
+ .priv_size = sizeof(FramepackContext),
+ .priv_class = &framepack_class,
+ .query_formats = query_formats,
+ .inputs = framepack_inputs,
+ .outputs = framepack_outputs,
+ .uninit = framepack_uninit,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_framestep.c b/chromium/third_party/ffmpeg/libavfilter/vf_framestep.c
index 9087f4620b4..09945e17aef 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_framestep.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_framestep.c
@@ -28,7 +28,7 @@
#include "internal.h"
#include "video.h"
-typedef struct {
+typedef struct NullContext {
const AVClass *class;
int frame_step;
} FrameStepContext;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_frei0r.c b/chromium/third_party/ffmpeg/libavfilter/vf_frei0r.c
index a070eb4726f..9f868383eee 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_frei0r.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_frei0r.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include "config.h"
#include "libavutil/avstring.h"
+#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
@@ -80,7 +81,7 @@ static void *load_sym(AVFilterContext *ctx, const char *sym_name)
Frei0rContext *s = ctx->priv;
void *sym = dlsym(s->dl_handle, sym_name);
if (!sym)
- av_log(ctx, AV_LOG_ERROR, "Could not find symbol '%s' in loaded module\n", sym_name);
+ av_log(ctx, AV_LOG_ERROR, "Could not find symbol '%s' in loaded module.\n", sym_name);
return sym;
}
@@ -128,7 +129,7 @@ static int set_param(AVFilterContext *ctx, f0r_param_info_t info, int index, cha
return 0;
fail:
- av_log(ctx, AV_LOG_ERROR, "Invalid value '%s' for parameter '%s'\n",
+ av_log(ctx, AV_LOG_ERROR, "Invalid value '%s' for parameter '%s'.\n",
param, info.name);
return AVERROR(EINVAL);
}
@@ -201,11 +202,11 @@ static int set_params(AVFilterContext *ctx, const char *params)
default: /* F0R_PARAM_STRING */
v = s;
s->get_param_value(s->instance, v, i);
- av_log(ctx, AV_LOG_DEBUG, "'%s'\n", s);
+ av_log(ctx, AV_LOG_DEBUG, "'%s'", s);
break;
}
#endif
- av_log(ctx, AV_LOG_VERBOSE, "\n");
+ av_log(ctx, AV_LOG_VERBOSE, ".\n");
}
return 0;
@@ -216,7 +217,7 @@ static int load_path(AVFilterContext *ctx, void **handle_ptr, const char *prefix
char *path = av_asprintf("%s%s%s", prefix, name, SLIBSUF);
if (!path)
return AVERROR(ENOMEM);
- av_log(ctx, AV_LOG_DEBUG, "Looking for frei0r effect in '%s'\n", path);
+ av_log(ctx, AV_LOG_DEBUG, "Looking for frei0r effect in '%s'.\n", path);
*handle_ptr = dlopen(path, RTLD_NOW|RTLD_LOCAL);
av_free(path);
return 0;
@@ -231,6 +232,13 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
f0r_plugin_info_t *pi;
char *path;
int ret = 0;
+ int i;
+ static const char* const frei0r_pathlist[] = {
+ "/usr/local/lib/frei0r-1/",
+ "/usr/lib/frei0r-1/",
+ "/usr/local/lib64/frei0r-1/",
+ "/usr/lib64/frei0r-1/"
+ };
if (!dl_name) {
av_log(ctx, AV_LOG_ERROR, "No filter name provided.\n");
@@ -274,18 +282,13 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
if (ret < 0)
return ret;
}
- if (!s->dl_handle) {
- ret = load_path(ctx, &s->dl_handle, "/usr/local/lib/frei0r-1/", dl_name);
- if (ret < 0)
- return ret;
- }
- if (!s->dl_handle) {
- ret = load_path(ctx, &s->dl_handle, "/usr/lib/frei0r-1/", dl_name);
+ for (i = 0; !s->dl_handle && i < FF_ARRAY_ELEMS(frei0r_pathlist); i++) {
+ ret = load_path(ctx, &s->dl_handle, frei0r_pathlist[i], dl_name);
if (ret < 0)
return ret;
}
if (!s->dl_handle) {
- av_log(ctx, AV_LOG_ERROR, "Could not find module '%s'\n", dl_name);
+ av_log(ctx, AV_LOG_ERROR, "Could not find module '%s'.\n", dl_name);
return AVERROR(EINVAL);
}
@@ -301,7 +304,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
return AVERROR(EINVAL);
if (f0r_init() < 0) {
- av_log(ctx, AV_LOG_ERROR, "Could not init the frei0r module\n");
+ av_log(ctx, AV_LOG_ERROR, "Could not init the frei0r module.\n");
return AVERROR(EINVAL);
}
@@ -309,7 +312,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
pi = &s->plugin_info;
if (pi->plugin_type != type) {
av_log(ctx, AV_LOG_ERROR,
- "Invalid type '%s' for the plugin\n",
+ "Invalid type '%s' for this plugin\n",
pi->plugin_type == F0R_PLUGIN_TYPE_FILTER ? "filter" :
pi->plugin_type == F0R_PLUGIN_TYPE_SOURCE ? "source" :
pi->plugin_type == F0R_PLUGIN_TYPE_MIXER2 ? "mixer2" :
@@ -356,7 +359,7 @@ static int config_input_props(AVFilterLink *inlink)
if (s->destruct && s->instance)
s->destruct(s->instance);
if (!(s->instance = s->construct(inlink->w, inlink->h))) {
- av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance\n");
+ av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance.\n");
return AVERROR(EINVAL);
}
@@ -473,7 +476,11 @@ static int source_config_props(AVFilterLink *outlink)
if (s->destruct && s->instance)
s->destruct(s->instance);
if (!(s->instance = s->construct(outlink->w, outlink->h))) {
- av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance\n");
+ av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance.\n");
+ return AVERROR(EINVAL);
+ }
+ if (!s->params) {
+ av_log(ctx, AV_LOG_ERROR, "frei0r filter parameters not set.\n");
return AVERROR(EINVAL);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_hflip.c b/chromium/third_party/ffmpeg/libavfilter/vf_hflip.c
index 19b66062db9..faf32853ef6 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_hflip.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_hflip.c
@@ -35,7 +35,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
-typedef struct {
+typedef struct FlipContext {
int max_step[4]; ///< max pixel step for each plane, expressed as a number of bytes
int planewidth[4]; ///< width of each plane
int planeheight[4]; ///< height of each plane
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.c b/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.c
index 518a23d424a..0448c0d1e89 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.c
@@ -133,7 +133,7 @@ static void denoise_depth(HQDN3DContext *s,
uint16_t *frame_ant = *frame_ant_ptr;
if (!frame_ant) {
uint8_t *frame_src = src;
- *frame_ant_ptr = frame_ant = av_malloc(w*h*sizeof(uint16_t));
+ *frame_ant_ptr = frame_ant = av_malloc_array(w, h*sizeof(uint16_t));
for (y = 0; y < h; y++, src += sstride, frame_ant += w)
for (x = 0; x < w; x++)
frame_ant[x] = LOAD(x);
@@ -147,6 +147,7 @@ static void denoise_depth(HQDN3DContext *s,
else
denoise_temporal(src, dst, frame_ant,
w, h, sstride, dstride, temporal, depth);
+ emms_c();
}
#define denoise(...) \
@@ -258,7 +259,7 @@ static int config_input(AVFilterLink *inlink)
s->vsub = desc->log2_chroma_h;
s->depth = desc->comp[0].depth_minus1+1;
- s->line = av_malloc(inlink->w * sizeof(*s->line));
+ s->line = av_malloc_array(inlink->w, sizeof(*s->line));
if (!s->line)
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.h b/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.h
index 268ac9a2595..be55400f018 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.h
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.h
@@ -28,7 +28,7 @@
#include "libavutil/opt.h"
-typedef struct {
+typedef struct HQDN3DContext {
const AVClass *class;
int16_t *coefs[4];
uint16_t *line;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_hue.c b/chromium/third_party/ffmpeg/libavfilter/vf_hue.c
index faa2e8df03e..7843673365e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_hue.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_hue.c
@@ -73,6 +73,7 @@ typedef struct {
AVExpr *brightness_pexpr;
int hsub;
int vsub;
+ int is_first;
int32_t hue_sin;
int32_t hue_cos;
double var_values[VAR_NB];
@@ -143,8 +144,8 @@ static inline void create_chrominance_lut(HueContext *h, const int32_t c,
new_v = ((s * u) + (c * v) + (1 << 15) + (128 << 16)) >> 16;
/* Prevent a potential overflow */
- h->lut_u[i][j] = av_clip_uint8_c(new_u);
- h->lut_v[i][j] = av_clip_uint8_c(new_v);
+ h->lut_u[i][j] = av_clip_uint8(new_u);
+ h->lut_v[i][j] = av_clip_uint8(new_v);
}
}
}
@@ -207,6 +208,7 @@ static av_cold int init(AVFilterContext *ctx)
"H_expr:%s h_deg_expr:%s s_expr:%s b_expr:%s\n",
hue->hue_expr, hue->hue_deg_expr, hue->saturation_expr, hue->brightness_expr);
compute_sin_and_cos(hue);
+ hue->is_first = 1;
return 0;
}
@@ -351,15 +353,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
}
av_log(inlink->dst, AV_LOG_DEBUG,
- "H:%0.1f*PI h:%0.1f s:%0.f b:%0.f t:%0.1f n:%d\n",
+ "H:%0.1f*PI h:%0.1f s:%0.1f b:%0.f t:%0.1f n:%d\n",
hue->hue/M_PI, hue->hue_deg, hue->saturation, hue->brightness,
hue->var_values[VAR_T], (int)hue->var_values[VAR_N]);
compute_sin_and_cos(hue);
- if (old_hue_sin != hue->hue_sin || old_hue_cos != hue->hue_cos)
+ if (hue->is_first || (old_hue_sin != hue->hue_sin || old_hue_cos != hue->hue_cos))
create_chrominance_lut(hue, hue->hue_cos, hue->hue_sin);
- if (old_brightness != hue->brightness && hue->brightness)
+ if (hue->is_first || (old_brightness != hue->brightness && hue->brightness))
create_luma_lut(hue);
if (!direct) {
@@ -383,6 +385,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
if (!direct)
av_frame_free(&inpic);
+
+ hue->is_first = 0;
return ff_filter_frame(outlink, outpic);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_interlace.c b/chromium/third_party/ffmpeg/libavfilter/vf_interlace.c
index 63fea2b8854..0929a7107ad 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_interlace.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_interlace.c
@@ -34,6 +34,7 @@
#include "formats.h"
#include "avfilter.h"
#include "internal.h"
+#include "version.h"
#include "video.h"
enum ScanMode {
@@ -46,10 +47,12 @@ enum FieldType {
FIELD_LOWER = 1,
};
-typedef struct {
+typedef struct InterlaceContext {
const AVClass *class;
enum ScanMode scan; // top or bottom field first scanning
+#if FF_API_INTERLACE_LOWPASS_SET
int lowpass; // enable or disable low pass filterning
+#endif
AVFrame *cur, *next; // the two frames from which the new one is obtained
} InterlaceContext;
@@ -62,8 +65,10 @@ static const AVOption interlace_options[] = {
AV_OPT_TYPE_CONST, {.i64 = MODE_TFF }, INT_MIN, INT_MAX, .flags = V, .unit = "scan" },
{ "bff", "bottom field first", 0,
AV_OPT_TYPE_CONST, {.i64 = MODE_BFF }, INT_MIN, INT_MAX, .flags = V, .unit = "scan" },
- { "lowpass", "enable vertical low-pass filter", OFFSET(lowpass),
+#if FF_API_INTERLACE_LOWPASS_SET
+ { "lowpass", "(deprecated, this option is always set)", OFFSET(lowpass),
AV_OPT_TYPE_INT, {.i64 = 1 }, 0, 1, .flags = V },
+#endif
{ NULL }
};
@@ -96,6 +101,11 @@ static int config_out_props(AVFilterLink *outlink)
AVFilterLink *inlink = outlink->src->inputs[0];
InterlaceContext *s = ctx->priv;
+#if FF_API_INTERLACE_LOWPASS_SET
+ if (!s->lowpass)
+ av_log(ctx, AV_LOG_WARNING, "This option is deprecated and always set.\n");
+#endif
+
if (inlink->h < 2) {
av_log(ctx, AV_LOG_ERROR, "input video height is too small\n");
return AVERROR_INVALIDDATA;
@@ -110,15 +120,14 @@ static int config_out_props(AVFilterLink *outlink)
outlink->frame_rate.den *= 2;
outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
- av_log(ctx, AV_LOG_VERBOSE, "%s interlacing %s lowpass filter\n",
- s->scan == MODE_TFF ? "tff" : "bff", (s->lowpass) ? "with" : "without");
+ av_log(ctx, AV_LOG_VERBOSE, "%s interlacing\n",
+ s->scan == MODE_TFF ? "tff" : "bff");
return 0;
}
static void copy_picture_field(AVFrame *src_frame, AVFrame *dst_frame,
- AVFilterLink *inlink, enum FieldType field_type,
- int lowpass)
+ AVFilterLink *inlink, enum FieldType field_type)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
int vsub = desc->log2_chroma_h;
@@ -129,6 +138,8 @@ static void copy_picture_field(AVFrame *src_frame, AVFrame *dst_frame,
int linesize = av_image_get_linesize(inlink->format, inlink->w, plane);
uint8_t *dstp = dst_frame->data[plane];
const uint8_t *srcp = src_frame->data[plane];
+ int srcp_linesize;
+ int dstp_linesize;
av_assert0(linesize >= 0);
@@ -137,29 +148,24 @@ static void copy_picture_field(AVFrame *src_frame, AVFrame *dst_frame,
srcp += src_frame->linesize[plane];
if (field_type == FIELD_LOWER)
dstp += dst_frame->linesize[plane];
- if (lowpass) {
- int srcp_linesize = src_frame->linesize[plane] * 2;
- int dstp_linesize = dst_frame->linesize[plane] * 2;
- for (j = lines; j > 0; j--) {
- const uint8_t *srcp_above = srcp - src_frame->linesize[plane];
- const uint8_t *srcp_below = srcp + src_frame->linesize[plane];
- if (j == lines)
- srcp_above = srcp; // there is no line above
- if (j == 1)
- srcp_below = srcp; // there is no line below
- for (i = 0; i < linesize; i++) {
- // this calculation is an integer representation of
- // '0.5 * current + 0.25 * above + 0.25 * below'
- // '1 +' is for rounding.
- dstp[i] = (1 + srcp[i] + srcp[i] + srcp_above[i] + srcp_below[i]) >> 2;
- }
- dstp += dstp_linesize;
- srcp += srcp_linesize;
+
+ srcp_linesize = src_frame->linesize[plane] * 2;
+ dstp_linesize = dst_frame->linesize[plane] * 2;
+ for (j = lines; j > 0; j--) {
+ const uint8_t *srcp_above = srcp - src_frame->linesize[plane];
+ const uint8_t *srcp_below = srcp + src_frame->linesize[plane];
+ if (j == lines)
+ srcp_above = srcp; // there is no line above
+ if (j == 1)
+ srcp_below = srcp; // there is no line below
+ for (i = 0; i < linesize; i++) {
+ // this calculation is an integer representation of
+ // '0.5 * current + 0.25 * above + 0.25 * below'
+ // '1 +' is for rounding.
+ dstp[i] = (1 + srcp[i] + srcp[i] + srcp_above[i] + srcp_below[i]) >> 2;
}
- } else {
- av_image_copy_plane(dstp, dst_frame->linesize[plane] * 2,
- srcp, src_frame->linesize[plane] * 2,
- linesize, lines);
+ dstp += dstp_linesize;
+ srcp += srcp_linesize;
}
}
}
@@ -202,11 +208,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
out->pts /= 2; // adjust pts to new framerate
/* copy upper/lower field from cur */
- copy_picture_field(s->cur, out, inlink, tff ? FIELD_UPPER : FIELD_LOWER, s->lowpass);
+ copy_picture_field(s->cur, out, inlink, tff ? FIELD_UPPER : FIELD_LOWER);
av_frame_free(&s->cur);
/* copy lower/upper field from next */
- copy_picture_field(s->next, out, inlink, tff ? FIELD_LOWER : FIELD_UPPER, s->lowpass);
+ copy_picture_field(s->next, out, inlink, tff ? FIELD_LOWER : FIELD_UPPER);
av_frame_free(&s->next);
ret = ff_filter_frame(outlink, out);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_libopencv.c b/chromium/third_party/ffmpeg/libavfilter/vf_libopencv.c
index 2306b09bdb1..6b4a7fcb380 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_libopencv.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_libopencv.c
@@ -68,7 +68,7 @@ static int query_formats(AVFilterContext *ctx)
return 0;
}
-typedef struct {
+typedef struct OCVContext {
const AVClass *class;
char *name;
char *params;
@@ -78,7 +78,7 @@ typedef struct {
void *priv;
} OCVContext;
-typedef struct {
+typedef struct SmoothContext {
int type;
int param1, param2;
double param3, param4;
@@ -245,7 +245,7 @@ static int parse_iplconvkernel(IplConvKernel **kernel, char *buf, void *log_ctx)
return 0;
}
-typedef struct {
+typedef struct DilateContext {
int nb_iterations;
IplConvKernel *kernel;
} DilateContext;
@@ -302,7 +302,7 @@ static void erode_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplIma
cvErode(inimg, outimg, dilate->kernel, dilate->nb_iterations);
}
-typedef struct {
+typedef struct OCVFilterEntry {
const char *name;
size_t priv_size;
int (*init)(AVFilterContext *ctx, const char *args);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_lut.c b/chromium/third_party/ffmpeg/libavfilter/vf_lut.c
index 9f30ae0cdff..fff5a2ba317 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_lut.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_lut.c
@@ -57,7 +57,7 @@ enum var_name {
VAR_VARS_NB
};
-typedef struct {
+typedef struct LutContext {
const AVClass *class;
uint8_t lut[4][256]; ///< lookup table for each component
char *comp_expr_str[4];
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c b/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c
index 79566be8ce6..7c3a7dac152 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c
@@ -62,9 +62,7 @@ typedef struct LUT3DContext {
char *file;
uint8_t rgba_map[4];
int step;
- int is16bit;
- struct rgbvec (*interp_8) (const struct LUT3DContext*, uint8_t, uint8_t, uint8_t);
- struct rgbvec (*interp_16)(const struct LUT3DContext*, uint16_t, uint16_t, uint16_t);
+ avfilter_action_func *interp;
struct rgbvec lut[MAX_LEVEL][MAX_LEVEL][MAX_LEVEL];
int lutsize;
#if CONFIG_HALDCLUT_FILTER
@@ -76,6 +74,10 @@ typedef struct LUT3DContext {
#endif
} LUT3DContext;
+typedef struct ThreadData {
+ AVFrame *in, *out;
+} ThreadData;
+
#define OFFSET(x) offsetof(LUT3DContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
#define COMMON_OPTIONS \
@@ -196,15 +198,44 @@ static inline struct rgbvec interp_tetrahedral(const LUT3DContext *lut3d,
return c;
}
-#define DEFINE_INTERP_FUNC(name, nbits) \
-static struct rgbvec interp_##nbits##_##name(const LUT3DContext *lut3d, \
- uint##nbits##_t r, \
- uint##nbits##_t g, \
- uint##nbits##_t b) \
-{ \
- const float scale = (1. / ((1<<nbits) - 1)) * (lut3d->lutsize - 1); \
- const struct rgbvec scaled_rgb = {r * scale, g * scale, b * scale}; \
- return interp_##name(lut3d, &scaled_rgb); \
+#define DEFINE_INTERP_FUNC(name, nbits) \
+static int interp_##nbits##_##name(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) \
+{ \
+ int x, y; \
+ const LUT3DContext *lut3d = ctx->priv; \
+ const ThreadData *td = arg; \
+ const AVFrame *in = td->in; \
+ const AVFrame *out = td->out; \
+ const int direct = out == in; \
+ const int step = lut3d->step; \
+ const uint8_t r = lut3d->rgba_map[R]; \
+ const uint8_t g = lut3d->rgba_map[G]; \
+ const uint8_t b = lut3d->rgba_map[B]; \
+ const uint8_t a = lut3d->rgba_map[A]; \
+ const int slice_start = (in->height * jobnr ) / nb_jobs; \
+ const int slice_end = (in->height * (jobnr+1)) / nb_jobs; \
+ uint8_t *dstrow = out->data[0] + slice_start * out->linesize[0]; \
+ const uint8_t *srcrow = in ->data[0] + slice_start * in ->linesize[0]; \
+ const float scale = (1. / ((1<<nbits) - 1)) * (lut3d->lutsize - 1); \
+ \
+ for (y = slice_start; y < slice_end; y++) { \
+ uint##nbits##_t *dst = (uint##nbits##_t *)dstrow; \
+ const uint##nbits##_t *src = (const uint##nbits##_t *)srcrow; \
+ for (x = 0; x < in->width * step; x += step) { \
+ const struct rgbvec scaled_rgb = {src[x + r] * scale, \
+ src[x + g] * scale, \
+ src[x + b] * scale}; \
+ struct rgbvec vec = interp_##name(lut3d, &scaled_rgb); \
+ dst[x + r] = av_clip_uint##nbits(vec.r * (float)((1<<nbits) - 1)); \
+ dst[x + g] = av_clip_uint##nbits(vec.g * (float)((1<<nbits) - 1)); \
+ dst[x + b] = av_clip_uint##nbits(vec.b * (float)((1<<nbits) - 1)); \
+ if (!direct && step == 4) \
+ dst[x + a] = src[x + a]; \
+ } \
+ dstrow += out->linesize[0]; \
+ srcrow += in ->linesize[0]; \
+ } \
+ return 0; \
}
DEFINE_INTERP_FUNC(nearest, 8)
@@ -231,21 +262,34 @@ static int skip_line(const char *p)
} \
} while (loop_cond)
-/* Basically r g and b float values on each line; seems to be generated by
- * Davinci */
+/* Basically r g and b float values on each line, with a facultative 3DLUTSIZE
+ * directive; seems to be generated by Davinci */
static int parse_dat(AVFilterContext *ctx, FILE *f)
{
LUT3DContext *lut3d = ctx->priv;
- const int size = lut3d->lutsize;
- int i, j, k;
+ char line[MAX_LINE_SIZE];
+ int i, j, k, size;
+
+ lut3d->lutsize = size = 33;
+ NEXT_LINE(skip_line(line));
+ if (!strncmp(line, "3DLUTSIZE ", 10)) {
+ size = strtol(line + 10, NULL, 0);
+ if (size < 2 || size > MAX_LEVEL) {
+ av_log(ctx, AV_LOG_ERROR, "Too large or invalid 3D LUT size\n");
+ return AVERROR(EINVAL);
+ }
+ lut3d->lutsize = size;
+ NEXT_LINE(skip_line(line));
+ }
for (k = 0; k < size; k++) {
for (j = 0; j < size; j++) {
for (i = 0; i < size; i++) {
- char line[MAX_LINE_SIZE];
struct rgbvec *vec = &lut3d->lut[k][j][i];
- NEXT_LINE(skip_line(line));
- sscanf(line, "%f %f %f", &vec->r, &vec->g, &vec->b);
+ if (k != 0 || j != 0 || i != 0)
+ NEXT_LINE(skip_line(line));
+ if (sscanf(line, "%f %f %f", &vec->r, &vec->g, &vec->b) != 3)
+ return AVERROR_INVALIDDATA;
}
}
}
@@ -273,7 +317,7 @@ static int parse_cube(AVFilterContext *ctx, FILE *f)
for (k = 0; k < size; k++) {
for (j = 0; j < size; j++) {
for (i = 0; i < size; i++) {
- struct rgbvec *vec = &lut3d->lut[k][j][i];
+ struct rgbvec *vec = &lut3d->lut[i][j][k];
do {
NEXT_LINE(0);
@@ -433,6 +477,7 @@ static int query_formats(AVFilterContext *ctx)
static int config_input(AVFilterLink *inlink)
{
+ int is16bit = 0;
LUT3DContext *lut3d = inlink->dst->priv;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
@@ -441,15 +486,15 @@ static int config_input(AVFilterLink *inlink)
case AV_PIX_FMT_BGR48:
case AV_PIX_FMT_RGBA64:
case AV_PIX_FMT_BGRA64:
- lut3d->is16bit = 1;
+ is16bit = 1;
}
ff_fill_rgba_map(lut3d->rgba_map, inlink->format);
- lut3d->step = av_get_padded_bits_per_pixel(desc) >> (3 + lut3d->is16bit);
+ lut3d->step = av_get_padded_bits_per_pixel(desc) >> (3 + is16bit);
-#define SET_FUNC(name) do { \
- if (lut3d->is16bit) lut3d->interp_16 = interp_16_##name; \
- else lut3d->interp_8 = interp_8_##name; \
+#define SET_FUNC(name) do { \
+ if (is16bit) lut3d->interp = interp_16_##name; \
+ else lut3d->interp = interp_8_##name; \
} while (0)
switch (lut3d->interpolation) {
@@ -463,41 +508,15 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
-#define FILTER(nbits) do { \
- uint8_t *dstrow = out->data[0]; \
- const uint8_t *srcrow = in ->data[0]; \
- \
- for (y = 0; y < inlink->h; y++) { \
- uint##nbits##_t *dst = (uint##nbits##_t *)dstrow; \
- const uint##nbits##_t *src = (const uint##nbits##_t *)srcrow; \
- for (x = 0; x < inlink->w * step; x += step) { \
- struct rgbvec vec = lut3d->interp_##nbits(lut3d, src[x + r], src[x + g], src[x + b]); \
- dst[x + r] = av_clip_uint##nbits(vec.r * (float)((1<<nbits) - 1)); \
- dst[x + g] = av_clip_uint##nbits(vec.g * (float)((1<<nbits) - 1)); \
- dst[x + b] = av_clip_uint##nbits(vec.b * (float)((1<<nbits) - 1)); \
- if (!direct && step == 4) \
- dst[x + a] = src[x + a]; \
- } \
- dstrow += out->linesize[0]; \
- srcrow += in ->linesize[0]; \
- } \
-} while (0)
-
static AVFrame *apply_lut(AVFilterLink *inlink, AVFrame *in)
{
- int x, y, direct = 0;
AVFilterContext *ctx = inlink->dst;
LUT3DContext *lut3d = ctx->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFrame *out;
- const int step = lut3d->step;
- const uint8_t r = lut3d->rgba_map[R];
- const uint8_t g = lut3d->rgba_map[G];
- const uint8_t b = lut3d->rgba_map[B];
- const uint8_t a = lut3d->rgba_map[A];
+ ThreadData td;
if (av_frame_is_writable(in)) {
- direct = 1;
out = in;
} else {
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
@@ -508,10 +527,11 @@ static AVFrame *apply_lut(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props(out, in);
}
- if (lut3d->is16bit) FILTER(16);
- else FILTER(8);
+ td.in = in;
+ td.out = out;
+ ctx->internal->execute(ctx, lut3d->interp, &td, NULL, FFMIN(outlink->h, ctx->graph->nb_threads));
- if (!direct)
+ if (out != in)
av_frame_free(&in);
return out;
@@ -562,7 +582,6 @@ static av_cold int lut3d_init(AVFilterContext *ctx)
ext++;
if (!av_strcasecmp(ext, "dat")) {
- lut3d->lutsize = 33;
ret = parse_dat(ctx, f);
} else if (!av_strcasecmp(ext, "3dl")) {
ret = parse_3dl(ctx, f);
@@ -612,7 +631,7 @@ AVFilter ff_vf_lut3d = {
.inputs = lut3d_inputs,
.outputs = lut3d_outputs,
.priv_class = &lut3d_class,
- .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
};
#endif
@@ -791,6 +810,6 @@ AVFilter ff_vf_haldclut = {
.inputs = haldclut_inputs,
.outputs = haldclut_outputs,
.priv_class = &haldclut_class,
- .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_mergeplanes.c b/chromium/third_party/ffmpeg/libavfilter/vf_mergeplanes.c
index 4a814120565..6fec816a4a5 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_mergeplanes.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_mergeplanes.c
@@ -53,7 +53,7 @@ typedef struct MergePlanesContext {
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static const AVOption mergeplanes_options[] = {
{ "mapping", "set input to output plane mapping", OFFSET(mapping), AV_OPT_TYPE_INT, {.i64=0}, 0, 0x33333333, FLAGS },
- { "format", "set output pixel format", OFFSET(out_fmt), AV_OPT_TYPE_PIXEL_FMT, {.i64=AV_PIX_FMT_YUVA444P}, 0, AV_PIX_FMT_NB-1, .flags=FLAGS },
+ { "format", "set output pixel format", OFFSET(out_fmt), AV_OPT_TYPE_PIXEL_FMT, {.i64=AV_PIX_FMT_YUVA444P}, 0, INT_MAX, .flags=FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_noise.c b/chromium/third_party/ffmpeg/libavfilter/vf_noise.c
index c29afa27214..07d1c276c32 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_noise.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_noise.c
@@ -289,7 +289,7 @@ static inline void line_noise_avg_c(uint8_t *dst, const uint8_t *src,
static inline void line_noise_avg_mmx(uint8_t *dst, const uint8_t *src,
int len, int8_t **shift)
{
-#if HAVE_MMX_INLINE
+#if HAVE_MMX_INLINE && HAVE_6REGS
x86_reg mmx_len= len&(~7);
__asm__ volatile(
@@ -438,7 +438,9 @@ static av_cold int init(AVFilterContext *ctx)
if (HAVE_MMX_INLINE &&
cpu_flags & AV_CPU_FLAG_MMX) {
n->line_noise = line_noise_mmx;
+#if HAVE_6REGS
n->line_noise_avg = line_noise_avg_mmx;
+#endif
}
if (HAVE_MMXEXT_INLINE &&
cpu_flags & AV_CPU_FLAG_MMXEXT)
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_overlay.c b/chromium/third_party/ffmpeg/libavfilter/vf_overlay.c
index 9047deeee47..beb4e8f1ff0 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_overlay.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_overlay.c
@@ -69,6 +69,16 @@ enum var_name {
VAR_VARS_NB
};
+enum EOFAction {
+ EOF_ACTION_REPEAT,
+ EOF_ACTION_ENDALL,
+ EOF_ACTION_PASS
+};
+
+static const char *eof_action_str[] = {
+ "repeat", "endall", "pass"
+};
+
#define MAIN 0
#define OVERLAY 1
@@ -81,7 +91,7 @@ enum var_name {
#define U 1
#define V 2
-typedef struct {
+typedef struct OverlayContext {
const AVClass *class;
int x, y; ///< position of overlayed picture
@@ -92,7 +102,7 @@ typedef struct {
uint8_t overlay_is_packed_rgb;
uint8_t overlay_rgba_map[4];
uint8_t overlay_has_alpha;
- enum OverlayFormat { OVERLAY_FORMAT_YUV420, OVERLAY_FORMAT_YUV444, OVERLAY_FORMAT_RGB, OVERLAY_FORMAT_NB} format;
+ enum OverlayFormat { OVERLAY_FORMAT_YUV420, OVERLAY_FORMAT_YUV422, OVERLAY_FORMAT_YUV444, OVERLAY_FORMAT_RGB, OVERLAY_FORMAT_NB} format;
enum EvalMode { EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB } eval_mode;
FFDualInputContext dinput;
@@ -103,6 +113,9 @@ typedef struct {
double var_values[VAR_VARS_NB];
char *x_expr, *y_expr;
+
+ enum EOFAction eof_action; ///< action to take on EOF from source
+
AVExpr *x_pexpr, *y_pexpr;
} OverlayContext;
@@ -191,6 +204,13 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE
};
+ static const enum AVPixelFormat main_pix_fmts_yuv422[] = {
+ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_NONE
+ };
+ static const enum AVPixelFormat overlay_pix_fmts_yuv422[] = {
+ AV_PIX_FMT_YUVA422P, AV_PIX_FMT_NONE
+ };
+
static const enum AVPixelFormat main_pix_fmts_yuv444[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE
};
@@ -218,6 +238,10 @@ static int query_formats(AVFilterContext *ctx)
main_formats = ff_make_format_list(main_pix_fmts_yuv420);
overlay_formats = ff_make_format_list(overlay_pix_fmts_yuv420);
break;
+ case OVERLAY_FORMAT_YUV422:
+ main_formats = ff_make_format_list(main_pix_fmts_yuv422);
+ overlay_formats = ff_make_format_list(overlay_pix_fmts_yuv422);
+ break;
case OVERLAY_FORMAT_YUV444:
main_formats = ff_make_format_list(main_pix_fmts_yuv444);
overlay_formats = ff_make_format_list(overlay_pix_fmts_yuv444);
@@ -298,11 +322,12 @@ static int config_input_overlay(AVFilterLink *inlink)
}
av_log(ctx, AV_LOG_VERBOSE,
- "main w:%d h:%d fmt:%s overlay w:%d h:%d fmt:%s\n",
+ "main w:%d h:%d fmt:%s overlay w:%d h:%d fmt:%s eof_action:%s\n",
ctx->inputs[MAIN]->w, ctx->inputs[MAIN]->h,
av_get_pix_fmt_name(ctx->inputs[MAIN]->format),
ctx->inputs[OVERLAY]->w, ctx->inputs[OVERLAY]->h,
- av_get_pix_fmt_name(ctx->inputs[OVERLAY]->format));
+ av_get_pix_fmt_name(ctx->inputs[OVERLAY]->format),
+ eof_action_str[s->eof_action]);
return 0;
}
@@ -570,6 +595,15 @@ static av_cold int init(AVFilterContext *ctx)
"The rgb option is deprecated and is overriding the format option, use format instead\n");
s->format = OVERLAY_FORMAT_RGB;
}
+ if (!s->dinput.repeatlast || s->eof_action == EOF_ACTION_PASS) {
+ s->dinput.repeatlast = 0;
+ s->eof_action = EOF_ACTION_PASS;
+ }
+ if (s->dinput.shortest || s->eof_action == EOF_ACTION_ENDALL) {
+ s->dinput.shortest = 1;
+ s->eof_action = EOF_ACTION_ENDALL;
+ }
+
s->dinput.process = do_blend;
return 0;
}
@@ -580,6 +614,12 @@ static av_cold int init(AVFilterContext *ctx)
static const AVOption overlay_options[] = {
{ "x", "set the x expression", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str = "0"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "y", "set the y expression", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str = "0"}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "eof_action", "Action to take when encountering EOF from secondary input ",
+ OFFSET(eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT },
+ EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
+ { "repeat", "Repeat the previous frame.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS, "eof_action" },
+ { "endall", "End both streams.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS, "eof_action" },
+ { "pass", "Pass through the main input.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS }, .flags = FLAGS, "eof_action" },
{ "eval", "specify when to evaluate expressions", OFFSET(eval_mode), AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_FRAME}, 0, EVAL_MODE_NB-1, FLAGS, "eval" },
{ "init", "eval expressions once during initialization", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_INIT}, .flags = FLAGS, .unit = "eval" },
{ "frame", "eval expressions per-frame", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = FLAGS, .unit = "eval" },
@@ -587,6 +627,7 @@ static const AVOption overlay_options[] = {
{ "shortest", "force termination when the shortest input terminates", OFFSET(dinput.shortest), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
{ "format", "set output format", OFFSET(format), AV_OPT_TYPE_INT, {.i64=OVERLAY_FORMAT_YUV420}, 0, OVERLAY_FORMAT_NB-1, FLAGS, "format" },
{ "yuv420", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV420}, .flags = FLAGS, .unit = "format" },
+ { "yuv422", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV422}, .flags = FLAGS, .unit = "format" },
{ "yuv444", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV444}, .flags = FLAGS, .unit = "format" },
{ "rgb", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_RGB}, .flags = FLAGS, .unit = "format" },
{ "repeatlast", "repeat overlay of the last overlay frame", OFFSET(dinput.repeatlast), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_pad.c b/chromium/third_party/ffmpeg/libavfilter/vf_pad.c
index 2962e204f0e..2d9b9d03626 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_pad.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_pad.c
@@ -77,7 +77,7 @@ static int query_formats(AVFilterContext *ctx)
return 0;
}
-typedef struct {
+typedef struct PadContext {
const AVClass *class;
int w, h; ///< output dimensions, a value of 0 will result in the input size
int x, y; ///< offsets of the input area with respect to the padded area
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_phase.c b/chromium/third_party/ffmpeg/libavfilter/vf_phase.c
index 2dcc6faa495..82dc603efe5 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_phase.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_phase.c
@@ -42,7 +42,7 @@ enum PhaseMode {
typedef struct PhaseContext {
const AVClass *class;
enum PhaseMode mode;
- AVFrame *frame;
+ AVFrame *frame; /* previous frame */
int nb_planes;
int planeheight[4];
int linesize[4];
@@ -112,20 +112,16 @@ static int config_input(AVFilterLink *inlink)
* Find which field combination has the smallest average squared difference
* between the fields.
*/
-static enum PhaseMode analyze_plane(AVFilterContext *ctx, PhaseContext *s,
- AVFrame *old, AVFrame *new)
+static enum PhaseMode analyze_plane(void *ctx, enum PhaseMode mode, AVFrame *old, AVFrame *new)
{
double bdiff, tdiff, pdiff, scale;
const int ns = new->linesize[0];
const int os = old->linesize[0];
- uint8_t *nptr = new->data[0];
- uint8_t *optr = old->data[0];
+ const uint8_t *nptr = new->data[0];
+ const uint8_t *optr = old->data[0];
const int h = new->height;
const int w = new->width;
int bdif, tdif, pdif;
- enum PhaseMode mode = s->mode;
- uint8_t *end, *rend;
- int top, t;
if (mode == AUTO) {
mode = new->interlaced_frame ? new->top_field_first ?
@@ -138,10 +134,14 @@ static enum PhaseMode analyze_plane(AVFilterContext *ctx, PhaseContext *s,
if (mode <= BOTTOM_FIRST) {
bdiff = pdiff = tdiff = 65536.0;
} else {
+ int top = 0, t;
+ const uint8_t *rend, *end = nptr + (h - 2) * ns;
+
bdiff = pdiff = tdiff = 0.0;
- for (end = nptr + (h - 2) * ns, nptr += ns, optr += os, top = 0;
- nptr < end; nptr += ns - w, optr += os - w, top ^= 1) {
+ nptr += ns;
+ optr += os;
+ while (nptr < end) {
pdif = tdif = bdif = 0;
switch (mode) {
@@ -206,6 +206,9 @@ static enum PhaseMode analyze_plane(AVFilterContext *ctx, PhaseContext *s,
pdiff += (double)pdif;
tdiff += (double)tdif;
bdiff += (double)bdif;
+ nptr += ns - w;
+ optr += os - w;
+ top ^= 1;
}
scale = 1.0 / (w * (h - 3)) / 25.0;
@@ -245,6 +248,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int plane, top, y;
AVFrame *out;
+ if (ctx->is_disabled) {
+ av_frame_free(&s->frame);
+ /* we keep a reference to the previous frame so the filter can start
+ * being useful as soon as it's not disabled, avoiding the 1-frame
+ * delay. */
+ s->frame = av_frame_clone(in);
+ return ff_filter_frame(outlink, in);
+ }
+
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) {
av_frame_free(&in);
@@ -253,25 +265,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props(out, in);
if (!s->frame) {
+ s->frame = in;
mode = PROGRESSIVE;
- s->frame = ff_get_video_buffer(outlink, outlink->w, outlink->h);
- if (!s->frame) {
- av_frame_free(&in);
- av_frame_free(&out);
- return AVERROR(ENOMEM);
- }
} else {
- mode = analyze_plane(ctx, s, s->frame, in);
+ mode = analyze_plane(ctx, s->mode, s->frame, in);
}
for (plane = 0; plane < s->nb_planes; plane++) {
- uint8_t *buf = s->frame->data[plane];
- uint8_t *from = in->data[plane];
+ const uint8_t *buf = s->frame->data[plane];
+ const uint8_t *from = in->data[plane];
uint8_t *to = out->data[plane];
for (y = 0, top = 1; y < s->planeheight[plane]; y++, top ^= 1) {
memcpy(to, mode == (top ? BOTTOM_FIRST : TOP_FIRST) ? buf : from, s->linesize[plane]);
- memcpy(buf, from, s->linesize[plane]);
buf += s->frame->linesize[plane];
from += in->linesize[plane];
@@ -279,7 +285,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
}
- av_frame_free(&in);
+ if (in != s->frame)
+ av_frame_free(&s->frame);
+ s->frame = in;
return ff_filter_frame(outlink, out);
}
@@ -317,4 +325,5 @@ AVFilter ff_vf_phase = {
.query_formats = query_formats,
.inputs = phase_inputs,
.outputs = phase_outputs,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_pixdesctest.c b/chromium/third_party/ffmpeg/libavfilter/vf_pixdesctest.c
index 54ddf897652..790dd0d9c20 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_pixdesctest.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_pixdesctest.c
@@ -29,7 +29,7 @@
#include "internal.h"
#include "video.h"
-typedef struct {
+typedef struct PixdescTestContext {
const AVPixFmtDescriptor *pix_desc;
uint16_t *line;
} PixdescTestContext;
@@ -47,7 +47,7 @@ static int config_props(AVFilterLink *inlink)
priv->pix_desc = av_pix_fmt_desc_get(inlink->format);
av_freep(&priv->line);
- if (!(priv->line = av_malloc(sizeof(*priv->line) * inlink->w)))
+ if (!(priv->line = av_malloc_array(sizeof(*priv->line), inlink->w)))
return AVERROR(ENOMEM);
return 0;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_psnr.c b/chromium/third_party/ffmpeg/libavfilter/vf_psnr.c
index 4915816da36..082612ad54b 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_psnr.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_psnr.c
@@ -246,7 +246,7 @@ static int config_input_ref(AVFilterLink *inlink)
s->nb_components = desc->nb_components;
if (ctx->inputs[0]->w != ctx->inputs[1]->w ||
ctx->inputs[0]->h != ctx->inputs[1]->h) {
- av_log(ctx, AV_LOG_ERROR, "Width and heigth of input videos must be same.\n");
+ av_log(ctx, AV_LOG_ERROR, "Width and height of input videos must be same.\n");
return AVERROR(EINVAL);
}
if (ctx->inputs[0]->format != ctx->inputs[1]->format) {
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_pullup.c b/chromium/third_party/ffmpeg/libavfilter/vf_pullup.c
index 69e1e917193..13e06253c7f 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_pullup.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_pullup.c
@@ -126,6 +126,23 @@ static int alloc_metrics(PullupContext *s, PullupField *f)
return 0;
}
+static void free_field_queue(PullupField *head)
+{
+ PullupField *f = head;
+ do {
+ PullupField *next;
+ if (!f)
+ break;
+ av_free(f->diffs);
+ av_free(f->combs);
+ av_free(f->vars);
+ next = f->next;
+ memset(f, 0, sizeof(*f)); // clear all pointers to avoid stale ones
+ av_free(f);
+ f = next;
+ } while (f != head);
+}
+
static PullupField *make_field_queue(PullupContext *s, int len)
{
PullupField *head, *f;
@@ -141,13 +158,17 @@ static PullupField *make_field_queue(PullupContext *s, int len)
for (; len > 0; len--) {
f->next = av_mallocz(sizeof(*f->next));
- if (!f->next)
+ if (!f->next) {
+ free_field_queue(head);
return NULL;
+ }
f->next->prev = f;
f = f->next;
- if (alloc_metrics(s, f) < 0)
+ if (alloc_metrics(s, f) < 0) {
+ free_field_queue(head);
return NULL;
+ }
}
f->next = head;
@@ -235,6 +256,8 @@ static int alloc_buffer(PullupContext *s, PullupBuffer *b)
for (i = 0; i < s->nb_planes; i++) {
b->planes[i] = av_malloc(s->planeheight[i] * s->planewidth[i]);
}
+ if (s->nb_planes == 1)
+ b->planes[1] = av_malloc(4*256);
return 0;
}
@@ -714,21 +737,10 @@ end:
static av_cold void uninit(AVFilterContext *ctx)
{
PullupContext *s = ctx->priv;
- PullupField *f;
int i;
- f = s->head;
- while (f) {
- av_free(f->diffs);
- av_free(f->combs);
- av_free(f->vars);
- if (f == s->last) {
- av_freep(&s->last);
- break;
- }
- f = f->next;
- av_freep(&f->prev);
- };
+ free_field_queue(s->head);
+ s->last = NULL;
for (i = 0; i < FF_ARRAY_ELEMS(s->buffers); i++) {
av_freep(&s->buffers[i].planes[0]);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_removelogo.c b/chromium/third_party/ffmpeg/libavfilter/vf_removelogo.c
index 01a585c218f..555517f83d9 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_removelogo.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_removelogo.c
@@ -312,18 +312,22 @@ static av_cold int init(AVFilterContext *ctx)
the filter is applied, the mask size is determined on a pixel
by pixel basis, with pixels nearer the edge of the logo getting
smaller mask sizes. */
- mask = (int ***)av_malloc(sizeof(int **) * (s->max_mask_size + 1));
+ mask = (int ***)av_malloc_array(s->max_mask_size + 1, sizeof(int **));
if (!mask)
return AVERROR(ENOMEM);
for (a = 0; a <= s->max_mask_size; a++) {
- mask[a] = (int **)av_malloc(sizeof(int *) * ((a * 2) + 1));
- if (!mask[a])
+ mask[a] = (int **)av_malloc_array((a * 2) + 1, sizeof(int *));
+ if (!mask[a]) {
+ av_free(mask);
return AVERROR(ENOMEM);
+ }
for (b = -a; b <= a; b++) {
- mask[a][b + a] = (int *)av_malloc(sizeof(int) * ((a * 2) + 1));
- if (!mask[a][b + a])
+ mask[a][b + a] = (int *)av_malloc_array((a * 2) + 1, sizeof(int));
+ if (!mask[a][b + a]) {
+ av_free(mask);
return AVERROR(ENOMEM);
+ }
for (c = -a; c <= a; c++) {
if ((b * b) + (c * c) <= (a * a)) /* Circular 0/1 mask. */
mask[a][b + a][c + a] = 1;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_rotate.c b/chromium/third_party/ffmpeg/libavfilter/vf_rotate.c
index e242ee2dfa5..7e5b12b42db 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_rotate.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_rotate.c
@@ -36,6 +36,8 @@
#include "internal.h"
#include "video.h"
+#include <float.h>
+
static const char *var_names[] = {
"in_w" , "iw", ///< width of the input video
"in_h" , "ih", ///< height of the input video
@@ -252,11 +254,12 @@ static int config_props(AVFilterLink *outlink)
}
#define FIXP (1<<16)
-#define INT_PI 205887 //(M_PI * FIXP)
+#define FIXP2 (1<<20)
+#define INT_PI 3294199 //(M_PI * FIXP2)
/**
* Compute the sin of a using integer values.
- * Input and output values are scaled by FIXP.
+ * Input is scaled by FIXP2 and output values are scaled by FIXP.
*/
static int64_t int_sin(int64_t a)
{
@@ -268,13 +271,13 @@ static int64_t int_sin(int64_t a)
if (a >= INT_PI*3/2) a -= 2*INT_PI; // -PI/2 .. 3PI/2
if (a >= INT_PI/2 ) a = INT_PI - a; // -PI/2 .. PI/2
- /* compute sin using Taylor series approximated to the third term */
- a2 = (a*a)/FIXP;
- for (i = 2; i < 7; i += 2) {
+ /* compute sin using Taylor series approximated to the fifth term */
+ a2 = (a*a)/(FIXP2);
+ for (i = 2; i < 11; i += 2) {
res += a;
- a = -a*a2 / (FIXP*i*(i+1));
+ a = -a*a2 / (FIXP2*i*(i+1));
}
- return res;
+ return (res + 8)>>4;
}
/**
@@ -307,6 +310,62 @@ static uint8_t *interpolate_bilinear(uint8_t *dst_color,
return dst_color;
}
+static av_always_inline void copy_elem(uint8_t *pout, const uint8_t *pin, int elem_size)
+{
+ int v;
+ switch (elem_size) {
+ case 1:
+ *pout = *pin;
+ break;
+ case 2:
+ *((uint16_t *)pout) = *((uint16_t *)pin);
+ break;
+ case 3:
+ v = AV_RB24(pin);
+ AV_WB24(pout, v);
+ break;
+ case 4:
+ *((uint32_t *)pout) = *((uint32_t *)pin);
+ break;
+ default:
+ memcpy(pout, pin, elem_size);
+ break;
+ }
+}
+
+static av_always_inline void simple_rotate_internal(uint8_t *dst, const uint8_t *src, int src_linesize, int angle, int elem_size, int len)
+{
+ int i;
+ switch(angle) {
+ case 0:
+ memcpy(dst, src, elem_size * len);
+ break;
+ case 1:
+ for (i = 0; i<len; i++)
+ copy_elem(dst + i*elem_size, src + (len-i-1)*src_linesize, elem_size);
+ break;
+ case 2:
+ for (i = 0; i<len; i++)
+ copy_elem(dst + i*elem_size, src + (len-i-1)*elem_size, elem_size);
+ break;
+ case 3:
+ for (i = 0; i<len; i++)
+ copy_elem(dst + i*elem_size, src + i*src_linesize, elem_size);
+ break;
+ }
+}
+
+static av_always_inline void simple_rotate(uint8_t *dst, const uint8_t *src, int src_linesize, int angle, int elem_size, int len)
+{
+ switch(elem_size) {
+ case 1 : simple_rotate_internal(dst, src, src_linesize, angle, 1, len); break;
+ case 2 : simple_rotate_internal(dst, src, src_linesize, angle, 2, len); break;
+ case 3 : simple_rotate_internal(dst, src, src_linesize, angle, 3, len); break;
+ case 4 : simple_rotate_internal(dst, src, src_linesize, angle, 4, len); break;
+ default: simple_rotate_internal(dst, src, src_linesize, angle, elem_size, len); break;
+ }
+}
+
#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)*av_q2d(tb))
static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
@@ -327,15 +386,31 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
int i, j, x, y;
for (j = start; j < end; j++) {
- x = xprime + xi + FIXP*inw/2;
- y = yprime + yi + FIXP*inh/2;
+ x = xprime + xi + FIXP*(inw-1)/2;
+ y = yprime + yi + FIXP*(inh-1)/2;
+
+ if (fabs(rot->angle - 0) < FLT_EPSILON && outw == inw && outh == inh) {
+ simple_rotate(out->data[plane] + j * out->linesize[plane],
+ in->data[plane] + j * in->linesize[plane],
+ in->linesize[plane], 0, rot->draw.pixelstep[plane], outw);
+ } else if (fabs(rot->angle - M_PI/2) < FLT_EPSILON && outw == inh && outh == inw) {
+ simple_rotate(out->data[plane] + j * out->linesize[plane],
+ in->data[plane] + j * rot->draw.pixelstep[plane],
+ in->linesize[plane], 1, rot->draw.pixelstep[plane], outw);
+ } else if (fabs(rot->angle - M_PI) < FLT_EPSILON && outw == inw && outh == inh) {
+ simple_rotate(out->data[plane] + j * out->linesize[plane],
+ in->data[plane] + (outh-j-1) * in->linesize[plane],
+ in->linesize[plane], 2, rot->draw.pixelstep[plane], outw);
+ } else if (fabs(rot->angle - 3*M_PI/2) < FLT_EPSILON && outw == inh && outh == inw) {
+ simple_rotate(out->data[plane] + j * out->linesize[plane],
+ in->data[plane] + (outh-j-1) * rot->draw.pixelstep[plane],
+ in->linesize[plane], 3, rot->draw.pixelstep[plane], outw);
+ } else {
for (i = 0; i < outw; i++) {
int32_t v;
int x1, y1;
uint8_t *pin, *pout;
- x += c;
- y -= s;
x1 = x>>16;
y1 = y>>16;
@@ -371,6 +446,9 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
break;
}
}
+ x += c;
+ y -= s;
+ }
}
xprime += s;
yprime += c;
@@ -402,7 +480,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_log(ctx, AV_LOG_DEBUG, "n:%f time:%f angle:%f/PI\n",
rot->var_values[VAR_N], rot->var_values[VAR_T], rot->angle/M_PI);
- angle_int = res * FIXP;
+ angle_int = res * FIXP * 16;
s = int_sin(angle_int);
c = int_sin(angle_int + INT_PI/2);
@@ -420,9 +498,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
.inw = FF_CEIL_RSHIFT(inlink->w, hsub),
.inh = FF_CEIL_RSHIFT(inlink->h, vsub),
.outh = outh, .outw = outw,
- .xi = -outw/2 * c, .yi = outw/2 * s,
- .xprime = -outh/2 * s,
- .yprime = -outh/2 * c,
+ .xi = -(outw-1) * c / 2, .yi = (outw-1) * s / 2,
+ .xprime = -(outh-1) * s / 2,
+ .yprime = -(outh-1) * c / 2,
.plane = plane, .c = c, .s = s };
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_scale.c b/chromium/third_party/ffmpeg/libavfilter/vf_scale.c
index 2e692cff5b7..b1d97af4e04 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_scale.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_scale.c
@@ -71,7 +71,7 @@ enum var_name {
VARS_NB
};
-typedef struct {
+typedef struct ScaleContext {
const AVClass *class;
struct SwsContext *sws; ///< software scaler context
struct SwsContext *isws[2]; ///< software scaler context for interlaced material
@@ -81,6 +81,7 @@ typedef struct {
* New dimensions. Special values are:
* 0 = original width/height
* -1 = keep original aspect
+ * -N = try to keep aspect but make sure it is divisible by N
*/
int w, h;
char *size_str;
@@ -236,6 +237,7 @@ static int config_props(AVFilterLink *outlink)
double var_values[VARS_NB], res;
char *expr;
int ret;
+ int factor_w, factor_h;
var_values[VAR_IN_W] = var_values[VAR_IW] = inlink->w;
var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
@@ -270,23 +272,35 @@ static int config_props(AVFilterLink *outlink)
w = scale->w;
h = scale->h;
- /* sanity check params */
- if (w < -1 || h < -1) {
- av_log(ctx, AV_LOG_ERROR, "Size values less than -1 are not acceptable.\n");
- return AVERROR(EINVAL);
+ /* Check if it is requested that the result has to be divisible by a some
+ * factor (w or h = -n with n being the factor). */
+ factor_w = 1;
+ factor_h = 1;
+ if (w < -1) {
+ factor_w = -w;
}
- if (w == -1 && h == -1)
+ if (h < -1) {
+ factor_h = -h;
+ }
+
+ if (w < 0 && h < 0)
scale->w = scale->h = 0;
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);
+ /* Make sure that the result is divisible by the factor we determined
+ * earlier. If no factor was set, it is nothing will happen as the default
+ * factor is 1 */
+ if (w < 0)
+ w = av_rescale(h, inlink->w, inlink->h * factor_w) * factor_w;
+ if (h < 0)
+ h = av_rescale(w, inlink->h, inlink->w * factor_h) * factor_h;
+
+ /* Note that force_original_aspect_ratio may overwrite the previous set
+ * dimensions so that it is not divisible by the set factors anymore. */
if (scale->force_original_aspect_ratio) {
int tmp_w = av_rescale(h, inlink->w, inlink->h);
int tmp_h = av_rescale(w, inlink->h, inlink->w);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_showinfo.c b/chromium/third_party/ffmpeg/libavfilter/vf_showinfo.c
index ade3e1ae063..ec4bed14411 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_showinfo.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_showinfo.c
@@ -22,20 +22,66 @@
* filter for showing textual video frame information
*/
+#include <inttypes.h>
+
#include "libavutil/adler32.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/pixdesc.h"
+#include "libavutil/stereo3d.h"
#include "libavutil/timestamp.h"
+
#include "avfilter.h"
#include "internal.h"
#include "video.h"
+static void dump_stereo3d(AVFilterContext *ctx, AVFrameSideData *sd)
+{
+ AVStereo3D *stereo;
+
+ av_log(ctx, AV_LOG_INFO, "stereoscopic information: ");
+ if (sd->size < sizeof(*stereo)) {
+ av_log(ctx, AV_LOG_INFO, "invalid data");
+ return;
+ }
+
+ stereo = (AVStereo3D *)sd->data;
+
+ av_log(ctx, AV_LOG_INFO, "type - ");
+ switch (stereo->type) {
+ case AV_STEREO3D_2D: av_log(ctx, AV_LOG_INFO, "2D"); break;
+ case AV_STEREO3D_SIDEBYSIDE: av_log(ctx, AV_LOG_INFO, "side by side"); break;
+ case AV_STEREO3D_TOPBOTTOM: av_log(ctx, AV_LOG_INFO, "top and bottom"); break;
+ case AV_STEREO3D_FRAMESEQUENCE: av_log(ctx, AV_LOG_INFO, "frame alternate"); break;
+ case AV_STEREO3D_CHECKERBOARD: av_log(ctx, AV_LOG_INFO, "checkerboard"); break;
+ case AV_STEREO3D_LINES: av_log(ctx, AV_LOG_INFO, "interleaved lines"); break;
+ case AV_STEREO3D_COLUMNS: av_log(ctx, AV_LOG_INFO, "interleaved columns"); break;
+ case AV_STEREO3D_SIDEBYSIDE_QUINCUNX: av_log(ctx, AV_LOG_INFO, "side by side "
+ "(quincunx subsampling)"); break;
+ default: av_log(ctx, AV_LOG_WARNING, "unknown"); break;
+ }
+
+ if (stereo->flags & AV_STEREO3D_FLAG_INVERT)
+ av_log(ctx, AV_LOG_INFO, " (inverted)");
+}
+
+static void update_sample_stats(const uint8_t *src, int len, int64_t *sum, int64_t *sum2)
+{
+ int i;
+
+ for (i = 0; i < len; i++) {
+ *sum += src[i];
+ *sum2 += src[i] * src[i];
+ }
+}
+
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
AVFilterContext *ctx = inlink->dst;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
uint32_t plane_checksum[4] = {0}, checksum = 0;
+ int64_t sum[4] = {0}, sum2[4] = {0};
+ int32_t pixelcount[4] = {0};
int i, plane, vsub = desc->log2_chroma_h;
for (plane = 0; plane < 4 && frame->data[plane] && frame->linesize[plane]; plane++) {
@@ -49,6 +95,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
for (i = 0; i < h; i++) {
plane_checksum[plane] = av_adler32_update(plane_checksum[plane], data, linesize);
checksum = av_adler32_update(checksum, data, linesize);
+
+ update_sample_stats(data, linesize, sum+plane, sum2+plane);
+ pixelcount[plane] += linesize;
data += frame->linesize[plane];
}
}
@@ -56,7 +105,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
av_log(ctx, AV_LOG_INFO,
"n:%"PRId64" pts:%s pts_time:%s pos:%"PRId64" "
"fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c "
- "checksum:%08X plane_checksum:[%08X",
+ "checksum:%08"PRIX32" plane_checksum:[%08"PRIX32,
inlink->frame_count,
av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base), av_frame_get_pkt_pos(frame),
desc->name,
@@ -69,8 +118,38 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
checksum, plane_checksum[0]);
for (plane = 1; plane < 4 && frame->data[plane] && frame->linesize[plane]; plane++)
- av_log(ctx, AV_LOG_INFO, " %08X", plane_checksum[plane]);
- av_log(ctx, AV_LOG_INFO, "]\n");
+ av_log(ctx, AV_LOG_INFO, " %08"PRIX32, plane_checksum[plane]);
+ av_log(ctx, AV_LOG_INFO, "] mean:[");
+ for (plane = 0; plane < 4 && frame->data[plane] && frame->linesize[plane]; plane++)
+ av_log(ctx, AV_LOG_INFO, "%"PRId64" ", (sum[plane] + pixelcount[plane]/2) / pixelcount[plane]);
+ av_log(ctx, AV_LOG_INFO, "\b] stdev:[");
+ for (plane = 0; plane < 4 && frame->data[plane] && frame->linesize[plane]; plane++)
+ av_log(ctx, AV_LOG_INFO, "%3.1f ",
+ sqrt((sum2[plane] - sum[plane]*(double)sum[plane]/pixelcount[plane])/pixelcount[plane]));
+ av_log(ctx, AV_LOG_INFO, "\b]\n");
+
+ for (i = 0; i < frame->nb_side_data; i++) {
+ AVFrameSideData *sd = frame->side_data[i];
+
+ av_log(ctx, AV_LOG_INFO, " side data - ");
+ switch (sd->type) {
+ case AV_FRAME_DATA_PANSCAN:
+ av_log(ctx, AV_LOG_INFO, "pan/scan");
+ break;
+ case AV_FRAME_DATA_A53_CC:
+ av_log(ctx, AV_LOG_INFO, "A/53 closed captions (%d bytes)", sd->size);
+ break;
+ case AV_FRAME_DATA_STEREO3D:
+ dump_stereo3d(ctx, sd);
+ break;
+ default:
+ av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d bytes)",
+ sd->type, sd->size);
+ break;
+ }
+
+ av_log(ctx, AV_LOG_INFO, "\n");
+ }
return ff_filter_frame(inlink->dst->outputs[0], frame);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_shuffleplanes.c b/chromium/third_party/ffmpeg/libavfilter/vf_shuffleplanes.c
new file mode 100644
index 00000000000..80085cd712a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_shuffleplanes.c
@@ -0,0 +1,172 @@
+/*
+ * 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 "libavutil/avstring.h"
+#include "libavutil/common.h"
+#include "libavutil/internal.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/pixfmt.h"
+
+#include "avfilter.h"
+#include "internal.h"
+#include "video.h"
+
+typedef struct ShufflePlanesContext {
+ const AVClass *class;
+
+ /* number of planes in the selected pixel format */
+ int planes;
+
+ /* mapping indices */
+ int map[4];
+
+ /* set to 1 if some plane is used more than once, so we need to make a copy */
+ int copy;
+} ShufflePlanesContext;
+
+static av_cold int shuffleplanes_config_input(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ ShufflePlanesContext *s = ctx->priv;
+ const AVPixFmtDescriptor *desc;
+ int used[4] = { 0 };
+ int i;
+
+ s->copy = 0;
+ s->planes = av_pix_fmt_count_planes(inlink->format);
+ desc = av_pix_fmt_desc_get(inlink->format);
+
+ for (i = 0; i < s->planes; i++) {
+ if (s->map[i] >= s->planes) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Non-existing input plane #%d mapped to output plane #%d.\n",
+ s->map[i], i);
+ return AVERROR(EINVAL);
+ }
+
+ if ((desc->log2_chroma_h || desc->log2_chroma_w) &&
+ (i == 1 || i == 2) != (s->map[i] == 1 || s->map[i] == 2)) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Cannot map between a subsampled chroma plane and a luma "
+ "or alpha plane.\n");
+ return AVERROR(EINVAL);
+ }
+
+ if ((desc->flags & AV_PIX_FMT_FLAG_PAL ||
+ desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) &&
+ (i == 1) != (s->map[i] == 1)) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Cannot map between a palette plane and a data plane.\n");
+ return AVERROR(EINVAL);
+ }
+ if (used[s->map[i]])
+ s->copy = 1;
+ used[s->map[i]]++;
+ }
+
+ return 0;
+}
+
+static int shuffleplanes_filter_frame(AVFilterLink *inlink, AVFrame *frame)
+{
+ AVFilterContext *ctx = inlink->dst;
+ ShufflePlanesContext *s = ctx->priv;
+ uint8_t *shuffled_data[4] = { NULL };
+ int shuffled_linesize[4] = { 0 };
+ int i, ret;
+
+ for (i = 0; i < s->planes; i++) {
+ shuffled_data[i] = frame->data[s->map[i]];
+ shuffled_linesize[i] = frame->linesize[s->map[i]];
+ }
+ memcpy(frame->data, shuffled_data, sizeof(shuffled_data));
+ memcpy(frame->linesize, shuffled_linesize, sizeof(shuffled_linesize));
+
+ if (s->copy) {
+ AVFrame *copy = ff_get_video_buffer(ctx->outputs[0], frame->width, frame->height);
+
+ if (!copy) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ av_frame_copy(copy, frame);
+
+ ret = av_frame_copy_props(copy, frame);
+ if (ret < 0) {
+ av_frame_free(&copy);
+ goto fail;
+ }
+
+ av_frame_free(&frame);
+ frame = copy;
+ }
+
+ return ff_filter_frame(ctx->outputs[0], frame);
+fail:
+ av_frame_free(&frame);
+ return ret;
+}
+
+#define OFFSET(x) offsetof(ShufflePlanesContext, x)
+#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
+static const AVOption shuffleplanes_options[] = {
+ { "map0", "Index of the input plane to be used as the first output plane ", OFFSET(map[0]), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 4, FLAGS },
+ { "map1", "Index of the input plane to be used as the second output plane ", OFFSET(map[1]), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 4, FLAGS },
+ { "map2", "Index of the input plane to be used as the third output plane ", OFFSET(map[2]), AV_OPT_TYPE_INT, { .i64 = 2 }, 0, 4, FLAGS },
+ { "map3", "Index of the input plane to be used as the fourth output plane ", OFFSET(map[3]), AV_OPT_TYPE_INT, { .i64 = 3 }, 0, 4, FLAGS },
+ { NULL },
+};
+
+static const AVClass shuffleplanes_class = {
+ .class_name = "shuffleplanes",
+ .item_name = av_default_item_name,
+ .option = shuffleplanes_options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static const AVFilterPad shuffleplanes_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = shuffleplanes_config_input,
+ .filter_frame = shuffleplanes_filter_frame,
+ .get_video_buffer = ff_null_get_video_buffer,
+ },
+ { NULL },
+};
+
+static const AVFilterPad shuffleplanes_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ },
+ { NULL },
+};
+
+AVFilter ff_vf_shuffleplanes = {
+ .name = "shuffleplanes",
+ .description = NULL_IF_CONFIG_SMALL("Shuffle video planes"),
+
+ .priv_size = sizeof(ShufflePlanesContext),
+ .priv_class = &shuffleplanes_class,
+
+ .inputs = shuffleplanes_inputs,
+ .outputs = shuffleplanes_outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_subtitles.c b/chromium/third_party/ffmpeg/libavfilter/vf_subtitles.c
index e44f61ddcd5..558e509e4eb 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_subtitles.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_subtitles.c
@@ -51,6 +51,7 @@ typedef struct {
ASS_Track *track;
char *filename;
char *charenc;
+ int stream_index;
uint8_t rgba_map[4];
int pix_step[4]; ///< steps per pixel for each plane of the main output
int original_w, original_h;
@@ -107,7 +108,6 @@ static av_cold int init(AVFilterContext *ctx)
return AVERROR(EINVAL);
}
- ass_set_fonts(ass->renderer, NULL, NULL, 1, NULL, 1);
return 0;
}
@@ -218,6 +218,9 @@ static av_cold int init_ass(AVFilterContext *ctx)
if (ret < 0)
return ret;
+ /* Initialize fonts */
+ ass_set_fonts(ass->renderer, NULL, NULL, 1, NULL, 1);
+
ass->track = ass_read_file(ass->library, ass->filename, NULL);
if (!ass->track) {
av_log(ctx, AV_LOG_ERROR,
@@ -245,15 +248,41 @@ AVFilter ff_vf_ass = {
static const AVOption subtitles_options[] = {
COMMON_OPTIONS
- {"charenc", "set input character encoding", OFFSET(charenc), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS},
+ {"charenc", "set input character encoding", OFFSET(charenc), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS},
+ {"stream_index", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS},
+ {"si", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS},
{NULL},
};
+static const char *font_mimetypes[] = {
+ "application/x-truetype-font",
+ "application/vnd.ms-opentype",
+ "application/x-font-ttf",
+ NULL
+};
+
+static int attachment_is_font(AVStream * st)
+{
+ const AVDictionaryEntry *tag = NULL;
+ int n;
+
+ tag = av_dict_get(st->metadata, "mimetype", NULL, AV_DICT_MATCH_CASE);
+
+ if (tag) {
+ for (n = 0; font_mimetypes[n]; n++) {
+ if (av_strcasecmp(font_mimetypes[n], tag->value) == 0)
+ return 1;
+ }
+ }
+ return 0;
+}
+
AVFILTER_DEFINE_CLASS(subtitles);
static av_cold int init_subtitles(AVFilterContext *ctx)
{
- int ret, sid;
+ int j, ret, sid;
+ int k = 0;
AVDictionary *codec_opts = NULL;
AVFormatContext *fmt = NULL;
AVCodecContext *dec_ctx = NULL;
@@ -284,7 +313,23 @@ static av_cold int init_subtitles(AVFilterContext *ctx)
goto end;
/* Locate subtitles stream */
- ret = av_find_best_stream(fmt, AVMEDIA_TYPE_SUBTITLE, -1, -1, NULL, 0);
+ if (ass->stream_index < 0)
+ ret = av_find_best_stream(fmt, AVMEDIA_TYPE_SUBTITLE, -1, -1, NULL, 0);
+ else {
+ ret = -1;
+ if (ass->stream_index < fmt->nb_streams) {
+ for (j = 0; j < fmt->nb_streams; j++) {
+ if (fmt->streams[j]->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
+ if (ass->stream_index == k) {
+ ret = j;
+ break;
+ }
+ k++;
+ }
+ }
+ }
+ }
+
if (ret < 0) {
av_log(ctx, AV_LOG_ERROR, "Unable to locate subtitle stream in %s\n",
ass->filename);
@@ -293,6 +338,31 @@ static av_cold int init_subtitles(AVFilterContext *ctx)
sid = ret;
st = fmt->streams[sid];
+ /* Load attached fonts */
+ for (j = 0; j < fmt->nb_streams; j++) {
+ AVStream *st = fmt->streams[j];
+ if (st->codec->codec_type == AVMEDIA_TYPE_ATTACHMENT &&
+ attachment_is_font(st)) {
+ const AVDictionaryEntry *tag = NULL;
+ tag = av_dict_get(st->metadata, "filename", NULL,
+ AV_DICT_MATCH_CASE);
+
+ if (tag) {
+ av_log(ctx, AV_LOG_DEBUG, "Loading attached font: %s\n",
+ tag->value);
+ ass_add_font(ass->library, tag->value,
+ st->codec->extradata,
+ st->codec->extradata_size);
+ } else {
+ av_log(ctx, AV_LOG_WARNING,
+ "Font attachment has no filename, ignored.\n");
+ }
+ }
+ }
+
+ /* Initialize fonts */
+ ass_set_fonts(ass->renderer, NULL, NULL, 1, NULL, 1);
+
/* Open decoder */
dec_ctx = st->codec;
dec = avcodec_find_decoder(dec_ctx->codec_id);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_tile.c b/chromium/third_party/ffmpeg/libavfilter/vf_tile.c
index 786f4f66304..459ae462ef9 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_tile.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_tile.c
@@ -113,7 +113,7 @@ static int config_props(AVFilterLink *outlink)
outlink->h = tile->h * inlink->h + total_margin_h;
outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
outlink->frame_rate = av_mul_q(inlink->frame_rate,
- (AVRational){ 1, tile->nb_frames });
+ av_make_q(1, tile->nb_frames));
ff_draw_init(&tile->draw, inlink->format, 0);
ff_draw_color(&tile->draw, &tile->blank, tile->rgba_color);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_tinterlace.c b/chromium/third_party/ffmpeg/libavfilter/vf_tinterlace.c
index db82393117d..3ebb9716465 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_tinterlace.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_tinterlace.c
@@ -145,6 +145,12 @@ static int config_out_props(AVFilterLink *outlink)
tinterlace->mode);
tinterlace->flags &= ~TINTERLACE_FLAG_VLPF;
}
+ if (tinterlace->mode == MODE_INTERLACEX2) {
+ outlink->time_base.num = inlink->time_base.num;
+ outlink->time_base.den = inlink->time_base.den * 2;
+ outlink->frame_rate = av_mul_q(inlink->frame_rate, (AVRational){2,1});
+ }
+
av_log(ctx, AV_LOG_VERBOSE, "mode:%d filter:%s h:%d -> h:%d\n",
tinterlace->mode, (tinterlace->flags & TINTERLACE_FLAG_VLPF) ? "on" : "off",
inlink->h, outlink->h);
@@ -321,6 +327,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
if (!out)
return AVERROR(ENOMEM);
out->interlaced_frame = 1;
+ if (cur->pts != AV_NOPTS_VALUE)
+ out->pts = cur->pts*2;
if ((ret = ff_filter_frame(outlink, out)) < 0)
return ret;
@@ -333,6 +341,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
av_frame_copy_props(out, next);
out->interlaced_frame = 1;
+ if (next->pts != AV_NOPTS_VALUE && cur->pts != AV_NOPTS_VALUE)
+ out->pts = cur->pts + next->pts;
+ else
+ out->pts = AV_NOPTS_VALUE;
/* write current frame second field lines into the second field of the new frame */
copy_picture_field(out->data, out->linesize,
(const uint8_t **)cur->data, cur->linesize,
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_transpose.c b/chromium/third_party/ffmpeg/libavfilter/vf_transpose.c
index 7e471d49a60..58ddd2cb966 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_transpose.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_transpose.c
@@ -27,11 +27,12 @@
#include <stdio.h>
-#include "libavutil/intreadwrite.h"
-#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
+#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
@@ -50,7 +51,7 @@ enum TransposeDir {
TRANSPOSE_CLOCK_FLIP,
};
-typedef struct {
+typedef struct TransContext {
const AVClass *class;
int hsub, vsub;
int pixsteps[4];
@@ -111,12 +112,14 @@ static int config_props_output(AVFilterLink *outlink)
outlink->w = inlink->h;
outlink->h = inlink->w;
- if (inlink->sample_aspect_ratio.num){
- outlink->sample_aspect_ratio = av_div_q((AVRational){1,1}, inlink->sample_aspect_ratio);
- } else
+ if (inlink->sample_aspect_ratio.num)
+ outlink->sample_aspect_ratio = av_div_q((AVRational) { 1, 1 },
+ inlink->sample_aspect_ratio);
+ else
outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
- av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d dir:%d -> w:%d h:%d rotation:%s vflip:%d\n",
+ av_log(ctx, AV_LOG_VERBOSE,
+ "w:%d h:%d dir:%d -> w:%d h:%d rotation:%s vflip:%d\n",
inlink->w, inlink->h, trans->dir, outlink->w, outlink->h,
trans->dir == 1 || trans->dir == 3 ? "clockwise" : "counterclockwise",
trans->dir == 0 || trans->dir == 3);
@@ -146,30 +149,30 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr,
int plane;
for (plane = 0; out->data[plane]; plane++) {
- int hsub = plane == 1 || plane == 2 ? trans->hsub : 0;
- int vsub = plane == 1 || plane == 2 ? trans->vsub : 0;
+ int hsub = plane == 1 || plane == 2 ? trans->hsub : 0;
+ int vsub = plane == 1 || plane == 2 ? trans->vsub : 0;
int pixstep = trans->pixsteps[plane];
- int inh = in->height >> vsub;
- int outw = FF_CEIL_RSHIFT(out->width, hsub);
- int outh = FF_CEIL_RSHIFT(out->height, vsub);
- int start = (outh * jobnr ) / nb_jobs;
- int end = (outh * (jobnr+1)) / nb_jobs;
+ int inh = in->height >> vsub;
+ int outw = FF_CEIL_RSHIFT(out->width, hsub);
+ int outh = FF_CEIL_RSHIFT(out->height, vsub);
+ int start = (outh * jobnr ) / nb_jobs;
+ int end = (outh * (jobnr+1)) / nb_jobs;
uint8_t *dst, *src;
int dstlinesize, srclinesize;
int x, y;
dstlinesize = out->linesize[plane];
- dst = out->data[plane] + start * dstlinesize;
- src = in->data[plane];
+ dst = out->data[plane] + start * dstlinesize;
+ src = in->data[plane];
srclinesize = in->linesize[plane];
- if (trans->dir&1) {
- src += in->linesize[plane] * (inh-1);
+ if (trans->dir & 1) {
+ src += in->linesize[plane] * (inh - 1);
srclinesize *= -1;
}
- if (trans->dir&2) {
- dst = out->data[plane] + dstlinesize * (outh-start-1);
+ if (trans->dir & 2) {
+ dst = out->data[plane] + dstlinesize * (outh - start - 1);
dstlinesize *= -1;
}
@@ -177,32 +180,34 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr,
case 1:
for (y = start; y < end; y++, dst += dstlinesize)
for (x = 0; x < outw; x++)
- dst[x] = src[x*srclinesize + y];
+ dst[x] = src[x * srclinesize + y];
break;
case 2:
for (y = start; y < end; y++, dst += dstlinesize) {
for (x = 0; x < outw; x++)
- *((uint16_t *)(dst + 2*x)) = *((uint16_t *)(src + x*srclinesize + y*2));
+ *((uint16_t *)(dst + 2 * x)) =
+ *((uint16_t *)(src + x * srclinesize + y * 2));
}
break;
case 3:
for (y = start; y < end; y++, dst += dstlinesize) {
for (x = 0; x < outw; x++) {
- int32_t v = AV_RB24(src + x*srclinesize + y*3);
- AV_WB24(dst + 3*x, v);
+ int32_t v = AV_RB24(src + x * srclinesize + y * 3);
+ AV_WB24(dst + 3 * x, v);
}
}
break;
case 4:
for (y = start; y < end; y++, dst += dstlinesize) {
for (x = 0; x < outw; x++)
- *((uint32_t *)(dst + 4*x)) = *((uint32_t *)(src + x*srclinesize + y*4));
+ *((uint32_t *)(dst + 4 * x)) =
+ *((uint32_t *)(src + x * srclinesize + y * 4));
}
break;
case 6:
for (y = start; y < end; y++, dst += dstlinesize) {
for (x = 0; x < outw; x++) {
- int64_t v = AV_RB48(src + x*srclinesize + y*6);
+ int64_t v = AV_RB48(src + x * srclinesize + y*6);
AV_WB48(dst + 6*x, v);
}
}
@@ -210,7 +215,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr,
case 8:
for (y = start; y < end; y++, dst += dstlinesize) {
for (x = 0; x < outw; x++)
- *((uint64_t *)(dst + 8*x)) = *((uint64_t *)(src + x*srclinesize + y*8));
+ *((uint64_t *)(dst + 8*x)) = *((uint64_t *)(src + x * srclinesize + y*8));
}
break;
}
@@ -273,10 +278,10 @@ AVFILTER_DEFINE_CLASS(transpose);
static const AVFilterPad avfilter_vf_transpose_inputs[] = {
{
- .name = "default",
- .type = AVMEDIA_TYPE_VIDEO,
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = get_video_buffer,
- .filter_frame = filter_frame,
+ .filter_frame = filter_frame,
},
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_vflip.c b/chromium/third_party/ffmpeg/libavfilter/vf_vflip.c
index f6908e46ab4..4a4ae0e5e1d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_vflip.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_vflip.c
@@ -29,7 +29,7 @@
#include "internal.h"
#include "video.h"
-typedef struct {
+typedef struct FlipContext {
int vsub; ///< vertical chroma subsampling
} FlipContext;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_vidstabdetect.c b/chromium/third_party/ffmpeg/libavfilter/vf_vidstabdetect.c
index b2977ff7300..9b4b20f47f4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_vidstabdetect.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_vidstabdetect.c
@@ -49,7 +49,7 @@ static const AVOption vidstabdetect_options[] = {
{"result", "path to the file used to write the transforms", OFFSET(result), AV_OPT_TYPE_STRING, {.str = DEFAULT_RESULT_NAME}, .flags = FLAGS},
{"shakiness", "how shaky is the video and how quick is the camera?"
" 1: little (fast) 10: very strong/quick (slow)", OFFSETC(shakiness), AV_OPT_TYPE_INT, {.i64 = 5}, 1, 10, FLAGS},
- {"accuracy", "(>=shakiness) 1: low 15: high (slow)", OFFSETC(accuracy), AV_OPT_TYPE_INT, {.i64 = 9}, 1, 15, FLAGS},
+ {"accuracy", "(>=shakiness) 1: low 15: high (slow)", OFFSETC(accuracy), AV_OPT_TYPE_INT, {.i64 = 15}, 1, 15, FLAGS},
{"stepsize", "region around minimum is scanned with 1 pixel resolution", OFFSETC(stepSize), AV_OPT_TYPE_INT, {.i64 = 6}, 1, 32, FLAGS},
{"mincontrast", "below this contrast a field is discarded (0-1)", OFFSETC(contrastThreshold), AV_OPT_TYPE_DOUBLE, {.dbl = 0.25}, 0.0, 1.0, FLAGS},
{"show", "0: draw nothing; 1,2: show fields and transforms", OFFSETC(show), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 2, FLAGS},
@@ -135,6 +135,7 @@ static int config_input(AVFilterLink *inlink)
av_log(ctx, AV_LOG_INFO, " accuracy = %d\n", sd->conf.accuracy);
av_log(ctx, AV_LOG_INFO, " stepsize = %d\n", sd->conf.stepSize);
av_log(ctx, AV_LOG_INFO, " mincontrast = %f\n", sd->conf.contrastThreshold);
+ av_log(ctx, AV_LOG_INFO, " tripod = %d\n", sd->conf.virtualTripod);
av_log(ctx, AV_LOG_INFO, " show = %d\n", sd->conf.show);
av_log(ctx, AV_LOG_INFO, " result = %s\n", sd->result);
@@ -151,7 +152,6 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
-
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterContext *ctx = inlink->dst;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_vidstabtransform.c b/chromium/third_party/ffmpeg/libavfilter/vf_vidstabtransform.c
index 3c0a5ee40d6..80968aedccc 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_vidstabtransform.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_vidstabtransform.c
@@ -39,6 +39,7 @@ typedef struct {
VSTransformations trans; // transformations
char *input; // name of transform file
int tripod;
+ int debug;
} TransformContext;
#define OFFSET(x) offsetof(TransformContext, x)
@@ -46,29 +47,44 @@ typedef struct {
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static const AVOption vidstabtransform_options[] = {
- {"input", "path to the file storing the transforms", OFFSET(input),
+ {"input", "set path to the file storing the transforms", OFFSET(input),
AV_OPT_TYPE_STRING, {.str = DEFAULT_INPUT_NAME}, .flags = FLAGS },
- {"smoothing", "number of frames*2 + 1 used for lowpass filtering", OFFSETC(smoothing),
- AV_OPT_TYPE_INT, {.i64 = 10}, 1, 1000, FLAGS},
- {"maxshift", "maximal number of pixels to translate image", OFFSETC(maxShift),
+ {"smoothing", "set number of frames*2 + 1 used for lowpass filtering", OFFSETC(smoothing),
+ AV_OPT_TYPE_INT, {.i64 = 15}, 0, 1000, FLAGS},
+
+ {"optalgo", "set camera path optimization algo", OFFSETC(camPathAlgo),
+ AV_OPT_TYPE_INT, {.i64 = VSOptimalL1}, VSOptimalL1, VSAvg, FLAGS, "optalgo"},
+ { "opt", "global optimization", 0, // from version 1.0 on
+ AV_OPT_TYPE_CONST, {.i64 = VSOptimalL1 }, 0, 0, FLAGS, "optalgo"},
+ { "gauss", "gaussian kernel", 0,
+ AV_OPT_TYPE_CONST, {.i64 = VSGaussian }, 0, 0, FLAGS, "optalgo"},
+ { "avg", "simple averaging on motion", 0,
+ AV_OPT_TYPE_CONST, {.i64 = VSAvg }, 0, 0, FLAGS, "optalgo"},
+
+ {"maxshift", "set maximal number of pixels to translate image", OFFSETC(maxShift),
AV_OPT_TYPE_INT, {.i64 = -1}, -1, 500, FLAGS},
- {"maxangle", "maximal angle in rad to rotate image", OFFSETC(maxAngle),
+ {"maxangle", "set maximal angle in rad to rotate image", OFFSETC(maxAngle),
AV_OPT_TYPE_DOUBLE, {.dbl = -1.0}, -1.0, 3.14, FLAGS},
- {"crop", "set cropping mode", OFFSETC(crop),
+
+ {"crop", "set cropping mode", OFFSETC(crop),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS, "crop"},
{ "keep", "keep border", 0,
AV_OPT_TYPE_CONST, {.i64 = VSKeepBorder }, 0, 0, FLAGS, "crop"},
{ "black", "black border", 0,
AV_OPT_TYPE_CONST, {.i64 = VSCropBorder }, 0, 0, FLAGS, "crop"},
- {"invert", "1: invert transforms", OFFSETC(invert),
+
+ {"invert", "invert transforms", OFFSETC(invert),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
- {"relative", "consider transforms as 0: absolute, 1: relative", OFFSETC(relative),
+ {"relative", "consider transforms as relative", OFFSETC(relative),
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, FLAGS},
- {"zoom", "percentage to zoom >0: zoom in, <0 zoom out", OFFSETC(zoom),
+ {"zoom", "set percentage to zoom (>0: zoom in, <0: zoom out", OFFSETC(zoom),
AV_OPT_TYPE_DOUBLE, {.dbl = 0}, -100, 100, FLAGS},
- {"optzoom", "0: nothing, 1: determine optimal zoom (added to 'zoom')", OFFSETC(optZoom),
+ {"optzoom", "set optimal zoom (0: nothing, 1: optimal static zoom, 2: optimal dynamic zoom)", OFFSETC(optZoom),
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 2, FLAGS},
- {"interpol", "type of interpolation", OFFSETC(interpolType),
+ {"zoomspeed", "for adative zoom: percent to zoom maximally each frame", OFFSETC(zoomSpeed),
+ AV_OPT_TYPE_DOUBLE, {.dbl = 0.25}, 0, 5, FLAGS},
+
+ {"interpol", "set type of interpolation", OFFSETC(interpolType),
AV_OPT_TYPE_INT, {.i64 = 2}, 0, 3, FLAGS, "interpol"},
{ "no", "no interpolation", 0,
AV_OPT_TYPE_CONST, {.i64 = VS_Zero }, 0, 0, FLAGS, "interpol"},
@@ -78,7 +94,10 @@ static const AVOption vidstabtransform_options[] = {
AV_OPT_TYPE_CONST, {.i64 = VS_BiLinear},0, 0, FLAGS, "interpol"},
{ "bicubic", "bi-cubic", 0,
AV_OPT_TYPE_CONST, {.i64 = VS_BiCubic },0, 0, FLAGS, "interpol"},
- {"tripod", "if 1: virtual tripod mode (equiv. to relative=0:smoothing=0)", OFFSET(tripod),
+
+ {"tripod", "enable virtual tripod mode (same as relative=0:smoothing=0)", OFFSET(tripod),
+ AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
+ {"debug", "enable debug mode and writer global motions information to file", OFFSET(debug),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
{NULL}
};
@@ -153,12 +172,15 @@ static int config_input(AVFilterLink *inlink)
// set values that are not initializes by the options
tc->conf.modName = "vidstabtransform";
- tc->conf.verbose =1;
+ tc->conf.verbose = 1 + tc->debug;
if (tc->tripod) {
- av_log(ctx, AV_LOG_INFO, "Virtual tripod mode: relative=0, smoothing=0");
+ av_log(ctx, AV_LOG_INFO, "Virtual tripod mode: relative=0, smoothing=0\n");
tc->conf.relative = 0;
tc->conf.smoothing = 0;
}
+ tc->conf.simpleMotionCalculation = 0;
+ tc->conf.storeTransforms = tc->debug;
+ tc->conf.smoothZoom = 0;
if (vsTransformDataInit(td, &tc->conf, &fi_src, &fi_dest) != VS_OK) {
av_log(ctx, AV_LOG_ERROR, "initialization of vid.stab transform failed, please report a BUG\n");
@@ -169,13 +191,19 @@ static int config_input(AVFilterLink *inlink)
av_log(ctx, AV_LOG_INFO, "Video transformation/stabilization settings (pass 2/2):\n");
av_log(ctx, AV_LOG_INFO, " input = %s\n", tc->input);
av_log(ctx, AV_LOG_INFO, " smoothing = %d\n", tc->conf.smoothing);
+ av_log(ctx, AV_LOG_INFO, " optalgo = %s\n",
+ tc->conf.camPathAlgo == VSOptimalL1 ? "opt" :
+ (tc->conf.camPathAlgo == VSGaussian ? "gauss" : "avg"));
av_log(ctx, AV_LOG_INFO, " maxshift = %d\n", tc->conf.maxShift);
av_log(ctx, AV_LOG_INFO, " maxangle = %f\n", tc->conf.maxAngle);
av_log(ctx, AV_LOG_INFO, " crop = %s\n", tc->conf.crop ? "Black" : "Keep");
av_log(ctx, AV_LOG_INFO, " relative = %s\n", tc->conf.relative ? "True": "False");
av_log(ctx, AV_LOG_INFO, " invert = %s\n", tc->conf.invert ? "True" : "False");
av_log(ctx, AV_LOG_INFO, " zoom = %f\n", tc->conf.zoom);
- av_log(ctx, AV_LOG_INFO, " optzoom = %s\n", tc->conf.optZoom ? "On" : "Off");
+ av_log(ctx, AV_LOG_INFO, " optzoom = %s\n",
+ tc->conf.optZoom == 1 ? "Static (1)" : (tc->conf.optZoom == 2 ? "Dynamic (2)" : "Off (0)"));
+ if (tc->conf.optZoom == 2)
+ av_log(ctx, AV_LOG_INFO, " zoomspeed = %g\n", tc->conf.zoomSpeed);
av_log(ctx, AV_LOG_INFO, " interpol = %s\n", getInterpolationTypeName(tc->conf.interpolType));
f = fopen(tc->input, "r");
@@ -186,7 +214,7 @@ static int config_input(AVFilterLink *inlink)
VSManyLocalMotions mlms;
if (vsReadLocalMotionsFile(f, &mlms) == VS_OK) {
// calculate the actual transforms from the local motions
- if (vsLocalmotions2TransformsSimple(td, &mlms, &tc->trans) != VS_OK) {
+ if (vsLocalmotions2Transforms(td, &mlms, &tc->trans) != VS_OK) {
av_log(ctx, AV_LOG_ERROR, "calculating transformations failed\n");
return AVERROR(EINVAL);
}
@@ -199,7 +227,7 @@ static int config_input(AVFilterLink *inlink)
}
fclose(f);
- if (vsPreprocessTransforms(td, &tc->trans) != VS_OK ) {
+ if (vsPreprocessTransforms(td, &tc->trans) != VS_OK) {
av_log(ctx, AV_LOG_ERROR, "error while preprocessing transforms\n");
return AVERROR(EINVAL);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_yadif.c b/chromium/third_party/ffmpeg/libavfilter/vf_yadif.c
index 40383a4d06b..70670c3eb9d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_yadif.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_yadif.c
@@ -2,19 +2,19 @@
* Copyright (C) 2006-2011 Michael Niedermayer <michaelni@gmx.at>
* 2010 James Darnley <james.darnley@gmail.com>
*
- * FFmpeg is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * 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 General Public License for more details.
+ * 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 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.
+ * 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 "libavutil/avassert.h"
@@ -23,15 +23,12 @@
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "yadif.h"
-
typedef struct ThreadData {
AVFrame *frame;
int plane;
@@ -40,42 +37,13 @@ typedef struct ThreadData {
int tff;
} ThreadData;
-typedef struct YADIFContext {
- const AVClass *class;
-
- enum YADIFMode mode;
- enum YADIFParity parity;
- enum YADIFDeint deint;
-
- int frame_pending;
-
- AVFrame *cur;
- AVFrame *next;
- AVFrame *prev;
- AVFrame *out;
-
- /**
- * Required alignment for filter_line
- */
- void (*filter_line)(void *dst,
- void *prev, void *cur, void *next,
- int w, int prefs, int mrefs, int parity, int mode);
- void (*filter_edges)(void *dst, void *prev, void *cur, void *next,
- int w, int prefs, int mrefs, int parity, int mode);
-
- const AVPixFmtDescriptor *csp;
- int eof;
- uint8_t *temp_line;
- int temp_line_size;
-} YADIFContext;
-
#define CHECK(j)\
- { int score = FFABS(cur[mrefs - 1 + j] - cur[prefs - 1 - j])\
- + FFABS(cur[mrefs + j] - cur[prefs - j])\
- + FFABS(cur[mrefs + 1 + j] - cur[prefs + 1 - j]);\
+ { int score = FFABS(cur[mrefs - 1 + (j)] - cur[prefs - 1 - (j)])\
+ + FFABS(cur[mrefs +(j)] - cur[prefs -(j)])\
+ + FFABS(cur[mrefs + 1 + (j)] - cur[prefs + 1 - (j)]);\
if (score < spatial_score) {\
spatial_score= score;\
- spatial_pred= (cur[mrefs + j] + cur[prefs - j])>>1;\
+ spatial_pred= (cur[mrefs +(j)] + cur[prefs -(j)])>>1;\
/* The is_not_edge argument here controls when the code will enter a branch
* which reads up to and including x-3 and x+3. */
@@ -357,8 +325,9 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
yadif->cur = yadif->next;
yadif->next = frame;
- if (!yadif->cur)
- return 0;
+ if (!yadif->cur &&
+ !(yadif->cur = av_frame_clone(yadif->next)))
+ return AVERROR(ENOMEM);
if (checkstride(yadif, yadif->next, yadif->cur)) {
av_log(ctx, AV_LOG_VERBOSE, "Reallocating frame due to differing stride\n");
@@ -384,9 +353,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
return ff_filter_frame(ctx->outputs[0], yadif->out);
}
- if (!yadif->prev &&
- !(yadif->prev = av_frame_clone(yadif->cur)))
- return AVERROR(ENOMEM);
+ if (!yadif->prev)
+ return 0;
yadif->out = ff_get_video_buffer(ctx->outputs[0], link->w, link->h);
if (!yadif->out)
@@ -432,7 +400,7 @@ static int request_frame(AVFilterLink *link)
} else if (ret < 0) {
return ret;
}
- } while (!yadif->cur);
+ } while (!yadif->prev);
return 0;
}
@@ -493,9 +461,6 @@ static int config_props(AVFilterLink *link)
{
AVFilterContext *ctx = link->src;
YADIFContext *s = link->src->priv;
- int cpu_flags = av_get_cpu_flags();
- int bit_depth = (!s->csp) ? 8
- : s->csp->comp[0].depth_minus1 + 1;
link->time_base.num = link->src->inputs[0]->time_base.num;
link->time_base.den = link->src->inputs[0]->time_base.den * 2;
@@ -519,38 +484,9 @@ static int config_props(AVFilterLink *link)
s->filter_edges = filter_edges;
}
-#if HAVE_YASM
- if (bit_depth >= 15) {
- if (EXTERNAL_SSE4(cpu_flags))
- s->filter_line = ff_yadif_filter_line_16bit_sse4;
- else if (EXTERNAL_SSSE3(cpu_flags))
- s->filter_line = ff_yadif_filter_line_16bit_ssse3;
- else if (EXTERNAL_SSE2(cpu_flags))
- s->filter_line = ff_yadif_filter_line_16bit_sse2;
-#if ARCH_X86_32
- else if (EXTERNAL_MMXEXT(cpu_flags))
- s->filter_line = ff_yadif_filter_line_16bit_mmxext;
-#endif /* ARCH_X86_32 */
- } else if ( bit_depth >= 9 && bit_depth <= 14) {
- if (EXTERNAL_SSSE3(cpu_flags))
- s->filter_line = ff_yadif_filter_line_10bit_ssse3;
- else if (EXTERNAL_SSE2(cpu_flags))
- s->filter_line = ff_yadif_filter_line_10bit_sse2;
-#if ARCH_X86_32
- else if (EXTERNAL_MMXEXT(cpu_flags))
- s->filter_line = ff_yadif_filter_line_10bit_mmxext;
-#endif /* ARCH_X86_32 */
- } else {
- if (EXTERNAL_SSSE3(cpu_flags))
- s->filter_line = ff_yadif_filter_line_ssse3;
- else if (EXTERNAL_SSE2(cpu_flags))
- s->filter_line = ff_yadif_filter_line_sse2;
-#if ARCH_X86_32
- else if (EXTERNAL_MMXEXT(cpu_flags))
- s->filter_line = ff_yadif_filter_line_mmxext;
-#endif /* ARCH_X86_32 */
- }
-#endif /* HAVE_YASM */
+ if (ARCH_X86)
+ ff_yadif_init_x86(s);
+
return 0;
}
@@ -581,6 +517,25 @@ static const AVOption yadif_options[] = {
AVFILTER_DEFINE_CLASS(yadif);
+static const AVFilterPad avfilter_vf_yadif_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad avfilter_vf_yadif_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .request_frame = request_frame,
+ .config_props = config_props,
+ },
+ { NULL }
+};
+
AVFilter ff_vf_yadif = {
.name = "yadif",
.description = NULL_IF_CONFIG_SMALL("Deinterlace the input image."),
@@ -588,19 +543,7 @@ AVFilter ff_vf_yadif = {
.priv_class = &yadif_class,
.uninit = uninit,
.query_formats = query_formats,
-
- .inputs = (const AVFilterPad[]) {{ .name = "default",
- .type = AVMEDIA_TYPE_VIDEO,
- .filter_frame = filter_frame,
- },
- { .name = NULL}},
-
- .outputs = (const AVFilterPad[]) {{ .name = "default",
- .type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
- .config_props = config_props,
- },
- { .name = NULL}},
-
+ .inputs = avfilter_vf_yadif_inputs,
+ .outputs = avfilter_vf_yadif_outputs,
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vsrc_mandelbrot.c b/chromium/third_party/ffmpeg/libavfilter/vsrc_mandelbrot.c
index 19dddf9727d..255f2db6aa7 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vsrc_mandelbrot.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vsrc_mandelbrot.c
@@ -130,9 +130,9 @@ static av_cold int init(AVFilterContext *ctx)
mb->cache_allocated = mb->w * mb->h * 3;
mb->cache_used = 0;
- mb->point_cache= av_malloc(sizeof(*mb->point_cache)*mb->cache_allocated);
- mb-> next_cache= av_malloc(sizeof(*mb-> next_cache)*mb->cache_allocated);
- mb-> zyklus = av_malloc(sizeof(*mb->zyklus) * (mb->maxiter+16));
+ mb->point_cache= av_malloc_array(mb->cache_allocated, sizeof(*mb->point_cache));
+ mb-> next_cache= av_malloc_array(mb->cache_allocated, sizeof(*mb-> next_cache));
+ mb-> zyklus = av_malloc_array(mb->maxiter + 16, sizeof(*mb->zyklus));
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vsrc_testsrc.c b/chromium/third_party/ffmpeg/libavfilter/vsrc_testsrc.c
index 0ad14741930..88144407605 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vsrc_testsrc.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vsrc_testsrc.c
@@ -47,7 +47,7 @@
#include "internal.h"
#include "video.h"
-typedef struct {
+typedef struct TestSourceContext {
const AVClass *class;
int w, h;
unsigned int nb_frame;
@@ -488,7 +488,7 @@ static void draw_digit(int digit, uint8_t *dst, int dst_linesize,
#define LEFT_BOT_VBAR 16
#define RIGHT_TOP_VBAR 32
#define RIGHT_BOT_VBAR 64
- struct {
+ struct segments {
int x, y, w, h;
} segments[] = {
{ 1, 0, 5, 1 }, /* TOP_HBAR */
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/Makefile b/chromium/third_party/ffmpeg/libavfilter/x86/Makefile
index be4ad83ebc4..6a252b40bf7 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/Makefile
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/Makefile
@@ -3,6 +3,7 @@ OBJS-$(CONFIG_HQDN3D_FILTER) += x86/vf_hqdn3d_init.o
OBJS-$(CONFIG_PULLUP_FILTER) += x86/vf_pullup_init.o
OBJS-$(CONFIG_SPP_FILTER) += x86/vf_spp.o
OBJS-$(CONFIG_VOLUME_FILTER) += x86/af_volume_init.o
+OBJS-$(CONFIG_YADIF_FILTER) += x86/vf_yadif_init.o
YASM-OBJS-$(CONFIG_GRADFUN_FILTER) += x86/vf_gradfun.o
YASM-OBJS-$(CONFIG_HQDN3D_FILTER) += x86/vf_hqdn3d.o
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif.asm b/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif.asm
index ebc505c6387..4b80bf3d7c4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif.asm
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif.asm
@@ -6,19 +6,19 @@
;*
;* This file is part of FFmpeg.
;*
-;* FFmpeg is free software; you can redistribute it and/or modify
-;* it under the terms of the GNU General Public License as published by
-;* the Free Software Foundation; either version 2 of the License, or
-;* (at your option) any later version.
+;* 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 General Public License for more details.
+;* 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 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.
+;* 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 "libavutil/x86/x86util.asm"
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif_init.c b/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif_init.c
new file mode 100644
index 00000000000..1460a642c38
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif_init.c
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2006 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 "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/mem.h"
+#include "libavutil/x86/asm.h"
+#include "libavutil/x86/cpu.h"
+#include "libavfilter/yadif.h"
+
+void ff_yadif_filter_line_mmxext(void *dst, void *prev, void *cur,
+ void *next, int w, int prefs,
+ int mrefs, int parity, int mode);
+void ff_yadif_filter_line_sse2(void *dst, void *prev, void *cur,
+ void *next, int w, int prefs,
+ int mrefs, int parity, int mode);
+void ff_yadif_filter_line_ssse3(void *dst, void *prev, void *cur,
+ void *next, int w, int prefs,
+ int mrefs, int parity, int mode);
+
+void ff_yadif_filter_line_16bit_mmxext(void *dst, void *prev, void *cur,
+ void *next, int w, int prefs,
+ int mrefs, int parity, int mode);
+void ff_yadif_filter_line_16bit_sse2(void *dst, void *prev, void *cur,
+ void *next, int w, int prefs,
+ int mrefs, int parity, int mode);
+void ff_yadif_filter_line_16bit_ssse3(void *dst, void *prev, void *cur,
+ void *next, int w, int prefs,
+ int mrefs, int parity, int mode);
+void ff_yadif_filter_line_16bit_sse4(void *dst, void *prev, void *cur,
+ void *next, int w, int prefs,
+ int mrefs, int parity, int mode);
+
+void ff_yadif_filter_line_10bit_mmxext(void *dst, void *prev, void *cur,
+ void *next, int w, int prefs,
+ int mrefs, int parity, int mode);
+void ff_yadif_filter_line_10bit_sse2(void *dst, void *prev, void *cur,
+ void *next, int w, int prefs,
+ int mrefs, int parity, int mode);
+void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur,
+ void *next, int w, int prefs,
+ int mrefs, int parity, int mode);
+
+av_cold void ff_yadif_init_x86(YADIFContext *yadif)
+{
+ int cpu_flags = av_get_cpu_flags();
+ int bit_depth = (!yadif->csp) ? 8
+ : yadif->csp->comp[0].depth_minus1 + 1;
+
+ if (bit_depth >= 15) {
+#if ARCH_X86_32
+ if (EXTERNAL_MMXEXT(cpu_flags))
+ yadif->filter_line = ff_yadif_filter_line_16bit_mmxext;
+#endif /* ARCH_X86_32 */
+ if (EXTERNAL_SSE2(cpu_flags))
+ yadif->filter_line = ff_yadif_filter_line_16bit_sse2;
+ if (EXTERNAL_SSSE3(cpu_flags))
+ yadif->filter_line = ff_yadif_filter_line_16bit_ssse3;
+ if (EXTERNAL_SSE4(cpu_flags))
+ yadif->filter_line = ff_yadif_filter_line_16bit_sse4;
+ } else if ( bit_depth >= 9 && bit_depth <= 14) {
+#if ARCH_X86_32
+ if (EXTERNAL_MMXEXT(cpu_flags))
+ yadif->filter_line = ff_yadif_filter_line_10bit_mmxext;
+#endif /* ARCH_X86_32 */
+ if (EXTERNAL_SSE2(cpu_flags))
+ yadif->filter_line = ff_yadif_filter_line_10bit_sse2;
+ if (EXTERNAL_SSSE3(cpu_flags))
+ yadif->filter_line = ff_yadif_filter_line_10bit_ssse3;
+ } else {
+#if ARCH_X86_32
+ if (EXTERNAL_MMXEXT(cpu_flags))
+ yadif->filter_line = ff_yadif_filter_line_mmxext;
+#endif /* ARCH_X86_32 */
+ if (EXTERNAL_SSE2(cpu_flags))
+ yadif->filter_line = ff_yadif_filter_line_sse2;
+ if (EXTERNAL_SSSE3(cpu_flags))
+ yadif->filter_line = ff_yadif_filter_line_ssse3;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/yadif-10.asm b/chromium/third_party/ffmpeg/libavfilter/x86/yadif-10.asm
index d586deb6f62..9a6385ac4df 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/yadif-10.asm
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/yadif-10.asm
@@ -7,19 +7,19 @@
;*
;* This file is part of FFmpeg.
;*
-;* FFmpeg is free software; you can redistribute it and/or modify
-;* it under the terms of the GNU General Public License as published by
-;* the Free Software Foundation; either version 2 of the License, or
-;* (at your option) any later version.
+;* 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 General Public License for more details.
+;* 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 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.
+;* 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 "libavutil/x86/x86util.asm"
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/yadif-16.asm b/chromium/third_party/ffmpeg/libavfilter/x86/yadif-16.asm
index a2e6006253e..d6dcd3a4031 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/yadif-16.asm
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/yadif-16.asm
@@ -7,19 +7,19 @@
;*
;* This file is part of FFmpeg.
;*
-;* FFmpeg is free software; you can redistribute it and/or modify
-;* it under the terms of the GNU General Public License as published by
-;* the Free Software Foundation; either version 2 of the License, or
-;* (at your option) any later version.
+;* 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 General Public License for more details.
+;* 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 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.
+;* 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 "libavutil/x86/x86util.asm"
diff --git a/chromium/third_party/ffmpeg/libavfilter/yadif.h b/chromium/third_party/ffmpeg/libavfilter/yadif.h
index 5afe01424b0..07f2cc9b6f1 100644
--- a/chromium/third_party/ffmpeg/libavfilter/yadif.h
+++ b/chromium/third_party/ffmpeg/libavfilter/yadif.h
@@ -1,24 +1,25 @@
/*
* This file is part of FFmpeg.
*
- * FFmpeg is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * 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 General Public License for more details.
+ * 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 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.
+ * 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 AVFILTER_YADIF_H
#define AVFILTER_YADIF_H
+#include "libavutil/pixdesc.h"
#include "avfilter.h"
enum YADIFMode {
@@ -39,37 +40,35 @@ enum YADIFDeint {
YADIF_DEINT_INTERLACED = 1, ///< only deinterlace frames marked as interlaced
};
-void ff_yadif_filter_line_mmxext(void *dst, void *prev, void *cur,
- void *next, int w, int prefs,
- int mrefs, int parity, int mode);
-void ff_yadif_filter_line_sse2(void *dst, void *prev, void *cur,
- void *next, int w, int prefs,
- int mrefs, int parity, int mode);
-void ff_yadif_filter_line_ssse3(void *dst, void *prev, void *cur,
- void *next, int w, int prefs,
- int mrefs, int parity, int mode);
+typedef struct YADIFContext {
+ const AVClass *class;
-void ff_yadif_filter_line_16bit_mmxext(void *dst, void *prev, void *cur,
- void *next, int w, int prefs,
- int mrefs, int parity, int mode);
-void ff_yadif_filter_line_16bit_sse2(void *dst, void *prev, void *cur,
- void *next, int w, int prefs,
- int mrefs, int parity, int mode);
-void ff_yadif_filter_line_16bit_ssse3(void *dst, void *prev, void *cur,
- void *next, int w, int prefs,
- int mrefs, int parity, int mode);
-void ff_yadif_filter_line_16bit_sse4(void *dst, void *prev, void *cur,
- void *next, int w, int prefs,
- int mrefs, int parity, int mode);
+ enum YADIFMode mode;
+ enum YADIFParity parity;
+ enum YADIFDeint deint;
-void ff_yadif_filter_line_10bit_mmxext(void *dst, void *prev, void *cur,
- void *next, int w, int prefs,
- int mrefs, int parity, int mode);
-void ff_yadif_filter_line_10bit_sse2(void *dst, void *prev, void *cur,
- void *next, int w, int prefs,
- int mrefs, int parity, int mode);
-void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur,
- void *next, int w, int prefs,
- int mrefs, int parity, int mode);
+ int frame_pending;
+
+ AVFrame *cur;
+ AVFrame *next;
+ AVFrame *prev;
+ AVFrame *out;
+
+ /**
+ * Required alignment for filter_line
+ */
+ void (*filter_line)(void *dst,
+ void *prev, void *cur, void *next,
+ int w, int prefs, int mrefs, int parity, int mode);
+ void (*filter_edges)(void *dst, void *prev, void *cur, void *next,
+ int w, int prefs, int mrefs, int parity, int mode);
+
+ const AVPixFmtDescriptor *csp;
+ int eof;
+ uint8_t *temp_line;
+ int temp_line_size;
+} YADIFContext;
+
+void ff_yadif_init_x86(YADIFContext *yadif);
#endif /* AVFILTER_YADIF_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/4xm.c b/chromium/third_party/ffmpeg/libavformat/4xm.c
index 6e63c673993..23279c42fb7 100644
--- a/chromium/third_party/ffmpeg/libavformat/4xm.c
+++ b/chromium/third_party/ffmpeg/libavformat/4xm.c
@@ -319,8 +319,10 @@ static int fourxm_read_packet(AVFormatContext *s,
if (ret < 0) {
av_free_packet(pkt);
- } else
+ } else {
packet_read = 1;
+ av_shrink_packet(pkt, ret + 8);
+ }
break;
case snd__TAG:
diff --git a/chromium/third_party/ffmpeg/libavformat/Makefile b/chromium/third_party/ffmpeg/libavformat/Makefile
index cf3352b96de..00358e771b9 100644
--- a/chromium/third_party/ffmpeg/libavformat/Makefile
+++ b/chromium/third_party/ffmpeg/libavformat/Makefile
@@ -1,7 +1,6 @@
include $(SUBDIR)../config.mak
NAME = avformat
-FFLIBS = avcodec avutil
HEADERS = avformat.h \
avio.h \
@@ -50,7 +49,7 @@ OBJS-$(CONFIG_RTPDEC) += rdt.o \
rtpdec_xiph.o \
srtp.o
OBJS-$(CONFIG_RTPENC_CHAIN) += rtpenc_chain.o rtp.o
-OBJS-$(CONFIG_SHARED) += log2_tab.o
+OBJS-$(CONFIG_SHARED) += log2_tab.o golomb_tab.o
# muxers/demuxers
OBJS-$(CONFIG_A64_MUXER) += a64.o rawenc.o
@@ -62,7 +61,7 @@ OBJS-$(CONFIG_ADF_DEMUXER) += bintext.o sauce.o
OBJS-$(CONFIG_ADP_DEMUXER) += adp.o
OBJS-$(CONFIG_ADX_DEMUXER) += adxdec.o
OBJS-$(CONFIG_ADX_MUXER) += rawenc.o
-OBJS-$(CONFIG_ADTS_MUXER) += adtsenc.o apetag.o
+OBJS-$(CONFIG_ADTS_MUXER) += adtsenc.o apetag.o img2.o
OBJS-$(CONFIG_AEA_DEMUXER) += aea.o pcm.o
OBJS-$(CONFIG_AFC_DEMUXER) += afc.o
OBJS-$(CONFIG_AIFF_DEMUXER) += aiffdec.o pcm.o isom.o \
@@ -84,7 +83,7 @@ OBJS-$(CONFIG_AST_MUXER) += ast.o astenc.o
OBJS-$(CONFIG_AU_DEMUXER) += au.o pcm.o
OBJS-$(CONFIG_AU_MUXER) += au.o rawenc.o
OBJS-$(CONFIG_AVI_DEMUXER) += avidec.o
-OBJS-$(CONFIG_AVI_MUXER) += avienc.o
+OBJS-$(CONFIG_AVI_MUXER) += avienc.o avlanguage.o
OBJS-$(CONFIG_AVISYNTH) += avisynth.o
OBJS-$(CONFIG_AVM2_MUXER) += swfenc.o swf.o
OBJS-$(CONFIG_AVR_DEMUXER) += avr.o pcm.o
@@ -106,6 +105,7 @@ OBJS-$(CONFIG_CAVSVIDEO_DEMUXER) += cavsvideodec.o rawdec.o
OBJS-$(CONFIG_CAVSVIDEO_MUXER) += rawenc.o
OBJS-$(CONFIG_CDG_DEMUXER) += cdg.o
OBJS-$(CONFIG_CDXL_DEMUXER) += cdxl.o
+OBJS-$(CONFIG_CINE_DEMUXER) += cinedec.o
OBJS-$(CONFIG_CONCAT_DEMUXER) += concatdec.o
OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
OBJS-$(CONFIG_DATA_DEMUXER) += rawdec.o
@@ -117,6 +117,7 @@ OBJS-$(CONFIG_DIRAC_DEMUXER) += diracdec.o rawdec.o
OBJS-$(CONFIG_DIRAC_MUXER) += rawenc.o
OBJS-$(CONFIG_DNXHD_DEMUXER) += dnxhddec.o rawdec.o
OBJS-$(CONFIG_DNXHD_MUXER) += rawenc.o
+OBJS-$(CONFIG_DSF_DEMUXER) += dsfdec.o
OBJS-$(CONFIG_DSICIN_DEMUXER) += dsicin.o
OBJS-$(CONFIG_DTSHD_DEMUXER) += dtshddec.o
OBJS-$(CONFIG_DTS_DEMUXER) += dtsdec.o rawdec.o
@@ -138,6 +139,7 @@ OBJS-$(CONFIG_FILMSTRIP_MUXER) += filmstripenc.o
OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o rawdec.o \
flac_picture.o \
oggparsevorbis.o \
+ replaygain.o \
vorbiscomment.o
OBJS-$(CONFIG_FLAC_MUXER) += flacenc.o flacenc_header.o \
vorbiscomment.o
@@ -166,6 +168,7 @@ OBJS-$(CONFIG_H264_DEMUXER) += h264dec.o rawdec.o
OBJS-$(CONFIG_H264_MUXER) += rawenc.o
OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
OBJS-$(CONFIG_HEVC_DEMUXER) += hevcdec.o rawdec.o
+OBJS-$(CONFIG_HEVC_MUXER) += rawenc.o
OBJS-$(CONFIG_HLS_DEMUXER) += hls.o
OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o
OBJS-$(CONFIG_HNM_DEMUXER) += hnm.o
@@ -180,6 +183,8 @@ OBJS-$(CONFIG_IMAGE2_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE2_MUXER) += img2enc.o img2.o
OBJS-$(CONFIG_IMAGE2PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE2PIPE_MUXER) += img2enc.o img2.o
+OBJS-$(CONFIG_IMAGE2_ALIAS_PIX_DEMUXER) += img2_alias_pix.o
+OBJS-$(CONFIG_IMAGE2_BRENDER_PIX_DEMUXER) += img2_brender_pix.o
OBJS-$(CONFIG_INGENIENT_DEMUXER) += ingenientdec.o rawdec.o
OBJS-$(CONFIG_IPMOVIE_DEMUXER) += ipmovie.o
OBJS-$(CONFIG_IRCAM_DEMUXER) += ircamdec.o ircam.o pcm.o
@@ -202,7 +207,7 @@ OBJS-$(CONFIG_M4V_MUXER) += rawenc.o
OBJS-$(CONFIG_MATROSKA_DEMUXER) += matroskadec.o matroska.o \
isom.o rmsipr.o
OBJS-$(CONFIG_MATROSKA_MUXER) += matroskaenc.o matroska.o \
- isom.o avc.o \
+ isom.o avc.o hevc.o \
flacenc_header.o avlanguage.o wv.o
OBJS-$(CONFIG_MD5_MUXER) += md5enc.o
OBJS-$(CONFIG_MGSTS_DEMUXER) += mgsts.o
@@ -212,14 +217,15 @@ OBJS-$(CONFIG_MJPEG_DEMUXER) += rawdec.o
OBJS-$(CONFIG_MJPEG_MUXER) += rawenc.o
OBJS-$(CONFIG_MLP_DEMUXER) += rawdec.o
OBJS-$(CONFIG_MLP_MUXER) += rawenc.o
+OBJS-$(CONFIG_MLV_DEMUXER) += mlvdec.o riffdec.o
OBJS-$(CONFIG_MM_DEMUXER) += mm.o
OBJS-$(CONFIG_MMF_DEMUXER) += mmf.o
OBJS-$(CONFIG_MMF_MUXER) += mmf.o rawenc.o
-OBJS-$(CONFIG_MOV_DEMUXER) += mov.o isom.o mov_chan.o
-OBJS-$(CONFIG_MOV_MUXER) += movenc.o isom.o avc.o \
+OBJS-$(CONFIG_MOV_DEMUXER) += mov.o isom.o mov_chan.o replaygain.o
+OBJS-$(CONFIG_MOV_MUXER) += movenc.o isom.o avc.o hevc.o \
movenchint.o mov_chan.o rtp.o
OBJS-$(CONFIG_MP2_MUXER) += mp3enc.o rawenc.o id3v2enc.o
-OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o
+OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o replaygain.o
OBJS-$(CONFIG_MP3_MUXER) += mp3enc.o rawenc.o id3v2enc.o
OBJS-$(CONFIG_MPC_DEMUXER) += mpc.o apetag.o img2.o
OBJS-$(CONFIG_MPC8_DEMUXER) += mpc8.o apetag.o img2.o
@@ -239,8 +245,8 @@ OBJS-$(CONFIG_MPL2_DEMUXER) += mpl2dec.o subtitles.o
OBJS-$(CONFIG_MPSUB_DEMUXER) += mpsubdec.o subtitles.o
OBJS-$(CONFIG_MSNWC_TCP_DEMUXER) += msnwc_tcp.o
OBJS-$(CONFIG_MTV_DEMUXER) += mtv.o
-OBJS-$(CONFIG_MVI_DEMUXER) += mvi.o
OBJS-$(CONFIG_MV_DEMUXER) += mvdec.o
+OBJS-$(CONFIG_MVI_DEMUXER) += mvi.o
OBJS-$(CONFIG_MXF_DEMUXER) += mxfdec.o mxf.o
OBJS-$(CONFIG_MXF_MUXER) += mxfenc.o mxf.o audiointerleave.o
OBJS-$(CONFIG_MXG_DEMUXER) += mxg.o
@@ -261,8 +267,12 @@ OBJS-$(CONFIG_OGG_DEMUXER) += oggdec.o \
oggparsespeex.o \
oggparsetheora.o \
oggparsevorbis.o \
+ oggparsevp8.o \
+ replaygain.o \
vorbiscomment.o \
flac_picture.o
+OBJS-$(CONFIG_OGA_MUXER) += oggenc.o \
+ vorbiscomment.o
OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \
vorbiscomment.o
OBJS-$(CONFIG_OMA_DEMUXER) += omadec.o pcm.o oma.o
@@ -351,6 +361,7 @@ OBJS-$(CONFIG_SAP_DEMUXER) += sapdec.o
OBJS-$(CONFIG_SAP_MUXER) += sapenc.o
OBJS-$(CONFIG_SBG_DEMUXER) += sbgdec.o
OBJS-$(CONFIG_SDP_DEMUXER) += rtsp.o
+OBJS-$(CONFIG_SDR2_DEMUXER) += sdr2.o
OBJS-$(CONFIG_SEGAFILM_DEMUXER) += segafilm.o
OBJS-$(CONFIG_SEGMENT_MUXER) += segment.o
OBJS-$(CONFIG_SHORTEN_DEMUXER) += rawdec.o
@@ -386,6 +397,7 @@ OBJS-$(CONFIG_TRUEHD_MUXER) += rawenc.o
OBJS-$(CONFIG_TTA_DEMUXER) += tta.o apetag.o img2.o
OBJS-$(CONFIG_TTY_DEMUXER) += tty.o sauce.o
OBJS-$(CONFIG_TXD_DEMUXER) += txd.o
+OBJS-$(CONFIG_UNCODEDFRAMECRC_MUXER) += uncodedframecrcenc.o framehash.o
OBJS-$(CONFIG_VC1_DEMUXER) += rawdec.o
OBJS-$(CONFIG_VC1_MUXER) += rawenc.o
OBJS-$(CONFIG_VC1T_DEMUXER) += vc1test.o
@@ -411,7 +423,7 @@ OBJS-$(CONFIG_WSAUD_DEMUXER) += westwood_aud.o
OBJS-$(CONFIG_WSVQA_DEMUXER) += westwood_vqa.o
OBJS-$(CONFIG_WTV_DEMUXER) += wtvdec.o wtv_common.o asfdec.o asf.o asfcrypt.o \
avlanguage.o mpegts.o isom.o
-OBJS-$(CONFIG_WTV_MUXER) += wtvenc.o wtv_common.o asf.o asfenc.o
+OBJS-$(CONFIG_WTV_MUXER) += wtvenc.o wtv_common.o mpegtsenc.o
OBJS-$(CONFIG_WV_DEMUXER) += wvdec.o wv.o apetag.o img2.o
OBJS-$(CONFIG_WV_MUXER) += wvenc.o wv.o apetag.o img2.o
OBJS-$(CONFIG_XA_DEMUXER) += xa.o
@@ -460,6 +472,7 @@ OBJS-$(CONFIG_RTMPTS_PROTOCOL) += rtmpproto.o rtmppkt.o
OBJS-$(CONFIG_RTP_PROTOCOL) += rtpproto.o
OBJS-$(CONFIG_SCTP_PROTOCOL) += sctp.o
OBJS-$(CONFIG_SRTP_PROTOCOL) += srtpproto.o srtp.o
+OBJS-$(CONFIG_SUBFILE_PROTOCOL) += subfile.o
OBJS-$(CONFIG_TCP_PROTOCOL) += tcp.o
OBJS-$(CONFIG_TLS_PROTOCOL) += tls.o
OBJS-$(CONFIG_UDP_PROTOCOL) += udp.o
@@ -472,6 +485,7 @@ SLIBOBJS-$(HAVE_GNU_WINDRES) += avformatres.o
SKIPHEADERS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh.h
SKIPHEADERS-$(CONFIG_NETWORK) += network.h rtsp.h
+
TESTPROGS = seek \
srtp \
url \
diff --git a/chromium/third_party/ffmpeg/libavformat/aacdec.c b/chromium/third_party/ffmpeg/libavformat/aacdec.c
index d93e75ec52c..05cbaf78aa1 100644
--- a/chromium/third_party/ffmpeg/libavformat/aacdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/aacdec.c
@@ -38,28 +38,42 @@ static int adts_aac_probe(AVProbeData *p)
buf = buf0;
- for(; buf < end; buf= buf2+1) {
+ for (; buf < end; buf = buf2 + 1) {
buf2 = buf;
- for(frames = 0; buf2 < end; frames++) {
+ for (frames = 0; buf2 < end; frames++) {
uint32_t header = AV_RB16(buf2);
- if((header&0xFFF6) != 0xFFF0)
+ if ((header & 0xFFF6) != 0xFFF0) {
+ if (buf != buf0) {
+ // Found something that isn't an ADTS header, starting
+ // from a position other than the start of the buffer.
+ // Discard the count we've accumulated so far since it
+ // probably was a false positive.
+ frames = 0;
+ }
break;
+ }
fsize = (AV_RB32(buf2 + 3) >> 13) & 0x1FFF;
- if(fsize < 7)
+ if (fsize < 7)
break;
fsize = FFMIN(fsize, end - buf2);
buf2 += fsize;
}
max_frames = FFMAX(max_frames, frames);
- if(buf == buf0)
- first_frames= frames;
+ if (buf == buf0)
+ first_frames = frames;
}
- if (first_frames>=3) return AVPROBE_SCORE_EXTENSION + 1;
- else if(max_frames>500)return AVPROBE_SCORE_EXTENSION;
- else if(max_frames>=3) return AVPROBE_SCORE_EXTENSION / 2;
- else if(max_frames>=1) return 1;
- else return 0;
+
+ if (first_frames >= 3)
+ return AVPROBE_SCORE_EXTENSION + 1;
+ else if (max_frames > 100)
+ return AVPROBE_SCORE_EXTENSION;
+ else if (max_frames >= 3)
+ return AVPROBE_SCORE_EXTENSION / 2;
+ else if (max_frames >= 1)
+ return 1;
+ else
+ return 0;
}
static int adts_aac_read_header(AVFormatContext *s)
@@ -71,8 +85,8 @@ static int adts_aac_read_header(AVFormatContext *s)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->codec->codec_id = s->iformat->raw_codec_id;
- st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
+ st->codec->codec_id = s->iformat->raw_codec_id;
+ st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
ff_id3v1_read(s);
if (s->pb->seekable &&
@@ -82,19 +96,19 @@ static int adts_aac_read_header(AVFormatContext *s)
avio_seek(s->pb, cur, SEEK_SET);
}
- //LCM of all possible ADTS sample rates
+ // LCM of all possible ADTS sample rates
avpriv_set_pts_info(st, 64, 1, 28224000);
return 0;
}
AVInputFormat ff_aac_demuxer = {
- .name = "aac",
- .long_name = NULL_IF_CONFIG_SMALL("raw ADTS AAC (Advanced Audio Coding)"),
- .read_probe = adts_aac_probe,
- .read_header = adts_aac_read_header,
- .read_packet = ff_raw_read_partial_packet,
- .flags = AVFMT_GENERIC_INDEX,
- .extensions = "aac",
- .raw_codec_id = AV_CODEC_ID_AAC,
+ .name = "aac",
+ .long_name = NULL_IF_CONFIG_SMALL("raw ADTS AAC (Advanced Audio Coding)"),
+ .read_probe = adts_aac_probe,
+ .read_header = adts_aac_read_header,
+ .read_packet = ff_raw_read_partial_packet,
+ .flags = AVFMT_GENERIC_INDEX,
+ .extensions = "aac",
+ .raw_codec_id = AV_CODEC_ID_AAC,
};
diff --git a/chromium/third_party/ffmpeg/libavformat/ac3dec.c b/chromium/third_party/ffmpeg/libavformat/ac3dec.c
index 3db23397d0d..58ef44d45a7 100644
--- a/chromium/third_party/ffmpeg/libavformat/ac3dec.c
+++ b/chromium/third_party/ffmpeg/libavformat/ac3dec.c
@@ -28,7 +28,7 @@ static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
{
int max_frames, first_frames = 0, frames;
const uint8_t *buf, *buf2, *end;
- AC3HeaderInfo hdr;
+ AC3HeaderInfo *phdr = NULL;
GetBitContext gbc;
enum AVCodecID codec_id = AV_CODEC_ID_AC3;
@@ -55,27 +55,28 @@ static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
init_get_bits(&gbc, buf3, 54);
}else
init_get_bits(&gbc, buf2, 54);
- if(avpriv_ac3_parse_header(&gbc, &hdr) < 0)
+ if(avpriv_ac3_parse_header2(&gbc, &phdr) < 0)
break;
- if(buf2 + hdr.frame_size > end)
+ if(buf2 + phdr->frame_size > end)
break;
if (buf[0] == 0x77 && buf[1] == 0x0B) {
- av_assert0(hdr.frame_size <= sizeof(buf3));
- for(i=8; i<hdr.frame_size; i+=2) {
+ av_assert0(phdr->frame_size <= sizeof(buf3));
+ for(i=8; i<phdr->frame_size; i+=2) {
buf3[i ] = buf[i+1];
buf3[i+1] = buf[i ];
}
}
- if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, gbc.buffer + 2, hdr.frame_size - 2))
+ if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, gbc.buffer + 2, phdr->frame_size - 2))
break;
- if (hdr.bitstream_id > 10)
+ if (phdr->bitstream_id > 10)
codec_id = AV_CODEC_ID_EAC3;
- buf2 += hdr.frame_size;
+ buf2 += phdr->frame_size;
}
max_frames = FFMAX(max_frames, frames);
if(buf == p->buf)
first_frames = frames;
}
+ av_freep(&phdr);
if(codec_id != expected_codec_id) return 0;
// keep this in sync with mp3 probe, both need to avoid
// issues with MPEG-files!
diff --git a/chromium/third_party/ffmpeg/libavformat/adxdec.c b/chromium/third_party/ffmpeg/libavformat/adxdec.c
index 0a0436f1847..fe22c3ae697 100644
--- a/chromium/third_party/ffmpeg/libavformat/adxdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/adxdec.c
@@ -78,13 +78,8 @@ static int adx_read_header(AVFormatContext *s)
c->header_size = avio_rb16(s->pb) + 4;
avio_seek(s->pb, -4, SEEK_CUR);
- if (ff_alloc_extradata(avctx, c->header_size))
+ if (ff_get_extradata(avctx, s->pb, c->header_size) < 0)
return AVERROR(ENOMEM);
- if (avio_read(s->pb, avctx->extradata, c->header_size) < c->header_size) {
- av_freep(&avctx->extradata);
- return AVERROR(EIO);
- }
- avctx->extradata_size = c->header_size;
ret = avpriv_adx_decode_header(avctx, avctx->extradata,
avctx->extradata_size, &c->header_size,
diff --git a/chromium/third_party/ffmpeg/libavformat/aiffdec.c b/chromium/third_party/ffmpeg/libavformat/aiffdec.c
index 6f82d9339a1..81bcc64a0c5 100644
--- a/chromium/third_party/ffmpeg/libavformat/aiffdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/aiffdec.c
@@ -237,7 +237,7 @@ static int aiff_read_header(AVFormatContext *s)
break;
case MKTAG('I', 'D', '3', ' '):
position = avio_tell(pb);
- ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
+ ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, size);
if (id3v2_extra_meta)
if ((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0) {
ff_id3v2_free_extra_meta(&id3v2_extra_meta);
@@ -278,9 +278,8 @@ static int aiff_read_header(AVFormatContext *s)
case MKTAG('w', 'a', 'v', 'e'):
if ((uint64_t)size > (1<<30))
return -1;
- if (ff_alloc_extradata(st->codec, size))
+ if (ff_get_extradata(st->codec, pb, size) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, st->codec->extradata, size);
if (st->codec->codec_id == AV_CODEC_ID_QDM2 && size>=12*4 && !st->codec->block_align) {
st->codec->block_align = AV_RB32(st->codec->extradata+11*4);
aiff->block_duration = AV_RB32(st->codec->extradata+9*4);
diff --git a/chromium/third_party/ffmpeg/libavformat/aiffenc.c b/chromium/third_party/ffmpeg/libavformat/aiffenc.c
index 6e3d8bc6add..90fc43346ce 100644
--- a/chromium/third_party/ffmpeg/libavformat/aiffenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/aiffenc.c
@@ -66,7 +66,7 @@ static int put_id3v2_tags(AVFormatContext *s, AIFFOutputContext *aiff)
return ret;
pict_list = pict_list->next;
}
- ff_id3v2_finish(&id3v2, pb);
+ ff_id3v2_finish(&id3v2, pb, s->metadata_header_padding);
end = avio_tell(pb);
size = end - pos;
diff --git a/chromium/third_party/ffmpeg/libavformat/allformats.c b/chromium/third_party/ffmpeg/libavformat/allformats.c
index f1039dda84b..0e7feea8f64 100644
--- a/chromium/third_party/ffmpeg/libavformat/allformats.c
+++ b/chromium/third_party/ffmpeg/libavformat/allformats.c
@@ -98,6 +98,7 @@ void av_register_all(void)
REGISTER_MUXDEMUX(CAVSVIDEO, cavsvideo);
REGISTER_DEMUXER (CDG, cdg);
REGISTER_DEMUXER (CDXL, cdxl);
+ REGISTER_DEMUXER (CINE, cine);
REGISTER_DEMUXER (CONCAT, concat);
REGISTER_MUXER (CRC, crc);
REGISTER_MUXDEMUX(DATA, data);
@@ -105,6 +106,7 @@ void av_register_all(void)
REGISTER_DEMUXER (DFA, dfa);
REGISTER_MUXDEMUX(DIRAC, dirac);
REGISTER_MUXDEMUX(DNXHD, dnxhd);
+ REGISTER_DEMUXER (DSF, dsf);
REGISTER_DEMUXER (DSICIN, dsicin);
REGISTER_MUXDEMUX(DTS, dts);
REGISTER_DEMUXER (DTSHD, dtshd);
@@ -135,7 +137,7 @@ void av_register_all(void)
REGISTER_MUXDEMUX(H263, h263);
REGISTER_MUXDEMUX(H264, h264);
REGISTER_MUXER (HDS, hds);
- REGISTER_DEMUXER (HEVC, hevc);
+ REGISTER_MUXDEMUX(HEVC, hevc);
REGISTER_MUXDEMUX(HLS, hls);
REGISTER_DEMUXER (HNM, hnm);
REGISTER_MUXDEMUX(ICO, ico);
@@ -145,6 +147,8 @@ void av_register_all(void)
REGISTER_MUXDEMUX(ILBC, ilbc);
REGISTER_MUXDEMUX(IMAGE2, image2);
REGISTER_MUXDEMUX(IMAGE2PIPE, image2pipe);
+ REGISTER_DEMUXER (IMAGE2_ALIAS_PIX, image2_alias_pix);
+ REGISTER_DEMUXER (IMAGE2_BRENDER_PIX, image2_brender_pix);
REGISTER_DEMUXER (INGENIENT, ingenient);
REGISTER_DEMUXER (IPMOVIE, ipmovie);
REGISTER_MUXER (IPOD, ipod);
@@ -168,6 +172,7 @@ void av_register_all(void)
REGISTER_MUXDEMUX(MICRODVD, microdvd);
REGISTER_MUXDEMUX(MJPEG, mjpeg);
REGISTER_MUXDEMUX(MLP, mlp);
+ REGISTER_DEMUXER (MLV, mlv);
REGISTER_DEMUXER (MM, mm);
REGISTER_MUXDEMUX(MMF, mmf);
REGISTER_MUXDEMUX(MOV, mov);
@@ -203,6 +208,7 @@ void av_register_all(void)
REGISTER_MUXER (NULL, null);
REGISTER_MUXDEMUX(NUT, nut);
REGISTER_DEMUXER (NUV, nuv);
+ REGISTER_MUXER (OGA, oga);
REGISTER_MUXDEMUX(OGG, ogg);
REGISTER_MUXDEMUX(OMA, oma);
REGISTER_MUXER (OPUS, opus);
@@ -249,6 +255,7 @@ void av_register_all(void)
REGISTER_MUXDEMUX(SAP, sap);
REGISTER_DEMUXER (SBG, sbg);
REGISTER_DEMUXER (SDP, sdp);
+ REGISTER_DEMUXER (SDR2, sdr2);
#if CONFIG_RTPDEC
ff_register_rtp_dynamic_payload_handlers();
ff_register_rdt_dynamic_payload_handlers();
@@ -284,6 +291,7 @@ void av_register_all(void)
REGISTER_DEMUXER (TTA, tta);
REGISTER_DEMUXER (TXD, txd);
REGISTER_DEMUXER (TTY, tty);
+ REGISTER_MUXER (UNCODEDFRAMECRC, uncodedframecrc);
REGISTER_MUXDEMUX(VC1, vc1);
REGISTER_MUXDEMUX(VC1T, vc1t);
REGISTER_DEMUXER (VIVO, vivo);
@@ -336,6 +344,7 @@ void av_register_all(void)
REGISTER_PROTOCOL(RTP, rtp);
REGISTER_PROTOCOL(SCTP, sctp);
REGISTER_PROTOCOL(SRTP, srtp);
+ REGISTER_PROTOCOL(SUBFILE, subfile);
REGISTER_PROTOCOL(TCP, tcp);
REGISTER_PROTOCOL(TLS, tls);
REGISTER_PROTOCOL(UDP, udp);
diff --git a/chromium/third_party/ffmpeg/libavformat/amr.c b/chromium/third_party/ffmpeg/libavformat/amr.c
index db9bb4e59da..60015255307 100644
--- a/chromium/third_party/ffmpeg/libavformat/amr.c
+++ b/chromium/third_party/ffmpeg/libavformat/amr.c
@@ -26,11 +26,15 @@ Only mono files are supported.
*/
-#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
+typedef struct {
+ uint64_t cumulated_size;
+ uint64_t block_count;
+} AMRContext;
+
static const char AMR_header[] = "#!AMR\n";
static const char AMRWB_header[] = "#!AMR-WB\n";
@@ -111,12 +115,13 @@ static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
AVCodecContext *enc = s->streams[0]->codec;
int read, size = 0, toc, mode;
int64_t pos = avio_tell(s->pb);
+ AMRContext *amr = s->priv_data;
if (url_feof(s->pb)) {
return AVERROR(EIO);
}
- // FIXME this is wrong, this should rather be in a AVParset
+ // FIXME this is wrong, this should rather be in a AVParser
toc = avio_r8(s->pb);
mode = (toc >> 3) & 0x0F;
@@ -137,8 +142,11 @@ static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
if (!size || av_new_packet(pkt, size))
return AVERROR(EIO);
- /* Both AMR formats have 50 frames per second */
- s->streams[0]->codec->bit_rate = size*8*50;
+ if (amr->cumulated_size < UINT64_MAX - size) {
+ amr->cumulated_size += size;
+ /* Both AMR formats have 50 frames per second */
+ s->streams[0]->codec->bit_rate = amr->cumulated_size / ++amr->block_count * 8 * 50;
+ }
pkt->stream_index = 0;
pkt->pos = pos;
@@ -158,6 +166,7 @@ static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
AVInputFormat ff_amr_demuxer = {
.name = "amr",
.long_name = NULL_IF_CONFIG_SMALL("3GPP AMR"),
+ .priv_data_size = sizeof(AMRContext),
.read_probe = amr_probe,
.read_header = amr_read_header,
.read_packet = amr_read_packet,
diff --git a/chromium/third_party/ffmpeg/libavformat/apc.c b/chromium/third_party/ffmpeg/libavformat/apc.c
index 08ae9351dcf..21bb514cd0b 100644
--- a/chromium/third_party/ffmpeg/libavformat/apc.c
+++ b/chromium/third_party/ffmpeg/libavformat/apc.c
@@ -52,11 +52,9 @@ static int apc_read_header(AVFormatContext *s)
avio_rl32(pb); /* number of samples */
st->codec->sample_rate = avio_rl32(pb);
- if (ff_alloc_extradata(st->codec, 2 * 4))
- return AVERROR(ENOMEM);
-
/* initial predictor values for adpcm decoder */
- avio_read(pb, st->codec->extradata, 2 * 4);
+ if (ff_get_extradata(st->codec, pb, 2 * 4) < 0)
+ return AVERROR(ENOMEM);
if (avio_rl32(pb)) {
st->codec->channels = 2;
diff --git a/chromium/third_party/ffmpeg/libavformat/ape.c b/chromium/third_party/ffmpeg/libavformat/ape.c
index 6f824800a39..d5a786a1989 100644
--- a/chromium/third_party/ffmpeg/libavformat/ape.c
+++ b/chromium/third_party/ffmpeg/libavformat/ape.c
@@ -264,7 +264,7 @@ static int ape_read_header(AVFormatContext * s)
}
if (ape->seektablelength / sizeof(*ape->seektable) < ape->totalframes) {
av_log(s, AV_LOG_ERROR,
- "Number of seek entries is less than number of frames: %zu vs. %"PRIu32"\n",
+ "Number of seek entries is less than number of frames: %"SIZE_SPECIFIER" vs. %"PRIu32"\n",
ape->seektablelength / sizeof(*ape->seektable), ape->totalframes);
return AVERROR_INVALIDDATA;
}
@@ -282,18 +282,20 @@ static int ape_read_header(AVFormatContext * s)
ape->totalsamples += ape->blocksperframe * (ape->totalframes - 1);
if (ape->seektablelength > 0) {
- ape->seektable = av_malloc(ape->seektablelength);
+ ape->seektable = av_mallocz(ape->seektablelength);
if (!ape->seektable)
return AVERROR(ENOMEM);
for (i = 0; i < ape->seektablelength / sizeof(uint32_t) && !pb->eof_reached; i++)
ape->seektable[i] = avio_rl32(pb);
if (ape->fileversion < 3810) {
- ape->bittable = av_malloc(ape->totalframes);
+ ape->bittable = av_mallocz(ape->totalframes);
if (!ape->bittable)
return AVERROR(ENOMEM);
for (i = 0; i < ape->totalframes && !pb->eof_reached; i++)
ape->bittable[i] = avio_r8(pb);
}
+ if (pb->eof_reached)
+ av_log(s, AV_LOG_WARNING, "File truncated\n");
}
ape->frames[0].pos = ape->firstframe;
@@ -415,8 +417,10 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
AV_WL32(pkt->data , nblocks);
AV_WL32(pkt->data + 4, ape->frames[ape->currentframe].skip);
ret = avio_read(s->pb, pkt->data + extra_size, ape->frames[ape->currentframe].size);
- if (ret < 0)
+ if (ret < 0) {
+ av_free_packet(pkt);
return ret;
+ }
pkt->pts = ape->frames[ape->currentframe].pts;
pkt->stream_index = 0;
diff --git a/chromium/third_party/ffmpeg/libavformat/apetag.c b/chromium/third_party/ffmpeg/libavformat/apetag.c
index a376a0bc4a4..7d2f0b3222d 100644
--- a/chromium/third_party/ffmpeg/libavformat/apetag.c
+++ b/chromium/third_party/ffmpeg/libavformat/apetag.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "avformat.h"
@@ -88,13 +90,8 @@ static int ape_tag_read_field(AVFormatContext *s)
st->attached_pic.stream_index = st->index;
st->attached_pic.flags |= AV_PKT_FLAG_KEY;
} else {
- if (ff_alloc_extradata(st->codec, size))
+ if (ff_get_extradata(st->codec, s->pb, size) < 0)
return AVERROR(ENOMEM);
- if (avio_read(pb, st->codec->extradata, size) != size) {
- av_freep(&st->codec->extradata);
- st->codec->extradata_size = 0;
- return AVERROR(EIO);
- }
st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
}
} else {
@@ -144,14 +141,14 @@ int64_t ff_ape_parse_tag(AVFormatContext *s)
}
if (tag_bytes > file_size - APE_TAG_FOOTER_BYTES) {
- av_log(s, AV_LOG_ERROR, "Invalid tag size %u.\n", tag_bytes);
+ av_log(s, AV_LOG_ERROR, "Invalid tag size %"PRIu32".\n", tag_bytes);
return 0;
}
tag_start = file_size - tag_bytes - APE_TAG_FOOTER_BYTES;
fields = avio_rl32(pb); /* number of fields */
if (fields > 65536) {
- av_log(s, AV_LOG_ERROR, "Too many tag fields (%d)\n", fields);
+ av_log(s, AV_LOG_ERROR, "Too many tag fields (%"PRIu32")\n", fields);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/asf.h b/chromium/third_party/ffmpeg/libavformat/asf.h
index 904d3486e88..0c9598a8d8f 100644
--- a/chromium/third_party/ffmpeg/libavformat/asf.h
+++ b/chromium/third_party/ffmpeg/libavformat/asf.h
@@ -43,6 +43,7 @@ typedef struct ASFStream {
int timestamp;
int64_t duration;
int skip_to_key;
+ int pkt_clean;
int ds_span; /* descrambling */
int ds_packet_size;
@@ -188,6 +189,4 @@ extern const AVMetadataConv ff_asf_metadata_conv[];
extern AVInputFormat ff_asf_demuxer;
-void ff_put_guid(AVIOContext *s, const ff_asf_guid *g);
-
#endif /* AVFORMAT_ASF_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/asfdec.c b/chromium/third_party/ffmpeg/libavformat/asfdec.c
index a9b032682d5..a7d860927b1 100644
--- a/chromium/third_party/ffmpeg/libavformat/asfdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/asfdec.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
@@ -266,7 +268,7 @@ static void get_id3_tag(AVFormatContext *s, int len)
{
ID3v2ExtraMeta *id3v2_extra_meta = NULL;
- ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
+ ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, len);
if (id3v2_extra_meta)
ff_id3v2_parse_apic(s, &id3v2_extra_meta);
ff_id3v2_free_extra_meta(&id3v2_extra_meta);
@@ -943,13 +945,13 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
// the following checks prevent overflows and infinite loops
if (!packet_length || packet_length >= (1U << 29)) {
av_log(s, AV_LOG_ERROR,
- "invalid packet_length %d at:%"PRId64"\n",
+ "invalid packet_length %"PRIu32" at:%"PRId64"\n",
packet_length, avio_tell(pb));
return AVERROR_INVALIDDATA;
}
if (padsize >= packet_length) {
av_log(s, AV_LOG_ERROR,
- "invalid padsize %d at:%"PRId64"\n", padsize, avio_tell(pb));
+ "invalid padsize %"PRIu32" at:%"PRId64"\n", padsize, avio_tell(pb));
return AVERROR_INVALIDDATA;
}
@@ -968,7 +970,7 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
if (rsize > packet_length - padsize) {
asf->packet_size_left = 0;
av_log(s, AV_LOG_ERROR,
- "invalid packet header length %d for pktlen %d-%d at %"PRId64"\n",
+ "invalid packet header length %d for pktlen %"PRIu32"-%"PRIu32" at %"PRId64"\n",
rsize, packet_length, padsize, avio_tell(pb));
return AVERROR_INVALIDDATA;
}
@@ -1159,6 +1161,16 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
asf_st = asf->asf_st;
av_assert0(asf_st);
+ if (!asf_st->frag_offset && asf->packet_frag_offset) {
+ av_dlog(s, "skipping asf data pkt with fragment offset for "
+ "stream:%d, expected:%d but got %d from pkt)\n",
+ asf->stream_index, asf_st->frag_offset,
+ asf->packet_frag_offset);
+ avio_skip(pb, asf->packet_frag_size);
+ asf->packet_size_left -= asf->packet_frag_size;
+ continue;
+ }
+
if (asf->packet_replic_size == 1) {
// frag_offset is here used as the beginning timestamp
asf->packet_frag_timestamp = asf->packet_time_start;
@@ -1191,6 +1203,7 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
asf_st->pkt.stream_index = asf->stream_index;
asf_st->pkt.pos = asf_st->packet_pos = asf->packet_pos;
+ asf_st->pkt_clean = 0;
if (asf_st->pkt.data && asf_st->palette_changed) {
uint8_t *pal;
@@ -1231,6 +1244,11 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
continue;
}
+ if (asf->packet_frag_offset != asf_st->frag_offset && !asf_st->pkt_clean) {
+ memset(asf_st->pkt.data + asf_st->frag_offset, 0, asf_st->pkt.size - asf_st->frag_offset);
+ asf_st->pkt_clean = 1;
+ }
+
ret = avio_read(pb, asf_st->pkt.data + asf->packet_frag_offset,
asf->packet_frag_size);
if (ret != asf->packet_frag_size) {
@@ -1450,30 +1468,30 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index,
return pts;
}
-static void asf_build_simple_index(AVFormatContext *s, int stream_index)
+static int asf_build_simple_index(AVFormatContext *s, int stream_index)
{
ff_asf_guid g;
ASFContext *asf = s->priv_data;
int64_t current_pos = avio_tell(s->pb);
+ int ret = 0;
- if(avio_seek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET) < 0) {
- asf->index_read= -1;
- return;
+ if((ret = avio_seek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET)) < 0) {
+ return ret;
}
- ff_get_guid(s->pb, &g);
+ if ((ret = ff_get_guid(s->pb, &g)) < 0)
+ goto end;
/* the data object can be followed by other top-level objects,
* skip them until the simple index object is reached */
while (ff_guidcmp(&g, &ff_asf_simple_index_header)) {
int64_t gsize = avio_rl64(s->pb);
if (gsize < 24 || url_feof(s->pb)) {
- avio_seek(s->pb, current_pos, SEEK_SET);
- asf->index_read= -1;
- return;
+ goto end;
}
avio_skip(s->pb, gsize - 24);
- ff_get_guid(s->pb, &g);
+ if ((ret = ff_get_guid(s->pb, &g)) < 0)
+ goto end;
}
{
@@ -1481,7 +1499,8 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
int pct, ict;
int i;
int64_t av_unused gsize = avio_rl64(s->pb);
- ff_get_guid(s->pb, &g);
+ if ((ret = ff_get_guid(s->pb, &g)) < 0)
+ goto end;
itime = avio_rl64(s->pb);
pct = avio_rl32(s->pb);
ict = avio_rl32(s->pb);
@@ -1504,7 +1523,12 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
}
asf->index_read = ict > 1;
}
+end:
+// if (url_feof(s->pb)) {
+// ret = 0;
+// }
avio_seek(s->pb, current_pos, SEEK_SET);
+ return ret;
}
static int asf_read_seek(AVFormatContext *s, int stream_index,
@@ -1512,6 +1536,7 @@ static int asf_read_seek(AVFormatContext *s, int stream_index,
{
ASFContext *asf = s->priv_data;
AVStream *st = s->streams[stream_index];
+ int ret = 0;
if (s->packet_size <= 0)
return -1;
@@ -1525,10 +1550,20 @@ static int asf_read_seek(AVFormatContext *s, int stream_index,
return ret;
}
- if (!asf->index_read)
- asf_build_simple_index(s, stream_index);
+ /* explicitly handle the case of seeking to 0 */
+ if (!pts) {
+ asf_reset_header(s);
+ avio_seek(s->pb, s->data_offset, SEEK_SET);
+ return 0;
+ }
+
+ if (!asf->index_read) {
+ ret = asf_build_simple_index(s, stream_index);
+ if (ret < 0)
+ asf->index_read = -1;
+ }
- if ((asf->index_read > 0 && st->index_entries)) {
+ if (asf->index_read > 0 && st->index_entries) {
int index = av_index_search_timestamp(st, pts, flags);
if (index >= 0) {
/* find the position */
diff --git a/chromium/third_party/ffmpeg/libavformat/asfenc.c b/chromium/third_party/ffmpeg/libavformat/asfenc.c
index b4a3ffb7ef6..cccbf858c7a 100644
--- a/chromium/third_party/ffmpeg/libavformat/asfenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/asfenc.c
@@ -34,6 +34,7 @@
#define ASF_INDEXED_INTERVAL 10000000
#define ASF_INDEX_BLOCK (1<<9)
+#define ASF_PAYLOADS_PER_PACKET 63
#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE 0x2
#define ASF_PACKET_ERROR_CORRECTION_FLAGS \
@@ -223,12 +224,6 @@ static const AVCodecTag codec_asf_bmp_tags[] = {
#define PREROLL_TIME 3100
-void ff_put_guid(AVIOContext *s, const ff_asf_guid *g)
-{
- av_assert0(sizeof(*g) == 16);
- avio_write(s, *g, sizeof(*g));
-}
-
static void put_str16(AVIOContext *s, const char *tag)
{
int len;
@@ -358,7 +353,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
AVIOContext *pb = s->pb;
AVDictionaryEntry *tags[5];
int header_size, n, extra_size, extra_size2, wav_extra_size, file_time;
- int has_title;
+ int has_title, has_aspect_ratio = 0;
int metadata_count;
AVCodecContext *enc;
int64_t header_offset, cur_pos, hpos;
@@ -384,6 +379,10 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
avpriv_set_pts_info(s->streams[n], 32, 1, 1000); /* 32 bit pts in ms */
bit_rate += enc->bit_rate;
+ if ( enc->codec_type == AVMEDIA_TYPE_VIDEO
+ && enc->sample_aspect_ratio.num > 0
+ && enc->sample_aspect_ratio.den > 0)
+ has_aspect_ratio++;
}
if (asf->is_streamed) {
@@ -410,14 +409,46 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
avio_wl32(pb, (asf->is_streamed || !pb->seekable) ? 3 : 2); /* ??? */
avio_wl32(pb, s->packet_size); /* packet size */
avio_wl32(pb, s->packet_size); /* packet size */
- avio_wl32(pb, bit_rate); /* Nominal data rate in bps */
+ avio_wl32(pb, bit_rate ? bit_rate : -1); /* Maximum data rate in bps */
end_header(pb, hpos);
/* unknown headers */
hpos = put_header(pb, &ff_asf_head1_guid);
ff_put_guid(pb, &ff_asf_head2_guid);
- avio_wl32(pb, 6);
- avio_wl16(pb, 0);
+ avio_wl16(pb, 6);
+ if (has_aspect_ratio) {
+ int64_t hpos2;
+ avio_wl32(pb, 26 + has_aspect_ratio * 84);
+ hpos2 = put_header(pb, &ff_asf_metadata_header);
+ avio_wl16(pb, 2 * has_aspect_ratio);
+ for (n = 0; n < s->nb_streams; n++) {
+ enc = s->streams[n]->codec;
+ if ( enc->codec_type == AVMEDIA_TYPE_VIDEO
+ && enc->sample_aspect_ratio.num > 0
+ && enc->sample_aspect_ratio.den > 0) {
+ AVRational sar = enc->sample_aspect_ratio;
+ avio_wl16(pb, 0);
+ // the stream number is set like this below
+ avio_wl16(pb, n + 1);
+ avio_wl16(pb, 26); // name_len
+ avio_wl16(pb, 3); // value_type
+ avio_wl32(pb, 4); // value_len
+ avio_put_str16le(pb, "AspectRatioX");
+ avio_wl32(pb, sar.num);
+ avio_wl16(pb, 0);
+ // the stream number is set like this below
+ avio_wl16(pb, n + 1);
+ avio_wl16(pb, 26); // name_len
+ avio_wl16(pb, 3); // value_type
+ avio_wl32(pb, 4); // value_len
+ avio_put_str16le(pb, "AspectRatioY");
+ avio_wl32(pb, sar.den);
+ }
+ }
+ end_header(pb, hpos2);
+ } else {
+ avio_wl32(pb, 0);
+ }
end_header(pb, hpos);
/* title and other infos */
@@ -497,7 +528,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
/* WAVEFORMATEX header */
- int wavsize = ff_put_wav_header(pb, enc);
+ int wavsize = ff_put_wav_header(pb, enc, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX);
if (wavsize < 0)
return -1;
@@ -525,7 +556,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
avio_wl16(pb, 40 + enc->extradata_size); /* size */
/* BITMAPINFOHEADER header */
- ff_put_bmp_header(pb, enc, ff_codec_bmp_tags, 1);
+ ff_put_bmp_header(pb, enc, ff_codec_bmp_tags, 1, 0);
}
end_header(pb, hpos);
}
@@ -536,14 +567,11 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
ff_put_guid(pb, &ff_asf_codec_comment1_header);
avio_wl32(pb, s->nb_streams);
for (n = 0; n < s->nb_streams; n++) {
- AVCodec *p;
+ const AVCodecDescriptor *codec_desc;
const char *desc;
- int len;
- uint8_t *buf;
- AVIOContext *dyn_buf;
- enc = s->streams[n]->codec;
- p = avcodec_find_encoder(enc->codec_id);
+ enc = s->streams[n]->codec;
+ codec_desc = avcodec_descriptor_get(enc->codec_id);
if (enc->codec_type == AVMEDIA_TYPE_AUDIO)
avio_wl16(pb, 2);
@@ -555,17 +583,24 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
if (enc->codec_id == AV_CODEC_ID_WMAV2)
desc = "Windows Media Audio V8";
else
- desc = p ? p->name : enc->codec_name;
+ desc = codec_desc ? codec_desc->name : NULL;
- if (avio_open_dyn_buf(&dyn_buf) < 0)
- return AVERROR(ENOMEM);
+ if (desc) {
+ AVIOContext *dyn_buf;
+ uint8_t *buf;
+ int len;
- avio_put_str16le(dyn_buf, desc);
- len = avio_close_dyn_buf(dyn_buf, &buf);
- avio_wl16(pb, len / 2); // "number of characters" = length in bytes / 2
+ if (avio_open_dyn_buf(&dyn_buf) < 0)
+ return AVERROR(ENOMEM);
- avio_write(pb, buf, len);
- av_freep(&buf);
+ avio_put_str16le(dyn_buf, desc);
+ len = avio_close_dyn_buf(dyn_buf, &buf);
+ avio_wl16(pb, len / 2); // "number of characters" = length in bytes / 2
+
+ avio_write(pb, buf, len);
+ av_freep(&buf);
+ } else
+ avio_wl16(pb, 0);
avio_wl16(pb, 0); /* no parameters */
@@ -617,6 +652,7 @@ static int asf_write_header(AVFormatContext *s)
ASFContext *asf = s->priv_data;
s->packet_size = PACKET_SIZE;
+ s->max_interleave_delta = 0;
asf->nb_packets = 0;
asf->index_ptr = av_malloc(sizeof(ASFIndex) * ASF_INDEX_BLOCK);
@@ -823,6 +859,8 @@ static void put_frame(AVFormatContext *s, ASFStream *stream, AVStream *avst,
flush_packet(s);
else if (asf->packet_size_left <= (PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS + PACKET_HEADER_MIN_SIZE + 1))
flush_packet(s);
+ else if (asf->packet_nb_payloads == ASF_PAYLOADS_PER_PACKET)
+ flush_packet(s);
}
stream->seq++;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/assdec.c b/chromium/third_party/ffmpeg/libavformat/assdec.c
index c9bd63b3c4d..bb953c7276f 100644
--- a/chromium/third_party/ffmpeg/libavformat/assdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/assdec.c
@@ -27,16 +27,16 @@
#include "libavcodec/internal.h"
#include "libavutil/bprint.h"
-typedef struct ASSContext{
+typedef struct ASSContext {
FFDemuxSubtitlesQueue q;
-}ASSContext;
+} ASSContext;
static int ass_probe(AVProbeData *p)
{
- const char *header= "[Script Info]";
+ const char *header = "[Script Info]";
- if( !memcmp(p->buf , header, strlen(header))
- || !memcmp(p->buf+3, header, strlen(header)))
+ if (!memcmp(p->buf, header, strlen(header)) ||
+ !memcmp(p->buf + 3, header, strlen(header)))
return AVPROBE_SCORE_MAX;
return 0;
@@ -94,9 +94,9 @@ static int ass_read_header(AVFormatContext *s)
return AVERROR(ENOMEM);
avpriv_set_pts_info(st, 64, 1, 100);
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
- st->codec->codec_id= AV_CODEC_ID_SSA;
+ st->codec->codec_id = AV_CODEC_ID_SSA;
- header_remaining= INT_MAX;
+ header_remaining = INT_MAX;
av_bprint_init(&header, 0, AV_BPRINT_SIZE_UNLIMITED);
av_bprint_init(&line, 0, AV_BPRINT_SIZE_UNLIMITED);
@@ -108,9 +108,9 @@ static int ass_read_header(AVFormatContext *s)
break;
if (!memcmp(line.str, "[Events]", 8))
- header_remaining= 2;
- else if (line.str[0]=='[')
- header_remaining= INT_MAX;
+ header_remaining = 2;
+ else if (line.str[0] == '[')
+ header_remaining = INT_MAX;
if (header_remaining) {
av_bprintf(&header, "%s", line.str);
diff --git a/chromium/third_party/ffmpeg/libavformat/astenc.c b/chromium/third_party/ffmpeg/libavformat/astenc.c
index edd802cbf39..cf7a12c95d1 100644
--- a/chromium/third_party/ffmpeg/libavformat/astenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/astenc.c
@@ -113,7 +113,7 @@ static int ast_write_packet(AVFormatContext *s, AVPacket *pkt)
AVCodecContext *enc = s->streams[0]->codec;
int size = pkt->size / enc->channels;
- if (enc->frame_number == 1)
+ if (s->streams[0]->nb_frames == 0)
ast->fbs = size;
ffio_wfourcc(pb, "BLCK");
@@ -135,7 +135,7 @@ static int ast_write_trailer(AVFormatContext *s)
ASTMuxContext *ast = s->priv_data;
AVCodecContext *enc = s->streams[0]->codec;
int64_t file_size = avio_tell(pb);
- int64_t samples = (file_size - 64 - (32 * enc->frame_number)) / enc->block_align; /* PCM_S16BE_PLANAR */
+ int64_t samples = (file_size - 64 - (32 * s->streams[0]->nb_frames)) / enc->block_align; /* PCM_S16BE_PLANAR */
av_log(s, AV_LOG_DEBUG, "total samples: %"PRId64"\n", samples);
diff --git a/chromium/third_party/ffmpeg/libavformat/audiointerleave.c b/chromium/third_party/ffmpeg/libavformat/audiointerleave.c
index 2aa95f3dc6a..6d24ff5c7fe 100644
--- a/chromium/third_party/ffmpeg/libavformat/audiointerleave.c
+++ b/chromium/third_party/ffmpeg/libavformat/audiointerleave.c
@@ -34,7 +34,7 @@ void ff_audio_interleave_close(AVFormatContext *s)
AudioInterleaveContext *aic = st->priv_data;
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
- av_fifo_free(aic->fifo);
+ av_fifo_freep(&aic->fifo);
}
}
diff --git a/chromium/third_party/ffmpeg/libavformat/avformat.h b/chromium/third_party/ffmpeg/libavformat/avformat.h
index 6bd54cec64d..55a3cfbd35d 100644
--- a/chromium/third_party/ffmpeg/libavformat/avformat.h
+++ b/chromium/third_party/ffmpeg/libavformat/avformat.h
@@ -173,6 +173,58 @@
*
* @defgroup lavf_encoding Muxing
* @{
+ * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write
+ * it into files or other output bytestreams in the specified container format.
+ *
+ * The main API functions for muxing are avformat_write_header() for writing the
+ * file header, av_write_frame() / av_interleaved_write_frame() for writing the
+ * packets and av_write_trailer() for finalizing the file.
+ *
+ * At the beginning of the muxing process, the caller must first call
+ * avformat_alloc_context() to create a muxing context. The caller then sets up
+ * the muxer by filling the various fields in this context:
+ *
+ * - The @ref AVFormatContext.oformat "oformat" field must be set to select the
+ * muxer that will be used.
+ * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb
+ * "pb" field must be set to an opened IO context, either returned from
+ * avio_open2() or a custom one.
+ * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must
+ * be created with the avformat_new_stream() function. The caller should fill
+ * the @ref AVStream.codec "stream codec context" information, such as the
+ * codec @ref AVCodecContext.codec_type "type", @ref AVCodecContext.codec_id
+ * "id" and other parameters (e.g. width / height, the pixel or sample format,
+ * etc.) as known. The @ref AVCodecContext.time_base "codec timebase" should
+ * be set to the timebase that the caller desires to use for this stream (note
+ * that the timebase actually used by the muxer can be different, as will be
+ * described later).
+ * - The caller may fill in additional information, such as @ref
+ * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream"
+ * metadata, @ref AVFormatContext.chapters "chapters", @ref
+ * AVFormatContext.programs "programs", etc. as described in the
+ * AVFormatContext documentation. Whether such information will actually be
+ * stored in the output depends on what the container format and the muxer
+ * support.
+ *
+ * When the muxing context is fully set up, the caller must call
+ * avformat_write_header() to initialize the muxer internals and write the file
+ * header. Whether anything actually is written to the IO context at this step
+ * depends on the muxer, but this function must always be called. Any muxer
+ * private options must be passed in the options parameter to this function.
+ *
+ * The data is then sent to the muxer by repeatedly calling av_write_frame() or
+ * av_interleaved_write_frame() (consult those functions' documentation for
+ * discussion on the difference between them; only one of them may be used with
+ * a single muxing context, they should not be mixed). Do note that the timing
+ * information on the packets sent to the muxer must be in the corresponding
+ * AVStream's timebase. That timebase is set by the muxer (in the
+ * avformat_write_header() step) and may be different from the timebase the
+ * caller set on the codec context.
+ *
+ * Once all the data has been written, the caller must call av_write_trailer()
+ * to flush any buffered packets and finalize the output file, then close the IO
+ * context (if any) and finally free the muxing context with
+ * avformat_free_context().
* @}
*
* @defgroup lavf_io I/O Read/Write
@@ -209,6 +261,8 @@
struct AVFormatContext;
+struct AVDeviceInfoList;
+struct AVDeviceCapabilitiesQuery;
/**
* @defgroup metadata_api Public Metadata API
@@ -290,6 +344,7 @@ struct AVFormatContext;
* Allocate and read the payload of a packet and initialize its
* fields with default values.
*
+ * @param s associated IO context
* @param pkt packet
* @param size desired payload size
* @return >0 (read size) if OK, AVERROR_xxx otherwise
@@ -305,6 +360,7 @@ int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
* when there is no reasonable way to know (an upper bound of)
* the final size.
*
+ * @param s associated IO context
* @param pkt packet
* @param size amount of data to read
* @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data
@@ -338,6 +394,8 @@ typedef struct AVProbeData {
} AVProbeData;
#define AVPROBE_SCORE_RETRY (AVPROBE_SCORE_MAX/4)
+#define AVPROBE_SCORE_STREAM_RETRY (AVPROBE_SCORE_MAX/4-1)
+
#define AVPROBE_SCORE_EXTENSION 50 ///< score for file extension
#define AVPROBE_SCORE_MAX 100 ///< maximum score
@@ -453,6 +511,37 @@ typedef struct AVOutputFormat {
void (*get_output_timestamp)(struct AVFormatContext *s, int stream,
int64_t *dts, int64_t *wall);
+ /**
+ * Allows sending messages from application to device.
+ */
+ int (*control_message)(struct AVFormatContext *s, int type,
+ void *data, size_t data_size);
+
+ /**
+ * Write an uncoded AVFrame.
+ *
+ * See av_write_uncoded_frame() for details.
+ *
+ * The library will free *frame afterwards, but the muxer can prevent it
+ * by setting the pointer to NULL.
+ */
+ int (*write_uncoded_frame)(struct AVFormatContext *, int stream_index,
+ AVFrame **frame, unsigned flags);
+ /**
+ * Returns device list with it properties.
+ * @see avdevice_list_devices() for more details.
+ */
+ int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list);
+ /**
+ * Initialize device capabilities submodule.
+ * @see avdevice_capabilities_create() for more details.
+ */
+ int (*create_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
+ /**
+ * Free device capabilities submodule.
+ * @see avdevice_capabilities_free() for more details.
+ */
+ int (*free_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
} AVOutputFormat;
/**
* @}
@@ -581,6 +670,24 @@ typedef struct AVInputFormat {
* Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
*/
int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
+
+ /**
+ * Returns device list with it properties.
+ * @see avdevice_list_devices() for more details.
+ */
+ int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list);
+
+ /**
+ * Initialize device capabilities submodule.
+ * @see avdevice_capabilities_create() for more details.
+ */
+ int (*create_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
+
+ /**
+ * Free device capabilities submodule.
+ * @see avdevice_capabilities_free() for more details.
+ */
+ int (*free_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
} AVInputFormat;
/**
* @}
@@ -740,6 +847,30 @@ typedef struct AVStream {
*/
AVPacket attached_pic;
+ /**
+ * An array of side data that applies to the whole stream (i.e. the
+ * container does not allow it to change between packets).
+ *
+ * There may be no overlap between the side data in this array and side data
+ * in the packets. I.e. a given side data is either exported by the muxer
+ * (demuxing) / set by the caller (muxing) in this array, then it never
+ * appears in the packets, or the side data is exported / sent through
+ * the packets (always in the first packet where the value becomes known or
+ * changes), then it does not appear in this array.
+ *
+ * - demuxing: Set by libavformat when the stream is created.
+ * - muxing: May be set by the caller before avformat_write_header().
+ *
+ * Freed by libavformat in avformat_free_context().
+ *
+ * @see av_format_inject_global_side_data()
+ */
+ AVPacketSideData *side_data;
+ /**
+ * The number of elements in the AVStream.side_data array.
+ */
+ int nb_side_data;
+
/*****************************************************************
* All fields below this line are not part of the public API. They
* may not be used outside of libavformat and can be changed and
@@ -756,9 +887,16 @@ typedef struct AVStream {
int64_t last_dts;
int64_t duration_gcd;
int duration_count;
+ int64_t rfps_duration_sum;
double (*duration_error)[2][MAX_STD_TIMEBASES];
int64_t codec_info_duration;
int64_t codec_info_duration_fields;
+
+ /**
+ * 0 -> decoder has not been searched for yet.
+ * >0 -> decoder found
+ * <0 -> decoder with codec_id == -found_decoder has not been found
+ */
int found_decoder;
int64_t last_duration;
@@ -892,6 +1030,29 @@ typedef struct AVStream {
*/
int pts_wrap_behavior;
+ /**
+ * Internal data to prevent doing update_initial_durations() twice
+ */
+ int update_initial_durations_done;
+
+ /**
+ * Internal data to generate dts from pts
+ */
+ int64_t pts_reorder_error[MAX_REORDER_DELAY+1];
+ uint8_t pts_reorder_error_count[MAX_REORDER_DELAY+1];
+
+ /**
+ * Internal data to analyze DTS and detect faulty mpeg streams
+ */
+ int64_t last_dts_for_order_check;
+ uint8_t dts_ordered;
+ uint8_t dts_misordered;
+
+ /**
+ * Internal data to inject global side data
+ */
+ int inject_global_side_data;
+
} AVStream;
AVRational av_stream_get_r_frame_rate(const AVStream *s);
@@ -943,6 +1104,13 @@ typedef struct AVChapter {
/**
+ * Callback used by devices to communicate with application.
+ */
+typedef int (*av_format_control_message)(struct AVFormatContext *s, int type,
+ void *data, size_t data_size);
+
+
+/**
* The duration of a video can be estimated through various ways, and this enum can be used
* to know how the duration was estimated.
*/
@@ -952,6 +1120,8 @@ enum AVDurationEstimationMethod {
AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate)
};
+typedef struct AVFormatInternal AVFormatInternal;
+
/**
* Format I/O context.
* New fields can be added to the end with minor version bumps.
@@ -962,32 +1132,41 @@ enum AVDurationEstimationMethod {
*/
typedef struct AVFormatContext {
/**
- * A class for logging and AVOptions. Set by avformat_alloc_context().
+ * A class for logging and @ref avoptions. Set by avformat_alloc_context().
* Exports (de)muxer private options if they exist.
*/
const AVClass *av_class;
/**
- * Can only be iformat or oformat, not both at the same time.
+ * The input container format.
*
- * decoding: set by avformat_open_input().
- * encoding: set by the user.
+ * Demuxing only, set by avformat_open_input().
*/
struct AVInputFormat *iformat;
+
+ /**
+ * The output container format.
+ *
+ * Muxing only, must be set by the caller before avformat_write_header().
+ */
struct AVOutputFormat *oformat;
/**
* Format private data. This is an AVOptions-enabled struct
* if and only if iformat/oformat.priv_class is not NULL.
+ *
+ * - muxing: set by avformat_write_header()
+ * - demuxing: set by avformat_open_input()
*/
void *priv_data;
/**
* I/O context.
*
- * decoding: either set by the user before avformat_open_input() (then
- * the user must close it manually) or set by avformat_open_input().
- * encoding: set by the user.
+ * - demuxing: either set by the user before avformat_open_input() (then
+ * the user must close it manually) or set by avformat_open_input().
+ * - muxing: set by the user before avformat_write_header(). The caller must
+ * take care of closing / freeing the IO context.
*
* Do NOT set this field if AVFMT_NOFILE flag is set in
* iformat/oformat.flags. In such a case, the (de)muxer will handle
@@ -996,39 +1175,60 @@ typedef struct AVFormatContext {
AVIOContext *pb;
/* stream info */
- int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
+ /**
+ * Flags signalling stream properties. A combination of AVFMTCTX_*.
+ * Set by libavformat.
+ */
+ int ctx_flags;
/**
+ * Number of elements in AVFormatContext.streams.
+ *
+ * Set by avformat_new_stream(), must not be modified by any other code.
+ */
+ unsigned int nb_streams;
+ /**
* A list of all streams in the file. New streams are created with
* avformat_new_stream().
*
- * decoding: streams are created by libavformat in avformat_open_input().
- * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also
- * appear in av_read_frame().
- * encoding: streams are created by the user before avformat_write_header().
+ * - demuxing: streams are created by libavformat in avformat_open_input().
+ * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also
+ * appear in av_read_frame().
+ * - muxing: streams are created by the user before avformat_write_header().
+ *
+ * Freed by libavformat in avformat_free_context().
*/
- unsigned int nb_streams;
AVStream **streams;
- char filename[1024]; /**< input or output filename */
+ /**
+ * input or output filename
+ *
+ * - demuxing: set by avformat_open_input()
+ * - muxing: may be set by the caller before avformat_write_header()
+ */
+ char filename[1024];
/**
- * Decoding: position of the first frame of the component, in
+ * Position of the first frame of the component, in
* AV_TIME_BASE fractional seconds. NEVER set this value directly:
* It is deduced from the AVStream values.
+ *
+ * Demuxing only, set by libavformat.
*/
int64_t start_time;
/**
- * Decoding: duration of the stream, in AV_TIME_BASE fractional
+ * Duration of the stream, in AV_TIME_BASE fractional
* seconds. Only set this value if you know none of the individual stream
* durations and also do not set any of them. This is deduced from the
* AVStream values if not set.
+ *
+ * Demuxing only, set by libavformat.
*/
int64_t duration;
/**
- * Decoding: total stream bitrate in bit/s, 0 if not
+ * Total stream bitrate in bit/s, 0 if not
* available. Never set it directly if the file_size and the
* duration are known as FFmpeg can compute it automatically.
*/
@@ -1037,6 +1237,10 @@ typedef struct AVFormatContext {
unsigned int packet_size;
int max_delay;
+ /**
+ * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*.
+ * Set by the user before avformat_open_input() / avformat_write_header().
+ */
int flags;
#define AVFMT_FLAG_GENPTS 0x0001 ///< Generate missing pts even if it requires parsing future frames.
#define AVFMT_FLAG_IGNIDX 0x0002 ///< Ignore index.
@@ -1048,19 +1252,29 @@ typedef struct AVFormatContext {
#define AVFMT_FLAG_CUSTOM_IO 0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
#define AVFMT_FLAG_DISCARD_CORRUPT 0x0100 ///< Discard frames marked corrupted
#define AVFMT_FLAG_FLUSH_PACKETS 0x0200 ///< Flush the AVIOContext every packet.
+/**
+ * When muxing, try to avoid writing any random/volatile data to the output.
+ * This includes any random IDs, real-time timestamps/dates, muxer version, etc.
+ *
+ * This flag is mainly intended for testing.
+ */
+#define AVFMT_FLAG_BITEXACT 0x0400
#define AVFMT_FLAG_MP4A_LATM 0x8000 ///< Enable RTP MP4A-LATM payload
#define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted)
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Don't merge side data but keep it separate.
/**
- * decoding: size of data to probe; encoding: unused.
+ * Maximum size of the data read from input for determining
+ * the input container format.
+ * Demuxing only, set by the caller before avformat_open_input().
*/
unsigned int probesize;
/**
- * decoding: maximum time (in AV_TIME_BASE units) during which the input should
- * be analyzed in avformat_find_stream_info().
+ * Maximum duration (in AV_TIME_BASE units) of the data read
+ * from input in avformat_find_stream_info().
+ * Demuxing only, set by the caller before avformat_find_stream_info().
*/
int max_analyze_duration;
@@ -1095,8 +1309,8 @@ typedef struct AVFormatContext {
* accurate seeking (depends on demuxer).
* Demuxers for which a full in-memory index is mandatory will ignore
* this.
- * muxing : unused
- * demuxing: set by user
+ * - muxing: unused
+ * - demuxing: set by user
*/
unsigned int max_index_size;
@@ -1114,41 +1328,54 @@ typedef struct AVFormatContext {
* in the trailer. To write chapters in the trailer, nb_chapters
* must be zero when write_header is called and non-zero when
* write_trailer is called.
- * muxing : set by user
- * demuxing: set by libavformat
+ * - muxing: set by user
+ * - demuxing: set by libavformat
*/
unsigned int nb_chapters;
AVChapter **chapters;
+ /**
+ * Metadata that applies to the whole file.
+ *
+ * - demuxing: set by libavformat in avformat_open_input()
+ * - muxing: may be set by the caller before avformat_write_header()
+ *
+ * Freed by libavformat in avformat_free_context().
+ */
AVDictionary *metadata;
/**
* Start time of the stream in real world time, in microseconds
- * since the unix epoch (00:00 1st January 1970). That is, pts=0
- * in the stream was captured at this real world time.
- * - encoding: Set by user.
- * - decoding: Unused.
+ * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the
+ * stream was captured at this real world time.
+ * - muxing: Set by the caller before avformat_write_header(). If set to
+ * either 0 or AV_NOPTS_VALUE, then the current wall-time will
+ * be used.
+ * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that
+ * the value may become known after some number of frames
+ * have been received.
*/
int64_t start_time_realtime;
/**
- * decoding: number of frames used to probe fps
+ * The number of frames used for determining the framerate in
+ * avformat_find_stream_info().
+ * Demuxing only, set by the caller before avformat_find_stream_info().
*/
int fps_probe_size;
/**
* Error recognition; higher values will detect more errors but may
* misdetect some more or less valid parts as errors.
- * - encoding: unused
- * - decoding: Set by user.
+ * Demuxing only, set by the caller before avformat_open_input().
*/
int error_recognition;
/**
* Custom interrupt callbacks for the I/O layer.
*
- * decoding: set by the user before avformat_open_input().
- * encoding: set by the user before avformat_write_header()
+ * demuxing: set by the user before avformat_open_input().
+ * muxing: set by the user before avformat_write_header()
* (mainly useful for AVFMT_NOFILE formats). The callback
* should also be passed to avio_open2() if it's used to
* open the file.
@@ -1162,6 +1389,24 @@ typedef struct AVFormatContext {
#define FF_FDEBUG_TS 0x0001
/**
+ * Maximum buffering duration for interleaving.
+ *
+ * To ensure all the streams are interleaved correctly,
+ * av_interleaved_write_frame() will wait until it has at least one packet
+ * for each stream before actually writing any packets to the output file.
+ * When some streams are "sparse" (i.e. there are large gaps between
+ * successive packets), this can result in excessive buffering.
+ *
+ * This field specifies the maximum difference between the timestamps of the
+ * first and the last packet in the muxing queue, above which libavformat
+ * will output a packet regardless of whether it has queued a packet for all
+ * the streams.
+ *
+ * Muxing only, set by the caller before avformat_write_header().
+ */
+ int64_t max_interleave_delta;
+
+ /**
* Transport stream id.
* This will be moved into demuxer private options. Thus no API/ABI compatibility
*/
@@ -1235,14 +1480,14 @@ typedef struct AVFormatContext {
/**
* Correct single timestamp overflows
* - encoding: unused
- * - decoding: Set by user via AVOPtions (NO direct access)
+ * - decoding: Set by user via AVOptions (NO direct access)
*/
unsigned int correct_ts_overflow;
/**
* Force seeking to any (also non key) frames.
* - encoding: unused
- * - decoding: Set by user via AVOPtions (NO direct access)
+ * - decoding: Set by user via AVOptions (NO direct access)
*/
int seek2any;
@@ -1313,6 +1558,12 @@ typedef struct AVFormatContext {
AVRational offset_timebase;
/**
+ * An opaque field for libavformat internal usage.
+ * Must not be accessed in any way by callers.
+ */
+ AVFormatInternal *internal;
+
+ /**
* IO repositioned flag.
* This is set by avformat when the underlaying IO context read pointer
* is repositioned, for example when doing byte based seeking.
@@ -1343,6 +1594,31 @@ typedef struct AVFormatContext {
* Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access).
*/
AVCodec *subtitle_codec;
+
+ /**
+ * Number of bytes to be written as padding in a metadata header.
+ * Demuxing: Unused.
+ * Muxing: Set by user via av_format_set_metadata_header_padding.
+ */
+ int metadata_header_padding;
+
+ /**
+ * User data.
+ * This is a place for some private data of the user.
+ * Mostly usable with control_message_cb or any future callbacks in device's context.
+ */
+ void *opaque;
+
+ /**
+ * Callback used by devices to communicate with application.
+ */
+ av_format_control_message control_message_cb;
+
+ /**
+ * Output timestamp offset, in microseconds.
+ * Muxing: set by user via AVOptions (NO direct access)
+ */
+ int64_t output_ts_offset;
} AVFormatContext;
int av_format_get_probe_score(const AVFormatContext *s);
@@ -1352,6 +1628,18 @@ AVCodec * av_format_get_audio_codec(const AVFormatContext *s);
void av_format_set_audio_codec(AVFormatContext *s, AVCodec *c);
AVCodec * av_format_get_subtitle_codec(const AVFormatContext *s);
void av_format_set_subtitle_codec(AVFormatContext *s, AVCodec *c);
+int av_format_get_metadata_header_padding(const AVFormatContext *s);
+void av_format_set_metadata_header_padding(AVFormatContext *s, int c);
+void * av_format_get_opaque(const AVFormatContext *s);
+void av_format_set_opaque(AVFormatContext *s, void *opaque);
+av_format_control_message av_format_get_control_message_cb(const AVFormatContext *s);
+void av_format_set_control_message_cb(AVFormatContext *s, av_format_control_message callback);
+
+/**
+ * This function will cause global side data to be injected in the next packet
+ * of each stream as well as after any subsequent seek.
+ */
+void av_format_inject_global_side_data(AVFormatContext *s);
/**
* Returns the method used to set ctx->duration.
@@ -1465,6 +1753,7 @@ const AVClass *avformat_get_class(void);
* User is required to call avcodec_close() and avformat_free_context() to
* clean up the allocation by avformat_new_stream().
*
+ * @param s media file handle
* @param c If non-NULL, the AVCodecContext corresponding to the new stream
* will be initialized to use this codec. This is needed for e.g. codec-specific
* defaults to be set, so codec should be provided if it is known.
@@ -1522,6 +1811,7 @@ AVInputFormat *av_find_input_format(const char *short_name);
/**
* Guess the file format.
*
+ * @param pd data to be probed
* @param is_opened Whether the file is already opened; determines whether
* demuxers with or without AVFMT_NOFILE are probed.
*/
@@ -1530,6 +1820,7 @@ AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
/**
* Guess the file format.
*
+ * @param pd data to be probed
* @param is_opened Whether the file is already opened; determines whether
* demuxers with or without AVFMT_NOFILE are probed.
* @param score_max A probe score larger that this is required to accept a
@@ -1733,6 +2024,8 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt);
/**
* Seek to the keyframe at timestamp.
* 'timestamp' in 'stream_index'.
+ *
+ * @param s media file handle
* @param stream_index If stream_index is (-1), a default
* stream is selected, and timestamp is automatically converted
* from AV_TIME_BASE units to the stream specific time_base.
@@ -1760,6 +2053,7 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
* keyframes (this may not be supported by all demuxers).
* If flags contain AVSEEK_FLAG_BACKWARD, it is ignored.
*
+ * @param s media file handle
* @param stream_index index of the stream which is used as time base reference
* @param min_ts smallest acceptable timestamp
* @param ts target timestamp
@@ -1859,50 +2153,109 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options);
/**
* Write a packet to an output media file.
*
- * The packet shall contain one audio or video frame.
- * The packet must be correctly interleaved according to the container
- * specification, if not then av_interleaved_write_frame must be used.
+ * This function passes the packet directly to the muxer, without any buffering
+ * or reordering. The caller is responsible for correctly interleaving the
+ * packets if the format requires it. Callers that want libavformat to handle
+ * the interleaving should call av_interleaved_write_frame() instead of this
+ * function.
*
* @param s media file handle
- * @param pkt The packet, which contains the stream_index, buf/buf_size,
- * dts/pts, ...
- * This can be NULL (at any time, not just at the end), in
- * order to immediately flush data buffered within the muxer,
- * for muxers that buffer up data internally before writing it
- * to the output.
+ * @param pkt The packet containing the data to be written. Note that unlike
+ * av_interleaved_write_frame(), this function does not take
+ * ownership of the packet passed to it (though some muxers may make
+ * an internal reference to the input packet).
+ * <br>
+ * This parameter can be NULL (at any time, not just at the end), in
+ * order to immediately flush data buffered within the muxer, for
+ * muxers that buffer up data internally before writing it to the
+ * output.
+ * <br>
+ * Packet's @ref AVPacket.stream_index "stream_index" field must be
+ * set to the index of the corresponding stream in @ref
+ * AVFormatContext.streams "s->streams". It is very strongly
+ * recommended that timing information (@ref AVPacket.pts "pts", @ref
+ * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to
+ * correct values.
* @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush
+ *
+ * @see av_interleaved_write_frame()
*/
int av_write_frame(AVFormatContext *s, AVPacket *pkt);
/**
* Write a packet to an output media file ensuring correct interleaving.
*
- * The packet must contain one audio or video frame.
- * If the packets are already correctly interleaved, the application should
- * call av_write_frame() instead as it is slightly faster. It is also important
- * to keep in mind that completely non-interleaved input will need huge amounts
- * of memory to interleave with this, so it is preferable to interleave at the
- * demuxer level.
+ * This function will buffer the packets internally as needed to make sure the
+ * packets in the output file are properly interleaved in the order of
+ * increasing dts. Callers doing their own interleaving should call
+ * av_write_frame() instead of this function.
*
* @param s media file handle
- * @param pkt The packet containing the data to be written. pkt->buf must be set
- * to a valid AVBufferRef describing the packet data. Libavformat takes
- * ownership of this reference and will unref it when it sees fit. The caller
- * must not access the data through this reference after this function returns.
- * This can be NULL (at any time, not just at the end), to flush the
- * interleaving queues.
- * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the
- * index of the corresponding stream in @ref AVFormatContext.streams
- * "s.streams".
- * It is very strongly recommended that timing information (@ref AVPacket.pts
- * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to
- * correct values.
- *
- * @return 0 on success, a negative AVERROR on error.
+ * @param pkt The packet containing the data to be written.
+ * <br>
+ * If the packet is reference-counted, this function will take
+ * ownership of this reference and unreference it later when it sees
+ * fit.
+ * The caller must not access the data through this reference after
+ * this function returns. If the packet is not reference-counted,
+ * libavformat will make a copy.
+ * <br>
+ * This parameter can be NULL (at any time, not just at the end), to
+ * flush the interleaving queues.
+ * <br>
+ * Packet's @ref AVPacket.stream_index "stream_index" field must be
+ * set to the index of the corresponding stream in @ref
+ * AVFormatContext.streams "s->streams". It is very strongly
+ * recommended that timing information (@ref AVPacket.pts "pts", @ref
+ * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to
+ * correct values.
+ *
+ * @return 0 on success, a negative AVERROR on error. Libavformat will always
+ * take care of freeing the packet, even if this function fails.
+ *
+ * @see av_write_frame(), AVFormatContext.max_interleave_delta
*/
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
/**
+ * Write a uncoded frame to an output media file.
+ *
+ * The frame must be correctly interleaved according to the container
+ * specification; if not, then av_interleaved_write_frame() must be used.
+ *
+ * See av_interleaved_write_frame() for details.
+ */
+int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
+ AVFrame *frame);
+
+/**
+ * Write a uncoded frame to an output media file.
+ *
+ * If the muxer supports it, this function allows to write an AVFrame
+ * structure directly, without encoding it into a packet.
+ * It is mostly useful for devices and similar special muxers that use raw
+ * video or PCM data and will not serialize it into a byte stream.
+ *
+ * To test whether it is possible to use it with a given muxer and stream,
+ * use av_write_uncoded_frame_query().
+ *
+ * The caller gives up ownership of the frame and must not access it
+ * afterwards.
+ *
+ * @return >=0 for success, a negative code on error
+ */
+int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index,
+ AVFrame *frame);
+
+/**
+ * Test whether a muxer supports uncoded frame.
+ *
+ * @return >=0 if an uncoded frame can be written to that muxer and stream,
+ * <0 if not
+ */
+int av_write_uncoded_frame_query(AVFormatContext *s, int stream_index);
+
+/**
* Write the stream trailer to an output media file and free the
* file private data.
*
@@ -2002,7 +2355,7 @@ void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size);
* @param dump_payload True if the payload must be displayed, too.
* @param st AVStream that the packet belongs to
*/
-void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st);
+void av_pkt_dump2(FILE *f, const AVPacket *pkt, int dump_payload, const AVStream *st);
/**
@@ -2016,8 +2369,8 @@ void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st);
* @param dump_payload True if the payload must be displayed, too.
* @param st AVStream that the packet belongs to
*/
-void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
- AVStream *st);
+void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_payload,
+ const AVStream *st);
/**
* Get the AVCodecID for the given codec tag tag.
@@ -2025,6 +2378,7 @@ void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
*
* @param tags list of supported codec_id-codec_tag pairs, as stored
* in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+ * @param tag codec tag to match to a codec ID
*/
enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
@@ -2034,6 +2388,7 @@ enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned i
*
* @param tags list of supported codec_id-codec_tag pairs, as stored
* in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+ * @param id codec ID to match to a codec tag
*/
unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum AVCodecID id);
@@ -2053,6 +2408,9 @@ int av_find_default_stream_index(AVFormatContext *s);
/**
* Get the index for a specific timestamp.
+ *
+ * @param st stream that the timestamp belongs to
+ * @param timestamp timestamp to retrieve the index for
* @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond
* to the timestamp which is <= the requested one, if backward
* is 0, then it will be >=
@@ -2097,7 +2455,13 @@ void av_url_split(char *proto, int proto_size,
char *path, int path_size,
const char *url);
-
+/**
+ * log a nice Dump of input format context or output format context
+ * @param ic already initialized Format Context, must not be NULL.
+ * @param index index of the stream to dump information about
+ * @param url name of file or URL of stream to print information about
+ * @param is_output Select whether specified context is of input(0) or output(1)
+ */
void av_dump_format(AVFormatContext *ic,
int index,
const char *url,
@@ -2149,6 +2513,7 @@ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size);
* Return a positive value if the given filename has one of the given
* extensions, 0 otherwise.
*
+ * @param filename file name to check against the given extensions
* @param extensions a comma-separated list of filename extensions
*/
int av_match_ext(const char *filename, const char *extensions);
@@ -2156,6 +2521,8 @@ int av_match_ext(const char *filename, const char *extensions);
/**
* Test if the given container can store a codec.
*
+ * @param ofmt container to check for compatibility
+ * @param codec_id codec to potentially store in container
* @param std_compliance standards compliance level, one of FF_COMPLIANCE_*
*
* @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot.
@@ -2183,6 +2550,14 @@ const struct AVCodecTag *avformat_get_riff_video_tags(void);
* @return the table mapping RIFF FourCCs for audio to AVCodecID.
*/
const struct AVCodecTag *avformat_get_riff_audio_tags(void);
+/**
+ * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID.
+ */
+const struct AVCodecTag *avformat_get_mov_video_tags(void);
+/**
+ * @return the table mapping MOV FourCCs for audio to AVCodecID.
+ */
+const struct AVCodecTag *avformat_get_mov_audio_tags(void);
/**
* @}
diff --git a/chromium/third_party/ffmpeg/libavformat/avidec.c b/chromium/third_party/ffmpeg/libavformat/avidec.c
index 1c6b18c9805..0db9f32ef92 100644
--- a/chromium/third_party/ffmpeg/libavformat/avidec.c
+++ b/chromium/third_party/ffmpeg/libavformat/avidec.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdint.h>
+#include <inttypes.h>
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
@@ -34,6 +34,8 @@
#include "dv.h"
#include "internal.h"
#include "riff.h"
+#include "libavcodec/bytestream.h"
+#include "libavcodec/exif.h"
typedef struct AVIStream {
int64_t frame_offset; /* current frame (video) or byte (audio) counter
@@ -222,7 +224,7 @@ 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 && (len || !ast->sample_size))
+ if (last_pos != pos && len)
av_add_index_entry(st, pos, ast->cum_len, len, 0,
key ? AVINDEX_KEYFRAME : 0);
@@ -350,6 +352,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end)
uint16_t size = avio_rl16(s->pb);
const char *name = NULL;
char buffer[64] = { 0 };
+ size = FFMIN(size, tag_end - avio_tell(s->pb));
size -= avio_read(s->pb, buffer,
FFMIN(size, sizeof(buffer) - 1));
switch (tag) {
@@ -378,6 +381,84 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end)
}
}
+static int avi_extract_stream_metadata(AVStream *st)
+{
+ GetByteContext gb;
+ uint8_t *data = st->codec->extradata;
+ int data_size = st->codec->extradata_size;
+ int tag, offset;
+
+ if (!data || data_size < 8) {
+ return AVERROR_INVALIDDATA;
+ }
+
+ bytestream2_init(&gb, data, data_size);
+
+ tag = bytestream2_get_le32(&gb);
+
+ switch (tag) {
+ case MKTAG('A', 'V', 'I', 'F'):
+ // skip 4 byte padding
+ bytestream2_skip(&gb, 4);
+ offset = bytestream2_tell(&gb);
+ bytestream2_init(&gb, data + offset, data_size - offset);
+
+ // decode EXIF tags from IFD, AVI is always little-endian
+ return avpriv_exif_decode_ifd(st->codec, &gb, 1, 0, &st->metadata);
+ break;
+ case MKTAG('C', 'A', 'S', 'I'):
+ avpriv_request_sample(st->codec, "RIFF stream data tag type CASI (%u)", tag);
+ break;
+ case MKTAG('Z', 'o', 'r', 'a'):
+ avpriv_request_sample(st->codec, "RIFF stream data tag type Zora (%u)", tag);
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+static int calculate_bitrate(AVFormatContext *s)
+{
+ AVIContext *avi = s->priv_data;
+ int i, j;
+ int64_t lensum = 0;
+ int64_t maxpos = 0;
+
+ for (i = 0; i<s->nb_streams; i++) {
+ int64_t len = 0;
+ AVStream *st = s->streams[i];
+
+ if (!st->nb_index_entries)
+ continue;
+
+ for (j = 0; j < st->nb_index_entries; j++)
+ len += st->index_entries[j].size;
+ maxpos = FFMAX(maxpos, st->index_entries[j-1].pos);
+ lensum += len;
+ }
+ if (maxpos < avi->io_fsize*9/10) // index does not cover the whole file
+ return 0;
+ if (lensum*9/10 > maxpos || lensum < maxpos*9/10) // frame sum and filesize mismatch
+ return 0;
+
+ for (i = 0; i<s->nb_streams; i++) {
+ int64_t len = 0;
+ AVStream *st = s->streams[i];
+ int64_t duration;
+
+ for (j = 0; j < st->nb_index_entries; j++)
+ len += st->index_entries[j].size;
+
+ if (st->nb_index_entries < 2 || st->codec->bit_rate > 0)
+ continue;
+ duration = st->index_entries[j-1].timestamp - st->index_entries[0].timestamp;
+ st->codec->bit_rate = av_rescale(8*len, st->time_base.den, duration * st->time_base.num);
+ }
+ return 1;
+}
+
static int avi_read_header(AVFormatContext *s)
{
AVIContext *avi = s->priv_data;
@@ -556,7 +637,7 @@ static int avi_read_header(AVFormatContext *s)
ast->rate = avio_rl32(pb);
if (!(ast->scale && ast->rate)) {
av_log(s, AV_LOG_WARNING,
- "scale/rate is %u/%u which is invalid. "
+ "scale/rate is %"PRIu32"/%"PRIu32" which is invalid. "
"(This file has been generated by broken software.)\n",
ast->scale,
ast->rate);
@@ -590,6 +671,7 @@ static int avi_read_header(AVFormatContext *s)
codec_type = AVMEDIA_TYPE_VIDEO;
ast->sample_size = 0;
+ st->avg_frame_rate = av_inv_q(st->time_base);
break;
case MKTAG('a', 'u', 'd', 's'):
codec_type = AVMEDIA_TYPE_AUDIO;
@@ -654,11 +736,8 @@ static int avi_read_header(AVFormatContext *s)
st->codec->extradata_size = esize - 10 * 4;
} else
st->codec->extradata_size = size - 10 * 4;
- if (ff_alloc_extradata(st->codec, st->codec->extradata_size))
+ if (ff_get_extradata(st->codec, pb, st->codec->extradata_size) < 0)
return AVERROR(ENOMEM);
- avio_read(pb,
- st->codec->extradata,
- st->codec->extradata_size);
}
// FIXME: check if the encoder really did this correctly
@@ -691,6 +770,8 @@ static int avi_read_header(AVFormatContext *s)
/* This is needed to get the pict type which is necessary
* for generating correct pts. */
st->need_parsing = AVSTREAM_PARSE_HEADERS;
+ if (st->codec->codec_tag == MKTAG('V', 'S', 'S', 'H'))
+ st->need_parsing = AVSTREAM_PARSE_FULL;
if (st->codec->codec_tag == 0 && st->codec->height > 0 &&
st->codec->extradata_size < 1U << 30) {
@@ -783,13 +864,17 @@ static int avi_read_header(AVFormatContext *s)
st = s->streams[stream_index];
if (size<(1<<30)) {
- if (ff_alloc_extradata(st->codec, size))
+ if (ff_get_extradata(st->codec, pb, size) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, st->codec->extradata, st->codec->extradata_size);
}
if (st->codec->extradata_size & 1) //FIXME check if the encoder really did this correctly
avio_r8(pb);
+
+ ret = avi_extract_stream_metadata(st);
+ if (ret < 0) {
+ av_log(s, AV_LOG_WARNING, "could not decoding EXIF data in stream header.\n");
+ }
}
break;
case MKTAG('i', 'n', 'd', 'x'):
@@ -864,8 +949,13 @@ fail:
if (!avi->index_loaded && pb->seekable)
avi_load_index(s);
+ calculate_bitrate(s);
avi->index_loaded |= 1;
- avi->non_interleaved |= guess_ni_flag(s) | (s->flags & AVFMT_FLAG_SORT_DTS);
+
+ if ((ret = guess_ni_flag(s)) < 0)
+ return ret;
+
+ avi->non_interleaved |= ret | (s->flags & AVFMT_FLAG_SORT_DTS);
dict_entry = av_dict_get(s->metadata, "ISFT", NULL, 0);
if (dict_entry && !strcmp(dict_entry->value, "PotEncoder"))
@@ -905,12 +995,14 @@ fail:
static int read_gab2_sub(AVStream *st, AVPacket *pkt)
{
if (pkt->size >= 7 &&
+ pkt->size < INT_MAX - AVPROBE_PADDING_SIZE &&
!strcmp(pkt->data, "GAB2") && AV_RL16(pkt->data + 5) == 2) {
uint8_t desc[256];
int score = AVPROBE_SCORE_EXTENSION, ret;
AVIStream *ast = st->priv_data;
AVInputFormat *sub_demuxer;
AVRational time_base;
+ int size;
AVIOContext *pb = avio_alloc_context(pkt->data + 7,
pkt->size - 7,
0, NULL, NULL, NULL, NULL);
@@ -928,9 +1020,15 @@ static int read_gab2_sub(AVStream *st, AVPacket *pkt)
avio_rl16(pb); /* flags? */
avio_rl32(pb); /* data size */
- pd = (AVProbeData) { .buf = pb->buf_ptr,
- .buf_size = pb->buf_end - pb->buf_ptr };
- if (!(sub_demuxer = av_probe_input_format2(&pd, 1, &score)))
+ size = pb->buf_end - pb->buf_ptr;
+ pd = (AVProbeData) { .buf = av_mallocz(size + AVPROBE_PADDING_SIZE),
+ .buf_size = size };
+ if (!pd.buf)
+ goto error;
+ memcpy(pd.buf, pb->buf_ptr, size);
+ sub_demuxer = av_probe_input_format2(&pd, 1, &score);
+ av_freep(&pd.buf);
+ if (!sub_demuxer)
goto error;
if (!(ast->sub_ctx = avformat_alloc_context()))
@@ -1063,7 +1161,7 @@ start_sync:
ast = st->priv_data;
if (!ast) {
- av_log(s, AV_LOG_WARNING, "Skiping foreign stream %d packet\n", n);
+ av_log(s, AV_LOG_WARNING, "Skipping foreign stream %d packet\n", n);
continue;
}
@@ -1129,7 +1227,7 @@ start_sync:
ast->packet_size = size + 8;
ast->remaining = size;
- if (size || !ast->sample_size) {
+ if (size) {
uint64_t pos = avio_tell(pb) - 8;
if (!st->index_entries || !st->nb_index_entries ||
st->index_entries[st->nb_index_entries - 1].pos < pos) {
@@ -1316,7 +1414,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AVIndexEntry *e;
int index;
- index = av_index_search_timestamp(st, ast->frame_offset, 0);
+ index = av_index_search_timestamp(st, ast->frame_offset, AVSEEK_FLAG_ANY);
e = &st->index_entries[index];
if (index >= 0 && e->timestamp == ast->frame_offset) {
@@ -1456,14 +1554,69 @@ static int avi_read_idx1(AVFormatContext *s, int size)
return 0;
}
+/* Scan the index and consider any file with streams more than
+ * 2 seconds or 64MB apart non-interleaved. */
+static int check_stream_max_drift(AVFormatContext *s)
+{
+ int64_t min_pos, pos;
+ int i;
+ int *idx = av_mallocz_array(s->nb_streams, sizeof(*idx));
+ if (!idx)
+ return AVERROR(ENOMEM);
+ for (min_pos = pos = 0; min_pos != INT64_MAX; pos = min_pos + 1LU) {
+ int64_t max_dts = INT64_MIN / 2;
+ int64_t min_dts = INT64_MAX / 2;
+ int64_t max_buffer = 0;
+
+ min_pos = INT64_MAX;
+
+ for (i = 0; i < s->nb_streams; i++) {
+ AVStream *st = s->streams[i];
+ AVIStream *ast = st->priv_data;
+ int n = st->nb_index_entries;
+ while (idx[i] < n && st->index_entries[idx[i]].pos < pos)
+ idx[i]++;
+ if (idx[i] < n) {
+ int64_t dts;
+ dts = av_rescale_q(st->index_entries[idx[i]].timestamp /
+ FFMAX(ast->sample_size, 1),
+ st->time_base, AV_TIME_BASE_Q);
+ min_dts = FFMIN(min_dts, dts);
+ min_pos = FFMIN(min_pos, st->index_entries[idx[i]].pos);
+ }
+ }
+ for (i = 0; i < s->nb_streams; i++) {
+ AVStream *st = s->streams[i];
+ AVIStream *ast = st->priv_data;
+
+ if (idx[i] && min_dts != INT64_MAX / 2) {
+ int64_t dts;
+ dts = av_rescale_q(st->index_entries[idx[i] - 1].timestamp /
+ FFMAX(ast->sample_size, 1),
+ st->time_base, AV_TIME_BASE_Q);
+ max_dts = FFMAX(max_dts, dts);
+ max_buffer = FFMAX(max_buffer,
+ av_rescale(dts - min_dts,
+ st->codec->bit_rate,
+ AV_TIME_BASE));
+ }
+ }
+ if (max_dts - min_dts > 2 * AV_TIME_BASE ||
+ max_buffer > 1024 * 1024 * 8 * 8) {
+ av_free(idx);
+ return 1;
+ }
+ }
+ av_free(idx);
+ return 0;
+}
+
static int guess_ni_flag(AVFormatContext *s)
{
int i;
int64_t last_start = 0;
int64_t first_end = INT64_MAX;
int64_t oldpos = avio_tell(s->pb);
- int *idx;
- int64_t min_pos, pos;
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
@@ -1487,35 +1640,11 @@ static int guess_ni_flag(AVFormatContext *s)
first_end = st->index_entries[n - 1].pos;
}
avio_seek(s->pb, oldpos, SEEK_SET);
+
if (last_start > first_end)
return 1;
- idx= av_calloc(s->nb_streams, sizeof(*idx));
- if (!idx)
- return 0;
- for (min_pos=pos=0; min_pos!=INT64_MAX; pos= min_pos+1LU) {
- int64_t max_dts = INT64_MIN/2, min_dts= INT64_MAX/2;
- min_pos = INT64_MAX;
- for (i=0; i<s->nb_streams; i++) {
- AVStream *st = s->streams[i];
- AVIStream *ast = st->priv_data;
- int n= st->nb_index_entries;
- while (idx[i]<n && st->index_entries[idx[i]].pos < pos)
- idx[i]++;
- if (idx[i] < n) {
- min_dts = FFMIN(min_dts, av_rescale_q(st->index_entries[idx[i]].timestamp/FFMAX(ast->sample_size, 1), st->time_base, AV_TIME_BASE_Q));
- min_pos = FFMIN(min_pos, st->index_entries[idx[i]].pos);
- }
- if (idx[i])
- max_dts = FFMAX(max_dts, av_rescale_q(st->index_entries[idx[i]-1].timestamp/FFMAX(ast->sample_size, 1), st->time_base, AV_TIME_BASE_Q));
- }
- if (max_dts - min_dts > 2*AV_TIME_BASE) {
- av_free(idx);
- return 1;
- }
- }
- av_free(idx);
- return 0;
+ return check_stream_max_drift(s);
}
static int avi_load_index(AVFormatContext *s)
@@ -1734,6 +1863,7 @@ AVInputFormat ff_avi_demuxer = {
.name = "avi",
.long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
.priv_data_size = sizeof(AVIContext),
+ .extensions = "avi",
.read_probe = avi_probe,
.read_header = avi_read_header,
.read_packet = avi_read_packet,
diff --git a/chromium/third_party/ffmpeg/libavformat/avienc.c b/chromium/third_party/ffmpeg/libavformat/avienc.c
index 45f7a203da8..89e2a539a05 100644
--- a/chromium/third_party/ffmpeg/libavformat/avienc.c
+++ b/chromium/third_party/ffmpeg/libavformat/avienc.c
@@ -32,6 +32,8 @@
#include "libavutil/dict.h"
#include "libavutil/avassert.h"
#include "libavutil/timestamp.h"
+#include "libavutil/pixdesc.h"
+#include "libavcodec/raw.h"
/*
* TODO:
@@ -64,9 +66,9 @@ typedef struct {
int entry;
AVIIndex indexes;
-} AVIStream ;
+} AVIStream;
-static inline AVIIentry* avi_get_ientry(AVIIndex* idx, int ent_id)
+static inline AVIIentry *avi_get_ientry(AVIIndex *idx, int ent_id)
{
int cl = ent_id / AVI_INDEX_CLUSTER_SIZE;
int id = ent_id % AVI_INDEX_CLUSTER_SIZE;
@@ -74,15 +76,15 @@ static inline AVIIentry* avi_get_ientry(AVIIndex* idx, int ent_id)
}
static int64_t avi_start_new_riff(AVFormatContext *s, AVIOContext *pb,
- const char* riff_tag, const char* list_tag)
+ const char *riff_tag, const char *list_tag)
{
- AVIContext *avi= s->priv_data;
+ AVIContext *avi = s->priv_data;
int64_t loff;
int i;
avi->riff_id++;
- for (i=0; i<s->nb_streams; i++){
- AVIStream *avist= s->streams[i]->priv_data;
+ for (i = 0; i < s->nb_streams; i++) {
+ AVIStream *avist = s->streams[i]->priv_data;
avist->indexes.entry = 0;
}
@@ -93,10 +95,10 @@ static int64_t avi_start_new_riff(AVFormatContext *s, AVIOContext *pb,
return loff;
}
-static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type)
+static char *avi_stream2fourcc(char *tag, int index, enum AVMediaType type)
{
- tag[0] = '0' + index/10;
- tag[1] = '0' + index%10;
+ tag[0] = '0' + index / 10;
+ tag[1] = '0' + index % 10;
if (type == AVMEDIA_TYPE_VIDEO) {
tag[2] = 'd';
tag[3] = 'c';
@@ -112,31 +114,30 @@ static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type)
return tag;
}
-static int avi_write_counters(AVFormatContext* s, int riff_id)
+static int avi_write_counters(AVFormatContext *s, int riff_id)
{
AVIOContext *pb = s->pb;
AVIContext *avi = s->priv_data;
int n, au_byterate, au_ssize, au_scale, nb_frames = 0;
int64_t file_size;
- AVCodecContext* stream;
+ AVCodecContext *stream;
file_size = avio_tell(pb);
- for(n = 0; n < s->nb_streams; n++) {
- AVIStream *avist= s->streams[n]->priv_data;
+ for (n = 0; n < s->nb_streams; n++) {
+ AVIStream *avist = s->streams[n]->priv_data;
av_assert0(avist->frames_hdr_strm);
stream = s->streams[n]->codec;
avio_seek(pb, avist->frames_hdr_strm, SEEK_SET);
ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
- if(au_ssize == 0) {
+ if (au_ssize == 0)
avio_wl32(pb, avist->packet_count);
- } else {
+ else
avio_wl32(pb, avist->audio_strm_length / au_ssize);
- }
- if(stream->codec_type == AVMEDIA_TYPE_VIDEO)
+ if (stream->codec_type == AVMEDIA_TYPE_VIDEO)
nb_frames = FFMAX(nb_frames, avist->packet_count);
}
- if(riff_id == 1) {
+ if (riff_id == 1) {
av_assert0(avi->frames_hdr_all);
avio_seek(pb, avi->frames_hdr_all, SEEK_SET);
avio_wl32(pb, nb_frames);
@@ -154,6 +155,7 @@ static int avi_write_header(AVFormatContext *s)
AVCodecContext *stream, *video_enc;
int64_t list1, list2, strh, strf;
AVDictionaryEntry *t = NULL;
+ int padding;
if (s->nb_streams > AVI_MAX_STREAM_COUNT) {
av_log(s, AV_LOG_ERROR, "AVI does not support >%d streams\n",
@@ -161,9 +163,9 @@ static int avi_write_header(AVFormatContext *s)
return AVERROR(EINVAL);
}
- for(n=0;n<s->nb_streams;n++) {
- s->streams[n]->priv_data= av_mallocz(sizeof(AVIStream));
- if(!s->streams[n]->priv_data)
+ for (n = 0; n < s->nb_streams; n++) {
+ s->streams[n]->priv_data = av_mallocz(sizeof(AVIStream));
+ if (!s->streams[n]->priv_data)
return AVERROR(ENOMEM);
}
@@ -177,8 +179,8 @@ static int avi_write_header(AVFormatContext *s)
bitrate = 0;
video_enc = NULL;
- for(n=0;n<s->nb_streams;n++) {
- stream = s->streams[n]->codec;
+ for (n = 0; n < s->nb_streams; n++) {
+ stream = s->streams[n]->codec;
bitrate += stream->bit_rate;
if (stream->codec_type == AVMEDIA_TYPE_VIDEO)
video_enc = stream;
@@ -186,23 +188,23 @@ static int avi_write_header(AVFormatContext *s)
nb_frames = 0;
- if(video_enc){
- avio_wl32(pb, (uint32_t)(INT64_C(1000000) * video_enc->time_base.num / video_enc->time_base.den));
- } else {
+ if (video_enc)
+ avio_wl32(pb, (uint32_t) (INT64_C(1000000) * video_enc->time_base.num /
+ video_enc->time_base.den));
+ else
avio_wl32(pb, 0);
- }
avio_wl32(pb, bitrate / 8); /* XXX: not quite exact */
avio_wl32(pb, 0); /* padding */
if (!pb->seekable)
- avio_wl32(pb, AVIF_TRUSTCKTYPE | AVIF_ISINTERLEAVED); /* flags */
+ avio_wl32(pb, AVIF_TRUSTCKTYPE | AVIF_ISINTERLEAVED); /* flags */
else
- avio_wl32(pb, AVIF_TRUSTCKTYPE | AVIF_HASINDEX | AVIF_ISINTERLEAVED); /* flags */
+ avio_wl32(pb, AVIF_TRUSTCKTYPE | AVIF_HASINDEX | AVIF_ISINTERLEAVED); /* flags */
avi->frames_hdr_all = avio_tell(pb); /* remember this offset to fill later */
avio_wl32(pb, nb_frames); /* nb frames, filled later */
avio_wl32(pb, 0); /* initial frame */
avio_wl32(pb, s->nb_streams); /* nb streams */
avio_wl32(pb, 1024 * 1024); /* suggested buffer size */
- if(video_enc){
+ if (video_enc) {
avio_wl32(pb, video_enc->width);
avio_wl32(pb, video_enc->height);
} else {
@@ -215,8 +217,8 @@ static int avi_write_header(AVFormatContext *s)
avio_wl32(pb, 0); /* reserved */
/* stream list */
- for(i=0;i<n;i++) {
- AVIStream *avist= s->streams[i]->priv_data;
+ for (i = 0; i < n; i++) {
+ AVIStream *avist = s->streams[i]->priv_data;
list2 = ff_start_tag(pb, "LIST");
ffio_wfourcc(pb, "strl");
@@ -224,21 +226,30 @@ static int avi_write_header(AVFormatContext *s)
/* stream generic header */
strh = ff_start_tag(pb, "strh");
- switch(stream->codec_type) {
+ switch (stream->codec_type) {
case AVMEDIA_TYPE_SUBTITLE:
// XSUB subtitles behave like video tracks, other subtitles
// are not (yet) supported.
if (stream->codec_id != AV_CODEC_ID_XSUB) {
- av_log(s, AV_LOG_ERROR, "Subtitle streams other than DivX XSUB are not supported by the AVI muxer.\n");
+ av_log(s, AV_LOG_ERROR,
+ "Subtitle streams other than DivX XSUB are not supported by the AVI muxer.\n");
return AVERROR_PATCHWELCOME;
}
- case AVMEDIA_TYPE_VIDEO: ffio_wfourcc(pb, "vids"); break;
- case AVMEDIA_TYPE_AUDIO: ffio_wfourcc(pb, "auds"); break;
-// case AVMEDIA_TYPE_TEXT : ffio_wfourcc(pb, "txts"); break;
- case AVMEDIA_TYPE_DATA : ffio_wfourcc(pb, "dats"); break;
+ case AVMEDIA_TYPE_VIDEO:
+ ffio_wfourcc(pb, "vids");
+ break;
+ case AVMEDIA_TYPE_AUDIO:
+ ffio_wfourcc(pb, "auds");
+ break;
+// case AVMEDIA_TYPE_TEXT:
+// ffio_wfourcc(pb, "txts");
+// break;
+ case AVMEDIA_TYPE_DATA:
+ ffio_wfourcc(pb, "dats");
+ break;
}
- if(stream->codec_type == AVMEDIA_TYPE_VIDEO ||
- stream->codec_id == AV_CODEC_ID_XSUB)
+ if (stream->codec_type == AVMEDIA_TYPE_VIDEO ||
+ stream->codec_id == AV_CODEC_ID_XSUB)
avio_wl32(pb, stream->codec_tag);
else
avio_wl32(pb, 1);
@@ -256,23 +267,25 @@ static int avi_write_header(AVFormatContext *s)
au_scale = 1;
}
avpriv_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
- if(stream->codec_id == AV_CODEC_ID_XSUB)
+ if (stream->codec_id == AV_CODEC_ID_XSUB)
au_scale = au_byterate = 0;
avio_wl32(pb, au_scale); /* scale */
avio_wl32(pb, au_byterate); /* rate */
avio_wl32(pb, 0); /* start */
- avist->frames_hdr_strm = avio_tell(pb); /* remember this offset to fill later */
+ /* remember this offset to fill later */
+ avist->frames_hdr_strm = avio_tell(pb);
if (!pb->seekable)
- avio_wl32(pb, AVI_MAX_RIFF_SIZE); /* FIXME: this may be broken, but who cares */
+ /* FIXME: this may be broken, but who cares */
+ avio_wl32(pb, AVI_MAX_RIFF_SIZE);
else
- avio_wl32(pb, 0); /* length, XXX: filled later */
+ avio_wl32(pb, 0); /* length, XXX: filled later */
/* suggested buffer size */ //FIXME set at the end to largest chunk
- if(stream->codec_type == AVMEDIA_TYPE_VIDEO)
+ if (stream->codec_type == AVMEDIA_TYPE_VIDEO)
avio_wl32(pb, 1024 * 1024);
- else if(stream->codec_type == AVMEDIA_TYPE_AUDIO)
+ else if (stream->codec_type == AVMEDIA_TYPE_AUDIO)
avio_wl32(pb, 12 * 1024);
else
avio_wl32(pb, 0);
@@ -283,45 +296,60 @@ static int avi_write_header(AVFormatContext *s)
avio_wl16(pb, stream->height);
ff_end_tag(pb, strh);
- if(stream->codec_type != AVMEDIA_TYPE_DATA){
- int ret;
-
- strf = ff_start_tag(pb, "strf");
- switch(stream->codec_type) {
- case AVMEDIA_TYPE_SUBTITLE:
- // XSUB subtitles behave like video tracks, other subtitles
- // are not (yet) supported.
- if (stream->codec_id != AV_CODEC_ID_XSUB) break;
- case AVMEDIA_TYPE_VIDEO:
- ff_put_bmp_header(pb, stream, ff_codec_bmp_tags, 0);
- break;
- case AVMEDIA_TYPE_AUDIO:
- if ((ret = ff_put_wav_header(pb, stream)) < 0) {
- return ret;
+ if (stream->codec_type != AVMEDIA_TYPE_DATA) {
+ int ret;
+ enum AVPixelFormat pix_fmt;
+
+ strf = ff_start_tag(pb, "strf");
+ switch (stream->codec_type) {
+ case AVMEDIA_TYPE_SUBTITLE:
+ /* XSUB subtitles behave like video tracks, other subtitles
+ * are not (yet) supported. */
+ if (stream->codec_id != AV_CODEC_ID_XSUB)
+ break;
+ case AVMEDIA_TYPE_VIDEO:
+ /* WMP expects RGB 5:5:5 rawvideo in avi to have bpp set to 16. */
+ if ( !stream->codec_tag
+ && stream->codec_id == AV_CODEC_ID_RAWVIDEO
+ && stream->pix_fmt == AV_PIX_FMT_RGB555LE
+ && stream->bits_per_coded_sample == 15)
+ stream->bits_per_coded_sample = 16;
+ ff_put_bmp_header(pb, stream, ff_codec_bmp_tags, 0, 0);
+ pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_avi,
+ stream->bits_per_coded_sample);
+ if ( !stream->codec_tag
+ && stream->codec_id == AV_CODEC_ID_RAWVIDEO
+ && stream->pix_fmt != pix_fmt
+ && stream->pix_fmt != AV_PIX_FMT_NONE)
+ av_log(s, AV_LOG_ERROR, "%s rawvideo cannot be written to avi, output file will be unreadable\n",
+ av_get_pix_fmt_name(stream->pix_fmt));
+ break;
+ case AVMEDIA_TYPE_AUDIO:
+ if ((ret = ff_put_wav_header(pb, stream, 0)) < 0)
+ return ret;
+ break;
+ default:
+ av_log(s, AV_LOG_ERROR,
+ "Invalid or not supported codec type '%s' found in the input\n",
+ (char *)av_x_if_null(av_get_media_type_string(stream->codec_type), "?"));
+ return AVERROR(EINVAL);
}
- break;
- default:
- av_log(s, AV_LOG_ERROR,
- "Invalid or not supported codec type '%s' found in the input\n",
- (char *)av_x_if_null(av_get_media_type_string(stream->codec_type), "?"));
- return AVERROR(EINVAL);
- }
- ff_end_tag(pb, strf);
- if ((t = av_dict_get(s->streams[i]->metadata, "title", NULL, 0))) {
- ff_riff_write_info_tag(s->pb, "strn", t->value);
- t = NULL;
- }
- if(stream->codec_id == AV_CODEC_ID_XSUB
- && (t = av_dict_get(s->streams[i]->metadata, "language", NULL, 0))) {
- const char* langstr = av_convert_lang_to(t->value, AV_LANG_ISO639_1);
- t = NULL;
- if (langstr) {
- char* str = av_asprintf("Subtitle - %s-xx;02", langstr);
- ff_riff_write_info_tag(s->pb, "strn", str);
- av_free(str);
+ ff_end_tag(pb, strf);
+ if ((t = av_dict_get(s->streams[i]->metadata, "title", NULL, 0))) {
+ ff_riff_write_info_tag(s->pb, "strn", t->value);
+ t = NULL;
+ }
+ if (stream->codec_id == AV_CODEC_ID_XSUB
+ && (t = av_dict_get(s->streams[i]->metadata, "language", NULL, 0))) {
+ const char* langstr = av_convert_lang_to(t->value, AV_LANG_ISO639_1);
+ t = NULL;
+ if (langstr) {
+ char* str = av_asprintf("Subtitle - %s-xx;02", langstr);
+ ff_riff_write_info_tag(s->pb, "strn", str);
+ av_free(str);
+ }
}
}
- }
if (pb->seekable) {
unsigned char tag[5];
@@ -330,47 +358,47 @@ static int avi_write_header(AVFormatContext *s)
/* Starting to lay out AVI OpenDML master index.
* We want to make it JUNK entry for now, since we'd
* like to get away without making AVI an OpenDML one
- * for compatibility reasons.
- */
- avist->indexes.entry = avist->indexes.ents_allocated = 0;
+ * for compatibility reasons. */
+ avist->indexes.entry = avist->indexes.ents_allocated = 0;
avist->indexes.indx_start = ff_start_tag(pb, "JUNK");
- avio_wl16(pb, 4); /* wLongsPerEntry */
- avio_w8(pb, 0); /* bIndexSubType (0 == frame index) */
- avio_w8(pb, 0); /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
- avio_wl32(pb, 0); /* nEntriesInUse (will fill out later on) */
+ avio_wl16(pb, 4); /* wLongsPerEntry */
+ avio_w8(pb, 0); /* bIndexSubType (0 == frame index) */
+ avio_w8(pb, 0); /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
+ avio_wl32(pb, 0); /* nEntriesInUse (will fill out later on) */
ffio_wfourcc(pb, avi_stream2fourcc(tag, i, stream->codec_type));
- /* dwChunkId */
- avio_wl64(pb, 0); /* dwReserved[3]
- avio_wl32(pb, 0); Must be 0. */
- for (j=0; j < AVI_MASTER_INDEX_SIZE * 2; j++)
- avio_wl64(pb, 0);
+ /* dwChunkId */
+ avio_wl64(pb, 0); /* dwReserved[3] */
+ // avio_wl32(pb, 0); /* Must be 0. */
+ for (j = 0; j < AVI_MASTER_INDEX_SIZE * 2; j++)
+ avio_wl64(pb, 0);
ff_end_tag(pb, avist->indexes.indx_start);
}
- if( stream->codec_type == AVMEDIA_TYPE_VIDEO
- && s->streams[i]->sample_aspect_ratio.num>0
- && s->streams[i]->sample_aspect_ratio.den>0){
- int vprp= ff_start_tag(pb, "vprp");
+ if (stream->codec_type == AVMEDIA_TYPE_VIDEO &&
+ s->streams[i]->sample_aspect_ratio.num > 0 &&
+ s->streams[i]->sample_aspect_ratio.den > 0) {
+ int vprp = ff_start_tag(pb, "vprp");
AVRational dar = av_mul_q(s->streams[i]->sample_aspect_ratio,
- (AVRational){stream->width, stream->height});
+ (AVRational) { stream->width,
+ stream->height });
int num, den;
av_reduce(&num, &den, dar.num, dar.den, 0xFFFF);
- avio_wl32(pb, 0); //video format = unknown
- avio_wl32(pb, 0); //video standard= unknown
- avio_wl32(pb, lrintf(1.0/av_q2d(stream->time_base)));
- avio_wl32(pb, stream->width );
+ avio_wl32(pb, 0); // video format = unknown
+ avio_wl32(pb, 0); // video standard = unknown
+ avio_wl32(pb, lrintf(1.0 / av_q2d(stream->time_base)));
+ avio_wl32(pb, stream->width);
avio_wl32(pb, stream->height);
avio_wl16(pb, den);
avio_wl16(pb, num);
- avio_wl32(pb, stream->width );
+ avio_wl32(pb, stream->width);
avio_wl32(pb, stream->height);
- avio_wl32(pb, 1); //progressive FIXME
+ avio_wl32(pb, 1); // progressive FIXME
avio_wl32(pb, stream->height);
- avio_wl32(pb, stream->width );
+ avio_wl32(pb, stream->width);
avio_wl32(pb, stream->height);
- avio_wl32(pb, stream->width );
+ avio_wl32(pb, stream->width);
avio_wl32(pb, 0);
avio_wl32(pb, 0);
@@ -388,8 +416,8 @@ static int avi_write_header(AVFormatContext *s)
ffio_wfourcc(pb, "odml");
ffio_wfourcc(pb, "dmlh");
avio_wl32(pb, 248);
- for (i = 0; i < 248; i+= 4)
- avio_wl32(pb, 0);
+ for (i = 0; i < 248; i += 4)
+ avio_wl32(pb, 0);
ff_end_tag(pb, avi->odml_list);
}
@@ -397,11 +425,18 @@ static int avi_write_header(AVFormatContext *s)
ff_riff_write_info(s);
+
+ padding = s->metadata_header_padding;
+ if (padding < 0)
+ padding = 1016;
+
/* some padding for easier tag editing */
- list2 = ff_start_tag(pb, "JUNK");
- for (i = 0; i < 1016; i += 4)
- avio_wl32(pb, 0);
- ff_end_tag(pb, list2);
+ if (padding) {
+ list2 = ff_start_tag(pb, "JUNK");
+ for (i = padding; i > 0; i -= 4)
+ avio_wl32(pb, 0);
+ ff_end_tag(pb, list2);
+ }
avi->movi_list = ff_start_tag(pb, "LIST");
ffio_wfourcc(pb, "movi");
@@ -427,47 +462,47 @@ static int avi_write_ix(AVFormatContext *s)
return AVERROR(EINVAL);
}
- for (i=0;i<s->nb_streams;i++) {
- AVIStream *avist= s->streams[i]->priv_data;
- int64_t ix, pos;
-
- avi_stream2fourcc(tag, i, s->streams[i]->codec->codec_type);
- ix_tag[3] = '0' + i;
-
- /* Writing AVI OpenDML leaf index chunk */
- ix = avio_tell(pb);
- ffio_wfourcc(pb, ix_tag); /* ix?? */
- avio_wl32(pb, avist->indexes.entry * 8 + 24);
- /* chunk size */
- avio_wl16(pb, 2); /* wLongsPerEntry */
- avio_w8(pb, 0); /* bIndexSubType (0 == frame index) */
- avio_w8(pb, 1); /* bIndexType (1 == AVI_INDEX_OF_CHUNKS) */
- avio_wl32(pb, avist->indexes.entry);
- /* nEntriesInUse */
- ffio_wfourcc(pb, tag); /* dwChunkId */
- avio_wl64(pb, avi->movi_list);/* qwBaseOffset */
- avio_wl32(pb, 0); /* dwReserved_3 (must be 0) */
-
- for (j=0; j<avist->indexes.entry; j++) {
- AVIIentry* ie = avi_get_ientry(&avist->indexes, j);
- avio_wl32(pb, ie->pos + 8);
- avio_wl32(pb, ((uint32_t)ie->len & ~0x80000000) |
+ for (i = 0; i < s->nb_streams; i++) {
+ AVIStream *avist = s->streams[i]->priv_data;
+ int64_t ix, pos;
+
+ avi_stream2fourcc(tag, i, s->streams[i]->codec->codec_type);
+ ix_tag[3] = '0' + i;
+
+ /* Writing AVI OpenDML leaf index chunk */
+ ix = avio_tell(pb);
+ ffio_wfourcc(pb, ix_tag); /* ix?? */
+ avio_wl32(pb, avist->indexes.entry * 8 + 24);
+ /* chunk size */
+ avio_wl16(pb, 2); /* wLongsPerEntry */
+ avio_w8(pb, 0); /* bIndexSubType (0 == frame index) */
+ avio_w8(pb, 1); /* bIndexType (1 == AVI_INDEX_OF_CHUNKS) */
+ avio_wl32(pb, avist->indexes.entry);
+ /* nEntriesInUse */
+ ffio_wfourcc(pb, tag); /* dwChunkId */
+ avio_wl64(pb, avi->movi_list); /* qwBaseOffset */
+ avio_wl32(pb, 0); /* dwReserved_3 (must be 0) */
+
+ for (j = 0; j < avist->indexes.entry; j++) {
+ AVIIentry *ie = avi_get_ientry(&avist->indexes, j);
+ avio_wl32(pb, ie->pos + 8);
+ avio_wl32(pb, ((uint32_t) ie->len & ~0x80000000) |
(ie->flags & 0x10 ? 0 : 0x80000000));
- }
- avio_flush(pb);
- pos = avio_tell(pb);
-
- /* Updating one entry in the AVI OpenDML master index */
- avio_seek(pb, avist->indexes.indx_start - 8, SEEK_SET);
- ffio_wfourcc(pb, "indx"); /* enabling this entry */
- avio_skip(pb, 8);
- avio_wl32(pb, avi->riff_id); /* nEntriesInUse */
- avio_skip(pb, 16*avi->riff_id);
- avio_wl64(pb, ix); /* qwOffset */
- avio_wl32(pb, pos - ix); /* dwSize */
- avio_wl32(pb, avist->indexes.entry); /* dwDuration */
-
- avio_seek(pb, pos, SEEK_SET);
+ }
+ avio_flush(pb);
+ pos = avio_tell(pb);
+
+ /* Updating one entry in the AVI OpenDML master index */
+ avio_seek(pb, avist->indexes.indx_start - 8, SEEK_SET);
+ ffio_wfourcc(pb, "indx"); /* enabling this entry */
+ avio_skip(pb, 8);
+ avio_wl32(pb, avi->riff_id); /* nEntriesInUse */
+ avio_skip(pb, 16 * avi->riff_id);
+ avio_wl64(pb, ix); /* qwOffset */
+ avio_wl32(pb, pos - ix); /* dwSize */
+ avio_wl32(pb, avist->indexes.entry); /* dwDuration */
+
+ avio_seek(pb, pos, SEEK_SET);
}
return 0;
}
@@ -482,31 +517,31 @@ static int avi_write_idx1(AVFormatContext *s)
if (pb->seekable) {
AVIStream *avist;
- AVIIentry* ie = 0, *tie;
+ AVIIentry *ie = 0, *tie;
int empty, stream_id = -1;
idx_chunk = ff_start_tag(pb, "idx1");
- for(i=0; i<s->nb_streams; i++){
- avist= s->streams[i]->priv_data;
- avist->entry=0;
+ for (i = 0; i < s->nb_streams; i++) {
+ avist = s->streams[i]->priv_data;
+ avist->entry = 0;
}
do {
empty = 1;
- for (i=0; i<s->nb_streams; i++) {
- avist= s->streams[i]->priv_data;
- if (avist->indexes.entry <= avist->entry)
- continue;
-
- tie = avi_get_ientry(&avist->indexes, avist->entry);
- if (empty || tie->pos < ie->pos) {
- ie = tie;
- stream_id = i;
- }
- empty = 0;
+ for (i = 0; i < s->nb_streams; i++) {
+ avist = s->streams[i]->priv_data;
+ if (avist->indexes.entry <= avist->entry)
+ continue;
+
+ tie = avi_get_ientry(&avist->indexes, avist->entry);
+ if (empty || tie->pos < ie->pos) {
+ ie = tie;
+ stream_id = i;
+ }
+ empty = 0;
}
if (!empty) {
- avist= s->streams[stream_id]->priv_data;
+ avist = s->streams[stream_id]->priv_data;
avi_stream2fourcc(tag, stream_id,
s->streams[stream_id]->codec->codec_type);
ffio_wfourcc(pb, tag);
@@ -525,28 +560,29 @@ static int avi_write_idx1(AVFormatContext *s)
static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
{
- AVIContext *avi = s->priv_data;
- AVIOContext *pb = s->pb;
unsigned char tag[5];
- unsigned int flags=0;
- const int stream_index= pkt->stream_index;
- AVIStream *avist= s->streams[stream_index]->priv_data;
- AVCodecContext *enc= s->streams[stream_index]->codec;
- int size= pkt->size;
+ unsigned int flags = 0;
+ const int stream_index = pkt->stream_index;
+ int size = pkt->size;
+ AVIContext *avi = s->priv_data;
+ AVIOContext *pb = s->pb;
+ AVIStream *avist = s->streams[stream_index]->priv_data;
+ AVCodecContext *enc = s->streams[stream_index]->codec;
av_dlog(s, "dts:%s packet_count:%d stream_index:%d\n", av_ts2str(pkt->dts), avist->packet_count, stream_index);
- while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count && enc->codec_id != AV_CODEC_ID_XSUB && avist->packet_count){
+ while (enc->block_align == 0 && pkt->dts != AV_NOPTS_VALUE &&
+ pkt->dts > avist->packet_count && enc->codec_id != AV_CODEC_ID_XSUB && avist->packet_count) {
AVPacket empty_packet;
- if(pkt->dts - avist->packet_count > 60000){
+ if (pkt->dts - avist->packet_count > 60000) {
av_log(s, AV_LOG_ERROR, "Too large number of skipped frames %"PRId64" > 60000\n", pkt->dts - avist->packet_count);
return AVERROR(EINVAL);
}
av_init_packet(&empty_packet);
- empty_packet.size= 0;
- empty_packet.data= NULL;
- empty_packet.stream_index= stream_index;
+ empty_packet.size = 0;
+ empty_packet.data = NULL;
+ empty_packet.stream_index = stream_index;
avi_write_packet(s, &empty_packet);
av_dlog(s, "dup dts:%s packet_count:%d\n", av_ts2str(pkt->dts), avist->packet_count);
}
@@ -555,7 +591,6 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
// Make sure to put an OpenDML chunk when the file size exceeds the limits
if (pb->seekable &&
(avio_tell(pb) - avi->riff_start > AVI_MAX_RIFF_SIZE)) {
-
avi_write_ix(s);
ff_end_tag(pb, avi->movi_list);
@@ -567,32 +602,32 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
}
avi_stream2fourcc(tag, stream_index, enc->codec_type);
- if(pkt->flags&AV_PKT_FLAG_KEY)
+ if (pkt->flags & AV_PKT_FLAG_KEY)
flags = 0x10;
- if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
- avist->audio_strm_length += size;
- }
+ if (enc->codec_type == AVMEDIA_TYPE_AUDIO)
+ avist->audio_strm_length += size;
if (s->pb->seekable) {
- AVIIndex* idx = &avist->indexes;
+ AVIIndex *idx = &avist->indexes;
int cl = idx->entry / AVI_INDEX_CLUSTER_SIZE;
int id = idx->entry % AVI_INDEX_CLUSTER_SIZE;
if (idx->ents_allocated <= idx->entry) {
idx->cluster = av_realloc_f(idx->cluster, sizeof(void*), cl+1);
if (!idx->cluster) {
idx->ents_allocated = 0;
- idx->entry = 0;
+ idx->entry = 0;
return AVERROR(ENOMEM);
}
- idx->cluster[cl] = av_malloc(AVI_INDEX_CLUSTER_SIZE*sizeof(AVIIentry));
+ idx->cluster[cl] =
+ av_malloc(AVI_INDEX_CLUSTER_SIZE * sizeof(AVIIentry));
if (!idx->cluster[cl])
return AVERROR(ENOMEM);
idx->ents_allocated += AVI_INDEX_CLUSTER_SIZE;
}
idx->cluster[cl][id].flags = flags;
- idx->cluster[cl][id].pos = avio_tell(pb) - avi->movi_list;
- idx->cluster[cl][id].len = size;
+ idx->cluster[cl][id].pos = avio_tell(pb) - avi->movi_list;
+ idx->cluster[cl][id].len = size;
idx->entry++;
}
@@ -613,7 +648,7 @@ static int avi_write_trailer(AVFormatContext *s)
int i, j, n, nb_frames;
int64_t file_size;
- if (pb->seekable){
+ if (pb->seekable) {
if (avi->riff_id == 1) {
ff_end_tag(pb, avi->movi_list);
res = avi_write_idx1(s);
@@ -628,17 +663,17 @@ static int avi_write_trailer(AVFormatContext *s)
ffio_wfourcc(pb, "LIST"); /* Making this AVI OpenDML one */
avio_skip(pb, 16);
- for (n=nb_frames=0;n<s->nb_streams;n++) {
+ for (n = nb_frames = 0; n < s->nb_streams; n++) {
AVCodecContext *stream = s->streams[n]->codec;
- AVIStream *avist= s->streams[n]->priv_data;
+ AVIStream *avist = s->streams[n]->priv_data;
if (stream->codec_type == AVMEDIA_TYPE_VIDEO) {
if (nb_frames < avist->packet_count)
nb_frames = avist->packet_count;
} else {
- if (stream->codec_id == AV_CODEC_ID_MP2 || stream->codec_id == AV_CODEC_ID_MP3) {
+ if (stream->codec_id == AV_CODEC_ID_MP2 ||
+ stream->codec_id == AV_CODEC_ID_MP3)
nb_frames += avist->packet_count;
- }
}
}
avio_wl32(pb, nb_frames);
@@ -648,29 +683,29 @@ static int avi_write_trailer(AVFormatContext *s)
}
}
- for (i=0; i<s->nb_streams; i++) {
- AVIStream *avist= s->streams[i]->priv_data;
- for (j=0; j<avist->indexes.ents_allocated/AVI_INDEX_CLUSTER_SIZE; j++)
- av_freep(&avist->indexes.cluster[j]);
- av_freep(&avist->indexes.cluster);
- avist->indexes.ents_allocated = avist->indexes.entry = 0;
+ for (i = 0; i < s->nb_streams; i++) {
+ AVIStream *avist = s->streams[i]->priv_data;
+ for (j = 0; j < avist->indexes.ents_allocated / AVI_INDEX_CLUSTER_SIZE; j++)
+ av_freep(&avist->indexes.cluster[j]);
+ av_freep(&avist->indexes.cluster);
+ avist->indexes.ents_allocated = avist->indexes.entry = 0;
}
return res;
}
AVOutputFormat ff_avi_muxer = {
- .name = "avi",
- .long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
- .mime_type = "video/x-msvideo",
- .extensions = "avi",
- .priv_data_size = sizeof(AVIContext),
- .audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_AC3,
- .video_codec = AV_CODEC_ID_MPEG4,
- .write_header = avi_write_header,
- .write_packet = avi_write_packet,
- .write_trailer = avi_write_trailer,
- .codec_tag = (const AVCodecTag* const []){
+ .name = "avi",
+ .long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
+ .mime_type = "video/x-msvideo",
+ .extensions = "avi",
+ .priv_data_size = sizeof(AVIContext),
+ .audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_AC3,
+ .video_codec = AV_CODEC_ID_MPEG4,
+ .write_header = avi_write_header,
+ .write_packet = avi_write_packet,
+ .write_trailer = avi_write_trailer,
+ .codec_tag = (const AVCodecTag * const []) {
ff_codec_bmp_tags, ff_codec_wav_tags, 0
},
};
diff --git a/chromium/third_party/ffmpeg/libavformat/avio.c b/chromium/third_party/ffmpeg/libavformat/avio.c
index 225d9821a0a..4edaaa62150 100644
--- a/chromium/third_party/ffmpeg/libavformat/avio.c
+++ b/chromium/third_party/ffmpeg/libavformat/avio.c
@@ -215,18 +215,12 @@ int ffurl_connect(URLContext *uc, AVDictionary **options)
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
"0123456789+-."
-int ffurl_alloc(URLContext **puc, const char *filename, int flags,
- const AVIOInterruptCB *int_cb)
+static struct URLProtocol *url_find_protocol(const char *filename)
{
URLProtocol *up = NULL;
char proto_str[128], proto_nested[128], *ptr;
size_t proto_len = strspn(filename, URL_SCHEME_CHARS);
- if (!first_protocol) {
- av_log(NULL, AV_LOG_WARNING, "No URL Protocols are registered. "
- "Missing call to av_register_all()?\n");
- }
-
if (filename[proto_len] != ':' &&
(filename[proto_len] != ',' || !strchr(filename + proto_len + 1, ':')) ||
is_dos_path(filename))
@@ -243,13 +237,31 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
while (up = ffurl_protocol_next(up)) {
if (!strcmp(proto_str, up->name))
- return url_alloc_for_protocol(puc, up, filename, flags, int_cb);
+ break;
if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&
!strcmp(proto_nested, up->name))
- return url_alloc_for_protocol(puc, up, filename, flags, int_cb);
+ break;
+ }
+
+ return up;
+}
+
+int ffurl_alloc(URLContext **puc, const char *filename, int flags,
+ const AVIOInterruptCB *int_cb)
+{
+ URLProtocol *p = NULL;
+
+ if (!first_protocol) {
+ av_log(NULL, AV_LOG_WARNING, "No URL Protocols are registered. "
+ "Missing call to av_register_all()?\n");
}
+
+ p = url_find_protocol(filename);
+ if (p)
+ return url_alloc_for_protocol(puc, p, filename, flags, int_cb);
+
*puc = NULL;
- if (!strcmp("https", proto_str))
+ if (av_strstart("https:", filename, NULL))
av_log(NULL, AV_LOG_WARNING, "https protocol not found, recompile with openssl or gnutls enabled.\n");
return AVERROR_PROTOCOL_NOT_FOUND;
}
@@ -258,11 +270,13 @@ int ffurl_open(URLContext **puc, const char *filename, int flags,
const AVIOInterruptCB *int_cb, AVDictionary **options)
{
int ret = ffurl_alloc(puc, filename, flags, int_cb);
- if (ret)
+ if (ret < 0)
return ret;
if (options && (*puc)->prot->priv_data_class &&
(ret = av_opt_set_dict((*puc)->priv_data, options)) < 0)
goto fail;
+ if ((ret = av_opt_set_dict(*puc, options)) < 0)
+ goto fail;
ret = ffurl_connect(*puc, options);
if (!ret)
return 0;
@@ -376,11 +390,18 @@ int ffurl_close(URLContext *h)
}
+const char *avio_find_protocol_name(const char *url)
+{
+ URLProtocol *p = url_find_protocol(url);
+
+ return p ? p->name : NULL;
+}
+
int avio_check(const char *url, int flags)
{
URLContext *h;
int ret = ffurl_alloc(&h, url, flags, NULL);
- if (ret)
+ if (ret < 0)
return ret;
if (h->prot->url_check) {
diff --git a/chromium/third_party/ffmpeg/libavformat/avio.h b/chromium/third_party/ffmpeg/libavformat/avio.h
index 4f4ac3cbaf9..4004b6fda91 100644
--- a/chromium/third_party/ffmpeg/libavformat/avio.h
+++ b/chromium/third_party/ffmpeg/libavformat/avio.h
@@ -146,11 +146,27 @@ typedef struct AVIOContext {
* This field is internal to libavformat and access from outside is not allowed.
*/
int writeout_count;
+
+ /**
+ * Original buffer size
+ * used internally after probing and ensure seekback to reset the buffer size
+ * This field is internal to libavformat and access from outside is not allowed.
+ */
+ int orig_buffer_size;
} AVIOContext;
/* unbuffered I/O */
/**
+ * Return the name of the protocol that will handle the passed URL.
+ *
+ * NULL is returned if no protocol could be found for the given URL.
+ *
+ * @return Name of the protocol or NULL.
+ */
+const char *avio_find_protocol_name(const char *url);
+
+/**
* Return AVIO_FLAG_* access flags corresponding to the access permissions
* of the resource in url, or a negative value corresponding to an
* AVERROR code in case of failure. The returned access flags are
@@ -366,6 +382,7 @@ int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
*
* @param s Used to return the pointer to the created AVIOContext.
* In case of failure the pointed to value is set to NULL.
+ * @param url resource to access
* @param flags flags which control how the resource indicated by url
* is to be opened
* @return >= 0 in case of success, a negative value corresponding to an
@@ -381,6 +398,7 @@ int avio_open(AVIOContext **s, const char *url, int flags);
*
* @param s Used to return the pointer to the created AVIOContext.
* In case of failure the pointed to value is set to NULL.
+ * @param url resource to access
* @param flags flags which control how the resource indicated by url
* is to be opened
* @param int_cb an interrupt callback to be used at the protocols level
@@ -454,6 +472,8 @@ const char *avio_enum_protocols(void **opaque, int output);
/**
* Pause and resume playing - only meaningful if using a network streaming
* protocol (e.g. MMS).
+ *
+ * @param h IO context from which to call the read_pause function pointer
* @param pause 1 for pause, 0 for resume
*/
int avio_pause(AVIOContext *h, int pause);
@@ -461,6 +481,8 @@ int avio_pause(AVIOContext *h, int pause);
/**
* Seek to a given timestamp relative to some component stream.
* Only meaningful if using a network streaming protocol (e.g. MMS.).
+ *
+ * @param h IO context from which to call the seek function pointers
* @param stream_index The stream index that the timestamp is relative to.
* If stream_index is (-1) the timestamp should be in AV_TIME_BASE
* units from the beginning of the presentation.
diff --git a/chromium/third_party/ffmpeg/libavformat/avio_internal.h b/chromium/third_party/ffmpeg/libavformat/avio_internal.h
index 8441d49971f..f4bc39c6003 100644
--- a/chromium/third_party/ffmpeg/libavformat/avio_internal.h
+++ b/chromium/third_party/ffmpeg/libavformat/avio_internal.h
@@ -105,6 +105,8 @@ void ffio_init_checksum(AVIOContext *s,
unsigned long ffio_get_checksum(AVIOContext *s);
unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
unsigned int len);
+unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf,
+ unsigned int len);
/**
* Open a write only packetized memory stream with a maximum packet
diff --git a/chromium/third_party/ffmpeg/libavformat/aviobuf.c b/chromium/third_party/ffmpeg/libavformat/aviobuf.c
index 8b4511d177d..32a1f92cb83 100644
--- a/chromium/third_party/ffmpeg/libavformat/aviobuf.c
+++ b/chromium/third_party/ffmpeg/libavformat/aviobuf.c
@@ -78,6 +78,7 @@ int ffio_init_context(AVIOContext *s,
int64_t (*seek)(void *opaque, int64_t offset, int whence))
{
s->buffer = buffer;
+ s->orig_buffer_size =
s->buffer_size = buffer_size;
s->buf_ptr = buffer;
s->opaque = opaque;
@@ -201,12 +202,14 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
int64_t offset1;
int64_t pos;
int force = whence & AVSEEK_FORCE;
+ int buffer_size;
whence &= ~AVSEEK_FORCE;
if(!s)
return AVERROR(EINVAL);
- pos = s->pos - (s->write_flag ? 0 : (s->buf_end - s->buffer));
+ buffer_size = s->buf_end - s->buffer;
+ pos = s->pos - (s->write_flag ? 0 : buffer_size);
if (whence != SEEK_CUR && whence != SEEK_SET)
return AVERROR(EINVAL);
@@ -219,7 +222,7 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
}
offset1 = offset - pos;
if (!s->must_flush && (!s->direct || !s->seek) &&
- offset1 >= 0 && offset1 <= (s->buf_end - s->buffer)) {
+ offset1 >= 0 && offset1 <= buffer_size) {
/* can do the seek inside the buffer */
s->buf_ptr = s->buffer + offset1;
} else if ((!s->seekable ||
@@ -232,9 +235,20 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
if (s->eof_reached)
return AVERROR_EOF;
s->buf_ptr = s->buf_end + offset - s->pos;
- } else {
+ } else if(!s->write_flag && offset1 < 0 && -offset1 < buffer_size>>1 && s->seek && offset > 0) {
int64_t res;
+ pos -= FFMIN(buffer_size>>1, pos);
+ if ((res = s->seek(s->opaque, pos, SEEK_SET)) < 0)
+ return res;
+ s->buf_end =
+ s->buf_ptr = s->buffer;
+ s->pos = pos;
+ s->eof_reached = 0;
+ fill_buffer(s);
+ return avio_seek(s, offset, SEEK_SET | force);
+ } else {
+ int64_t res;
if (s->write_flag) {
flush_buffer(s);
s->must_flush = 1;
@@ -421,14 +435,14 @@ static void fill_buffer(AVIOContext *s)
}
/* make buffer smaller in case it ended up large after probing */
- if (s->read_packet && s->buffer_size > max_buffer_size) {
+ if (s->read_packet && s->orig_buffer_size && s->buffer_size > s->orig_buffer_size) {
if (dst == s->buffer) {
- ffio_set_buf_size(s, max_buffer_size);
+ ffio_set_buf_size(s, s->orig_buffer_size);
s->checksum_ptr = dst = s->buffer;
}
- av_assert0(len >= max_buffer_size);
- len = max_buffer_size;
+ av_assert0(len >= s->orig_buffer_size);
+ len = s->orig_buffer_size;
}
if (s->read_packet)
@@ -455,6 +469,12 @@ unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
return av_crc(av_crc_get_table(AV_CRC_32_IEEE), checksum, buf, len);
}
+unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf,
+ unsigned int len)
+{
+ return av_crc(av_crc_get_table(AV_CRC_16_ANSI_LE), checksum, buf, len);
+}
+
unsigned long ffio_get_checksum(AVIOContext *s)
{
s->checksum = s->update_checksum(s->checksum, s->checksum_ptr,
@@ -749,10 +769,11 @@ int ffio_ensure_seekback(AVIOContext *s, int buf_size)
uint8_t *buffer;
int max_buffer_size = s->max_packet_size ?
s->max_packet_size : IO_BUFFER_SIZE;
+ int filled = s->buf_end - s->buffer;
buf_size += s->buf_ptr - s->buffer + max_buffer_size;
- if (buf_size < s->buffer_size || s->seekable)
+ if (buf_size < filled || s->seekable)
return 0;
av_assert0(!s->write_flag);
@@ -760,7 +781,7 @@ int ffio_ensure_seekback(AVIOContext *s, int buf_size)
if (!buffer)
return AVERROR(ENOMEM);
- memcpy(buffer, s->buffer, s->buffer_size);
+ memcpy(buffer, s->buffer, filled);
av_free(s->buffer);
s->buf_ptr = buffer + (s->buf_ptr - s->buffer);
s->buf_end = buffer + (s->buf_end - s->buffer);
@@ -778,6 +799,7 @@ int ffio_set_buf_size(AVIOContext *s, int buf_size)
av_free(s->buffer);
s->buffer = buffer;
+ s->orig_buffer_size =
s->buffer_size = buf_size;
s->buf_ptr = buffer;
url_resetbuf(s, s->write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ);
@@ -1036,7 +1058,7 @@ int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
{
- DynBuffer *d = s->opaque;
+ DynBuffer *d;
int size;
static const char padbuf[FF_INPUT_BUFFER_PADDING_SIZE] = {0};
int padding = 0;
@@ -1045,6 +1067,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
*pbuffer = NULL;
return 0;
}
+ d = s->opaque;
/* don't attempt to pad fixed-size packet buffers */
if (!s->max_packet_size) {
diff --git a/chromium/third_party/ffmpeg/libavformat/avisynth.c b/chromium/third_party/ffmpeg/libavformat/avisynth.c
index 2f438d90270..c01d7e484cd 100644
--- a/chromium/third_party/ffmpeg/libavformat/avisynth.c
+++ b/chromium/third_party/ffmpeg/libavformat/avisynth.c
@@ -294,6 +294,7 @@ static int avisynth_create_stream_audio(AVFormatContext *s, AVStream *st)
st->codec->channels = avs->vi->nchannels;
st->time_base = (AVRational) { 1,
avs->vi->audio_samples_per_second };
+ st->duration = avs->vi->num_audio_samples;
switch (avs->vi->sample_type) {
case AVS_SAMPLE_INT8:
@@ -401,10 +402,10 @@ static void avisynth_next_stream(AVFormatContext *s, AVStream **st,
{
AviSynthContext *avs = s->priv_data;
- pkt->stream_index = avs->curr_stream++;
+ avs->curr_stream++;
avs->curr_stream %= s->nb_streams;
- *st = s->streams[pkt->stream_index];
+ *st = s->streams[avs->curr_stream];
if ((*st)->discard == AVDISCARD_ALL)
*discard = 1;
else
@@ -432,10 +433,6 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt,
if (discard)
return 0;
- pkt->pts = n;
- pkt->dts = n;
- pkt->duration = 1;
-
#ifdef USING_AVISYNTH
/* Define the bpp values for the new AviSynth 2.6 colorspaces.
* Since AvxSynth doesn't have these functions, special-case
@@ -459,17 +456,21 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt,
(int64_t)avs->vi->height) * bits) / 8;
if (!pkt->size)
return AVERROR_UNKNOWN;
- if (av_new_packet(pkt, (int)pkt->size) < 0) {
- av_free(pkt);
+
+ if (av_new_packet(pkt, pkt->size) < 0)
return AVERROR(ENOMEM);
- }
+
+ pkt->pts = n;
+ pkt->dts = n;
+ pkt->duration = 1;
+ pkt->stream_index = avs->curr_stream;
frame = avs_library.avs_get_frame(avs->clip, n);
error = avs_library.avs_clip_get_error(avs->clip);
if (error) {
av_log(s, AV_LOG_ERROR, "%s\n", error);
avs->error = 1;
- av_freep(&pkt->data);
+ av_packet_unref(pkt);
return AVERROR_UNKNOWN;
}
@@ -550,24 +551,25 @@ static int avisynth_read_packet_audio(AVFormatContext *s, AVPacket *pkt,
if (discard)
return 0;
- pkt->pts = n;
- pkt->dts = n;
- pkt->duration = samples;
-
pkt->size = avs_bytes_per_channel_sample(avs->vi) *
samples * avs->vi->nchannels;
if (!pkt->size)
return AVERROR_UNKNOWN;
- pkt->data = av_malloc(pkt->size);
- if (!pkt->data)
+
+ if (av_new_packet(pkt, pkt->size) < 0)
return AVERROR(ENOMEM);
+ pkt->pts = n;
+ pkt->dts = n;
+ pkt->duration = samples;
+ pkt->stream_index = avs->curr_stream;
+
avs_library.avs_get_audio(avs->clip, pkt->data, n, samples);
error = avs_library.avs_clip_get_error(avs->clip);
if (error) {
av_log(s, AV_LOG_ERROR, "%s\n", error);
avs->error = 1;
- av_freep(&pkt->data);
+ av_packet_unref(pkt);
return AVERROR_UNKNOWN;
}
return 0;
@@ -600,8 +602,6 @@ static int avisynth_read_packet(AVFormatContext *s, AVPacket *pkt)
if (avs->error)
return AVERROR_UNKNOWN;
- av_free_packet(pkt);
-
/* If either stream reaches EOF, try to read the other one before
* giving up. */
avisynth_next_stream(s, &st, pkt, &discard);
diff --git a/chromium/third_party/ffmpeg/libavformat/bink.c b/chromium/third_party/ffmpeg/libavformat/bink.c
index 6db73cce3aa..395c8d9aa89 100644
--- a/chromium/third_party/ffmpeg/libavformat/bink.c
+++ b/chromium/third_party/ffmpeg/libavformat/bink.c
@@ -28,6 +28,8 @@
* http://wiki.multimedia.cx/index.php?title=Bink_Container
*/
+#include <inttypes.h>
+
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
@@ -59,8 +61,10 @@ static int probe(AVProbeData *p)
{
const uint8_t *b = p->buf;
- if ( b[0] == 'B' && b[1] == 'I' && b[2] == 'K' &&
- (b[3] == 'b' || b[3] == 'f' || b[3] == 'g' || b[3] == 'h' || b[3] == 'i') &&
+ if (((b[0] == 'B' && b[1] == 'I' && b[2] == 'K' &&
+ (b[3] == 'b' || b[3] == 'f' || b[3] == 'g' || b[3] == 'h' || b[3] == 'i')) ||
+ (b[0] == 'K' && b[1] == 'B' && b[2] == '2' && /* Bink 2 */
+ (b[3] == 'a' || b[3] == 'd' || b[3] == 'f' || b[3] == 'g'))) &&
AV_RL32(b+8) > 0 && // num_frames
AV_RL32(b+20) > 0 && AV_RL32(b+20) <= BINK_MAX_WIDTH &&
AV_RL32(b+24) > 0 && AV_RL32(b+24) <= BINK_MAX_HEIGHT &&
@@ -79,6 +83,7 @@ static int read_header(AVFormatContext *s)
uint32_t pos, next_pos;
uint16_t flags;
int keyframe;
+ int ret;
vst = avformat_new_stream(s, NULL);
if (!vst)
@@ -108,7 +113,9 @@ static int read_header(AVFormatContext *s)
fps_num = avio_rl32(pb);
fps_den = avio_rl32(pb);
if (fps_num == 0 || fps_den == 0) {
- av_log(s, AV_LOG_ERROR, "invalid header: invalid fps (%d/%d)\n", fps_num, fps_den);
+ av_log(s, AV_LOG_ERROR,
+ "invalid header: invalid fps (%"PRIu32"/%"PRIu32")\n",
+ fps_num, fps_den);
return AVERROR(EIO);
}
avpriv_set_pts_info(vst, 64, fps_den, fps_num);
@@ -116,15 +123,20 @@ static int read_header(AVFormatContext *s)
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
vst->codec->codec_id = AV_CODEC_ID_BINKVIDEO;
- if (ff_alloc_extradata(vst->codec, 4))
+
+ if ((vst->codec->codec_tag & 0xFFFFFF) == MKTAG('K', 'B', '2', 0)) {
+ av_log(s, AV_LOG_WARNING, "Bink 2 video is not implemented\n");
+ vst->codec->codec_id = AV_CODEC_ID_NONE;
+ }
+
+ if (ff_get_extradata(vst->codec, pb, 4) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, vst->codec->extradata, 4);
bink->num_audio_tracks = avio_rl32(pb);
if (bink->num_audio_tracks > BINK_MAX_AUDIO_TRACKS) {
av_log(s, AV_LOG_ERROR,
- "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%d)\n",
+ "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%"PRIu32")\n",
bink->num_audio_tracks);
return AVERROR(EIO);
}
@@ -177,11 +189,12 @@ static int read_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "invalid frame index table\n");
return AVERROR(EIO);
}
- av_add_index_entry(vst, pos, i, next_pos - pos, 0,
- keyframe ? AVINDEX_KEYFRAME : 0);
+ if ((ret = av_add_index_entry(vst, pos, i, next_pos - pos, 0,
+ keyframe ? AVINDEX_KEYFRAME : 0)) < 0)
+ return ret;
}
- avio_skip(pb, 4);
+ avio_seek(pb, vst->index_entries[0].pos, SEEK_SET);
bink->current_track = -1;
return 0;
@@ -217,7 +230,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
uint32_t audio_size = avio_rl32(pb);
if (audio_size > bink->remain_packet_size - 4) {
av_log(s, AV_LOG_ERROR,
- "frame %"PRId64": audio size in header (%u) > size of packet left (%u)\n",
+ "frame %"PRId64": audio size in header (%"PRIu32") > size of packet left (%"PRIu32")\n",
bink->video_pts, audio_size, bink->remain_packet_size);
return AVERROR(EIO);
}
@@ -280,4 +293,5 @@ AVInputFormat ff_bink_demuxer = {
.read_header = read_header,
.read_packet = read_packet,
.read_seek = read_seek,
+ .flags = AVFMT_SHOW_IDS,
};
diff --git a/chromium/third_party/ffmpeg/libavformat/cafdec.c b/chromium/third_party/ffmpeg/libavformat/cafdec.c
index e954c65683b..a8edbca039b 100644
--- a/chromium/third_party/ffmpeg/libavformat/cafdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/cafdec.c
@@ -25,6 +25,8 @@
* Core Audio Format demuxer
*/
+#include <inttypes.h>
+
#include "avformat.h"
#include "internal.h"
#include "isom.h"
@@ -154,9 +156,8 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size)
avio_skip(pb, size - ALAC_NEW_KUKI);
}
} else {
- if (ff_alloc_extradata(st->codec, size))
+ if (ff_get_extradata(st->codec, pb, size) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, st->codec->extradata, size);
}
return 0;
@@ -286,7 +287,8 @@ static int read_header(AVFormatContext *s)
default:
#define _(x) ((x) >= ' ' ? (x) : ' ')
- av_log(s, AV_LOG_WARNING, "skipping CAF chunk: %08X (%c%c%c%c), size %"PRId64"\n",
+ av_log(s, AV_LOG_WARNING,
+ "skipping CAF chunk: %08"PRIX32" (%c%c%c%c), size %"PRId64"\n",
tag, _(tag>>24), _((tag>>16)&0xFF), _((tag>>8)&0xFF), _(tag&0xFF), size);
#undef _
case MKBETAG('f','r','e','e'):
diff --git a/chromium/third_party/ffmpeg/libavformat/cafenc.c b/chromium/third_party/ffmpeg/libavformat/cafenc.c
index cd3a0be907f..f94101ab020 100644
--- a/chromium/third_party/ffmpeg/libavformat/cafenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/cafenc.c
@@ -108,9 +108,13 @@ static int caf_write_header(AVFormatContext *s)
unsigned int codec_tag = ff_codec_get_tag(ff_codec_caf_tags, enc->codec_id);
int64_t chunk_size = 0;
+ if (s->nb_streams != 1) {
+ av_log(s, AV_LOG_ERROR, "CAF files have exactly one stream\n");
+ return AVERROR(EINVAL);
+ }
+
switch (enc->codec_id) {
case AV_CODEC_ID_AAC:
- case AV_CODEC_ID_AC3:
av_log(s, AV_LOG_ERROR, "muxing codec currently unsupported\n");
return AVERROR_PATCHWELCOME;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/cinedec.c b/chromium/third_party/ffmpeg/libavformat/cinedec.c
new file mode 100644
index 00000000000..372088495e1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/cinedec.c
@@ -0,0 +1,301 @@
+/*
+ * Phanton Cine demuxer
+ * Copyright (c) 2010-2011 Peter Ross <pross@xvid.org>
+ *
+ * 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
+ * Phantom Cine demuxer
+ * @author Peter Ross <pross@xvid.org>
+ */
+
+#include "libavutil/intreadwrite.h"
+#include "libavcodec/bmp.h"
+#include "avformat.h"
+#include "internal.h"
+
+typedef struct {
+ uint64_t pts;
+} CineDemuxContext;
+
+/** Compression */
+enum {
+ CC_RGB = 0, /**< Gray */
+ CC_LEAD = 1, /**< LEAD (M)JPEG */
+ CC_UNINT = 2 /**< Uninterpolated color image (CFA field indicates color ordering) */
+};
+
+/** Color Filter Array */
+enum {
+ CFA_NONE = 0, /**< GRAY */
+ CFA_VRI = 1, /**< GBRG/RGGB */
+ CFA_VRIV6 = 2, /**< BGGR/GRBG */
+ CFA_BAYER = 3, /**< GB/RG */
+ CFA_BAYERFLIP = 4, /**< RG/GB */
+
+ CFA_TLGRAY = 0x80000000,
+ CFA_TRGRAY = 0x40000000,
+ CFA_BLGRAY = 0x20000000,
+ CFA_BRGRAY = 0x10000000
+};
+
+static int cine_read_probe(AVProbeData *p)
+{
+ int HeaderSize;
+ if (p->buf[0] == 'C' && p->buf[1] == 'I' && // Type
+ (HeaderSize = AV_RL16(p->buf + 2)) >= 0x2C && // HeaderSize
+ AV_RL16(p->buf + 4) <= CC_UNINT && // Compression
+ AV_RL16(p->buf + 6) <= 1 && // Version
+ AV_RL32(p->buf + 20) && // ImageCount
+ AV_RL32(p->buf + 24) >= HeaderSize && // OffImageHeader
+ AV_RL32(p->buf + 28) >= HeaderSize && // OffSetup
+ AV_RL32(p->buf + 32) >= HeaderSize) // OffImageOffsets
+ return AVPROBE_SCORE_MAX;
+ return 0;
+}
+
+static int set_metadata_int(AVDictionary **dict, const char *key, int value)
+{
+ if (value) {
+ char buf[64];
+ snprintf(buf, sizeof(buf), "%i", value);
+ return av_dict_set(dict, key, buf, 0);
+ }
+ return 0;
+}
+
+static int cine_read_header(AVFormatContext *avctx)
+{
+ AVIOContext *pb = avctx->pb;
+ AVStream *st;
+ unsigned int version, compression, offImageHeader, offSetup, offImageOffsets, biBitCount, length, CFA;
+ int vflip;
+ char *description;
+ uint64_t i;
+
+ st = avformat_new_stream(avctx, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
+ st->codec->codec_tag = 0;
+
+ /* CINEFILEHEADER structure */
+ avio_skip(pb, 4); // Type, Headersize
+
+ compression = avio_rl16(pb);
+ version = avio_rl16(pb);
+ if (version != 1) {
+ avpriv_request_sample(avctx, "uknown version %i", version);
+ return AVERROR_INVALIDDATA;
+ }
+
+ avio_skip(pb, 12); // FirstMovieImage, TotalImageCount, FirstImageNumber
+
+ st->duration = avio_rl32(pb);
+ offImageHeader = avio_rl32(pb);
+ offSetup = avio_rl32(pb);
+ offImageOffsets = avio_rl32(pb);
+
+ avio_skip(pb, 8); // TriggerTime
+
+ /* BITMAPINFOHEADER structure */
+ avio_seek(pb, offImageHeader, SEEK_SET);
+ avio_skip(pb, 4); //biSize
+ st->codec->width = avio_rl32(pb);
+ st->codec->height = avio_rl32(pb);
+
+ if (avio_rl16(pb) != 1) // biPlanes
+ return AVERROR_INVALIDDATA;
+
+ biBitCount = avio_rl16(pb);
+ if (biBitCount != 8 && biBitCount != 16 && biBitCount != 24 && biBitCount != 48) {
+ avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
+ return AVERROR_INVALIDDATA;
+ }
+
+ switch (avio_rl32(pb)) {
+ case BMP_RGB:
+ vflip = 0;
+ break;
+ case 0x100: /* BI_PACKED */
+ st->codec->codec_tag = MKTAG('B', 'I', 'T', 0);
+ vflip = 1;
+ break;
+ default:
+ avpriv_request_sample(avctx, "unknown bitmap compression");
+ return AVERROR_INVALIDDATA;
+ }
+
+ avio_skip(pb, 4); // biSizeImage
+
+ /* parse SETUP structure */
+ avio_seek(pb, offSetup, SEEK_SET);
+ avio_skip(pb, 140); // FrameRatae16 .. descriptionOld
+ if (avio_rl16(pb) != 0x5453)
+ return AVERROR_INVALIDDATA;
+ length = avio_rl16(pb);
+ if (length < 0x163C) {
+ avpriv_request_sample(avctx, "short SETUP header");
+ return AVERROR_INVALIDDATA;
+ }
+
+ avio_skip(pb, 616); // Binning .. bFlipH
+ if (!avio_rl32(pb) ^ vflip) {
+ st->codec->extradata = av_strdup("BottomUp");
+ st->codec->extradata_size = 9;
+ }
+
+ avio_skip(pb, 4); // Grid
+
+ avpriv_set_pts_info(st, 64, 1, avio_rl32(pb));
+
+ avio_skip(pb, 20); // Shutter .. bEnableColor
+
+ set_metadata_int(&st->metadata, "camera_version", avio_rl32(pb));
+ set_metadata_int(&st->metadata, "firmware_version", avio_rl32(pb));
+ set_metadata_int(&st->metadata, "software_version", avio_rl32(pb));
+ set_metadata_int(&st->metadata, "recording_timezone", avio_rl32(pb));
+
+ CFA = avio_rl32(pb);
+
+ set_metadata_int(&st->metadata, "brightness", avio_rl32(pb));
+ set_metadata_int(&st->metadata, "contrast", avio_rl32(pb));
+ set_metadata_int(&st->metadata, "gamma", avio_rl32(pb));
+
+ avio_skip(pb, 72); // Reserved1 .. WBView
+
+ st->codec->bits_per_coded_sample = avio_rl32(pb);
+
+ if (compression == CC_RGB) {
+ if (biBitCount == 8) {
+ st->codec->pix_fmt = AV_PIX_FMT_GRAY8;
+ } else if (biBitCount == 16) {
+ st->codec->pix_fmt = AV_PIX_FMT_GRAY16LE;
+ } else if (biBitCount == 24) {
+ st->codec->pix_fmt = AV_PIX_FMT_BGR24;
+ } else if (biBitCount == 48) {
+ st->codec->pix_fmt = AV_PIX_FMT_BGR48LE;
+ } else {
+ avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
+ return AVERROR_INVALIDDATA;
+ }
+ } else if (compression == CC_UNINT) {
+ switch (CFA & 0xFFFFFF) {
+ case CFA_BAYER:
+ if (biBitCount == 8) {
+ st->codec->pix_fmt = AV_PIX_FMT_BAYER_GBRG8;
+ } else if (biBitCount == 16) {
+ st->codec->pix_fmt = AV_PIX_FMT_BAYER_GBRG16LE;
+ } else {
+ avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
+ return AVERROR_INVALIDDATA;
+ }
+ break;
+ case CFA_BAYERFLIP:
+ if (biBitCount == 8) {
+ st->codec->pix_fmt = AV_PIX_FMT_BAYER_RGGB8;
+ } else if (biBitCount == 16) {
+ st->codec->pix_fmt = AV_PIX_FMT_BAYER_RGGB16LE;
+ } else {
+ avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
+ return AVERROR_INVALIDDATA;
+ }
+ break;
+ default:
+ avpriv_request_sample(avctx, "unsupported Color Field Array (CFA) %i", CFA & 0xFFFFFF);
+ return AVERROR_INVALIDDATA;
+ }
+ } else { //CC_LEAD
+ avpriv_request_sample(avctx, "unsupported compression %i", compression);
+ return AVERROR_INVALIDDATA;
+ }
+
+ avio_skip(pb, 696); // Conv8Min ... ImHeightAcq
+
+#define DESCRIPTION_SIZE 4096
+ description = av_malloc(DESCRIPTION_SIZE + 1);
+ if (!description)
+ return AVERROR(ENOMEM);
+ i = avio_get_str(pb, DESCRIPTION_SIZE, description, DESCRIPTION_SIZE + 1);
+ if (i < DESCRIPTION_SIZE)
+ avio_skip(pb, DESCRIPTION_SIZE - i);
+ if (description[0])
+ av_dict_set(&st->metadata, "description", description, AV_DICT_DONT_STRDUP_VAL);
+ else
+ av_free(description);
+
+ /* parse image offsets */
+ avio_seek(pb, offImageOffsets, SEEK_SET);
+ for (i = 0; i < st->duration; i++)
+ av_add_index_entry(st, avio_rl64(pb), i, 0, 0, AVINDEX_KEYFRAME);
+
+ return 0;
+}
+
+static int cine_read_packet(AVFormatContext *avctx, AVPacket *pkt)
+{
+ CineDemuxContext *cine = avctx->priv_data;
+ AVStream *st = avctx->streams[0];
+ AVIOContext *pb = avctx->pb;
+ int n, size, ret;
+
+ if (cine->pts >= st->duration)
+ return AVERROR_EOF;
+
+ avio_seek(pb, st->index_entries[cine->pts].pos, SEEK_SET);
+ n = avio_rl32(pb);
+ if (n < 8)
+ return AVERROR_INVALIDDATA;
+ avio_skip(pb, n - 8);
+ size = avio_rl32(pb);
+
+ ret = av_get_packet(pb, pkt, size);
+ if (ret < 0)
+ return ret;
+
+ pkt->pts = cine->pts++;
+ pkt->stream_index = 0;
+ pkt->flags |= AV_PKT_FLAG_KEY;
+ return 0;
+}
+
+static int cine_read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
+{
+ CineDemuxContext *cine = avctx->priv_data;
+
+ if ((flags & AVSEEK_FLAG_FRAME) || (flags & AVSEEK_FLAG_BYTE))
+ return AVERROR(ENOSYS);
+
+ if (!avctx->pb->seekable)
+ return AVERROR(EIO);
+
+ cine->pts = timestamp;
+ return 0;
+}
+
+AVInputFormat ff_cine_demuxer = {
+ .name = "cine",
+ .long_name = NULL_IF_CONFIG_SMALL("Phantom Cine"),
+ .priv_data_size = sizeof(CineDemuxContext),
+ .read_probe = cine_read_probe,
+ .read_header = cine_read_header,
+ .read_packet = cine_read_packet,
+ .read_seek = cine_read_seek,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/concatdec.c b/chromium/third_party/ffmpeg/libavformat/concatdec.c
index 428c749ab24..4590dc59232 100644
--- a/chromium/third_party/ffmpeg/libavformat/concatdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/concatdec.c
@@ -18,17 +18,31 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
+#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "avformat.h"
#include "internal.h"
#include "url.h"
+typedef enum ConcatMatchMode {
+ MATCH_ONE_TO_ONE,
+ MATCH_EXACT_ID,
+} ConcatMatchMode;
+
+typedef struct ConcatStream {
+ AVBitStreamFilterContext *bsf;
+ int out_stream_index;
+} ConcatStream;
+
typedef struct {
char *url;
int64_t start_time;
int64_t duration;
+ ConcatStream *streams;
+ int nb_streams;
} ConcatFile;
typedef struct {
@@ -39,6 +53,8 @@ typedef struct {
AVFormatContext *avf;
int safe;
int seekable;
+ ConcatMatchMode stream_match_mode;
+ unsigned auto_convert;
} ConcatContext;
static int concat_probe(AVProbeData *probe)
@@ -85,18 +101,28 @@ static int add_file(AVFormatContext *avf, char *filename, ConcatFile **rfile,
ConcatContext *cat = avf->priv_data;
ConcatFile *file;
char *url = NULL;
- size_t url_len;
+ const char *proto;
+ size_t url_len, proto_len;
int ret;
if (cat->safe > 0 && !safe_filename(filename)) {
av_log(avf, AV_LOG_ERROR, "Unsafe file name '%s'\n", filename);
FAIL(AVERROR(EPERM));
}
- url_len = strlen(avf->filename) + strlen(filename) + 16;
- if (!(url = av_malloc(url_len)))
- FAIL(AVERROR(ENOMEM));
- ff_make_absolute_url(url, url_len, avf->filename, filename);
- av_freep(&filename);
+
+ proto = avio_find_protocol_name(filename);
+ proto_len = proto ? strlen(proto) : 0;
+ if (!memcmp(filename, proto, proto_len) &&
+ (filename[proto_len] == ':' || filename[proto_len] == ',')) {
+ url = filename;
+ filename = NULL;
+ } else {
+ url_len = strlen(avf->filename) + strlen(filename) + 16;
+ if (!(url = av_malloc(url_len)))
+ FAIL(AVERROR(ENOMEM));
+ ff_make_absolute_url(url, url_len, avf->filename, filename);
+ av_freep(&filename);
+ }
if (cat->nb_files >= *nb_files_alloc) {
size_t n = FFMAX(*nb_files_alloc * 2, 16);
@@ -124,6 +150,130 @@ fail:
return ret;
}
+static int copy_stream_props(AVStream *st, AVStream *source_st)
+{
+ int ret;
+
+ if (st->codec->codec_id || !source_st->codec->codec_id) {
+ if (st->codec->extradata_size < source_st->codec->extradata_size) {
+ ret = ff_alloc_extradata(st->codec,
+ source_st->codec->extradata_size);
+ if (ret < 0)
+ return ret;
+ }
+ memcpy(st->codec->extradata, source_st->codec->extradata,
+ source_st->codec->extradata_size);
+ return 0;
+ }
+ if ((ret = avcodec_copy_context(st->codec, source_st->codec)) < 0)
+ return ret;
+ st->r_frame_rate = source_st->r_frame_rate;
+ st->avg_frame_rate = source_st->avg_frame_rate;
+ st->time_base = source_st->time_base;
+ st->sample_aspect_ratio = source_st->sample_aspect_ratio;
+ return 0;
+}
+
+static int detect_stream_specific(AVFormatContext *avf, int idx)
+{
+ ConcatContext *cat = avf->priv_data;
+ AVStream *st = cat->avf->streams[idx];
+ ConcatStream *cs = &cat->cur_file->streams[idx];
+ AVBitStreamFilterContext *bsf;
+
+ if (cat->auto_convert && st->codec->codec_id == AV_CODEC_ID_H264 &&
+ (st->codec->extradata_size < 4 || AV_RB32(st->codec->extradata) != 1)) {
+ av_log(cat->avf, AV_LOG_INFO,
+ "Auto-inserting h264_mp4toannexb bitstream filter\n");
+ if (!(bsf = av_bitstream_filter_init("h264_mp4toannexb"))) {
+ av_log(avf, AV_LOG_ERROR, "h264_mp4toannexb bitstream filter "
+ "required for H.264 streams\n");
+ return AVERROR_BSF_NOT_FOUND;
+ }
+ cs->bsf = bsf;
+ }
+ return 0;
+}
+
+static int match_streams_one_to_one(AVFormatContext *avf)
+{
+ ConcatContext *cat = avf->priv_data;
+ AVStream *st;
+ int i, ret;
+
+ for (i = cat->cur_file->nb_streams; i < cat->avf->nb_streams; i++) {
+ if (i < avf->nb_streams) {
+ st = avf->streams[i];
+ } else {
+ if (!(st = avformat_new_stream(avf, NULL)))
+ return AVERROR(ENOMEM);
+ }
+ if ((ret = copy_stream_props(st, cat->avf->streams[i])) < 0)
+ return ret;
+ cat->cur_file->streams[i].out_stream_index = i;
+ }
+ return 0;
+}
+
+static int match_streams_exact_id(AVFormatContext *avf)
+{
+ ConcatContext *cat = avf->priv_data;
+ AVStream *st;
+ int i, j, ret;
+
+ for (i = cat->cur_file->nb_streams; i < cat->avf->nb_streams; i++) {
+ st = cat->avf->streams[i];
+ for (j = 0; j < avf->nb_streams; j++) {
+ if (avf->streams[j]->id == st->id) {
+ av_log(avf, AV_LOG_VERBOSE,
+ "Match slave stream #%d with stream #%d id 0x%x\n",
+ i, j, st->id);
+ if ((ret = copy_stream_props(avf->streams[j], st)) < 0)
+ return ret;
+ cat->cur_file->streams[i].out_stream_index = j;
+ }
+ }
+ }
+ return 0;
+}
+
+static int match_streams(AVFormatContext *avf)
+{
+ ConcatContext *cat = avf->priv_data;
+ ConcatStream *map;
+ int i, ret;
+
+ if (cat->cur_file->nb_streams >= cat->avf->nb_streams)
+ return 0;
+ map = av_realloc(cat->cur_file->streams,
+ cat->avf->nb_streams * sizeof(*map));
+ if (!map)
+ return AVERROR(ENOMEM);
+ cat->cur_file->streams = map;
+ memset(map + cat->cur_file->nb_streams, 0,
+ (cat->avf->nb_streams - cat->cur_file->nb_streams) * sizeof(*map));
+
+ for (i = cat->cur_file->nb_streams; i < cat->avf->nb_streams; i++)
+ map[i].out_stream_index = -1;
+ switch (cat->stream_match_mode) {
+ case MATCH_ONE_TO_ONE:
+ ret = match_streams_one_to_one(avf);
+ break;
+ case MATCH_EXACT_ID:
+ ret = match_streams_exact_id(avf);
+ break;
+ default:
+ ret = AVERROR_BUG;
+ }
+ if (ret < 0)
+ return ret;
+ for (i = cat->cur_file->nb_streams; i < cat->avf->nb_streams; i++)
+ if ((ret = detect_stream_specific(avf, i)) < 0)
+ return ret;
+ cat->cur_file->nb_streams = cat->avf->nb_streams;
+ return 0;
+}
+
static int open_file(AVFormatContext *avf, unsigned fileno)
{
ConcatContext *cat = avf->priv_data;
@@ -132,9 +282,16 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
if (cat->avf)
avformat_close_input(&cat->avf);
+
+ cat->avf = avformat_alloc_context();
+ if (!cat->avf)
+ return AVERROR(ENOMEM);
+
+ cat->avf->interrupt_callback = avf->interrupt_callback;
if ((ret = avformat_open_input(&cat->avf, file->url, NULL, NULL)) < 0 ||
(ret = avformat_find_stream_info(cat->avf, NULL)) < 0) {
av_log(avf, AV_LOG_ERROR, "Impossible to open '%s'\n", file->url);
+ avformat_close_input(&cat->avf);
return ret;
}
cat->cur_file = file;
@@ -142,6 +299,8 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
file->start_time = !fileno ? 0 :
cat->files[fileno - 1].start_time +
cat->files[fileno - 1].duration;
+ if ((ret = match_streams(avf)) < 0)
+ return ret;
return 0;
}
@@ -152,8 +311,10 @@ static int concat_read_close(AVFormatContext *avf)
if (cat->avf)
avformat_close_input(&cat->avf);
- for (i = 0; i < cat->nb_files; i++)
+ for (i = 0; i < cat->nb_files; i++) {
av_freep(&cat->files[i].url);
+ av_freep(&cat->files[i].streams);
+ }
av_freep(&cat->files);
return 0;
}
@@ -166,7 +327,6 @@ static int concat_read_header(AVFormatContext *avf)
int ret, line = 0, i;
unsigned nb_files_alloc = 0;
ConcatFile *file = NULL;
- AVStream *st, *source_st;
int64_t time = 0;
while (1) {
@@ -200,6 +360,17 @@ static int concat_read_header(AVFormatContext *avf)
FAIL(ret);
}
file->duration = dur;
+ } else if (!strcmp(keyword, "stream")) {
+ if (!avformat_new_stream(avf, NULL))
+ FAIL(AVERROR(ENOMEM));
+ } else if (!strcmp(keyword, "exact_stream_id")) {
+ if (!avf->nb_streams) {
+ av_log(avf, AV_LOG_ERROR, "Line %d: exact_stream_id without stream\n",
+ line);
+ FAIL(AVERROR_INVALIDDATA);
+ }
+ avf->streams[avf->nb_streams - 1]->id =
+ strtol(get_keyword(&cursor), NULL, 0);
} else if (!strcmp(keyword, "ffconcat")) {
char *ver_kw = get_keyword(&cursor);
char *ver_val = get_keyword(&cursor);
@@ -234,20 +405,10 @@ static int concat_read_header(AVFormatContext *avf)
cat->seekable = 1;
}
+ cat->stream_match_mode = avf->nb_streams ? MATCH_EXACT_ID :
+ MATCH_ONE_TO_ONE;
if ((ret = open_file(avf, 0)) < 0)
FAIL(ret);
- for (i = 0; i < cat->avf->nb_streams; i++) {
- if (!(st = avformat_new_stream(avf, NULL)))
- FAIL(AVERROR(ENOMEM));
- source_st = cat->avf->streams[i];
- if ((ret = avcodec_copy_context(st->codec, source_st->codec)) < 0)
- FAIL(ret);
- st->r_frame_rate = source_st->r_frame_rate;
- st->avg_frame_rate = source_st->avg_frame_rate;
- st->time_base = source_st->time_base;
- st->sample_aspect_ratio = source_st->sample_aspect_ratio;
- }
-
return 0;
fail:
@@ -268,17 +429,77 @@ static int open_next_file(AVFormatContext *avf)
return open_file(avf, fileno);
}
+static int filter_packet(AVFormatContext *avf, ConcatStream *cs, AVPacket *pkt)
+{
+ AVStream *st = avf->streams[cs->out_stream_index];
+ AVBitStreamFilterContext *bsf;
+ AVPacket pkt2;
+ int ret;
+
+ av_assert0(cs->out_stream_index >= 0);
+ for (bsf = cs->bsf; bsf; bsf = bsf->next) {
+ pkt2 = *pkt;
+ ret = av_bitstream_filter_filter(bsf, st->codec, NULL,
+ &pkt2.data, &pkt2.size,
+ pkt->data, pkt->size,
+ !!(pkt->flags & AV_PKT_FLAG_KEY));
+ if (ret < 0) {
+ av_packet_unref(pkt);
+ return ret;
+ }
+ av_assert0(pkt2.buf);
+ if (ret == 0 && pkt2.data != pkt->data) {
+ if ((ret = av_copy_packet(&pkt2, pkt)) < 0) {
+ av_free(pkt2.data);
+ return ret;
+ }
+ ret = 1;
+ }
+ if (ret > 0) {
+ av_free_packet(pkt);
+ pkt2.buf = av_buffer_create(pkt2.data, pkt2.size,
+ av_buffer_default_free, NULL, 0);
+ if (!pkt2.buf) {
+ av_free(pkt2.data);
+ return AVERROR(ENOMEM);
+ }
+ }
+ *pkt = pkt2;
+ }
+ return 0;
+}
+
static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
{
ConcatContext *cat = avf->priv_data;
int ret;
int64_t delta;
+ ConcatStream *cs;
while (1) {
- if ((ret = av_read_frame(cat->avf, pkt)) != AVERROR_EOF ||
- (ret = open_next_file(avf)) < 0)
- break;
+ ret = av_read_frame(cat->avf, pkt);
+ if (ret == AVERROR_EOF) {
+ if ((ret = open_next_file(avf)) < 0)
+ return ret;
+ continue;
+ }
+ if (ret < 0)
+ return ret;
+ if ((ret = match_streams(avf)) < 0) {
+ av_packet_unref(pkt);
+ return ret;
+ }
+ cs = &cat->cur_file->streams[pkt->stream_index];
+ if (cs->out_stream_index < 0) {
+ av_packet_unref(pkt);
+ continue;
+ }
+ pkt->stream_index = cs->out_stream_index;
+ break;
}
+ if ((ret = filter_packet(avf, cs, pkt)))
+ return ret;
+
delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time,
AV_TIME_BASE_Q,
cat->avf->streams[pkt->stream_index]->time_base);
@@ -384,6 +605,8 @@ static int concat_seek(AVFormatContext *avf, int stream,
static const AVOption options[] = {
{ "safe", "enable safe mode",
OFFSET(safe), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, DEC },
+ { "auto_convert", "automatically convert bitstream format",
+ OFFSET(auto_convert), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavformat/crcenc.c b/chromium/third_party/ffmpeg/libavformat/crcenc.c
index ac0638037e4..3fdfea5207f 100644
--- a/chromium/third_party/ffmpeg/libavformat/crcenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/crcenc.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/adler32.h"
#include "avformat.h"
@@ -48,7 +50,7 @@ static int crc_write_trailer(struct AVFormatContext *s)
CRCState *crc = s->priv_data;
char buf[64];
- snprintf(buf, sizeof(buf), "CRC=0x%08x\n", crc->crcval);
+ snprintf(buf, sizeof(buf), "CRC=0x%08"PRIx32"\n", crc->crcval);
avio_write(s->pb, buf, strlen(buf));
return 0;
diff --git a/chromium/third_party/ffmpeg/libavformat/dfa.c b/chromium/third_party/ffmpeg/libavformat/dfa.c
index 9cd13e24d95..dfa0590e2e2 100644
--- a/chromium/third_party/ffmpeg/libavformat/dfa.c
+++ b/chromium/third_party/ffmpeg/libavformat/dfa.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -98,12 +100,13 @@ static int dfa_read_packet(AVFormatContext *s, AVPacket *pkt)
first = 0;
frame_size = AV_RL32(pkt->data + pkt->size - 8);
if (frame_size > INT_MAX - 4) {
- av_log(s, AV_LOG_ERROR, "Too large chunk size: %d\n", frame_size);
+ av_log(s, AV_LOG_ERROR, "Too large chunk size: %"PRIu32"\n", frame_size);
return AVERROR(EIO);
}
if (AV_RL32(pkt->data + pkt->size - 12) == MKTAG('E', 'O', 'F', 'R')) {
if (frame_size) {
- av_log(s, AV_LOG_WARNING, "skipping %d bytes of end-of-frame marker chunk\n",
+ av_log(s, AV_LOG_WARNING,
+ "skipping %"PRIu32" bytes of end-of-frame marker chunk\n",
frame_size);
avio_skip(pb, frame_size);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/dsfdec.c b/chromium/third_party/ffmpeg/libavformat/dsfdec.c
new file mode 100644
index 00000000000..ae198b2e93b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/dsfdec.c
@@ -0,0 +1,159 @@
+/*
+ * DSD Stream File (DSF) demuxer
+ * Copyright (c) 2014 Peter Ross
+ *
+ * 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 "libavutil/intreadwrite.h"
+#include "avformat.h"
+#include "internal.h"
+#include "id3v2.h"
+
+typedef struct {
+ uint64_t data_end;
+} DSFContext;
+
+static int dsf_probe(AVProbeData *p)
+{
+ if (p->buf_size < 12 || memcmp(p->buf, "DSD ", 4) || AV_RL64(p->buf + 4) != 28)
+ return 0;
+ return AVPROBE_SCORE_MAX;
+}
+
+static const uint64_t dsf_channel_layout[] = {
+ 0,
+ AV_CH_LAYOUT_MONO,
+ AV_CH_LAYOUT_STEREO,
+ AV_CH_LAYOUT_SURROUND,
+ AV_CH_LAYOUT_QUAD,
+ AV_CH_LAYOUT_4POINT0,
+ AV_CH_LAYOUT_5POINT0_BACK,
+ AV_CH_LAYOUT_5POINT1_BACK,
+};
+
+static void read_id3(AVFormatContext *s, uint64_t id3pos)
+{
+ ID3v2ExtraMeta *id3v2_extra_meta = NULL;
+ if (avio_seek(s->pb, id3pos, SEEK_SET) < 0)
+ return;
+
+ ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, 0);
+ if (id3v2_extra_meta)
+ ff_id3v2_parse_apic(s, &id3v2_extra_meta);
+ ff_id3v2_free_extra_meta(&id3v2_extra_meta);
+}
+
+static int dsf_read_header(AVFormatContext *s)
+{
+ DSFContext *dsf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ AVStream *st;
+ uint64_t id3pos;
+ unsigned int channel_type;
+
+ avio_skip(pb, 4);
+ if (avio_rl64(pb) != 28)
+ return AVERROR_INVALIDDATA;
+
+ /* create primary stream before any id3 coverart streams */
+ st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+
+ avio_skip(pb, 8);
+ id3pos = avio_rl64(pb);
+ if (pb->seekable) {
+ read_id3(s, id3pos);
+ avio_seek(pb, 28, SEEK_SET);
+ }
+
+ /* fmt chunk */
+
+ if (avio_rl32(pb) != MKTAG('f', 'm', 't', ' ') || avio_rl64(pb) != 52)
+ return AVERROR_INVALIDDATA;
+
+ if (avio_rl32(pb) != 1) {
+ avpriv_request_sample(s, "unknown format version");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (avio_rl32(pb)) {
+ avpriv_request_sample(s, "unknown format id");
+ return AVERROR_INVALIDDATA;
+ }
+
+ channel_type = avio_rl32(pb);
+ if (channel_type < FF_ARRAY_ELEMS(dsf_channel_layout))
+ st->codec->channel_layout = dsf_channel_layout[channel_type];
+ if (!st->codec->channel_layout)
+ avpriv_request_sample(s, "channel type %i", channel_type);
+
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ st->codec->channels = avio_rl32(pb);
+ st->codec->sample_rate = avio_rl32(pb) / 8;
+
+ switch(avio_rl32(pb)) {
+ case 1: st->codec->codec_id = AV_CODEC_ID_DSD_LSBF_PLANAR; break;
+ case 8: st->codec->codec_id = AV_CODEC_ID_DSD_MSBF_PLANAR; break;
+ default:
+ avpriv_request_sample(s, "unknown most significant bit");
+ return AVERROR_INVALIDDATA;
+ }
+
+ avio_skip(pb, 8);
+ st->codec->block_align = avio_rl32(pb);
+ if (st->codec->block_align > INT_MAX / st->codec->channels) {
+ avpriv_request_sample(s, "block_align overflow");
+ return AVERROR_INVALIDDATA;
+ }
+ st->codec->block_align *= st->codec->channels;
+ avio_skip(pb, 4);
+
+ /* data chunk */
+
+ dsf->data_end = avio_tell(pb);
+ if (avio_rl32(pb) != MKTAG('d', 'a', 't', 'a'))
+ return AVERROR_INVALIDDATA;
+ dsf->data_end += avio_rl64(pb);
+
+ return 0;
+}
+
+static int dsf_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ DSFContext *dsf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ AVStream *st = s->streams[0];
+ int64_t pos = avio_tell(pb);
+
+ if (pos >= dsf->data_end)
+ return AVERROR_EOF;
+
+ pkt->stream_index = 0;
+ return av_get_packet(pb, pkt, FFMIN(dsf->data_end - pos, st->codec->block_align));
+}
+
+AVInputFormat ff_dsf_demuxer = {
+ .name = "dsf",
+ .long_name = NULL_IF_CONFIG_SMALL("DSD Stream File (DSF)"),
+ .priv_data_size = sizeof(DSFContext),
+ .read_probe = dsf_probe,
+ .read_header = dsf_read_header,
+ .read_packet = dsf_read_packet,
+ .flags = AVFMT_GENERIC_INDEX | AVFMT_NO_BYTE_SEEK,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/dvenc.c b/chromium/third_party/ffmpeg/libavformat/dvenc.c
index 43f65c37b9c..defcf2a16e3 100644
--- a/chromium/third_party/ffmpeg/libavformat/dvenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/dvenc.c
@@ -334,7 +334,7 @@ static DVMuxContext* dv_init_mux(AVFormatContext* s)
if (c->ast[i] && !(c->audio_data[i]=av_fifo_alloc(100*MAX_AUDIO_FRAME_SIZE))) {
while (i > 0) {
i--;
- av_fifo_free(c->audio_data[i]);
+ av_fifo_freep(&c->audio_data[i]);
}
goto bail_out;
}
@@ -350,7 +350,7 @@ static void dv_delete_mux(DVMuxContext *c)
{
int i;
for (i=0; i < c->n_ast; i++)
- av_fifo_free(c->audio_data[i]);
+ av_fifo_freep(&c->audio_data[i]);
}
static int dv_write_header(AVFormatContext *s)
diff --git a/chromium/third_party/ffmpeg/libavformat/dxa.c b/chromium/third_party/ffmpeg/libavformat/dxa.c
index 22ee2a97a54..ea5b4f7163a 100644
--- a/chromium/third_party/ffmpeg/libavformat/dxa.c
+++ b/chromium/third_party/ffmpeg/libavformat/dxa.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -169,7 +171,10 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
}
avio_seek(s->pb, c->vidpos, SEEK_SET);
while(!url_feof(s->pb) && c->frames){
- avio_read(s->pb, buf, 4);
+ if ((ret = avio_read(s->pb, buf, 4)) != 4) {
+ av_log(s, AV_LOG_ERROR, "failed reading chunk type\n");
+ return ret < 0 ? ret : AVERROR_INVALIDDATA;
+ }
switch(AV_RL32(buf)){
case MKTAG('N', 'U', 'L', 'L'):
if(av_new_packet(pkt, 4 + pal_size) < 0)
@@ -187,10 +192,14 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
avio_read(s->pb, pal + 4, 768);
break;
case MKTAG('F', 'R', 'A', 'M'):
- avio_read(s->pb, buf + 4, DXA_EXTRA_SIZE - 4);
+ if ((ret = avio_read(s->pb, buf + 4, DXA_EXTRA_SIZE - 4)) != DXA_EXTRA_SIZE - 4) {
+ av_log(s, AV_LOG_ERROR, "failed reading dxa_extra\n");
+ return ret < 0 ? ret : AVERROR_INVALIDDATA;
+ }
size = AV_RB32(buf + 5);
if(size > 0xFFFFFF){
- av_log(s, AV_LOG_ERROR, "Frame size is too big: %d\n", size);
+ av_log(s, AV_LOG_ERROR, "Frame size is too big: %"PRIu32"\n",
+ size);
return AVERROR_INVALIDDATA;
}
if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0)
diff --git a/chromium/third_party/ffmpeg/libavformat/electronicarts.c b/chromium/third_party/ffmpeg/libavformat/electronicarts.c
index dd8cf5d6449..1acaa14c8cf 100644
--- a/chromium/third_party/ffmpeg/libavformat/electronicarts.c
+++ b/chromium/third_party/ffmpeg/libavformat/electronicarts.c
@@ -25,6 +25,8 @@
* by Robin Kay (komadori at gekkou.co.uk)
*/
+#include <inttypes.h>
+
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -152,7 +154,7 @@ static int process_audio_header_elements(AVFormatContext *s)
break;
case 0x8A:
av_log(s, AV_LOG_DEBUG,
- "element 0x%02x set to 0x%08x\n",
+ "element 0x%02x set to 0x%08"PRIx32"\n",
subbyte, read_arbitrary(pb));
av_log(s, AV_LOG_DEBUG, "exited audio subheader\n");
in_subheader = 0;
@@ -171,7 +173,7 @@ static int process_audio_header_elements(AVFormatContext *s)
break;
default:
av_log(s, AV_LOG_DEBUG,
- "element 0x%02x set to 0x%08x\n",
+ "element 0x%02x set to 0x%08"PRIx32"\n",
subbyte, read_arbitrary(pb));
break;
}
@@ -183,7 +185,7 @@ static int process_audio_header_elements(AVFormatContext *s)
break;
default:
av_log(s, AV_LOG_DEBUG,
- "header element 0x%02x set to 0x%08x\n",
+ "header element 0x%02x set to 0x%08"PRIx32"\n",
byte, read_arbitrary(pb));
break;
}
@@ -351,13 +353,13 @@ static int process_ea_header(AVFormatContext *s)
int i;
for (i = 0; i < 5 && (!ea->audio_codec || !ea->video_codec); i++) {
- unsigned int startpos = avio_tell(pb);
+ uint64_t startpos = avio_tell(pb);
int err = 0;
blockid = avio_rl32(pb);
size = avio_rl32(pb);
if (i == 0)
- ea->big_endian = size > 0x000FFFFF;
+ ea->big_endian = size > av_bswap32(size);
if (ea->big_endian)
size = av_bswap32(size);
diff --git a/chromium/third_party/ffmpeg/libavformat/ffmdec.c b/chromium/third_party/ffmpeg/libavformat/ffmdec.c
index 679d926da16..9d89b166435 100644
--- a/chromium/third_party/ffmpeg/libavformat/ffmdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/ffmdec.c
@@ -280,9 +280,8 @@ static int ffm2_read_header(AVFormatContext *s)
codec->flags2 = avio_rb32(pb);
codec->debug = avio_rb32(pb);
if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
- if (ff_alloc_extradata(codec, avio_rb32(pb)))
+ if (ff_get_extradata(codec, pb, avio_rb32(pb)) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, codec->extradata, codec->extradata_size);
}
avio_seek(pb, next, SEEK_SET);
id = avio_rb32(pb);
@@ -468,9 +467,8 @@ static int ffm_read_header(AVFormatContext *s)
goto fail;
}
if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
- if (ff_alloc_extradata(codec, avio_rb32(pb)))
+ if (ff_get_extradata(codec, pb, avio_rb32(pb)) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, codec->extradata, codec->extradata_size);
}
}
diff --git a/chromium/third_party/ffmpeg/libavformat/file.c b/chromium/third_party/ffmpeg/libavformat/file.c
index 2defc75e5f7..6511328de7d 100644
--- a/chromium/third_party/ffmpeg/libavformat/file.c
+++ b/chromium/third_party/ffmpeg/libavformat/file.c
@@ -54,7 +54,7 @@ typedef struct FileContext {
} FileContext;
static const AVOption file_options[] = {
- { "truncate", "Truncate existing files on write", offsetof(FileContext, trunc), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
+ { "truncate", "truncate existing files on write", offsetof(FileContext, trunc), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
{ "blocksize", "set I/O operation maximum block size", offsetof(FileContext, blocksize), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
};
@@ -104,25 +104,30 @@ static int file_get_handle(URLContext *h)
static int file_check(URLContext *h, int mask)
{
-#if HAVE_ACCESS && defined(R_OK)
int ret = 0;
- if (access(h->filename, F_OK) < 0)
+ const char *filename = h->filename;
+ av_strstart(filename, "file:", &filename);
+
+ {
+#if HAVE_ACCESS && defined(R_OK)
+ if (access(filename, F_OK) < 0)
return AVERROR(errno);
if (mask&AVIO_FLAG_READ)
- if (access(h->filename, R_OK) >= 0)
+ if (access(filename, R_OK) >= 0)
ret |= AVIO_FLAG_READ;
if (mask&AVIO_FLAG_WRITE)
- if (access(h->filename, W_OK) >= 0)
+ if (access(filename, W_OK) >= 0)
ret |= AVIO_FLAG_WRITE;
#else
struct stat st;
- int ret = stat(h->filename, &st);
+ ret = stat(filename, &st);
if (ret < 0)
return AVERROR(errno);
ret |= st.st_mode&S_IRUSR ? mask&AVIO_FLAG_READ : 0;
ret |= st.st_mode&S_IWUSR ? mask&AVIO_FLAG_WRITE : 0;
#endif
+ }
return ret;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/flac_picture.c b/chromium/third_party/ffmpeg/libavformat/flac_picture.c
index 12d73e488f9..5f2026d1d0e 100644
--- a/chromium/third_party/ffmpeg/libavformat/flac_picture.c
+++ b/chromium/third_party/ffmpeg/libavformat/flac_picture.c
@@ -107,9 +107,10 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
ret = AVERROR_INVALIDDATA;
goto fail;
}
- if (!(data = av_buffer_alloc(len))) {
+ if (!(data = av_buffer_alloc(len + FF_INPUT_BUFFER_PADDING_SIZE))) {
RETURN_ERROR(AVERROR(ENOMEM));
}
+ memset(data->data + len, 0, FF_INPUT_BUFFER_PADDING_SIZE);
if (avio_read(pb, data->data, len) != len) {
av_log(s, AV_LOG_ERROR, "Error reading attached picture data.\n");
if (s->error_recognition & AV_EF_EXPLODE)
diff --git a/chromium/third_party/ffmpeg/libavformat/flacdec.c b/chromium/third_party/ffmpeg/libavformat/flacdec.c
index 29310b831f1..cd752e1a20f 100644
--- a/chromium/third_party/ffmpeg/libavformat/flacdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/flacdec.c
@@ -26,6 +26,7 @@
#include "rawdec.h"
#include "oggdec.h"
#include "vorbiscomment.h"
+#include "replaygain.h"
#include "libavcodec/bytestream.h"
static int flac_read_header(AVFormatContext *s)
@@ -143,6 +144,10 @@ static int flac_read_header(AVFormatContext *s)
}
}
+ ret = ff_replaygain_export(st, s->metadata);
+ if (ret < 0)
+ return ret;
+
return 0;
fail:
@@ -157,12 +162,61 @@ static int flac_probe(AVProbeData *p)
return AVPROBE_SCORE_EXTENSION;
}
+static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_index,
+ int64_t *ppos, int64_t pos_limit)
+{
+ AVPacket pkt, out_pkt;
+ AVStream *st = s->streams[stream_index];
+ AVCodecParserContext *parser;
+ int ret;
+ int64_t pts = AV_NOPTS_VALUE;
+
+ if (avio_seek(s->pb, *ppos, SEEK_SET) < 0)
+ return AV_NOPTS_VALUE;
+
+ av_init_packet(&pkt);
+ parser = av_parser_init(st->codec->codec_id);
+ if (!parser){
+ return AV_NOPTS_VALUE;
+ }
+ parser->flags |= PARSER_FLAG_USE_CODEC_TS;
+
+ for (;;){
+ ret = ff_raw_read_partial_packet(s, &pkt);
+ if (ret < 0){
+ if (ret == AVERROR(EAGAIN))
+ continue;
+ else
+ break;
+ }
+ av_init_packet(&out_pkt);
+ ret = av_parser_parse2(parser, st->codec,
+ &out_pkt.data, &out_pkt.size, pkt.data, pkt.size,
+ pkt.pts, pkt.dts, *ppos);
+
+ av_free_packet(&pkt);
+ if (out_pkt.size){
+ int size = out_pkt.size;
+ if (parser->pts != AV_NOPTS_VALUE){
+ // seeking may not have started from beginning of a frame
+ // calculate frame start position from next frame backwards
+ *ppos = parser->next_frame_offset - size;
+ pts = parser->pts;
+ break;
+ }
+ }
+ }
+ av_parser_close(parser);
+ return pts;
+}
+
AVInputFormat ff_flac_demuxer = {
.name = "flac",
.long_name = NULL_IF_CONFIG_SMALL("raw FLAC"),
.read_probe = flac_probe,
.read_header = flac_read_header,
.read_packet = ff_raw_read_partial_packet,
+ .read_timestamp = flac_read_timestamp,
.flags = AVFMT_GENERIC_INDEX,
.extensions = "flac",
.raw_codec_id = AV_CODEC_ID_FLAC,
diff --git a/chromium/third_party/ffmpeg/libavformat/flacenc.c b/chromium/third_party/ffmpeg/libavformat/flacenc.c
index 87e93625f28..d92801807ef 100644
--- a/chromium/third_party/ffmpeg/libavformat/flacenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/flacenc.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/opt.h"
#include "libavcodec/flac.h"
#include "avformat.h"
#include "avio_internal.h"
@@ -27,6 +28,11 @@
#include "libavcodec/bytestream.h"
+typedef struct FlacMuxerContext {
+ const AVClass *class;
+ int write_header;
+} FlacMuxerContext;
+
static int flac_write_block_padding(AVIOContext *pb, unsigned int n_padding_bytes,
int last_block)
{
@@ -65,7 +71,12 @@ static int flac_write_block_comment(AVIOContext *pb, AVDictionary **m,
static int flac_write_header(struct AVFormatContext *s)
{
int ret;
+ int padding = s->metadata_header_padding;
AVCodecContext *codec = s->streams[0]->codec;
+ FlacMuxerContext *c = s->priv_data;
+
+ if (!c->write_header)
+ return 0;
if (s->nb_streams > 1) {
av_log(s, AV_LOG_ERROR, "only one stream is supported\n");
@@ -76,20 +87,27 @@ static int flac_write_header(struct AVFormatContext *s)
return AVERROR(EINVAL);
}
+ if (padding < 0)
+ padding = 8192;
+ /* The FLAC specification states that 24 bits are used to represent the
+ * size of a metadata block so we must clip this value to 2^24-1. */
+ padding = av_clip_c(padding, 0, 16777215);
+
ret = ff_flac_write_header(s->pb, codec, 0);
if (ret)
return ret;
- ret = flac_write_block_comment(s->pb, &s->metadata, 0,
- codec->flags & CODEC_FLAG_BITEXACT);
+ ret = flac_write_block_comment(s->pb, &s->metadata, !padding,
+ s->flags & AVFMT_FLAG_BITEXACT);
if (ret)
return ret;
/* The command line flac encoder defaults to placing a seekpoint
* every 10s. So one might add padding to allow that later
* but there seems to be no simple way to get the duration here.
- * So let's try the flac default of 8192 bytes */
- flac_write_block_padding(s->pb, 8192, 1);
+ * So just add the amount requested by the user. */
+ if (padding)
+ flac_write_block_padding(s->pb, padding, 1);
return ret;
}
@@ -100,6 +118,10 @@ static int flac_write_trailer(struct AVFormatContext *s)
uint8_t *streaminfo;
enum FLACExtradataFormat format;
int64_t file_size;
+ FlacMuxerContext *c = s->priv_data;
+
+ if (!c->write_header)
+ return 0;
if (!avpriv_flac_is_extradata_valid(s->streams[0]->codec, &format, &streaminfo))
return -1;
@@ -123,9 +145,22 @@ static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt)
return 0;
}
+static const AVOption flacenc_options[] = {
+ { "write_header", "Write the file header", offsetof(FlacMuxerContext, write_header), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
+ { NULL },
+};
+
+static const AVClass flac_muxer_class = {
+ .class_name = "flac muxer",
+ .item_name = av_default_item_name,
+ .option = flacenc_options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVOutputFormat ff_flac_muxer = {
.name = "flac",
.long_name = NULL_IF_CONFIG_SMALL("raw FLAC"),
+ .priv_data_size = sizeof(FlacMuxerContext),
.mime_type = "audio/x-flac",
.extensions = "flac",
.audio_codec = AV_CODEC_ID_FLAC,
@@ -134,4 +169,5 @@ AVOutputFormat ff_flac_muxer = {
.write_packet = flac_write_packet,
.write_trailer = flac_write_trailer,
.flags = AVFMT_NOTIMESTAMPS,
+ .priv_class = &flac_muxer_class,
};
diff --git a/chromium/third_party/ffmpeg/libavformat/flvdec.c b/chromium/third_party/ffmpeg/libavformat/flvdec.c
index 1024001a473..c0eddd3820d 100644
--- a/chromium/third_party/ffmpeg/libavformat/flvdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/flvdec.c
@@ -256,6 +256,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
return 1; // 1 byte body size adjustment for flv_read_packet()
case FLV_CODECID_H264:
vcodec->codec_id = AV_CODEC_ID_H264;
+ vstream->need_parsing = AVSTREAM_PARSE_HEADERS;
return 3; // not 4, reading packet type will consume one byte
case FLV_CODECID_MPEG4:
vcodec->codec_id = AV_CODEC_ID_MPEG4;
@@ -295,7 +296,7 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc,
int64_t initial_pos = avio_tell(ioc);
if (vstream->nb_index_entries>0) {
- av_log(s, AV_LOG_WARNING, "Skiping duplicate index\n");
+ av_log(s, AV_LOG_WARNING, "Skipping duplicate index\n");
return 0;
}
@@ -579,7 +580,7 @@ static int flv_read_header(AVFormatContext *s)
flags = FLV_HEADER_FLAG_HASVIDEO | FLV_HEADER_FLAG_HASAUDIO;
av_log(s, AV_LOG_WARNING,
"Broken FLV file, which says no streams present, "
- "this might fail\n");
+ "this might fail.\n");
}
s->ctx_flags |= AVFMTCTX_NOHEADER;
@@ -614,9 +615,8 @@ static int flv_read_close(AVFormatContext *s)
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
{
av_free(st->codec->extradata);
- if (ff_alloc_extradata(st->codec, size))
+ if (ff_get_extradata(st->codec, s->pb, size) < 0)
return AVERROR(ENOMEM);
- avio_read(s->pb, st->codec->extradata, st->codec->extradata_size);
return 0;
}
@@ -772,7 +772,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
size = avio_rb24(s->pb);
dts = avio_rb24(s->pb);
dts |= avio_r8(s->pb) << 24;
- av_dlog(s, "type:%d, size:%d, dts:%"PRId64"\n", type, size, dts);
+ av_dlog(s, "type:%d, size:%d, dts:%"PRId64" pos:%"PRId64"\n", type, size, dts, avio_tell(s->pb));
if (url_feof(s->pb))
return AVERROR_EOF;
avio_skip(s->pb, 3); /* stream id, always 0 */
@@ -820,7 +820,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
}
} else {
av_log(s, AV_LOG_DEBUG,
- "skipping flv packet: type %d, size %d, flags %d\n",
+ "Skipping flv packet: type %d, size %d, flags %d.\n",
type, size, flags);
skip:
avio_seek(s->pb, next, SEEK_SET);
@@ -916,7 +916,7 @@ retry_duration:
flv->last_channels =
channels = st->codec->channels;
} else {
- AVCodecContext ctx;
+ AVCodecContext ctx = {0};
ctx.sample_rate = sample_rate;
flv_set_audio_codec(s, st, &ctx, flags & FLV_AUDIO_CODECID_MASK);
sample_rate = ctx.sample_rate;
@@ -934,15 +934,20 @@ retry_duration:
// sign extension
int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000;
pts = dts + cts;
- if (cts < 0) { // dts are wrong
+ if (cts < 0) { // dts might be wrong
+ if (!flv->wrong_dts)
+ av_log(s, AV_LOG_WARNING,
+ "Negative cts, previous timestamps might be wrong.\n");
flv->wrong_dts = 1;
+ } else if (FFABS(dts - pts) > 1000*60*15) {
av_log(s, AV_LOG_WARNING,
- "negative cts, previous timestamps might be wrong\n");
+ "invalid timestamps %"PRId64" %"PRId64"\n", dts, pts);
+ dts = pts = AV_NOPTS_VALUE;
}
- if (flv->wrong_dts)
- dts = AV_NOPTS_VALUE;
}
if (type == 0 && (!st->codec->extradata || st->codec->codec_id == AV_CODEC_ID_AAC)) {
+ AVDictionaryEntry *t;
+
if (st->codec->extradata) {
if ((ret = flv_queue_extradata(flv, s->pb, stream_type, size)) < 0)
return ret;
@@ -951,8 +956,15 @@ retry_duration:
}
if ((ret = flv_get_extradata(s, st, size)) < 0)
return ret;
+
+ /* Workaround for buggy Omnia A/XE encoder */
+ t = av_dict_get(s->metadata, "Encoder", NULL, 0);
+ if (st->codec->codec_id == AV_CODEC_ID_AAC && t && !strcmp(t->value, "Omnia A/XE"))
+ st->codec->extradata_size = 2;
+
if (st->codec->codec_id == AV_CODEC_ID_AAC && 0) {
MPEG4AudioConfig cfg;
+
if (avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
st->codec->extradata_size * 8, 1) >= 0) {
st->codec->channels = cfg.channels;
diff --git a/chromium/third_party/ffmpeg/libavformat/flvenc.c b/chromium/third_party/ffmpeg/libavformat/flvenc.c
index a1b498d9e1d..c16f8ebb4a7 100644
--- a/chromium/third_party/ffmpeg/libavformat/flvenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/flvenc.c
@@ -233,6 +233,9 @@ static int flv_write_header(AVFormatContext *s)
audio_enc = enc;
if (get_audio_flags(s, enc) < 0)
return AVERROR_INVALIDDATA;
+ if (enc->codec_id == AV_CODEC_ID_PCM_S16BE)
+ av_log(s, AV_LOG_WARNING,
+ "16-bit big-endian audio in flv is valid but most likely unplayable (hardware dependent); use s16le\n");
break;
case AVMEDIA_TYPE_DATA:
if (enc->codec_id != AV_CODEC_ID_TEXT) {
@@ -539,7 +542,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
if (enc->codec_type == AVMEDIA_TYPE_DATA) {
int data_size;
- int metadata_size_pos = avio_tell(pb);
+ int64_t metadata_size_pos = avio_tell(pb);
avio_w8(pb, AMF_DATA_TYPE_STRING);
put_amf_string(pb, "onTextData");
avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY);
diff --git a/chromium/third_party/ffmpeg/libavformat/format.c b/chromium/third_party/ffmpeg/libavformat/format.c
index 36c0131c12e..95060f373d7 100644
--- a/chromium/third_party/ffmpeg/libavformat/format.c
+++ b/chromium/third_party/ffmpeg/libavformat/format.c
@@ -33,6 +33,9 @@ static AVInputFormat *first_iformat = NULL;
/** head of registered output format linked list */
static AVOutputFormat *first_oformat = NULL;
+static AVInputFormat **last_iformat = &first_iformat;
+static AVOutputFormat **last_oformat = &first_oformat;
+
AVInputFormat *av_iformat_next(AVInputFormat *f)
{
if (f)
@@ -51,20 +54,22 @@ AVOutputFormat *av_oformat_next(AVOutputFormat *f)
void av_register_input_format(AVInputFormat *format)
{
- AVInputFormat **p = &first_iformat;
+ AVInputFormat **p = last_iformat;
format->next = NULL;
while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format))
p = &(*p)->next;
+ last_iformat = &format->next;
}
void av_register_output_format(AVOutputFormat *format)
{
- AVOutputFormat **p = &first_oformat;
+ AVOutputFormat **p = last_oformat;
format->next = NULL;
while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format))
p = &(*p)->next;
+ last_oformat = &format->next;
}
int av_match_ext(const char *filename, const char *extensions)
diff --git a/chromium/third_party/ffmpeg/libavformat/framecrcenc.c b/chromium/third_party/ffmpeg/libavformat/framecrcenc.c
index dbe49b5ba1e..4a96083953f 100644
--- a/chromium/third_party/ffmpeg/libavformat/framecrcenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/framecrcenc.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/adler32.h"
#include "libavutil/avstring.h"
#include "avformat.h"
@@ -29,7 +31,7 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
uint32_t crc = av_adler32_update(0, pkt->data, pkt->size);
char buf[256];
- snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08x",
+ snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08"PRIx32,
pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc);
if (pkt->flags != AV_PKT_FLAG_KEY)
av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags);
diff --git a/chromium/third_party/ffmpeg/libavformat/ftp.c b/chromium/third_party/ffmpeg/libavformat/ftp.c
index ed9a3db419b..dae8aa086d2 100644
--- a/chromium/third_party/ffmpeg/libavformat/ftp.c
+++ b/chromium/third_party/ffmpeg/libavformat/ftp.c
@@ -572,13 +572,15 @@ static int64_t ftp_seek(URLContext *h, int64_t pos, int whence)
return AVERROR(EINVAL);
}
- if (h->is_streamed)
+ if (h->is_streamed)
return AVERROR(EIO);
- /* XXX: Simulate behaviour of lseek in file protocol, which could be treated as a reference */
- new_pos = FFMAX(0, new_pos);
- fake_pos = s->filesize != -1 ? FFMIN(new_pos, s->filesize) : new_pos;
+ if (new_pos < 0) {
+ av_log(h, AV_LOG_ERROR, "Seeking to nagative position.\n");
+ return AVERROR(EINVAL);
+ }
+ fake_pos = s->filesize != -1 ? FFMIN(new_pos, s->filesize) : new_pos;
if (fake_pos != s->position) {
if ((err = ftp_abort(h)) < 0)
return err;
diff --git a/chromium/third_party/ffmpeg/libavformat/gif.c b/chromium/third_party/ffmpeg/libavformat/gif.c
index e52498d42b4..e8171214400 100644
--- a/chromium/third_party/ffmpeg/libavformat/gif.c
+++ b/chromium/third_party/ffmpeg/libavformat/gif.c
@@ -28,10 +28,19 @@
#include "libavutil/log.h"
#include "libavutil/opt.h"
-static int gif_image_write_header(AVIOContext *pb, int width, int height,
+static int gif_image_write_header(AVFormatContext *s, int width, int height,
int loop_count, uint32_t *palette)
{
+ AVIOContext *pb = s->pb;
+ AVRational sar = s->streams[0]->codec->sample_aspect_ratio;
int i;
+ int64_t aspect = 0;
+
+ if (sar.num > 0 && sar.den > 0) {
+ aspect = sar.num * 64LL / sar.den - 15;
+ if (aspect < 0 || aspect > 255)
+ aspect = 0;
+ }
avio_write(pb, "GIF", 3);
avio_write(pb, "89a", 3);
@@ -41,7 +50,7 @@ static int gif_image_write_header(AVIOContext *pb, int width, int height,
if (palette) {
avio_w8(pb, 0xf7); /* flags: global clut, 256 entries */
avio_w8(pb, 0x1f); /* background color index */
- avio_w8(pb, 0); /* aspect ratio */
+ avio_w8(pb, aspect);
for (i = 0; i < 256; i++) {
const uint32_t v = palette[i] & 0xffffff;
avio_wb24(pb, v);
@@ -49,7 +58,7 @@ static int gif_image_write_header(AVIOContext *pb, int width, int height,
} else {
avio_w8(pb, 0); /* flags */
avio_w8(pb, 0); /* background color index */
- avio_w8(pb, 0); /* aspect ratio */
+ avio_w8(pb, aspect);
}
@@ -79,7 +88,6 @@ typedef struct {
static int gif_write_header(AVFormatContext *s)
{
GIFContext *gif = s->priv_data;
- AVIOContext *pb = s->pb;
AVCodecContext *video_enc;
int width, height;
uint32_t palette[AVPALETTE_COUNT];
@@ -99,9 +107,9 @@ static int gif_write_header(AVFormatContext *s)
avpriv_set_pts_info(s->streams[0], 64, 1, 100);
if (avpriv_set_systematic_pal2(palette, video_enc->pix_fmt) < 0) {
av_assert0(video_enc->pix_fmt == AV_PIX_FMT_PAL8);
- gif_image_write_header(pb, width, height, gif->loop, NULL);
+ gif_image_write_header(s, width, height, gif->loop, NULL);
} else {
- gif_image_write_header(pb, width, height, gif->loop, palette);
+ gif_image_write_header(s, width, height, gif->loop, palette);
}
avio_flush(s->pb);
diff --git a/chromium/third_party/ffmpeg/libavformat/golomb_tab.c b/chromium/third_party/ffmpeg/libavformat/golomb_tab.c
new file mode 100644
index 00000000000..063fae36471
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/golomb_tab.c
@@ -0,0 +1 @@
+#include "libavcodec/golomb.c"
diff --git a/chromium/third_party/ffmpeg/libavformat/gxf.c b/chromium/third_party/ffmpeg/libavformat/gxf.c
index c36479a8213..479a8fb394d 100644
--- a/chromium/third_party/ffmpeg/libavformat/gxf.c
+++ b/chromium/third_party/ffmpeg/libavformat/gxf.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "avformat.h"
@@ -293,7 +295,9 @@ static void gxf_read_index(AVFormatContext *s, int pkt_len) {
}
st = s->streams[0];
if (map_cnt > 1000) {
- av_log(s, AV_LOG_ERROR, "too many index entries %u (%x)\n", map_cnt, map_cnt);
+ av_log(s, AV_LOG_ERROR,
+ "too many index entries %"PRIu32" (%"PRIx32")\n",
+ map_cnt, map_cnt);
map_cnt = 1000;
}
if (pkt_len < 4 * map_cnt) {
diff --git a/chromium/third_party/ffmpeg/libavformat/gxfenc.c b/chromium/third_party/ffmpeg/libavformat/gxfenc.c
index 5fa510057d3..12031f7cd91 100644
--- a/chromium/third_party/ffmpeg/libavformat/gxfenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/gxfenc.c
@@ -949,7 +949,7 @@ static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt)
AVStream *st = s->streams[pkt->stream_index];
int64_t pos = avio_tell(pb);
int padding = 0;
- int packet_start_offset = avio_tell(pb) / 1024;
+ unsigned packet_start_offset = avio_tell(pb) / 1024;
int ret;
gxf_write_packet_header(pb, PKT_MEDIA);
diff --git a/chromium/third_party/ffmpeg/libavformat/h263dec.c b/chromium/third_party/ffmpeg/libavformat/h263dec.c
index e6e0345b690..145fb859021 100644
--- a/chromium/third_party/ffmpeg/libavformat/h263dec.c
+++ b/chromium/third_party/ffmpeg/libavformat/h263dec.c
@@ -31,24 +31,37 @@ static int h263_probe(AVProbeData *p)
int res_change=0;
int src_fmt, last_src_fmt=-1;
int last_gn=0;
+ int tr, last_tr = -1;
for(i=0; i<p->buf_size; i++){
code = (code<<8) + p->buf[i];
- if ((code & 0xfffffc0000) == 0x800000) {
- src_fmt= (code>>2)&3;
+ if ((code & 0xfffffc000000) == 0x80000000) {
+ tr = (code >> 18) & 0xFF;
+ src_fmt= (code>>10)&7;
if( src_fmt != last_src_fmt
&& last_src_fmt>0 && last_src_fmt<6
&& src_fmt<6)
res_change++;
- if((code&0x300)==0x200 && src_fmt){
+ if (tr == last_tr) {
+ invalid_psc++;
+ continue;
+ }
+
+ if (src_fmt != 7 && !(code&(1<<9)) && (code&(1<<5))) {
+ invalid_psc++;
+ continue;
+ }
+
+ if((code&0x30000)==0x20000 && src_fmt){
valid_psc++;
last_gn=0;
}else
invalid_psc++;
last_src_fmt= src_fmt;
- } else if((code & 0xffff800000) == 0x800000) {
- int gn= (code>>(23-5)) & 0x1F;
+ last_tr = tr;
+ } else if((code & 0xffff80000000) == 0x80000000) {
+ int gn= (code>>(31-5)) & 0x1F;
if(gn<last_gn){
invalid_psc++;
}else
diff --git a/chromium/third_party/ffmpeg/libavformat/hdsenc.c b/chromium/third_party/ffmpeg/libavformat/hdsenc.c
index 08ae5490d24..fb0a94892aa 100644
--- a/chromium/third_party/ffmpeg/libavformat/hdsenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/hdsenc.c
@@ -89,7 +89,7 @@ static int parse_header(OutputStream *os, const uint8_t *buf, int buf_size)
if (size > buf_size)
return AVERROR_INVALIDDATA;
if (type == 8 || type == 9) {
- if (os->nb_extra_packets > FF_ARRAY_ELEMS(os->extra_packets))
+ if (os->nb_extra_packets >= FF_ARRAY_ELEMS(os->extra_packets))
return AVERROR_INVALIDDATA;
os->extra_packet_sizes[os->nb_extra_packets] = size;
os->extra_packets[os->nb_extra_packets] = av_malloc(size);
@@ -204,7 +204,10 @@ static int write_manifest(AVFormatContext *s, int final)
avio_printf(out, "</manifest>\n");
avio_flush(out);
avio_close(out);
- rename(temp_filename, filename);
+ if (rename(temp_filename, filename) == -1) {
+ av_log(s, AV_LOG_ERROR, "failed to rename file %s to %s\n", temp_filename, filename);
+ return AVERROR(errno);
+ }
return 0;
}
@@ -286,7 +289,10 @@ static int write_abst(AVFormatContext *s, OutputStream *os, int final)
update_size(out, afrt_pos);
update_size(out, 0);
avio_close(out);
- rename(temp_filename, filename);
+ if (rename(temp_filename, filename) == -1) {
+ av_log(s, AV_LOG_ERROR, "failed to rename file %s to %s\n", temp_filename, filename);
+ return AVERROR(errno);
+ }
return 0;
}
@@ -323,7 +329,14 @@ static int hds_write_header(AVFormatContext *s)
int ret = 0, i;
AVOutputFormat *oformat;
- mkdir(s->filename, 0777);
+ if (mkdir(s->filename, 0777)) {
+ int is_error = errno != EEXIST;
+ av_log(s, is_error ? AV_LOG_ERROR : AV_LOG_VERBOSE, "Failed to create directory %s\n", s->filename);
+ if (is_error) {
+ ret = AVERROR(errno);
+ goto fail;
+ }
+ }
oformat = av_guess_format("flv", NULL, NULL);
if (!oformat) {
@@ -412,7 +425,9 @@ static int hds_write_header(AVFormatContext *s)
snprintf(os->temp_filename, sizeof(os->temp_filename),
"%s/stream%d_temp", s->filename, i);
- init_file(s, os, 0);
+ ret = init_file(s, os, 0);
+ if (ret < 0)
+ goto fail;
if (!os->has_video && c->min_frag_duration <= 0) {
av_log(s, AV_LOG_WARNING,
@@ -475,7 +490,10 @@ static int hds_flush(AVFormatContext *s, OutputStream *os, int final,
snprintf(target_filename, sizeof(target_filename),
"%s/stream%dSeg1-Frag%d", s->filename, index, os->fragment_index);
- rename(os->temp_filename, target_filename);
+ if (rename(os->temp_filename, target_filename) == -1) {
+ av_log(s, AV_LOG_ERROR, "failed to rename file %s to %s\n", os->temp_filename, target_filename);
+ return AVERROR(errno);
+ }
add_fragment(os, target_filename, os->frag_start_ts, end_ts - os->frag_start_ts);
if (!final) {
@@ -509,7 +527,7 @@ static int hds_write_packet(AVFormatContext *s, AVPacket *pkt)
HDSContext *c = s->priv_data;
AVStream *st = s->streams[pkt->stream_index];
OutputStream *os = &c->streams[s->streams[pkt->stream_index]->id];
- int64_t end_dts = (os->fragment_index) * c->min_frag_duration;
+ int64_t end_dts = os->fragment_index * (int64_t)c->min_frag_duration;
int ret;
if (st->first_dts == AV_NOPTS_VALUE)
diff --git a/chromium/third_party/ffmpeg/libavformat/hevc.c b/chromium/third_party/ffmpeg/libavformat/hevc.c
new file mode 100644
index 00000000000..96323861532
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/hevc.c
@@ -0,0 +1,1140 @@
+/*
+ * Copyright (c) 2014 Tim Walker <tdskywalker@gmail.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 "libavcodec/get_bits.h"
+#include "libavcodec/golomb.h"
+#include "libavcodec/hevc.h"
+#include "libavutil/intreadwrite.h"
+#include "avc.h"
+#include "avio.h"
+#include "hevc.h"
+
+#define MAX_SPATIAL_SEGMENTATION 4096 // max. value of u(12) field
+
+typedef struct HVCCNALUnitArray {
+ uint8_t array_completeness;
+ uint8_t NAL_unit_type;
+ uint16_t numNalus;
+ uint16_t *nalUnitLength;
+ uint8_t **nalUnit;
+} HVCCNALUnitArray;
+
+typedef struct HEVCDecoderConfigurationRecord {
+ uint8_t configurationVersion;
+ uint8_t general_profile_space;
+ uint8_t general_tier_flag;
+ uint8_t general_profile_idc;
+ uint32_t general_profile_compatibility_flags;
+ uint64_t general_constraint_indicator_flags;
+ uint8_t general_level_idc;
+ uint16_t min_spatial_segmentation_idc;
+ uint8_t parallelismType;
+ uint8_t chromaFormat;
+ uint8_t bitDepthLumaMinus8;
+ uint8_t bitDepthChromaMinus8;
+ uint16_t avgFrameRate;
+ uint8_t constantFrameRate;
+ uint8_t numTemporalLayers;
+ uint8_t temporalIdNested;
+ uint8_t lengthSizeMinusOne;
+ uint8_t numOfArrays;
+ HVCCNALUnitArray *array;
+} HEVCDecoderConfigurationRecord;
+
+typedef struct HVCCProfileTierLevel {
+ uint8_t profile_space;
+ uint8_t tier_flag;
+ uint8_t profile_idc;
+ uint32_t profile_compatibility_flags;
+ uint64_t constraint_indicator_flags;
+ uint8_t level_idc;
+} HVCCProfileTierLevel;
+
+static void hvcc_update_ptl(HEVCDecoderConfigurationRecord *hvcc,
+ HVCCProfileTierLevel *ptl)
+{
+ /*
+ * The value of general_profile_space in all the parameter sets must be
+ * identical.
+ */
+ hvcc->general_profile_space = ptl->profile_space;
+
+ /*
+ * The level indication general_level_idc must indicate a level of
+ * capability equal to or greater than the highest level indicated for the
+ * highest tier in all the parameter sets.
+ */
+ if (hvcc->general_tier_flag < ptl->tier_flag)
+ hvcc->general_level_idc = ptl->level_idc;
+ else
+ hvcc->general_level_idc = FFMAX(hvcc->general_level_idc, ptl->level_idc);
+
+ /*
+ * The tier indication general_tier_flag must indicate a tier equal to or
+ * greater than the highest tier indicated in all the parameter sets.
+ */
+ hvcc->general_tier_flag = FFMAX(hvcc->general_tier_flag, ptl->tier_flag);
+
+ /*
+ * The profile indication general_profile_idc must indicate a profile to
+ * which the stream associated with this configuration record conforms.
+ *
+ * If the sequence parameter sets are marked with different profiles, then
+ * the stream may need examination to determine which profile, if any, the
+ * entire stream conforms to. If the entire stream is not examined, or the
+ * examination reveals that there is no profile to which the entire stream
+ * conforms, then the entire stream must be split into two or more
+ * sub-streams with separate configuration records in which these rules can
+ * be met.
+ *
+ * Note: set the profile to the highest value for the sake of simplicity.
+ */
+ hvcc->general_profile_idc = FFMAX(hvcc->general_profile_idc, ptl->profile_idc);
+
+ /*
+ * Each bit in general_profile_compatibility_flags may only be set if all
+ * the parameter sets set that bit.
+ */
+ hvcc->general_profile_compatibility_flags &= ptl->profile_compatibility_flags;
+
+ /*
+ * Each bit in general_constraint_indicator_flags may only be set if all
+ * the parameter sets set that bit.
+ */
+ hvcc->general_constraint_indicator_flags &= ptl->constraint_indicator_flags;
+}
+
+static void hvcc_parse_ptl(GetBitContext *gb,
+ HEVCDecoderConfigurationRecord *hvcc,
+ unsigned int max_sub_layers_minus1)
+{
+ unsigned int i;
+ HVCCProfileTierLevel general_ptl;
+ uint8_t sub_layer_profile_present_flag[MAX_SUB_LAYERS];
+ uint8_t sub_layer_level_present_flag[MAX_SUB_LAYERS];
+
+ general_ptl.profile_space = get_bits(gb, 2);
+ general_ptl.tier_flag = get_bits1(gb);
+ general_ptl.profile_idc = get_bits(gb, 5);
+ general_ptl.profile_compatibility_flags = get_bits_long(gb, 32);
+ general_ptl.constraint_indicator_flags = get_bits64(gb, 48);
+ general_ptl.level_idc = get_bits(gb, 8);
+ hvcc_update_ptl(hvcc, &general_ptl);
+
+ for (i = 0; i < max_sub_layers_minus1; i++) {
+ sub_layer_profile_present_flag[i] = get_bits1(gb);
+ sub_layer_level_present_flag[i] = get_bits1(gb);
+ }
+
+ if (max_sub_layers_minus1 > 0)
+ for (i = max_sub_layers_minus1; i < 8; i++)
+ skip_bits(gb, 2); // reserved_zero_2bits[i]
+
+ for (i = 0; i < max_sub_layers_minus1; i++) {
+ if (sub_layer_profile_present_flag[i]) {
+ /*
+ * sub_layer_profile_space[i] u(2)
+ * sub_layer_tier_flag[i] u(1)
+ * sub_layer_profile_idc[i] u(5)
+ * sub_layer_profile_compatibility_flag[i][0..31] u(32)
+ * sub_layer_progressive_source_flag[i] u(1)
+ * sub_layer_interlaced_source_flag[i] u(1)
+ * sub_layer_non_packed_constraint_flag[i] u(1)
+ * sub_layer_frame_only_constraint_flag[i] u(1)
+ * sub_layer_reserved_zero_44bits[i] u(44)
+ */
+ skip_bits_long(gb, 32);
+ skip_bits_long(gb, 32);
+ skip_bits (gb, 24);
+ }
+
+ if (sub_layer_level_present_flag[i])
+ skip_bits(gb, 8);
+ }
+}
+
+static void skip_sub_layer_hrd_parameters(GetBitContext *gb,
+ unsigned int cpb_cnt_minus1,
+ uint8_t sub_pic_hrd_params_present_flag)
+{
+ unsigned int i;
+
+ for (i = 0; i <= cpb_cnt_minus1; i++) {
+ get_ue_golomb_long(gb); // bit_rate_value_minus1
+ get_ue_golomb_long(gb); // cpb_size_value_minus1
+
+ if (sub_pic_hrd_params_present_flag) {
+ get_ue_golomb_long(gb); // cpb_size_du_value_minus1
+ get_ue_golomb_long(gb); // bit_rate_du_value_minus1
+ }
+
+ skip_bits1(gb); // cbr_flag
+ }
+}
+
+static void skip_hrd_parameters(GetBitContext *gb, uint8_t cprms_present_flag,
+ unsigned int max_sub_layers_minus1)
+{
+ unsigned int i;
+ uint8_t sub_pic_hrd_params_present_flag = 0;
+ uint8_t nal_hrd_parameters_present_flag = 0;
+ uint8_t vcl_hrd_parameters_present_flag = 0;
+
+ if (cprms_present_flag) {
+ nal_hrd_parameters_present_flag = get_bits1(gb);
+ vcl_hrd_parameters_present_flag = get_bits1(gb);
+
+ if (nal_hrd_parameters_present_flag ||
+ vcl_hrd_parameters_present_flag) {
+ sub_pic_hrd_params_present_flag = get_bits1(gb);
+
+ if (sub_pic_hrd_params_present_flag)
+ /*
+ * tick_divisor_minus2 u(8)
+ * du_cpb_removal_delay_increment_length_minus1 u(5)
+ * sub_pic_cpb_params_in_pic_timing_sei_flag u(1)
+ * dpb_output_delay_du_length_minus1 u(5)
+ */
+ skip_bits(gb, 19);
+
+ /*
+ * bit_rate_scale u(4)
+ * cpb_size_scale u(4)
+ */
+ skip_bits(gb, 8);
+
+ if (sub_pic_hrd_params_present_flag)
+ skip_bits(gb, 4); // cpb_size_du_scale
+
+ /*
+ * initial_cpb_removal_delay_length_minus1 u(5)
+ * au_cpb_removal_delay_length_minus1 u(5)
+ * dpb_output_delay_length_minus1 u(5)
+ */
+ skip_bits(gb, 15);
+ }
+ }
+
+ for (i = 0; i <= max_sub_layers_minus1; i++) {
+ unsigned int cpb_cnt_minus1 = 0;
+ uint8_t low_delay_hrd_flag = 0;
+ uint8_t fixed_pic_rate_within_cvs_flag = 0;
+ uint8_t fixed_pic_rate_general_flag = get_bits1(gb);
+
+ if (!fixed_pic_rate_general_flag)
+ fixed_pic_rate_within_cvs_flag = get_bits1(gb);
+
+ if (fixed_pic_rate_within_cvs_flag)
+ get_ue_golomb_long(gb); // elemental_duration_in_tc_minus1
+ else
+ low_delay_hrd_flag = get_bits1(gb);
+
+ if (!low_delay_hrd_flag)
+ cpb_cnt_minus1 = get_ue_golomb_long(gb);
+
+ if (nal_hrd_parameters_present_flag)
+ skip_sub_layer_hrd_parameters(gb, cpb_cnt_minus1,
+ sub_pic_hrd_params_present_flag);
+
+ if (vcl_hrd_parameters_present_flag)
+ skip_sub_layer_hrd_parameters(gb, cpb_cnt_minus1,
+ sub_pic_hrd_params_present_flag);
+ }
+}
+
+static void skip_timing_info(GetBitContext *gb)
+{
+ skip_bits_long(gb, 32); // num_units_in_tick
+ skip_bits_long(gb, 32); // time_scale
+
+ if (get_bits1(gb)) // poc_proportional_to_timing_flag
+ get_ue_golomb_long(gb); // num_ticks_poc_diff_one_minus1
+}
+
+static void hvcc_parse_vui(GetBitContext *gb,
+ HEVCDecoderConfigurationRecord *hvcc,
+ unsigned int max_sub_layers_minus1)
+{
+ unsigned int min_spatial_segmentation_idc;
+
+ if (get_bits1(gb)) // aspect_ratio_info_present_flag
+ if (get_bits(gb, 8) == 255) // aspect_ratio_idc
+ skip_bits_long(gb, 32); // sar_width u(16), sar_height u(16)
+
+ if (get_bits1(gb)) // overscan_info_present_flag
+ skip_bits1(gb); // overscan_appropriate_flag
+
+ if (get_bits1(gb)) { // video_signal_type_present_flag
+ skip_bits(gb, 4); // video_format u(3), video_full_range_flag u(1)
+
+ if (get_bits1(gb)) // colour_description_present_flag
+ /*
+ * colour_primaries u(8)
+ * transfer_characteristics u(8)
+ * matrix_coeffs u(8)
+ */
+ skip_bits(gb, 24);
+ }
+
+ if (get_bits1(gb)) { // chroma_loc_info_present_flag
+ get_ue_golomb_long(gb); // chroma_sample_loc_type_top_field
+ get_ue_golomb_long(gb); // chroma_sample_loc_type_bottom_field
+ }
+
+ /*
+ * neutral_chroma_indication_flag u(1)
+ * field_seq_flag u(1)
+ * frame_field_info_present_flag u(1)
+ */
+ skip_bits(gb, 3);
+
+ if (get_bits1(gb)) { // default_display_window_flag
+ get_ue_golomb_long(gb); // def_disp_win_left_offset
+ get_ue_golomb_long(gb); // def_disp_win_right_offset
+ get_ue_golomb_long(gb); // def_disp_win_top_offset
+ get_ue_golomb_long(gb); // def_disp_win_bottom_offset
+ }
+
+ if (get_bits1(gb)) { // vui_timing_info_present_flag
+ skip_timing_info(gb);
+
+ if (get_bits1(gb)) // vui_hrd_parameters_present_flag
+ skip_hrd_parameters(gb, 1, max_sub_layers_minus1);
+ }
+
+ if (get_bits1(gb)) { // bitstream_restriction_flag
+ /*
+ * tiles_fixed_structure_flag u(1)
+ * motion_vectors_over_pic_boundaries_flag u(1)
+ * restricted_ref_pic_lists_flag u(1)
+ */
+ skip_bits(gb, 3);
+
+ min_spatial_segmentation_idc = get_ue_golomb_long(gb);
+
+ /*
+ * unsigned int(12) min_spatial_segmentation_idc;
+ *
+ * The min_spatial_segmentation_idc indication must indicate a level of
+ * spatial segmentation equal to or less than the lowest level of
+ * spatial segmentation indicated in all the parameter sets.
+ */
+ hvcc->min_spatial_segmentation_idc = FFMIN(hvcc->min_spatial_segmentation_idc,
+ min_spatial_segmentation_idc);
+
+ get_ue_golomb_long(gb); // max_bytes_per_pic_denom
+ get_ue_golomb_long(gb); // max_bits_per_min_cu_denom
+ get_ue_golomb_long(gb); // log2_max_mv_length_horizontal
+ get_ue_golomb_long(gb); // log2_max_mv_length_vertical
+ }
+}
+
+static void skip_sub_layer_ordering_info(GetBitContext *gb)
+{
+ get_ue_golomb_long(gb); // max_dec_pic_buffering_minus1
+ get_ue_golomb_long(gb); // max_num_reorder_pics
+ get_ue_golomb_long(gb); // max_latency_increase_plus1
+}
+
+static int hvcc_parse_vps(GetBitContext *gb,
+ HEVCDecoderConfigurationRecord *hvcc)
+{
+ unsigned int vps_max_sub_layers_minus1;
+
+ /*
+ * vps_video_parameter_set_id u(4)
+ * vps_reserved_three_2bits u(2)
+ * vps_max_layers_minus1 u(6)
+ */
+ skip_bits(gb, 12);
+
+ vps_max_sub_layers_minus1 = get_bits(gb, 3);
+
+ /*
+ * numTemporalLayers greater than 1 indicates that the stream to which this
+ * configuration record applies is temporally scalable and the contained
+ * number of temporal layers (also referred to as temporal sub-layer or
+ * sub-layer in ISO/IEC 23008-2) is equal to numTemporalLayers. Value 1
+ * indicates that the stream is not temporally scalable. Value 0 indicates
+ * that it is unknown whether the stream is temporally scalable.
+ */
+ hvcc->numTemporalLayers = FFMAX(hvcc->numTemporalLayers,
+ vps_max_sub_layers_minus1 + 1);
+
+ /*
+ * vps_temporal_id_nesting_flag u(1)
+ * vps_reserved_0xffff_16bits u(16)
+ */
+ skip_bits(gb, 17);
+
+ hvcc_parse_ptl(gb, hvcc, vps_max_sub_layers_minus1);
+
+ /* nothing useful for hvcC past this point */
+ return 0;
+}
+
+static void skip_scaling_list_data(GetBitContext *gb)
+{
+ int i, j, k, num_coeffs;
+
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < (i == 3 ? 2 : 6); j++)
+ if (!get_bits1(gb)) // scaling_list_pred_mode_flag[i][j]
+ get_ue_golomb_long(gb); // scaling_list_pred_matrix_id_delta[i][j]
+ else {
+ num_coeffs = FFMIN(64, 1 << (4 + (i << 1)));
+
+ if (i > 1)
+ get_se_golomb_long(gb); // scaling_list_dc_coef_minus8[i-2][j]
+
+ for (k = 0; k < num_coeffs; k++)
+ get_se_golomb_long(gb); // scaling_list_delta_coef
+ }
+}
+
+static int parse_rps(GetBitContext *gb, unsigned int rps_idx,
+ unsigned int num_rps,
+ unsigned int num_delta_pocs[MAX_SHORT_TERM_RPS_COUNT])
+{
+ unsigned int i;
+
+ if (rps_idx && get_bits1(gb)) { // inter_ref_pic_set_prediction_flag
+ /* this should only happen for slice headers, and this isn't one */
+ if (rps_idx >= num_rps)
+ return AVERROR_INVALIDDATA;
+
+ skip_bits1 (gb); // delta_rps_sign
+ get_ue_golomb_long(gb); // abs_delta_rps_minus1
+
+ num_delta_pocs[rps_idx] = 0;
+
+ /*
+ * From libavcodec/hevc_ps.c:
+ *
+ * if (is_slice_header) {
+ * //foo
+ * } else
+ * rps_ridx = &sps->st_rps[rps - sps->st_rps - 1];
+ *
+ * where:
+ * rps: &sps->st_rps[rps_idx]
+ * sps->st_rps: &sps->st_rps[0]
+ * is_slice_header: rps_idx == num_rps
+ *
+ * thus:
+ * if (num_rps != rps_idx)
+ * rps_ridx = &sps->st_rps[rps_idx - 1];
+ *
+ * NumDeltaPocs[RefRpsIdx]: num_delta_pocs[rps_idx - 1]
+ */
+ for (i = 0; i < num_delta_pocs[rps_idx - 1]; i++) {
+ uint8_t use_delta_flag = 0;
+ uint8_t used_by_curr_pic_flag = get_bits1(gb);
+ if (!used_by_curr_pic_flag)
+ use_delta_flag = get_bits1(gb);
+
+ if (used_by_curr_pic_flag || use_delta_flag)
+ num_delta_pocs[rps_idx]++;
+ }
+ } else {
+ unsigned int num_negative_pics = get_ue_golomb_long(gb);
+ unsigned int num_positive_pics = get_ue_golomb_long(gb);
+
+ num_delta_pocs[rps_idx] = num_negative_pics + num_positive_pics;
+
+ for (i = 0; i < num_negative_pics; i++) {
+ get_ue_golomb_long(gb); // delta_poc_s0_minus1[rps_idx]
+ skip_bits1 (gb); // used_by_curr_pic_s0_flag[rps_idx]
+ }
+
+ for (i = 0; i < num_positive_pics; i++) {
+ get_ue_golomb_long(gb); // delta_poc_s1_minus1[rps_idx]
+ skip_bits1 (gb); // used_by_curr_pic_s1_flag[rps_idx]
+ }
+ }
+
+ return 0;
+}
+
+static int hvcc_parse_sps(GetBitContext *gb,
+ HEVCDecoderConfigurationRecord *hvcc)
+{
+ unsigned int i, sps_max_sub_layers_minus1, log2_max_pic_order_cnt_lsb_minus4;
+ unsigned int num_short_term_ref_pic_sets, num_delta_pocs[MAX_SHORT_TERM_RPS_COUNT];
+
+ skip_bits(gb, 4); // sps_video_parameter_set_id
+
+ sps_max_sub_layers_minus1 = get_bits (gb, 3);
+
+ /*
+ * numTemporalLayers greater than 1 indicates that the stream to which this
+ * configuration record applies is temporally scalable and the contained
+ * number of temporal layers (also referred to as temporal sub-layer or
+ * sub-layer in ISO/IEC 23008-2) is equal to numTemporalLayers. Value 1
+ * indicates that the stream is not temporally scalable. Value 0 indicates
+ * that it is unknown whether the stream is temporally scalable.
+ */
+ hvcc->numTemporalLayers = FFMAX(hvcc->numTemporalLayers,
+ sps_max_sub_layers_minus1 + 1);
+
+ hvcc->temporalIdNested = get_bits1(gb);
+
+ hvcc_parse_ptl(gb, hvcc, sps_max_sub_layers_minus1);
+
+ get_ue_golomb_long(gb); // sps_seq_parameter_set_id
+
+ hvcc->chromaFormat = get_ue_golomb_long(gb);
+
+ if (hvcc->chromaFormat == 3)
+ skip_bits1(gb); // separate_colour_plane_flag
+
+ get_ue_golomb_long(gb); // pic_width_in_luma_samples
+ get_ue_golomb_long(gb); // pic_height_in_luma_samples
+
+ if (get_bits1(gb)) { // conformance_window_flag
+ get_ue_golomb_long(gb); // conf_win_left_offset
+ get_ue_golomb_long(gb); // conf_win_right_offset
+ get_ue_golomb_long(gb); // conf_win_top_offset
+ get_ue_golomb_long(gb); // conf_win_bottom_offset
+ }
+
+ hvcc->bitDepthLumaMinus8 = get_ue_golomb_long(gb);
+ hvcc->bitDepthChromaMinus8 = get_ue_golomb_long(gb);
+ log2_max_pic_order_cnt_lsb_minus4 = get_ue_golomb_long(gb);
+
+ /* sps_sub_layer_ordering_info_present_flag */
+ i = get_bits1(gb) ? 0 : sps_max_sub_layers_minus1;
+ for (; i <= sps_max_sub_layers_minus1; i++)
+ skip_sub_layer_ordering_info(gb);
+
+ get_ue_golomb_long(gb); // log2_min_luma_coding_block_size_minus3
+ get_ue_golomb_long(gb); // log2_diff_max_min_luma_coding_block_size
+ get_ue_golomb_long(gb); // log2_min_transform_block_size_minus2
+ get_ue_golomb_long(gb); // log2_diff_max_min_transform_block_size
+ get_ue_golomb_long(gb); // max_transform_hierarchy_depth_inter
+ get_ue_golomb_long(gb); // max_transform_hierarchy_depth_intra
+
+ if (get_bits1(gb) && // scaling_list_enabled_flag
+ get_bits1(gb)) // sps_scaling_list_data_present_flag
+ skip_scaling_list_data(gb);
+
+ skip_bits1(gb); // amp_enabled_flag
+ skip_bits1(gb); // sample_adaptive_offset_enabled_flag
+
+ if (get_bits1(gb)) { // pcm_enabled_flag
+ skip_bits (gb, 4); // pcm_sample_bit_depth_luma_minus1
+ skip_bits (gb, 4); // pcm_sample_bit_depth_chroma_minus1
+ get_ue_golomb_long(gb); // log2_min_pcm_luma_coding_block_size_minus3
+ get_ue_golomb_long(gb); // log2_diff_max_min_pcm_luma_coding_block_size
+ skip_bits1 (gb); // pcm_loop_filter_disabled_flag
+ }
+
+ num_short_term_ref_pic_sets = get_ue_golomb_long(gb);
+ if (num_short_term_ref_pic_sets > MAX_SHORT_TERM_RPS_COUNT)
+ return AVERROR_INVALIDDATA;
+
+ for (i = 0; i < num_short_term_ref_pic_sets; i++) {
+ int ret = parse_rps(gb, i, num_short_term_ref_pic_sets, num_delta_pocs);
+ if (ret < 0)
+ return ret;
+ }
+
+ if (get_bits1(gb)) { // long_term_ref_pics_present_flag
+ for (i = 0; i < get_ue_golomb_long(gb); i++) { // num_long_term_ref_pics_sps
+ int len = FFMIN(log2_max_pic_order_cnt_lsb_minus4 + 4, 16);
+ skip_bits (gb, len); // lt_ref_pic_poc_lsb_sps[i]
+ skip_bits1(gb); // used_by_curr_pic_lt_sps_flag[i]
+ }
+ }
+
+ skip_bits1(gb); // sps_temporal_mvp_enabled_flag
+ skip_bits1(gb); // strong_intra_smoothing_enabled_flag
+
+ if (get_bits1(gb)) // vui_parameters_present_flag
+ hvcc_parse_vui(gb, hvcc, sps_max_sub_layers_minus1);
+
+ /* nothing useful for hvcC past this point */
+ return 0;
+}
+
+static int hvcc_parse_pps(GetBitContext *gb,
+ HEVCDecoderConfigurationRecord *hvcc)
+{
+ uint8_t tiles_enabled_flag, entropy_coding_sync_enabled_flag;
+
+ get_ue_golomb_long(gb); // pps_pic_parameter_set_id
+ get_ue_golomb_long(gb); // pps_seq_parameter_set_id
+
+ /*
+ * dependent_slice_segments_enabled_flag u(1)
+ * output_flag_present_flag u(1)
+ * num_extra_slice_header_bits u(3)
+ * sign_data_hiding_enabled_flag u(1)
+ * cabac_init_present_flag u(1)
+ */
+ skip_bits(gb, 7);
+
+ get_ue_golomb_long(gb); // num_ref_idx_l0_default_active_minus1
+ get_ue_golomb_long(gb); // num_ref_idx_l1_default_active_minus1
+ get_se_golomb_long(gb); // init_qp_minus26
+
+ /*
+ * constrained_intra_pred_flag u(1)
+ * transform_skip_enabled_flag u(1)
+ */
+ skip_bits(gb, 2);
+
+ if (get_bits1(gb)) // cu_qp_delta_enabled_flag
+ get_ue_golomb_long(gb); // diff_cu_qp_delta_depth
+
+ get_se_golomb_long(gb); // pps_cb_qp_offset
+ get_se_golomb_long(gb); // pps_cr_qp_offset
+
+ /*
+ * weighted_pred_flag u(1)
+ * weighted_bipred_flag u(1)
+ * transquant_bypass_enabled_flag u(1)
+ */
+ skip_bits(gb, 3);
+
+ tiles_enabled_flag = get_bits1(gb);
+ entropy_coding_sync_enabled_flag = get_bits1(gb);
+
+ if (entropy_coding_sync_enabled_flag && tiles_enabled_flag)
+ hvcc->parallelismType = 0; // mixed-type parallel decoding
+ else if (entropy_coding_sync_enabled_flag)
+ hvcc->parallelismType = 3; // wavefront-based parallel decoding
+ else if (tiles_enabled_flag)
+ hvcc->parallelismType = 2; // tile-based parallel decoding
+ else
+ hvcc->parallelismType = 1; // slice-based parallel decoding
+
+ /* nothing useful for hvcC past this point */
+ return 0;
+}
+
+static uint8_t *nal_unit_extract_rbsp(const uint8_t *src, uint32_t src_len,
+ uint32_t *dst_len)
+{
+ uint8_t *dst;
+ uint32_t i, len;
+
+ dst = av_malloc(src_len);
+ if (!dst)
+ return NULL;
+
+ /* NAL unit header (2 bytes) */
+ i = len = 0;
+ while (i < 2 && i < src_len)
+ dst[len++] = src[i++];
+
+ while (i + 2 < src_len)
+ if (!src[i] && !src[i + 1] && src[i + 2] == 3) {
+ dst[len++] = src[i++];
+ dst[len++] = src[i++];
+ i++; // remove emulation_prevention_three_byte
+ } else
+ dst[len++] = src[i++];
+
+ while (i < src_len)
+ dst[len++] = src[i++];
+
+ *dst_len = len;
+ return dst;
+}
+
+
+
+static void nal_unit_parse_header(GetBitContext *gb, uint8_t *nal_type)
+{
+ skip_bits1(gb); // forbidden_zero_bit
+
+ *nal_type = get_bits(gb, 6);
+
+ /*
+ * nuh_layer_id u(6)
+ * nuh_temporal_id_plus1 u(3)
+ */
+ skip_bits(gb, 9);
+}
+
+static int hvcc_array_add_nal_unit(uint8_t *nal_buf, uint32_t nal_size,
+ uint8_t nal_type, int ps_array_completeness,
+ HEVCDecoderConfigurationRecord *hvcc)
+{
+ int ret;
+ uint8_t index;
+ uint16_t numNalus;
+ HVCCNALUnitArray *array;
+
+ for (index = 0; index < hvcc->numOfArrays; index++)
+ if (hvcc->array[index].NAL_unit_type == nal_type)
+ break;
+
+ if (index >= hvcc->numOfArrays) {
+ uint8_t i;
+
+ ret = av_reallocp_array(&hvcc->array, index + 1, sizeof(HVCCNALUnitArray));
+ if (ret < 0)
+ return ret;
+
+ for (i = hvcc->numOfArrays; i <= index; i++)
+ memset(&hvcc->array[i], 0, sizeof(HVCCNALUnitArray));
+ hvcc->numOfArrays = index + 1;
+ }
+
+ array = &hvcc->array[index];
+ numNalus = array->numNalus;
+
+ ret = av_reallocp_array(&array->nalUnit, numNalus + 1, sizeof(uint8_t*));
+ if (ret < 0)
+ return ret;
+
+ ret = av_reallocp_array(&array->nalUnitLength, numNalus + 1, sizeof(uint16_t));
+ if (ret < 0)
+ return ret;
+
+ array->nalUnit [numNalus] = nal_buf;
+ array->nalUnitLength[numNalus] = nal_size;
+ array->NAL_unit_type = nal_type;
+ array->numNalus++;
+
+ /*
+ * When the sample entry name is ‘hvc1’, the default and mandatory value of
+ * array_completeness is 1 for arrays of all types of parameter sets, and 0
+ * for all other arrays. When the sample entry name is ‘hev1’, the default
+ * value of array_completeness is 0 for all arrays.
+ */
+ if (nal_type == NAL_VPS || nal_type == NAL_SPS || nal_type == NAL_PPS)
+ array->array_completeness = ps_array_completeness;
+
+ return 0;
+}
+
+static int hvcc_add_nal_unit(uint8_t *nal_buf, uint32_t nal_size,
+ int ps_array_completeness,
+ HEVCDecoderConfigurationRecord *hvcc)
+{
+ int ret = 0;
+ GetBitContext gbc;
+ uint8_t nal_type;
+ uint8_t *rbsp_buf;
+ uint32_t rbsp_size;
+
+ rbsp_buf = nal_unit_extract_rbsp(nal_buf, nal_size, &rbsp_size);
+ if (!rbsp_buf) {
+ ret = AVERROR(ENOMEM);
+ goto end;
+ }
+
+ ret = init_get_bits8(&gbc, rbsp_buf, rbsp_size);
+ if (ret < 0)
+ goto end;
+
+ nal_unit_parse_header(&gbc, &nal_type);
+
+ /*
+ * Note: only 'declarative' SEI messages are allowed in
+ * hvcC. Perhaps the SEI playload type should be checked
+ * and non-declarative SEI messages discarded?
+ */
+ switch (nal_type) {
+ case NAL_VPS:
+ case NAL_SPS:
+ case NAL_PPS:
+ case NAL_SEI_PREFIX:
+ case NAL_SEI_SUFFIX:
+ ret = hvcc_array_add_nal_unit(nal_buf, nal_size, nal_type,
+ ps_array_completeness, hvcc);
+ if (ret < 0)
+ goto end;
+ else if (nal_type == NAL_VPS)
+ ret = hvcc_parse_vps(&gbc, hvcc);
+ else if (nal_type == NAL_SPS)
+ ret = hvcc_parse_sps(&gbc, hvcc);
+ else if (nal_type == NAL_PPS)
+ ret = hvcc_parse_pps(&gbc, hvcc);
+ if (ret < 0)
+ goto end;
+ break;
+ default:
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
+
+end:
+ av_free(rbsp_buf);
+ return ret;
+}
+
+static void hvcc_init(HEVCDecoderConfigurationRecord *hvcc)
+{
+ memset(hvcc, 0, sizeof(HEVCDecoderConfigurationRecord));
+ hvcc->configurationVersion = 1;
+ hvcc->lengthSizeMinusOne = 3; // 4 bytes
+
+ /*
+ * The following fields have all their valid bits set by default,
+ * the ProfileTierLevel parsing code will unset them when needed.
+ */
+ hvcc->general_profile_compatibility_flags = 0xffffffff;
+ hvcc->general_constraint_indicator_flags = 0xffffffffffff;
+
+ /*
+ * Initialize this field with an invalid value which can be used to detect
+ * whether we didn't see any VUI (in wich case it should be reset to zero).
+ */
+ hvcc->min_spatial_segmentation_idc = MAX_SPATIAL_SEGMENTATION + 1;
+}
+
+static void hvcc_close(HEVCDecoderConfigurationRecord *hvcc)
+{
+ uint8_t i;
+
+ for (i = 0; i < hvcc->numOfArrays; i++) {
+ hvcc->array[i].numNalus = 0;
+ av_freep(&hvcc->array[i].nalUnit);
+ av_freep(&hvcc->array[i].nalUnitLength);
+ }
+
+ hvcc->numOfArrays = 0;
+ av_freep(&hvcc->array);
+}
+
+static int hvcc_write(AVIOContext *pb, HEVCDecoderConfigurationRecord *hvcc)
+{
+ uint8_t i;
+ uint16_t j, vps_count = 0, sps_count = 0, pps_count = 0;
+
+ /*
+ * We only support writing HEVCDecoderConfigurationRecord version 1.
+ */
+ hvcc->configurationVersion = 1;
+
+ /*
+ * If min_spatial_segmentation_idc is invalid, reset to 0 (unspecified).
+ */
+ if (hvcc->min_spatial_segmentation_idc > MAX_SPATIAL_SEGMENTATION)
+ hvcc->min_spatial_segmentation_idc = 0;
+
+ /*
+ * parallelismType indicates the type of parallelism that is used to meet
+ * the restrictions imposed by min_spatial_segmentation_idc when the value
+ * of min_spatial_segmentation_idc is greater than 0.
+ */
+ if (!hvcc->min_spatial_segmentation_idc)
+ hvcc->parallelismType = 0;
+
+ /*
+ * It's unclear how to properly compute these fields, so
+ * let's always set them to values meaning 'unspecified'.
+ */
+ hvcc->avgFrameRate = 0;
+ hvcc->constantFrameRate = 0;
+
+ av_dlog(NULL, "configurationVersion: %"PRIu8"\n",
+ hvcc->configurationVersion);
+ av_dlog(NULL, "general_profile_space: %"PRIu8"\n",
+ hvcc->general_profile_space);
+ av_dlog(NULL, "general_tier_flag: %"PRIu8"\n",
+ hvcc->general_tier_flag);
+ av_dlog(NULL, "general_profile_idc: %"PRIu8"\n",
+ hvcc->general_profile_idc);
+ av_dlog(NULL, "general_profile_compatibility_flags: 0x%08"PRIx32"\n",
+ hvcc->general_profile_compatibility_flags);
+ av_dlog(NULL, "general_constraint_indicator_flags: 0x%012"PRIx64"\n",
+ hvcc->general_constraint_indicator_flags);
+ av_dlog(NULL, "general_level_idc: %"PRIu8"\n",
+ hvcc->general_level_idc);
+ av_dlog(NULL, "min_spatial_segmentation_idc: %"PRIu16"\n",
+ hvcc->min_spatial_segmentation_idc);
+ av_dlog(NULL, "parallelismType: %"PRIu8"\n",
+ hvcc->parallelismType);
+ av_dlog(NULL, "chromaFormat: %"PRIu8"\n",
+ hvcc->chromaFormat);
+ av_dlog(NULL, "bitDepthLumaMinus8: %"PRIu8"\n",
+ hvcc->bitDepthLumaMinus8);
+ av_dlog(NULL, "bitDepthChromaMinus8: %"PRIu8"\n",
+ hvcc->bitDepthChromaMinus8);
+ av_dlog(NULL, "avgFrameRate: %"PRIu16"\n",
+ hvcc->avgFrameRate);
+ av_dlog(NULL, "constantFrameRate: %"PRIu8"\n",
+ hvcc->constantFrameRate);
+ av_dlog(NULL, "numTemporalLayers: %"PRIu8"\n",
+ hvcc->numTemporalLayers);
+ av_dlog(NULL, "temporalIdNested: %"PRIu8"\n",
+ hvcc->temporalIdNested);
+ av_dlog(NULL, "lengthSizeMinusOne: %"PRIu8"\n",
+ hvcc->lengthSizeMinusOne);
+ av_dlog(NULL, "numOfArrays: %"PRIu8"\n",
+ hvcc->numOfArrays);
+ for (i = 0; i < hvcc->numOfArrays; i++) {
+ av_dlog(NULL, "array_completeness[%"PRIu8"]: %"PRIu8"\n",
+ i, hvcc->array[i].array_completeness);
+ av_dlog(NULL, "NAL_unit_type[%"PRIu8"]: %"PRIu8"\n",
+ i, hvcc->array[i].NAL_unit_type);
+ av_dlog(NULL, "numNalus[%"PRIu8"]: %"PRIu16"\n",
+ i, hvcc->array[i].numNalus);
+ for (j = 0; j < hvcc->array[i].numNalus; j++)
+ av_dlog(NULL,
+ "nalUnitLength[%"PRIu8"][%"PRIu16"]: %"PRIu16"\n",
+ i, j, hvcc->array[i].nalUnitLength[j]);
+ }
+
+ /*
+ * We need at least one of each: VPS, SPS and PPS.
+ */
+ for (i = 0; i < hvcc->numOfArrays; i++)
+ switch (hvcc->array[i].NAL_unit_type) {
+ case NAL_VPS:
+ vps_count += hvcc->array[i].numNalus;
+ break;
+ case NAL_SPS:
+ sps_count += hvcc->array[i].numNalus;
+ break;
+ case NAL_PPS:
+ pps_count += hvcc->array[i].numNalus;
+ break;
+ default:
+ break;
+ }
+ if (!vps_count || vps_count > MAX_VPS_COUNT ||
+ !sps_count || sps_count > MAX_SPS_COUNT ||
+ !pps_count || pps_count > MAX_PPS_COUNT)
+ return AVERROR_INVALIDDATA;
+
+ /* unsigned int(8) configurationVersion = 1; */
+ avio_w8(pb, hvcc->configurationVersion);
+
+ /*
+ * unsigned int(2) general_profile_space;
+ * unsigned int(1) general_tier_flag;
+ * unsigned int(5) general_profile_idc;
+ */
+ avio_w8(pb, hvcc->general_profile_space << 6 |
+ hvcc->general_tier_flag << 5 |
+ hvcc->general_profile_idc);
+
+ /* unsigned int(32) general_profile_compatibility_flags; */
+ avio_wb32(pb, hvcc->general_profile_compatibility_flags);
+
+ /* unsigned int(48) general_constraint_indicator_flags; */
+ avio_wb32(pb, hvcc->general_constraint_indicator_flags >> 16);
+ avio_wb16(pb, hvcc->general_constraint_indicator_flags);
+
+ /* unsigned int(8) general_level_idc; */
+ avio_w8(pb, hvcc->general_level_idc);
+
+ /*
+ * bit(4) reserved = ‘1111’b;
+ * unsigned int(12) min_spatial_segmentation_idc;
+ */
+ avio_wb16(pb, hvcc->min_spatial_segmentation_idc | 0xf000);
+
+ /*
+ * bit(6) reserved = ‘111111’b;
+ * unsigned int(2) parallelismType;
+ */
+ avio_w8(pb, hvcc->parallelismType | 0xfc);
+
+ /*
+ * bit(6) reserved = ‘111111’b;
+ * unsigned int(2) chromaFormat;
+ */
+ avio_w8(pb, hvcc->chromaFormat | 0xfc);
+
+ /*
+ * bit(5) reserved = ‘11111’b;
+ * unsigned int(3) bitDepthLumaMinus8;
+ */
+ avio_w8(pb, hvcc->bitDepthLumaMinus8 | 0xf8);
+
+ /*
+ * bit(5) reserved = ‘11111’b;
+ * unsigned int(3) bitDepthChromaMinus8;
+ */
+ avio_w8(pb, hvcc->bitDepthChromaMinus8 | 0xf8);
+
+ /* bit(16) avgFrameRate; */
+ avio_wb16(pb, hvcc->avgFrameRate);
+
+ /*
+ * bit(2) constantFrameRate;
+ * bit(3) numTemporalLayers;
+ * bit(1) temporalIdNested;
+ * unsigned int(2) lengthSizeMinusOne;
+ */
+ avio_w8(pb, hvcc->constantFrameRate << 6 |
+ hvcc->numTemporalLayers << 3 |
+ hvcc->temporalIdNested << 2 |
+ hvcc->lengthSizeMinusOne);
+
+ /* unsigned int(8) numOfArrays; */
+ avio_w8(pb, hvcc->numOfArrays);
+
+ for (i = 0; i < hvcc->numOfArrays; i++) {
+ /*
+ * bit(1) array_completeness;
+ * unsigned int(1) reserved = 0;
+ * unsigned int(6) NAL_unit_type;
+ */
+ avio_w8(pb, hvcc->array[i].array_completeness << 7 |
+ hvcc->array[i].NAL_unit_type & 0x3f);
+
+ /* unsigned int(16) numNalus; */
+ avio_wb16(pb, hvcc->array[i].numNalus);
+
+ for (j = 0; j < hvcc->array[i].numNalus; j++) {
+ /* unsigned int(16) nalUnitLength; */
+ avio_wb16(pb, hvcc->array[i].nalUnitLength[j]);
+
+ /* bit(8*nalUnitLength) nalUnit; */
+ avio_write(pb, hvcc->array[i].nalUnit[j],
+ hvcc->array[i].nalUnitLength[j]);
+ }
+ }
+
+ return 0;
+}
+
+int ff_hevc_annexb2mp4(AVIOContext *pb, const uint8_t *buf_in,
+ int size, int filter_ps, int *ps_count)
+{
+ int num_ps = 0, ret = 0;
+ uint8_t *buf, *end, *start = NULL;
+
+ if (!filter_ps) {
+ ret = ff_avc_parse_nal_units(pb, buf_in, size);
+ goto end;
+ }
+
+ ret = ff_avc_parse_nal_units_buf(buf_in, &start, &size);
+ if (ret < 0)
+ goto end;
+
+ ret = 0;
+ buf = start;
+ end = start + size;
+
+ while (end - buf > 4) {
+ uint32_t len = FFMIN(AV_RB32(buf), end - buf - 4);
+ uint8_t type = (buf[4] >> 1) & 0x3f;
+
+ buf += 4;
+
+ switch (type) {
+ case NAL_VPS:
+ case NAL_SPS:
+ case NAL_PPS:
+ num_ps++;
+ break;
+ default:
+ ret += 4 + len;
+ avio_wb32(pb, len);
+ avio_write(pb, buf, len);
+ break;
+ }
+
+ buf += len;
+ }
+
+end:
+ av_free(start);
+ if (ps_count)
+ *ps_count = num_ps;
+ return ret;
+}
+
+int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out,
+ int *size, int filter_ps, int *ps_count)
+{
+ AVIOContext *pb;
+ int ret;
+
+ ret = avio_open_dyn_buf(&pb);
+ if (ret < 0)
+ return ret;
+
+ ret = ff_hevc_annexb2mp4(pb, buf_in, *size, filter_ps, ps_count);
+ *size = avio_close_dyn_buf(pb, buf_out);
+
+ return ret;
+}
+
+int ff_isom_write_hvcc(AVIOContext *pb, const uint8_t *data,
+ int size, int ps_array_completeness)
+{
+ int ret = 0;
+ uint8_t *buf, *end, *start = NULL;
+ HEVCDecoderConfigurationRecord hvcc;
+
+ hvcc_init(&hvcc);
+
+ if (size < 6) {
+ /* We can't write a valid hvcC from the provided data */
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ } else if (*data == 1) {
+ /* Data is already hvcC-formatted */
+ avio_write(pb, data, size);
+ goto end;
+ } else if (!(AV_RB24(data) == 1 || AV_RB32(data) == 1)) {
+ /* Not a valid Annex B start code prefix */
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
+
+ ret = ff_avc_parse_nal_units_buf(data, &start, &size);
+ if (ret < 0)
+ goto end;
+
+ buf = start;
+ end = start + size;
+
+ while (end - buf > 4) {
+ uint32_t len = FFMIN(AV_RB32(buf), end - buf - 4);
+ uint8_t type = (buf[4] >> 1) & 0x3f;
+
+ buf += 4;
+
+ switch (type) {
+ case NAL_VPS:
+ case NAL_SPS:
+ case NAL_PPS:
+ case NAL_SEI_PREFIX:
+ case NAL_SEI_SUFFIX:
+ ret = hvcc_add_nal_unit(buf, len, ps_array_completeness, &hvcc);
+ if (ret < 0)
+ goto end;
+ break;
+ default:
+ break;
+ }
+
+ buf += len;
+ }
+
+ ret = hvcc_write(pb, &hvcc);
+
+end:
+ hvcc_close(&hvcc);
+ av_free(start);
+ return ret;
+}
diff --git a/chromium/third_party/ffmpeg/libavformat/hevc.h b/chromium/third_party/ffmpeg/libavformat/hevc.h
new file mode 100644
index 00000000000..796eaf40b16
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/hevc.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2014 Tim Walker <tdskywalker@gmail.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
+ * internal header for HEVC (de)muxer utilities
+ */
+
+#ifndef AVFORMAT_HEVC_H
+#define AVFORMAT_HEVC_H
+
+#include <stdint.h>
+#include "avio.h"
+
+/**
+ * Writes Annex B formatted HEVC NAL units to the provided AVIOContext.
+ *
+ * The NAL units are converted to an MP4-compatible format (start code prefixes
+ * are replaced by 4-byte size fields, as per ISO/IEC 14496-15).
+ *
+ * If filter_ps is non-zero, any HEVC parameter sets found in the input will be
+ * discarded, and *ps_count will be set to the number of discarded PS NAL units.
+ *
+ * @param pb address of the AVIOContext where the data shall be written
+ * @param buf_in address of the buffer holding the input data
+ * @param size size (in bytes) of the input buffer
+ * @param filter_ps whether to write parameter set NAL units to the output (0)
+ * or to discard them (non-zero)
+ * @param ps_count address of the variable where the number of discarded
+ * parameter set NAL units shall be written, may be NULL
+ * @return the amount (in bytes) of data written in case of success, a negative
+ * value corresponding to an AVERROR code in case of failure
+ */
+int ff_hevc_annexb2mp4(AVIOContext *pb, const uint8_t *buf_in,
+ int size, int filter_ps, int *ps_count);
+
+/**
+ * Writes Annex B formatted HEVC NAL units to a data buffer.
+ *
+ * The NAL units are converted to an MP4-compatible format (start code prefixes
+ * are replaced by 4-byte size fields, as per ISO/IEC 14496-15).
+ *
+ * If filter_ps is non-zero, any HEVC parameter sets found in the input will be
+ * discarded, and *ps_count will be set to the number of discarded PS NAL units.
+ *
+ * On output, *size holds the size (in bytes) of the output data buffer.
+ *
+ * @param buf_in address of the buffer holding the input data
+ * @param size address of the variable holding the size (in bytes) of the input
+ * buffer (on input) and of the output buffer (on output)
+ * @param buf_out address of the variable holding the address of the output
+ * buffer
+ * @param filter_ps whether to write parameter set NAL units to the output (0)
+ * or to discard them (non-zero)
+ * @param ps_count address of the variable where the number of discarded
+ * parameter set NAL units shall be written, may be NULL
+ * @return the amount (in bytes) of data written in case of success, a negative
+ * value corresponding to an AVERROR code in case of failure
+ */
+int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out,
+ int *size, int filter_ps, int *ps_count);
+
+/**
+ * Writes HEVC extradata (parameter sets, declarative SEI NAL units) to the
+ * provided AVIOContext.
+ *
+ * If the extradata is Annex B format, it gets converted to hvcC format before
+ * writing.
+ *
+ * @param pb address of the AVIOContext where the hvcC shall be written
+ * @param data address of the buffer holding the data needed to write the hvcC
+ * @param size size (in bytes) of the data buffer
+ * @param ps_array_completeness whether all parameter sets are in the hvcC (1)
+ * or there may be additional parameter sets in the bitstream (0)
+ * @return >=0 in case of success, a negative value corresponding to an AVERROR
+ * code in case of failure
+ */
+int ff_isom_write_hvcc(AVIOContext *pb, const uint8_t *data,
+ int size, int ps_array_completeness);
+
+#endif /* AVFORMAT_HEVC_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/hls.c b/chromium/third_party/ffmpeg/libavformat/hls.c
index 471a62dc9c4..3897723b7de 100644
--- a/chromium/third_party/ffmpeg/libavformat/hls.c
+++ b/chromium/third_party/ffmpeg/libavformat/hls.c
@@ -1,6 +1,7 @@
/*
* Apple HTTP Live Streaming demuxer
* Copyright (c) 2010 Martin Storsjo
+ * Copyright (c) 2013 Anssi Hannula
*
* This file is part of FFmpeg.
*
@@ -26,6 +27,7 @@
*/
#include "libavutil/avstring.h"
+#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
@@ -35,9 +37,16 @@
#include "internal.h"
#include "avio_internal.h"
#include "url.h"
+#include "id3v2.h"
#define INITIAL_BUFFER_SIZE 32768
+#define MAX_FIELD_LEN 64
+#define MAX_CHARACTERISTICS_LEN 512
+
+#define MPEG_TIME_BASE 90000
+#define MPEG_TIME_BASE_Q (AVRational){1, MPEG_TIME_BASE}
+
/*
* An apple http stream consists of a playlist with media segment files,
* played sequentially. There may be several playlists with the same
@@ -57,19 +66,28 @@ enum KeyType {
struct segment {
int64_t duration;
- char url[MAX_URL_SIZE];
- char key[MAX_URL_SIZE];
+ int64_t url_offset;
+ int64_t size;
+ char *url;
+ char *key;
enum KeyType key_type;
uint8_t iv[16];
};
+struct rendition;
+
+enum PlaylistType {
+ PLS_TYPE_UNSPECIFIED,
+ PLS_TYPE_EVENT,
+ PLS_TYPE_VOD
+};
+
/*
- * Each variant has its own demuxer. If it currently is active,
+ * Each playlist has its own demuxer. If it currently is active,
* it has an open AVIOContext too, and potentially an AVPacket
* containing the next packet from this stream.
*/
-struct variant {
- int bandwidth;
+struct playlist {
char url[MAX_URL_SIZE];
AVIOContext pb;
uint8_t* read_buffer;
@@ -81,27 +99,82 @@ struct variant {
int stream_offset;
int finished;
+ enum PlaylistType type;
int64_t target_duration;
int start_seq_no;
int n_segments;
struct segment **segments;
int needed, cur_needed;
int cur_seq_no;
+ int64_t cur_seg_offset;
int64_t last_load_time;
char key_url[MAX_URL_SIZE];
uint8_t key[16];
+
+ /* ID3 timestamp handling (elementary audio streams have ID3 timestamps
+ * (and possibly other ID3 tags) in the beginning of each segment) */
+ int is_id3_timestamped; /* -1: not yet known */
+ int64_t id3_mpegts_timestamp; /* in mpegts tb */
+ int64_t id3_offset; /* in stream original tb */
+ uint8_t* id3_buf; /* temp buffer for id3 parsing */
+ unsigned int id3_buf_size;
+ AVDictionary *id3_initial; /* data from first id3 tag */
+ int id3_found; /* ID3 tag found at some point */
+ int id3_changed; /* ID3 tag data has changed at some point */
+ ID3v2ExtraMeta *id3_deferred_extra; /* stored here until subdemuxer is opened */
+
+ int64_t seek_timestamp;
+ int seek_flags;
+ int seek_stream_index; /* into subdemuxer stream array */
+
+ /* Renditions associated with this playlist, if any.
+ * Alternative rendition playlists have a single rendition associated
+ * with them, and variant main Media Playlists may have
+ * multiple (playlist-less) renditions associated with them. */
+ int n_renditions;
+ struct rendition **renditions;
+};
+
+/*
+ * Renditions are e.g. alternative subtitle or audio streams.
+ * The rendition may either be an external playlist or it may be
+ * contained in the main Media Playlist of the variant (in which case
+ * playlist is NULL).
+ */
+struct rendition {
+ enum AVMediaType type;
+ struct playlist *playlist;
+ char group_id[MAX_FIELD_LEN];
+ char language[MAX_FIELD_LEN];
+ char name[MAX_FIELD_LEN];
+ int disposition;
+};
+
+struct variant {
+ int bandwidth;
+
+ /* every variant contains at least the main Media Playlist in index 0 */
+ int n_playlists;
+ struct playlist **playlists;
+
+ char audio_group[MAX_FIELD_LEN];
+ char video_group[MAX_FIELD_LEN];
+ char subtitles_group[MAX_FIELD_LEN];
};
typedef struct HLSContext {
int n_variants;
struct variant **variants;
+ int n_playlists;
+ struct playlist **playlists;
+ int n_renditions;
+ struct rendition **renditions;
+
int cur_seq_no;
- int end_of_segment;
int first_packet;
int64_t first_timestamp;
- int64_t seek_timestamp;
- int seek_flags;
+ int64_t cur_timestamp;
AVIOInterruptCB *interrupt_callback;
char *user_agent; ///< holds HTTP user agent set as an AVOption to the HTTP protocol context
char *cookies; ///< holds HTTP cookie values set in either the initial response or as an AVOption to the HTTP protocol context
@@ -116,13 +189,42 @@ static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
return len;
}
-static void free_segment_list(struct variant *var)
+static void free_segment_list(struct playlist *pls)
+{
+ int i;
+ for (i = 0; i < pls->n_segments; i++) {
+ av_free(pls->segments[i]->key);
+ av_free(pls->segments[i]->url);
+ av_free(pls->segments[i]);
+ }
+ av_freep(&pls->segments);
+ pls->n_segments = 0;
+}
+
+static void free_playlist_list(HLSContext *c)
{
int i;
- for (i = 0; i < var->n_segments; i++)
- av_free(var->segments[i]);
- av_freep(&var->segments);
- var->n_segments = 0;
+ for (i = 0; i < c->n_playlists; i++) {
+ struct playlist *pls = c->playlists[i];
+ free_segment_list(pls);
+ av_freep(&pls->renditions);
+ av_freep(&pls->id3_buf);
+ av_dict_free(&pls->id3_initial);
+ ff_id3v2_free_extra_meta(&pls->id3_deferred_extra);
+ av_free_packet(&pls->pkt);
+ av_free(pls->pb.buffer);
+ if (pls->input)
+ ffurl_close(pls->input);
+ if (pls->ctx) {
+ pls->ctx->pb = NULL;
+ avformat_close_input(&pls->ctx);
+ }
+ av_free(pls);
+ }
+ av_freep(&c->playlists);
+ av_freep(&c->cookies);
+ av_freep(&c->user_agent);
+ c->n_playlists = 0;
}
static void free_variant_list(HLSContext *c)
@@ -130,23 +232,22 @@ static void free_variant_list(HLSContext *c)
int i;
for (i = 0; i < c->n_variants; i++) {
struct variant *var = c->variants[i];
- free_segment_list(var);
- av_free_packet(&var->pkt);
- av_free(var->pb.buffer);
- if (var->input)
- ffurl_close(var->input);
- if (var->ctx) {
- var->ctx->pb = NULL;
- avformat_close_input(&var->ctx);
- }
+ av_freep(&var->playlists);
av_free(var);
}
av_freep(&c->variants);
- av_freep(&c->cookies);
- av_freep(&c->user_agent);
c->n_variants = 0;
}
+static void free_rendition_list(HLSContext *c)
+{
+ int i;
+ for (i = 0; i < c->n_renditions; i++)
+ av_free(c->renditions[i]);
+ av_freep(&c->renditions);
+ c->n_renditions = 0;
+}
+
/*
* Used to reset a statically allocated AVPacket to a clean slate,
* containing no data.
@@ -157,29 +258,72 @@ static void reset_packet(AVPacket *pkt)
pkt->data = NULL;
}
-static struct variant *new_variant(HLSContext *c, int bandwidth,
- const char *url, const char *base)
+static struct playlist *new_playlist(HLSContext *c, const char *url,
+ const char *base)
{
- struct variant *var = av_mallocz(sizeof(struct variant));
- if (!var)
+ struct playlist *pls = av_mallocz(sizeof(struct playlist));
+ if (!pls)
return NULL;
- reset_packet(&var->pkt);
- var->bandwidth = bandwidth;
- ff_make_absolute_url(var->url, sizeof(var->url), base, url);
- dynarray_add(&c->variants, &c->n_variants, var);
- return var;
+ reset_packet(&pls->pkt);
+ ff_make_absolute_url(pls->url, sizeof(pls->url), base, url);
+ pls->seek_timestamp = AV_NOPTS_VALUE;
+
+ pls->is_id3_timestamped = -1;
+ pls->id3_mpegts_timestamp = AV_NOPTS_VALUE;
+
+ dynarray_add(&c->playlists, &c->n_playlists, pls);
+ return pls;
}
struct variant_info {
char bandwidth[20];
+ /* variant group ids: */
+ char audio[MAX_FIELD_LEN];
+ char video[MAX_FIELD_LEN];
+ char subtitles[MAX_FIELD_LEN];
};
+static struct variant *new_variant(HLSContext *c, struct variant_info *info,
+ const char *url, const char *base)
+{
+ struct variant *var;
+ struct playlist *pls;
+
+ pls = new_playlist(c, url, base);
+ if (!pls)
+ return NULL;
+
+ var = av_mallocz(sizeof(struct variant));
+ if (!var)
+ return NULL;
+
+ if (info) {
+ var->bandwidth = atoi(info->bandwidth);
+ strcpy(var->audio_group, info->audio);
+ strcpy(var->video_group, info->video);
+ strcpy(var->subtitles_group, info->subtitles);
+ }
+
+ dynarray_add(&c->variants, &c->n_variants, var);
+ dynarray_add(&var->playlists, &var->n_playlists, pls);
+ return var;
+}
+
static void handle_variant_args(struct variant_info *info, const char *key,
int key_len, char **dest, int *dest_len)
{
if (!strncmp(key, "BANDWIDTH=", key_len)) {
*dest = info->bandwidth;
*dest_len = sizeof(info->bandwidth);
+ } else if (!strncmp(key, "AUDIO=", key_len)) {
+ *dest = info->audio;
+ *dest_len = sizeof(info->audio);
+ } else if (!strncmp(key, "VIDEO=", key_len)) {
+ *dest = info->video;
+ *dest_len = sizeof(info->video);
+ } else if (!strncmp(key, "SUBTITLES=", key_len)) {
+ *dest = info->subtitles;
+ *dest_len = sizeof(info->subtitles);
}
}
@@ -204,10 +348,153 @@ static void handle_key_args(struct key_info *info, const char *key,
}
}
+struct rendition_info {
+ char type[16];
+ char uri[MAX_URL_SIZE];
+ char group_id[MAX_FIELD_LEN];
+ char language[MAX_FIELD_LEN];
+ char assoc_language[MAX_FIELD_LEN];
+ char name[MAX_FIELD_LEN];
+ char defaultr[4];
+ char forced[4];
+ char characteristics[MAX_CHARACTERISTICS_LEN];
+};
+
+static struct rendition *new_rendition(HLSContext *c, struct rendition_info *info,
+ const char *url_base)
+{
+ struct rendition *rend;
+ enum AVMediaType type = AVMEDIA_TYPE_UNKNOWN;
+ char *characteristic;
+ char *chr_ptr;
+ char *saveptr;
+
+ if (!strcmp(info->type, "AUDIO"))
+ type = AVMEDIA_TYPE_AUDIO;
+ else if (!strcmp(info->type, "VIDEO"))
+ type = AVMEDIA_TYPE_VIDEO;
+ else if (!strcmp(info->type, "SUBTITLES"))
+ type = AVMEDIA_TYPE_SUBTITLE;
+ else if (!strcmp(info->type, "CLOSED-CAPTIONS"))
+ /* CLOSED-CAPTIONS is ignored since we do not support CEA-608 CC in
+ * AVC SEI RBSP anyway */
+ return NULL;
+
+ if (type == AVMEDIA_TYPE_UNKNOWN)
+ return NULL;
+
+ /* URI is mandatory for subtitles as per spec */
+ if (type == AVMEDIA_TYPE_SUBTITLE && !info->uri[0])
+ return NULL;
+
+ /* TODO: handle subtitles (each segment has to parsed separately) */
+ if (type == AVMEDIA_TYPE_SUBTITLE)
+ return NULL;
+
+ rend = av_mallocz(sizeof(struct rendition));
+ if (!rend)
+ return NULL;
+
+ dynarray_add(&c->renditions, &c->n_renditions, rend);
+
+ rend->type = type;
+ strcpy(rend->group_id, info->group_id);
+ strcpy(rend->language, info->language);
+ strcpy(rend->name, info->name);
+
+ /* add the playlist if this is an external rendition */
+ if (info->uri[0]) {
+ rend->playlist = new_playlist(c, info->uri, url_base);
+ if (rend->playlist)
+ dynarray_add(&rend->playlist->renditions,
+ &rend->playlist->n_renditions, rend);
+ }
+
+ if (info->assoc_language[0]) {
+ int langlen = strlen(rend->language);
+ if (langlen < sizeof(rend->language) - 3) {
+ rend->language[langlen] = ',';
+ strncpy(rend->language + langlen + 1, info->assoc_language,
+ sizeof(rend->language) - langlen - 2);
+ }
+ }
+
+ if (!strcmp(info->defaultr, "YES"))
+ rend->disposition |= AV_DISPOSITION_DEFAULT;
+ if (!strcmp(info->forced, "YES"))
+ rend->disposition |= AV_DISPOSITION_FORCED;
+
+ chr_ptr = info->characteristics;
+ while ((characteristic = av_strtok(chr_ptr, ",", &saveptr))) {
+ if (!strcmp(characteristic, "public.accessibility.describes-music-and-sound"))
+ rend->disposition |= AV_DISPOSITION_HEARING_IMPAIRED;
+ else if (!strcmp(characteristic, "public.accessibility.describes-video"))
+ rend->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
+
+ chr_ptr = NULL;
+ }
+
+ return rend;
+}
+
+static void handle_rendition_args(struct rendition_info *info, const char *key,
+ int key_len, char **dest, int *dest_len)
+{
+ if (!strncmp(key, "TYPE=", key_len)) {
+ *dest = info->type;
+ *dest_len = sizeof(info->type);
+ } else if (!strncmp(key, "URI=", key_len)) {
+ *dest = info->uri;
+ *dest_len = sizeof(info->uri);
+ } else if (!strncmp(key, "GROUP-ID=", key_len)) {
+ *dest = info->group_id;
+ *dest_len = sizeof(info->group_id);
+ } else if (!strncmp(key, "LANGUAGE=", key_len)) {
+ *dest = info->language;
+ *dest_len = sizeof(info->language);
+ } else if (!strncmp(key, "ASSOC-LANGUAGE=", key_len)) {
+ *dest = info->assoc_language;
+ *dest_len = sizeof(info->assoc_language);
+ } else if (!strncmp(key, "NAME=", key_len)) {
+ *dest = info->name;
+ *dest_len = sizeof(info->name);
+ } else if (!strncmp(key, "DEFAULT=", key_len)) {
+ *dest = info->defaultr;
+ *dest_len = sizeof(info->defaultr);
+ } else if (!strncmp(key, "FORCED=", key_len)) {
+ *dest = info->forced;
+ *dest_len = sizeof(info->forced);
+ } else if (!strncmp(key, "CHARACTERISTICS=", key_len)) {
+ *dest = info->characteristics;
+ *dest_len = sizeof(info->characteristics);
+ }
+ /*
+ * ignored:
+ * - AUTOSELECT: client may autoselect based on e.g. system language
+ * - INSTREAM-ID: EIA-608 closed caption number ("CC1".."CC4")
+ */
+}
+
+/* used by parse_playlist to allocate a new variant+playlist when the
+ * playlist is detected to be a Media Playlist (not Master Playlist)
+ * and we have no parent Master Playlist (parsing of which would have
+ * allocated the variant and playlist already) */
+static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url)
+{
+ if (*pls)
+ return 0;
+ if (!new_variant(c, NULL, url, NULL))
+ return AVERROR(ENOMEM);
+ *pls = c->playlists[c->n_playlists - 1];
+ return 0;
+}
+
+/* pls = NULL => Master Playlist or parentless Media Playlist
+ * pls = !NULL => parented Media Playlist, playlist+variant allocated */
static int parse_playlist(HLSContext *c, const char *url,
- struct variant *var, AVIOContext *in)
+ struct playlist *pls, AVIOContext *in)
{
- int ret = 0, is_segment = 0, is_variant = 0, bandwidth = 0;
+ int ret = 0, is_segment = 0, is_variant = 0;
int64_t duration = 0;
enum KeyType key_type = KEY_NONE;
uint8_t iv[16] = "";
@@ -216,7 +503,11 @@ static int parse_playlist(HLSContext *c, const char *url,
char line[MAX_URL_SIZE];
const char *ptr;
int close_in = 0;
+ int64_t seg_offset = 0;
+ int64_t seg_size = -1;
uint8_t *new_url = NULL;
+ struct variant_info variant_info;
+ char tmp_str[MAX_URL_SIZE];
if (!in) {
AVDictionary *opts = NULL;
@@ -245,18 +536,18 @@ static int parse_playlist(HLSContext *c, const char *url,
goto fail;
}
- if (var) {
- free_segment_list(var);
- var->finished = 0;
+ if (pls) {
+ free_segment_list(pls);
+ pls->finished = 0;
+ pls->type = PLS_TYPE_UNSPECIFIED;
}
while (!url_feof(in)) {
read_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
- struct variant_info info = {{0}};
is_variant = 1;
+ memset(&variant_info, 0, sizeof(variant_info));
ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_variant_args,
- &info);
- bandwidth = atoi(info.bandwidth);
+ &variant_info);
} else if (av_strstart(line, "#EXT-X-KEY:", &ptr)) {
struct key_info info = {{0}};
ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_key_args,
@@ -270,49 +561,58 @@ static int parse_playlist(HLSContext *c, const char *url,
has_iv = 1;
}
av_strlcpy(key, info.uri, sizeof(key));
+ } else if (av_strstart(line, "#EXT-X-MEDIA:", &ptr)) {
+ struct rendition_info info = {{0}};
+ ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_rendition_args,
+ &info);
+ new_rendition(c, &info, url);
} else if (av_strstart(line, "#EXT-X-TARGETDURATION:", &ptr)) {
- if (!var) {
- var = new_variant(c, 0, url, NULL);
- if (!var) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- }
- var->target_duration = atoi(ptr) * AV_TIME_BASE;
+ ret = ensure_playlist(c, &pls, url);
+ if (ret < 0)
+ goto fail;
+ pls->target_duration = atoi(ptr) * AV_TIME_BASE;
} else if (av_strstart(line, "#EXT-X-MEDIA-SEQUENCE:", &ptr)) {
- if (!var) {
- var = new_variant(c, 0, url, NULL);
- if (!var) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- }
- var->start_seq_no = atoi(ptr);
+ ret = ensure_playlist(c, &pls, url);
+ if (ret < 0)
+ goto fail;
+ pls->start_seq_no = atoi(ptr);
+ } else if (av_strstart(line, "#EXT-X-PLAYLIST-TYPE:", &ptr)) {
+ ret = ensure_playlist(c, &pls, url);
+ if (ret < 0)
+ goto fail;
+ if (!strcmp(ptr, "EVENT"))
+ pls->type = PLS_TYPE_EVENT;
+ else if (!strcmp(ptr, "VOD"))
+ pls->type = PLS_TYPE_VOD;
} else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) {
- if (var)
- var->finished = 1;
+ if (pls)
+ pls->finished = 1;
} else if (av_strstart(line, "#EXTINF:", &ptr)) {
is_segment = 1;
duration = atof(ptr) * AV_TIME_BASE;
+ } else if (av_strstart(line, "#EXT-X-BYTERANGE:", &ptr)) {
+ seg_size = atoi(ptr);
+ ptr = strchr(ptr, '@');
+ if (ptr)
+ seg_offset = atoi(ptr+1);
} else if (av_strstart(line, "#", NULL)) {
continue;
} else if (line[0]) {
if (is_variant) {
- if (!new_variant(c, bandwidth, line, url)) {
+ if (!new_variant(c, &variant_info, line, url)) {
ret = AVERROR(ENOMEM);
goto fail;
}
is_variant = 0;
- bandwidth = 0;
}
if (is_segment) {
struct segment *seg;
- if (!var) {
- var = new_variant(c, 0, url, NULL);
- if (!var) {
+ if (!pls) {
+ if (!new_variant(c, 0, url, NULL)) {
ret = AVERROR(ENOMEM);
goto fail;
}
+ pls = c->playlists[c->n_playlists - 1];
}
seg = av_malloc(sizeof(struct segment));
if (!seg) {
@@ -324,19 +624,49 @@ static int parse_playlist(HLSContext *c, const char *url,
if (has_iv) {
memcpy(seg->iv, iv, sizeof(iv));
} else {
- int seq = var->start_seq_no + var->n_segments;
+ int seq = pls->start_seq_no + pls->n_segments;
memset(seg->iv, 0, sizeof(seg->iv));
AV_WB32(seg->iv + 12, seq);
}
- ff_make_absolute_url(seg->key, sizeof(seg->key), url, key);
- ff_make_absolute_url(seg->url, sizeof(seg->url), url, line);
- dynarray_add(&var->segments, &var->n_segments, seg);
+
+ if (key_type != KEY_NONE) {
+ ff_make_absolute_url(tmp_str, sizeof(tmp_str), url, key);
+ seg->key = av_strdup(tmp_str);
+ if (!seg->key) {
+ av_free(seg);
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ } else {
+ seg->key = NULL;
+ }
+
+ ff_make_absolute_url(tmp_str, sizeof(tmp_str), url, line);
+ seg->url = av_strdup(tmp_str);
+ if (!seg->url) {
+ av_free(seg->key);
+ av_free(seg);
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ dynarray_add(&pls->segments, &pls->n_segments, seg);
is_segment = 0;
+
+ seg->size = seg_size;
+ if (seg_size >= 0) {
+ seg->url_offset = seg_offset;
+ seg_offset += seg_size;
+ seg_size = -1;
+ } else {
+ seg->url_offset = 0;
+ seg_offset = 0;
+ }
}
}
}
- if (var)
- var->last_load_time = av_gettime();
+ if (pls)
+ pls->last_load_time = av_gettime();
fail:
av_free(new_url);
@@ -345,11 +675,237 @@ fail:
return ret;
}
-static int open_input(HLSContext *c, struct variant *var)
+enum ReadFromURLMode {
+ READ_NORMAL,
+ READ_COMPLETE,
+};
+
+/* read from URLContext, limiting read to current segment */
+static int read_from_url(struct playlist *pls, uint8_t *buf, int buf_size,
+ enum ReadFromURLMode mode)
+{
+ int ret;
+ struct segment *seg = pls->segments[pls->cur_seq_no - pls->start_seq_no];
+
+ /* limit read if the segment was only a part of a file */
+ if (seg->size >= 0)
+ buf_size = FFMIN(buf_size, seg->size - pls->cur_seg_offset);
+
+ if (mode == READ_COMPLETE)
+ ret = ffurl_read_complete(pls->input, buf, buf_size);
+ else
+ ret = ffurl_read(pls->input, buf, buf_size);
+
+ if (ret > 0)
+ pls->cur_seg_offset += ret;
+
+ return ret;
+}
+
+/* Parse the raw ID3 data and pass contents to caller */
+static void parse_id3(AVFormatContext *s, AVIOContext *pb,
+ AVDictionary **metadata, int64_t *dts,
+ ID3v2ExtraMetaAPIC **apic, ID3v2ExtraMeta **extra_meta)
+{
+ static const char id3_priv_owner_ts[] = "com.apple.streaming.transportStreamTimestamp";
+ ID3v2ExtraMeta *meta;
+
+ ff_id3v2_read_dict(pb, metadata, ID3v2_DEFAULT_MAGIC, extra_meta);
+ for (meta = *extra_meta; meta; meta = meta->next) {
+ if (!strcmp(meta->tag, "PRIV")) {
+ ID3v2ExtraMetaPRIV *priv = meta->data;
+ if (priv->datasize == 8 && !strcmp(priv->owner, id3_priv_owner_ts)) {
+ /* 33-bit MPEG timestamp */
+ int64_t ts = AV_RB64(priv->data);
+ av_log(s, AV_LOG_DEBUG, "HLS ID3 audio timestamp %"PRId64"\n", ts);
+ if ((ts & ~((1ULL << 33) - 1)) == 0)
+ *dts = ts;
+ else
+ av_log(s, AV_LOG_ERROR, "Invalid HLS ID3 audio timestamp %"PRId64"\n", ts);
+ }
+ } else if (!strcmp(meta->tag, "APIC") && apic)
+ *apic = meta->data;
+ }
+}
+
+/* Check if the ID3 metadata contents have changed */
+static int id3_has_changed_values(struct playlist *pls, AVDictionary *metadata,
+ ID3v2ExtraMetaAPIC *apic)
+{
+ AVDictionaryEntry *entry = NULL;
+ AVDictionaryEntry *oldentry;
+ /* check that no keys have changed values */
+ while ((entry = av_dict_get(metadata, "", entry, AV_DICT_IGNORE_SUFFIX))) {
+ oldentry = av_dict_get(pls->id3_initial, entry->key, NULL, AV_DICT_MATCH_CASE);
+ if (!oldentry || strcmp(oldentry->value, entry->value) != 0)
+ return 1;
+ }
+
+ /* check if apic appeared */
+ if (apic && (pls->ctx->nb_streams != 2 || !pls->ctx->streams[1]->attached_pic.data))
+ return 1;
+
+ if (apic) {
+ int size = pls->ctx->streams[1]->attached_pic.size;
+ if (size != apic->buf->size - FF_INPUT_BUFFER_PADDING_SIZE)
+ return 1;
+
+ if (memcmp(apic->buf->data, pls->ctx->streams[1]->attached_pic.data, size) != 0)
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Parse ID3 data and handle the found data */
+static void handle_id3(AVIOContext *pb, struct playlist *pls)
+{
+ AVDictionary *metadata = NULL;
+ ID3v2ExtraMetaAPIC *apic = NULL;
+ ID3v2ExtraMeta *extra_meta = NULL;
+ int64_t timestamp = AV_NOPTS_VALUE;
+
+ parse_id3(pls->ctx, pb, &metadata, &timestamp, &apic, &extra_meta);
+
+ if (timestamp != AV_NOPTS_VALUE) {
+ pls->id3_mpegts_timestamp = timestamp;
+ pls->id3_offset = 0;
+ }
+
+ if (!pls->id3_found) {
+ /* initial ID3 tags */
+ av_assert0(!pls->id3_deferred_extra);
+ pls->id3_found = 1;
+
+ /* get picture attachment and set text metadata */
+ if (pls->ctx->nb_streams)
+ ff_id3v2_parse_apic(pls->ctx, &extra_meta);
+ else
+ /* demuxer not yet opened, defer picture attachment */
+ pls->id3_deferred_extra = extra_meta;
+
+ av_dict_copy(&pls->ctx->metadata, metadata, 0);
+ pls->id3_initial = metadata;
+
+ } else {
+ if (!pls->id3_changed && id3_has_changed_values(pls, metadata, apic)) {
+ avpriv_report_missing_feature(pls->ctx, "Changing ID3 metadata in HLS audio elementary stream");
+ pls->id3_changed = 1;
+ }
+ av_dict_free(&metadata);
+ }
+
+ if (!pls->id3_deferred_extra)
+ ff_id3v2_free_extra_meta(&extra_meta);
+}
+
+/* Intercept and handle ID3 tags between URLContext and AVIOContext */
+static void intercept_id3(struct playlist *pls, uint8_t *buf,
+ int buf_size, int *len)
+{
+ /* intercept id3 tags, we do not want to pass them to the raw
+ * demuxer on all segment switches */
+ int bytes;
+ int id3_buf_pos = 0;
+ int fill_buf = 0;
+
+ /* gather all the id3 tags */
+ while (1) {
+ /* see if we can retrieve enough data for ID3 header */
+ if (*len < ID3v2_HEADER_SIZE && buf_size >= ID3v2_HEADER_SIZE) {
+ bytes = read_from_url(pls, buf + *len, ID3v2_HEADER_SIZE - *len, READ_COMPLETE);
+ if (bytes > 0) {
+
+ if (bytes == ID3v2_HEADER_SIZE - *len)
+ /* no EOF yet, so fill the caller buffer again after
+ * we have stripped the ID3 tags */
+ fill_buf = 1;
+
+ *len += bytes;
+
+ } else if (*len <= 0) {
+ /* error/EOF */
+ *len = bytes;
+ fill_buf = 0;
+ }
+ }
+
+ if (*len < ID3v2_HEADER_SIZE)
+ break;
+
+ if (ff_id3v2_match(buf, ID3v2_DEFAULT_MAGIC)) {
+ struct segment *seg = pls->segments[pls->cur_seq_no - pls->start_seq_no];
+ int64_t maxsize = seg->size >= 0 ? seg->size : 1024*1024;
+ int taglen = ff_id3v2_tag_len(buf);
+ int tag_got_bytes = FFMIN(taglen, *len);
+ int remaining = taglen - tag_got_bytes;
+
+ if (taglen > maxsize) {
+ av_log(pls->ctx, AV_LOG_ERROR, "Too large HLS ID3 tag (%d > %"PRId64" bytes)\n",
+ taglen, maxsize);
+ break;
+ }
+
+ /*
+ * Copy the id3 tag to our temporary id3 buffer.
+ * We could read a small id3 tag directly without memcpy, but
+ * we would still need to copy the large tags, and handling
+ * both of those cases together with the possibility for multiple
+ * tags would make the handling a bit complex.
+ */
+ pls->id3_buf = av_fast_realloc(pls->id3_buf, &pls->id3_buf_size, id3_buf_pos + taglen);
+ if (!pls->id3_buf)
+ break;
+ memcpy(pls->id3_buf + id3_buf_pos, buf, tag_got_bytes);
+ id3_buf_pos += tag_got_bytes;
+
+ /* strip the intercepted bytes */
+ *len -= tag_got_bytes;
+ memmove(buf, buf + tag_got_bytes, *len);
+ av_log(pls->ctx, AV_LOG_DEBUG, "Stripped %d HLS ID3 bytes\n", tag_got_bytes);
+
+ if (remaining > 0) {
+ /* read the rest of the tag in */
+ if (read_from_url(pls, pls->id3_buf + id3_buf_pos, remaining, READ_COMPLETE) != remaining)
+ break;
+ id3_buf_pos += remaining;
+ av_log(pls->ctx, AV_LOG_DEBUG, "Stripped additional %d HLS ID3 bytes\n", remaining);
+ }
+
+ } else {
+ /* no more ID3 tags */
+ break;
+ }
+ }
+
+ /* re-fill buffer for the caller unless EOF */
+ if (*len >= 0 && (fill_buf || *len == 0)) {
+ bytes = read_from_url(pls, buf + *len, buf_size - *len, READ_NORMAL);
+
+ /* ignore error if we already had some data */
+ if (bytes >= 0)
+ *len += bytes;
+ else if (*len == 0)
+ *len = bytes;
+ }
+
+ if (pls->id3_buf) {
+ /* Now parse all the ID3 tags */
+ AVIOContext id3ioctx;
+ ffio_init_context(&id3ioctx, pls->id3_buf, id3_buf_pos, 0, NULL, NULL, NULL, NULL);
+ handle_id3(&id3ioctx, pls);
+ }
+
+ if (pls->is_id3_timestamped == -1)
+ pls->is_id3_timestamped = (pls->id3_mpegts_timestamp != AV_NOPTS_VALUE);
+}
+
+static int open_input(HLSContext *c, struct playlist *pls)
{
AVDictionary *opts = NULL;
+ AVDictionary *opts2 = NULL;
int ret;
- struct segment *seg = var->segments[var->cur_seq_no - var->start_seq_no];
+ struct segment *seg = pls->segments[pls->cur_seq_no - pls->start_seq_no];
// broker prior HTTP options that should be consistent across requests
av_dict_set(&opts, "user-agent", c->user_agent, 0);
@@ -357,18 +913,37 @@ static int open_input(HLSContext *c, struct variant *var)
av_dict_set(&opts, "headers", c->headers, 0);
av_dict_set(&opts, "seekable", "0", 0);
+ // Same opts for key request (ffurl_open mutilates the opts so it cannot be used twice)
+ av_dict_copy(&opts2, opts, 0);
+
+ if (seg->size >= 0) {
+ /* try to restrict the HTTP request to the part we want
+ * (if this is in fact a HTTP request) */
+ char offset[24] = { 0 };
+ char end_offset[24] = { 0 };
+ snprintf(offset, sizeof(offset) - 1, "%"PRId64,
+ seg->url_offset);
+ snprintf(end_offset, sizeof(end_offset) - 1, "%"PRId64,
+ seg->url_offset + seg->size);
+ av_dict_set(&opts, "offset", offset, 0);
+ av_dict_set(&opts, "end_offset", end_offset, 0);
+ }
+
+ av_log(pls->parent, AV_LOG_VERBOSE, "HLS request for url '%s', offset %"PRId64", playlist %d\n",
+ seg->url, seg->url_offset, pls->index);
+
if (seg->key_type == KEY_NONE) {
- ret = ffurl_open(&var->input, seg->url, AVIO_FLAG_READ,
- &var->parent->interrupt_callback, &opts);
- goto cleanup;
+ ret = ffurl_open(&pls->input, seg->url, AVIO_FLAG_READ,
+ &pls->parent->interrupt_callback, &opts);
+
} else if (seg->key_type == KEY_AES_128) {
char iv[33], key[33], url[MAX_URL_SIZE];
- if (strcmp(seg->key, var->key_url)) {
+ if (strcmp(seg->key, pls->key_url)) {
URLContext *uc;
if (ffurl_open(&uc, seg->key, AVIO_FLAG_READ,
- &var->parent->interrupt_callback, &opts) == 0) {
- if (ffurl_read_complete(uc, var->key, sizeof(var->key))
- != sizeof(var->key)) {
+ &pls->parent->interrupt_callback, &opts2) == 0) {
+ if (ffurl_read_complete(uc, pls->key, sizeof(pls->key))
+ != sizeof(pls->key)) {
av_log(NULL, AV_LOG_ERROR, "Unable to read key file %s\n",
seg->key);
}
@@ -377,26 +952,24 @@ static int open_input(HLSContext *c, struct variant *var)
av_log(NULL, AV_LOG_ERROR, "Unable to open key file %s\n",
seg->key);
}
- av_strlcpy(var->key_url, seg->key, sizeof(var->key_url));
+ av_strlcpy(pls->key_url, seg->key, sizeof(pls->key_url));
}
ff_data_to_hex(iv, seg->iv, sizeof(seg->iv), 0);
- ff_data_to_hex(key, var->key, sizeof(var->key), 0);
+ ff_data_to_hex(key, pls->key, sizeof(pls->key), 0);
iv[32] = key[32] = '\0';
if (strstr(seg->url, "://"))
snprintf(url, sizeof(url), "crypto+%s", seg->url);
else
snprintf(url, sizeof(url), "crypto:%s", seg->url);
- if ((ret = ffurl_alloc(&var->input, url, AVIO_FLAG_READ,
- &var->parent->interrupt_callback)) < 0)
+ if ((ret = ffurl_alloc(&pls->input, url, AVIO_FLAG_READ,
+ &pls->parent->interrupt_callback)) < 0)
goto cleanup;
- av_opt_set(var->input->priv_data, "key", key, 0);
- av_opt_set(var->input->priv_data, "iv", iv, 0);
- /* Need to repopulate options */
- av_dict_free(&opts);
- av_dict_set(&opts, "seekable", "0", 0);
- if ((ret = ffurl_connect(var->input, &opts)) < 0) {
- ffurl_close(var->input);
- var->input = NULL;
+ av_opt_set(pls->input->priv_data, "key", key, 0);
+ av_opt_set(pls->input->priv_data, "iv", iv, 0);
+
+ if ((ret = ffurl_connect(pls->input, &opts)) < 0) {
+ ffurl_close(pls->input);
+ pls->input = NULL;
goto cleanup;
}
ret = 0;
@@ -404,30 +977,76 @@ static int open_input(HLSContext *c, struct variant *var)
else
ret = AVERROR(ENOSYS);
+ /* Seek to the requested position. If this was a HTTP request, the offset
+ * should already be where want it to, but this allows e.g. local testing
+ * without a HTTP server. */
+ if (ret == 0 && seg->key_type == KEY_NONE) {
+ int seekret = ffurl_seek(pls->input, seg->url_offset, SEEK_SET);
+ if (seekret < 0) {
+ av_log(pls->parent, AV_LOG_ERROR, "Unable to seek to offset %"PRId64" of HLS segment '%s'\n", seg->url_offset, seg->url);
+ ret = seekret;
+ ffurl_close(pls->input);
+ pls->input = NULL;
+ }
+ }
+
cleanup:
av_dict_free(&opts);
+ av_dict_free(&opts2);
+ pls->cur_seg_offset = 0;
return ret;
}
+static int64_t default_reload_interval(struct playlist *pls)
+{
+ return pls->n_segments > 0 ?
+ pls->segments[pls->n_segments - 1]->duration :
+ pls->target_duration;
+}
+
static int read_data(void *opaque, uint8_t *buf, int buf_size)
{
- struct variant *v = opaque;
+ struct playlist *v = opaque;
HLSContext *c = v->parent->priv_data;
int ret, i;
+ int just_opened = 0;
restart:
+ if (!v->needed)
+ return AVERROR_EOF;
+
if (!v->input) {
+ int64_t reload_interval;
+
+ /* Check that the playlist is still needed before opening a new
+ * segment. */
+ if (v->ctx && v->ctx->nb_streams &&
+ v->parent->nb_streams >= v->stream_offset + v->ctx->nb_streams) {
+ v->needed = 0;
+ for (i = v->stream_offset; i < v->stream_offset + v->ctx->nb_streams;
+ i++) {
+ if (v->parent->streams[i]->discard < AVDISCARD_ALL)
+ v->needed = 1;
+ }
+ }
+ if (!v->needed) {
+ av_log(v->parent, AV_LOG_INFO, "No longer receiving playlist %d\n",
+ v->index);
+ return AVERROR_EOF;
+ }
+
/* If this is a live stream and the reload interval has elapsed since
- * the last playlist reload, reload the variant playlists now. */
- int64_t reload_interval = v->n_segments > 0 ?
- v->segments[v->n_segments - 1]->duration :
- v->target_duration;
+ * the last playlist reload, reload the playlists now. */
+ reload_interval = default_reload_interval(v);
reload:
if (!v->finished &&
av_gettime() - v->last_load_time >= reload_interval) {
- if ((ret = parse_playlist(c, v->url, v, NULL)) < 0)
+ if ((ret = parse_playlist(c, v->url, v, NULL)) < 0) {
+ av_log(v->parent, AV_LOG_WARNING, "Failed to reload playlist %d\n",
+ v->index);
return ret;
+ }
/* If we need to reload the playlist again below (if
* there's still no more segments), switch to a reload
* interval of half the target duration. */
@@ -452,34 +1071,169 @@ reload:
}
ret = open_input(c, v);
- if (ret < 0)
+ if (ret < 0) {
+ av_log(v->parent, AV_LOG_WARNING, "Failed to open segment of playlist %d\n",
+ v->index);
return ret;
+ }
+ just_opened = 1;
}
- ret = ffurl_read(v->input, buf, buf_size);
- if (ret > 0)
+
+ ret = read_from_url(v, buf, buf_size, READ_NORMAL);
+ if (ret > 0) {
+ if (just_opened && v->is_id3_timestamped != 0) {
+ /* Intercept ID3 tags here, elementary audio streams are required
+ * to convey timestamps using them in the beginning of each segment. */
+ intercept_id3(v, buf, buf_size, &ret);
+ }
+
return ret;
+ }
ffurl_close(v->input);
v->input = NULL;
v->cur_seq_no++;
- c->end_of_segment = 1;
c->cur_seq_no = v->cur_seq_no;
- if (v->ctx && v->ctx->nb_streams &&
- v->parent->nb_streams >= v->stream_offset + v->ctx->nb_streams) {
- v->needed = 0;
- for (i = v->stream_offset; i < v->stream_offset + v->ctx->nb_streams;
- i++) {
- if (v->parent->streams[i]->discard < AVDISCARD_ALL)
- v->needed = 1;
+ goto restart;
+}
+
+static int playlist_in_multiple_variants(HLSContext *c, struct playlist *pls)
+{
+ int variant_count = 0;
+ int i, j;
+
+ for (i = 0; i < c->n_variants && variant_count < 2; i++) {
+ struct variant *v = c->variants[i];
+
+ for (j = 0; j < v->n_playlists; j++) {
+ if (v->playlists[j] == pls) {
+ variant_count++;
+ break;
+ }
}
}
- if (!v->needed) {
- av_log(v->parent, AV_LOG_INFO, "No longer receiving variant %d\n",
- v->index);
- return AVERROR_EOF;
+
+ return variant_count >= 2;
+}
+
+static void add_renditions_to_variant(HLSContext *c, struct variant *var,
+ enum AVMediaType type, const char *group_id)
+{
+ int i;
+
+ for (i = 0; i < c->n_renditions; i++) {
+ struct rendition *rend = c->renditions[i];
+
+ if (rend->type == type && !strcmp(rend->group_id, group_id)) {
+
+ if (rend->playlist)
+ /* rendition is an external playlist
+ * => add the playlist to the variant */
+ dynarray_add(&var->playlists, &var->n_playlists, rend->playlist);
+ else
+ /* rendition is part of the variant main Media Playlist
+ * => add the rendition to the main Media Playlist */
+ dynarray_add(&var->playlists[0]->renditions,
+ &var->playlists[0]->n_renditions,
+ rend);
+ }
+ }
+}
+
+static void add_metadata_from_renditions(AVFormatContext *s, struct playlist *pls,
+ enum AVMediaType type)
+{
+ int rend_idx = 0;
+ int i;
+
+ for (i = 0; i < pls->ctx->nb_streams; i++) {
+ AVStream *st = s->streams[pls->stream_offset + i];
+
+ if (st->codec->codec_type != type)
+ continue;
+
+ for (; rend_idx < pls->n_renditions; rend_idx++) {
+ struct rendition *rend = pls->renditions[rend_idx];
+
+ if (rend->type != type)
+ continue;
+
+ if (rend->language[0])
+ av_dict_set(&st->metadata, "language", rend->language, 0);
+ if (rend->name[0])
+ av_dict_set(&st->metadata, "comment", rend->name, 0);
+
+ st->disposition |= rend->disposition;
+ }
+ if (rend_idx >=pls->n_renditions)
+ break;
}
- goto restart;
+}
+
+/* if timestamp was in valid range: returns 1 and sets seq_no
+ * if not: returns 0 and sets seq_no to closest segment */
+static int find_timestamp_in_playlist(HLSContext *c, struct playlist *pls,
+ int64_t timestamp, int *seq_no)
+{
+ int i;
+ int64_t pos = c->first_timestamp == AV_NOPTS_VALUE ?
+ 0 : c->first_timestamp;
+
+ if (timestamp < pos) {
+ *seq_no = pls->start_seq_no;
+ return 0;
+ }
+
+ for (i = 0; i < pls->n_segments; i++) {
+ int64_t diff = pos + pls->segments[i]->duration - timestamp;
+ if (diff > 0) {
+ *seq_no = pls->start_seq_no + i;
+ return 1;
+ }
+ pos += pls->segments[i]->duration;
+ }
+
+ *seq_no = pls->start_seq_no + pls->n_segments - 1;
+
+ return 0;
+}
+
+static int select_cur_seq_no(HLSContext *c, struct playlist *pls)
+{
+ int seq_no;
+
+ if (!pls->finished && !c->first_packet &&
+ av_gettime() - pls->last_load_time >= default_reload_interval(pls))
+ /* reload the playlist since it was suspended */
+ parse_playlist(c, pls->url, pls, NULL);
+
+ /* If playback is already in progress (we are just selecting a new
+ * playlist) and this is a complete file, find the matching segment
+ * by counting durations. */
+ if (pls->finished && c->cur_timestamp != AV_NOPTS_VALUE) {
+ find_timestamp_in_playlist(c, pls, c->cur_timestamp, &seq_no);
+ return seq_no;
+ }
+
+ if (!pls->finished) {
+ if (!c->first_packet && /* we are doing a segment selection during playback */
+ c->cur_seq_no >= pls->start_seq_no &&
+ c->cur_seq_no < pls->start_seq_no + pls->n_segments)
+ /* While spec 3.4.3 says that we cannot assume anything about the
+ * content at the same sequence number on different playlists,
+ * in practice this seems to work and doing it otherwise would
+ * require us to download a segment to inspect its timestamps. */
+ return c->cur_seq_no;
+
+ /* If this is a live stream with more than 3 segments, start at the
+ * third last segment. */
+ if (pls->n_segments > 3)
+ return pls->start_seq_no + pls->n_segments - 3;
+ }
+
+ /* Otherwise just start on the first segment. */
+ return pls->start_seq_no;
}
static int hls_read_header(AVFormatContext *s)
@@ -490,6 +1244,10 @@ static int hls_read_header(AVFormatContext *s)
c->interrupt_callback = &s->interrupt_callback;
+ c->first_packet = 1;
+ c->first_timestamp = AV_NOPTS_VALUE;
+ c->cur_timestamp = AV_NOPTS_VALUE;
+
// if the URL context is good, read important options we must broker later
if (u && u->prot->priv_data_class) {
// get the previous user agent & set back to null if string size is zero
@@ -519,17 +1277,17 @@ static int hls_read_header(AVFormatContext *s)
ret = AVERROR_EOF;
goto fail;
}
- /* If the playlist only contained variants, parse each individual
- * variant playlist. */
- if (c->n_variants > 1 || c->variants[0]->n_segments == 0) {
- for (i = 0; i < c->n_variants; i++) {
- struct variant *v = c->variants[i];
- if ((ret = parse_playlist(c, v->url, v, NULL)) < 0)
+ /* If the playlist only contained playlists (Master Playlist),
+ * parse each individual playlist. */
+ if (c->n_playlists > 1 || c->playlists[0]->n_segments == 0) {
+ for (i = 0; i < c->n_playlists; i++) {
+ struct playlist *pls = c->playlists[i];
+ if ((ret = parse_playlist(c, pls->url, pls, NULL)) < 0)
goto fail;
}
}
- if (c->variants[0]->n_segments == 0) {
+ if (c->variants[0]->playlists[0]->n_segments == 0) {
av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
ret = AVERROR_EOF;
goto fail;
@@ -537,97 +1295,140 @@ static int hls_read_header(AVFormatContext *s)
/* If this isn't a live stream, calculate the total duration of the
* stream. */
- if (c->variants[0]->finished) {
+ if (c->variants[0]->playlists[0]->finished) {
int64_t duration = 0;
- for (i = 0; i < c->variants[0]->n_segments; i++)
- duration += c->variants[0]->segments[i]->duration;
+ for (i = 0; i < c->variants[0]->playlists[0]->n_segments; i++)
+ duration += c->variants[0]->playlists[0]->segments[i]->duration;
s->duration = duration;
}
- /* Open the demuxer for each variant */
+ /* Associate renditions with variants */
for (i = 0; i < c->n_variants; i++) {
- struct variant *v = c->variants[i];
+ struct variant *var = c->variants[i];
+
+ if (var->audio_group[0])
+ add_renditions_to_variant(c, var, AVMEDIA_TYPE_AUDIO, var->audio_group);
+ if (var->video_group[0])
+ add_renditions_to_variant(c, var, AVMEDIA_TYPE_VIDEO, var->video_group);
+ if (var->subtitles_group[0])
+ add_renditions_to_variant(c, var, AVMEDIA_TYPE_SUBTITLE, var->subtitles_group);
+ }
+
+ /* Open the demuxer for each playlist */
+ for (i = 0; i < c->n_playlists; i++) {
+ struct playlist *pls = c->playlists[i];
AVInputFormat *in_fmt = NULL;
- char bitrate_str[20];
- AVProgram *program;
- if (v->n_segments == 0)
+ if (pls->n_segments == 0)
continue;
- if (!(v->ctx = avformat_alloc_context())) {
+ if (!(pls->ctx = avformat_alloc_context())) {
ret = AVERROR(ENOMEM);
goto fail;
}
- v->index = i;
- v->needed = 1;
- v->parent = s;
-
- /* If this is a live stream with more than 3 segments, start at the
- * third last segment. */
- v->cur_seq_no = v->start_seq_no;
- if (!v->finished && v->n_segments > 3)
- v->cur_seq_no = v->start_seq_no + v->n_segments - 3;
+ pls->index = i;
+ pls->needed = 1;
+ pls->parent = s;
+ pls->cur_seq_no = select_cur_seq_no(c, pls);
- v->read_buffer = av_malloc(INITIAL_BUFFER_SIZE);
- ffio_init_context(&v->pb, v->read_buffer, INITIAL_BUFFER_SIZE, 0, v,
+ pls->read_buffer = av_malloc(INITIAL_BUFFER_SIZE);
+ ffio_init_context(&pls->pb, pls->read_buffer, INITIAL_BUFFER_SIZE, 0, pls,
read_data, NULL, NULL);
- v->pb.seekable = 0;
- ret = av_probe_input_buffer(&v->pb, &in_fmt, v->segments[0]->url,
+ pls->pb.seekable = 0;
+ ret = av_probe_input_buffer(&pls->pb, &in_fmt, pls->segments[0]->url,
NULL, 0, 0);
if (ret < 0) {
/* Free the ctx - it isn't initialized properly at this point,
* so avformat_close_input shouldn't be called. If
* avformat_open_input fails below, it frees and zeros the
* context, so it doesn't need any special treatment like this. */
- av_log(s, AV_LOG_ERROR, "Error when loading first segment '%s'\n", v->segments[0]->url);
- avformat_free_context(v->ctx);
- v->ctx = NULL;
+ av_log(s, AV_LOG_ERROR, "Error when loading first segment '%s'\n", pls->segments[0]->url);
+ avformat_free_context(pls->ctx);
+ pls->ctx = NULL;
goto fail;
}
- v->ctx->pb = &v->pb;
- v->stream_offset = stream_offset;
- ret = avformat_open_input(&v->ctx, v->segments[0]->url, in_fmt, NULL);
+ pls->ctx->pb = &pls->pb;
+ pls->stream_offset = stream_offset;
+ ret = avformat_open_input(&pls->ctx, pls->segments[0]->url, in_fmt, NULL);
if (ret < 0)
goto fail;
- v->ctx->ctx_flags &= ~AVFMTCTX_NOHEADER;
- ret = avformat_find_stream_info(v->ctx, NULL);
+ if (pls->id3_deferred_extra && pls->ctx->nb_streams == 1) {
+ ff_id3v2_parse_apic(pls->ctx, &pls->id3_deferred_extra);
+ avformat_queue_attached_pictures(pls->ctx);
+ ff_id3v2_free_extra_meta(&pls->id3_deferred_extra);
+ pls->id3_deferred_extra = NULL;
+ }
+
+ pls->ctx->ctx_flags &= ~AVFMTCTX_NOHEADER;
+ ret = avformat_find_stream_info(pls->ctx, NULL);
if (ret < 0)
goto fail;
- snprintf(bitrate_str, sizeof(bitrate_str), "%d", v->bandwidth);
- program = av_new_program(s, i);
- if (!program)
- goto fail;
- av_dict_set(&program->metadata, "variant_bitrate", bitrate_str, 0);
+ if (pls->is_id3_timestamped == -1)
+ av_log(s, AV_LOG_WARNING, "No expected HTTP requests have been made\n");
- /* Create new AVStreams for each stream in this variant */
- for (j = 0; j < v->ctx->nb_streams; j++) {
+ /* Create new AVStreams for each stream in this playlist */
+ for (j = 0; j < pls->ctx->nb_streams; j++) {
AVStream *st = avformat_new_stream(s, NULL);
- AVStream *ist = v->ctx->streams[j];
+ AVStream *ist = pls->ctx->streams[j];
if (!st) {
ret = AVERROR(ENOMEM);
goto fail;
}
- ff_program_add_stream_index(s, i, stream_offset + j);
st->id = i;
- avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den);
- avcodec_copy_context(st->codec, v->ctx->streams[j]->codec);
- if (v->bandwidth)
- av_dict_set(&st->metadata, "variant_bitrate", bitrate_str,
- 0);
+
+ avcodec_copy_context(st->codec, pls->ctx->streams[j]->codec);
+
+ if (pls->is_id3_timestamped) /* custom timestamps via id3 */
+ avpriv_set_pts_info(st, 33, 1, MPEG_TIME_BASE);
+ else
+ avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den);
}
- stream_offset += v->ctx->nb_streams;
+
+ add_metadata_from_renditions(s, pls, AVMEDIA_TYPE_AUDIO);
+ add_metadata_from_renditions(s, pls, AVMEDIA_TYPE_VIDEO);
+ add_metadata_from_renditions(s, pls, AVMEDIA_TYPE_SUBTITLE);
+
+ stream_offset += pls->ctx->nb_streams;
}
- c->first_packet = 1;
- c->first_timestamp = AV_NOPTS_VALUE;
- c->seek_timestamp = AV_NOPTS_VALUE;
+ /* Create a program for each variant */
+ for (i = 0; i < c->n_variants; i++) {
+ struct variant *v = c->variants[i];
+ char bitrate_str[20];
+ AVProgram *program;
+
+ snprintf(bitrate_str, sizeof(bitrate_str), "%d", v->bandwidth);
+
+ program = av_new_program(s, i);
+ if (!program)
+ goto fail;
+ av_dict_set(&program->metadata, "variant_bitrate", bitrate_str, 0);
+
+ for (j = 0; j < v->n_playlists; j++) {
+ struct playlist *pls = v->playlists[j];
+ int is_shared = playlist_in_multiple_variants(c, pls);
+ int k;
+
+ for (k = 0; k < pls->ctx->nb_streams; k++) {
+ struct AVStream *st = s->streams[pls->stream_offset + k];
+
+ ff_program_add_stream_index(s, i, pls->stream_offset + k);
+
+ /* Set variant_bitrate for streams unique to this variant */
+ if (!is_shared && v->bandwidth)
+ av_dict_set(&st->metadata, "variant_bitrate", bitrate_str, 0);
+ }
+ }
+ }
return 0;
fail:
+ free_playlist_list(c);
free_variant_list(c);
+ free_rendition_list(c);
return ret;
}
@@ -637,127 +1438,171 @@ static int recheck_discard_flags(AVFormatContext *s, int first)
int i, changed = 0;
/* Check if any new streams are needed */
- for (i = 0; i < c->n_variants; i++)
- c->variants[i]->cur_needed = 0;
+ for (i = 0; i < c->n_playlists; i++)
+ c->playlists[i]->cur_needed = 0;
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
- struct variant *var = c->variants[s->streams[i]->id];
+ struct playlist *pls = c->playlists[s->streams[i]->id];
if (st->discard < AVDISCARD_ALL)
- var->cur_needed = 1;
+ pls->cur_needed = 1;
}
- for (i = 0; i < c->n_variants; i++) {
- struct variant *v = c->variants[i];
- if (v->cur_needed && !v->needed) {
- v->needed = 1;
+ for (i = 0; i < c->n_playlists; i++) {
+ struct playlist *pls = c->playlists[i];
+ if (pls->cur_needed && !pls->needed) {
+ pls->needed = 1;
changed = 1;
- v->cur_seq_no = c->cur_seq_no;
- v->pb.eof_reached = 0;
- av_log(s, AV_LOG_INFO, "Now receiving variant %d\n", i);
- } else if (first && !v->cur_needed && v->needed) {
- if (v->input)
- ffurl_close(v->input);
- v->input = NULL;
- v->needed = 0;
+ pls->cur_seq_no = select_cur_seq_no(c, pls);
+ pls->pb.eof_reached = 0;
+ if (c->cur_timestamp != AV_NOPTS_VALUE) {
+ /* catch up */
+ pls->seek_timestamp = c->cur_timestamp;
+ pls->seek_flags = AVSEEK_FLAG_ANY;
+ pls->seek_stream_index = -1;
+ }
+ av_log(s, AV_LOG_INFO, "Now receiving playlist %d, segment %d\n", i, pls->cur_seq_no);
+ } else if (first && !pls->cur_needed && pls->needed) {
+ if (pls->input)
+ ffurl_close(pls->input);
+ pls->input = NULL;
+ pls->needed = 0;
changed = 1;
- av_log(s, AV_LOG_INFO, "No longer receiving variant %d\n", i);
+ av_log(s, AV_LOG_INFO, "No longer receiving playlist %d\n", i);
}
}
return changed;
}
+static void fill_timing_for_id3_timestamped_stream(struct playlist *pls)
+{
+ if (pls->id3_offset >= 0) {
+ pls->pkt.dts = pls->id3_mpegts_timestamp +
+ av_rescale_q(pls->id3_offset,
+ pls->ctx->streams[pls->pkt.stream_index]->time_base,
+ MPEG_TIME_BASE_Q);
+ if (pls->pkt.duration)
+ pls->id3_offset += pls->pkt.duration;
+ else
+ pls->id3_offset = -1;
+ } else {
+ /* there have been packets with unknown duration
+ * since the last id3 tag, should not normally happen */
+ pls->pkt.dts = AV_NOPTS_VALUE;
+ }
+
+ if (pls->pkt.duration)
+ pls->pkt.duration = av_rescale_q(pls->pkt.duration,
+ pls->ctx->streams[pls->pkt.stream_index]->time_base,
+ MPEG_TIME_BASE_Q);
+
+ pls->pkt.pts = AV_NOPTS_VALUE;
+}
+
+static AVRational get_timebase(struct playlist *pls)
+{
+ if (pls->is_id3_timestamped)
+ return MPEG_TIME_BASE_Q;
+
+ return pls->ctx->streams[pls->pkt.stream_index]->time_base;
+}
+
+static int compare_ts_with_wrapdetect(int64_t ts_a, struct playlist *pls_a,
+ int64_t ts_b, struct playlist *pls_b)
+{
+ int64_t scaled_ts_a = av_rescale_q(ts_a, get_timebase(pls_a), MPEG_TIME_BASE_Q);
+ int64_t scaled_ts_b = av_rescale_q(ts_b, get_timebase(pls_b), MPEG_TIME_BASE_Q);
+
+ return av_compare_mod(scaled_ts_a, scaled_ts_b, 1LL << 33);
+}
+
static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
{
HLSContext *c = s->priv_data;
- int ret, i, minvariant = -1;
+ int ret, i, minplaylist = -1;
- if (c->first_packet) {
- recheck_discard_flags(s, 1);
- c->first_packet = 0;
- }
+ recheck_discard_flags(s, c->first_packet);
-start:
- c->end_of_segment = 0;
- for (i = 0; i < c->n_variants; i++) {
- struct variant *var = c->variants[i];
- /* Make sure we've got one buffered packet from each open variant
+ for (i = 0; i < c->n_playlists; i++) {
+ struct playlist *pls = c->playlists[i];
+ /* Make sure we've got one buffered packet from each open playlist
* stream */
- if (var->needed && !var->pkt.data) {
+ if (pls->needed && !pls->pkt.data) {
while (1) {
int64_t ts_diff;
- AVStream *st;
- ret = av_read_frame(var->ctx, &var->pkt);
+ AVRational tb;
+ ret = av_read_frame(pls->ctx, &pls->pkt);
if (ret < 0) {
- if (!url_feof(&var->pb) && ret != AVERROR_EOF)
+ if (!url_feof(&pls->pb) && ret != AVERROR_EOF)
return ret;
- reset_packet(&var->pkt);
+ reset_packet(&pls->pkt);
break;
} else {
+ /* stream_index check prevents matching picture attachments etc. */
+ if (pls->is_id3_timestamped && pls->pkt.stream_index == 0) {
+ /* audio elementary streams are id3 timestamped */
+ fill_timing_for_id3_timestamped_stream(pls);
+ }
+
if (c->first_timestamp == AV_NOPTS_VALUE &&
- var->pkt.dts != AV_NOPTS_VALUE)
- c->first_timestamp = av_rescale_q(var->pkt.dts,
- var->ctx->streams[var->pkt.stream_index]->time_base,
- AV_TIME_BASE_Q);
+ pls->pkt.dts != AV_NOPTS_VALUE)
+ c->first_timestamp = av_rescale_q(pls->pkt.dts,
+ get_timebase(pls), AV_TIME_BASE_Q);
}
- if (c->seek_timestamp == AV_NOPTS_VALUE)
+ if (pls->seek_timestamp == AV_NOPTS_VALUE)
break;
- if (var->pkt.dts == AV_NOPTS_VALUE) {
- c->seek_timestamp = AV_NOPTS_VALUE;
- break;
- }
+ if (pls->seek_stream_index < 0 ||
+ pls->seek_stream_index == pls->pkt.stream_index) {
- st = var->ctx->streams[var->pkt.stream_index];
- ts_diff = av_rescale_rnd(var->pkt.dts, AV_TIME_BASE,
- st->time_base.den, AV_ROUND_DOWN) -
- c->seek_timestamp;
- if (ts_diff >= 0 && (c->seek_flags & AVSEEK_FLAG_ANY ||
- var->pkt.flags & AV_PKT_FLAG_KEY)) {
- c->seek_timestamp = AV_NOPTS_VALUE;
- break;
+ if (pls->pkt.dts == AV_NOPTS_VALUE) {
+ pls->seek_timestamp = AV_NOPTS_VALUE;
+ break;
+ }
+
+ tb = get_timebase(pls);
+ ts_diff = av_rescale_rnd(pls->pkt.dts, AV_TIME_BASE,
+ tb.den, AV_ROUND_DOWN) -
+ pls->seek_timestamp;
+ if (ts_diff >= 0 && (pls->seek_flags & AVSEEK_FLAG_ANY ||
+ pls->pkt.flags & AV_PKT_FLAG_KEY)) {
+ pls->seek_timestamp = AV_NOPTS_VALUE;
+ break;
+ }
}
- av_free_packet(&var->pkt);
- reset_packet(&var->pkt);
+ av_free_packet(&pls->pkt);
+ reset_packet(&pls->pkt);
}
}
- /* Check if this stream still is on an earlier segment number, or
- * has the packet with the lowest dts */
- if (var->pkt.data) {
- struct variant *minvar = minvariant < 0 ?
- NULL : c->variants[minvariant];
- if (minvariant < 0 || var->cur_seq_no < minvar->cur_seq_no) {
- minvariant = i;
- } else if (var->cur_seq_no == minvar->cur_seq_no) {
- int64_t dts = var->pkt.dts;
- int64_t mindts = minvar->pkt.dts;
- AVStream *st = var->ctx->streams[var->pkt.stream_index];
- AVStream *minst = minvar->ctx->streams[minvar->pkt.stream_index];
-
- if (dts == AV_NOPTS_VALUE) {
- minvariant = i;
- } else if (mindts != AV_NOPTS_VALUE) {
- if (st->start_time != AV_NOPTS_VALUE)
- dts -= st->start_time;
- if (minst->start_time != AV_NOPTS_VALUE)
- mindts -= minst->start_time;
-
- if (av_compare_ts(dts, st->time_base,
- mindts, minst->time_base) < 0)
- minvariant = i;
- }
+ /* Check if this stream has the packet with the lowest dts */
+ if (pls->pkt.data) {
+ struct playlist *minpls = minplaylist < 0 ?
+ NULL : c->playlists[minplaylist];
+ if (minplaylist < 0) {
+ minplaylist = i;
+ } else {
+ int64_t dts = pls->pkt.dts;
+ int64_t mindts = minpls->pkt.dts;
+
+ if (dts == AV_NOPTS_VALUE ||
+ (mindts != AV_NOPTS_VALUE && compare_ts_with_wrapdetect(dts, pls, mindts, minpls) < 0))
+ minplaylist = i;
}
}
}
- if (c->end_of_segment) {
- if (recheck_discard_flags(s, 0))
- goto start;
- }
+
/* If we got a packet, return it */
- if (minvariant >= 0) {
- *pkt = c->variants[minvariant]->pkt;
- pkt->stream_index += c->variants[minvariant]->stream_offset;
- reset_packet(&c->variants[minvariant]->pkt);
+ if (minplaylist >= 0) {
+ struct playlist *pls = c->playlists[minplaylist];
+ *pkt = pls->pkt;
+ pkt->stream_index += pls->stream_offset;
+ reset_packet(&c->playlists[minplaylist]->pkt);
+
+ if (pkt->dts != AV_NOPTS_VALUE)
+ c->cur_timestamp = av_rescale_q(pkt->dts,
+ pls->ctx->streams[pls->pkt.stream_index]->time_base,
+ AV_TIME_BASE_Q);
+
return 0;
}
return AVERROR_EOF;
@@ -767,7 +1612,9 @@ static int hls_close(AVFormatContext *s)
{
HLSContext *c = s->priv_data;
+ free_playlist_list(c);
free_variant_list(c);
+ free_rendition_list(c);
return 0;
}
@@ -775,58 +1622,80 @@ static int hls_read_seek(AVFormatContext *s, int stream_index,
int64_t timestamp, int flags)
{
HLSContext *c = s->priv_data;
- int i, j, ret;
+ struct playlist *seek_pls = NULL;
+ int i, seq_no;
+ int64_t first_timestamp, seek_timestamp, duration;
- if ((flags & AVSEEK_FLAG_BYTE) || !c->variants[0]->finished)
+ if ((flags & AVSEEK_FLAG_BYTE) ||
+ !(c->variants[0]->playlists[0]->finished || c->variants[0]->playlists[0]->type == PLS_TYPE_EVENT))
return AVERROR(ENOSYS);
- c->seek_flags = flags;
- c->seek_timestamp = stream_index < 0 ? timestamp :
- av_rescale_rnd(timestamp, AV_TIME_BASE,
- s->streams[stream_index]->time_base.den,
- flags & AVSEEK_FLAG_BACKWARD ?
- AV_ROUND_DOWN : AV_ROUND_UP);
- timestamp = av_rescale_rnd(timestamp, AV_TIME_BASE, stream_index >= 0 ?
- s->streams[stream_index]->time_base.den :
- AV_TIME_BASE, flags & AVSEEK_FLAG_BACKWARD ?
- AV_ROUND_DOWN : AV_ROUND_UP);
- if (s->duration < c->seek_timestamp) {
- c->seek_timestamp = AV_NOPTS_VALUE;
+ first_timestamp = c->first_timestamp == AV_NOPTS_VALUE ?
+ 0 : c->first_timestamp;
+
+ seek_timestamp = av_rescale_rnd(timestamp, AV_TIME_BASE,
+ s->streams[stream_index]->time_base.den,
+ flags & AVSEEK_FLAG_BACKWARD ?
+ AV_ROUND_DOWN : AV_ROUND_UP);
+
+ duration = s->duration == AV_NOPTS_VALUE ?
+ 0 : s->duration;
+
+ if (0 < duration && duration < seek_timestamp - first_timestamp)
return AVERROR(EIO);
+
+ /* find the playlist with the specified stream */
+ for (i = 0; i < c->n_playlists; i++) {
+ struct playlist *pls = c->playlists[i];
+ if (stream_index >= pls->stream_offset &&
+ stream_index - pls->stream_offset < pls->ctx->nb_streams) {
+ seek_pls = pls;
+ break;
+ }
}
+ /* check if the timestamp is valid for the playlist with the
+ * specified stream index */
+ if (!seek_pls || !find_timestamp_in_playlist(c, seek_pls, seek_timestamp, &seq_no))
+ return AVERROR(EIO);
- ret = AVERROR(EIO);
- for (i = 0; i < c->n_variants; i++) {
+ /* set segment now so we do not need to search again below */
+ seek_pls->cur_seq_no = seq_no;
+ seek_pls->seek_stream_index = stream_index - seek_pls->stream_offset;
+
+ for (i = 0; i < c->n_playlists; i++) {
/* Reset reading */
- struct variant *var = c->variants[i];
- int64_t pos = c->first_timestamp == AV_NOPTS_VALUE ?
- 0 : c->first_timestamp;
- if (var->input) {
- ffurl_close(var->input);
- var->input = NULL;
+ struct playlist *pls = c->playlists[i];
+ if (pls->input) {
+ ffurl_close(pls->input);
+ pls->input = NULL;
}
- av_free_packet(&var->pkt);
- reset_packet(&var->pkt);
- var->pb.eof_reached = 0;
+ av_free_packet(&pls->pkt);
+ reset_packet(&pls->pkt);
+ pls->pb.eof_reached = 0;
/* Clear any buffered data */
- var->pb.buf_end = var->pb.buf_ptr = var->pb.buffer;
+ pls->pb.buf_end = pls->pb.buf_ptr = pls->pb.buffer;
/* Reset the pos, to let the mpegts demuxer know we've seeked. */
- var->pb.pos = 0;
-
- /* Locate the segment that contains the target timestamp */
- for (j = 0; j < var->n_segments; j++) {
- if (timestamp >= pos &&
- timestamp < pos + var->segments[j]->duration) {
- var->cur_seq_no = var->start_seq_no + j;
- ret = 0;
- break;
- }
- pos += var->segments[j]->duration;
+ pls->pb.pos = 0;
+ /* Flush the packet queue of the subdemuxer. */
+ ff_read_frame_flush(pls->ctx);
+
+ pls->seek_timestamp = seek_timestamp;
+ pls->seek_flags = flags;
+
+ if (pls != seek_pls) {
+ /* set closest segment seq_no for playlists not handled above */
+ find_timestamp_in_playlist(c, pls, seek_timestamp, &pls->cur_seq_no);
+ /* seek the playlist to the given position without taking
+ * keyframes into account since this playlist does not have the
+ * specified stream where we should look for the keyframes */
+ pls->seek_stream_index = -1;
+ pls->seek_flags |= AVSEEK_FLAG_ANY;
}
- if (ret)
- c->seek_timestamp = AV_NOPTS_VALUE;
}
- return ret;
+
+ c->cur_timestamp = seek_timestamp;
+
+ return 0;
}
static int hls_probe(AVProbeData *p)
diff --git a/chromium/third_party/ffmpeg/libavformat/hlsenc.c b/chromium/third_party/ffmpeg/libavformat/hlsenc.c
index b9bf60543fa..12bd07b2d43 100644
--- a/chromium/third_party/ffmpeg/libavformat/hlsenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/hlsenc.c
@@ -33,7 +33,7 @@
typedef struct ListEntry {
char name[1024];
- int duration;
+ double duration;
struct ListEntry *next;
} ListEntry;
@@ -41,6 +41,7 @@ typedef struct HLSContext {
const AVClass *class; // Class for private options.
unsigned number;
int64_t sequence;
+ int64_t start_sequence;
AVOutputFormat *oformat;
AVFormatContext *avf;
float time; // Set by a private option.
@@ -50,11 +51,12 @@ typedef struct HLSContext {
int has_video;
int64_t start_pts;
int64_t end_pts;
- int64_t duration; // last segment duration computed so far, in seconds
+ double duration; // last segment duration computed so far, in seconds
int nb_entries;
ListEntry *list;
ListEntry *end_list;
char *basename;
+ char *baseurl;
AVIOContext *pb;
} HLSContext;
@@ -70,6 +72,7 @@ static int hls_mux_init(AVFormatContext *s)
oc->oformat = hls->oformat;
oc->interrupt_callback = s->interrupt_callback;
+ av_dict_copy(&oc->metadata, s->metadata, 0);
for (i = 0; i < s->nb_streams; i++) {
AVStream *st;
@@ -82,7 +85,7 @@ static int hls_mux_init(AVFormatContext *s)
return 0;
}
-static int append_entry(HLSContext *hls, uint64_t duration)
+static int append_entry(HLSContext *hls, double duration)
{
ListEntry *en = av_malloc(sizeof(*en));
@@ -101,7 +104,7 @@ static int append_entry(HLSContext *hls, uint64_t duration)
hls->end_list = en;
- if (hls->nb_entries >= hls->size) {
+ if (hls->size && hls->nb_entries >= hls->size) {
en = hls->list;
hls->list = en->next;
av_free(en);
@@ -130,6 +133,7 @@ static int hls_window(AVFormatContext *s, int last)
ListEntry *en;
int target_duration = 0;
int ret = 0;
+ int64_t sequence = FFMAX(hls->start_sequence, hls->sequence - hls->nb_entries);
if ((ret = avio_open2(&hls->pb, s->filename, AVIO_FLAG_WRITE,
&s->interrupt_callback, NULL)) < 0)
@@ -137,17 +141,21 @@ static int hls_window(AVFormatContext *s, int last)
for (en = hls->list; en; en = en->next) {
if (target_duration < en->duration)
- target_duration = en->duration;
+ target_duration = (int) floor(en->duration + 0.5);
}
avio_printf(hls->pb, "#EXTM3U\n");
avio_printf(hls->pb, "#EXT-X-VERSION:3\n");
avio_printf(hls->pb, "#EXT-X-TARGETDURATION:%d\n", target_duration);
- avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
- FFMAX(0, hls->sequence - hls->size));
+ avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n", sequence);
+
+ av_log(s, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
+ sequence);
for (en = hls->list; en; en = en->next) {
- avio_printf(hls->pb, "#EXTINF:%d,\n", en->duration);
+ avio_printf(hls->pb, "#EXTINF:%f,\n", en->duration);
+ if (hls->baseurl)
+ avio_printf(hls->pb, "%s", hls->baseurl);
avio_printf(hls->pb, "%s\n", en->name);
}
@@ -166,7 +174,7 @@ static int hls_start(AVFormatContext *s)
int err = 0;
if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
- c->basename, c->wrap ? c->number % c->wrap : c->number) < 0) {
+ c->basename, c->wrap ? c->sequence % c->wrap : c->sequence) < 0) {
av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s'\n", c->basename);
return AVERROR(EINVAL);
}
@@ -190,8 +198,7 @@ static int hls_write_header(AVFormatContext *s)
const char *pattern = "%d.ts";
int basename_size = strlen(s->filename) + strlen(pattern) + 1;
- hls->number = 0;
-
+ hls->sequence = hls->start_sequence;
hls->recording_time = hls->time * AV_TIME_BASE;
hls->start_pts = AV_NOPTS_VALUE;
@@ -269,8 +276,8 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
is_ref_pkt = can_split = 0;
if (is_ref_pkt)
- hls->duration = av_rescale(pkt->pts - hls->end_pts,
- st->time_base.num, st->time_base.den);
+ hls->duration = (double)(pkt->pts - hls->end_pts)
+ * st->time_base.num / st->time_base.den;
if (can_split && av_compare_ts(pkt->pts - hls->start_pts, st->time_base,
end_pts, AV_TIME_BASE_Q) >= 0) {
@@ -320,10 +327,11 @@ static int hls_write_trailer(struct AVFormatContext *s)
#define OFFSET(x) offsetof(HLSContext, x)
#define E AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- {"start_number", "set first number in the sequence", OFFSET(sequence),AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, E},
+ {"start_number", "set first number in the sequence", OFFSET(start_sequence),AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, E},
{"hls_time", "set segment length in seconds", OFFSET(time), AV_OPT_TYPE_FLOAT, {.dbl = 2}, 0, FLT_MAX, E},
{"hls_list_size", "set maximum number of playlist entries", OFFSET(size), AV_OPT_TYPE_INT, {.i64 = 5}, 0, INT_MAX, E},
{"hls_wrap", "set number after which the index wraps", OFFSET(wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E},
+ {"hls_base_url", "url to prepend to each playlist entry", OFFSET(baseurl), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavformat/hnm.c b/chromium/third_party/ffmpeg/libavformat/hnm.c
index 47a1808afba..1320fa52062 100644
--- a/chromium/third_party/ffmpeg/libavformat/hnm.c
+++ b/chromium/third_party/ffmpeg/libavformat/hnm.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -90,7 +92,7 @@ static int hnm_read_header(AVFormatContext *s)
hnm->currentframe = 0;
- if (hnm->width < 320 || hnm->width > 640 ||
+ if (hnm->width < 256 || hnm->width > 640 ||
hnm->height < 150 || hnm->height > 480) {
av_log(s, AV_LOG_ERROR,
"invalid resolution: %ux%u\n", hnm->width, hnm->height);
@@ -149,8 +151,9 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt)
avio_skip(pb, 2);
if (chunk_size > hnm->superchunk_remaining || !chunk_size) {
- av_log(s, AV_LOG_ERROR, "invalid chunk size: %u, offset: %u\n",
- chunk_size, (int) avio_tell(pb));
+ av_log(s, AV_LOG_ERROR,
+ "invalid chunk size: %"PRIu32", offset: %"PRId64"\n",
+ chunk_size, avio_tell(pb));
avio_skip(pb, hnm->superchunk_remaining - 8);
hnm->superchunk_remaining = 0;
}
@@ -172,8 +175,8 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt)
break;
default:
- av_log(s, AV_LOG_WARNING, "unknown chunk found: %d, offset: %d\n",
- chunk_id, (int) avio_tell(pb));
+ av_log(s, AV_LOG_WARNING, "unknown chunk found: %"PRIu16", offset: %"PRId64"\n",
+ chunk_id, avio_tell(pb));
avio_skip(pb, chunk_size - 8);
hnm->superchunk_remaining -= chunk_size;
break;
diff --git a/chromium/third_party/ffmpeg/libavformat/http.c b/chromium/third_party/ffmpeg/libavformat/http.c
index 0619e2a06cf..3e172e36455 100644
--- a/chromium/third_party/ffmpeg/libavformat/http.c
+++ b/chromium/third_party/ffmpeg/libavformat/http.c
@@ -49,29 +49,37 @@ typedef struct {
unsigned char buffer[BUFFER_SIZE], *buf_ptr, *buf_end;
int line_count;
int http_code;
- int64_t chunksize; /**< Used if "Transfer-Encoding: chunked" otherwise -1. */
- char *content_type;
- char *user_agent;
- int64_t off, filesize;
- int icy_data_read; ///< how much data was read since last ICY metadata packet
- int icy_metaint; ///< after how many bytes of read data a new metadata packet will be found
+ /* Used if "Transfer-Encoding: chunked" otherwise -1. */
+ int64_t chunksize;
+ int64_t off, end_off, filesize;
char *location;
HTTPAuthState auth_state;
HTTPAuthState proxy_auth_state;
char *headers;
- int willclose; /**< Set if the server correctly handles Connection: close and will close the connection after feeding us the content. */
+ char *mime_type;
+ char *user_agent;
+ char *content_type;
+ /* Set if the server correctly handles Connection: close and will close
+ * the connection after feeding us the content. */
+ int willclose;
int seekable; /**< Control seekability, 0 = disable, 1 = enable, -1 = probe. */
int chunked_post;
- int end_chunked_post; /**< A flag which indicates if the end of chunked encoding has been sent. */
- int end_header; /**< A flag which indicates we have finished to read POST reply. */
- int multiple_requests; /**< A flag which indicates if we use persistent connections. */
+ /* A flag which indicates if the end of chunked encoding has been sent. */
+ int end_chunked_post;
+ /* A flag which indicates we have finished to read POST reply. */
+ int end_header;
+ /* A flag which indicates if we use persistent connections. */
+ int multiple_requests;
uint8_t *post_data;
int post_datalen;
int is_akamai;
int is_mediagateway;
- char *mime_type;
char *cookies; ///< holds newline (\n) delimited Set-Cookie header field values (without the "Set-Cookie: " field name)
int icy;
+ /* how much data was read since the last ICY metadata packet */
+ int icy_data_read;
+ /* after how many bytes of read data a new metadata packet will be found */
+ int icy_metaint;
char *icy_metadata_headers;
char *icy_metadata_packet;
#if CONFIG_ZLIB
@@ -91,20 +99,23 @@ static const AVOption options[] = {
{"seekable", "control seekability of connection", OFFSET(seekable), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, D },
{"chunked_post", "use chunked transfer-encoding for posts", OFFSET(chunked_post), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E },
{"headers", "set custom HTTP headers, can override built in default headers", OFFSET(headers), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
-{"content_type", "force a content type", OFFSET(content_type), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
+{"content_type", "set a specific content type for the POST messages", OFFSET(content_type), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
+{"user_agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = DEFAULT_USER_AGENT}, 0, 0, D },
{"user-agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = DEFAULT_USER_AGENT}, 0, 0, D },
{"multiple_requests", "use persistent connections", OFFSET(multiple_requests), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
{"post_data", "set custom HTTP post data", OFFSET(post_data), AV_OPT_TYPE_BINARY, .flags = D|E },
-{"mime_type", "set MIME type", OFFSET(mime_type), AV_OPT_TYPE_STRING, {0}, 0, 0, 0 },
+{"mime_type", "export the MIME type", OFFSET(mime_type), AV_OPT_TYPE_STRING, {0}, 0, 0, AV_OPT_FLAG_EXPORT | AV_OPT_FLAG_READONLY },
{"cookies", "set cookies to be sent in applicable future requests, use newline delimited Set-Cookie HTTP field value syntax", OFFSET(cookies), AV_OPT_TYPE_STRING, {0}, 0, 0, D },
{"icy", "request ICY metadata", OFFSET(icy), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D },
-{"icy_metadata_headers", "return ICY metadata headers", OFFSET(icy_metadata_headers), AV_OPT_TYPE_STRING, {0}, 0, 0, 0 },
-{"icy_metadata_packet", "return current ICY metadata packet", OFFSET(icy_metadata_packet), AV_OPT_TYPE_STRING, {0}, 0, 0, 0 },
+{"icy_metadata_headers", "return ICY metadata headers", OFFSET(icy_metadata_headers), AV_OPT_TYPE_STRING, {0}, 0, 0, AV_OPT_FLAG_EXPORT },
+{"icy_metadata_packet", "return current ICY metadata packet", OFFSET(icy_metadata_packet), AV_OPT_TYPE_STRING, {0}, 0, 0, AV_OPT_FLAG_EXPORT },
{"auth_type", "HTTP authentication type", OFFSET(auth_state.auth_type), AV_OPT_TYPE_INT, {.i64 = HTTP_AUTH_NONE}, HTTP_AUTH_NONE, HTTP_AUTH_BASIC, D|E, "auth_type" },
{"none", "No auth method set, autodetect", 0, AV_OPT_TYPE_CONST, {.i64 = HTTP_AUTH_NONE}, 0, 0, D|E, "auth_type" },
{"basic", "HTTP basic authentication", 0, AV_OPT_TYPE_CONST, {.i64 = HTTP_AUTH_BASIC}, 0, 0, D|E, "auth_type" },
{"send_expect_100", "Force sending an Expect: 100-continue header for POST", OFFSET(send_expect_100), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, E },
{"location", "The actual location of the data received", OFFSET(location), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
+{"offset", "initial byte offset", OFFSET(off), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D },
+{"end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D },
{NULL}
};
#define HTTP_CLASS(flavor)\
@@ -285,7 +296,7 @@ static int http_getc(HTTPContext *s)
if (len < 0) {
return len;
} else if (len == 0) {
- return -1;
+ return AVERROR_EOF;
} else {
s->buf_ptr = s->buffer;
s->buf_end = s->buffer + len;
@@ -318,11 +329,110 @@ static int http_get_line(HTTPContext *s, char *line, int line_size)
}
}
+static int check_http_code(URLContext *h, int http_code, const char *end)
+{
+ HTTPContext *s = h->priv_data;
+ /* error codes are 4xx and 5xx, but regard 401 as a success, so we
+ * don't abort until all headers have been parsed. */
+ if (http_code >= 400 && http_code < 600 &&
+ (http_code != 401 || s->auth_state.auth_type != HTTP_AUTH_NONE) &&
+ (http_code != 407 || s->proxy_auth_state.auth_type != HTTP_AUTH_NONE)) {
+ end += strspn(end, SPACE_CHARS);
+ av_log(h, AV_LOG_WARNING, "HTTP error %d %s\n", http_code, end);
+ return AVERROR(EIO);
+ }
+ return 0;
+}
+
+static int parse_location(HTTPContext *s, const char *p)
+{
+ char redirected_location[MAX_URL_SIZE], *new_loc;
+ ff_make_absolute_url(redirected_location, sizeof(redirected_location),
+ s->location, p);
+ new_loc = av_strdup(redirected_location);
+ if (!new_loc)
+ return AVERROR(ENOMEM);
+ av_free(s->location);
+ s->location = new_loc;
+ return 0;
+}
+
+/* "bytes $from-$to/$document_size" */
+static void parse_content_range(URLContext *h, const char *p)
+{
+ HTTPContext *s = h->priv_data;
+ const char *slash;
+
+ if (!strncmp(p, "bytes ", 6)) {
+ p += 6;
+ s->off = strtoll(p, NULL, 10);
+ if ((slash = strchr(p, '/')) && strlen(slash) > 0)
+ s->filesize = strtoll(slash+1, NULL, 10);
+ }
+ if (s->seekable == -1 && (!s->is_akamai || s->filesize != 2147483647))
+ h->is_streamed = 0; /* we _can_ in fact seek */
+}
+
+static int parse_content_encoding(URLContext *h, const char *p)
+{
+ HTTPContext *s = h->priv_data;
+
+ if (!av_strncasecmp(p, "gzip", 4) ||
+ !av_strncasecmp(p, "deflate", 7)) {
+#if CONFIG_ZLIB
+ s->compressed = 1;
+ inflateEnd(&s->inflate_stream);
+ if (inflateInit2(&s->inflate_stream, 32 + 15) != Z_OK) {
+ av_log(h, AV_LOG_WARNING, "Error during zlib initialisation: %s\n",
+ s->inflate_stream.msg);
+ return AVERROR(ENOSYS);
+ }
+ if (zlibCompileFlags() & (1 << 17)) {
+ av_log(h, AV_LOG_WARNING,
+ "Your zlib was compiled without gzip support.\n");
+ return AVERROR(ENOSYS);
+ }
+#else
+ av_log(h, AV_LOG_WARNING,
+ "Compressed (%s) content, need zlib with gzip support\n", p);
+ return AVERROR(ENOSYS);
+#endif
+ } else if (!av_strncasecmp(p, "identity", 8)) {
+ // The normal, no-encoding case (although servers shouldn't include
+ // the header at all if this is the case).
+ } else {
+ av_log(h, AV_LOG_WARNING, "Unknown content coding: %s\n", p);
+ }
+ return 0;
+}
+
+// Concat all Icy- header lines
+static int parse_icy(HTTPContext *s, const char *tag, const char *p)
+{
+ int len = 4 + strlen(p) + strlen(tag);
+ int is_first = !s->icy_metadata_headers;
+ int ret;
+
+ if (s->icy_metadata_headers)
+ len += strlen(s->icy_metadata_headers);
+
+ if ((ret = av_reallocp(&s->icy_metadata_headers, len)) < 0)
+ return ret;
+
+ if (is_first)
+ *s->icy_metadata_headers = '\0';
+
+ av_strlcatf(s->icy_metadata_headers, len, "%s: %s\n", tag, p);
+
+ return 0;
+}
+
static int process_line(URLContext *h, char *line, int line_count,
int *new_location)
{
HTTPContext *s = h->priv_data;
char *tag, *p, *end;
+ int ret;
/* end of header */
if (line[0] == '\0') {
@@ -340,16 +450,8 @@ static int process_line(URLContext *h, char *line, int line_count,
av_log(h, AV_LOG_DEBUG, "http_code=%d\n", s->http_code);
- /* error codes are 4xx and 5xx, but regard 401 as a success, so we
- * don't abort until all headers have been parsed. */
- if (s->http_code >= 400 && s->http_code < 600 && (s->http_code != 401
- || s->auth_state.auth_type != HTTP_AUTH_NONE) &&
- (s->http_code != 407 || s->proxy_auth_state.auth_type != HTTP_AUTH_NONE)) {
- end += strspn(end, SPACE_CHARS);
- av_log(h, AV_LOG_WARNING, "HTTP error %d %s\n",
- s->http_code, end);
- return -1;
- }
+ if ((ret = check_http_code(h, s->http_code, end)) < 0)
+ return ret;
} else {
while (*p != '\0' && *p != ':')
p++;
@@ -362,40 +464,28 @@ static int process_line(URLContext *h, char *line, int line_count,
while (av_isspace(*p))
p++;
if (!av_strcasecmp(tag, "Location")) {
- char redirected_location[MAX_URL_SIZE], *new_loc;
- ff_make_absolute_url(redirected_location, sizeof(redirected_location),
- s->location, p);
- new_loc = av_strdup(redirected_location);
- if (!new_loc)
- return AVERROR(ENOMEM);
- av_free(s->location);
- s->location = new_loc;
+ if ((ret = parse_location(s, p)) < 0)
+ return ret;
*new_location = 1;
- } else if (!av_strcasecmp (tag, "Content-Length") && s->filesize == -1) {
+ } else if (!av_strcasecmp(tag, "Content-Length") && s->filesize == -1) {
s->filesize = strtoll(p, NULL, 10);
- } else if (!av_strcasecmp (tag, "Content-Range")) {
- /* "bytes $from-$to/$document_size" */
- const char *slash;
- if (!strncmp (p, "bytes ", 6)) {
- p += 6;
- s->off = strtoll(p, NULL, 10);
- if ((slash = strchr(p, '/')) && strlen(slash) > 0)
- s->filesize = strtoll(slash+1, NULL, 10);
- }
- if (s->seekable == -1 && (!s->is_akamai || s->filesize != 2147483647))
- h->is_streamed = 0; /* we _can_ in fact seek */
- } else if (!av_strcasecmp(tag, "Accept-Ranges") && !strncmp(p, "bytes", 5) && s->seekable == -1) {
+ } else if (!av_strcasecmp(tag, "Content-Range")) {
+ parse_content_range(h, p);
+ } else if (!av_strcasecmp(tag, "Accept-Ranges") &&
+ !strncmp(p, "bytes", 5) &&
+ s->seekable == -1) {
h->is_streamed = 0;
- } else if (!av_strcasecmp (tag, "Transfer-Encoding") && !av_strncasecmp(p, "chunked", 7)) {
+ } else if (!av_strcasecmp(tag, "Transfer-Encoding") &&
+ !av_strncasecmp(p, "chunked", 7)) {
s->filesize = -1;
s->chunksize = 0;
- } else if (!av_strcasecmp (tag, "WWW-Authenticate")) {
+ } else if (!av_strcasecmp(tag, "WWW-Authenticate")) {
ff_http_auth_handle_header(&s->auth_state, tag, p);
- } else if (!av_strcasecmp (tag, "Authentication-Info")) {
+ } else if (!av_strcasecmp(tag, "Authentication-Info")) {
ff_http_auth_handle_header(&s->auth_state, tag, p);
- } else if (!av_strcasecmp (tag, "Proxy-Authenticate")) {
+ } else if (!av_strcasecmp(tag, "Proxy-Authenticate")) {
ff_http_auth_handle_header(&s->proxy_auth_state, tag, p);
- } else if (!av_strcasecmp (tag, "Connection")) {
+ } else if (!av_strcasecmp(tag, "Connection")) {
if (!strcmp(p, "close"))
s->willclose = 1;
} else if (!av_strcasecmp (tag, "Server")) {
@@ -405,7 +495,8 @@ static int process_line(URLContext *h, char *line, int line_count,
s->is_mediagateway = 1;
}
} else if (!av_strcasecmp (tag, "Content-Type")) {
- av_free(s->mime_type); s->mime_type = av_strdup(p);
+ av_free(s->mime_type);
+ s->mime_type = av_strdup(p);
} else if (!av_strcasecmp (tag, "Set-Cookie")) {
if (!s->cookies) {
if (!(s->cookies = av_strdup(p)))
@@ -423,37 +514,11 @@ static int process_line(URLContext *h, char *line, int line_count,
} else if (!av_strcasecmp (tag, "Icy-MetaInt")) {
s->icy_metaint = strtoll(p, NULL, 10);
} else if (!av_strncasecmp(tag, "Icy-", 4)) {
- // Concat all Icy- header lines
- char *buf = av_asprintf("%s%s: %s\n",
- s->icy_metadata_headers ? s->icy_metadata_headers : "", tag, p);
- if (!buf)
- return AVERROR(ENOMEM);
- av_freep(&s->icy_metadata_headers);
- s->icy_metadata_headers = buf;
- } else if (!av_strcasecmp (tag, "Content-Encoding")) {
- if (!av_strncasecmp(p, "gzip", 4) || !av_strncasecmp(p, "deflate", 7)) {
-#if CONFIG_ZLIB
- s->compressed = 1;
- inflateEnd(&s->inflate_stream);
- if (inflateInit2(&s->inflate_stream, 32 + 15) != Z_OK) {
- av_log(h, AV_LOG_WARNING, "Error during zlib initialisation: %s\n",
- s->inflate_stream.msg);
- return AVERROR(ENOSYS);
- }
- if (zlibCompileFlags() & (1 << 17)) {
- av_log(h, AV_LOG_WARNING, "Your zlib was compiled without gzip support.\n");
- return AVERROR(ENOSYS);
- }
-#else
- av_log(h, AV_LOG_WARNING, "Compressed (%s) content, need zlib with gzip support\n", p);
- return AVERROR(ENOSYS);
-#endif
- } else if (!av_strncasecmp(p, "identity", 8)) {
- // The normal, no-encoding case (although servers shouldn't include
- // the header at all if this is the case).
- } else {
- av_log(h, AV_LOG_WARNING, "Unknown content coding: %s\n", p);
- }
+ if ((ret = parse_icy(s, tag, p)) < 0)
+ return ret;
+ } else if (!av_strcasecmp(tag, "Content-Encoding")) {
+ if ((ret = parse_content_encoding(h, p)) < 0)
+ return ret;
}
}
return 1;
@@ -488,8 +553,11 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path,
av_free(cpath);
cpath = av_strdup(&param[5]);
} else if (!av_strncasecmp("domain=", param, 7)) {
+ // if the cookie specifies a sub-domain, skip the leading dot thereby
+ // supporting URLs that point to sub-domains and the master domain
+ int leading_dot = (param[7] == '.');
av_free(cdomain);
- cdomain = av_strdup(&param[7]);
+ cdomain = av_strdup(&param[7+leading_dot]);
} else if (!av_strncasecmp("secure", param, 6) ||
!av_strncasecmp("comment", param, 7) ||
!av_strncasecmp("max-age", param, 7) ||
@@ -643,9 +711,15 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
// Note: we send this on purpose even when s->off is 0 when we're probing,
// since it allows us to detect more reliably if a (non-conforming)
// server supports seeking by analysing the reply headers.
- if (!has_header(s->headers, "\r\nRange: ") && !post && (s->off > 0 || s->seekable == -1))
+ if (!has_header(s->headers, "\r\nRange: ") && !post && (s->off > 0 || s->end_off || s->seekable == -1)) {
len += av_strlcatf(headers + len, sizeof(headers) - len,
- "Range: bytes=%"PRId64"-\r\n", s->off);
+ "Range: bytes=%"PRId64"-", s->off);
+ if (s->end_off)
+ len += av_strlcatf(headers + len, sizeof(headers) - len,
+ "%"PRId64, s->end_off - 1);
+ len += av_strlcpy(headers + len, "\r\n",
+ sizeof(headers) - len);
+ }
if (send_expect_100 && !has_header(s->headers, "\r\nExpect: "))
len += av_strlcatf(headers + len, sizeof(headers) - len,
"Expect: 100-continue\r\n");
@@ -666,12 +740,13 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
if (!has_header(s->headers, "\r\nContent-Length: ") && s->post_data)
len += av_strlcatf(headers + len, sizeof(headers) - len,
"Content-Length: %d\r\n", s->post_datalen);
+
if (!has_header(s->headers, "\r\nContent-Type: ") && s->content_type)
len += av_strlcatf(headers + len, sizeof(headers) - len,
"Content-Type: %s\r\n", s->content_type);
if (!has_header(s->headers, "\r\nCookie: ") && s->cookies) {
char *cookies = NULL;
- if (!get_cookies(s, &cookies, path, hoststr)) {
+ if (!get_cookies(s, &cookies, path, hoststr) && cookies) {
len += av_strlcatf(headers + len, sizeof(headers) - len,
"Cookie: %s\r\n", cookies);
av_free(cookies);
@@ -700,17 +775,14 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
authstr ? authstr : "",
proxyauthstr ? "Proxy-" : "", proxyauthstr ? proxyauthstr : "");
- av_freep(&authstr);
- av_freep(&proxyauthstr);
-
av_log(h, AV_LOG_DEBUG, "request: %s\n", s->buffer);
if ((err = ffurl_write(s->hd, s->buffer, strlen(s->buffer))) < 0)
- return err;
+ goto done;
if (s->post_data)
if ((err = ffurl_write(s->hd, s->post_data, s->post_datalen)) < 0)
- return err;
+ goto done;
/* init input buffer */
s->buf_ptr = s->buffer;
@@ -727,15 +799,20 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
* we've still to send the POST data, but the code calling this
* function will check http_code after we return. */
s->http_code = 200;
- return 0;
+ err = 0;
+ goto done;
}
/* wait for header */
err = http_read_header(h, new_location);
if (err < 0)
- return err;
+ goto done;
- return (off == s->off) ? 0 : -1;
+ err = (off == s->off) ? 0 : -1;
+done:
+ av_freep(&authstr);
+ av_freep(&proxyauthstr);
+ return err;
}
@@ -757,7 +834,6 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
}
if (len > 0) {
s->off += len;
- s->icy_data_read += len;
if (s->chunksize > 0)
s->chunksize -= len;
}
@@ -796,7 +872,7 @@ static int http_buf_read_compressed(URLContext *h, uint8_t *buf, int size)
}
#endif
-static int http_read(URLContext *h, uint8_t *buf, int size)
+static int http_read_stream(URLContext *h, uint8_t *buf, int size)
{
HTTPContext *s = h->priv_data;
int err, new_location;
@@ -814,7 +890,6 @@ static int http_read(URLContext *h, uint8_t *buf, int size)
if (!s->chunksize) {
char line[32];
- for(;;) {
do {
if ((err = http_get_line(s, line, sizeof(line))) < 0)
return err;
@@ -826,37 +901,9 @@ static int http_read(URLContext *h, uint8_t *buf, int size)
if (!s->chunksize)
return 0;
- break;
- }
}
size = FFMIN(size, s->chunksize);
}
- if (s->icy_metaint > 0) {
- int remaining = s->icy_metaint - s->icy_data_read; /* until next metadata packet */
- if (!remaining) {
- // The metadata packet is variable sized. It has a 1 byte header
- // which sets the length of the packet (divided by 16). If it's 0,
- // the metadata doesn't change. After the packet, icy_metaint bytes
- // of normal data follow.
- int ch = http_getc(s);
- if (ch < 0)
- return ch;
- if (ch > 0) {
- char data[255 * 16 + 1];
- int n;
- int ret;
- ch *= 16;
- for (n = 0; n < ch; n++)
- data[n] = http_getc(s);
- data[ch + 1] = 0;
- if ((ret = av_opt_set(s, "icy_metadata_packet", data, 0)) < 0)
- return ret;
- }
- s->icy_data_read = 0;
- remaining = s->icy_metaint;
- }
- size = FFMIN(size, remaining);
- }
#if CONFIG_ZLIB
if (s->compressed)
return http_buf_read_compressed(h, buf, size);
@@ -864,6 +911,72 @@ static int http_read(URLContext *h, uint8_t *buf, int size)
return http_buf_read(h, buf, size);
}
+// Like http_read_stream(), but no short reads.
+// Assumes partial reads are an error.
+static int http_read_stream_all(URLContext *h, uint8_t *buf, int size)
+{
+ int pos = 0;
+ while (pos < size) {
+ int len = http_read_stream(h, buf + pos, size - pos);
+ if (len < 0)
+ return len;
+ pos += len;
+ }
+ return pos;
+}
+
+static int store_icy(URLContext *h, int size)
+{
+ HTTPContext *s = h->priv_data;
+ /* until next metadata packet */
+ int remaining = s->icy_metaint - s->icy_data_read;
+
+ if (remaining < 0)
+ return AVERROR_INVALIDDATA;
+
+ if (!remaining) {
+ // The metadata packet is variable sized. It has a 1 byte header
+ // which sets the length of the packet (divided by 16). If it's 0,
+ // the metadata doesn't change. After the packet, icy_metaint bytes
+ // of normal data follow.
+ uint8_t ch;
+ int len = http_read_stream_all(h, &ch, 1);
+ if (len < 0)
+ return len;
+ if (ch > 0) {
+ char data[255 * 16 + 1];
+ int ret;
+ len = ch * 16;
+ ret = http_read_stream_all(h, data, len);
+ if (ret < 0)
+ return ret;
+ data[len + 1] = 0;
+ if ((ret = av_opt_set(s, "icy_metadata_packet", data, 0)) < 0)
+ return ret;
+ }
+ s->icy_data_read = 0;
+ remaining = s->icy_metaint;
+ }
+
+ return FFMIN(size, remaining);
+}
+
+static int http_read(URLContext *h, uint8_t *buf, int size)
+{
+ HTTPContext *s = h->priv_data;
+
+ if (s->icy_metaint > 0) {
+ size = store_icy(h, size);
+ if (size < 0)
+ return size;
+ }
+
+ size = http_read_stream(h, buf, size);
+ if (size > 0)
+ s->icy_data_read += size;
+ return size;
+}
+
/* used only when posting data */
static int http_write(URLContext *h, const uint8_t *buf, int size)
{
@@ -934,34 +1047,42 @@ static int64_t http_seek(URLContext *h, int64_t off, int whence)
URLContext *old_hd = s->hd;
int64_t old_off = s->off;
uint8_t old_buf[BUFFER_SIZE];
- int old_buf_size;
+ int old_buf_size, ret;
AVDictionary *options = NULL;
if (whence == AVSEEK_SIZE)
return s->filesize;
+ else if ((whence == SEEK_CUR && off == 0) ||
+ (whence == SEEK_SET && off == s->off))
+ return s->off;
else if ((s->filesize == -1 && whence == SEEK_END) || h->is_streamed)
- return -1;
+ return AVERROR(ENOSYS);
- /* we save the old context in case the seek fails */
- old_buf_size = s->buf_end - s->buf_ptr;
- memcpy(old_buf, s->buf_ptr, old_buf_size);
- s->hd = NULL;
if (whence == SEEK_CUR)
off += s->off;
else if (whence == SEEK_END)
off += s->filesize;
+ else if (whence != SEEK_SET)
+ return AVERROR(EINVAL);
+ if (off < 0)
+ return AVERROR(EINVAL);
s->off = off;
+ /* we save the old context in case the seek fails */
+ old_buf_size = s->buf_end - s->buf_ptr;
+ memcpy(old_buf, s->buf_ptr, old_buf_size);
+ s->hd = NULL;
+
/* if it fails, continue on old connection */
av_dict_copy(&options, s->chained_options, 0);
- if (http_open_cnx(h, &options) < 0) {
+ if ((ret = http_open_cnx(h, &options)) < 0) {
av_dict_free(&options);
memcpy(s->buffer, old_buf, old_buf_size);
s->buf_ptr = s->buffer;
s->buf_end = s->buffer + old_buf_size;
s->hd = old_hd;
s->off = old_off;
- return -1;
+ return ret;
}
av_dict_free(&options);
ffurl_close(old_hd);
diff --git a/chromium/third_party/ffmpeg/libavformat/httpauth.c b/chromium/third_party/ffmpeg/libavformat/httpauth.c
index 5ca48b9c1de..dbe3eff48f5 100644
--- a/chromium/third_party/ffmpeg/libavformat/httpauth.c
+++ b/chromium/third_party/ffmpeg/libavformat/httpauth.c
@@ -224,8 +224,11 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
av_strlcatf(authstr, len, ",nonce=\"%s\"", digest->nonce);
av_strlcatf(authstr, len, ",uri=\"%s\"", uri);
av_strlcatf(authstr, len, ",response=\"%s\"", response);
+
+ // we are violating the RFC and use "" because all others seem to do that too.
if (digest->algorithm[0])
- av_strlcatf(authstr, len, ",algorithm=%s", digest->algorithm);
+ av_strlcatf(authstr, len, ",algorithm=\"%s\"", digest->algorithm);
+
if (digest->opaque[0])
av_strlcatf(authstr, len, ",opaque=\"%s\"", digest->opaque);
if (digest->qop[0]) {
diff --git a/chromium/third_party/ffmpeg/libavformat/icodec.c b/chromium/third_party/ffmpeg/libavformat/icodec.c
index 4c038e96146..847f0eea2f0 100644
--- a/chromium/third_party/ffmpeg/libavformat/icodec.c
+++ b/chromium/third_party/ffmpeg/libavformat/icodec.c
@@ -58,7 +58,7 @@ static int read_header(AVFormatContext *s)
avio_skip(pb, 4);
ico->nb_images = avio_rl16(pb);
- ico->images = av_malloc(ico->nb_images * sizeof(IcoImage));
+ ico->images = av_malloc_array(ico->nb_images, sizeof(IcoImage));
if (!ico->images)
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavformat/icoenc.c b/chromium/third_party/ffmpeg/libavformat/icoenc.c
index 561c6cadcc9..dcf906513af 100644
--- a/chromium/third_party/ffmpeg/libavformat/icoenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/icoenc.c
@@ -101,7 +101,7 @@ static int ico_write_header(AVFormatContext *s)
avio_skip(pb, 16);
}
- ico->images = av_mallocz(ico->nb_images * sizeof(IcoMuxContext));
+ ico->images = av_mallocz_array(ico->nb_images, sizeof(IcoMuxContext));
if (!ico->images)
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavformat/id3v2.c b/chromium/third_party/ffmpeg/libavformat/id3v2.c
index 4bc76a321ca..fb89e83944b 100644
--- a/chromium/third_party/ffmpeg/libavformat/id3v2.c
+++ b/chromium/third_party/ffmpeg/libavformat/id3v2.c
@@ -59,6 +59,7 @@ const AVMetadataConv ff_id3v2_34_metadata_conv[] = {
};
const AVMetadataConv ff_id3v2_4_metadata_conv[] = {
+ { "TCMP", "compilation" },
{ "TDRL", "date" },
{ "TDRC", "date" },
{ "TDEN", "creation_time" },
@@ -71,6 +72,7 @@ const AVMetadataConv ff_id3v2_4_metadata_conv[] = {
static const AVMetadataConv id3v2_2_metadata_conv[] = {
{ "TAL", "album" },
{ "TCO", "genre" },
+ { "TCP", "compilation" },
{ "TT2", "title" },
{ "TEN", "encoded_by" },
{ "TP1", "artist" },
@@ -313,7 +315,7 @@ static void read_ttag(AVFormatContext *s, AVIOContext *pb, int taglen,
* Parse GEOB tag into a ID3v2ExtraMetaGEOB struct.
*/
static void read_geobtag(AVFormatContext *s, AVIOContext *pb, int taglen,
- char *tag, ID3v2ExtraMeta **extra_meta)
+ char *tag, ID3v2ExtraMeta **extra_meta, int isv34)
{
ID3v2ExtraMetaGEOB *geob_data = NULL;
ID3v2ExtraMeta *new_extra = NULL;
@@ -325,14 +327,14 @@ static void read_geobtag(AVFormatContext *s, AVIOContext *pb, int taglen,
geob_data = av_mallocz(sizeof(ID3v2ExtraMetaGEOB));
if (!geob_data) {
- av_log(s, AV_LOG_ERROR, "Failed to alloc %zu bytes\n",
+ av_log(s, AV_LOG_ERROR, "Failed to alloc %"SIZE_SPECIFIER" bytes\n",
sizeof(ID3v2ExtraMetaGEOB));
return;
}
new_extra = av_mallocz(sizeof(ID3v2ExtraMeta));
if (!new_extra) {
- av_log(s, AV_LOG_ERROR, "Failed to alloc %zu bytes\n",
+ av_log(s, AV_LOG_ERROR, "Failed to alloc %"SIZE_SPECIFIER" bytes\n",
sizeof(ID3v2ExtraMeta));
goto fail;
}
@@ -445,7 +447,7 @@ static void free_apic(void *obj)
}
static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen,
- char *tag, ID3v2ExtraMeta **extra_meta)
+ char *tag, ID3v2ExtraMeta **extra_meta, int isv34)
{
int enc, pic_type;
char mimetype[64];
@@ -467,7 +469,12 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen,
taglen--;
/* mimetype */
+ if (isv34) {
taglen -= avio_get_str(pb, taglen, mimetype, sizeof(mimetype));
+ } else {
+ avio_read(pb, mimetype, 3);
+ mimetype[3] = 0;
+ }
while (mime->id != AV_CODEC_ID_NONE) {
if (!av_strncasecmp(mime->str, mimetype, sizeof(mimetype))) {
id = mime->id;
@@ -518,7 +525,7 @@ fail:
avio_seek(pb, end, SEEK_SET);
}
-static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len, char *ttag, ID3v2ExtraMeta **extra_meta)
+static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len, char *ttag, ID3v2ExtraMeta **extra_meta, int isv34)
{
AVRational time_base = {1, 1000};
uint32_t start, end;
@@ -527,6 +534,14 @@ static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len, char *tta
int taglen;
char tag[5];
+ if (!s) {
+ /* We should probably just put the chapter data to extra_meta here
+ * and do the AVFormatContext-needing part in a separate
+ * ff_id3v2_parse_apic()-like function. */
+ av_log(NULL, AV_LOG_DEBUG, "No AVFormatContext, skipped ID3 chapter data\n");
+ return;
+ }
+
if (decode_str(s, pb, 0, &dst, &len) < 0)
return;
if (len < 16)
@@ -544,15 +559,14 @@ static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len, char *tta
len -= 16;
while (len > 10) {
- avio_read(pb, tag, 4);
+ if (avio_read(pb, tag, 4) < 4)
+ goto end;
tag[4] = 0;
taglen = avio_rb32(pb);
avio_skip(pb, 2);
len -= 10;
- if (taglen < 0 || taglen > len) {
- av_free(dst);
- return;
- }
+ if (taglen < 0 || taglen > len)
+ goto end;
if (tag[0] == 'T')
read_ttag(s, pb, taglen, &chapter->metadata, tag);
else
@@ -562,14 +576,60 @@ static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len, char *tta
ff_metadata_conv(&chapter->metadata, NULL, ff_id3v2_34_metadata_conv);
ff_metadata_conv(&chapter->metadata, NULL, ff_id3v2_4_metadata_conv);
+end:
av_free(dst);
}
+static void free_priv(void *obj)
+{
+ ID3v2ExtraMetaPRIV *priv = obj;
+ av_freep(&priv->owner);
+ av_freep(&priv->data);
+ av_freep(&priv);
+}
+
+static void read_priv(AVFormatContext *s, AVIOContext *pb, int taglen,
+ char *tag, ID3v2ExtraMeta **extra_meta, int isv34)
+{
+ ID3v2ExtraMeta *meta;
+ ID3v2ExtraMetaPRIV *priv;
+
+ meta = av_mallocz(sizeof(*meta));
+ priv = av_mallocz(sizeof(*priv));
+
+ if (!meta || !priv)
+ goto fail;
+
+ if (decode_str(s, pb, ID3v2_ENCODING_ISO8859, &priv->owner, &taglen) < 0)
+ goto fail;
+
+ priv->data = av_malloc(taglen);
+ if (!priv->data)
+ goto fail;
+
+ priv->datasize = taglen;
+
+ if (avio_read(pb, priv->data, priv->datasize) != priv->datasize)
+ goto fail;
+
+ meta->tag = "PRIV";
+ meta->data = priv;
+ meta->next = *extra_meta;
+ *extra_meta = meta;
+
+ return;
+
+fail:
+ if (priv)
+ free_priv(priv);
+ av_freep(&meta);
+}
+
typedef struct ID3v2EMFunc {
const char *tag3;
const char *tag4;
void (*read)(AVFormatContext *, AVIOContext *, int, char *,
- ID3v2ExtraMeta **);
+ ID3v2ExtraMeta **, int isv34);
void (*free)(void *obj);
} ID3v2EMFunc;
@@ -577,6 +637,7 @@ static const ID3v2EMFunc id3v2_extra_meta_funcs[] = {
{ "GEO", "GEOB", read_geobtag, free_geobtag },
{ "PIC", "APIC", read_apic, free_apic },
{ "CHAP","CHAP", read_chapter, NULL },
+ { "PRIV","PRIV", read_priv, free_priv },
{ NULL }
};
@@ -599,16 +660,17 @@ static const ID3v2EMFunc *get_extra_meta_func(const char *tag, int isv34)
return NULL;
}
-static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
+static void id3v2_parse(AVIOContext *pb, AVDictionary **metadata,
+ AVFormatContext *s, int len, uint8_t version,
uint8_t flags, ID3v2ExtraMeta **extra_meta)
{
int isv34, unsync;
unsigned tlen;
char tag[5];
- int64_t next, end = avio_tell(s->pb) + len;
+ int64_t next, end = avio_tell(pb) + len;
int taghdrlen;
const char *reason = NULL;
- AVIOContext pb;
+ AVIOContext pb_local;
AVIOContext *pbx;
unsigned char *buffer = NULL;
int buffer_size = 0;
@@ -642,7 +704,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
unsync = flags & 0x80;
if (isv34 && flags & 0x40) { /* Extended header present, just skip over it */
- int extlen = get_size(s->pb, 4);
+ int extlen = get_size(pb, 4);
if (version == 4)
/* In v2.4 the length includes the length field we just read. */
extlen -= 4;
@@ -651,7 +713,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
reason = "invalid extended header length";
goto error;
}
- avio_skip(s->pb, extlen);
+ avio_skip(pb, extlen);
len -= extlen + 4;
if (len < 0) {
reason = "extended header too long.";
@@ -667,18 +729,20 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
unsigned long dlen;
if (isv34) {
- avio_read(s->pb, tag, 4);
+ if (avio_read(pb, tag, 4) < 4)
+ break;
tag[4] = 0;
if (version == 3) {
- tlen = avio_rb32(s->pb);
+ tlen = avio_rb32(pb);
} else
- tlen = get_size(s->pb, 4);
- tflags = avio_rb16(s->pb);
+ tlen = get_size(pb, 4);
+ tflags = avio_rb16(pb);
tunsync = tflags & ID3v2_FLAG_UNSYNCH;
} else {
- avio_read(s->pb, tag, 3);
+ if (avio_read(pb, tag, 3) < 3)
+ break;
tag[3] = 0;
- tlen = avio_rb24(s->pb);
+ tlen = avio_rb24(pb);
}
if (tlen > (1<<28))
break;
@@ -687,7 +751,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
if (len < 0)
break;
- next = avio_tell(s->pb) + tlen;
+ next = avio_tell(pb) + tlen;
if (!tlen) {
if (tag[0])
@@ -699,7 +763,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
if (tflags & ID3v2_FLAG_DATALEN) {
if (tlen < 4)
break;
- dlen = avio_rb32(s->pb);
+ dlen = avio_rb32(pb);
tlen -= 4;
} else
dlen = tlen;
@@ -718,12 +782,12 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
type = "encrypted and compressed";
av_log(s, AV_LOG_WARNING, "Skipping %s ID3v2 frame %s.\n", type, tag);
- avio_skip(s->pb, tlen);
+ avio_skip(pb, tlen);
/* check for text tag or supported special meta tag */
} else if (tag[0] == 'T' ||
(extra_meta &&
(extra_func = get_extra_meta_func(tag, isv34)))) {
- pbx = s->pb;
+ pbx = pb;
if (unsync || tunsync || tcomp) {
av_fast_malloc(&buffer, &buffer_size, tlen);
@@ -733,23 +797,23 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
}
}
if (unsync || tunsync) {
- int64_t end = avio_tell(s->pb) + tlen;
+ int64_t end = avio_tell(pb) + tlen;
uint8_t *b;
b = buffer;
- while (avio_tell(s->pb) < end && b - buffer < tlen && !s->pb->eof_reached) {
- *b++ = avio_r8(s->pb);
- if (*(b - 1) == 0xff && avio_tell(s->pb) < end - 1 &&
+ while (avio_tell(pb) < end && b - buffer < tlen && !pb->eof_reached) {
+ *b++ = avio_r8(pb);
+ if (*(b - 1) == 0xff && avio_tell(pb) < end - 1 &&
b - buffer < tlen &&
- !s->pb->eof_reached ) {
- uint8_t val = avio_r8(s->pb);
- *b++ = val ? val : avio_r8(s->pb);
+ !pb->eof_reached ) {
+ uint8_t val = avio_r8(pb);
+ *b++ = val ? val : avio_r8(pb);
}
}
- ffio_init_context(&pb, buffer, b - buffer, 0, NULL, NULL, NULL,
+ ffio_init_context(&pb_local, buffer, b - buffer, 0, NULL, NULL, NULL,
NULL);
tlen = b - buffer;
- pbx = &pb; // read from sync buffer
+ pbx = &pb_local; // read from sync buffer
}
#if CONFIG_ZLIB
@@ -765,7 +829,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
}
if (!(unsync || tunsync)) {
- err = avio_read(s->pb, buffer, tlen);
+ err = avio_read(pb, buffer, tlen);
if (err < 0) {
av_log(s, AV_LOG_ERROR, "Failed to read compressed tag\n");
goto seek;
@@ -778,26 +842,26 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
av_log(s, AV_LOG_ERROR, "Failed to uncompress tag: %d\n", err);
goto seek;
}
- ffio_init_context(&pb, uncompressed_buffer, dlen, 0, NULL, NULL, NULL, NULL);
+ ffio_init_context(&pb_local, uncompressed_buffer, dlen, 0, NULL, NULL, NULL, NULL);
tlen = dlen;
- pbx = &pb; // read from sync buffer
+ pbx = &pb_local; // read from sync buffer
}
#endif
if (tag[0] == 'T')
/* parse text tag */
- read_ttag(s, pbx, tlen, &s->metadata, tag);
+ read_ttag(s, pbx, tlen, metadata, tag);
else
/* parse special meta tag */
- extra_func->read(s, pbx, tlen, tag, extra_meta);
+ extra_func->read(s, pbx, tlen, tag, extra_meta, isv34);
} else if (!tag[0]) {
if (tag[1])
av_log(s, AV_LOG_WARNING, "invalid frame id, assuming padding\n");
- avio_skip(s->pb, tlen);
+ avio_skip(pb, tlen);
break;
}
/* Skip to end of tag */
seek:
- avio_seek(s->pb, next, SEEK_SET);
+ avio_seek(pb, next, SEEK_SET);
}
/* Footer preset, always 10 bytes, skip over it */
@@ -808,26 +872,36 @@ error:
if (reason)
av_log(s, AV_LOG_INFO, "ID3v2.%d tag skipped, cannot handle %s\n",
version, reason);
- avio_seek(s->pb, end, SEEK_SET);
+ avio_seek(pb, end, SEEK_SET);
av_free(buffer);
av_free(uncompressed_buffer);
return;
}
-void ff_id3v2_read(AVFormatContext *s, const char *magic,
- ID3v2ExtraMeta **extra_meta)
+static void id3v2_read_internal(AVIOContext *pb, AVDictionary **metadata,
+ AVFormatContext *s, const char *magic,
+ ID3v2ExtraMeta **extra_meta, int64_t max_search_size)
{
int len, ret;
uint8_t buf[ID3v2_HEADER_SIZE];
int found_header;
- int64_t off;
+ int64_t start, off;
+
+ if (max_search_size && max_search_size < ID3v2_HEADER_SIZE)
+ return;
+ start = avio_tell(pb);
do {
/* save the current offset in case there's nothing to read/skip */
- off = avio_tell(s->pb);
- ret = avio_read(s->pb, buf, ID3v2_HEADER_SIZE);
+ off = avio_tell(pb);
+ if (max_search_size && off - start >= max_search_size - ID3v2_HEADER_SIZE) {
+ avio_seek(pb, off, SEEK_SET);
+ break;
+ }
+
+ ret = avio_read(pb, buf, ID3v2_HEADER_SIZE);
if (ret != ID3v2_HEADER_SIZE) {
- avio_seek(s->pb, off, SEEK_SET);
+ avio_seek(pb, off, SEEK_SET);
break;
}
found_header = ff_id3v2_match(buf, magic);
@@ -837,15 +911,27 @@ void ff_id3v2_read(AVFormatContext *s, const char *magic,
((buf[7] & 0x7f) << 14) |
((buf[8] & 0x7f) << 7) |
(buf[9] & 0x7f);
- id3v2_parse(s, len, buf[3], buf[5], extra_meta);
+ id3v2_parse(pb, metadata, s, len, buf[3], buf[5], extra_meta);
} else {
- avio_seek(s->pb, off, SEEK_SET);
+ avio_seek(pb, off, SEEK_SET);
}
} while (found_header);
- ff_metadata_conv(&s->metadata, NULL, ff_id3v2_34_metadata_conv);
- ff_metadata_conv(&s->metadata, NULL, id3v2_2_metadata_conv);
- ff_metadata_conv(&s->metadata, NULL, ff_id3v2_4_metadata_conv);
- merge_date(&s->metadata);
+ ff_metadata_conv(metadata, NULL, ff_id3v2_34_metadata_conv);
+ ff_metadata_conv(metadata, NULL, id3v2_2_metadata_conv);
+ ff_metadata_conv(metadata, NULL, ff_id3v2_4_metadata_conv);
+ merge_date(metadata);
+}
+
+void ff_id3v2_read_dict(AVIOContext *pb, AVDictionary **metadata,
+ const char *magic, ID3v2ExtraMeta **extra_meta)
+{
+ id3v2_read_internal(pb, metadata, NULL, magic, extra_meta, 0);
+}
+
+void ff_id3v2_read(AVFormatContext *s, const char *magic,
+ ID3v2ExtraMeta **extra_meta, unsigned int max_search_size)
+{
+ id3v2_read_internal(s->pb, &s->metadata, s, magic, extra_meta, max_search_size);
}
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
@@ -860,6 +946,8 @@ void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
av_freep(&current);
current = next;
}
+
+ *extra_meta = NULL;
}
int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
diff --git a/chromium/third_party/ffmpeg/libavformat/id3v2.h b/chromium/third_party/ffmpeg/libavformat/id3v2.h
index e893922133e..9d7bf1c03c1 100644
--- a/chromium/third_party/ffmpeg/libavformat/id3v2.h
+++ b/chromium/third_party/ffmpeg/libavformat/id3v2.h
@@ -73,6 +73,12 @@ typedef struct ID3v2ExtraMetaAPIC {
enum AVCodecID id;
} ID3v2ExtraMetaAPIC;
+typedef struct ID3v2ExtraMetaPRIV {
+ uint8_t *owner;
+ uint8_t *data;
+ uint32_t datasize;
+} ID3v2ExtraMetaPRIV;
+
/**
* Detect ID3v2 Header.
* @param buf must be ID3v2_HEADER_SIZE byte long
@@ -89,11 +95,27 @@ int ff_id3v2_match(const uint8_t *buf, const char *magic);
int ff_id3v2_tag_len(const uint8_t *buf);
/**
- * Read an ID3v2 tag, including supported extra metadata
+ * Read an ID3v2 tag into specified dictionary and retrieve supported extra metadata.
+ *
+ * Chapters are not currently read by this variant.
+ *
+ * @param metadata Parsed metadata is stored here
+ * @param extra_meta If not NULL, extra metadata is parsed into a list of
+ * ID3v2ExtraMeta structs and *extra_meta points to the head of the list
+ */
+void ff_id3v2_read_dict(AVIOContext *pb, AVDictionary **metadata, const char *magic, ID3v2ExtraMeta **extra_meta);
+
+/**
+ * Read an ID3v2 tag, including supported extra metadata and chapters.
+ *
+ * Data is read from and stored to AVFormatContext.
+ *
* @param extra_meta If not NULL, extra metadata is parsed into a list of
* ID3v2ExtraMeta structs and *extra_meta points to the head of the list
+ * @param[opt] max_search_search restrict ID3 magic number search (bytes from start)
*/
-void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta);
+void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta,
+ unsigned int max_search_size);
/**
* Initialize an ID3v2 tag.
@@ -114,7 +136,7 @@ int ff_id3v2_write_apic(AVFormatContext *s, ID3v2EncContext *id3, AVPacket *pkt)
/**
* Finalize an opened ID3v2 tag.
*/
-void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb);
+void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb, int padding_bytes);
/**
* Write an ID3v2 tag containing all global metadata from s.
diff --git a/chromium/third_party/ffmpeg/libavformat/id3v2enc.c b/chromium/third_party/ffmpeg/libavformat/id3v2enc.c
index 60522444fc6..4d555b3d241 100644
--- a/chromium/third_party/ffmpeg/libavformat/id3v2enc.c
+++ b/chromium/third_party/ffmpeg/libavformat/id3v2enc.c
@@ -29,8 +29,6 @@
#include "avio_internal.h"
#include "id3v2.h"
-#define PADDING_BYTES 10
-
static void id3v2_put_size(AVIOContext *pb, int size)
{
avio_w8(pb, size >> 21 & 0x7f);
@@ -324,15 +322,23 @@ int ff_id3v2_write_apic(AVFormatContext *s, ID3v2EncContext *id3, AVPacket *pkt)
return 0;
}
-void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb)
+void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb,
+ int padding_bytes)
{
int64_t cur_pos;
- /* adding an arbitrary amount of padding bytes at the end of the
- * ID3 metadata fixes cover art display for some software (iTunes,
- * Traktor, Serato, Torq) */
- ffio_fill(pb, 0, PADDING_BYTES);
- id3->len += PADDING_BYTES;
+ if (padding_bytes < 0)
+ padding_bytes = 10;
+
+ /* The ID3v2.3 specification states that 28 bits are used to represent the
+ * size of the whole tag. Therefore the current size of the tag needs to be
+ * subtracted from the upper limit of 2^28-1 to clip the value correctly. */
+ /* The minimum of 10 is an arbitrary amount of padding at the end of the tag
+ * to fix cover art display with some software such as iTunes, Traktor,
+ * Serato, Torq. */
+ padding_bytes = av_clip(padding_bytes, 10, 268435455 - id3->len);
+ ffio_fill(pb, 0, padding_bytes);
+ id3->len += padding_bytes;
cur_pos = avio_tell(pb);
avio_seek(pb, id3->size_pos, SEEK_SET);
@@ -349,7 +355,7 @@ int ff_id3v2_write_simple(struct AVFormatContext *s, int id3v2_version,
ff_id3v2_start(&id3, s->pb, id3v2_version, magic);
if ((ret = ff_id3v2_write_metadata(s, &id3)) < 0)
return ret;
- ff_id3v2_finish(&id3, s->pb);
+ ff_id3v2_finish(&id3, s->pb, s->metadata_header_padding);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/idcin.c b/chromium/third_party/ffmpeg/libavformat/idcin.c
index f2d5548a4f1..cc25fb0e38d 100644
--- a/chromium/third_party/ffmpeg/libavformat/idcin.c
+++ b/chromium/third_party/ffmpeg/libavformat/idcin.c
@@ -205,15 +205,8 @@ static int idcin_read_header(AVFormatContext *s)
st->codec->height = height;
/* load up the Huffman tables into extradata */
- if (ff_alloc_extradata(st->codec, HUFFMAN_TABLE_SIZE))
- return AVERROR(ENOMEM);
- ret = avio_read(pb, st->codec->extradata, HUFFMAN_TABLE_SIZE);
- if (ret < 0) {
+ if ((ret = ff_get_extradata(st->codec, pb, HUFFMAN_TABLE_SIZE)) < 0)
return ret;
- } else if (ret != HUFFMAN_TABLE_SIZE) {
- av_log(s, AV_LOG_ERROR, "incomplete header\n");
- return AVERROR(EIO);
- }
if (idcin->audio_present) {
idcin->audio_present = 1;
diff --git a/chromium/third_party/ffmpeg/libavformat/idroqenc.c b/chromium/third_party/ffmpeg/libavformat/idroqenc.c
index 50c428046ba..28a3aba9d43 100644
--- a/chromium/third_party/ffmpeg/libavformat/idroqenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/idroqenc.c
@@ -25,9 +25,35 @@
static int roq_write_header(struct AVFormatContext *s)
{
- static const uint8_t header[] = {
- 0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00
+ uint8_t header[] = {
+ 0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, /* fps: */ 0x1E, 0x00
};
+ int n;
+ AVCodecContext *avctx;
+
+// set the actual fps
+ for(n=0;n<s->nb_streams;n++) {
+ if ((avctx=s->streams[n]->codec)->codec_type == AVMEDIA_TYPE_VIDEO) {
+ unsigned int fps;
+
+ if (avctx->time_base.num != 1) {
+ av_log(avctx, AV_LOG_ERROR, "Frame rate must be integer\n");
+ return AVERROR(EINVAL);
+ }
+
+ if ((fps=avctx->time_base.den) > 255) {
+ av_log(avctx, AV_LOG_ERROR, "Frame rate may not exceed 255fps\n");
+ return AVERROR(EINVAL);
+ }
+
+ if (fps != 30) {
+ av_log(avctx, AV_LOG_WARNING, "For vintage compatibility fps must be 30\n");
+ }
+
+ header[6] = fps;
+ break;
+ }
+ }
avio_write(s->pb, header, 8);
avio_flush(s->pb);
diff --git a/chromium/third_party/ffmpeg/libavformat/iff.c b/chromium/third_party/ffmpeg/libavformat/iff.c
index edf308b1355..62f0b8387c2 100644
--- a/chromium/third_party/ffmpeg/libavformat/iff.c
+++ b/chromium/third_party/ffmpeg/libavformat/iff.c
@@ -28,12 +28,15 @@
* http://wiki.multimedia.cx/index.php?title=IFF
*/
+#include <inttypes.h>
+
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "libavcodec/bytestream.h"
#include "avformat.h"
+#include "id3v2.h"
#include "internal.h"
#define ID_8SVX MKTAG('8','S','V','X')
@@ -55,8 +58,10 @@
#define ID_DEEP MKTAG('D','E','E','P')
#define ID_RGB8 MKTAG('R','G','B','8')
#define ID_RGBN MKTAG('R','G','B','N')
+#define ID_DSD MKTAG('D','S','D',' ')
#define ID_FORM MKTAG('F','O','R','M')
+#define ID_FRM8 MKTAG('F','R','M','8')
#define ID_ANNO MKTAG('A','N','N','O')
#define ID_AUTH MKTAG('A','U','T','H')
#define ID_CHRS MKTAG('C','H','R','S')
@@ -93,6 +98,7 @@ typedef enum {
} svx8_compression_type;
typedef struct {
+ int is_64bit; ///< chunk size is 64-bit
int64_t body_pos;
int64_t body_end;
uint32_t body_size;
@@ -118,7 +124,7 @@ static int get_metadata(AVFormatContext *s,
if (!buf)
return AVERROR(ENOMEM);
- if (avio_read(s->pb, buf, data_size) < 0) {
+ if (avio_read(s->pb, buf, data_size) != data_size) {
av_free(buf);
return AVERROR(EIO);
}
@@ -131,7 +137,7 @@ static int iff_probe(AVProbeData *p)
{
const uint8_t *d = p->buf;
- if ( AV_RL32(d) == ID_FORM &&
+ if ( (AV_RL32(d) == ID_FORM &&
(AV_RL32(d+8) == ID_8SVX ||
AV_RL32(d+8) == ID_16SV ||
AV_RL32(d+8) == ID_MAUD ||
@@ -140,11 +146,188 @@ static int iff_probe(AVProbeData *p)
AV_RL32(d+8) == ID_DEEP ||
AV_RL32(d+8) == ID_ILBM ||
AV_RL32(d+8) == ID_RGB8 ||
- AV_RL32(d+8) == ID_RGBN) )
+ AV_RL32(d+8) == ID_RGB8 ||
+ AV_RL32(d+8) == ID_RGBN)) ||
+ (AV_RL32(d) == ID_FRM8 && AV_RL32(d+12) == ID_DSD))
return AVPROBE_SCORE_MAX;
return 0;
}
+static const AVCodecTag dsd_codec_tags[] = {
+ { AV_CODEC_ID_DSD_MSBF, ID_DSD },
+ { AV_CODEC_ID_NONE, 0 },
+};
+
+
+#define DSD_SLFT MKTAG('S','L','F','T')
+#define DSD_SRGT MKTAG('S','R','G','T')
+#define DSD_MLFT MKTAG('M','L','F','T')
+#define DSD_MRGT MKTAG('M','R','G','T')
+#define DSD_C MKTAG('C',' ',' ',' ')
+#define DSD_LS MKTAG('L','S',' ',' ')
+#define DSD_RS MKTAG('R','S',' ',' ')
+#define DSD_LFE MKTAG('L','F','E',' ')
+
+static const uint32_t dsd_stereo[] = { DSD_SLFT, DSD_SRGT };
+static const uint32_t dsd_5point0[] = { DSD_MLFT, DSD_MRGT, DSD_C, DSD_LS, DSD_RS };
+static const uint32_t dsd_5point1[] = { DSD_MLFT, DSD_MRGT, DSD_C, DSD_LFE, DSD_LS, DSD_RS };
+
+typedef struct {
+ uint64_t layout;
+ const uint32_t * dsd_layout;
+} DSDLayoutDesc;
+
+static const DSDLayoutDesc dsd_channel_layout[] = {
+ { AV_CH_LAYOUT_STEREO, dsd_stereo },
+ { AV_CH_LAYOUT_5POINT0, dsd_5point0 },
+ { AV_CH_LAYOUT_5POINT1, dsd_5point1 },
+};
+
+static const uint64_t dsd_loudspeaker_config[] = {
+ AV_CH_LAYOUT_STEREO,
+ 0, 0,
+ AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1,
+};
+
+static const char * dsd_source_comment[] = {
+ "dsd_source_comment",
+ "analogue_source_comment",
+ "pcm_source_comment",
+};
+
+static const char * dsd_history_comment[] = {
+ "general_remark",
+ "operator_name",
+ "creating_machine",
+ "timezone",
+ "file_revision"
+};
+
+static int parse_dsd_diin(AVFormatContext *s, AVStream *st, uint64_t eof)
+{
+ AVIOContext *pb = s->pb;
+
+ while (avio_tell(pb) + 12 <= eof) {
+ uint32_t tag = avio_rl32(pb);
+ uint64_t size = avio_rb64(pb);
+ uint64_t orig_pos = avio_tell(pb);
+ const char * metadata_tag = NULL;
+
+ switch(tag) {
+ case MKTAG('D','I','A','R'): metadata_tag = "artist"; break;
+ case MKTAG('D','I','T','I'): metadata_tag = "title"; break;
+ }
+
+ if (metadata_tag && size > 4) {
+ unsigned int tag_size = avio_rb32(pb);
+ int ret = get_metadata(s, metadata_tag, FFMIN(tag_size, size - 4));
+ if (ret < 0) {
+ av_log(s, AV_LOG_ERROR, "cannot allocate metadata tag %s!\n", metadata_tag);
+ return ret;
+ }
+ }
+
+ avio_skip(pb, size - (avio_tell(pb) - orig_pos) + (size & 1));
+ }
+
+ return 0;
+}
+
+static int parse_dsd_prop(AVFormatContext *s, AVStream *st, uint64_t eof)
+{
+ AVIOContext *pb = s->pb;
+ char abss[24];
+ int hour, min, sec, i, ret, config;
+ int dsd_layout[6];
+ ID3v2ExtraMeta *id3v2_extra_meta;
+
+ while (avio_tell(pb) + 12 <= eof) {
+ uint32_t tag = avio_rl32(pb);
+ uint64_t size = avio_rb64(pb);
+ uint64_t orig_pos = avio_tell(pb);
+
+ switch(tag) {
+ case MKTAG('A','B','S','S'):
+ if (size < 8)
+ return AVERROR_INVALIDDATA;
+ hour = avio_rb16(pb);
+ min = avio_r8(pb);
+ sec = avio_r8(pb);
+ snprintf(abss, sizeof(abss), "%02dh:%02dm:%02ds:%d", hour, min, sec, avio_rb32(pb));
+ av_dict_set(&st->metadata, "absolute_start_time", abss, 0);
+ break;
+
+ case MKTAG('C','H','N','L'):
+ if (size < 2)
+ return AVERROR_INVALIDDATA;
+ st->codec->channels = avio_rb16(pb);
+ if (size < 2 + st->codec->channels * 4)
+ return AVERROR_INVALIDDATA;
+ st->codec->channel_layout = 0;
+ if (st->codec->channels > FF_ARRAY_ELEMS(dsd_layout)) {
+ avpriv_request_sample(s, "channel layout");
+ break;
+ }
+ for (i = 0; i < st->codec->channels; i++)
+ dsd_layout[i] = avio_rl32(pb);
+ for (i = 0; i < FF_ARRAY_ELEMS(dsd_channel_layout); i++) {
+ const DSDLayoutDesc * d = &dsd_channel_layout[i];
+ if (av_get_channel_layout_nb_channels(d->layout) == st->codec->channels &&
+ !memcmp(d->dsd_layout, dsd_layout, st->codec->channels * sizeof(uint32_t))) {
+ st->codec->channel_layout = d->layout;
+ break;
+ }
+ }
+ break;
+
+ case MKTAG('C','M','P','R'):
+ if (size < 4)
+ return AVERROR_INVALIDDATA;
+ st->codec->codec_id = ff_codec_get_id(dsd_codec_tags, avio_rl32(pb));
+ break;
+
+ case MKTAG('F','S',' ',' '):
+ if (size < 4)
+ return AVERROR_INVALIDDATA;
+ st->codec->sample_rate = avio_rb32(pb) / 8;
+ break;
+
+ case MKTAG('I','D','3',' '):
+ id3v2_extra_meta = NULL;
+ ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, size);
+ if (id3v2_extra_meta) {
+ if ((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0) {
+ ff_id3v2_free_extra_meta(&id3v2_extra_meta);
+ return ret;
+ }
+ ff_id3v2_free_extra_meta(&id3v2_extra_meta);
+ }
+
+ if (size < avio_tell(pb) - orig_pos) {
+ av_log(s, AV_LOG_ERROR, "id3 exceeds chunk size\n");
+ return AVERROR_INVALIDDATA;
+ }
+ break;
+
+ case MKTAG('L','S','C','O'):
+ if (size < 2)
+ return AVERROR_INVALIDDATA;
+ config = avio_rb16(pb);
+ if (config != 0xFFFF) {
+ if (config < FF_ARRAY_ELEMS(dsd_loudspeaker_config))
+ st->codec->channel_layout = dsd_loudspeaker_config[config];
+ if (!st->codec->channel_layout)
+ avpriv_request_sample(s, "loudspeaker configuration %d", config);
+ }
+ break;
+ }
+
+ avio_skip(pb, size - (avio_tell(pb) - orig_pos) + (size & 1));
+ }
+
+ return 0;
+}
+
static const uint8_t deep_rgb24[] = {0, 0, 0, 3, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
static const uint8_t deep_rgba[] = {0, 0, 0, 4, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
static const uint8_t deep_bgra[] = {0, 0, 0, 4, 0, 3, 0, 8, 0, 2, 0, 8, 0, 1, 0, 8};
@@ -157,7 +340,8 @@ static int iff_read_header(AVFormatContext *s)
AVIOContext *pb = s->pb;
AVStream *st;
uint8_t *buf;
- uint32_t chunk_id, data_size;
+ uint32_t chunk_id;
+ uint64_t data_size;
uint32_t screenmode = 0, num, den;
unsigned transparency = 0;
unsigned masking = 0; // no mask
@@ -170,7 +354,8 @@ static int iff_read_header(AVFormatContext *s)
st->codec->channels = 1;
st->codec->channel_layout = AV_CH_LAYOUT_MONO;
- avio_skip(pb, 8);
+ iff->is_64bit = avio_rl32(pb) == ID_FRM8;
+ avio_skip(pb, iff->is_64bit ? 8 : 4);
// codec_tag used by ByteRun1 decoder to distinguish progressive (PBM) and interlaced (ILBM) content
st->codec->codec_tag = avio_rl32(pb);
iff->bitmap_compression = -1;
@@ -182,8 +367,9 @@ static int iff_read_header(AVFormatContext *s)
uint64_t orig_pos;
int res;
const char *metadata_tag = NULL;
+ int version, nb_comments, i;
chunk_id = avio_rl32(pb);
- data_size = avio_rb32(pb);
+ data_size = iff->is_64bit ? avio_rb64(pb) : avio_rb32(pb);
orig_pos = avio_tell(pb);
switch(chunk_id) {
@@ -225,6 +411,7 @@ static int iff_read_header(AVFormatContext *s)
case ID_ABIT:
case ID_BODY:
case ID_DBOD:
+ case ID_DSD:
case ID_MDAT:
iff->body_pos = avio_tell(pb);
iff->body_end = iff->body_pos + data_size;
@@ -251,7 +438,7 @@ static int iff_read_header(AVFormatContext *s)
case ID_CMAP:
if (data_size < 3 || data_size > 768 || data_size % 3) {
- av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %d\n",
+ av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %"PRIu64"\n",
data_size);
return AVERROR_INVALIDDATA;
}
@@ -338,6 +525,84 @@ static int iff_read_header(AVFormatContext *s)
case ID_AUTH: metadata_tag = "artist"; break;
case ID_COPYRIGHT: metadata_tag = "copyright"; break;
case ID_NAME: metadata_tag = "title"; break;
+
+ /* DSD tags */
+
+ case MKTAG('F','V','E','R'):
+ if (data_size < 4)
+ return AVERROR_INVALIDDATA;
+ version = avio_rb32(pb);
+ av_log(s, AV_LOG_DEBUG, "DSIFF v%d.%d.%d.%d\n",version >> 24, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ break;
+
+ case MKTAG('D','I','I','N'):
+ res = parse_dsd_diin(s, st, orig_pos + data_size);
+ if (res < 0)
+ return res;
+ break;
+
+ case MKTAG('P','R','O','P'):
+ if (data_size < 4)
+ return AVERROR_INVALIDDATA;
+ if (avio_rl32(pb) != MKTAG('S','N','D',' ')) {
+ avpriv_request_sample(s, "unknown property type");
+ break;
+ }
+ res = parse_dsd_prop(s, st, orig_pos + data_size);
+ if (res < 0)
+ return res;
+ break;
+
+ case MKTAG('C','O','M','T'):
+ if (data_size < 2)
+ return AVERROR_INVALIDDATA;
+ nb_comments = avio_rb16(pb);
+ for (i = 0; i < nb_comments; i++) {
+ int year, mon, day, hour, min, type, ref;
+ char tmp[24];
+ const char *tag;
+ int metadata_size;
+
+ year = avio_rb16(pb);
+ mon = avio_r8(pb);
+ day = avio_r8(pb);
+ hour = avio_r8(pb);
+ min = avio_r8(pb);
+ snprintf(tmp, sizeof(tmp), "%04d-%02d-%02d %02d:%02d", year, mon, day, hour, min);
+ av_dict_set(&st->metadata, "comment_time", tmp, 0);
+
+ type = avio_rb16(pb);
+ ref = avio_rb16(pb);
+ switch (type) {
+ case 1:
+ if (!i)
+ tag = "channel_comment";
+ else {
+ snprintf(tmp, sizeof(tmp), "channel%d_comment", ref);
+ tag = tmp;
+ }
+ break;
+ case 2:
+ tag = ref < FF_ARRAY_ELEMS(dsd_source_comment) ? dsd_history_comment[ref] : "source_comment";
+ break;
+ case 3:
+ tag = ref < FF_ARRAY_ELEMS(dsd_history_comment) ? dsd_history_comment[ref] : "file_history";
+ break;
+ default:
+ tag = "comment";
+ }
+
+ metadata_size = avio_rb32(pb);
+ if ((res = get_metadata(s, tag, metadata_size)) < 0) {
+ av_log(s, AV_LOG_ERROR, "cannot allocate metadata tag %s!\n", tag);
+ return res;
+ }
+
+ if (metadata_size & 1)
+ avio_skip(pb, 1);
+ }
+ break;
}
if (metadata_tag) {
@@ -370,28 +635,22 @@ static int iff_read_header(AVFormatContext *s)
avpriv_request_sample(s, "compression %d and bit depth %d", iff->maud_compression, iff->maud_bits);
return AVERROR_PATCHWELCOME;
}
-
- st->codec->bits_per_coded_sample =
- av_get_bits_per_sample(st->codec->codec_id);
-
- st->codec->block_align =
- st->codec->bits_per_coded_sample * st->codec->channels / 8;
- } else {
- switch (iff->svx8_compression) {
- case COMP_NONE:
- st->codec->codec_id = AV_CODEC_ID_PCM_S8_PLANAR;
- break;
- case COMP_FIB:
- st->codec->codec_id = AV_CODEC_ID_8SVX_FIB;
- break;
- case COMP_EXP:
- st->codec->codec_id = AV_CODEC_ID_8SVX_EXP;
- break;
- default:
- av_log(s, AV_LOG_ERROR,
- "Unknown SVX8 compression method '%d'\n", iff->svx8_compression);
- return -1;
- }
+ } else if (st->codec->codec_tag != ID_DSD) {
+ switch (iff->svx8_compression) {
+ case COMP_NONE:
+ st->codec->codec_id = AV_CODEC_ID_PCM_S8_PLANAR;
+ break;
+ case COMP_FIB:
+ st->codec->codec_id = AV_CODEC_ID_8SVX_FIB;
+ break;
+ case COMP_EXP:
+ st->codec->codec_id = AV_CODEC_ID_8SVX_EXP;
+ break;
+ default:
+ av_log(s, AV_LOG_ERROR,
+ "Unknown SVX8 compression method '%d'\n", iff->svx8_compression);
+ return -1;
+ }
}
st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id);
@@ -447,7 +706,7 @@ static int iff_read_packet(AVFormatContext *s,
return AVERROR_EOF;
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
- if (st->codec->codec_tag == ID_MAUD) {
+ if (st->codec->codec_tag == ID_DSD || st->codec->codec_tag == ID_MAUD) {
ret = av_get_packet(pb, pkt, FFMIN(iff->body_end - pos, 1024 * st->codec->block_align));
} else {
ret = av_get_packet(pb, pkt, iff->body_size);
@@ -462,6 +721,10 @@ static int iff_read_packet(AVFormatContext *s,
buf = pkt->data;
bytestream_put_be16(&buf, 2);
ret = avio_read(pb, buf, iff->body_size);
+ if (ret<0) {
+ av_free_packet(pkt);
+ } else if (ret < iff->body_size)
+ av_shrink_packet(pkt, ret + 2);
} else {
av_assert0(0);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/img2.c b/chromium/third_party/ffmpeg/libavformat/img2.c
index 7539359540e..80020549f63 100644
--- a/chromium/third_party/ffmpeg/libavformat/img2.c
+++ b/chromium/third_party/ffmpeg/libavformat/img2.c
@@ -32,6 +32,7 @@ static const IdStrMap img_tags[] = {
{ AV_CODEC_ID_MJPEG, "jpeg" },
{ AV_CODEC_ID_MJPEG, "jpg" },
{ AV_CODEC_ID_MJPEG, "jps" },
+ { AV_CODEC_ID_MJPEG, "mpo" },
{ AV_CODEC_ID_LJPEG, "ljpg" },
{ AV_CODEC_ID_JPEGLS, "jls" },
{ AV_CODEC_ID_PNG, "png" },
@@ -43,6 +44,7 @@ static const IdStrMap img_tags[] = {
{ AV_CODEC_ID_PGMYUV, "pgmyuv" },
{ AV_CODEC_ID_PBM, "pbm" },
{ AV_CODEC_ID_PAM, "pam" },
+ { AV_CODEC_ID_ALIAS_PIX, "pix" },
{ AV_CODEC_ID_MPEG1VIDEO, "mpg1-img" },
{ AV_CODEC_ID_MPEG2VIDEO, "mpg2-img" },
{ AV_CODEC_ID_MPEG4, "mpg4-img" },
@@ -55,8 +57,8 @@ static const IdStrMap img_tags[] = {
{ AV_CODEC_ID_TIFF, "tif" },
{ AV_CODEC_ID_SGI, "sgi" },
{ AV_CODEC_ID_PTX, "ptx" },
+ { AV_CODEC_ID_BRENDER_PIX,"pix" },
{ AV_CODEC_ID_PCX, "pcx" },
- { AV_CODEC_ID_BRENDER_PIX, "pix" },
{ AV_CODEC_ID_SUNRAST, "sun" },
{ AV_CODEC_ID_SUNRAST, "ras" },
{ AV_CODEC_ID_SUNRAST, "rs" },
diff --git a/chromium/third_party/ffmpeg/libavformat/img2.h b/chromium/third_party/ffmpeg/libavformat/img2.h
new file mode 100644
index 00000000000..dc53c5cc510
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/img2.h
@@ -0,0 +1,61 @@
+/*
+ * Image format
+ * Copyright (c) 2014 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
+ */
+
+#ifndef AVFORMAT_IMG2_H
+#define AVFORMAT_IMG2_H
+
+#include <stdint.h>
+#include "avformat.h"
+
+#if HAVE_GLOB
+#include <glob.h>
+#endif
+
+typedef struct {
+ const AVClass *class; /**< Class for private options. */
+ int img_first;
+ int img_last;
+ int img_number;
+ int64_t pts;
+ int img_count;
+ int is_pipe;
+ int split_planes; /**< use independent file for each Y, U, V plane */
+ char path[1024];
+ char *pixel_format; /**< Set by a private option. */
+ int width, height; /**< Set by a private option. */
+ AVRational framerate; /**< Set by a private option. */
+ int loop;
+ enum { PT_GLOB_SEQUENCE, PT_GLOB, PT_SEQUENCE } pattern_type;
+ int use_glob;
+#if HAVE_GLOB
+ glob_t globstate;
+#endif
+ int start_number;
+ int start_number_range;
+ int frame_size;
+ int ts_from_file;
+} VideoDemuxData;
+
+int ff_img_read_header(AVFormatContext *s1);
+
+int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt);
+
+#endif
diff --git a/chromium/third_party/ffmpeg/libavformat/img2_alias_pix.c b/chromium/third_party/ffmpeg/libavformat/img2_alias_pix.c
new file mode 100644
index 00000000000..a3d5cfa0c4b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/img2_alias_pix.c
@@ -0,0 +1,65 @@
+/*
+ * Alias PIX image demuxer
+ * Copyright (c) 2014 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 "img2.h"
+#include "libavcodec/bytestream.h"
+
+static int brender_read_probe(AVProbeData *p)
+{
+ const uint8_t *b = p->buf;
+ const uint8_t *end = b + p->buf_size;
+ int width = bytestream_get_be16(&b);
+ int height = bytestream_get_be16(&b);
+ av_unused int ox = bytestream_get_be16(&b);
+ av_unused int oy = bytestream_get_be16(&b);
+ int bpp = bytestream_get_be16(&b);
+ int x, y;
+
+ if (!width || !height)
+ return 0;
+
+ if (bpp != 24 && bpp != 8)
+ return 0;
+
+ for (y=0; y<2 && y<height; y++) {
+ for (x=0; x<width; ) {
+ int count = *b++;
+ if (count == 0 || x + count > width)
+ return 0;
+ if (b > end)
+ return AVPROBE_SCORE_MAX / 8;
+ b += bpp / 8;
+ x += count;
+ }
+ }
+
+ return AVPROBE_SCORE_EXTENSION + 1;
+}
+
+AVInputFormat ff_image2_alias_pix_demuxer = {
+ .name = "alias_pix",
+ .long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"),
+ .priv_data_size = sizeof(VideoDemuxData),
+ .read_probe = brender_read_probe,
+ .read_header = ff_img_read_header,
+ .read_packet = ff_img_read_packet,
+ .raw_codec_id = AV_CODEC_ID_ALIAS_PIX,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/img2_brender_pix.c b/chromium/third_party/ffmpeg/libavformat/img2_brender_pix.c
new file mode 100644
index 00000000000..f7306267c4b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/img2_brender_pix.c
@@ -0,0 +1,49 @@
+/*
+ * BRender PIX image demuxer
+ * Copyright (c) 2014 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 "img2.h"
+#include "libavutil/intreadwrite.h"
+
+static int aliaspix_read_probe(AVProbeData *p)
+{
+ static const uint8_t brender_magic[16] = {
+ 0,0,0,0x12,0,0,0,8,0,0,0,2,0,0,0,2
+ };
+
+ if (memcmp(p->buf, brender_magic, sizeof(brender_magic)))
+ return 0;
+
+ if (AV_RB32(p->buf+16) != 0x03 &&
+ AV_RB32(p->buf+16) != 0x3D)
+ return 0;
+
+ return AVPROBE_SCORE_MAX-10;
+}
+
+AVInputFormat ff_image2_brender_pix_demuxer = {
+ .name = "brender_pix",
+ .long_name = NULL_IF_CONFIG_SMALL("BRender PIX image"),
+ .priv_data_size = sizeof(VideoDemuxData),
+ .read_probe = aliaspix_read_probe,
+ .read_header = ff_img_read_header,
+ .read_packet = ff_img_read_packet,
+ .raw_codec_id = AV_CODEC_ID_BRENDER_PIX,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/img2dec.c b/chromium/third_party/ffmpeg/libavformat/img2dec.c
index 5163e69f65b..dc962dbb33a 100644
--- a/chromium/third_party/ffmpeg/libavformat/img2dec.c
+++ b/chromium/third_party/ffmpeg/libavformat/img2dec.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define _BSD_SOURCE
#include <sys/stat.h>
#include "libavutil/avstring.h"
#include "libavutil/log.h"
@@ -28,9 +29,9 @@
#include "libavutil/parseutils.h"
#include "avformat.h"
#include "internal.h"
-#if HAVE_GLOB
-#include <glob.h>
+#include "img2.h"
+#if HAVE_GLOB
/* Locally define as 0 (bitwise-OR no-op) any missing glob options that
are non-posix glibc/bsd extensions. */
#ifndef GLOB_NOMAGIC
@@ -42,31 +43,6 @@
#endif /* HAVE_GLOB */
-typedef struct {
- const AVClass *class; /**< Class for private options. */
- int img_first;
- int img_last;
- int img_number;
- int64_t pts;
- int img_count;
- int is_pipe;
- int split_planes; /**< use independent file for each Y, U, V plane */
- char path[1024];
- char *pixel_format; /**< Set by a private option. */
- int width, height; /**< Set by a private option. */
- AVRational framerate; /**< Set by a private option. */
- int loop;
- enum { PT_GLOB_SEQUENCE, PT_GLOB, PT_SEQUENCE } pattern_type;
- int use_glob;
-#if HAVE_GLOB
- glob_t globstate;
-#endif
- int start_number;
- int start_number_range;
- int frame_size;
- int ts_from_file;
-} VideoDemuxData;
-
static const int sizes[][2] = {
{ 640, 480 },
{ 720, 480 },
@@ -192,7 +168,7 @@ static int img_read_probe(AVProbeData *p)
return 0;
}
-static int img_read_header(AVFormatContext *s1)
+int ff_img_read_header(AVFormatContext *s1)
{
VideoDemuxData *s = s1->priv_data;
int first_index, last_index;
@@ -225,7 +201,13 @@ static int img_read_header(AVFormatContext *s1)
st->need_parsing = AVSTREAM_PARSE_FULL;
}
- if (s->ts_from_file)
+ if (s->ts_from_file == 2) {
+#if !HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
+ av_log(s1, AV_LOG_ERROR, "POSIX.1-2008 not supported, nanosecond file timestamps unavailable\n");
+ return AVERROR(ENOSYS);
+#endif
+ avpriv_set_pts_info(st, 64, 1, 1000000000);
+ } else if (s->ts_from_file)
avpriv_set_pts_info(st, 64, 1, 1);
else
avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num);
@@ -313,6 +295,9 @@ static int img_read_header(AVFormatContext *s1)
} else if (s1->audio_codec_id) {
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = s1->audio_codec_id;
+ } else if (s1->iformat->raw_codec_id) {
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ st->codec->codec_id = s1->iformat->raw_codec_id;
} else {
const char *str = strrchr(s->path, '.');
s->split_planes = str && !av_strcasecmp(str + 1, "y");
@@ -320,6 +305,8 @@ static int img_read_header(AVFormatContext *s1)
st->codec->codec_id = ff_guess_image2_codec(s->path);
if (st->codec->codec_id == AV_CODEC_ID_LJPEG)
st->codec->codec_id = AV_CODEC_ID_MJPEG;
+ if (st->codec->codec_id == AV_CODEC_ID_ALIAS_PIX) // we cannot distingiush this from BRENDER_PIX
+ st->codec->codec_id = AV_CODEC_ID_NONE;
}
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
pix_fmt != AV_PIX_FMT_NONE)
@@ -328,7 +315,7 @@ static int img_read_header(AVFormatContext *s1)
return 0;
}
-static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
+int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
{
VideoDemuxData *s = s1->priv_data;
char filename_bytes[1024];
@@ -371,6 +358,27 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
filename[strlen(filename) - 1] = 'U' + i;
}
+ if (codec->codec_id == AV_CODEC_ID_NONE) {
+ AVProbeData pd;
+ AVInputFormat *ifmt;
+ uint8_t header[PROBE_BUF_MIN + AVPROBE_PADDING_SIZE];
+ int ret;
+ int score = 0;
+
+ ret = avio_read(f[0], header, PROBE_BUF_MIN);
+ if (ret < 0)
+ return ret;
+ memset(header + ret, 0, sizeof(header) - ret);
+ avio_skip(f[0], -ret);
+ pd.buf = header;
+ pd.buf_size = ret;
+ pd.filename = filename;
+
+ ifmt = av_probe_input_format3(&pd, 1, &score);
+ if (ifmt && ifmt->read_packet == ff_img_read_packet && ifmt->raw_codec_id)
+ codec->codec_id = ifmt->raw_codec_id;
+ }
+
if (codec->codec_id == AV_CODEC_ID_RAWVIDEO && !codec->width)
infer_size(&codec->width, &codec->height, size[0]);
} else {
@@ -393,6 +401,10 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
if (stat(filename, &img_stat))
return AVERROR(EIO);
pkt->pts = (int64_t)img_stat.st_mtime;
+#if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
+ if (s->ts_from_file == 2)
+ pkt->pts = 1000000000*pkt->pts + img_stat.st_mtim.tv_nsec;
+#endif
av_add_index_entry(s1->streams[0], s->img_number, pkt->pts, 0, 0, AVINDEX_KEYFRAME);
} else if (!s->is_pipe) {
pkt->pts = s->pts;
@@ -467,7 +479,10 @@ static const AVOption options[] = {
{ "start_number_range", "set range for looking at the first sequence number", OFFSET(start_number_range), AV_OPT_TYPE_INT, {.i64 = 5}, 1, INT_MAX, DEC },
{ "video_size", "set video size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC },
{ "frame_size", "force frame size in bytes", OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, DEC },
- { "ts_from_file", "set frame timestamp from file's one", OFFSET(ts_from_file), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, DEC },
+ { "ts_from_file", "set frame timestamp from file's one", OFFSET(ts_from_file), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 2, DEC, "ts_type" },
+ { "none", "none", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 2, DEC, "ts_type" },
+ { "sec", "second precision", 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 2, DEC, "ts_type" },
+ { "ns", "nano second precision", 0, AV_OPT_TYPE_CONST, {.i64 = 2 }, 0, 2, DEC, "ts_type" },
{ NULL },
};
@@ -483,8 +498,8 @@ AVInputFormat ff_image2_demuxer = {
.long_name = NULL_IF_CONFIG_SMALL("image2 sequence"),
.priv_data_size = sizeof(VideoDemuxData),
.read_probe = img_read_probe,
- .read_header = img_read_header,
- .read_packet = img_read_packet,
+ .read_header = ff_img_read_header,
+ .read_packet = ff_img_read_packet,
.read_close = img_read_close,
.read_seek = img_read_seek,
.flags = AVFMT_NOFILE,
@@ -502,8 +517,8 @@ AVInputFormat ff_image2pipe_demuxer = {
.name = "image2pipe",
.long_name = NULL_IF_CONFIG_SMALL("piped image2 sequence"),
.priv_data_size = sizeof(VideoDemuxData),
- .read_header = img_read_header,
- .read_packet = img_read_packet,
+ .read_header = ff_img_read_header,
+ .read_packet = ff_img_read_packet,
.priv_class = &img2pipe_class,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavformat/img2enc.c b/chromium/third_party/ffmpeg/libavformat/img2enc.c
index 3529e12c55b..37dfbecce31 100644
--- a/chromium/third_party/ffmpeg/libavformat/img2enc.c
+++ b/chromium/third_party/ffmpeg/libavformat/img2enc.c
@@ -194,7 +194,7 @@ AVOutputFormat ff_image2_muxer = {
.long_name = NULL_IF_CONFIG_SMALL("image2 sequence"),
.extensions = "bmp,dpx,jls,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png,"
"ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,im24,"
- "sunras,xbm,xface",
+ "sunras,webp,xbm,xface,pix,y",
.priv_data_size = sizeof(VideoMuxData),
.video_codec = AV_CODEC_ID_MJPEG,
.write_header = write_header,
diff --git a/chromium/third_party/ffmpeg/libavformat/internal.h b/chromium/third_party/ffmpeg/libavformat/internal.h
index edc6a11685c..66fb5d64af2 100644
--- a/chromium/third_party/ffmpeg/libavformat/internal.h
+++ b/chromium/third_party/ffmpeg/libavformat/internal.h
@@ -28,7 +28,7 @@
/** size of probe buffer, for guessing file type from file contents */
#define PROBE_BUF_MIN 2048
-#define PROBE_BUF_MAX (1<<20)
+#define PROBE_BUF_MAX (1 << 20)
#ifdef DEBUG
# define hex_dump_debug(class, buf, size) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size)
@@ -46,6 +46,16 @@ typedef struct CodecMime{
enum AVCodecID id;
} CodecMime;
+struct AVFormatInternal {
+ /**
+ * Number of streams relevant for interleaving.
+ * Muxing only.
+ */
+ int nb_interleaved_streams;
+
+ int inject_global_side_data;
+};
+
#ifdef __GNUC__
#define dynarray_add(tab, nb_ptr, elem)\
do {\
@@ -350,11 +360,11 @@ enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags);
/**
* Chooses a timebase for muxing the specified stream.
*
- * The choosen timebase allows sample accurate timestamps based
+ * The chosen timebase allows sample accurate timestamps based
* on the framerate or sample rate for audio streams. It also is
- * at least as precisse as 1/min_precission would be.
+ * at least as precise as 1/min_precision would be.
*/
-AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precission);
+AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precision);
/**
* Generate standard extradata for AVC-Intra based on width/height and field
@@ -372,6 +382,15 @@ int ff_generate_avci_extradata(AVStream *st);
int ff_alloc_extradata(AVCodecContext *avctx, int size);
/**
+ * Allocate extradata with additional FF_INPUT_BUFFER_PADDING_SIZE at end
+ * which is always set to 0 and fill it from pb.
+ *
+ * @param size size of extradata
+ * @return >= 0 if OK, AVERROR_xxx on error
+ */
+int ff_get_extradata(AVCodecContext *avctx, AVIOContext *pb, int size);
+
+/**
* add frame for rfps calculation.
*
* @param dts timestamp of the i-th frame
@@ -381,4 +400,18 @@ int ff_rfps_add_frame(AVFormatContext *ic, AVStream *st, int64_t dts);
void ff_rfps_calculate(AVFormatContext *ic);
+/**
+ * Flags for AVFormatContext.write_uncoded_frame()
+ */
+enum AVWriteUncodedFrameFlags {
+
+ /**
+ * Query whether the feature is possible on this stream.
+ * The frame argument is ignored.
+ */
+ AV_WRITE_UNCODED_FRAME_QUERY = 0x0001,
+
+};
+
+
#endif /* AVFORMAT_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/ipmovie.c b/chromium/third_party/ffmpeg/libavformat/ipmovie.c
index 368c05922da..4a766ef3bac 100644
--- a/chromium/third_party/ffmpeg/libavformat/ipmovie.c
+++ b/chromium/third_party/ffmpeg/libavformat/ipmovie.c
@@ -321,7 +321,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
case OPCODE_CREATE_TIMER:
av_dlog(NULL, "create timer\n");
- if ((opcode_version > 0) || (opcode_size > 6)) {
+ if ((opcode_version > 0) || (opcode_size != 6)) {
av_dlog(NULL, "bad create_timer opcode\n");
chunk_type = CHUNK_BAD;
break;
@@ -339,7 +339,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
case OPCODE_INIT_AUDIO_BUFFERS:
av_dlog(NULL, "initialize audio buffers\n");
- if ((opcode_version > 1) || (opcode_size > 10)) {
+ if (opcode_version > 1 || opcode_size > 10 || opcode_size < 6) {
av_dlog(NULL, "bad init_audio_buffers opcode\n");
chunk_type = CHUNK_BAD;
break;
@@ -376,7 +376,9 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
case OPCODE_INIT_VIDEO_BUFFERS:
av_dlog(NULL, "initialize video buffers\n");
- if ((opcode_version > 2) || (opcode_size > 8) || opcode_size < 4) {
+ if ((opcode_version > 2) || (opcode_size > 8) || opcode_size < 4
+ || opcode_version == 2 && opcode_size < 8
+ ) {
av_dlog(NULL, "bad init_video_buffers opcode\n");
chunk_type = CHUNK_BAD;
break;
@@ -449,8 +451,8 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
av_dlog(NULL, "set palette\n");
/* check for the logical maximum palette size
* (3 * 256 + 4 bytes) */
- if (opcode_size > 0x304) {
- av_dlog(NULL, "demux_ipmovie: set_palette opcode too large\n");
+ if (opcode_size > 0x304 || opcode_size < 4) {
+ av_dlog(NULL, "demux_ipmovie: set_palette opcode with invalid size\n");
chunk_type = CHUNK_BAD;
break;
}
@@ -463,7 +465,8 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
first_color = AV_RL16(&scratch[0]);
last_color = first_color + AV_RL16(&scratch[2]) - 1;
/* sanity check (since they are 16 bit values) */
- if ((first_color > 0xFF) || (last_color > 0xFF)) {
+ if ( (first_color > 0xFF) || (last_color > 0xFF)
+ || (last_color - first_color + 1)*3 + 4 > opcode_size) {
av_dlog(NULL, "demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
first_color, last_color);
chunk_type = CHUNK_BAD;
diff --git a/chromium/third_party/ffmpeg/libavformat/isom.c b/chromium/third_party/ffmpeg/libavformat/isom.c
index de9d20ccab2..b34398b4f3c 100644
--- a/chromium/third_party/ffmpeg/libavformat/isom.c
+++ b/chromium/third_party/ffmpeg/libavformat/isom.c
@@ -26,6 +26,8 @@
#include "isom.h"
#include "libavcodec/mpeg4audio.h"
#include "libavcodec/mpegaudiodata.h"
+#include "libavutil/avstring.h"
+#include "libavutil/intreadwrite.h"
/* http://www.mp4ra.org */
/* ordered by muxing preference */
@@ -33,6 +35,7 @@ const AVCodecTag ff_mp4_obj_type[] = {
{ AV_CODEC_ID_MOV_TEXT , 0x08 },
{ AV_CODEC_ID_MPEG4 , 0x20 },
{ AV_CODEC_ID_H264 , 0x21 },
+ { AV_CODEC_ID_HEVC , 0x23 },
{ AV_CODEC_ID_AAC , 0x40 },
{ AV_CODEC_ID_MP4ALS , 0x40 }, /* 14496-3 ALS */
{ AV_CODEC_ID_MPEG2VIDEO , 0x61 }, /* MPEG2 Main */
@@ -80,7 +83,7 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
{ AV_CODEC_ID_RAWVIDEO, MKTAG('A', 'B', 'G', 'R') },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('b', '1', '6', 'g') },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('b', '4', '8', 'r') },
- { AV_CODEC_ID_RAWVIDEO, MKTAG('b', 'x', 'b', 'g') },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG('b', 'x', 'b', 'g') }, /* BOXX */
{ AV_CODEC_ID_RAWVIDEO, MKTAG('b', 'x', 'r', 'g') },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('b', 'x', 'y', 'v') },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('N', 'O', '1', '6') },
@@ -151,8 +154,8 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
{ AV_CODEC_ID_RAWVIDEO, MKTAG('W', 'R', 'A', 'W') },
- { AV_CODEC_ID_HEVC, MKTAG('h', 'v', 'c', '1') }, /* HEVC/H.265 which indicates parameter sets shall not be in ES */
{ AV_CODEC_ID_HEVC, MKTAG('h', 'e', 'v', '1') }, /* HEVC/H.265 which indicates parameter sets may be in ES */
+ { AV_CODEC_ID_HEVC, MKTAG('h', 'v', 'c', '1') }, /* HEVC/H.265 which indicates parameter sets shall not be in ES */
{ AV_CODEC_ID_H264, MKTAG('a', 'v', 'c', '1') }, /* AVC-1/H.264 */
{ AV_CODEC_ID_H264, MKTAG('a', 'i', '5', 'p') }, /* AVC-Intra 50M 720p24/30/60 */
@@ -167,12 +170,12 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
{ AV_CODEC_ID_H264, MKTAG('a', 'i', '1', '3') }, /* AVC-Intra 100M 1080p24/30/60 */
{ AV_CODEC_ID_H264, MKTAG('a', 'i', '1', '5') }, /* AVC-Intra 100M 1080i50 */
{ AV_CODEC_ID_H264, MKTAG('a', 'i', '1', '6') }, /* AVC-Intra 100M 1080i60 */
- { AV_CODEC_ID_H264, MKTAG('a', 'i', 'v', 'x') }, /* XAVC 4:2:2 10bit */
{ AV_CODEC_ID_H264, MKTAG('A', 'V', 'i', 'n') }, /* AVC-Intra with implicit SPS/PPS */
+ { AV_CODEC_ID_H264, MKTAG('a', 'i', 'v', 'x') }, /* XAVC 4:2:2 10bit */
+ { AV_CODEC_ID_MPEG1VIDEO, MKTAG('m', '1', 'v', ' ') },
{ AV_CODEC_ID_MPEG1VIDEO, MKTAG('m', '1', 'v', '1') }, /* Apple MPEG-1 Camcorder */
{ AV_CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'e', 'g') }, /* MPEG */
- { AV_CODEC_ID_MPEG1VIDEO, MKTAG('m', '1', 'v', ' ') },
{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', '2', 'v', '1') }, /* Apple MPEG-2 Camcorder */
{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '1') }, /* MPEG2 HDV 720p30 */
{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '2') }, /* MPEG2 HDV 1080i60 */
@@ -218,6 +221,7 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'h', 'd') }, /* XDCAM HD 540p */
{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'h', '2') }, /* XDCAM HD422 540p */
{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('A', 'V', 'm', 'p') }, /* AVID IMX PAL */
+ { AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', '2', 'v') }, /* FCP5 */
{ AV_CODEC_ID_JPEG2000, MKTAG('m', 'j', 'p', '2') }, /* JPEG 2000 produced by FCP */
@@ -299,7 +303,7 @@ const AVCodecTag ff_codec_movaudio_tags[] = {
{ AV_CODEC_ID_QDM2, MKTAG('Q', 'D', 'M', '2') },
{ AV_CODEC_ID_QDMC, MKTAG('Q', 'D', 'M', 'C') },
{ AV_CODEC_ID_SPEEX, MKTAG('s', 'p', 'e', 'x') }, /* Flash Media Server */
- { AV_CODEC_ID_SPEEX, MKTAG('S', 'P', 'X', 'N') },
+ { AV_CODEC_ID_SPEEX, MKTAG('S', 'P', 'X', 'N') }, /* ZygoAudio (quality 10 mode) */
{ AV_CODEC_ID_WMAV2, MKTAG('W', 'M', 'A', '2') },
{ AV_CODEC_ID_EVRC, MKTAG('s', 'e', 'v', 'c') }, /* 3GPP2 */
{ AV_CODEC_ID_SMV, MKTAG('s', 's', 'm', 'v') }, /* 3GPP2 */
@@ -438,6 +442,7 @@ static const AVCodecTag mp4_audio_types[] = {
int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb)
{
int len, tag;
+ int ret;
int object_type_id = avio_r8(pb);
avio_r8(pb); /* stream type */
avio_rb24(pb); /* buffer size db */
@@ -457,11 +462,10 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext
if (!len || (uint64_t)len > (1<<30))
return -1;
av_free(st->codec->extradata);
- if (ff_alloc_extradata(st->codec, len))
- return AVERROR(ENOMEM);
- avio_read(pb, st->codec->extradata, len);
+ if ((ret = ff_get_extradata(st->codec, pb, len)) < 0)
+ return ret;
if (st->codec->codec_id == AV_CODEC_ID_AAC) {
- MPEG4AudioConfig cfg;
+ MPEG4AudioConfig cfg = {0};
avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
st->codec->extradata_size * 8, 1);
st->codec->channels = cfg.channels;
@@ -574,3 +578,12 @@ void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout)
avio_wb32(pb, 0); // mNumberChannelDescriptions
}
+const struct AVCodecTag *avformat_get_mov_video_tags(void)
+{
+ return ff_codec_movvideo_tags;
+}
+
+const struct AVCodecTag *avformat_get_mov_audio_tags(void)
+{
+ return ff_codec_movaudio_tags;
+}
diff --git a/chromium/third_party/ffmpeg/libavformat/isom.h b/chromium/third_party/ffmpeg/libavformat/isom.h
index 2834b11b3e8..a929ebf05ef 100644
--- a/chromium/third_party/ffmpeg/libavformat/isom.h
+++ b/chromium/third_party/ffmpeg/libavformat/isom.h
@@ -142,6 +142,9 @@ typedef struct MOVStreamContext {
int start_pad; ///< amount of samples to skip due to enc-dec delay
unsigned int rap_group_count;
MOVSbgp *rap_group;
+
+ int nb_frames_for_fps;
+ int64_t duration_for_fps;
} MOVStreamContext;
typedef struct MOVContext {
diff --git a/chromium/third_party/ffmpeg/libavformat/iss.c b/chromium/third_party/ffmpeg/libavformat/iss.c
index e4335b4cbfb..e9945313d69 100644
--- a/chromium/third_party/ffmpeg/libavformat/iss.c
+++ b/chromium/third_party/ffmpeg/libavformat/iss.c
@@ -76,14 +76,23 @@ static av_cold int iss_read_header(AVFormatContext *s)
get_token(pb, token, sizeof(token)); //"IMA_ADPCM_Sound"
get_token(pb, token, sizeof(token)); //packet size
- sscanf(token, "%d", &iss->packet_size);
+ if (sscanf(token, "%d", &iss->packet_size) != 1) {
+ av_log(s, AV_LOG_ERROR, "Failed parsing packet size\n");
+ return AVERROR_INVALIDDATA;
+ }
get_token(pb, token, sizeof(token)); //File ID
get_token(pb, token, sizeof(token)); //out size
get_token(pb, token, sizeof(token)); //stereo
- sscanf(token, "%d", &stereo);
+ if (sscanf(token, "%d", &stereo) != 1) {
+ av_log(s, AV_LOG_ERROR, "Failed parsing stereo flag\n");
+ return AVERROR_INVALIDDATA;
+ }
get_token(pb, token, sizeof(token)); //Unknown1
get_token(pb, token, sizeof(token)); //RateDivisor
- sscanf(token, "%d", &rate_divisor);
+ if (sscanf(token, "%d", &rate_divisor) != 1) {
+ av_log(s, AV_LOG_ERROR, "Failed parsing rate_divisor\n");
+ return AVERROR_INVALIDDATA;
+ }
get_token(pb, token, sizeof(token)); //Unknown2
get_token(pb, token, sizeof(token)); //Version ID
get_token(pb, token, sizeof(token)); //Size
diff --git a/chromium/third_party/ffmpeg/libavformat/jvdec.c b/chromium/third_party/ffmpeg/libavformat/jvdec.c
index 69ac8f27fd3..eab450d862b 100644
--- a/chromium/third_party/ffmpeg/libavformat/jvdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/jvdec.c
@@ -27,6 +27,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
+
#include "avformat.h"
#include "internal.h"
@@ -59,6 +60,15 @@ static int read_probe(AVProbeData *pd)
return 0;
}
+static int read_close(AVFormatContext *s)
+{
+ JVDemuxContext *jv = s->priv_data;
+
+ av_freep(&jv->frames);
+
+ return 0;
+}
+
static int read_header(AVFormatContext *s)
{
JVDemuxContext *jv = s->priv_data;
@@ -87,17 +97,18 @@ static int read_header(AVFormatContext *s)
avio_skip(pb, 4);
- ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- ast->codec->codec_id = AV_CODEC_ID_PCM_U8;
- ast->codec->codec_tag = 0; /* no fourcc */
- ast->codec->sample_rate = avio_rl16(pb);
- ast->codec->channels = 1;
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ ast->codec->codec_id = AV_CODEC_ID_PCM_U8;
+ ast->codec->codec_tag = 0; /* no fourcc */
+ ast->codec->sample_rate = avio_rl16(pb);
+ ast->codec->channels = 1;
ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
avio_skip(pb, 10);
- ast->index_entries = av_malloc(ast->nb_index_entries * sizeof(*ast->index_entries));
+ ast->index_entries = av_malloc(ast->nb_index_entries *
+ sizeof(*ast->index_entries));
if (!ast->index_entries)
return AVERROR(ENOMEM);
@@ -106,28 +117,41 @@ static int read_header(AVFormatContext *s)
return AVERROR(ENOMEM);
offset = 0x68 + ast->nb_index_entries * 16;
- for(i = 0; i < ast->nb_index_entries; i++) {
+ for (i = 0; i < ast->nb_index_entries; i++) {
AVIndexEntry *e = ast->index_entries + i;
JVFrame *jvf = jv->frames + i;
/* total frame size including audio, video, palette data and padding */
- e->size = avio_rl32(pb);
- e->timestamp = i;
- e->pos = offset;
- offset += e->size;
+ e->size = avio_rl32(pb);
+ e->timestamp = i;
+ e->pos = offset;
+ offset += e->size;
- jvf->audio_size = avio_rl32(pb);
- jvf->video_size = avio_rl32(pb);
+ jvf->audio_size = avio_rl32(pb);
+ jvf->video_size = avio_rl32(pb);
jvf->palette_size = avio_r8(pb) ? 768 : 0;
- jvf->video_size = FFMIN(FFMAX(jvf->video_size, 0),
- INT_MAX - JV_PREAMBLE_SIZE - jvf->palette_size);
+
+ if ((jvf->video_size | jvf->audio_size) & ~0xFFFFFF ||
+ e->size - jvf->audio_size
+ - jvf->video_size
+ - jvf->palette_size < 0) {
+ if (s->error_recognition & AV_EF_EXPLODE) {
+ read_close(s);
+ return AVERROR_INVALIDDATA;
+ }
+ jvf->audio_size =
+ jvf->video_size =
+ jvf->palette_size = 0;
+ }
+
if (avio_r8(pb))
- av_log(s, AV_LOG_WARNING, "unsupported audio codec\n");
+ av_log(s, AV_LOG_WARNING, "unsupported audio codec\n");
+
jvf->video_type = avio_r8(pb);
avio_skip(pb, 1);
e->timestamp = jvf->audio_size ? audio_pts : AV_NOPTS_VALUE;
- audio_pts += jvf->audio_size;
+ audio_pts += jvf->audio_size;
e->flags = jvf->video_type != 1 ? AVINDEX_KEYFRAME : 0;
}
@@ -146,10 +170,10 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
const AVIndexEntry *e = ast->index_entries + jv->pts;
const JVFrame *jvf = jv->frames + jv->pts;
- switch(jv->state) {
+ switch (jv->state) {
case JV_AUDIO:
jv->state++;
- if (jvf->audio_size ) {
+ if (jvf->audio_size) {
if (av_get_packet(s->pb, pkt, jvf->audio_size) < 0)
return AVERROR(ENOMEM);
pkt->stream_index = 0;
@@ -160,16 +184,22 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
case JV_VIDEO:
jv->state++;
if (jvf->video_size || jvf->palette_size) {
+ int ret;
int size = jvf->video_size + jvf->palette_size;
if (av_new_packet(pkt, size + JV_PREAMBLE_SIZE))
return AVERROR(ENOMEM);
AV_WL32(pkt->data, jvf->video_size);
- pkt->data[4] = jvf->video_type;
- if ((size = avio_read(pb, pkt->data + JV_PREAMBLE_SIZE, size)) < 0)
- return AVERROR(EIO);
-
- pkt->size = size + JV_PREAMBLE_SIZE;
+ pkt->data[4] = jvf->video_type;
+ ret = avio_read(pb, pkt->data + JV_PREAMBLE_SIZE, size);
+ if (ret < 0)
+ return ret;
+ if (ret < size) {
+ memset(pkt->data + JV_PREAMBLE_SIZE + ret, 0,
+ FF_INPUT_BUFFER_PADDING_SIZE);
+ pkt->flags |= AV_PKT_FLAG_CORRUPT;
+ }
+ pkt->size = ret + JV_PREAMBLE_SIZE;
pkt->stream_index = 1;
pkt->pts = jv->pts;
if (jvf->video_type != 1)
@@ -184,6 +214,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
}
}
+ if (s->pb->eof_reached)
+ return AVERROR_EOF;
+
return AVERROR(EIO);
}
@@ -194,10 +227,10 @@ static int read_seek(AVFormatContext *s, int stream_index,
AVStream *ast = s->streams[0];
int i;
- if (flags & (AVSEEK_FLAG_BYTE|AVSEEK_FLAG_FRAME))
+ if (flags & (AVSEEK_FLAG_BYTE | AVSEEK_FLAG_FRAME))
return AVERROR(ENOSYS);
- switch(stream_index) {
+ switch (stream_index) {
case 0:
i = av_index_search_timestamp(ast, ts, flags);
break;
@@ -218,15 +251,6 @@ static int read_seek(AVFormatContext *s, int stream_index,
return 0;
}
-static int read_close(AVFormatContext *s)
-{
- JVDemuxContext *jv = s->priv_data;
-
- av_freep(&jv->frames);
-
- return 0;
-}
-
AVInputFormat ff_jv_demuxer = {
.name = "jv",
.long_name = NULL_IF_CONFIG_SMALL("Bitmap Brothers JV"),
diff --git a/chromium/third_party/ffmpeg/libavformat/libmodplug.c b/chromium/third_party/ffmpeg/libavformat/libmodplug.c
index 836b7c2ec06..3f00dbf2a42 100644
--- a/chromium/third_party/ffmpeg/libavformat/libmodplug.c
+++ b/chromium/third_party/ffmpeg/libavformat/libmodplug.c
@@ -22,6 +22,7 @@
* @todo better probing than extensions matching
*/
+#define MODPLUG_STATIC
#include <libmodplug/modplug.h>
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
diff --git a/chromium/third_party/ffmpeg/libavformat/libnut.c b/chromium/third_party/ffmpeg/libavformat/libnut.c
index be8f3cb283e..4a9a21a7668 100644
--- a/chromium/third_party/ffmpeg/libavformat/libnut.c
+++ b/chromium/third_party/ffmpeg/libavformat/libnut.c
@@ -70,7 +70,7 @@ static int nut_write_header(AVFormatContext * avf) {
nut_stream_header_tt * s;
int i;
- priv->s = s = av_mallocz((avf->nb_streams + 1) * sizeof*s);
+ priv->s = s = av_mallocz_array(avf->nb_streams + 1, sizeof*s);
if(!s)
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavformat/librtmp.c b/chromium/third_party/ffmpeg/libavformat/librtmp.c
index 5b4c39dde5c..5172c5148ab 100644
--- a/chromium/third_party/ffmpeg/libavformat/librtmp.c
+++ b/chromium/third_party/ffmpeg/libavformat/librtmp.c
@@ -37,7 +37,16 @@ typedef struct LibRTMPContext {
const AVClass *class;
RTMP rtmp;
char *app;
+ char *conn;
+ char *subscribe;
char *playpath;
+ char *tcurl;
+ char *flashver;
+ char *swfurl;
+ char *swfverify;
+ char *pageurl;
+ char *client_buffer_time;
+ int live;
} LibRTMPContext;
static void rtmp_log(int level, const char *fmt, va_list args)
@@ -83,6 +92,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
RTMP *r = &ctx->rtmp;
int rc = 0, level;
char *filename = s->filename;
+ int len = strlen(s->filename) + 1;
switch (av_log_get_level()) {
default:
@@ -96,22 +106,111 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
RTMP_LogSetLevel(level);
RTMP_LogSetCallback(rtmp_log);
- if (ctx->app || ctx->playpath) {
- int len = strlen(s->filename) + 1;
- if (ctx->app) len += strlen(ctx->app) + sizeof(" app=");
- if (ctx->playpath) len += strlen(ctx->playpath) + sizeof(" playpath=");
+ if (ctx->app) len += strlen(ctx->app) + sizeof(" app=");
+ if (ctx->tcurl) len += strlen(ctx->tcurl) + sizeof(" tcUrl=");
+ if (ctx->pageurl) len += strlen(ctx->pageurl) + sizeof(" pageUrl=");
+ if (ctx->flashver) len += strlen(ctx->flashver) + sizeof(" flashver=");
+
+ if (ctx->conn) {
+ char *sep, *p = ctx->conn;
+ int options = 0;
+
+ while (p) {
+ options++;
+ p += strspn(p, " ");
+ if (!*p)
+ break;
+ sep = strchr(p, ' ');
+ if (sep)
+ p = sep + 1;
+ else
+ break;
+ }
+ len += options * sizeof(" conn=");
+ len += strlen(ctx->conn);
+ }
+
+ if (ctx->playpath)
+ len += strlen(ctx->playpath) + sizeof(" playpath=");
+ if (ctx->live)
+ len += sizeof(" live=1");
+ if (ctx->subscribe)
+ len += strlen(ctx->subscribe) + sizeof(" subscribe=");
- if (!(filename = av_malloc(len)))
- return AVERROR(ENOMEM);
+ if (ctx->client_buffer_time)
+ len += strlen(ctx->client_buffer_time) + sizeof(" buffer=");
- av_strlcpy(filename, s->filename, len);
- if (ctx->app) {
- av_strlcat(filename, " app=", len);
- av_strlcat(filename, ctx->app, len);
+ if (ctx->swfurl || ctx->swfverify) {
+ len += sizeof(" swfUrl=");
+
+ if (ctx->swfverify)
+ len += strlen(ctx->swfverify) + sizeof(" swfVfy=1");
+ else
+ len += strlen(ctx->swfurl);
+ }
+
+ if (!(filename = av_malloc(len)))
+ return AVERROR(ENOMEM);
+
+ av_strlcpy(filename, s->filename, len);
+ if (ctx->app) {
+ av_strlcat(filename, " app=", len);
+ av_strlcat(filename, ctx->app, len);
+ }
+ if (ctx->tcurl) {
+ av_strlcat(filename, " tcUrl=", len);
+ av_strlcat(filename, ctx->tcurl, len);
+ }
+ if (ctx->pageurl) {
+ av_strlcat(filename, " pageUrl=", len);
+ av_strlcat(filename, ctx->pageurl, len);
+ }
+ if (ctx->swfurl) {
+ av_strlcat(filename, " swfUrl=", len);
+ av_strlcat(filename, ctx->pageurl, len);
+ }
+ if (ctx->flashver) {
+ av_strlcat(filename, " flashVer=", len);
+ av_strlcat(filename, ctx->flashver, len);
+ }
+ if (ctx->conn) {
+ char *sep, *p = ctx->conn;
+ while (p) {
+ av_strlcat(filename, " conn=", len);
+ p += strspn(p, " ");
+ if (!*p)
+ break;
+ sep = strchr(p, ' ');
+ if (sep)
+ *sep = '\0';
+ av_strlcat(filename, p, len);
+
+ if (sep)
+ p = sep + 1;
}
- if (ctx->playpath) {
- av_strlcat(filename, " playpath=", len);
- av_strlcat(filename, ctx->playpath, len);
+ }
+ if (ctx->playpath) {
+ av_strlcat(filename, " playpath=", len);
+ av_strlcat(filename, ctx->playpath, len);
+ }
+ if (ctx->live)
+ av_strlcat(filename, " live=1", len);
+ if (ctx->subscribe) {
+ av_strlcat(filename, " subscribe=", len);
+ av_strlcat(filename, ctx->subscribe, len);
+ }
+ if (ctx->client_buffer_time) {
+ av_strlcat(filename, " buffer=", len);
+ av_strlcat(filename, ctx->client_buffer_time, len);
+ }
+ if (ctx->swfurl || ctx->swfverify) {
+ av_strlcat(filename, " swfUrl=", len);
+
+ if (ctx->swfverify) {
+ av_strlcat(filename, ctx->swfverify, len);
+ av_strlcat(filename, " swfVfy=1", len);
+ } else {
+ av_strlcat(filename, ctx->swfurl, len);
}
}
@@ -134,6 +233,9 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
fail:
if (filename != s->filename)
av_freep(&filename);
+ if (rc)
+ RTMP_Close(r);
+
return rc;
}
@@ -194,8 +296,20 @@ static int rtmp_get_file_handle(URLContext *s)
#define DEC AV_OPT_FLAG_DECODING_PARAM
#define ENC AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- {"rtmp_app", "Name of application to connect to on the RTMP server", OFFSET(app), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
- {"rtmp_playpath", "Stream identifier to play or to publish", OFFSET(playpath), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
+ {"rtmp_app", "Name of application to connect to on the RTMP server", OFFSET(app), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
+ {"rtmp_buffer", "Set buffer time in milliseconds. The default is 3000.", OFFSET(client_buffer_time), AV_OPT_TYPE_STRING, {.str = "3000"}, 0, 0, DEC|ENC},
+ {"rtmp_conn", "Append arbitrary AMF data to the Connect message", OFFSET(conn), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
+ {"rtmp_flashver", "Version of the Flash plugin used to run the SWF player.", OFFSET(flashver), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
+ {"rtmp_live", "Specify that the media is a live stream.", OFFSET(live), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC, "rtmp_live"},
+ {"any", "both", 0, AV_OPT_TYPE_CONST, {.i64 = -2}, 0, 0, DEC, "rtmp_live"},
+ {"live", "live stream", 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, DEC, "rtmp_live"},
+ {"recorded", "recorded stream", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, DEC, "rtmp_live"},
+ {"rtmp_pageurl", "URL of the web page in which the media was embedded. By default no value will be sent.", OFFSET(pageurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
+ {"rtmp_playpath", "Stream identifier to play or to publish", OFFSET(playpath), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
+ {"rtmp_subscribe", "Name of live stream to subscribe to. Defaults to rtmp_playpath.", OFFSET(subscribe), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
+ {"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
+ {"rtmp_swfverify", "URL to player swf file, compute hash/size automatically. (unimplemented)", OFFSET(swfverify), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
+ {"rtmp_tcurl", "URL of the target stream. Defaults to proto://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavformat/libssh.c b/chromium/third_party/ffmpeg/libavformat/libssh.c
index 4a9b8674cf4..b20e93bbab9 100644
--- a/chromium/third_party/ffmpeg/libavformat/libssh.c
+++ b/chromium/third_party/ffmpeg/libavformat/libssh.c
@@ -19,9 +19,11 @@
*/
#include <fcntl.h>
+#define LIBSSH_STATIC
#include <libssh/sftp.h>
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
+#include "libavutil/attributes.h"
#include "avformat.h"
#include "internal.h"
#include "url.h"
@@ -34,106 +36,179 @@ typedef struct {
int64_t filesize;
int rw_timeout;
int trunc;
+ char *priv_key;
} LIBSSHContext;
-static int libssh_close(URLContext *h)
+static av_cold int libssh_create_ssh_session(LIBSSHContext *libssh, const char* hostname, unsigned int port)
{
- LIBSSHContext *s = h->priv_data;
- if (s->file)
- sftp_close(s->file);
- if (s->sftp)
- sftp_free(s->sftp);
- if (s->session) {
- ssh_disconnect(s->session);
- ssh_free(s->session);
+ static const int verbosity = SSH_LOG_NOLOG;
+
+ if (!(libssh->session = ssh_new())) {
+ av_log(libssh, AV_LOG_ERROR, "SSH session creation failed: %s\n", ssh_get_error(libssh->session));
+ return AVERROR(ENOMEM);
+ }
+ ssh_options_set(libssh->session, SSH_OPTIONS_HOST, hostname);
+ ssh_options_set(libssh->session, SSH_OPTIONS_PORT, &port);
+ ssh_options_set(libssh->session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
+ if (libssh->rw_timeout > 0) {
+ long timeout = libssh->rw_timeout * 1000;
+ ssh_options_set(libssh->session, SSH_OPTIONS_TIMEOUT_USEC, &timeout);
+ }
+
+ if (ssh_connect(libssh->session) != SSH_OK) {
+ av_log(libssh, AV_LOG_ERROR, "Connection failed: %s\n", ssh_get_error(libssh->session));
+ return AVERROR(EIO);
}
+
return 0;
}
-static int libssh_open(URLContext *h, const char *url, int flags)
+static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user, const char *password)
{
- static const int verbosity = SSH_LOG_NOLOG;
- LIBSSHContext *s = h->priv_data;
- char proto[10], path[MAX_URL_SIZE], hostname[1024], credencials[1024];
- int port = 22, access, ret;
- long timeout = s->rw_timeout * 1000;
- const char *user = NULL, *pass = NULL;
- char *end = NULL;
- sftp_attributes stat;
+ int authorized = 0;
+ int auth_methods;
- av_url_split(proto, sizeof(proto),
- credencials, sizeof(credencials),
- hostname, sizeof(hostname),
- &port,
- path, sizeof(path),
- url);
+ if (user)
+ ssh_options_set(libssh->session, SSH_OPTIONS_USER, user);
- if (port <= 0 || port > 65535)
- port = 22;
+ auth_methods = ssh_userauth_list(libssh->session, NULL);
- if (!(s->session = ssh_new())) {
- ret = AVERROR(ENOMEM);
- goto fail;
+ if (auth_methods & SSH_AUTH_METHOD_PUBLICKEY) {
+ if (libssh->priv_key) {
+ ssh_string pub_key;
+ ssh_private_key priv_key;
+ int type;
+ if (!ssh_try_publickey_from_file(libssh->session, libssh->priv_key, &pub_key, &type)) {
+ priv_key = privatekey_from_file(libssh->session, libssh->priv_key, type, password);
+ if (ssh_userauth_pubkey(libssh->session, NULL, pub_key, priv_key) == SSH_AUTH_SUCCESS) {
+ av_log(libssh, AV_LOG_DEBUG, "Authentication successful with selected private key.\n");
+ authorized = 1;
+ }
+ } else {
+ av_log(libssh, AV_LOG_DEBUG, "Invalid key is provided.\n");
+ return AVERROR(EACCES);
+ }
+ } else if (ssh_userauth_autopubkey(libssh->session, password) == SSH_AUTH_SUCCESS) {
+ av_log(libssh, AV_LOG_DEBUG, "Authentication successful with auto selected key.\n");
+ authorized = 1;
+ }
}
- user = av_strtok(credencials, ":", &end);
- pass = av_strtok(end, ":", &end);
- ssh_options_set(s->session, SSH_OPTIONS_HOST, hostname);
- ssh_options_set(s->session, SSH_OPTIONS_PORT, &port);
- ssh_options_set(s->session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
- if (timeout > 0)
- ssh_options_set(s->session, SSH_OPTIONS_TIMEOUT_USEC, &timeout);
- if (user)
- ssh_options_set(s->session, SSH_OPTIONS_USER, user);
- if (ssh_connect(s->session) != SSH_OK) {
- av_log(h, AV_LOG_ERROR, "Connection failed. %s\n", ssh_get_error(s->session));
- ret = AVERROR(EIO);
- goto fail;
+ if (!authorized && (auth_methods & SSH_AUTH_METHOD_PASSWORD)) {
+ if (ssh_userauth_password(libssh->session, NULL, password) == SSH_AUTH_SUCCESS) {
+ av_log(libssh, AV_LOG_DEBUG, "Authentication successful with password.\n");
+ authorized = 1;
+ }
}
- if (pass && ssh_userauth_password(s->session, NULL, pass) != SSH_AUTH_SUCCESS) {
- av_log(h, AV_LOG_ERROR, "Error authenticating with password: %s\n", ssh_get_error(s->session));
- ret = AVERROR(EACCES);
- goto fail;
+ if (!authorized) {
+ av_log(libssh, AV_LOG_ERROR, "Authentication failed.\n");
+ return AVERROR(EACCES);
}
- if (!(s->sftp = sftp_new(s->session))) {
- av_log(h, AV_LOG_ERROR, "SFTP session creation failed: %s\n", ssh_get_error(s->session));
- ret = AVERROR(ENOMEM);
- goto fail;
+ return 0;
+}
+
+static av_cold int libssh_create_sftp_session(LIBSSHContext *libssh)
+{
+ if (!(libssh->sftp = sftp_new(libssh->session))) {
+ av_log(libssh, AV_LOG_ERROR, "SFTP session creation failed: %s\n", ssh_get_error(libssh->session));
+ return AVERROR(ENOMEM);
}
- if (sftp_init(s->sftp) != SSH_OK) {
- av_log(h, AV_LOG_ERROR, "Error initializing sftp session: %s\n", ssh_get_error(s->session));
- ret = AVERROR(EIO);
- goto fail;
+ if (sftp_init(libssh->sftp) != SSH_OK) {
+ av_log(libssh, AV_LOG_ERROR, "Error initializing sftp session: %s\n", ssh_get_error(libssh->session));
+ return AVERROR(EIO);
}
+ return 0;
+}
+
+static av_cold int libssh_open_file(LIBSSHContext *libssh, int flags, const char *file)
+{
+ int access;
+
if ((flags & AVIO_FLAG_WRITE) && (flags & AVIO_FLAG_READ)) {
access = O_CREAT | O_RDWR;
- if (s->trunc)
+ if (libssh->trunc)
access |= O_TRUNC;
} else if (flags & AVIO_FLAG_WRITE) {
access = O_CREAT | O_WRONLY;
- if (s->trunc)
+ if (libssh->trunc)
access |= O_TRUNC;
- } else {
+ } else
access = O_RDONLY;
- }
- if (!(s->file = sftp_open(s->sftp, path, access, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH))) {
- av_log(h, AV_LOG_ERROR, "Error opening sftp file: %s\n", ssh_get_error(s->session));
- ret = AVERROR(EIO);
- goto fail;
+ /* 0666 = -rw-rw-rw- = read+write for everyone, minus umask */
+ if (!(libssh->file = sftp_open(libssh->sftp, file, access, 0666))) {
+ av_log(libssh, AV_LOG_ERROR, "Error opening sftp file: %s\n", ssh_get_error(libssh->session));
+ return AVERROR(EIO);
}
- if (!(stat = sftp_fstat(s->file))) {
- av_log(h, AV_LOG_WARNING, "Cannot stat remote file %s.\n", path);
- s->filesize = -1;
+ return 0;
+}
+
+static av_cold void libssh_stat_file(LIBSSHContext *libssh)
+{
+ sftp_attributes stat;
+
+ if (!(stat = sftp_fstat(libssh->file))) {
+ av_log(libssh, AV_LOG_WARNING, "Cannot stat remote file.\n");
+ libssh->filesize = -1;
} else {
- s->filesize = stat->size;
+ libssh->filesize = stat->size;
sftp_attributes_free(stat);
}
+}
+
+static av_cold int libssh_close(URLContext *h)
+{
+ LIBSSHContext *libssh = h->priv_data;
+ if (libssh->file)
+ sftp_close(libssh->file);
+ if (libssh->sftp)
+ sftp_free(libssh->sftp);
+ if (libssh->session) {
+ ssh_disconnect(libssh->session);
+ ssh_free(libssh->session);
+ }
+ return 0;
+}
+
+static av_cold int libssh_open(URLContext *h, const char *url, int flags)
+{
+ LIBSSHContext *libssh = h->priv_data;
+ char proto[10], path[MAX_URL_SIZE], hostname[1024], credencials[1024];
+ int port = 22, ret;
+ const char *user = NULL, *pass = NULL;
+ char *end = NULL;
+
+ av_url_split(proto, sizeof(proto),
+ credencials, sizeof(credencials),
+ hostname, sizeof(hostname),
+ &port,
+ path, sizeof(path),
+ url);
+
+ if (port <= 0 || port > 65535)
+ port = 22;
+
+ if ((ret = libssh_create_ssh_session(libssh, hostname, port)) < 0)
+ goto fail;
+
+ user = av_strtok(credencials, ":", &end);
+ pass = av_strtok(end, ":", &end);
+
+ if ((ret = libssh_authentication(libssh, user, pass)) < 0)
+ goto fail;
+
+ if ((ret = libssh_create_sftp_session(libssh)) < 0)
+ goto fail;
+
+ if ((ret = libssh_open_file(libssh, flags, path)) < 0)
+ goto fail;
+
+ libssh_stat_file(libssh);
return 0;
@@ -144,31 +219,36 @@ static int libssh_open(URLContext *h, const char *url, int flags)
static int64_t libssh_seek(URLContext *h, int64_t pos, int whence)
{
- LIBSSHContext *s = h->priv_data;
+ LIBSSHContext *libssh = h->priv_data;
int64_t newpos;
- if (s->filesize == -1 && (whence == AVSEEK_SIZE || whence == SEEK_END)) {
+ if (libssh->filesize == -1 && (whence == AVSEEK_SIZE || whence == SEEK_END)) {
av_log(h, AV_LOG_ERROR, "Error during seeking.\n");
return AVERROR(EIO);
}
switch(whence) {
case AVSEEK_SIZE:
- return s->filesize;
+ return libssh->filesize;
case SEEK_SET:
newpos = pos;
break;
case SEEK_CUR:
- newpos = sftp_tell64(s->file);
+ newpos = sftp_tell64(libssh->file) + pos;
break;
case SEEK_END:
- newpos = s->filesize + pos;
+ newpos = libssh->filesize + pos;
break;
default:
return AVERROR(EINVAL);
}
- if (sftp_seek64(s->file, newpos)) {
+ if (newpos < 0) {
+ av_log(h, AV_LOG_ERROR, "Seeking to nagative position.\n");
+ return AVERROR(EINVAL);
+ }
+
+ if (sftp_seek64(libssh->file, newpos)) {
av_log(h, AV_LOG_ERROR, "Error during seeking.\n");
return AVERROR(EIO);
}
@@ -178,11 +258,11 @@ static int64_t libssh_seek(URLContext *h, int64_t pos, int whence)
static int libssh_read(URLContext *h, unsigned char *buf, int size)
{
- LIBSSHContext *s = h->priv_data;
+ LIBSSHContext *libssh = h->priv_data;
int bytes_read;
- if ((bytes_read = sftp_read(s->file, buf, size)) < 0) {
- av_log(h, AV_LOG_ERROR, "Read error.\n");
+ if ((bytes_read = sftp_read(libssh->file, buf, size)) < 0) {
+ av_log(libssh, AV_LOG_ERROR, "Read error.\n");
return AVERROR(EIO);
}
return bytes_read;
@@ -190,11 +270,11 @@ static int libssh_read(URLContext *h, unsigned char *buf, int size)
static int libssh_write(URLContext *h, const unsigned char *buf, int size)
{
- LIBSSHContext *s = h->priv_data;
+ LIBSSHContext *libssh = h->priv_data;
int bytes_written;
- if ((bytes_written = sftp_write(s->file, buf, size)) < 0) {
- av_log(h, AV_LOG_ERROR, "Write error.\n");
+ if ((bytes_written = sftp_write(libssh->file, buf, size)) < 0) {
+ av_log(libssh, AV_LOG_ERROR, "Write error.\n");
return AVERROR(EIO);
}
return bytes_written;
@@ -206,6 +286,7 @@ static int libssh_write(URLContext *h, const unsigned char *buf, int size)
static const AVOption options[] = {
{"timeout", "set timeout of socket I/O operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
{"truncate", "Truncate existing files on write", OFFSET(trunc), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, E },
+ {"private_key", "set path to private key", OFFSET(priv_key), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D|E },
{NULL}
};
diff --git a/chromium/third_party/ffmpeg/libavformat/loasdec.c b/chromium/third_party/ffmpeg/libavformat/loasdec.c
index 05ef0fe3ad5..c41809be006 100644
--- a/chromium/third_party/ffmpeg/libavformat/loasdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/loasdec.c
@@ -25,6 +25,8 @@
#include "internal.h"
#include "rawdec.h"
+#define LOAS_SYNC_WORD 0x2b7
+
static int loas_probe(AVProbeData *p)
{
int max_frames = 0, first_frames = 0;
@@ -35,27 +37,32 @@ static int loas_probe(AVProbeData *p)
const uint8_t *end = buf0 + p->buf_size - 3;
buf = buf0;
- for(; buf < end; buf= buf2+1) {
+ for (; buf < end; buf = buf2 + 1) {
buf2 = buf;
- for(frames = 0; buf2 < end; frames++) {
+ for (frames = 0; buf2 < end; frames++) {
uint32_t header = AV_RB24(buf2);
- if((header >> 13) != 0x2B7)
+ if ((header >> 13) != LOAS_SYNC_WORD)
break;
fsize = (header & 0x1FFF) + 3;
- if(fsize < 7)
+ if (fsize < 7)
break;
fsize = FFMIN(fsize, end - buf2);
buf2 += fsize;
}
max_frames = FFMAX(max_frames, frames);
- if(buf == buf0)
- first_frames= frames;
+ if (buf == buf0)
+ first_frames = frames;
}
- if (first_frames>=3) return AVPROBE_SCORE_EXTENSION+1;
- else if(max_frames>100)return AVPROBE_SCORE_EXTENSION;
- else if(max_frames>=3) return AVPROBE_SCORE_EXTENSION / 2;
- else return 0;
+
+ if (first_frames >= 3)
+ return AVPROBE_SCORE_EXTENSION + 1;
+ else if (max_frames > 100)
+ return AVPROBE_SCORE_EXTENSION;
+ else if (max_frames >= 3)
+ return AVPROBE_SCORE_EXTENSION / 2;
+ else
+ return 0;
}
static int loas_read_header(AVFormatContext *s)
diff --git a/chromium/third_party/ffmpeg/libavformat/lxfdec.c b/chromium/third_party/ffmpeg/libavformat/lxfdec.c
index f0a96396b46..19f7f27385a 100644
--- a/chromium/third_party/ffmpeg/libavformat/lxfdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/lxfdec.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/intreadwrite.h"
#include "libavcodec/bytestream.h"
#include "avformat.h"
@@ -128,12 +130,12 @@ static int get_packet_header(AVFormatContext *s)
version = bytestream_get_le32(&p);
header_size = bytestream_get_le32(&p);
if (version > 1)
- avpriv_request_sample(s, "Unknown format version %i\n", version);
+ avpriv_request_sample(s, "Unknown format version %"PRIu32"\n", version);
if (header_size < (version ? 72 : 60) ||
header_size > LXF_MAX_PACKET_HEADER_SIZE ||
(header_size & 3)) {
- av_log(s, AV_LOG_ERROR, "Invalid header size 0x%x\n", header_size);
+ av_log(s, AV_LOG_ERROR, "Invalid header size 0x%"PRIx32"\n", header_size);
return AVERROR_INVALIDDATA;
}
@@ -301,7 +303,8 @@ static int lxf_read_packet(AVFormatContext *s, AVPacket *pkt)
stream = lxf->packet_type;
if (stream > 1) {
- av_log(s, AV_LOG_WARNING, "got packet with illegal stream index %u\n", stream);
+ av_log(s, AV_LOG_WARNING,
+ "got packet with illegal stream index %"PRIu32"\n", stream);
return AVERROR(EAGAIN);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/matroska.c b/chromium/third_party/ffmpeg/libavformat/matroska.c
index 77a88a8756c..d281ef4fd53 100644
--- a/chromium/third_party/ffmpeg/libavformat/matroska.c
+++ b/chromium/third_party/ffmpeg/libavformat/matroska.c
@@ -35,7 +35,7 @@ const CodecTags ff_mkv_codec_tags[]={
{"A_MPEG/L2" , AV_CODEC_ID_MP2},
{"A_MPEG/L1" , AV_CODEC_ID_MP2},
{"A_MPEG/L3" , AV_CODEC_ID_MP3},
- {"A_OPUS", AV_CODEC_ID_OPUS},
+ {"A_OPUS" , AV_CODEC_ID_OPUS},
{"A_OPUS/EXPERIMENTAL",AV_CODEC_ID_OPUS},
{"A_PCM/FLOAT/IEEE" , AV_CODEC_ID_PCM_F32LE},
{"A_PCM/FLOAT/IEEE" , AV_CODEC_ID_PCM_F64LE},
@@ -113,6 +113,7 @@ const CodecMime ff_mkv_mime_tags[] = {
{"application/x-truetype-font", AV_CODEC_ID_TTF},
{"application/x-font" , AV_CODEC_ID_TTF},
{"application/vnd.ms-opentype", AV_CODEC_ID_OTF},
+ {"binary" , AV_CODEC_ID_BIN_DATA},
{"" , AV_CODEC_ID_NONE}
};
diff --git a/chromium/third_party/ffmpeg/libavformat/matroskadec.c b/chromium/third_party/ffmpeg/libavformat/matroskadec.c
index cedb3452a51..dcbdd2f5246 100644
--- a/chromium/third_party/ffmpeg/libavformat/matroskadec.c
+++ b/chromium/third_party/ffmpeg/libavformat/matroskadec.c
@@ -28,33 +28,38 @@
* @see specs available on the Matroska project page: http://www.matroska.org/
*/
+#include "config.h"
+
+#include <inttypes.h>
#include <stdio.h>
+#if CONFIG_BZLIB
+#include <bzlib.h>
+#endif
+#if CONFIG_ZLIB
+#include <zlib.h>
+#endif
+
+#include "libavutil/avstring.h"
+#include "libavutil/base64.h"
+#include "libavutil/dict.h"
+#include "libavutil/intfloat.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/lzo.h"
+#include "libavutil/mathematics.h"
+
+#include "libavcodec/bytestream.h"
+#include "libavcodec/mpeg4audio.h"
+
#include "avformat.h"
-#include "internal.h"
#include "avio_internal.h"
+#include "internal.h"
+#include "isom.h"
+#include "matroska.h"
/* For ff_codec_get_id(). */
#include "riff.h"
-#include "isom.h"
#if CONFIG_SIPR_DECODER
#include "rmsipr.h"
#endif
-#include "matroska.h"
-#include "libavcodec/bytestream.h"
-#include "libavcodec/mpeg4audio.h"
-#include "libavutil/base64.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/avstring.h"
-#if CONFIG_LZO
-#include "libavutil/lzo.h"
-#endif
-#include "libavutil/dict.h"
-#if CONFIG_ZLIB
-#include <zlib.h>
-#endif
-#if CONFIG_BZLIB
-#include <bzlib.h>
-#endif
static int matroska_read_close(AVFormatContext *s);
@@ -170,12 +175,12 @@ typedef struct {
uint64_t default_duration;
uint64_t flag_default;
uint64_t flag_forced;
- uint64_t codec_delay;
uint64_t seek_preroll;
MatroskaTrackVideo video;
MatroskaTrackAudio audio;
MatroskaTrackOperation operation;
EbmlList encodings;
+ uint64_t codec_delay;
AVStream *stream;
int64_t end_timecode;
@@ -190,7 +195,7 @@ typedef struct {
EbmlBin bin;
AVStream *stream;
-} MatroskaAttachement;
+} MatroskaAttachment;
typedef struct {
uint64_t start;
@@ -259,6 +264,7 @@ typedef struct {
uint64_t time_scale;
double duration;
char *title;
+ char *muxingapp;
EbmlBin date_utc;
EbmlList tracks;
EbmlList attachments;
@@ -303,67 +309,67 @@ typedef struct {
} MatroskaBlock;
static EbmlSyntax ebml_header[] = {
- { EBML_ID_EBMLREADVERSION, EBML_UINT, 0, offsetof(Ebml,version), {.u=EBML_VERSION} },
- { EBML_ID_EBMLMAXSIZELENGTH, EBML_UINT, 0, offsetof(Ebml,max_size), {.u=8} },
- { EBML_ID_EBMLMAXIDLENGTH, EBML_UINT, 0, offsetof(Ebml,id_length), {.u=4} },
- { EBML_ID_DOCTYPE, EBML_STR, 0, offsetof(Ebml,doctype), {.s="(none)"} },
- { EBML_ID_DOCTYPEREADVERSION, EBML_UINT, 0, offsetof(Ebml,doctype_version), {.u=1} },
- { EBML_ID_EBMLVERSION, EBML_NONE },
- { EBML_ID_DOCTYPEVERSION, EBML_NONE },
+ { EBML_ID_EBMLREADVERSION, EBML_UINT, 0, offsetof(Ebml, version), { .u = EBML_VERSION } },
+ { EBML_ID_EBMLMAXSIZELENGTH, EBML_UINT, 0, offsetof(Ebml, max_size), { .u = 8 } },
+ { EBML_ID_EBMLMAXIDLENGTH, EBML_UINT, 0, offsetof(Ebml, id_length), { .u = 4 } },
+ { EBML_ID_DOCTYPE, EBML_STR, 0, offsetof(Ebml, doctype), { .s = "(none)" } },
+ { EBML_ID_DOCTYPEREADVERSION, EBML_UINT, 0, offsetof(Ebml, doctype_version), { .u = 1 } },
+ { EBML_ID_EBMLVERSION, EBML_NONE },
+ { EBML_ID_DOCTYPEVERSION, EBML_NONE },
{ 0 }
};
static EbmlSyntax ebml_syntax[] = {
- { EBML_ID_HEADER, EBML_NEST, 0, 0, {.n=ebml_header} },
+ { EBML_ID_HEADER, EBML_NEST, 0, 0, { .n = ebml_header } },
{ 0 }
};
static EbmlSyntax matroska_info[] = {
- { MATROSKA_ID_TIMECODESCALE, EBML_UINT, 0, offsetof(MatroskaDemuxContext,time_scale), {.u=1000000} },
- { MATROSKA_ID_DURATION, EBML_FLOAT, 0, offsetof(MatroskaDemuxContext,duration) },
- { MATROSKA_ID_TITLE, EBML_UTF8, 0, offsetof(MatroskaDemuxContext,title) },
- { MATROSKA_ID_WRITINGAPP, EBML_NONE },
- { MATROSKA_ID_MUXINGAPP, EBML_NONE },
- { MATROSKA_ID_DATEUTC, EBML_BIN, 0, offsetof(MatroskaDemuxContext,date_utc) },
- { MATROSKA_ID_SEGMENTUID, EBML_NONE },
+ { MATROSKA_ID_TIMECODESCALE, EBML_UINT, 0, offsetof(MatroskaDemuxContext, time_scale), { .u = 1000000 } },
+ { MATROSKA_ID_DURATION, EBML_FLOAT, 0, offsetof(MatroskaDemuxContext, duration) },
+ { MATROSKA_ID_TITLE, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, title) },
+ { MATROSKA_ID_WRITINGAPP, EBML_NONE },
+ { MATROSKA_ID_MUXINGAPP, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, muxingapp) },
+ { MATROSKA_ID_DATEUTC, EBML_BIN, 0, offsetof(MatroskaDemuxContext, date_utc) },
+ { MATROSKA_ID_SEGMENTUID, EBML_NONE },
{ 0 }
};
static EbmlSyntax matroska_track_video[] = {
- { MATROSKA_ID_VIDEOFRAMERATE, EBML_FLOAT,0, offsetof(MatroskaTrackVideo,frame_rate) },
- { MATROSKA_ID_VIDEODISPLAYWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo,display_width), {.u=-1} },
- { MATROSKA_ID_VIDEODISPLAYHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo,display_height), {.u=-1} },
- { MATROSKA_ID_VIDEOPIXELWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo,pixel_width) },
- { MATROSKA_ID_VIDEOPIXELHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo,pixel_height) },
- { MATROSKA_ID_VIDEOCOLORSPACE, EBML_BIN, 0, offsetof(MatroskaTrackVideo,color_space) },
- { MATROSKA_ID_VIDEOSTEREOMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo,stereo_mode) },
- { MATROSKA_ID_VIDEOALPHAMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo,alpha_mode) },
- { MATROSKA_ID_VIDEOPIXELCROPB, EBML_NONE },
- { MATROSKA_ID_VIDEOPIXELCROPT, EBML_NONE },
- { MATROSKA_ID_VIDEOPIXELCROPL, EBML_NONE },
- { MATROSKA_ID_VIDEOPIXELCROPR, EBML_NONE },
- { MATROSKA_ID_VIDEODISPLAYUNIT, EBML_NONE },
- { MATROSKA_ID_VIDEOFLAGINTERLACED,EBML_NONE },
- { MATROSKA_ID_VIDEOASPECTRATIO, EBML_NONE },
+ { MATROSKA_ID_VIDEOFRAMERATE, EBML_FLOAT, 0, offsetof(MatroskaTrackVideo, frame_rate) },
+ { MATROSKA_ID_VIDEODISPLAYWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_width), { .u=-1 } },
+ { MATROSKA_ID_VIDEODISPLAYHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_height), { .u=-1 } },
+ { MATROSKA_ID_VIDEOPIXELWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_width) },
+ { MATROSKA_ID_VIDEOPIXELHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_height) },
+ { MATROSKA_ID_VIDEOCOLORSPACE, EBML_BIN, 0, offsetof(MatroskaTrackVideo, color_space) },
+ { MATROSKA_ID_VIDEOSTEREOMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, stereo_mode) },
+ { MATROSKA_ID_VIDEOALPHAMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, alpha_mode) },
+ { MATROSKA_ID_VIDEOPIXELCROPB, EBML_NONE },
+ { MATROSKA_ID_VIDEOPIXELCROPT, EBML_NONE },
+ { MATROSKA_ID_VIDEOPIXELCROPL, EBML_NONE },
+ { MATROSKA_ID_VIDEOPIXELCROPR, EBML_NONE },
+ { MATROSKA_ID_VIDEODISPLAYUNIT, EBML_NONE },
+ { MATROSKA_ID_VIDEOFLAGINTERLACED, EBML_NONE },
+ { MATROSKA_ID_VIDEOASPECTRATIO, EBML_NONE },
{ 0 }
};
static EbmlSyntax matroska_track_audio[] = {
- { MATROSKA_ID_AUDIOSAMPLINGFREQ, EBML_FLOAT,0, offsetof(MatroskaTrackAudio,samplerate), {.f=8000.0} },
- { MATROSKA_ID_AUDIOOUTSAMPLINGFREQ,EBML_FLOAT,0,offsetof(MatroskaTrackAudio,out_samplerate) },
- { MATROSKA_ID_AUDIOBITDEPTH, EBML_UINT, 0, offsetof(MatroskaTrackAudio,bitdepth) },
- { MATROSKA_ID_AUDIOCHANNELS, EBML_UINT, 0, offsetof(MatroskaTrackAudio,channels), {.u=1} },
+ { MATROSKA_ID_AUDIOSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, samplerate), { .f = 8000.0 } },
+ { MATROSKA_ID_AUDIOOUTSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, out_samplerate) },
+ { MATROSKA_ID_AUDIOBITDEPTH, EBML_UINT, 0, offsetof(MatroskaTrackAudio, bitdepth) },
+ { MATROSKA_ID_AUDIOCHANNELS, EBML_UINT, 0, offsetof(MatroskaTrackAudio, channels), { .u = 1 } },
{ 0 }
};
static EbmlSyntax matroska_track_encoding_compression[] = {
- { MATROSKA_ID_ENCODINGCOMPALGO, EBML_UINT, 0, offsetof(MatroskaTrackCompression,algo), {.u=0} },
- { MATROSKA_ID_ENCODINGCOMPSETTINGS,EBML_BIN, 0, offsetof(MatroskaTrackCompression,settings) },
+ { MATROSKA_ID_ENCODINGCOMPALGO, EBML_UINT, 0, offsetof(MatroskaTrackCompression, algo), { .u = 0 } },
+ { MATROSKA_ID_ENCODINGCOMPSETTINGS, EBML_BIN, 0, offsetof(MatroskaTrackCompression, settings) },
{ 0 }
};
static EbmlSyntax matroska_track_encoding_encryption[] = {
- { MATROSKA_ID_ENCODINGENCALGO, EBML_UINT, 0, offsetof(MatroskaTrackEncryption,algo), {.u=0} },
+ { MATROSKA_ID_ENCODINGENCALGO, EBML_UINT, 0, offsetof(MatroskaTrackEncryption,algo), {.u = 0} },
{ MATROSKA_ID_ENCODINGENCKEYID, EBML_BIN, 0, offsetof(MatroskaTrackEncryption,key_id) },
{ MATROSKA_ID_ENCODINGENCAESSETTINGS, EBML_NONE },
{ MATROSKA_ID_ENCODINGSIGALGO, EBML_NONE },
@@ -373,16 +379,16 @@ static EbmlSyntax matroska_track_encoding_encryption[] = {
{ 0 }
};
static EbmlSyntax matroska_track_encoding[] = {
- { MATROSKA_ID_ENCODINGSCOPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding,scope), {.u=1} },
- { MATROSKA_ID_ENCODINGTYPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding,type), {.u=0} },
- { MATROSKA_ID_ENCODINGCOMPRESSION,EBML_NEST, 0, offsetof(MatroskaTrackEncoding,compression), {.n=matroska_track_encoding_compression} },
- { MATROSKA_ID_ENCODINGENCRYPTION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding,encryption), {.n=matroska_track_encoding_encryption} },
- { MATROSKA_ID_ENCODINGORDER, EBML_NONE },
+ { MATROSKA_ID_ENCODINGSCOPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, scope), { .u = 1 } },
+ { MATROSKA_ID_ENCODINGTYPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, type), { .u = 0 } },
+ { MATROSKA_ID_ENCODINGCOMPRESSION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, compression), { .n = matroska_track_encoding_compression } },
+ { MATROSKA_ID_ENCODINGENCRYPTION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, encryption), { .n = matroska_track_encoding_encryption } },
+ { MATROSKA_ID_ENCODINGORDER, EBML_NONE },
{ 0 }
};
static EbmlSyntax matroska_track_encodings[] = {
- { MATROSKA_ID_TRACKCONTENTENCODING, EBML_NEST, sizeof(MatroskaTrackEncoding), offsetof(MatroskaTrack,encodings), {.n=matroska_track_encoding} },
+ { MATROSKA_ID_TRACKCONTENTENCODING, EBML_NEST, sizeof(MatroskaTrackEncoding), offsetof(MatroskaTrack, encodings), { .n = matroska_track_encoding } },
{ 0 }
};
@@ -393,75 +399,75 @@ static EbmlSyntax matroska_track_plane[] = {
};
static EbmlSyntax matroska_track_combine_planes[] = {
- { MATROSKA_ID_TRACKPLANE, EBML_NEST, sizeof(MatroskaTrackPlane), offsetof(MatroskaTrackOperation,combine_planes), {.n=matroska_track_plane} },
+ { MATROSKA_ID_TRACKPLANE, EBML_NEST, sizeof(MatroskaTrackPlane), offsetof(MatroskaTrackOperation,combine_planes), {.n = matroska_track_plane} },
{ 0 }
};
static EbmlSyntax matroska_track_operation[] = {
- { MATROSKA_ID_TRACKCOMBINEPLANES, EBML_NEST, 0, 0, {.n=matroska_track_combine_planes} },
+ { MATROSKA_ID_TRACKCOMBINEPLANES, EBML_NEST, 0, 0, {.n = matroska_track_combine_planes} },
{ 0 }
};
static EbmlSyntax matroska_track[] = {
- { MATROSKA_ID_TRACKNUMBER, EBML_UINT, 0, offsetof(MatroskaTrack,num) },
- { MATROSKA_ID_TRACKNAME, EBML_UTF8, 0, offsetof(MatroskaTrack,name) },
- { MATROSKA_ID_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTrack,uid) },
- { MATROSKA_ID_TRACKTYPE, EBML_UINT, 0, offsetof(MatroskaTrack,type) },
- { MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack,codec_id) },
- { MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack,codec_priv) },
- { MATROSKA_ID_TRACKLANGUAGE, EBML_UTF8, 0, offsetof(MatroskaTrack,language), {.s="eng"} },
- { MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack,default_duration) },
- { MATROSKA_ID_TRACKTIMECODESCALE, EBML_FLOAT,0, offsetof(MatroskaTrack,time_scale), {.f=1.0} },
- { MATROSKA_ID_TRACKFLAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTrack,flag_default), {.u=1} },
- { MATROSKA_ID_TRACKFLAGFORCED, EBML_UINT, 0, offsetof(MatroskaTrack,flag_forced), {.u=0} },
- { MATROSKA_ID_TRACKVIDEO, EBML_NEST, 0, offsetof(MatroskaTrack,video), {.n=matroska_track_video} },
- { MATROSKA_ID_TRACKAUDIO, EBML_NEST, 0, offsetof(MatroskaTrack,audio), {.n=matroska_track_audio} },
- { MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack,operation), {.n=matroska_track_operation} },
- { MATROSKA_ID_TRACKCONTENTENCODINGS,EBML_NEST, 0, 0, {.n=matroska_track_encodings} },
- { MATROSKA_ID_TRACKMAXBLKADDID, EBML_UINT, 0, offsetof(MatroskaTrack,max_block_additional_id) },
- { MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack,codec_delay) },
- { MATROSKA_ID_SEEKPREROLL, EBML_UINT, 0, offsetof(MatroskaTrack,seek_preroll) },
- { MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE },
- { MATROSKA_ID_TRACKFLAGLACING, EBML_NONE },
- { MATROSKA_ID_CODECNAME, EBML_NONE },
- { MATROSKA_ID_CODECDECODEALL, EBML_NONE },
- { MATROSKA_ID_CODECINFOURL, EBML_NONE },
- { MATROSKA_ID_CODECDOWNLOADURL, EBML_NONE },
- { MATROSKA_ID_TRACKMINCACHE, EBML_NONE },
- { MATROSKA_ID_TRACKMAXCACHE, EBML_NONE },
+ { MATROSKA_ID_TRACKNUMBER, EBML_UINT, 0, offsetof(MatroskaTrack, num) },
+ { MATROSKA_ID_TRACKNAME, EBML_UTF8, 0, offsetof(MatroskaTrack, name) },
+ { MATROSKA_ID_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTrack, uid) },
+ { MATROSKA_ID_TRACKTYPE, EBML_UINT, 0, offsetof(MatroskaTrack, type) },
+ { MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack, codec_id) },
+ { MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack, codec_priv) },
+ { MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack, codec_delay) },
+ { MATROSKA_ID_TRACKLANGUAGE, EBML_UTF8, 0, offsetof(MatroskaTrack, language), { .s = "eng" } },
+ { MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack, default_duration) },
+ { MATROSKA_ID_TRACKTIMECODESCALE, EBML_FLOAT, 0, offsetof(MatroskaTrack, time_scale), { .f = 1.0 } },
+ { MATROSKA_ID_TRACKFLAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTrack, flag_default), { .u = 1 } },
+ { MATROSKA_ID_TRACKFLAGFORCED, EBML_UINT, 0, offsetof(MatroskaTrack, flag_forced), { .u = 0 } },
+ { MATROSKA_ID_TRACKVIDEO, EBML_NEST, 0, offsetof(MatroskaTrack, video), { .n = matroska_track_video } },
+ { MATROSKA_ID_TRACKAUDIO, EBML_NEST, 0, offsetof(MatroskaTrack, audio), { .n = matroska_track_audio } },
+ { MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack, operation), { .n = matroska_track_operation } },
+ { MATROSKA_ID_TRACKCONTENTENCODINGS, EBML_NEST, 0, 0, { .n = matroska_track_encodings } },
+ { MATROSKA_ID_TRACKMAXBLKADDID, EBML_UINT, 0, offsetof(MatroskaTrack, max_block_additional_id) },
+ { MATROSKA_ID_SEEKPREROLL, EBML_UINT, 0, offsetof(MatroskaTrack, seek_preroll) },
+ { MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE },
+ { MATROSKA_ID_TRACKFLAGLACING, EBML_NONE },
+ { MATROSKA_ID_CODECNAME, EBML_NONE },
+ { MATROSKA_ID_CODECDECODEALL, EBML_NONE },
+ { MATROSKA_ID_CODECINFOURL, EBML_NONE },
+ { MATROSKA_ID_CODECDOWNLOADURL, EBML_NONE },
+ { MATROSKA_ID_TRACKMINCACHE, EBML_NONE },
+ { MATROSKA_ID_TRACKMAXCACHE, EBML_NONE },
{ 0 }
};
static EbmlSyntax matroska_tracks[] = {
- { MATROSKA_ID_TRACKENTRY, EBML_NEST, sizeof(MatroskaTrack), offsetof(MatroskaDemuxContext,tracks), {.n=matroska_track} },
+ { MATROSKA_ID_TRACKENTRY, EBML_NEST, sizeof(MatroskaTrack), offsetof(MatroskaDemuxContext, tracks), { .n = matroska_track } },
{ 0 }
};
static EbmlSyntax matroska_attachment[] = {
- { MATROSKA_ID_FILEUID, EBML_UINT, 0, offsetof(MatroskaAttachement,uid) },
- { MATROSKA_ID_FILENAME, EBML_UTF8, 0, offsetof(MatroskaAttachement,filename) },
- { MATROSKA_ID_FILEMIMETYPE, EBML_STR, 0, offsetof(MatroskaAttachement,mime) },
- { MATROSKA_ID_FILEDATA, EBML_BIN, 0, offsetof(MatroskaAttachement,bin) },
- { MATROSKA_ID_FILEDESC, EBML_NONE },
+ { MATROSKA_ID_FILEUID, EBML_UINT, 0, offsetof(MatroskaAttachment, uid) },
+ { MATROSKA_ID_FILENAME, EBML_UTF8, 0, offsetof(MatroskaAttachment, filename) },
+ { MATROSKA_ID_FILEMIMETYPE, EBML_STR, 0, offsetof(MatroskaAttachment, mime) },
+ { MATROSKA_ID_FILEDATA, EBML_BIN, 0, offsetof(MatroskaAttachment, bin) },
+ { MATROSKA_ID_FILEDESC, EBML_NONE },
{ 0 }
};
static EbmlSyntax matroska_attachments[] = {
- { MATROSKA_ID_ATTACHEDFILE, EBML_NEST, sizeof(MatroskaAttachement), offsetof(MatroskaDemuxContext,attachments), {.n=matroska_attachment} },
+ { MATROSKA_ID_ATTACHEDFILE, EBML_NEST, sizeof(MatroskaAttachment), offsetof(MatroskaDemuxContext, attachments), { .n = matroska_attachment } },
{ 0 }
};
static EbmlSyntax matroska_chapter_display[] = {
- { MATROSKA_ID_CHAPSTRING, EBML_UTF8, 0, offsetof(MatroskaChapter,title) },
- { MATROSKA_ID_CHAPLANG, EBML_NONE },
+ { MATROSKA_ID_CHAPSTRING, EBML_UTF8, 0, offsetof(MatroskaChapter, title) },
+ { MATROSKA_ID_CHAPLANG, EBML_NONE },
{ 0 }
};
static EbmlSyntax matroska_chapter_entry[] = {
- { MATROSKA_ID_CHAPTERTIMESTART, EBML_UINT, 0, offsetof(MatroskaChapter,start), {.u=AV_NOPTS_VALUE} },
- { MATROSKA_ID_CHAPTERTIMEEND, EBML_UINT, 0, offsetof(MatroskaChapter,end), {.u=AV_NOPTS_VALUE} },
- { MATROSKA_ID_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaChapter,uid) },
- { MATROSKA_ID_CHAPTERDISPLAY, EBML_NEST, 0, 0, {.n=matroska_chapter_display} },
+ { MATROSKA_ID_CHAPTERTIMESTART, EBML_UINT, 0, offsetof(MatroskaChapter, start), { .u = AV_NOPTS_VALUE } },
+ { MATROSKA_ID_CHAPTERTIMEEND, EBML_UINT, 0, offsetof(MatroskaChapter, end), { .u = AV_NOPTS_VALUE } },
+ { MATROSKA_ID_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaChapter, uid) },
+ { MATROSKA_ID_CHAPTERDISPLAY, EBML_NEST, 0, 0, { .n = matroska_chapter_display } },
{ MATROSKA_ID_CHAPTERFLAGHIDDEN, EBML_NONE },
{ MATROSKA_ID_CHAPTERFLAGENABLED, EBML_NONE },
{ MATROSKA_ID_CHAPTERPHYSEQUIV, EBML_NONE },
@@ -470,7 +476,7 @@ static EbmlSyntax matroska_chapter_entry[] = {
};
static EbmlSyntax matroska_chapter[] = {
- { MATROSKA_ID_CHAPTERATOM, EBML_NEST, sizeof(MatroskaChapter), offsetof(MatroskaDemuxContext,chapters), {.n=matroska_chapter_entry} },
+ { MATROSKA_ID_CHAPTERATOM, EBML_NEST, sizeof(MatroskaChapter), offsetof(MatroskaDemuxContext, chapters), { .n = matroska_chapter_entry } },
{ MATROSKA_ID_EDITIONUID, EBML_NONE },
{ MATROSKA_ID_EDITIONFLAGHIDDEN, EBML_NONE },
{ MATROSKA_ID_EDITIONFLAGDEFAULT, EBML_NONE },
@@ -479,13 +485,13 @@ static EbmlSyntax matroska_chapter[] = {
};
static EbmlSyntax matroska_chapters[] = {
- { MATROSKA_ID_EDITIONENTRY, EBML_NEST, 0, 0, {.n=matroska_chapter} },
+ { MATROSKA_ID_EDITIONENTRY, EBML_NEST, 0, 0, { .n = matroska_chapter } },
{ 0 }
};
static EbmlSyntax matroska_index_pos[] = {
- { MATROSKA_ID_CUETRACK, EBML_UINT, 0, offsetof(MatroskaIndexPos,track) },
- { MATROSKA_ID_CUECLUSTERPOSITION, EBML_UINT, 0, offsetof(MatroskaIndexPos,pos) },
+ { MATROSKA_ID_CUETRACK, EBML_UINT, 0, offsetof(MatroskaIndexPos, track) },
+ { MATROSKA_ID_CUECLUSTERPOSITION, EBML_UINT, 0, offsetof(MatroskaIndexPos, pos) },
{ MATROSKA_ID_CUERELATIVEPOSITION,EBML_NONE },
{ MATROSKA_ID_CUEDURATION, EBML_NONE },
{ MATROSKA_ID_CUEBLOCKNUMBER, EBML_NONE },
@@ -493,71 +499,71 @@ static EbmlSyntax matroska_index_pos[] = {
};
static EbmlSyntax matroska_index_entry[] = {
- { MATROSKA_ID_CUETIME, EBML_UINT, 0, offsetof(MatroskaIndex,time) },
- { MATROSKA_ID_CUETRACKPOSITION, EBML_NEST, sizeof(MatroskaIndexPos), offsetof(MatroskaIndex,pos), {.n=matroska_index_pos} },
+ { MATROSKA_ID_CUETIME, EBML_UINT, 0, offsetof(MatroskaIndex, time) },
+ { MATROSKA_ID_CUETRACKPOSITION, EBML_NEST, sizeof(MatroskaIndexPos), offsetof(MatroskaIndex, pos), { .n = matroska_index_pos } },
{ 0 }
};
static EbmlSyntax matroska_index[] = {
- { MATROSKA_ID_POINTENTRY, EBML_NEST, sizeof(MatroskaIndex), offsetof(MatroskaDemuxContext,index), {.n=matroska_index_entry} },
+ { MATROSKA_ID_POINTENTRY, EBML_NEST, sizeof(MatroskaIndex), offsetof(MatroskaDemuxContext, index), { .n = matroska_index_entry } },
{ 0 }
};
static EbmlSyntax matroska_simpletag[] = {
- { MATROSKA_ID_TAGNAME, EBML_UTF8, 0, offsetof(MatroskaTag,name) },
- { MATROSKA_ID_TAGSTRING, EBML_UTF8, 0, offsetof(MatroskaTag,string) },
- { MATROSKA_ID_TAGLANG, EBML_STR, 0, offsetof(MatroskaTag,lang), {.s="und"} },
- { MATROSKA_ID_TAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTag,def) },
- { MATROSKA_ID_TAGDEFAULT_BUG, EBML_UINT, 0, offsetof(MatroskaTag,def) },
- { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTag,sub), {.n=matroska_simpletag} },
+ { MATROSKA_ID_TAGNAME, EBML_UTF8, 0, offsetof(MatroskaTag, name) },
+ { MATROSKA_ID_TAGSTRING, EBML_UTF8, 0, offsetof(MatroskaTag, string) },
+ { MATROSKA_ID_TAGLANG, EBML_STR, 0, offsetof(MatroskaTag, lang), { .s = "und" } },
+ { MATROSKA_ID_TAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTag, def) },
+ { MATROSKA_ID_TAGDEFAULT_BUG, EBML_UINT, 0, offsetof(MatroskaTag, def) },
+ { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTag, sub), { .n = matroska_simpletag } },
{ 0 }
};
static EbmlSyntax matroska_tagtargets[] = {
- { MATROSKA_ID_TAGTARGETS_TYPE, EBML_STR, 0, offsetof(MatroskaTagTarget,type) },
- { MATROSKA_ID_TAGTARGETS_TYPEVALUE, EBML_UINT, 0, offsetof(MatroskaTagTarget,typevalue), {.u=50} },
- { MATROSKA_ID_TAGTARGETS_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTagTarget,trackuid) },
- { MATROSKA_ID_TAGTARGETS_CHAPTERUID,EBML_UINT, 0, offsetof(MatroskaTagTarget,chapteruid) },
- { MATROSKA_ID_TAGTARGETS_ATTACHUID, EBML_UINT, 0, offsetof(MatroskaTagTarget,attachuid) },
+ { MATROSKA_ID_TAGTARGETS_TYPE, EBML_STR, 0, offsetof(MatroskaTagTarget, type) },
+ { MATROSKA_ID_TAGTARGETS_TYPEVALUE, EBML_UINT, 0, offsetof(MatroskaTagTarget, typevalue), { .u = 50 } },
+ { MATROSKA_ID_TAGTARGETS_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, trackuid) },
+ { MATROSKA_ID_TAGTARGETS_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, chapteruid) },
+ { MATROSKA_ID_TAGTARGETS_ATTACHUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, attachuid) },
{ 0 }
};
static EbmlSyntax matroska_tag[] = {
- { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTags,tag), {.n=matroska_simpletag} },
- { MATROSKA_ID_TAGTARGETS, EBML_NEST, 0, offsetof(MatroskaTags,target), {.n=matroska_tagtargets} },
+ { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTags, tag), { .n = matroska_simpletag } },
+ { MATROSKA_ID_TAGTARGETS, EBML_NEST, 0, offsetof(MatroskaTags, target), { .n = matroska_tagtargets } },
{ 0 }
};
static EbmlSyntax matroska_tags[] = {
- { MATROSKA_ID_TAG, EBML_NEST, sizeof(MatroskaTags), offsetof(MatroskaDemuxContext,tags), {.n=matroska_tag} },
+ { MATROSKA_ID_TAG, EBML_NEST, sizeof(MatroskaTags), offsetof(MatroskaDemuxContext, tags), { .n = matroska_tag } },
{ 0 }
};
static EbmlSyntax matroska_seekhead_entry[] = {
- { MATROSKA_ID_SEEKID, EBML_UINT, 0, offsetof(MatroskaSeekhead,id) },
- { MATROSKA_ID_SEEKPOSITION, EBML_UINT, 0, offsetof(MatroskaSeekhead,pos), {.u=-1} },
+ { MATROSKA_ID_SEEKID, EBML_UINT, 0, offsetof(MatroskaSeekhead, id) },
+ { MATROSKA_ID_SEEKPOSITION, EBML_UINT, 0, offsetof(MatroskaSeekhead, pos), { .u = -1 } },
{ 0 }
};
static EbmlSyntax matroska_seekhead[] = {
- { MATROSKA_ID_SEEKENTRY, EBML_NEST, sizeof(MatroskaSeekhead), offsetof(MatroskaDemuxContext,seekhead), {.n=matroska_seekhead_entry} },
+ { MATROSKA_ID_SEEKENTRY, EBML_NEST, sizeof(MatroskaSeekhead), offsetof(MatroskaDemuxContext, seekhead), { .n = matroska_seekhead_entry } },
{ 0 }
};
static EbmlSyntax matroska_segment[] = {
- { MATROSKA_ID_INFO, EBML_NEST, 0, 0, {.n=matroska_info } },
- { MATROSKA_ID_TRACKS, EBML_NEST, 0, 0, {.n=matroska_tracks } },
- { MATROSKA_ID_ATTACHMENTS, EBML_NEST, 0, 0, {.n=matroska_attachments} },
- { MATROSKA_ID_CHAPTERS, EBML_NEST, 0, 0, {.n=matroska_chapters } },
- { MATROSKA_ID_CUES, EBML_NEST, 0, 0, {.n=matroska_index } },
- { MATROSKA_ID_TAGS, EBML_NEST, 0, 0, {.n=matroska_tags } },
- { MATROSKA_ID_SEEKHEAD, EBML_NEST, 0, 0, {.n=matroska_seekhead } },
- { MATROSKA_ID_CLUSTER, EBML_STOP },
+ { MATROSKA_ID_INFO, EBML_NEST, 0, 0, { .n = matroska_info } },
+ { MATROSKA_ID_TRACKS, EBML_NEST, 0, 0, { .n = matroska_tracks } },
+ { MATROSKA_ID_ATTACHMENTS, EBML_NEST, 0, 0, { .n = matroska_attachments } },
+ { MATROSKA_ID_CHAPTERS, EBML_NEST, 0, 0, { .n = matroska_chapters } },
+ { MATROSKA_ID_CUES, EBML_NEST, 0, 0, { .n = matroska_index } },
+ { MATROSKA_ID_TAGS, EBML_NEST, 0, 0, { .n = matroska_tags } },
+ { MATROSKA_ID_SEEKHEAD, EBML_NEST, 0, 0, { .n = matroska_seekhead } },
+ { MATROSKA_ID_CLUSTER, EBML_STOP },
{ 0 }
};
static EbmlSyntax matroska_segments[] = {
- { MATROSKA_ID_SEGMENT, EBML_NEST, 0, 0, {.n=matroska_segment } },
+ { MATROSKA_ID_SEGMENT, EBML_NEST, 0, 0, { .n = matroska_segment } },
{ 0 }
};
@@ -568,69 +574,69 @@ static EbmlSyntax matroska_blockmore[] = {
};
static EbmlSyntax matroska_blockadditions[] = {
- { MATROSKA_ID_BLOCKMORE, EBML_NEST, 0, 0, {.n=matroska_blockmore} },
+ { MATROSKA_ID_BLOCKMORE, EBML_NEST, 0, 0, {.n = matroska_blockmore} },
{ 0 }
};
static EbmlSyntax matroska_blockgroup[] = {
- { MATROSKA_ID_BLOCK, EBML_BIN, 0, offsetof(MatroskaBlock,bin) },
- { MATROSKA_ID_BLOCKADDITIONS, EBML_NEST, 0, 0, {.n=matroska_blockadditions} },
- { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock,bin) },
- { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock,duration) },
- { MATROSKA_ID_DISCARDPADDING, EBML_SINT, 0, offsetof(MatroskaBlock,discard_padding) },
- { MATROSKA_ID_BLOCKREFERENCE, EBML_SINT, 0, offsetof(MatroskaBlock,reference) },
+ { MATROSKA_ID_BLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) },
+ { MATROSKA_ID_BLOCKADDITIONS, EBML_NEST, 0, 0, { .n = matroska_blockadditions} },
+ { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) },
+ { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock, duration) },
+ { MATROSKA_ID_DISCARDPADDING, EBML_SINT, 0, offsetof(MatroskaBlock, discard_padding) },
+ { MATROSKA_ID_BLOCKREFERENCE, EBML_SINT, 0, offsetof(MatroskaBlock, reference) },
{ MATROSKA_ID_CODECSTATE, EBML_NONE },
- { 1, EBML_UINT, 0, offsetof(MatroskaBlock,non_simple), {.u=1} },
+ { 1, EBML_UINT, 0, offsetof(MatroskaBlock, non_simple), { .u = 1 } },
{ 0 }
};
static EbmlSyntax matroska_cluster[] = {
- { MATROSKA_ID_CLUSTERTIMECODE,EBML_UINT,0, offsetof(MatroskaCluster,timecode) },
- { MATROSKA_ID_BLOCKGROUP, EBML_NEST, sizeof(MatroskaBlock), offsetof(MatroskaCluster,blocks), {.n=matroska_blockgroup} },
- { MATROSKA_ID_SIMPLEBLOCK, EBML_PASS, sizeof(MatroskaBlock), offsetof(MatroskaCluster,blocks), {.n=matroska_blockgroup} },
- { MATROSKA_ID_CLUSTERPOSITION,EBML_NONE },
- { MATROSKA_ID_CLUSTERPREVSIZE,EBML_NONE },
+ { MATROSKA_ID_CLUSTERTIMECODE, EBML_UINT, 0, offsetof(MatroskaCluster, timecode) },
+ { MATROSKA_ID_BLOCKGROUP, EBML_NEST, sizeof(MatroskaBlock), offsetof(MatroskaCluster, blocks), { .n = matroska_blockgroup } },
+ { MATROSKA_ID_SIMPLEBLOCK, EBML_PASS, sizeof(MatroskaBlock), offsetof(MatroskaCluster, blocks), { .n = matroska_blockgroup } },
+ { MATROSKA_ID_CLUSTERPOSITION, EBML_NONE },
+ { MATROSKA_ID_CLUSTERPREVSIZE, EBML_NONE },
{ 0 }
};
static EbmlSyntax matroska_clusters[] = {
- { MATROSKA_ID_CLUSTER, EBML_NEST, 0, 0, {.n=matroska_cluster} },
- { MATROSKA_ID_INFO, EBML_NONE },
- { MATROSKA_ID_CUES, EBML_NONE },
- { MATROSKA_ID_TAGS, EBML_NONE },
- { MATROSKA_ID_SEEKHEAD, EBML_NONE },
+ { MATROSKA_ID_CLUSTER, EBML_NEST, 0, 0, { .n = matroska_cluster } },
+ { MATROSKA_ID_INFO, EBML_NONE },
+ { MATROSKA_ID_CUES, EBML_NONE },
+ { MATROSKA_ID_TAGS, EBML_NONE },
+ { MATROSKA_ID_SEEKHEAD, EBML_NONE },
{ 0 }
};
static EbmlSyntax matroska_cluster_incremental_parsing[] = {
- { MATROSKA_ID_CLUSTERTIMECODE,EBML_UINT,0, offsetof(MatroskaCluster,timecode) },
- { MATROSKA_ID_BLOCKGROUP, EBML_NEST, sizeof(MatroskaBlock), offsetof(MatroskaCluster,blocks), {.n=matroska_blockgroup} },
- { MATROSKA_ID_SIMPLEBLOCK, EBML_PASS, sizeof(MatroskaBlock), offsetof(MatroskaCluster,blocks), {.n=matroska_blockgroup} },
- { MATROSKA_ID_CLUSTERPOSITION,EBML_NONE },
- { MATROSKA_ID_CLUSTERPREVSIZE,EBML_NONE },
- { MATROSKA_ID_INFO, EBML_NONE },
- { MATROSKA_ID_CUES, EBML_NONE },
- { MATROSKA_ID_TAGS, EBML_NONE },
- { MATROSKA_ID_SEEKHEAD, EBML_NONE },
- { MATROSKA_ID_CLUSTER, EBML_STOP },
+ { MATROSKA_ID_CLUSTERTIMECODE, EBML_UINT, 0, offsetof(MatroskaCluster, timecode) },
+ { MATROSKA_ID_BLOCKGROUP, EBML_NEST, sizeof(MatroskaBlock), offsetof(MatroskaCluster, blocks), { .n = matroska_blockgroup } },
+ { MATROSKA_ID_SIMPLEBLOCK, EBML_PASS, sizeof(MatroskaBlock), offsetof(MatroskaCluster, blocks), { .n = matroska_blockgroup } },
+ { MATROSKA_ID_CLUSTERPOSITION, EBML_NONE },
+ { MATROSKA_ID_CLUSTERPREVSIZE, EBML_NONE },
+ { MATROSKA_ID_INFO, EBML_NONE },
+ { MATROSKA_ID_CUES, EBML_NONE },
+ { MATROSKA_ID_TAGS, EBML_NONE },
+ { MATROSKA_ID_SEEKHEAD, EBML_NONE },
+ { MATROSKA_ID_CLUSTER, EBML_STOP },
{ 0 }
};
static EbmlSyntax matroska_cluster_incremental[] = {
- { MATROSKA_ID_CLUSTERTIMECODE,EBML_UINT,0, offsetof(MatroskaCluster,timecode) },
- { MATROSKA_ID_BLOCKGROUP, EBML_STOP },
- { MATROSKA_ID_SIMPLEBLOCK, EBML_STOP },
- { MATROSKA_ID_CLUSTERPOSITION,EBML_NONE },
- { MATROSKA_ID_CLUSTERPREVSIZE,EBML_NONE },
+ { MATROSKA_ID_CLUSTERTIMECODE, EBML_UINT, 0, offsetof(MatroskaCluster, timecode) },
+ { MATROSKA_ID_BLOCKGROUP, EBML_STOP },
+ { MATROSKA_ID_SIMPLEBLOCK, EBML_STOP },
+ { MATROSKA_ID_CLUSTERPOSITION, EBML_NONE },
+ { MATROSKA_ID_CLUSTERPREVSIZE, EBML_NONE },
{ 0 }
};
static EbmlSyntax matroska_clusters_incremental[] = {
- { MATROSKA_ID_CLUSTER, EBML_NEST, 0, 0, {.n=matroska_cluster_incremental} },
- { MATROSKA_ID_INFO, EBML_NONE },
- { MATROSKA_ID_CUES, EBML_NONE },
- { MATROSKA_ID_TAGS, EBML_NONE },
- { MATROSKA_ID_SEEKHEAD, EBML_NONE },
+ { MATROSKA_ID_CLUSTER, EBML_NEST, 0, 0, { .n = matroska_cluster_incremental } },
+ { MATROSKA_ID_INFO, EBML_NONE },
+ { MATROSKA_ID_CUES, EBML_NONE },
+ { MATROSKA_ID_TAGS, EBML_NONE },
+ { MATROSKA_ID_SEEKHEAD, EBML_NONE },
{ 0 }
};
@@ -655,11 +661,12 @@ static int matroska_resync(MatroskaDemuxContext *matroska, int64_t last_pos)
id == MATROSKA_ID_CUES || id == MATROSKA_ID_TAGS ||
id == MATROSKA_ID_SEEKHEAD || id == MATROSKA_ID_ATTACHMENTS ||
id == MATROSKA_ID_CLUSTER || id == MATROSKA_ID_CHAPTERS) {
- matroska->current_id = id;
- return 0;
+ matroska->current_id = id;
+ return 0;
}
id = (id << 8) | avio_r8(pb);
}
+
eof:
matroska->done = 1;
return AVERROR_EOF;
@@ -795,13 +802,13 @@ static int ebml_read_sint(AVIOContext *pb, int size, int64_t *num)
*/
static int ebml_read_float(AVIOContext *pb, int size, double *num)
{
- if (size == 0) {
+ if (size == 0)
*num = 0;
- } else if (size == 4) {
+ else if (size == 4)
*num = av_int2float(avio_rb32(pb));
- } else if (size == 8){
+ else if (size == 8)
*num = av_int2double(avio_rb64(pb));
- } else
+ else
return AVERROR_INVALIDDATA;
return 0;
@@ -867,8 +874,8 @@ static int ebml_read_master(MatroskaDemuxContext *matroska, uint64_t length)
return AVERROR(ENOSYS);
}
- level = &matroska->levels[matroska->num_levels++];
- level->start = avio_tell(pb);
+ level = &matroska->levels[matroska->num_levels++];
+ level->start = avio_tell(pb);
level->length = length;
return 0;
@@ -900,7 +907,7 @@ static int matroska_ebmlnum_sint(MatroskaDemuxContext *matroska,
return res;
/* make signed (weird way) */
- *num = unum - ((1LL << (7*res - 1)) - 1);
+ *num = unum - ((1LL << (7 * res - 1)) - 1);
return res;
}
@@ -912,15 +919,15 @@ static int ebml_parse_id(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
uint32_t id, void *data)
{
int i;
- for (i=0; syntax[i].id; i++)
+ for (i = 0; syntax[i].id; i++)
if (id == syntax[i].id)
break;
if (!syntax[i].id && id == MATROSKA_ID_CLUSTER &&
- matroska->num_levels > 0 &&
- matroska->levels[matroska->num_levels-1].length == 0xffffffffffffff)
+ matroska->num_levels > 0 &&
+ matroska->levels[matroska->num_levels - 1].length == 0xffffffffffffff)
return 0; // we reached the end of an unknown size cluster
if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) {
- av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%X\n", id);
+ av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%"PRIX32"\n", id);
if (matroska->ctx->error_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
@@ -935,7 +942,7 @@ static int ebml_parse(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
int res = ebml_read_num(matroska, matroska->ctx->pb, 4, &id);
if (res < 0)
return res;
- matroska->current_id = id | 1 << 7*res;
+ matroska->current_id = id | 1 << 7 * res;
}
return ebml_parse_id(matroska, syntax, matroska->current_id, data);
}
@@ -945,19 +952,19 @@ static int ebml_parse_nest(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
{
int i, res = 0;
- for (i=0; syntax[i].id; i++)
+ for (i = 0; syntax[i].id; i++)
switch (syntax[i].type) {
case EBML_UINT:
- *(uint64_t *)((char *)data+syntax[i].data_offset) = syntax[i].def.u;
+ *(uint64_t *) ((char *) data + syntax[i].data_offset) = syntax[i].def.u;
break;
case EBML_FLOAT:
- *(double *)((char *)data+syntax[i].data_offset) = syntax[i].def.f;
+ *(double *) ((char *) data + syntax[i].data_offset) = syntax[i].def.f;
break;
case EBML_STR:
case EBML_UTF8:
// the default may be NULL
if (syntax[i].def.s) {
- uint8_t **dst = (uint8_t**)((uint8_t*)data + syntax[i].data_offset);
+ uint8_t **dst = (uint8_t **) ((uint8_t *) data + syntax[i].data_offset);
*dst = av_strdup(syntax[i].def.s);
if (!*dst)
return AVERROR(ENOMEM);
@@ -990,14 +997,14 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska,
int res;
void *newelem;
- data = (char *)data + syntax->data_offset;
+ data = (char *) data + syntax->data_offset;
if (syntax->list_elem_size) {
EbmlList *list = data;
- newelem = av_realloc_array(list->elem, list->nb_elem+1, syntax->list_elem_size);
+ newelem = av_realloc_array(list->elem, list->nb_elem + 1, syntax->list_elem_size);
if (!newelem)
return AVERROR(ENOMEM);
list->elem = newelem;
- data = (char*)list->elem + list->nb_elem*syntax->list_elem_size;
+ data = (char *) list->elem + list->nb_elem * syntax->list_elem_size;
memset(data, 0, syntax->list_elem_size);
list->nb_elem++;
}
@@ -1015,23 +1022,36 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska,
}
switch (syntax->type) {
- case EBML_UINT: res = ebml_read_uint (pb, length, data); break;
- case EBML_SINT: res = ebml_read_sint (pb, length, data); break;
- case EBML_FLOAT: res = ebml_read_float (pb, length, data); break;
+ case EBML_UINT:
+ res = ebml_read_uint(pb, length, data);
+ break;
+ case EBML_SINT:
+ res = ebml_read_sint(pb, length, data);
+ break;
+ case EBML_FLOAT:
+ res = ebml_read_float(pb, length, data);
+ break;
case EBML_STR:
- case EBML_UTF8: res = ebml_read_ascii (pb, length, data); break;
- case EBML_BIN: res = ebml_read_binary(pb, length, data); break;
- case EBML_NEST: if ((res=ebml_read_master(matroska, length)) < 0)
- return res;
- if (id == MATROSKA_ID_SEGMENT)
- matroska->segment_start = avio_tell(matroska->ctx->pb);
- return ebml_parse_nest(matroska, syntax->def.n, data);
- case EBML_PASS: return ebml_parse_id(matroska, syntax->def.n, id, data);
- case EBML_STOP: return 1;
+ case EBML_UTF8:
+ res = ebml_read_ascii(pb, length, data);
+ break;
+ case EBML_BIN:
+ res = ebml_read_binary(pb, length, data);
+ break;
+ case EBML_NEST:
+ if ((res = ebml_read_master(matroska, length)) < 0)
+ return res;
+ if (id == MATROSKA_ID_SEGMENT)
+ matroska->segment_start = avio_tell(matroska->ctx->pb);
+ return ebml_parse_nest(matroska, syntax->def.n, data);
+ case EBML_PASS:
+ return ebml_parse_id(matroska, syntax->def.n, id, data);
+ case EBML_STOP:
+ return 1;
default:
- if(ffio_limit(pb, length) != length)
+ if (ffio_limit(pb, length) != length)
return AVERROR(EIO);
- return avio_skip(pb,length)<0 ? AVERROR(EIO) : 0;
+ return avio_skip(pb, length) < 0 ? AVERROR(EIO) : 0;
}
if (res == AVERROR_INVALIDDATA)
av_log(matroska->ctx, AV_LOG_ERROR, "Invalid element\n");
@@ -1043,27 +1063,32 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska,
static void ebml_free(EbmlSyntax *syntax, void *data)
{
int i, j;
- for (i=0; syntax[i].id; i++) {
- void *data_off = (char *)data + syntax[i].data_offset;
+ for (i = 0; syntax[i].id; i++) {
+ void *data_off = (char *) data + syntax[i].data_offset;
switch (syntax[i].type) {
case EBML_STR:
- case EBML_UTF8: av_freep(data_off); break;
- case EBML_BIN: av_freep(&((EbmlBin *)data_off)->data); break;
+ case EBML_UTF8:
+ av_freep(data_off);
+ break;
+ case EBML_BIN:
+ av_freep(&((EbmlBin *) data_off)->data);
+ break;
case EBML_NEST:
if (syntax[i].list_elem_size) {
EbmlList *list = data_off;
char *ptr = list->elem;
- for (j=0; j<list->nb_elem; j++, ptr+=syntax[i].list_elem_size)
+ for (j = 0; j < list->nb_elem;
+ j++, ptr += syntax[i].list_elem_size)
ebml_free(syntax[i].def.n, ptr);
av_free(list->elem);
} else
ebml_free(syntax[i].def.n, data_off);
- default: break;
+ default:
+ break;
}
}
}
-
/*
* Autodetecting...
*/
@@ -1083,14 +1108,14 @@ static int matroska_probe(AVProbeData *p)
len_mask >>= 1;
}
if (size > 8)
- return 0;
+ return 0;
total &= (len_mask - 1);
while (n < size)
total = (total << 8) | p->buf[4 + n++];
/* Does the probe data contain the whole header? */
if (p->buf_size < 4 + size + total)
- return 0;
+ return 0;
/* The header should contain a known document type. For now,
* we don't parse the whole header but simply check for the
@@ -1100,8 +1125,8 @@ static int matroska_probe(AVProbeData *p)
int probelen = strlen(matroska_doctypes[i]);
if (total < probelen)
continue;
- for (n = 4+size; n <= 4+size+total-probelen; n++)
- if (!memcmp(p->buf+n, matroska_doctypes[i], probelen))
+ for (n = 4 + size; n <= 4 + size + total - probelen; n++)
+ if (!memcmp(p->buf + n, matroska_doctypes[i], probelen))
return AVPROBE_SCORE_MAX;
}
@@ -1115,7 +1140,7 @@ static MatroskaTrack *matroska_find_track_by_num(MatroskaDemuxContext *matroska,
MatroskaTrack *tracks = matroska->tracks.elem;
int i;
- for (i=0; i < matroska->tracks.nb_elem; i++)
+ for (i = 0; i < matroska->tracks.nb_elem; i++)
if (tracks[i].num == num)
return &tracks[i];
@@ -1123,13 +1148,13 @@ static MatroskaTrack *matroska_find_track_by_num(MatroskaDemuxContext *matroska,
return NULL;
}
-static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
+static int matroska_decode_buffer(uint8_t **buf, int *buf_size,
MatroskaTrack *track)
{
MatroskaTrackEncoding *encodings = track->encodings.elem;
- uint8_t* data = *buf;
+ uint8_t *data = *buf;
int isize = *buf_size;
- uint8_t* pkt_data = NULL;
+ uint8_t *pkt_data = NULL;
uint8_t av_unused *newpktdata;
int pkt_size = isize;
int result = 0;
@@ -1139,7 +1164,8 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
return AVERROR_INVALIDDATA;
switch (encodings[0].compression.algo) {
- case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP: {
+ case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
+ {
int header_size = encodings[0].compression.settings.size;
uint8_t *header = encodings[0].compression.settings.data;
@@ -1163,15 +1189,15 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
#if CONFIG_LZO
case MATROSKA_TRACK_ENCODING_COMP_LZO:
do {
- olen = pkt_size *= 3;
+ olen = pkt_size *= 3;
newpktdata = av_realloc(pkt_data, pkt_size + AV_LZO_OUTPUT_PADDING);
if (!newpktdata) {
result = AVERROR(ENOMEM);
goto failed;
}
pkt_data = newpktdata;
- result = av_lzo1x_decode(pkt_data, &olen, data, &isize);
- } while (result==AV_LZO_OUTPUT_FULL && pkt_size<10000000);
+ result = av_lzo1x_decode(pkt_data, &olen, data, &isize);
+ } while (result == AV_LZO_OUTPUT_FULL && pkt_size < 10000000);
if (result) {
result = AVERROR_INVALIDDATA;
goto failed;
@@ -1180,27 +1206,28 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
break;
#endif
#if CONFIG_ZLIB
- case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
- z_stream zstream = {0};
+ case MATROSKA_TRACK_ENCODING_COMP_ZLIB:
+ {
+ z_stream zstream = { 0 };
if (inflateInit(&zstream) != Z_OK)
return -1;
- zstream.next_in = data;
+ zstream.next_in = data;
zstream.avail_in = isize;
do {
- pkt_size *= 3;
+ pkt_size *= 3;
newpktdata = av_realloc(pkt_data, pkt_size);
if (!newpktdata) {
inflateEnd(&zstream);
goto failed;
}
- pkt_data = newpktdata;
+ pkt_data = newpktdata;
zstream.avail_out = pkt_size - zstream.total_out;
- zstream.next_out = pkt_data + zstream.total_out;
+ zstream.next_out = pkt_data + zstream.total_out;
if (pkt_data) {
result = inflate(&zstream, Z_NO_FLUSH);
} else
result = Z_MEM_ERROR;
- } while (result==Z_OK && pkt_size<10000000);
+ } while (result == Z_OK && pkt_size < 10000000);
pkt_size = zstream.total_out;
inflateEnd(&zstream);
if (result != Z_STREAM_END) {
@@ -1214,27 +1241,28 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
}
#endif
#if CONFIG_BZLIB
- case MATROSKA_TRACK_ENCODING_COMP_BZLIB: {
- bz_stream bzstream = {0};
+ case MATROSKA_TRACK_ENCODING_COMP_BZLIB:
+ {
+ bz_stream bzstream = { 0 };
if (BZ2_bzDecompressInit(&bzstream, 0, 0) != BZ_OK)
return -1;
- bzstream.next_in = data;
+ bzstream.next_in = data;
bzstream.avail_in = isize;
do {
- pkt_size *= 3;
+ pkt_size *= 3;
newpktdata = av_realloc(pkt_data, pkt_size);
if (!newpktdata) {
BZ2_bzDecompressEnd(&bzstream);
goto failed;
}
- pkt_data = newpktdata;
+ pkt_data = newpktdata;
bzstream.avail_out = pkt_size - bzstream.total_out_lo32;
- bzstream.next_out = pkt_data + bzstream.total_out_lo32;
+ bzstream.next_out = pkt_data + bzstream.total_out_lo32;
if (pkt_data) {
result = BZ2_bzDecompress(&bzstream);
} else
result = BZ_MEM_ERROR;
- } while (result==BZ_OK && pkt_size<10000000);
+ } while (result == BZ_OK && pkt_size < 10000000);
pkt_size = bzstream.total_out_lo32;
BZ2_bzDecompressEnd(&bzstream);
if (result != BZ_STREAM_END) {
@@ -1251,10 +1279,11 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
return AVERROR_INVALIDDATA;
}
- *buf = pkt_data;
+ *buf = pkt_data;
*buf_size = pkt_size;
return 0;
- failed:
+
+failed:
av_free(pkt_data);
return result;
}
@@ -1264,28 +1293,38 @@ static void matroska_fix_ass_packet(MatroskaDemuxContext *matroska,
AVPacket *pkt, uint64_t display_duration)
{
AVBufferRef *line;
- char *layer, *ptr = pkt->data, *end = ptr+pkt->size;
- for (; *ptr!=',' && ptr<end-1; ptr++);
+ char *layer, *ptr = pkt->data, *end = ptr + pkt->size;
+
+ for (; *ptr != ',' && ptr < end - 1; ptr++)
+ ;
if (*ptr == ',')
ptr++;
layer = ptr;
- for (; *ptr!=',' && ptr<end-1; ptr++);
+ for (; *ptr != ',' && ptr < end - 1; ptr++)
+ ;
if (*ptr == ',') {
int64_t end_pts = pkt->pts + display_duration;
int sc = matroska->time_scale * pkt->pts / 10000000;
int ec = matroska->time_scale * end_pts / 10000000;
int sh, sm, ss, eh, em, es, len;
- sh = sc/360000; sc -= 360000*sh;
- sm = sc/ 6000; sc -= 6000*sm;
- ss = sc/ 100; sc -= 100*ss;
- eh = ec/360000; ec -= 360000*eh;
- em = ec/ 6000; ec -= 6000*em;
- es = ec/ 100; ec -= 100*es;
+ sh = sc / 360000;
+ sc -= 360000 * sh;
+ sm = sc / 6000;
+ sc -= 6000 * sm;
+ ss = sc / 100;
+ sc -= 100 * ss;
+ eh = ec / 360000;
+ ec -= 360000 * eh;
+ em = ec / 6000;
+ ec -= 6000 * em;
+ es = ec / 100;
+ ec -= 100 * es;
*ptr++ = '\0';
- len = 50 + end-ptr + FF_INPUT_BUFFER_PADDING_SIZE;
+ len = 50 + end - ptr + FF_INPUT_BUFFER_PADDING_SIZE;
if (!(line = av_buffer_alloc(len)))
return;
- snprintf(line->data, len,"Dialogue: %s,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s\r\n",
+ snprintf(line->data, len,
+ "Dialogue: %s,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s\r\n",
layer, sh, sm, ss, sc, eh, em, es, ec, ptr);
av_buffer_unref(&pkt->buf);
pkt->buf = line;
@@ -1315,20 +1354,22 @@ static void matroska_convert_tag(AVFormatContext *s, EbmlList *list,
char key[1024];
int i;
- for (i=0; i < list->nb_elem; i++) {
- const char *lang = tags[i].lang && strcmp(tags[i].lang, "und") ?
- tags[i].lang : NULL;
+ for (i = 0; i < list->nb_elem; i++) {
+ const char *lang = tags[i].lang &&
+ strcmp(tags[i].lang, "und") ? tags[i].lang : NULL;
if (!tags[i].name) {
av_log(s, AV_LOG_WARNING, "Skipping invalid tag with no TagName.\n");
continue;
}
- if (prefix) snprintf(key, sizeof(key), "%s/%s", prefix, tags[i].name);
- else av_strlcpy(key, tags[i].name, sizeof(key));
+ if (prefix)
+ snprintf(key, sizeof(key), "%s/%s", prefix, tags[i].name);
+ else
+ av_strlcpy(key, tags[i].name, sizeof(key));
if (tags[i].def || !lang) {
- av_dict_set(metadata, key, tags[i].string, 0);
- if (tags[i].sub.nb_elem)
- matroska_convert_tag(s, &tags[i].sub, metadata, key);
+ av_dict_set(metadata, key, tags[i].string, 0);
+ if (tags[i].sub.nb_elem)
+ matroska_convert_tag(s, &tags[i].sub, metadata, key);
}
if (lang) {
av_strlcat(key, "-", sizeof(key));
@@ -1347,24 +1388,24 @@ static void matroska_convert_tags(AVFormatContext *s)
MatroskaTags *tags = matroska->tags.elem;
int i, j;
- for (i=0; i < matroska->tags.nb_elem; i++) {
+ for (i = 0; i < matroska->tags.nb_elem; i++) {
if (tags[i].target.attachuid) {
- MatroskaAttachement *attachment = matroska->attachments.elem;
- for (j=0; j<matroska->attachments.nb_elem; j++)
- if (attachment[j].uid == tags[i].target.attachuid
- && attachment[j].stream)
+ MatroskaAttachment *attachment = matroska->attachments.elem;
+ for (j = 0; j < matroska->attachments.nb_elem; j++)
+ if (attachment[j].uid == tags[i].target.attachuid &&
+ attachment[j].stream)
matroska_convert_tag(s, &tags[i].tag,
&attachment[j].stream->metadata, NULL);
} else if (tags[i].target.chapteruid) {
MatroskaChapter *chapter = matroska->chapters.elem;
- for (j=0; j<matroska->chapters.nb_elem; j++)
- if (chapter[j].uid == tags[i].target.chapteruid
- && chapter[j].chapter)
+ for (j = 0; j < matroska->chapters.nb_elem; j++)
+ if (chapter[j].uid == tags[i].target.chapteruid &&
+ chapter[j].chapter)
matroska_convert_tag(s, &tags[i].tag,
&chapter[j].chapter->metadata, NULL);
} else if (tags[i].target.trackuid) {
MatroskaTrack *track = matroska->tracks.elem;
- for (j=0; j<matroska->tracks.nb_elem; j++)
+ for (j = 0; j < matroska->tracks.nb_elem; j++)
if (track[j].uid == tags[i].target.trackuid && track[j].stream)
matroska_convert_tag(s, &tags[i].tag,
&track[j].stream->metadata, NULL);
@@ -1375,20 +1416,21 @@ static void matroska_convert_tags(AVFormatContext *s)
}
}
-static int matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska, int idx)
+static int matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska,
+ int idx)
{
EbmlList *seekhead_list = &matroska->seekhead;
+ uint32_t level_up = matroska->level_up;
+ uint32_t saved_id = matroska->current_id;
MatroskaSeekhead *seekhead = seekhead_list->elem;
- uint32_t level_up = matroska->level_up;
int64_t before_pos = avio_tell(matroska->ctx->pb);
- uint32_t saved_id = matroska->current_id;
MatroskaLevel level;
int64_t offset;
int ret = 0;
- if (idx >= seekhead_list->nb_elem
- || seekhead[idx].id == MATROSKA_ID_SEEKHEAD
- || seekhead[idx].id == MATROSKA_ID_CLUSTER)
+ if (idx >= seekhead_list->nb_elem ||
+ seekhead[idx].id == MATROSKA_ID_SEEKHEAD ||
+ seekhead[idx].id == MATROSKA_ID_CLUSTER)
return 0;
/* seek */
@@ -1402,25 +1444,25 @@ static int matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska, int idx
"cannot parse further.\n", EBML_MAX_DEPTH);
ret = AVERROR_INVALIDDATA;
} else {
- level.start = 0;
- level.length = (uint64_t)-1;
+ level.start = 0;
+ level.length = (uint64_t) -1;
matroska->levels[matroska->num_levels] = level;
matroska->num_levels++;
- matroska->current_id = 0;
+ matroska->current_id = 0;
ret = ebml_parse(matroska, matroska_segment, matroska);
/* remove dummy level */
while (matroska->num_levels) {
uint64_t length = matroska->levels[--matroska->num_levels].length;
- if (length == (uint64_t)-1)
+ if (length == (uint64_t) -1)
break;
}
}
}
/* seek back */
avio_seek(matroska->ctx->pb, before_pos, SEEK_SET);
- matroska->level_up = level_up;
+ matroska->level_up = level_up;
matroska->current_id = saved_id;
return ret;
@@ -1456,28 +1498,30 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)
}
}
-static void matroska_add_index_entries(MatroskaDemuxContext *matroska) {
+static void matroska_add_index_entries(MatroskaDemuxContext *matroska)
+{
EbmlList *index_list;
MatroskaIndex *index;
int index_scale = 1;
int i, j;
index_list = &matroska->index;
- index = index_list->elem;
- if (index_list->nb_elem
- && index[0].time > 1E14/matroska->time_scale) {
+ index = index_list->elem;
+ if (index_list->nb_elem &&
+ index[0].time > 1E14 / matroska->time_scale) {
av_log(matroska->ctx, AV_LOG_WARNING, "Working around broken index.\n");
index_scale = matroska->time_scale;
}
for (i = 0; i < index_list->nb_elem; i++) {
- EbmlList *pos_list = &index[i].pos;
+ EbmlList *pos_list = &index[i].pos;
MatroskaIndexPos *pos = pos_list->elem;
for (j = 0; j < pos_list->nb_elem; j++) {
- MatroskaTrack *track = matroska_find_track_by_num(matroska, pos[j].track);
+ MatroskaTrack *track = matroska_find_track_by_num(matroska,
+ pos[j].track);
if (track && track->stream)
av_add_index_entry(track->stream,
pos[j].pos + matroska->segment_start,
- index[i].time/index_scale, 0, 0,
+ index[i].time / index_scale, 0, 0,
AVINDEX_KEYFRAME);
}
}
@@ -1500,10 +1544,10 @@ static void matroska_parse_cues(MatroskaDemuxContext *matroska) {
static int matroska_aac_profile(char *codec_id)
{
- static const char * const aac_profiles[] = { "MAIN", "LC", "SSR" };
+ static const char *const aac_profiles[] = { "MAIN", "LC", "SSR" };
int profile;
- for (profile=0; profile<FF_ARRAY_ELEMS(aac_profiles); profile++)
+ for (profile = 0; profile < FF_ARRAY_ELEMS(aac_profiles); profile++)
if (strstr(codec_id, aac_profiles[profile]))
break;
return profile + 1;
@@ -1513,7 +1557,7 @@ static int matroska_aac_sri(int samplerate)
{
int sri;
- for (sri=0; sri<FF_ARRAY_ELEMS(avpriv_mpeg4audio_sample_rates); sri++)
+ for (sri = 0; sri < FF_ARRAY_ELEMS(avpriv_mpeg4audio_sample_rates); sri++)
if (avpriv_mpeg4audio_sample_rates[sri] == samplerate)
break;
return sri;
@@ -1533,9 +1577,9 @@ static void matroska_metadata_creation_time(AVDictionary **metadata, int64_t dat
static int matroska_read_header(AVFormatContext *s)
{
MatroskaDemuxContext *matroska = s->priv_data;
- EbmlList *attachements_list = &matroska->attachments;
- MatroskaAttachement *attachements;
- EbmlList *chapters_list = &matroska->chapters;
+ EbmlList *attachments_list = &matroska->attachments;
+ EbmlList *chapters_list = &matroska->chapters;
+ MatroskaAttachment *attachments;
MatroskaChapter *chapters;
MatroskaTrack *tracks;
uint64_t max_start = 0;
@@ -1547,9 +1591,12 @@ static int matroska_read_header(AVFormatContext *s)
matroska->ctx = s;
/* First read the EBML header. */
- if (ebml_parse(matroska, ebml_syntax, &ebml)
- || ebml.version > EBML_VERSION || ebml.max_size > sizeof(uint64_t)
- || ebml.id_length > sizeof(uint32_t) || ebml.doctype_version > 3 || !ebml.doctype) {
+ if (ebml_parse(matroska, ebml_syntax, &ebml) ||
+ ebml.version > EBML_VERSION ||
+ ebml.max_size > sizeof(uint64_t) ||
+ ebml.id_length > sizeof(uint32_t) ||
+ ebml.doctype_version > 3 ||
+ !ebml.doctype) {
av_log(matroska->ctx, AV_LOG_ERROR,
"EBML header using unsupported features\n"
"(EBML version %"PRIu64", doctype %s, doc version %"PRIu64")\n",
@@ -1590,15 +1637,16 @@ static int matroska_read_header(AVFormatContext *s)
if (!matroska->time_scale)
matroska->time_scale = 1000000;
if (matroska->duration)
- matroska->ctx->duration = matroska->duration * matroska->time_scale
- * 1000 / AV_TIME_BASE;
+ matroska->ctx->duration = matroska->duration * matroska->time_scale *
+ 1000 / AV_TIME_BASE;
av_dict_set(&s->metadata, "title", matroska->title, 0);
+ av_dict_set(&s->metadata, "encoder", matroska->muxingapp, 0);
if (matroska->date_utc.size == 8)
matroska_metadata_creation_time(&s->metadata, AV_RB64(matroska->date_utc.data));
tracks = matroska->tracks.elem;
- for (i=0; i < matroska->tracks.nb_elem; i++) {
+ for (i = 0; i < matroska->tracks.nb_elem; i++) {
MatroskaTrack *track = &tracks[i];
enum AVCodecID codec_id = AV_CODEC_ID_NONE;
EbmlList *encodings_list = &track->encodings;
@@ -1609,6 +1657,7 @@ static int matroska_read_header(AVFormatContext *s)
uint32_t fourcc = 0;
AVIOContext b;
char* key_id_base64 = NULL;
+ int bit_depth = -1;
/* Apply some sanity checks. */
if (track->type != MATROSKA_TRACK_TYPE_VIDEO &&
@@ -1625,7 +1674,7 @@ static int matroska_read_header(AVFormatContext *s)
if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
if (!track->default_duration && track->video.frame_rate > 0)
- track->default_duration = 1000000000/track->video.frame_rate;
+ track->default_duration = 1000000000 / track->video.frame_rate;
if (track->video.display_width == -1)
track->video.display_width = track->video.pixel_width;
if (track->video.display_height == -1)
@@ -1659,19 +1708,19 @@ static int matroska_read_header(AVFormatContext *s)
}
} else if (
#if CONFIG_ZLIB
- encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_ZLIB &&
+ encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_ZLIB &&
#endif
#if CONFIG_BZLIB
encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_BZLIB &&
#endif
#if CONFIG_LZO
- encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_LZO &&
+ encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_LZO &&
#endif
encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP) {
encodings[0].scope = 0;
av_log(matroska->ctx, AV_LOG_ERROR,
"Unsupported encoding type");
- } else if (track->codec_priv.size && encodings[0].scope&2) {
+ } else if (track->codec_priv.size && encodings[0].scope & 2) {
uint8_t *codec_priv = track->codec_priv.data;
int ret = matroska_decode_buffer(&track->codec_priv.data,
&track->codec_priv.size,
@@ -1688,10 +1737,10 @@ static int matroska_read_header(AVFormatContext *s)
}
}
- for(j=0; ff_mkv_codec_tags[j].id != AV_CODEC_ID_NONE; j++){
- if(!strncmp(ff_mkv_codec_tags[j].str, track->codec_id,
- strlen(ff_mkv_codec_tags[j].str))){
- codec_id= ff_mkv_codec_tags[j].id;
+ for (j = 0; ff_mkv_codec_tags[j].id != AV_CODEC_ID_NONE; j++) {
+ if (!strncmp(ff_mkv_codec_tags[j].str, track->codec_id,
+ strlen(ff_mkv_codec_tags[j].str))) {
+ codec_id = ff_mkv_codec_tags[j].id;
break;
}
}
@@ -1708,79 +1757,114 @@ static int matroska_read_header(AVFormatContext *s)
av_freep(&key_id_base64);
}
- if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC")
- && track->codec_priv.size >= 40
- && track->codec_priv.data != NULL) {
- track->ms_compat = 1;
- fourcc = AV_RL32(track->codec_priv.data + 16);
- codec_id = ff_codec_get_id(ff_codec_bmp_tags, fourcc);
- extradata_offset = 40;
- } else if (!strcmp(track->codec_id, "A_MS/ACM")
- && track->codec_priv.size >= 14
- && track->codec_priv.data != NULL) {
+ if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC") &&
+ track->codec_priv.size >= 40 &&
+ track->codec_priv.data != NULL) {
+ track->ms_compat = 1;
+ bit_depth = AV_RL16(track->codec_priv.data + 14);
+ fourcc = AV_RL32(track->codec_priv.data + 16);
+ codec_id = ff_codec_get_id(ff_codec_bmp_tags,
+ fourcc);
+ if (!codec_id)
+ codec_id = ff_codec_get_id(ff_codec_movvideo_tags,
+ fourcc);
+ extradata_offset = 40;
+ } else if (!strcmp(track->codec_id, "A_MS/ACM") &&
+ track->codec_priv.size >= 14 &&
+ track->codec_priv.data != NULL) {
int ret;
- ffio_init_context(&b, track->codec_priv.data, track->codec_priv.size,
+ ffio_init_context(&b, track->codec_priv.data,
+ track->codec_priv.size,
0, NULL, NULL, NULL, NULL);
ret = ff_get_wav_header(&b, st->codec, track->codec_priv.size);
if (ret < 0)
return ret;
- codec_id = st->codec->codec_id;
+ codec_id = st->codec->codec_id;
extradata_offset = FFMIN(track->codec_priv.size, 18);
- } else if (!strcmp(track->codec_id, "V_QUICKTIME")
+ } else if (!strcmp(track->codec_id, "A_QUICKTIME")
&& (track->codec_priv.size >= 86)
&& (track->codec_priv.data != NULL)) {
- fourcc = AV_RL32(track->codec_priv.data);
+ fourcc = AV_RL32(track->codec_priv.data + 4);
+ codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
+ if (ff_codec_get_id(ff_codec_movaudio_tags, AV_RL32(track->codec_priv.data))) {
+ fourcc = AV_RL32(track->codec_priv.data);
+ codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
+ }
+ } else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
+ (track->codec_priv.size >= 21) &&
+ (track->codec_priv.data != NULL)) {
+ fourcc = AV_RL32(track->codec_priv.data + 4);
codec_id = ff_codec_get_id(ff_codec_movvideo_tags, fourcc);
+ if (ff_codec_get_id(ff_codec_movvideo_tags, AV_RL32(track->codec_priv.data))) {
+ fourcc = AV_RL32(track->codec_priv.data);
+ codec_id = ff_codec_get_id(ff_codec_movvideo_tags, fourcc);
+ }
+ if (codec_id == AV_CODEC_ID_NONE && AV_RL32(track->codec_priv.data+4) == AV_RL32("SMI "))
+ codec_id = AV_CODEC_ID_SVQ3;
} else if (codec_id == AV_CODEC_ID_PCM_S16BE) {
switch (track->audio.bitdepth) {
- case 8: codec_id = AV_CODEC_ID_PCM_U8; break;
- case 24: codec_id = AV_CODEC_ID_PCM_S24BE; break;
- case 32: codec_id = AV_CODEC_ID_PCM_S32BE; break;
+ case 8:
+ codec_id = AV_CODEC_ID_PCM_U8;
+ break;
+ case 24:
+ codec_id = AV_CODEC_ID_PCM_S24BE;
+ break;
+ case 32:
+ codec_id = AV_CODEC_ID_PCM_S32BE;
+ break;
}
} else if (codec_id == AV_CODEC_ID_PCM_S16LE) {
switch (track->audio.bitdepth) {
- case 8: codec_id = AV_CODEC_ID_PCM_U8; break;
- case 24: codec_id = AV_CODEC_ID_PCM_S24LE; break;
- case 32: codec_id = AV_CODEC_ID_PCM_S32LE; break;
+ case 8:
+ codec_id = AV_CODEC_ID_PCM_U8;
+ break;
+ case 24:
+ codec_id = AV_CODEC_ID_PCM_S24LE;
+ break;
+ case 32:
+ codec_id = AV_CODEC_ID_PCM_S32LE;
+ break;
}
- } else if (codec_id==AV_CODEC_ID_PCM_F32LE && track->audio.bitdepth==64) {
+ } else if (codec_id == AV_CODEC_ID_PCM_F32LE &&
+ track->audio.bitdepth == 64) {
codec_id = AV_CODEC_ID_PCM_F64LE;
} else if (codec_id == AV_CODEC_ID_AAC && !track->codec_priv.size) {
int profile = matroska_aac_profile(track->codec_id);
- int sri = matroska_aac_sri(track->audio.samplerate);
- extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
+ int sri = matroska_aac_sri(track->audio.samplerate);
+ extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
if (extradata == NULL)
return AVERROR(ENOMEM);
- extradata[0] = (profile << 3) | ((sri&0x0E) >> 1);
- extradata[1] = ((sri&0x01) << 7) | (track->audio.channels<<3);
+ extradata[0] = (profile << 3) | ((sri & 0x0E) >> 1);
+ extradata[1] = ((sri & 0x01) << 7) | (track->audio.channels << 3);
if (strstr(track->codec_id, "SBR")) {
- sri = matroska_aac_sri(track->audio.out_samplerate);
- extradata[2] = 0x56;
- extradata[3] = 0xE5;
- extradata[4] = 0x80 | (sri<<3);
+ sri = matroska_aac_sri(track->audio.out_samplerate);
+ extradata[2] = 0x56;
+ extradata[3] = 0xE5;
+ extradata[4] = 0x80 | (sri << 3);
extradata_size = 5;
} else
extradata_size = 2;
} else if (codec_id == AV_CODEC_ID_ALAC && track->codec_priv.size && track->codec_priv.size < INT_MAX - 12 - FF_INPUT_BUFFER_PADDING_SIZE) {
/* Only ALAC's magic cookie is stored in Matroska's track headers.
- Create the "atom size", "tag", and "tag version" fields the
- decoder expects manually. */
+ * Create the "atom size", "tag", and "tag version" fields the
+ * decoder expects manually. */
extradata_size = 12 + track->codec_priv.size;
- extradata = av_mallocz(extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ extradata = av_mallocz(extradata_size +
+ FF_INPUT_BUFFER_PADDING_SIZE);
if (extradata == NULL)
return AVERROR(ENOMEM);
AV_WB32(extradata, extradata_size);
memcpy(&extradata[4], "alac", 4);
AV_WB32(&extradata[8], 0);
memcpy(&extradata[12], track->codec_priv.data,
- track->codec_priv.size);
+ track->codec_priv.size);
} else if (codec_id == AV_CODEC_ID_TTA) {
extradata_size = 30;
- extradata = av_mallocz(extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ extradata = av_mallocz(extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (extradata == NULL)
return AVERROR(ENOMEM);
ffio_init_context(&b, extradata, extradata_size, 1,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL);
avio_write(&b, "TTA1", 4);
avio_wl16(&b, 1);
avio_wl16(&b, track->audio.channels);
@@ -1788,21 +1872,28 @@ static int matroska_read_header(AVFormatContext *s)
if (track->audio.out_samplerate < 0 || track->audio.out_samplerate > INT_MAX)
return AVERROR_INVALIDDATA;
avio_wl32(&b, track->audio.out_samplerate);
- avio_wl32(&b, av_rescale((matroska->duration * matroska->time_scale), track->audio.out_samplerate, AV_TIME_BASE * 1000));
- } else if (codec_id == AV_CODEC_ID_RV10 || codec_id == AV_CODEC_ID_RV20 ||
- codec_id == AV_CODEC_ID_RV30 || codec_id == AV_CODEC_ID_RV40) {
+ avio_wl32(&b, av_rescale((matroska->duration * matroska->time_scale),
+ track->audio.out_samplerate,
+ AV_TIME_BASE * 1000));
+ } else if (codec_id == AV_CODEC_ID_RV10 ||
+ codec_id == AV_CODEC_ID_RV20 ||
+ codec_id == AV_CODEC_ID_RV30 ||
+ codec_id == AV_CODEC_ID_RV40) {
extradata_offset = 26;
} else if (codec_id == AV_CODEC_ID_RA_144) {
track->audio.out_samplerate = 8000;
- track->audio.channels = 1;
- } else if ((codec_id == AV_CODEC_ID_RA_288 || codec_id == AV_CODEC_ID_COOK ||
- codec_id == AV_CODEC_ID_ATRAC3 || codec_id == AV_CODEC_ID_SIPR)
- && track->codec_priv.data) {
+ track->audio.channels = 1;
+ } else if ((codec_id == AV_CODEC_ID_RA_288 ||
+ codec_id == AV_CODEC_ID_COOK ||
+ codec_id == AV_CODEC_ID_ATRAC3 ||
+ codec_id == AV_CODEC_ID_SIPR)
+ && track->codec_priv.data) {
#if CONFIG_RA_288_DECODER || CONFIG_COOK_DECODER || CONFIG_ATRAC3_DECODER || CONFIG_SIPR_DECODER
int flavor;
- ffio_init_context(&b, track->codec_priv.data,track->codec_priv.size,
- 0, NULL, NULL, NULL, NULL);
+ ffio_init_context(&b, track->codec_priv.data,
+ track->codec_priv.size,
+ 0, NULL, NULL, NULL, NULL);
avio_skip(&b, 22);
flavor = avio_rb16(&b);
track->audio.coded_framesize = avio_rb32(&b);
@@ -1810,11 +1901,14 @@ static int matroska_read_header(AVFormatContext *s)
track->audio.sub_packet_h = avio_rb16(&b);
track->audio.frame_size = avio_rb16(&b);
track->audio.sub_packet_size = avio_rb16(&b);
- if (flavor <= 0 || track->audio.coded_framesize <= 0 ||
- track->audio.sub_packet_h <= 0 || track->audio.frame_size <= 0 ||
+ if (flavor < 0 ||
+ track->audio.coded_framesize <= 0 ||
+ track->audio.sub_packet_h <= 0 ||
+ track->audio.frame_size <= 0 ||
track->audio.sub_packet_size <= 0)
return AVERROR_INVALIDDATA;
- track->audio.buf = av_malloc_array(track->audio.sub_packet_h, track->audio.frame_size);
+ track->audio.buf = av_malloc_array(track->audio.sub_packet_h,
+ track->audio.frame_size);
if (!track->audio.buf)
return AVERROR(ENOMEM);
if (codec_id == AV_CODEC_ID_RA_288) {
@@ -1824,16 +1918,18 @@ static int matroska_read_header(AVFormatContext *s)
if (codec_id == AV_CODEC_ID_SIPR && flavor < 4) {
static const int sipr_bit_rate[4] = { 6504, 8496, 5000, 16000 };
track->audio.sub_packet_size = ff_sipr_subpk_size[flavor];
- st->codec->bit_rate = sipr_bit_rate[flavor];
+ st->codec->bit_rate = sipr_bit_rate[flavor];
}
st->codec->block_align = track->audio.sub_packet_size;
- extradata_offset = 78;
+ extradata_offset = 78;
}
#else
/* Returning without closing would cause leaks with some files */
matroska_read_close(s);
return AVERROR_INVALIDDATA;
#endif
+ } else if (codec_id == AV_CODEC_ID_PRORES && track->codec_priv.size == 4) {
+ fourcc = AV_RL32(track->codec_priv.data);
}
track->codec_priv.size -= extradata_offset;
@@ -1843,10 +1939,16 @@ static int matroska_read_header(AVFormatContext *s)
if (track->time_scale < 0.01)
track->time_scale = 1.0;
- avpriv_set_pts_info(st, 64, matroska->time_scale*track->time_scale, 1000*1000*1000); /* 64 bit pts in ns */
+ avpriv_set_pts_info(st, 64, matroska->time_scale * track->time_scale,
+ 1000 * 1000 * 1000); /* 64 bit pts in ns */
+
+ /* convert the delay from ns to the track timebase */
+ track->codec_delay = av_rescale_q(track->codec_delay,
+ (AVRational){ 1, 1000000000 },
+ st->time_base);
st->codec->codec_id = codec_id;
- st->start_time = 0;
+
if (strcmp(track->language, "und"))
av_dict_set(&st->metadata, "language", track->language, 0);
av_dict_set(&st->metadata, "title", track->name, 0);
@@ -1857,10 +1959,10 @@ static int matroska_read_header(AVFormatContext *s)
st->disposition |= AV_DISPOSITION_FORCED;
if (!st->codec->extradata) {
- if(extradata){
- st->codec->extradata = extradata;
+ if (extradata) {
+ st->codec->extradata = extradata;
st->codec->extradata_size = extradata_size;
- } else if(track->codec_priv.data && track->codec_priv.size > 0){
+ } else if (track->codec_priv.data && track->codec_priv.size > 0) {
if (ff_alloc_extradata(st->codec, track->codec_priv.size))
return AVERROR(ENOMEM);
memcpy(st->codec->extradata,
@@ -1874,12 +1976,14 @@ static int matroska_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_tag = fourcc;
- st->codec->width = track->video.pixel_width;
- st->codec->height = track->video.pixel_height;
+ if (bit_depth >= 0)
+ st->codec->bits_per_coded_sample = bit_depth;
+ st->codec->width = track->video.pixel_width;
+ st->codec->height = track->video.pixel_height;
av_reduce(&st->sample_aspect_ratio.num,
&st->sample_aspect_ratio.den,
st->codec->height * track->video.display_width,
- st->codec-> width * track->video.display_height,
+ st->codec->width * track->video.display_height,
255);
if (st->codec->codec_id != AV_CODEC_ID_HEVC)
st->need_parsing = AVSTREAM_PARSE_HEADERS;
@@ -1916,15 +2020,16 @@ static int matroska_read_header(AVFormatContext *s)
}
}
} else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) {
- st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->sample_rate = track->audio.out_samplerate;
- st->codec->channels = track->audio.channels;
- st->codec->bits_per_coded_sample = track->audio.bitdepth;
+ st->codec->channels = track->audio.channels;
+ if (!st->codec->bits_per_coded_sample)
+ st->codec->bits_per_coded_sample = track->audio.bitdepth;
if (st->codec->codec_id != AV_CODEC_ID_AAC)
- st->need_parsing = AVSTREAM_PARSE_HEADERS;
+ st->need_parsing = AVSTREAM_PARSE_HEADERS;
if (track->codec_delay > 0) {
st->codec->delay = av_rescale_q(track->codec_delay,
- (AVRational){1, 1000000000},
+ st->time_base,
(AVRational){1, st->codec->sample_rate});
}
if (track->seek_preroll > 0) {
@@ -1955,44 +2060,46 @@ static int matroska_read_header(AVFormatContext *s)
}
}
- attachements = attachements_list->elem;
- for (j=0; j<attachements_list->nb_elem; j++) {
- if (!(attachements[j].filename && attachements[j].mime &&
- attachements[j].bin.data && attachements[j].bin.size > 0)) {
+ attachments = attachments_list->elem;
+ for (j = 0; j < attachments_list->nb_elem; j++) {
+ if (!(attachments[j].filename && attachments[j].mime &&
+ attachments[j].bin.data && attachments[j].bin.size > 0)) {
av_log(matroska->ctx, AV_LOG_ERROR, "incomplete attachment\n");
} else {
AVStream *st = avformat_new_stream(s, NULL);
if (st == NULL)
break;
- av_dict_set(&st->metadata, "filename",attachements[j].filename, 0);
- av_dict_set(&st->metadata, "mimetype", attachements[j].mime, 0);
- st->codec->codec_id = AV_CODEC_ID_NONE;
+ av_dict_set(&st->metadata, "filename", attachments[j].filename, 0);
+ av_dict_set(&st->metadata, "mimetype", attachments[j].mime, 0);
+ st->codec->codec_id = AV_CODEC_ID_NONE;
st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
- if (ff_alloc_extradata(st->codec, attachements[j].bin.size))
+ if (ff_alloc_extradata(st->codec, attachments[j].bin.size))
break;
- memcpy(st->codec->extradata, attachements[j].bin.data, attachements[j].bin.size);
+ memcpy(st->codec->extradata, attachments[j].bin.data,
+ attachments[j].bin.size);
- for (i=0; ff_mkv_mime_tags[i].id != AV_CODEC_ID_NONE; i++) {
- if (!strncmp(ff_mkv_mime_tags[i].str, attachements[j].mime,
+ for (i = 0; ff_mkv_mime_tags[i].id != AV_CODEC_ID_NONE; i++) {
+ if (!strncmp(ff_mkv_mime_tags[i].str, attachments[j].mime,
strlen(ff_mkv_mime_tags[i].str))) {
st->codec->codec_id = ff_mkv_mime_tags[i].id;
break;
}
}
- attachements[j].stream = st;
+ attachments[j].stream = st;
}
}
chapters = chapters_list->elem;
- for (i=0; i<chapters_list->nb_elem; i++)
- if (chapters[i].start != AV_NOPTS_VALUE && chapters[i].uid
- && (max_start==0 || chapters[i].start > max_start)) {
+ for (i = 0; i < chapters_list->nb_elem; i++)
+ if (chapters[i].start != AV_NOPTS_VALUE && chapters[i].uid &&
+ (max_start == 0 || chapters[i].start > max_start)) {
chapters[i].chapter =
- avpriv_new_chapter(s, chapters[i].uid, (AVRational){1, 1000000000},
- chapters[i].start, chapters[i].end,
- chapters[i].title);
+ avpriv_new_chapter(s, chapters[i].uid,
+ (AVRational) { 1, 1000000000 },
+ chapters[i].start, chapters[i].end,
+ chapters[i].title);
av_dict_set(&chapters[i].chapter->metadata,
- "title", chapters[i].title, 0);
+ "title", chapters[i].title, 0);
max_start = chapters[i].start;
}
@@ -2018,7 +2125,8 @@ static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
memmove(&matroska->packets[0], &matroska->packets[1],
(matroska->num_packets - 1) * sizeof(AVPacket *));
newpackets = av_realloc(matroska->packets,
- (matroska->num_packets - 1) * sizeof(AVPacket *));
+ (matroska->num_packets - 1) *
+ sizeof(AVPacket *));
if (newpackets)
matroska->packets = newpackets;
} else {
@@ -2050,7 +2158,7 @@ static void matroska_clear_queue(MatroskaDemuxContext *matroska)
}
static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
- int* buf_size, int type,
+ int *buf_size, int type,
uint32_t **lace_buf, int *laces)
{
int res = 0, n, size = *buf_size;
@@ -2058,7 +2166,7 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
uint32_t *lace_size;
if (!type) {
- *laces = 1;
+ *laces = 1;
*lace_buf = av_mallocz(sizeof(int));
if (!*lace_buf)
return AVERROR(ENOMEM);
@@ -2068,15 +2176,16 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
}
av_assert0(size > 0);
- *laces = *data + 1;
- data += 1;
- size -= 1;
+ *laces = *data + 1;
+ data += 1;
+ size -= 1;
lace_size = av_mallocz(*laces * sizeof(int));
if (!lace_size)
return AVERROR(ENOMEM);
switch (type) {
- case 0x1: /* Xiph lacing */ {
+ case 0x1: /* Xiph lacing */
+ {
uint8_t temp;
uint32_t total = 0;
for (n = 0; res == 0 && n < *laces - 1; n++) {
@@ -2085,11 +2194,11 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
res = AVERROR_INVALIDDATA;
break;
}
- temp = *data;
- total += temp;
+ temp = *data;
+ total += temp;
lace_size[n] += temp;
- data += 1;
- size -= 1;
+ data += 1;
+ size -= 1;
if (temp != 0xff)
break;
}
@@ -2112,7 +2221,8 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
lace_size[n] = size / *laces;
break;
- case 0x3: /* EBML lacing */ {
+ case 0x3: /* EBML lacing */
+ {
uint64_t num;
uint64_t total;
n = matroska_ebmlnum_uint(matroska, data, size, &num);
@@ -2135,10 +2245,10 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
res = r<0 ? r : AVERROR_INVALIDDATA;
break;
}
- data += r;
- size -= r;
+ data += r;
+ size -= r;
lace_size[n] = lace_size[n - 1] + snum;
- total += lace_size[n];
+ total += lace_size[n];
}
if (size <= total) {
res = AVERROR_INVALIDDATA;
@@ -2157,18 +2267,16 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
}
static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska,
- MatroskaTrack *track,
- AVStream *st,
- uint8_t *data, int size,
- uint64_t timecode,
+ MatroskaTrack *track, AVStream *st,
+ uint8_t *data, int size, uint64_t timecode,
int64_t pos)
{
int a = st->codec->block_align;
int sps = track->audio.sub_packet_size;
int cfs = track->audio.coded_framesize;
- int h = track->audio.sub_packet_h;
- int y = track->audio.sub_packet_cnt;
- int w = track->audio.frame_size;
+ int h = track->audio.sub_packet_h;
+ int y = track->audio.sub_packet_cnt;
+ int w = track->audio.frame_size;
int x;
if (!track->audio.pkt_cnt) {
@@ -2180,24 +2288,26 @@ static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska,
"Corrupt int4 RM-style audio packet size\n");
return AVERROR_INVALIDDATA;
}
- for (x=0; x<h/2; x++)
- memcpy(track->audio.buf+x*2*w+y*cfs,
- data+x*cfs, cfs);
+ for (x = 0; x < h / 2; x++)
+ memcpy(track->audio.buf + x * 2 * w + y * cfs,
+ data + x * cfs, cfs);
} else if (st->codec->codec_id == AV_CODEC_ID_SIPR) {
if (size < w) {
av_log(matroska->ctx, AV_LOG_ERROR,
"Corrupt sipr RM-style audio packet size\n");
return AVERROR_INVALIDDATA;
}
- memcpy(track->audio.buf + y*w, data, w);
+ memcpy(track->audio.buf + y * w, data, w);
} else {
- if (size < sps * w / sps || h<=0) {
+ if (size < sps * w / sps || h<=0 || w%sps) {
av_log(matroska->ctx, AV_LOG_ERROR,
"Corrupt generic RM-style audio packet size\n");
return AVERROR_INVALIDDATA;
}
- for (x=0; x<w/sps; x++)
- memcpy(track->audio.buf+sps*(h*x+((h+1)/2)*(y&1)+(y>>1)), data+x*sps, sps);
+ for (x = 0; x < w / sps; x++)
+ memcpy(track->audio.buf +
+ sps * (h * x + ((h + 1) / 2) * (y & 1) + (y >> 1)),
+ data + x * sps, sps);
}
if (++track->audio.sub_packet_cnt >= h) {
@@ -2209,23 +2319,24 @@ static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska,
#endif
}
track->audio.sub_packet_cnt = 0;
- track->audio.pkt_cnt = h*w / a;
+ track->audio.pkt_cnt = h * w / a;
}
}
while (track->audio.pkt_cnt) {
AVPacket *pkt = NULL;
- if (!(pkt = av_mallocz(sizeof(AVPacket))) || av_new_packet(pkt, a) < 0){
+ if (!(pkt = av_mallocz(sizeof(AVPacket))) || av_new_packet(pkt, a) < 0) {
av_free(pkt);
return AVERROR(ENOMEM);
}
- memcpy(pkt->data, track->audio.buf
- + a * (h*w / a - track->audio.pkt_cnt--), a);
- pkt->pts = track->audio.buf_timecode;
+ memcpy(pkt->data,
+ track->audio.buf + a * (h * w / a - track->audio.pkt_cnt--),
+ a);
+ pkt->pts = track->audio.buf_timecode;
track->audio.buf_timecode = AV_NOPTS_VALUE;
- pkt->pos = pos;
- pkt->stream_index = st->index;
- dynarray_add(&matroska->packets,&matroska->num_packets,pkt);
+ pkt->pos = pos;
+ pkt->stream_index = st->index;
+ dynarray_add(&matroska->packets, &matroska->num_packets, pkt);
}
return 0;
@@ -2268,8 +2379,8 @@ static int matroska_parse_wavpack(MatroskaTrack *track, uint8_t *src,
goto fail;
}
blocksize = AV_RL32(src);
- src += 4;
- srclen -= 4;
+ src += 4;
+ srclen -= 4;
} else
blocksize = srclen;
@@ -2286,16 +2397,16 @@ static int matroska_parse_wavpack(MatroskaTrack *track, uint8_t *src,
dst = tmp;
dstlen += blocksize + 32;
- AV_WL32(dst + offset, MKTAG('w', 'v', 'p', 'k')); // tag
- AV_WL32(dst + offset + 4, blocksize + 24); // blocksize - 8
- AV_WL16(dst + offset + 8, ver); // version
- AV_WL16(dst + offset + 10, 0); // track/index_no
- AV_WL32(dst + offset + 12, 0); // total samples
- AV_WL32(dst + offset + 16, 0); // block index
- AV_WL32(dst + offset + 20, samples); // number of samples
- AV_WL32(dst + offset + 24, flags); // flags
- AV_WL32(dst + offset + 28, crc); // crc
- memcpy (dst + offset + 32, src, blocksize); // block data
+ AV_WL32(dst + offset, MKTAG('w', 'v', 'p', 'k')); // tag
+ AV_WL32(dst + offset + 4, blocksize + 24); // blocksize - 8
+ AV_WL16(dst + offset + 8, ver); // version
+ AV_WL16(dst + offset + 10, 0); // track/index_no
+ AV_WL32(dst + offset + 12, 0); // total samples
+ AV_WL32(dst + offset + 16, 0); // block index
+ AV_WL32(dst + offset + 20, samples); // number of samples
+ AV_WL32(dst + offset + 24, flags); // flags
+ AV_WL32(dst + offset + 28, crc); // crc
+ memcpy(dst + offset + 32, src, blocksize); // block data
src += blocksize;
srclen -= blocksize;
@@ -2427,8 +2538,7 @@ static int matroska_parse_webvtt(MatroskaDemuxContext *matroska,
}
static int matroska_parse_frame(MatroskaDemuxContext *matroska,
- MatroskaTrack *track,
- AVStream *st,
+ MatroskaTrack *track, AVStream *st,
uint8_t *data, int pkt_size,
uint64_t timecode, uint64_t lace_duration,
int64_t pos, int is_keyframe,
@@ -2450,7 +2560,8 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
uint8_t *wv_data;
res = matroska_parse_wavpack(track, pkt_data, &wv_data, &pkt_size);
if (res < 0) {
- av_log(matroska->ctx, AV_LOG_ERROR, "Error parsing a wavpack block.\n");
+ av_log(matroska->ctx, AV_LOG_ERROR,
+ "Error parsing a wavpack block.\n");
goto fail;
}
if (pkt_data != data)
@@ -2458,7 +2569,8 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
pkt_data = wv_data;
}
- if (st->codec->codec_id == AV_CODEC_ID_PRORES)
+ if (st->codec->codec_id == AV_CODEC_ID_PRORES &&
+ AV_RB32(&data[4]) != MKBETAG('i', 'c', 'p', 'f'))
offset = 8;
pkt = av_mallocz(sizeof(AVPacket));
@@ -2469,7 +2581,7 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
goto fail;
}
- if (st->codec->codec_id == AV_CODEC_ID_PRORES) {
+ if (st->codec->codec_id == AV_CODEC_ID_PRORES && offset == 8) {
uint8_t *buf = pkt->data;
bytestream_put_be32(&buf, pkt_size);
bytestream_put_be32(&buf, MKBETAG('i', 'c', 'p', 'f'));
@@ -2480,14 +2592,14 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
if (pkt_data != data)
av_freep(&pkt_data);
- pkt->flags = is_keyframe;
+ pkt->flags = is_keyframe;
pkt->stream_index = st->index;
if (additional_size > 0) {
uint8_t *side_data = av_packet_new_side_data(pkt,
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL,
additional_size + 8);
- if(side_data == NULL) {
+ if (side_data == NULL) {
av_free_packet(pkt);
av_free(pkt);
return AVERROR(ENOMEM);
@@ -2500,7 +2612,7 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
uint8_t *side_data = av_packet_new_side_data(pkt,
AV_PKT_DATA_SKIP_SAMPLES,
10);
- if(side_data == NULL) {
+ if (side_data == NULL) {
av_free_packet(pkt);
av_free(pkt);
return AVERROR(ENOMEM);
@@ -2544,14 +2656,14 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
if (st->codec->codec_id == AV_CODEC_ID_SSA)
matroska_fix_ass_packet(matroska, pkt, lace_duration);
- if (matroska->prev_pkt &&
- timecode != AV_NOPTS_VALUE &&
- matroska->prev_pkt->pts == timecode &&
- matroska->prev_pkt->stream_index == st->index &&
+ if (matroska->prev_pkt &&
+ timecode != AV_NOPTS_VALUE &&
+ matroska->prev_pkt->pts == timecode &&
+ matroska->prev_pkt->stream_index == st->index &&
st->codec->codec_id == AV_CODEC_ID_SSA)
matroska_merge_packets(matroska->prev_pkt, pkt);
else {
- dynarray_add(&matroska->packets,&matroska->num_packets,pkt);
+ dynarray_add(&matroska->packets, &matroska->num_packets, pkt);
matroska->prev_pkt = pkt;
}
#else
@@ -2560,6 +2672,7 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
#endif
return 0;
+
fail:
if (pkt_data != data)
av_freep(&pkt_data);
@@ -2602,23 +2715,25 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
av_assert1(block_duration != AV_NOPTS_VALUE);
block_time = sign_extend(AV_RB16(data), 16);
- data += 2;
- flags = *data++;
- size -= 3;
+ data += 2;
+ flags = *data++;
+ size -= 3;
if (is_keyframe == -1)
is_keyframe = flags & 0x80 ? AV_PKT_FLAG_KEY : 0;
- if (cluster_time != (uint64_t)-1
- && (block_time >= 0 || cluster_time >= -block_time)) {
- timecode = cluster_time + block_time;
- if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE
- && timecode < track->end_timecode)
+ if (cluster_time != (uint64_t) -1 &&
+ (block_time >= 0 || cluster_time >= -block_time)) {
+ timecode = cluster_time + block_time - track->codec_delay;
+ if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE &&
+ timecode < track->end_timecode)
is_keyframe = 0; /* overlapping subtitles are not key frame */
if (is_keyframe)
- av_add_index_entry(st, cluster_pos, timecode, 0,0,AVINDEX_KEYFRAME);
+ av_add_index_entry(st, cluster_pos, timecode, 0, 0,
+ AVINDEX_KEYFRAME);
}
- if (matroska->skip_to_keyframe && track->type != MATROSKA_TRACK_TYPE_SUBTITLE) {
+ if (matroska->skip_to_keyframe &&
+ track->type != MATROSKA_TRACK_TYPE_SUBTITLE) {
if (timecode < matroska->skip_to_timecode)
return res;
if (is_keyframe)
@@ -2638,7 +2753,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
if (track->audio.samplerate == 8000) {
// If this is needed for more codecs, then add them here
if (st->codec->codec_id == AV_CODEC_ID_AC3) {
- if(track->audio.samplerate != st->codec->sample_rate || !st->codec->frame_size)
+ if (track->audio.samplerate != st->codec->sample_rate || !st->codec->frame_size)
trust_default_duration = 0;
}
}
@@ -2659,11 +2774,10 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
}
if ((st->codec->codec_id == AV_CODEC_ID_RA_288 ||
- st->codec->codec_id == AV_CODEC_ID_COOK ||
- st->codec->codec_id == AV_CODEC_ID_SIPR ||
+ st->codec->codec_id == AV_CODEC_ID_COOK ||
+ st->codec->codec_id == AV_CODEC_ID_SIPR ||
st->codec->codec_id == AV_CODEC_ID_ATRAC3) &&
- st->codec->block_align && track->audio.sub_packet_size) {
-
+ st->codec->block_align && track->audio.sub_packet_size) {
#if CONFIG_RA_288_DECODER || CONFIG_COOK_DECODER || CONFIG_ATRAC3_DECODER || CONFIG_SIPR_DECODER
res = matroska_parse_rm_audio(matroska, track, st, data,
lace_size[n],
@@ -2681,13 +2795,12 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
pos);
if (res)
goto end;
-
} else {
res = matroska_parse_frame(matroska, track, st, data, lace_size[n],
- timecode, lace_duration,
- pos, !n? is_keyframe : 0,
- additional, additional_id, additional_size,
- discard_padding);
+ timecode, lace_duration, pos,
+ !n ? is_keyframe : 0,
+ additional, additional_id, additional_size,
+ discard_padding);
if (res)
goto end;
}
@@ -2718,8 +2831,8 @@ static int matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska)
ebml_free(matroska_cluster, &matroska->current_cluster);
memset(&matroska->current_cluster, 0, sizeof(MatroskaCluster));
matroska->current_cluster_num_blocks = 0;
- matroska->current_cluster_pos = avio_tell(matroska->ctx->pb);
- matroska->prev_pkt = NULL;
+ matroska->current_cluster_pos = avio_tell(matroska->ctx->pb);
+ matroska->prev_pkt = NULL;
/* sizeof the ID which was already read */
if (matroska->current_id)
matroska->current_cluster_pos -= 4;
@@ -2735,21 +2848,20 @@ static int matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska)
if (!res &&
matroska->current_cluster_num_blocks <
- matroska->current_cluster.blocks.nb_elem) {
+ matroska->current_cluster.blocks.nb_elem) {
blocks_list = &matroska->current_cluster.blocks;
- blocks = blocks_list->elem;
+ blocks = blocks_list->elem;
matroska->current_cluster_num_blocks = blocks_list->nb_elem;
- i = blocks_list->nb_elem - 1;
+ i = blocks_list->nb_elem - 1;
if (blocks[i].bin.size > 0 && blocks[i].bin.data) {
int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
uint8_t* additional = blocks[i].additional.size > 0 ?
blocks[i].additional.data : NULL;
if (!blocks[i].non_simple)
blocks[i].duration = 0;
- res = matroska_parse_block(matroska,
- blocks[i].bin.data, blocks[i].bin.size,
- blocks[i].bin.pos,
+ res = matroska_parse_block(matroska, blocks[i].bin.data,
+ blocks[i].bin.size, blocks[i].bin.pos,
matroska->current_cluster.timecode,
blocks[i].duration, is_keyframe,
additional, blocks[i].additional_id,
@@ -2769,23 +2881,24 @@ static int matroska_parse_cluster(MatroskaDemuxContext *matroska)
MatroskaBlock *blocks;
int i, res;
int64_t pos;
+
if (!matroska->contains_ssa)
return matroska_parse_cluster_incremental(matroska);
pos = avio_tell(matroska->ctx->pb);
matroska->prev_pkt = NULL;
if (matroska->current_id)
pos -= 4; /* sizeof the ID which was already read */
- res = ebml_parse(matroska, matroska_clusters, &cluster);
+ res = ebml_parse(matroska, matroska_clusters, &cluster);
blocks_list = &cluster.blocks;
- blocks = blocks_list->elem;
- for (i=0; i<blocks_list->nb_elem; i++)
+ blocks = blocks_list->elem;
+ for (i = 0; i < blocks_list->nb_elem; i++)
if (blocks[i].bin.size > 0 && blocks[i].bin.data) {
int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
- res=matroska_parse_block(matroska,
- blocks[i].bin.data, blocks[i].bin.size,
- blocks[i].bin.pos, cluster.timecode,
- blocks[i].duration, is_keyframe, NULL, 0, 0,
- pos, blocks[i].discard_padding);
+ res = matroska_parse_block(matroska, blocks[i].bin.data,
+ blocks[i].bin.size, blocks[i].bin.pos,
+ cluster.timecode, blocks[i].duration,
+ is_keyframe, NULL, 0, 0, pos,
+ blocks[i].discard_padding);
}
ebml_free(matroska_cluster, &cluster);
return res;
@@ -2825,7 +2938,8 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
timestamp = FFMAX(timestamp, st->index_entries[0].timestamp);
if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
- avio_seek(s->pb, st->index_entries[st->nb_index_entries-1].pos, SEEK_SET);
+ avio_seek(s->pb, st->index_entries[st->nb_index_entries - 1].pos,
+ SEEK_SET);
matroska->current_id = 0;
while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
matroska_clear_queue(matroska);
@@ -2839,24 +2953,26 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
goto err;
index_min = index;
- for (i=0; i < matroska->tracks.nb_elem; i++) {
- tracks[i].audio.pkt_cnt = 0;
+ for (i = 0; i < matroska->tracks.nb_elem; i++) {
+ tracks[i].audio.pkt_cnt = 0;
tracks[i].audio.sub_packet_cnt = 0;
- tracks[i].audio.buf_timecode = AV_NOPTS_VALUE;
- tracks[i].end_timecode = 0;
- if (tracks[i].type == MATROSKA_TRACK_TYPE_SUBTITLE
- && tracks[i].stream->discard != AVDISCARD_ALL) {
- index_sub = av_index_search_timestamp(tracks[i].stream, st->index_entries[index].timestamp, AVSEEK_FLAG_BACKWARD);
- while(index_sub >= 0
- && index_min >= 0
- && tracks[i].stream->index_entries[index_sub].pos < st->index_entries[index_min].pos
- && st->index_entries[index].timestamp - tracks[i].stream->index_entries[index_sub].timestamp < 30000000000/matroska->time_scale)
+ tracks[i].audio.buf_timecode = AV_NOPTS_VALUE;
+ tracks[i].end_timecode = 0;
+ if (tracks[i].type == MATROSKA_TRACK_TYPE_SUBTITLE &&
+ tracks[i].stream->discard != AVDISCARD_ALL) {
+ index_sub = av_index_search_timestamp(
+ tracks[i].stream, st->index_entries[index].timestamp,
+ AVSEEK_FLAG_BACKWARD);
+ while (index_sub >= 0 &&
+ index_min > 0 &&
+ tracks[i].stream->index_entries[index_sub].pos < st->index_entries[index_min].pos &&
+ st->index_entries[index].timestamp - tracks[i].stream->index_entries[index_sub].timestamp < 30000000000 / matroska->time_scale)
index_min--;
}
}
avio_seek(s->pb, st->index_entries[index_min].pos, SEEK_SET);
- matroska->current_id = 0;
+ matroska->current_id = 0;
if (flags & AVSEEK_FLAG_ANY) {
st->skip_to_keyframe = 0;
matroska->skip_to_timecode = timestamp;
@@ -2865,8 +2981,8 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
matroska->skip_to_timecode = st->index_entries[index].timestamp;
}
matroska->skip_to_keyframe = 1;
- matroska->done = 0;
- matroska->num_levels = 0;
+ matroska->done = 0;
+ matroska->num_levels = 0;
ff_update_cur_dts(s, st, st->index_entries[index].timestamp);
return 0;
err:
@@ -2889,7 +3005,7 @@ static int matroska_read_close(AVFormatContext *s)
matroska_clear_queue(matroska);
- for (n=0; n < matroska->tracks.nb_elem; n++)
+ for (n = 0; n < matroska->tracks.nb_elem; n++)
if (tracks[n].type == MATROSKA_TRACK_TYPE_AUDIO)
av_free(tracks[n].audio.buf);
ebml_free(matroska_cluster, &matroska->current_cluster);
diff --git a/chromium/third_party/ffmpeg/libavformat/matroskaenc.c b/chromium/third_party/ffmpeg/libavformat/matroskaenc.c
index e461c5e60ed..17eb318aadb 100644
--- a/chromium/third_party/ffmpeg/libavformat/matroskaenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/matroskaenc.c
@@ -22,6 +22,7 @@
#include <stdint.h>
#include "avc.h"
+#include "hevc.h"
#include "avformat.h"
#include "avio_internal.h"
#include "avlanguage.h"
@@ -84,6 +85,7 @@ typedef struct {
typedef struct {
int write_dts;
int has_cue;
+ int64_t ts_offset;
} mkv_track;
#define MODE_MATROSKAv2 0x01
@@ -532,6 +534,8 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
ret = put_wv_codecpriv(dyn_cp, codec);
else if (codec->codec_id == AV_CODEC_ID_H264)
ret = ff_isom_write_avcc(dyn_cp, codec->extradata, codec->extradata_size);
+ else if (codec->codec_id == AV_CODEC_ID_HEVC)
+ ret = ff_isom_write_hvcc(dyn_cp, codec->extradata, codec->extradata_size, 0);
else if (codec->codec_id == AV_CODEC_ID_ALAC) {
if (codec->extradata_size < 36) {
av_log(s, AV_LOG_ERROR,
@@ -541,6 +545,9 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
} else
avio_write(dyn_cp, codec->extradata + 12,
codec->extradata_size - 12);
+ } else if (codec->codec_id == AV_CODEC_ID_PRORES &&
+ ff_codec_get_id(ff_codec_movvideo_tags, codec->codec_tag) == AV_CODEC_ID_PRORES) {
+ avio_wl32(dyn_cp, codec->codec_tag);
}
else if (codec->extradata_size && codec->codec_id != AV_CODEC_ID_TTA)
avio_write(dyn_cp, codec->extradata, codec->extradata_size);
@@ -548,9 +555,23 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
if (qt_id) {
if (!codec->codec_tag)
codec->codec_tag = ff_codec_get_tag(ff_codec_movvideo_tags, codec->codec_id);
- if (codec->extradata_size)
+ if (codec->extradata_size) {
+ if ( ff_codec_get_id(ff_codec_movvideo_tags, codec->codec_tag) == codec->codec_id
+ && ff_codec_get_id(ff_codec_movvideo_tags, AV_RL32(codec->extradata+4)) != codec->codec_id
+ ) {
+ int i;
+ avio_wb32(dyn_cp, 0x5a + codec->extradata_size);
+ avio_wl32(dyn_cp, codec->codec_tag);
+ for(i=0; i<0x5a-8; i++)
+ avio_w8(dyn_cp, 0);
+ }
avio_write(dyn_cp, codec->extradata, codec->extradata_size);
+ }
} else {
+ if (!ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id))
+ av_log(s, AV_LOG_WARNING, "codec %s is not supported by this format\n",
+ avcodec_get_name(codec->codec_id));
+
if (!codec->codec_tag)
codec->codec_tag = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id);
if (!codec->codec_tag) {
@@ -559,7 +580,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
ret = AVERROR(EINVAL);
}
- ff_put_bmp_header(dyn_cp, codec, ff_codec_bmp_tags, 0);
+ ff_put_bmp_header(dyn_cp, codec, ff_codec_bmp_tags, 0, 0);
}
} else if (codec->codec_type == AVMEDIA_TYPE_AUDIO) {
@@ -573,7 +594,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
if (!codec->codec_tag)
codec->codec_tag = tag;
- ff_put_wav_header(dyn_cp, codec);
+ ff_put_wav_header(dyn_cp, codec, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX);
}
codecpriv_size = avio_close_dyn_buf(dyn_cp, &codecpriv);
@@ -616,7 +637,7 @@ static int mkv_write_tracks(AVFormatContext *s)
continue;
}
- if (!bit_depth)
+ if (!bit_depth && codec->codec_id != AV_CODEC_ID_ADPCM_G726)
bit_depth = av_get_bytes_per_sample(codec->sample_fmt) << 3;
if (!bit_depth)
bit_depth = codec->bits_per_coded_sample;
@@ -674,13 +695,17 @@ static int mkv_write_tracks(AVFormatContext *s)
}
}
+ if (codec->codec_type == AVMEDIA_TYPE_AUDIO && codec->delay && codec->codec_id == AV_CODEC_ID_OPUS) {
+// mkv->tracks[i].ts_offset = av_rescale_q(codec->delay,
+// (AVRational){ 1, codec->sample_rate },
+// st->time_base);
+
+ put_ebml_uint(pb, MATROSKA_ID_CODECDELAY,
+ av_rescale_q(codec->delay, (AVRational){ 1, codec->sample_rate },
+ (AVRational){ 1, 1000000000 }));
+ }
if (codec->codec_id == AV_CODEC_ID_OPUS) {
- uint64_t codec_delay =av_rescale_q(codec->delay,
- (AVRational){1, codec->sample_rate},
- (AVRational){1, 1000000000});
- put_ebml_uint(pb, MATROSKA_ID_CODECDELAY, codec_delay);
put_ebml_uint(pb, MATROSKA_ID_SEEKPREROLL, OPUS_SEEK_PREROLL);
-
}
if (mkv->mode == MODE_WEBM && !(codec->codec_id == AV_CODEC_ID_VP8 ||
@@ -928,7 +953,9 @@ static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int eleme
end_ebml_master(s->pb, targets);
while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX)))
- if (av_strcasecmp(t->key, "title") && av_strcasecmp(t->key, "stereo_mode"))
+ if (av_strcasecmp(t->key, "title") &&
+ av_strcasecmp(t->key, "stereo_mode") &&
+ av_strcasecmp(t->key, "encoding_tool"))
mkv_write_simpletag(s->pb, t);
end_ebml_master(s->pb, tag);
@@ -1069,7 +1096,7 @@ static int mkv_write_header(AVFormatContext *s)
AVIOContext *pb = s->pb;
ebml_master ebml_header, segment_info;
AVDictionaryEntry *tag;
- int ret, i;
+ int ret, i, version = 2;
if (!strcmp(s->oformat->name, "webm")) mkv->mode = MODE_WEBM;
else mkv->mode = MODE_MATROSKAv2;
@@ -1077,7 +1104,12 @@ static int mkv_write_header(AVFormatContext *s)
if (s->avoid_negative_ts < 0)
s->avoid_negative_ts = 1;
- for (i = 0; i < s->nb_streams; i++)
+ if (mkv->mode != MODE_WEBM ||
+ av_dict_get(s->metadata, "stereo_mode", NULL, 0) ||
+ av_dict_get(s->metadata, "alpha_mode", NULL, 0))
+ version = 4;
+
+ for (i = 0; i < s->nb_streams; i++) {
if (s->streams[i]->codec->codec_id == AV_CODEC_ID_ATRAC3 ||
s->streams[i]->codec->codec_id == AV_CODEC_ID_COOK ||
s->streams[i]->codec->codec_id == AV_CODEC_ID_RA_288 ||
@@ -1089,8 +1121,13 @@ static int mkv_write_header(AVFormatContext *s)
avcodec_get_name(s->streams[i]->codec->codec_id));
return AVERROR_PATCHWELCOME;
}
+ if (s->streams[i]->codec->codec_id == AV_CODEC_ID_OPUS ||
+ av_dict_get(s->streams[i]->metadata, "stereo_mode", NULL, 0) ||
+ av_dict_get(s->streams[i]->metadata, "alpha_mode", NULL, 0))
+ version = 4;
+ }
- mkv->tracks = av_mallocz(s->nb_streams * sizeof(*mkv->tracks));
+ mkv->tracks = av_mallocz_array(s->nb_streams, sizeof(*mkv->tracks));
if (!mkv->tracks)
return AVERROR(ENOMEM);
@@ -1100,7 +1137,7 @@ static int mkv_write_header(AVFormatContext *s)
put_ebml_uint (pb, EBML_ID_EBMLMAXIDLENGTH , 4);
put_ebml_uint (pb, EBML_ID_EBMLMAXSIZELENGTH , 8);
put_ebml_string (pb, EBML_ID_DOCTYPE , s->oformat->name);
- put_ebml_uint (pb, EBML_ID_DOCTYPEVERSION , 4);
+ put_ebml_uint (pb, EBML_ID_DOCTYPEVERSION , version);
put_ebml_uint (pb, EBML_ID_DOCTYPEREADVERSION , 2);
end_ebml_master(pb, ebml_header);
@@ -1123,7 +1160,7 @@ static int mkv_write_header(AVFormatContext *s)
put_ebml_uint(pb, MATROSKA_ID_TIMECODESCALE, 1000000);
if ((tag = av_dict_get(s->metadata, "title", NULL, 0)))
put_ebml_string(pb, MATROSKA_ID_TITLE, tag->value);
- if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(s->flags & AVFMT_FLAG_BITEXACT)) {
uint32_t segment_uid[4];
AVLFG lfg;
@@ -1133,7 +1170,10 @@ static int mkv_write_header(AVFormatContext *s)
segment_uid[i] = av_lfg_get(&lfg);
put_ebml_string(pb, MATROSKA_ID_MUXINGAPP , LIBAVFORMAT_IDENT);
- put_ebml_string(pb, MATROSKA_ID_WRITINGAPP, LIBAVFORMAT_IDENT);
+ if ((tag = av_dict_get(s->metadata, "encoding_tool", NULL, 0)))
+ put_ebml_string(pb, MATROSKA_ID_WRITINGAPP, tag->value);
+ else
+ put_ebml_string(pb, MATROSKA_ID_WRITINGAPP, LIBAVFORMAT_IDENT);
put_ebml_binary(pb, MATROSKA_ID_SEGMENTUID, segment_uid, 16);
} else {
const char *ident = "Lavf";
@@ -1349,6 +1389,10 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
if (codec->codec_id == AV_CODEC_ID_H264 && codec->extradata_size > 0 &&
(AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1))
ff_avc_parse_nal_units_buf(pkt->data, &data, &size);
+ else if (codec->codec_id == AV_CODEC_ID_HEVC && codec->extradata_size > 6 &&
+ (AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1))
+ /* extradata is Annex B, assume the bitstream is too and convert it */
+ ff_hevc_annexb2mp4_buf(pkt->data, &data, &size, 0, NULL);
else if (codec->codec_id == AV_CODEC_ID_WAVPACK) {
int ret = mkv_strip_wavpack(pkt->data, &data, &size);
if (ret < 0) {
@@ -1520,6 +1564,7 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
av_log(s, AV_LOG_ERROR, "Can't write packet with unknown timestamp\n");
return AVERROR(EINVAL);
}
+ ts += mkv->tracks[pkt->stream_index].ts_offset;
if (!s->pb->seekable) {
if (!mkv->dyn_bc) {
@@ -1585,6 +1630,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
cluster_time = pkt->dts - mkv->cluster_pts;
else
cluster_time = pkt->pts - mkv->cluster_pts;
+ cluster_time += mkv->tracks[pkt->stream_index].ts_offset;
// start a new cluster every 5 MB or 5 sec, or 32k / 1 sec for streaming or
// after 4k and on a keyframe
@@ -1630,9 +1676,9 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
ret = mkv->cur_audio_pkt.buf ? 0 : AVERROR(ENOMEM);
} else
ret = av_dup_packet(&mkv->cur_audio_pkt);
- if (mkv->cur_audio_pkt.side_data_elems > 0) {
- ret = av_copy_packet_side_data(&mkv->cur_audio_pkt, &mkv->cur_audio_pkt);
- }
+ if (mkv->cur_audio_pkt.side_data_elems > 0) {
+ ret = av_copy_packet_side_data(&mkv->cur_audio_pkt, &mkv->cur_audio_pkt);
+ }
} else
ret = mkv_write_packet_internal(s, pkt);
return ret;
diff --git a/chromium/third_party/ffmpeg/libavformat/metadata.c b/chromium/third_party/ffmpeg/libavformat/metadata.c
index fc3a9d7d556..b9b6de79725 100644
--- a/chromium/third_party/ffmpeg/libavformat/metadata.c
+++ b/chromium/third_party/ffmpeg/libavformat/metadata.c
@@ -33,7 +33,7 @@ void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv,
AVDictionary *dst = NULL;
const char *key;
- if (d_conv == s_conv)
+ if (d_conv == s_conv || !pm)
return;
while ((mtag = av_dict_get(*pm, "", mtag, AV_DICT_IGNORE_SUFFIX))) {
diff --git a/chromium/third_party/ffmpeg/libavformat/microdvddec.c b/chromium/third_party/ffmpeg/libavformat/microdvddec.c
index 7b49e439765..49d2b681921 100644
--- a/chromium/third_party/ffmpeg/libavformat/microdvddec.c
+++ b/chromium/third_party/ffmpeg/libavformat/microdvddec.c
@@ -24,12 +24,15 @@
#include "internal.h"
#include "subtitles.h"
#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
#define MAX_LINESIZE 2048
typedef struct {
+ const AVClass *class;
FFDemuxSubtitlesQueue q;
+ AVRational frame_rate;
} MicroDVDContext;
@@ -71,22 +74,30 @@ static int get_duration(const char *buf)
return -1;
}
+static const char *bom = "\xEF\xBB\xBF";
+
static int microdvd_read_header(AVFormatContext *s)
{
AVRational pts_info = (AVRational){ 2997, 125 }; /* default: 23.976 fps */
MicroDVDContext *microdvd = s->priv_data;
AVStream *st = avformat_new_stream(s, NULL);
int i = 0;
- char line[MAX_LINESIZE];
+ char line_buf[MAX_LINESIZE];
+ int has_real_fps = 0;
if (!st)
return AVERROR(ENOMEM);
while (!url_feof(s->pb)) {
- char *p = line;
+ char *p;
AVPacket *sub;
int64_t pos = avio_tell(s->pb);
- int len = ff_get_line(s->pb, line, sizeof(line));
+ int len = ff_get_line(s->pb, line_buf, sizeof(line_buf));
+ char *line = line_buf;
+
+ if (!strncmp(line, bom, 3))
+ line += 3;
+ p = line;
if (!len)
break;
@@ -98,8 +109,10 @@ static int microdvd_read_header(AVFormatContext *s)
if ((sscanf(line, "{%d}{}%6lf", &frame, &fps) == 2 ||
sscanf(line, "{%d}{%*d}%6lf", &frame, &fps) == 2)
- && frame <= 1 && fps > 3 && fps < 100)
+ && frame <= 1 && fps > 3 && fps < 100) {
pts_info = av_d2q(fps, 100000);
+ has_real_fps = 1;
+ }
if (!st->codec->extradata && sscanf(line, "{DEFAULT}{}%c", &c) == 1) {
st->codec->extradata = av_strdup(line + 11);
if (!st->codec->extradata)
@@ -128,6 +141,13 @@ static int microdvd_read_header(AVFormatContext *s)
sub->duration = get_duration(line);
}
ff_subtitles_queue_finalize(&microdvd->q);
+ if (has_real_fps) {
+ /* export the FPS info only if set in the file */
+ microdvd->frame_rate = pts_info;
+ } else if (microdvd->frame_rate.num) {
+ /* fallback on user specified frame rate */
+ pts_info = microdvd->frame_rate;
+ }
avpriv_set_pts_info(st, 64, pts_info.den, pts_info.num);
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_MICRODVD;
@@ -155,6 +175,21 @@ static int microdvd_read_close(AVFormatContext *s)
return 0;
}
+
+#define OFFSET(x) offsetof(MicroDVDContext, x)
+#define SD AV_OPT_FLAG_SUBTITLE_PARAM|AV_OPT_FLAG_DECODING_PARAM
+static const AVOption microdvd_options[] = {
+ { "subfps", "set the movie frame rate fallback", OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, SD },
+ { NULL }
+};
+
+static const AVClass microdvd_class = {
+ .class_name = "microdvddec",
+ .item_name = av_default_item_name,
+ .option = microdvd_options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVInputFormat ff_microdvd_demuxer = {
.name = "microdvd",
.long_name = NULL_IF_CONFIG_SMALL("MicroDVD subtitle format"),
@@ -164,4 +199,5 @@ AVInputFormat ff_microdvd_demuxer = {
.read_packet = microdvd_read_packet,
.read_seek2 = microdvd_read_seek,
.read_close = microdvd_read_close,
+ .priv_class = &microdvd_class,
};
diff --git a/chromium/third_party/ffmpeg/libavformat/mlvdec.c b/chromium/third_party/ffmpeg/libavformat/mlvdec.c
new file mode 100644
index 00000000000..a980ed6218c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/mlvdec.c
@@ -0,0 +1,471 @@
+/*
+ * Magic Lantern Video (MLV) demuxer
+ * Copyright (c) 2014 Peter Ross
+ *
+ * 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
+ * Magic Lantern Video (MLV) demuxer
+ */
+
+#include "libavutil/eval.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/rational.h"
+#include "avformat.h"
+#include "internal.h"
+#include "riff.h"
+
+#define MLV_VERSION "v2.0"
+
+#define MLV_VIDEO_CLASS_RAW 1
+#define MLV_VIDEO_CLASS_YUV 2
+#define MLV_VIDEO_CLASS_JPEG 3
+#define MLV_VIDEO_CLASS_H264 4
+
+#define MLV_AUDIO_CLASS_WAV 1
+
+#define MLV_CLASS_FLAG_DELTA 0x40
+#define MLV_CLASS_FLAG_LZMA 0x80
+
+typedef struct {
+ AVIOContext *pb[101];
+ int class[2];
+ int stream_index;
+ uint64_t pts;
+} MlvContext;
+
+static int probe(AVProbeData *p)
+{
+ if (AV_RL32(p->buf) == MKTAG('M','L','V','I') &&
+ AV_RL32(p->buf + 4) >= 52 &&
+ !memcmp(p->buf + 8, MLV_VERSION, 5))
+ return AVPROBE_SCORE_MAX;
+ return 0;
+}
+
+static int check_file_header(AVIOContext *pb, uint64_t guid)
+{
+ unsigned int size;
+ uint8_t version[8];
+
+ avio_skip(pb, 4);
+ size = avio_rl32(pb);
+ if (size < 52)
+ return AVERROR_INVALIDDATA;
+ avio_read(pb, version, 8);
+ if (memcmp(version, MLV_VERSION, 5) || avio_rl64(pb) != guid)
+ return AVERROR_INVALIDDATA;
+ avio_skip(pb, size - 24);
+ return 0;
+}
+
+static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag, int size)
+{
+ char * value = av_malloc(size + 1);
+ if (!value) {
+ avio_skip(pb, size);
+ return;
+ }
+
+ avio_read(pb, value, size);
+ if (!value[0]) {
+ av_free(value);
+ return;
+ }
+
+ value[size] = 0;
+ av_dict_set(&avctx->metadata, tag, value, AV_DICT_DONT_STRDUP_VAL);
+}
+
+static void read_uint8(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
+{
+ char value[4];
+ snprintf(value, sizeof(value), "%i", avio_r8(pb));
+ av_dict_set(&avctx->metadata, tag, value, 0);
+}
+
+static void read_uint16(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
+{
+ char value[8];
+ snprintf(value, sizeof(value), "%i", avio_rl16(pb));
+ av_dict_set(&avctx->metadata, tag, value, 0);
+}
+
+static void read_uint32(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
+{
+ char value[16];
+ snprintf(value, sizeof(value), fmt, avio_rl32(pb));
+ av_dict_set(&avctx->metadata, tag, value, 0);
+}
+
+static void read_uint64(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
+{
+ char value[32];
+ snprintf(value, sizeof(value), fmt, avio_rl64(pb));
+ av_dict_set(&avctx->metadata, tag, value, 0);
+}
+
+static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int file)
+{
+ MlvContext *mlv = avctx->priv_data;
+ AVIOContext *pb = mlv->pb[file];
+ int ret;
+ while (!url_feof(pb)) {
+ int type;
+ unsigned int size;
+ type = avio_rl32(pb);
+ size = avio_rl32(pb);
+ avio_skip(pb, 8); //timestamp
+ if (size < 16)
+ break;
+ size -= 16;
+ if (vst && type == MKTAG('R','A','W','I') && size >= 164) {
+ vst->codec->width = avio_rl16(pb);
+ vst->codec->height = avio_rl16(pb);
+ if (avio_rl32(pb) != 1)
+ avpriv_request_sample(avctx, "raw api version");
+ avio_skip(pb, 20); // pointer, width, height, pitch, frame_size
+ vst->codec->bits_per_coded_sample = avio_rl32(pb);
+ avio_skip(pb, 8 + 16 + 24); // black_level, white_level, xywh, active_area, exposure_bias
+ if (avio_rl32(pb) != 0x2010100) /* RGGB */
+ avpriv_request_sample(avctx, "cfa_pattern");
+ avio_skip(pb, 80); // calibration_illuminant1, color_matrix1, dynamic_range
+ vst->codec->pix_fmt = AV_PIX_FMT_BAYER_RGGB16LE;
+ vst->codec->codec_tag = MKTAG('B', 'I', 'T', 16);
+ size -= 164;
+ } else if (ast && type == MKTAG('W', 'A', 'V', 'I') && size >= 16) {
+ ret = ff_get_wav_header(pb, ast->codec, 16);
+ if (ret < 0)
+ return ret;
+ size -= 16;
+ } else if (type == MKTAG('I','N','F','O')) {
+ if (size > 0)
+ read_string(avctx, pb, "info", size);
+ continue;
+ } else if (type == MKTAG('I','D','N','T') && size >= 36) {
+ read_string(avctx, pb, "cameraName", 32);
+ read_uint32(avctx, pb, "cameraModel", "0x%"PRIx32);
+ size -= 36;
+ if (size >= 32) {
+ read_string(avctx, pb, "cameraSerial", 32);
+ size -= 32;
+ }
+ } else if (type == MKTAG('L','E','N','S') && size >= 48) {
+ read_uint16(avctx, pb, "focalLength", "%i");
+ read_uint16(avctx, pb, "focalDist", "%i");
+ read_uint16(avctx, pb, "aperture", "%i");
+ read_uint8(avctx, pb, "stabilizerMode", "%i");
+ read_uint8(avctx, pb, "autofocusMode", "%i");
+ read_uint32(avctx, pb, "flags", "0x%"PRIx32);
+ read_uint32(avctx, pb, "lensID", "%"PRIi32);
+ read_string(avctx, pb, "lensName", 32);
+ size -= 48;
+ if (size >= 32) {
+ read_string(avctx, pb, "lensSerial", 32);
+ size -= 32;
+ }
+ } else if (vst && type == MKTAG('V', 'I', 'D', 'F') && size >= 4) {
+ uint64_t pts = avio_rl32(pb);
+ ff_add_index_entry(&vst->index_entries, &vst->nb_index_entries, &vst->index_entries_allocated_size,
+ avio_tell(pb) - 20, pts, file, 0, AVINDEX_KEYFRAME);
+ size -= 4;
+ } else if (ast && type == MKTAG('A', 'U', 'D', 'F') && size >= 4) {
+ uint64_t pts = avio_rl32(pb);
+ ff_add_index_entry(&ast->index_entries, &ast->nb_index_entries, &ast->index_entries_allocated_size,
+ avio_tell(pb) - 20, pts, file, 0, AVINDEX_KEYFRAME);
+ size -= 4;
+ } else if (vst && type == MKTAG('W','B','A','L') && size >= 28) {
+ read_uint32(avctx, pb, "wb_mode", "%"PRIi32);
+ read_uint32(avctx, pb, "kelvin", "%"PRIi32);
+ read_uint32(avctx, pb, "wbgain_r", "%"PRIi32);
+ read_uint32(avctx, pb, "wbgain_g", "%"PRIi32);
+ read_uint32(avctx, pb, "wbgain_b", "%"PRIi32);
+ read_uint32(avctx, pb, "wbs_gm", "%"PRIi32);
+ read_uint32(avctx, pb, "wbs_ba", "%"PRIi32);
+ size -= 28;
+ } else if (type == MKTAG('R','T','C','I') && size >= 20) {
+ char str[32];
+ struct tm time = { 0 };
+ time.tm_sec = avio_rl16(pb);
+ time.tm_min = avio_rl16(pb);
+ time.tm_hour = avio_rl16(pb);
+ time.tm_mday = avio_rl16(pb);
+ time.tm_mon = avio_rl16(pb);
+ time.tm_year = avio_rl16(pb);
+ time.tm_wday = avio_rl16(pb);
+ time.tm_yday = avio_rl16(pb);
+ time.tm_isdst = avio_rl16(pb);
+ avio_skip(pb, 2);
+ strftime(str, sizeof(str), "%Y-%m-%d %H:%M:%S", &time);
+ av_dict_set(&avctx->metadata, "time", str, 0);
+ size -= 20;
+ } else if (type == MKTAG('E','X','P','O') && size >= 16) {
+ av_dict_set(&avctx->metadata, "isoMode", avio_rl32(pb) ? "auto" : "manual", 0);
+ read_uint32(avctx, pb, "isoValue", "%"PRIi32);
+ read_uint32(avctx, pb, "isoAnalog", "%"PRIi32);
+ read_uint32(avctx, pb, "digitalGain", "%"PRIi32);
+ size -= 16;
+ if (size >= 8) {
+ read_uint64(avctx, pb, "shutterValue", "%"PRIi64);
+ size -= 8;
+ }
+ } else if (type == MKTAG('S','T','Y','L') && size >= 36) {
+ read_uint32(avctx, pb, "picStyleId", "%"PRIi32);
+ read_uint32(avctx, pb, "contrast", "%"PRIi32);
+ read_uint32(avctx, pb, "sharpness", "%"PRIi32);
+ read_uint32(avctx, pb, "saturation", "%"PRIi32);
+ read_uint32(avctx, pb, "colortone", "%"PRIi32);
+ read_string(avctx, pb, "picStyleName", 16);
+ size -= 36;
+ } else if (type == MKTAG('M','A','R','K')) {
+ } else if (type == MKTAG('N','U','L','L')) {
+ } else if (type == MKTAG('M','L','V','I')) { /* occurs when MLV and Mnn files are concatenated */
+ } else {
+ av_log(avctx, AV_LOG_INFO, "unsupported tag %c%c%c%c, size %u\n", type&0xFF, (type>>8)&0xFF, (type>>16)&0xFF, (type>>24)&0xFF, size);
+ }
+ avio_skip(pb, size);
+ }
+ return 0;
+}
+
+static int read_header(AVFormatContext *avctx)
+{
+ MlvContext *mlv = avctx->priv_data;
+ AVIOContext *pb = avctx->pb;
+ AVStream *vst = NULL, *ast = NULL;
+ int size, ret;
+ uint64_t guid;
+ char guidstr[32];
+
+ avio_skip(pb, 4);
+ size = avio_rl32(pb);
+ if (size < 52)
+ return AVERROR_INVALIDDATA;
+
+ avio_skip(pb, 8);
+
+ guid = avio_rl64(pb);
+ snprintf(guidstr, sizeof(guidstr), "0x%"PRIx64, guid);
+ av_dict_set(&avctx->metadata, "guid", guidstr, 0);
+
+ avio_skip(pb, 8); //fileNum, fileCount, fileFlags
+
+ mlv->class[0] = avio_rl16(pb);
+ if (mlv->class[0]) {
+ vst = avformat_new_stream(avctx, NULL);
+ if (!vst)
+ return AVERROR(ENOMEM);
+ vst->id = 0;
+ if ((mlv->class[0] & (MLV_CLASS_FLAG_DELTA|MLV_CLASS_FLAG_LZMA)))
+ avpriv_request_sample(avctx, "compression");
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ switch (mlv->class[0] & ~(MLV_CLASS_FLAG_DELTA|MLV_CLASS_FLAG_LZMA)) {
+ case MLV_VIDEO_CLASS_RAW:
+ vst->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
+ break;
+ case MLV_VIDEO_CLASS_YUV:
+ vst->codec->pix_fmt = AV_PIX_FMT_YUV420P;
+ vst->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
+ vst->codec->codec_tag = 0;
+ break;
+ case MLV_VIDEO_CLASS_JPEG:
+ vst->codec->codec_id = AV_CODEC_ID_MJPEG;
+ vst->codec->codec_tag = 0;
+ break;
+ case MLV_VIDEO_CLASS_H264:
+ vst->codec->codec_id = AV_CODEC_ID_H264;
+ vst->codec->codec_tag = 0;
+ break;
+ default:
+ avpriv_request_sample(avctx, "unknown video class");
+ }
+ }
+
+ mlv->class[1] = avio_rl16(pb);
+ if (mlv->class[1]) {
+ ast = avformat_new_stream(avctx, NULL);
+ if (!ast)
+ return AVERROR(ENOMEM);
+ ast->id = 1;
+ if ((mlv->class[1] & MLV_CLASS_FLAG_LZMA))
+ avpriv_request_sample(avctx, "compression");
+ if ((mlv->class[1] & ~MLV_CLASS_FLAG_LZMA) != MLV_AUDIO_CLASS_WAV)
+ avpriv_request_sample(avctx, "unknown audio class");
+
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ avpriv_set_pts_info(ast, 33, 1, ast->codec->sample_rate);
+ }
+
+ if (vst)
+ vst->nb_frames = avio_rl32(pb);
+ else
+ avio_skip(pb, 4);
+
+ if (ast)
+ ast->nb_frames = avio_rl32(pb);
+ else
+ avio_skip(pb, 4);
+
+ if (vst) {
+ AVRational framerate;
+ framerate.num = avio_rl32(pb);
+ framerate.den = avio_rl32(pb);
+ avpriv_set_pts_info(vst, 64, framerate.den, framerate.num);
+ } else
+ avio_skip(pb, 8);
+
+ avio_skip(pb, size - 52);
+
+ /* scan primary file */
+ mlv->pb[100] = avctx->pb;
+ ret = scan_file(avctx, vst, ast, 100);
+ if (ret < 0)
+ return ret;
+
+ /* scan secondary files */
+ if (strlen(avctx->filename) > 2) {
+ int i;
+ char *filename = av_strdup(avctx->filename);
+ if (!filename)
+ return AVERROR(ENOMEM);
+ for (i = 0; i < 100; i++) {
+ snprintf(filename + strlen(filename) - 2, 3, "%02d", i);
+ if (avio_open2(&mlv->pb[i], filename, AVIO_FLAG_READ, &avctx->interrupt_callback, NULL) < 0)
+ break;
+ if (check_file_header(mlv->pb[i], guid) < 0) {
+ av_log(avctx, AV_LOG_WARNING, "ignoring %s; bad format or guid mismatch\n", filename);
+ avio_close(mlv->pb[i]);
+ mlv->pb[i] = NULL;
+ continue;
+ }
+ av_log(avctx, AV_LOG_INFO, "scanning %s\n", filename);
+ ret = scan_file(avctx, vst, ast, i);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_WARNING, "ignoring %s; %s\n", filename, av_err2str(ret));
+ avio_close(mlv->pb[i]);
+ mlv->pb[i] = NULL;
+ continue;
+ }
+ }
+ av_free(filename);
+ }
+
+ if (vst)
+ vst->duration = vst->nb_index_entries;
+ if (ast)
+ ast->duration = ast->nb_index_entries;
+
+ if (vst && ast)
+ avio_seek(pb, FFMIN(vst->index_entries[0].pos, ast->index_entries[0].pos), SEEK_SET);
+ else if (vst)
+ avio_seek(pb, vst->index_entries[0].pos, SEEK_SET);
+ else if (ast)
+ avio_seek(pb, ast->index_entries[0].pos, SEEK_SET);
+
+ return 0;
+}
+
+static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
+{
+ MlvContext *mlv = avctx->priv_data;
+ AVIOContext *pb;
+ AVStream *st = avctx->streams[mlv->stream_index];
+ int index, ret;
+ unsigned int size, space;
+
+ if (mlv->pts >= st->duration)
+ return AVERROR_EOF;
+
+ index = av_index_search_timestamp(st, mlv->pts, AVSEEK_FLAG_ANY);
+ if (index < 0) {
+ av_log(avctx, AV_LOG_ERROR, "could not find index entry for frame %"PRId64"\n", mlv->pts);
+ return AVERROR(EIO);
+ }
+
+ pb = mlv->pb[st->index_entries[index].size];
+ avio_seek(pb, st->index_entries[index].pos, SEEK_SET);
+
+ avio_skip(pb, 4); // blockType
+ size = avio_rl32(pb);
+ if (size < 16)
+ return AVERROR_INVALIDDATA;
+ avio_skip(pb, 12); //timestamp, frameNumber
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
+ avio_skip(pb, 8); // cropPosX, cropPosY, panPosX, panPosY
+ space = avio_rl32(pb);
+ avio_skip(pb, space);
+
+ if ((mlv->class[st->id] & (MLV_CLASS_FLAG_DELTA|MLV_CLASS_FLAG_LZMA))) {
+ ret = AVERROR_PATCHWELCOME;
+ } else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ ret = av_get_packet(pb, pkt, (st->codec->width * st->codec->height * st->codec->bits_per_coded_sample + 7) >> 3);
+ } else { // AVMEDIA_TYPE_AUDIO
+ if (space > UINT_MAX - 24 || size < (24 + space))
+ return AVERROR_INVALIDDATA;
+ ret = av_get_packet(pb, pkt, size - (24 + space));
+ }
+
+ if (ret < 0)
+ return ret;
+
+ pkt->stream_index = mlv->stream_index;
+ pkt->pts = mlv->pts;
+
+ mlv->stream_index++;
+ if (mlv->stream_index == avctx->nb_streams) {
+ mlv->stream_index = 0;
+ mlv->pts++;
+ }
+ return 0;
+}
+
+static int read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
+{
+ MlvContext *mlv = avctx->priv_data;
+
+ if ((flags & AVSEEK_FLAG_FRAME) || (flags & AVSEEK_FLAG_BYTE))
+ return AVERROR(ENOSYS);
+
+ if (!avctx->pb->seekable)
+ return AVERROR(EIO);
+
+ mlv->pts = timestamp;
+ return 0;
+}
+
+static int read_close(AVFormatContext *s)
+{
+ MlvContext *mlv = s->priv_data;
+ int i;
+ for (i = 0; i < 100; i++)
+ if (mlv->pb[i])
+ avio_close(mlv->pb[i]);
+ return 0;
+}
+
+AVInputFormat ff_mlv_demuxer = {
+ .name = "mlv",
+ .long_name = NULL_IF_CONFIG_SMALL("Magic Lantern Video (MLV)"),
+ .priv_data_size = sizeof(MlvContext),
+ .read_probe = probe,
+ .read_header = read_header,
+ .read_packet = read_packet,
+ .read_close = read_close,
+ .read_seek = read_seek,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/mms.c b/chromium/third_party/ffmpeg/libavformat/mms.c
index 46fbede90c4..7e60b3bec60 100644
--- a/chromium/third_party/ffmpeg/libavformat/mms.c
+++ b/chromium/third_party/ffmpeg/libavformat/mms.c
@@ -1,7 +1,7 @@
/*
* MMS protocol common definitions.
* Copyright (c) 2006,2007 Ryan Martell
- * Copyright (c) 2007 Björn Axelsson
+ * Copyright (c) 2007 Björn Axelsson
* Copyright (c) 2010 Zhentan Feng <spyfeng at gmail dot com>
*
* This file is part of FFmpeg.
diff --git a/chromium/third_party/ffmpeg/libavformat/mmsh.c b/chromium/third_party/ffmpeg/libavformat/mmsh.c
index 482ece40316..dac5d9f6539 100644
--- a/chromium/third_party/ffmpeg/libavformat/mmsh.c
+++ b/chromium/third_party/ffmpeg/libavformat/mmsh.c
@@ -119,7 +119,7 @@ static int read_data_packet(MMSHContext *mmsh, const int len)
int res;
if (len > sizeof(mms->in_buffer)) {
av_log(NULL, AV_LOG_ERROR,
- "Data packet length %d exceeds the in_buffer size %zu\n",
+ "Data packet length %d exceeds the in_buffer size %"SIZE_SPECIFIER"\n",
len, sizeof(mms->in_buffer));
return AVERROR(EIO);
}
@@ -194,7 +194,7 @@ static int get_http_header_data(MMSHContext *mmsh)
if (len) {
if (len > sizeof(mms->in_buffer)) {
av_log(NULL, AV_LOG_ERROR,
- "Other packet len = %d exceed the in_buffer size %zu\n",
+ "Other packet len = %d exceed the in_buffer size %"SIZE_SPECIFIER"\n",
len, sizeof(mms->in_buffer));
return AVERROR(EIO);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/mmst.c b/chromium/third_party/ffmpeg/libavformat/mmst.c
index 382895566ee..c851187dafb 100644
--- a/chromium/third_party/ffmpeg/libavformat/mmst.c
+++ b/chromium/third_party/ffmpeg/libavformat/mmst.c
@@ -1,7 +1,7 @@
/*
* MMS protocol over TCP
* Copyright (c) 2006,2007 Ryan Martell
- * Copyright (c) 2007 Björn Axelsson
+ * Copyright (c) 2007 Björn Axelsson
* Copyright (c) 2010 Zhentan Feng <spyfeng at gmail dot com>
*
* This file is part of FFmpeg.
@@ -284,7 +284,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
if (length_remaining < 0
|| length_remaining > sizeof(mms->in_buffer) - 12) {
av_log(NULL, AV_LOG_ERROR,
- "Incoming packet length %d exceeds bufsize %zu\n",
+ "Incoming packet length %d exceeds bufsize %"SIZE_SPECIFIER"\n",
length_remaining, sizeof(mms->in_buffer) - 12);
return AVERROR_INVALIDDATA;
}
@@ -320,7 +320,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
if (length_remaining < 0
|| length_remaining > sizeof(mms->in_buffer) - 8) {
av_log(NULL, AV_LOG_ERROR,
- "Data length %d is invalid or too large (max=%zu)\n",
+ "Data length %d is invalid or too large (max=%"SIZE_SPECIFIER")\n",
length_remaining, sizeof(mms->in_buffer));
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/mov.c b/chromium/third_party/ffmpeg/libavformat/mov.c
index 0157a7dc8a9..b0500d9756c 100644
--- a/chromium/third_party/ffmpeg/libavformat/mov.c
+++ b/chromium/third_party/ffmpeg/libavformat/mov.c
@@ -23,6 +23,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
@@ -46,6 +47,7 @@
#include "libavcodec/get_bits.h"
#include "id3v1.h"
#include "mov_chan.h"
+#include "replaygain.h"
#if CONFIG_ZLIB
#include <zlib.h>
@@ -129,74 +131,6 @@ static int mov_metadata_gnre(MOVContext *c, AVIOContext *pb,
return 0;
}
-static int mov_read_custom_metadata(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
- char key[1024]={0}, data[1024]={0};
- int i;
- 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;
-
- if (atom.size <= 8) return 0;
-
- for (i = 0; i < 3; i++) { // Parse up to three sub-atoms looking for name and data.
- int data_size = avio_rb32(pb);
- int tag = avio_rl32(pb);
- int str_size = 0, skip_size = 0;
- char *target = NULL;
-
- switch (tag) {
- case MKTAG('n','a','m','e'):
- avio_rb32(pb); // version/flags
- str_size = skip_size = data_size - 12;
- atom.size -= 12;
- target = key;
- break;
- case MKTAG('d','a','t','a'):
- avio_rb32(pb); // version/flags
- avio_rb32(pb); // reserved (zero)
- str_size = skip_size = data_size - 16;
- atom.size -= 16;
- target = data;
- break;
- default:
- skip_size = data_size - 8;
- str_size = 0;
- break;
- }
-
- if (target) {
- str_size = FFMIN3(sizeof(data)-1, str_size, atom.size);
- avio_read(pb, target, str_size);
- target[str_size] = 0;
- }
- atom.size -= skip_size;
-
- // If we didn't read the full data chunk for the sub-atom, skip to the end of it.
- if (skip_size > str_size) avio_skip(pb, skip_size - str_size);
- }
-
- if (*key && *data) {
- if (strcmp(key, "iTunSMPB") == 0) {
- int priming, remainder, samples;
- if(sscanf(data, "%*X %X %X %X", &priming, &remainder, &samples) == 3){
- if(priming>0 && priming<16384)
- sc->start_pad = priming;
- return 1;
- }
- }
- if (strcmp(key, "cdec") == 0) {
-// av_dict_set(&st->metadata, key, data, 0);
- return 1;
- }
- }
- return 0;
-}
-
static const uint32_t mac_to_unicode[128] = {
0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1,
0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8,
@@ -298,15 +232,14 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
uint32_t data_type = 0, str_size;
int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL;
- if (c->itunes_metadata && atom.type == MKTAG('-','-','-','-'))
- return mov_read_custom_metadata(c, pb, 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'): key = "artist"; break;
case MKTAG( 'a','A','R','T'): key = "album_artist"; break;
case MKTAG(0xa9,'w','r','t'): key = "composer"; break;
+ case MKTAG( 'c','p','i','l'): key = "compilation";
+ parse = mov_metadata_int8_no_padding; break;
case MKTAG( 'c','p','r','t'):
case MKTAG(0xa9,'c','p','y'): key = "copyright"; break;
case MKTAG(0xa9,'g','r','p'): key = "grouping"; break;
@@ -362,8 +295,8 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int ret = mov_read_covr(c, pb, data_type, str_size);
if (ret < 0) {
av_log(c->fc, AV_LOG_ERROR, "Error parsing cover art.\n");
- return ret;
}
+ return ret;
}
} else return 0;
} else if (atom.size > 4 && key && !c->itunes_metadata) {
@@ -394,7 +327,9 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (data_type == 3 || (data_type == 0 && (langcode < 0x400 || langcode == 0x7fff))) { // MAC Encoded
mov_read_mac_string(c, pb, str_size, str, sizeof(str));
} else {
- avio_read(pb, str, str_size);
+ int ret = avio_read(pb, str, str_size);
+ if (ret != str_size)
+ return ret < 0 ? ret : AVERROR_INVALIDDATA;
str[str_size] = 0;
}
av_dict_set(&c->fc->metadata, key, str, 0);
@@ -537,7 +472,8 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
dref->dir = av_malloc(len+1);
if (!dref->dir)
return AVERROR(ENOMEM);
- avio_read(pb, dref->dir, len);
+ if (avio_read(pb, dref->dir, len) != len)
+ return AVERROR_INVALIDDATA;
dref->dir[len] = 0;
for (j = 0; j < len; j++)
if (dref->dir[j] == ':')
@@ -764,7 +700,7 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type);
av_dict_set(&c->fc->metadata, "major_brand", type, 0);
minor_ver = avio_rb32(pb); /* minor version */
- snprintf(minor_ver_str, sizeof(minor_ver_str), "%d", minor_ver);
+ snprintf(minor_ver_str, sizeof(minor_ver_str), "%"PRIu32"", minor_ver);
av_dict_set(&c->fc->metadata, "minor_version", minor_ver_str, 0);
comp_brand_size = atom.size - 8;
@@ -1002,7 +938,14 @@ static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom,
st->codec->extradata_size= size - FF_INPUT_BUFFER_PADDING_SIZE;
AV_WB32( buf , atom.size + 8);
AV_WL32( buf + 4, atom.type);
- avio_read(pb, buf + 8, atom.size);
+ err = avio_read(pb, buf + 8, atom.size);
+ if (err < 0) {
+ return err;
+ } else if (err < atom.size) {
+ av_log(c->fc, AV_LOG_WARNING, "truncated extradata\n");
+ st->codec->extradata_size -= atom.size - err;
+ }
+ memset(buf + 8 + err, 0, FF_INPUT_BUFFER_PADDING_SIZE);
return 0;
}
@@ -1080,9 +1023,8 @@ static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom)
st->codec->codec_id == AV_CODEC_ID_SPEEX) {
// pass all frma atom to codec, needed at least for QDMC and QDM2
av_free(st->codec->extradata);
- if (ff_alloc_extradata(st->codec, atom.size))
+ if (ff_get_extradata(st->codec, pb, atom.size) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, st->codec->extradata, atom.size);
} else if (atom.size > 8) { /* to read frma, esds atoms */
int ret;
if ((ret = mov_read_default(c, pb, atom)) < 0)
@@ -1117,9 +1059,9 @@ static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return mov_read_default(c, pb, atom);
}
av_free(st->codec->extradata);
- if (ff_alloc_extradata(st->codec, atom.size))
+ if (ff_get_extradata(st->codec, pb, atom.size) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, st->codec->extradata, atom.size);
+
return 0;
}
@@ -1127,6 +1069,7 @@ static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
uint8_t profile_level;
+ int ret;
if (c->fc->nb_streams < 1)
return 0;
@@ -1139,11 +1082,11 @@ static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if ((profile_level & 0xf0) != 0xc0)
return 0;
- av_free(st->codec->extradata);
- if (ff_alloc_extradata(st->codec, atom.size - 7))
- return AVERROR(ENOMEM);
avio_seek(pb, 6, SEEK_CUR);
- avio_read(pb, st->codec->extradata, st->codec->extradata_size);
+ av_free(st->codec->extradata);
+ if ((ret = ff_get_extradata(st->codec, pb, atom.size - 7)) < 0)
+ return ret;
+
return 0;
}
@@ -1165,11 +1108,10 @@ static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if ((uint64_t)atom.size > (1<<30))
return AVERROR_INVALIDDATA;
+ avio_skip(pb, 40);
av_free(st->codec->extradata);
- if (ff_alloc_extradata(st->codec, atom.size - 40))
+ if (ff_get_extradata(st->codec, pb, atom.size - 40) < 0)
return AVERROR(ENOMEM);
- avio_skip(pb, 40);
- avio_read(pb, st->codec->extradata, atom.size - 40);
return 0;
}
@@ -1266,6 +1208,7 @@ static int mov_codec_id(AVStream *st, uint32_t format)
static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
AVStream *st, MOVStreamContext *sc)
{
+ uint8_t codec_name[32];
unsigned int color_depth, len, j;
int color_greyscale;
int color_table_id;
@@ -1287,18 +1230,22 @@ static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
len = avio_r8(pb); /* codec name, pascal string */
if (len > 31)
len = 31;
- mov_read_mac_string(c, pb, len, st->codec->codec_name, 32);
+ mov_read_mac_string(c, pb, len, codec_name, sizeof(codec_name));
if (len < 31)
avio_skip(pb, 31 - len);
+
+ if (codec_name[0])
+ av_dict_set(&st->metadata, "encoder", codec_name, 0);
+
/* codec_tag YV12 triggers an UV swap in rawdec.c */
- if (!memcmp(st->codec->codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25)) {
+ if (!memcmp(codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25)) {
st->codec->codec_tag = MKTAG('I', '4', '2', '0');
st->codec->width &= ~1;
st->codec->height &= ~1;
}
/* Flash Media Server uses tag H263 with Sorenson Spark */
if (st->codec->codec_tag == MKTAG('H','2','6','3') &&
- !memcmp(st->codec->codec_name, "Sorenson H263", 13))
+ !memcmp(codec_name, "Sorenson H263", 13))
st->codec->codec_id = AV_CODEC_ID_FLV1;
st->codec->bits_per_coded_sample = avio_rb16(pb); /* depth */
@@ -1308,6 +1255,9 @@ static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
/* figure out the palette situation */
color_depth = st->codec->bits_per_coded_sample & 0x1F;
color_greyscale = st->codec->bits_per_coded_sample & 0x20;
+ /* Do not create a greyscale palette for cinepak */
+ if (color_greyscale && st->codec->codec_id == AV_CODEC_ID_CINEPAK)
+ return;
/* if the depth is 2, 4, or 8 bpp, file is palettized */
if ((color_depth == 2) || (color_depth == 4) || (color_depth == 8)) {
@@ -1323,9 +1273,6 @@ static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
color_index = 255;
color_dec = 256 / (color_count - 1);
for (j = 0; j < color_count; j++) {
- if (st->codec->codec_id == AV_CODEC_ID_CINEPAK){
- r = g = b = color_count - 1 - color_index;
- } else
r = g = b = color_index;
sc->palette[j] = (0xFFU << 24) | (r << 16) | (g << 8) | (b);
color_index -= color_dec;
@@ -1477,14 +1424,64 @@ static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb,
st->codec->height = sc->height;
}
+static uint32_t yuv_to_rgba(uint32_t ycbcr)
+{
+ uint8_t r, g, b;
+ int y, cb, cr;
+
+ y = (ycbcr >> 16) & 0xFF;
+ cr = (ycbcr >> 8) & 0xFF;
+ cb = ycbcr & 0xFF;
+
+ b = av_clip_uint8(1.164 * (y - 16) + 2.018 * (cb - 128));
+ g = av_clip_uint8(1.164 * (y - 16) - 0.813 * (cr - 128) - 0.391 * (cb - 128));
+ r = av_clip_uint8(1.164 * (y - 16) + 1.596 * (cr - 128));
+
+ return (r << 16) | (g << 8) | b;
+}
+
+static int mov_rewrite_dvd_sub_extradata(AVStream *st)
+{
+ char buf[256] = {0};
+ uint8_t *src = st->codec->extradata;
+ int i;
+
+ if (st->codec->extradata_size != 64)
+ return 0;
+
+ if (st->codec->width > 0 && st->codec->height > 0)
+ snprintf(buf, sizeof(buf), "size: %dx%d\n",
+ st->codec->width, st->codec->height);
+ av_strlcat(buf, "palette: ", sizeof(buf));
+
+ for (i = 0; i < 16; i++) {
+ uint32_t yuv = AV_RB32(src + i * 4);
+ uint32_t rgba = yuv_to_rgba(yuv);
+
+ av_strlcatf(buf, sizeof(buf), "%06"PRIx32"%s", rgba, i != 15 ? ", " : "");
+ }
+
+ if (av_strlcat(buf, "\n", sizeof(buf)) >= sizeof(buf))
+ return 0;
+
+ av_freep(&st->codec->extradata);
+ st->codec->extradata_size = 0;
+ st->codec->extradata = av_mallocz(strlen(buf) + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!st->codec->extradata)
+ return AVERROR(ENOMEM);
+ st->codec->extradata_size = strlen(buf);
+ memcpy(st->codec->extradata, buf, st->codec->extradata_size);
+
+ return 0;
+}
+
static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
AVStream *st, MOVStreamContext *sc,
int size)
{
if (st->codec->codec_tag == MKTAG('t','m','c','d')) {
- if (ff_alloc_extradata(st->codec, size))
+ if (ff_get_extradata(st->codec, pb, size) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, st->codec->extradata, size);
if (size > 16) {
MOVStreamContext *tmcd_ctx = st->priv_data;
int val;
@@ -1529,6 +1526,10 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb,
// force sample rate for qcelp when not stored in mov
if (st->codec->codec_tag != MKTAG('Q','c','l','p'))
st->codec->sample_rate = 8000;
+ // FIXME: Why is the following needed for some files?
+ sc->samples_per_frame = 160;
+ if (!sc->bytes_per_frame)
+ sc->bytes_per_frame = 35;
break;
case AV_CODEC_ID_AMR_NB:
st->codec->channels = 1;
@@ -1561,11 +1562,7 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb,
}
break;
case AV_CODEC_ID_AC3:
- st->need_parsing = AVSTREAM_PARSE_FULL;
- break;
case AV_CODEC_ID_MPEG1VIDEO:
- st->need_parsing = AVSTREAM_PARSE_FULL;
- break;
case AV_CODEC_ID_VC1:
st->need_parsing = AVSTREAM_PARSE_FULL;
break;
@@ -1906,6 +1903,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (entries >= UINT_MAX / sizeof(*sc->stts_data))
return -1;
+ av_free(sc->stts_data);
sc->stts_data = av_malloc(entries * sizeof(*sc->stts_data));
if (!sc->stts_data)
return AVERROR(ENOMEM);
@@ -1919,7 +1917,8 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
/* sample_duration < 0 is invalid based on the spec */
if (sample_duration < 0) {
- av_log(c->fc, AV_LOG_ERROR, "Invalid SampleDelta in STTS %d\n", sample_duration);
+ av_log(c->fc, AV_LOG_ERROR, "Invalid SampleDelta %d in STTS, at %d st:%d\n",
+ sample_duration, i, c->fc->nb_streams-1);
sample_duration = 1;
}
if (sample_count < 0) {
@@ -1932,12 +1931,21 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_dlog(c->fc, "sample_count=%d, sample_duration=%d\n",
sample_count, sample_duration);
+ if ( i+1 == entries
+ && i
+ && sample_count == 1
+ && total_sample_count > 100
+ && sample_duration/10 > duration / total_sample_count)
+ sample_duration = duration / total_sample_count;
duration+=(int64_t)sample_duration*sample_count;
total_sample_count+=sample_count;
}
sc->stts_count = i;
+ sc->duration_for_fps += duration;
+ sc->nb_frames_for_fps += total_sample_count;
+
if (pb->eof_reached)
return AVERROR_EOF;
@@ -2145,6 +2153,11 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
rap_group_index++;
}
}
+ if (sc->keyframe_absent
+ && !sc->stps_count
+ && !rap_group_present
+ && st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
+ keyframe = 1;
if (keyframe)
distance = 0;
sample_size = sc->stsz_sample_size > 0 ? sc->stsz_sample_size : sc->sample_sizes[current_sample];
@@ -2379,10 +2392,6 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
((double)st->codec->width * sc->height), INT_MAX);
}
- if (st->duration > 0)
- av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
- sc->time_scale*st->nb_frames, st->duration, INT_MAX);
-
#if FF_API_R_FRAME_RATE
if (sc->stts_count == 1 || (sc->stts_count == 2 && sc->stts_data[1].count == 1))
av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den,
@@ -2434,6 +2443,103 @@ static int mov_read_ilst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return ret;
}
+static int mov_read_custom_2plus(MOVContext *c, AVIOContext *pb, int size)
+{
+ int64_t end = avio_tell(pb) + size;
+ uint8_t *key = NULL, *val = NULL;
+ int i;
+ 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;
+
+ for (i = 0; i < 2; i++) {
+ uint8_t **p;
+ uint32_t len, tag;
+
+ if (end - avio_tell(pb) <= 12)
+ break;
+
+ len = avio_rb32(pb);
+ tag = avio_rl32(pb);
+ avio_skip(pb, 4); // flags
+
+ if (len < 12 || len - 12 > end - avio_tell(pb))
+ break;
+ len -= 12;
+
+ if (tag == MKTAG('n', 'a', 'm', 'e'))
+ p = &key;
+ else if (tag == MKTAG('d', 'a', 't', 'a') && len > 4) {
+ avio_skip(pb, 4);
+ len -= 4;
+ p = &val;
+ } else
+ break;
+
+ *p = av_malloc(len + 1);
+ if (!*p)
+ break;
+ avio_read(pb, *p, len);
+ (*p)[len] = 0;
+ }
+
+ if (key && val) {
+ if (strcmp(key, "iTunSMPB") == 0) {
+ int priming, remainder, samples;
+ if(sscanf(val, "%*X %X %X %X", &priming, &remainder, &samples) == 3){
+ if(priming>0 && priming<16384)
+ sc->start_pad = priming;
+ }
+ } else if (strcmp(key, "cdec") == 0) {
+ } else {
+ av_dict_set(&c->fc->metadata, key, val,
+ AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
+ key = val = NULL;
+ }
+ }
+
+ avio_seek(pb, end, SEEK_SET);
+ av_freep(&key);
+ av_freep(&val);
+ return 0;
+}
+
+static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+ int64_t end = avio_tell(pb) + atom.size;
+ uint32_t tag, len;
+
+ if (atom.size < 8)
+ goto fail;
+
+ len = avio_rb32(pb);
+ tag = avio_rl32(pb);
+
+ if (len > atom.size)
+ goto fail;
+
+ if (tag == MKTAG('m', 'e', 'a', 'n') && len > 12) {
+ uint8_t domain[128];
+ int domain_len;
+
+ avio_skip(pb, 4); // flags
+ len -= 12;
+
+ domain_len = avio_get_str(pb, len, domain, sizeof(domain));
+ avio_skip(pb, len - domain_len);
+ return mov_read_custom_2plus(c, pb, end - avio_tell(pb));
+ }
+
+fail:
+ av_log(c->fc, AV_LOG_VERBOSE,
+ "Unhandled or malformed custom metadata of size %"PRId64"\n", atom.size);
+ return 0;
+}
+
static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
while (atom.size > 8) {
@@ -2701,6 +2807,8 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
dts += sample_duration;
offset += sample_size;
sc->data_size += sample_size;
+ sc->duration_for_fps += sample_duration;
+ sc->nb_frames_for_fps ++;
}
if (pb->eof_reached)
@@ -2975,6 +3083,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG('h','v','c','C'), mov_read_glbl },
{ MKTAG('u','u','i','d'), mov_read_uuid },
{ MKTAG('C','i','n', 0x8e), mov_read_targa_y216 },
+{ MKTAG('-','-','-','-'), mov_read_custom },
{ 0, NULL }
};
@@ -3272,15 +3381,20 @@ static int mov_read_close(AVFormatContext *s)
av_freep(&sc->drefs[j].dir);
}
av_freep(&sc->drefs);
+
+ sc->drefs_count = 0;
+
if (!sc->pb_is_copied)
avio_close(sc->pb);
+
sc->pb = NULL;
av_freep(&sc->chunk_offsets);
- av_freep(&sc->keyframes);
- av_freep(&sc->sample_sizes);
- av_freep(&sc->stps_data);
av_freep(&sc->stsc_data);
+ av_freep(&sc->sample_sizes);
+ av_freep(&sc->keyframes);
av_freep(&sc->stts_data);
+ av_freep(&sc->stps_data);
+ av_freep(&sc->rap_group);
}
if (mov->dv_demux) {
@@ -3336,8 +3450,9 @@ static int mov_read_header(AVFormatContext *s)
{
MOVContext *mov = s->priv_data;
AVIOContext *pb = s->pb;
- int i, j, err;
+ int j, err;
MOVAtom atom = { AV_RL32("root") };
+ int i;
mov->fc = s;
/* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */
@@ -3395,6 +3510,19 @@ static int mov_read_header(AVFormatContext *s)
if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->codec->codec_id == AV_CODEC_ID_AAC) {
st->skip_samples = sc->start_pad;
}
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && sc->nb_frames_for_fps > 0 && sc->duration_for_fps > 0)
+ av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
+ sc->time_scale*(int64_t)sc->nb_frames_for_fps, sc->duration_for_fps, INT_MAX);
+ if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
+ if (st->codec->width <= 0 && st->codec->height <= 0) {
+ st->codec->width = sc->width;
+ st->codec->height = sc->height;
+ }
+ if (st->codec->codec_id == AV_CODEC_ID_DVD_SUBTITLE) {
+ if ((err = mov_rewrite_dvd_sub_extradata(st)) < 0)
+ return err;
+ }
+ }
}
if (mov->trex_data) {
@@ -3414,6 +3542,19 @@ static int mov_read_header(AVFormatContext *s)
ff_rfps_calculate(s);
+ for (i = 0; i < s->nb_streams; i++) {
+ AVStream *st = s->streams[i];
+
+ if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO)
+ continue;
+
+ err = ff_replaygain_export(st, s->metadata);
+ if (err < 0) {
+ mov_read_close(s);
+ return err;
+ }
+ }
+
return 0;
}
@@ -3617,6 +3758,7 @@ AVInputFormat ff_mov_demuxer = {
.name = "mov,mp4,m4a,3gp,3g2,mj2",
.long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
.priv_data_size = sizeof(MOVContext),
+ .extensions = "mov,mp4,m4a,3gp,3g2,mj2",
.read_probe = mov_probe,
.read_header = mov_read_header,
.read_packet = mov_read_packet,
diff --git a/chromium/third_party/ffmpeg/libavformat/movenc.c b/chromium/third_party/ffmpeg/libavformat/movenc.c
index 7315417ca2a..adcbcf2c0f8 100644
--- a/chromium/third_party/ffmpeg/libavformat/movenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/movenc.c
@@ -22,6 +22,7 @@
*/
#include <stdint.h>
+#include <inttypes.h>
#include "movenc.h"
#include "avformat.h"
@@ -33,12 +34,15 @@
#include "libavcodec/get_bits.h"
#include "libavcodec/put_bits.h"
#include "libavcodec/vc1.h"
+#include "libavcodec/raw.h"
#include "internal.h"
#include "libavutil/avstring.h"
#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"
+#include "libavutil/pixdesc.h"
+#include "hevc.h"
#include "rtpenc.h"
#include "mov_chan.h"
@@ -66,6 +70,7 @@ static const AVOption options[] = {
{ "ism_lookahead", "Number of lookahead entries for ISM files", offsetof(MOVMuxContext, ism_lookahead), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
{ "use_editlist", "use edit list", offsetof(MOVMuxContext, use_editlist), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, AV_OPT_FLAG_ENCODING_PARAM},
{ "video_track_timescale", "set timescale of all video tracks", offsetof(MOVMuxContext, video_track_timescale), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
+ { "brand", "Override major brand", offsetof(MOVMuxContext, major_brand), AV_OPT_TYPE_STRING, {.str = NULL}, .flags = AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
};
@@ -348,7 +353,9 @@ static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
// the following fields is made of 6 bits to identify the streamtype (4 for video, 5 for audio)
// plus 1 bit to indicate upstream and 1 bit set to 1 (reserved)
- if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
+ if (track->enc->codec_id == AV_CODEC_ID_DVD_SUBTITLE)
+ avio_w8(pb, (0x38 << 2) | 1); // flags (= NeroSubpicStream)
+ else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
avio_w8(pb, 0x15); // flags (= Audiostream)
else
avio_w8(pb, 0x11); // flags (= Visualstream)
@@ -390,20 +397,24 @@ static int mov_pcm_be_gt16(enum AVCodecID codec_id)
static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track)
{
+ int ret;
int64_t pos = avio_tell(pb);
avio_wb32(pb, 0);
avio_wl32(pb, track->tag); // store it byteswapped
track->enc->codec_tag = av_bswap16(track->tag >> 16);
- ff_put_wav_header(pb, track->enc);
+ if ((ret = ff_put_wav_header(pb, track->enc, 0)) < 0)
+ return ret;
return update_size(pb, pos);
}
static int mov_write_wfex_tag(AVIOContext *pb, MOVTrack *track)
{
+ int ret;
int64_t pos = avio_tell(pb);
avio_wb32(pb, 0);
ffio_wfourcc(pb, "wfex");
- ff_put_wav_header(pb, track->enc);
+ if ((ret = ff_put_wav_header(pb, track->enc, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX)) < 0)
+ return ret;
return update_size(pb, pos);
}
@@ -614,7 +625,12 @@ static int get_cluster_duration(MOVTrack *track, int cluster_idx)
else
next_dts = track->cluster[cluster_idx + 1].dts;
- return next_dts - track->cluster[cluster_idx].dts;
+ next_dts -= track->cluster[cluster_idx].dts;
+
+ av_assert0(next_dts >= 0);
+ av_assert0(next_dts <= INT_MAX);
+
+ return next_dts;
}
static int get_samples_per_packet(MOVTrack *track)
@@ -767,6 +783,16 @@ static int mov_write_avcc_tag(AVIOContext *pb, MOVTrack *track)
return update_size(pb, pos);
}
+static int mov_write_hvcc_tag(AVIOContext *pb, MOVTrack *track)
+{
+ int64_t pos = avio_tell(pb);
+
+ avio_wb32(pb, 0);
+ ffio_wfourcc(pb, "hvcC");
+ ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 0);
+ return update_size(pb, pos);
+}
+
/* also used by all avid codecs (dv, imx, meridien) and their variants */
static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
{
@@ -823,12 +849,14 @@ static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track)
return 0;
if (track->enc->codec_id == AV_CODEC_ID_H264) tag = MKTAG('a','v','c','1');
+ else if (track->enc->codec_id == AV_CODEC_ID_HEVC) tag = MKTAG('h','e','v','1');
else if (track->enc->codec_id == AV_CODEC_ID_AC3) tag = MKTAG('a','c','-','3');
else if (track->enc->codec_id == AV_CODEC_ID_DIRAC) tag = MKTAG('d','r','a','c');
else if (track->enc->codec_id == AV_CODEC_ID_MOV_TEXT) tag = MKTAG('t','x','3','g');
else if (track->enc->codec_id == AV_CODEC_ID_VC1) tag = MKTAG('v','c','-','1');
else if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) tag = MKTAG('m','p','4','v');
else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) tag = MKTAG('m','p','4','a');
+ else if (track->enc->codec_id == AV_CODEC_ID_DVD_SUBTITLE) tag = MKTAG('m','p','4','s');
return tag;
}
@@ -901,11 +929,14 @@ static AVRational find_fps(AVFormatContext *s, AVStream *st)
static int mov_get_mpeg2_xdcam_codec_tag(AVFormatContext *s, MOVTrack *track)
{
- int tag = MKTAG('m', '2', 'v', '1'); //fallback tag
+ int tag = track->enc->codec_tag;
int interlaced = track->enc->field_order > AV_FIELD_PROGRESSIVE;
AVStream *st = track->st;
int rate = av_q2d(find_fps(s, st));
+ if (!tag)
+ tag = MKTAG('m', '2', 'v', '1'); //fallback tag
+
if (track->enc->pix_fmt == AV_PIX_FMT_YUV420P) {
if (track->enc->width == 1280 && track->enc->height == 720) {
if (!interlaced) {
@@ -984,6 +1015,7 @@ static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track)
{
int tag = track->enc->codec_tag;
int i;
+ enum AVPixelFormat pix_fmt;
for (i = 0; i < FF_ARRAY_ELEMS(mov_pix_fmt_tags); i++) {
if (track->enc->pix_fmt == mov_pix_fmt_tags[i].pix_fmt) {
@@ -994,6 +1026,13 @@ static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track)
}
}
+ pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_mov,
+ track->enc->bits_per_coded_sample);
+ if (tag == MKTAG('r','a','w',' ') &&
+ track->enc->pix_fmt != pix_fmt &&
+ track->enc->pix_fmt != AV_PIX_FMT_NONE)
+ av_log(s, AV_LOG_ERROR, "%s rawvideo cannot be written to mov, output file will be unreadable\n",
+ av_get_pix_fmt_name(track->enc->pix_fmt));
return tag;
}
@@ -1122,7 +1161,9 @@ static int mov_write_subtitle_tag(AVIOContext *pb, MOVTrack *track)
avio_wb16(pb, 0); /* Reserved */
avio_wb16(pb, 1); /* Data-reference index */
- if (track->enc->extradata_size)
+ if (track->enc->codec_id == AV_CODEC_ID_DVD_SUBTITLE)
+ mov_write_esds_tag(pb, track);
+ else if (track->enc->extradata_size)
avio_write(pb, track->enc->extradata, track->enc->extradata_size);
return update_size(pb, pos);
@@ -1221,6 +1262,8 @@ static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
avio_wb32(pb, 0);
} else if (track->enc->codec_id == AV_CODEC_ID_DNXHD)
mov_write_avid_tag(pb, track);
+ else if (track->enc->codec_id == AV_CODEC_ID_HEVC)
+ mov_write_hvcc_tag(pb, track);
else if (track->enc->codec_id == AV_CODEC_ID_H264) {
mov_write_avcc_tag(pb, track);
if (track->mode == MODE_IPOD)
@@ -1539,6 +1582,12 @@ static int mov_write_vmhd_tag(AVIOContext *pb)
return 0x14;
}
+static int is_clcp_track(MOVTrack *track)
+{
+ return track->tag == MKTAG('c','7','0','8') ||
+ track->tag == MKTAG('c','6','0','8');
+}
+
static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track)
{
const char *hdlr, *descr = NULL, *hdlr_type = NULL;
@@ -1557,12 +1606,17 @@ static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track)
hdlr_type = "soun";
descr = "SoundHandler";
} else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) {
- if (track->tag == MKTAG('c','6','0','8')) {
+ if (is_clcp_track(track)) {
hdlr_type = "clcp";
descr = "ClosedCaptionHandler";
} else {
- if (track->tag == MKTAG('t','x','3','g')) hdlr_type = "sbtl";
- else hdlr_type = "text";
+ if (track->tag == MKTAG('t','x','3','g')) {
+ hdlr_type = "sbtl";
+ } else if (track->tag == MKTAG('m','p','4','s')) {
+ hdlr_type = "subp";
+ } else {
+ hdlr_type = "text";
+ }
descr = "SubtitleHandler";
}
} else if (track->enc->codec_tag == MKTAG('r','t','p',' ')) {
@@ -1623,7 +1677,7 @@ static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track)
else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
mov_write_smhd_tag(pb);
else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) {
- if (track->tag == MKTAG('t','e','x','t') || track->tag == MKTAG('c','6','0','8')) {
+ if (track->tag == MKTAG('t','e','x','t') || is_clcp_track(track)) {
mov_write_gmhd_tag(pb, track);
} else {
mov_write_nmhd_tag(pb);
@@ -1929,10 +1983,16 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov,
mov_write_uuid_tag_psp(pb, track); // PSP Movies require this uuid box
if (track->tag == MKTAG('r','t','p',' '))
mov_write_udta_sdp(pb, track);
- if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO && track->mode == MODE_MOV) {
- double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio);
- if (st->sample_aspect_ratio.num && 1.0 != sample_aspect_ratio)
+ if (track->mode == MODE_MOV) {
+ if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) {
+ double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio);
+ if (st->sample_aspect_ratio.num && 1.0 != sample_aspect_ratio) {
+ mov_write_tapt_tag(pb, track);
+ }
+ }
+ if (is_clcp_track(track) && st->sample_aspect_ratio.num) {
mov_write_tapt_tag(pb, track);
+ }
}
return update_size(pb, pos);
}
@@ -2203,7 +2263,9 @@ static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
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", "date" , 1);
- mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 0, 1);
+ if (!mov->exact &&
+ !mov_write_string_metadata(s, pb, "\251too", "encoding_tool", 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);
@@ -2219,6 +2281,7 @@ static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
mov_write_int8_metadata (s, pb, "stik", "media_type",1);
mov_write_int8_metadata (s, pb, "hdvd", "hd_video", 1);
mov_write_int8_metadata (s, pb, "pgap", "gapless_playback",1);
+ mov_write_int8_metadata (s, pb, "cpil", "compilation", 1);
mov_write_trkn_tag(pb, mov, s, 0); // track number
mov_write_trkn_tag(pb, mov, s, 1); // disc number
mov_write_tmpo_tag(pb, s);
@@ -2321,14 +2384,9 @@ static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov,
AVFormatContext *s)
{
AVIOContext *pb_buf;
- int i, ret, size;
+ int ret, size;
uint8_t *buf;
- for (i = 0; i < s->nb_streams; i++)
- if (mov->tracks[i].enc->flags & CODEC_FLAG_BITEXACT) {
- return 0;
- }
-
ret = avio_open_dyn_buf(&pb_buf);
if (ret < 0)
return ret;
@@ -2388,6 +2446,7 @@ static void mov_write_psp_udta_tag(AVIOContext *pb,
static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s)
{
+ MOVMuxContext *mov = s->priv_data;
AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0);
int64_t pos, pos2;
@@ -2412,7 +2471,8 @@ static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s)
avio_wb16(pb, 0x0); /* ? */
avio_wb16(pb, 0x021C); /* data */
- mov_write_psp_udta_tag(pb, LIBAVCODEC_IDENT, "eng", 0x04);
+ if (!mov->exact)
+ mov_write_psp_udta_tag(pb, LIBAVCODEC_IDENT, "eng", 0x04);
mov_write_psp_udta_tag(pb, title->value, "eng", 0x01);
mov_write_psp_udta_tag(pb, "2006/04/01 11:11:11", "und", 0x03);
@@ -2482,7 +2542,10 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov,
int src_trk = mov->tracks[i].src_track;
mov->tracks[src_trk].tref_tag = mov->tracks[i].tag;
mov->tracks[src_trk].tref_id = mov->tracks[i].track_id;
- mov->tracks[i].track_duration = mov->tracks[src_trk].track_duration;
+ //src_trk may have a different timescale than the tmcd track
+ mov->tracks[i].track_duration = av_rescale(mov->tracks[src_trk].track_duration,
+ mov->tracks[i].timescale,
+ mov->tracks[src_trk].timescale);
}
}
@@ -2541,7 +2604,8 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov)
avio_printf(pb, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
avio_printf(pb, "<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">\n");
avio_printf(pb, "<head>\n");
- avio_printf(pb, "<meta name=\"creator\" content=\"%s\" />\n",
+ if (!mov->exact)
+ avio_printf(pb, "<meta name=\"creator\" content=\"%s\" />\n",
LIBAVFORMAT_IDENT);
avio_printf(pb, "</head>\n");
avio_printf(pb, "<body>\n");
@@ -2937,7 +3001,9 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
avio_wb32(pb, 0); /* size */
ffio_wfourcc(pb, "ftyp");
- if (mov->mode == MODE_3GP) {
+ if (mov->major_brand && strlen(mov->major_brand) >= 4)
+ ffio_wfourcc(pb, mov->major_brand);
+ else if (mov->mode == MODE_3GP) {
ffio_wfourcc(pb, has_h264 ? "3gp6" : "3gp4");
minor = has_h264 ? 0x100 : 0x200;
} else if (mov->mode & MODE_3G2) {
@@ -3255,6 +3321,17 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
int size = pkt->size;
uint8_t *reformatted_data = NULL;
+ if (trk->entry) {
+ int64_t duration = pkt->dts - trk->cluster[trk->entry - 1].dts;
+ if (duration < 0 || duration > INT_MAX) {
+ av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" / timestamp: %"PRId64" is out of range for mov/mp4 format\n",
+ duration, pkt->dts
+ );
+
+ pkt->dts = trk->cluster[trk->entry - 1].dts + 1;
+ pkt->pts = AV_NOPTS_VALUE;
+ }
+ }
if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
int ret;
if (mov->fragments > 0) {
@@ -3321,6 +3398,15 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
} else {
size = ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
}
+ } else if (enc->codec_id == AV_CODEC_ID_HEVC && trk->vos_len > 6 &&
+ (AV_RB24(trk->vos_data) == 1 || AV_RB32(trk->vos_data) == 1)) {
+ /* extradata is Annex B, assume the bitstream is too and convert it */
+ if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) {
+ ff_hevc_annexb2mp4_buf(pkt->data, &reformatted_data, &size, 0, NULL);
+ avio_write(pb, reformatted_data, size);
+ } else {
+ size = ff_hevc_annexb2mp4(pb, pkt->data, pkt->size, 0, NULL);
+ }
} else {
avio_write(pb, pkt->data, size);
}
@@ -3558,7 +3644,7 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
track->enc->extradata = buf;
track->enc->extradata_size = size;
} else {
- av_free(&buf);
+ av_freep(&buf);
}
}
#endif
@@ -3700,12 +3786,77 @@ static void mov_free(AVFormatContext *s)
av_freep(&mov->tracks);
}
+static uint32_t rgb_to_yuv(uint32_t rgb)
+{
+ uint8_t r, g, b;
+ int y, cb, cr;
+
+ r = (rgb >> 16) & 0xFF;
+ g = (rgb >> 8) & 0xFF;
+ b = (rgb ) & 0xFF;
+
+ y = av_clip_uint8( 16. + 0.257 * r + 0.504 * g + 0.098 * b);
+ cb = av_clip_uint8(128. - 0.148 * r - 0.291 * g + 0.439 * b);
+ cr = av_clip_uint8(128. + 0.439 * r - 0.368 * g - 0.071 * b);
+
+ return (y << 16) | (cr << 8) | cb;
+}
+
+static int mov_create_dvd_sub_decoder_specific_info(MOVTrack *track,
+ AVStream *st)
+{
+ int i, width = 720, height = 480;
+ int have_palette = 0, have_size = 0;
+ uint32_t palette[16];
+ char *cur = st->codec->extradata;
+
+ while (cur && *cur) {
+ if (strncmp("palette:", cur, 8) == 0) {
+ int i, count;
+ count = sscanf(cur + 8,
+ "%06"PRIx32", %06"PRIx32", %06"PRIx32", %06"PRIx32", "
+ "%06"PRIx32", %06"PRIx32", %06"PRIx32", %06"PRIx32", "
+ "%06"PRIx32", %06"PRIx32", %06"PRIx32", %06"PRIx32", "
+ "%06"PRIx32", %06"PRIx32", %06"PRIx32", %06"PRIx32"",
+ &palette[ 0], &palette[ 1], &palette[ 2], &palette[ 3],
+ &palette[ 4], &palette[ 5], &palette[ 6], &palette[ 7],
+ &palette[ 8], &palette[ 9], &palette[10], &palette[11],
+ &palette[12], &palette[13], &palette[14], &palette[15]);
+
+ for (i = 0; i < count; i++) {
+ palette[i] = rgb_to_yuv(palette[i]);
+ }
+ have_palette = 1;
+ } else if (!strncmp("size:", cur, 5)) {
+ sscanf(cur + 5, "%dx%d", &width, &height);
+ have_size = 1;
+ }
+ if (have_palette && have_size)
+ break;
+ cur += strcspn(cur, "\n\r");
+ cur += strspn(cur, "\n\r");
+ }
+ if (have_palette) {
+ track->vos_data = av_malloc(16*4);
+ if (!track->vos_data)
+ return AVERROR(ENOMEM);
+ for (i = 0; i < 16; i++) {
+ AV_WB32(track->vos_data + i * 4, palette[i]);
+ }
+ track->vos_len = 16 * 4;
+ }
+ st->codec->width = width;
+ st->codec->height = track->height = height;
+
+ return 0;
+}
+
static int mov_write_header(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
MOVMuxContext *mov = s->priv_data;
AVDictionaryEntry *t, *global_tcr = av_dict_get(s->metadata, "timecode", NULL, 0);
- int i, hint_track = 0, tmcd_track = 0;
+ int i, ret, hint_track = 0, tmcd_track = 0;
/* Default mode == MP4 */
mov->mode = MODE_MP4;
@@ -3720,6 +3871,10 @@ static int mov_write_header(AVFormatContext *s)
else if (!strcmp("f4v", s->oformat->name)) mov->mode = MODE_F4V;
}
+ for (i = 0; i < s->nb_streams; i++)
+ if (s->flags & AVFMT_FLAG_BITEXACT)
+ mov->exact = 1;
+
/* Set the FRAGMENT flag if any of the fragmentation methods are
* enabled. */
if (mov->max_fragment_duration || mov->max_fragment_size ||
@@ -3745,7 +3900,7 @@ static int mov_write_header(AVFormatContext *s)
}
if (!supports_edts(mov) && s->avoid_negative_ts < 0) {
- s->avoid_negative_ts = 1;
+ s->avoid_negative_ts = 2;
}
/* Non-seekable output is ok if using fragmentation. If ism_lookahead
@@ -3837,8 +3992,10 @@ static int mov_write_header(AVFormatContext *s)
track->mode = mov->mode;
track->tag = mov_find_codec_tag(s, track);
if (!track->tag) {
- av_log(s, AV_LOG_ERROR, "track %d: could not find tag, "
- "codec not currently supported in container\n", i);
+ av_log(s, AV_LOG_ERROR, "Could not find tag for codec %s in stream #%d, "
+ "codec not currently supported in container\n",
+ avcodec_get_name(st->codec->codec_id), i);
+ ret = AVERROR(EINVAL);
goto error;
}
/* If hinting of this track is enabled by a later hint track,
@@ -3851,6 +4008,7 @@ static int mov_write_header(AVFormatContext *s)
track->tag == MKTAG('m','x','5','p') || track->tag == MKTAG('m','x','5','n')) {
if (st->codec->width != 720 || (st->codec->height != 608 && st->codec->height != 512)) {
av_log(s, AV_LOG_ERROR, "D-10/IMX must use 720x608 or 720x512 video resolution\n");
+ ret = AVERROR(EINVAL);
goto error;
}
track->height = track->tag >> 24 == 'n' ? 486 : 576;
@@ -3877,6 +4035,7 @@ static int mov_write_header(AVFormatContext *s)
st->codec->codec_id == AV_CODEC_ID_ILBC){
if (!st->codec->block_align) {
av_log(s, AV_LOG_ERROR, "track %d: codec block align is not set for adpcm\n", i);
+ ret = AVERROR(EINVAL);
goto error;
}
track->sample_size = st->codec->block_align;
@@ -3893,6 +4052,7 @@ static int mov_write_header(AVFormatContext *s)
track->enc->codec_id == AV_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);
+ ret = AVERROR(EINVAL);
goto error;
}
} else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
@@ -3913,21 +4073,18 @@ static int mov_write_header(AVFormatContext *s)
/* copy extradata if it exists */
if (st->codec->extradata_size) {
- track->vos_len = st->codec->extradata_size;
- track->vos_data = av_malloc(track->vos_len);
- memcpy(track->vos_data, st->codec->extradata, track->vos_len);
+ if (st->codec->codec_id == AV_CODEC_ID_DVD_SUBTITLE)
+ mov_create_dvd_sub_decoder_specific_info(track, st);
+ else {
+ track->vos_len = st->codec->extradata_size;
+ track->vos_data = av_malloc(track->vos_len);
+ memcpy(track->vos_data, st->codec->extradata, track->vos_len);
+ }
}
}
enable_tracks(s);
- if (mov->mode == MODE_ISM) {
- /* If no fragmentation options have been set, set a default. */
- if (!(mov->flags & (FF_MOV_FLAG_FRAG_KEYFRAME |
- FF_MOV_FLAG_FRAG_CUSTOM)) &&
- !mov->max_fragment_duration && !mov->max_fragment_size)
- mov->flags |= FF_MOV_FLAG_FRAG_KEYFRAME;
- }
if (mov->reserved_moov_size){
mov->reserved_moov_pos= avio_tell(pb);
@@ -3935,7 +4092,13 @@ static int mov_write_header(AVFormatContext *s)
avio_skip(pb, mov->reserved_moov_size);
}
- if (!(mov->flags & FF_MOV_FLAG_FRAGMENT)) {
+ if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
+ /* If no fragmentation options have been set, set a default. */
+ if (!(mov->flags & (FF_MOV_FLAG_FRAG_KEYFRAME |
+ FF_MOV_FLAG_FRAG_CUSTOM)) &&
+ !mov->max_fragment_duration && !mov->max_fragment_size)
+ mov->flags |= FF_MOV_FLAG_FRAG_KEYFRAME;
+ } else {
if (mov->flags & FF_MOV_FLAG_FASTSTART)
mov->reserved_moov_pos = avio_tell(pb);
mov_write_mdat_tag(pb, mov);
@@ -3947,7 +4110,7 @@ static int mov_write_header(AVFormatContext *s)
mov->time += 0x7C25B080; // 1970 based -> 1904 based
if (mov->chapter_track)
- if (mov_create_chapter_track(s, mov->chapter_track) < 0)
+ if ((ret = mov_create_chapter_track(s, mov->chapter_track)) < 0)
goto error;
if (mov->flags & FF_MOV_FLAG_RTP_HINT) {
@@ -3956,7 +4119,7 @@ static int mov_write_header(AVFormatContext *s)
AVStream *st = s->streams[i];
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
- if (ff_mov_init_hinting(s, hint_track, i) < 0)
+ if ((ret = ff_mov_init_hinting(s, hint_track, i)) < 0)
goto error;
hint_track++;
}
@@ -3974,7 +4137,7 @@ static int mov_write_header(AVFormatContext *s)
t = av_dict_get(st->metadata, "timecode", NULL, 0);
if (!t)
continue;
- if (mov_create_timecode_track(s, tmcd_track, i, t->value) < 0)
+ if ((ret = mov_create_timecode_track(s, tmcd_track, i, t->value)) < 0)
goto error;
tmcd_track++;
}
@@ -3994,7 +4157,7 @@ static int mov_write_header(AVFormatContext *s)
return 0;
error:
mov_free(s);
- return -1;
+ return ret;
}
static int get_moov_size(AVFormatContext *s)
diff --git a/chromium/third_party/ffmpeg/libavformat/movenc.h b/chromium/third_party/ffmpeg/libavformat/movenc.h
index 09f3ea772c8..fce2d3c9329 100644
--- a/chromium/third_party/ffmpeg/libavformat/movenc.h
+++ b/chromium/third_party/ffmpeg/libavformat/movenc.h
@@ -156,6 +156,7 @@ typedef struct MOVMuxContext {
int flags;
int rtp_flags;
+ int exact;
int iods_skip;
int iods_video_profile;
@@ -173,6 +174,8 @@ typedef struct MOVMuxContext {
int reserved_moov_size; ///< 0 for disabled, -1 for automatic, size otherwise
int64_t reserved_moov_pos;
+
+ char *major_brand;
} MOVMuxContext;
#define FF_MOV_FLAG_RTP_HINT 1
diff --git a/chromium/third_party/ffmpeg/libavformat/mp3dec.c b/chromium/third_party/ffmpeg/libavformat/mp3dec.c
index 5d484e9090d..00142c5163c 100644
--- a/chromium/third_party/ffmpeg/libavformat/mp3dec.c
+++ b/chromium/third_party/ffmpeg/libavformat/mp3dec.c
@@ -22,12 +22,16 @@
#include "libavutil/opt.h"
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
+#include "libavutil/crc.h"
#include "libavutil/dict.h"
#include "libavutil/mathematics.h"
#include "avformat.h"
#include "internal.h"
+#include "avio_internal.h"
#include "id3v2.h"
#include "id3v1.h"
+#include "replaygain.h"
+
#include "libavcodec/mpegaudiodecheader.h"
#define XING_FLAG_FRAMES 0x01
@@ -39,11 +43,12 @@
typedef struct {
AVClass *class;
int64_t filesize;
- int64_t header_filesize;
int xing_toc;
int start_pad;
int end_pad;
int usetoc;
+ unsigned frames; /* Total number of frames in file */
+ unsigned header_filesize; /* Total number of bytes in the stream */
int is_cbr;
} MP3DecContext;
@@ -85,10 +90,10 @@ static int mp3_read_probe(AVProbeData *p)
// issues with MPEG-files!
if (first_frames>=4) return AVPROBE_SCORE_EXTENSION + 1;
else if(max_frames>200)return AVPROBE_SCORE_EXTENSION;
- else if(max_frames>=4) return AVPROBE_SCORE_EXTENSION / 2;
+ else if(max_frames>=4 && max_frames >= p->buf_size/10000) return AVPROBE_SCORE_EXTENSION / 2;
else if(ff_id3v2_match(buf0, ID3v2_DEFAULT_MAGIC) && 2*ff_id3v2_tag_len(buf0) >= p->buf_size)
return p->buf_size < PROBE_BUF_MAX ? AVPROBE_SCORE_EXTENSION / 4 : AVPROBE_SCORE_EXTENSION - 2;
- else if(max_frames>=1) return 1;
+ else if(max_frames>=1 && max_frames >= p->buf_size/10000) return 1;
else return 0;
//mpegps_mp3_unrecognized_format.mpg has max_frames=3
}
@@ -117,19 +122,149 @@ static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration
mp3->xing_toc = 1;
}
+static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st,
+ MPADecodeHeader *c, uint32_t spf)
+{
+#define LAST_BITS(k, n) ((k) & ((1 << (n)) - 1))
+#define MIDDLE_BITS(k, m, n) LAST_BITS((k) >> (m), ((n) - (m)))
+
+ uint16_t crc;
+ uint32_t v;
+
+ char version[10];
+
+ uint32_t peak = 0;
+ int32_t r_gain = INT32_MIN, a_gain = INT32_MIN;
+
+ MP3DecContext *mp3 = s->priv_data;
+ static const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}};
+
+ /* Check for Xing / Info tag */
+ avio_skip(s->pb, xing_offtbl[c->lsf == 1][c->nb_channels == 1]);
+ v = avio_rb32(s->pb);
+ mp3->is_cbr = v == MKBETAG('I', 'n', 'f', 'o');
+ if (v != MKBETAG('X', 'i', 'n', 'g') && !mp3->is_cbr)
+ return;
+
+ v = avio_rb32(s->pb);
+ if (v & XING_FLAG_FRAMES)
+ mp3->frames = avio_rb32(s->pb);
+ if (v & XING_FLAG_SIZE)
+ mp3->header_filesize = avio_rb32(s->pb);
+ if (v & XING_FLAG_TOC)
+ read_xing_toc(s, mp3->header_filesize, av_rescale_q(mp3->frames,
+ (AVRational){spf, c->sample_rate},
+ st->time_base));
+ /* VBR quality */
+ if(v & 8)
+ avio_skip(s->pb, 4);
+
+ /* Encoder short version string */
+ memset(version, 0, sizeof(version));
+ avio_read(s->pb, version, 9);
+
+ /* Info Tag revision + VBR method */
+ avio_r8(s->pb);
+
+ /* Lowpass filter value */
+ avio_r8(s->pb);
+
+ /* ReplayGain peak */
+ v = avio_rb32(s->pb);
+ peak = av_rescale(v, 100000, 1 << 23);
+
+ /* Radio ReplayGain */
+ v = avio_rb16(s->pb);
+
+ if (MIDDLE_BITS(v, 13, 15) == 1) {
+ r_gain = MIDDLE_BITS(v, 0, 8) * 10000;
+
+ if (v & (1 << 9))
+ r_gain *= -1;
+ }
+
+ /* Audiophile ReplayGain */
+ v = avio_rb16(s->pb);
+
+ if (MIDDLE_BITS(v, 13, 15) == 2) {
+ a_gain = MIDDLE_BITS(v, 0, 8) * 10000;
+
+ if (v & (1 << 9))
+ a_gain *= -1;
+ }
+
+ /* Encoding flags + ATH Type */
+ avio_r8(s->pb);
+
+ /* if ABR {specified bitrate} else {minimal bitrate} */
+ avio_r8(s->pb);
+
+ /* Encoder delays */
+ v= avio_rb24(s->pb);
+ if(AV_RB32(version) == MKBETAG('L', 'A', 'M', 'E')
+ || AV_RB32(version) == MKBETAG('L', 'a', 'v', 'f')) {
+
+ mp3->start_pad = v>>12;
+ mp3-> end_pad = v&4095;
+ st->skip_samples = mp3->start_pad + 528 + 1;
+ av_log(s, AV_LOG_DEBUG, "pad %d %d\n", mp3->start_pad, mp3-> end_pad);
+ }
+
+ /* Misc */
+ avio_r8(s->pb);
+
+ /* MP3 gain */
+ avio_r8(s->pb);
+
+ /* Preset and surround info */
+ avio_rb16(s->pb);
+
+ /* Music length */
+ avio_rb32(s->pb);
+
+ /* Music CRC */
+ avio_rb16(s->pb);
+
+ /* Info Tag CRC */
+ crc = ffio_get_checksum(s->pb);
+ v = avio_rb16(s->pb);
+
+ if (v == crc) {
+ ff_replaygain_export_raw(st, r_gain, peak, a_gain, 0);
+ av_dict_set(&st->metadata, "encoder", version, 0);
+ }
+}
+
+static void mp3_parse_vbri_tag(AVFormatContext *s, AVStream *st, int64_t base)
+{
+ uint32_t v;
+ MP3DecContext *mp3 = s->priv_data;
+
+ /* Check for VBRI tag (always 32 bytes after end of mpegaudio header) */
+ avio_seek(s->pb, base + 4 + 32, SEEK_SET);
+ v = avio_rb32(s->pb);
+ if (v == MKBETAG('V', 'B', 'R', 'I')) {
+ /* Check tag version */
+ if (avio_rb16(s->pb) == 1) {
+ /* skip delay and quality */
+ avio_skip(s->pb, 4);
+ mp3->header_filesize = avio_rb32(s->pb);
+ mp3->frames = avio_rb32(s->pb);
+ }
+ }
+}
+
/**
* Try to find Xing/Info/VBRI tags and compute duration from info therein
*/
static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
{
- MP3DecContext *mp3 = s->priv_data;
uint32_t v, spf;
- unsigned frames = 0; /* Total number of frames in file */
- unsigned size = 0; /* Total number of bytes in the stream */
- static const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}};
MPADecodeHeader c;
int vbrtag_size = 0;
- int is_cbr;
+ MP3DecContext *mp3 = s->priv_data;
+
+ ffio_init_checksum(s->pb, ff_crcA001_update, 0);
v = avio_rb32(s->pb);
if(ff_mpa_check_header(v) < 0)
@@ -142,60 +277,23 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
spf = c.lsf ? 576 : 1152; /* Samples per frame, layer 3 */
- /* Check for Xing / Info tag */
- avio_skip(s->pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1]);
- v = avio_rb32(s->pb);
- is_cbr = v == MKBETAG('I', 'n', 'f', 'o');
- if (v == MKBETAG('X', 'i', 'n', 'g') || is_cbr) {
- v = avio_rb32(s->pb);
- if(v & XING_FLAG_FRAMES)
- frames = avio_rb32(s->pb);
- if(v & XING_FLAG_SIZE)
- size = avio_rb32(s->pb);
- if (v & XING_FLAG_TOC)
- read_xing_toc(s, size, av_rescale_q(frames, (AVRational){spf, c.sample_rate},
- st->time_base));
- if(v & 8)
- avio_skip(s->pb, 4);
-
- v = avio_rb32(s->pb);
- if(v == MKBETAG('L', 'A', 'M', 'E') || v == MKBETAG('L', 'a', 'v', 'f')) {
- avio_skip(s->pb, 21-4);
- v= avio_rb24(s->pb);
- mp3->start_pad = v>>12;
- mp3-> end_pad = v&4095;
- st->skip_samples = mp3->start_pad + 528 + 1;
- av_log(s, AV_LOG_DEBUG, "pad %d %d\n", mp3->start_pad, mp3-> end_pad);
- }
- }
+ mp3->frames = 0;
+ mp3->header_filesize = 0;
- /* Check for VBRI tag (always 32 bytes after end of mpegaudio header) */
- avio_seek(s->pb, base + 4 + 32, SEEK_SET);
- v = avio_rb32(s->pb);
- if(v == MKBETAG('V', 'B', 'R', 'I')) {
- /* Check tag version */
- if(avio_rb16(s->pb) == 1) {
- /* skip delay and quality */
- avio_skip(s->pb, 4);
- size = avio_rb32(s->pb);
- frames = avio_rb32(s->pb);
- }
- }
+ mp3_parse_info_tag(s, st, &c, spf);
+ mp3_parse_vbri_tag(s, st, base);
- if(!frames && !size)
+ if (!mp3->frames && !mp3->header_filesize)
return -1;
/* Skip the vbr tag frame */
avio_seek(s->pb, base + vbrtag_size, SEEK_SET);
- if(frames)
- st->duration = av_rescale_q(frames, (AVRational){spf, c.sample_rate},
+ if (mp3->frames)
+ st->duration = av_rescale_q(mp3->frames, (AVRational){spf, c.sample_rate},
st->time_base);
- if (size && frames && !is_cbr)
- st->codec->bit_rate = av_rescale(size, 8 * c.sample_rate, frames * (int64_t)spf);
-
- mp3->is_cbr = is_cbr;
- mp3->header_filesize = size;
+ if (mp3->header_filesize && mp3->frames && !mp3->is_cbr)
+ st->codec->bit_rate = av_rescale(mp3->header_filesize, 8 * c.sample_rate, mp3->frames * (int64_t)spf);
return 0;
}
@@ -205,6 +303,7 @@ static int mp3_read_header(AVFormatContext *s)
MP3DecContext *mp3 = s->priv_data;
AVStream *st;
int64_t off;
+ int ret;
st = avformat_new_stream(s, NULL);
if (!st)
@@ -230,6 +329,10 @@ static int mp3_read_header(AVFormatContext *s)
if (mp3_parse_vbr_tags(s, st, off) < 0)
avio_seek(s->pb, off, SEEK_SET);
+ ret = ff_replaygain_export(st, s->metadata);
+ if (ret < 0)
+ return ret;
+
/* the parameters will be extracted from the compressed bitstream */
return 0;
}
@@ -314,6 +417,8 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
return -1;
}
+ if (dir < 0)
+ avio_seek(s->pb, FFMAX(ie->pos - 4096, 0), SEEK_SET);
ret = avio_seek(s->pb, ie->pos, SEEK_SET);
if (ret < 0)
return ret;
diff --git a/chromium/third_party/ffmpeg/libavformat/mp3enc.c b/chromium/third_party/ffmpeg/libavformat/mp3enc.c
index a5f672b2577..9c9bd5e8626 100644
--- a/chromium/third_party/ffmpeg/libavformat/mp3enc.c
+++ b/chromium/third_party/ffmpeg/libavformat/mp3enc.c
@@ -85,6 +85,7 @@ typedef struct MP3Context {
ID3v2EncContext id3;
int id3v2_version;
int write_id3v1;
+ int write_xing;
/* xing header */
int64_t xing_offset;
@@ -115,17 +116,18 @@ static int mp3_write_xing(AVFormatContext *s)
{
MP3Context *mp3 = s->priv_data;
AVCodecContext *codec = s->streams[mp3->audio_stream_idx]->codec;
- int bitrate_idx;
- int best_bitrate_idx = -1;
- int best_bitrate_error= INT_MAX;
- int xing_offset;
- int32_t header, mask;
- MPADecodeHeader c;
- int srate_idx, ver = 0, i, channels;
- int needed;
- const char *vendor = (codec->flags & CODEC_FLAG_BITEXACT) ? "Lavf" : LIBAVFORMAT_IDENT;
-
- if (!s->pb->seekable)
+ int32_t header;
+ MPADecodeHeader mpah;
+ int srate_idx, i, channels;
+ int bitrate_idx;
+ int best_bitrate_idx = -1;
+ int best_bitrate_error = INT_MAX;
+ int xing_offset;
+ int ver = 0;
+ int bytes_needed;
+ const char *vendor = (codec->flags & CODEC_FLAG_BITEXACT) ? "Lavf" : LIBAVFORMAT_IDENT;
+
+ if (!s->pb->seekable || !mp3->write_xing)
return 0;
for (i = 0; i < FF_ARRAY_ELEMS(avpriv_mpa_freq_tab); i++) {
@@ -155,28 +157,29 @@ static int mp3_write_xing(AVFormatContext *s)
/* dummy MPEG audio header */
header = 0xffU << 24; // sync
header |= (0x7 << 5 | ver << 3 | 0x1 << 1 | 0x1) << 16; // sync/audio-version/layer 3/no crc*/
- header |= (srate_idx << 2) << 8;
+ header |= (srate_idx << 2) << 8;
header |= channels << 6;
- for (bitrate_idx=1; bitrate_idx<15; bitrate_idx++) {
- int error;
- avpriv_mpegaudio_decode_header(&c, header | (bitrate_idx << (4+8)));
- error= FFABS(c.bit_rate - codec->bit_rate);
- if(error < best_bitrate_error){
- best_bitrate_error= error;
- best_bitrate_idx = bitrate_idx;
+ for (bitrate_idx = 1; bitrate_idx < 15; bitrate_idx++) {
+ int bit_rate = 1000 * avpriv_mpa_bitrate_tab[ver != 3][3 - 1][bitrate_idx];
+ int error = FFABS(bit_rate - codec->bit_rate);
+
+ if (error < best_bitrate_error) {
+ best_bitrate_error = error;
+ best_bitrate_idx = bitrate_idx;
}
}
av_assert0(best_bitrate_idx >= 0);
- for (bitrate_idx= best_bitrate_idx;; bitrate_idx++) {
+ for (bitrate_idx = best_bitrate_idx; ; bitrate_idx++) {
+ int32_t mask = bitrate_idx << (4 + 8);
if (15 == bitrate_idx)
return -1;
- mask = bitrate_idx << (4+8);
header |= mask;
- avpriv_mpegaudio_decode_header(&c, header);
- xing_offset=xing_offtbl[c.lsf == 1][c.nb_channels == 1];
- needed = 4 // header
+
+ avpriv_mpegaudio_decode_header(&mpah, header);
+ xing_offset=xing_offtbl[mpah.lsf == 1][mpah.nb_channels == 1];
+ bytes_needed = 4 // header
+ xing_offset
+ 4 // xing tag
+ 4 // frames/size/toc flags
@@ -186,8 +189,9 @@ static int mp3_write_xing(AVFormatContext *s)
+ 24
;
- if (needed <= c.frame_size)
+ if (bytes_needed <= mpah.frame_size)
break;
+
header &= ~mask;
}
@@ -198,7 +202,7 @@ static int mp3_write_xing(AVFormatContext *s)
ffio_wfourcc(s->pb, "Xing");
avio_wb32(s->pb, 0x01 | 0x02 | 0x04); // frames / size / TOC
- mp3->size = c.frame_size;
+ mp3->size = mpah.frame_size;
mp3->want=1;
mp3->seen=0;
mp3->pos=0;
@@ -216,7 +220,7 @@ static int mp3_write_xing(AVFormatContext *s)
avio_w8(s->pb, 0);
avio_wb24(s->pb, FFMAX(codec->delay - 528 - 1, 0)<<12);
- ffio_fill(s->pb, 0, c.frame_size - needed);
+ ffio_fill(s->pb, 0, mpah.frame_size - bytes_needed);
return 0;
}
@@ -256,7 +260,7 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)
MP3Context *mp3 = s->priv_data;
if (pkt->data && pkt->size >= 4) {
- MPADecodeHeader c;
+ MPADecodeHeader mpah;
int av_unused base;
uint32_t head = AV_RB32(pkt->data);
@@ -265,16 +269,16 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)
"is invalid, writing it anyway.\n", pkt->size, head);
return ff_raw_write_packet(s, pkt);
}
- avpriv_mpegaudio_decode_header(&c, head);
+ avpriv_mpegaudio_decode_header(&mpah, head);
if (!mp3->initial_bitrate)
- mp3->initial_bitrate = c.bit_rate;
- if ((c.bit_rate == 0) || (mp3->initial_bitrate != c.bit_rate))
+ mp3->initial_bitrate = mpah.bit_rate;
+ if ((mpah.bit_rate == 0) || (mp3->initial_bitrate != mpah.bit_rate))
mp3->has_variable_bitrate = 1;
#ifdef FILTER_VBR_HEADERS
/* filter out XING and INFO headers. */
- base = 4 + xing_offtbl[c.lsf == 1][c.nb_channels == 1];
+ base = 4 + xing_offtbl[mpah.lsf == 1][mpah.nb_channels == 1];
if (base + 4 <= pkt->size) {
uint32_t v = AV_RB32(pkt->data + base);
@@ -303,7 +307,7 @@ static int mp3_queue_flush(AVFormatContext *s)
AVPacketList *pktl;
int ret = 0, write = 1;
- ff_id3v2_finish(&mp3->id3, s->pb);
+ ff_id3v2_finish(&mp3->id3, s->pb, s->metadata_header_padding);
mp3_write_xing(s);
while ((pktl = mp3->queue)) {
@@ -393,9 +397,11 @@ AVOutputFormat ff_mp2_muxer = {
static const AVOption options[] = {
{ "id3v2_version", "Select ID3v2 version to write. Currently 3 and 4 are supported.",
- offsetof(MP3Context, id3v2_version), AV_OPT_TYPE_INT, {.i64 = 4}, 3, 4, AV_OPT_FLAG_ENCODING_PARAM},
+ offsetof(MP3Context, id3v2_version), AV_OPT_TYPE_INT, {.i64 = 4}, 0, 4, AV_OPT_FLAG_ENCODING_PARAM},
{ "write_id3v1", "Enable ID3v1 writing. ID3v1 tags are written in UTF-8 which may not be supported by most software.",
offsetof(MP3Context, write_id3v1), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
+ { "write_xing", "Write the Xing header containing file duration.",
+ offsetof(MP3Context, write_xing), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL },
};
@@ -414,14 +420,14 @@ static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
if (mp3->pics_to_write) {
/* buffer audio packets until we get all the pictures */
AVPacketList *pktl = av_mallocz(sizeof(*pktl));
+ int ret;
if (!pktl)
return AVERROR(ENOMEM);
- pktl->pkt = *pkt;
- pktl->pkt.buf = av_buffer_ref(pkt->buf);
- if (!pktl->pkt.buf) {
+ ret = av_copy_packet(&pktl->pkt, pkt);
+ if (ret < 0) {
av_freep(&pktl);
- return AVERROR(ENOMEM);
+ return ret;
}
if (mp3->queue_end)
@@ -464,6 +470,14 @@ static int mp3_write_header(struct AVFormatContext *s)
MP3Context *mp3 = s->priv_data;
int ret, i;
+ if (mp3->id3v2_version &&
+ mp3->id3v2_version != 3 &&
+ mp3->id3v2_version != 4) {
+ av_log(s, AV_LOG_ERROR, "Invalid ID3v2 version requested: %d. Only "
+ "3, 4 or 0 (disabled) are allowed.\n", mp3->id3v2_version);
+ return AVERROR(EINVAL);
+ }
+
/* check the streams -- we want exactly one audio and arbitrary number of
* video (attached pictures) */
mp3->audio_stream_idx = -1;
@@ -487,13 +501,22 @@ static int mp3_write_header(struct AVFormatContext *s)
}
mp3->pics_to_write = s->nb_streams - 1;
- ff_id3v2_start(&mp3->id3, s->pb, mp3->id3v2_version, ID3v2_DEFAULT_MAGIC);
- ret = ff_id3v2_write_metadata(s, &mp3->id3);
- if (ret < 0)
- return ret;
+ if (mp3->pics_to_write && !mp3->id3v2_version) {
+ av_log(s, AV_LOG_ERROR, "Attached pictures were requested, but the "
+ "ID3v2 header is disabled.\n");
+ return AVERROR(EINVAL);
+ }
+
+ if (mp3->id3v2_version) {
+ ff_id3v2_start(&mp3->id3, s->pb, mp3->id3v2_version, ID3v2_DEFAULT_MAGIC);
+ ret = ff_id3v2_write_metadata(s, &mp3->id3);
+ if (ret < 0)
+ return ret;
+ }
if (!mp3->pics_to_write) {
- ff_id3v2_finish(&mp3->id3, s->pb);
+ if (mp3->id3v2_version)
+ ff_id3v2_finish(&mp3->id3, s->pb, s->metadata_header_padding);
mp3_write_xing(s);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/mpc.c b/chromium/third_party/ffmpeg/libavformat/mpc.c
index 8abc4885536..c3faebe6c07 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpc.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpc.c
@@ -95,9 +95,8 @@ static int mpc_read_header(AVFormatContext *s)
st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
st->codec->bits_per_coded_sample = 16;
- if (ff_alloc_extradata(st->codec, 16))
+ if (ff_get_extradata(st->codec, s->pb, 16) < 0)
return AVERROR(ENOMEM);
- avio_read(s->pb, st->codec->extradata, 16);
st->codec->sample_rate = mpc_rate[st->codec->extradata[2] & 3];
avpriv_set_pts_info(st, 32, MPC_FRAMESIZE, st->codec->sample_rate);
/* scan for seekpoints */
diff --git a/chromium/third_party/ffmpeg/libavformat/mpc8.c b/chromium/third_party/ffmpeg/libavformat/mpc8.c
index 7017c187f77..b32bc9c3546 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpc8.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpc8.c
@@ -136,7 +136,7 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
int tag;
int64_t size, pos, ppos[2];
uint8_t *buf;
- int i, t, seekd;
+ int i, t, seekd, ret;
GetBitContext gb;
if (s->nb_streams == 0) {
@@ -156,7 +156,14 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
}
if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
return;
- avio_read(s->pb, buf, size);
+ ret = avio_read(s->pb, buf, size);
+ if (ret != size) {
+ av_log(s, AV_LOG_ERROR, "seek table truncated\n");
+ av_free(buf);
+ return;
+ }
+ memset(buf+size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+
init_get_bits(&gb, buf, size * 8);
size = gb_get_v(&gb);
if(size > UINT_MAX/4 || size > c->samples/1152){
@@ -241,9 +248,8 @@ static int mpc8_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_MUSEPACK8;
st->codec->bits_per_coded_sample = 16;
- if (ff_alloc_extradata(st->codec, 2))
+ if (ff_get_extradata(st->codec, pb, 2) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, st->codec->extradata, st->codec->extradata_size);
st->codec->channels = (st->codec->extradata[1] >> 4) + 1;
st->codec->sample_rate = mpc8_rate[st->codec->extradata[0] >> 5];
diff --git a/chromium/third_party/ffmpeg/libavformat/mpeg.c b/chromium/third_party/ffmpeg/libavformat/mpeg.c
index 1777283939c..d70a5ab9beb 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpeg.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpeg.c
@@ -37,74 +37,85 @@
#define MAX_SYNC_SIZE 100000
-static int check_pes(const uint8_t *p, const uint8_t *end){
+static int check_pes(const uint8_t *p, const uint8_t *end)
+{
int pes1;
- int pes2= (p[3] & 0xC0) == 0x80
- && (p[4] & 0xC0) != 0x40
- &&((p[4] & 0xC0) == 0x00 || (p[4]&0xC0)>>2 == (p[6]&0xF0));
-
- for(p+=3; p<end && *p == 0xFF; p++);
- if((*p&0xC0) == 0x40) p+=2;
- if((*p&0xF0) == 0x20){
- pes1= p[0]&p[2]&p[4]&1;
- }else if((*p&0xF0) == 0x30){
- pes1= p[0]&p[2]&p[4]&p[5]&p[7]&p[9]&1;
- }else
+ int pes2 = (p[3] & 0xC0) == 0x80 &&
+ (p[4] & 0xC0) != 0x40 &&
+ ((p[4] & 0xC0) == 0x00 ||
+ (p[4] & 0xC0) >> 2 == (p[6] & 0xF0));
+
+ for (p += 3; p < end && *p == 0xFF; p++) ;
+ if ((*p & 0xC0) == 0x40)
+ p += 2;
+
+ if ((*p & 0xF0) == 0x20)
+ pes1 = p[0] & p[2] & p[4] & 1;
+ else if ((*p & 0xF0) == 0x30)
+ pes1 = p[0] & p[2] & p[4] & p[5] & p[7] & p[9] & 1;
+ else
pes1 = *p == 0x0F;
- return pes1||pes2;
+ return pes1 || pes2;
}
-static int check_pack_header(const uint8_t *buf) {
+static int check_pack_header(const uint8_t *buf)
+{
return (buf[1] & 0xC0) == 0x40 || (buf[1] & 0xF0) == 0x20;
}
static int mpegps_probe(AVProbeData *p)
{
- uint32_t code= -1;
- int sys=0, pspack=0, priv1=0, vid=0, audio=0, invalid=0;
+ uint32_t code = -1;
int i;
- int score=0;
+ int sys = 0, pspack = 0, priv1 = 0, vid = 0;
+ int audio = 0, invalid = 0, score = 0;
- for(i=0; i<p->buf_size; i++){
- code = (code<<8) + p->buf[i];
+ for (i = 0; i < p->buf_size; i++) {
+ code = (code << 8) + p->buf[i];
if ((code & 0xffffff00) == 0x100) {
- int len= p->buf[i+1] << 8 | p->buf[i+2];
- int pes= check_pes(p->buf+i, p->buf+p->buf_size);
- int pack = check_pack_header(p->buf+i);
-
- if(code == SYSTEM_HEADER_START_CODE) sys++;
- else if(code == PACK_START_CODE && pack) pspack++;
- else if((code & 0xf0) == VIDEO_ID && pes) vid++;
+ int len = p->buf[i + 1] << 8 | p->buf[i + 2];
+ int pes = check_pes(p->buf + i, p->buf + p->buf_size);
+ int pack = check_pack_header(p->buf + i);
+
+ if (code == SYSTEM_HEADER_START_CODE)
+ sys++;
+ else if (code == PACK_START_CODE && pack)
+ pspack++;
+ else if ((code & 0xf0) == VIDEO_ID && pes)
+ vid++;
// skip pes payload to avoid start code emulation for private
// and audio streams
- else if((code & 0xe0) == AUDIO_ID && pes) {audio++; i+=len;}
- else if(code == PRIVATE_STREAM_1 && pes) {priv1++; i+=len;}
- else if(code == 0x1fd && pes) vid++; //VC1
+ else if ((code & 0xe0) == AUDIO_ID && pes) {audio++; i+=len;}
+ else if (code == PRIVATE_STREAM_1 && pes) {priv1++; i+=len;}
+ else if (code == 0x1fd && pes) vid++; //VC1
- else if((code & 0xf0) == VIDEO_ID && !pes) invalid++;
- else if((code & 0xe0) == AUDIO_ID && !pes) invalid++;
- else if(code == PRIVATE_STREAM_1 && !pes) invalid++;
+ else if ((code & 0xf0) == VIDEO_ID && !pes) invalid++;
+ else if ((code & 0xe0) == AUDIO_ID && !pes) invalid++;
+ else if (code == PRIVATE_STREAM_1 && !pes) invalid++;
}
}
- if(vid+audio > invalid+1) /* invalid VDR files nd short PES streams */
+ if (vid + audio > invalid + 1) /* invalid VDR files nd short PES streams */
score = AVPROBE_SCORE_EXTENSION / 2;
- if(sys>invalid && sys*9 <= pspack*10)
- return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg
- if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9)
- return pspack > 2 ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg
- if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048 && vid + audio > invalid) /* PES stream */
- return (audio > 12 || vid > 3 + 2*invalid) ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2;
-
- //02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1
- //mp3_misidentified_2.mp3 has sys:0 priv1:0 pspack:0 vid:0 audio:6
- //Have\ Yourself\ a\ Merry\ Little\ Christmas.mp3 0 0 0 5 0 1 len:21618
+ if (sys > invalid && sys * 9 <= pspack * 10)
+ return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_EXTENSION + 2
+ : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg
+ if (pspack > invalid && (priv1 + vid + audio) * 10 >= pspack * 9)
+ return pspack > 2 ? AVPROBE_SCORE_EXTENSION + 2
+ : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg
+ if ((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys &&
+ !pspack && p->buf_size > 2048 && vid + audio > invalid) /* PES stream */
+ return (audio > 12 || vid > 3 + 2 * invalid) ? AVPROBE_SCORE_EXTENSION + 2
+ : AVPROBE_SCORE_EXTENSION / 2;
+
+ // 02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1
+ // mp3_misidentified_2.mp3 has sys:0 priv1:0 pspack:0 vid:0 audio:6
+ // Have\ Yourself\ a\ Merry\ Little\ Christmas.mp3 0 0 0 5 0 1 len:21618
return score;
}
-
typedef struct MpegDemuxContext {
int32_t header_state;
unsigned char psm_es_type[256];
@@ -124,7 +135,7 @@ static int mpegps_read_header(AVFormatContext *s)
int64_t last_pos = avio_tell(s->pb);
m->header_state = 0xff;
- s->ctx_flags |= AVFMTCTX_NOHEADER;
+ s->ctx_flags |= AVFMTCTX_NOHEADER;
avio_get_str(s->pb, 6, buffer, sizeof(buffer));
if (!memcmp("IMKH", buffer, 4)) {
@@ -142,8 +153,8 @@ static int64_t get_pts(AVIOContext *pb, int c)
{
uint8_t buf[5];
- buf[0] = c<0 ? avio_r8(pb) : c;
- avio_read(pb, buf+1, 4);
+ buf[0] = c < 0 ? avio_r8(pb) : c;
+ avio_read(pb, buf + 1, 4);
return ff_parse_pes_pts(buf);
}
@@ -155,7 +166,7 @@ static int find_next_start_code(AVIOContext *pb, int *size_ptr,
int val, n;
state = *header_state;
- n = *size_ptr;
+ n = *size_ptr;
while (n > 0) {
if (url_feof(pb))
break;
@@ -163,15 +174,16 @@ static int find_next_start_code(AVIOContext *pb, int *size_ptr,
n--;
if (state == 0x000001) {
state = ((state << 8) | v) & 0xffffff;
- val = state;
+ val = state;
goto found;
}
state = ((state << 8) | v) & 0xffffff;
}
val = -1;
- found:
+
+found:
*header_state = state;
- *size_ptr = n;
+ *size_ptr = n;
return val;
}
@@ -197,10 +209,11 @@ static long mpegps_psm_parse(MpegDemuxContext *m, AVIOContext *pb)
es_map_length = psm_length - ps_info_length - 10;
/* at least one es available? */
- while (es_map_length >= 4){
+ while (es_map_length >= 4) {
unsigned char type = avio_r8(pb);
unsigned char es_id = avio_r8(pb);
uint16_t es_info_length = avio_rb16(pb);
+
/* remember mapping from stream id to stream type */
m->psm_es_type[es_id] = type;
/* skip program_stream_info */
@@ -212,7 +225,7 @@ static long mpegps_psm_parse(MpegDemuxContext *m, AVIOContext *pb)
}
/* read the next PES header. Return its position in ppos
- (if not NULL), and its start code, pts and dts.
+ * (if not NULL), and its start code, pts and dts.
*/
static int mpegps_read_pes_header(AVFormatContext *s,
int64_t *ppos, int *pstart_code,
@@ -222,20 +235,20 @@ static int mpegps_read_pes_header(AVFormatContext *s,
int len, size, startcode, c, flags, header_len;
int pes_ext, ext2_len, id_ext, skip;
int64_t pts, dts;
- int64_t last_sync= avio_tell(s->pb);
-
- error_redo:
- avio_seek(s->pb, last_sync, SEEK_SET);
- redo:
- /* next start code (should be immediately after) */
- m->header_state = 0xff;
- size = MAX_SYNC_SIZE;
- startcode = find_next_start_code(s->pb, &size, &m->header_state);
- last_sync = avio_tell(s->pb);
- if (startcode < 0){
- if(url_feof(s->pb))
+ int64_t last_sync = avio_tell(s->pb);
+
+error_redo:
+ avio_seek(s->pb, last_sync, SEEK_SET);
+redo:
+ /* next start code (should be immediately after) */
+ m->header_state = 0xff;
+ size = MAX_SYNC_SIZE;
+ startcode = find_next_start_code(s->pb, &size, &m->header_state);
+ last_sync = avio_tell(s->pb);
+ if (startcode < 0) {
+ if (url_feof(s->pb))
return AVERROR_EOF;
- //FIXME we should remember header_state
+ // FIXME we should remember header_state
return AVERROR(EAGAIN);
}
@@ -346,7 +359,7 @@ static int mpegps_read_pes_header(AVFormatContext *s,
if (startcode != PRIVATE_STREAM_2)
{
/* stuffing */
- for(;;) {
+ for (;;) {
if (len < 1)
goto error_redo;
c = avio_r8(s->pb);
@@ -358,45 +371,47 @@ static int mpegps_read_pes_header(AVFormatContext *s,
if ((c & 0xc0) == 0x40) {
/* buffer scale & size */
avio_r8(s->pb);
- c = avio_r8(s->pb);
+ c = avio_r8(s->pb);
len -= 2;
}
if ((c & 0xe0) == 0x20) {
- dts = pts = get_pts(s->pb, c);
+ dts =
+ pts = get_pts(s->pb, c);
len -= 4;
- if (c & 0x10){
- dts = get_pts(s->pb, -1);
+ if (c & 0x10) {
+ dts = get_pts(s->pb, -1);
len -= 5;
}
} else if ((c & 0xc0) == 0x80) {
/* mpeg 2 PES */
- flags = avio_r8(s->pb);
+ flags = avio_r8(s->pb);
header_len = avio_r8(s->pb);
- len -= 2;
+ len -= 2;
if (header_len > len)
goto error_redo;
len -= header_len;
if (flags & 0x80) {
- dts = pts = get_pts(s->pb, -1);
+ dts = pts = get_pts(s->pb, -1);
header_len -= 5;
if (flags & 0x40) {
- dts = get_pts(s->pb, -1);
+ dts = get_pts(s->pb, -1);
header_len -= 5;
}
}
- if (flags & 0x3f && header_len == 0){
+ if (flags & 0x3f && header_len == 0) {
flags &= 0xC0;
av_log(s, AV_LOG_WARNING, "Further flags set but no bytes left\n");
}
if (flags & 0x01) { /* PES extension */
pes_ext = avio_r8(s->pb);
header_len--;
- /* Skip PES private data, program packet sequence counter and P-STD buffer */
- skip = (pes_ext >> 4) & 0xb;
+ /* Skip PES private data, program packet sequence counter
+ * and P-STD buffer */
+ skip = (pes_ext >> 4) & 0xb;
skip += skip & 0x9;
- if (pes_ext & 0x40 || skip > header_len){
+ if (pes_ext & 0x40 || skip > header_len) {
av_log(s, AV_LOG_WARNING, "pes_ext %X is invalid\n", pes_ext);
- pes_ext=skip=0;
+ pes_ext = skip = 0;
}
avio_skip(s->pb, skip);
header_len -= skip;
@@ -412,11 +427,10 @@ static int mpegps_read_pes_header(AVFormatContext *s,
}
}
}
- if(header_len < 0)
+ if (header_len < 0)
goto error_redo;
avio_skip(s->pb, header_len);
- }
- else if( c!= 0xf )
+ } else if (c != 0xf)
goto redo;
}
@@ -424,22 +438,23 @@ static int mpegps_read_pes_header(AVFormatContext *s,
startcode = avio_r8(s->pb);
len--;
}
- if(len<0)
+ if (len < 0)
goto error_redo;
- if(dts != AV_NOPTS_VALUE && ppos){
+ if (dts != AV_NOPTS_VALUE && ppos) {
int i;
- for(i=0; i<s->nb_streams; i++){
- if(startcode == s->streams[i]->id &&
- s->pb->seekable /* index useless on streams anyway */) {
+ for (i = 0; i < s->nb_streams; i++) {
+ if (startcode == s->streams[i]->id &&
+ s->pb->seekable /* index useless on streams anyway */) {
ff_reduce_index(s, i);
- av_add_index_entry(s->streams[i], *ppos, dts, 0, 0, AVINDEX_KEYFRAME /* FIXME keyframe? */);
+ av_add_index_entry(s->streams[i], *ppos, dts, 0, 0,
+ AVINDEX_KEYFRAME /* FIXME keyframe? */);
}
}
}
*pstart_code = startcode;
- *ppts = pts;
- *pdts = dts;
+ *ppts = pts;
+ *pdts = dts;
return len;
}
@@ -453,15 +468,15 @@ static int mpegps_read_packet(AVFormatContext *s,
int request_probe= 0;
enum AVCodecID codec_id = AV_CODEC_ID_NONE;
enum AVMediaType type;
- int64_t pts, dts, dummy_pos; //dummy_pos is needed for the index building to work
+ int64_t pts, dts, dummy_pos; // dummy_pos is needed for the index building to work
- redo:
+redo:
len = mpegps_read_pes_header(s, &dummy_pos, &startcode, &pts, &dts);
if (len < 0)
return len;
if (startcode >= 0x80 && startcode <= 0xcf) {
- if(len < 4)
+ if (len < 4)
goto skip;
/* audio: skip header */
@@ -476,44 +491,45 @@ static int mpegps_read_packet(AVFormatContext *s,
}
/* now find stream */
- for(i=0;i<s->nb_streams;i++) {
+ for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
if (st->id == startcode)
goto found;
}
es_type = m->psm_es_type[startcode & 0xff];
- if(es_type == STREAM_TYPE_VIDEO_MPEG1){
+ if (es_type == STREAM_TYPE_VIDEO_MPEG1) {
codec_id = AV_CODEC_ID_MPEG2VIDEO;
- type = AVMEDIA_TYPE_VIDEO;
- } else if(es_type == STREAM_TYPE_VIDEO_MPEG2){
+ type = AVMEDIA_TYPE_VIDEO;
+ } else if (es_type == STREAM_TYPE_VIDEO_MPEG2) {
codec_id = AV_CODEC_ID_MPEG2VIDEO;
- type = AVMEDIA_TYPE_VIDEO;
- } else if(es_type == STREAM_TYPE_AUDIO_MPEG1 ||
- es_type == STREAM_TYPE_AUDIO_MPEG2){
+ type = AVMEDIA_TYPE_VIDEO;
+ } else if (es_type == STREAM_TYPE_AUDIO_MPEG1 ||
+ es_type == STREAM_TYPE_AUDIO_MPEG2) {
codec_id = AV_CODEC_ID_MP3;
- type = AVMEDIA_TYPE_AUDIO;
- } else if(es_type == STREAM_TYPE_AUDIO_AAC){
+ type = AVMEDIA_TYPE_AUDIO;
+ } else if (es_type == STREAM_TYPE_AUDIO_AAC) {
codec_id = AV_CODEC_ID_AAC;
- type = AVMEDIA_TYPE_AUDIO;
- } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){
+ type = AVMEDIA_TYPE_AUDIO;
+ } else if (es_type == STREAM_TYPE_VIDEO_MPEG4) {
codec_id = AV_CODEC_ID_MPEG4;
- type = AVMEDIA_TYPE_VIDEO;
- } else if(es_type == STREAM_TYPE_VIDEO_H264){
+ type = AVMEDIA_TYPE_VIDEO;
+ } else if (es_type == STREAM_TYPE_VIDEO_H264) {
codec_id = AV_CODEC_ID_H264;
- type = AVMEDIA_TYPE_VIDEO;
- } else if(es_type == STREAM_TYPE_AUDIO_AC3){
+ type = AVMEDIA_TYPE_VIDEO;
+ } else if (es_type == STREAM_TYPE_AUDIO_AC3) {
codec_id = AV_CODEC_ID_AC3;
- type = AVMEDIA_TYPE_AUDIO;
- } else if(m->imkh_cctv && es_type == 0x91){
+ type = AVMEDIA_TYPE_AUDIO;
+ } else if (m->imkh_cctv && es_type == 0x91) {
codec_id = AV_CODEC_ID_PCM_MULAW;
- type = AVMEDIA_TYPE_AUDIO;
+ type = AVMEDIA_TYPE_AUDIO;
} else if (startcode >= 0x1e0 && startcode <= 0x1ef) {
static const unsigned char avs_seqh[4] = { 0, 0, 1, 0xb0 };
unsigned char buf[8];
+
avio_read(s->pb, buf, 8);
avio_seek(s->pb, -8, SEEK_CUR);
- if(!memcmp(buf, avs_seqh, 4) && (buf[6] != 0 || buf[7] != 1))
+ if (!memcmp(buf, avs_seqh, 4) && (buf[6] != 0 || buf[7] != 1))
codec_id = AV_CODEC_ID_CAVS;
else
request_probe= 1;
@@ -522,7 +538,7 @@ static int mpegps_read_packet(AVFormatContext *s,
type = AVMEDIA_TYPE_DATA;
codec_id = AV_CODEC_ID_DVD_NAV;
} else if (startcode >= 0x1c0 && startcode <= 0x1df) {
- type = AVMEDIA_TYPE_AUDIO;
+ type = AVMEDIA_TYPE_AUDIO;
if (m->sofdec > 0) {
codec_id = AV_CODEC_ID_ADPCM_ADX;
// Auto-detect AC-3
@@ -531,35 +547,35 @@ static int mpegps_read_packet(AVFormatContext *s,
codec_id = AV_CODEC_ID_MP2;
}
} else if (startcode >= 0x80 && startcode <= 0x87) {
- type = AVMEDIA_TYPE_AUDIO;
+ type = AVMEDIA_TYPE_AUDIO;
codec_id = AV_CODEC_ID_AC3;
- } else if ( ( startcode >= 0x88 && startcode <= 0x8f)
- ||( startcode >= 0x98 && startcode <= 0x9f)) {
+ } else if ((startcode >= 0x88 && startcode <= 0x8f) ||
+ (startcode >= 0x98 && startcode <= 0x9f)) {
/* 0x90 - 0x97 is reserved for SDDS in DVD specs */
- type = AVMEDIA_TYPE_AUDIO;
+ type = AVMEDIA_TYPE_AUDIO;
codec_id = AV_CODEC_ID_DTS;
} else if (startcode >= 0xa0 && startcode <= 0xaf) {
- type = AVMEDIA_TYPE_AUDIO;
- if(lpcm_header_len == 6) {
+ type = AVMEDIA_TYPE_AUDIO;
+ if (lpcm_header_len == 6) {
codec_id = AV_CODEC_ID_MLP;
} else {
codec_id = AV_CODEC_ID_PCM_DVD;
}
} else if (startcode >= 0xb0 && startcode <= 0xbf) {
- type = AVMEDIA_TYPE_AUDIO;
+ type = AVMEDIA_TYPE_AUDIO;
codec_id = AV_CODEC_ID_TRUEHD;
} else if (startcode >= 0xc0 && startcode <= 0xcf) {
/* Used for both AC-3 and E-AC-3 in EVOB files */
- type = AVMEDIA_TYPE_AUDIO;
+ type = AVMEDIA_TYPE_AUDIO;
codec_id = AV_CODEC_ID_AC3;
} else if (startcode >= 0x20 && startcode <= 0x3f) {
- type = AVMEDIA_TYPE_SUBTITLE;
+ type = AVMEDIA_TYPE_SUBTITLE;
codec_id = AV_CODEC_ID_DVD_SUBTITLE;
} else if (startcode >= 0xfd55 && startcode <= 0xfd5f) {
- type = AVMEDIA_TYPE_VIDEO;
+ type = AVMEDIA_TYPE_VIDEO;
codec_id = AV_CODEC_ID_VC1;
} else {
- skip:
+skip:
/* skip packet */
avio_skip(s->pb, len);
goto redo;
@@ -568,18 +584,19 @@ static int mpegps_read_packet(AVFormatContext *s,
st = avformat_new_stream(s, NULL);
if (!st)
goto skip;
- st->id = startcode;
+ st->id = startcode;
st->codec->codec_type = type;
- st->codec->codec_id = codec_id;
+ st->codec->codec_id = codec_id;
if (st->codec->codec_id == AV_CODEC_ID_PCM_MULAW) {
st->codec->channels = 1;
st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = 8000;
}
st->request_probe = request_probe;
- st->need_parsing = AVSTREAM_PARSE_FULL;
- found:
- if(st->discard >= AVDISCARD_ALL)
+ st->need_parsing = AVSTREAM_PARSE_FULL;
+
+found:
+ if (st->discard >= AVDISCARD_ALL)
goto skip;
if (startcode >= 0xa0 && startcode <= 0xaf) {
if (lpcm_header_len == 6 && st->codec->codec_id == AV_CODEC_ID_MLP) {
@@ -590,9 +607,10 @@ static int mpegps_read_packet(AVFormatContext *s,
}
}
ret = av_get_packet(s->pb, pkt, len);
- pkt->pts = pts;
- pkt->dts = dts;
- pkt->pos = dummy_pos;
+
+ pkt->pts = pts;
+ pkt->dts = dts;
+ pkt->pos = dummy_pos;
pkt->stream_index = st->index;
av_dlog(s, "%d: pts=%0.3f dts=%0.3f size=%d\n",
pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0,
@@ -611,7 +629,7 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
if (avio_seek(s->pb, pos, SEEK_SET) < 0)
return AV_NOPTS_VALUE;
- for(;;) {
+ for (;;) {
len = mpegps_read_pes_header(s, &pos, &startcode, &pts, &dts);
if (len < 0) {
av_dlog(s, "none (ret=%d)\n", len);
@@ -739,7 +757,7 @@ static int vobsub_read_header(AVFormatContext *s)
break;
}
timestamp = (hh*3600LL + mm*60LL + ss) * 1000LL + ms + delay;
- timestamp = av_rescale_q(timestamp, (AVRational){1,1000}, st->time_base);
+ timestamp = av_rescale_q(timestamp, av_make_q(1, 1000), st->time_base);
sub = ff_subtitles_queue_insert(&vobsub->q[s->nb_streams - 1], "", 0, 0);
if (!sub) {
@@ -810,8 +828,6 @@ end:
return ret;
}
-#define FAIL(r) do { ret = r; goto fail; } while (0)
-
static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
{
MpegDemuxContext *vobsub = s->priv_data;
@@ -860,7 +876,7 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0) {
if (pkt->size) // raise packet even if incomplete
break;
- FAIL(ret);
+ goto fail;
}
to_read = ret & 0xffff;
new_pos = avio_tell(pb);
@@ -877,7 +893,7 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
ret = av_grow_packet(pkt, to_read);
if (ret < 0)
- FAIL(ret);
+ goto fail;
n = avio_read(pb, pkt->data + (pkt->size - to_read), to_read);
if (n < to_read)
diff --git a/chromium/third_party/ffmpeg/libavformat/mpeg.h b/chromium/third_party/ffmpeg/libavformat/mpeg.h
index cf10d6a4c40..55f9e0cb51b 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpeg.h
+++ b/chromium/third_party/ffmpeg/libavformat/mpeg.h
@@ -57,7 +57,6 @@
#define STREAM_TYPE_VIDEO_CAVS 0x42
#define STREAM_TYPE_AUDIO_AC3 0x81
-#define STREAM_TYPE_AUDIO_DTS 0x8a
static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 };
diff --git a/chromium/third_party/ffmpeg/libavformat/mpegenc.c b/chromium/third_party/ffmpeg/libavformat/mpegenc.c
index ccf3ec21f7a..5521f48cee4 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpegenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpegenc.c
@@ -387,7 +387,9 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
if (st->codec->rc_buffer_size)
stream->max_buffer_size = 6*1024 + st->codec->rc_buffer_size/8;
else {
- av_log(ctx, AV_LOG_WARNING, "VBV buffer size not set, muxing may fail\n");
+ av_log(ctx, AV_LOG_WARNING, "VBV buffer size not set, using default size of 130KB\n"
+ "If you want the mpeg file to be compliant to some specification\n"
+ "Like DVD, VCD or others, make sure you set the correct buffer size\n");
stream->max_buffer_size = 230*1024; //FIXME this is probably too small as default
}
if (stream->max_buffer_size > 1024 * 8191) {
@@ -1157,7 +1159,7 @@ static int mpeg_mux_end(AVFormatContext *ctx)
stream = ctx->streams[i]->priv_data;
assert(av_fifo_size(stream->fifo) == 0);
- av_fifo_free(stream->fifo);
+ av_fifo_freep(&stream->fifo);
}
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/mpegts.c b/chromium/third_party/ffmpeg/libavformat/mpegts.c
index d67c63a4de2..0a5ac689614 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpegts.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpegts.c
@@ -29,7 +29,6 @@
#include "libavutil/avassert.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/get_bits.h"
-#include "libavcodec/mathops.h"
#include "avformat.h"
#include "mpegts.h"
#include "internal.h"
@@ -39,37 +38,46 @@
#include "isom.h"
/* maximum size in which we look for synchronisation if
- synchronisation is lost */
+ * synchronisation is lost */
#define MAX_RESYNC_SIZE 65536
-#define MAX_PES_PAYLOAD 200*1024
+#define MAX_PES_PAYLOAD 200 * 1024
#define MAX_MP4_DESCR_COUNT 16
+#define MOD_UNLIKELY(modulus, dividend, divisor, prev_dividend) \
+ do { \
+ if ((prev_dividend) == 0 || (dividend) - (prev_dividend) != (divisor)) \
+ (modulus) = (dividend) % (divisor); \
+ (prev_dividend) = (dividend); \
+ } while (0)
+
enum MpegTSFilterType {
MPEGTS_PES,
MPEGTS_SECTION,
+ MPEGTS_PCR,
};
typedef struct MpegTSFilter MpegTSFilter;
-typedef int PESCallback(MpegTSFilter *f, const uint8_t *buf, int len, int is_start, int64_t pos, int64_t cur_pcr);
+typedef int PESCallback (MpegTSFilter *f, const uint8_t *buf, int len,
+ int is_start, int64_t pos);
typedef struct MpegTSPESFilter {
PESCallback *pes_cb;
void *opaque;
} MpegTSPESFilter;
-typedef void SectionCallback(MpegTSFilter *f, const uint8_t *buf, int len);
+typedef void SectionCallback (MpegTSFilter *f, const uint8_t *buf, int len);
-typedef void SetServiceCallback(void *opaque, int ret);
+typedef void SetServiceCallback (void *opaque, int ret);
typedef struct MpegTSSectionFilter {
int section_index;
int section_h_size;
uint8_t *section_buf;
- unsigned int check_crc:1;
- unsigned int end_of_section_reached:1;
+ unsigned int check_crc : 1;
+ unsigned int end_of_section_reached : 1;
SectionCallback *section_cb;
void *opaque;
} MpegTSSectionFilter;
@@ -78,6 +86,7 @@ struct MpegTSFilter {
int pid;
int es_id;
int last_cc; /* last cc code (-1 if first packet) */
+ int64_t last_pcr;
enum MpegTSFilterType type;
union {
MpegTSPESFilter pes_filter;
@@ -87,16 +96,19 @@ struct MpegTSFilter {
#define MAX_PIDS_PER_PROGRAM 64
struct Program {
- unsigned int id; //program id/service id
+ unsigned int id; // program id/service id
unsigned int nb_pids;
unsigned int pids[MAX_PIDS_PER_PROGRAM];
+
+ /** have we found pmt for this program */
+ int pmt_found;
};
struct MpegTSContext {
const AVClass *class;
/* user data */
AVFormatContext *stream;
- /** raw packet size, including FEC if present */
+ /** raw packet size, including FEC if present */
int raw_packet_size;
int size_stat[3];
@@ -105,43 +117,47 @@ struct MpegTSContext {
int64_t pos47_full;
- /** if true, all pids are analyzed to find streams */
+ /** if true, all pids are analyzed to find streams */
int auto_guess;
- /** compute exact PCR for each transport stream packet */
+ /** compute exact PCR for each transport stream packet */
int mpeg2ts_compute_pcr;
/** fix dvb teletext pts */
int fix_teletext_pts;
- int64_t cur_pcr; /**< used to estimate the exact PCR */
- int pcr_incr; /**< used to estimate the exact PCR */
+ int64_t cur_pcr; /**< used to estimate the exact PCR */
+ int pcr_incr; /**< used to estimate the exact PCR */
/* data needed to handle file based ts */
- /** stop parsing loop */
+ /** stop parsing loop */
int stop_parse;
- /** packet containing Audio/Video data */
+ /** packet containing Audio/Video data */
AVPacket *pkt;
- /** to detect seek */
+ /** to detect seek */
int64_t last_pos;
/******************************************/
/* private mpegts data */
/* scan context */
- /** structure to keep track of Program->pids mapping */
+ /** structure to keep track of Program->pids mapping */
unsigned int nb_prg;
struct Program *prg;
int8_t crc_validity[NB_PID_MAX];
-
/** filters for various streams specified by PMT + for the PAT and PMT */
MpegTSFilter *pids[NB_PID_MAX];
int current_pid;
};
static const AVOption mpegtsraw_options[] = {
- {"compute_pcr", "Compute exact PCR for each transport stream packet.", offsetof(MpegTSContext, mpeg2ts_compute_pcr), AV_OPT_TYPE_INT,
- {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+ { "compute_pcr", "Compute exact PCR for each transport stream packet.",
+ offsetof(MpegTSContext, mpeg2ts_compute_pcr), AV_OPT_TYPE_INT,
+ { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+ { "ts_packetsize", "Output option carrying the raw packet size.",
+ offsetof(MpegTSContext, raw_packet_size), AV_OPT_TYPE_INT,
+ { .i64 = 0 }, 0, 0,
+ AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_EXPORT | AV_OPT_FLAG_READONLY },
{ NULL },
};
@@ -155,6 +171,8 @@ static const AVClass mpegtsraw_class = {
static const AVOption mpegts_options[] = {
{"fix_teletext_pts", "Try to fix pts values of dvb teletext streams.", offsetof(MpegTSContext, fix_teletext_pts), AV_OPT_TYPE_INT,
{.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+ {"ts_packetsize", "Output option carrying the raw packet size.", offsetof(MpegTSContext, raw_packet_size), AV_OPT_TYPE_INT,
+ {.i64 = 0}, 0, 0, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_EXPORT | AV_OPT_FLAG_READONLY },
{ NULL },
};
@@ -200,17 +218,27 @@ typedef struct PESContext {
uint8_t header[MAX_PES_HEADER_SIZE];
AVBufferRef *buffer;
SLConfigDescr sl;
- int64_t last_pcr;
} PESContext;
extern AVInputFormat ff_mpegts_demuxer;
+static struct Program * get_program(MpegTSContext *ts, unsigned int programid)
+{
+ int i;
+ for (i = 0; i < ts->nb_prg; i++) {
+ if (ts->prg[i].id == programid) {
+ return &ts->prg[i];
+ }
+ }
+ return NULL;
+}
+
static void clear_avprogram(MpegTSContext *ts, unsigned int programid)
{
AVProgram *prg = NULL;
int i;
- for(i=0; i<ts->stream->nb_programs; i++)
- if(ts->stream->programs[i]->id == programid){
+ for (i = 0; i < ts->stream->nb_programs; i++)
+ if (ts->stream->programs[i]->id == programid) {
prg = ts->stream->programs[i];
break;
}
@@ -224,15 +252,17 @@ static void clear_program(MpegTSContext *ts, unsigned int programid)
int i;
clear_avprogram(ts, programid);
- for(i=0; i<ts->nb_prg; i++)
- if(ts->prg[i].id == programid)
+ for (i = 0; i < ts->nb_prg; i++)
+ if (ts->prg[i].id == programid) {
ts->prg[i].nb_pids = 0;
+ ts->prg[i].pmt_found = 0;
+ }
}
static void clear_programs(MpegTSContext *ts)
{
av_freep(&ts->prg);
- ts->nb_prg=0;
+ ts->nb_prg = 0;
}
static void add_pat_entry(MpegTSContext *ts, unsigned int programid)
@@ -245,32 +275,36 @@ static void add_pat_entry(MpegTSContext *ts, unsigned int programid)
p = &ts->prg[ts->nb_prg];
p->id = programid;
p->nb_pids = 0;
+ p->pmt_found = 0;
ts->nb_prg++;
}
-static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid, unsigned int pid)
+static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid,
+ unsigned int pid)
{
- int i;
- struct Program *p = NULL;
- for(i=0; i<ts->nb_prg; i++) {
- if(ts->prg[i].id == programid) {
- p = &ts->prg[i];
- break;
- }
- }
- if(!p)
+ struct Program *p = get_program(ts, programid);
+ if (!p)
return;
- if(p->nb_pids >= MAX_PIDS_PER_PROGRAM)
+ if (p->nb_pids >= MAX_PIDS_PER_PROGRAM)
return;
p->pids[p->nb_pids++] = pid;
}
+static void set_pmt_found(MpegTSContext *ts, unsigned int programid)
+{
+ struct Program *p = get_program(ts, programid);
+ if (!p)
+ return;
+
+ p->pmt_found = 1;
+}
+
static void set_pcr_pid(AVFormatContext *s, unsigned int programid, unsigned int pid)
{
int i;
- for(i=0; i<s->nb_programs; i++) {
- if(s->programs[i]->id == programid) {
+ for (i = 0; i < s->nb_programs; i++) {
+ if (s->programs[i]->id == programid) {
s->programs[i]->pcr_pid = pid;
break;
}
@@ -292,24 +326,22 @@ static int discard_pid(MpegTSContext *ts, unsigned int pid)
struct Program *p;
/* If none of the programs have .discard=AVDISCARD_ALL then there's
- * no way we have to discard this packet
- */
- for (k = 0; k < ts->stream->nb_programs; k++) {
+ * no way we have to discard this packet */
+ for (k = 0; k < ts->stream->nb_programs; k++)
if (ts->stream->programs[k]->discard == AVDISCARD_ALL)
break;
- }
if (k == ts->stream->nb_programs)
return 0;
- for(i=0; i<ts->nb_prg; i++) {
+ for (i = 0; i < ts->nb_prg; i++) {
p = &ts->prg[i];
- for(j=0; j<p->nb_pids; j++) {
- if(p->pids[j] != pid)
+ for (j = 0; j < p->nb_pids; j++) {
+ if (p->pids[j] != pid)
continue;
- //is program with id p->id set to be discarded?
- for(k=0; k<ts->stream->nb_programs; k++) {
- if(ts->stream->programs[k]->id == p->id) {
- if(ts->stream->programs[k]->discard == AVDISCARD_ALL)
+ // is program with id p->id set to be discarded?
+ for (k = 0; k < ts->stream->nb_programs; k++) {
+ if (ts->stream->programs[k]->id == p->id) {
+ if (ts->stream->programs[k]->discard == AVDISCARD_ALL)
discarded++;
else
used++;
@@ -355,15 +387,16 @@ static void write_section_data(AVFormatContext *s, MpegTSFilter *tss1,
tss->section_h_size = len;
}
- if (tss->section_h_size != -1 && tss->section_index >= tss->section_h_size) {
+ if (tss->section_h_size != -1 &&
+ tss->section_index >= tss->section_h_size) {
int crc_valid = 1;
tss->end_of_section_reached = 1;
- if (tss->check_crc){
+ if (tss->check_crc) {
crc_valid = !av_crc(av_crc_get_table(AV_CRC_32_IEEE), -1, tss->section_buf, tss->section_h_size);
- if (crc_valid){
+ if (crc_valid) {
ts->crc_validity[ tss1->pid ] = 100;
- }else if(ts->crc_validity[ tss1->pid ] > -10){
+ }else if (ts->crc_validity[ tss1->pid ] > -10) {
ts->crc_validity[ tss1->pid ]--;
}else
crc_valid = 2;
@@ -373,13 +406,10 @@ static void write_section_data(AVFormatContext *s, MpegTSFilter *tss1,
}
}
-static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int pid,
- SectionCallback *section_cb, void *opaque,
- int check_crc)
-
+static MpegTSFilter *mpegts_open_filter(MpegTSContext *ts, unsigned int pid,
+ enum MpegTSFilterType type)
{
MpegTSFilter *filter;
- MpegTSSectionFilter *sec;
av_dlog(ts->stream, "Filter: pid=0x%x\n", pid);
@@ -389,15 +419,32 @@ static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int
if (!filter)
return NULL;
ts->pids[pid] = filter;
- filter->type = MPEGTS_SECTION;
- filter->pid = pid;
- filter->es_id = -1;
+
+ filter->type = type;
+ filter->pid = pid;
+ filter->es_id = -1;
filter->last_cc = -1;
+ filter->last_pcr= -1;
+
+ return filter;
+}
+
+static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts,
+ unsigned int pid,
+ SectionCallback *section_cb,
+ void *opaque,
+ int check_crc)
+{
+ MpegTSFilter *filter;
+ MpegTSSectionFilter *sec;
+
+ if (!(filter = mpegts_open_filter(ts, pid, MPEGTS_SECTION)))
+ return NULL;
sec = &filter->u.section_filter;
- sec->section_cb = section_cb;
- sec->opaque = opaque;
+ sec->section_cb = section_cb;
+ sec->opaque = opaque;
sec->section_buf = av_malloc(MAX_SECTION_SIZE);
- sec->check_crc = check_crc;
+ sec->check_crc = check_crc;
if (!sec->section_buf) {
av_free(filter);
return NULL;
@@ -406,28 +453,26 @@ static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int
}
static MpegTSFilter *mpegts_open_pes_filter(MpegTSContext *ts, unsigned int pid,
- PESCallback *pes_cb,
- void *opaque)
+ PESCallback *pes_cb,
+ void *opaque)
{
MpegTSFilter *filter;
MpegTSPESFilter *pes;
- if (pid >= NB_PID_MAX || ts->pids[pid])
+ if (!(filter = mpegts_open_filter(ts, pid, MPEGTS_PES)))
return NULL;
- filter = av_mallocz(sizeof(MpegTSFilter));
- if (!filter)
- return NULL;
- ts->pids[pid] = filter;
- filter->type = MPEGTS_PES;
- filter->pid = pid;
- filter->es_id = -1;
- filter->last_cc = -1;
+
pes = &filter->u.pes_filter;
pes->pes_cb = pes_cb;
pes->opaque = opaque;
return filter;
}
+static MpegTSFilter *mpegts_open_pcr_filter(MpegTSContext *ts, unsigned int pid)
+{
+ return mpegts_open_filter(ts, pid, MPEGTS_PCR);
+}
+
static void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter)
{
int pid;
@@ -449,20 +494,22 @@ static void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter)
ts->pids[pid] = NULL;
}
-static int analyze(const uint8_t *buf, int size, int packet_size, int *index){
+static int analyze(const uint8_t *buf, int size, int packet_size, int *index)
+{
int stat[TS_MAX_PACKET_SIZE];
int i;
- int best_score=0;
+ int best_score = 0;
- memset(stat, 0, packet_size*sizeof(*stat));
+ memset(stat, 0, packet_size * sizeof(*stat));
- for(i=0; i<size-3; i++){
- if(buf[i] == 0x47 && !(buf[i+1] & 0x80) && buf[i+3] != 0x47){
+ for (i = 0; i < size - 3; i++) {
+ if (buf[i] == 0x47 && !(buf[i + 1] & 0x80) && buf[i + 3] != 0x47) {
int x = i % packet_size;
stat[x]++;
- if(stat[x] > best_score){
- best_score= stat[x];
- if(index) *index= x;
+ if (stat[x] > best_score) {
+ best_score = stat[x];
+ if (index)
+ *index = x;
}
}
}
@@ -476,18 +523,22 @@ static int get_packet_size(const uint8_t *buf, int size)
int score, fec_score, dvhs_score;
if (size < (TS_FEC_PACKET_SIZE * 5 + 1))
- return -1;
+ return AVERROR_INVALIDDATA;
- score = analyze(buf, size, TS_PACKET_SIZE, NULL);
- dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL);
- fec_score= analyze(buf, size, TS_FEC_PACKET_SIZE, NULL);
+ score = analyze(buf, size, TS_PACKET_SIZE, NULL);
+ dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL);
+ fec_score = analyze(buf, size, TS_FEC_PACKET_SIZE, NULL);
av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",
score, dvhs_score, fec_score);
- if (score > fec_score && score > dvhs_score) return TS_PACKET_SIZE;
- else if(dvhs_score > score && dvhs_score > fec_score) return TS_DVHS_PACKET_SIZE;
- else if(score < fec_score && dvhs_score < fec_score) return TS_FEC_PACKET_SIZE;
- else return -1;
+ if (score > fec_score && score > dvhs_score)
+ return TS_PACKET_SIZE;
+ else if (dvhs_score > score && dvhs_score > fec_score)
+ return TS_DVHS_PACKET_SIZE;
+ else if (score < fec_score && dvhs_score < fec_score)
+ return TS_FEC_PACKET_SIZE;
+ else
+ return AVERROR_INVALIDDATA;
}
typedef struct SectionHeader {
@@ -505,8 +556,8 @@ static inline int get8(const uint8_t **pp, const uint8_t *p_end)
p = *pp;
if (p >= p_end)
- return -1;
- c = *p++;
+ return AVERROR_INVALIDDATA;
+ c = *p++;
*pp = p;
return c;
}
@@ -518,9 +569,9 @@ static inline int get16(const uint8_t **pp, const uint8_t *p_end)
p = *pp;
if ((p + 1) >= p_end)
- return -1;
- c = AV_RB16(p);
- p += 2;
+ return AVERROR_INVALIDDATA;
+ c = AV_RB16(p);
+ p += 2;
*pp = p;
return c;
}
@@ -532,7 +583,7 @@ static char *getstr8(const uint8_t **pp, const uint8_t *p_end)
const uint8_t *p;
char *str;
- p = *pp;
+ p = *pp;
len = get8(&p, p_end);
if (len < 0)
return NULL;
@@ -543,7 +594,7 @@ static char *getstr8(const uint8_t **pp, const uint8_t *p_end)
return NULL;
memcpy(str, p, len);
str[len] = '\0';
- p += len;
+ p += len;
*pp = p;
return str;
}
@@ -555,24 +606,24 @@ static int parse_section_header(SectionHeader *h,
val = get8(pp, p_end);
if (val < 0)
- return -1;
+ return val;
h->tid = val;
*pp += 2;
- val = get16(pp, p_end);
+ val = get16(pp, p_end);
if (val < 0)
- return -1;
+ return val;
h->id = val;
val = get8(pp, p_end);
if (val < 0)
- return -1;
+ return val;
h->version = (val >> 1) & 0x1f;
val = get8(pp, p_end);
if (val < 0)
- return -1;
+ return val;
h->sec_num = val;
val = get8(pp, p_end);
if (val < 0)
- return -1;
+ return val;
h->last_sec_num = val;
return 0;
}
@@ -586,94 +637,95 @@ typedef struct {
static const StreamType ISO_types[] = {
{ 0x01, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_MPEG2VIDEO },
{ 0x02, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_MPEG2VIDEO },
- { 0x03, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_MP3 },
- { 0x04, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_MP3 },
- { 0x0f, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AAC },
- { 0x10, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_MPEG4 },
+ { 0x03, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_MP3 },
+ { 0x04, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_MP3 },
+ { 0x0f, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AAC },
+ { 0x10, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_MPEG4 },
/* Makito encoder sets stream type 0x11 for AAC,
* so auto-detect LOAS/LATM instead of hardcoding it. */
#if !CONFIG_LOAS_DEMUXER
- { 0x11, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AAC_LATM }, /* LATM syntax */
+ { 0x11, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AAC_LATM }, /* LATM syntax */
#endif
- { 0x1b, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264 },
- { 0x24, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_HEVC },
- { 0x42, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_CAVS },
- { 0xd1, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_DIRAC },
- { 0xea, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_VC1 },
+ { 0x1b, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264 },
+ { 0x24, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_HEVC },
+ { 0x42, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_CAVS },
+ { 0xd1, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_DIRAC },
+ { 0xea, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_VC1 },
{ 0 },
};
static const StreamType HDMV_types[] = {
- { 0x80, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_PCM_BLURAY },
- { 0x81, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
- { 0x82, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
- { 0x83, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_TRUEHD },
- { 0x84, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_EAC3 },
- { 0x85, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS }, /* DTS HD */
- { 0x86, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS }, /* DTS HD MASTER*/
- { 0xa1, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_EAC3 }, /* E-AC3 Secondary Audio */
- { 0xa2, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS }, /* DTS Express Secondary Audio */
+ { 0x80, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_PCM_BLURAY },
+ { 0x81, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
+ { 0x82, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
+ { 0x83, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_TRUEHD },
+ { 0x84, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_EAC3 },
+ { 0x85, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS }, /* DTS HD */
+ { 0x86, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS }, /* DTS HD MASTER*/
+ { 0xa1, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_EAC3 }, /* E-AC3 Secondary Audio */
+ { 0xa2, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS }, /* DTS Express Secondary Audio */
{ 0x90, AVMEDIA_TYPE_SUBTITLE, AV_CODEC_ID_HDMV_PGS_SUBTITLE },
{ 0 },
};
/* ATSC ? */
static const StreamType MISC_types[] = {
- { 0x81, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
- { 0x8a, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
+ { 0x81, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
+ { 0x8a, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
{ 0 },
};
static const StreamType REGD_types[] = {
- { MKTAG('d','r','a','c'), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_DIRAC },
- { MKTAG('A','C','-','3'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
- { MKTAG('B','S','S','D'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_S302M },
- { MKTAG('D','T','S','1'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
- { MKTAG('D','T','S','2'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
- { MKTAG('D','T','S','3'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
- { MKTAG('H','E','V','C'), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_HEVC },
- { MKTAG('K','L','V','A'), AVMEDIA_TYPE_DATA, AV_CODEC_ID_SMPTE_KLV },
- { MKTAG('V','C','-','1'), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_VC1 },
+ { MKTAG('d', 'r', 'a', 'c'), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_DIRAC },
+ { MKTAG('A', 'C', '-', '3'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
+ { MKTAG('B', 'S', 'S', 'D'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_S302M },
+ { MKTAG('D', 'T', 'S', '1'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
+ { MKTAG('D', 'T', 'S', '2'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
+ { MKTAG('D', 'T', 'S', '3'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
+ { MKTAG('H', 'E', 'V', 'C'), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_HEVC },
+ { MKTAG('K', 'L', 'V', 'A'), AVMEDIA_TYPE_DATA, AV_CODEC_ID_SMPTE_KLV },
+ { MKTAG('V', 'C', '-', '1'), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_VC1 },
{ 0 },
};
static const StreamType METADATA_types[] = {
{ MKTAG('K','L','V','A'), AVMEDIA_TYPE_DATA, AV_CODEC_ID_SMPTE_KLV },
+ { MKTAG('I','D','3',' '), AVMEDIA_TYPE_DATA, AV_CODEC_ID_TIMED_ID3 },
{ 0 },
};
/* descriptor present */
static const StreamType DESC_types[] = {
- { 0x6a, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 }, /* AC-3 descriptor */
- { 0x7a, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_EAC3 }, /* E-AC-3 descriptor */
- { 0x7b, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
+ { 0x6a, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 }, /* AC-3 descriptor */
+ { 0x7a, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_EAC3 }, /* E-AC-3 descriptor */
+ { 0x7b, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
{ 0x56, AVMEDIA_TYPE_SUBTITLE, AV_CODEC_ID_DVB_TELETEXT },
{ 0x59, AVMEDIA_TYPE_SUBTITLE, AV_CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */
{ 0 },
};
static void mpegts_find_stream_type(AVStream *st,
- uint32_t stream_type, const StreamType *types)
+ uint32_t stream_type,
+ const StreamType *types)
{
if (avcodec_is_open(st->codec)) {
av_log(NULL, AV_LOG_DEBUG, "cannot set stream info, codec is open\n");
return;
}
- for (; types->stream_type; types++) {
+ for (; types->stream_type; types++)
if (stream_type == types->stream_type) {
st->codec->codec_type = types->codec_type;
st->codec->codec_id = types->codec_id;
st->request_probe = 0;
return;
}
- }
}
static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
uint32_t stream_type, uint32_t prog_reg_desc)
{
- int old_codec_type= st->codec->codec_type;
+ int old_codec_type = st->codec->codec_type;
int old_codec_id = st->codec->codec_id;
if (avcodec_is_open(st->codec)) {
@@ -682,16 +734,16 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
}
avpriv_set_pts_info(st, 33, 1, 90000);
- st->priv_data = pes;
+ st->priv_data = pes;
st->codec->codec_type = AVMEDIA_TYPE_DATA;
st->codec->codec_id = AV_CODEC_ID_NONE;
- st->need_parsing = AVSTREAM_PARSE_FULL;
- pes->st = st;
+ st->need_parsing = AVSTREAM_PARSE_FULL;
+ pes->st = st;
pes->stream_type = stream_type;
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->index, pes->stream_type, pes->pid, (char *)&prog_reg_desc);
st->codec->codec_tag = pes->stream_type;
@@ -718,23 +770,32 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
sub_st->id = pes->pid;
avpriv_set_pts_info(sub_st, 33, 1, 90000);
- sub_st->priv_data = sub_pes;
+ sub_st->priv_data = sub_pes;
sub_st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
sub_st->codec->codec_id = AV_CODEC_ID_AC3;
- sub_st->need_parsing = AVSTREAM_PARSE_FULL;
- sub_pes->sub_st = pes->sub_st = sub_st;
+ sub_st->need_parsing = AVSTREAM_PARSE_FULL;
+ sub_pes->sub_st = pes->sub_st = sub_st;
}
}
if (st->codec->codec_id == AV_CODEC_ID_NONE)
mpegts_find_stream_type(st, pes->stream_type, MISC_types);
- if (st->codec->codec_id == AV_CODEC_ID_NONE){
+ if (st->codec->codec_id == AV_CODEC_ID_NONE) {
st->codec->codec_id = old_codec_id;
- st->codec->codec_type= old_codec_type;
+ st->codec->codec_type = old_codec_type;
}
return 0;
}
+static void reset_pes_packet_state(PESContext *pes)
+{
+ pes->pts = AV_NOPTS_VALUE;
+ pes->dts = AV_NOPTS_VALUE;
+ pes->data_index = 0;
+ pes->flags = 0;
+ av_buffer_unref(&pes->buffer);
+}
+
static void new_pes_packet(PESContext *pes, AVPacket *pkt)
{
av_init_packet(pkt);
@@ -743,12 +804,13 @@ static void new_pes_packet(PESContext *pes, AVPacket *pkt)
pkt->data = pes->buffer->data;
pkt->size = pes->data_index;
- if(pes->total_size != MAX_PES_PAYLOAD &&
- pes->pes_header_size + pes->data_index != pes->total_size + PES_START_SIZE) {
+ if (pes->total_size != MAX_PES_PAYLOAD &&
+ pes->pes_header_size + pes->data_index != pes->total_size +
+ PES_START_SIZE) {
av_log(pes->stream, AV_LOG_WARNING, "PES packet size mismatch\n");
pes->flags |= AV_PKT_FLAG_CORRUPT;
}
- memset(pkt->data+pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ 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)
@@ -758,15 +820,11 @@ static void new_pes_packet(PESContext *pes, AVPacket *pkt)
pkt->pts = pes->pts;
pkt->dts = pes->dts;
/* store position of first TS packet of this PES packet */
- pkt->pos = pes->ts_packet_pos;
+ pkt->pos = pes->ts_packet_pos;
pkt->flags = pes->flags;
- /* reset pts values */
- pes->pts = AV_NOPTS_VALUE;
- pes->dts = AV_NOPTS_VALUE;
pes->buffer = NULL;
- pes->data_index = 0;
- pes->flags = 0;
+ reset_pes_packet_state(pes);
}
static uint64_t get_ts64(GetBitContext *gb, int bits)
@@ -776,7 +834,8 @@ static uint64_t get_ts64(GetBitContext *gb, int bits)
return get_bits64(gb, bits);
}
-static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf, int buf_size)
+static int read_sl_header(PESContext *pes, SLConfigDescr *sl,
+ const uint8_t *buf, int buf_size)
{
GetBitContext gb;
int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
@@ -784,7 +843,7 @@ static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf
int dts_flag = -1, cts_flag = -1;
int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
- init_get_bits(&gb, buf, buf_size*8);
+ init_get_bits(&gb, buf, buf_size * 8);
if (sl->use_au_start)
au_start_flag = get_bits1(&gb);
@@ -845,31 +904,29 @@ static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf
/* 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, int64_t pcr)
+ int64_t pos)
{
- PESContext *pes = filter->u.pes_filter.opaque;
+ PESContext *pes = filter->u.pes_filter.opaque;
MpegTSContext *ts = pes->ts;
const uint8_t *p;
int len, code;
- if(!ts->pkt)
+ if (!ts->pkt)
return 0;
- if (pcr != -1)
- pes->last_pcr = pcr;
-
if (is_start) {
if (pes->state == MPEGTS_PAYLOAD && pes->data_index > 0) {
new_pes_packet(pes, ts->pkt);
ts->stop_parse = 1;
+ } else {
+ reset_pes_packet_state(pes);
}
- pes->state = MPEGTS_HEADER;
- pes->data_index = 0;
+ pes->state = MPEGTS_HEADER;
pes->ts_packet_pos = pos;
}
p = buf;
while (buf_size > 0) {
- switch(pes->state) {
+ switch (pes->state) {
case MPEGTS_HEADER:
len = PES_START_SIZE - pes->data_index;
if (len > buf_size)
@@ -880,15 +937,17 @@ static int mpegts_push_data(MpegTSFilter *filter,
buf_size -= len;
if (pes->data_index == PES_START_SIZE) {
/* we got all the PES or section header. We can now
- decide */
+ * decide */
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;
- av_dlog(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code);
+ av_dlog(pes->stream, "pid=%x pes_code=%#x\n", pes->pid,
+ code);
if ((pes->st && pes->st->discard == AVDISCARD_ALL &&
- (!pes->sub_st || pes->sub_st->discard == AVDISCARD_ALL)) ||
+ (!pes->sub_st ||
+ pes->sub_st->discard == AVDISCARD_ALL)) ||
code == 0x1be) /* padding_stream */
goto skip;
@@ -903,7 +962,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
pes->total_size = AV_RB16(pes->header + 4);
/* NOTE: a zero total size means the PES size is
- unbounded */
+ * unbounded */
if (!pes->total_size)
pes->total_size = MAX_PES_PAYLOAD;
@@ -919,29 +978,31 @@ static int mpegts_push_data(MpegTSFilter *filter,
code != 0x1f8) { /* ITU-T Rec. H.222.1 type E stream */
pes->state = MPEGTS_PESHEADER;
if (pes->st->codec->codec_id == AV_CODEC_ID_NONE && !pes->st->request_probe) {
- av_dlog(pes->stream, "pid=%x stream_type=%x probing\n",
- pes->pid, pes->stream_type);
- pes->st->request_probe= 1;
+ av_dlog(pes->stream,
+ "pid=%x stream_type=%x probing\n",
+ pes->pid,
+ pes->stream_type);
+ pes->st->request_probe = 1;
}
} else {
- pes->state = MPEGTS_PAYLOAD;
+ pes->state = MPEGTS_PAYLOAD;
pes->data_index = 0;
}
} else {
/* otherwise, it should be a table */
/* skip packet */
- skip:
+skip:
pes->state = MPEGTS_SKIP;
continue;
}
}
break;
- /**********************************************/
- /* PES packing parsing */
+ /**********************************************/
+ /* PES packing parsing */
case MPEGTS_PESHEADER:
len = PES_HEADER_SIZE - pes->data_index;
if (len < 0)
- return -1;
+ return AVERROR_INVALIDDATA;
if (len > buf_size)
len = buf_size;
memcpy(pes->header + pes->data_index, p, len);
@@ -950,13 +1011,13 @@ static int mpegts_push_data(MpegTSFilter *filter,
buf_size -= len;
if (pes->data_index == PES_HEADER_SIZE) {
pes->pes_header_size = pes->header[8] + 9;
- pes->state = MPEGTS_PESHEADER_FILL;
+ pes->state = MPEGTS_PESHEADER_FILL;
}
break;
case MPEGTS_PESHEADER_FILL:
len = pes->pes_header_size - pes->data_index;
if (len < 0)
- return -1;
+ return AVERROR_INVALIDDATA;
if (len > buf_size)
len = buf_size;
memcpy(pes->header + pes->data_index, p, len);
@@ -972,10 +1033,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
pes->pts = AV_NOPTS_VALUE;
pes->dts = AV_NOPTS_VALUE;
if ((flags & 0xc0) == 0x80) {
- pes->pts = ff_parse_pes_pts(r);
- /* video pts is not monotonic, can't be used for dts */
- if (pes->st->codec->codec_type != AVMEDIA_TYPE_VIDEO)
- pes->dts = pes->pts;
+ pes->dts = pes->pts = ff_parse_pes_pts(r);
r += 5;
} else if ((flags & 0xc0) == 0xc0) {
pes->pts = ff_parse_pes_pts(r);
@@ -987,9 +1045,9 @@ static int mpegts_push_data(MpegTSFilter *filter,
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 = (pes_ext >> 4) & 0xb;
skip += skip & 0x9;
- r += skip;
+ r += skip;
if ((pes_ext & 0x41) == 0x01 &&
(r + 2) <= (pes->header + pes->pes_header_size)) {
/* PES extension 2 */
@@ -1002,7 +1060,8 @@ static int mpegts_push_data(MpegTSFilter *filter,
pes->state = MPEGTS_PAYLOAD;
pes->data_index = 0;
if (pes->stream_type == 0x12 && buf_size > 0) {
- int sl_header_bytes = read_sl_header(pes, &pes->sl, p, buf_size);
+ int sl_header_bytes = read_sl_header(pes, &pes->sl, p,
+ buf_size);
pes->pes_header_size += sl_header_bytes;
p += sl_header_bytes;
buf_size -= sl_header_bytes;
@@ -1018,16 +1077,28 @@ static int mpegts_push_data(MpegTSFilter *filter,
while ((p = av_find_program_from_stream(pes->stream, p, pes->st->index))) {
if (p->pcr_pid != -1 && p->discard != AVDISCARD_ALL) {
MpegTSFilter *f = pes->ts->pids[p->pcr_pid];
- if (f && f->type == MPEGTS_PES) {
- PESContext *pcrpes = f->u.pes_filter.opaque;
- if (pcrpes && pcrpes->last_pcr != -1 && pcrpes->st && pcrpes->st->discard != AVDISCARD_ALL) {
+ if (f) {
+ AVStream *st = NULL;
+ if (f->type == MPEGTS_PES) {
+ PESContext *pcrpes = f->u.pes_filter.opaque;
+ if (pcrpes)
+ st = pcrpes->st;
+ } else if (f->type == MPEGTS_PCR) {
+ int i;
+ for (i = 0; i < p->nb_stream_indexes; i++) {
+ AVStream *pst = pes->stream->streams[p->stream_index[i]];
+ if (pst->codec->codec_type == AVMEDIA_TYPE_VIDEO)
+ st = pst;
+ }
+ }
+ if (f->last_pcr != -1 && st && st->discard != AVDISCARD_ALL) {
// teletext packets do not always have correct timestamps,
// the standard says they should be handled after 40.6 ms at most,
// and the pcr error to this packet should be no more than 100 ms.
// TODO: we should interpolate the PCR, not just use the last one
- int64_t pcr = pcrpes->last_pcr / 300;
- pes->st->pts_wrap_reference = pcrpes->st->pts_wrap_reference;
- pes->st->pts_wrap_behavior = pcrpes->st->pts_wrap_behavior;
+ int64_t pcr = f->last_pcr / 300;
+ pes->st->pts_wrap_reference = st->pts_wrap_reference;
+ pes->st->pts_wrap_behavior = st->pts_wrap_behavior;
if (pes->dts == AV_NOPTS_VALUE || pes->dts < pcr) {
pes->pts = pes->dts = pcr;
} else if (pes->dts > pcr + 3654 + 9000) {
@@ -1042,33 +1113,36 @@ static int mpegts_push_data(MpegTSFilter *filter,
}
break;
case MPEGTS_PAYLOAD:
- if (buf_size > 0 && pes->buffer) {
- if (pes->data_index > 0 && pes->data_index+buf_size > pes->total_size) {
+ if (pes->buffer) {
+ if (pes->data_index > 0 &&
+ pes->data_index + buf_size > pes->total_size) {
new_pes_packet(pes, ts->pkt);
pes->total_size = MAX_PES_PAYLOAD;
- pes->buffer = av_buffer_alloc(pes->total_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ pes->buffer = av_buffer_alloc(pes->total_size +
+ FF_INPUT_BUFFER_PADDING_SIZE);
if (!pes->buffer)
return AVERROR(ENOMEM);
ts->stop_parse = 1;
- } else if (pes->data_index == 0 && buf_size > pes->total_size) {
+ } else if (pes->data_index == 0 &&
+ buf_size > pes->total_size) {
// pes packet size is < ts size packet and pes data is padded with 0xff
// not sure if this is legal in ts but see issue #2392
buf_size = pes->total_size;
}
memcpy(pes->buffer->data + pes->data_index, p, buf_size);
pes->data_index += buf_size;
+ /* emit complete packets with known packet size
+ * decreases demuxer delay for infrequent packets like subtitles from
+ * a couple of seconds to milliseconds for properly muxed files.
+ * total_size is the number of bytes following pes_packet_length
+ * in the pes header, i.e. not counting the first PES_START_SIZE bytes */
+ if (!ts->stop_parse && pes->total_size < MAX_PES_PAYLOAD &&
+ pes->pes_header_size + pes->data_index == pes->total_size + PES_START_SIZE) {
+ ts->stop_parse = 1;
+ new_pes_packet(pes, ts->pkt);
+ }
}
buf_size = 0;
- /* emit complete packets with known packet size
- * decreases demuxer delay for infrequent packets like subtitles from
- * a couple of seconds to milliseconds for properly muxed files.
- * total_size is the number of bytes following pes_packet_length
- * in the pes header, i.e. not counting the first PES_START_SIZE bytes */
- if (!ts->stop_parse && pes->total_size < MAX_PES_PAYLOAD &&
- pes->pes_header_size + pes->data_index == pes->total_size + PES_START_SIZE) {
- ts->stop_parse = 1;
- new_pes_packet(pes, ts->pkt);
- }
break;
case MPEGTS_SKIP:
buf_size = 0;
@@ -1088,15 +1162,14 @@ static PESContext *add_pes_stream(MpegTSContext *ts, int pid, int pcr_pid)
pes = av_mallocz(sizeof(PESContext));
if (!pes)
return 0;
- pes->ts = ts;
- pes->stream = ts->stream;
- pes->pid = pid;
+ 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;
- pes->last_pcr = -1;
- tss = mpegts_open_pes_filter(ts, pid, mpegts_push_data, pes);
+ 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;
@@ -1115,32 +1188,33 @@ typedef struct {
int level;
} MP4DescrParseContext;
-static int init_MP4DescrParseContext(
- MP4DescrParseContext *d, AVFormatContext *s, const uint8_t *buf,
- unsigned size, Mp4Descr *descr, int max_descr_count)
+static int init_MP4DescrParseContext(MP4DescrParseContext *d, AVFormatContext *s,
+ const uint8_t *buf, unsigned size,
+ Mp4Descr *descr, int max_descr_count)
{
int ret;
- if (size > (1<<30))
+ if (size > (1 << 30))
return AVERROR_INVALIDDATA;
- if ((ret = ffio_init_context(&d->pb, (unsigned char*)buf, size, 0,
- NULL, NULL, NULL, NULL)) < 0)
+ if ((ret = ffio_init_context(&d->pb, (unsigned char *)buf, size, 0,
+ NULL, NULL, NULL, NULL)) < 0)
return ret;
- d->s = s;
- d->level = 0;
- d->descr_count = 0;
- d->descr = descr;
- d->active_descr = NULL;
+ d->s = s;
+ d->level = 0;
+ d->descr_count = 0;
+ d->descr = descr;
+ d->active_descr = NULL;
d->max_descr_count = max_descr_count;
return 0;
}
-static void update_offsets(AVIOContext *pb, int64_t *off, int *len) {
+static void update_offsets(AVIOContext *pb, int64_t *off, int *len)
+{
int64_t new_off = avio_tell(pb);
(*len) -= new_off - *off;
- *off = new_off;
+ *off = new_off;
}
static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
@@ -1149,8 +1223,9 @@ static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
static int parse_mp4_descr_arr(MP4DescrParseContext *d, int64_t off, int len)
{
while (len > 0) {
- if (parse_mp4_descr(d, off, len, 0) < 0)
- return -1;
+ int ret = parse_mp4_descr(d, off, len, 0);
+ if (ret < 0)
+ return ret;
update_offsets(&d->pb, &off, &len);
}
return 0;
@@ -1174,9 +1249,9 @@ static int parse_MP4ODescrTag(MP4DescrParseContext *d, int64_t off, int len)
if (len < 2)
return 0;
id_flags = avio_rb16(&d->pb);
- if (!(id_flags & 0x0020)) { //URL_Flag
+ if (!(id_flags & 0x0020)) { // URL_Flag
update_offsets(&d->pb, &off, &len);
- return parse_mp4_descr_arr(d, off, len); //ES_Descriptor[]
+ return parse_mp4_descr_arr(d, off, len); // ES_Descriptor[]
} else {
return 0;
}
@@ -1186,7 +1261,7 @@ static int parse_MP4ESDescrTag(MP4DescrParseContext *d, int64_t off, int len)
{
int es_id = 0;
if (d->descr_count >= d->max_descr_count)
- return -1;
+ return AVERROR_INVALIDDATA;
ff_mp4_parse_es_descr(&d->pb, &es_id);
d->active_descr = d->descr + (d->descr_count++);
@@ -1200,11 +1275,12 @@ static int parse_MP4ESDescrTag(MP4DescrParseContext *d, int64_t off, int len)
return 0;
}
-static int parse_MP4DecConfigDescrTag(MP4DescrParseContext *d, int64_t off, int len)
+static int parse_MP4DecConfigDescrTag(MP4DescrParseContext *d, int64_t off,
+ int len)
{
Mp4Descr *descr = d->active_descr;
if (!descr)
- return -1;
+ return AVERROR_INVALIDDATA;
d->active_descr->dec_config_descr = av_malloc(len);
if (!descr->dec_config_descr)
return AVERROR(ENOMEM);
@@ -1218,21 +1294,26 @@ static int parse_MP4SLDescrTag(MP4DescrParseContext *d, int64_t off, int len)
Mp4Descr *descr = d->active_descr;
int predefined;
if (!descr)
- return -1;
+ return AVERROR_INVALIDDATA;
predefined = avio_r8(&d->pb);
if (!predefined) {
int lengths;
int flags = avio_r8(&d->pb);
- descr->sl.use_au_start = !!(flags & 0x80);
- descr->sl.use_au_end = !!(flags & 0x40);
- descr->sl.use_rand_acc_pt = !!(flags & 0x20);
- descr->sl.use_padding = !!(flags & 0x08);
- descr->sl.use_timestamps = !!(flags & 0x04);
- descr->sl.use_idle = !!(flags & 0x02);
- descr->sl.timestamp_res = avio_rb32(&d->pb);
- avio_rb32(&d->pb);
+ descr->sl.use_au_start = !!(flags & 0x80);
+ descr->sl.use_au_end = !!(flags & 0x40);
+ descr->sl.use_rand_acc_pt = !!(flags & 0x20);
+ descr->sl.use_padding = !!(flags & 0x08);
+ descr->sl.use_timestamps = !!(flags & 0x04);
+ descr->sl.use_idle = !!(flags & 0x02);
+ descr->sl.timestamp_res = avio_rb32(&d->pb);
+ avio_rb32(&d->pb);
descr->sl.timestamp_len = avio_r8(&d->pb);
+ if (descr->sl.timestamp_len > 64) {
+ avpriv_request_sample(NULL, "timestamp_len > 64");
+ descr->sl.timestamp_len = 64;
+ return AVERROR_PATCHWELCOME;
+ }
descr->sl.ocr_len = avio_r8(&d->pb);
descr->sl.au_len = avio_r8(&d->pb);
descr->sl.inst_bitrate_len = avio_r8(&d->pb);
@@ -1247,13 +1328,16 @@ static int parse_MP4SLDescrTag(MP4DescrParseContext *d, int64_t off, int len)
}
static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
- int target_tag) {
+ int target_tag)
+{
int tag;
int len1 = ff_mp4_read_descr(d->s, &d->pb, &tag);
update_offsets(&d->pb, &off, &len);
if (len < 0 || len1 > len || len1 <= 0) {
- av_log(d->s, AV_LOG_ERROR, "Tag %x length violation new length %d bytes remaining %d\n", tag, len1, len);
- return -1;
+ av_log(d->s, AV_LOG_ERROR,
+ "Tag %x length violation new length %d bytes remaining %d\n",
+ tag, len1, len);
+ return AVERROR_INVALIDDATA;
}
if (d->level++ >= MAX_LEVEL) {
@@ -1262,7 +1346,8 @@ static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
}
if (target_tag && tag != target_tag) {
- av_log(d->s, AV_LOG_ERROR, "Found tag %x expected %x\n", tag, target_tag);
+ av_log(d->s, AV_LOG_ERROR, "Found tag %x expected %x\n", tag,
+ target_tag);
goto done;
}
@@ -1284,6 +1369,7 @@ static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
break;
}
+
done:
d->level--;
avio_seek(&d->pb, off + len1, SEEK_SET);
@@ -1294,36 +1380,43 @@ static int mp4_read_iods(AVFormatContext *s, const uint8_t *buf, unsigned size,
Mp4Descr *descr, int *descr_count, int max_descr_count)
{
MP4DescrParseContext d;
- if (init_MP4DescrParseContext(&d, s, buf, size, descr, max_descr_count) < 0)
- return -1;
+ int ret;
+
+ ret = init_MP4DescrParseContext(&d, s, buf, size, descr, max_descr_count);
+ if (ret < 0)
+ return ret;
- parse_mp4_descr(&d, avio_tell(&d.pb), size, MP4IODescrTag);
+ ret = parse_mp4_descr(&d, avio_tell(&d.pb), size, MP4IODescrTag);
*descr_count = d.descr_count;
- return 0;
+ return ret;
}
static int mp4_read_od(AVFormatContext *s, const uint8_t *buf, unsigned size,
Mp4Descr *descr, int *descr_count, int max_descr_count)
{
MP4DescrParseContext d;
- if (init_MP4DescrParseContext(&d, s, buf, size, descr, max_descr_count) < 0)
- return -1;
+ int ret;
- parse_mp4_descr_arr(&d, avio_tell(&d.pb), size);
+ ret = init_MP4DescrParseContext(&d, s, buf, size, descr, max_descr_count);
+ if (ret < 0)
+ return ret;
+
+ ret = parse_mp4_descr_arr(&d, avio_tell(&d.pb), size);
*descr_count = d.descr_count;
- return 0;
+ return ret;
}
-static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)
+static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section,
+ int section_len)
{
MpegTSContext *ts = filter->u.section_filter.opaque;
SectionHeader h;
const uint8_t *p, *p_end;
AVIOContext pb;
- Mp4Descr mp4_descr[MAX_MP4_DESCR_COUNT] = {{ 0 }};
int mp4_descr_count = 0;
+ Mp4Descr mp4_descr[MAX_MP4_DESCR_COUNT] = { { 0 } };
int i, pid;
AVFormatContext *s = ts->stream;
@@ -1334,30 +1427,31 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, int section_le
if (h.tid != M4OD_TID)
return;
- mp4_read_od(s, p, (unsigned)(p_end - p), mp4_descr, &mp4_descr_count, MAX_MP4_DESCR_COUNT);
+ mp4_read_od(s, p, (unsigned) (p_end - p), mp4_descr, &mp4_descr_count,
+ MAX_MP4_DESCR_COUNT);
for (pid = 0; pid < NB_PID_MAX; pid++) {
if (!ts->pids[pid])
- continue;
+ continue;
for (i = 0; i < mp4_descr_count; i++) {
PESContext *pes;
AVStream *st;
if (ts->pids[pid]->es_id != mp4_descr[i].es_id)
continue;
- if (!(ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES)) {
+ if (ts->pids[pid]->type != MPEGTS_PES) {
av_log(s, AV_LOG_ERROR, "pid %x is not PES\n", pid);
continue;
}
pes = ts->pids[pid]->u.pes_filter.opaque;
- st = pes->st;
- if (!st) {
+ st = pes->st;
+ if (!st)
continue;
- }
pes->sl = mp4_descr[i].sl;
ffio_init_context(&pb, mp4_descr[i].dec_config_descr,
- mp4_descr[i].dec_config_descr_len, 0, NULL, NULL, NULL, NULL);
+ mp4_descr[i].dec_config_descr_len, 0,
+ NULL, NULL, NULL, NULL);
ff_mp4_read_dec_config_descr(s, st, &pb);
if (st->codec->codec_id == AV_CODEC_ID_AAC &&
st->codec->extradata_size > 0)
@@ -1367,13 +1461,13 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, int section_le
st->need_parsing = 0;
if (st->codec->codec_id <= AV_CODEC_ID_NONE) {
- } else if (st->codec->codec_id < AV_CODEC_ID_FIRST_AUDIO) {
+ // do nothing
+ } else if (st->codec->codec_id < AV_CODEC_ID_FIRST_AUDIO)
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
- } else if (st->codec->codec_id < AV_CODEC_ID_FIRST_SUBTITLE) {
+ else if (st->codec->codec_id < AV_CODEC_ID_FIRST_SUBTITLE)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- } else if (st->codec->codec_id < AV_CODEC_ID_FIRST_UNKNOWN) {
+ else if (st->codec->codec_id < AV_CODEC_ID_FIRST_UNKNOWN)
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
- }
}
}
for (i = 0; i < mp4_descr_count; i++)
@@ -1392,13 +1486,13 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
desc_tag = get8(pp, desc_list_end);
if (desc_tag < 0)
- return -1;
+ return AVERROR_INVALIDDATA;
desc_len = get8(pp, desc_list_end);
if (desc_len < 0)
- return -1;
+ return AVERROR_INVALIDDATA;
desc_end = *pp + desc_len;
if (desc_end > desc_list_end)
- return -1;
+ return AVERROR_INVALIDDATA;
av_dlog(fc, "tag: 0x%02x len=%d\n", desc_tag, desc_len);
@@ -1406,73 +1500,149 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
stream_type == STREAM_TYPE_PRIVATE_DATA)
mpegts_find_stream_type(st, desc_tag, DESC_types);
- switch(desc_tag) {
+ switch (desc_tag) {
case 0x1E: /* SL descriptor */
desc_es_id = get16(pp, desc_end);
if (ts && ts->pids[pid])
ts->pids[pid]->es_id = desc_es_id;
for (i = 0; i < mp4_descr_count; i++)
- if (mp4_descr[i].dec_config_descr_len &&
- mp4_descr[i].es_id == desc_es_id) {
- AVIOContext pb;
- ffio_init_context(&pb, mp4_descr[i].dec_config_descr,
- mp4_descr[i].dec_config_descr_len, 0, NULL, NULL, NULL, NULL);
- ff_mp4_read_dec_config_descr(fc, st, &pb);
- if (st->codec->codec_id == AV_CODEC_ID_AAC &&
- st->codec->extradata_size > 0)
- st->need_parsing = 0;
- if (st->codec->codec_id == AV_CODEC_ID_MPEG4SYSTEMS)
- mpegts_open_section_filter(ts, pid, m4sl_cb, ts, 1);
- }
+ if (mp4_descr[i].dec_config_descr_len &&
+ mp4_descr[i].es_id == desc_es_id) {
+ AVIOContext pb;
+ ffio_init_context(&pb, mp4_descr[i].dec_config_descr,
+ mp4_descr[i].dec_config_descr_len, 0,
+ NULL, NULL, NULL, NULL);
+ ff_mp4_read_dec_config_descr(fc, st, &pb);
+ if (st->codec->codec_id == AV_CODEC_ID_AAC &&
+ st->codec->extradata_size > 0)
+ st->need_parsing = 0;
+ if (st->codec->codec_id == AV_CODEC_ID_MPEG4SYSTEMS)
+ mpegts_open_section_filter(ts, pid, m4sl_cb, ts, 1);
+ }
break;
case 0x1F: /* FMC descriptor */
get16(pp, desc_end);
- if (mp4_descr_count > 0 && (st->codec->codec_id == AV_CODEC_ID_AAC_LATM || st->request_probe>0) &&
+ if (mp4_descr_count > 0 &&
+ (st->codec->codec_id == AV_CODEC_ID_AAC_LATM || st->request_probe > 0) &&
mp4_descr->dec_config_descr_len && mp4_descr->es_id == pid) {
AVIOContext pb;
ffio_init_context(&pb, mp4_descr->dec_config_descr,
- mp4_descr->dec_config_descr_len, 0, NULL, NULL, NULL, NULL);
+ mp4_descr->dec_config_descr_len, 0,
+ NULL, NULL, NULL, NULL);
ff_mp4_read_dec_config_descr(fc, st, &pb);
if (st->codec->codec_id == AV_CODEC_ID_AAC &&
- st->codec->extradata_size > 0){
- st->request_probe= st->need_parsing = 0;
- st->codec->codec_type= AVMEDIA_TYPE_AUDIO;
+ st->codec->extradata_size > 0) {
+ st->request_probe = st->need_parsing = 0;
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
}
}
break;
case 0x56: /* DVB teletext descriptor */
- language[0] = get8(pp, desc_end);
- language[1] = get8(pp, desc_end);
- language[2] = get8(pp, desc_end);
- language[3] = 0;
- av_dict_set(&st->metadata, "language", language, 0);
+ {
+ uint8_t *extradata = NULL;
+ int language_count = desc_len / 5;
+
+ if (desc_len > 0 && desc_len % 5 != 0)
+ return AVERROR_INVALIDDATA;
+
+ if (language_count > 0) {
+ /* 4 bytes per language code (3 bytes) with comma or NUL byte should fit language buffer */
+ if (language_count > sizeof(language) / 4) {
+ language_count = sizeof(language) / 4;
+ }
+
+ if (st->codec->extradata == NULL) {
+ if (ff_alloc_extradata(st->codec, language_count * 2)) {
+ return AVERROR(ENOMEM);
+ }
+ }
+
+ if (st->codec->extradata_size < language_count * 2)
+ return AVERROR_INVALIDDATA;
+
+ extradata = st->codec->extradata;
+
+ for (i = 0; i < language_count; i++) {
+ language[i * 4 + 0] = get8(pp, desc_end);
+ language[i * 4 + 1] = get8(pp, desc_end);
+ language[i * 4 + 2] = get8(pp, desc_end);
+ language[i * 4 + 3] = ',';
+
+ memcpy(extradata, *pp, 2);
+ extradata += 2;
+
+ *pp += 2;
+ }
+
+ language[i * 4 - 1] = 0;
+ av_dict_set(&st->metadata, "language", language, 0);
+ }
+ }
break;
case 0x59: /* subtitling descriptor */
- language[0] = get8(pp, desc_end);
- language[1] = get8(pp, desc_end);
- language[2] = get8(pp, desc_end);
- language[3] = 0;
- /* hearing impaired subtitles detection */
- switch(get8(pp, desc_end)) {
- case 0x20: /* DVB subtitles (for the hard of hearing) with no monitor aspect ratio criticality */
- case 0x21: /* DVB subtitles (for the hard of hearing) for display on 4:3 aspect ratio monitor */
- case 0x22: /* DVB subtitles (for the hard of hearing) for display on 16:9 aspect ratio monitor */
- case 0x23: /* DVB subtitles (for the hard of hearing) for display on 2.21:1 aspect ratio monitor */
- case 0x24: /* DVB subtitles (for the hard of hearing) for display on a high definition monitor */
- case 0x25: /* DVB subtitles (for the hard of hearing) with plano-stereoscopic disparity for display on a high definition monitor */
- st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED;
- break;
- }
- if (st->codec->extradata) {
- if (st->codec->extradata_size == 4 && memcmp(st->codec->extradata, *pp, 4))
- avpriv_request_sample(fc, "DVB sub with multiple IDs");
- } else {
- if (!ff_alloc_extradata(st->codec, 4)) {
- memcpy(st->codec->extradata, *pp, 4);
+ {
+ /* 8 bytes per DVB subtitle substream data:
+ * ISO_639_language_code (3 bytes),
+ * subtitling_type (1 byte),
+ * composition_page_id (2 bytes),
+ * ancillary_page_id (2 bytes) */
+ int language_count = desc_len / 8;
+
+ if (desc_len > 0 && desc_len % 8 != 0)
+ return AVERROR_INVALIDDATA;
+
+ if (language_count > 1) {
+ avpriv_request_sample(fc, "DVB subtitles with multiple languages");
+ }
+
+ if (language_count > 0) {
+ uint8_t *extradata;
+
+ /* 4 bytes per language code (3 bytes) with comma or NUL byte should fit language buffer */
+ if (language_count > sizeof(language) / 4) {
+ language_count = sizeof(language) / 4;
+ }
+
+ if (st->codec->extradata == NULL) {
+ if (ff_alloc_extradata(st->codec, language_count * 5)) {
+ return AVERROR(ENOMEM);
+ }
+ }
+
+ if (st->codec->extradata_size < language_count * 5)
+ return AVERROR_INVALIDDATA;
+
+ extradata = st->codec->extradata;
+
+ for (i = 0; i < language_count; i++) {
+ language[i * 4 + 0] = get8(pp, desc_end);
+ language[i * 4 + 1] = get8(pp, desc_end);
+ language[i * 4 + 2] = get8(pp, desc_end);
+ language[i * 4 + 3] = ',';
+
+ /* hearing impaired subtitles detection using subtitling_type */
+ switch (*pp[0]) {
+ case 0x20: /* DVB subtitles (for the hard of hearing) with no monitor aspect ratio criticality */
+ case 0x21: /* DVB subtitles (for the hard of hearing) for display on 4:3 aspect ratio monitor */
+ case 0x22: /* DVB subtitles (for the hard of hearing) for display on 16:9 aspect ratio monitor */
+ case 0x23: /* DVB subtitles (for the hard of hearing) for display on 2.21:1 aspect ratio monitor */
+ case 0x24: /* DVB subtitles (for the hard of hearing) for display on a high definition monitor */
+ case 0x25: /* DVB subtitles (for the hard of hearing) with plano-stereoscopic disparity for display on a high definition monitor */
+ st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED;
+ break;
+ }
+
+ extradata[4] = get8(pp, desc_end); /* subtitling_type */
+ memcpy(extradata, *pp, 4); /* composition_page_id and ancillary_page_id */
+ extradata += 5;
+
+ *pp += 4;
+ }
+
+ language[i * 4 - 1] = 0;
+ av_dict_set(&st->metadata, "language", language, 0);
}
}
- *pp += 4;
- av_dict_set(&st->metadata, "language", language, 0);
break;
case 0x0a: /* ISO 639 language descriptor */
for (i = 0; i + 4 <= desc_len; i += 4) {
@@ -1480,11 +1650,17 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
language[i + 1] = get8(pp, desc_end);
language[i + 2] = get8(pp, desc_end);
language[i + 3] = ',';
- switch (get8(pp, desc_end)) {
- case 0x01: st->disposition |= AV_DISPOSITION_CLEAN_EFFECTS; break;
- case 0x02: st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED; break;
- case 0x03: st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED; break;
- }
+ switch (get8(pp, desc_end)) {
+ case 0x01:
+ st->disposition |= AV_DISPOSITION_CLEAN_EFFECTS;
+ break;
+ case 0x02:
+ st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED;
+ break;
+ case 0x03:
+ st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
+ break;
+ }
}
if (i) {
language[i - 1] = 0;
@@ -1493,7 +1669,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
break;
case 0x05: /* registration descriptor */
st->codec->codec_tag = bytestream_get_le32(pp);
- av_dlog(fc, "reg_desc=%.4s\n", (char*)&st->codec->codec_tag);
+ av_dlog(fc, "reg_desc=%.4s\n", (char *)&st->codec->codec_tag);
if (st->codec->codec_id == AV_CODEC_ID_NONE)
mpegts_find_stream_type(st, st->codec->codec_tag, REGD_types);
break;
@@ -1527,8 +1703,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
int desc_list_len;
uint32_t prog_reg_desc = 0; /* registration descriptor */
- Mp4Descr mp4_descr[MAX_MP4_DESCR_COUNT] = {{ 0 }};
int mp4_descr_count = 0;
+ Mp4Descr mp4_descr[MAX_MP4_DESCR_COUNT] = { { 0 } };
int i;
av_dlog(ts->stream, "PMT: len %i\n", section_len);
@@ -1540,7 +1716,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
return;
av_dlog(ts->stream, "sid=0x%x sec_num=%d/%d\n",
- h->id, h->sec_num, h->last_sec_num);
+ h->id, h->sec_num, h->last_sec_num);
if (h->tid != PMT_TID)
return;
@@ -1559,15 +1735,15 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (program_info_length < 0)
return;
program_info_length &= 0xfff;
- while(program_info_length >= 2) {
+ while (program_info_length >= 2) {
uint8_t tag, len;
tag = get8(&p, p_end);
len = get8(&p, p_end);
av_dlog(ts->stream, "program tag: 0x%02x len=%d\n", tag, len);
- if(len > program_info_length - 2)
- //something else is broken, exit the program_descriptors_loop
+ if (len > program_info_length - 2)
+ // something else is broken, exit the program_descriptors_loop
break;
program_info_length -= len + 2;
if (tag == 0x1d) { // IOD descriptor
@@ -1590,7 +1766,10 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (!ts->stream->nb_streams)
ts->stop_parse = 2;
- for(;;) {
+ set_pmt_found(ts, h->id);
+
+
+ for (;;) {
st = 0;
pes = NULL;
stream_type = get8(&p, p_end);
@@ -1598,23 +1777,24 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
break;
pid = get16(&p, p_end);
if (pid < 0)
- break;
+ goto out;
pid &= 0x1fff;
if (pid == ts->current_pid)
- break;
+ goto out;
/* now create stream */
if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {
pes = ts->pids[pid]->u.pes_filter.opaque;
if (!pes->st) {
- pes->st = avformat_new_stream(pes->stream, NULL);
+ pes->st = avformat_new_stream(pes->stream, NULL);
if (!pes->st)
goto out;
pes->st->id = pes->pid;
}
st = pes->st;
} else if (stream_type != 0x13) {
- if (ts->pids[pid]) mpegts_close_filter(ts, ts->pids[pid]); //wrongly added sdt filter probably
+ if (ts->pids[pid])
+ mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt filter probably
pes = add_pes_stream(ts, pid, pcr_pid);
if (pes) {
st = avformat_new_stream(pes->stream, NULL);
@@ -1647,25 +1827,31 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
desc_list_len = get16(&p, p_end);
if (desc_list_len < 0)
- break;
+ goto out;
desc_list_len &= 0xfff;
- desc_list_end = p + desc_list_len;
+ desc_list_end = p + desc_list_len;
if (desc_list_end > p_end)
- break;
- for(;;) {
- if (ff_parse_mpeg2_descriptor(ts->stream, st, stream_type, &p, desc_list_end,
- mp4_descr, mp4_descr_count, pid, ts) < 0)
+ goto out;
+ for (;;) {
+ if (ff_parse_mpeg2_descriptor(ts->stream, st, stream_type, &p,
+ desc_list_end, mp4_descr,
+ mp4_descr_count, pid, ts) < 0)
break;
- if (pes && prog_reg_desc == AV_RL32("HDMV") && stream_type == 0x83 && pes->sub_st) {
- ff_program_add_stream_index(ts->stream, h->id, pes->sub_st->index);
+ if (pes && prog_reg_desc == AV_RL32("HDMV") &&
+ stream_type == 0x83 && pes->sub_st) {
+ ff_program_add_stream_index(ts->stream, h->id,
+ pes->sub_st->index);
pes->sub_st->codec->codec_tag = st->codec->codec_tag;
}
}
p = desc_list_end;
}
- out:
+ if (!ts->pids[pcr_pid])
+ mpegts_open_pcr_filter(ts, pcr_pid);
+
+out:
for (i = 0; i < mp4_descr_count; i++)
av_free(mp4_descr[i].dec_config_descr);
}
@@ -1682,7 +1868,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
hex_dump_debug(ts->stream, section, section_len);
p_end = section + section_len - 4;
- p = section;
+ p = section;
if (parse_section_header(h, &p, p_end) < 0)
return;
if (h->tid != PAT_TID)
@@ -1691,7 +1877,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
ts->stream->ts_id = h->id;
clear_programs(ts);
- for(;;) {
+ for (;;) {
sid = get16(&p, p_end);
if (sid < 0)
break;
@@ -1721,7 +1907,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (!ts->pids[pmt_pid])
mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1);
add_pat_entry(ts, sid);
- add_pid_to_pmt(ts, sid, 0); //add pat pid to program
+ add_pid_to_pmt(ts, sid, 0); // add pat pid to program
add_pid_to_pmt(ts, sid, pmt_pid);
}
}
@@ -1729,7 +1915,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (sid < 0) {
int i,j;
for (j=0; j<ts->stream->nb_programs; j++) {
- for (i=0; i<ts->nb_prg; i++)
+ for (i = 0; i < ts->nb_prg; i++)
if (ts->prg[i].id == ts->stream->programs[j]->id)
break;
if (i==ts->nb_prg)
@@ -1750,7 +1936,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
hex_dump_debug(ts->stream, section, section_len);
p_end = section + section_len - 4;
- p = section;
+ p = section;
if (parse_section_header(h, &p, p_end) < 0)
return;
if (h->tid != SDT_TID)
@@ -1761,7 +1947,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
val = get8(&p, p_end);
if (val < 0)
return;
- for(;;) {
+ for (;;) {
sid = get16(&p, p_end);
if (sid < 0)
break;
@@ -1772,10 +1958,10 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (desc_list_len < 0)
break;
desc_list_len &= 0xfff;
- desc_list_end = p + desc_list_len;
+ desc_list_end = p + desc_list_len;
if (desc_list_end > p_end)
break;
- for(;;) {
+ for (;;) {
desc_tag = get8(&p, desc_list_end);
if (desc_tag < 0)
break;
@@ -1785,9 +1971,9 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
break;
av_dlog(ts->stream, "tag: 0x%02x len=%d\n",
- desc_tag, desc_len);
+ desc_tag, desc_len);
- switch(desc_tag) {
+ switch (desc_tag) {
case 0x48:
service_type = get8(&p, p_end);
if (service_type < 0)
@@ -1798,9 +1984,10 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
name = getstr8(&p, p_end);
if (name) {
AVProgram *program = av_new_program(ts->stream, sid);
- if(program) {
+ if (program) {
av_dict_set(&program->metadata, "service_name", name, 0);
- av_dict_set(&program->metadata, "service_provider", provider_name, 0);
+ av_dict_set(&program->metadata, "service_provider",
+ provider_name, 0);
}
}
av_free(name);
@@ -1829,7 +2016,7 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
int64_t pos;
pid = AV_RB16(packet + 1) & 0x1fff;
- if(pid && discard_pid(ts, pid))
+ if (pid && discard_pid(ts, pid))
return 0;
is_start = packet[1] & 0x40;
tss = ts->pids[pid];
@@ -1844,32 +2031,32 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
afc = (packet[3] >> 4) & 3;
if (afc == 0) /* reserved value */
return 0;
- has_adaptation = afc & 2;
- has_payload = afc & 1;
- is_discontinuity = has_adaptation
- && packet[4] != 0 /* with length > 0 */
- && (packet[5] & 0x80); /* and discontinuity indicated */
+ has_adaptation = afc & 2;
+ has_payload = afc & 1;
+ is_discontinuity = has_adaptation &&
+ packet[4] != 0 && /* with length > 0 */
+ (packet[5] & 0x80); /* and discontinuity indicated */
/* continuity check (currently not used) */
cc = (packet[3] & 0xf);
expected_cc = has_payload ? (tss->last_cc + 1) & 0x0f : tss->last_cc;
- cc_ok = pid == 0x1FFF // null packet PID
- || is_discontinuity
- || tss->last_cc < 0
- || expected_cc == cc;
+ cc_ok = pid == 0x1FFF || // null packet PID
+ is_discontinuity ||
+ tss->last_cc < 0 ||
+ expected_cc == cc;
tss->last_cc = cc;
if (!cc_ok) {
av_log(ts->stream, AV_LOG_DEBUG,
"Continuity check failed for pid %d expected %d got %d\n",
pid, expected_cc, cc);
- if(tss->type == MPEGTS_PES) {
+ if (tss->type == MPEGTS_PES) {
PESContext *pc = tss->u.pes_filter.opaque;
pc->flags |= AV_PKT_FLAG_CORRUPT;
}
}
- if (!has_payload)
+ if (!has_payload && tss->type != MPEGTS_PCR)
return 0;
p = packet + 4;
if (has_adaptation) {
@@ -1878,7 +2065,7 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
}
/* if past the end of packet, ignore */
p_end = packet + TS_PACKET_SIZE;
- if (p >= p_end)
+ if (p > p_end || (p == p_end && tss->type != MPEGTS_PCR))
return 0;
pos = avio_tell(ts->stream->pb);
@@ -1912,17 +2099,35 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
p, p_end - p, 0);
}
}
+
+ // stop find_stream_info from waiting for more streams
+ // when all programs have received a PMT
+ if (ts->stream->ctx_flags & AVFMTCTX_NOHEADER) {
+ int i;
+ for (i = 0; i < ts->nb_prg; i++) {
+ if (!ts->prg[i].pmt_found)
+ break;
+ }
+ if (i == ts->nb_prg && ts->nb_prg > 0) {
+ if (ts->stream->nb_streams > 1 || pos > 100000) {
+ av_log(ts->stream, AV_LOG_DEBUG, "All programs have pmt, headers found\n");
+ ts->stream->ctx_flags &= ~AVFMTCTX_NOHEADER;
+ }
+ }
+ }
+
} else {
int ret;
- int64_t pcr = -1;
int64_t pcr_h;
int pcr_l;
if (parse_pcr(&pcr_h, &pcr_l, packet) == 0)
- pcr = pcr_h * 300 + pcr_l;
+ tss->last_pcr = pcr_h * 300 + pcr_l;
// Note: The position here points actually behind the current packet.
- if ((ret = tss->u.pes_filter.pes_cb(tss, p, p_end - p, is_start,
- pos - ts->raw_packet_size, pcr)) < 0)
- return ret;
+ if (tss->type == MPEGTS_PES) {
+ if ((ret = tss->u.pes_filter.pes_cb(tss, p, p_end - p, is_start,
+ pos - ts->raw_packet_size)) < 0)
+ return ret;
+ }
}
return 0;
@@ -1931,7 +2136,7 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
static void reanalyze(MpegTSContext *ts) {
AVIOContext *pb = ts->stream->pb;
int64_t pos = avio_tell(pb);
- if(pos < 0)
+ if (pos < 0)
return;
pos -= ts->pos47_full;
if (pos == TS_PACKET_SIZE) {
@@ -1943,7 +2148,7 @@ static void reanalyze(MpegTSContext *ts) {
}
ts->size_stat_count ++;
- if(ts->size_stat_count > SIZE_STAT_THRESHOLD) {
+ if (ts->size_stat_count > SIZE_STAT_THRESHOLD) {
int newsize = 0;
if (ts->size_stat[0] > SIZE_STAT_THRESHOLD) {
newsize = TS_PACKET_SIZE;
@@ -1962,34 +2167,36 @@ static void reanalyze(MpegTSContext *ts) {
}
/* XXX: try to find a better synchro over several packets (use
- get_packet_size() ?) */
+ * get_packet_size() ?) */
static int mpegts_resync(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
int c, i;
- for(i = 0;i < MAX_RESYNC_SIZE; i++) {
+ for (i = 0; i < MAX_RESYNC_SIZE; i++) {
c = avio_r8(pb);
if (url_feof(pb))
- return -1;
+ return AVERROR_EOF;
if (c == 0x47) {
avio_seek(pb, -1, SEEK_CUR);
reanalyze(s->priv_data);
return 0;
}
}
- av_log(s, AV_LOG_ERROR, "max resync size reached, could not find sync byte\n");
+ av_log(s, AV_LOG_ERROR,
+ "max resync size reached, could not find sync byte\n");
/* no sync found */
- return -1;
+ return AVERROR_INVALIDDATA;
}
-/* return -1 if error or EOF. Return 0 if OK. */
-static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size, const uint8_t **data)
+/* return AVERROR_something if error or EOF. Return 0 if OK. */
+static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size,
+ const uint8_t **data)
{
AVIOContext *pb = s->pb;
int len;
- for(;;) {
+ for (;;) {
len = ffio_read_indirect(pb, buf, TS_PACKET_SIZE, data);
if (len != TS_PACKET_SIZE)
return len < 0 ? len : AVERROR_EOF;
@@ -2032,13 +2239,13 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
for (i = 0; i < NB_PID_MAX; i++) {
if (ts->pids[i]) {
if (ts->pids[i]->type == MPEGTS_PES) {
- PESContext *pes = ts->pids[i]->u.pes_filter.opaque;
- av_buffer_unref(&pes->buffer);
- pes->data_index = 0;
- pes->state = MPEGTS_SKIP; /* skip until pes header */
- pes->last_pcr = -1;
+ PESContext *pes = ts->pids[i]->u.pes_filter.opaque;
+ av_buffer_unref(&pes->buffer);
+ pes->data_index = 0;
+ pes->state = MPEGTS_SKIP; /* skip until pes header */
}
ts->pids[i]->last_cc = -1;
+ ts->pids[i]->last_pcr = -1;
}
}
}
@@ -2046,7 +2253,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
ts->stop_parse = 0;
packet_num = 0;
memset(packet + TS_PACKET_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
- for(;;) {
+ for (;;) {
packet_num++;
if (nb_packets != 0 && packet_num >= nb_packets ||
ts->stop_parse > 1) {
@@ -2070,41 +2277,41 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
static int mpegts_probe(AVProbeData *p)
{
- const int size= p->buf_size;
- int maxscore=0;
- int sumscore=0;
+ const int size = p->buf_size;
+ int maxscore = 0;
+ int sumscore = 0;
int i;
- int check_count= size / TS_FEC_PACKET_SIZE;
+ int check_count = size / TS_FEC_PACKET_SIZE;
#define CHECK_COUNT 10
#define CHECK_BLOCK 100
if (check_count < CHECK_COUNT)
- return -1;
+ return AVERROR_INVALIDDATA;
- for (i=0; i<check_count; i+=CHECK_BLOCK){
+ for (i = 0; i<check_count; i+=CHECK_BLOCK) {
int left = FFMIN(check_count - i, CHECK_BLOCK);
- int score = analyze(p->buf + TS_PACKET_SIZE *i, TS_PACKET_SIZE *left, TS_PACKET_SIZE , NULL);
- int dvhs_score= analyze(p->buf + TS_DVHS_PACKET_SIZE*i, TS_DVHS_PACKET_SIZE*left, TS_DVHS_PACKET_SIZE, NULL);
- int fec_score = analyze(p->buf + TS_FEC_PACKET_SIZE *i, TS_FEC_PACKET_SIZE *left, TS_FEC_PACKET_SIZE , NULL);
+ int score = analyze(p->buf + TS_PACKET_SIZE *i, TS_PACKET_SIZE *left, TS_PACKET_SIZE , NULL);
+ int dvhs_score = analyze(p->buf + TS_DVHS_PACKET_SIZE*i, TS_DVHS_PACKET_SIZE*left, TS_DVHS_PACKET_SIZE, NULL);
+ int fec_score = analyze(p->buf + TS_FEC_PACKET_SIZE *i, TS_FEC_PACKET_SIZE *left, TS_FEC_PACKET_SIZE , NULL);
score = FFMAX3(score, dvhs_score, fec_score);
sumscore += score;
maxscore = FFMAX(maxscore, score);
}
- sumscore = sumscore*CHECK_COUNT/check_count;
- maxscore = maxscore*CHECK_COUNT/CHECK_BLOCK;
+ sumscore = sumscore * CHECK_COUNT / check_count;
+ maxscore = maxscore * CHECK_COUNT / CHECK_BLOCK;
av_dlog(0, "TS score: %d %d\n", sumscore, maxscore);
- if (sumscore > 6) return AVPROBE_SCORE_MAX + sumscore - CHECK_COUNT;
- else if (maxscore > 6) return AVPROBE_SCORE_MAX/2 + sumscore - CHECK_COUNT;
- else return -1;
+ if (sumscore > 6) return AVPROBE_SCORE_MAX + sumscore - CHECK_COUNT;
+ else if (maxscore > 6) return AVPROBE_SCORE_MAX/2 + sumscore - CHECK_COUNT;
+ else
+ return AVERROR_INVALIDDATA;
}
/* return the 90kHz PCR and the extension for the 27MHz PCR. return
- (-1) if not available */
-static int parse_pcr(int64_t *ppcr_high, int *ppcr_low,
- const uint8_t *packet)
+ * (-1) if not available */
+static int parse_pcr(int64_t *ppcr_high, int *ppcr_low, const uint8_t *packet)
{
int afc, len, flags;
const uint8_t *p;
@@ -2112,21 +2319,21 @@ static int parse_pcr(int64_t *ppcr_high, int *ppcr_low,
afc = (packet[3] >> 4) & 3;
if (afc <= 1)
- return -1;
- p = packet + 4;
+ return AVERROR_INVALIDDATA;
+ p = packet + 4;
len = p[0];
p++;
if (len == 0)
- return -1;
+ return AVERROR_INVALIDDATA;
flags = *p++;
len--;
if (!(flags & 0x10))
- return -1;
+ return AVERROR_INVALIDDATA;
if (len < 6)
- return -1;
- v = AV_RB32(p);
- *ppcr_high = ((int64_t)v << 1) | (p[4] >> 7);
- *ppcr_low = ((p[4] & 1) << 8) | p[5];
+ return AVERROR_INVALIDDATA;
+ v = AV_RB32(p);
+ *ppcr_high = ((int64_t) v << 1) | (p[4] >> 7);
+ *ppcr_low = ((p[4] & 1) << 8) | p[5];
return 0;
}
@@ -2142,8 +2349,8 @@ static void seek_back(AVFormatContext *s, AVIOContext *pb, int64_t pos) {
static int mpegts_read_header(AVFormatContext *s)
{
MpegTSContext *ts = s->priv_data;
- AVIOContext *pb = s->pb;
- uint8_t buf[8*1024]={0};
+ AVIOContext *pb = s->pb;
+ uint8_t buf[8 * 1024] = {0};
int len;
int64_t pos;
@@ -2157,7 +2364,7 @@ static int mpegts_read_header(AVFormatContext *s)
av_log(s, AV_LOG_WARNING, "Could not detect TS packet size, defaulting to non-FEC/DVHS\n");
ts->raw_packet_size = TS_PACKET_SIZE;
}
- ts->stream = s;
+ ts->stream = s;
ts->auto_guess = 0;
if (s->iformat == &ff_mpegts_demuxer) {
@@ -2190,19 +2397,19 @@ static int mpegts_read_header(AVFormatContext *s)
st = avformat_new_stream(s, NULL);
if (!st)
- goto fail;
+ return AVERROR(ENOMEM);
avpriv_set_pts_info(st, 60, 1, 27000000);
st->codec->codec_type = AVMEDIA_TYPE_DATA;
- st->codec->codec_id = AV_CODEC_ID_MPEG2TS;
+ st->codec->codec_id = AV_CODEC_ID_MPEG2TS;
/* we iterate until we find two PCRs to estimate the bitrate */
- pcr_pid = -1;
- nb_pcrs = 0;
+ pcr_pid = -1;
+ nb_pcrs = 0;
nb_packets = 0;
- for(;;) {
+ for (;;) {
ret = read_packet(s, packet, ts->raw_packet_size, &data);
if (ret < 0)
- goto fail;
+ return ret;
pid = AV_RB16(data + 1) & 0x1fff;
if ((pcr_pid == -1 || pcr_pid == pid) &&
parse_pcr(&pcr_h, &pcr_l, data) == 0) {
@@ -2222,24 +2429,21 @@ static int mpegts_read_header(AVFormatContext *s)
/* NOTE1: the bitrate is computed without the FEC */
/* NOTE2: it is only the bitrate of the start of the stream */
ts->pcr_incr = (pcrs[1] - pcrs[0]) / (packet_count[1] - packet_count[0]);
- ts->cur_pcr = pcrs[0] - ts->pcr_incr * packet_count[0];
- s->bit_rate = (TS_PACKET_SIZE * 8) * 27e6 / ts->pcr_incr;
+ ts->cur_pcr = pcrs[0] - ts->pcr_incr * packet_count[0];
+ s->bit_rate = TS_PACKET_SIZE * 8 * 27e6 / ts->pcr_incr;
st->codec->bit_rate = s->bit_rate;
- st->start_time = ts->cur_pcr;
+ st->start_time = ts->cur_pcr;
av_dlog(ts->stream, "start=%0.3f pcr=%0.3f incr=%d\n",
st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr);
}
seek_back(s, pb, pos);
return 0;
- fail:
- return -1;
}
#define MAX_PACKET_READAHEAD ((128 * 1024) / 188)
-static int mpegts_raw_read_packet(AVFormatContext *s,
- AVPacket *pkt)
+static int mpegts_raw_read_packet(AVFormatContext *s, AVPacket *pkt)
{
MpegTSContext *ts = s->priv_data;
int ret, i;
@@ -2250,8 +2454,8 @@ static int mpegts_raw_read_packet(AVFormatContext *s,
if (av_new_packet(pkt, TS_PACKET_SIZE) < 0)
return AVERROR(ENOMEM);
- pkt->pos= avio_tell(s->pb);
ret = read_packet(s, pkt->data, ts->raw_packet_size, &data);
+ pkt->pos = avio_tell(s->pb);
if (ret < 0) {
av_free_packet(pkt);
return ret;
@@ -2264,12 +2468,13 @@ static int mpegts_raw_read_packet(AVFormatContext *s,
if (parse_pcr(&pcr_h, &pcr_l, pkt->data) == 0) {
/* we read the next PCR (XXX: optimize it by using a bigger buffer */
pos = avio_tell(s->pb);
- for(i = 0; i < MAX_PACKET_READAHEAD; i++) {
+ for (i = 0; i < MAX_PACKET_READAHEAD; i++) {
avio_seek(s->pb, pos + i * ts->raw_packet_size, SEEK_SET);
avio_read(s->pb, pcr_buf, 12);
if (parse_pcr(&next_pcr_h, &next_pcr_l, pcr_buf) == 0) {
/* XXX: not precise enough */
- ts->pcr_incr = ((next_pcr_h - pcr_h) * 300 + (next_pcr_l - pcr_l)) /
+ ts->pcr_incr =
+ ((next_pcr_h - pcr_h) * 300 + (next_pcr_l - pcr_l)) /
(i + 1);
break;
}
@@ -2278,16 +2483,15 @@ static int mpegts_raw_read_packet(AVFormatContext *s,
/* no next PCR found: we use previous increment */
ts->cur_pcr = pcr_h * 300 + pcr_l;
}
- pkt->pts = ts->cur_pcr;
+ pkt->pts = ts->cur_pcr;
pkt->duration = ts->pcr_incr;
- ts->cur_pcr += ts->pcr_incr;
+ ts->cur_pcr += ts->pcr_incr;
}
pkt->stream_index = 0;
return 0;
}
-static int mpegts_read_packet(AVFormatContext *s,
- AVPacket *pkt)
+static int mpegts_read_packet(AVFormatContext *s, AVPacket *pkt)
{
MpegTSContext *ts = s->priv_data;
int ret, i;
@@ -2298,7 +2502,7 @@ static int mpegts_read_packet(AVFormatContext *s,
if (ret < 0) {
av_free_packet(ts->pkt);
/* flush pes data left */
- for (i = 0; i < NB_PID_MAX; i++) {
+ for (i = 0; i < NB_PID_MAX; i++)
if (ts->pids[i] && ts->pids[i]->type == MPEGTS_PES) {
PESContext *pes = ts->pids[i]->u.pes_filter.opaque;
if (pes->state == MPEGTS_PAYLOAD && pes->data_index > 0) {
@@ -2308,7 +2512,6 @@ static int mpegts_read_packet(AVFormatContext *s,
break;
}
}
- }
}
if (!ret && pkt->size < 0)
@@ -2322,8 +2525,9 @@ static void mpegts_free(MpegTSContext *ts)
clear_programs(ts);
- for(i=0;i<NB_PID_MAX;i++)
- if (ts->pids[i]) mpegts_close_filter(ts, ts->pids[i]);
+ for (i = 0; i < NB_PID_MAX; i++)
+ if (ts->pids[i])
+ mpegts_close_filter(ts, ts->pids[i]);
}
static int mpegts_read_close(AVFormatContext *s)
@@ -2339,9 +2543,12 @@ static av_unused int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
MpegTSContext *ts = s->priv_data;
int64_t pos, timestamp;
uint8_t buf[TS_PACKET_SIZE];
- int pcr_l, pcr_pid = ((PESContext*)s->streams[stream_index]->priv_data)->pcr_pid;
+ int pcr_l, pcr_pid =
+ ((PESContext *)s->streams[stream_index]->priv_data)->pcr_pid;
int pos47 = ts->pos47_full % ts->raw_packet_size;
- pos = ((*ppos + ts->raw_packet_size - 1 - pos47) / ts->raw_packet_size) * ts->raw_packet_size + pos47;
+ pos =
+ ((*ppos + ts->raw_packet_size - 1 - pos47) / ts->raw_packet_size) *
+ ts->raw_packet_size + pos47;
while(pos < pos_limit) {
if (avio_seek(s->pb, pos, SEEK_SET) < 0)
return AV_NOPTS_VALUE;
@@ -2379,15 +2586,15 @@ static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index,
int ret;
AVPacket pkt;
av_init_packet(&pkt);
- ret= av_read_frame(s, &pkt);
- if(ret < 0)
+ ret = av_read_frame(s, &pkt);
+ if (ret < 0)
return AV_NOPTS_VALUE;
av_free_packet(&pkt);
- if(pkt.dts != AV_NOPTS_VALUE && pkt.pos >= 0){
+ if (pkt.dts != AV_NOPTS_VALUE && pkt.pos >= 0) {
ff_reduce_index(s, pkt.stream_index);
av_add_index_entry(s->streams[pkt.stream_index], pkt.pos, pkt.dts, 0, 0, AVINDEX_KEYFRAME /* FIXME keyframe? */);
- if(pkt.stream_index == stream_index && pkt.pos >= *ppos){
- *ppos= pkt.pos;
+ if (pkt.stream_index == stream_index && pkt.pos >= *ppos) {
+ *ppos = pkt.pos;
return pkt.dts;
}
}
@@ -2418,18 +2625,18 @@ MpegTSContext *ff_mpegts_parse_open(AVFormatContext *s)
}
/* return the consumed length if a packet was output, or -1 if no
- packet is output */
+ * packet is output */
int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
- const uint8_t *buf, int len)
+ const uint8_t *buf, int len)
{
int len1;
len1 = len;
ts->pkt = pkt;
- for(;;) {
+ for (;;) {
ts->stop_parse = 0;
if (len < TS_PACKET_SIZE)
- return -1;
+ return AVERROR_INVALIDDATA;
if (buf[0] != 0x47) {
buf++;
len--;
diff --git a/chromium/third_party/ffmpeg/libavformat/mpegts.h b/chromium/third_party/ffmpeg/libavformat/mpegts.h
index 269c23b9257..7dfe844bdb0 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpegts.h
+++ b/chromium/third_party/ffmpeg/libavformat/mpegts.h
@@ -52,12 +52,14 @@
#define STREAM_TYPE_AUDIO_AAC_LATM 0x11
#define STREAM_TYPE_VIDEO_MPEG4 0x10
#define STREAM_TYPE_VIDEO_H264 0x1b
+#define STREAM_TYPE_VIDEO_HEVC 0x24 //Definition of 0x24 HEVC video MPEG TS stream type
#define STREAM_TYPE_VIDEO_CAVS 0x42
#define STREAM_TYPE_VIDEO_VC1 0xea
#define STREAM_TYPE_VIDEO_DIRAC 0xd1
#define STREAM_TYPE_AUDIO_AC3 0x81
-#define STREAM_TYPE_AUDIO_DTS 0x8a
+#define STREAM_TYPE_AUDIO_DTS 0x82
+#define STREAM_TYPE_AUDIO_TRUEHD 0x83
typedef struct MpegTSContext MpegTSContext;
@@ -104,4 +106,10 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
Mp4Descr *mp4_descr, int mp4_descr_count, int pid,
MpegTSContext *ts);
+/**
+ * Check presence of H264 startcode
+ * @return <0 to stop processing
+ */
+int ff_check_h264_startcode(AVFormatContext *s, const AVStream *st, const AVPacket *pkt);
+
#endif /* AVFORMAT_MPEGTS_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/mpegtsenc.c b/chromium/third_party/ffmpeg/libavformat/mpegtsenc.c
index 1d51b97bdf0..48477614fed 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpegtsenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpegtsenc.c
@@ -86,6 +86,8 @@ typedef struct MpegTSWrite {
int flags;
int copyts;
int tables_version;
+
+ int omit_video_pes_length;
} MpegTSWrite;
/* a PES packet header is generated every DEFAULT_PES_HEADER_FREQ packets */
@@ -124,6 +126,8 @@ static const AVOption options[] = {
offsetof(MpegTSWrite, copyts), AV_OPT_TYPE_INT, {.i64=-1}, -1, 1, AV_OPT_FLAG_ENCODING_PARAM},
{ "tables_version", "set PAT, PMT and SDT version",
offsetof(MpegTSWrite, tables_version), AV_OPT_TYPE_INT, {.i64=0}, 0, 31, AV_OPT_FLAG_ENCODING_PARAM},
+ { "omit_video_pes_length", "Omit the PES packet length for video packets",
+ offsetof(MpegTSWrite, omit_video_pes_length), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL },
};
@@ -259,7 +263,7 @@ static void mpegts_write_pat(AVFormatContext *s)
data, q - data);
}
-static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
+static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
{
MpegTSWrite *ts = s->priv_data;
uint8_t data[1012], *q, *desc_length_ptr, *program_info_length_ptr;
@@ -292,6 +296,9 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
case AV_CODEC_ID_H264:
stream_type = STREAM_TYPE_VIDEO_H264;
break;
+ case AV_CODEC_ID_HEVC:
+ stream_type = STREAM_TYPE_VIDEO_HEVC;
+ break;
case AV_CODEC_ID_CAVS:
stream_type = STREAM_TYPE_VIDEO_CAVS;
break;
@@ -311,10 +318,20 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
case AV_CODEC_ID_AC3:
stream_type = STREAM_TYPE_AUDIO_AC3;
break;
+ case AV_CODEC_ID_DTS:
+ stream_type = STREAM_TYPE_AUDIO_DTS;
+ break;
+ case AV_CODEC_ID_TRUEHD:
+ stream_type = STREAM_TYPE_AUDIO_TRUEHD;
+ break;
default:
stream_type = STREAM_TYPE_PRIVATE_DATA;
break;
}
+
+ if (q - data > sizeof(data) - 32)
+ return AVERROR(EINVAL);
+
*q++ = stream_type;
put16(&q, 0xe000 | ts_st->pid);
desc_length_ptr = q;
@@ -346,7 +363,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
len_ptr = q++;
*len_ptr = 0;
- for (p = lang->value; next && *len_ptr < 255 / 4 * 4; p = next + 1) {
+ for (p = lang->value; next && *len_ptr < 255 / 4 * 4 && q - data < sizeof(data) - 4; p = next + 1) {
next = strchr(p, ',');
if (strlen(p) != 3 && (!next || next != p + 3))
continue; /* not a 3-letter code */
@@ -373,21 +390,79 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
break;
case AVMEDIA_TYPE_SUBTITLE:
{
- const char *language;
- language = lang && strlen(lang->value)==3 ? lang->value : "eng";
- *q++ = 0x59;
- *q++ = 8;
- *q++ = language[0];
- *q++ = language[1];
- *q++ = language[2];
- *q++ = 0x10; /* normal subtitles (0x20 = if hearing pb) */
- if(st->codec->extradata_size == 4) {
- memcpy(q, st->codec->extradata, 4);
- q += 4;
- } else {
- put16(&q, 1); /* page id */
- put16(&q, 1); /* ancillary page id */
- }
+ const char default_language[] = "und";
+ const char *language = lang && strlen(lang->value) >= 3 ? lang->value : default_language;
+
+ if (st->codec->codec_id == AV_CODEC_ID_DVB_SUBTITLE) {
+ uint8_t *len_ptr;
+ int extradata_copied = 0;
+
+ *q++ = 0x59; /* subtitling_descriptor */
+ len_ptr = q++;
+
+ while (strlen(language) >= 3 && (sizeof(data) - (q - data)) >= 8) { /* 8 bytes per DVB subtitle substream data */
+ *q++ = *language++;
+ *q++ = *language++;
+ *q++ = *language++;
+ /* Skip comma */
+ if (*language != '\0')
+ language++;
+
+ if (st->codec->extradata_size - extradata_copied >= 5) {
+ *q++ = st->codec->extradata[extradata_copied + 4]; /* subtitling_type */
+ memcpy(q, st->codec->extradata + extradata_copied, 4); /* composition_page_id and ancillary_page_id */
+ extradata_copied += 5;
+ q += 4;
+ } else {
+ /* subtitling_type:
+ * 0x10 - normal with no monitor aspect ratio criticality
+ * 0x20 - for the hard of hearing with no monitor aspect ratio criticality */
+ *q++ = (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED) ? 0x20 : 0x10;
+ if ((st->codec->extradata_size == 4) && (extradata_copied == 0)) {
+ /* support of old 4-byte extradata format */
+ memcpy(q, st->codec->extradata, 4); /* composition_page_id and ancillary_page_id */
+ extradata_copied += 4;
+ q += 4;
+ } else {
+ put16(&q, 1); /* composition_page_id */
+ put16(&q, 1); /* ancillary_page_id */
+ }
+ }
+ }
+
+ *len_ptr = q - len_ptr - 1;
+ } else if (st->codec->codec_id == AV_CODEC_ID_DVB_TELETEXT) {
+ uint8_t *len_ptr = NULL;
+ int extradata_copied = 0;
+
+ /* The descriptor tag. teletext_descriptor */
+ *q++ = 0x56;
+ len_ptr = q++;
+
+ while (strlen(language) >= 3 && q - data < sizeof(data) - 6) {
+ *q++ = *language++;
+ *q++ = *language++;
+ *q++ = *language++;
+ /* Skip comma */
+ if (*language != '\0')
+ language++;
+
+ if (st->codec->extradata_size - 1 > extradata_copied) {
+ memcpy(q, st->codec->extradata + extradata_copied, 2);
+ extradata_copied += 2;
+ q += 2;
+ } else {
+ /* The Teletext descriptor:
+ * teletext_type: This 5-bit field indicates the type of Teletext page indicated. (0x01 Initial Teletext page)
+ * teletext_magazine_number: This is a 3-bit field which identifies the magazine number.
+ * teletext_page_number: This is an 8-bit field giving two 4-bit hex digits identifying the page number. */
+ *q++ = 0x08;
+ *q++ = 0x00;
+ }
+ }
+
+ *len_ptr = q - len_ptr - 1;
+ }
}
break;
case AVMEDIA_TYPE_VIDEO:
@@ -418,6 +493,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
}
mpegts_write_section1(&service->pmt, PMT_TID, service->sid, ts->tables_version, 0, 0,
data, q - data);
+ return 0;
}
/* NOTE: str == NULL is accepted for an empty string */
@@ -562,7 +638,7 @@ static int mpegts_write_header(AVFormatContext *s)
ts->sdt.write_packet = section_write_packet;
ts->sdt.opaque = s;
- pids = av_malloc(s->nb_streams * sizeof(*pids));
+ pids = av_malloc_array(s->nb_streams, sizeof(*pids));
if (!pids)
return AVERROR(ENOMEM);
@@ -630,6 +706,10 @@ static int mpegts_write_header(AVFormatContext *s)
goto fail;
}
ast = avformat_new_stream(ts_st->amux, NULL);
+ if (!ast) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
ret = avcodec_copy_context(ast->codec, st->codec);
if (ret != 0)
goto fail;
@@ -859,7 +939,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
MpegTSWrite *ts = s->priv_data;
uint8_t buf[TS_PACKET_SIZE];
uint8_t *q;
- int val, is_start, len, header_len, write_pcr, private_code, flags;
+ int val, is_start, len, header_len, write_pcr, is_dvb_subtitle, is_dvb_teletext, flags;
int afc_len, stuffing_len;
int64_t pcr = -1; /* avoid warning */
int64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE);
@@ -923,11 +1003,13 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
}
if (is_start) {
int pes_extension = 0;
+ int pes_header_stuffing_bytes = 0;
/* write PES header */
*q++ = 0x00;
*q++ = 0x00;
*q++ = 0x01;
- private_code = 0;
+ is_dvb_subtitle = 0;
+ is_dvb_teletext = 0;
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
if (st->codec->codec_id == AV_CODEC_ID_DIRAC) {
*q++ = 0xfd;
@@ -944,8 +1026,12 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
*q++ = 0xfd;
} else {
*q++ = 0xbd;
- if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
- private_code = 0x20;
+ if(st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
+ if (st->codec->codec_id == AV_CODEC_ID_DVB_SUBTITLE) {
+ is_dvb_subtitle = 1;
+ } else if (st->codec->codec_id == AV_CODEC_ID_DVB_TELETEXT) {
+ is_dvb_teletext = 1;
+ }
}
}
header_len = 0;
@@ -982,11 +1068,21 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
flags |= 0x01;
header_len += 3;
}
+ if (is_dvb_teletext) {
+ pes_header_stuffing_bytes = 0x24 - header_len;
+ header_len = 0x24;
+ }
len = payload_size + header_len + 3;
- if (private_code != 0)
- len++;
+ /* 3 extra bytes should be added to DVB subtitle payload: 0x20 0x00 at the beginning and trailing 0xff */
+ if (is_dvb_subtitle) {
+ len += 3;
+ payload_size++;
+ }
if (len > 0xffff)
len = 0;
+ if (ts->omit_video_pes_length && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ len = 0;
+ }
*q++ = len >> 8;
*q++ = len;
val = 0x80;
@@ -1025,8 +1121,17 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
}
- if (private_code != 0)
- *q++ = private_code;
+ if (is_dvb_subtitle) {
+ /* First two fields of DVB subtitles PES data:
+ * data_identifier: for DVB subtitle streams shall be coded with the value 0x20
+ * subtitle_stream_id: for DVB subtitle stream shall be identified by the value 0x00 */
+ *q++ = 0x20;
+ *q++ = 0x00;
+ }
+ if (is_dvb_teletext) {
+ memset(q, 0xff, pes_header_stuffing_bytes);
+ q += pes_header_stuffing_bytes;
+ }
is_start = 0;
}
/* header size */
@@ -1057,7 +1162,14 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
}
}
}
- memcpy(buf + TS_PACKET_SIZE - len, payload, len);
+
+ if (is_dvb_subtitle && payload_size == len) {
+ memcpy(buf + TS_PACKET_SIZE - len, payload, len - 1);
+ buf[TS_PACKET_SIZE - 1] = 0xff; /* end_of_PES_data_field_marker: an 8-bit field with fixed contents 0xff for DVB subtitle */
+ } else {
+ memcpy(buf + TS_PACKET_SIZE - len, payload, len);
+ }
+
payload += len;
payload_size -= len;
mpegts_prefix_m2ts_header(s);
@@ -1067,6 +1179,19 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
ts_st->prev_payload_key = key;
}
+int ff_check_h264_startcode(AVFormatContext *s, const AVStream *st, const AVPacket *pkt)
+{
+ if (pkt->size < 5 || AV_RB32(pkt->data) != 0x0000001) {
+ if (!st->nb_frames) {
+ av_log(s, AV_LOG_ERROR, "H.264 bitstream malformed, "
+ "no startcode found, use the h264_mp4toannexb bitstream filter (-bsf h264_mp4toannexb)\n");
+ return AVERROR(EINVAL);
+ }
+ av_log(s, AV_LOG_WARNING, "H.264 bitstream error, startcode missing\n");
+ }
+ return 0;
+}
+
static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
{
AVStream *st = s->streams[pkt->stream_index];
@@ -1106,15 +1231,9 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
if (st->codec->codec_id == AV_CODEC_ID_H264) {
const uint8_t *p = buf, *buf_end = p+size;
uint32_t state = -1;
-
- if (pkt->size < 5 || AV_RB32(pkt->data) != 0x0000001) {
- if (!st->nb_frames) {
- av_log(s, AV_LOG_ERROR, "H.264 bitstream malformed, "
- "no startcode found, use the h264_mp4toannexb bitstream filter (-bsf h264_mp4toannexb)\n");
- return AVERROR(EINVAL);
- }
- av_log(s, AV_LOG_WARNING, "H.264 bitstream error, startcode missing\n");
- }
+ int ret = ff_check_h264_startcode(s, st, pkt);
+ if (ret < 0)
+ return ret;
do {
p = avpriv_find_start_code(p, buf_end, &state);
diff --git a/chromium/third_party/ffmpeg/libavformat/mtv.c b/chromium/third_party/ffmpeg/libavformat/mtv.c
index 0517dd2d835..b449d5886f1 100644
--- a/chromium/third_party/ffmpeg/libavformat/mtv.c
+++ b/chromium/third_party/ffmpeg/libavformat/mtv.c
@@ -32,7 +32,8 @@
#define MTV_ASUBCHUNK_DATA_SIZE 500
#define MTV_HEADER_SIZE 512
#define MTV_AUDIO_PADDING_SIZE 12
-#define AUDIO_SAMPLING_RATE 44100
+#define MTV_IMAGE_DEFAULT_BPP 16
+#define MTV_AUDIO_SAMPLING_RATE 44100
typedef struct MTVDemuxContext {
@@ -52,12 +53,22 @@ typedef struct MTVDemuxContext {
static int mtv_probe(AVProbeData *p)
{
+ /* we need at least 57 bytes from the header
+ * to try parsing all required fields
+ */
+ if (p->buf_size < 57)
+ return 0;
+
/* Magic is 'AMV' */
if (*p->buf != 'A' || *(p->buf + 1) != 'M' || *(p->buf + 2) != 'V')
return 0;
+ /* Audio magic is always MP3 */
+ if (p->buf[43] != 'M' || p->buf[44] != 'P' || p->buf[45] != '3')
+ return 0;
+
/* Check for nonzero in bpp and (width|height) header fields */
- if(p->buf_size < 57 || !(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54])))
+ 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 */
@@ -69,8 +80,20 @@ static int mtv_probe(AVProbeData *p)
return 0;
}
- if(p->buf[51] != 16)
- return AVPROBE_SCORE_EXTENSION / 2; // But we are going to assume 16bpp anyway ..
+ /* Image bpp is not an absolutely required
+ * field as we latter claim it should be 16
+ * no matter what. All samples in the wild
+ * are RGB565/555.
+ */
+ if(p->buf[51] != MTV_IMAGE_DEFAULT_BPP)
+ return AVPROBE_SCORE_EXTENSION / 2;
+
+ /* We had enough data to parse header values
+ * but we expect to be able to get 512 bytes
+ * of header to be sure.
+ */
+ if (p->buf_size < MTV_HEADER_SIZE)
+ return AVPROBE_SCORE_EXTENSION;
return AVPROBE_SCORE_MAX;
}
@@ -89,22 +112,30 @@ static int mtv_read_header(AVFormatContext *s)
mtv->audio_identifier = avio_rl24(pb);
mtv->audio_br = avio_rl16(pb);
mtv->img_colorfmt = avio_rl24(pb);
- mtv->img_bpp = avio_r8(pb);
+ mtv->img_bpp = avio_r8(pb)>>3;
mtv->img_width = avio_rl16(pb);
mtv->img_height = avio_rl16(pb);
mtv->img_segment_size = avio_rl16(pb);
+ /* Assume 16bpp even if claimed otherwise.
+ * We know its going to be RGBG565/555 anyway
+ */
+ if (mtv->img_bpp != MTV_IMAGE_DEFAULT_BPP) {
+ av_log (s, AV_LOG_WARNING, "Header claims %dbpp (!= 16). Ignoring\n",
+ mtv->img_bpp);
+ mtv->img_bpp = MTV_IMAGE_DEFAULT_BPP;
+ }
+
/* Calculate width and height if missing from header */
- if(mtv->img_bpp>>3){
if(!mtv->img_width && mtv->img_height)
- mtv->img_width=mtv->img_segment_size / (mtv->img_bpp>>3)
+ mtv->img_width=mtv->img_segment_size / (mtv->img_bpp)
/ mtv->img_height;
if(!mtv->img_height && mtv->img_width)
- mtv->img_height=mtv->img_segment_size / (mtv->img_bpp>>3)
+ mtv->img_height=mtv->img_segment_size / (mtv->img_bpp)
/ mtv->img_width;
- }
+
if(!mtv->img_height || !mtv->img_width || !mtv->img_segment_size){
av_log(s, AV_LOG_ERROR, "width or height or segment_size is invalid and I cannot calculate them from other information\n");
return AVERROR(EINVAL);
@@ -149,7 +180,7 @@ static int mtv_read_header(AVFormatContext *s)
if(!st)
return AVERROR(ENOMEM);
- avpriv_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE);
+ avpriv_set_pts_info(st, 64, 1, MTV_AUDIO_SAMPLING_RATE);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_MP3;
st->codec->bit_rate = mtv->audio_br;
diff --git a/chromium/third_party/ffmpeg/libavformat/mux.c b/chromium/third_party/ffmpeg/libavformat/mux.c
index 79625c6547c..a3a63f29a53 100644
--- a/chromium/third_party/ffmpeg/libavformat/mux.c
+++ b/chromium/third_party/ffmpeg/libavformat/mux.c
@@ -102,7 +102,7 @@ static void frac_add(AVFrac *f, int64_t incr)
f->num = num;
}
-AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precission)
+AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precision)
{
AVRational q;
int j;
@@ -113,9 +113,9 @@ AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precissi
q = st->codec->time_base;
}
for (j=2; j<14; j+= 1+(j>2))
- while (q.den / q.num < min_precission && q.num % j == 0)
+ while (q.den / q.num < min_precision && q.num % j == 0)
q.num /= j;
- while (q.den / q.num < min_precission && q.den < (1<<24))
+ while (q.den / q.num < min_precision && q.den < (1<<24))
q.den <<= 1;
return q;
@@ -189,7 +189,7 @@ static int validate_codec_tag(AVFormatContext *s, AVStream *st)
const AVCodecTag *avctag;
int n;
enum AVCodecID id = AV_CODEC_ID_NONE;
- unsigned int tag = 0;
+ int64_t tag = -1;
/**
* Check that tag + id is in the table
@@ -212,7 +212,7 @@ static int validate_codec_tag(AVFormatContext *s, AVStream *st)
}
if (id != AV_CODEC_ID_NONE)
return 0;
- if (tag && (st->codec->strict_std_compliance >= FF_COMPLIANCE_NORMAL))
+ if (tag >= 0 && (st->codec->strict_std_compliance >= FF_COMPLIANCE_NORMAL))
return 0;
return 1;
}
@@ -232,12 +232,17 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
if ((ret = av_opt_set_dict(s, &tmp)) < 0)
goto fail;
if (s->priv_data && s->oformat->priv_class && *(const AVClass**)s->priv_data==s->oformat->priv_class &&
- (ret = av_opt_set_dict(s->priv_data, &tmp)) < 0)
+ (ret = av_opt_set_dict2(s->priv_data, &tmp, AV_OPT_SEARCH_CHILDREN)) < 0)
goto fail;
+#if FF_API_LAVF_BITEXACT
+ if (s->nb_streams && s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)
+ s->flags |= AVFMT_FLAG_BITEXACT;
+#endif
+
// some sanity checks
if (s->nb_streams == 0 && !(of->flags & AVFMT_NOSTREAMS)) {
- av_log(s, AV_LOG_ERROR, "no streams\n");
+ av_log(s, AV_LOG_ERROR, "No streams to mux were specified\n");
ret = AVERROR(EINVAL);
goto fail;
}
@@ -320,6 +325,9 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
av_log(s, AV_LOG_WARNING,
"Codec for stream %d does not use global headers "
"but container format requires global headers\n", i);
+
+ if (codec->codec_type != AVMEDIA_TYPE_ATTACHMENT)
+ s->internal->nb_interleaved_streams++;
}
if (!s->priv_data && of->priv_data_size > 0) {
@@ -331,13 +339,13 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
if (of->priv_class) {
*(const AVClass **)s->priv_data = of->priv_class;
av_opt_set_defaults(s->priv_data);
- if ((ret = av_opt_set_dict(s->priv_data, &tmp)) < 0)
+ if ((ret = av_opt_set_dict2(s->priv_data, &tmp, AV_OPT_SEARCH_CHILDREN)) < 0)
goto fail;
}
}
/* set muxer identification string */
- if (s->nb_streams && !(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(s->flags & AVFMT_FLAG_BITEXACT)) {
av_dict_set(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0);
} else {
av_dict_set(&s->metadata, "encoder", NULL, 0);
@@ -414,6 +422,15 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
return 0;
}
+#define AV_PKT_FLAG_UNCODED_FRAME 0x2000
+
+/* Note: using sizeof(AVFrame) from outside lavu is unsafe in general, but
+ it is only being used internally to this file as a consistency check.
+ The value is chosen to be very unlikely to appear on its own and to cause
+ immediate failure if used anywhere as a real size. */
+#define UNCODED_FRAME_PACKET_SIZE (INT_MIN / 3 * 2 + (int)sizeof(AVFrame))
+
+
//FIXME merge with compute_pkt_fields
static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
{
@@ -423,6 +440,12 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
av_dlog(s, "compute_pkt_fields2: pts:%s dts:%s cur_dts:%s b:%d size:%d st:%d\n",
av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), delay, pkt->size, pkt->stream_index);
+ if (pkt->duration < 0 && st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) {
+ av_log(s, AV_LOG_WARNING, "Packet with invalid duration %d in stream %d\n",
+ pkt->duration, pkt->stream_index);
+ pkt->duration = 0;
+ }
+
/* duration field */
if (pkt->duration == 0) {
ff_compute_frame_duration(&num, &den, st, NULL, pkt);
@@ -479,7 +502,9 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
/* update pts */
switch (st->codec->codec_type) {
case AVMEDIA_TYPE_AUDIO:
- frame_size = ff_get_audio_frame_size(st->codec, pkt->size, 1);
+ frame_size = (pkt->flags & AV_PKT_FLAG_UNCODED_FRAME) ?
+ ((AVFrame *)pkt->data)->nb_samples :
+ ff_get_audio_frame_size(st->codec, pkt->size, 1);
/* HACK/FIXME, we skip the initial 0 size packets as they are most
* likely equal to the encoder delay, but it would be better if we
@@ -510,11 +535,21 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret, did_split;
+ if (s->output_ts_offset) {
+ AVStream *st = s->streams[pkt->stream_index];
+ int64_t offset = av_rescale_q(s->output_ts_offset, AV_TIME_BASE_Q, st->time_base);
+
+ if (pkt->dts != AV_NOPTS_VALUE)
+ pkt->dts += offset;
+ if (pkt->pts != AV_NOPTS_VALUE)
+ pkt->pts += offset;
+ }
+
if (s->avoid_negative_ts > 0) {
AVStream *st = s->streams[pkt->stream_index];
int64_t offset = st->mux_ts_offset;
- if (pkt->dts < 0 && pkt->dts != AV_NOPTS_VALUE && !s->offset) {
+ if ((pkt->dts < 0 || s->avoid_negative_ts == 2) && pkt->dts != AV_NOPTS_VALUE && !s->offset) {
s->offset = -pkt->dts;
s->offset_timebase = st->time_base;
}
@@ -536,7 +571,14 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
}
did_split = av_packet_split_side_data(pkt);
- ret = s->oformat->write_packet(s, pkt);
+ if ((pkt->flags & AV_PKT_FLAG_UNCODED_FRAME)) {
+ AVFrame *frame = (AVFrame *)pkt->data;
+ av_assert0(pkt->size == UNCODED_FRAME_PACKET_SIZE);
+ ret = s->oformat->write_uncoded_frame(s, pkt->stream_index, &frame, 0);
+ av_frame_free(&frame);
+ } else {
+ ret = s->oformat->write_packet(s, pkt);
+ }
if (s->flush_packets && s->pb && ret >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
avio_flush(s->pb);
@@ -547,10 +589,33 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
+static int check_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ if (!pkt)
+ return 0;
+
+ if (pkt->stream_index < 0 || pkt->stream_index >= s->nb_streams) {
+ av_log(s, AV_LOG_ERROR, "Invalid packet stream index: %d\n",
+ pkt->stream_index);
+ return AVERROR(EINVAL);
+ }
+
+ if (s->streams[pkt->stream_index]->codec->codec_type == AVMEDIA_TYPE_ATTACHMENT) {
+ av_log(s, AV_LOG_ERROR, "Received a packet for an attachment stream.\n");
+ return AVERROR(EINVAL);
+ }
+
+ return 0;
+}
+
int av_write_frame(AVFormatContext *s, AVPacket *pkt)
{
int ret;
+ ret = check_packet(s, pkt);
+ if (ret < 0)
+ return ret;
+
if (!pkt) {
if (s->oformat->flags & AVFMT_ALLOW_FLUSH) {
ret = s->oformat->write_packet(s, NULL);
@@ -585,6 +650,7 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
AVPacketList **next_point, *this_pktl;
AVStream *st = s->streams[pkt->stream_index];
int chunked = s->max_chunk_size || s->max_chunk_duration;
+ int ret;
this_pktl = av_mallocz(sizeof(AVPacketList));
if (!this_pktl)
@@ -596,8 +662,17 @@ FF_DISABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
#endif
pkt->buf = NULL;
- av_dup_packet(&this_pktl->pkt); // duplicate the packet if it uses non-allocated memory
- av_copy_packet_side_data(&this_pktl->pkt, &this_pktl->pkt); // copy side data
+ if ((pkt->flags & AV_PKT_FLAG_UNCODED_FRAME)) {
+ av_assert0(pkt->size == UNCODED_FRAME_PACKET_SIZE);
+ av_assert0(((AVFrame *)pkt->data)->buf);
+ } else {
+ // duplicate the packet if it uses non-allocated memory
+ if ((ret = av_dup_packet(&this_pktl->pkt)) < 0) {
+ av_free(this_pktl);
+ return ret;
+ }
+ av_copy_packet_side_data(&this_pktl->pkt, &this_pktl->pkt); // copy side data
+ }
if (s->streams[pkt->stream_index]->last_in_packet_buffer) {
next_point = &(st->last_in_packet_buffer->next);
@@ -677,7 +752,6 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
{
AVPacketList *pktl;
int stream_count = 0, noninterleaved_count = 0;
- int64_t delta_dts_max = 0;
int i, ret;
if (pkt) {
@@ -694,27 +768,38 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
}
}
- if (s->nb_streams == stream_count) {
+ if (s->internal->nb_interleaved_streams == stream_count)
flush = 1;
- } else if (!flush) {
- for (i=0; i < s->nb_streams; i++) {
- if (s->streams[i]->last_in_packet_buffer) {
- int64_t delta_dts =
- av_rescale_q(s->streams[i]->last_in_packet_buffer->pkt.dts,
- s->streams[i]->time_base,
- AV_TIME_BASE_Q) -
- av_rescale_q(s->packet_buffer->pkt.dts,
- s->streams[s->packet_buffer->pkt.stream_index]->time_base,
- AV_TIME_BASE_Q);
- delta_dts_max= FFMAX(delta_dts_max, delta_dts);
- }
+
+ if (s->max_interleave_delta > 0 && s->packet_buffer && !flush) {
+ AVPacket *top_pkt = &s->packet_buffer->pkt;
+ int64_t delta_dts = INT64_MIN;
+ int64_t top_dts = av_rescale_q(top_pkt->dts,
+ s->streams[top_pkt->stream_index]->time_base,
+ AV_TIME_BASE_Q);
+
+ for (i = 0; i < s->nb_streams; i++) {
+ int64_t last_dts;
+ const AVPacketList *last = s->streams[i]->last_in_packet_buffer;
+
+ if (!last)
+ continue;
+
+ last_dts = av_rescale_q(last->pkt.dts,
+ s->streams[i]->time_base,
+ AV_TIME_BASE_Q);
+ delta_dts = FFMAX(delta_dts, last_dts - top_dts);
}
- if (s->nb_streams == stream_count+noninterleaved_count &&
- delta_dts_max > 20*AV_TIME_BASE) {
- av_log(s, AV_LOG_DEBUG, "flushing with %d noninterleaved\n", noninterleaved_count);
+
+ if (delta_dts > s->max_interleave_delta) {
+ av_log(s, AV_LOG_DEBUG,
+ "Delay between the first packet and last packet in the "
+ "muxing queue is %"PRId64" > %"PRId64": forcing output\n",
+ delta_dts, s->max_interleave_delta);
flush = 1;
}
}
+
if (stream_count && flush) {
AVStream *st;
pktl = s->packet_buffer;
@@ -760,20 +845,22 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
{
int ret, flush = 0;
+ ret = check_packet(s, pkt);
+ if (ret < 0)
+ goto fail;
+
if (pkt) {
AVStream *st = s->streams[pkt->stream_index];
- //FIXME/XXX/HACK drop zero sized packets
- if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && pkt->size == 0)
- return 0;
-
av_dlog(s, "av_interleaved_write_frame size:%d dts:%s pts:%s\n",
pkt->size, av_ts2str(pkt->dts), av_ts2str(pkt->pts));
if ((ret = compute_pkt_fields2(s, st, pkt)) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
- return ret;
+ goto fail;
- if (pkt->dts == AV_NOPTS_VALUE && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
- return AVERROR(EINVAL);
+ if (pkt->dts == AV_NOPTS_VALUE && !(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
} else {
av_dlog(s, "av_interleaved_write_frame FLUSH\n");
flush = 1;
@@ -782,6 +869,11 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
for (;; ) {
AVPacket opkt;
int ret = interleave_packet(s, &opkt, pkt, flush);
+ if (pkt) {
+ memset(pkt, 0, sizeof(*pkt));
+ av_init_packet(pkt);
+ pkt = NULL;
+ }
if (ret <= 0) //FIXME cleanup needed for ret<0 ?
return ret;
@@ -790,13 +882,15 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
s->streams[opkt.stream_index]->nb_frames++;
av_free_packet(&opkt);
- pkt = NULL;
if (ret < 0)
return ret;
if(s->pb && s->pb->error)
return s->pb->error;
}
+fail:
+ av_packet_unref(pkt);
+ return ret;
}
int av_write_trailer(AVFormatContext *s)
@@ -871,3 +965,51 @@ int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
dst->streams[dst_stream]->time_base);
return av_write_frame(dst, &local_pkt);
}
+
+static int av_write_uncoded_frame_internal(AVFormatContext *s, int stream_index,
+ AVFrame *frame, int interleaved)
+{
+ AVPacket pkt, *pktp;
+
+ av_assert0(s->oformat);
+ if (!s->oformat->write_uncoded_frame)
+ return AVERROR(ENOSYS);
+
+ if (!frame) {
+ pktp = NULL;
+ } else {
+ pktp = &pkt;
+ av_init_packet(&pkt);
+ pkt.data = (void *)frame;
+ pkt.size = UNCODED_FRAME_PACKET_SIZE;
+ pkt.pts =
+ pkt.dts = frame->pts;
+ pkt.duration = av_frame_get_pkt_duration(frame);
+ pkt.stream_index = stream_index;
+ pkt.flags |= AV_PKT_FLAG_UNCODED_FRAME;
+ }
+
+ return interleaved ? av_interleaved_write_frame(s, pktp) :
+ av_write_frame(s, pktp);
+}
+
+int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
+ AVFrame *frame)
+{
+ return av_write_uncoded_frame_internal(s, stream_index, frame, 0);
+}
+
+int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index,
+ AVFrame *frame)
+{
+ return av_write_uncoded_frame_internal(s, stream_index, frame, 1);
+}
+
+int av_write_uncoded_frame_query(AVFormatContext *s, int stream_index)
+{
+ av_assert0(s->oformat);
+ if (!s->oformat->write_uncoded_frame)
+ return AVERROR(ENOSYS);
+ return s->oformat->write_uncoded_frame(s, stream_index, NULL,
+ AV_WRITE_UNCODED_FRAME_QUERY);
+}
diff --git a/chromium/third_party/ffmpeg/libavformat/mvdec.c b/chromium/third_party/ffmpeg/libavformat/mvdec.c
index 5525233db56..6e7c3ffd113 100644
--- a/chromium/third_party/ffmpeg/libavformat/mvdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/mvdec.c
@@ -24,48 +24,55 @@
* Silicon Graphics Movie demuxer
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/eval.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/rational.h"
+
#include "avformat.h"
#include "internal.h"
-typedef struct {
+typedef struct MvContext {
int nb_video_tracks;
int nb_audio_tracks;
- int eof_count; /**< number of streams that have finished */
- int stream_index; /**< current stream index */
- int frame[2]; /**< frame nb for current stream */
+ int eof_count; ///< number of streams that have finished
+ int stream_index; ///< current stream index
+ int frame[2]; ///< frame nb for current stream
+
+ int acompression; ///< compression level for audio stream
+ int aformat; ///< audio format
} MvContext;
#define AUDIO_FORMAT_SIGNED 401
static int mv_probe(AVProbeData *p)
{
- if (AV_RB32(p->buf) == MKBETAG('M','O','V','I') && AV_RB16(p->buf + 4) < 3)
+ if (AV_RB32(p->buf) == MKBETAG('M', 'O', 'V', 'I') &&
+ AV_RB16(p->buf + 4) < 3)
return AVPROBE_SCORE_MAX;
return 0;
}
-static char * var_read_string(AVIOContext *pb, int size)
+static char *var_read_string(AVIOContext *pb, int size)
{
- char *str = av_malloc(size + 1);
int n;
+ char *str = av_malloc(size + 1);
if (!str)
return NULL;
n = avio_get_str(pb, size, str, size + 1);
if (n < size)
- avio_skip(pb, size - n);
+ avio_skip(pb, size - n);
return str;
}
static int var_read_int(AVIOContext *pb, int size)
{
int v;
- char * s = var_read_string(pb, size);
- if (!s || sscanf(s, "%d", &v) != 1)
- v = 0;
+ char *s = var_read_string(pb, size);
+ if (!s)
+ return 0;
+ v = strtol(s, NULL, 10);
av_free(s);
return v;
}
@@ -73,9 +80,9 @@ static int var_read_int(AVIOContext *pb, int size)
static AVRational var_read_float(AVIOContext *pb, int size)
{
AVRational v;
- char * s = var_read_string(pb, size);
+ char *s = var_read_string(pb, size);
if (!s)
- return (AVRational){0, 0};
+ return (AVRational) { 0, 0 };
v = av_d2q(av_strtod(s, NULL), INT_MAX);
av_free(s);
return v;
@@ -88,13 +95,15 @@ static void var_read_metadata(AVFormatContext *avctx, const char *tag, int size)
av_dict_set(&avctx->metadata, tag, value, AV_DICT_DONT_STRDUP_VAL);
}
-static int set_channels(AVFormatContext *avctx, AVStream *st, int channels) {
+static int set_channels(AVFormatContext *avctx, AVStream *st, int channels)
+{
if (channels <= 0) {
- av_log(avctx, AV_LOG_ERROR, "Channel count %d invalid\n", channels);
+ av_log(avctx, AV_LOG_ERROR, "Channel count %d invalid.\n", channels);
return AVERROR_INVALIDDATA;
}
- st->codec->channels = channels;
- st->codec->channel_layout = (st->codec->channels == 1) ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
+ st->codec->channels = channels;
+ st->codec->channel_layout = (st->codec->channels == 1) ? AV_CH_LAYOUT_MONO
+ : AV_CH_LAYOUT_STEREO;
return 0;
}
@@ -102,7 +111,8 @@ static int set_channels(AVFormatContext *avctx, AVStream *st, int channels) {
* Parse global variable
* @return < 0 if unknown
*/
-static int parse_global_var(AVFormatContext *avctx, AVStream *st, const char *name, int size)
+static int parse_global_var(AVFormatContext *avctx, AVStream *st,
+ const char *name, int size)
{
MvContext *mv = avctx->priv_data;
AVIOContext *pb = avctx->pb;
@@ -112,10 +122,11 @@ static int parse_global_var(AVFormatContext *avctx, AVStream *st, const char *na
mv->nb_audio_tracks = var_read_int(pb, size);
} else if (!strcmp(name, "COMMENT") || !strcmp(name, "TITLE")) {
var_read_metadata(avctx, name, size);
- } else if (!strcmp(name, "LOOP_MODE") || !strcmp(name, "NUM_LOOPS") || !strcmp(name, "OPTIMIZED")) {
+ } else if (!strcmp(name, "LOOP_MODE") || !strcmp(name, "NUM_LOOPS") ||
+ !strcmp(name, "OPTIMIZED")) {
avio_skip(pb, size); // ignore
} else
- return -1;
+ return AVERROR_INVALIDDATA;
return 0;
}
@@ -124,15 +135,17 @@ static int parse_global_var(AVFormatContext *avctx, AVStream *st, const char *na
* Parse audio variable
* @return < 0 if unknown
*/
-static int parse_audio_var(AVFormatContext *avctx, AVStream *st, const char *name, int size)
+static int parse_audio_var(AVFormatContext *avctx, AVStream *st,
+ const char *name, int size)
{
+ MvContext *mv = avctx->priv_data;
AVIOContext *pb = avctx->pb;
if (!strcmp(name, "__DIR_COUNT")) {
st->nb_frames = var_read_int(pb, size);
} else if (!strcmp(name, "AUDIO_FORMAT")) {
- st->codec->codec_id = var_read_int(pb, size);
+ mv->aformat = var_read_int(pb, size);
} else if (!strcmp(name, "COMPRESSION")) {
- st->codec->codec_tag = var_read_int(pb, size);
+ mv->acompression = var_read_int(pb, size);
} else if (!strcmp(name, "DEFAULT_VOL")) {
var_read_metadata(avctx, name, size);
} else if (!strcmp(name, "NUM_CHANNELS")) {
@@ -143,7 +156,8 @@ static int parse_audio_var(AVFormatContext *avctx, AVStream *st, const char *nam
} else if (!strcmp(name, "SAMPLE_WIDTH")) {
st->codec->bits_per_coded_sample = var_read_int(pb, size) * 8;
} else
- return -1;
+ return AVERROR_INVALIDDATA;
+
return 0;
}
@@ -151,13 +165,14 @@ static int parse_audio_var(AVFormatContext *avctx, AVStream *st, const char *nam
* Parse video variable
* @return < 0 if unknown
*/
-static int parse_video_var(AVFormatContext *avctx, AVStream *st, const char *name, int size)
+static int parse_video_var(AVFormatContext *avctx, AVStream *st,
+ const char *name, int size)
{
AVIOContext *pb = avctx->pb;
if (!strcmp(name, "__DIR_COUNT")) {
st->nb_frames = st->duration = var_read_int(pb, size);
} else if (!strcmp(name, "COMPRESSION")) {
- char * str = var_read_string(pb, size);
+ char *str = var_read_string(pb, size);
if (!str)
return AVERROR_INVALIDDATA;
if (!strcmp(str, "1")) {
@@ -172,35 +187,40 @@ static int parse_video_var(AVFormatContext *avctx, AVStream *st, const char *nam
} else if (!strcmp(str, "MVC2")) {
st->codec->codec_id = AV_CODEC_ID_MVC2;
} else {
- avpriv_request_sample(avctx, "video compression %s", str);
+ avpriv_request_sample(avctx, "Video compression %s", str);
}
av_free(str);
} else if (!strcmp(name, "FPS")) {
AVRational fps = var_read_float(pb, size);
avpriv_set_pts_info(st, 64, fps.den, fps.num);
+ st->avg_frame_rate = fps;
} else if (!strcmp(name, "HEIGHT")) {
st->codec->height = var_read_int(pb, size);
} else if (!strcmp(name, "PIXEL_ASPECT")) {
st->sample_aspect_ratio = var_read_float(pb, size);
av_reduce(&st->sample_aspect_ratio.num, &st->sample_aspect_ratio.den,
- st->sample_aspect_ratio.num, st->sample_aspect_ratio.den, INT_MAX);
+ st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
+ INT_MAX);
} else if (!strcmp(name, "WIDTH")) {
st->codec->width = var_read_int(pb, size);
} else if (!strcmp(name, "ORIENTATION")) {
if (var_read_int(pb, size) == 1101) {
- st->codec->extradata = av_strdup("BottomUp");
- st->codec->extradata_size = 9;
+ st->codec->extradata = av_strdup("BottomUp");
+ st->codec->extradata_size = 9;
}
} else if (!strcmp(name, "Q_SPATIAL") || !strcmp(name, "Q_TEMPORAL")) {
var_read_metadata(avctx, name, size);
} else if (!strcmp(name, "INTERLACING") || !strcmp(name, "PACKING")) {
avio_skip(pb, size); // ignore
} else
- return -1;
+ return AVERROR_INVALIDDATA;
+
return 0;
}
-static void read_table(AVFormatContext *avctx, AVStream *st, int (*parse)(AVFormatContext *avctx, AVStream *st, const char *name, int size))
+static void read_table(AVFormatContext *avctx, AVStream *st,
+ int (*parse)(AVFormatContext *avctx, AVStream *st,
+ const char *name, int size))
{
int count, i;
AVIOContext *pb = avctx->pb;
@@ -214,7 +234,7 @@ static void read_table(AVFormatContext *avctx, AVStream *st, int (*parse)(AVForm
name[sizeof(name) - 1] = 0;
size = avio_rb32(pb);
if (parse(avctx, st, name, size) < 0) {
- avpriv_request_sample(avctx, "variable %s", name);
+ avpriv_request_sample(avctx, "Variable %s", name);
avio_skip(pb, size);
}
}
@@ -253,7 +273,7 @@ static int mv_read_header(AVFormatContext *avctx)
avio_skip(pb, 22);
/* allocate audio track first to prevent unnecessary seeking
- (audio packet always precede video packet for a given frame) */
+ * (audio packet always precede video packet for a given frame) */
ast = avformat_new_stream(avctx, NULL);
if (!ast)
return AVERROR(ENOMEM);
@@ -261,9 +281,10 @@ static int mv_read_header(AVFormatContext *avctx)
vst = avformat_new_stream(avctx, NULL);
if (!vst)
return AVERROR(ENOMEM);
- vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
avpriv_set_pts_info(vst, 64, 1, 15);
- vst->nb_frames = avio_rb32(pb);
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ vst->avg_frame_rate = av_inv_q(vst->time_base);
+ vst->nb_frames = avio_rb32(pb);
v = avio_rb32(pb);
switch (v) {
case 1:
@@ -274,7 +295,7 @@ static int mv_read_header(AVFormatContext *avctx)
vst->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
break;
default:
- avpriv_request_sample(avctx, "video compression %i", v);
+ avpriv_request_sample(avctx, "Video compression %i", v);
break;
}
vst->codec->codec_tag = 0;
@@ -282,9 +303,9 @@ static int mv_read_header(AVFormatContext *avctx)
vst->codec->height = avio_rb32(pb);
avio_skip(pb, 12);
- ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- ast->nb_frames = vst->nb_frames;
- ast->codec->sample_rate = avio_rb32(pb);
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ ast->nb_frames = vst->nb_frames;
+ ast->codec->sample_rate = avio_rb32(pb);
avpriv_set_pts_info(ast, 33, 1, ast->codec->sample_rate);
if (set_channels(avctx, ast, avio_rb32(pb)) < 0)
return AVERROR_INVALIDDATA;
@@ -293,7 +314,7 @@ static int mv_read_header(AVFormatContext *avctx)
if (v == AUDIO_FORMAT_SIGNED) {
ast->codec->codec_id = AV_CODEC_ID_PCM_S16BE;
} else {
- avpriv_request_sample(avctx, "audio compression (format %i)", v);
+ avpriv_request_sample(avctx, "Audio compression (format %i)", v);
}
avio_skip(pb, 12);
@@ -307,8 +328,8 @@ static int mv_read_header(AVFormatContext *avctx)
uint32_t asize = avio_rb32(pb);
uint32_t vsize = avio_rb32(pb);
avio_skip(pb, 8);
- av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
- av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);
+ av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
+ av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);
timestamp += asize / (ast->codec->channels * 2);
}
} else if (!version && avio_rb16(pb) == 3) {
@@ -317,31 +338,33 @@ static int mv_read_header(AVFormatContext *avctx)
read_table(avctx, NULL, parse_global_var);
if (mv->nb_audio_tracks > 1) {
- avpriv_request_sample(avctx, "multiple audio streams support");
+ avpriv_request_sample(avctx, "Multiple audio streams support");
return AVERROR_PATCHWELCOME;
} else if (mv->nb_audio_tracks) {
ast = avformat_new_stream(avctx, NULL);
if (!ast)
return AVERROR(ENOMEM);
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- /* temporarily store compression value in codec_tag; format value in codec_id */
read_table(avctx, ast, parse_audio_var);
- if (ast->codec->codec_tag == 100 && ast->codec->codec_id == AUDIO_FORMAT_SIGNED && ast->codec->bits_per_coded_sample == 16) {
+ if (mv->acompression == 100 &&
+ mv->aformat == AUDIO_FORMAT_SIGNED &&
+ ast->codec->bits_per_coded_sample == 16) {
ast->codec->codec_id = AV_CODEC_ID_PCM_S16BE;
} else {
- avpriv_request_sample(avctx, "audio compression %i (format %i, width %i)",
- ast->codec->codec_tag, ast->codec->codec_id, ast->codec->bits_per_coded_sample);
+ avpriv_request_sample(avctx,
+ "Audio compression %i (format %i, sr %i)",
+ mv->acompression, mv->aformat,
+ ast->codec->bits_per_coded_sample);
ast->codec->codec_id = AV_CODEC_ID_NONE;
}
- ast->codec->codec_tag = 0;
if (ast->codec->channels <= 0) {
- av_log(avctx, AV_LOG_ERROR, "No valid channel count found\n");
+ av_log(avctx, AV_LOG_ERROR, "No valid channel count found.\n");
return AVERROR_INVALIDDATA;
}
}
if (mv->nb_video_tracks > 1) {
- avpriv_request_sample(avctx, "multiple video streams support");
+ avpriv_request_sample(avctx, "Multiple video streams support");
return AVERROR_PATCHWELCOME;
} else if (mv->nb_video_tracks) {
vst = avformat_new_stream(avctx, NULL);
@@ -357,7 +380,7 @@ static int mv_read_header(AVFormatContext *avctx)
if (mv->nb_video_tracks)
read_index(pb, vst);
} else {
- avpriv_request_sample(avctx, "version %i", version);
+ avpriv_request_sample(avctx, "Version %i", version);
return AVERROR_PATCHWELCOME;
}
@@ -374,9 +397,9 @@ static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
int ret;
uint64_t pos;
- if (frame < st->nb_index_entries) {
+ if (frame < st->nb_index_entries) {
index = &st->index_entries[frame];
- pos = avio_tell(pb);
+ pos = avio_tell(pb);
if (index->pos > pos)
avio_skip(pb, index->pos - pos);
else if (index->pos < pos) {
@@ -391,8 +414,8 @@ static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
return ret;
pkt->stream_index = mv->stream_index;
- pkt->pts = index->timestamp;
- pkt->flags |= AV_PKT_FLAG_KEY;
+ pkt->pts = index->timestamp;
+ pkt->flags |= AV_PKT_FLAG_KEY;
mv->frame[mv->stream_index]++;
mv->eof_count = 0;
@@ -400,6 +423,9 @@ static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
mv->eof_count++;
if (mv->eof_count >= avctx->nb_streams)
return AVERROR_EOF;
+
+ // avoid returning 0 without a packet
+ return AVERROR(EAGAIN);
}
mv->stream_index++;
@@ -409,7 +435,8 @@ static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
return 0;
}
-static int mv_read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
+static int mv_read_seek(AVFormatContext *avctx, int stream_index,
+ int64_t timestamp, int flags)
{
MvContext *mv = avctx->priv_data;
AVStream *st = avctx->streams[stream_index];
@@ -423,7 +450,7 @@ static int mv_read_seek(AVFormatContext *avctx, int stream_index, int64_t timest
frame = av_index_search_timestamp(st, timestamp, flags);
if (frame < 0)
- return -1;
+ return AVERROR_INVALIDDATA;
for (i = 0; i < avctx->nb_streams; i++)
mv->frame[i] = frame;
diff --git a/chromium/third_party/ffmpeg/libavformat/mvi.c b/chromium/third_party/ffmpeg/libavformat/mvi.c
index 5efc4431524..a7cfcb9a7a5 100644
--- a/chromium/third_party/ffmpeg/libavformat/mvi.c
+++ b/chromium/third_party/ffmpeg/libavformat/mvi.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
@@ -95,7 +97,8 @@ static int read_header(AVFormatContext *s)
mvi->audio_frame_size = ((uint64_t)mvi->audio_data_size << MVI_FRAC_BITS) / frames_count;
if (mvi->audio_frame_size <= 1 << MVI_FRAC_BITS - 1) {
- av_log(s, AV_LOG_ERROR, "Invalid audio_data_size (%d) or frames_count (%d)\n",
+ av_log(s, AV_LOG_ERROR,
+ "Invalid audio_data_size (%"PRIu32") or frames_count (%u)\n",
mvi->audio_data_size, frames_count);
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/mxf.c b/chromium/third_party/ffmpeg/libavformat/mxf.c
index 4a4158a1d33..d20ed946ac6 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxf.c
+++ b/chromium/third_party/ffmpeg/libavformat/mxf.c
@@ -45,6 +45,7 @@ const MXFCodecUL ff_mxf_codec_uls[] = {
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x71,0x00,0x00,0x00 }, 13, AV_CODEC_ID_DNXHD }, /* SMPTE VC-3/DNxHD */
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x03,0x02,0x00,0x00 }, 14, AV_CODEC_ID_DNXHD }, /* SMPTE VC-3/DNxHD */
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 }, 14, AV_CODEC_ID_H264 }, /* H.264/MPEG-4 AVC Intra */
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x31,0x11,0x01 }, 14, AV_CODEC_ID_H264 }, /* H.264/MPEG-4 AVC SPS/PPS in-band */
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x02,0x01 }, 16, AV_CODEC_ID_V210 }, /* V210 */
/* SoundEssenceCompression */
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 }, 13, AV_CODEC_ID_PCM_S16LE }, /* Uncompressed */
@@ -107,7 +108,7 @@ int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *
return -1;
}
-static const MXFSamplesPerFrame mxf_samples_per_frames[] = {
+static const MXFSamplesPerFrame mxf_spf[] = {
{ { 1001, 24000 }, { 2002, 0, 0, 0, 0, 0 } }, // FILM 23.976
{ { 1, 24}, { 2000, 0, 0, 0, 0, 0 } }, // FILM 24
{ { 1001, 30000 }, { 1602, 1601, 1602, 1601, 1602, 0 } }, // NTSC 29.97
@@ -116,22 +117,33 @@ static const MXFSamplesPerFrame mxf_samples_per_frames[] = {
{ { 1, 50 }, { 960, 0, 0, 0, 0, 0 } }, // PAL 50
};
-const MXFSamplesPerFrame *ff_mxf_get_samples_per_frame(AVFormatContext *s, AVRational time_base)
+static const AVRational mxf_time_base[] = {
+ { 1001, 24000 },
+ { 1, 24},
+ { 1001, 30000 },
+ { 1001, 60000 },
+ { 1, 25 },
+ { 1, 50 },
+ { 0, 0}
+};
+
+const MXFSamplesPerFrame *ff_mxf_get_samples_per_frame(AVFormatContext *s,
+ AVRational time_base)
{
- int i;
- for (i = 0; i < FF_ARRAY_ELEMS(mxf_samples_per_frames); i++) {
- if (!av_cmp_q(mxf_samples_per_frames[i].time_base, time_base))
- return &mxf_samples_per_frames[i];
- }
+ int idx = av_find_nearest_q_idx(time_base, mxf_time_base);
+ AVRational diff = av_sub_q(time_base, mxf_time_base[idx]);
- // Find closest container time base for approximative codec time base like 1/29.97, 1/30, ...
- for (i = 0; i < FF_ARRAY_ELEMS(mxf_samples_per_frames); i++) {
- if (fabs(av_q2d(mxf_samples_per_frames[i].time_base) - av_q2d(time_base)) < 0.0001) {
- av_log(s, AV_LOG_WARNING, "%d/%d input time base matched %d/%d container time base\n",
- time_base.num, time_base.den,
- mxf_samples_per_frames[i].time_base.num, mxf_samples_per_frames[i].time_base.den);
- return &mxf_samples_per_frames[i];
- }
- }
- return NULL;
+ diff.num = abs(diff.num);
+
+ if (av_cmp_q(diff, (AVRational){1, 1000}) >= 0)
+ return NULL;
+
+ if (av_cmp_q(time_base, mxf_time_base[idx]))
+ av_log(s, AV_LOG_WARNING,
+ "%d/%d input time base matched %d/%d container time base\n",
+ time_base.num, time_base.den,
+ mxf_spf[idx].time_base.num,
+ mxf_spf[idx].time_base.den);
+
+ return &mxf_spf[idx];
}
diff --git a/chromium/third_party/ffmpeg/libavformat/mxf.h b/chromium/third_party/ffmpeg/libavformat/mxf.h
index 4c751e8eef8..cf7ec0bab59 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxf.h
+++ b/chromium/third_party/ffmpeg/libavformat/mxf.h
@@ -79,7 +79,32 @@ extern const MXFCodecUL ff_mxf_pixel_format_uls[];
int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt);
const MXFSamplesPerFrame *ff_mxf_get_samples_per_frame(AVFormatContext *s, AVRational time_base);
-#define PRINT_KEY(pc, s, x) av_dlog(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \
- (x)[0], (x)[1], (x)[2], (x)[3], (x)[4], (x)[5], (x)[6], (x)[7], (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15])
+#ifdef DEBUG
+#define PRINT_KEY(pc, s, x) \
+ av_log(pc, AV_LOG_VERBOSE, \
+ "%s " \
+ "0x%02x,0x%02x,0x%02x,0x%02x," \
+ "0x%02x,0x%02x,0x%02x,0x%02x," \
+ "0x%02x,0x%02x,0x%02x,0x%02x," \
+ "0x%02x,0x%02x,0x%02x,0x%02x ", \
+ s, \
+ (x)[0], (x)[1], (x)[2], (x)[3], \
+ (x)[4], (x)[5], (x)[6], (x)[7], \
+ (x)[8], (x)[9], (x)[10], (x)[11], \
+ (x)[12], (x)[13], (x)[14], (x)[15]); \
+ av_log(pc, AV_LOG_INFO, \
+ "%s " \
+ "%02x.%02x.%02x.%02x." \
+ "%02x.%02x.%02x.%02x." \
+ "%02x.%02x.%02x.%02x." \
+ "%02x.%02x.%02x.%02x\n", \
+ s, \
+ (x)[0], (x)[1], (x)[2], (x)[3], \
+ (x)[4], (x)[5], (x)[6], (x)[7], \
+ (x)[8], (x)[9], (x)[10], (x)[11], \
+ (x)[12], (x)[13], (x)[14], (x)[15])
+#else
+#define PRINT_KEY(pc, s, x)
+#endif
#endif /* AVFORMAT_MXF_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/mxfdec.c b/chromium/third_party/ffmpeg/libavformat/mxfdec.c
index 61c0cb2366b..0d17a029640 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxfdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/mxfdec.c
@@ -43,7 +43,7 @@
* Only tracks with associated descriptors will be decoded. "Highly Desirable" SMPTE 377M D.1
*/
-#include <stdint.h>
+#include <inttypes.h>
#include "libavutil/aes.h"
#include "libavutil/avassert.h"
@@ -135,7 +135,7 @@ typedef struct {
AVRational edit_rate;
int intra_only;
uint64_t sample_count;
- int64_t original_duration; ///< duration before multiplying st->duration by SampleRate/EditRate
+ int64_t original_duration; /* st->duration in SampleRate/EditRate units */
} MXFTrack;
typedef struct {
@@ -148,9 +148,11 @@ typedef struct {
int width;
int height; /* Field height, not frame height */
int frame_layout; /* See MXFFrameLayout enum */
+#define MXF_TFF 1
+#define MXF_BFF 2
+ int field_dominance;
int channels;
int bits_per_sample;
- int field_dominance;
unsigned int component_depth;
unsigned int horiz_subsampling;
unsigned int vert_subsampling;
@@ -252,13 +254,13 @@ static int mxf_read_close(AVFormatContext *s);
static const uint8_t mxf_header_partition_pack_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02 };
static const uint8_t mxf_essence_element_key[] = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01 };
static const uint8_t mxf_avid_essence_element_key[] = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0e,0x04,0x03,0x01 };
-static const uint8_t mxf_system_item_key[] = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x03,0x01,0x04 };
+static const uint8_t mxf_system_item_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x03,0x01,0x04 };
static const uint8_t mxf_klv_key[] = { 0x06,0x0e,0x2b,0x34 };
/* complete keys to match */
static const uint8_t mxf_crypto_source_container_ul[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x02,0x02,0x00,0x00,0x00 };
static const uint8_t mxf_encrypted_triplet_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 };
static const uint8_t mxf_encrypted_essence_container[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00 };
-static const uint8_t mxf_random_index_pack_key[] = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x02,0x01,0x01,0x11,0x01,0x00 };
+static const uint8_t mxf_random_index_pack_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x11,0x01,0x00 };
static const uint8_t mxf_sony_mpeg4_extradata[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 };
#define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))
@@ -331,7 +333,7 @@ static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt,
data_ptr = pkt->data;
end_ptr = pkt->data + length;
buf_ptr = pkt->data + 4; /* skip SMPTE 331M header */
- for (; buf_ptr + st->codec->channels*4 <= end_ptr; ) {
+ for (; end_ptr - buf_ptr >= st->codec->channels * 4; ) {
for (i = 0; i < st->codec->channels; i++) {
uint32_t sample = bytestream_get_le32(&buf_ptr);
if (st->codec->bits_per_coded_sample == 24)
@@ -487,9 +489,32 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
partition->index_sid = avio_rb32(pb);
avio_skip(pb, 8);
partition->body_sid = avio_rb32(pb);
- avio_read(pb, op, sizeof(UID));
+ if (avio_read(pb, op, sizeof(UID)) != sizeof(UID)) {
+ av_log(mxf->fc, AV_LOG_ERROR, "Failed reading UID\n");
+ return AVERROR_INVALIDDATA;
+ }
nb_essence_containers = avio_rb32(pb);
+ if (partition->this_partition &&
+ partition->previous_partition == partition->this_partition) {
+ av_log(mxf->fc, AV_LOG_ERROR,
+ "PreviousPartition equal to ThisPartition %"PRIx64"\n",
+ partition->previous_partition);
+ /* override with the actual previous partition offset */
+ if (!mxf->parsing_backward && mxf->last_forward_partition > 1) {
+ MXFPartition *prev =
+ mxf->partitions + mxf->last_forward_partition - 2;
+ partition->previous_partition = prev->this_partition;
+ }
+ /* if no previous body partition are found point to the header
+ * partition */
+ if (partition->previous_partition == partition->this_partition)
+ partition->previous_partition = 0;
+ av_log(mxf->fc, AV_LOG_ERROR,
+ "Overriding PreviousPartition with %"PRIx64"\n",
+ partition->previous_partition);
+ }
+
/* some files don'thave FooterPartition set in every partition */
if (footer_partition) {
if (mxf->footer_partition && mxf->footer_partition != footer_partition) {
@@ -537,8 +562,10 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
/* only nag once */
if (!mxf->op)
- av_log(mxf->fc, AV_LOG_WARNING, "\"OPAtom\" with %u ECs - assuming %s\n",
- nb_essence_containers, op == OP1a ? "OP1a" : "OPAtom");
+ av_log(mxf->fc, AV_LOG_WARNING,
+ "\"OPAtom\" with %"PRIu32" ECs - assuming %s\n",
+ nb_essence_containers,
+ op == OP1a ? "OP1a" : "OPAtom");
mxf->op = op;
} else
@@ -549,14 +576,15 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
}
if (partition->kag_size <= 0 || partition->kag_size > (1 << 20)) {
- av_log(mxf->fc, AV_LOG_WARNING, "invalid KAGSize %i - guessing ", partition->kag_size);
+ av_log(mxf->fc, AV_LOG_WARNING, "invalid KAGSize %"PRId32" - guessing ",
+ partition->kag_size);
if (mxf->op == OPSONYOpt)
partition->kag_size = 512;
else
partition->kag_size = 1;
- av_log(mxf->fc, AV_LOG_WARNING, "%i\n", partition->kag_size);
+ av_log(mxf->fc, AV_LOG_WARNING, "%"PRId32"\n", partition->kag_size);
}
return 0;
@@ -666,7 +694,7 @@ static int mxf_read_track(void *arg, AVIOContext *pb, int tag, int size, UID uid
case 0x4804:
avio_read(pb, track->track_number, 4);
break;
- case 0x4B01:
+ case 0x4b01:
track->edit_rate.num = avio_rb32(pb);
track->edit_rate.den = avio_rb32(pb);
break;
@@ -925,31 +953,31 @@ static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe
static const MXFCodecUL mxf_picture_essence_container_uls[] = {
// video essence container uls
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* MPEG-ES Frame wrapped */
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 14, AV_CODEC_ID_DVVIDEO }, /* DV 625 25mbps */
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, 14, AV_CODEC_ID_RAWVIDEO }, /* Uncompressed Picture */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* MPEG-ES Frame wrapped */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 14, AV_CODEC_ID_DVVIDEO }, /* DV 625 25mbps */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, 14, AV_CODEC_ID_RAWVIDEO }, /* Uncompressed Picture */
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE },
};
/* EC ULs for intra-only formats */
static const MXFCodecUL mxf_intra_only_essence_container_uls[] = {
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x00,0x00 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* MXF-GC SMPTE D-10 Mappings */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x01,0x00,0x00 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* MXF-GC SMPTE D-10 Mappings */
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE },
};
/* intra-only PictureEssenceCoding ULs, where no corresponding EC UL exists */
static const MXFCodecUL mxf_intra_only_picture_essence_coding_uls[] = {
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 }, 14, AV_CODEC_ID_H264 }, /* H.264/MPEG-4 AVC Intra Profiles */
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14, AV_CODEC_ID_JPEG2000 }, /* JPEG2000 Codestream */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 }, 14, AV_CODEC_ID_H264 }, /* H.264/MPEG-4 AVC Intra Profiles */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14, AV_CODEC_ID_JPEG2000 }, /* JPEG2000 Codestream */
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE },
};
static const MXFCodecUL mxf_sound_essence_container_uls[] = {
// sound essence container uls
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 14, AV_CODEC_ID_PCM_S16LE }, /* BWF Frame wrapped */
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 14, AV_CODEC_ID_MP2 }, /* MPEG-ES Frame wrapped, 0x40 ??? stream id */
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14, AV_CODEC_ID_PCM_S16LE }, /* D-10 Mapping 50Mbps PAL Extended Template */
- { { 0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0xFF,0x4B,0x46,0x41,0x41,0x00,0x0D,0x4D,0x4F }, 14, AV_CODEC_ID_PCM_S16LE }, /* 0001GL00.MXF.A1.mxf_opatom.mxf */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 14, AV_CODEC_ID_PCM_S16LE }, /* BWF Frame wrapped */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 14, AV_CODEC_ID_MP2 }, /* MPEG-ES Frame wrapped, 0x40 ??? stream id */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14, AV_CODEC_ID_PCM_S16LE }, /* D-10 Mapping 50Mbps PAL Extended Template */
+ { { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0xff,0x4b,0x46,0x41,0x41,0x00,0x0d,0x4d,0x4F }, 14, AV_CODEC_ID_PCM_S16LE }, /* 0001GL00.MXF.A1.mxf_opatom.mxf */
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE },
};
@@ -1246,7 +1274,9 @@ static int mxf_compute_index_tables(MXFContext *mxf)
}
}
- if (!(mxf->index_tables = av_calloc(mxf->nb_index_tables, sizeof(MXFIndexTable)))) {
+ mxf->index_tables = av_mallocz_array(mxf->nb_index_tables,
+ sizeof(*mxf->index_tables));
+ if (!mxf->index_tables) {
av_log(mxf->fc, AV_LOG_ERROR, "failed to allocate index tables\n");
ret = AVERROR(ENOMEM);
goto finish_decoding_index;
@@ -1265,8 +1295,12 @@ static int mxf_compute_index_tables(MXFContext *mxf)
for (i = j = 0; j < mxf->nb_index_tables; i += mxf->index_tables[j++].nb_segments) {
MXFIndexTable *t = &mxf->index_tables[j];
- if (!(t->segments = av_calloc(t->nb_segments, sizeof(MXFIndexTableSegment*)))) {
- av_log(mxf->fc, AV_LOG_ERROR, "failed to allocate IndexTableSegment pointer array\n");
+ t->segments = av_mallocz_array(t->nb_segments,
+ sizeof(*t->segments));
+
+ if (!t->segments) {
+ av_log(mxf->fc, AV_LOG_ERROR, "failed to allocate IndexTableSegment"
+ " pointer array\n");
ret = AVERROR(ENOMEM);
goto finish_decoding_index;
}
@@ -1453,15 +1487,19 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
if (st->duration == -1)
st->duration = AV_NOPTS_VALUE;
st->start_time = component->start_position;
- if (material_track->edit_rate.num <= 0 || material_track->edit_rate.den <= 0) {
+ if (material_track->edit_rate.num <= 0 ||
+ material_track->edit_rate.den <= 0) {
av_log(mxf->fc, AV_LOG_WARNING,
- "invalid edit rate (%d/%d) found on stream #%d, defaulting to 25/1\n",
- material_track->edit_rate.num, material_track->edit_rate.den, st->index);
+ "Invalid edit rate (%d/%d) found on stream #%d, "
+ "defaulting to 25/1\n",
+ material_track->edit_rate.num,
+ material_track->edit_rate.den, st->index);
material_track->edit_rate = (AVRational){25, 1};
}
avpriv_set_pts_info(st, 64, material_track->edit_rate.den, material_track->edit_rate.num);
- /* ensure SourceTrack EditRate == MaterialTrack EditRate since only the former is accessible via st->priv_data */
+ /* ensure SourceTrack EditRate == MaterialTrack EditRate since only
+ * the former is accessible via st->priv_data */
source_track->edit_rate = material_track->edit_rate;
PRINT_KEY(mxf->fc, "data definition ul", source_track->sequence->data_definition_ul);
@@ -1543,7 +1581,21 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
case MixedFields:
break;
case SeparateFields:
- st->codec->height *= 2; /* Turn field height into frame height. */
+ switch (descriptor->field_dominance) {
+ case MXF_TFF:
+ st->codec->field_order = AV_FIELD_TT;
+ break;
+ case MXF_BFF:
+ st->codec->field_order = AV_FIELD_BB;
+ break;
+ default:
+ avpriv_request_sample(mxf->fc,
+ "Field dominance %d support",
+ descriptor->field_dominance);
+ break;
+ }
+ /* Turn field height into frame height. */
+ st->codec->height *= 2;
break;
default:
av_log(mxf->fc, AV_LOG_INFO, "Unknown frame layout type: %d\n", descriptor->frame_layout);
@@ -1587,7 +1639,9 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
/* if duration is set, rescale it from EditRate to SampleRate */
if (st->duration != AV_NOPTS_VALUE)
- st->duration = av_rescale_q(st->duration, av_inv_q(material_track->edit_rate), st->time_base);
+ st->duration = av_rescale_q(st->duration,
+ av_inv_q(material_track->edit_rate),
+ st->time_base);
/* TODO: implement AV_CODEC_ID_RAWAUDIO */
if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
@@ -1632,7 +1686,7 @@ static int mxf_read_utf16_string(AVIOContext *pb, int size, char** str)
if (size < 0)
return AVERROR(EINVAL);
- buf_size = size + size/2 + 1;
+ buf_size = size + size / 2 + 1;
*str = av_malloc(buf_size);
if (!*str)
return AVERROR(ENOMEM);
@@ -1665,7 +1719,7 @@ static int mxf_uid_to_str(UID uid, char **str)
static int mxf_timestamp_to_str(uint64_t timestamp, char **str)
{
- struct tm time = {0};
+ struct tm time = { 0 };
time.tm_year = (timestamp >> 48) - 1900;
time.tm_mon = (timestamp >> 40 & 0xFF) - 1;
time.tm_mday = (timestamp >> 32 & 0xFF);
@@ -1673,9 +1727,14 @@ static int mxf_timestamp_to_str(uint64_t timestamp, char **str)
time.tm_min = (timestamp >> 16 & 0xFF);
time.tm_sec = (timestamp >> 8 & 0xFF);
- /* ensure month/day are valid */
- time.tm_mon = FFMAX(time.tm_mon, 0);
- time.tm_mday = FFMAX(time.tm_mday, 1);
+ /* msvcrt versions of strftime calls the invalid parameter handler
+ * (aborting the process if one isn't set) if the parameters are out
+ * of range. */
+ time.tm_mon = av_clip(time.tm_mon, 0, 11);
+ time.tm_mday = av_clip(time.tm_mday, 1, 31);
+ time.tm_hour = av_clip(time.tm_hour, 0, 23);
+ time.tm_min = av_clip(time.tm_min, 0, 59);
+ time.tm_sec = av_clip(time.tm_sec, 0, 59);
*str = av_mallocz(32);
if (!*str)
@@ -1743,35 +1802,35 @@ static int mxf_read_identification_metadata(void *arg, AVIOContext *pb, int tag,
}
static const MXFMetadataReadTableEntry mxf_metadata_read_table[] = {
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x05,0x01,0x00 }, mxf_read_primer_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00 }, mxf_read_partition_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x02,0x00 }, mxf_read_partition_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x03,0x00 }, mxf_read_partition_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x04,0x00 }, mxf_read_partition_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x01,0x00 }, mxf_read_partition_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x02,0x00 }, mxf_read_partition_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x03,0x00 }, mxf_read_partition_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x04,0x00 }, mxf_read_partition_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x02,0x00 }, mxf_read_partition_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x04,0x00 }, mxf_read_partition_pack },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01,0x01,0x30,0x00 }, mxf_read_identification_metadata },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x18,0x00 }, mxf_read_content_storage, 0, AnyType },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x37,0x00 }, mxf_read_source_package, sizeof(MXFPackage), SourcePackage },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x36,0x00 }, mxf_read_material_package, sizeof(MXFPackage), MaterialPackage },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x0F,0x00 }, mxf_read_sequence, sizeof(MXFSequence), Sequence },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x11,0x00 }, mxf_read_source_clip, sizeof(MXFStructuralComponent), SourceClip },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x44,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), MultipleDescriptor },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x42,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* Generic Sound */
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x28,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* CDCI */
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x29,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* RGBA */
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* MPEG 2 Video */
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* Wave */
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* AES3 */
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Static Track */
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3B,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Generic Track */
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x14,0x00 }, mxf_read_timecode_component, sizeof(MXFTimecodeComponent), TimecodeComponent },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x04,0x01,0x02,0x02,0x00,0x00 }, mxf_read_cryptographic_context, sizeof(MXFCryptoContext), CryptoContext },
- { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x10,0x01,0x00 }, mxf_read_index_table_segment, sizeof(MXFIndexTableSegment), IndexTableSegment },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x05,0x01,0x00 }, mxf_read_primer_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00 }, mxf_read_partition_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x02,0x00 }, mxf_read_partition_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x03,0x00 }, mxf_read_partition_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x04,0x00 }, mxf_read_partition_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x01,0x00 }, mxf_read_partition_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x02,0x00 }, mxf_read_partition_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x03,0x00 }, mxf_read_partition_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x04,0x00 }, mxf_read_partition_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x02,0x00 }, mxf_read_partition_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x04,0x00 }, mxf_read_partition_pack },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x30,0x00 }, mxf_read_identification_metadata },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x18,0x00 }, mxf_read_content_storage, 0, AnyType },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x37,0x00 }, mxf_read_source_package, sizeof(MXFPackage), SourcePackage },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x36,0x00 }, mxf_read_material_package, sizeof(MXFPackage), MaterialPackage },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x0f,0x00 }, mxf_read_sequence, sizeof(MXFSequence), Sequence },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x11,0x00 }, mxf_read_source_clip, sizeof(MXFStructuralComponent), SourceClip },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x44,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), MultipleDescriptor },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x42,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* Generic Sound */
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x28,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* CDCI */
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x29,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* RGBA */
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* MPEG 2 Video */
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* Wave */
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* AES3 */
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Static Track */
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3B,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Generic Track */
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x14,0x00 }, mxf_read_timecode_component, sizeof(MXFTimecodeComponent), TimecodeComponent },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x04,0x01,0x02,0x02,0x00,0x00 }, mxf_read_cryptographic_context, sizeof(MXFCryptoContext), CryptoContext },
+ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x10,0x01,0x00 }, mxf_read_index_table_segment, sizeof(MXFIndexTableSegment), IndexTableSegment },
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, NULL, 0, AnyType },
};
@@ -1860,10 +1919,14 @@ static int mxf_parse_handle_essence(MXFContext *mxf)
if (mxf->parsing_backward) {
return mxf_seek_to_previous_partition(mxf);
- } else if (mxf->footer_partition || mxf->last_partition){
- uint64_t offset;
+ } else {
+ uint64_t offset = mxf->footer_partition ? mxf->footer_partition
+ : mxf->last_partition;
- offset = mxf->footer_partition ? mxf->footer_partition : mxf->last_partition;
+ if (!offset) {
+ av_dlog(mxf->fc, "no last partition\n");
+ return 0;
+ }
av_dlog(mxf->fc, "seeking to last partition\n");
@@ -1877,16 +1940,15 @@ static int mxf_parse_handle_essence(MXFContext *mxf)
/* seek to last partition and parse backward */
if ((ret = avio_seek(pb, mxf->run_in + offset, SEEK_SET)) < 0) {
- av_log(mxf->fc, AV_LOG_ERROR, "failed to seek to last partition @ 0x%"PRIx64" (%"PRId64") - partial file?\n",
+ av_log(mxf->fc, AV_LOG_ERROR,
+ "failed to seek to last partition @ 0x%" PRIx64
+ " (%"PRId64") - partial file?\n",
mxf->run_in + offset, ret);
return ret;
}
mxf->current_partition = NULL;
mxf->parsing_backward = 1;
- } else {
- av_dlog(mxf->fc, "can't find last partition\n");
- return 0;
}
return 1;
@@ -2011,6 +2073,8 @@ static int mxf_read_header(AVFormatContext *s)
MXFContext *mxf = s->priv_data;
KLVPacket klv;
int64_t essence_offset = 0;
+ int64_t last_pos = -1;
+ uint64_t last_pos_index = 1;
int ret;
mxf->last_forward_tell = INT64_MAX;
@@ -2028,7 +2092,12 @@ static int mxf_read_header(AVFormatContext *s)
while (!url_feof(s->pb)) {
const MXFMetadataReadTableEntry *metadata;
-
+ if (avio_tell(s->pb) == last_pos) {
+ av_log(mxf->fc, AV_LOG_ERROR, "MXF structure loop detected\n");
+ return AVERROR_INVALIDDATA;
+ }
+ if ((1ULL<<61) % last_pos_index++ == 0)
+ last_pos = avio_tell(s->pb);
if (klv_read_packet(&klv, s->pb) < 0) {
/* EOF - seek to previous partition or stop */
if(mxf_parse_handle_partition_or_eof(mxf) <= 0)
@@ -2195,7 +2264,8 @@ static int64_t mxf_set_current_edit_unit(MXFContext *mxf, int64_t current_offset
return next_ofs;
}
-static int mxf_compute_sample_count(MXFContext *mxf, int stream_index, uint64_t *sample_count)
+static int mxf_compute_sample_count(MXFContext *mxf, int stream_index,
+ uint64_t *sample_count)
{
int i, total = 0, size = 0;
AVStream *st = mxf->fc->streams[stream_index];
@@ -2207,13 +2277,16 @@ static int mxf_compute_sample_count(MXFContext *mxf, int stream_index, uint64_t
if ((sample_rate.num / sample_rate.den) == 48000)
spf = ff_mxf_get_samples_per_frame(mxf->fc, time_base);
if (!spf) {
- int remainder = (sample_rate.num * time_base.num) % (time_base.den * sample_rate.den);
+ int remainder = (sample_rate.num * time_base.num) %
+ (time_base.den * sample_rate.den);
*sample_count = av_q2d(av_mul_q((AVRational){mxf->current_edit_unit, 1},
av_mul_q(sample_rate, time_base)));
if (remainder)
av_log(mxf->fc, AV_LOG_WARNING,
- "seeking detected on stream #%d with time base (%d/%d) and sample rate (%d/%d), audio pts won't be accurate.\n",
- stream_index, time_base.num, time_base.den, sample_rate.num, sample_rate.den);
+ "seeking detected on stream #%d with time base (%d/%d) and "
+ "sample rate (%d/%d), audio pts won't be accurate.\n",
+ stream_index, time_base.num, time_base.den,
+ sample_rate.num, sample_rate.den);
return 0;
}
@@ -2232,15 +2305,19 @@ static int mxf_compute_sample_count(MXFContext *mxf, int stream_index, uint64_t
return 0;
}
-static int mxf_set_audio_pts(MXFContext *mxf, AVCodecContext *codec, AVPacket *pkt)
+static int mxf_set_audio_pts(MXFContext *mxf, AVCodecContext *codec,
+ AVPacket *pkt)
{
MXFTrack *track = mxf->fc->streams[pkt->stream_index]->priv_data;
+ int64_t bits_per_sample = av_get_bits_per_sample(codec->codec_id);
+
pkt->pts = track->sample_count;
+
if ( codec->channels <= 0
- || av_get_bits_per_sample(codec->codec_id) <= 0
- || codec->channels * (int64_t)av_get_bits_per_sample(codec->codec_id) < 8)
+ || bits_per_sample <= 0
+ || codec->channels * (int64_t)bits_per_sample < 8)
return AVERROR(EINVAL);
- track->sample_count += pkt->size / (codec->channels * (int64_t)av_get_bits_per_sample(codec->codec_id) / 8);
+ track->sample_count += pkt->size / (codec->channels * (int64_t)bits_per_sample / 8);
return 0;
}
@@ -2248,16 +2325,16 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
{
KLVPacket klv;
MXFContext *mxf = s->priv_data;
+ int ret;
- while (klv_read_packet(&klv, s->pb) == 0) {
- int ret;
+ while ((ret = klv_read_packet(&klv, s->pb)) == 0) {
PRINT_KEY(s, "read packet", klv.key);
av_dlog(s, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset);
if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key)) {
ret = mxf_decrypt_triplet(s, pkt, &klv);
if (ret < 0) {
av_log(s, AV_LOG_ERROR, "invalid encoded triplet\n");
- return AVERROR_INVALIDDATA;
+ return ret;
}
return 0;
}
@@ -2270,7 +2347,9 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
AVCodecContext *codec;
if (index < 0) {
- av_log(s, AV_LOG_ERROR, "error getting stream index %d\n", AV_RB32(klv.key+12));
+ av_log(s, AV_LOG_ERROR,
+ "error getting stream index %"PRIu32"\n",
+ AV_RB32(klv.key + 12));
goto skip;
}
@@ -2296,9 +2375,11 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
/* check for 8 channels AES3 element */
if (klv.key[12] == 0x06 && klv.key[13] == 0x01 && klv.key[14] == 0x10) {
- if (mxf_get_d10_aes3_packet(s->pb, s->streams[index], pkt, klv.length) < 0) {
+ ret = mxf_get_d10_aes3_packet(s->pb, s->streams[index],
+ pkt, klv.length);
+ if (ret < 0) {
av_log(s, AV_LOG_ERROR, "error reading D-10 aes3 frame\n");
- return AVERROR_INVALIDDATA;
+ return ret;
}
} else {
ret = av_get_packet(s->pb, pkt, klv.length);
@@ -2309,8 +2390,10 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
pkt->pos = klv.offset;
codec = s->streams[index]->codec;
+
if (codec->codec_type == AVMEDIA_TYPE_VIDEO && next_ofs >= 0) {
- /* mxf->current_edit_unit good - see if we have an index table to derive timestamps from */
+ /* mxf->current_edit_unit good - see if we have an
+ * index table to derive timestamps from */
MXFIndexTable *t = &mxf->index_tables[0];
if (mxf->nb_index_tables >= 1 && mxf->current_edit_unit < t->nb_ptses) {
@@ -2322,7 +2405,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
pkt->pts = mxf->current_edit_unit;
}
} else if (codec->codec_type == AVMEDIA_TYPE_AUDIO) {
- int ret = mxf_set_audio_pts(mxf, codec, pkt);
+ ret = mxf_set_audio_pts(mxf, codec, pkt);
if (ret < 0)
return ret;
}
@@ -2335,7 +2418,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
skip:
avio_skip(s->pb, klv.length);
}
- return url_feof(s->pb) ? AVERROR_EOF : -1;
+ return url_feof(s->pb) ? AVERROR_EOF : ret;
}
static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
@@ -2487,13 +2570,13 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
MXFContext* mxf = s->priv_data;
int64_t seekpos;
int i, ret;
- int64_t ret64;
MXFIndexTable *t;
MXFTrack *source_track = st->priv_data;
/* if audio then truncate sample_time to EditRate */
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
- sample_time = av_rescale_q(sample_time, st->time_base, av_inv_q(source_track->edit_rate));
+ sample_time = av_rescale_q(sample_time, st->time_base,
+ av_inv_q(source_track->edit_rate));
if (mxf->nb_index_tables <= 0) {
if (!s->bit_rate)
@@ -2502,8 +2585,10 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
sample_time = 0;
seconds = av_rescale(sample_time, st->time_base.num, st->time_base.den);
- if ((ret64 = avio_seek(s->pb, (s->bit_rate * seconds) >> 3, SEEK_SET)) < 0)
- return ret64;
+ seekpos = avio_seek(s->pb, (s->bit_rate * seconds) >> 3, SEEK_SET);
+ if (seekpos < 0)
+ return seekpos;
+
ff_update_cur_dts(s, st, sample_time);
mxf->current_edit_unit = sample_time;
} else {
@@ -2523,7 +2608,7 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
sample_time = FFMIN(sample_time, source_track->original_duration - 1);
}
- if ((ret = mxf_edit_unit_absolute_offset(mxf, t, sample_time, &sample_time, &seekpos, 1)) << 0)
+ if ((ret = mxf_edit_unit_absolute_offset(mxf, t, sample_time, &sample_time, &seekpos, 1)) < 0)
return ret;
ff_update_cur_dts(s, st, sample_time);
diff --git a/chromium/third_party/ffmpeg/libavformat/mxfenc.c b/chromium/third_party/ffmpeg/libavformat/mxfenc.c
index 5e77a3f0684..6f3226b968d 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxfenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/mxfenc.c
@@ -618,7 +618,7 @@ static void mxf_write_identification(AVFormatContext *s)
mxf_write_metadata_key(pb, 0x013000);
PRINT_KEY(s, "identification key", pb->buf_ptr - 16);
- version = s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT ?
+ version = s->flags & AVFMT_FLAG_BITEXACT ?
"0.0.0" : AV_STRINGIFY(LIBAVFORMAT_VERSION);
length = 84 + (strlen(company)+strlen(product)+strlen(version))*2; // utf-16
klv_encode_ber_length(pb, length);
@@ -1777,7 +1777,7 @@ static int mxf_write_header(AVFormatContext *s)
mxf->essence_container_count = 1;
}
- if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
+ if (!(s->flags & AVFMT_FLAG_BITEXACT))
mxf_gen_umid(s);
for (i = 0; i < s->nb_streams; i++) {
diff --git a/chromium/third_party/ffmpeg/libavformat/network.c b/chromium/third_party/ffmpeg/libavformat/network.c
index 2ba435d4726..5e574e3bbe0 100644
--- a/chromium/third_party/ffmpeg/libavformat/network.c
+++ b/chromium/third_party/ffmpeg/libavformat/network.c
@@ -76,7 +76,7 @@ void ff_tls_init(void)
#if HAVE_THREADS
if (!CRYPTO_get_locking_callback()) {
int i;
- openssl_mutexes = av_malloc(sizeof(pthread_mutex_t) * CRYPTO_num_locks());
+ openssl_mutexes = av_malloc_array(sizeof(pthread_mutex_t), CRYPTO_num_locks());
for (i = 0; i < CRYPTO_num_locks(); i++)
pthread_mutex_init(&openssl_mutexes[i], NULL);
CRYPTO_set_locking_callback(openssl_lock);
@@ -281,7 +281,9 @@ int ff_listen_bind(int fd, const struct sockaddr *addr,
closesocket(fd);
- ff_socket_nonblock(ret, 1);
+ if (ff_socket_nonblock(ret, 1) < 0)
+ av_log(NULL, AV_LOG_DEBUG, "ff_socket_nonblock failed\n");
+
return ret;
}
@@ -293,7 +295,8 @@ int ff_listen_connect(int fd, const struct sockaddr *addr,
int ret;
socklen_t optlen;
- ff_socket_nonblock(fd, 1);
+ if (ff_socket_nonblock(fd, 1) < 0)
+ av_log(NULL, AV_LOG_DEBUG, "ff_socket_nonblock failed\n");
while ((ret = connect(fd, addr, addrlen))) {
ret = ff_neterrno();
diff --git a/chromium/third_party/ffmpeg/libavformat/network.h b/chromium/third_party/ffmpeg/libavformat/network.h
index c60e1424a1c..5ca906491ac 100644
--- a/chromium/third_party/ffmpeg/libavformat/network.h
+++ b/chromium/third_party/ffmpeg/libavformat/network.h
@@ -62,7 +62,7 @@ int ff_neterrno(void);
#include <netdb.h>
#define ff_neterrno() AVERROR(errno)
-#endif
+#endif /* HAVE_WINSOCK2_H */
#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
@@ -104,12 +104,12 @@ struct sockaddr_storage {
uint8_t ss_family;
#else
uint16_t ss_family;
-#endif
+#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
char ss_pad1[6];
int64_t ss_align;
char ss_pad2[112];
};
-#endif
+#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
#if !HAVE_STRUCT_ADDRINFO
struct addrinfo {
@@ -122,7 +122,7 @@ struct addrinfo {
char *ai_canonname;
struct addrinfo *ai_next;
};
-#endif
+#endif /* !HAVE_STRUCT_ADDRINFO */
/* getaddrinfo constants */
#ifndef EAI_AGAIN
@@ -195,12 +195,13 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen,
#define getaddrinfo ff_getaddrinfo
#define freeaddrinfo ff_freeaddrinfo
#define getnameinfo ff_getnameinfo
-#endif
+#endif /* !HAVE_GETADDRINFO */
+
#if !HAVE_GETADDRINFO || HAVE_WINSOCK2_H
const char *ff_gai_strerror(int ecode);
#undef gai_strerror
#define gai_strerror ff_gai_strerror
-#endif
+#endif /* !HAVE_GETADDRINFO || HAVE_WINSOCK2_H */
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK 0x7f000001
diff --git a/chromium/third_party/ffmpeg/libavformat/nistspheredec.c b/chromium/third_party/ffmpeg/libavformat/nistspheredec.c
index c09df9ccc1a..2c966863422 100644
--- a/chromium/third_party/ffmpeg/libavformat/nistspheredec.c
+++ b/chromium/third_party/ffmpeg/libavformat/nistspheredec.c
@@ -36,7 +36,7 @@ static int nist_read_header(AVFormatContext *s)
{
char buffer[32], coding[32] = "pcm", format[32] = "01";
int bps = 0, be = 0;
- int32_t header_size;
+ int32_t header_size = -1;
AVStream *st;
st = avformat_new_stream(s, NULL);
@@ -108,8 +108,11 @@ static int nist_read_header(AVFormatContext *s)
sscanf(buffer, "%*s %*s %"SCNd32, &st->codec->bits_per_coded_sample);
} else {
char key[32], value[32];
- sscanf(buffer, "%31s %*s %31s", key, value);
- av_dict_set(&s->metadata, key, value, AV_DICT_APPEND);
+ if (sscanf(buffer, "%31s %*s %31s", key, value) == 3) {
+ av_dict_set(&s->metadata, key, value, AV_DICT_APPEND);
+ } else {
+ av_log(s, AV_LOG_ERROR, "Failed to parse '%s' as metadata\n", buffer);
+ }
}
}
diff --git a/chromium/third_party/ffmpeg/libavformat/nut.c b/chromium/third_party/ffmpeg/libavformat/nut.c
index 8b8a4cb8ac8..9224a963737 100644
--- a/chromium/third_party/ffmpeg/libavformat/nut.c
+++ b/chromium/third_party/ffmpeg/libavformat/nut.c
@@ -82,10 +82,10 @@ const AVCodecTag ff_nut_video_tags[] = {
{ AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 48 ) },
{ AV_CODEC_ID_RAWVIDEO, MKTAG(48 , 'B', 'G', 'R') },
{ AV_CODEC_ID_RAWVIDEO, MKTAG(48 , 'R', 'G', 'B') },
- { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'R', 'A', 64 ) },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'B', 'A', 64 ) },
- { AV_CODEC_ID_RAWVIDEO, MKTAG(64 , 'B', 'R', 'A') },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'R', 'A', 64 ) },
{ AV_CODEC_ID_RAWVIDEO, MKTAG(64 , 'R', 'B', 'A') },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(64 , 'B', 'R', 'A') },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 10 ) },
{ AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 11 , '3', 'Y') },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 10 ) },
@@ -157,10 +157,27 @@ const AVCodecTag ff_nut_video_tags[] = {
{ AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 16) },
{ AV_CODEC_ID_RAWVIDEO, MKTAG(16, 0, '3', 'G') },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG('X', 'Y', 'Z' , 36 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(36 , 'Z' , 'Y', 'X') },
+
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'B', 'G', 8 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'B', 'G', 16 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 'G', 'B', 0xBA) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'R', 'G', 8 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'R', 'G', 16 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 'G', 'R', 0xBA) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'B', 8 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'B', 16 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 'B', 'G', 0xBA) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'R', 8 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'R', 16 ) },
+ { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 'R', 'G', 0xBA) },
+
{ AV_CODEC_ID_NONE, 0 }
};
-static const AVCodecTag nut_audio_extra_tags[] = {
+const AVCodecTag ff_nut_audio_extra_tags[] = {
+ { AV_CODEC_ID_COMFORT_NOISE, MKTAG('3', '3', '8', '9') },
{ AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') },
{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') },
{ AV_CODEC_ID_MP3, MKTAG('M', 'P', '3', ' ') },
@@ -196,7 +213,7 @@ const AVCodecTag ff_nut_audio_tags[] = {
const AVCodecTag * const ff_nut_codec_tags[] = {
ff_nut_video_tags, ff_nut_audio_tags, ff_nut_subtitle_tags,
- ff_codec_bmp_tags, ff_codec_wav_tags, nut_audio_extra_tags, ff_nut_data_tags, 0
+ ff_codec_bmp_tags, ff_codec_wav_tags, ff_nut_audio_extra_tags, ff_nut_data_tags, 0
};
void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val)
diff --git a/chromium/third_party/ffmpeg/libavformat/nut.h b/chromium/third_party/ffmpeg/libavformat/nut.h
index da456ac5b08..a08d30b9350 100644
--- a/chromium/third_party/ffmpeg/libavformat/nut.h
+++ b/chromium/third_party/ffmpeg/libavformat/nut.h
@@ -46,6 +46,7 @@ typedef enum{
FLAG_SIZE_MSB = 32, ///<if set, data_size_msb is at frame header, otherwise data_size_msb is 0
FLAG_CHECKSUM = 64, ///<if set, the frame header contains a checksum
FLAG_RESERVED = 128, ///<if set, reserved_count is coded in the frame header
+ FLAG_SM_DATA = 256, ///<if set, side / meta data is stored in the frame header.
FLAG_HEADER_IDX =1024, ///<If set, header_idx is coded in the frame header.
FLAG_MATCH_TIME =2048, ///<If set, match_time_delta is coded in the frame header
FLAG_CODED =4096, ///<if set, coded_flags are stored in the frame header
@@ -104,11 +105,14 @@ typedef struct NUTContext {
int sp_count;
int64_t max_pts;
AVRational *max_pts_tb;
+ int version;
+ int minor_version;
} NUTContext;
extern const AVCodecTag ff_nut_subtitle_tags[];
extern const AVCodecTag ff_nut_video_tags[];
extern const AVCodecTag ff_nut_audio_tags[];
+extern const AVCodecTag ff_nut_audio_extra_tags[];
extern const AVCodecTag ff_nut_data_tags[];
extern const AVCodecTag * const ff_nut_codec_tags[];
diff --git a/chromium/third_party/ffmpeg/libavformat/nutdec.c b/chromium/third_party/ffmpeg/libavformat/nutdec.c
index aa7ca676fb7..5d08a8e80b1 100644
--- a/chromium/third_party/ffmpeg/libavformat/nutdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/nutdec.c
@@ -24,8 +24,10 @@
#include "libavutil/avassert.h"
#include "libavutil/bswap.h"
#include "libavutil/dict.h"
+#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/tree.h"
+#include "libavcodec/bytestream.h"
#include "avio_internal.h"
#include "nut.h"
#include "riff.h"
@@ -227,11 +229,14 @@ static int decode_main_header(NUTContext *nut)
end += avio_tell(bc);
tmp = ffio_read_varlen(bc);
- if (tmp < 2 && tmp > NUT_VERSION) {
+ if (tmp < 2 && tmp > 4) {
av_log(s, AV_LOG_ERROR, "Version %"PRId64" not supported.\n",
tmp);
return AVERROR(ENOSYS);
}
+ nut->version = tmp;
+ if (nut->version > 3)
+ nut->minor_version = ffio_read_varlen(bc);
GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS);
@@ -385,6 +390,7 @@ static int decode_stream_header(NUTContext *nut)
st->codec->codec_id = av_codec_get_id((const AVCodecTag * const []) {
ff_nut_audio_tags,
ff_codec_wav_tags,
+ ff_nut_audio_extra_tags,
0
},
tmp);
@@ -415,9 +421,8 @@ static int decode_stream_header(NUTContext *nut)
GET_V(st->codec->extradata_size, tmp < (1 << 30));
if (st->codec->extradata_size) {
- if (ff_alloc_extradata(st->codec, st->codec->extradata_size))
+ if (ff_get_extradata(st->codec, bc, st->codec->extradata_size) < 0)
return AVERROR(ENOMEM);
- avio_read(bc, st->codec->extradata, st->codec->extradata_size);
}
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
@@ -774,6 +779,116 @@ static int nut_read_header(AVFormatContext *s)
return 0;
}
+static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int is_meta, int64_t maxpos)
+{
+ int count = ffio_read_varlen(bc);
+ int skip_start = 0;
+ int skip_end = 0;
+ int channels = 0;
+ int64_t channel_layout = 0;
+ int sample_rate = 0;
+ int width = 0;
+ int height = 0;
+ int i;
+
+ for (i=0; i<count; i++) {
+ uint8_t name[256], str_value[256], type_str[256];
+ int value;
+ if (avio_tell(bc) >= maxpos)
+ return AVERROR_INVALIDDATA;
+ get_str(bc, name, sizeof(name));
+ value = get_s(bc);
+
+ if (value == -1) {
+ get_str(bc, str_value, sizeof(str_value));
+ av_log(s, AV_LOG_WARNING, "Unknown string %s / %s\n", name, str_value);
+ } else if (value == -2) {
+ uint8_t *dst = NULL;
+ int64_t v64, value_len;
+
+ get_str(bc, type_str, sizeof(type_str));
+ value_len = ffio_read_varlen(bc);
+ if (avio_tell(bc) + value_len >= maxpos)
+ return AVERROR_INVALIDDATA;
+ if (!strcmp(name, "Palette")) {
+ dst = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE, value_len);
+ } else if (!strcmp(name, "Extradata")) {
+ dst = av_packet_new_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, value_len);
+ } else if (sscanf(name, "CodecSpecificSide%"SCNd64"", &v64) == 1) {
+ dst = av_packet_new_side_data(pkt, AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, value_len + 8);
+ if(!dst)
+ return AVERROR(ENOMEM);
+ AV_WB64(dst, v64);
+ dst += 8;
+ } else if (!strcmp(name, "ChannelLayout") && value_len == 8) {
+ channel_layout = avio_rl64(bc);
+ continue;
+ } else {
+ av_log(s, AV_LOG_WARNING, "Unknown data %s / %s\n", name, type_str);
+ avio_skip(bc, value_len);
+ continue;
+ }
+ if(!dst)
+ return AVERROR(ENOMEM);
+ avio_read(bc, dst, value_len);
+ } else if (value == -3) {
+ value = get_s(bc);
+ } else if (value == -4) {
+ value = ffio_read_varlen(bc);
+ } else if (value < -4) {
+ get_s(bc);
+ } else {
+ if (!strcmp(name, "SkipStart")) {
+ skip_start = value;
+ } else if (!strcmp(name, "SkipEnd")) {
+ skip_end = value;
+ } else if (!strcmp(name, "Channels")) {
+ channels = value;
+ } else if (!strcmp(name, "SampleRate")) {
+ sample_rate = value;
+ } else if (!strcmp(name, "Width")) {
+ width = value;
+ } else if (!strcmp(name, "Height")) {
+ height = value;
+ } else {
+ av_log(s, AV_LOG_WARNING, "Unknown integer %s\n", name);
+ }
+ }
+ }
+
+ if (channels || channel_layout || sample_rate || width || height) {
+ uint8_t *dst = av_packet_new_side_data(pkt, AV_PKT_DATA_PARAM_CHANGE, 28);
+ if (!dst)
+ return AVERROR(ENOMEM);
+ bytestream_put_le32(&dst,
+ AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT*(!!channels) +
+ AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT*(!!channel_layout) +
+ AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE*(!!sample_rate) +
+ AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS*(!!(width|height))
+ );
+ if (channels)
+ bytestream_put_le32(&dst, channels);
+ if (channel_layout)
+ bytestream_put_le64(&dst, channel_layout);
+ if (sample_rate)
+ bytestream_put_le32(&dst, sample_rate);
+ if (width || height){
+ bytestream_put_le32(&dst, width);
+ bytestream_put_le32(&dst, height);
+ }
+ }
+
+ if (skip_start || skip_end) {
+ uint8_t *dst = av_packet_new_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES, 10);
+ if (!dst)
+ return AVERROR(ENOMEM);
+ AV_WL32(dst, skip_start);
+ AV_WL32(dst+4, skip_end);
+ }
+
+ return 0;
+}
+
static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id,
uint8_t *header_idx, int frame_code)
{
@@ -856,6 +971,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
int64_t pts, last_IP_pts;
StreamContext *stc;
uint8_t header_idx;
+ int ret;
size = decode_frame_header(nut, &pts, &stream_id, &header_idx, frame_code);
if (size < 0)
@@ -881,7 +997,23 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
return AVERROR(ENOMEM);
memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
pkt->pos = avio_tell(bc); // FIXME
- avio_read(bc, pkt->data + nut->header_len[header_idx], size);
+ if (stc->last_flags & FLAG_SM_DATA) {
+ int sm_size;
+ if (read_sm_data(s, bc, pkt, 0, pkt->pos + size) < 0)
+ return AVERROR_INVALIDDATA;
+ if (read_sm_data(s, bc, pkt, 1, pkt->pos + size) < 0)
+ return AVERROR_INVALIDDATA;
+ sm_size = avio_tell(bc) - pkt->pos;
+ size -= sm_size;
+ pkt->size -= sm_size;
+ }
+
+ ret = avio_read(bc, pkt->data + nut->header_len[header_idx], size);
+ if (ret != size) {
+ if (ret < 0)
+ return ret;
+ }
+ av_shrink_packet(pkt, nut->header_len[header_idx] + ret);
pkt->stream_index = stream_id;
if (stc->last_flags & FLAG_KEY)
diff --git a/chromium/third_party/ffmpeg/libavformat/nutenc.c b/chromium/third_party/ffmpeg/libavformat/nutenc.c
index 10b8fc88eb7..604fe760b69 100644
--- a/chromium/third_party/ffmpeg/libavformat/nutenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/nutenc.c
@@ -26,6 +26,7 @@
#include "libavutil/tree.h"
#include "libavutil/dict.h"
#include "libavutil/avassert.h"
+#include "libavcodec/bytestream.h"
#include "libavcodec/mpegaudiodata.h"
#include "nut.h"
#include "internal.h"
@@ -337,7 +338,9 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc)
tmp_head_idx;
int64_t tmp_match;
- ff_put_v(bc, NUT_VERSION);
+ ff_put_v(bc, nut->version = NUT_VERSION);
+ if (nut->version > 3)
+ ff_put_v(bc, nut->minor_version);
ff_put_v(bc, nut->avf->nb_streams);
ff_put_v(bc, nut->max_distance);
ff_put_v(bc, nut->time_base_count);
@@ -586,8 +589,15 @@ static int write_index(NUTContext *nut, AVIOContext *bc) {
int64_t last_pts= -1;
int j, k;
for (j=0; j<nut->sp_count; j++) {
- int flag = (nus->keyframe_pts[j] != AV_NOPTS_VALUE) ^ (j+1 == nut->sp_count);
+ int flag;
int n = 0;
+
+ if (j && nus->keyframe_pts[j] == nus->keyframe_pts[j-1]) {
+ av_log(nut->avf, AV_LOG_WARNING, "Multiple keyframes with same PTS\n");
+ nus->keyframe_pts[j] = AV_NOPTS_VALUE;
+ }
+
+ flag = (nus->keyframe_pts[j] != AV_NOPTS_VALUE) ^ (j+1 == nut->sp_count);
for (; j<nut->sp_count && (nus->keyframe_pts[j] != AV_NOPTS_VALUE) == flag; j++)
n++;
@@ -769,6 +779,8 @@ static int get_needed_flags(NUTContext *nut, StreamContext *nus, FrameCode *fc,
flags |= FLAG_SIZE_MSB;
if (pkt->pts - nus->last_pts != fc->pts_delta)
flags |= FLAG_CODED_PTS;
+ if (pkt->side_data_elems && nut->version > 3)
+ flags |= FLAG_SM_DATA;
if (pkt->size > 2 * nut->max_distance)
flags |= FLAG_CHECKSUM;
if (FFABS(pkt->pts - nus->last_pts) > nus->max_pts_distance)
@@ -801,11 +813,129 @@ static int find_best_header_idx(NUTContext *nut, AVPacket *pkt)
return best_i;
}
+static int write_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int is_meta)
+{
+ AVStream *st = s->streams[pkt->stream_index];
+ int ret, i, dyn_size;
+ unsigned flags;
+ AVIOContext *dyn_bc;
+ int sm_data_count = 0;
+ uint8_t tmp[256];
+ uint8_t *dyn_buf;
+
+ ret = avio_open_dyn_buf(&dyn_bc);
+ if (ret < 0)
+ return ret;
+
+ for (i = 0; i<pkt->side_data_elems; i++) {
+ const uint8_t *data = pkt->side_data[i].data;
+ int size = pkt->side_data[i].size;
+ const uint8_t *data_end = data + size;
+
+ if (is_meta) {
+ if ( pkt->side_data[i].type == AV_PKT_DATA_METADATA_UPDATE
+ || pkt->side_data[i].type == AV_PKT_DATA_STRINGS_METADATA) {
+ if (!size || data[size-1])
+ return AVERROR(EINVAL);
+ while (data < data_end) {
+ const uint8_t *key = data;
+ const uint8_t *val = data + strlen(key) + 1;
+
+ if(val >= data_end)
+ return AVERROR(EINVAL);
+ put_str(dyn_bc, key);
+ put_s(dyn_bc, -1);
+ put_str(dyn_bc, val);
+ data = val + strlen(val) + 1;
+ sm_data_count++;
+ }
+ }
+ } else {
+ switch (pkt->side_data[i].type) {
+ case AV_PKT_DATA_PALETTE:
+ case AV_PKT_DATA_NEW_EXTRADATA:
+ case AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL:
+ default:
+ if (pkt->side_data[i].type == AV_PKT_DATA_PALETTE) {
+ put_str(dyn_bc, "Palette");
+ } else if(pkt->side_data[i].type == AV_PKT_DATA_NEW_EXTRADATA) {
+ put_str(dyn_bc, "Extradata");
+ } else if(pkt->side_data[i].type == AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL) {
+ snprintf(tmp, sizeof(tmp), "CodecSpecificSide%"PRId64"", AV_RB64(data));
+ put_str(dyn_bc, tmp);
+ } else {
+ snprintf(tmp, sizeof(tmp), "UserData%s-SD-%d",
+ (st->codec->flags & CODEC_FLAG_BITEXACT) ? "Lavf" : LIBAVFORMAT_IDENT,
+ pkt->side_data[i].type);
+ put_str(dyn_bc, tmp);
+ }
+ put_s(dyn_bc, -2);
+ put_str(dyn_bc, "bin");
+ ff_put_v(dyn_bc, pkt->side_data[i].size);
+ avio_write(dyn_bc, data, pkt->side_data[i].size);
+ sm_data_count++;
+ break;
+ case AV_PKT_DATA_PARAM_CHANGE:
+ flags = bytestream_get_le32(&data);
+ if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) {
+ put_str(dyn_bc, "Channels");
+ put_s(dyn_bc, bytestream_get_le32(&data));
+ sm_data_count++;
+ }
+ if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) {
+ put_str(dyn_bc, "ChannelLayout");
+ put_s(dyn_bc, -2);
+ put_str(dyn_bc, "u64");
+ ff_put_v(bc, 8);
+ avio_write(dyn_bc, data, 8); data+=8;
+ sm_data_count++;
+ }
+ if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) {
+ put_str(dyn_bc, "SampleRate");
+ put_s(dyn_bc, bytestream_get_le32(&data));
+ sm_data_count++;
+ }
+ if (flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) {
+ put_str(dyn_bc, "Width");
+ put_s(dyn_bc, bytestream_get_le32(&data));
+ put_str(dyn_bc, "Height");
+ put_s(dyn_bc, bytestream_get_le32(&data));
+ sm_data_count+=2;
+ }
+ break;
+ case AV_PKT_DATA_SKIP_SAMPLES:
+ if (AV_RL32(data)) {
+ put_str(dyn_bc, "SkipStart");
+ put_s(dyn_bc, (unsigned)AV_RL32(data));
+ sm_data_count++;
+ }
+ if (AV_RL32(data+4)) {
+ put_str(dyn_bc, "SkipEnd");
+ put_s(dyn_bc, (unsigned)AV_RL32(data+4));
+ sm_data_count++;
+ }
+ break;
+ case AV_PKT_DATA_METADATA_UPDATE:
+ case AV_PKT_DATA_STRINGS_METADATA:
+ // belongs into meta, not side data
+ break;
+ }
+ }
+ }
+
+ ff_put_v(bc, sm_data_count);
+ dyn_size = avio_close_dyn_buf(dyn_bc, &dyn_buf);
+ avio_write(bc, dyn_buf, dyn_size);
+ av_freep(&dyn_buf);
+
+ return 0;
+}
+
static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
{
NUTContext *nut = s->priv_data;
StreamContext *nus = &nut->stream[pkt->stream_index];
- AVIOContext *bc = s->pb, *dyn_bc;
+ AVIOContext *bc = s->pb, *dyn_bc, *sm_bc = NULL;
FrameCode *fc;
int64_t coded_pts;
int best_length, frame_code, flags, needed_flags, i, header_idx;
@@ -813,6 +943,9 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
int key_frame = !!(pkt->flags & AV_PKT_FLAG_KEY);
int store_sp = 0;
int ret;
+ int sm_size = 0;
+ int data_size = pkt->size;
+ uint8_t *sm_buf;
if (pkt->pts < 0) {
av_log(s, AV_LOG_ERROR,
@@ -821,13 +954,23 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR(EINVAL);
}
+ if (pkt->side_data_elems && nut->version > 3) {
+ ret = avio_open_dyn_buf(&sm_bc);
+ if (ret < 0)
+ return ret;
+ write_sm_data(s, sm_bc, pkt, 0);
+ write_sm_data(s, sm_bc, pkt, 1);
+ sm_size = avio_close_dyn_buf(sm_bc, &sm_buf);
+ data_size += sm_size;
+ }
+
if (1LL << (20 + 3 * nut->header_count) <= avio_tell(bc))
write_headers(s, bc);
if (key_frame && !(nus->last_flags & FLAG_KEY))
store_sp = 1;
- if (pkt->size + 30 /*FIXME check*/ + avio_tell(bc) >= nut->last_syncpoint_pos + nut->max_distance)
+ if (data_size + 30 /*FIXME check*/ + avio_tell(bc) >= nut->last_syncpoint_pos + nut->max_distance)
store_sp = 1;
//FIXME: Ensure store_sp is 1 in the first place.
@@ -907,10 +1050,10 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
if (flags & FLAG_STREAM_ID)
length += ff_get_v_length(pkt->stream_index);
- if (pkt->size % fc->size_mul != fc->size_lsb)
+ if (data_size % fc->size_mul != fc->size_lsb)
continue;
if (flags & FLAG_SIZE_MSB)
- length += ff_get_v_length(pkt->size / fc->size_mul);
+ length += ff_get_v_length(data_size / fc->size_mul);
if (flags & FLAG_CHECKSUM)
length += 4;
@@ -952,13 +1095,18 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
}
if (flags & FLAG_STREAM_ID) ff_put_v(bc, pkt->stream_index);
if (flags & FLAG_CODED_PTS) ff_put_v(bc, coded_pts);
- if (flags & FLAG_SIZE_MSB ) ff_put_v(bc, pkt->size / fc->size_mul);
+ if (flags & FLAG_SIZE_MSB ) ff_put_v(bc, data_size / fc->size_mul);
if (flags & FLAG_HEADER_IDX) ff_put_v(bc, header_idx = best_header_idx);
if (flags & FLAG_CHECKSUM) avio_wl32(bc, ffio_get_checksum(bc));
else ffio_get_checksum(bc);
+ if (flags & FLAG_SM_DATA) {
+ avio_write(bc, sm_buf, sm_size);
+ av_freep(&sm_buf);
+ }
avio_write(bc, pkt->data + nut->header_len[header_idx], pkt->size - nut->header_len[header_idx]);
+
nus->last_flags = flags;
nus->last_pts = pkt->pts;
diff --git a/chromium/third_party/ffmpeg/libavformat/nuv.c b/chromium/third_party/ffmpeg/libavformat/nuv.c
index 32d0e02f68b..2c02de1c6f1 100644
--- a/chromium/third_party/ffmpeg/libavformat/nuv.c
+++ b/chromium/third_party/ffmpeg/libavformat/nuv.c
@@ -86,9 +86,8 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst,
av_freep(&vst->codec->extradata);
vst->codec->extradata_size = 0;
}
- if (ff_alloc_extradata(vst->codec, size))
+ if (ff_get_extradata(vst->codec, pb, size) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, vst->codec->extradata, size);
size = 0;
if (!myth)
return 0;
diff --git a/chromium/third_party/ffmpeg/libavformat/oggdec.c b/chromium/third_party/ffmpeg/libavformat/oggdec.c
index 8639eaea8db..f7d00c1b4b1 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggdec.c
@@ -48,6 +48,7 @@ static const struct ogg_codec * const ogg_codecs[] = {
&ff_flac_codec,
&ff_celt_codec,
&ff_opus_codec,
+ &ff_vp8_codec,
&ff_old_dirac_codec,
&ff_old_flac_codec,
&ff_ogm_video_codec,
@@ -77,6 +78,8 @@ static int ogg_save(AVFormatContext *s)
struct ogg_stream *os = ogg->streams + i;
os->buf = av_mallocz(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
memcpy(os->buf, ost->streams[i].buf, os->bufpos);
+ os->new_metadata = NULL;
+ os->new_metadata_size = 0;
}
ogg->state = ost;
@@ -143,6 +146,8 @@ static int ogg_reset(AVFormatContext *s)
os->lastpts = 0;
}
os->end_trimming = 0;
+ av_freep(&os->new_metadata);
+ os->new_metadata_size = 0;
}
ogg->page_pos = -1;
@@ -640,7 +645,11 @@ static int ogg_read_close(AVFormatContext *s)
ogg->streams[i].codec->cleanup(s, i);
}
av_freep(&ogg->streams[i].private);
+ av_freep(&ogg->streams[i].new_metadata);
}
+
+ ogg->nstreams = 0;
+
av_freep(&ogg->streams);
return 0;
}
@@ -721,8 +730,16 @@ static void ogg_validate_keyframe(AVFormatContext *s, int idx, int pstart, int p
{
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + idx;
- if (psize && s->streams[idx]->codec->codec_id == AV_CODEC_ID_THEORA) {
- if (!!(os->pflags & AV_PKT_FLAG_KEY) != !(os->buf[pstart] & 0x40)) {
+ int invalid = 0;
+ if (psize) {
+ switch (s->streams[idx]->codec->codec_id) {
+ case AV_CODEC_ID_THEORA:
+ invalid = !!(os->pflags & AV_PKT_FLAG_KEY) != !(os->buf[pstart] & 0x40);
+ break;
+ case AV_CODEC_ID_VP8:
+ invalid = !!(os->pflags & AV_PKT_FLAG_KEY) != !(os->buf[pstart] & 1);
+ }
+ if (invalid) {
os->pflags ^= AV_PKT_FLAG_KEY;
av_log(s, AV_LOG_WARNING, "Broken file, %skeyframe not correctly marked.\n",
(os->pflags & AV_PKT_FLAG_KEY) ? "" : "non-");
@@ -779,16 +796,29 @@ retry:
uint8_t *side_data = av_packet_new_side_data(pkt,
AV_PKT_DATA_SKIP_SAMPLES,
10);
- if(side_data == NULL) {
- av_free_packet(pkt);
- av_free(pkt);
- return AVERROR(ENOMEM);
- }
+ if(side_data == NULL)
+ goto fail;
AV_WL32(side_data + 4, os->end_trimming);
os->end_trimming = 0;
}
+ if (os->new_metadata) {
+ uint8_t *side_data = av_packet_new_side_data(pkt,
+ AV_PKT_DATA_METADATA_UPDATE,
+ os->new_metadata_size);
+ if(side_data == NULL)
+ goto fail;
+
+ memcpy(side_data, os->new_metadata, os->new_metadata_size);
+ av_freep(&os->new_metadata);
+ os->new_metadata_size = 0;
+ }
+
return psize;
+fail:
+ av_free_packet(pkt);
+ av_free(pkt);
+ return AVERROR(ENOMEM);
}
static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index,
@@ -807,6 +837,11 @@ static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index,
&& !ogg_packet(s, &i, &pstart, &psize, pos_arg)) {
if (i == stream_index) {
struct ogg_stream *os = ogg->streams + stream_index;
+ // Do not trust the last timestamps of a ogm video
+ if ( (os->flags & OGG_FLAG_EOS)
+ && !(os->flags & OGG_FLAG_BOS)
+ && os->codec == &ff_ogm_video_codec)
+ continue;
pts = ogg_calc_pts(s, i, NULL);
ogg_validate_keyframe(s, i, pstart, psize);
if (os->pflags & AV_PKT_FLAG_KEY) {
diff --git a/chromium/third_party/ffmpeg/libavformat/oggdec.h b/chromium/third_party/ffmpeg/libavformat/oggdec.h
index c31859fecd7..231b5837704 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggdec.h
+++ b/chromium/third_party/ffmpeg/libavformat/oggdec.h
@@ -85,6 +85,8 @@ struct ogg_stream {
int got_data; ///< 1 if the stream got some data (non-initial packets), 0 otherwise
int nb_header; ///< set to the number of parsed headers
int end_trimming; ///< set the number of packets to drop from the end
+ uint8_t *new_metadata;
+ unsigned int new_metadata_size;
void *private;
};
@@ -125,6 +127,7 @@ extern const struct ogg_codec ff_skeleton_codec;
extern const struct ogg_codec ff_speex_codec;
extern const struct ogg_codec ff_theora_codec;
extern const struct ogg_codec ff_vorbis_codec;
+extern const struct ogg_codec ff_vp8_codec;
int ff_vorbis_comment(AVFormatContext *ms, AVDictionary **m, const uint8_t *buf, int size);
diff --git a/chromium/third_party/ffmpeg/libavformat/oggenc.c b/chromium/third_party/ffmpeg/libavformat/oggenc.c
index d9ef23c445c..375abadd445 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggenc.c
@@ -427,9 +427,12 @@ static int ogg_write_header(AVFormatContext *s)
return -1;
}
oggstream = av_mallocz(sizeof(*oggstream));
+ if (!oggstream)
+ return AVERROR(ENOMEM);
+
oggstream->page.stream_index = i;
- if (!(st->codec->flags & CODEC_FLAG_BITEXACT))
+ if (!(s->flags & AVFMT_FLAG_BITEXACT))
do {
serial_num = av_get_random_seed();
for (j = 0; j < i; j++) {
@@ -445,7 +448,7 @@ static int ogg_write_header(AVFormatContext *s)
st->priv_data = oggstream;
if (st->codec->codec_id == AV_CODEC_ID_FLAC) {
int err = ogg_build_flac_headers(st->codec, oggstream,
- st->codec->flags & CODEC_FLAG_BITEXACT,
+ s->flags & AVFMT_FLAG_BITEXACT,
&st->metadata);
if (err) {
av_log(s, AV_LOG_ERROR, "Error writing FLAC headers\n");
@@ -454,7 +457,7 @@ static int ogg_write_header(AVFormatContext *s)
}
} else if (st->codec->codec_id == AV_CODEC_ID_SPEEX) {
int err = ogg_build_speex_headers(st->codec, oggstream,
- st->codec->flags & CODEC_FLAG_BITEXACT,
+ s->flags & AVFMT_FLAG_BITEXACT,
&st->metadata);
if (err) {
av_log(s, AV_LOG_ERROR, "Error writing Speex headers\n");
@@ -463,7 +466,7 @@ static int ogg_write_header(AVFormatContext *s)
}
} else if (st->codec->codec_id == AV_CODEC_ID_OPUS) {
int err = ogg_build_opus_headers(st->codec, oggstream,
- st->codec->flags & CODEC_FLAG_BITEXACT,
+ s->flags & AVFMT_FLAG_BITEXACT,
&st->metadata);
if (err) {
av_log(s, AV_LOG_ERROR, "Error writing Opus headers\n");
@@ -484,7 +487,7 @@ static int ogg_write_header(AVFormatContext *s)
return -1;
}
- p = ogg_write_vorbiscomment(7, st->codec->flags & CODEC_FLAG_BITEXACT,
+ p = ogg_write_vorbiscomment(7, s->flags & AVFMT_FLAG_BITEXACT,
&oggstream->header_len[1], &st->metadata,
framing_bit);
oggstream->header[1] = p;
@@ -637,7 +640,8 @@ AVOutputFormat ff_ogg_muxer = {
#endif
,
.priv_data_size = sizeof(OGGContext),
- .audio_codec = AV_CODEC_ID_FLAC,
+ .audio_codec = CONFIG_LIBVORBIS_ENCODER ?
+ AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC,
.video_codec = AV_CODEC_ID_THEORA,
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
@@ -647,6 +651,30 @@ AVOutputFormat ff_ogg_muxer = {
};
#endif
+#if CONFIG_OGA_MUXER
+static const AVClass oga_muxer_class = {
+ .class_name = "Ogg audio muxer",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVOutputFormat ff_oga_muxer = {
+ .name = "oga",
+ .long_name = NULL_IF_CONFIG_SMALL("Ogg audio"),
+ .mime_type = "audio/ogg",
+ .extensions = "oga",
+ .priv_data_size = sizeof(OGGContext),
+ .audio_codec = AV_CODEC_ID_VORBIS,
+ .video_codec = AV_CODEC_ID_NONE,
+ .write_header = ogg_write_header,
+ .write_packet = ogg_write_packet,
+ .write_trailer = ogg_write_trailer,
+ .flags = AVFMT_TS_NEGATIVE,
+ .priv_class = &oga_muxer_class,
+};
+#endif
+
#if CONFIG_SPEEX_MUXER
static const AVClass speex_muxer_class = {
.class_name = "Speex muxer",
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparsecelt.c b/chromium/third_party/ffmpeg/libavformat/oggparsecelt.c
index f3c2c1a632f..d6e99626509 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparsecelt.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparsecelt.c
@@ -48,8 +48,10 @@ static int celt_header(AVFormatContext *s, int idx)
priv = av_malloc(sizeof(struct oggcelt_private));
if (!priv)
return AVERROR(ENOMEM);
- if (ff_alloc_extradata(st->codec, 2 * sizeof(uint32_t)) < 0)
+ if (ff_alloc_extradata(st->codec, 2 * sizeof(uint32_t)) < 0) {
+ av_free(priv);
return AVERROR(ENOMEM);
+ }
version = AV_RL32(p + 28);
/* unused header size field skipped */
sample_rate = AV_RL32(p + 36);
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparseogm.c b/chromium/third_party/ffmpeg/libavformat/oggparseogm.c
index b8c502a5ffd..95369df89ea 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparseogm.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparseogm.c
@@ -79,6 +79,11 @@ ogm_header(AVFormatContext *s, int idx)
size = FFMIN(size, os->psize);
time_unit = bytestream2_get_le64(&p);
spu = bytestream2_get_le64(&p);
+ if (!time_unit || !spu) {
+ av_log(s, AV_LOG_ERROR, "Invalid timing values.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
bytestream2_skip(&p, 4); /* default_len */
bytestream2_skip(&p, 8); /* buffersize + bits_per_sample */
@@ -90,7 +95,7 @@ ogm_header(AVFormatContext *s, int idx)
st->codec->channels = bytestream2_get_le16(&p);
bytestream2_skip(&p, 2); /* block_align */
st->codec->bit_rate = bytestream2_get_le32(&p) * 8;
- st->codec->sample_rate = time_unit ? spu * 10000000 / time_unit : 0;
+ st->codec->sample_rate = spu * 10000000 / time_unit;
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
if (size >= 56 && st->codec->codec_id == AV_CODEC_ID_AAC) {
bytestream2_skip(&p, 4);
@@ -126,15 +131,23 @@ ogm_dshow_header(AVFormatContext *s, int idx)
if(*p != 1)
return 1;
+ if (os->psize < 100)
+ return AVERROR_INVALIDDATA;
t = AV_RL32(p + 96);
if(t == 0x05589f80){
+ if (os->psize < 184)
+ return AVERROR_INVALIDDATA;
+
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(p + 68));
avpriv_set_pts_info(st, 64, AV_RL64(p + 164), 10000000);
st->codec->width = AV_RL32(p + 176);
st->codec->height = AV_RL32(p + 180);
} else if(t == 0x05589f81){
+ if (os->psize < 136)
+ return AVERROR_INVALIDDATA;
+
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, AV_RL16(p + 124));
st->codec->channels = AV_RL16(p + 126);
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparseopus.c b/chromium/third_party/ffmpeg/libavformat/oggparseopus.c
index aafefbbe65b..75c611413ec 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparseopus.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparseopus.c
@@ -32,6 +32,7 @@ struct oggopus_private {
int64_t cur_dts;
};
+#define OPUS_SEEK_PREROLL_MS 80
#define OPUS_HEAD_SIZE 19
static int opus_header(AVFormatContext *avf, int idx)
@@ -66,6 +67,9 @@ static int opus_header(AVFormatContext *avf, int idx)
memcpy(st->codec->extradata, packet, os->psize);
st->codec->sample_rate = 48000;
+ av_codec_set_seek_preroll(st->codec,
+ av_rescale(OPUS_SEEK_PREROLL_MS,
+ st->codec->sample_rate, 1000));
avpriv_set_pts_info(st, 64, 1, 48000);
priv->need_comments = 1;
return 1;
@@ -130,16 +134,13 @@ static int opus_packet(AVFormatContext *avf, int idx)
duration += d;
last_pkt = next_pkt = next_pkt + os->psize;
for (; seg < os->nsegs; seg++) {
- if (os->segments[seg] < 255) {
- int d = opus_duration(last_pkt, os->segments[seg]);
- if (d < 0) {
- duration = os->granule;
- break;
- }
- duration += d;
- last_pkt = next_pkt + os->segments[seg];
- }
next_pkt += os->segments[seg];
+ if (os->segments[seg] < 255 && next_pkt != last_pkt) {
+ int d = opus_duration(last_pkt, next_pkt - last_pkt);
+ if (d > 0)
+ duration += d;
+ last_pkt = next_pkt;
+ }
}
os->lastpts =
os->lastdts = os->granule - duration;
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparseskeleton.c b/chromium/third_party/ffmpeg/libavformat/oggparseskeleton.c
index d94b0c2e07b..6c2105f324f 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparseskeleton.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparseskeleton.c
@@ -34,7 +34,6 @@ static int skeleton_header(AVFormatContext *s, int idx)
uint64_t start_granule;
int target_idx, start_time;
- strcpy(st->codec->codec_name, "skeleton");
st->codec->codec_type = AVMEDIA_TYPE_DATA;
if ((os->flags & OGG_FLAG_EOS) && os->psize == 0)
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparsetheora.c b/chromium/third_party/ffmpeg/libavformat/oggparsetheora.c
index 6458b97bc0a..59df17efba1 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparsetheora.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparsetheora.c
@@ -131,6 +131,8 @@ static int theora_header(AVFormatContext *s, int idx)
st->codec->extradata_size = 0;
return err;
}
+ memset(st->codec->extradata + cds, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+
cdp = st->codec->extradata + st->codec->extradata_size;
*cdp++ = os->psize >> 8;
*cdp++ = os->psize & 0xff;
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparsevorbis.c b/chromium/third_party/ffmpeg/libavformat/oggparsevorbis.c
index 36ad7384ea4..2d8cb15af9a 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparsevorbis.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparsevorbis.c
@@ -36,6 +36,7 @@
#include "internal.h"
#include "oggdec.h"
#include "vorbiscomment.h"
+#include "replaygain.h"
static int ogm_chapter(AVFormatContext *as, uint8_t *key, uint8_t *val)
{
@@ -155,16 +156,21 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
av_log(as, AV_LOG_WARNING, "Failed to parse cover art block.\n");
continue;
}
- } else if (!ogm_chapter(as, tt, ct))
+ } else if (!ogm_chapter(as, tt, ct)) {
+ if (av_dict_get(*m, tt, NULL, 0)) {
+ av_dict_set(m, tt, ";", AV_DICT_APPEND);
+ }
av_dict_set(m, tt, ct,
AV_DICT_DONT_STRDUP_KEY |
- AV_DICT_DONT_STRDUP_VAL);
+ AV_DICT_APPEND);
+ av_freep(&ct);
+ }
}
}
if (p != end)
av_log(as, AV_LOG_INFO,
- "%ti bytes of comment header remain\n", end - p);
+ "%"PTRDIFF_SPECIFIER" bytes of comment header remain\n", end - p);
if (n > 0)
av_log(as, AV_LOG_INFO,
"truncated comment header, %i comments not found\n", n);
@@ -237,6 +243,36 @@ static void vorbis_cleanup(AVFormatContext *s, int idx)
av_freep(&priv->packet[i]);
}
+static int vorbis_update_metadata(AVFormatContext *s, int idx)
+{
+ struct ogg *ogg = s->priv_data;
+ struct ogg_stream *os = ogg->streams + idx;
+ AVStream *st = s->streams[idx];
+ int ret;
+
+ if (os->psize <= 8)
+ return 0;
+
+ /* New metadata packet; release old data. */
+ av_dict_free(&st->metadata);
+ ret = ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7,
+ os->psize - 8);
+ if (ret < 0)
+ return ret;
+
+ /* Update the metadata if possible. */
+ av_freep(&os->new_metadata);
+ if (st->metadata) {
+ os->new_metadata = av_packet_pack_dictionary(st->metadata, &os->new_metadata_size);
+ /* Send an empty dictionary to indicate that metadata has been cleared. */
+ } else {
+ os->new_metadata = av_malloc(1);
+ os->new_metadata_size = 0;
+ }
+
+ return ret;
+}
+
static int vorbis_header(AVFormatContext *s, int idx)
{
struct ogg *ogg = s->priv_data;
@@ -312,11 +348,15 @@ static int vorbis_header(AVFormatContext *s, int idx)
avpriv_set_pts_info(st, 64, 1, srate);
}
} else if (os->buf[os->pstart] == 3) {
- if (os->psize > 8 &&
- ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7,
- os->psize - 8) >= 0) {
+ if (vorbis_update_metadata(s, idx) >= 0 && priv->len[1] > 10) {
+ unsigned new_len;
+
+ int ret = ff_replaygain_export(st, st->metadata);
+ if (ret < 0)
+ return ret;
+
// drop all metadata we parsed and which is not required by libvorbis
- unsigned new_len = 7 + 4 + AV_RL32(priv->packet[1] + 7) + 4 + 1;
+ new_len = 7 + 4 + AV_RL32(priv->packet[1] + 7) + 4 + 1;
if (new_len >= 16 && new_len < os->psize) {
AV_WL32(priv->packet[1] + new_len - 5, 0);
priv->packet[1][new_len - 1] = 1;
@@ -345,13 +385,13 @@ static int vorbis_packet(AVFormatContext *s, int idx)
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + idx;
struct oggvorbis_private *priv = os->private;
- int duration;
+ int duration, flags = 0;
/* first packet handling
* here we parse the duration of each packet in the first page and compare
* the total duration to the page granule to find the encoder delay and
* set the first timestamp */
- if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS)) {
+ if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS) && (int64_t)os->granule>=0) {
int seg, d;
uint8_t *last_pkt = os->buf + os->pstart;
uint8_t *next_pkt = last_pkt;
@@ -359,19 +399,25 @@ static int vorbis_packet(AVFormatContext *s, int idx)
avpriv_vorbis_parse_reset(&priv->vp);
duration = 0;
seg = os->segp;
- d = avpriv_vorbis_parse_frame(&priv->vp, last_pkt, 1);
+ d = avpriv_vorbis_parse_frame_flags(&priv->vp, last_pkt, 1, &flags);
if (d < 0) {
os->pflags |= AV_PKT_FLAG_CORRUPT;
return 0;
+ } else if (flags & VORBIS_FLAG_COMMENT) {
+ vorbis_update_metadata(s, idx);
+ flags = 0;
}
duration += d;
last_pkt = next_pkt = next_pkt + os->psize;
for (; seg < os->nsegs; seg++) {
if (os->segments[seg] < 255) {
- int d = avpriv_vorbis_parse_frame(&priv->vp, last_pkt, 1);
+ int d = avpriv_vorbis_parse_frame_flags(&priv->vp, last_pkt, 1, &flags);
if (d < 0) {
duration = os->granule;
break;
+ } else if (flags & VORBIS_FLAG_COMMENT) {
+ vorbis_update_metadata(s, idx);
+ flags = 0;
}
duration += d;
last_pkt = next_pkt + os->segments[seg];
@@ -380,9 +426,13 @@ static int vorbis_packet(AVFormatContext *s, int idx)
}
os->lastpts =
os->lastdts = os->granule - duration;
+
+ if (!os->granule && duration) //hack to deal with broken files (Ticket3710)
+ os->lastpts = os->lastdts = AV_NOPTS_VALUE;
+
if (s->streams[idx]->start_time == AV_NOPTS_VALUE) {
s->streams[idx]->start_time = FFMAX(os->lastpts, 0);
- if (s->streams[idx]->duration)
+ if (s->streams[idx]->duration != AV_NOPTS_VALUE)
s->streams[idx]->duration -= s->streams[idx]->start_time;
}
priv->final_pts = AV_NOPTS_VALUE;
@@ -391,10 +441,13 @@ static int vorbis_packet(AVFormatContext *s, int idx)
/* parse packet duration */
if (os->psize > 0) {
- duration = avpriv_vorbis_parse_frame(&priv->vp, os->buf + os->pstart, 1);
+ duration = avpriv_vorbis_parse_frame_flags(&priv->vp, os->buf + os->pstart, 1, &flags);
if (duration < 0) {
os->pflags |= AV_PKT_FLAG_CORRUPT;
return 0;
+ } else if (flags & VORBIS_FLAG_COMMENT) {
+ vorbis_update_metadata(s, idx);
+ flags = 0;
}
os->pduration = duration;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparsevp8.c b/chromium/third_party/ffmpeg/libavformat/oggparsevp8.c
new file mode 100644
index 00000000000..89295c86a68
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/oggparsevp8.c
@@ -0,0 +1,137 @@
+/*
+ * On2 VP8 parser for Ogg
+ * Copyright (C) 2013 James Almer
+ *
+ * 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 "libavutil/intreadwrite.h"
+#include "avformat.h"
+#include "internal.h"
+#include "oggdec.h"
+
+#define VP8_HEADER_SIZE 26
+
+static int vp8_header(AVFormatContext *s, int idx)
+{
+ struct ogg *ogg = s->priv_data;
+ struct ogg_stream *os = ogg->streams + idx;
+ uint8_t *p = os->buf + os->pstart;
+ AVStream *st = s->streams[idx];
+ AVRational framerate;
+
+ if (os->psize < 7 || p[0] != 0x4f)
+ return 0;
+
+ switch (p[5]){
+ case 0x01:
+ if (os->psize < VP8_HEADER_SIZE) {
+ av_log(s, AV_LOG_ERROR, "Invalid OggVP8 header packet");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (p[6] != 1) {
+ av_log(s, AV_LOG_WARNING, "Unknown OggVP8 version %d.%d\n", p[6], p[7]);
+ return AVERROR_INVALIDDATA;
+ }
+
+ st->codec->width = AV_RB16(p + 8);
+ st->codec->height = AV_RB16(p + 10);
+ st->sample_aspect_ratio.num = AV_RB24(p + 12);
+ st->sample_aspect_ratio.den = AV_RB24(p + 15);
+ framerate.den = AV_RB32(p + 18);
+ framerate.num = AV_RB32(p + 22);
+
+ avpriv_set_pts_info(st, 64, framerate.num, framerate.den);
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ st->codec->codec_id = AV_CODEC_ID_VP8;
+ st->need_parsing = AVSTREAM_PARSE_HEADERS;
+ break;
+ case 0x02:
+ if (p[6] != 0x20)
+ return AVERROR_INVALIDDATA;
+ ff_vorbis_comment(s, &st->metadata, p + 7, os->psize - 7);
+ break;
+ default:
+ av_log(s, AV_LOG_ERROR, "Unknown VP8 header type 0x%02X\n", p[5]);
+ return AVERROR_INVALIDDATA;
+ }
+
+ return 1;
+}
+
+static uint64_t vp8_gptopts(AVFormatContext *s, int idx, uint64_t granule, int64_t *dts)
+{
+ struct ogg *ogg = s->priv_data;
+ struct ogg_stream *os = ogg->streams + idx;
+
+ uint64_t pts = (granule >> 32);
+ uint32_t dist = (granule >> 3) & 0x07ffffff;
+
+ if (!dist)
+ os->pflags |= AV_PKT_FLAG_KEY;
+
+ if (dts)
+ *dts = pts;
+
+ return pts;
+}
+
+static int vp8_packet(AVFormatContext *s, int idx)
+{
+ struct ogg *ogg = s->priv_data;
+ struct ogg_stream *os = ogg->streams + idx;
+ uint8_t *p = os->buf + os->pstart;
+
+ if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS)) {
+ int seg;
+ int duration;
+ uint8_t *last_pkt = p;
+ uint8_t *next_pkt;
+
+ seg = os->segp;
+ duration = (last_pkt[0] >> 4) & 1;
+ next_pkt = last_pkt += os->psize;
+ for (; seg < os->nsegs; seg++) {
+ if (os->segments[seg] < 255) {
+ duration += (last_pkt[0] >> 4) & 1;
+ last_pkt = next_pkt + os->segments[seg];
+ }
+ next_pkt += os->segments[seg];
+ }
+ os->lastpts = os->lastdts = vp8_gptopts(s, idx, os->granule, NULL) - duration;
+ if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
+ s->streams[idx]->start_time = os->lastpts;
+ if (s->streams[idx]->duration)
+ s->streams[idx]->duration -= s->streams[idx]->start_time;
+ }
+ }
+
+ if (os->psize > 0)
+ os->pduration = (p[0] >> 4) & 1;
+
+ return 0;
+}
+
+const struct ogg_codec ff_vp8_codec = {
+ .magic = "OVP80",
+ .magicsize = 5,
+ .header = vp8_header,
+ .packet = vp8_packet,
+ .gptopts = vp8_gptopts,
+ .nb_header = 1,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/omadec.c b/chromium/third_party/ffmpeg/libavformat/omadec.c
index 6a08076f473..9f3d3aa860f 100644
--- a/chromium/third_party/ffmpeg/libavformat/omadec.c
+++ b/chromium/third_party/ffmpeg/libavformat/omadec.c
@@ -37,8 +37,11 @@
* - Sound data organized in packets follow the EA3 header
* (can be encrypted using the Sony DRM!).
*
+ * Supported decoders: ATRAC3, ATRAC3+, MP3, LPCM
*/
+#include <inttypes.h>
+
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
@@ -214,7 +217,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
if (geob->datasize < 64) {
av_log(s, AV_LOG_ERROR,
- "Invalid GEOB data size: %u\n", geob->datasize);
+ "Invalid GEOB data size: %"PRIu32"\n", geob->datasize);
return AVERROR_INVALIDDATA;
}
@@ -238,7 +241,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
return AVERROR_INVALIDDATA;
}
oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]);
- av_log(s, AV_LOG_DEBUG, "RID: %.8x\n", oc->rid);
+ av_log(s, AV_LOG_DEBUG, "RID: %.8"PRIx32"\n", oc->rid);
memcpy(oc->iv, &header[0x58], 8);
hex_log(s, AV_LOG_DEBUG, "IV", oc->iv, 8);
@@ -292,7 +295,7 @@ static int oma_read_header(AVFormatContext *s)
ID3v2ExtraMeta *extra_meta = NULL;
OMAContext *oc = s->priv_data;
- ff_id3v2_read(s, ID3v2_EA3_MAGIC, &extra_meta);
+ ff_id3v2_read(s, ID3v2_EA3_MAGIC, &extra_meta, 0);
ret = avio_read(s->pb, buf, EA3_HEADER_SIZE);
if (ret < EA3_HEADER_SIZE)
return -1;
@@ -365,7 +368,7 @@ static int oma_read_header(AVFormatContext *s)
channel_id = (codec_params >> 10) & 7;
if (!channel_id) {
av_log(s, AV_LOG_ERROR,
- "Invalid ATRAC-X channel id: %d\n", channel_id);
+ "Invalid ATRAC-X channel id: %"PRIu32"\n", channel_id);
return AVERROR_INVALIDDATA;
}
st->codec->channel_layout = ff_oma_chid_to_native_layout[channel_id - 1];
@@ -379,7 +382,6 @@ static int oma_read_header(AVFormatContext *s)
st->codec->sample_rate = samplerate;
st->codec->bit_rate = samplerate * framesize * 8 / 2048;
avpriv_set_pts_info(st, 64, 1, samplerate);
- av_log(s, AV_LOG_ERROR, "Unsupported codec ATRAC3+!\n");
break;
case OMA_CODECID_MP3:
st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
@@ -448,7 +450,7 @@ static int oma_read_probe(AVProbeData *p)
/* This check cannot overflow as tag_len has at most 28 bits */
if (p->buf_size < tag_len + 5)
/* EA3 header comes late, might be outside of the probe buffer */
- return tag_len ? AVPROBE_SCORE_EXTENSION : 0;
+ return tag_len ? AVPROBE_SCORE_EXTENSION/2 : 0;
buf += tag_len;
diff --git a/chromium/third_party/ffmpeg/libavformat/options.c b/chromium/third_party/ffmpeg/libavformat/options.c
index 5218e5b92a4..e0d6df6fbde 100644
--- a/chromium/third_party/ffmpeg/libavformat/options.c
+++ b/chromium/third_party/ffmpeg/libavformat/options.c
@@ -19,6 +19,7 @@
*/
#include "avformat.h"
#include "avio_internal.h"
+#include "internal.h"
#include "libavutil/opt.h"
/**
@@ -109,6 +110,13 @@ AVFormatContext *avformat_alloc_context(void)
ic = av_malloc(sizeof(AVFormatContext));
if (!ic) return ic;
avformat_get_context_defaults(ic);
+
+ ic->internal = av_mallocz(sizeof(*ic->internal));
+ if (!ic->internal) {
+ avformat_free_context(ic);
+ return NULL;
+ }
+
return ic;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/options_table.h b/chromium/third_party/ffmpeg/libavformat/options_table.h
index 8145325c1c7..359b38483aa 100644
--- a/chromium/third_party/ffmpeg/libavformat/options_table.h
+++ b/chromium/third_party/ffmpeg/libavformat/options_table.h
@@ -50,6 +50,7 @@ static const AVOption avformat_options[] = {
{"latm", "enable RTP MP4A-LATM payload", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_MP4A_LATM }, INT_MIN, INT_MAX, E, "fflags"},
{"nobuffer", "reduce the latency introduced by optional buffering", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOBUFFER }, 0, INT_MAX, D, "fflags"},
{"seek2any", "allow seeking to non-keyframes on demuxer level when supported", OFFSET(seek2any), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, D},
+{"bitexact", "do not write random/volatile data", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_BITEXACT }, 0, 0, E, "fflags" },
{"analyzeduration", "specify how many microseconds are analyzed to probe the input", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT, {.i64 = 5*AV_TIME_BASE }, 0, INT_MAX, D},
{"cryptokey", "decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, {.dbl = 0}, 0, 0, D},
{"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), AV_OPT_TYPE_INT, {.i64 = 1<<20 }, 0, INT_MAX, D},
@@ -57,6 +58,7 @@ static const AVOption avformat_options[] = {
{"fdebug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, 0, INT_MAX, E|D, "fdebug"},
{"ts", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_FDEBUG_TS }, INT_MIN, INT_MAX, E|D, "fdebug"},
{"max_delay", "maximum muxing or demuxing delay in microseconds", OFFSET(max_delay), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, INT_MAX, E|D},
+{"start_time_realtime", "wall-clock time when stream begins (PTS==0)", OFFSET(start_time_realtime), AV_OPT_TYPE_INT64, {.i64 = AV_NOPTS_VALUE}, INT64_MIN, INT64_MAX, E},
{"fpsprobesize", "number of frames used to probe fps", OFFSET(fps_probe_size), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX-1, D},
{"audio_preload", "microseconds by which audio packets should be interleaved earlier", OFFSET(audio_preload), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, E},
{"chunk_duration", "microseconds for each chunk", OFFSET(max_chunk_duration), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, E},
@@ -69,14 +71,22 @@ static const AVOption avformat_options[] = {
{"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, D, "err_detect"},
{"buffer", "detect improper bitstream length", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BUFFER }, INT_MIN, INT_MAX, D, "err_detect"},
{"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_EXPLODE }, INT_MIN, INT_MAX, D, "err_detect"},
+{"ignore_err", "ignore errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_IGNORE_ERR }, INT_MIN, INT_MAX, D, "err_detect"},
{"careful", "consider things that violate the spec, are fast to check and have not been seen in the wild as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CAREFUL }, INT_MIN, INT_MAX, D, "err_detect"},
{"compliant", "consider all spec non compliancies as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_COMPLIANT }, INT_MIN, INT_MAX, D, "err_detect"},
{"aggressive", "consider things that a sane encoder shouldn't do as an error", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_AGGRESSIVE }, INT_MIN, INT_MAX, D, "err_detect"},
{"use_wallclock_as_timestamps", "use wallclock as timestamps", OFFSET(use_wallclock_as_timestamps), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, D},
-{"avoid_negative_ts", "shift timestamps to make them non-negative. 1 enables, 0 disables, default of -1 enables when required by target format.", OFFSET(avoid_negative_ts), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, E},
+{"avoid_negative_ts", "shift timestamps so they start at 0", OFFSET(avoid_negative_ts), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, E, "avoid_negative_ts"},
+{"auto", "enabled when required by target format", 0, AV_OPT_TYPE_CONST, {.i64 = -1 }, INT_MIN, INT_MAX, E, "avoid_negative_ts"},
+{"disabled", "do not change timestamps", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, E, "avoid_negative_ts"},
+{"make_zero", "shift timestamps so they start at 0", 0, AV_OPT_TYPE_CONST, {.i64 = 2 }, INT_MIN, INT_MAX, E, "avoid_negative_ts"},
+{"make_non_negative", "shift timestamps so they are non negative", 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, INT_MIN, INT_MAX, E, "avoid_negative_ts"},
{"skip_initial_bytes", "set number of bytes to skip before reading header and frames", OFFSET(skip_initial_bytes), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, D},
{"correct_ts_overflow", "correct single timestamp overflows", OFFSET(correct_ts_overflow), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, D},
{"flush_packets", "enable flushing of the I/O context after each packet", OFFSET(flush_packets), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E},
+{"metadata_header_padding", "set number of bytes to be written as padding in a metadata header", OFFSET(metadata_header_padding), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, E},
+{"output_ts_offset", "set output timestamp offset", OFFSET(output_ts_offset), AV_OPT_TYPE_DURATION, {.i64 = 0}, -INT64_MAX, INT64_MAX, E},
+{"max_interleave_delta", "maximum buffering duration for interleaving", OFFSET(max_interleave_delta), AV_OPT_TYPE_INT64, { .i64 = 10000000 }, 0, INT64_MAX, E },
{NULL},
};
diff --git a/chromium/third_party/ffmpeg/libavformat/paf.c b/chromium/third_party/ffmpeg/libavformat/paf.c
index 09aefe6770b..88a274fe156 100644
--- a/chromium/third_party/ffmpeg/libavformat/paf.c
+++ b/chromium/third_party/ffmpeg/libavformat/paf.c
@@ -44,13 +44,13 @@ typedef struct {
uint32_t *blocks_offset_table;
uint8_t *video_frame;
- int video_size;
+ int video_size;
uint8_t *audio_frame;
uint8_t *temp_audio_frame;
- int audio_size;
+ int audio_size;
- int got_audio;
+ int got_audio;
} PAFDemuxContext;
static int read_probe(AVProbeData *p)
@@ -87,10 +87,10 @@ static void read_table(AVFormatContext *s, uint32_t *table, uint32_t count)
static int read_header(AVFormatContext *s)
{
- PAFDemuxContext *p = s->priv_data;
+ PAFDemuxContext *p = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *ast, *vst;
- int ret = 0;
+ int ret = 0;
avio_skip(pb, 132);
@@ -101,11 +101,13 @@ static int read_header(AVFormatContext *s)
vst->start_time = 0;
vst->nb_frames =
vst->duration =
- p->nb_frames = avio_rl32(pb);
+ p->nb_frames = avio_rl32(pb);
avio_skip(pb, 4);
+
vst->codec->width = avio_rl32(pb);
vst->codec->height = avio_rl32(pb);
avio_skip(pb, 4);
+
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
vst->codec->codec_tag = 0;
vst->codec->codec_id = AV_CODEC_ID_PAF_VIDEO;
@@ -115,13 +117,13 @@ static int read_header(AVFormatContext *s)
if (!ast)
return AVERROR(ENOMEM);
- ast->start_time = 0;
- ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- ast->codec->codec_tag = 0;
- ast->codec->codec_id = AV_CODEC_ID_PAF_AUDIO;
- ast->codec->channels = 2;
+ ast->start_time = 0;
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ ast->codec->codec_tag = 0;
+ ast->codec->codec_id = AV_CODEC_ID_PAF_AUDIO;
+ ast->codec->channels = 2;
ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
- ast->codec->sample_rate = 22050;
+ ast->codec->sample_rate = 22050;
avpriv_set_pts_info(ast, 64, 1, 22050);
p->buffer_size = avio_rl32(pb);
@@ -143,16 +145,19 @@ static int read_header(AVFormatContext *s)
p->frame_blks > INT_MAX / sizeof(uint32_t))
return AVERROR_INVALIDDATA;
- p->blocks_count_table = av_mallocz(p->nb_frames * sizeof(uint32_t));
- p->frames_offset_table = av_mallocz(p->nb_frames * sizeof(uint32_t));
- p->blocks_offset_table = av_mallocz(p->frame_blks * sizeof(uint32_t));
+ p->blocks_count_table = av_mallocz(p->nb_frames *
+ sizeof(*p->blocks_count_table));
+ p->frames_offset_table = av_mallocz(p->nb_frames *
+ sizeof(*p->frames_offset_table));
+ p->blocks_offset_table = av_mallocz(p->frame_blks *
+ sizeof(*p->blocks_offset_table));
- p->video_size = p->max_video_blks * p->buffer_size;
- p->video_frame = av_mallocz(p->video_size);
+ p->video_size = p->max_video_blks * p->buffer_size;
+ p->video_frame = av_mallocz(p->video_size);
- p->audio_size = p->max_audio_blks * p->buffer_size;
- p->audio_frame = av_mallocz(p->audio_size);
- p->temp_audio_frame = av_mallocz(p->audio_size);
+ p->audio_size = p->max_audio_blks * p->buffer_size;
+ p->audio_frame = av_mallocz(p->audio_size);
+ p->temp_audio_frame = av_mallocz(p->audio_size);
if (!p->blocks_count_table ||
!p->frames_offset_table ||
@@ -186,7 +191,7 @@ fail:
static int read_packet(AVFormatContext *s, AVPacket *pkt)
{
- PAFDemuxContext *p = s->priv_data;
+ PAFDemuxContext *p = s->priv_data;
AVIOContext *pb = s->pb;
uint32_t count, offset;
int size, i;
@@ -209,7 +214,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
return pkt->size;
}
- count = (p->current_frame == 0) ? p->preload_count : p->blocks_count_table[p->current_frame - 1];
+ count = (p->current_frame == 0) ? p->preload_count
+ : p->blocks_count_table[p->current_frame - 1];
for (i = 0; i < count; i++) {
if (p->current_frame_block >= p->frame_blks)
return AVERROR_INVALIDDATA;
@@ -245,7 +251,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->duration = 1;
memcpy(pkt->data, p->video_frame + p->frames_offset_table[p->current_frame], size);
if (pkt->data[0] & 0x20)
- pkt->flags |= AV_PKT_FLAG_KEY;
+ pkt->flags |= AV_PKT_FLAG_KEY;
p->current_frame++;
return pkt->size;
diff --git a/chromium/third_party/ffmpeg/libavformat/pcm.c b/chromium/third_party/ffmpeg/libavformat/pcm.c
index 2fe44dcb407..a57a4b62493 100644
--- a/chromium/third_party/ffmpeg/libavformat/pcm.c
+++ b/chromium/third_party/ffmpeg/libavformat/pcm.c
@@ -37,8 +37,6 @@ int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
pkt->stream_index = 0;
- if (ret < 0)
- return ret;
return ret;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/pjsdec.c b/chromium/third_party/ffmpeg/libavformat/pjsdec.c
index a69a31660da..6f5db378866 100644
--- a/chromium/third_party/ffmpeg/libavformat/pjsdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/pjsdec.c
@@ -53,7 +53,8 @@ static int64_t read_ts(char **line, int *duration)
int64_t start, end;
if (sscanf(*line, "%"SCNd64",%"SCNd64, &start, &end) == 2) {
- *line += strcspn(*line, "\"") + 1;
+ *line += strcspn(*line, "\"");
+ *line += !!**line;
*duration = end - start;
return start;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/pmpdec.c b/chromium/third_party/ffmpeg/libavformat/pmpdec.c
index 71f450e9d37..d03283722a3 100644
--- a/chromium/third_party/ffmpeg/libavformat/pmpdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/pmpdec.c
@@ -138,10 +138,12 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt)
if (pmp->cur_stream == 0) {
int num_packets;
pmp->audio_packets = avio_r8(pb);
+
if (!pmp->audio_packets) {
- avpriv_request_sample(s, "0 audio packets");
- return AVERROR_PATCHWELCOME;
+ av_log(s, AV_LOG_ERROR, "No audio packets.\n");
+ return AVERROR_INVALIDDATA;
}
+
num_packets = (pmp->num_streams - 1) * pmp->audio_packets + 1;
avio_skip(pb, 8);
pmp->current_packet = 0;
@@ -158,10 +160,6 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt)
ret = av_get_packet(pb, pkt, pmp->packet_sizes[pmp->current_packet]);
if (ret >= 0) {
ret = 0;
- // FIXME: this is a hack that should be removed once
- // compute_pkt_fields() can handle timestamps properly
- if (pmp->cur_stream == 0)
- pkt->dts = s->streams[0]->cur_dts++;
pkt->stream_index = pmp->cur_stream;
}
if (pmp->current_packet % pmp->audio_packets == 0)
diff --git a/chromium/third_party/ffmpeg/libavformat/psxstr.c b/chromium/third_party/ffmpeg/libavformat/psxstr.c
index 3409d6a5af8..5efcadf64e6 100644
--- a/chromium/third_party/ffmpeg/libavformat/psxstr.c
+++ b/chromium/third_party/ffmpeg/libavformat/psxstr.c
@@ -221,6 +221,7 @@ static int str_read_packet(AVFormatContext *s,
av_free_packet(pkt);
if (av_new_packet(pkt, sector_count*VIDEO_DATA_CHUNK_SIZE))
return AVERROR(EIO);
+ memset(pkt->data, 0, sector_count*VIDEO_DATA_CHUNK_SIZE);
pkt->pos= avio_tell(pb) - RAW_CD_SECTOR_SIZE;
pkt->stream_index =
diff --git a/chromium/third_party/ffmpeg/libavformat/pva.c b/chromium/third_party/ffmpeg/libavformat/pva.c
index 9b7a40a0682..18ab1cd3fc0 100644
--- a/chromium/third_party/ffmpeg/libavformat/pva.c
+++ b/chromium/third_party/ffmpeg/libavformat/pva.c
@@ -85,6 +85,7 @@ static int read_part_of_packet(AVFormatContext *s, int64_t *pts,
PVAContext *pvactx = s->priv_data;
int syncword, streamid, reserved, flags, length, pts_flag;
int64_t pva_pts = AV_NOPTS_VALUE, startpos;
+ int ret;
recover:
startpos = avio_tell(pb);
@@ -133,8 +134,8 @@ recover:
pes_flags = avio_rb16(pb);
pes_header_data_length = avio_r8(pb);
- if (pes_signal != 1) {
- pva_log(s, AV_LOG_WARNING, "expected signaled PES packet, "
+ if (pes_signal != 1 || pes_header_data_length == 0) {
+ pva_log(s, AV_LOG_WARNING, "expected non empty signaled PES packet, "
"trying to recover\n");
avio_skip(pb, length - 9);
if (!read_packet)
@@ -142,15 +143,23 @@ recover:
goto recover;
}
- avio_read(pb, pes_header_data, pes_header_data_length);
+ ret = avio_read(pb, pes_header_data, pes_header_data_length);
+ if (ret != pes_header_data_length)
+ return ret < 0 ? ret : AVERROR_INVALIDDATA;
length -= 9 + pes_header_data_length;
pes_packet_length -= 3 + pes_header_data_length;
pvactx->continue_pes = pes_packet_length;
- if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20)
+ if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20) {
+ if (pes_header_data_length < 5) {
+ pva_log(s, AV_LOG_ERROR, "header too short\n");
+ avio_skip(pb, length);
+ return AVERROR_INVALIDDATA;
+ }
pva_pts = ff_parse_pes_pts(pes_header_data);
+ }
}
pvactx->continue_pes -= length;
diff --git a/chromium/third_party/ffmpeg/libavformat/rawdec.c b/chromium/third_party/ffmpeg/libavformat/rawdec.c
index a9ff22ae182..9b2aa3551e4 100644
--- a/chromium/third_party/ffmpeg/libavformat/rawdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/rawdec.c
@@ -28,6 +28,7 @@
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avassert.h"
+#include "libavutil/intreadwrite.h"
#define RAW_PACKET_SIZE 1024
@@ -121,6 +122,7 @@ AVInputFormat ff_data_demuxer = {
#endif
#if CONFIG_LATM_DEMUXER
+
AVInputFormat ff_latm_demuxer = {
.name = "latm",
.long_name = NULL_IF_CONFIG_SMALL("raw LOAS/LATM"),
diff --git a/chromium/third_party/ffmpeg/libavformat/rawenc.c b/chromium/third_party/ffmpeg/libavformat/rawenc.c
index 7a1fa93e8ba..abd7e66978e 100644
--- a/chromium/third_party/ffmpeg/libavformat/rawenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/rawenc.c
@@ -29,6 +29,16 @@ int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
+static int force_one_stream(AVFormatContext *s)
+{
+ if (s->nb_streams != 1) {
+ av_log(s, AV_LOG_ERROR, "%s files have exactly one stream\n",
+ s->oformat->name);
+ return AVERROR(EINVAL);
+ }
+ return 0;
+}
+
/* Note: Do not forget to add new entries to the Makefile as well. */
#if CONFIG_AC3_MUXER
@@ -39,6 +49,7 @@ AVOutputFormat ff_ac3_muxer = {
.extensions = "ac3",
.audio_codec = AV_CODEC_ID_AC3,
.video_codec = AV_CODEC_ID_NONE,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -51,6 +62,7 @@ AVOutputFormat ff_adx_muxer = {
.extensions = "adx",
.audio_codec = AV_CODEC_ID_ADPCM_ADX,
.video_codec = AV_CODEC_ID_NONE,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -63,6 +75,7 @@ AVOutputFormat ff_cavsvideo_muxer = {
.extensions = "cavs",
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_CAVS,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -72,6 +85,7 @@ AVOutputFormat ff_cavsvideo_muxer = {
AVOutputFormat ff_data_muxer = {
.name = "data",
.long_name = NULL_IF_CONFIG_SMALL("raw data"),
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -84,6 +98,7 @@ AVOutputFormat ff_dirac_muxer = {
.extensions = "drc",
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_DIRAC,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -96,6 +111,7 @@ AVOutputFormat ff_dnxhd_muxer = {
.extensions = "dnxhd",
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_DNXHD,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -109,6 +125,7 @@ AVOutputFormat ff_dts_muxer = {
.extensions = "dts",
.audio_codec = AV_CODEC_ID_DTS,
.video_codec = AV_CODEC_ID_NONE,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -122,6 +139,7 @@ AVOutputFormat ff_eac3_muxer = {
.extensions = "eac3",
.audio_codec = AV_CODEC_ID_EAC3,
.video_codec = AV_CODEC_ID_NONE,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -135,6 +153,7 @@ AVOutputFormat ff_g722_muxer = {
.extensions = "g722",
.audio_codec = AV_CODEC_ID_ADPCM_G722,
.video_codec = AV_CODEC_ID_NONE,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -148,6 +167,7 @@ AVOutputFormat ff_g723_1_muxer = {
.extensions = "tco,rco",
.audio_codec = AV_CODEC_ID_G723_1,
.video_codec = AV_CODEC_ID_NONE,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -161,6 +181,7 @@ AVOutputFormat ff_h261_muxer = {
.extensions = "h261",
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_H261,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -174,6 +195,7 @@ AVOutputFormat ff_h263_muxer = {
.extensions = "h263",
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_H263,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -186,6 +208,19 @@ AVOutputFormat ff_h264_muxer = {
.extensions = "h264",
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_H264,
+ .write_header = force_one_stream,
+ .write_packet = ff_raw_write_packet,
+ .flags = AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_HEVC_MUXER
+AVOutputFormat ff_hevc_muxer = {
+ .name = "hevc",
+ .long_name = NULL_IF_CONFIG_SMALL("raw HEVC video"),
+ .extensions = "hevc",
+ .audio_codec = AV_CODEC_ID_NONE,
+ .video_codec = AV_CODEC_ID_HEVC,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -211,6 +246,7 @@ AVOutputFormat ff_mjpeg_muxer = {
.extensions = "mjpg,mjpeg",
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_MJPEG,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -223,6 +259,7 @@ AVOutputFormat ff_mlp_muxer = {
.extensions = "mlp",
.audio_codec = AV_CODEC_ID_MLP,
.video_codec = AV_CODEC_ID_NONE,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -236,6 +273,7 @@ AVOutputFormat ff_mpeg1video_muxer = {
.extensions = "mpg,mpeg,m1v",
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_MPEG1VIDEO,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -248,6 +286,7 @@ AVOutputFormat ff_mpeg2video_muxer = {
.extensions = "m2v",
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_MPEG2VIDEO,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -272,6 +311,7 @@ AVOutputFormat ff_truehd_muxer = {
.extensions = "thd",
.audio_codec = AV_CODEC_ID_TRUEHD,
.video_codec = AV_CODEC_ID_NONE,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
@@ -284,6 +324,7 @@ AVOutputFormat ff_vc1_muxer = {
.extensions = "vc1",
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_VC1,
+ .write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
diff --git a/chromium/third_party/ffmpeg/libavformat/replaygain.c b/chromium/third_party/ffmpeg/libavformat/replaygain.c
new file mode 100644
index 00000000000..8b8c81a0c3a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/replaygain.c
@@ -0,0 +1,125 @@
+/*
+ * 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
+ * replaygain tags parsing
+ */
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libavutil/avstring.h"
+#include "libavutil/dict.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/mathematics.h"
+#include "libavutil/mem.h"
+#include "libavutil/replaygain.h"
+
+#include "avformat.h"
+#include "replaygain.h"
+
+static int32_t parse_value(const char *value, int32_t min)
+{
+ char *fraction;
+ int scale = 10000;
+ int32_t mb = 0;
+ int sign = 1;
+ int db;
+
+ if (!value)
+ return min;
+
+ value += strspn(value, " \t");
+
+ if (*value == '-')
+ sign = -1;
+
+ db = strtol(value, &fraction, 0);
+ if (*fraction++ == '.') {
+ while (av_isdigit(*fraction) && scale) {
+ mb += scale * (*fraction - '0');
+ scale /= 10;
+ fraction++;
+ }
+ }
+
+ if (abs(db) > (INT32_MAX - mb) / 100000)
+ return min;
+
+ return db * 100000 + sign * mb;
+}
+
+int ff_replaygain_export_raw(AVStream *st, int32_t tg, uint32_t tp,
+ int32_t ag, uint32_t ap)
+{
+ AVPacketSideData *sd, *tmp;
+ AVReplayGain *replaygain;
+ int i;
+
+ if (tg == INT32_MIN && ag == INT32_MIN)
+ return 0;
+
+ for (i = 0; i < st->nb_side_data; i++) {
+ AVPacketSideData *src_sd = &st->side_data[i];
+
+ if (src_sd->type == AV_PKT_DATA_REPLAYGAIN)
+ return 0;
+ }
+
+ replaygain = av_mallocz(sizeof(*replaygain));
+ if (!replaygain)
+ return AVERROR(ENOMEM);
+
+ tmp = av_realloc_array(st->side_data, st->nb_side_data + 1, sizeof(*tmp));
+ if (!tmp) {
+ av_freep(&replaygain);
+ return AVERROR(ENOMEM);
+ }
+ st->side_data = tmp;
+ st->nb_side_data++;
+
+ sd = &st->side_data[st->nb_side_data - 1];
+ sd->type = AV_PKT_DATA_REPLAYGAIN;
+ sd->data = (uint8_t*)replaygain;
+ sd->size = sizeof(*replaygain);
+
+ replaygain->track_gain = tg;
+ replaygain->track_peak = tp;
+ replaygain->album_gain = ag;
+ replaygain->album_peak = ap;
+
+ return 0;
+}
+
+int ff_replaygain_export(AVStream *st, AVDictionary *metadata)
+{
+ const AVDictionaryEntry *tg, *tp, *ag, *ap;
+
+ tg = av_dict_get(metadata, "REPLAYGAIN_TRACK_GAIN", NULL, 0);
+ tp = av_dict_get(metadata, "REPLAYGAIN_TRACK_PEAK", NULL, 0);
+ ag = av_dict_get(metadata, "REPLAYGAIN_ALBUM_GAIN", NULL, 0);
+ ap = av_dict_get(metadata, "REPLAYGAIN_ALBUM_PEAK", NULL, 0);
+
+ return ff_replaygain_export_raw(st,
+ parse_value(tg ? tg->value : NULL, INT32_MIN),
+ parse_value(tp ? tp->value : NULL, 0),
+ parse_value(ag ? ag->value : NULL, INT32_MIN),
+ parse_value(ap ? ap->value : NULL, 0));
+}
diff --git a/chromium/third_party/ffmpeg/libavformat/replaygain.h b/chromium/third_party/ffmpeg/libavformat/replaygain.h
new file mode 100644
index 00000000000..ceacb21421e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/replaygain.h
@@ -0,0 +1,38 @@
+/*
+ * 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 AVFORMAT_REPLAYGAIN_H
+#define AVFORMAT_REPLAYGAIN_H
+
+#include "libavutil/dict.h"
+
+#include "avformat.h"
+
+/**
+ * Parse replaygain tags and export them as per-stream side data.
+ */
+int ff_replaygain_export(AVStream *st, AVDictionary *metadata);
+
+
+/**
+ * Export already decoded replaygain values as per-stream side data.
+ */
+int ff_replaygain_export_raw(AVStream *st, int32_t tg, uint32_t tp,
+ int32_t ag, uint32_t ap);
+
+#endif /* AVFORMAT_REPLAYGAIN_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/riff.c b/chromium/third_party/ffmpeg/libavformat/riff.c
index 52640d12411..735dea0eaf9 100644
--- a/chromium/third_party/ffmpeg/libavformat/riff.c
+++ b/chromium/third_party/ffmpeg/libavformat/riff.c
@@ -39,9 +39,10 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_H264, MKTAG('S', 'M', 'V', '2') },
{ AV_CODEC_ID_H264, MKTAG('V', 'S', 'S', 'H') },
{ AV_CODEC_ID_H264, MKTAG('Q', '2', '6', '4') }, /* QNAP surveillance system */
- { AV_CODEC_ID_H264, MKTAG('V', '2', '6', '4') },
+ { AV_CODEC_ID_H264, MKTAG('V', '2', '6', '4') }, /* CCTV recordings */
{ AV_CODEC_ID_H264, MKTAG('G', 'A', 'V', 'C') }, /* GeoVision camera */
{ AV_CODEC_ID_H264, MKTAG('U', 'M', 'S', 'V') },
+ { AV_CODEC_ID_H264, MKTAG('I', 'N', 'M', 'C') },
{ AV_CODEC_ID_H263, MKTAG('H', '2', '6', '3') },
{ AV_CODEC_ID_H263, MKTAG('X', '2', '6', '3') },
{ AV_CODEC_ID_H263, MKTAG('T', '2', '6', '3') },
@@ -92,7 +93,6 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_MPEG4, MKTAG('D', 'M', 'K', '2') },
{ AV_CODEC_ID_MPEG4, MKTAG('D', 'Y', 'M', '4') },
{ AV_CODEC_ID_MPEG4, MKTAG('D', 'I', 'G', 'I') },
- { AV_CODEC_ID_MPEG4, MKTAG('I', 'N', 'M', 'C') },
/* Ephv MPEG-4 */
{ AV_CODEC_ID_MPEG4, MKTAG('E', 'P', 'H', 'V') },
{ AV_CODEC_ID_MPEG4, MKTAG('E', 'M', '4', 'A') },
@@ -258,6 +258,8 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_VP6A, MKTAG('V', 'P', '6', 'A') },
{ AV_CODEC_ID_VP6F, MKTAG('V', 'P', '6', 'F') },
{ AV_CODEC_ID_VP6F, MKTAG('F', 'L', 'V', '4') },
+ { AV_CODEC_ID_VP7, MKTAG('V', 'P', '7', '0') },
+ { AV_CODEC_ID_VP7, MKTAG('V', 'P', '7', '1') },
{ AV_CODEC_ID_VP8, MKTAG('V', 'P', '8', '0') },
{ AV_CODEC_ID_VP9, MKTAG('V', 'P', '9', '0') },
{ AV_CODEC_ID_ASV1, MKTAG('A', 'S', 'V', '1') },
@@ -300,7 +302,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_LOCO, MKTAG('L', 'O', 'C', 'O') },
{ AV_CODEC_ID_WNV1, MKTAG('W', 'N', 'V', '1') },
{ AV_CODEC_ID_WNV1, MKTAG('Y', 'U', 'V', '8') },
- { AV_CODEC_ID_AASC, MKTAG('A', 'A', 'S', '4') },
+ { AV_CODEC_ID_AASC, MKTAG('A', 'A', 'S', '4') }, /* Autodesk 24 bit RLE compressor */
{ AV_CODEC_ID_AASC, MKTAG('A', 'A', 'S', 'C') },
{ AV_CODEC_ID_INDEO2, MKTAG('R', 'T', '2', '1') },
{ AV_CODEC_ID_FRAPS, MKTAG('F', 'P', 'S', '1') },
@@ -356,6 +358,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_G2M, MKTAG('G', '2', 'M', '2') },
{ AV_CODEC_ID_G2M, MKTAG('G', '2', 'M', '3') },
{ AV_CODEC_ID_G2M, MKTAG('G', '2', 'M', '4') },
+ { AV_CODEC_ID_FIC, MKTAG('F', 'I', 'C', 'V') },
{ AV_CODEC_ID_NONE, 0 }
};
@@ -407,12 +410,16 @@ const AVCodecTag ff_codec_wav_tags[] = {
{ AV_CODEC_ID_ADPCM_G722, 0x028F },
{ AV_CODEC_ID_IMC, 0x0401 },
{ AV_CODEC_ID_IAC, 0x0402 },
+ { AV_CODEC_ID_ON2AVC, 0x0500 },
+ { AV_CODEC_ID_ON2AVC, 0x0501 },
{ AV_CODEC_ID_GSM_MS, 0x1500 },
{ AV_CODEC_ID_TRUESPEECH, 0x1501 },
/* ADTS AAC */
{ AV_CODEC_ID_AAC, 0x1600 },
{ AV_CODEC_ID_AAC_LATM, 0x1602 },
{ AV_CODEC_ID_AC3, 0x2000 },
+ /* There is no Microsoft Format Tag for E-AC3, the GUID has to be used */
+ { AV_CODEC_ID_EAC3, 0x2000 },
{ AV_CODEC_ID_DTS, 0x2001 },
{ AV_CODEC_ID_SONIC, 0x2048 },
{ AV_CODEC_ID_SONIC_LS, 0x2048 },
@@ -420,7 +427,7 @@ const AVCodecTag ff_codec_wav_tags[] = {
{ AV_CODEC_ID_AAC, 0x706d },
{ AV_CODEC_ID_AAC, 0x4143 },
{ AV_CODEC_ID_XAN_DPCM, 0x594a },
- { AV_CODEC_ID_G723_1, 0xA100 },
+ { AV_CODEC_ID_G723_1, 0xA100 }, /* Comverse Infosys Ltd. G723 1 */
{ AV_CODEC_ID_AAC, 0xA106 },
{ AV_CODEC_ID_SPEEX, 0xA109 },
{ AV_CODEC_ID_FLAC, 0xF1AC },
@@ -456,3 +463,11 @@ const struct AVCodecTag *avformat_get_riff_audio_tags(void)
{
return ff_codec_wav_tags;
}
+
+const AVCodecGuid ff_codec_wav_guids[] = {
+ { AV_CODEC_ID_AC3, { 0x2C, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA } },
+ { AV_CODEC_ID_ATRAC3P, { 0xBF, 0xAA, 0x23, 0xE9, 0x58, 0xCB, 0x71, 0x44, 0xA1, 0x19, 0xFF, 0xFA, 0x01, 0xE4, 0xCE, 0x62 } },
+ { AV_CODEC_ID_EAC3, { 0xAF, 0x87, 0xFB, 0xA7, 0x02, 0x2D, 0xFB, 0x42, 0xA4, 0xD4, 0x05, 0xCD, 0x93, 0x84, 0x3B, 0xDD } },
+ { AV_CODEC_ID_MP2, { 0x2B, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA } },
+ { AV_CODEC_ID_NONE }
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/riff.h b/chromium/third_party/ffmpeg/libavformat/riff.h
index 1bf437e06c8..6f07179b2ae 100644
--- a/chromium/third_party/ffmpeg/libavformat/riff.h
+++ b/chromium/third_party/ffmpeg/libavformat/riff.h
@@ -45,8 +45,22 @@ void ff_end_tag(AVIOContext *pb, int64_t start);
*/
int ff_get_bmp_header(AVIOContext *pb, AVStream *st, unsigned *esize);
-void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
-int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc);
+void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf, int ignore_extradata);
+
+/**
+ * Tell ff_put_wav_header() to use WAVEFORMATEX even for PCM codecs.
+ */
+#define FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX 0x00000001
+
+/**
+ * Write WAVEFORMAT header structure.
+ *
+ * @param flags a combination of FF_PUT_WAV_HEADER_* constants
+ *
+ * @return the size or -1 on error
+ */
+int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc, int flags);
+
enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps);
int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size);
@@ -91,7 +105,9 @@ static av_always_inline int ff_guidcmp(const void *g1, const void *g2)
return memcmp(g1, g2, sizeof(ff_asf_guid));
}
-void ff_get_guid(AVIOContext *s, ff_asf_guid *g);
+int ff_get_guid(AVIOContext *s, ff_asf_guid *g);
+void ff_put_guid(AVIOContext *s, const ff_asf_guid *g);
+const ff_asf_guid *get_codec_guid(enum AVCodecID id, const AVCodecGuid *av_guid);
enum AVCodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid);
diff --git a/chromium/third_party/ffmpeg/libavformat/riffdec.c b/chromium/third_party/ffmpeg/libavformat/riffdec.c
index de8eb5f5885..48c9a941b70 100644
--- a/chromium/third_party/ffmpeg/libavformat/riffdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/riffdec.c
@@ -29,19 +29,14 @@
#include "avio_internal.h"
#include "riff.h"
-const AVCodecGuid ff_codec_wav_guids[] = {
- { AV_CODEC_ID_AC3, { 0x2C, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA } },
- { AV_CODEC_ID_ATRAC3P, { 0xBF, 0xAA, 0x23, 0xE9, 0x58, 0xCB, 0x71, 0x44, 0xA1, 0x19, 0xFF, 0xFA, 0x01, 0xE4, 0xCE, 0x62 } },
- { AV_CODEC_ID_EAC3, { 0xAF, 0x87, 0xFB, 0xA7, 0x02, 0x2D, 0xFB, 0x42, 0xA4, 0xD4, 0x05, 0xCD, 0x93, 0x84, 0x3B, 0xDD } },
- { AV_CODEC_ID_MP2, { 0x2B, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA } },
- { AV_CODEC_ID_NONE }
-};
-
-void ff_get_guid(AVIOContext *s, ff_asf_guid *g)
+int ff_get_guid(AVIOContext *s, ff_asf_guid *g)
{
av_assert0(sizeof(*g) == 16); //compiler will optimize this out
- if (avio_read(s, *g, sizeof(*g)) < (int)sizeof(*g))
+ if (avio_read(s, *g, sizeof(*g)) < (int)sizeof(*g)) {
memset(*g, 0, sizeof(*g));
+ return AVERROR_INVALIDDATA;
+ }
+ return 0;
}
enum AVCodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid)
@@ -117,9 +112,8 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
}
if (cbSize > 0) {
av_free(codec->extradata);
- if (ff_alloc_extradata(codec, cbSize))
+ if (ff_get_extradata(codec, pb, cbSize) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, codec->extradata, codec->extradata_size);
size -= cbSize;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/riffenc.c b/chromium/third_party/ffmpeg/libavformat/riffenc.c
index bcfe018f74e..66c0ff29d63 100644
--- a/chromium/third_party/ffmpeg/libavformat/riffenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/riffenc.c
@@ -31,7 +31,7 @@
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
{
ffio_wfourcc(pb, tag);
- avio_wl32(pb, 0);
+ avio_wl32(pb, -1);
return avio_tell(pb);
}
@@ -51,10 +51,11 @@ void ff_end_tag(AVIOContext *pb, int64_t start)
/* WAVEFORMATEX header */
/* returns the size or -1 on error */
-int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
+int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc, int flags)
{
int bps, blkalign, bytespersec, frame_size;
- int hdrsize = 18;
+ int hdrsize;
+ int64_t hdrstart = avio_tell(pb);
int waveformatextensible;
uint8_t temp[256];
uint8_t *riff_extradata = temp;
@@ -72,6 +73,7 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
waveformatextensible = (enc->channels > 2 && enc->channel_layout) ||
enc->sample_rate > 48000 ||
+ enc->codec_id == AV_CODEC_ID_EAC3 ||
av_get_bits_per_sample(enc->codec_id) > 16;
if (waveformatextensible)
@@ -134,14 +136,12 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
avio_wl16(pb, blkalign); /* block align */
avio_wl16(pb, bps); /* bits per sample */
if (enc->codec_id == AV_CODEC_ID_MP3) {
- hdrsize += 12;
bytestream_put_le16(&riff_extradata, 1); /* wID */
bytestream_put_le32(&riff_extradata, 2); /* fdwFlags */
bytestream_put_le16(&riff_extradata, 1152); /* nBlockSize */
bytestream_put_le16(&riff_extradata, 1); /* nFramesPerBlock */
bytestream_put_le16(&riff_extradata, 1393); /* nCodecDelay */
} else if (enc->codec_id == AV_CODEC_ID_MP2) {
- hdrsize += 22;
/* fwHeadLayer */
bytestream_put_le16(&riff_extradata, 2);
/* dwHeadBitrate */
@@ -159,38 +159,44 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
/* dwPTSHigh */
bytestream_put_le32(&riff_extradata, 0);
} else if (enc->codec_id == AV_CODEC_ID_G723_1) {
- hdrsize += 20;
bytestream_put_le32(&riff_extradata, 0x9ace0002); /* extradata needed for msacm g723.1 codec */
bytestream_put_le32(&riff_extradata, 0xaea2f732);
bytestream_put_le16(&riff_extradata, 0xacde);
} else if (enc->codec_id == AV_CODEC_ID_GSM_MS ||
enc->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV) {
- hdrsize += 2;
/* wSamplesPerBlock */
bytestream_put_le16(&riff_extradata, frame_size);
} else if (enc->extradata_size) {
riff_extradata_start = enc->extradata;
riff_extradata = enc->extradata + enc->extradata_size;
- hdrsize += enc->extradata_size;
}
/* write WAVEFORMATEXTENSIBLE extensions */
if (waveformatextensible) {
- hdrsize += 22;
+ int write_channel_mask = enc->strict_std_compliance < FF_COMPLIANCE_NORMAL ||
+ enc->channel_layout < 0x40000;
/* 22 is WAVEFORMATEXTENSIBLE size */
avio_wl16(pb, riff_extradata - riff_extradata_start + 22);
/* ValidBitsPerSample || SamplesPerBlock || Reserved */
avio_wl16(pb, bps);
/* dwChannelMask */
- avio_wl32(pb, enc->channel_layout);
+ avio_wl32(pb, write_channel_mask ? enc->channel_layout : 0);
/* GUID + next 3 */
+ if (enc->codec_id == AV_CODEC_ID_EAC3) {
+ ff_put_guid(pb, get_codec_guid(enc->codec_id, ff_codec_wav_guids));
+ } else {
avio_wl32(pb, enc->codec_tag);
avio_wl32(pb, 0x00100000);
avio_wl32(pb, 0xAA000080);
avio_wl32(pb, 0x719B3800);
- } else {
+ }
+ } else if ((flags & FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX) ||
+ enc->codec_tag != 0x0001 /* PCM */ ||
+ riff_extradata - riff_extradata_start) {
+ /* WAVEFORMATEX */
avio_wl16(pb, riff_extradata - riff_extradata_start); /* cbSize */
- }
+ } /* else PCMWAVEFORMAT */
avio_write(pb, riff_extradata_start, riff_extradata - riff_extradata_start);
+ hdrsize = avio_tell(pb) - hdrstart;
if (hdrsize & 1) {
hdrsize++;
avio_w8(pb, 0);
@@ -201,10 +207,10 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
/* BITMAPINFOHEADER header */
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
- const AVCodecTag *tags, int for_asf)
+ const AVCodecTag *tags, int for_asf, int ignore_extradata)
{
/* size */
- avio_wl32(pb, 40 + enc->extradata_size);
+ avio_wl32(pb, 40 + (ignore_extradata ? 0 : enc->extradata_size));
avio_wl32(pb, enc->width);
//We always store RGB TopDown
avio_wl32(pb, enc->codec_tag ? enc->height : -enc->height);
@@ -220,10 +226,12 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
avio_wl32(pb, 0);
avio_wl32(pb, 0);
- avio_write(pb, enc->extradata, enc->extradata_size);
+ if (!ignore_extradata) {
+ avio_write(pb, enc->extradata, enc->extradata_size);
- if (!for_asf && enc->extradata_size & 1)
- avio_w8(pb, 0);
+ if (!for_asf && enc->extradata_size & 1)
+ avio_w8(pb, 0);
+ }
}
void ff_parse_specific_params(AVCodecContext *stream, int *au_rate,
@@ -310,3 +318,19 @@ void ff_riff_write_info(AVFormatContext *s)
ff_riff_write_info_tag(s->pb, t->key, t->value);
ff_end_tag(pb, list_pos);
}
+
+void ff_put_guid(AVIOContext *s, const ff_asf_guid *g)
+{
+ av_assert0(sizeof(*g) == 16);
+ avio_write(s, *g, sizeof(*g));
+}
+
+const ff_asf_guid *get_codec_guid(enum AVCodecID id, const AVCodecGuid *av_guid)
+{
+ int i;
+ for (i = 0; av_guid[i].id != AV_CODEC_ID_NONE; i++) {
+ if (id == av_guid[i].id)
+ return &(av_guid[i].guid);
+ }
+ return NULL;
+}
diff --git a/chromium/third_party/ffmpeg/libavformat/rl2.c b/chromium/third_party/ffmpeg/libavformat/rl2.c
index 56f4cf29ff6..d354339ea31 100644
--- a/chromium/third_party/ffmpeg/libavformat/rl2.c
+++ b/chromium/third_party/ffmpeg/libavformat/rl2.c
@@ -127,13 +127,9 @@ static av_cold int rl2_read_header(AVFormatContext *s)
if(signature == RLV3_TAG && back_size > 0)
st->codec->extradata_size += back_size;
- if(ff_alloc_extradata(st->codec, st->codec->extradata_size))
+ if(ff_get_extradata(st->codec, pb, st->codec->extradata_size) < 0)
return AVERROR(ENOMEM);
- if(avio_read(pb,st->codec->extradata,st->codec->extradata_size) !=
- st->codec->extradata_size)
- return AVERROR(EIO);
-
/** setup audio stream if present */
if(sound_rate){
if (!channels || channels > 42) {
diff --git a/chromium/third_party/ffmpeg/libavformat/rmdec.c b/chromium/third_party/ffmpeg/libavformat/rmdec.c
index b0876fe5bd5..36764ee9b22 100644
--- a/chromium/third_party/ffmpeg/libavformat/rmdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/rmdec.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
@@ -86,11 +88,8 @@ static int rm_read_extradata(AVIOContext *pb, AVCodecContext *avctx, unsigned si
{
if (size >= 1<<24)
return -1;
- if (ff_alloc_extradata(avctx, size))
+ if (ff_get_extradata(avctx, pb, size) < 0)
return AVERROR(ENOMEM);
- avctx->extradata_size = avio_read(pb, avctx->extradata, size);
- if (avctx->extradata_size != size)
- return AVERROR(EIO);
return 0;
}
@@ -185,6 +184,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
avio_read(pb, buf, 4);
buf[4] = 0;
} else {
+ AV_WL32(buf, 0);
get_str8(pb, buf, sizeof(buf)); /* desc */
ast->deint_id = AV_RL32(buf);
get_str8(pb, buf, sizeof(buf)); /* desc */
@@ -254,18 +254,6 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
return ret;
}
break;
- default:
- av_strlcpy(st->codec->codec_name, buf, sizeof(st->codec->codec_name));
- }
- if (ast->deint_id == DEINT_ID_INT4 ||
- ast->deint_id == DEINT_ID_GENR ||
- ast->deint_id == DEINT_ID_SIPR) {
- if (st->codec->block_align <= 0 ||
- ast->audio_framesize * sub_packet_h > (unsigned)INT_MAX ||
- ast->audio_framesize * sub_packet_h < st->codec->block_align)
- return AVERROR_INVALIDDATA;
- if (av_new_packet(&ast->pkt, ast->audio_framesize * sub_packet_h) < 0)
- return AVERROR(ENOMEM);
}
switch (ast->deint_id) {
case DEINT_ID_INT4:
@@ -273,11 +261,17 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
sub_packet_h <= 1 ||
ast->coded_framesize * sub_packet_h > (2 + (sub_packet_h & 1)) * ast->audio_framesize)
return AVERROR_INVALIDDATA;
+ if (ast->coded_framesize * sub_packet_h != 2*ast->audio_framesize) {
+ avpriv_request_sample(s, "mismatching interleaver parameters");
+ return AVERROR_INVALIDDATA;
+ }
break;
case DEINT_ID_GENR:
if (ast->sub_packet_size <= 0 ||
ast->sub_packet_size > ast->audio_framesize)
return AVERROR_INVALIDDATA;
+ if (ast->audio_framesize % ast->sub_packet_size)
+ return AVERROR_INVALIDDATA;
break;
case DEINT_ID_SIPR:
case DEINT_ID_INT0:
@@ -285,9 +279,19 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
case DEINT_ID_VBRF:
break;
default:
- av_log(s, AV_LOG_ERROR, "Unknown interleaver %X\n", ast->deint_id);
+ av_log(s, AV_LOG_ERROR ,"Unknown interleaver %"PRIX32"\n", ast->deint_id);
return AVERROR_INVALIDDATA;
}
+ if (ast->deint_id == DEINT_ID_INT4 ||
+ ast->deint_id == DEINT_ID_GENR ||
+ ast->deint_id == DEINT_ID_SIPR) {
+ if (st->codec->block_align <= 0 ||
+ ast->audio_framesize * sub_packet_h > (unsigned)INT_MAX ||
+ ast->audio_framesize * sub_packet_h < st->codec->block_align)
+ return AVERROR_INVALIDDATA;
+ if (av_new_packet(&ast->pkt, ast->audio_framesize * sub_packet_h) < 0)
+ return AVERROR(ENOMEM);
+ }
if (read_all) {
avio_r8(pb);
@@ -785,6 +789,16 @@ rm_ac3_swap_bytes (AVStream *st, AVPacket *pkt)
}
}
+static int readfull(AVFormatContext *s, AVIOContext *pb, uint8_t *dst, int n) {
+ int ret = avio_read(pb, dst, n);
+ if (ret != n) {
+ if (ret >= 0) memset(dst + ret, 0, n - ret);
+ else memset(dst , 0, n);
+ av_log(s, AV_LOG_ERROR, "Failed to fully read block\n");
+ }
+ return ret;
+}
+
int
ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
AVStream *st, RMStream *ast, int len, AVPacket *pkt,
@@ -817,14 +831,14 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
switch (ast->deint_id) {
case DEINT_ID_INT4:
for (x = 0; x < h/2; x++)
- avio_read(pb, ast->pkt.data+x*2*w+y*cfs, cfs);
+ readfull(s, pb, ast->pkt.data+x*2*w+y*cfs, cfs);
break;
case DEINT_ID_GENR:
for (x = 0; x < w/sps; x++)
- avio_read(pb, ast->pkt.data+sps*(h*x+((h+1)/2)*(y&1)+(y>>1)), sps);
+ readfull(s, pb, ast->pkt.data+sps*(h*x+((h+1)/2)*(y&1)+(y>>1)), sps);
break;
case DEINT_ID_SIPR:
- avio_read(pb, ast->pkt.data + y * w, w);
+ readfull(s, pb, ast->pkt.data + y * w, w);
break;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/rpl.c b/chromium/third_party/ffmpeg/libavformat/rpl.c
index 85b573ea1f0..46a5796414e 100644
--- a/chromium/third_party/ffmpeg/libavformat/rpl.c
+++ b/chromium/third_party/ffmpeg/libavformat/rpl.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdint.h>
+#include <inttypes.h>
#include <stdlib.h>
#include "libavutil/avstring.h"
@@ -222,7 +222,8 @@ static int rpl_read_header(AVFormatContext *s)
break;
}
if (ast->codec->codec_id == AV_CODEC_ID_NONE)
- avpriv_request_sample(s, "Audio format %i", audio_format);
+ avpriv_request_sample(s, "Audio format %"PRId32,
+ audio_format);
avpriv_set_pts_info(ast, 32, 1, ast->codec->bit_rate);
} else {
for (i = 0; i < 3; i++)
@@ -254,8 +255,10 @@ static int rpl_read_header(AVFormatContext *s)
int64_t offset, video_size, audio_size;
error |= read_line(pb, line, sizeof(line));
if (3 != sscanf(line, "%"SCNd64" , %"SCNd64" ; %"SCNd64,
- &offset, &video_size, &audio_size))
+ &offset, &video_size, &audio_size)) {
error = -1;
+ continue;
+ }
av_add_index_entry(vst, offset, i * rpl->frames_per_chunk,
video_size, rpl->frames_per_chunk, 0);
if (ast)
diff --git a/chromium/third_party/ffmpeg/libavformat/rsd.c b/chromium/third_party/ffmpeg/libavformat/rsd.c
index 341f638c77c..b6f168633b1 100644
--- a/chromium/third_party/ffmpeg/libavformat/rsd.c
+++ b/chromium/third_party/ffmpeg/libavformat/rsd.c
@@ -104,13 +104,10 @@ static int rsd_read_header(AVFormatContext *s)
/* RSD3GADP is mono, so only alloc enough memory
to store the coeff table for a single channel. */
- if (ff_alloc_extradata(codec, 32))
- return AVERROR(ENOMEM);
-
start = avio_rl32(pb);
- if (avio_read(s->pb, codec->extradata, 32) != 32)
- return AVERROR_INVALIDDATA;
+ if (ff_get_extradata(codec, s->pb, 32) < 0)
+ return AVERROR(ENOMEM);
for (i = 0; i < 16; i++)
AV_WB16(codec->extradata + i * 2, AV_RL16(codec->extradata + i * 2));
diff --git a/chromium/third_party/ffmpeg/libavformat/rtmppkt.c b/chromium/third_party/ffmpeg/libavformat/rtmppkt.c
index 375ae2fcb13..65d5dd9d570 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtmppkt.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtmppkt.c
@@ -169,6 +169,7 @@ static int rtmp_packet_read_one_chunk(URLContext *h, RTMPPacket *p,
uint8_t buf[16];
int channel_id, timestamp, size;
+ uint32_t ts_field; // non-extended timestamp or delta field
uint32_t extra = 0;
enum RTMPPacketType type;
int written = 0;
@@ -193,14 +194,14 @@ static int rtmp_packet_read_one_chunk(URLContext *h, RTMPPacket *p,
type = prev_pkt[channel_id].type;
extra = prev_pkt[channel_id].extra;
- hdr >>= 6;
+ hdr >>= 6; // header size indicator
if (hdr == RTMP_PS_ONEBYTE) {
- timestamp = prev_pkt[channel_id].ts_delta;
+ ts_field = prev_pkt[channel_id].ts_field;
} else {
if (ffurl_read_complete(h, buf, 3) != 3)
return AVERROR(EIO);
written += 3;
- timestamp = AV_RB24(buf);
+ ts_field = AV_RB24(buf);
if (hdr != RTMP_PS_FOURBYTES) {
if (ffurl_read_complete(h, buf, 3) != 3)
return AVERROR(EIO);
@@ -217,11 +218,13 @@ static int rtmp_packet_read_one_chunk(URLContext *h, RTMPPacket *p,
extra = AV_RL32(buf);
}
}
- if (timestamp == 0xFFFFFF) {
- if (ffurl_read_complete(h, buf, 4) != 4)
- return AVERROR(EIO);
- timestamp = AV_RB32(buf);
- }
+ }
+ if (ts_field == 0xFFFFFF) {
+ if (ffurl_read_complete(h, buf, 4) != 4)
+ return AVERROR(EIO);
+ timestamp = AV_RB32(buf);
+ } else {
+ timestamp = ts_field;
}
if (hdr != RTMP_PS_TWELVEBYTES)
timestamp += prev_pkt[channel_id].timestamp;
@@ -232,8 +235,7 @@ static int rtmp_packet_read_one_chunk(URLContext *h, RTMPPacket *p,
return ret;
p->read = written;
p->offset = 0;
- prev_pkt[channel_id].ts_delta = timestamp -
- prev_pkt[channel_id].timestamp;
+ prev_pkt[channel_id].ts_field = ts_field;
prev_pkt[channel_id].timestamp = timestamp;
} else {
// previous packet in this channel hasn't completed reading
@@ -242,7 +244,7 @@ static int rtmp_packet_read_one_chunk(URLContext *h, RTMPPacket *p,
p->size = prev->size;
p->channel_id = prev->channel_id;
p->type = prev->type;
- p->ts_delta = prev->ts_delta;
+ p->ts_field = prev->ts_field;
p->extra = prev->extra;
p->offset = prev->offset;
p->read = prev->read + written;
@@ -271,6 +273,7 @@ static int rtmp_packet_read_one_chunk(URLContext *h, RTMPPacket *p,
prev->data = p->data;
prev->read = p->read;
prev->offset = p->offset;
+ p->data = NULL;
return AVERROR(EAGAIN);
}
@@ -303,21 +306,34 @@ int ff_rtmp_packet_write(URLContext *h, RTMPPacket *pkt,
int written = 0;
int ret;
RTMPPacket *prev_pkt;
+ int use_delta; // flag if using timestamp delta, not RTMP_PS_TWELVEBYTES
+ uint32_t timestamp; // full 32-bit timestamp or delta value
if ((ret = ff_rtmp_check_alloc_array(prev_pkt_ptr, nb_prev_pkt,
pkt->channel_id)) < 0)
return ret;
prev_pkt = *prev_pkt_ptr;
- 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) {
+ use_delta = prev_pkt[pkt->channel_id].channel_id &&
+ pkt->extra == prev_pkt[pkt->channel_id].extra &&
+ pkt->timestamp >= prev_pkt[pkt->channel_id].timestamp;
+
+ timestamp = pkt->timestamp;
+ if (use_delta) {
+ timestamp -= prev_pkt[pkt->channel_id].timestamp;
+ }
+ if (timestamp >= 0xFFFFFF) {
+ pkt->ts_field = 0xFFFFFF;
+ } else {
+ pkt->ts_field = timestamp;
+ }
+
+ if (use_delta) {
if (pkt->type == prev_pkt[pkt->channel_id].type &&
pkt->size == prev_pkt[pkt->channel_id].size) {
mode = RTMP_PS_FOURBYTES;
- if (pkt->ts_delta == prev_pkt[pkt->channel_id].ts_delta)
+ if (pkt->ts_field == prev_pkt[pkt->channel_id].ts_field)
mode = RTMP_PS_ONEBYTE;
} else {
mode = RTMP_PS_EIGHTBYTES;
@@ -334,29 +350,22 @@ int ff_rtmp_packet_write(URLContext *h, RTMPPacket *pkt,
bytestream_put_le16(&p, pkt->channel_id - 64);
}
if (mode != RTMP_PS_ONEBYTE) {
- uint32_t timestamp = pkt->timestamp;
- if (mode != RTMP_PS_TWELVEBYTES)
- timestamp = pkt->ts_delta;
- bytestream_put_be24(&p, timestamp >= 0xFFFFFF ? 0xFFFFFF : timestamp);
+ bytestream_put_be24(&p, pkt->ts_field);
if (mode != RTMP_PS_FOURBYTES) {
bytestream_put_be24(&p, pkt->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);
}
+ if (pkt->ts_field == 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].size = pkt->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].ts_field = pkt->ts_field;
prev_pkt[pkt->channel_id].extra = pkt->extra;
if ((ret = ffurl_write(h, pkt_hdr, p - pkt_hdr)) < 0)
@@ -390,7 +399,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;
+ pkt->ts_field = 0;
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/rtmppkt.h b/chromium/third_party/ffmpeg/libavformat/rtmppkt.h
index fb79fedac64..0d98f60981e 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtmppkt.h
+++ b/chromium/third_party/ffmpeg/libavformat/rtmppkt.h
@@ -78,7 +78,7 @@ typedef struct RTMPPacket {
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
- uint32_t ts_delta; ///< timestamp increment to the previous one in milliseconds (latter only for media packets)
+ uint32_t ts_field; ///< 24-bit timestamp or increment to the previous one, in milliseconds (latter only for media packets). Clipped to a maximum of 0xFFFFFF, indicating an extended timestamp field.
uint32_t extra; ///< probably an additional channel ID used during streaming data
uint8_t *data; ///< packet payload
int size; ///< packet payload size
diff --git a/chromium/third_party/ffmpeg/libavformat/rtmpproto.c b/chromium/third_party/ffmpeg/libavformat/rtmpproto.c
index a4d7f0ee73d..308110b9c1b 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtmpproto.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtmpproto.c
@@ -150,6 +150,8 @@ static const uint8_t rtmp_server_key[] = {
0xE6, 0x36, 0xCF, 0xEB, 0x31, 0xAE
};
+static int handle_chunk_size(URLContext *s, RTMPPacket *pkt);
+
static int add_tracked_method(RTMPContext *rt, const char *name, int id)
{
int err;
@@ -408,6 +410,17 @@ static int read_connect(URLContext *s, RTMPContext *rt)
if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size,
&rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0)
return ret;
+
+ if (pkt.type == RTMP_PT_CHUNK_SIZE) {
+ if ((ret = handle_chunk_size(s, &pkt)) < 0)
+ return ret;
+
+ ff_rtmp_packet_destroy(&pkt);
+ if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size,
+ &rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0)
+ return ret;
+ }
+
cp = pkt.data;
bytestream2_init(&gbc, cp, pkt.size);
if (ff_amf_read_string(&gbc, command, sizeof(command), &stringlen)) {
@@ -2367,7 +2380,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
{
RTMPContext *rt = s->priv_data;
char proto[8], hostname[256], path[1024], auth[100], *fname;
- char *old_app;
+ char *old_app, *qmark, fname_buffer[1024];
uint8_t buf[2048];
int port;
AVDictionary *opts = NULL;
@@ -2465,7 +2478,20 @@ reconnect:
}
//extract "app" part from path
- if (!strncmp(path, "/ondemand/", 10)) {
+ qmark = strchr(path, '?');
+ if (qmark && strstr(qmark, "slist=")) {
+ char* amp;
+ // After slist we have the playpath, before the params, the app
+ av_strlcpy(rt->app, path + 1, FFMIN(qmark - path, APP_MAX_LENGTH));
+ fname = strstr(path, "slist=") + 6;
+ // Strip any further query parameters from fname
+ amp = strchr(fname, '&');
+ if (amp) {
+ av_strlcpy(fname_buffer, fname, FFMIN(amp - fname + 1,
+ sizeof(fname_buffer)));
+ fname = fname_buffer;
+ }
+ } else if (!strncmp(path, "/ondemand/", 10)) {
fname = path + 10;
memcpy(rt->app, "ondemand", 9);
} else {
@@ -2511,9 +2537,9 @@ reconnect:
(!strcmp(fname + len - 4, ".f4v") ||
!strcmp(fname + len - 4, ".mp4"))) {
memcpy(rt->playpath, "mp4:", 5);
- } else if (len >= 4 && !strcmp(fname + len - 4, ".flv")) {
- fname[len - 4] = '\0';
} else {
+ if (len >= 4 && !strcmp(fname + len - 4, ".flv"))
+ fname[len - 4] = '\0';
rt->playpath[0] = 0;
}
av_strlcat(rt->playpath, fname, PLAYPATH_MAX_LENGTH);
@@ -2556,7 +2582,7 @@ reconnect:
if ((ret = gen_connect(s, rt)) < 0)
goto fail;
} else {
- if (read_connect(s, s->priv_data) < 0)
+ if ((ret = read_connect(s, s->priv_data)) < 0)
goto fail;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpdec.h b/chromium/third_party/ffmpeg/libavformat/rtpdec.h
index 9321066ba78..7e356c048d5 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpdec.h
+++ b/chromium/third_party/ffmpeg/libavformat/rtpdec.h
@@ -173,9 +173,9 @@ struct RTPDemuxContext {
/*@}*/
/* rtcp sender statistics receive */
- int64_t last_rtcp_ntp_time;
+ uint64_t last_rtcp_ntp_time;
int64_t last_rtcp_reception_time;
- int64_t first_rtcp_ntp_time;
+ uint64_t first_rtcp_ntp_time;
uint32_t last_rtcp_timestamp;
int64_t rtcp_ts_offset;
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpdec_asf.c b/chromium/third_party/ffmpeg/libavformat/rtpdec_asf.c
index 123894f2756..541b86fe41b 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpdec_asf.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpdec_asf.c
@@ -144,6 +144,8 @@ static int asfrtp_parse_sdp_line(AVFormatContext *s, int stream_index,
if (s->streams[stream_index]->id == rt->asf_ctx->streams[i]->id) {
*s->streams[stream_index]->codec =
*rt->asf_ctx->streams[i]->codec;
+ s->streams[stream_index]->need_parsing =
+ rt->asf_ctx->streams[i]->need_parsing;
rt->asf_ctx->streams[i]->codec->extradata_size = 0;
rt->asf_ctx->streams[i]->codec->extradata = NULL;
avpriv_set_pts_info(s->streams[stream_index], 32, 1, 1000);
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpdec_h264.c b/chromium/third_party/ffmpeg/libavformat/rtpdec_h264.c
index be657c0ccc7..1ca78bc81c2 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpdec_h264.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpdec_h264.c
@@ -190,7 +190,8 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
switch (type) {
case 0: // undefined, but pass them through
case 1:
- av_new_packet(pkt, len + sizeof(start_sequence));
+ if ((result = av_new_packet(pkt, len + sizeof(start_sequence))) < 0)
+ return result;
memcpy(pkt->data, start_sequence, sizeof(start_sequence));
memcpy(pkt->data + sizeof(start_sequence), buf, len);
COUNT_NAL_TYPE(data, nal);
@@ -247,7 +248,8 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
if (pass == 0) {
/* now we know the total size of the packet (with the
* start sequences added) */
- av_new_packet(pkt, total_length);
+ if ((result = av_new_packet(pkt, total_length)) < 0)
+ return result;
dst = pkt->data;
} else {
assert(dst - pkt->data == total_length);
@@ -292,12 +294,14 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
COUNT_NAL_TYPE(data, nal_type);
if (start_bit) {
/* copy in the start sequence, and the reconstructed nal */
- av_new_packet(pkt, sizeof(start_sequence) + sizeof(nal) + len);
+ if ((result = av_new_packet(pkt, sizeof(start_sequence) + sizeof(nal) + len)) < 0)
+ return result;
memcpy(pkt->data, start_sequence, sizeof(start_sequence));
pkt->data[sizeof(start_sequence)] = reconstructed_nal;
memcpy(pkt->data + sizeof(start_sequence) + sizeof(nal), buf, len);
} else {
- av_new_packet(pkt, len);
+ if ((result = av_new_packet(pkt, len)) < 0)
+ return result;
memcpy(pkt->data, buf, len);
}
} else {
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpdec_xiph.c b/chromium/third_party/ffmpeg/libavformat/rtpdec_xiph.c
index 887a65ed651..43f72a2305d 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpdec_xiph.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpdec_xiph.c
@@ -256,7 +256,7 @@ parse_packed_headers(const uint8_t * packed_headers,
if (packed_headers_end - packed_headers < 9) {
av_log(codec, AV_LOG_ERROR,
- "Invalid %td byte packed header.",
+ "Invalid %"PTRDIFF_SPECIFIER" byte packed header.",
packed_headers_end - packed_headers);
return AVERROR_INVALIDDATA;
}
@@ -278,7 +278,7 @@ parse_packed_headers(const uint8_t * packed_headers,
if (packed_headers_end - packed_headers != length ||
length1 > length || length2 > length - length1) {
av_log(codec, AV_LOG_ERROR,
- "Bad packed header lengths (%d,%d,%td,%d)\n", length1,
+ "Bad packed header lengths (%d,%d,%"PTRDIFF_SPECIFIER",%d)\n", length1,
length2, packed_headers_end - packed_headers, length);
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpenc.c b/chromium/third_party/ffmpeg/libavformat/rtpenc.c
index 6fdc908d0f9..457fef0cfcb 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpenc.c
@@ -119,7 +119,7 @@ static int rtp_write_header(AVFormatContext *s1)
s->ssrc = av_get_random_seed();
s->first_packet = 1;
s->first_rtcp_ntp_time = ff_ntp_time();
- if (s1->start_time_realtime)
+ if (s1->start_time_realtime != 0 && s1->start_time_realtime != AV_NOPTS_VALUE)
/* Round the NTP time to whole milliseconds. */
s->first_rtcp_ntp_time = (s1->start_time_realtime / 1000) * 1000 +
NTP_OFFSET_US;
@@ -557,6 +557,10 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
const uint8_t *mb_info =
av_packet_get_side_data(pkt, AV_PKT_DATA_H263_MB_INFO,
&mb_info_size);
+ if (!mb_info) {
+ av_log(s1, AV_LOG_ERROR, "failed to allocate side data\n");
+ return AVERROR(ENOMEM);
+ }
ff_rtp_send_h263_rfc2190(s1, pkt->data, size, mb_info, mb_info_size);
break;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/rtsp.c b/chromium/third_party/ffmpeg/libavformat/rtsp.c
index 3b88fc72715..fcf9eca0d49 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtsp.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtsp.c
@@ -65,7 +65,7 @@
#define RTSP_FLAG_OPTS(name, longname) \
{ name, longname, OFFSET(rtsp_flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, DEC, "rtsp_flags" }, \
- { "filter_src", "Only receive packets from the negotiated peer IP", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_FILTER_SRC}, 0, 0, DEC, "rtsp_flags" }
+ { "filter_src", "only receive packets from the negotiated peer IP", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_FILTER_SRC}, 0, 0, DEC, "rtsp_flags" }
#define RTSP_MEDIATYPE_OPTS(name, longname) \
{ name, longname, OFFSET(media_type_mask), AV_OPT_TYPE_FLAGS, { .i64 = (1 << (AVMEDIA_TYPE_DATA+1)) - 1 }, INT_MIN, INT_MAX, DEC, "allowed_media_types" }, \
@@ -74,23 +74,24 @@
{ "data", "Data", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_DATA}, 0, 0, DEC, "allowed_media_types" }
#define RTSP_REORDERING_OPTS() \
- { "reorder_queue_size", "Number of packets to buffer for handling of reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC }
+ { "reorder_queue_size", "set number of packets to buffer for handling of reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC }
const AVOption ff_rtsp_options[] = {
- { "initial_pause", "Don't start playing the stream immediately", OFFSET(initial_pause), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
+ { "initial_pause", "do not start playing the stream immediately", OFFSET(initial_pause), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
FF_RTP_FLAG_OPTS(RTSPState, rtp_muxer_flags),
- { "rtsp_transport", "RTSP transport protocols", OFFSET(lower_transport_mask), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, DEC|ENC, "rtsp_transport" }, \
+ { "rtsp_transport", "set RTSP transport protocols", OFFSET(lower_transport_mask), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, DEC|ENC, "rtsp_transport" }, \
{ "udp", "UDP", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << RTSP_LOWER_TRANSPORT_UDP}, 0, 0, DEC|ENC, "rtsp_transport" }, \
{ "tcp", "TCP", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << RTSP_LOWER_TRANSPORT_TCP}, 0, 0, DEC|ENC, "rtsp_transport" }, \
{ "udp_multicast", "UDP multicast", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << RTSP_LOWER_TRANSPORT_UDP_MULTICAST}, 0, 0, DEC, "rtsp_transport" },
{ "http", "HTTP tunneling", 0, AV_OPT_TYPE_CONST, {.i64 = (1 << RTSP_LOWER_TRANSPORT_HTTP)}, 0, 0, DEC, "rtsp_transport" },
- RTSP_FLAG_OPTS("rtsp_flags", "RTSP flags"),
- { "listen", "Wait for incoming connections", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_LISTEN}, 0, 0, DEC, "rtsp_flags" },
- RTSP_MEDIATYPE_OPTS("allowed_media_types", "Media types to accept from the server"),
- { "min_port", "Minimum local UDP port", OFFSET(rtp_port_min), AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MIN}, 0, 65535, DEC|ENC },
- { "max_port", "Maximum local UDP port", OFFSET(rtp_port_max), AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MAX}, 0, 65535, DEC|ENC },
- { "timeout", "Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies flag listen", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC },
- { "stimeout", "timeout (in micro seconds) of socket i/o operations.", OFFSET(stimeout), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC },
+ RTSP_FLAG_OPTS("rtsp_flags", "set RTSP flags"),
+ { "listen", "wait for incoming connections", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_LISTEN}, 0, 0, DEC, "rtsp_flags" },
+ { "prefer_tcp", "try RTP via TCP first, if available", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_PREFER_TCP}, 0, 0, DEC|ENC, "rtsp_flags" },
+ RTSP_MEDIATYPE_OPTS("allowed_media_types", "set media types to accept from the server"),
+ { "min_port", "set minimum local UDP port", OFFSET(rtp_port_min), AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MIN}, 0, 65535, DEC|ENC },
+ { "max_port", "set maximum local UDP port", OFFSET(rtp_port_max), AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MAX}, 0, 65535, DEC|ENC },
+ { "timeout", "set maximum timeout (in seconds) to wait for incoming connections (-1 is infinite, imply flag listen)", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC },
+ { "stimeout", "set timeout (in micro seconds) of socket TCP I/O operations", OFFSET(stimeout), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC },
RTSP_REORDERING_OPTS(),
{ "user-agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = LIBAVFORMAT_IDENT}, 0, 0, DEC },
{ NULL },
@@ -98,15 +99,15 @@ const AVOption ff_rtsp_options[] = {
static const AVOption sdp_options[] = {
RTSP_FLAG_OPTS("sdp_flags", "SDP flags"),
- { "custom_io", "Use custom IO", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_CUSTOM_IO}, 0, 0, DEC, "rtsp_flags" },
- { "rtcp_to_source", "Send RTCP packets to the source address of received packets", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_RTCP_TO_SOURCE}, 0, 0, DEC, "rtsp_flags" },
- RTSP_MEDIATYPE_OPTS("allowed_media_types", "Media types to accept from the server"),
+ { "custom_io", "use custom I/O", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_CUSTOM_IO}, 0, 0, DEC, "rtsp_flags" },
+ { "rtcp_to_source", "send RTCP packets to the source address of received packets", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_RTCP_TO_SOURCE}, 0, 0, DEC, "rtsp_flags" },
+ RTSP_MEDIATYPE_OPTS("allowed_media_types", "set media types to accept from the server"),
RTSP_REORDERING_OPTS(),
{ NULL },
};
static const AVOption rtp_options[] = {
- RTSP_FLAG_OPTS("rtp_flags", "RTP flags"),
+ RTSP_FLAG_OPTS("rtp_flags", "set RTP flags"),
RTSP_REORDERING_OPTS(),
{ NULL },
};
@@ -729,8 +730,8 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
s->ctx_flags |= AVFMTCTX_NOHEADER;
if (s->oformat && CONFIG_RTSP_MUXER) {
- int ret = ff_rtp_chain_mux_open((AVFormatContext **)&rtsp_st->transport_priv, s, st,
- rtsp_st->rtp_handle,
+ int ret = ff_rtp_chain_mux_open((AVFormatContext **)&rtsp_st->transport_priv,
+ s, st, rtsp_st->rtp_handle,
RTSP_TCP_MAX_PACKET_SIZE,
rtsp_st->stream_index);
/* Ownership of rtp_handle is passed to the rtp mux context */
@@ -1766,6 +1767,10 @@ redirect:
int lower_transport = ff_log2_tab[lower_transport_mask &
~(lower_transport_mask - 1)];
+ if ((lower_transport_mask & (1 << RTSP_LOWER_TRANSPORT_TCP))
+ && (rt->rtsp_flags & RTSP_FLAG_PREFER_TCP))
+ lower_transport = RTSP_LOWER_TRANSPORT_TCP;
+
err = ff_rtsp_make_setup_request(s, host, port, lower_transport,
rt->server_type == RTSP_SERVER_REAL ?
real_challenge : NULL);
@@ -2066,6 +2071,16 @@ redo:
st2->time_base);
}
}
+ // Make real NTP start time available in AVFormatContext
+ if (s->start_time_realtime == AV_NOPTS_VALUE) {
+ s->start_time_realtime = av_rescale (rtpctx->first_rtcp_ntp_time - (NTP_OFFSET << 32), 1000000, 1LL << 32);
+ if (rtpctx->st) {
+ s->start_time_realtime -=
+ av_rescale (rtpctx->rtcp_ts_offset,
+ (uint64_t) rtpctx->st->time_base.num * 1000000,
+ rtpctx->st->time_base.den);
+ }
+ }
}
if (ret == -RTCP_BYE) {
rt->nb_byes++;
diff --git a/chromium/third_party/ffmpeg/libavformat/rtsp.h b/chromium/third_party/ffmpeg/libavformat/rtsp.h
index 76c7f181cf7..d1597938351 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtsp.h
+++ b/chromium/third_party/ffmpeg/libavformat/rtsp.h
@@ -413,6 +413,7 @@ typedef struct RTSPState {
#define RTSP_FLAG_CUSTOM_IO 0x4 /**< Do all IO via the AVIOContext. */
#define RTSP_FLAG_RTCP_TO_SOURCE 0x8 /**< Send RTCP packets to the source
address of received packets. */
+#define RTSP_FLAG_PREFER_TCP 0x10 /**< Try RTP via TCP first if possible. */
typedef struct RTSPSource {
char addr[128]; /**< Source-specific multicast include source IP address (from SDP content) */
diff --git a/chromium/third_party/ffmpeg/libavformat/rtspcodes.h b/chromium/third_party/ffmpeg/libavformat/rtspcodes.h
index 4245e48642d..d4f762b00c3 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtspcodes.h
+++ b/chromium/third_party/ffmpeg/libavformat/rtspcodes.h
@@ -1,6 +1,8 @@
/*
* RTSP definitions
* copyright (c) 2002 Fabrice Bellard
+ * copyright (c) 2014 Samsung Electronics. All rights reserved.
+ * @Author: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
*
* This file is part of FFmpeg.
*
@@ -22,21 +24,107 @@
#ifndef AVFORMAT_RTSPCODES_H
#define AVFORMAT_RTSPCODES_H
+#include "libavutil/common.h"
+
/** RTSP handling */
enum RTSPStatusCode {
-RTSP_STATUS_OK =200, /**< OK */
-RTSP_STATUS_METHOD =405, /**< Method Not Allowed */
-RTSP_STATUS_BANDWIDTH =453, /**< Not Enough Bandwidth */
-RTSP_STATUS_SESSION =454, /**< Session Not Found */
-RTSP_STATUS_STATE =455, /**< Method Not Valid in This State */
-RTSP_STATUS_AGGREGATE =459, /**< Aggregate operation not allowed */
-RTSP_STATUS_ONLY_AGGREGATE =460, /**< Only aggregate operation allowed */
-RTSP_STATUS_TRANSPORT =461, /**< Unsupported transport */
-RTSP_STATUS_INTERNAL =500, /**< Internal Server Error */
-RTSP_STATUS_SERVICE =503, /**< Service Unavailable */
-RTSP_STATUS_VERSION =505, /**< RTSP Version not supported */
+RTSP_STATUS_CONTINUE =100,
+RTSP_STATUS_OK =200,
+RTSP_STATUS_CREATED =201,
+RTSP_STATUS_LOW_ON_STORAGE_SPACE =250,
+RTSP_STATUS_MULTIPLE_CHOICES =300,
+RTSP_STATUS_MOVED_PERMANENTLY =301,
+RTSP_STATUS_MOVED_TEMPORARILY =302,
+RTSP_STATUS_SEE_OTHER =303,
+RTSP_STATUS_NOT_MODIFIED =304,
+RTSP_STATUS_USE_PROXY =305,
+RTSP_STATUS_BAD_REQUEST =400,
+RTSP_STATUS_UNAUTHORIZED =401,
+RTSP_STATUS_PAYMENT_REQUIRED =402,
+RTSP_STATUS_FORBIDDEN =403,
+RTSP_STATUS_NOT_FOUND =404,
+RTSP_STATUS_METHOD =405,
+RTSP_STATUS_NOT_ACCEPTABLE =406,
+RTSP_STATUS_PROXY_AUTH_REQUIRED =407,
+RTSP_STATUS_REQ_TIME_OUT =408,
+RTSP_STATUS_GONE =410,
+RTSP_STATUS_LENGTH_REQUIRED =411,
+RTSP_STATUS_PRECONDITION_FAILED =412,
+RTSP_STATUS_REQ_ENTITY_2LARGE =413,
+RTSP_STATUS_REQ_URI_2LARGE =414,
+RTSP_STATUS_UNSUPPORTED_MTYPE =415,
+RTSP_STATUS_PARAM_NOT_UNDERSTOOD =451,
+RTSP_STATUS_CONFERENCE_NOT_FOUND =452,
+RTSP_STATUS_BANDWIDTH =453,
+RTSP_STATUS_SESSION =454,
+RTSP_STATUS_STATE =455,
+RTSP_STATUS_INVALID_HEADER_FIELD =456,
+RTSP_STATUS_INVALID_RANGE =457,
+RTSP_STATUS_RONLY_PARAMETER =458,
+RTSP_STATUS_AGGREGATE =459,
+RTSP_STATUS_ONLY_AGGREGATE =460,
+RTSP_STATUS_TRANSPORT =461,
+RTSP_STATUS_UNREACHABLE =462,
+RTSP_STATUS_INTERNAL =500,
+RTSP_STATUS_NOT_IMPLEMENTED =501,
+RTSP_STATUS_BAD_GATEWAY =502,
+RTSP_STATUS_SERVICE =503,
+RTSP_STATUS_GATEWAY_TIME_OUT =504,
+RTSP_STATUS_VERSION =505,
+RTSP_STATUS_UNSUPPORTED_OPTION =551,
+};
+
+static const av_unused char *rtsp_status_strings[] = {
+[RTSP_STATUS_CONTINUE] ="Continue",
+[RTSP_STATUS_OK] ="OK",
+[RTSP_STATUS_CREATED] ="Created",
+[RTSP_STATUS_LOW_ON_STORAGE_SPACE] ="Low on Storage Space",
+[RTSP_STATUS_MULTIPLE_CHOICES] ="Multiple Choices",
+[RTSP_STATUS_MOVED_PERMANENTLY] ="Moved Permanently",
+[RTSP_STATUS_MOVED_TEMPORARILY] ="Moved Temporarily",
+[RTSP_STATUS_SEE_OTHER] ="See Other",
+[RTSP_STATUS_NOT_MODIFIED] ="Not Modified",
+[RTSP_STATUS_USE_PROXY] ="Use Proxy",
+[RTSP_STATUS_BAD_REQUEST] ="Bad Request",
+[RTSP_STATUS_UNAUTHORIZED] ="Unauthorized",
+[RTSP_STATUS_PAYMENT_REQUIRED] ="Payment Required",
+[RTSP_STATUS_FORBIDDEN] ="Forbidden",
+[RTSP_STATUS_NOT_FOUND] ="Not Found",
+[RTSP_STATUS_METHOD] ="Method Not Allowed",
+[RTSP_STATUS_NOT_ACCEPTABLE] ="Not Acceptable",
+[RTSP_STATUS_PROXY_AUTH_REQUIRED] ="Proxy Authentication Required",
+[RTSP_STATUS_REQ_TIME_OUT] ="Request Time-out",
+[RTSP_STATUS_GONE] ="Gone",
+[RTSP_STATUS_LENGTH_REQUIRED] ="Length Required",
+[RTSP_STATUS_PRECONDITION_FAILED] ="Precondition Failed",
+[RTSP_STATUS_REQ_ENTITY_2LARGE] ="Request Entity Too Large",
+[RTSP_STATUS_REQ_URI_2LARGE] ="Request URI Too Large",
+[RTSP_STATUS_UNSUPPORTED_MTYPE] ="Unsupported Media Type",
+[RTSP_STATUS_PARAM_NOT_UNDERSTOOD] ="Parameter Not Understood",
+[RTSP_STATUS_CONFERENCE_NOT_FOUND] ="Conference Not Found",
+[RTSP_STATUS_BANDWIDTH] ="Not Enough Bandwidth",
+[RTSP_STATUS_SESSION] ="Session Not Found",
+[RTSP_STATUS_STATE] ="Method Not Valid in This State",
+[RTSP_STATUS_INVALID_HEADER_FIELD] ="Header Field Not Valid for Resource",
+[RTSP_STATUS_INVALID_RANGE] ="Invalid Range",
+[RTSP_STATUS_RONLY_PARAMETER] ="Parameter Is Read-Only",
+[RTSP_STATUS_AGGREGATE] ="Aggregate Operation no Allowed",
+[RTSP_STATUS_ONLY_AGGREGATE] ="Only Aggregate Operation Allowed",
+[RTSP_STATUS_TRANSPORT] ="Unsupported Transport",
+[RTSP_STATUS_UNREACHABLE] ="Destination Unreachable",
+[RTSP_STATUS_INTERNAL] ="Internal Server Error",
+[RTSP_STATUS_NOT_IMPLEMENTED] ="Not Implemented",
+[RTSP_STATUS_BAD_GATEWAY] ="Bad Gateway",
+[RTSP_STATUS_SERVICE] ="Service Unavailable",
+[RTSP_STATUS_GATEWAY_TIME_OUT] ="Gateway Time-out",
+[RTSP_STATUS_VERSION] ="RTSP Version not Supported",
+[RTSP_STATUS_UNSUPPORTED_OPTION] ="Option not supported",
};
+#define RTSP_STATUS_CODE2STRING(x) (\
+x >= 100 && x < FF_ARRAY_ELEMS(rtsp_status_strings) && rtsp_status_strings[x] \
+)? rtsp_status_strings[x] : NULL
+
enum RTSPMethod {
DESCRIBE,
ANNOUNCE,
diff --git a/chromium/third_party/ffmpeg/libavformat/rtspdec.c b/chromium/third_party/ffmpeg/libavformat/rtspdec.c
index eb650ff42a1..af20465783c 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtspdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtspdec.c
@@ -360,6 +360,10 @@ static inline int parse_command_line(AVFormatContext *s, const char *line,
RTSPState *rt = s->priv_data;
const char *linept, *searchlinept;
linept = strchr(line, ' ');
+ if (!linept) {
+ av_log(s, AV_LOG_ERROR, "Error parsing method string\n");
+ return AVERROR_INVALIDDATA;
+ }
if (linept - line > methodsize - 1) {
av_log(s, AV_LOG_ERROR, "Method string too long\n");
return AVERROR(EIO);
@@ -877,7 +881,7 @@ retry:
rt->get_parameter_supported)) {
ff_rtsp_send_cmd_async(s, "GET_PARAMETER", rt->control_uri, NULL);
} else {
- ff_rtsp_send_cmd_async(s, "OPTIONS", "*", NULL);
+ ff_rtsp_send_cmd_async(s, "OPTIONS", rt->control_uri, NULL);
}
/* The stale flag should be reset when creating the auth response in
* ff_rtsp_send_cmd_async, but reset it here just in case we never
diff --git a/chromium/third_party/ffmpeg/libavformat/rtspenc.c b/chromium/third_party/ffmpeg/libavformat/rtspenc.c
index d76ae872eb4..cc6e729e8cd 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtspenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtspenc.c
@@ -51,7 +51,8 @@ int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr)
char *sdp;
AVFormatContext sdp_ctx, *ctx_array[1];
- s->start_time_realtime = av_gettime();
+ if (s->start_time_realtime == 0 || s->start_time_realtime == AV_NOPTS_VALUE)
+ s->start_time_realtime = av_gettime();
/* Announce the stream */
sdp = av_mallocz(SDP_MAX_SIZE);
diff --git a/chromium/third_party/ffmpeg/libavformat/sapenc.c b/chromium/third_party/ffmpeg/libavformat/sapenc.c
index 9fc78a83af8..738e8b8f911 100644
--- a/chromium/third_party/ffmpeg/libavformat/sapenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/sapenc.c
@@ -140,7 +140,8 @@ static int sap_write_header(AVFormatContext *s)
goto fail;
}
- s->start_time_realtime = av_gettime();
+ if (s->start_time_realtime == 0 || s->start_time_realtime == AV_NOPTS_VALUE)
+ s->start_time_realtime = av_gettime();
for (i = 0; i < s->nb_streams; i++) {
URLContext *fd;
diff --git a/chromium/third_party/ffmpeg/libavformat/sdp.c b/chromium/third_party/ffmpeg/libavformat/sdp.c
index 01242184958..c53de905171 100644
--- a/chromium/third_party/ffmpeg/libavformat/sdp.c
+++ b/chromium/third_party/ffmpeg/libavformat/sdp.c
@@ -217,7 +217,7 @@ static char *extradata2psets(AVCodecContext *c)
sps_end = r1;
}
if (av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r) == NULL) {
- av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %td %td!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
+ av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
av_free(psets);
return NULL;
@@ -402,7 +402,7 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
switch (c->codec_id) {
case AV_CODEC_ID_H264: {
int mode = 1;
- if (fmt && fmt->oformat->priv_class &&
+ if (fmt && fmt->oformat && fmt->oformat->priv_class &&
av_opt_flag_is_set(fmt->priv_data, "rtpflags", "h264_mode0"))
mode = 0;
if (c->extradata_size) {
@@ -513,13 +513,6 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
break;
case AV_CODEC_ID_THEORA: {
const char *pix_fmt;
- if (c->extradata_size)
- config = xiph_extradata2config(c);
- else
- av_log(c, AV_LOG_ERROR, "Theora configuation info missing\n");
- if (!config)
- return NULL;
-
switch (c->pix_fmt) {
case AV_PIX_FMT_YUV420P:
pix_fmt = "YCbCr-4:2:0";
@@ -535,6 +528,13 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
return NULL;
}
+ if (c->extradata_size)
+ config = xiph_extradata2config(c);
+ else
+ av_log(c, AV_LOG_ERROR, "Theora configuation info missing\n");
+ if (!config)
+ return NULL;
+
av_strlcatf(buff, size, "a=rtpmap:%d theora/90000\r\n"
"a=fmtp:%d delivery-method=inline; "
"width=%d; height=%d; sampling=%s; "
diff --git a/chromium/third_party/ffmpeg/libavformat/sdr2.c b/chromium/third_party/ffmpeg/libavformat/sdr2.c
new file mode 100644
index 00000000000..82405f69d18
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/sdr2.c
@@ -0,0 +1,121 @@
+/*
+ * SDR2 demuxer
+ * Copyright (c) 2014 Paul B Mahol
+ *
+ * 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 "libavutil/intreadwrite.h"
+#include "avformat.h"
+#include "internal.h"
+
+static int sdr2_probe(AVProbeData *p)
+{
+ if (AV_RL32(p->buf) != MKTAG('S', 'R', 'A', 1))
+ return 0;
+
+ return AVPROBE_SCORE_EXTENSION;
+}
+
+#define FIRST 0xA8
+
+static int sdr2_read_header(AVFormatContext *s)
+{
+ AVStream *st, *ast;
+
+ ast = avformat_new_stream(s, 0);
+ if (!ast)
+ return AVERROR(ENOMEM);
+
+ st = avformat_new_stream(s, 0);
+ if (!st)
+ return AVERROR(ENOMEM);
+
+ avio_skip(s->pb, 20);
+ avpriv_set_pts_info(st, 64, 1, avio_rl32(s->pb));
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ st->codec->width = avio_rl32(s->pb);
+ st->codec->height = avio_rl32(s->pb);
+ st->codec->codec_id = AV_CODEC_ID_H264;
+ st->need_parsing = AVSTREAM_PARSE_FULL;
+
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ ast->codec->channels = 1;
+ ast->codec->sample_rate = 8000;
+ ast->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
+ avpriv_set_pts_info(ast, 64, 1, 8000);
+
+ avio_seek(s->pb, FIRST, SEEK_SET);
+
+ return 0;
+}
+
+static const uint8_t header[24] = {
+ 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x00, 0x1e,
+ 0xa6, 0x80, 0xb0, 0x7e, 0x40, 0x00, 0x00, 0x00,
+ 0x01, 0x68, 0xce, 0x38, 0x80, 0x00, 0x00, 0x00
+};
+
+static int sdr2_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ int64_t pos;
+ unsigned next;
+ int flags, ret = 0, is_video;
+
+ pos = avio_tell(s->pb);
+
+ flags = avio_rl32(s->pb);
+ avio_skip(s->pb, 4);
+
+ next = avio_rl32(s->pb);
+ if (next <= 52)
+ return AVERROR_INVALIDDATA;
+
+ avio_skip(s->pb, 6);
+ is_video = avio_rl32(s->pb);
+ avio_skip(s->pb, 30);
+
+ if (pos == FIRST) {
+ if (av_new_packet(pkt, next - 52 + 24) < 0)
+ return AVERROR(ENOMEM);
+ memcpy(pkt->data, header, 24);
+ ret = avio_read(s->pb, pkt->data + 24, next - 52);
+ if (ret < 0) {
+ av_free_packet(pkt);
+ return ret;
+ }
+ av_shrink_packet(pkt, ret + 24);
+ } else {
+ ret = av_get_packet(s->pb, pkt, next - 52);
+ }
+ pkt->stream_index = !!is_video;
+ pkt->pos = pos;
+ if (flags & (1 << 12))
+ pkt->flags |= AV_PKT_FLAG_KEY;
+
+ return ret;
+}
+
+AVInputFormat ff_sdr2_demuxer = {
+ .name = "sdr2",
+ .long_name = NULL_IF_CONFIG_SMALL("SDR2"),
+ .read_probe = sdr2_probe,
+ .read_header = sdr2_read_header,
+ .read_packet = sdr2_read_packet,
+ .extensions = "sdr2",
+ .flags = AVFMT_GENERIC_INDEX,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/segafilm.c b/chromium/third_party/ffmpeg/libavformat/segafilm.c
index 8a0e8bc3c6b..6b3ad52446a 100644
--- a/chromium/third_party/ffmpeg/libavformat/segafilm.c
+++ b/chromium/third_party/ffmpeg/libavformat/segafilm.c
@@ -75,13 +75,22 @@ static int film_probe(AVProbeData *p)
return AVPROBE_SCORE_MAX;
}
+static int film_read_close(AVFormatContext *s)
+{
+ FilmDemuxContext *film = s->priv_data;
+
+ av_freep(&film->sample_table);
+
+ return 0;
+}
+
static int film_read_header(AVFormatContext *s)
{
FilmDemuxContext *film = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *st;
unsigned char scratch[256];
- int i;
+ int i, ret;
unsigned int data_offset;
unsigned int audio_frame_counter;
@@ -206,14 +215,16 @@ static int film_read_header(AVFormatContext *s)
for (i = 0; i < film->sample_count; i++) {
/* load the next sample record and transfer it to an internal struct */
if (avio_read(pb, scratch, 16) != 16) {
- av_freep(&film->sample_table);
- return AVERROR(EIO);
+ ret = AVERROR(EIO);
+ goto fail;
}
film->sample_table[i].sample_offset =
data_offset + AV_RB32(&scratch[0]);
film->sample_table[i].sample_size = AV_RB32(&scratch[4]);
- if (film->sample_table[i].sample_size > INT_MAX / 4)
- return AVERROR_INVALIDDATA;
+ if (film->sample_table[i].sample_size > INT_MAX / 4) {
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
if (AV_RB32(&scratch[8]) == 0xFFFFFFFF) {
film->sample_table[i].stream = film->audio_stream_index;
film->sample_table[i].pts = audio_frame_counter;
@@ -234,6 +245,9 @@ static int film_read_header(AVFormatContext *s)
film->current_sample = 0;
return 0;
+fail:
+ film_read_close(s);
+ return ret;
}
static int film_read_packet(AVFormatContext *s,
@@ -252,18 +266,10 @@ static int film_read_packet(AVFormatContext *s,
/* position the stream (will probably be there anyway) */
avio_seek(pb, sample->sample_offset, SEEK_SET);
- /* do a special song and dance when loading FILM Cinepak chunks */
- if ((sample->stream == film->video_stream_index) &&
- (film->video_type == AV_CODEC_ID_CINEPAK)) {
- pkt->pos= avio_tell(pb);
- if (av_new_packet(pkt, sample->sample_size))
- return AVERROR(ENOMEM);
- avio_read(pb, pkt->data, sample->sample_size);
- } else {
- ret= av_get_packet(pb, pkt, sample->sample_size);
- if (ret != sample->sample_size)
- ret = AVERROR(EIO);
- }
+
+ ret= av_get_packet(pb, pkt, sample->sample_size);
+ if (ret != sample->sample_size)
+ ret = AVERROR(EIO);
pkt->stream_index = sample->stream;
pkt->pts = sample->pts;
@@ -273,15 +279,6 @@ static int film_read_packet(AVFormatContext *s,
return ret;
}
-static int film_read_close(AVFormatContext *s)
-{
- FilmDemuxContext *film = s->priv_data;
-
- av_freep(&film->sample_table);
-
- return 0;
-}
-
AVInputFormat ff_segafilm_demuxer = {
.name = "film_cpk",
.long_name = NULL_IF_CONFIG_SMALL("Sega FILM / CPK"),
diff --git a/chromium/third_party/ffmpeg/libavformat/segment.c b/chromium/third_party/ffmpeg/libavformat/segment.c
index f07f464f71c..fe84f2710da 100644
--- a/chromium/third_party/ffmpeg/libavformat/segment.c
+++ b/chromium/third_party/ffmpeg/libavformat/segment.c
@@ -65,6 +65,7 @@ typedef struct {
const AVClass *class; /**< Class for private options. */
int segment_idx; ///< index of the segment file to write, starting from 0
int segment_idx_wrap; ///< number after which the index wraps
+ int segment_idx_wrap_nb; ///< number of time the index has wraped
int segment_count; ///< number of segment files already written
AVOutputFormat *oformat;
AVFormatContext *avf;
@@ -72,7 +73,7 @@ typedef struct {
char *list; ///< filename for the segment list file
int list_flags; ///< flags affecting list generation
int list_size; ///< number of entries for the segment list file
- char *list_entry_prefix; ///< prefix to add to list entry filenames
+ char *entry_prefix; ///< prefix to add to list entry filenames
ListType list_type; ///< set the list type
AVIOContext *list_pb; ///< list file put-byte context
char *time_str; ///< segment duration specification string
@@ -171,14 +172,14 @@ static int set_segment_filename(AVFormatContext *s)
/* copy modified name in list entry */
size = strlen(av_basename(oc->filename)) + 1;
- if (seg->list_entry_prefix)
- size += strlen(seg->list_entry_prefix);
+ if (seg->entry_prefix)
+ size += strlen(seg->entry_prefix);
seg->cur_entry.filename = av_mallocz(size);
if (!seg->cur_entry.filename)
return AVERROR(ENOMEM);
snprintf(seg->cur_entry.filename, size, "%s%s",
- seg->list_entry_prefix ? seg->list_entry_prefix : "",
+ seg->entry_prefix ? seg->entry_prefix : "",
av_basename(oc->filename));
return 0;
@@ -199,6 +200,9 @@ static int segment_start(AVFormatContext *s, int write_header)
}
seg->segment_idx++;
+ if ((seg->segment_idx_wrap) && (seg->segment_idx%seg->segment_idx_wrap == 0))
+ seg->segment_idx_wrap_nb++;
+
if ((err = set_segment_filename(s)) < 0)
return err;
@@ -242,6 +246,9 @@ static int segment_list_open(AVFormatContext *s)
avio_printf(seg->list_pb, "#EXT-X-ALLOW-CACHE:%s\n",
seg->list_flags & SEGMENT_LIST_FLAG_CACHE ? "YES" : "NO");
+ av_log(s, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%d\n",
+ seg->segment_list_entries->index);
+
for (entry = seg->segment_list_entries; entry; entry = entry->next)
max_duration = FFMAX(max_duration, entry->end_time - entry->start_time);
avio_printf(seg->list_pb, "#EXT-X-TARGETDURATION:%"PRId64"\n", (int64_t)ceil(max_duration));
@@ -366,7 +373,7 @@ static int parse_times(void *log_ctx, int64_t **times, int *nb_times,
if (*p == ',')
(*nb_times)++;
- *times = av_malloc(sizeof(**times) * *nb_times);
+ *times = av_malloc_array(*nb_times, sizeof(**times));
if (!*times) {
av_log(log_ctx, AV_LOG_ERROR, "Could not allocate forced times array\n");
FAIL(AVERROR(ENOMEM));
@@ -424,7 +431,7 @@ static int parse_frames(void *log_ctx, int **frames, int *nb_frames,
if (*p == ',')
(*nb_frames)++;
- *frames = av_malloc(sizeof(**frames) * *nb_frames);
+ *frames = av_malloc_array(*nb_frames, sizeof(**frames));
if (!*frames) {
av_log(log_ctx, AV_LOG_ERROR, "Could not allocate forced frames array\n");
FAIL(AVERROR(ENOMEM));
@@ -657,7 +664,6 @@ fail:
static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
{
SegmentContext *seg = s->priv_data;
- AVFormatContext *oc = seg->avf;
AVStream *st = s->streams[pkt->stream_index];
int64_t end_pts = INT64_MAX, offset;
int start_frame = INT_MAX;
@@ -690,9 +696,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
if ((ret = segment_start(s, seg->individual_header_trailer)) < 0)
goto fail;
- oc = seg->avf;
-
- seg->cur_entry.index = seg->segment_idx;
+ seg->cur_entry.index = seg->segment_idx + seg->segment_idx_wrap*seg->segment_idx_wrap_nb;
seg->cur_entry.start_time = (double)pkt->pts * av_q2d(st->time_base);
seg->cur_entry.start_pts = av_rescale_q(pkt->pts, st->time_base, AV_TIME_BASE_Q);
} else if (pkt->pts != AV_NOPTS_VALUE) {
@@ -701,7 +705,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
}
if (seg->is_first_pkt) {
- av_log(s, AV_LOG_DEBUG, "segment:'%s' starts with packet stream:%d pts:%s pts_time:%s frame:%d\n",
+ av_log(s, AV_LOG_VERBOSE, "segment:'%s' starts with packet stream:%d pts:%s pts_time:%s frame:%d\n",
seg->avf->filename, pkt->stream_index,
av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base), seg->frame_count);
seg->is_first_pkt = 0;
@@ -725,18 +729,12 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
- ret = ff_write_chained(oc, pkt->stream_index, pkt, s);
+ ret = ff_write_chained(seg->avf, pkt->stream_index, pkt, s);
fail:
if (pkt->stream_index == seg->reference_stream_index)
seg->frame_count++;
- if (ret < 0) {
- if (seg->list)
- avio_close(seg->list_pb);
- avformat_free_context(oc);
- }
-
return ret;
}
@@ -788,7 +786,6 @@ static const AVOption options[] = {
{ "live", "enable live-friendly list generation (useful for HLS)", 0, AV_OPT_TYPE_CONST, {.i64 = SEGMENT_LIST_FLAG_LIVE }, INT_MIN, INT_MAX, E, "list_flags"},
{ "segment_list_size", "set the maximum number of playlist entries", OFFSET(list_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
- { "segment_list_entry_prefix", "set prefix to prepend to each list entry filename", OFFSET(list_entry_prefix), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
{ "segment_list_type", "set the segment list type", OFFSET(list_type), AV_OPT_TYPE_INT, {.i64 = LIST_TYPE_UNDEFINED}, -1, LIST_TYPE_NB-1, E, "list_type" },
{ "flat", "flat format", 0, AV_OPT_TYPE_CONST, {.i64=LIST_TYPE_FLAT }, INT_MIN, INT_MAX, E, "list_type" },
@@ -803,7 +800,9 @@ static const AVOption options[] = {
{ "segment_times", "set segment split time points", OFFSET(times_str),AV_OPT_TYPE_STRING,{.str = NULL}, 0, 0, E },
{ "segment_frames", "set segment split frame numbers", OFFSET(frames_str),AV_OPT_TYPE_STRING,{.str = NULL}, 0, 0, E },
{ "segment_wrap", "set number after which the index wraps", OFFSET(segment_idx_wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
+ { "segment_list_entry_prefix", "set base url prefix for segments", OFFSET(entry_prefix), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E },
{ "segment_start_number", "set the sequence number of the first segment", OFFSET(segment_idx), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
+ { "segment_wrap_number", "set the number of wrap before the first segment", OFFSET(segment_idx_wrap_nb), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
{ "individual_header_trailer", "write header/trailer to each segment", OFFSET(individual_header_trailer), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E },
{ "write_header_trailer", "write a header to the first segment and a trailer to the last one", OFFSET(write_header_trailer), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E },
diff --git a/chromium/third_party/ffmpeg/libavformat/sierravmd.c b/chromium/third_party/ffmpeg/libavformat/sierravmd.c
index 8749ec1640c..9bd42b4e78a 100644
--- a/chromium/third_party/ffmpeg/libavformat/sierravmd.c
+++ b/chromium/third_party/ffmpeg/libavformat/sierravmd.c
@@ -204,7 +204,12 @@ static int vmd_read_header(AVFormatContext *s)
int type;
uint32_t size;
- avio_read(pb, chunk, BYTES_PER_FRAME_RECORD);
+ if ((ret = avio_read(pb, chunk, BYTES_PER_FRAME_RECORD)) != BYTES_PER_FRAME_RECORD) {
+ av_log(s, AV_LOG_ERROR, "Failed to read frame record\n");
+ if (ret >= 0)
+ ret = AVERROR_INVALIDDATA;
+ goto error;
+ }
type = chunk[0];
size = AV_RL32(&chunk[2]);
if (size > INT_MAX / 2) {
diff --git a/chromium/third_party/ffmpeg/libavformat/siff.c b/chromium/third_party/ffmpeg/libavformat/siff.c
index c8b68abe301..8da6c2f67a7 100644
--- a/chromium/third_party/ffmpeg/libavformat/siff.c
+++ b/chromium/third_party/ffmpeg/libavformat/siff.c
@@ -216,7 +216,10 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
AV_WL16(pkt->data, c->flags);
if (c->gmcsize)
memcpy(pkt->data + 2, c->gmc, c->gmcsize);
- avio_read(s->pb, pkt->data + 2 + c->gmcsize, size);
+ if (avio_read(s->pb, pkt->data + 2 + c->gmcsize, size) != size) {
+ av_free_packet(pkt);
+ return AVERROR_INVALIDDATA;
+ }
pkt->stream_index = 0;
c->curstrm = -1;
}else{
diff --git a/chromium/third_party/ffmpeg/libavformat/smacker.c b/chromium/third_party/ffmpeg/libavformat/smacker.c
index 0d38588e21f..46215ee73d3 100644
--- a/chromium/third_party/ffmpeg/libavformat/smacker.c
+++ b/chromium/third_party/ffmpeg/libavformat/smacker.c
@@ -23,6 +23,8 @@
* Based on http://wiki.multimedia.cx/index.php?title=Smacker
*/
+#include <inttypes.h>
+
#include "libavutil/bswap.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
@@ -142,7 +144,7 @@ static int smacker_read_header(AVFormatContext *s)
smk->pad = avio_rl32(pb);
/* setup data */
if(smk->frames > 0xFFFFFF) {
- av_log(s, AV_LOG_ERROR, "Too many frames: %i\n", smk->frames);
+ av_log(s, AV_LOG_ERROR, "Too many frames: %"PRIu32"\n", smk->frames);
return AVERROR_INVALIDDATA;
}
smk->frm_size = av_malloc_array(smk->frames, sizeof(*smk->frm_size));
@@ -221,7 +223,9 @@ static int smacker_read_header(AVFormatContext *s)
/* load trees to extradata, they will be unpacked by decoder */
if(ff_alloc_extradata(st->codec, smk->treesize + 16)){
- av_log(s, AV_LOG_ERROR, "Cannot allocate %i bytes of extradata\n", smk->treesize + 16);
+ av_log(s, AV_LOG_ERROR,
+ "Cannot allocate %"PRIu32" bytes of extradata\n",
+ smk->treesize + 16);
av_freep(&smk->frm_size);
av_freep(&smk->frm_flags);
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavformat/smjpegdec.c b/chromium/third_party/ffmpeg/libavformat/smjpegdec.c
index 38ac2fb0861..e4c7a9b890f 100644
--- a/chromium/third_party/ffmpeg/libavformat/smjpegdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/smjpegdec.c
@@ -24,6 +24,8 @@
* This is a demuxer for Loki SDL Motion JPEG files
*/
+#include <inttypes.h>
+
#include "avformat.h"
#include "internal.h"
#include "riff.h"
@@ -52,7 +54,7 @@ static int smjpeg_read_header(AVFormatContext *s)
avio_skip(pb, 8); // magic
version = avio_rb32(pb);
if (version)
- avpriv_request_sample(s, "Unknown version %d", version);
+ avpriv_request_sample(s, "Unknown version %"PRIu32, version);
duration = avio_rb32(pb); // in msec
@@ -124,7 +126,7 @@ static int smjpeg_read_header(AVFormatContext *s)
case SMJPEG_HEND:
return 0;
default:
- av_log(s, AV_LOG_ERROR, "unknown header %x\n", htype);
+ av_log(s, AV_LOG_ERROR, "unknown header %"PRIx32"\n", htype);
return AVERROR_INVALIDDATA;
}
}
@@ -164,7 +166,7 @@ static int smjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
ret = AVERROR_EOF;
break;
default:
- av_log(s, AV_LOG_ERROR, "unknown chunk %x\n", dtype);
+ av_log(s, AV_LOG_ERROR, "unknown chunk %"PRIx32"\n", dtype);
ret = AVERROR_INVALIDDATA;
break;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/smush.c b/chromium/third_party/ffmpeg/libavformat/smush.c
index e9c1937398d..a33d50915a7 100644
--- a/chromium/third_party/ffmpeg/libavformat/smush.c
+++ b/chromium/third_party/ffmpeg/libavformat/smush.c
@@ -20,11 +20,12 @@
*/
#include "libavutil/intreadwrite.h"
+
#include "avformat.h"
-#include "internal.h"
#include "avio.h"
+#include "internal.h"
-typedef struct {
+typedef struct SMUSHContext {
int version;
int audio_stream_index;
int video_stream_index;
@@ -32,9 +33,9 @@ typedef struct {
static int smush_read_probe(AVProbeData *p)
{
- if (((AV_RL32(p->buf) == MKTAG('S', 'A', 'N', 'M') &&
+ if (((AV_RL32(p->buf) == MKTAG('S', 'A', 'N', 'M') &&
AV_RL32(p->buf + 8) == MKTAG('S', 'H', 'D', 'R')) ||
- (AV_RL32(p->buf) == MKTAG('A', 'N', 'I', 'M') &&
+ (AV_RL32(p->buf) == MKTAG('A', 'N', 'I', 'M') &&
AV_RL32(p->buf + 8) == MKTAG('A', 'H', 'D', 'R')))) {
return AVPROBE_SCORE_MAX;
}
@@ -65,6 +66,8 @@ static int smush_read_header(AVFormatContext *ctx)
smush->version = 0;
subversion = avio_rl16(pb);
nframes = avio_rl16(pb);
+ if (!nframes)
+ return AVERROR_INVALIDDATA;
avio_skip(pb, 2); // skip pad
@@ -72,7 +75,7 @@ static int smush_read_header(AVFormatContext *ctx)
palette[i] = avio_rb24(pb);
avio_skip(pb, size - (3 * 256 + 6));
- } else if (magic == MKBETAG('S', 'A', 'N', 'M') ) {
+ } else if (magic == MKBETAG('S', 'A', 'N', 'M')) {
if (avio_rb32(pb) != MKBETAG('S', 'H', 'D', 'R'))
return AVERROR_INVALIDDATA;
@@ -81,8 +84,11 @@ static int smush_read_header(AVFormatContext *ctx)
return AVERROR_INVALIDDATA;
smush->version = 1;
- subversion = avio_rl16(pb);
+ subversion = avio_rl16(pb);
nframes = avio_rl32(pb);
+ if (!nframes)
+ return AVERROR_INVALIDDATA;
+
avio_skip(pb, 2); // skip pad
width = avio_rl16(pb);
height = avio_rl16(pb);
@@ -101,12 +107,18 @@ static int smush_read_header(AVFormatContext *ctx)
sig = avio_rb32(pb);
chunk_size = avio_rb32(pb);
- read += 8;
+ read += 8;
switch (sig) {
case MKBETAG('W', 'a', 'v', 'e'):
got_audio = 1;
sample_rate = avio_rl32(pb);
- channels = avio_rl32(pb);
+ if (!sample_rate)
+ return AVERROR_INVALIDDATA;
+
+ channels = avio_rl32(pb);
+ if (!channels)
+ return AVERROR_INVALIDDATA;
+
avio_skip(pb, chunk_size - 8);
read += chunk_size;
break;
@@ -133,17 +145,18 @@ static int smush_read_header(AVFormatContext *ctx)
smush->video_stream_index = vst->index;
+ avpriv_set_pts_info(vst, 64, 1, 15);
+
vst->start_time = 0;
vst->duration =
vst->nb_frames = nframes;
+ vst->avg_frame_rate = av_inv_q(vst->time_base);
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
vst->codec->codec_id = AV_CODEC_ID_SANM;
vst->codec->codec_tag = 0;
vst->codec->width = width;
vst->codec->height = height;
- avpriv_set_pts_info(vst, 64, 66667, 1000000);
-
if (!smush->version) {
if (ff_alloc_extradata(vst->codec, 1024 + 2))
return AVERROR(ENOMEM);
@@ -162,7 +175,7 @@ static int smush_read_header(AVFormatContext *ctx)
ast->start_time = 0;
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- ast->codec->codec_id = AV_CODEC_ID_VIMA;
+ ast->codec->codec_id = AV_CODEC_ID_ADPCM_VIMA;
ast->codec->codec_tag = 0;
ast->codec->sample_rate = sample_rate;
ast->codec->channels = channels;
@@ -178,6 +191,7 @@ static int smush_read_packet(AVFormatContext *ctx, AVPacket *pkt)
SMUSHContext *smush = ctx->priv_data;
AVIOContext *pb = ctx->pb;
int done = 0;
+ int ret;
while (!done) {
uint32_t sig, size;
@@ -185,22 +199,22 @@ static int smush_read_packet(AVFormatContext *ctx, AVPacket *pkt)
if (url_feof(pb))
return AVERROR_EOF;
- sig = avio_rb32(pb);
- size = avio_rb32(pb);
+ sig = avio_rb32(pb);
+ size = avio_rb32(pb);
switch (sig) {
case MKBETAG('F', 'R', 'M', 'E'):
if (smush->version)
break;
- if (av_get_packet(pb, pkt, size) < 0)
- return AVERROR(EIO);
+ if ((ret = av_get_packet(pb, pkt, size)) < 0)
+ return ret;
pkt->stream_index = smush->video_stream_index;
done = 1;
break;
case MKBETAG('B', 'l', '1', '6'):
- if (av_get_packet(pb, pkt, size) < 0)
- return AVERROR(EIO);
+ if ((ret = av_get_packet(pb, pkt, size)) < 0)
+ return ret;
pkt->stream_index = smush->video_stream_index;
pkt->duration = 1;
@@ -214,7 +228,7 @@ static int smush_read_packet(AVFormatContext *ctx, AVPacket *pkt)
pkt->stream_index = smush->audio_stream_index;
pkt->flags |= AV_PKT_FLAG_KEY;
- pkt->duration = AV_RB32(pkt->data);
+ pkt->duration = AV_RB32(pkt->data);
if (pkt->duration == 0xFFFFFFFFu)
pkt->duration = AV_RB32(pkt->data + 8);
done = 1;
diff --git a/chromium/third_party/ffmpeg/libavformat/spdifenc.c b/chromium/third_party/ffmpeg/libavformat/spdifenc.c
index 210d63f39cd..18afd428019 100644
--- a/chromium/third_party/ffmpeg/libavformat/spdifenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/spdifenc.c
@@ -44,6 +44,8 @@
* dependent from data-type (spaces between packets are filled by zeros)
*/
+#include <inttypes.h>
+
#include "avformat.h"
#include "avio_internal.h"
#include "spdif.h"
@@ -274,7 +276,7 @@ static int spdif_header_dts(AVFormatContext *s, AVPacket *pkt)
av_log(s, AV_LOG_ERROR, "stray DTS-HD frame\n");
return AVERROR_INVALIDDATA;
default:
- av_log(s, AV_LOG_ERROR, "bad DTS syncword 0x%x\n", syncword_dts);
+ av_log(s, AV_LOG_ERROR, "bad DTS syncword 0x%"PRIx32"\n", syncword_dts);
return AVERROR_INVALIDDATA;
}
blocks++;
@@ -369,8 +371,8 @@ static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
ctx->data_type = IEC61937_MPEG2_AAC_LSF_4096;
break;
default:
- av_log(s, AV_LOG_ERROR, "%i samples in AAC frame not supported\n",
- hdr.samples);
+ av_log(s, AV_LOG_ERROR,
+ "%"PRIu32" samples in AAC frame not supported\n", hdr.samples);
return AVERROR(EINVAL);
}
//TODO Data type dependent info (LC profile/SBR)
diff --git a/chromium/third_party/ffmpeg/libavformat/subfile.c b/chromium/third_party/ffmpeg/libavformat/subfile.c
new file mode 100644
index 00000000000..0e84384600b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/subfile.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2014 Nicolas George
+ *
+ * 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 "libavutil/avassert.h"
+#include "libavutil/avstring.h"
+#include "libavutil/opt.h"
+#include "avformat.h"
+#include "url.h"
+
+typedef struct SubfileContext {
+ const AVClass *class;
+ URLContext *h;
+ int64_t start;
+ int64_t end;
+ int64_t pos;
+} SubfileContext;
+
+#define OFFSET(field) offsetof(SubfileContext, field)
+#define D AV_OPT_FLAG_DECODING_PARAM
+
+static const AVOption subfile_options[] = {
+ { "start", "start offset", OFFSET(start), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D },
+ { "end", "end offset", OFFSET(end), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D },
+ { NULL }
+};
+
+#undef OFFSET
+#undef D
+
+static const AVClass subfile_class = {
+ .class_name = "subfile",
+ .item_name = av_default_item_name,
+ .option = subfile_options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static int slave_seek(URLContext *h)
+{
+ SubfileContext *c = h->priv_data;
+ int64_t ret;
+
+ if ((ret = ffurl_seek(c->h, c->pos, SEEK_SET)) != c->pos) {
+ if (ret >= 0)
+ ret = AVERROR_BUG;
+ av_log(h, AV_LOG_ERROR, "Impossible to seek in file: %s\n",
+ av_err2str(ret));
+ return ret;
+ }
+ return 0;
+}
+
+static int subfile_open(URLContext *h, const char *filename, int flags,
+ AVDictionary **options)
+{
+ SubfileContext *c = h->priv_data;
+ int ret;
+
+ if (c->end <= c->start) {
+ av_log(h, AV_LOG_ERROR, "end before start\n");
+ return AVERROR(EINVAL);
+ }
+ av_strstart(filename, "subfile:", &filename);
+ ret = ffurl_open(&c->h, filename, flags, &h->interrupt_callback, options);
+ if (ret < 0)
+ return ret;
+ c->pos = c->start;
+ if ((ret = slave_seek(h)) < 0) {
+ ffurl_close(c->h);
+ return ret;
+ }
+ return 0;
+}
+
+static int subfile_close(URLContext *h)
+{
+ SubfileContext *c = h->priv_data;
+ return ffurl_close(c->h);
+}
+
+static int subfile_read(URLContext *h, unsigned char *buf, int size)
+{
+ SubfileContext *c = h->priv_data;
+ int64_t rest = c->end - c->pos;
+ int ret;
+
+ if (rest <= 0)
+ return 0;
+ size = FFMIN(size, rest);
+ ret = ffurl_read(c->h, buf, size);
+ if (ret >= 0)
+ c->pos += ret;
+ return ret;
+}
+
+static int64_t subfile_seek(URLContext *h, int64_t pos, int whence)
+{
+ SubfileContext *c = h->priv_data;
+ int64_t new_pos = -1;
+ int ret;
+
+ if (whence == AVSEEK_SIZE)
+ return c->end - c->start;
+ switch (whence) {
+ case SEEK_SET:
+ new_pos = c->start + pos;
+ break;
+ case SEEK_CUR:
+ new_pos += pos;
+ break;
+ case SEEK_END:
+ new_pos = c->end + c->pos;
+ break;
+ }
+ if (new_pos < c->start)
+ return AVERROR(EINVAL);
+ c->pos = new_pos;
+ if ((ret = slave_seek(h)) < 0)
+ return ret;
+ return c->pos - c->start;
+}
+
+URLProtocol ff_subfile_protocol = {
+ .name = "subfile",
+ .url_open2 = subfile_open,
+ .url_read = subfile_read,
+ .url_seek = subfile_seek,
+ .url_close = subfile_close,
+ .priv_data_size = sizeof(SubfileContext),
+ .priv_data_class = &subfile_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/swfdec.c b/chromium/third_party/ffmpeg/libavformat/swfdec.c
index e6ceec818af..c95b18ec6cb 100644
--- a/chromium/third_party/ffmpeg/libavformat/swfdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/swfdec.c
@@ -446,16 +446,30 @@ bitmap_end_skip:
goto skip;
if ((res = av_new_packet(pkt, len)) < 0)
return res;
- avio_read(pb, pkt->data, 4);
+ if (avio_read(pb, pkt->data, 4) != 4) {
+ av_free_packet(pkt);
+ return AVERROR_INVALIDDATA;
+ }
if (AV_RB32(pkt->data) == 0xffd8ffd9 ||
AV_RB32(pkt->data) == 0xffd9ffd8) {
/* old SWF files containing SOI/EOI as data start */
/* files created by swink have reversed tag */
pkt->size -= 4;
- avio_read(pb, pkt->data, pkt->size);
+ memset(pkt->data+pkt->size, 0, 4);
+ res = avio_read(pb, pkt->data, pkt->size);
} else {
- avio_read(pb, pkt->data + 4, pkt->size - 4);
+ res = avio_read(pb, pkt->data + 4, pkt->size - 4);
+ if (res >= 0)
+ res += 4;
+ }
+ if (res != pkt->size) {
+ if (res < 0) {
+ av_free_packet(pkt);
+ return res;
+ }
+ av_shrink_packet(pkt, res);
}
+
pkt->pos = pos;
pkt->stream_index = st->index;
return pkt->size;
diff --git a/chromium/third_party/ffmpeg/libavformat/swfenc.c b/chromium/third_party/ffmpeg/libavformat/swfenc.c
index 8d9cf0c246c..402f21ef40a 100644
--- a/chromium/third_party/ffmpeg/libavformat/swfenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/swfenc.c
@@ -490,8 +490,7 @@ static int swf_write_trailer(AVFormatContext *s)
if (enc->codec_type == AVMEDIA_TYPE_VIDEO)
video_enc = enc;
else {
- av_fifo_free(swf->audio_fifo);
- swf->audio_fifo = NULL;
+ av_fifo_freep(&swf->audio_fifo);
}
}
diff --git a/chromium/third_party/ffmpeg/libavformat/takdec.c b/chromium/third_party/ffmpeg/libavformat/takdec.c
index 2ed8a1e3b71..4888a776305 100644
--- a/chromium/third_party/ffmpeg/libavformat/takdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/takdec.c
@@ -85,6 +85,7 @@ static int tak_read_header(AVFormatContext *s)
buffer = av_malloc(size - 3 + FF_INPUT_BUFFER_PADDING_SIZE);
if (!buffer)
return AVERROR(ENOMEM);
+ memset(buffer + size - 3, 0, FF_INPUT_BUFFER_PADDING_SIZE);
ffio_init_checksum(pb, tak_check_crc, 0xCE04B7U);
if (avio_read(pb, buffer, size - 3) != size - 3) {
diff --git a/chromium/third_party/ffmpeg/libavformat/tcp.c b/chromium/third_party/ffmpeg/libavformat/tcp.c
index 634d99d0d02..e457fba94fa 100644
--- a/chromium/third_party/ffmpeg/libavformat/tcp.c
+++ b/chromium/third_party/ffmpeg/libavformat/tcp.c
@@ -44,8 +44,8 @@ typedef struct TCPContext {
#define E AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
{"listen", "listen on port instead of connecting", OFFSET(listen), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
-{"timeout", "timeout of socket i/o operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
-{"listen_timeout", "connection awaiting timeout", OFFSET(listen_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
+{"timeout", "set timeout of socket I/O operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
+{"listen_timeout", "set connection awaiting timeout", OFFSET(listen_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
{NULL}
};
@@ -79,8 +79,13 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
}
p = strchr(uri, '?');
if (p) {
- if (av_find_info_tag(buf, sizeof(buf), "listen", p))
- s->listen = 1;
+ if (av_find_info_tag(buf, sizeof(buf), "listen", p)) {
+ char *endptr = NULL;
+ s->listen = strtol(buf, &endptr, 10);
+ /* assume if no digits were found it is a request to enable it */
+ if (buf == endptr)
+ s->listen = 1;
+ }
if (av_find_info_tag(buf, sizeof(buf), "timeout", p)) {
s->rw_timeout = strtol(buf, NULL, 10);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/tee.c b/chromium/third_party/ffmpeg/libavformat/tee.c
index 12ea0ea27d6..f26e15742a5 100644
--- a/chromium/third_party/ffmpeg/libavformat/tee.c
+++ b/chromium/third_party/ffmpeg/libavformat/tee.c
@@ -410,18 +410,17 @@ static int filter_packet(void *log_ctx, AVPacket *pkt,
if (!new_pkt.buf)
break;
}
+ if (ret < 0) {
+ av_log(log_ctx, AV_LOG_ERROR,
+ "Failed to filter bitstream with filter %s for stream %d in file '%s' with codec %s\n",
+ bsf_ctx->filter->name, pkt->stream_index, fmt_ctx->filename,
+ avcodec_get_name(enc_ctx->codec_id));
+ }
*pkt = new_pkt;
bsf_ctx = bsf_ctx->next;
}
- if (ret < 0) {
- av_log(log_ctx, AV_LOG_ERROR,
- "Failed to filter bitstream with filter %s for stream %d in file '%s' with codec %s\n",
- bsf_ctx->filter->name, pkt->stream_index, fmt_ctx->filename,
- avcodec_get_name(enc_ctx->codec_id));
- }
-
return ret;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/tls.c b/chromium/third_party/ffmpeg/libavformat/tls.c
index 5da82db7967..7fd18cfce0c 100644
--- a/chromium/third_party/ffmpeg/libavformat/tls.c
+++ b/chromium/third_party/ffmpeg/libavformat/tls.c
@@ -24,6 +24,9 @@
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
+#include "network.h"
+#include "os_support.h"
+#include "internal.h"
#if CONFIG_GNUTLS
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
@@ -50,9 +53,6 @@
SSL_CTX_free(c->ctx); \
} while (0)
#endif
-#include "network.h"
-#include "os_support.h"
-#include "internal.h"
#if HAVE_POLL_H
#include <poll.h>
#endif
diff --git a/chromium/third_party/ffmpeg/libavformat/txd.c b/chromium/third_party/ffmpeg/libavformat/txd.c
index 194945bbc8f..400f2cc54bd 100644
--- a/chromium/third_party/ffmpeg/libavformat/txd.c
+++ b/chromium/third_party/ffmpeg/libavformat/txd.c
@@ -21,6 +21,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
+#include "internal.h"
#define TXD_FILE 0x16
#define TXD_INFO 0x01
@@ -45,8 +46,8 @@ static int txd_read_header(AVFormatContext *s) {
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = AV_CODEC_ID_TXD;
- st->codec->time_base.den = 5;
- st->codec->time_base.num = 1;
+ avpriv_set_pts_info(st, 64, 1, 5);
+ st->avg_frame_rate = av_inv_q(st->time_base);
/* the parameters will be extracted from the compressed bitstream */
return 0;
diff --git a/chromium/third_party/ffmpeg/libavformat/udp.c b/chromium/third_party/ffmpeg/libavformat/udp.c
index 3c0d6bf0123..91b411e679a 100644
--- a/chromium/third_party/ffmpeg/libavformat/udp.c
+++ b/chromium/third_party/ffmpeg/libavformat/udp.c
@@ -62,6 +62,7 @@ typedef struct {
int ttl;
int buffer_size;
int is_multicast;
+ int is_broadcast;
int local_port;
int reuse_socket;
int overrun_nonfatal;
@@ -84,23 +85,25 @@ typedef struct {
char *local_addr;
int packet_size;
int timeout;
+ struct sockaddr_storage local_addr_storage;
} UDPContext;
#define OFFSET(x) offsetof(UDPContext, x)
#define D AV_OPT_FLAG_DECODING_PARAM
#define E AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
-{"buffer_size", "Socket buffer size in bytes", OFFSET(buffer_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D|E },
-{"localport", "Set local port to bind to", OFFSET(local_port), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D|E },
-{"localaddr", "Choose local IP address", OFFSET(local_addr), AV_OPT_TYPE_STRING, {.str = ""}, 0, 0, D|E },
-{"pkt_size", "Set size of UDP packets", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 = 1472}, 0, INT_MAX, D|E },
-{"reuse", "Explicitly allow or disallow reusing UDP sockets", OFFSET(reuse_socket), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
-{"ttl", "Set the time to live value (for multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, {.i64 = 16}, 0, INT_MAX, E },
-{"connect", "Should connect() be called on socket", OFFSET(is_connected), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
+{"buffer_size", "set packet buffer size in bytes", OFFSET(buffer_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D|E },
+{"localport", "set local port to bind to", OFFSET(local_port), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D|E },
+{"localaddr", "choose local IP address", OFFSET(local_addr), AV_OPT_TYPE_STRING, {.str = ""}, 0, 0, D|E },
+{"pkt_size", "set size of UDP packets", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 = 1472}, 0, INT_MAX, D|E },
+{"reuse", "explicitly allow or disallow reusing UDP sockets", OFFSET(reuse_socket), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
+{"broadcast", "explicitly allow or disallow broadcast destination", OFFSET(is_broadcast), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, E },
+{"ttl", "set the time to live value (for multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, {.i64 = 16}, 0, INT_MAX, E },
+{"connect", "set if connect() should be called on socket", OFFSET(is_connected), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
/* TODO 'sources', 'block' option */
-{"fifo_size", "Set the UDP receiving circular buffer size, expressed as a number of packets with size of 188 bytes", OFFSET(circular_buffer_size), AV_OPT_TYPE_INT, {.i64 = 7*4096}, 0, INT_MAX, D },
-{"overrun_nonfatal", "Survive in case of UDP receiving circular buffer overrun", OFFSET(overrun_nonfatal), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D },
-{"timeout", "In read mode: if no data arrived in more than this time interval, raise error", OFFSET(timeout), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D },
+{"fifo_size", "set the UDP receiving circular buffer size, expressed as a number of packets with size of 188 bytes", OFFSET(circular_buffer_size), AV_OPT_TYPE_INT, {.i64 = 7*4096}, 0, INT_MAX, D },
+{"overrun_nonfatal", "survive in case of UDP receiving circular buffer overrun", OFFSET(overrun_nonfatal), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D },
+{"timeout", "set raise error timeout (only in read mode)", OFFSET(timeout), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D },
{NULL}
};
@@ -140,14 +143,17 @@ static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
return 0;
}
-static int udp_join_multicast_group(int sockfd, struct sockaddr *addr)
+static int udp_join_multicast_group(int sockfd, struct sockaddr *addr,struct sockaddr *local_addr)
{
#ifdef IP_ADD_MEMBERSHIP
if (addr->sa_family == AF_INET) {
struct ip_mreq mreq;
mreq.imr_multiaddr.s_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr;
- mreq.imr_interface.s_addr= INADDR_ANY;
+ if (local_addr)
+ mreq.imr_interface= ((struct sockaddr_in *)local_addr)->sin_addr;
+ else
+ mreq.imr_interface.s_addr= INADDR_ANY;
if (setsockopt(sockfd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const void *)&mreq, sizeof(mreq)) < 0) {
log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IP_ADD_MEMBERSHIP)");
return -1;
@@ -169,14 +175,17 @@ static int udp_join_multicast_group(int sockfd, struct sockaddr *addr)
return 0;
}
-static int udp_leave_multicast_group(int sockfd, struct sockaddr *addr)
+static int udp_leave_multicast_group(int sockfd, struct sockaddr *addr,struct sockaddr *local_addr)
{
#ifdef IP_DROP_MEMBERSHIP
if (addr->sa_family == AF_INET) {
struct ip_mreq mreq;
mreq.imr_multiaddr.s_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr;
- mreq.imr_interface.s_addr= INADDR_ANY;
+ if (local_addr)
+ mreq.imr_interface= ((struct sockaddr_in *)local_addr)->sin_addr;
+ else
+ mreq.imr_interface.s_addr= INADDR_ANY;
if (setsockopt(sockfd, IPPROTO_IP, IP_DROP_MEMBERSHIP, (const void *)&mreq, sizeof(mreq)) < 0) {
log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IP_DROP_MEMBERSHIP)");
return -1;
@@ -595,6 +604,8 @@ static int udp_open(URLContext *h, const char *uri, int flags)
}
if (!is_output && av_find_info_tag(buf, sizeof(buf), "timeout", p))
s->timeout = strtol(buf, NULL, 10);
+ if (is_output && av_find_info_tag(buf, sizeof(buf), "broadcast", p))
+ s->is_broadcast = strtol(buf, NULL, 10);
}
/* handling needed to support options picking from both AVOption and URL */
s->circular_buffer_size *= 188;
@@ -624,6 +635,8 @@ static int udp_open(URLContext *h, const char *uri, int flags)
if (udp_fd < 0)
goto fail;
+ s->local_addr_storage=my_addr; //store for future multicast join
+
/* Follow the requested reuse option, unless it's multicast in which
* case enable reuse unless explicitly disabled.
*/
@@ -633,6 +646,11 @@ static int udp_open(URLContext *h, const char *uri, int flags)
goto fail;
}
+ if (s->is_broadcast) {
+ if (setsockopt (udp_fd, SOL_SOCKET, SO_BROADCAST, &(s->is_broadcast), sizeof(s->is_broadcast)) != 0)
+ goto fail;
+ }
+
/* If multicast, try binding the multicast address first, to avoid
* receiving UDP packets from other sources aimed at the same UDP
* port. This fails on windows. This makes sending to the same address
@@ -668,7 +686,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
if (udp_set_multicast_sources(udp_fd, (struct sockaddr *)&s->dest_addr, s->dest_addr_len, include_sources, num_include_sources, 1) < 0)
goto fail;
} else {
- if (udp_join_multicast_group(udp_fd, (struct sockaddr *)&s->dest_addr) < 0)
+ if (udp_join_multicast_group(udp_fd, (struct sockaddr *)&s->dest_addr,(struct sockaddr *)&s->local_addr_storage) < 0)
goto fail;
}
if (num_exclude_sources) {
@@ -686,12 +704,20 @@ static int udp_open(URLContext *h, const char *uri, int flags)
goto fail;
}
} else {
- /* set udp recv buffer size to the largest possible udp packet size to
- * avoid losing data on OSes that set this too low by default. */
+ /* set udp recv buffer size to the requested value (default 64K) */
tmp = s->buffer_size;
if (setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp)) < 0) {
log_net_error(h, AV_LOG_WARNING, "setsockopt(SO_RECVBUF)");
}
+ len = sizeof(tmp);
+ if (getsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, &len) < 0) {
+ log_net_error(h, AV_LOG_WARNING, "getsockopt(SO_RCVBUF)");
+ } else {
+ av_log(h, AV_LOG_DEBUG, "end receive buffer size reported is %d\n", tmp);
+ if(tmp < s->buffer_size)
+ av_log(h, AV_LOG_WARNING, "attempted to set receive buffer to size %d but it only ended up set as %d", s->buffer_size, tmp);
+ }
+
/* make the socket non-blocking */
ff_socket_nonblock(udp_fd, 1);
}
@@ -744,7 +770,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
fail:
if (udp_fd >= 0)
closesocket(udp_fd);
- av_fifo_free(s->fifo);
+ av_fifo_freep(&s->fifo);
for (i = 0; i < num_include_sources; i++)
av_freep(&include_sources[i]);
for (i = 0; i < num_exclude_sources; i++)
@@ -838,7 +864,7 @@ static int udp_close(URLContext *h)
int ret;
if (s->is_multicast && (h->flags & AVIO_FLAG_READ))
- udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr);
+ udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr,(struct sockaddr *)&s->local_addr_storage);
closesocket(s->udp_fd);
#if HAVE_PTHREAD_CANCEL
if (s->thread_started) {
@@ -850,7 +876,7 @@ static int udp_close(URLContext *h)
pthread_cond_destroy(&s->cond);
}
#endif
- av_fifo_free(s->fifo);
+ av_fifo_freep(&s->fifo);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/uncodedframecrcenc.c b/chromium/third_party/ffmpeg/libavformat/uncodedframecrcenc.c
new file mode 100644
index 00000000000..414683fe23c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/uncodedframecrcenc.c
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2013 Nicolas George
+*
+* 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 "libavutil/adler32.h"
+#include "libavutil/avassert.h"
+#include "libavutil/bprint.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/pixdesc.h"
+#include "avformat.h"
+#include "internal.h"
+
+/* Identical to Adler32 when the type is uint8_t. */
+#define DEFINE_CKSUM_LINE(name, type, conv) \
+static void cksum_line_ ## name(unsigned *cksum, void *data, unsigned size) \
+{ \
+ type *p = data; \
+ unsigned a = *cksum & 0xFFFF, b = *cksum >> 16; \
+ for (; size > 0; size--, p++) { \
+ a = (a + (unsigned)(conv)) % 65521; \
+ b = (b + a) % 65521; \
+ } \
+ *cksum = a | (b << 16); \
+}
+
+DEFINE_CKSUM_LINE(u8, uint8_t, *p)
+DEFINE_CKSUM_LINE(s16, int16_t, *p + 0x8000)
+DEFINE_CKSUM_LINE(s32, int32_t, *p + 0x80000000)
+DEFINE_CKSUM_LINE(flt, float, *p * 0x80000000 + 0x80000000)
+DEFINE_CKSUM_LINE(dbl, double, *p * 0x80000000 + 0x80000000)
+
+static void video_frame_cksum(AVBPrint *bp, AVFrame *frame)
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
+ int i, y;
+ uint8_t *data;
+ int linesize[5] = { 0 };
+
+ av_bprintf(bp, ", %d x %d", frame->width, frame->height);
+ if (!desc) {
+ av_bprintf(bp, ", unknown");
+ return;
+ }
+ if (av_image_fill_linesizes(linesize, frame->format, frame->width) < 0)
+ return;
+ av_bprintf(bp, ", %s", desc->name);
+ for (i = 0; linesize[i]; i++) {
+ unsigned cksum = 0;
+ int h = frame->height;
+ if ((i == 1 || i == 2) && desc->nb_components >= 3)
+ h = -((-h) >> desc->log2_chroma_h);
+ data = frame->data[i];
+ for (y = 0; y < h; y++) {
+ cksum = av_adler32_update(cksum, data, linesize[i]);
+ data += frame->linesize[i];
+ }
+ av_bprintf(bp, ", 0x%08x", cksum);
+ }
+}
+
+static void audio_frame_cksum(AVBPrint *bp, AVFrame *frame)
+{
+ int nb_planes, nb_samples, p;
+ const char *name;
+
+ nb_planes = av_frame_get_channels(frame);
+ nb_samples = frame->nb_samples;
+ if (!av_sample_fmt_is_planar(frame->format)) {
+ nb_samples *= nb_planes;
+ nb_planes = 1;
+ }
+ name = av_get_sample_fmt_name(frame->format);
+ av_bprintf(bp, ", %d samples", frame->nb_samples);
+ av_bprintf(bp, ", %s", name ? name : "unknown");
+ for (p = 0; p < nb_planes; p++) {
+ uint32_t cksum = 0;
+ void *d = frame->extended_data[p];
+ switch (frame->format) {
+ case AV_SAMPLE_FMT_U8:
+ case AV_SAMPLE_FMT_U8P:
+ cksum_line_u8(&cksum, d, nb_samples);
+ break;
+ case AV_SAMPLE_FMT_S16:
+ case AV_SAMPLE_FMT_S16P:
+ cksum_line_s16(&cksum, d, nb_samples);
+ break;
+ case AV_SAMPLE_FMT_S32:
+ case AV_SAMPLE_FMT_S32P:
+ cksum_line_s32(&cksum, d, nb_samples);
+ break;
+ case AV_SAMPLE_FMT_FLT:
+ case AV_SAMPLE_FMT_FLTP:
+ cksum_line_flt(&cksum, d, nb_samples);
+ break;
+ case AV_SAMPLE_FMT_DBL:
+ case AV_SAMPLE_FMT_DBLP:
+ cksum_line_dbl(&cksum, d, nb_samples);
+ break;
+ default:
+ av_assert0(!"reached");
+ }
+ av_bprintf(bp, ", 0x%08x", cksum);
+ }
+}
+
+static int write_frame(struct AVFormatContext *s, int stream_index,
+ AVFrame **frame, unsigned flags)
+{
+ AVBPrint bp;
+ int ret = 0;
+ enum AVMediaType type;
+ const char *type_name;
+
+ if ((flags & AV_WRITE_UNCODED_FRAME_QUERY))
+ return 0;
+
+ av_bprint_init(&bp, 0, AV_BPRINT_SIZE_UNLIMITED);
+ av_bprintf(&bp, "%d, %10"PRId64"",
+ stream_index, (*frame)->pts);
+ type = s->streams[stream_index]->codec->codec_type;
+ type_name = av_get_media_type_string(type);
+ av_bprintf(&bp, ", %s", type_name ? type_name : "unknown");
+ switch (type) {
+ case AVMEDIA_TYPE_VIDEO:
+ video_frame_cksum(&bp, *frame);
+ break;
+ case AVMEDIA_TYPE_AUDIO:
+ audio_frame_cksum(&bp, *frame);
+ break;
+ }
+
+ av_bprint_chars(&bp, '\n', 1);
+ if (av_bprint_is_complete(&bp))
+ avio_write(s->pb, bp.str, bp.len);
+ else
+ ret = AVERROR(ENOMEM);
+ av_bprint_finalize(&bp, NULL);
+ return ret;
+}
+
+static int write_packet(struct AVFormatContext *s, AVPacket *pkt)
+{
+ return AVERROR(ENOSYS);
+}
+
+AVOutputFormat ff_uncodedframecrc_muxer = {
+ .name = "uncodedframecrc",
+ .long_name = NULL_IF_CONFIG_SMALL("uncoded framecrc testing"),
+ .audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .write_header = ff_framehash_write_header,
+ .write_packet = write_packet,
+ .write_uncoded_frame = write_frame,
+ .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+ AVFMT_TS_NEGATIVE,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/utils.c b/chromium/third_party/ffmpeg/libavformat/utils.c
index fc4de4c34eb..d84d6053ffa 100644
--- a/chromium/third_party/ffmpeg/libavformat/utils.c
+++ b/chromium/third_party/ffmpeg/libavformat/utils.c
@@ -19,36 +19,39 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#undef NDEBUG
+#include <assert.h>
+#include <stdarg.h>
#include <stdint.h>
-#include "avformat.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "libavcodec/internal.h"
-#include "libavcodec/raw.h"
-#include "libavcodec/bytestream.h"
-#include "libavutil/opt.h"
-#include "libavutil/dict.h"
-#include "libavutil/internal.h"
-#include "libavutil/pixdesc.h"
-#include "metadata.h"
-#include "id3v2.h"
+#include "config.h"
+
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
+#include "libavutil/dict.h"
+#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
+#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
+#include "libavutil/pixdesc.h"
#include "libavutil/time.h"
#include "libavutil/timestamp.h"
-#include "riff.h"
+
+#include "libavcodec/bytestream.h"
+#include "libavcodec/internal.h"
+#include "libavcodec/raw.h"
+
#include "audiointerleave.h"
-#include "url.h"
-#include <stdarg.h>
+#include "avformat.h"
+#include "avio_internal.h"
+#include "id3v2.h"
+#include "internal.h"
+#include "metadata.h"
#if CONFIG_NETWORK
#include "network.h"
#endif
-
-#undef NDEBUG
-#include <assert.h>
+#include "riff.h"
+#include "url.h"
/**
* @file
@@ -91,10 +94,10 @@ static int64_t wrap_timestamp(AVStream *st, int64_t timestamp)
st->pts_wrap_reference != AV_NOPTS_VALUE && timestamp != AV_NOPTS_VALUE) {
if (st->pts_wrap_behavior == AV_PTS_WRAP_ADD_OFFSET &&
timestamp < st->pts_wrap_reference)
- return timestamp + (1ULL<<st->pts_wrap_bits);
+ return timestamp + (1ULL << st->pts_wrap_bits);
else if (st->pts_wrap_behavior == AV_PTS_WRAP_SUB_OFFSET &&
timestamp >= st->pts_wrap_reference)
- return timestamp - (1ULL<<st->pts_wrap_bits);
+ return timestamp - (1ULL << st->pts_wrap_bits);
}
return timestamp;
}
@@ -103,21 +106,34 @@ MAKE_ACCESSORS(AVStream, stream, AVRational, r_frame_rate)
MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, video_codec)
MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, audio_codec)
MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, subtitle_codec)
+MAKE_ACCESSORS(AVFormatContext, format, int, metadata_header_padding)
+MAKE_ACCESSORS(AVFormatContext, format, void *, opaque)
+MAKE_ACCESSORS(AVFormatContext, format, av_format_control_message, control_message_cb)
-static AVCodec *find_decoder(AVFormatContext *s, AVStream *st, enum AVCodecID codec_id)
+void av_format_inject_global_side_data(AVFormatContext *s)
+{
+ int i;
+ s->internal->inject_global_side_data = 1;
+ for (i = 0; i < s->nb_streams; i++) {
+ AVStream *st = s->streams[i];
+ st->inject_global_side_data = 1;
+ }
+}
+
+static const AVCodec *find_decoder(AVFormatContext *s, AVStream *st, enum AVCodecID codec_id)
{
if (st->codec->codec)
return st->codec->codec;
- switch(st->codec->codec_type){
+ switch (st->codec->codec_type) {
case AVMEDIA_TYPE_VIDEO:
- if(s->video_codec) return s->video_codec;
+ if (s->video_codec) return s->video_codec;
break;
case AVMEDIA_TYPE_AUDIO:
- if(s->audio_codec) return s->audio_codec;
+ if (s->audio_codec) return s->audio_codec;
break;
case AVMEDIA_TYPE_SUBTITLE:
- if(s->subtitle_codec) return s->subtitle_codec;
+ if (s->subtitle_codec) return s->subtitle_codec;
break;
}
@@ -134,28 +150,26 @@ int av_format_get_probe_score(const AVFormatContext *s)
int ffio_limit(AVIOContext *s, int size)
{
- if(s->maxsize>=0){
+ if (s->maxsize>= 0) {
int64_t remaining= s->maxsize - avio_tell(s);
- if(remaining < size){
- int64_t newsize= avio_size(s);
- if(!s->maxsize || s->maxsize<newsize)
- s->maxsize= newsize - !newsize;
+ if (remaining < size) {
+ int64_t newsize = avio_size(s);
+ if (!s->maxsize || s->maxsize<newsize)
+ s->maxsize = newsize - !newsize;
remaining= s->maxsize - avio_tell(s);
remaining= FFMAX(remaining, 0);
}
- if(s->maxsize>=0 && remaining+1 < size){
+ if (s->maxsize>= 0 && remaining+1 < size) {
av_log(NULL, remaining ? AV_LOG_ERROR : AV_LOG_DEBUG, "Truncating packet of size %d to %"PRId64"\n", size, remaining+1);
- size= remaining+1;
+ size = remaining+1;
}
}
return size;
}
-/*
- * Read the data in sane-sized chunks and append to pkt.
- * Return the number of bytes read or an error.
- */
+/* Read the data in sane-sized chunks and append to pkt.
+ * Return the number of bytes read or an error. */
static int append_packet_chunked(AVIOContext *s, AVPacket *pkt, int size)
{
int64_t orig_pos = pkt->pos; // av_grow_packet might reset pos
@@ -166,10 +180,8 @@ static int append_packet_chunked(AVIOContext *s, AVPacket *pkt, int size)
int prev_size = pkt->size;
int read_size;
- /*
- * When the caller requests a lot of data, limit it to the amount left
- * in file or SANE_CHUNK_SIZE when it is not known
- */
+ /* When the caller requests a lot of data, limit it to the amount
+ * left in file or SANE_CHUNK_SIZE when it is not known. */
read_size = size;
if (read_size > SANE_CHUNK_SIZE/10) {
read_size = ffio_limit(s, read_size);
@@ -216,18 +228,19 @@ int av_append_packet(AVIOContext *s, AVPacket *pkt, int size)
return append_packet_chunked(s, pkt, size);
}
-
int av_filename_number_test(const char *filename)
{
char buf[1024];
- return filename && (av_get_frame_filename(buf, sizeof(buf), filename, 1)>=0);
+ return filename &&
+ (av_get_frame_filename(buf, sizeof(buf), filename, 1) >= 0);
}
-AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score_ret)
+AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened,
+ int *score_ret)
{
AVProbeData lpd = *pd;
AVInputFormat *fmt1 = NULL, *fmt;
- int score, nodat = 0, score_max=0;
+ int score, nodat = 0, score_max = 0;
const static uint8_t zerobuffer[AVPROBE_PADDING_SIZE];
if (!lpd.buf)
@@ -236,9 +249,11 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score
if (lpd.buf_size > 10 && ff_id3v2_match(lpd.buf, ID3v2_DEFAULT_MAGIC)) {
int id3len = ff_id3v2_tag_len(lpd.buf);
if (lpd.buf_size > id3len + 16) {
- lpd.buf += id3len;
+ lpd.buf += id3len;
lpd.buf_size -= id3len;
- }else
+ } else if (id3len >= PROBE_BUF_MAX) {
+ nodat = 2;
+ } else
nodat = 1;
}
@@ -249,22 +264,24 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score
score = 0;
if (fmt1->read_probe) {
score = fmt1->read_probe(&lpd);
- if(fmt1->extensions && av_match_ext(lpd.filename, fmt1->extensions))
- score = FFMAX(score, nodat ? AVPROBE_SCORE_EXTENSION / 2 - 1 : 1);
+ if (fmt1->extensions && av_match_ext(lpd.filename, fmt1->extensions)) {
+ if (nodat == 0) score = FFMAX(score, 1);
+ else if (nodat == 1) score = FFMAX(score, AVPROBE_SCORE_EXTENSION / 2 - 1);
+ else score = FFMAX(score, AVPROBE_SCORE_EXTENSION);
+ }
} else if (fmt1->extensions) {
- if (av_match_ext(lpd.filename, fmt1->extensions)) {
+ if (av_match_ext(lpd.filename, fmt1->extensions))
score = AVPROBE_SCORE_EXTENSION;
- }
}
if (score > score_max) {
score_max = score;
- fmt = fmt1;
- }else if (score == score_max)
+ fmt = fmt1;
+ } else if (score == score_max)
fmt = NULL;
}
- if(nodat)
+ if (nodat == 1)
score_max = FFMIN(AVPROBE_SCORE_EXTENSION / 2 - 1, score_max);
- *score_ret= score_max;
+ *score_ret = score_max;
return fmt;
}
@@ -272,32 +289,37 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score
AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)
{
int score_ret;
- AVInputFormat *fmt= av_probe_input_format3(pd, is_opened, &score_ret);
- if(score_ret > *score_max){
- *score_max= score_ret;
+ AVInputFormat *fmt = av_probe_input_format3(pd, is_opened, &score_ret);
+ if (score_ret > *score_max) {
+ *score_max = score_ret;
return fmt;
- }else
+ } else
return NULL;
}
-AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened){
- int score=0;
+AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened)
+{
+ int score = 0;
return av_probe_input_format2(pd, is_opened, &score);
}
-static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, AVProbeData *pd)
+static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
+ AVProbeData *pd)
{
static const struct {
- const char *name; enum AVCodecID id; enum AVMediaType type;
+ const char *name;
+ enum AVCodecID id;
+ enum AVMediaType type;
} fmt_id_type[] = {
- { "aac" , AV_CODEC_ID_AAC , AVMEDIA_TYPE_AUDIO },
- { "ac3" , AV_CODEC_ID_AC3 , AVMEDIA_TYPE_AUDIO },
- { "dts" , AV_CODEC_ID_DTS , AVMEDIA_TYPE_AUDIO },
- { "eac3" , AV_CODEC_ID_EAC3 , AVMEDIA_TYPE_AUDIO },
- { "h264" , AV_CODEC_ID_H264 , AVMEDIA_TYPE_VIDEO },
- { "loas" , AV_CODEC_ID_AAC_LATM , AVMEDIA_TYPE_AUDIO },
- { "m4v" , AV_CODEC_ID_MPEG4 , AVMEDIA_TYPE_VIDEO },
- { "mp3" , AV_CODEC_ID_MP3 , AVMEDIA_TYPE_AUDIO },
+ { "aac", AV_CODEC_ID_AAC, AVMEDIA_TYPE_AUDIO },
+ { "ac3", AV_CODEC_ID_AC3, AVMEDIA_TYPE_AUDIO },
+ { "dts", AV_CODEC_ID_DTS, AVMEDIA_TYPE_AUDIO },
+ { "eac3", AV_CODEC_ID_EAC3, AVMEDIA_TYPE_AUDIO },
+ { "h264", AV_CODEC_ID_H264, AVMEDIA_TYPE_VIDEO },
+ { "hevc", AV_CODEC_ID_HEVC, AVMEDIA_TYPE_VIDEO },
+ { "loas", AV_CODEC_ID_AAC_LATM, AVMEDIA_TYPE_AUDIO },
+ { "m4v", AV_CODEC_ID_MPEG4, AVMEDIA_TYPE_VIDEO },
+ { "mp3", AV_CODEC_ID_MP3, AVMEDIA_TYPE_AUDIO },
{ "mpegvideo", AV_CODEC_ID_MPEG2VIDEO, AVMEDIA_TYPE_VIDEO },
{ 0 }
};
@@ -306,8 +328,10 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, AVProbeDa
if (fmt && st->request_probe <= score) {
int i;
- av_log(s, AV_LOG_DEBUG, "Probe with size=%d, packets=%d detected %s with score=%d\n",
- pd->buf_size, MAX_PROBE_PACKETS - st->probe_packets, fmt->name, score);
+ av_log(s, AV_LOG_DEBUG,
+ "Probe with size=%d, packets=%d detected %s with score=%d\n",
+ pd->buf_size, MAX_PROBE_PACKETS - st->probe_packets,
+ fmt->name, score);
for (i = 0; fmt_id_type[i].name; i++) {
if (!strcmp(fmt->name, fmt_id_type[i].name)) {
st->codec->codec_id = fmt_id_type[i].id;
@@ -322,7 +346,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, AVProbeDa
/************************************************************/
/* input media file */
-int av_demuxer_open(AVFormatContext *ic){
+int av_demuxer_open(AVFormatContext *ic) {
int err;
if (ic->iformat->read_header) {
@@ -342,25 +366,24 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
const char *filename, void *logctx,
unsigned int offset, unsigned int max_probe_size)
{
- AVProbeData pd = { filename ? filename : "", NULL, -offset };
- unsigned char *buf = NULL;
+ AVProbeData pd = { filename ? filename : "" };
+ uint8_t *buf = NULL;
uint8_t *mime_type;
int ret = 0, probe_size, buf_offset = 0;
int score = 0;
- if (!max_probe_size) {
+ if (!max_probe_size)
max_probe_size = PROBE_BUF_MAX;
- } else if (max_probe_size > PROBE_BUF_MAX) {
+ else if (max_probe_size > PROBE_BUF_MAX)
max_probe_size = PROBE_BUF_MAX;
- } else if (max_probe_size < PROBE_BUF_MIN) {
+ else if (max_probe_size < PROBE_BUF_MIN) {
av_log(logctx, AV_LOG_ERROR,
"Specified probe size value %u cannot be < %u\n", max_probe_size, PROBE_BUF_MIN);
return AVERROR(EINVAL);
}
- if (offset >= max_probe_size) {
+ if (offset >= max_probe_size)
return AVERROR(EINVAL);
- }
if (!*fmt && pb->av_class && av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type) >= 0 && mime_type) {
if (!av_strcasecmp(mime_type, "audio/aacp")) {
@@ -369,38 +392,44 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
av_freep(&mime_type);
}
- for(probe_size= PROBE_BUF_MIN; probe_size<=max_probe_size && !*fmt;
- probe_size = FFMIN(probe_size<<1, FFMAX(max_probe_size, probe_size+1))) {
-
- if (probe_size < offset) {
- continue;
- }
+ for (probe_size = PROBE_BUF_MIN; probe_size <= max_probe_size && !*fmt;
+ probe_size = FFMIN(probe_size << 1,
+ FFMAX(max_probe_size, probe_size + 1))) {
score = probe_size < max_probe_size ? AVPROBE_SCORE_RETRY : 0;
- /* read probe data */
+ /* Read probe data. */
if ((ret = av_reallocp(&buf, probe_size + AVPROBE_PADDING_SIZE)) < 0)
return ret;
- if ((ret = avio_read(pb, buf + buf_offset, probe_size - buf_offset)) < 0) {
- /* fail if error was not end of file, otherwise, lower score */
+ if ((ret = avio_read(pb, buf + buf_offset,
+ probe_size - buf_offset)) < 0) {
+ /* Fail if error was not end of file, otherwise, lower score. */
if (ret != AVERROR_EOF) {
av_free(buf);
return ret;
}
score = 0;
- ret = 0; /* error was end of file, nothing read */
+ ret = 0; /* error was end of file, nothing read */
}
- pd.buf_size = buf_offset += ret;
+ buf_offset += ret;
+ if (buf_offset < offset)
+ continue;
+ pd.buf_size = buf_offset - offset;
pd.buf = &buf[offset];
memset(pd.buf + pd.buf_size, 0, AVPROBE_PADDING_SIZE);
- /* guess file format */
+ /* Guess file format. */
*fmt = av_probe_input_format2(&pd, 1, &score);
- if(*fmt){
- if(score <= AVPROBE_SCORE_RETRY){ //this can only be true in the last iteration
- av_log(logctx, AV_LOG_WARNING, "Format %s detected only with low score of %d, misdetection possible!\n", (*fmt)->name, score);
- }else
- av_log(logctx, AV_LOG_DEBUG, "Format %s probed with size=%d and score=%d\n", (*fmt)->name, probe_size, score);
+ if (*fmt) {
+ /* This can only be true in the last iteration. */
+ if (score <= AVPROBE_SCORE_RETRY) {
+ av_log(logctx, AV_LOG_WARNING,
+ "Format %s detected only with low score of %d, "
+ "misdetection possible!\n", (*fmt)->name, score);
+ } else
+ av_log(logctx, AV_LOG_DEBUG,
+ "Format %s probed with size=%d and score=%d\n",
+ (*fmt)->name, probe_size, score);
#if 0
FILE *f = fopen("probestat.tmp", "ab");
fprintf(f, "probe_size:%d format:%s score:%d filename:%s\n", probe_size, (*fmt)->name, score, filename);
@@ -414,8 +443,8 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
return AVERROR_INVALIDDATA;
}
- /* rewind. reuse probe buffer to avoid seeking */
- ret = ffio_rewind_with_probe_data(pb, &buf, pd.buf_size);
+ /* Rewind. Reuse probe buffer to avoid seeking. */
+ ret = ffio_rewind_with_probe_data(pb, &buf, buf_offset);
return ret < 0 ? ret : score;
}
@@ -428,25 +457,26 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
return ret < 0 ? ret : 0;
}
-
-/* open input file and probe the format if necessary */
-static int init_input(AVFormatContext *s, const char *filename, AVDictionary **options)
+/* Open input file and probe the format if necessary. */
+static int init_input(AVFormatContext *s, const char *filename,
+ AVDictionary **options)
{
int ret;
- AVProbeData pd = {filename, NULL, 0};
+ AVProbeData pd = { filename, NULL, 0 };
int score = AVPROBE_SCORE_RETRY;
if (s->pb) {
s->flags |= AVFMT_FLAG_CUSTOM_IO;
if (!s->iformat)
- return av_probe_input_buffer2(s->pb, &s->iformat, filename, s, 0, s->probesize);
+ return av_probe_input_buffer2(s->pb, &s->iformat, filename,
+ s, 0, s->probesize);
else if (s->iformat->flags & AVFMT_NOFILE)
av_log(s, AV_LOG_WARNING, "Custom AVIOContext makes no sense and "
"will be ignored with AVFMT_NOFILE format.\n");
return 0;
}
- if ( (s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
+ if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
(!s->iformat && (s->iformat = av_probe_input_format2(&pd, 0, &score))))
return score;
@@ -455,11 +485,13 @@ static int init_input(AVFormatContext *s, const char *filename, AVDictionary **o
return ret;
if (s->iformat)
return 0;
- return av_probe_input_buffer2(s->pb, &s->iformat, filename, s, 0, s->probesize);
+ return av_probe_input_buffer2(s->pb, &s->iformat, filename,
+ s, 0, s->probesize);
}
static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt,
- AVPacketList **plast_pktl){
+ AVPacketList **plast_pktl)
+{
AVPacketList *pktl = av_mallocz(sizeof(AVPacketList));
if (!pktl)
return NULL;
@@ -469,9 +501,9 @@ static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt,
else
*packet_buffer = pktl;
- /* add the packet in the buffered packet list */
+ /* Add the packet in the buffered packet list. */
*plast_pktl = pktl;
- pktl->pkt= *pkt;
+ pktl->pkt = *pkt;
return &pktl->pkt;
}
@@ -482,16 +514,18 @@ int avformat_queue_attached_pictures(AVFormatContext *s)
if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC &&
s->streams[i]->discard < AVDISCARD_ALL) {
AVPacket copy = s->streams[i]->attached_pic;
- copy.buf = av_buffer_ref(copy.buf);
+ copy.buf = av_buffer_ref(copy.buf);
if (!copy.buf)
return AVERROR(ENOMEM);
- add_to_pktbuf(&s->raw_packet_buffer, &copy, &s->raw_packet_buffer_end);
+ add_to_pktbuf(&s->raw_packet_buffer, &copy,
+ &s->raw_packet_buffer_end);
}
return 0;
}
-int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
+int avformat_open_input(AVFormatContext **ps, const char *filename,
+ AVInputFormat *fmt, AVDictionary **options)
{
AVFormatContext *s = *ps;
int ret = 0;
@@ -500,7 +534,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma
if (!s && !(s = avformat_alloc_context()))
return AVERROR(ENOMEM);
- if (!s->av_class){
+ if (!s->av_class) {
av_log(NULL, AV_LOG_ERROR, "Input context has not been properly allocated by avformat_alloc_context() and is not NULL either\n");
return AVERROR(EINVAL);
}
@@ -518,7 +552,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma
s->probe_score = ret;
avio_skip(s->pb, s->skip_initial_bytes);
- /* check filename in case an image number is expected */
+ /* Check filename in case an image number is expected. */
if (s->iformat->flags & AVFMT_NEEDNUMBER) {
if (!av_filename_number_test(filename)) {
ret = AVERROR(EINVAL);
@@ -529,14 +563,14 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma
s->duration = s->start_time = AV_NOPTS_VALUE;
av_strlcpy(s->filename, filename ? filename : "", sizeof(s->filename));
- /* allocate private data */
+ /* Allocate private data. */
if (s->iformat->priv_data_size > 0) {
if (!(s->priv_data = av_mallocz(s->iformat->priv_data_size))) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (s->iformat->priv_class) {
- *(const AVClass**)s->priv_data = s->iformat->priv_class;
+ *(const AVClass **) s->priv_data = s->iformat->priv_class;
av_opt_set_defaults(s->priv_data);
if ((ret = av_opt_set_dict(s->priv_data, &tmp)) < 0)
goto fail;
@@ -545,7 +579,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma
/* e.g. AVFMT_NOFILE formats will not have a AVIOContext */
if (s->pb)
- ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
+ ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, 0);
if (!(s->flags&AVFMT_FLAG_PRIV_OPT) && s->iformat->read_header)
if ((ret = s->iformat->read_header(s)) < 0)
@@ -554,7 +588,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma
if (id3v2_extra_meta) {
if (!strcmp(s->iformat->name, "mp3") || !strcmp(s->iformat->name, "aac") ||
!strcmp(s->iformat->name, "tta")) {
- if((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0)
+ if ((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0)
goto fail;
} else
av_log(s, AV_LOG_DEBUG, "demuxer does not support additional id3 data, skipping\n");
@@ -590,22 +624,25 @@ fail:
static void force_codec_ids(AVFormatContext *s, AVStream *st)
{
- switch(st->codec->codec_type){
+ switch (st->codec->codec_type) {
case AVMEDIA_TYPE_VIDEO:
- if(s->video_codec_id) st->codec->codec_id= s->video_codec_id;
+ if (s->video_codec_id)
+ st->codec->codec_id = s->video_codec_id;
break;
case AVMEDIA_TYPE_AUDIO:
- if(s->audio_codec_id) st->codec->codec_id= s->audio_codec_id;
+ if (s->audio_codec_id)
+ st->codec->codec_id = s->audio_codec_id;
break;
case AVMEDIA_TYPE_SUBTITLE:
- if(s->subtitle_codec_id)st->codec->codec_id= s->subtitle_codec_id;
+ if (s->subtitle_codec_id)
+ st->codec->codec_id = s->subtitle_codec_id;
break;
}
}
static int probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
{
- if(st->request_probe>0){
+ if (st->request_probe>0) {
AVProbeData *pd = &st->probe_data;
int end;
av_log(s, AV_LOG_DEBUG, "probing stream %d pp:%d\n", st->index, st->probe_packets);
@@ -613,38 +650,38 @@ static int probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
if (pkt) {
uint8_t *new_buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);
- if(!new_buf) {
+ if (!new_buf) {
av_log(s, AV_LOG_WARNING,
"Failed to reallocate probe buffer for stream %d\n",
st->index);
goto no_packet;
}
pd->buf = new_buf;
- memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);
+ memcpy(pd->buf + pd->buf_size, pkt->data, pkt->size);
pd->buf_size += pkt->size;
- memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);
+ memset(pd->buf + pd->buf_size, 0, AVPROBE_PADDING_SIZE);
} else {
no_packet:
st->probe_packets = 0;
if (!pd->buf_size) {
- av_log(s, AV_LOG_WARNING, "nothing to probe for stream %d\n",
- st->index);
+ av_log(s, AV_LOG_WARNING,
+ "nothing to probe for stream %d\n", st->index);
}
}
end= s->raw_packet_buffer_remaining_size <= 0
- || st->probe_packets<=0;
+ || st->probe_packets<= 0;
- if(end || av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)){
- int score= set_codec_from_probe_data(s, st, pd);
- if( (st->codec->codec_id != AV_CODEC_ID_NONE && score > AVPROBE_SCORE_RETRY)
- || end){
- pd->buf_size=0;
+ if (end || av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)) {
+ int score = set_codec_from_probe_data(s, st, pd);
+ if ( (st->codec->codec_id != AV_CODEC_ID_NONE && score > AVPROBE_SCORE_STREAM_RETRY)
+ || end) {
+ pd->buf_size = 0;
av_freep(&pd->buf);
- st->request_probe= -1;
- if(st->codec->codec_id != AV_CODEC_ID_NONE){
+ st->request_probe = -1;
+ if (st->codec->codec_id != AV_CODEC_ID_NONE) {
av_log(s, AV_LOG_DEBUG, "probed stream %d\n", st->index);
- }else
+ } else
av_log(s, AV_LOG_WARNING, "probed stream %d failed\n", st->index);
}
force_codec_ids(s, st);
@@ -664,13 +701,13 @@ static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_in
ref = pkt->pts;
if (st->pts_wrap_reference != AV_NOPTS_VALUE || st->pts_wrap_bits >= 63 || ref == AV_NOPTS_VALUE || !s->correct_ts_overflow)
return 0;
- ref &= (1LL<<st->pts_wrap_bits)-1;
+ ref &= (1LL << st->pts_wrap_bits)-1;
// reference time stamp should be 60 s before first time stamp
pts_wrap_reference = ref - av_rescale(60, st->time_base.den, st->time_base.num);
// if first time stamp is not more than 1/8 and 60s before the wrap point, subtract rather than add wrap offset
- pts_wrap_behavior = (ref < (1LL<<st->pts_wrap_bits) - (1LL<<st->pts_wrap_bits-3)) ||
- (ref < (1LL<<st->pts_wrap_bits) - av_rescale(60, st->time_base.den, st->time_base.num)) ?
+ pts_wrap_behavior = (ref < (1LL << st->pts_wrap_bits) - (1LL << st->pts_wrap_bits-3)) ||
+ (ref < (1LL << st->pts_wrap_bits) - av_rescale(60, st->time_base.den, st->time_base.num)) ?
AV_PTS_WRAP_ADD_OFFSET : AV_PTS_WRAP_SUB_OFFSET;
first_program = av_find_program_from_stream(s, NULL, stream_index);
@@ -678,7 +715,7 @@ static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_in
if (!first_program) {
int default_stream_index = av_find_default_stream_index(s);
if (s->streams[default_stream_index]->pts_wrap_reference == AV_NOPTS_VALUE) {
- for (i=0; i<s->nb_streams; i++) {
+ for (i = 0; i < s->nb_streams; i++) {
s->streams[i]->pts_wrap_reference = pts_wrap_reference;
s->streams[i]->pts_wrap_behavior = pts_wrap_behavior;
}
@@ -701,9 +738,9 @@ static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_in
// update every program with differing pts_wrap_reference
program = first_program;
- while(program) {
+ while (program) {
if (program->pts_wrap_reference != pts_wrap_reference) {
- for (i=0; i<program->nb_stream_indexes; i++) {
+ for (i = 0; i<program->nb_stream_indexes; i++) {
s->streams[program->stream_index[i]]->pts_wrap_reference = pts_wrap_reference;
s->streams[program->stream_index[i]]->pts_wrap_behavior = pts_wrap_behavior;
}
@@ -722,18 +759,17 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
int ret, i, err;
AVStream *st;
- for(;;){
+ for (;;) {
AVPacketList *pktl = s->raw_packet_buffer;
if (pktl) {
*pkt = pktl->pkt;
- st = s->streams[pkt->stream_index];
- if (s->raw_packet_buffer_remaining_size <= 0) {
+ st = s->streams[pkt->stream_index];
+ if (s->raw_packet_buffer_remaining_size <= 0)
if ((err = probe_codec(s, st, NULL)) < 0)
return err;
- }
- if(st->request_probe <= 0){
- s->raw_packet_buffer = pktl->next;
+ if (st->request_probe <= 0) {
+ s->raw_packet_buffer = pktl->next;
s->raw_packet_buffer_remaining_size += pkt->size;
av_free(pktl);
return 0;
@@ -743,16 +779,15 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->data = NULL;
pkt->size = 0;
av_init_packet(pkt);
- ret= s->iformat->read_packet(s, pkt);
+ ret = s->iformat->read_packet(s, pkt);
if (ret < 0) {
if (!pktl || ret == AVERROR(EAGAIN))
return ret;
for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
- if (st->probe_packets) {
+ if (st->probe_packets)
if ((err = probe_codec(s, st, NULL)) < 0)
return err;
- }
av_assert0(st->request_probe <= 0);
}
continue;
@@ -767,12 +802,12 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
continue;
}
- if(pkt->stream_index >= (unsigned)s->nb_streams){
+ if (pkt->stream_index >= (unsigned)s->nb_streams) {
av_log(s, AV_LOG_ERROR, "Invalid stream index %d\n", pkt->stream_index);
continue;
}
- st= s->streams[pkt->stream_index];
+ st = s->streams[pkt->stream_index];
if (update_wrap_reference(s, st, pkt->stream_index, pkt) && st->pts_wrap_behavior == AV_PTS_WRAP_SUB_OFFSET) {
// correct first time stamps to negative values
@@ -793,7 +828,7 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
if (s->use_wallclock_as_timestamps)
pkt->dts = pkt->pts = av_rescale_q(av_gettime(), AV_TIME_BASE_Q, st->time_base);
- if(!pktl && st->request_probe <= 0)
+ if (!pktl && st->request_probe <= 0)
return ret;
add_to_pktbuf(&s->raw_packet_buffer, pkt, &s->raw_packet_buffer_end);
@@ -845,7 +880,7 @@ int ff_get_audio_frame_size(AVCodecContext *enc, int size, int mux)
//For WMA we currently have no other means to calculate duration thus we
//do it here by assuming CBR, which is true for all known cases.
- if(!mux && enc->bit_rate>0 && size>0 && enc->sample_rate>0 && enc->block_align>1) {
+ if (!mux && enc->bit_rate>0 && size>0 && enc->sample_rate>0 && enc->block_align>1) {
if (enc->codec_id == AV_CODEC_ID_WMAV1 || enc->codec_id == AV_CODEC_ID_WMAV2)
return ((int64_t)size * 8 * enc->sample_rate) / enc->bit_rate;
}
@@ -853,7 +888,6 @@ int ff_get_audio_frame_size(AVCodecContext *enc, int size, int mux)
return -1;
}
-
/**
* Return the frame duration in seconds. Return 0 if not available.
*/
@@ -864,15 +898,15 @@ void ff_compute_frame_duration(int *pnum, int *pden, AVStream *st,
*pnum = 0;
*pden = 0;
- switch(st->codec->codec_type) {
+ switch (st->codec->codec_type) {
case AVMEDIA_TYPE_VIDEO:
if (st->r_frame_rate.num && !pc) {
*pnum = st->r_frame_rate.den;
*pden = st->r_frame_rate.num;
- } else if(st->time_base.num*1000LL > st->time_base.den) {
+ } else if (st->time_base.num * 1000LL > st->time_base.den) {
*pnum = st->time_base.num;
*pden = st->time_base.den;
- }else if(st->codec->time_base.num*1000LL > st->codec->time_base.den){
+ } else if (st->codec->time_base.num * 1000LL > st->codec->time_base.den) {
*pnum = st->codec->time_base.num;
*pden = st->codec->time_base.den;
if (pc && pc->repeat_pict) {
@@ -881,11 +915,11 @@ void ff_compute_frame_duration(int *pnum, int *pden, AVStream *st,
else
*pnum *= 1 + pc->repeat_pict;
}
- //If this codec can be interlaced or progressive then we need a parser to compute duration of a packet
- //Thus if we have no parser in such case leave duration undefined.
- if(st->codec->ticks_per_frame>1 && !pc){
+ /* If this codec can be interlaced or progressive then we need
+ * a parser to compute duration of a packet. Thus if we have
+ * no parser in such case leave duration undefined. */
+ if (st->codec->ticks_per_frame > 1 && !pc)
*pnum = *pden = 0;
- }
}
break;
case AVMEDIA_TYPE_AUDIO:
@@ -900,10 +934,10 @@ void ff_compute_frame_duration(int *pnum, int *pden, AVStream *st,
}
}
-static int is_intra_only(AVCodecContext *enc){
+static int is_intra_only(AVCodecContext *enc) {
const AVCodecDescriptor *desc;
- if(enc->codec_type != AVMEDIA_TYPE_VIDEO)
+ if (enc->codec_type != AVMEDIA_TYPE_VIDEO)
return 1;
desc = av_codec_get_codec_descriptor(enc);
@@ -918,17 +952,17 @@ static int is_intra_only(AVCodecContext *enc){
static int has_decode_delay_been_guessed(AVStream *st)
{
- if(st->codec->codec_id != AV_CODEC_ID_H264) return 1;
- if(!st->info) // if we have left find_stream_info then nb_decoded_frames won't increase anymore for stream copy
+ if (st->codec->codec_id != AV_CODEC_ID_H264) return 1;
+ if (!st->info) // if we have left find_stream_info then nb_decoded_frames won't increase anymore for stream copy
return 1;
#if CONFIG_H264_DECODER
- if(st->codec->has_b_frames &&
+ if (st->codec->has_b_frames &&
avpriv_h264_has_num_reorder_frames(st->codec) == st->codec->has_b_frames)
return 1;
#endif
- if(st->codec->has_b_frames<3)
+ if (st->codec->has_b_frames<3)
return st->nb_decoded_frames >= 7;
- else if(st->codec->has_b_frames<4)
+ else if (st->codec->has_b_frames<4)
return st->nb_decoded_frames >= 18;
else
return st->nb_decoded_frames >= 20;
@@ -938,52 +972,97 @@ static AVPacketList *get_next_pkt(AVFormatContext *s, AVStream *st, AVPacketList
{
if (pktl->next)
return pktl->next;
- if (pktl == s->parse_queue_end)
- return s->packet_buffer;
+ if (pktl == s->packet_buffer_end)
+ return s->parse_queue;
return NULL;
}
+static int64_t select_from_pts_buffer(AVStream *st, int64_t *pts_buffer, int64_t dts) {
+ int onein_oneout = st->codec->codec_id != AV_CODEC_ID_H264 &&
+ st->codec->codec_id != AV_CODEC_ID_HEVC;
+
+ if(!onein_oneout) {
+ int delay = st->codec->has_b_frames;
+ int i;
+
+ if (dts == AV_NOPTS_VALUE) {
+ int64_t best_score = INT64_MAX;
+ for (i = 0; i<delay; i++) {
+ if (st->pts_reorder_error_count[i]) {
+ int64_t score = st->pts_reorder_error[i] / st->pts_reorder_error_count[i];
+ if (score < best_score) {
+ best_score = score;
+ dts = pts_buffer[i];
+ }
+ }
+ }
+ } else {
+ for (i = 0; i<delay; i++) {
+ if (pts_buffer[i] != AV_NOPTS_VALUE) {
+ int64_t diff = FFABS(pts_buffer[i] - dts)
+ + (uint64_t)st->pts_reorder_error[i];
+ diff = FFMAX(diff, st->pts_reorder_error[i]);
+ st->pts_reorder_error[i] = diff;
+ st->pts_reorder_error_count[i]++;
+ if (st->pts_reorder_error_count[i] > 250) {
+ st->pts_reorder_error[i] >>= 1;
+ st->pts_reorder_error_count[i] >>= 1;
+ }
+ }
+ }
+ }
+ }
+
+ if (dts == AV_NOPTS_VALUE)
+ dts = pts_buffer[0];
+
+ return dts;
+}
+
static void update_initial_timestamps(AVFormatContext *s, int stream_index,
int64_t dts, int64_t pts, AVPacket *pkt)
{
- AVStream *st= s->streams[stream_index];
- AVPacketList *pktl= s->parse_queue ? s->parse_queue : s->packet_buffer;
+ AVStream *st = s->streams[stream_index];
+ AVPacketList *pktl = s->packet_buffer ? s->packet_buffer : s->parse_queue;
int64_t pts_buffer[MAX_REORDER_DELAY+1];
int64_t shift;
int i, delay;
- if(st->first_dts != AV_NOPTS_VALUE || dts == AV_NOPTS_VALUE || st->cur_dts == AV_NOPTS_VALUE || is_relative(dts))
+ if (st->first_dts != AV_NOPTS_VALUE ||
+ dts == AV_NOPTS_VALUE ||
+ st->cur_dts == AV_NOPTS_VALUE ||
+ is_relative(dts))
return;
- delay = st->codec->has_b_frames;
- st->first_dts= dts - (st->cur_dts - RELATIVE_TS_BASE);
- st->cur_dts= dts;
- shift = st->first_dts - RELATIVE_TS_BASE;
+ delay = st->codec->has_b_frames;
+ st->first_dts = dts - (st->cur_dts - RELATIVE_TS_BASE);
+ st->cur_dts = dts;
+ shift = st->first_dts - RELATIVE_TS_BASE;
- for (i=0; i<MAX_REORDER_DELAY+1; i++)
+ for (i = 0; i<MAX_REORDER_DELAY+1; i++)
pts_buffer[i] = AV_NOPTS_VALUE;
if (is_relative(pts))
pts += shift;
- for(; pktl; pktl= get_next_pkt(s, st, pktl)){
- if(pktl->pkt.stream_index != stream_index)
+ for (; pktl; pktl = get_next_pkt(s, st, pktl)) {
+ if (pktl->pkt.stream_index != stream_index)
continue;
- if(is_relative(pktl->pkt.pts))
+ if (is_relative(pktl->pkt.pts))
pktl->pkt.pts += shift;
- if(is_relative(pktl->pkt.dts))
+ if (is_relative(pktl->pkt.dts))
pktl->pkt.dts += shift;
- if(st->start_time == AV_NOPTS_VALUE && pktl->pkt.pts != AV_NOPTS_VALUE)
- st->start_time= pktl->pkt.pts;
+ if (st->start_time == AV_NOPTS_VALUE && pktl->pkt.pts != AV_NOPTS_VALUE)
+ st->start_time = pktl->pkt.pts;
+
+ if (pktl->pkt.pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY && has_decode_delay_been_guessed(st)) {
+ pts_buffer[0] = pktl->pkt.pts;
+ for (i = 0; i<delay && pts_buffer[i] > pts_buffer[i + 1]; i++)
+ FFSWAP(int64_t, pts_buffer[i], pts_buffer[i + 1]);
- if(pktl->pkt.pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY && has_decode_delay_been_guessed(st)){
- pts_buffer[0]= pktl->pkt.pts;
- for(i=0; i<delay && pts_buffer[i] > pts_buffer[i+1]; i++)
- FFSWAP(int64_t, pts_buffer[i], pts_buffer[i+1]);
- if(pktl->pkt.dts == AV_NOPTS_VALUE)
- pktl->pkt.dts= pts_buffer[0];
+ pktl->pkt.dts = select_from_pts_buffer(st, pts_buffer, pktl->pkt.dts);
}
}
@@ -994,48 +1073,54 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index,
static void update_initial_durations(AVFormatContext *s, AVStream *st,
int stream_index, int duration)
{
- AVPacketList *pktl= s->parse_queue ? s->parse_queue : s->packet_buffer;
- int64_t cur_dts= RELATIVE_TS_BASE;
-
- if(st->first_dts != AV_NOPTS_VALUE){
- cur_dts= st->first_dts;
- for(; pktl; pktl= get_next_pkt(s, st, pktl)){
- if(pktl->pkt.stream_index == stream_index){
- if(pktl->pkt.pts != pktl->pkt.dts || pktl->pkt.dts != AV_NOPTS_VALUE || pktl->pkt.duration)
+ AVPacketList *pktl = s->packet_buffer ? s->packet_buffer : s->parse_queue;
+ int64_t cur_dts = RELATIVE_TS_BASE;
+
+ if (st->first_dts != AV_NOPTS_VALUE) {
+ if (st->update_initial_durations_done)
+ return;
+ st->update_initial_durations_done = 1;
+ cur_dts = st->first_dts;
+ for (; pktl; pktl = get_next_pkt(s, st, pktl)) {
+ if (pktl->pkt.stream_index == stream_index) {
+ if (pktl->pkt.pts != pktl->pkt.dts ||
+ pktl->pkt.dts != AV_NOPTS_VALUE ||
+ pktl->pkt.duration)
break;
cur_dts -= duration;
}
}
- if(pktl && pktl->pkt.dts != st->first_dts) {
+ if (pktl && pktl->pkt.dts != st->first_dts) {
av_log(s, AV_LOG_DEBUG, "first_dts %s not matching first dts %s (pts %s, duration %d) in the queue\n",
av_ts2str(st->first_dts), av_ts2str(pktl->pkt.dts), av_ts2str(pktl->pkt.pts), pktl->pkt.duration);
return;
}
- if(!pktl) {
+ if (!pktl) {
av_log(s, AV_LOG_DEBUG, "first_dts %s but no packet with dts in the queue\n", av_ts2str(st->first_dts));
return;
}
- pktl= s->parse_queue ? s->parse_queue : s->packet_buffer;
+ pktl = s->packet_buffer ? s->packet_buffer : s->parse_queue;
st->first_dts = cur_dts;
- }else if(st->cur_dts != RELATIVE_TS_BASE)
+ } else if (st->cur_dts != RELATIVE_TS_BASE)
return;
- for(; pktl; pktl= get_next_pkt(s, st, pktl)){
- if(pktl->pkt.stream_index != stream_index)
+ for (; pktl; pktl = get_next_pkt(s, st, pktl)) {
+ if (pktl->pkt.stream_index != stream_index)
continue;
- if(pktl->pkt.pts == pktl->pkt.dts && (pktl->pkt.dts == AV_NOPTS_VALUE || pktl->pkt.dts == st->first_dts)
- && !pktl->pkt.duration){
- pktl->pkt.dts= cur_dts;
- if(!st->codec->has_b_frames)
- pktl->pkt.pts= cur_dts;
+ if (pktl->pkt.pts == pktl->pkt.dts &&
+ (pktl->pkt.dts == AV_NOPTS_VALUE || pktl->pkt.dts == st->first_dts) &&
+ !pktl->pkt.duration) {
+ pktl->pkt.dts = cur_dts;
+ if (!st->codec->has_b_frames)
+ pktl->pkt.pts = cur_dts;
// if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO)
pktl->pkt.duration = duration;
- }else
+ } else
break;
cur_dts = pktl->pkt.dts + pktl->pkt.duration;
}
- if(!pktl)
- st->cur_dts= cur_dts;
+ if (!pktl)
+ st->cur_dts = cur_dts;
}
static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
@@ -1043,12 +1128,37 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
{
int num, den, presentation_delayed, delay, i;
int64_t offset;
+ AVRational duration;
+ int onein_oneout = st->codec->codec_id != AV_CODEC_ID_H264 &&
+ st->codec->codec_id != AV_CODEC_ID_HEVC;
if (s->flags & AVFMT_FLAG_NOFILLIN)
return;
- if((s->flags & AVFMT_FLAG_IGNDTS) && pkt->pts != AV_NOPTS_VALUE)
- pkt->dts= AV_NOPTS_VALUE;
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && pkt->dts != AV_NOPTS_VALUE) {
+ if (pkt->dts == pkt->pts && st->last_dts_for_order_check != AV_NOPTS_VALUE) {
+ if (st->last_dts_for_order_check <= pkt->dts) {
+ st->dts_ordered++;
+ } else {
+ av_log(s, st->dts_misordered ? AV_LOG_DEBUG : AV_LOG_WARNING,
+ "DTS %"PRIi64" < %"PRIi64" out of order\n",
+ pkt->dts,
+ st->last_dts_for_order_check);
+ st->dts_misordered++;
+ }
+ if (st->dts_ordered + st->dts_misordered > 250) {
+ st->dts_ordered >>= 1;
+ st->dts_misordered >>= 1;
+ }
+ }
+
+ st->last_dts_for_order_check = pkt->dts;
+ if (st->dts_ordered < 8*st->dts_misordered && pkt->dts == pkt->pts)
+ pkt->dts = AV_NOPTS_VALUE;
+ }
+
+ if ((s->flags & AVFMT_FLAG_IGNDTS) && pkt->pts != AV_NOPTS_VALUE)
+ pkt->dts = AV_NOPTS_VALUE;
if (pc && pc->pict_type == AV_PICTURE_TYPE_B
&& !st->codec->has_b_frames)
@@ -1056,11 +1166,11 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
st->codec->has_b_frames = 1;
/* do we have a video B-frame ? */
- delay= st->codec->has_b_frames;
+ delay = st->codec->has_b_frames;
presentation_delayed = 0;
/* XXX: need has_b_frame, but cannot get it if the codec is
- not initialized */
+ * not initialized */
if (delay &&
pc && pc->pict_type != AV_PICTURE_TYPE_B)
presentation_delayed = 1;
@@ -1068,50 +1178,64 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
if (pkt->pts != AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE &&
st->pts_wrap_bits < 63 &&
pkt->dts - (1LL << (st->pts_wrap_bits - 1)) > pkt->pts) {
- if(is_relative(st->cur_dts) || pkt->dts - (1LL<<(st->pts_wrap_bits-1)) > st->cur_dts) {
- pkt->dts -= 1LL<<st->pts_wrap_bits;
+ if (is_relative(st->cur_dts) || pkt->dts - (1LL<<(st->pts_wrap_bits - 1)) > st->cur_dts) {
+ pkt->dts -= 1LL << st->pts_wrap_bits;
} else
- pkt->pts += 1LL<<st->pts_wrap_bits;
+ pkt->pts += 1LL << st->pts_wrap_bits;
}
- // some mpeg2 in mpeg-ps lack dts (issue171 / input_file.mpg)
- // we take the conservative approach and discard both
- // Note, if this is misbehaving for a H.264 file then possibly presentation_delayed is not set correctly.
- if(delay==1 && pkt->dts == pkt->pts && pkt->dts != AV_NOPTS_VALUE && presentation_delayed){
+ /* Some MPEG-2 in MPEG-PS lack dts (issue #171 / input_file.mpg).
+ * We take the conservative approach and discard both.
+ * Note: If this is misbehaving for an H.264 file, then possibly
+ * presentation_delayed is not set correctly. */
+ if (delay == 1 && pkt->dts == pkt->pts &&
+ pkt->dts != AV_NOPTS_VALUE && presentation_delayed) {
av_log(s, AV_LOG_DEBUG, "invalid dts/pts combination %"PRIi64"\n", pkt->dts);
- if(strcmp(s->iformat->name, "mov,mp4,m4a,3gp,3g2,mj2")) // otherwise we discard correct timestamps for vc1-wmapro.ism
- pkt->dts= AV_NOPTS_VALUE;
+ if ( strcmp(s->iformat->name, "mov,mp4,m4a,3gp,3g2,mj2")
+ && strcmp(s->iformat->name, "flv")) // otherwise we discard correct timestamps for vc1-wmapro.ism
+ pkt->dts = AV_NOPTS_VALUE;
}
+ duration = av_mul_q((AVRational) {pkt->duration, 1}, st->time_base);
if (pkt->duration == 0) {
ff_compute_frame_duration(&num, &den, st, pc, pkt);
if (den && num) {
- pkt->duration = av_rescale_rnd(1, num * (int64_t)st->time_base.den, den * (int64_t)st->time_base.num, AV_ROUND_DOWN);
+ duration = (AVRational) {num, den};
+ pkt->duration = av_rescale_rnd(1,
+ num * (int64_t) st->time_base.den,
+ den * (int64_t) st->time_base.num,
+ AV_ROUND_DOWN);
}
}
- if(pkt->duration != 0 && (s->packet_buffer || s->parse_queue))
+
+ if (pkt->duration != 0 && (s->packet_buffer || s->parse_queue))
update_initial_durations(s, st, pkt->stream_index, pkt->duration);
- /* correct timestamps with byte offset if demuxers only have timestamps
- on packet boundaries */
- if(pc && st->need_parsing == AVSTREAM_PARSE_TIMESTAMPS && pkt->size){
+ /* Correct timestamps with byte offset if demuxers only have timestamps
+ * on packet boundaries */
+ if (pc && st->need_parsing == AVSTREAM_PARSE_TIMESTAMPS && pkt->size) {
/* this will estimate bitrate based on this frame's duration and size */
offset = av_rescale(pc->offset, pkt->duration, pkt->size);
- if(pkt->pts != AV_NOPTS_VALUE)
+ if (pkt->pts != AV_NOPTS_VALUE)
pkt->pts += offset;
- if(pkt->dts != AV_NOPTS_VALUE)
+ if (pkt->dts != AV_NOPTS_VALUE)
pkt->dts += offset;
}
/* This may be redundant, but it should not hurt. */
- if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts > pkt->dts)
+ if (pkt->dts != AV_NOPTS_VALUE &&
+ pkt->pts != AV_NOPTS_VALUE &&
+ pkt->pts > pkt->dts)
presentation_delayed = 1;
- av_dlog(NULL, "IN delayed:%d pts:%s, dts:%s cur_dts:%s st:%d pc:%p duration:%d\n",
- presentation_delayed, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), pkt->stream_index, pc, pkt->duration);
- /* interpolate PTS and DTS if they are not present */
- //We skip H264 currently because delay and has_b_frames are not reliably set
- if((delay==0 || (delay==1 && pc)) && st->codec->codec_id != AV_CODEC_ID_H264){
+ av_dlog(NULL,
+ "IN delayed:%d pts:%s, dts:%s cur_dts:%s st:%d pc:%p duration:%d\n",
+ presentation_delayed, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts),
+ pkt->stream_index, pc, pkt->duration);
+ /* Interpolate PTS and DTS if they are not present. We skip H264
+ * currently because delay and has_b_frames are not reliably set. */
+ if ((delay == 0 || (delay == 1 && pc)) &&
+ onein_oneout) {
if (presentation_delayed) {
/* DTS = decompression timestamp */
/* PTS = presentation timestamp */
@@ -1121,20 +1245,19 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
if (pkt->dts == AV_NOPTS_VALUE)
pkt->dts = st->cur_dts;
- /* this is tricky: the dts must be incremented by the duration
- of the frame we are displaying, i.e. the last I- or P-frame */
+ /* This is tricky: the dts must be incremented by the duration
+ * of the frame we are displaying, i.e. the last I- or P-frame. */
if (st->last_IP_duration == 0)
st->last_IP_duration = pkt->duration;
- if(pkt->dts != AV_NOPTS_VALUE)
+ if (pkt->dts != AV_NOPTS_VALUE)
st->cur_dts = pkt->dts + st->last_IP_duration;
- st->last_IP_duration = pkt->duration;
- st->last_IP_pts= pkt->pts;
- /* cannot compute PTS if not present (we can compute it only
- by knowing the future */
+ st->last_IP_duration = pkt->duration;
+ st->last_IP_pts = pkt->pts;
+ /* Cannot compute PTS if not present (we can compute it only
+ * by knowing the future. */
} else if (pkt->pts != AV_NOPTS_VALUE ||
pkt->dts != AV_NOPTS_VALUE ||
pkt->duration ) {
- int duration = pkt->duration;
/* presentation is not delayed : PTS and DTS are the same */
if (pkt->pts == AV_NOPTS_VALUE)
@@ -1145,21 +1268,22 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
pkt->pts = st->cur_dts;
pkt->dts = pkt->pts;
if (pkt->pts != AV_NOPTS_VALUE)
- st->cur_dts = pkt->pts + duration;
+ st->cur_dts = av_add_stable(st->time_base, pkt->pts, duration, 1);
}
}
- if(pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY && has_decode_delay_been_guessed(st)){
- st->pts_buffer[0]= pkt->pts;
- for(i=0; i<delay && st->pts_buffer[i] > st->pts_buffer[i+1]; i++)
- FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i+1]);
- if(pkt->dts == AV_NOPTS_VALUE)
- pkt->dts= st->pts_buffer[0];
- }
- if(st->codec->codec_id == AV_CODEC_ID_H264){ // we skipped it above so we try here
- update_initial_timestamps(s, pkt->stream_index, pkt->dts, pkt->pts, pkt); // this should happen on the first packet
+ if (pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY && has_decode_delay_been_guessed(st)) {
+ st->pts_buffer[0] = pkt->pts;
+ for (i = 0; i<delay && st->pts_buffer[i] > st->pts_buffer[i + 1]; i++)
+ FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i + 1]);
+
+ pkt->dts = select_from_pts_buffer(st, st->pts_buffer, pkt->dts);
}
- if(pkt->dts > st->cur_dts)
+ // We skipped it above so we try here.
+ if (!onein_oneout)
+ // This should happen on the first packet
+ update_initial_timestamps(s, pkt->stream_index, pkt->dts, pkt->pts, pkt);
+ if (pkt->dts > st->cur_dts)
st->cur_dts = pkt->dts;
av_dlog(NULL, "OUTdelayed:%d/%d pts:%s, dts:%s cur_dts:%s\n",
@@ -1184,21 +1308,21 @@ static void free_packet_buffer(AVPacketList **pkt_buf, AVPacketList **pkt_buf_en
}
/**
- * Parse a packet, add all split parts to parse_queue
+ * Parse a packet, add all split parts to parse_queue.
*
- * @param pkt packet to parse, NULL when flushing the parser at end of stream
+ * @param pkt Packet to parse, NULL when flushing the parser at end of stream.
*/
static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
{
AVPacket out_pkt = { 0 }, flush_pkt = { 0 };
- AVStream *st = s->streams[stream_index];
- uint8_t *data = pkt ? pkt->data : NULL;
- int size = pkt ? pkt->size : 0;
+ AVStream *st = s->streams[stream_index];
+ uint8_t *data = pkt ? pkt->data : NULL;
+ int size = pkt ? pkt->size : 0;
int ret = 0, got_output = 0;
if (!pkt) {
av_init_packet(&flush_pkt);
- pkt = &flush_pkt;
+ pkt = &flush_pkt;
got_output = 1;
} else if (!size && st->parser->flags & PARSER_FLAG_COMPLETE_FRAMES) {
// preserve 0-size sync packets
@@ -1209,7 +1333,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
int len;
av_init_packet(&out_pkt);
- len = av_parser_parse2(st->parser, st->codec,
+ len = av_parser_parse2(st->parser, st->codec,
&out_pkt.data, &out_pkt.size, data, size,
pkt->pts, pkt->dts, pkt->pos);
@@ -1227,33 +1351,28 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
if (pkt->side_data) {
out_pkt.side_data = pkt->side_data;
out_pkt.side_data_elems = pkt->side_data_elems;
- pkt->side_data = NULL;
- pkt->side_data_elems = 0;
+ pkt->side_data = NULL;
+ pkt->side_data_elems = 0;
}
/* set the duration */
out_pkt.duration = 0;
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
if (st->codec->sample_rate > 0) {
- out_pkt.duration = av_rescale_q_rnd(st->parser->duration,
- (AVRational){ 1, st->codec->sample_rate },
- st->time_base,
- AV_ROUND_DOWN);
+ out_pkt.duration =
+ av_rescale_q_rnd(st->parser->duration,
+ (AVRational) { 1, st->codec->sample_rate },
+ st->time_base,
+ AV_ROUND_DOWN);
}
- } else if (st->codec->time_base.num != 0 &&
- st->codec->time_base.den != 0) {
- out_pkt.duration = av_rescale_q_rnd(st->parser->duration,
- st->codec->time_base,
- st->time_base,
- AV_ROUND_DOWN);
}
out_pkt.stream_index = st->index;
- out_pkt.pts = st->parser->pts;
- out_pkt.dts = st->parser->dts;
- out_pkt.pos = st->parser->pos;
+ out_pkt.pts = st->parser->pts;
+ out_pkt.dts = st->parser->dts;
+ out_pkt.pos = st->parser->pos;
- if(st->need_parsing == AVSTREAM_PARSE_FULL_RAW)
+ if (st->need_parsing == AVSTREAM_PARSE_FULL_RAW)
out_pkt.pos = st->parser->frame_offset;
if (st->parser->key_frame == 1 ||
@@ -1261,14 +1380,14 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
st->parser->pict_type == AV_PICTURE_TYPE_I))
out_pkt.flags |= AV_PKT_FLAG_KEY;
- if(st->parser->key_frame == -1 && st->parser->pict_type==AV_PICTURE_TYPE_NONE && (pkt->flags&AV_PKT_FLAG_KEY))
+ if (st->parser->key_frame == -1 && st->parser->pict_type ==AV_PICTURE_TYPE_NONE && (pkt->flags&AV_PKT_FLAG_KEY))
out_pkt.flags |= AV_PKT_FLAG_KEY;
compute_pkt_fields(s, st, st->parser, &out_pkt);
if (out_pkt.data == pkt->data && out_pkt.size == pkt->size) {
- out_pkt.buf = pkt->buf;
- pkt->buf = NULL;
+ out_pkt.buf = pkt->buf;
+ pkt->buf = NULL;
#if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
out_pkt.destruct = pkt->destruct;
@@ -1286,7 +1405,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
}
-
/* end of the stream => close and free the parser */
if (pkt == &flush_pkt) {
av_parser_close(st->parser);
@@ -1304,8 +1422,8 @@ static int read_from_packet_buffer(AVPacketList **pkt_buffer,
{
AVPacketList *pktl;
av_assert0(*pkt_buffer);
- pktl = *pkt_buffer;
- *pkt = pktl->pkt;
+ pktl = *pkt_buffer;
+ *pkt = pktl->pkt;
*pkt_buffer = pktl->next;
if (!pktl->next)
*pkt_buffer_end = NULL;
@@ -1329,7 +1447,7 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
if (ret == AVERROR(EAGAIN))
return ret;
/* flush the parsers */
- for(i = 0; i < s->nb_streams; i++) {
+ for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
if (st->parser && st->need_parsing)
parse_packet(s, NULL, st->index);
@@ -1344,20 +1462,20 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
if (cur_pkt.pts != AV_NOPTS_VALUE &&
cur_pkt.dts != AV_NOPTS_VALUE &&
cur_pkt.pts < cur_pkt.dts) {
- av_log(s, AV_LOG_WARNING, "Invalid timestamps stream=%d, pts=%s, dts=%s, size=%d\n",
+ av_log(s, AV_LOG_WARNING,
+ "Invalid timestamps stream=%d, pts=%s, dts=%s, size=%d\n",
cur_pkt.stream_index,
av_ts2str(cur_pkt.pts),
av_ts2str(cur_pkt.dts),
cur_pkt.size);
}
if (s->debug & FF_FDEBUG_TS)
- av_log(s, AV_LOG_DEBUG, "ff_read_packet stream=%d, pts=%s, dts=%s, size=%d, duration=%d, flags=%d\n",
+ av_log(s, AV_LOG_DEBUG,
+ "ff_read_packet stream=%d, pts=%s, dts=%s, size=%d, duration=%d, flags=%d\n",
cur_pkt.stream_index,
av_ts2str(cur_pkt.pts),
av_ts2str(cur_pkt.dts),
- cur_pkt.size,
- cur_pkt.duration,
- cur_pkt.flags);
+ cur_pkt.size, cur_pkt.duration, cur_pkt.flags);
if (st->need_parsing && !st->parser && !(s->flags & AVFMT_FLAG_NOPARSE)) {
st->parser = av_parser_init(st->codec->codec_id);
@@ -1367,13 +1485,12 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
avcodec_get_name(st->codec->codec_id));
/* no parser available: just output the raw packets */
st->need_parsing = AVSTREAM_PARSE_NONE;
- } else if(st->need_parsing == AVSTREAM_PARSE_HEADERS) {
+ } else if (st->need_parsing == AVSTREAM_PARSE_HEADERS)
st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
- } else if(st->need_parsing == AVSTREAM_PARSE_FULL_ONCE) {
+ else if (st->need_parsing == AVSTREAM_PARSE_FULL_ONCE)
st->parser->flags |= PARSER_FLAG_ONCE;
- } else if(st->need_parsing == AVSTREAM_PARSE_FULL_RAW) {
+ else if (st->need_parsing == AVSTREAM_PARSE_FULL_RAW)
st->parser->flags |= PARSER_FLAG_USE_CODEC_TS;
- }
}
if (!st->need_parsing || !st->parser) {
@@ -1383,7 +1500,8 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
if ((s->iformat->flags & AVFMT_GENERIC_INDEX) &&
(pkt->flags & AV_PKT_FLAG_KEY) && pkt->dts != AV_NOPTS_VALUE) {
ff_reduce_index(s, st->index);
- av_add_index_entry(st, pkt->pos, pkt->dts, 0, 0, AVINDEX_KEYFRAME);
+ av_add_index_entry(st, pkt->pos, pkt->dts,
+ 0, 0, AVINDEX_KEYFRAME);
}
got_packet = 1;
} else if (st->discard < AVDISCARD_ALL) {
@@ -1417,19 +1535,38 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
}
st->skip_samples = 0;
}
- }
- if(ret >= 0 && !(s->flags & AVFMT_FLAG_KEEP_SIDE_DATA))
- av_packet_merge_side_data(pkt);
+ if (st->inject_global_side_data) {
+ for (i = 0; i < st->nb_side_data; i++) {
+ AVPacketSideData *src_sd = &st->side_data[i];
+ uint8_t *dst_data;
+
+ if (av_packet_get_side_data(pkt, src_sd->type, NULL))
+ continue;
+
+ dst_data = av_packet_new_side_data(pkt, src_sd->type, src_sd->size);
+ if (!dst_data) {
+ av_log(s, AV_LOG_WARNING, "Could not inject global side data\n");
+ continue;
+ }
+
+ memcpy(dst_data, src_sd->data, src_sd->size);
+ }
+ st->inject_global_side_data = 0;
+ }
- if(s->debug & FF_FDEBUG_TS)
- av_log(s, AV_LOG_DEBUG, "read_frame_internal stream=%d, pts=%s, dts=%s, size=%d, duration=%d, flags=%d\n",
- pkt->stream_index,
- av_ts2str(pkt->pts),
- av_ts2str(pkt->dts),
- pkt->size,
- pkt->duration,
- pkt->flags);
+ if (!(s->flags & AVFMT_FLAG_KEEP_SIDE_DATA))
+ av_packet_merge_side_data(pkt);
+ }
+
+ if (s->debug & FF_FDEBUG_TS)
+ av_log(s, AV_LOG_DEBUG,
+ "read_frame_internal stream=%d, pts=%s, dts=%s, "
+ "size=%d, duration=%d, flags=%d\n",
+ pkt->stream_index,
+ av_ts2str(pkt->pts),
+ av_ts2str(pkt->dts),
+ pkt->size, pkt->duration, pkt->flags);
return ret;
}
@@ -1437,14 +1574,15 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
{
const int genpts = s->flags & AVFMT_FLAG_GENPTS;
- int eof = 0;
+ int eof = 0;
int ret;
AVStream *st;
if (!genpts) {
- ret = s->packet_buffer ?
- read_from_packet_buffer(&s->packet_buffer, &s->packet_buffer_end, pkt) :
- read_frame_internal(s, pkt);
+ ret = s->packet_buffer
+ ? read_from_packet_buffer(&s->packet_buffer,
+ &s->packet_buffer_end, pkt)
+ : read_frame_internal(s, pkt);
if (ret < 0)
return ret;
goto return_packet;
@@ -1464,7 +1602,8 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
while (pktl && next_pkt->pts == AV_NOPTS_VALUE) {
if (pktl->pkt.stream_index == next_pkt->stream_index &&
(av_compare_mod(next_pkt->dts, pktl->pkt.dts, 2LL << (wrap_bits - 1)) < 0)) {
- if (av_compare_mod(pktl->pkt.pts, pktl->pkt.dts, 2LL << (wrap_bits - 1))) { //not b frame
+ if (av_compare_mod(pktl->pkt.pts, pktl->pkt.dts, 2LL << (wrap_bits - 1))) {
+ // not B-frame
next_pkt->pts = pktl->pkt.dts;
}
if (last_dts != AV_NOPTS_VALUE) {
@@ -1504,7 +1643,7 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
}
if (av_dup_packet(add_to_pktbuf(&s->packet_buffer, pkt,
- &s->packet_buffer_end)) < 0)
+ &s->packet_buffer_end)) < 0)
return AVERROR(ENOMEM);
}
@@ -1545,21 +1684,20 @@ int av_find_default_stream_index(AVFormatContext *s)
if (s->nb_streams <= 0)
return -1;
- for(i = 0; i < s->nb_streams; i++) {
+ for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
!(st->disposition & AV_DISPOSITION_ATTACHED_PIC)) {
return i;
}
- if (first_audio_index < 0 && st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
+ if (first_audio_index < 0 &&
+ st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
first_audio_index = i;
}
return first_audio_index >= 0 ? first_audio_index : 0;
}
-/**
- * Flush the frame reader.
- */
+/** Flush the frame reader. */
void ff_read_frame_flush(AVFormatContext *s)
{
AVStream *st;
@@ -1567,8 +1705,8 @@ void ff_read_frame_flush(AVFormatContext *s)
flush_packet_queue(s);
- /* for each stream, reset read state */
- for(i = 0; i < s->nb_streams; i++) {
+ /* Reset read state for each stream. */
+ for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
if (st->parser) {
@@ -1576,13 +1714,20 @@ void ff_read_frame_flush(AVFormatContext *s)
st->parser = NULL;
}
st->last_IP_pts = AV_NOPTS_VALUE;
- if(st->first_dts == AV_NOPTS_VALUE) st->cur_dts = RELATIVE_TS_BASE;
- else st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */
+ st->last_dts_for_order_check = AV_NOPTS_VALUE;
+ if (st->first_dts == AV_NOPTS_VALUE)
+ st->cur_dts = RELATIVE_TS_BASE;
+ else
+ /* We set the current DTS to an unspecified origin. */
+ st->cur_dts = AV_NOPTS_VALUE;
st->probe_packets = MAX_PROBE_PACKETS;
- for(j=0; j<MAX_REORDER_DELAY+1; j++)
- st->pts_buffer[j]= AV_NOPTS_VALUE;
+ for (j = 0; j < MAX_REORDER_DELAY + 1; j++)
+ st->pts_buffer[j] = AV_NOPTS_VALUE;
+
+ if (s->internal->inject_global_side_data)
+ st->inject_global_side_data = 1;
}
}
@@ -1590,40 +1735,42 @@ void ff_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp)
{
int i;
- for(i = 0; i < s->nb_streams; i++) {
+ for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
- st->cur_dts = av_rescale(timestamp,
- st->time_base.den * (int64_t)ref_st->time_base.num,
- st->time_base.num * (int64_t)ref_st->time_base.den);
+ st->cur_dts =
+ av_rescale(timestamp,
+ st->time_base.den * (int64_t) ref_st->time_base.num,
+ st->time_base.num * (int64_t) ref_st->time_base.den);
}
}
void ff_reduce_index(AVFormatContext *s, int stream_index)
{
- AVStream *st= s->streams[stream_index];
- unsigned int max_entries= s->max_index_size / sizeof(AVIndexEntry);
+ AVStream *st = s->streams[stream_index];
+ unsigned int max_entries = s->max_index_size / sizeof(AVIndexEntry);
- if((unsigned)st->nb_index_entries >= max_entries){
+ if ((unsigned) st->nb_index_entries >= max_entries) {
int i;
- for(i=0; 2*i<st->nb_index_entries; i++)
- st->index_entries[i]= st->index_entries[2*i];
- st->nb_index_entries= i;
+ for (i = 0; 2 * i < st->nb_index_entries; i++)
+ st->index_entries[i] = st->index_entries[2 * i];
+ st->nb_index_entries = i;
}
}
int ff_add_index_entry(AVIndexEntry **index_entries,
int *nb_index_entries,
unsigned int *index_entries_allocated_size,
- int64_t pos, int64_t timestamp, int size, int distance, int flags)
+ int64_t pos, int64_t timestamp,
+ int size, int distance, int flags)
{
AVIndexEntry *entries, *ie;
int index;
- if((unsigned)*nb_index_entries + 1 >= UINT_MAX / sizeof(AVIndexEntry))
+ if ((unsigned) *nb_index_entries + 1 >= UINT_MAX / sizeof(AVIndexEntry))
return -1;
- if(timestamp == AV_NOPTS_VALUE)
+ if (timestamp == AV_NOPTS_VALUE)
return AVERROR(EINVAL);
if (size < 0 || size > 0x3FFFFFFF)
@@ -1636,39 +1783,42 @@ int ff_add_index_entry(AVIndexEntry **index_entries,
index_entries_allocated_size,
(*nb_index_entries + 1) *
sizeof(AVIndexEntry));
- if(!entries)
+ if (!entries)
return -1;
- *index_entries= entries;
+ *index_entries = entries;
- index= ff_index_search_timestamp(*index_entries, *nb_index_entries, timestamp, AVSEEK_FLAG_ANY);
+ index = ff_index_search_timestamp(*index_entries, *nb_index_entries,
+ timestamp, AVSEEK_FLAG_ANY);
- if(index<0){
- index= (*nb_index_entries)++;
- ie= &entries[index];
- av_assert0(index==0 || ie[-1].timestamp < timestamp);
- }else{
- ie= &entries[index];
- if(ie->timestamp != timestamp){
- if(ie->timestamp <= timestamp)
+ if (index < 0) {
+ index = (*nb_index_entries)++;
+ ie = &entries[index];
+ av_assert0(index == 0 || ie[-1].timestamp < timestamp);
+ } else {
+ ie = &entries[index];
+ if (ie->timestamp != timestamp) {
+ if (ie->timestamp <= timestamp)
return -1;
- memmove(entries + index + 1, entries + index, sizeof(AVIndexEntry)*(*nb_index_entries - index));
+ memmove(entries + index + 1, entries + index,
+ sizeof(AVIndexEntry) * (*nb_index_entries - index));
(*nb_index_entries)++;
- }else if(ie->pos == pos && distance < ie->min_distance) //do not reduce the distance
- distance= ie->min_distance;
+ } else if (ie->pos == pos && distance < ie->min_distance)
+ // do not reduce the distance
+ distance = ie->min_distance;
}
- ie->pos = pos;
- ie->timestamp = timestamp;
- ie->min_distance= distance;
- ie->size= size;
- ie->flags = flags;
+ ie->pos = pos;
+ ie->timestamp = timestamp;
+ ie->min_distance = distance;
+ ie->size = size;
+ ie->flags = flags;
return index;
}
-int av_add_index_entry(AVStream *st,
- int64_t pos, int64_t timestamp, int size, int distance, int flags)
+int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
+ int size, int distance, int flags)
{
timestamp = wrap_timestamp(st, timestamp);
return ff_add_index_entry(&st->index_entries, &st->nb_index_entries,
@@ -1682,36 +1832,34 @@ int ff_index_search_timestamp(const AVIndexEntry *entries, int nb_entries,
int a, b, m;
int64_t timestamp;
- a = - 1;
+ a = -1;
b = nb_entries;
- //optimize appending index entries at the end
- if(b && entries[b-1].timestamp < wanted_timestamp)
- a= b-1;
+ // Optimize appending index entries at the end.
+ if (b && entries[b - 1].timestamp < wanted_timestamp)
+ a = b - 1;
while (b - a > 1) {
- m = (a + b) >> 1;
+ m = (a + b) >> 1;
timestamp = entries[m].timestamp;
- if(timestamp >= wanted_timestamp)
+ if (timestamp >= wanted_timestamp)
b = m;
- if(timestamp <= wanted_timestamp)
+ if (timestamp <= wanted_timestamp)
a = m;
}
- m= (flags & AVSEEK_FLAG_BACKWARD) ? a : b;
+ m = (flags & AVSEEK_FLAG_BACKWARD) ? a : b;
- if(!(flags & AVSEEK_FLAG_ANY)){
- while(m>=0 && m<nb_entries && !(entries[m].flags & AVINDEX_KEYFRAME)){
+ if (!(flags & AVSEEK_FLAG_ANY))
+ while (m >= 0 && m < nb_entries &&
+ !(entries[m].flags & AVINDEX_KEYFRAME))
m += (flags & AVSEEK_FLAG_BACKWARD) ? -1 : 1;
- }
- }
- if(m == nb_entries)
+ if (m == nb_entries)
return -1;
- return m;
+ return m;
}
-int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp,
- int flags)
+int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp, int flags)
{
return ff_index_search_timestamp(st->index_entries, st->nb_index_entries,
wanted_timestamp, flags);
@@ -1726,9 +1874,10 @@ static int64_t ff_read_timestamp(AVFormatContext *s, int stream_index, int64_t *
return ts;
}
-int ff_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags)
+int ff_seek_frame_binary(AVFormatContext *s, int stream_index,
+ int64_t target_ts, int flags)
{
- AVInputFormat *avif= s->iformat;
+ AVInputFormat *avif = s->iformat;
int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit;
int64_t ts_min, ts_max, ts;
int index;
@@ -1740,42 +1889,47 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts
av_dlog(s, "read_seek: %d %s\n", stream_index, av_ts2str(target_ts));
- ts_max=
- ts_min= AV_NOPTS_VALUE;
- pos_limit= -1; //gcc falsely says it may be uninitialized
+ ts_max =
+ ts_min = AV_NOPTS_VALUE;
+ pos_limit = -1; // GCC falsely says it may be uninitialized.
- st= s->streams[stream_index];
- if(st->index_entries){
+ st = s->streams[stream_index];
+ if (st->index_entries) {
AVIndexEntry *e;
- index= av_index_search_timestamp(st, target_ts, flags | AVSEEK_FLAG_BACKWARD); //FIXME whole func must be checked for non-keyframe entries in index case, especially read_timestamp()
- index= FFMAX(index, 0);
- e= &st->index_entries[index];
+ /* FIXME: Whole function must be checked for non-keyframe entries in
+ * index case, especially read_timestamp(). */
+ index = av_index_search_timestamp(st, target_ts,
+ flags | AVSEEK_FLAG_BACKWARD);
+ index = FFMAX(index, 0);
+ e = &st->index_entries[index];
- if(e->timestamp <= target_ts || e->pos == e->min_distance){
- pos_min= e->pos;
- ts_min= e->timestamp;
+ if (e->timestamp <= target_ts || e->pos == e->min_distance) {
+ pos_min = e->pos;
+ ts_min = e->timestamp;
av_dlog(s, "using cached pos_min=0x%"PRIx64" dts_min=%s\n",
pos_min, av_ts2str(ts_min));
- }else{
- av_assert1(index==0);
+ } else {
+ av_assert1(index == 0);
}
- index= av_index_search_timestamp(st, target_ts, flags & ~AVSEEK_FLAG_BACKWARD);
+ index = av_index_search_timestamp(st, target_ts,
+ flags & ~AVSEEK_FLAG_BACKWARD);
av_assert0(index < st->nb_index_entries);
- if(index >= 0){
- e= &st->index_entries[index];
+ if (index >= 0) {
+ e = &st->index_entries[index];
av_assert1(e->timestamp >= target_ts);
- pos_max= e->pos;
- ts_max= e->timestamp;
- pos_limit= pos_max - e->min_distance;
- av_dlog(s, "using cached pos_max=0x%"PRIx64" pos_limit=0x%"PRIx64" dts_max=%s\n",
- pos_max, pos_limit, av_ts2str(ts_max));
+ pos_max = e->pos;
+ ts_max = e->timestamp;
+ pos_limit = pos_max - e->min_distance;
+ av_dlog(s, "using cached pos_max=0x%"PRIx64" pos_limit=0x%"PRIx64
+ " dts_max=%s\n", pos_max, pos_limit, av_ts2str(ts_max));
}
}
- pos= ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit, ts_min, ts_max, flags, &ts, avif->read_timestamp);
- if(pos<0)
+ pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit,
+ ts_min, ts_max, flags, &ts, avif->read_timestamp);
+ if (pos < 0)
return -1;
/* do the seek */
@@ -1791,28 +1945,30 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts
int ff_find_last_ts(AVFormatContext *s, int stream_index, int64_t *ts, int64_t *pos,
int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ))
{
- int64_t step= 1024;
+ int64_t step = 1024;
int64_t limit, ts_max;
int64_t filesize = avio_size(s->pb);
- int64_t pos_max = filesize - 1;
- do{
+ int64_t pos_max = filesize - 1;
+ do {
limit = pos_max;
pos_max = FFMAX(0, (pos_max) - step);
- ts_max = ff_read_timestamp(s, stream_index, &pos_max, limit, read_timestamp);
- step += step;
- }while(ts_max == AV_NOPTS_VALUE && 2*limit > step);
+ ts_max = ff_read_timestamp(s, stream_index,
+ &pos_max, limit, read_timestamp);
+ step += step;
+ } while (ts_max == AV_NOPTS_VALUE && 2*limit > step);
if (ts_max == AV_NOPTS_VALUE)
return -1;
- for(;;){
+ for (;;) {
int64_t tmp_pos = pos_max + 1;
- int64_t tmp_ts = ff_read_timestamp(s, stream_index, &tmp_pos, INT64_MAX, read_timestamp);
- if(tmp_ts == AV_NOPTS_VALUE)
+ int64_t tmp_ts = ff_read_timestamp(s, stream_index,
+ &tmp_pos, INT64_MAX, read_timestamp);
+ if (tmp_ts == AV_NOPTS_VALUE)
break;
av_assert0(tmp_pos > pos_max);
ts_max = tmp_ts;
pos_max = tmp_pos;
- if(tmp_pos >= filesize)
+ if (tmp_pos >= filesize)
break;
}
@@ -1826,8 +1982,10 @@ int ff_find_last_ts(AVFormatContext *s, int stream_index, int64_t *ts, int64_t *
int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
int64_t pos_min, int64_t pos_max, int64_t pos_limit,
- int64_t ts_min, int64_t ts_max, int flags, int64_t *ts_ret,
- int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ))
+ int64_t ts_min, int64_t ts_max,
+ int flags, int64_t *ts_ret,
+ int64_t (*read_timestamp)(struct AVFormatContext *, int,
+ int64_t *, int64_t))
{
int64_t pos, ts;
int64_t start_pos;
@@ -1836,107 +1994,114 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
av_dlog(s, "gen_seek: %d %s\n", stream_index, av_ts2str(target_ts));
- if(ts_min == AV_NOPTS_VALUE){
+ if (ts_min == AV_NOPTS_VALUE) {
pos_min = s->data_offset;
- ts_min = ff_read_timestamp(s, stream_index, &pos_min, INT64_MAX, read_timestamp);
+ ts_min = ff_read_timestamp(s, stream_index, &pos_min, INT64_MAX, read_timestamp);
if (ts_min == AV_NOPTS_VALUE)
return -1;
}
- if(ts_min >= target_ts){
- *ts_ret= ts_min;
+ if (ts_min >= target_ts) {
+ *ts_ret = ts_min;
return pos_min;
}
- if(ts_max == AV_NOPTS_VALUE){
+ if (ts_max == AV_NOPTS_VALUE) {
if ((ret = ff_find_last_ts(s, stream_index, &ts_max, &pos_max, read_timestamp)) < 0)
return ret;
- pos_limit= pos_max;
+ pos_limit = pos_max;
}
- if(ts_max <= target_ts){
- *ts_ret= ts_max;
+ if (ts_max <= target_ts) {
+ *ts_ret = ts_max;
return pos_max;
}
- if(ts_min > ts_max){
+ if (ts_min > ts_max)
return -1;
- }else if(ts_min == ts_max){
- pos_limit= pos_min;
- }
+ else if (ts_min == ts_max)
+ pos_limit = pos_min;
- no_change=0;
+ no_change = 0;
while (pos_min < pos_limit) {
- av_dlog(s, "pos_min=0x%"PRIx64" pos_max=0x%"PRIx64" dts_min=%s dts_max=%s\n",
+ av_dlog(s,
+ "pos_min=0x%"PRIx64" pos_max=0x%"PRIx64" dts_min=%s dts_max=%s\n",
pos_min, pos_max, av_ts2str(ts_min), av_ts2str(ts_max));
assert(pos_limit <= pos_max);
- if(no_change==0){
- int64_t approximate_keyframe_distance= pos_max - pos_limit;
+ if (no_change == 0) {
+ int64_t approximate_keyframe_distance = pos_max - pos_limit;
// interpolate position (better than dichotomy)
- pos = av_rescale(target_ts - ts_min, pos_max - pos_min, ts_max - ts_min)
- + pos_min - approximate_keyframe_distance;
- }else if(no_change==1){
- // bisection, if interpolation failed to change min or max pos last time
- pos = (pos_min + pos_limit)>>1;
- }else{
+ pos = av_rescale(target_ts - ts_min, pos_max - pos_min,
+ ts_max - ts_min) +
+ pos_min - approximate_keyframe_distance;
+ } else if (no_change == 1) {
+ // bisection if interpolation did not change min / max pos last time
+ pos = (pos_min + pos_limit) >> 1;
+ } else {
/* linear search if bisection failed, can only happen if there
- are very few or no keyframes between min/max */
- pos=pos_min;
+ * are very few or no keyframes between min/max */
+ pos = pos_min;
}
- if(pos <= pos_min)
- pos= pos_min + 1;
- else if(pos > pos_limit)
- pos= pos_limit;
- start_pos= pos;
-
- ts = ff_read_timestamp(s, stream_index, &pos, INT64_MAX, read_timestamp); //may pass pos_limit instead of -1
- if(pos == pos_max)
+ if (pos <= pos_min)
+ pos = pos_min + 1;
+ else if (pos > pos_limit)
+ pos = pos_limit;
+ start_pos = pos;
+
+ // May pass pos_limit instead of -1.
+ ts = ff_read_timestamp(s, stream_index, &pos, INT64_MAX, read_timestamp);
+ if (pos == pos_max)
no_change++;
else
- no_change=0;
- av_dlog(s, "%"PRId64" %"PRId64" %"PRId64" / %s %s %s target:%s limit:%"PRId64" start:%"PRId64" noc:%d\n",
+ no_change = 0;
+ av_dlog(s, "%"PRId64" %"PRId64" %"PRId64" / %s %s %s"
+ " target:%s limit:%"PRId64" start:%"PRId64" noc:%d\n",
pos_min, pos, pos_max,
av_ts2str(ts_min), av_ts2str(ts), av_ts2str(ts_max), av_ts2str(target_ts),
pos_limit, start_pos, no_change);
- if(ts == AV_NOPTS_VALUE){
+ if (ts == AV_NOPTS_VALUE) {
av_log(s, AV_LOG_ERROR, "read_timestamp() failed in the middle\n");
return -1;
}
assert(ts != AV_NOPTS_VALUE);
if (target_ts <= ts) {
pos_limit = start_pos - 1;
- pos_max = pos;
- ts_max = ts;
+ pos_max = pos;
+ ts_max = ts;
}
if (target_ts >= ts) {
pos_min = pos;
- ts_min = ts;
+ ts_min = ts;
}
}
- pos = (flags & AVSEEK_FLAG_BACKWARD) ? pos_min : pos_max;
- ts = (flags & AVSEEK_FLAG_BACKWARD) ? ts_min : ts_max;
+ pos = (flags & AVSEEK_FLAG_BACKWARD) ? pos_min : pos_max;
+ ts = (flags & AVSEEK_FLAG_BACKWARD) ? ts_min : ts_max;
#if 0
pos_min = pos;
- ts_min = ff_read_timestamp(s, stream_index, &pos_min, INT64_MAX, read_timestamp);
+ ts_min = ff_read_timestamp(s, stream_index, &pos_min, INT64_MAX, read_timestamp);
pos_min++;
ts_max = ff_read_timestamp(s, stream_index, &pos_min, INT64_MAX, read_timestamp);
av_dlog(s, "pos=0x%"PRIx64" %s<=%s<=%s\n",
pos, av_ts2str(ts_min), av_ts2str(target_ts), av_ts2str(ts_max));
#endif
- *ts_ret= ts;
+ *ts_ret = ts;
return pos;
}
-static int seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos, int flags){
+static int seek_frame_byte(AVFormatContext *s, int stream_index,
+ int64_t pos, int flags)
+{
int64_t pos_min, pos_max;
pos_min = s->data_offset;
pos_max = avio_size(s->pb) - 1;
- if (pos < pos_min) pos= pos_min;
- else if(pos > pos_max) pos= pos_max;
+ if (pos < pos_min)
+ pos = pos_min;
+ else if (pos > pos_max)
+ pos = pos_max;
avio_seek(s->pb, pos, SEEK_SET);
@@ -1945,8 +2110,8 @@ static int seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos, in
return 0;
}
-static int seek_frame_generic(AVFormatContext *s,
- int stream_index, int64_t timestamp, int flags)
+static int seek_frame_generic(AVFormatContext *s, int stream_index,
+ int64_t timestamp, int flags)
{
int index;
int64_t ret;
@@ -1957,35 +2122,36 @@ static int seek_frame_generic(AVFormatContext *s,
index = av_index_search_timestamp(st, timestamp, flags);
- if(index < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp)
+ if (index < 0 && st->nb_index_entries &&
+ timestamp < st->index_entries[0].timestamp)
return -1;
- if(index < 0 || index==st->nb_index_entries-1){
+ if (index < 0 || index == st->nb_index_entries - 1) {
AVPacket pkt;
- int nonkey=0;
+ int nonkey = 0;
- if(st->nb_index_entries){
+ if (st->nb_index_entries) {
av_assert0(st->index_entries);
- ie= &st->index_entries[st->nb_index_entries-1];
+ ie = &st->index_entries[st->nb_index_entries - 1];
if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0)
return ret;
ff_update_cur_dts(s, st, ie->timestamp);
- }else{
+ } else {
if ((ret = avio_seek(s->pb, s->data_offset, SEEK_SET)) < 0)
return ret;
}
for (;;) {
int read_status;
- do{
+ do {
read_status = av_read_frame(s, &pkt);
} while (read_status == AVERROR(EAGAIN));
if (read_status < 0)
break;
av_free_packet(&pkt);
- if(stream_index == pkt.stream_index && pkt.dts > timestamp){
- if(pkt.flags & AV_PKT_FLAG_KEY)
+ if (stream_index == pkt.stream_index && pkt.dts > timestamp) {
+ if (pkt.flags & AV_PKT_FLAG_KEY)
break;
- if(nonkey++ > 1000 && st->codec->codec_id != AV_CODEC_ID_CDGRAPHICS){
+ if (nonkey++ > 1000 && st->codec->codec_id != AV_CODEC_ID_CDGRAPHICS) {
av_log(s, AV_LOG_ERROR,"seek_frame_generic failed as this stream seems to contain no keyframes after the target timestamp, %d non keyframes found\n", nonkey);
break;
}
@@ -1997,10 +2163,9 @@ static int seek_frame_generic(AVFormatContext *s,
return -1;
ff_read_frame_flush(s);
- if (s->iformat->read_seek){
- if(s->iformat->read_seek(s, stream_index, timestamp, flags) >= 0)
+ if (s->iformat->read_seek)
+ if (s->iformat->read_seek(s, stream_index, timestamp, flags) >= 0)
return 0;
- }
ie = &st->index_entries[index];
if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0)
return ret;
@@ -2022,14 +2187,15 @@ static int seek_frame_internal(AVFormatContext *s, int stream_index,
return seek_frame_byte(s, stream_index, timestamp, flags);
}
- if(stream_index < 0){
- stream_index= av_find_default_stream_index(s);
- if(stream_index < 0)
+ if (stream_index < 0) {
+ stream_index = av_find_default_stream_index(s);
+ if (stream_index < 0)
return -1;
- st= s->streams[stream_index];
+ st = s->streams[stream_index];
/* timestamp for default must be expressed in AV_TIME_BASE units */
- timestamp = av_rescale(timestamp, st->time_base.den, AV_TIME_BASE * (int64_t)st->time_base.num);
+ timestamp = av_rescale(timestamp, st->time_base.den,
+ AV_TIME_BASE * (int64_t) st->time_base.num);
}
/* first, we try the format specific seek */
@@ -2038,22 +2204,22 @@ static int seek_frame_internal(AVFormatContext *s, int stream_index,
ret = s->iformat->read_seek(s, stream_index, timestamp, flags);
} else
ret = -1;
- if (ret >= 0) {
+ if (ret >= 0)
return 0;
- }
- if (s->iformat->read_timestamp && !(s->iformat->flags & AVFMT_NOBINSEARCH)) {
+ if (s->iformat->read_timestamp &&
+ !(s->iformat->flags & AVFMT_NOBINSEARCH)) {
ff_read_frame_flush(s);
return ff_seek_frame_binary(s, stream_index, timestamp, flags);
} else if (!(s->iformat->flags & AVFMT_NOGENSEARCH)) {
ff_read_frame_flush(s);
return seek_frame_generic(s, stream_index, timestamp, flags);
- }
- else
+ } else
return -1;
}
-int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
+int av_seek_frame(AVFormatContext *s, int stream_index,
+ int64_t timestamp, int flags)
{
int ret;
@@ -2075,14 +2241,15 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int f
return ret;
}
-int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
+int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts,
+ int64_t ts, int64_t max_ts, int flags)
{
- if(min_ts > ts || max_ts < ts)
+ if (min_ts > ts || max_ts < ts)
return -1;
if (stream_index < -1 || stream_index >= (int)s->nb_streams)
return AVERROR(EINVAL);
- if(s->seek2any>0)
+ if (s->seek2any>0)
flags |= AVSEEK_FLAG_ANY;
flags &= ~AVSEEK_FLAG_BACKWARD;
@@ -2101,15 +2268,16 @@ int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int
AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX);
}
- ret = s->iformat->read_seek2(s, stream_index, min_ts, ts, max_ts, flags);
+ ret = s->iformat->read_seek2(s, stream_index, min_ts,
+ ts, max_ts, flags);
if (ret >= 0)
ret = avformat_queue_attached_pictures(s);
return ret;
}
- if(s->iformat->read_timestamp){
- //try to seek via read_timestamp()
+ if (s->iformat->read_timestamp) {
+ // try to seek via read_timestamp()
}
// Fall back on old API if new is not implemented but old is.
@@ -2141,7 +2309,7 @@ static int has_duration(AVFormatContext *ic)
int i;
AVStream *st;
- for(i = 0;i < ic->nb_streams; i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
if (st->duration != AV_NOPTS_VALUE)
return 1;
@@ -2166,47 +2334,50 @@ static void update_stream_timings(AVFormatContext *ic)
start_time = INT64_MAX;
start_time_text = INT64_MAX;
- end_time = INT64_MIN;
- duration = INT64_MIN;
- for(i = 0;i < ic->nb_streams; i++) {
+ end_time = INT64_MIN;
+ duration = INT64_MIN;
+ for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
if (st->start_time != AV_NOPTS_VALUE && st->time_base.den) {
- start_time1= av_rescale_q(st->start_time, st->time_base, AV_TIME_BASE_Q);
+ start_time1 = av_rescale_q(st->start_time, st->time_base,
+ AV_TIME_BASE_Q);
if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE || st->codec->codec_type == AVMEDIA_TYPE_DATA) {
if (start_time1 < start_time_text)
start_time_text = start_time1;
} else
start_time = FFMIN(start_time, start_time1);
- end_time1 = AV_NOPTS_VALUE;
+ end_time1 = AV_NOPTS_VALUE;
if (st->duration != AV_NOPTS_VALUE) {
- end_time1 = start_time1
- + av_rescale_q(st->duration, st->time_base, AV_TIME_BASE_Q);
+ end_time1 = start_time1 +
+ av_rescale_q(st->duration, st->time_base,
+ AV_TIME_BASE_Q);
end_time = FFMAX(end_time, end_time1);
}
- for(p = NULL; (p = av_find_program_from_stream(ic, p, i)); ){
- if(p->start_time == AV_NOPTS_VALUE || p->start_time > start_time1)
+ for (p = NULL; (p = av_find_program_from_stream(ic, p, i)); ) {
+ if (p->start_time == AV_NOPTS_VALUE || p->start_time > start_time1)
p->start_time = start_time1;
- if(p->end_time < end_time1)
+ if (p->end_time < end_time1)
p->end_time = end_time1;
}
}
if (st->duration != AV_NOPTS_VALUE) {
- duration1 = av_rescale_q(st->duration, st->time_base, AV_TIME_BASE_Q);
- duration = FFMAX(duration, duration1);
+ duration1 = av_rescale_q(st->duration, st->time_base,
+ AV_TIME_BASE_Q);
+ duration = FFMAX(duration, duration1);
}
}
if (start_time == INT64_MAX || (start_time > start_time_text && start_time - start_time_text < AV_TIME_BASE))
start_time = start_time_text;
- else if(start_time > start_time_text)
+ else if (start_time > start_time_text)
av_log(ic, AV_LOG_VERBOSE, "Ignoring outlier non primary stream starttime %f\n", start_time_text / (float)AV_TIME_BASE);
if (start_time != INT64_MAX) {
ic->start_time = start_time;
if (end_time != INT64_MIN) {
if (ic->nb_programs) {
- for (i=0; i<ic->nb_programs; i++) {
+ for (i = 0; i < ic->nb_programs; i++) {
p = ic->programs[i];
- if(p->start_time != AV_NOPTS_VALUE && p->end_time > p->start_time)
+ if (p->start_time != AV_NOPTS_VALUE && p->end_time > p->start_time)
duration = FFMAX(duration, p->end_time - p->start_time);
}
} else
@@ -2216,13 +2387,13 @@ static void update_stream_timings(AVFormatContext *ic)
if (duration != INT64_MIN && duration > 0 && ic->duration == AV_NOPTS_VALUE) {
ic->duration = duration;
}
- if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration != AV_NOPTS_VALUE) {
- /* compute the bitrate */
- double bitrate = (double)filesize * 8.0 * AV_TIME_BASE /
- (double)ic->duration;
- if (bitrate >= 0 && bitrate <= INT_MAX)
- ic->bit_rate = bitrate;
- }
+ if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration != AV_NOPTS_VALUE) {
+ /* compute the bitrate */
+ double bitrate = (double) filesize * 8.0 * AV_TIME_BASE /
+ (double) ic->duration;
+ if (bitrate >= 0 && bitrate <= INT_MAX)
+ ic->bit_rate = bitrate;
+ }
}
static void fill_all_stream_timings(AVFormatContext *ic)
@@ -2231,13 +2402,15 @@ static void fill_all_stream_timings(AVFormatContext *ic)
AVStream *st;
update_stream_timings(ic);
- for(i = 0;i < ic->nb_streams; i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
if (st->start_time == AV_NOPTS_VALUE) {
- if(ic->start_time != AV_NOPTS_VALUE)
- st->start_time = av_rescale_q(ic->start_time, AV_TIME_BASE_Q, st->time_base);
- if(ic->duration != AV_NOPTS_VALUE)
- st->duration = av_rescale_q(ic->duration, AV_TIME_BASE_Q, st->time_base);
+ if (ic->start_time != AV_NOPTS_VALUE)
+ st->start_time = av_rescale_q(ic->start_time, AV_TIME_BASE_Q,
+ st->time_base);
+ if (ic->duration != AV_NOPTS_VALUE)
+ st->duration = av_rescale_q(ic->duration, AV_TIME_BASE_Q,
+ st->time_base);
}
}
}
@@ -2251,7 +2424,7 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
/* if bit_rate is already set, we believe it */
if (ic->bit_rate <= 0) {
int bit_rate = 0;
- for(i=0;i<ic->nb_streams;i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
if (st->codec->bit_rate > 0) {
if (INT_MAX - st->codec->bit_rate < bit_rate) {
@@ -2269,11 +2442,13 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
ic->bit_rate != 0) {
filesize = ic->pb ? avio_size(ic->pb) : 0;
if (filesize > 0) {
- for(i = 0; i < ic->nb_streams; i++) {
- st = ic->streams[i];
+ for (i = 0; i < ic->nb_streams; i++) {
+ st = ic->streams[i];
if ( st->time_base.num <= INT64_MAX / ic->bit_rate
&& st->duration == AV_NOPTS_VALUE) {
- duration= av_rescale(8*filesize, st->time_base.den, ic->bit_rate*(int64_t)st->time_base.num);
+ duration = av_rescale(8 * filesize, st->time_base.den,
+ ic->bit_rate *
+ (int64_t) st->time_base.num);
st->duration = duration;
show_warning = 1;
}
@@ -2281,7 +2456,8 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
}
}
if (show_warning)
- av_log(ic, AV_LOG_WARNING, "Estimating duration from bitrate, this may be inaccurate\n");
+ av_log(ic, AV_LOG_WARNING,
+ "Estimating duration from bitrate, this may be inaccurate\n");
}
#define DURATION_MAX_READ_SIZE 250000LL
@@ -2295,19 +2471,22 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
int read_size, i, ret;
int64_t end_time;
int64_t filesize, offset, duration;
- int retry=0;
+ int retry = 0;
/* flush packet queue */
flush_packet_queue(ic);
- for (i=0; i<ic->nb_streams; i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
- if (st->start_time == AV_NOPTS_VALUE && st->first_dts == AV_NOPTS_VALUE)
- av_log(st->codec, AV_LOG_WARNING, "start time is not set in estimate_timings_from_pts\n");
+ if (st->start_time == AV_NOPTS_VALUE &&
+ st->first_dts == AV_NOPTS_VALUE &&
+ st->codec->codec_type != AVMEDIA_TYPE_UNKNOWN)
+ av_log(st->codec, AV_LOG_WARNING,
+ "start time for stream %d is not set in estimate_timings_from_pts\n", i);
if (st->parser) {
av_parser_close(st->parser);
- st->parser= NULL;
+ st->parser = NULL;
}
}
@@ -2315,24 +2494,24 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
/* XXX: may need to support wrapping */
filesize = ic->pb ? avio_size(ic->pb) : 0;
end_time = AV_NOPTS_VALUE;
- do{
- offset = filesize - (DURATION_MAX_READ_SIZE<<retry);
+ do {
+ offset = filesize - (DURATION_MAX_READ_SIZE << retry);
if (offset < 0)
offset = 0;
avio_seek(ic->pb, offset, SEEK_SET);
read_size = 0;
- for(;;) {
- if (read_size >= DURATION_MAX_READ_SIZE<<(FFMAX(retry-1,0)))
+ for (;;) {
+ if (read_size >= DURATION_MAX_READ_SIZE << (FFMAX(retry - 1, 0)))
break;
do {
ret = ff_read_packet(ic, pkt);
- } while(ret == AVERROR(EAGAIN));
+ } while (ret == AVERROR(EAGAIN));
if (ret != 0)
break;
read_size += pkt->size;
- st = ic->streams[pkt->stream_index];
+ st = ic->streams[pkt->stream_index];
if (pkt->pts != AV_NOPTS_VALUE &&
(st->start_time != AV_NOPTS_VALUE ||
st->first_dts != AV_NOPTS_VALUE)) {
@@ -2342,7 +2521,7 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
else
duration -= st->first_dts;
if (duration > 0) {
- if (st->duration == AV_NOPTS_VALUE || st->info->last_duration<=0 ||
+ if (st->duration == AV_NOPTS_VALUE || st->info->last_duration<= 0 ||
(st->duration < duration && FFABS(duration - st->info->last_duration) < 60LL*st->time_base.den / st->time_base.num))
st->duration = duration;
st->info->last_duration = duration;
@@ -2350,17 +2529,22 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
}
av_free_packet(pkt);
}
- }while( end_time==AV_NOPTS_VALUE
- && filesize > (DURATION_MAX_READ_SIZE<<retry)
- && ++retry <= DURATION_MAX_RETRY);
+ } while (end_time == AV_NOPTS_VALUE &&
+ filesize > (DURATION_MAX_READ_SIZE << retry) &&
+ ++retry <= DURATION_MAX_RETRY);
fill_all_stream_timings(ic);
avio_seek(ic->pb, old_offset, SEEK_SET);
- for (i=0; i<ic->nb_streams; i++) {
- st= ic->streams[i];
- st->cur_dts= st->first_dts;
+ for (i = 0; i < ic->nb_streams; i++) {
+ int j;
+
+ st = ic->streams[i];
+ st->cur_dts = st->first_dts;
st->last_IP_pts = AV_NOPTS_VALUE;
+ st->last_dts_for_order_check = AV_NOPTS_VALUE;
+ for (j = 0; j < MAX_REORDER_DELAY + 1; j++)
+ st->pts_buffer[j] = AV_NOPTS_VALUE;
}
}
@@ -2384,7 +2568,7 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
ic->duration_estimation_method = AVFMT_DURATION_FROM_PTS;
} else if (has_duration(ic)) {
/* at least one component has timings - we use them for all
- the components */
+ * the components */
fill_all_stream_timings(ic);
ic->duration_estimation_method = AVFMT_DURATION_FROM_STREAM;
} else {
@@ -2397,13 +2581,14 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
{
int i;
AVStream av_unused *st;
- for(i = 0;i < ic->nb_streams; i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
av_dlog(ic, "%d: start_time: %0.3f duration: %0.3f\n", i,
(double) st->start_time / AV_TIME_BASE,
(double) st->duration / AV_TIME_BASE);
}
- av_dlog(ic, "stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
+ av_dlog(ic,
+ "stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
(double) ic->start_time / AV_TIME_BASE,
(double) ic->duration / AV_TIME_BASE,
ic->bit_rate / 1000);
@@ -2424,7 +2609,8 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr)
case AVMEDIA_TYPE_AUDIO:
if (!avctx->frame_size && determinable_frame_size(avctx))
FAIL("unspecified frame size");
- if (st->info->found_decoder >= 0 && avctx->sample_fmt == AV_SAMPLE_FMT_NONE)
+ if (st->info->found_decoder >= 0 &&
+ avctx->sample_fmt == AV_SAMPLE_FMT_NONE)
FAIL("unspecified sample format");
if (!avctx->sample_rate)
FAIL("unspecified sample rate");
@@ -2447,7 +2633,7 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr)
FAIL("unspecified size");
break;
case AVMEDIA_TYPE_DATA:
- if(avctx->codec_id == AV_CODEC_ID_NONE) return 1;
+ if (avctx->codec_id == AV_CODEC_ID_NONE) return 1;
}
if (avctx->codec_id == AV_CODEC_ID_NONE)
@@ -2456,7 +2642,8 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr)
}
/* returns 1 or 0 if or if not decoded data was returned, or a negative error */
-static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt, AVDictionary **options)
+static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt,
+ AVDictionary **options)
{
const AVCodec *codec;
int got_picture = 1, ret = 0;
@@ -2467,25 +2654,27 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt, A
if (!frame)
return AVERROR(ENOMEM);
- if (!avcodec_is_open(st->codec) && !st->info->found_decoder) {
+ if (!avcodec_is_open(st->codec) &&
+ st->info->found_decoder <= 0 &&
+ (st->codec->codec_id != -st->info->found_decoder || !st->codec->codec_id)) {
AVDictionary *thread_opt = NULL;
codec = find_decoder(s, st, st->codec->codec_id);
if (!codec) {
- st->info->found_decoder = -1;
- ret = -1;
+ st->info->found_decoder = -st->codec->codec_id;
+ ret = -1;
goto fail;
}
- /* force thread count to 1 since the h264 decoder will not extract SPS
- * and PPS to extradata during multi-threaded decoding */
+ /* Force thread count to 1 since the H.264 decoder will not extract
+ * SPS and PPS to extradata during multi-threaded decoding. */
av_dict_set(options ? options : &thread_opt, "threads", "1", 0);
ret = avcodec_open2(st->codec, codec, options ? options : &thread_opt);
if (!options)
av_dict_free(&thread_opt);
if (ret < 0) {
- st->info->found_decoder = -1;
+ st->info->found_decoder = -st->codec->codec_id;
goto fail;
}
st->info->found_decoder = 1;
@@ -2499,12 +2688,11 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt, A
while ((pkt.size > 0 || (!pkt.data && got_picture)) &&
ret >= 0 &&
- (!has_codec_parameters(st, NULL) ||
- !has_decode_delay_been_guessed(st) ||
- (!st->codec_info_nb_frames && st->codec->codec->capabilities & CODEC_CAP_CHANNEL_CONF))) {
+ (!has_codec_parameters(st, NULL) || !has_decode_delay_been_guessed(st) ||
+ (!st->codec_info_nb_frames &&
+ st->codec->codec->capabilities & CODEC_CAP_CHANNEL_CONF))) {
got_picture = 0;
- avcodec_get_frame_defaults(frame);
- switch(st->codec->codec_type) {
+ switch (st->codec->codec_type) {
case AVMEDIA_TYPE_VIDEO:
ret = avcodec_decode_video2(st->codec, frame,
&got_picture, &pkt);
@@ -2529,11 +2717,11 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt, A
}
}
- if(!pkt.data && !got_picture)
+ if (!pkt.data && !got_picture)
ret = -1;
fail:
- avcodec_free_frame(&frame);
+ av_frame_free(&frame);
return ret;
}
@@ -2550,14 +2738,12 @@ unsigned int ff_codec_get_tag(const AVCodecTag *tags, enum AVCodecID id)
enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
{
int i;
- for(i=0; tags[i].id != AV_CODEC_ID_NONE;i++) {
- if(tag == tags[i].tag)
+ for (i = 0; tags[i].id != AV_CODEC_ID_NONE; i++)
+ if (tag == tags[i].tag)
return tags[i].id;
- }
- for(i=0; tags[i].id != AV_CODEC_ID_NONE; i++) {
+ for (i = 0; tags[i].id != AV_CODEC_ID_NONE; i++)
if (avpriv_toupper4(tag) == avpriv_toupper4(tags[i].tag))
return tags[i].id;
- }
return AV_CODEC_ID_NONE;
}
@@ -2565,34 +2751,47 @@ enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags)
{
if (flt) {
switch (bps) {
- case 32: return be ? AV_CODEC_ID_PCM_F32BE : AV_CODEC_ID_PCM_F32LE;
- case 64: return be ? AV_CODEC_ID_PCM_F64BE : AV_CODEC_ID_PCM_F64LE;
- default: return AV_CODEC_ID_NONE;
+ case 32:
+ return be ? AV_CODEC_ID_PCM_F32BE : AV_CODEC_ID_PCM_F32LE;
+ case 64:
+ return be ? AV_CODEC_ID_PCM_F64BE : AV_CODEC_ID_PCM_F64LE;
+ default:
+ return AV_CODEC_ID_NONE;
}
} else {
bps += 7;
bps >>= 3;
if (sflags & (1 << (bps - 1))) {
switch (bps) {
- case 1: return AV_CODEC_ID_PCM_S8;
- case 2: return be ? AV_CODEC_ID_PCM_S16BE : AV_CODEC_ID_PCM_S16LE;
- case 3: return be ? AV_CODEC_ID_PCM_S24BE : AV_CODEC_ID_PCM_S24LE;
- case 4: return be ? AV_CODEC_ID_PCM_S32BE : AV_CODEC_ID_PCM_S32LE;
- default: return AV_CODEC_ID_NONE;
+ case 1:
+ return AV_CODEC_ID_PCM_S8;
+ case 2:
+ return be ? AV_CODEC_ID_PCM_S16BE : AV_CODEC_ID_PCM_S16LE;
+ case 3:
+ return be ? AV_CODEC_ID_PCM_S24BE : AV_CODEC_ID_PCM_S24LE;
+ case 4:
+ return be ? AV_CODEC_ID_PCM_S32BE : AV_CODEC_ID_PCM_S32LE;
+ default:
+ return AV_CODEC_ID_NONE;
}
} else {
switch (bps) {
- case 1: return AV_CODEC_ID_PCM_U8;
- case 2: return be ? AV_CODEC_ID_PCM_U16BE : AV_CODEC_ID_PCM_U16LE;
- case 3: return be ? AV_CODEC_ID_PCM_U24BE : AV_CODEC_ID_PCM_U24LE;
- case 4: return be ? AV_CODEC_ID_PCM_U32BE : AV_CODEC_ID_PCM_U32LE;
- default: return AV_CODEC_ID_NONE;
+ case 1:
+ return AV_CODEC_ID_PCM_U8;
+ case 2:
+ return be ? AV_CODEC_ID_PCM_U16BE : AV_CODEC_ID_PCM_U16LE;
+ case 3:
+ return be ? AV_CODEC_ID_PCM_U24BE : AV_CODEC_ID_PCM_U24LE;
+ case 4:
+ return be ? AV_CODEC_ID_PCM_U32BE : AV_CODEC_ID_PCM_U32LE;
+ default:
+ return AV_CODEC_ID_NONE;
}
}
}
}
-unsigned int av_codec_get_tag(const AVCodecTag * const *tags, enum AVCodecID id)
+unsigned int av_codec_get_tag(const AVCodecTag *const *tags, enum AVCodecID id)
{
unsigned int tag;
if (!av_codec_get_tag2(tags, id, &tag))
@@ -2604,7 +2803,7 @@ int av_codec_get_tag2(const AVCodecTag * const *tags, enum AVCodecID id,
unsigned int *tag)
{
int i;
- for(i=0; tags && tags[i]; i++){
+ for (i = 0; tags && tags[i]; i++) {
const AVCodecTag *codec_tags = tags[i];
while (codec_tags->id != AV_CODEC_ID_NONE) {
if (codec_tags->id == id) {
@@ -2617,12 +2816,13 @@ int av_codec_get_tag2(const AVCodecTag * const *tags, enum AVCodecID id,
return 0;
}
-enum AVCodecID av_codec_get_id(const AVCodecTag * const *tags, unsigned int tag)
+enum AVCodecID av_codec_get_id(const AVCodecTag *const *tags, unsigned int tag)
{
int i;
- for(i=0; tags && tags[i]; i++){
- enum AVCodecID id= ff_codec_get_id(tags[i], tag);
- if(id!=AV_CODEC_ID_NONE) return id;
+ for (i = 0; tags && tags[i]; i++) {
+ enum AVCodecID id = ff_codec_get_id(tags[i], tag);
+ if (id != AV_CODEC_ID_NONE)
+ return id;
}
return AV_CODEC_ID_NONE;
}
@@ -2630,17 +2830,20 @@ enum AVCodecID av_codec_get_id(const AVCodecTag * const *tags, unsigned int tag)
static void compute_chapters_end(AVFormatContext *s)
{
unsigned int i, j;
- int64_t max_time = s->duration + ((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time);
+ int64_t max_time = s->duration +
+ ((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time);
for (i = 0; i < s->nb_chapters; i++)
if (s->chapters[i]->end == AV_NOPTS_VALUE) {
AVChapter *ch = s->chapters[i];
- int64_t end = max_time ? av_rescale_q(max_time, AV_TIME_BASE_Q, ch->time_base)
- : INT64_MAX;
+ int64_t end = max_time ? av_rescale_q(max_time, AV_TIME_BASE_Q,
+ ch->time_base)
+ : INT64_MAX;
for (j = 0; j < s->nb_chapters; j++) {
- AVChapter *ch1 = s->chapters[j];
- int64_t next_start = av_rescale_q(ch1->start, ch1->time_base, ch->time_base);
+ AVChapter *ch1 = s->chapters[j];
+ int64_t next_start = av_rescale_q(ch1->start, ch1->time_base,
+ ch->time_base);
if (j != i && next_start > ch->start && next_start < end)
end = next_start;
}
@@ -2648,28 +2851,30 @@ static void compute_chapters_end(AVFormatContext *s)
}
}
-static int get_std_framerate(int i){
- if(i<60*12) return (i+1)*1001;
- else return ((const int[]){24,30,60,12,15,48})[i-60*12]*1000*12;
+static int get_std_framerate(int i)
+{
+ if (i < 60 * 12)
+ return (i + 1) * 1001;
+ else
+ return ((const int[]) { 24, 30, 60, 12, 15, 48 })[i - 60 * 12] * 1000 * 12;
}
-/*
- * Is the time base unreliable.
+/* Is the time base unreliable?
* This is a heuristic to balance between quick acceptance of the values in
* the headers vs. some extra checks.
* Old DivX and Xvid often have nonsense timebases like 1fps or 2fps.
* MPEG-2 commonly misuses field repeat flags to store different framerates.
- * And there are "variable" fps files this needs to detect as well.
- */
-static int tb_unreliable(AVCodecContext *c){
- if( c->time_base.den >= 101L*c->time_base.num
- || c->time_base.den < 5L*c->time_base.num
-/* || c->codec_tag == AV_RL32("DIVX")
- || c->codec_tag == AV_RL32("XVID")*/
- || c->codec_tag == AV_RL32("mp4v")
- || c->codec_id == AV_CODEC_ID_MPEG2VIDEO
- || c->codec_id == AV_CODEC_ID_H264
- )
+ * And there are "variable" fps files this needs to detect as well. */
+static int tb_unreliable(AVCodecContext *c)
+{
+ if (c->time_base.den >= 101L * c->time_base.num ||
+ c->time_base.den < 5L * c->time_base.num ||
+ // c->codec_tag == AV_RL32("DIVX") ||
+ // c->codec_tag == AV_RL32("XVID") ||
+ c->codec_tag == AV_RL32("mp4v") ||
+ c->codec_id == AV_CODEC_ID_MPEG2VIDEO ||
+ c->codec_id == AV_CODEC_ID_GIF ||
+ c->codec_id == AV_CODEC_ID_H264)
return 1;
return 0;
}
@@ -2701,29 +2906,45 @@ int ff_alloc_extradata(AVCodecContext *avctx, int size)
return ret;
}
+int ff_get_extradata(AVCodecContext *avctx, AVIOContext *pb, int size)
+{
+ int ret = ff_alloc_extradata(avctx, size);
+ if (ret < 0)
+ return ret;
+ ret = avio_read(pb, avctx->extradata, size);
+ if (ret != size) {
+ av_freep(&avctx->extradata);
+ avctx->extradata_size = 0;
+ av_log(avctx, AV_LOG_ERROR, "Failed to read extradata of size %d\n", size);
+ return ret < 0 ? ret : AVERROR_INVALIDDATA;
+ }
+
+ return ret;
+}
+
int ff_rfps_add_frame(AVFormatContext *ic, AVStream *st, int64_t ts)
{
int i, j;
int64_t last = st->info->last_dts;
- if( ts != AV_NOPTS_VALUE && last != AV_NOPTS_VALUE && ts > last
- && ts - (uint64_t)last < INT64_MAX){
- double dts= (is_relative(ts) ? ts - RELATIVE_TS_BASE : ts) * av_q2d(st->time_base);
- int64_t duration= ts - last;
+ if ( ts != AV_NOPTS_VALUE && last != AV_NOPTS_VALUE && ts > last
+ && ts - (uint64_t)last < INT64_MAX) {
+ double dts = (is_relative(ts) ? ts - RELATIVE_TS_BASE : ts) * av_q2d(st->time_base);
+ int64_t duration = ts - last;
if (!st->info->duration_error)
st->info->duration_error = av_mallocz(sizeof(st->info->duration_error[0])*2);
if (!st->info->duration_error)
return AVERROR(ENOMEM);
-// if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
+// if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
// av_log(NULL, AV_LOG_ERROR, "%f\n", dts);
- for (i=0; i<MAX_STD_TIMEBASES; i++) {
+ for (i = 0; i<MAX_STD_TIMEBASES; i++) {
if (st->info->duration_error[0][1][i] < 1e10) {
- int framerate= get_std_framerate(i);
- double sdts= dts*framerate/(1001*12);
- for(j=0; j<2; j++){
- int64_t ticks= llrint(sdts+j*0.5);
+ int framerate = get_std_framerate(i);
+ double sdts = dts*framerate/(1001*12);
+ for (j= 0; j<2; j++) {
+ int64_t ticks = llrint(sdts+j*0.5);
double error= sdts - ticks + j*0.5;
st->info->duration_error[j][0][i] += error;
st->info->duration_error[j][1][i] += error*error;
@@ -2731,10 +2952,11 @@ int ff_rfps_add_frame(AVFormatContext *ic, AVStream *st, int64_t ts)
}
}
st->info->duration_count++;
+ st->info->rfps_duration_sum += duration;
if (st->info->duration_count % 10 == 0) {
int n = st->info->duration_count;
- for (i=0; i<MAX_STD_TIMEBASES; i++) {
+ for (i = 0; i<MAX_STD_TIMEBASES; i++) {
if (st->info->duration_error[0][1][i] < 1e10) {
double a0 = st->info->duration_error[0][0][i] / n;
double error0 = st->info->duration_error[0][1][i] / n - a0*a0;
@@ -2762,7 +2984,7 @@ void ff_rfps_calculate(AVFormatContext *ic)
{
int i, j;
- for (i = 0; i<ic->nb_streams; i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
AVStream *st = ic->streams[i];
if (st->codec->codec_type != AVMEDIA_TYPE_VIDEO)
@@ -2776,35 +2998,50 @@ void ff_rfps_calculate(AVFormatContext *ic)
&& tb_unreliable(st->codec)) {
int num = 0;
double best_error= 0.01;
+ AVRational ref_rate = st->r_frame_rate.num ? st->r_frame_rate : av_inv_q(st->time_base);
- for (j=0; j<MAX_STD_TIMEBASES; j++) {
+ for (j= 0; j<MAX_STD_TIMEBASES; j++) {
int k;
- if(st->info->codec_info_duration && st->info->codec_info_duration*av_q2d(st->time_base) < (1001*12.0)/get_std_framerate(j))
+ if (st->info->codec_info_duration && st->info->codec_info_duration*av_q2d(st->time_base) < (1001*12.0)/get_std_framerate(j))
continue;
- if(!st->info->codec_info_duration && 1.0 < (1001*12.0)/get_std_framerate(j))
+ if (!st->info->codec_info_duration && 1.0 < (1001*12.0)/get_std_framerate(j))
+ continue;
+
+ if (av_q2d(st->time_base) * st->info->rfps_duration_sum / st->info->duration_count < (1001*12.0 * 0.8)/get_std_framerate(j))
continue;
- for(k=0; k<2; k++){
- int n= st->info->duration_count;
+
+ for (k= 0; k<2; k++) {
+ int n = st->info->duration_count;
double a= st->info->duration_error[k][0][j] / n;
double error= st->info->duration_error[k][1][j]/n - a*a;
- if(error < best_error && best_error> 0.000000001){
+ if (error < best_error && best_error> 0.000000001) {
best_error= error;
num = get_std_framerate(j);
}
- if(error < 0.02)
+ if (error < 0.02)
av_log(NULL, AV_LOG_DEBUG, "rfps: %f %f\n", get_std_framerate(j) / 12.0/1001, error);
}
}
// do not increase frame rate by more than 1 % in order to match a standard rate.
- if (num && (!st->r_frame_rate.num || (double)num/(12*1001) < 1.01 * av_q2d(st->r_frame_rate)))
+ if (num && (!ref_rate.num || (double)num/(12*1001) < 1.01 * av_q2d(ref_rate)))
av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, num, 12*1001, INT_MAX);
}
+ if ( !st->avg_frame_rate.num
+ && st->r_frame_rate.num && st->info->rfps_duration_sum
+ && st->info->codec_info_duration <= 0
+ && st->info->duration_count > 2
+ && fabs(1.0 / (av_q2d(st->r_frame_rate) * av_q2d(st->time_base)) - st->info->rfps_duration_sum / (double)st->info->duration_count) <= 1.0
+ ) {
+ av_log(ic, AV_LOG_DEBUG, "Setting avg frame rate based on r frame rate\n");
+ st->avg_frame_rate = st->r_frame_rate;
+ }
av_freep(&st->info->duration_error);
st->info->last_dts = AV_NOPTS_VALUE;
st->info->duration_count = 0;
+ st->info->rfps_duration_sum = 0;
}
}
@@ -2814,33 +3051,34 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
int64_t read_size;
AVStream *st;
AVPacket pkt1, *pkt;
- int64_t old_offset = avio_tell(ic->pb);
- int orig_nb_streams = ic->nb_streams; // new streams might appear, no options for those
- int flush_codecs = ic->probesize > 0;
+ int64_t old_offset = avio_tell(ic->pb);
+ // new streams might appear, no options for those
+ int orig_nb_streams = ic->nb_streams;
+ int flush_codecs = ic->probesize > 0;
- if(ic->pb)
+ if (ic->pb)
av_log(ic, AV_LOG_DEBUG, "Before avformat_find_stream_info() pos: %"PRId64" bytes read:%"PRId64" seeks:%d\n",
avio_tell(ic->pb), ic->pb->bytes_read, ic->pb->seek_count);
- for(i=0;i<ic->nb_streams;i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
const AVCodec *codec;
AVDictionary *thread_opt = NULL;
st = ic->streams[i];
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
-/* if(!st->time_base.num)
- st->time_base= */
- if(!st->codec->time_base.num)
- st->codec->time_base= st->time_base;
+/* if (!st->time_base.num)
+ st->time_base = */
+ if (!st->codec->time_base.num)
+ st->codec->time_base = st->time_base;
}
- //only for the split stuff
+ // only for the split stuff
if (!st->parser && !(ic->flags & AVFMT_FLAG_NOPARSE)) {
st->parser = av_parser_init(st->codec->codec_id);
- if(st->parser){
- if(st->need_parsing == AVSTREAM_PARSE_HEADERS){
+ if (st->parser) {
+ if (st->need_parsing == AVSTREAM_PARSE_HEADERS) {
st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
- } else if(st->need_parsing == AVSTREAM_PARSE_FULL_RAW) {
+ } else if (st->need_parsing == AVSTREAM_PARSE_FULL_RAW) {
st->parser->flags |= PARSER_FLAG_USE_CODEC_TS;
}
} else if (st->need_parsing) {
@@ -2851,27 +3089,30 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
}
codec = find_decoder(ic, st, st->codec->codec_id);
- /* force thread count to 1 since the h264 decoder will not extract SPS
- * and PPS to extradata during multi-threaded decoding */
+ /* Force thread count to 1 since the H.264 decoder will not extract
+ * SPS and PPS to extradata during multi-threaded decoding. */
av_dict_set(options ? &options[i] : &thread_opt, "threads", "1", 0);
/* Ensure that subtitle_header is properly set. */
if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE
- && codec && !st->codec->codec)
- avcodec_open2(st->codec, codec, options ? &options[i]
- : &thread_opt);
+ && codec && !st->codec->codec) {
+ if (avcodec_open2(st->codec, codec, options ? &options[i] : &thread_opt) < 0)
+ av_log(ic, AV_LOG_WARNING,
+ "Failed to open codec in av_find_stream_info\n");
+ }
- //try to just open decoders, in case this is enough to get parameters
+ // Try to just open decoders, in case this is enough to get parameters.
if (!has_codec_parameters(st, NULL) && st->request_probe <= 0) {
if (codec && !st->codec->codec)
- avcodec_open2(st->codec, codec, options ? &options[i]
- : &thread_opt);
+ if (avcodec_open2(st->codec, codec, options ? &options[i] : &thread_opt) < 0)
+ av_log(ic, AV_LOG_WARNING,
+ "Failed to open codec in av_find_stream_info\n");
}
if (!options)
av_dict_free(&thread_opt);
}
- for (i=0; i<ic->nb_streams; i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
#if FF_API_R_FRAME_RATE
ic->streams[i]->info->last_dts = AV_NOPTS_VALUE;
#endif
@@ -2879,37 +3120,40 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
ic->streams[i]->info->fps_last_dts = AV_NOPTS_VALUE;
}
- count = 0;
+ count = 0;
read_size = 0;
- for(;;) {
- if (ff_check_interrupt(&ic->interrupt_callback)){
- ret= AVERROR_EXIT;
+ for (;;) {
+ if (ff_check_interrupt(&ic->interrupt_callback)) {
+ ret = AVERROR_EXIT;
av_log(ic, AV_LOG_DEBUG, "interrupted\n");
break;
}
/* check if one codec still needs to be handled */
- for(i=0;i<ic->nb_streams;i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
int fps_analyze_framecount = 20;
st = ic->streams[i];
if (!has_codec_parameters(st, NULL))
break;
- /* if the timebase is coarse (like the usual millisecond precision
- of mkv), we need to analyze more frames to reliably arrive at
- the correct fps */
+ /* If the timebase is coarse (like the usual millisecond precision
+ * of mkv), we need to analyze more frames to reliably arrive at
+ * the correct fps. */
if (av_q2d(st->time_base) > 0.0005)
fps_analyze_framecount *= 2;
+ if (!tb_unreliable(st->codec))
+ fps_analyze_framecount = 0;
if (ic->fps_probe_size >= 0)
fps_analyze_framecount = ic->fps_probe_size;
if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
fps_analyze_framecount = 0;
/* variable fps and no guess at the real fps */
- if( tb_unreliable(st->codec) && !(st->r_frame_rate.num && st->avg_frame_rate.num)
- && st->info->duration_count < fps_analyze_framecount
- && st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
+ if (!(st->r_frame_rate.num && st->avg_frame_rate.num) &&
+ st->info->duration_count < fps_analyze_framecount &&
+ st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
break;
- if(st->parser && st->parser->parser->split && !st->codec->extradata)
+ if (st->parser && st->parser->parser->split &&
+ !st->codec->extradata)
break;
if (st->first_dts == AV_NOPTS_VALUE &&
(st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
@@ -2917,24 +3161,25 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
break;
}
if (i == ic->nb_streams) {
- /* NOTE: if the format has no header, then we need to read
- some packets to get most of the streams, so we cannot
- stop here */
+ /* NOTE: If the format has no header, then we need to read some
+ * packets to get most of the streams, so we cannot stop here. */
if (!(ic->ctx_flags & AVFMTCTX_NOHEADER)) {
- /* if we found the info for all the codecs, we can stop */
+ /* If we found the info for all the codecs, we can stop. */
ret = count;
av_log(ic, AV_LOG_DEBUG, "All info found\n");
flush_codecs = 0;
break;
}
}
- /* we did not get all the codec info, but we read too much data */
+ /* We did not get all the codec info, but we read too much data. */
if (read_size >= ic->probesize) {
ret = count;
- av_log(ic, AV_LOG_DEBUG, "Probe buffer size limit of %d bytes reached\n", ic->probesize);
+ av_log(ic, AV_LOG_DEBUG,
+ "Probe buffer size limit of %d bytes reached\n", ic->probesize);
for (i = 0; i < ic->nb_streams; i++)
if (!ic->streams[i]->r_frame_rate.num &&
ic->streams[i]->info->duration_count <= 1 &&
+ ic->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
strcmp(ic->iformat->name, "image2"))
av_log(ic, AV_LOG_WARNING,
"Stream #%d: not enough frames to estimate rate; "
@@ -2942,8 +3187,8 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
break;
}
- /* NOTE: a new stream can be added there if no header in file
- (AVFMTCTX_NOHEADER) */
+ /* NOTE: A new stream can be added there if no header in file
+ * (AVFMTCTX_NOHEADER). */
ret = read_frame_internal(ic, &pkt1);
if (ret == AVERROR(EAGAIN))
continue;
@@ -2974,24 +3219,31 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
/* check for non-increasing dts */
if (st->info->fps_last_dts != AV_NOPTS_VALUE &&
st->info->fps_last_dts >= pkt->dts) {
- av_log(ic, AV_LOG_DEBUG, "Non-increasing DTS in stream %d: "
- "packet %d with DTS %"PRId64", packet %d with DTS "
- "%"PRId64"\n", st->index, st->info->fps_last_dts_idx,
- st->info->fps_last_dts, st->codec_info_nb_frames, pkt->dts);
- st->info->fps_first_dts = st->info->fps_last_dts = AV_NOPTS_VALUE;
+ av_log(ic, AV_LOG_DEBUG,
+ "Non-increasing DTS in stream %d: packet %d with DTS "
+ "%"PRId64", packet %d with DTS %"PRId64"\n",
+ st->index, st->info->fps_last_dts_idx,
+ st->info->fps_last_dts, st->codec_info_nb_frames,
+ pkt->dts);
+ st->info->fps_first_dts =
+ st->info->fps_last_dts = AV_NOPTS_VALUE;
}
- /* check for a discontinuity in dts - if the difference in dts
- * is more than 1000 times the average packet duration in the sequence,
- * we treat it as a discontinuity */
+ /* Check for a discontinuity in dts. If the difference in dts
+ * is more than 1000 times the average packet duration in the
+ * sequence, we treat it as a discontinuity. */
if (st->info->fps_last_dts != AV_NOPTS_VALUE &&
st->info->fps_last_dts_idx > st->info->fps_first_dts_idx &&
(pkt->dts - st->info->fps_last_dts) / 1000 >
- (st->info->fps_last_dts - st->info->fps_first_dts) / (st->info->fps_last_dts_idx - st->info->fps_first_dts_idx)) {
- av_log(ic, AV_LOG_WARNING, "DTS discontinuity in stream %d: "
- "packet %d with DTS %"PRId64", packet %d with DTS "
- "%"PRId64"\n", st->index, st->info->fps_last_dts_idx,
- st->info->fps_last_dts, st->codec_info_nb_frames, pkt->dts);
- st->info->fps_first_dts = st->info->fps_last_dts = AV_NOPTS_VALUE;
+ (st->info->fps_last_dts - st->info->fps_first_dts) /
+ (st->info->fps_last_dts_idx - st->info->fps_first_dts_idx)) {
+ av_log(ic, AV_LOG_WARNING,
+ "DTS discontinuity in stream %d: packet %d with DTS "
+ "%"PRId64", packet %d with DTS %"PRId64"\n",
+ st->index, st->info->fps_last_dts_idx,
+ st->info->fps_last_dts, st->codec_info_nb_frames,
+ pkt->dts);
+ st->info->fps_first_dts =
+ st->info->fps_last_dts = AV_NOPTS_VALUE;
}
/* update stored dts values */
@@ -2999,53 +3251,57 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
st->info->fps_first_dts = pkt->dts;
st->info->fps_first_dts_idx = st->codec_info_nb_frames;
}
- st->info->fps_last_dts = pkt->dts;
+ st->info->fps_last_dts = pkt->dts;
st->info->fps_last_dts_idx = st->codec_info_nb_frames;
}
if (st->codec_info_nb_frames>1) {
- int64_t t=0;
+ int64_t t = 0;
if (st->time_base.den > 0)
t = av_rescale_q(st->info->codec_info_duration, st->time_base, AV_TIME_BASE_Q);
if (st->avg_frame_rate.num > 0)
t = FFMAX(t, av_rescale_q(st->codec_info_nb_frames, av_inv_q(st->avg_frame_rate), AV_TIME_BASE_Q));
- if ( t==0
+ if ( t == 0
&& st->codec_info_nb_frames>30
&& st->info->fps_first_dts != AV_NOPTS_VALUE
&& st->info->fps_last_dts != AV_NOPTS_VALUE)
t = FFMAX(t, av_rescale_q(st->info->fps_last_dts - st->info->fps_first_dts, st->time_base, AV_TIME_BASE_Q));
if (t >= ic->max_analyze_duration) {
- av_log(ic, AV_LOG_VERBOSE, "max_analyze_duration %d reached at %"PRId64" microseconds\n", ic->max_analyze_duration, t);
+ av_log(ic, AV_LOG_VERBOSE, "max_analyze_duration %d reached at %"PRId64" microseconds\n",
+ ic->max_analyze_duration,
+ t);
break;
}
if (pkt->duration) {
st->info->codec_info_duration += pkt->duration;
- st->info->codec_info_duration_fields += st->parser && st->need_parsing && st->codec->ticks_per_frame==2 ? st->parser->repeat_pict + 1 : 2;
+ st->info->codec_info_duration_fields += st->parser && st->need_parsing && st->codec->ticks_per_frame ==2 ? st->parser->repeat_pict + 1 : 2;
}
}
#if FF_API_R_FRAME_RATE
ff_rfps_add_frame(ic, st, pkt->dts);
#endif
- if(st->parser && st->parser->parser->split && !st->codec->extradata){
- int i= st->parser->parser->split(st->codec, pkt->data, pkt->size);
+ if (st->parser && st->parser->parser->split && !st->codec->extradata) {
+ int i = st->parser->parser->split(st->codec, pkt->data, pkt->size);
if (i > 0 && i < FF_MAX_EXTRADATA_SIZE) {
if (ff_alloc_extradata(st->codec, i))
return AVERROR(ENOMEM);
- memcpy(st->codec->extradata, pkt->data, st->codec->extradata_size);
+ memcpy(st->codec->extradata, pkt->data,
+ st->codec->extradata_size);
}
}
- /* if still no information, we try to open the codec and to
- 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 CODEC_CAP_CHANNEL_CONF is set this will force decoding of at
- least one frame of codec data, this makes sure the codec initializes
- the channel configuration and does not only trust the values from the container.
- */
- try_decode_frame(ic, st, pkt, (options && i < orig_nb_streams ) ? &options[i] : NULL);
+ /* If still no information, we try to open the codec and to
+ * 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 CODEC_CAP_CHANNEL_CONF is set this will force decoding of at
+ * least one frame of codec data, this makes sure the codec initializes
+ * the channel configuration and does not only trust the values from
+ * the container. */
+ try_decode_frame(ic, st, pkt,
+ (options && i < orig_nb_streams) ? &options[i] : NULL);
st->codec_info_nb_frames++;
count++;
@@ -3056,7 +3312,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
int err = 0;
av_init_packet(&empty_pkt);
- for(i=0;i<ic->nb_streams;i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
@@ -3064,8 +3320,8 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
if (st->info->found_decoder == 1) {
do {
err = try_decode_frame(ic, st, &empty_pkt,
- (options && i < orig_nb_streams) ?
- &options[i] : NULL);
+ (options && i < orig_nb_streams)
+ ? &options[i] : NULL);
} while (err > 0 && !has_codec_parameters(st, NULL));
if (err < 0) {
@@ -3077,25 +3333,27 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
}
// close codecs which were opened in try_decode_frame()
- for(i=0;i<ic->nb_streams;i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
avcodec_close(st->codec);
}
ff_rfps_calculate(ic);
- for(i=0;i<ic->nb_streams;i++) {
+ for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
- if(st->codec->codec_id == AV_CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample){
+ if (st->codec->codec_id == AV_CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample) {
uint32_t tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
if (avpriv_find_pix_fmt(ff_raw_pix_fmt_tags, tag) == st->codec->pix_fmt)
st->codec->codec_tag= tag;
}
/* estimate average framerate if not set by demuxer */
- if (st->info->codec_info_duration_fields && !st->avg_frame_rate.num && st->info->codec_info_duration) {
- int best_fps = 0;
+ if (st->info->codec_info_duration_fields &&
+ !st->avg_frame_rate.num &&
+ st->info->codec_info_duration) {
+ int best_fps = 0;
double best_error = 0.01;
if (st->info->codec_info_duration >= INT64_MAX / st->time_base.num / 2||
@@ -3103,61 +3361,68 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
st->info->codec_info_duration < 0)
continue;
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
- st->info->codec_info_duration_fields*(int64_t)st->time_base.den,
- st->info->codec_info_duration*2*(int64_t)st->time_base.num, 60000);
+ st->info->codec_info_duration_fields * (int64_t) st->time_base.den,
+ st->info->codec_info_duration * 2 * (int64_t) st->time_base.num, 60000);
- /* round guessed framerate to a "standard" framerate if it's
- * within 1% of the original estimate*/
- for (j = 1; j < MAX_STD_TIMEBASES; j++) {
- AVRational std_fps = { get_std_framerate(j), 12*1001 };
- double error = fabs(av_q2d(st->avg_frame_rate) / av_q2d(std_fps) - 1);
+ /* Round guessed framerate to a "standard" framerate if it's
+ * within 1% of the original estimate. */
+ for (j = 0; j < MAX_STD_TIMEBASES; j++) {
+ AVRational std_fps = { get_std_framerate(j), 12 * 1001 };
+ double error = fabs(av_q2d(st->avg_frame_rate) /
+ av_q2d(std_fps) - 1);
if (error < best_error) {
best_error = error;
best_fps = std_fps.num;
}
}
- if (best_fps) {
+ if (best_fps)
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
- best_fps, 12*1001, INT_MAX);
- }
+ best_fps, 12 * 1001, INT_MAX);
}
- if (!st->r_frame_rate.num){
- if( st->codec->time_base.den * (int64_t)st->time_base.num
- <= st->codec->time_base.num * st->codec->ticks_per_frame * (int64_t)st->time_base.den){
+ if (!st->r_frame_rate.num) {
+ if ( st->codec->time_base.den * (int64_t) st->time_base.num
+ <= st->codec->time_base.num * st->codec->ticks_per_frame * (int64_t) st->time_base.den) {
st->r_frame_rate.num = st->codec->time_base.den;
st->r_frame_rate.den = st->codec->time_base.num * st->codec->ticks_per_frame;
- }else{
+ } else {
st->r_frame_rate.num = st->time_base.den;
st->r_frame_rate.den = st->time_base.num;
}
}
- }else if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
- if(!st->codec->bits_per_coded_sample)
- st->codec->bits_per_coded_sample= av_get_bits_per_sample(st->codec->codec_id);
+ } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
+ if (!st->codec->bits_per_coded_sample)
+ st->codec->bits_per_coded_sample =
+ av_get_bits_per_sample(st->codec->codec_id);
// set stream disposition based on audio service type
switch (st->codec->audio_service_type) {
case AV_AUDIO_SERVICE_TYPE_EFFECTS:
- st->disposition = AV_DISPOSITION_CLEAN_EFFECTS; break;
+ st->disposition = AV_DISPOSITION_CLEAN_EFFECTS;
+ break;
case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED:
- st->disposition = AV_DISPOSITION_VISUAL_IMPAIRED; break;
+ st->disposition = AV_DISPOSITION_VISUAL_IMPAIRED;
+ break;
case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED:
- st->disposition = AV_DISPOSITION_HEARING_IMPAIRED; break;
+ st->disposition = AV_DISPOSITION_HEARING_IMPAIRED;
+ break;
case AV_AUDIO_SERVICE_TYPE_COMMENTARY:
- st->disposition = AV_DISPOSITION_COMMENT; break;
+ st->disposition = AV_DISPOSITION_COMMENT;
+ break;
case AV_AUDIO_SERVICE_TYPE_KARAOKE:
- st->disposition = AV_DISPOSITION_KARAOKE; break;
+ st->disposition = AV_DISPOSITION_KARAOKE;
+ break;
}
}
}
- if(ic->probesize)
+ if (ic->probesize)
estimate_timings(ic, old_offset);
if (ret >= 0 && ic->nb_streams)
- ret = -1; /* we could not have all the codec parameters before EOF */
- for(i=0;i<ic->nb_streams;i++) {
+ /* We could not have all the codec parameters before EOF. */
+ ret = -1;
+ for (i = 0; i < ic->nb_streams; i++) {
const char *errmsg;
st = ic->streams[i];
if (!has_codec_parameters(st, &errmsg)) {
@@ -3174,16 +3439,16 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
compute_chapters_end(ic);
- find_stream_info_err:
- for (i=0; i < ic->nb_streams; i++) {
+find_stream_info_err:
+ for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
- if (ic->streams[i]->codec && ic->streams[i]->codec->codec_type != AVMEDIA_TYPE_AUDIO)
+ if (ic->streams[i]->codec->codec_type != AVMEDIA_TYPE_AUDIO)
ic->streams[i]->codec->thread_count = 0;
if (st->info)
av_freep(&st->info->duration_error);
av_freep(&ic->streams[i]->info);
}
- if(ic->pb)
+ if (ic->pb)
av_log(ic, AV_LOG_DEBUG, "After avformat_find_stream_info() pos: %"PRId64" bytes read:%"PRId64" seeks:%d frames:%d\n",
avio_tell(ic->pb), ic->pb->bytes_read, ic->pb->seek_count, count);
return ret;
@@ -3206,34 +3471,35 @@ AVProgram *av_find_program_from_stream(AVFormatContext *ic, AVProgram *last, int
return NULL;
}
-int av_find_best_stream(AVFormatContext *ic,
- enum AVMediaType type,
- int wanted_stream_nb,
- int related_stream,
- AVCodec **decoder_ret,
- int flags)
+int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
+ int wanted_stream_nb, int related_stream,
+ AVCodec **decoder_ret, int flags)
{
int i, nb_streams = ic->nb_streams;
int ret = AVERROR_STREAM_NOT_FOUND, best_count = -1, best_bitrate = -1, best_multiframe = -1, count, bitrate, multiframe;
unsigned *program = NULL;
- AVCodec *decoder = NULL, *best_decoder = NULL;
+ const AVCodec *decoder = NULL, *best_decoder = NULL;
if (related_stream >= 0 && wanted_stream_nb < 0) {
AVProgram *p = av_find_program_from_stream(ic, NULL, related_stream);
if (p) {
- program = p->stream_index;
+ program = p->stream_index;
nb_streams = p->nb_stream_indexes;
}
}
for (i = 0; i < nb_streams; i++) {
int real_stream_index = program ? program[i] : i;
- AVStream *st = ic->streams[real_stream_index];
+ AVStream *st = ic->streams[real_stream_index];
AVCodecContext *avctx = st->codec;
if (avctx->codec_type != type)
continue;
if (wanted_stream_nb >= 0 && real_stream_index != wanted_stream_nb)
continue;
- if (st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED|AV_DISPOSITION_VISUAL_IMPAIRED))
+ if (wanted_stream_nb != real_stream_index &&
+ st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED |
+ AV_DISPOSITION_VISUAL_IMPAIRED))
+ continue;
+ if (type == AVMEDIA_TYPE_AUDIO && !avctx->channels)
continue;
if (decoder_ret) {
decoder = find_decoder(ic, st, st->codec->codec_id);
@@ -3250,19 +3516,20 @@ int av_find_best_stream(AVFormatContext *ic,
(best_multiframe == multiframe && best_bitrate > bitrate) ||
(best_multiframe == multiframe && best_bitrate == bitrate && best_count >= count))
continue;
- best_count = count;
+ best_count = count;
best_bitrate = bitrate;
best_multiframe = multiframe;
- ret = real_stream_index;
+ ret = real_stream_index;
best_decoder = decoder;
if (program && i == nb_streams - 1 && ret < 0) {
- program = NULL;
+ program = NULL;
nb_streams = ic->nb_streams;
- i = 0; /* no related stream found, try again with everything */
+ /* no related stream found, try again with everything */
+ i = 0;
}
}
if (decoder_ret)
- *decoder_ret = best_decoder;
+ *decoder_ret = (AVCodec*)best_decoder;
return ret;
}
@@ -3286,9 +3553,15 @@ int av_read_pause(AVFormatContext *s)
return AVERROR(ENOSYS);
}
-void ff_free_stream(AVFormatContext *s, AVStream *st){
+void ff_free_stream(AVFormatContext *s, AVStream *st) {
+ int j;
av_assert0(s->nb_streams>0);
- av_assert0(s->streams[ s->nb_streams-1 ] == st);
+ av_assert0(s->streams[ s->nb_streams - 1 ] == st);
+
+ for (j = 0; j < st->nb_side_data; j++)
+ av_freep(&st->side_data[j].data);
+ av_freep(&st->side_data);
+ st->nb_side_data = 0;
if (st->parser) {
av_parser_close(st->parser);
@@ -3318,24 +3591,27 @@ void avformat_free_context(AVFormatContext *s)
av_opt_free(s);
if (s->iformat && s->iformat->priv_class && s->priv_data)
av_opt_free(s->priv_data);
+ if (s->oformat && s->oformat->priv_class && s->priv_data)
+ av_opt_free(s->priv_data);
- for(i=s->nb_streams-1; i>=0; i--) {
+ for (i = s->nb_streams - 1; i >= 0; i--) {
ff_free_stream(s, s->streams[i]);
}
- for(i=s->nb_programs-1; i>=0; i--) {
+ for (i = s->nb_programs - 1; i >= 0; i--) {
av_dict_free(&s->programs[i]->metadata);
av_freep(&s->programs[i]->stream_index);
av_freep(&s->programs[i]);
}
av_freep(&s->programs);
av_freep(&s->priv_data);
- while(s->nb_chapters--) {
+ while (s->nb_chapters--) {
av_dict_free(&s->chapters[s->nb_chapters]->metadata);
av_freep(&s->chapters[s->nb_chapters]);
}
av_freep(&s->chapters);
av_dict_free(&s->metadata);
av_freep(&s->streams);
+ av_freep(&s->internal);
av_free(s);
}
@@ -3354,7 +3630,7 @@ void avformat_close_input(AVFormatContext **ps)
if (!ps || !*ps)
return;
- s = *ps;
+ s = *ps;
pb = s->pb;
if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
@@ -3363,10 +3639,9 @@ void avformat_close_input(AVFormatContext **ps)
flush_packet_queue(s);
- if (s->iformat) {
+ if (s->iformat)
if (s->iformat->read_close)
s->iformat->read_close(s);
- }
avformat_free_context(s);
@@ -3408,19 +3683,18 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
st->info->last_dts = AV_NOPTS_VALUE;
st->codec = avcodec_alloc_context3(c);
- if (s->iformat) {
+ if (s->iformat)
/* no default bitrate if decoding */
st->codec->bit_rate = 0;
- }
- st->index = s->nb_streams;
+ st->index = s->nb_streams;
st->start_time = AV_NOPTS_VALUE;
- st->duration = AV_NOPTS_VALUE;
- /* we set the current DTS to 0 so that formats without any timestamps
- but durations get some timestamps, formats with some unknown
- timestamps have their first few packets buffered and the
- timestamps corrected before they are returned to the user */
- st->cur_dts = s->iformat ? RELATIVE_TS_BASE : 0;
- st->first_dts = AV_NOPTS_VALUE;
+ st->duration = AV_NOPTS_VALUE;
+ /* we set the current DTS to 0 so that formats without any timestamps
+ * but durations get some timestamps, formats with some unknown
+ * timestamps have their first few packets buffered and the
+ * timestamps corrected before they are returned to the user */
+ st->cur_dts = s->iformat ? RELATIVE_TS_BASE : 0;
+ st->first_dts = AV_NOPTS_VALUE;
st->probe_packets = MAX_PROBE_PACKETS;
st->pts_wrap_reference = AV_NOPTS_VALUE;
st->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
@@ -3428,10 +3702,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
/* default pts setting is MPEG-like */
avpriv_set_pts_info(st, 33, 1, 90000);
st->last_IP_pts = AV_NOPTS_VALUE;
- for(i=0; i<MAX_REORDER_DELAY+1; i++)
- st->pts_buffer[i]= AV_NOPTS_VALUE;
+ st->last_dts_for_order_check = AV_NOPTS_VALUE;
+ for (i = 0; i < MAX_REORDER_DELAY + 1; i++)
+ st->pts_buffer[i] = AV_NOPTS_VALUE;
- st->sample_aspect_ratio = (AVRational){0,1};
+ st->sample_aspect_ratio = (AVRational) { 0, 1 };
#if FF_API_R_FRAME_RATE
st->info->last_dts = AV_NOPTS_VALUE;
@@ -3439,22 +3714,24 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
st->info->fps_first_dts = AV_NOPTS_VALUE;
st->info->fps_last_dts = AV_NOPTS_VALUE;
+ st->inject_global_side_data = s->internal->inject_global_side_data;
+
s->streams[s->nb_streams++] = st;
return st;
}
AVProgram *av_new_program(AVFormatContext *ac, int id)
{
- AVProgram *program=NULL;
+ AVProgram *program = NULL;
int i;
av_dlog(ac, "new_program: id=0x%04x\n", id);
- for(i=0; i<ac->nb_programs; i++)
- if(ac->programs[i]->id == id)
+ for (i = 0; i < ac->nb_programs; i++)
+ if (ac->programs[i]->id == id)
program = ac->programs[i];
- if(!program){
+ if (!program) {
program = av_mallocz(sizeof(AVProgram));
if (!program)
return NULL;
@@ -3471,34 +3748,35 @@ AVProgram *av_new_program(AVFormatContext *ac, int id)
return program;
}
-AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base, int64_t start, int64_t end, const char *title)
+AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base,
+ int64_t start, int64_t end, const char *title)
{
AVChapter *chapter = NULL;
int i;
- for(i=0; i<s->nb_chapters; i++)
- if(s->chapters[i]->id == id)
+ for (i = 0; i < s->nb_chapters; i++)
+ if (s->chapters[i]->id == id)
chapter = s->chapters[i];
- if(!chapter){
- chapter= av_mallocz(sizeof(AVChapter));
- if(!chapter)
+ if (!chapter) {
+ chapter = av_mallocz(sizeof(AVChapter));
+ if (!chapter)
return NULL;
dynarray_add(&s->chapters, &s->nb_chapters, chapter);
}
av_dict_set(&chapter->metadata, "title", title, 0);
- chapter->id = id;
- chapter->time_base= time_base;
- chapter->start = start;
- chapter->end = end;
+ chapter->id = id;
+ chapter->time_base = time_base;
+ chapter->start = start;
+ chapter->end = end;
return chapter;
}
-void ff_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int idx)
+void ff_program_add_stream_index(AVFormatContext *ac, int progid, unsigned idx)
{
int i, j;
- AVProgram *program=NULL;
+ AVProgram *program = NULL;
void *tmp;
if (idx >= ac->nb_streams) {
@@ -3506,16 +3784,16 @@ void ff_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int i
return;
}
- for(i=0; i<ac->nb_programs; i++){
- if(ac->programs[i]->id != progid)
+ for (i = 0; i < ac->nb_programs; i++) {
+ if (ac->programs[i]->id != progid)
continue;
program = ac->programs[i];
- for(j=0; j<program->nb_stream_indexes; j++)
- if(program->stream_index[j] == idx)
+ for (j = 0; j < program->nb_stream_indexes; j++)
+ if (program->stream_index[j] == idx)
return;
tmp = av_realloc_array(program->stream_index, program->nb_stream_indexes+1, sizeof(unsigned int));
- if(!tmp)
+ if (!tmp)
return;
program->stream_index = tmp;
program->stream_index[program->nb_stream_indexes++] = idx;
@@ -3523,24 +3801,29 @@ void ff_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int i
}
}
-static void print_fps(double d, const char *postfix){
- uint64_t v= lrintf(d*100);
- if (v% 100 ) av_log(NULL, AV_LOG_INFO, ", %3.2f %s", d, postfix);
- else if(v%(100*1000)) av_log(NULL, AV_LOG_INFO, ", %1.0f %s", d, postfix);
- else av_log(NULL, AV_LOG_INFO, ", %1.0fk %s", d/1000, postfix);
+static void print_fps(double d, const char *postfix)
+{
+ uint64_t v = lrintf(d * 100);
+ if (v % 100)
+ av_log(NULL, AV_LOG_INFO, ", %3.2f %s", d, postfix);
+ else if (v % (100 * 1000))
+ av_log(NULL, AV_LOG_INFO, ", %1.0f %s", d, postfix);
+ else
+ av_log(NULL, AV_LOG_INFO, ", %1.0fk %s", d / 1000, postfix);
}
static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
{
- if(m && !(av_dict_count(m) == 1 && av_dict_get(m, "language", NULL, 0))){
- AVDictionaryEntry *tag=NULL;
+ if (m && !(av_dict_count(m) == 1 && av_dict_get(m, "language", NULL, 0))) {
+ AVDictionaryEntry *tag = NULL;
av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
- while((tag=av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) {
- if(strcmp("language", tag->key)){
+ while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX)))
+ if (strcmp("language", tag->key)) {
const char *p = tag->value;
- av_log(ctx, AV_LOG_INFO, "%s %-16s: ", indent, tag->key);
- while(*p) {
+ av_log(ctx, AV_LOG_INFO,
+ "%s %-16s: ", indent, tag->key);
+ while (*p) {
char tmp[256];
size_t len = strcspn(p, "\x8\xa\xb\xc\xd");
av_strlcpy(tmp, p, FFMIN(sizeof(tmp), len+1));
@@ -3552,12 +3835,12 @@ static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
}
av_log(ctx, AV_LOG_INFO, "\n");
}
- }
}
}
/* "user interface" functions */
-static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output)
+static void dump_stream_format(AVFormatContext *ic, int i,
+ int index, int is_output)
{
char buf[256];
int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
@@ -3572,30 +3855,31 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out
av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id);
if (lang)
av_log(NULL, AV_LOG_INFO, "(%s)", lang->value);
- av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->codec_info_nb_frames, st->time_base.num/g, st->time_base.den/g);
+ av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->codec_info_nb_frames,
+ st->time_base.num / g, st->time_base.den / g);
av_log(NULL, AV_LOG_INFO, ": %s", buf);
if (st->sample_aspect_ratio.num && // default
av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) {
AVRational display_aspect_ratio;
av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
- st->codec->width*st->sample_aspect_ratio.num,
- st->codec->height*st->sample_aspect_ratio.den,
- 1024*1024);
+ st->codec->width * st->sample_aspect_ratio.num,
+ st->codec->height * st->sample_aspect_ratio.den,
+ 1024 * 1024);
av_log(NULL, AV_LOG_INFO, ", SAR %d:%d DAR %d:%d",
- st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
- display_aspect_ratio.num, display_aspect_ratio.den);
+ st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
+ display_aspect_ratio.num, display_aspect_ratio.den);
}
- if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){
- if(st->avg_frame_rate.den && st->avg_frame_rate.num)
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (st->avg_frame_rate.den && st->avg_frame_rate.num)
print_fps(av_q2d(st->avg_frame_rate), "fps");
#if FF_API_R_FRAME_RATE
- if(st->r_frame_rate.den && st->r_frame_rate.num)
+ if (st->r_frame_rate.den && st->r_frame_rate.num)
print_fps(av_q2d(st->r_frame_rate), "tbr");
#endif
- if(st->time_base.den && st->time_base.num)
- print_fps(1/av_q2d(st->time_base), "tbn");
- if(st->codec->time_base.den && st->codec->time_base.num)
- print_fps(1/av_q2d(st->codec->time_base), "tbc");
+ if (st->time_base.den && st->time_base.num)
+ print_fps(1 / av_q2d(st->time_base), "tbn");
+ if (st->codec->time_base.den && st->codec->time_base.num)
+ print_fps(1 / av_q2d(st->codec->time_base), "tbc");
}
if (st->disposition & AV_DISPOSITION_DEFAULT)
av_log(NULL, AV_LOG_INFO, " (default)");
@@ -3621,10 +3905,8 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out
dump_metadata(NULL, st->metadata, " ");
}
-void av_dump_format(AVFormatContext *ic,
- int index,
- const char *url,
- int is_output)
+void av_dump_format(AVFormatContext *ic, int index,
+ const char *url, int is_output)
{
int i;
uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL;
@@ -3632,19 +3914,19 @@ void av_dump_format(AVFormatContext *ic,
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);
+ 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) {
int hours, mins, secs, us;
int64_t duration = ic->duration + 5000;
- secs = duration / AV_TIME_BASE;
- us = duration % AV_TIME_BASE;
- mins = secs / 60;
+ secs = duration / AV_TIME_BASE;
+ us = duration % AV_TIME_BASE;
+ mins = secs / 60;
secs %= 60;
hours = mins / 60;
mins %= 60;
@@ -3657,36 +3939,38 @@ void av_dump_format(AVFormatContext *ic,
int secs, us;
av_log(NULL, AV_LOG_INFO, ", start: ");
secs = ic->start_time / AV_TIME_BASE;
- us = abs(ic->start_time % AV_TIME_BASE);
+ us = abs(ic->start_time % AV_TIME_BASE);
av_log(NULL, AV_LOG_INFO, "%d.%06d",
- secs, (int)av_rescale(us, 1000000, AV_TIME_BASE));
+ secs, (int) av_rescale(us, 1000000, AV_TIME_BASE));
}
av_log(NULL, AV_LOG_INFO, ", bitrate: ");
- if (ic->bit_rate) {
- av_log(NULL, AV_LOG_INFO,"%d kb/s", ic->bit_rate / 1000);
- } else {
+ if (ic->bit_rate)
+ av_log(NULL, AV_LOG_INFO, "%d kb/s", ic->bit_rate / 1000);
+ else
av_log(NULL, AV_LOG_INFO, "N/A");
- }
av_log(NULL, AV_LOG_INFO, "\n");
}
for (i = 0; i < ic->nb_chapters; i++) {
AVChapter *ch = ic->chapters[i];
av_log(NULL, AV_LOG_INFO, " Chapter #%d.%d: ", index, i);
- av_log(NULL, AV_LOG_INFO, "start %f, ", ch->start * av_q2d(ch->time_base));
- av_log(NULL, AV_LOG_INFO, "end %f\n", ch->end * av_q2d(ch->time_base));
+ av_log(NULL, AV_LOG_INFO,
+ "start %f, ", ch->start * av_q2d(ch->time_base));
+ av_log(NULL, AV_LOG_INFO,
+ "end %f\n", ch->end * av_q2d(ch->time_base));
dump_metadata(NULL, ch->metadata, " ");
}
- if(ic->nb_programs) {
+ if (ic->nb_programs) {
int j, k, total = 0;
- for(j=0; j<ic->nb_programs; j++) {
+ for (j = 0; j < ic->nb_programs; j++) {
AVDictionaryEntry *name = av_dict_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 : "");
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);
+ for (k = 0; k < ic->programs[j]->nb_stream_indexes; k++) {
+ dump_stream_format(ic, ic->programs[j]->stream_index[k],
+ index, is_output);
printed[ic->programs[j]->stream_index[k]] = 1;
}
total += ic->programs[j]->nb_stream_indexes;
@@ -3694,7 +3978,7 @@ void av_dump_format(AVFormatContext *ic,
if (total < ic->nb_streams)
av_log(NULL, AV_LOG_INFO, " No Program\n");
}
- for(i=0;i<ic->nb_streams;i++)
+ for (i = 0; i < ic->nb_streams; i++)
if (!printed[i])
dump_stream_format(ic, i, index, is_output);
@@ -3703,11 +3987,10 @@ void av_dump_format(AVFormatContext *ic,
uint64_t ff_ntp_time(void)
{
- return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US;
+ return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US;
}
-int av_get_frame_filename(char *buf, int buf_size,
- const char *path, int number)
+int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
{
const char *p;
char *q, buf1[20], c;
@@ -3716,20 +3999,19 @@ int av_get_frame_filename(char *buf, int buf_size,
q = buf;
p = path;
percentd_found = 0;
- for(;;) {
+ for (;;) {
c = *p++;
if (c == '\0')
break;
if (c == '%') {
do {
nd = 0;
- while (av_isdigit(*p)) {
+ while (av_isdigit(*p))
nd = nd * 10 + *p++ - '0';
- }
c = *p++;
} while (av_isdigit(c));
- switch(c) {
+ switch (c) {
case '%':
goto addchar;
case 'd':
@@ -3747,7 +4029,7 @@ int av_get_frame_filename(char *buf, int buf_size,
goto fail;
}
} else {
- addchar:
+addchar:
if ((q - buf) < buf_size - 1)
*q++ = c;
}
@@ -3756,38 +4038,44 @@ int av_get_frame_filename(char *buf, int buf_size,
goto fail;
*q = '\0';
return 0;
- fail:
+fail:
*q = '\0';
return -1;
}
+#define HEXDUMP_PRINT(...) \
+ do { \
+ if (!f) \
+ av_log(avcl, level, __VA_ARGS__); \
+ else \
+ fprintf(f, __VA_ARGS__); \
+ } while (0)
+
static void hex_dump_internal(void *avcl, FILE *f, int level,
const uint8_t *buf, int size)
{
int len, i, j, c;
-#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) {
+ for (i = 0; i < size; i += 16) {
len = size - i;
if (len > 16)
len = 16;
- PRINT("%08x ", i);
- for(j=0;j<16;j++) {
+ HEXDUMP_PRINT("%08x ", i);
+ for (j = 0; j < 16; j++) {
if (j < len)
- PRINT(" %02x", buf[i+j]);
+ HEXDUMP_PRINT(" %02x", buf[i + j]);
else
- PRINT(" ");
+ HEXDUMP_PRINT(" ");
}
- PRINT(" ");
- for(j=0;j<len;j++) {
- c = buf[i+j];
+ HEXDUMP_PRINT(" ");
+ for (j = 0; j < len; j++) {
+ c = buf[i + j];
if (c < ' ' || c > '~')
c = '.';
- PRINT("%c", c);
+ HEXDUMP_PRINT("%c", c);
}
- PRINT("\n");
+ HEXDUMP_PRINT("\n");
}
-#undef PRINT
}
void av_hex_dump(FILE *f, const uint8_t *buf, int size)
@@ -3800,38 +4088,37 @@ void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
hex_dump_internal(avcl, NULL, level, buf, size);
}
-static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, int dump_payload, AVRational time_base)
+static void pkt_dump_internal(void *avcl, FILE *f, int level, const AVPacket *pkt,
+ int dump_payload, AVRational time_base)
{
-#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 & AV_PKT_FLAG_KEY) != 0));
- PRINT(" duration=%0.3f\n", pkt->duration * av_q2d(time_base));
+ HEXDUMP_PRINT("stream #%d:\n", pkt->stream_index);
+ HEXDUMP_PRINT(" keyframe=%d\n", (pkt->flags & AV_PKT_FLAG_KEY) != 0);
+ HEXDUMP_PRINT(" duration=%0.3f\n", pkt->duration * av_q2d(time_base));
/* DTS is _always_ valid after av_read_frame() */
- PRINT(" dts=");
+ HEXDUMP_PRINT(" dts=");
if (pkt->dts == AV_NOPTS_VALUE)
- PRINT("N/A");
+ HEXDUMP_PRINT("N/A");
else
- PRINT("%0.3f", pkt->dts * av_q2d(time_base));
+ HEXDUMP_PRINT("%0.3f", pkt->dts * av_q2d(time_base));
/* PTS may not be known if B-frames are present. */
- PRINT(" pts=");
+ HEXDUMP_PRINT(" pts=");
if (pkt->pts == AV_NOPTS_VALUE)
- PRINT("N/A");
+ HEXDUMP_PRINT("N/A");
else
- PRINT("%0.3f", pkt->pts * av_q2d(time_base));
- PRINT("\n");
- PRINT(" size=%d\n", pkt->size);
-#undef PRINT
+ HEXDUMP_PRINT("%0.3f", pkt->pts * av_q2d(time_base));
+ HEXDUMP_PRINT("\n");
+ HEXDUMP_PRINT(" size=%d\n", pkt->size);
if (dump_payload)
av_hex_dump(f, pkt->data, pkt->size);
}
-void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st)
+void av_pkt_dump2(FILE *f, const AVPacket *pkt, int dump_payload, const AVStream *st)
{
pkt_dump_internal(NULL, f, 0, pkt, dump_payload, st->time_base);
}
-void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
- AVStream *st)
+void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_payload,
+ const AVStream *st)
{
pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base);
}
@@ -3839,24 +4126,29 @@ void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
void av_url_split(char *proto, int proto_size,
char *authorization, int authorization_size,
char *hostname, int hostname_size,
- int *port_ptr,
- char *path, int path_size,
- const char *url)
+ int *port_ptr, char *path, int path_size, const char *url)
{
const char *p, *ls, *ls2, *at, *at2, *col, *brk;
- if (port_ptr) *port_ptr = -1;
- if (proto_size > 0) proto[0] = 0;
- if (authorization_size > 0) authorization[0] = 0;
- if (hostname_size > 0) hostname[0] = 0;
- if (path_size > 0) path[0] = 0;
+ if (port_ptr)
+ *port_ptr = -1;
+ if (proto_size > 0)
+ proto[0] = 0;
+ if (authorization_size > 0)
+ authorization[0] = 0;
+ if (hostname_size > 0)
+ hostname[0] = 0;
+ if (path_size > 0)
+ path[0] = 0;
/* parse protocol */
if ((p = strchr(url, ':'))) {
av_strlcpy(proto, url, FFMIN(proto_size, p + 1 - url));
p++; /* skip ':' */
- if (*p == '/') p++;
- if (*p == '/') p++;
+ if (*p == '/')
+ p++;
+ if (*p == '/')
+ p++;
} else {
/* no protocol means plain filename */
av_strlcpy(path, url, path_size);
@@ -3866,14 +4158,14 @@ void av_url_split(char *proto, int proto_size,
/* separate path from hostname */
ls = strchr(p, '/');
ls2 = strchr(p, '?');
- if(!ls)
+ if (!ls)
ls = ls2;
else if (ls && ls2)
ls = FFMIN(ls, ls2);
- if(ls)
+ if (ls)
av_strlcpy(path, ls, path_size);
else
- ls = &p[strlen(p)]; // XXX
+ ls = &p[strlen(p)]; // XXX
/* the rest is hostname, use that to parse auth/port */
if (ls != p) {
@@ -3894,7 +4186,8 @@ void av_url_split(char *proto, int proto_size,
} else if ((col = strchr(p, ':')) && col < ls) {
av_strlcpy(hostname, p,
FFMIN(col + 1 - p, hostname_size));
- if (port_ptr) *port_ptr = atoi(col + 1);
+ if (port_ptr)
+ *port_ptr = atoi(col + 1);
} else
av_strlcpy(hostname, p,
FFMIN(ls + 1 - p, hostname_size));
@@ -3914,7 +4207,7 @@ char *ff_data_to_hex(char *buff, const uint8_t *src, int s, int lowercase)
'c', 'd', 'e', 'f' };
const char *hex_table = lowercase ? hex_table_lc : hex_table_uc;
- for(i = 0; i < s; i++) {
+ for (i = 0; i < s; i++) {
buff[i * 2] = hex_table[src[i] >> 4];
buff[i * 2 + 1] = hex_table[src[i] & 0xF];
}
@@ -3927,7 +4220,7 @@ int ff_hex_to_data(uint8_t *data, const char *p)
int c, len, v;
len = 0;
- v = 1;
+ v = 1;
for (;;) {
p += strspn(p, SPACE_CHARS);
if (*p == '\0')
@@ -3962,17 +4255,23 @@ void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits,
unsigned int pts_num, unsigned int pts_den)
{
AVRational new_tb;
- if(av_reduce(&new_tb.num, &new_tb.den, pts_num, pts_den, INT_MAX)){
- if(new_tb.num != pts_num)
- av_log(NULL, AV_LOG_DEBUG, "st:%d removing common factor %d from timebase\n", s->index, pts_num/new_tb.num);
- }else
- av_log(NULL, AV_LOG_WARNING, "st:%d has too large timebase, reducing\n", s->index);
-
- if(new_tb.num <= 0 || new_tb.den <= 0) {
- av_log(NULL, AV_LOG_ERROR, "Ignoring attempt to set invalid timebase %d/%d for st:%d\n", new_tb.num, new_tb.den, s->index);
+ if (av_reduce(&new_tb.num, &new_tb.den, pts_num, pts_den, INT_MAX)) {
+ if (new_tb.num != pts_num)
+ av_log(NULL, AV_LOG_DEBUG,
+ "st:%d removing common factor %d from timebase\n",
+ s->index, pts_num / new_tb.num);
+ } else
+ av_log(NULL, AV_LOG_WARNING,
+ "st:%d has too large timebase, reducing\n", s->index);
+
+ if (new_tb.num <= 0 || new_tb.den <= 0) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Ignoring attempt to set invalid timebase %d/%d for st:%d\n",
+ new_tb.num, new_tb.den,
+ s->index);
return;
}
- s->time_base = new_tb;
+ s->time_base = new_tb;
av_codec_set_pkt_timebase(s->codec, new_tb);
s->pts_wrap_bits = pts_wrap_bits;
}
@@ -4034,16 +4333,15 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
int ff_find_stream_index(AVFormatContext *s, int id)
{
int i;
- for (i = 0; i < s->nb_streams; i++) {
+ for (i = 0; i < s->nb_streams; i++)
if (s->streams[i]->id == id)
return i;
- }
return -1;
}
int64_t ff_iso8601_to_unix_time(const char *datestr)
{
- struct tm time1 = {0}, time2 = {0};
+ struct tm time1 = { 0 }, time2 = { 0 };
char *ret1, *ret2;
ret1 = av_small_strptime(datestr, "%Y - %m - %d %H:%M:%S", &time1);
ret2 = av_small_strptime(datestr, "%Y - %m - %dT%H:%M:%S", &time2);
@@ -4053,14 +4351,16 @@ int64_t ff_iso8601_to_unix_time(const char *datestr)
return av_timegm(&time1);
}
-int avformat_query_codec(AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance)
+int avformat_query_codec(AVOutputFormat *ofmt, enum AVCodecID codec_id,
+ int std_compliance)
{
if (ofmt) {
if (ofmt->query_codec)
return ofmt->query_codec(codec_id, std_compliance);
else if (ofmt->codec_tag)
return !!av_codec_get_tag(ofmt->codec_tag, codec_id);
- else if (codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec ||
+ else if (codec_id == ofmt->video_codec ||
+ codec_id == ofmt->audio_codec ||
codec_id == ofmt->subtitle_codec)
return 1;
}
@@ -4098,19 +4398,19 @@ int ff_add_param_change(AVPacket *pkt, int32_t channels,
if (!pkt)
return AVERROR(EINVAL);
if (channels) {
- size += 4;
+ size += 4;
flags |= AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT;
}
if (channel_layout) {
- size += 8;
+ size += 8;
flags |= AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT;
}
if (sample_rate) {
- size += 4;
+ size += 4;
flags |= AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE;
}
if (width || height) {
- size += 8;
+ size += 8;
flags |= AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS;
}
data = av_packet_new_side_data(pkt, AV_PKT_DATA_PARAM_CHANGE, size);
@@ -4156,10 +4456,16 @@ AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *strea
AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *frame)
{
AVRational fr = st->r_frame_rate;
+ AVRational codec_fr = av_inv_q(st->codec->time_base);
+ AVRational avg_fr = st->avg_frame_rate;
+
+ if (avg_fr.num > 0 && avg_fr.den > 0 && fr.num > 0 && fr.den > 0 &&
+ av_q2d(avg_fr) < 70 && av_q2d(fr) > 210) {
+ fr = avg_fr;
+ }
+
if (st->codec->ticks_per_frame > 1) {
- AVRational codec_fr = av_inv_q(st->codec->time_base);
- AVRational avg_fr = st->avg_frame_rate;
codec_fr.den *= st->codec->ticks_per_frame;
if ( codec_fr.num > 0 && codec_fr.den > 0 && av_q2d(codec_fr) < av_q2d(fr)*0.7
&& fabs(1.0 - av_q2d(av_div_q(avg_fr, fr))) > 0.1)
@@ -4217,12 +4523,14 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
return 1;
}
return 0;
- } else if (*spec == '#') {
- int sid;
+ } else if (*spec == '#' ||
+ (*spec == 'i' && *(spec + 1) == ':')) {
+ int stream_id;
char *endptr;
- sid = strtol(spec + 1, &endptr, 0);
+ spec += 1 + (*spec == 'i');
+ stream_id = strtol(spec, &endptr, 0);
if (!*endptr)
- return st->id == sid;
+ return stream_id == st->id;
} else if (!*spec) /* empty specifier, matches everything */
return 1;
@@ -4299,7 +4607,7 @@ int ff_generate_avci_extradata(AVStream *st)
};
const uint8_t *data = NULL;
- int size = 0;
+ int size = 0;
if (st->codec->width == 1920) {
if (st->codec->field_order == AV_FIELD_PROGRESSIVE) {
diff --git a/chromium/third_party/ffmpeg/libavformat/vc1test.c b/chromium/third_party/ffmpeg/libavformat/vc1test.c
index bf1bfe0318e..e5303fa46e7 100644
--- a/chromium/third_party/ffmpeg/libavformat/vc1test.c
+++ b/chromium/third_party/ffmpeg/libavformat/vc1test.c
@@ -61,9 +61,8 @@ static int vc1t_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = AV_CODEC_ID_WMV3;
- if (ff_alloc_extradata(st->codec, VC1_EXTRADATA_SIZE))
+ if (ff_get_extradata(st->codec, pb, VC1_EXTRADATA_SIZE) < 0)
return AVERROR(ENOMEM);
- avio_read(pb, st->codec->extradata, VC1_EXTRADATA_SIZE);
st->codec->height = avio_rl32(pb);
st->codec->width = avio_rl32(pb);
if(avio_rl32(pb) != 0xC)
diff --git a/chromium/third_party/ffmpeg/libavformat/version.h b/chromium/third_party/ffmpeg/libavformat/version.h
index 4fe8364ab20..c6667ca7bfd 100644
--- a/chromium/third_party/ffmpeg/libavformat/version.h
+++ b/chromium/third_party/ffmpeg/libavformat/version.h
@@ -27,10 +27,10 @@
* Libavformat version macros
*/
-#include "libavutil/avutil.h"
+#include "libavutil/version.h"
#define LIBAVFORMAT_VERSION_MAJOR 55
-#define LIBAVFORMAT_VERSION_MINOR 22
+#define LIBAVFORMAT_VERSION_MINOR 38
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
@@ -51,6 +51,9 @@
#ifndef FF_API_REFERENCE_DTS
#define FF_API_REFERENCE_DTS (LIBAVFORMAT_VERSION_MAJOR < 56)
#endif
+#ifndef FF_API_LAVF_BITEXACT
+#define FF_API_LAVF_BITEXACT (LIBAVFORMAT_VERSION_MAJOR < 56)
+#endif
#ifndef FF_API_ALLOC_OUTPUT_CONTEXT
#define FF_API_ALLOC_OUTPUT_CONTEXT (LIBAVFORMAT_VERSION_MAJOR < 56)
diff --git a/chromium/third_party/ffmpeg/libavformat/vqf.c b/chromium/third_party/ffmpeg/libavformat/vqf.c
index 526b5961461..74c7f5fc172 100644
--- a/chromium/third_party/ffmpeg/libavformat/vqf.c
+++ b/chromium/third_party/ffmpeg/libavformat/vqf.c
@@ -249,7 +249,7 @@ static int vqf_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->data[1] = c->last_frame_bits;
ret = avio_read(s->pb, pkt->data+2, size);
- if (ret<=0) {
+ if (ret != size) {
av_free_packet(pkt);
return AVERROR(EIO);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/wavdec.c b/chromium/third_party/ffmpeg/libavformat/wavdec.c
index daea64edc5a..a865b760b78 100644
--- a/chromium/third_party/ffmpeg/libavformat/wavdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/wavdec.c
@@ -114,7 +114,7 @@ static void handle_stream_probing(AVStream *st)
{
if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
st->request_probe = AVPROBE_SCORE_EXTENSION;
- st->probe_packets = FFMIN(st->probe_packets, 4);
+ st->probe_packets = FFMIN(st->probe_packets, 14);
}
}
diff --git a/chromium/third_party/ffmpeg/libavformat/wavenc.c b/chromium/third_party/ffmpeg/libavformat/wavenc.c
index 0067dfef29b..c892c7b34db 100644
--- a/chromium/third_party/ffmpeg/libavformat/wavenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/wavenc.c
@@ -126,7 +126,7 @@ static int wav_write_header(AVFormatContext *s)
avio_wl32(pb, -1); /* RF64 chunk size: use size in ds64 */
} else {
ffio_wfourcc(pb, "RIFF");
- avio_wl32(pb, 0); /* file length */
+ avio_wl32(pb, -1); /* file length */
}
ffio_wfourcc(pb, "WAVE");
@@ -141,7 +141,7 @@ static int wav_write_header(AVFormatContext *s)
/* format header */
fmt = ff_start_tag(pb, "fmt ");
- if (ff_put_wav_header(pb, s->streams[0]->codec) < 0) {
+ if (ff_put_wav_header(pb, s->streams[0]->codec, 0) < 0) {
av_log(s, AV_LOG_ERROR, "%s codec not supported in WAVE format\n",
s->streams[0]->codec->codec ? s->streams[0]->codec->codec->name : "NONE");
return -1;
@@ -323,7 +323,7 @@ static int w64_write_header(AVFormatContext *s)
avio_wl64(pb, -1);
avio_write(pb, ff_w64_guid_wave, sizeof(ff_w64_guid_wave));
start_guid(pb, ff_w64_guid_fmt, &start);
- if ((ret = ff_put_wav_header(pb, s->streams[0]->codec)) < 0) {
+ if ((ret = ff_put_wav_header(pb, s->streams[0]->codec, 0)) < 0) {
av_log(s, AV_LOG_ERROR, "%s codec not supported\n",
s->streams[0]->codec->codec ? s->streams[0]->codec->codec->name : "NONE");
return ret;
diff --git a/chromium/third_party/ffmpeg/libavformat/wc3movie.c b/chromium/third_party/ffmpeg/libavformat/wc3movie.c
index 657380a6be1..408c050b7c7 100644
--- a/chromium/third_party/ffmpeg/libavformat/wc3movie.c
+++ b/chromium/third_party/ffmpeg/libavformat/wc3movie.c
@@ -27,6 +27,7 @@
* http://www.pcisys.net/~melanson/codecs/
*/
+#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
@@ -249,10 +250,16 @@ static int wc3_read_packet(AVFormatContext *s,
else {
int i = 0;
av_log (s, AV_LOG_DEBUG, "Subtitle time!\n");
+ if (i >= size || av_strnlen(&text[i + 1], size - i - 1) >= size - i - 1)
+ return AVERROR_INVALIDDATA;
av_log (s, AV_LOG_DEBUG, " inglish: %s\n", &text[i + 1]);
i += text[i] + 1;
+ if (i >= size || av_strnlen(&text[i + 1], size - i - 1) >= size - i - 1)
+ return AVERROR_INVALIDDATA;
av_log (s, AV_LOG_DEBUG, " doytsch: %s\n", &text[i + 1]);
i += text[i] + 1;
+ if (i >= size || av_strnlen(&text[i + 1], size - i - 1) >= size - i - 1)
+ return AVERROR_INVALIDDATA;
av_log (s, AV_LOG_DEBUG, " fronsay: %s\n", &text[i + 1]);
}
#endif
diff --git a/chromium/third_party/ffmpeg/libavformat/webvttdec.c b/chromium/third_party/ffmpeg/libavformat/webvttdec.c
index 065448532d3..e457e8f6d21 100644
--- a/chromium/third_party/ffmpeg/libavformat/webvttdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/webvttdec.c
@@ -119,7 +119,7 @@ static int webvtt_read_header(AVFormatContext *s)
break;
if (!(p = strstr(p, "-->")))
break;
- p += 3;
+ p += 2;
do p++; while (*p == ' ' || *p == '\t');
if ((ts_end = read_ts(p)) == AV_NOPTS_VALUE)
break;
diff --git a/chromium/third_party/ffmpeg/libavformat/westwood_vqa.c b/chromium/third_party/ffmpeg/libavformat/westwood_vqa.c
index 1d4bb5ad6c6..2a988ad3900 100644
--- a/chromium/third_party/ffmpeg/libavformat/westwood_vqa.c
+++ b/chromium/third_party/ffmpeg/libavformat/westwood_vqa.c
@@ -101,13 +101,9 @@ static int wsvqa_read_header(AVFormatContext *s)
avio_seek(pb, 20, SEEK_SET);
/* the VQA header needs to go to the decoder */
- if (ff_alloc_extradata(st->codec, VQA_HEADER_SIZE))
+ if (ff_get_extradata(st->codec, pb, VQA_HEADER_SIZE) < 0)
return AVERROR(ENOMEM);
header = (uint8_t *)st->codec->extradata;
- if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
- VQA_HEADER_SIZE) {
- return AVERROR(EIO);
- }
st->codec->width = AV_RL16(&header[6]);
st->codec->height = AV_RL16(&header[8]);
fps = header[12];
diff --git a/chromium/third_party/ffmpeg/libavformat/wtv.h b/chromium/third_party/ffmpeg/libavformat/wtv.h
index efe90d68466..f26ad5efb90 100644
--- a/chromium/third_party/ffmpeg/libavformat/wtv.h
+++ b/chromium/third_party/ffmpeg/libavformat/wtv.h
@@ -55,4 +55,6 @@ extern const ff_asf_guid ff_mediasubtype_cpfilters_processed;
extern const ff_asf_guid ff_format_cpfilters_processed;
extern const ff_asf_guid ff_format_waveformatex;
extern const ff_asf_guid ff_format_mpeg2_video;
+extern const ff_asf_guid ff_format_videoinfo2;
+
#endif /* AVFORMAT_WTV_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/wtv_common.c b/chromium/third_party/ffmpeg/libavformat/wtv_common.c
index 5b1e61b810b..ce4349dce54 100644
--- a/chromium/third_party/ffmpeg/libavformat/wtv_common.c
+++ b/chromium/third_party/ffmpeg/libavformat/wtv_common.c
@@ -75,6 +75,8 @@ const ff_asf_guid ff_format_waveformatex =
{0x81,0x9F,0x58,0x05,0x56,0xC3,0xCE,0x11,0xBF,0x01,0x00,0xAA,0x00,0x55,0x59,0x5A};
const ff_asf_guid ff_format_mpeg2_video =
{0xE3,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA};
+const ff_asf_guid ff_format_videoinfo2 =
+ {0xA0,0x76,0x2A,0xF7,0x0A,0xEB,0xD0,0x11,0xAC,0xE4,0x00,0x00,0xC0,0xCC,0x16,0xBA};
const AVCodecGuid ff_video_guids[] = {
{AV_CODEC_ID_MPEG2VIDEO, {0x26,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA}},
diff --git a/chromium/third_party/ffmpeg/libavformat/wtvdec.c b/chromium/third_party/ffmpeg/libavformat/wtvdec.c
index 4dfe7010d12..cfdc55523a8 100644
--- a/chromium/third_party/ffmpeg/libavformat/wtvdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/wtvdec.c
@@ -25,6 +25,8 @@
* @author Peter Ross <pross@xvid.org>
*/
+#include <inttypes.h>
+
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
@@ -35,7 +37,7 @@
/* Macros for formating GUIDs */
#define PRI_PRETTY_GUID \
- "%08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x"
+ "%08"PRIx32"-%04"PRIx16"-%04"PRIx16"-%02x%02x%02x%02x%02x%02x%02x%02x"
#define ARG_PRETTY_GUID(g) \
AV_RL32(g),AV_RL16(g+4),AV_RL16(g+6),g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]
#define LEN_PRETTY_GUID 34
@@ -153,6 +155,7 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
AVIOContext *pb;
WtvFile *wf;
uint8_t *buffer;
+ int64_t size;
if (seek_by_sector(s->pb, first_sector, 0) < 0)
return NULL;
@@ -205,7 +208,8 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
return NULL;
}
- if ((int64_t)wf->sectors[wf->nb_sectors - 1] << WTV_SECTOR_BITS > avio_tell(s->pb))
+ size = avio_size(s->pb);
+ if (size >= 0 && (int64_t)wf->sectors[wf->nb_sectors - 1] << WTV_SECTOR_BITS > size)
av_log(s, AV_LOG_WARNING, "truncated file\n");
/* check length */
@@ -370,10 +374,6 @@ static const ff_asf_guid mediasubtype_dtvccdata =
static const ff_asf_guid mediasubtype_mpeg2_sections =
{0x79,0x85,0x9F,0x4A,0xF8,0x6B,0x92,0x43,0x8A,0x6D,0xD2,0xDD,0x09,0xFA,0x78,0x61};
-/* Formats */
-static const ff_asf_guid format_videoinfo2 =
- {0xA0,0x76,0x2A,0xF7,0x0A,0xEB,0xD0,0x11,0xAC,0xE4,0x00,0x00,0xC0,0xCC,0x16,0xBA};
-
static int read_probe(AVProbeData *p)
{
return ff_guidcmp(p->buf, ff_wtv_guid) ? 0 : AVPROBE_SCORE_MAX;
@@ -473,7 +473,7 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty
return;
if (type == 0 && length == 4) {
- snprintf(buf, buf_size, "%"PRIi32, avio_rl32(pb));
+ snprintf(buf, buf_size, "%u", avio_rl32(pb));
} else if (type == 1) {
avio_get_str16le(pb, length, buf, buf_size);
if (!strlen(buf)) {
@@ -562,7 +562,7 @@ static int parse_videoinfoheader2(AVFormatContext *s, AVStream *st)
AVIOContext *pb = wtv->pb;
avio_skip(pb, 72); // picture aspect ratio is unreliable
- ff_get_bmp_header(pb, st, NULL);
+ st->codec->codec_tag = ff_get_bmp_header(pb, st, NULL);
return 72 + 40;
}
@@ -635,7 +635,7 @@ static AVStream * new_stream(AVFormatContext *s, AVStream *st, int sid, int code
*/
static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
ff_asf_guid mediatype, ff_asf_guid subtype,
- ff_asf_guid formattype, int size)
+ ff_asf_guid formattype, uint64_t size)
{
WtvContext *wtv = s->priv_data;
AVIOContext *pb = wtv->pb;
@@ -689,11 +689,12 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
st = new_stream(s, st, sid, AVMEDIA_TYPE_VIDEO);
if (!st)
return NULL;
- if (!ff_guidcmp(formattype, format_videoinfo2)) {
+ if (!ff_guidcmp(formattype, ff_format_videoinfo2)) {
int consumed = parse_videoinfoheader2(s, st);
avio_skip(pb, FFMAX(size - consumed, 0));
} else if (!ff_guidcmp(formattype, ff_format_mpeg2_video)) {
- int consumed = parse_videoinfoheader2(s, st);
+ uint64_t consumed = parse_videoinfoheader2(s, st);
+ /* ignore extradata; files produced by windows media center contain meaningless mpeg1 sequence header */
avio_skip(pb, FFMAX(size - consumed, 0));
} else {
if (ff_guidcmp(formattype, ff_format_none))
diff --git a/chromium/third_party/ffmpeg/libavformat/wtvenc.c b/chromium/third_party/ffmpeg/libavformat/wtvenc.c
index 04e6cc22f8d..634545d4594 100644
--- a/chromium/third_party/ffmpeg/libavformat/wtvenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/wtvenc.c
@@ -30,8 +30,8 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mpegts.h"
#include "wtv.h"
-#include "asf.h"
#define WTV_BIGSECTOR_SIZE (1 << WTV_BIGSECTOR_BITS)
#define INDEX_BASE 0x2
@@ -130,16 +130,6 @@ typedef struct {
#define write_pad(pb, size) ffio_fill(pb, 0, size)
-static const ff_asf_guid *get_codec_guid(enum AVCodecID id, const AVCodecGuid *av_guid)
-{
- int i;
- for (i = 0; av_guid[i].id != AV_CODEC_ID_NONE; i++) {
- if (id == av_guid[i].id)
- return &(av_guid[i].guid);
- }
- return NULL;
-}
-
/**
* Write chunk header. If header chunk (0x80000000 set) then add to list of header chunks
*/
@@ -223,10 +213,53 @@ static void finish_chunk(AVFormatContext *s)
write_index(s);
}
+static void put_videoinfoheader2(AVIOContext *pb, AVStream *st)
+{
+ AVRational dar = av_mul_q(st->sample_aspect_ratio, (AVRational){st->codec->width, st->codec->height});
+ unsigned int num, den;
+ av_reduce(&num, &den, dar.num, dar.den, 0xFFFFFFFF);
+
+ /* VIDEOINFOHEADER2 */
+ avio_wl32(pb, 0);
+ avio_wl32(pb, 0);
+ avio_wl32(pb, st->codec->width);
+ avio_wl32(pb, st->codec->height);
+
+ avio_wl32(pb, 0);
+ avio_wl32(pb, 0);
+ avio_wl32(pb, 0);
+ avio_wl32(pb, 0);
+
+ avio_wl32(pb, st->codec->bit_rate);
+ avio_wl32(pb, 0);
+ avio_wl64(pb, st->avg_frame_rate.num && st->avg_frame_rate.den ? INT64_C(10000000) / av_q2d(st->avg_frame_rate) : 0);
+ avio_wl32(pb, 0);
+ avio_wl32(pb, 0);
+
+ avio_wl32(pb, num);
+ avio_wl32(pb, den);
+ avio_wl32(pb, 0);
+ avio_wl32(pb, 0);
+
+ ff_put_bmp_header(pb, st->codec, ff_codec_bmp_tags, 0, 1);
+
+ if (st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
+ int padding = (st->codec->extradata_size & 3) ? 4 - (st->codec->extradata_size & 3) : 0;
+ /* MPEG2VIDEOINFO */
+ avio_wl32(pb, 0);
+ avio_wl32(pb, st->codec->extradata_size + padding);
+ avio_wl32(pb, -1);
+ avio_wl32(pb, -1);
+ avio_wl32(pb, 0);
+ avio_write(pb, st->codec->extradata, st->codec->extradata_size);
+ ffio_fill(pb, 0, padding);
+ }
+}
+
static int write_stream_codec_info(AVFormatContext *s, AVStream *st)
{
- WtvContext *wctx = s->priv_data;
const ff_asf_guid *g, *media_type, *format_type;
+ const AVCodecTag *tags;
AVIOContext *pb = s->pb;
int64_t hdr_pos_start;
int hdr_size = 0;
@@ -234,21 +267,18 @@ static int write_stream_codec_info(AVFormatContext *s, AVStream *st)
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
g = get_codec_guid(st->codec->codec_id, ff_video_guids);
media_type = &ff_mediatype_video;
- format_type = &ff_format_mpeg2_video;
+ format_type = st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO ? &ff_format_mpeg2_video : &ff_format_videoinfo2;
+ tags = ff_codec_bmp_tags;
} else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
g = get_codec_guid(st->codec->codec_id, ff_codec_wav_guids);
media_type = &ff_mediatype_audio;
format_type = &ff_format_waveformatex;
+ tags = ff_codec_wav_tags;
} else {
av_log(s, AV_LOG_ERROR, "unknown codec_type (0x%x)\n", st->codec->codec_type);
return -1;
}
- if (g == NULL) {
- av_log(s, AV_LOG_ERROR, "can't get video codec_id (0x%x) guid.\n", st->codec->codec_id);
- return -1;
- }
-
ff_put_guid(pb, media_type); // mediatype
ff_put_guid(pb, &ff_mediasubtype_cpfilters_processed); // subtype
write_pad(pb, 12);
@@ -257,15 +287,10 @@ static int write_stream_codec_info(AVFormatContext *s, AVStream *st)
hdr_pos_start = avio_tell(pb);
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
- if (wctx->first_video_flag) {
- write_pad(pb, 216); //The size is sensitive.
- wctx->first_video_flag = 0;
- } else {
- write_pad(pb, 72); // aspect ratio
- ff_put_bmp_header(pb, st->codec, ff_codec_bmp_tags, 0);
- }
+ put_videoinfoheader2(pb, st);
} else {
- ff_put_wav_header(pb, st->codec);
+ if (ff_put_wav_header(pb, st->codec, 0) < 0)
+ format_type = &ff_format_none;
}
hdr_size = avio_tell(pb) - hdr_pos_start;
@@ -273,7 +298,17 @@ static int write_stream_codec_info(AVFormatContext *s, AVStream *st)
avio_seek(pb, -(hdr_size + 4), SEEK_CUR);
avio_wl32(pb, hdr_size + 32);
avio_seek(pb, hdr_size, SEEK_CUR);
- ff_put_guid(pb, g); // actual_subtype
+ if (g) {
+ ff_put_guid(pb, g); // actual_subtype
+ } else {
+ int tag = ff_codec_get_tag(tags, st->codec->codec_id);
+ if (!tag) {
+ av_log(s, AV_LOG_ERROR, "unsupported codec_id (0x%x)\n", st->codec->codec_id);
+ return -1;
+ }
+ avio_wl32(pb, tag);
+ avio_write(pb, (const uint8_t[]){FF_MEDIASUBTYPE_BASE_GUID}, 12);
+ }
ff_put_guid(pb, format_type); // actual_formattype
return 0;
@@ -426,10 +461,15 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
{
AVIOContext *pb = s->pb;
WtvContext *wctx = s->priv_data;
+ AVStream *st = s->streams[pkt->stream_index];
- if (s->streams[pkt->stream_index]->codec->codec_id == AV_CODEC_ID_MJPEG && !wctx->thumbnail.size) {
+ if (st->codec->codec_id == AV_CODEC_ID_MJPEG && !wctx->thumbnail.size) {
av_copy_packet(&wctx->thumbnail, pkt);
return 0;
+ } else if (st->codec->codec_id == AV_CODEC_ID_H264) {
+ int ret = ff_check_h264_startcode(s, st, pkt);
+ if (ret < 0)
+ return ret;
}
/* emit sync chunk and 'timeline.table.0.entries.Event' record every 50 frames */
diff --git a/chromium/third_party/ffmpeg/libavformat/xmv.c b/chromium/third_party/ffmpeg/libavformat/xmv.c
index 20f9bea55bc..6eac4d21e84 100644
--- a/chromium/third_party/ffmpeg/libavformat/xmv.c
+++ b/chromium/third_party/ffmpeg/libavformat/xmv.c
@@ -25,7 +25,7 @@
* Microsoft XMV demuxer
*/
-#include <stdint.h>
+#include <inttypes.h>
#include "libavutil/intreadwrite.h"
@@ -155,7 +155,7 @@ static int xmv_read_header(AVFormatContext *s)
file_version = avio_rl32(pb);
if ((file_version != 4) && (file_version != 2))
- avpriv_request_sample(s, "Uncommon version %d", file_version);
+ avpriv_request_sample(s, "Uncommon version %"PRIu32"", file_version);
/* Video track */
@@ -182,7 +182,7 @@ static int xmv_read_header(AVFormatContext *s)
avio_skip(pb, 2); /* Unknown (padding?) */
- xmv->audio = av_malloc(xmv->audio_track_count * sizeof(XMVAudioPacket));
+ xmv->audio = av_malloc_array(xmv->audio_track_count, sizeof(XMVAudioPacket));
if (!xmv->audio) {
ret = AVERROR(ENOMEM);
goto fail;
@@ -219,7 +219,7 @@ static int xmv_read_header(AVFormatContext *s)
if (!packet->channels || !packet->sample_rate ||
packet->channels >= UINT16_MAX / XMV_BLOCK_ALIGN_SIZE) {
- av_log(s, AV_LOG_ERROR, "Invalid parameters for audio track %d.\n",
+ av_log(s, AV_LOG_ERROR, "Invalid parameters for audio track %"PRIu16".\n",
audio_track);
ret = AVERROR_INVALIDDATA;
goto fail;
diff --git a/chromium/third_party/ffmpeg/libavformat/xwma.c b/chromium/third_party/ffmpeg/libavformat/xwma.c
index e629b3f3844..127c097c449 100644
--- a/chromium/third_party/ffmpeg/libavformat/xwma.c
+++ b/chromium/third_party/ffmpeg/libavformat/xwma.c
@@ -46,7 +46,7 @@ static int xwma_read_header(AVFormatContext *s)
int64_t size;
int ret;
uint32_t dpds_table_size = 0;
- uint32_t *dpds_table = 0;
+ uint32_t *dpds_table = NULL;
unsigned int tag;
AVIOContext *pb = s->pb;
AVStream *st;
@@ -130,8 +130,10 @@ static int xwma_read_header(AVFormatContext *s)
/* parse the remaining RIFF chunks */
for (;;) {
- if (pb->eof_reached)
- return -1;
+ if (pb->eof_reached) {
+ ret = AVERROR_EOF;
+ goto end;
+ }
/* read next chunk tag */
tag = avio_rl32(pb);
size = avio_rl32(pb);
@@ -152,7 +154,8 @@ static int xwma_read_header(AVFormatContext *s)
/* Error out if there is more than one dpds chunk. */
if (dpds_table) {
av_log(s, AV_LOG_ERROR, "two dpds chunks present\n");
- return -1;
+ ret = AVERROR_INVALIDDATA;
+ goto end;
}
/* Compute the number of entries in the dpds chunk. */
@@ -164,7 +167,7 @@ static int xwma_read_header(AVFormatContext *s)
if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {
av_log(s, AV_LOG_ERROR,
"dpds chunk size %"PRId64" invalid\n", size);
- return -1;
+ return AVERROR_INVALIDDATA;
}
/* Allocate some temporary storage to keep the dpds data around.
@@ -184,8 +187,10 @@ static int xwma_read_header(AVFormatContext *s)
}
/* Determine overall data length */
- if (size < 0)
- return -1;
+ if (size < 0) {
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
if (!size) {
xwma->data_end = INT64_MAX;
} else
@@ -204,7 +209,8 @@ static int xwma_read_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR,
"Invalid bits_per_coded_sample %d for %d channels\n",
st->codec->bits_per_coded_sample, st->codec->channels);
- return AVERROR_INVALIDDATA;
+ ret = AVERROR_INVALIDDATA;
+ goto end;
}
st->duration = total_decoded_bytes / bytes_per_sample;
@@ -239,9 +245,10 @@ static int xwma_read_header(AVFormatContext *s)
st->duration = (size<<3) * st->codec->sample_rate / st->codec->bit_rate;
}
+end:
av_free(dpds_table);
- return 0;
+ return ret;
}
static int xwma_read_packet(AVFormatContext *s, AVPacket *pkt)
diff --git a/chromium/third_party/ffmpeg/libavformat/yuv4mpeg.c b/chromium/third_party/ffmpeg/libavformat/yuv4mpeg.c
index 1999c733642..bc07b4c55de 100644
--- a/chromium/third_party/ffmpeg/libavformat/yuv4mpeg.c
+++ b/chromium/third_party/ffmpeg/libavformat/yuv4mpeg.c
@@ -517,6 +517,7 @@ static int yuv4_read_header(AVFormatContext *s)
st->codec->height = height;
av_reduce(&raten, &rated, raten, rated, (1UL << 31) - 1);
avpriv_set_pts_info(st, 64, rated, raten);
+ st->avg_frame_rate = av_inv_q(st->time_base);
st->codec->pix_fmt = pix_fmt;
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
diff --git a/chromium/third_party/ffmpeg/libavresample/Makefile b/chromium/third_party/ffmpeg/libavresample/Makefile
index bca23a9844b..7d857a0e368 100644
--- a/chromium/third_party/ffmpeg/libavresample/Makefile
+++ b/chromium/third_party/ffmpeg/libavresample/Makefile
@@ -1,5 +1,4 @@
NAME = avresample
-FFLIBS = avutil
HEADERS = avresample.h \
version.h \
diff --git a/chromium/third_party/ffmpeg/libavresample/aarch64/Makefile b/chromium/third_party/ffmpeg/libavresample/aarch64/Makefile
new file mode 100644
index 00000000000..1d9e5f8ca00
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavresample/aarch64/Makefile
@@ -0,0 +1,7 @@
+OBJS += aarch64/audio_convert_init.o \
+ aarch64/resample_init.o \
+
+OBJS-$(CONFIG_NEON_CLOBBER_TEST) += aarch64/neontest.o
+
+NEON-OBJS += aarch64/audio_convert_neon.o \
+ aarch64/resample_neon.o \
diff --git a/chromium/third_party/ffmpeg/libavresample/aarch64/asm-offsets.h b/chromium/third_party/ffmpeg/libavresample/aarch64/asm-offsets.h
new file mode 100644
index 00000000000..0b582446f6a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavresample/aarch64/asm-offsets.h
@@ -0,0 +1,28 @@
+/*
+ * 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 AVRESAMPLE_AARCH64_ASM_OFFSETS_H
+#define AVRESAMPLE_AARCH64_ASM_OFFSETS_H
+
+/* struct ResampleContext */
+#define FILTER_BANK 0x10
+#define FILTER_LENGTH 0x18
+#define PHASE_SHIFT 0x34
+#define PHASE_MASK (PHASE_SHIFT + 0x04) // loaded as pair
+
+#endif /* AVRESAMPLE_AARCH64_ASM_OFFSETS_H */
diff --git a/chromium/third_party/ffmpeg/libavresample/aarch64/audio_convert_init.c b/chromium/third_party/ffmpeg/libavresample/aarch64/audio_convert_init.c
new file mode 100644
index 00000000000..b5b0d1eee0f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavresample/aarch64/audio_convert_init.c
@@ -0,0 +1,49 @@
+/*
+ * 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 "config.h"
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavutil/samplefmt.h"
+#include "libavresample/audio_convert.h"
+
+void ff_conv_flt_to_s16_neon(int16_t *dst, const float *src, int len);
+void ff_conv_fltp_to_s16_neon(int16_t *dst, float *const *src,
+ int len, int channels);
+void ff_conv_fltp_to_s16_2ch_neon(int16_t *dst, float *const *src,
+ int len, int channels);
+
+av_cold void ff_audio_convert_init_aarch64(AudioConvert *ac)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT,
+ 0, 16, 8, "NEON",
+ ff_conv_flt_to_s16_neon);
+ ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
+ 2, 16, 8, "NEON",
+ ff_conv_fltp_to_s16_2ch_neon);
+ ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
+ 0, 16, 8, "NEON",
+ ff_conv_fltp_to_s16_neon);
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavresample/aarch64/audio_convert_neon.S b/chromium/third_party/ffmpeg/libavresample/aarch64/audio_convert_neon.S
new file mode 100644
index 00000000000..e13e277e615
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavresample/aarch64/audio_convert_neon.S
@@ -0,0 +1,363 @@
+/*
+ * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
+ * Copyright (c) 2014 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "config.h"
+#include "libavutil/aarch64/asm.S"
+
+function ff_conv_flt_to_s16_neon, export=1
+ subs x2, x2, #8
+ ld1 {v0.4s}, [x1], #16
+ fcvtzs v4.4s, v0.4s, #31
+ ld1 {v1.4s}, [x1], #16
+ fcvtzs v5.4s, v1.4s, #31
+ b.eq 3f
+ ands x12, x2, #~15
+ b.eq 2f
+1: subs x12, x12, #16
+ sqrshrn v4.4h, v4.4s, #16
+ ld1 {v2.4s}, [x1], #16
+ fcvtzs v6.4s, v2.4s, #31
+ sqrshrn2 v4.8h, v5.4s, #16
+ ld1 {v3.4s}, [x1], #16
+ fcvtzs v7.4s, v3.4s, #31
+ sqrshrn v6.4h, v6.4s, #16
+ st1 {v4.8h}, [x0], #16
+ sqrshrn2 v6.8h, v7.4s, #16
+ ld1 {v0.4s}, [x1], #16
+ fcvtzs v4.4s, v0.4s, #31
+ ld1 {v1.4s}, [x1], #16
+ fcvtzs v5.4s, v1.4s, #31
+ st1 {v6.8h}, [x0], #16
+ b.ne 1b
+ ands x2, x2, #15
+ b.eq 3f
+2: ld1 {v2.4s}, [x1], #16
+ sqrshrn v4.4h, v4.4s, #16
+ fcvtzs v6.4s, v2.4s, #31
+ ld1 {v3.4s}, [x1], #16
+ sqrshrn2 v4.8h, v5.4s, #16
+ fcvtzs v7.4s, v3.4s, #31
+ sqrshrn v6.4h, v6.4s, #16
+ st1 {v4.8h}, [x0], #16
+ sqrshrn2 v6.8h, v7.4s, #16
+ st1 {v6.8h}, [x0]
+ ret
+3: sqrshrn v4.4h, v4.4s, #16
+ sqrshrn2 v4.8h, v5.4s, #16
+ st1 {v4.8h}, [x0]
+ ret
+endfunc
+
+function ff_conv_fltp_to_s16_2ch_neon, export=1
+ ldp x4, x5, [x1]
+ subs x2, x2, #8
+ ld1 {v0.4s}, [x4], #16
+ fcvtzs v4.4s, v0.4s, #31
+ ld1 {v1.4s}, [x4], #16
+ fcvtzs v5.4s, v1.4s, #31
+ ld1 {v2.4s}, [x5], #16
+ fcvtzs v6.4s, v2.4s, #31
+ ld1 {v3.4s}, [x5], #16
+ fcvtzs v7.4s, v3.4s, #31
+ b.eq 3f
+ ands x12, x2, #~15
+ b.eq 2f
+1: subs x12, x12, #16
+ ld1 {v16.4s}, [x4], #16
+ fcvtzs v20.4s, v16.4s, #31
+ sri v6.4s, v4.4s, #16
+ ld1 {v17.4s}, [x4], #16
+ fcvtzs v21.4s, v17.4s, #31
+ ld1 {v18.4s}, [x5], #16
+ fcvtzs v22.4s, v18.4s, #31
+ ld1 {v19.4s}, [x5], #16
+ sri v7.4s, v5.4s, #16
+ st1 {v6.4s}, [x0], #16
+ fcvtzs v23.4s, v19.4s, #31
+ st1 {v7.4s}, [x0], #16
+ sri v22.4s, v20.4s, #16
+ ld1 {v0.4s}, [x4], #16
+ sri v23.4s, v21.4s, #16
+ st1 {v22.4s}, [x0], #16
+ fcvtzs v4.4s, v0.4s, #31
+ ld1 {v1.4s}, [x4], #16
+ fcvtzs v5.4s, v1.4s, #31
+ ld1 {v2.4s}, [x5], #16
+ fcvtzs v6.4s, v2.4s, #31
+ ld1 {v3.4s}, [x5], #16
+ fcvtzs v7.4s, v3.4s, #31
+ st1 {v23.4s}, [x0], #16
+ b.ne 1b
+ ands x2, x2, #15
+ b.eq 3f
+2: sri v6.4s, v4.4s, #16
+ ld1 {v0.4s}, [x4], #16
+ fcvtzs v0.4s, v0.4s, #31
+ ld1 {v1.4s}, [x4], #16
+ fcvtzs v1.4s, v1.4s, #31
+ ld1 {v2.4s}, [x5], #16
+ fcvtzs v2.4s, v2.4s, #31
+ sri v7.4s, v5.4s, #16
+ ld1 {v3.4s}, [x5], #16
+ fcvtzs v3.4s, v3.4s, #31
+ sri v2.4s, v0.4s, #16
+ st1 {v6.4s,v7.4s}, [x0], #32
+ sri v3.4s, v1.4s, #16
+ st1 {v2.4s,v3.4s}, [x0], #32
+ ret
+3: sri v6.4s, v4.4s, #16
+ sri v7.4s, v5.4s, #16
+ st1 {v6.4s,v7.4s}, [x0]
+ ret
+endfunc
+
+function ff_conv_fltp_to_s16_neon, export=1
+ cmp w3, #2
+ b.eq X(ff_conv_fltp_to_s16_2ch_neon)
+ b.gt 1f
+ ldr x1, [x1]
+ b X(ff_conv_flt_to_s16_neon)
+1:
+ cmp w3, #4
+ lsl x12, x3, #1
+ b.lt 4f
+
+5: // 4 channels
+ ldp x4, x5, [x1], #16
+ ldp x6, x7, [x1], #16
+ mov w9, w2
+ mov x8, x0
+ ld1 {v4.4s}, [x4], #16
+ fcvtzs v4.4s, v4.4s, #31
+ ld1 {v5.4s}, [x5], #16
+ fcvtzs v5.4s, v5.4s, #31
+ ld1 {v6.4s}, [x6], #16
+ fcvtzs v6.4s, v6.4s, #31
+ ld1 {v7.4s}, [x7], #16
+ fcvtzs v7.4s, v7.4s, #31
+6:
+ subs w9, w9, #8
+ ld1 {v0.4s}, [x4], #16
+ fcvtzs v0.4s, v0.4s, #31
+ sri v5.4s, v4.4s, #16
+ ld1 {v1.4s}, [x5], #16
+ fcvtzs v1.4s, v1.4s, #31
+ sri v7.4s, v6.4s, #16
+ ld1 {v2.4s}, [x6], #16
+ fcvtzs v2.4s, v2.4s, #31
+ zip1 v16.4s, v5.4s, v7.4s
+ ld1 {v3.4s}, [x7], #16
+ fcvtzs v3.4s, v3.4s, #31
+ zip2 v17.4s, v5.4s, v7.4s
+ st1 {v16.d}[0], [x8], x12
+ sri v1.4s, v0.4s, #16
+ st1 {v16.d}[1], [x8], x12
+ sri v3.4s, v2.4s, #16
+ st1 {v17.d}[0], [x8], x12
+ zip1 v18.4s, v1.4s, v3.4s
+ st1 {v17.d}[1], [x8], x12
+ zip2 v19.4s, v1.4s, v3.4s
+ b.eq 7f
+ ld1 {v4.4s}, [x4], #16
+ fcvtzs v4.4s, v4.4s, #31
+ st1 {v18.d}[0], [x8], x12
+ ld1 {v5.4s}, [x5], #16
+ fcvtzs v5.4s, v5.4s, #31
+ st1 {v18.d}[1], [x8], x12
+ ld1 {v6.4s}, [x6], #16
+ fcvtzs v6.4s, v6.4s, #31
+ st1 {v19.d}[0], [x8], x12
+ ld1 {v7.4s}, [x7], #16
+ fcvtzs v7.4s, v7.4s, #31
+ st1 {v19.d}[1], [x8], x12
+ b 6b
+7:
+ st1 {v18.d}[0], [x8], x12
+ st1 {v18.d}[1], [x8], x12
+ st1 {v19.d}[0], [x8], x12
+ st1 {v19.d}[1], [x8], x12
+ subs w3, w3, #4
+ b.eq end
+ cmp w3, #4
+ add x0, x0, #8
+ b.ge 5b
+
+4: // 2 channels
+ cmp w3, #2
+ b.lt 4f
+ ldp x4, x5, [x1], #16
+ mov w9, w2
+ mov x8, x0
+ tst w9, #8
+ ld1 {v4.4s}, [x4], #16
+ fcvtzs v4.4s, v4.4s, #31
+ ld1 {v5.4s}, [x5], #16
+ fcvtzs v5.4s, v5.4s, #31
+ ld1 {v6.4s}, [x4], #16
+ fcvtzs v6.4s, v6.4s, #31
+ ld1 {v7.4s}, [x5], #16
+ fcvtzs v7.4s, v7.4s, #31
+ b.eq 6f
+ subs w9, w9, #8
+ b.eq 7f
+ sri v5.4s, v4.4s, #16
+ ld1 {v4.4s}, [x4], #16
+ fcvtzs v4.4s, v4.4s, #31
+ st1 {v5.s}[0], [x8], x12
+ sri v7.4s, v6.4s, #16
+ st1 {v5.s}[1], [x8], x12
+ ld1 {v6.4s}, [x4], #16
+ fcvtzs v6.4s, v6.4s, #31
+ st1 {v5.s}[2], [x8], x12
+ st1 {v5.s}[3], [x8], x12
+ st1 {v7.s}[0], [x8], x12
+ st1 {v7.s}[1], [x8], x12
+ ld1 {v5.4s}, [x5], #16
+ fcvtzs v5.4s, v5.4s, #31
+ st1 {v7.s}[2], [x8], x12
+ st1 {v7.s}[3], [x8], x12
+ ld1 {v7.4s}, [x5], #16
+ fcvtzs v7.4s, v7.4s, #31
+6:
+ subs w9, w9, #16
+ ld1 {v0.4s}, [x4], #16
+ sri v5.4s, v4.4s, #16
+ fcvtzs v0.4s, v0.4s, #31
+ ld1 {v1.4s}, [x5], #16
+ sri v7.4s, v6.4s, #16
+ st1 {v5.s}[0], [x8], x12
+ st1 {v5.s}[1], [x8], x12
+ fcvtzs v1.4s, v1.4s, #31
+ st1 {v5.s}[2], [x8], x12
+ st1 {v5.s}[3], [x8], x12
+ ld1 {v2.4s}, [x4], #16
+ st1 {v7.s}[0], [x8], x12
+ fcvtzs v2.4s, v2.4s, #31
+ st1 {v7.s}[1], [x8], x12
+ ld1 {v3.4s}, [x5], #16
+ st1 {v7.s}[2], [x8], x12
+ fcvtzs v3.4s, v3.4s, #31
+ st1 {v7.s}[3], [x8], x12
+ sri v1.4s, v0.4s, #16
+ sri v3.4s, v2.4s, #16
+ b.eq 6f
+ ld1 {v4.4s}, [x4], #16
+ st1 {v1.s}[0], [x8], x12
+ fcvtzs v4.4s, v4.4s, #31
+ st1 {v1.s}[1], [x8], x12
+ ld1 {v5.4s}, [x5], #16
+ st1 {v1.s}[2], [x8], x12
+ fcvtzs v5.4s, v5.4s, #31
+ st1 {v1.s}[3], [x8], x12
+ ld1 {v6.4s}, [x4], #16
+ st1 {v3.s}[0], [x8], x12
+ fcvtzs v6.4s, v6.4s, #31
+ st1 {v3.s}[1], [x8], x12
+ ld1 {v7.4s}, [x5], #16
+ st1 {v3.s}[2], [x8], x12
+ fcvtzs v7.4s, v7.4s, #31
+ st1 {v3.s}[3], [x8], x12
+ b.gt 6b
+6:
+ st1 {v1.s}[0], [x8], x12
+ st1 {v1.s}[1], [x8], x12
+ st1 {v1.s}[2], [x8], x12
+ st1 {v1.s}[3], [x8], x12
+ st1 {v3.s}[0], [x8], x12
+ st1 {v3.s}[1], [x8], x12
+ st1 {v3.s}[2], [x8], x12
+ st1 {v3.s}[3], [x8], x12
+ b 8f
+7:
+ sri v5.4s, v4.4s, #16
+ sri v7.4s, v6.4s, #16
+ st1 {v5.s}[0], [x8], x12
+ st1 {v5.s}[1], [x8], x12
+ st1 {v5.s}[2], [x8], x12
+ st1 {v5.s}[3], [x8], x12
+ st1 {v7.s}[0], [x8], x12
+ st1 {v7.s}[1], [x8], x12
+ st1 {v7.s}[2], [x8], x12
+ st1 {v7.s}[3], [x8], x12
+8:
+ subs w3, w3, #2
+ add x0, x0, #4
+ b.eq end
+
+4: // 1 channel
+ ldr x4, [x1]
+ tst w2, #8
+ mov w9, w2
+ mov x5, x0
+ ld1 {v0.4s}, [x4], #16
+ fcvtzs v0.4s, v0.4s, #31
+ ld1 {v1.4s}, [x4], #16
+ fcvtzs v1.4s, v1.4s, #31
+ b.ne 8f
+6:
+ subs w9, w9, #16
+ ld1 {v2.4s}, [x4], #16
+ fcvtzs v2.4s, v2.4s, #31
+ ld1 {v3.4s}, [x4], #16
+ fcvtzs v3.4s, v3.4s, #31
+ st1 {v0.h}[1], [x5], x12
+ st1 {v0.h}[3], [x5], x12
+ st1 {v0.h}[5], [x5], x12
+ st1 {v0.h}[7], [x5], x12
+ st1 {v1.h}[1], [x5], x12
+ st1 {v1.h}[3], [x5], x12
+ st1 {v1.h}[5], [x5], x12
+ st1 {v1.h}[7], [x5], x12
+ b.eq 7f
+ ld1 {v0.4s}, [x4], #16
+ fcvtzs v0.4s, v0.4s, #31
+ ld1 {v1.4s}, [x4], #16
+ fcvtzs v1.4s, v1.4s, #31
+7:
+ st1 {v2.h}[1], [x5], x12
+ st1 {v2.h}[3], [x5], x12
+ st1 {v2.h}[5], [x5], x12
+ st1 {v2.h}[7], [x5], x12
+ st1 {v3.h}[1], [x5], x12
+ st1 {v3.h}[3], [x5], x12
+ st1 {v3.h}[5], [x5], x12
+ st1 {v3.h}[7], [x5], x12
+ b.gt 6b
+ ret
+8:
+ subs w9, w9, #8
+ st1 {v0.h}[1], [x5], x12
+ st1 {v0.h}[3], [x5], x12
+ st1 {v0.h}[5], [x5], x12
+ st1 {v0.h}[7], [x5], x12
+ st1 {v1.h}[1], [x5], x12
+ st1 {v1.h}[3], [x5], x12
+ st1 {v1.h}[5], [x5], x12
+ st1 {v1.h}[7], [x5], x12
+ b.eq end
+ ld1 {v0.4s}, [x4], #16
+ fcvtzs v0.4s, v0.4s, #31
+ ld1 {v1.4s}, [x4], #16
+ fcvtzs v1.4s, v1.4s, #31
+ b 6b
+end:
+ ret
+endfunc
diff --git a/chromium/third_party/ffmpeg/libavresample/aarch64/neontest.c b/chromium/third_party/ffmpeg/libavresample/aarch64/neontest.c
new file mode 100644
index 00000000000..e956ee6b0d8
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavresample/aarch64/neontest.c
@@ -0,0 +1,31 @@
+/*
+ * check NEON registers for clobbers
+ * Copyright (c) 2013 Martin Storsjo
+ *
+ * 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 "libavresample/avresample.h"
+#include "libavutil/aarch64/neontest.h"
+
+wrap(avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
+ int out_plane_size, int out_samples, uint8_t **input,
+ int in_plane_size, int in_samples))
+{
+ testneonclobbers(avresample_convert, avr, output, out_plane_size,
+ out_samples, input, in_plane_size, in_samples);
+}
diff --git a/chromium/third_party/ffmpeg/libavresample/aarch64/resample_init.c b/chromium/third_party/ffmpeg/libavresample/aarch64/resample_init.c
new file mode 100644
index 00000000000..d3dfb12a578
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavresample/aarch64/resample_init.c
@@ -0,0 +1,71 @@
+/*
+ * 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 "config.h"
+#include "libavutil/cpu.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavutil/internal.h"
+#include "libavutil/samplefmt.h"
+#include "libavresample/resample.h"
+
+#include "asm-offsets.h"
+
+AV_CHECK_OFFSET(struct ResampleContext, filter_bank, FILTER_BANK);
+AV_CHECK_OFFSET(struct ResampleContext, filter_length, FILTER_LENGTH);
+AV_CHECK_OFFSET(struct ResampleContext, phase_shift, PHASE_SHIFT);
+AV_CHECK_OFFSET(struct ResampleContext, phase_mask, PHASE_MASK);
+
+void ff_resample_one_dbl_neon(struct ResampleContext *c, void *dst0,
+ int dst_index, const void *src0,
+ unsigned int index, int frac);
+void ff_resample_one_flt_neon(struct ResampleContext *c, void *dst0,
+ int dst_index, const void *src0,
+ unsigned int index, int frac);
+void ff_resample_one_s16_neon(struct ResampleContext *c, void *dst0,
+ int dst_index, const void *src0,
+ unsigned int index, int frac);
+void ff_resample_one_s32_neon(struct ResampleContext *c, void *dst0,
+ int dst_index, const void *src0,
+ unsigned int index, int frac);
+
+void ff_audio_resample_init_aarch64(ResampleContext *c,
+ enum AVSampleFormat sample_fmt)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ if (!c->linear) {
+ switch (sample_fmt) {
+ case AV_SAMPLE_FMT_DBLP:
+ c->resample_one = ff_resample_one_dbl_neon;
+ break;
+ case AV_SAMPLE_FMT_FLTP:
+ c->resample_one = ff_resample_one_flt_neon;
+ break;
+ case AV_SAMPLE_FMT_S16P:
+ c->resample_one = ff_resample_one_s16_neon;
+ break;
+ case AV_SAMPLE_FMT_S32P:
+ c->resample_one = ff_resample_one_s32_neon;
+ break;
+ }
+ }
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavresample/aarch64/resample_neon.S b/chromium/third_party/ffmpeg/libavresample/aarch64/resample_neon.S
new file mode 100644
index 00000000000..d3c2cbf5613
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavresample/aarch64/resample_neon.S
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2014 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "libavutil/aarch64/asm.S"
+#include "asm-offsets.h"
+
+.macro resample_one fmt, es=2
+.ifnc \fmt, dbl
+ .macro M_MUL2 x:vararg
+ .endm
+ .macro M_MLA2 x:vararg
+ .endm
+.endif
+function ff_resample_one_\fmt\()_neon, export=1
+ sxtw x2, w2
+ ldr x9, [x0, #FILTER_BANK]
+ ldr w6, [x0, #FILTER_LENGTH]
+ ldp w7, w8, [x0, #PHASE_SHIFT] // and phase_mask
+ lsr x10, x4, x7 // sample_index
+ and x4, x4, x8
+ lsl x11, x6, #\es // filter_length * elem_size
+ add x3, x3, x10, lsl #\es // src[sample_index]
+ madd x9, x11, x4, x9 // filter
+ cmp w6, #16
+ b.lt 5f
+8: // remaining filter_length at least 16
+ subs w6, w6, #16
+ LOAD8 v4, v5, v6, v7, x3
+ LOAD8 v16, v17, v18, v19, x9
+ M_MUL v0, v4, v16, v1
+ M_MUL2 v1, v6, v18
+7:
+ LOAD8 v20, v21, v22, v23, x3
+ M_MLA v0, v5, v17, v1
+ M_MLA2 v1, v7, v19
+ LOAD8 v24, v25, v26, v27, x9
+ M_MLA v0, v20, v24, v1
+ M_MLA2 v1, v22, v26
+ b.eq 6f
+ cmp w6, #16
+ M_MLA v0, v21, v25, v1
+ M_MLA2 v1, v23, v27
+ b.lt 4f
+ subs w6, w6, #16
+ LOAD8 v4, v5, v6, v7, x3
+ LOAD8 v16, v17, v18, v19, x9
+ M_MLA v0, v4, v16, v1
+ M_MLA2 v1, v6, v18
+ b 7b
+6:
+ M_MLA v0, v21, v25, v1
+ M_MLA2 v1, v23, v27
+ STORE_ONE 0, x1, x2, v1
+ ret
+5:
+ movi v0.16b, #0
+ movi v1.16b, #0
+4: // remaining filter_length 1-15
+ cmp w6, #4
+ b.lt 2f
+ subs w6, w6, #4
+ LOAD4 v4, v5, x3
+ LOAD4 v6, v7, x9
+ M_MLA v0, v4, v6, v1
+ M_MLA2 v1, v5, v7
+ b.eq 0f
+ b 4b
+2: // remaining filter_length 1-3
+ cmp w6, #2
+ b.lt 1f
+ LOAD2 2, x3
+ LOAD2 3, x9
+ subs w6, w6, #2
+ M_MLA v0, v2, v3
+ b.eq 0f
+1: // remaining filter_length 1
+ LOAD1 6, x3
+ LOAD1 7, x9
+ M_MLA v0, v6, v7
+0:
+ STORE_ONE 0, x1, x2, v1
+ ret
+endfunc
+
+.purgem LOAD1
+.purgem LOAD2
+.purgem LOAD4
+.purgem LOAD8
+.purgem M_MLA
+.purgem M_MLA2
+.purgem M_MUL
+.purgem M_MUL2
+.purgem STORE_ONE
+.endm
+
+
+.macro LOAD1 d1, addr
+ ldr d\d1, [\addr], #8
+.endm
+.macro LOAD2 d1, addr
+ ld1 {v\d1\().2d}, [\addr], #16
+.endm
+.macro LOAD4 d1, d2, addr
+ ld1 {\d1\().2d,\d2\().2d}, [\addr], #32
+.endm
+.macro LOAD8 d1, d2, d3, d4, addr
+ ld1 {\d1\().2d,\d2\().2d,\d3\().2d,\d4\().2d}, [\addr], #64
+.endm
+.macro M_MLA d, r0, r1, d2:vararg
+ fmla \d\().2d, \r0\().2d, \r1\().2d
+.endm
+.macro M_MLA2 second:vararg
+ M_MLA \second
+.endm
+.macro M_MUL d, r0, r1, d2:vararg
+ fmul \d\().2d, \r0\().2d, \r1\().2d
+.endm
+.macro M_MUL2 second:vararg
+ M_MUL \second
+.endm
+.macro STORE_ONE rn, addr, idx, d2
+ fadd v\rn\().2d, v\rn\().2d, \d2\().2d
+ faddp d\rn\(), v\rn\().2d
+ str d\rn\(), [\addr, \idx, lsl #3]
+.endm
+
+resample_one dbl, 3
+
+
+.macro LOAD1 d1, addr
+ ldr s\d1, [\addr], #4
+.endm
+.macro LOAD2 d1, addr
+ ld1 {v\d1\().2s}, [\addr], #8
+.endm
+.macro LOAD4 d1, d2, addr
+ ld1 {\d1\().4s}, [\addr], #16
+.endm
+.macro LOAD8 d1, d2, d3, d4, addr
+ ld1 {\d1\().4s,\d2\().4s}, [\addr], #32
+.endm
+.macro M_MLA d, r0, r1, d2:vararg
+ fmla \d\().4s, \r0\().4s, \r1\().4s
+.endm
+.macro M_MUL d, r0, r1, d2:vararg
+ fmul \d\().4s, \r0\().4s, \r1\().4s
+.endm
+.macro STORE_ONE rn, addr, idx, d2
+ faddp v\rn\().4s, v\rn\().4s, v\rn\().4s
+ faddp s\rn\(), v\rn\().2s
+ str s\rn\(), [\addr, \idx, lsl #2]
+.endm
+
+resample_one flt
+
+
+.macro LOAD1 d1, addr
+ ldr h\d1, [\addr], #2
+.endm
+.macro LOAD2 d1, addr
+ ldr s\d1, [\addr], #4
+.endm
+.macro LOAD4 d1, d2, addr
+ ld1 {\d1\().4h}, [\addr], #8
+.endm
+.macro LOAD8 d1, d2, d3, d4, addr
+ ld1 {\d1\().4h,\d2\().4h}, [\addr], #16
+.endm
+.macro M_MLA d, r0, r1, d2:vararg
+ smlal \d\().4s, \r0\().4h, \r1\().4h
+.endm
+.macro M_MUL d, r0, r1, d2:vararg
+ smull \d\().4s, \r0\().4h, \r1\().4h
+.endm
+.macro STORE_ONE rn, addr, idx, d2
+ addp v\rn\().4s, v\rn\().4s, v\rn\().4s
+ addp v\rn\().4s, v\rn\().4s, v\rn\().4s
+ sqrshrn v\rn\().4h, v\rn\().4s, #15
+ str h\rn\(), [\addr, \idx, lsl #1]
+.endm
+
+resample_one s16, 1
+
+
+.macro LOAD1 d1, addr
+ ldr s\d1, [\addr], #4
+.endm
+.macro LOAD2 d1, addr
+ ld1 {v\d1\().2s}, [\addr], #8
+.endm
+.macro LOAD4 d1, d2, addr
+ ld1 {\d1\().4s}, [\addr], #16
+.endm
+.macro LOAD8 d1, d2, d3, d4, addr
+ ld1 {\d1\().4s,\d2\().4s}, [\addr], #32
+.endm
+.macro M_MLA d1, r0, r1, d2:vararg
+ smlal \d1\().2d, \r0\().2s, \r1\().2s
+.ifnb \d2
+ smlal2 \d2\().2d, \r0\().4s, \r1\().4s
+.endif
+.endm
+.macro M_MUL d1, r0, r1, d2:vararg
+ smull \d1\().2d, \r0\().2s, \r1\().2s
+.ifnb \d2
+ smull2 \d2\().2d, \r0\().4s, \r1\().4s
+.endif
+.endm
+.macro STORE_ONE rn, addr, idx, d2
+ add v\rn\().2d, v\rn\().2d, \d2\().2d
+ addp d\rn\(), v\rn\().2d
+ sqrshrn v\rn\().2s, v\rn\().2d, #30
+ str s\rn\(), [\addr, \idx, lsl #2]
+.endm
+
+resample_one s32
diff --git a/chromium/third_party/ffmpeg/libavresample/arm/Makefile b/chromium/third_party/ffmpeg/libavresample/arm/Makefile
index 55683cbfae3..60f3f6d6b88 100644
--- a/chromium/third_party/ffmpeg/libavresample/arm/Makefile
+++ b/chromium/third_party/ffmpeg/libavresample/arm/Makefile
@@ -1,2 +1,5 @@
OBJS += arm/audio_convert_init.o
+
+OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o
+
NEON-OBJS += arm/audio_convert_neon.o
diff --git a/chromium/third_party/ffmpeg/libavresample/arm/audio_convert_neon.S b/chromium/third_party/ffmpeg/libavresample/arm/audio_convert_neon.S
index 98f77f058ca..a120e8793b3 100644
--- a/chromium/third_party/ffmpeg/libavresample/arm/audio_convert_neon.S
+++ b/chromium/third_party/ffmpeg/libavresample/arm/audio_convert_neon.S
@@ -133,8 +133,8 @@ function ff_conv_fltp_to_s16_neon, export=1
cmp r3, #2
itt lt
ldrlt r1, [r1]
- blt ff_conv_flt_to_s16_neon
- beq ff_conv_fltp_to_s16_2ch_neon
+ blt X(ff_conv_flt_to_s16_neon)
+ beq X(ff_conv_fltp_to_s16_2ch_neon)
push {r4-r8, lr}
cmp r3, #4
diff --git a/chromium/third_party/ffmpeg/libavresample/arm/neontest.c b/chromium/third_party/ffmpeg/libavresample/arm/neontest.c
new file mode 100644
index 00000000000..22afedbc604
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavresample/arm/neontest.c
@@ -0,0 +1,31 @@
+/*
+ * check NEON registers for clobbers
+ * Copyright (c) 2013 Martin Storsjo
+ *
+ * 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 "libavresample/avresample.h"
+#include "libavutil/arm/neontest.h"
+
+wrap(avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
+ int out_plane_size, int out_samples, uint8_t **input,
+ int in_plane_size, int in_samples))
+{
+ testneonclobbers(avresample_convert, avr, output, out_plane_size,
+ out_samples, input, in_plane_size, in_samples);
+}
diff --git a/chromium/third_party/ffmpeg/libavresample/audio_convert.c b/chromium/third_party/ffmpeg/libavresample/audio_convert.c
index e73105d54ef..e68d5727f48 100644
--- a/chromium/third_party/ffmpeg/libavresample/audio_convert.c
+++ b/chromium/third_party/ffmpeg/libavresample/audio_convert.c
@@ -301,6 +301,8 @@ AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr,
set_generic_function(ac);
+ if (ARCH_AARCH64)
+ ff_audio_convert_init_aarch64(ac);
if (ARCH_ARM)
ff_audio_convert_init_arm(ac);
if (ARCH_X86)
diff --git a/chromium/third_party/ffmpeg/libavresample/audio_convert.h b/chromium/third_party/ffmpeg/libavresample/audio_convert.h
index 5cf6b9df229..df15442c18c 100644
--- a/chromium/third_party/ffmpeg/libavresample/audio_convert.h
+++ b/chromium/third_party/ffmpeg/libavresample/audio_convert.h
@@ -96,6 +96,7 @@ int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in);
/* arch-specific initialization functions */
+void ff_audio_convert_init_aarch64(AudioConvert *ac);
void ff_audio_convert_init_arm(AudioConvert *ac);
void ff_audio_convert_init_x86(AudioConvert *ac);
diff --git a/chromium/third_party/ffmpeg/libavresample/audio_mix.c b/chromium/third_party/ffmpeg/libavresample/audio_mix.c
index 1b48fe56005..989891d0f62 100644
--- a/chromium/third_party/ffmpeg/libavresample/audio_mix.c
+++ b/chromium/third_party/ffmpeg/libavresample/audio_mix.c
@@ -447,7 +447,7 @@ int ff_audio_mix(AudioMix *am, AudioData *src)
if (am->in_matrix_channels && am->out_matrix_channels) {
uint8_t **data;
- uint8_t *data0[AVRESAMPLE_MAX_CHANNELS];
+ uint8_t *data0[AVRESAMPLE_MAX_CHANNELS] = { NULL };
if (am->out_matrix_channels < am->out_channels ||
am->in_matrix_channels < am->in_channels) {
@@ -559,9 +559,12 @@ static void reduce_matrix(AudioMix *am, const double *matrix, int stride)
if (zero) {
am->output_zero[o] = 1;
am->out_matrix_channels--;
+ if (o < am->in_channels)
+ am->in_matrix_channels--;
}
}
- if (am->out_matrix_channels == 0) {
+ if (am->out_matrix_channels == 0 || am->in_matrix_channels == 0) {
+ am->out_matrix_channels = 0;
am->in_matrix_channels = 0;
return;
}
@@ -683,7 +686,7 @@ int ff_audio_mix_set_matrix(AudioMix *am, const double *matrix, int stride)
am->in_matrix_channels; \
for (i = 0, i0 = 0; i < am->in_channels; i++) { \
double v; \
- if (am->input_skip[i]) \
+ if (am->input_skip[i] || am->output_zero[i]) \
continue; \
v = matrix[o * stride + i]; \
am->matrix_## type[o0][i0] = expr; \
@@ -726,7 +729,7 @@ int ff_audio_mix_set_matrix(AudioMix *am, const double *matrix, int stride)
for (i = 0; i < am->in_channels; i++) {
if (am->output_zero[o])
av_log(am->avr, AV_LOG_DEBUG, " (ZERO)");
- else if (am->input_skip[i] || am->output_skip[o])
+ else if (am->input_skip[i] || am->output_zero[i] || am->output_skip[o])
av_log(am->avr, AV_LOG_DEBUG, " (SKIP)");
else
av_log(am->avr, AV_LOG_DEBUG, " %0.3f ",
diff --git a/chromium/third_party/ffmpeg/libavresample/audio_mix_matrix.c b/chromium/third_party/ffmpeg/libavresample/audio_mix_matrix.c
index 935ed5ad462..bcbe181a803 100644
--- a/chromium/third_party/ffmpeg/libavresample/audio_mix_matrix.c
+++ b/chromium/third_party/ffmpeg/libavresample/audio_mix_matrix.c
@@ -126,8 +126,13 @@ int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
/* mix front center to front left/right */
if (unaccounted & AV_CH_FRONT_CENTER) {
if ((out_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO) {
- matrix[FRONT_LEFT ][FRONT_CENTER] += M_SQRT1_2;
- matrix[FRONT_RIGHT][FRONT_CENTER] += M_SQRT1_2;
+ if ((in_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO) {
+ matrix[FRONT_LEFT ][FRONT_CENTER] += center_mix_level;
+ matrix[FRONT_RIGHT][FRONT_CENTER] += center_mix_level;
+ } else {
+ matrix[FRONT_LEFT ][FRONT_CENTER] += M_SQRT1_2;
+ matrix[FRONT_RIGHT][FRONT_CENTER] += M_SQRT1_2;
+ }
} else
return AVERROR_PATCHWELCOME;
}
diff --git a/chromium/third_party/ffmpeg/libavresample/avresample.h b/chromium/third_party/ffmpeg/libavresample/avresample.h
index f62e53303d2..dc392ad076e 100644
--- a/chromium/third_party/ffmpeg/libavresample/avresample.h
+++ b/chromium/third_party/ffmpeg/libavresample/avresample.h
@@ -172,6 +172,14 @@ AVAudioResampleContext *avresample_alloc_context(void);
int avresample_open(AVAudioResampleContext *avr);
/**
+ * Check whether an AVAudioResampleContext is open or closed.
+ *
+ * @param avr AVAudioResampleContext to check
+ * @return 1 if avr is open, 0 if avr is closed.
+ */
+int avresample_is_open(AVAudioResampleContext *avr);
+
+/**
* Close AVAudioResampleContext.
*
* This closes the context, but it does not change the parameters. The context
diff --git a/chromium/third_party/ffmpeg/libavresample/internal.h b/chromium/third_party/ffmpeg/libavresample/internal.h
index 2946126c789..fe6bd8fa638 100644
--- a/chromium/third_party/ffmpeg/libavresample/internal.h
+++ b/chromium/third_party/ffmpeg/libavresample/internal.h
@@ -107,4 +107,7 @@ struct AVAudioResampleContext {
ChannelMapInfo ch_map_info;
};
+
+void ff_audio_resample_init_aarch64(ResampleContext *c,
+ enum AVSampleFormat sample_fmt);
#endif /* AVRESAMPLE_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libavresample/resample.c b/chromium/third_party/ffmpeg/libavresample/resample.c
index 525828c5283..bdc74a2e05e 100644
--- a/chromium/third_party/ffmpeg/libavresample/resample.c
+++ b/chromium/third_party/ffmpeg/libavresample/resample.c
@@ -26,29 +26,6 @@
#include "resample.h"
#include "audio_data.h"
-struct ResampleContext {
- AVAudioResampleContext *avr;
- AudioData *buffer;
- uint8_t *filter_bank;
- int filter_length;
- int ideal_dst_incr;
- int dst_incr;
- int index;
- int frac;
- int src_incr;
- int compensation_distance;
- int phase_shift;
- int phase_mask;
- int linear;
- enum AVResampleFilterType filter_type;
- int kaiser_beta;
- double factor;
- void (*set_filter)(void *filter, double *tab, int phase, int tap_count);
- void (*resample_one)(struct ResampleContext *c, int no_filter, void *dst0,
- int dst_index, const void *src0, int src_size,
- int index, int frac);
-};
-
/* double template */
#define CONFIG_RESAMPLE_DBL
@@ -87,10 +64,10 @@ static double bessel(double x)
}
/* Build a polyphase filterbank. */
-static int build_filter(ResampleContext *c)
+static int build_filter(ResampleContext *c, double factor)
{
int ph, i;
- double x, y, w, factor;
+ double x, y, w;
double *tab;
int tap_count = c->filter_length;
int phase_count = 1 << c->phase_shift;
@@ -100,9 +77,6 @@ static int build_filter(ResampleContext *c)
if (!tab)
return AVERROR(ENOMEM);
- /* if upsampling, only need to interpolate, no filter */
- factor = FFMIN(c->factor, 1.0);
-
for (ph = 0; ph < phase_count; ph++) {
double norm = 0;
for (i = 0; i < tap_count; i++) {
@@ -169,36 +143,42 @@ ResampleContext *ff_audio_resample_init(AVAudioResampleContext *avr)
c->phase_shift = avr->phase_shift;
c->phase_mask = phase_count - 1;
c->linear = avr->linear_interp;
- c->factor = factor;
c->filter_length = FFMAX((int)ceil(avr->filter_size / factor), 1);
c->filter_type = avr->filter_type;
c->kaiser_beta = avr->kaiser_beta;
switch (avr->internal_sample_fmt) {
case AV_SAMPLE_FMT_DBLP:
- c->resample_one = resample_one_dbl;
+ c->resample_one = c->linear ? resample_linear_dbl : resample_one_dbl;
+ c->resample_nearest = resample_nearest_dbl;
c->set_filter = set_filter_dbl;
break;
case AV_SAMPLE_FMT_FLTP:
- c->resample_one = resample_one_flt;
+ c->resample_one = c->linear ? resample_linear_flt : resample_one_flt;
+ c->resample_nearest = resample_nearest_flt;
c->set_filter = set_filter_flt;
break;
case AV_SAMPLE_FMT_S32P:
- c->resample_one = resample_one_s32;
+ c->resample_one = c->linear ? resample_linear_s32 : resample_one_s32;
+ c->resample_nearest = resample_nearest_s32;
c->set_filter = set_filter_s32;
break;
case AV_SAMPLE_FMT_S16P:
- c->resample_one = resample_one_s16;
+ c->resample_one = c->linear ? resample_linear_s16 : resample_one_s16;
+ c->resample_nearest = resample_nearest_s16;
c->set_filter = set_filter_s16;
break;
}
+ if (ARCH_AARCH64)
+ ff_audio_resample_init_aarch64(c, avr->internal_sample_fmt);
+
felem_size = av_get_bytes_per_sample(avr->internal_sample_fmt);
c->filter_bank = av_mallocz(c->filter_length * (phase_count + 1) * felem_size);
if (!c->filter_bank)
goto error;
- if (build_filter(c) < 0)
+ if (build_filter(c, factor) < 0)
goto error;
memcpy(&c->filter_bank[(c->filter_length * phase_count + 1) * felem_size],
@@ -212,15 +192,19 @@ ResampleContext *ff_audio_resample_init(AVAudioResampleContext *avr)
goto error;
c->ideal_dst_incr = c->dst_incr;
- c->index = -phase_count * ((c->filter_length - 1) / 2);
+ c->padding_size = (c->filter_length - 1) / 2;
+ c->initial_padding_filled = 0;
+ c->index = 0;
c->frac = 0;
/* allocate internal buffer */
- c->buffer = ff_audio_data_alloc(avr->resample_channels, 0,
+ c->buffer = ff_audio_data_alloc(avr->resample_channels, c->padding_size,
avr->internal_sample_fmt,
"resample buffer");
if (!c->buffer)
goto error;
+ c->buffer->nb_samples = c->padding_size;
+ c->initial_padding_samples = c->padding_size;
av_log(avr, AV_LOG_DEBUG, "resample: %s from %d Hz to %d Hz\n",
av_get_sample_fmt_name(avr->internal_sample_fmt),
@@ -330,10 +314,11 @@ reinit_fail:
}
static int resample(ResampleContext *c, void *dst, const void *src,
- int *consumed, int src_size, int dst_size, int update_ctx)
+ int *consumed, int src_size, int dst_size, int update_ctx,
+ int nearest_neighbour)
{
int dst_index;
- int index = c->index;
+ unsigned int index = c->index;
int frac = c->frac;
int dst_incr_frac = c->dst_incr % c->src_incr;
int dst_incr = c->dst_incr / c->src_incr;
@@ -342,9 +327,8 @@ static int resample(ResampleContext *c, void *dst, const void *src,
if (!dst != !src)
return AVERROR(EINVAL);
- if (compensation_distance == 0 && c->filter_length == 1 &&
- c->phase_shift == 0) {
- int64_t index2 = ((int64_t)index) << 32;
+ if (nearest_neighbour) {
+ uint64_t index2 = ((uint64_t)index) << 32;
int64_t incr = (1LL << 32) * c->dst_incr / c->src_incr;
dst_size = FFMIN(dst_size,
(src_size-1-index) * (int64_t)c->src_incr /
@@ -352,7 +336,7 @@ static int resample(ResampleContext *c, void *dst, const void *src,
if (dst) {
for(dst_index = 0; dst_index < dst_size; dst_index++) {
- c->resample_one(c, 1, dst, dst_index, src, 0, index2 >> 32, 0);
+ c->resample_nearest(dst, dst_index, src, index2 >> 32);
index2 += incr;
}
} else {
@@ -365,12 +349,11 @@ static int resample(ResampleContext *c, void *dst, const void *src,
for (dst_index = 0; dst_index < dst_size; dst_index++) {
int sample_index = index >> c->phase_shift;
- if (sample_index + c->filter_length > src_size ||
- -sample_index >= src_size)
+ if (sample_index + c->filter_length > src_size)
break;
if (dst)
- c->resample_one(c, 0, dst, dst_index, src, src_size, index, frac);
+ c->resample_one(c, dst, dst_index, src, index, frac);
frac += dst_incr_frac;
index += dst_incr;
@@ -386,11 +369,10 @@ static int resample(ResampleContext *c, void *dst, const void *src,
}
}
if (consumed)
- *consumed = FFMAX(index, 0) >> c->phase_shift;
+ *consumed = index >> c->phase_shift;
if (update_ctx) {
- if (index >= 0)
- index &= c->phase_mask;
+ index &= c->phase_mask;
if (compensation_distance) {
compensation_distance -= dst_index;
@@ -410,6 +392,9 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src)
{
int ch, in_samples, in_leftover, consumed = 0, out_samples = 0;
int ret = AVERROR(EINVAL);
+ int nearest_neighbour = (c->compensation_distance == 0 &&
+ c->filter_length == 1 &&
+ c->phase_shift == 0);
in_samples = src ? src->nb_samples : 0;
in_leftover = c->buffer->nb_samples;
@@ -419,18 +404,62 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src)
ret = ff_audio_data_combine(c->buffer, in_leftover, src, 0, in_samples);
if (ret < 0)
return ret;
- } else if (!in_leftover) {
+ } else if (in_leftover <= c->final_padding_samples) {
/* no remaining samples to flush */
return 0;
- } else {
- /* TODO: pad buffer to flush completely */
}
+ if (!c->initial_padding_filled) {
+ int bps = av_get_bytes_per_sample(c->avr->internal_sample_fmt);
+ int i;
+
+ if (src && c->buffer->nb_samples < 2 * c->padding_size)
+ return 0;
+
+ for (i = 0; i < c->padding_size; i++)
+ for (ch = 0; ch < c->buffer->channels; ch++) {
+ if (c->buffer->nb_samples > 2 * c->padding_size - i) {
+ memcpy(c->buffer->data[ch] + bps * i,
+ c->buffer->data[ch] + bps * (2 * c->padding_size - i), bps);
+ } else {
+ memset(c->buffer->data[ch] + bps * i, 0, bps);
+ }
+ }
+ c->initial_padding_filled = 1;
+ }
+
+ if (!src && !c->final_padding_filled) {
+ int bps = av_get_bytes_per_sample(c->avr->internal_sample_fmt);
+ int i;
+
+ ret = ff_audio_data_realloc(c->buffer, in_samples + c->padding_size);
+ if (ret < 0) {
+ av_log(c->avr, AV_LOG_ERROR, "Error reallocating resampling buffer\n");
+ return AVERROR(ENOMEM);
+ }
+
+ for (i = 0; i < c->padding_size; i++)
+ for (ch = 0; ch < c->buffer->channels; ch++) {
+ if (in_leftover > i) {
+ memcpy(c->buffer->data[ch] + bps * (in_leftover + i),
+ c->buffer->data[ch] + bps * (in_leftover - i - 1),
+ bps);
+ } else {
+ memset(c->buffer->data[ch] + bps * (in_leftover + i),
+ 0, bps);
+ }
+ }
+ c->buffer->nb_samples += c->padding_size;
+ c->final_padding_samples = c->padding_size;
+ c->final_padding_filled = 1;
+ }
+
+
/* calculate output size and reallocate output buffer if needed */
/* TODO: try to calculate this without the dummy resample() run */
if (!dst->read_only && dst->allow_realloc) {
out_samples = resample(c, NULL, NULL, NULL, c->buffer->nb_samples,
- INT_MAX, 0);
+ INT_MAX, 0, nearest_neighbour);
ret = ff_audio_data_realloc(dst, out_samples);
if (ret < 0) {
av_log(c->avr, AV_LOG_ERROR, "error reallocating output\n");
@@ -443,7 +472,7 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src)
out_samples = resample(c, (void *)dst->data[ch],
(const void *)c->buffer->data[ch], &consumed,
c->buffer->nb_samples, dst->allocated_samples,
- ch + 1 == c->buffer->channels);
+ ch + 1 == c->buffer->channels, nearest_neighbour);
}
if (out_samples < 0) {
av_log(c->avr, AV_LOG_ERROR, "error during resampling\n");
@@ -452,6 +481,7 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src)
/* drain consumed samples from the internal buffer */
ff_audio_data_drain(c->buffer, consumed);
+ c->initial_padding_samples = FFMAX(c->initial_padding_samples - consumed, 0);
av_dlog(c->avr, "resampled %d in + %d leftover to %d out + %d leftover\n",
in_samples, in_leftover, out_samples, c->buffer->nb_samples);
@@ -462,8 +492,10 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src)
int avresample_get_delay(AVAudioResampleContext *avr)
{
+ ResampleContext *c = avr->resample;
+
if (!avr->resample_needed || !avr->resample)
return 0;
- return avr->resample->buffer->nb_samples;
+ return FFMAX(c->buffer->nb_samples - c->padding_size, 0);
}
diff --git a/chromium/third_party/ffmpeg/libavresample/resample.h b/chromium/third_party/ffmpeg/libavresample/resample.h
index 3b56baa5cf2..be9f5627914 100644
--- a/chromium/third_party/ffmpeg/libavresample/resample.h
+++ b/chromium/third_party/ffmpeg/libavresample/resample.h
@@ -25,6 +25,35 @@
#include "internal.h"
#include "audio_data.h"
+struct ResampleContext {
+ AVAudioResampleContext *avr;
+ AudioData *buffer;
+ uint8_t *filter_bank;
+ int filter_length;
+ int ideal_dst_incr;
+ int dst_incr;
+ unsigned int index;
+ int frac;
+ int src_incr;
+ int compensation_distance;
+ int phase_shift;
+ int phase_mask;
+ int linear;
+ enum AVResampleFilterType filter_type;
+ int kaiser_beta;
+ void (*set_filter)(void *filter, double *tab, int phase, int tap_count);
+ void (*resample_one)(struct ResampleContext *c, void *dst0,
+ int dst_index, const void *src0,
+ unsigned int index, int frac);
+ void (*resample_nearest)(void *dst0, int dst_index,
+ const void *src0, unsigned int index);
+ int padding_size;
+ int initial_padding_filled;
+ int initial_padding_samples;
+ int final_padding_filled;
+ int final_padding_samples;
+};
+
/**
* Allocate and initialize a ResampleContext.
*
diff --git a/chromium/third_party/ffmpeg/libavresample/resample_template.c b/chromium/third_party/ffmpeg/libavresample/resample_template.c
index 06da90fe9fc..863852a3fd5 100644
--- a/chromium/third_party/ffmpeg/libavresample/resample_template.c
+++ b/chromium/third_party/ffmpeg/libavresample/resample_template.c
@@ -18,6 +18,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <math.h>
+#include <stdint.h>
+
+#include "libavutil/common.h"
+#include "internal.h"
+
#if defined(CONFIG_RESAMPLE_DBL)
#define SET_TYPE(func) func ## _dbl
#define FELEM double
@@ -48,40 +54,50 @@
#define DBL_TO_FELEM(d, v) d = av_clip_int16(lrint(v * (1 << 15)))
#endif
-static void SET_TYPE(resample_one)(ResampleContext *c, int no_filter,
- void *dst0, int dst_index, const void *src0,
- int src_size, int index, int frac)
+static void SET_TYPE(resample_nearest)(void *dst0, int dst_index, const void *src0, unsigned int index)
{
FELEM *dst = dst0;
const FELEM *src = src0;
+ dst[dst_index] = src[index];
+}
- if (no_filter) {
- dst[dst_index] = src[index];
- } else {
- int i;
- int sample_index = index >> c->phase_shift;
- FELEM2 val = 0;
- FELEM *filter = ((FELEM *)c->filter_bank) +
- c->filter_length * (index & c->phase_mask);
-
- if (sample_index < 0) {
- for (i = 0; i < c->filter_length; i++)
- val += src[FFABS(sample_index + i) % src_size] *
- (FELEM2)filter[i];
- } else if (c->linear) {
- FELEM2 v2 = 0;
- for (i = 0; i < c->filter_length; i++) {
- val += src[abs(sample_index + i)] * (FELEM2)filter[i];
- v2 += src[abs(sample_index + i)] * (FELEM2)filter[i + c->filter_length];
- }
- val += (v2 - val) * (FELEML)frac / c->src_incr;
- } else {
- for (i = 0; i < c->filter_length; i++)
- val += src[sample_index + i] * (FELEM2)filter[i];
- }
+static void SET_TYPE(resample_linear)(ResampleContext *c, void *dst0, int dst_index,
+ const void *src0, unsigned int index, int frac)
+{
+ FELEM *dst = dst0;
+ const FELEM *src = src0;
+ int i;
+ unsigned int sample_index = index >> c->phase_shift;
+ FELEM2 val = 0;
+ FELEM *filter = ((FELEM *)c->filter_bank) +
+ c->filter_length * (index & c->phase_mask);
+ FELEM2 v2 = 0;
- OUT(dst[dst_index], val);
+ for (i = 0; i < c->filter_length; i++) {
+ val += src[sample_index + i] * (FELEM2)filter[i];
+ v2 += src[sample_index + i] * (FELEM2)filter[i + c->filter_length];
}
+ val += (v2 - val) * (FELEML)frac / c->src_incr;
+
+ OUT(dst[dst_index], val);
+}
+
+static void SET_TYPE(resample_one)(ResampleContext *c,
+ void *dst0, int dst_index, const void *src0,
+ unsigned int index, int frac)
+{
+ FELEM *dst = dst0;
+ const FELEM *src = src0;
+ int i;
+ unsigned int sample_index = index >> c->phase_shift;
+ FELEM2 val = 0;
+ FELEM *filter = ((FELEM *)c->filter_bank) +
+ c->filter_length * (index & c->phase_mask);
+
+ for (i = 0; i < c->filter_length; i++)
+ val += src[sample_index + i] * (FELEM2)filter[i];
+
+ OUT(dst[dst_index], val);
}
static void SET_TYPE(set_filter)(void *filter0, double *tab, int phase,
diff --git a/chromium/third_party/ffmpeg/libavresample/utils.c b/chromium/third_party/ffmpeg/libavresample/utils.c
index db1e08701ac..3a335c0587b 100644
--- a/chromium/third_party/ffmpeg/libavresample/utils.c
+++ b/chromium/third_party/ffmpeg/libavresample/utils.c
@@ -36,6 +36,11 @@ int avresample_open(AVAudioResampleContext *avr)
{
int ret;
+ if (avresample_is_open(avr)) {
+ av_log(avr, AV_LOG_ERROR, "The resampling context is already open.\n");
+ return AVERROR(EINVAL);
+ }
+
/* set channel mixing parameters */
avr->in_channels = av_get_channel_layout_nb_channels(avr->in_channel_layout);
if (avr->in_channels <= 0 || avr->in_channels > AVRESAMPLE_MAX_CHANNELS) {
@@ -184,7 +189,7 @@ int avresample_open(AVAudioResampleContext *avr)
}
if (avr->resample_needed) {
avr->resample_out_buffer = ff_audio_data_alloc(avr->out_channels,
- 0, avr->internal_sample_fmt,
+ 1024, avr->internal_sample_fmt,
"resample_out_buffer");
if (!avr->resample_out_buffer) {
ret = AVERROR(EINVAL);
@@ -254,6 +259,11 @@ error:
return ret;
}
+int avresample_is_open(AVAudioResampleContext *avr)
+{
+ return !!avr->out_fifo;
+}
+
void avresample_close(AVAudioResampleContext *avr)
{
ff_audio_data_free(&avr->in_buffer);
diff --git a/chromium/third_party/ffmpeg/libavresample/version.h b/chromium/third_party/ffmpeg/libavresample/version.h
index 0dd5bb62c53..d865ad2d23b 100644
--- a/chromium/third_party/ffmpeg/libavresample/version.h
+++ b/chromium/third_party/ffmpeg/libavresample/version.h
@@ -25,10 +25,10 @@
* Libavresample version macros.
*/
-#include "libavutil/avutil.h"
+#include "libavutil/version.h"
#define LIBAVRESAMPLE_VERSION_MAJOR 1
-#define LIBAVRESAMPLE_VERSION_MINOR 1
+#define LIBAVRESAMPLE_VERSION_MINOR 2
#define LIBAVRESAMPLE_VERSION_MICRO 0
#define LIBAVRESAMPLE_VERSION_INT AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \
diff --git a/chromium/third_party/ffmpeg/libavresample/x86/Makefile b/chromium/third_party/ffmpeg/libavresample/x86/Makefile
index 2e8786fb907..0ca2d79045d 100644
--- a/chromium/third_party/ffmpeg/libavresample/x86/Makefile
+++ b/chromium/third_party/ffmpeg/libavresample/x86/Makefile
@@ -2,6 +2,8 @@ OBJS += x86/audio_convert_init.o \
x86/audio_mix_init.o \
x86/dither_init.o \
+OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
+
YASM-OBJS += x86/audio_convert.o \
x86/audio_mix.o \
x86/dither.o \
diff --git a/chromium/third_party/ffmpeg/libavresample/x86/audio_mix_init.c b/chromium/third_party/ffmpeg/libavresample/x86/audio_mix_init.c
index bec88b0d3ae..2f05eee81ac 100644
--- a/chromium/third_party/ffmpeg/libavresample/x86/audio_mix_init.c
+++ b/chromium/third_party/ffmpeg/libavresample/x86/audio_mix_init.c
@@ -173,7 +173,6 @@ DEFINE_MIX_3_8_TO_1_2(8)
av_cold void ff_audio_mix_init_x86(AudioMix *am)
{
-#if HAVE_YASM
int cpu_flags = av_get_cpu_flags();
if (EXTERNAL_SSE(cpu_flags)) {
@@ -211,5 +210,4 @@ av_cold void ff_audio_mix_init_x86(AudioMix *am)
SET_MIX_3_8_TO_1_2(6)
SET_MIX_3_8_TO_1_2(7)
SET_MIX_3_8_TO_1_2(8)
-#endif /* HAVE_YASM */
}
diff --git a/chromium/third_party/ffmpeg/libavresample/x86/w64xmmtest.c b/chromium/third_party/ffmpeg/libavresample/x86/w64xmmtest.c
new file mode 100644
index 00000000000..0f42bd185cc
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavresample/x86/w64xmmtest.c
@@ -0,0 +1,31 @@
+/*
+ * check XMM registers for clobbers on Win64
+ * Copyright (c) 2013 Martin Storsjo
+ *
+ * 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 "libavresample/avresample.h"
+#include "libavutil/x86/w64xmmtest.h"
+
+wrap(avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
+ int out_plane_size, int out_samples, uint8_t **input,
+ int in_plane_size, int in_samples))
+{
+ testxmmclobbers(avresample_convert, avr, output, out_plane_size,
+ out_samples, input, in_plane_size, in_samples);
+}
diff --git a/chromium/third_party/ffmpeg/libavutil/Makefile b/chromium/third_party/ffmpeg/libavutil/Makefile
index 89708fc0af1..a345024722a 100644
--- a/chromium/third_party/ffmpeg/libavutil/Makefile
+++ b/chromium/third_party/ffmpeg/libavutil/Makefile
@@ -19,6 +19,7 @@ HEADERS = adler32.h \
common.h \
cpu.h \
crc.h \
+ downmix_info.h \
error.h \
eval.h \
fifo.h \
@@ -31,6 +32,7 @@ HEADERS = adler32.h \
intreadwrite.h \
lfg.h \
log.h \
+ macros.h \
mathematics.h \
md5.h \
mem.h \
@@ -42,6 +44,7 @@ HEADERS = adler32.h \
pixdesc.h \
pixfmt.h \
random_seed.h \
+ replaygain.h \
rational.h \
ripemd.h \
samplefmt.h \
@@ -79,12 +82,14 @@ OBJS = adler32.o \
cpu.o \
crc.o \
des.o \
+ downmix_info.o \
error.o \
eval.o \
fifo.o \
file.o \
file_open.o \
float_dsp.o \
+ fixed_dsp.o \
frame.o \
hash.o \
hmac.o \
@@ -148,15 +153,18 @@ TESTPROGS = adler32 \
eval \
file \
fifo \
+ float_dsp \
hmac \
lfg \
lls1 \
lls2 \
+ log \
md5 \
murmur3 \
opt \
pca \
parseutils \
+ pixdesc \
random_seed \
rational \
ripemd \
diff --git a/chromium/third_party/ffmpeg/libavutil/aarch64/Makefile b/chromium/third_party/ffmpeg/libavutil/aarch64/Makefile
new file mode 100644
index 00000000000..5613813ba8c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/aarch64/Makefile
@@ -0,0 +1,4 @@
+OBJS += aarch64/cpu.o \
+ aarch64/float_dsp_init.o \
+
+NEON-OBJS += aarch64/float_dsp_neon.o
diff --git a/chromium/third_party/ffmpeg/libavutil/aarch64/asm.S b/chromium/third_party/ffmpeg/libavutil/aarch64/asm.S
new file mode 100644
index 00000000000..51850ec7ba6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/aarch64/asm.S
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2008 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 "config.h"
+
+#ifdef __ELF__
+# define ELF
+#else
+# define ELF //
+#endif
+
+.macro function name, export=0, align=2
+ .macro endfunc
+ELF .size \name, . - \name
+ .endfunc
+ .purgem endfunc
+ .endm
+ .text
+ .align \align
+ .if \export
+ .global EXTERN_ASM\name
+ELF .type EXTERN_ASM\name, %function
+ .func EXTERN_ASM\name
+EXTERN_ASM\name:
+ .else
+ELF .type \name, %function
+ .func \name
+\name:
+ .endif
+.endm
+
+.macro const name, align=2
+ .macro endconst
+ELF .size \name, . - \name
+ .purgem endconst
+ .endm
+ .section .rodata
+ .align \align
+\name:
+.endm
+
+.macro movrel rd, val
+#if CONFIG_PIC
+ adrp \rd, #:pg_hi21:\val
+ add \rd, \rd, #:lo12:\val
+#else
+ ldr \rd, =\val
+#endif
+.endm
+
+#define GLUE(a, b) a ## b
+#define JOIN(a, b) GLUE(a, b)
+#define X(s) JOIN(EXTERN_ASM, s)
diff --git a/chromium/third_party/ffmpeg/libavutil/aarch64/bswap.h b/chromium/third_party/ffmpeg/libavutil/aarch64/bswap.h
new file mode 100644
index 00000000000..1e735c52cf7
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/aarch64/bswap.h
@@ -0,0 +1,50 @@
+/*
+ * 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 AVUTIL_AARCH64_BSWAP_H
+#define AVUTIL_AARCH64_BSWAP_H
+
+#include <stdint.h>
+#include "config.h"
+#include "libavutil/attributes.h"
+
+#if HAVE_INLINE_ASM
+
+#define av_bswap16 av_bswap16
+static av_always_inline av_const unsigned av_bswap16(unsigned x)
+{
+ __asm__("rev16 %w0, %w0" : "+r"(x));
+ return x;
+}
+
+#define av_bswap32 av_bswap32
+static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
+{
+ __asm__("rev %w0, %w0" : "+r"(x));
+ return x;
+}
+
+#define av_bswap64 av_bswap64
+static av_always_inline av_const uint64_t av_bswap64(uint64_t x)
+{
+ __asm__("rev %0, %0" : "+r"(x));
+ return x;
+}
+
+#endif /* HAVE_INLINE_ASM */
+#endif /* AVUTIL_AARCH64_BSWAP_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/aarch64/cpu.c b/chromium/third_party/ffmpeg/libavutil/aarch64/cpu.c
new file mode 100644
index 00000000000..8ef077aaea3
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/aarch64/cpu.c
@@ -0,0 +1,28 @@
+/*
+ * 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 "libavutil/cpu.h"
+#include "libavutil/cpu_internal.h"
+#include "config.h"
+
+int ff_get_cpu_flags_aarch64(void)
+{
+ return AV_CPU_FLAG_ARMV8 * HAVE_ARMV8 |
+ AV_CPU_FLAG_NEON * HAVE_NEON |
+ AV_CPU_FLAG_VFP * HAVE_VFP;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/sparc/dsputil_vis.h b/chromium/third_party/ffmpeg/libavutil/aarch64/cpu.h
index d7e2e63ab98..cf1b9cc5168 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sparc/dsputil_vis.h
+++ b/chromium/third_party/ffmpeg/libavutil/aarch64/cpu.h
@@ -16,13 +16,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef AVCODEC_SPARC_DSPUTIL_VIS_H
-#define AVCODEC_SPARC_DSPUTIL_VIS_H
+#ifndef AVUTIL_AARCH64_CPU_H
+#define AVUTIL_AARCH64_CPU_H
-#include <stdint.h>
+#include "config.h"
+#include "libavutil/cpu.h"
+#include "libavutil/cpu_internal.h"
-void ff_simple_idct_put_vis(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_vis(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_vis(int16_t *data);
+#define have_armv8(flags) CPUEXT(flags, ARMV8)
+#define have_neon(flags) CPUEXT(flags, NEON)
+#define have_vfp(flags) CPUEXT(flags, VFP)
-#endif /* AVCODEC_SPARC_DSPUTIL_VIS_H */
+#endif /* AVUTIL_AARCH64_CPU_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/aarch64/float_dsp_init.c b/chromium/third_party/ffmpeg/libavutil/aarch64/float_dsp_init.c
new file mode 100644
index 00000000000..4325071821c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/aarch64/float_dsp_init.c
@@ -0,0 +1,69 @@
+/*
+ * ARM NEON optimised Float DSP functions
+ * Copyright (c) 2008 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 "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/float_dsp.h"
+#include "cpu.h"
+
+void ff_vector_fmul_neon(float *dst, const float *src0, const float *src1,
+ int len);
+
+void ff_vector_fmac_scalar_neon(float *dst, const float *src, float mul,
+ int len);
+
+void ff_vector_fmul_scalar_neon(float *dst, const float *src, float mul,
+ int len);
+
+void ff_vector_dmul_scalar_neon(double *dst, const double *src, double mul,
+ int len);
+
+void ff_vector_fmul_window_neon(float *dst, const float *src0,
+ const float *src1, const float *win, int len);
+
+void ff_vector_fmul_add_neon(float *dst, const float *src0, const float *src1,
+ const float *src2, int len);
+
+void ff_vector_fmul_reverse_neon(float *dst, const float *src0,
+ const float *src1, int len);
+
+void ff_butterflies_float_neon(float *v1, float *v2, int len);
+
+float ff_scalarproduct_float_neon(const float *v1, const float *v2, int len);
+
+av_cold void ff_float_dsp_init_aarch64(AVFloatDSPContext *fdsp)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags)) {
+ fdsp->butterflies_float = ff_butterflies_float_neon;
+ fdsp->scalarproduct_float = ff_scalarproduct_float_neon;
+ fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_neon;
+ fdsp->vector_fmul = ff_vector_fmul_neon;
+ fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_neon;
+ fdsp->vector_fmul_add = ff_vector_fmul_add_neon;
+ fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_neon;
+ fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_neon;
+ fdsp->vector_fmul_window = ff_vector_fmul_window_neon;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavutil/aarch64/float_dsp_neon.S b/chromium/third_party/ffmpeg/libavutil/aarch64/float_dsp_neon.S
new file mode 100644
index 00000000000..02d790c0cc6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/aarch64/float_dsp_neon.S
@@ -0,0 +1,202 @@
+/*
+ * ARM NEON optimised Float DSP functions
+ * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
+ * Copyright (c) 2014 Janne Grunau <janne-libav@jannau.net>
+ *
+ * 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 "config.h"
+#include "asm.S"
+
+function ff_vector_fmul_neon, export=1
+1: subs w3, w3, #16
+ ld1 {v0.4S, v1.4S}, [x1], #32
+ ld1 {v2.4S, v3.4S}, [x1], #32
+ ld1 {v4.4S, v5.4S}, [x2], #32
+ ld1 {v6.4S, v7.4S}, [x2], #32
+ fmul v16.4S, v0.4S, v4.4S
+ fmul v17.4S, v1.4S, v5.4S
+ fmul v18.4S, v2.4S, v6.4S
+ fmul v19.4S, v3.4S, v7.4S
+ st1 {v16.4S, v17.4S}, [x0], #32
+ st1 {v18.4S, v19.4S}, [x0], #32
+ b.ne 1b
+ ret
+endfunc
+
+function ff_vector_fmac_scalar_neon, export=1
+ mov x3, #-32
+1: subs w2, w2, #16
+ ld1 {v16.4S, v17.4S}, [x0], #32
+ ld1 {v18.4S, v19.4S}, [x0], x3
+ ld1 {v4.4S, v5.4S}, [x1], #32
+ ld1 {v6.4S, v7.4S}, [x1], #32
+ fmla v16.4S, v4.4S, v0.S[0]
+ fmla v17.4S, v5.4S, v0.S[0]
+ fmla v18.4S, v6.4S, v0.S[0]
+ fmla v19.4S, v7.4S, v0.S[0]
+ st1 {v16.4S, v17.4S}, [x0], #32
+ st1 {v18.4S, v19.4S}, [x0], #32
+ b.ne 1b
+ ret
+endfunc
+
+function ff_vector_fmul_scalar_neon, export=1
+ mov w4, #15
+ bics w3, w2, w4
+ dup v16.4S, v0.S[0]
+ b.eq 3f
+ ld1 {v0.4S, v1.4S}, [x1], #32
+1: subs w3, w3, #16
+ fmul v0.4S, v0.4S, v16.4S
+ ld1 {v2.4S, v3.4S}, [x1], #32
+ fmul v1.4S, v1.4S, v16.4S
+ fmul v2.4S, v2.4S, v16.4S
+ st1 {v0.4S, v1.4S}, [x0], #32
+ fmul v3.4S, v3.4S, v16.4S
+ b.eq 2f
+ ld1 {v0.4S, v1.4S}, [x1], #32
+ st1 {v2.4S, v3.4S}, [x0], #32
+ b 1b
+2: ands w2, w2, #15
+ st1 {v2.4S, v3.4S}, [x0], #32
+ b.eq 4f
+3: ld1 {v0.4S}, [x1], #16
+ fmul v0.4S, v0.4S, v16.4S
+ st1 {v0.4S}, [x0], #16
+ subs w2, w2, #4
+ b.gt 3b
+4: ret
+endfunc
+
+function ff_vector_dmul_scalar_neon, export=1
+ dup v16.2D, v0.D[0]
+ ld1 {v0.2D, v1.2D}, [x1], #32
+1: subs w2, w2, #8
+ fmul v0.2D, v0.2D, v16.2D
+ ld1 {v2.2D, v3.2D}, [x1], #32
+ fmul v1.2D, v1.2D, v16.2D
+ fmul v2.2D, v2.2D, v16.2D
+ st1 {v0.2D, v1.2D}, [x0], #32
+ fmul v3.2D, v3.2D, v16.2D
+ ld1 {v0.2D, v1.2D}, [x1], #32
+ st1 {v2.2D, v3.2D}, [x0], #32
+ b.gt 1b
+ ret
+endfunc
+
+function ff_vector_fmul_window_neon, export=1
+ sxtw x4, w4 // len
+ sub x2, x2, #8
+ sub x5, x4, #2
+ add x2, x2, x5, lsl #2 // src1 + 4 * (len - 4)
+ add x6, x3, x5, lsl #3 // win + 8 * (len - 2)
+ add x5, x0, x5, lsl #3 // dst + 8 * (len - 2)
+ mov x7, #-16
+ ld1 {v0.4S}, [x1], #16 // s0
+ ld1 {v2.4S}, [x3], #16 // wi
+ ld1 {v1.4S}, [x2], x7 // s1
+1: ld1 {v3.4S}, [x6], x7 // wj
+ subs x4, x4, #4
+ fmul v17.4S, v0.4S, v2.4S // s0 * wi
+ rev64 v4.4S, v1.4S
+ rev64 v5.4S, v3.4S
+ rev64 v17.4S, v17.4S
+ ext v4.16B, v4.16B, v4.16B, #8 // s1_r
+ ext v5.16B, v5.16B, v5.16B, #8 // wj_r
+ ext v17.16B, v17.16B, v17.16B, #8 // (s0 * wi)_rev
+ fmul v16.4S, v0.4S, v5.4S // s0 * wj_r
+ fmla v17.4S, v1.4S, v3.4S // (s0 * wi)_rev + s1 * wj
+ b.eq 2f
+ ld1 {v0.4S}, [x1], #16
+ fmls v16.4S, v4.4S, v2.4S // s0 * wj_r - s1_r * wi
+ st1 {v17.4S}, [x5], x7
+ ld1 {v2.4S}, [x3], #16
+ ld1 {v1.4S}, [x2], x7
+ st1 {v16.4S}, [x0], #16
+ b 1b
+2:
+ fmls v16.4S, v4.4S, v2.4S // s0 * wj_r - s1_r * wi
+ st1 {v17.4S}, [x5], x7
+ st1 {v16.4S}, [x0], #16
+ ret
+endfunc
+
+function ff_vector_fmul_add_neon, export=1
+ ld1 {v0.4S, v1.4S}, [x1], #32
+ ld1 {v2.4S, v3.4S}, [x2], #32
+ ld1 {v4.4S, v5.4S}, [x3], #32
+1: subs w4, w4, #8
+ fmla v4.4S, v0.4S, v2.4S
+ fmla v5.4S, v1.4S, v3.4S
+ b.eq 2f
+ ld1 {v0.4S, v1.4S}, [x1], #32
+ ld1 {v2.4S, v3.4S}, [x2], #32
+ st1 {v4.4S, v5.4S}, [x0], #32
+ ld1 {v4.4S, v5.4S}, [x3], #32
+ b 1b
+2: st1 {v4.4S, v5.4S}, [x0], #32
+ ret
+endfunc
+
+function ff_vector_fmul_reverse_neon, export=1
+ sxtw x3, w3
+ add x2, x2, x3, lsl #2
+ sub x2, x2, #32
+ mov x4, #-32
+ ld1 {v2.4S, v3.4S}, [x2], x4
+ ld1 {v0.4S, v1.4S}, [x1], #32
+1: subs x3, x3, #8
+ rev64 v3.4S, v3.4S
+ rev64 v2.4S, v2.4S
+ ext v3.16B, v3.16B, v3.16B, #8
+ ext v2.16B, v2.16B, v2.16B, #8
+ fmul v16.4S, v0.4S, v3.4S
+ fmul v17.4S, v1.4S, v2.4S
+ b.eq 2f
+ ld1 {v2.4S, v3.4S}, [x2], x4
+ ld1 {v0.4S, v1.4S}, [x1], #32
+ st1 {v16.4S, v17.4S}, [x0], #32
+ b 1b
+2: st1 {v16.4S, v17.4S}, [x0], #32
+ ret
+endfunc
+
+function ff_butterflies_float_neon, export=1
+1: ld1 {v0.4S}, [x0]
+ ld1 {v1.4S}, [x1]
+ subs w2, w2, #4
+ fsub v2.4S, v0.4S, v1.4S
+ fadd v3.4S, v0.4S, v1.4S
+ st1 {v2.4S}, [x1], #16
+ st1 {v3.4S}, [x0], #16
+ b.gt 1b
+ ret
+endfunc
+
+function ff_scalarproduct_float_neon, export=1
+ movi v2.4S, #0
+1: ld1 {v0.4S}, [x0], #16
+ ld1 {v1.4S}, [x1], #16
+ subs w2, w2, #4
+ fmla v2.4S, v0.4S, v1.4S
+ b.gt 1b
+ faddp v0.4S, v2.4S, v2.4S
+ faddp s0, v0.2S
+ ret
+endfunc
diff --git a/chromium/third_party/ffmpeg/libavutil/aarch64/neontest.h b/chromium/third_party/ffmpeg/libavutil/aarch64/neontest.h
new file mode 100644
index 00000000000..b9d49860725
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/aarch64/neontest.h
@@ -0,0 +1,65 @@
+/*
+ * check NEON registers for clobbering
+ * Copyright (c) 2008 Ramiro Polla <ramiro.polla@gmail.com>
+ * Copyright (c) 2013 Martin Storsjo
+ *
+ * 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 <inttypes.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include "libavutil/bswap.h"
+
+#define storeneonregs(mem) \
+ __asm__ volatile( \
+ "stp d8, d9, [%0]\n\t" \
+ "stp d10, d11, [%0, #16]\n\t" \
+ "stp d12, d13, [%0, #32]\n\t" \
+ "stp d14, d15, [%0, #48]\n\t" \
+ :: "r"(mem) : "memory")
+
+#define testneonclobbers(func, ctx, ...) \
+ uint64_t neon[2][8]; \
+ int ret; \
+ storeneonregs(neon[0]); \
+ ret = __real_ ## func(ctx, __VA_ARGS__); \
+ storeneonregs(neon[1]); \
+ if (memcmp(neon[0], neon[1], sizeof(neon[0]))) { \
+ int i; \
+ av_log(ctx, AV_LOG_ERROR, \
+ "NEON REGS CLOBBERED IN %s!\n", #func); \
+ for (i = 0; i < 8; i ++) \
+ if (neon[0][i] != neon[1][i]) { \
+ av_log(ctx, AV_LOG_ERROR, \
+ "d%-2d = %016"PRIx64"\n", \
+ 8 + i, av_bswap64(neon[0][i])); \
+ av_log(ctx, AV_LOG_ERROR, \
+ " -> %016"PRIx64"\n", \
+ av_bswap64(neon[1][i])); \
+ } \
+ abort(); \
+ } \
+ return ret
+
+#define wrap(func) \
+int __real_ ## func; \
+int __wrap_ ## func; \
+int __wrap_ ## func
diff --git a/chromium/third_party/ffmpeg/libavutil/aes.c b/chromium/third_party/ffmpeg/libavutil/aes.c
index a3eb295e244..638fb81e8da 100644
--- a/chromium/third_party/ffmpeg/libavutil/aes.c
+++ b/chromium/third_party/ffmpeg/libavutil/aes.c
@@ -23,6 +23,7 @@
#include "common.h"
#include "aes.h"
#include "intreadwrite.h"
+#include "timer.h"
typedef union {
uint64_t u64[2];
diff --git a/chromium/third_party/ffmpeg/libavutil/arm/asm.S b/chromium/third_party/ffmpeg/libavutil/arm/asm.S
index 9cdcce9a180..08669f043cf 100644
--- a/chromium/third_party/ffmpeg/libavutil/arm/asm.S
+++ b/chromium/third_party/ffmpeg/libavutil/arm/asm.S
@@ -53,8 +53,9 @@
.syntax unified
T .thumb
ELF .eabi_attribute 25, 1 @ Tag_ABI_align_preserved
+ELF .section .note.GNU-stack,"",%progbits @ Mark stack as non-executable
-.macro function name, export=0
+.macro function name, export=0, align=2
.set .Lpic_idx, 0
.set .Lpic_gp, 0
.macro endfunc
@@ -69,14 +70,17 @@ ELF .size \name, . - \name
.purgem endfunc
.endm
.text
- .align 2
+ .align \align
.if \export
.global EXTERN_ASM\name
+ELF .type EXTERN_ASM\name, %function
+ .func EXTERN_ASM\name
EXTERN_ASM\name:
- .endif
+ .else
ELF .type \name, %function
.func \name
\name:
+ .endif
.endm
.macro const name, align=2
@@ -212,6 +216,13 @@ T ldr \rt, [\rn]
T add \rn, \rn, \rm
.endm
+.macro ldrc_pre cc, rt, rn, rm:vararg
+A ldr\cc \rt, [\rn, \rm]!
+T itt \cc
+T add\cc \rn, \rn, \rm
+T ldr\cc \rt, [\rn]
+.endm
+
.macro ldrd_reg rt, rt2, rn, rm
A ldrd \rt, \rt2, [\rn, \rm]
T add \rt, \rn, \rm
diff --git a/chromium/third_party/ffmpeg/libavutil/arm/float_dsp_init_arm.c b/chromium/third_party/ffmpeg/libavutil/arm/float_dsp_init_arm.c
index 38148b38786..678762862ec 100644
--- a/chromium/third_party/ffmpeg/libavutil/arm/float_dsp_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavutil/arm/float_dsp_init_arm.c
@@ -1,6 +1,4 @@
/*
- * ARM optimized DSP utils
- *
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
diff --git a/chromium/third_party/ffmpeg/libavutil/arm/intmath.h b/chromium/third_party/ffmpeg/libavutil/arm/intmath.h
index fd52648f884..faea5ea4032 100644
--- a/chromium/third_party/ffmpeg/libavutil/arm/intmath.h
+++ b/chromium/third_party/ffmpeg/libavutil/arm/intmath.h
@@ -62,6 +62,11 @@ static av_always_inline av_const int av_clip_int16_arm(int a)
return x;
}
+/*
+TODO(dalecurtis): This causes compilation to fail if the function can't be
+inlined because the 2nd operand in usat must be an immediate. So disable since
+av_always_inline doesn't seem to really mean always...
+
#define av_clip_uintp2 av_clip_uintp2_arm
static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
{
@@ -69,6 +74,7 @@ static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
__asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
return x;
}
+*/
#define av_sat_add32 av_sat_add32_arm
static av_always_inline int av_sat_add32_arm(int a, int b)
diff --git a/chromium/third_party/ffmpeg/libavutil/arm/neontest.h b/chromium/third_party/ffmpeg/libavutil/arm/neontest.h
new file mode 100644
index 00000000000..f668c00733f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/arm/neontest.h
@@ -0,0 +1,62 @@
+/*
+ * check NEON registers for clobbering
+ * Copyright (c) 2008 Ramiro Polla <ramiro.polla@gmail.com>
+ * Copyright (c) 2013 Martin Storsjo
+ *
+ * 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 <inttypes.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include "libavutil/bswap.h"
+
+#define storeneonregs(mem) \
+ __asm__ volatile( \
+ "vstm %0, {d8-d15}\n\t" \
+ :: "r"(mem) : "memory")
+
+#define testneonclobbers(func, ctx, ...) \
+ uint64_t neon[2][8]; \
+ int ret; \
+ storeneonregs(neon[0]); \
+ ret = __real_ ## func(ctx, __VA_ARGS__); \
+ storeneonregs(neon[1]); \
+ if (memcmp(neon[0], neon[1], sizeof(neon[0]))) { \
+ int i; \
+ av_log(ctx, AV_LOG_ERROR, \
+ "NEON REGS CLOBBERED IN %s!\n", #func); \
+ for (i = 0; i < 8; i ++) \
+ if (neon[0][i] != neon[1][i]) { \
+ av_log(ctx, AV_LOG_ERROR, \
+ "d%-2d = %016"PRIx64"\n", \
+ 8 + i, av_bswap64(neon[0][i])); \
+ av_log(ctx, AV_LOG_ERROR, \
+ " -> %016"PRIx64"\n", \
+ av_bswap64(neon[1][i])); \
+ } \
+ abort(); \
+ } \
+ return ret
+
+#define wrap(func) \
+int __real_ ## func; \
+int __wrap_ ## func; \
+int __wrap_ ## func
diff --git a/chromium/third_party/ffmpeg/libavutil/atomic.c b/chromium/third_party/ffmpeg/libavutil/atomic.c
index 04182f2330b..1fa63086309 100644
--- a/chromium/third_party/ffmpeg/libavutil/atomic.c
+++ b/chromium/third_party/ffmpeg/libavutil/atomic.c
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
#include "atomic.h"
#if !HAVE_ATOMICS_NATIVE
@@ -96,13 +97,16 @@ void *avpriv_atomic_ptr_cas(void * volatile *ptr, void *oldval, void *newval)
return *ptr;
}
-#else
+#else /* HAVE_THREADS */
+/* This should never trigger, unless a new threading implementation
+ * without correct atomics dependencies in configure or a corresponding
+ * atomics implementation is added. */
#error "Threading is enabled, but there is no implementation of atomic operations available"
#endif /* HAVE_PTHREADS */
-#endif /* !HAVE_MEMORYBARRIER && !HAVE_SYNC_VAL_COMPARE_AND_SWAP && !HAVE_MACHINE_RW_BARRIER */
+#endif /* !HAVE_ATOMICS_NATIVE */
#ifdef TEST
#include "avassert.h"
diff --git a/chromium/third_party/ffmpeg/libavutil/atomic.h b/chromium/third_party/ffmpeg/libavutil/atomic.h
index fd7d8fc03e0..15906d24c9c 100644
--- a/chromium/third_party/ffmpeg/libavutil/atomic.h
+++ b/chromium/third_party/ffmpeg/libavutil/atomic.h
@@ -23,12 +23,16 @@
#include "config.h"
+#if HAVE_ATOMICS_NATIVE
+
#if HAVE_ATOMICS_GCC
#include "atomic_gcc.h"
#elif HAVE_ATOMICS_WIN32
#include "atomic_win32.h"
#elif HAVE_ATOMICS_SUNCC
#include "atomic_suncc.h"
+#endif
+
#else
/**
@@ -70,5 +74,6 @@ int avpriv_atomic_int_add_and_fetch(volatile int *ptr, int inc);
*/
void *avpriv_atomic_ptr_cas(void * volatile *ptr, void *oldval, void *newval);
-#endif /* HAVE_MEMORYBARRIER */
+#endif /* HAVE_ATOMICS_NATIVE */
+
#endif /* AVUTIL_ATOMIC_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/audio_fifo.c b/chromium/third_party/ffmpeg/libavutil/audio_fifo.c
index cfbde899235..c3aadfdab70 100644
--- a/chromium/third_party/ffmpeg/libavutil/audio_fifo.c
+++ b/chromium/third_party/ffmpeg/libavutil/audio_fifo.c
@@ -76,7 +76,7 @@ AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
af->sample_size = buf_size / nb_samples;
af->nb_buffers = av_sample_fmt_is_planar(sample_fmt) ? channels : 1;
- af->buf = av_mallocz(af->nb_buffers * sizeof(*af->buf));
+ af->buf = av_mallocz_array(af->nb_buffers, sizeof(*af->buf));
if (!af->buf)
goto error;
diff --git a/chromium/third_party/ffmpeg/libavutil/avstring.c b/chromium/third_party/ffmpeg/libavutil/avstring.c
index 20931071b32..e75cdc63120 100644
--- a/chromium/third_party/ffmpeg/libavutil/avstring.c
+++ b/chromium/third_party/ffmpeg/libavutil/avstring.c
@@ -331,15 +331,15 @@ int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end,
while (code & top) {
int tmp;
if (p >= buf_end) {
- ret = AVERROR(EILSEQ); /* incomplete sequence */
- goto end;
+ (*bufp) ++;
+ return AVERROR(EILSEQ); /* incomplete sequence */
}
/* we assume the byte to be in the form 10xx-xxxx */
tmp = *p++ - 128; /* strip leading 1 */
if (tmp>>6) {
- ret = AVERROR(EILSEQ);
- goto end;
+ (*bufp) ++;
+ return AVERROR(EILSEQ);
}
code = (code<<6) + tmp;
top <<= 5;
@@ -362,8 +362,8 @@ int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end,
if (code >= 0xD800 && code <= 0xDFFF &&
!(flags & AV_UTF8_FLAG_ACCEPT_SURROGATES))
ret = AVERROR(EILSEQ);
- if (code == 0xFFFE || code == 0xFFFF &&
- (!flags & AV_UTF8_FLAG_ACCEPT_NON_CHARACTERS))
+ if ((code == 0xFFFE || code == 0xFFFF) &&
+ !(flags & AV_UTF8_FLAG_ACCEPT_NON_CHARACTERS))
ret = AVERROR(EILSEQ);
end:
diff --git a/chromium/third_party/ffmpeg/libavutil/avstring.h b/chromium/third_party/ffmpeg/libavutil/avstring.h
index 882a2b57dc2..de2f71d12b6 100644
--- a/chromium/third_party/ffmpeg/libavutil/avstring.h
+++ b/chromium/third_party/ffmpeg/libavutil/avstring.h
@@ -132,6 +132,20 @@ size_t av_strlcat(char *dst, const char *src, size_t size);
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4);
/**
+ * Get the count of continuous non zero chars starting from the beginning.
+ *
+ * @param len maximum number of characters to check in the string, that
+ * is the maximum value which is returned by the function
+ */
+static inline size_t av_strnlen(const char *s, size_t len)
+{
+ size_t i;
+ for (i = 0; i < len && s[i]; i++)
+ ;
+ return i;
+}
+
+/**
* Print arguments following specified format into a large enough auto
* allocated buffer. It is similar to GNU asprintf().
* @param fmt printf-compatible format string, specifying how the
diff --git a/chromium/third_party/ffmpeg/libavutil/avutil.h b/chromium/third_party/ffmpeg/libavutil/avutil.h
index 4e680ed0e01..ba6bb020513 100644
--- a/chromium/third_party/ffmpeg/libavutil/avutil.h
+++ b/chromium/third_party/ffmpeg/libavutil/avutil.h
@@ -41,7 +41,7 @@
* @li @ref lavu "libavutil" common utility library
* @li @ref lswr "libswresample" audio resampling, format conversion and mixing
* @li @ref lpp "libpostproc" post processing library
- * @li @ref lsws "libswscale" color conversion and scaling library
+ * @li @ref libsws "libswscale" color conversion and scaling library
*
* @section ffmpeg_versioning Versioning and compatibility
*
@@ -145,6 +145,12 @@
* @{
*
* @}
+ *
+ * @defgroup preproc_misc Preprocessor String Macros
+ *
+ * @{
+ *
+ * @}
*/
@@ -276,10 +282,10 @@ char av_get_picture_type_char(enum AVPictureType pict_type);
#include "common.h"
#include "error.h"
+#include "rational.h"
#include "version.h"
+#include "macros.h"
#include "mathematics.h"
-#include "rational.h"
-#include "intfloat_readwrite.h"
#include "log.h"
#include "pixfmt.h"
@@ -320,6 +326,11 @@ unsigned av_int_list_length_for_size(unsigned elsize,
FILE *av_fopen_utf8(const char *path, const char *mode);
/**
+ * Return the fractional representation of the internal time base.
+ */
+AVRational av_get_time_base_q(void);
+
+/**
* @}
* @}
*/
diff --git a/chromium/third_party/ffmpeg/libavutil/base64.c b/chromium/third_party/ffmpeg/libavutil/base64.c
index 348690d32e7..03ebce8b803 100644
--- a/chromium/third_party/ffmpeg/libavutil/base64.c
+++ b/chromium/third_party/ffmpeg/libavutil/base64.c
@@ -27,6 +27,7 @@
#include "common.h"
#include "base64.h"
#include "intreadwrite.h"
+#include "timer.h"
/* ---------------- private code */
static const uint8_t map2[256] =
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfin/config_bfin.h b/chromium/third_party/ffmpeg/libavutil/bfin/asm.h
index 36439530e9f..703e65d9a8c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bfin/config_bfin.h
+++ b/chromium/third_party/ffmpeg/libavutil/bfin/asm.h
@@ -17,49 +17,38 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/*
- low level assembler interface wrapper
-
-DEFUN(put_pixels_clamped,mL1,
- (int16_t *block, uint8_t *dest, int line_size)):
-
- body
- rts;
-*/
-
-#ifndef AVCODEC_BFIN_CONFIG_BFIN_H
-#define AVCODEC_BFIN_CONFIG_BFIN_H
+#ifndef AVUTIL_BFIN_ASM_H
+#define AVUTIL_BFIN_ASM_H
#include "config.h"
-#ifndef DEFUN
-
#define mL3 .text
-#ifndef mL1
+
#if defined(__FDPIC__) && CONFIG_SRAM
#define mL1 .l1.text
+#define SECTION_L1_DATA_A .section .l1.data.A,"aw",@progbits
+#define SECTION_L1_DATA_B .section .l1.data.B,"aw",@progbits
#else
#define mL1 mL3
-#endif
+#define SECTION_L1_DATA_A
+#define SECTION_L1_DATA_B .data
#endif
-#define DEFUN(fname,where,interface) \
- .section where; \
- .global _ff_bfin_ ## fname ; \
- .type _ff_bfin_ ## fname, STT_FUNC; \
- .align 8; \
- _ff_bfin_ ## fname
+#define DEFUN(fname, where, interface) \
+ .section where; \
+ .global _ff_bfin_ ## fname; \
+ .type _ff_bfin_ ## fname, STT_FUNC; \
+ .align 8; \
+ _ff_bfin_ ## fname
#define DEFUN_END(fname) \
- .size _ff_bfin_ ## fname, . - _ff_bfin_ ## fname
+ .size _ff_bfin_ ## fname, . - _ff_bfin_ ## fname
#ifdef __FDPIC__
-#define RELOC(reg,got,obj) reg = [got + obj@GOT17M4]
+#define RELOC(reg, got, obj) reg = [got + obj@GOT17M4]
#else
-#define RELOC(reg,got,obj) reg.L = obj; reg.H = obj
-#endif
-
+#define RELOC(reg, got, obj) reg.L = obj; reg.H = obj
#endif
-#endif /* AVCODEC_BFIN_CONFIG_BFIN_H */
+#endif /* AVUTIL_BFIN_ASM_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/rnd_mmx.c b/chromium/third_party/ffmpeg/libavutil/bfin/attributes.h
index 326e2f395b6..f55699e523b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/rnd_mmx.c
+++ b/chromium/third_party/ffmpeg/libavutil/bfin/attributes.h
@@ -1,4 +1,6 @@
/*
+ * Copyright (C) 2007 Marc Hoffman <mmh@pleasantst.com>
+ *
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
@@ -16,20 +18,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config.h"
-#include "dsputil_x86.h"
-
-#if HAVE_INLINE_ASM
+#ifndef AVUTIL_BFIN_ATTRIBUTES_H
+#define AVUTIL_BFIN_ATTRIBUTES_H
-#define DEF(x, y) ff_ ## x ## _ ## y ## _mmx
-#define SET_RND MOVQ_WTWO
-#define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX(a, b, c, d, e, f)
-#define PAVGB(a, b, c, e) PAVGB_MMX(a, b, c, e)
-#define STATIC
-
-#include "rnd_template.c"
+#include "config.h"
-PIXELS16(, ff_avg, , _xy2, _mmx)
-PIXELS16(, ff_put, , _xy2, _mmx)
+#if defined(__FDPIC__) && CONFIG_SRAM
+#define attribute_l1_text __attribute__((l1_text))
+#define attribute_l1_data_b __attribute__((l1_data_B))
+#else
+#define attribute_l1_text
+#define attribute_l1_data_b
+#endif
-#endif /* HAVE_INLINE_ASM */
+#endif /* AVUTIL_BFIN_ATTRIBUTES_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/bswap.h b/chromium/third_party/ffmpeg/libavutil/bswap.h
index 06f654816d8..f38e1dec83d 100644
--- a/chromium/third_party/ffmpeg/libavutil/bswap.h
+++ b/chromium/third_party/ffmpeg/libavutil/bswap.h
@@ -34,7 +34,9 @@
#include "config.h"
-#if ARCH_ARM
+#if ARCH_AARCH64
+# include "aarch64/bswap.h"
+#elif ARCH_ARM
# include "arm/bswap.h"
#elif ARCH_AVR32
# include "avr32/bswap.h"
diff --git a/chromium/third_party/ffmpeg/libavutil/channel_layout.h b/chromium/third_party/ffmpeg/libavutil/channel_layout.h
index ba4f96d2d04..bc6befd8e38 100644
--- a/chromium/third_party/ffmpeg/libavutil/channel_layout.h
+++ b/chromium/third_party/ffmpeg/libavutil/channel_layout.h
@@ -114,6 +114,10 @@ enum AVMatrixEncoding {
AV_MATRIX_ENCODING_NONE,
AV_MATRIX_ENCODING_DOLBY,
AV_MATRIX_ENCODING_DPLII,
+ AV_MATRIX_ENCODING_DPLIIX,
+ AV_MATRIX_ENCODING_DPLIIZ,
+ AV_MATRIX_ENCODING_DOLBYEX,
+ AV_MATRIX_ENCODING_DOLBYHEADPHONE,
AV_MATRIX_ENCODING_NB
};
diff --git a/chromium/third_party/ffmpeg/libavutil/cpu.c b/chromium/third_party/ffmpeg/libavutil/cpu.c
index e0806b18560..c4517bab673 100644
--- a/chromium/third_party/ffmpeg/libavutil/cpu.c
+++ b/chromium/third_party/ffmpeg/libavutil/cpu.c
@@ -56,9 +56,14 @@ int av_get_cpu_flags(void)
if (checked)
return flags;
- if (ARCH_ARM) flags = ff_get_cpu_flags_arm();
- if (ARCH_PPC) flags = ff_get_cpu_flags_ppc();
- if (ARCH_X86) flags = ff_get_cpu_flags_x86();
+ if (ARCH_AARCH64)
+ flags = ff_get_cpu_flags_aarch64();
+ if (ARCH_ARM)
+ flags = ff_get_cpu_flags_arm();
+ if (ARCH_PPC)
+ flags = ff_get_cpu_flags_ppc();
+ if (ARCH_X86)
+ flags = ff_get_cpu_flags_x86();
checked = 1;
return flags;
@@ -86,8 +91,11 @@ int av_parse_cpu_flags(const char *s)
#define CPUFLAG_SSE42 (AV_CPU_FLAG_SSE42 | CPUFLAG_SSE4)
#define CPUFLAG_AVX (AV_CPU_FLAG_AVX | CPUFLAG_SSE42)
#define CPUFLAG_XOP (AV_CPU_FLAG_XOP | CPUFLAG_AVX)
+#define CPUFLAG_FMA3 (AV_CPU_FLAG_FMA3 | CPUFLAG_AVX)
#define CPUFLAG_FMA4 (AV_CPU_FLAG_FMA4 | CPUFLAG_AVX)
#define CPUFLAG_AVX2 (AV_CPU_FLAG_AVX2 | CPUFLAG_AVX)
+#define CPUFLAG_BMI1 (AV_CPU_FLAG_BMI1)
+#define CPUFLAG_BMI2 (AV_CPU_FLAG_BMI2 | CPUFLAG_BMI1)
static const AVOption cpuflags_opts[] = {
{ "flags" , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" },
#if ARCH_PPC
@@ -106,8 +114,11 @@ int av_parse_cpu_flags(const char *s)
{ "sse4.2" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE42 }, .unit = "flags" },
{ "avx" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVX }, .unit = "flags" },
{ "xop" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_XOP }, .unit = "flags" },
+ { "fma3" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_FMA3 }, .unit = "flags" },
{ "fma4" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_FMA4 }, .unit = "flags" },
{ "avx2" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVX2 }, .unit = "flags" },
+ { "bmi1" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_BMI1 }, .unit = "flags" },
+ { "bmi2" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_BMI2 }, .unit = "flags" },
{ "3dnow" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOW }, .unit = "flags" },
{ "3dnowext", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOWEXT }, .unit = "flags" },
{ "cmov", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_CMOV }, .unit = "flags" },
@@ -118,6 +129,10 @@ int av_parse_cpu_flags(const char *s)
{ "vfp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP }, .unit = "flags" },
{ "vfpv3", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFPV3 }, .unit = "flags" },
{ "neon", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON }, .unit = "flags" },
+#elif ARCH_AARCH64
+ { "armv8", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ARMV8 }, .unit = "flags" },
+ { "neon", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON }, .unit = "flags" },
+ { "vfp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP }, .unit = "flags" },
#endif
{ NULL },
};
@@ -158,7 +173,11 @@ int av_parse_cpu_caps(unsigned *flags, const char *s)
{ "sse4.2" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_SSE42 }, .unit = "flags" },
{ "avx" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_AVX }, .unit = "flags" },
{ "xop" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_XOP }, .unit = "flags" },
+ { "fma3" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_FMA3 }, .unit = "flags" },
{ "fma4" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_FMA4 }, .unit = "flags" },
+ { "avx2" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_AVX2 }, .unit = "flags" },
+ { "bmi1" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_BMI1 }, .unit = "flags" },
+ { "bmi2" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_BMI2 }, .unit = "flags" },
{ "3dnow" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_3DNOW }, .unit = "flags" },
{ "3dnowext", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_3DNOWEXT }, .unit = "flags" },
{ "cmov", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_CMOV }, .unit = "flags" },
@@ -244,7 +263,11 @@ static const struct {
int flag;
const char *name;
} cpu_flag_tab[] = {
-#if ARCH_ARM
+#if ARCH_AARCH64
+ { AV_CPU_FLAG_ARMV8, "armv8" },
+ { AV_CPU_FLAG_NEON, "neon" },
+ { AV_CPU_FLAG_VFP, "vfp" },
+#elif ARCH_ARM
{ AV_CPU_FLAG_ARMV5TE, "armv5te" },
{ AV_CPU_FLAG_ARMV6, "armv6" },
{ AV_CPU_FLAG_ARMV6T2, "armv6t2" },
@@ -267,11 +290,14 @@ static const struct {
{ AV_CPU_FLAG_SSE42, "sse4.2" },
{ AV_CPU_FLAG_AVX, "avx" },
{ AV_CPU_FLAG_XOP, "xop" },
+ { AV_CPU_FLAG_FMA3, "fma3" },
{ AV_CPU_FLAG_FMA4, "fma4" },
{ AV_CPU_FLAG_3DNOW, "3dnow" },
{ AV_CPU_FLAG_3DNOWEXT, "3dnowext" },
{ AV_CPU_FLAG_CMOV, "cmov" },
{ AV_CPU_FLAG_AVX2, "avx2" },
+ { AV_CPU_FLAG_BMI1, "bmi1" },
+ { AV_CPU_FLAG_BMI2, "bmi2" },
#endif
{ 0 }
};
diff --git a/chromium/third_party/ffmpeg/libavutil/cpu.h b/chromium/third_party/ffmpeg/libavutil/cpu.h
index 55c3ec9a06f..8ff14d3adaa 100644
--- a/chromium/third_party/ffmpeg/libavutil/cpu.h
+++ b/chromium/third_party/ffmpeg/libavutil/cpu.h
@@ -51,6 +51,9 @@
// #define AV_CPU_FLAG_CMOV 0x1000 ///< supports cmov instruction
// #endif
#define AV_CPU_FLAG_AVX2 0x8000 ///< AVX2 functions: requires OS support even if YMM registers aren't used
+#define AV_CPU_FLAG_FMA3 0x10000 ///< Haswell FMA3 functions
+#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1
+#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2
#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
@@ -60,6 +63,7 @@
#define AV_CPU_FLAG_VFP (1 << 3)
#define AV_CPU_FLAG_VFPV3 (1 << 4)
#define AV_CPU_FLAG_NEON (1 << 5)
+#define AV_CPU_FLAG_ARMV8 (1 << 6)
/**
* Return the flags which specify extensions supported by the CPU.
diff --git a/chromium/third_party/ffmpeg/libavutil/cpu_internal.h b/chromium/third_party/ffmpeg/libavutil/cpu_internal.h
index 8597a32eb77..3c6ce6d079c 100644
--- a/chromium/third_party/ffmpeg/libavutil/cpu_internal.h
+++ b/chromium/third_party/ffmpeg/libavutil/cpu_internal.h
@@ -26,6 +26,7 @@
#define CPUEXT(flags, cpuext) CPUEXT_SUFFIX(flags, , cpuext)
+int ff_get_cpu_flags_aarch64(void);
int ff_get_cpu_flags_arm(void);
int ff_get_cpu_flags_ppc(void);
int ff_get_cpu_flags_x86(void);
diff --git a/chromium/third_party/ffmpeg/libavutil/crc.c b/chromium/third_party/ffmpeg/libavutil/crc.c
index b429fe1e354..d8b1c99d1cb 100644
--- a/chromium/third_party/ffmpeg/libavutil/crc.c
+++ b/chromium/third_party/ffmpeg/libavutil/crc.c
@@ -248,6 +248,41 @@ static const AVCRC av_crc_table[AV_CRC_MAX][257] = {
0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D, 0x00000001
},
+ [AV_CRC_16_ANSI_LE] = {
+ 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
+ 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
+ 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40,
+ 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841,
+ 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40,
+ 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41,
+ 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641,
+ 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040,
+ 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240,
+ 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441,
+ 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41,
+ 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840,
+ 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41,
+ 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40,
+ 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640,
+ 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041,
+ 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240,
+ 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441,
+ 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41,
+ 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840,
+ 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41,
+ 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40,
+ 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640,
+ 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041,
+ 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241,
+ 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440,
+ 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40,
+ 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841,
+ 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40,
+ 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41,
+ 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641,
+ 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040,
+ 0x0001
+ },
};
#else
#if CONFIG_SMALL
@@ -266,6 +301,7 @@ static struct {
[AV_CRC_24_IEEE] = { 0, 24, 0x864CFB },
[AV_CRC_32_IEEE] = { 0, 32, 0x04C11DB7 },
[AV_CRC_32_IEEE_LE] = { 1, 32, 0xEDB88320 },
+ [AV_CRC_16_ANSI_LE] = { 1, 16, 0xA001 },
};
static AVCRC av_crc_table[AV_CRC_MAX][CRC_TABLE_SIZE];
#endif
@@ -347,9 +383,10 @@ int main(void)
{
uint8_t buf[1999];
int i;
- int p[5][3] = { { AV_CRC_32_IEEE_LE, 0xEDB88320, 0x3D5CDD04 },
+ int p[6][3] = { { AV_CRC_32_IEEE_LE, 0xEDB88320, 0x3D5CDD04 },
{ AV_CRC_32_IEEE , 0x04C11DB7, 0xC0F5BAE0 },
{ AV_CRC_24_IEEE , 0x864CFB , 0xB704CE },
+ { AV_CRC_16_ANSI_LE, 0xA001 , 0xBFD8 },
{ AV_CRC_16_ANSI , 0x8005 , 0x1FBB },
{ AV_CRC_8_ATM , 0x07 , 0xE3 }
};
@@ -358,7 +395,7 @@ int main(void)
for (i = 0; i < sizeof(buf); i++)
buf[i] = i + i * i;
- for (i = 0; i < 5; i++) {
+ for (i = 0; i < 6; i++) {
ctx = av_crc_get_table(p[i][0]);
printf("crc %08X = %X\n", p[i][1], av_crc(ctx, 0, buf, sizeof(buf)));
}
diff --git a/chromium/third_party/ffmpeg/libavutil/crc.h b/chromium/third_party/ffmpeg/libavutil/crc.h
index f4219ca5bb0..e86bf1deba1 100644
--- a/chromium/third_party/ffmpeg/libavutil/crc.h
+++ b/chromium/third_party/ffmpeg/libavutil/crc.h
@@ -39,6 +39,7 @@ typedef enum {
AV_CRC_16_CCITT,
AV_CRC_32_IEEE,
AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
+ AV_CRC_16_ANSI_LE, /*< reversed bitorder version of AV_CRC_16_ANSI */
AV_CRC_24_IEEE = 12,
AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
}AVCRCId;
diff --git a/chromium/third_party/ffmpeg/libavutil/dict.c b/chromium/third_party/ffmpeg/libavutil/dict.c
index 3a0e84cd407..f7aa7094ad0 100644
--- a/chromium/third_party/ffmpeg/libavutil/dict.c
+++ b/chromium/third_party/ffmpeg/libavutil/dict.c
@@ -35,40 +35,47 @@ int av_dict_count(const AVDictionary *m)
return m ? m->count : 0;
}
-AVDictionaryEntry *
-av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
+AVDictionaryEntry *av_dict_get(FF_CONST_AVUTIL53 AVDictionary *m, const char *key,
+ const AVDictionaryEntry *prev, int flags)
{
unsigned int i, j;
- if(!m)
+ if (!m)
return NULL;
- if(prev) i= prev - m->elems + 1;
- else i= 0;
+ if (prev)
+ i = prev - m->elems + 1;
+ else
+ i = 0;
- for(; i<m->count; i++){
- const char *s= m->elems[i].key;
- if(flags & AV_DICT_MATCH_CASE) for(j=0; s[j] == key[j] && key[j]; j++);
- else for(j=0; av_toupper(s[j]) == av_toupper(key[j]) && key[j]; j++);
- if(key[j])
+ for (; i < m->count; i++) {
+ const char *s = m->elems[i].key;
+ if (flags & AV_DICT_MATCH_CASE)
+ for (j = 0; s[j] == key[j] && key[j]; j++)
+ ;
+ else
+ for (j = 0; av_toupper(s[j]) == av_toupper(key[j]) && key[j]; j++)
+ ;
+ if (key[j])
continue;
- if(s[j] && !(flags & AV_DICT_IGNORE_SUFFIX))
+ if (s[j] && !(flags & AV_DICT_IGNORE_SUFFIX))
continue;
return &m->elems[i];
}
return NULL;
}
-int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
+int av_dict_set(AVDictionary **pm, const char *key, const char *value,
+ int flags)
{
- AVDictionary *m = *pm;
+ AVDictionary *m = *pm;
AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags);
char *oldval = NULL;
- if(!m)
+ if (!m)
m = *pm = av_mallocz(sizeof(*m));
- if(tag) {
+ if (tag) {
if (flags & AV_DICT_DONT_OVERWRITE)
return 0;
if (flags & AV_DICT_APPEND)
@@ -78,16 +85,17 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags
av_free(tag->key);
*tag = m->elems[--m->count];
} else {
- AVDictionaryEntry *tmp = av_realloc(m->elems, (m->count+1) * sizeof(*m->elems));
- if(tmp) {
+ AVDictionaryEntry *tmp = av_realloc(m->elems,
+ (m->count + 1) * sizeof(*m->elems));
+ if (tmp)
m->elems = tmp;
- } else
+ else
return AVERROR(ENOMEM);
}
if (value) {
- if (flags & AV_DICT_DONT_STRDUP_KEY) {
+ if (flags & AV_DICT_DONT_STRDUP_KEY)
m->elems[m->count].key = (char*)(intptr_t)key;
- } else
+ else
m->elems[m->count].key = av_strdup(key);
if (flags & AV_DICT_DONT_STRDUP_VAL) {
m->elems[m->count].value = (char*)(intptr_t)value;
@@ -164,7 +172,7 @@ void av_dict_free(AVDictionary **pm)
AVDictionary *m = *pm;
if (m) {
- while(m->count--) {
+ while (m->count--) {
av_free(m->elems[m->count].key);
av_free(m->elems[m->count].value);
}
@@ -173,7 +181,7 @@ void av_dict_free(AVDictionary **pm)
av_freep(pm);
}
-void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags)
+void av_dict_copy(AVDictionary **dst, FF_CONST_AVUTIL53 AVDictionary *src, int flags)
{
AVDictionaryEntry *t = NULL;
diff --git a/chromium/third_party/ffmpeg/libavutil/dict.h b/chromium/third_party/ffmpeg/libavutil/dict.h
index 1dfc5a6443a..cf77cf9a323 100644
--- a/chromium/third_party/ffmpeg/libavutil/dict.h
+++ b/chromium/third_party/ffmpeg/libavutil/dict.h
@@ -31,6 +31,8 @@
#ifndef AVUTIL_DICT_H
#define AVUTIL_DICT_H
+#include "version.h"
+
/**
* @addtogroup lavu_dict AVDictionary
* @ingroup lavu_data
@@ -46,21 +48,21 @@
* entries and finally av_dict_free() to free the dictionary
* and all its contents.
*
- * @code
- * AVDictionary *d = NULL; // "create" an empty dictionary
- * av_dict_set(&d, "foo", "bar", 0); // add an entry
- *
- * char *k = av_strdup("key"); // if your strings are already allocated,
- * char *v = av_strdup("value"); // you can avoid copying them like this
- * av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
- *
- * AVDictionaryEntry *t = NULL;
- * while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
- * <....> // iterate over all entries in d
- * }
- *
- * av_dict_free(&d);
- * @endcode
+ @code
+ AVDictionary *d = NULL; // "create" an empty dictionary
+ AVDictionaryEntry *t = NULL;
+
+ av_dict_set(&d, "foo", "bar", 0); // add an entry
+
+ char *k = av_strdup("key"); // if your strings are already allocated,
+ char *v = av_strdup("value"); // you can avoid copying them like this
+ av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
+
+ while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
+ <....> // iterate over all entries in d
+ }
+ av_dict_free(&d);
+ @endcode
*
*/
@@ -85,17 +87,20 @@ typedef struct AVDictionary AVDictionary;
/**
* Get a dictionary entry with matching key.
*
+ * The returned entry key or value must not be changed, or it will
+ * cause undefined behavior.
+ *
* To iterate through all the dictionary entries, you can set the matching key
* to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag.
*
* @param prev Set to the previous matching element to find the next.
* If set to NULL the first matching element is returned.
* @param key matching key
- * @param flags Allows case as well as suffix-insensitive comparisons.
- * @return Found entry or NULL, changing key or value leads to undefined behavior.
+ * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved
+ * @return found entry or NULL in case no matching entry was found in the dictionary
*/
AVDictionaryEntry *
-av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
+av_dict_get(FF_CONST_AVUTIL53 AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
/**
* Get number of entries in dictionary.
@@ -145,7 +150,7 @@ int av_dict_parse_string(AVDictionary **pm, const char *str,
* @param flags flags to use when setting entries in *dst
* @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
*/
-void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
+void av_dict_copy(AVDictionary **dst, FF_CONST_AVUTIL53 AVDictionary *src, int flags);
/**
* Free all the memory allocated for an AVDictionary struct
diff --git a/chromium/third_party/ffmpeg/libavutil/downmix_info.c b/chromium/third_party/ffmpeg/libavutil/downmix_info.c
new file mode 100644
index 00000000000..c634c6a79f0
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/downmix_info.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2014 Tim Walker <tdskywalker@gmail.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 "downmix_info.h"
+#include "frame.h"
+
+AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame)
+{
+ AVFrameSideData *side_data;
+
+ side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_DOWNMIX_INFO);
+
+ if (!side_data)
+ side_data = av_frame_new_side_data(frame, AV_FRAME_DATA_DOWNMIX_INFO,
+ sizeof(AVDownmixInfo));
+
+ if (!side_data)
+ return NULL;
+
+ return (AVDownmixInfo*)side_data->data;
+}
diff --git a/chromium/third_party/ffmpeg/libavutil/downmix_info.h b/chromium/third_party/ffmpeg/libavutil/downmix_info.h
new file mode 100644
index 00000000000..c369891c02b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/downmix_info.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2014 Tim Walker <tdskywalker@gmail.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
+ */
+
+#ifndef AVUTIL_DOWNMIX_INFO_H
+#define AVUTIL_DOWNMIX_INFO_H
+
+#include "frame.h"
+
+/**
+ * @file
+ * audio downmix medatata
+ */
+
+/**
+ * @addtogroup lavu_audio
+ * @{
+ */
+
+/**
+ * @defgroup downmix_info Audio downmix metadata
+ * @{
+ */
+
+/**
+ * Possible downmix types.
+ */
+enum AVDownmixType {
+ AV_DOWNMIX_TYPE_UNKNOWN, /**< Not indicated. */
+ AV_DOWNMIX_TYPE_LORO, /**< Lo/Ro 2-channel downmix (Stereo). */
+ AV_DOWNMIX_TYPE_LTRT, /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */
+ AV_DOWNMIX_TYPE_DPLII, /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */
+ AV_DOWNMIX_TYPE_NB /**< Number of downmix types. Not part of ABI. */
+};
+
+/**
+ * This structure describes optional metadata relevant to a downmix procedure.
+ *
+ * All fields are set by the decoder to the value indicated in the audio
+ * bitstream (if present), or to a "sane" default otherwise.
+ */
+typedef struct AVDownmixInfo {
+ /**
+ * Type of downmix preferred by the mastering engineer.
+ */
+ enum AVDownmixType preferred_downmix_type;
+
+ /**
+ * Absolute scale factor representing the nominal level of the center
+ * channel during a regular downmix.
+ */
+ double center_mix_level;
+
+ /**
+ * Absolute scale factor representing the nominal level of the center
+ * channel during an Lt/Rt compatible downmix.
+ */
+ double center_mix_level_ltrt;
+
+ /**
+ * Absolute scale factor representing the nominal level of the surround
+ * channels during a regular downmix.
+ */
+ double surround_mix_level;
+
+ /**
+ * Absolute scale factor representing the nominal level of the surround
+ * channels during an Lt/Rt compatible downmix.
+ */
+ double surround_mix_level_ltrt;
+
+ /**
+ * Absolute scale factor representing the level at which the LFE data is
+ * mixed into L/R channels during downmixing.
+ */
+ double lfe_mix_level;
+} AVDownmixInfo;
+
+/**
+ * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing.
+ *
+ * The side data is created and added to the frame if it's absent.
+ *
+ * @param frame the frame for which the side data is to be obtained.
+ *
+ * @return the AVDownmixInfo structure to be edited by the caller.
+ */
+AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame);
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_DOWNMIX_INFO_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/dynarray.h b/chromium/third_party/ffmpeg/libavutil/dynarray.h
new file mode 100644
index 00000000000..00b19bc2a77
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/dynarray.h
@@ -0,0 +1,70 @@
+/*
+ * 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 AVUTIL_DYNARRAY_H
+#define AVUTIL_DYNARRAY_H
+
+#include "log.h"
+#include "mem.h"
+
+/**
+ * Add an element of to a dynamic array.
+ *
+ * The array is reallocated when its number of elements reaches powers of 2.
+ * Therefore, the amortized cost of adding an element is constant.
+ *
+ * In case of success, the pointer to the array is updated in order to
+ * point to the new grown array, and the size is incremented.
+ *
+ * @param av_size_max maximum size of the array, usually the MAX macro of
+ * the type of the size
+ * @param av_elt_size size of the elements in the array, in bytes
+ * @param av_array pointer to the array, must be a lvalue
+ * @param av_size size of the array, must be an interger lvalue
+ * @param av_success statement to execute on success; at this point, the
+ * size variable is not yet incremented
+ * @param av_failure statement to execute on failure; if this happens, the
+ * array and size are not changed; the statement can end
+ * with a return or a goto
+ */
+#define AV_DYNARRAY_ADD(av_size_max, av_elt_size, av_array, av_size, \
+ av_success, av_failure) \
+ do { \
+ size_t av_size_new = (av_size); \
+ if (!((av_size) & ((av_size) - 1))) { \
+ av_size_new = (av_size) ? (av_size) << 1 : 1; \
+ if (av_size_new > (av_size_max) / (av_elt_size)) { \
+ av_size_new = 0; \
+ } else { \
+ void *av_array_new = \
+ av_realloc((av_array), av_size_new * (av_elt_size)); \
+ if (!av_array_new) \
+ av_size_new = 0; \
+ else \
+ (av_array) = av_array_new; \
+ } \
+ } \
+ if (av_size_new) { \
+ { av_success } \
+ (av_size)++; \
+ } else { \
+ av_failure \
+ } \
+ } while (0)
+
+#endif /* AVUTIL_DYNARRAY_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/eval.c b/chromium/third_party/ffmpeg/libavutil/eval.c
index 635e538af55..4a313bfad4d 100644
--- a/chromium/third_party/ffmpeg/libavutil/eval.c
+++ b/chromium/third_party/ffmpeg/libavutil/eval.c
@@ -35,6 +35,7 @@
#include "mathematics.h"
#include "time.h"
#include "avstring.h"
+#include "timer.h"
typedef struct Parser {
const AVClass *class;
diff --git a/chromium/third_party/ffmpeg/libavutil/fifo.c b/chromium/third_party/ffmpeg/libavutil/fifo.c
index ca25bc52399..09ffa4fd26e 100644
--- a/chromium/third_party/ffmpeg/libavutil/fifo.c
+++ b/chromium/third_party/ffmpeg/libavutil/fifo.c
@@ -45,18 +45,26 @@ void av_fifo_free(AVFifoBuffer *f)
}
}
+void av_fifo_freep(AVFifoBuffer **f)
+{
+ if (f) {
+ av_fifo_free(*f);
+ *f = NULL;
+ }
+}
+
void av_fifo_reset(AVFifoBuffer *f)
{
f->wptr = f->rptr = f->buffer;
f->wndx = f->rndx = 0;
}
-int av_fifo_size(AVFifoBuffer *f)
+int av_fifo_size(FF_CONST_AVUTIL53 AVFifoBuffer *f)
{
return (uint32_t)(f->wndx - f->rndx);
}
-int av_fifo_space(AVFifoBuffer *f)
+int av_fifo_space(FF_CONST_AVUTIL53 AVFifoBuffer *f)
{
return f->end - f->buffer - av_fifo_size(f);
}
diff --git a/chromium/third_party/ffmpeg/libavutil/fifo.h b/chromium/third_party/ffmpeg/libavutil/fifo.h
index 849b9a6b813..f0b11094d0c 100644
--- a/chromium/third_party/ffmpeg/libavutil/fifo.h
+++ b/chromium/third_party/ffmpeg/libavutil/fifo.h
@@ -48,6 +48,12 @@ AVFifoBuffer *av_fifo_alloc(unsigned int size);
void av_fifo_free(AVFifoBuffer *f);
/**
+ * Free an AVFifoBuffer and reset pointer to NULL.
+ * @param f AVFifoBuffer to free
+ */
+void av_fifo_freep(AVFifoBuffer **f);
+
+/**
* Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
* @param f AVFifoBuffer to reset
*/
@@ -59,7 +65,7 @@ void av_fifo_reset(AVFifoBuffer *f);
* @param f AVFifoBuffer to read from
* @return size
*/
-int av_fifo_size(AVFifoBuffer *f);
+int av_fifo_size(FF_CONST_AVUTIL53 AVFifoBuffer *f);
/**
* Return the amount of space in bytes in the AVFifoBuffer, that is the
@@ -67,7 +73,7 @@ int av_fifo_size(AVFifoBuffer *f);
* @param f AVFifoBuffer to write into
* @return size
*/
-int av_fifo_space(AVFifoBuffer *f);
+int av_fifo_space(FF_CONST_AVUTIL53 AVFifoBuffer *f);
/**
* Feed data from an AVFifoBuffer to a user-supplied callback.
diff --git a/chromium/third_party/ffmpeg/libavutil/file_open.c b/chromium/third_party/ffmpeg/libavutil/file_open.c
index bcdd26ae355..f3164ebe684 100644
--- a/chromium/third_party/ffmpeg/libavutil/file_open.c
+++ b/chromium/third_party/ffmpeg/libavutil/file_open.c
@@ -48,7 +48,7 @@ static int win32_open(const char *filename_utf8, int oflag, int pmode)
num_chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename_utf8, -1, NULL, 0);
if (num_chars <= 0)
goto fallback;
- filename_w = av_mallocz(sizeof(wchar_t) * num_chars);
+ filename_w = av_mallocz_array(num_chars, sizeof(wchar_t));
if (!filename_w) {
errno = ENOMEM;
return -1;
diff --git a/chromium/third_party/ffmpeg/libavutil/fixed_dsp.c b/chromium/third_party/ffmpeg/libavutil/fixed_dsp.c
new file mode 100644
index 00000000000..b99fea519e1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/fixed_dsp.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2012
+ * MIPS Technologies, Inc., California.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Author: Nedeljko Babic (nbabic@mips.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 "fixed_dsp.h"
+
+static void vector_fmul_window_fixed_scaled_c(int16_t *dst, const int32_t *src0,
+ const int32_t *src1, const int32_t *win,
+ int len, uint8_t bits)
+{
+ int32_t s0, s1, wi, wj, i,j, round;
+
+ dst += len;
+ win += len;
+ src0+= len;
+ round = bits? 1 << (bits-1) : 0;
+
+ for (i=-len, j=len-1; i<0; i++, j--) {
+ s0 = src0[i];
+ s1 = src1[j];
+ wi = win[i];
+ wj = win[j];
+ dst[i] = av_clip_int16_c(((((int64_t)s0*wj - (int64_t)s1*wi + 0x40000000) >> 31) + round) >> bits);
+ dst[j] = av_clip_int16_c(((((int64_t)s0*wi + (int64_t)s1*wj + 0x40000000) >> 31) + round) >> bits);
+ }
+}
+
+static void vector_fmul_window_fixed_c(int32_t *dst, const int32_t *src0,
+ const int32_t *src1, const int32_t *win,
+ int len)
+{
+ int32_t s0, s1, wi, wj, i, j;
+
+ dst += len;
+ win += len;
+ src0+= len;
+
+ for (i=-len, j=len-1; i<0; i++, j--) {
+ s0 = src0[i];
+ s1 = src1[j];
+ wi = win[i];
+ wj = win[j];
+ dst[i] = ((int64_t)s0*wj - (int64_t)s1*wi + 0x40000000) >> 31;
+ dst[j] = ((int64_t)s0*wi + (int64_t)s1*wj + 0x40000000) >> 31;
+ }
+}
+
+AVFixedDSPContext * avpriv_alloc_fixed_dsp(int bit_exact)
+{
+ AVFixedDSPContext * fdsp = av_malloc(sizeof(AVFixedDSPContext));
+ fdsp->vector_fmul_window_scaled = vector_fmul_window_fixed_scaled_c;
+ fdsp->vector_fmul_window = vector_fmul_window_fixed_c;
+
+ return fdsp;
+}
diff --git a/chromium/third_party/ffmpeg/libavutil/fixed_dsp.h b/chromium/third_party/ffmpeg/libavutil/fixed_dsp.h
new file mode 100644
index 00000000000..ff6f36599a8
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/fixed_dsp.h
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2012
+ * MIPS Technologies, Inc., California.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Author: Nedeljko Babic (nbabic@mips.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
+ */
+
+#ifndef AVUTIL_FIXED_DSP_H
+#define AVUTIL_FIXED_DSP_H
+
+#include <stdint.h>
+#include "attributes.h"
+#include "common.h"
+#include "libavcodec/mathops.h"
+
+typedef struct AVFixedDSPContext {
+ /**
+ * Overlap/add with window function.
+ * Used primarily by MDCT-based audio codecs.
+ * Source and destination vectors must overlap exactly or not at all.
+ *
+ * @param dst result vector
+ * constraints: 16-byte aligned
+ * @param src0 first source vector
+ * constraints: 16-byte aligned
+ * @param src1 second source vector
+ * constraints: 16-byte aligned
+ * @param win half-window vector
+ * constraints: 16-byte aligned
+ * @param len length of vector
+ * constraints: multiple of 4
+ * @param bits scaling parameter
+ *
+ */
+ void (*vector_fmul_window_scaled)(int16_t *dst, const int32_t *src0, const int32_t *src1, const int32_t *win, int len, uint8_t bits);
+
+ /**
+ * Overlap/add with window function.
+ * Used primarily by MDCT-based audio codecs.
+ * Source and destination vectors must overlap exactly or not at all.
+ *
+ * @param dst result vector
+ * constraints: 32-byte aligned
+ * @param src0 first source vector
+ * constraints: 16-byte aligned
+ * @param src1 second source vector
+ * constraints: 16-byte aligned
+ * @param win half-window vector
+ * constraints: 16-byte aligned
+ * @param len length of vector
+ * constraints: multiple of 4
+ */
+ void (*vector_fmul_window)(int32_t *dst, const int32_t *src0, const int32_t *src1, const int32_t *win, int len);
+
+} AVFixedDSPContext;
+
+/**
+ * Allocate and initialize a fixed DSP context.
+ * note: should be freed with a av_free call when no longer needed.
+ *
+ * @param strict setting to non-zero avoids using functions which may not be IEEE-754 compliant
+ */
+AVFixedDSPContext * avpriv_alloc_fixed_dsp(int strict);
+
+/**
+ * Calculate the square root
+ *
+ * @param x input fixed point number
+ *
+ * @param bits format of fixed point number (32 - bits).bits
+ *
+ * note: input is normalized to (0, 1) fixed point value
+ */
+
+static av_always_inline int fixed_sqrt(int x, int bits)
+{
+ int retval, bit_mask, guess, square, i;
+ int64_t accu;
+ int shift1 = 30 - bits;
+ int shift2 = bits - 15;
+
+ if (shift1 > 0) retval = ff_sqrt(x << shift1);
+ else retval = ff_sqrt(x >> -shift1);
+
+ if (shift2 > 0) {
+ retval = retval << shift2;
+ bit_mask = (1 << (shift2 - 1));
+
+ for (i=0; i<shift2; i++){
+ guess = retval + bit_mask;
+ accu = (int64_t)guess * guess;
+ square = (int)((accu + bit_mask) >> bits);
+ if (x >= square)
+ retval += bit_mask;
+ bit_mask >>= 1;
+ }
+
+ }
+ else retval >>= (-shift2);
+
+ return retval;
+}
+
+#endif /* AVUTIL_FIXED_DSP_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/float_dsp.c b/chromium/third_party/ffmpeg/libavutil/float_dsp.c
index efff47f89aa..8ac74800eef 100644
--- a/chromium/third_party/ffmpeg/libavutil/float_dsp.c
+++ b/chromium/third_party/ffmpeg/libavutil/float_dsp.c
@@ -127,13 +127,299 @@ av_cold void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact)
fdsp->butterflies_float = butterflies_float_c;
fdsp->scalarproduct_float = avpriv_scalarproduct_float_c;
-#if ARCH_ARM
- ff_float_dsp_init_arm(fdsp);
-#elif ARCH_PPC
- ff_float_dsp_init_ppc(fdsp, bit_exact);
-#elif ARCH_X86
- ff_float_dsp_init_x86(fdsp);
-#elif ARCH_MIPS
- ff_float_dsp_init_mips(fdsp);
-#endif
+ if (ARCH_AARCH64)
+ ff_float_dsp_init_aarch64(fdsp);
+ if (ARCH_ARM)
+ ff_float_dsp_init_arm(fdsp);
+ if (ARCH_PPC)
+ ff_float_dsp_init_ppc(fdsp, bit_exact);
+ if (ARCH_X86)
+ ff_float_dsp_init_x86(fdsp);
+ if (ARCH_MIPS)
+ ff_float_dsp_init_mips(fdsp);
}
+
+#ifdef TEST
+
+#include <float.h>
+#include <math.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "common.h"
+#include "cpu.h"
+#include "internal.h"
+#include "lfg.h"
+#include "log.h"
+#include "mem.h"
+#include "random_seed.h"
+
+#define LEN 240
+
+static void fill_float_array(AVLFG *lfg, float *a, int len)
+{
+ int i;
+ double bmg[2], stddev = 10.0, mean = 0.0;
+
+ for (i = 0; i < len; i += 2) {
+ av_bmg_get(lfg, bmg);
+ a[i] = bmg[0] * stddev + mean;
+ a[i + 1] = bmg[1] * stddev + mean;
+ }
+}
+static int compare_floats(const float *a, const float *b, int len,
+ float max_diff)
+{
+ int i;
+ for (i = 0; i < len; i++) {
+ if (fabsf(a[i] - b[i]) > max_diff) {
+ av_log(NULL, AV_LOG_ERROR, "%d: %- .12f - %- .12f = % .12g\n",
+ i, a[i], b[i], a[i] - b[i]);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static void fill_double_array(AVLFG *lfg, double *a, int len)
+{
+ int i;
+ double bmg[2], stddev = 10.0, mean = 0.0;
+
+ for (i = 0; i < len; i += 2) {
+ av_bmg_get(lfg, bmg);
+ a[i] = bmg[0] * stddev + mean;
+ a[i + 1] = bmg[1] * stddev + mean;
+ }
+}
+
+static int compare_doubles(const double *a, const double *b, int len,
+ double max_diff)
+{
+ int i;
+
+ for (i = 0; i < len; i++) {
+ if (fabs(a[i] - b[i]) > max_diff) {
+ av_log(NULL, AV_LOG_ERROR, "%d: %- .12f - %- .12f = % .12g\n",
+ i, a[i], b[i], a[i] - b[i]);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static int test_vector_fmul(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
+ const float *v1, const float *v2)
+{
+ LOCAL_ALIGNED(32, float, cdst, [LEN]);
+ LOCAL_ALIGNED(32, float, odst, [LEN]);
+ int ret;
+
+ cdsp->vector_fmul(cdst, v1, v2, LEN);
+ fdsp->vector_fmul(odst, v1, v2, LEN);
+
+ if (ret = compare_floats(cdst, odst, LEN, FLT_EPSILON))
+ av_log(NULL, AV_LOG_ERROR, "vector_fmul failed\n");
+
+ return ret;
+}
+
+#define ARBITRARY_FMAC_SCALAR_CONST 0.005
+static int test_vector_fmac_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
+ const float *v1, const float *src0, float scale)
+{
+ LOCAL_ALIGNED(32, float, cdst, [LEN]);
+ LOCAL_ALIGNED(32, float, odst, [LEN]);
+ int ret;
+
+ memcpy(cdst, v1, LEN * sizeof(*v1));
+ memcpy(odst, v1, LEN * sizeof(*v1));
+
+ cdsp->vector_fmac_scalar(cdst, src0, scale, LEN);
+ fdsp->vector_fmac_scalar(odst, src0, scale, LEN);
+
+ if (ret = compare_floats(cdst, odst, LEN, ARBITRARY_FMAC_SCALAR_CONST))
+ av_log(NULL, AV_LOG_ERROR, "vector_fmac_scalar failed\n");
+
+ return ret;
+}
+
+static int test_vector_fmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
+ const float *v1, float scale)
+{
+ LOCAL_ALIGNED(32, float, cdst, [LEN]);
+ LOCAL_ALIGNED(32, float, odst, [LEN]);
+ int ret;
+
+ cdsp->vector_fmul_scalar(cdst, v1, scale, LEN);
+ fdsp->vector_fmul_scalar(odst, v1, scale, LEN);
+
+ if (ret = compare_floats(cdst, odst, LEN, FLT_EPSILON))
+ av_log(NULL, AV_LOG_ERROR, "vector_fmul_scalar failed\n");
+
+ return ret;
+}
+
+static int test_vector_dmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
+ const double *v1, double scale)
+{
+ LOCAL_ALIGNED(32, double, cdst, [LEN]);
+ LOCAL_ALIGNED(32, double, odst, [LEN]);
+ int ret;
+
+ cdsp->vector_dmul_scalar(cdst, v1, scale, LEN);
+ fdsp->vector_dmul_scalar(odst, v1, scale, LEN);
+
+ if (ret = compare_doubles(cdst, odst, LEN, DBL_EPSILON))
+ av_log(NULL, AV_LOG_ERROR, "vector_dmul_scalar failed\n");
+
+ return ret;
+}
+
+#define ARBITRARY_FMUL_WINDOW_CONST 0.008
+static int test_vector_fmul_window(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
+ const float *v1, const float *v2, const float *v3)
+{
+ LOCAL_ALIGNED(32, float, cdst, [LEN]);
+ LOCAL_ALIGNED(32, float, odst, [LEN]);
+ int ret;
+
+ cdsp->vector_fmul_window(cdst, v1, v2, v3, LEN / 2);
+ fdsp->vector_fmul_window(odst, v1, v2, v3, LEN / 2);
+
+ if (ret = compare_floats(cdst, odst, LEN, ARBITRARY_FMUL_WINDOW_CONST))
+ av_log(NULL, AV_LOG_ERROR, "vector_fmul_window failed\n");
+
+ return ret;
+}
+
+#define ARBITRARY_FMUL_ADD_CONST 0.005
+static int test_vector_fmul_add(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
+ const float *v1, const float *v2, const float *v3)
+{
+ LOCAL_ALIGNED(32, float, cdst, [LEN]);
+ LOCAL_ALIGNED(32, float, odst, [LEN]);
+ int ret;
+
+ cdsp->vector_fmul_add(cdst, v1, v2, v3, LEN);
+ fdsp->vector_fmul_add(odst, v1, v2, v3, LEN);
+
+ if (ret = compare_floats(cdst, odst, LEN, ARBITRARY_FMUL_ADD_CONST))
+ av_log(NULL, AV_LOG_ERROR, "vector_fmul_add failed\n");
+
+ return ret;
+}
+
+static int test_vector_fmul_reverse(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
+ const float *v1, const float *v2)
+{
+ LOCAL_ALIGNED(32, float, cdst, [LEN]);
+ LOCAL_ALIGNED(32, float, odst, [LEN]);
+ int ret;
+
+ cdsp->vector_fmul_reverse(cdst, v1, v2, LEN);
+ fdsp->vector_fmul_reverse(odst, v1, v2, LEN);
+
+ if (ret = compare_floats(cdst, odst, LEN, FLT_EPSILON))
+ av_log(NULL, AV_LOG_ERROR, "vector_fmul_reverse failed\n");
+
+ return ret;
+}
+
+static int test_butterflies_float(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
+ const float *v1, const float *v2)
+{
+ LOCAL_ALIGNED(32, float, cv1, [LEN]);
+ LOCAL_ALIGNED(32, float, cv2, [LEN]);
+ LOCAL_ALIGNED(32, float, ov1, [LEN]);
+ LOCAL_ALIGNED(32, float, ov2, [LEN]);
+ int ret;
+
+ memcpy(cv1, v1, LEN * sizeof(*v1));
+ memcpy(cv2, v2, LEN * sizeof(*v2));
+ memcpy(ov1, v1, LEN * sizeof(*v1));
+ memcpy(ov2, v2, LEN * sizeof(*v2));
+
+ cdsp->butterflies_float(cv1, cv2, LEN);
+ fdsp->butterflies_float(ov1, ov2, LEN);
+
+ if ((ret = compare_floats(cv1, ov1, LEN, FLT_EPSILON)) ||
+ (ret = compare_floats(cv2, ov2, LEN, FLT_EPSILON)))
+ av_log(NULL, AV_LOG_ERROR, "butterflies_float failed\n");
+
+ return ret;
+}
+
+#define ARBITRARY_SCALARPRODUCT_CONST 0.2
+static int test_scalarproduct_float(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
+ const float *v1, const float *v2)
+{
+ float cprod, oprod;
+ int ret;
+
+ cprod = cdsp->scalarproduct_float(v1, v2, LEN);
+ oprod = fdsp->scalarproduct_float(v1, v2, LEN);
+
+ if (ret = compare_floats(&cprod, &oprod, 1, ARBITRARY_SCALARPRODUCT_CONST))
+ av_log(NULL, AV_LOG_ERROR, "scalarproduct_float failed\n");
+
+ return ret;
+}
+
+int main(int argc, char **argv)
+{
+ int ret = 0;
+ uint32_t seed;
+ AVFloatDSPContext fdsp, cdsp;
+ AVLFG lfg;
+
+ LOCAL_ALIGNED(32, float, src0, [LEN]);
+ LOCAL_ALIGNED(32, float, src1, [LEN]);
+ LOCAL_ALIGNED(32, float, src2, [LEN]);
+ LOCAL_ALIGNED(32, double, dbl_src0, [LEN]);
+ LOCAL_ALIGNED(32, double, dbl_src1, [LEN]);
+
+ if (argc > 2 && !strcmp(argv[1], "-s"))
+ seed = strtoul(argv[2], NULL, 10);
+ else
+ seed = av_get_random_seed();
+
+ av_log(NULL, AV_LOG_INFO, "float_dsp-test: random seed %u\n", seed);
+
+ av_lfg_init(&lfg, seed);
+
+ fill_float_array(&lfg, src0, LEN);
+ fill_float_array(&lfg, src1, LEN);
+ fill_float_array(&lfg, src2, LEN);
+
+ fill_double_array(&lfg, dbl_src0, LEN);
+ fill_double_array(&lfg, dbl_src1, LEN);
+
+ avpriv_float_dsp_init(&fdsp, 1);
+ av_set_cpu_flags_mask(0);
+ avpriv_float_dsp_init(&cdsp, 1);
+
+ if (test_vector_fmul(&fdsp, &cdsp, src0, src1))
+ ret -= 1 << 0;
+ if (test_vector_fmac_scalar(&fdsp, &cdsp, src2, src0, src1[0]))
+ ret -= 1 << 1;
+ if (test_vector_fmul_scalar(&fdsp, &cdsp, src0, src1[0]))
+ ret -= 1 << 2;
+ if (test_vector_fmul_window(&fdsp, &cdsp, src0, src1, src2))
+ ret -= 1 << 3;
+ if (test_vector_fmul_add(&fdsp, &cdsp, src0, src1, src2))
+ ret -= 1 << 4;
+ if (test_vector_fmul_reverse(&fdsp, &cdsp, src0, src1))
+ ret -= 1 << 5;
+ if (test_butterflies_float(&fdsp, &cdsp, src0, src1))
+ ret -= 1 << 6;
+ if (test_scalarproduct_float(&fdsp, &cdsp, src0, src1))
+ ret -= 1 << 7;
+ if (test_vector_dmul_scalar(&fdsp, &cdsp, dbl_src0, dbl_src1[0]))
+ ret -= 1 << 8;
+
+ return ret;
+}
+
+#endif /* TEST */
diff --git a/chromium/third_party/ffmpeg/libavutil/float_dsp.h b/chromium/third_party/ffmpeg/libavutil/float_dsp.h
index d0447d63462..7fc851b6e5f 100644
--- a/chromium/third_party/ffmpeg/libavutil/float_dsp.h
+++ b/chromium/third_party/ffmpeg/libavutil/float_dsp.h
@@ -113,7 +113,7 @@ typedef struct AVFloatDSPContext {
* constraints: 32-byte aligned
* @param src1 second input vector
* constraints: 32-byte aligned
- * @param src1 third input vector
+ * @param src2 third input vector
* constraints: 32-byte aligned
* @param len number of elements in the input
* constraints: multiple of 16
@@ -132,8 +132,6 @@ typedef struct AVFloatDSPContext {
* constraints: 32-byte aligned
* @param src1 second input vector
* constraints: 32-byte aligned
- * @param src1 third input vector
- * constraints: 32-byte aligned
* @param len number of elements in the input
* constraints: multiple of 16
*/
@@ -181,6 +179,7 @@ float avpriv_scalarproduct_float_c(const float *v1, const float *v2, int len);
void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int strict);
+void ff_float_dsp_init_aarch64(AVFloatDSPContext *fdsp);
void ff_float_dsp_init_arm(AVFloatDSPContext *fdsp);
void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int strict);
void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp);
diff --git a/chromium/third_party/ffmpeg/libavutil/frame.c b/chromium/third_party/ffmpeg/libavutil/frame.c
index 1b44400eb97..9617b10cc59 100644
--- a/chromium/third_party/ffmpeg/libavutil/frame.c
+++ b/chromium/third_party/ffmpeg/libavutil/frame.c
@@ -159,7 +159,7 @@ static int get_video_buffer(AVFrame *frame, int align)
if (i == 1 || i == 2)
h = FF_CEIL_RSHIFT(h, desc->log2_chroma_h);
- frame->buf[i] = av_buffer_alloc(frame->linesize[i] * h + 16);
+ frame->buf[i] = av_buffer_alloc(frame->linesize[i] * h + 16 + 16/*STRIDE_ALIGN*/ - 1);
if (!frame->buf[i])
goto fail;
@@ -204,9 +204,9 @@ static int get_audio_buffer(AVFrame *frame, int align)
}
if (planes > AV_NUM_DATA_POINTERS) {
- frame->extended_data = av_mallocz(planes *
+ frame->extended_data = av_mallocz_array(planes,
sizeof(*frame->extended_data));
- frame->extended_buf = av_mallocz((planes - AV_NUM_DATA_POINTERS) *
+ frame->extended_buf = av_mallocz_array((planes - AV_NUM_DATA_POINTERS),
sizeof(*frame->extended_buf));
if (!frame->extended_data || !frame->extended_buf) {
av_freep(&frame->extended_data);
@@ -271,16 +271,11 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src)
if (ret < 0)
return ret;
- if (src->nb_samples) {
- int ch = src->channels;
- CHECK_CHANNELS_CONSISTENCY(src);
- av_samples_copy(dst->extended_data, src->extended_data, 0, 0,
- dst->nb_samples, ch, dst->format);
- } else {
- av_image_copy(dst->data, dst->linesize, src->data, src->linesize,
- dst->format, dst->width, dst->height);
- }
- return 0;
+ ret = av_frame_copy(dst, src);
+ if (ret < 0)
+ av_frame_unref(dst);
+
+ return ret;
}
/* ref the buffers */
@@ -295,7 +290,7 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src)
}
if (src->extended_buf) {
- dst->extended_buf = av_mallocz(sizeof(*dst->extended_buf) *
+ dst->extended_buf = av_mallocz_array(sizeof(*dst->extended_buf),
src->nb_extended_buf);
if (!dst->extended_buf) {
ret = AVERROR(ENOMEM);
@@ -322,7 +317,7 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src)
}
CHECK_CHANNELS_CONSISTENCY(src);
- dst->extended_data = av_malloc(sizeof(*dst->extended_data) * ch);
+ dst->extended_data = av_malloc_array(sizeof(*dst->extended_data), ch);
if (!dst->extended_data) {
ret = AVERROR(ENOMEM);
goto fail;
@@ -424,14 +419,10 @@ int av_frame_make_writable(AVFrame *frame)
if (ret < 0)
return ret;
- if (tmp.nb_samples) {
- int ch = tmp.channels;
- CHECK_CHANNELS_CONSISTENCY(&tmp);
- av_samples_copy(tmp.extended_data, frame->extended_data, 0, 0,
- frame->nb_samples, ch, frame->format);
- } else {
- av_image_copy(tmp.data, tmp.linesize, frame->data, frame->linesize,
- frame->format, frame->width, frame->height);
+ ret = av_frame_copy(&tmp, frame);
+ if (ret < 0) {
+ av_frame_unref(&tmp);
+ return ret;
}
ret = av_frame_copy_props(&tmp, frame);
@@ -592,3 +583,78 @@ AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
}
return NULL;
}
+
+static int frame_copy_video(AVFrame *dst, const AVFrame *src)
+{
+ const uint8_t *src_data[4];
+ int i, planes;
+
+ if (dst->width != src->width ||
+ dst->height != src->height)
+ return AVERROR(EINVAL);
+
+ planes = av_pix_fmt_count_planes(dst->format);
+ for (i = 0; i < planes; i++)
+ if (!dst->data[i] || !src->data[i])
+ return AVERROR(EINVAL);
+
+ memcpy(src_data, src->data, sizeof(src_data));
+ av_image_copy(dst->data, dst->linesize,
+ src_data, src->linesize,
+ dst->format, dst->width, dst->height);
+
+ return 0;
+}
+
+static int frame_copy_audio(AVFrame *dst, const AVFrame *src)
+{
+ int planar = av_sample_fmt_is_planar(dst->format);
+ int channels = dst->channels;
+ int planes = planar ? channels : 1;
+ int i;
+
+ if (dst->nb_samples != src->nb_samples ||
+ dst->channels != src->channels ||
+ dst->channel_layout != src->channel_layout)
+ return AVERROR(EINVAL);
+
+ CHECK_CHANNELS_CONSISTENCY(src);
+
+ for (i = 0; i < planes; i++)
+ if (!dst->extended_data[i] || !src->extended_data[i])
+ return AVERROR(EINVAL);
+
+ av_samples_copy(dst->extended_data, src->extended_data, 0, 0,
+ dst->nb_samples, channels, dst->format);
+
+ return 0;
+}
+
+int av_frame_copy(AVFrame *dst, const AVFrame *src)
+{
+ if (dst->format != src->format || dst->format < 0)
+ return AVERROR(EINVAL);
+
+ if (dst->width > 0 && dst->height > 0)
+ return frame_copy_video(dst, src);
+ else if (dst->nb_samples > 0 && dst->channel_layout)
+ return frame_copy_audio(dst, src);
+
+ return AVERROR(EINVAL);
+}
+
+void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
+{
+ int i;
+
+ for (i = 0; i < frame->nb_side_data; i++) {
+ AVFrameSideData *sd = frame->side_data[i];
+ if (sd->type == type) {
+ av_freep(&sd->data);
+ av_dict_free(&sd->metadata);
+ av_freep(&frame->side_data[i]);
+ frame->side_data[i] = frame->side_data[frame->nb_side_data - 1];
+ frame->nb_side_data--;
+ }
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavutil/frame.h b/chromium/third_party/ffmpeg/libavutil/frame.h
index b064cc564be..ccc86d72c53 100644
--- a/chromium/third_party/ffmpeg/libavutil/frame.h
+++ b/chromium/third_party/ffmpeg/libavutil/frame.h
@@ -17,18 +17,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+/**
+ * @file
+ * @ingroup lavu_frame
+ * reference-counted frame API
+ */
+
#ifndef AVUTIL_FRAME_H
#define AVUTIL_FRAME_H
#include <stdint.h>
-#include "libavcodec/version.h"
-
#include "avutil.h"
#include "buffer.h"
#include "dict.h"
#include "rational.h"
#include "samplefmt.h"
+#include "version.h"
+
enum AVColorSpace{
AVCOL_SPC_RGB = 0,
@@ -53,6 +59,14 @@ enum AVColorRange{
};
+/**
+ * @defgroup lavu_frame AVFrame
+ * @ingroup lavu_data
+ *
+ * @{
+ * AVFrame is an abstraction for reference-counted raw multimedia data.
+ */
+
enum AVFrameSideDataType {
/**
* The data is the AVPanScan struct defined in libavcodec.
@@ -69,6 +83,19 @@ enum AVFrameSideDataType {
* The data is the AVStereo3D struct defined in libavutil/stereo3d.h.
*/
AV_FRAME_DATA_STEREO3D,
+ /**
+ * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.
+ */
+ AV_FRAME_DATA_MATRIXENCODING,
+ /**
+ * Metadata relevant to a downmix procedure.
+ * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h.
+ */
+ AV_FRAME_DATA_DOWNMIX_INFO,
+ /**
+ * ReplayGain information in the form of the AVReplayGain struct.
+ */
+ AV_FRAME_DATA_REPLAYGAIN,
};
typedef struct AVFrameSideData {
@@ -181,8 +208,7 @@ typedef struct AVFrame {
enum AVPictureType pict_type;
#if FF_API_AVFRAME_LAVC
- // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
- // attribute_deprecated
+ attribute_deprecated
uint8_t *base[AV_NUM_DATA_POINTERS];
#endif
@@ -257,7 +283,6 @@ typedef struct AVFrame {
* motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];
* @endcode
*/
- attribute_deprecated
int16_t (*motion_val[2])[2];
/**
@@ -292,8 +317,7 @@ typedef struct AVFrame {
uint64_t error[AV_NUM_DATA_POINTERS];
#if FF_API_AVFRAME_LAVC
- // TODO(wolenetz) Switch to refcounted buffers. See http://crbug.com/236611
- // attribute_deprecated
+ attribute_deprecated
int type;
#endif
@@ -355,7 +379,6 @@ typedef struct AVFrame {
* log2 of the size of the block which a single vector in motion_val represents:
* (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
*/
- attribute_deprecated
uint8_t motion_subsample_log2;
#endif
@@ -403,12 +426,22 @@ typedef struct AVFrame {
int nb_side_data;
/**
+ * @defgroup lavu_frame_flags AV_FRAME_FLAGS
+ * Flags describing additional frame properties.
+ *
+ * @{
+ */
+
+/**
* The frame data may be corrupted, e.g. due to decoding errors.
*/
#define AV_FRAME_FLAG_CORRUPT (1 << 0)
+/**
+ * @}
+ */
/**
- * Frame flags, a combination of AV_FRAME_FLAG_*
+ * Frame flags, a combination of @ref lavu_frame_flags
*/
int flags;
@@ -565,7 +598,7 @@ AVFrame *av_frame_alloc(void);
void av_frame_free(AVFrame **frame);
/**
- * Setup a new reference to the data described by a given frame.
+ * Set up a new reference to the data described by the source frame.
*
* Copy frame properties from src to dst and create a new reference for each
* AVBufferRef from src.
@@ -643,6 +676,19 @@ int av_frame_is_writable(AVFrame *frame);
int av_frame_make_writable(AVFrame *frame);
/**
+ * Copy the frame data from src to dst.
+ *
+ * This function does not allocate anything, dst must be already initialized and
+ * allocated with the same parameters as src.
+ *
+ * This function only copies the frame data (i.e. the contents of the data /
+ * extended data arrays), not any other properties.
+ *
+ * @return >= 0 on success, a negative AVERROR on error.
+ */
+int av_frame_copy(AVFrame *dst, const AVFrame *src);
+
+/**
* Copy only "metadata" fields from src to dst.
*
* Metadata for the purpose of this function are those fields that do not affect
@@ -682,4 +728,14 @@ AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
enum AVFrameSideDataType type);
+/**
+ * If side data of the supplied type exists in the frame, free it and remove it
+ * from the frame.
+ */
+void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type);
+
+/**
+ * @}
+ */
+
#endif /* AVUTIL_FRAME_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/hash.c b/chromium/third_party/ffmpeg/libavutil/hash.c
index a8cf80b577b..773f29e23b5 100644
--- a/chromium/third_party/ffmpeg/libavutil/hash.c
+++ b/chromium/third_party/ffmpeg/libavutil/hash.c
@@ -29,6 +29,7 @@
#include "sha512.h"
#include "avstring.h"
+#include "base64.h"
#include "error.h"
#include "intreadwrite.h"
#include "mem.h"
@@ -196,6 +197,40 @@ void av_hash_final(AVHashContext *ctx, uint8_t *dst)
}
}
+void av_hash_final_bin(struct AVHashContext *ctx, uint8_t *dst, int size)
+{
+ uint8_t buf[AV_HASH_MAX_SIZE];
+ unsigned rsize = av_hash_get_size(ctx);
+
+ av_hash_final(ctx, buf);
+ memcpy(dst, buf, FFMIN(size, rsize));
+ if (size > rsize)
+ memset(dst + rsize, 0, size - rsize);
+}
+
+void av_hash_final_hex(struct AVHashContext *ctx, uint8_t *dst, int size)
+{
+ uint8_t buf[AV_HASH_MAX_SIZE];
+ unsigned rsize = av_hash_get_size(ctx), i;
+
+ av_hash_final(ctx, buf);
+ for (i = 0; i < FFMIN(rsize, size / 2); i++)
+ snprintf(dst + i * 2, size - i * 2, "%02x", buf[i]);
+}
+
+void av_hash_final_b64(struct AVHashContext *ctx, uint8_t *dst, int size)
+{
+ uint8_t buf[AV_HASH_MAX_SIZE], b64[AV_BASE64_SIZE(AV_HASH_MAX_SIZE)];
+ unsigned rsize = av_hash_get_size(ctx), osize;
+
+ av_hash_final(ctx, buf);
+ av_base64_encode(b64, sizeof(b64), buf, rsize);
+ osize = AV_BASE64_SIZE(rsize);
+ memcpy(dst, b64, FFMIN(osize, size));
+ if (size < osize)
+ dst[size - 1] = 0;
+}
+
void av_hash_freep(AVHashContext **ctx)
{
if (*ctx)
diff --git a/chromium/third_party/ffmpeg/libavutil/hash.h b/chromium/third_party/ffmpeg/libavutil/hash.h
index 9bf715e1ac7..d4bcbf8cc83 100644
--- a/chromium/third_party/ffmpeg/libavutil/hash.h
+++ b/chromium/third_party/ffmpeg/libavutil/hash.h
@@ -83,6 +83,28 @@ void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);
void av_hash_final(struct AVHashContext *ctx, uint8_t *dst);
/**
+ * Finalize a hash context and compute the actual hash value.
+ * If size is smaller than the hash size, the hash is truncated;
+ * if size is larger, the buffer is padded with 0.
+ */
+void av_hash_final_bin(struct AVHashContext *ctx, uint8_t *dst, int size);
+
+/**
+ * Finalize a hash context and compute the actual hash value as a hex string.
+ * The string is always 0-terminated.
+ * If size is smaller than 2 * hash_size + 1, the hex string is truncated.
+ */
+void av_hash_final_hex(struct AVHashContext *ctx, uint8_t *dst, int size);
+
+/**
+ * Finalize a hash context and compute the actual hash value as a base64 string.
+ * The string is always 0-terminated.
+ * If size is smaller than AV_BASE64_SIZE(hash_size), the base64 string is
+ * truncated.
+ */
+void av_hash_final_b64(struct AVHashContext *ctx, uint8_t *dst, int size);
+
+/**
* Free hash context.
*/
void av_hash_freep(struct AVHashContext **ctx);
diff --git a/chromium/third_party/ffmpeg/libavutil/internal.h b/chromium/third_party/ffmpeg/libavutil/internal.h
index 9c5546f3b14..ea3c31e4fbc 100644
--- a/chromium/third_party/ffmpeg/libavutil/internal.h
+++ b/chromium/third_party/ffmpeg/libavutil/internal.h
@@ -93,6 +93,13 @@
// to be forced to tokenize __VA_ARGS__
#define E1(x) x
+/* Check if the hard coded offset of a struct member still matches reality.
+ * Induce a compilation failure if not.
+ */
+#define AV_CHECK_OFFSET(s, m, o) struct check_##o { \
+ int x_##o[offsetof(s, m) == o? 1: -1]; \
+ }
+
#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
uint8_t la_##v[sizeof(t s o) + (a)]; \
t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)
@@ -115,6 +122,12 @@
# define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__)
#endif
+#if HAVE_LOCAL_ALIGNED_32
+# define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_D(32, t, v, __VA_ARGS__,,))
+#else
+# define LOCAL_ALIGNED_32(t, v, ...) LOCAL_ALIGNED(32, t, v, __VA_ARGS__)
+#endif
+
#define FF_ALLOC_OR_GOTO(ctx, p, size, label)\
{\
p = av_malloc(size);\
@@ -133,6 +146,24 @@
}\
}
+#define FF_ALLOC_ARRAY_OR_GOTO(ctx, p, nelem, elsize, label)\
+{\
+ p = av_malloc_array(nelem, elsize);\
+ if (p == NULL) {\
+ av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
+ goto label;\
+ }\
+}
+
+#define FF_ALLOCZ_ARRAY_OR_GOTO(ctx, p, nelem, elsize, label)\
+{\
+ p = av_mallocz_array(nelem, elsize);\
+ if (p == NULL) {\
+ av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
+ goto label;\
+ }\
+}
+
#include "libm.h"
#if defined(_MSC_VER)
@@ -213,6 +244,11 @@ void avpriv_request_sample(void *avc,
#if HAVE_LIBC_MSVCRT
#define avpriv_open ff_open
+#define PTRDIFF_SPECIFIER "Id"
+#define SIZE_SPECIFIER "Iu"
+#else
+#define PTRDIFF_SPECIFIER "td"
+#define SIZE_SPECIFIER "zu"
#endif
/**
diff --git a/chromium/third_party/ffmpeg/libavutil/intfloat_readwrite.c b/chromium/third_party/ffmpeg/libavutil/intfloat_readwrite.c
index 142331dac10..af5da623cd8 100644
--- a/chromium/third_party/ffmpeg/libavutil/intfloat_readwrite.c
+++ b/chromium/third_party/ffmpeg/libavutil/intfloat_readwrite.c
@@ -29,7 +29,9 @@
#include "common.h"
#include "mathematics.h"
#include "intfloat_readwrite.h"
+#include "version.h"
+#if FF_API_INTFLOAT
double av_int2dbl(int64_t v){
if((uint64_t)v+v > 0xFFEULL<<52)
return NAN;
@@ -96,3 +98,4 @@ AVExtFloat av_dbl2ext(double d){
ext.exponent[0] |= 0x80;
return ext;
}
+#endif /* FF_API_INTFLOAT */
diff --git a/chromium/third_party/ffmpeg/libavutil/intfloat_readwrite.h b/chromium/third_party/ffmpeg/libavutil/intfloat_readwrite.h
index 9709f4dae43..1d79e3e8af3 100644
--- a/chromium/third_party/ffmpeg/libavutil/intfloat_readwrite.h
+++ b/chromium/third_party/ffmpeg/libavutil/intfloat_readwrite.h
@@ -22,8 +22,11 @@
#define AVUTIL_INTFLOAT_READWRITE_H
#include <stdint.h>
+
#include "attributes.h"
+#include "version.h"
+#if FF_API_INTFLOAT
/* IEEE 80 bits extended float */
typedef struct AVExtFloat {
uint8_t exponent[2];
@@ -36,5 +39,6 @@ attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const;
attribute_deprecated int64_t av_dbl2int(double d) av_const;
attribute_deprecated int32_t av_flt2int(float d) av_const;
attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const;
+#endif /* FF_API_INTFLOAT */
#endif /* AVUTIL_INTFLOAT_READWRITE_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/log.c b/chromium/third_party/ffmpeg/libavutil/log.c
index a7eb34c3d25..cc51cc01330 100644
--- a/chromium/third_party/ffmpeg/libavutil/log.c
+++ b/chromium/third_party/ffmpeg/libavutil/log.c
@@ -50,7 +50,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static int av_log_level = AV_LOG_INFO;
static int flags;
-#if HAVE_SETCONSOLETEXTATTRIBUTE
+#if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
#include <windows.h>
static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = {
[AV_LOG_PANIC /8] = 12,
@@ -71,6 +71,12 @@ static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = {
[16+AV_CLASS_CATEGORY_BITSTREAM_FILTER] = 9,
[16+AV_CLASS_CATEGORY_SWSCALER ] = 7,
[16+AV_CLASS_CATEGORY_SWRESAMPLER ] = 7,
+ [16+AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT ] = 13,
+ [16+AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT ] = 5,
+ [16+AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT ] = 13,
+ [16+AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT ] = 5,
+ [16+AV_CLASS_CATEGORY_DEVICE_OUTPUT ] = 13,
+ [16+AV_CLASS_CATEGORY_DEVICE_INPUT ] = 5,
};
static int16_t background, attr_orig;
@@ -96,53 +102,74 @@ static const uint32_t color[16 + AV_CLASS_CATEGORY_NB] = {
[16+AV_CLASS_CATEGORY_BITSTREAM_FILTER] = 192 << 8 | 0x14,
[16+AV_CLASS_CATEGORY_SWSCALER ] = 153 << 8 | 0x14,
[16+AV_CLASS_CATEGORY_SWRESAMPLER ] = 147 << 8 | 0x14,
+ [16+AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT ] = 213 << 8 | 0x15,
+ [16+AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT ] = 207 << 8 | 0x05,
+ [16+AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT ] = 213 << 8 | 0x15,
+ [16+AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT ] = 207 << 8 | 0x05,
+ [16+AV_CLASS_CATEGORY_DEVICE_OUTPUT ] = 213 << 8 | 0x15,
+ [16+AV_CLASS_CATEGORY_DEVICE_INPUT ] = 207 << 8 | 0x05,
};
#endif
static int use_color = -1;
-static void colored_fputs(int level, const char *str)
+static void check_color_terminal(void)
{
- if (!*str)
- return;
-
- if (use_color < 0) {
-#if HAVE_SETCONSOLETEXTATTRIBUTE
- CONSOLE_SCREEN_BUFFER_INFO con_info;
- con = GetStdHandle(STD_ERROR_HANDLE);
- use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") &&
- !getenv("AV_LOG_FORCE_NOCOLOR");
- if (use_color) {
- GetConsoleScreenBufferInfo(con, &con_info);
- attr_orig = con_info.wAttributes;
- background = attr_orig & 0xF0;
- }
+#if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
+ CONSOLE_SCREEN_BUFFER_INFO con_info;
+ con = GetStdHandle(STD_ERROR_HANDLE);
+ use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") &&
+ !getenv("AV_LOG_FORCE_NOCOLOR");
+ if (use_color) {
+ GetConsoleScreenBufferInfo(con, &con_info);
+ attr_orig = con_info.wAttributes;
+ background = attr_orig & 0xF0;
+ }
#elif HAVE_ISATTY
- use_color = !getenv("NO_COLOR") && !getenv("AV_LOG_FORCE_NOCOLOR") &&
- (getenv("TERM") && isatty(2) ||
- getenv("AV_LOG_FORCE_COLOR"));
- if (getenv("AV_LOG_FORCE_256COLOR"))
- use_color *= 256;
+ char *term = getenv("TERM");
+ use_color = !getenv("NO_COLOR") && !getenv("AV_LOG_FORCE_NOCOLOR") &&
+ (getenv("TERM") && isatty(2) || getenv("AV_LOG_FORCE_COLOR"));
+ if ( getenv("AV_LOG_FORCE_256COLOR")
+ || (term && strstr(term, "256color")))
+ use_color *= 256;
#else
- use_color = getenv("AV_LOG_FORCE_COLOR") && !getenv("NO_COLOR") &&
- !getenv("AV_LOG_FORCE_NOCOLOR");
+ use_color = getenv("AV_LOG_FORCE_COLOR") && !getenv("NO_COLOR") &&
+ !getenv("AV_LOG_FORCE_NOCOLOR");
#endif
- }
+}
+
+static void colored_fputs(int level, int tint, const char *str)
+{
+ int local_use_color;
+ if (!*str)
+ return;
+
+ if (use_color < 0)
+ check_color_terminal();
-#if HAVE_SETCONSOLETEXTATTRIBUTE
- if (use_color && level != AV_LOG_INFO/8)
+ if (level == AV_LOG_INFO/8) local_use_color = 0;
+ else local_use_color = use_color;
+
+#if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
+ if (local_use_color)
SetConsoleTextAttribute(con, background | color[level]);
fputs(str, stderr);
- if (use_color && level != AV_LOG_INFO/8)
+ if (local_use_color)
SetConsoleTextAttribute(con, attr_orig);
#else
- if (use_color == 1 && level != AV_LOG_INFO/8) {
+ if (local_use_color == 1) {
fprintf(stderr,
"\033[%d;3%dm%s\033[0m",
(color[level] >> 4) & 15,
color[level] & 15,
str);
- } else if (use_color == 256 && level != AV_LOG_INFO/8) {
+ } else if (tint && use_color == 256) {
+ fprintf(stderr,
+ "\033[48;5;%dm\033[38;5;%dm%s\033[0m",
+ (color[level] >> 16) & 0xff,
+ tint,
+ str);
+ } else if (local_use_color == 256) {
fprintf(stderr,
"\033[48;5;%dm\033[38;5;%dm%s\033[0m",
(color[level] >> 16) & 0xff,
@@ -185,18 +212,43 @@ static int get_category(void *ptr){
return avc->category + 16;
}
-static void format_line(void *ptr, int level, const char *fmt, va_list vl,
- AVBPrint part[3], int *print_prefix, int type[2])
+static const char *get_level_str(int level)
{
- AVClass* avc = ptr ? *(AVClass **) ptr : NULL;
+ switch (level) {
+ case AV_LOG_QUIET:
+ return "quiet";
+ case AV_LOG_DEBUG:
+ return "debug";
+ case AV_LOG_VERBOSE:
+ return "verbose";
+ case AV_LOG_INFO:
+ return "info";
+ case AV_LOG_WARNING:
+ return "warning";
+ case AV_LOG_ERROR:
+ return "error";
+ case AV_LOG_FATAL:
+ return "fatal";
+ case AV_LOG_PANIC:
+ return "panic";
+ default:
+ return "";
+ }
+}
+
+static void format_line(void *avcl, int level, const char *fmt, va_list vl,
+ AVBPrint part[4], int *print_prefix, int type[2])
+{
+ AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
av_bprint_init(part+0, 0, 1);
av_bprint_init(part+1, 0, 1);
- av_bprint_init(part+2, 0, 65536);
+ av_bprint_init(part+2, 0, 1);
+ av_bprint_init(part+3, 0, 65536);
if(type) type[0] = type[1] = AV_CLASS_CATEGORY_NA + 16;
if (*print_prefix && avc) {
if (avc->parent_log_context_offset) {
- AVClass** parent = *(AVClass ***) (((uint8_t *) ptr) +
+ AVClass** parent = *(AVClass ***) (((uint8_t *) avcl) +
avc->parent_log_context_offset);
if (parent && *parent) {
av_bprintf(part+0, "[%s @ %p] ",
@@ -205,14 +257,17 @@ static void format_line(void *ptr, int level, const char *fmt, va_list vl,
}
}
av_bprintf(part+1, "[%s @ %p] ",
- avc->item_name(ptr), ptr);
- if(type) type[1] = get_category(ptr);
+ avc->item_name(avcl), avcl);
+ if(type) type[1] = get_category(avcl);
+
+ if (flags & AV_LOG_PRINT_LEVEL)
+ av_bprintf(part+2, "[%s] ", get_level_str(level));
}
- av_vbprintf(part+2, fmt, vl);
+ av_vbprintf(part+3, fmt, vl);
- if(*part[0].str || *part[1].str || *part[2].str) {
- char lastc = part[2].len && part[2].len <= part[2].size ? part[2].str[part[2].len - 1] : 0;
+ if(*part[0].str || *part[1].str || *part[2].str || *part[3].str) {
+ char lastc = part[3].len && part[3].len <= part[3].size ? part[3].str[part[3].len - 1] : 0;
*print_prefix = lastc == '\n' || lastc == '\r';
}
}
@@ -220,10 +275,10 @@ static void format_line(void *ptr, int level, const char *fmt, va_list vl,
void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
char *line, int line_size, int *print_prefix)
{
- AVBPrint part[3];
+ AVBPrint part[4];
format_line(ptr, level, fmt, vl, part, print_prefix, NULL);
- snprintf(line, line_size, "%s%s%s", part[0].str, part[1].str, part[2].str);
- av_bprint_finalize(part+2, NULL);
+ snprintf(line, line_size, "%s%s%s%s", part[0].str, part[1].str, part[2].str, part[3].str);
+ av_bprint_finalize(part+3, NULL);
}
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
@@ -231,10 +286,16 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
static int print_prefix = 1;
static int count;
static char prev[LINE_SZ];
- AVBPrint part[3];
+ AVBPrint part[4];
char line[LINE_SZ];
static int is_atty;
int type[2];
+ unsigned tint = 0;
+
+ if (level >= 0) {
+ tint = level & 0xff00;
+ level &= 0xff;
+ }
if (level > av_log_level)
return;
@@ -243,7 +304,7 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
#endif
format_line(ptr, level, fmt, vl, part, &print_prefix, type);
- snprintf(line, sizeof(line), "%s%s%s", part[0].str, part[1].str, part[2].str);
+ snprintf(line, sizeof(line), "%s%s%s%s", part[0].str, part[1].str, part[2].str, part[3].str);
#if HAVE_ISATTY
if (!is_atty)
@@ -263,13 +324,15 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
}
strcpy(prev, line);
sanitize(part[0].str);
- colored_fputs(type[0], part[0].str);
+ colored_fputs(type[0], 0, part[0].str);
sanitize(part[1].str);
- colored_fputs(type[1], part[1].str);
+ colored_fputs(type[1], 0, part[1].str);
sanitize(part[2].str);
- colored_fputs(av_clip(level >> 3, 0, 6), part[2].str);
+ colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, part[2].str);
+ sanitize(part[3].str);
+ colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, part[3].str);
end:
- av_bprint_finalize(part+2, NULL);
+ av_bprint_finalize(part+3, NULL);
#if HAVE_PTHREADS
pthread_mutex_unlock(&mutex);
#endif
@@ -312,6 +375,11 @@ void av_log_set_flags(int arg)
flags = arg;
}
+int av_log_get_flags(void)
+{
+ return flags;
+}
+
void av_log_set_callback(void (*callback)(void*, int, const char*, va_list))
{
av_log_callback = callback;
@@ -348,3 +416,26 @@ void avpriv_report_missing_feature(void *avc, const char *msg, ...)
missing_feature_sample(0, avc, msg, argument_list);
va_end(argument_list);
}
+
+#ifdef TEST
+// LCOV_EXCL_START
+#include <string.h>
+
+int main(int argc, char **argv)
+{
+ int i;
+ av_log_set_level(AV_LOG_DEBUG);
+ for (use_color=0; use_color<=256; use_color = 255*use_color+1) {
+ av_log(NULL, AV_LOG_FATAL, "use_color: %d\n", use_color);
+ for (i = AV_LOG_DEBUG; i>=AV_LOG_QUIET; i-=8) {
+ av_log(NULL, i, " %d", i);
+ av_log(NULL, AV_LOG_INFO, "e ");
+ av_log(NULL, i + 256*123, "C%d", i);
+ av_log(NULL, AV_LOG_INFO, "e");
+ }
+ av_log(NULL, AV_LOG_PANIC, "\n");
+ }
+ return 0;
+}
+// LCOV_EXCL_STOP
+#endif
diff --git a/chromium/third_party/ffmpeg/libavutil/log.h b/chromium/third_party/ffmpeg/libavutil/log.h
index 55459e811a0..a6a07e0653a 100644
--- a/chromium/third_party/ffmpeg/libavutil/log.h
+++ b/chromium/third_party/ffmpeg/libavutil/log.h
@@ -37,6 +37,12 @@ typedef enum {
AV_CLASS_CATEGORY_BITSTREAM_FILTER,
AV_CLASS_CATEGORY_SWSCALER,
AV_CLASS_CATEGORY_SWRESAMPLER,
+ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40,
+ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
+ AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
+ AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
+ AV_CLASS_CATEGORY_DEVICE_OUTPUT,
+ AV_CLASS_CATEGORY_DEVICE_INPUT,
AV_CLASS_CATEGORY_NB, ///< not part of ABI/API
}AVClassCategory;
@@ -186,6 +192,16 @@ typedef struct AVClass {
*/
/**
+ * Sets additional colors for extended debugging sessions.
+ * @code
+ av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n");
+ @endcode
+ * Requires 256color terminal support. Uses outside debugging is not
+ * recommended.
+ */
+#define AV_LOG_C(x) (x << 8)
+
+/**
* Send the specified message to the log if the level is less than or equal
* to the current av_log_level. By default, all logging messages are sent to
* stderr. This behavior can be altered by setting a different logging callback
@@ -260,9 +276,10 @@ void av_log_set_callback(void (*callback)(void*, int, const char*, va_list));
* lavu_log_constants "Logging Constant".
* @param fmt The format string (printf-compatible) that specifies how
* subsequent arguments are converted to output.
- * @param ap The arguments referenced by the format string.
+ * @param vl The arguments referenced by the format string.
*/
-void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
+void av_log_default_callback(void *avcl, int level, const char *fmt,
+ va_list vl);
/**
* Return the context name
@@ -304,7 +321,17 @@ void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
* call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end
*/
#define AV_LOG_SKIP_REPEATED 1
+
+/**
+ * Include the log severity in messages originating from codecs.
+ *
+ * Results in messages such as:
+ * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts
+ */
+#define AV_LOG_PRINT_LEVEL 2
+
void av_log_set_flags(int arg);
+int av_log_get_flags(void);
/**
* @}
diff --git a/chromium/third_party/ffmpeg/libavutil/macros.h b/chromium/third_party/ffmpeg/libavutil/macros.h
new file mode 100644
index 00000000000..446532377a6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/macros.h
@@ -0,0 +1,48 @@
+/*
+ * 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
+ * @ingroup lavu
+ * Utility Preprocessor macros
+ */
+
+#ifndef AVUTIL_MACROS_H
+#define AVUTIL_MACROS_H
+
+/**
+ * @addtogroup preproc_misc Preprocessor String Macros
+ *
+ * String manipulation macros
+ *
+ * @{
+ */
+
+#define AV_STRINGIFY(s) AV_TOSTRING(s)
+#define AV_TOSTRING(s) #s
+
+#define AV_GLUE(a, b) a ## b
+#define AV_JOIN(a, b) AV_GLUE(a, b)
+
+/**
+ * @}
+ */
+
+#define AV_PRAGMA(s) _Pragma(#s)
+
+#endif /* AVUTIL_MACROS_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/mathematics.c b/chromium/third_party/ffmpeg/libavutil/mathematics.c
index f9cf87da803..81841f79d2e 100644
--- a/chromium/third_party/ffmpeg/libavutil/mathematics.c
+++ b/chromium/third_party/ffmpeg/libavutil/mathematics.c
@@ -32,7 +32,7 @@
#include "version.h"
#if FF_API_AV_REVERSE
-const uint8_t av_reverse[256]={
+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,
@@ -52,53 +52,62 @@ const uint8_t av_reverse[256]={
};
#endif
-int64_t av_gcd(int64_t a, int64_t b){
- if(b) return av_gcd(b, a%b);
- else return a;
+int64_t av_gcd(int64_t a, int64_t b)
+{
+ if (b)
+ return av_gcd(b, a % b);
+ else
+ return a;
}
-int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
- int64_t r=0;
+int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
+{
+ int64_t r = 0;
av_assert2(c > 0);
av_assert2(b >=0);
av_assert2((unsigned)(rnd&~AV_ROUND_PASS_MINMAX)<=5 && (rnd&~AV_ROUND_PASS_MINMAX)!=4);
+ if (c <= 0 || b < 0 || !((unsigned)(rnd&~AV_ROUND_PASS_MINMAX)<=5 && (rnd&~AV_ROUND_PASS_MINMAX)!=4))
+ return INT64_MIN;
+
if (rnd & AV_ROUND_PASS_MINMAX) {
if (a == INT64_MIN || a == INT64_MAX)
return a;
rnd -= AV_ROUND_PASS_MINMAX;
}
- if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1));
+ if (a < 0 && a != INT64_MIN)
+ return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd >> 1) & 1));
- if(rnd==AV_ROUND_NEAR_INF) r= c/2;
- else if(rnd&1) r= c-1;
+ if (rnd == AV_ROUND_NEAR_INF)
+ r = c / 2;
+ else if (rnd & 1)
+ r = c - 1;
- if(b<=INT_MAX && c<=INT_MAX){
- if(a<=INT_MAX)
- return (a * b + r)/c;
+ if (b <= INT_MAX && c <= INT_MAX) {
+ if (a <= INT_MAX)
+ return (a * b + r) / c;
else
- return a/c*b + (a%c*b + r)/c;
- }else{
+ return a / c * b + (a % c * b + r) / c;
+ } else {
#if 1
- uint64_t a0= a&0xFFFFFFFF;
- uint64_t a1= a>>32;
- uint64_t b0= b&0xFFFFFFFF;
- uint64_t b1= b>>32;
- uint64_t t1= a0*b1 + a1*b0;
- uint64_t t1a= t1<<32;
+ uint64_t a0 = a & 0xFFFFFFFF;
+ uint64_t a1 = a >> 32;
+ uint64_t b0 = b & 0xFFFFFFFF;
+ uint64_t b1 = b >> 32;
+ uint64_t t1 = a0 * b1 + a1 * b0;
+ uint64_t t1a = t1 << 32;
int i;
- a0 = a0*b0 + t1a;
- a1 = a1*b1 + (t1>>32) + (a0<t1a);
+ a0 = a0 * b0 + t1a;
+ a1 = a1 * b1 + (t1 >> 32) + (a0 < t1a);
a0 += r;
- a1 += a0<r;
+ a1 += a0 < r;
- for(i=63; i>=0; i--){
-// int o= a1 & 0x8000000000000000ULL;
- a1+= a1 + ((a0>>i)&1);
- t1+=t1;
- if(/*o || */c <= a1){
+ for (i = 63; i >= 0; i--) {
+ a1 += a1 + ((a0 >> i) & 1);
+ t1 += t1;
+ if (c <= a1) {
a1 -= c;
t1++;
}
@@ -107,23 +116,24 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
}
#else
AVInteger ai;
- ai= av_mul_i(av_int2i(a), av_int2i(b));
- ai= av_add_i(ai, av_int2i(r));
+ ai = av_mul_i(av_int2i(a), av_int2i(b));
+ ai = av_add_i(ai, av_int2i(r));
return av_i2int(av_div_i(ai, av_int2i(c)));
}
#endif
}
-int64_t av_rescale(int64_t a, int64_t b, int64_t c){
+int64_t av_rescale(int64_t a, int64_t b, int64_t c)
+{
return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
}
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
enum AVRounding rnd)
{
- int64_t b= bq.num * (int64_t)cq.den;
- int64_t c= cq.num * (int64_t)bq.den;
+ int64_t b = bq.num * (int64_t)cq.den;
+ int64_t c = cq.num * (int64_t)bq.den;
return av_rescale_rnd(a, b, c, rnd);
}
@@ -132,20 +142,24 @@ int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
return av_rescale_q_rnd(a, bq, cq, AV_ROUND_NEAR_INF);
}
-int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b){
- int64_t a= tb_a.num * (int64_t)tb_b.den;
- int64_t b= tb_b.num * (int64_t)tb_a.den;
- if((FFABS(ts_a)|a|FFABS(ts_b)|b)<=INT_MAX)
+int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b)
+{
+ int64_t a = tb_a.num * (int64_t)tb_b.den;
+ int64_t b = tb_b.num * (int64_t)tb_a.den;
+ if ((FFABS(ts_a)|a|FFABS(ts_b)|b) <= INT_MAX)
return (ts_a*a > ts_b*b) - (ts_a*a < ts_b*b);
- if (av_rescale_rnd(ts_a, a, b, AV_ROUND_DOWN) < ts_b) return -1;
- if (av_rescale_rnd(ts_b, b, a, AV_ROUND_DOWN) < ts_a) return 1;
+ if (av_rescale_rnd(ts_a, a, b, AV_ROUND_DOWN) < ts_b)
+ return -1;
+ if (av_rescale_rnd(ts_b, b, a, AV_ROUND_DOWN) < ts_a)
+ return 1;
return 0;
}
-int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod){
- int64_t c= (a-b) & (mod-1);
- if(c > (mod>>1))
- c-= mod;
+int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod)
+{
+ int64_t c = (a - b) & (mod - 1);
+ if (c > (mod >> 1))
+ c -= mod;
return c;
}
@@ -171,3 +185,17 @@ simple_round:
return av_rescale_q(this, fs_tb, out_tb);
}
+
+int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc)
+{
+ AVRational step = av_mul_q(inc_tb, (AVRational) {inc, 1});
+
+ if (av_cmp_q(step, ts_tb) < 0) {
+ //increase step is too small for even 1 step to be representable
+ return ts;
+ } else {
+ int64_t old = av_rescale_q(ts, ts_tb, step);
+ int64_t old_ts = av_rescale_q(old, step, ts_tb);
+ return av_rescale_q(old + 1, step, ts_tb) + (ts - old_ts);
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavutil/mathematics.h b/chromium/third_party/ffmpeg/libavutil/mathematics.h
index 71f0392218d..88739e80b8f 100644
--- a/chromium/third_party/ffmpeg/libavutil/mathematics.h
+++ b/chromium/third_party/ffmpeg/libavutil/mathematics.h
@@ -45,6 +45,9 @@
#ifndef M_PI
#define M_PI 3.14159265358979323846 /* pi */
#endif
+#ifndef M_PI_2
+#define M_PI_2 1.57079632679489661923 /* pi/2 */
+#endif
#ifndef M_SQRT1_2
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
#endif
@@ -133,14 +136,28 @@ int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
* Rescale a timestamp while preserving known durations.
*
* @param in_ts Input timestamp
- * @param in_tb Input timesbase
+ * @param in_tb Input timebase
* @param fs_tb Duration and *last timebase
* @param duration duration till the next call
- * @param out_tb Output timesbase
+ * @param out_tb Output timebase
*/
int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb);
/**
+ * Add a value to a timestamp.
+ *
+ * This function gurantees that when the same value is repeatly added that
+ * no accumulation of rounding errors occurs.
+ *
+ * @param ts Input timestamp
+ * @param ts_tb Input timestamp timebase
+ * @param inc value to add to ts
+ * @param inc_tb inc timebase
+ */
+int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc);
+
+
+ /**
* @}
*/
diff --git a/chromium/third_party/ffmpeg/libavutil/mem.c b/chromium/third_party/ffmpeg/libavutil/mem.c
index 10b0137a7e2..8226168eedc 100644
--- a/chromium/third_party/ffmpeg/libavutil/mem.c
+++ b/chromium/third_party/ffmpeg/libavutil/mem.c
@@ -39,6 +39,7 @@
#include "avassert.h"
#include "avutil.h"
#include "common.h"
+#include "dynarray.h"
#include "intreadwrite.h"
#include "mem.h"
@@ -277,67 +278,48 @@ void *av_memdup(const void *p, size_t size)
return ptr;
}
-void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem)
+int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem)
{
- /* see similar ffmpeg.c:grow_array() */
- int nb, nb_alloc;
- intptr_t *tab;
-
- nb = *nb_ptr;
- tab = *(intptr_t**)tab_ptr;
- if ((nb & (nb - 1)) == 0) {
- if (nb == 0) {
- nb_alloc = 1;
- } else {
- if (nb > INT_MAX / (2 * sizeof(intptr_t)))
- goto fail;
- nb_alloc = nb * 2;
- }
- tab = av_realloc(tab, nb_alloc * sizeof(intptr_t));
- if (!tab)
- goto fail;
- *(intptr_t**)tab_ptr = tab;
- }
- tab[nb++] = (intptr_t)elem;
- *nb_ptr = nb;
- return;
+ void **tab = *(void ***)tab_ptr;
+
+ AV_DYNARRAY_ADD(INT_MAX, sizeof(*tab), tab, *nb_ptr, {
+ tab[*nb_ptr] = elem;
+ *(void ***)tab_ptr = tab;
+ }, {
+ return AVERROR(ENOMEM);
+ });
+ return 0;
+}
-fail:
- av_freep(tab_ptr);
- *nb_ptr = 0;
+void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem)
+{
+ void **tab = *(void ***)tab_ptr;
+
+ AV_DYNARRAY_ADD(INT_MAX, sizeof(*tab), tab, *nb_ptr, {
+ tab[*nb_ptr] = elem;
+ *(void ***)tab_ptr = tab;
+ }, {
+ *nb_ptr = 0;
+ av_freep(tab_ptr);
+ });
}
void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size,
const uint8_t *elem_data)
{
- int nb = *nb_ptr, nb_alloc;
- uint8_t *tab = *tab_ptr, *tab_elem_data;
-
- if ((nb & (nb - 1)) == 0) {
- if (nb == 0) {
- nb_alloc = 1;
- } else {
- if (nb > INT_MAX / (2 * elem_size))
- goto fail;
- nb_alloc = nb * 2;
- }
- tab = av_realloc(tab, nb_alloc * elem_size);
- if (!tab)
- goto fail;
- *tab_ptr = tab;
- }
- *nb_ptr = nb + 1;
- tab_elem_data = tab + nb*elem_size;
- if (elem_data)
- memcpy(tab_elem_data, elem_data, elem_size);
- else if (CONFIG_MEMORY_POISONING)
- memset(tab_elem_data, FF_MEMORY_POISON, elem_size);
+ uint8_t *tab_elem_data = NULL;
+
+ AV_DYNARRAY_ADD(INT_MAX, elem_size, *tab_ptr, *nb_ptr, {
+ tab_elem_data = (uint8_t *)*tab_ptr + (*nb_ptr) * elem_size;
+ if (elem_data)
+ memcpy(tab_elem_data, elem_data, elem_size);
+ else if (CONFIG_MEMORY_POISONING)
+ memset(tab_elem_data, FF_MEMORY_POISON, elem_size);
+ }, {
+ av_freep(tab_ptr);
+ *nb_ptr = 0;
+ });
return tab_elem_data;
-
-fail:
- av_freep(tab_ptr);
- *nb_ptr = 0;
- return NULL;
}
static void fill16(uint8_t *dst, int len)
diff --git a/chromium/third_party/ffmpeg/libavutil/mem.h b/chromium/third_party/ffmpeg/libavutil/mem.h
index 703ce819364..801c53ff512 100644
--- a/chromium/third_party/ffmpeg/libavutil/mem.h
+++ b/chromium/third_party/ffmpeg/libavutil/mem.h
@@ -276,11 +276,26 @@ void av_freep(void *ptr);
* @param tab_ptr pointer to the array to grow
* @param nb_ptr pointer to the number of elements in the array
* @param elem element to add
- * @see av_dynarray2_add()
+ * @see av_dynarray_add_nofree(), av_dynarray2_add()
*/
void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem);
/**
+ * Add an element to a dynamic array.
+ *
+ * Function has the same functionality as av_dynarray_add(),
+ * but it doesn't free memory on fails. It returns error code
+ * instead and leave current buffer untouched.
+ *
+ * @param tab_ptr pointer to the array to grow
+ * @param nb_ptr pointer to the number of elements in the array
+ * @param elem element to add
+ * @return >=0 on success, negative otherwise.
+ * @see av_dynarray_add(), av_dynarray2_add()
+ */
+int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem);
+
+/**
* Add an element of size elem_size to a dynamic array.
*
* The array is reallocated when its number of elements reaches powers of 2.
@@ -299,7 +314,7 @@ void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem);
* the new added element is not filled.
* @return pointer to the data of the element to copy in the new allocated space.
* If NULL, the new allocated space is left uninitialized."
- * @see av_dynarray_add()
+ * @see av_dynarray_add(), av_dynarray_add_nofree()
*/
void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size,
const uint8_t *elem_data);
diff --git a/chromium/third_party/ffmpeg/libavutil/opencl.c b/chromium/third_party/ffmpeg/libavutil/opencl.c
index 142c6b0bf21..a92bce76b46 100644
--- a/chromium/third_party/ffmpeg/libavutil/opencl.c
+++ b/chromium/third_party/ffmpeg/libavutil/opencl.c
@@ -27,15 +27,20 @@
#include "avassert.h"
#include "opt.h"
+#if HAVE_THREADS
#if HAVE_PTHREADS
-
#include <pthread.h>
-static pthread_mutex_t atomic_opencl_lock = PTHREAD_MUTEX_INITIALIZER;
-
-#define LOCK_OPENCL pthread_mutex_lock(&atomic_opencl_lock)
-#define UNLOCK_OPENCL pthread_mutex_unlock(&atomic_opencl_lock)
+#elif HAVE_W32THREADS
+#include "compat/w32pthreads.h"
+#elif HAVE_OS2THREADS
+#include "compat/os2threads.h"
+#endif
+#include "atomic.h"
-#elif !HAVE_THREADS
+static volatile pthread_mutex_t *atomic_opencl_lock = NULL;
+#define LOCK_OPENCL pthread_mutex_lock(atomic_opencl_lock)
+#define UNLOCK_OPENCL pthread_mutex_unlock(atomic_opencl_lock)
+#else
#define LOCK_OPENCL
#define UNLOCK_OPENCL
#endif
@@ -169,7 +174,7 @@ static const OpenclErrorMsg opencl_err_msg[] = {
const char *av_opencl_errstr(cl_int status)
{
int i;
- for (i = 0; i < sizeof(opencl_err_msg); i++) {
+ for (i = 0; i < FF_ARRAY_ELEMS(opencl_err_msg); i++) {
if (opencl_err_msg[i].err_code == status)
return opencl_err_msg[i].err_str;
}
@@ -321,9 +326,32 @@ void av_opencl_free_device_list(AVOpenCLDeviceList **device_list)
av_freep(device_list);
}
+static inline int init_opencl_mtx(void)
+{
+#if HAVE_THREADS
+ if (!atomic_opencl_lock) {
+ int err;
+ pthread_mutex_t *tmp = av_malloc(sizeof(pthread_mutex_t));
+ if (!tmp)
+ return AVERROR(ENOMEM);
+ if ((err = pthread_mutex_init(tmp, NULL))) {
+ av_free(tmp);
+ return AVERROR(err);
+ }
+ if (avpriv_atomic_ptr_cas(&atomic_opencl_lock, NULL, tmp)) {
+ pthread_mutex_destroy(tmp);
+ av_free(tmp);
+ }
+ }
+#endif
+ return 0;
+}
+
int av_opencl_set_option(const char *key, const char *val)
{
- int ret = 0;
+ int ret = init_opencl_mtx( );
+ if (ret < 0)
+ return ret;
LOCK_OPENCL;
if (!opencl_ctx.opt_init_flag) {
av_opt_set_defaults(&opencl_ctx);
@@ -368,7 +396,9 @@ void av_opencl_free_external_env(AVOpenCLExternalEnv **ext_opencl_env)
int av_opencl_register_kernel_code(const char *kernel_code)
{
- int i, ret = 0;
+ int i, ret = init_opencl_mtx( );
+ if (ret < 0)
+ return ret;
LOCK_OPENCL;
if (opencl_ctx.kernel_code_count >= MAX_KERNEL_CODE_NUM) {
av_log(&opencl_ctx, AV_LOG_ERROR,
@@ -553,7 +583,9 @@ static int init_opencl_env(OpenclContext *opencl_ctx, AVOpenCLExternalEnv *ext_o
int av_opencl_init(AVOpenCLExternalEnv *ext_opencl_env)
{
- int ret = 0;
+ int ret = init_opencl_mtx( );
+ if (ret < 0)
+ return ret;
LOCK_OPENCL;
if (!opencl_ctx.init_count) {
if (!opencl_ctx.opt_init_flag) {
diff --git a/chromium/third_party/ffmpeg/libavutil/opencl.h b/chromium/third_party/ffmpeg/libavutil/opencl.h
index cf0abd79751..9e6dc55ee8a 100644
--- a/chromium/third_party/ffmpeg/libavutil/opencl.h
+++ b/chromium/third_party/ffmpeg/libavutil/opencl.h
@@ -38,6 +38,7 @@
#else
#include <OpenCL/cl.h>
#endif
+#include <stdint.h>
#include "dict.h"
#include "libavutil/version.h"
diff --git a/chromium/third_party/ffmpeg/libavutil/opt.c b/chromium/third_party/ffmpeg/libavutil/opt.c
index f6aa496b8c0..199eadbc05d 100644
--- a/chromium/third_party/ffmpeg/libavutil/opt.c
+++ b/chromium/third_party/ffmpeg/libavutil/opt.c
@@ -195,6 +195,15 @@ static int set_string(void *obj, const AVOption *o, const char *val, uint8_t **d
static int set_string_number(void *obj, void *target_obj, const AVOption *o, const char *val, void *dst)
{
int ret = 0, notfirst = 0;
+ int num, den;
+ char c;
+
+ if (sscanf(val, "%d%*1[:/]%d%c", &num, &den, &c) == 2) {
+ if ((ret = write_number(obj, o, dst, 1, den, num)) >= 0)
+ return ret;
+ ret = 0;
+ }
+
for (;;) {
int i, den = 1;
char buf[256];
@@ -295,6 +304,58 @@ static int set_string_color(void *obj, const AVOption *o, const char *val, uint8
return 0;
}
+static int set_string_fmt(void *obj, const AVOption *o, const char *val, uint8_t *dst,
+ int fmt_nb, int ((*get_fmt)(const char *)), const char *desc)
+{
+ int fmt, min, max;
+
+ if (!val || !strcmp(val, "none")) {
+ fmt = -1;
+ } else {
+ fmt = get_fmt(val);
+ if (fmt == -1) {
+ char *tail;
+ fmt = strtol(val, &tail, 0);
+ if (*tail || (unsigned)fmt >= fmt_nb) {
+ av_log(obj, AV_LOG_ERROR,
+ "Unable to parse option value \"%s\" as %s\n", val, desc);
+ return AVERROR(EINVAL);
+ }
+ }
+ }
+
+ min = FFMAX(o->min, -1);
+ max = FFMIN(o->max, fmt_nb-1);
+
+ // hack for compatibility with old ffmpeg
+ if(min == 0 && max == 0) {
+ min = -1;
+ max = fmt_nb-1;
+ }
+
+ if (fmt < min || fmt > max) {
+ av_log(obj, AV_LOG_ERROR,
+ "Value %d for parameter '%s' out of %s format range [%d - %d]\n",
+ fmt, o->name, desc, min, max);
+ return AVERROR(ERANGE);
+ }
+
+ *(int *)dst = fmt;
+ return 0;
+}
+
+static int set_string_pixel_fmt(void *obj, const AVOption *o, const char *val, uint8_t *dst)
+{
+ return set_string_fmt(obj, o, val, dst,
+ AV_PIX_FMT_NB, av_get_pix_fmt, "pixel format");
+}
+
+static int set_string_sample_fmt(void *obj, const AVOption *o, const char *val, uint8_t *dst)
+{
+ return set_string_fmt(obj, o, val, dst,
+ AV_SAMPLE_FMT_NB, av_get_sample_fmt, "sample format");
+}
+
#if FF_API_OLD_AVOPTIONS
int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out)
{
@@ -319,6 +380,9 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
o->type != AV_OPT_TYPE_CHANNEL_LAYOUT))
return AVERROR(EINVAL);
+ if (o->flags & AV_OPT_FLAG_READONLY)
+ return AVERROR(EINVAL);
+
dst = ((uint8_t*)target_obj) + o->offset;
switch (o->type) {
case AV_OPT_TYPE_STRING: return set_string(obj, o, val, dst);
@@ -331,38 +395,8 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
case AV_OPT_TYPE_RATIONAL: return set_string_number(obj, target_obj, o, val, dst);
case AV_OPT_TYPE_IMAGE_SIZE: return set_string_image_size(obj, o, val, dst);
case AV_OPT_TYPE_VIDEO_RATE: return set_string_video_rate(obj, o, val, dst);
- case AV_OPT_TYPE_PIXEL_FMT:
- if (!val || !strcmp(val, "none")) {
- ret = AV_PIX_FMT_NONE;
- } else {
- ret = av_get_pix_fmt(val);
- if (ret == AV_PIX_FMT_NONE) {
- char *tail;
- ret = strtol(val, &tail, 0);
- if (*tail || (unsigned)ret >= AV_PIX_FMT_NB) {
- av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\" as pixel format\n", val);
- return AVERROR(EINVAL);
- }
- }
- }
- *(enum AVPixelFormat *)dst = ret;
- return 0;
- case AV_OPT_TYPE_SAMPLE_FMT:
- if (!val || !strcmp(val, "none")) {
- ret = AV_SAMPLE_FMT_NONE;
- } else {
- ret = av_get_sample_fmt(val);
- if (ret == AV_SAMPLE_FMT_NONE) {
- char *tail;
- ret = strtol(val, &tail, 0);
- if (*tail || (unsigned)ret >= AV_SAMPLE_FMT_NB) {
- av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\" as sample format\n", val);
- return AVERROR(EINVAL);
- }
- }
- }
- *(enum AVSampleFormat *)dst = ret;
- return 0;
+ case AV_OPT_TYPE_PIXEL_FMT: return set_string_pixel_fmt(obj, o, val, dst);
+ case AV_OPT_TYPE_SAMPLE_FMT: return set_string_sample_fmt(obj, o, val, dst);
case AV_OPT_TYPE_DURATION:
if (!val) {
*(int64_t *)dst = 0;
@@ -400,7 +434,7 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
#define OPT_EVAL_NUMBER(name, opttype, vartype)\
int av_opt_eval_ ## name(void *obj, const AVOption *o, const char *val, vartype *name ## _out)\
{\
- if (!o || o->type != opttype)\
+ if (!o || o->type != opttype || o->flags & AV_OPT_FLAG_READONLY)\
return AVERROR(EINVAL);\
return set_string_number(obj, obj, o, val, name ## _out);\
}
@@ -421,6 +455,9 @@ static int set_number(void *obj, const char *name, double num, int den, int64_t
if (!o || !target_obj)
return AVERROR_OPTION_NOT_FOUND;
+ if (o->flags & AV_OPT_FLAG_READONLY)
+ return AVERROR(EINVAL);
+
dst = ((uint8_t*)target_obj) + o->offset;
return write_number(obj, o, dst, num, den, intnum);
}
@@ -477,7 +514,7 @@ int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int
if (!o || !target_obj)
return AVERROR_OPTION_NOT_FOUND;
- if (o->type != AV_OPT_TYPE_BINARY)
+ if (o->type != AV_OPT_TYPE_BINARY || o->flags & AV_OPT_FLAG_READONLY)
return AVERROR(EINVAL);
ptr = len ? av_malloc(len) : NULL;
@@ -552,15 +589,15 @@ static int set_format(void *obj, const char *name, int fmt, int search_flags,
return AVERROR(EINVAL);
}
-#if LIBAVUTIL_VERSION_MAJOR < 53
+#if LIBAVUTIL_VERSION_MAJOR < 54
if (class->version && class->version < AV_VERSION_INT(52, 11, 100)) {
min = -1;
max = nb_fmts-1;
} else
#endif
{
- min = FFMIN(o->min, -1);
- max = FFMAX(o->max, nb_fmts-1);
+ min = FFMAX(o->min, -1);
+ max = FFMIN(o->max, nb_fmts-1);
}
if (fmt < min || fmt > max) {
av_log(obj, AV_LOG_ERROR,
@@ -905,6 +942,8 @@ static void log_value(void *av_log_obj, int level, double d)
av_log(av_log_obj, level, "INT_MAX");
} else if (d == INT_MIN) {
av_log(av_log_obj, level, "INT_MIN");
+ } else if (d == UINT32_MAX) {
+ av_log(av_log_obj, level, "UINT32_MAX");
} else if (d == (double)INT64_MAX) {
av_log(av_log_obj, level, "I64_MAX");
} else if (d == INT64_MIN) {
@@ -913,6 +952,18 @@ static void log_value(void *av_log_obj, int level, double d)
av_log(av_log_obj, level, "FLT_MAX");
} else if (d == FLT_MIN) {
av_log(av_log_obj, level, "FLT_MIN");
+ } else if (d == -FLT_MAX) {
+ av_log(av_log_obj, level, "-FLT_MAX");
+ } else if (d == -FLT_MIN) {
+ av_log(av_log_obj, level, "-FLT_MIN");
+ } else if (d == DBL_MAX) {
+ av_log(av_log_obj, level, "DBL_MAX");
+ } else if (d == DBL_MIN) {
+ av_log(av_log_obj, level, "DBL_MIN");
+ } else if (d == -DBL_MAX) {
+ av_log(av_log_obj, level, "-DBL_MAX");
+ } else if (d == -DBL_MIN) {
+ av_log(av_log_obj, level, "-DBL_MIN");
} else {
av_log(av_log_obj, level, "%g", d);
}
@@ -1003,6 +1054,8 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_VIDEO_PARAM ) ? 'V' : '.');
av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_AUDIO_PARAM ) ? 'A' : '.');
av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.');
+ av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_EXPORT) ? 'X' : '.');
+ av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_READONLY) ? 'R' : '.');
if (opt->help)
av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help);
@@ -1106,6 +1159,10 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
if ((opt->flags & mask) != flags)
continue;
#endif
+
+ if (opt->flags & AV_OPT_FLAG_READONLY)
+ continue;
+
switch (opt->type) {
case AV_OPT_TYPE_CONST:
/* Nothing to be done here */
@@ -1143,7 +1200,7 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
set_string_video_rate(s, opt, opt->default_val.str, dst);
break;
case AV_OPT_TYPE_PIXEL_FMT:
-#if LIBAVUTIL_VERSION_MAJOR < 53
+#if LIBAVUTIL_VERSION_MAJOR < 54
if (class->version && class->version < AV_VERSION_INT(52, 10, 100))
av_opt_set(s, opt->name, opt->default_val.str, 0);
else
@@ -1151,7 +1208,7 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
write_number(s, opt, dst, 1, 1, opt->default_val.i64);
break;
case AV_OPT_TYPE_SAMPLE_FMT:
-#if LIBAVUTIL_VERSION_MAJOR < 53
+#if LIBAVUTIL_VERSION_MAJOR < 54
if (class->version && class->version < AV_VERSION_INT(52, 10, 100))
av_opt_set(s, opt->name, opt->default_val.str, 0);
else
@@ -1358,14 +1415,17 @@ void av_opt_free(void *obj)
av_freep((uint8_t *)obj + o->offset);
}
-int av_opt_set_dict(void *obj, AVDictionary **options)
+int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags)
{
AVDictionaryEntry *t = NULL;
AVDictionary *tmp = NULL;
int ret = 0;
+ if (!options)
+ return 0;
+
while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) {
- ret = av_opt_set(obj, t->key, t->value, 0);
+ ret = av_opt_set(obj, t->key, t->value, search_flags);
if (ret == AVERROR_OPTION_NOT_FOUND)
av_dict_set(&tmp, t->key, t->value, 0);
else if (ret < 0) {
@@ -1379,6 +1439,11 @@ int av_opt_set_dict(void *obj, AVDictionary **options)
return ret;
}
+int av_opt_set_dict(void *obj, AVDictionary **options)
+{
+ return av_opt_set_dict2(obj, options, 0);
+}
+
const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
int opt_flags, int search_flags)
{
@@ -1454,6 +1519,7 @@ void *av_opt_ptr(const AVClass *class, void *obj, const char *name)
int av_opt_query_ranges(AVOptionRanges **ranges_arg, void *obj, const char *key, int flags)
{
+ int ret;
const AVClass *c = *(AVClass**)obj;
int (*callback)(AVOptionRanges **, void *obj, const char *key, int flags) = NULL;
@@ -1463,7 +1529,13 @@ int av_opt_query_ranges(AVOptionRanges **ranges_arg, void *obj, const char *key,
if (!callback)
callback = av_opt_query_ranges_default;
- return callback(ranges_arg, obj, key, flags);
+ ret = callback(ranges_arg, obj, key, flags);
+ if (ret >= 0) {
+ if (!(flags & AV_OPT_MULTI_COMPONENT_RANGE))
+ ret = 1;
+ (*ranges_arg)->nb_components = ret;
+ }
+ return ret;
}
int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const char *key, int flags)
@@ -1484,6 +1556,7 @@ int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const ch
ranges->range = range_array;
ranges->range[0] = range;
ranges->nb_ranges = 1;
+ ranges->nb_components = 1;
range->is_range = 1;
range->value_min = field->min;
range->value_max = field->max;
@@ -1527,7 +1600,7 @@ int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const ch
}
*ranges_arg = ranges;
- return 0;
+ return 1;
fail:
av_free(ranges);
av_free(range);
@@ -1540,10 +1613,15 @@ void av_opt_freep_ranges(AVOptionRanges **rangesp)
int i;
AVOptionRanges *ranges = *rangesp;
- for (i = 0; i < ranges->nb_ranges; i++) {
+ if (!ranges)
+ return;
+
+ for (i = 0; i < ranges->nb_ranges * ranges->nb_components; i++) {
AVOptionRange *range = ranges->range[i];
- av_freep(&range->str);
- av_freep(&ranges->range[i]);
+ if (range) {
+ av_freep(&range->str);
+ av_freep(&ranges->range[i]);
+ }
}
av_freep(&ranges->range);
av_freep(rangesp);
@@ -1584,8 +1662,8 @@ static const AVOption test_options[]= {
{"lame", "set lame flag ", 0, AV_OPT_TYPE_CONST, {.i64 = TEST_FLAG_LAME}, INT_MIN, INT_MAX, 0, "flags" },
{"mu", "set mu flag ", 0, AV_OPT_TYPE_CONST, {.i64 = TEST_FLAG_MU}, INT_MIN, INT_MAX, 0, "flags" },
{"size", "set size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE,{0}, 0, 0 },
-{"pix_fmt", "set pixfmt", OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_NONE}, -1, AV_PIX_FMT_NB-1},
-{"sample_fmt", "set samplefmt", OFFSET(sample_fmt), AV_OPT_TYPE_SAMPLE_FMT, {.i64 = AV_SAMPLE_FMT_NONE}, -1, AV_SAMPLE_FMT_NB-1},
+{"pix_fmt", "set pixfmt", OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_NONE}, -1, INT_MAX},
+{"sample_fmt", "set samplefmt", OFFSET(sample_fmt), AV_OPT_TYPE_SAMPLE_FMT, {.i64 = AV_SAMPLE_FMT_NONE}, -1, INT_MAX},
{"video_rate", "set videorate", OFFSET(video_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0 },
{"duration", "set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX},
{"color", "set color", OFFSET(color), AV_OPT_TYPE_COLOR, {.str = "pink"}, 0, 0},
diff --git a/chromium/third_party/ffmpeg/libavutil/opt.h b/chromium/third_party/ffmpeg/libavutil/opt.h
index 14faa6e066e..1e1dd69b30e 100644
--- a/chromium/third_party/ffmpeg/libavutil/opt.h
+++ b/chromium/third_party/ffmpeg/libavutil/opt.h
@@ -282,10 +282,21 @@ typedef struct AVOption {
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
+#if FF_API_OPT_TYPE_METADATA
#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
+#endif
#define AV_OPT_FLAG_AUDIO_PARAM 8
#define AV_OPT_FLAG_VIDEO_PARAM 16
#define AV_OPT_FLAG_SUBTITLE_PARAM 32
+/**
+ * The option is inteded for exporting values to the caller.
+ */
+#define AV_OPT_FLAG_EXPORT 64
+/**
+ * The option may not be set through the AVOptions API, only read.
+ * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set.
+ */
+#define AV_OPT_FLAG_READONLY 128
#define AV_OPT_FLAG_FILTERING_PARAM (1<<16) ///< a generic parameter which can be set by the user for filtering
//FIXME think about enc-audio, ... style flags
@@ -302,17 +313,67 @@ typedef struct AVOption {
*/
typedef struct AVOptionRange {
const char *str;
- double value_min, value_max; ///< For string ranges this represents the min/max length, for dimensions this represents the min/max pixel count
- double component_min, component_max; ///< For string this represents the unicode range for chars, 0-127 limits to ASCII
- int is_range; ///< if set to 1 the struct encodes a range, if set to 0 a single value
+ /**
+ * Value range.
+ * For string ranges this represents the min/max length.
+ * For dimensions this represents the min/max pixel count or width/height in multi-component case.
+ */
+ double value_min, value_max;
+ /**
+ * Value's component range.
+ * For string this represents the unicode range for chars, 0-127 limits to ASCII.
+ */
+ double component_min, component_max;
+ /**
+ * Range flag.
+ * If set to 1 the struct encodes a range, if set to 0 a single value.
+ */
+ int is_range;
} AVOptionRange;
/**
- * List of AVOptionRange structs
+ * List of AVOptionRange structs.
*/
typedef struct AVOptionRanges {
+ /**
+ * Array of option ranges.
+ *
+ * Most of option types use just one component.
+ * Following describes multi-component option types:
+ *
+ * AV_OPT_TYPE_IMAGE_SIZE:
+ * component index 0: range of pixel count (width * height).
+ * component index 1: range of width.
+ * component index 2: range of height.
+ *
+ * @note To obtain multi-component version of this structure, user must
+ * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or
+ * av_opt_query_ranges_default function.
+ *
+ * Multi-component range can be read as in following example:
+ *
+ * @code
+ * int range_index, component_index;
+ * AVOptionRanges *ranges;
+ * AVOptionRange *range[3]; //may require more than 3 in the future.
+ * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE);
+ * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) {
+ * for (component_index = 0; component_index < ranges->nb_components; component_index++)
+ * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index];
+ * //do something with range here.
+ * }
+ * av_opt_freep_ranges(&ranges);
+ * @endcode
+ */
AVOptionRange **range;
+ /**
+ * Number of ranges per component.
+ */
int nb_ranges;
+ /**
+ * Number of componentes.
+ */
+ int nb_components;
} AVOptionRanges;
@@ -480,6 +541,24 @@ int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
*/
int av_opt_set_dict(void *obj, struct AVDictionary **options);
+
+/**
+ * Set all the options from a given dictionary on an object.
+ *
+ * @param obj a struct whose first element is a pointer to AVClass
+ * @param options options to process. This dictionary will be freed and replaced
+ * by a new one containing all options not found in obj.
+ * Of course this new dictionary needs to be freed by caller
+ * with av_dict_free().
+ * @param search_flags A combination of AV_OPT_SEARCH_*.
+ *
+ * @return 0 on success, a negative AVERROR if some option was found in obj,
+ * but could not be set.
+ *
+ * @see av_dict_copy()
+ */
+int av_opt_set_dict2(void *obj, struct AVDictionary **options, int search_flags);
+
/**
* Extract a key-value pair from the beginning of a string.
*
@@ -548,6 +627,13 @@ int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational
#define AV_OPT_SEARCH_FAKE_OBJ 0x0002
/**
+ * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than
+ * one component for certain option types.
+ * @see AVOptionRanges for details.
+ */
+#define AV_OPT_MULTI_COMPONENT_RANGE 0x1000
+
+/**
* Look for an option in an object. Consider only options which
* have all the specified flags set.
*
@@ -728,10 +814,11 @@ void av_opt_freep_ranges(AVOptionRanges **ranges);
*
* @param flags is a bitmask of flags, undefined flags should not be set and should be ignored
* AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance
+ * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges
*
* The result must be freed with av_opt_freep_ranges.
*
- * @return >= 0 on success, a negative errro code otherwise
+ * @return number of compontents returned on success, a negative errro code otherwise
*/
int av_opt_query_ranges(AVOptionRanges **, void *obj, const char *key, int flags);
@@ -743,10 +830,11 @@ int av_opt_query_ranges(AVOptionRanges **, void *obj, const char *key, int flags
*
* @param flags is a bitmask of flags, undefined flags should not be set and should be ignored
* AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance
+ * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges
*
* The result must be freed with av_opt_free_ranges.
*
- * @return >= 0 on success, a negative errro code otherwise
+ * @return number of compontents returned on success, a negative errro code otherwise
*/
int av_opt_query_ranges_default(AVOptionRanges **, void *obj, const char *key, int flags);
diff --git a/chromium/third_party/ffmpeg/libavutil/parseutils.c b/chromium/third_party/ffmpeg/libavutil/parseutils.c
index e793e2d4c6a..ba4b4e1b722 100644
--- a/chromium/third_party/ffmpeg/libavutil/parseutils.c
+++ b/chromium/third_party/ffmpeg/libavutil/parseutils.c
@@ -613,12 +613,14 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
dt.tm_hour = 0;
}
if (!q) {
+ char *o;
/* parse timestr as S+ */
- dt.tm_sec = strtol(p, (void *)&q, 10);
- if (q == p) /* the parsing didn't succeed */
+ dt.tm_sec = strtol(p, &o, 10);
+ if (o == p) /* the parsing didn't succeed */
return AVERROR(EINVAL);
dt.tm_min = 0;
dt.tm_hour = 0;
+ q = o;
}
}
diff --git a/chromium/third_party/ffmpeg/libavutil/pca.c b/chromium/third_party/ffmpeg/libavutil/pca.c
index 311b6bc9cb4..26d5bbb1570 100644
--- a/chromium/third_party/ffmpeg/libavutil/pca.c
+++ b/chromium/third_party/ffmpeg/libavutil/pca.c
@@ -42,7 +42,7 @@ PCA *ff_pca_init(int n){
pca= av_mallocz(sizeof(*pca));
pca->n= n;
- pca->z = av_malloc(sizeof(*pca->z) * n);
+ pca->z = av_malloc_array(n, sizeof(*pca->z));
pca->count=0;
pca->covariance= av_calloc(n*n, sizeof(double));
pca->mean= av_calloc(n, sizeof(double));
diff --git a/chromium/third_party/ffmpeg/libavutil/pixdesc.c b/chromium/third_party/ffmpeg/libavutil/pixdesc.c
index 0cb2f34f57e..f00907dc240 100644
--- a/chromium/third_party/ffmpeg/libavutil/pixdesc.c
+++ b/chromium/third_party/ffmpeg/libavutil/pixdesc.c
@@ -154,6 +154,17 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{ 0, 3, 4, 0, 7 }, /* V */
},
},
+ [AV_PIX_FMT_YVYU422] = {
+ .name = "yvyu422",
+ .nb_components = 3,
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 1, 1, 0, 7 }, /* Y */
+ { 0, 3, 2, 0, 7 }, /* V */
+ { 0, 3, 4, 0, 7 }, /* U */
+ },
+ },
[AV_PIX_FMT_RGB24] = {
.name = "rgb24",
.nb_components = 3,
@@ -324,6 +335,12 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.flags = AV_PIX_FMT_FLAG_HWACCEL,
},
#endif /* FF_API_XVMC */
+#if !FF_API_XVMC
+ [AV_PIX_FMT_XVMC] = {
+ .name = "xvmc",
+ .flags = AV_PIX_FMT_FLAG_HWACCEL,
+ },
+#endif /* !FF_API_XVMC */
[AV_PIX_FMT_UYVY422] = {
.name = "uyvy422",
.nb_components = 3,
@@ -922,22 +939,22 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
[AV_PIX_FMT_RGBA64BE] = {
.name = "rgba64be",
- .nb_components= 4,
- .log2_chroma_w= 0,
- .log2_chroma_h= 0,
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
.comp = {
{ 0, 7, 1, 0, 15 }, /* R */
{ 0, 7, 3, 0, 15 }, /* G */
{ 0, 7, 5, 0, 15 }, /* B */
{ 0, 7, 7, 0, 15 }, /* A */
},
- .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA,
+ .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
},
[AV_PIX_FMT_RGBA64LE] = {
.name = "rgba64le",
- .nb_components= 4,
- .log2_chroma_w= 0,
- .log2_chroma_h= 0,
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
.comp = {
{ 0, 7, 1, 0, 15 }, /* R */
{ 0, 7, 3, 0, 15 }, /* G */
@@ -1044,9 +1061,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
[AV_PIX_FMT_BGRA64BE] = {
.name = "bgra64be",
- .nb_components= 4,
- .log2_chroma_w= 0,
- .log2_chroma_h= 0,
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
.comp = {
{ 0, 7, 5, 0, 15 }, /* R */
{ 0, 7, 3, 0, 15 }, /* G */
@@ -1057,9 +1074,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
[AV_PIX_FMT_BGRA64LE] = {
.name = "bgra64le",
- .nb_components= 4,
- .log2_chroma_w= 0,
- .log2_chroma_h= 0,
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
.comp = {
{ 0, 7, 5, 0, 15 }, /* R */
{ 0, 7, 3, 0, 15 }, /* G */
@@ -1764,50 +1781,62 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_BAYER_BGGR8] = {
.name = "bayer_bggr8",
BAYER8_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_BGGR16LE] = {
.name = "bayer_bggr16le",
BAYER16_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_BGGR16BE] = {
.name = "bayer_bggr16be",
BAYER16_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_RGGB8] = {
.name = "bayer_rggb8",
BAYER8_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_RGGB16LE] = {
.name = "bayer_rggb16le",
BAYER16_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_RGGB16BE] = {
.name = "bayer_rggb16be",
BAYER16_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_GBRG8] = {
.name = "bayer_gbrg8",
BAYER8_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_GBRG16LE] = {
.name = "bayer_gbrg16le",
BAYER16_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_GBRG16BE] = {
.name = "bayer_gbrg16be",
BAYER16_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_GRBG8] = {
.name = "bayer_grbg8",
BAYER8_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_GRBG16LE] = {
.name = "bayer_grbg16le",
BAYER16_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BAYER_GRBG16BE] = {
.name = "bayer_grbg16be",
BAYER16_DESC_COMMON
+ .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_NV16] = {
.name = "nv16",
@@ -1845,6 +1874,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
},
+ [AV_PIX_FMT_VDA] = {
+ .name = "vda",
+ .flags = AV_PIX_FMT_FLAG_HWACCEL,
+ },
};
FF_DISABLE_DEPRECATION_WARNINGS
@@ -2053,3 +2086,226 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
return get_pix_fmt_internal(name);
}
+
+#define FF_COLOR_NA -1
+#define FF_COLOR_RGB 0 /**< RGB color space */
+#define FF_COLOR_GRAY 1 /**< gray color space */
+#define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
+#define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
+
+#define pixdesc_has_alpha(pixdesc) \
+ ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
+
+
+static int get_color_type(const AVPixFmtDescriptor *desc) {
+ if (desc->flags & AV_PIX_FMT_FLAG_PAL)
+ return FF_COLOR_RGB;
+
+ if(desc->nb_components == 1 || desc->nb_components == 2)
+ return FF_COLOR_GRAY;
+
+ if(desc->name && !strncmp(desc->name, "yuvj", 4))
+ return FF_COLOR_YUV_JPEG;
+
+ if(desc->flags & AV_PIX_FMT_FLAG_RGB)
+ return FF_COLOR_RGB;
+
+ if(desc->nb_components == 0)
+ return FF_COLOR_NA;
+
+ return FF_COLOR_YUV;
+}
+
+static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+ int i;
+
+ if (!desc || !desc->nb_components) {
+ *min = *max = 0;
+ return AVERROR(EINVAL);
+ }
+
+ *min = INT_MAX, *max = -INT_MAX;
+ for (i = 0; i < desc->nb_components; i++) {
+ *min = FFMIN(desc->comp[i].depth_minus1+1, *min);
+ *max = FFMAX(desc->comp[i].depth_minus1+1, *max);
+ }
+ return 0;
+}
+
+static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
+ enum AVPixelFormat src_pix_fmt,
+ unsigned *lossp, unsigned consider)
+{
+ const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
+ const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
+ int src_color, dst_color;
+ int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
+ int ret, loss, i, nb_components;
+ int score = INT_MAX - 1;
+
+ if (dst_pix_fmt >= AV_PIX_FMT_NB || dst_pix_fmt <= AV_PIX_FMT_NONE)
+ return ~0;
+
+ /* compute loss */
+ *lossp = loss = 0;
+
+ if (dst_pix_fmt == src_pix_fmt)
+ return INT_MAX;
+
+ if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
+ return ret;
+ if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
+ return ret;
+
+ src_color = get_color_type(src_desc);
+ dst_color = get_color_type(dst_desc);
+ if (dst_pix_fmt == AV_PIX_FMT_PAL8)
+ nb_components = FFMIN(src_desc->nb_components, 4);
+ else
+ nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
+
+ for (i = 0; i < nb_components; i++) {
+ int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : dst_desc->comp[i].depth_minus1;
+ if (src_desc->comp[i].depth_minus1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
+ loss |= FF_LOSS_DEPTH;
+ score -= 65536 >> depth_minus1;
+ }
+ }
+
+ if (consider & FF_LOSS_RESOLUTION) {
+ if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
+ loss |= FF_LOSS_RESOLUTION;
+ score -= 256 << dst_desc->log2_chroma_w;
+ }
+ if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
+ loss |= FF_LOSS_RESOLUTION;
+ score -= 256 << dst_desc->log2_chroma_h;
+ }
+ // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
+ if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
+ dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
+ score += 512;
+ }
+ }
+
+ if(consider & FF_LOSS_COLORSPACE)
+ switch(dst_color) {
+ case FF_COLOR_RGB:
+ if (src_color != FF_COLOR_RGB &&
+ src_color != FF_COLOR_GRAY)
+ loss |= FF_LOSS_COLORSPACE;
+ break;
+ case FF_COLOR_GRAY:
+ if (src_color != FF_COLOR_GRAY)
+ loss |= FF_LOSS_COLORSPACE;
+ break;
+ case FF_COLOR_YUV:
+ if (src_color != FF_COLOR_YUV)
+ loss |= FF_LOSS_COLORSPACE;
+ break;
+ case FF_COLOR_YUV_JPEG:
+ if (src_color != FF_COLOR_YUV_JPEG &&
+ src_color != FF_COLOR_YUV &&
+ src_color != FF_COLOR_GRAY)
+ loss |= FF_LOSS_COLORSPACE;
+ break;
+ default:
+ /* fail safe test */
+ if (src_color != dst_color)
+ loss |= FF_LOSS_COLORSPACE;
+ break;
+ }
+ if(loss & FF_LOSS_COLORSPACE)
+ score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth_minus1, src_desc->comp[0].depth_minus1);
+
+ if (dst_color == FF_COLOR_GRAY &&
+ src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
+ loss |= FF_LOSS_CHROMA;
+ score -= 2 * 65536;
+ }
+ if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
+ loss |= FF_LOSS_ALPHA;
+ score -= 65536;
+ }
+ if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
+ (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
+ loss |= FF_LOSS_COLORQUANT;
+ score -= 65536;
+ }
+
+ *lossp = loss;
+ return score;
+}
+
+int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
+ enum AVPixelFormat src_pix_fmt,
+ int has_alpha)
+{
+ int loss;
+ int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
+ if (ret < 0)
+ return ret;
+ return loss;
+}
+
+enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
+ enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
+{
+ enum AVPixelFormat dst_pix_fmt;
+ int loss1, loss2, loss_mask;
+ const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
+ const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
+ int score1, score2;
+
+ loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
+ if(!has_alpha)
+ loss_mask &= ~FF_LOSS_ALPHA;
+
+ dst_pix_fmt = AV_PIX_FMT_NONE;
+ score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
+ score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
+
+ if (score1 == score2) {
+ if(av_get_padded_bits_per_pixel(desc2) != av_get_padded_bits_per_pixel(desc1)) {
+ dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
+ } else {
+ dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
+ }
+ } else {
+ dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
+ }
+
+ if (loss_ptr)
+ *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
+ return dst_pix_fmt;
+}
+
+#ifdef TEST
+
+int main(void){
+ int i;
+ int err=0;
+ int skip = 0;
+
+ for (i=0; i<AV_PIX_FMT_NB*2; i++) {
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i);
+ if(!desc || !desc->name) {
+ skip ++;
+ continue;
+ }
+ if (skip) {
+ av_log(NULL, AV_LOG_INFO, "%3d unused pixel format values\n", skip);
+ skip = 0;
+ }
+ av_log(NULL, AV_LOG_INFO, "pix fmt %s avg_bpp:%d colortype:%d\n", desc->name, av_get_padded_bits_per_pixel(desc), get_color_type(desc));
+ if ((!(desc->flags & AV_PIX_FMT_FLAG_ALPHA)) != (desc->nb_components != 2 && desc->nb_components != 4)) {
+ av_log(NULL, AV_LOG_ERROR, "Alpha flag mismatch\n");
+ err = 1;
+ }
+ }
+ return err;
+}
+
+#endif
diff --git a/chromium/third_party/ffmpeg/libavutil/pixdesc.h b/chromium/third_party/ffmpeg/libavutil/pixdesc.h
index e88bf9b92ac..1d2ead6cb99 100644
--- a/chromium/third_party/ffmpeg/libavutil/pixdesc.h
+++ b/chromium/third_party/ffmpeg/libavutil/pixdesc.h
@@ -255,7 +255,7 @@ enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
* Utility function to access log2_chroma_w log2_chroma_h from
* the pixel format AVPixFmtDescriptor.
*
- * See avcodec_get_chroma_sub_sample() for a function that asserts a
+ * See av_get_chroma_sub_sample() for a function that asserts a
* valid pixel format instead of returning an error code.
* Its recommanded that you use avcodec_get_chroma_sub_sample unless
* you do check the return code!
@@ -287,5 +287,53 @@ void ff_check_pixfmt_descriptors(void);
*/
enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt);
+#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
+#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
+#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */
+#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */
+#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */
+#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
+/**
+ * Compute what kind of losses will occur when converting from one specific
+ * pixel format to another.
+ * When converting from one pixel format to another, information loss may occur.
+ * For example, when converting from RGB24 to GRAY, the color information will
+ * be lost. Similarly, other losses occur when converting from some formats to
+ * other formats. These losses can involve loss of chroma, but also loss of
+ * resolution, loss of color depth, loss due to the color space conversion, loss
+ * of the alpha bits or loss due to color quantization.
+ * av_get_fix_fmt_loss() informs you about the various types of losses
+ * which will occur when converting from one pixel format to another.
+ *
+ * @param[in] dst_pix_fmt destination pixel format
+ * @param[in] src_pix_fmt source pixel format
+ * @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ * @return Combination of flags informing you what kind of losses will occur
+ * (maximum loss for an invalid dst_pix_fmt).
+ */
+int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
+ enum AVPixelFormat src_pix_fmt,
+ int has_alpha);
+
+/**
+ * Compute what kind of losses will occur when converting from one specific
+ * pixel format to another.
+ * When converting from one pixel format to another, information loss may occur.
+ * For example, when converting from RGB24 to GRAY, the color information will
+ * be lost. Similarly, other losses occur when converting from some formats to
+ * other formats. These losses can involve loss of chroma, but also loss of
+ * resolution, loss of color depth, loss due to the color space conversion, loss
+ * of the alpha bits or loss due to color quantization.
+ * av_get_fix_fmt_loss() informs you about the various types of losses
+ * which will occur when converting from one pixel format to another.
+ *
+ * @param[in] dst_pix_fmt destination pixel format
+ * @param[in] src_pix_fmt source pixel format
+ * @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ * @return Combination of flags informing you what kind of losses will occur
+ * (maximum loss for an invalid dst_pix_fmt).
+ */
+enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
+ enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
#endif /* AVUTIL_PIXDESC_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/pixfmt.h b/chromium/third_party/ffmpeg/libavutil/pixfmt.h
index 3d32d3eec97..98987a5cd69 100644
--- a/chromium/third_party/ffmpeg/libavutil/pixfmt.h
+++ b/chromium/third_party/ffmpeg/libavutil/pixfmt.h
@@ -83,6 +83,7 @@ enum AVPixelFormat {
#if FF_API_XVMC
AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
AV_PIX_FMT_XVMC_MPEG2_IDCT,
+#define AV_PIX_FMT_XVMC AV_PIX_FMT_XVMC_MPEG2_IDCT
#endif /* FF_API_XVMC */
AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
@@ -216,6 +217,21 @@ enum AVPixelFormat {
AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+ /**
+ * duplicated pixel formats for compatibility with libav.
+ * FFmpeg supports these formats since Sat Sep 24 06:01:45 2011 +0200 (commits 9569a3c9f41387a8c7d1ce97d8693520477a66c3)
+ * also see Fri Nov 25 01:38:21 2011 +0100 92afb431621c79155fcb7171d26f137eb1bee028
+ * Libav added them Sun Mar 16 23:05:47 2014 +0100 with incompatible values (commit 1481d24c3a0abf81e1d7a514547bd5305232be30)
+ */
+ AV_PIX_FMT_RGBA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+ AV_PIX_FMT_RGBA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+ AV_PIX_FMT_BGRA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+ AV_PIX_FMT_BGRA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+
+ AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
+
+ AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef
+
#ifndef AV_PIX_FMT_ABI_GIT_MASTER
AV_PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
@@ -262,6 +278,9 @@ enum AVPixelFormat {
AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */
AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */
AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */
+#if !FF_API_XVMC
+ AV_PIX_FMT_XVMC,///< XVideo Motion Acceleration via common packet passing
+#endif /* !FF_API_XVMC */
AV_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
@@ -273,6 +292,10 @@ enum AVPixelFormat {
#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
#define AV_PIX_FMT_YUVA422P AV_PIX_FMT_YUVA422P_LIBAV
#define AV_PIX_FMT_YUVA444P AV_PIX_FMT_YUVA444P_LIBAV
+#define AV_PIX_FMT_RGBA64BE AV_PIX_FMT_RGBA64BE_LIBAV
+#define AV_PIX_FMT_RGBA64LE AV_PIX_FMT_RGBA64LE_LIBAV
+#define AV_PIX_FMT_BGRA64BE AV_PIX_FMT_BGRA64BE_LIBAV
+#define AV_PIX_FMT_BGRA64LE AV_PIX_FMT_BGRA64LE_LIBAV
#endif
@@ -297,10 +320,12 @@ enum AVPixelFormat {
#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE)
#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE)
#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE)
+#define AV_PIX_FMT_RGBA64 AV_PIX_FMT_NE(RGBA64BE, RGBA64LE)
#define AV_PIX_FMT_BGR48 AV_PIX_FMT_NE(BGR48BE, BGR48LE)
#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE)
#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE)
#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE)
+#define AV_PIX_FMT_BGRA64 AV_PIX_FMT_NE(BGRA64BE, BGRA64LE)
#define AV_PIX_FMT_YUV420P9 AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
#define AV_PIX_FMT_YUV422P9 AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
@@ -318,8 +343,6 @@ enum AVPixelFormat {
#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
-#define AV_PIX_FMT_RGBA64 AV_PIX_FMT_NE(RGBA64BE, RGBA64LE)
-#define AV_PIX_FMT_BGRA64 AV_PIX_FMT_NE(BGRA64BE, BGRA64LE)
#define AV_PIX_FMT_GBRP9 AV_PIX_FMT_NE(GBRP9BE , GBRP9LE)
#define AV_PIX_FMT_GBRP10 AV_PIX_FMT_NE(GBRP10BE, GBRP10LE)
#define AV_PIX_FMT_GBRP12 AV_PIX_FMT_NE(GBRP12BE, GBRP12LE)
@@ -346,6 +369,7 @@ enum AVPixelFormat {
#define AV_PIX_FMT_XYZ12 AV_PIX_FMT_NE(XYZ12BE, XYZ12LE)
#define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE)
+
#if FF_API_PIX_FMT
#define PixelFormat AVPixelFormat
diff --git a/chromium/third_party/ffmpeg/libavutil/random_seed.c b/chromium/third_party/ffmpeg/libavutil/random_seed.c
index aa8902472ea..e3ffaff014e 100644
--- a/chromium/third_party/ffmpeg/libavutil/random_seed.c
+++ b/chromium/third_party/ffmpeg/libavutil/random_seed.c
@@ -33,10 +33,10 @@
#include <string.h>
#include "avassert.h"
#include "internal.h"
+#include "intreadwrite.h"
#include "timer.h"
#include "random_seed.h"
#include "sha.h"
-#include "intreadwrite.h"
#ifndef TEST
#define TEST 0
@@ -65,7 +65,7 @@ static uint32_t get_generic_seed(void)
struct AVSHA *sha = (void*)tmp;
clock_t last_t = 0;
static uint64_t i = 0;
- static uint32_t buffer[512] = {0};
+ static uint32_t buffer[512] = { 0 };
unsigned char digest[20];
uint64_t last_i = i;
@@ -84,11 +84,11 @@ static uint32_t get_generic_seed(void)
for (;;) {
clock_t t = clock();
- if(last_t == t){
- buffer[i&511]++;
- }else{
- buffer[++i&511]+= (t-last_t) % 3294638521U;
- if(last_i && i-last_i > 4 || i-last_i > 64 || TEST && i-last_i > 8)
+ if (last_t == t) {
+ buffer[i & 511]++;
+ } else {
+ buffer[++i & 511] += (t - last_t) % 3294638521U;
+ if (last_i && i - last_i > 4 || i - last_i > 64 || TEST && i - last_i > 8)
break;
}
last_t = t;
@@ -98,9 +98,9 @@ static uint32_t get_generic_seed(void)
buffer[0] = buffer[1] = 0;
av_sha_init(sha, 160);
- av_sha_update(sha, (uint8_t*)buffer, sizeof(buffer));
+ av_sha_update(sha, (const uint8_t *)buffer, sizeof(buffer));
av_sha_final(sha, digest);
- return AV_RB32(digest) + AV_RB32(digest+16);
+ return AV_RB32(digest) + AV_RB32(digest + 16);
}
uint32_t av_get_random_seed(void)
diff --git a/chromium/third_party/ffmpeg/libavutil/rational.c b/chromium/third_party/ffmpeg/libavutil/rational.c
index ec2f2e53866..55a8dd58972 100644
--- a/chromium/third_party/ffmpeg/libavutil/rational.c
+++ b/chromium/third_party/ffmpeg/libavutil/rational.c
@@ -171,6 +171,36 @@ int main(void)
}
}
}
+
+ for (a.num = 1; a.num <= 10; a.num++) {
+ for (a.den = 1; a.den <= 10; a.den++) {
+ if (av_gcd(a.num, a.den) > 1)
+ continue;
+ for (b.num = 1; b.num <= 10; b.num++) {
+ for (b.den = 1; b.den <= 10; b.den++) {
+ int start;
+ if (av_gcd(b.num, b.den) > 1)
+ continue;
+ if (av_cmp_q(b, a) < 0)
+ continue;
+ for (start = 0; start < 10 ; start++) {
+ int acc= start;
+ int i;
+
+ for (i = 0; i<100; i++) {
+ int exact = start + av_rescale_q(i+1, b, a);
+ acc = av_add_stable(a, acc, b, 1);
+ if (FFABS(acc - exact) > 2) {
+ av_log(NULL, AV_LOG_ERROR, "%d/%d %d/%d, %d %d\n", a.num,
+ a.den, b.num, b.den, acc, exact);
+ return 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
return 0;
}
#endif
diff --git a/chromium/third_party/ffmpeg/libavutil/rational.h b/chromium/third_party/ffmpeg/libavutil/rational.h
index b9800ee3600..7439701db23 100644
--- a/chromium/third_party/ffmpeg/libavutil/rational.h
+++ b/chromium/third_party/ffmpeg/libavutil/rational.h
@@ -46,6 +46,17 @@ typedef struct AVRational{
} AVRational;
/**
+ * Create a rational.
+ * Useful for compilers that do not support compound literals.
+ * @note The return value is not reduced.
+ */
+static inline AVRational av_make_q(int num, int den)
+{
+ AVRational r = { num, den };
+ return r;
+}
+
+/**
* Compare two rationals.
* @param a first rational
* @param b second rational
diff --git a/chromium/third_party/ffmpeg/libavutil/replaygain.h b/chromium/third_party/ffmpeg/libavutil/replaygain.h
new file mode 100644
index 00000000000..5c03e1993d8
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/replaygain.h
@@ -0,0 +1,51 @@
+/*
+ *
+ * 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 AVUTIL_REPLAYGAIN_H
+#define AVUTIL_REPLAYGAIN_H
+
+#include <stdint.h>
+
+/**
+ * ReplayGain information (see
+ * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification).
+ * The size of this struct is a part of the public ABI.
+ */
+typedef struct AVReplayGain {
+ /**
+ * Track replay gain in microbels (divide by 100000 to get the value in dB).
+ * Should be set to INT32_MIN when unknown.
+ */
+ int32_t track_gain;
+ /**
+ * Peak track amplitude, with 100000 representing full scale (but values
+ * may overflow). 0 when unknown.
+ */
+ uint32_t track_peak;
+ /**
+ * Same as track_gain, but for the whole album.
+ */
+ int32_t album_gain;
+ /**
+ * Same as track_peak, but for the whole album,
+ */
+ uint32_t album_peak;
+} AVReplayGain;
+
+#endif /* AVUTIL_REPLAYGAIN_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/samplefmt.c b/chromium/third_party/ffmpeg/libavutil/samplefmt.c
index 08ecc834678..a1986980f05 100644
--- a/chromium/third_party/ffmpeg/libavutil/samplefmt.c
+++ b/chromium/third_party/ffmpeg/libavutil/samplefmt.c
@@ -135,6 +135,8 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
/* auto-select alignment if not specified */
if (!align) {
+ if (nb_samples > INT_MAX - 31)
+ return AVERROR(EINVAL);
align = 1;
nb_samples = FFALIGN(nb_samples, 32);
}
diff --git a/chromium/third_party/ffmpeg/libavutil/stereo3d.h b/chromium/third_party/ffmpeg/libavutil/stereo3d.h
index b384ad49afb..8829da9ff44 100644
--- a/chromium/third_party/ffmpeg/libavutil/stereo3d.h
+++ b/chromium/third_party/ffmpeg/libavutil/stereo3d.h
@@ -140,7 +140,7 @@ AVStereo3D *av_stereo3d_alloc(void);
/**
* Allocate a complete AVFrameSideData and add it to the frame.
*
- * @param The frame on which the side data is added to.
+ * @param frame The frame which side data is added to.
*
* @return The AVStereo3D structure to be filled by caller.
*/
diff --git a/chromium/third_party/ffmpeg/libavutil/timer.h b/chromium/third_party/ffmpeg/libavutil/timer.h
index 3e242f3463c..3fff77ff1c6 100644
--- a/chromium/third_party/ffmpeg/libavutil/timer.h
+++ b/chromium/third_party/ffmpeg/libavutil/timer.h
@@ -32,6 +32,12 @@
#include "config.h"
+#if HAVE_MACH_MACH_TIME_H
+#include <mach/mach_time.h>
+#endif
+
+#include "log.h"
+
#if ARCH_ARM
# include "arm/timer.h"
#elif ARCH_BFIN
@@ -42,8 +48,16 @@
# include "x86/timer.h"
#endif
-#if !defined(AV_READ_TIME) && HAVE_GETHRTIME
-# define AV_READ_TIME gethrtime
+#if !defined(AV_READ_TIME)
+# if HAVE_GETHRTIME
+# define AV_READ_TIME gethrtime
+# elif HAVE_MACH_ABSOLUTE_TIME
+# define AV_READ_TIME mach_absolute_time
+# endif
+#endif
+
+#ifndef FF_TIMER_UNITS
+# define FF_TIMER_UNITS "UNITS"
#endif
#ifdef AV_READ_TIME
@@ -66,7 +80,7 @@
tskip_count++; \
if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \
av_log(NULL, AV_LOG_ERROR, \
- "%"PRIu64" decicycles in %s, %d runs, %d skips\n", \
+ "%"PRIu64" " FF_TIMER_UNITS " in %s, %d runs, %d skips\n", \
tsum * 10 / tcount, id, tcount, tskip_count); \
} \
}
diff --git a/chromium/third_party/ffmpeg/libavutil/timestamp.h b/chromium/third_party/ffmpeg/libavutil/timestamp.h
index f63a08c579c..f010a7ee38f 100644
--- a/chromium/third_party/ffmpeg/libavutil/timestamp.h
+++ b/chromium/third_party/ffmpeg/libavutil/timestamp.h
@@ -26,6 +26,10 @@
#include "common.h"
+#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64)
+#error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS
+#endif
+
#define AV_TS_MAX_STRING_SIZE 32
/**
diff --git a/chromium/third_party/ffmpeg/libavutil/utils.c b/chromium/third_party/ffmpeg/libavutil/utils.c
index 4c82503d9c6..6c9b493a8f9 100644
--- a/chromium/third_party/ffmpeg/libavutil/utils.c
+++ b/chromium/third_party/ffmpeg/libavutil/utils.c
@@ -113,3 +113,8 @@ unsigned av_int_list_length_for_size(unsigned elsize,
}
return i;
}
+
+AVRational av_get_time_base_q(void)
+{
+ return (AVRational){1, AV_TIME_BASE};
+}
diff --git a/chromium/third_party/ffmpeg/libavutil/version.h b/chromium/third_party/ffmpeg/libavutil/version.h
index 4eff48cb230..71407053192 100644
--- a/chromium/third_party/ffmpeg/libavutil/version.h
+++ b/chromium/third_party/ffmpeg/libavutil/version.h
@@ -21,25 +21,7 @@
#ifndef AVUTIL_VERSION_H
#define AVUTIL_VERSION_H
-/**
- * @defgroup preproc_misc Preprocessor String Macros
- *
- * String manipulation macros
- *
- * @{
- */
-
-#define AV_STRINGIFY(s) AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define AV_GLUE(a, b) a ## b
-#define AV_JOIN(a, b) AV_GLUE(a, b)
-
-#define AV_PRAGMA(s) _Pragma(#s)
-
-/**
- * @}
- */
+#include "macros.h"
/**
* @defgroup version_utils Library Version Macros
@@ -58,7 +40,6 @@
* @}
*/
-
/**
* @file
* @ingroup lavu
@@ -75,7 +56,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
-#define LIBAVUTIL_VERSION_MINOR 58
+#define LIBAVUTIL_VERSION_MINOR 83
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@@ -100,57 +81,69 @@
*/
#ifndef FF_API_GET_BITS_PER_SAMPLE_FMT
-#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_FIND_OPT
-#define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_OLD_AVOPTIONS
-#define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_PIX_FMT
-#define FF_API_PIX_FMT (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_PIX_FMT (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_CONTEXT_SIZE
-#define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_PIX_FMT_DESC
+#define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
-// TODO(dalecurtis): Remove when libavutil > 52. We don't care about this API,
-// but without this it'll generate spammy deprecation warnings.
-// #ifndef FF_API_PIX_FMT_DESC
-// #define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 53)
-// #endif
#ifndef FF_API_AV_REVERSE
-#define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_AUDIOCONVERT
-#define FF_API_AUDIOCONVERT (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_AUDIOCONVERT (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_CPU_FLAG_MMX2
-#define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO
-#define FF_API_SAMPLES_UTILS_RETURN_ZERO (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_SAMPLES_UTILS_RETURN_ZERO (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_LLS_PRIVATE
-#define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_LLS1
-#define FF_API_LLS1 (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_LLS1 (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_AVFRAME_LAVC
-#define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_VDPAU
-#define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT
-#define FF_API_GET_CHANNEL_LAYOUT_COMPAT (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_GET_CHANNEL_LAYOUT_COMPAT (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_OLD_OPENCL
-#define FF_API_OLD_OPENCL (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_OLD_OPENCL (LIBAVUTIL_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_XVMC
-#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 53)
+#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_INTFLOAT
+#define FF_API_INTFLOAT (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_OPT_TYPE_METADATA
+#define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+
+#ifndef FF_CONST_AVUTIL53
+#if LIBAVUTIL_VERSION_MAJOR >= 53
+#define FF_CONST_AVUTIL53 const
+#else
+#define FF_CONST_AVUTIL53
+#endif
#endif
/**
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/asm.h b/chromium/third_party/ffmpeg/libavutil/x86/asm.h
index 70ccac78852..2cecc980a5b 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/asm.h
+++ b/chromium/third_party/ffmpeg/libavutil/x86/asm.h
@@ -107,6 +107,46 @@ typedef int x86_reg;
# define LOCAL_MANGLE(a) #a
#endif
-#define MANGLE(a) EXTERN_PREFIX LOCAL_MANGLE(a)
+#if HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS
+# define MANGLE(a) EXTERN_PREFIX LOCAL_MANGLE(a)
+# define NAMED_CONSTRAINTS_ADD(...)
+# define NAMED_CONSTRAINTS(...)
+# define NAMED_CONSTRAINTS_ARRAY_ADD(...)
+# define NAMED_CONSTRAINTS_ARRAY(...)
+#else
+ /* When direct symbol references are used in code passed to a compiler that does not support them
+ * then these references need to be converted to named asm constraints instead.
+ * Instead of returning a direct symbol MANGLE now returns a named constraint for that specific symbol.
+ * In order for this to work there must also be a corresponding entry in the asm-interface. To add this
+ * entry use the macro NAMED_CONSTRAINTS() and pass in a list of each symbol reference used in the
+ * corresponding block of code. (e.g. NAMED_CONSTRAINTS(var1,var2,var3) where var1 is the first symbol etc. ).
+ * If there are already existing constraints then use NAMED_CONSTRAINTS_ADD to add to the existing constraint list.
+ */
+# define MANGLE(a) "%["#a"]"
+ // Intel/MSVC does not correctly expand va-args so we need a rather ugly hack in order to get it to work
+# define FE_0(P,X) P(X)
+# define FE_1(P,X,X1) P(X), FE_0(P,X1)
+# define FE_2(P,X,X1,X2) P(X), FE_1(P,X1,X2)
+# define FE_3(P,X,X1,X2,X3) P(X), FE_2(P,X1,X2,X3)
+# define FE_4(P,X,X1,X2,X3,X4) P(X), FE_3(P,X1,X2,X3,X4)
+# define FE_5(P,X,X1,X2,X3,X4,X5) P(X), FE_4(P,X1,X2,X3,X4,X5)
+# define FE_6(P,X,X1,X2,X3,X4,X5,X6) P(X), FE_5(P,X1,X2,X3,X4,X5,X6)
+# define FE_7(P,X,X1,X2,X3,X4,X5,X6,X7) P(X), FE_6(P,X1,X2,X3,X4,X5,X6,X7)
+# define FE_8(P,X,X1,X2,X3,X4,X5,X6,X7,X8) P(X), FE_7(P,X1,X2,X3,X4,X5,X6,X7,X8)
+# define FE_9(P,X,X1,X2,X3,X4,X5,X6,X7,X8,X9) P(X), FE_8(P,X1,X2,X3,X4,X5,X6,X7,X8,X9)
+# define GET_FE_IMPL(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME
+# define GET_FE(A) GET_FE_IMPL A
+# define GET_FE_GLUE(x, y) x y
+# define FOR_EACH_VA(P,...) GET_FE_GLUE(GET_FE((__VA_ARGS__,FE_9,FE_8,FE_7,FE_6,FE_5,FE_4,FE_3,FE_2,FE_1,FE_0)), (P,__VA_ARGS__))
+# define NAME_CONSTRAINT(x) [x] "m"(x)
+ // Parameters are a list of each symbol reference required
+# define NAMED_CONSTRAINTS_ADD(...) , FOR_EACH_VA(NAME_CONSTRAINT,__VA_ARGS__)
+ // Same but without comma for when there are no previously defined constraints
+# define NAMED_CONSTRAINTS(...) FOR_EACH_VA(NAME_CONSTRAINT,__VA_ARGS__)
+ // Same as above NAMED_CONSTRAINTS except used for passing arrays/pointers instead of normal variables
+# define NAME_CONSTRAINT_ARRAY(x) [x] "m"(*x)
+# define NAMED_CONSTRAINTS_ARRAY_ADD(...) , FOR_EACH_VA(NAME_CONSTRAINT_ARRAY,__VA_ARGS__)
+# define NAMED_CONSTRAINTS_ARRAY(...) FOR_EACH_VA(NAME_CONSTRAINT_ARRAY,__VA_ARGS__)
+#endif
#endif /* AVUTIL_X86_ASM_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/cpu.c b/chromium/third_party/ffmpeg/libavutil/x86/cpu.c
index 18049eaead4..8ad478400c8 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/cpu.c
+++ b/chromium/third_party/ffmpeg/libavutil/x86/cpu.c
@@ -131,19 +131,27 @@ int ff_get_cpu_flags_x86(void)
if ((ecx & 0x18000000) == 0x18000000) {
/* Check for OS support */
xgetbv(0, eax, edx);
- if ((eax & 0x6) == 0x6)
+ if ((eax & 0x6) == 0x6) {
rval |= AV_CPU_FLAG_AVX;
+ if (ecx & 0x00001000)
+ rval |= AV_CPU_FLAG_FMA3;
+ }
}
-#if HAVE_AVX2
+#endif /* HAVE_AVX */
+#endif /* HAVE_SSE */
+ }
if (max_std_level >= 7) {
cpuid(7, eax, ebx, ecx, edx);
- if (ebx&0x00000020)
+#if HAVE_AVX2
+ if ((rval & AV_CPU_FLAG_AVX) && (ebx & 0x00000020))
rval |= AV_CPU_FLAG_AVX2;
- /* TODO: BMI1/2 */
- }
#endif /* HAVE_AVX2 */
-#endif /* HAVE_AVX */
-#endif /* HAVE_SSE */
+ /* BMI1/2 don't need OS support */
+ if (ebx & 0x00000008) {
+ rval |= AV_CPU_FLAG_BMI1;
+ if (ebx & 0x00000100)
+ rval |= AV_CPU_FLAG_BMI2;
+ }
}
cpuid(0x80000000, max_ext_level, ebx, ecx, edx);
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/cpu.h b/chromium/third_party/ffmpeg/libavutil/x86/cpu.h
index 3724357e74a..bc64b1b3bd9 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/cpu.h
+++ b/chromium/third_party/ffmpeg/libavutil/x86/cpu.h
@@ -37,6 +37,8 @@
#define X86_SSE4(flags) CPUEXT(flags, SSE4)
#define X86_SSE42(flags) CPUEXT(flags, SSE42)
#define X86_AVX(flags) CPUEXT(flags, AVX)
+#define X86_XOP(flags) CPUEXT(flags, XOP)
+#define X86_FMA3(flags) CPUEXT(flags, FMA3)
#define X86_FMA4(flags) CPUEXT(flags, FMA4)
#define X86_AVX2(flags) CPUEXT(flags, AVX2)
@@ -51,6 +53,8 @@
#define EXTERNAL_SSE4(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, SSE4)
#define EXTERNAL_SSE42(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, SSE42)
#define EXTERNAL_AVX(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, AVX)
+#define EXTERNAL_XOP(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, XOP)
+#define EXTERNAL_FMA3(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, FMA3)
#define EXTERNAL_FMA4(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, FMA4)
#define EXTERNAL_AVX2(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, AVX2)
@@ -65,6 +69,8 @@
#define INLINE_SSE4(flags) CPUEXT_SUFFIX(flags, _INLINE, SSE4)
#define INLINE_SSE42(flags) CPUEXT_SUFFIX(flags, _INLINE, SSE42)
#define INLINE_AVX(flags) CPUEXT_SUFFIX(flags, _INLINE, AVX)
+#define INLINE_XOP(flags) CPUEXT_SUFFIX(flags, _INLINE, XOP)
+#define INLINE_FMA3(flags) CPUEXT_SUFFIX(flags, _INLINE, FMA3)
#define INLINE_FMA4(flags) CPUEXT_SUFFIX(flags, _INLINE, FMA4)
#define INLINE_AVX2(flags) CPUEXT_SUFFIX(flags, _INLINE, AVX2)
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/float_dsp.asm b/chromium/third_party/ffmpeg/libavutil/x86/float_dsp.asm
index 49d4876447a..a5fcffb30b7 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/float_dsp.asm
+++ b/chromium/third_party/ffmpeg/libavutil/x86/float_dsp.asm
@@ -29,17 +29,21 @@ SECTION .text
;-----------------------------------------------------------------------------
%macro VECTOR_FMUL 0
cglobal vector_fmul, 4,4,2, dst, src0, src1, len
- lea lenq, [lend*4 - 2*mmsize]
+ lea lenq, [lend*4 - 64]
ALIGN 16
.loop:
- mova m0, [src0q + lenq]
- mova m1, [src0q + lenq + mmsize]
- mulps m0, m0, [src1q + lenq]
- mulps m1, m1, [src1q + lenq + mmsize]
- mova [dstq + lenq], m0
- mova [dstq + lenq + mmsize], m1
+%assign a 0
+%rep 32/mmsize
+ mova m0, [src0q + lenq + (a+0)*mmsize]
+ mova m1, [src0q + lenq + (a+1)*mmsize]
+ mulps m0, m0, [src1q + lenq + (a+0)*mmsize]
+ mulps m1, m1, [src1q + lenq + (a+1)*mmsize]
+ mova [dstq + lenq + (a+0)*mmsize], m0
+ mova [dstq + lenq + (a+1)*mmsize], m1
+%assign a a+2
+%endrep
- sub lenq, 2*mmsize
+ sub lenq, 64
jge .loop
REP_RET
%endmacro
@@ -57,30 +61,49 @@ VECTOR_FMUL
%macro VECTOR_FMAC_SCALAR 0
%if UNIX64
-cglobal vector_fmac_scalar, 3,3,3, dst, src, len
+cglobal vector_fmac_scalar, 3,3,5, dst, src, len
%else
-cglobal vector_fmac_scalar, 4,4,3, dst, src, mul, len
+cglobal vector_fmac_scalar, 4,4,5, dst, src, mul, len
%endif
%if ARCH_X86_32
VBROADCASTSS m0, mulm
%else
%if WIN64
- mova xmm0, xmm2
+ SWAP 0, 2
%endif
- shufps xmm0, xmm0, 0
+ shufps xm0, xm0, 0
%if cpuflag(avx)
- vinsertf128 m0, m0, xmm0, 1
+ vinsertf128 m0, m0, xm0, 1
%endif
%endif
- lea lenq, [lend*4-2*mmsize]
+ lea lenq, [lend*4-64]
.loop:
- mulps m1, m0, [srcq+lenq ]
- mulps m2, m0, [srcq+lenq+mmsize]
- addps m1, m1, [dstq+lenq ]
- addps m2, m2, [dstq+lenq+mmsize]
- mova [dstq+lenq ], m1
- mova [dstq+lenq+mmsize], m2
- sub lenq, 2*mmsize
+%if cpuflag(fma3)
+ mova m1, [dstq+lenq]
+ mova m2, [dstq+lenq+1*mmsize]
+ fmaddps m1, m0, [srcq+lenq], m1
+ fmaddps m2, m0, [srcq+lenq+1*mmsize], m2
+%else ; cpuflag
+ mulps m1, m0, [srcq+lenq]
+ mulps m2, m0, [srcq+lenq+1*mmsize]
+%if mmsize < 32
+ mulps m3, m0, [srcq+lenq+2*mmsize]
+ mulps m4, m0, [srcq+lenq+3*mmsize]
+%endif ; mmsize
+ addps m1, m1, [dstq+lenq]
+ addps m2, m2, [dstq+lenq+1*mmsize]
+%if mmsize < 32
+ addps m3, m3, [dstq+lenq+2*mmsize]
+ addps m4, m4, [dstq+lenq+3*mmsize]
+%endif ; mmsize
+%endif ; cpuflag
+ mova [dstq+lenq], m1
+ mova [dstq+lenq+1*mmsize], m2
+%if mmsize < 32
+ mova [dstq+lenq+2*mmsize], m3
+ mova [dstq+lenq+3*mmsize], m4
+%endif ; mmsize
+ sub lenq, 64
jge .loop
REP_RET
%endmacro
@@ -91,6 +114,10 @@ VECTOR_FMAC_SCALAR
INIT_YMM avx
VECTOR_FMAC_SCALAR
%endif
+%if HAVE_FMA3_EXTERNAL
+INIT_YMM fma3
+VECTOR_FMAC_SCALAR
+%endif
;------------------------------------------------------------------------------
; void ff_vector_fmul_scalar(float *dst, const float *src, float mul, int len)
@@ -139,16 +166,11 @@ cglobal vector_dmul_scalar, 4,4,3, dst, src, mul, len
VBROADCASTSD m0, mulm
%else
%if WIN64
- movlhps xmm2, xmm2
-%if cpuflag(avx)
- vinsertf128 ymm2, ymm2, xmm2, 1
-%endif
SWAP 0, 2
-%else
- movlhps xmm0, xmm0
-%if cpuflag(avx)
- vinsertf128 ymm0, ymm0, xmm0, 1
%endif
+ movlhps xm0, xm0
+%if cpuflag(avx)
+ vinsertf128 ym0, ym0, xm0, 1
%endif
%endif
lea lenq, [lend*8-2*mmsize]
@@ -174,16 +196,23 @@ VECTOR_DMUL_SCALAR
; const float *src2, int len)
;-----------------------------------------------------------------------------
%macro VECTOR_FMUL_ADD 0
-cglobal vector_fmul_add, 5,5,2, dst, src0, src1, src2, len
+cglobal vector_fmul_add, 5,5,4, dst, src0, src1, src2, len
lea lenq, [lend*4 - 2*mmsize]
ALIGN 16
.loop:
mova m0, [src0q + lenq]
mova m1, [src0q + lenq + mmsize]
+%if cpuflag(fma3)
+ mova m2, [src2q + lenq]
+ mova m3, [src2q + lenq + mmsize]
+ fmaddps m0, m0, [src1q + lenq], m2
+ fmaddps m1, m1, [src1q + lenq + mmsize], m3
+%else
mulps m0, m0, [src1q + lenq]
mulps m1, m1, [src1q + lenq + mmsize]
addps m0, m0, [src2q + lenq]
addps m1, m1, [src2q + lenq + mmsize]
+%endif
mova [dstq + lenq], m0
mova [dstq + lenq + mmsize], m1
@@ -198,6 +227,10 @@ VECTOR_FMUL_ADD
INIT_YMM avx
VECTOR_FMUL_ADD
%endif
+%if HAVE_FMA3_EXTERNAL
+INIT_YMM fma3
+VECTOR_FMUL_ADD
+%endif
;-----------------------------------------------------------------------------
; void vector_fmul_reverse(float *dst, const float *src0, const float *src1,
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/float_dsp_init.c b/chromium/third_party/ffmpeg/libavutil/x86/float_dsp_init.c
index 97f7b7c7cae..88ffbc11b5e 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/float_dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavutil/x86/float_dsp_init.c
@@ -33,6 +33,8 @@ void ff_vector_fmac_scalar_sse(float *dst, const float *src, float mul,
int len);
void ff_vector_fmac_scalar_avx(float *dst, const float *src, float mul,
int len);
+void ff_vector_fmac_scalar_fma3(float *dst, const float *src, float mul,
+ int len);
void ff_vector_fmul_scalar_sse(float *dst, const float *src, float mul,
int len);
@@ -46,6 +48,8 @@ void ff_vector_fmul_add_sse(float *dst, const float *src0, const float *src1,
const float *src2, int len);
void ff_vector_fmul_add_avx(float *dst, const float *src0, const float *src1,
const float *src2, int len);
+void ff_vector_fmul_add_fma3(float *dst, const float *src0, const float *src1,
+ const float *src2, int len);
void ff_vector_fmul_reverse_sse(float *dst, const float *src0,
const float *src1, int len);
@@ -153,4 +157,8 @@ av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
fdsp->vector_fmul_add = ff_vector_fmul_add_avx;
fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_avx;
}
+ if (EXTERNAL_FMA3(cpu_flags)) {
+ fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_fma3;
+ fdsp->vector_fmul_add = ff_vector_fmul_add_fma3;
+ }
}
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/timer.h b/chromium/third_party/ffmpeg/libavutil/x86/timer.h
index d812d46aed3..5b24b511c1f 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/timer.h
+++ b/chromium/third_party/ffmpeg/libavutil/x86/timer.h
@@ -25,6 +25,7 @@
#if HAVE_INLINE_ASM
+#define FF_TIMER_UNITS "decicycles"
#define AV_READ_TIME read_time
static inline uint64_t read_time(void)
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/x86inc.asm b/chromium/third_party/ffmpeg/libavutil/x86/x86inc.asm
index 420e293f689..a7f9f543670 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/x86inc.asm
+++ b/chromium/third_party/ffmpeg/libavutil/x86/x86inc.asm
@@ -1058,25 +1058,25 @@ INIT_XMM
;%5+: operands
%macro RUN_AVX_INSTR 5-8+
%ifnum sizeof%6
- %assign %%sizeofreg sizeof%6
+ %assign __sizeofreg sizeof%6
%elifnum sizeof%5
- %assign %%sizeofreg sizeof%5
+ %assign __sizeofreg sizeof%5
%else
- %assign %%sizeofreg mmsize
+ %assign __sizeofreg mmsize
%endif
- %assign %%emulate_avx 0
- %if avx_enabled && %%sizeofreg >= 16
- %xdefine %%instr v%1
+ %assign __emulate_avx 0
+ %if avx_enabled && __sizeofreg >= 16
+ %xdefine __instr v%1
%else
- %xdefine %%instr %1
+ %xdefine __instr %1
%if %0 >= 7+%3
- %assign %%emulate_avx 1
+ %assign __emulate_avx 1
%endif
%endif
- %if %%emulate_avx
- %xdefine %%src1 %6
- %xdefine %%src2 %7
+ %if __emulate_avx
+ %xdefine __src1 %6
+ %xdefine __src2 %7
%ifnidn %5, %6
%if %0 >= 8
CHECK_AVX_INSTR_EMU {%1 %5, %6, %7, %8}, %5, %7, %8
@@ -1088,31 +1088,31 @@ INIT_XMM
; 3-operand AVX instructions with a memory arg can only have it in src2,
; whereas SSE emulation prefers to have it in src1 (i.e. the mov).
; So, if the instruction is commutative with a memory arg, swap them.
- %xdefine %%src1 %7
- %xdefine %%src2 %6
+ %xdefine __src1 %7
+ %xdefine __src2 %6
%endif
%endif
- %if %%sizeofreg == 8
- MOVQ %5, %%src1
+ %if __sizeofreg == 8
+ MOVQ %5, __src1
%elif %2
- MOVAPS %5, %%src1
+ MOVAPS %5, __src1
%else
- MOVDQA %5, %%src1
+ MOVDQA %5, __src1
%endif
%endif
%if %0 >= 8
- %1 %5, %%src2, %8
+ %1 %5, __src2, %8
%else
- %1 %5, %%src2
+ %1 %5, __src2
%endif
%elif %0 >= 8
- %%instr %5, %6, %7, %8
+ __instr %5, %6, %7, %8
%elif %0 == 7
- %%instr %5, %6, %7
+ __instr %5, %6, %7
%elif %0 == 6
- %%instr %5, %6
+ __instr %5, %6
%else
- %%instr %5
+ __instr %5
%endif
%endmacro
@@ -1407,21 +1407,6 @@ AVX_INSTR pfmul, 1, 0, 1
%undef i
%undef j
-%macro FMA_INSTR 3
- %macro %1 4-7 %1, %2, %3
- %if cpuflag(xop)
- v%5 %1, %2, %3, %4
- %else
- %6 %1, %2, %3
- %7 %1, %4
- %endif
- %endmacro
-%endmacro
-
-FMA_INSTR pmacsdd, pmulld, paddd
-FMA_INSTR pmacsww, pmullw, paddw
-FMA_INSTR pmadcswd, pmaddwd, paddd
-
; tzcnt is equivalent to "rep bsf" and is backwards-compatible with bsf.
; This lets us use tzcnt without bumping the yasm version requirement yet.
%define tzcnt rep bsf
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/x86util.asm b/chromium/third_party/ffmpeg/libavutil/x86/x86util.asm
index 59e5df248e5..67d79051328 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/x86util.asm
+++ b/chromium/third_party/ffmpeg/libavutil/x86/x86util.asm
@@ -273,6 +273,39 @@
%endif
%endmacro
+%macro HADDD 2 ; sum junk
+%if sizeof%1 == 32
+%define %2 xmm%2
+ vextracti128 %2, %1, 1
+%define %1 xmm%1
+ paddd %1, %2
+%endif
+%if mmsize >= 16
+%if cpuflag(xop) && sizeof%1 == 16
+ vphadddq %1, %1
+%endif
+ movhlps %2, %1
+ paddd %1, %2
+%endif
+%if notcpuflag(xop) || sizeof%1 != 16
+ PSHUFLW %2, %1, q0032
+ paddd %1, %2
+%endif
+%undef %1
+%undef %2
+%endmacro
+
+%macro HADDW 2 ; reg, tmp
+%if cpuflag(xop) && sizeof%1 == 16
+ vphaddwq %1, %1
+ movhlps %2, %1
+ paddd %1, %2
+%else
+ pmaddwd %1, [pw_1]
+ HADDD %1, %2
+%endif
+%endmacro
+
%macro PALIGNR 4-5
%if cpuflag(ssse3)
%if %0==5
@@ -666,6 +699,25 @@
%endif
%endmacro
+%macro PMA_EMU 4
+ %macro %1 5-8 %2, %3, %4
+ %if cpuflag(xop)
+ v%6 %1, %2, %3, %4
+ %elifidn %1, %4
+ %7 %5, %2, %3
+ %8 %1, %4, %5
+ %else
+ %7 %1, %2, %3
+ %8 %1, %4
+ %endif
+ %endmacro
+%endmacro
+
+PMA_EMU PMACSWW, pmacsww, pmullw, paddw
+PMA_EMU PMACSDD, pmacsdd, pmulld, paddd ; sse4 emulation
+PMA_EMU PMACSDQL, pmacsdql, pmuldq, paddq ; sse4 emulation
+PMA_EMU PMADCSWD, pmadcswd, pmaddwd, paddd
+
; Wrapper for non-FMA version of fmaddps
%macro FMULADD_PS 5
%if cpuflag(fma3) || cpuflag(fma4)
diff --git a/chromium/third_party/ffmpeg/libpostproc/postprocess.c b/chromium/third_party/ffmpeg/libpostproc/postprocess.c
index b34943f983c..da586ffd31c 100644
--- a/chromium/third_party/ffmpeg/libpostproc/postprocess.c
+++ b/chromium/third_party/ffmpeg/libpostproc/postprocess.c
@@ -719,6 +719,10 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality)
if(filterToken == NULL) break;
p+= strlen(filterToken) + 1; // p points to next filterToken
filterName= strtok(filterToken, optionDelimiters);
+ if (filterName == NULL) {
+ ppMode->error++;
+ break;
+ }
av_log(NULL, AV_LOG_DEBUG, "pp: %s::%s\n", filterToken, filterName);
if(*filterName == '-'){
diff --git a/chromium/third_party/ffmpeg/libpostproc/postprocess_template.c b/chromium/third_party/ffmpeg/libpostproc/postprocess_template.c
index 74b0ab4c460..0761c5027a6 100644
--- a/chromium/third_party/ffmpeg/libpostproc/postprocess_template.c
+++ b/chromium/third_party/ffmpeg/libpostproc/postprocess_template.c
@@ -490,6 +490,7 @@ static inline void RENAME(vertX1Filter)(uint8_t *src, int stride, PPContext *co)
:
: "r" (src), "r" ((x86_reg)stride), "m" (co->pQPb)
+ NAMED_CONSTRAINTS_ADD(b01)
: "%"REG_a, "%"REG_c
);
#else //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW
@@ -755,6 +756,7 @@ static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext
:
: "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb)
+ NAMED_CONSTRAINTS_ADD(b80,b00,b01)
: "%"REG_a, "%"REG_c
);
@@ -1042,6 +1044,7 @@ static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext
: "+r" (src)
: "r" ((x86_reg)stride), "m" (c->pQPb), "r"(tmp)
+ NAMED_CONSTRAINTS_ADD(w05,w20)
: "%"REG_a
);
#else //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW
@@ -1313,6 +1316,7 @@ DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,
"1: \n\t"
: : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(c->pQPb2), "q"(tmp)
+ NAMED_CONSTRAINTS_ADD(deringThreshold,b00,b02,b08)
: "%"REG_a, "%"REG_d, "%"REG_SP
);
#else // HAVE_7REGS && (TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW)
@@ -1664,7 +1668,7 @@ DEINT_FF((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4))
*/
static inline void RENAME(deInterlaceL5)(uint8_t src[], int stride, uint8_t *tmp, uint8_t *tmp2)
{
-#if TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW
+#if (TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS
src+= stride*4;
__asm__ volatile(
"lea (%0, %1), %%"REG_a" \n\t"
@@ -1724,7 +1728,7 @@ DEINT_L5(%%mm1, %%mm0, (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4))
: : "r" (src), "r" ((x86_reg)stride), "r"(tmp), "r"(tmp2)
: "%"REG_a, "%"REG_d
);
-#else //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW
+#else //(TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS
int x;
src+= stride*4;
for(x=0; x<8; x++){
@@ -1753,7 +1757,7 @@ DEINT_L5(%%mm1, %%mm0, (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4))
src++;
}
-#endif //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW
+#endif //(TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS
}
/**
@@ -2160,7 +2164,7 @@ static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
#define FAST_L2_DIFF
//#define L1_DIFF //u should change the thresholds too if u try that one
-#if TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW
+#if (TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS
__asm__ volatile(
"lea (%2, %2, 2), %%"REG_a" \n\t" // 3*stride
"lea (%2, %2, 4), %%"REG_d" \n\t" // 5*stride
@@ -2446,9 +2450,10 @@ L2_DIFF_CORE((%0, %%REGc) , (%1, %%REGc))
"4: \n\t"
:: "r" (src), "r" (tempBlurred), "r"((x86_reg)stride), "m" (tempBlurredPast)
+ NAMED_CONSTRAINTS_ADD(b80)
: "%"REG_a, "%"REG_d, "%"REG_c, "memory"
);
-#else //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW
+#else //(TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS
{
int y;
int d=0;
@@ -2531,7 +2536,7 @@ Switch between
}
}
}
-#endif //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW
+#endif //(TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS
}
#endif //TEMPLATE_PP_ALTIVEC
@@ -2790,6 +2795,7 @@ static av_always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int st
: "+&r"(src)
: "r" ((x86_reg)step), "m" (c->pQPb), "r"(sums), "g"(src)
+ NAMED_CONSTRAINTS_ADD(w04)
);
src+= step; // src points to begin of the 8x8 Block
@@ -3061,6 +3067,7 @@ static av_always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int st
: "+r" (temp_src)
: "r" ((x86_reg)step), "m" (c->pQPb), "m"(eq_mask), "r"(tmp)
+ NAMED_CONSTRAINTS_ADD(w05,w20)
: "%"REG_a
);
}
@@ -3086,11 +3093,11 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[
static inline void RENAME(blockCopy)(uint8_t dst[], int dstStride, const uint8_t src[], int srcStride,
int levelFix, int64_t *packedOffsetAndScale)
{
-#if !TEMPLATE_PP_MMX
+#if !TEMPLATE_PP_MMX || !HAVE_6REGS
int i;
#endif
if(levelFix){
-#if TEMPLATE_PP_MMX
+#if TEMPLATE_PP_MMX && HAVE_6REGS
__asm__ volatile(
"movq (%%"REG_a"), %%mm2 \n\t" // packedYOffset
"movq 8(%%"REG_a"), %%mm3 \n\t" // packedYScale
@@ -3167,13 +3174,13 @@ SCALED_CPY((%%REGa, %4), (%%REGa, %4, 2), (%%REGd, %5), (%%REGd, %5, 2))
"r" ((x86_reg)dstStride)
: "%"REG_d
);
-#else //TEMPLATE_PP_MMX
+#else //TEMPLATE_PP_MMX && HAVE_6REGS
for(i=0; i<8; i++)
memcpy( &(dst[dstStride*i]),
&(src[srcStride*i]), BLOCK_SIZE);
-#endif //TEMPLATE_PP_MMX
+#endif //TEMPLATE_PP_MMX && HAVE_6REGS
}else{
-#if TEMPLATE_PP_MMX
+#if TEMPLATE_PP_MMX && HAVE_6REGS
__asm__ volatile(
"lea (%0,%2), %%"REG_a" \n\t"
"lea (%1,%3), %%"REG_d" \n\t"
@@ -3200,11 +3207,11 @@ SIMPLE_CPY((%%REGa, %2), (%%REGa, %2, 2), (%%REGd, %3), (%%REGd, %3, 2))
"r" ((x86_reg)dstStride)
: "%"REG_a, "%"REG_d
);
-#else //TEMPLATE_PP_MMX
+#else //TEMPLATE_PP_MMX && HAVE_6REGS
for(i=0; i<8; i++)
memcpy( &(dst[dstStride*i]),
&(src[srcStride*i]), BLOCK_SIZE);
-#endif //TEMPLATE_PP_MMX
+#endif //TEMPLATE_PP_MMX && HAVE_6REGS
}
}
@@ -3356,7 +3363,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[
// with the L1 Cache of the P4 ... or only a few blocks at a time or something
for(x=0; x<width; x+=BLOCK_SIZE){
-#if TEMPLATE_PP_MMXEXT
+#if TEMPLATE_PP_MMXEXT && HAVE_6REGS
/*
prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32);
prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32);
@@ -3492,7 +3499,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[
#endif
-#if TEMPLATE_PP_MMXEXT
+#if TEMPLATE_PP_MMXEXT && HAVE_6REGS
/*
prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32);
prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32);
diff --git a/chromium/third_party/ffmpeg/library.mak b/chromium/third_party/ffmpeg/library.mak
index 45096a741fc..cd39f11cfb8 100644
--- a/chromium/third_party/ffmpeg/library.mak
+++ b/chromium/third_party/ffmpeg/library.mak
@@ -42,10 +42,10 @@ install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
define RULES
-$(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
-$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
+$(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
+$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
-$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
+$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
$$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
@@ -61,7 +61,7 @@ $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
endif
clean::
- $(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
+ $(RM) $(addprefix $(SUBDIR),*-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
$(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%)
distclean:: clean
@@ -105,8 +105,7 @@ endef
$(eval $(RULES))
-$(EXAMPLES) $(TOOLS): $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
-$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME)
+$(TOOLS): $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
+$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME)
-examples: $(EXAMPLES)
testprogs: $(TESTPROGS)
diff --git a/chromium/third_party/ffmpeg/libswresample/arm/Makefile b/chromium/third_party/ffmpeg/libswresample/arm/Makefile
index 55683cbfae3..60f3f6d6b88 100644
--- a/chromium/third_party/ffmpeg/libswresample/arm/Makefile
+++ b/chromium/third_party/ffmpeg/libswresample/arm/Makefile
@@ -1,2 +1,5 @@
OBJS += arm/audio_convert_init.o
+
+OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o
+
NEON-OBJS += arm/audio_convert_neon.o
diff --git a/chromium/third_party/ffmpeg/libswresample/arm/audio_convert_neon.S b/chromium/third_party/ffmpeg/libswresample/arm/audio_convert_neon.S
index 471a2d864f1..1f88316ddec 100644
--- a/chromium/third_party/ffmpeg/libswresample/arm/audio_convert_neon.S
+++ b/chromium/third_party/ffmpeg/libswresample/arm/audio_convert_neon.S
@@ -133,8 +133,8 @@ function swri_oldapi_conv_fltp_to_s16_nch_neon, export=1
cmp r3, #2
itt lt
ldrlt r1, [r1]
- blt swri_oldapi_conv_flt_to_s16_neon
- beq swri_oldapi_conv_fltp_to_s16_2ch_neon
+ blt X(swri_oldapi_conv_flt_to_s16_neon)
+ beq X(swri_oldapi_conv_fltp_to_s16_2ch_neon)
push {r4-r8, lr}
cmp r3, #4
diff --git a/chromium/third_party/ffmpeg/libswresample/arm/neontest.c b/chromium/third_party/ffmpeg/libswresample/arm/neontest.c
new file mode 100644
index 00000000000..2abbbc23678
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswresample/arm/neontest.c
@@ -0,0 +1,29 @@
+/*
+ * check NEON registers for clobbers
+ * Copyright (c) 2013 Martin Storsjo
+ *
+ * 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 "libswresample/swresample.h"
+#include "libavutil/arm/neontest.h"
+
+wrap(swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
+ const uint8_t **in , int in_count))
+{
+ testneonclobbers(swr_convert, s, out, out_count, in, in_count);
+}
diff --git a/chromium/third_party/ffmpeg/libswresample/dither.c b/chromium/third_party/ffmpeg/libswresample/dither.c
index 7cbe410557d..b8b592a7ce9 100644
--- a/chromium/third_party/ffmpeg/libswresample/dither.c
+++ b/chromium/third_party/ffmpeg/libswresample/dither.c
@@ -26,7 +26,7 @@
void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt) {
double scale = s->dither.noise_scale;
#define TMP_EXTRA 2
- double *tmp = av_malloc((len + TMP_EXTRA) * sizeof(double));
+ double *tmp = av_malloc_array(len + TMP_EXTRA, sizeof(double));
int i;
for(i=0; i<len + TMP_EXTRA; i++){
diff --git a/chromium/third_party/ffmpeg/libswresample/rematrix.c b/chromium/third_party/ffmpeg/libswresample/rematrix.c
index e146edfcf7d..bf2abcfb20e 100644
--- a/chromium/third_party/ffmpeg/libswresample/rematrix.c
+++ b/chromium/third_party/ffmpeg/libswresample/rematrix.c
@@ -127,6 +127,11 @@ av_cold static int auto_matrix(SwrContext *s)
)
out_ch_layout = AV_CH_LAYOUT_STEREO;
+ if( in_ch_layout == AV_CH_LAYOUT_STEREO_DOWNMIX
+ && (out_ch_layout & AV_CH_LAYOUT_STEREO_DOWNMIX) == 0
+ )
+ in_ch_layout = AV_CH_LAYOUT_STEREO;
+
if(!sane_layout(in_ch_layout)){
av_get_channel_layout_string(buf, sizeof(buf), -1, s->in_ch_layout);
av_log(s, AV_LOG_ERROR, "Input channel layout '%s' is not supported\n", buf);
diff --git a/chromium/third_party/ffmpeg/libswresample/resample.c b/chromium/third_party/ffmpeg/libswresample/resample.c
index 8b1b6ca9aff..0ce74d076cf 100644
--- a/chromium/third_party/ffmpeg/libswresample/resample.c
+++ b/chromium/third_party/ffmpeg/libswresample/resample.c
@@ -95,7 +95,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
int filter_type, int kaiser_beta){
int ph, i;
double x, y, w;
- double *tab = av_malloc(tap_count * sizeof(*tab));
+ double *tab = av_malloc_array(tap_count, sizeof(*tab));
const int center= (tap_count-1)/2;
if (!tab)
@@ -229,6 +229,11 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r
av_assert0(0);
}
+ if (filter_size/factor > INT32_MAX/256) {
+ av_log(NULL, AV_LOG_ERROR, "Filter length too large\n");
+ goto error;
+ }
+
c->phase_shift = phase_shift;
c->phase_mask = phase_count - 1;
c->linear = linear;
@@ -302,10 +307,20 @@ static int set_compensation(ResampleContext *c, int sample_delta, int compensati
#include "resample_template.c"
#undef TEMPLATE_RESAMPLE_S16_MMX2
-#if HAVE_SSSE3_INLINE
-#define TEMPLATE_RESAMPLE_S16_SSSE3
+#if HAVE_SSE_INLINE
+#define TEMPLATE_RESAMPLE_FLT_SSE
+#include "resample_template.c"
+#undef TEMPLATE_RESAMPLE_FLT_SSE
+#endif
+
+#if HAVE_SSE2_INLINE
+#define TEMPLATE_RESAMPLE_S16_SSE2
+#include "resample_template.c"
+#undef TEMPLATE_RESAMPLE_S16_SSE2
+
+#define TEMPLATE_RESAMPLE_DBL_SSE2
#include "resample_template.c"
-#undef TEMPLATE_RESAMPLE_S16_SSSE3
+#undef TEMPLATE_RESAMPLE_DBL_SSE2
#endif
#endif // HAVE_MMXEXT_INLINE
@@ -317,8 +332,8 @@ static int multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, A
for(i=0; i<dst->ch_count; i++){
#if HAVE_MMXEXT_INLINE
-#if HAVE_SSSE3_INLINE
- if(c->format == AV_SAMPLE_FMT_S16P && (mm_flags&AV_CPU_FLAG_SSSE3)) ret= swri_resample_int16_ssse3(c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
+#if HAVE_SSE2_INLINE
+ if(c->format == AV_SAMPLE_FMT_S16P && (mm_flags&AV_CPU_FLAG_SSE2)) ret= swri_resample_int16_sse2 (c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
else
#endif
if(c->format == AV_SAMPLE_FMT_S16P && (mm_flags&AV_CPU_FLAG_MMX2 )){
@@ -328,7 +343,15 @@ static int multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, A
#endif
if(c->format == AV_SAMPLE_FMT_S16P) ret= swri_resample_int16(c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
else if(c->format == AV_SAMPLE_FMT_S32P) ret= swri_resample_int32(c, (int32_t*)dst->ch[i], (const int32_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
+#if HAVE_SSE_INLINE
+ else if(c->format == AV_SAMPLE_FMT_FLTP && (mm_flags&AV_CPU_FLAG_SSE))
+ ret= swri_resample_float_sse (c, (float*)dst->ch[i], (const float*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
+#endif
else if(c->format == AV_SAMPLE_FMT_FLTP) ret= swri_resample_float(c, (float *)dst->ch[i], (const float *)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
+#if HAVE_SSE2_INLINE
+ else if(c->format == AV_SAMPLE_FMT_DBLP && (mm_flags&AV_CPU_FLAG_SSE2))
+ ret= swri_resample_double_sse2(c,(double *)dst->ch[i], (const double *)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
+#endif
else if(c->format == AV_SAMPLE_FMT_DBLP) ret= swri_resample_double(c,(double *)dst->ch[i], (const double *)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
}
if(need_emms)
diff --git a/chromium/third_party/ffmpeg/libswresample/resample_template.c b/chromium/third_party/ffmpeg/libswresample/resample_template.c
index 5bc12bcb712..7624d9291ba 100644
--- a/chromium/third_party/ffmpeg/libswresample/resample_template.c
+++ b/chromium/third_party/ffmpeg/libswresample/resample_template.c
@@ -25,8 +25,9 @@
* @author Michael Niedermayer <michaelni@gmx.at>
*/
-#if defined(TEMPLATE_RESAMPLE_DBL)
-# define RENAME(N) N ## _double
+#if defined(TEMPLATE_RESAMPLE_DBL) \
+ || defined(TEMPLATE_RESAMPLE_DBL_SSE2)
+
# define FILTER_SHIFT 0
# define DELEM double
# define FELEM double
@@ -34,8 +35,17 @@
# define FELEML double
# define OUT(d, v) d = v
-#elif defined(TEMPLATE_RESAMPLE_FLT)
-# define RENAME(N) N ## _float
+# if defined(TEMPLATE_RESAMPLE_DBL)
+# define RENAME(N) N ## _double
+# elif defined(TEMPLATE_RESAMPLE_DBL_SSE2)
+# define COMMON_CORE COMMON_CORE_DBL_SSE2
+# define LINEAR_CORE LINEAR_CORE_DBL_SSE2
+# define RENAME(N) N ## _double_sse2
+# endif
+
+#elif defined(TEMPLATE_RESAMPLE_FLT) \
+ || defined(TEMPLATE_RESAMPLE_FLT_SSE)
+
# define FILTER_SHIFT 0
# define DELEM float
# define FELEM float
@@ -43,6 +53,14 @@
# define FELEML float
# define OUT(d, v) d = v
+# if defined(TEMPLATE_RESAMPLE_FLT)
+# define RENAME(N) N ## _float
+# elif defined(TEMPLATE_RESAMPLE_FLT_SSE)
+# define COMMON_CORE COMMON_CORE_FLT_SSE
+# define LINEAR_CORE LINEAR_CORE_FLT_SSE
+# define RENAME(N) N ## _float_sse
+# endif
+
#elif defined(TEMPLATE_RESAMPLE_S32)
# define RENAME(N) N ## _int32
# define FILTER_SHIFT 30
@@ -57,7 +75,7 @@
#elif defined(TEMPLATE_RESAMPLE_S16) \
|| defined(TEMPLATE_RESAMPLE_S16_MMX2) \
- || defined(TEMPLATE_RESAMPLE_S16_SSSE3)
+ || defined(TEMPLATE_RESAMPLE_S16_SSE2)
# define FILTER_SHIFT 15
# define DELEM int16_t
@@ -73,10 +91,12 @@
# define RENAME(N) N ## _int16
# elif defined(TEMPLATE_RESAMPLE_S16_MMX2)
# define COMMON_CORE COMMON_CORE_INT16_MMX2
+# define LINEAR_CORE LINEAR_CORE_INT16_MMX2
# define RENAME(N) N ## _int16_mmx2
-# elif defined(TEMPLATE_RESAMPLE_S16_SSSE3)
-# define COMMON_CORE COMMON_CORE_INT16_SSSE3
-# define RENAME(N) N ## _int16_ssse3
+# elif defined(TEMPLATE_RESAMPLE_S16_SSE2)
+# define COMMON_CORE COMMON_CORE_INT16_SSE2
+# define LINEAR_CORE LINEAR_CORE_INT16_SSE2
+# define RENAME(N) N ## _int16_sse2
# endif
#endif
@@ -93,9 +113,11 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
av_assert1(c->felem_size == sizeof(FELEM));
if(compensation_distance == 0 && c->filter_length == 1 && c->phase_shift==0){
- int64_t index2= ((int64_t)index)<<32;
+ int64_t index2= (1LL<<32)*c->frac/c->src_incr + (1LL<<32)*index;
int64_t incr= (1LL<<32) * c->dst_incr / c->src_incr;
- dst_size= FFMIN(dst_size, (src_size-1-index) * (int64_t)c->src_incr / c->dst_incr);
+ int new_size = (src_size * (int64_t)c->src_incr - frac + c->dst_incr - 1) / c->dst_incr;
+
+ dst_size= FFMIN(dst_size, new_size);
for(dst_index=0; dst_index < dst_size; dst_index++){
dst[dst_index] = src[index2>>32];
@@ -105,8 +127,8 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
index += (frac + dst_index * (int64_t)dst_incr_frac) / c->src_incr;
frac = (frac + dst_index * (int64_t)dst_incr_frac) % c->src_incr;
av_assert2(index >= 0);
- *consumed= index >> c->phase_shift;
- index &= c->phase_mask;
+ *consumed= index;
+ index = 0;
}else if(compensation_distance == 0 && !c->linear && index >= 0){
int sample_index = 0;
for(dst_index=0; dst_index < dst_size; dst_index++){
@@ -152,21 +174,30 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
}else if(sample_index < 0){
for(i=0; i<c->filter_length; i++)
val += src[FFABS(sample_index + i)] * (FELEM2)filter[i];
+ OUT(dst[dst_index], val);
}else if(c->linear){
FELEM2 v2=0;
+#ifdef LINEAR_CORE
+ LINEAR_CORE
+#else
for(i=0; i<c->filter_length; i++){
val += src[sample_index + i] * (FELEM2)filter[i];
v2 += src[sample_index + i] * (FELEM2)filter[i + c->filter_alloc];
}
+#endif
val+=(v2-val)*(FELEML)frac / c->src_incr;
+ OUT(dst[dst_index], val);
}else{
+#ifdef COMMON_CORE
+ COMMON_CORE
+#else
for(i=0; i<c->filter_length; i++){
val += src[sample_index + i] * (FELEM2)filter[i];
}
+ OUT(dst[dst_index], val);
+#endif
}
- OUT(dst[dst_index], val);
-
frac += dst_incr_frac;
index += dst_incr;
if(frac >= c->src_incr){
@@ -200,6 +231,7 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
}
#undef COMMON_CORE
+#undef LINEAR_CORE
#undef RENAME
#undef FILTER_SHIFT
#undef DELEM
diff --git a/chromium/third_party/ffmpeg/libswresample/swresample.c b/chromium/third_party/ffmpeg/libswresample/swresample.c
index 93c96ceb6a8..7076650106f 100644
--- a/chromium/third_party/ffmpeg/libswresample/swresample.c
+++ b/chromium/third_party/ffmpeg/libswresample/swresample.c
@@ -51,12 +51,12 @@ static const AVOption options[]={
{"in_sample_rate" , "set input sample rate" , OFFSET( in_sample_rate), AV_OPT_TYPE_INT , {.i64=0 }, 0 , INT_MAX , PARAM},
{"osr" , "set output sample rate" , OFFSET(out_sample_rate), AV_OPT_TYPE_INT , {.i64=0 }, 0 , INT_MAX , PARAM},
{"out_sample_rate" , "set output sample rate" , OFFSET(out_sample_rate), AV_OPT_TYPE_INT , {.i64=0 }, 0 , INT_MAX , PARAM},
-{"isf" , "set input sample format" , OFFSET( in_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , AV_SAMPLE_FMT_NB-1, PARAM},
-{"in_sample_fmt" , "set input sample format" , OFFSET( in_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , AV_SAMPLE_FMT_NB-1, PARAM},
-{"osf" , "set output sample format" , OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , AV_SAMPLE_FMT_NB-1, PARAM},
-{"out_sample_fmt" , "set output sample format" , OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , AV_SAMPLE_FMT_NB-1, PARAM},
-{"tsf" , "set internal sample format" , OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , AV_SAMPLE_FMT_NB-1, PARAM},
-{"internal_sample_fmt" , "set internal sample format" , OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , AV_SAMPLE_FMT_NB-1, PARAM},
+{"isf" , "set input sample format" , OFFSET( in_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
+{"in_sample_fmt" , "set input sample format" , OFFSET( in_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
+{"osf" , "set output sample format" , OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
+{"out_sample_fmt" , "set output sample format" , OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
+{"tsf" , "set internal sample format" , OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
+{"internal_sample_fmt" , "set internal sample format" , OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
{"icl" , "set input channel layout" , OFFSET( in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0 }, 0 , INT64_MAX , PARAM, "channel_layout"},
{"in_channel_layout" , "set input channel layout" , OFFSET( in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0 }, 0 , INT64_MAX , PARAM, "channel_layout"},
{"ocl" , "set output channel layout" , OFFSET(out_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0 }, 0 , INT64_MAX , PARAM, "channel_layout"},
@@ -218,33 +218,12 @@ static void free_temp(AudioData *a){
memset(a, 0, sizeof(*a));
}
-av_cold void swr_free(SwrContext **ss){
- SwrContext *s= *ss;
- if(s){
- free_temp(&s->postin);
- free_temp(&s->midbuf);
- free_temp(&s->preout);
- free_temp(&s->in_buffer);
- free_temp(&s->silence);
- free_temp(&s->drop_temp);
- free_temp(&s->dither.noise);
- free_temp(&s->dither.temp);
- swri_audio_convert_free(&s-> in_convert);
- swri_audio_convert_free(&s->out_convert);
- swri_audio_convert_free(&s->full_convert);
- if (s->resampler)
- s->resampler->free(&s->resample);
- swri_rematrix_free(s);
- }
-
- av_freep(ss);
-}
-
-av_cold int swr_init(struct SwrContext *s){
- int ret;
+static void clear_context(SwrContext *s){
s->in_buffer_index= 0;
s->in_buffer_count= 0;
s->resample_in_constraint= 0;
+ memset(s->in.ch, 0, sizeof(s->in.ch));
+ memset(s->out.ch, 0, sizeof(s->out.ch));
free_temp(&s->postin);
free_temp(&s->midbuf);
free_temp(&s->preout);
@@ -253,14 +232,33 @@ av_cold int swr_init(struct SwrContext *s){
free_temp(&s->drop_temp);
free_temp(&s->dither.noise);
free_temp(&s->dither.temp);
- memset(s->in.ch, 0, sizeof(s->in.ch));
- memset(s->out.ch, 0, sizeof(s->out.ch));
swri_audio_convert_free(&s-> in_convert);
swri_audio_convert_free(&s->out_convert);
swri_audio_convert_free(&s->full_convert);
swri_rematrix_free(s);
s->flushed = 0;
+}
+
+av_cold void swr_free(SwrContext **ss){
+ SwrContext *s= *ss;
+ if(s){
+ clear_context(s);
+ if (s->resampler)
+ s->resampler->free(&s->resample);
+ }
+
+ av_freep(ss);
+}
+
+av_cold void swr_close(SwrContext *s){
+ clear_context(s);
+}
+
+av_cold int swr_init(struct SwrContext *s){
+ int ret;
+
+ clear_context(s);
if(s-> in_sample_fmt >= AV_SAMPLE_FMT_NB){
av_log(s, AV_LOG_ERROR, "Requested input sample format %d is invalid\n", s->in_sample_fmt);
@@ -739,11 +737,20 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
return out_count;
}
+int swr_is_initialized(struct SwrContext *s) {
+ return !!s->in_buffer.ch_count;
+}
+
int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_count,
const uint8_t *in_arg [SWR_CH_MAX], int in_count){
AudioData * in= &s->in;
AudioData *out= &s->out;
+ if (!swr_is_initialized(s)) {
+ av_log(s, AV_LOG_ERROR, "Context has not been initialized\n");
+ return AVERROR(EINVAL);
+ }
+
while(s->drop_output > 0){
int ret;
uint8_t *tmp_arg[SWR_CH_MAX];
diff --git a/chromium/third_party/ffmpeg/libswresample/swresample.h b/chromium/third_party/ffmpeg/libswresample/swresample.h
index 381130184d1..017a320c014 100644
--- a/chromium/third_party/ffmpeg/libswresample/swresample.h
+++ b/chromium/third_party/ffmpeg/libswresample/swresample.h
@@ -166,6 +166,13 @@ struct SwrContext *swr_alloc(void);
int swr_init(struct SwrContext *s);
/**
+ * Check whether an swr context has been initialized or not.
+ *
+ * @return positive if it has been initialized, 0 if not initialized
+ */
+int swr_is_initialized(struct SwrContext *s);
+
+/**
* Allocate SwrContext if needed and set/reset common parameters.
*
* This function does not require s to be allocated with swr_alloc(). On the
@@ -196,6 +203,16 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
void swr_free(struct SwrContext **s);
/**
+ * Closes the context so that swr_is_initialized() returns 0.
+ *
+ * the context can be brougt back to life by running swr_init(),
+ * swr_init() can also be used without swr_close().
+ * This function is mainly provided for simplifying the usecase
+ * where one tries to support libavresample and libswresample
+ */
+void swr_close(struct SwrContext *s);
+
+/**
* Convert audio.
*
* in and in_count can be set to 0 to flush the last few samples out at the
@@ -203,7 +220,7 @@ void swr_free(struct SwrContext **s);
*
* If more input is provided than output space then the input will be buffered.
* You can avoid this buffering by providing more output space than input.
- * Convertion will run directly without copying whenever possible.
+ * Conversion will run directly without copying whenever possible.
*
* @param s allocated Swr context, with parameters set
* @param out output buffers, only the first one need be set in case of packed audio
diff --git a/chromium/third_party/ffmpeg/libswresample/version.h b/chromium/third_party/ffmpeg/libswresample/version.h
index 464c86d74be..8ca9f59102d 100644
--- a/chromium/third_party/ffmpeg/libswresample/version.h
+++ b/chromium/third_party/ffmpeg/libswresample/version.h
@@ -29,8 +29,8 @@
#include "libavutil/avutil.h"
#define LIBSWRESAMPLE_VERSION_MAJOR 0
-#define LIBSWRESAMPLE_VERSION_MINOR 17
-#define LIBSWRESAMPLE_VERSION_MICRO 104
+#define LIBSWRESAMPLE_VERSION_MINOR 19
+#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
LIBSWRESAMPLE_VERSION_MINOR, \
diff --git a/chromium/third_party/ffmpeg/libswresample/x86/Makefile b/chromium/third_party/ffmpeg/libswresample/x86/Makefile
index e8feede6b67..1d1ab6ead64 100644
--- a/chromium/third_party/ffmpeg/libswresample/x86/Makefile
+++ b/chromium/third_party/ffmpeg/libswresample/x86/Makefile
@@ -1,3 +1,5 @@
YASM-OBJS += x86/swresample_x86.o\
x86/audio_convert.o\
x86/rematrix.o\
+
+OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
diff --git a/chromium/third_party/ffmpeg/libswresample/x86/resample_mmx.h b/chromium/third_party/ffmpeg/libswresample/x86/resample_mmx.h
index d96fd5a9d2d..2bd48a92955 100644
--- a/chromium/third_party/ffmpeg/libswresample/x86/resample_mmx.h
+++ b/chromium/third_party/ffmpeg/libswresample/x86/resample_mmx.h
@@ -23,7 +23,9 @@
#include "libswresample/swresample_internal.h"
int swri_resample_int16_mmx2 (struct ResampleContext *c, int16_t *dst, const int16_t *src, int *consumed, int src_size, int dst_size, int update_ctx);
-int swri_resample_int16_ssse3(struct ResampleContext *c, int16_t *dst, const int16_t *src, int *consumed, int src_size, int dst_size, int update_ctx);
+int swri_resample_int16_sse2 (struct ResampleContext *c, int16_t *dst, const int16_t *src, int *consumed, int src_size, int dst_size, int update_ctx);
+int swri_resample_float_sse (struct ResampleContext *c, float *dst, const float *src, int *consumed, int src_size, int dst_size, int update_ctx);
+int swri_resample_double_sse2(struct ResampleContext *c, double *dst, const double *src, int *consumed, int src_size, int dst_size, int update_ctx);
DECLARE_ALIGNED(16, const uint64_t, ff_resample_int16_rounder)[2] = { 0x0000000000004000ULL, 0x0000000000000000ULL};
@@ -46,9 +48,38 @@ __asm__ volatile(\
: "r" (((uint8_t*)(src+sample_index))-len),\
"r" (((uint8_t*)filter)-len),\
"r" (dst+dst_index)\
+ NAMED_CONSTRAINTS_ARRAY_ADD(ff_resample_int16_rounder)\
);
-#define COMMON_CORE_INT16_SSSE3 \
+#define LINEAR_CORE_INT16_MMX2 \
+ x86_reg len= -2*c->filter_length;\
+__asm__ volatile(\
+ "pxor %%mm0, %%mm0 \n\t"\
+ "pxor %%mm2, %%mm2 \n\t"\
+ "1: \n\t"\
+ "movq (%3, %0), %%mm1 \n\t"\
+ "movq %%mm1, %%mm3 \n\t"\
+ "pmaddwd (%4, %0), %%mm1 \n\t"\
+ "pmaddwd (%5, %0), %%mm3 \n\t"\
+ "paddd %%mm1, %%mm0 \n\t"\
+ "paddd %%mm3, %%mm2 \n\t"\
+ "add $8, %0 \n\t"\
+ " js 1b \n\t"\
+ "pshufw $0x0E, %%mm0, %%mm1 \n\t"\
+ "pshufw $0x0E, %%mm2, %%mm3 \n\t"\
+ "paddd %%mm1, %%mm0 \n\t"\
+ "paddd %%mm3, %%mm2 \n\t"\
+ "movd %%mm0, %1 \n\t"\
+ "movd %%mm2, %2 \n\t"\
+ : "+r" (len),\
+ "=r" (val),\
+ "=r" (v2)\
+ : "r" (((uint8_t*)(src+sample_index))-len),\
+ "r" (((uint8_t*)filter)-len),\
+ "r" (((uint8_t*)(filter+c->filter_alloc))-len)\
+);
+
+#define COMMON_CORE_INT16_SSE2 \
x86_reg len= -2*c->filter_length;\
__asm__ volatile(\
"movdqa "MANGLE(ff_resample_int16_rounder)", %%xmm0 \n\t"\
@@ -58,8 +89,10 @@ __asm__ volatile(\
"paddd %%xmm1, %%xmm0 \n\t"\
"add $16, %0 \n\t"\
" js 1b \n\t"\
- "phaddd %%xmm0, %%xmm0 \n\t"\
- "phaddd %%xmm0, %%xmm0 \n\t"\
+ "pshufd $0x0E, %%xmm0, %%xmm1 \n\t"\
+ "paddd %%xmm1, %%xmm0 \n\t"\
+ "pshufd $0x01, %%xmm0, %%xmm1 \n\t"\
+ "paddd %%xmm1, %%xmm0 \n\t"\
"psrad $15, %%xmm0 \n\t"\
"packssdw %%xmm0, %%xmm0 \n\t"\
"movd %%xmm0, (%3) \n\t"\
@@ -67,4 +100,146 @@ __asm__ volatile(\
: "r" (((uint8_t*)(src+sample_index))-len),\
"r" (((uint8_t*)filter)-len),\
"r" (dst+dst_index)\
+ NAMED_CONSTRAINTS_ARRAY_ADD(ff_resample_int16_rounder)\
+ XMM_CLOBBERS_ONLY("%xmm0", "%xmm1")\
+);
+
+#define LINEAR_CORE_INT16_SSE2 \
+ x86_reg len= -2*c->filter_length;\
+__asm__ volatile(\
+ "pxor %%xmm0, %%xmm0 \n\t"\
+ "pxor %%xmm2, %%xmm2 \n\t"\
+ "1: \n\t"\
+ "movdqu (%3, %0), %%xmm1 \n\t"\
+ "movdqa %%xmm1, %%xmm3 \n\t"\
+ "pmaddwd (%4, %0), %%xmm1 \n\t"\
+ "pmaddwd (%5, %0), %%xmm3 \n\t"\
+ "paddd %%xmm1, %%xmm0 \n\t"\
+ "paddd %%xmm3, %%xmm2 \n\t"\
+ "add $16, %0 \n\t"\
+ " js 1b \n\t"\
+ "pshufd $0x0E, %%xmm0, %%xmm1 \n\t"\
+ "pshufd $0x0E, %%xmm2, %%xmm3 \n\t"\
+ "paddd %%xmm1, %%xmm0 \n\t"\
+ "paddd %%xmm3, %%xmm2 \n\t"\
+ "pshufd $0x01, %%xmm0, %%xmm1 \n\t"\
+ "pshufd $0x01, %%xmm2, %%xmm3 \n\t"\
+ "paddd %%xmm1, %%xmm0 \n\t"\
+ "paddd %%xmm3, %%xmm2 \n\t"\
+ "movd %%xmm0, %1 \n\t"\
+ "movd %%xmm2, %2 \n\t"\
+ : "+r" (len),\
+ "=r" (val),\
+ "=r" (v2)\
+ : "r" (((uint8_t*)(src+sample_index))-len),\
+ "r" (((uint8_t*)filter)-len),\
+ "r" (((uint8_t*)(filter+c->filter_alloc))-len)\
+ XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3")\
+);
+
+#define COMMON_CORE_FLT_SSE \
+ x86_reg len= -4*c->filter_length;\
+__asm__ volatile(\
+ "xorps %%xmm0, %%xmm0 \n\t"\
+ "1: \n\t"\
+ "movups (%1, %0), %%xmm1 \n\t"\
+ "mulps (%2, %0), %%xmm1 \n\t"\
+ "addps %%xmm1, %%xmm0 \n\t"\
+ "add $16, %0 \n\t"\
+ " js 1b \n\t"\
+ "movhlps %%xmm0, %%xmm1 \n\t"\
+ "addps %%xmm1, %%xmm0 \n\t"\
+ "movss %%xmm0, %%xmm1 \n\t"\
+ "shufps $1, %%xmm0, %%xmm0 \n\t"\
+ "addps %%xmm1, %%xmm0 \n\t"\
+ "movss %%xmm0, (%3) \n\t"\
+ : "+r" (len)\
+ : "r" (((uint8_t*)(src+sample_index))-len),\
+ "r" (((uint8_t*)filter)-len),\
+ "r" (dst+dst_index)\
+ XMM_CLOBBERS_ONLY("%xmm0", "%xmm1")\
+);
+
+#define LINEAR_CORE_FLT_SSE \
+ x86_reg len= -4*c->filter_length;\
+__asm__ volatile(\
+ "xorps %%xmm0, %%xmm0 \n\t"\
+ "xorps %%xmm2, %%xmm2 \n\t"\
+ "1: \n\t"\
+ "movups (%3, %0), %%xmm1 \n\t"\
+ "movaps %%xmm1, %%xmm3 \n\t"\
+ "mulps (%4, %0), %%xmm1 \n\t"\
+ "mulps (%5, %0), %%xmm3 \n\t"\
+ "addps %%xmm1, %%xmm0 \n\t"\
+ "addps %%xmm3, %%xmm2 \n\t"\
+ "add $16, %0 \n\t"\
+ " js 1b \n\t"\
+ "movhlps %%xmm0, %%xmm1 \n\t"\
+ "movhlps %%xmm2, %%xmm3 \n\t"\
+ "addps %%xmm1, %%xmm0 \n\t"\
+ "addps %%xmm3, %%xmm2 \n\t"\
+ "movss %%xmm0, %%xmm1 \n\t"\
+ "movss %%xmm2, %%xmm3 \n\t"\
+ "shufps $1, %%xmm0, %%xmm0 \n\t"\
+ "shufps $1, %%xmm2, %%xmm2 \n\t"\
+ "addps %%xmm1, %%xmm0 \n\t"\
+ "addps %%xmm3, %%xmm2 \n\t"\
+ "movss %%xmm0, %1 \n\t"\
+ "movss %%xmm2, %2 \n\t"\
+ : "+r" (len),\
+ "=m" (val),\
+ "=m" (v2)\
+ : "r" (((uint8_t*)(src+sample_index))-len),\
+ "r" (((uint8_t*)filter)-len),\
+ "r" (((uint8_t*)(filter+c->filter_alloc))-len)\
+ XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3")\
+);
+
+#define COMMON_CORE_DBL_SSE2 \
+ x86_reg len= -8*c->filter_length;\
+__asm__ volatile(\
+ "xorpd %%xmm0, %%xmm0 \n\t"\
+ "1: \n\t"\
+ "movupd (%1, %0), %%xmm1 \n\t"\
+ "mulpd (%2, %0), %%xmm1 \n\t"\
+ "addpd %%xmm1, %%xmm0 \n\t"\
+ "add $16, %0 \n\t"\
+ " js 1b \n\t"\
+ "movhlps %%xmm0, %%xmm1 \n\t"\
+ "addpd %%xmm1, %%xmm0 \n\t"\
+ "movsd %%xmm0, (%3) \n\t"\
+ : "+r" (len)\
+ : "r" (((uint8_t*)(src+sample_index))-len),\
+ "r" (((uint8_t*)filter)-len),\
+ "r" (dst+dst_index)\
+ XMM_CLOBBERS_ONLY("%xmm0", "%xmm1")\
+);
+
+#define LINEAR_CORE_DBL_SSE2 \
+ x86_reg len= -8*c->filter_length;\
+__asm__ volatile(\
+ "xorpd %%xmm0, %%xmm0 \n\t"\
+ "xorpd %%xmm2, %%xmm2 \n\t"\
+ "1: \n\t"\
+ "movupd (%3, %0), %%xmm1 \n\t"\
+ "movapd %%xmm1, %%xmm3 \n\t"\
+ "mulpd (%4, %0), %%xmm1 \n\t"\
+ "mulpd (%5, %0), %%xmm3 \n\t"\
+ "addpd %%xmm1, %%xmm0 \n\t"\
+ "addpd %%xmm3, %%xmm2 \n\t"\
+ "add $16, %0 \n\t"\
+ " js 1b \n\t"\
+ "movhlps %%xmm0, %%xmm1 \n\t"\
+ "movhlps %%xmm2, %%xmm3 \n\t"\
+ "addpd %%xmm1, %%xmm0 \n\t"\
+ "addpd %%xmm3, %%xmm2 \n\t"\
+ "movsd %%xmm0, %1 \n\t"\
+ "movsd %%xmm2, %2 \n\t"\
+ : "+r" (len),\
+ "=m" (val),\
+ "=m" (v2)\
+ : "r" (((uint8_t*)(src+sample_index))-len),\
+ "r" (((uint8_t*)filter)-len),\
+ "r" (((uint8_t*)(filter+c->filter_alloc))-len)\
+ XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3")\
);
diff --git a/chromium/third_party/ffmpeg/libswresample/x86/swresample_x86.c b/chromium/third_party/ffmpeg/libswresample/x86/swresample_x86.c
index 581dc17e85b..7483ba0bed9 100644
--- a/chromium/third_party/ffmpeg/libswresample/x86/swresample_x86.c
+++ b/chromium/third_party/ffmpeg/libswresample/x86/swresample_x86.c
@@ -21,14 +21,14 @@
#include "libswresample/swresample_internal.h"
#include "libswresample/audioconvert.h"
-#define PROTO(pre, in, out, cap) void ff ## pre ## _ ##in## _to_ ##out## _a_ ##cap(uint8_t **dst, const uint8_t **src, int len);
+#define PROTO(pre, in, out, cap) void ff ## pre ## in## _to_ ##out## _a_ ##cap(uint8_t **dst, const uint8_t **src, int len);
#define PROTO2(pre, out, cap) PROTO(pre, int16, out, cap) PROTO(pre, int32, out, cap) PROTO(pre, float, out, cap)
#define PROTO3(pre, cap) PROTO2(pre, int16, cap) PROTO2(pre, int32, cap) PROTO2(pre, float, cap)
#define PROTO4(pre) PROTO3(pre, mmx) PROTO3(pre, sse) PROTO3(pre, sse2) PROTO3(pre, ssse3) PROTO3(pre, sse4) PROTO3(pre, avx)
-PROTO4()
-PROTO4(_pack_2ch)
-PROTO4(_pack_6ch)
-PROTO4(_unpack_2ch)
+PROTO4(_)
+PROTO4(_pack_2ch_)
+PROTO4(_pack_6ch_)
+PROTO4(_unpack_2ch_)
av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac,
enum AVSampleFormat out_fmt,
diff --git a/chromium/third_party/ffmpeg/libswresample/x86/w64xmmtest.c b/chromium/third_party/ffmpeg/libswresample/x86/w64xmmtest.c
new file mode 100644
index 00000000000..9cddb4a8582
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswresample/x86/w64xmmtest.c
@@ -0,0 +1,29 @@
+/*
+ * check XMM registers for clobbers on Win64
+ * Copyright (c) 2013 Martin Storsjo
+ *
+ * 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 "libswresample/swresample.h"
+#include "libavutil/x86/w64xmmtest.h"
+
+wrap(swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
+ const uint8_t **in , int in_count))
+{
+ testxmmclobbers(swr_convert, s, out, out_count, in, in_count);
+}
diff --git a/chromium/third_party/ffmpeg/libswscale/Makefile b/chromium/third_party/ffmpeg/libswscale/Makefile
index ca6e27d1f03..e96837f0648 100644
--- a/chromium/third_party/ffmpeg/libswscale/Makefile
+++ b/chromium/third_party/ffmpeg/libswscale/Makefile
@@ -1,7 +1,6 @@
include $(SUBDIR)../config.mak
NAME = swscale
-FFLIBS = avutil
HEADERS = swscale.h \
version.h \
diff --git a/chromium/third_party/ffmpeg/libswscale/arm/Makefile b/chromium/third_party/ffmpeg/libswscale/arm/Makefile
new file mode 100644
index 00000000000..8b5a97b54cf
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/arm/Makefile
@@ -0,0 +1,4 @@
+# OBJS += arm/swscale_unscaled.o
+
+# NEON-OBJS += arm/rgb2yuv_neon_32.o
+# NEON-OBJS += arm/rgb2yuv_neon_16.o
diff --git a/chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_16.S b/chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_16.S
new file mode 100644
index 00000000000..601bc9a9b7c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_16.S
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2013 Xiaolei Yu <dreifachstein@gmail.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 "rgb2yuv_neon_common.S"
+
+/* downsampled R16G16B16 x8 */
+alias_qw r16x8, q7
+alias_qw g16x8, q8
+alias_qw b16x8, q9
+
+alias n16x16_l, q11
+alias n16x16_h, q12
+
+alias y16x16_l, q13
+alias y16x16_h, q14
+
+alias_qw y8x16, q15
+
+.macro init src
+ vld3.i32 {q13_l, q14_l, q15_l}, [\src]!
+ vld3.i32 {q13_h[0], q14_h[0], q15_h[0]}, [\src]
+ vrshrn.i32 CO_R, q13, #7
+ vrshrn.i32 CO_G, q14, #7
+ vrshrn.i32 CO_B, q15, #7
+
+ vmov.u8 BIAS_Y, #16
+ vmov.u8 BIAS_U, #128
+.endm
+
+
+.macro compute_y_16x1_step action, s8x16, coeff
+ vmovl.u8 n16x16_l, \s8x16\()_l
+ vmovl.u8 n16x16_h, \s8x16\()_h
+
+ \action y16x16_l, n16x16_l, \coeff
+ \action y16x16_h, n16x16_h, \coeff
+.endm
+
+.macro compute_y_16x1
+ compute_y_16x1_step vmul, r8x16, CO_RY
+ compute_y_16x1_step vmla, g8x16, CO_GY
+ compute_y_16x1_step vmla, b8x16, CO_BY
+
+ vrshrn.i16 y8x16_l, y16x16_l, #8
+ vrshrn.i16 y8x16_h, y16x16_h, #8
+
+ vadd.u8 y8x16, y8x16, BIAS_Y
+.endm
+
+alias c16x8, q15
+alias_qw c8x8x2, q10
+
+
+.macro compute_chroma_8x1 c, C
+ vmul c16x8, r16x8, CO_R\C
+ vmla c16x8, g16x8, CO_G\C
+ vmla c16x8, b16x8, CO_B\C
+
+ vrshrn.i16 \c\()8x8, c16x8, #8
+ vadd.u8 \c\()8x8, \c\()8x8, BIAS_\C
+.endm
+
+ loop_420sp rgbx, nv12, init, kernel_420_16x2, 16
diff --git a/chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_32.S b/chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_32.S
new file mode 100644
index 00000000000..f51a5f149f0
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_32.S
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2013 Xiaolei Yu <dreifachstein@gmail.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 "rgb2yuv_neon_common.S"
+
+/* downsampled R16G16B16 x8 */
+alias_qw r16x8, q7
+alias_qw g16x8, q8
+alias_qw b16x8, q9
+
+alias n16x16_o, q11
+alias n16x16_ol, q11_l
+alias n16x16_oh, q11_h
+
+alias y32x16_el, q12
+alias y32x16_eh, q13
+alias y32x16_ol, q14
+alias y32x16_oh, q15
+
+alias y16x16_e, q12
+alias y16x16_el, q12_l
+alias y16x16_eh, q12_h
+alias y16x16_o, q13
+alias y16x16_ol, q13_l
+alias y16x16_oh, q13_h
+
+
+alias y8x16, y16x16_e
+
+
+.macro init src
+ // load s32x3x3, narrow to s16x3x3
+ vld3.i32 {q13_l, q14_l, q15_l}, [\src]!
+ vld3.i32 {q13_h[0], q14_h[0], q15_h[0]}, [\src]
+
+ vmovn.i32 CO_R, q13
+ vmovn.i32 CO_G, q14
+ vmovn.i32 CO_B, q15
+
+ vmov.u8 BIAS_Y, #16
+ vmov.u8 BIAS_U, #128
+.endm
+
+
+.macro compute_y_16x1_step action, s8x16, coeff
+ vmov.u8 n16x16_o, #0
+ vtrn.u8 \s8x16, n16x16_o
+
+ \action y32x16_el, \s8x16\()_l, \coeff
+ \action y32x16_eh, \s8x16\()_h, \coeff
+ \action y32x16_ol, n16x16_ol, \coeff
+ \action y32x16_oh, n16x16_oh, \coeff
+.endm
+
+/*
+ * in: r8x16, g8x16, b8x16
+ * out: y8x16
+ * clobber: q11-q15, r8x16, g8x16, b8x16
+ */
+.macro compute_y_16x1
+ compute_y_16x1_step vmull, r8x16, CO_RY
+ compute_y_16x1_step vmlal, g8x16, CO_GY
+ compute_y_16x1_step vmlal, b8x16, CO_BY
+
+ vrshrn.i32 y16x16_el, y32x16_el, #15
+ vrshrn.i32 y16x16_eh, y32x16_eh, #15
+ vrshrn.i32 y16x16_ol, y32x16_ol, #15
+ vrshrn.i32 y16x16_oh, y32x16_oh, #15
+
+ vtrn.8 y16x16_e, y16x16_o
+ vadd.u8 y8x16, y8x16, BIAS_Y
+.endm
+
+alias c32x8_l, q14
+alias c32x8_h, q15
+
+alias_qw c16x8, q13
+alias_qw c8x8x2, q10
+
+.macro compute_chroma_8x1_step action, s16x8, coeff
+ \action c32x8_l, \s16x8\()_l, \coeff
+ \action c32x8_h, \s16x8\()_h, \coeff
+.endm
+
+/*
+ * in: r16x8, g16x8, b16x8
+ * out: c8x8
+ * clobber: q14-q15
+ */
+.macro compute_chroma_8x1 c, C
+ compute_chroma_8x1_step vmull, r16x8, CO_R\C
+ compute_chroma_8x1_step vmlal, g16x8, CO_G\C
+ compute_chroma_8x1_step vmlal, b16x8, CO_B\C
+
+ vrshrn.i32 c16x8_l, c32x8_l, #15
+ vrshrn.i32 c16x8_h, c32x8_h, #15
+ vmovn.i16 \c\()8x8, c16x8
+ vadd.u8 \c\()8x8, \c\()8x8, BIAS_\C
+.endm
+
+
+ loop_420sp rgbx, nv12, init, kernel_420_16x2, 32
diff --git a/chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_common.S b/chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_common.S
new file mode 100644
index 00000000000..30bcecd5bbe
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/arm/rgb2yuv_neon_common.S
@@ -0,0 +1,291 @@
+/*
+ * Copyright (C) 2013 Xiaolei Yu <dreifachstein@gmail.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 "libavutil/arm/asm.S"
+
+.macro alias name, tgt, set=1
+.if \set != 0
+ \name .req \tgt
+.else
+ .unreq \name
+.endif
+.endm
+
+.altmacro
+
+.macro alias_dw_all qw, dw_l, dw_h
+ alias q\qw\()_l, d\dw_l
+ alias q\qw\()_h, d\dw_h
+ .if \qw < 15
+ alias_dw_all %(\qw + 1), %(\dw_l + 2), %(\dw_h + 2)
+ .endif
+.endm
+
+alias_dw_all 0, 0, 1
+
+.noaltmacro
+
+.macro alias_qw name, qw, set=1
+ alias \name\(), \qw, \set
+ alias \name\()_l, \qw\()_l, \set
+ alias \name\()_h, \qw\()_h, \set
+.endm
+
+.macro prologue
+ push {r4-r12, lr}
+ vpush {q4-q7}
+.endm
+
+.macro epilogue
+ vpop {q4-q7}
+ pop {r4-r12, pc}
+.endm
+
+.macro load_arg reg, ix
+ ldr \reg, [sp, #((10 * 4 + 4 * 16) + (\ix - 4) * 4)]
+.endm
+
+
+/* ()_to_()_neon(const uint8_t *src, uint8_t *y, uint8_t *chroma
+ * int width, int height,
+ * int y_stride, int c_stride, int src_stride,
+ * int32_t coeff_table[9]);
+ */
+.macro alias_loop_420sp set=1
+ alias src, r0, \set
+ alias src0, src, \set
+ alias y, r1, \set
+ alias y0, y, \set
+ alias chroma, r2, \set
+ alias width, r3, \set
+ alias header, width, \set
+
+ alias height, r4, \set
+ alias y_stride, r5, \set
+ alias c_stride, r6, \set
+ alias c_padding, c_stride, \set
+ alias src_stride, r7, \set
+
+ alias y0_end, r8, \set
+
+ alias src_padding,r9, \set
+ alias y_padding, r10, \set
+
+ alias src1, r11, \set
+ alias y1, r12, \set
+
+ alias coeff_table,r12, \set
+.endm
+
+
+.macro loop_420sp s_fmt, d_fmt, init, kernel, precision
+
+function \s_fmt\()_to_\d_fmt\()_neon_\precision, export=1
+ prologue
+
+ alias_loop_420sp
+
+ load_arg height, 4
+ load_arg y_stride, 5
+ load_arg c_stride, 6
+ load_arg src_stride, 7
+ load_arg coeff_table, 8
+
+ \init coeff_table
+
+ sub y_padding, y_stride, width
+ sub c_padding, c_stride, width
+ sub src_padding, src_stride, width, LSL #2
+
+ add y0_end, y0, width
+ and header, width, #15
+
+ add y1, y0, y_stride
+ add src1, src0, src_stride
+
+0:
+ cmp header, #0
+ beq 1f
+
+ \kernel \s_fmt, \d_fmt, src0, src1, y0, y1, chroma, header
+
+1:
+ \kernel \s_fmt, \d_fmt, src0, src1, y0, y1, chroma
+
+ cmp y0, y0_end
+ blt 1b
+2:
+ add y0, y1, y_padding
+ add y0_end, y1, y_stride
+ add chroma, chroma, c_padding
+ add src0, src1, src_padding
+
+ add y1, y0, y_stride
+ add src1, src0, src_stride
+
+ subs height, height, #2
+
+ bgt 0b
+
+ epilogue
+
+ alias_loop_420sp 0
+
+endfunc
+.endm
+
+.macro downsample
+ vpaddl.u8 r16x8, r8x16
+ vpaddl.u8 g16x8, g8x16
+ vpaddl.u8 b16x8, b8x16
+.endm
+
+
+/* acculumate and right shift by 2 */
+.macro downsample_ars2
+ vpadal.u8 r16x8, r8x16
+ vpadal.u8 g16x8, g8x16
+ vpadal.u8 b16x8, b8x16
+
+ vrshr.u16 r16x8, r16x8, #2
+ vrshr.u16 g16x8, g16x8, #2
+ vrshr.u16 b16x8, b16x8, #2
+.endm
+
+.macro store_y8_16x1 dst, count
+.ifc "\count",""
+ vstmia \dst!, {y8x16}
+.else
+ vstmia \dst, {y8x16}
+ add \dst, \dst, \count
+.endif
+.endm
+
+.macro store_chroma_nv12_8x1 dst, count
+.ifc "\count",""
+ vst2.i8 {u8x8, v8x8}, [\dst]!
+.else
+ vst2.i8 {u8x8, v8x8}, [\dst], \count
+.endif
+.endm
+
+.macro store_chroma_nv21_8x1 dst, count
+.ifc "\count",""
+ vst2.i8 {v8x8, u8x8}, [\dst]!
+.else
+ vst2.i8 {v8x8, u8x8}, [\dst], \count
+.endif
+.endm
+
+.macro load_8888_16x1 a, b, c, d, src, count
+.ifc "\count",""
+ vld4.8 {\a\()8x16_l, \b\()8x16_l, \c\()8x16_l, \d\()8x16_l}, [\src]!
+ vld4.8 {\a\()8x16_h, \b\()8x16_h, \c\()8x16_h, \d\()8x16_h}, [\src]!
+.else
+ vld4.8 {\a\()8x16_l, \b\()8x16_l, \c\()8x16_l, \d\()8x16_l}, [\src]!
+ vld4.8 {\a\()8x16_h, \b\()8x16_h, \c\()8x16_h, \d\()8x16_h}, [\src]
+ sub \src, \src, #32
+ add \src, \src, \count, LSL #2
+.endif
+.endm
+
+.macro load_rgbx_16x1 src, count
+ load_8888_16x1 r, g, b, x, \src, \count
+.endm
+
+.macro load_bgrx_16x1 src, count
+ load_8888_16x1 b, g, r, x, \src, \count
+.endm
+
+.macro alias_src_rgbx set=1
+ alias_src_8888 r, g, b, x, \set
+.endm
+
+.macro alias_src_bgrx set=1
+ alias_src_8888 b, g, r, x, \set
+.endm
+
+.macro alias_dst_nv12 set=1
+ alias u8x8, c8x8x2_l, \set
+ alias v8x8, c8x8x2_h, \set
+.endm
+
+.macro alias_dst_nv21 set=1
+ alias v8x8, c8x8x2_l, \set
+ alias u8x8, c8x8x2_h, \set
+.endm
+
+
+// common aliases
+
+alias CO_R d0
+CO_RY .dn d0.s16[0]
+CO_RU .dn d0.s16[1]
+CO_RV .dn d0.s16[2]
+
+alias CO_G d1
+CO_GY .dn d1.s16[0]
+CO_GU .dn d1.s16[1]
+CO_GV .dn d1.s16[2]
+
+alias CO_B d2
+CO_BY .dn d2.s16[0]
+CO_BU .dn d2.s16[1]
+CO_BV .dn d2.s16[2]
+
+alias BIAS_U, d3
+alias BIAS_V, BIAS_U
+
+alias BIAS_Y, q2
+
+
+/* q3-q6 R8G8B8X8 x16 */
+
+.macro alias_src_8888 a, b, c, d, set
+ alias_qw \a\()8x16, q3, \set
+ alias_qw \b\()8x16, q4, \set
+ alias_qw \c\()8x16, q5, \set
+ alias_qw \d\()8x16, q6, \set
+.endm
+
+.macro kernel_420_16x2 rgb_fmt, yuv_fmt, rgb0, rgb1, y0, y1, chroma, count
+ alias_src_\rgb_fmt
+ alias_dst_\yuv_fmt
+
+ load_\rgb_fmt\()_16x1 \rgb0, \count
+
+ downsample
+ compute_y_16x1
+ store_y8_16x1 \y0, \count
+
+
+ load_\rgb_fmt\()_16x1 \rgb1, \count
+ downsample_ars2
+ compute_y_16x1
+ store_y8_16x1 \y1, \count
+
+ compute_chroma_8x1 u, U
+ compute_chroma_8x1 v, V
+
+ store_chroma_\yuv_fmt\()_8x1 \chroma, \count
+
+ alias_dst_\yuv_fmt 0
+ alias_src_\rgb_fmt 0
+.endm
diff --git a/chromium/third_party/ffmpeg/libswscale/arm/swscale_unscaled.c b/chromium/third_party/ffmpeg/libswscale/arm/swscale_unscaled.c
new file mode 100644
index 00000000000..04be7622bc9
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/arm/swscale_unscaled.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2013 Xiaolei Yu <dreifachstein@gmail.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 "config.h"
+#include "libswscale/swscale.h"
+#include "libswscale/swscale_internal.h"
+#include "libavutil/arm/cpu.h"
+
+extern void rgbx_to_nv12_neon_32(const uint8_t *src, uint8_t *y, uint8_t *chroma,
+ int width, int height,
+ int y_stride, int c_stride, int src_stride,
+ int32_t coeff_tbl[9]);
+
+extern void rgbx_to_nv12_neon_16(const uint8_t *src, uint8_t *y, uint8_t *chroma,
+ int width, int height,
+ int y_stride, int c_stride, int src_stride,
+ int32_t coeff_tbl[9]);
+
+static int rgbx_to_nv12_neon_32_wrapper(SwsContext *context, const uint8_t *src[],
+ int srcStride[], int srcSliceY, int srcSliceH,
+ uint8_t *dst[], int dstStride[]) {
+
+ rgbx_to_nv12_neon_32(src[0] + srcSliceY * srcStride[0],
+ dst[0] + srcSliceY * dstStride[0],
+ dst[1] + (srcSliceY / 2) * dstStride[1],
+ context->srcW, srcSliceH,
+ dstStride[0], dstStride[1], srcStride[0],
+ context->input_rgb2yuv_table);
+
+ return 0;
+}
+
+static int rgbx_to_nv12_neon_16_wrapper(SwsContext *context, const uint8_t *src[],
+ int srcStride[], int srcSliceY, int srcSliceH,
+ uint8_t *dst[], int dstStride[]) {
+
+ rgbx_to_nv12_neon_16(src[0] + srcSliceY * srcStride[0],
+ dst[0] + srcSliceY * dstStride[0],
+ dst[1] + (srcSliceY / 2) * dstStride[1],
+ context->srcW, srcSliceH,
+ dstStride[0], dstStride[1], srcStride[0],
+ context->input_rgb2yuv_table);
+
+ return 0;
+}
+
+static void get_unscaled_swscale_neon(SwsContext *c) {
+ int accurate_rnd = c->flags & SWS_ACCURATE_RND;
+ if (c->srcFormat == AV_PIX_FMT_RGBA
+ && c->dstFormat == AV_PIX_FMT_NV12
+ && (c->srcW >= 16)) {
+ c->swscale = accurate_rnd ? rgbx_to_nv12_neon_32_wrapper
+ : rgbx_to_nv12_neon_16_wrapper;
+ }
+}
+
+void ff_get_unscaled_swscale_arm(SwsContext *c)
+{
+ int cpu_flags = av_get_cpu_flags();
+ if (have_neon(cpu_flags))
+ get_unscaled_swscale_neon(c);
+}
diff --git a/chromium/third_party/ffmpeg/libswscale/bayer_template.c b/chromium/third_party/ffmpeg/libswscale/bayer_template.c
new file mode 100644
index 00000000000..67ab2aee09d
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/bayer_template.c
@@ -0,0 +1,236 @@
+/*
+ * Bayer-to-RGB/YV12 template
+ * Copyright (c) 2011-2014 Peter Ross <pross@xvid.org>
+ *
+ * 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
+ */
+
+#if defined(BAYER_BGGR) || defined(BAYER_GBRG)
+#define BAYER_R 0
+#define BAYER_G 1
+#define BAYER_B 2
+#endif
+#if defined(BAYER_RGGB) || defined(BAYER_GRBG)
+#define BAYER_R 2
+#define BAYER_G 1
+#define BAYER_B 0
+#endif
+
+#if defined(BAYER_8)
+#define BAYER_READ(x) (x)
+#define BAYER_SIZEOF 1
+#define BAYER_SHIFT 0
+#endif
+#if defined(BAYER_16LE)
+#define BAYER_READ(x) AV_RL16(&x)
+#define BAYER_SIZEOF 2
+#define BAYER_SHIFT 8
+#endif
+#if defined(BAYER_16BE)
+#define BAYER_READ(x) AV_RB16(&x)
+#define BAYER_SIZEOF 2
+#define BAYER_SHIFT 8
+#endif
+
+#define S(y, x) BAYER_READ(src[(y)*src_stride + BAYER_SIZEOF*(x)])
+#define T(y, x) (unsigned int)S(y, x)
+#define R(y, x) dst[(y)*dst_stride + (x)*3 + BAYER_R]
+#define G(y, x) dst[(y)*dst_stride + (x)*3 + BAYER_G]
+#define B(y, x) dst[(y)*dst_stride + (x)*3 + BAYER_B]
+
+#if defined(BAYER_BGGR) || defined(BAYER_RGGB)
+#define BAYER_TO_RGB24_COPY \
+ R(0, 0) = \
+ R(0, 1) = \
+ R(1, 1) = \
+ R(1, 0) = S(1, 1) >> BAYER_SHIFT; \
+ \
+ G(0, 1) = S(0, 1) >> BAYER_SHIFT; \
+ G(0, 0) = \
+ G(1, 1) = (T(0, 1) + T(1, 0)) >> (1 + BAYER_SHIFT); \
+ G(1, 0) = S(1, 0) >> BAYER_SHIFT; \
+ \
+ B(1, 1) = \
+ B(0, 0) = \
+ B(0, 1) = \
+ B(1, 0) = S(0, 0) >> BAYER_SHIFT;
+#define BAYER_TO_RGB24_INTERPOLATE \
+ R(0, 0) = (T(-1, -1) + T(-1, 1) + T(1, -1) + T(1, 1)) >> (2 + BAYER_SHIFT); \
+ G(0, 0) = (T(-1, 0) + T( 0, -1) + T(0, 1) + T(1, 0)) >> (2 + BAYER_SHIFT); \
+ B(0, 0) = S(0, 0) >> BAYER_SHIFT; \
+ \
+ R(0, 1) = (T(-1, 1) + T(1, 1)) >> (1 + BAYER_SHIFT); \
+ G(0, 1) = S(0, 1) >> BAYER_SHIFT; \
+ B(0, 1) = (T(0, 0) + T(0, 2)) >> (1 + BAYER_SHIFT); \
+ \
+ R(1, 0) = (T(1, -1) + T(1, 1)) >> (1 + BAYER_SHIFT); \
+ G(1, 0) = S(1, 0) >> BAYER_SHIFT; \
+ B(1, 0) = (T(0, 0) + T(2, 0)) >> (1 + BAYER_SHIFT); \
+ \
+ R(1, 1) = S(1, 1) >> BAYER_SHIFT; \
+ G(1, 1) = (T(0, 1) + T(1, 0) + T(1, 2) + T(2, 1)) >> (2 + BAYER_SHIFT); \
+ B(1, 1) = (T(0, 0) + T(0, 2) + T(2, 0) + T(2, 2)) >> (2 + BAYER_SHIFT);
+#else
+#define BAYER_TO_RGB24_COPY \
+ R(0, 0) = \
+ R(0, 1) = \
+ R(1, 1) = \
+ R(1, 0) = S(1, 0) >> BAYER_SHIFT; \
+ \
+ G(0, 0) = S(0, 0) >> BAYER_SHIFT; \
+ G(1, 1) = S(1, 1) >> BAYER_SHIFT; \
+ G(0, 1) = \
+ G(1, 0) = (T(0, 0) + T(1, 1)) >> (1 + BAYER_SHIFT); \
+ \
+ B(1, 1) = \
+ B(0, 0) = \
+ B(0, 1) = \
+ B(1, 0) = S(0, 1) >> BAYER_SHIFT;
+#define BAYER_TO_RGB24_INTERPOLATE \
+ R(0, 0) = (T(-1, 0) + T(1, 0)) >> (1 + BAYER_SHIFT); \
+ G(0, 0) = S(0, 0) >> BAYER_SHIFT; \
+ B(0, 0) = (T(0, -1) + T(0, 1)) >> (1 + BAYER_SHIFT); \
+ \
+ R(0, 1) = (T(-1, 0) + T(-1, 2) + T(1, 0) + T(1, 2)) >> (2 + BAYER_SHIFT); \
+ G(0, 1) = (T(-1, 1) + T(0, 0) + T(0, 2) + T(1, 1)) >> (2 + BAYER_SHIFT); \
+ B(0, 1) = S(0, 1) >> BAYER_SHIFT; \
+ \
+ R(1, 0) = S(1, 0) >> BAYER_SHIFT; \
+ G(1, 0) = (T(0, 0) + T(1, -1) + T(1, 1) + T(2, 0)) >> (2 + BAYER_SHIFT); \
+ B(1, 0) = (T(0, -1) + T(0, 1) + T(2, -1) + T(2, 1)) >> (2 + BAYER_SHIFT); \
+ \
+ R(1, 1) = (T(1, 0) + T(1, 2)) >> (1 + BAYER_SHIFT); \
+ G(1, 1) = S(1, 1) >> BAYER_SHIFT; \
+ B(1, 1) = (T(0, 1) + T(2, 1)) >> (1 + BAYER_SHIFT);
+#endif
+
+/**
+ * invoke ff_rgb24toyv12 for 2x2 pixels
+ */
+#define rgb24toyv12_2x2(src, dstY, dstU, dstV, luma_stride, src_stride, rgb2yuv) \
+ ff_rgb24toyv12(src, dstY, dstV, dstU, 2, 2, luma_stride, 0, src_stride, rgb2yuv)
+
+static void BAYER_RENAME(rgb24_copy)(const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int width)
+{
+ int i;
+ for (i = 0 ; i < width; i+= 2) {
+ BAYER_TO_RGB24_COPY
+ src += 2 * BAYER_SIZEOF;
+ dst += 6;
+ }
+}
+
+static void BAYER_RENAME(rgb24_interpolate)(const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int width)
+{
+ int i;
+
+ BAYER_TO_RGB24_COPY
+ src += 2 * BAYER_SIZEOF;
+ dst += 6;
+
+ for (i = 2 ; i < width - 2; i+= 2) {
+ BAYER_TO_RGB24_INTERPOLATE
+ src += 2 * BAYER_SIZEOF;
+ dst += 6;
+ }
+
+ if (width > 2) {
+ BAYER_TO_RGB24_COPY
+ }
+}
+
+static void BAYER_RENAME(yv12_copy)(const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, int32_t *rgb2yuv)
+{
+ uint8_t dst[12];
+ const int dst_stride = 6;
+ int i;
+ for (i = 0 ; i < width; i+= 2) {
+ BAYER_TO_RGB24_COPY
+ rgb24toyv12_2x2(dst, dstY, dstU, dstV, luma_stride, dst_stride, rgb2yuv);
+ src += 2 * BAYER_SIZEOF;
+ dstY += 2;
+ dstU++;
+ dstV++;
+ }
+}
+
+static void BAYER_RENAME(yv12_interpolate)(const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, int32_t *rgb2yuv)
+{
+ uint8_t dst[12];
+ const int dst_stride = 6;
+ int i;
+
+ BAYER_TO_RGB24_COPY
+ rgb24toyv12_2x2(dst, dstY, dstU, dstV, luma_stride, dst_stride, rgb2yuv);
+ src += 2 * BAYER_SIZEOF;
+ dstY += 2;
+ dstU++;
+ dstV++;
+
+ for (i = 2 ; i < width - 2; i+= 2) {
+ BAYER_TO_RGB24_INTERPOLATE
+ rgb24toyv12_2x2(dst, dstY, dstU, dstV, luma_stride, dst_stride, rgb2yuv);
+ src += 2 * BAYER_SIZEOF;
+ dstY += 2;
+ dstU++;
+ dstV++;
+ }
+
+ if (width > 2) {
+ BAYER_TO_RGB24_COPY
+ rgb24toyv12_2x2(dst, dstY, dstU, dstV, luma_stride, dst_stride, rgb2yuv);
+ }
+}
+
+#undef S
+#undef T
+#undef R
+#undef G
+#undef B
+#undef BAYER_TO_RGB24_COPY
+#undef BAYER_TO_RGB24_INTERPOLATE
+
+#undef BAYER_RENAME
+
+#undef BAYER_R
+#undef BAYER_G
+#undef BAYER_B
+#undef BAYER_READ
+#undef BAYER_SIZEOF
+#undef BAYER_SHIFT
+
+#if defined(BAYER_BGGR)
+#undef BAYER_BGGR
+#endif
+#if defined(BAYER_RGGB)
+#undef BAYER_RGGB
+#endif
+#if defined(BAYER_GBRG)
+#undef BAYER_GBRG
+#endif
+#if defined(BAYER_GRBG)
+#undef BAYER_GRBG
+#endif
+#if defined(BAYER_8)
+#undef BAYER_8
+#endif
+#if defined(BAYER_16LE)
+#undef BAYER_16LE
+#endif
+#if defined(BAYER_16BE)
+#undef BAYER_16BE
+#endif
diff --git a/chromium/third_party/ffmpeg/libswscale/bfin/internal_bfin.S b/chromium/third_party/ffmpeg/libswscale/bfin/internal_bfin.S
index eab30aa6ce5..5ea0f1f90e0 100644
--- a/chromium/third_party/ffmpeg/libswscale/bfin/internal_bfin.S
+++ b/chromium/third_party/ffmpeg/libswscale/bfin/internal_bfin.S
@@ -93,23 +93,9 @@ huge variation on the reference codes on Blackfin I guess it must have
to do with the memory system.
*/
-#define mL3 .text
-#if defined(__FDPIC__) && CONFIG_SRAM
-#define mL1 .l1.text
-#else
-#define mL1 mL3
-#endif
-#define MEM mL1
-
-#define DEFUN(fname,where,interface) \
- .section where; \
- .global _ff_bfin_ ## fname; \
- .type _ff_bfin_ ## fname, STT_FUNC; \
- .align 8; \
- _ff_bfin_ ## fname
+#include "libavutil/bfin/asm.h"
-#define DEFUN_END(fname) \
- .size _ff_bfin_ ## fname, . - _ff_bfin_ ## fname
+#define MEM mL1
.text
diff --git a/chromium/third_party/ffmpeg/libswscale/bfin/swscale_bfin.c b/chromium/third_party/ffmpeg/libswscale/bfin/swscale_bfin.c
index 33c3ec52014..147b3bf1e05 100644
--- a/chromium/third_party/ffmpeg/libswscale/bfin/swscale_bfin.c
+++ b/chromium/third_party/ffmpeg/libswscale/bfin/swscale_bfin.c
@@ -24,21 +24,18 @@
#include "config.h"
#include "libavutil/attributes.h"
+#include "libavutil/bfin/attributes.h"
#include "libswscale/swscale_internal.h"
-#if defined (__FDPIC__) && CONFIG_SRAM
-#define L1CODE __attribute__((l1_text))
-#else
-#define L1CODE
-#endif
-
int ff_bfin_uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
uint8_t *vdst, int width, int height,
- int lumStride, int chromStride, int srcStride) L1CODE;
+ int lumStride, int chromStride,
+ int srcStride) attribute_l1_text;
int ff_bfin_yuyvtoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
uint8_t *vdst, int width, int height,
- int lumStride, int chromStride, int srcStride) L1CODE;
+ int lumStride, int chromStride,
+ int srcStride) attribute_l1_text;
static int uyvytoyv12_unscaled(SwsContext *c, const uint8_t *src[],
int srcStride[], int srcSliceY, int srcSliceH,
diff --git a/chromium/third_party/ffmpeg/libswscale/bfin/yuv2rgb_bfin.c b/chromium/third_party/ffmpeg/libswscale/bfin/yuv2rgb_bfin.c
index 2a36ad55f72..6f4659f15b8 100644
--- a/chromium/third_party/ffmpeg/libswscale/bfin/yuv2rgb_bfin.c
+++ b/chromium/third_party/ffmpeg/libswscale/bfin/yuv2rgb_bfin.c
@@ -26,25 +26,20 @@
#include "config.h"
#include "libavutil/attributes.h"
+#include "libavutil/bfin/attributes.h"
#include "libswscale/swscale_internal.h"
-#if defined(__FDPIC__) && CONFIG_SRAM
-#define L1CODE __attribute__((l1_text))
-#else
-#define L1CODE
-#endif
-
void ff_bfin_yuv2rgb555_line(const uint8_t *Y, const uint8_t *U,
const uint8_t *V, uint8_t *out,
- int w, uint32_t *coeffs) L1CODE;
+ int w, uint32_t *coeffs) attribute_l1_text;
void ff_bfin_yuv2rgb565_line(const uint8_t *Y, const uint8_t *U,
const uint8_t *V, uint8_t *out,
- int w, uint32_t *coeffs) L1CODE;
+ int w, uint32_t *coeffs) attribute_l1_text;
void ff_bfin_yuv2rgb24_line(const uint8_t *Y, const uint8_t *U,
const uint8_t *V, uint8_t *out,
- int w, uint32_t *coeffs) L1CODE;
+ int w, uint32_t *coeffs) attribute_l1_text;
typedef void (*ltransform)(const uint8_t *Y, const uint8_t *U, const uint8_t *V,
uint8_t *out, int w, uint32_t *coeffs);
diff --git a/chromium/third_party/ffmpeg/libswscale/input.c b/chromium/third_party/ffmpeg/libswscale/input.c
index 919b232231f..3a2a12437a2 100644
--- a/chromium/third_party/ffmpeg/libswscale/input.c
+++ b/chromium/third_party/ffmpeg/libswscale/input.c
@@ -37,8 +37,8 @@
#define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos))
-#define r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE) ? b_r : r_b)
-#define b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE) ? r_b : b_r)
+#define r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? b_r : r_b)
+#define b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? r_b : b_r)
static av_always_inline void
rgb64ToY_c_template(uint16_t *dst, const uint16_t *src, int width,
@@ -124,6 +124,8 @@ static void pattern ## 64 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV
rgb64funcs(rgb, LE, AV_PIX_FMT_RGBA64LE)
rgb64funcs(rgb, BE, AV_PIX_FMT_RGBA64BE)
+rgb64funcs(bgr, LE, AV_PIX_FMT_BGRA64LE)
+rgb64funcs(bgr, BE, AV_PIX_FMT_BGRA64BE)
static av_always_inline void rgb48ToY_c_template(uint16_t *dst,
const uint16_t *src, int width,
@@ -529,7 +531,18 @@ static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, con
av_assert1(src1 == src2);
}
-static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width,
+static void yvy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1,
+ const uint8_t *src2, int width, uint32_t *unused)
+{
+ int i;
+ for (i = 0; i < width; i++) {
+ dstV[i] = src1[4 * i + 1];
+ dstU[i] = src1[4 * i + 3];
+ }
+ av_assert1(src1 == src2);
+}
+
+static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width,
uint32_t *unused)
{
int i;
@@ -816,6 +829,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YUYV422:
c->chrToYV12 = yuy2ToUV_c;
break;
+ case AV_PIX_FMT_YVYU422:
+ c->chrToYV12 = yvy2ToUV_c;
+ break;
case AV_PIX_FMT_UYVY422:
c->chrToYV12 = uyvyToUV_c;
break;
@@ -934,6 +950,12 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_RGBA64LE:
c->chrToYV12 = rgb64LEToUV_half_c;
break;
+ case AV_PIX_FMT_BGRA64BE:
+ c->chrToYV12 = bgr64BEToUV_half_c;
+ break;
+ case AV_PIX_FMT_BGRA64LE:
+ c->chrToYV12 = bgr64LEToUV_half_c;
+ break;
case AV_PIX_FMT_RGB48BE:
c->chrToYV12 = rgb48BEToUV_half_c;
break;
@@ -1013,6 +1035,12 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_RGBA64LE:
c->chrToYV12 = rgb64LEToUV_c;
break;
+ case AV_PIX_FMT_BGRA64BE:
+ c->chrToYV12 = bgr64BEToUV_c;
+ break;
+ case AV_PIX_FMT_BGRA64LE:
+ c->chrToYV12 = bgr64LEToUV_c;
+ break;
case AV_PIX_FMT_RGB48BE:
c->chrToYV12 = rgb48BEToUV_c;
break;
@@ -1188,6 +1216,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
break;
#endif
case AV_PIX_FMT_YUYV422:
+ case AV_PIX_FMT_YVYU422:
case AV_PIX_FMT_Y400A:
c->lumToYV12 = yuy2ToY_c;
break;
@@ -1279,6 +1308,11 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_RGBA64LE:
c->lumToYV12 = rgb64LEToY_c;
break;
+ case AV_PIX_FMT_BGRA64BE:
+ c->lumToYV12 = bgr64BEToY_c;
+ break;
+ case AV_PIX_FMT_BGRA64LE:
+ c->lumToYV12 = bgr64LEToY_c;
}
if (c->alpPixBuf) {
if (is16BPS(srcFormat) || isNBPS(srcFormat)) {
@@ -1286,6 +1320,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
c->alpToYV12 = bswap16Y_c;
}
switch (srcFormat) {
+ case AV_PIX_FMT_BGRA64LE:
+ case AV_PIX_FMT_BGRA64BE:
case AV_PIX_FMT_RGBA64LE:
case AV_PIX_FMT_RGBA64BE: c->alpToYV12 = rgba64ToA_c; break;
case AV_PIX_FMT_BGRA:
diff --git a/chromium/third_party/ffmpeg/libswscale/options.c b/chromium/third_party/ffmpeg/libswscale/options.c
index 9e8703ff396..5433d55b9bd 100644
--- a/chromium/third_party/ffmpeg/libswscale/options.c
+++ b/chromium/third_party/ffmpeg/libswscale/options.c
@@ -69,10 +69,12 @@ static const AVOption swscale_options[] = {
{ "dst_v_chr_pos", "destination vertical chroma position in luma grid/256" , OFFSET(dst_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 512, VE },
{ "dst_h_chr_pos", "destination horizontal chroma position in luma grid/256", OFFSET(dst_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 512, VE },
- { "sws_dither", "set dithering algorithm", OFFSET(dither), AV_OPT_TYPE_INT, { .i64 = SWS_DITHER_AUTO }, 0, NB_SWS_DITHER, VE, "sws_dither" },
- { "auto", "leave choice to sws", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_AUTO }, INT_MIN, INT_MAX, VE, "sws_dither" },
- { "bayer", "bayer dither", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_BAYER }, INT_MIN, INT_MAX, VE, "sws_dither" },
- { "ed", "error diffusion", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_ED }, INT_MIN, INT_MAX, VE, "sws_dither" },
+ { "sws_dither", "set dithering algorithm", OFFSET(dither), AV_OPT_TYPE_INT, { .i64 = SWS_DITHER_AUTO }, 0, NB_SWS_DITHER, VE, "sws_dither" },
+ { "auto", "leave choice to sws", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_AUTO }, INT_MIN, INT_MAX, VE, "sws_dither" },
+ { "bayer", "bayer dither", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_BAYER }, INT_MIN, INT_MAX, VE, "sws_dither" },
+ { "ed", "error diffusion", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_ED }, INT_MIN, INT_MAX, VE, "sws_dither" },
+ { "a_dither", "arithmetic addition dither", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_A_DITHER}, INT_MIN, INT_MAX, VE, "sws_dither" },
+ { "x_dither", "arithmetic xor dither", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_X_DITHER}, INT_MIN, INT_MAX, VE, "sws_dither" },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libswscale/output.c b/chromium/third_party/ffmpeg/libswscale/output.c
index ddb0d0c19e1..eee6b4874b2 100644
--- a/chromium/third_party/ffmpeg/libswscale/output.c
+++ b/chromium/third_party/ffmpeg/libswscale/output.c
@@ -526,7 +526,12 @@ YUV2PACKEDWRAPPER(yuv2mono,, black, AV_PIX_FMT_MONOBLACK)
dest[pos + 1] = U; \
dest[pos + 2] = Y2; \
dest[pos + 3] = V; \
- } else { \
+ } else if (target == AV_PIX_FMT_YVYU422) { \
+ dest[pos + 0] = Y1; \
+ dest[pos + 1] = V; \
+ dest[pos + 2] = Y2; \
+ dest[pos + 3] = U; \
+ } else { /* AV_PIX_FMT_UYVY422 */ \
dest[pos + 0] = U; \
dest[pos + 1] = Y1; \
dest[pos + 2] = V; \
@@ -661,10 +666,11 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
#undef output_pixels
YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, AV_PIX_FMT_YUYV422)
+YUV2PACKEDWRAPPER(yuv2, 422, yvyu422, AV_PIX_FMT_YVYU422)
YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, AV_PIX_FMT_UYVY422)
-#define R_B ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE) ? R : B)
-#define B_R ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE) ? B : R)
+#define R_B ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE || target == AV_PIX_FMT_RGBA64LE || target == AV_PIX_FMT_RGBA64BE) ? R : B)
+#define B_R ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE || target == AV_PIX_FMT_RGBA64LE || target == AV_PIX_FMT_RGBA64BE) ? B : R)
#define output_pixel(pos, val) \
if (isBE(target)) { \
AV_WB16(pos, val); \
@@ -735,13 +741,13 @@ yuv2rgba64_X_c_template(SwsContext *c, const int16_t *lumFilter,
B = U * c->yuv2rgb_u2b_coeff;
// 8bit: 30 - 22 = 8bit, 16bit: 30bit - 14 = 16bit
- output_pixel(&dest[0], av_clip_uintp2(B_R + Y1, 30) >> 14);
+ output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
- output_pixel(&dest[2], av_clip_uintp2(R_B + Y1, 30) >> 14);
+ output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14);
- output_pixel(&dest[4], av_clip_uintp2(B_R + Y2, 30) >> 14);
+ output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14);
output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
- output_pixel(&dest[6], av_clip_uintp2(R_B + Y2, 30) >> 14);
+ output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14);
output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14);
dest += 8;
}
@@ -790,13 +796,13 @@ yuv2rgba64_2_c_template(SwsContext *c, const int32_t *buf[2],
A2 += 1 << 13;
}
- output_pixel(&dest[0], av_clip_uintp2(B_R + Y1, 30) >> 14);
+ output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
- output_pixel(&dest[2], av_clip_uintp2(R_B + Y1, 30) >> 14);
+ output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14);
- output_pixel(&dest[4], av_clip_uintp2(B_R + Y2, 30) >> 14);
+ output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14);
output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
- output_pixel(&dest[6], av_clip_uintp2(R_B + Y2, 30) >> 14);
+ output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14);
output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14);
dest += 8;
}
@@ -839,13 +845,13 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0,
G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
B = U * c->yuv2rgb_u2b_coeff;
- output_pixel(&dest[0], av_clip_uintp2(B_R + Y1, 30) >> 14);
+ output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
- output_pixel(&dest[2], av_clip_uintp2(R_B + Y1, 30) >> 14);
+ output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14);
- output_pixel(&dest[4], av_clip_uintp2(B_R + Y2, 30) >> 14);
+ output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14);
output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
- output_pixel(&dest[6], av_clip_uintp2(R_B + Y2, 30) >> 14);
+ output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14);
output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14);
dest += 8;
}
@@ -878,13 +884,13 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0,
G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
B = U * c->yuv2rgb_u2b_coeff;
- output_pixel(&dest[0], av_clip_uintp2(B_R + Y1, 30) >> 14);
+ output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
- output_pixel(&dest[2], av_clip_uintp2(R_B + Y1, 30) >> 14);
+ output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14);
- output_pixel(&dest[4], av_clip_uintp2(B_R + Y2, 30) >> 14);
+ output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14);
output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
- output_pixel(&dest[6], av_clip_uintp2(R_B + Y2, 30) >> 14);
+ output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14);
output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14);
dest += 8;
}
@@ -1117,6 +1123,10 @@ YUV2PACKED16WRAPPER(yuv2, rgba64, rgba64be, AV_PIX_FMT_RGBA64BE, 1)
YUV2PACKED16WRAPPER(yuv2, rgba64, rgba64le, AV_PIX_FMT_RGBA64LE, 1)
YUV2PACKED16WRAPPER(yuv2, rgba64, rgbx64be, AV_PIX_FMT_RGBA64BE, 0)
YUV2PACKED16WRAPPER(yuv2, rgba64, rgbx64le, AV_PIX_FMT_RGBA64LE, 0)
+YUV2PACKED16WRAPPER(yuv2, rgba64, bgra64be, AV_PIX_FMT_BGRA64BE, 1)
+YUV2PACKED16WRAPPER(yuv2, rgba64, bgra64le, AV_PIX_FMT_BGRA64LE, 1)
+YUV2PACKED16WRAPPER(yuv2, rgba64, bgrx64be, AV_PIX_FMT_BGRA64BE, 0)
+YUV2PACKED16WRAPPER(yuv2, rgba64, bgrx64le, AV_PIX_FMT_BGRA64LE, 0)
/*
* Write out 2 RGB pixels in the target pixel format. This function takes a
@@ -1508,24 +1518,71 @@ static av_always_inline void yuv2rgb_write_full(SwsContext *c,
case AV_PIX_FMT_RGB8:
{
int r,g,b;
- R >>= 22;
- G >>= 22;
- B >>= 22;
- R += (7*err[0] + 1*c->dither_error[0][i] + 5*c->dither_error[0][i+1] + 3*c->dither_error[0][i+2])>>4;
- G += (7*err[1] + 1*c->dither_error[1][i] + 5*c->dither_error[1][i+1] + 3*c->dither_error[1][i+2])>>4;
- B += (7*err[2] + 1*c->dither_error[2][i] + 5*c->dither_error[2][i+1] + 3*c->dither_error[2][i+2])>>4;
- c->dither_error[0][i] = err[0];
- c->dither_error[1][i] = err[1];
- c->dither_error[2][i] = err[2];
- r = R >> (isrgb8 ? 5 : 7);
- g = G >> (isrgb8 ? 5 : 6);
- b = B >> (isrgb8 ? 6 : 7);
- r = av_clip(r, 0, isrgb8 ? 7 : 1);
- g = av_clip(g, 0, isrgb8 ? 7 : 3);
- b = av_clip(b, 0, isrgb8 ? 3 : 1);
- err[0] = R - r*(isrgb8 ? 36 : 255);
- err[1] = G - g*(isrgb8 ? 36 : 85);
- err[2] = B - b*(isrgb8 ? 85 : 255);
+
+ switch (c->dither) {
+ default:
+ case SWS_DITHER_AUTO:
+ case SWS_DITHER_ED:
+ R >>= 22;
+ G >>= 22;
+ B >>= 22;
+ R += (7*err[0] + 1*c->dither_error[0][i] + 5*c->dither_error[0][i+1] + 3*c->dither_error[0][i+2])>>4;
+ G += (7*err[1] + 1*c->dither_error[1][i] + 5*c->dither_error[1][i+1] + 3*c->dither_error[1][i+2])>>4;
+ B += (7*err[2] + 1*c->dither_error[2][i] + 5*c->dither_error[2][i+1] + 3*c->dither_error[2][i+2])>>4;
+ c->dither_error[0][i] = err[0];
+ c->dither_error[1][i] = err[1];
+ c->dither_error[2][i] = err[2];
+ r = R >> (isrgb8 ? 5 : 7);
+ g = G >> (isrgb8 ? 5 : 6);
+ b = B >> (isrgb8 ? 6 : 7);
+ r = av_clip(r, 0, isrgb8 ? 7 : 1);
+ g = av_clip(g, 0, isrgb8 ? 7 : 3);
+ b = av_clip(b, 0, isrgb8 ? 3 : 1);
+ err[0] = R - r*(isrgb8 ? 36 : 255);
+ err[1] = G - g*(isrgb8 ? 36 : 85);
+ err[2] = B - b*(isrgb8 ? 85 : 255);
+ break;
+ case SWS_DITHER_A_DITHER:
+ if (isrgb8) {
+ /* see http://pippin.gimp.org/a_dither/ for details/origin */
+#define A_DITHER(u,v) (((((u)+((v)*236))*119)&0xff))
+ r = (((R >> 19) + A_DITHER(i,y) -96)>>8);
+ g = (((G >> 19) + A_DITHER(i + 17,y) - 96)>>8);
+ b = (((B >> 20) + A_DITHER(i + 17*2,y) -96)>>8);
+ r = av_clip(r, 0, 7);
+ g = av_clip(g, 0, 7);
+ b = av_clip(b, 0, 3);
+ } else {
+ r = (((R >> 21) + A_DITHER(i,y)-256)>>8);
+ g = (((G >> 19) + A_DITHER(i + 17,y)-256)>>8);
+ b = (((B >> 21) + A_DITHER(i + 17*2,y)-256)>>8);
+ r = av_clip(r, 0, 1);
+ g = av_clip(g, 0, 3);
+ b = av_clip(b, 0, 1);
+ }
+ break;
+ case SWS_DITHER_X_DITHER:
+ if (isrgb8) {
+ /* see http://pippin.gimp.org/a_dither/ for details/origin */
+#define X_DITHER(u,v) (((((u)^((v)*237))*181)&0x1ff)/2)
+ r = (((R >> 19) + X_DITHER(i,y) - 96)>>8);
+ g = (((G >> 19) + X_DITHER(i + 17,y) - 96)>>8);
+ b = (((B >> 20) + X_DITHER(i + 17*2,y) - 96)>>8);
+ r = av_clip(r, 0, 7);
+ g = av_clip(g, 0, 7);
+ b = av_clip(b, 0, 3);
+ } else {
+ r = (((R >> 21) + X_DITHER(i,y)-256)>>8);
+ g = (((G >> 19) + X_DITHER(i + 17,y)-256)>>8);
+ b = (((B >> 21) + X_DITHER(i + 17*2,y)-256)>>8);
+ r = av_clip(r, 0, 1);
+ g = av_clip(g, 0, 3);
+ b = av_clip(b, 0, 1);
+ }
+
+ break;
+ }
+
if(target == AV_PIX_FMT_BGR4_BYTE) {
dest[0] = r + 2*g + 8*b;
} else if(target == AV_PIX_FMT_RGB4_BYTE) {
@@ -1994,6 +2051,34 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
*yuv2packedX = yuv2rgbx64be_X_c;
}
break;
+ case AV_PIX_FMT_BGRA64LE:
+#if CONFIG_SWSCALE_ALPHA
+ if (c->alpPixBuf) {
+ *yuv2packed1 = yuv2bgra64le_1_c;
+ *yuv2packed2 = yuv2bgra64le_2_c;
+ *yuv2packedX = yuv2bgra64le_X_c;
+ } else
+#endif /* CONFIG_SWSCALE_ALPHA */
+ {
+ *yuv2packed1 = yuv2bgrx64le_1_c;
+ *yuv2packed2 = yuv2bgrx64le_2_c;
+ *yuv2packedX = yuv2bgrx64le_X_c;
+ }
+ break;
+ case AV_PIX_FMT_BGRA64BE:
+#if CONFIG_SWSCALE_ALPHA
+ if (c->alpPixBuf) {
+ *yuv2packed1 = yuv2bgra64be_1_c;
+ *yuv2packed2 = yuv2bgra64be_2_c;
+ *yuv2packedX = yuv2bgra64be_X_c;
+ } else
+#endif /* CONFIG_SWSCALE_ALPHA */
+ {
+ *yuv2packed1 = yuv2bgrx64be_1_c;
+ *yuv2packed2 = yuv2bgrx64be_2_c;
+ *yuv2packedX = yuv2bgrx64be_X_c;
+ }
+ break;
case AV_PIX_FMT_RGB48LE:
*yuv2packed1 = yuv2rgb48le_1_c;
*yuv2packed2 = yuv2rgb48le_2_c;
@@ -2126,6 +2211,11 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
*yuv2packed2 = yuv2yuyv422_2_c;
*yuv2packedX = yuv2yuyv422_X_c;
break;
+ case AV_PIX_FMT_YVYU422:
+ *yuv2packed1 = yuv2yvyu422_1_c;
+ *yuv2packed2 = yuv2yvyu422_2_c;
+ *yuv2packedX = yuv2yvyu422_X_c;
+ break;
case AV_PIX_FMT_UYVY422:
*yuv2packed1 = yuv2uyvy422_1_c;
*yuv2packed2 = yuv2uyvy422_2_c;
diff --git a/chromium/third_party/ffmpeg/libswscale/rgb2rgb.c b/chromium/third_party/ffmpeg/libswscale/rgb2rgb.c
index cf877fbae0a..5b1fcf73ca6 100644
--- a/chromium/third_party/ffmpeg/libswscale/rgb2rgb.c
+++ b/chromium/third_party/ffmpeg/libswscale/rgb2rgb.c
@@ -84,8 +84,8 @@ void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
int width, int height, int src1Stride,
int src2Stride, int dstStride);
void (*deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
- int width, int height, int srcStride,
- int dst1Stride, int dst2Stride);
+ int width, int height, int srcStride,
+ int dst1Stride, int dst2Stride);
void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
uint8_t *dst1, uint8_t *dst2,
int width, int height,
diff --git a/chromium/third_party/ffmpeg/libswscale/rgb2rgb_template.c b/chromium/third_party/ffmpeg/libswscale/rgb2rgb_template.c
index 56e735f6ca6..121f4ef2e58 100644
--- a/chromium/third_party/ffmpeg/libswscale/rgb2rgb_template.c
+++ b/chromium/third_party/ffmpeg/libswscale/rgb2rgb_template.c
@@ -705,7 +705,7 @@ static void deinterleaveBytes_c(const uint8_t *src, uint8_t *dst1, uint8_t *dst2
dst1[w] = src[2 * w + 0];
dst2[w] = src[2 * w + 1];
}
- src += srcStride;
+ src += srcStride;
dst1 += dst1Stride;
dst2 += dst2Stride;
}
diff --git a/chromium/third_party/ffmpeg/libswscale/sparc/Makefile b/chromium/third_party/ffmpeg/libswscale/sparc/Makefile
deleted file mode 100644
index 2351ba45caf..00000000000
--- a/chromium/third_party/ffmpeg/libswscale/sparc/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-VIS-OBJS += sparc/yuv2rgb_vis.o \
diff --git a/chromium/third_party/ffmpeg/libswscale/sparc/yuv2rgb_vis.c b/chromium/third_party/ffmpeg/libswscale/sparc/yuv2rgb_vis.c
deleted file mode 100644
index ed008377adb..00000000000
--- a/chromium/third_party/ffmpeg/libswscale/sparc/yuv2rgb_vis.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * VIS optimized software YUV to RGB converter
- * Copyright (c) 2007 Denes Balatoni <dbalatoni@programozo.hu>
- *
- * 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 <inttypes.h>
-#include <stdlib.h>
-
-#include "libavutil/attributes.h"
-#include "libswscale/swscale.h"
-#include "libswscale/swscale_internal.h"
-
-#define YUV2RGB_INIT \
- "wr %%g0, 0x10, %%gsr \n\t" \
- "ldd [%5], %%f32 \n\t" \
- "ldd [%5 + 8], %%f34 \n\t" \
- "ldd [%5 + 16], %%f36 \n\t" \
- "ldd [%5 + 24], %%f38 \n\t" \
- "ldd [%5 + 32], %%f40 \n\t" \
- "ldd [%5 + 40], %%f42 \n\t" \
- "ldd [%5 + 48], %%f44 \n\t" \
- "ldd [%5 + 56], %%f46 \n\t" \
- "ldd [%5 + 64], %%f48 \n\t" \
- "ldd [%5 + 72], %%f50 \n\t"
-
-#define YUV2RGB_KERNEL \
- /* ^^^^ f0=Y f3=u f5=v */ \
- "fmul8x16 %%f3, %%f48, %%f6 \n\t" \
- "fmul8x16 %%f19, %%f48, %%f22 \n\t" \
- "fmul8x16 %%f5, %%f44, %%f8 \n\t" \
- "fmul8x16 %%f21, %%f44, %%f24 \n\t" \
- "fmul8x16 %%f0, %%f42, %%f0 \n\t" \
- "fmul8x16 %%f16, %%f42, %%f16 \n\t" \
- "fmul8x16 %%f3, %%f50, %%f2 \n\t" \
- "fmul8x16 %%f19, %%f50, %%f18 \n\t" \
- "fmul8x16 %%f5, %%f46, %%f4 \n\t" \
- "fmul8x16 %%f21, %%f46, %%f20 \n\t" \
- \
- "fpsub16 %%f6, %%f34, %%f6 \n\t" /* 1 */ \
- "fpsub16 %%f22, %%f34, %%f22 \n\t" /* 1 */ \
- "fpsub16 %%f8, %%f38, %%f8 \n\t" /* 3 */ \
- "fpsub16 %%f24, %%f38, %%f24 \n\t" /* 3 */ \
- "fpsub16 %%f0, %%f32, %%f0 \n\t" /* 0 */ \
- "fpsub16 %%f16, %%f32, %%f16 \n\t" /* 0 */ \
- "fpsub16 %%f2, %%f36, %%f2 \n\t" /* 2 */ \
- "fpsub16 %%f18, %%f36, %%f18 \n\t" /* 2 */ \
- "fpsub16 %%f4, %%f40, %%f4 \n\t" /* 4 */ \
- "fpsub16 %%f20, %%f40, %%f20 \n\t" /* 4 */ \
- \
- "fpadd16 %%f0, %%f8, %%f8 \n\t" /* Gt */ \
- "fpadd16 %%f16, %%f24, %%f24 \n\t" /* Gt */ \
- "fpadd16 %%f0, %%f4, %%f4 \n\t" /* R */ \
- "fpadd16 %%f16, %%f20, %%f20 \n\t" /* R */ \
- "fpadd16 %%f0, %%f6, %%f6 \n\t" /* B */ \
- "fpadd16 %%f16, %%f22, %%f22 \n\t" /* B */ \
- "fpadd16 %%f8, %%f2, %%f2 \n\t" /* G */ \
- "fpadd16 %%f24, %%f18, %%f18 \n\t" /* G */ \
- \
- "fpack16 %%f4, %%f4 \n\t" \
- "fpack16 %%f20, %%f20 \n\t" \
- "fpack16 %%f6, %%f6 \n\t" \
- "fpack16 %%f22, %%f22 \n\t" \
- "fpack16 %%f2, %%f2 \n\t" \
- "fpack16 %%f18, %%f18 \n\t"
-
-// FIXME: must be changed to set alpha to 255 instead of 0
-static int vis_420P_ARGB32(SwsContext *c, uint8_t *src[], int srcStride[],
- int srcSliceY, int srcSliceH,
- uint8_t *dst[], int dstStride[])
-{
- int y, out1, out2, out3, out4, out5, out6;
-
- for (y = 0; y < srcSliceH; ++y)
- __asm__ volatile (
- YUV2RGB_INIT
- "wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */
- "1: \n\t"
- "ldda [%1] %%asi, %%f2 \n\t"
- "ldda [%1 + 2] %%asi, %%f18 \n\t"
- "ldda [%2] %%asi, %%f4 \n\t"
- "ldda [%2 + 2] %%asi, %%f20 \n\t"
- "ld [%0], %%f0 \n\t"
- "ld [%0+4], %%f16 \n\t"
- "fpmerge %%f3, %%f3, %%f2 \n\t"
- "fpmerge %%f19, %%f19, %%f18 \n\t"
- "fpmerge %%f5, %%f5, %%f4 \n\t"
- "fpmerge %%f21, %%f21, %%f20 \n\t"
- YUV2RGB_KERNEL
- "fzero %%f0 \n\t"
- "fpmerge %%f4, %%f6, %%f8 \n\t" // r, b, t1
- "fpmerge %%f20, %%f22, %%f24 \n\t" // r, b, t1
- "fpmerge %%f0, %%f2, %%f10 \n\t" // 0, g, t2
- "fpmerge %%f0, %%f18, %%f26 \n\t" // 0, g, t2
- "fpmerge %%f10, %%f8, %%f4 \n\t" // t2, t1, msb
- "fpmerge %%f26, %%f24, %%f20 \n\t" // t2, t1, msb
- "fpmerge %%f11, %%f9, %%f6 \n\t" // t2, t1, lsb
- "fpmerge %%f27, %%f25, %%f22 \n\t" // t2, t1, lsb
- "std %%f4, [%3] \n\t"
- "std %%f20, [%3 + 16] \n\t"
- "std %%f6, [%3 + 8] \n\t"
- "std %%f22, [%3 + 24] \n\t"
-
- "add %0, 8, %0 \n\t"
- "add %1, 4, %1 \n\t"
- "add %2, 4, %2 \n\t"
- "subcc %4, 8, %4 \n\t"
- "bne 1b \n\t"
- "add %3, 32, %3 \n\t" // delay slot
- : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5), "=r" (out6)
- : "0" (src[0] + (y + srcSliceY) * srcStride[0]), "1" (src[1] + ((y + srcSliceY) >> 1) * srcStride[1]),
- "2" (src[2] + ((y + srcSliceY) >> 1) * srcStride[2]), "3" (dst[0] + (y + srcSliceY) * dstStride[0]),
- "4" (c->dstW),
- "5" (c->sparc_coeffs)
- );
-
- return srcSliceH;
-}
-
-// FIXME: must be changed to set alpha to 255 instead of 0
-static int vis_422P_ARGB32(SwsContext *c, uint8_t *src[], int srcStride[],
- int srcSliceY, int srcSliceH,
- uint8_t *dst[], int dstStride[])
-{
- int y, out1, out2, out3, out4, out5, out6;
-
- for (y = 0; y < srcSliceH; ++y)
- __asm__ volatile (
- YUV2RGB_INIT
- "wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */
- "1: \n\t"
- "ldda [%1] %%asi, %%f2 \n\t"
- "ldda [%1 + 2] %%asi, %%f18 \n\t"
- "ldda [%2] %%asi, %%f4 \n\t"
- "ldda [%2 + 2] %%asi, %%f20 \n\t"
- "ld [%0], %%f0 \n\t"
- "ld [%0 + 4], %%f16 \n\t"
- "fpmerge %%f3, %%f3, %%f2 \n\t"
- "fpmerge %%f19, %%f19, %%f18 \n\t"
- "fpmerge %%f5, %%f5, %%f4 \n\t"
- "fpmerge %%f21, %%f21, %%f20 \n\t"
- YUV2RGB_KERNEL
- "fzero %%f0 \n\t"
- "fpmerge %%f4, %%f6, %%f8 \n\t" // r,b,t1
- "fpmerge %%f20, %%f22, %%f24 \n\t" // r,b,t1
- "fpmerge %%f0, %%f2, %%f10 \n\t" // 0,g,t2
- "fpmerge %%f0, %%f18, %%f26 \n\t" // 0,g,t2
- "fpmerge %%f10, %%f8, %%f4 \n\t" // t2,t1,msb
- "fpmerge %%f26, %%f24, %%f20 \n\t" // t2,t1,msb
- "fpmerge %%f11, %%f9, %%f6 \n\t" // t2,t1,lsb
- "fpmerge %%f27, %%f25, %%f22 \n\t" // t2,t1,lsb
- "std %%f4, [%3] \n\t"
- "std %%f20, [%3 + 16] \n\t"
- "std %%f6, [%3 + 8] \n\t"
- "std %%f22, [%3 + 24] \n\t"
-
- "add %0, 8, %0 \n\t"
- "add %1, 4, %1 \n\t"
- "add %2, 4, %2 \n\t"
- "subcc %4, 8, %4 \n\t"
- "bne 1b \n\t"
- "add %3, 32, %3 \n\t" //delay slot
- : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5), "=r" (out6)
- : "0" (src[0] + (y + srcSliceY) * srcStride[0]), "1" (src[1] + (y + srcSliceY) * srcStride[1]),
- "2" (src[2] + (y + srcSliceY) * srcStride[2]), "3" (dst[0] + (y + srcSliceY) * dstStride[0]),
- "4" (c->dstW),
- "5" (c->sparc_coeffs)
- );
-
- return srcSliceH;
-}
-
-av_cold SwsFunc ff_yuv2rgb_init_vis(SwsContext *c)
-{
- c->sparc_coeffs[5] = c->yCoeff;
- c->sparc_coeffs[6] = c->vgCoeff;
- c->sparc_coeffs[7] = c->vrCoeff;
- c->sparc_coeffs[8] = c->ubCoeff;
- c->sparc_coeffs[9] = c->ugCoeff;
-
- c->sparc_coeffs[0] = (((int16_t)c->yOffset * (int16_t)c->yCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
- c->sparc_coeffs[1] = (((int16_t)c->uOffset * (int16_t)c->ubCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
- c->sparc_coeffs[2] = (((int16_t)c->uOffset * (int16_t)c->ugCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
- c->sparc_coeffs[3] = (((int16_t)c->vOffset * (int16_t)c->vgCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
- c->sparc_coeffs[4] = (((int16_t)c->vOffset * (int16_t)c->vrCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
-
- if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV422P && (c->dstW & 7) == 0) {
- av_log(c, AV_LOG_INFO,
- "SPARC VIS accelerated YUV422P -> RGB32 (WARNING: alpha value is wrong)\n");
- return vis_422P_ARGB32;
- } else if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV420P && (c->dstW & 7) == 0) {
- av_log(c, AV_LOG_INFO,
- "SPARC VIS accelerated YUV420P -> RGB32 (WARNING: alpha value is wrong)\n");
- return vis_420P_ARGB32;
- }
- return NULL;
-}
diff --git a/chromium/third_party/ffmpeg/libswscale/swscale.c b/chromium/third_party/ffmpeg/libswscale/swscale.c
index 710dce33300..56fa1ee8ebe 100644
--- a/chromium/third_party/ffmpeg/libswscale/swscale.c
+++ b/chromium/third_party/ffmpeg/libswscale/swscale.c
@@ -208,8 +208,9 @@ static void lumRangeToJpeg16_c(int16_t *_dst, int width)
{
int i;
int32_t *dst = (int32_t *) _dst;
- for (i = 0; i < width; i++)
- dst[i] = (FFMIN(dst[i], 30189 << 4) * 4769 - (39057361 << 2)) >> 12;
+ for (i = 0; i < width; i++) {
+ dst[i] = ((int)(FFMIN(dst[i], 30189 << 4) * 4769U - (39057361 << 2))) >> 12;
+ }
}
static void lumRangeFromJpeg16_c(int16_t *_dst, int width)
@@ -704,6 +705,31 @@ static int swscale(SwsContext *c, const uint8_t *src[],
return dstY - lastDstY;
}
+av_cold void ff_sws_init_range_convert(SwsContext *c)
+{
+ c->lumConvertRange = NULL;
+ c->chrConvertRange = NULL;
+ if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
+ if (c->dstBpc <= 14) {
+ if (c->srcRange) {
+ c->lumConvertRange = lumRangeFromJpeg_c;
+ c->chrConvertRange = chrRangeFromJpeg_c;
+ } else {
+ c->lumConvertRange = lumRangeToJpeg_c;
+ c->chrConvertRange = chrRangeToJpeg_c;
+ }
+ } else {
+ if (c->srcRange) {
+ c->lumConvertRange = lumRangeFromJpeg16_c;
+ c->chrConvertRange = chrRangeFromJpeg16_c;
+ } else {
+ c->lumConvertRange = lumRangeToJpeg16_c;
+ c->chrConvertRange = chrRangeToJpeg16_c;
+ }
+ }
+ }
+}
+
static av_cold void sws_init_swscale(SwsContext *c)
{
enum AVPixelFormat srcFormat = c->srcFormat;
@@ -730,25 +756,7 @@ static av_cold void sws_init_swscale(SwsContext *c)
: hScale16To15_c;
}
- if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
- if (c->dstBpc <= 14) {
- if (c->srcRange) {
- c->lumConvertRange = lumRangeFromJpeg_c;
- c->chrConvertRange = chrRangeFromJpeg_c;
- } else {
- c->lumConvertRange = lumRangeToJpeg_c;
- c->chrConvertRange = chrRangeToJpeg_c;
- }
- } else {
- if (c->srcRange) {
- c->lumConvertRange = lumRangeFromJpeg16_c;
- c->chrConvertRange = chrRangeFromJpeg16_c;
- } else {
- c->lumConvertRange = lumRangeToJpeg16_c;
- c->chrConvertRange = chrRangeToJpeg16_c;
- }
- }
- }
+ ff_sws_init_range_convert(c);
if (!(isGray(srcFormat) || isGray(c->dstFormat) ||
srcFormat == AV_PIX_FMT_MONOBLACK || srcFormat == AV_PIX_FMT_MONOWHITE))
@@ -854,7 +862,7 @@ static void rgb48Toxyz12(struct SwsContext *c, uint16_t *dst,
const uint16_t *src, int stride, int h)
{
int xp,yp;
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->dstFormat);
for (yp=0; yp<h; yp++) {
for (xp=0; xp+2<stride; xp+=3) {
@@ -921,7 +929,7 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
uint8_t *dst2[4];
uint8_t *rgb0_tmp = NULL;
- if (!srcSlice || !dstStride || !dst || !srcSlice) {
+ if (!srcStride || !dstStride || !dst || !srcSlice) {
av_log(c, AV_LOG_ERROR, "One of the input parameters to sws_scale() is NULL, please check the calling code\n");
return 0;
}
@@ -951,9 +959,9 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
if (usePal(c->srcFormat)) {
for (i = 0; i < 256; i++) {
- int p, r, g, b, y, u, v, a = 0xff;
+ int r, g, b, y, u, v, a = 0xff;
if (c->srcFormat == AV_PIX_FMT_PAL8) {
- p = ((const uint32_t *)(srcSlice[1]))[i];
+ uint32_t p = ((const uint32_t *)(srcSlice[1]))[i];
a = (p >> 24) & 0xFF;
r = (p >> 16) & 0xFF;
g = (p >> 8) & 0xFF;
diff --git a/chromium/third_party/ffmpeg/libswscale/swscale.h b/chromium/third_party/ffmpeg/libswscale/swscale.h
index 42702b7aa20..25c8b5e981a 100644
--- a/chromium/third_party/ffmpeg/libswscale/swscale.h
+++ b/chromium/third_party/ffmpeg/libswscale/swscale.h
@@ -23,15 +23,10 @@
/**
* @file
- * @ingroup lsws
+ * @ingroup libsws
* external API header
*/
-/**
- * @defgroup lsws Libswscale
- * @{
- */
-
#include <stdint.h>
#include "libavutil/avutil.h"
@@ -40,6 +35,9 @@
#include "version.h"
/**
+ * @defgroup libsws Color conversion and scaling
+ * @{
+ *
* Return the LIBSWSCALE_VERSION_INT constant.
*/
unsigned swscale_version(void);
diff --git a/chromium/third_party/ffmpeg/libswscale/swscale_internal.h b/chromium/third_party/ffmpeg/libswscale/swscale_internal.h
index 6ad278e19be..a258f31bb62 100644
--- a/chromium/third_party/ffmpeg/libswscale/swscale_internal.h
+++ b/chromium/third_party/ffmpeg/libswscale/swscale_internal.h
@@ -66,6 +66,8 @@ typedef enum SwsDither {
SWS_DITHER_AUTO,
SWS_DITHER_BAYER,
SWS_DITHER_ED,
+ SWS_DITHER_A_DITHER,
+ SWS_DITHER_X_DITHER,
NB_SWS_DITHER,
} SwsDither;
@@ -368,7 +370,7 @@ typedef struct SwsContext {
uint8_t *table_rV[256 + 2*YUVRGB_TABLE_HEADROOM];
uint8_t *table_gU[256 + 2*YUVRGB_TABLE_HEADROOM];
uint8_t *table_bU[256 + 2*YUVRGB_TABLE_HEADROOM];
- DECLARE_ALIGNED(16, int32_t, input_rgb2yuv_table)[16+40*4]; // This table can contain both C and SIMD formatted values, teh C vales are always at the XY_IDX points
+ DECLARE_ALIGNED(16, int32_t, input_rgb2yuv_table)[16+40*4]; // This table can contain both C and SIMD formatted values, the C vales are always at the XY_IDX points
#define RY_IDX 0
#define GY_IDX 1
#define BY_IDX 2
@@ -415,18 +417,19 @@ typedef struct SwsContext {
#define U_OFFSET "9*8"
#define V_OFFSET "10*8"
#define LUM_MMX_FILTER_OFFSET "11*8"
-#define CHR_MMX_FILTER_OFFSET "11*8+4*4*256"
-#define DSTW_OFFSET "11*8+4*4*256*2" //do not change, it is hardcoded in the ASM
-#define ESP_OFFSET "11*8+4*4*256*2+8"
-#define VROUNDER_OFFSET "11*8+4*4*256*2+16"
-#define U_TEMP "11*8+4*4*256*2+24"
-#define V_TEMP "11*8+4*4*256*2+32"
-#define Y_TEMP "11*8+4*4*256*2+40"
-#define ALP_MMX_FILTER_OFFSET "11*8+4*4*256*2+48"
-#define UV_OFF_PX "11*8+4*4*256*3+48"
-#define UV_OFF_BYTE "11*8+4*4*256*3+56"
-#define DITHER16 "11*8+4*4*256*3+64"
-#define DITHER32 "11*8+4*4*256*3+80"
+#define CHR_MMX_FILTER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)
+#define DSTW_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2"
+#define ESP_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+8"
+#define VROUNDER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+16"
+#define U_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+24"
+#define V_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+32"
+#define Y_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+40"
+#define ALP_MMX_FILTER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+48"
+#define UV_OFF_PX "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+48"
+#define UV_OFF_BYTE "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+56"
+#define DITHER16 "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+64"
+#define DITHER32 "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+80"
+#define DITHER32_INT (11*8+4*4*MAX_FILTER_SIZE*3+80) // value equal to above, used for checking that the struct hasnt been changed by mistake
DECLARE_ALIGNED(8, uint64_t, redDither);
DECLARE_ALIGNED(8, uint64_t, greenDither);
@@ -484,9 +487,6 @@ typedef struct SwsContext {
DECLARE_ALIGNED(4, uint32_t, gmask);
#endif
-#if HAVE_VIS
- DECLARE_ALIGNED(8, uint64_t, sparc_coeffs)[10];
-#endif
int use_mmx_vfilter;
/* pre defined color-spaces gamma */
@@ -618,8 +618,9 @@ void ff_yuv2rgb_init_tables_ppc(SwsContext *c, const int inv_table[4],
void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex,
int lastInLumBuf, int lastInChrBuf);
+av_cold void ff_sws_init_range_convert(SwsContext *c);
+
SwsFunc ff_yuv2rgb_init_x86(SwsContext *c);
-SwsFunc ff_yuv2rgb_init_vis(SwsContext *c);
SwsFunc ff_yuv2rgb_init_ppc(SwsContext *c);
SwsFunc ff_yuv2rgb_init_bfin(SwsContext *c);
@@ -691,8 +692,6 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
( \
(x) == AV_PIX_FMT_RGB48BE || \
(x) == AV_PIX_FMT_RGB48LE || \
- (x) == AV_PIX_FMT_RGBA64BE || \
- (x) == AV_PIX_FMT_RGBA64LE || \
(x) == AV_PIX_FMT_RGB32 || \
(x) == AV_PIX_FMT_RGB32_1 || \
(x) == AV_PIX_FMT_RGB24 || \
@@ -705,6 +704,8 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
(x) == AV_PIX_FMT_RGB8 || \
(x) == AV_PIX_FMT_RGB4 || \
(x) == AV_PIX_FMT_RGB4_BYTE || \
+ (x) == AV_PIX_FMT_RGBA64BE || \
+ (x) == AV_PIX_FMT_RGBA64LE || \
(x) == AV_PIX_FMT_MONOBLACK || \
(x) == AV_PIX_FMT_MONOWHITE \
)
@@ -712,8 +713,6 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
( \
(x) == AV_PIX_FMT_BGR48BE || \
(x) == AV_PIX_FMT_BGR48LE || \
- (x) == AV_PIX_FMT_BGRA64BE || \
- (x) == AV_PIX_FMT_BGRA64LE || \
(x) == AV_PIX_FMT_BGR32 || \
(x) == AV_PIX_FMT_BGR32_1 || \
(x) == AV_PIX_FMT_BGR24 || \
@@ -726,6 +725,8 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
(x) == AV_PIX_FMT_BGR8 || \
(x) == AV_PIX_FMT_BGR4 || \
(x) == AV_PIX_FMT_BGR4_BYTE || \
+ (x) == AV_PIX_FMT_BGRA64BE || \
+ (x) == AV_PIX_FMT_BGRA64LE || \
(x) == AV_PIX_FMT_MONOBLACK || \
(x) == AV_PIX_FMT_MONOWHITE \
)
@@ -749,8 +750,24 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
|| (x) == AV_PIX_FMT_BGR24 \
)
+#define isBayer(x) ( \
+ (x)==AV_PIX_FMT_BAYER_BGGR8 \
+ || (x)==AV_PIX_FMT_BAYER_BGGR16LE \
+ || (x)==AV_PIX_FMT_BAYER_BGGR16BE \
+ || (x)==AV_PIX_FMT_BAYER_RGGB8 \
+ || (x)==AV_PIX_FMT_BAYER_RGGB16LE \
+ || (x)==AV_PIX_FMT_BAYER_RGGB16BE \
+ || (x)==AV_PIX_FMT_BAYER_GBRG8 \
+ || (x)==AV_PIX_FMT_BAYER_GBRG16LE \
+ || (x)==AV_PIX_FMT_BAYER_GBRG16BE \
+ || (x)==AV_PIX_FMT_BAYER_GRBG8 \
+ || (x)==AV_PIX_FMT_BAYER_GRBG16LE \
+ || (x)==AV_PIX_FMT_BAYER_GRBG16BE \
+ )
+
#define isAnyRGB(x) \
( \
+ isBayer(x) || \
isRGBinInt(x) || \
isBGRinInt(x) || \
isRGB(x) \
@@ -769,6 +786,7 @@ static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt)
#define isPacked(x) ( \
(x)==AV_PIX_FMT_PAL8 \
|| (x)==AV_PIX_FMT_YUYV422 \
+ || (x)==AV_PIX_FMT_YVYU422 \
|| (x)==AV_PIX_FMT_UYVY422 \
|| (x)==AV_PIX_FMT_Y400A \
|| isRGBinInt(x) \
@@ -835,6 +853,7 @@ extern const AVClass sws_context_class;
void ff_get_unscaled_swscale(SwsContext *c);
void ff_get_unscaled_swscale_bfin(SwsContext *c);
void ff_get_unscaled_swscale_ppc(SwsContext *c);
+void ff_get_unscaled_swscale_arm(SwsContext *c);
/**
* Return function pointer to fastest main scaler path function depending
diff --git a/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c b/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c
index 4181e0ded7f..6c24854e356 100644
--- a/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c
+++ b/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c
@@ -410,6 +410,192 @@ static int palToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
return srcSliceH;
}
+static void packed16togbra16(const uint8_t *src, int srcStride,
+ uint16_t *dst[], int dstStride[], int srcSliceH,
+ int src_alpha, int swap, int shift, int width)
+{
+ int x, h, i;
+ int dst_alpha = dst[3] != NULL;
+ for (h = 0; h < srcSliceH; h++) {
+ uint16_t *src_line = (uint16_t *)(src + srcStride * h);
+ switch (swap) {
+ case 3:
+ if (src_alpha && dst_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ dst[1][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ dst[2][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ dst[3][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ }
+ } else if (dst_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ dst[1][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ dst[2][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ dst[3][x] = 0xFFFF;
+ }
+ } else if (src_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ dst[1][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ dst[2][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ src_line++;
+ }
+ } else {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ dst[1][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ dst[2][x] = av_bswap16(av_bswap16(*src_line++) >> shift);
+ }
+ }
+ break;
+ case 2:
+ if (src_alpha && dst_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(*src_line++ >> shift);
+ dst[1][x] = av_bswap16(*src_line++ >> shift);
+ dst[2][x] = av_bswap16(*src_line++ >> shift);
+ dst[3][x] = av_bswap16(*src_line++ >> shift);
+ }
+ } else if (dst_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(*src_line++ >> shift);
+ dst[1][x] = av_bswap16(*src_line++ >> shift);
+ dst[2][x] = av_bswap16(*src_line++ >> shift);
+ dst[3][x] = 0xFFFF;
+ }
+ } else if (src_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(*src_line++ >> shift);
+ dst[1][x] = av_bswap16(*src_line++ >> shift);
+ dst[2][x] = av_bswap16(*src_line++ >> shift);
+ src_line++;
+ }
+ } else {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(*src_line++ >> shift);
+ dst[1][x] = av_bswap16(*src_line++ >> shift);
+ dst[2][x] = av_bswap16(*src_line++ >> shift);
+ }
+ }
+ break;
+ case 1:
+ if (src_alpha && dst_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(*src_line++) >> shift;
+ dst[1][x] = av_bswap16(*src_line++) >> shift;
+ dst[2][x] = av_bswap16(*src_line++) >> shift;
+ dst[3][x] = av_bswap16(*src_line++) >> shift;
+ }
+ } else if (dst_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(*src_line++) >> shift;
+ dst[1][x] = av_bswap16(*src_line++) >> shift;
+ dst[2][x] = av_bswap16(*src_line++) >> shift;
+ dst[3][x] = 0xFFFF;
+ }
+ } else if (src_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(*src_line++) >> shift;
+ dst[1][x] = av_bswap16(*src_line++) >> shift;
+ dst[2][x] = av_bswap16(*src_line++) >> shift;
+ src_line++;
+ }
+ } else {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = av_bswap16(*src_line++) >> shift;
+ dst[1][x] = av_bswap16(*src_line++) >> shift;
+ dst[2][x] = av_bswap16(*src_line++) >> shift;
+ }
+ }
+ break;
+ default:
+ if (src_alpha && dst_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = *src_line++ >> shift;
+ dst[1][x] = *src_line++ >> shift;
+ dst[2][x] = *src_line++ >> shift;
+ dst[3][x] = *src_line++ >> shift;
+ }
+ } else if (dst_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = *src_line++ >> shift;
+ dst[1][x] = *src_line++ >> shift;
+ dst[2][x] = *src_line++ >> shift;
+ dst[3][x] = 0xFFFF;
+ }
+ } else if (src_alpha) {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = *src_line++ >> shift;
+ dst[1][x] = *src_line++ >> shift;
+ dst[2][x] = *src_line++ >> shift;
+ src_line++;
+ }
+ } else {
+ for (x = 0; x < width; x++) {
+ dst[0][x] = *src_line++ >> shift;
+ dst[1][x] = *src_line++ >> shift;
+ dst[2][x] = *src_line++ >> shift;
+ }
+ }
+ }
+ for (i = 0; i < 4; i++)
+ dst[i] += dstStride[i] >> 1;
+ }
+}
+
+static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const uint8_t *src[],
+ int srcStride[], int srcSliceY, int srcSliceH,
+ uint8_t *dst[], int dstStride[])
+{
+ uint16_t *dst2013[] = { (uint16_t *)dst[2], (uint16_t *)dst[0], (uint16_t *)dst[1], (uint16_t *)dst[3] };
+ uint16_t *dst1023[] = { (uint16_t *)dst[1], (uint16_t *)dst[0], (uint16_t *)dst[2], (uint16_t *)dst[3] };
+ int stride2013[] = { dstStride[2], dstStride[0], dstStride[1], dstStride[3] };
+ int stride1023[] = { dstStride[1], dstStride[0], dstStride[2], dstStride[3] };
+ const AVPixFmtDescriptor *src_format = av_pix_fmt_desc_get(c->srcFormat);
+ const AVPixFmtDescriptor *dst_format = av_pix_fmt_desc_get(c->dstFormat);
+ int bpc = dst_format->comp[0].depth_minus1 + 1;
+ int alpha = src_format->flags & AV_PIX_FMT_FLAG_ALPHA;
+ int swap = 0;
+ if ( HAVE_BIGENDIAN && !(src_format->flags & AV_PIX_FMT_FLAG_BE) ||
+ !HAVE_BIGENDIAN && src_format->flags & AV_PIX_FMT_FLAG_BE)
+ swap++;
+ if ( HAVE_BIGENDIAN && !(dst_format->flags & AV_PIX_FMT_FLAG_BE) ||
+ !HAVE_BIGENDIAN && dst_format->flags & AV_PIX_FMT_FLAG_BE)
+ swap += 2;
+
+ if ((dst_format->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) !=
+ (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB) || bpc < 9) {
+ av_log(c, AV_LOG_ERROR, "unsupported conversion to planar RGB %s -> %s\n",
+ src_format->name, dst_format->name);
+ return srcSliceH;
+ }
+ switch (c->srcFormat) {
+ case AV_PIX_FMT_RGB48LE:
+ case AV_PIX_FMT_RGB48BE:
+ case AV_PIX_FMT_RGBA64LE:
+ case AV_PIX_FMT_RGBA64BE:
+ packed16togbra16(src[0] + srcSliceY * srcStride[0], srcStride[0],
+ dst2013, stride2013, srcSliceH, alpha, swap,
+ 16 - bpc, c->srcW);
+ break;
+ case AV_PIX_FMT_BGR48LE:
+ case AV_PIX_FMT_BGR48BE:
+ case AV_PIX_FMT_BGRA64LE:
+ case AV_PIX_FMT_BGRA64BE:
+ packed16togbra16(src[0] + srcSliceY * srcStride[0], srcStride[0],
+ dst1023, stride1023, srcSliceH, alpha, swap,
+ 16 - bpc, c->srcW);
+ break;
+ default:
+ av_log(c, AV_LOG_ERROR,
+ "unsupported conversion to planar RGB %s -> %s\n",
+ src_format->name, dst_format->name);
+ }
+
+ return srcSliceH;
+}
+
static void gbr16ptopacked16(const uint16_t *src[], int srcStride[],
uint8_t *dst, int dstStride, int srcSliceH,
int alpha, int swap, int bpp, int width)
@@ -782,6 +968,160 @@ static int rgbToPlanarRgbWrapper(SwsContext *c, const uint8_t *src[],
return srcSliceH;
}
+#define BAYER_GBRG
+#define BAYER_8
+#define BAYER_RENAME(x) bayer_gbrg8_to_##x
+#include "bayer_template.c"
+
+#define BAYER_GBRG
+#define BAYER_16LE
+#define BAYER_RENAME(x) bayer_gbrg16le_to_##x
+#include "bayer_template.c"
+
+#define BAYER_GBRG
+#define BAYER_16BE
+#define BAYER_RENAME(x) bayer_gbrg16be_to_##x
+#include "bayer_template.c"
+
+#define BAYER_GRBG
+#define BAYER_8
+#define BAYER_RENAME(x) bayer_grbg8_to_##x
+#include "bayer_template.c"
+
+#define BAYER_GRBG
+#define BAYER_16LE
+#define BAYER_RENAME(x) bayer_grbg16le_to_##x
+#include "bayer_template.c"
+
+#define BAYER_GRBG
+#define BAYER_16BE
+#define BAYER_RENAME(x) bayer_grbg16be_to_##x
+#include "bayer_template.c"
+
+#define BAYER_BGGR
+#define BAYER_8
+#define BAYER_RENAME(x) bayer_bggr8_to_##x
+#include "bayer_template.c"
+
+#define BAYER_BGGR
+#define BAYER_16LE
+#define BAYER_RENAME(x) bayer_bggr16le_to_##x
+#include "bayer_template.c"
+
+#define BAYER_BGGR
+#define BAYER_16BE
+#define BAYER_RENAME(x) bayer_bggr16be_to_##x
+#include "bayer_template.c"
+
+#define BAYER_RGGB
+#define BAYER_8
+#define BAYER_RENAME(x) bayer_rggb8_to_##x
+#include "bayer_template.c"
+
+#define BAYER_RGGB
+#define BAYER_16LE
+#define BAYER_RENAME(x) bayer_rggb16le_to_##x
+#include "bayer_template.c"
+
+#define BAYER_RGGB
+#define BAYER_16BE
+#define BAYER_RENAME(x) bayer_rggb16be_to_##x
+#include "bayer_template.c"
+
+static int bayer_to_rgb24_wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
+ int srcSliceH, uint8_t* dst[], int dstStride[])
+{
+ uint8_t *dstPtr= dst[0];
+ const uint8_t *srcPtr= src[0];
+ int i;
+ void (*copy) (const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int width);
+ void (*interpolate)(const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int width);
+
+ switch(c->srcFormat) {
+#define CASE(pixfmt, prefix) \
+ case pixfmt: copy = bayer_##prefix##_to_rgb24_copy; \
+ interpolate = bayer_##prefix##_to_rgb24_interpolate; \
+ break;
+ CASE(AV_PIX_FMT_BAYER_BGGR8, bggr8)
+ CASE(AV_PIX_FMT_BAYER_BGGR16LE, bggr16le)
+ CASE(AV_PIX_FMT_BAYER_BGGR16BE, bggr16be)
+ CASE(AV_PIX_FMT_BAYER_RGGB8, rggb8)
+ CASE(AV_PIX_FMT_BAYER_RGGB16LE, rggb16le)
+ CASE(AV_PIX_FMT_BAYER_RGGB16BE, rggb16be)
+ CASE(AV_PIX_FMT_BAYER_GBRG8, gbrg8)
+ CASE(AV_PIX_FMT_BAYER_GBRG16LE, gbrg16le)
+ CASE(AV_PIX_FMT_BAYER_GBRG16BE, gbrg16be)
+ CASE(AV_PIX_FMT_BAYER_GRBG8, grbg8)
+ CASE(AV_PIX_FMT_BAYER_GRBG16LE, grbg16le)
+ CASE(AV_PIX_FMT_BAYER_GRBG16BE, grbg16be)
+#undef CASE
+ default: return 0;
+ }
+
+ copy(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);
+ srcPtr += 2 * srcStride[0];
+ dstPtr += 2 * dstStride[0];
+
+ for (i = 2; i < srcSliceH - 2; i += 2) {
+ interpolate(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);
+ srcPtr += 2 * srcStride[0];
+ dstPtr += 2 * dstStride[0];
+ }
+
+ copy(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);
+ return srcSliceH;
+}
+
+static int bayer_to_yv12_wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
+ int srcSliceH, uint8_t* dst[], int dstStride[])
+{
+ const uint8_t *srcPtr= src[0];
+ uint8_t *dstY= dst[0];
+ uint8_t *dstU= dst[1];
+ uint8_t *dstV= dst[2];
+ int i;
+ void (*copy) (const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, int32_t *rgb2yuv);
+ void (*interpolate)(const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, int32_t *rgb2yuv);
+
+ switch(c->srcFormat) {
+#define CASE(pixfmt, prefix) \
+ case pixfmt: copy = bayer_##prefix##_to_yv12_copy; \
+ interpolate = bayer_##prefix##_to_yv12_interpolate; \
+ break;
+ CASE(AV_PIX_FMT_BAYER_BGGR8, bggr8)
+ CASE(AV_PIX_FMT_BAYER_BGGR16LE, bggr16le)
+ CASE(AV_PIX_FMT_BAYER_BGGR16BE, bggr16be)
+ CASE(AV_PIX_FMT_BAYER_RGGB8, rggb8)
+ CASE(AV_PIX_FMT_BAYER_RGGB16LE, rggb16le)
+ CASE(AV_PIX_FMT_BAYER_RGGB16BE, rggb16be)
+ CASE(AV_PIX_FMT_BAYER_GBRG8, gbrg8)
+ CASE(AV_PIX_FMT_BAYER_GBRG16LE, gbrg16le)
+ CASE(AV_PIX_FMT_BAYER_GBRG16BE, gbrg16be)
+ CASE(AV_PIX_FMT_BAYER_GRBG8, grbg8)
+ CASE(AV_PIX_FMT_BAYER_GRBG16LE, grbg16le)
+ CASE(AV_PIX_FMT_BAYER_GRBG16BE, grbg16be)
+#undef CASE
+ default: return 0;
+ }
+
+ copy(srcPtr, srcStride[0], dstY, dstU, dstV, dstStride[0], c->srcW, c->input_rgb2yuv_table);
+ srcPtr += 2 * srcStride[0];
+ dstY += 2 * dstStride[0];
+ dstU += dstStride[1];
+ dstV += dstStride[1];
+
+ for (i = 2; i < srcSliceH - 2; i += 2) {
+ interpolate(srcPtr, srcStride[0], dstY, dstU, dstV, dstStride[0], c->srcW, c->input_rgb2yuv_table);
+ srcPtr += 2 * srcStride[0];
+ dstY += 2 * dstStride[0];
+ dstU += dstStride[1];
+ dstV += dstStride[1];
+ }
+
+ copy(srcPtr, srcStride[0], dstY, dstU, dstV, dstStride[0], c->srcW, c->input_rgb2yuv_table);
+ return srcSliceH;
+}
+
#define isRGBA32(x) ( \
(x) == AV_PIX_FMT_ARGB \
|| (x) == AV_PIX_FMT_RGBA \
@@ -1245,7 +1585,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
c->swscale = ff_yuv2rgb_get_func_ptr(c);
}
- if (srcFormat == AV_PIX_FMT_YUV410P &&
+ if (srcFormat == AV_PIX_FMT_YUV410P && !(dstH & 3) &&
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
!(flags & SWS_BITEXACT)) {
c->swscale = yvu9ToYv12Wrapper;
@@ -1277,6 +1617,18 @@ void ff_get_unscaled_swscale(SwsContext *c)
if (srcFormat == AV_PIX_FMT_GBRP && isPlanar(srcFormat) && isByteRGB(dstFormat))
c->swscale = planarRgbToRgbWrapper;
+ if ((srcFormat == AV_PIX_FMT_RGB48LE || srcFormat == AV_PIX_FMT_RGB48BE ||
+ srcFormat == AV_PIX_FMT_BGR48LE || srcFormat == AV_PIX_FMT_BGR48BE ||
+ srcFormat == AV_PIX_FMT_RGBA64LE || srcFormat == AV_PIX_FMT_RGBA64BE ||
+ srcFormat == AV_PIX_FMT_BGRA64LE || srcFormat == AV_PIX_FMT_BGRA64BE) &&
+ (dstFormat == AV_PIX_FMT_GBRP9LE || dstFormat == AV_PIX_FMT_GBRP9BE ||
+ dstFormat == AV_PIX_FMT_GBRP10LE || dstFormat == AV_PIX_FMT_GBRP10BE ||
+ dstFormat == AV_PIX_FMT_GBRP12LE || dstFormat == AV_PIX_FMT_GBRP12BE ||
+ dstFormat == AV_PIX_FMT_GBRP14LE || dstFormat == AV_PIX_FMT_GBRP14BE ||
+ dstFormat == AV_PIX_FMT_GBRP16LE || dstFormat == AV_PIX_FMT_GBRP16BE ||
+ dstFormat == AV_PIX_FMT_GBRAP16LE || dstFormat == AV_PIX_FMT_GBRAP16BE ))
+ c->swscale = Rgb16ToPlanarRgb16Wrapper;
+
if ((srcFormat == AV_PIX_FMT_GBRP9LE || srcFormat == AV_PIX_FMT_GBRP9BE ||
srcFormat == AV_PIX_FMT_GBRP16LE || srcFormat == AV_PIX_FMT_GBRP16BE ||
srcFormat == AV_PIX_FMT_GBRP10LE || srcFormat == AV_PIX_FMT_GBRP10BE ||
@@ -1293,12 +1645,28 @@ void ff_get_unscaled_swscale(SwsContext *c)
isPackedRGB(srcFormat) && dstFormat == AV_PIX_FMT_GBRP)
c->swscale = rgbToPlanarRgbWrapper;
+ if (isBayer(srcFormat)) {
+ if (dstFormat == AV_PIX_FMT_RGB24)
+ c->swscale = bayer_to_rgb24_wrapper;
+ else if (dstFormat == AV_PIX_FMT_YUV420P)
+ c->swscale = bayer_to_yv12_wrapper;
+ else if (!isBayer(dstFormat)) {
+ av_log(c, AV_LOG_ERROR, "unsupported bayer conversion\n");
+ av_assert0(0);
+ }
+ }
+
/* bswap 16 bits per pixel/component packed formats */
- if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR444) ||
+ if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BAYER_BGGR16) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BAYER_RGGB16) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BAYER_GBRG16) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BAYER_GRBG16) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR444) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR48) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGRA64) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR555) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR565) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGRA64) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GRAY16) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRP9) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRP10) ||
@@ -1311,6 +1679,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGBA64) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB555) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB565) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGBA64) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_XYZ12) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV420P9) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV420P10) ||
@@ -1384,6 +1753,8 @@ void ff_get_unscaled_swscale(SwsContext *c)
ff_get_unscaled_swscale_bfin(c);
if (ARCH_PPC)
ff_get_unscaled_swscale_ppc(c);
+// if (ARCH_ARM)
+// ff_get_unscaled_swscale_arm(c);
}
/* Convert the palette to the same packed 32-bit format as the palette */
diff --git a/chromium/third_party/ffmpeg/libswscale/utils.c b/chromium/third_party/ffmpeg/libswscale/utils.c
index 90ddbf1e06d..29c57119e75 100644
--- a/chromium/third_party/ffmpeg/libswscale/utils.c
+++ b/chromium/third_party/ffmpeg/libswscale/utils.c
@@ -97,6 +97,7 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_YUVJ411P] = { 1, 1 },
[AV_PIX_FMT_YUVJ422P] = { 1, 1 },
[AV_PIX_FMT_YUVJ444P] = { 1, 1 },
+ [AV_PIX_FMT_YVYU422] = { 1, 1 },
[AV_PIX_FMT_UYVY422] = { 1, 1 },
[AV_PIX_FMT_UYYVYY411] = { 0, 0 },
[AV_PIX_FMT_BGR8] = { 1, 1 },
@@ -142,8 +143,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_YUVA444P16LE]= { 1, 1 },
[AV_PIX_FMT_RGB48BE] = { 1, 1 },
[AV_PIX_FMT_RGB48LE] = { 1, 1 },
- [AV_PIX_FMT_RGBA64BE] = { 1, 1 },
- [AV_PIX_FMT_RGBA64LE] = { 1, 1 },
+ [AV_PIX_FMT_RGBA64BE] = { 1, 1, 1 },
+ [AV_PIX_FMT_RGBA64LE] = { 1, 1, 1 },
[AV_PIX_FMT_RGB565BE] = { 1, 1 },
[AV_PIX_FMT_RGB565LE] = { 1, 1 },
[AV_PIX_FMT_RGB555BE] = { 1, 1 },
@@ -165,8 +166,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_Y400A] = { 1, 0 },
[AV_PIX_FMT_BGR48BE] = { 1, 1 },
[AV_PIX_FMT_BGR48LE] = { 1, 1 },
- [AV_PIX_FMT_BGRA64BE] = { 0, 0 },
- [AV_PIX_FMT_BGRA64LE] = { 0, 0 },
+ [AV_PIX_FMT_BGRA64BE] = { 1, 1, 1 },
+ [AV_PIX_FMT_BGRA64LE] = { 1, 1, 1 },
[AV_PIX_FMT_YUV420P9BE] = { 1, 1 },
[AV_PIX_FMT_YUV420P9LE] = { 1, 1 },
[AV_PIX_FMT_YUV420P10BE] = { 1, 1 },
@@ -207,6 +208,18 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_GBRAP] = { 1, 1 },
[AV_PIX_FMT_GBRAP16LE] = { 1, 0 },
[AV_PIX_FMT_GBRAP16BE] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_BGGR8] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_RGGB8] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_GBRG8] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_GRBG8] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_BGGR16LE] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_BGGR16BE] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_RGGB16LE] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_RGGB16BE] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_GBRG16LE] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_GBRG16BE] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_GRBG16LE] = { 1, 0 },
+ [AV_PIX_FMT_BAYER_GRBG16BE] = { 1, 0 },
};
int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
@@ -299,13 +312,13 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
emms_c(); // FIXME should not be required but IS (even for non-MMX versions)
// NOTE: the +3 is for the MMX(+1) / SSE(+3) scaler which reads over the end
- FF_ALLOC_OR_GOTO(NULL, *filterPos, (dstW + 3) * sizeof(**filterPos), fail);
+ FF_ALLOC_ARRAY_OR_GOTO(NULL, *filterPos, (dstW + 3), sizeof(**filterPos), fail);
if (FFABS(xInc - 0x10000) < 10 && srcPos == dstPos) { // unscaled
int i;
filterSize = 1;
- FF_ALLOCZ_OR_GOTO(NULL, filter,
- dstW * sizeof(*filter) * filterSize, fail);
+ FF_ALLOCZ_ARRAY_OR_GOTO(NULL, filter,
+ dstW, sizeof(*filter) * filterSize, fail);
for (i = 0; i < dstW; i++) {
filter[i * filterSize] = fone;
@@ -315,8 +328,8 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
int i;
int64_t xDstInSrc;
filterSize = 1;
- FF_ALLOC_OR_GOTO(NULL, filter,
- dstW * sizeof(*filter) * filterSize, fail);
+ FF_ALLOC_ARRAY_OR_GOTO(NULL, filter,
+ dstW, sizeof(*filter) * filterSize, fail);
xDstInSrc = ((dstPos*(int64_t)xInc)>>8) - ((srcPos*0x8000LL)>>7);
for (i = 0; i < dstW; i++) {
@@ -331,8 +344,8 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
int i;
int64_t xDstInSrc;
filterSize = 2;
- FF_ALLOC_OR_GOTO(NULL, filter,
- dstW * sizeof(*filter) * filterSize, fail);
+ FF_ALLOC_ARRAY_OR_GOTO(NULL, filter,
+ dstW, sizeof(*filter) * filterSize, fail);
xDstInSrc = ((dstPos*(int64_t)xInc)>>8) - ((srcPos*0x8000LL)>>7);
for (i = 0; i < dstW; i++) {
@@ -355,7 +368,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
int sizeFactor = -1;
for (i = 0; i < FF_ARRAY_ELEMS(scale_algorithms); i++) {
- if (flags & scale_algorithms[i].flag) {
+ if (flags & scale_algorithms[i].flag && scale_algorithms[i].size_factor > 0) {
sizeFactor = scale_algorithms[i].size_factor;
break;
}
@@ -372,12 +385,12 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
filterSize = FFMIN(filterSize, srcW - 2);
filterSize = FFMAX(filterSize, 1);
- FF_ALLOC_OR_GOTO(NULL, filter,
- dstW * sizeof(*filter) * filterSize, fail);
+ FF_ALLOC_ARRAY_OR_GOTO(NULL, filter,
+ dstW, sizeof(*filter) * filterSize, fail);
xDstInSrc = ((dstPos*(int64_t)xInc)>>7) - ((srcPos*0x10000LL)>>7);
for (i = 0; i < dstW; i++) {
- int xx = (xDstInSrc - ((filterSize - 2) << 16)) / (1 << 17);
+ int xx = (xDstInSrc - ((int64_t)(filterSize - 2) << 16)) / (1 << 17);
int j;
(*filterPos)[i] = xx;
for (j = 0; j < filterSize; j++) {
@@ -480,7 +493,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
if (dstFilter)
filter2Size += dstFilter->length - 1;
av_assert0(filter2Size > 0);
- FF_ALLOCZ_OR_GOTO(NULL, filter2, filter2Size * dstW * sizeof(*filter2), fail);
+ FF_ALLOCZ_ARRAY_OR_GOTO(NULL, filter2, dstW, filter2Size * sizeof(*filter2), fail);
for (i = 0; i < dstW; i++) {
int j, k;
@@ -564,10 +577,13 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
av_assert0(minFilterSize > 0);
filterSize = (minFilterSize + (filterAlign - 1)) & (~(filterAlign - 1));
av_assert0(filterSize > 0);
- filter = av_malloc(filterSize * dstW * sizeof(*filter));
+ filter = av_malloc_array(dstW, filterSize * sizeof(*filter));
+ if (!filter)
+ goto fail;
if (filterSize >= MAX_FILTER_SIZE * 16 /
- ((flags & SWS_ACCURATE_RND) ? APCK_SIZE : 16) || !filter) {
- av_log(NULL, AV_LOG_ERROR, "sws: filterSize %d is too large, try less extreme scaling or increase MAX_FILTER_SIZE and recompile\n", filterSize);
+ ((flags & SWS_ACCURATE_RND) ? APCK_SIZE : 16)) {
+ av_log(NULL, AV_LOG_ERROR, "sws: filterSize %d is too large, try less extreme scaling or increase MAX_FILTER_SIZE and recompile\n",
+ FF_CEIL_RSHIFT((filterSize+1) * ((flags & SWS_ACCURATE_RND) ? APCK_SIZE : 16), 4));
goto fail;
}
*outFilterSize = filterSize;
@@ -619,8 +635,8 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
// Note the +1 is for the MMX scaler which reads over the end
/* align at 16 for AltiVec (needed by hScale_altivec_real) */
- FF_ALLOCZ_OR_GOTO(NULL, *outFilter,
- *outFilterSize * (dstW + 3) * sizeof(int16_t), fail);
+ FF_ALLOCZ_ARRAY_OR_GOTO(NULL, *outFilter,
+ (dstW + 3), *outFilterSize * sizeof(int16_t), fail);
/* normalize & store in outFilter */
for (i = 0; i < dstW; i++) {
@@ -781,10 +797,10 @@ static av_cold int init_hscaler_mmxext(int dstW, int xInc, uint8_t *filterCode,
int c = ((xpos + xInc * 2) >> 16) - xx;
int d = ((xpos + xInc * 3) >> 16) - xx;
int inc = (d + 1 < 4);
- uint8_t *fragment = (d + 1 < 4) ? fragmentB : fragmentA;
- x86_reg imm8OfPShufW1 = (d + 1 < 4) ? imm8OfPShufW1B : imm8OfPShufW1A;
- x86_reg imm8OfPShufW2 = (d + 1 < 4) ? imm8OfPShufW2B : imm8OfPShufW2A;
- x86_reg fragmentLength = (d + 1 < 4) ? fragmentLengthB : fragmentLengthA;
+ uint8_t *fragment = inc ? fragmentB : fragmentA;
+ x86_reg imm8OfPShufW1 = inc ? imm8OfPShufW1B : imm8OfPShufW1A;
+ x86_reg imm8OfPShufW2 = inc ? imm8OfPShufW2B : imm8OfPShufW2A;
+ x86_reg fragmentLength = inc ? fragmentLengthB : fragmentLengthA;
int maxShift = 3 - (d + inc);
int shift = 0;
@@ -967,6 +983,7 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
{
const AVPixFmtDescriptor *desc_dst;
const AVPixFmtDescriptor *desc_src;
+ int need_reinit = 0;
memmove(c->srcColorspaceTable, inv_table, sizeof(int) * 4);
memmove(c->dstColorspaceTable, table, sizeof(int) * 4);
@@ -982,9 +999,14 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
c->brightness = brightness;
c->contrast = contrast;
c->saturation = saturation;
+ if (c->srcRange != srcRange || c->dstRange != dstRange)
+ need_reinit = 1;
c->srcRange = srcRange;
c->dstRange = dstRange;
+ if (need_reinit && c->srcBpc == 8)
+ ff_sws_init_range_convert(c);
+
if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat)))
return -1;
@@ -1043,6 +1065,8 @@ static int handle_jpeg(enum AVPixelFormat *format)
*format = AV_PIX_FMT_YUV440P;
return 1;
case AV_PIX_FMT_GRAY8:
+ case AV_PIX_FMT_GRAY16LE:
+ case AV_PIX_FMT_GRAY16BE:
return 1;
default:
return 0;
@@ -1083,6 +1107,8 @@ SwsContext *sws_alloc_context(void)
{
SwsContext *c = av_mallocz(sizeof(SwsContext));
+ av_assert0(offsetof(SwsContext, redDither) + DITHER32_INT == offsetof(SwsContext, dither32));
+
if (c) {
c->av_class = &sws_context_class;
av_opt_set_defaults(c);
@@ -1120,13 +1146,14 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
c->srcRange |= handle_jpeg(&c->srcFormat);
c->dstRange |= handle_jpeg(&c->dstFormat);
+ if(srcFormat!=c->srcFormat || dstFormat!=c->dstFormat)
+ av_log(c, AV_LOG_WARNING, "deprecated pixel format used, make sure you did set range correctly\n");
+
if (!c->contrast && !c->saturation && !c->dstFormatBpp)
sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], c->srcRange,
ff_yuv2rgb_coeffs[SWS_CS_DEFAULT],
c->dstRange, 0, 1 << 16, 1 << 16);
- if(srcFormat!=c->srcFormat || dstFormat!=c->dstFormat)
- av_log(c, AV_LOG_WARNING, "deprecated pixel format used, make sure you did set range correctly\n");
handle_formats(c);
srcFormat = c->srcFormat;
dstFormat = c->dstFormat;
@@ -1235,7 +1262,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
if (c->dither == SWS_DITHER_AUTO)
c->dither = (flags & SWS_FULL_CHR_H_INT) ? SWS_DITHER_ED : SWS_DITHER_BAYER;
if (!(flags & SWS_FULL_CHR_H_INT)) {
- if (c->dither == SWS_DITHER_ED) {
+ if (c->dither == SWS_DITHER_ED || c->dither == SWS_DITHER_A_DITHER || c->dither == SWS_DITHER_X_DITHER) {
av_log(c, AV_LOG_DEBUG,
"Desired dithering only supported in full chroma interpolation for destination format '%s'\n",
av_get_pix_fmt_name(dstFormat));
@@ -1315,20 +1342,6 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
FF_ALLOC_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail);
- /* unscaled special cases */
- if (unscaled && !usesHFilter && !usesVFilter &&
- (c->srcRange == c->dstRange || isAnyRGB(dstFormat))) {
- ff_get_unscaled_swscale(c);
-
- if (c->swscale) {
- if (flags & SWS_PRINT_INFO)
- av_log(c, AV_LOG_INFO,
- "using unscaled %s -> %s special converter\n",
- av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat));
- return 0;
- }
- }
-
c->srcBpc = 1 + desc_src->comp[0].depth_minus1;
if (c->srcBpc < 8)
c->srcBpc = 8;
@@ -1341,9 +1354,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
dst_stride <<= 1;
if (INLINE_MMXEXT(cpu_flags) && c->srcBpc == 8 && c->dstBpc <= 14) {
- c->canMMXEXTBeUsed = (dstW >= srcW && (dstW & 31) == 0 &&
- (srcW & 15) == 0) ? 1 : 0;
- if (!c->canMMXEXTBeUsed && dstW >= srcW && (srcW & 15) == 0
+ c->canMMXEXTBeUsed = dstW >= srcW && (dstW & 31) == 0 &&
+ c->chrDstW >= c->chrSrcW &&
+ (srcW & 15) == 0;
+ if (!c->canMMXEXTBeUsed && dstW >= srcW && c->chrDstW >= c->chrSrcW && (srcW & 15) == 0
&& (flags & SWS_FAST_BILINEAR)) {
if (flags & SWS_PRINT_INFO)
@@ -1623,6 +1637,20 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
c->chrXInc, c->chrYInc);
}
+ /* unscaled special cases */
+ if (unscaled && !usesHFilter && !usesVFilter &&
+ (c->srcRange == c->dstRange || isAnyRGB(dstFormat))) {
+ ff_get_unscaled_swscale(c);
+
+ if (c->swscale) {
+ if (flags & SWS_PRINT_INFO)
+ av_log(c, AV_LOG_INFO,
+ "using unscaled %s -> %s special converter\n",
+ av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat));
+ return 0;
+ }
+ }
+
c->swscale = ff_getSwsFunc(c);
return 0;
fail: // FIXME replace things by appropriate error codes
diff --git a/chromium/third_party/ffmpeg/libswscale/version.h b/chromium/third_party/ffmpeg/libswscale/version.h
index 360ec820a90..b0338636f51 100644
--- a/chromium/third_party/ffmpeg/libswscale/version.h
+++ b/chromium/third_party/ffmpeg/libswscale/version.h
@@ -24,11 +24,11 @@
* swscale version macros
*/
-#include "libavutil/avutil.h"
+#include "libavutil/version.h"
#define LIBSWSCALE_VERSION_MAJOR 2
-#define LIBSWSCALE_VERSION_MINOR 5
-#define LIBSWSCALE_VERSION_MICRO 101
+#define LIBSWSCALE_VERSION_MINOR 6
+#define LIBSWSCALE_VERSION_MICRO 100
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \
diff --git a/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb.c b/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb.c
index 8af0bc4a7c2..b80e869e0cf 100644
--- a/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb.c
+++ b/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb.c
@@ -76,6 +76,10 @@ DECLARE_ASM_CONST(8, uint64_t, mul15_mid) = 0x4200420042004200ULL;
DECLARE_ASM_CONST(8, uint64_t, mul15_hi) = 0x0210021002100210ULL;
DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL;
+DECLARE_ALIGNED(8, extern const uint64_t, ff_bgr2YOffset);
+DECLARE_ALIGNED(8, extern const uint64_t, ff_w1111);
+DECLARE_ALIGNED(8, extern const uint64_t, ff_bgr2UVOffset);
+
#define BY ((int)( 0.098*(1<<RGB2YUV_SHIFT)+0.5))
#define BV ((int)(-0.071*(1<<RGB2YUV_SHIFT)+0.5))
#define BU ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5))
@@ -127,6 +131,7 @@ DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL;
#undef COMPILE_TEMPLATE_AMD3DNOW
#define COMPILE_TEMPLATE_MMXEXT 0
#define COMPILE_TEMPLATE_SSE2 0
+#define COMPILE_TEMPLATE_AVX 0
#define COMPILE_TEMPLATE_AMD3DNOW 1
#define RENAME(a) a ## _3dnow
#include "rgb2rgb_template.c"
diff --git a/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb_template.c b/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb_template.c
index aaea510f514..1e124468595 100644
--- a/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb_template.c
+++ b/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb_template.c
@@ -25,8 +25,10 @@
*/
#include <stddef.h>
+#include <stdint.h>
#include "libavutil/attributes.h"
+#include "libavutil/x86/asm.h"
#undef PREFETCH
#undef MOVNTQ
@@ -163,6 +165,7 @@ static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int sr
"movq %%mm5, %%mm7 \n\t"
STORE_BGR24_MMX
:: "r"(dest), "r"(s)
+ NAMED_CONSTRAINTS_ADD(mask24l,mask24h)
:"memory");
dest += 24;
s += 32;
@@ -785,6 +788,7 @@ static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int sr
:"=m"(*d)
:"r"(s),"m"(mask15b),"m"(mask15g),"m"(mask15r), "m"(mmx_null)
+ NAMED_CONSTRAINTS_ADD(mul15_mid,mul15_hi)
:"memory");
/* borrowed 32 to 24 */
__asm__ volatile(
@@ -801,6 +805,7 @@ static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int sr
STORE_BGR24_MMX
:: "r"(d), "m"(*s)
+ NAMED_CONSTRAINTS_ADD(mask24l,mask24h)
:"memory");
d += 24;
s += 8;
@@ -890,6 +895,7 @@ static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int sr
"por %%mm5, %%mm3 \n\t"
:"=m"(*d)
:"r"(s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null)
+ NAMED_CONSTRAINTS_ADD(mul15_mid,mul16_mid,mul15_hi)
:"memory");
/* borrowed 32 to 24 */
__asm__ volatile(
@@ -906,6 +912,7 @@ static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int sr
STORE_BGR24_MMX
:: "r"(d), "m"(*s)
+ NAMED_CONSTRAINTS_ADD(mask24l,mask24h)
:"memory");
d += 24;
s += 8;
@@ -966,6 +973,7 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, int src_s
"pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t"
PACK_RGB32
::"r"(d),"r"(s),"m"(mask15b),"m"(mask15g),"m"(mask15r) ,"m"(mul15_mid)
+ NAMED_CONSTRAINTS_ADD(mul15_hi)
:"memory");
d += 16;
s += 4;
@@ -1009,6 +1017,7 @@ static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, int src_s
"pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t"
PACK_RGB32
::"r"(d),"r"(s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mul15_mid)
+ NAMED_CONSTRAINTS_ADD(mul16_mid,mul15_hi)
:"memory");
d += 16;
s += 4;
@@ -1133,6 +1142,7 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int sr
"2: \n\t"
: "+a" (mmx_size)
: "r" (src-mmx_size), "r"(dst-mmx_size)
+ NAMED_CONSTRAINTS_ADD(mask24r,mask24g,mask24b)
);
__asm__ volatile(SFENCE:::"memory");
@@ -1468,6 +1478,7 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWid
:: "r" (src + mmxSize ), "r" (src + srcStride + mmxSize ),
"r" (dst + mmxSize*2), "r" (dst + dstStride + mmxSize*2),
"g" (-mmxSize)
+ NAMED_CONSTRAINTS_ADD(mmx_ff)
: "%"REG_a
);
@@ -1689,6 +1700,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
"add $8, %%"REG_a" \n\t"
" js 1b \n\t"
: : "r" (src+width*3), "r" (ydst+width), "g" ((x86_reg)-width), "r"(rgb2yuv)
+ NAMED_CONSTRAINTS_ADD(ff_w1111,ff_bgr2YOffset)
: "%"REG_a, "%"REG_d
);
ydst += lumStride;
@@ -1837,6 +1849,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
"add $4, %%"REG_a" \n\t"
" js 1b \n\t"
: : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth), "r"(rgb2yuv)
+ NAMED_CONSTRAINTS_ADD(ff_w1111,ff_bgr2UVOffset)
: "%"REG_a, "%"REG_d
);
@@ -1924,23 +1937,25 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui
::: "memory"
);
}
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX*/
+#endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */
+#if !COMPILE_TEMPLATE_AVX || HAVE_AVX_EXTERNAL
#if !COMPILE_TEMPLATE_AMD3DNOW && (ARCH_X86_32 || COMPILE_TEMPLATE_SSE2) && COMPILE_TEMPLATE_MMXEXT == COMPILE_TEMPLATE_SSE2 && HAVE_YASM
void RENAME(ff_nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
- const uint8_t *unused0,
- const uint8_t *src1,
- const uint8_t *src2,
- int w, uint32_t *unused);
+ const uint8_t *unused,
+ const uint8_t *src1,
+ const uint8_t *src2,
+ int w,
+ uint32_t *unused2);
static void RENAME(deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
int width, int height, int srcStride,
int dst1Stride, int dst2Stride)
{
int h;
- for (h=0; h < height; h++) {
+ for (h = 0; h < height; h++) {
RENAME(ff_nv12ToUV)(dst1, dst2, NULL, src, NULL, width, NULL);
- src += srcStride;
+ src += srcStride;
dst1 += dst1Stride;
dst2 += dst2Stride;
}
@@ -1951,6 +1966,7 @@ static void RENAME(deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t
);
}
#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
+#endif /* !COMPILE_TEMPLATE_AVX || HAVE_AVX_EXTERNAL */
#if !COMPILE_TEMPLATE_SSE2
#if !COMPILE_TEMPLATE_AMD3DNOW
@@ -2522,8 +2538,10 @@ static av_cold void RENAME(rgb2rgb_init)(void)
#if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX
interleaveBytes = RENAME(interleaveBytes);
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX*/
+#endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */
+#if !COMPILE_TEMPLATE_AVX || HAVE_AVX_EXTERNAL
#if !COMPILE_TEMPLATE_AMD3DNOW && (ARCH_X86_32 || COMPILE_TEMPLATE_SSE2) && COMPILE_TEMPLATE_MMXEXT == COMPILE_TEMPLATE_SSE2 && HAVE_YASM
deinterleaveBytes = RENAME(deinterleaveBytes);
#endif
+#endif
}
diff --git a/chromium/third_party/ffmpeg/libswscale/x86/swscale.c b/chromium/third_party/ffmpeg/libswscale/x86/swscale.c
index 2f7e4f717a7..d85380065b6 100644
--- a/chromium/third_party/ffmpeg/libswscale/x86/swscale.c
+++ b/chromium/third_party/ffmpeg/libswscale/x86/swscale.c
@@ -58,10 +58,6 @@ DECLARE_ALIGNED(8, const uint64_t, ff_M24A) = 0x00FF0000FF0000FFLL;
DECLARE_ALIGNED(8, const uint64_t, ff_M24B) = 0xFF0000FF0000FF00LL;
DECLARE_ALIGNED(8, const uint64_t, ff_M24C) = 0x0000FF0000FF0000LL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YCoeff) = 0x000020E540830C8BULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UCoeff) = 0x0000ED0FDAC23831ULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2VCoeff) = 0x00003831D0E6F6EAULL;
-
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YOffset) = 0x1010101010101010ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UVOffset) = 0x8080808080808080ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL;
@@ -266,7 +262,8 @@ static void yuv2yuvX_sse3(const int16_t *filter, int filterSize,
"jb 1b \n\t"\
:: "g" (filter),
"r" (dest-offset), "g" ((x86_reg)(dstW+offset)), "m" (offset)
- : "%"REG_d, "%"REG_S, "%"REG_c
+ : XMM_CLOBBERS("%xmm0" , "%xmm1" , "%xmm2" , "%xmm3" , "%xmm4" , "%xmm5" , "%xmm7" ,)
+ "%"REG_d, "%"REG_S, "%"REG_c
);
}
#endif
@@ -382,11 +379,11 @@ av_cold void ff_sws_init_swscale_x86(SwsContext *c)
int cpu_flags = av_get_cpu_flags();
#if HAVE_MMX_INLINE
- if (cpu_flags & AV_CPU_FLAG_MMX)
+ if (INLINE_MMX(cpu_flags))
sws_init_swscale_mmx(c);
#endif
#if HAVE_MMXEXT_INLINE
- if (cpu_flags & AV_CPU_FLAG_MMXEXT)
+ if (INLINE_MMXEXT(cpu_flags))
sws_init_swscale_mmxext(c);
if (cpu_flags & AV_CPU_FLAG_SSE3){
if(c->use_mmx_vfilter && !(c->flags & SWS_ACCURATE_RND))
diff --git a/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c b/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c
index c7a1bb46d9a..1213197347e 100644
--- a/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c
+++ b/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c
@@ -18,6 +18,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <stdint.h>
+
+#include "libavutil/x86/asm.h"
+#include "libswscale/swscale_internal.h"
+
#undef REAL_MOVNTQ
#undef MOVNTQ
#undef MOVNTQ2
@@ -172,6 +177,7 @@ static void RENAME(yuv2yuvX)(const int16_t *filter, int filterSize,
:: "r" (&c->redDither), \
"m" (dummy), "m" (dummy), "m" (dummy),\
"r" (dest), "m" (dstW_reg), "m"(uv_off) \
+ NAMED_CONSTRAINTS_ADD(bF8,bFC) \
: "%"REG_a, "%"REG_d, "%"REG_S \
);
@@ -332,7 +338,7 @@ static void RENAME(yuv2yuvX)(const int16_t *filter, int filterSize,
MOVNTQ( q3, 24(dst, index, 4))\
\
"add $8, "#index" \n\t"\
- "cmp "#dstw", "#index" \n\t"\
+ "cmp "dstw", "#index" \n\t"\
" jb 1b \n\t"
#define WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t)
@@ -358,13 +364,13 @@ static void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilter,
"psraw $3, %%mm1 \n\t"
"psraw $3, %%mm7 \n\t"
"packuswb %%mm7, %%mm1 \n\t"
- WRITEBGR32(%4, %5, %%REGa, %%mm3, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm2, %%mm6)
+ WRITEBGR32(%4, "%5", %%REGa, %%mm3, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm2, %%mm6)
YSCALEYUV2PACKEDX_END
} else {
YSCALEYUV2PACKEDX_ACCURATE
YSCALEYUV2RGBX
"pcmpeqd %%mm7, %%mm7 \n\t"
- WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
+ WRITEBGR32(%4, "%5", %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
YSCALEYUV2PACKEDX_END
}
}
@@ -387,13 +393,13 @@ static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
"psraw $3, %%mm1 \n\t"
"psraw $3, %%mm7 \n\t"
"packuswb %%mm7, %%mm1 \n\t"
- WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
+ WRITEBGR32(%4, "%5", %%REGa, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
YSCALEYUV2PACKEDX_END
} else {
YSCALEYUV2PACKEDX
YSCALEYUV2RGBX
"pcmpeqd %%mm7, %%mm7 \n\t"
- WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
+ WRITEBGR32(%4, "%5", %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
YSCALEYUV2PACKEDX_END
}
}
@@ -422,7 +428,7 @@ static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
MOVNTQ(%%mm1, 8(dst, index, 2))\
\
"add $8, "#index" \n\t"\
- "cmp "#dstw", "#index" \n\t"\
+ "cmp "dstw", "#index" \n\t"\
" jb 1b \n\t"
#define WRITERGB16(dst, dstw, index) REAL_WRITERGB16(dst, dstw, index)
@@ -446,7 +452,7 @@ static void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter,
"paddusb "GREEN_DITHER"(%0), %%mm4\n\t"
"paddusb "RED_DITHER"(%0), %%mm5\n\t"
#endif
- WRITERGB16(%4, %5, %%REGa)
+ WRITERGB16(%4, "%5", %%REGa)
YSCALEYUV2PACKEDX_END
}
@@ -470,7 +476,7 @@ static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
"paddusb "GREEN_DITHER"(%0), %%mm4 \n\t"
"paddusb "RED_DITHER"(%0), %%mm5 \n\t"
#endif
- WRITERGB16(%4, %5, %%REGa)
+ WRITERGB16(%4, "%5", %%REGa)
YSCALEYUV2PACKEDX_END
}
@@ -499,7 +505,7 @@ static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
MOVNTQ(%%mm1, 8(dst, index, 2))\
\
"add $8, "#index" \n\t"\
- "cmp "#dstw", "#index" \n\t"\
+ "cmp "dstw", "#index" \n\t"\
" jb 1b \n\t"
#define WRITERGB15(dst, dstw, index) REAL_WRITERGB15(dst, dstw, index)
@@ -523,7 +529,7 @@ static void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter,
"paddusb "GREEN_DITHER"(%0), %%mm4\n\t"
"paddusb "RED_DITHER"(%0), %%mm5\n\t"
#endif
- WRITERGB15(%4, %5, %%REGa)
+ WRITERGB15(%4, "%5", %%REGa)
YSCALEYUV2PACKEDX_END
}
@@ -547,7 +553,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
"paddusb "GREEN_DITHER"(%0), %%mm4 \n\t"
"paddusb "RED_DITHER"(%0), %%mm5 \n\t"
#endif
- WRITERGB15(%4, %5, %%REGa)
+ WRITERGB15(%4, "%5", %%REGa)
YSCALEYUV2PACKEDX_END
}
@@ -601,7 +607,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
"add $24, "#dst" \n\t"\
\
"add $8, "#index" \n\t"\
- "cmp "#dstw", "#index" \n\t"\
+ "cmp "dstw", "#index" \n\t"\
" jb 1b \n\t"
#define WRITEBGR24MMXEXT(dst, dstw, index) \
@@ -649,7 +655,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
"add $24, "#dst" \n\t"\
\
"add $8, "#index" \n\t"\
- "cmp "#dstw", "#index" \n\t"\
+ "cmp "dstw", "#index" \n\t"\
" jb 1b \n\t"
#if COMPILE_TEMPLATE_MMXEXT
@@ -660,6 +666,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
#define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX(dst, dstw, index)
#endif
+#if HAVE_6REGS
static void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter,
const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
@@ -676,10 +683,11 @@ static void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter,
"pxor %%mm7, %%mm7 \n\t"
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_c"\n\t" //FIXME optimize
"add %4, %%"REG_c" \n\t"
- WRITEBGR24(%%REGc, %5, %%REGa)
+ WRITEBGR24(%%REGc, "%5", %%REGa)
:: "r" (&c->redDither),
"m" (dummy), "m" (dummy), "m" (dummy),
"r" (dest), "m" (dstW_reg), "m"(uv_off)
+ NAMED_CONSTRAINTS_ADD(ff_M24A,ff_M24C,ff_M24B)
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S
);
}
@@ -700,13 +708,15 @@ static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
"pxor %%mm7, %%mm7 \n\t"
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_c" \n\t" //FIXME optimize
"add %4, %%"REG_c" \n\t"
- WRITEBGR24(%%REGc, %5, %%REGa)
+ WRITEBGR24(%%REGc, "%5", %%REGa)
:: "r" (&c->redDither),
"m" (dummy), "m" (dummy), "m" (dummy),
"r" (dest), "m" (dstW_reg), "m"(uv_off)
+ NAMED_CONSTRAINTS_ADD(ff_M24A,ff_M24C,ff_M24B)
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S
);
}
+#endif /* HAVE_6REGS */
#define REAL_WRITEYUY2(dst, dstw, index) \
"packuswb %%mm3, %%mm3 \n\t"\
@@ -721,7 +731,7 @@ static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
MOVNTQ(%%mm7, 8(dst, index, 2))\
\
"add $8, "#index" \n\t"\
- "cmp "#dstw", "#index" \n\t"\
+ "cmp "dstw", "#index" \n\t"\
" jb 1b \n\t"
#define WRITEYUY2(dst, dstw, index) REAL_WRITEYUY2(dst, dstw, index)
@@ -742,7 +752,7 @@ static void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter,
"psraw $3, %%mm4 \n\t"
"psraw $3, %%mm1 \n\t"
"psraw $3, %%mm7 \n\t"
- WRITEYUY2(%4, %5, %%REGa)
+ WRITEYUY2(%4, "%5", %%REGa)
YSCALEYUV2PACKEDX_END
}
@@ -763,7 +773,7 @@ static void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter,
"psraw $3, %%mm4 \n\t"
"psraw $3, %%mm1 \n\t"
"psraw $3, %%mm7 \n\t"
- WRITEYUY2(%4, %5, %%REGa)
+ WRITEYUY2(%4, "%5", %%REGa)
YSCALEYUV2PACKEDX_END
}
@@ -864,7 +874,7 @@ static void RENAME(yuv2rgb32_2)(SwsContext *c, const int16_t *buf[2],
"psraw $3, %%mm1 \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
"psraw $3, %%mm7 \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
"packuswb %%mm7, %%mm1 \n\t"
- WRITEBGR32(%4, 8280(%5), %%r8, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
+ WRITEBGR32(%4, DSTW_OFFSET"(%5)", %%r8, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "r" (dest),
"a" (&c->redDither),
"r" (abuf0), "r" (abuf1)
@@ -888,7 +898,7 @@ static void RENAME(yuv2rgb32_2)(SwsContext *c, const int16_t *buf[2],
"packuswb %%mm7, %%mm1 \n\t"
"pop %1 \n\t"
"pop %0 \n\t"
- WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
+ WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
@@ -902,7 +912,7 @@ static void RENAME(yuv2rgb32_2)(SwsContext *c, const int16_t *buf[2],
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB(%%REGBP, %5)
"pcmpeqd %%mm7, %%mm7 \n\t"
- WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
+ WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
@@ -919,18 +929,18 @@ static void RENAME(yuv2bgr24_2)(SwsContext *c, const int16_t *buf[2],
const int16_t *buf0 = buf[0], *buf1 = buf[1],
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
- //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB(%%REGBP, %5)
"pxor %%mm7, %%mm7 \n\t"
- WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
+ WRITEBGR24(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither)
+ NAMED_CONSTRAINTS_ADD(ff_M24A,ff_M24C,ff_M24B)
);
}
@@ -942,7 +952,6 @@ static void RENAME(yuv2rgb555_2)(SwsContext *c, const int16_t *buf[2],
const int16_t *buf0 = buf[0], *buf1 = buf[1],
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
- //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
@@ -955,11 +964,12 @@ static void RENAME(yuv2rgb555_2)(SwsContext *c, const int16_t *buf[2],
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
- WRITERGB15(%%REGb, 8280(%5), %%REGBP)
+ WRITERGB15(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither)
+ NAMED_CONSTRAINTS_ADD(bF8)
);
}
@@ -971,7 +981,6 @@ static void RENAME(yuv2rgb565_2)(SwsContext *c, const int16_t *buf[2],
const int16_t *buf0 = buf[0], *buf1 = buf[1],
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
- //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
@@ -984,11 +993,12 @@ static void RENAME(yuv2rgb565_2)(SwsContext *c, const int16_t *buf[2],
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
- WRITERGB16(%%REGb, 8280(%5), %%REGBP)
+ WRITERGB16(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither)
+ NAMED_CONSTRAINTS_ADD(bF8,bFC)
);
}
@@ -1040,13 +1050,12 @@ static void RENAME(yuv2yuyv422_2)(SwsContext *c, const int16_t *buf[2],
const int16_t *buf0 = buf[0], *buf1 = buf[1],
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
- //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2PACKED(%%REGBP, %5)
- WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
+ WRITEYUY2(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
@@ -1189,7 +1198,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1(%%REGBP, %5)
YSCALEYUV2RGB1_ALPHA(%%REGBP)
- WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
+ WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (abuf0), "S" (ubuf0), "D" (ubuf1), "m" (dest),
@@ -1202,7 +1211,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1(%%REGBP, %5)
"pcmpeqd %%mm7, %%mm7 \n\t"
- WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
+ WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
@@ -1218,7 +1227,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1b(%%REGBP, %5)
YSCALEYUV2RGB1_ALPHA(%%REGBP)
- WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
+ WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (abuf0), "S" (ubuf0), "D" (ubuf1), "m" (dest),
@@ -1231,7 +1240,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1b(%%REGBP, %5)
"pcmpeqd %%mm7, %%mm7 \n\t"
- WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
+ WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
@@ -1257,11 +1266,12 @@ static void RENAME(yuv2bgr24_1)(SwsContext *c, const int16_t *buf0,
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1(%%REGBP, %5)
"pxor %%mm7, %%mm7 \n\t"
- WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
+ WRITEBGR24(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither)
+ NAMED_CONSTRAINTS_ADD(ff_M24A,ff_M24C,ff_M24B)
);
} else {
const int16_t *ubuf1 = ubuf[1];
@@ -1271,11 +1281,12 @@ static void RENAME(yuv2bgr24_1)(SwsContext *c, const int16_t *buf0,
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1b(%%REGBP, %5)
"pxor %%mm7, %%mm7 \n\t"
- WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
+ WRITEBGR24(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither)
+ NAMED_CONSTRAINTS_ADD(ff_M24A,ff_M24C,ff_M24B)
);
}
}
@@ -1302,11 +1313,12 @@ static void RENAME(yuv2rgb555_1)(SwsContext *c, const int16_t *buf0,
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
- WRITERGB15(%%REGb, 8280(%5), %%REGBP)
+ WRITERGB15(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither)
+ NAMED_CONSTRAINTS_ADD(bF8)
);
} else {
const int16_t *ubuf1 = ubuf[1];
@@ -1322,11 +1334,12 @@ static void RENAME(yuv2rgb555_1)(SwsContext *c, const int16_t *buf0,
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
- WRITERGB15(%%REGb, 8280(%5), %%REGBP)
+ WRITERGB15(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither)
+ NAMED_CONSTRAINTS_ADD(bF8)
);
}
}
@@ -1353,11 +1366,12 @@ static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0,
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
- WRITERGB16(%%REGb, 8280(%5), %%REGBP)
+ WRITERGB16(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither)
+ NAMED_CONSTRAINTS_ADD(bF8,bFC)
);
} else {
const int16_t *ubuf1 = ubuf[1];
@@ -1373,11 +1387,12 @@ static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0,
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
- WRITERGB16(%%REGb, 8280(%5), %%REGBP)
+ WRITERGB16(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither)
+ NAMED_CONSTRAINTS_ADD(bF8,bFC)
);
}
}
@@ -1434,7 +1449,7 @@ static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0,
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2PACKED1(%%REGBP, %5)
- WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
+ WRITEYUY2(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
@@ -1447,7 +1462,7 @@ static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0,
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2PACKED1b(%%REGBP, %5)
- WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
+ WRITEYUY2(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
@@ -1651,7 +1666,9 @@ static av_cold void RENAME(sws_init_swscale)(SwsContext *c)
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break;
+#if HAVE_6REGS
case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break;
+#endif
case AV_PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break;
case AV_PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break;
case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break;
@@ -1664,7 +1681,9 @@ static av_cold void RENAME(sws_init_swscale)(SwsContext *c)
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;
+#if HAVE_6REGS
case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;
+#endif
case AV_PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break;
case AV_PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break;
case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break;
diff --git a/chromium/third_party/ffmpeg/libswscale/x86/yuv2rgb.c b/chromium/third_party/ffmpeg/libswscale/x86/yuv2rgb.c
index e4315eff28f..5e2f77c20f0 100644
--- a/chromium/third_party/ffmpeg/libswscale/x86/yuv2rgb.c
+++ b/chromium/third_party/ffmpeg/libswscale/x86/yuv2rgb.c
@@ -34,6 +34,7 @@
#include "libswscale/swscale_internal.h"
#include "libavutil/attributes.h"
#include "libavutil/x86/asm.h"
+#include "libavutil/x86/cpu.h"
#include "libavutil/cpu.h"
#if HAVE_INLINE_ASM
@@ -49,32 +50,32 @@ DECLARE_ASM_CONST(8, uint64_t, pb_03) = 0x0303030303030303ULL;
DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL;
//MMX versions
-#if HAVE_MMX_INLINE
+#if HAVE_MMX_INLINE && HAVE_6REGS
#undef RENAME
#undef COMPILE_TEMPLATE_MMXEXT
#define COMPILE_TEMPLATE_MMXEXT 0
#define RENAME(a) a ## _mmx
#include "yuv2rgb_template.c"
-#endif /* HAVE_MMX_INLINE */
+#endif /* HAVE_MMX_INLINE && HAVE_6REGS */
// MMXEXT versions
-#if HAVE_MMXEXT_INLINE
+#if HAVE_MMXEXT_INLINE && HAVE_6REGS
#undef RENAME
#undef COMPILE_TEMPLATE_MMXEXT
#define COMPILE_TEMPLATE_MMXEXT 1
#define RENAME(a) a ## _mmxext
#include "yuv2rgb_template.c"
-#endif /* HAVE_MMXEXT_INLINE */
+#endif /* HAVE_MMXEXT_INLINE && HAVE_6REGS */
#endif /* HAVE_INLINE_ASM */
av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c)
{
-#if HAVE_MMX_INLINE
+#if HAVE_MMX_INLINE && HAVE_6REGS
int cpu_flags = av_get_cpu_flags();
#if HAVE_MMXEXT_INLINE
- if (cpu_flags & AV_CPU_FLAG_MMXEXT) {
+ if (INLINE_MMXEXT(cpu_flags)) {
switch (c->dstFormat) {
case AV_PIX_FMT_RGB24:
return yuv420_rgb24_mmxext;
@@ -84,7 +85,7 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c)
}
#endif
- if (cpu_flags & AV_CPU_FLAG_MMX) {
+ if (INLINE_MMX(cpu_flags)) {
switch (c->dstFormat) {
case AV_PIX_FMT_RGB32:
if (c->srcFormat == AV_PIX_FMT_YUVA420P) {
@@ -112,7 +113,7 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c)
return yuv420_rgb15_mmx;
}
}
-#endif /* HAVE_MMX_INLINE */
+#endif /* HAVE_MMX_INLINE && HAVE_6REGS */
return NULL;
}
diff --git a/chromium/third_party/ffmpeg/libswscale/x86/yuv2rgb_template.c b/chromium/third_party/ffmpeg/libswscale/x86/yuv2rgb_template.c
index c879102cc45..acb78f520e4 100644
--- a/chromium/third_party/ffmpeg/libswscale/x86/yuv2rgb_template.c
+++ b/chromium/third_party/ffmpeg/libswscale/x86/yuv2rgb_template.c
@@ -21,6 +21,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <stdint.h>
+
+#include "libavutil/x86/asm.h"
+#include "libswscale/swscale_internal.h"
+
#undef MOVNTQ
#undef EMMS
#undef SFENCE
@@ -134,10 +139,20 @@
"add $4, %0\n\t" \
"js 1b\n\t" \
+#if COMPILE_TEMPLATE_MMXEXT
+#undef RGB_PACK24_B_OPERANDS
+#define RGB_PACK24_B_OPERANDS NAMED_CONSTRAINTS_ARRAY_ADD(mask1101,mask0110,mask0100,mask0010,mask1001)
+#else
+#undef RGB_PACK24_B_OPERANDS
+#define RGB_PACK24_B_OPERANDS
+#endif
+
#define YUV2RGB_OPERANDS \
: "+r" (index), "+r" (image) \
: "r" (pu - index), "r" (pv - index), "r"(&c->redDither), \
"r" (py - 2*index) \
+ NAMED_CONSTRAINTS_ADD(mmx_00ffw,pb_03,pb_07,mmx_redmask,pb_e0) \
+ RGB_PACK24_B_OPERANDS \
: "memory" \
); \
} \
@@ -146,6 +161,7 @@
: "+r" (index), "+r" (image) \
: "r" (pu - index), "r" (pv - index), "r"(&c->redDither), \
"r" (py - 2*index), "r" (pa - 2*index) \
+ NAMED_CONSTRAINTS_ADD(mmx_00ffw) \
: "memory" \
); \
} \
diff --git a/chromium/third_party/ffmpeg/libswscale/yuv2rgb.c b/chromium/third_party/ffmpeg/libswscale/yuv2rgb.c
index 77c56a97722..b0bee4c8d84 100644
--- a/chromium/third_party/ffmpeg/libswscale/yuv2rgb.c
+++ b/chromium/third_party/ffmpeg/libswscale/yuv2rgb.c
@@ -605,8 +605,6 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
t = ff_yuv2rgb_init_bfin(c);
if (ARCH_PPC)
t = ff_yuv2rgb_init_ppc(c);
- if (HAVE_VIS)
- t = ff_yuv2rgb_init_vis(c);
if (ARCH_X86)
t = ff_yuv2rgb_init_x86(c);
diff --git a/chromium/third_party/ffmpeg/tools/aviocat.c b/chromium/third_party/ffmpeg/tools/aviocat.c
index e161d586030..56b918e44d4 100644
--- a/chromium/third_party/ffmpeg/tools/aviocat.c
+++ b/chromium/third_party/ffmpeg/tools/aviocat.c
@@ -26,13 +26,13 @@
static int usage(const char *argv0, int ret)
{
- fprintf(stderr, "%s [-b bytespersec] input_url output_url\n", argv0);
+ fprintf(stderr, "%s [-b bytespersec] [-d duration] input_url output_url\n", argv0);
return ret;
}
int main(int argc, char **argv)
{
- int bps = 0, ret, i;
+ int bps = 0, duration = 0, ret, i;
const char *input_url = NULL, *output_url = NULL;
int64_t stream_pos = 0;
int64_t start_time;
@@ -43,9 +43,12 @@ int main(int argc, char **argv)
avformat_network_init();
for (i = 1; i < argc; i++) {
- if (!strcmp(argv[i], "-b")) {
+ if (!strcmp(argv[i], "-b") && i + 1 < argc) {
bps = atoi(argv[i + 1]);
i++;
+ } else if (!strcmp(argv[i], "-d") && i + 1 < argc) {
+ duration = atoi(argv[i + 1]);
+ i++;
} else if (!input_url) {
input_url = argv[i];
} else if (!output_url) {
@@ -63,6 +66,15 @@ int main(int argc, char **argv)
fprintf(stderr, "Unable to open %s: %s\n", input_url, errbuf);
return 1;
}
+ if (duration && !bps) {
+ int64_t size = avio_size(input);
+ if (size < 0) {
+ av_strerror(ret, errbuf, sizeof(errbuf));
+ fprintf(stderr, "Unable to get size of %s: %s\n", input_url, errbuf);
+ goto fail;
+ }
+ bps = size / duration;
+ }
ret = avio_open2(&output, output_url, AVIO_FLAG_WRITE, NULL, NULL);
if (ret) {
av_strerror(ret, errbuf, sizeof(errbuf));
diff --git a/chromium/third_party/ffmpeg/tools/build_libstagefright b/chromium/third_party/ffmpeg/tools/build_libstagefright
index 8b3a0930f9c..22bb71225c8 100644
--- a/chromium/third_party/ffmpeg/tools/build_libstagefright
+++ b/chromium/third_party/ffmpeg/tools/build_libstagefright
@@ -6,8 +6,8 @@ if [ "$NDK" = "" ]; then
fi
echo "Fetching Android system headers"
-git clone --depth=1 --branch gingerbread-release git://github.com/CyanogenMod/android_frameworks_base.git ../android-source/frameworks/base
-git clone --depth=1 --branch gingerbread-release git://github.com/CyanogenMod/android_system_core.git ../android-source/system/core
+git clone --depth=1 --branch gingerbread-release https://github.com/CyanogenMod/android_frameworks_base.git ../android-source/frameworks/base
+git clone --depth=1 --branch gingerbread-release https://github.com/CyanogenMod/android_system_core.git ../android-source/system/core
echo "Fetching Android libraries for linking"
# Libraries from any froyo/gingerbread device/emulator should work
diff --git a/chromium/third_party/ffmpeg/tools/dvd2concat b/chromium/third_party/ffmpeg/tools/dvd2concat
new file mode 100755
index 00000000000..02371e09970
--- /dev/null
+++ b/chromium/third_party/ffmpeg/tools/dvd2concat
@@ -0,0 +1,127 @@
+#!/usr/bin/env perl
+
+# Copyright (c) 2014 Nicolas George
+#
+# 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
+
+=head1 NAME
+
+dvd2concat - create a concat script for a DVD title
+
+=head1 SYNOPSIS
+
+tools/dvd2concat I<path/to/dvd/structure> > I<file.concat>
+
+=head1 DESCRIPTION
+
+This script uses B<lsdvd> to produce concat script for a DVD title.
+The resulting script can be used to play the DVD using B<ffplay>, to
+transcode it using B<ffmpeg> or any other similar use.
+
+I<path/to/dvd/structure> is the path to the DVD structure hierarchy; it
+normally contains a directory named B<VIDEO_TS>. It must not be encrypted
+with CSS.
+
+I<file.concat> is the output file. It can be used a input to ffmpeg.
+It will require the B<-safe 0> option.
+
+=cut
+
+use strict;
+use warnings;
+use Getopt::Long ":config" => "require_order";
+use Pod::Usage;
+
+my $title;
+
+GetOptions (
+ "help|usage|?|h" => sub { pod2usage({ -verbose => 1, -exitval => 0 }) },
+ "manpage|m" => sub { pod2usage({ -verbose => 2, -exitval => 0 }) },
+ "title|t=i" => \$title,
+) and @ARGV == 1 or pod2usage({ -verbose => 1, -exitval => 1 });
+my ($path) = @ARGV;
+
+my $lsdvd_message =
+"Make sure your lsdvd version has the two following patches applied:\n" .
+"http://sourceforge.net/p/lsdvd/feature-requests/1/\n" .
+"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=603826\n";
+
+my $lsdvd = do {
+ open my $l, "-|", "lsdvd", "-Op", "-x", $path
+ or die "You need to install lsdvd for this script to work.\n$lsdvd_message";
+ local $/;
+ <$l>;
+};
+my %lsdvd = eval $lsdvd;
+die $@ if $@;
+
+if (!defined $title) {
+ $title = $lsdvd{longest_track};
+ warn "Using longest title $title\n";
+}
+my $track = $lsdvd{track}[$title - 1]
+ or die "Title $title does not exist (1-", scalar(@{$lsdvd{track}}), ")\n";
+my $vts_base = sprintf "%s/VIDEO_TS/VTS_%02d_", $path, $track->{vts};
+my @frag;
+for my $i (1 .. 9) {
+ my $file = sprintf "%s%d.VOB", $vts_base, $i;
+ my $size = -s $file or last;
+ push @frag, { file => $file, size => $size >> 11 };
+}
+
+my $concat = "ffconcat version 1.0\n";
+$concat .= "\nstream\nexact_stream_id 0x1E0\n";
+for my $audio (@{$track->{audio}}) {
+ $concat .= "\nstream\nexact_stream_id " . $audio->{streamid} . "\n";
+}
+for my $subp (@{$track->{subp}}) {
+ $concat .= "\nstream\nexact_stream_id " . $subp->{streamid} . "\n";
+}
+for my $cell (@{$track->{cell}}) {
+ my $off = $cell->{first_sector};
+ die "Your lsdvd version does not print cell sectors.\n$lsdvd_message"
+ unless defined $off;
+ my $size = $cell->{last_sector} + 1 - $cell->{first_sector};
+
+ my $frag = 0;
+ while ($frag < @frag) {
+ last if $off < $frag[$frag]->{size};
+ $off -= $frag[$frag++]->{size};
+ }
+ die "Cell beyond VOB data\n" unless $frag < @frag;
+ my $cur_off = $off;
+ my $cur_size = $size;
+ my @files;
+ while ($cur_size > $frag[$frag]->{size} - $cur_off) {
+ push @files, $frag[$frag]->{file};
+ $cur_size -= $frag[$frag]->{size} - $cur_off;
+ $cur_off = 0;
+ die "Cell end beyond VOB data\n" unless ++$frag < @frag;
+ }
+ push @files, $frag[$frag]->{file};
+ my $file = @files == 1 ? $files[0] : "concat:" . join("|", @files);
+ my $start = $off << 11;
+ my $end = ($off + $size) << 11;
+ $file = "subfile,,start,${start},end,${end},,:$file";
+
+ my $dur = int(1000 * $cell->{length});
+ $concat .= sprintf "\nfile '%s'\nduration %02d:%02d:%02d.%03d\n", $file,
+ int($dur / 3600000), int($dur / 60000) % 60, int($dur / 1000) % 60,
+ $dur % 1000;
+}
+
+print $concat;
diff --git a/chromium/third_party/ffmpeg/tools/ffhash.c b/chromium/third_party/ffmpeg/tools/ffhash.c
index 086d48a7ab5..a9f71c26c52 100644
--- a/chromium/third_party/ffmpeg/tools/ffhash.c
+++ b/chromium/third_party/ffmpeg/tools/ffhash.c
@@ -21,6 +21,7 @@
*/
#include "config.h"
+#include "libavutil/avstring.h"
#include "libavutil/error.h"
#include "libavutil/hash.h"
#include "libavutil/mem.h"
@@ -40,14 +41,14 @@
#define SIZE 65536
static struct AVHashContext *hash;
-static uint8_t *res;
+static int out_b64;
static void usage(void)
{
int i = 0;
const char *name;
- printf("usage: ffhash [algorithm] [input]...\n");
+ printf("usage: ffhash [b64:]algorithm [input]...\n");
printf("Supported hash algorithms:");
do {
name = av_hash_names(i);
@@ -60,12 +61,16 @@ static void usage(void)
static void finish(void)
{
- int i, len = av_hash_get_size(hash);
-
- printf("%s=0x", av_hash_get_name(hash));
- av_hash_final(hash, res);
- for (i = 0; i < len; i++)
- printf("%02x", res[i]);
+ char res[2 * AV_HASH_MAX_SIZE + 4];
+
+ printf("%s=", av_hash_get_name(hash));
+ if (out_b64) {
+ av_hash_final_b64(hash, res, sizeof(res));
+ printf("b64:%s", res);
+ } else {
+ av_hash_final_hex(hash, res, sizeof(res));
+ printf("0x%s", res);
+ }
}
static int check(char *file)
@@ -113,16 +118,19 @@ int main(int argc, char **argv)
{
int i;
int ret = 0;
+ const char *hash_name;
if (argc == 1) {
usage();
return 0;
}
- if ((ret = av_hash_alloc(&hash, argv[1])) < 0) {
+ hash_name = argv[1];
+ out_b64 = av_strstart(hash_name, "b64:", &hash_name);
+ if ((ret = av_hash_alloc(&hash, hash_name)) < 0) {
switch(ret) {
case AVERROR(EINVAL):
- printf("Invalid hash type: %s\n", argv[1]);
+ printf("Invalid hash type: %s\n", hash_name);
break;
case AVERROR(ENOMEM):
printf("%s\n", strerror(errno));
@@ -130,11 +138,6 @@ int main(int argc, char **argv)
}
return 1;
}
- res = av_malloc(av_hash_get_size(hash));
- if (!res) {
- printf("%s\n", strerror(errno));
- return 1;
- }
for (i = 2; i < argc; i++)
ret |= check(argv[i]);
@@ -143,7 +146,6 @@ int main(int argc, char **argv)
ret |= check(NULL);
av_hash_freep(&hash);
- av_freep(&res);
return ret;
}
diff --git a/chromium/third_party/ffmpeg/tools/gen-rc b/chromium/third_party/ffmpeg/tools/gen-rc
new file mode 100755
index 00000000000..d9ca37e9fff
--- /dev/null
+++ b/chromium/third_party/ffmpeg/tools/gen-rc
@@ -0,0 +1,121 @@
+#!/bin/sh
+#
+# Copyright (c) 2012 James Almer
+# Copyright (c) 2013 Tiancheng "Timothy" Gu
+#
+# 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
+
+## Help
+die() {
+ cat <<EOF >&2
+This script is used to generate Windows resources file for the FFmpeg libraries.
+The output .rc file is to be compiled by windres(1). It is mainly useful for
+FFmpeg developers to tweak and regenerate all resources files at once.
+
+Usage: $0 <libname> <comment>
+
+The script will output the file to '<libname>/<libname-without-lib>res.rc'.
+
+Example: $0 libavcodec 'FFmpeg codecs library'
+EOF
+ exit 1
+}
+
+# Script to generate all:
+# (to remove prefix '# ' and add 'tools/' as prefix: sed -r 's/^.{2}/tools\//')
+# gen-rc libavutil "FFmpeg utility library"
+# gen-rc libavcodec "FFmpeg codec library"
+# gen-rc libavformat "FFmpeg container format library"
+# gen-rc libavdevice "FFmpeg device handling library"
+# gen-rc libavfilter "FFmpeg audio/video filtering library"
+# gen-rc libpostproc "FFmpeg postprocessing library"
+# gen-rc libavresample "Libav audio resampling library"
+# gen-rc libswscale "FFmpeg image rescaling library"
+# gen-rc libswresample "FFmpeg audio resampling library"
+
+## Sanity checks and argument parsing
+if test $# -lt 2 || test $# -gt 3; then
+ die
+fi
+
+name=$1
+shortname=${name#lib}
+comment=$2
+capname=`echo $name | awk '{print toupper($0)}'`
+version=${capname}_VERSION
+
+mkdir -p "$name"
+output="$name/${shortname}res.rc"
+
+## REAL magic
+cat <<EOF > $output
+/*
+ * Windows resource file for $name
+ *
+ * Copyright (C) 2012 James Almer
+ * Copyright (C) 2013 Tiancheng "Timothy" Gu
+ *
+ * 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 <windows.h>
+#include "$name/version.h"
+#include "libavutil/ffversion.h"
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION ${version}_MAJOR, ${version}_MINOR, ${version}_MICRO, 0
+PRODUCTVERSION ${version}_MAJOR, ${version}_MINOR, ${version}_MICRO, 0
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+FILEOS VOS_NT_WINDOWS32
+FILETYPE VFT_DLL
+{
+ BLOCK "StringFileInfo"
+ {
+ BLOCK "040904B0"
+ {
+ VALUE "CompanyName", "FFmpeg Project"
+ VALUE "FileDescription", "$comment"
+ VALUE "FileVersion", AV_STRINGIFY($version)
+ VALUE "InternalName", "$name"
+ VALUE "LegalCopyright", "Copyright (C) 2000-" AV_STRINGIFY(CONFIG_THIS_YEAR) " FFmpeg Project"
+ VALUE "OriginalFilename", "$shortname" BUILDSUF "-" AV_STRINGIFY(${version}_MAJOR) SLIBSUF
+ VALUE "ProductName", "FFmpeg"
+ VALUE "ProductVersion", FFMPEG_VERSION
+ }
+ }
+
+ BLOCK "VarFileInfo"
+ {
+ VALUE "Translation", 0x0409, 0x04B0
+ }
+}
+EOF
diff --git a/chromium/third_party/ffmpeg/tools/ismindex.c b/chromium/third_party/ffmpeg/tools/ismindex.c
index 4dc3e125e37..759bc0f5a47 100644
--- a/chromium/third_party/ffmpeg/tools/ismindex.c
+++ b/chromium/third_party/ffmpeg/tools/ismindex.c
@@ -163,7 +163,7 @@ static int read_tfra(struct Tracks *tracks, int start_index, AVIOContext *f)
}
fieldlength = avio_rb32(f);
track->chunks = avio_rb32(f);
- track->offsets = av_mallocz(sizeof(*track->offsets) * track->chunks);
+ track->offsets = av_mallocz_array(track->chunks, sizeof(*track->offsets));
if (!track->offsets) {
ret = AVERROR(ENOMEM);
goto fail;
diff --git a/chromium/third_party/ffmpeg/tools/missing_codec_desc b/chromium/third_party/ffmpeg/tools/missing_codec_desc
index 093d02e02ee..e1d3d60b4f1 100755
--- a/chromium/third_party/ffmpeg/tools/missing_codec_desc
+++ b/chromium/third_party/ffmpeg/tools/missing_codec_desc
@@ -14,7 +14,6 @@ known_AV_CODEC_ID_NONE=1
known_AV_CODEC_ID_FIRST_AUDIO=1
known_AV_CODEC_ID_FIRST_SUBTITLE=1
known_AV_CODEC_ID_FIRST_UNKNOWN=1
-known_AV_CODEC_ID_TTF=1
known_AV_CODEC_ID_PROBE=1
known_AV_CODEC_ID_MPEG2TS=1
known_AV_CODEC_ID_MPEG4SYSTEMS=1
diff --git a/chromium/third_party/ffmpeg/tools/probetest.c b/chromium/third_party/ffmpeg/tools/probetest.c
index dd1a0bcabb0..b685e3d6c2d 100644
--- a/chromium/third_party/ffmpeg/tools/probetest.c
+++ b/chromium/third_party/ffmpeg/tools/probetest.c
@@ -110,6 +110,11 @@ int main(int argc, char **argv)
pd.buf = av_realloc(pd.buf, size + AVPROBE_PADDING_SIZE);
pd.filename = "";
+ if (!pd.buf) {
+ fprintf(stderr, "out of memory\n");
+ return 1;
+ }
+
memset(pd.buf, 0, size + AVPROBE_PADDING_SIZE);
fprintf(stderr, "testing size=%d\n", size);
diff --git a/chromium/third_party/ffmpeg/tools/qt-faststart.c b/chromium/third_party/ffmpeg/tools/qt-faststart.c
index cb36c4331ef..9cbabd9a8d2 100644
--- a/chromium/third_party/ffmpeg/tools/qt-faststart.c
+++ b/chromium/third_party/ffmpeg/tools/qt-faststart.c
@@ -37,14 +37,14 @@
#define ftello(x) _ftelli64(x)
#endif
-#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
+#define MIN(a,b) ((a) > (b) ? (b) : (a))
#define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])
-#define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \
- (((uint8_t*)(x))[1] << 16) | \
- (((uint8_t*)(x))[2] << 8) | \
- ((uint8_t*)(x))[3])
+#define BE_32(x) (((uint32_t)(((uint8_t*)(x))[0]) << 24) | \
+ (((uint8_t*)(x))[1] << 16) | \
+ (((uint8_t*)(x))[2] << 8) | \
+ ((uint8_t*)(x))[3])
#define BE_64(x) (((uint64_t)(((uint8_t*)(x))[0]) << 56) | \
((uint64_t)(((uint8_t*)(x))[1]) << 48) | \
@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
uint32_t atom_type = 0;
uint64_t atom_size = 0;
uint64_t atom_offset = 0;
- uint64_t last_offset;
+ int64_t last_offset;
unsigned char *moov_atom = NULL;
unsigned char *ftyp_atom = NULL;
uint64_t moov_atom_size;
@@ -102,7 +102,8 @@ int main(int argc, char *argv[])
int bytes_to_copy;
if (argc != 3) {
- printf("Usage: qt-faststart <infile.mov> <outfile.mov>\n");
+ printf("Usage: qt-faststart <infile.mov> <outfile.mov>\n"
+ "Note: alternatively you can use -movflags +faststart in ffmpeg\n");
return 0;
}
@@ -123,7 +124,7 @@ int main(int argc, char *argv[])
if (fread(atom_bytes, ATOM_PREAMBLE_SIZE, 1, infile) != 1) {
break;
}
- atom_size = (uint32_t) BE_32(&atom_bytes[0]);
+ atom_size = BE_32(&atom_bytes[0]);
atom_type = BE_32(&atom_bytes[4]);
/* keep ftyp atom */
@@ -136,9 +137,9 @@ int main(int argc, char *argv[])
atom_size);
goto error_out;
}
- if ( fseeko(infile, -ATOM_PREAMBLE_SIZE, SEEK_CUR)
- || fread(ftyp_atom, atom_size, 1, infile) != 1
- || (start_offset = ftello(infile))<0) {
+ if (fseeko(infile, -ATOM_PREAMBLE_SIZE, SEEK_CUR) ||
+ fread(ftyp_atom, atom_size, 1, infile) != 1 ||
+ (start_offset = ftello(infile)) < 0) {
perror(argv[1]);
goto error_out;
}
@@ -154,7 +155,7 @@ int main(int argc, char *argv[])
} else {
ret = fseeko(infile, atom_size - ATOM_PREAMBLE_SIZE, SEEK_CUR);
}
- if(ret) {
+ if (ret) {
perror(argv[1]);
goto error_out;
}
@@ -202,6 +203,10 @@ int main(int argc, char *argv[])
goto error_out;
}
last_offset = ftello(infile);
+ if (last_offset < 0) {
+ perror(argv[1]);
+ goto error_out;
+ }
moov_atom_size = atom_size;
moov_atom = malloc(moov_atom_size);
if (!moov_atom) {
@@ -229,18 +234,18 @@ int main(int argc, char *argv[])
atom_type = BE_32(&moov_atom[i]);
if (atom_type == STCO_ATOM) {
printf(" patching stco atom...\n");
- atom_size = (uint32_t)BE_32(&moov_atom[i - 4]);
+ atom_size = BE_32(&moov_atom[i - 4]);
if (i + atom_size - 4 > moov_atom_size) {
printf(" bad atom size\n");
goto error_out;
}
offset_count = BE_32(&moov_atom[i + 8]);
- if (i + 12LL + offset_count * 4LL > moov_atom_size) {
- printf(" bad atom size\n");
+ if (i + 12 + offset_count * UINT64_C(4) > moov_atom_size) {
+ printf(" bad atom size/element count\n");
goto error_out;
}
for (j = 0; j < offset_count; j++) {
- current_offset = (uint32_t)BE_32(&moov_atom[i + 12 + j * 4]);
+ current_offset = BE_32(&moov_atom[i + 12 + j * 4]);
current_offset += moov_atom_size;
moov_atom[i + 12 + j * 4 + 0] = (current_offset >> 24) & 0xFF;
moov_atom[i + 12 + j * 4 + 1] = (current_offset >> 16) & 0xFF;
@@ -250,14 +255,14 @@ int main(int argc, char *argv[])
i += atom_size - 4;
} else if (atom_type == CO64_ATOM) {
printf(" patching co64 atom...\n");
- atom_size = (uint32_t)BE_32(&moov_atom[i - 4]);
+ atom_size = BE_32(&moov_atom[i - 4]);
if (i + atom_size - 4 > moov_atom_size) {
printf(" bad atom size\n");
goto error_out;
}
offset_count = BE_32(&moov_atom[i + 8]);
- if (i + 12LL + offset_count * 8LL > moov_atom_size) {
- printf(" bad atom size\n");
+ if (i + 12 + offset_count * UINT64_C(8) > moov_atom_size) {
+ printf(" bad atom size/element count\n");
goto error_out;
}
for (j = 0; j < offset_count; j++) {
@@ -315,7 +320,7 @@ int main(int argc, char *argv[])
}
/* copy the remainder of the infile, from offset 0 -> last_offset - 1 */
- bytes_to_copy = FFMIN(COPY_BUFFER_SIZE, last_offset);
+ bytes_to_copy = MIN(COPY_BUFFER_SIZE, last_offset);
copy_buffer = malloc(bytes_to_copy);
if (!copy_buffer) {
printf("could not allocate %d bytes for copy_buffer\n", bytes_to_copy);
@@ -323,7 +328,7 @@ int main(int argc, char *argv[])
}
printf(" copying rest of file...\n");
while (last_offset) {
- bytes_to_copy = FFMIN(bytes_to_copy, last_offset);
+ bytes_to_copy = MIN(bytes_to_copy, last_offset);
if (fread(copy_buffer, bytes_to_copy, 1, infile) != 1) {
perror(argv[1]);
diff --git a/chromium/third_party/ffmpeg/tools/uncoded_frame.c b/chromium/third_party/ffmpeg/tools/uncoded_frame.c
new file mode 100644
index 00000000000..53e71eacbf2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/tools/uncoded_frame.c
@@ -0,0 +1,279 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "libavutil/avassert.h"
+#include "libavdevice/avdevice.h"
+#include "libavfilter/avfilter.h"
+#include "libavfilter/buffersink.h"
+#include "libavformat/avformat.h"
+
+typedef struct {
+ AVFormatContext *mux;
+ AVStream *stream;
+ AVFilterContext *sink;
+ AVFilterLink *link;
+} Stream;
+
+static int create_sink(Stream *st, AVFilterGraph *graph,
+ AVFilterContext *f, int idx)
+{
+ enum AVMediaType type = avfilter_pad_get_type(f->output_pads, idx);
+ const char *sink_name;
+ int ret;
+
+ switch (type) {
+ case AVMEDIA_TYPE_VIDEO: sink_name = "buffersink"; break;
+ case AVMEDIA_TYPE_AUDIO: sink_name = "abuffersink"; break;
+ default:
+ av_log(NULL, AV_LOG_ERROR, "Stream type not supported\n");
+ return AVERROR(EINVAL);
+ }
+ ret = avfilter_graph_create_filter(&st->sink,
+ avfilter_get_by_name(sink_name),
+ NULL, NULL, NULL, graph);
+ if (ret < 0)
+ return ret;
+ ret = avfilter_link(f, idx, st->sink, 0);
+ if (ret < 0)
+ return ret;
+ st->link = st->sink->inputs[0];
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ char *in_graph_desc, **out_dev_name;
+ int nb_out_dev = 0, nb_streams = 0;
+ AVFilterGraph *in_graph = NULL;
+ Stream *streams = NULL, *st;
+ AVFrame *frame = NULL;
+ int i, j, run = 1, ret;
+
+ //av_log_set_level(AV_LOG_DEBUG);
+
+ if (argc < 3) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Usage: %s filter_graph dev:out [dev2:out2...]\n\n"
+ "Examples:\n"
+ "%s movie=file.nut:s=v+a xv:- alsa:default\n"
+ "%s movie=file.nut:s=v+a uncodedframecrc:pipe:0\n",
+ argv[0], argv[0], argv[0]);
+ exit(1);
+ }
+ in_graph_desc = argv[1];
+ out_dev_name = argv + 2;
+ nb_out_dev = argc - 2;
+
+ av_register_all();
+ avdevice_register_all();
+ avfilter_register_all();
+
+ /* Create input graph */
+ if (!(in_graph = avfilter_graph_alloc())) {
+ ret = AVERROR(ENOMEM);
+ av_log(NULL, AV_LOG_ERROR, "Unable to alloc graph graph: %s\n",
+ av_err2str(ret));
+ goto fail;
+ }
+ ret = avfilter_graph_parse_ptr(in_graph, in_graph_desc, NULL, NULL, NULL);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Unable to parse graph: %s\n",
+ av_err2str(ret));
+ goto fail;
+ }
+ nb_streams = 0;
+ for (i = 0; i < in_graph->nb_filters; i++) {
+ AVFilterContext *f = in_graph->filters[i];
+ for (j = 0; j < f->nb_inputs; j++) {
+ if (!f->inputs[j]) {
+ av_log(NULL, AV_LOG_ERROR, "Graph has unconnected inputs\n");
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+ }
+ for (j = 0; j < f->nb_outputs; j++)
+ if (!f->outputs[j])
+ nb_streams++;
+ }
+ if (!nb_streams) {
+ av_log(NULL, AV_LOG_ERROR, "Graph has no output stream\n");
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+ if (nb_out_dev != 1 && nb_out_dev != nb_streams) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Graph has %d output streams, %d devices given\n",
+ nb_streams, nb_out_dev);
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+
+ if (!(streams = av_calloc(nb_streams, sizeof(*streams)))) {
+ ret = AVERROR(ENOMEM);
+ av_log(NULL, AV_LOG_ERROR, "Could not allocate streams\n");
+ }
+ st = streams;
+ for (i = 0; i < in_graph->nb_filters; i++) {
+ AVFilterContext *f = in_graph->filters[i];
+ for (j = 0; j < f->nb_outputs; j++) {
+ if (!f->outputs[j]) {
+ if ((ret = create_sink(st++, in_graph, f, j)) < 0)
+ goto fail;
+ }
+ }
+ }
+ av_assert0(st - streams == nb_streams);
+ if ((ret = avfilter_graph_config(in_graph, NULL)) < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Failed to configure graph\n");
+ goto fail;
+ }
+
+ /* Create output devices */
+ for (i = 0; i < nb_out_dev; i++) {
+ char *fmt = NULL, *dev = out_dev_name[i];
+ st = &streams[i];
+ if ((dev = strchr(dev, ':'))) {
+ *(dev++) = 0;
+ fmt = out_dev_name[i];
+ }
+ ret = avformat_alloc_output_context2(&st->mux, NULL, fmt, dev);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Failed to allocate output: %s\n",
+ av_err2str(ret));
+ goto fail;
+ }
+ if (!(st->mux->oformat->flags & AVFMT_NOFILE)) {
+ ret = avio_open2(&st->mux->pb, st->mux->filename, AVIO_FLAG_WRITE,
+ NULL, NULL);
+ if (ret < 0) {
+ av_log(st->mux, AV_LOG_ERROR, "Failed to init output: %s\n",
+ av_err2str(ret));
+ goto fail;
+ }
+ }
+ }
+ for (; i < nb_streams; i++)
+ streams[i].mux = streams[0].mux;
+
+ /* Create output device streams */
+ for (i = 0; i < nb_streams; i++) {
+ st = &streams[i];
+ if (!(st->stream = avformat_new_stream(st->mux, NULL))) {
+ ret = AVERROR(ENOMEM);
+ av_log(NULL, AV_LOG_ERROR, "Failed to create output stream\n");
+ goto fail;
+ }
+ st->stream->codec->codec_type = st->link->type;
+ st->stream->time_base = st->stream->codec->time_base =
+ st->link->time_base;
+ switch (st->link->type) {
+ case AVMEDIA_TYPE_VIDEO:
+ st->stream->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
+ st->stream->avg_frame_rate =
+ st->stream-> r_frame_rate = av_buffersink_get_frame_rate(st->sink);
+ st->stream->codec->width = st->link->w;
+ st->stream->codec->height = st->link->h;
+ st->stream->codec->sample_aspect_ratio = st->link->sample_aspect_ratio;
+ st->stream->codec->pix_fmt = st->link->format;
+ break;
+ case AVMEDIA_TYPE_AUDIO:
+ st->stream->codec->channel_layout = st->link->channel_layout;
+ st->stream->codec->channels = avfilter_link_get_channels(st->link);
+ st->stream->codec->sample_rate = st->link->sample_rate;
+ st->stream->codec->sample_fmt = st->link->format;
+ st->stream->codec->codec_id =
+ av_get_pcm_codec(st->stream->codec->sample_fmt, -1);
+ break;
+ default:
+ av_assert0(!"reached");
+ }
+ }
+
+ /* Init output devices */
+ for (i = 0; i < nb_out_dev; i++) {
+ st = &streams[i];
+ if ((ret = avformat_write_header(st->mux, NULL)) < 0) {
+ av_log(st->mux, AV_LOG_ERROR, "Failed to init output: %s\n",
+ av_err2str(ret));
+ goto fail;
+ }
+ }
+
+ /* Check output devices */
+ for (i = 0; i < nb_streams; i++) {
+ st = &streams[i];
+ ret = av_write_uncoded_frame_query(st->mux, st->stream->index);
+ if (ret < 0) {
+ av_log(st->mux, AV_LOG_ERROR,
+ "Uncoded frames not supported on stream #%d: %s\n",
+ i, av_err2str(ret));
+ goto fail;
+ }
+ }
+
+ while (run) {
+ ret = avfilter_graph_request_oldest(in_graph);
+ if (ret < 0) {
+ if (ret == AVERROR_EOF) {
+ run = 0;
+ } else {
+ av_log(NULL, AV_LOG_ERROR, "Error filtering: %s\n",
+ av_err2str(ret));
+ break;
+ }
+ }
+ for (i = 0; i < nb_streams; i++) {
+ st = &streams[i];
+ while (1) {
+ if (!frame && !(frame = av_frame_alloc())) {
+ ret = AVERROR(ENOMEM);
+ av_log(NULL, AV_LOG_ERROR, "Could not allocate frame\n");
+ goto fail;
+ }
+ ret = av_buffersink_get_frame_flags(st->sink, frame,
+ AV_BUFFERSINK_FLAG_NO_REQUEST);
+ if (ret < 0) {
+ if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
+ av_log(NULL, AV_LOG_WARNING, "Error in sink: %s\n",
+ av_err2str(ret));
+ break;
+ }
+ if (frame->pts != AV_NOPTS_VALUE)
+ frame->pts = av_rescale_q(frame->pts,
+ st->link ->time_base,
+ st->stream->time_base);
+ ret = av_interleaved_write_uncoded_frame(st->mux,
+ st->stream->index,
+ frame);
+ frame = NULL;
+ if (ret < 0) {
+ av_log(st->stream->codec, AV_LOG_ERROR,
+ "Error writing frame: %s\n", av_err2str(ret));
+ goto fail;
+ }
+ }
+ }
+ }
+ ret = 0;
+
+ for (i = 0; i < nb_out_dev; i++) {
+ st = &streams[i];
+ av_write_trailer(st->mux);
+ }
+
+fail:
+ av_frame_free(&frame);
+ avfilter_graph_free(&in_graph);
+ if (streams) {
+ for (i = 0; i < nb_out_dev; i++) {
+ st = &streams[i];
+ if (st->mux) {
+ if (st->mux->pb)
+ avio_close(st->mux->pb);
+ avformat_free_context(st->mux);
+ }
+ }
+ }
+ av_freep(&streams);
+ return ret < 0;
+}
diff --git a/chromium/third_party/ffmpeg/tools/zmqsend.c b/chromium/third_party/ffmpeg/tools/zmqsend.c
index ae3c8d7aa40..d47bf216b47 100644
--- a/chromium/third_party/ffmpeg/tools/zmqsend.c
+++ b/chromium/third_party/ffmpeg/tools/zmqsend.c
@@ -54,7 +54,7 @@ int main(int argc, char **argv)
AVBPrint src;
char c, *src_buf, *recv_buf;
int recv_buf_size, ret;
- void *ctx, *socket;
+ void *zmq_ctx, *socket;
const char *bind_address = "tcp://localhost:5555";
const char *infilename = NULL;
FILE *infile = NULL;
@@ -88,23 +88,23 @@ int main(int argc, char **argv)
return 1;
}
- ctx = zmq_ctx_new();
- if (!ctx) {
+ zmq_ctx = zmq_ctx_new();
+ if (!zmq_ctx) {
av_log(NULL, AV_LOG_ERROR,
"Could not create ZMQ context: %s\n", zmq_strerror(errno));
return 1;
}
- socket = zmq_socket(ctx, ZMQ_REQ);
+ socket = zmq_socket(zmq_ctx, ZMQ_REQ);
if (!socket) {
- av_log(ctx, AV_LOG_ERROR,
+ av_log(NULL, AV_LOG_ERROR,
"Could not create ZMQ socket: %s\n", zmq_strerror(errno));
ret = 1;
goto end;
}
if (zmq_connect(socket, bind_address) == -1) {
- av_log(ctx, AV_LOG_ERROR, "Could not bind ZMQ responder to address '%s': %s\n",
+ av_log(NULL, AV_LOG_ERROR, "Could not bind ZMQ responder to address '%s': %s\n",
bind_address, zmq_strerror(errno));
ret = 1;
goto end;
@@ -131,14 +131,14 @@ int main(int argc, char **argv)
}
if (zmq_msg_init(&msg) == -1) {
- av_log(ctx, AV_LOG_ERROR,
+ av_log(NULL, AV_LOG_ERROR,
"Could not initialize receiving message: %s\n", zmq_strerror(errno));
ret = 1;
goto end;
}
if (zmq_msg_recv(&msg, socket, 0) == -1) {
- av_log(ctx, AV_LOG_ERROR,
+ av_log(NULL, AV_LOG_ERROR,
"Could not receive message: %s\n", zmq_strerror(errno));
zmq_msg_close(&msg);
ret = 1;
@@ -148,7 +148,7 @@ int main(int argc, char **argv)
recv_buf_size = zmq_msg_size(&msg) + 1;
recv_buf = av_malloc(recv_buf_size);
if (!recv_buf) {
- av_log(ctx, AV_LOG_ERROR,
+ av_log(NULL, AV_LOG_ERROR,
"Could not allocate receiving message buffer\n");
zmq_msg_close(&msg);
ret = 1;
@@ -162,6 +162,6 @@ int main(int argc, char **argv)
end:
zmq_close(socket);
- zmq_ctx_destroy(ctx);
+ zmq_ctx_destroy(zmq_ctx);
return ret;
}